@pixpilot/formily-shadcn 0.8.0 → 0.8.2
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/_virtual/rolldown_runtime.cjs +25 -1
- package/dist/_virtual/rolldown_runtime.js +24 -1
- package/dist/components/array-base/array-base.cjs +59 -1
- package/dist/components/array-base/array-base.js +55 -1
- package/dist/components/array-base/array-context.cjs +28 -1
- package/dist/components/array-base/array-context.js +22 -1
- package/dist/components/array-base/component-context.cjs +28 -1
- package/dist/components/array-base/component-context.js +22 -1
- package/dist/components/array-base/components/addition.cjs +51 -1
- package/dist/components/array-base/components/addition.js +45 -1
- package/dist/components/array-base/components/array-copy.cjs +49 -1
- package/dist/components/array-base/components/array-copy.js +42 -1
- package/dist/components/array-base/components/array-index.cjs +15 -1
- package/dist/components/array-base/components/array-index.js +13 -1
- package/dist/components/array-base/components/array-item-label.cjs +22 -1
- package/dist/components/array-base/components/array-item-label.js +19 -1
- package/dist/components/array-base/components/components.cjs +30 -1
- package/dist/components/array-base/components/components.js +29 -1
- package/dist/components/array-base/components/edit.cjs +42 -1
- package/dist/components/array-base/components/edit.js +36 -1
- package/dist/components/array-base/components/empty.cjs +19 -1
- package/dist/components/array-base/components/empty.js +16 -1
- package/dist/components/array-base/components/get-array-components.cjs +88 -1
- package/dist/components/array-base/components/get-array-components.js +84 -1
- package/dist/components/array-base/components/move-down.cjs +47 -1
- package/dist/components/array-base/components/move-down.js +41 -1
- package/dist/components/array-base/components/move-up.cjs +47 -1
- package/dist/components/array-base/components/move-up.js +41 -1
- package/dist/components/array-base/components/remove.cjs +46 -1
- package/dist/components/array-base/components/remove.js +40 -1
- package/dist/components/array-base/components/title.cjs +17 -1
- package/dist/components/array-base/components/title.js +14 -1
- package/dist/components/array-base/components/use-array-components-registry.cjs +56 -1
- package/dist/components/array-base/components/use-array-components-registry.js +52 -1
- package/dist/components/array-base/constants/index.cjs +17 -1
- package/dist/components/array-base/constants/index.js +15 -1
- package/dist/components/array-base/index.cjs +2 -1
- package/dist/components/array-base/index.js +2 -1
- package/dist/components/array-base/utils/filter-and-sort-components.cjs +34 -1
- package/dist/components/array-base/utils/filter-and-sort-components.js +34 -1
- package/dist/components/array-base/utils/is-array-component.cjs +65 -1
- package/dist/components/array-base/utils/is-array-component.js +56 -1
- package/dist/components/array-cards/array-cards.cjs +64 -1
- package/dist/components/array-cards/array-cards.js +60 -1
- package/dist/components/array-cards/index.cjs +1 -1
- package/dist/components/array-cards/index.js +1 -1
- package/dist/components/array-cards/item.cjs +64 -1
- package/dist/components/array-cards/item.js +60 -1
- package/dist/components/array-collapse/array-collapse.cjs +96 -1
- package/dist/components/array-collapse/array-collapse.js +92 -1
- package/dist/components/array-collapse/index.cjs +1 -1
- package/dist/components/array-collapse/index.js +1 -1
- package/dist/components/array-collapse/item.cjs +84 -1
- package/dist/components/array-collapse/item.js +78 -1
- package/dist/components/array-common/array-items-list.cjs +43 -1
- package/dist/components/array-common/array-items-list.js +39 -1
- package/dist/components/array-common/create-active-item-manager.cjs +29 -1
- package/dist/components/array-common/create-active-item-manager.js +27 -1
- package/dist/components/array-common/index.cjs +5 -1
- package/dist/components/array-common/index.js +5 -1
- package/dist/components/array-common/item-wrapper.cjs +26 -1
- package/dist/components/array-common/item-wrapper.js +21 -1
- package/dist/components/array-common/list-item.cjs +53 -1
- package/dist/components/array-common/list-item.js +48 -1
- package/dist/components/array-common/use-array-editor.cjs +47 -1
- package/dist/components/array-common/use-array-editor.js +44 -1
- package/dist/components/array-dialog/array-dialog.cjs +66 -1
- package/dist/components/array-dialog/array-dialog.js +62 -1
- package/dist/components/array-dialog/edit-dialog.cjs +61 -1
- package/dist/components/array-dialog/edit-dialog.js +57 -1
- package/dist/components/array-dialog/index.cjs +1 -1
- package/dist/components/array-dialog/index.js +1 -1
- package/dist/components/array-popover/array-popover.cjs +58 -1
- package/dist/components/array-popover/array-popover.js +53 -1
- package/dist/components/array-popover/index.cjs +1 -1
- package/dist/components/array-popover/index.js +1 -1
- package/dist/components/array-popover/popover.cjs +75 -1
- package/dist/components/array-popover/popover.js +71 -1
- package/dist/components/checkbox.cjs +26 -1
- package/dist/components/checkbox.js +23 -1
- package/dist/components/column.cjs +39 -1
- package/dist/components/column.js +35 -1
- package/dist/components/combobox.cjs +14 -1
- package/dist/components/combobox.js +11 -1
- package/dist/components/context/context.cjs +7 -1
- package/dist/components/context/context.js +7 -1
- package/dist/components/context/form-context.cjs +9 -1
- package/dist/components/context/form-context.js +7 -1
- package/dist/components/context/index.cjs +2 -1
- package/dist/components/context/index.js +2 -1
- package/dist/components/date-picker.cjs +23 -1
- package/dist/components/date-picker.js +19 -1
- package/dist/components/file-upload/file-upload-inline.cjs +35 -1
- package/dist/components/file-upload/file-upload-inline.d.cts +8 -8
- package/dist/components/file-upload/file-upload-inline.js +30 -1
- package/dist/components/file-upload/file-upload.cjs +35 -1
- package/dist/components/file-upload/file-upload.d.cts +8 -8
- package/dist/components/file-upload/file-upload.js +30 -1
- package/dist/components/file-upload/index.cjs +2 -1
- package/dist/components/file-upload/index.js +2 -1
- package/dist/components/file-upload/use-file-upload-feedback.cjs +59 -3
- package/dist/components/file-upload/use-file-upload-feedback.js +53 -3
- package/dist/components/form-grid.cjs +19 -1
- package/dist/components/form-grid.js +15 -1
- package/dist/components/form-item.cjs +118 -3
- package/dist/components/form-item.js +112 -3
- package/dist/components/form-items-container.cjs +28 -1
- package/dist/components/form-items-container.js +24 -1
- package/dist/components/form.cjs +56 -1
- package/dist/components/form.js +51 -1
- package/dist/components/hidden.cjs +26 -1
- package/dist/components/hidden.js +23 -1
- package/dist/components/icon-picker.cjs +37 -1
- package/dist/components/icon-picker.js +33 -1
- package/dist/components/input.cjs +20 -1
- package/dist/components/input.js +17 -1
- package/dist/components/json-schema-form-renderer.cjs +30 -1
- package/dist/components/json-schema-form-renderer.js +26 -1
- package/dist/components/number-input.cjs +19 -1
- package/dist/components/number-input.d.ts +2 -2
- package/dist/components/number-input.js +16 -1
- package/dist/components/object-container.cjs +35 -1
- package/dist/components/object-container.js +32 -1
- package/dist/components/radio.cjs +40 -1
- package/dist/components/radio.js +35 -1
- package/dist/components/rich-text-editor.cjs +27 -1
- package/dist/components/rich-text-editor.js +23 -1
- package/dist/components/row.cjs +39 -1
- package/dist/components/row.js +35 -1
- package/dist/components/schema-field-extended.cjs +25 -1
- package/dist/components/schema-field-extended.d.cts +9 -9
- package/dist/components/schema-field-extended.d.ts +262 -262
- package/dist/components/schema-field-extended.js +23 -1
- package/dist/components/schema-field.cjs +61 -1
- package/dist/components/schema-field.d.cts +9 -9
- package/dist/components/schema-field.d.ts +220 -220
- package/dist/components/schema-field.js +57 -1
- package/dist/components/select.cjs +11 -1
- package/dist/components/select.js +8 -1
- package/dist/components/separator.cjs +15 -1
- package/dist/components/separator.d.ts +2 -2
- package/dist/components/separator.js +12 -1
- package/dist/components/slider.cjs +33 -1
- package/dist/components/slider.d.ts +2 -2
- package/dist/components/slider.js +29 -1
- package/dist/components/switch.cjs +21 -1
- package/dist/components/switch.js +18 -1
- package/dist/components/tags-input-inline.cjs +26 -1
- package/dist/components/tags-input-inline.js +23 -1
- package/dist/components/textarea.cjs +19 -1
- package/dist/components/textarea.js +16 -1
- package/dist/hooks/index.cjs +3 -1
- package/dist/hooks/index.js +3 -1
- package/dist/hooks/use-description.cjs +14 -1
- package/dist/hooks/use-description.js +12 -1
- package/dist/hooks/use-form-context.cjs +13 -1
- package/dist/hooks/use-form-context.js +11 -1
- package/dist/hooks/use-label.cjs +19 -1
- package/dist/hooks/use-label.js +16 -1
- package/dist/index.cjs +102 -1
- package/dist/index.js +35 -1
- package/dist/utils/create-panel-state-manager.cjs +40 -1
- package/dist/utils/create-panel-state-manager.js +38 -1
- package/dist/utils/for-each-schema.cjs +27 -1
- package/dist/utils/for-each-schema.js +26 -1
- package/dist/utils/get-array-item-info.cjs +20 -1
- package/dist/utils/get-array-item-info.js +19 -1
- package/dist/utils/get-default-value.cjs +22 -1
- package/dist/utils/get-default-value.js +20 -1
- package/dist/utils/has-array-item-errors.cjs +15 -1
- package/dist/utils/has-array-item-errors.js +14 -1
- package/dist/utils/has-error.cjs +12 -1
- package/dist/utils/has-error.js +10 -1
- package/dist/utils/index.cjs +10 -1
- package/dist/utils/index.js +10 -1
- package/dist/utils/resolve-responsive-space.cjs +131 -1
- package/dist/utils/resolve-responsive-space.js +123 -1
- package/dist/utils/transform-schema.cjs +45 -1
- package/dist/utils/transform-schema.js +43 -1
- package/dist/utils/use-array-item-editor.cjs +3 -1
- package/dist/utils/use-array-item-editor.js +1 -1
- package/dist/utils/validate-array-item-fields.cjs +22 -1
- package/dist/utils/validate-array-item-fields.js +22 -1
- package/package.json +3 -3
|
@@ -1 +1,20 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let __formily_react = require("@formily/react");
|
|
3
|
+
__formily_react = require_rolldown_runtime.__toESM(__formily_react);
|
|
4
|
+
let __pixpilot_shadcn = require("@pixpilot/shadcn");
|
|
5
|
+
__pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
|
|
6
|
+
|
|
7
|
+
//#region src/components/input.tsx
|
|
8
|
+
/**
|
|
9
|
+
* Formily-connected Input component
|
|
10
|
+
* Automatically connects shadcn Input to Formily field state
|
|
11
|
+
*/
|
|
12
|
+
const Input = (0, __formily_react.connect)(__pixpilot_shadcn.Input, (0, __formily_react.mapProps)((props, field) => {
|
|
13
|
+
return {
|
|
14
|
+
...props,
|
|
15
|
+
value: field.value ?? ""
|
|
16
|
+
};
|
|
17
|
+
}));
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
exports.Input = Input;
|
package/dist/components/input.js
CHANGED
|
@@ -1 +1,17 @@
|
|
|
1
|
-
import{connect
|
|
1
|
+
import { connect, mapProps } from "@formily/react";
|
|
2
|
+
import { Input } from "@pixpilot/shadcn";
|
|
3
|
+
|
|
4
|
+
//#region src/components/input.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Formily-connected Input component
|
|
7
|
+
* Automatically connects shadcn Input to Formily field state
|
|
8
|
+
*/
|
|
9
|
+
const Input$1 = connect(Input, mapProps((props, field) => {
|
|
10
|
+
return {
|
|
11
|
+
...props,
|
|
12
|
+
value: field.value ?? ""
|
|
13
|
+
};
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { Input$1 as Input };
|
|
@@ -1 +1,30 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_transform_schema = require('../utils/transform-schema.cjs');
|
|
3
|
+
require('../utils/index.cjs');
|
|
4
|
+
const require_form = require('./form.cjs');
|
|
5
|
+
const require_schema_field = require('./schema-field.cjs');
|
|
6
|
+
let react = require("react");
|
|
7
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
8
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
|
+
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
10
|
+
let __formily_core = require("@formily/core");
|
|
11
|
+
__formily_core = require_rolldown_runtime.__toESM(__formily_core);
|
|
12
|
+
|
|
13
|
+
//#region src/components/json-schema-form-renderer.tsx
|
|
14
|
+
const JsonSchemaFormRenderer = (props) => {
|
|
15
|
+
const { schema, children, schemaField,...rest } = props;
|
|
16
|
+
const form = (0, react.useMemo)(() => (0, __formily_core.createForm)(), []);
|
|
17
|
+
const formSchema = (0, react.useMemo)(() => {
|
|
18
|
+
return require_transform_schema.transformSchema(schema);
|
|
19
|
+
}, [schema]);
|
|
20
|
+
const SchemaFieldComponent = schemaField || require_schema_field.SchemaField;
|
|
21
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_form.Form, {
|
|
22
|
+
...rest,
|
|
23
|
+
form,
|
|
24
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SchemaFieldComponent, { schema: formSchema }), children]
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
JsonSchemaFormRenderer.displayName = "JsonSchemaFormRenderer";
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
exports.JsonSchemaFormRenderer = JsonSchemaFormRenderer;
|
|
@@ -1 +1,26 @@
|
|
|
1
|
-
import{transformSchema
|
|
1
|
+
import { transformSchema } from "../utils/transform-schema.js";
|
|
2
|
+
import "../utils/index.js";
|
|
3
|
+
import { Form as Form$1 } from "./form.js";
|
|
4
|
+
import { SchemaField } from "./schema-field.js";
|
|
5
|
+
import React, { useMemo } from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { createForm } from "@formily/core";
|
|
8
|
+
|
|
9
|
+
//#region src/components/json-schema-form-renderer.tsx
|
|
10
|
+
const JsonSchemaFormRenderer = (props) => {
|
|
11
|
+
const { schema, children, schemaField,...rest } = props;
|
|
12
|
+
const form = useMemo(() => createForm(), []);
|
|
13
|
+
const formSchema = useMemo(() => {
|
|
14
|
+
return transformSchema(schema);
|
|
15
|
+
}, [schema]);
|
|
16
|
+
const SchemaFieldComponent = schemaField || SchemaField;
|
|
17
|
+
return /* @__PURE__ */ jsxs(Form$1, {
|
|
18
|
+
...rest,
|
|
19
|
+
form,
|
|
20
|
+
children: [/* @__PURE__ */ jsx(SchemaFieldComponent, { schema: formSchema }), children]
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
JsonSchemaFormRenderer.displayName = "JsonSchemaFormRenderer";
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
export { JsonSchemaFormRenderer };
|
|
@@ -1 +1,19 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let __formily_react = require("@formily/react");
|
|
3
|
+
__formily_react = require_rolldown_runtime.__toESM(__formily_react);
|
|
4
|
+
let __pixpilot_shadcn = require("@pixpilot/shadcn");
|
|
5
|
+
__pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
|
|
6
|
+
|
|
7
|
+
//#region src/components/number-input.tsx
|
|
8
|
+
/**
|
|
9
|
+
* Formily-connected Number Input component
|
|
10
|
+
*/
|
|
11
|
+
const NumberInput = (0, __formily_react.connect)(__pixpilot_shadcn.Input, (0, __formily_react.mapProps)((props) => {
|
|
12
|
+
return {
|
|
13
|
+
...props,
|
|
14
|
+
type: "number"
|
|
15
|
+
};
|
|
16
|
+
}));
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
exports.NumberInput = NumberInput;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react14 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/components/number-input.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Formily-connected Number Input component
|
|
6
6
|
*/
|
|
7
|
-
declare const NumberInput:
|
|
7
|
+
declare const NumberInput: react14.ForwardRefExoticComponent<Omit<Partial<react14.ClassAttributes<HTMLInputElement> & react14.InputHTMLAttributes<HTMLInputElement>>, "ref"> & react14.RefAttributes<unknown>>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { NumberInput };
|
|
@@ -1 +1,16 @@
|
|
|
1
|
-
import{connect
|
|
1
|
+
import { connect, mapProps } from "@formily/react";
|
|
2
|
+
import { Input } from "@pixpilot/shadcn";
|
|
3
|
+
|
|
4
|
+
//#region src/components/number-input.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Formily-connected Number Input component
|
|
7
|
+
*/
|
|
8
|
+
const NumberInput = connect(Input, mapProps((props) => {
|
|
9
|
+
return {
|
|
10
|
+
...props,
|
|
11
|
+
type: "number"
|
|
12
|
+
};
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { NumberInput };
|
|
@@ -1 +1,35 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_resolve_responsive_space = require('../utils/resolve-responsive-space.cjs');
|
|
3
|
+
const require_use_description = require('../hooks/use-description.cjs');
|
|
4
|
+
const require_use_form_context = require('../hooks/use-form-context.cjs');
|
|
5
|
+
const require_use_label = require('../hooks/use-label.cjs');
|
|
6
|
+
require('../hooks/index.cjs');
|
|
7
|
+
const require_form_items_container = require('./form-items-container.cjs');
|
|
8
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
|
+
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
10
|
+
let __pixpilot_shadcn = require("@pixpilot/shadcn");
|
|
11
|
+
__pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
|
|
12
|
+
|
|
13
|
+
//#region src/components/object-container.tsx
|
|
14
|
+
const ObjectContainer = ({ className, children, label, description,...rest }) => {
|
|
15
|
+
const effectiveLabel = require_use_label.useLabel(label);
|
|
16
|
+
const desc = require_use_description.useDescription(description);
|
|
17
|
+
const { objectContainerProps, density, responsive } = require_use_form_context.useFormContext();
|
|
18
|
+
const gapClass = require_resolve_responsive_space.resolveResponsiveGapClass({
|
|
19
|
+
density,
|
|
20
|
+
responsive
|
|
21
|
+
});
|
|
22
|
+
const { className: itemsContainerClassName } = objectContainerProps || {};
|
|
23
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.Card, {
|
|
24
|
+
...rest,
|
|
25
|
+
className: (0, __pixpilot_shadcn.cn)("bg-transparent", gapClass, className),
|
|
26
|
+
children: [(effectiveLabel != null || desc != null) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.CardHeader, { children: [effectiveLabel != null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.CardTitle, { children: effectiveLabel }), desc != null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.CardDescription, { children: desc })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_form_items_container.FormItemContainer, {
|
|
27
|
+
as: __pixpilot_shadcn.CardContent,
|
|
28
|
+
className: itemsContainerClassName,
|
|
29
|
+
children
|
|
30
|
+
})]
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
exports.ObjectContainer = ObjectContainer;
|
|
@@ -1 +1,32 @@
|
|
|
1
|
-
import{resolveResponsiveGapClass
|
|
1
|
+
import { resolveResponsiveGapClass } from "../utils/resolve-responsive-space.js";
|
|
2
|
+
import { useDescription } from "../hooks/use-description.js";
|
|
3
|
+
import { useFormContext } from "../hooks/use-form-context.js";
|
|
4
|
+
import { useLabel } from "../hooks/use-label.js";
|
|
5
|
+
import "../hooks/index.js";
|
|
6
|
+
import { FormItemContainer } from "./form-items-container.js";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { Card, CardContent, CardDescription, CardHeader, CardTitle, cn } from "@pixpilot/shadcn";
|
|
9
|
+
|
|
10
|
+
//#region src/components/object-container.tsx
|
|
11
|
+
const ObjectContainer = ({ className, children, label, description,...rest }) => {
|
|
12
|
+
const effectiveLabel = useLabel(label);
|
|
13
|
+
const desc = useDescription(description);
|
|
14
|
+
const { objectContainerProps, density, responsive } = useFormContext();
|
|
15
|
+
const gapClass = resolveResponsiveGapClass({
|
|
16
|
+
density,
|
|
17
|
+
responsive
|
|
18
|
+
});
|
|
19
|
+
const { className: itemsContainerClassName } = objectContainerProps || {};
|
|
20
|
+
return /* @__PURE__ */ jsxs(Card, {
|
|
21
|
+
...rest,
|
|
22
|
+
className: cn("bg-transparent", gapClass, className),
|
|
23
|
+
children: [(effectiveLabel != null || desc != null) && /* @__PURE__ */ jsxs(CardHeader, { children: [effectiveLabel != null && /* @__PURE__ */ jsx(CardTitle, { children: effectiveLabel }), desc != null && /* @__PURE__ */ jsx(CardDescription, { children: desc })] }), /* @__PURE__ */ jsx(FormItemContainer, {
|
|
24
|
+
as: CardContent,
|
|
25
|
+
className: itemsContainerClassName,
|
|
26
|
+
children
|
|
27
|
+
})]
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
export { ObjectContainer };
|
|
@@ -1 +1,40 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let __formily_react = require("@formily/react");
|
|
3
|
+
__formily_react = require_rolldown_runtime.__toESM(__formily_react);
|
|
4
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
+
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
6
|
+
let __pixpilot_shadcn = require("@pixpilot/shadcn");
|
|
7
|
+
__pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
|
|
8
|
+
|
|
9
|
+
//#region src/components/radio.tsx
|
|
10
|
+
/**
|
|
11
|
+
* Formily-connected Radio Group component
|
|
12
|
+
*/
|
|
13
|
+
const BaseRadioGroup = __pixpilot_shadcn.RadioGroup;
|
|
14
|
+
/**
|
|
15
|
+
* Radio component with options rendering
|
|
16
|
+
*/
|
|
17
|
+
function Radio(props) {
|
|
18
|
+
const { options, value = "", onChange,...restProps } = props;
|
|
19
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BaseRadioGroup, {
|
|
20
|
+
value,
|
|
21
|
+
onValueChange: onChange,
|
|
22
|
+
...restProps,
|
|
23
|
+
children: options?.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
24
|
+
className: "flex items-center space-x-2",
|
|
25
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.RadioGroupItem, {
|
|
26
|
+
value: option.value,
|
|
27
|
+
id: `radio-${option.value}`
|
|
28
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.Label, {
|
|
29
|
+
htmlFor: `radio-${option.value}`,
|
|
30
|
+
children: option.label
|
|
31
|
+
})]
|
|
32
|
+
}, option.value))
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
Radio.displayName = "Radio";
|
|
36
|
+
const ConnectedRadio = (0, __formily_react.connect)(Radio);
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
exports.ConnectedRadio = ConnectedRadio;
|
|
40
|
+
exports.Radio = Radio;
|
package/dist/components/radio.js
CHANGED
|
@@ -1 +1,35 @@
|
|
|
1
|
-
import{connect
|
|
1
|
+
import { connect } from "@formily/react";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Label, RadioGroup, RadioGroupItem } from "@pixpilot/shadcn";
|
|
4
|
+
|
|
5
|
+
//#region src/components/radio.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Formily-connected Radio Group component
|
|
8
|
+
*/
|
|
9
|
+
const BaseRadioGroup = RadioGroup;
|
|
10
|
+
/**
|
|
11
|
+
* Radio component with options rendering
|
|
12
|
+
*/
|
|
13
|
+
function Radio(props) {
|
|
14
|
+
const { options, value = "", onChange,...restProps } = props;
|
|
15
|
+
return /* @__PURE__ */ jsx(BaseRadioGroup, {
|
|
16
|
+
value,
|
|
17
|
+
onValueChange: onChange,
|
|
18
|
+
...restProps,
|
|
19
|
+
children: options?.map((option) => /* @__PURE__ */ jsxs("div", {
|
|
20
|
+
className: "flex items-center space-x-2",
|
|
21
|
+
children: [/* @__PURE__ */ jsx(RadioGroupItem, {
|
|
22
|
+
value: option.value,
|
|
23
|
+
id: `radio-${option.value}`
|
|
24
|
+
}), /* @__PURE__ */ jsx(Label, {
|
|
25
|
+
htmlFor: `radio-${option.value}`,
|
|
26
|
+
children: option.label
|
|
27
|
+
})]
|
|
28
|
+
}, option.value))
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
Radio.displayName = "Radio";
|
|
32
|
+
const ConnectedRadio = connect(Radio);
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
export { ConnectedRadio, Radio };
|
|
@@ -1 +1,27 @@
|
|
|
1
|
-
const
|
|
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');
|
|
4
|
+
let __formily_react = require("@formily/react");
|
|
5
|
+
__formily_react = require_rolldown_runtime.__toESM(__formily_react);
|
|
6
|
+
let __pixpilot_shadcn_ui = require("@pixpilot/shadcn-ui");
|
|
7
|
+
__pixpilot_shadcn_ui = require_rolldown_runtime.__toESM(__pixpilot_shadcn_ui);
|
|
8
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
|
+
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
10
|
+
|
|
11
|
+
//#region src/components/rich-text-editor.tsx
|
|
12
|
+
const RichTextEditorBase = (props) => {
|
|
13
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn_ui.RichTextEditor, {
|
|
14
|
+
...require_use_form_context.useFormContext()?.config?.richTextEditor,
|
|
15
|
+
...props,
|
|
16
|
+
children: "RichTextEditor"
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
const RichTextEditor = (0, __formily_react.connect)(RichTextEditorBase, (0, __formily_react.mapProps)((props, field) => {
|
|
20
|
+
return {
|
|
21
|
+
...props,
|
|
22
|
+
value: field.value ?? ""
|
|
23
|
+
};
|
|
24
|
+
}));
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
exports.RichTextEditor = RichTextEditor;
|
|
@@ -1 +1,23 @@
|
|
|
1
|
-
import{useFormContext
|
|
1
|
+
import { useFormContext } from "../hooks/use-form-context.js";
|
|
2
|
+
import "../hooks/index.js";
|
|
3
|
+
import { connect, mapProps } from "@formily/react";
|
|
4
|
+
import { RichTextEditor } from "@pixpilot/shadcn-ui";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/components/rich-text-editor.tsx
|
|
8
|
+
const RichTextEditorBase = (props) => {
|
|
9
|
+
return /* @__PURE__ */ jsx(RichTextEditor, {
|
|
10
|
+
...useFormContext()?.config?.richTextEditor,
|
|
11
|
+
...props,
|
|
12
|
+
children: "RichTextEditor"
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
const RichTextEditor$1 = connect(RichTextEditorBase, mapProps((props, field) => {
|
|
16
|
+
return {
|
|
17
|
+
...props,
|
|
18
|
+
value: field.value ?? ""
|
|
19
|
+
};
|
|
20
|
+
}));
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { RichTextEditor$1 as RichTextEditor };
|
package/dist/components/row.cjs
CHANGED
|
@@ -1 +1,39 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let react = require("react");
|
|
3
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
4
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
+
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
6
|
+
let __pixpilot_shadcn = require("@pixpilot/shadcn");
|
|
7
|
+
__pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
|
|
8
|
+
|
|
9
|
+
//#region src/components/row.tsx
|
|
10
|
+
/**
|
|
11
|
+
* Row component for creating multi-column layouts in forms
|
|
12
|
+
* Should be used with Column components as children
|
|
13
|
+
* Use Tailwind classes for all styling: gap-4, flex-wrap, items-center, justify-between, etc.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <Row className="gap-4 flex-wrap">
|
|
18
|
+
* <Column className="flex-1">
|
|
19
|
+
* <FormItem label="First Name">
|
|
20
|
+
* <Input />
|
|
21
|
+
* </FormItem>
|
|
22
|
+
* </Column>
|
|
23
|
+
* <Column className="flex-1">
|
|
24
|
+
* <FormItem label="Last Name">
|
|
25
|
+
* <Input />
|
|
26
|
+
* </FormItem>
|
|
27
|
+
* </Column>
|
|
28
|
+
* </Row>
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
function Row({ className, children }) {
|
|
32
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
33
|
+
className: (0, __pixpilot_shadcn.cn)("flex gap-4", className),
|
|
34
|
+
children
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
exports.Row = Row;
|
package/dist/components/row.js
CHANGED
|
@@ -1 +1,35 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@pixpilot/shadcn";
|
|
4
|
+
|
|
5
|
+
//#region src/components/row.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Row component for creating multi-column layouts in forms
|
|
8
|
+
* Should be used with Column components as children
|
|
9
|
+
* Use Tailwind classes for all styling: gap-4, flex-wrap, items-center, justify-between, etc.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <Row className="gap-4 flex-wrap">
|
|
14
|
+
* <Column className="flex-1">
|
|
15
|
+
* <FormItem label="First Name">
|
|
16
|
+
* <Input />
|
|
17
|
+
* </FormItem>
|
|
18
|
+
* </Column>
|
|
19
|
+
* <Column className="flex-1">
|
|
20
|
+
* <FormItem label="Last Name">
|
|
21
|
+
* <Input />
|
|
22
|
+
* </FormItem>
|
|
23
|
+
* </Column>
|
|
24
|
+
* </Row>
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
function Row({ className, children }) {
|
|
28
|
+
return /* @__PURE__ */ jsx("div", {
|
|
29
|
+
className: cn("flex gap-4", className),
|
|
30
|
+
children
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
export { Row };
|
|
@@ -1 +1,25 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_file_upload = require('./file-upload/file-upload.cjs');
|
|
3
|
+
const require_file_upload_inline = require('./file-upload/file-upload-inline.cjs');
|
|
4
|
+
require('./file-upload/index.cjs');
|
|
5
|
+
const require_icon_picker = require('./icon-picker.cjs');
|
|
6
|
+
const require_schema_field = require('./schema-field.cjs');
|
|
7
|
+
const require_rich_text_editor = require('./rich-text-editor.cjs');
|
|
8
|
+
let __formily_react = require("@formily/react");
|
|
9
|
+
__formily_react = require_rolldown_runtime.__toESM(__formily_react);
|
|
10
|
+
|
|
11
|
+
//#region src/components/schema-field-extended.tsx
|
|
12
|
+
/**
|
|
13
|
+
* SchemaField with all Shadcn Formily components pre-registered
|
|
14
|
+
* Use this to render forms from JSON Schema
|
|
15
|
+
*/
|
|
16
|
+
const SchemaFieldExtended = (0, __formily_react.createSchemaField)({ components: {
|
|
17
|
+
FileUploadInline: require_file_upload_inline.FileUploadInline,
|
|
18
|
+
IconPicker: require_icon_picker.IconPicker,
|
|
19
|
+
FileUpload: require_file_upload.FileUpload,
|
|
20
|
+
RichTextEditor: require_rich_text_editor.RichTextEditor,
|
|
21
|
+
...require_schema_field.basicComponents
|
|
22
|
+
} });
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
exports.SchemaFieldExtended = SchemaFieldExtended;
|