@para-ui/core 5.0.1 → 5.0.3-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/FieldForm/component.json +22 -1
  2. package/FormItemGroup/component.json +72 -0
  3. package/Menu/component.json +9 -2
  4. package/es/Checkbox/index.js +26 -24
  5. package/es/CheckboxGroup/index.css +1 -1
  6. package/es/CheckboxGroup/style/index.css +1 -1
  7. package/es/ExpressionInput/Popup.js +11 -4
  8. package/es/ExpressionInput/useExpressionInput.js +40 -37
  9. package/es/FieldForm/ErrorList.js +9 -8
  10. package/es/FieldForm/FieldFormItem/ItemHolder.d.ts +2 -0
  11. package/es/FieldForm/FieldFormItem/ItemHolder.js +78 -68
  12. package/es/FieldForm/FieldFormItem/index.d.ts +3 -0
  13. package/es/FieldForm/FieldFormItem/index.js +131 -120
  14. package/es/FieldForm/Form.d.ts +3 -1
  15. package/es/FieldForm/Form.js +54 -50
  16. package/es/FieldForm/compactControlMarker.d.ts +18 -0
  17. package/es/FieldForm/compactControlMarker.js +5 -0
  18. package/es/FieldForm/component.json +22 -1
  19. package/es/FieldForm/context.d.ts +3 -1
  20. package/es/FieldForm/context.js +6 -5
  21. package/es/FieldForm/index.css +1 -1
  22. package/es/FieldForm/index.d.ts +2 -0
  23. package/es/FieldForm/index.js +13 -9
  24. package/es/FieldForm/interface.d.ts +9 -0
  25. package/es/FieldForm/style/index.css +1 -1
  26. package/es/FieldForm/util.d.ts +14 -0
  27. package/es/FieldForm/util.js +41 -17
  28. package/es/FormItemGroup/component.json +72 -0
  29. package/es/FormItemGroup/index.css +1 -0
  30. package/es/FormItemGroup/index.d.ts +14 -0
  31. package/es/FormItemGroup/index.js +27 -0
  32. package/es/FormItemGroup/style/css.js +1 -0
  33. package/es/FormItemGroup/style/index.css +1 -0
  34. package/es/FormItemGroup/style/index.js +1 -0
  35. package/es/HelperText/index.js +15 -13
  36. package/es/Menu/component.json +9 -2
  37. package/es/Menu/index.css +1 -1
  38. package/es/Menu/interface.d.ts +2 -0
  39. package/es/Menu/style/index.css +1 -1
  40. package/es/Menu/verticalMenuList.js +378 -361
  41. package/es/RadioGroup/index.css +1 -1
  42. package/es/RadioGroup/style/index.css +1 -1
  43. package/es/RangeInput/index.js +60 -60
  44. package/es/Switch/index.js +30 -28
  45. package/es/Tag/TagGroup.js +29 -32
  46. package/es/Tag/index.js +5 -5
  47. package/es/index.d.ts +2 -0
  48. package/es/index.js +175 -169
  49. package/lib/Checkbox/index.js +1 -1
  50. package/lib/CheckboxGroup/index.css +1 -1
  51. package/lib/CheckboxGroup/style/index.css +1 -1
  52. package/lib/ExpressionInput/Popup.js +1 -1
  53. package/lib/ExpressionInput/useExpressionInput.js +1 -1
  54. package/lib/FieldForm/ErrorList.js +1 -1
  55. package/lib/FieldForm/FieldFormItem/ItemHolder.d.ts +2 -0
  56. package/lib/FieldForm/FieldFormItem/ItemHolder.js +1 -1
  57. package/lib/FieldForm/FieldFormItem/index.d.ts +3 -0
  58. package/lib/FieldForm/FieldFormItem/index.js +1 -1
  59. package/lib/FieldForm/Form.d.ts +3 -1
  60. package/lib/FieldForm/Form.js +1 -1
  61. package/lib/FieldForm/compactControlMarker.d.ts +18 -0
  62. package/lib/FieldForm/compactControlMarker.js +2 -0
  63. package/lib/FieldForm/component.json +22 -1
  64. package/lib/FieldForm/context.d.ts +3 -1
  65. package/lib/FieldForm/context.js +1 -1
  66. package/lib/FieldForm/index.css +1 -1
  67. package/lib/FieldForm/index.d.ts +2 -0
  68. package/lib/FieldForm/index.js +1 -1
  69. package/lib/FieldForm/interface.d.ts +9 -0
  70. package/lib/FieldForm/style/index.css +1 -1
  71. package/lib/FieldForm/util.d.ts +14 -0
  72. package/lib/FieldForm/util.js +1 -1
  73. package/lib/FormItemGroup/component.json +72 -0
  74. package/lib/FormItemGroup/index.css +1 -0
  75. package/lib/FormItemGroup/index.d.ts +14 -0
  76. package/lib/FormItemGroup/index.js +2 -0
  77. package/lib/FormItemGroup/style/css.js +1 -0
  78. package/lib/FormItemGroup/style/index.css +1 -0
  79. package/lib/FormItemGroup/style/index.js +1 -0
  80. package/lib/HelperText/index.js +1 -1
  81. package/lib/Menu/component.json +9 -2
  82. package/lib/Menu/index.css +1 -1
  83. package/lib/Menu/interface.d.ts +2 -0
  84. package/lib/Menu/style/index.css +1 -1
  85. package/lib/Menu/verticalMenuList.js +1 -1
  86. package/lib/RadioGroup/index.css +1 -1
  87. package/lib/RadioGroup/style/index.css +1 -1
  88. package/lib/RangeInput/index.js +1 -1
  89. package/lib/Switch/index.js +1 -1
  90. package/lib/Tag/TagGroup.js +1 -1
  91. package/lib/Tag/index.js +1 -1
  92. package/lib/index.d.ts +2 -0
  93. package/lib/index.js +1 -1
  94. package/package.json +14 -1
@@ -1,95 +1,105 @@
1
1
  import { j as t } from "../../_virtual/jsx-runtime.js";
2
- import { useContext as M, useMemo as N, useRef as R, useState as V } from "react";
3
- import W from "../../_virtual/index.js";
4
- import _ from "rc-util/lib/Dom/isVisible";
5
- import q from "rc-util/lib/hooks/useLayoutEffect";
6
- import { FormContext as A, NoStyleItemContext as O } from "../context.js";
7
- import T from "../FormItemLabel.js";
8
- import k from "../FormItemInput.js";
9
- import z from "./StatusProvider.js";
10
- function te(a) {
2
+ import { useContext as q, useMemo as I, useRef as A, useState as D } from "react";
3
+ import O from "../../_virtual/index.js";
4
+ import T from "rc-util/lib/Dom/isVisible";
5
+ import k from "rc-util/lib/hooks/useLayoutEffect";
6
+ import { FormContext as z, NoStyleItemContext as G } from "../context.js";
7
+ import J from "../FormItemLabel.js";
8
+ import K from "../FormItemInput.js";
9
+ import Q from "./StatusProvider.js";
10
+ function ne(l) {
11
11
  const {
12
- className: h,
13
- style: g,
14
- helperText: s,
12
+ className: S,
13
+ style: C,
14
+ helperText: i,
15
15
  errors: m,
16
- warnings: u,
16
+ warnings: c,
17
17
  status: e,
18
- hidden: x,
19
- children: b,
18
+ hidden: j,
19
+ children: v,
20
20
  fieldId: r,
21
- required: y,
22
- onSubItemMetaChange: I,
23
- layout: c,
24
- hideLabel: S,
25
- hideError: j,
26
- noSpacing: v,
27
- label: C,
28
- labelProps: E,
29
- labelAlign: L,
30
- colon: P,
31
- labelWidth: $,
32
- labelWrap: w
33
- } = a, { prefixCls: i, layout: d } = M(A), n = N(() => c ?? d, [c, d]), o = R(null), f = !!(s != null || m.length || u.length), B = !!o.current && _(o.current), [F, p] = V(null);
34
- q(() => {
35
- if (f && o.current) {
36
- const l = getComputedStyle(o.current);
37
- p(parseInt(l.marginBottom, 10));
21
+ required: E,
22
+ identityMeta: u,
23
+ onSubItemMetaChange: L,
24
+ layout: d,
25
+ hideLabel: $,
26
+ hideError: M,
27
+ noSpacing: N,
28
+ spacing: p,
29
+ label: P,
30
+ labelProps: w,
31
+ labelAlign: B,
32
+ colon: F,
33
+ labelWidth: H,
34
+ labelWrap: R
35
+ } = l, { prefixCls: s, layout: f, spacing: g, itemDecorator: h } = q(z), n = I(() => d ?? f, [d, f]), x = I(() => p ?? g, [p, g]), o = A(null), b = !!(i != null || m.length || c.length), V = !!o.current && T(o.current), [W, y] = D(null);
36
+ k(() => {
37
+ if (b && o.current) {
38
+ const a = getComputedStyle(o.current);
39
+ y(parseInt(a.marginBottom, 10));
38
40
  }
39
- }, [f, B]);
40
- const H = (l) => {
41
- l || p(null);
41
+ }, [b, V]);
42
+ const _ = (a) => {
43
+ a || y(null);
42
44
  };
43
45
  return /* @__PURE__ */ t.jsx(
44
- z,
46
+ Q,
45
47
  {
46
- ...a,
47
- prefixCls: i,
48
+ ...l,
49
+ prefixCls: s,
48
50
  children: /* @__PURE__ */ t.jsxs(
49
51
  "div",
50
52
  {
51
- className: W(h, `${i}-item`, {
52
- [`${i}-item__${r}`]: r,
53
- // 状态
54
- "is-success": e === "success",
55
- "is-warning": e === "warning",
56
- "is-error": e === "error",
57
- "is-validating": e === "validating",
58
- "is-hidden": x,
59
- // 布局
60
- [`is-${n}`]: n
61
- }),
62
- style: g,
53
+ className: O(
54
+ S,
55
+ `${s}-item`,
56
+ {
57
+ [`${s}-item__${r}`]: r,
58
+ // 状态
59
+ "is-success": e === "success",
60
+ "is-warning": e === "warning",
61
+ "is-error": e === "error",
62
+ "is-validating": e === "validating",
63
+ "is-hidden": j,
64
+ // 布局
65
+ [`is-${n}`]: n,
66
+ // 间距密度
67
+ [`is-spacing-${x}`]: x
68
+ },
69
+ h?.getItemClassName?.(u)
70
+ ),
71
+ style: C,
63
72
  children: [
64
73
  /* @__PURE__ */ t.jsx(
65
- T,
74
+ J,
66
75
  {
67
76
  fieldId: r,
68
- label: C,
69
- labelWidth: $,
70
- labelWrap: w,
71
- labelAlign: L,
72
- colon: P,
73
- labelProps: { required: y, ...E },
74
- hideLabel: S,
77
+ label: P,
78
+ labelWidth: H,
79
+ labelWrap: R,
80
+ labelAlign: B,
81
+ colon: F,
82
+ labelProps: { required: E, ...w },
83
+ hideLabel: $,
75
84
  layout: n
76
85
  }
77
86
  ),
78
87
  /* @__PURE__ */ t.jsx(
79
- k,
88
+ K,
80
89
  {
81
90
  fieldId: r,
82
91
  errors: m,
83
- warnings: u,
92
+ warnings: c,
84
93
  status: e,
85
- helperText: s,
86
- marginBottom: F,
87
- onErrorVisibleChanged: H,
88
- hideError: j,
89
- noSpacing: v,
90
- children: /* @__PURE__ */ t.jsx(O.Provider, { value: I, children: b })
94
+ helperText: i,
95
+ marginBottom: W,
96
+ onErrorVisibleChanged: _,
97
+ hideError: M,
98
+ noSpacing: N,
99
+ children: /* @__PURE__ */ t.jsx(G.Provider, { value: L, children: v })
91
100
  }
92
- )
101
+ ),
102
+ h?.renderItemExtra?.(u)
93
103
  ]
94
104
  }
95
105
  )
@@ -97,6 +107,6 @@ function te(a) {
97
107
  );
98
108
  }
99
109
  export {
100
- te as default
110
+ ne as default
101
111
  };
102
112
  //# sourceMappingURL=ItemHolder.js.map
@@ -1,6 +1,7 @@
1
1
  import { ReactNode, ReactElement, CSSProperties } from 'react';
2
2
  import { FieldProps } from 'rc-field-form/lib/Field';
3
3
  import { Meta } from 'rc-field-form/lib/interface';
4
+ import { ItemDecoratorMeta } from '../interface';
4
5
  import { FormInstance, FormItemLayout } from '../Form';
5
6
  import { FormItemInputProps } from '../FormItemInput';
6
7
  import { FormItemLabelProps } from '../FormItemLabel';
@@ -35,6 +36,7 @@ export interface FormItemProps<Values = unknown> extends FormItemLabelProps, For
35
36
  disabled?: boolean;
36
37
  size?: 'small' | 'medium' | 'large';
37
38
  noSpacing?: boolean;
39
+ spacing?: 'normal' | 'compact';
38
40
  }
39
41
  export interface ItemHolderProps extends FormItemProps {
40
42
  errors: ReactNode[];
@@ -44,6 +46,7 @@ export interface ItemHolderProps extends FormItemProps {
44
46
  fieldId?: string;
45
47
  isRequired?: boolean;
46
48
  onSubItemMetaChange: ReportMetaChange;
49
+ identityMeta: ItemDecoratorMeta;
47
50
  }
48
51
  declare function InternalFormItem<Values = unknown>(props: FormItemProps<Values>): ReactElement;
49
52
  type InternalFormItemType = typeof InternalFormItem;
@@ -1,16 +1,16 @@
1
- import { j as g } from "../../_virtual/jsx-runtime.js";
2
- import { useContext as h, useRef as ae, useMemo as U, isValidElement as W, Children as $, cloneElement as P } from "react";
3
- import { FieldContext as de, ListContext as le, Field as me } from "rc-field-form";
4
- import fe from "rc-util/lib/hooks/useState";
5
- import { supportRef as ue } from "rc-util/lib/ref";
6
- import ge from "./MemoInput.js";
7
- import { FormContext as ce, NoStyleItemContext as pe } from "../context.js";
8
- import he from "../hooks/useChildren.js";
9
- import ye from "../hooks/useFormItemStatus.js";
10
- import be from "../hooks/useFrameState.js";
11
- import Ce from "../hooks/useItemRef.js";
12
- import { getStatus as Se, toArray as j, getFieldId as Ie, isReactComponent as B } from "../util.js";
13
- import we from "./ItemHolder.js";
1
+ import { j as u } from "../../_virtual/jsx-runtime.js";
2
+ import { useContext as y, useMemo as T, useRef as le, isValidElement as W, Children as $, cloneElement as j } from "react";
3
+ import { FieldContext as ce, ListContext as fe, Field as ge } from "rc-field-form";
4
+ import ue from "rc-util/lib/hooks/useState";
5
+ import { supportRef as pe } from "rc-util/lib/ref";
6
+ import he from "./MemoInput.js";
7
+ import { FormContext as ye, NoStyleItemContext as be } from "../context.js";
8
+ import Ce from "../hooks/useChildren.js";
9
+ import Ie from "../hooks/useFormItemStatus.js";
10
+ import Se from "../hooks/useFrameState.js";
11
+ import Pe from "../hooks/useItemRef.js";
12
+ import { isCompactControlChild as ve, getStatus as we, toArray as N, joinNamePath as Ee, getFieldId as Fe, isReactComponent as B } from "../util.js";
13
+ import Te from "./ItemHolder.js";
14
14
  function G() {
15
15
  return {
16
16
  errors: [],
@@ -21,147 +21,158 @@ function G() {
21
21
  validated: !1
22
22
  };
23
23
  }
24
- const ve = "__SPLIT__";
25
- function Fe(y) {
24
+ const je = "__SPLIT__", Ne = { namePath: [], path: "" };
25
+ function xe(b) {
26
26
  const {
27
- noStyle: E,
27
+ noStyle: x,
28
28
  shouldUpdate: J,
29
- dependencies: x,
30
- messageVariables: R,
31
- trigger: N = "onChange",
32
- validateTrigger: T,
33
- children: M,
34
- required: b,
35
- hidden: Q,
36
- rules: X,
29
+ dependencies: R,
30
+ messageVariables: _,
31
+ trigger: q = "onChange",
32
+ validateTrigger: z,
33
+ children: Q,
34
+ required: C,
35
+ hidden: X,
36
+ rules: Z,
37
37
  name: l,
38
- label: q,
39
- disabled: C,
38
+ label: A,
39
+ disabled: I,
40
40
  helperText: S,
41
- hasFeedback: z,
42
- validateStatus: L,
43
- size: I
44
- } = y, { name: Y, disabled: w, size: v } = h(ce), n = he(M), V = typeof n == "function", _ = h(pe), { validateTrigger: Z } = h(de), A = T !== void 0 ? T : Z, F = l != null, ee = h(le), K = ae(), [O, re] = be({}), [a, te] = fe(() => G()), ne = (r) => {
45
- const i = ee?.getKey(r.name);
46
- if (te(r.destroy ? G() : r, !0), E && S !== !1 && _) {
47
- let t = r.name;
48
- if (r.destroy)
49
- t = K.current || t;
50
- else if (i !== void 0) {
51
- const [s, e] = i;
52
- t = [s, ...e], K.current = t;
41
+ hasFeedback: L,
42
+ validateStatus: V,
43
+ size: P,
44
+ spacing: v
45
+ } = b, { name: ee, disabled: w, size: E } = y(ye), t = Ce(Q), re = T(
46
+ () => v === void 0 && ve(t) ? "compact" : void 0,
47
+ [v, t]
48
+ ), K = typeof t == "function", M = y(be), { validateTrigger: te } = y(ce), O = z !== void 0 ? z : te, F = l != null, ne = y(fe), k = le(), [D, ie] = Se({}), [a, oe] = ue(() => G()), se = (e) => {
49
+ const o = ne?.getKey(e.name);
50
+ if (oe(e.destroy ? G() : e, !0), x && S !== !1 && M) {
51
+ let n = e.name;
52
+ if (e.destroy)
53
+ n = k.current || n;
54
+ else if (o !== void 0) {
55
+ const [s, r] = o;
56
+ n = [s, ...r], k.current = n;
53
57
  }
54
- _(r, t);
58
+ M(e, n);
55
59
  }
56
- }, ie = (r, i) => {
57
- re((t) => {
60
+ }, ae = (e, o) => {
61
+ ie((n) => {
58
62
  const s = {
59
- ...t
60
- }, f = [...r.name.slice(0, -1), ...i].join(ve);
61
- return r.destroy ? delete s[f] : s[f] = r, s;
63
+ ...n
64
+ }, i = [...e.name.slice(0, -1), ...o].join(je);
65
+ return e.destroy ? delete s[i] : s[i] = e, s;
62
66
  });
63
- }, [c, k] = U(() => {
64
- const r = [...a.errors], i = [...a.warnings];
65
- return Object.values(O).forEach((t) => {
66
- r.push(...t.errors || []), i.push(...t.warnings || []);
67
- }), [r, i];
68
- }, [O, a.errors, a.warnings]), m = U(
69
- () => Se(a.errors, a.warnings, a, "", !!z, L),
70
- [a, z, L]
71
- ), D = (r, i, t, s) => E && !Q ? /* @__PURE__ */ g.jsx(g.Fragment, { children: $.map(r, (e) => B(e) ? P(e, {
67
+ }, [p, Y] = T(() => {
68
+ const e = [...a.errors], o = [...a.warnings];
69
+ return Object.values(D).forEach((n) => {
70
+ e.push(...n.errors || []), o.push(...n.warnings || []);
71
+ }), [e, o];
72
+ }, [D, a.errors, a.warnings]), c = T(
73
+ () => we(a.errors, a.warnings, a, "", !!L, V),
74
+ [a, L, V]
75
+ ), H = (e, o, n, s, r = Ne) => x && !X ? /* @__PURE__ */ u.jsx(u.Fragment, { children: $.map(e, (i) => B(i) ? j(i, {
72
76
  ...s,
73
77
  name: l,
74
- disabled: C ?? w,
75
- error: m === "error" || m === "warning",
76
- size: I ?? v,
77
- ...e.props
78
- }) : e) }) : /* @__PURE__ */ g.jsx(
79
- we,
78
+ disabled: I ?? w,
79
+ error: c === "error" || c === "warning",
80
+ size: P ?? E,
81
+ ...i.props
82
+ }) : i) }) : /* @__PURE__ */ u.jsx(
83
+ Te,
80
84
  {
81
- ...y,
82
- fieldId: i,
83
- required: b ?? t,
84
- errors: c,
85
- warnings: k,
86
- status: m,
85
+ ...b,
86
+ fieldId: o,
87
+ required: C ?? n,
88
+ errors: p,
89
+ warnings: Y,
90
+ status: c,
87
91
  meta: a,
88
- onSubItemMetaChange: ie,
89
- children: $.map(r, (e) => B(e) ? P(e, {
92
+ identityMeta: r,
93
+ onSubItemMetaChange: ae,
94
+ spacing: v ?? re,
95
+ children: $.map(e, (i) => B(i) ? j(i, {
90
96
  ...s,
91
97
  name: l,
92
- disabled: C ?? w,
93
- error: m === "error" || m === "warning",
94
- size: I ?? v,
95
- ...e.props
96
- }) : e)
98
+ disabled: I ?? w,
99
+ error: c === "error" || c === "warning",
100
+ size: P ?? E,
101
+ ...i.props
102
+ }) : i)
97
103
  }
98
104
  );
99
- if (!F && !V && !x)
100
- return D(n);
101
- let u = {};
102
- typeof q == "string" ? u.label = q : l && (u.label = String(l)), R && (u = { ...u, ...R });
103
- const se = Ce(), oe = ({ control: r, fieldId: i, isRequired: t, mergedName: s }) => {
104
- if (!W(n)) return null;
105
- const e = {
106
- ...n.props,
107
- ...r,
108
- disabled: C ?? w,
109
- error: m === "error" || m === "warning",
110
- size: n.props?.size ?? I ?? v
105
+ if (!F && !K && !R)
106
+ return H(t);
107
+ let g = {};
108
+ typeof A == "string" ? g.label = A : l && (g.label = String(l)), _ && (g = { ...g, ..._ });
109
+ const de = Pe(), me = ({
110
+ control: e,
111
+ fieldId: o,
112
+ isRequired: n,
113
+ mergedName: s
114
+ }) => {
115
+ if (!W(t)) return null;
116
+ const r = {
117
+ ...t.props,
118
+ ...e,
119
+ disabled: I ?? w,
120
+ error: c === "error" || c === "warning",
121
+ size: t.props?.size ?? P ?? E
111
122
  };
112
- if (e.fieldId || (e["data-field-id"] = i), S || c.length > 0 || k.length > 0) {
113
- const o = [];
114
- (S || c.length > 0) && o.push(`${i}_help`), e["aria-describedby"] = o.join(" ");
123
+ if (r.fieldId || (r["data-field-id"] = o), S || p.length > 0 || Y.length > 0) {
124
+ const d = [];
125
+ (S || p.length > 0) && d.push(`${o}_help`), r["aria-describedby"] = d.join(" ");
115
126
  }
116
- c.length > 0 && (e["aria-invalid"] = "true"), t && (e["aria-required"] = "true"), ue(n) && (e.ref = se(s, n)), (/* @__PURE__ */ new Set([...j(N), ...j(A)])).forEach((o) => {
117
- e[o] = (...d) => {
118
- r[o]?.(...d), n.props[o]?.(...d);
127
+ p.length > 0 && (r["aria-invalid"] = "true"), n && (r["aria-required"] = "true"), pe(t) && (r.ref = de(s, t)), (/* @__PURE__ */ new Set([...N(q), ...N(O)])).forEach((d) => {
128
+ r[d] = (...m) => {
129
+ e[d]?.(...m), t.props[d]?.(...m);
119
130
  };
120
131
  });
121
- const p = [
122
- e["aria-required"],
123
- e["aria-invalid"],
124
- e["aria-describedby"]
132
+ const h = [
133
+ r["aria-required"],
134
+ r["aria-invalid"],
135
+ r["aria-describedby"]
125
136
  ];
126
- return /* @__PURE__ */ g.jsx(
127
- ge,
137
+ return /* @__PURE__ */ u.jsx(
138
+ he,
128
139
  {
129
- control: r,
130
- update: n,
131
- childProps: p,
132
- children: P(n, e)
140
+ control: e,
141
+ update: t,
142
+ childProps: h,
143
+ children: j(t, r)
133
144
  }
134
145
  );
135
146
  };
136
- return /* @__PURE__ */ g.jsx(
137
- me,
147
+ return /* @__PURE__ */ u.jsx(
148
+ ge,
138
149
  {
139
- ...y,
140
- messageVariables: u,
141
- trigger: N,
142
- validateTrigger: A,
143
- onMetaChange: ne,
144
- children: (r, i, t) => {
145
- const s = j(l).length && i ? i.name : [], e = Ie(s, Y), f = b !== void 0 ? b : !!X?.some((d) => {
146
- if (d && typeof d == "object" && d.required && !d.warningOnly)
150
+ ...b,
151
+ messageVariables: g,
152
+ trigger: q,
153
+ validateTrigger: O,
154
+ onMetaChange: se,
155
+ children: (e, o, n) => {
156
+ const s = N(l).length && o ? o.name : [], r = { namePath: s, path: Ee(s) }, i = Fe(s, ee), h = C !== void 0 ? C : !!Z?.some((f) => {
157
+ if (f && typeof f == "object" && f.required && !f.warningOnly)
147
158
  return !0;
148
- if (typeof d == "function") {
149
- const H = d(t);
150
- return H?.required && !H?.warningOnly;
159
+ if (typeof f == "function") {
160
+ const U = f(n);
161
+ return U?.required && !U?.warningOnly;
151
162
  }
152
163
  return !1;
153
- }), p = {
154
- ...r
164
+ }), d = {
165
+ ...e
155
166
  };
156
- let o = null;
157
- return Array.isArray(n) && F ? o = n : W(n) ? o = oe({ control: p, fieldId: e, isRequired: f, mergedName: s }) : V && (J || x) && !F ? o = n(t) : o = n, D(o, e, f, p);
167
+ let m = null;
168
+ return Array.isArray(t) && F ? m = t : W(t) ? m = me({ control: d, fieldId: i, isRequired: h, mergedName: s }) : K && (J || R) && !F ? m = t(n) : m = t, H(m, i, h, d, r);
158
169
  }
159
170
  }
160
171
  );
161
172
  }
162
- const Pe = Fe;
163
- Pe.useStatus = ye;
173
+ const Re = xe;
174
+ Re.useStatus = Ie;
164
175
  export {
165
- Pe as default
176
+ Re as default
166
177
  };
167
178
  //# sourceMappingURL=index.js.map
@@ -2,7 +2,7 @@ import { PropsWithChildren, RefAttributes, ReactElement, FC, ReactNode } from 'r
2
2
  import { useWatch } from 'rc-field-form';
3
3
  import { FormProps as RcFormProps } from 'rc-field-form/lib/Form';
4
4
  import { FormRef } from 'rc-field-form/lib/interface';
5
- import { FormLabelAlign } from './interface';
5
+ import { FormLabelAlign, ItemDecorator } from './interface';
6
6
  import { FormInstance, default as useForm } from './hooks/useForm';
7
7
  import { FeedbackIcons } from './FieldFormItem';
8
8
  export type RequiredMark = boolean | 'optional' | ((labelNode: ReactNode, info: {
@@ -22,6 +22,8 @@ export interface FormProps<Values = unknown> extends Omit<RcFormProps<Values>, '
22
22
  disabled?: boolean;
23
23
  requiredMark?: RequiredMark;
24
24
  size?: 'small' | 'medium' | 'large';
25
+ spacing?: 'normal' | 'compact';
26
+ itemDecorator?: ItemDecorator;
25
27
  }
26
28
  declare const FieldForm: (<Values = unknown>(props: PropsWithChildren<FormProps<Values>> & RefAttributes<FormRef<Values>>) => ReactElement) & Pick<FC, "displayName">;
27
29
  export { useForm, useWatch, type FormInstance };