@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.
Files changed (152) hide show
  1. package/README.md +9 -1
  2. package/component-manifest.json +38 -4
  3. package/dist/components/alert/alert.js +20 -17
  4. package/dist/components/auto-complete/auto-complete.js +12 -3
  5. package/dist/components/avatar/avatar.js +2 -1
  6. package/dist/components/breadcrumb/breadcrumb.css +4 -0
  7. package/dist/components/breadcrumb/breadcrumb.js +82 -77
  8. package/dist/components/calendar/calendar.d.ts +1 -1
  9. package/dist/components/calendar/calendar.js +51 -33
  10. package/dist/components/card/card-tabs.js +204 -182
  11. package/dist/components/card/card.js +1 -1
  12. package/dist/components/carousel/carousel.js +11 -5
  13. package/dist/components/cascader/cascader.js +16 -4
  14. package/dist/components/collapse/collapse.css +8 -0
  15. package/dist/components/color-picker/color-picker.js +273 -269
  16. package/dist/components/context-menu/context-menu.d.ts +2 -1
  17. package/dist/components/context-menu/context-menu.js +57 -44
  18. package/dist/components/date-picker/calendar/calendar-grid.js +13 -6
  19. package/dist/components/date-picker/calendar/use-calendar.d.ts +2 -2
  20. package/dist/components/date-picker/calendar/use-calendar.js +2 -3
  21. package/dist/components/date-picker/date-localization.d.ts +3 -0
  22. package/dist/components/date-picker/date-localization.js +76 -0
  23. package/dist/components/date-picker/date-picker.css +4 -0
  24. package/dist/components/date-picker/date-picker.d.ts +1 -0
  25. package/dist/components/date-picker/date-picker.js +48 -30
  26. package/dist/components/date-picker/range-picker.d.ts +1 -0
  27. package/dist/components/date-picker/range-picker.js +41 -23
  28. package/dist/components/drawer/drawer.d.ts +2 -1
  29. package/dist/components/drawer/drawer.js +32 -20
  30. package/dist/components/dropdown/dropdown.d.ts +1 -0
  31. package/dist/components/dropdown/dropdown.js +160 -143
  32. package/dist/components/float-button/float-button.js +3 -2
  33. package/dist/components/form/form.js +88 -103
  34. package/dist/components/image/image.js +202 -137
  35. package/dist/components/list/list-pagination.js +148 -147
  36. package/dist/components/mentions/mentions.js +6 -2
  37. package/dist/components/modal/confirm-dialog.js +4 -2
  38. package/dist/components/modal/modal.d.ts +2 -1
  39. package/dist/components/modal/modal.js +387 -375
  40. package/dist/components/pagination/pagination.css +4 -0
  41. package/dist/components/pagination/pagination.js +115 -110
  42. package/dist/components/popconfirm/popconfirm.js +109 -107
  43. package/dist/components/popover/popover.d.ts +2 -1
  44. package/dist/components/popover/popover.js +185 -176
  45. package/dist/components/qr-code/qr-code.js +22 -21
  46. package/dist/components/rate/rate.js +114 -88
  47. package/dist/components/scroll-area/scroll-area.js +132 -120
  48. package/dist/components/segmented/segmented.js +52 -29
  49. package/dist/components/select/mobile-select.d.ts +3 -2
  50. package/dist/components/select/mobile-select.js +54 -48
  51. package/dist/components/select/select-types.d.ts +1 -0
  52. package/dist/components/select/select.js +19 -6
  53. package/dist/components/slider/slider.js +136 -133
  54. package/dist/components/sonner/sonner.js +10 -10
  55. package/dist/components/spinner/spinner.js +1 -1
  56. package/dist/components/splitter/splitter.css +4 -0
  57. package/dist/components/splitter/splitter.js +29 -24
  58. package/dist/components/statistic/statistic.d.ts +2 -0
  59. package/dist/components/statistic/statistic.js +203 -187
  60. package/dist/components/table/table-filter.js +61 -52
  61. package/dist/components/table/table-icons.js +3 -1
  62. package/dist/components/table/table.css +29 -11
  63. package/dist/components/table/table.d.ts +1 -1
  64. package/dist/components/table/table.js +384 -547
  65. package/dist/components/tabs/tabs.js +3 -2
  66. package/dist/components/tag/tag.js +22 -19
  67. package/dist/components/time-picker/time-picker.d.ts +0 -1
  68. package/dist/components/time-picker/time-picker.js +160 -103
  69. package/dist/components/tooltip/tooltip.d.ts +2 -1
  70. package/dist/components/tooltip/tooltip.js +82 -71
  71. package/dist/components/transfer/transfer-list.js +224 -488
  72. package/dist/components/transfer/transfer-parts.js +14 -4
  73. package/dist/components/transfer/transfer-types.d.ts +1 -0
  74. package/dist/components/transfer/transfer.js +23 -20
  75. package/dist/components/tree/tree-keyboard.d.ts +6 -0
  76. package/dist/components/tree/tree-keyboard.js +27 -0
  77. package/dist/components/tree/tree.js +14 -3
  78. package/dist/components/tree-select/select-engine.d.ts +2 -1
  79. package/dist/components/tree-select/select-engine.js +23 -15
  80. package/dist/components/tree-select/tree-select.js +20 -10
  81. package/dist/components/upload/upload.js +30 -26
  82. package/dist/docs/component-docs.d.ts +13 -2
  83. package/dist/docs/components/headless-input-number.doc.d.ts +5 -0
  84. package/dist/docs/components/headless-input-number.doc.js +7 -0
  85. package/dist/docs/components/input-number.doc.d.ts +5 -0
  86. package/dist/docs/components/input-number.doc.js +7 -0
  87. package/dist/docs/components/statistic.doc.d.ts +5 -0
  88. package/dist/docs/components/statistic.doc.js +7 -0
  89. package/dist/docs/components/tao-provider.doc.d.ts +8 -2
  90. package/dist/docs/components/tao-provider.doc.js +16 -3
  91. package/dist/docs/components/tooltip.doc.d.ts +2 -2
  92. package/dist/entries/provider.d.ts +2 -1
  93. package/dist/entries/provider.js +1 -0
  94. package/dist/index.d.ts +2 -1
  95. package/dist/index.js +1 -0
  96. package/dist/locales/ar-EG.d.ts +3 -0
  97. package/dist/locales/ar-EG.js +199 -0
  98. package/dist/locales/create-locale.d.ts +41 -0
  99. package/dist/locales/create-locale.js +88 -0
  100. package/dist/locales/de-DE.d.ts +3 -0
  101. package/dist/locales/de-DE.js +195 -0
  102. package/dist/locales/en-US.d.ts +2 -0
  103. package/dist/locales/en-US.js +194 -0
  104. package/dist/locales/es-ES.d.ts +3 -0
  105. package/dist/locales/es-ES.js +195 -0
  106. package/dist/locales/fr-FR.d.ts +3 -0
  107. package/dist/locales/fr-FR.js +195 -0
  108. package/dist/locales/hi-IN.d.ts +3 -0
  109. package/dist/locales/hi-IN.js +194 -0
  110. package/dist/locales/id-ID.d.ts +3 -0
  111. package/dist/locales/id-ID.js +194 -0
  112. package/dist/locales/index.d.ts +18 -0
  113. package/dist/locales/index.js +17 -0
  114. package/dist/locales/it-IT.d.ts +3 -0
  115. package/dist/locales/it-IT.js +195 -0
  116. package/dist/locales/ja-JP.d.ts +3 -0
  117. package/dist/locales/ja-JP.js +194 -0
  118. package/dist/locales/ko-KR.d.ts +3 -0
  119. package/dist/locales/ko-KR.js +194 -0
  120. package/dist/locales/pt-BR.d.ts +3 -0
  121. package/dist/locales/pt-BR.js +195 -0
  122. package/dist/locales/ru-RU.d.ts +3 -0
  123. package/dist/locales/ru-RU.js +197 -0
  124. package/dist/locales/th-TH.d.ts +3 -0
  125. package/dist/locales/th-TH.js +194 -0
  126. package/dist/locales/tr-TR.d.ts +3 -0
  127. package/dist/locales/tr-TR.js +194 -0
  128. package/dist/locales/types.d.ts +176 -0
  129. package/dist/locales/types.js +0 -0
  130. package/dist/locales/vi-VN.d.ts +3 -0
  131. package/dist/locales/vi-VN.js +194 -0
  132. package/dist/locales/zh-CN.d.ts +3 -0
  133. package/dist/locales/zh-CN.js +194 -0
  134. package/dist/locales/zh-TW.d.ts +3 -0
  135. package/dist/locales/zh-TW.js +194 -0
  136. package/dist/number-input/format.d.ts +4 -3
  137. package/dist/number-input/format.js +9 -7
  138. package/dist/number-input/locale.d.ts +19 -0
  139. package/dist/number-input/locale.js +44 -0
  140. package/dist/number-input/number-input.js +1 -0
  141. package/dist/number-input/use-number-input.d.ts +2 -0
  142. package/dist/number-input/use-number-input.js +180 -176
  143. package/dist/provider/locale.d.ts +3 -65
  144. package/dist/provider/locale.js +2 -146
  145. package/dist/provider/merge-locale.d.ts +8 -0
  146. package/dist/provider/merge-locale.js +53 -0
  147. package/dist/provider/tao-provider.d.ts +16 -5
  148. package/dist/provider/tao-provider.js +200 -92
  149. package/dist/utils/scroll-left.d.ts +3 -0
  150. package/dist/utils/scroll-left.js +7 -0
  151. package/llms.txt +3 -3
  152. package/package.json +5 -1
@@ -2,15 +2,16 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { c } from "react-compiler-runtime";
3
3
  import { useCallback, useMemo, useRef } from "react";
4
4
  import { useTaoConfig } from "../../provider/tao-provider.js";
5
+ import { useMobileTitle } from "../../utils/field-label.js";
5
6
  import { Button } from "../button/button.js";
6
7
  import { Drawer } from "../drawer/drawer.js";
7
- import { useMobileTitle } from "../../utils/field-label.js";
8
8
  import { SearchIcon } from "./select-icons.js";
9
9
  import { countLeafOptions, defaultFilter, filterTree, flattenLeafOptions } from "./select-model.js";
10
10
  import { useSelectSelection } from "./use-select-selection.js";
11
11
  import "./mobile-select.css";
12
- function MobileSelectContentInner({ options, value, onChange, onMultiChange, showSearch, searchValue: search, onSearch, filterOption, notFoundContent = 'No results', optionRender, onClose, multiple, maxCount, mode, tokenSeparators, onSearchClear, disabled, classNames, styles }) {
12
+ function MobileSelectContentInner({ options, value, onChange, onMultiChange, showSearch, searchValue: search, onSearch, filterOption, notFoundContent: notFoundContentProp, optionRender, onClose, multiple, maxCount, mode, tokenSeparators, onSearchClear, disabled, classNames, styles }) {
13
13
  const { locale } = useTaoConfig();
14
+ const notFoundContent = void 0 === notFoundContentProp ? locale.noResults : notFoundContentProp;
14
15
  const valueArray = useMemo(()=>{
15
16
  if (multiple) return value ?? [];
16
17
  return value ? [
@@ -218,8 +219,9 @@ function MobileSelectContentInner({ options, value, onChange, onMultiChange, sho
218
219
  });
219
220
  }
220
221
  function MobileSelectDrawer(t0) {
221
- const $ = c(29);
222
+ const $ = c(31);
222
223
  let classNames;
224
+ let direction;
223
225
  let mobileTitle;
224
226
  let onClose;
225
227
  let open;
@@ -228,30 +230,32 @@ function MobileSelectDrawer(t0) {
228
230
  let rest;
229
231
  let styles;
230
232
  if ($[0] !== t0) {
231
- ({ open, mobileTitle, onClose, placeholder, classNames, styles, popupRender, ...rest } = t0);
233
+ ({ direction, open, mobileTitle, onClose, placeholder, classNames, styles, popupRender, ...rest } = t0);
232
234
  $[0] = t0;
233
235
  $[1] = classNames;
234
- $[2] = mobileTitle;
235
- $[3] = onClose;
236
- $[4] = open;
237
- $[5] = placeholder;
238
- $[6] = popupRender;
239
- $[7] = rest;
240
- $[8] = styles;
236
+ $[2] = direction;
237
+ $[3] = mobileTitle;
238
+ $[4] = onClose;
239
+ $[5] = open;
240
+ $[6] = placeholder;
241
+ $[7] = popupRender;
242
+ $[8] = rest;
243
+ $[9] = styles;
241
244
  } else {
242
245
  classNames = $[1];
243
- mobileTitle = $[2];
244
- onClose = $[3];
245
- open = $[4];
246
- placeholder = $[5];
247
- popupRender = $[6];
248
- rest = $[7];
249
- styles = $[8];
246
+ direction = $[2];
247
+ mobileTitle = $[3];
248
+ onClose = $[4];
249
+ open = $[5];
250
+ placeholder = $[6];
251
+ popupRender = $[7];
252
+ rest = $[8];
253
+ styles = $[9];
250
254
  }
251
255
  const { locale } = useTaoConfig();
252
256
  const title = useMobileTitle(mobileTitle, locale.select);
253
257
  let t1;
254
- if ($[9] !== classNames || $[10] !== onClose || $[11] !== placeholder || $[12] !== rest || $[13] !== styles) {
258
+ if ($[10] !== classNames || $[11] !== onClose || $[12] !== placeholder || $[13] !== rest || $[14] !== styles) {
255
259
  t1 = /*#__PURE__*/ jsx(MobileSelectContentInner, {
256
260
  onClose: onClose,
257
261
  placeholder: placeholder,
@@ -259,42 +263,43 @@ function MobileSelectDrawer(t0) {
259
263
  styles: styles,
260
264
  ...rest
261
265
  });
262
- $[9] = classNames;
263
- $[10] = onClose;
264
- $[11] = placeholder;
265
- $[12] = rest;
266
- $[13] = styles;
267
- $[14] = t1;
268
- } else t1 = $[14];
266
+ $[10] = classNames;
267
+ $[11] = onClose;
268
+ $[12] = placeholder;
269
+ $[13] = rest;
270
+ $[14] = styles;
271
+ $[15] = t1;
272
+ } else t1 = $[15];
269
273
  const content = t1;
270
274
  const t2 = classNames?.popup;
271
275
  let t3;
272
- if ($[15] !== t2) {
276
+ if ($[16] !== t2) {
273
277
  t3 = {
274
278
  root: t2
275
279
  };
276
- $[15] = t2;
277
- $[16] = t3;
278
- } else t3 = $[16];
280
+ $[16] = t2;
281
+ $[17] = t3;
282
+ } else t3 = $[17];
279
283
  const t4 = styles?.popup;
280
284
  let t5;
281
- if ($[17] !== t4) {
285
+ if ($[18] !== t4) {
282
286
  t5 = {
283
287
  root: t4
284
288
  };
285
- $[17] = t4;
286
- $[18] = t5;
287
- } else t5 = $[18];
289
+ $[18] = t4;
290
+ $[19] = t5;
291
+ } else t5 = $[19];
288
292
  let t6;
289
- if ($[19] !== content || $[20] !== popupRender) {
293
+ if ($[20] !== content || $[21] !== popupRender) {
290
294
  t6 = popupRender ? popupRender(content) : content;
291
- $[19] = content;
292
- $[20] = popupRender;
293
- $[21] = t6;
294
- } else t6 = $[21];
295
+ $[20] = content;
296
+ $[21] = popupRender;
297
+ $[22] = t6;
298
+ } else t6 = $[22];
295
299
  let t7;
296
- if ($[22] !== onClose || $[23] !== open || $[24] !== t3 || $[25] !== t5 || $[26] !== t6 || $[27] !== title) {
300
+ if ($[23] !== direction || $[24] !== onClose || $[25] !== open || $[26] !== t3 || $[27] !== t5 || $[28] !== t6 || $[29] !== title) {
297
301
  t7 = /*#__PURE__*/ jsx(Drawer, {
302
+ direction: direction,
298
303
  open: open,
299
304
  onClose: onClose,
300
305
  placement: "bottom",
@@ -304,14 +309,15 @@ function MobileSelectDrawer(t0) {
304
309
  styles: t5,
305
310
  children: t6
306
311
  });
307
- $[22] = onClose;
308
- $[23] = open;
309
- $[24] = t3;
310
- $[25] = t5;
311
- $[26] = t6;
312
- $[27] = title;
313
- $[28] = t7;
314
- } else t7 = $[28];
312
+ $[23] = direction;
313
+ $[24] = onClose;
314
+ $[25] = open;
315
+ $[26] = t3;
316
+ $[27] = t5;
317
+ $[28] = t6;
318
+ $[29] = title;
319
+ $[30] = t7;
320
+ } else t7 = $[30];
315
321
  return t7;
316
322
  }
317
323
  function CheckIcon() {
@@ -24,6 +24,7 @@ export interface SelectRef {
24
24
  nativeElement: HTMLElement | null;
25
25
  }
26
26
  export interface SelectProps extends Pick<AriaAttributes, 'aria-label' | 'aria-labelledby' | 'aria-describedby' | 'aria-errormessage' | 'aria-invalid' | 'aria-required'> {
27
+ direction?: 'ltr' | 'rtl';
27
28
  /** Available options; nested options form groups. */
28
29
  options: SelectOption[];
29
30
  /** Controlled selection. Use an array for multiple or tags mode. */
@@ -1,6 +1,7 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { forwardRef, useCallback, useId, useImperativeHandle, useMemo, useRef, useState } from "react";
3
- import { TaoPortalScope, useTaoConfig } from "../../provider/tao-provider.js";
3
+ import { TaoPortalScope, useTaoConfig, useTaoDirection } from "../../provider/tao-provider.js";
4
+ import { mergeRefs } from "../../utils/refs.js";
4
5
  import { cx } from "../../utils/semantic.js";
5
6
  import { MobileSelectDrawer } from "./mobile-select.js";
6
7
  import { CheckIcon, ChevronDownIcon, CloseIcon, LoadingIcon, SearchIcon } from "./select-icons.js";
@@ -31,7 +32,7 @@ const PLACEMENT_MAP = {
31
32
  }
32
33
  };
33
34
  const select_Select = /*#__PURE__*/ forwardRef(function(props, ref) {
34
- const { options, mode, placeholder, size, variant, disabled, status, showSearch, filterOption, searchValue: searchValueProp, onSearch, allowClear, loading, loadingIcon, notFoundContent: notFoundContentProp, prefix, suffixIcon, removeIcon, autoFocus, id, name, open: openProp, defaultOpen, onOpenChange, placement = 'bottomLeft', popupMatchSelectWidth = true, listHeight = 256, getPopupContainer, optionRender, labelRender, popupRender, tagRender, maxTagCount, maxTagPlaceholder, maxTagTextLength, maxCount, autoClearSearchValue = true, tokenSeparators, hideSelected, mobile, className, style, classNames, styles } = props;
35
+ const { options, mode, placeholder, size, variant, disabled, status, showSearch, filterOption, searchValue: searchValueProp, onSearch, allowClear, loading, loadingIcon, notFoundContent: notFoundContentProp, prefix, suffixIcon, removeIcon, autoFocus, id, name, open: openProp, defaultOpen, onOpenChange, placement, popupMatchSelectWidth = true, listHeight = 256, getPopupContainer, optionRender, labelRender, popupRender, tagRender, maxTagCount, maxTagPlaceholder, maxTagTextLength, maxCount, autoClearSearchValue = true, tokenSeparators, hideSelected, mobile, className, style, classNames, styles } = props;
35
36
  const ctx = useTaoConfig();
36
37
  const notFoundContent = void 0 === notFoundContentProp ? ctx.locale.noResults : notFoundContentProp;
37
38
  const resolvedSize = size ?? ctx.size;
@@ -46,6 +47,10 @@ const select_Select = /*#__PURE__*/ forwardRef(function(props, ref) {
46
47
  if ((!requestedOpen || void 0 === mobilePresentation) && mobilePresentation !== requestedMobile) setMobilePresentation(requestedMobile);
47
48
  const isMobile = (requestedOpen ? mobilePresentation : requestedMobile) ?? false;
48
49
  const triggerRef = useRef(null);
50
+ const [direction, directionRef] = useTaoDirection(props.direction);
51
+ const mergedTriggerRef = useMemo(()=>mergeRefs(triggerRef, directionRef), [
52
+ directionRef
53
+ ]);
49
54
  const inputRef = useRef(null);
50
55
  const searchListboxId = useId();
51
56
  const isMultiple = 'multiple' === mode || 'tags' === mode;
@@ -284,9 +289,10 @@ const select_Select = /*#__PURE__*/ forwardRef(function(props, ref) {
284
289
  if (isMobile) return /*#__PURE__*/ jsxs(Fragment, {
285
290
  children: [
286
291
  /*#__PURE__*/ jsxs("div", {
287
- ref: triggerRef,
292
+ ref: mergedTriggerRef,
288
293
  id: id,
289
294
  "data-tao-control": "",
295
+ dir: direction,
290
296
  "data-tao-select": "",
291
297
  "data-tao-multiple": isMultiple || void 0,
292
298
  "data-tao-size": resolvedSize,
@@ -352,6 +358,7 @@ const select_Select = /*#__PURE__*/ forwardRef(function(props, ref) {
352
358
  ]
353
359
  }),
354
360
  /*#__PURE__*/ jsx(MobileSelectDrawer, {
361
+ direction: direction,
355
362
  mobileTitle: props.mobileTitle,
356
363
  classNames: classNames,
357
364
  styles: styles,
@@ -380,7 +387,8 @@ const select_Select = /*#__PURE__*/ forwardRef(function(props, ref) {
380
387
  })
381
388
  ]
382
389
  });
383
- const { side, align } = PLACEMENT_MAP[placement];
390
+ const { side, align: physicalAlign } = PLACEMENT_MAP[placement ?? ('rtl' === direction ? 'bottomRight' : 'bottomLeft')];
391
+ const align = 'rtl' === direction ? 'start' === physicalAlign ? 'end' : 'start' : physicalAlign;
384
392
  const contentStyle = {
385
393
  ...styles?.popup
386
394
  };
@@ -579,9 +587,10 @@ const select_Select = /*#__PURE__*/ forwardRef(function(props, ref) {
579
587
  /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_c8444160.Trigger, {
580
588
  asChild: true,
581
589
  children: /*#__PURE__*/ jsxs("div", {
582
- ref: triggerRef,
590
+ ref: mergedTriggerRef,
583
591
  role: "presentation",
584
592
  "data-tao-control": "",
593
+ dir: direction,
585
594
  "data-tao-select": "",
586
595
  "data-tao-inline-search": "",
587
596
  "data-tao-multiple": isMultiple || void 0,
@@ -647,6 +656,7 @@ const select_Select = /*#__PURE__*/ forwardRef(function(props, ref) {
647
656
  container: container,
648
657
  children: /*#__PURE__*/ jsx(TaoPortalScope, {
649
658
  asChild: true,
659
+ direction: direction,
650
660
  children: /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_c8444160.Content, {
651
661
  "data-tao-select-content": "",
652
662
  "data-tao-size": resolvedSize,
@@ -670,6 +680,7 @@ const select_Select = /*#__PURE__*/ forwardRef(function(props, ref) {
670
680
  });
671
681
  }
672
682
  return /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_select_4606f4d3.Root, {
683
+ dir: direction,
673
684
  value: radixValue,
674
685
  onValueChange: handleValueChange,
675
686
  disabled: resolvedDisabled,
@@ -680,11 +691,12 @@ const select_Select = /*#__PURE__*/ forwardRef(function(props, ref) {
680
691
  /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_select_4606f4d3.Trigger, {
681
692
  asChild: true,
682
693
  children: /*#__PURE__*/ jsxs("div", {
683
- ref: triggerRef,
694
+ ref: mergedTriggerRef,
684
695
  tabIndex: resolvedDisabled ? -1 : 0,
685
696
  id: id,
686
697
  ...ariaProps,
687
698
  "data-tao-control": "",
699
+ dir: direction,
688
700
  "data-tao-select": "",
689
701
  "data-tao-size": resolvedSize,
690
702
  "data-tao-variant": resolvedVariant,
@@ -741,6 +753,7 @@ const select_Select = /*#__PURE__*/ forwardRef(function(props, ref) {
741
753
  container: container,
742
754
  children: /*#__PURE__*/ jsx(TaoPortalScope, {
743
755
  asChild: true,
756
+ direction: direction,
744
757
  children: /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_select_4606f4d3.Content, {
745
758
  "data-tao-select-content": "",
746
759
  "data-tao-size": resolvedSize,
@@ -2,7 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { c } from "react-compiler-runtime";
3
3
  import slider from "@rc-component/slider";
4
4
  import { forwardRef, useEffect, useRef, useState } from "react";
5
- import { TaoPortalScope, useTaoConfig } from "../../provider/tao-provider.js";
5
+ import { TaoPortalScope, useTaoConfig, useTaoDirection } from "../../provider/tao-provider.js";
6
6
  import { cx } from "../../utils/semantic.js";
7
7
  import "../tooltip/tooltip.css";
8
8
  import "./slider.css";
@@ -50,6 +50,7 @@ function SliderTip({ children, value, dragging, disabled, vertical, direction, o
50
50
  /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_tooltip_b301f25d.Portal, {
51
51
  container: trigger && getPopupContainer ? getPopupContainer(trigger) : void 0,
52
52
  children: /*#__PURE__*/ jsx(TaoPortalScope, {
53
+ direction: direction,
53
54
  children: /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_tooltip_b301f25d.Content, {
54
55
  "data-tao-tooltip-content": "",
55
56
  side: side,
@@ -89,9 +90,10 @@ function SliderTip({ children, value, dragging, disabled, vertical, direction, o
89
90
  });
90
91
  }
91
92
  const Slider = /*#__PURE__*/ forwardRef((props, ref)=>{
92
- const $ = c(67);
93
+ const $ = c(68);
93
94
  let className;
94
95
  let classNames;
96
+ let directionProp;
95
97
  let disabled;
96
98
  let handleRender;
97
99
  let orientation;
@@ -103,55 +105,54 @@ const Slider = /*#__PURE__*/ forwardRef((props, ref)=>{
103
105
  let t0;
104
106
  let t1;
105
107
  let t2;
106
- let t3;
107
108
  if ($[0] !== props) {
108
- ({ prefixCls: t0, classNames, styles, rootClassName, className, style, orientation, vertical: t1, direction: t2, disabled, tooltip: t3, handleRender, reverse, ...rest } = props);
109
+ ({ prefixCls: t0, classNames, styles, rootClassName, className, style, orientation, vertical: t1, direction: directionProp, disabled, tooltip: t2, handleRender, reverse, ...rest } = props);
109
110
  $[0] = props;
110
111
  $[1] = className;
111
112
  $[2] = classNames;
112
- $[3] = disabled;
113
- $[4] = handleRender;
114
- $[5] = orientation;
115
- $[6] = rest;
116
- $[7] = reverse;
117
- $[8] = rootClassName;
118
- $[9] = style;
119
- $[10] = styles;
120
- $[11] = t0;
121
- $[12] = t1;
122
- $[13] = t2;
123
- $[14] = t3;
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;
124
125
  } else {
125
126
  className = $[1];
126
127
  classNames = $[2];
127
- disabled = $[3];
128
- handleRender = $[4];
129
- orientation = $[5];
130
- rest = $[6];
131
- reverse = $[7];
132
- rootClassName = $[8];
133
- style = $[9];
134
- styles = $[10];
135
- t0 = $[11];
136
- t1 = $[12];
137
- t2 = $[13];
138
- t3 = $[14];
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];
139
140
  }
140
141
  const prefixCls = void 0 === t0 ? "tao-slider" : t0;
141
142
  const vertical = void 0 === t1 ? false : t1;
142
- const direction = void 0 === t2 ? "ltr" : t2;
143
- let t4;
144
- if ($[15] !== t3) {
145
- t4 = void 0 === t3 ? {} : t3;
146
- $[15] = t3;
147
- $[16] = t4;
148
- } else t4 = $[16];
149
- const tooltip = t4;
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;
150
+ const [direction, directionRef] = useTaoDirection(directionProp);
150
151
  const config = useTaoConfig();
151
152
  const resolvedDisabled = disabled ?? config.disabled;
152
153
  const resolvedVertical = orientation ? "vertical" === orientation : vertical;
153
154
  let classes;
154
- let t5;
155
+ let t4;
155
156
  if ($[17] !== classNames || $[18] !== props || $[19] !== resolvedDisabled || $[20] !== resolvedVertical || $[21] !== styles) {
156
157
  const mergedProps = {
157
158
  ...props,
@@ -161,7 +162,7 @@ const Slider = /*#__PURE__*/ forwardRef((props, ref)=>{
161
162
  classes = "function" == typeof classNames ? classNames({
162
163
  props: mergedProps
163
164
  }) : classNames;
164
- t5 = "function" == typeof styles ? styles({
165
+ t4 = "function" == typeof styles ? styles({
165
166
  props: mergedProps
166
167
  }) : styles;
167
168
  $[17] = classNames;
@@ -170,82 +171,82 @@ const Slider = /*#__PURE__*/ forwardRef((props, ref)=>{
170
171
  $[20] = resolvedVertical;
171
172
  $[21] = styles;
172
173
  $[22] = classes;
173
- $[23] = t5;
174
+ $[23] = t4;
174
175
  } else {
175
176
  classes = $[22];
176
- t5 = $[23];
177
+ t4 = $[23];
177
178
  }
178
- const semanticStyles = t5;
179
+ const semanticStyles = t4;
179
180
  const allDisabled = Array.isArray(resolvedDisabled) ? resolvedDisabled.every(Boolean) : resolvedDisabled;
180
- const t6 = resolvedVertical ? "" : void 0;
181
- const t7 = allDisabled ? "" : void 0;
182
- const t8 = rest;
183
- const t9 = "rtl" !== direction || resolvedVertical ? reverse : !reverse;
184
- const t10 = classes?.root;
185
- let t11;
186
- if ($[24] !== className || $[25] !== rootClassName || $[26] !== t10) {
187
- t11 = cx(t10, rootClassName, className);
181
+ const t5 = resolvedVertical ? "" : void 0;
182
+ const t6 = allDisabled ? "" : void 0;
183
+ const t7 = rest;
184
+ const t8 = "rtl" !== direction || resolvedVertical ? reverse : !reverse;
185
+ const t9 = classes?.root;
186
+ let t10;
187
+ if ($[24] !== className || $[25] !== rootClassName || $[26] !== t9) {
188
+ t10 = cx(t9, rootClassName, className);
188
189
  $[24] = className;
189
190
  $[25] = rootClassName;
190
- $[26] = t10;
191
- $[27] = t11;
192
- } else t11 = $[27];
193
- const t12 = semanticStyles?.root;
194
- let t13;
195
- if ($[28] !== style || $[29] !== t12) {
196
- t13 = {
197
- ...t12,
191
+ $[26] = t9;
192
+ $[27] = t10;
193
+ } else t10 = $[27];
194
+ const t11 = semanticStyles?.root;
195
+ let t12;
196
+ if ($[28] !== style || $[29] !== t11) {
197
+ t12 = {
198
+ ...t11,
198
199
  ...style
199
200
  };
200
201
  $[28] = style;
201
- $[29] = t12;
202
- $[30] = t13;
203
- } else t13 = $[30];
204
- const t14 = classes?.tracks;
205
- let t15;
206
- if ($[31] !== t14) {
207
- t15 = cx("tao-slider-tracks-slot", t14);
208
- $[31] = t14;
209
- $[32] = t15;
210
- } else t15 = $[32];
211
- const t16 = classes?.track;
212
- let t17;
213
- if ($[33] !== t16) {
214
- t17 = cx("tao-slider-track-slot", t16);
215
- $[33] = t16;
216
- $[34] = t17;
217
- } else t17 = $[34];
218
- const t18 = classes?.rail;
219
- let t19;
220
- if ($[35] !== t18) {
221
- t19 = cx("tao-slider-rail-slot", t18);
222
- $[35] = t18;
223
- $[36] = t19;
224
- } else t19 = $[36];
225
- const t20 = classes?.handle;
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];
226
233
  let t21;
227
- if ($[37] !== t20) {
228
- t21 = cx("tao-slider-handle-slot", t20);
229
- $[37] = t20;
230
- $[38] = t21;
231
- } else t21 = $[38];
232
- let t22;
233
- if ($[39] !== t15 || $[40] !== t17 || $[41] !== t19 || $[42] !== t21) {
234
- t22 = {
235
- tracks: t15,
236
- track: t17,
237
- rail: t19,
238
- handle: 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
239
240
  };
240
- $[39] = t15;
241
- $[40] = t17;
242
- $[41] = t19;
243
- $[42] = t21;
244
- $[43] = t22;
245
- } else t22 = $[43];
246
- let t23;
241
+ $[39] = t14;
242
+ $[40] = t16;
243
+ $[41] = t18;
244
+ $[42] = t20;
245
+ $[43] = t21;
246
+ } else t21 = $[43];
247
+ let t22;
247
248
  if ($[44] !== direction || $[45] !== handleRender || $[46] !== resolvedDisabled || $[47] !== resolvedVertical || $[48] !== tooltip) {
248
- t23 = (node, info)=>/*#__PURE__*/ jsx(SliderTip, {
249
+ t22 = (node, info)=>/*#__PURE__*/ jsx(SliderTip, {
249
250
  value: info.value,
250
251
  dragging: info.dragging,
251
252
  disabled: Array.isArray(resolvedDisabled) ? !!resolvedDisabled[info.index] : !!resolvedDisabled,
@@ -259,52 +260,54 @@ const Slider = /*#__PURE__*/ forwardRef((props, ref)=>{
259
260
  $[46] = resolvedDisabled;
260
261
  $[47] = resolvedVertical;
261
262
  $[48] = tooltip;
262
- $[49] = t23;
263
- } else t23 = $[49];
264
- let t24;
265
- if ($[50] !== prefixCls || $[51] !== ref || $[52] !== resolvedDisabled || $[53] !== resolvedVertical || $[54] !== semanticStyles || $[55] !== t11 || $[56] !== t13 || $[57] !== t22 || $[58] !== t23 || $[59] !== t8 || $[60] !== t9) {
266
- t24 = /*#__PURE__*/ jsx(RcSliderComponent, {
267
- ...t8,
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,
268
269
  ref: ref,
269
270
  prefixCls: prefixCls,
270
271
  disabled: resolvedDisabled,
271
272
  vertical: resolvedVertical,
272
- reverse: t9,
273
- className: t11,
274
- style: t13,
275
- classNames: t22,
273
+ reverse: t8,
274
+ className: t10,
275
+ style: t12,
276
+ classNames: t21,
276
277
  styles: semanticStyles,
277
- handleRender: t23
278
+ handleRender: t22
278
279
  });
279
280
  $[50] = prefixCls;
280
281
  $[51] = ref;
281
282
  $[52] = resolvedDisabled;
282
283
  $[53] = resolvedVertical;
283
284
  $[54] = semanticStyles;
284
- $[55] = t11;
285
- $[56] = t13;
286
- $[57] = t22;
287
- $[58] = t23;
288
- $[59] = t8;
289
- $[60] = t9;
290
- $[61] = t24;
291
- } else t24 = $[61];
292
- let t25;
293
- if ($[62] !== direction || $[63] !== t24 || $[64] !== t6 || $[65] !== t7) {
294
- t25 = /*#__PURE__*/ jsx("div", {
285
+ $[55] = t10;
286
+ $[56] = t12;
287
+ $[57] = t21;
288
+ $[58] = t22;
289
+ $[59] = t7;
290
+ $[60] = t8;
291
+ $[61] = t23;
292
+ } else t23 = $[61];
293
+ let t24;
294
+ if ($[62] !== direction || $[63] !== directionRef || $[64] !== t23 || $[65] !== t5 || $[66] !== t6) {
295
+ t24 = /*#__PURE__*/ jsx("div", {
296
+ ref: directionRef,
295
297
  "data-tao-slider": "",
296
- "data-tao-vertical": t6,
297
- "data-tao-disabled": t7,
298
+ "data-tao-vertical": t5,
299
+ "data-tao-disabled": t6,
298
300
  dir: direction,
299
- children: t24
301
+ children: t23
300
302
  });
301
303
  $[62] = direction;
302
- $[63] = t24;
303
- $[64] = t6;
304
- $[65] = t7;
305
- $[66] = t25;
306
- } else t25 = $[66];
307
- return t25;
304
+ $[63] = directionRef;
305
+ $[64] = t23;
306
+ $[65] = t5;
307
+ $[66] = t6;
308
+ $[67] = t24;
309
+ } else t24 = $[67];
310
+ return t24;
308
311
  });
309
312
  Slider.displayName = 'Slider';
310
313
  export { Slider };