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
7 changes: 3 additions & 4 deletions projects/dxc-ngx-cdk/src/lib/dxc-alert/dxc-alert.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
Output,
EventEmitter,
ViewChild,
ElementRef,
SimpleChanges,
} from "@angular/core";
import { BehaviorSubject } from "rxjs";
Expand All @@ -15,7 +14,7 @@ import { CssUtils } from "../utils";
import { coerceNumberProperty } from "@angular/cdk/coercion";
import { BackgroundProviderService } from "../background-provider/service/background-provider.service";
import { BackgroundProviderInnerComponent } from "../background-provider/background-provider-inner.component";
import { Margin, Space } from "./dxc-alert.types";
import { Spacing, Space, AlertProperties } from "./dxc-alert.types";

@Component({
selector: "dxc-alert",
Expand Down Expand Up @@ -70,7 +69,7 @@ export class DxcAlertComponent implements OnChanges {
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties
* in order to specify different margin sizes.
*/
@Input() margin: Space | Margin;
@Input() margin: Space | Spacing;

/**
* Size of the component.
Expand All @@ -95,7 +94,7 @@ export class DxcAlertComponent implements OnChanges {
fitContent: "auto",
};

defaultInputs = new BehaviorSubject<any>({
defaultInputs = new BehaviorSubject<AlertProperties>({
type: "info",
mode: "inline",
inlineText: null,
Expand Down
11 changes: 10 additions & 1 deletion projects/dxc-ngx-cdk/src/lib/dxc-alert/dxc-alert.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,18 @@ export type Space =
| "xlarge"
| "xxlarge";

export type Margin = {
export type Spacing = {
top?: Space;
bottom?: Space;
left?: Space;
right?: Space;
};

export interface AlertProperties {
type: "info" | "warning" | "error" | "confirm";
mode: "inline" | "modal";
inlineText?: string;
tabIndexValue?: number;
margin?: Space | Spacing;
size: "small" | "medium" | "large" | "fillParent" | "fitContent";
}