@rockshin/tao-ui 0.0.58 → 0.0.60
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 +105 -47
- package/dist/components/auto-complete/auto-complete.js +9 -2
- package/dist/components/calendar/calendar.js +22 -18
- package/dist/components/carousel/carousel.js +27 -14
- package/dist/components/cascader/cascader.js +18 -12
- package/dist/components/checkbox/checkbox.d.ts +3 -1
- package/dist/components/checkbox/checkbox.js +65 -58
- package/dist/components/color-picker/color-picker.css +1 -1
- package/dist/components/color-picker/color-picker.js +386 -362
- package/dist/components/context-menu/context-menu.d.ts +3 -1
- package/dist/components/context-menu/context-menu.js +48 -43
- 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 +93 -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-picker.css +9 -0
- package/dist/components/date-picker/date-picker.js +25 -14
- package/dist/components/date-picker/range-picker.d.ts +2 -0
- package/dist/components/date-picker/range-picker.js +132 -73
- package/dist/components/date-picker/types.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.d.ts +1 -0
- package/dist/components/dropdown/dropdown.js +29 -21
- package/dist/components/float-button/float-button.js +6 -5
- package/dist/components/form/form-item.d.ts +1 -1
- package/dist/components/form/form-item.js +160 -120
- package/dist/components/form/use-form.js +2 -1
- 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/input/input-shared.js +3 -2
- package/dist/components/input/otp.js +114 -110
- package/dist/components/input/password.js +55 -61
- package/dist/components/input/search.js +8 -4
- package/dist/components/input-number/input-number.d.ts +2 -1
- package/dist/components/input-number/input-number.js +67 -52
- package/dist/components/mentions/mentions.js +4 -2
- package/dist/components/menu/menu-render.d.ts +6 -0
- package/dist/components/menu/menu-render.js +39 -26
- package/dist/components/modal/confirm-dialog.js +22 -10
- package/dist/components/modal/modal.js +320 -315
- package/dist/components/modal/use-modal.js +1 -1
- package/dist/components/pagination/pagination.d.ts +4 -2
- package/dist/components/pagination/pagination.js +128 -117
- package/dist/components/popover/popover.js +214 -351
- 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/select/mobile-select.js +7 -4
- package/dist/components/select/select-model.js +3 -3
- package/dist/components/select/select.js +78 -39
- package/dist/components/select/use-select-selection.js +100 -92
- 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 +38 -31
- package/dist/components/switch/switch.js +45 -39
- package/dist/components/table/table-filter.d.ts +3 -1
- package/dist/components/table/table-filter.js +100 -74
- package/dist/components/table/table.js +2 -0
- package/dist/components/table/use-table-data.js +2 -2
- package/dist/components/tabs/tabs.d.ts +3 -2
- package/dist/components/tabs/tabs.js +122 -112
- package/dist/components/time-picker/time-picker.js +35 -3
- package/dist/components/tooltip/tooltip.d.ts +1 -1
- package/dist/components/tooltip/tooltip.js +220 -124
- package/dist/components/tree/tree.js +31 -3
- package/dist/components/tree-select/tree-select.js +2 -1
- package/dist/components/upload/upload.js +67 -40
- 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/format.js +1 -1
- package/dist/number-input/use-number-input.d.ts +1 -0
- package/dist/number-input/use-number-input.js +170 -321
- 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 +66 -52
- package/dist/theme/control.css +5 -1
- package/dist/theme/theme.css +2 -2
- 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
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
1
|
+
import { type CSSProperties, type ReactNode } 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 './pagination.css';
|
|
5
5
|
export type PaginationSemanticPart = 'root' | 'item' | 'total';
|
|
6
6
|
export interface PaginationProps {
|
|
7
|
+
/** Current page as a safe integer. */
|
|
7
8
|
current?: number;
|
|
8
9
|
defaultCurrent?: number;
|
|
9
10
|
/** A positive integer. */
|
|
@@ -18,7 +19,8 @@ export interface PaginationProps {
|
|
|
18
19
|
size?: TaoSize;
|
|
19
20
|
disabled?: boolean;
|
|
20
21
|
className?: string;
|
|
22
|
+
style?: CSSProperties;
|
|
21
23
|
classNames?: SemanticClassNames<PaginationSemanticPart>;
|
|
22
24
|
styles?: SemanticStyles<PaginationSemanticPart>;
|
|
23
25
|
}
|
|
24
|
-
export declare function Pagination({ current: currentProp, defaultCurrent, pageSize: pageSizeProp, defaultPageSize, total, onChange, showSizeChanger, pageSizeOptions, showTotal, size, disabled, className, classNames, styles, }: PaginationProps): import("react").JSX.Element;
|
|
26
|
+
export declare function Pagination({ current: currentProp, defaultCurrent, pageSize: pageSizeProp, defaultPageSize, total, onChange, showSizeChanger, pageSizeOptions, showTotal, size, disabled, className, style, classNames, styles, }: PaginationProps): import("react").JSX.Element;
|
|
@@ -68,8 +68,8 @@ function ChevronRight() {
|
|
|
68
68
|
return t0;
|
|
69
69
|
}
|
|
70
70
|
function Pagination(t0) {
|
|
71
|
-
const $ = c(
|
|
72
|
-
const { current: currentProp, defaultCurrent: t1, pageSize: pageSizeProp, defaultPageSize: t2, total, onChange, showSizeChanger: t3, pageSizeOptions: t4, showTotal, size, disabled, className, classNames, styles } = t0;
|
|
71
|
+
const $ = c(74);
|
|
72
|
+
const { current: currentProp, defaultCurrent: t1, pageSize: pageSizeProp, defaultPageSize: t2, total, onChange, showSizeChanger: t3, pageSizeOptions: t4, showTotal, size, disabled, className, style, classNames, styles } = t0;
|
|
73
73
|
const defaultCurrent = void 0 === t1 ? 1 : t1;
|
|
74
74
|
const defaultPageSize = void 0 === t2 ? 10 : t2;
|
|
75
75
|
const showSizeChanger = void 0 === t3 ? false : t3;
|
|
@@ -95,6 +95,7 @@ function Pagination(t0) {
|
|
|
95
95
|
const [internalPageSize, setInternalPageSize] = useState(defaultPageSize);
|
|
96
96
|
const pageSize = isPageSizeControlled ? pageSizeProp : internalPageSize;
|
|
97
97
|
if (!Number.isSafeInteger(total) || total < 0) throw new RangeError("Pagination total must be a non-negative safe integer");
|
|
98
|
+
if (!Number.isSafeInteger(current)) throw new RangeError("Pagination current page must be a safe integer");
|
|
98
99
|
if (!isValidPageSize(pageSize)) throw new RangeError("Pagination pageSize must be a positive integer");
|
|
99
100
|
if (showSizeChanger && !pageSizeOptions.every(isValidPageSize)) throw new RangeError("Pagination pageSizeOptions must contain positive integers");
|
|
100
101
|
const totalPages = Math.max(1, Math.ceil(total / pageSize));
|
|
@@ -142,8 +143,18 @@ function Pagination(t0) {
|
|
|
142
143
|
} else t11 = $[14];
|
|
143
144
|
const t12 = styles?.root;
|
|
144
145
|
let t13;
|
|
145
|
-
if ($[15] !==
|
|
146
|
-
t13 =
|
|
146
|
+
if ($[15] !== style || $[16] !== t12) {
|
|
147
|
+
t13 = {
|
|
148
|
+
...t12,
|
|
149
|
+
...style
|
|
150
|
+
};
|
|
151
|
+
$[15] = style;
|
|
152
|
+
$[16] = t12;
|
|
153
|
+
$[17] = t13;
|
|
154
|
+
} else t13 = $[17];
|
|
155
|
+
let t14;
|
|
156
|
+
if ($[18] !== classNames?.total || $[19] !== current || $[20] !== rangeEnd || $[21] !== rangeStart || $[22] !== showTotal || $[23] !== styles?.total || $[24] !== total) {
|
|
157
|
+
t14 = showTotal && /*#__PURE__*/ jsx("span", {
|
|
147
158
|
"data-tao-pagination-total": "",
|
|
148
159
|
className: classNames?.total,
|
|
149
160
|
style: styles?.total,
|
|
@@ -155,52 +166,52 @@ function Pagination(t0) {
|
|
|
155
166
|
0
|
|
156
167
|
])
|
|
157
168
|
});
|
|
158
|
-
$[
|
|
159
|
-
$[
|
|
160
|
-
$[
|
|
161
|
-
$[
|
|
162
|
-
$[
|
|
163
|
-
$[
|
|
164
|
-
$[
|
|
165
|
-
$[
|
|
166
|
-
} else
|
|
167
|
-
const
|
|
168
|
-
let
|
|
169
|
-
if ($[
|
|
170
|
-
|
|
171
|
-
$[
|
|
172
|
-
$[
|
|
173
|
-
$[
|
|
174
|
-
} else
|
|
175
|
-
const
|
|
176
|
-
const
|
|
177
|
-
let t18;
|
|
178
|
-
if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
|
|
179
|
-
t18 = /*#__PURE__*/ jsx(ChevronLeft, {});
|
|
180
|
-
$[26] = t18;
|
|
181
|
-
} else t18 = $[26];
|
|
169
|
+
$[18] = classNames?.total;
|
|
170
|
+
$[19] = current;
|
|
171
|
+
$[20] = rangeEnd;
|
|
172
|
+
$[21] = rangeStart;
|
|
173
|
+
$[22] = showTotal;
|
|
174
|
+
$[23] = styles?.total;
|
|
175
|
+
$[24] = total;
|
|
176
|
+
$[25] = t14;
|
|
177
|
+
} else t14 = $[25];
|
|
178
|
+
const t15 = resolvedDisabled || current <= 1;
|
|
179
|
+
let t16;
|
|
180
|
+
if ($[26] !== current || $[27] !== goTo) {
|
|
181
|
+
t16 = ()=>goTo(current - 1);
|
|
182
|
+
$[26] = current;
|
|
183
|
+
$[27] = goTo;
|
|
184
|
+
$[28] = t16;
|
|
185
|
+
} else t16 = $[28];
|
|
186
|
+
const t17 = classNames?.item;
|
|
187
|
+
const t18 = styles?.item;
|
|
182
188
|
let t19;
|
|
183
|
-
if ($[
|
|
184
|
-
t19 = /*#__PURE__*/ jsx(
|
|
189
|
+
if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
|
|
190
|
+
t19 = /*#__PURE__*/ jsx(ChevronLeft, {});
|
|
191
|
+
$[29] = t19;
|
|
192
|
+
} else t19 = $[29];
|
|
193
|
+
let t20;
|
|
194
|
+
if ($[30] !== ctx.locale.messages.previousPage || $[31] !== t15 || $[32] !== t16 || $[33] !== t17 || $[34] !== t18) {
|
|
195
|
+
t20 = /*#__PURE__*/ jsx("button", {
|
|
185
196
|
type: "button",
|
|
186
197
|
"data-tao-pagination-btn": "",
|
|
187
|
-
disabled:
|
|
198
|
+
disabled: t15,
|
|
188
199
|
"aria-label": ctx.locale.messages.previousPage,
|
|
189
|
-
onClick:
|
|
190
|
-
className:
|
|
191
|
-
style:
|
|
192
|
-
children:
|
|
200
|
+
onClick: t16,
|
|
201
|
+
className: t17,
|
|
202
|
+
style: t18,
|
|
203
|
+
children: t19
|
|
193
204
|
});
|
|
194
|
-
$[
|
|
195
|
-
$[
|
|
196
|
-
$[
|
|
197
|
-
$[
|
|
198
|
-
$[
|
|
199
|
-
$[
|
|
200
|
-
} else
|
|
201
|
-
let
|
|
202
|
-
if ($[
|
|
203
|
-
|
|
205
|
+
$[30] = ctx.locale.messages.previousPage;
|
|
206
|
+
$[31] = t15;
|
|
207
|
+
$[32] = t16;
|
|
208
|
+
$[33] = t17;
|
|
209
|
+
$[34] = t18;
|
|
210
|
+
$[35] = t20;
|
|
211
|
+
} else t20 = $[35];
|
|
212
|
+
let t21;
|
|
213
|
+
if ($[36] !== classNames?.item || $[37] !== ctx.locale.messages || $[38] !== current || $[39] !== goTo || $[40] !== pages || $[41] !== resolvedDisabled || $[42] !== styles?.item) {
|
|
214
|
+
t21 = pages.map((item, i)=>"ellipsis" === item ? /*#__PURE__*/ jsx("span", {
|
|
204
215
|
"data-tao-pagination-ellipsis": "",
|
|
205
216
|
children: "\xb7\xb7\xb7"
|
|
206
217
|
}, `ellipsis-${pages[i - 1]}-${pages[i + 1]}`) : /*#__PURE__*/ jsx("button", {
|
|
@@ -215,52 +226,52 @@ function Pagination(t0) {
|
|
|
215
226
|
style: styles?.item,
|
|
216
227
|
children: item
|
|
217
228
|
}, item));
|
|
218
|
-
$[
|
|
219
|
-
$[
|
|
220
|
-
$[
|
|
221
|
-
$[
|
|
222
|
-
$[
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
225
|
-
$[
|
|
226
|
-
} else
|
|
227
|
-
const
|
|
228
|
-
let
|
|
229
|
-
if ($[
|
|
230
|
-
|
|
231
|
-
$[
|
|
232
|
-
$[
|
|
233
|
-
$[
|
|
234
|
-
} else
|
|
235
|
-
const
|
|
236
|
-
const
|
|
237
|
-
let t25;
|
|
238
|
-
if ($[44] === Symbol.for("react.memo_cache_sentinel")) {
|
|
239
|
-
t25 = /*#__PURE__*/ jsx(ChevronRight, {});
|
|
240
|
-
$[44] = t25;
|
|
241
|
-
} else t25 = $[44];
|
|
229
|
+
$[36] = classNames?.item;
|
|
230
|
+
$[37] = ctx.locale.messages;
|
|
231
|
+
$[38] = current;
|
|
232
|
+
$[39] = goTo;
|
|
233
|
+
$[40] = pages;
|
|
234
|
+
$[41] = resolvedDisabled;
|
|
235
|
+
$[42] = styles?.item;
|
|
236
|
+
$[43] = t21;
|
|
237
|
+
} else t21 = $[43];
|
|
238
|
+
const t22 = resolvedDisabled || current >= totalPages;
|
|
239
|
+
let t23;
|
|
240
|
+
if ($[44] !== current || $[45] !== goTo) {
|
|
241
|
+
t23 = ()=>goTo(current + 1);
|
|
242
|
+
$[44] = current;
|
|
243
|
+
$[45] = goTo;
|
|
244
|
+
$[46] = t23;
|
|
245
|
+
} else t23 = $[46];
|
|
246
|
+
const t24 = classNames?.item;
|
|
247
|
+
const t25 = styles?.item;
|
|
242
248
|
let t26;
|
|
243
|
-
if ($[
|
|
244
|
-
t26 = /*#__PURE__*/ jsx(
|
|
249
|
+
if ($[47] === Symbol.for("react.memo_cache_sentinel")) {
|
|
250
|
+
t26 = /*#__PURE__*/ jsx(ChevronRight, {});
|
|
251
|
+
$[47] = t26;
|
|
252
|
+
} else t26 = $[47];
|
|
253
|
+
let t27;
|
|
254
|
+
if ($[48] !== ctx.locale.messages.nextPage || $[49] !== t22 || $[50] !== t23 || $[51] !== t24 || $[52] !== t25) {
|
|
255
|
+
t27 = /*#__PURE__*/ jsx("button", {
|
|
245
256
|
type: "button",
|
|
246
257
|
"data-tao-pagination-btn": "",
|
|
247
|
-
disabled:
|
|
258
|
+
disabled: t22,
|
|
248
259
|
"aria-label": ctx.locale.messages.nextPage,
|
|
249
|
-
onClick:
|
|
250
|
-
className:
|
|
251
|
-
style:
|
|
252
|
-
children:
|
|
260
|
+
onClick: t23,
|
|
261
|
+
className: t24,
|
|
262
|
+
style: t25,
|
|
263
|
+
children: t26
|
|
253
264
|
});
|
|
254
|
-
$[
|
|
255
|
-
$[
|
|
256
|
-
$[
|
|
257
|
-
$[
|
|
258
|
-
$[
|
|
259
|
-
$[
|
|
260
|
-
} else
|
|
261
|
-
let
|
|
262
|
-
if ($[
|
|
263
|
-
|
|
265
|
+
$[48] = ctx.locale.messages.nextPage;
|
|
266
|
+
$[49] = t22;
|
|
267
|
+
$[50] = t23;
|
|
268
|
+
$[51] = t24;
|
|
269
|
+
$[52] = t25;
|
|
270
|
+
$[53] = t27;
|
|
271
|
+
} else t27 = $[53];
|
|
272
|
+
let t28;
|
|
273
|
+
if ($[54] !== ctx.locale.messages.itemsPerPage || $[55] !== ctx.locale.messages.pageSize || $[56] !== goTo || $[57] !== pageSize || $[58] !== pageSizeOptions || $[59] !== resolvedDisabled || $[60] !== resolvedSize || $[61] !== showSizeChanger) {
|
|
274
|
+
t28 = showSizeChanger && /*#__PURE__*/ jsx(Select, {
|
|
264
275
|
"aria-label": ctx.locale.messages.pageSize,
|
|
265
276
|
style: {
|
|
266
277
|
width: "auto"
|
|
@@ -280,45 +291,45 @@ function Pagination(t0) {
|
|
|
280
291
|
disabled: resolvedDisabled,
|
|
281
292
|
size: "large" === resolvedSize ? "medium" : resolvedSize
|
|
282
293
|
});
|
|
283
|
-
$[
|
|
284
|
-
$[
|
|
285
|
-
$[
|
|
286
|
-
$[
|
|
287
|
-
$[
|
|
288
|
-
$[
|
|
289
|
-
$[
|
|
290
|
-
$[
|
|
291
|
-
$[
|
|
292
|
-
} else
|
|
293
|
-
let
|
|
294
|
-
if ($[
|
|
295
|
-
|
|
294
|
+
$[54] = ctx.locale.messages.itemsPerPage;
|
|
295
|
+
$[55] = ctx.locale.messages.pageSize;
|
|
296
|
+
$[56] = goTo;
|
|
297
|
+
$[57] = pageSize;
|
|
298
|
+
$[58] = pageSizeOptions;
|
|
299
|
+
$[59] = resolvedDisabled;
|
|
300
|
+
$[60] = resolvedSize;
|
|
301
|
+
$[61] = showSizeChanger;
|
|
302
|
+
$[62] = t28;
|
|
303
|
+
} else t28 = $[62];
|
|
304
|
+
let t29;
|
|
305
|
+
if ($[63] !== ctx.locale.messages.pagination || $[64] !== resolvedSize || $[65] !== t11 || $[66] !== t13 || $[67] !== t14 || $[68] !== t20 || $[69] !== t21 || $[70] !== t27 || $[71] !== t28 || $[72] !== t8) {
|
|
306
|
+
t29 = /*#__PURE__*/ jsxs("nav", {
|
|
296
307
|
"data-tao-pagination": "",
|
|
297
308
|
"data-tao-size": resolvedSize,
|
|
298
309
|
"data-tao-disabled": t8,
|
|
299
310
|
"aria-label": t9,
|
|
300
311
|
className: t11,
|
|
301
|
-
style:
|
|
312
|
+
style: t13,
|
|
302
313
|
children: [
|
|
303
|
-
|
|
304
|
-
t19,
|
|
314
|
+
t14,
|
|
305
315
|
t20,
|
|
306
|
-
|
|
307
|
-
t27
|
|
316
|
+
t21,
|
|
317
|
+
t27,
|
|
318
|
+
t28
|
|
308
319
|
]
|
|
309
320
|
});
|
|
310
|
-
$[
|
|
311
|
-
$[
|
|
312
|
-
$[
|
|
313
|
-
$[
|
|
314
|
-
$[
|
|
315
|
-
$[
|
|
316
|
-
$[
|
|
317
|
-
$[
|
|
318
|
-
$[
|
|
319
|
-
$[
|
|
320
|
-
$[
|
|
321
|
-
} else
|
|
322
|
-
return
|
|
321
|
+
$[63] = ctx.locale.messages.pagination;
|
|
322
|
+
$[64] = resolvedSize;
|
|
323
|
+
$[65] = t11;
|
|
324
|
+
$[66] = t13;
|
|
325
|
+
$[67] = t14;
|
|
326
|
+
$[68] = t20;
|
|
327
|
+
$[69] = t21;
|
|
328
|
+
$[70] = t27;
|
|
329
|
+
$[71] = t28;
|
|
330
|
+
$[72] = t8;
|
|
331
|
+
$[73] = t29;
|
|
332
|
+
} else t29 = $[73];
|
|
333
|
+
return t29;
|
|
323
334
|
}
|
|
324
335
|
export { Pagination };
|