@rockshin/tao-ui 0.0.44 → 0.0.46
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/README.md +9 -1
- package/component-manifest.json +38 -4
- package/dist/components/alert/alert.js +20 -17
- package/dist/components/auto-complete/auto-complete.js +12 -3
- package/dist/components/avatar/avatar.js +2 -1
- package/dist/components/breadcrumb/breadcrumb.css +4 -0
- package/dist/components/breadcrumb/breadcrumb.js +82 -77
- package/dist/components/calendar/calendar.d.ts +1 -1
- package/dist/components/calendar/calendar.js +51 -33
- package/dist/components/card/card-tabs.js +204 -182
- package/dist/components/card/card.js +1 -1
- package/dist/components/carousel/carousel.js +11 -5
- package/dist/components/cascader/cascader.js +16 -4
- package/dist/components/collapse/collapse.css +8 -0
- package/dist/components/color-picker/color-picker.js +273 -269
- package/dist/components/context-menu/context-menu.d.ts +2 -1
- package/dist/components/context-menu/context-menu.js +57 -44
- package/dist/components/date-picker/calendar/calendar-grid.js +13 -6
- package/dist/components/date-picker/calendar/use-calendar.d.ts +2 -2
- package/dist/components/date-picker/calendar/use-calendar.js +2 -3
- package/dist/components/date-picker/date-localization.d.ts +3 -0
- package/dist/components/date-picker/date-localization.js +76 -0
- package/dist/components/date-picker/date-picker.css +4 -0
- package/dist/components/date-picker/date-picker.d.ts +1 -0
- package/dist/components/date-picker/date-picker.js +48 -30
- package/dist/components/date-picker/range-picker.d.ts +1 -0
- package/dist/components/date-picker/range-picker.js +41 -23
- package/dist/components/drawer/drawer.d.ts +2 -1
- package/dist/components/drawer/drawer.js +32 -20
- package/dist/components/dropdown/dropdown.d.ts +1 -0
- package/dist/components/dropdown/dropdown.js +160 -143
- package/dist/components/float-button/float-button.js +3 -2
- package/dist/components/form/form.js +88 -103
- package/dist/components/image/image.js +202 -137
- package/dist/components/list/list-pagination.js +148 -147
- package/dist/components/mentions/mentions.js +6 -2
- package/dist/components/modal/confirm-dialog.js +4 -2
- package/dist/components/modal/modal.d.ts +2 -1
- package/dist/components/modal/modal.js +387 -375
- package/dist/components/pagination/pagination.css +4 -0
- package/dist/components/pagination/pagination.js +115 -110
- package/dist/components/popconfirm/popconfirm.js +109 -107
- package/dist/components/popover/popover.d.ts +2 -1
- package/dist/components/popover/popover.js +185 -176
- package/dist/components/qr-code/qr-code.js +22 -21
- package/dist/components/rate/rate.js +114 -88
- package/dist/components/scroll-area/scroll-area.js +132 -120
- package/dist/components/segmented/segmented.js +52 -29
- package/dist/components/select/mobile-select.d.ts +3 -2
- package/dist/components/select/mobile-select.js +54 -48
- package/dist/components/select/select-types.d.ts +1 -0
- package/dist/components/select/select.js +19 -6
- package/dist/components/slider/slider.js +136 -133
- package/dist/components/sonner/sonner.js +10 -10
- package/dist/components/spinner/spinner.js +1 -1
- package/dist/components/splitter/splitter.css +4 -0
- package/dist/components/splitter/splitter.js +29 -24
- package/dist/components/statistic/statistic.d.ts +2 -0
- package/dist/components/statistic/statistic.js +203 -187
- package/dist/components/table/table-filter.js +61 -52
- package/dist/components/table/table-icons.js +3 -1
- package/dist/components/table/table.css +29 -11
- package/dist/components/table/table.d.ts +1 -1
- package/dist/components/table/table.js +384 -547
- package/dist/components/tabs/tabs.js +3 -2
- package/dist/components/tag/tag.js +22 -19
- package/dist/components/time-picker/time-picker.d.ts +0 -1
- package/dist/components/time-picker/time-picker.js +160 -103
- package/dist/components/tooltip/tooltip.d.ts +2 -1
- package/dist/components/tooltip/tooltip.js +82 -71
- package/dist/components/transfer/transfer-list.js +224 -488
- package/dist/components/transfer/transfer-parts.js +14 -4
- package/dist/components/transfer/transfer-types.d.ts +1 -0
- package/dist/components/transfer/transfer.js +23 -20
- package/dist/components/tree/tree-keyboard.d.ts +6 -0
- package/dist/components/tree/tree-keyboard.js +27 -0
- package/dist/components/tree/tree.js +14 -3
- package/dist/components/tree-select/select-engine.d.ts +2 -1
- package/dist/components/tree-select/select-engine.js +23 -15
- package/dist/components/tree-select/tree-select.js +20 -10
- package/dist/components/upload/upload.js +30 -26
- package/dist/docs/component-docs.d.ts +13 -2
- package/dist/docs/components/headless-input-number.doc.d.ts +5 -0
- package/dist/docs/components/headless-input-number.doc.js +7 -0
- package/dist/docs/components/input-number.doc.d.ts +5 -0
- package/dist/docs/components/input-number.doc.js +7 -0
- package/dist/docs/components/statistic.doc.d.ts +5 -0
- package/dist/docs/components/statistic.doc.js +7 -0
- package/dist/docs/components/tao-provider.doc.d.ts +8 -2
- package/dist/docs/components/tao-provider.doc.js +16 -3
- package/dist/docs/components/tooltip.doc.d.ts +2 -2
- package/dist/entries/provider.d.ts +2 -1
- package/dist/entries/provider.js +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/dist/locales/ar-EG.d.ts +3 -0
- package/dist/locales/ar-EG.js +199 -0
- package/dist/locales/create-locale.d.ts +41 -0
- package/dist/locales/create-locale.js +88 -0
- package/dist/locales/de-DE.d.ts +3 -0
- package/dist/locales/de-DE.js +195 -0
- package/dist/locales/en-US.d.ts +2 -0
- package/dist/locales/en-US.js +194 -0
- package/dist/locales/es-ES.d.ts +3 -0
- package/dist/locales/es-ES.js +195 -0
- package/dist/locales/fr-FR.d.ts +3 -0
- package/dist/locales/fr-FR.js +195 -0
- package/dist/locales/hi-IN.d.ts +3 -0
- package/dist/locales/hi-IN.js +194 -0
- package/dist/locales/id-ID.d.ts +3 -0
- package/dist/locales/id-ID.js +194 -0
- package/dist/locales/index.d.ts +18 -0
- package/dist/locales/index.js +17 -0
- package/dist/locales/it-IT.d.ts +3 -0
- package/dist/locales/it-IT.js +195 -0
- package/dist/locales/ja-JP.d.ts +3 -0
- package/dist/locales/ja-JP.js +194 -0
- package/dist/locales/ko-KR.d.ts +3 -0
- package/dist/locales/ko-KR.js +194 -0
- package/dist/locales/pt-BR.d.ts +3 -0
- package/dist/locales/pt-BR.js +195 -0
- package/dist/locales/ru-RU.d.ts +3 -0
- package/dist/locales/ru-RU.js +197 -0
- package/dist/locales/th-TH.d.ts +3 -0
- package/dist/locales/th-TH.js +194 -0
- package/dist/locales/tr-TR.d.ts +3 -0
- package/dist/locales/tr-TR.js +194 -0
- package/dist/locales/types.d.ts +176 -0
- package/dist/locales/types.js +0 -0
- package/dist/locales/vi-VN.d.ts +3 -0
- package/dist/locales/vi-VN.js +194 -0
- package/dist/locales/zh-CN.d.ts +3 -0
- package/dist/locales/zh-CN.js +194 -0
- package/dist/locales/zh-TW.d.ts +3 -0
- package/dist/locales/zh-TW.js +194 -0
- package/dist/number-input/format.d.ts +4 -3
- package/dist/number-input/format.js +9 -7
- package/dist/number-input/locale.d.ts +19 -0
- package/dist/number-input/locale.js +44 -0
- package/dist/number-input/number-input.js +1 -0
- package/dist/number-input/use-number-input.d.ts +2 -0
- package/dist/number-input/use-number-input.js +180 -176
- package/dist/provider/locale.d.ts +3 -65
- package/dist/provider/locale.js +2 -146
- package/dist/provider/merge-locale.d.ts +8 -0
- package/dist/provider/merge-locale.js +53 -0
- package/dist/provider/tao-provider.d.ts +16 -5
- package/dist/provider/tao-provider.js +200 -92
- package/dist/utils/scroll-left.d.ts +3 -0
- package/dist/utils/scroll-left.js +7 -0
- package/llms.txt +3 -3
- package/package.json +5 -1
|
@@ -116,20 +116,20 @@ function resolveDataType(type, richColors) {
|
|
|
116
116
|
if (!richColors) return 'default';
|
|
117
117
|
return type;
|
|
118
118
|
}
|
|
119
|
-
function getAriaLabel(type) {
|
|
119
|
+
function getAriaLabel(type, messages) {
|
|
120
120
|
switch(type){
|
|
121
121
|
case 'success':
|
|
122
|
-
return
|
|
122
|
+
return messages.successNotification;
|
|
123
123
|
case 'error':
|
|
124
|
-
return
|
|
124
|
+
return messages.errorNotification;
|
|
125
125
|
case 'warning':
|
|
126
|
-
return
|
|
126
|
+
return messages.warningNotification;
|
|
127
127
|
case 'info':
|
|
128
|
-
return
|
|
128
|
+
return messages.infoNotification;
|
|
129
129
|
case 'loading':
|
|
130
|
-
return
|
|
130
|
+
return messages.loadingNotification;
|
|
131
131
|
default:
|
|
132
|
-
return
|
|
132
|
+
return messages.notification;
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
function renderPromiseState(stateValue, payload) {
|
|
@@ -138,7 +138,6 @@ function renderPromiseState(stateValue, payload) {
|
|
|
138
138
|
return stateValue;
|
|
139
139
|
}
|
|
140
140
|
function Sonner({ position = 'bottom-right', visibleToasts = 3, offset = 24, gap = 12, expand = true, richColors = false, closeButton = false, duration = 4000, className, style, classNames, styles }) {
|
|
141
|
-
useTaoConfig();
|
|
142
141
|
const snapshot = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
143
142
|
const [heights, setHeights] = useState(()=>new Map());
|
|
144
143
|
useEffect(()=>{
|
|
@@ -197,6 +196,7 @@ function Sonner({ position = 'bottom-right', visibleToasts = 3, offset = 24, gap
|
|
|
197
196
|
});
|
|
198
197
|
}
|
|
199
198
|
function ToastView({ toast, richColors, showClose, yPosition, index, visibleToasts, expanded, offset, frontToastHeight, setHeights, classNames, styles }) {
|
|
199
|
+
const { locale: { messages } } = useTaoConfig();
|
|
200
200
|
const [mounted, setMounted] = useState(false);
|
|
201
201
|
const [offsetBeforeRemove, setOffsetBeforeRemove] = useState(0);
|
|
202
202
|
const ref = useRef(null);
|
|
@@ -245,7 +245,7 @@ function ToastView({ toast, richColors, showClose, yPosition, index, visibleToas
|
|
|
245
245
|
className: cx(classNames?.toast),
|
|
246
246
|
role: "status",
|
|
247
247
|
"aria-live": "polite",
|
|
248
|
-
"aria-label": getAriaLabel(toast.type),
|
|
248
|
+
"aria-label": getAriaLabel(toast.type, messages),
|
|
249
249
|
"data-tao-sonner-toast": "",
|
|
250
250
|
"data-tao-type": resolveDataType(toast.type, richColors),
|
|
251
251
|
"data-tao-mounted": mounted,
|
|
@@ -312,7 +312,7 @@ function ToastView({ toast, richColors, showClose, yPosition, index, visibleToas
|
|
|
312
312
|
}) : null,
|
|
313
313
|
showClose ? /*#__PURE__*/ jsx("button", {
|
|
314
314
|
type: "button",
|
|
315
|
-
"aria-label":
|
|
315
|
+
"aria-label": messages.closeNotification,
|
|
316
316
|
className: cx(classNames?.close),
|
|
317
317
|
style: styles?.close,
|
|
318
318
|
"data-tao-sonner-close": "",
|
|
@@ -56,7 +56,7 @@ function Spinner(t0) {
|
|
|
56
56
|
$[10] = styles?.root;
|
|
57
57
|
$[11] = t8;
|
|
58
58
|
} else t8 = $[11];
|
|
59
|
-
const t9 = ariaLabel ?? (null != tip || ariaLabelledBy ? void 0 :
|
|
59
|
+
const t9 = ariaLabel ?? (null != tip || ariaLabelledBy ? void 0 : ctx.locale.messages.loading);
|
|
60
60
|
const t10 = classNames?.indicator;
|
|
61
61
|
let t11;
|
|
62
62
|
if ($[12] !== t10) {
|
|
@@ -3,6 +3,7 @@ import { c } from "react-compiler-runtime";
|
|
|
3
3
|
import { useEffect, useRef, useState } from "react";
|
|
4
4
|
import { cx } from "../../utils/semantic.js";
|
|
5
5
|
import "./splitter.css";
|
|
6
|
+
import { useTaoConfig } from "../../provider/tao-provider.js";
|
|
6
7
|
function parseSize(value, total) {
|
|
7
8
|
if (void 0 === value) return;
|
|
8
9
|
if ('number' == typeof value) return value;
|
|
@@ -83,9 +84,10 @@ function Panel(_props) {
|
|
|
83
84
|
return null;
|
|
84
85
|
}
|
|
85
86
|
function Splitter(t0) {
|
|
86
|
-
const $ = c(
|
|
87
|
+
const $ = c(72);
|
|
87
88
|
const { orientation: t1, onResize, onResizeEnd, onResizeStart, className, classNames, styles, children } = t0;
|
|
88
89
|
const orientation = void 0 === t1 ? "horizontal" : t1;
|
|
90
|
+
const { locale } = useTaoConfig();
|
|
89
91
|
const containerRef = useRef(null);
|
|
90
92
|
let t2;
|
|
91
93
|
if ($[0] !== children) {
|
|
@@ -221,6 +223,7 @@ function Splitter(t0) {
|
|
|
221
223
|
dragCleanup.current?.();
|
|
222
224
|
const pos = isHorizontal ? e.clientX : e.clientY;
|
|
223
225
|
const pointerId = e.pointerId;
|
|
226
|
+
const sign = isHorizontal && "rtl" === getComputedStyle(containerRef.current).direction ? -1 : 1;
|
|
224
227
|
const startSizes_0 = [
|
|
225
228
|
...sizes
|
|
226
229
|
];
|
|
@@ -228,7 +231,7 @@ function Splitter(t0) {
|
|
|
228
231
|
onResizeStart?.(sizes);
|
|
229
232
|
const handleMove = (ev)=>{
|
|
230
233
|
if (ev.pointerId !== pointerId) return;
|
|
231
|
-
const delta_0 = (isHorizontal ? ev.clientX : ev.clientY) - pos;
|
|
234
|
+
const delta_0 = ((isHorizontal ? ev.clientX : ev.clientY) - pos) * sign;
|
|
232
235
|
const next_1 = resizePanels(index_0, delta_0, startSizes_0);
|
|
233
236
|
currentSizes = next_1;
|
|
234
237
|
setSizes(next_1);
|
|
@@ -262,8 +265,9 @@ function Splitter(t0) {
|
|
|
262
265
|
let t12;
|
|
263
266
|
if ($[25] !== isHorizontal || $[26] !== onResize || $[27] !== onResizeEnd || $[28] !== onResizeStart || $[29] !== resizePanels || $[30] !== sizes) {
|
|
264
267
|
t12 = (index_1, event)=>{
|
|
265
|
-
const
|
|
266
|
-
const
|
|
268
|
+
const rtl = "rtl" === getComputedStyle(event.currentTarget).direction;
|
|
269
|
+
const growKey = isHorizontal ? rtl ? "ArrowLeft" : "ArrowRight" : "ArrowDown";
|
|
270
|
+
const shrinkKey = isHorizontal ? rtl ? "ArrowRight" : "ArrowLeft" : "ArrowUp";
|
|
267
271
|
if (event.key !== growKey && event.key !== shrinkKey) return;
|
|
268
272
|
event.preventDefault();
|
|
269
273
|
const delta_1 = event.key === growKey ? 10 : -10;
|
|
@@ -377,7 +381,7 @@ function Splitter(t0) {
|
|
|
377
381
|
} else t16 = $[49];
|
|
378
382
|
const t17 = styles?.root;
|
|
379
383
|
let t18;
|
|
380
|
-
if ($[50] !== classNames?.dragger || $[51] !== classNames?.panel || $[52] !== containerSize || $[53] !== getDraggerCollapse || $[54] !== handleCollapse || $[55] !== handleDragStart || $[56] !== handleDraggerKeyDown || $[57] !== isHorizontal || $[58] !==
|
|
384
|
+
if ($[50] !== classNames?.dragger || $[51] !== classNames?.panel || $[52] !== containerSize || $[53] !== getDraggerCollapse || $[54] !== handleCollapse || $[55] !== handleDragStart || $[56] !== handleDraggerKeyDown || $[57] !== isHorizontal || $[58] !== locale || $[59] !== orientation || $[60] !== panelChildren || $[61] !== panelCount || $[62] !== panels || $[63] !== sizes || $[64] !== styles?.dragger || $[65] !== styles?.panel) {
|
|
381
385
|
t18 = panels.map((panel, i_0)=>{
|
|
382
386
|
const sizeStyle = isHorizontal ? {
|
|
383
387
|
width: sizes[i_0],
|
|
@@ -415,7 +419,7 @@ function Splitter(t0) {
|
|
|
415
419
|
"data-tao-splitter-dragger": "",
|
|
416
420
|
"data-tao-orientation": orientation,
|
|
417
421
|
role: "separator",
|
|
418
|
-
"aria-label":
|
|
422
|
+
"aria-label": locale.messages.resizePanels(i_0 + 1, i_0 + 2),
|
|
419
423
|
"aria-orientation": isHorizontal ? "vertical" : "horizontal",
|
|
420
424
|
"aria-valuemin": Math.round(valueMin),
|
|
421
425
|
"aria-valuemax": Math.round(valueMax),
|
|
@@ -442,7 +446,7 @@ function Splitter(t0) {
|
|
|
442
446
|
"data-tao-splitter-collapse": "",
|
|
443
447
|
"data-tao-collapse-direction": "start",
|
|
444
448
|
"data-tao-orientation": orientation,
|
|
445
|
-
"aria-label":
|
|
449
|
+
"aria-label": locale.messages.collapsePanel,
|
|
446
450
|
onClick: ()=>handleCollapse(i_0, "start"),
|
|
447
451
|
children: /*#__PURE__*/ jsx(CollapseIcon, {
|
|
448
452
|
direction: sizes[i_0] <= 0 ? "end" : "start",
|
|
@@ -454,7 +458,7 @@ function Splitter(t0) {
|
|
|
454
458
|
"data-tao-splitter-collapse": "",
|
|
455
459
|
"data-tao-collapse-direction": "end",
|
|
456
460
|
"data-tao-orientation": orientation,
|
|
457
|
-
"aria-label":
|
|
461
|
+
"aria-label": locale.messages.collapsePanel,
|
|
458
462
|
onClick: ()=>handleCollapse(i_0, "end"),
|
|
459
463
|
children: /*#__PURE__*/ jsx(CollapseIcon, {
|
|
460
464
|
direction: sizes[i_0 + 1] <= 0 ? "start" : "end",
|
|
@@ -477,17 +481,18 @@ function Splitter(t0) {
|
|
|
477
481
|
$[55] = handleDragStart;
|
|
478
482
|
$[56] = handleDraggerKeyDown;
|
|
479
483
|
$[57] = isHorizontal;
|
|
480
|
-
$[58] =
|
|
481
|
-
$[59] =
|
|
482
|
-
$[60] =
|
|
483
|
-
$[61] =
|
|
484
|
-
$[62] =
|
|
485
|
-
$[63] =
|
|
486
|
-
$[64] = styles?.
|
|
487
|
-
$[65] =
|
|
488
|
-
|
|
484
|
+
$[58] = locale;
|
|
485
|
+
$[59] = orientation;
|
|
486
|
+
$[60] = panelChildren;
|
|
487
|
+
$[61] = panelCount;
|
|
488
|
+
$[62] = panels;
|
|
489
|
+
$[63] = sizes;
|
|
490
|
+
$[64] = styles?.dragger;
|
|
491
|
+
$[65] = styles?.panel;
|
|
492
|
+
$[66] = t18;
|
|
493
|
+
} else t18 = $[66];
|
|
489
494
|
let t19;
|
|
490
|
-
if ($[
|
|
495
|
+
if ($[67] !== orientation || $[68] !== t16 || $[69] !== t17 || $[70] !== t18) {
|
|
491
496
|
t19 = /*#__PURE__*/ jsx("div", {
|
|
492
497
|
ref: containerRef,
|
|
493
498
|
"data-tao-splitter": "",
|
|
@@ -496,12 +501,12 @@ function Splitter(t0) {
|
|
|
496
501
|
style: t17,
|
|
497
502
|
children: t18
|
|
498
503
|
});
|
|
499
|
-
$[
|
|
500
|
-
$[
|
|
501
|
-
$[
|
|
502
|
-
$[
|
|
503
|
-
$[
|
|
504
|
-
} else t19 = $[
|
|
504
|
+
$[67] = orientation;
|
|
505
|
+
$[68] = t16;
|
|
506
|
+
$[69] = t17;
|
|
507
|
+
$[70] = t18;
|
|
508
|
+
$[71] = t19;
|
|
509
|
+
} else t19 = $[71];
|
|
505
510
|
return t19;
|
|
506
511
|
}
|
|
507
512
|
Splitter.Panel = Panel;
|
|
@@ -4,6 +4,8 @@ import './statistic.css';
|
|
|
4
4
|
export type StatisticValue = number | string;
|
|
5
5
|
export type StatisticSemanticPart = 'root' | 'content' | 'value' | 'title' | 'header' | 'prefix' | 'suffix';
|
|
6
6
|
export interface StatisticFormatConfig {
|
|
7
|
+
/** BCP 47 locale. Defaults to the provider's number locale. */
|
|
8
|
+
locale?: string;
|
|
7
9
|
formatter?: false | 'number' | 'countdown' | ((value: StatisticValue, config?: StatisticFormatConfig) => ReactNode);
|
|
8
10
|
decimalSeparator?: string;
|
|
9
11
|
groupSeparator?: string;
|