Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 5 additions & 20 deletions projects/dxc-ngx-cdk/src/lib/dxc-tabs/dxc-tabs.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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",
Expand Down Expand Up @@ -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;
Expand All @@ -94,7 +79,7 @@ export class DxcTabsComponent implements OnChanges {
@ContentChildren(DxcTabComponent)
protected tabs: QueryList<DxcTabComponent>;

defaultInputs = new BehaviorSubject<any>({
defaultInputs = new BehaviorSubject<TabsProperties>({
activeTabIndex: 0,
iconPosition: "left",
margin: null,
Expand Down
21 changes: 21 additions & 0 deletions projects/dxc-ngx-cdk/src/lib/dxc-tabs/dxc-tabs.types.ts
Original file line number Diff line number Diff line change
@@ -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;
}