musae 0.1.48 → 0.2.0
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.
- package/dist/components/avatar/avatar.d.ts +1 -1
- package/dist/components/avatar/avatar.js +8 -5
- package/dist/components/avatar/group.d.ts +1 -1
- package/dist/components/avatar/group.js +2 -1
- package/dist/components/avatar/types.d.ts +12 -4
- package/dist/components/breadcrumb/breadcrumb.js +1 -1
- package/dist/components/breadcrumb/item.js +1 -1
- package/dist/components/breadcrumb/types.d.ts +9 -3
- package/dist/components/button/types.d.ts +12 -15
- package/dist/components/calendar/calendar.js +8 -2
- package/dist/components/calendar/hooks.d.ts +1 -1
- package/dist/components/calendar/hooks.js +6 -6
- package/dist/components/calendar/types.d.ts +3 -0
- package/dist/components/cascader/cascader.d.ts +1 -1
- package/dist/components/cascader/cascader.js +3 -1
- package/dist/components/cascader/hooks.d.ts +3 -2
- package/dist/components/cascader/types.d.ts +6 -1
- package/dist/components/cascader/utils.js +2 -2
- package/dist/components/checkbox/types.d.ts +5 -0
- package/dist/components/clock/clock.d.ts +1 -1
- package/dist/components/clock/types.d.ts +2 -0
- package/dist/components/countable/types.d.ts +0 -2
- package/dist/components/date-picker/types.d.ts +2 -0
- package/dist/components/date-range-picker/types.d.ts +2 -0
- package/dist/components/dialog/dialog.d.ts +1 -1
- package/dist/components/dialog/dialog.js +2 -2
- package/dist/components/dialog/popup.js +1 -1
- package/dist/components/dialog/types.d.ts +15 -6
- package/dist/components/divider/types.d.ts +3 -0
- package/dist/components/drawer/types.d.ts +11 -7
- package/dist/components/form/types.d.ts +7 -0
- package/dist/components/grid/types.d.ts +8 -0
- package/dist/components/image/types.d.ts +3 -0
- package/dist/components/input/input.js +2 -2
- package/dist/components/input/types.d.ts +12 -12
- package/dist/components/loading/types.d.ts +1 -0
- package/dist/components/menu/group.d.ts +1 -1
- package/dist/components/menu/group.js +2 -3
- package/dist/components/menu/menu.js +10 -6
- package/dist/components/menu/types.d.ts +32 -15
- package/dist/components/otp-input/otp-input.js +4 -2
- package/dist/components/otp-input/types.d.ts +2 -1
- package/dist/components/pagination/types.d.ts +4 -0
- package/dist/components/popover/popover.js +0 -2
- package/dist/components/portal/portal.d.ts +2 -2
- package/dist/components/progress/progress.d.ts +1 -1
- package/dist/components/radio/group.d.ts +1 -1
- package/dist/components/radio/group.js +4 -4
- package/dist/components/radio/radio.d.ts +1 -1
- package/dist/components/radio/radio.js +131 -123
- package/dist/components/radio/types.d.ts +7 -0
- package/dist/components/rate/types.d.ts +4 -0
- package/dist/components/select/hooks.d.ts +2 -1
- package/dist/components/select/hooks.js +1 -3
- package/dist/components/select/select.js +1 -1
- package/dist/components/select/types.d.ts +8 -0
- package/dist/components/space/types.d.ts +2 -0
- package/dist/components/steps/types.d.ts +5 -2
- package/dist/components/switch/switch.js +3 -0
- package/dist/components/switch/types.d.ts +6 -0
- package/dist/components/table/table.d.ts +1 -1
- package/dist/components/table/table.js +2 -1
- package/dist/components/table/types.d.ts +3 -0
- package/dist/components/tabs/types.d.ts +8 -1
- package/dist/components/tag/tag.js +1 -1
- package/dist/components/tag/types.d.ts +4 -0
- package/dist/components/time-picker/types.d.ts +2 -0
- package/dist/components/timeline/types.d.ts +4 -0
- package/dist/components/tooltip/types.d.ts +6 -4
- package/dist/components/tour/hooks.d.ts +3 -3
- package/dist/components/tour/types.d.ts +10 -2
- package/dist/components/tree/types.d.ts +3 -0
- package/dist/components/waterfall/types.d.ts +4 -0
- package/dist/components/watermark/types.d.ts +8 -5
- package/dist/stylex.css +3 -2
- package/dist/types/option.d.ts +3 -0
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { AvatarProps } from "./types";
|
|
3
|
-
declare const Avatar: ({ src, alt,
|
|
3
|
+
declare const Avatar: ({ src, alt, shape: _shape, size: _size }: AvatarProps) => React.JSX.Element;
|
|
4
4
|
export default Avatar;
|
|
@@ -37,6 +37,7 @@ const styles = {
|
|
|
37
37
|
borderTopColor: null,
|
|
38
38
|
borderBottomColor: null,
|
|
39
39
|
boxSizing: "musae-9f619",
|
|
40
|
+
display: "musae-3nfvp2",
|
|
40
41
|
$$css: true
|
|
41
42
|
},
|
|
42
43
|
image: {
|
|
@@ -114,13 +115,14 @@ const styles = {
|
|
|
114
115
|
const Avatar = ({
|
|
115
116
|
src,
|
|
116
117
|
alt,
|
|
117
|
-
|
|
118
|
+
shape: _shape = "circular",
|
|
119
|
+
size: _size = "medium"
|
|
118
120
|
}) => {
|
|
119
121
|
const theme = useTheme();
|
|
120
122
|
const group = useContext(Context);
|
|
121
123
|
const isInGroup = !!group;
|
|
122
|
-
const size = group?.size ??
|
|
123
|
-
const shape = group?.shape ??
|
|
124
|
+
const size = group?.size ?? _size;
|
|
125
|
+
const shape = group?.shape ?? _shape;
|
|
124
126
|
const classNames = useClassNames(ComponentToken.Avatar);
|
|
125
127
|
const styled = {
|
|
126
128
|
avatar: props(styles.avatar, styles[size], styles[shape], isInGroup && styles.overlapping({
|
|
@@ -134,9 +136,10 @@ const Avatar = ({
|
|
|
134
136
|
className: clsx(classNames[AvatarClassToken.Avatar], styled.avatar.className),
|
|
135
137
|
style: styled.avatar.style
|
|
136
138
|
}, React.createElement("img", {
|
|
137
|
-
...styled.image,
|
|
138
139
|
src: src,
|
|
139
|
-
alt: alt
|
|
140
|
+
alt: alt,
|
|
141
|
+
className: styled.image.className,
|
|
142
|
+
style: styled.image.style
|
|
140
143
|
}));
|
|
141
144
|
};
|
|
142
145
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type AvatarGroupProps } from "./types";
|
|
3
|
-
declare const Group: ({ children, shape, size }: AvatarGroupProps) => React.JSX.Element;
|
|
3
|
+
declare const Group: ({ children, shape, size, max }: AvatarGroupProps) => React.JSX.Element;
|
|
4
4
|
export default Group;
|
|
@@ -9,21 +9,25 @@ export type AvatarProps = {
|
|
|
9
9
|
/**
|
|
10
10
|
* @description
|
|
11
11
|
* src
|
|
12
|
+
* @default void 0
|
|
12
13
|
*/
|
|
13
14
|
src?: string;
|
|
14
15
|
/**
|
|
15
16
|
* @description
|
|
16
17
|
* alt
|
|
18
|
+
* @default void 0
|
|
17
19
|
*/
|
|
18
20
|
alt?: string;
|
|
19
21
|
/**
|
|
20
22
|
* @description
|
|
21
23
|
* size
|
|
24
|
+
* @default "medium"
|
|
22
25
|
*/
|
|
23
26
|
size?: Size;
|
|
24
27
|
/**
|
|
25
28
|
* @description
|
|
26
29
|
* shape
|
|
30
|
+
* @default "circular"
|
|
27
31
|
*/
|
|
28
32
|
shape?: Shape;
|
|
29
33
|
};
|
|
@@ -35,23 +39,27 @@ export type AvatarGroupProps = {
|
|
|
35
39
|
/**
|
|
36
40
|
* @description
|
|
37
41
|
* children
|
|
42
|
+
* @requires
|
|
38
43
|
*/
|
|
39
44
|
children: ReactNode;
|
|
40
45
|
/**
|
|
41
46
|
* @description
|
|
42
47
|
* max
|
|
48
|
+
* @default 3
|
|
43
49
|
*/
|
|
44
50
|
max?: number;
|
|
45
51
|
/**
|
|
46
52
|
* @description
|
|
47
|
-
*
|
|
53
|
+
* size
|
|
54
|
+
* @default "circular"
|
|
48
55
|
*/
|
|
49
|
-
|
|
56
|
+
size?: Size;
|
|
50
57
|
/**
|
|
51
58
|
* @description
|
|
52
|
-
*
|
|
59
|
+
* shape
|
|
60
|
+
* @default "circular"
|
|
53
61
|
*/
|
|
54
|
-
|
|
62
|
+
shape?: Shape;
|
|
55
63
|
};
|
|
56
64
|
/**
|
|
57
65
|
* @description
|
|
@@ -8,12 +8,14 @@ export type BreadcrumbItem = {
|
|
|
8
8
|
/**
|
|
9
9
|
* @description
|
|
10
10
|
* item display label
|
|
11
|
+
* @requires
|
|
11
12
|
*/
|
|
12
13
|
label: ReactNode;
|
|
13
14
|
/**
|
|
14
15
|
* @description
|
|
15
16
|
* item href link
|
|
16
17
|
* if link is not provided, item will display as a label
|
|
18
|
+
* @default void 0
|
|
17
19
|
*/
|
|
18
20
|
href?: string;
|
|
19
21
|
};
|
|
@@ -25,13 +27,15 @@ export type BreadcrumbProps = ComponentProps & {
|
|
|
25
27
|
/**
|
|
26
28
|
* @description
|
|
27
29
|
* breadcrumb items
|
|
30
|
+
* @default []
|
|
28
31
|
*/
|
|
29
|
-
items
|
|
32
|
+
items?: BreadcrumbItem[];
|
|
30
33
|
/**
|
|
31
34
|
* @description
|
|
32
35
|
* separator
|
|
36
|
+
* @default "/"
|
|
33
37
|
*/
|
|
34
|
-
separator?: ReactNode
|
|
38
|
+
separator?: Exclude<ReactNode, undefined | null>;
|
|
35
39
|
};
|
|
36
40
|
/**
|
|
37
41
|
* @description
|
|
@@ -41,11 +45,13 @@ export type BreadcrumbItemProps = BreadcrumbItem & {
|
|
|
41
45
|
/**
|
|
42
46
|
* @description
|
|
43
47
|
* max
|
|
48
|
+
* @requires
|
|
44
49
|
*/
|
|
45
50
|
max: boolean;
|
|
46
51
|
/**
|
|
47
52
|
* @description
|
|
48
53
|
* separator
|
|
54
|
+
* @requires
|
|
49
55
|
*/
|
|
50
|
-
separator
|
|
56
|
+
separator: Exclude<ReactNode, undefined | null>;
|
|
51
57
|
};
|
|
@@ -14,54 +14,45 @@ export interface ButtonProps extends Partial<Pick<ButtonHTMLAttributes<HTMLButto
|
|
|
14
14
|
/**
|
|
15
15
|
* @description
|
|
16
16
|
* variant
|
|
17
|
-
*
|
|
18
17
|
* @default "filled"
|
|
19
18
|
*/
|
|
20
19
|
variant?: Variant;
|
|
21
20
|
/**
|
|
22
21
|
* @description
|
|
23
22
|
* color: only support preset colors
|
|
24
|
-
*
|
|
25
23
|
* @default "primary"
|
|
26
24
|
*/
|
|
27
25
|
color?: Color;
|
|
28
26
|
/**
|
|
29
27
|
* @description
|
|
30
28
|
* shape
|
|
31
|
-
*
|
|
32
29
|
* @default "rounded"
|
|
33
30
|
*/
|
|
34
31
|
shape?: Shape;
|
|
35
32
|
/**
|
|
36
33
|
* @description
|
|
37
|
-
*
|
|
34
|
+
* size
|
|
35
|
+
* @default "medium"
|
|
38
36
|
*/
|
|
39
|
-
|
|
37
|
+
size?: Size;
|
|
40
38
|
/**
|
|
41
39
|
* @description
|
|
42
40
|
* children
|
|
41
|
+
* @default void 0
|
|
43
42
|
*/
|
|
44
43
|
children?: ReactNode;
|
|
45
|
-
/**
|
|
46
|
-
* @description
|
|
47
|
-
* size
|
|
48
|
-
*
|
|
49
|
-
* @default "medium"
|
|
50
|
-
*/
|
|
51
|
-
size?: Size;
|
|
52
44
|
/**
|
|
53
45
|
* @description
|
|
54
46
|
* disabled
|
|
55
|
-
*
|
|
56
47
|
* @default false
|
|
57
48
|
*/
|
|
58
49
|
disabled?: boolean;
|
|
59
50
|
/**
|
|
60
51
|
* @description
|
|
61
52
|
* prefix react node
|
|
62
|
-
*
|
|
63
53
|
* @template
|
|
64
54
|
* icon or prefix signal
|
|
55
|
+
* @default void 0
|
|
65
56
|
*/
|
|
66
57
|
prefix?: ReactNode;
|
|
67
58
|
/**
|
|
@@ -69,14 +60,20 @@ export interface ButtonProps extends Partial<Pick<ButtonHTMLAttributes<HTMLButto
|
|
|
69
60
|
* suffix react node
|
|
70
61
|
* @template
|
|
71
62
|
* icon or suffix signal
|
|
63
|
+
* @default void 0
|
|
72
64
|
*/
|
|
73
65
|
suffix?: ReactNode;
|
|
74
66
|
/**
|
|
75
67
|
* @description
|
|
76
68
|
* if false, without a ripple
|
|
77
|
-
*
|
|
78
69
|
* @default true
|
|
79
70
|
*/
|
|
80
71
|
ripple?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* @description
|
|
74
|
+
* click handler
|
|
75
|
+
* @default void 0
|
|
76
|
+
*/
|
|
77
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
81
78
|
}
|
|
82
79
|
export {};
|
|
@@ -50,6 +50,9 @@ const Calendar = ({
|
|
|
50
50
|
const classNames = useClassNames(ComponentToken.Calendar);
|
|
51
51
|
const theme = useTheme();
|
|
52
52
|
const styled = {
|
|
53
|
+
calendar: {
|
|
54
|
+
className: "musae-eq5yr9"
|
|
55
|
+
},
|
|
53
56
|
header: props(typography.label.large, styles.header({
|
|
54
57
|
color: theme.colors[ColorToken.OnSurfaceVariant]
|
|
55
58
|
})),
|
|
@@ -58,8 +61,11 @@ const Calendar = ({
|
|
|
58
61
|
}
|
|
59
62
|
};
|
|
60
63
|
return React.createElement("div", {
|
|
61
|
-
className: className,
|
|
62
|
-
style:
|
|
64
|
+
className: clsx(styled.calendar.className, className),
|
|
65
|
+
style: {
|
|
66
|
+
...styled.calendar.style,
|
|
67
|
+
...style
|
|
68
|
+
}
|
|
63
69
|
}, React.createElement("header", {
|
|
64
70
|
className: clsx(classNames[CalendarClassToken.Header], styled.header.className),
|
|
65
71
|
style: styled.header.style
|
|
@@ -24,7 +24,7 @@ export declare const useValue: ([value, _click]: [CalendarProps["value"], Calend
|
|
|
24
24
|
* @description
|
|
25
25
|
* point at
|
|
26
26
|
*/
|
|
27
|
-
export declare const useFocusedAt: ([
|
|
27
|
+
export declare const useFocusedAt: ([_focusedAt]: [CalendarProps["focusedAt"]]) => {
|
|
28
28
|
focusedAt: dayjs.Dayjs;
|
|
29
29
|
toNextYear: () => void;
|
|
30
30
|
toPrevYear: () => void;
|
|
@@ -169,25 +169,25 @@ const useValue = ([value, _click]) => {
|
|
|
169
169
|
* @description
|
|
170
170
|
* point at
|
|
171
171
|
*/
|
|
172
|
-
const useFocusedAt = ([
|
|
173
|
-
const [focusedAt, setFocusedAt] = useControlledState(
|
|
172
|
+
const useFocusedAt = ([_focusedAt]) => {
|
|
173
|
+
const [focusedAt, setFocusedAt] = useControlledState(_focusedAt, {
|
|
174
174
|
defaultState: dayjs()
|
|
175
175
|
});
|
|
176
176
|
/// next year
|
|
177
177
|
const toNextYear = useCallback(() => {
|
|
178
|
-
setFocusedAt(
|
|
178
|
+
setFocusedAt(__focusedAt => __focusedAt.add(1, "year"));
|
|
179
179
|
}, [setFocusedAt]);
|
|
180
180
|
/// prev year
|
|
181
181
|
const toPrevYear = useCallback(() => {
|
|
182
|
-
setFocusedAt(
|
|
182
|
+
setFocusedAt(__focusedAt => __focusedAt.subtract(1, "year"));
|
|
183
183
|
}, [setFocusedAt]);
|
|
184
184
|
/// next month
|
|
185
185
|
const toNextMonth = useCallback(() => {
|
|
186
|
-
setFocusedAt(
|
|
186
|
+
setFocusedAt(__focusedAt => __focusedAt.add(1, "month"));
|
|
187
187
|
}, [setFocusedAt]);
|
|
188
188
|
/// prev month
|
|
189
189
|
const toPrevMonth = useCallback(() => {
|
|
190
|
-
setFocusedAt(
|
|
190
|
+
setFocusedAt(__focusedAt => __focusedAt.subtract(1, "month"));
|
|
191
191
|
}, [setFocusedAt]);
|
|
192
192
|
return {
|
|
193
193
|
focusedAt,
|
|
@@ -9,16 +9,19 @@ export type CalendarProps = ComponentProps & {
|
|
|
9
9
|
/**
|
|
10
10
|
* @description
|
|
11
11
|
* value
|
|
12
|
+
* @default void 0
|
|
12
13
|
*/
|
|
13
14
|
value?: Dayjs | [Partialable<Dayjs>, Partialable<Dayjs>];
|
|
14
15
|
/**
|
|
15
16
|
* @description
|
|
16
17
|
* focused at
|
|
18
|
+
* @default void 0
|
|
17
19
|
*/
|
|
18
20
|
focusedAt?: Dayjs;
|
|
19
21
|
/**
|
|
20
22
|
* @description
|
|
21
23
|
* click date handler
|
|
24
|
+
* @default void 0
|
|
22
25
|
*/
|
|
23
26
|
onClick?: (value: Dayjs) => void;
|
|
24
27
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { CascaderProps } from "./types";
|
|
3
|
-
declare const Cascader: ({ mode, separator, ...props }: CascaderProps) => React.JSX.Element;
|
|
3
|
+
declare const Cascader: ({ mode, separator, options, complex, ...props }: CascaderProps) => React.JSX.Element;
|
|
4
4
|
export default Cascader;
|
|
@@ -10,6 +10,8 @@ import clsx from 'clsx';
|
|
|
10
10
|
const Cascader = ({
|
|
11
11
|
mode,
|
|
12
12
|
separator = "/",
|
|
13
|
+
options = [],
|
|
14
|
+
complex = false,
|
|
13
15
|
...props
|
|
14
16
|
}) => {
|
|
15
17
|
const ref = useRef(null);
|
|
@@ -21,7 +23,7 @@ const Cascader = ({
|
|
|
21
23
|
additionalMenusItems,
|
|
22
24
|
presetedMenuItems,
|
|
23
25
|
setAdditionalMenusItems
|
|
24
|
-
} = useOptions([
|
|
26
|
+
} = useOptions([options]);
|
|
25
27
|
const {
|
|
26
28
|
values,
|
|
27
29
|
onChange
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Dispatch, type SetStateAction } from "react";
|
|
2
2
|
import { type MenuItem } from "../menu";
|
|
3
3
|
import type { CascaderProps, ReadableOptions, ReadablePaths } from "./types";
|
|
4
|
+
import type { Option } from "../../types/option";
|
|
4
5
|
/**
|
|
5
6
|
* @description
|
|
6
7
|
* cascader value
|
|
@@ -13,14 +14,14 @@ export declare const useValue: ([valueInProps, readableOptions, readablePaths, m
|
|
|
13
14
|
close: VoidFunction,
|
|
14
15
|
Dispatch<SetStateAction<MenuItem[][]>>
|
|
15
16
|
]) => {
|
|
16
|
-
values: Map<number, Required<Pick<
|
|
17
|
+
values: Map<number, Required<Pick<Option, "value" | "label">>[]>;
|
|
17
18
|
onChange: (id: number) => void;
|
|
18
19
|
};
|
|
19
20
|
/**
|
|
20
21
|
* @description
|
|
21
22
|
* options
|
|
22
23
|
*/
|
|
23
|
-
export declare const useOptions: ([options]: [options:
|
|
24
|
+
export declare const useOptions: ([options]: [options: Option[]]) => {
|
|
24
25
|
presetedMenuItems: MenuItem[];
|
|
25
26
|
additionalMenusItems: MenuItem[][];
|
|
26
27
|
readableOptions: ReadableOptions;
|
|
@@ -20,26 +20,31 @@ export interface CascaderProps {
|
|
|
20
20
|
/**
|
|
21
21
|
* @description
|
|
22
22
|
* value
|
|
23
|
+
* @default void 0
|
|
23
24
|
*/
|
|
24
25
|
value?: ValueOrValues;
|
|
25
26
|
/**
|
|
26
27
|
* @description
|
|
27
28
|
* options
|
|
29
|
+
* @default []
|
|
28
30
|
*/
|
|
29
31
|
options?: Option[];
|
|
30
32
|
/**
|
|
31
33
|
* @description
|
|
32
34
|
* mode
|
|
35
|
+
* @default void 0
|
|
33
36
|
*/
|
|
34
37
|
mode?: Mode;
|
|
35
38
|
/**
|
|
36
39
|
* @description
|
|
37
40
|
* complex
|
|
41
|
+
* @default false
|
|
38
42
|
*/
|
|
39
43
|
complex?: boolean;
|
|
40
44
|
/**
|
|
41
45
|
* @description
|
|
42
46
|
* separator
|
|
47
|
+
* @default "/"
|
|
43
48
|
*/
|
|
44
49
|
separator?: ReactNode;
|
|
45
50
|
}
|
|
@@ -52,7 +57,7 @@ export interface ReadBy {
|
|
|
52
57
|
* @description
|
|
53
58
|
* options
|
|
54
59
|
*/
|
|
55
|
-
options
|
|
60
|
+
options: Option[];
|
|
56
61
|
/**
|
|
57
62
|
* @description
|
|
58
63
|
* from
|
|
@@ -4,7 +4,7 @@ import { isVoid, isArray } from '@aiszlab/relax';
|
|
|
4
4
|
* @description
|
|
5
5
|
* read options
|
|
6
6
|
*/
|
|
7
|
-
const readOptions = ({ options
|
|
7
|
+
const readOptions = ({ options, from = 1, paths = [] }) => {
|
|
8
8
|
return options.reduce((prev, option) => {
|
|
9
9
|
const [collectedOptions, collectedPaths, next] = prev;
|
|
10
10
|
const currentPaths = [
|
|
@@ -16,7 +16,7 @@ const readOptions = ({ options = [], from = 1, paths = [] }) => {
|
|
|
16
16
|
];
|
|
17
17
|
// read deeply
|
|
18
18
|
const [children, readPaths, readId] = readOptions({
|
|
19
|
-
options: option.children,
|
|
19
|
+
options: option.children ?? [],
|
|
20
20
|
from: next,
|
|
21
21
|
paths: currentPaths,
|
|
22
22
|
});
|
|
@@ -30,6 +30,7 @@ export interface CheckboxGroupProps {
|
|
|
30
30
|
* checked values
|
|
31
31
|
* @example
|
|
32
32
|
* ["A"]
|
|
33
|
+
* @default void 0
|
|
33
34
|
*/
|
|
34
35
|
value?: Key[];
|
|
35
36
|
/**
|
|
@@ -37,6 +38,7 @@ export interface CheckboxGroupProps {
|
|
|
37
38
|
* children
|
|
38
39
|
* @example
|
|
39
40
|
* <Checkbox value="A" />
|
|
41
|
+
* @requires
|
|
40
42
|
*/
|
|
41
43
|
children: ReactNode;
|
|
42
44
|
}
|
|
@@ -50,16 +52,19 @@ export interface CheckboxProps extends ComponentProps {
|
|
|
50
52
|
/**
|
|
51
53
|
* @description
|
|
52
54
|
* if is checked
|
|
55
|
+
* @default void 0
|
|
53
56
|
*/
|
|
54
57
|
checked?: boolean;
|
|
55
58
|
/**
|
|
56
59
|
* @description
|
|
57
60
|
* value
|
|
61
|
+
* @requires
|
|
58
62
|
*/
|
|
59
63
|
value: Key;
|
|
60
64
|
/**
|
|
61
65
|
* @description
|
|
62
66
|
* children
|
|
67
|
+
* @default void 0
|
|
63
68
|
*/
|
|
64
69
|
children?: ReactNode;
|
|
65
70
|
}
|
|
@@ -8,14 +8,12 @@ export type CountableProps = Pick<ButtonProps, "children" | "disabled" | "varian
|
|
|
8
8
|
/**
|
|
9
9
|
* @description
|
|
10
10
|
* count total after every trigger
|
|
11
|
-
*
|
|
12
11
|
* @default 60
|
|
13
12
|
*/
|
|
14
13
|
count?: number;
|
|
15
14
|
/**
|
|
16
15
|
* @description
|
|
17
16
|
* interval, unit(ms)
|
|
18
|
-
*
|
|
19
17
|
* @default 1000
|
|
20
18
|
*/
|
|
21
19
|
interval?: number;
|
|
@@ -8,11 +8,13 @@ export interface DateRangePickerProps {
|
|
|
8
8
|
/**
|
|
9
9
|
* @description
|
|
10
10
|
* value
|
|
11
|
+
* @default void 0
|
|
11
12
|
*/
|
|
12
13
|
value?: [Partialable<Dayjs>, Partialable<Dayjs>];
|
|
13
14
|
/**
|
|
14
15
|
* @description
|
|
15
16
|
* change handler
|
|
17
|
+
* @default void 0
|
|
16
18
|
*/
|
|
17
19
|
onChange?: (value: [Dayjs, Dayjs]) => void;
|
|
18
20
|
}
|
|
@@ -3,7 +3,7 @@ import React, { useEffect } from 'react';
|
|
|
3
3
|
import Popup from './popup.js';
|
|
4
4
|
import { useBoolean } from '@aiszlab/relax';
|
|
5
5
|
|
|
6
|
-
const Dialog = ({ open, ...props }) => {
|
|
6
|
+
const Dialog = ({ open, dismissable = true, ...props }) => {
|
|
7
7
|
/// `Portal` should disappear after `Dialog` disappear completely
|
|
8
8
|
const [_isVisible, { turnOn, turnOff }] = useBoolean(false);
|
|
9
9
|
useEffect(() => {
|
|
@@ -13,7 +13,7 @@ const Dialog = ({ open, ...props }) => {
|
|
|
13
13
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
14
14
|
}, [open]);
|
|
15
15
|
return (React.createElement(Portal, { open: open || _isVisible },
|
|
16
|
-
React.createElement(Popup, { open: open, onClosed: turnOff
|
|
16
|
+
React.createElement(Popup, { ...props, dismissable: true, open: open, onClosed: turnOff })));
|
|
17
17
|
};
|
|
18
18
|
var Dialog$1 = Dialog;
|
|
19
19
|
|