@pixpilot/formily-shadcn 1.4.3 → 1.4.5

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.
@@ -2,7 +2,7 @@ import { FormContextStates } from "./context/form-context.cjs";
2
2
  import "./context/index.cjs";
3
3
  import React from "react";
4
4
  import { Form } from "@formily/core";
5
- import * as react_jsx_runtime1 from "react/jsx-runtime";
5
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
6
6
 
7
7
  //#region src/components/Form.d.ts
8
8
  interface IFormProps extends FormContextStates {
@@ -25,6 +25,6 @@ declare function Form$1({
25
25
  onAutoSubmit,
26
26
  layout,
27
27
  settings
28
- }: IFormProps): react_jsx_runtime1.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_runtime0 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_runtime0.JSX.Element;
10
+ }: IFormGridProps): react_jsx_runtime1.JSX.Element;
11
11
  //#endregion
12
12
  export { FormGrid };
@@ -1,4 +1,4 @@
1
- import * as react8 from "react";
1
+ import * as react4 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: react8.ForwardRefExoticComponent<Partial<Omit<IconPickerProps, "providers"> & {
11
+ declare const IconPicker: react4.ForwardRefExoticComponent<Partial<Omit<IconPickerProps, "providers"> & {
12
12
  providers?: IconProviderProps[];
13
- }> & react8.RefAttributes<unknown>>;
13
+ }> & react4.RefAttributes<unknown>>;
14
14
  //#endregion
15
15
  export { IconPicker };
@@ -1,4 +1,4 @@
1
- import * as react10 from "react";
1
+ import * as react6 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: react10.ForwardRefExoticComponent<Omit<Partial<Omit<_pixpilot_shadcn_ui0.IconToggleProps, "ref"> & react10.RefAttributes<HTMLButtonElement>>, "ref"> & react10.RefAttributes<unknown>>;
9
+ declare const IconToggle: react6.ForwardRefExoticComponent<Omit<Partial<Omit<_pixpilot_shadcn_ui0.IconToggleProps, "ref"> & react6.RefAttributes<HTMLButtonElement>>, "ref"> & react6.RefAttributes<unknown>>;
10
10
  //#endregion
11
11
  export { IconToggle };
@@ -1,4 +1,4 @@
1
- import * as react4 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 react4 from "react";
6
6
  * Formily-connected Input component
7
7
  * Automatically connects shadcn Input to Formily field state
8
8
  */
9
- declare const Input: react4.ForwardRefExoticComponent<Omit<Partial<react4.ClassAttributes<HTMLInputElement> & react4.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"> & react4.RefAttributes<unknown>>;
15
+ }>, "ref"> & react9.RefAttributes<unknown>>;
16
16
  //#endregion
17
17
  export { Input };
@@ -1,5 +1,5 @@
1
- import * as react26 from "react";
2
- import * as _pixpilot_shadcn_ui1 from "@pixpilot/shadcn-ui";
1
+ import * as react25 from "react";
2
+ import * as _pixpilot_shadcn_ui2 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: react26.ForwardRefExoticComponent<Partial<_pixpilot_shadcn_ui1.TagsInputProps> & react26.RefAttributes<unknown>>;
13
+ declare const TagsInputInLine: react25.ForwardRefExoticComponent<Partial<_pixpilot_shadcn_ui2.TagsInputProps> & react25.RefAttributes<unknown>>;
14
14
  //#endregion
15
15
  export { TagsInputInLine };
@@ -1,9 +1,9 @@
1
- import * as react22 from "react";
1
+ import * as react27 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: react22.ForwardRefExoticComponent<Omit<Partial<react22.ClassAttributes<HTMLTextAreaElement> & react22.TextareaHTMLAttributes<HTMLTextAreaElement>>, "ref"> & react22.RefAttributes<unknown>>;
7
+ declare const Textarea: react27.ForwardRefExoticComponent<Omit<Partial<react27.ClassAttributes<HTMLTextAreaElement> & react27.TextareaHTMLAttributes<HTMLTextAreaElement>>, "ref"> & react27.RefAttributes<unknown>>;
8
8
  //#endregion
9
9
  export { Textarea };
@@ -1,11 +1,11 @@
1
- import * as react28 from "react";
2
- import * as _pixpilot_shadcn_ui2 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/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: react28.ForwardRefExoticComponent<Omit<Partial<Omit<_pixpilot_shadcn_ui2.ToggleButtonProps, "ref"> & react28.RefAttributes<HTMLButtonElement>>, "ref"> & react28.RefAttributes<unknown>>;
9
+ declare const ToggleButton: react22.ForwardRefExoticComponent<Omit<Partial<Omit<_pixpilot_shadcn_ui1.ToggleButtonProps, "ref"> & react22.RefAttributes<HTMLButtonElement>>, "ref"> & react22.RefAttributes<unknown>>;
10
10
  //#endregion
11
11
  export { ToggleButton };
@@ -42,7 +42,7 @@ function ArrayAddition({ ref,...props }) {
42
42
  if (e.defaultPrevented) return;
43
43
  }
44
44
  const defaultValue = require_get_default_value.getDefaultValue(props.defaultValue, array.schema);
45
- if (!(array.props?.autoSave === true)) {
45
+ if (array.props?.autoSave === false) {
46
46
  const method = props.method ?? "push";
47
47
  const insertionIndex = method === "unshift" ? 0 : currentLength;
48
48
  array.props?.onAdd?.(insertionIndex, {
@@ -36,7 +36,7 @@ function ArrayAddition({ ref,...props }) {
36
36
  if (e.defaultPrevented) return;
37
37
  }
38
38
  const defaultValue = getDefaultValue(props.defaultValue, array.schema);
39
- if (!(array.props?.autoSave === true)) {
39
+ if (array.props?.autoSave === false) {
40
40
  const method = props.method ?? "push";
41
41
  const insertionIndex = method === "unshift" ? 0 : currentLength;
42
42
  array.props?.onAdd?.(insertionIndex, {
@@ -35,6 +35,7 @@ const ArrayDialogBase = (0, __formily_react.observer)((props) => {
35
35
  const items = require_use_array_item_schema.useArrayItemSchema();
36
36
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_array_base.ArrayBase, {
37
37
  ...props,
38
+ autoSave: autoSave ?? false,
38
39
  transformActions,
39
40
  onAdd: handleAdd,
40
41
  onRemove,
@@ -31,6 +31,7 @@ const ArrayDialogBase = observer((props) => {
31
31
  const items = useArrayItemSchema();
32
32
  return /* @__PURE__ */ jsxs(ArrayBase, {
33
33
  ...props,
34
+ autoSave: autoSave ?? false,
34
35
  transformActions,
35
36
  onAdd: handleAdd,
36
37
  onRemove,
@@ -1,4 +1,6 @@
1
1
  const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
+ const require_use_form_context = require('../../hooks/use-form-context.cjs');
3
+ require('../../hooks/index.cjs');
2
4
  const require_ArrayItemDraftFields = require('../array-common/ArrayItemDraftFields.cjs');
3
5
  const require_ShakeStyles = require('../array-common/ShakeStyles.cjs');
4
6
  const require_use_array_item_edit_state = require('../array-common/use-array-item-edit-state.cjs');
@@ -26,12 +28,14 @@ const EditDialog = (0, __formily_react.observer)(({ schema, onSave, onAutoSave,
26
28
  onAutoSave,
27
29
  autoSave
28
30
  });
31
+ const { settings = {} } = require_use_form_context.useFormContext();
29
32
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn_ui.Dialog, {
30
33
  open,
31
34
  onOpenChange: (isOpen) => {
32
35
  if (!isOpen) handleCancel();
33
36
  },
34
37
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn_ui.DialogContent, {
38
+ ...settings.dialog,
35
39
  ...rest,
36
40
  className: (0, __pixpilot_shadcn_ui.cn)("sm:max-w-[525px]", shouldShake && "pp-shake", className),
37
41
  onInteractOutside: (event) => {
@@ -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";
@@ -21,12 +23,14 @@ const EditDialog = observer(({ schema, onSave, onAutoSave, onCancel, activeItemM
21
23
  onAutoSave,
22
24
  autoSave
23
25
  });
26
+ const { settings = {} } = useFormContext();
24
27
  return /* @__PURE__ */ jsx(Dialog, {
25
28
  open,
26
29
  onOpenChange: (isOpen) => {
27
30
  if (!isOpen) handleCancel();
28
31
  },
29
32
  children: /* @__PURE__ */ jsxs(DialogContent, {
33
+ ...settings.dialog,
30
34
  ...rest,
31
35
  className: cn("sm:max-w-[525px]", shouldShake && "pp-shake", className),
32
36
  onInteractOutside: (event) => {
@@ -28,6 +28,7 @@ const ArrayPopoverBase = (0, __formily_react.observer)((props) => {
28
28
  const schema = require_use_array_item_schema.useArrayItemSchema();
29
29
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_array_base.ArrayBase, {
30
30
  ...props,
31
+ autoSave,
31
32
  transformActions,
32
33
  onAdd: handleAdd,
33
34
  onRemove,
@@ -23,6 +23,7 @@ const ArrayPopoverBase = observer((props) => {
23
23
  const schema = useArrayItemSchema();
24
24
  return /* @__PURE__ */ jsx(ArrayBase, {
25
25
  ...props,
26
+ autoSave,
26
27
  transformActions,
27
28
  onAdd: handleAdd,
28
29
  onRemove,
@@ -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 { FileUploadProgressCallBacks, IconProvider, RichTextEditorProps } from "@pixpilot/shadcn-ui";
5
+ import { DialogContentProps, FileUploadProgressCallBacks, IconProvider, RichTextEditorProps } from "@pixpilot/shadcn-ui";
6
6
 
7
7
  //#region src/components/context/types.d.ts
8
8
  interface FomFileUpload {
@@ -37,6 +37,7 @@ interface FormSettings {
37
37
  actions?: ActionItem[] | false;
38
38
  };
39
39
  };
40
+ dialog?: DialogContentProps;
40
41
  }
41
42
  /**
42
43
  * 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 { FileUploadProgressCallBacks, IconProvider, RichTextEditorProps } from "@pixpilot/shadcn-ui";
5
+ import { DialogContentProps, FileUploadProgressCallBacks, IconProvider, RichTextEditorProps } from "@pixpilot/shadcn-ui";
6
6
 
7
7
  //#region src/components/context/types.d.ts
8
8
  interface FomFileUpload {
@@ -37,6 +37,7 @@ interface FormSettings {
37
37
  actions?: ActionItem[] | false;
38
38
  };
39
39
  };
40
+ dialog?: DialogContentProps;
40
41
  }
41
42
  /**
42
43
  * Layout configuration options for form components.