@pixpilot/formily-shadcn 0.14.6 → 0.15.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.
@@ -1,4 +1,4 @@
1
- import * as react18 from "react";
1
+ import * as react14 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: react18.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_separator0.SeparatorProps & react18.RefAttributes<HTMLDivElement>>, "ref"> & react18.RefAttributes<unknown>>;
9
+ declare const Separator: react14.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_separator0.SeparatorProps & react14.RefAttributes<HTMLDivElement>>, "ref"> & react14.RefAttributes<unknown>>;
10
10
  //#endregion
11
11
  export { Separator };
@@ -17,14 +17,21 @@ const SliderBase = (props) => {
17
17
  * Formily-connected Slider component
18
18
  * Range input for selecting numeric values
19
19
  */
20
- const Slider = (0, __formily_react.connect)(SliderBase, (0, __formily_react.mapProps)((props, field) => {
20
+ const Slider = (0, __formily_react.connect)(SliderBase, (0, __formily_react.mapProps)({
21
+ value: true,
22
+ onInput: true
23
+ }, (props, field) => {
21
24
  const fieldValue = field.value;
22
- const value = typeof fieldValue === "number" ? [fieldValue] : [0];
25
+ let value;
26
+ if (Array.isArray(fieldValue)) value = fieldValue;
27
+ else if (typeof fieldValue === "number") value = [fieldValue];
28
+ else value = [0];
23
29
  return {
24
30
  ...props,
25
31
  value,
26
32
  onValueChange: (newValue) => {
27
- field.setValue(newValue[0]);
33
+ if (Array.isArray(field.value)) field.onInput(newValue).catch(() => {});
34
+ else field.onInput(newValue[0]).catch(() => {});
28
35
  }
29
36
  };
30
37
  }));
@@ -1,4 +1,4 @@
1
- import * as react14 from "react";
1
+ import * as react17 from "react";
2
2
  import { SliderProps } from "@pixpilot/shadcn-ui";
3
3
 
4
4
  //#region src/components/slider.d.ts
@@ -7,6 +7,6 @@ import { SliderProps } from "@pixpilot/shadcn-ui";
7
7
  * Formily-connected Slider component
8
8
  * Range input for selecting numeric values
9
9
  */
10
- declare const Slider: react14.ForwardRefExoticComponent<Omit<Partial<SliderProps>, "ref"> & react14.RefAttributes<unknown>>;
10
+ declare const Slider: react17.ForwardRefExoticComponent<Omit<Partial<SliderProps>, "ref"> & react17.RefAttributes<unknown>>;
11
11
  //#endregion
12
12
  export { Slider };
@@ -13,14 +13,21 @@ const SliderBase = (props) => {
13
13
  * Formily-connected Slider component
14
14
  * Range input for selecting numeric values
15
15
  */
16
- const Slider$1 = connect(SliderBase, mapProps((props, field) => {
16
+ const Slider$1 = connect(SliderBase, mapProps({
17
+ value: true,
18
+ onInput: true
19
+ }, (props, field) => {
17
20
  const fieldValue = field.value;
18
- const value = typeof fieldValue === "number" ? [fieldValue] : [0];
21
+ let value;
22
+ if (Array.isArray(fieldValue)) value = fieldValue;
23
+ else if (typeof fieldValue === "number") value = [fieldValue];
24
+ else value = [0];
19
25
  return {
20
26
  ...props,
21
27
  value,
22
28
  onValueChange: (newValue) => {
23
- field.setValue(newValue[0]);
29
+ if (Array.isArray(field.value)) field.onInput(newValue).catch(() => {});
30
+ else field.onInput(newValue[0]).catch(() => {});
24
31
  }
25
32
  };
26
33
  }));
@@ -1,4 +1,4 @@
1
- import * as react21 from "react";
1
+ import * as react19 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: react21.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_switch0.SwitchProps & react21.RefAttributes<HTMLButtonElement>>, "ref"> & react21.RefAttributes<unknown>>;
9
+ declare const Switch: react19.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_switch0.SwitchProps & react19.RefAttributes<HTMLButtonElement>>, "ref"> & react19.RefAttributes<unknown>>;
10
10
  //#endregion
11
11
  export { Switch };
@@ -1,4 +1,4 @@
1
- import * as react16 from "react";
1
+ import * as react22 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: react16.ForwardRefExoticComponent<Partial<_pixpilot_shadcn_ui0.TagsInputProps> & react16.RefAttributes<unknown>>;
13
+ declare const TagsInputInLine: react22.ForwardRefExoticComponent<Partial<_pixpilot_shadcn_ui0.TagsInputProps> & react22.RefAttributes<unknown>>;
14
14
  //#endregion
15
15
  export { TagsInputInLine };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pixpilot/formily-shadcn",
3
3
  "type": "module",
4
- "version": "0.14.6",
4
+ "version": "0.15.0",
5
5
  "description": "Formily integration for shadcn/ui components",
6
6
  "author": "m.doaie <m.doaie@hotmail.com>",
7
7
  "license": "MIT",
@@ -54,11 +54,11 @@
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
+ "@internal/tsdown-config": "0.1.0",
57
59
  "@internal/prettier-config": "0.0.1",
58
60
  "@internal/tsconfig": "0.1.0",
59
- "@internal/tsdown-config": "0.1.0",
60
- "@internal/vitest-config": "0.1.0",
61
- "@internal/eslint-config": "0.3.0"
61
+ "@internal/vitest-config": "0.1.0"
62
62
  },
63
63
  "prettier": "@internal/prettier-config",
64
64
  "scripts": {