@rockshin/tao-ui 0.0.57 → 0.0.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/affix/affix.js +38 -4
- package/dist/components/app/app-modals.js +11 -6
- package/dist/components/app/app-notices.js +112 -47
- package/dist/components/auto-complete/auto-complete.js +9 -2
- package/dist/components/avatar/avatar.js +1 -1
- package/dist/components/badge/badge.js +2 -2
- package/dist/components/breadcrumb/breadcrumb.js +5 -1
- package/dist/components/calendar/calendar.js +24 -17
- package/dist/components/carousel/carousel.js +35 -16
- package/dist/components/cascader/cascader.js +17 -12
- package/dist/components/checkbox/checkbox.d.ts +3 -1
- package/dist/components/checkbox/checkbox.js +65 -58
- package/dist/components/collapse/collapse-panels.js +68 -67
- package/dist/components/color-picker/color-picker.js +383 -360
- package/dist/components/date-picker/calendar/calendar-grid.d.ts +5 -3
- package/dist/components/date-picker/calendar/calendar-grid.js +9 -4
- package/dist/components/date-picker/calendar/month-grid.d.ts +2 -1
- package/dist/components/date-picker/calendar/month-grid.js +61 -45
- package/dist/components/date-picker/calendar/time-panel.d.ts +8 -1
- package/dist/components/date-picker/calendar/time-panel.js +89 -88
- package/dist/components/date-picker/calendar/year-grid.d.ts +2 -1
- package/dist/components/date-picker/calendar/year-grid.js +60 -44
- package/dist/components/date-picker/date-localization.js +12 -14
- package/dist/components/date-picker/date-picker.css +9 -0
- package/dist/components/date-picker/date-picker.js +22 -13
- package/dist/components/date-picker/range-picker.d.ts +2 -0
- package/dist/components/date-picker/range-picker.js +127 -70
- package/dist/components/date-picker/types.js +1 -1
- package/dist/components/divider/divider.js +1 -1
- package/dist/components/drawer/drawer.d.ts +1 -1
- package/dist/components/drawer/drawer.js +4 -3
- package/dist/components/dropdown/dropdown.js +11 -9
- package/dist/components/float-button/float-button.js +11 -9
- package/dist/components/form/form-item.d.ts +1 -1
- package/dist/components/form/form-item.js +160 -120
- package/dist/components/form-field/form-field-view.d.ts +2 -1
- package/dist/components/form-field/form-field-view.js +173 -108
- package/dist/components/image/image.js +135 -143
- package/dist/components/input/input-shared.js +3 -2
- package/dist/components/input/otp.js +120 -110
- package/dist/components/input/password.js +55 -61
- package/dist/components/input/search.js +13 -7
- package/dist/components/list/list.js +106 -105
- package/dist/components/masonry/masonry.js +1 -1
- package/dist/components/mentions/mentions.js +1 -0
- package/dist/components/menu/menu-render.js +1 -0
- package/dist/components/modal/confirm-dialog.js +11 -4
- package/dist/components/modal/modal.js +320 -315
- package/dist/components/pagination/pagination.d.ts +3 -0
- package/dist/components/pagination/pagination.js +5 -0
- package/dist/components/popover/popover.js +325 -289
- package/dist/components/qr-code/qr-code.js +157 -150
- package/dist/components/radio/radio.d.ts +3 -1
- package/dist/components/radio/radio.js +73 -64
- package/dist/components/rate/rate.js +83 -72
- package/dist/components/scroll-area/scroll-area.css +1 -1
- package/dist/components/scroll-area/scroll-area.js +294 -222
- package/dist/components/select/mobile-select.js +6 -3
- package/dist/components/select/select-model.js +2 -2
- package/dist/components/select/select.js +78 -39
- package/dist/components/select/use-select-selection.d.ts +1 -1
- package/dist/components/select/use-select-selection.js +91 -84
- package/dist/components/slider/slider.d.ts +2 -2
- package/dist/components/slider/slider.js +13 -2
- package/dist/components/sonner/sonner.js +2 -2
- package/dist/components/splitter/splitter.css +1 -0
- package/dist/components/splitter/splitter.js +152 -126
- package/dist/components/statistic/statistic.js +84 -78
- package/dist/components/steps/steps.js +1 -1
- package/dist/components/switch/switch.js +45 -39
- package/dist/components/table/table.js +5 -1
- package/dist/components/table/use-table-data.js +2 -2
- package/dist/components/time-picker/time-picker.js +31 -1
- package/dist/components/tooltip/tooltip.js +237 -99
- package/dist/components/tree/tree.js +31 -3
- package/dist/components/tree-select/tree-select.js +1 -1
- package/dist/components/upload/upload.js +69 -42
- package/dist/locales/ar-EG.js +2 -0
- package/dist/locales/de-DE.js +2 -0
- package/dist/locales/en-US.js +2 -0
- package/dist/locales/es-ES.js +2 -0
- package/dist/locales/fr-FR.js +2 -0
- package/dist/locales/hi-IN.js +2 -0
- package/dist/locales/id-ID.js +2 -0
- package/dist/locales/it-IT.js +2 -0
- package/dist/locales/ja-JP.js +2 -0
- package/dist/locales/ko-KR.js +2 -0
- package/dist/locales/pt-BR.js +2 -0
- package/dist/locales/ru-RU.js +2 -0
- package/dist/locales/th-TH.js +2 -0
- package/dist/locales/tr-TR.js +2 -0
- package/dist/locales/types.d.ts +2 -0
- package/dist/locales/vi-VN.js +2 -0
- package/dist/locales/zh-CN.js +2 -0
- package/dist/locales/zh-TW.js +2 -0
- package/dist/number-input/cursor.js +20 -8
- package/dist/number-input/format.js +13 -5
- package/dist/number-input/use-number-input.js +166 -318
- package/dist/number-input/validate.d.ts +1 -0
- package/dist/number-input/validate.js +1 -1
- package/dist/provider/tao-provider.d.ts +2 -2
- package/dist/provider/tao-provider.js +49 -49
- package/dist/utils/composed-parent.d.ts +1 -0
- package/dist/utils/composed-parent.js +7 -0
- package/dist/utils/portal.d.ts +5 -0
- package/dist/utils/portal.js +7 -1
- package/dist/utils/refs.d.ts +3 -1
- package/dist/utils/refs.js +25 -1
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ import { c } from "react-compiler-runtime";
|
|
|
3
3
|
import { useCallback, useEffect, useRef } from "react";
|
|
4
4
|
import { TaoPortalScope, useTaoConfig, useTaoDirection } from "../../provider/tao-provider.js";
|
|
5
5
|
import { asTriggerChild, useControlledOpen } from "../../utils/overlay.js";
|
|
6
|
+
import { useCommittedRef } from "../../utils/refs.js";
|
|
6
7
|
import { cx } from "../../utils/semantic.js";
|
|
7
8
|
import { Button } from "../button/button.js";
|
|
8
9
|
import { ContextMenu } from "../context-menu/context-menu.js";
|
|
@@ -97,8 +98,7 @@ function Dropdown(props) {
|
|
|
97
98
|
}, [
|
|
98
99
|
updateOpen
|
|
99
100
|
]);
|
|
100
|
-
const latestSetOpen =
|
|
101
|
-
latestSetOpen.current = setOpen;
|
|
101
|
+
const latestSetOpen = useCommittedRef(setOpen);
|
|
102
102
|
useEffect(()=>{
|
|
103
103
|
if (resolvedDisabled && realOpen && null == open) setOpen(false);
|
|
104
104
|
}, [
|
|
@@ -107,18 +107,20 @@ function Dropdown(props) {
|
|
|
107
107
|
resolvedDisabled,
|
|
108
108
|
setOpen
|
|
109
109
|
]);
|
|
110
|
-
const openOnHover = useCallback(()=>{
|
|
110
|
+
const openOnHover = useCallback((event)=>{
|
|
111
|
+
if ('touch' === event.pointerType) return;
|
|
111
112
|
clearTimeout(closeTimer.current);
|
|
112
113
|
if (!realOpen) setOpen(true);
|
|
113
114
|
}, [
|
|
114
115
|
realOpen,
|
|
115
116
|
setOpen
|
|
116
117
|
]);
|
|
117
|
-
const closeOnHover = useCallback(()=>{
|
|
118
|
-
if (!realOpen) return;
|
|
118
|
+
const closeOnHover = useCallback((event_0)=>{
|
|
119
|
+
if (!realOpen || 'touch' === event_0.pointerType) return;
|
|
119
120
|
clearTimeout(closeTimer.current);
|
|
120
121
|
closeTimer.current = setTimeout(()=>latestSetOpen.current(false), 120);
|
|
121
122
|
}, [
|
|
123
|
+
latestSetOpen,
|
|
122
124
|
realOpen
|
|
123
125
|
]);
|
|
124
126
|
const { content, selectedKeys, commitSelection } = useMenuController(menu, DD, {
|
|
@@ -160,8 +162,8 @@ function Dropdown(props) {
|
|
|
160
162
|
disabled: resolvedDisabled,
|
|
161
163
|
"data-tao-dropdown-trigger": "",
|
|
162
164
|
...hoverProps,
|
|
163
|
-
onPointerDown: (
|
|
164
|
-
if (!clickMode)
|
|
165
|
+
onPointerDown: (event_1)=>{
|
|
166
|
+
if (!clickMode && 'touch' !== event_1.pointerType) event_1.preventDefault();
|
|
165
167
|
},
|
|
166
168
|
children: triggerChild
|
|
167
169
|
}),
|
|
@@ -181,8 +183,8 @@ function Dropdown(props) {
|
|
|
181
183
|
side: side,
|
|
182
184
|
align: align,
|
|
183
185
|
sideOffset: 4,
|
|
184
|
-
onCloseAutoFocus: (
|
|
185
|
-
if (latestVisible.current)
|
|
186
|
+
onCloseAutoFocus: (event_2)=>{
|
|
187
|
+
if (latestVisible.current) event_2.preventDefault();
|
|
186
188
|
},
|
|
187
189
|
...hoverProps,
|
|
188
190
|
children: [
|
|
@@ -49,11 +49,15 @@ const FloatButtonRoot = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
49
49
|
const slots = 'function' == typeof styles ? styles({
|
|
50
50
|
props: merged
|
|
51
51
|
}) : styles;
|
|
52
|
-
const
|
|
52
|
+
const isLink = null != href;
|
|
53
|
+
const Tag = isLink ? 'a' : 'button';
|
|
53
54
|
const node = useRef(null);
|
|
54
55
|
useImperativeHandle(ref, ()=>node.current);
|
|
55
56
|
const hasLabel = null != label && 'boolean' != typeof label;
|
|
56
57
|
const glyph = icon ?? (hasLabel ? null : /*#__PURE__*/ jsx(ActionIcon, {}));
|
|
58
|
+
const tooltipProps = !tooltip || 'object' != typeof tooltip || Array.isArray(tooltip) || '$$typeof' in tooltip ? {
|
|
59
|
+
title: tooltip
|
|
60
|
+
} : tooltip;
|
|
57
61
|
const button = /*#__PURE__*/ jsxs(Tag, {
|
|
58
62
|
...rest,
|
|
59
63
|
ref: (element)=>{
|
|
@@ -61,11 +65,11 @@ const FloatButtonRoot = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
61
65
|
},
|
|
62
66
|
href: disabled ? void 0 : href,
|
|
63
67
|
target: target,
|
|
64
|
-
type:
|
|
65
|
-
disabled:
|
|
66
|
-
"aria-disabled":
|
|
67
|
-
tabIndex:
|
|
68
|
-
"aria-label": props['aria-label'] ?? (hasLabel ? void 0 : 'string' == typeof
|
|
68
|
+
type: isLink ? void 0 : htmlType,
|
|
69
|
+
disabled: isLink ? void 0 : disabled,
|
|
70
|
+
"aria-disabled": isLink && disabled || void 0,
|
|
71
|
+
tabIndex: isLink && disabled ? -1 : rest.tabIndex,
|
|
72
|
+
"aria-label": props['aria-label'] ?? (hasLabel ? void 0 : 'string' == typeof tooltipProps.title ? tooltipProps.title : 'Action'),
|
|
69
73
|
"data-tao-float-button": "",
|
|
70
74
|
"data-tao-type": type,
|
|
71
75
|
"data-tao-shape": actualShape,
|
|
@@ -80,6 +84,7 @@ const FloatButtonRoot = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
80
84
|
if (disabled) return void event.preventDefault();
|
|
81
85
|
rest.onClick?.(event);
|
|
82
86
|
},
|
|
87
|
+
onAuxClick: disabled ? (event_0)=>event_0.preventDefault() : rest.onAuxClick,
|
|
83
88
|
children: [
|
|
84
89
|
null !== glyph && /*#__PURE__*/ jsx("span", {
|
|
85
90
|
"data-tao-float-button-icon": "",
|
|
@@ -107,9 +112,6 @@ const FloatButtonRoot = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
107
112
|
})
|
|
108
113
|
]
|
|
109
114
|
});
|
|
110
|
-
const tooltipProps = !tooltip || 'object' != typeof tooltip || Array.isArray(tooltip) || '$$typeof' in tooltip ? {
|
|
111
|
-
title: tooltip
|
|
112
|
-
} : tooltip;
|
|
113
115
|
return null == tooltip ? button : /*#__PURE__*/ jsx(Tooltip, {
|
|
114
116
|
...tooltipProps,
|
|
115
117
|
children: button
|
|
@@ -53,4 +53,4 @@ export interface FormItemProps<Values = Record<string, unknown>> {
|
|
|
53
53
|
* With no `name`, `dependencies`, or `shouldUpdate`, it is purely
|
|
54
54
|
* presentational — equivalent to FormField with `help`/`validateStatus`.
|
|
55
55
|
*/
|
|
56
|
-
export declare function FormItem<Values = Record<string, unknown>>({ name, label, required, rules, help, extra, validateStatus, initialValue, valuePropName, getValueFromEvent, trigger, validateTrigger, noStyle, dependencies, shouldUpdate, normalize, preserve, messageVariables, validateFirst, htmlFor, className, style, classNames, styles, children, }: FormItemProps<Values>): ReactNode;
|
|
56
|
+
export declare function FormItem<Values = Record<string, unknown>>({ name, label, required, rules, help, extra, validateStatus, initialValue, valuePropName, getValueFromEvent, trigger, validateTrigger, noStyle, dependencies, shouldUpdate, normalize, preserve, messageVariables, validateFirst, htmlFor, className, style, classNames, styles, children, ...shellProps }: FormItemProps<Values>): ReactNode;
|
|
@@ -1,76 +1,133 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react-compiler-runtime";
|
|
3
3
|
import { Field } from "@rc-component/form";
|
|
4
|
-
import { Fragment, cloneElement, isValidElement } from "react";
|
|
4
|
+
import { Fragment, cloneElement, createContext, isValidElement, useContext, useId, useState } from "react";
|
|
5
5
|
import { FormFieldView } from "../form-field/form-field-view.js";
|
|
6
6
|
import { FieldControl } from "./field-control.js";
|
|
7
7
|
import { useFormLayout } from "./form-context.js";
|
|
8
|
+
const NoStyleFeedbackContext = /*#__PURE__*/ createContext(null);
|
|
8
9
|
function FormItem(t0) {
|
|
9
|
-
const $ = c(
|
|
10
|
-
const { name, label, required, rules, help, extra, validateStatus, initialValue, valuePropName, getValueFromEvent, trigger, validateTrigger, noStyle, dependencies, shouldUpdate, normalize, preserve, messageVariables, validateFirst, htmlFor, className, style, classNames, styles, children } = t0;
|
|
10
|
+
const $ = c(29);
|
|
11
|
+
const { name, label, required, rules, help, extra, validateStatus, initialValue, valuePropName, getValueFromEvent, trigger, validateTrigger, noStyle, dependencies, shouldUpdate, normalize, preserve, messageVariables, validateFirst, htmlFor, className, style, classNames, styles, children, ...shellProps } = t0;
|
|
11
12
|
const { layout, form: formInstance } = useFormLayout();
|
|
13
|
+
const parentFeedback = useContext(NoStyleFeedbackContext);
|
|
14
|
+
const feedbackId = `${useId()}-nostyle-error`;
|
|
12
15
|
let t1;
|
|
13
|
-
if ($[0]
|
|
14
|
-
t1 =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
17
|
+
t1 = {};
|
|
18
|
+
$[0] = t1;
|
|
19
|
+
} else t1 = $[0];
|
|
20
|
+
const [nestedErrors, setNestedErrors] = useState(t1);
|
|
21
|
+
let t2;
|
|
22
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
23
|
+
t2 = (id, errors)=>{
|
|
24
|
+
setNestedErrors((current)=>{
|
|
25
|
+
if (!errors.length && !current[id]) return current;
|
|
26
|
+
if (errors.length) return {
|
|
27
|
+
...current,
|
|
28
|
+
[id]: errors
|
|
29
|
+
};
|
|
30
|
+
const next = {
|
|
31
|
+
...current
|
|
32
|
+
};
|
|
33
|
+
delete next[id];
|
|
34
|
+
return next;
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
$[1] = t2;
|
|
38
|
+
} else t2 = $[1];
|
|
39
|
+
const report = t2;
|
|
40
|
+
const t3 = null == help;
|
|
41
|
+
let t4;
|
|
42
|
+
if ($[2] !== t3) {
|
|
43
|
+
t4 = {
|
|
44
|
+
visible: t3,
|
|
45
|
+
report
|
|
46
|
+
};
|
|
47
|
+
$[2] = t3;
|
|
48
|
+
$[3] = t4;
|
|
49
|
+
} else t4 = $[3];
|
|
50
|
+
const feedback = t4;
|
|
51
|
+
const renderShell = (content, meta, control)=>{
|
|
52
|
+
const requiredMark = required ?? rules?.some((rule)=>{
|
|
53
|
+
const entity = "function" == typeof rule ? formInstance && rule(formInstance) : rule;
|
|
54
|
+
return !!entity?.required && !entity.warningOnly;
|
|
55
|
+
}) ?? false;
|
|
56
|
+
const status = validateStatus ?? (meta?.errors.length ? "error" : meta?.warnings.length ? "warning" : void 0);
|
|
57
|
+
const message = help ?? meta?.errors[0] ?? meta?.warnings[0];
|
|
58
|
+
const showAsStatus = null != message && null != status;
|
|
59
|
+
const errorSlot = showAsStatus ? message : void 0;
|
|
60
|
+
const descriptionSlot = showAsStatus ? void 0 : message;
|
|
61
|
+
let controlProps = control ?? void 0;
|
|
62
|
+
const valueProp = valuePropName ?? "value";
|
|
63
|
+
const element = /*#__PURE__*/ isValidElement(content) && content.type !== Fragment ? content : void 0;
|
|
64
|
+
if (status && element && "string" != typeof element.type && null == element.props.status && null == element.props.error) controlProps = {
|
|
65
|
+
...controlProps,
|
|
66
|
+
status
|
|
67
|
+
};
|
|
68
|
+
if (controlProps && "checked" === valuePropName && "checked" in controlProps && (void 0 === controlProps.checked || null === controlProps.checked && element?.type === "input")) controlProps = {
|
|
69
|
+
...controlProps,
|
|
70
|
+
checked: false
|
|
71
|
+
};
|
|
72
|
+
if (controlProps && "value" === valueProp && null == controlProps.value) {
|
|
73
|
+
if (element?.type === "select") controlProps = {
|
|
25
74
|
...controlProps,
|
|
26
|
-
|
|
75
|
+
value: element.props.multiple ? [] : ""
|
|
27
76
|
};
|
|
28
|
-
if (
|
|
77
|
+
else if (element?.type === "input" || element?.type === "textarea") controlProps = {
|
|
29
78
|
...controlProps,
|
|
30
|
-
|
|
79
|
+
value: ""
|
|
31
80
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
81
|
+
}
|
|
82
|
+
if (controlProps && element) for (const [prop, handler] of Object.entries(controlProps)){
|
|
83
|
+
const childHandler = element.props[prop];
|
|
84
|
+
if (prop !== valueProp && "function" == typeof handler && "function" == typeof childHandler) controlProps = {
|
|
85
|
+
...controlProps,
|
|
86
|
+
[prop]: "function" == typeof children ? childHandler : (...t5)=>{
|
|
87
|
+
const args = t5;
|
|
88
|
+
handler(...args);
|
|
89
|
+
childHandler(...args);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
const collect = control?.onChange;
|
|
94
|
+
const valueChange = (trigger ?? "onChange") === "onChange" && "value" === valueProp && "function" == typeof collect ? {
|
|
95
|
+
onChange: controlProps?.onChange,
|
|
96
|
+
collect: (value)=>collect(value)
|
|
97
|
+
} : null;
|
|
98
|
+
if (noStyle) {
|
|
99
|
+
if (!element) return content;
|
|
100
|
+
const inherited = Object.fromEntries(Object.entries(shellProps).filter((t6)=>{
|
|
101
|
+
const [key] = t6;
|
|
102
|
+
return null == element.props[key] && !("aria-labelledby" === key && element.props["aria-label"]);
|
|
103
|
+
}));
|
|
104
|
+
const errors_0 = meta?.errors ?? [];
|
|
105
|
+
const describedBy = [
|
|
106
|
+
element.props["aria-describedby"] ?? inherited["aria-describedby"],
|
|
107
|
+
parentFeedback?.visible && errors_0.length ? feedbackId : void 0
|
|
108
|
+
].filter(Boolean).join(" ");
|
|
109
|
+
const child = /*#__PURE__*/ cloneElement(element, {
|
|
110
|
+
...inherited,
|
|
111
|
+
...controlProps,
|
|
112
|
+
"aria-describedby": describedBy || void 0,
|
|
113
|
+
"aria-invalid": errors_0.length > 0 ? true : element.props["aria-invalid"] ?? inherited["aria-invalid"]
|
|
114
|
+
});
|
|
115
|
+
return null != name && meta ? /*#__PURE__*/ jsx(FieldControl, {
|
|
116
|
+
name: meta.name,
|
|
117
|
+
valueChange: valueChange,
|
|
118
|
+
children: child
|
|
119
|
+
}) : child;
|
|
120
|
+
}
|
|
121
|
+
return /*#__PURE__*/ jsx(NoStyleFeedbackContext.Provider, {
|
|
122
|
+
value: feedback,
|
|
123
|
+
children: /*#__PURE__*/ jsx(FormFieldView, {
|
|
68
124
|
formItem: true,
|
|
69
125
|
reserveMessage: Boolean(rules?.length) || null != help || null != extra || null != validateStatus,
|
|
70
126
|
label: label,
|
|
71
127
|
htmlFor: htmlFor,
|
|
72
128
|
required: requiredMark,
|
|
73
129
|
error: errorSlot,
|
|
130
|
+
nestedErrors: null == help ? nestedErrors : void 0,
|
|
74
131
|
invalid: "error" === status,
|
|
75
132
|
warning: "warning" === status,
|
|
76
133
|
description: descriptionSlot,
|
|
@@ -87,57 +144,38 @@ function FormItem(t0) {
|
|
|
87
144
|
classNames: classNames,
|
|
88
145
|
styles: styles,
|
|
89
146
|
children: content
|
|
90
|
-
})
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
$[
|
|
102
|
-
$[
|
|
103
|
-
$[
|
|
104
|
-
$[
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
$[17] = valuePropName;
|
|
110
|
-
$[18] = t1;
|
|
111
|
-
} else t1 = $[18];
|
|
112
|
-
const renderShell = t1;
|
|
113
|
-
if (null == name && null == dependencies && null == shouldUpdate) {
|
|
114
|
-
const t2 = children;
|
|
115
|
-
let t3;
|
|
116
|
-
if ($[19] !== renderShell || $[20] !== t2) {
|
|
117
|
-
t3 = renderShell(t2, void 0, null);
|
|
118
|
-
$[19] = renderShell;
|
|
119
|
-
$[20] = t2;
|
|
120
|
-
$[21] = t3;
|
|
121
|
-
} else t3 = $[21];
|
|
122
|
-
return t3;
|
|
123
|
-
}
|
|
124
|
-
const t2 = name ?? void 0;
|
|
125
|
-
let t3;
|
|
126
|
-
if ($[22] !== children || $[23] !== formInstance || $[24] !== name || $[25] !== renderShell) {
|
|
127
|
-
t3 = (control_0, meta_0)=>{
|
|
147
|
+
})
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
if (null == name && null == dependencies && null == shouldUpdate) return renderShell(children, void 0, null);
|
|
151
|
+
const t7 = name ?? void 0;
|
|
152
|
+
let t8;
|
|
153
|
+
if ($[4] !== feedbackId || $[5] !== noStyle || $[6] !== parentFeedback) {
|
|
154
|
+
t8 = noStyle && parentFeedback ? (t9)=>{
|
|
155
|
+
const { errors: errors_1, destroy } = t9;
|
|
156
|
+
return parentFeedback.report(feedbackId, destroy ? [] : errors_1);
|
|
157
|
+
} : void 0;
|
|
158
|
+
$[4] = feedbackId;
|
|
159
|
+
$[5] = noStyle;
|
|
160
|
+
$[6] = parentFeedback;
|
|
161
|
+
$[7] = t8;
|
|
162
|
+
} else t8 = $[7];
|
|
163
|
+
let t9;
|
|
164
|
+
if ($[8] !== children || $[9] !== formInstance || $[10] !== name || $[11] !== renderShell) {
|
|
165
|
+
t9 = (control_0, meta_0)=>{
|
|
128
166
|
const content_0 = "function" == typeof children ? children(control_0, meta_0, formInstance) : children;
|
|
129
167
|
return renderShell(content_0, meta_0, null != name ? control_0 : null);
|
|
130
168
|
};
|
|
131
|
-
$[
|
|
132
|
-
$[
|
|
133
|
-
$[
|
|
134
|
-
$[
|
|
135
|
-
$[
|
|
136
|
-
} else
|
|
137
|
-
let
|
|
138
|
-
if ($[
|
|
139
|
-
|
|
140
|
-
name:
|
|
169
|
+
$[8] = children;
|
|
170
|
+
$[9] = formInstance;
|
|
171
|
+
$[10] = name;
|
|
172
|
+
$[11] = renderShell;
|
|
173
|
+
$[12] = t9;
|
|
174
|
+
} else t9 = $[12];
|
|
175
|
+
let t10;
|
|
176
|
+
if ($[13] !== dependencies || $[14] !== getValueFromEvent || $[15] !== initialValue || $[16] !== messageVariables || $[17] !== normalize || $[18] !== preserve || $[19] !== rules || $[20] !== shouldUpdate || $[21] !== t7 || $[22] !== t8 || $[23] !== t9 || $[24] !== trigger || $[25] !== validateFirst || $[26] !== validateTrigger || $[27] !== valuePropName) {
|
|
177
|
+
t10 = /*#__PURE__*/ jsx(Field, {
|
|
178
|
+
name: t7,
|
|
141
179
|
rules: rules,
|
|
142
180
|
initialValue: initialValue,
|
|
143
181
|
valuePropName: valuePropName,
|
|
@@ -150,24 +188,26 @@ function FormItem(t0) {
|
|
|
150
188
|
preserve: preserve,
|
|
151
189
|
messageVariables: messageVariables,
|
|
152
190
|
validateFirst: validateFirst,
|
|
153
|
-
|
|
191
|
+
onMetaChange: t8,
|
|
192
|
+
children: t9
|
|
154
193
|
});
|
|
155
|
-
$[
|
|
156
|
-
$[
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
159
|
-
$[
|
|
160
|
-
$[
|
|
161
|
-
$[
|
|
162
|
-
$[
|
|
163
|
-
$[
|
|
164
|
-
$[
|
|
165
|
-
$[
|
|
166
|
-
$[
|
|
167
|
-
$[
|
|
168
|
-
$[
|
|
169
|
-
$[
|
|
170
|
-
|
|
171
|
-
|
|
194
|
+
$[13] = dependencies;
|
|
195
|
+
$[14] = getValueFromEvent;
|
|
196
|
+
$[15] = initialValue;
|
|
197
|
+
$[16] = messageVariables;
|
|
198
|
+
$[17] = normalize;
|
|
199
|
+
$[18] = preserve;
|
|
200
|
+
$[19] = rules;
|
|
201
|
+
$[20] = shouldUpdate;
|
|
202
|
+
$[21] = t7;
|
|
203
|
+
$[22] = t8;
|
|
204
|
+
$[23] = t9;
|
|
205
|
+
$[24] = trigger;
|
|
206
|
+
$[25] = validateFirst;
|
|
207
|
+
$[26] = validateTrigger;
|
|
208
|
+
$[27] = valuePropName;
|
|
209
|
+
$[28] = t10;
|
|
210
|
+
} else t10 = $[28];
|
|
211
|
+
return t10;
|
|
172
212
|
}
|
|
173
213
|
export { FormItem };
|
|
@@ -11,6 +11,7 @@ export interface FormFieldViewProps {
|
|
|
11
11
|
htmlFor?: string;
|
|
12
12
|
required?: boolean;
|
|
13
13
|
error?: ReactNode;
|
|
14
|
+
nestedErrors?: Record<string, string[]>;
|
|
14
15
|
invalid?: boolean;
|
|
15
16
|
/** Render the message slot with warning styling instead of error. */
|
|
16
17
|
warning?: boolean;
|
|
@@ -36,4 +37,4 @@ export interface FormFieldViewProps {
|
|
|
36
37
|
* with the aria wiring (describedby/errormessage/invalid/required) applied
|
|
37
38
|
* to the child control. Not part of the public API.
|
|
38
39
|
*/
|
|
39
|
-
export declare function FormFieldView({ formItem, reserveMessage, label, htmlFor, required, error, invalid, warning, description, extra, layout, controlProps, renderControl, children, className, style, classNames, styles, }: FormFieldViewProps): import("react").JSX.Element;
|
|
40
|
+
export declare function FormFieldView({ formItem, reserveMessage, label, htmlFor, required, error, nestedErrors, invalid, warning, description, extra, layout, controlProps, renderControl, children, className, style, classNames, styles, }: FormFieldViewProps): import("react").JSX.Element;
|