@rockshin/tao-ui 0.0.57 → 0.0.58
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/app/app-notices.js +10 -3
- 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 +4 -1
- package/dist/components/carousel/carousel.js +8 -2
- package/dist/components/collapse/collapse-panels.js +68 -67
- package/dist/components/date-picker/date-localization.js +12 -14
- package/dist/components/divider/divider.js +1 -1
- package/dist/components/float-button/float-button.js +7 -5
- package/dist/components/image/image.js +135 -143
- package/dist/components/input/otp.js +6 -0
- package/dist/components/input/search.js +7 -5
- package/dist/components/list/list.js +106 -105
- package/dist/components/masonry/masonry.js +1 -1
- package/dist/components/pagination/pagination.d.ts +2 -0
- package/dist/components/pagination/pagination.js +4 -0
- 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/use-select-selection.d.ts +1 -1
- package/dist/components/select/use-select-selection.js +60 -53
- package/dist/components/statistic/statistic.js +84 -78
- package/dist/components/steps/steps.js +1 -1
- package/dist/components/table/table.js +4 -1
- package/dist/components/upload/upload.js +2 -2
- package/dist/number-input/cursor.js +20 -8
- package/dist/number-input/format.js +12 -4
- package/dist/number-input/use-number-input.js +4 -1
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ export declare function useSelectSelection(props: SelectionProps, disabled: bool
|
|
|
10
10
|
select: (next: string) => boolean;
|
|
11
11
|
addTokens: (input: string) => boolean;
|
|
12
12
|
remove: (removed: string) => void;
|
|
13
|
-
commit: (
|
|
13
|
+
commit: (draft: string[]) => void;
|
|
14
14
|
clear: () => void;
|
|
15
15
|
};
|
|
16
16
|
export {};
|
|
@@ -2,7 +2,7 @@ import { c } from "react-compiler-runtime";
|
|
|
2
2
|
import { useState } from "react";
|
|
3
3
|
import { buildSelectIndex } from "./select-model.js";
|
|
4
4
|
function useSelectSelection(props, disabled) {
|
|
5
|
-
const $ = c(
|
|
5
|
+
const $ = c(76);
|
|
6
6
|
const { options, value: valueProp, defaultValue, mode, maxCount, tokenSeparators, onChange, onSelect, onDeselect, onClear } = props;
|
|
7
7
|
const multiple = "multiple" === mode || "tags" === mode;
|
|
8
8
|
const controlled = "value" in props;
|
|
@@ -162,67 +162,74 @@ function useSelectSelection(props, disabled) {
|
|
|
162
162
|
} else t7 = $[41];
|
|
163
163
|
const remove = t7;
|
|
164
164
|
let t8;
|
|
165
|
-
if ($[42] !== disabled || $[43] !== maxCount || $[44] !==
|
|
166
|
-
t8 = (
|
|
167
|
-
if (disabled
|
|
165
|
+
if ($[42] !== disabled || $[43] !== maxCount || $[44] !== mode || $[45] !== onDeselect || $[46] !== onSelect || $[47] !== optionByValue || $[48] !== publish || $[49] !== selectedValueSet || $[50] !== valueArray) {
|
|
166
|
+
t8 = (draft)=>{
|
|
167
|
+
if (disabled) return;
|
|
168
|
+
const nextArray_1 = draft.filter((item_2)=>{
|
|
169
|
+
if (selectedValueSet.has(item_2)) return true;
|
|
170
|
+
const option_4 = optionByValue.get(item_2);
|
|
171
|
+
return option_4 ? !option_4.disabled : "tags" === mode;
|
|
172
|
+
});
|
|
173
|
+
if (null != maxCount && nextArray_1.length > maxCount) return;
|
|
168
174
|
publish(nextArray_1);
|
|
169
175
|
const nextSet = new Set(nextArray_1);
|
|
170
176
|
for (const next_3 of nextArray_1)if (!selectedValueSet.has(next_3)) {
|
|
171
|
-
const
|
|
172
|
-
if (
|
|
177
|
+
const option_5 = optionByValue.get(next_3);
|
|
178
|
+
if (option_5) onSelect?.(next_3, option_5);
|
|
173
179
|
}
|
|
174
180
|
for (const previous of valueArray)if (!nextSet.has(previous)) {
|
|
175
|
-
const
|
|
176
|
-
if (
|
|
181
|
+
const option_6 = optionByValue.get(previous);
|
|
182
|
+
if (option_6) onDeselect?.(previous, option_6);
|
|
177
183
|
}
|
|
178
184
|
};
|
|
179
185
|
$[42] = disabled;
|
|
180
186
|
$[43] = maxCount;
|
|
181
|
-
$[44] =
|
|
182
|
-
$[45] =
|
|
183
|
-
$[46] =
|
|
184
|
-
$[47] =
|
|
185
|
-
$[48] =
|
|
186
|
-
$[49] =
|
|
187
|
-
$[50] =
|
|
188
|
-
|
|
187
|
+
$[44] = mode;
|
|
188
|
+
$[45] = onDeselect;
|
|
189
|
+
$[46] = onSelect;
|
|
190
|
+
$[47] = optionByValue;
|
|
191
|
+
$[48] = publish;
|
|
192
|
+
$[49] = selectedValueSet;
|
|
193
|
+
$[50] = valueArray;
|
|
194
|
+
$[51] = t8;
|
|
195
|
+
} else t8 = $[51];
|
|
189
196
|
const commit = t8;
|
|
190
197
|
let t9;
|
|
191
|
-
if ($[
|
|
198
|
+
if ($[52] !== multiple || $[53] !== onClear || $[54] !== publish) {
|
|
192
199
|
t9 = ()=>{
|
|
193
200
|
publish(multiple ? [] : void 0, true);
|
|
194
201
|
onClear?.();
|
|
195
202
|
};
|
|
196
|
-
$[
|
|
197
|
-
$[
|
|
198
|
-
$[
|
|
199
|
-
$[
|
|
200
|
-
} else t9 = $[
|
|
203
|
+
$[52] = multiple;
|
|
204
|
+
$[53] = onClear;
|
|
205
|
+
$[54] = publish;
|
|
206
|
+
$[55] = t9;
|
|
207
|
+
} else t9 = $[55];
|
|
201
208
|
const clear_0 = t9;
|
|
202
209
|
let t10;
|
|
203
|
-
if ($[
|
|
210
|
+
if ($[56] !== multiple || $[57] !== optionByValue || $[58] !== value) {
|
|
204
211
|
t10 = !multiple && value ? optionByValue.get(value) : void 0;
|
|
205
|
-
$[
|
|
206
|
-
$[
|
|
207
|
-
$[
|
|
208
|
-
$[
|
|
209
|
-
} else t10 = $[
|
|
212
|
+
$[56] = multiple;
|
|
213
|
+
$[57] = optionByValue;
|
|
214
|
+
$[58] = value;
|
|
215
|
+
$[59] = t10;
|
|
216
|
+
} else t10 = $[59];
|
|
210
217
|
const selectedOption = t10;
|
|
211
218
|
let t11;
|
|
212
|
-
if ($[
|
|
213
|
-
t11 = multiple ? valueArray.map((
|
|
214
|
-
label:
|
|
215
|
-
value:
|
|
219
|
+
if ($[60] !== mode || $[61] !== multiple || $[62] !== optionByValue || $[63] !== valueArray) {
|
|
220
|
+
t11 = multiple ? valueArray.map((item_3)=>optionByValue.get(item_3) ?? ("tags" === mode ? {
|
|
221
|
+
label: item_3,
|
|
222
|
+
value: item_3
|
|
216
223
|
} : void 0)).filter(_temp4) : [];
|
|
217
|
-
$[
|
|
218
|
-
$[
|
|
219
|
-
$[
|
|
220
|
-
$[
|
|
221
|
-
$[
|
|
222
|
-
} else t11 = $[
|
|
224
|
+
$[60] = mode;
|
|
225
|
+
$[61] = multiple;
|
|
226
|
+
$[62] = optionByValue;
|
|
227
|
+
$[63] = valueArray;
|
|
228
|
+
$[64] = t11;
|
|
229
|
+
} else t11 = $[64];
|
|
223
230
|
const selectedOptions = t11;
|
|
224
231
|
let t12;
|
|
225
|
-
if ($[
|
|
232
|
+
if ($[65] !== addTokens || $[66] !== clear_0 || $[67] !== commit || $[68] !== remove || $[69] !== select || $[70] !== selectedOption || $[71] !== selectedOptions || $[72] !== selectedValueSet || $[73] !== value || $[74] !== valueArray) {
|
|
226
233
|
t12 = {
|
|
227
234
|
value,
|
|
228
235
|
valueArray,
|
|
@@ -235,22 +242,22 @@ function useSelectSelection(props, disabled) {
|
|
|
235
242
|
commit,
|
|
236
243
|
clear: clear_0
|
|
237
244
|
};
|
|
238
|
-
$[
|
|
239
|
-
$[
|
|
240
|
-
$[
|
|
241
|
-
$[
|
|
242
|
-
$[
|
|
243
|
-
$[
|
|
244
|
-
$[
|
|
245
|
-
$[
|
|
246
|
-
$[
|
|
247
|
-
$[
|
|
248
|
-
$[
|
|
249
|
-
} else t12 = $[
|
|
245
|
+
$[65] = addTokens;
|
|
246
|
+
$[66] = clear_0;
|
|
247
|
+
$[67] = commit;
|
|
248
|
+
$[68] = remove;
|
|
249
|
+
$[69] = select;
|
|
250
|
+
$[70] = selectedOption;
|
|
251
|
+
$[71] = selectedOptions;
|
|
252
|
+
$[72] = selectedValueSet;
|
|
253
|
+
$[73] = value;
|
|
254
|
+
$[74] = valueArray;
|
|
255
|
+
$[75] = t12;
|
|
256
|
+
} else t12 = $[75];
|
|
250
257
|
return t12;
|
|
251
258
|
}
|
|
252
|
-
function _temp4(
|
|
253
|
-
return void 0 !==
|
|
259
|
+
function _temp4(option_7) {
|
|
260
|
+
return void 0 !== option_7;
|
|
254
261
|
}
|
|
255
262
|
function _temp3(token) {
|
|
256
263
|
return token.trim();
|
|
@@ -13,7 +13,7 @@ const plainNumber = new Intl.NumberFormat('en-US', {
|
|
|
13
13
|
function formattedNumber(value, precision, options) {
|
|
14
14
|
const text = 'number' == typeof value && String(value).includes('e') ? plainNumber.format(value) : String(value);
|
|
15
15
|
const match = /^(-?)(\d*)(?:\.(\d+))?$/.exec(text);
|
|
16
|
-
if (!match || '-' === text) return text;
|
|
16
|
+
if (!match || '' === text || '-' === text) return text;
|
|
17
17
|
const integer = localizeDigits(groupInteger(match[2] || '0', options), options);
|
|
18
18
|
const fraction = void 0 === precision ? match[3] ?? '' : (match[3] ?? '').padEnd(precision, '0').slice(0, Math.max(0, precision));
|
|
19
19
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
@@ -37,7 +37,7 @@ function formattedNumber(value, precision, options) {
|
|
|
37
37
|
}
|
|
38
38
|
const hasContent = (node)=>null != node && 'boolean' != typeof node;
|
|
39
39
|
const StatisticRoot = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
40
|
-
const $ = c(
|
|
40
|
+
const $ = c(87);
|
|
41
41
|
let className;
|
|
42
42
|
let classNames;
|
|
43
43
|
let decimalSeparator;
|
|
@@ -158,51 +158,57 @@ const StatisticRoot = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
158
158
|
const t5 = classes?.value;
|
|
159
159
|
const t6 = slots?.value;
|
|
160
160
|
let t7;
|
|
161
|
-
if ($[34] !== formatter || $[35] !==
|
|
162
|
-
t7 = "function" == typeof formatter ? formatter(value
|
|
161
|
+
if ($[34] !== formatter || $[35] !== locale || $[36] !== numberFormat || $[37] !== precision || $[38] !== value) {
|
|
162
|
+
t7 = "function" == typeof formatter ? formatter(value, {
|
|
163
|
+
locale,
|
|
164
|
+
precision,
|
|
165
|
+
decimalSeparator: numberFormat.decimalSeparator,
|
|
166
|
+
groupSeparator: numberFormat.thousandsSeparator
|
|
167
|
+
}) : false === formatter ? value : formattedNumber(value, precision, numberFormat);
|
|
163
168
|
$[34] = formatter;
|
|
164
|
-
$[35] =
|
|
165
|
-
$[36] =
|
|
166
|
-
$[37] =
|
|
167
|
-
$[38] =
|
|
168
|
-
|
|
169
|
+
$[35] = locale;
|
|
170
|
+
$[36] = numberFormat;
|
|
171
|
+
$[37] = precision;
|
|
172
|
+
$[38] = value;
|
|
173
|
+
$[39] = t7;
|
|
174
|
+
} else t7 = $[39];
|
|
169
175
|
let t8;
|
|
170
|
-
if ($[
|
|
176
|
+
if ($[40] !== t5 || $[41] !== t6 || $[42] !== t7) {
|
|
171
177
|
t8 = /*#__PURE__*/ jsx("span", {
|
|
172
178
|
"data-tao-statistic-value": "",
|
|
173
179
|
className: t5,
|
|
174
180
|
style: t6,
|
|
175
181
|
children: t7
|
|
176
182
|
});
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
179
|
-
$[
|
|
180
|
-
$[
|
|
181
|
-
} else t8 = $[
|
|
183
|
+
$[40] = t5;
|
|
184
|
+
$[41] = t6;
|
|
185
|
+
$[42] = t7;
|
|
186
|
+
$[43] = t8;
|
|
187
|
+
} else t8 = $[43];
|
|
182
188
|
const formatted = t8;
|
|
183
189
|
const t9 = classes?.root;
|
|
184
190
|
let t10;
|
|
185
|
-
if ($[
|
|
191
|
+
if ($[44] !== className || $[45] !== prefixCls || $[46] !== rootClassName || $[47] !== t9) {
|
|
186
192
|
t10 = cx(prefixCls, t9, className, rootClassName);
|
|
187
|
-
$[
|
|
188
|
-
$[
|
|
189
|
-
$[
|
|
190
|
-
$[
|
|
191
|
-
$[
|
|
192
|
-
} else t10 = $[
|
|
193
|
+
$[44] = className;
|
|
194
|
+
$[45] = prefixCls;
|
|
195
|
+
$[46] = rootClassName;
|
|
196
|
+
$[47] = t9;
|
|
197
|
+
$[48] = t10;
|
|
198
|
+
} else t10 = $[48];
|
|
193
199
|
const t11 = slots?.root;
|
|
194
200
|
let t12;
|
|
195
|
-
if ($[
|
|
201
|
+
if ($[49] !== style || $[50] !== t11) {
|
|
196
202
|
t12 = {
|
|
197
203
|
...t11,
|
|
198
204
|
...style
|
|
199
205
|
};
|
|
200
|
-
$[
|
|
201
|
-
$[
|
|
202
|
-
$[
|
|
203
|
-
} else t12 = $[
|
|
206
|
+
$[49] = style;
|
|
207
|
+
$[50] = t11;
|
|
208
|
+
$[51] = t12;
|
|
209
|
+
} else t12 = $[51];
|
|
204
210
|
let t13;
|
|
205
|
-
if ($[
|
|
211
|
+
if ($[52] !== classes?.header || $[53] !== classes?.title || $[54] !== slots?.header || $[55] !== slots?.title || $[56] !== title) {
|
|
206
212
|
t13 = hasContent(title) && /*#__PURE__*/ jsx("div", {
|
|
207
213
|
"data-tao-statistic-header": "",
|
|
208
214
|
className: classes?.header,
|
|
@@ -214,60 +220,60 @@ const StatisticRoot = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
214
220
|
children: title
|
|
215
221
|
})
|
|
216
222
|
});
|
|
217
|
-
$[
|
|
218
|
-
$[
|
|
219
|
-
$[
|
|
220
|
-
$[
|
|
221
|
-
$[
|
|
222
|
-
$[
|
|
223
|
-
} else t13 = $[
|
|
223
|
+
$[52] = classes?.header;
|
|
224
|
+
$[53] = classes?.title;
|
|
225
|
+
$[54] = slots?.header;
|
|
226
|
+
$[55] = slots?.title;
|
|
227
|
+
$[56] = title;
|
|
228
|
+
$[57] = t13;
|
|
229
|
+
} else t13 = $[57];
|
|
224
230
|
const t14 = classes?.content;
|
|
225
231
|
const t15 = slots?.content;
|
|
226
232
|
let t16;
|
|
227
|
-
if ($[
|
|
233
|
+
if ($[58] !== t15 || $[59] !== valueStyle) {
|
|
228
234
|
t16 = {
|
|
229
235
|
...valueStyle,
|
|
230
236
|
...t15
|
|
231
237
|
};
|
|
232
|
-
$[
|
|
233
|
-
$[
|
|
234
|
-
$[
|
|
235
|
-
} else t16 = $[
|
|
238
|
+
$[58] = t15;
|
|
239
|
+
$[59] = valueStyle;
|
|
240
|
+
$[60] = t16;
|
|
241
|
+
} else t16 = $[60];
|
|
236
242
|
let t17;
|
|
237
|
-
if ($[
|
|
243
|
+
if ($[61] !== classes?.prefix || $[62] !== prefix || $[63] !== slots?.prefix) {
|
|
238
244
|
t17 = hasContent(prefix) && /*#__PURE__*/ jsx("span", {
|
|
239
245
|
"data-tao-statistic-prefix": "",
|
|
240
246
|
className: classes?.prefix,
|
|
241
247
|
style: slots?.prefix,
|
|
242
248
|
children: prefix
|
|
243
249
|
});
|
|
244
|
-
$[
|
|
245
|
-
$[
|
|
246
|
-
$[
|
|
247
|
-
$[
|
|
248
|
-
} else t17 = $[
|
|
250
|
+
$[61] = classes?.prefix;
|
|
251
|
+
$[62] = prefix;
|
|
252
|
+
$[63] = slots?.prefix;
|
|
253
|
+
$[64] = t17;
|
|
254
|
+
} else t17 = $[64];
|
|
249
255
|
let t18;
|
|
250
|
-
if ($[
|
|
256
|
+
if ($[65] !== formatted || $[66] !== valueRender) {
|
|
251
257
|
t18 = valueRender ? valueRender(formatted) : formatted;
|
|
252
|
-
$[
|
|
253
|
-
$[
|
|
254
|
-
$[
|
|
255
|
-
} else t18 = $[
|
|
258
|
+
$[65] = formatted;
|
|
259
|
+
$[66] = valueRender;
|
|
260
|
+
$[67] = t18;
|
|
261
|
+
} else t18 = $[67];
|
|
256
262
|
let t19;
|
|
257
|
-
if ($[
|
|
263
|
+
if ($[68] !== classes?.suffix || $[69] !== slots?.suffix || $[70] !== suffix) {
|
|
258
264
|
t19 = hasContent(suffix) && /*#__PURE__*/ jsx("span", {
|
|
259
265
|
"data-tao-statistic-suffix": "",
|
|
260
266
|
className: classes?.suffix,
|
|
261
267
|
style: slots?.suffix,
|
|
262
268
|
children: suffix
|
|
263
269
|
});
|
|
264
|
-
$[
|
|
265
|
-
$[
|
|
266
|
-
$[
|
|
267
|
-
$[
|
|
268
|
-
} else t19 = $[
|
|
270
|
+
$[68] = classes?.suffix;
|
|
271
|
+
$[69] = slots?.suffix;
|
|
272
|
+
$[70] = suffix;
|
|
273
|
+
$[71] = t19;
|
|
274
|
+
} else t19 = $[71];
|
|
269
275
|
let t20;
|
|
270
|
-
if ($[
|
|
276
|
+
if ($[72] !== t14 || $[73] !== t16 || $[74] !== t17 || $[75] !== t18 || $[76] !== t19) {
|
|
271
277
|
t20 = /*#__PURE__*/ jsxs("div", {
|
|
272
278
|
"data-tao-statistic-content": "",
|
|
273
279
|
className: t14,
|
|
@@ -278,27 +284,27 @@ const StatisticRoot = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
278
284
|
t19
|
|
279
285
|
]
|
|
280
286
|
});
|
|
281
|
-
$[
|
|
282
|
-
$[
|
|
283
|
-
$[
|
|
284
|
-
$[
|
|
285
|
-
$[
|
|
286
|
-
$[
|
|
287
|
-
} else t20 = $[
|
|
287
|
+
$[72] = t14;
|
|
288
|
+
$[73] = t16;
|
|
289
|
+
$[74] = t17;
|
|
290
|
+
$[75] = t18;
|
|
291
|
+
$[76] = t19;
|
|
292
|
+
$[77] = t20;
|
|
293
|
+
} else t20 = $[77];
|
|
288
294
|
let t21;
|
|
289
|
-
if ($[
|
|
295
|
+
if ($[78] !== loading || $[79] !== t20) {
|
|
290
296
|
t21 = /*#__PURE__*/ jsx(Skeleton, {
|
|
291
297
|
loading: loading,
|
|
292
298
|
paragraph: false,
|
|
293
299
|
active: true,
|
|
294
300
|
children: t20
|
|
295
301
|
});
|
|
296
|
-
$[
|
|
297
|
-
$[
|
|
298
|
-
$[
|
|
299
|
-
} else t21 = $[
|
|
302
|
+
$[78] = loading;
|
|
303
|
+
$[79] = t20;
|
|
304
|
+
$[80] = t21;
|
|
305
|
+
} else t21 = $[80];
|
|
300
306
|
let t22;
|
|
301
|
-
if ($[
|
|
307
|
+
if ($[81] !== rest || $[82] !== t10 || $[83] !== t12 || $[84] !== t13 || $[85] !== t21) {
|
|
302
308
|
t22 = /*#__PURE__*/ jsxs("div", {
|
|
303
309
|
...rest,
|
|
304
310
|
ref: node,
|
|
@@ -310,13 +316,13 @@ const StatisticRoot = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
310
316
|
t21
|
|
311
317
|
]
|
|
312
318
|
});
|
|
313
|
-
$[
|
|
314
|
-
$[
|
|
315
|
-
$[
|
|
316
|
-
$[
|
|
317
|
-
$[
|
|
318
|
-
$[
|
|
319
|
-
} else t22 = $[
|
|
319
|
+
$[81] = rest;
|
|
320
|
+
$[82] = t10;
|
|
321
|
+
$[83] = t12;
|
|
322
|
+
$[84] = t13;
|
|
323
|
+
$[85] = t21;
|
|
324
|
+
$[86] = t22;
|
|
325
|
+
} else t22 = $[86];
|
|
320
326
|
return t22;
|
|
321
327
|
});
|
|
322
328
|
StatisticRoot.displayName = 'Statistic';
|
|
@@ -148,7 +148,7 @@ function Steps(t0) {
|
|
|
148
148
|
const isPanel = "panel" === mergedType;
|
|
149
149
|
const mergedOrientation = isPanel ? "horizontal" : "vertical" === orientation || responsive && true === screens.xs ? "vertical" : "horizontal";
|
|
150
150
|
const mergedTitlePlacement = isDot || "vertical" === mergedOrientation ? "vertical" === mergedOrientation ? "horizontal" : "vertical" : "navigation" === mergedType ? "horizontal" : titlePlacement ?? "horizontal";
|
|
151
|
-
const mergedPercent = isInline ? void 0 : percent;
|
|
151
|
+
const mergedPercent = isInline || void 0 === percent ? void 0 : Math.min(100, Math.max(0, percent || 0));
|
|
152
152
|
const { canApplyMaxCount, displaySteps, displayCurrent } = useDisplaySteps(mergedItems, current, initial, maxCount);
|
|
153
153
|
let t10;
|
|
154
154
|
if ($[4] !== displayCurrent || $[5] !== displaySteps || $[6] !== status) {
|
|
@@ -143,7 +143,9 @@ function Table({ columns: columnsProp, dataSource, rowKey, loading = false, pagi
|
|
|
143
143
|
] : expandedKeys.filter((k_0)=>k_0 !== key_1);
|
|
144
144
|
if (!isExpansionControlled) setInternalExpandedKeys(nextKeys_1);
|
|
145
145
|
expandable?.onExpand?.(expanded, record_2);
|
|
146
|
-
expandable?.onExpandedRowsChange?.(
|
|
146
|
+
expandable?.onExpandedRowsChange?.([
|
|
147
|
+
...nextKeys_1
|
|
148
|
+
]);
|
|
147
149
|
};
|
|
148
150
|
const scrollRef = useRef(null);
|
|
149
151
|
const headerRowRef = useRef(null);
|
|
@@ -416,6 +418,7 @@ function Table({ columns: columnsProp, dataSource, rowKey, loading = false, pagi
|
|
|
416
418
|
"data-tao-table-row": "",
|
|
417
419
|
"data-tao-selected": isSelected || void 0,
|
|
418
420
|
onClick: (event)=>{
|
|
421
|
+
if (!event.currentTarget.contains(event.target)) return;
|
|
419
422
|
const selectionCell = event.target.closest('[data-tao-table-selection-cell]');
|
|
420
423
|
if (selectionCell && event.target !== selectionCell) return void event.stopPropagation();
|
|
421
424
|
rowProps.onClick?.(event);
|
|
@@ -572,8 +572,8 @@ const UploadRoot = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
572
572
|
showInfo: false,
|
|
573
573
|
...props.progress,
|
|
574
574
|
percent: file_15.percent ?? 0,
|
|
575
|
-
"aria-label": file_15['aria-label'] ?? file_15.name,
|
|
576
|
-
"aria-labelledby": file_15['aria-labelledby']
|
|
575
|
+
"aria-label": file_15['aria-label'] ?? props.progress?.['aria-label'] ?? file_15.name,
|
|
576
|
+
"aria-labelledby": file_15['aria-labelledby'] ?? props.progress?.['aria-labelledby']
|
|
577
577
|
}),
|
|
578
578
|
null != listConfig.extra && /*#__PURE__*/ jsx("span", {
|
|
579
579
|
"data-tao-upload-extra": "",
|
|
@@ -2,16 +2,22 @@ function countAnchored(display, upTo, thousandsSeparator) {
|
|
|
2
2
|
const limit = Math.min(upTo, display.length);
|
|
3
3
|
if (!thousandsSeparator) return Math.max(0, limit);
|
|
4
4
|
let count = 0;
|
|
5
|
-
for(let i = 0; i < limit;
|
|
5
|
+
for(let i = 0; i < limit;)if (display.startsWith(thousandsSeparator, i)) i += thousandsSeparator.length;
|
|
6
|
+
else {
|
|
7
|
+
count++;
|
|
8
|
+
i++;
|
|
9
|
+
}
|
|
6
10
|
return count;
|
|
7
11
|
}
|
|
8
12
|
function findCursorAt(display, anchorCount, thousandsSeparator) {
|
|
9
13
|
if (anchorCount <= 0) return 0;
|
|
10
14
|
if (!thousandsSeparator) return Math.min(anchorCount, display.length);
|
|
11
15
|
let count = 0;
|
|
12
|
-
for(let i = 0; i < display.length; i
|
|
13
|
-
|
|
14
|
-
|
|
16
|
+
for(let i = 0; i < display.length;)if (display.startsWith(thousandsSeparator, i)) i += thousandsSeparator.length;
|
|
17
|
+
else {
|
|
18
|
+
count++;
|
|
19
|
+
i++;
|
|
20
|
+
if (count === anchorCount) return i;
|
|
15
21
|
}
|
|
16
22
|
return display.length;
|
|
17
23
|
}
|
|
@@ -19,15 +25,21 @@ function countAnchoredFromEnd(display, fromPos, thousandsSeparator) {
|
|
|
19
25
|
if (fromPos >= display.length) return 0;
|
|
20
26
|
if (!thousandsSeparator) return display.length - Math.max(0, fromPos);
|
|
21
27
|
let count = 0;
|
|
22
|
-
for(let i = Math.max(0, fromPos);
|
|
28
|
+
for(let i = display.length; i > Math.max(0, fromPos);)if (display.endsWith(thousandsSeparator, i)) i -= thousandsSeparator.length;
|
|
29
|
+
else {
|
|
30
|
+
count++;
|
|
31
|
+
i--;
|
|
32
|
+
}
|
|
23
33
|
return count;
|
|
24
34
|
}
|
|
25
35
|
function findCursorFromEnd(display, anchoredFromEnd, thousandsSeparator) {
|
|
26
36
|
if (anchoredFromEnd <= 0) return display.length;
|
|
27
37
|
if (!thousandsSeparator) return Math.max(0, display.length - anchoredFromEnd);
|
|
28
38
|
let count = 0;
|
|
29
|
-
for(let i = display.length
|
|
30
|
-
|
|
39
|
+
for(let i = display.length; i > 0;)if (display.endsWith(thousandsSeparator, i)) i -= thousandsSeparator.length;
|
|
40
|
+
else {
|
|
41
|
+
count++;
|
|
42
|
+
i--;
|
|
31
43
|
if (count === anchoredFromEnd) return i;
|
|
32
44
|
}
|
|
33
45
|
return 0;
|
|
@@ -39,6 +51,6 @@ function reposition(args) {
|
|
|
39
51
|
}
|
|
40
52
|
function isThousandSepBeforeCursor(display, cursor, thousandsSeparator) {
|
|
41
53
|
if (!thousandsSeparator || cursor <= 0) return false;
|
|
42
|
-
return display
|
|
54
|
+
return display.endsWith(thousandsSeparator, cursor);
|
|
43
55
|
}
|
|
44
56
|
export { countAnchored, findCursorAt, isThousandSepBeforeCursor, reposition };
|
|
@@ -19,10 +19,18 @@ function parse(display, opts) {
|
|
|
19
19
|
const body = negative ? text.slice(1) : text;
|
|
20
20
|
let cleaned = '';
|
|
21
21
|
let seenDecimal = false;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
const { decimalSeparator } = opts;
|
|
23
|
+
for(let index = 0; index < body.length; index++){
|
|
24
|
+
const ch = body[index];
|
|
25
|
+
if (decimalSeparator && body.startsWith(decimalSeparator, index)) {
|
|
26
|
+
if (!seenDecimal) cleaned += '.';
|
|
27
|
+
seenDecimal = true;
|
|
28
|
+
index += decimalSeparator.length - 1;
|
|
29
|
+
} else if (ch >= '0' && ch <= '9') cleaned += ch;
|
|
30
|
+
else if (!seenDecimal && opts.allowAsciiDecimal && '.' === ch && '.' !== opts.thousandsSeparator) {
|
|
31
|
+
cleaned += '.';
|
|
32
|
+
seenDecimal = true;
|
|
33
|
+
}
|
|
26
34
|
}
|
|
27
35
|
if (cleaned.startsWith('.')) cleaned = `0${cleaned}`;
|
|
28
36
|
return (negative ? '-' : '') + cleaned;
|
|
@@ -294,7 +294,10 @@ function useNumberInput(opts) {
|
|
|
294
294
|
const el = inputRef.current;
|
|
295
295
|
if (!el) return;
|
|
296
296
|
const cursor_0 = el.selectionStart ?? 0;
|
|
297
|
-
if (cursor_0 > 0 && el.selectionEnd === cursor_0 && isThousandSepBeforeCursor(displayBuffer, cursor_0, thousandsSeparator))
|
|
297
|
+
if (cursor_0 > 0 && el.selectionEnd === cursor_0 && isThousandSepBeforeCursor(displayBuffer, cursor_0, thousandsSeparator)) {
|
|
298
|
+
const beforeSeparator = cursor_0 - thousandsSeparator.length;
|
|
299
|
+
el.setSelectionRange(beforeSeparator, beforeSeparator);
|
|
300
|
+
}
|
|
298
301
|
};
|
|
299
302
|
$[74] = displayBuffer;
|
|
300
303
|
$[75] = thousandsSeparator;
|