@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
|
@@ -200,7 +200,7 @@ function SkeletonImage(props) {
|
|
|
200
200
|
return t1;
|
|
201
201
|
}
|
|
202
202
|
const SkeletonRoot = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
203
|
-
const $ = c(
|
|
203
|
+
const $ = c(78);
|
|
204
204
|
const { active, avatar: t0, title: t1, paragraph: t2, round, prefixCls: t3, className, rootClassName, style, classNames, styles, children } = props;
|
|
205
205
|
const avatar = void 0 === t0 ? false : t0;
|
|
206
206
|
const title = void 0 === t1 ? true : t1;
|
|
@@ -327,23 +327,27 @@ const SkeletonRoot = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
327
327
|
$[33] = t14;
|
|
328
328
|
} else t14 = $[33];
|
|
329
329
|
let t15;
|
|
330
|
-
if ($[34] !== avatar || $[35] !== avatarProps.className || $[36] !== avatarProps.
|
|
330
|
+
if ($[34] !== avatar || $[35] !== avatarProps.className || $[36] !== avatarProps.classNames?.content || $[37] !== avatarProps.classNames?.root || $[38] !== avatarProps.prefixCls || $[39] !== avatarProps.rootClassName || $[40] !== avatarProps.shape || $[41] !== avatarProps.style || $[42] !== avatarProps.styles?.content || $[43] !== avatarProps.styles?.root || $[44] !== avatarSize || $[45] !== names?.avatar || $[46] !== names?.header || $[47] !== paragraph || $[48] !== prefixCls || $[49] !== slots?.avatar || $[50] !== slots?.header || $[51] !== title) {
|
|
331
331
|
t15 = avatar && /*#__PURE__*/ jsx("div", {
|
|
332
332
|
"data-tao-skeleton-header": "",
|
|
333
|
-
className: cx(`${prefixCls}-header`, names?.header),
|
|
334
|
-
style:
|
|
333
|
+
className: cx(`${prefixCls}-header`, names?.header, avatarProps.classNames?.root),
|
|
334
|
+
style: {
|
|
335
|
+
...avatarProps.styles?.root,
|
|
336
|
+
...slots?.header
|
|
337
|
+
},
|
|
335
338
|
"aria-hidden": "true",
|
|
336
339
|
children: /*#__PURE__*/ jsx("span", {
|
|
337
340
|
"data-tao-skeleton-placeholder": "",
|
|
338
341
|
"data-tao-kind": "avatar",
|
|
339
342
|
"data-tao-size": "number" == typeof avatarSize ? void 0 : avatarSize,
|
|
340
343
|
"data-tao-shape": avatarProps.shape ?? (title && !paragraph ? "square" : "circle"),
|
|
341
|
-
className: cx(avatarProps.prefixCls ?? `${prefixCls}-avatar`, names?.avatar, avatarProps.className, avatarProps.rootClassName),
|
|
344
|
+
className: cx(avatarProps.prefixCls ?? `${prefixCls}-avatar`, names?.avatar, avatarProps.classNames?.content, avatarProps.className, avatarProps.rootClassName),
|
|
342
345
|
style: {
|
|
343
346
|
..."number" == typeof avatarSize ? {
|
|
344
347
|
width: avatarSize,
|
|
345
348
|
height: avatarSize
|
|
346
349
|
} : {},
|
|
350
|
+
...avatarProps.styles?.content,
|
|
347
351
|
...avatarProps.style,
|
|
348
352
|
...slots?.avatar
|
|
349
353
|
}
|
|
@@ -351,22 +355,26 @@ const SkeletonRoot = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
351
355
|
});
|
|
352
356
|
$[34] = avatar;
|
|
353
357
|
$[35] = avatarProps.className;
|
|
354
|
-
$[36] = avatarProps.
|
|
355
|
-
$[37] = avatarProps.
|
|
356
|
-
$[38] = avatarProps.
|
|
357
|
-
$[39] = avatarProps.
|
|
358
|
-
$[40] =
|
|
359
|
-
$[41] =
|
|
360
|
-
$[42] =
|
|
361
|
-
$[43] =
|
|
362
|
-
$[44] =
|
|
363
|
-
$[45] =
|
|
364
|
-
$[46] =
|
|
365
|
-
$[47] =
|
|
366
|
-
$[48] =
|
|
367
|
-
|
|
358
|
+
$[36] = avatarProps.classNames?.content;
|
|
359
|
+
$[37] = avatarProps.classNames?.root;
|
|
360
|
+
$[38] = avatarProps.prefixCls;
|
|
361
|
+
$[39] = avatarProps.rootClassName;
|
|
362
|
+
$[40] = avatarProps.shape;
|
|
363
|
+
$[41] = avatarProps.style;
|
|
364
|
+
$[42] = avatarProps.styles?.content;
|
|
365
|
+
$[43] = avatarProps.styles?.root;
|
|
366
|
+
$[44] = avatarSize;
|
|
367
|
+
$[45] = names?.avatar;
|
|
368
|
+
$[46] = names?.header;
|
|
369
|
+
$[47] = paragraph;
|
|
370
|
+
$[48] = prefixCls;
|
|
371
|
+
$[49] = slots?.avatar;
|
|
372
|
+
$[50] = slots?.header;
|
|
373
|
+
$[51] = title;
|
|
374
|
+
$[52] = t15;
|
|
375
|
+
} else t15 = $[52];
|
|
368
376
|
let t16;
|
|
369
|
-
if ($[
|
|
377
|
+
if ($[53] !== names?.paragraph || $[54] !== names?.section || $[55] !== names?.title || $[56] !== paragraph || $[57] !== paragraphProps || $[58] !== paragraphWidth || $[59] !== prefixCls || $[60] !== rowNumbers || $[61] !== rows || $[62] !== slots?.paragraph || $[63] !== slots?.section || $[64] !== slots?.title || $[65] !== title || $[66] !== titleProps.className || $[67] !== titleProps.prefixCls || $[68] !== titleProps.style || $[69] !== titleWidth) {
|
|
370
378
|
t16 = (title || paragraph) && /*#__PURE__*/ jsxs("div", {
|
|
371
379
|
"data-tao-skeleton-section": "",
|
|
372
380
|
className: cx(`${prefixCls}-section`, names?.section),
|
|
@@ -400,27 +408,27 @@ const SkeletonRoot = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
400
408
|
})
|
|
401
409
|
]
|
|
402
410
|
});
|
|
403
|
-
$[
|
|
404
|
-
$[
|
|
405
|
-
$[
|
|
406
|
-
$[
|
|
407
|
-
$[
|
|
408
|
-
$[
|
|
409
|
-
$[
|
|
410
|
-
$[
|
|
411
|
-
$[
|
|
412
|
-
$[
|
|
413
|
-
$[
|
|
414
|
-
$[
|
|
415
|
-
$[
|
|
416
|
-
$[
|
|
417
|
-
$[
|
|
418
|
-
$[
|
|
419
|
-
$[
|
|
420
|
-
$[
|
|
421
|
-
} else t16 = $[
|
|
411
|
+
$[53] = names?.paragraph;
|
|
412
|
+
$[54] = names?.section;
|
|
413
|
+
$[55] = names?.title;
|
|
414
|
+
$[56] = paragraph;
|
|
415
|
+
$[57] = paragraphProps;
|
|
416
|
+
$[58] = paragraphWidth;
|
|
417
|
+
$[59] = prefixCls;
|
|
418
|
+
$[60] = rowNumbers;
|
|
419
|
+
$[61] = rows;
|
|
420
|
+
$[62] = slots?.paragraph;
|
|
421
|
+
$[63] = slots?.section;
|
|
422
|
+
$[64] = slots?.title;
|
|
423
|
+
$[65] = title;
|
|
424
|
+
$[66] = titleProps.className;
|
|
425
|
+
$[67] = titleProps.prefixCls;
|
|
426
|
+
$[68] = titleProps.style;
|
|
427
|
+
$[69] = titleWidth;
|
|
428
|
+
$[70] = t16;
|
|
429
|
+
} else t16 = $[70];
|
|
422
430
|
let t17;
|
|
423
|
-
if ($[
|
|
431
|
+
if ($[71] !== t10 || $[72] !== t12 || $[73] !== t14 || $[74] !== t15 || $[75] !== t16 || $[76] !== t9) {
|
|
424
432
|
t17 = /*#__PURE__*/ jsxs("div", {
|
|
425
433
|
ref: root,
|
|
426
434
|
"data-tao-skeleton": "",
|
|
@@ -434,14 +442,14 @@ const SkeletonRoot = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
434
442
|
t16
|
|
435
443
|
]
|
|
436
444
|
});
|
|
437
|
-
$[
|
|
438
|
-
$[
|
|
439
|
-
$[
|
|
440
|
-
$[
|
|
441
|
-
$[
|
|
442
|
-
$[
|
|
443
|
-
$[
|
|
444
|
-
} else t17 = $[
|
|
445
|
+
$[71] = t10;
|
|
446
|
+
$[72] = t12;
|
|
447
|
+
$[73] = t14;
|
|
448
|
+
$[74] = t15;
|
|
449
|
+
$[75] = t16;
|
|
450
|
+
$[76] = t9;
|
|
451
|
+
$[77] = t17;
|
|
452
|
+
} else t17 = $[77];
|
|
445
453
|
return t17;
|
|
446
454
|
});
|
|
447
455
|
const skeleton_Skeleton = Object.assign(SkeletonRoot, {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "react-compiler-runtime";
|
|
3
2
|
import slider from "@rc-component/slider";
|
|
4
|
-
import { forwardRef, useEffect, useRef, useState } from "react";
|
|
3
|
+
import { cloneElement, forwardRef, useEffect, useRef, useState } from "react";
|
|
5
4
|
import { TaoPortalScope, useTaoConfig, useTaoDirection } from "../../provider/tao-provider.js";
|
|
6
5
|
import { cx } from "../../utils/semantic.js";
|
|
7
6
|
import "../tooltip/tooltip.css";
|
|
@@ -19,7 +18,7 @@ function SliderTip({ children, value, dragging, disabled, vertical, direction, o
|
|
|
19
18
|
const title = null === formatter ? null : formatter ? formatter(value) : String(value);
|
|
20
19
|
const side = placement.startsWith('top') ? 'top' : placement.startsWith('bottom') ? 'bottom' : placement.startsWith('left') ? 'left' : 'right';
|
|
21
20
|
const align = placement.endsWith('Left') || placement.endsWith('Top') ? 'start' : placement.endsWith('Right') || placement.endsWith('Bottom') ? 'end' : 'center';
|
|
22
|
-
const visible = null != title && '' !== title && (open ?? (!disabled && (dragging || active)));
|
|
21
|
+
const visible = null != title && 'boolean' != typeof title && '' !== title && (open ?? (!disabled && (dragging || active)));
|
|
23
22
|
return /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_tooltip_b301f25d.Provider, {
|
|
24
23
|
delayDuration: 1000 * mouseEnterDelay,
|
|
25
24
|
children: /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_tooltip_b301f25d.Root, {
|
|
@@ -89,225 +88,101 @@ function SliderTip({ children, value, dragging, disabled, vertical, direction, o
|
|
|
89
88
|
})
|
|
90
89
|
});
|
|
91
90
|
}
|
|
91
|
+
const withValueSnapshot = (callback)=>callback ? (value)=>callback(Array.isArray(value) ? [
|
|
92
|
+
...value
|
|
93
|
+
] : value) : void 0;
|
|
92
94
|
const Slider = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
93
|
-
const
|
|
94
|
-
let className;
|
|
95
|
-
let classNames;
|
|
96
|
-
let directionProp;
|
|
97
|
-
let disabled;
|
|
98
|
-
let handleRender;
|
|
99
|
-
let orientation;
|
|
100
|
-
let rest;
|
|
101
|
-
let reverse;
|
|
102
|
-
let rootClassName;
|
|
103
|
-
let style;
|
|
104
|
-
let styles;
|
|
105
|
-
let t0;
|
|
106
|
-
let t1;
|
|
107
|
-
let t2;
|
|
108
|
-
if ($[0] !== props) {
|
|
109
|
-
({ prefixCls: t0, classNames, styles, rootClassName, className, style, orientation, vertical: t1, direction: directionProp, disabled, tooltip: t2, handleRender, reverse, ...rest } = props);
|
|
110
|
-
$[0] = props;
|
|
111
|
-
$[1] = className;
|
|
112
|
-
$[2] = classNames;
|
|
113
|
-
$[3] = directionProp;
|
|
114
|
-
$[4] = disabled;
|
|
115
|
-
$[5] = handleRender;
|
|
116
|
-
$[6] = orientation;
|
|
117
|
-
$[7] = rest;
|
|
118
|
-
$[8] = reverse;
|
|
119
|
-
$[9] = rootClassName;
|
|
120
|
-
$[10] = style;
|
|
121
|
-
$[11] = styles;
|
|
122
|
-
$[12] = t0;
|
|
123
|
-
$[13] = t1;
|
|
124
|
-
$[14] = t2;
|
|
125
|
-
} else {
|
|
126
|
-
className = $[1];
|
|
127
|
-
classNames = $[2];
|
|
128
|
-
directionProp = $[3];
|
|
129
|
-
disabled = $[4];
|
|
130
|
-
handleRender = $[5];
|
|
131
|
-
orientation = $[6];
|
|
132
|
-
rest = $[7];
|
|
133
|
-
reverse = $[8];
|
|
134
|
-
rootClassName = $[9];
|
|
135
|
-
style = $[10];
|
|
136
|
-
styles = $[11];
|
|
137
|
-
t0 = $[12];
|
|
138
|
-
t1 = $[13];
|
|
139
|
-
t2 = $[14];
|
|
140
|
-
}
|
|
141
|
-
const prefixCls = void 0 === t0 ? "tao-slider" : t0;
|
|
142
|
-
const vertical = void 0 === t1 ? false : t1;
|
|
143
|
-
let t3;
|
|
144
|
-
if ($[15] !== t2) {
|
|
145
|
-
t3 = void 0 === t2 ? {} : t2;
|
|
146
|
-
$[15] = t2;
|
|
147
|
-
$[16] = t3;
|
|
148
|
-
} else t3 = $[16];
|
|
149
|
-
const tooltip = t3;
|
|
95
|
+
const { prefixCls = 'tao-slider', classNames, styles, rootClassName, className, style, orientation, vertical = false, direction: directionProp, disabled, keyboard, tooltip = {}, handleRender, reverse, ...rest } = props;
|
|
150
96
|
const [direction, directionRef] = useTaoDirection(directionProp);
|
|
151
97
|
const config = useTaoConfig();
|
|
152
98
|
const resolvedDisabled = disabled ?? config.disabled;
|
|
153
|
-
const resolvedVertical = orientation ?
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
t4 = "function" == typeof styles ? styles({
|
|
166
|
-
props: mergedProps
|
|
167
|
-
}) : styles;
|
|
168
|
-
$[17] = classNames;
|
|
169
|
-
$[18] = props;
|
|
170
|
-
$[19] = resolvedDisabled;
|
|
171
|
-
$[20] = resolvedVertical;
|
|
172
|
-
$[21] = styles;
|
|
173
|
-
$[22] = classes;
|
|
174
|
-
$[23] = t4;
|
|
175
|
-
} else {
|
|
176
|
-
classes = $[22];
|
|
177
|
-
t4 = $[23];
|
|
178
|
-
}
|
|
179
|
-
const semanticStyles = t4;
|
|
99
|
+
const resolvedVertical = orientation ? 'vertical' === orientation : vertical;
|
|
100
|
+
const mergedProps = {
|
|
101
|
+
...props,
|
|
102
|
+
disabled: resolvedDisabled,
|
|
103
|
+
vertical: resolvedVertical
|
|
104
|
+
};
|
|
105
|
+
const classes = 'function' == typeof classNames ? classNames({
|
|
106
|
+
props: mergedProps
|
|
107
|
+
}) : classNames;
|
|
108
|
+
const semanticStyles = 'function' == typeof styles ? styles({
|
|
109
|
+
props: mergedProps
|
|
110
|
+
}) : styles;
|
|
180
111
|
const allDisabled = Array.isArray(resolvedDisabled) ? resolvedDisabled.every(Boolean) : resolvedDisabled;
|
|
181
|
-
const
|
|
182
|
-
const
|
|
183
|
-
const
|
|
184
|
-
const
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
let t12;
|
|
196
|
-
if ($[28] !== style || $[29] !== t11) {
|
|
197
|
-
t12 = {
|
|
198
|
-
...t11,
|
|
199
|
-
...style
|
|
200
|
-
};
|
|
201
|
-
$[28] = style;
|
|
202
|
-
$[29] = t11;
|
|
203
|
-
$[30] = t12;
|
|
204
|
-
} else t12 = $[30];
|
|
205
|
-
const t13 = classes?.tracks;
|
|
206
|
-
let t14;
|
|
207
|
-
if ($[31] !== t13) {
|
|
208
|
-
t14 = cx("tao-slider-tracks-slot", t13);
|
|
209
|
-
$[31] = t13;
|
|
210
|
-
$[32] = t14;
|
|
211
|
-
} else t14 = $[32];
|
|
212
|
-
const t15 = classes?.track;
|
|
213
|
-
let t16;
|
|
214
|
-
if ($[33] !== t15) {
|
|
215
|
-
t16 = cx("tao-slider-track-slot", t15);
|
|
216
|
-
$[33] = t15;
|
|
217
|
-
$[34] = t16;
|
|
218
|
-
} else t16 = $[34];
|
|
219
|
-
const t17 = classes?.rail;
|
|
220
|
-
let t18;
|
|
221
|
-
if ($[35] !== t17) {
|
|
222
|
-
t18 = cx("tao-slider-rail-slot", t17);
|
|
223
|
-
$[35] = t17;
|
|
224
|
-
$[36] = t18;
|
|
225
|
-
} else t18 = $[36];
|
|
226
|
-
const t19 = classes?.handle;
|
|
227
|
-
let t20;
|
|
228
|
-
if ($[37] !== t19) {
|
|
229
|
-
t20 = cx("tao-slider-handle-slot", t19);
|
|
230
|
-
$[37] = t19;
|
|
231
|
-
$[38] = t20;
|
|
232
|
-
} else t20 = $[38];
|
|
233
|
-
let t21;
|
|
234
|
-
if ($[39] !== t14 || $[40] !== t16 || $[41] !== t18 || $[42] !== t20) {
|
|
235
|
-
t21 = {
|
|
236
|
-
tracks: t14,
|
|
237
|
-
track: t16,
|
|
238
|
-
rail: t18,
|
|
239
|
-
handle: t20
|
|
240
|
-
};
|
|
241
|
-
$[39] = t14;
|
|
242
|
-
$[40] = t16;
|
|
243
|
-
$[41] = t18;
|
|
244
|
-
$[42] = t20;
|
|
245
|
-
$[43] = t21;
|
|
246
|
-
} else t21 = $[43];
|
|
247
|
-
let t22;
|
|
248
|
-
if ($[44] !== direction || $[45] !== handleRender || $[46] !== resolvedDisabled || $[47] !== resolvedVertical || $[48] !== tooltip) {
|
|
249
|
-
t22 = (node, info)=>/*#__PURE__*/ jsx(SliderTip, {
|
|
250
|
-
value: info.value,
|
|
251
|
-
dragging: info.dragging,
|
|
252
|
-
disabled: Array.isArray(resolvedDisabled) ? !!resolvedDisabled[info.index] : !!resolvedDisabled,
|
|
253
|
-
vertical: resolvedVertical,
|
|
254
|
-
direction: direction,
|
|
255
|
-
options: tooltip,
|
|
256
|
-
children: handleRender ? handleRender(node, info) : node
|
|
257
|
-
}, info.index);
|
|
258
|
-
$[44] = direction;
|
|
259
|
-
$[45] = handleRender;
|
|
260
|
-
$[46] = resolvedDisabled;
|
|
261
|
-
$[47] = resolvedVertical;
|
|
262
|
-
$[48] = tooltip;
|
|
263
|
-
$[49] = t22;
|
|
264
|
-
} else t22 = $[49];
|
|
265
|
-
let t23;
|
|
266
|
-
if ($[50] !== prefixCls || $[51] !== ref || $[52] !== resolvedDisabled || $[53] !== resolvedVertical || $[54] !== semanticStyles || $[55] !== t10 || $[56] !== t12 || $[57] !== t21 || $[58] !== t22 || $[59] !== t7 || $[60] !== t8) {
|
|
267
|
-
t23 = /*#__PURE__*/ jsx(RcSliderComponent, {
|
|
268
|
-
...t7,
|
|
112
|
+
const editableRange = 'object' == typeof props.range && props.range.editable;
|
|
113
|
+
const deletion = useRef(null);
|
|
114
|
+
const engineProps = rest;
|
|
115
|
+
const onChange = withValueSnapshot(engineProps.onChange);
|
|
116
|
+
const onAfterChange = withValueSnapshot(engineProps.onAfterChange);
|
|
117
|
+
const onChangeComplete = withValueSnapshot(engineProps.onChangeComplete);
|
|
118
|
+
return /*#__PURE__*/ jsx("div", {
|
|
119
|
+
ref: directionRef,
|
|
120
|
+
"data-tao-slider": "",
|
|
121
|
+
"data-tao-vertical": resolvedVertical ? '' : void 0,
|
|
122
|
+
"data-tao-disabled": allDisabled ? '' : void 0,
|
|
123
|
+
dir: direction,
|
|
124
|
+
children: /*#__PURE__*/ jsx(RcSliderComponent, {
|
|
125
|
+
...engineProps,
|
|
269
126
|
ref: ref,
|
|
270
127
|
prefixCls: prefixCls,
|
|
271
128
|
disabled: resolvedDisabled,
|
|
129
|
+
keyboard: keyboard,
|
|
130
|
+
onBeforeChange: withValueSnapshot(engineProps.onBeforeChange),
|
|
131
|
+
onChange: editableRange ? (value)=>{
|
|
132
|
+
if (deletion.current && Array.isArray(value)) deletion.current.value = value;
|
|
133
|
+
onChange?.(value);
|
|
134
|
+
} : onChange,
|
|
135
|
+
onAfterChange: onAfterChange,
|
|
136
|
+
onChangeComplete: onChangeComplete,
|
|
272
137
|
vertical: resolvedVertical,
|
|
273
|
-
reverse:
|
|
274
|
-
className:
|
|
275
|
-
style:
|
|
276
|
-
|
|
138
|
+
reverse: 'rtl' !== direction || resolvedVertical ? reverse : !reverse,
|
|
139
|
+
className: cx(classes?.root, rootClassName, className),
|
|
140
|
+
style: {
|
|
141
|
+
...semanticStyles?.root,
|
|
142
|
+
...style
|
|
143
|
+
},
|
|
144
|
+
classNames: {
|
|
145
|
+
tracks: cx('tao-slider-tracks-slot', classes?.tracks),
|
|
146
|
+
track: cx('tao-slider-track-slot', classes?.track),
|
|
147
|
+
rail: cx('tao-slider-rail-slot', classes?.rail),
|
|
148
|
+
handle: cx('tao-slider-handle-slot', classes?.handle)
|
|
149
|
+
},
|
|
277
150
|
styles: semanticStyles,
|
|
278
|
-
handleRender:
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
151
|
+
handleRender: (node, info)=>{
|
|
152
|
+
const handleDisabled = Array.isArray(resolvedDisabled) ? !!resolvedDisabled[info.index] : !!resolvedDisabled;
|
|
153
|
+
let handle = node;
|
|
154
|
+
if (handleDisabled || false === keyboard) handle = /*#__PURE__*/ cloneElement(node, {
|
|
155
|
+
onKeyUp: void 0
|
|
156
|
+
});
|
|
157
|
+
else if (editableRange) handle = /*#__PURE__*/ cloneElement(node, {
|
|
158
|
+
onKeyDown: (event)=>{
|
|
159
|
+
const keyCode = event.which || event.keyCode;
|
|
160
|
+
if (8 !== keyCode && 46 !== keyCode) return void node.props.onKeyDown?.(event);
|
|
161
|
+
const change = {};
|
|
162
|
+
deletion.current = change;
|
|
163
|
+
try {
|
|
164
|
+
node.props.onKeyDown?.(event);
|
|
165
|
+
} finally{
|
|
166
|
+
deletion.current = null;
|
|
167
|
+
}
|
|
168
|
+
if (change.value) {
|
|
169
|
+
onAfterChange?.(change.value);
|
|
170
|
+
onChangeComplete?.(change.value);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
return /*#__PURE__*/ jsx(SliderTip, {
|
|
175
|
+
value: info.value,
|
|
176
|
+
dragging: info.dragging,
|
|
177
|
+
disabled: handleDisabled,
|
|
178
|
+
vertical: resolvedVertical,
|
|
179
|
+
direction: direction,
|
|
180
|
+
options: tooltip,
|
|
181
|
+
children: handleRender ? handleRender(handle, info) : handle
|
|
182
|
+
}, info.index);
|
|
183
|
+
}
|
|
184
|
+
})
|
|
185
|
+
});
|
|
311
186
|
});
|
|
312
187
|
Slider.displayName = 'Slider';
|
|
313
188
|
export { Slider };
|