@pixpilot/formily-shadcn 1.5.0 → 1.7.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/Checkbox.d.cts +2 -2
- package/dist/components/Checkbox.d.ts +2 -2
- package/dist/components/Column.d.ts +2 -2
- package/dist/components/DatePicker.d.cts +3 -3
- package/dist/components/DatePicker.d.ts +3 -3
- 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.ts +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.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 +2 -2
- 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 +2 -2
- package/dist/components/ToggleButton.d.ts +3 -3
- 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 +12 -4
- package/dist/components/array-dialog/EditDialog.js +12 -4
- package/dist/components/array-popover/ArrayPopover.cjs +5 -1
- package/dist/components/array-popover/ArrayPopover.js +5 -1
- package/dist/components/array-popover/Popover.cjs +15 -3
- package/dist/components/array-popover/Popover.js +16 -4
- package/dist/components/context/types.d.cts +7 -2
- package/dist/components/context/types.d.ts +7 -2
- package/dist/components/file-upload/FileUpload.d.ts +8 -8
- package/dist/components/file-upload/FileUploadInline.d.ts +8 -8
- package/dist/components/schema-field/schema-field-basics.d.ts +303 -303
- package/dist/components/schema-field/schema-field-extended.d.cts +632 -632
- package/dist/components/schema-field/schema-field-extended.d.ts +633 -633
- package/dist/components/schema-field/schema-field.d.cts +412 -412
- package/dist/components/schema-field/schema-field.d.ts +412 -412
- package/dist/components/slider/Slider.d.ts +2 -2
- package/dist/components/slider/SliderInput.d.ts +2 -2
- package/dist/components/slider/SliderSelect.d.ts +2 -2
- package/package.json +4 -4
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { useFormContext } from "../../hooks/use-form-context.js";
|
|
2
|
+
import "../../hooks/index.js";
|
|
1
3
|
import { ArrayItemDraftFields } from "../array-common/ArrayItemDraftFields.js";
|
|
2
4
|
import { ShakeStyles } from "../array-common/ShakeStyles.js";
|
|
3
5
|
import { useArrayItemEditState } from "../array-common/use-array-item-edit-state.js";
|
|
@@ -5,10 +7,10 @@ import { observer } from "@formily/react";
|
|
|
5
7
|
import React from "react";
|
|
6
8
|
import { XIcon } from "lucide-react";
|
|
7
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
import { Button, PopoverContent } from "@pixpilot/shadcn";
|
|
10
|
+
import { Button, PopoverContent, cn } from "@pixpilot/shadcn";
|
|
9
11
|
|
|
10
12
|
//#region src/components/array-popover/Popover.tsx
|
|
11
|
-
const ArrayItemsEditPopover = observer(({ schema, onSave, onAutoSave, onCancel, activeItemManager, autoSave,...rest }) => {
|
|
13
|
+
const ArrayItemsEditPopover = observer(({ schema, onSave, onAutoSave, onCancel, activeItemManager, autoSave, className,...rest }) => {
|
|
12
14
|
const { arrayField, activeIndex, isNewItem, normalizedAutoSave, draftForm, basePath, validationPath, isolatedForm, isDirty, title, description, shouldShake, triggerShake, handleSave, handleCancel } = useArrayItemEditState({
|
|
13
15
|
schema,
|
|
14
16
|
activeItemManager,
|
|
@@ -17,6 +19,12 @@ const ArrayItemsEditPopover = observer(({ schema, onSave, onAutoSave, onCancel,
|
|
|
17
19
|
onAutoSave,
|
|
18
20
|
autoSave
|
|
19
21
|
});
|
|
22
|
+
const { settings = {} } = useFormContext();
|
|
23
|
+
const { autoSave: _globalAutoSave,...popoverSettings } = settings.popover || {};
|
|
24
|
+
const contentProps = {
|
|
25
|
+
...popoverSettings,
|
|
26
|
+
...rest
|
|
27
|
+
};
|
|
20
28
|
const handleDiscard = React.useCallback(() => {
|
|
21
29
|
if (activeIndex === void 0) return;
|
|
22
30
|
if (normalizedAutoSave && isNewItem) arrayField.remove?.(activeIndex).catch(console.error);
|
|
@@ -48,10 +56,12 @@ const ArrayItemsEditPopover = observer(({ schema, onSave, onAutoSave, onCancel,
|
|
|
48
56
|
validationPath
|
|
49
57
|
]);
|
|
50
58
|
return /* @__PURE__ */ jsxs(PopoverContent, {
|
|
51
|
-
className: shouldShake ? "relative w-96 pp-shake" : "relative w-96",
|
|
52
59
|
side: "top",
|
|
53
|
-
...
|
|
60
|
+
...contentProps,
|
|
61
|
+
className: cn(shouldShake ? "relative w-96 pp-shake" : "relative w-96", contentProps.className, className),
|
|
54
62
|
onInteractOutside: (event) => {
|
|
63
|
+
contentProps.onInteractOutside?.(event);
|
|
64
|
+
if (event.defaultPrevented) return;
|
|
55
65
|
if (isDirty) {
|
|
56
66
|
event.preventDefault();
|
|
57
67
|
triggerShake();
|
|
@@ -61,6 +71,8 @@ const ArrayItemsEditPopover = observer(({ schema, onSave, onAutoSave, onCancel,
|
|
|
61
71
|
validateAndClose();
|
|
62
72
|
},
|
|
63
73
|
onEscapeKeyDown: (event) => {
|
|
74
|
+
contentProps.onEscapeKeyDown?.(event);
|
|
75
|
+
if (event.defaultPrevented) return;
|
|
64
76
|
if (isDirty) {
|
|
65
77
|
event.preventDefault();
|
|
66
78
|
triggerShake();
|
|
@@ -2,7 +2,7 @@ import { ActionItem } from "../array-base/types.cjs";
|
|
|
2
2
|
import "../array-base/index.cjs";
|
|
3
3
|
import { FormSpace } from "../../types/form.cjs";
|
|
4
4
|
import { DescriptionPlacement, LabelPlacement } from "../../types/form-item.cjs";
|
|
5
|
-
import { DialogContentProps, FileUploadProgressCallBacks, IconProvider, RichTextEditorProps } from "@pixpilot/shadcn-ui";
|
|
5
|
+
import { DialogContentProps, FileUploadProgressCallBacks, IconProvider, PopoverContentProps, RichTextEditorProps } from "@pixpilot/shadcn-ui";
|
|
6
6
|
|
|
7
7
|
//#region src/components/context/types.d.ts
|
|
8
8
|
interface FomFileUpload {
|
|
@@ -37,7 +37,12 @@ interface FormSettings {
|
|
|
37
37
|
actions?: ActionItem[] | false;
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
|
-
dialog?: DialogContentProps
|
|
40
|
+
dialog?: DialogContentProps & {
|
|
41
|
+
autoSave?: boolean;
|
|
42
|
+
};
|
|
43
|
+
popover?: PopoverContentProps & {
|
|
44
|
+
autoSave?: boolean;
|
|
45
|
+
};
|
|
41
46
|
}
|
|
42
47
|
/**
|
|
43
48
|
* Layout configuration options for form components.
|
|
@@ -2,7 +2,7 @@ import { ActionItem } from "../array-base/types.js";
|
|
|
2
2
|
import "../array-base/index.js";
|
|
3
3
|
import { FormSpace } from "../../types/form.js";
|
|
4
4
|
import { DescriptionPlacement, LabelPlacement } from "../../types/form-item.js";
|
|
5
|
-
import { DialogContentProps, FileUploadProgressCallBacks, IconProvider, RichTextEditorProps } from "@pixpilot/shadcn-ui";
|
|
5
|
+
import { DialogContentProps, FileUploadProgressCallBacks, IconProvider, PopoverContentProps, RichTextEditorProps } from "@pixpilot/shadcn-ui";
|
|
6
6
|
|
|
7
7
|
//#region src/components/context/types.d.ts
|
|
8
8
|
interface FomFileUpload {
|
|
@@ -37,7 +37,12 @@ interface FormSettings {
|
|
|
37
37
|
actions?: ActionItem[] | false;
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
|
-
dialog?: DialogContentProps
|
|
40
|
+
dialog?: DialogContentProps & {
|
|
41
|
+
autoSave?: boolean;
|
|
42
|
+
};
|
|
43
|
+
popover?: PopoverContentProps & {
|
|
44
|
+
autoSave?: boolean;
|
|
45
|
+
};
|
|
41
46
|
}
|
|
42
47
|
/**
|
|
43
48
|
* Layout configuration options for form components.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _pixpilot_shadcn_ui511 from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/file-upload/FileUpload.d.ts
|
|
5
5
|
|
|
@@ -7,14 +7,14 @@ import * as _pixpilot_shadcn_ui13 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 FileUpload$1: React.ForwardRefExoticComponent<(Omit<Partial<
|
|
10
|
+
declare const FileUpload$1: React.ForwardRefExoticComponent<(Omit<Partial<_pixpilot_shadcn_ui511.FileUploadInlineBaseProps & _pixpilot_shadcn_ui511.FileUploadRootPropsBaseProps & {
|
|
11
11
|
multiple: true;
|
|
12
|
-
value?:
|
|
13
|
-
onChange?:
|
|
14
|
-
} &
|
|
12
|
+
value?: _pixpilot_shadcn_ui511.FileMetadata[];
|
|
13
|
+
onChange?: _pixpilot_shadcn_ui511.OnChangeMultipleFiles;
|
|
14
|
+
} & _pixpilot_shadcn_ui511.FileUploadBaseProps>, "ref"> | Omit<Partial<_pixpilot_shadcn_ui511.FileUploadInlineBaseProps & _pixpilot_shadcn_ui511.FileUploadRootPropsBaseProps & {
|
|
15
15
|
multiple?: false;
|
|
16
|
-
value?:
|
|
17
|
-
onChange?:
|
|
18
|
-
} &
|
|
16
|
+
value?: _pixpilot_shadcn_ui511.FileMetadata | null;
|
|
17
|
+
onChange?: _pixpilot_shadcn_ui511.OnChangeSingleFile;
|
|
18
|
+
} & _pixpilot_shadcn_ui511.FileUploadBaseProps>, "ref">) & React.RefAttributes<unknown>>;
|
|
19
19
|
//#endregion
|
|
20
20
|
export { FileUpload$1 as FileUpload };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _pixpilot_shadcn_ui501 from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/file-upload/FileUploadInline.d.ts
|
|
5
5
|
|
|
@@ -7,14 +7,14 @@ import * as _pixpilot_shadcn_ui3 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$1: React.ForwardRefExoticComponent<(Omit<Partial<
|
|
10
|
+
declare const FileUploadInline$1: React.ForwardRefExoticComponent<(Omit<Partial<_pixpilot_shadcn_ui501.FileUploadInlineBaseProps & _pixpilot_shadcn_ui501.FileUploadRootPropsBaseProps & {
|
|
11
11
|
multiple: true;
|
|
12
|
-
value?:
|
|
13
|
-
onChange?:
|
|
14
|
-
} &
|
|
12
|
+
value?: _pixpilot_shadcn_ui501.FileMetadata[];
|
|
13
|
+
onChange?: _pixpilot_shadcn_ui501.OnChangeMultipleFiles;
|
|
14
|
+
} & _pixpilot_shadcn_ui501.FileUploadBaseProps>, "ref"> | Omit<Partial<_pixpilot_shadcn_ui501.FileUploadInlineBaseProps & _pixpilot_shadcn_ui501.FileUploadRootPropsBaseProps & {
|
|
15
15
|
multiple?: false;
|
|
16
|
-
value?:
|
|
17
|
-
onChange?:
|
|
18
|
-
} &
|
|
16
|
+
value?: _pixpilot_shadcn_ui501.FileMetadata | null;
|
|
17
|
+
onChange?: _pixpilot_shadcn_ui501.OnChangeSingleFile;
|
|
18
|
+
} & _pixpilot_shadcn_ui501.FileUploadBaseProps>, "ref">) & React.RefAttributes<unknown>>;
|
|
19
19
|
//#endregion
|
|
20
20
|
export { FileUploadInline$1 as FileUploadInline };
|