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 @@ -20,22 +20,7 @@ import {
coerceNumberProperty,
} from "@angular/cdk/coercion";
import { DropdownService } from "./services/dropdown.service";

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

type Margin = {
top?: Space;
bottom?: Space;
left?: Space;
right?: Space;
};
import { DropdownProperties, Space, Spacing } from "./dxc-dropdown.types";

@Component({
selector: "dxc-dropdown",
Expand Down Expand Up @@ -79,11 +64,11 @@ export class DxcDropdownComponent implements OnChanges {

/**
* 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
* ('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;

/**
* Size of the component.
Expand Down Expand Up @@ -151,9 +136,8 @@ export class DxcDropdownComponent implements OnChanges {
menuOptions: string;
triggerStyles: string;

defaultInputs = new BehaviorSubject<any>({
defaultInputs = new BehaviorSubject<DropdownProperties>({
optionsIconPosition: "before",
iconSrc: null,
iconPosition: "before",
label: null,
name: null,
Expand Down
28 changes: 28 additions & 0 deletions projects/dxc-ngx-cdk/src/lib/dxc-dropdown/dxc-dropdown.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
export interface DropdownProperties {
margin?: Space | Spacing;
optionsIconPosition?: "before" | "after";
iconPosition?: "before" | "after";
label?: string;
name?: string;
caretHidden?: boolean;
size?: "small" | "medium" | "large" | "fillParent" | "fitContent";
tabIndexValue?: number;
expandOnHover?: boolean;
disabled?: boolean;
}

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

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