diff --git a/projects/dxc-ngx-cdk/src/lib/dxc-dialog/dxc-dialog.component.ts b/projects/dxc-ngx-cdk/src/lib/dxc-dialog/dxc-dialog.component.ts index 8ffe9e612..4842a8872 100644 --- a/projects/dxc-ngx-cdk/src/lib/dxc-dialog/dxc-dialog.component.ts +++ b/projects/dxc-ngx-cdk/src/lib/dxc-dialog/dxc-dialog.component.ts @@ -14,23 +14,7 @@ import { coerceNumberProperty, } from "@angular/cdk/coercion"; import { BackgroundProviderService } from "../background-provider/service/background-provider.service"; - -type Space = - | "xxsmall" - | "xsmall" - | "small" - | "medium" - | "large" - | "xlarge" - | "xxlarge"; -; - -type Padding = { - top?: Space; - bottom?: Space; - left?: Space; - right?: Space; -}; +import { DialogProperties, Space, Spacing } from "./dxc-dialog.types"; @Component({ selector: "dxc-dialog", @@ -68,7 +52,7 @@ export class DxcDialogComponent { * object with 'top', 'bottom', 'left' and 'right' to * specify different padding sizes. */ - @Input() padding: Space | Padding = "small"; + @Input() padding: Space | Spacing = "small"; /** * Value of the tabindex given to the close button. @@ -90,7 +74,7 @@ export class DxcDialogComponent { /** * This event will emit when the user clicks the background. - * The responsibility of hiding the dialog lies with the user. + * The responsibility of hiding the dialog lies with the user. * */ @Output() onBackgroundClick: EventEmitter = new EventEmitter(); @@ -98,10 +82,11 @@ export class DxcDialogComponent { currentBackgroundColor: string; - defaultInputs = new BehaviorSubject({ + defaultInputs = new BehaviorSubject({ overlay: true, isCloseVisible: true, padding: "small", + margin: null, tabIndexValue: 0, }); diff --git a/projects/dxc-ngx-cdk/src/lib/dxc-dialog/dxc-dialog.types.ts b/projects/dxc-ngx-cdk/src/lib/dxc-dialog/dxc-dialog.types.ts new file mode 100644 index 000000000..7fcb8a29a --- /dev/null +++ b/projects/dxc-ngx-cdk/src/lib/dxc-dialog/dxc-dialog.types.ts @@ -0,0 +1,23 @@ +export interface DialogProperties { + margin?: Space | Spacing; + overlay?: boolean; + isCloseVisible?: boolean; + padding?: Space | Spacing; + tabIndexValue?: number; +} + +export type Space = + | "xxsmall" + | "xsmall" + | "small" + | "medium" + | "large" + | "xlarge" + | "xxlarge"; + +export type Spacing = { + top?: Space; + bottom?: Space; + left?: Space; + right?: Space; +};