@pixpilot/formily-shadcn 0.17.0 → 0.18.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/components/date-picker.d.cts +3 -3
- package/dist/components/form-item/connected-form-item.d.cts +4 -4
- package/dist/components/icon-picker.d.cts +3 -3
- package/dist/components/icon-picker.d.ts +3 -3
- package/dist/components/input.d.cts +2 -2
- package/dist/components/input.d.ts +2 -2
- package/dist/components/number/index.cjs +1 -0
- package/dist/components/number/index.d.cts +1 -0
- package/dist/components/number/index.d.ts +1 -0
- package/dist/components/number/index.js +1 -0
- package/dist/components/number/number-input-map-props.cjs +37 -0
- package/dist/components/number/number-input-map-props.js +35 -0
- package/dist/components/{number-input.cjs → number/number-input.cjs} +4 -11
- package/dist/components/number/number-input.d.cts +9 -0
- package/dist/components/number/number-input.d.ts +9 -0
- package/dist/components/number/number-input.js +12 -0
- package/dist/components/object-container.cjs +5 -6
- package/dist/components/object-container.js +5 -6
- package/dist/components/radio.d.cts +2 -2
- package/dist/components/row.d.cts +2 -2
- package/dist/components/schema-field/schema-field-basics.cjs +2 -1
- package/dist/components/schema-field/schema-field-basics.d.cts +211 -211
- package/dist/components/schema-field/schema-field-basics.js +2 -1
- package/dist/components/schema-field/schema-field.d.cts +266 -266
- package/dist/components/separator.d.cts +2 -2
- package/dist/components/separator.d.ts +2 -2
- package/dist/components/slider/slider-input.d.cts +3 -3
- package/dist/components/slider/slider-input.d.ts +3 -3
- package/dist/components/slider/slider.d.ts +3 -3
- 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 +2 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/package.json +2 -2
- package/dist/components/number-input.d.cts +0 -9
- package/dist/components/number-input.d.ts +0 -9
- package/dist/components/number-input.js +0 -19
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react20 from "react";
|
|
2
2
|
import { DatePickerProps } from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/date-picker.d.ts
|
|
5
|
-
declare const DatePicker:
|
|
5
|
+
declare const DatePicker: react20.ForwardRefExoticComponent<Partial<{
|
|
6
6
|
value?: Date;
|
|
7
7
|
onChange?: (date: Date | undefined) => void;
|
|
8
8
|
placeholder?: string;
|
|
9
|
-
} & Omit<DatePickerProps, "onSelect" | "selected" | "mode">> &
|
|
9
|
+
} & Omit<DatePickerProps, "onSelect" | "selected" | "mode">> & react20.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { DatePicker };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { FormItemProps } from "./form-item-types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react1453 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/form-item/connected-form-item.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* FormItem component connected to Formily field state.
|
|
7
7
|
* Automatically maps field validation state to component props.
|
|
8
8
|
*/
|
|
9
|
-
declare const FormItem:
|
|
10
|
-
children?:
|
|
11
|
-
}>, "ref"> &
|
|
9
|
+
declare const FormItem: react1453.ForwardRefExoticComponent<Omit<Partial<FormItemProps & {
|
|
10
|
+
children?: react1453.ReactNode | undefined;
|
|
11
|
+
}>, "ref"> & react1453.RefAttributes<unknown>>;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { FormItem };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react2 from "react";
|
|
2
2
|
import { IconPickerProps, IconProviderProps } from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/icon-picker.d.ts
|
|
@@ -8,8 +8,8 @@ import { IconPickerProps, IconProviderProps } from "@pixpilot/shadcn-ui";
|
|
|
8
8
|
* Automatically connects to Formily field state
|
|
9
9
|
* Supports both static and async icon providers
|
|
10
10
|
*/
|
|
11
|
-
declare const IconPicker:
|
|
11
|
+
declare const IconPicker: react2.ForwardRefExoticComponent<Partial<Omit<IconPickerProps, "providers"> & {
|
|
12
12
|
providers?: IconProviderProps[];
|
|
13
|
-
}> &
|
|
13
|
+
}> & react2.RefAttributes<unknown>>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { IconPicker };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react8 from "react";
|
|
2
2
|
import { IconPickerProps, IconProviderProps } from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/icon-picker.d.ts
|
|
@@ -8,8 +8,8 @@ import { IconPickerProps, IconProviderProps } from "@pixpilot/shadcn-ui";
|
|
|
8
8
|
* Automatically connects to Formily field state
|
|
9
9
|
* Supports both static and async icon providers
|
|
10
10
|
*/
|
|
11
|
-
declare const IconPicker$1:
|
|
11
|
+
declare const IconPicker$1: react8.ForwardRefExoticComponent<Partial<Omit<IconPickerProps, "providers"> & {
|
|
12
12
|
providers?: IconProviderProps[];
|
|
13
|
-
}> &
|
|
13
|
+
}> & react8.RefAttributes<unknown>>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { IconPicker$1 as IconPicker };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react4 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/components/input.d.ts
|
|
4
4
|
|
|
@@ -6,6 +6,6 @@ import * as react6 from "react";
|
|
|
6
6
|
* Formily-connected Input component
|
|
7
7
|
* Automatically connects shadcn Input to Formily field state
|
|
8
8
|
*/
|
|
9
|
-
declare const Input:
|
|
9
|
+
declare const Input: react4.ForwardRefExoticComponent<Omit<Partial<react4.ClassAttributes<HTMLInputElement> & react4.InputHTMLAttributes<HTMLInputElement>>, "ref"> & react4.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Input };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react4 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/components/input.d.ts
|
|
4
4
|
|
|
@@ -6,6 +6,6 @@ import * as react6 from "react";
|
|
|
6
6
|
* Formily-connected Input component
|
|
7
7
|
* Automatically connects shadcn Input to Formily field state
|
|
8
8
|
*/
|
|
9
|
-
declare const Input:
|
|
9
|
+
declare const Input: react4.ForwardRefExoticComponent<Omit<Partial<react4.ClassAttributes<HTMLInputElement> & react4.InputHTMLAttributes<HTMLInputElement>>, "ref"> & react4.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Input };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const require_number_input = require('./number-input.cjs');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { NumberInput } from "./number-input.cjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { NumberInput } from "./number-input.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { NumberInput } from "./number-input.js";
|
|
@@ -0,0 +1,37 @@
|
|
|
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/number/number-input-map-props.ts
|
|
6
|
+
/**
|
|
7
|
+
* Mapper function for NumberInput props
|
|
8
|
+
*/
|
|
9
|
+
function mapNumberInputProps(props, inputField) {
|
|
10
|
+
const field = inputField;
|
|
11
|
+
const schema = (0, __formily_react.useFieldSchema)();
|
|
12
|
+
const min = schema?.minimum;
|
|
13
|
+
const max = schema?.maximum;
|
|
14
|
+
const fieldValue = field.value;
|
|
15
|
+
const value = typeof fieldValue === "number" || typeof fieldValue === "string" ? fieldValue : "";
|
|
16
|
+
return {
|
|
17
|
+
min,
|
|
18
|
+
max,
|
|
19
|
+
...props,
|
|
20
|
+
type: "number",
|
|
21
|
+
value,
|
|
22
|
+
onChange: (event) => {
|
|
23
|
+
const raw = event.target.value.trim();
|
|
24
|
+
if (raw === "") {
|
|
25
|
+
field.onInput(void 0).catch(() => {});
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const normalized = raw.includes(".") ? raw : raw.replace(",", ".");
|
|
29
|
+
const nextValue = Number(normalized);
|
|
30
|
+
if (!Number.isNaN(nextValue)) field.onInput(nextValue).catch(() => {});
|
|
31
|
+
else field.onInput(raw).catch(() => {});
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
exports.mapNumberInputProps = mapNumberInputProps;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useFieldSchema } from "@formily/react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/number/number-input-map-props.ts
|
|
4
|
+
/**
|
|
5
|
+
* Mapper function for NumberInput props
|
|
6
|
+
*/
|
|
7
|
+
function mapNumberInputProps(props, inputField) {
|
|
8
|
+
const field = inputField;
|
|
9
|
+
const schema = useFieldSchema();
|
|
10
|
+
const min = schema?.minimum;
|
|
11
|
+
const max = schema?.maximum;
|
|
12
|
+
const fieldValue = field.value;
|
|
13
|
+
const value = typeof fieldValue === "number" || typeof fieldValue === "string" ? fieldValue : "";
|
|
14
|
+
return {
|
|
15
|
+
min,
|
|
16
|
+
max,
|
|
17
|
+
...props,
|
|
18
|
+
type: "number",
|
|
19
|
+
value,
|
|
20
|
+
onChange: (event) => {
|
|
21
|
+
const raw = event.target.value.trim();
|
|
22
|
+
if (raw === "") {
|
|
23
|
+
field.onInput(void 0).catch(() => {});
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const normalized = raw.includes(".") ? raw : raw.replace(",", ".");
|
|
27
|
+
const nextValue = Number(normalized);
|
|
28
|
+
if (!Number.isNaN(nextValue)) field.onInput(nextValue).catch(() => {});
|
|
29
|
+
else field.onInput(raw).catch(() => {});
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
export { mapNumberInputProps };
|
|
@@ -1,22 +1,15 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_number_input_map_props = require('./number-input-map-props.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");
|
|
5
6
|
__pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
|
|
6
7
|
|
|
7
|
-
//#region src/components/number-input.tsx
|
|
8
|
+
//#region src/components/number/number-input.tsx
|
|
8
9
|
/**
|
|
9
10
|
* Formily-connected Number Input component
|
|
10
11
|
*/
|
|
11
|
-
const NumberInput = (0, __formily_react.connect)(__pixpilot_shadcn.Input, (0, __formily_react.mapProps)(
|
|
12
|
-
const schema = (0, __formily_react.useFieldSchema)();
|
|
13
|
-
return {
|
|
14
|
-
min: schema?.minimum,
|
|
15
|
-
max: schema?.maximum,
|
|
16
|
-
...props,
|
|
17
|
-
type: "number"
|
|
18
|
-
};
|
|
19
|
-
}));
|
|
12
|
+
const NumberInput = (0, __formily_react.connect)(__pixpilot_shadcn.Input, (0, __formily_react.mapProps)(require_number_input_map_props.mapNumberInputProps));
|
|
20
13
|
|
|
21
14
|
//#endregion
|
|
22
15
|
exports.NumberInput = NumberInput;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as react22 from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/number/number-input.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Formily-connected Number Input component
|
|
6
|
+
*/
|
|
7
|
+
declare const NumberInput: react22.ForwardRefExoticComponent<Omit<Partial<react22.ClassAttributes<HTMLInputElement> & react22.InputHTMLAttributes<HTMLInputElement>>, "ref"> & react22.RefAttributes<unknown>>;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { NumberInput };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as react24 from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/number/number-input.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Formily-connected Number Input component
|
|
6
|
+
*/
|
|
7
|
+
declare const NumberInput: react24.ForwardRefExoticComponent<Omit<Partial<react24.ClassAttributes<HTMLInputElement> & react24.InputHTMLAttributes<HTMLInputElement>>, "ref"> & react24.RefAttributes<unknown>>;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { NumberInput };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { mapNumberInputProps } from "./number-input-map-props.js";
|
|
2
|
+
import { connect, mapProps } from "@formily/react";
|
|
3
|
+
import { Input } from "@pixpilot/shadcn";
|
|
4
|
+
|
|
5
|
+
//#region src/components/number/number-input.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Formily-connected Number Input component
|
|
8
|
+
*/
|
|
9
|
+
const NumberInput = connect(Input, mapProps(mapNumberInputProps));
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { NumberInput };
|
|
@@ -46,20 +46,19 @@ const ObjectContainer = ({ className, children, label, description,...rest }) =>
|
|
|
46
46
|
const { classes } = objectContainer || {};
|
|
47
47
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.Card, {
|
|
48
48
|
...rest,
|
|
49
|
-
|
|
50
|
-
className: (0, __pixpilot_shadcn.cn)("form-object-container", "bg-transparent", gapClass, cardPaddingClass, className, classes?.card),
|
|
49
|
+
className: (0, __pixpilot_shadcn.cn)("form-object-card", "bg-transparent", gapClass, cardPaddingClass, className, classes?.card),
|
|
51
50
|
children: [(effectiveLabel != null || desc != null) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.CardHeader, {
|
|
52
|
-
className: (0, __pixpilot_shadcn.cn)(headerGapClass, classes?.header),
|
|
51
|
+
className: (0, __pixpilot_shadcn.cn)("form-object-header", headerGapClass, classes?.header),
|
|
53
52
|
children: [effectiveLabel != null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.CardTitle, {
|
|
54
|
-
className: classes?.title,
|
|
53
|
+
className: (0, __pixpilot_shadcn.cn)("form-object-title", classes?.title),
|
|
55
54
|
children: effectiveLabel
|
|
56
55
|
}), desc != null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.CardDescription, {
|
|
57
|
-
className: classes?.description,
|
|
56
|
+
className: (0, __pixpilot_shadcn.cn)("form-object-desc", classes?.description),
|
|
58
57
|
children: desc
|
|
59
58
|
})]
|
|
60
59
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_form_items_container.FormItemContainer, {
|
|
61
60
|
as: __pixpilot_shadcn.CardContent,
|
|
62
|
-
className: classes?.content,
|
|
61
|
+
className: (0, __pixpilot_shadcn.cn)("form-object-container", classes?.content),
|
|
63
62
|
children
|
|
64
63
|
})]
|
|
65
64
|
});
|
|
@@ -43,20 +43,19 @@ const ObjectContainer = ({ className, children, label, description,...rest }) =>
|
|
|
43
43
|
const { classes } = objectContainer || {};
|
|
44
44
|
return /* @__PURE__ */ jsxs(Card, {
|
|
45
45
|
...rest,
|
|
46
|
-
|
|
47
|
-
className: cn("form-object-container", "bg-transparent", gapClass, cardPaddingClass, className, classes?.card),
|
|
46
|
+
className: cn("form-object-card", "bg-transparent", gapClass, cardPaddingClass, className, classes?.card),
|
|
48
47
|
children: [(effectiveLabel != null || desc != null) && /* @__PURE__ */ jsxs(CardHeader, {
|
|
49
|
-
className: cn(headerGapClass, classes?.header),
|
|
48
|
+
className: cn("form-object-header", headerGapClass, classes?.header),
|
|
50
49
|
children: [effectiveLabel != null && /* @__PURE__ */ jsx(CardTitle, {
|
|
51
|
-
className: classes?.title,
|
|
50
|
+
className: cn("form-object-title", classes?.title),
|
|
52
51
|
children: effectiveLabel
|
|
53
52
|
}), desc != null && /* @__PURE__ */ jsx(CardDescription, {
|
|
54
|
-
className: classes?.description,
|
|
53
|
+
className: cn("form-object-desc", classes?.description),
|
|
55
54
|
children: desc
|
|
56
55
|
})]
|
|
57
56
|
}), /* @__PURE__ */ jsx(FormItemContainer, {
|
|
58
57
|
as: CardContent,
|
|
59
|
-
className: classes?.content,
|
|
58
|
+
className: cn("form-object-container", classes?.content),
|
|
60
59
|
children
|
|
61
60
|
})]
|
|
62
61
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
3
3
|
import { RadioGroup } from "@pixpilot/shadcn";
|
|
4
4
|
|
|
5
5
|
//#region src/components/radio.d.ts
|
|
@@ -15,7 +15,7 @@ type RadioProps = {
|
|
|
15
15
|
/**
|
|
16
16
|
* Radio component with options rendering
|
|
17
17
|
*/
|
|
18
|
-
declare function Radio(props: RadioProps):
|
|
18
|
+
declare function Radio(props: RadioProps): react_jsx_runtime3.JSX.Element;
|
|
19
19
|
declare namespace Radio {
|
|
20
20
|
var displayName: string;
|
|
21
21
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/row.d.ts
|
|
5
5
|
interface IRowProps {
|
|
@@ -36,6 +36,6 @@ interface IRowProps {
|
|
|
36
36
|
declare function Row({
|
|
37
37
|
className,
|
|
38
38
|
children
|
|
39
|
-
}: IRowProps):
|
|
39
|
+
}: IRowProps): react_jsx_runtime2.JSX.Element;
|
|
40
40
|
//#endregion
|
|
41
41
|
export { Row };
|
|
@@ -18,7 +18,8 @@ require('../array-dialog/index.cjs');
|
|
|
18
18
|
const require_array_popover = require('../array-popover/array-popover.cjs');
|
|
19
19
|
require('../array-popover/index.cjs');
|
|
20
20
|
const require_hidden = require('../hidden.cjs');
|
|
21
|
-
const require_number_input = require('../number-input.cjs');
|
|
21
|
+
const require_number_input = require('../number/number-input.cjs');
|
|
22
|
+
require('../number/index.cjs');
|
|
22
23
|
const require_object_container = require('../object-container.cjs');
|
|
23
24
|
const require_radio = require('../radio.cjs');
|
|
24
25
|
const require_row = require('../row.cjs');
|