@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.
- package/README.md +7 -1
- package/component-manifest.json +10 -3
- package/dist/components/auto-complete/auto-complete.js +12 -3
- package/dist/components/breadcrumb/breadcrumb.css +4 -0
- package/dist/components/breadcrumb/breadcrumb.js +1 -0
- package/dist/components/calendar/calendar.d.ts +1 -0
- package/dist/components/calendar/calendar.js +10 -3
- package/dist/components/card/card-tabs.js +204 -182
- package/dist/components/card/card.js +1 -1
- package/dist/components/carousel/carousel.js +11 -5
- package/dist/components/cascader/cascader.js +16 -4
- package/dist/components/collapse/collapse.css +8 -0
- package/dist/components/context-menu/context-menu.d.ts +2 -1
- package/dist/components/context-menu/context-menu.js +57 -44
- package/dist/components/date-picker/calendar/calendar-grid.js +3 -2
- package/dist/components/date-picker/date-picker.css +4 -0
- package/dist/components/date-picker/date-picker.d.ts +1 -0
- package/dist/components/date-picker/date-picker.js +13 -3
- package/dist/components/date-picker/range-picker.d.ts +1 -0
- package/dist/components/date-picker/range-picker.js +13 -3
- package/dist/components/drawer/drawer.d.ts +2 -1
- package/dist/components/drawer/drawer.js +32 -20
- package/dist/components/dropdown/dropdown.d.ts +1 -0
- package/dist/components/dropdown/dropdown.js +139 -123
- package/dist/components/form/field-control.d.ts +6 -0
- package/dist/components/form/field-control.js +42 -0
- package/dist/components/form/form-context.d.ts +3 -0
- package/dist/components/form/form-item.d.ts +2 -1
- package/dist/components/form/form-item.js +55 -42
- package/dist/components/form/form.d.ts +5 -5
- package/dist/components/form/form.js +86 -68
- package/dist/components/form/index.d.ts +1 -0
- package/dist/components/form/use-form.d.ts +16 -0
- package/dist/components/form/use-form.js +69 -0
- package/dist/components/form-field/form-field-view.d.ts +4 -2
- package/dist/components/form-field/form-field-view.js +42 -35
- package/dist/components/mentions/mentions.js +6 -2
- package/dist/components/modal/modal.d.ts +2 -1
- package/dist/components/modal/modal.js +14 -4
- package/dist/components/pagination/pagination.css +4 -0
- package/dist/components/popover/popover.d.ts +2 -1
- package/dist/components/popover/popover.js +185 -176
- package/dist/components/rate/rate.js +114 -88
- package/dist/components/scroll-area/scroll-area.js +127 -118
- package/dist/components/segmented/segmented.js +52 -29
- package/dist/components/select/mobile-select.d.ts +2 -1
- package/dist/components/select/mobile-select.js +52 -47
- package/dist/components/select/select-types.d.ts +1 -0
- package/dist/components/select/select.js +19 -6
- package/dist/components/slider/slider.js +136 -133
- package/dist/components/splitter/splitter.css +4 -0
- package/dist/components/splitter/splitter.js +5 -3
- package/dist/components/table/table.css +29 -11
- package/dist/components/table/table.js +383 -547
- package/dist/components/tabs/tabs.js +3 -2
- package/dist/components/time-picker/time-picker.js +21 -7
- package/dist/components/tooltip/tooltip.d.ts +2 -1
- package/dist/components/tooltip/tooltip.js +82 -71
- package/dist/components/transfer/transfer-parts.js +12 -2
- package/dist/components/transfer/transfer.js +10 -4
- package/dist/components/tree/tree-keyboard.d.ts +6 -0
- package/dist/components/tree/tree-keyboard.js +27 -0
- package/dist/components/tree/tree.js +14 -3
- package/dist/components/tree-select/select-engine.d.ts +2 -1
- package/dist/components/tree-select/select-engine.js +23 -15
- package/dist/components/tree-select/tree-select.js +20 -10
- package/dist/docs/components/form.doc.js +3 -1
- package/dist/docs/components/tao-provider.doc.js +6 -1
- package/dist/entries/form.d.ts +2 -2
- package/dist/entries/provider.d.ts +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/provider/tao-provider.d.ts +10 -3
- package/dist/provider/tao-provider.js +198 -88
- package/dist/utils/scroll-left.d.ts +3 -0
- package/dist/utils/scroll-left.js +7 -0
- package/llms.txt +3 -3
- package/package.json +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, {
|
|
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(
|
|
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] =
|
|
31
|
-
$[6] =
|
|
32
|
-
$[7] =
|
|
33
|
-
$[8] =
|
|
34
|
-
$[9] =
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
$[
|
|
53
|
-
$[
|
|
54
|
-
} else
|
|
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 ($[
|
|
59
|
-
t4 =
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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 ($[
|
|
67
|
-
t6 =
|
|
68
|
-
|
|
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
|
-
$[
|
|
72
|
-
$[
|
|
73
|
-
$[
|
|
74
|
-
} else
|
|
75
|
-
let
|
|
76
|
-
if ($[
|
|
77
|
-
|
|
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:
|
|
81
|
-
style:
|
|
96
|
+
className: t6,
|
|
97
|
+
style: t8,
|
|
82
98
|
...rcProps,
|
|
99
|
+
form: instance,
|
|
83
100
|
children: children
|
|
84
101
|
});
|
|
85
|
-
$[
|
|
86
|
-
$[
|
|
87
|
-
$[
|
|
88
|
-
$[
|
|
89
|
-
$[
|
|
90
|
-
$[
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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:
|
|
115
|
+
children: t9
|
|
98
116
|
});
|
|
99
|
-
$[
|
|
100
|
-
$[
|
|
101
|
-
$[
|
|
102
|
-
$[
|
|
103
|
-
} else
|
|
104
|
-
let
|
|
105
|
-
if ($[
|
|
106
|
-
|
|
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:
|
|
126
|
+
children: t10
|
|
109
127
|
});
|
|
110
|
-
$[
|
|
111
|
-
$[
|
|
112
|
-
$[
|
|
113
|
-
} else
|
|
114
|
-
return
|
|
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(
|
|
136
|
+
return useContext(FormLayoutContext).form;
|
|
119
137
|
}
|
|
120
138
|
const Form = Object.assign(ForwardedForm, {
|
|
121
139
|
Item: FormItem,
|
|
@@ -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(
|
|
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] !==
|
|
132
|
-
t13 = /*#__PURE__*/
|
|
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] =
|
|
134
|
+
$[39] = renderControl;
|
|
138
135
|
$[40] = t13;
|
|
139
136
|
} else t13 = $[40];
|
|
140
137
|
let t14;
|
|
141
|
-
if ($[41] !==
|
|
142
|
-
t14 =
|
|
143
|
-
|
|
144
|
-
children:
|
|
145
|
-
})
|
|
146
|
-
$[41] =
|
|
147
|
-
$[42] =
|
|
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] !==
|
|
152
|
-
t15 = /*#__PURE__*/
|
|
153
|
-
"data-tao-form-
|
|
154
|
-
children:
|
|
155
|
-
|
|
156
|
-
|
|
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] !==
|
|
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
|
-
|
|
180
|
+
t16
|
|
174
181
|
]
|
|
175
182
|
});
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
179
|
-
$[50] = t15;
|
|
180
|
-
$[51] = t7;
|
|
181
|
-
$[52] = t9;
|
|
183
|
+
$[50] = t10;
|
|
184
|
+
$[51] = t11;
|
|
185
|
+
$[52] = t12;
|
|
182
186
|
$[53] = t16;
|
|
183
|
-
|
|
184
|
-
|
|
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:
|
|
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(
|
|
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
|
-
|
|
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();
|
|
@@ -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 {};
|