Skip to content

Commit e456edc

Browse files
authored
Merge pull request #782 from dxc-technology/sidenav-types-interface
Added types file in sidenav
2 parents 6778f87 + f5c1856 commit e456edc

File tree

2 files changed

+22
-18
lines changed

2 files changed

+22
-18
lines changed

projects/dxc-ngx-cdk/src/lib/dxc-sidenav/dxc-sidenav.component.ts

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,8 @@ import { BehaviorSubject } from "rxjs";
1313
import { css } from "emotion";
1414
import { CssUtils } from "../utils";
1515
import { BackgroundProviderService } from "../background-provider/service/background-provider.service";
16+
import { SidenavProperties, Space, Spacing } from "./dxc-sidenav.types";
1617

17-
type Space =
18-
| "xxsmall"
19-
| "xsmall"
20-
| "small"
21-
| "medium"
22-
| "large"
23-
| "xlarge"
24-
| "xxlarge";
25-
26-
type Padding = {
27-
top?: Space;
28-
bottom?: Space;
29-
left?: Space;
30-
right?: Space;
31-
};
3218
@Component({
3319
selector: "dxc-sidenav",
3420
templateUrl: "./dxc-sidenav.component.html",
@@ -41,14 +27,13 @@ export class DxcSidenavComponent implements OnInit {
4127
* Size of the padding to be applied to the custom area ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
4228
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
4329
*/
44-
@Input() padding: Space | Padding;
30+
@Input() padding: Space | Spacing;
4531

4632
firstClick: boolean = false; //remove animation on first load
4733

4834
currentBackgroundColor: string;
4935

50-
defaultInputs = new BehaviorSubject<any>({
51-
displayArrow: true,
36+
defaultInputs = new BehaviorSubject<SidenavProperties>({
5237
padding: null,
5338
});
5439

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
export interface SidenavProperties {
2+
padding?: Space | Spacing;
3+
}
4+
5+
export type Space =
6+
| "xxsmall"
7+
| "xsmall"
8+
| "small"
9+
| "medium"
10+
| "large"
11+
| "xlarge"
12+
| "xxlarge";
13+
14+
export type Spacing = {
15+
top?: Space;
16+
bottom?: Space;
17+
left?: Space;
18+
right?: Space;
19+
};

0 commit comments

Comments
 (0)