@pixpilot/formily-shadcn 0.8.4 → 0.9.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.
Files changed (76) hide show
  1. package/README.md +1 -42
  2. package/dist/components/array-base/components/array-item-label.cjs +4 -7
  3. package/dist/components/array-base/components/array-item-label.js +4 -6
  4. package/dist/components/array-base/components/empty.cjs +2 -2
  5. package/dist/components/array-base/components/empty.d.cts +9 -0
  6. package/dist/components/array-base/components/empty.d.ts +9 -0
  7. package/dist/components/array-base/components/empty.js +2 -2
  8. package/dist/components/array-base/components/get-array-components.cjs +1 -1
  9. package/dist/components/array-base/components/get-array-components.js +1 -1
  10. package/dist/components/array-base/components/types.d.cts +2 -1
  11. package/dist/components/array-base/components/types.d.ts +2 -1
  12. package/dist/components/array-base/components/use-array-components-registry.cjs +5 -8
  13. package/dist/components/array-base/components/use-array-components-registry.d.cts +1 -0
  14. package/dist/components/array-base/components/use-array-components-registry.d.ts +1 -0
  15. package/dist/components/array-base/components/use-array-components-registry.js +5 -8
  16. package/dist/components/array-cards/array-cards.cjs +1 -4
  17. package/dist/components/array-cards/array-cards.js +1 -4
  18. package/dist/components/array-cards/item.cjs +5 -12
  19. package/dist/components/array-cards/item.js +5 -12
  20. package/dist/components/array-collapse/array-collapse.cjs +1 -4
  21. package/dist/components/array-collapse/array-collapse.js +1 -4
  22. package/dist/components/array-collapse/item.cjs +1 -4
  23. package/dist/components/array-collapse/item.js +1 -4
  24. package/dist/components/array-common/list-item.cjs +0 -4
  25. package/dist/components/array-common/list-item.js +1 -5
  26. package/dist/components/array-dialog/array-dialog.cjs +2 -5
  27. package/dist/components/array-dialog/array-dialog.js +2 -5
  28. package/dist/components/file-upload/file-upload-inline.d.cts +8 -8
  29. package/dist/components/file-upload/file-upload-inline.d.ts +8 -8
  30. package/dist/components/file-upload/file-upload.d.cts +8 -8
  31. package/dist/components/file-upload/file-upload.d.ts +8 -8
  32. package/dist/components/json-schema-form-renderer.cjs +2 -1
  33. package/dist/components/json-schema-form-renderer.js +2 -1
  34. package/dist/components/radio.d.ts +2 -2
  35. package/dist/components/row.d.ts +2 -2
  36. package/dist/components/schema-field/index.cjs +3 -0
  37. package/dist/components/schema-field/index.d.cts +3 -0
  38. package/dist/components/schema-field/index.d.ts +3 -0
  39. package/dist/components/schema-field/index.js +3 -0
  40. package/dist/components/schema-field/schema-field-basics.cjs +54 -0
  41. package/dist/components/schema-field/schema-field-basics.d.cts +439 -0
  42. package/dist/components/schema-field/schema-field-basics.d.ts +439 -0
  43. package/dist/components/schema-field/schema-field-basics.js +51 -0
  44. package/dist/components/schema-field/schema-field-extended.cjs +28 -0
  45. package/dist/components/schema-field/schema-field-extended.d.cts +704 -0
  46. package/dist/components/schema-field/schema-field-extended.d.ts +704 -0
  47. package/dist/components/schema-field/schema-field-extended.js +25 -0
  48. package/dist/components/schema-field/schema-field.cjs +23 -0
  49. package/dist/components/schema-field/schema-field.d.cts +481 -0
  50. package/dist/components/schema-field/schema-field.d.ts +481 -0
  51. package/dist/components/schema-field/schema-field.js +19 -0
  52. package/dist/components/separator.d.cts +3 -3
  53. package/dist/components/slider.d.cts +2 -2
  54. package/dist/components/slider.d.ts +2 -2
  55. package/dist/components/switch.d.cts +3 -3
  56. package/dist/components/switch.d.ts +3 -3
  57. package/dist/components/tags-input-inline.d.cts +3 -3
  58. package/dist/components/tags-input-inline.d.ts +3 -3
  59. package/dist/components/textarea.d.cts +2 -2
  60. package/dist/index.cjs +12 -7
  61. package/dist/index.d.cts +5 -3
  62. package/dist/index.d.ts +5 -3
  63. package/dist/index.js +8 -6
  64. package/dist/utils/transform-schema.cjs +1 -1
  65. package/dist/utils/transform-schema.js +1 -1
  66. package/package.json +9 -9
  67. package/dist/components/array-base/components/title.cjs +0 -17
  68. package/dist/components/array-base/components/title.js +0 -14
  69. package/dist/components/schema-field-extended.cjs +0 -25
  70. package/dist/components/schema-field-extended.d.cts +0 -630
  71. package/dist/components/schema-field-extended.d.ts +0 -630
  72. package/dist/components/schema-field-extended.js +0 -23
  73. package/dist/components/schema-field.cjs +0 -61
  74. package/dist/components/schema-field.d.cts +0 -471
  75. package/dist/components/schema-field.d.ts +0 -471
  76. package/dist/components/schema-field.js +0 -57
package/README.md CHANGED
@@ -70,13 +70,12 @@ function MyForm() {
70
70
  const schema = {
71
71
  type: 'void',
72
72
  'x-component': 'FormGrid',
73
- 'x-component-props': { maxColumns: 3 },
74
73
  properties: {
75
74
  field1: {
76
75
  type: 'string',
77
76
  title: 'Field 1 (Span 2)',
78
77
  'x-decorator': 'FormItem',
79
- 'x-decorator-props': { gridSpan: 2 },
78
+ 'x-decorator-props': { className: 'col-span-2' },
80
79
  'x-component': 'Input',
81
80
  },
82
81
  field2: {
@@ -139,7 +138,6 @@ import {
139
138
 
140
139
  ### Field Components
141
140
 
142
- - `ArrayField` - Dynamic array fields
143
141
  - `SchemaField` - Renders forms from JSON Schema
144
142
 
145
143
  ## Schema Properties
@@ -150,7 +148,6 @@ import {
150
148
  - `x-decorator`: Wrapper component (typically 'FormItem')
151
149
  - `x-component-props`: Props passed to the component
152
150
  - `x-decorator-props`: Props passed to the decorator
153
- - `gridSpan`: Number of grid columns to span in FormGrid
154
151
 
155
152
  ## API Reference
156
153
 
@@ -164,41 +161,3 @@ const form = createForm({
164
161
  effects: () => {},
165
162
  });
166
163
  ```
167
-
168
- ### Form Props
169
-
170
- ```tsx
171
- interface IFormProps {
172
- form: IForm;
173
- className?: string;
174
- style?: React.CSSProperties;
175
- children?: React.ReactNode;
176
- onSubmit?: (values: any) => void;
177
- onAutoSubmit?: (values: any) => void;
178
- }
179
- ```
180
-
181
- ### FormGrid Props
182
-
183
- ```tsx
184
- interface IFormGridProps {
185
- minColumns?: number | number[];
186
- maxColumns?: number | number[];
187
- columnGap?: number;
188
- rowGap?: number;
189
- className?: string;
190
- }
191
- ```
192
-
193
- ## Examples
194
-
195
- Check the `stories` directory for comprehensive examples:
196
-
197
- - Basic forms
198
- - Grid layouts
199
- - Array fields
200
- - All input types
201
-
202
- ## License
203
-
204
- MIT
@@ -1,20 +1,17 @@
1
1
  const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
2
2
  const require_array_context = require('../array-context.cjs');
3
- let __formily_react = require("@formily/react");
4
- __formily_react = require_rolldown_runtime.__toESM(__formily_react);
3
+ const require_use_label = require('../../../hooks/use-label.cjs');
4
+ require('../../../hooks/index.cjs');
5
5
  let react_jsx_runtime = require("react/jsx-runtime");
6
6
  react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
7
7
 
8
8
  //#region src/components/array-base/components/array-item-label.tsx
9
9
  const ArrayItemLabel = () => {
10
10
  const index = require_array_context.useIndex();
11
+ const label = require_use_label.useLabel();
11
12
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
12
13
  className: "font-medium",
13
- children: [
14
- (0, __formily_react.useField)().title,
15
- " ",
16
- (index ?? 0) + 1
17
- ]
14
+ children: [label, typeof label === "string" ? ` ${(index ?? 0) + 1}` : ""]
18
15
  });
19
16
  };
20
17
 
@@ -1,17 +1,15 @@
1
1
  import { useIndex } from "../array-context.js";
2
- import { useField } from "@formily/react";
2
+ import { useLabel } from "../../../hooks/use-label.js";
3
+ import "../../../hooks/index.js";
3
4
  import { jsxs } from "react/jsx-runtime";
4
5
 
5
6
  //#region src/components/array-base/components/array-item-label.tsx
6
7
  const ArrayItemLabel = () => {
7
8
  const index = useIndex();
9
+ const label = useLabel();
8
10
  return /* @__PURE__ */ jsxs("span", {
9
11
  className: "font-medium",
10
- children: [
11
- useField().title,
12
- " ",
13
- (index ?? 0) + 1
14
- ]
12
+ children: [label, typeof label === "string" ? ` ${(index ?? 0) + 1}` : ""]
15
13
  });
16
14
  };
17
15
 
@@ -5,7 +5,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
5
5
  react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
6
6
 
7
7
  //#region src/components/array-base/components/empty.tsx
8
- const ArrayEmpty = react.default.forwardRef((props, ref) => {
8
+ function ArrayEmpty({ ref,...props }) {
9
9
  const { title, children,...rest } = props;
10
10
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11
11
  ref,
@@ -13,7 +13,7 @@ const ArrayEmpty = react.default.forwardRef((props, ref) => {
13
13
  ...rest,
14
14
  children: children ?? title ?? "No Data"
15
15
  });
16
- });
16
+ }
17
17
 
18
18
  //#endregion
19
19
  exports.ArrayEmpty = ArrayEmpty;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import "react/jsx-runtime";
3
+
4
+ //#region src/components/array-base/components/empty.d.ts
5
+ type ArrayEmptyProps = React.HTMLAttributes<HTMLDivElement> & {
6
+ title?: string;
7
+ };
8
+ //#endregion
9
+ export { ArrayEmptyProps };
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import "react/jsx-runtime";
3
+
4
+ //#region src/components/array-base/components/empty.d.ts
5
+ type ArrayEmptyProps = React.HTMLAttributes<HTMLDivElement> & {
6
+ title?: string;
7
+ };
8
+ //#endregion
9
+ export { ArrayEmptyProps };
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/array-base/components/empty.tsx
5
- const ArrayEmpty = React.forwardRef((props, ref) => {
5
+ function ArrayEmpty({ ref,...props }) {
6
6
  const { title, children,...rest } = props;
7
7
  return /* @__PURE__ */ jsx("div", {
8
8
  ref,
@@ -10,7 +10,7 @@ const ArrayEmpty = React.forwardRef((props, ref) => {
10
10
  ...rest,
11
11
  children: children ?? title ?? "No Data"
12
12
  });
13
- });
13
+ }
14
14
 
15
15
  //#endregion
16
16
  export { ArrayEmpty };
@@ -60,7 +60,7 @@ const componentChecks = [
60
60
  }
61
61
  ];
62
62
  function getArrayComponents(rootSchema) {
63
- const schemaComponents = /* @__PURE__ */ new Map([]);
63
+ const schemaComponents = /* @__PURE__ */ new Map();
64
64
  require_for_each_schema.forEachSchema(rootSchema, (schema, path) => {
65
65
  if (path.length > 0 && schema.type === "array") return false;
66
66
  componentChecks.forEach(({ type, check }) => {
@@ -56,7 +56,7 @@ const componentChecks = [
56
56
  }
57
57
  ];
58
58
  function getArrayComponents(rootSchema) {
59
- const schemaComponents = /* @__PURE__ */ new Map([]);
59
+ const schemaComponents = /* @__PURE__ */ new Map();
60
60
  forEachSchema(rootSchema, (schema, path) => {
61
61
  if (path.length > 0 && schema.type === "array") return false;
62
62
  componentChecks.forEach(({ type, check }) => {
@@ -1,4 +1,5 @@
1
1
  import { IArrayBaseAdditionProps } from "./addition.cjs";
2
+ import { ArrayEmptyProps } from "./empty.cjs";
2
3
  import { IArrayBaseOperationProps } from "../types.cjs";
3
4
  import { Schema } from "@formily/react";
4
5
 
@@ -18,7 +19,7 @@ interface ArrayBaseComponents {
18
19
  index?: number;
19
20
  }>>;
20
21
  Index: React.FC;
21
- Empty: React.FC;
22
+ Empty: React.FC<ArrayEmptyProps>;
22
23
  Copy: React.FC<React.PropsWithChildren<IArrayBaseOperationProps & {
23
24
  index?: number;
24
25
  }>>;
@@ -1,4 +1,5 @@
1
1
  import { IArrayBaseAdditionProps } from "./addition.js";
2
+ import { ArrayEmptyProps } from "./empty.js";
2
3
  import { IArrayBaseOperationProps } from "../types.js";
3
4
  import { Schema } from "@formily/react";
4
5
 
@@ -18,7 +19,7 @@ interface ArrayBaseComponents {
18
19
  index?: number;
19
20
  }>>;
20
21
  Index: React.FC;
21
- Empty: React.FC;
22
+ Empty: React.FC<ArrayEmptyProps>;
22
23
  Copy: React.FC<React.PropsWithChildren<IArrayBaseOperationProps & {
23
24
  index?: number;
24
25
  }>>;
@@ -27,26 +27,23 @@ function useArrayComponentRegistry(rootSchema, operations) {
27
27
  if (!EmptyArray) return null;
28
28
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EmptyArray, { ...props }) });
29
29
  },
30
- ItemIndex: (props) => {
30
+ ItemIndex: (_props) => {
31
31
  const compInfo = schemaComponents.get("Index");
32
32
  if (!compInfo) return null;
33
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(compInfo.Component, { ...props }) });
33
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(compInfo.Component, {}) });
34
34
  },
35
35
  ArrayItemsContainer: (props) => {
36
36
  const { className, schema, children, hasItems, basePath,...otherProps } = props;
37
37
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
38
38
  ...otherProps,
39
39
  className: (0, __pixpilot_shadcn.cn)("space-y-3", className),
40
- children: [!hasItems && EmptyArray && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EmptyArray, {
41
- basePath,
42
- schema
43
- }), children]
40
+ children: [!hasItems && EmptyArray && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EmptyArray, {}), children]
44
41
  });
45
42
  },
46
- ItemLabel: (props) => {
43
+ ItemLabel: (_props) => {
47
44
  const compInfo = schemaComponents.get("Label");
48
45
  if (!compInfo) return null;
49
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(compInfo.Component, { ...props }) });
46
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(compInfo.Component, {}) });
50
47
  }
51
48
  };
52
49
  }, [operations, rootSchema]);
@@ -1,4 +1,5 @@
1
1
  import "./addition.cjs";
2
+ import "./empty.cjs";
2
3
  import "./types.cjs";
3
4
  import { Schema } from "@formily/react";
4
5
  import React from "react";
@@ -1,4 +1,5 @@
1
1
  import "./addition.js";
2
+ import "./empty.js";
2
3
  import "./types.js";
3
4
  import { Schema } from "@formily/react";
4
5
  import React from "react";
@@ -23,26 +23,23 @@ function useArrayComponentRegistry(rootSchema, operations) {
23
23
  if (!EmptyArray) return null;
24
24
  return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(EmptyArray, { ...props }) });
25
25
  },
26
- ItemIndex: (props) => {
26
+ ItemIndex: (_props) => {
27
27
  const compInfo = schemaComponents.get("Index");
28
28
  if (!compInfo) return null;
29
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(compInfo.Component, { ...props }) });
29
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(compInfo.Component, {}) });
30
30
  },
31
31
  ArrayItemsContainer: (props) => {
32
32
  const { className, schema, children, hasItems, basePath,...otherProps } = props;
33
33
  return /* @__PURE__ */ jsxs("div", {
34
34
  ...otherProps,
35
35
  className: cn("space-y-3", className),
36
- children: [!hasItems && EmptyArray && /* @__PURE__ */ jsx(EmptyArray, {
37
- basePath,
38
- schema
39
- }), children]
36
+ children: [!hasItems && EmptyArray && /* @__PURE__ */ jsx(EmptyArray, {}), children]
40
37
  });
41
38
  },
42
- ItemLabel: (props) => {
39
+ ItemLabel: (_props) => {
43
40
  const compInfo = schemaComponents.get("Label");
44
41
  if (!compInfo) return null;
45
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(compInfo.Component, { ...props }) });
42
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(compInfo.Component, {}) });
46
43
  }
47
44
  };
48
45
  }, [operations, rootSchema]);
@@ -42,10 +42,7 @@ const ArrayCardsBase = (0, __formily_react.observer)((props) => {
42
42
  basePath: fieldAddress,
43
43
  schema,
44
44
  hasItems: dataSource.length > 0,
45
- children: [renderItems(), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AddButton, {
46
- schema,
47
- basePath: fieldAddress
48
- })]
45
+ children: [renderItems(), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AddButton, { schema })]
49
46
  })
50
47
  });
51
48
  });
@@ -38,10 +38,7 @@ const ArrayCardsBase = observer((props) => {
38
38
  basePath: fieldAddress,
39
39
  schema,
40
40
  hasItems: dataSource.length > 0,
41
- children: [renderItems(), /* @__PURE__ */ jsx(AddButton, {
42
- schema,
43
- basePath: fieldAddress
44
- })]
41
+ children: [renderItems(), /* @__PURE__ */ jsx(AddButton, { schema })]
45
42
  })
46
43
  });
47
44
  });
@@ -3,7 +3,6 @@ const require_array_base = require('../array-base/array-base.cjs');
3
3
  const require_is_array_component = require('../array-base/utils/is-array-component.cjs');
4
4
  const require_component_context = require('../array-base/component-context.cjs');
5
5
  require('../array-base/index.cjs');
6
- const require_title = require('../array-base/components/title.cjs');
7
6
  let __formily_react = require("@formily/react");
8
7
  __formily_react = require_rolldown_runtime.__toESM(__formily_react);
9
8
  let react = require("react");
@@ -12,7 +11,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
12
11
  react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
13
12
 
14
13
  //#region src/components/array-cards/item.tsx
15
- const ArrayItem = react.default.memo(({ index, title, record }) => {
14
+ const ArrayItem = react.default.memo(({ index, record }) => {
16
15
  const field = (0, __formily_react.useField)();
17
16
  const schema = (0, __formily_react.useFieldSchema)();
18
17
  const Components = require_component_context.useArrayComponents();
@@ -27,17 +26,11 @@ const ArrayItem = react.default.memo(({ index, title, record }) => {
27
26
  className: "flex",
28
27
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
29
28
  className: "flex-1",
30
- children: [
31
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Components.ItemLabel, {
32
- basePath: fieldAddress,
33
- index,
34
- schema: schema.items
35
- }),
36
- " ",
37
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_title.ArrayTitle, { title: title ?? field.title })
38
- ]
29
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Components.ItemLabel, {
30
+ index,
31
+ schema: schema.items
32
+ }), " "]
39
33
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Components.OperationComponents, {
40
- basePath: fieldAddress,
41
34
  index,
42
35
  schema: schema.items
43
36
  }) })]
@@ -2,13 +2,12 @@ import { ArrayBase } from "../array-base/array-base.js";
2
2
  import { isOperationComponent } from "../array-base/utils/is-array-component.js";
3
3
  import { useArrayComponents } from "../array-base/component-context.js";
4
4
  import "../array-base/index.js";
5
- import { ArrayTitle } from "../array-base/components/title.js";
6
5
  import { RecursionField, useField, useFieldSchema } from "@formily/react";
7
6
  import React from "react";
8
7
  import { jsx, jsxs } from "react/jsx-runtime";
9
8
 
10
9
  //#region src/components/array-cards/item.tsx
11
- const ArrayItem = React.memo(({ index, title, record }) => {
10
+ const ArrayItem = React.memo(({ index, record }) => {
12
11
  const field = useField();
13
12
  const schema = useFieldSchema();
14
13
  const Components = useArrayComponents();
@@ -23,17 +22,11 @@ const ArrayItem = React.memo(({ index, title, record }) => {
23
22
  className: "flex",
24
23
  children: [/* @__PURE__ */ jsxs("div", {
25
24
  className: "flex-1",
26
- children: [
27
- /* @__PURE__ */ jsx(Components.ItemLabel, {
28
- basePath: fieldAddress,
29
- index,
30
- schema: schema.items
31
- }),
32
- " ",
33
- /* @__PURE__ */ jsx(ArrayTitle, { title: title ?? field.title })
34
- ]
25
+ children: [/* @__PURE__ */ jsx(Components.ItemLabel, {
26
+ index,
27
+ schema: schema.items
28
+ }), " "]
35
29
  }), /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Components.OperationComponents, {
36
- basePath: fieldAddress,
37
30
  index,
38
31
  schema: schema.items
39
32
  }) })]
@@ -75,10 +75,7 @@ const ArrayItemsCollapseBase = (0, __formily_react.observer)((props) => {
75
75
  basePath: fieldAddress,
76
76
  schema,
77
77
  hasItems: dataSource.length > 0,
78
- children: [renderItems(), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AddButton, {
79
- schema,
80
- basePath: fieldAddress
81
- })]
78
+ children: [renderItems(), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AddButton, { schema })]
82
79
  })
83
80
  });
84
81
  });
@@ -71,10 +71,7 @@ const ArrayItemsCollapseBase = observer((props) => {
71
71
  basePath: fieldAddress,
72
72
  schema,
73
73
  hasItems: dataSource.length > 0,
74
- children: [renderItems(), /* @__PURE__ */ jsx(AddButton, {
75
- schema,
76
- basePath: fieldAddress
77
- })]
74
+ children: [renderItems(), /* @__PURE__ */ jsx(AddButton, { schema })]
78
75
  })
79
76
  });
80
77
  });
@@ -31,7 +31,6 @@ const ArrayCollapseItem = react.default.memo((props) => {
31
31
  itemId,
32
32
  formCollapse
33
33
  ]);
34
- const fieldAddress = field.address.concat(index).toString();
35
34
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_array_base.ArrayBase.Item, {
36
35
  index,
37
36
  record: () => field.value?.[index],
@@ -53,15 +52,13 @@ const ArrayCollapseItem = react.default.memo((props) => {
53
52
  className: "text-foreground flex items-center gap-2 font-medium",
54
53
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronDownIcon, { className: (0, __pixpilot_shadcn.cn)("size-4 shrink-0 transition-transform duration-200", isOpen && "rotate-180") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ItemLabel, {
55
54
  schema,
56
- index,
57
- basePath: fieldAddress
55
+ index
58
56
  })]
59
57
  })
60
58
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
61
59
  className: "flex items-center gap-1",
62
60
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OperationComponents, {
63
61
  schema,
64
- basePath: fieldAddress,
65
62
  index
66
63
  })
67
64
  })]
@@ -25,7 +25,6 @@ const ArrayCollapseItem = React.memo((props) => {
25
25
  itemId,
26
26
  formCollapse
27
27
  ]);
28
- const fieldAddress = field.address.concat(index).toString();
29
28
  return /* @__PURE__ */ jsx(ArrayBase.Item, {
30
29
  index,
31
30
  record: () => field.value?.[index],
@@ -47,15 +46,13 @@ const ArrayCollapseItem = React.memo((props) => {
47
46
  className: "text-foreground flex items-center gap-2 font-medium",
48
47
  children: [/* @__PURE__ */ jsx(ChevronDownIcon, { className: cn("size-4 shrink-0 transition-transform duration-200", isOpen && "rotate-180") }), /* @__PURE__ */ jsx(ItemLabel, {
49
48
  schema,
50
- index,
51
- basePath: fieldAddress
49
+ index
52
50
  })]
53
51
  })
54
52
  }), /* @__PURE__ */ jsx("div", {
55
53
  className: "flex items-center gap-1",
56
54
  children: /* @__PURE__ */ jsx(OperationComponents, {
57
55
  schema,
58
- basePath: fieldAddress,
59
56
  index
60
57
  })
61
58
  })]
@@ -19,9 +19,7 @@ __pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
19
19
  */
20
20
  const ListItem = react.default.memo(({ itemKey, index, record, isNew }) => {
21
21
  const schema = (0, __formily_react.useFieldSchema)();
22
- const field = (0, __formily_react.useField)();
23
22
  const { OperationComponents, ItemLabel } = require_component_context.useArrayComponents();
24
- const fieldAddress = field.address.toString();
25
23
  const isNewItem = isNew;
26
24
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_array_base.ArrayBase.Item, {
27
25
  index,
@@ -33,14 +31,12 @@ const ListItem = react.default.memo(({ itemKey, index, record, isNew }) => {
33
31
  className: "text-foreground flex-1 font-medium",
34
32
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ItemLabel, {
35
33
  schema,
36
- basePath: fieldAddress,
37
34
  index
38
35
  })
39
36
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
40
37
  className: "flex items-center gap-1",
41
38
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OperationComponents, {
42
39
  schema,
43
- basePath: fieldAddress,
44
40
  index
45
41
  })
46
42
  })]
@@ -2,7 +2,7 @@ import { ArrayBase } from "../array-base/array-base.js";
2
2
  import { useArrayComponents } from "../array-base/component-context.js";
3
3
  import "../array-base/index.js";
4
4
  import { ItemWrapper } from "./item-wrapper.js";
5
- import { useField, useFieldSchema } from "@formily/react";
5
+ import { useFieldSchema } from "@formily/react";
6
6
  import React from "react";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
8
  import { cn } from "@pixpilot/shadcn";
@@ -14,9 +14,7 @@ import { cn } from "@pixpilot/shadcn";
14
14
  */
15
15
  const ListItem = React.memo(({ itemKey, index, record, isNew }) => {
16
16
  const schema = useFieldSchema();
17
- const field = useField();
18
17
  const { OperationComponents, ItemLabel } = useArrayComponents();
19
- const fieldAddress = field.address.toString();
20
18
  const isNewItem = isNew;
21
19
  return /* @__PURE__ */ jsx(ArrayBase.Item, {
22
20
  index,
@@ -28,14 +26,12 @@ const ListItem = React.memo(({ itemKey, index, record, isNew }) => {
28
26
  className: "text-foreground flex-1 font-medium",
29
27
  children: /* @__PURE__ */ jsx(ItemLabel, {
30
28
  schema,
31
- basePath: fieldAddress,
32
29
  index
33
30
  })
34
31
  }), /* @__PURE__ */ jsx("div", {
35
32
  className: "flex items-center gap-1",
36
33
  children: /* @__PURE__ */ jsx(OperationComponents, {
37
34
  schema,
38
- basePath: fieldAddress,
39
35
  index
40
36
  })
41
37
  })]
@@ -25,7 +25,7 @@ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
25
25
  const ArrayDialogBase = (0, __formily_react.observer)((props) => {
26
26
  const schema = (0, __formily_react.useFieldSchema)();
27
27
  const { onAdd, onRemove, onMoveDown, onMoveUp, onEdit, className } = props;
28
- const { activeItemManager, handleAdd, handleEdit, isNewItem, handleSaveClick, handleCancelClick, field } = require_use_array_editor.useArrayEditor({
28
+ const { activeItemManager, handleAdd, handleEdit, isNewItem, handleSaveClick, handleCancelClick } = require_use_array_editor.useArrayEditor({
29
29
  onAdd,
30
30
  onEdit
31
31
  });
@@ -40,10 +40,7 @@ const ArrayDialogBase = (0, __formily_react.observer)((props) => {
40
40
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_array_items_list.ArrayItemsList, {
41
41
  className,
42
42
  isNewItem,
43
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AddButton, {
44
- schema,
45
- basePath: field.address.toString()
46
- })
43
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AddButton, { schema })
47
44
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_edit_dialog.EditDialog, {
48
45
  onSave: handleSaveClick,
49
46
  onCancel: handleCancelClick,
@@ -21,7 +21,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
21
21
  const ArrayDialogBase = observer((props) => {
22
22
  const schema = useFieldSchema();
23
23
  const { onAdd, onRemove, onMoveDown, onMoveUp, onEdit, className } = props;
24
- const { activeItemManager, handleAdd, handleEdit, isNewItem, handleSaveClick, handleCancelClick, field } = useArrayEditor({
24
+ const { activeItemManager, handleAdd, handleEdit, isNewItem, handleSaveClick, handleCancelClick } = useArrayEditor({
25
25
  onAdd,
26
26
  onEdit
27
27
  });
@@ -36,10 +36,7 @@ const ArrayDialogBase = observer((props) => {
36
36
  children: [/* @__PURE__ */ jsx(ArrayItemsList, {
37
37
  className,
38
38
  isNewItem,
39
- children: /* @__PURE__ */ jsx(AddButton, {
40
- schema,
41
- basePath: field.address.toString()
42
- })
39
+ children: /* @__PURE__ */ jsx(AddButton, { schema })
43
40
  }), /* @__PURE__ */ jsx(EditDialog, {
44
41
  onSave: handleSaveClick,
45
42
  onCancel: handleCancelClick,
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import * as _pixpilot_shadcn_ui190 from "@pixpilot/shadcn-ui";
2
+ import * as _pixpilot_shadcn_ui0 from "@pixpilot/shadcn-ui";
3
3
 
4
4
  //#region src/components/file-upload/file-upload-inline.d.ts
5
5
 
@@ -7,14 +7,14 @@ import * as _pixpilot_shadcn_ui190 from "@pixpilot/shadcn-ui";
7
7
  * Formily-connected FileUploadInline component
8
8
  * Automatically connects shadcn FileUploadInline to Formily field state
9
9
  */
10
- declare const FileUploadInline: React.ForwardRefExoticComponent<(Omit<Partial<_pixpilot_shadcn_ui190.FileUploadInlineBaseProps & {
10
+ declare const FileUploadInline: React.ForwardRefExoticComponent<(Omit<Partial<_pixpilot_shadcn_ui0.FileUploadInlineBaseProps & {
11
11
  multiple: true;
12
- value?: _pixpilot_shadcn_ui190.FileMetadata[];
13
- onChange?: _pixpilot_shadcn_ui190.OnChangeMultipleFiles;
14
- } & _pixpilot_shadcn_ui190.FileUploadBaseProps>, "ref"> | Omit<Partial<_pixpilot_shadcn_ui190.FileUploadInlineBaseProps & {
12
+ value?: _pixpilot_shadcn_ui0.FileMetadata[];
13
+ onChange?: _pixpilot_shadcn_ui0.OnChangeMultipleFiles;
14
+ } & _pixpilot_shadcn_ui0.FileUploadBaseProps>, "ref"> | Omit<Partial<_pixpilot_shadcn_ui0.FileUploadInlineBaseProps & {
15
15
  multiple?: false;
16
- value?: _pixpilot_shadcn_ui190.FileMetadata | null;
17
- onChange?: _pixpilot_shadcn_ui190.OnChangeSingleFile;
18
- } & _pixpilot_shadcn_ui190.FileUploadBaseProps>, "ref">) & React.RefAttributes<unknown>>;
16
+ value?: _pixpilot_shadcn_ui0.FileMetadata | null;
17
+ onChange?: _pixpilot_shadcn_ui0.OnChangeSingleFile;
18
+ } & _pixpilot_shadcn_ui0.FileUploadBaseProps>, "ref">) & React.RefAttributes<unknown>>;
19
19
  //#endregion
20
20
  export { FileUploadInline };