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-dialog/dxc-dialog.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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.
Expand All @@ -90,18 +74,19 @@ 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<void> = new EventEmitter<void>();

@HostBinding("class") className;

currentBackgroundColor: string;

defaultInputs = new BehaviorSubject<any>({
defaultInputs = new BehaviorSubject<DialogProperties>({
overlay: true,
isCloseVisible: true,
padding: "small",
margin: null,
tabIndexValue: 0,
});

Expand Down
23 changes: 23 additions & 0 deletions projects/dxc-ngx-cdk/src/lib/dxc-dialog/dxc-dialog.types.ts
Original file line number Diff line number Diff line change
@@ -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;
};