@pixpilot/formily-shadcn 0.10.0 → 0.11.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/README.md +27 -1
- package/dist/components/checkbox.d.cts +2 -2
- package/dist/components/context/context.d.cts +1 -1
- package/dist/components/context/context.d.ts +1 -1
- package/dist/components/context/form-context.d.cts +34 -5
- package/dist/components/context/form-context.d.ts +34 -5
- package/dist/components/context/index.d.cts +1 -1
- package/dist/components/context/index.d.ts +1 -1
- package/dist/components/date-picker.d.cts +3 -3
- package/dist/components/file-upload/file-upload-inline.d.cts +8 -8
- package/dist/components/file-upload/file-upload.d.cts +8 -8
- package/dist/components/form-grid.d.cts +2 -2
- package/dist/components/form-item/base-form-item.cjs +85 -0
- package/dist/components/form-item/base-form-item.d.cts +2 -0
- package/dist/components/form-item/base-form-item.d.ts +2 -0
- package/dist/components/form-item/base-form-item.js +80 -0
- package/dist/components/form-item/connected-form-item.cjs +47 -0
- package/dist/components/form-item/connected-form-item.d.cts +13 -0
- package/dist/components/form-item/connected-form-item.d.ts +13 -0
- package/dist/components/form-item/connected-form-item.js +44 -0
- package/dist/components/form-item/form-item-description-popover.cjs +42 -0
- package/dist/components/form-item/form-item-description-popover.js +37 -0
- package/dist/components/form-item/form-item-label.cjs +29 -0
- package/dist/components/form-item/form-item-label.js +25 -0
- package/dist/components/form-item/form-item-types.d.cts +23 -0
- package/dist/components/form-item/form-item-types.d.ts +23 -0
- package/dist/components/form-item/form-item.cjs +2 -0
- package/dist/components/form-item/form-item.d.cts +4 -0
- package/dist/components/form-item/form-item.d.ts +4 -0
- package/dist/components/form-item/form-item.js +2 -0
- package/dist/components/form-item/index.cjs +3 -0
- package/dist/components/form-item/index.d.cts +4 -0
- package/dist/components/form-item/index.d.ts +4 -0
- package/dist/components/form-item/index.js +3 -0
- package/dist/components/form-item/spacing-config.cjs +24 -0
- package/dist/components/form-item/spacing-config.js +23 -0
- package/dist/components/form-items-container.cjs +2 -1
- package/dist/components/form-items-container.js +2 -1
- package/dist/components/form.cjs +4 -11
- package/dist/components/form.d.cts +3 -5
- package/dist/components/form.d.ts +1 -3
- package/dist/components/form.js +4 -11
- package/dist/components/icon-picker.d.cts +3 -3
- package/dist/components/icon-picker.d.ts +3 -3
- package/dist/components/input.d.ts +2 -2
- package/dist/components/json-schema-form-renderer/index.cjs +4 -0
- package/dist/components/json-schema-form-renderer/index.d.cts +5 -0
- package/dist/components/json-schema-form-renderer/index.d.ts +5 -0
- package/dist/components/json-schema-form-renderer/index.js +4 -0
- package/dist/components/json-schema-form-renderer/json-schema-form-basic.cjs +35 -0
- package/dist/components/json-schema-form-renderer/json-schema-form-basic.d.cts +14 -0
- package/dist/components/json-schema-form-renderer/json-schema-form-basic.d.ts +14 -0
- package/dist/components/json-schema-form-renderer/json-schema-form-basic.js +32 -0
- package/dist/components/json-schema-form-renderer/json-schema-form-extended.cjs +35 -0
- package/dist/components/json-schema-form-renderer/json-schema-form-extended.d.cts +14 -0
- package/dist/components/json-schema-form-renderer/json-schema-form-extended.d.ts +14 -0
- package/dist/components/json-schema-form-renderer/json-schema-form-extended.js +32 -0
- package/dist/components/{json-schema-form-renderer.cjs → json-schema-form-renderer/json-schema-form-renderer.cjs} +14 -15
- package/dist/components/json-schema-form-renderer/json-schema-form-renderer.d.cts +7 -0
- package/dist/components/json-schema-form-renderer/json-schema-form-renderer.d.ts +7 -0
- package/dist/components/{json-schema-form-renderer.js → json-schema-form-renderer/json-schema-form-renderer.js} +13 -14
- package/dist/components/json-schema-form-renderer/json-schema-form.cjs +36 -0
- package/dist/components/json-schema-form-renderer/json-schema-form.d.cts +14 -0
- package/dist/components/json-schema-form-renderer/json-schema-form.d.ts +14 -0
- package/dist/components/json-schema-form-renderer/json-schema-form.js +33 -0
- package/dist/components/json-schema-form-renderer/types.d.cts +23 -0
- package/dist/components/json-schema-form-renderer/types.d.ts +23 -0
- package/dist/components/number-input.d.ts +2 -2
- package/dist/components/object-container.cjs +13 -6
- package/dist/components/object-container.js +13 -6
- package/dist/components/radio.d.cts +2 -2
- package/dist/components/row.d.cts +2 -2
- package/dist/components/schema-field/index.d.cts +3 -3
- package/dist/components/schema-field/index.d.ts +3 -3
- package/dist/components/schema-field/index.js +3 -3
- package/dist/components/schema-field/schema-field-basics.cjs +66 -23
- package/dist/components/schema-field/schema-field-basics.d.cts +283 -198
- package/dist/components/schema-field/schema-field-basics.d.ts +295 -210
- package/dist/components/schema-field/schema-field-basics.js +65 -23
- package/dist/components/schema-field/schema-field-extended.cjs +23 -8
- package/dist/components/schema-field/schema-field-extended.d.cts +569 -434
- package/dist/components/schema-field/schema-field-extended.d.ts +569 -434
- package/dist/components/schema-field/schema-field-extended.js +23 -9
- package/dist/components/schema-field/schema-field.cjs +23 -8
- package/dist/components/schema-field/schema-field.d.cts +341 -240
- package/dist/components/schema-field/schema-field.d.ts +340 -239
- package/dist/components/schema-field/schema-field.js +23 -9
- package/dist/components/separator.d.cts +2 -2
- package/dist/components/separator.d.ts +2 -2
- package/dist/components/slider.d.cts +2 -2
- package/dist/components/slider.d.ts +2 -2
- package/dist/components/switch.d.cts +2 -2
- package/dist/components/switch.d.ts +2 -2
- package/dist/components/tags-input-inline.d.cts +2 -2
- package/dist/components/tags-input-inline.d.ts +2 -2
- package/dist/components/textarea.d.cts +2 -2
- package/dist/components/textarea.d.ts +2 -2
- package/dist/index.cjs +17 -6
- package/dist/index.d.cts +14 -6
- package/dist/index.d.ts +14 -6
- package/dist/index.js +11 -6
- package/dist/types/form-item.d.cts +5 -0
- package/dist/types/form-item.d.ts +5 -0
- package/dist/utils/extract-components.cjs +11 -0
- package/dist/utils/extract-components.js +10 -0
- package/package.json +5 -5
- package/dist/components/form-item.cjs +0 -118
- package/dist/components/form-item.d.cts +0 -22
- package/dist/components/form-item.d.ts +0 -22
- package/dist/components/form-item.js +0 -112
- package/dist/components/json-schema-form-renderer.d.cts +0 -20
- package/dist/components/json-schema-form-renderer.d.ts +0 -20
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { HelpCircleIcon } from "lucide-react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Popover, PopoverContent, PopoverTrigger, cn } from "@pixpilot/shadcn";
|
|
5
|
+
|
|
6
|
+
//#region src/components/form-item/form-item-description-popover.tsx
|
|
7
|
+
function FormItemDescriptionPopover({ description, className }) {
|
|
8
|
+
const [open, setOpen] = React.useState(false);
|
|
9
|
+
return /* @__PURE__ */ jsxs(Popover, {
|
|
10
|
+
open,
|
|
11
|
+
onOpenChange: setOpen,
|
|
12
|
+
children: [/* @__PURE__ */ jsx(PopoverTrigger, {
|
|
13
|
+
asChild: true,
|
|
14
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
15
|
+
type: "button",
|
|
16
|
+
"aria-label": "Show description",
|
|
17
|
+
className: cn("text-muted-foreground inline-flex items-center justify-center rounded-sm hover:text-foreground transition-colors", className),
|
|
18
|
+
onMouseEnter: () => setOpen(true),
|
|
19
|
+
onMouseLeave: () => setOpen(false),
|
|
20
|
+
onClick: () => setOpen((prev) => !prev),
|
|
21
|
+
children: /* @__PURE__ */ jsx(HelpCircleIcon, { className: "h-4 w-4" })
|
|
22
|
+
})
|
|
23
|
+
}), /* @__PURE__ */ jsx(PopoverContent, {
|
|
24
|
+
side: "top",
|
|
25
|
+
className: "w-80 bg-card border border-border",
|
|
26
|
+
onMouseEnter: () => setOpen(true),
|
|
27
|
+
onMouseLeave: () => setOpen(false),
|
|
28
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
29
|
+
className: "text-sm leading-relaxed text-foreground",
|
|
30
|
+
children: description
|
|
31
|
+
})
|
|
32
|
+
})]
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
export { FormItemDescriptionPopover };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_form_item_description_popover = require('./form-item-description-popover.cjs');
|
|
3
|
+
let react = require("react");
|
|
4
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
+
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
7
|
+
let __pixpilot_shadcn = require("@pixpilot/shadcn");
|
|
8
|
+
__pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
|
|
9
|
+
|
|
10
|
+
//#region src/components/form-item/form-item-label.tsx
|
|
11
|
+
function FormItemLabel({ id, label, asterisk, error, shrink, labelClassName, description, descriptionInPopover }) {
|
|
12
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
13
|
+
htmlFor: id,
|
|
14
|
+
"data-slot": "form-label",
|
|
15
|
+
"data-error": Boolean(error),
|
|
16
|
+
className: (0, __pixpilot_shadcn.cn)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", error && "text-destructive", shrink && "shrink-0", labelClassName),
|
|
17
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
18
|
+
className: "inline-flex items-center gap-1",
|
|
19
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: label }), descriptionInPopover && description != null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_form_item_description_popover.FormItemDescriptionPopover, { description })]
|
|
20
|
+
}), asterisk && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
21
|
+
className: "text-destructive ml-1",
|
|
22
|
+
"aria-label": "required",
|
|
23
|
+
children: "*"
|
|
24
|
+
})]
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
exports.FormItemLabel = FormItemLabel;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FormItemDescriptionPopover } from "./form-item-description-popover.js";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { cn } from "@pixpilot/shadcn";
|
|
5
|
+
|
|
6
|
+
//#region src/components/form-item/form-item-label.tsx
|
|
7
|
+
function FormItemLabel({ id, label, asterisk, error, shrink, labelClassName, description, descriptionInPopover }) {
|
|
8
|
+
return /* @__PURE__ */ jsxs("label", {
|
|
9
|
+
htmlFor: id,
|
|
10
|
+
"data-slot": "form-label",
|
|
11
|
+
"data-error": Boolean(error),
|
|
12
|
+
className: cn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", error && "text-destructive", shrink && "shrink-0", labelClassName),
|
|
13
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
14
|
+
className: "inline-flex items-center gap-1",
|
|
15
|
+
children: [/* @__PURE__ */ jsx("span", { children: label }), descriptionInPopover && description != null && /* @__PURE__ */ jsx(FormItemDescriptionPopover, { description })]
|
|
16
|
+
}), asterisk && /* @__PURE__ */ jsx("span", {
|
|
17
|
+
className: "text-destructive ml-1",
|
|
18
|
+
"aria-label": "required",
|
|
19
|
+
children: "*"
|
|
20
|
+
})]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { FormItemLabel };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DescriptionPlacement } from "../../types/form-item.cjs";
|
|
2
|
+
import { SyncReactNode } from "../../types/react.cjs";
|
|
3
|
+
import React from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/form-item/form-item-types.d.ts
|
|
6
|
+
type LabelPlacement = 'top' | 'bottom' | 'start' | 'end';
|
|
7
|
+
interface FormItemProps extends React.ComponentProps<'div'> {
|
|
8
|
+
label?: SyncReactNode;
|
|
9
|
+
description?: SyncReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* Controls where `description` is rendered relative to the input.
|
|
12
|
+
* - `top`: above the input
|
|
13
|
+
* - `bottom`: below the input
|
|
14
|
+
* - `popover`: show a help icon before the label and render the description in a hover popover
|
|
15
|
+
*/
|
|
16
|
+
descriptionPlacement?: DescriptionPlacement;
|
|
17
|
+
asterisk?: boolean;
|
|
18
|
+
feedbackStatus?: 'error' | 'warning' | 'success';
|
|
19
|
+
feedbackText?: SyncReactNode;
|
|
20
|
+
labelPlacement?: LabelPlacement;
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { FormItemProps, LabelPlacement };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DescriptionPlacement } from "../../types/form-item.js";
|
|
2
|
+
import { SyncReactNode } from "../../types/react.js";
|
|
3
|
+
import React from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/form-item/form-item-types.d.ts
|
|
6
|
+
type LabelPlacement = 'top' | 'bottom' | 'start' | 'end';
|
|
7
|
+
interface FormItemProps extends React.ComponentProps<'div'> {
|
|
8
|
+
label?: SyncReactNode;
|
|
9
|
+
description?: SyncReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* Controls where `description` is rendered relative to the input.
|
|
12
|
+
* - `top`: above the input
|
|
13
|
+
* - `bottom`: below the input
|
|
14
|
+
* - `popover`: show a help icon before the label and render the description in a hover popover
|
|
15
|
+
*/
|
|
16
|
+
descriptionPlacement?: DescriptionPlacement;
|
|
17
|
+
asterisk?: boolean;
|
|
18
|
+
feedbackStatus?: 'error' | 'warning' | 'success';
|
|
19
|
+
feedbackText?: SyncReactNode;
|
|
20
|
+
labelPlacement?: LabelPlacement;
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { FormItemProps, LabelPlacement };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/components/form-item/spacing-config.ts
|
|
3
|
+
const FEEDBACK = "mt-1";
|
|
4
|
+
const LABE_DEFAULT = "mb-2";
|
|
5
|
+
function getSpacingConfig(descriptionPlacement, hasDescription) {
|
|
6
|
+
if (descriptionPlacement === "top" && hasDescription) return {
|
|
7
|
+
label: "mb-1",
|
|
8
|
+
description: "mb-1.5",
|
|
9
|
+
feedback: FEEDBACK
|
|
10
|
+
};
|
|
11
|
+
if (descriptionPlacement === "bottom" && hasDescription) return {
|
|
12
|
+
label: LABE_DEFAULT,
|
|
13
|
+
description: "mt-1",
|
|
14
|
+
feedback: FEEDBACK
|
|
15
|
+
};
|
|
16
|
+
return {
|
|
17
|
+
label: LABE_DEFAULT,
|
|
18
|
+
description: "",
|
|
19
|
+
feedback: FEEDBACK
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
exports.getSpacingConfig = getSpacingConfig;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/components/form-item/spacing-config.ts
|
|
2
|
+
const FEEDBACK = "mt-1";
|
|
3
|
+
const LABE_DEFAULT = "mb-2";
|
|
4
|
+
function getSpacingConfig(descriptionPlacement, hasDescription) {
|
|
5
|
+
if (descriptionPlacement === "top" && hasDescription) return {
|
|
6
|
+
label: "mb-1",
|
|
7
|
+
description: "mb-1.5",
|
|
8
|
+
feedback: FEEDBACK
|
|
9
|
+
};
|
|
10
|
+
if (descriptionPlacement === "bottom" && hasDescription) return {
|
|
11
|
+
label: LABE_DEFAULT,
|
|
12
|
+
description: "mt-1",
|
|
13
|
+
feedback: FEEDBACK
|
|
14
|
+
};
|
|
15
|
+
return {
|
|
16
|
+
label: LABE_DEFAULT,
|
|
17
|
+
description: "",
|
|
18
|
+
feedback: FEEDBACK
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { getSpacingConfig };
|
|
@@ -12,7 +12,8 @@ __pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
|
|
|
12
12
|
//#region src/components/form-items-container.tsx
|
|
13
13
|
const FormItemContainer = (props) => {
|
|
14
14
|
const { as: Component = "div", className,...rest } = props;
|
|
15
|
-
const {
|
|
15
|
+
const { layout } = require_use_form_context.useFormContext();
|
|
16
|
+
const { density } = layout || {};
|
|
16
17
|
const spaceClass = require_resolve_responsive_space.resolveResponsiveSpaceClass({ density });
|
|
17
18
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
|
|
18
19
|
...rest,
|
|
@@ -8,7 +8,8 @@ import { cn } from "@pixpilot/shadcn";
|
|
|
8
8
|
//#region src/components/form-items-container.tsx
|
|
9
9
|
const FormItemContainer = (props) => {
|
|
10
10
|
const { as: Component = "div", className,...rest } = props;
|
|
11
|
-
const {
|
|
11
|
+
const { layout } = useFormContext();
|
|
12
|
+
const { density } = layout || {};
|
|
12
13
|
const spaceClass = resolveResponsiveSpaceClass({ density });
|
|
13
14
|
return /* @__PURE__ */ jsx(Component, {
|
|
14
15
|
...rest,
|
package/dist/components/form.cjs
CHANGED
|
@@ -15,7 +15,7 @@ __pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
|
|
|
15
15
|
/**
|
|
16
16
|
* Form component - wraps FormProvider and provides form context
|
|
17
17
|
*/
|
|
18
|
-
function Form({ form, className, style, children, onSubmit, onAutoSubmit,
|
|
18
|
+
function Form({ form, className, style, children, onSubmit, onAutoSubmit, layout, settings }) {
|
|
19
19
|
const handleSubmit = (e) => {
|
|
20
20
|
e.preventDefault();
|
|
21
21
|
form.submit((values) => {
|
|
@@ -26,22 +26,15 @@ function Form({ form, className, style, children, onSubmit, onAutoSubmit, itemPr
|
|
|
26
26
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_context.Provider, {
|
|
27
27
|
value: react.default.useMemo(() => {
|
|
28
28
|
return {
|
|
29
|
-
|
|
30
|
-
objectContainerProps,
|
|
31
|
-
density,
|
|
29
|
+
layout,
|
|
32
30
|
settings
|
|
33
31
|
};
|
|
34
|
-
}, [
|
|
35
|
-
itemProps,
|
|
36
|
-
objectContainerProps,
|
|
37
|
-
density,
|
|
38
|
-
settings
|
|
39
|
-
]),
|
|
32
|
+
}, [layout, settings]),
|
|
40
33
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__formily_react.FormProvider, {
|
|
41
34
|
form,
|
|
42
35
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_form_items_container.FormItemContainer, {
|
|
43
36
|
as: "form",
|
|
44
|
-
className: (0, __pixpilot_shadcn.cn)(
|
|
37
|
+
className: (0, __pixpilot_shadcn.cn)(className),
|
|
45
38
|
style,
|
|
46
39
|
onSubmit: handleSubmit,
|
|
47
40
|
children
|
|
@@ -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
|
|
5
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
6
6
|
|
|
7
7
|
//#region src/components/form.d.ts
|
|
8
8
|
interface IFormProps extends FormContextStates {
|
|
@@ -23,10 +23,8 @@ declare function Form$1({
|
|
|
23
23
|
children,
|
|
24
24
|
onSubmit,
|
|
25
25
|
onAutoSubmit,
|
|
26
|
-
|
|
27
|
-
objectContainerProps,
|
|
28
|
-
density,
|
|
26
|
+
layout,
|
|
29
27
|
settings
|
|
30
|
-
}: IFormProps):
|
|
28
|
+
}: IFormProps): react_jsx_runtime1.JSX.Element;
|
|
31
29
|
//#endregion
|
|
32
30
|
export { Form$1 as Form };
|
package/dist/components/form.js
CHANGED
|
@@ -10,7 +10,7 @@ import { cn } from "@pixpilot/shadcn";
|
|
|
10
10
|
/**
|
|
11
11
|
* Form component - wraps FormProvider and provides form context
|
|
12
12
|
*/
|
|
13
|
-
function Form({ form, className, style, children, onSubmit, onAutoSubmit,
|
|
13
|
+
function Form({ form, className, style, children, onSubmit, onAutoSubmit, layout, settings }) {
|
|
14
14
|
const handleSubmit = (e) => {
|
|
15
15
|
e.preventDefault();
|
|
16
16
|
form.submit((values) => {
|
|
@@ -21,22 +21,15 @@ function Form({ form, className, style, children, onSubmit, onAutoSubmit, itemPr
|
|
|
21
21
|
return /* @__PURE__ */ jsx(Provider, {
|
|
22
22
|
value: React.useMemo(() => {
|
|
23
23
|
return {
|
|
24
|
-
|
|
25
|
-
objectContainerProps,
|
|
26
|
-
density,
|
|
24
|
+
layout,
|
|
27
25
|
settings
|
|
28
26
|
};
|
|
29
|
-
}, [
|
|
30
|
-
itemProps,
|
|
31
|
-
objectContainerProps,
|
|
32
|
-
density,
|
|
33
|
-
settings
|
|
34
|
-
]),
|
|
27
|
+
}, [layout, settings]),
|
|
35
28
|
children: /* @__PURE__ */ jsx(FormProvider, {
|
|
36
29
|
form,
|
|
37
30
|
children: /* @__PURE__ */ jsx(FormItemContainer, {
|
|
38
31
|
as: "form",
|
|
39
|
-
className: cn(
|
|
32
|
+
className: cn(className),
|
|
40
33
|
style,
|
|
41
34
|
onSubmit: handleSubmit,
|
|
42
35
|
children
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react2 from "react";
|
|
2
2
|
import { IconPickerProps, IconProviderProps } from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/icon-picker.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:
|
|
11
|
+
declare const IconPicker: react2.ForwardRefExoticComponent<Partial<Omit<IconPickerProps, "providers"> & {
|
|
12
12
|
providers?: IconProviderProps[];
|
|
13
|
-
}> &
|
|
13
|
+
}> & react2.RefAttributes<unknown>>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { IconPicker };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react8 from "react";
|
|
2
2
|
import { IconPickerProps, IconProviderProps } from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/icon-picker.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: react8.ForwardRefExoticComponent<Partial<Omit<IconPickerProps, "providers"> & {
|
|
12
12
|
providers?: IconProviderProps[];
|
|
13
|
-
}> &
|
|
13
|
+
}> & react8.RefAttributes<unknown>>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { IconPicker$1 as IconPicker };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react4 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/components/input.d.ts
|
|
4
4
|
|
|
@@ -6,6 +6,6 @@ import * as react10 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: react4.ForwardRefExoticComponent<Omit<Partial<react4.ClassAttributes<HTMLInputElement> & react4.InputHTMLAttributes<HTMLInputElement>>, "ref"> & react4.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Input };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const require_json_schema_form_renderer = require('./json-schema-form-renderer.cjs');
|
|
2
|
+
const require_json_schema_form = require('./json-schema-form.cjs');
|
|
3
|
+
const require_json_schema_form_basic = require('./json-schema-form-basic.cjs');
|
|
4
|
+
const require_json_schema_form_extended = require('./json-schema-form-extended.cjs');
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { JsonSchemaFormComponent, JsonSchemaFormComponents, JsonSchemaFormProps, JsonSchemaFormRendererProps } from "./types.cjs";
|
|
2
|
+
import { JsonSchemaForm } from "./json-schema-form.cjs";
|
|
3
|
+
import { JsonSchemaFormBasic } from "./json-schema-form-basic.cjs";
|
|
4
|
+
import { JsonSchemaFormExtended } from "./json-schema-form-extended.cjs";
|
|
5
|
+
import { JsonSchemaFormRenderer } from "./json-schema-form-renderer.cjs";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { JsonSchemaFormComponent, JsonSchemaFormComponents, JsonSchemaFormProps, JsonSchemaFormRendererProps } from "./types.js";
|
|
2
|
+
import { JsonSchemaForm } from "./json-schema-form.js";
|
|
3
|
+
import { JsonSchemaFormBasic } from "./json-schema-form-basic.js";
|
|
4
|
+
import { JsonSchemaFormExtended } from "./json-schema-form-extended.js";
|
|
5
|
+
import { JsonSchemaFormRenderer } from "./json-schema-form-renderer.js";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { JsonSchemaFormRenderer } from "./json-schema-form-renderer.js";
|
|
2
|
+
import { JsonSchemaForm } from "./json-schema-form.js";
|
|
3
|
+
import { JsonSchemaFormBasic } from "./json-schema-form-basic.js";
|
|
4
|
+
import { JsonSchemaFormExtended } from "./json-schema-form-extended.js";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_schema_field_basics = require('../schema-field/schema-field-basics.cjs');
|
|
3
|
+
const require_json_schema_form_renderer = require('./json-schema-form-renderer.cjs');
|
|
4
|
+
let react = require("react");
|
|
5
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
8
|
+
|
|
9
|
+
//#region src/components/json-schema-form-renderer/json-schema-form-basic.tsx
|
|
10
|
+
/**
|
|
11
|
+
* JsonSchemaFormBasic is the basic version that provides only the essential components
|
|
12
|
+
* from the basicComponentRegistry (Input, Checkbox, Select, etc.).
|
|
13
|
+
*
|
|
14
|
+
* User-provided components are merged with basics, with user components taking precedence.
|
|
15
|
+
*/
|
|
16
|
+
const JsonSchemaFormBasic = (props) => {
|
|
17
|
+
const { components,...rest } = props;
|
|
18
|
+
const mergedComponents = react.default.useMemo(() => {
|
|
19
|
+
return {
|
|
20
|
+
fields: {
|
|
21
|
+
...require_schema_field_basics.basicComponentRegistry,
|
|
22
|
+
...components?.fields || {}
|
|
23
|
+
},
|
|
24
|
+
decorators: components?.decorators
|
|
25
|
+
};
|
|
26
|
+
}, [components?.decorators, components?.fields]);
|
|
27
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_json_schema_form_renderer.JsonSchemaFormRenderer, {
|
|
28
|
+
...rest,
|
|
29
|
+
components: mergedComponents
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
JsonSchemaFormBasic.displayName = "JsonSchemaFormBasic";
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
exports.JsonSchemaFormBasic = JsonSchemaFormBasic;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { JsonSchemaFormProps } from "./types.cjs";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/json-schema-form-renderer/json-schema-form-basic.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* JsonSchemaFormBasic is the basic version that provides only the essential components
|
|
8
|
+
* from the basicComponentRegistry (Input, Checkbox, Select, etc.).
|
|
9
|
+
*
|
|
10
|
+
* User-provided components are merged with basics, with user components taking precedence.
|
|
11
|
+
*/
|
|
12
|
+
declare const JsonSchemaFormBasic: React.FC<JsonSchemaFormProps>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { JsonSchemaFormBasic };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { JsonSchemaFormProps } from "./types.js";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/json-schema-form-renderer/json-schema-form-basic.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* JsonSchemaFormBasic is the basic version that provides only the essential components
|
|
8
|
+
* from the basicComponentRegistry (Input, Checkbox, Select, etc.).
|
|
9
|
+
*
|
|
10
|
+
* User-provided components are merged with basics, with user components taking precedence.
|
|
11
|
+
*/
|
|
12
|
+
declare const JsonSchemaFormBasic: React.FC<JsonSchemaFormProps>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { JsonSchemaFormBasic };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { basicComponentRegistry } from "../schema-field/schema-field-basics.js";
|
|
2
|
+
import { JsonSchemaFormRenderer } from "./json-schema-form-renderer.js";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/json-schema-form-renderer/json-schema-form-basic.tsx
|
|
7
|
+
/**
|
|
8
|
+
* JsonSchemaFormBasic is the basic version that provides only the essential components
|
|
9
|
+
* from the basicComponentRegistry (Input, Checkbox, Select, etc.).
|
|
10
|
+
*
|
|
11
|
+
* User-provided components are merged with basics, with user components taking precedence.
|
|
12
|
+
*/
|
|
13
|
+
const JsonSchemaFormBasic = (props) => {
|
|
14
|
+
const { components,...rest } = props;
|
|
15
|
+
const mergedComponents = React.useMemo(() => {
|
|
16
|
+
return {
|
|
17
|
+
fields: {
|
|
18
|
+
...basicComponentRegistry,
|
|
19
|
+
...components?.fields || {}
|
|
20
|
+
},
|
|
21
|
+
decorators: components?.decorators
|
|
22
|
+
};
|
|
23
|
+
}, [components?.decorators, components?.fields]);
|
|
24
|
+
return /* @__PURE__ */ jsx(JsonSchemaFormRenderer, {
|
|
25
|
+
...rest,
|
|
26
|
+
components: mergedComponents
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
JsonSchemaFormBasic.displayName = "JsonSchemaFormBasic";
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
export { JsonSchemaFormBasic };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_schema_field_extended = require('../schema-field/schema-field-extended.cjs');
|
|
3
|
+
const require_json_schema_form_renderer = require('./json-schema-form-renderer.cjs');
|
|
4
|
+
let react = require("react");
|
|
5
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
8
|
+
|
|
9
|
+
//#region src/components/json-schema-form-renderer/json-schema-form-extended.tsx
|
|
10
|
+
/**
|
|
11
|
+
* JsonSchemaFormExtended is the extended version that provides all components
|
|
12
|
+
* from the extendedComponentRegistry (including FileUpload, RichTextEditor, etc.).
|
|
13
|
+
*
|
|
14
|
+
* User-provided components are merged with extended defaults, with user components taking precedence.
|
|
15
|
+
*/
|
|
16
|
+
const JsonSchemaFormExtended = (props) => {
|
|
17
|
+
const { components,...rest } = props;
|
|
18
|
+
const mergedComponents = react.default.useMemo(() => {
|
|
19
|
+
return {
|
|
20
|
+
fields: {
|
|
21
|
+
...require_schema_field_extended.extendedComponentRegistry,
|
|
22
|
+
...components?.fields || {}
|
|
23
|
+
},
|
|
24
|
+
decorators: components?.decorators
|
|
25
|
+
};
|
|
26
|
+
}, [components?.decorators, components?.fields]);
|
|
27
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_json_schema_form_renderer.JsonSchemaFormRenderer, {
|
|
28
|
+
...rest,
|
|
29
|
+
components: mergedComponents
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
JsonSchemaFormExtended.displayName = "JsonSchemaFormExtended";
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
exports.JsonSchemaFormExtended = JsonSchemaFormExtended;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { JsonSchemaFormProps } from "./types.cjs";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/json-schema-form-renderer/json-schema-form-extended.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* JsonSchemaFormExtended is the extended version that provides all components
|
|
8
|
+
* from the extendedComponentRegistry (including FileUpload, RichTextEditor, etc.).
|
|
9
|
+
*
|
|
10
|
+
* User-provided components are merged with extended defaults, with user components taking precedence.
|
|
11
|
+
*/
|
|
12
|
+
declare const JsonSchemaFormExtended: React.FC<JsonSchemaFormProps>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { JsonSchemaFormExtended };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { JsonSchemaFormProps } from "./types.js";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/json-schema-form-renderer/json-schema-form-extended.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* JsonSchemaFormExtended is the extended version that provides all components
|
|
8
|
+
* from the extendedComponentRegistry (including FileUpload, RichTextEditor, etc.).
|
|
9
|
+
*
|
|
10
|
+
* User-provided components are merged with extended defaults, with user components taking precedence.
|
|
11
|
+
*/
|
|
12
|
+
declare const JsonSchemaFormExtended: React.FC<JsonSchemaFormProps>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { JsonSchemaFormExtended };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { extendedComponentRegistry } from "../schema-field/schema-field-extended.js";
|
|
2
|
+
import { JsonSchemaFormRenderer } from "./json-schema-form-renderer.js";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/json-schema-form-renderer/json-schema-form-extended.tsx
|
|
7
|
+
/**
|
|
8
|
+
* JsonSchemaFormExtended is the extended version that provides all components
|
|
9
|
+
* from the extendedComponentRegistry (including FileUpload, RichTextEditor, etc.).
|
|
10
|
+
*
|
|
11
|
+
* User-provided components are merged with extended defaults, with user components taking precedence.
|
|
12
|
+
*/
|
|
13
|
+
const JsonSchemaFormExtended = (props) => {
|
|
14
|
+
const { components,...rest } = props;
|
|
15
|
+
const mergedComponents = React.useMemo(() => {
|
|
16
|
+
return {
|
|
17
|
+
fields: {
|
|
18
|
+
...extendedComponentRegistry,
|
|
19
|
+
...components?.fields || {}
|
|
20
|
+
},
|
|
21
|
+
decorators: components?.decorators
|
|
22
|
+
};
|
|
23
|
+
}, [components?.decorators, components?.fields]);
|
|
24
|
+
return /* @__PURE__ */ jsx(JsonSchemaFormRenderer, {
|
|
25
|
+
...rest,
|
|
26
|
+
components: mergedComponents
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
JsonSchemaFormExtended.displayName = "JsonSchemaFormExtended";
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
export { JsonSchemaFormExtended };
|