@pixpilot/formily-shadcn 0.6.0 → 0.8.1
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.d.cts +1 -1
- package/dist/components/array-base/components/addition.d.ts +1 -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.d.cts +12 -6
- package/dist/components/context/form-context.d.ts +12 -6
- package/dist/components/context/form-context.js +7 -1
- package/dist/components/context/index.cjs +2 -1
- package/dist/components/context/index.d.cts +1 -1
- package/dist/components/context/index.d.ts +1 -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 -0
- package/dist/components/file-upload/file-upload-inline.d.cts +20 -0
- package/dist/components/file-upload/file-upload-inline.d.ts +20 -0
- package/dist/components/file-upload/file-upload-inline.js +30 -0
- package/dist/components/file-upload/file-upload.cjs +35 -0
- package/dist/components/file-upload/file-upload.d.cts +20 -0
- package/dist/components/file-upload/file-upload.d.ts +20 -0
- package/dist/components/file-upload/file-upload.js +30 -0
- package/dist/components/file-upload/index.cjs +2 -0
- package/dist/components/file-upload/index.d.cts +2 -0
- package/dist/components/file-upload/index.d.ts +2 -0
- package/dist/components/file-upload/index.js +2 -0
- package/dist/components/file-upload/use-file-upload-feedback.cjs +59 -0
- package/dist/components/file-upload/use-file-upload-feedback.js +53 -0
- 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.d.cts +1 -1
- package/dist/components/form.d.ts +1 -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.d.cts +2 -2
- package/dist/components/icon-picker.d.ts +2 -2
- 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.d.cts +3 -0
- package/dist/components/json-schema-form-renderer.d.ts +3 -0
- package/dist/components/json-schema-form-renderer.js +26 -1
- package/dist/components/number-input.cjs +19 -1
- package/dist/components/number-input.d.cts +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 -0
- package/dist/components/rich-text-editor.d.cts +6 -0
- package/dist/components/rich-text-editor.d.ts +6 -0
- package/dist/components/rich-text-editor.js +23 -0
- package/dist/components/row.cjs +39 -1
- package/dist/components/row.js +35 -1
- package/dist/components/schema-field-extended.cjs +25 -0
- package/dist/components/schema-field-extended.d.cts +630 -0
- package/dist/components/schema-field-extended.d.ts +630 -0
- package/dist/components/schema-field-extended.js +23 -0
- package/dist/components/schema-field.cjs +61 -1
- package/dist/components/schema-field.d.cts +290 -288
- package/dist/components/schema-field.d.ts +136 -134
- 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.cts +3 -3
- package/dist/components/separator.d.ts +3 -3
- package/dist/components/separator.js +12 -1
- package/dist/components/slider.cjs +33 -1
- package/dist/components/slider.d.cts +2 -2
- 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.d.cts +3 -3
- package/dist/components/switch.d.ts +3 -3
- package/dist/components/switch.js +18 -1
- package/dist/components/tags-input-inline.cjs +26 -1
- package/dist/components/tags-input-inline.d.cts +3 -3
- package/dist/components/tags-input-inline.d.ts +3 -3
- package/dist/components/tags-input-inline.js +23 -1
- package/dist/components/textarea.cjs +19 -1
- package/dist/components/textarea.d.cts +2 -2
- 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.d.cts +7 -4
- package/dist/index.d.ts +7 -4
- package/dist/index.js +35 -1
- package/dist/types/form.d.cts +1 -9
- package/dist/types/form.d.ts +1 -9
- 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 +5 -5
- package/dist/components/file-upload-inline.cjs +0 -3
- package/dist/components/file-upload-inline.d.cts +0 -12
- package/dist/components/file-upload-inline.d.ts +0 -12
- package/dist/components/file-upload-inline.js +0 -3
|
@@ -1 +1,57 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ArrayCards } from "./array-cards/array-cards.js";
|
|
2
|
+
import "./array-cards/index.js";
|
|
3
|
+
import { ArrayCollapse } from "./array-collapse/array-collapse.js";
|
|
4
|
+
import "./array-collapse/index.js";
|
|
5
|
+
import { Checkbox } from "./checkbox.js";
|
|
6
|
+
import { Column } from "./column.js";
|
|
7
|
+
import { Combobox as Combobox$1 } from "./combobox.js";
|
|
8
|
+
import { DatePicker as DatePicker$1 } from "./date-picker.js";
|
|
9
|
+
import { FormGrid } from "./form-grid.js";
|
|
10
|
+
import { FormItem } from "./form-item.js";
|
|
11
|
+
import { Input } from "./input.js";
|
|
12
|
+
import { ArrayDialog } from "./array-dialog/array-dialog.js";
|
|
13
|
+
import "./array-dialog/index.js";
|
|
14
|
+
import { ArrayPopover } from "./array-popover/array-popover.js";
|
|
15
|
+
import "./array-popover/index.js";
|
|
16
|
+
import { Hidden } from "./hidden.js";
|
|
17
|
+
import { NumberInput } from "./number-input.js";
|
|
18
|
+
import { ObjectContainer } from "./object-container.js";
|
|
19
|
+
import { ConnectedRadio } from "./radio.js";
|
|
20
|
+
import { Row } from "./row.js";
|
|
21
|
+
import { Select as Select$1 } from "./select.js";
|
|
22
|
+
import { Separator } from "./separator.js";
|
|
23
|
+
import { Slider as Slider$1 } from "./slider.js";
|
|
24
|
+
import { Switch } from "./switch.js";
|
|
25
|
+
import { Textarea } from "./textarea.js";
|
|
26
|
+
import { createSchemaField } from "@formily/react";
|
|
27
|
+
import { TagsInput } from "@pixpilot/shadcn-ui";
|
|
28
|
+
|
|
29
|
+
//#region src/components/schema-field.tsx
|
|
30
|
+
const basicComponents = {
|
|
31
|
+
FormItem,
|
|
32
|
+
Hidden,
|
|
33
|
+
Input,
|
|
34
|
+
Textarea,
|
|
35
|
+
NumberInput,
|
|
36
|
+
Checkbox,
|
|
37
|
+
Radio: ConnectedRadio,
|
|
38
|
+
Select: Select$1,
|
|
39
|
+
Switch,
|
|
40
|
+
DatePicker: DatePicker$1,
|
|
41
|
+
Row,
|
|
42
|
+
Column,
|
|
43
|
+
FormGrid,
|
|
44
|
+
Combobox: Combobox$1,
|
|
45
|
+
TagsInput,
|
|
46
|
+
Separator,
|
|
47
|
+
Slider: Slider$1,
|
|
48
|
+
ArrayCards,
|
|
49
|
+
ArrayDialog,
|
|
50
|
+
ArrayCollapse,
|
|
51
|
+
ArrayPopover,
|
|
52
|
+
ObjectContainer
|
|
53
|
+
};
|
|
54
|
+
const SchemaField = createSchemaField({ components: basicComponents });
|
|
55
|
+
|
|
56
|
+
//#endregion
|
|
57
|
+
export { SchemaField, basicComponents };
|
|
@@ -1 +1,11 @@
|
|
|
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_ui = require("@pixpilot/shadcn-ui");
|
|
5
|
+
__pixpilot_shadcn_ui = require_rolldown_runtime.__toESM(__pixpilot_shadcn_ui);
|
|
6
|
+
|
|
7
|
+
//#region src/components/select.tsx
|
|
8
|
+
const Select = (0, __formily_react.connect)(__pixpilot_shadcn_ui.Select, (0, __formily_react.mapProps)({ dataSource: "options" }));
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
exports.Select = Select;
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import { connect, mapProps } from "@formily/react";
|
|
2
|
+
import { Select } from "@pixpilot/shadcn-ui";
|
|
3
|
+
|
|
4
|
+
//#region src/components/select.tsx
|
|
5
|
+
const Select$1 = connect(Select, mapProps({ dataSource: "options" }));
|
|
6
|
+
|
|
7
|
+
//#endregion
|
|
8
|
+
export { Select$1 as Select };
|
|
@@ -1 +1,15 @@
|
|
|
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/separator.tsx
|
|
8
|
+
/**
|
|
9
|
+
* Formily-connected Separator component
|
|
10
|
+
* A visual divider for content sections
|
|
11
|
+
*/
|
|
12
|
+
const Separator = (0, __formily_react.connect)(__pixpilot_shadcn.Separator);
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
exports.Separator = Separator;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as react780 from "react";
|
|
2
|
+
import * as _radix_ui_react_separator18 from "@radix-ui/react-separator";
|
|
3
3
|
|
|
4
4
|
//#region src/components/separator.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Formily-connected Separator component
|
|
7
7
|
* A visual divider for content sections
|
|
8
8
|
*/
|
|
9
|
-
declare const Separator:
|
|
9
|
+
declare const Separator: react780.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_separator18.SeparatorProps & react780.RefAttributes<HTMLDivElement>>, "ref"> & react780.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Separator };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as react784 from "react";
|
|
2
|
+
import * as _radix_ui_react_separator18 from "@radix-ui/react-separator";
|
|
3
3
|
|
|
4
4
|
//#region src/components/separator.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Formily-connected Separator component
|
|
7
7
|
* A visual divider for content sections
|
|
8
8
|
*/
|
|
9
|
-
declare const Separator:
|
|
9
|
+
declare const Separator: react784.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_separator18.SeparatorProps & react784.RefAttributes<HTMLDivElement>>, "ref"> & react784.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Separator };
|
|
@@ -1 +1,12 @@
|
|
|
1
|
-
import{connect
|
|
1
|
+
import { connect } from "@formily/react";
|
|
2
|
+
import { Separator } from "@pixpilot/shadcn";
|
|
3
|
+
|
|
4
|
+
//#region src/components/separator.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Formily-connected Separator component
|
|
7
|
+
* A visual divider for content sections
|
|
8
|
+
*/
|
|
9
|
+
const Separator$1 = connect(Separator);
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Separator$1 as Separator };
|
|
@@ -1 +1,33 @@
|
|
|
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_ui = require("@pixpilot/shadcn-ui");
|
|
5
|
+
__pixpilot_shadcn_ui = require_rolldown_runtime.__toESM(__pixpilot_shadcn_ui);
|
|
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/slider.tsx
|
|
10
|
+
const SliderBase = (props) => {
|
|
11
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn_ui.Slider, {
|
|
12
|
+
...props,
|
|
13
|
+
className: (0, __pixpilot_shadcn_ui.cn)("py-2", props.className)
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Formily-connected Slider component
|
|
18
|
+
* Range input for selecting numeric values
|
|
19
|
+
*/
|
|
20
|
+
const Slider = (0, __formily_react.connect)(SliderBase, (0, __formily_react.mapProps)((props, field) => {
|
|
21
|
+
const fieldValue = field.value;
|
|
22
|
+
const value = typeof fieldValue === "number" ? [fieldValue] : [0];
|
|
23
|
+
return {
|
|
24
|
+
...props,
|
|
25
|
+
value,
|
|
26
|
+
onValueChange: (newValue) => {
|
|
27
|
+
field.setValue(newValue[0]);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}));
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
exports.Slider = Slider;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import * as react783 from "react";
|
|
1
2
|
import { SliderProps } from "@pixpilot/shadcn-ui";
|
|
2
|
-
import * as react17 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/slider.d.ts
|
|
5
5
|
|
|
@@ -7,6 +7,6 @@ import * as react17 from "react";
|
|
|
7
7
|
* Formily-connected Slider component
|
|
8
8
|
* Range input for selecting numeric values
|
|
9
9
|
*/
|
|
10
|
-
declare const Slider:
|
|
10
|
+
declare const Slider: react783.ForwardRefExoticComponent<Omit<Partial<SliderProps>, "ref"> & react783.RefAttributes<unknown>>;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { Slider };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import * as react787 from "react";
|
|
1
2
|
import { SliderProps } from "@pixpilot/shadcn-ui";
|
|
2
|
-
import * as react390 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/slider.d.ts
|
|
5
5
|
|
|
@@ -7,6 +7,6 @@ import * as react390 from "react";
|
|
|
7
7
|
* Formily-connected Slider component
|
|
8
8
|
* Range input for selecting numeric values
|
|
9
9
|
*/
|
|
10
|
-
declare const Slider$1:
|
|
10
|
+
declare const Slider$1: react787.ForwardRefExoticComponent<Omit<Partial<SliderProps>, "ref"> & react787.RefAttributes<unknown>>;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { Slider$1 as Slider };
|
|
@@ -1 +1,29 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import { connect, mapProps } from "@formily/react";
|
|
2
|
+
import { Slider, cn } from "@pixpilot/shadcn-ui";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/slider.tsx
|
|
6
|
+
const SliderBase = (props) => {
|
|
7
|
+
return /* @__PURE__ */ jsx(Slider, {
|
|
8
|
+
...props,
|
|
9
|
+
className: cn("py-2", props.className)
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Formily-connected Slider component
|
|
14
|
+
* Range input for selecting numeric values
|
|
15
|
+
*/
|
|
16
|
+
const Slider$1 = connect(SliderBase, mapProps((props, field) => {
|
|
17
|
+
const fieldValue = field.value;
|
|
18
|
+
const value = typeof fieldValue === "number" ? [fieldValue] : [0];
|
|
19
|
+
return {
|
|
20
|
+
...props,
|
|
21
|
+
value,
|
|
22
|
+
onValueChange: (newValue) => {
|
|
23
|
+
field.setValue(newValue[0]);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}));
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
export { Slider$1 as Slider };
|
|
@@ -1 +1,21 @@
|
|
|
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/switch.tsx
|
|
8
|
+
/**
|
|
9
|
+
* Formily-connected Switch component
|
|
10
|
+
* Toggle switch for boolean values
|
|
11
|
+
*/
|
|
12
|
+
const Switch = (0, __formily_react.connect)(__pixpilot_shadcn.Switch, (0, __formily_react.mapProps)({
|
|
13
|
+
value: "checked",
|
|
14
|
+
onInput: "onCheckedChange"
|
|
15
|
+
}, (props, field) => {
|
|
16
|
+
field.decoratorProps.labelPlacement = "end";
|
|
17
|
+
return props;
|
|
18
|
+
}));
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
exports.Switch = Switch;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as react785 from "react";
|
|
2
|
+
import * as _radix_ui_react_switch18 from "@radix-ui/react-switch";
|
|
3
3
|
|
|
4
4
|
//#region src/components/switch.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Formily-connected Switch component
|
|
7
7
|
* Toggle switch for boolean values
|
|
8
8
|
*/
|
|
9
|
-
declare const Switch:
|
|
9
|
+
declare const Switch: react785.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_switch18.SwitchProps & react785.RefAttributes<HTMLButtonElement>>, "ref"> & react785.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Switch };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as react789 from "react";
|
|
2
|
+
import * as _radix_ui_react_switch18 from "@radix-ui/react-switch";
|
|
3
3
|
|
|
4
4
|
//#region src/components/switch.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Formily-connected Switch component
|
|
7
7
|
* Toggle switch for boolean values
|
|
8
8
|
*/
|
|
9
|
-
declare const Switch:
|
|
9
|
+
declare const Switch: react789.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_switch18.SwitchProps & react789.RefAttributes<HTMLButtonElement>>, "ref"> & react789.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Switch };
|
|
@@ -1 +1,18 @@
|
|
|
1
|
-
import{connect
|
|
1
|
+
import { connect, mapProps } from "@formily/react";
|
|
2
|
+
import { Switch } from "@pixpilot/shadcn";
|
|
3
|
+
|
|
4
|
+
//#region src/components/switch.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Formily-connected Switch component
|
|
7
|
+
* Toggle switch for boolean values
|
|
8
|
+
*/
|
|
9
|
+
const Switch$1 = connect(Switch, mapProps({
|
|
10
|
+
value: "checked",
|
|
11
|
+
onInput: "onCheckedChange"
|
|
12
|
+
}, (props, field) => {
|
|
13
|
+
field.decoratorProps.labelPlacement = "end";
|
|
14
|
+
return props;
|
|
15
|
+
}));
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { Switch$1 as Switch };
|
|
@@ -1 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
5
|
+
let __formily_react = require("@formily/react");
|
|
6
|
+
__formily_react = require_rolldown_runtime.__toESM(__formily_react);
|
|
7
|
+
let __pixpilot_shadcn_ui = require("@pixpilot/shadcn-ui");
|
|
8
|
+
__pixpilot_shadcn_ui = require_rolldown_runtime.__toESM(__pixpilot_shadcn_ui);
|
|
9
|
+
|
|
10
|
+
//#region src/components/tags-input-inline.tsx
|
|
11
|
+
/**
|
|
12
|
+
* Formily-connected TagsInputInLine component
|
|
13
|
+
* Automatically connects shadcn-ui TagsInputInLine to Formily field state
|
|
14
|
+
*
|
|
15
|
+
* Based on DiceUI's tags-input for inline tag editing with keyboard navigation
|
|
16
|
+
* and validation support.
|
|
17
|
+
*/
|
|
18
|
+
const TagsInputInLine = (0, __formily_react.connect)(__pixpilot_shadcn_ui.TagsInput, (0, __formily_react.mapProps)((props, field) => {
|
|
19
|
+
return {
|
|
20
|
+
...props,
|
|
21
|
+
value: field.value ?? []
|
|
22
|
+
};
|
|
23
|
+
}));
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
exports.TagsInputInLine = TagsInputInLine;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as react788 from "react";
|
|
2
|
+
import * as _pixpilot_shadcn_ui189 from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/tags-input-inline.d.ts
|
|
5
5
|
|
|
@@ -10,6 +10,6 @@ import * as react22 from "react";
|
|
|
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: react788.ForwardRefExoticComponent<Partial<_pixpilot_shadcn_ui189.TagsInputProps> & react788.RefAttributes<unknown>>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { TagsInputInLine };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as react792 from "react";
|
|
2
|
+
import * as _pixpilot_shadcn_ui189 from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/tags-input-inline.d.ts
|
|
5
5
|
|
|
@@ -10,6 +10,6 @@ import * as react395 from "react";
|
|
|
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: react792.ForwardRefExoticComponent<Partial<_pixpilot_shadcn_ui189.TagsInputProps> & react792.RefAttributes<unknown>>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { TagsInputInLine };
|
|
@@ -1 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import { connect, mapProps } from "@formily/react";
|
|
5
|
+
import { TagsInput } from "@pixpilot/shadcn-ui";
|
|
6
|
+
|
|
7
|
+
//#region src/components/tags-input-inline.tsx
|
|
8
|
+
/**
|
|
9
|
+
* Formily-connected TagsInputInLine component
|
|
10
|
+
* Automatically connects shadcn-ui TagsInputInLine to Formily field state
|
|
11
|
+
*
|
|
12
|
+
* Based on DiceUI's tags-input for inline tag editing with keyboard navigation
|
|
13
|
+
* and validation support.
|
|
14
|
+
*/
|
|
15
|
+
const TagsInputInLine = connect(TagsInput, mapProps((props, field) => {
|
|
16
|
+
return {
|
|
17
|
+
...props,
|
|
18
|
+
value: field.value ?? []
|
|
19
|
+
};
|
|
20
|
+
}));
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { TagsInputInLine };
|
|
@@ -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/textarea.tsx
|
|
8
|
+
/**
|
|
9
|
+
* Formily-connected Textarea component
|
|
10
|
+
*/
|
|
11
|
+
const Textarea = (0, __formily_react.connect)(__pixpilot_shadcn.Textarea, (0, __formily_react.mapProps)((props, field) => {
|
|
12
|
+
return {
|
|
13
|
+
...props,
|
|
14
|
+
value: field.value ?? ""
|
|
15
|
+
};
|
|
16
|
+
}));
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
exports.Textarea = Textarea;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react790 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: react790.ForwardRefExoticComponent<Omit<Partial<react790.ClassAttributes<HTMLTextAreaElement> & react790.TextareaHTMLAttributes<HTMLTextAreaElement>>, "ref"> & react790.RefAttributes<unknown>>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { Textarea };
|
|
@@ -1 +1,16 @@
|
|
|
1
|
-
import{connect
|
|
1
|
+
import { connect, mapProps } from "@formily/react";
|
|
2
|
+
import { Textarea } from "@pixpilot/shadcn";
|
|
3
|
+
|
|
4
|
+
//#region src/components/textarea.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Formily-connected Textarea component
|
|
7
|
+
*/
|
|
8
|
+
const Textarea$1 = connect(Textarea, mapProps((props, field) => {
|
|
9
|
+
return {
|
|
10
|
+
...props,
|
|
11
|
+
value: field.value ?? ""
|
|
12
|
+
};
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Textarea$1 as Textarea };
|
package/dist/hooks/index.cjs
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_use_description = require('./use-description.cjs');
|
|
2
|
+
const require_use_form_context = require('./use-form-context.cjs');
|
|
3
|
+
const require_use_label = require('./use-label.cjs');
|
package/dist/hooks/index.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
import{useDescription
|
|
1
|
+
import { useDescription } from "./use-description.js";
|
|
2
|
+
import { useFormContext } from "./use-form-context.js";
|
|
3
|
+
import { useLabel } from "./use-label.js";
|
|
@@ -1 +1,14 @@
|
|
|
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
|
+
|
|
5
|
+
//#region src/hooks/use-description.ts
|
|
6
|
+
function useDescription(description) {
|
|
7
|
+
const desc = (0, __formily_react.useFieldSchema)().description;
|
|
8
|
+
if (description != null) return description;
|
|
9
|
+
if (desc != null) return desc;
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
exports.useDescription = useDescription;
|
|
@@ -1 +1,12 @@
|
|
|
1
|
-
import{useFieldSchema
|
|
1
|
+
import { useFieldSchema } from "@formily/react";
|
|
2
|
+
|
|
3
|
+
//#region src/hooks/use-description.ts
|
|
4
|
+
function useDescription(description) {
|
|
5
|
+
const desc = useFieldSchema().description;
|
|
6
|
+
if (description != null) return description;
|
|
7
|
+
if (desc != null) return desc;
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { useDescription };
|
|
@@ -1 +1,13 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_form_context = require('../components/context/form-context.cjs');
|
|
3
|
+
require('../components/context/index.cjs');
|
|
4
|
+
let react = require("react");
|
|
5
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
6
|
+
|
|
7
|
+
//#region src/hooks/use-form-context.ts
|
|
8
|
+
function useFormContext() {
|
|
9
|
+
return (0, react.use)(require_form_context.FormContext);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
exports.useFormContext = useFormContext;
|
|
@@ -1 +1,11 @@
|
|
|
1
|
-
import{FormContext
|
|
1
|
+
import { FormContext } from "../components/context/form-context.js";
|
|
2
|
+
import "../components/context/index.js";
|
|
3
|
+
import { use } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/hooks/use-form-context.ts
|
|
6
|
+
function useFormContext() {
|
|
7
|
+
return use(FormContext);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { useFormContext };
|
package/dist/hooks/use-label.cjs
CHANGED
|
@@ -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_string = require("@pixpilot/string");
|
|
5
|
+
__pixpilot_string = require_rolldown_runtime.__toESM(__pixpilot_string);
|
|
6
|
+
|
|
7
|
+
//#region src/hooks/use-label.ts
|
|
8
|
+
function useLabel(label) {
|
|
9
|
+
const schema = (0, __formily_react.useFieldSchema)();
|
|
10
|
+
const name = schema.name;
|
|
11
|
+
const title = schema.title;
|
|
12
|
+
if (label != null) return label;
|
|
13
|
+
if (title != null) return typeof title === "string" ? (0, __pixpilot_string.toCapitalCase)(title) : title;
|
|
14
|
+
if (name != null) return typeof name === "string" ? (0, __pixpilot_string.toCapitalCase)(name) : name;
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
exports.useLabel = useLabel;
|
package/dist/hooks/use-label.js
CHANGED
|
@@ -1 +1,16 @@
|
|
|
1
|
-
import{useFieldSchema
|
|
1
|
+
import { useFieldSchema } from "@formily/react";
|
|
2
|
+
import { toCapitalCase } from "@pixpilot/string";
|
|
3
|
+
|
|
4
|
+
//#region src/hooks/use-label.ts
|
|
5
|
+
function useLabel(label) {
|
|
6
|
+
const schema = useFieldSchema();
|
|
7
|
+
const name = schema.name;
|
|
8
|
+
const title = schema.title;
|
|
9
|
+
if (label != null) return label;
|
|
10
|
+
if (title != null) return typeof title === "string" ? toCapitalCase(title) : title;
|
|
11
|
+
if (name != null) return typeof name === "string" ? toCapitalCase(name) : name;
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { useLabel };
|