diff --git a/projects/dxc-ngx-cdk/src/lib/dxc-tabs/dxc-tabs.component.ts b/projects/dxc-ngx-cdk/src/lib/dxc-tabs/dxc-tabs.component.ts index f5c5a9635..91af98aa8 100644 --- a/projects/dxc-ngx-cdk/src/lib/dxc-tabs/dxc-tabs.component.ts +++ b/projects/dxc-ngx-cdk/src/lib/dxc-tabs/dxc-tabs.component.ts @@ -21,6 +21,7 @@ import { MAT_RIPPLE_GLOBAL_OPTIONS, RippleGlobalOptions, } from "@angular/material/core"; +import { TabsProperties, Spacing, Space } from "./dxc-tabs.types"; const globalRippleConfig: RippleGlobalOptions = { animation: { @@ -29,22 +30,6 @@ const globalRippleConfig: RippleGlobalOptions = { }, }; -type Space = - | "xxsmall" - | "xsmall" - | "small" - | "medium" - | "large" - | "xlarge" - | "xxlarge"; - -type Margin = { - top?: Space; - bottom?: Space; - left?: Space; - right?: Space; -}; - @Component({ selector: "dxc-tabs", templateUrl: "./dxc-tabs.component.html", @@ -75,11 +60,11 @@ export class DxcTabsComponent implements OnChanges { /** * Size of the margin to be applied to the component - * ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge'). - * You can pass an object with 'top', 'bottom', 'left' and 'right' properties + * ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge'). + * You can pass an object with 'top', 'bottom', 'left' and 'right' properties * in order to specify different margin sizes. */ - @Input() margin: Space | Margin; + @Input() margin: Space | Spacing; @HostBinding("class") className; @HostBinding("class.label-icons") allTabWithLabelAndIcon: boolean = false; @@ -94,7 +79,7 @@ export class DxcTabsComponent implements OnChanges { @ContentChildren(DxcTabComponent) protected tabs: QueryList; - defaultInputs = new BehaviorSubject({ + defaultInputs = new BehaviorSubject({ activeTabIndex: 0, iconPosition: "left", margin: null, diff --git a/projects/dxc-ngx-cdk/src/lib/dxc-tabs/dxc-tabs.types.ts b/projects/dxc-ngx-cdk/src/lib/dxc-tabs/dxc-tabs.types.ts new file mode 100644 index 000000000..82765c554 --- /dev/null +++ b/projects/dxc-ngx-cdk/src/lib/dxc-tabs/dxc-tabs.types.ts @@ -0,0 +1,21 @@ +export type Space = + | "xxsmall" + | "xsmall" + | "small" + | "medium" + | "large" + | "xlarge" + | "xxlarge"; + +export type Spacing = { + top?: Space; + bottom?: Space; + left?: Space; + right?: Space; +}; + +export interface TabsProperties { + activeTabIndex?: number; + iconPosition?: "top" | "left"; + margin?: Space | Spacing; +}