@pixpilot/formily-shadcn 0.2.0 → 0.4.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.d.cts +2 -2
- package/dist/components/checkbox.d.ts +2 -2
- package/dist/components/column.d.ts +2 -2
- package/dist/components/date-picker.d.cts +3 -3
- package/dist/components/date-picker.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.cjs +3 -3
- package/dist/components/form-item.d.cts +4 -3
- package/dist/components/form-item.d.ts +4 -3
- package/dist/components/form-item.js +3 -3
- package/dist/components/form.d.cts +2 -2
- package/dist/components/hidden.cjs +1 -0
- package/dist/components/hidden.js +1 -0
- package/dist/components/input.d.ts +2 -2
- package/dist/components/number-input.d.ts +2 -2
- package/dist/components/object-container.cjs +1 -0
- package/dist/components/object-container.d.cts +9 -0
- package/dist/components/object-container.d.ts +9 -0
- package/dist/components/object-container.js +1 -0
- package/dist/components/radio.d.cts +2 -2
- package/dist/components/row.d.cts +2 -2
- package/dist/components/row.d.ts +2 -2
- package/dist/components/schema-field.cjs +1 -1
- package/dist/components/schema-field.d.cts +64 -18
- package/dist/components/schema-field.d.ts +227 -181
- package/dist/components/schema-field.js +1 -1
- package/dist/components/separator.d.cts +2 -2
- package/dist/components/slider.d.cts +2 -2
- package/dist/components/slider.d.ts +2 -2
- package/dist/components/switch.d.cts +2 -2
- package/dist/components/switch.d.ts +3 -3
- package/dist/components/tags-input-inline.d.cts +2 -2
- package/dist/components/tags-input-inline.d.ts +3 -3
- package/dist/components/textarea.d.cts +2 -2
- package/dist/components/textarea.d.ts +2 -2
- package/dist/hooks/index.cjs +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/use-description.cjs +1 -0
- package/dist/hooks/use-description.js +1 -0
- package/dist/hooks/use-label.cjs +1 -0
- package/dist/hooks/use-label.js +1 -0
- package/dist/types/react.d.cts +4 -0
- package/dist/types/react.d.ts +4 -0
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/transform-schema.cjs +1 -1
- package/dist/utils/transform-schema.js +1 -1
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ArrayCards as e}from"./array-cards/array-cards.js";import"./array-cards/index.js";import{ArrayCollapse as t}from"./array-collapse/array-collapse.js";import"./array-collapse/index.js";import{Checkbox as n}from"./checkbox.js";import{Column as r}from"./column.js";import{Combobox as i}from"./combobox.js";import{DatePicker as a}from"./date-picker.js";import{FileUploadInline as o}from"./file-upload-inline.js";import{FormGrid as s}from"./form-grid.js";import{FormItem as c}from"./form-item.js";import{Input as l}from"./input.js";import{ArrayDialog as u}from"./array-dialog/array-dialog.js";import"./array-dialog/index.js";import{ArrayPopover as d}from"./array-popover/array-popover.js";import"./array-popover/index.js";import{
|
|
1
|
+
import{ArrayCards as e}from"./array-cards/array-cards.js";import"./array-cards/index.js";import{ArrayCollapse as t}from"./array-collapse/array-collapse.js";import"./array-collapse/index.js";import{Checkbox as n}from"./checkbox.js";import{Column as r}from"./column.js";import{Combobox as i}from"./combobox.js";import{DatePicker as a}from"./date-picker.js";import{FileUploadInline as o}from"./file-upload-inline.js";import{FormGrid as s}from"./form-grid.js";import{FormItem as c}from"./form-item.js";import{Input as l}from"./input.js";import{ArrayDialog as u}from"./array-dialog/array-dialog.js";import"./array-dialog/index.js";import{ArrayPopover as d}from"./array-popover/array-popover.js";import"./array-popover/index.js";import{Hidden as f}from"./hidden.js";import{NumberInput as p}from"./number-input.js";import{ObjectContainer as m}from"./object-container.js";import{ConnectedRadio as h}from"./radio.js";import{Row as g}from"./row.js";import{Select as _}from"./select.js";import{Separator as v}from"./separator.js";import{Slider as y}from"./slider.js";import{Switch as b}from"./switch.js";import{Textarea as x}from"./textarea.js";import{createSchemaField as S}from"@formily/react";import{TagsInput as C}from"@pixpilot/shadcn-ui";const w=S({components:{FormItem:c,FormGrid:s,Row:g,Column:r,Input:l,Textarea:x,Checkbox:n,Radio:h,Select:_,NumberInput:p,DatePicker:a,Combobox:i,TagsInput:C,FileUploadInline:o,Separator:v,Slider:y,Switch:b,ArrayCards:e,ArrayDialog:u,ArrayCollapse:t,ArrayPopover:d,ObjectContainer:m,Hidden:f}});var T=w;export{w as SchemaField,T as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react363 from "react";
|
|
2
2
|
import * as _radix_ui_react_separator8 from "@radix-ui/react-separator";
|
|
3
3
|
|
|
4
4
|
//#region src/components/separator.d.ts
|
|
@@ -6,6 +6,6 @@ import * as _radix_ui_react_separator8 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: react363.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_separator8.SeparatorProps & react363.RefAttributes<HTMLDivElement>>, "ref"> & react363.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Separator };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react366 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:
|
|
10
|
+
declare const Slider: react366.ForwardRefExoticComponent<Omit<Partial<SliderProps>, "ref"> & react366.RefAttributes<unknown>>;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { Slider };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react369 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$1:
|
|
10
|
+
declare const Slider$1: react369.ForwardRefExoticComponent<Omit<Partial<SliderProps>, "ref"> & react369.RefAttributes<unknown>>;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { Slider$1 as Slider };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react368 from "react";
|
|
2
2
|
import * as _radix_ui_react_switch8 from "@radix-ui/react-switch";
|
|
3
3
|
|
|
4
4
|
//#region src/components/switch.d.ts
|
|
@@ -6,6 +6,6 @@ import * as _radix_ui_react_switch8 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: react368.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_switch8.SwitchProps & react368.RefAttributes<HTMLButtonElement>>, "ref"> & react368.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Switch };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as react366 from "react";
|
|
2
|
+
import * as _radix_ui_react_switch8 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: react366.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_switch8.SwitchProps & react366.RefAttributes<HTMLButtonElement>>, "ref"> & react366.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Switch };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react371 from "react";
|
|
2
2
|
import * as _pixpilot_shadcn_ui17 from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/tags-input-inline.d.ts
|
|
@@ -10,6 +10,6 @@ import * as _pixpilot_shadcn_ui17 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: react371.ForwardRefExoticComponent<Partial<_pixpilot_shadcn_ui17.TagsInputProps> & react371.RefAttributes<unknown>>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { TagsInputInLine };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as react371 from "react";
|
|
2
|
+
import * as _pixpilot_shadcn_ui17 from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/tags-input-inline.d.ts
|
|
5
5
|
|
|
@@ -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: react371.ForwardRefExoticComponent<Partial<_pixpilot_shadcn_ui17.TagsInputProps> & react371.RefAttributes<unknown>>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { TagsInputInLine };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react373 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: react373.ForwardRefExoticComponent<Omit<Partial<react373.ClassAttributes<HTMLTextAreaElement> & react373.TextareaHTMLAttributes<HTMLTextAreaElement>>, "ref"> & react373.RefAttributes<unknown>>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { Textarea };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react373 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: react373.ForwardRefExoticComponent<Omit<Partial<react373.ClassAttributes<HTMLTextAreaElement> & react373.TextareaHTMLAttributes<HTMLTextAreaElement>>, "ref"> & react373.RefAttributes<unknown>>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { Textarea };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./use-description.cjs`),t=require(`./use-label.cjs`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useDescription as e}from"./use-description.js";import{useLabel as t}from"./use-label.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../_virtual/rolldown_runtime.cjs`);let t=require(`@formily/react`);t=e.__toESM(t);function n(e){let n=(0,t.useFieldSchema)().description;return e??n??null}exports.useDescription=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useFieldSchema as e}from"@formily/react";function t(t){let n=e().description;return t??n??null}export{t as useDescription};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../_virtual/rolldown_runtime.cjs`);let t=require(`@formily/react`);t=e.__toESM(t);let n=require(`@pixpilot/string`);n=e.__toESM(n);function r(e){let r=(0,t.useFieldSchema)(),i=r.name,a=r.title;return e??(a==null?i==null?null:typeof i==`string`?(0,n.toCapitalCase)(i):i:typeof a==`string`?(0,n.toCapitalCase)(a):a)}exports.useLabel=r;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useFieldSchema as e}from"@formily/react";import{toCapitalCase as t}from"@pixpilot/string";function n(n){let r=e(),i=r.name,a=r.title;return n??(a==null?i==null?null:typeof i==`string`?t(i):i:typeof a==`string`?t(a):a)}export{n as useLabel};
|
package/dist/utils/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./
|
|
1
|
+
const e=require(`./has-error.cjs`),t=require(`./validate-array-item-fields.cjs`),n=require(`./create-panel-state-manager.cjs`),r=require(`./for-each-schema.cjs`),i=require(`./get-array-item-info.cjs`),a=require(`./get-default-value.cjs`),o=require(`./has-array-item-errors.cjs`),s=require(`./transform-schema.cjs`);require(`./use-array-item-editor.cjs`);
|
package/dist/utils/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{fieldsHasError as e,filedHasError as t}from"./has-error.js";import{validateArrayItemFields as n}from"./validate-array-item-fields.js";import{createPanelStateManager as r}from"./create-panel-state-manager.js";import{forEachSchema as i}from"./for-each-schema.js";import{getArrayItemInfo as a}from"./get-array-item-info.js";import{getDefaultValue as o,getSchemaDefaultValue as s}from"./get-default-value.js";import{hasArrayItemErrors as c}from"./has-array-item-errors.js";import{transformSchema as l}from"./transform-schema.js";import"./use-array-item-editor.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../_virtual/rolldown_runtime.cjs`);let t=require(`json-schema-traverse`);t=e.__toESM(t);const n={string:{"x-component":`Input`,"x-decorator":`FormItem`},number:{"x-component":`NumberInput`,"x-decorator":`FormItem`},integer:{"x-component":`NumberInput`,"x-decorator":`FormItem`},boolean:{"x-component":`Checkbox`,"x-decorator":`FormItem`},array:{"x-component":`ArrayCards`,"x-decorator":`FormItem`}};function r(e){return(0,t.default)(e,{allKeys:!0,cb:e=>{let{type:t}=e;if(typeof t==`string`&&t in n){let r=n[t];e[`x-component`]
|
|
1
|
+
const e=require(`../_virtual/rolldown_runtime.cjs`);let t=require(`json-schema-traverse`);t=e.__toESM(t);const n={string:{"x-component":`Input`,"x-decorator":`FormItem`},number:{"x-component":`NumberInput`,"x-decorator":`FormItem`},integer:{"x-component":`NumberInput`,"x-decorator":`FormItem`},boolean:{"x-component":`Checkbox`,"x-decorator":`FormItem`},array:{"x-component":`ArrayCards`,"x-decorator":`FormItem`},object:{"x-component":`ObjectContainer`}};function r(e){return(0,t.default)(e,{allKeys:!0,cb:e=>{let{type:t}=e;if(typeof t==`string`&&t in n){let r=n[t];e[`x-component`]??=r[`x-component`],[`Hidden`].includes(e[`x-component`])||(e[`x-decorator`]=r[`x-decorator`])}}}),e}exports.transformSchema=r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"json-schema-traverse";const t={string:{"x-component":`Input`,"x-decorator":`FormItem`},number:{"x-component":`NumberInput`,"x-decorator":`FormItem`},integer:{"x-component":`NumberInput`,"x-decorator":`FormItem`},boolean:{"x-component":`Checkbox`,"x-decorator":`FormItem`},array:{"x-component":`ArrayCards`,"x-decorator":`FormItem`}};function n(n){return e(n,{allKeys:!0,cb:e=>{let{type:n}=e;if(typeof n==`string`&&n in t){let r=t[n];e[`x-component`]
|
|
1
|
+
import e from"json-schema-traverse";const t={string:{"x-component":`Input`,"x-decorator":`FormItem`},number:{"x-component":`NumberInput`,"x-decorator":`FormItem`},integer:{"x-component":`NumberInput`,"x-decorator":`FormItem`},boolean:{"x-component":`Checkbox`,"x-decorator":`FormItem`},array:{"x-component":`ArrayCards`,"x-decorator":`FormItem`},object:{"x-component":`ObjectContainer`}};function n(n){return e(n,{allKeys:!0,cb:e=>{let{type:n}=e;if(typeof n==`string`&&n in t){let r=t[n];e[`x-component`]??=r[`x-component`],[`Hidden`].includes(e[`x-component`])||(e[`x-decorator`]=r[`x-decorator`])}}}),n}export{n as transformSchema};
|
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.4.0",
|
|
5
5
|
"description": "Formily integration for shadcn/ui components",
|
|
6
6
|
"author": "m.doaie <m.doaie@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@storybook/react": "^10.0.8",
|
|
44
|
+
"@testing-library/react": "^16.3.0",
|
|
44
45
|
"@types/node": "^22.18.11",
|
|
45
46
|
"@types/react": "^19.2.6",
|
|
46
47
|
"@types/react-dom": "^19.2.3",
|
|
@@ -50,9 +51,9 @@
|
|
|
50
51
|
"tsdown": "^0.15.8",
|
|
51
52
|
"typescript": "^5.9.3",
|
|
52
53
|
"@internal/eslint-config": "0.3.0",
|
|
53
|
-
"@internal/prettier-config": "0.0.1",
|
|
54
54
|
"@internal/tsconfig": "0.1.0",
|
|
55
55
|
"@internal/tsdown-config": "0.1.0",
|
|
56
|
+
"@internal/prettier-config": "0.0.1",
|
|
56
57
|
"@internal/vitest-config": "0.1.0"
|
|
57
58
|
},
|
|
58
59
|
"prettier": "@internal/prettier-config",
|