@pixpilot/formily-shadcn 1.4.4 → 1.5.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 (53) hide show
  1. package/dist/components/Column.d.ts +2 -2
  2. package/dist/components/DatePicker.d.ts +3 -3
  3. package/dist/components/Form.d.ts +2 -2
  4. package/dist/components/FormGrid.d.ts +2 -2
  5. package/dist/components/IconPicker.d.ts +3 -3
  6. package/dist/components/IconToggle.d.ts +3 -3
  7. package/dist/components/Input.d.ts +3 -3
  8. package/dist/components/Radio.d.ts +2 -2
  9. package/dist/components/Rating.d.ts +4 -4
  10. package/dist/components/Row.d.ts +2 -2
  11. package/dist/components/Separator.d.cts +2 -2
  12. package/dist/components/Separator.d.ts +2 -2
  13. package/dist/components/Switch.d.cts +2 -2
  14. package/dist/components/Switch.d.ts +2 -2
  15. package/dist/components/TagsInputInline.d.cts +2 -2
  16. package/dist/components/TagsInputInline.d.ts +3 -3
  17. package/dist/components/Textarea.d.cts +2 -2
  18. package/dist/components/Textarea.d.ts +2 -2
  19. package/dist/components/ToggleButton.d.cts +2 -2
  20. package/dist/components/ToggleButton.d.ts +3 -3
  21. package/dist/components/array-common/ArrayItemDraftFields.cjs +37 -25
  22. package/dist/components/array-common/ArrayItemDraftFields.js +37 -25
  23. package/dist/components/array-common/ArrayItemsList.cjs +3 -2
  24. package/dist/components/array-common/ArrayItemsList.js +3 -2
  25. package/dist/components/array-common/ItemWrapper.cjs +1 -0
  26. package/dist/components/array-common/ItemWrapper.js +1 -0
  27. package/dist/components/array-common/ListItem.cjs +21 -4
  28. package/dist/components/array-common/ListItem.js +23 -6
  29. package/dist/components/array-common/use-array-item-draft-form.cjs +31 -15
  30. package/dist/components/array-common/use-array-item-draft-form.js +31 -15
  31. package/dist/components/array-common/use-array-item-edit-state.cjs +5 -14
  32. package/dist/components/array-common/use-array-item-edit-state.js +5 -13
  33. package/dist/components/array-dialog/EditDialog.cjs +60 -6
  34. package/dist/components/array-dialog/EditDialog.js +60 -6
  35. package/dist/components/array-popover/ArrayPopover.cjs +29 -16
  36. package/dist/components/array-popover/ArrayPopover.js +30 -17
  37. package/dist/components/array-popover/Popover.cjs +88 -88
  38. package/dist/components/array-popover/Popover.js +88 -88
  39. package/dist/components/context/types.d.cts +2 -1
  40. package/dist/components/context/types.d.ts +2 -1
  41. package/dist/components/file-upload/FileUpload.d.ts +8 -8
  42. package/dist/components/file-upload/FileUploadInline.d.ts +8 -8
  43. package/dist/components/schema-field/schema-field-basics.d.ts +302 -302
  44. package/dist/components/schema-field/schema-field-extended.d.cts +632 -632
  45. package/dist/components/schema-field/schema-field-extended.d.ts +307 -307
  46. package/dist/components/schema-field/schema-field.d.cts +412 -412
  47. package/dist/components/schema-field/schema-field.d.ts +412 -412
  48. package/dist/components/slider/Slider.d.cts +3 -3
  49. package/dist/components/slider/Slider.d.ts +2 -2
  50. package/dist/components/slider/SliderInput.d.ts +2 -2
  51. package/dist/components/slider/SliderSelect.d.cts +3 -3
  52. package/dist/components/slider/SliderSelect.d.ts +2 -2
  53. package/package.json +6 -6
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import * as react_jsx_runtime1 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/Column.d.ts
5
5
  interface IColumnProps {
@@ -36,6 +36,6 @@ interface IColumnProps {
36
36
  declare function Column({
37
37
  className,
38
38
  children
39
- }: IColumnProps): react_jsx_runtime1.JSX.Element;
39
+ }: IColumnProps): react_jsx_runtime0.JSX.Element;
40
40
  //#endregion
41
41
  export { Column };
@@ -1,11 +1,11 @@
1
- import * as react20 from "react";
1
+ import * as react2 from "react";
2
2
  import { DatePickerProps } from "@pixpilot/shadcn-ui";
3
3
 
4
4
  //#region src/components/DatePicker.d.ts
5
- declare const DatePicker$1: react20.ForwardRefExoticComponent<Partial<{
5
+ declare const DatePicker$1: react2.ForwardRefExoticComponent<Partial<{
6
6
  value?: Date;
7
7
  onChange?: (date: Date | undefined) => void;
8
8
  placeholder?: string;
9
- } & Omit<DatePickerProps, "onSelect" | "selected" | "mode">> & react20.RefAttributes<unknown>>;
9
+ } & Omit<DatePickerProps, "onSelect" | "selected" | "mode">> & react2.RefAttributes<unknown>>;
10
10
  //#endregion
11
11
  export { DatePicker$1 as DatePicker };
@@ -1,7 +1,7 @@
1
1
  import { FormContextStates } from "./context/form-context.js";
2
2
  import "./context/index.js";
3
3
  import React from "react";
4
- import * as react_jsx_runtime4 from "react/jsx-runtime";
4
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
5
5
  import { Form } from "@formily/core";
6
6
 
7
7
  //#region src/components/Form.d.ts
@@ -25,6 +25,6 @@ declare function Form$1({
25
25
  onAutoSubmit,
26
26
  layout,
27
27
  settings
28
- }: IFormProps): react_jsx_runtime4.JSX.Element;
28
+ }: IFormProps): react_jsx_runtime0.JSX.Element;
29
29
  //#endregion
30
30
  export { Form$1 as Form };
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import * as react_jsx_runtime3 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/FormGrid.d.ts
5
5
  interface IFormGridProps extends React.HTMLAttributes<HTMLDivElement> {}
@@ -7,6 +7,6 @@ declare function FormGrid({
7
7
  className,
8
8
  children,
9
9
  ...rest
10
- }: IFormGridProps): react_jsx_runtime3.JSX.Element;
10
+ }: IFormGridProps): react_jsx_runtime1.JSX.Element;
11
11
  //#endregion
12
12
  export { FormGrid };
@@ -1,4 +1,4 @@
1
- import * as react22 from "react";
1
+ import * as react7 from "react";
2
2
  import { IconPickerProps, IconProviderProps } from "@pixpilot/shadcn-ui";
3
3
 
4
4
  //#region src/components/IconPicker.d.ts
@@ -8,8 +8,8 @@ import { IconPickerProps, IconProviderProps } from "@pixpilot/shadcn-ui";
8
8
  * Automatically connects to Formily field state
9
9
  * Supports both static and async icon providers
10
10
  */
11
- declare const IconPicker$1: react22.ForwardRefExoticComponent<Partial<Omit<IconPickerProps, "providers"> & {
11
+ declare const IconPicker$1: react7.ForwardRefExoticComponent<Partial<Omit<IconPickerProps, "providers"> & {
12
12
  providers?: IconProviderProps[];
13
- }> & react22.RefAttributes<unknown>>;
13
+ }> & react7.RefAttributes<unknown>>;
14
14
  //#endregion
15
15
  export { IconPicker$1 as IconPicker };
@@ -1,11 +1,11 @@
1
- import * as react24 from "react";
2
- import * as _pixpilot_shadcn_ui2 from "@pixpilot/shadcn-ui";
1
+ import * as react4 from "react";
2
+ import * as _pixpilot_shadcn_ui0 from "@pixpilot/shadcn-ui";
3
3
 
4
4
  //#region src/components/IconToggle.d.ts
5
5
  /**
6
6
  * Formily-connected IconToggle component
7
7
  * Toggle button with customizable icons for boolean values
8
8
  */
9
- declare const IconToggle$1: react24.ForwardRefExoticComponent<Omit<Partial<Omit<_pixpilot_shadcn_ui2.IconToggleProps, "ref"> & react24.RefAttributes<HTMLButtonElement>>, "ref"> & react24.RefAttributes<unknown>>;
9
+ declare const IconToggle$1: react4.ForwardRefExoticComponent<Omit<Partial<Omit<_pixpilot_shadcn_ui0.IconToggleProps, "ref"> & react4.RefAttributes<HTMLButtonElement>>, "ref"> & react4.RefAttributes<unknown>>;
10
10
  //#endregion
11
11
  export { IconToggle$1 as IconToggle };
@@ -1,4 +1,4 @@
1
- import * as react27 from "react";
1
+ import * as react9 from "react";
2
2
 
3
3
  //#region src/components/Input.d.ts
4
4
 
@@ -6,12 +6,12 @@ import * as react27 from "react";
6
6
  * Formily-connected Input component
7
7
  * Automatically connects shadcn Input to Formily field state
8
8
  */
9
- declare const Input: react27.ForwardRefExoticComponent<Omit<Partial<react27.ClassAttributes<HTMLInputElement> & react27.InputHTMLAttributes<HTMLInputElement> & {
9
+ declare const Input: react9.ForwardRefExoticComponent<Omit<Partial<react9.ClassAttributes<HTMLInputElement> & react9.InputHTMLAttributes<HTMLInputElement> & {
10
10
  prefix?: React.ReactNode;
11
11
  suffix?: React.ReactNode;
12
12
  groupClassName?: string;
13
13
  prefixClassName?: string;
14
14
  suffixClassName?: string;
15
- }>, "ref"> & react27.RefAttributes<unknown>>;
15
+ }>, "ref"> & react9.RefAttributes<unknown>>;
16
16
  //#endregion
17
17
  export { Input };
@@ -1,5 +1,5 @@
1
1
  import { FC } from "react";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime2 from "react/jsx-runtime";
3
3
  import { RadioGroup } from "@pixpilot/shadcn";
4
4
 
5
5
  //#region src/components/Radio.d.ts
@@ -15,7 +15,7 @@ type RadioProps = {
15
15
  /**
16
16
  * Radio component with options rendering
17
17
  */
18
- declare function Radio(props: RadioProps): react_jsx_runtime0.JSX.Element;
18
+ declare function Radio(props: RadioProps): react_jsx_runtime2.JSX.Element;
19
19
  declare namespace Radio {
20
20
  var displayName: string;
21
21
  }
@@ -1,4 +1,4 @@
1
- import * as react2 from "react";
1
+ import * as react13 from "react";
2
2
  import * as _pixpilot_shadcn_ui0 from "@pixpilot/shadcn-ui";
3
3
 
4
4
  //#region src/components/Rating.d.ts
@@ -6,8 +6,8 @@ import * as _pixpilot_shadcn_ui0 from "@pixpilot/shadcn-ui";
6
6
  * Formily-connected Rating component
7
7
  * Automatically connects shadcn-ui Rating to Formily field state
8
8
  */
9
- declare const Rating$1: react2.ForwardRefExoticComponent<Partial<_pixpilot_shadcn_ui0.RatingProps & {
10
- children?: react2.ReactNode | undefined;
11
- }> & react2.RefAttributes<unknown>>;
9
+ declare const Rating$1: react13.ForwardRefExoticComponent<Partial<_pixpilot_shadcn_ui0.RatingProps & {
10
+ children?: react13.ReactNode | undefined;
11
+ }> & react13.RefAttributes<unknown>>;
12
12
  //#endregion
13
13
  export { Rating$1 as Rating };
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime3 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/Row.d.ts
5
5
  interface IRowProps {
@@ -36,6 +36,6 @@ interface IRowProps {
36
36
  declare function Row({
37
37
  className,
38
38
  children
39
- }: IRowProps): react_jsx_runtime0.JSX.Element;
39
+ }: IRowProps): react_jsx_runtime3.JSX.Element;
40
40
  //#endregion
41
41
  export { Row };
@@ -1,4 +1,4 @@
1
- import * as react21 from "react";
1
+ import * as react16 from "react";
2
2
  import * as _radix_ui_react_separator0 from "@radix-ui/react-separator";
3
3
 
4
4
  //#region src/components/Separator.d.ts
@@ -6,6 +6,6 @@ import * as _radix_ui_react_separator0 from "@radix-ui/react-separator";
6
6
  * Formily-connected Separator component
7
7
  * A visual divider for content sections
8
8
  */
9
- declare const Separator: react21.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_separator0.SeparatorProps & react21.RefAttributes<HTMLDivElement>>, "ref"> & react21.RefAttributes<unknown>>;
9
+ declare const Separator: react16.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_separator0.SeparatorProps & react16.RefAttributes<HTMLDivElement>>, "ref"> & react16.RefAttributes<unknown>>;
10
10
  //#endregion
11
11
  export { Separator };
@@ -1,4 +1,4 @@
1
- import * as react5 from "react";
1
+ import * as react16 from "react";
2
2
  import * as _radix_ui_react_separator0 from "@radix-ui/react-separator";
3
3
 
4
4
  //#region src/components/Separator.d.ts
@@ -6,6 +6,6 @@ import * as _radix_ui_react_separator0 from "@radix-ui/react-separator";
6
6
  * Formily-connected Separator component
7
7
  * A visual divider for content sections
8
8
  */
9
- declare const Separator: react5.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_separator0.SeparatorProps & react5.RefAttributes<HTMLDivElement>>, "ref"> & react5.RefAttributes<unknown>>;
9
+ declare const Separator: react16.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_separator0.SeparatorProps & react16.RefAttributes<HTMLDivElement>>, "ref"> & react16.RefAttributes<unknown>>;
10
10
  //#endregion
11
11
  export { Separator };
@@ -1,4 +1,4 @@
1
- import * as react28 from "react";
1
+ import * as react19 from "react";
2
2
  import * as _radix_ui_react_switch0 from "@radix-ui/react-switch";
3
3
 
4
4
  //#region src/components/Switch.d.ts
@@ -6,6 +6,6 @@ import * as _radix_ui_react_switch0 from "@radix-ui/react-switch";
6
6
  * Formily-connected Switch component
7
7
  * Toggle switch for boolean values
8
8
  */
9
- declare const Switch: react28.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_switch0.SwitchProps & react28.RefAttributes<HTMLButtonElement>>, "ref"> & react28.RefAttributes<unknown>>;
9
+ declare const Switch: react19.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_switch0.SwitchProps & react19.RefAttributes<HTMLButtonElement>>, "ref"> & react19.RefAttributes<unknown>>;
10
10
  //#endregion
11
11
  export { Switch };
@@ -1,4 +1,4 @@
1
- import * as react8 from "react";
1
+ import * as react19 from "react";
2
2
  import * as _radix_ui_react_switch0 from "@radix-ui/react-switch";
3
3
 
4
4
  //#region src/components/Switch.d.ts
@@ -6,6 +6,6 @@ import * as _radix_ui_react_switch0 from "@radix-ui/react-switch";
6
6
  * Formily-connected Switch component
7
7
  * Toggle switch for boolean values
8
8
  */
9
- declare const Switch: react8.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_switch0.SwitchProps & react8.RefAttributes<HTMLButtonElement>>, "ref"> & react8.RefAttributes<unknown>>;
9
+ declare const Switch: react19.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_switch0.SwitchProps & react19.RefAttributes<HTMLButtonElement>>, "ref"> & react19.RefAttributes<unknown>>;
10
10
  //#endregion
11
11
  export { Switch };
@@ -1,4 +1,4 @@
1
- import * as react16 from "react";
1
+ import * as react26 from "react";
2
2
  import * as _pixpilot_shadcn_ui1 from "@pixpilot/shadcn-ui";
3
3
 
4
4
  //#region src/components/TagsInputInline.d.ts
@@ -10,6 +10,6 @@ import * as _pixpilot_shadcn_ui1 from "@pixpilot/shadcn-ui";
10
10
  * Based on DiceUI's tags-input for inline tag editing with keyboard navigation
11
11
  * and validation support.
12
12
  */
13
- declare const TagsInputInLine: react16.ForwardRefExoticComponent<Partial<_pixpilot_shadcn_ui1.TagsInputProps> & react16.RefAttributes<unknown>>;
13
+ declare const TagsInputInLine: react26.ForwardRefExoticComponent<Partial<_pixpilot_shadcn_ui1.TagsInputProps> & react26.RefAttributes<unknown>>;
14
14
  //#endregion
15
15
  export { TagsInputInLine };
@@ -1,5 +1,5 @@
1
- import * as react11 from "react";
2
- import * as _pixpilot_shadcn_ui0 from "@pixpilot/shadcn-ui";
1
+ import * as react22 from "react";
2
+ import * as _pixpilot_shadcn_ui1 from "@pixpilot/shadcn-ui";
3
3
 
4
4
  //#region src/components/TagsInputInline.d.ts
5
5
 
@@ -10,6 +10,6 @@ import * as _pixpilot_shadcn_ui0 from "@pixpilot/shadcn-ui";
10
10
  * Based on DiceUI's tags-input for inline tag editing with keyboard navigation
11
11
  * and validation support.
12
12
  */
13
- declare const TagsInputInLine: react11.ForwardRefExoticComponent<Partial<_pixpilot_shadcn_ui0.TagsInputProps> & react11.RefAttributes<unknown>>;
13
+ declare const TagsInputInLine: react22.ForwardRefExoticComponent<Partial<_pixpilot_shadcn_ui1.TagsInputProps> & react22.RefAttributes<unknown>>;
14
14
  //#endregion
15
15
  export { TagsInputInLine };
@@ -1,9 +1,9 @@
1
- import * as react24 from "react";
1
+ import * as react22 from "react";
2
2
 
3
3
  //#region src/components/Textarea.d.ts
4
4
  /**
5
5
  * Formily-connected Textarea component
6
6
  */
7
- declare const Textarea: react24.ForwardRefExoticComponent<Omit<Partial<react24.ClassAttributes<HTMLTextAreaElement> & react24.TextareaHTMLAttributes<HTMLTextAreaElement>>, "ref"> & react24.RefAttributes<unknown>>;
7
+ declare const Textarea: react22.ForwardRefExoticComponent<Omit<Partial<react22.ClassAttributes<HTMLTextAreaElement> & react22.TextareaHTMLAttributes<HTMLTextAreaElement>>, "ref"> & react22.RefAttributes<unknown>>;
8
8
  //#endregion
9
9
  export { Textarea };
@@ -1,9 +1,9 @@
1
- import * as react13 from "react";
1
+ import * as react24 from "react";
2
2
 
3
3
  //#region src/components/Textarea.d.ts
4
4
  /**
5
5
  * Formily-connected Textarea component
6
6
  */
7
- declare const Textarea: react13.ForwardRefExoticComponent<Omit<Partial<react13.ClassAttributes<HTMLTextAreaElement> & react13.TextareaHTMLAttributes<HTMLTextAreaElement>>, "ref"> & react13.RefAttributes<unknown>>;
7
+ declare const Textarea: react24.ForwardRefExoticComponent<Omit<Partial<react24.ClassAttributes<HTMLTextAreaElement> & react24.TextareaHTMLAttributes<HTMLTextAreaElement>>, "ref"> & react24.RefAttributes<unknown>>;
8
8
  //#endregion
9
9
  export { Textarea };
@@ -1,4 +1,4 @@
1
- import * as react18 from "react";
1
+ import * as react28 from "react";
2
2
  import * as _pixpilot_shadcn_ui2 from "@pixpilot/shadcn-ui";
3
3
 
4
4
  //#region src/components/ToggleButton.d.ts
@@ -6,6 +6,6 @@ import * as _pixpilot_shadcn_ui2 from "@pixpilot/shadcn-ui";
6
6
  * Formily-connected IconToggle component
7
7
  * Toggle button with customizable icons for boolean values
8
8
  */
9
- declare const ToggleButton: react18.ForwardRefExoticComponent<Omit<Partial<Omit<_pixpilot_shadcn_ui2.ToggleButtonProps, "ref"> & react18.RefAttributes<HTMLButtonElement>>, "ref"> & react18.RefAttributes<unknown>>;
9
+ declare const ToggleButton: react28.ForwardRefExoticComponent<Omit<Partial<Omit<_pixpilot_shadcn_ui2.ToggleButtonProps, "ref"> & react28.RefAttributes<HTMLButtonElement>>, "ref"> & react28.RefAttributes<unknown>>;
10
10
  //#endregion
11
11
  export { ToggleButton };
@@ -1,11 +1,11 @@
1
- import * as react17 from "react";
2
- import * as _pixpilot_shadcn_ui1 from "@pixpilot/shadcn-ui";
1
+ import * as react28 from "react";
2
+ import * as _pixpilot_shadcn_ui2 from "@pixpilot/shadcn-ui";
3
3
 
4
4
  //#region src/components/ToggleButton.d.ts
5
5
  /**
6
6
  * Formily-connected IconToggle component
7
7
  * Toggle button with customizable icons for boolean values
8
8
  */
9
- declare const ToggleButton$1: react17.ForwardRefExoticComponent<Omit<Partial<Omit<_pixpilot_shadcn_ui1.ToggleButtonProps, "ref"> & react17.RefAttributes<HTMLButtonElement>>, "ref"> & react17.RefAttributes<unknown>>;
9
+ declare const ToggleButton$1: react28.ForwardRefExoticComponent<Omit<Partial<Omit<_pixpilot_shadcn_ui2.ToggleButtonProps, "ref"> & react28.RefAttributes<HTMLButtonElement>>, "ref"> & react28.RefAttributes<unknown>>;
10
10
  //#endregion
11
11
  export { ToggleButton$1 as ToggleButton };
@@ -19,32 +19,29 @@ function mergeClassName(a, b) {
19
19
  if (!hasA && hasB) return bb;
20
20
  return `${aa} ${bb}`;
21
21
  }
22
- function ArrayItemDraftFields({ schema, form, basePath = "draft", as: Component = "div", className }) {
22
+ /**
23
+ * Renders item fields inside their own FormProvider.
24
+ * SchemaField contexts (component registry, options, …) are captured from
25
+ * the outer tree and re-provided inside the new form context so that string
26
+ * component names like "Input" still resolve correctly.
27
+ */
28
+ function IsolatedDraftFields({ schema, form, basePath }) {
23
29
  const schemaComponents = react.default.use(__formily_react.SchemaComponentsContext);
24
- const schemaOptions = react.default.use(__formily_react.SchemaOptionsContext);
25
- const schemaExpressionScope = react.default.use(__formily_react.SchemaExpressionScopeContext);
26
- const schemaMarkup = react.default.use(__formily_react.SchemaMarkupContext);
27
- const schemaContext = react.default.use(__formily_react.SchemaContext);
28
- const { className: itemWrapperClassName,...itemWrapperRestProps } = require_get_x_component_props.getXComponentProps(schema);
29
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
30
- ...itemWrapperRestProps,
31
- className: mergeClassName(className, itemWrapperClassName),
32
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__formily_react.FormProvider, {
33
- form,
34
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__formily_react.SchemaOptionsContext, {
35
- value: schemaOptions,
36
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__formily_react.SchemaComponentsContext, {
37
- value: schemaComponents,
38
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__formily_react.SchemaExpressionScopeContext, {
39
- value: schemaExpressionScope,
40
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__formily_react.SchemaMarkupContext, {
41
- value: schemaMarkup,
42
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__formily_react.SchemaContext, {
43
- value: schemaContext,
44
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__formily_react.RecursionField, {
45
- schema,
46
- name: basePath
47
- })
30
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__formily_react.FormProvider, {
31
+ form,
32
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__formily_react.SchemaOptionsContext, {
33
+ value: react.default.use(__formily_react.SchemaOptionsContext),
34
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__formily_react.SchemaComponentsContext, {
35
+ value: schemaComponents,
36
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__formily_react.SchemaExpressionScopeContext, {
37
+ value: react.default.use(__formily_react.SchemaExpressionScopeContext),
38
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__formily_react.SchemaMarkupContext, {
39
+ value: react.default.use(__formily_react.SchemaMarkupContext),
40
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__formily_react.SchemaContext, {
41
+ value: react.default.use(__formily_react.SchemaContext),
42
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__formily_react.RecursionField, {
43
+ schema,
44
+ name: basePath
48
45
  })
49
46
  })
50
47
  })
@@ -53,6 +50,21 @@ function ArrayItemDraftFields({ schema, form, basePath = "draft", as: Component
53
50
  })
54
51
  });
55
52
  }
53
+ function ArrayItemDraftFields({ schema, form, basePath = "draft", as: Component = "div", className, isolated = true }) {
54
+ const { className: itemWrapperClassName,...itemWrapperRestProps } = require_get_x_component_props.getXComponentProps(schema);
55
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
56
+ ...itemWrapperRestProps,
57
+ className: mergeClassName(className, itemWrapperClassName),
58
+ children: isolated ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IsolatedDraftFields, {
59
+ schema,
60
+ form,
61
+ basePath
62
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__formily_react.RecursionField, {
63
+ schema,
64
+ name: basePath
65
+ })
66
+ });
67
+ }
56
68
 
57
69
  //#endregion
58
70
  exports.ArrayItemDraftFields = ArrayItemDraftFields;
@@ -15,32 +15,29 @@ function mergeClassName(a, b) {
15
15
  if (!hasA && hasB) return bb;
16
16
  return `${aa} ${bb}`;
17
17
  }
18
- function ArrayItemDraftFields({ schema, form, basePath = "draft", as: Component = "div", className }) {
18
+ /**
19
+ * Renders item fields inside their own FormProvider.
20
+ * SchemaField contexts (component registry, options, …) are captured from
21
+ * the outer tree and re-provided inside the new form context so that string
22
+ * component names like "Input" still resolve correctly.
23
+ */
24
+ function IsolatedDraftFields({ schema, form, basePath }) {
19
25
  const schemaComponents = React.use(SchemaComponentsContext);
20
- const schemaOptions = React.use(SchemaOptionsContext);
21
- const schemaExpressionScope = React.use(SchemaExpressionScopeContext);
22
- const schemaMarkup = React.use(SchemaMarkupContext);
23
- const schemaContext = React.use(SchemaContext);
24
- const { className: itemWrapperClassName,...itemWrapperRestProps } = getXComponentProps(schema);
25
- return /* @__PURE__ */ jsx(Component, {
26
- ...itemWrapperRestProps,
27
- className: mergeClassName(className, itemWrapperClassName),
28
- children: /* @__PURE__ */ jsx(FormProvider, {
29
- form,
30
- children: /* @__PURE__ */ jsx(SchemaOptionsContext, {
31
- value: schemaOptions,
32
- children: /* @__PURE__ */ jsx(SchemaComponentsContext, {
33
- value: schemaComponents,
34
- children: /* @__PURE__ */ jsx(SchemaExpressionScopeContext, {
35
- value: schemaExpressionScope,
36
- children: /* @__PURE__ */ jsx(SchemaMarkupContext, {
37
- value: schemaMarkup,
38
- children: /* @__PURE__ */ jsx(SchemaContext, {
39
- value: schemaContext,
40
- children: /* @__PURE__ */ jsx(RecursionField, {
41
- schema,
42
- name: basePath
43
- })
26
+ return /* @__PURE__ */ jsx(FormProvider, {
27
+ form,
28
+ children: /* @__PURE__ */ jsx(SchemaOptionsContext, {
29
+ value: React.use(SchemaOptionsContext),
30
+ children: /* @__PURE__ */ jsx(SchemaComponentsContext, {
31
+ value: schemaComponents,
32
+ children: /* @__PURE__ */ jsx(SchemaExpressionScopeContext, {
33
+ value: React.use(SchemaExpressionScopeContext),
34
+ children: /* @__PURE__ */ jsx(SchemaMarkupContext, {
35
+ value: React.use(SchemaMarkupContext),
36
+ children: /* @__PURE__ */ jsx(SchemaContext, {
37
+ value: React.use(SchemaContext),
38
+ children: /* @__PURE__ */ jsx(RecursionField, {
39
+ schema,
40
+ name: basePath
44
41
  })
45
42
  })
46
43
  })
@@ -49,6 +46,21 @@ function ArrayItemDraftFields({ schema, form, basePath = "draft", as: Component
49
46
  })
50
47
  });
51
48
  }
49
+ function ArrayItemDraftFields({ schema, form, basePath = "draft", as: Component = "div", className, isolated = true }) {
50
+ const { className: itemWrapperClassName,...itemWrapperRestProps } = getXComponentProps(schema);
51
+ return /* @__PURE__ */ jsx(Component, {
52
+ ...itemWrapperRestProps,
53
+ className: mergeClassName(className, itemWrapperClassName),
54
+ children: isolated ? /* @__PURE__ */ jsx(IsolatedDraftFields, {
55
+ schema,
56
+ form,
57
+ basePath
58
+ }) : /* @__PURE__ */ jsx(RecursionField, {
59
+ schema,
60
+ name: basePath
61
+ })
62
+ });
63
+ }
52
64
 
53
65
  //#endregion
54
66
  export { ArrayItemDraftFields };
@@ -21,7 +21,7 @@ __pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
21
21
  * Shared component for rendering array items list
22
22
  * Displays items with move up/down, edit, and remove controls
23
23
  */
24
- const ArrayItemsList = (0, __formily_react.observer)(({ isNewItem, children, className, containerProps }) => {
24
+ const ArrayItemsList = (0, __formily_react.observer)(({ isNewItem, activeIndex, children, className, containerProps }) => {
25
25
  const field = (0, __formily_react.useField)();
26
26
  const schema = (0, __formily_react.useFieldSchema)();
27
27
  const dataSource = require_use_array_data_source.useArrayDataSource();
@@ -39,7 +39,8 @@ const ArrayItemsList = (0, __formily_react.observer)(({ isNewItem, children, cla
39
39
  itemKey,
40
40
  index,
41
41
  record,
42
- isNew
42
+ isNew,
43
+ isAnchor: activeIndex === index && !isNew
43
44
  }, itemKey);
44
45
  }) }), children]
45
46
  });
@@ -16,7 +16,7 @@ import { cn } from "@pixpilot/shadcn";
16
16
  * Shared component for rendering array items list
17
17
  * Displays items with move up/down, edit, and remove controls
18
18
  */
19
- const ArrayItemsList = observer(({ isNewItem, children, className, containerProps }) => {
19
+ const ArrayItemsList = observer(({ isNewItem, activeIndex, children, className, containerProps }) => {
20
20
  const field = useField();
21
21
  const schema = useFieldSchema();
22
22
  const dataSource = useArrayDataSource();
@@ -34,7 +34,8 @@ const ArrayItemsList = observer(({ isNewItem, children, className, containerProp
34
34
  itemKey,
35
35
  index,
36
36
  record,
37
- isNew
37
+ isNew,
38
+ isAnchor: activeIndex === index && !isNew
38
39
  }, itemKey);
39
40
  }) }), children]
40
41
  });
@@ -16,6 +16,7 @@ const ItemWrapper = (props) => {
16
16
  const hasErrors = require_has_array_item_errors.hasArrayItemErrors((0, __formily_react.useField)(), index);
17
17
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
18
18
  ...rest,
19
+ "data-array-item-index": index,
19
20
  className: (0, __pixpilot_shadcn_ui.cn)("border-input bg-card rounded-md border transition-colors items-center", hasErrors && "border-destructive border-2", props.className),
20
21
  children
21
22
  });
@@ -11,6 +11,7 @@ const ItemWrapper = (props) => {
11
11
  const hasErrors = hasArrayItemErrors(useField(), index);
12
12
  return /* @__PURE__ */ jsx("div", {
13
13
  ...rest,
14
+ "data-array-item-index": index,
14
15
  className: cn("border-input bg-card rounded-md border transition-colors items-center", hasErrors && "border-destructive border-2", props.className),
15
16
  children
16
17
  });
@@ -20,7 +20,7 @@ __pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
20
20
  * Individual list item component for array items
21
21
  * Displays an item with label and operation controls
22
22
  */
23
- const ListItem = react.default.memo(({ itemKey, index, record, isNew }) => {
23
+ const ListItem = react.default.memo(({ itemKey, index, record, isNew, isAnchor }) => {
24
24
  const schema = (0, __formily_react.useFieldSchema)();
25
25
  const hiddenItemSchema = react.default.useMemo(() => {
26
26
  return require_get_hidden_item_schema.getHiddenItemSchema(schema.items);
@@ -29,9 +29,26 @@ const ListItem = react.default.memo(({ itemKey, index, record, isNew }) => {
29
29
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_array_base.ArrayBase.Item, {
30
30
  index,
31
31
  record,
32
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_SortableItem.SortableItem, {
32
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SortableItem.SortableItem, {
33
33
  id: itemKey,
34
- children: [hiddenItemSchema ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
34
+ children: isAnchor ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.PopoverAnchor, {
35
+ asChild: true,
36
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [hiddenItemSchema ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
37
+ style: { display: "none" },
38
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__formily_react.RecursionField, {
39
+ schema: hiddenItemSchema,
40
+ name: index
41
+ })
42
+ }) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ItemWrapper.ItemWrapper, {
43
+ className: (0, __pixpilot_shadcn.cn)("px-3 pl-4 py-2", isNewItem && "hidden"),
44
+ index,
45
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ArrayItemHeaderRow.ArrayItemHeaderRow, {
46
+ schema,
47
+ index,
48
+ slots: { content: { content: "text-foreground font-medium" } }
49
+ })
50
+ })] })
51
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [hiddenItemSchema ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
35
52
  style: { display: "none" },
36
53
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__formily_react.RecursionField, {
37
54
  schema: hiddenItemSchema,
@@ -45,7 +62,7 @@ const ListItem = react.default.memo(({ itemKey, index, record, isNew }) => {
45
62
  index,
46
63
  slots: { content: { content: "text-foreground font-medium" } }
47
64
  })
48
- })]
65
+ })] })
49
66
  })
50
67
  }, itemKey);
51
68
  });
@@ -7,15 +7,15 @@ import { getHiddenItemSchema } from "./get-hidden-item-schema.js";
7
7
  import { ItemWrapper } from "./ItemWrapper.js";
8
8
  import { RecursionField, useFieldSchema } from "@formily/react";
9
9
  import React from "react";
10
- import { jsx, jsxs } from "react/jsx-runtime";
11
- import { cn } from "@pixpilot/shadcn";
10
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
+ import { PopoverAnchor, cn } from "@pixpilot/shadcn";
12
12
 
13
13
  //#region src/components/array-common/ListItem.tsx
14
14
  /**
15
15
  * Individual list item component for array items
16
16
  * Displays an item with label and operation controls
17
17
  */
18
- const ListItem = React.memo(({ itemKey, index, record, isNew }) => {
18
+ const ListItem = React.memo(({ itemKey, index, record, isNew, isAnchor }) => {
19
19
  const schema = useFieldSchema();
20
20
  const hiddenItemSchema = React.useMemo(() => {
21
21
  return getHiddenItemSchema(schema.items);
@@ -24,9 +24,26 @@ const ListItem = React.memo(({ itemKey, index, record, isNew }) => {
24
24
  return /* @__PURE__ */ jsx(ArrayBase.Item, {
25
25
  index,
26
26
  record,
27
- children: /* @__PURE__ */ jsxs(SortableItem, {
27
+ children: /* @__PURE__ */ jsx(SortableItem, {
28
28
  id: itemKey,
29
- children: [hiddenItemSchema ? /* @__PURE__ */ jsx("div", {
29
+ children: isAnchor ? /* @__PURE__ */ jsx(PopoverAnchor, {
30
+ asChild: true,
31
+ children: /* @__PURE__ */ jsxs("div", { children: [hiddenItemSchema ? /* @__PURE__ */ jsx("div", {
32
+ style: { display: "none" },
33
+ children: /* @__PURE__ */ jsx(RecursionField, {
34
+ schema: hiddenItemSchema,
35
+ name: index
36
+ })
37
+ }) : null, /* @__PURE__ */ jsx(ItemWrapper, {
38
+ className: cn("px-3 pl-4 py-2", isNewItem && "hidden"),
39
+ index,
40
+ children: /* @__PURE__ */ jsx(ArrayItemHeaderRow, {
41
+ schema,
42
+ index,
43
+ slots: { content: { content: "text-foreground font-medium" } }
44
+ })
45
+ })] })
46
+ }) : /* @__PURE__ */ jsxs(Fragment, { children: [hiddenItemSchema ? /* @__PURE__ */ jsx("div", {
30
47
  style: { display: "none" },
31
48
  children: /* @__PURE__ */ jsx(RecursionField, {
32
49
  schema: hiddenItemSchema,
@@ -40,7 +57,7 @@ const ListItem = React.memo(({ itemKey, index, record, isNew }) => {
40
57
  index,
41
58
  slots: { content: { content: "text-foreground font-medium" } }
42
59
  })
43
- })]
60
+ })] })
44
61
  })
45
62
  }, itemKey);
46
63
  });