@rockshin/tao-ui 0.0.47 → 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/form.css +3 -2
- 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
|
@@ -10,6 +10,9 @@ function parseSize(value, total) {
|
|
|
10
10
|
if (value.endsWith('%')) return parseFloat(value) / 100 * total;
|
|
11
11
|
return parseFloat(value);
|
|
12
12
|
}
|
|
13
|
+
function canResizeBetween(panels, index) {
|
|
14
|
+
return index < panels.length - 1 && (panels[index].resizable ?? true) && (panels[index + 1].resizable ?? true);
|
|
15
|
+
}
|
|
13
16
|
function allocateSizes(panels, previous, available) {
|
|
14
17
|
const initialized = previous.length === panels.length;
|
|
15
18
|
const desired = panels.map((panel, i)=>parseSize(panel.size, available) ?? (initialized ? previous[i] : parseSize(panel.defaultSize, available)));
|
|
@@ -84,7 +87,7 @@ function Panel(_props) {
|
|
|
84
87
|
return null;
|
|
85
88
|
}
|
|
86
89
|
function Splitter(t0) {
|
|
87
|
-
const $ = c(
|
|
90
|
+
const $ = c(80);
|
|
88
91
|
const { orientation: t1, onResize, onResizeEnd, onResizeStart, className, classNames, styles, children } = t0;
|
|
89
92
|
const orientation = void 0 === t1 ? "horizontal" : t1;
|
|
90
93
|
const { locale } = useTaoConfig();
|
|
@@ -172,22 +175,44 @@ function Splitter(t0) {
|
|
|
172
175
|
t7 = $[11];
|
|
173
176
|
}
|
|
174
177
|
useEffect(t6, t7);
|
|
175
|
-
const
|
|
178
|
+
const activeDrag = useRef(null);
|
|
176
179
|
let t8;
|
|
177
|
-
let t9;
|
|
178
180
|
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
179
|
-
t8 = ()=>()=>
|
|
180
|
-
t9 = [];
|
|
181
|
+
t8 = ()=>()=>activeDrag.current?.cleanup();
|
|
181
182
|
$[12] = t8;
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
t9 =
|
|
186
|
-
|
|
183
|
+
} else t8 = $[12];
|
|
184
|
+
let t9;
|
|
185
|
+
if ($[13] !== orientation || $[14] !== panelCount) {
|
|
186
|
+
t9 = [
|
|
187
|
+
orientation,
|
|
188
|
+
panelCount
|
|
189
|
+
];
|
|
190
|
+
$[13] = orientation;
|
|
191
|
+
$[14] = panelCount;
|
|
192
|
+
$[15] = t9;
|
|
193
|
+
} else t9 = $[15];
|
|
187
194
|
useEffect(t8, t9);
|
|
188
195
|
let t10;
|
|
189
|
-
|
|
190
|
-
|
|
196
|
+
let t11;
|
|
197
|
+
if ($[16] !== panels) {
|
|
198
|
+
t10 = ()=>{
|
|
199
|
+
const drag = activeDrag.current;
|
|
200
|
+
if (drag && !canResizeBetween(panels, drag.index)) drag.cleanup();
|
|
201
|
+
};
|
|
202
|
+
t11 = [
|
|
203
|
+
panels
|
|
204
|
+
];
|
|
205
|
+
$[16] = panels;
|
|
206
|
+
$[17] = t10;
|
|
207
|
+
$[18] = t11;
|
|
208
|
+
} else {
|
|
209
|
+
t10 = $[17];
|
|
210
|
+
t11 = $[18];
|
|
211
|
+
}
|
|
212
|
+
useEffect(t10, t11);
|
|
213
|
+
let t12;
|
|
214
|
+
if ($[19] !== containerSize || $[20] !== panelCount || $[21] !== panels) {
|
|
215
|
+
t12 = (index, delta, startSizes)=>{
|
|
191
216
|
const draggerSpace = (panelCount - 1) * 1;
|
|
192
217
|
const available_0 = containerSize - draggerSpace;
|
|
193
218
|
const leftIdx = index;
|
|
@@ -210,25 +235,26 @@ function Splitter(t0) {
|
|
|
210
235
|
next_0[rightIdx] = total_0 - newLeft;
|
|
211
236
|
return next_0;
|
|
212
237
|
};
|
|
213
|
-
$[
|
|
214
|
-
$[
|
|
215
|
-
$[
|
|
216
|
-
$[
|
|
217
|
-
} else
|
|
218
|
-
const resizePanels =
|
|
219
|
-
let
|
|
220
|
-
if ($[
|
|
221
|
-
|
|
238
|
+
$[19] = containerSize;
|
|
239
|
+
$[20] = panelCount;
|
|
240
|
+
$[21] = panels;
|
|
241
|
+
$[22] = t12;
|
|
242
|
+
} else t12 = $[22];
|
|
243
|
+
const resizePanels = t12;
|
|
244
|
+
let t13;
|
|
245
|
+
if ($[23] !== isHorizontal || $[24] !== onResize || $[25] !== onResizeEnd || $[26] !== onResizeStart || $[27] !== resizePanels || $[28] !== sizes) {
|
|
246
|
+
t13 = (index_0, e)=>{
|
|
247
|
+
if (0 !== e.button) return;
|
|
222
248
|
e.preventDefault();
|
|
223
|
-
|
|
249
|
+
activeDrag.current?.cleanup();
|
|
224
250
|
const pos = isHorizontal ? e.clientX : e.clientY;
|
|
251
|
+
const ownerDocument = e.currentTarget.ownerDocument;
|
|
225
252
|
const pointerId = e.pointerId;
|
|
226
253
|
const sign = isHorizontal && "rtl" === getComputedStyle(containerRef.current).direction ? -1 : 1;
|
|
227
254
|
const startSizes_0 = [
|
|
228
255
|
...sizes
|
|
229
256
|
];
|
|
230
257
|
let currentSizes = startSizes_0;
|
|
231
|
-
onResizeStart?.(sizes);
|
|
232
258
|
const handleMove = (ev)=>{
|
|
233
259
|
if (ev.pointerId !== pointerId) return;
|
|
234
260
|
const delta_0 = ((isHorizontal ? ev.clientX : ev.clientY) - pos) * sign;
|
|
@@ -238,92 +264,115 @@ function Splitter(t0) {
|
|
|
238
264
|
onResize?.(next_1);
|
|
239
265
|
};
|
|
240
266
|
const cleanup = ()=>{
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
267
|
+
ownerDocument.removeEventListener("pointermove", handleMove);
|
|
268
|
+
ownerDocument.removeEventListener("pointerup", handleEnd);
|
|
269
|
+
ownerDocument.removeEventListener("pointercancel", handleEnd);
|
|
270
|
+
activeDrag.current = null;
|
|
245
271
|
};
|
|
246
272
|
const handleEnd = (ev_0)=>{
|
|
247
273
|
if (ev_0.pointerId !== pointerId) return;
|
|
248
274
|
cleanup();
|
|
249
275
|
onResizeEnd?.(currentSizes);
|
|
250
276
|
};
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
277
|
+
activeDrag.current = {
|
|
278
|
+
index: index_0,
|
|
279
|
+
cleanup
|
|
280
|
+
};
|
|
281
|
+
ownerDocument.addEventListener("pointermove", handleMove);
|
|
282
|
+
ownerDocument.addEventListener("pointerup", handleEnd);
|
|
283
|
+
ownerDocument.addEventListener("pointercancel", handleEnd);
|
|
284
|
+
onResizeStart?.(sizes);
|
|
255
285
|
};
|
|
256
|
-
$[
|
|
257
|
-
$[
|
|
258
|
-
$[
|
|
259
|
-
$[
|
|
260
|
-
$[
|
|
261
|
-
$[
|
|
262
|
-
$[
|
|
263
|
-
} else
|
|
264
|
-
const handleDragStart =
|
|
265
|
-
let
|
|
266
|
-
if ($[
|
|
267
|
-
|
|
286
|
+
$[23] = isHorizontal;
|
|
287
|
+
$[24] = onResize;
|
|
288
|
+
$[25] = onResizeEnd;
|
|
289
|
+
$[26] = onResizeStart;
|
|
290
|
+
$[27] = resizePanels;
|
|
291
|
+
$[28] = sizes;
|
|
292
|
+
$[29] = t13;
|
|
293
|
+
} else t13 = $[29];
|
|
294
|
+
const handleDragStart = t13;
|
|
295
|
+
let t14;
|
|
296
|
+
if ($[30] !== isHorizontal || $[31] !== onResize || $[32] !== onResizeEnd || $[33] !== onResizeStart || $[34] !== resizePanels || $[35] !== sizes) {
|
|
297
|
+
t14 = (index_1, event)=>{
|
|
298
|
+
if (event.defaultPrevented || event.target !== event.currentTarget) return;
|
|
268
299
|
const rtl = "rtl" === getComputedStyle(event.currentTarget).direction;
|
|
269
300
|
const growKey = isHorizontal ? rtl ? "ArrowLeft" : "ArrowRight" : "ArrowDown";
|
|
270
301
|
const shrinkKey = isHorizontal ? rtl ? "ArrowRight" : "ArrowLeft" : "ArrowUp";
|
|
271
302
|
if (event.key !== growKey && event.key !== shrinkKey) return;
|
|
272
303
|
event.preventDefault();
|
|
273
304
|
const delta_1 = event.key === growKey ? 10 : -10;
|
|
274
|
-
onResizeStart?.(sizes);
|
|
275
305
|
const next_2 = resizePanels(index_1, delta_1, sizes);
|
|
306
|
+
if (next_2[index_1] === sizes[index_1] && next_2[index_1 + 1] === sizes[index_1 + 1]) return;
|
|
307
|
+
onResizeStart?.(sizes);
|
|
276
308
|
setSizes(next_2);
|
|
277
309
|
onResize?.(next_2);
|
|
278
310
|
onResizeEnd?.(next_2);
|
|
279
311
|
};
|
|
280
|
-
$[
|
|
281
|
-
$[
|
|
282
|
-
$[
|
|
283
|
-
$[
|
|
284
|
-
$[
|
|
285
|
-
$[
|
|
286
|
-
$[
|
|
287
|
-
} else
|
|
288
|
-
const handleDraggerKeyDown =
|
|
289
|
-
let
|
|
290
|
-
if ($[
|
|
291
|
-
|
|
312
|
+
$[30] = isHorizontal;
|
|
313
|
+
$[31] = onResize;
|
|
314
|
+
$[32] = onResizeEnd;
|
|
315
|
+
$[33] = onResizeStart;
|
|
316
|
+
$[34] = resizePanels;
|
|
317
|
+
$[35] = sizes;
|
|
318
|
+
$[36] = t14;
|
|
319
|
+
} else t14 = $[36];
|
|
320
|
+
const handleDraggerKeyDown = t14;
|
|
321
|
+
let t15;
|
|
322
|
+
if ($[37] !== containerSize || $[38] !== panelCount || $[39] !== panels || $[40] !== sizes) {
|
|
323
|
+
t15 = (index_2, direction)=>{
|
|
292
324
|
const draggerSpace_0 = (panelCount - 1) * 1;
|
|
293
325
|
const available_1 = containerSize - draggerSpace_0;
|
|
294
326
|
const targetIdx = "start" === direction ? index_2 : index_2 + 1;
|
|
295
327
|
const adjacentIdx = "start" === direction ? index_2 + 1 : index_2;
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
328
|
+
const next_3 = [
|
|
329
|
+
...sizes
|
|
330
|
+
];
|
|
331
|
+
const isCollapsed = next_3[targetIdx] <= 0;
|
|
332
|
+
const target = panels[targetIdx];
|
|
333
|
+
const adjacent = panels[adjacentIdx];
|
|
334
|
+
const adjacentMax = parseSize(adjacent.max, available_1);
|
|
335
|
+
if (isCollapsed) {
|
|
336
|
+
const adjacentMin = parseSize(adjacent.min, available_1) ?? 0;
|
|
337
|
+
const targetMin = parseSize(target.min, available_1) ?? 0;
|
|
338
|
+
const targetMax = parseSize(target.max, available_1) ?? 1 / 0;
|
|
339
|
+
const minTake = Math.max(targetMin, next_3[adjacentIdx] - (adjacentMax ?? 1 / 0));
|
|
340
|
+
const maxTake = Math.min(targetMax, next_3[adjacentIdx] - adjacentMin);
|
|
341
|
+
if (maxTake < minTake || maxTake <= 0) return;
|
|
342
|
+
const def = parseSize(target.defaultSize, available_1);
|
|
343
|
+
const expandTo = def && def > 0 ? def : available_1 / panelCount;
|
|
344
|
+
const take = Math.max(minTake, Math.min(expandTo, maxTake));
|
|
345
|
+
next_3[targetIdx] = take;
|
|
346
|
+
next_3[adjacentIdx] = next_3[adjacentIdx] - take;
|
|
347
|
+
} else {
|
|
348
|
+
if (void 0 !== adjacentMax && next_3[adjacentIdx] + next_3[targetIdx] > adjacentMax) return;
|
|
349
|
+
next_3[adjacentIdx] = next_3[adjacentIdx] + next_3[targetIdx];
|
|
350
|
+
next_3[targetIdx] = 0;
|
|
351
|
+
}
|
|
352
|
+
return next_3;
|
|
315
353
|
};
|
|
316
|
-
$[
|
|
317
|
-
$[
|
|
318
|
-
$[
|
|
319
|
-
$[
|
|
320
|
-
$[
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
354
|
+
$[37] = containerSize;
|
|
355
|
+
$[38] = panelCount;
|
|
356
|
+
$[39] = panels;
|
|
357
|
+
$[40] = sizes;
|
|
358
|
+
$[41] = t15;
|
|
359
|
+
} else t15 = $[41];
|
|
360
|
+
const getCollapseSizes = t15;
|
|
361
|
+
let t16;
|
|
362
|
+
if ($[42] !== onResize || $[43] !== onResizeEnd) {
|
|
363
|
+
t16 = (next_4)=>{
|
|
364
|
+
setSizes(next_4);
|
|
365
|
+
onResize?.(next_4);
|
|
366
|
+
onResizeEnd?.(next_4);
|
|
367
|
+
};
|
|
368
|
+
$[42] = onResize;
|
|
369
|
+
$[43] = onResizeEnd;
|
|
370
|
+
$[44] = t16;
|
|
371
|
+
} else t16 = $[44];
|
|
372
|
+
const handleCollapse = t16;
|
|
373
|
+
let t17;
|
|
374
|
+
if ($[45] !== panels) {
|
|
375
|
+
t17 = function(index_3) {
|
|
327
376
|
const leftPanel = panels[index_3];
|
|
328
377
|
const rightPanel = panels[index_3 + 1];
|
|
329
378
|
let startCollapsible = false;
|
|
@@ -341,48 +390,48 @@ function Splitter(t0) {
|
|
|
341
390
|
end: endCollapsible
|
|
342
391
|
};
|
|
343
392
|
};
|
|
344
|
-
$[
|
|
345
|
-
$[
|
|
346
|
-
} else
|
|
347
|
-
const getDraggerCollapse =
|
|
393
|
+
$[45] = panels;
|
|
394
|
+
$[46] = t17;
|
|
395
|
+
} else t17 = $[46];
|
|
396
|
+
const getDraggerCollapse = t17;
|
|
348
397
|
if (sizes.length !== panelCount) {
|
|
349
|
-
const
|
|
350
|
-
let
|
|
351
|
-
if ($[
|
|
352
|
-
|
|
353
|
-
$[
|
|
354
|
-
$[
|
|
355
|
-
$[
|
|
356
|
-
} else
|
|
357
|
-
const
|
|
358
|
-
let
|
|
359
|
-
if ($[
|
|
360
|
-
|
|
398
|
+
const t18 = classNames?.root;
|
|
399
|
+
let t19;
|
|
400
|
+
if ($[47] !== className || $[48] !== t18) {
|
|
401
|
+
t19 = cx(t18, className);
|
|
402
|
+
$[47] = className;
|
|
403
|
+
$[48] = t18;
|
|
404
|
+
$[49] = t19;
|
|
405
|
+
} else t19 = $[49];
|
|
406
|
+
const t20 = styles?.root;
|
|
407
|
+
let t21;
|
|
408
|
+
if ($[50] !== orientation || $[51] !== t19 || $[52] !== t20) {
|
|
409
|
+
t21 = /*#__PURE__*/ jsx("div", {
|
|
361
410
|
ref: containerRef,
|
|
362
411
|
"data-tao-splitter": "",
|
|
363
412
|
"data-tao-orientation": orientation,
|
|
364
|
-
className:
|
|
365
|
-
style:
|
|
413
|
+
className: t19,
|
|
414
|
+
style: t20
|
|
366
415
|
});
|
|
367
|
-
$[
|
|
368
|
-
$[
|
|
369
|
-
$[
|
|
370
|
-
$[
|
|
371
|
-
} else
|
|
372
|
-
return
|
|
416
|
+
$[50] = orientation;
|
|
417
|
+
$[51] = t19;
|
|
418
|
+
$[52] = t20;
|
|
419
|
+
$[53] = t21;
|
|
420
|
+
} else t21 = $[53];
|
|
421
|
+
return t21;
|
|
373
422
|
}
|
|
374
|
-
const
|
|
375
|
-
let
|
|
376
|
-
if ($[
|
|
377
|
-
|
|
378
|
-
$[
|
|
379
|
-
$[
|
|
380
|
-
$[
|
|
381
|
-
} else
|
|
382
|
-
const
|
|
383
|
-
let
|
|
384
|
-
if ($[
|
|
385
|
-
|
|
423
|
+
const t18 = classNames?.root;
|
|
424
|
+
let t19;
|
|
425
|
+
if ($[54] !== className || $[55] !== t18) {
|
|
426
|
+
t19 = cx(t18, className);
|
|
427
|
+
$[54] = className;
|
|
428
|
+
$[55] = t18;
|
|
429
|
+
$[56] = t19;
|
|
430
|
+
} else t19 = $[56];
|
|
431
|
+
const t20 = styles?.root;
|
|
432
|
+
let t21;
|
|
433
|
+
if ($[57] !== classNames?.dragger || $[58] !== classNames?.panel || $[59] !== containerSize || $[60] !== getCollapseSizes || $[61] !== getDraggerCollapse || $[62] !== handleCollapse || $[63] !== handleDragStart || $[64] !== handleDraggerKeyDown || $[65] !== isHorizontal || $[66] !== locale || $[67] !== orientation || $[68] !== panelChildren || $[69] !== panelCount || $[70] !== panels || $[71] !== sizes || $[72] !== styles?.dragger || $[73] !== styles?.panel) {
|
|
434
|
+
t21 = panels.map((panel, i_0)=>{
|
|
386
435
|
const sizeStyle = isHorizontal ? {
|
|
387
436
|
width: sizes[i_0],
|
|
388
437
|
flexShrink: 0,
|
|
@@ -393,11 +442,12 @@ function Splitter(t0) {
|
|
|
393
442
|
flexGrow: 0
|
|
394
443
|
};
|
|
395
444
|
const isCollapsed_0 = sizes[i_0] <= 0;
|
|
396
|
-
const draggerResizable =
|
|
445
|
+
const draggerResizable = canResizeBetween(panels, i_0);
|
|
397
446
|
const available_2 = containerSize - (panelCount - 1);
|
|
398
447
|
const pairSize = sizes[i_0] + (sizes[i_0 + 1] ?? 0);
|
|
399
|
-
const valueMin = parseSize(panel.min, available_2) ?? 0;
|
|
400
448
|
const nextMin = parseSize(panels[i_0 + 1]?.min, available_2) ?? 0;
|
|
449
|
+
const nextMax = parseSize(panels[i_0 + 1]?.max, available_2) ?? pairSize;
|
|
450
|
+
const valueMin = Math.max(parseSize(panel.min, available_2) ?? 0, pairSize - nextMax);
|
|
401
451
|
const valueMax = Math.min(parseSize(panel.max, available_2) ?? pairSize, pairSize - nextMin);
|
|
402
452
|
return /*#__PURE__*/ jsxs("div", {
|
|
403
453
|
style: {
|
|
@@ -421,8 +471,8 @@ function Splitter(t0) {
|
|
|
421
471
|
role: "separator",
|
|
422
472
|
"aria-label": locale.messages.resizePanels(i_0 + 1, i_0 + 2),
|
|
423
473
|
"aria-orientation": isHorizontal ? "vertical" : "horizontal",
|
|
424
|
-
"aria-valuemin": Math.round(valueMin),
|
|
425
|
-
"aria-valuemax": Math.round(valueMax),
|
|
474
|
+
"aria-valuemin": Math.round(Math.min(valueMin, sizes[i_0])),
|
|
475
|
+
"aria-valuemax": Math.round(Math.max(valueMax, sizes[i_0])),
|
|
426
476
|
"aria-valuenow": Math.round(sizes[i_0]),
|
|
427
477
|
tabIndex: draggerResizable ? 0 : void 0,
|
|
428
478
|
className: cx(classNames?.dragger),
|
|
@@ -439,6 +489,8 @@ function Splitter(t0) {
|
|
|
439
489
|
}),
|
|
440
490
|
(()=>{
|
|
441
491
|
const { start, end } = getDraggerCollapse(i_0);
|
|
492
|
+
const startSizes_1 = start ? getCollapseSizes(i_0, "start") : void 0;
|
|
493
|
+
const endSizes = end ? getCollapseSizes(i_0, "end") : void 0;
|
|
442
494
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
443
495
|
children: [
|
|
444
496
|
start && /*#__PURE__*/ jsx("button", {
|
|
@@ -447,7 +499,9 @@ function Splitter(t0) {
|
|
|
447
499
|
"data-tao-collapse-direction": "start",
|
|
448
500
|
"data-tao-orientation": orientation,
|
|
449
501
|
"aria-label": locale.messages.collapsePanel,
|
|
450
|
-
|
|
502
|
+
disabled: !startSizes_1,
|
|
503
|
+
onPointerDown: _temp,
|
|
504
|
+
onClick: ()=>startSizes_1 && handleCollapse(startSizes_1),
|
|
451
505
|
children: /*#__PURE__*/ jsx(CollapseIcon, {
|
|
452
506
|
direction: sizes[i_0] <= 0 ? "end" : "start",
|
|
453
507
|
orientation: orientation
|
|
@@ -459,7 +513,9 @@ function Splitter(t0) {
|
|
|
459
513
|
"data-tao-collapse-direction": "end",
|
|
460
514
|
"data-tao-orientation": orientation,
|
|
461
515
|
"aria-label": locale.messages.collapsePanel,
|
|
462
|
-
|
|
516
|
+
disabled: !endSizes,
|
|
517
|
+
onPointerDown: _temp2,
|
|
518
|
+
onClick: ()=>endSizes && handleCollapse(endSizes),
|
|
463
519
|
children: /*#__PURE__*/ jsx(CollapseIcon, {
|
|
464
520
|
direction: sizes[i_0 + 1] <= 0 ? "start" : "end",
|
|
465
521
|
orientation: orientation
|
|
@@ -473,41 +529,48 @@ function Splitter(t0) {
|
|
|
473
529
|
]
|
|
474
530
|
}, i_0);
|
|
475
531
|
});
|
|
476
|
-
$[
|
|
477
|
-
$[
|
|
478
|
-
$[
|
|
479
|
-
$[
|
|
480
|
-
$[
|
|
481
|
-
$[
|
|
482
|
-
$[
|
|
483
|
-
$[
|
|
484
|
-
$[
|
|
485
|
-
$[
|
|
486
|
-
$[
|
|
487
|
-
$[
|
|
488
|
-
$[
|
|
489
|
-
$[
|
|
490
|
-
$[
|
|
491
|
-
$[
|
|
492
|
-
$[
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
532
|
+
$[57] = classNames?.dragger;
|
|
533
|
+
$[58] = classNames?.panel;
|
|
534
|
+
$[59] = containerSize;
|
|
535
|
+
$[60] = getCollapseSizes;
|
|
536
|
+
$[61] = getDraggerCollapse;
|
|
537
|
+
$[62] = handleCollapse;
|
|
538
|
+
$[63] = handleDragStart;
|
|
539
|
+
$[64] = handleDraggerKeyDown;
|
|
540
|
+
$[65] = isHorizontal;
|
|
541
|
+
$[66] = locale;
|
|
542
|
+
$[67] = orientation;
|
|
543
|
+
$[68] = panelChildren;
|
|
544
|
+
$[69] = panelCount;
|
|
545
|
+
$[70] = panels;
|
|
546
|
+
$[71] = sizes;
|
|
547
|
+
$[72] = styles?.dragger;
|
|
548
|
+
$[73] = styles?.panel;
|
|
549
|
+
$[74] = t21;
|
|
550
|
+
} else t21 = $[74];
|
|
551
|
+
let t22;
|
|
552
|
+
if ($[75] !== orientation || $[76] !== t19 || $[77] !== t20 || $[78] !== t21) {
|
|
553
|
+
t22 = /*#__PURE__*/ jsx("div", {
|
|
497
554
|
ref: containerRef,
|
|
498
555
|
"data-tao-splitter": "",
|
|
499
556
|
"data-tao-orientation": orientation,
|
|
500
|
-
className:
|
|
501
|
-
style:
|
|
502
|
-
children:
|
|
557
|
+
className: t19,
|
|
558
|
+
style: t20,
|
|
559
|
+
children: t21
|
|
503
560
|
});
|
|
504
|
-
$[
|
|
505
|
-
$[
|
|
506
|
-
$[
|
|
507
|
-
$[
|
|
508
|
-
$[
|
|
509
|
-
} else
|
|
510
|
-
return
|
|
561
|
+
$[75] = orientation;
|
|
562
|
+
$[76] = t19;
|
|
563
|
+
$[77] = t20;
|
|
564
|
+
$[78] = t21;
|
|
565
|
+
$[79] = t22;
|
|
566
|
+
} else t22 = $[79];
|
|
567
|
+
return t22;
|
|
568
|
+
}
|
|
569
|
+
function _temp2(event_2) {
|
|
570
|
+
return event_2.stopPropagation();
|
|
571
|
+
}
|
|
572
|
+
function _temp(event_1) {
|
|
573
|
+
return event_1.stopPropagation();
|
|
511
574
|
}
|
|
512
575
|
Splitter.Panel = Panel;
|
|
513
576
|
export { Panel, Splitter };
|
|
@@ -159,7 +159,7 @@ const StatisticRoot = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
159
159
|
const t6 = slots?.value;
|
|
160
160
|
let t7;
|
|
161
161
|
if ($[34] !== formatter || $[35] !== numberFormat || $[36] !== precision || $[37] !== value) {
|
|
162
|
-
t7 = "function" == typeof formatter ? formatter(value) : formattedNumber(value, precision, numberFormat);
|
|
162
|
+
t7 = "function" == typeof formatter ? formatter(value) : false === formatter ? value : formattedNumber(value, precision, numberFormat);
|
|
163
163
|
$[34] = formatter;
|
|
164
164
|
$[35] = numberFormat;
|
|
165
165
|
$[36] = precision;
|
|
@@ -428,7 +428,8 @@ function StatisticTimer(t0) {
|
|
|
428
428
|
useLayoutEffect(t3, t4);
|
|
429
429
|
let t5;
|
|
430
430
|
if ($[14] !== value) {
|
|
431
|
-
|
|
431
|
+
const timestamp = void 0 === value ? 0 / 0 : new Date(value).getTime();
|
|
432
|
+
t5 = Number.isNaN(timestamp) ? void 0 : timestamp;
|
|
432
433
|
$[14] = value;
|
|
433
434
|
$[15] = t5;
|
|
434
435
|
} else t5 = $[15];
|
|
@@ -437,13 +438,14 @@ function StatisticTimer(t0) {
|
|
|
437
438
|
let t7;
|
|
438
439
|
if ($[16] !== target || $[17] !== type) {
|
|
439
440
|
t6 = ()=>{
|
|
441
|
+
if (void 0 === target) return void setNow(void 0);
|
|
440
442
|
setNow(Date.now());
|
|
441
443
|
const timer = setInterval(()=>{
|
|
442
444
|
const current = Date.now();
|
|
443
|
-
const difference = "countdown" === type ? target - current : current - target;
|
|
445
|
+
const difference = Math.max(0, "countdown" === type ? target - current : current - target);
|
|
444
446
|
setNow(current);
|
|
445
447
|
callbacks.current.onChange?.(difference);
|
|
446
|
-
if ("countdown" === type && current
|
|
448
|
+
if ("countdown" === type && current >= target) {
|
|
447
449
|
clearInterval(timer);
|
|
448
450
|
callbacks.current.onFinish?.();
|
|
449
451
|
}
|
|
@@ -465,7 +467,7 @@ function StatisticTimer(t0) {
|
|
|
465
467
|
useEffect(t6, t7);
|
|
466
468
|
let t8;
|
|
467
469
|
if ($[20] !== format || $[21] !== now || $[22] !== target || $[23] !== type) {
|
|
468
|
-
t8 = ()=>void 0 === now ? "-" : formatDuration("countdown" === type ? target - now : now - target, format);
|
|
470
|
+
t8 = ()=>void 0 === now || void 0 === target ? "-" : formatDuration("countdown" === type ? target - now : now - target, format);
|
|
469
471
|
$[20] = format;
|
|
470
472
|
$[21] = now;
|
|
471
473
|
$[22] = target;
|
|
@@ -477,7 +479,6 @@ function StatisticTimer(t0) {
|
|
|
477
479
|
t9 = /*#__PURE__*/ jsx(StatisticRoot, {
|
|
478
480
|
...rest,
|
|
479
481
|
value: value,
|
|
480
|
-
valueRender: void 0,
|
|
481
482
|
formatter: t8
|
|
482
483
|
});
|
|
483
484
|
$[25] = rest;
|