Skip to content

Commit 81f646e

Browse files
authored
Merge pull request #795 from dxc-technology/dialog-types-interface
Added types file in dialog
2 parents a613359 + 4a00c78 commit 81f646e

File tree

2 files changed

+28
-20
lines changed

2 files changed

+28
-20
lines changed

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

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,7 @@ import {
1414
coerceNumberProperty,
1515
} from "@angular/cdk/coercion";
1616
import { BackgroundProviderService } from "../background-provider/service/background-provider.service";
17-
18-
type Space =
19-
| "xxsmall"
20-
| "xsmall"
21-
| "small"
22-
| "medium"
23-
| "large"
24-
| "xlarge"
25-
| "xxlarge";
26-
;
27-
28-
type Padding = {
29-
top?: Space;
30-
bottom?: Space;
31-
left?: Space;
32-
right?: Space;
33-
};
17+
import { DialogProperties, Space, Spacing } from "./dxc-dialog.types";
3418

3519
@Component({
3620
selector: "dxc-dialog",
@@ -68,7 +52,7 @@ export class DxcDialogComponent {
6852
* object with 'top', 'bottom', 'left' and 'right' to
6953
* specify different padding sizes.
7054
*/
71-
@Input() padding: Space | Padding = "small";
55+
@Input() padding: Space | Spacing = "small";
7256

7357
/**
7458
* Value of the tabindex given to the close button.
@@ -90,18 +74,19 @@ export class DxcDialogComponent {
9074

9175
/**
9276
* This event will emit when the user clicks the background.
93-
* The responsibility of hiding the dialog lies with the user.
77+
* The responsibility of hiding the dialog lies with the user.
9478
* */
9579
@Output() onBackgroundClick: EventEmitter<void> = new EventEmitter<void>();
9680

9781
@HostBinding("class") className;
9882

9983
currentBackgroundColor: string;
10084

101-
defaultInputs = new BehaviorSubject<any>({
85+
defaultInputs = new BehaviorSubject<DialogProperties>({
10286
overlay: true,
10387
isCloseVisible: true,
10488
padding: "small",
89+
margin: null,
10590
tabIndexValue: 0,
10691
});
10792

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

0 commit comments

Comments
 (0)