@rockshin/tao-ui 0.0.57 → 0.0.59
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 +38 -4
- package/dist/components/app/app-modals.js +11 -6
- package/dist/components/app/app-notices.js +112 -47
- package/dist/components/auto-complete/auto-complete.js +9 -2
- package/dist/components/avatar/avatar.js +1 -1
- package/dist/components/badge/badge.js +2 -2
- package/dist/components/breadcrumb/breadcrumb.js +5 -1
- package/dist/components/calendar/calendar.js +24 -17
- package/dist/components/carousel/carousel.js +35 -16
- package/dist/components/cascader/cascader.js +17 -12
- package/dist/components/checkbox/checkbox.d.ts +3 -1
- package/dist/components/checkbox/checkbox.js +65 -58
- package/dist/components/collapse/collapse-panels.js +68 -67
- package/dist/components/color-picker/color-picker.js +383 -360
- package/dist/components/date-picker/calendar/calendar-grid.d.ts +5 -3
- package/dist/components/date-picker/calendar/calendar-grid.js +9 -4
- package/dist/components/date-picker/calendar/month-grid.d.ts +2 -1
- package/dist/components/date-picker/calendar/month-grid.js +61 -45
- package/dist/components/date-picker/calendar/time-panel.d.ts +8 -1
- package/dist/components/date-picker/calendar/time-panel.js +89 -88
- package/dist/components/date-picker/calendar/year-grid.d.ts +2 -1
- package/dist/components/date-picker/calendar/year-grid.js +60 -44
- package/dist/components/date-picker/date-localization.js +12 -14
- package/dist/components/date-picker/date-picker.css +9 -0
- package/dist/components/date-picker/date-picker.js +22 -13
- package/dist/components/date-picker/range-picker.d.ts +2 -0
- package/dist/components/date-picker/range-picker.js +127 -70
- package/dist/components/date-picker/types.js +1 -1
- package/dist/components/divider/divider.js +1 -1
- package/dist/components/drawer/drawer.d.ts +1 -1
- package/dist/components/drawer/drawer.js +4 -3
- package/dist/components/dropdown/dropdown.js +11 -9
- package/dist/components/float-button/float-button.js +11 -9
- package/dist/components/form/form-item.d.ts +1 -1
- package/dist/components/form/form-item.js +160 -120
- package/dist/components/form-field/form-field-view.d.ts +2 -1
- package/dist/components/form-field/form-field-view.js +173 -108
- package/dist/components/image/image.js +135 -143
- package/dist/components/input/input-shared.js +3 -2
- package/dist/components/input/otp.js +120 -110
- package/dist/components/input/password.js +55 -61
- package/dist/components/input/search.js +13 -7
- package/dist/components/list/list.js +106 -105
- package/dist/components/masonry/masonry.js +1 -1
- package/dist/components/mentions/mentions.js +1 -0
- package/dist/components/menu/menu-render.js +1 -0
- package/dist/components/modal/confirm-dialog.js +11 -4
- package/dist/components/modal/modal.js +320 -315
- package/dist/components/pagination/pagination.d.ts +3 -0
- package/dist/components/pagination/pagination.js +5 -0
- package/dist/components/popover/popover.js +325 -289
- package/dist/components/qr-code/qr-code.js +157 -150
- package/dist/components/radio/radio.d.ts +3 -1
- package/dist/components/radio/radio.js +73 -64
- package/dist/components/rate/rate.js +83 -72
- package/dist/components/scroll-area/scroll-area.css +1 -1
- package/dist/components/scroll-area/scroll-area.js +294 -222
- package/dist/components/select/mobile-select.js +6 -3
- package/dist/components/select/select-model.js +2 -2
- package/dist/components/select/select.js +78 -39
- package/dist/components/select/use-select-selection.d.ts +1 -1
- package/dist/components/select/use-select-selection.js +91 -84
- package/dist/components/slider/slider.d.ts +2 -2
- package/dist/components/slider/slider.js +13 -2
- package/dist/components/sonner/sonner.js +2 -2
- package/dist/components/splitter/splitter.css +1 -0
- package/dist/components/splitter/splitter.js +152 -126
- package/dist/components/statistic/statistic.js +84 -78
- package/dist/components/steps/steps.js +1 -1
- package/dist/components/switch/switch.js +45 -39
- package/dist/components/table/table.js +5 -1
- package/dist/components/table/use-table-data.js +2 -2
- package/dist/components/time-picker/time-picker.js +31 -1
- package/dist/components/tooltip/tooltip.js +237 -99
- package/dist/components/tree/tree.js +31 -3
- package/dist/components/tree-select/tree-select.js +1 -1
- package/dist/components/upload/upload.js +69 -42
- package/dist/locales/ar-EG.js +2 -0
- package/dist/locales/de-DE.js +2 -0
- package/dist/locales/en-US.js +2 -0
- package/dist/locales/es-ES.js +2 -0
- package/dist/locales/fr-FR.js +2 -0
- package/dist/locales/hi-IN.js +2 -0
- package/dist/locales/id-ID.js +2 -0
- package/dist/locales/it-IT.js +2 -0
- package/dist/locales/ja-JP.js +2 -0
- package/dist/locales/ko-KR.js +2 -0
- package/dist/locales/pt-BR.js +2 -0
- package/dist/locales/ru-RU.js +2 -0
- package/dist/locales/th-TH.js +2 -0
- package/dist/locales/tr-TR.js +2 -0
- package/dist/locales/types.d.ts +2 -0
- package/dist/locales/vi-VN.js +2 -0
- package/dist/locales/zh-CN.js +2 -0
- package/dist/locales/zh-TW.js +2 -0
- package/dist/number-input/cursor.js +20 -8
- package/dist/number-input/format.js +13 -5
- package/dist/number-input/use-number-input.js +166 -318
- package/dist/number-input/validate.d.ts +1 -0
- package/dist/number-input/validate.js +1 -1
- package/dist/provider/tao-provider.d.ts +2 -2
- package/dist/provider/tao-provider.js +49 -49
- package/dist/utils/composed-parent.d.ts +1 -0
- package/dist/utils/composed-parent.js +7 -0
- package/dist/utils/portal.d.ts +5 -0
- package/dist/utils/portal.js +7 -1
- package/dist/utils/refs.d.ts +3 -1
- package/dist/utils/refs.js +25 -1
- package/package.json +1 -1
|
@@ -9,7 +9,10 @@ import { Button } from "../button/button.js";
|
|
|
9
9
|
import { Spinner } from "../spinner/spinner.js";
|
|
10
10
|
import "./qr-code.css";
|
|
11
11
|
const qr_code_QRCode = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
12
|
-
const $ = c(
|
|
12
|
+
const $ = c(84);
|
|
13
|
+
let ariaDescribedBy;
|
|
14
|
+
let ariaLabel;
|
|
15
|
+
let ariaLabelledBy;
|
|
13
16
|
let boostLevel;
|
|
14
17
|
let className;
|
|
15
18
|
let classNames;
|
|
@@ -33,53 +36,59 @@ const qr_code_QRCode = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
33
36
|
let title;
|
|
34
37
|
let value;
|
|
35
38
|
if ($[0] !== props) {
|
|
36
|
-
({ value, type: t0, size: t1, icon, iconSize: t2, bordered: t3, errorLevel: t4, status: t5, onRefresh, statusRender, color, bgColor: t6, marginSize, boostLevel, title, className, rootClassName, prefixCls, classNames, styles, style, ...rest } = props);
|
|
39
|
+
({ value, type: t0, size: t1, icon, iconSize: t2, bordered: t3, errorLevel: t4, status: t5, onRefresh, statusRender, color, bgColor: t6, marginSize, boostLevel, title, className, rootClassName, prefixCls, classNames, styles, style, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, ...rest } = props);
|
|
37
40
|
$[0] = props;
|
|
38
|
-
$[1] =
|
|
39
|
-
$[2] =
|
|
40
|
-
$[3] =
|
|
41
|
-
$[4] =
|
|
42
|
-
$[5] =
|
|
43
|
-
$[6] =
|
|
44
|
-
$[7] =
|
|
45
|
-
$[8] =
|
|
46
|
-
$[9] =
|
|
47
|
-
$[10] =
|
|
48
|
-
$[11] =
|
|
49
|
-
$[12] =
|
|
50
|
-
$[13] =
|
|
51
|
-
$[14] =
|
|
52
|
-
$[15] =
|
|
53
|
-
$[16] =
|
|
54
|
-
$[17] =
|
|
55
|
-
$[18] =
|
|
56
|
-
$[19] =
|
|
57
|
-
$[20] =
|
|
58
|
-
$[21] =
|
|
59
|
-
$[22] =
|
|
41
|
+
$[1] = ariaDescribedBy;
|
|
42
|
+
$[2] = ariaLabel;
|
|
43
|
+
$[3] = ariaLabelledBy;
|
|
44
|
+
$[4] = boostLevel;
|
|
45
|
+
$[5] = className;
|
|
46
|
+
$[6] = classNames;
|
|
47
|
+
$[7] = color;
|
|
48
|
+
$[8] = icon;
|
|
49
|
+
$[9] = marginSize;
|
|
50
|
+
$[10] = onRefresh;
|
|
51
|
+
$[11] = prefixCls;
|
|
52
|
+
$[12] = rest;
|
|
53
|
+
$[13] = rootClassName;
|
|
54
|
+
$[14] = statusRender;
|
|
55
|
+
$[15] = style;
|
|
56
|
+
$[16] = styles;
|
|
57
|
+
$[17] = t0;
|
|
58
|
+
$[18] = t1;
|
|
59
|
+
$[19] = t2;
|
|
60
|
+
$[20] = t3;
|
|
61
|
+
$[21] = t4;
|
|
62
|
+
$[22] = t5;
|
|
63
|
+
$[23] = t6;
|
|
64
|
+
$[24] = title;
|
|
65
|
+
$[25] = value;
|
|
60
66
|
} else {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
67
|
+
ariaDescribedBy = $[1];
|
|
68
|
+
ariaLabel = $[2];
|
|
69
|
+
ariaLabelledBy = $[3];
|
|
70
|
+
boostLevel = $[4];
|
|
71
|
+
className = $[5];
|
|
72
|
+
classNames = $[6];
|
|
73
|
+
color = $[7];
|
|
74
|
+
icon = $[8];
|
|
75
|
+
marginSize = $[9];
|
|
76
|
+
onRefresh = $[10];
|
|
77
|
+
prefixCls = $[11];
|
|
78
|
+
rest = $[12];
|
|
79
|
+
rootClassName = $[13];
|
|
80
|
+
statusRender = $[14];
|
|
81
|
+
style = $[15];
|
|
82
|
+
styles = $[16];
|
|
83
|
+
t0 = $[17];
|
|
84
|
+
t1 = $[18];
|
|
85
|
+
t2 = $[19];
|
|
86
|
+
t3 = $[20];
|
|
87
|
+
t4 = $[21];
|
|
88
|
+
t5 = $[22];
|
|
89
|
+
t6 = $[23];
|
|
90
|
+
title = $[24];
|
|
91
|
+
value = $[25];
|
|
83
92
|
}
|
|
84
93
|
const type = void 0 === t0 ? "canvas" : t0;
|
|
85
94
|
const size = void 0 === t1 ? 160 : t1;
|
|
@@ -92,24 +101,24 @@ const qr_code_QRCode = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
92
101
|
const root = useRef(null);
|
|
93
102
|
const [themeColor, setThemeColor] = useState("#000000");
|
|
94
103
|
let t7;
|
|
95
|
-
if ($[
|
|
104
|
+
if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
|
|
96
105
|
t7 = ()=>root.current ? {
|
|
97
106
|
nativeElement: root.current
|
|
98
107
|
} : null;
|
|
99
|
-
$[
|
|
100
|
-
} else t7 = $[
|
|
108
|
+
$[26] = t7;
|
|
109
|
+
} else t7 = $[26];
|
|
101
110
|
useImperativeHandle(ref, t7);
|
|
102
111
|
let t8;
|
|
103
|
-
if ($[
|
|
112
|
+
if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
|
|
104
113
|
t8 = ()=>{
|
|
105
114
|
if (root.current) setThemeColor(getComputedStyle(root.current).color);
|
|
106
115
|
};
|
|
107
|
-
$[
|
|
108
|
-
} else t8 = $[
|
|
116
|
+
$[27] = t8;
|
|
117
|
+
} else t8 = $[27];
|
|
109
118
|
useLayoutEffect(t8);
|
|
110
119
|
let names;
|
|
111
120
|
let t9;
|
|
112
|
-
if ($[
|
|
121
|
+
if ($[28] !== bgColor || $[29] !== bordered || $[30] !== classNames || $[31] !== errorLevel || $[32] !== props || $[33] !== size || $[34] !== status || $[35] !== styles || $[36] !== type) {
|
|
113
122
|
const mergedProps = {
|
|
114
123
|
...props,
|
|
115
124
|
type,
|
|
@@ -125,27 +134,27 @@ const qr_code_QRCode = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
125
134
|
t9 = "function" == typeof styles ? styles({
|
|
126
135
|
props: mergedProps
|
|
127
136
|
}) : styles;
|
|
128
|
-
$[
|
|
129
|
-
$[
|
|
130
|
-
$[
|
|
131
|
-
$[
|
|
132
|
-
$[
|
|
133
|
-
$[
|
|
134
|
-
$[
|
|
135
|
-
$[
|
|
136
|
-
$[
|
|
137
|
-
$[
|
|
138
|
-
$[
|
|
137
|
+
$[28] = bgColor;
|
|
138
|
+
$[29] = bordered;
|
|
139
|
+
$[30] = classNames;
|
|
140
|
+
$[31] = errorLevel;
|
|
141
|
+
$[32] = props;
|
|
142
|
+
$[33] = size;
|
|
143
|
+
$[34] = status;
|
|
144
|
+
$[35] = styles;
|
|
145
|
+
$[36] = type;
|
|
146
|
+
$[37] = names;
|
|
147
|
+
$[38] = t9;
|
|
139
148
|
} else {
|
|
140
|
-
names = $[
|
|
141
|
-
t9 = $[
|
|
149
|
+
names = $[37];
|
|
150
|
+
t9 = $[38];
|
|
142
151
|
}
|
|
143
152
|
const semanticStyles = t9;
|
|
144
153
|
const locale = config.locale.qrCode ?? enUS.qrCode;
|
|
145
154
|
if (!value) return null;
|
|
146
155
|
const t10 = color ?? themeColor;
|
|
147
156
|
let t11;
|
|
148
|
-
if ($[
|
|
157
|
+
if ($[39] !== icon || $[40] !== iconSize) {
|
|
149
158
|
t11 = icon ? {
|
|
150
159
|
src: icon,
|
|
151
160
|
height: "number" == typeof iconSize ? iconSize : iconSize.height,
|
|
@@ -153,16 +162,14 @@ const qr_code_QRCode = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
153
162
|
excavate: true,
|
|
154
163
|
crossOrigin: "anonymous"
|
|
155
164
|
} : void 0;
|
|
156
|
-
$[
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
159
|
-
} else t11 = $[
|
|
160
|
-
const t12 =
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
if ($[39] !== bgColor || $[40] !== boostLevel || $[41] !== errorLevel || $[42] !== marginSize || $[43] !== size || $[44] !== t10 || $[45] !== t11 || $[46] !== t12 || $[47] !== t13 || $[48] !== t14 || $[49] !== title || $[50] !== value) {
|
|
165
|
-
t15 = {
|
|
165
|
+
$[39] = icon;
|
|
166
|
+
$[40] = iconSize;
|
|
167
|
+
$[41] = t11;
|
|
168
|
+
} else t11 = $[41];
|
|
169
|
+
const t12 = ariaLabel ?? title ?? "QR Code";
|
|
170
|
+
let t13;
|
|
171
|
+
if ($[42] !== ariaDescribedBy || $[43] !== ariaLabelledBy || $[44] !== bgColor || $[45] !== boostLevel || $[46] !== errorLevel || $[47] !== marginSize || $[48] !== size || $[49] !== t10 || $[50] !== t11 || $[51] !== t12 || $[52] !== title || $[53] !== value) {
|
|
172
|
+
t13 = {
|
|
166
173
|
value,
|
|
167
174
|
size,
|
|
168
175
|
level: errorLevel,
|
|
@@ -174,64 +181,64 @@ const qr_code_QRCode = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
174
181
|
imageSettings: t11,
|
|
175
182
|
role: "img",
|
|
176
183
|
"aria-label": t12,
|
|
177
|
-
"aria-labelledby":
|
|
178
|
-
"aria-describedby":
|
|
184
|
+
"aria-labelledby": ariaLabelledBy,
|
|
185
|
+
"aria-describedby": ariaDescribedBy
|
|
179
186
|
};
|
|
180
|
-
$[
|
|
181
|
-
$[
|
|
182
|
-
$[
|
|
183
|
-
$[
|
|
184
|
-
$[
|
|
185
|
-
$[
|
|
186
|
-
$[
|
|
187
|
-
$[
|
|
188
|
-
$[
|
|
189
|
-
$[
|
|
190
|
-
$[
|
|
191
|
-
$[
|
|
192
|
-
$[
|
|
193
|
-
} else
|
|
194
|
-
const qrProps =
|
|
195
|
-
const
|
|
187
|
+
$[42] = ariaDescribedBy;
|
|
188
|
+
$[43] = ariaLabelledBy;
|
|
189
|
+
$[44] = bgColor;
|
|
190
|
+
$[45] = boostLevel;
|
|
191
|
+
$[46] = errorLevel;
|
|
192
|
+
$[47] = marginSize;
|
|
193
|
+
$[48] = size;
|
|
194
|
+
$[49] = t10;
|
|
195
|
+
$[50] = t11;
|
|
196
|
+
$[51] = t12;
|
|
197
|
+
$[52] = title;
|
|
198
|
+
$[53] = value;
|
|
199
|
+
$[54] = t13;
|
|
200
|
+
} else t13 = $[54];
|
|
201
|
+
const qrProps = t13;
|
|
202
|
+
const t14 = names?.root;
|
|
203
|
+
let t15;
|
|
204
|
+
if ($[55] !== className || $[56] !== prefixCls || $[57] !== rootClassName || $[58] !== t14) {
|
|
205
|
+
t15 = cx(prefixCls, t14, rootClassName, className);
|
|
206
|
+
$[55] = className;
|
|
207
|
+
$[56] = prefixCls;
|
|
208
|
+
$[57] = rootClassName;
|
|
209
|
+
$[58] = t14;
|
|
210
|
+
$[59] = t15;
|
|
211
|
+
} else t15 = $[59];
|
|
212
|
+
const t16 = semanticStyles?.root;
|
|
196
213
|
let t17;
|
|
197
|
-
if ($[
|
|
198
|
-
t17 =
|
|
199
|
-
$[52] = className;
|
|
200
|
-
$[53] = prefixCls;
|
|
201
|
-
$[54] = rootClassName;
|
|
202
|
-
$[55] = t16;
|
|
203
|
-
$[56] = t17;
|
|
204
|
-
} else t17 = $[56];
|
|
205
|
-
const t18 = semanticStyles?.root;
|
|
206
|
-
let t19;
|
|
207
|
-
if ($[57] !== bgColor || $[58] !== size || $[59] !== style || $[60] !== t18) {
|
|
208
|
-
t19 = {
|
|
214
|
+
if ($[60] !== bgColor || $[61] !== size || $[62] !== style || $[63] !== t16) {
|
|
215
|
+
t17 = {
|
|
209
216
|
width: size,
|
|
210
217
|
height: size,
|
|
211
218
|
backgroundColor: bgColor,
|
|
212
|
-
...
|
|
219
|
+
...t16,
|
|
213
220
|
...style
|
|
214
221
|
};
|
|
215
|
-
$[
|
|
216
|
-
$[
|
|
217
|
-
$[
|
|
218
|
-
$[
|
|
219
|
-
$[
|
|
220
|
-
} else
|
|
221
|
-
let
|
|
222
|
-
if ($[
|
|
223
|
-
|
|
222
|
+
$[60] = bgColor;
|
|
223
|
+
$[61] = size;
|
|
224
|
+
$[62] = style;
|
|
225
|
+
$[63] = t16;
|
|
226
|
+
$[64] = t17;
|
|
227
|
+
} else t17 = $[64];
|
|
228
|
+
let t18;
|
|
229
|
+
if ($[65] !== qrProps || $[66] !== type) {
|
|
230
|
+
t18 = "svg" === type ? /*#__PURE__*/ jsx(QRCodeSVG, {
|
|
224
231
|
...qrProps
|
|
225
232
|
}) : /*#__PURE__*/ jsx(QRCodeCanvas, {
|
|
226
233
|
...qrProps
|
|
227
234
|
});
|
|
228
|
-
$[
|
|
229
|
-
$[
|
|
230
|
-
$[
|
|
231
|
-
} else
|
|
232
|
-
let
|
|
233
|
-
if ($[
|
|
234
|
-
|
|
235
|
+
$[65] = qrProps;
|
|
236
|
+
$[66] = type;
|
|
237
|
+
$[67] = t18;
|
|
238
|
+
} else t18 = $[67];
|
|
239
|
+
let t19;
|
|
240
|
+
if ($[68] !== config.locale.messages || $[69] !== locale || $[70] !== names?.cover || $[71] !== onRefresh || $[72] !== semanticStyles?.cover || $[73] !== status || $[74] !== statusRender) {
|
|
241
|
+
t19 = "active" !== status && /*#__PURE__*/ jsx("div", {
|
|
235
242
|
"data-tao-qr-cover": "",
|
|
236
243
|
role: "status",
|
|
237
244
|
className: names?.cover,
|
|
@@ -255,39 +262,39 @@ const qr_code_QRCode = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
255
262
|
]
|
|
256
263
|
})
|
|
257
264
|
});
|
|
258
|
-
$[
|
|
259
|
-
$[
|
|
260
|
-
$[
|
|
261
|
-
$[
|
|
262
|
-
$[
|
|
263
|
-
$[
|
|
264
|
-
$[
|
|
265
|
-
$[
|
|
266
|
-
} else
|
|
267
|
-
let
|
|
268
|
-
if ($[
|
|
269
|
-
|
|
265
|
+
$[68] = config.locale.messages;
|
|
266
|
+
$[69] = locale;
|
|
267
|
+
$[70] = names?.cover;
|
|
268
|
+
$[71] = onRefresh;
|
|
269
|
+
$[72] = semanticStyles?.cover;
|
|
270
|
+
$[73] = status;
|
|
271
|
+
$[74] = statusRender;
|
|
272
|
+
$[75] = t19;
|
|
273
|
+
} else t19 = $[75];
|
|
274
|
+
let t20;
|
|
275
|
+
if ($[76] !== bordered || $[77] !== rest || $[78] !== status || $[79] !== t15 || $[80] !== t17 || $[81] !== t18 || $[82] !== t19) {
|
|
276
|
+
t20 = /*#__PURE__*/ jsxs("div", {
|
|
270
277
|
...rest,
|
|
271
278
|
ref: root,
|
|
272
279
|
"data-tao-qr-code": "",
|
|
273
280
|
"data-bordered": bordered,
|
|
274
281
|
"data-status": status,
|
|
275
|
-
className:
|
|
276
|
-
style:
|
|
282
|
+
className: t15,
|
|
283
|
+
style: t17,
|
|
277
284
|
children: [
|
|
278
|
-
|
|
279
|
-
|
|
285
|
+
t18,
|
|
286
|
+
t19
|
|
280
287
|
]
|
|
281
288
|
});
|
|
282
|
-
$[
|
|
283
|
-
$[
|
|
284
|
-
$[
|
|
285
|
-
$[
|
|
286
|
-
$[
|
|
287
|
-
$[
|
|
288
|
-
$[
|
|
289
|
-
$[
|
|
290
|
-
} else
|
|
291
|
-
return
|
|
289
|
+
$[76] = bordered;
|
|
290
|
+
$[77] = rest;
|
|
291
|
+
$[78] = status;
|
|
292
|
+
$[79] = t15;
|
|
293
|
+
$[80] = t17;
|
|
294
|
+
$[81] = t18;
|
|
295
|
+
$[82] = t19;
|
|
296
|
+
$[83] = t20;
|
|
297
|
+
} else t20 = $[83];
|
|
298
|
+
return t20;
|
|
292
299
|
});
|
|
293
300
|
export { qr_code_QRCode as QRCode };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AriaAttributes, type ChangeEvent, type ReactNode, type Ref } from 'react';
|
|
1
|
+
import { type AriaAttributes, type ChangeEvent, type FocusEventHandler, type ReactNode, type Ref } from 'react';
|
|
2
2
|
import { type TaoSize } from '../../provider/tao-provider.js';
|
|
3
3
|
import { type SemanticClassNames, type SemanticStyles } from '../../utils/semantic.js';
|
|
4
4
|
import './radio.css';
|
|
@@ -29,6 +29,8 @@ export interface RadioGroupProps extends Pick<AriaAttributes, 'aria-label' | 'ar
|
|
|
29
29
|
value?: string;
|
|
30
30
|
defaultValue?: string;
|
|
31
31
|
onChange?: (value: string) => void;
|
|
32
|
+
/** Fires when focus leaves any radio in the group (Form validateTrigger). */
|
|
33
|
+
onBlur?: FocusEventHandler<HTMLDivElement>;
|
|
32
34
|
disabled?: boolean;
|
|
33
35
|
size?: TaoSize;
|
|
34
36
|
direction?: 'horizontal' | 'vertical';
|
|
@@ -4,6 +4,7 @@ import useLayoutEffect from "@rc-component/util/es/hooks/useLayoutEffect";
|
|
|
4
4
|
import { createContext, forwardRef, useContext, useEffect, useId, useRef, useState } from "react";
|
|
5
5
|
import { useTaoConfig } from "../../provider/tao-provider.js";
|
|
6
6
|
import { cx } from "../../utils/semantic.js";
|
|
7
|
+
import { useFormLayout } from "../form/form-context.js";
|
|
7
8
|
import "./radio.css";
|
|
8
9
|
const RadioGroupContext = /*#__PURE__*/ createContext(null);
|
|
9
10
|
const radio_Radio = /*#__PURE__*/ forwardRef(function(t0, ref) {
|
|
@@ -51,6 +52,7 @@ const radio_Radio = /*#__PURE__*/ forwardRef(function(t0, ref) {
|
|
|
51
52
|
}
|
|
52
53
|
const ctx = useTaoConfig();
|
|
53
54
|
const groupCtx = useContext(RadioGroupContext);
|
|
55
|
+
const inForm = null != useFormLayout().form;
|
|
54
56
|
const resolvedDisabled = disabled ?? groupCtx?.disabled ?? ctx.disabled ?? false;
|
|
55
57
|
const grouped = null != groupCtx && null != value;
|
|
56
58
|
const resolvedChecked = grouped ? groupCtx.value === value : checked;
|
|
@@ -78,7 +80,7 @@ const radio_Radio = /*#__PURE__*/ forwardRef(function(t0, ref) {
|
|
|
78
80
|
$[19] = t5;
|
|
79
81
|
} else t5 = $[19];
|
|
80
82
|
const t6 = styles?.root;
|
|
81
|
-
const t7 = required ?? (void 0 === ariaRequired ? grouped && groupCtx.required : true === ariaRequired || "true" === ariaRequired);
|
|
83
|
+
const t7 = required ?? (!inForm && (void 0 === ariaRequired ? grouped && groupCtx.required : true === ariaRequired || "true" === ariaRequired));
|
|
82
84
|
let t8;
|
|
83
85
|
if ($[20] !== ariaProps || $[21] !== defaultChecked || $[22] !== handleChange || $[23] !== ref || $[24] !== resolvedChecked || $[25] !== resolvedDisabled || $[26] !== resolvedName || $[27] !== t7 || $[28] !== value) {
|
|
84
86
|
t8 = /*#__PURE__*/ jsx("input", {
|
|
@@ -177,9 +179,9 @@ const radio_Radio = /*#__PURE__*/ forwardRef(function(t0, ref) {
|
|
|
177
179
|
return t16;
|
|
178
180
|
});
|
|
179
181
|
function RadioGroup(props) {
|
|
180
|
-
const $ = c(
|
|
182
|
+
const $ = c(63);
|
|
181
183
|
const generatedName = useId();
|
|
182
|
-
const { options, value, defaultValue, onChange, disabled, size, direction: t0, name, children, id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-errormessage": ariaErrorMessage, "aria-invalid": ariaInvalid, "aria-required": ariaRequired } = props;
|
|
184
|
+
const { options, value, defaultValue, onChange, onBlur, disabled, size, direction: t0, name, children, id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-errormessage": ariaErrorMessage, "aria-invalid": ariaInvalid, "aria-required": ariaRequired } = props;
|
|
183
185
|
const direction = void 0 === t0 ? "horizontal" : t0;
|
|
184
186
|
const ctx = useTaoConfig();
|
|
185
187
|
const resolvedDisabled = disabled ?? ctx.disabled ?? false;
|
|
@@ -273,12 +275,13 @@ function RadioGroup(props) {
|
|
|
273
275
|
let t18;
|
|
274
276
|
let t19;
|
|
275
277
|
let t20;
|
|
278
|
+
let t21;
|
|
276
279
|
let t8;
|
|
277
280
|
let t9;
|
|
278
|
-
if ($[18] !== ariaDescribedBy || $[19] !== ariaErrorMessage || $[20] !== ariaInvalid || $[21] !== ariaLabel || $[22] !== ariaLabelledBy || $[23] !== ariaRequired || $[24] !== children || $[25] !== direction || $[26] !== groupCtxValue || $[27] !== id || $[28] !== options) {
|
|
281
|
+
if ($[18] !== ariaDescribedBy || $[19] !== ariaErrorMessage || $[20] !== ariaInvalid || $[21] !== ariaLabel || $[22] !== ariaLabelledBy || $[23] !== ariaRequired || $[24] !== children || $[25] !== direction || $[26] !== groupCtxValue || $[27] !== id || $[28] !== onBlur || $[29] !== options) {
|
|
279
282
|
const normalizedOptions = options?.map(_temp);
|
|
280
283
|
T0 = RadioGroupContext.Provider;
|
|
281
|
-
|
|
284
|
+
t21 = groupCtxValue;
|
|
282
285
|
t8 = root;
|
|
283
286
|
t9 = "";
|
|
284
287
|
t10 = direction;
|
|
@@ -290,7 +293,8 @@ function RadioGroup(props) {
|
|
|
290
293
|
t16 = ariaErrorMessage;
|
|
291
294
|
t17 = ariaInvalid;
|
|
292
295
|
t18 = ariaRequired;
|
|
293
|
-
t19 =
|
|
296
|
+
t19 = onBlur;
|
|
297
|
+
t20 = normalizedOptions ? normalizedOptions.map(_temp2) : children;
|
|
294
298
|
$[18] = ariaDescribedBy;
|
|
295
299
|
$[19] = ariaErrorMessage;
|
|
296
300
|
$[20] = ariaInvalid;
|
|
@@ -301,40 +305,43 @@ function RadioGroup(props) {
|
|
|
301
305
|
$[25] = direction;
|
|
302
306
|
$[26] = groupCtxValue;
|
|
303
307
|
$[27] = id;
|
|
304
|
-
$[28] =
|
|
305
|
-
$[29] =
|
|
306
|
-
$[30] =
|
|
307
|
-
$[31] =
|
|
308
|
-
$[32] =
|
|
309
|
-
$[33] =
|
|
310
|
-
$[34] =
|
|
311
|
-
$[35] =
|
|
312
|
-
$[36] =
|
|
313
|
-
$[37] =
|
|
314
|
-
$[38] =
|
|
315
|
-
$[39] =
|
|
316
|
-
$[40] =
|
|
317
|
-
$[41] =
|
|
318
|
-
$[42] =
|
|
308
|
+
$[28] = onBlur;
|
|
309
|
+
$[29] = options;
|
|
310
|
+
$[30] = T0;
|
|
311
|
+
$[31] = t10;
|
|
312
|
+
$[32] = t11;
|
|
313
|
+
$[33] = t12;
|
|
314
|
+
$[34] = t13;
|
|
315
|
+
$[35] = t14;
|
|
316
|
+
$[36] = t15;
|
|
317
|
+
$[37] = t16;
|
|
318
|
+
$[38] = t17;
|
|
319
|
+
$[39] = t18;
|
|
320
|
+
$[40] = t19;
|
|
321
|
+
$[41] = t20;
|
|
322
|
+
$[42] = t21;
|
|
323
|
+
$[43] = t8;
|
|
324
|
+
$[44] = t9;
|
|
319
325
|
} else {
|
|
320
|
-
T0 = $[
|
|
321
|
-
t10 = $[
|
|
322
|
-
t11 = $[
|
|
323
|
-
t12 = $[
|
|
324
|
-
t13 = $[
|
|
325
|
-
t14 = $[
|
|
326
|
-
t15 = $[
|
|
327
|
-
t16 = $[
|
|
328
|
-
t17 = $[
|
|
329
|
-
t18 = $[
|
|
330
|
-
t19 = $[
|
|
331
|
-
t20 = $[
|
|
332
|
-
|
|
333
|
-
|
|
326
|
+
T0 = $[30];
|
|
327
|
+
t10 = $[31];
|
|
328
|
+
t11 = $[32];
|
|
329
|
+
t12 = $[33];
|
|
330
|
+
t13 = $[34];
|
|
331
|
+
t14 = $[35];
|
|
332
|
+
t15 = $[36];
|
|
333
|
+
t16 = $[37];
|
|
334
|
+
t17 = $[38];
|
|
335
|
+
t18 = $[39];
|
|
336
|
+
t19 = $[40];
|
|
337
|
+
t20 = $[41];
|
|
338
|
+
t21 = $[42];
|
|
339
|
+
t8 = $[43];
|
|
340
|
+
t9 = $[44];
|
|
334
341
|
}
|
|
335
|
-
let
|
|
336
|
-
if ($[
|
|
337
|
-
|
|
342
|
+
let t22;
|
|
343
|
+
if ($[45] !== t10 || $[46] !== t11 || $[47] !== t12 || $[48] !== t13 || $[49] !== t14 || $[50] !== t15 || $[51] !== t16 || $[52] !== t17 || $[53] !== t18 || $[54] !== t19 || $[55] !== t20 || $[56] !== t8 || $[57] !== t9) {
|
|
344
|
+
t22 = /*#__PURE__*/ jsx("div", {
|
|
338
345
|
ref: t8,
|
|
339
346
|
"data-tao-radio-group": t9,
|
|
340
347
|
"data-tao-direction": t10,
|
|
@@ -346,34 +353,36 @@ function RadioGroup(props) {
|
|
|
346
353
|
"aria-errormessage": t16,
|
|
347
354
|
"aria-invalid": t17,
|
|
348
355
|
"aria-required": t18,
|
|
349
|
-
|
|
356
|
+
onBlur: t19,
|
|
357
|
+
children: t20
|
|
350
358
|
});
|
|
351
|
-
$[
|
|
352
|
-
$[
|
|
353
|
-
$[
|
|
354
|
-
$[
|
|
355
|
-
$[
|
|
356
|
-
$[
|
|
357
|
-
$[
|
|
358
|
-
$[
|
|
359
|
-
$[
|
|
360
|
-
$[
|
|
361
|
-
$[
|
|
362
|
-
$[
|
|
363
|
-
$[
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
359
|
+
$[45] = t10;
|
|
360
|
+
$[46] = t11;
|
|
361
|
+
$[47] = t12;
|
|
362
|
+
$[48] = t13;
|
|
363
|
+
$[49] = t14;
|
|
364
|
+
$[50] = t15;
|
|
365
|
+
$[51] = t16;
|
|
366
|
+
$[52] = t17;
|
|
367
|
+
$[53] = t18;
|
|
368
|
+
$[54] = t19;
|
|
369
|
+
$[55] = t20;
|
|
370
|
+
$[56] = t8;
|
|
371
|
+
$[57] = t9;
|
|
372
|
+
$[58] = t22;
|
|
373
|
+
} else t22 = $[58];
|
|
374
|
+
let t23;
|
|
375
|
+
if ($[59] !== T0 || $[60] !== t21 || $[61] !== t22) {
|
|
376
|
+
t23 = /*#__PURE__*/ jsx(T0, {
|
|
377
|
+
value: t21,
|
|
378
|
+
children: t22
|
|
370
379
|
});
|
|
371
|
-
$[
|
|
372
|
-
$[
|
|
373
|
-
$[
|
|
374
|
-
$[
|
|
375
|
-
} else
|
|
376
|
-
return
|
|
380
|
+
$[59] = T0;
|
|
381
|
+
$[60] = t21;
|
|
382
|
+
$[61] = t22;
|
|
383
|
+
$[62] = t23;
|
|
384
|
+
} else t23 = $[62];
|
|
385
|
+
return t23;
|
|
377
386
|
}
|
|
378
387
|
function _temp2(opt_0) {
|
|
379
388
|
return /*#__PURE__*/ jsx(radio_Radio, {
|