@pixpilot/formily-shadcn 0.25.2 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/checkbox.cjs +2 -6
- package/dist/components/checkbox.js +2 -6
- package/dist/components/context/form-context.d.cts +3 -3
- package/dist/components/context/form-context.d.ts +3 -3
- package/dist/components/form-grid.d.cts +2 -2
- package/dist/components/form-grid.d.ts +2 -2
- package/dist/components/form-item/base-form-item.cjs +25 -10
- package/dist/components/form-item/base-form-item.js +25 -10
- package/dist/components/form-item/form-item-label.cjs +4 -2
- package/dist/components/form-item/form-item-label.js +4 -2
- package/dist/components/form-item/form-item-types.d.cts +12 -2
- package/dist/components/form-item/form-item-types.d.ts +12 -2
- package/dist/components/form-item/form-item.d.cts +1 -1
- package/dist/components/form-item/form-item.d.ts +1 -1
- package/dist/components/form-item/index.d.cts +1 -1
- package/dist/components/form-item/index.d.ts +1 -1
- package/dist/components/form.d.cts +2 -2
- package/dist/components/form.d.ts +2 -2
- package/dist/components/schema-field/schema-field-basics.d.cts +233 -233
- package/dist/components/schema-field/schema-field.d.cts +310 -310
- package/dist/components/separator.d.cts +2 -2
- package/dist/components/slider/slider-input.d.cts +3 -3
- package/dist/components/slider/slider-select.d.cts +3 -3
- package/dist/components/slider/slider.d.cts +3 -3
- package/dist/components/switch.cjs +2 -1
- package/dist/components/switch.d.cts +2 -2
- package/dist/components/switch.js +2 -1
- package/dist/components/tags-input-inline.d.cts +2 -2
- package/dist/components/textarea.d.cts +2 -2
- package/dist/utils/formily-decorator.cjs +17 -0
- package/dist/utils/formily-decorator.js +16 -0
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react10 from "react";
|
|
2
2
|
import * as _radix_ui_react_separator0 from "@radix-ui/react-separator";
|
|
3
3
|
|
|
4
4
|
//#region src/components/separator.d.ts
|
|
@@ -6,6 +6,6 @@ import * as _radix_ui_react_separator0 from "@radix-ui/react-separator";
|
|
|
6
6
|
* Formily-connected Separator component
|
|
7
7
|
* A visual divider for content sections
|
|
8
8
|
*/
|
|
9
|
-
declare const Separator:
|
|
9
|
+
declare const Separator: react10.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_separator0.SeparatorProps & react10.RefAttributes<HTMLDivElement>>, "ref"> & react10.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Separator };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as react1517 from "react";
|
|
2
|
+
import * as _pixpilot_shadcn_ui381 from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/slider/slider-input.d.ts
|
|
5
|
-
declare const SliderInput:
|
|
5
|
+
declare const SliderInput: react1517.ForwardRefExoticComponent<Omit<Partial<_pixpilot_shadcn_ui381.SliderInputProps>, "ref"> & react1517.RefAttributes<unknown>>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { SliderInput };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as react633 from "react";
|
|
2
|
+
import * as _pixpilot_shadcn_ui302 from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/slider/slider-select.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Formily-connected SliderSelect component
|
|
7
7
|
* Discrete slider that maps between provided options
|
|
8
8
|
*/
|
|
9
|
-
declare const SliderSelect:
|
|
9
|
+
declare const SliderSelect: react633.ForwardRefExoticComponent<Omit<Partial<_pixpilot_shadcn_ui302.SliderSelectProps>, "ref"> & react633.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { SliderSelect };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as react1515 from "react";
|
|
2
|
+
import * as _pixpilot_shadcn_ui380 from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/slider/slider.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Formily-connected Slider component
|
|
7
7
|
* Range input for selecting numeric values
|
|
8
8
|
*/
|
|
9
|
-
declare const Slider:
|
|
9
|
+
declare const Slider: react1515.ForwardRefExoticComponent<Omit<Partial<_pixpilot_shadcn_ui380.SliderProps>, "ref"> & react1515.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Slider };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_formily_decorator = require('../utils/formily-decorator.cjs');
|
|
2
3
|
let __formily_react = require("@formily/react");
|
|
3
4
|
__formily_react = require_rolldown_runtime.__toESM(__formily_react);
|
|
4
5
|
let __pixpilot_shadcn = require("@pixpilot/shadcn");
|
|
@@ -13,7 +14,7 @@ const Switch = (0, __formily_react.connect)(__pixpilot_shadcn.Switch, (0, __form
|
|
|
13
14
|
value: "checked",
|
|
14
15
|
onInput: "onCheckedChange"
|
|
15
16
|
}, (props, field) => {
|
|
16
|
-
field
|
|
17
|
+
require_formily_decorator.setCheckboxDefaultDecoratorProps(field);
|
|
17
18
|
return props;
|
|
18
19
|
}));
|
|
19
20
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react13 from "react";
|
|
2
2
|
import * as _radix_ui_react_switch0 from "@radix-ui/react-switch";
|
|
3
3
|
|
|
4
4
|
//#region src/components/switch.d.ts
|
|
@@ -6,6 +6,6 @@ import * as _radix_ui_react_switch0 from "@radix-ui/react-switch";
|
|
|
6
6
|
* Formily-connected Switch component
|
|
7
7
|
* Toggle switch for boolean values
|
|
8
8
|
*/
|
|
9
|
-
declare const Switch:
|
|
9
|
+
declare const Switch: react13.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_switch0.SwitchProps & react13.RefAttributes<HTMLButtonElement>>, "ref"> & react13.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Switch };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { setCheckboxDefaultDecoratorProps } from "../utils/formily-decorator.js";
|
|
1
2
|
import { connect, mapProps } from "@formily/react";
|
|
2
3
|
import { Switch } from "@pixpilot/shadcn";
|
|
3
4
|
|
|
@@ -10,7 +11,7 @@ const Switch$1 = connect(Switch, mapProps({
|
|
|
10
11
|
value: "checked",
|
|
11
12
|
onInput: "onCheckedChange"
|
|
12
13
|
}, (props, field) => {
|
|
13
|
-
field
|
|
14
|
+
setCheckboxDefaultDecoratorProps(field);
|
|
14
15
|
return props;
|
|
15
16
|
}));
|
|
16
17
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react16 from "react";
|
|
2
2
|
import * as _pixpilot_shadcn_ui0 from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/tags-input-inline.d.ts
|
|
@@ -10,6 +10,6 @@ import * as _pixpilot_shadcn_ui0 from "@pixpilot/shadcn-ui";
|
|
|
10
10
|
* Based on DiceUI's tags-input for inline tag editing with keyboard navigation
|
|
11
11
|
* and validation support.
|
|
12
12
|
*/
|
|
13
|
-
declare const TagsInputInLine:
|
|
13
|
+
declare const TagsInputInLine: react16.ForwardRefExoticComponent<Partial<_pixpilot_shadcn_ui0.TagsInputProps> & react16.RefAttributes<unknown>>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { TagsInputInLine };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react18 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: react18.ForwardRefExoticComponent<Omit<Partial<react18.ClassAttributes<HTMLTextAreaElement> & react18.TextareaHTMLAttributes<HTMLTextAreaElement>>, "ref"> & react18.RefAttributes<unknown>>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { Textarea };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/utils/formily-decorator.ts
|
|
3
|
+
/**
|
|
4
|
+
* Sets default decorator props for Checkbox and Switch components.
|
|
5
|
+
* Ensures slots.label.placement is 'end' and slots.label.className is 'font-normal' if not already set.
|
|
6
|
+
*/
|
|
7
|
+
function setCheckboxDefaultDecoratorProps(field) {
|
|
8
|
+
const slots = field.decoratorProps.slots ?? {};
|
|
9
|
+
const label = slots.label ?? {};
|
|
10
|
+
if (label.placement == null) label.placement = "end";
|
|
11
|
+
if (label.className == null) label.className = "font-normal";
|
|
12
|
+
slots.label = label;
|
|
13
|
+
field.decoratorProps.slots = slots;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
exports.setCheckboxDefaultDecoratorProps = setCheckboxDefaultDecoratorProps;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/utils/formily-decorator.ts
|
|
2
|
+
/**
|
|
3
|
+
* Sets default decorator props for Checkbox and Switch components.
|
|
4
|
+
* Ensures slots.label.placement is 'end' and slots.label.className is 'font-normal' if not already set.
|
|
5
|
+
*/
|
|
6
|
+
function setCheckboxDefaultDecoratorProps(field) {
|
|
7
|
+
const slots = field.decoratorProps.slots ?? {};
|
|
8
|
+
const label = slots.label ?? {};
|
|
9
|
+
if (label.placement == null) label.placement = "end";
|
|
10
|
+
if (label.className == null) label.className = "font-normal";
|
|
11
|
+
slots.label = label;
|
|
12
|
+
field.decoratorProps.slots = slots;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { setCheckboxDefaultDecoratorProps };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixpilot/formily-shadcn",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.26.0",
|
|
5
5
|
"description": "Formily integration for shadcn/ui components",
|
|
6
6
|
"author": "m.doaie <m.doaie@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"json-schema-traverse": "^1.0.0",
|
|
41
41
|
"lucide-react": "^0.562.0",
|
|
42
42
|
"pretty-bytes": "^7.1.0",
|
|
43
|
-
"@pixpilot/shadcn": "0.
|
|
44
|
-
"@pixpilot/shadcn
|
|
43
|
+
"@pixpilot/shadcn-ui": "0.31.1",
|
|
44
|
+
"@pixpilot/shadcn": "0.7.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@storybook/react": "^8.6.14",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"react-dom": "19.2.0",
|
|
55
55
|
"tsdown": "^0.15.12",
|
|
56
56
|
"typescript": "^5.9.3",
|
|
57
|
-
"@internal/eslint-config": "0.3.0",
|
|
58
57
|
"@internal/prettier-config": "0.0.1",
|
|
58
|
+
"@internal/eslint-config": "0.3.0",
|
|
59
59
|
"@internal/tsconfig": "0.1.0",
|
|
60
60
|
"@internal/tsdown-config": "0.1.0",
|
|
61
61
|
"@internal/vitest-config": "0.1.0"
|