@bioturing/components 0.46.4 → 0.47.0
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/base-menu/component.js +19 -21
- package/dist/components/base-menu/component.js.map +1 -1
- package/dist/components/base-menu/index.js +12 -7
- package/dist/components/base-menu/index.js.map +1 -1
- package/dist/components/checkbox/component.d.ts +2 -2
- package/dist/components/checkbox/component.d.ts.map +1 -1
- package/dist/components/checkbox/component.js.map +1 -1
- package/dist/components/choice-list/component.js +12 -12
- package/dist/components/data-table/component.d.ts.map +1 -1
- package/dist/components/data-table/component.js +73 -64
- package/dist/components/data-table/component.js.map +1 -1
- package/dist/components/data-table/components/TableBody.d.ts +1 -1
- package/dist/components/data-table/components/TableBody.d.ts.map +1 -1
- package/dist/components/data-table/components/TableBody.js +62 -53
- package/dist/components/data-table/components/TableBody.js.map +1 -1
- package/dist/components/data-table/components/TableHeader.d.ts +1 -1
- package/dist/components/data-table/components/TableHeader.d.ts.map +1 -1
- package/dist/components/data-table/components/TableHeader.js +46 -46
- package/dist/components/data-table/components/TableHeader.js.map +1 -1
- package/dist/components/data-table/components/TablePagination.d.ts.map +1 -1
- package/dist/components/data-table/components/TablePagination.js +22 -28
- package/dist/components/data-table/components/TablePagination.js.map +1 -1
- package/dist/components/data-table/hooks.d.ts.map +1 -1
- package/dist/components/data-table/hooks.js +15 -14
- package/dist/components/data-table/hooks.js.map +1 -1
- package/dist/components/data-table/style.css +1 -1
- package/dist/components/data-table/types.d.ts +1 -1
- package/dist/components/data-table/types.d.ts.map +1 -1
- package/dist/components/data-table/variant-minimal.css +1 -0
- package/dist/components/data-table/variant-zebra.css +1 -0
- package/dist/components/dialog/Dialog.js +46 -46
- package/dist/components/dialog/Dialog.js.map +1 -1
- package/dist/components/dialog/dialog.css +1 -1
- package/dist/components/form/FormItem/ItemHolder.d.ts +6 -5
- package/dist/components/form/FormItem/ItemHolder.d.ts.map +1 -1
- package/dist/components/form/FormItem/ItemHolder.js +32 -29
- package/dist/components/form/FormItem/ItemHolder.js.map +1 -1
- package/dist/components/form/FormItem/index.d.ts +6 -0
- package/dist/components/form/FormItem/index.d.ts.map +1 -1
- package/dist/components/form/FormItem/index.js +138 -127
- package/dist/components/form/FormItem/index.js.map +1 -1
- package/dist/components/form/FormValidationContext.d.ts +5 -0
- package/dist/components/form/FormValidationContext.d.ts.map +1 -0
- package/dist/components/form/FormValidationContext.js +7 -0
- package/dist/components/form/FormValidationContext.js.map +1 -0
- package/dist/components/form/component.d.ts +6 -1
- package/dist/components/form/component.d.ts.map +1 -1
- package/dist/components/form/component.js +30 -20
- package/dist/components/form/component.js.map +1 -1
- package/dist/components/form/formValidationRule.d.ts +19 -0
- package/dist/components/form/formValidationRule.d.ts.map +1 -0
- package/dist/components/form/formValidationRule.js +22 -0
- package/dist/components/form/formValidationRule.js.map +1 -0
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/form/index.d.ts.map +1 -1
- package/dist/components/form/useFormValidation.d.ts +3 -0
- package/dist/components/form/useFormValidation.d.ts.map +1 -0
- package/dist/components/form/useFormValidation.js +18 -0
- package/dist/components/form/useFormValidation.js.map +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/keyboard-shortcut/component.d.ts +2 -0
- package/dist/components/keyboard-shortcut/component.d.ts.map +1 -1
- package/dist/components/keyboard-shortcut/component.js +69 -49
- package/dist/components/keyboard-shortcut/component.js.map +1 -1
- package/dist/components/modal/Modal.d.ts +1 -1
- package/dist/components/modal/Modal.js +9 -9
- package/dist/components/modal/Modal.js.map +1 -1
- package/dist/components/modal/style.css +1 -1
- package/dist/components/theme-provider/component.d.ts +3 -1
- package/dist/components/theme-provider/component.d.ts.map +1 -1
- package/dist/components/theme-provider/component.js +32 -31
- package/dist/components/theme-provider/component.js.map +1 -1
- package/dist/components/theme-provider/context/index.d.ts +2 -1
- package/dist/components/theme-provider/context/index.d.ts.map +1 -1
- package/dist/components/theme-provider/context/provider.d.ts +2 -3
- package/dist/components/theme-provider/context/provider.d.ts.map +1 -1
- package/dist/components/theme-provider/context/provider.js +13 -6
- package/dist/components/theme-provider/context/provider.js.map +1 -1
- package/dist/components/theme-provider/context/themeStore.d.ts +15 -0
- package/dist/components/theme-provider/context/themeStore.d.ts.map +1 -1
- package/dist/components/theme-provider/context/themeStore.js +10 -9
- package/dist/components/theme-provider/context/themeStore.js.map +1 -1
- package/dist/components/theme-provider/style.css +1 -1
- package/dist/components/tooltip/component.d.ts.map +1 -1
- package/dist/components/tooltip/component.js +23 -12
- package/dist/components/tooltip/component.js.map +1 -1
- package/dist/index.js +286 -275
- package/dist/index.js.map +1 -1
- package/dist/metadata.d.ts +9 -0
- package/dist/metadata.d.ts.map +1 -1
- package/dist/metadata.js +14 -0
- package/dist/metadata.js.map +1 -1
- package/dist/stats.html +1 -1
- package/package.json +6 -6
|
@@ -1,36 +1,38 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import * as
|
|
4
|
-
import { FieldContext as
|
|
5
|
-
import
|
|
6
|
-
import { supportRef as
|
|
7
|
-
import { cloneElement as
|
|
8
|
-
import { devUseWarning as
|
|
9
|
-
import { ConfigContext as
|
|
10
|
-
import
|
|
11
|
-
import { FormContext as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import { toArray as
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
2
|
+
import { jsx as V } from "react/jsx-runtime";
|
|
3
|
+
import * as a from "react";
|
|
4
|
+
import { FieldContext as pe, ListContext as ye, Field as Ce } from "rc-field-form";
|
|
5
|
+
import Ie from "rc-util/es/hooks/useState";
|
|
6
|
+
import { supportRef as Se } from "rc-util/es/ref";
|
|
7
|
+
import { cloneElement as ve } from "antd/es/_util/reactNode";
|
|
8
|
+
import { devUseWarning as we } from "antd/es/_util/warning";
|
|
9
|
+
import { ConfigContext as Fe } from "antd/es/config-provider";
|
|
10
|
+
import be from "antd/es/config-provider/hooks/useCSSVarCls";
|
|
11
|
+
import { FormContext as Pe, NoStyleItemContext as xe } from "antd/es/form/context";
|
|
12
|
+
import Re from "antd/es/form/hooks/useChildren";
|
|
13
|
+
import Ve from "antd/es/form/hooks/useFormItemStatus";
|
|
14
|
+
import Ne from "antd/es/form/hooks/useFrameState";
|
|
15
|
+
import Ee from "antd/es/form/hooks/useItemRef";
|
|
16
|
+
import Ae from "antd/es/form/style";
|
|
17
|
+
import { toArray as j, getFieldId as ke } from "antd/es/form/util";
|
|
18
|
+
import _e from "antd/es/form/FormItem/StatusProvider";
|
|
19
|
+
import je from "./ItemHolder.js";
|
|
20
|
+
import { FormValidationContext as qe } from "../FormValidationContext.js";
|
|
21
|
+
import { useFormValidation as Te } from "../useFormValidation.js";
|
|
22
|
+
import { clsx as Le } from "../../utils/cn.js";
|
|
23
|
+
const Oe = "__SPLIT__";
|
|
24
|
+
function De(r, o) {
|
|
25
|
+
const u = Object.keys(r), y = Object.keys(o);
|
|
26
|
+
return u.length === y.length && u.every((l) => {
|
|
27
|
+
const w = r[l], c = o[l];
|
|
26
28
|
return w === c || typeof w == "function" || typeof c == "function";
|
|
27
29
|
});
|
|
28
30
|
}
|
|
29
|
-
const
|
|
31
|
+
const Me = a.memo(
|
|
30
32
|
({ children: r }) => r,
|
|
31
|
-
(r, o) =>
|
|
33
|
+
(r, o) => De(r.control, o.control) && r.update === o.update && r.childProps.length === o.childProps.length && r.childProps.every((u, y) => u === o.childProps[y])
|
|
32
34
|
);
|
|
33
|
-
function
|
|
35
|
+
function Y() {
|
|
34
36
|
return {
|
|
35
37
|
errors: [],
|
|
36
38
|
warnings: [],
|
|
@@ -40,195 +42,204 @@ function $() {
|
|
|
40
42
|
validated: !1
|
|
41
43
|
};
|
|
42
44
|
}
|
|
43
|
-
function
|
|
45
|
+
function Ke(r) {
|
|
44
46
|
const {
|
|
45
47
|
name: o,
|
|
46
|
-
noStyle:
|
|
48
|
+
noStyle: u,
|
|
47
49
|
className: y,
|
|
48
|
-
dependencies:
|
|
50
|
+
dependencies: l,
|
|
49
51
|
prefixCls: w,
|
|
50
52
|
shouldUpdate: c,
|
|
51
|
-
rules:
|
|
52
|
-
children:
|
|
53
|
-
required:
|
|
54
|
-
label:
|
|
55
|
-
messageVariables:
|
|
56
|
-
trigger:
|
|
57
|
-
validateTrigger:
|
|
58
|
-
hidden:
|
|
59
|
-
help:
|
|
60
|
-
layout:
|
|
53
|
+
rules: F,
|
|
54
|
+
children: G,
|
|
55
|
+
required: q,
|
|
56
|
+
label: T,
|
|
57
|
+
messageVariables: L,
|
|
58
|
+
trigger: O = "onChange",
|
|
59
|
+
validateTrigger: D,
|
|
60
|
+
hidden: J,
|
|
61
|
+
help: N,
|
|
62
|
+
layout: Q,
|
|
61
63
|
// ============ BioTuring Custom: Extract custom props ============
|
|
62
|
-
classNames:
|
|
63
|
-
optionalMark:
|
|
64
|
-
requiredMark:
|
|
65
|
-
labelRender:
|
|
64
|
+
classNames: X,
|
|
65
|
+
optionalMark: Z,
|
|
66
|
+
requiredMark: ee,
|
|
67
|
+
labelRender: te,
|
|
68
|
+
ignoreDefaultRules: b
|
|
66
69
|
// ============ End Custom ============
|
|
67
|
-
} = r, { getPrefixCls:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
} = r, { getPrefixCls: re } = a.useContext(Fe), { name: oe } = a.useContext(Pe), { ignoreDefaultRules: P } = a.useContext(qe), ne = a.useMemo(
|
|
71
|
+
() => P?.length ? b?.length ? [...P, ...b] : P : b,
|
|
72
|
+
[P, b]
|
|
73
|
+
), E = Te(ne), s = Re(G), x = typeof s == "function", M = a.useContext(xe), { validateTrigger: se } = a.useContext(pe), K = D !== void 0 ? D : se, h = o != null, R = re("form", w), U = be(R), [B, ie, ae] = Ae(R, U), d = we("Form.Item");
|
|
74
|
+
process.env.NODE_ENV !== "production" && d(o !== null, "usage", "`null` is passed as `name` property");
|
|
75
|
+
const le = a.useContext(ye), W = a.useRef(null), [$, me] = Ne({}), [p, ue] = Ie(() => Y()), de = (e) => {
|
|
76
|
+
const i = le?.getKey(e.name);
|
|
77
|
+
if (ue(e.destroy ? Y() : e, !0), u && N !== !1 && M) {
|
|
72
78
|
let n = e.name;
|
|
73
79
|
if (e.destroy)
|
|
74
|
-
n =
|
|
80
|
+
n = W.current || n;
|
|
75
81
|
else if (i !== void 0) {
|
|
76
|
-
const [
|
|
77
|
-
n = [
|
|
82
|
+
const [m, f] = i;
|
|
83
|
+
n = [m, ...f], W.current = n;
|
|
78
84
|
}
|
|
79
|
-
|
|
85
|
+
M(e, n);
|
|
80
86
|
}
|
|
81
|
-
},
|
|
82
|
-
|
|
83
|
-
const
|
|
87
|
+
}, ce = (e, i) => {
|
|
88
|
+
me((n) => {
|
|
89
|
+
const m = {
|
|
84
90
|
...n
|
|
85
|
-
},
|
|
86
|
-
return e.destroy ? delete
|
|
91
|
+
}, S = [...e.name.slice(0, -1), ...i].join(Oe);
|
|
92
|
+
return e.destroy ? delete m[S] : m[S] = e, m;
|
|
87
93
|
});
|
|
88
|
-
}, [C,
|
|
89
|
-
const e = [...
|
|
90
|
-
return Object.values(
|
|
94
|
+
}, [C, A] = a.useMemo(() => {
|
|
95
|
+
const e = [...p.errors], i = [...p.warnings];
|
|
96
|
+
return Object.values($).forEach((n) => {
|
|
91
97
|
e.push(...n.errors || []), i.push(...n.warnings || []);
|
|
92
98
|
}), [e, i];
|
|
93
|
-
}, [
|
|
94
|
-
function
|
|
95
|
-
return
|
|
96
|
-
|
|
99
|
+
}, [$, p.errors, p.warnings]), fe = Ee();
|
|
100
|
+
function z(e, i, n) {
|
|
101
|
+
return u && !J ? /* @__PURE__ */ V(
|
|
102
|
+
_e,
|
|
97
103
|
{
|
|
98
|
-
prefixCls:
|
|
104
|
+
prefixCls: R,
|
|
99
105
|
hasFeedback: r.hasFeedback,
|
|
100
106
|
validateStatus: r.validateStatus,
|
|
101
|
-
meta:
|
|
107
|
+
meta: p,
|
|
102
108
|
errors: C,
|
|
103
|
-
warnings:
|
|
109
|
+
warnings: A,
|
|
104
110
|
noStyle: !0,
|
|
105
111
|
name: o,
|
|
106
112
|
children: e
|
|
107
113
|
}
|
|
108
|
-
) : /* @__PURE__ */
|
|
109
|
-
|
|
114
|
+
) : /* @__PURE__ */ V(
|
|
115
|
+
je,
|
|
110
116
|
{
|
|
111
117
|
...r,
|
|
112
|
-
className:
|
|
113
|
-
prefixCls:
|
|
118
|
+
className: Le(y, ae, U, ie),
|
|
119
|
+
prefixCls: R,
|
|
114
120
|
fieldId: i,
|
|
115
121
|
isRequired: n,
|
|
116
122
|
errors: C,
|
|
117
|
-
warnings:
|
|
118
|
-
meta:
|
|
119
|
-
onSubItemMetaChange:
|
|
120
|
-
layout:
|
|
123
|
+
warnings: A,
|
|
124
|
+
meta: p,
|
|
125
|
+
onSubItemMetaChange: ce,
|
|
126
|
+
layout: Q,
|
|
121
127
|
name: o,
|
|
122
|
-
classNames:
|
|
123
|
-
optionalMark:
|
|
124
|
-
requiredMark:
|
|
125
|
-
labelRender:
|
|
128
|
+
classNames: X,
|
|
129
|
+
optionalMark: Z,
|
|
130
|
+
requiredMark: ee,
|
|
131
|
+
labelRender: te,
|
|
126
132
|
children: e
|
|
127
133
|
},
|
|
128
134
|
"row"
|
|
129
135
|
);
|
|
130
136
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
+
const ge = a.useMemo(
|
|
138
|
+
() => E?.length ? [...E, ...F ?? []] : F,
|
|
139
|
+
[F, E]
|
|
140
|
+
);
|
|
141
|
+
if (!h && !x && !l)
|
|
142
|
+
return B(z(s));
|
|
143
|
+
let I = {};
|
|
144
|
+
return typeof T == "string" ? I.label = T : o && (I.label = String(o)), L && (I = { ...I, ...L }), B(
|
|
145
|
+
/* @__PURE__ */ V(
|
|
146
|
+
Ce,
|
|
137
147
|
{
|
|
138
148
|
...r,
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
149
|
+
rules: ge,
|
|
150
|
+
messageVariables: I,
|
|
151
|
+
trigger: O,
|
|
152
|
+
validateTrigger: K,
|
|
153
|
+
onMetaChange: de,
|
|
143
154
|
children: (e, i, n) => {
|
|
144
|
-
const
|
|
155
|
+
const m = j(o).length && i ? i.name : [], f = ke(m, oe), S = q !== void 0 ? q : !!F?.some((t) => {
|
|
145
156
|
if (t && typeof t == "object" && t.required && !t.warningOnly)
|
|
146
157
|
return !0;
|
|
147
158
|
if (typeof t == "function") {
|
|
148
|
-
const
|
|
149
|
-
return
|
|
159
|
+
const _ = t(n);
|
|
160
|
+
return _?.required && !_?.warningOnly;
|
|
150
161
|
}
|
|
151
162
|
return !1;
|
|
152
|
-
}),
|
|
163
|
+
}), k = {
|
|
153
164
|
...e
|
|
154
165
|
};
|
|
155
166
|
let v = null;
|
|
156
|
-
if (
|
|
157
|
-
!(c &&
|
|
167
|
+
if (d(
|
|
168
|
+
!(c && l),
|
|
158
169
|
"usage",
|
|
159
170
|
"`shouldUpdate` and `dependencies` shouldn't be used together. See https://u.ant.design/form-deps."
|
|
160
|
-
), Array.isArray(s) &&
|
|
161
|
-
|
|
171
|
+
), Array.isArray(s) && h)
|
|
172
|
+
d(
|
|
162
173
|
!1,
|
|
163
174
|
"usage",
|
|
164
175
|
"A `Form.Item` with a `name` prop must have a single child element. For information on how to render more complex form items, see https://u.ant.design/complex-form-item."
|
|
165
176
|
), v = s;
|
|
166
|
-
else if (
|
|
167
|
-
|
|
168
|
-
!!(c ||
|
|
177
|
+
else if (x && (!(c || l) || h))
|
|
178
|
+
d(
|
|
179
|
+
!!(c || l),
|
|
169
180
|
"usage",
|
|
170
181
|
"A `Form.Item` with a render function must have either `shouldUpdate` or `dependencies`."
|
|
171
|
-
),
|
|
172
|
-
!
|
|
182
|
+
), d(
|
|
183
|
+
!h,
|
|
173
184
|
"usage",
|
|
174
185
|
"A `Form.Item` with a render function cannot be a field, and thus cannot have a `name` prop."
|
|
175
186
|
);
|
|
176
|
-
else if (
|
|
177
|
-
|
|
187
|
+
else if (l && !x && !h)
|
|
188
|
+
d(
|
|
178
189
|
!1,
|
|
179
190
|
"usage",
|
|
180
191
|
"Must set `name` or use a render function when `dependencies` is set."
|
|
181
192
|
);
|
|
182
|
-
else if (
|
|
183
|
-
|
|
193
|
+
else if (a.isValidElement(s)) {
|
|
194
|
+
d(
|
|
184
195
|
s.props.defaultValue === void 0,
|
|
185
196
|
"usage",
|
|
186
197
|
"`defaultValue` will not work on controlled Field. You should use `initialValues` of Form instead."
|
|
187
198
|
);
|
|
188
199
|
const t = {
|
|
189
200
|
...s.props,
|
|
190
|
-
...
|
|
201
|
+
...k
|
|
191
202
|
};
|
|
192
|
-
if (t.id || (t.id = f),
|
|
203
|
+
if (t.id || (t.id = f), N || C.length > 0 || A.length > 0 || r.extra) {
|
|
193
204
|
const g = [];
|
|
194
|
-
(
|
|
205
|
+
(N || C.length > 0) && g.push(`${f}_help`), r.extra && g.push(`${f}_extra`), t["aria-describedby"] = g.join(" ");
|
|
195
206
|
}
|
|
196
|
-
C.length > 0 && (t["aria-invalid"] = "true"),
|
|
197
|
-
...
|
|
198
|
-
...
|
|
207
|
+
C.length > 0 && (t["aria-invalid"] = "true"), S && (t["aria-required"] = "true"), Se(s) && (t.ref = fe(m, s)), (/* @__PURE__ */ new Set([
|
|
208
|
+
...j(O),
|
|
209
|
+
...j(K)
|
|
199
210
|
])).forEach((g) => {
|
|
200
|
-
t[g] = (...
|
|
201
|
-
|
|
211
|
+
t[g] = (...H) => {
|
|
212
|
+
k[g]?.(...H), s.props[g]?.(...H);
|
|
202
213
|
};
|
|
203
214
|
});
|
|
204
|
-
const
|
|
215
|
+
const he = [
|
|
205
216
|
t["aria-required"],
|
|
206
217
|
t["aria-invalid"],
|
|
207
218
|
t["aria-describedby"]
|
|
208
219
|
];
|
|
209
|
-
v = /* @__PURE__ */
|
|
210
|
-
|
|
220
|
+
v = /* @__PURE__ */ V(
|
|
221
|
+
Me,
|
|
211
222
|
{
|
|
212
|
-
control:
|
|
223
|
+
control: k,
|
|
213
224
|
update: s,
|
|
214
|
-
childProps:
|
|
215
|
-
children:
|
|
225
|
+
childProps: he,
|
|
226
|
+
children: ve(s, t)
|
|
216
227
|
}
|
|
217
228
|
);
|
|
218
|
-
} else
|
|
219
|
-
!
|
|
229
|
+
} else x && (c || l) && !h ? v = s(n) : (d(
|
|
230
|
+
!m.length || !!u,
|
|
220
231
|
"usage",
|
|
221
232
|
"`name` is only used for validate React element. If you are using Form.Item as layout display, please remove `name` instead."
|
|
222
233
|
), v = s);
|
|
223
|
-
return
|
|
234
|
+
return z(v, f, S);
|
|
224
235
|
}
|
|
225
236
|
}
|
|
226
237
|
)
|
|
227
238
|
);
|
|
228
239
|
}
|
|
229
|
-
const
|
|
230
|
-
|
|
240
|
+
const Ue = Ke;
|
|
241
|
+
Ue.useStatus = Ve;
|
|
231
242
|
export {
|
|
232
|
-
|
|
243
|
+
Ue as default
|
|
233
244
|
};
|
|
234
245
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/form/FormItem/index.tsx"],"sourcesContent":["/**\n * This file is copied from Ant Design 5.x-stable\n * Source: https://github.com/ant-design/ant-design/blob/5.x-stable/components/form/FormItem/index.tsx\n * \n * Customizations for @bioturing/components:\n * - Added `classNames` prop for styling sub-elements (root, row, label, control, etc.)\n * - Added `optionalMark` prop to show optional indicator\n * - Added enhanced `requiredMark` support (boolean | ReactNode)\n * - Added `labelRender` prop for custom label rendering\n * \n * Last synced with antd version: 5.x-stable (2025-02-04)\n */\n\n\"use client\";\n\nimport * as React from 'react';\nimport type { JSX } from 'react';\nimport { Field, FieldContext, ListContext } from 'rc-field-form';\nimport type { FieldProps } from 'rc-field-form/lib/Field';\nimport type { InternalNamePath, Meta } from 'rc-field-form/lib/interface';\nimport useState from 'rc-util/es/hooks/useState';\nimport { supportRef } from 'rc-util/es/ref';\n\n// ============ BioTuring Utils ============\nimport { clsx as classNames } from '../../utils';\n\n// ============ Ant Design Imports (from antd/es) ============\nimport { cloneElement } from 'antd/es/_util/reactNode';\nimport { devUseWarning } from 'antd/es/_util/warning';\nimport { ConfigContext } from 'antd/es/config-provider';\nimport useCSSVarCls from 'antd/es/config-provider/hooks/useCSSVarCls';\nimport { FormContext, NoStyleItemContext } from 'antd/es/form/context';\nimport type { FormInstance, FormItemLayout } from 'antd/es/form/Form';\nimport type { FormItemInputProps } from 'antd/es/form/FormItemInput';\nimport type { FormItemLabelProps, LabelTooltipType } from 'antd/es/form/FormItemLabel';\nimport useChildren from 'antd/es/form/hooks/useChildren';\nimport useFormItemStatus from 'antd/es/form/hooks/useFormItemStatus';\nimport useFrameState from 'antd/es/form/hooks/useFrameState';\nimport useItemRef from 'antd/es/form/hooks/useItemRef';\nimport useStyle from 'antd/es/form/style';\nimport { getFieldId, toArray } from 'antd/es/form/util';\nimport StatusProvider from 'antd/es/form/FormItem/StatusProvider';\n\n// ============ BioTuring Custom Imports ============\nimport ItemHolder from './ItemHolder';\nimport type { ItemHolderProps } from './ItemHolder';\n\nconst NAME_SPLIT = '__SPLIT__';\n\ninterface FieldError {\n errors: string[];\n warnings: string[];\n}\n\nconst _ValidateStatuses = ['success', 'warning', 'error', 'validating', ''] as const;\nexport type ValidateStatus = (typeof _ValidateStatuses)[number];\n\ntype RenderChildren<Values = any> = (form: FormInstance<Values>) => React.ReactNode;\ntype RcFieldProps<Values = any> = Omit<FieldProps<Values>, 'children'>;\ntype ChildrenType<Values = any> = RenderChildren<Values> | React.ReactNode;\n\nexport type FeedbackIcons = (itemStatus: {\n status: ValidateStatus;\n errors?: React.ReactNode[];\n warnings?: React.ReactNode[];\n}) => { [key in ValidateStatus]?: React.ReactNode };\n\ninterface MemoInputProps {\n control: object;\n update: any;\n children: React.ReactNode;\n childProps: any[];\n}\n\n// https://github.com/ant-design/ant-design/issues/46417\n// `getValueProps` may modify the value props name,\n// we should check if the control is similar.\nfunction isSimilarControl(a: object, b: object) {\n const keysA = Object.keys(a);\n const keysB = Object.keys(b);\n\n return (\n keysA.length === keysB.length &&\n keysA.every((key) => {\n const propValueA = (a as any)[key];\n const propValueB = (b as any)[key];\n\n return (\n propValueA === propValueB ||\n typeof propValueA === 'function' ||\n typeof propValueB === 'function'\n );\n })\n );\n}\n\nconst MemoInput = React.memo(\n ({ children }: MemoInputProps) => children as JSX.Element,\n (prev, next) =>\n isSimilarControl(prev.control, next.control) &&\n prev.update === next.update &&\n prev.childProps.length === next.childProps.length &&\n prev.childProps.every((value, index) => value === next.childProps[index]),\n);\n\nexport interface FormItemProps<Values = any>\n extends Omit<FormItemLabelProps, 'requiredMark'>,\n FormItemInputProps,\n RcFieldProps<Values> {\n prefixCls?: string;\n noStyle?: boolean;\n style?: React.CSSProperties;\n className?: string;\n rootClassName?: string;\n children?: ChildrenType<Values>;\n id?: string;\n hasFeedback?: boolean | { icons: FeedbackIcons };\n validateStatus?: ValidateStatus;\n required?: boolean;\n hidden?: boolean;\n initialValue?: any;\n messageVariables?: Record<string, string>;\n tooltip?: LabelTooltipType;\n /** @deprecated No need anymore */\n fieldKey?: React.Key | React.Key[];\n layout?: FormItemLayout;\n \n // ============ BioTuring Custom Props ============\n /**\n * Custom class names for different parts of the form item\n * @custom BioTuring addition\n */\n classNames?: {\n /** Class name for the form item root wrapper */\n root?: string;\n /** Class name for the row container */\n row?: string;\n /** Class name for the label column wrapper */\n label?: string;\n /** Class name for the label text element */\n labelText?: string;\n /** Class name for the label tooltip icon */\n labelIcon?: string;\n /** Class name for the control/input wrapper column */\n control?: string;\n /** Class name for the control input wrapper */\n controlInput?: string;\n /** Class name for the control input content */\n controlInputContent?: string;\n /** Class name for the additional wrapper (errors + extra) */\n additional?: string;\n /** Class name for the error/help message wrapper */\n explain?: string;\n /** Class name for the extra text wrapper */\n extra?: string;\n /** Class name for the feedback icon */\n feedbackIcon?: string;\n };\n \n /**\n * Whether to show the optional mark\n * @default false\n * @custom BioTuring addition\n */\n optionalMark?: boolean | React.ReactNode;\n \n /**\n * Custom required mark (enhanced from antd to support ReactNode)\n * @default true\n * @custom BioTuring addition - enhanced to support ReactNode\n */\n requiredMark?: boolean | React.ReactNode;\n \n /**\n * Custom render function for the label\n * @custom BioTuring addition\n */\n labelRender?: (label: React.ReactElement) => React.ReactElement;\n // ============ End Custom Props ============\n}\n\nfunction genEmptyMeta(): Meta {\n return {\n errors: [],\n warnings: [],\n touched: false,\n validating: false,\n name: [],\n validated: false,\n };\n}\n\nfunction InternalFormItem<Values = any>(props: FormItemProps<Values>): React.ReactElement {\n const {\n name,\n noStyle,\n className,\n dependencies,\n prefixCls: customizePrefixCls,\n shouldUpdate,\n rules,\n children,\n required,\n label,\n messageVariables,\n trigger = 'onChange',\n validateTrigger,\n hidden,\n help,\n layout,\n // ============ BioTuring Custom: Extract custom props ============\n classNames: customClassNames,\n optionalMark,\n requiredMark,\n labelRender,\n // ============ End Custom ============\n } = props;\n const { getPrefixCls } = React.useContext(ConfigContext);\n const { name: formName } = React.useContext(FormContext);\n\n const mergedChildren = useChildren(children);\n\n const isRenderProps = typeof mergedChildren === 'function';\n const notifyParentMetaChange = React.useContext(NoStyleItemContext);\n\n const { validateTrigger: contextValidateTrigger } = React.useContext(FieldContext);\n const mergedValidateTrigger =\n validateTrigger !== undefined ? validateTrigger : contextValidateTrigger;\n\n const hasName = !(name === undefined || name === null);\n\n const prefixCls = getPrefixCls('form', customizePrefixCls);\n\n // Style\n const rootCls = useCSSVarCls(prefixCls);\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls, rootCls);\n\n // ========================= Warn =========================\n const warning = devUseWarning('Form.Item');\n\n if (process.env.NODE_ENV !== 'production') {\n warning(name !== null, 'usage', '`null` is passed as `name` property');\n }\n\n // ========================= MISC =========================\n // Get `noStyle` required info\n const listContext = React.useContext(ListContext);\n const fieldKeyPathRef = React.useRef<InternalNamePath>(null);\n\n // ======================== Errors ========================\n // >>>>> Collect sub field errors\n const [subFieldErrors, setSubFieldErrors] = useFrameState<Record<string, FieldError>>({});\n\n // >>>>> Current field errors\n const [meta, setMeta] = useState<Meta>(() => genEmptyMeta());\n\n const onMetaChange = (nextMeta: Meta & { destroy?: boolean }) => {\n // This keyInfo is not correct when field is removed\n // Since origin keyManager no longer keep the origin key anymore\n // Which means we need cache origin one and reuse when removed\n const keyInfo = listContext?.getKey(nextMeta.name);\n\n // Destroy will reset all the meta\n setMeta(nextMeta.destroy ? genEmptyMeta() : nextMeta, true);\n\n // Bump to parent since noStyle\n if (noStyle && help !== false && notifyParentMetaChange) {\n let namePath = nextMeta.name;\n\n if (!nextMeta.destroy) {\n if (keyInfo !== undefined) {\n const [fieldKey, restPath] = keyInfo;\n namePath = [fieldKey, ...restPath];\n fieldKeyPathRef.current = namePath;\n }\n } else {\n // Use origin cache data\n namePath = fieldKeyPathRef.current || namePath;\n }\n notifyParentMetaChange(nextMeta, namePath);\n }\n };\n\n // >>>>> Collect noStyle Field error to the top FormItem\n const onSubItemMetaChange: ItemHolderProps['onSubItemMetaChange'] = (subMeta, uniqueKeys) => {\n // Only `noStyle` sub item will trigger\n setSubFieldErrors((prevSubFieldErrors) => {\n const clone = {\n ...prevSubFieldErrors,\n };\n\n // name: ['user', 1] + key: [4] = ['user', 4]\n const mergedNamePath = [...subMeta.name.slice(0, -1), ...uniqueKeys];\n const mergedNameKey = mergedNamePath.join(NAME_SPLIT);\n\n if ((subMeta as any).destroy) {\n // Remove\n delete clone[mergedNameKey];\n } else {\n // Update\n clone[mergedNameKey] = subMeta;\n }\n\n return clone;\n });\n };\n\n // >>>>> Get merged errors\n const [mergedErrors, mergedWarnings] = React.useMemo(() => {\n const errorList: string[] = [...meta.errors];\n const warningList: string[] = [...meta.warnings];\n\n Object.values(subFieldErrors).forEach((subFieldError) => {\n errorList.push(...(subFieldError.errors || []));\n warningList.push(...(subFieldError.warnings || []));\n });\n\n return [errorList, warningList];\n }, [subFieldErrors, meta.errors, meta.warnings]);\n\n // ===================== Children Ref =====================\n const getItemRef = useItemRef();\n\n // ======================== Render ========================\n function renderLayout(\n baseChildren: React.ReactNode,\n fieldId?: string,\n isRequired?: boolean,\n ): React.ReactNode {\n if (noStyle && !hidden) {\n return (\n <StatusProvider\n prefixCls={prefixCls}\n hasFeedback={props.hasFeedback}\n validateStatus={props.validateStatus}\n meta={meta}\n errors={mergedErrors}\n warnings={mergedWarnings}\n noStyle\n name={name}\n >\n {baseChildren}\n </StatusProvider>\n );\n }\n\n // ============ BioTuring Custom: Pass custom props to ItemHolder ============\n return (\n <ItemHolder\n key=\"row\"\n {...props}\n className={classNames(className, cssVarCls, rootCls, hashId)}\n prefixCls={prefixCls}\n fieldId={fieldId}\n isRequired={isRequired}\n errors={mergedErrors}\n warnings={mergedWarnings}\n meta={meta}\n onSubItemMetaChange={onSubItemMetaChange}\n layout={layout}\n name={name}\n classNames={customClassNames}\n optionalMark={optionalMark}\n requiredMark={requiredMark}\n labelRender={labelRender}\n >\n {baseChildren}\n </ItemHolder>\n );\n // ============ End Custom ============\n }\n\n if (!hasName && !isRenderProps && !dependencies) {\n return wrapCSSVar(renderLayout(mergedChildren) as JSX.Element);\n }\n\n let variables: Record<string, string> = {};\n if (typeof label === 'string') {\n variables.label = label;\n } else if (name) {\n variables.label = String(name);\n }\n if (messageVariables) {\n variables = { ...variables, ...messageVariables };\n }\n\n // >>>>> With Field\n return wrapCSSVar(\n <Field\n {...props}\n messageVariables={variables}\n trigger={trigger}\n validateTrigger={mergedValidateTrigger}\n onMetaChange={onMetaChange}\n >\n {(control, renderMeta, context) => {\n const mergedName = toArray(name).length && renderMeta ? renderMeta.name : [];\n const fieldId = getFieldId(mergedName, formName);\n\n const isRequired =\n required !== undefined\n ? required\n : !!rules?.some((rule) => {\n if (rule && typeof rule === 'object' && rule.required && !rule.warningOnly) {\n return true;\n }\n if (typeof rule === 'function') {\n const ruleEntity = rule(context);\n return ruleEntity?.required && !ruleEntity?.warningOnly;\n }\n return false;\n });\n\n // ======================= Children =======================\n const mergedControl: typeof control = {\n ...control,\n };\n\n let childNode: React.ReactNode = null;\n\n warning(\n !(shouldUpdate && dependencies),\n 'usage',\n \"`shouldUpdate` and `dependencies` shouldn't be used together. See https://u.ant.design/form-deps.\",\n );\n if (Array.isArray(mergedChildren) && hasName) {\n warning(\n false,\n 'usage',\n 'A `Form.Item` with a `name` prop must have a single child element. For information on how to render more complex form items, see https://u.ant.design/complex-form-item.',\n );\n childNode = mergedChildren;\n } else if (isRenderProps && (!(shouldUpdate || dependencies) || hasName)) {\n warning(\n !!(shouldUpdate || dependencies),\n 'usage',\n 'A `Form.Item` with a render function must have either `shouldUpdate` or `dependencies`.',\n );\n warning(\n !hasName,\n 'usage',\n 'A `Form.Item` with a render function cannot be a field, and thus cannot have a `name` prop.',\n );\n } else if (dependencies && !isRenderProps && !hasName) {\n warning(\n false,\n 'usage',\n 'Must set `name` or use a render function when `dependencies` is set.',\n );\n } else if (React.isValidElement<{ defaultValue?: any }>(mergedChildren)) {\n warning(\n mergedChildren.props.defaultValue === undefined,\n 'usage',\n '`defaultValue` will not work on controlled Field. You should use `initialValues` of Form instead.',\n );\n\n const childProps: React.ReactElement<any>['props'] = {\n ...mergedChildren.props,\n ...mergedControl,\n };\n\n if (!childProps.id) {\n childProps.id = fieldId;\n }\n\n if (help || mergedErrors.length > 0 || mergedWarnings.length > 0 || props.extra) {\n const describedbyArr = [];\n if (help || mergedErrors.length > 0) {\n describedbyArr.push(`${fieldId}_help`);\n }\n if (props.extra) {\n describedbyArr.push(`${fieldId}_extra`);\n }\n childProps['aria-describedby'] = describedbyArr.join(' ');\n }\n\n if (mergedErrors.length > 0) {\n childProps['aria-invalid'] = 'true';\n }\n\n if (isRequired) {\n childProps['aria-required'] = 'true';\n }\n\n if (supportRef(mergedChildren)) {\n childProps.ref = getItemRef(mergedName, mergedChildren);\n }\n\n // We should keep user origin event handler\n const triggers = new Set<string>([\n ...toArray(trigger),\n ...toArray(mergedValidateTrigger),\n ]);\n\n triggers.forEach((eventName) => {\n childProps[eventName] = (...args: any[]) => {\n mergedControl[eventName]?.(...args);\n (mergedChildren as React.ReactElement<any>).props[eventName]?.(...args);\n };\n });\n\n // List of props that need to be watched for changes -> if changes are detected in MemoInput -> rerender\n const watchingChildProps = [\n childProps['aria-required'],\n childProps['aria-invalid'],\n childProps['aria-describedby'],\n ];\n\n childNode = (\n <MemoInput\n control={mergedControl}\n update={mergedChildren}\n childProps={watchingChildProps}\n >\n {cloneElement(mergedChildren, childProps)}\n </MemoInput>\n );\n } else if (isRenderProps && (shouldUpdate || dependencies) && !hasName) {\n childNode = mergedChildren(context as any);\n } else {\n warning(\n !mergedName.length || !!noStyle,\n 'usage',\n '`name` is only used for validate React element. If you are using Form.Item as layout display, please remove `name` instead.',\n );\n childNode = mergedChildren as React.ReactNode;\n }\n\n return renderLayout(childNode, fieldId, isRequired);\n }}\n </Field>,\n );\n}\n\ntype InternalFormItemType = typeof InternalFormItem;\n\ntype CompoundedComponent = InternalFormItemType & {\n useStatus: typeof useFormItemStatus;\n};\n\nconst FormItem = InternalFormItem as CompoundedComponent;\nFormItem.useStatus = useFormItemStatus;\n\nexport default FormItem;\n"],"names":["NAME_SPLIT","isSimilarControl","a","b","keysA","keysB","key","propValueA","propValueB","MemoInput","React","children","prev","next","value","index","genEmptyMeta","InternalFormItem","props","name","noStyle","className","dependencies","customizePrefixCls","shouldUpdate","rules","required","label","messageVariables","trigger","validateTrigger","hidden","help","layout","customClassNames","optionalMark","requiredMark","labelRender","getPrefixCls","ConfigContext","formName","FormContext","mergedChildren","useChildren","isRenderProps","notifyParentMetaChange","NoStyleItemContext","contextValidateTrigger","FieldContext","mergedValidateTrigger","hasName","prefixCls","rootCls","useCSSVarCls","wrapCSSVar","hashId","cssVarCls","useStyle","warning","devUseWarning","listContext","ListContext","fieldKeyPathRef","subFieldErrors","setSubFieldErrors","useFrameState","meta","setMeta","useState","onMetaChange","nextMeta","keyInfo","namePath","fieldKey","restPath","onSubItemMetaChange","subMeta","uniqueKeys","prevSubFieldErrors","clone","mergedNameKey","mergedErrors","mergedWarnings","errorList","warningList","subFieldError","getItemRef","useItemRef","renderLayout","baseChildren","fieldId","isRequired","jsx","StatusProvider","ItemHolder","classNames","variables","Field","control","renderMeta","context","mergedName","toArray","getFieldId","rule","ruleEntity","mergedControl","childNode","childProps","describedbyArr","supportRef","eventName","args","watchingChildProps","cloneElement","FormItem","useFormItemStatus"],"mappings":";;;;;;;;;;;;;;;;;;;;AA+CA,MAAMA,KAAa;AA8BnB,SAASC,GAAiBC,GAAWC,GAAW;AAC9C,QAAMC,IAAQ,OAAO,KAAKF,CAAC,GACrBG,IAAQ,OAAO,KAAKF,CAAC;AAE3B,SACEC,EAAM,WAAWC,EAAM,UACvBD,EAAM,MAAM,CAACE,MAAQ;AACnB,UAAMC,IAAcL,EAAUI,CAAG,GAC3BE,IAAcL,EAAUG,CAAG;AAEjC,WACEC,MAAeC,KACf,OAAOD,KAAe,cACtB,OAAOC,KAAe;AAAA,EAE1B,CAAC;AAEL;AAEA,MAAMC,KAAYC,EAAM;AAAA,EACtB,CAAC,EAAE,UAAAC,EAAA,MAA+BA;AAAA,EAClC,CAACC,GAAMC,MACLZ,GAAiBW,EAAK,SAASC,EAAK,OAAO,KAC3CD,EAAK,WAAWC,EAAK,UACrBD,EAAK,WAAW,WAAWC,EAAK,WAAW,UAC3CD,EAAK,WAAW,MAAM,CAACE,GAAOC,MAAUD,MAAUD,EAAK,WAAWE,CAAK,CAAC;AAC5E;AA8EA,SAASC,IAAqB;AAC5B,SAAO;AAAA,IACL,QAAQ,CAAA;AAAA,IACR,UAAU,CAAA;AAAA,IACV,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,MAAM,CAAA;AAAA,IACN,WAAW;AAAA,EAAA;AAEf;AAEA,SAASC,GAA+BC,GAA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A;AAAA,IAAA;AAAA,EACF;AAEJ;AAQA,MAAMwB,KAAWlG;AACjBkG,GAAS,YAAYC;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/form/FormItem/index.tsx"],"sourcesContent":["/**\n * This file is copied from Ant Design 5.x-stable\n * Source: https://github.com/ant-design/ant-design/blob/5.x-stable/components/form/FormItem/index.tsx\n * \n * Customizations for @bioturing/components:\n * - Added `classNames` prop for styling sub-elements (root, row, label, control, etc.)\n * - Added `optionalMark` prop to show optional indicator\n * - Added enhanced `requiredMark` support (boolean | ReactNode)\n * - Added `labelRender` prop for custom label rendering\n * \n * Last synced with antd version: 5.x-stable (2025-02-04)\n */\n\n\"use client\";\n\nimport * as React from 'react';\nimport type { JSX } from 'react';\nimport { Field, FieldContext, ListContext } from 'rc-field-form';\nimport type { FieldProps } from 'rc-field-form/lib/Field';\nimport type { InternalNamePath, Meta } from 'rc-field-form/lib/interface';\nimport useState from 'rc-util/es/hooks/useState';\nimport { supportRef } from 'rc-util/es/ref';\n\n// ============ BioTuring Utils ============\nimport { clsx as classNames } from '../../utils';\n\n// ============ Ant Design Imports (from antd/es) ============\nimport { cloneElement } from 'antd/es/_util/reactNode';\nimport { devUseWarning } from 'antd/es/_util/warning';\nimport { ConfigContext } from 'antd/es/config-provider';\nimport useCSSVarCls from 'antd/es/config-provider/hooks/useCSSVarCls';\nimport { FormContext, NoStyleItemContext } from 'antd/es/form/context';\nimport type { FormInstance, FormItemLayout } from 'antd/es/form/Form';\nimport type { FormItemInputProps } from 'antd/es/form/FormItemInput';\nimport type { FormItemLabelProps, LabelTooltipType } from 'antd/es/form/FormItemLabel';\nimport useChildren from 'antd/es/form/hooks/useChildren';\nimport useFormItemStatus from 'antd/es/form/hooks/useFormItemStatus';\nimport useFrameState from 'antd/es/form/hooks/useFrameState';\nimport useItemRef from 'antd/es/form/hooks/useItemRef';\nimport useStyle from 'antd/es/form/style';\nimport { getFieldId, toArray } from 'antd/es/form/util';\nimport StatusProvider from 'antd/es/form/FormItem/StatusProvider';\n\n// ============ BioTuring Custom Imports ============\nimport ItemHolder from './ItemHolder';\nimport type { ItemHolderProps } from './ItemHolder';\nimport { FormValidationContext } from '../FormValidationContext';\nimport { useFormValidation } from '../useFormValidation';\n\nconst NAME_SPLIT = '__SPLIT__';\n\ninterface FieldError {\n errors: string[];\n warnings: string[];\n}\n\nconst _ValidateStatuses = ['success', 'warning', 'error', 'validating', ''] as const;\nexport type ValidateStatus = (typeof _ValidateStatuses)[number];\n\ntype RenderChildren<Values = any> = (form: FormInstance<Values>) => React.ReactNode;\ntype RcFieldProps<Values = any> = Omit<FieldProps<Values>, 'children'>;\ntype ChildrenType<Values = any> = RenderChildren<Values> | React.ReactNode;\n\nexport type FeedbackIcons = (itemStatus: {\n status: ValidateStatus;\n errors?: React.ReactNode[];\n warnings?: React.ReactNode[];\n}) => { [key in ValidateStatus]?: React.ReactNode };\n\ninterface MemoInputProps {\n control: object;\n update: any;\n children: React.ReactNode;\n childProps: any[];\n}\n\n// https://github.com/ant-design/ant-design/issues/46417\n// `getValueProps` may modify the value props name,\n// we should check if the control is similar.\nfunction isSimilarControl(a: object, b: object) {\n const keysA = Object.keys(a);\n const keysB = Object.keys(b);\n\n return (\n keysA.length === keysB.length &&\n keysA.every((key) => {\n const propValueA = (a as any)[key];\n const propValueB = (b as any)[key];\n\n return (\n propValueA === propValueB ||\n typeof propValueA === 'function' ||\n typeof propValueB === 'function'\n );\n })\n );\n}\n\nconst MemoInput = React.memo(\n ({ children }: MemoInputProps) => children as JSX.Element,\n (prev, next) =>\n isSimilarControl(prev.control, next.control) &&\n prev.update === next.update &&\n prev.childProps.length === next.childProps.length &&\n prev.childProps.every((value, index) => value === next.childProps[index]),\n);\n\nexport interface FormItemProps<Values = any>\n extends Omit<FormItemLabelProps, 'requiredMark'>,\n FormItemInputProps,\n RcFieldProps<Values> {\n prefixCls?: string;\n noStyle?: boolean;\n style?: React.CSSProperties;\n className?: string;\n rootClassName?: string;\n children?: ChildrenType<Values>;\n id?: string;\n hasFeedback?: boolean | { icons: FeedbackIcons };\n validateStatus?: ValidateStatus;\n required?: boolean;\n hidden?: boolean;\n initialValue?: any;\n messageVariables?: Record<string, string>;\n tooltip?: LabelTooltipType;\n /** @deprecated No need anymore */\n fieldKey?: React.Key | React.Key[];\n layout?: FormItemLayout;\n \n // ============ BioTuring Custom Props ============\n /**\n * Custom class names for different parts of the form item\n * @custom BioTuring addition\n */\n classNames?: {\n /** Class name for the form item root wrapper */\n root?: string;\n /** Class name for the row container */\n row?: string;\n /** Class name for the label column wrapper */\n label?: string;\n /** Class name for the label text element */\n labelText?: string;\n /** Class name for the label tooltip icon */\n labelIcon?: string;\n /** Class name for the control/input wrapper column */\n control?: string;\n /** Class name for the control input wrapper */\n controlInput?: string;\n /** Class name for the control input content */\n controlInputContent?: string;\n /** Class name for the additional wrapper (errors + extra) */\n additional?: string;\n /** Class name for the error/help message wrapper */\n explain?: string;\n /** Class name for the extra text wrapper */\n extra?: string;\n /** Class name for the feedback icon */\n feedbackIcon?: string;\n };\n \n /**\n * Whether to show the optional mark\n * @default false\n * @custom BioTuring addition\n */\n optionalMark?: boolean | React.ReactNode;\n \n /**\n * Custom required mark (enhanced from antd to support ReactNode)\n * @default true\n * @custom BioTuring addition - enhanced to support ReactNode\n */\n requiredMark?: boolean | React.ReactNode;\n \n /**\n * Custom render function for the label\n * @custom BioTuring addition\n */\n labelRender?: (label: React.ReactElement) => React.ReactElement;\n\n /**\n * Rule keys to ignore from `componentConfig.formValidation`. Use `BLOCKED_CHARS_KEY` to skip blocked characters validation.\n * @default undefined\n * @custom BioTuring addition\n */\n ignoreDefaultRules?: string[];\n // ============ End Custom Props ============\n}\n\nfunction genEmptyMeta(): Meta {\n return {\n errors: [],\n warnings: [],\n touched: false,\n validating: false,\n name: [],\n validated: false,\n };\n}\n\nfunction InternalFormItem<Values = any>(props: FormItemProps<Values>): React.ReactElement {\n const {\n name,\n noStyle,\n className,\n dependencies,\n prefixCls: customizePrefixCls,\n shouldUpdate,\n rules,\n children,\n required,\n label,\n messageVariables,\n trigger = 'onChange',\n validateTrigger,\n hidden,\n help,\n layout,\n // ============ BioTuring Custom: Extract custom props ============\n classNames: customClassNames,\n optionalMark,\n requiredMark,\n labelRender,\n ignoreDefaultRules,\n // ============ End Custom ============\n } = props;\n const { getPrefixCls } = React.useContext(ConfigContext);\n const { name: formName } = React.useContext(FormContext);\n const { ignoreDefaultRules: formIgnoreDefaultRules } = React.useContext(FormValidationContext);\n const mergedIgnoreDefaultRules = React.useMemo(\n () => {\n if (!formIgnoreDefaultRules?.length) return ignoreDefaultRules;\n if (!ignoreDefaultRules?.length) return formIgnoreDefaultRules;\n return [...formIgnoreDefaultRules, ...ignoreDefaultRules];\n },\n [formIgnoreDefaultRules, ignoreDefaultRules],\n );\n const validationRules = useFormValidation(mergedIgnoreDefaultRules);\n\n const mergedChildren = useChildren(children);\n\n const isRenderProps = typeof mergedChildren === 'function';\n const notifyParentMetaChange = React.useContext(NoStyleItemContext);\n\n const { validateTrigger: contextValidateTrigger } = React.useContext(FieldContext);\n const mergedValidateTrigger =\n validateTrigger !== undefined ? validateTrigger : contextValidateTrigger;\n\n const hasName = !(name === undefined || name === null);\n\n const prefixCls = getPrefixCls('form', customizePrefixCls);\n\n // Style\n const rootCls = useCSSVarCls(prefixCls);\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls, rootCls);\n\n // ========================= Warn =========================\n const warning = devUseWarning('Form.Item');\n\n if (process.env.NODE_ENV !== 'production') {\n warning(name !== null, 'usage', '`null` is passed as `name` property');\n }\n\n // ========================= MISC =========================\n // Get `noStyle` required info\n const listContext = React.useContext(ListContext);\n const fieldKeyPathRef = React.useRef<InternalNamePath>(null);\n\n // ======================== Errors ========================\n // >>>>> Collect sub field errors\n const [subFieldErrors, setSubFieldErrors] = useFrameState<Record<string, FieldError>>({});\n\n // >>>>> Current field errors\n const [meta, setMeta] = useState<Meta>(() => genEmptyMeta());\n\n const onMetaChange = (nextMeta: Meta & { destroy?: boolean }) => {\n // This keyInfo is not correct when field is removed\n // Since origin keyManager no longer keep the origin key anymore\n // Which means we need cache origin one and reuse when removed\n const keyInfo = listContext?.getKey(nextMeta.name);\n\n // Destroy will reset all the meta\n setMeta(nextMeta.destroy ? genEmptyMeta() : nextMeta, true);\n\n // Bump to parent since noStyle\n if (noStyle && help !== false && notifyParentMetaChange) {\n let namePath = nextMeta.name;\n\n if (!nextMeta.destroy) {\n if (keyInfo !== undefined) {\n const [fieldKey, restPath] = keyInfo;\n namePath = [fieldKey, ...restPath];\n fieldKeyPathRef.current = namePath;\n }\n } else {\n // Use origin cache data\n namePath = fieldKeyPathRef.current || namePath;\n }\n notifyParentMetaChange(nextMeta, namePath);\n }\n };\n\n // >>>>> Collect noStyle Field error to the top FormItem\n const onSubItemMetaChange: ItemHolderProps['onSubItemMetaChange'] = (subMeta, uniqueKeys) => {\n // Only `noStyle` sub item will trigger\n setSubFieldErrors((prevSubFieldErrors) => {\n const clone = {\n ...prevSubFieldErrors,\n };\n\n // name: ['user', 1] + key: [4] = ['user', 4]\n const mergedNamePath = [...subMeta.name.slice(0, -1), ...uniqueKeys];\n const mergedNameKey = mergedNamePath.join(NAME_SPLIT);\n\n if ((subMeta as any).destroy) {\n // Remove\n delete clone[mergedNameKey];\n } else {\n // Update\n clone[mergedNameKey] = subMeta;\n }\n\n return clone;\n });\n };\n\n // >>>>> Get merged errors\n const [mergedErrors, mergedWarnings] = React.useMemo(() => {\n const errorList: string[] = [...meta.errors];\n const warningList: string[] = [...meta.warnings];\n\n Object.values(subFieldErrors).forEach((subFieldError) => {\n errorList.push(...(subFieldError.errors || []));\n warningList.push(...(subFieldError.warnings || []));\n });\n\n return [errorList, warningList];\n }, [subFieldErrors, meta.errors, meta.warnings]);\n\n // ===================== Children Ref =====================\n const getItemRef = useItemRef();\n\n // ======================== Render ========================\n function renderLayout(\n baseChildren: React.ReactNode,\n fieldId?: string,\n isRequired?: boolean,\n ): React.ReactNode {\n if (noStyle && !hidden) {\n return (\n <StatusProvider\n prefixCls={prefixCls}\n hasFeedback={props.hasFeedback}\n validateStatus={props.validateStatus}\n meta={meta}\n errors={mergedErrors}\n warnings={mergedWarnings}\n noStyle\n name={name}\n >\n {baseChildren}\n </StatusProvider>\n );\n }\n\n // ============ BioTuring Custom: Pass custom props to ItemHolder ============\n return (\n <ItemHolder\n key=\"row\"\n {...props}\n className={classNames(className, cssVarCls, rootCls, hashId)}\n prefixCls={prefixCls}\n fieldId={fieldId}\n isRequired={isRequired}\n errors={mergedErrors}\n warnings={mergedWarnings}\n meta={meta}\n onSubItemMetaChange={onSubItemMetaChange}\n layout={layout}\n name={name}\n classNames={customClassNames}\n optionalMark={optionalMark}\n requiredMark={requiredMark}\n labelRender={labelRender}\n >\n {baseChildren}\n </ItemHolder>\n );\n // ============ End Custom ============\n }\n\n // >>>>> With Field\n const mergedRules = React.useMemo(\n () => (validationRules?.length\n ? [...validationRules, ...(rules ?? [])]\n : rules),\n [rules, validationRules],\n );\n\n if (!hasName && !isRenderProps && !dependencies) {\n return wrapCSSVar(renderLayout(mergedChildren) as JSX.Element);\n }\n\n let variables: Record<string, string> = {};\n if (typeof label === 'string') {\n variables.label = label;\n } else if (name) {\n variables.label = String(name);\n }\n if (messageVariables) {\n variables = { ...variables, ...messageVariables };\n }\n\n return wrapCSSVar(\n <Field\n {...props}\n rules={mergedRules}\n messageVariables={variables}\n trigger={trigger}\n validateTrigger={mergedValidateTrigger}\n onMetaChange={onMetaChange}\n >\n {(control, renderMeta, context) => {\n const mergedName = toArray(name).length && renderMeta ? renderMeta.name : [];\n const fieldId = getFieldId(mergedName, formName);\n\n const isRequired =\n required !== undefined\n ? required\n : !!rules?.some((rule) => {\n if (rule && typeof rule === 'object' && rule.required && !rule.warningOnly) {\n return true;\n }\n if (typeof rule === 'function') {\n const ruleEntity = rule(context);\n return ruleEntity?.required && !ruleEntity?.warningOnly;\n }\n return false;\n });\n\n // ======================= Children =======================\n const mergedControl: typeof control = {\n ...control,\n };\n\n let childNode: React.ReactNode = null;\n\n warning(\n !(shouldUpdate && dependencies),\n 'usage',\n \"`shouldUpdate` and `dependencies` shouldn't be used together. See https://u.ant.design/form-deps.\",\n );\n if (Array.isArray(mergedChildren) && hasName) {\n warning(\n false,\n 'usage',\n 'A `Form.Item` with a `name` prop must have a single child element. For information on how to render more complex form items, see https://u.ant.design/complex-form-item.',\n );\n childNode = mergedChildren;\n } else if (isRenderProps && (!(shouldUpdate || dependencies) || hasName)) {\n warning(\n !!(shouldUpdate || dependencies),\n 'usage',\n 'A `Form.Item` with a render function must have either `shouldUpdate` or `dependencies`.',\n );\n warning(\n !hasName,\n 'usage',\n 'A `Form.Item` with a render function cannot be a field, and thus cannot have a `name` prop.',\n );\n } else if (dependencies && !isRenderProps && !hasName) {\n warning(\n false,\n 'usage',\n 'Must set `name` or use a render function when `dependencies` is set.',\n );\n } else if (React.isValidElement<{ defaultValue?: any }>(mergedChildren)) {\n warning(\n mergedChildren.props.defaultValue === undefined,\n 'usage',\n '`defaultValue` will not work on controlled Field. You should use `initialValues` of Form instead.',\n );\n\n const childProps: React.ReactElement<any>['props'] = {\n ...mergedChildren.props,\n ...mergedControl,\n };\n\n if (!childProps.id) {\n childProps.id = fieldId;\n }\n\n if (help || mergedErrors.length > 0 || mergedWarnings.length > 0 || props.extra) {\n const describedbyArr = [];\n if (help || mergedErrors.length > 0) {\n describedbyArr.push(`${fieldId}_help`);\n }\n if (props.extra) {\n describedbyArr.push(`${fieldId}_extra`);\n }\n childProps['aria-describedby'] = describedbyArr.join(' ');\n }\n\n if (mergedErrors.length > 0) {\n childProps['aria-invalid'] = 'true';\n }\n\n if (isRequired) {\n childProps['aria-required'] = 'true';\n }\n\n if (supportRef(mergedChildren)) {\n childProps.ref = getItemRef(mergedName, mergedChildren);\n }\n\n // We should keep user origin event handler\n const triggers = new Set<string>([\n ...toArray(trigger),\n ...toArray(mergedValidateTrigger),\n ]);\n\n triggers.forEach((eventName) => {\n childProps[eventName] = (...args: any[]) => {\n mergedControl[eventName]?.(...args);\n (mergedChildren as React.ReactElement<any>).props[eventName]?.(...args);\n };\n });\n\n // List of props that need to be watched for changes -> if changes are detected in MemoInput -> rerender\n const watchingChildProps = [\n childProps['aria-required'],\n childProps['aria-invalid'],\n childProps['aria-describedby'],\n ];\n\n childNode = (\n <MemoInput\n control={mergedControl}\n update={mergedChildren}\n childProps={watchingChildProps}\n >\n {cloneElement(mergedChildren, childProps)}\n </MemoInput>\n );\n } else if (isRenderProps && (shouldUpdate || dependencies) && !hasName) {\n childNode = mergedChildren(context as any);\n } else {\n warning(\n !mergedName.length || !!noStyle,\n 'usage',\n '`name` is only used for validate React element. If you are using Form.Item as layout display, please remove `name` instead.',\n );\n childNode = mergedChildren as React.ReactNode;\n }\n\n return renderLayout(childNode, fieldId, isRequired);\n }}\n </Field>,\n );\n}\n\ntype InternalFormItemType = typeof InternalFormItem;\n\ntype CompoundedComponent = InternalFormItemType & {\n useStatus: typeof useFormItemStatus;\n};\n\nconst FormItem = InternalFormItem as CompoundedComponent;\nFormItem.useStatus = useFormItemStatus;\n\nexport default FormItem;\n"],"names":["NAME_SPLIT","isSimilarControl","a","b","keysA","keysB","key","propValueA","propValueB","MemoInput","React","children","prev","next","value","index","genEmptyMeta","InternalFormItem","props","name","noStyle","className","dependencies","customizePrefixCls","shouldUpdate","rules","required","label","messageVariables","trigger","validateTrigger","hidden","help","layout","customClassNames","optionalMark","requiredMark","labelRender","ignoreDefaultRules","getPrefixCls","ConfigContext","formName","FormContext","formIgnoreDefaultRules","FormValidationContext","mergedIgnoreDefaultRules","validationRules","useFormValidation","mergedChildren","useChildren","isRenderProps","notifyParentMetaChange","NoStyleItemContext","contextValidateTrigger","FieldContext","mergedValidateTrigger","hasName","prefixCls","rootCls","useCSSVarCls","wrapCSSVar","hashId","cssVarCls","useStyle","warning","devUseWarning","listContext","ListContext","fieldKeyPathRef","subFieldErrors","setSubFieldErrors","useFrameState","meta","setMeta","useState","onMetaChange","nextMeta","keyInfo","namePath","fieldKey","restPath","onSubItemMetaChange","subMeta","uniqueKeys","prevSubFieldErrors","clone","mergedNameKey","mergedErrors","mergedWarnings","errorList","warningList","subFieldError","getItemRef","useItemRef","renderLayout","baseChildren","fieldId","isRequired","jsx","StatusProvider","ItemHolder","classNames","mergedRules","variables","Field","control","renderMeta","context","mergedName","toArray","getFieldId","rule","ruleEntity","mergedControl","childNode","childProps","describedbyArr","supportRef","eventName","args","watchingChildProps","cloneElement","FormItem","useFormItemStatus"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiDA,MAAMA,KAAa;AA8BnB,SAASC,GAAiBC,GAAWC,GAAW;AAC9C,QAAMC,IAAQ,OAAO,KAAKF,CAAC,GACrBG,IAAQ,OAAO,KAAKF,CAAC;AAE3B,SACEC,EAAM,WAAWC,EAAM,UACvBD,EAAM,MAAM,CAACE,MAAQ;AACnB,UAAMC,IAAcL,EAAUI,CAAG,GAC3BE,IAAcL,EAAUG,CAAG;AAEjC,WACEC,MAAeC,KACf,OAAOD,KAAe,cACtB,OAAOC,KAAe;AAAA,EAE1B,CAAC;AAEL;AAEA,MAAMC,KAAYC,EAAM;AAAA,EACtB,CAAC,EAAE,UAAAC,EAAA,MAA+BA;AAAA,EAClC,CAACC,GAAMC,MACLZ,GAAiBW,EAAK,SAASC,EAAK,OAAO,KAC3CD,EAAK,WAAWC,EAAK,UACrBD,EAAK,WAAW,WAAWC,EAAK,WAAW,UAC3CD,EAAK,WAAW,MAAM,CAACE,GAAOC,MAAUD,MAAUD,EAAK,WAAWE,CAAK,CAAC;AAC5E;AAqFA,SAASC,IAAqB;AAC5B,SAAO;AAAA,IACL,QAAQ,CAAA;AAAA,IACR,UAAU,CAAA;AAAA,IACV,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,MAAM,CAAA;AAAA,IACN,WAAW;AAAA,EAAA;AAEf;AAEA,SAASC,GAA+BC,GAAkD;AACxF,QAAM;AAAA,IACJ,MAAAC;AAAA,IACA,SAAAC;AA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cAACzF;AAAA,cAAA;AAAA,gBACC,SAASwG;AAAA,gBACT,QAAQjE;AAAA,gBACR,YAAYwE;AAAA,gBAEX,UAAAC,GAAazE,GAAgBmE,CAAU;AAAA,cAAA;AAAA,YAAA;AAAA,UAG9C,MAAA,CAAWjE,MAAkB1B,KAAgBF,MAAiB,CAACkC,IAC7D0D,IAAYlE,EAAe2D,CAAc,KAEzC3C;AAAA,YACE,CAAC4C,EAAW,UAAU,CAAC,CAACxF;AAAA,YACxB;AAAA,YACA;AAAA,UAAA,GAEF8F,IAAYlE;AAGd,iBAAO8C,EAAaoB,GAAWlB,GAASC,CAAU;AAAA,QACpD;AAAA,MAAA;AAAA,IAAA;AAAA,EACF;AAEJ;AAQA,MAAMyB,KAAWzG;AACjByG,GAAS,YAAYC;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormValidationContext.d.ts","sourceRoot":"","sources":["../../../src/components/form/FormValidationContext.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,0BAA0B;IACzC,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED,eAAO,MAAM,qBAAqB,qDAAgD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormValidationContext.js","sources":["../../../src/components/form/FormValidationContext.ts"],"sourcesContent":["\"use client\";\n\nimport { createContext } from \"react\";\n\nexport interface FormValidationContextValue {\n ignoreDefaultRules?: string[];\n}\n\nexport const FormValidationContext = createContext<FormValidationContextValue>({});\n"],"names":["FormValidationContext","createContext"],"mappings":";;AAQO,MAAMA,IAAwBC,EAA0C,CAAA,CAAE;"}
|
|
@@ -3,10 +3,15 @@ import { default as useFormInstance } from 'antd/es/form/hooks/useFormInstance';
|
|
|
3
3
|
import { FormItemProps } from './item';
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
export interface FormProps<Values = unknown> extends AntdFormProps<Values> {
|
|
6
|
+
/**
|
|
7
|
+
* Rule keys to ignore from `componentConfig.formValidationRules` for every Form.Item in this Form.
|
|
8
|
+
*/
|
|
9
|
+
ignoreDefaultRules?: string[];
|
|
6
10
|
}
|
|
7
11
|
interface InternalFormProps<Values = unknown> extends React.ComponentProps<typeof AntdInternalForm<Values>> {
|
|
12
|
+
ignoreDefaultRules?: string[];
|
|
8
13
|
}
|
|
9
|
-
export declare const Form: (<Values = unknown>({ ...rest }: InternalFormProps<Values>) => import("react/jsx-runtime").JSX.Element) & {
|
|
14
|
+
export declare const Form: (<Values = unknown>({ ignoreDefaultRules, ...rest }: InternalFormProps<Values>) => import("react/jsx-runtime").JSX.Element) & {
|
|
10
15
|
useForm: typeof useForm;
|
|
11
16
|
useFormInstance: typeof useFormInstance;
|
|
12
17
|
useWatch: typeof useWatch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/form/component.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,SAAS,IAAI,aAAa,EAC1B,OAAO,IAAI,gBAAgB,EAC3B,OAAO,EACP,QAAQ,EACT,MAAM,mBAAmB,CAAC;AAG3B,OAAO,eAAe,MAAM,oCAAoC,CAAC;AACjE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/form/component.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,SAAS,IAAI,aAAa,EAC1B,OAAO,IAAI,gBAAgB,EAC3B,OAAO,EACP,QAAQ,EACT,MAAM,mBAAmB,CAAC;AAG3B,OAAO,eAAe,MAAM,oCAAoC,CAAC;AACjE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,QAAQ,CAAC;AAItD,OAAO,aAAa,CAAC;AAErB,MAAM,WAAW,SAAS,CAAC,MAAM,GAAG,OAAO,CAAE,SAAQ,aAAa,CAAC,MAAM,CAAC;IACxE;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED,UAAU,iBAAiB,CAAC,MAAM,GAAG,OAAO,CAAE,SAAQ,KAAK,CAAC,cAAc,CACxE,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAChC;IACC,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAoBD,eAAO,MAAM,IAAI,IAlBK,MAAM,6CAGzB,iBAAiB,CAAC,MAAM,CAAC;;;;;;kBA9BxB,CAAC;;;;;;;;;WAyD4kC,CAAC;;CAHhlC,CAAC;AAEH,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1,26 +1,36 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { FormProvider as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
2
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import e from "antd/es/form/ErrorList";
|
|
4
|
+
import n, { useWatch as s, useForm as a } from "antd/es/form/Form";
|
|
5
|
+
import p from "antd/es/form/FormList";
|
|
6
|
+
import { FormProvider as c } from "antd/es/form/context";
|
|
7
|
+
import F from "antd/es/form/hooks/useFormInstance";
|
|
8
|
+
import * as f from "react";
|
|
9
|
+
import { FormValidationContext as d } from "./FormValidationContext.js";
|
|
10
|
+
import { FormLabel as l } from "./label.js";
|
|
9
11
|
import './style.css';/* empty css */
|
|
10
|
-
import
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Provider: n,
|
|
21
|
-
|
|
12
|
+
import u from "./FormItem/index.js";
|
|
13
|
+
const v = ({
|
|
14
|
+
ignoreDefaultRules: o,
|
|
15
|
+
...t
|
|
16
|
+
}) => {
|
|
17
|
+
const m = o?.join(","), i = f.useMemo(
|
|
18
|
+
() => ({ ignoreDefaultRules: o }),
|
|
19
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
20
|
+
[m]
|
|
21
|
+
);
|
|
22
|
+
return /* @__PURE__ */ r(d.Provider, { value: i, children: /* @__PURE__ */ r(n, { ...t }) });
|
|
23
|
+
}, A = Object.assign(v, {
|
|
24
|
+
useForm: a,
|
|
25
|
+
useFormInstance: F,
|
|
26
|
+
useWatch: s,
|
|
27
|
+
Item: u,
|
|
28
|
+
List: p,
|
|
29
|
+
ErrorList: e,
|
|
30
|
+
Provider: c,
|
|
31
|
+
Label: l
|
|
22
32
|
});
|
|
23
33
|
export {
|
|
24
|
-
|
|
34
|
+
A as Form
|
|
25
35
|
};
|
|
26
36
|
//# sourceMappingURL=component.js.map
|