@rescui/select 0.18.1-RUI-297-Add-react-compiler-to-the-packages-build-dbbefd7b8.10 → 0.18.1-RUI-297-Add-react-compiler-to-the-packages-build-8aaaed4be.39
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/lib/_virtual/check-outline.js +294 -63
- package/lib/_virtual/close-outline.js +294 -63
- package/lib/_virtual/down-outline.js +294 -63
- package/lib/_virtual/index.css.js +12 -12
- package/lib/_virtual/loading-outline.js +310 -79
- package/lib/hooks/use-a11y.js +121 -33
- package/lib/hooks/use-actual-size-from-css.js +46 -17
- package/lib/hooks/use-focus.js +54 -10
- package/lib/hooks/use-hover.js +54 -10
- package/lib/hooks/use-label-focus.js +45 -15
- package/lib/hooks/use-multi-handlers.js +114 -36
- package/lib/hooks/use-no-memo-getter.d.ts +5 -0
- package/lib/hooks/use-no-memo-getter.js +15 -0
- package/lib/hooks/use-options.d.ts +2 -1
- package/lib/hooks/use-options.js +92 -56
- package/lib/hooks/use-primary-contrast-css-var-transfer.js +43 -16
- package/lib/hooks/use-safe-id.d.ts +3 -5
- package/lib/hooks/use-safe-id.js +7 -12
- package/lib/index.css +229 -189
- package/lib/multiselect.js +533 -158
- package/lib/native-select.js +412 -116
- package/lib/parts/form-trigger-wrapper.js +159 -39
- package/lib/parts/hidden-select.js +105 -29
- package/lib/parts/icons.js +164 -44
- package/lib/parts/list-box.js +294 -72
- package/lib/parts/multi-trigger.js +106 -43
- package/lib/parts/native-select-options-with-groups.js +154 -52
- package/lib/parts/popup-content.d.ts +2 -2
- package/lib/parts/popup-content.js +145 -45
- package/lib/public-api.p.css +5 -0
- package/lib/public-api.pcss +5 -0
- package/lib/select-basic.js +456 -136
- package/lib/select-searchable.js +435 -142
- package/lib/select.js +228 -56
- package/lib/styles/common.p.module.css.js +29 -29
- package/lib/styles/form-trigger.p.module.css.js +12 -12
- package/lib/styles/list-box.p.module.css.js +13 -13
- package/lib/types.d.ts +5 -0
- package/lib/utils/get-text-from-nodes.js +1 -1
- package/package.json +9 -8
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _extends from '@babel/runtime-corejs3/helpers/esm/extends';
|
|
2
|
+
import { c } from 'react-compiler-runtime';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import PropTypes from 'prop-types';
|
|
4
5
|
import cn from 'classnames';
|
|
@@ -15,101 +16,331 @@ const Size = {
|
|
|
15
16
|
"m": "m",
|
|
16
17
|
"l": "l"
|
|
17
18
|
};
|
|
18
|
-
const LoadingOutlineIcon16 = /*#__PURE__*/React.forwardRef((props, ref) =>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
19
|
+
const LoadingOutlineIcon16 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
20
|
+
const $ = c(4);
|
|
21
|
+
let t0;
|
|
22
|
+
|
|
23
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
24
|
+
t0 = /*#__PURE__*/React.createElement("path", {
|
|
25
|
+
d: "M8 3a5 5 0 1 0 4.933 4.177.5.5 0 0 1 .986-.163Q14 7.496 14 8a6 6 0 1 1-5.014-5.92.5.5 0 1 1-.163.987A5 5 0 0 0 8 3",
|
|
26
|
+
style: {
|
|
27
|
+
animation: "rs-icon-rotate 1s linear infinite",
|
|
28
|
+
transformOrigin: "center center"
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
$[0] = t0;
|
|
32
|
+
} else {
|
|
33
|
+
t0 = $[0];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
let t1;
|
|
37
|
+
|
|
38
|
+
if ($[1] !== props || $[2] !== ref) {
|
|
39
|
+
t1 = /*#__PURE__*/React.createElement("svg", _extends({
|
|
40
|
+
viewBox: "0 0 16 16"
|
|
41
|
+
}, props, {
|
|
42
|
+
ref: ref
|
|
43
|
+
}), t0);
|
|
44
|
+
$[1] = props;
|
|
45
|
+
$[2] = ref;
|
|
46
|
+
$[3] = t1;
|
|
47
|
+
} else {
|
|
48
|
+
t1 = $[3];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return t1;
|
|
52
|
+
});
|
|
29
53
|
LoadingOutlineIcon16.displayName = 'LoadingOutlineIcon16';
|
|
30
|
-
const LoadingOutlineIcon20 = /*#__PURE__*/React.forwardRef((props, ref) =>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
54
|
+
const LoadingOutlineIcon20 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
55
|
+
const $ = c(4);
|
|
56
|
+
let t0;
|
|
57
|
+
|
|
58
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
59
|
+
t0 = /*#__PURE__*/React.createElement("path", {
|
|
60
|
+
d: "M10 3.75a6.25 6.25 0 1 0 6.166 5.221.75.75 0 0 1 1.48-.244 7.75 7.75 0 1 1-6.372-6.372.75.75 0 0 1-.245 1.48A6.3 6.3 0 0 0 10 3.75",
|
|
61
|
+
style: {
|
|
62
|
+
animation: "rs-icon-rotate 1s linear infinite",
|
|
63
|
+
transformOrigin: "center center"
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
$[0] = t0;
|
|
67
|
+
} else {
|
|
68
|
+
t0 = $[0];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
let t1;
|
|
72
|
+
|
|
73
|
+
if ($[1] !== props || $[2] !== ref) {
|
|
74
|
+
t1 = /*#__PURE__*/React.createElement("svg", _extends({
|
|
75
|
+
viewBox: "0 0 20 20"
|
|
76
|
+
}, props, {
|
|
77
|
+
ref: ref
|
|
78
|
+
}), t0);
|
|
79
|
+
$[1] = props;
|
|
80
|
+
$[2] = ref;
|
|
81
|
+
$[3] = t1;
|
|
82
|
+
} else {
|
|
83
|
+
t1 = $[3];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return t1;
|
|
87
|
+
});
|
|
41
88
|
LoadingOutlineIcon20.displayName = 'LoadingOutlineIcon20';
|
|
42
|
-
const LoadingOutlineIcon24 = /*#__PURE__*/React.forwardRef((props, ref) =>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
89
|
+
const LoadingOutlineIcon24 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
90
|
+
const $ = c(4);
|
|
91
|
+
let t0;
|
|
92
|
+
|
|
93
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
94
|
+
t0 = /*#__PURE__*/React.createElement("path", {
|
|
95
|
+
d: "M12 5a7 7 0 1 0 6.906 5.848 1 1 0 1 1 1.973-.327q.12.724.121 1.479a9 9 0 1 1-7.521-8.879 1 1 0 0 1-.327 1.973A7 7 0 0 0 12 5",
|
|
96
|
+
style: {
|
|
97
|
+
animation: "rs-icon-rotate 1s linear infinite",
|
|
98
|
+
transformOrigin: "center center"
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
$[0] = t0;
|
|
102
|
+
} else {
|
|
103
|
+
t0 = $[0];
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
let t1;
|
|
107
|
+
|
|
108
|
+
if ($[1] !== props || $[2] !== ref) {
|
|
109
|
+
t1 = /*#__PURE__*/React.createElement("svg", _extends({
|
|
110
|
+
viewBox: "0 0 24 24"
|
|
111
|
+
}, props, {
|
|
112
|
+
ref: ref
|
|
113
|
+
}), t0);
|
|
114
|
+
$[1] = props;
|
|
115
|
+
$[2] = ref;
|
|
116
|
+
$[3] = t1;
|
|
117
|
+
} else {
|
|
118
|
+
t1 = $[3];
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return t1;
|
|
122
|
+
});
|
|
53
123
|
LoadingOutlineIcon24.displayName = 'LoadingOutlineIcon24';
|
|
54
|
-
const LoadingOutlineIcon28 = /*#__PURE__*/React.forwardRef((props, ref) =>
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
124
|
+
const LoadingOutlineIcon28 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
125
|
+
const $ = c(4);
|
|
126
|
+
let t0;
|
|
127
|
+
|
|
128
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
129
|
+
t0 = /*#__PURE__*/React.createElement("path", {
|
|
130
|
+
d: "M14 6a8 8 0 1 0 7.892 6.683 1 1 0 1 1 1.974-.326q.133.803.134 1.643c0 5.523-4.477 10-10 10S4 19.523 4 14 8.477 4 14 4q.775.001 1.52.115a1 1 0 1 1-.302 1.977A8 8 0 0 0 14 6",
|
|
131
|
+
style: {
|
|
132
|
+
animation: "rs-icon-rotate 1s linear infinite",
|
|
133
|
+
transformOrigin: "center center"
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
$[0] = t0;
|
|
137
|
+
} else {
|
|
138
|
+
t0 = $[0];
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
let t1;
|
|
142
|
+
|
|
143
|
+
if ($[1] !== props || $[2] !== ref) {
|
|
144
|
+
t1 = /*#__PURE__*/React.createElement("svg", _extends({
|
|
145
|
+
viewBox: "0 0 28 28"
|
|
146
|
+
}, props, {
|
|
147
|
+
ref: ref
|
|
148
|
+
}), t0);
|
|
149
|
+
$[1] = props;
|
|
150
|
+
$[2] = ref;
|
|
151
|
+
$[3] = t1;
|
|
152
|
+
} else {
|
|
153
|
+
t1 = $[3];
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return t1;
|
|
157
|
+
});
|
|
65
158
|
LoadingOutlineIcon28.displayName = 'LoadingOutlineIcon28';
|
|
66
|
-
const LoadingOutlineIcon = /*#__PURE__*/React.forwardRef((
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
159
|
+
const LoadingOutlineIcon = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
160
|
+
const $ = c(34);
|
|
161
|
+
let className;
|
|
162
|
+
let props;
|
|
163
|
+
let style;
|
|
164
|
+
let t1;
|
|
165
|
+
let t2;
|
|
166
|
+
let theme;
|
|
167
|
+
|
|
168
|
+
if ($[0] !== t0) {
|
|
169
|
+
({
|
|
170
|
+
theme,
|
|
171
|
+
size: t1,
|
|
172
|
+
className,
|
|
173
|
+
style,
|
|
174
|
+
"data-render-all-sizes": t2,
|
|
175
|
+
...props
|
|
176
|
+
} = t0);
|
|
177
|
+
$[0] = t0;
|
|
178
|
+
$[1] = className;
|
|
179
|
+
$[2] = props;
|
|
180
|
+
$[3] = style;
|
|
181
|
+
$[4] = t1;
|
|
182
|
+
$[5] = t2;
|
|
183
|
+
$[6] = theme;
|
|
184
|
+
} else {
|
|
185
|
+
className = $[1];
|
|
186
|
+
props = $[2];
|
|
187
|
+
style = $[3];
|
|
188
|
+
t1 = $[4];
|
|
189
|
+
t2 = $[5];
|
|
190
|
+
theme = $[6];
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
const sizeFromProps = t1 === undefined ? "m" : t1;
|
|
194
|
+
const renderAllSizes = t2 === undefined ? false : t2;
|
|
75
195
|
const size = sizeFromProps in Size ? sizeFromProps : "m";
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
196
|
+
const t3 = styles[theme];
|
|
197
|
+
const t4 = sizeStyles[size];
|
|
198
|
+
const t5 = renderAllSizes && styles.allVariants;
|
|
199
|
+
let t6;
|
|
200
|
+
|
|
201
|
+
if ($[7] !== className || $[8] !== t3 || $[9] !== t4 || $[10] !== t5) {
|
|
202
|
+
t6 = cn(styles.icon, t3, t4, t5, className);
|
|
203
|
+
$[7] = className;
|
|
204
|
+
$[8] = t3;
|
|
205
|
+
$[9] = t4;
|
|
206
|
+
$[10] = t5;
|
|
207
|
+
$[11] = t6;
|
|
208
|
+
} else {
|
|
209
|
+
t6 = $[11];
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
let t7;
|
|
213
|
+
|
|
214
|
+
if ($[12] !== renderAllSizes || $[13] !== style) {
|
|
215
|
+
t7 = renderAllSizes ? {
|
|
216
|
+
"--rs-icon-ar-width": 28,
|
|
217
|
+
"--rs-icon-ar-height": 28,
|
|
81
218
|
...style
|
|
82
|
-
} : style
|
|
83
|
-
|
|
84
|
-
|
|
219
|
+
} : style;
|
|
220
|
+
$[12] = renderAllSizes;
|
|
221
|
+
$[13] = style;
|
|
222
|
+
$[14] = t7;
|
|
223
|
+
} else {
|
|
224
|
+
t7 = $[14];
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
let t8;
|
|
228
|
+
|
|
229
|
+
if ($[15] !== props || $[16] !== ref || $[17] !== t6 || $[18] !== t7) {
|
|
230
|
+
t8 = { ...props,
|
|
231
|
+
className: t6,
|
|
232
|
+
style: t7,
|
|
233
|
+
ref
|
|
234
|
+
};
|
|
235
|
+
$[15] = props;
|
|
236
|
+
$[16] = ref;
|
|
237
|
+
$[17] = t6;
|
|
238
|
+
$[18] = t7;
|
|
239
|
+
$[19] = t8;
|
|
240
|
+
} else {
|
|
241
|
+
t8 = $[19];
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
const mainProps = t8;
|
|
85
245
|
|
|
86
246
|
if (renderAllSizes) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
247
|
+
let t10;
|
|
248
|
+
let t11;
|
|
249
|
+
let t12;
|
|
250
|
+
let t9;
|
|
251
|
+
|
|
252
|
+
if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
|
|
253
|
+
t9 = /*#__PURE__*/React.createElement(LoadingOutlineIcon16, {
|
|
254
|
+
className: styles.variant16
|
|
255
|
+
});
|
|
256
|
+
t10 = /*#__PURE__*/React.createElement(LoadingOutlineIcon20, {
|
|
257
|
+
className: styles.variant20
|
|
258
|
+
});
|
|
259
|
+
t11 = /*#__PURE__*/React.createElement(LoadingOutlineIcon24, {
|
|
260
|
+
className: styles.variant24
|
|
261
|
+
});
|
|
262
|
+
t12 = /*#__PURE__*/React.createElement(LoadingOutlineIcon28, {
|
|
263
|
+
className: styles.variant28
|
|
264
|
+
});
|
|
265
|
+
$[20] = t10;
|
|
266
|
+
$[21] = t11;
|
|
267
|
+
$[22] = t12;
|
|
268
|
+
$[23] = t9;
|
|
269
|
+
} else {
|
|
270
|
+
t10 = $[20];
|
|
271
|
+
t11 = $[21];
|
|
272
|
+
t12 = $[22];
|
|
273
|
+
t9 = $[23];
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
let t13;
|
|
277
|
+
|
|
278
|
+
if ($[24] !== mainProps) {
|
|
279
|
+
t13 = /*#__PURE__*/React.createElement("svg", _extends({
|
|
280
|
+
viewBox: "0 0 28 28"
|
|
281
|
+
}, mainProps), t9, t10, t11, t12);
|
|
282
|
+
$[24] = mainProps;
|
|
283
|
+
$[25] = t13;
|
|
284
|
+
} else {
|
|
285
|
+
t13 = $[25];
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
return t13;
|
|
98
289
|
}
|
|
99
290
|
|
|
100
|
-
if (size === Size
|
|
101
|
-
|
|
291
|
+
if (size === Size.xs) {
|
|
292
|
+
let t9;
|
|
293
|
+
|
|
294
|
+
if ($[26] !== mainProps) {
|
|
295
|
+
t9 = /*#__PURE__*/React.createElement(LoadingOutlineIcon16, mainProps);
|
|
296
|
+
$[26] = mainProps;
|
|
297
|
+
$[27] = t9;
|
|
298
|
+
} else {
|
|
299
|
+
t9 = $[27];
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
return t9;
|
|
102
303
|
}
|
|
103
304
|
|
|
104
|
-
if (size === Size
|
|
105
|
-
|
|
305
|
+
if (size === Size.s) {
|
|
306
|
+
let t9;
|
|
307
|
+
|
|
308
|
+
if ($[28] !== mainProps) {
|
|
309
|
+
t9 = /*#__PURE__*/React.createElement(LoadingOutlineIcon20, mainProps);
|
|
310
|
+
$[28] = mainProps;
|
|
311
|
+
$[29] = t9;
|
|
312
|
+
} else {
|
|
313
|
+
t9 = $[29];
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
return t9;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
if (size === Size.m) {
|
|
320
|
+
let t9;
|
|
321
|
+
|
|
322
|
+
if ($[30] !== mainProps) {
|
|
323
|
+
t9 = /*#__PURE__*/React.createElement(LoadingOutlineIcon24, mainProps);
|
|
324
|
+
$[30] = mainProps;
|
|
325
|
+
$[31] = t9;
|
|
326
|
+
} else {
|
|
327
|
+
t9 = $[31];
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
return t9;
|
|
106
331
|
}
|
|
107
332
|
|
|
108
|
-
|
|
109
|
-
|
|
333
|
+
let t9;
|
|
334
|
+
|
|
335
|
+
if ($[32] !== mainProps) {
|
|
336
|
+
t9 = /*#__PURE__*/React.createElement(LoadingOutlineIcon28, mainProps);
|
|
337
|
+
$[32] = mainProps;
|
|
338
|
+
$[33] = t9;
|
|
339
|
+
} else {
|
|
340
|
+
t9 = $[33];
|
|
110
341
|
}
|
|
111
342
|
|
|
112
|
-
return
|
|
343
|
+
return t9;
|
|
113
344
|
});
|
|
114
345
|
LoadingOutlineIcon.displayName = 'LoadingOutlineIcon';
|
|
115
346
|
LoadingOutlineIcon.propTypes = {
|
package/lib/hooks/use-a11y.js
CHANGED
|
@@ -1,38 +1,87 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c } from 'react-compiler-runtime';
|
|
2
|
+
import { useSafeId } from './use-safe-id.js';
|
|
2
3
|
|
|
3
|
-
const useA11y =
|
|
4
|
-
|
|
4
|
+
const useA11y = t0 => {
|
|
5
|
+
const $ = c(26);
|
|
6
|
+
const {
|
|
5
7
|
baseId: baseIdFromProps,
|
|
6
|
-
prefix
|
|
8
|
+
prefix: t1,
|
|
7
9
|
description,
|
|
8
10
|
error,
|
|
9
11
|
label,
|
|
10
12
|
fieldRef,
|
|
11
|
-
isDisabled
|
|
12
|
-
} =
|
|
13
|
-
const
|
|
13
|
+
isDisabled: t2
|
|
14
|
+
} = t0;
|
|
15
|
+
const prefix = t1 === undefined ? "" : t1;
|
|
16
|
+
const isDisabled = t2 === undefined ? false : t2;
|
|
17
|
+
const uniqueId = `${prefix ? `${prefix}-` : ""}${useSafeId()}`;
|
|
14
18
|
const baseId = baseIdFromProps ?? uniqueId;
|
|
15
19
|
const fieldId = `${baseId}-field`;
|
|
16
20
|
const descriptionId = description ? `${baseId}-description` : undefined;
|
|
17
21
|
const errorId = error ? `${baseId}-error` : undefined;
|
|
18
22
|
const labelId = label ? `${baseId}-label` : undefined;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
23
|
+
let t3;
|
|
24
|
+
|
|
25
|
+
if ($[0] !== descriptionId || $[1] !== errorId) {
|
|
26
|
+
t3 = [descriptionId, errorId].filter(Boolean).join(" ") || undefined;
|
|
27
|
+
$[0] = descriptionId;
|
|
28
|
+
$[1] = errorId;
|
|
29
|
+
$[2] = t3;
|
|
30
|
+
} else {
|
|
31
|
+
t3 = $[2];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const describedBy = t3;
|
|
35
|
+
const t4 = Boolean(error);
|
|
36
|
+
let t5;
|
|
37
|
+
|
|
38
|
+
if ($[3] !== describedBy || $[4] !== fieldId || $[5] !== labelId || $[6] !== t4) {
|
|
39
|
+
t5 = {
|
|
40
|
+
"aria-invalid": t4,
|
|
41
|
+
"aria-describedby": describedBy,
|
|
42
|
+
"aria-labelledby": labelId,
|
|
43
|
+
id: fieldId
|
|
44
|
+
};
|
|
45
|
+
$[3] = describedBy;
|
|
46
|
+
$[4] = fieldId;
|
|
47
|
+
$[5] = labelId;
|
|
48
|
+
$[6] = t4;
|
|
49
|
+
$[7] = t5;
|
|
50
|
+
} else {
|
|
51
|
+
t5 = $[7];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const fieldProps = t5;
|
|
55
|
+
let t6;
|
|
56
|
+
|
|
57
|
+
if ($[8] !== errorId) {
|
|
58
|
+
t6 = {
|
|
59
|
+
id: errorId
|
|
60
|
+
};
|
|
61
|
+
$[8] = errorId;
|
|
62
|
+
$[9] = t6;
|
|
63
|
+
} else {
|
|
64
|
+
t6 = $[9];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const errorMessageProps = t6;
|
|
68
|
+
let t7;
|
|
69
|
+
|
|
70
|
+
if ($[10] !== descriptionId) {
|
|
71
|
+
t7 = {
|
|
72
|
+
id: descriptionId
|
|
73
|
+
};
|
|
74
|
+
$[10] = descriptionId;
|
|
75
|
+
$[11] = t7;
|
|
76
|
+
} else {
|
|
77
|
+
t7 = $[11];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const descriptionProps = t7;
|
|
81
|
+
let t8;
|
|
82
|
+
|
|
83
|
+
if ($[12] !== fieldId || $[13] !== fieldRef || $[14] !== isDisabled) {
|
|
84
|
+
t8 = () => {
|
|
36
85
|
if (isDisabled) {
|
|
37
86
|
return;
|
|
38
87
|
}
|
|
@@ -42,15 +91,54 @@ const useA11y = _ref => {
|
|
|
42
91
|
} else {
|
|
43
92
|
document.getElementById(fieldId)?.focus();
|
|
44
93
|
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
$[12] = fieldId;
|
|
97
|
+
$[13] = fieldRef;
|
|
98
|
+
$[14] = isDisabled;
|
|
99
|
+
$[15] = t8;
|
|
100
|
+
} else {
|
|
101
|
+
t8 = $[15];
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
let t9;
|
|
105
|
+
|
|
106
|
+
if ($[16] !== fieldId || $[17] !== labelId || $[18] !== t8) {
|
|
107
|
+
t9 = {
|
|
108
|
+
id: labelId,
|
|
109
|
+
htmlFor: fieldId,
|
|
110
|
+
onClick: t8
|
|
111
|
+
};
|
|
112
|
+
$[16] = fieldId;
|
|
113
|
+
$[17] = labelId;
|
|
114
|
+
$[18] = t8;
|
|
115
|
+
$[19] = t9;
|
|
116
|
+
} else {
|
|
117
|
+
t9 = $[19];
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const labelProps = t9;
|
|
121
|
+
let t10;
|
|
122
|
+
|
|
123
|
+
if ($[20] !== baseId || $[21] !== descriptionProps || $[22] !== errorMessageProps || $[23] !== fieldProps || $[24] !== labelProps) {
|
|
124
|
+
t10 = {
|
|
125
|
+
baseId,
|
|
126
|
+
fieldProps,
|
|
127
|
+
descriptionProps,
|
|
128
|
+
errorMessageProps,
|
|
129
|
+
labelProps
|
|
130
|
+
};
|
|
131
|
+
$[20] = baseId;
|
|
132
|
+
$[21] = descriptionProps;
|
|
133
|
+
$[22] = errorMessageProps;
|
|
134
|
+
$[23] = fieldProps;
|
|
135
|
+
$[24] = labelProps;
|
|
136
|
+
$[25] = t10;
|
|
137
|
+
} else {
|
|
138
|
+
t10 = $[25];
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return t10;
|
|
54
142
|
};
|
|
55
143
|
|
|
56
144
|
export { useA11y };
|
|
@@ -1,27 +1,56 @@
|
|
|
1
|
-
import _includesInstanceProperty from
|
|
1
|
+
import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
2
|
+
import { c } from 'react-compiler-runtime';
|
|
2
3
|
import { useRef, useState } from 'react';
|
|
3
4
|
import { useResizeObserver } from '@rescui/use-resize-observer';
|
|
4
5
|
|
|
5
|
-
const useActualSizeFromCss =
|
|
6
|
-
|
|
6
|
+
const useActualSizeFromCss = t0 => {
|
|
7
|
+
const $ = c(5);
|
|
8
|
+
const {
|
|
7
9
|
sizeFromProps,
|
|
8
10
|
triggerRef
|
|
9
|
-
} =
|
|
10
|
-
// We use invisible and "untouchable" dummy element to observe `size` changes from css to fetch the actual size
|
|
11
|
+
} = t0;
|
|
11
12
|
const observableRef = useRef(null);
|
|
12
13
|
const [size, setSize] = useState(sizeFromProps);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
let t1;
|
|
15
|
+
|
|
16
|
+
if ($[0] !== sizeFromProps || $[1] !== triggerRef) {
|
|
17
|
+
t1 = () => {
|
|
18
|
+
var _context;
|
|
19
|
+
|
|
20
|
+
const ownerWindow = triggerRef.current?.ownerDocument.defaultView;
|
|
21
|
+
|
|
22
|
+
if (!ownerWindow) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const triggerFormWrapperStyles = ownerWindow.getComputedStyle(triggerRef.current);
|
|
27
|
+
const rawSizeFromCss = triggerFormWrapperStyles.getPropertyValue("--_rs-select-size");
|
|
28
|
+
const sizeFromCss = _includesInstanceProperty(_context = ["s", "m", "l"]).call(_context, rawSizeFromCss) ? rawSizeFromCss : null;
|
|
29
|
+
setSize(sizeFromCss || sizeFromProps);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
$[0] = sizeFromProps;
|
|
33
|
+
$[1] = triggerRef;
|
|
34
|
+
$[2] = t1;
|
|
35
|
+
} else {
|
|
36
|
+
t1 = $[2];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
useResizeObserver(observableRef, t1);
|
|
40
|
+
let t2;
|
|
41
|
+
|
|
42
|
+
if ($[3] !== size) {
|
|
43
|
+
t2 = {
|
|
44
|
+
observableRef,
|
|
45
|
+
size
|
|
46
|
+
};
|
|
47
|
+
$[3] = size;
|
|
48
|
+
$[4] = t2;
|
|
49
|
+
} else {
|
|
50
|
+
t2 = $[4];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return t2;
|
|
25
54
|
};
|
|
26
55
|
|
|
27
56
|
export { useActualSizeFromCss };
|