@rockshin/tao-ui 0.0.43 → 0.0.45

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 (77) hide show
  1. package/README.md +7 -1
  2. package/component-manifest.json +10 -3
  3. package/dist/components/auto-complete/auto-complete.js +12 -3
  4. package/dist/components/breadcrumb/breadcrumb.css +4 -0
  5. package/dist/components/breadcrumb/breadcrumb.js +1 -0
  6. package/dist/components/calendar/calendar.d.ts +1 -0
  7. package/dist/components/calendar/calendar.js +10 -3
  8. package/dist/components/card/card-tabs.js +204 -182
  9. package/dist/components/card/card.js +1 -1
  10. package/dist/components/carousel/carousel.js +11 -5
  11. package/dist/components/cascader/cascader.js +16 -4
  12. package/dist/components/collapse/collapse.css +8 -0
  13. package/dist/components/context-menu/context-menu.d.ts +2 -1
  14. package/dist/components/context-menu/context-menu.js +57 -44
  15. package/dist/components/date-picker/calendar/calendar-grid.js +3 -2
  16. package/dist/components/date-picker/date-picker.css +4 -0
  17. package/dist/components/date-picker/date-picker.d.ts +1 -0
  18. package/dist/components/date-picker/date-picker.js +13 -3
  19. package/dist/components/date-picker/range-picker.d.ts +1 -0
  20. package/dist/components/date-picker/range-picker.js +13 -3
  21. package/dist/components/drawer/drawer.d.ts +2 -1
  22. package/dist/components/drawer/drawer.js +32 -20
  23. package/dist/components/dropdown/dropdown.d.ts +1 -0
  24. package/dist/components/dropdown/dropdown.js +139 -123
  25. package/dist/components/form/field-control.d.ts +6 -0
  26. package/dist/components/form/field-control.js +42 -0
  27. package/dist/components/form/form-context.d.ts +3 -0
  28. package/dist/components/form/form-item.d.ts +2 -1
  29. package/dist/components/form/form-item.js +55 -42
  30. package/dist/components/form/form.d.ts +5 -5
  31. package/dist/components/form/form.js +86 -68
  32. package/dist/components/form/index.d.ts +1 -0
  33. package/dist/components/form/use-form.d.ts +16 -0
  34. package/dist/components/form/use-form.js +69 -0
  35. package/dist/components/form-field/form-field-view.d.ts +4 -2
  36. package/dist/components/form-field/form-field-view.js +42 -35
  37. package/dist/components/mentions/mentions.js +6 -2
  38. package/dist/components/modal/modal.d.ts +2 -1
  39. package/dist/components/modal/modal.js +14 -4
  40. package/dist/components/pagination/pagination.css +4 -0
  41. package/dist/components/popover/popover.d.ts +2 -1
  42. package/dist/components/popover/popover.js +185 -176
  43. package/dist/components/rate/rate.js +114 -88
  44. package/dist/components/scroll-area/scroll-area.js +127 -118
  45. package/dist/components/segmented/segmented.js +52 -29
  46. package/dist/components/select/mobile-select.d.ts +2 -1
  47. package/dist/components/select/mobile-select.js +52 -47
  48. package/dist/components/select/select-types.d.ts +1 -0
  49. package/dist/components/select/select.js +19 -6
  50. package/dist/components/slider/slider.js +136 -133
  51. package/dist/components/splitter/splitter.css +4 -0
  52. package/dist/components/splitter/splitter.js +5 -3
  53. package/dist/components/table/table.css +29 -11
  54. package/dist/components/table/table.js +383 -547
  55. package/dist/components/tabs/tabs.js +3 -2
  56. package/dist/components/time-picker/time-picker.js +21 -7
  57. package/dist/components/tooltip/tooltip.d.ts +2 -1
  58. package/dist/components/tooltip/tooltip.js +82 -71
  59. package/dist/components/transfer/transfer-parts.js +12 -2
  60. package/dist/components/transfer/transfer.js +10 -4
  61. package/dist/components/tree/tree-keyboard.d.ts +6 -0
  62. package/dist/components/tree/tree-keyboard.js +27 -0
  63. package/dist/components/tree/tree.js +14 -3
  64. package/dist/components/tree-select/select-engine.d.ts +2 -1
  65. package/dist/components/tree-select/select-engine.js +23 -15
  66. package/dist/components/tree-select/tree-select.js +20 -10
  67. package/dist/docs/components/form.doc.js +3 -1
  68. package/dist/docs/components/tao-provider.doc.js +6 -1
  69. package/dist/entries/form.d.ts +2 -2
  70. package/dist/entries/provider.d.ts +1 -1
  71. package/dist/index.d.ts +3 -3
  72. package/dist/provider/tao-provider.d.ts +10 -3
  73. package/dist/provider/tao-provider.js +198 -88
  74. package/dist/utils/scroll-left.d.ts +3 -0
  75. package/dist/utils/scroll-left.js +7 -0
  76. package/llms.txt +3 -3
  77. package/package.json +4 -2
@@ -1,121 +1,139 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { c } from "react-compiler-runtime";
3
- import _rc_component_form, { FieldContext, FormProvider, List, useForm, useWatch } from "@rc-component/form";
3
+ import _rc_component_form, { FormProvider, List, useWatch } from "@rc-component/form";
4
4
  import { forwardRef, useContext } from "react";
5
5
  import { TaoProvider } from "../../provider/tao-provider.js";
6
6
  import { cx } from "../../utils/semantic.js";
7
7
  import { FormLayoutContext } from "./form-context.js";
8
8
  import { FormItem } from "./form-item.js";
9
+ import { getFieldRegistry, useForm } from "./use-form.js";
9
10
  import "./form.css";
10
11
  import { interopDefault } from "../../utils/interop-default.js";
11
12
  const RcFormComponent = /*#__PURE__*/ interopDefault(_rc_component_form);
12
13
  function FormInner(t0, ref) {
13
- const $ = c(31);
14
+ const $ = c(37);
14
15
  let children;
15
16
  let className;
16
17
  let classNames;
17
18
  let disabled;
19
+ let form;
18
20
  let rcProps;
19
21
  let size;
20
22
  let style;
21
23
  let styles;
22
24
  let t1;
23
25
  if ($[0] !== t0) {
24
- ({ layout: t1, size, disabled, children, className, style, classNames, styles, ...rcProps } = t0);
26
+ ({ layout: t1, size, disabled, children, className, style, classNames, styles, form, ...rcProps } = t0);
25
27
  $[0] = t0;
26
28
  $[1] = children;
27
29
  $[2] = className;
28
30
  $[3] = classNames;
29
31
  $[4] = disabled;
30
- $[5] = rcProps;
31
- $[6] = size;
32
- $[7] = style;
33
- $[8] = styles;
34
- $[9] = t1;
32
+ $[5] = form;
33
+ $[6] = rcProps;
34
+ $[7] = size;
35
+ $[8] = style;
36
+ $[9] = styles;
37
+ $[10] = t1;
35
38
  } else {
36
39
  children = $[1];
37
40
  className = $[2];
38
41
  classNames = $[3];
39
42
  disabled = $[4];
40
- rcProps = $[5];
41
- size = $[6];
42
- style = $[7];
43
- styles = $[8];
44
- t1 = $[9];
43
+ form = $[5];
44
+ rcProps = $[6];
45
+ size = $[7];
46
+ style = $[8];
47
+ styles = $[9];
48
+ t1 = $[10];
45
49
  }
46
50
  const layout = void 0 === t1 ? "vertical" : t1;
47
- let t2;
48
- if ($[10] !== layout) {
49
- t2 = {
50
- layout
51
- };
52
- $[10] = layout;
53
- $[11] = t2;
54
- } else t2 = $[11];
55
- const layoutValue = t2;
56
- const t3 = classNames?.root;
51
+ const [instance] = useForm(form);
52
+ const t2 = instance;
53
+ let t3;
54
+ if ($[11] !== instance) {
55
+ t3 = getFieldRegistry(instance);
56
+ $[11] = instance;
57
+ $[12] = t3;
58
+ } else t3 = $[12];
57
59
  let t4;
58
- if ($[12] !== className || $[13] !== t3) {
59
- t4 = cx(t3, className);
60
- $[12] = className;
61
- $[13] = t3;
62
- $[14] = t4;
63
- } else t4 = $[14];
64
- const t5 = styles?.root;
60
+ if ($[13] !== layout || $[14] !== t2 || $[15] !== t3) {
61
+ t4 = {
62
+ layout,
63
+ form: t2,
64
+ fields: t3
65
+ };
66
+ $[13] = layout;
67
+ $[14] = t2;
68
+ $[15] = t3;
69
+ $[16] = t4;
70
+ } else t4 = $[16];
71
+ const layoutValue = t4;
72
+ const t5 = classNames?.root;
65
73
  let t6;
66
- if ($[15] !== style || $[16] !== t5) {
67
- t6 = {
68
- ...t5,
74
+ if ($[17] !== className || $[18] !== t5) {
75
+ t6 = cx(t5, className);
76
+ $[17] = className;
77
+ $[18] = t5;
78
+ $[19] = t6;
79
+ } else t6 = $[19];
80
+ const t7 = styles?.root;
81
+ let t8;
82
+ if ($[20] !== style || $[21] !== t7) {
83
+ t8 = {
84
+ ...t7,
69
85
  ...style
70
86
  };
71
- $[15] = style;
72
- $[16] = t5;
73
- $[17] = t6;
74
- } else t6 = $[17];
75
- let t7;
76
- if ($[18] !== children || $[19] !== rcProps || $[20] !== ref || $[21] !== t4 || $[22] !== t6) {
77
- t7 = /*#__PURE__*/ jsx(RcFormComponent, {
87
+ $[20] = style;
88
+ $[21] = t7;
89
+ $[22] = t8;
90
+ } else t8 = $[22];
91
+ let t9;
92
+ if ($[23] !== children || $[24] !== instance || $[25] !== rcProps || $[26] !== ref || $[27] !== t6 || $[28] !== t8) {
93
+ t9 = /*#__PURE__*/ jsx(RcFormComponent, {
78
94
  "data-tao-form": "",
79
95
  ref: ref,
80
- className: t4,
81
- style: t6,
96
+ className: t6,
97
+ style: t8,
82
98
  ...rcProps,
99
+ form: instance,
83
100
  children: children
84
101
  });
85
- $[18] = children;
86
- $[19] = rcProps;
87
- $[20] = ref;
88
- $[21] = t4;
89
- $[22] = t6;
90
- $[23] = t7;
91
- } else t7 = $[23];
92
- let t8;
93
- if ($[24] !== disabled || $[25] !== size || $[26] !== t7) {
94
- t8 = /*#__PURE__*/ jsx(TaoProvider, {
102
+ $[23] = children;
103
+ $[24] = instance;
104
+ $[25] = rcProps;
105
+ $[26] = ref;
106
+ $[27] = t6;
107
+ $[28] = t8;
108
+ $[29] = t9;
109
+ } else t9 = $[29];
110
+ let t10;
111
+ if ($[30] !== disabled || $[31] !== size || $[32] !== t9) {
112
+ t10 = /*#__PURE__*/ jsx(TaoProvider, {
95
113
  size: size,
96
114
  disabled: disabled,
97
- children: t7
115
+ children: t9
98
116
  });
99
- $[24] = disabled;
100
- $[25] = size;
101
- $[26] = t7;
102
- $[27] = t8;
103
- } else t8 = $[27];
104
- let t9;
105
- if ($[28] !== layoutValue || $[29] !== t8) {
106
- t9 = /*#__PURE__*/ jsx(FormLayoutContext.Provider, {
117
+ $[30] = disabled;
118
+ $[31] = size;
119
+ $[32] = t9;
120
+ $[33] = t10;
121
+ } else t10 = $[33];
122
+ let t11;
123
+ if ($[34] !== layoutValue || $[35] !== t10) {
124
+ t11 = /*#__PURE__*/ jsx(FormLayoutContext.Provider, {
107
125
  value: layoutValue,
108
- children: t8
126
+ children: t10
109
127
  });
110
- $[28] = layoutValue;
111
- $[29] = t8;
112
- $[30] = t9;
113
- } else t9 = $[30];
114
- return t9;
128
+ $[34] = layoutValue;
129
+ $[35] = t10;
130
+ $[36] = t11;
131
+ } else t11 = $[36];
132
+ return t11;
115
133
  }
116
134
  const ForwardedForm = /*#__PURE__*/ forwardRef(FormInner);
117
135
  function useFormInstance() {
118
- return useContext(FieldContext);
136
+ return useContext(FormLayoutContext).form;
119
137
  }
120
138
  const Form = Object.assign(ForwardedForm, {
121
139
  Item: FormItem,
@@ -1,2 +1,3 @@
1
1
  export { Form, type FormProps, type FormSemanticPart } from './form.js';
2
+ export type { FormInstance, FormScrollOptions } from './use-form.js';
2
3
  export type { FormItemChildren, FormItemProps, FormItemSemanticPart, FormItemValidateStatus, } from './form-item.js';
@@ -0,0 +1,16 @@
1
+ import { type FormInstance as RcFormInstance, type NamePath } from '@rc-component/form';
2
+ import { type Options } from 'scroll-into-view-if-needed';
3
+ export type FormScrollOptions = Options & {
4
+ focus?: boolean;
5
+ };
6
+ export interface FormInstance<Values = any> extends RcFormInstance<Values> {
7
+ /** Scroll a mounted field into view; optionally focus its control. */
8
+ scrollToField: (name: NamePath<Values>, options?: FormScrollOptions) => void;
9
+ }
10
+ export interface FieldTarget {
11
+ id: string;
12
+ instance: unknown;
13
+ }
14
+ export declare function getFieldRegistry(form: object): Map<string, FieldTarget> | undefined;
15
+ export declare function fieldKey(name: unknown): string;
16
+ export declare function useForm<Values = any>(form?: FormInstance<Values>): [FormInstance<Values>];
@@ -0,0 +1,69 @@
1
+ import { c } from "react-compiler-runtime";
2
+ import { useForm } from "@rc-component/form";
3
+ import { getDOM } from "@rc-component/util/es/Dom/findDOMNode";
4
+ import scroll_into_view_if_needed from "scroll-into-view-if-needed";
5
+ const use_form_scroll = scroll_into_view_if_needed;
6
+ const fieldRegistries = new WeakMap();
7
+ function getFieldRegistry(form) {
8
+ return fieldRegistries.get(form);
9
+ }
10
+ function fieldKey(name) {
11
+ return JSON.stringify(Array.isArray(name) ? name : [
12
+ name
13
+ ]);
14
+ }
15
+ function use_form_useForm(form) {
16
+ const $ = c(4);
17
+ const [rcForm] = useForm(form);
18
+ let t0;
19
+ bb0: {
20
+ if (form) {
21
+ t0 = form;
22
+ break bb0;
23
+ }
24
+ let instance;
25
+ if ($[0] !== rcForm) {
26
+ const fields = new Map();
27
+ instance = {
28
+ ...rcForm,
29
+ scrollToField (name, t1) {
30
+ const options = void 0 === t1 ? {} : t1;
31
+ const target = fields.get(fieldKey(name));
32
+ if (!target) return;
33
+ const node = getDOM(target.instance) ?? document.getElementById(target.id);
34
+ if (!node) return;
35
+ const { focus, ...scrollOptions } = options;
36
+ use_form_scroll(node, {
37
+ scrollMode: "if-needed",
38
+ block: "nearest",
39
+ ...scrollOptions
40
+ });
41
+ if (focus) {
42
+ const control = target.instance;
43
+ if ("function" == typeof control?.focus) control.focus({
44
+ preventScroll: true
45
+ });
46
+ else node.focus({
47
+ preventScroll: true
48
+ });
49
+ }
50
+ }
51
+ };
52
+ fieldRegistries.set(instance, fields);
53
+ $[0] = rcForm;
54
+ $[1] = instance;
55
+ } else instance = $[1];
56
+ t0 = instance;
57
+ }
58
+ const wrapped = t0;
59
+ let t1;
60
+ if ($[2] !== wrapped) {
61
+ t1 = [
62
+ wrapped
63
+ ];
64
+ $[2] = wrapped;
65
+ $[3] = t1;
66
+ } else t1 = $[3];
67
+ return t1;
68
+ }
69
+ export { fieldKey, getFieldRegistry, use_form_useForm as useForm };
@@ -1,4 +1,4 @@
1
- import { type CSSProperties, type ReactNode } from 'react';
1
+ import { type CSSProperties, type ReactElement, type ReactNode } from 'react';
2
2
  import { type SemanticClassNames, type SemanticStyles } from '../../utils/semantic.js';
3
3
  export type FormFieldLayout = 'vertical' | 'horizontal';
4
4
  export interface FormFieldViewProps {
@@ -17,6 +17,8 @@ export interface FormFieldViewProps {
17
17
  * `value`/`onChange`/`status`). View-owned id/aria attributes win.
18
18
  */
19
19
  controlProps?: Record<string, unknown>;
20
+ /** Internal hook for bound forms to register the final control and its id. */
21
+ renderControl?: (control: ReactElement<Record<string, unknown>>) => ReactNode;
20
22
  children?: ReactNode;
21
23
  className?: string;
22
24
  style?: CSSProperties;
@@ -29,4 +31,4 @@ export interface FormFieldViewProps {
29
31
  * with the aria wiring (describedby/errormessage/invalid/required) applied
30
32
  * to the child control. Not part of the public API.
31
33
  */
32
- export declare function FormFieldView({ formItem, label, htmlFor, required, error, warning, description, layout, controlProps, children, className, style, classNames, styles, }: FormFieldViewProps): import("react").JSX.Element;
34
+ export declare function FormFieldView({ formItem, label, htmlFor, required, error, warning, description, layout, controlProps, renderControl, children, className, style, classNames, styles, }: FormFieldViewProps): import("react").JSX.Element;
@@ -4,8 +4,8 @@ import { cloneElement, isValidElement, useId } from "react";
4
4
  import { FieldLabelContext } from "../../utils/field-label.js";
5
5
  import { cx } from "../../utils/semantic.js";
6
6
  function FormFieldView(t0) {
7
- const $ = c(54);
8
- const { formItem, label, htmlFor, required, error, warning, description, layout: t1, controlProps, children, className, style, classNames, styles } = t0;
7
+ const $ = c(57);
8
+ const { formItem, label, htmlFor, required, error, warning, description, layout: t1, controlProps, renderControl, children, className, style, classNames, styles } = t0;
9
9
  const layout = void 0 === t1 ? "vertical" : t1;
10
10
  const generatedId = useId();
11
11
  const child = /*#__PURE__*/ isValidElement(children) ? children : null;
@@ -128,41 +128,48 @@ function FormFieldView(t0) {
128
128
  $[37] = t12;
129
129
  } else t12 = $[37];
130
130
  let t13;
131
- if ($[38] !== control || $[39] !== label) {
132
- t13 = /*#__PURE__*/ jsx(FieldLabelContext.Provider, {
133
- value: label,
134
- children: control
135
- });
131
+ if ($[38] !== control || $[39] !== renderControl) {
132
+ t13 = renderControl && /*#__PURE__*/ isValidElement(control) ? renderControl(control) : control;
136
133
  $[38] = control;
137
- $[39] = label;
134
+ $[39] = renderControl;
138
135
  $[40] = t13;
139
136
  } else t13 = $[40];
140
137
  let t14;
141
- if ($[41] !== formItem || $[42] !== message) {
142
- t14 = formItem ? /*#__PURE__*/ jsx("div", {
143
- "data-tao-form-message": "",
144
- children: message
145
- }) : message;
146
- $[41] = formItem;
147
- $[42] = message;
138
+ if ($[41] !== label || $[42] !== t13) {
139
+ t14 = /*#__PURE__*/ jsx(FieldLabelContext.Provider, {
140
+ value: label,
141
+ children: t13
142
+ });
143
+ $[41] = label;
144
+ $[42] = t13;
148
145
  $[43] = t14;
149
146
  } else t14 = $[43];
150
147
  let t15;
151
- if ($[44] !== t13 || $[45] !== t14) {
152
- t15 = /*#__PURE__*/ jsxs("div", {
153
- "data-tao-form-control": "",
154
- children: [
155
- t13,
156
- t14
157
- ]
158
- });
159
- $[44] = t13;
160
- $[45] = t14;
148
+ if ($[44] !== formItem || $[45] !== message) {
149
+ t15 = formItem ? /*#__PURE__*/ jsx("div", {
150
+ "data-tao-form-message": "",
151
+ children: message
152
+ }) : message;
153
+ $[44] = formItem;
154
+ $[45] = message;
161
155
  $[46] = t15;
162
156
  } else t15 = $[46];
163
157
  let t16;
164
- if ($[47] !== t10 || $[48] !== t11 || $[49] !== t12 || $[50] !== t15 || $[51] !== t7 || $[52] !== t9) {
158
+ if ($[47] !== t14 || $[48] !== t15) {
165
159
  t16 = /*#__PURE__*/ jsxs("div", {
160
+ "data-tao-form-control": "",
161
+ children: [
162
+ t14,
163
+ t15
164
+ ]
165
+ });
166
+ $[47] = t14;
167
+ $[48] = t15;
168
+ $[49] = t16;
169
+ } else t16 = $[49];
170
+ let t17;
171
+ if ($[50] !== t10 || $[51] !== t11 || $[52] !== t12 || $[53] !== t16 || $[54] !== t7 || $[55] !== t9) {
172
+ t17 = /*#__PURE__*/ jsxs("div", {
166
173
  className: t7,
167
174
  style: t9,
168
175
  "data-tao-form-field": "",
@@ -170,17 +177,17 @@ function FormFieldView(t0) {
170
177
  "data-tao-layout": t11,
171
178
  children: [
172
179
  t12,
173
- t15
180
+ t16
174
181
  ]
175
182
  });
176
- $[47] = t10;
177
- $[48] = t11;
178
- $[49] = t12;
179
- $[50] = t15;
180
- $[51] = t7;
181
- $[52] = t9;
183
+ $[50] = t10;
184
+ $[51] = t11;
185
+ $[52] = t12;
182
186
  $[53] = t16;
183
- } else t16 = $[53];
184
- return t16;
187
+ $[54] = t7;
188
+ $[55] = t9;
189
+ $[56] = t17;
190
+ } else t17 = $[56];
191
+ return t17;
185
192
  }
186
193
  export { FormFieldView };
@@ -1,7 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import mentions from "@rc-component/mentions";
3
3
  import { forwardRef } from "react";
4
- import { TaoPortalScope, useTaoInternalConfig } from "../../provider/tao-provider.js";
4
+ import { TaoPortalScope, useTaoDirection, useTaoInternalConfig } from "../../provider/tao-provider.js";
5
5
  import { cx } from "../../utils/semantic.js";
6
6
  import { CloseIcon } from "../select/select-icons.js";
7
7
  import { Spinner } from "../spinner/spinner.js";
@@ -52,7 +52,9 @@ const MentionsComponent = /*#__PURE__*/ forwardRef((props, ref)=>{
52
52
  })
53
53
  }
54
54
  ];
55
+ const [direction, directionRef] = useTaoDirection(props.direction);
55
56
  return /*#__PURE__*/ jsx("div", {
57
+ ref: directionRef,
56
58
  "data-tao-mentions": "",
57
59
  "data-tao-control": "",
58
60
  "data-tao-size": size,
@@ -60,7 +62,7 @@ const MentionsComponent = /*#__PURE__*/ forwardRef((props, ref)=>{
60
62
  "data-disabled": disabled || void 0,
61
63
  "data-tao-error": 'error' === status || void 0,
62
64
  "data-tao-warning": 'warning' === status || void 0,
63
- dir: props.direction,
65
+ dir: direction,
64
66
  className: cx(className, rootClassName, classes?.root),
65
67
  style: {
66
68
  ...semanticStyles?.root,
@@ -68,6 +70,7 @@ const MentionsComponent = /*#__PURE__*/ forwardRef((props, ref)=>{
68
70
  },
69
71
  children: /*#__PURE__*/ jsx(RcMentionsComponent, {
70
72
  ...rest,
73
+ direction: direction,
71
74
  ref: ref,
72
75
  prefixCls: prefixCls,
73
76
  disabled: disabled,
@@ -97,6 +100,7 @@ const MentionsComponent = /*#__PURE__*/ forwardRef((props, ref)=>{
97
100
  },
98
101
  popupRender: (menu)=>/*#__PURE__*/ jsx(TaoPortalScope, {
99
102
  asChild: true,
103
+ direction: direction,
100
104
  children: /*#__PURE__*/ jsx("div", {
101
105
  "data-tao-mentions-popup": "",
102
106
  "data-tao-size": size,
@@ -10,6 +10,7 @@ export type ModalFooterRender = (originNode: ReactNode, extra: {
10
10
  CancelBtn: FC;
11
11
  }) => ReactNode;
12
12
  export interface ModalProps extends Pick<AriaAttributes, 'aria-label' | 'aria-labelledby' | 'aria-describedby'> {
13
+ direction?: 'ltr' | 'rtl';
13
14
  open: boolean;
14
15
  onClose?: () => void;
15
16
  title?: ReactNode;
@@ -79,4 +80,4 @@ export interface ModalProps extends Pick<AriaAttributes, 'aria-label' | 'aria-la
79
80
  classNames?: SemanticClassNames<ModalSemanticPart>;
80
81
  styles?: SemanticStyles<ModalSemanticPart>;
81
82
  }
82
- export declare function Modal({ open, onClose, title, footer, onOk, okText, cancelText, confirmLoading, okButtonProps, cancelButtonProps, width, centered, closable, maskClosable, keyboard, getContainer, mask, zIndex, scrollLock, closeIcon, modalRender, wrapProps, transitionName, maskTransitionName, focusTriggerAfterClose, autoFocusButton, focusable, afterClose, destroyOnHidden, children, classNames, styles: stylesProp, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, }: ModalProps): import("react").JSX.Element;
83
+ export declare function Modal({ direction, open, onClose, title, footer, onOk, okText, cancelText, confirmLoading, okButtonProps, cancelButtonProps, width, centered, closable, maskClosable, keyboard, getContainer, mask, zIndex, scrollLock, closeIcon, modalRender, wrapProps, transitionName, maskTransitionName, focusTriggerAfterClose, autoFocusButton, focusable, afterClose, destroyOnHidden, children, classNames, styles: stylesProp, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, }: ModalProps): import("react").JSX.Element;
@@ -3,7 +3,7 @@ import { c } from "react-compiler-runtime";
3
3
  import { FocusScope, FocusScopeBranchProvider, useFocusScopeBranchRegistry } from "@radix-ui/react-focus-scope";
4
4
  import { useEffect, useRef } from "react";
5
5
  import { RemoveScroll } from "react-remove-scroll";
6
- import { TaoPortalScope } from "../../provider/tao-provider.js";
6
+ import { TaoPortalScope, TaoProvider } from "../../provider/tao-provider.js";
7
7
  import { resolveResponsiveValue, useBreakpoint } from "../../utils/breakpoint.js";
8
8
  import { DialogContent } from "../../utils/dialog-content.js";
9
9
  import { preventParentOutsideDismiss } from "../../utils/portal.js";
@@ -14,8 +14,8 @@ import "./modal.css";
14
14
  import * as __rspack_external__radix_ui_react_dialog_dabd8325 from "@radix-ui/react-dialog";
15
15
  const ModalBranchProvider = FocusScopeBranchProvider;
16
16
  function Modal(t0) {
17
- const $ = c(170);
18
- const { open, onClose, title, footer, onOk, okText: t1, cancelText: t2, confirmLoading, okButtonProps, cancelButtonProps, width: t3, centered: t4, closable: t5, maskClosable: t6, keyboard: t7, getContainer, mask: t8, zIndex, scrollLock: t9, closeIcon, modalRender, wrapProps, transitionName, maskTransitionName, focusTriggerAfterClose, autoFocusButton, focusable, afterClose, destroyOnHidden: t10, children, classNames, styles: stylesProp, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy } = t0;
17
+ const $ = c(173);
18
+ const { direction, open, onClose, title, footer, onOk, okText: t1, cancelText: t2, confirmLoading, okButtonProps, cancelButtonProps, width: t3, centered: t4, closable: t5, maskClosable: t6, keyboard: t7, getContainer, mask: t8, zIndex, scrollLock: t9, closeIcon, modalRender, wrapProps, transitionName, maskTransitionName, focusTriggerAfterClose, autoFocusButton, focusable, afterClose, destroyOnHidden: t10, children, classNames, styles: stylesProp, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy } = t0;
19
19
  const okText = void 0 === t1 ? "OK" : t1;
20
20
  const cancelText = void 0 === t2 ? "Cancel" : t2;
21
21
  const width = void 0 === t3 ? 520 : t3;
@@ -585,7 +585,17 @@ function Modal(t0) {
585
585
  $[168] = t58;
586
586
  $[169] = t59;
587
587
  } else t59 = $[169];
588
- return t59;
588
+ let t60;
589
+ if ($[170] !== direction || $[171] !== t59) {
590
+ t60 = /*#__PURE__*/ jsx(TaoProvider, {
591
+ direction: direction,
592
+ children: t59
593
+ });
594
+ $[170] = direction;
595
+ $[171] = t59;
596
+ $[172] = t60;
597
+ } else t60 = $[172];
598
+ return t60;
589
599
  }
590
600
  function _temp2(event_2) {
591
601
  return event_2.preventDefault();
@@ -152,3 +152,7 @@
152
152
  }
153
153
  }
154
154
 
155
+ [data-tao-pagination]:dir(rtl) [data-tao-pagination-btn] > svg {
156
+ transform: scaleX(-1);
157
+ }
158
+
@@ -6,6 +6,7 @@ export type PopoverTrigger = 'hover' | 'focus' | 'click' | 'contextMenu';
6
6
  export type PopoverPlacement = 'top' | 'topLeft' | 'topRight' | 'bottom' | 'bottomLeft' | 'bottomRight' | 'left' | 'leftTop' | 'leftBottom' | 'right' | 'rightTop' | 'rightBottom';
7
7
  type PopoverRender = ReactNode | (() => ReactNode);
8
8
  export interface PopoverProps extends Pick<AriaAttributes, 'aria-label' | 'aria-labelledby' | 'aria-describedby'> {
9
+ direction?: 'ltr' | 'rtl';
9
10
  /** Header content of the popup. */
10
11
  title?: PopoverRender;
11
12
  /** Body content of the popup. */
@@ -37,5 +38,5 @@ export interface PopoverProps extends Pick<AriaAttributes, 'aria-label' | 'aria-
37
38
  /** Exactly one trigger element. */
38
39
  children: ReactNode;
39
40
  }
40
- export declare function Popover({ title, content, trigger, placement, open, defaultOpen, onOpenChange, mouseEnterDelay, mouseLeaveDelay, arrow, destroyOnHidden, destroyTooltipOnHide, className, style, classNames, styles, children, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, }: PopoverProps): import("react").JSX.Element;
41
+ export declare function Popover({ direction: directionProp, title, content, trigger, placement, open, defaultOpen, onOpenChange, mouseEnterDelay, mouseLeaveDelay, arrow, destroyOnHidden, destroyTooltipOnHide, className, style, classNames, styles, children, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, }: PopoverProps): import("react").JSX.Element;
41
42
  export {};