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 @@ -22,22 +22,7 @@ import {
coerceNumberProperty,
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 { AccordionProperties, Space, Spacing } from "./dxc-accordionGroup.types";

@Component({
selector: "dxc-accordion-group",
Expand All @@ -49,7 +34,7 @@ export class DxcAccordionGroupComponent implements OnChanges, 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;
/**
* The index of the active accordion. If undefined, the component will be uncontrolled and the active accordion will be managed internally by the component.
* If null, the component will be controlled and all accordions will be closed.
Expand Down Expand Up @@ -90,7 +75,7 @@ export class DxcAccordionGroupComponent implements OnChanges, OnInit {

accordionContent: string;

defaultInputs = new BehaviorSubject<any>({
defaultInputs = new BehaviorSubject<AccordionProperties>({
margin: null,
indexActive: null,
disabled: false,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export type Space =
| "xxsmall"
| "xsmall"
| "small"
| "medium"
| "large"
| "xlarge"
| "xxlarge";

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

export interface AccordionProperties {
indexActive?: number;
disabled: boolean;
margin?: Space | Spacing;
}