@rockshin/tao-ui 0.0.48 → 0.0.49
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/affix/affix.js +20 -16
- package/dist/components/alert/alert.js +114 -99
- package/dist/components/app/app-modals.js +134 -96
- package/dist/components/app/app-notices.js +39 -23
- package/dist/components/auto-complete/auto-complete.js +21 -7
- package/dist/components/avatar/avatar.js +31 -11
- package/dist/components/badge/badge.css +1 -1
- package/dist/components/badge/badge.js +72 -257
- package/dist/components/border-beam/border-beam.js +21 -17
- package/dist/components/breadcrumb/breadcrumb.js +178 -159
- package/dist/components/button/button.js +61 -53
- package/dist/components/calendar/calendar.js +6 -4
- package/dist/components/card/card.js +24 -8
- package/dist/components/carousel/carousel.d.ts +1 -1
- package/dist/components/carousel/carousel.js +105 -68
- package/dist/components/cascader/cascader.js +54 -19
- package/dist/components/checkbox/checkbox.css +13 -2
- package/dist/components/checkbox/checkbox.d.ts +2 -0
- package/dist/components/checkbox/checkbox.js +320 -229
- package/dist/components/collapse/collapse-panels.d.ts +1 -1
- package/dist/components/collapse/collapse-panels.js +122 -113
- package/dist/components/collapse/collapse.js +98 -63
- package/dist/components/color-picker/color-picker.js +539 -441
- package/dist/components/color-picker/color.js +1 -1
- package/dist/components/context-menu/context-menu.d.ts +1 -1
- package/dist/components/context-menu/context-menu.js +108 -68
- package/dist/components/date-picker/calendar/calendar-grid.js +42 -39
- package/dist/components/date-picker/calendar/month-grid.d.ts +8 -1
- package/dist/components/date-picker/calendar/month-grid.js +79 -37
- package/dist/components/date-picker/calendar/time-panel.d.ts +2 -1
- package/dist/components/date-picker/calendar/time-panel.js +94 -89
- package/dist/components/date-picker/calendar/year-grid.d.ts +8 -1
- package/dist/components/date-picker/calendar/year-grid.js +66 -35
- package/dist/components/date-picker/date-picker.css +24 -1
- package/dist/components/date-picker/date-picker.js +99 -53
- package/dist/components/date-picker/presets.d.ts +2 -1
- package/dist/components/date-picker/presets.js +27 -24
- package/dist/components/date-picker/range-picker.js +308 -153
- package/dist/components/descriptions/descriptions.js +7 -3
- package/dist/components/divider/divider.css +1 -1
- package/dist/components/divider/divider.js +1 -1
- package/dist/components/drawer/drawer.js +201 -369
- package/dist/components/dropdown/dropdown.d.ts +1 -1
- package/dist/components/dropdown/dropdown.js +183 -279
- package/dist/components/empty/empty.js +57 -78
- package/dist/components/float-button/float-button.d.ts +1 -0
- package/dist/components/float-button/float-button.js +47 -30
- package/dist/components/form/field-control.d.ts +4 -2
- package/dist/components/form/field-control.js +17 -9
- package/dist/components/form/form-context.d.ts +8 -2
- package/dist/components/form/form-context.js +2 -1
- package/dist/components/form/form-item.js +85 -63
- package/dist/components/form/use-form.d.ts +2 -1
- package/dist/components/form/use-form.js +2 -1
- package/dist/components/form-field/form-field-view.d.ts +3 -1
- package/dist/components/form-field/form-field-view.js +194 -141
- package/dist/components/form-section/form-section.d.ts +1 -1
- package/dist/components/form-section/form-section.js +52 -45
- package/dist/components/image/image.js +585 -477
- package/dist/components/input/base-input.js +8 -9
- package/dist/components/input/input-shared.d.ts +5 -2
- package/dist/components/input/input-shared.js +42 -18
- package/dist/components/input/otp.js +236 -217
- package/dist/components/input/password.js +2 -1
- package/dist/components/input/search.js +8 -7
- package/dist/components/list/list-pagination.js +41 -36
- package/dist/components/list/list.js +141 -125
- package/dist/components/listy/listy.js +175 -106
- package/dist/components/masonry/masonry.js +108 -85
- package/dist/components/mentions/mentions.js +12 -3
- package/dist/components/menu/menu-render.d.ts +9 -3
- package/dist/components/menu/menu-render.js +99 -36
- package/dist/components/modal/confirm-dialog.js +10 -4
- package/dist/components/modal/confirm.js +3 -7
- package/dist/components/modal/index.js +9 -3
- package/dist/components/modal/modal.js +390 -365
- package/dist/components/pagination/pagination.js +105 -96
- package/dist/components/popconfirm/popconfirm.d.ts +1 -1
- package/dist/components/popconfirm/popconfirm.js +219 -168
- package/dist/components/popover/popover.js +330 -243
- package/dist/components/progress/progress.css +2 -2
- package/dist/components/progress/progress.js +232 -458
- package/dist/components/qr-code/qr-code.js +72 -66
- package/dist/components/radio/radio.css +15 -4
- package/dist/components/radio/radio.d.ts +2 -1
- package/dist/components/radio/radio.js +260 -198
- package/dist/components/rate/rate.js +173 -113
- package/dist/components/scroll-area/scroll-area.js +241 -211
- package/dist/components/segmented/segmented.js +73 -41
- package/dist/components/select/mobile-select.d.ts +2 -1
- package/dist/components/select/mobile-select.js +24 -13
- package/dist/components/select/select-searchable-list.d.ts +2 -1
- package/dist/components/select/select-searchable-list.js +2 -3
- package/dist/components/select/select.js +49 -25
- package/dist/components/select/use-select-selection.d.ts +1 -1
- package/dist/components/select/use-select-selection.js +7 -4
- package/dist/components/skeleton/skeleton.js +56 -48
- package/dist/components/slider/slider.js +87 -212
- package/dist/components/sonner/sonner.js +109 -93
- package/dist/components/spinner/spinner.js +147 -138
- package/dist/components/splitter/splitter.js +222 -159
- package/dist/components/statistic/statistic.js +7 -6
- package/dist/components/steps/steps.js +88 -81
- package/dist/components/steps/use-display-steps.js +1 -1
- package/dist/components/switch/switch.js +89 -89
- package/dist/components/table/table-filter.js +66 -56
- package/dist/components/table/table-icons.d.ts +2 -1
- package/dist/components/table/table-icons.js +11 -9
- package/dist/components/table/table-model.js +1 -1
- package/dist/components/table/table.js +107 -83
- package/dist/components/table/use-table-data.d.ts +6 -3
- package/dist/components/table/use-table-data.js +166 -130
- package/dist/components/tabs/tabs.css +1 -1
- package/dist/components/tabs/tabs.js +236 -179
- package/dist/components/tag/tag.d.ts +2 -2
- package/dist/components/tag/tag.js +111 -108
- package/dist/components/textarea/textarea.js +22 -17
- package/dist/components/time-picker/time-picker.js +5 -3
- package/dist/components/timeline/timeline.css +6 -1
- package/dist/components/timeline/timeline.js +21 -11
- package/dist/components/tooltip/tooltip.d.ts +2 -2
- package/dist/components/tooltip/tooltip.js +123 -233
- package/dist/components/tour/tour.css +4 -0
- package/dist/components/tour/tour.js +400 -331
- package/dist/components/transfer/transfer-list.js +29 -11
- package/dist/components/transfer/transfer-parts.js +1 -1
- package/dist/components/transfer/transfer-types.d.ts +1 -0
- package/dist/components/transfer/transfer.js +29 -14
- package/dist/components/tree/tree-keyboard.d.ts +1 -1
- package/dist/components/tree/tree-keyboard.js +5 -3
- package/dist/components/tree/tree.js +74 -59
- package/dist/components/tree-select/select-engine.d.ts +3 -2
- package/dist/components/tree-select/select-engine.js +18 -16
- package/dist/components/tree-select/tree-select.js +21 -5
- package/dist/components/upload/upload.css +8 -0
- package/dist/components/upload/upload.js +160 -72
- package/dist/components/watermark/watermark.js +36 -29
- package/dist/number-input/use-number-input.js +129 -90
- package/dist/number-input/validate.js +32 -5
- package/dist/provider/merge-locale.js +12 -9
- package/dist/provider/tao-provider.d.ts +3 -1
- package/dist/provider/tao-provider.js +123 -86
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react-compiler-runtime";
|
|
3
|
-
import { createContext, forwardRef, useContext, useEffect, useRef, useState } from "react";
|
|
3
|
+
import { createContext, forwardRef, useContext, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
4
4
|
import { useTaoConfig } from "../../provider/tao-provider.js";
|
|
5
5
|
import { mergeRefs } from "../../utils/refs.js";
|
|
6
6
|
import { cx } from "../../utils/semantic.js";
|
|
7
7
|
import "./checkbox.css";
|
|
8
8
|
const CheckboxGroupContext = /*#__PURE__*/ createContext(null);
|
|
9
|
-
const checkbox_Checkbox = /*#__PURE__*/ forwardRef(function(
|
|
10
|
-
const $ = c(
|
|
9
|
+
const checkbox_Checkbox = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
10
|
+
const $ = c(73);
|
|
11
11
|
let ariaProps;
|
|
12
12
|
let checked;
|
|
13
13
|
let children;
|
|
@@ -18,9 +18,9 @@ const checkbox_Checkbox = /*#__PURE__*/ forwardRef(function(t0, ref) {
|
|
|
18
18
|
let onChange;
|
|
19
19
|
let styles;
|
|
20
20
|
let value;
|
|
21
|
-
if ($[0] !==
|
|
22
|
-
({ checked, defaultChecked, indeterminate, disabled, onChange, value, children, classNames, styles, ...ariaProps } =
|
|
23
|
-
$[0] =
|
|
21
|
+
if ($[0] !== props) {
|
|
22
|
+
({ checked, defaultChecked, indeterminate, disabled, onChange, value, children, classNames, styles, ...ariaProps } = props);
|
|
23
|
+
$[0] = props;
|
|
24
24
|
$[1] = ariaProps;
|
|
25
25
|
$[2] = checked;
|
|
26
26
|
$[3] = children;
|
|
@@ -47,175 +47,215 @@ const checkbox_Checkbox = /*#__PURE__*/ forwardRef(function(t0, ref) {
|
|
|
47
47
|
const groupCtx = useContext(CheckboxGroupContext);
|
|
48
48
|
const inputRef = useRef(null);
|
|
49
49
|
const resolvedDisabled = disabled ?? groupCtx?.disabled ?? ctx.disabled ?? false;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
const grouped = groupCtx && null != value;
|
|
51
|
+
let t0;
|
|
52
|
+
if ($[11] !== checked || $[12] !== groupCtx || $[13] !== grouped || $[14] !== props || $[15] !== value) {
|
|
53
|
+
t0 = grouped ? groupCtx.value.includes(value) : "checked" in props ? checked ?? false : void 0;
|
|
53
54
|
$[11] = checked;
|
|
54
55
|
$[12] = groupCtx;
|
|
55
|
-
$[13] =
|
|
56
|
-
$[14] =
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
$[13] = grouped;
|
|
57
|
+
$[14] = props;
|
|
58
|
+
$[15] = value;
|
|
59
|
+
$[16] = t0;
|
|
60
|
+
} else t0 = $[16];
|
|
61
|
+
const resolvedChecked = t0;
|
|
62
|
+
let t1;
|
|
63
|
+
if ($[17] !== groupCtx || $[18] !== grouped || $[19] !== resolvedChecked || $[20] !== value) {
|
|
64
|
+
t1 = grouped ? groupCtx.resetValue.includes(value) : resolvedChecked;
|
|
65
|
+
$[17] = groupCtx;
|
|
66
|
+
$[18] = grouped;
|
|
67
|
+
$[19] = resolvedChecked;
|
|
68
|
+
$[20] = value;
|
|
69
|
+
$[21] = t1;
|
|
70
|
+
} else t1 = $[21];
|
|
71
|
+
const resetChecked = t1;
|
|
59
72
|
let t2;
|
|
60
73
|
let t3;
|
|
61
|
-
if ($[
|
|
74
|
+
if ($[22] !== resetChecked) {
|
|
62
75
|
t2 = ()=>{
|
|
63
|
-
|
|
76
|
+
const input = inputRef.current;
|
|
77
|
+
if (input?.form && void 0 !== resetChecked) input.defaultChecked = resetChecked;
|
|
64
78
|
};
|
|
65
79
|
t3 = [
|
|
66
|
-
|
|
80
|
+
resetChecked
|
|
67
81
|
];
|
|
68
|
-
$[
|
|
69
|
-
$[
|
|
70
|
-
$[
|
|
82
|
+
$[22] = resetChecked;
|
|
83
|
+
$[23] = t2;
|
|
84
|
+
$[24] = t3;
|
|
71
85
|
} else {
|
|
72
|
-
t2 = $[
|
|
73
|
-
t3 = $[
|
|
86
|
+
t2 = $[23];
|
|
87
|
+
t3 = $[24];
|
|
74
88
|
}
|
|
75
|
-
|
|
89
|
+
useLayoutEffect(t2, t3);
|
|
76
90
|
let t4;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
91
|
+
let t5;
|
|
92
|
+
if ($[25] !== indeterminate) {
|
|
93
|
+
t4 = ()=>{
|
|
94
|
+
if (inputRef.current) inputRef.current.indeterminate = !!indeterminate;
|
|
81
95
|
};
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
$[
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
$[
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
96
|
+
t5 = [
|
|
97
|
+
indeterminate
|
|
98
|
+
];
|
|
99
|
+
$[25] = indeterminate;
|
|
100
|
+
$[26] = t4;
|
|
101
|
+
$[27] = t5;
|
|
102
|
+
} else {
|
|
103
|
+
t4 = $[26];
|
|
104
|
+
t5 = $[27];
|
|
105
|
+
}
|
|
106
|
+
useEffect(t4, t5);
|
|
107
|
+
let t6;
|
|
108
|
+
if ($[28] !== groupCtx || $[29] !== indeterminate || $[30] !== onChange || $[31] !== value) {
|
|
109
|
+
t6 = (e)=>{
|
|
110
|
+
const nextChecked = e.currentTarget.checked;
|
|
111
|
+
if (indeterminate) e.currentTarget.indeterminate = true;
|
|
112
|
+
onChange?.(e);
|
|
113
|
+
if (!e.defaultPrevented && groupCtx && null != value) groupCtx.onChange(value, nextChecked);
|
|
114
|
+
};
|
|
115
|
+
$[28] = groupCtx;
|
|
116
|
+
$[29] = indeterminate;
|
|
117
|
+
$[30] = onChange;
|
|
118
|
+
$[31] = value;
|
|
119
|
+
$[32] = t6;
|
|
120
|
+
} else t6 = $[32];
|
|
121
|
+
const handleChange = t6;
|
|
122
|
+
const t7 = resolvedDisabled || void 0;
|
|
123
|
+
const t8 = groupCtx?.size ?? ctx.size;
|
|
124
|
+
const t9 = classNames?.root;
|
|
125
|
+
let t10;
|
|
126
|
+
if ($[33] !== t9) {
|
|
127
|
+
t10 = cx(t9);
|
|
128
|
+
$[33] = t9;
|
|
129
|
+
$[34] = t10;
|
|
130
|
+
} else t10 = $[34];
|
|
131
|
+
const t11 = styles?.root;
|
|
132
|
+
let t12;
|
|
133
|
+
if ($[35] !== ref) {
|
|
134
|
+
t12 = mergeRefs(inputRef, ref);
|
|
135
|
+
$[35] = ref;
|
|
136
|
+
$[36] = t12;
|
|
137
|
+
} else t12 = $[36];
|
|
138
|
+
const t13 = void 0 === resolvedChecked ? defaultChecked : void 0;
|
|
139
|
+
const t14 = indeterminate ? "mixed" : void 0;
|
|
140
|
+
let t15;
|
|
141
|
+
if ($[37] !== ariaProps || $[38] !== handleChange || $[39] !== resolvedChecked || $[40] !== resolvedDisabled || $[41] !== t12 || $[42] !== t13 || $[43] !== t14 || $[44] !== value) {
|
|
142
|
+
t15 = /*#__PURE__*/ jsx("input", {
|
|
107
143
|
...ariaProps,
|
|
108
|
-
ref:
|
|
144
|
+
ref: t12,
|
|
109
145
|
type: "checkbox",
|
|
146
|
+
value: value,
|
|
110
147
|
checked: resolvedChecked,
|
|
111
|
-
defaultChecked:
|
|
148
|
+
defaultChecked: t13,
|
|
112
149
|
disabled: resolvedDisabled,
|
|
113
150
|
onChange: handleChange,
|
|
114
|
-
"aria-checked":
|
|
151
|
+
"aria-checked": t14,
|
|
115
152
|
"data-tao-checkbox-input": ""
|
|
116
153
|
});
|
|
117
|
-
$[
|
|
118
|
-
$[
|
|
119
|
-
$[
|
|
120
|
-
$[
|
|
121
|
-
$[
|
|
122
|
-
$[
|
|
123
|
-
$[
|
|
124
|
-
$[
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
const
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
if ($[34] !== t14) {
|
|
131
|
-
t15 = cx(t14);
|
|
132
|
-
$[34] = t14;
|
|
133
|
-
$[35] = t15;
|
|
134
|
-
} else t15 = $[35];
|
|
135
|
-
const t16 = styles?.indicator;
|
|
136
|
-
let t17;
|
|
137
|
-
if ($[36] !== indeterminate) {
|
|
138
|
-
t17 = !indeterminate && /*#__PURE__*/ jsx(CheckIcon, {});
|
|
139
|
-
$[36] = indeterminate;
|
|
140
|
-
$[37] = t17;
|
|
141
|
-
} else t17 = $[37];
|
|
142
|
-
let t18;
|
|
143
|
-
if ($[38] !== indeterminate) {
|
|
144
|
-
t18 = indeterminate && /*#__PURE__*/ jsx(MinusIcon, {});
|
|
145
|
-
$[38] = indeterminate;
|
|
146
|
-
$[39] = t18;
|
|
147
|
-
} else t18 = $[39];
|
|
154
|
+
$[37] = ariaProps;
|
|
155
|
+
$[38] = handleChange;
|
|
156
|
+
$[39] = resolvedChecked;
|
|
157
|
+
$[40] = resolvedDisabled;
|
|
158
|
+
$[41] = t12;
|
|
159
|
+
$[42] = t13;
|
|
160
|
+
$[43] = t14;
|
|
161
|
+
$[44] = value;
|
|
162
|
+
$[45] = t15;
|
|
163
|
+
} else t15 = $[45];
|
|
164
|
+
const t16 = resolvedChecked || void 0;
|
|
165
|
+
const t17 = indeterminate || void 0;
|
|
166
|
+
const t18 = classNames?.indicator;
|
|
148
167
|
let t19;
|
|
149
|
-
if ($[
|
|
150
|
-
t19 =
|
|
168
|
+
if ($[46] !== t18) {
|
|
169
|
+
t19 = cx(t18);
|
|
170
|
+
$[46] = t18;
|
|
171
|
+
$[47] = t19;
|
|
172
|
+
} else t19 = $[47];
|
|
173
|
+
const t20 = styles?.indicator;
|
|
174
|
+
let t21;
|
|
175
|
+
if ($[48] !== indeterminate) {
|
|
176
|
+
t21 = !indeterminate && /*#__PURE__*/ jsx(CheckIcon, {});
|
|
177
|
+
$[48] = indeterminate;
|
|
178
|
+
$[49] = t21;
|
|
179
|
+
} else t21 = $[49];
|
|
180
|
+
let t22;
|
|
181
|
+
if ($[50] !== indeterminate) {
|
|
182
|
+
t22 = indeterminate && /*#__PURE__*/ jsx(MinusIcon, {});
|
|
183
|
+
$[50] = indeterminate;
|
|
184
|
+
$[51] = t22;
|
|
185
|
+
} else t22 = $[51];
|
|
186
|
+
let t23;
|
|
187
|
+
if ($[52] !== t16 || $[53] !== t17 || $[54] !== t19 || $[55] !== t20 || $[56] !== t21 || $[57] !== t22) {
|
|
188
|
+
t23 = /*#__PURE__*/ jsxs("span", {
|
|
151
189
|
"data-tao-checkbox": "",
|
|
152
|
-
"data-tao-checked":
|
|
153
|
-
"data-tao-indeterminate":
|
|
154
|
-
className:
|
|
155
|
-
style:
|
|
190
|
+
"data-tao-checked": t16,
|
|
191
|
+
"data-tao-indeterminate": t17,
|
|
192
|
+
className: t19,
|
|
193
|
+
style: t20,
|
|
156
194
|
children: [
|
|
157
|
-
|
|
158
|
-
|
|
195
|
+
t21,
|
|
196
|
+
t22
|
|
159
197
|
]
|
|
160
198
|
});
|
|
161
|
-
$[
|
|
162
|
-
$[
|
|
163
|
-
$[
|
|
164
|
-
$[
|
|
165
|
-
$[
|
|
166
|
-
$[
|
|
167
|
-
$[
|
|
168
|
-
} else
|
|
169
|
-
let
|
|
170
|
-
if ($[
|
|
171
|
-
|
|
199
|
+
$[52] = t16;
|
|
200
|
+
$[53] = t17;
|
|
201
|
+
$[54] = t19;
|
|
202
|
+
$[55] = t20;
|
|
203
|
+
$[56] = t21;
|
|
204
|
+
$[57] = t22;
|
|
205
|
+
$[58] = t23;
|
|
206
|
+
} else t23 = $[58];
|
|
207
|
+
let t24;
|
|
208
|
+
if ($[59] !== t15 || $[60] !== t23) {
|
|
209
|
+
t24 = /*#__PURE__*/ jsxs("span", {
|
|
172
210
|
"data-tao-checkbox-control": "",
|
|
173
211
|
children: [
|
|
174
|
-
|
|
175
|
-
|
|
212
|
+
t15,
|
|
213
|
+
t23
|
|
176
214
|
]
|
|
177
215
|
});
|
|
178
|
-
$[
|
|
179
|
-
$[
|
|
180
|
-
$[
|
|
181
|
-
} else
|
|
182
|
-
let
|
|
183
|
-
if ($[
|
|
184
|
-
|
|
216
|
+
$[59] = t15;
|
|
217
|
+
$[60] = t23;
|
|
218
|
+
$[61] = t24;
|
|
219
|
+
} else t24 = $[61];
|
|
220
|
+
let t25;
|
|
221
|
+
if ($[62] !== children || $[63] !== classNames?.label || $[64] !== styles?.label) {
|
|
222
|
+
t25 = null != children && /*#__PURE__*/ jsx("span", {
|
|
185
223
|
"data-tao-checkbox-label": "",
|
|
186
224
|
className: cx(classNames?.label),
|
|
187
225
|
style: styles?.label,
|
|
188
226
|
children: children
|
|
189
227
|
});
|
|
190
|
-
$[
|
|
191
|
-
$[
|
|
192
|
-
$[
|
|
193
|
-
$[
|
|
194
|
-
} else
|
|
195
|
-
let
|
|
196
|
-
if ($[
|
|
197
|
-
|
|
228
|
+
$[62] = children;
|
|
229
|
+
$[63] = classNames?.label;
|
|
230
|
+
$[64] = styles?.label;
|
|
231
|
+
$[65] = t25;
|
|
232
|
+
} else t25 = $[65];
|
|
233
|
+
let t26;
|
|
234
|
+
if ($[66] !== t10 || $[67] !== t11 || $[68] !== t24 || $[69] !== t25 || $[70] !== t7 || $[71] !== t8) {
|
|
235
|
+
t26 = /*#__PURE__*/ jsxs("label", {
|
|
198
236
|
"data-tao-checkbox-wrapper": "",
|
|
199
|
-
"data-tao-disabled":
|
|
200
|
-
|
|
201
|
-
|
|
237
|
+
"data-tao-disabled": t7,
|
|
238
|
+
"data-tao-size": t8,
|
|
239
|
+
className: t10,
|
|
240
|
+
style: t11,
|
|
202
241
|
children: [
|
|
203
|
-
|
|
204
|
-
|
|
242
|
+
t24,
|
|
243
|
+
t25
|
|
205
244
|
]
|
|
206
245
|
});
|
|
207
|
-
$[
|
|
208
|
-
$[
|
|
209
|
-
$[
|
|
210
|
-
$[
|
|
211
|
-
$[
|
|
212
|
-
$[
|
|
213
|
-
|
|
214
|
-
|
|
246
|
+
$[66] = t10;
|
|
247
|
+
$[67] = t11;
|
|
248
|
+
$[68] = t24;
|
|
249
|
+
$[69] = t25;
|
|
250
|
+
$[70] = t7;
|
|
251
|
+
$[71] = t8;
|
|
252
|
+
$[72] = t26;
|
|
253
|
+
} else t26 = $[72];
|
|
254
|
+
return t26;
|
|
215
255
|
});
|
|
216
256
|
function CheckboxGroup(props) {
|
|
217
|
-
const $ = c(
|
|
218
|
-
const { options, value, defaultValue, onChange, disabled, direction: t0, children } = props;
|
|
257
|
+
const $ = c(56);
|
|
258
|
+
const { options, value, defaultValue, onChange, disabled, size, direction: t0, children } = props;
|
|
219
259
|
const direction = void 0 === t0 ? "horizontal" : t0;
|
|
220
260
|
const ctx = useTaoConfig();
|
|
221
261
|
const resolvedDisabled = disabled ?? ctx.disabled ?? false;
|
|
@@ -238,9 +278,39 @@ function CheckboxGroup(props) {
|
|
|
238
278
|
$[5] = t2;
|
|
239
279
|
} else t2 = $[5];
|
|
240
280
|
const resolvedValue = t2;
|
|
281
|
+
const root = useRef(null);
|
|
241
282
|
let t3;
|
|
242
|
-
|
|
243
|
-
|
|
283
|
+
let t4;
|
|
284
|
+
if ($[6] !== defaultValue || $[7] !== isControlled) {
|
|
285
|
+
t3 = ()=>{
|
|
286
|
+
if (isControlled) return;
|
|
287
|
+
const form = root.current?.form;
|
|
288
|
+
const reset = (event)=>{
|
|
289
|
+
queueMicrotask(()=>{
|
|
290
|
+
if (!event.defaultPrevented) setInternalValue([
|
|
291
|
+
...new Set(defaultValue ?? [])
|
|
292
|
+
]);
|
|
293
|
+
});
|
|
294
|
+
};
|
|
295
|
+
form?.addEventListener("reset", reset);
|
|
296
|
+
return ()=>form?.removeEventListener("reset", reset);
|
|
297
|
+
};
|
|
298
|
+
t4 = [
|
|
299
|
+
isControlled,
|
|
300
|
+
defaultValue
|
|
301
|
+
];
|
|
302
|
+
$[6] = defaultValue;
|
|
303
|
+
$[7] = isControlled;
|
|
304
|
+
$[8] = t3;
|
|
305
|
+
$[9] = t4;
|
|
306
|
+
} else {
|
|
307
|
+
t3 = $[8];
|
|
308
|
+
t4 = $[9];
|
|
309
|
+
}
|
|
310
|
+
useEffect(t3, t4);
|
|
311
|
+
let t5;
|
|
312
|
+
if ($[10] !== isControlled || $[11] !== onChange || $[12] !== resolvedValue) {
|
|
313
|
+
t5 = (itemValue, checked)=>{
|
|
244
314
|
const next = [
|
|
245
315
|
...new Set(checked ? [
|
|
246
316
|
...resolvedValue,
|
|
@@ -248,116 +318,137 @@ function CheckboxGroup(props) {
|
|
|
248
318
|
] : resolvedValue.filter((v)=>v !== itemValue))
|
|
249
319
|
];
|
|
250
320
|
if (!isControlled) setInternalValue(next);
|
|
251
|
-
onChange?.(
|
|
321
|
+
onChange?.([
|
|
322
|
+
...next
|
|
323
|
+
]);
|
|
252
324
|
};
|
|
253
|
-
$[
|
|
254
|
-
$[
|
|
255
|
-
$[
|
|
256
|
-
$[
|
|
257
|
-
} else
|
|
258
|
-
const handleItemChange =
|
|
259
|
-
let
|
|
260
|
-
if ($[
|
|
261
|
-
|
|
325
|
+
$[10] = isControlled;
|
|
326
|
+
$[11] = onChange;
|
|
327
|
+
$[12] = resolvedValue;
|
|
328
|
+
$[13] = t5;
|
|
329
|
+
} else t5 = $[13];
|
|
330
|
+
const handleItemChange = t5;
|
|
331
|
+
let t6;
|
|
332
|
+
if ($[14] !== defaultValue || $[15] !== isControlled || $[16] !== resolvedValue) {
|
|
333
|
+
t6 = isControlled ? resolvedValue : defaultValue ?? [];
|
|
334
|
+
$[14] = defaultValue;
|
|
335
|
+
$[15] = isControlled;
|
|
336
|
+
$[16] = resolvedValue;
|
|
337
|
+
$[17] = t6;
|
|
338
|
+
} else t6 = $[17];
|
|
339
|
+
const t7 = size ?? ctx.size;
|
|
340
|
+
let t8;
|
|
341
|
+
if ($[18] !== handleItemChange || $[19] !== resolvedDisabled || $[20] !== resolvedValue || $[21] !== t6 || $[22] !== t7) {
|
|
342
|
+
t8 = {
|
|
262
343
|
value: resolvedValue,
|
|
344
|
+
resetValue: t6,
|
|
263
345
|
disabled: resolvedDisabled,
|
|
346
|
+
size: t7,
|
|
264
347
|
onChange: handleItemChange
|
|
265
348
|
};
|
|
266
|
-
$[
|
|
267
|
-
$[
|
|
268
|
-
$[
|
|
269
|
-
$[
|
|
270
|
-
|
|
271
|
-
|
|
349
|
+
$[18] = handleItemChange;
|
|
350
|
+
$[19] = resolvedDisabled;
|
|
351
|
+
$[20] = resolvedValue;
|
|
352
|
+
$[21] = t6;
|
|
353
|
+
$[22] = t7;
|
|
354
|
+
$[23] = t8;
|
|
355
|
+
} else t8 = $[23];
|
|
356
|
+
const groupCtxValue = t8;
|
|
272
357
|
let T0;
|
|
273
358
|
let t10;
|
|
274
359
|
let t11;
|
|
275
360
|
let t12;
|
|
276
361
|
let t13;
|
|
277
362
|
let t14;
|
|
278
|
-
let
|
|
279
|
-
let
|
|
280
|
-
let
|
|
281
|
-
let
|
|
363
|
+
let t15;
|
|
364
|
+
let t16;
|
|
365
|
+
let t17;
|
|
366
|
+
let t18;
|
|
367
|
+
let t19;
|
|
282
368
|
let t9;
|
|
283
|
-
if ($[
|
|
369
|
+
if ($[24] !== children || $[25] !== direction || $[26] !== groupCtxValue || $[27] !== options || $[28] !== props) {
|
|
284
370
|
const normalizedOptions = options?.map(_temp);
|
|
285
371
|
T0 = CheckboxGroupContext.Provider;
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
$[
|
|
298
|
-
$[
|
|
299
|
-
$[
|
|
300
|
-
$[
|
|
301
|
-
$[
|
|
302
|
-
$[
|
|
303
|
-
$[21] = t11;
|
|
304
|
-
$[22] = t12;
|
|
305
|
-
$[23] = t13;
|
|
306
|
-
$[24] = t14;
|
|
307
|
-
$[25] = t5;
|
|
308
|
-
$[26] = t6;
|
|
309
|
-
$[27] = t7;
|
|
310
|
-
$[28] = t8;
|
|
311
|
-
$[29] = t9;
|
|
312
|
-
} else {
|
|
313
|
-
T0 = $[19];
|
|
314
|
-
t10 = $[20];
|
|
315
|
-
t11 = $[21];
|
|
316
|
-
t12 = $[22];
|
|
317
|
-
t13 = $[23];
|
|
318
|
-
t14 = $[24];
|
|
319
|
-
t5 = $[25];
|
|
320
|
-
t6 = $[26];
|
|
321
|
-
t7 = $[27];
|
|
322
|
-
t8 = $[28];
|
|
323
|
-
t9 = $[29];
|
|
324
|
-
}
|
|
325
|
-
let t15;
|
|
326
|
-
if ($[30] !== t10 || $[31] !== t11 || $[32] !== t12 || $[33] !== t13 || $[34] !== t5 || $[35] !== t6 || $[36] !== t7 || $[37] !== t8 || $[38] !== t9) {
|
|
327
|
-
t15 = /*#__PURE__*/ jsx("fieldset", {
|
|
328
|
-
"data-tao-checkbox-group": t5,
|
|
329
|
-
"data-tao-direction": t6,
|
|
330
|
-
id: t7,
|
|
331
|
-
"aria-label": t8,
|
|
332
|
-
"aria-labelledby": t9,
|
|
333
|
-
"aria-describedby": t10,
|
|
334
|
-
"aria-errormessage": t11,
|
|
335
|
-
"aria-invalid": t12,
|
|
336
|
-
children: t13
|
|
337
|
-
});
|
|
372
|
+
t19 = groupCtxValue;
|
|
373
|
+
t9 = root;
|
|
374
|
+
t10 = "";
|
|
375
|
+
t11 = direction;
|
|
376
|
+
t12 = props.id;
|
|
377
|
+
t13 = props["aria-label"];
|
|
378
|
+
t14 = props["aria-labelledby"];
|
|
379
|
+
t15 = props["aria-describedby"];
|
|
380
|
+
t16 = props["aria-errormessage"];
|
|
381
|
+
t17 = props["aria-invalid"];
|
|
382
|
+
t18 = normalizedOptions ? normalizedOptions.map(_temp2) : children;
|
|
383
|
+
$[24] = children;
|
|
384
|
+
$[25] = direction;
|
|
385
|
+
$[26] = groupCtxValue;
|
|
386
|
+
$[27] = options;
|
|
387
|
+
$[28] = props;
|
|
388
|
+
$[29] = T0;
|
|
338
389
|
$[30] = t10;
|
|
339
390
|
$[31] = t11;
|
|
340
391
|
$[32] = t12;
|
|
341
392
|
$[33] = t13;
|
|
342
|
-
$[34] =
|
|
343
|
-
$[35] =
|
|
344
|
-
$[36] =
|
|
345
|
-
$[37] =
|
|
346
|
-
$[38] =
|
|
347
|
-
$[39] =
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
393
|
+
$[34] = t14;
|
|
394
|
+
$[35] = t15;
|
|
395
|
+
$[36] = t16;
|
|
396
|
+
$[37] = t17;
|
|
397
|
+
$[38] = t18;
|
|
398
|
+
$[39] = t19;
|
|
399
|
+
$[40] = t9;
|
|
400
|
+
} else {
|
|
401
|
+
T0 = $[29];
|
|
402
|
+
t10 = $[30];
|
|
403
|
+
t11 = $[31];
|
|
404
|
+
t12 = $[32];
|
|
405
|
+
t13 = $[33];
|
|
406
|
+
t14 = $[34];
|
|
407
|
+
t15 = $[35];
|
|
408
|
+
t16 = $[36];
|
|
409
|
+
t17 = $[37];
|
|
410
|
+
t18 = $[38];
|
|
411
|
+
t19 = $[39];
|
|
412
|
+
t9 = $[40];
|
|
413
|
+
}
|
|
414
|
+
let t20;
|
|
415
|
+
if ($[41] !== t10 || $[42] !== t11 || $[43] !== t12 || $[44] !== t13 || $[45] !== t14 || $[46] !== t15 || $[47] !== t16 || $[48] !== t17 || $[49] !== t18 || $[50] !== t9) {
|
|
416
|
+
t20 = /*#__PURE__*/ jsx("fieldset", {
|
|
417
|
+
ref: t9,
|
|
418
|
+
"data-tao-checkbox-group": t10,
|
|
419
|
+
"data-tao-direction": t11,
|
|
420
|
+
id: t12,
|
|
421
|
+
"aria-label": t13,
|
|
422
|
+
"aria-labelledby": t14,
|
|
423
|
+
"aria-describedby": t15,
|
|
424
|
+
"aria-errormessage": t16,
|
|
425
|
+
"aria-invalid": t17,
|
|
426
|
+
children: t18
|
|
354
427
|
});
|
|
355
|
-
$[
|
|
356
|
-
$[
|
|
357
|
-
$[
|
|
358
|
-
$[
|
|
359
|
-
|
|
360
|
-
|
|
428
|
+
$[41] = t10;
|
|
429
|
+
$[42] = t11;
|
|
430
|
+
$[43] = t12;
|
|
431
|
+
$[44] = t13;
|
|
432
|
+
$[45] = t14;
|
|
433
|
+
$[46] = t15;
|
|
434
|
+
$[47] = t16;
|
|
435
|
+
$[48] = t17;
|
|
436
|
+
$[49] = t18;
|
|
437
|
+
$[50] = t9;
|
|
438
|
+
$[51] = t20;
|
|
439
|
+
} else t20 = $[51];
|
|
440
|
+
let t21;
|
|
441
|
+
if ($[52] !== T0 || $[53] !== t19 || $[54] !== t20) {
|
|
442
|
+
t21 = /*#__PURE__*/ jsx(T0, {
|
|
443
|
+
value: t19,
|
|
444
|
+
children: t20
|
|
445
|
+
});
|
|
446
|
+
$[52] = T0;
|
|
447
|
+
$[53] = t19;
|
|
448
|
+
$[54] = t20;
|
|
449
|
+
$[55] = t21;
|
|
450
|
+
} else t21 = $[55];
|
|
451
|
+
return t21;
|
|
361
452
|
}
|
|
362
453
|
function _temp2(opt_0) {
|
|
363
454
|
return /*#__PURE__*/ jsx(checkbox_Checkbox, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { CollapseItem, CollapseProps } from './collapse.js';
|
|
2
|
-
export declare function CollapsePanels(
|
|
2
|
+
export declare function CollapsePanels(props: CollapseProps & {
|
|
3
3
|
items: CollapseItem[];
|
|
4
4
|
}): import("react").JSX.Element;
|