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
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { css } from "emotion";
import { BehaviorSubject } from "rxjs";
import { DxcWizardIconComponent } from "../dxc-wizard-icon/dxc-wizard-icon.component";
import { WizardService } from "../services/wizard.service";
import { WizardStepProperties } from "./dxc-wizard-step.types";

@Component({
selector: "dxc-wizard-step",
Expand Down Expand Up @@ -70,7 +71,7 @@ export class DxcWizardStepComponent {

@HostBinding("class") className;

defaultInputs = new BehaviorSubject<any>({
defaultInputs = new BehaviorSubject<WizardStepProperties>({
label: null,
description: null,
disabled: false,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export interface WizardStepProperties {
label: string;
description?: string;
disabled?: boolean;
valid?: boolean;
mode?: string;
}
21 changes: 4 additions & 17 deletions projects/dxc-ngx-cdk/src/lib/dxc-wizard/dxc-wizard.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,7 @@ import { DxcWizardStepComponent } from "./dxc-wizard-step/dxc-wizard-step.compon
import { WizardService } from "./services/wizard.service";
import { ChangeDetectorRef } from "@angular/core";
import { coerceNumberProperty } from "@angular/cdk/coercion";

type Space =
| "xxsmall"
| "xsmall"
| "small"
| "medium"
| "large"
| "xlarge"
| "xxlarge";
type Margin = {
top?: Space;
bottom?: Space;
left?: Space;
right?: Space;
};
import { Spacing, Space, WizardProperties } from "./dxc-wizard.types";

@Component({
selector: "dxc-wizard",
Expand All @@ -49,7 +35,7 @@ export class DxcWizardComponent {
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
*/
@Input() margin: Margin | Space;
@Input() margin: Spacing | Space;
/**
* Value of the tabindex attribute that is given to all the steps.
*/
Expand All @@ -72,10 +58,11 @@ export class DxcWizardComponent {

@HostBinding("class") className;

defaultInputs = new BehaviorSubject<any>({
defaultInputs = new BehaviorSubject<WizardProperties>({
mode: "horizontal",
currentStep: 0,
margin: null,
tabIndexValue: 0,
});

constructor(
Expand Down
22 changes: 22 additions & 0 deletions projects/dxc-ngx-cdk/src/lib/dxc-wizard/dxc-wizard.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export interface WizardProperties {
mode?: string;
currentStep?: number;
margin?: Spacing | Space;
tabIndexValue?: number;
}

export type Space =
| "xxsmall"
| "xsmall"
| "small"
| "medium"
| "large"
| "xlarge"
| "xxlarge";

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