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
21 changes: 3 additions & 18 deletions projects/dxc-ngx-cdk/src/lib/dxc-spinner/dxc-spinner.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,7 @@ import { BehaviorSubject } from "rxjs";
import { css } from "emotion";
import { CssUtils } from "../utils";
import { coerceBooleanProperty } from "@angular/cdk/coercion";

type Space =
| "xxsmall"
| "xsmall"
| "small"
| "medium"
| "large"
| "xlarge"
| "xxlarge";
type Margin = {
top?: Space;
bottom?: Space;
left?: Space;
right?: Space;
};

import { Space, Spacing, SpinnerProperties } from "./dxc-spinner.types";
@Component({
selector: "dxc-spinner",
templateUrl: "./dxc-spinner.component.html",
Expand All @@ -50,7 +35,7 @@ export class DxcSpinnerComponent implements OnInit {
* 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: Space | Margin;
@Input() margin: Space | Spacing;
/**
* If true, the value is displayed inside the spinner..
*/
Expand Down Expand Up @@ -82,7 +67,7 @@ export class DxcSpinnerComponent implements OnInit {
radioLargeSize: number = 65;
radioSmallSize: number = 6;

defaultInputs = new BehaviorSubject<any>({
defaultInputs = new BehaviorSubject<SpinnerProperties>({
showValue: false,
mode: "large",
value: 0,
Expand Down
23 changes: 23 additions & 0 deletions projects/dxc-ngx-cdk/src/lib/dxc-spinner/dxc-spinner.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export interface SpinnerProperties {
margin?: Space | Spacing;
showValue?: boolean;
value?: number;
label?: string;
mode?: "large" | "small" | "overlay";
}

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

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