@pixpilot/formily-shadcn 1.4.5 → 1.6.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/Form.d.ts +2 -2
- package/dist/components/FormGrid.d.ts +2 -2
- package/dist/components/IconPicker.d.ts +3 -3
- package/dist/components/IconToggle.d.cts +2 -2
- package/dist/components/IconToggle.d.ts +3 -3
- package/dist/components/Input.d.cts +3 -3
- package/dist/components/Input.d.ts +3 -3
- package/dist/components/Radio.d.ts +2 -2
- package/dist/components/Rating.d.ts +4 -4
- package/dist/components/Row.d.ts +2 -2
- package/dist/components/Separator.d.cts +2 -2
- package/dist/components/Separator.d.ts +2 -2
- package/dist/components/Switch.d.cts +2 -2
- package/dist/components/Switch.d.ts +2 -2
- package/dist/components/TagsInputInline.d.cts +3 -3
- package/dist/components/TagsInputInline.d.ts +3 -3
- package/dist/components/Textarea.d.cts +2 -2
- package/dist/components/Textarea.d.ts +2 -2
- package/dist/components/ToggleButton.d.cts +3 -3
- package/dist/components/ToggleButton.d.ts +3 -3
- package/dist/components/array-common/ArrayItemDraftFields.cjs +37 -25
- package/dist/components/array-common/ArrayItemDraftFields.js +37 -25
- package/dist/components/array-common/ArrayItemsList.cjs +3 -2
- package/dist/components/array-common/ArrayItemsList.js +3 -2
- package/dist/components/array-common/ItemWrapper.cjs +1 -0
- package/dist/components/array-common/ItemWrapper.js +1 -0
- package/dist/components/array-common/ListItem.cjs +21 -4
- package/dist/components/array-common/ListItem.js +23 -6
- package/dist/components/array-common/use-array-item-draft-form.cjs +31 -15
- package/dist/components/array-common/use-array-item-draft-form.js +31 -15
- package/dist/components/array-common/use-array-item-edit-state.cjs +5 -14
- package/dist/components/array-common/use-array-item-edit-state.js +5 -13
- package/dist/components/array-dialog/ArrayDialog.cjs +8 -4
- package/dist/components/array-dialog/ArrayDialog.js +8 -4
- package/dist/components/array-dialog/EditDialog.cjs +67 -9
- package/dist/components/array-dialog/EditDialog.js +67 -9
- package/dist/components/array-popover/ArrayPopover.cjs +34 -17
- package/dist/components/array-popover/ArrayPopover.js +35 -18
- package/dist/components/array-popover/Popover.cjs +100 -88
- package/dist/components/array-popover/Popover.js +100 -88
- package/dist/components/context/types.d.cts +7 -2
- package/dist/components/context/types.d.ts +7 -2
- package/dist/components/slider/Slider.d.ts +3 -3
- package/dist/components/slider/SliderInput.d.ts +3 -3
- package/package.json +4 -4
|
@@ -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
|
|
4
|
+
import * as react_jsx_runtime2 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):
|
|
28
|
+
}: IFormProps): react_jsx_runtime2.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
|
|
2
|
+
import * as react_jsx_runtime4 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):
|
|
10
|
+
}: IFormGridProps): react_jsx_runtime4.JSX.Element;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { FormGrid };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react29 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:
|
|
11
|
+
declare const IconPicker$1: react29.ForwardRefExoticComponent<Partial<Omit<IconPickerProps, "providers"> & {
|
|
12
12
|
providers?: IconProviderProps[];
|
|
13
|
-
}> &
|
|
13
|
+
}> & react29.RefAttributes<unknown>>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { IconPicker$1 as IconPicker };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react10 from "react";
|
|
2
2
|
import * as _pixpilot_shadcn_ui0 from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/IconToggle.d.ts
|
|
@@ -6,6 +6,6 @@ import * as _pixpilot_shadcn_ui0 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 IconToggle:
|
|
9
|
+
declare const IconToggle: react10.ForwardRefExoticComponent<Omit<Partial<Omit<_pixpilot_shadcn_ui0.IconToggleProps, "ref"> & react10.RefAttributes<HTMLButtonElement>>, "ref"> & react10.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { IconToggle };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as react22 from "react";
|
|
2
|
+
import * as _pixpilot_shadcn_ui2 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:
|
|
9
|
+
declare const IconToggle$1: react22.ForwardRefExoticComponent<Omit<Partial<Omit<_pixpilot_shadcn_ui2.IconToggleProps, "ref"> & react22.RefAttributes<HTMLButtonElement>>, "ref"> & react22.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { IconToggle$1 as IconToggle };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react6 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/components/Input.d.ts
|
|
4
4
|
|
|
@@ -6,12 +6,12 @@ import * as react9 from "react";
|
|
|
6
6
|
* Formily-connected Input component
|
|
7
7
|
* Automatically connects shadcn Input to Formily field state
|
|
8
8
|
*/
|
|
9
|
-
declare const Input:
|
|
9
|
+
declare const Input: react6.ForwardRefExoticComponent<Omit<Partial<react6.ClassAttributes<HTMLInputElement> & react6.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"> &
|
|
15
|
+
}>, "ref"> & react6.RefAttributes<unknown>>;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { Input };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react25 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/components/Input.d.ts
|
|
4
4
|
|
|
@@ -6,12 +6,12 @@ import * as react9 from "react";
|
|
|
6
6
|
* Formily-connected Input component
|
|
7
7
|
* Automatically connects shadcn Input to Formily field state
|
|
8
8
|
*/
|
|
9
|
-
declare const Input:
|
|
9
|
+
declare const Input: react25.ForwardRefExoticComponent<Omit<Partial<react25.ClassAttributes<HTMLInputElement> & react25.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"> &
|
|
15
|
+
}>, "ref"> & react25.RefAttributes<unknown>>;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { Input };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime0 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):
|
|
18
|
+
declare function Radio(props: RadioProps): react_jsx_runtime0.JSX.Element;
|
|
19
19
|
declare namespace Radio {
|
|
20
20
|
var displayName: string;
|
|
21
21
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react4 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:
|
|
10
|
-
children?:
|
|
11
|
-
}> &
|
|
9
|
+
declare const Rating$1: react4.ForwardRefExoticComponent<Partial<_pixpilot_shadcn_ui0.RatingProps & {
|
|
10
|
+
children?: react4.ReactNode | undefined;
|
|
11
|
+
}> & react4.RefAttributes<unknown>>;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { Rating$1 as Rating };
|
package/dist/components/Row.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime1 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):
|
|
39
|
+
}: IRowProps): react_jsx_runtime1.JSX.Element;
|
|
40
40
|
//#endregion
|
|
41
41
|
export { Row };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
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:
|
|
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
|
|
1
|
+
import * as react7 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:
|
|
9
|
+
declare const Separator: react7.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_separator0.SeparatorProps & react7.RefAttributes<HTMLDivElement>>, "ref"> & react7.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Separator };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react21 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:
|
|
9
|
+
declare const Switch: react21.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_switch0.SwitchProps & react21.RefAttributes<HTMLButtonElement>>, "ref"> & react21.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Switch };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react10 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:
|
|
9
|
+
declare const Switch: react10.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_switch0.SwitchProps & react10.RefAttributes<HTMLButtonElement>>, "ref"> & react10.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Switch };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as react19 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_ui2 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:
|
|
13
|
+
declare const TagsInputInLine: react19.ForwardRefExoticComponent<Partial<_pixpilot_shadcn_ui1.TagsInputProps> & react19.RefAttributes<unknown>>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { TagsInputInLine };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as react13 from "react";
|
|
2
|
+
import * as _pixpilot_shadcn_ui0 from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/TagsInputInline.d.ts
|
|
5
5
|
|
|
@@ -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:
|
|
13
|
+
declare const TagsInputInLine: react13.ForwardRefExoticComponent<Partial<_pixpilot_shadcn_ui0.TagsInputProps> & react13.RefAttributes<unknown>>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { TagsInputInLine };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
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:
|
|
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,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react15 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:
|
|
7
|
+
declare const Textarea: react15.ForwardRefExoticComponent<Omit<Partial<react15.ClassAttributes<HTMLTextAreaElement> & react15.TextareaHTMLAttributes<HTMLTextAreaElement>>, "ref"> & react15.RefAttributes<unknown>>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { Textarea };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
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:
|
|
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
|
|
2
|
-
import * as
|
|
1
|
+
import * as react19 from "react";
|
|
2
|
+
import * as _pixpilot_shadcn_ui1 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:
|
|
9
|
+
declare const ToggleButton$1: react19.ForwardRefExoticComponent<Omit<Partial<Omit<_pixpilot_shadcn_ui1.ToggleButtonProps, "ref"> & react19.RefAttributes<HTMLButtonElement>>, "ref"> & react19.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
|
-
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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.
|
|
32
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SortableItem.SortableItem, {
|
|
33
33
|
id: itemKey,
|
|
34
|
-
children:
|
|
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
|
});
|