-
Notifications
You must be signed in to change notification settings - Fork 22
/
segmented-control-showcase.component.ts
57 lines (55 loc) · 1.61 KB
/
segmented-control-showcase.component.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import { Component } from '@angular/core';
import { ShowcaseProperty } from '~/app/shared/showcase-properties/showcase-property';
@Component({
selector: 'cookbook-segmented-control-showcase',
templateUrl: './segmented-control-showcase.component.html',
styleUrls: ['./segmented-control-showcase.component.scss'],
})
export class SegmentedControlShowcaseComponent {
properties: ShowcaseProperty[] = [
{
name: 'mode',
description: 'The mode of the segmented control.',
defaultValue: 'default',
inputValues: ['default', 'chip'],
},
{
name: 'size',
description: 'Sets the size of the segmented control. Only applies to `default` mode.',
defaultValue: 'md',
inputValues: ['sm', 'md'],
},
{
name: 'items',
description:
'An array of `SegmentItem[]` representing the set of segment elements within the control.',
defaultValue: '',
inputValues: [
`[{
id: string,
text: string,
badge?: {
content: string,
description?: string,
themeColor: ThemeColor
}
}]`,
],
preserveInputValuesWhitespaces: true,
},
{
name: 'value',
description:
'Gets/sets the selected segment. Returns the selected segment if there is one, otherwise `undefined``.',
defaultValue: 'undefined',
inputValues: ['SegmentItem'],
},
{
name: 'selectedIndex',
description:
'Gets/sets the index of the selected segment within the `segmentItems` array. The value -1 indicates no element is selected.',
defaultValue: 'undefined',
inputValues: ['number'],
},
];
}