Skip to content

Commit 341542e

Browse files
authored
Merge pull request #787 from dxc-technology/progressbar-types-interface
Added types file to progressbar
2 parents 88e3367 + d2a6777 commit 341542e

File tree

2 files changed

+32
-18
lines changed

2 files changed

+32
-18
lines changed

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

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,7 @@ import { css } from "emotion";
33
import { BehaviorSubject } from "rxjs";
44
import { CssUtils } from "../utils";
55
import { coerceBooleanProperty } from "@angular/cdk/coercion";
6-
7-
type Space =
8-
| "xxsmall"
9-
| "xsmall"
10-
| "small"
11-
| "medium"
12-
| "large"
13-
| "xlarge"
14-
| "xxlarge";
15-
16-
type Margin = {
17-
top?: Space;
18-
bottom?: Space;
19-
left?: Space;
20-
right?: Space;
21-
};
6+
import { ProgressBarProperties, Space, Spacing } from "./dxc-progressbar.types";
227

238
@Component({
249
selector: "dxc-progressbar",
@@ -69,15 +54,20 @@ export class DxcProgressbarComponent {
6954
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
7055
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
7156
*/
72-
@Input() margin: Space | Margin;
57+
@Input() margin: Space | Spacing;
7358

7459
@HostBinding("class") className;
7560
@HostBinding("class.absolute") isAbsolute: boolean = false;
7661

7762
mode: string = "indeterminate";
7863

79-
defaultInputs = new BehaviorSubject<any>({
64+
defaultInputs = new BehaviorSubject<ProgressBarProperties>({
8065
overlay: false,
66+
margin: null,
67+
value: null,
68+
label: null,
69+
helperText: null,
70+
showValue: false,
8171
});
8272

8373
constructor(private utils: CssUtils) {}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
export interface ProgressBarProperties {
2+
margin?: Space | Spacing;
3+
value?: number;
4+
label?: string;
5+
helperText?: string;
6+
showValue?: boolean;
7+
overlay?: boolean;
8+
}
9+
10+
export type Space =
11+
| "xxsmall"
12+
| "xsmall"
13+
| "small"
14+
| "medium"
15+
| "large"
16+
| "xlarge"
17+
| "xxlarge";
18+
19+
export type Spacing = {
20+
top?: Space;
21+
bottom?: Space;
22+
left?: Space;
23+
right?: Space;
24+
};

0 commit comments

Comments
 (0)