@luscii-healthtech/web-ui 8.0.1 → 8.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4,34 +4,52 @@ export declare enum CheckboxState {
|
|
|
4
4
|
UNCHECKED = "unchecked"
|
|
5
5
|
}
|
|
6
6
|
export interface CheckboxListProps {
|
|
7
|
+
/**
|
|
8
|
+
* An array of items to render as checkboxes. Each item can be a single item or a group. When the
|
|
9
|
+
* title isn't specified, the group will render as a non-collapsible list. This is the way to
|
|
10
|
+
* render a regular list of checkboxes.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* Single list of checkboxes without visual grouping.
|
|
14
|
+
*
|
|
15
|
+
* ```tsx
|
|
16
|
+
* const groups = [{
|
|
17
|
+
* items: [
|
|
18
|
+
* {
|
|
19
|
+
* id: "1",
|
|
20
|
+
* label: "Item 1",
|
|
21
|
+
* },
|
|
22
|
+
* {
|
|
23
|
+
* id: "2",
|
|
24
|
+
* label: "Item 2",
|
|
25
|
+
* },
|
|
26
|
+
* ],
|
|
27
|
+
* }]
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
7
30
|
groups: CheckboxGroup[];
|
|
8
31
|
onChange: (event: CheckboxChangeEvent) => void;
|
|
32
|
+
/**
|
|
33
|
+
* Renders dividers between each item, including groups and inside of groups.
|
|
34
|
+
*/
|
|
9
35
|
hasDividers?: boolean;
|
|
10
36
|
className?: string;
|
|
11
37
|
}
|
|
12
38
|
type WithCollapsible = {
|
|
13
39
|
/**
|
|
14
|
-
* When `false
|
|
40
|
+
* When `false` will prevent the checkbox list from being collapsed (also disabling clicking to expand/collapse)
|
|
15
41
|
* in the component and it will be displayed expanded by default.
|
|
16
42
|
* @default true
|
|
17
43
|
*/
|
|
18
44
|
collapsible?: boolean;
|
|
19
45
|
};
|
|
20
|
-
export type CheckboxGroupProps = {
|
|
21
|
-
title?: string;
|
|
22
|
-
items: CheckboxListItem[];
|
|
46
|
+
export type CheckboxGroupProps = CheckboxGroup & {
|
|
23
47
|
onChange: (event: CheckboxChangeEvent) => void;
|
|
24
48
|
hasDividers?: boolean;
|
|
25
49
|
className?: string;
|
|
26
|
-
isCollapsed?: boolean;
|
|
27
50
|
} & WithCollapsible;
|
|
28
|
-
export interface CheckboxGroupItemProps {
|
|
29
|
-
id: string;
|
|
30
|
-
label: string;
|
|
31
|
-
isChecked?: boolean;
|
|
32
|
-
isDisabled?: boolean;
|
|
51
|
+
export interface CheckboxGroupItemProps extends CheckboxListItem {
|
|
33
52
|
onChange: (event: CheckboxChangeEvent) => void;
|
|
34
|
-
className?: string;
|
|
35
53
|
}
|
|
36
54
|
export interface CheckboxListItem {
|
|
37
55
|
id: string;
|
|
@@ -41,8 +59,17 @@ export interface CheckboxListItem {
|
|
|
41
59
|
className?: string;
|
|
42
60
|
}
|
|
43
61
|
export type CheckboxGroup = {
|
|
62
|
+
/**
|
|
63
|
+
* When the title isn't specified, the group will render as a non-collapsible list.
|
|
64
|
+
*/
|
|
44
65
|
title?: string;
|
|
66
|
+
/**
|
|
67
|
+
* The checkbox items to be shown inside of this group.
|
|
68
|
+
*/
|
|
45
69
|
items: CheckboxListItem[];
|
|
70
|
+
/**
|
|
71
|
+
* Whether the group is initially collapsed or not.
|
|
72
|
+
*/
|
|
46
73
|
isCollapsed?: boolean;
|
|
47
74
|
} & WithCollapsible;
|
|
48
75
|
export interface CheckboxChangeEvent {
|