@pixpilot/formily-shadcn 0.16.2 → 0.16.4
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.d.ts +2 -2
- package/dist/components/date-picker.d.cts +1 -1
- package/dist/components/date-picker.d.ts +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-item/connected-form-item.d.cts +4 -4
- package/dist/components/form-item/connected-form-item.d.ts +4 -4
- package/dist/components/icon-picker.d.ts +3 -3
- package/dist/components/input.d.ts +2 -2
- package/dist/components/number-input.d.ts +2 -2
- package/dist/components/schema-field/schema-field-basics.cjs +32 -32
- package/dist/components/schema-field/schema-field-basics.d.cts +333 -333
- package/dist/components/schema-field/schema-field-basics.d.ts +333 -333
- package/dist/components/schema-field/schema-field-basics.js +32 -32
- package/dist/components/schema-field/schema-field-extended.d.cts +482 -468
- package/dist/components/schema-field/schema-field-extended.d.ts +482 -468
- package/dist/components/schema-field/schema-field.cjs +15 -9
- package/dist/components/schema-field/schema-field.d.cts +395 -381
- package/dist/components/schema-field/schema-field.d.ts +395 -381
- package/dist/components/schema-field/schema-field.js +15 -9
- package/dist/components/separator.d.ts +2 -2
- package/dist/components/slider/index.cjs +2 -0
- package/dist/components/slider/index.d.cts +2 -0
- package/dist/components/slider/index.d.ts +2 -0
- package/dist/components/slider/index.js +2 -0
- package/dist/components/slider/map-props.cjs +26 -0
- package/dist/components/slider/map-props.js +24 -0
- package/dist/components/slider/slider-input.cjs +12 -0
- package/dist/components/slider/slider-input.d.cts +7 -0
- package/dist/components/slider/slider-input.d.ts +7 -0
- package/dist/components/slider/slider-input.js +9 -0
- package/dist/components/slider/slider.cjs +16 -0
- package/dist/components/slider/slider.d.cts +11 -0
- package/dist/components/slider/slider.d.ts +11 -0
- package/dist/components/slider/slider.js +13 -0
- 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 +4 -1
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +4 -2
- package/package.json +6 -6
- package/dist/components/slider.cjs +0 -40
- package/dist/components/slider.d.cts +0 -12
- package/dist/components/slider.d.ts +0 -12
- package/dist/components/slider.js +0 -36
|
@@ -4,7 +4,9 @@ import { extractComponents } from "../../utils/extract-components.js";
|
|
|
4
4
|
import { useFormSchema } from "../../hooks/use-form-schema.js";
|
|
5
5
|
import { ColorPicker as ColorPicker$1 } from "../color-picker/color-picker.js";
|
|
6
6
|
import "../color-picker/index.js";
|
|
7
|
-
import { Slider as Slider$1 } from "../slider.js";
|
|
7
|
+
import { Slider as Slider$1 } from "../slider/slider.js";
|
|
8
|
+
import { SliderInput as SliderInput$1 } from "../slider/slider-input.js";
|
|
9
|
+
import "../slider/index.js";
|
|
8
10
|
import { TagsInputInLine } from "../tags-input-inline.js";
|
|
9
11
|
import { basicComponentRegistry } from "./schema-field-basics.js";
|
|
10
12
|
import { createSchemaField } from "@formily/react";
|
|
@@ -14,24 +16,28 @@ import { jsx } from "react/jsx-runtime";
|
|
|
14
16
|
//#region src/components/schema-field/schema-field.tsx
|
|
15
17
|
const defaultComponentRegistry = {
|
|
16
18
|
...basicComponentRegistry,
|
|
19
|
+
ColorPicker: {
|
|
20
|
+
component: ColorPicker$1,
|
|
21
|
+
decorator: "FormItem"
|
|
22
|
+
},
|
|
17
23
|
Combobox: {
|
|
18
24
|
component: Combobox$1,
|
|
19
25
|
decorator: "FormItem"
|
|
20
26
|
},
|
|
21
|
-
|
|
22
|
-
component:
|
|
27
|
+
Slider: {
|
|
28
|
+
component: Slider$1,
|
|
23
29
|
decorator: "FormItem"
|
|
24
30
|
},
|
|
25
|
-
|
|
26
|
-
component:
|
|
31
|
+
SliderInput: {
|
|
32
|
+
component: SliderInput$1,
|
|
27
33
|
decorator: "FormItem"
|
|
28
34
|
},
|
|
29
|
-
|
|
30
|
-
component:
|
|
35
|
+
TagsInput: {
|
|
36
|
+
component: TagsInput,
|
|
31
37
|
decorator: "FormItem"
|
|
32
38
|
},
|
|
33
|
-
|
|
34
|
-
component:
|
|
39
|
+
TagsInputInLine: {
|
|
40
|
+
component: TagsInputInLine,
|
|
35
41
|
decorator: "FormItem"
|
|
36
42
|
}
|
|
37
43
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
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:
|
|
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 };
|
|
@@ -0,0 +1,26 @@
|
|
|
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/components/slider/map-props.ts
|
|
6
|
+
const sliderMapProps = (0, __formily_react.mapProps)({
|
|
7
|
+
value: true,
|
|
8
|
+
onInput: "onValueChange"
|
|
9
|
+
}, (props, field) => {
|
|
10
|
+
const fieldValue = field.value;
|
|
11
|
+
let value;
|
|
12
|
+
if (Array.isArray(fieldValue)) value = fieldValue;
|
|
13
|
+
else if (typeof fieldValue === "number") value = [fieldValue];
|
|
14
|
+
else value = [0];
|
|
15
|
+
return {
|
|
16
|
+
...props,
|
|
17
|
+
value,
|
|
18
|
+
onValueChange: (newValue) => {
|
|
19
|
+
if (Array.isArray(field.value)) field.onInput(newValue).catch(() => {});
|
|
20
|
+
else field.onInput(newValue[0]).catch(() => {});
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
exports.sliderMapProps = sliderMapProps;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { mapProps } from "@formily/react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/slider/map-props.ts
|
|
4
|
+
const sliderMapProps = mapProps({
|
|
5
|
+
value: true,
|
|
6
|
+
onInput: "onValueChange"
|
|
7
|
+
}, (props, field) => {
|
|
8
|
+
const fieldValue = field.value;
|
|
9
|
+
let value;
|
|
10
|
+
if (Array.isArray(fieldValue)) value = fieldValue;
|
|
11
|
+
else if (typeof fieldValue === "number") value = [fieldValue];
|
|
12
|
+
else value = [0];
|
|
13
|
+
return {
|
|
14
|
+
...props,
|
|
15
|
+
value,
|
|
16
|
+
onValueChange: (newValue) => {
|
|
17
|
+
if (Array.isArray(field.value)) field.onInput(newValue).catch(() => {});
|
|
18
|
+
else field.onInput(newValue[0]).catch(() => {});
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { sliderMapProps };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_map_props = require('./map-props.cjs');
|
|
3
|
+
let __formily_react = require("@formily/react");
|
|
4
|
+
__formily_react = require_rolldown_runtime.__toESM(__formily_react);
|
|
5
|
+
let __pixpilot_shadcn_ui = require("@pixpilot/shadcn-ui");
|
|
6
|
+
__pixpilot_shadcn_ui = require_rolldown_runtime.__toESM(__pixpilot_shadcn_ui);
|
|
7
|
+
|
|
8
|
+
//#region src/components/slider/slider-input.tsx
|
|
9
|
+
const SliderInput = (0, __formily_react.connect)(__pixpilot_shadcn_ui.SliderInput, require_map_props.sliderMapProps);
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
exports.SliderInput = SliderInput;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as react1447 from "react";
|
|
2
|
+
import * as _pixpilot_shadcn_ui357 from "@pixpilot/shadcn-ui";
|
|
3
|
+
|
|
4
|
+
//#region src/components/slider/slider-input.d.ts
|
|
5
|
+
declare const SliderInput: react1447.ForwardRefExoticComponent<Omit<Partial<_pixpilot_shadcn_ui357.SliderInputProps>, "ref"> & react1447.RefAttributes<unknown>>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { SliderInput };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as react1447 from "react";
|
|
2
|
+
import * as _pixpilot_shadcn_ui357 from "@pixpilot/shadcn-ui";
|
|
3
|
+
|
|
4
|
+
//#region src/components/slider/slider-input.d.ts
|
|
5
|
+
declare const SliderInput$1: react1447.ForwardRefExoticComponent<Omit<Partial<_pixpilot_shadcn_ui357.SliderInputProps>, "ref"> & react1447.RefAttributes<unknown>>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { SliderInput$1 as SliderInput };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { sliderMapProps } from "./map-props.js";
|
|
2
|
+
import { connect } from "@formily/react";
|
|
3
|
+
import { SliderInput } from "@pixpilot/shadcn-ui";
|
|
4
|
+
|
|
5
|
+
//#region src/components/slider/slider-input.tsx
|
|
6
|
+
const SliderInput$1 = connect(SliderInput, sliderMapProps);
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { SliderInput$1 as SliderInput };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_map_props = require('./map-props.cjs');
|
|
3
|
+
let __formily_react = require("@formily/react");
|
|
4
|
+
__formily_react = require_rolldown_runtime.__toESM(__formily_react);
|
|
5
|
+
let __pixpilot_shadcn_ui = require("@pixpilot/shadcn-ui");
|
|
6
|
+
__pixpilot_shadcn_ui = require_rolldown_runtime.__toESM(__pixpilot_shadcn_ui);
|
|
7
|
+
|
|
8
|
+
//#region src/components/slider/slider.tsx
|
|
9
|
+
/**
|
|
10
|
+
* Formily-connected Slider component
|
|
11
|
+
* Range input for selecting numeric values
|
|
12
|
+
*/
|
|
13
|
+
const Slider = (0, __formily_react.connect)(__pixpilot_shadcn_ui.Slider, require_map_props.sliderMapProps);
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
exports.Slider = Slider;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as react1449 from "react";
|
|
2
|
+
import * as _pixpilot_shadcn_ui358 from "@pixpilot/shadcn-ui";
|
|
3
|
+
|
|
4
|
+
//#region src/components/slider/slider.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Formily-connected Slider component
|
|
7
|
+
* Range input for selecting numeric values
|
|
8
|
+
*/
|
|
9
|
+
declare const Slider: react1449.ForwardRefExoticComponent<Omit<Partial<_pixpilot_shadcn_ui358.SliderProps>, "ref"> & react1449.RefAttributes<unknown>>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { Slider };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as react1449 from "react";
|
|
2
|
+
import * as _pixpilot_shadcn_ui358 from "@pixpilot/shadcn-ui";
|
|
3
|
+
|
|
4
|
+
//#region src/components/slider/slider.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Formily-connected Slider component
|
|
7
|
+
* Range input for selecting numeric values
|
|
8
|
+
*/
|
|
9
|
+
declare const Slider$1: react1449.ForwardRefExoticComponent<Omit<Partial<_pixpilot_shadcn_ui358.SliderProps>, "ref"> & react1449.RefAttributes<unknown>>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { Slider$1 as Slider };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { sliderMapProps } from "./map-props.js";
|
|
2
|
+
import { connect } from "@formily/react";
|
|
3
|
+
import { Slider } from "@pixpilot/shadcn-ui";
|
|
4
|
+
|
|
5
|
+
//#region src/components/slider/slider.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Formily-connected Slider component
|
|
8
|
+
* Range input for selecting numeric values
|
|
9
|
+
*/
|
|
10
|
+
const Slider$1 = connect(Slider, sliderMapProps);
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Slider$1 as Slider };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react21 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: react21.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_switch0.SwitchProps & react21.RefAttributes<HTMLButtonElement>>, "ref"> & react21.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Switch };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react17 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: react17.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_switch0.SwitchProps & react17.RefAttributes<HTMLButtonElement>>, "ref"> & react17.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Switch };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react24 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: react24.ForwardRefExoticComponent<Partial<_pixpilot_shadcn_ui0.TagsInputProps> & react24.RefAttributes<unknown>>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { TagsInputInLine };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react20 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: react20.ForwardRefExoticComponent<Partial<_pixpilot_shadcn_ui0.TagsInputProps> & react20.RefAttributes<unknown>>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { TagsInputInLine };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react17 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: react17.ForwardRefExoticComponent<Omit<Partial<react17.ClassAttributes<HTMLTextAreaElement> & react17.TextareaHTMLAttributes<HTMLTextAreaElement>>, "ref"> & react17.RefAttributes<unknown>>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { Textarea };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react22 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: react22.ForwardRefExoticComponent<Omit<Partial<react22.ClassAttributes<HTMLTextAreaElement> & react22.TextareaHTMLAttributes<HTMLTextAreaElement>>, "ref"> & react22.RefAttributes<unknown>>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { Textarea };
|
package/dist/index.cjs
CHANGED
|
@@ -21,7 +21,9 @@ const require_connected_form_item = require('./components/form-item/connected-fo
|
|
|
21
21
|
require('./components/form-item/index.cjs');
|
|
22
22
|
const require_icon_picker = require('./components/icon-picker.cjs');
|
|
23
23
|
const require_input = require('./components/input.cjs');
|
|
24
|
-
const require_slider = require('./components/slider.cjs');
|
|
24
|
+
const require_slider = require('./components/slider/slider.cjs');
|
|
25
|
+
const require_slider_input = require('./components/slider/slider-input.cjs');
|
|
26
|
+
require('./components/slider/index.cjs');
|
|
25
27
|
const require_tags_input_inline = require('./components/tags-input-inline.cjs');
|
|
26
28
|
const require_number_input = require('./components/number-input.cjs');
|
|
27
29
|
const require_radio = require('./components/radio.cjs');
|
|
@@ -102,6 +104,7 @@ exports.SchemaFieldExtended = require_schema_field_extended.SchemaFieldExtended;
|
|
|
102
104
|
exports.Select = require_select.Select;
|
|
103
105
|
exports.Separator = require_separator.Separator;
|
|
104
106
|
exports.Slider = require_slider.Slider;
|
|
107
|
+
exports.SliderInput = require_slider_input.SliderInput;
|
|
105
108
|
exports.Switch = require_switch.Switch;
|
|
106
109
|
exports.TagsInputInLine = require_tags_input_inline.TagsInputInLine;
|
|
107
110
|
exports.Textarea = require_textarea.Textarea;
|
package/dist/index.d.cts
CHANGED
|
@@ -37,7 +37,9 @@ import { JsonSchemaFieldExtended, SchemaFieldExtended, extendedComponentRegistry
|
|
|
37
37
|
import "./components/schema-field/index.cjs";
|
|
38
38
|
import { Select } from "./components/select.cjs";
|
|
39
39
|
import { Separator } from "./components/separator.cjs";
|
|
40
|
-
import { Slider } from "./components/slider.cjs";
|
|
40
|
+
import { Slider } from "./components/slider/slider.cjs";
|
|
41
|
+
import { SliderInput } from "./components/slider/slider-input.cjs";
|
|
42
|
+
import "./components/slider/index.cjs";
|
|
41
43
|
import { Switch } from "./components/switch.cjs";
|
|
42
44
|
import { TagsInputInLine } from "./components/tags-input-inline.cjs";
|
|
43
45
|
import { Textarea } from "./components/textarea.cjs";
|
|
@@ -45,4 +47,4 @@ import { transformSchema } from "./utils/transform-schema.cjs";
|
|
|
45
47
|
import "./utils/index.cjs";
|
|
46
48
|
import { Field, FormConsumer, FormProvider, ISchema, ObjectField, VoidField } from "@formily/react";
|
|
47
49
|
import { Form as IForm, createForm } from "@formily/core";
|
|
48
|
-
export { ArrayBase, type ArrayBaseMixins, ArrayCards, ArrayCollapse, AvatarUpload, Checkbox, Column, Combobox, ConnectedRadio, DatePicker, Field, FileUpload, FileUploadInline, Form, FormConsumer, FormGrid, FormItem, type FormLayoutOptions, FormProvider, type IArrayBaseOperationProps, type IArrayBaseProps, type IForm, type ISchema, IconPicker, Input, JsonSchemaField, JsonSchemaFieldBasics, JsonSchemaFieldExtended, JsonSchemaForm, JsonSchemaFormBasic, JsonSchemaFormComponent, JsonSchemaFormComponents, JsonSchemaFormExtended, JsonSchemaFormProps, JsonSchemaFormRenderer, JsonSchemaFormRendererProps, NumberInput, ObjectField, Radio, RichTextEditor, Row, SchemaField, SchemaFieldBasics, SchemaFieldExtended, Select, Separator, Slider, Switch, TagsInputInLine, Textarea, VoidField, basicComponentRegistry, basicComponents, createForm, defaultComponentRegistry, defaultComponents, extendedComponentRegistry, extendedComponents, transformSchema };
|
|
50
|
+
export { ArrayBase, type ArrayBaseMixins, ArrayCards, ArrayCollapse, AvatarUpload, Checkbox, Column, Combobox, ConnectedRadio, DatePicker, Field, FileUpload, FileUploadInline, Form, FormConsumer, FormGrid, FormItem, type FormLayoutOptions, FormProvider, type IArrayBaseOperationProps, type IArrayBaseProps, type IForm, type ISchema, IconPicker, Input, JsonSchemaField, JsonSchemaFieldBasics, JsonSchemaFieldExtended, JsonSchemaForm, JsonSchemaFormBasic, JsonSchemaFormComponent, JsonSchemaFormComponents, JsonSchemaFormExtended, JsonSchemaFormProps, JsonSchemaFormRenderer, JsonSchemaFormRendererProps, NumberInput, ObjectField, Radio, RichTextEditor, Row, SchemaField, SchemaFieldBasics, SchemaFieldExtended, Select, Separator, Slider, SliderInput, Switch, TagsInputInLine, Textarea, VoidField, basicComponentRegistry, basicComponents, createForm, defaultComponentRegistry, defaultComponents, extendedComponentRegistry, extendedComponents, transformSchema };
|
package/dist/index.d.ts
CHANGED
|
@@ -37,7 +37,9 @@ import { JsonSchemaFieldExtended, SchemaFieldExtended, extendedComponentRegistry
|
|
|
37
37
|
import "./components/schema-field/index.js";
|
|
38
38
|
import { Select } from "./components/select.js";
|
|
39
39
|
import { Separator } from "./components/separator.js";
|
|
40
|
-
import { Slider } from "./components/slider.js";
|
|
40
|
+
import { Slider } from "./components/slider/slider.js";
|
|
41
|
+
import { SliderInput } from "./components/slider/slider-input.js";
|
|
42
|
+
import "./components/slider/index.js";
|
|
41
43
|
import { Switch } from "./components/switch.js";
|
|
42
44
|
import { TagsInputInLine } from "./components/tags-input-inline.js";
|
|
43
45
|
import { Textarea } from "./components/textarea.js";
|
|
@@ -45,4 +47,4 @@ import { transformSchema } from "./utils/transform-schema.js";
|
|
|
45
47
|
import "./utils/index.js";
|
|
46
48
|
import { Field, FormConsumer, FormProvider, ISchema, ObjectField, VoidField } from "@formily/react";
|
|
47
49
|
import { Form as IForm, createForm } from "@formily/core";
|
|
48
|
-
export { ArrayBase, type ArrayBaseMixins, ArrayCards, ArrayCollapse, AvatarUpload, Checkbox, Column, Combobox, ConnectedRadio, DatePicker, Field, FileUpload, FileUploadInline, Form, FormConsumer, FormGrid, FormItem, type FormLayoutOptions, FormProvider, type IArrayBaseOperationProps, type IArrayBaseProps, type IForm, type ISchema, IconPicker, Input, JsonSchemaField, JsonSchemaFieldBasics, JsonSchemaFieldExtended, JsonSchemaForm, JsonSchemaFormBasic, JsonSchemaFormComponent, JsonSchemaFormComponents, JsonSchemaFormExtended, JsonSchemaFormProps, JsonSchemaFormRenderer, JsonSchemaFormRendererProps, NumberInput, ObjectField, Radio, RichTextEditor, Row, SchemaField, SchemaFieldBasics, SchemaFieldExtended, Select, Separator, Slider, Switch, TagsInputInLine, Textarea, VoidField, basicComponentRegistry, basicComponents, createForm, defaultComponentRegistry, defaultComponents, extendedComponentRegistry, extendedComponents, transformSchema };
|
|
50
|
+
export { ArrayBase, type ArrayBaseMixins, ArrayCards, ArrayCollapse, AvatarUpload, Checkbox, Column, Combobox, ConnectedRadio, DatePicker, Field, FileUpload, FileUploadInline, Form, FormConsumer, FormGrid, FormItem, type FormLayoutOptions, FormProvider, type IArrayBaseOperationProps, type IArrayBaseProps, type IForm, type ISchema, IconPicker, Input, JsonSchemaField, JsonSchemaFieldBasics, JsonSchemaFieldExtended, JsonSchemaForm, JsonSchemaFormBasic, JsonSchemaFormComponent, JsonSchemaFormComponents, JsonSchemaFormExtended, JsonSchemaFormProps, JsonSchemaFormRenderer, JsonSchemaFormRendererProps, NumberInput, ObjectField, Radio, RichTextEditor, Row, SchemaField, SchemaFieldBasics, SchemaFieldExtended, Select, Separator, Slider, SliderInput, Switch, TagsInputInLine, Textarea, VoidField, basicComponentRegistry, basicComponents, createForm, defaultComponentRegistry, defaultComponents, extendedComponentRegistry, extendedComponents, transformSchema };
|
package/dist/index.js
CHANGED
|
@@ -20,7 +20,9 @@ import { FormItem } from "./components/form-item/connected-form-item.js";
|
|
|
20
20
|
import "./components/form-item/index.js";
|
|
21
21
|
import { IconPicker } from "./components/icon-picker.js";
|
|
22
22
|
import { Input } from "./components/input.js";
|
|
23
|
-
import { Slider } from "./components/slider.js";
|
|
23
|
+
import { Slider } from "./components/slider/slider.js";
|
|
24
|
+
import { SliderInput } from "./components/slider/slider-input.js";
|
|
25
|
+
import "./components/slider/index.js";
|
|
24
26
|
import { TagsInputInLine } from "./components/tags-input-inline.js";
|
|
25
27
|
import { NumberInput } from "./components/number-input.js";
|
|
26
28
|
import { ConnectedRadio, Radio } from "./components/radio.js";
|
|
@@ -42,4 +44,4 @@ import "./components/json-schema-form-renderer/index.js";
|
|
|
42
44
|
import { Field, FormConsumer, FormProvider, ObjectField, VoidField } from "@formily/react";
|
|
43
45
|
import { createForm } from "@formily/core";
|
|
44
46
|
|
|
45
|
-
export { ArrayBase, ArrayCards, ArrayCollapse, AvatarUpload, Checkbox, Column, Combobox, ConnectedRadio, DatePicker, Field, FileUpload, FileUploadInline, Form, FormConsumer, FormGrid, FormItem, FormProvider, IconPicker, Input, JsonSchemaField, JsonSchemaFieldBasics, JsonSchemaFieldExtended, JsonSchemaForm, JsonSchemaFormBasic, JsonSchemaFormExtended, JsonSchemaFormRenderer, NumberInput, ObjectField, Radio, RichTextEditor, Row, SchemaField, SchemaFieldBasics, SchemaFieldExtended, Select, Separator, Slider, Switch, TagsInputInLine, Textarea, VoidField, basicComponentRegistry, basicComponents, createForm, defaultComponentRegistry, defaultComponents, extendedComponentRegistry, extendedComponents, transformSchema };
|
|
47
|
+
export { ArrayBase, ArrayCards, ArrayCollapse, AvatarUpload, Checkbox, Column, Combobox, ConnectedRadio, DatePicker, Field, FileUpload, FileUploadInline, Form, FormConsumer, FormGrid, FormItem, FormProvider, IconPicker, Input, JsonSchemaField, JsonSchemaFieldBasics, JsonSchemaFieldExtended, JsonSchemaForm, JsonSchemaFormBasic, JsonSchemaFormExtended, JsonSchemaFormRenderer, NumberInput, ObjectField, Radio, RichTextEditor, Row, SchemaField, SchemaFieldBasics, SchemaFieldExtended, Select, Separator, Slider, SliderInput, Switch, TagsInputInLine, Textarea, VoidField, basicComponentRegistry, basicComponents, createForm, defaultComponentRegistry, defaultComponents, extendedComponentRegistry, extendedComponents, transformSchema };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixpilot/formily-shadcn",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.16.
|
|
4
|
+
"version": "0.16.4",
|
|
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.6.
|
|
44
|
-
"@pixpilot/shadcn-ui": "0.
|
|
43
|
+
"@pixpilot/shadcn": "0.6.1",
|
|
44
|
+
"@pixpilot/shadcn-ui": "0.16.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@storybook/react": "^8.6.14",
|
|
@@ -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/prettier-config": "0.0.1",
|
|
59
57
|
"@internal/tsconfig": "0.1.0",
|
|
58
|
+
"@internal/prettier-config": "0.0.1",
|
|
60
59
|
"@internal/tsdown-config": "0.1.0",
|
|
61
|
-
"@internal/vitest-config": "0.1.0"
|
|
60
|
+
"@internal/vitest-config": "0.1.0",
|
|
61
|
+
"@internal/eslint-config": "0.3.0"
|
|
62
62
|
},
|
|
63
63
|
"prettier": "@internal/prettier-config",
|
|
64
64
|
"scripts": {
|
|
@@ -1,40 +0,0 @@
|
|
|
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)({
|
|
21
|
-
value: true,
|
|
22
|
-
onInput: true
|
|
23
|
-
}, (props, field) => {
|
|
24
|
-
const fieldValue = field.value;
|
|
25
|
-
let value;
|
|
26
|
-
if (Array.isArray(fieldValue)) value = fieldValue;
|
|
27
|
-
else if (typeof fieldValue === "number") value = [fieldValue];
|
|
28
|
-
else value = [0];
|
|
29
|
-
return {
|
|
30
|
-
...props,
|
|
31
|
-
value,
|
|
32
|
-
onValueChange: (newValue) => {
|
|
33
|
-
if (Array.isArray(field.value)) field.onInput(newValue).catch(() => {});
|
|
34
|
-
else field.onInput(newValue[0]).catch(() => {});
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
}));
|
|
38
|
-
|
|
39
|
-
//#endregion
|
|
40
|
-
exports.Slider = Slider;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as react20 from "react";
|
|
2
|
-
import { SliderProps } from "@pixpilot/shadcn-ui";
|
|
3
|
-
|
|
4
|
-
//#region src/components/slider.d.ts
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Formily-connected Slider component
|
|
8
|
-
* Range input for selecting numeric values
|
|
9
|
-
*/
|
|
10
|
-
declare const Slider: react20.ForwardRefExoticComponent<Omit<Partial<SliderProps>, "ref"> & react20.RefAttributes<unknown>>;
|
|
11
|
-
//#endregion
|
|
12
|
-
export { Slider };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as react14 from "react";
|
|
2
|
-
import { SliderProps } from "@pixpilot/shadcn-ui";
|
|
3
|
-
|
|
4
|
-
//#region src/components/slider.d.ts
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Formily-connected Slider component
|
|
8
|
-
* Range input for selecting numeric values
|
|
9
|
-
*/
|
|
10
|
-
declare const Slider$1: react14.ForwardRefExoticComponent<Omit<Partial<SliderProps>, "ref"> & react14.RefAttributes<unknown>>;
|
|
11
|
-
//#endregion
|
|
12
|
-
export { Slider$1 as Slider };
|
|
@@ -1,36 +0,0 @@
|
|
|
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({
|
|
17
|
-
value: true,
|
|
18
|
-
onInput: true
|
|
19
|
-
}, (props, field) => {
|
|
20
|
-
const fieldValue = field.value;
|
|
21
|
-
let value;
|
|
22
|
-
if (Array.isArray(fieldValue)) value = fieldValue;
|
|
23
|
-
else if (typeof fieldValue === "number") value = [fieldValue];
|
|
24
|
-
else value = [0];
|
|
25
|
-
return {
|
|
26
|
-
...props,
|
|
27
|
-
value,
|
|
28
|
-
onValueChange: (newValue) => {
|
|
29
|
-
if (Array.isArray(field.value)) field.onInput(newValue).catch(() => {});
|
|
30
|
-
else field.onInput(newValue[0]).catch(() => {});
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
}));
|
|
34
|
-
|
|
35
|
-
//#endregion
|
|
36
|
-
export { Slider$1 as Slider };
|