@pixpilot/formily-shadcn 0.1.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/LICENSE +21 -0
- package/README.md +204 -0
- package/dist/_virtual/rolldown_runtime.cjs +1 -0
- package/dist/_virtual/rolldown_runtime.js +1 -0
- package/dist/components/array-base/array-base.cjs +1 -0
- package/dist/components/array-base/array-base.d.cts +13 -0
- package/dist/components/array-base/array-base.d.ts +13 -0
- package/dist/components/array-base/array-base.js +1 -0
- package/dist/components/array-base/array-context.cjs +1 -0
- package/dist/components/array-base/array-context.d.cts +17 -0
- package/dist/components/array-base/array-context.d.ts +17 -0
- package/dist/components/array-base/array-context.js +1 -0
- package/dist/components/array-base/component-context.cjs +1 -0
- package/dist/components/array-base/component-context.d.cts +3 -0
- package/dist/components/array-base/component-context.d.ts +3 -0
- package/dist/components/array-base/component-context.js +1 -0
- package/dist/components/array-base/components/addition.cjs +1 -0
- package/dist/components/array-base/components/addition.d.cts +13 -0
- package/dist/components/array-base/components/addition.d.ts +13 -0
- package/dist/components/array-base/components/addition.js +1 -0
- package/dist/components/array-base/components/array-copy.cjs +1 -0
- package/dist/components/array-base/components/array-copy.js +1 -0
- package/dist/components/array-base/components/array-index.cjs +1 -0
- package/dist/components/array-base/components/array-index.js +1 -0
- package/dist/components/array-base/components/array-item-label.cjs +1 -0
- package/dist/components/array-base/components/array-item-label.js +1 -0
- package/dist/components/array-base/components/components.cjs +1 -0
- package/dist/components/array-base/components/components.js +1 -0
- package/dist/components/array-base/components/edit.cjs +1 -0
- package/dist/components/array-base/components/edit.js +1 -0
- package/dist/components/array-base/components/empty.cjs +1 -0
- package/dist/components/array-base/components/empty.js +1 -0
- package/dist/components/array-base/components/get-array-components.cjs +1 -0
- package/dist/components/array-base/components/get-array-components.js +1 -0
- package/dist/components/array-base/components/move-down.cjs +1 -0
- package/dist/components/array-base/components/move-down.js +1 -0
- package/dist/components/array-base/components/move-up.cjs +1 -0
- package/dist/components/array-base/components/move-up.js +1 -0
- package/dist/components/array-base/components/remove.cjs +1 -0
- package/dist/components/array-base/components/remove.js +1 -0
- package/dist/components/array-base/components/title.cjs +1 -0
- package/dist/components/array-base/components/title.js +1 -0
- package/dist/components/array-base/components/types.d.cts +30 -0
- package/dist/components/array-base/components/types.d.ts +30 -0
- package/dist/components/array-base/components/use-array-components-registry.cjs +1 -0
- package/dist/components/array-base/components/use-array-components-registry.d.cts +4 -0
- package/dist/components/array-base/components/use-array-components-registry.d.ts +4 -0
- package/dist/components/array-base/components/use-array-components-registry.js +1 -0
- package/dist/components/array-base/constants/index.cjs +1 -0
- package/dist/components/array-base/constants/index.js +1 -0
- package/dist/components/array-base/index.cjs +1 -0
- package/dist/components/array-base/index.d.cts +3 -0
- package/dist/components/array-base/index.d.ts +3 -0
- package/dist/components/array-base/index.js +1 -0
- package/dist/components/array-base/types.d.cts +37 -0
- package/dist/components/array-base/types.d.ts +37 -0
- package/dist/components/array-base/utils/filter-and-sort-components.cjs +1 -0
- package/dist/components/array-base/utils/filter-and-sort-components.js +1 -0
- package/dist/components/array-base/utils/is-array-component.cjs +1 -0
- package/dist/components/array-base/utils/is-array-component.js +1 -0
- package/dist/components/array-cards/array-cards.cjs +1 -0
- package/dist/components/array-cards/array-cards.d.cts +7 -0
- package/dist/components/array-cards/array-cards.d.ts +7 -0
- package/dist/components/array-cards/array-cards.js +1 -0
- package/dist/components/array-cards/index.cjs +1 -0
- package/dist/components/array-cards/index.d.cts +1 -0
- package/dist/components/array-cards/index.d.ts +1 -0
- package/dist/components/array-cards/index.js +1 -0
- package/dist/components/array-cards/item.cjs +1 -0
- package/dist/components/array-cards/item.js +1 -0
- package/dist/components/array-collapse/array-collapse.cjs +1 -0
- package/dist/components/array-collapse/array-collapse.d.cts +12 -0
- package/dist/components/array-collapse/array-collapse.d.ts +12 -0
- package/dist/components/array-collapse/array-collapse.js +1 -0
- package/dist/components/array-collapse/index.cjs +1 -0
- package/dist/components/array-collapse/index.d.cts +1 -0
- package/dist/components/array-collapse/index.d.ts +1 -0
- package/dist/components/array-collapse/index.js +1 -0
- package/dist/components/array-collapse/item.cjs +1 -0
- package/dist/components/array-collapse/item.js +1 -0
- package/dist/components/array-common/array-items-list.cjs +1 -0
- package/dist/components/array-common/array-items-list.js +1 -0
- package/dist/components/array-common/create-active-item-manager.cjs +1 -0
- package/dist/components/array-common/create-active-item-manager.js +1 -0
- package/dist/components/array-common/index.cjs +1 -0
- package/dist/components/array-common/index.js +1 -0
- package/dist/components/array-common/item-wrapper.cjs +1 -0
- package/dist/components/array-common/item-wrapper.js +1 -0
- package/dist/components/array-common/list-item.cjs +1 -0
- package/dist/components/array-common/list-item.js +1 -0
- package/dist/components/array-common/use-array-editor.cjs +1 -0
- package/dist/components/array-common/use-array-editor.js +1 -0
- package/dist/components/array-dialog/array-dialog.cjs +1 -0
- package/dist/components/array-dialog/array-dialog.js +1 -0
- package/dist/components/array-dialog/edit-dialog.cjs +1 -0
- package/dist/components/array-dialog/edit-dialog.js +1 -0
- package/dist/components/array-dialog/index.cjs +1 -0
- package/dist/components/array-dialog/index.js +1 -0
- package/dist/components/array-popover/array-popover.cjs +1 -0
- package/dist/components/array-popover/array-popover.js +1 -0
- package/dist/components/array-popover/index.cjs +1 -0
- package/dist/components/array-popover/index.js +1 -0
- package/dist/components/array-popover/popover.cjs +1 -0
- package/dist/components/array-popover/popover.js +1 -0
- package/dist/components/checkbox.cjs +1 -0
- package/dist/components/checkbox.d.cts +11 -0
- package/dist/components/checkbox.d.ts +11 -0
- package/dist/components/checkbox.js +1 -0
- package/dist/components/column.cjs +1 -0
- package/dist/components/column.d.cts +41 -0
- package/dist/components/column.d.ts +41 -0
- package/dist/components/column.js +1 -0
- package/dist/components/combobox.cjs +1 -0
- package/dist/components/combobox.d.cts +6 -0
- package/dist/components/combobox.d.ts +6 -0
- package/dist/components/combobox.js +1 -0
- package/dist/components/date-picker.cjs +1 -0
- package/dist/components/date-picker.d.cts +17 -0
- package/dist/components/date-picker.d.ts +17 -0
- package/dist/components/date-picker.js +1 -0
- package/dist/components/file-upload-inline.cjs +3 -0
- package/dist/components/file-upload-inline.d.cts +12 -0
- package/dist/components/file-upload-inline.d.ts +12 -0
- package/dist/components/file-upload-inline.js +3 -0
- package/dist/components/form-grid.cjs +1 -0
- package/dist/components/form-grid.d.cts +12 -0
- package/dist/components/form-grid.d.ts +12 -0
- package/dist/components/form-grid.js +1 -0
- package/dist/components/form-item.cjs +3 -0
- package/dist/components/form-item.d.cts +21 -0
- package/dist/components/form-item.d.ts +21 -0
- package/dist/components/form-item.js +3 -0
- package/dist/components/form.cjs +1 -0
- package/dist/components/form.d.cts +26 -0
- package/dist/components/form.d.ts +26 -0
- package/dist/components/form.js +1 -0
- package/dist/components/input.cjs +1 -0
- package/dist/components/input.d.cts +11 -0
- package/dist/components/input.d.ts +11 -0
- package/dist/components/input.js +1 -0
- package/dist/components/number-input.cjs +1 -0
- package/dist/components/number-input.d.cts +9 -0
- package/dist/components/number-input.d.ts +9 -0
- package/dist/components/number-input.js +1 -0
- package/dist/components/radio.cjs +1 -0
- package/dist/components/radio.d.cts +24 -0
- package/dist/components/radio.d.ts +24 -0
- package/dist/components/radio.js +1 -0
- package/dist/components/row.cjs +1 -0
- package/dist/components/row.d.cts +41 -0
- package/dist/components/row.d.ts +41 -0
- package/dist/components/row.js +1 -0
- package/dist/components/schema-field.cjs +1 -0
- package/dist/components/schema-field.d.cts +396 -0
- package/dist/components/schema-field.d.ts +396 -0
- package/dist/components/schema-field.js +1 -0
- package/dist/components/select.cjs +1 -0
- package/dist/components/select.d.cts +6 -0
- package/dist/components/select.d.ts +6 -0
- package/dist/components/select.js +1 -0
- package/dist/components/separator.cjs +1 -0
- package/dist/components/separator.d.cts +11 -0
- package/dist/components/separator.d.ts +11 -0
- package/dist/components/separator.js +1 -0
- package/dist/components/slider.cjs +1 -0
- package/dist/components/slider.d.cts +12 -0
- package/dist/components/slider.d.ts +12 -0
- package/dist/components/slider.js +1 -0
- package/dist/components/switch.cjs +1 -0
- package/dist/components/switch.d.cts +11 -0
- package/dist/components/switch.d.ts +11 -0
- package/dist/components/switch.js +1 -0
- package/dist/components/tags-input-inline.cjs +1 -0
- package/dist/components/tags-input-inline.d.cts +15 -0
- package/dist/components/tags-input-inline.d.ts +15 -0
- package/dist/components/tags-input-inline.js +1 -0
- package/dist/components/textarea.cjs +1 -0
- package/dist/components/textarea.d.cts +9 -0
- package/dist/components/textarea.d.ts +9 -0
- package/dist/components/textarea.js +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +33 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +1 -0
- package/dist/utils/create-panel-state-manager.cjs +1 -0
- package/dist/utils/create-panel-state-manager.js +1 -0
- package/dist/utils/for-each-schema.cjs +1 -0
- package/dist/utils/for-each-schema.js +1 -0
- package/dist/utils/get-array-item-info.cjs +1 -0
- package/dist/utils/get-array-item-info.js +1 -0
- package/dist/utils/get-default-value.cjs +1 -0
- package/dist/utils/get-default-value.js +1 -0
- package/dist/utils/has-array-item-errors.cjs +1 -0
- package/dist/utils/has-array-item-errors.js +1 -0
- package/dist/utils/has-error.cjs +1 -0
- package/dist/utils/has-error.js +1 -0
- package/dist/utils/index.cjs +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/transform-schema.cjs +1 -0
- package/dist/utils/transform-schema.js +1 -0
- package/dist/utils/use-array-item-editor.cjs +1 -0
- package/dist/utils/use-array-item-editor.js +1 -0
- package/dist/utils/validate-array-item-fields.cjs +1 -0
- package/dist/utils/validate-array-item-fields.js +1 -0
- package/package.json +74 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/form-item.d.ts
|
|
4
|
+
type LabelPlacement = 'top' | 'bottom' | 'start' | 'end';
|
|
5
|
+
interface FormItemProps extends React.ComponentProps<'div'> {
|
|
6
|
+
label?: React.ReactNode;
|
|
7
|
+
description?: React.ReactNode;
|
|
8
|
+
asterisk?: boolean;
|
|
9
|
+
feedbackStatus?: 'error' | 'warning' | 'success';
|
|
10
|
+
feedbackText?: React.ReactNode;
|
|
11
|
+
labelPlacement?: LabelPlacement;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* FormItem component connected to Formily field state
|
|
15
|
+
* Automatically maps field validation state to component props
|
|
16
|
+
*/
|
|
17
|
+
declare const FormItem: React.ForwardRefExoticComponent<Omit<Partial<FormItemProps & {
|
|
18
|
+
children?: React.ReactNode | undefined;
|
|
19
|
+
}>, "ref"> & React.RefAttributes<unknown>>;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { FormItem, FormItemProps };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{connect as e,mapProps as t,useField as n}from"@formily/react";import r from"react";import{Fragment as i,jsx as a,jsxs as o}from"react/jsx-runtime";import{cn as s}from"@pixpilot/shadcn";import{isVoidField as c}from"@formily/core";const l=e(({className:e,children:t,label:c,description:l,asterisk:u,feedbackStatus:d,feedbackText:f,labelPlacement:p=`top`,...m})=>{let h=n(),g=(h?.componentProps??{}).labelPlacement??p,_=h?.componentProps?.id??`form-${h?.address?.toString()?.replace(/\./gu,`-`)}`,v=r.useId(),y=r.useId(),b=[l==null?void 0:v,f==null?void 0:y].filter(Boolean).join(` `),x=c!=null&&o(`label`,{htmlFor:_,"data-slot":`form-label`,"data-error":d===`error`,className:s(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`,d===`error`&&`text-destructive`,(g===`end`||g===`start`)&&`shrink-0`),children:[c,u&&a(`span`,{className:`text-destructive ml-1`,"aria-label":`required`,children:`*`})]}),S=a(`div`,{className:`relative`,children:r.isValidElement(t)?r.cloneElement(t,{id:_,"aria-describedby":b||void 0,"aria-invalid":d===`error`?`true`:void 0}):t}),C=o(i,{children:[g===`top`&&x,l!=null&&g===`top`&&a(`p`,{id:v,className:`text-muted-foreground text-[0.8rem]`,children:l}),(g===`start`||g===`end`)&&o(`div`,{className:s(`flex items-center gap-2`,g===`start`&&`flex-row`),children:[g===`start`&&x,S,g===`end`&&x]}),g===`top`&&S,l!=null&&(g===`start`||g===`end`)&&a(`p`,{id:v,className:`text-muted-foreground text-[0.8rem]`,children:l})]});return o(`div`,{"data-slot":`form-item`,className:s(`flex flex-col gap-2`,e),...m,children:[C,!!f&&a(`p`,{id:y,className:s(`text-[0.8rem]`,d===`error`&&`text-destructive font-medium`,d===`warning`&&`text-amber-600`,d===`success`&&`text-green-600`),children:typeof f==`string`?f.split(`
|
|
2
|
+
`).map((e,t)=>o(r.Fragment,{children:[e,t<f.split(`
|
|
3
|
+
`).length-1&&a(`br`,{})]},t)):f})]})},t((e,t)=>c(t)?{label:t.title??e.label,description:e.description??t.description,asterisk:e.asterisk,effectiveLabelPlacement:e.labelPlacement??t.componentProps?.effectiveLabelPlacement??`top`}:{label:e.label??t.title,description:e.description??t.description,feedbackStatus:(()=>{if(!t.validating){if(t.selfErrors?.length)return`error`;if(t.selfWarnings?.length)return`warning`;if(t.selfSuccesses?.length)return`success`}})(),feedbackText:(()=>{if(!t.validating){if(e.feedbackText!=null)return e.feedbackText;if(t.selfErrors?.length)return t.selfErrors.join(`, `);if(t.selfWarnings?.length)return t.selfWarnings.join(`, `);if(t.selfSuccesses?.length)return t.selfSuccesses.join(`, `)}})(),asterisk:(()=>t.required&&t.pattern!==`readPretty`?!0:`asterisk`in e?!!e.asterisk:!1)(),effectiveLabelPlacement:e.labelPlacement??t.componentProps?.effectiveLabelPlacement??`top`}));export{l as FormItem};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../_virtual/rolldown_runtime.cjs`);let t=require(`@formily/react`);t=e.__toESM(t);let n=require(`react`);n=e.__toESM(n);let r=require(`react/jsx-runtime`);r=e.__toESM(r);let i=require(`@pixpilot/shadcn`);i=e.__toESM(i);function a({form:e,className:n,style:a,children:o,onSubmit:s,onAutoSubmit:c}){return(0,r.jsx)(t.FormProvider,{form:e,children:(0,r.jsx)(`form`,{className:(0,i.cn)(`space-y-6`,n),style:a,onSubmit:t=>{t.preventDefault(),e.submit(e=>{s?.(e),c?.(e)}).catch(()=>{})},children:o})})}exports.Form=a;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Form } from "@formily/core";
|
|
3
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/form.d.ts
|
|
6
|
+
interface IFormProps {
|
|
7
|
+
form: Form;
|
|
8
|
+
className?: string;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
onSubmit?: (values: any) => void;
|
|
12
|
+
onAutoSubmit?: (values: any) => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Form component - wraps FormProvider and provides form context
|
|
16
|
+
*/
|
|
17
|
+
declare function Form$1({
|
|
18
|
+
form,
|
|
19
|
+
className,
|
|
20
|
+
style,
|
|
21
|
+
children,
|
|
22
|
+
onSubmit,
|
|
23
|
+
onAutoSubmit
|
|
24
|
+
}: IFormProps): react_jsx_runtime1.JSX.Element;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { Form$1 as Form };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import { Form } from "@formily/core";
|
|
4
|
+
|
|
5
|
+
//#region src/components/form.d.ts
|
|
6
|
+
interface IFormProps {
|
|
7
|
+
form: Form;
|
|
8
|
+
className?: string;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
onSubmit?: (values: any) => void;
|
|
12
|
+
onAutoSubmit?: (values: any) => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Form component - wraps FormProvider and provides form context
|
|
16
|
+
*/
|
|
17
|
+
declare function Form$1({
|
|
18
|
+
form,
|
|
19
|
+
className,
|
|
20
|
+
style,
|
|
21
|
+
children,
|
|
22
|
+
onSubmit,
|
|
23
|
+
onAutoSubmit
|
|
24
|
+
}: IFormProps): react_jsx_runtime0.JSX.Element;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { Form$1 as Form };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{FormProvider as e}from"@formily/react";import t from"react";import{jsx as n}from"react/jsx-runtime";import{cn as r}from"@pixpilot/shadcn";function i({form:t,className:i,style:a,children:o,onSubmit:s,onAutoSubmit:c}){return n(e,{form:t,children:n(`form`,{className:r(`space-y-6`,i),style:a,onSubmit:e=>{e.preventDefault(),t.submit(e=>{s?.(e),c?.(e)}).catch(()=>{})},children:o})})}export{i as Form};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../_virtual/rolldown_runtime.cjs`);let t=require(`@formily/react`);t=e.__toESM(t);let n=require(`@pixpilot/shadcn`);n=e.__toESM(n);const r=(0,t.connect)(n.Input,(0,t.mapProps)((e,t)=>({...e,value:t.value??``})));exports.Input=r;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as react8 from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/input.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Formily-connected Input component
|
|
7
|
+
* Automatically connects shadcn Input to Formily field state
|
|
8
|
+
*/
|
|
9
|
+
declare const Input: react8.ForwardRefExoticComponent<Omit<Partial<react8.ClassAttributes<HTMLInputElement> & react8.InputHTMLAttributes<HTMLInputElement>>, "ref"> & react8.RefAttributes<unknown>>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { Input };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as react332 from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/input.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Formily-connected Input component
|
|
7
|
+
* Automatically connects shadcn Input to Formily field state
|
|
8
|
+
*/
|
|
9
|
+
declare const Input: react332.ForwardRefExoticComponent<Omit<Partial<react332.ClassAttributes<HTMLInputElement> & react332.InputHTMLAttributes<HTMLInputElement>>, "ref"> & react332.RefAttributes<unknown>>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { Input };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{connect as e,mapProps as t}from"@formily/react";import{Input as n}from"@pixpilot/shadcn";const r=e(n,t((e,t)=>({...e,value:t.value??``})));export{r as Input};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../_virtual/rolldown_runtime.cjs`);let t=require(`@formily/react`);t=e.__toESM(t);let n=require(`@pixpilot/shadcn`);n=e.__toESM(n);const r=(0,t.connect)(n.Input,(0,t.mapProps)(e=>({...e,type:`number`})));exports.NumberInput=r;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as react4 from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/number-input.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Formily-connected Number Input component
|
|
6
|
+
*/
|
|
7
|
+
declare const NumberInput: react4.ForwardRefExoticComponent<Omit<Partial<react4.ClassAttributes<HTMLInputElement> & react4.InputHTMLAttributes<HTMLInputElement>>, "ref"> & react4.RefAttributes<unknown>>;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { NumberInput };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as react336 from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/number-input.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Formily-connected Number Input component
|
|
6
|
+
*/
|
|
7
|
+
declare const NumberInput: react336.ForwardRefExoticComponent<Omit<Partial<react336.ClassAttributes<HTMLInputElement> & react336.InputHTMLAttributes<HTMLInputElement>>, "ref"> & react336.RefAttributes<unknown>>;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { NumberInput };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{connect as e,mapProps as t}from"@formily/react";import{Input as n}from"@pixpilot/shadcn";const r=e(n,t(e=>({...e,type:`number`})));export{r as NumberInput};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../_virtual/rolldown_runtime.cjs`);let t=require(`@formily/react`);t=e.__toESM(t);let n=require(`react/jsx-runtime`);n=e.__toESM(n);let r=require(`@pixpilot/shadcn`);r=e.__toESM(r);const i=r.RadioGroup;function a(e){let{options:t,value:a=``,onChange:o,...s}=e;return(0,n.jsx)(i,{value:a,onValueChange:o,...s,children:t?.map(e=>(0,n.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,n.jsx)(r.RadioGroupItem,{value:e.value,id:`radio-${e.value}`}),(0,n.jsx)(r.Label,{htmlFor:`radio-${e.value}`,children:e.label})]},e.value))})}a.displayName=`Radio`;const o=(0,t.connect)(a);exports.ConnectedRadio=o,exports.Radio=a;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComponentProps, FC } from "react";
|
|
2
|
+
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
3
|
+
import { RadioGroup } from "@pixpilot/shadcn";
|
|
4
|
+
|
|
5
|
+
//#region src/components/radio.d.ts
|
|
6
|
+
interface RadioGroupOption {
|
|
7
|
+
value: string;
|
|
8
|
+
label: string;
|
|
9
|
+
}
|
|
10
|
+
type RadioProps = {
|
|
11
|
+
options?: RadioGroupOption[];
|
|
12
|
+
value?: string;
|
|
13
|
+
onChange?: (value: string) => void;
|
|
14
|
+
} & Omit<ComponentProps<typeof RadioGroup>, 'value' | 'onValueChange' | 'children'>;
|
|
15
|
+
/**
|
|
16
|
+
* Radio component with options rendering
|
|
17
|
+
*/
|
|
18
|
+
declare function Radio(props: RadioProps): react_jsx_runtime3.JSX.Element;
|
|
19
|
+
declare namespace Radio {
|
|
20
|
+
var displayName: string;
|
|
21
|
+
}
|
|
22
|
+
declare const ConnectedRadio: FC;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { ConnectedRadio, Radio };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComponentProps, FC } from "react";
|
|
2
|
+
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
3
|
+
import { RadioGroup } from "@pixpilot/shadcn";
|
|
4
|
+
|
|
5
|
+
//#region src/components/radio.d.ts
|
|
6
|
+
interface RadioGroupOption {
|
|
7
|
+
value: string;
|
|
8
|
+
label: string;
|
|
9
|
+
}
|
|
10
|
+
type RadioProps = {
|
|
11
|
+
options?: RadioGroupOption[];
|
|
12
|
+
value?: string;
|
|
13
|
+
onChange?: (value: string) => void;
|
|
14
|
+
} & Omit<ComponentProps<typeof RadioGroup>, 'value' | 'onValueChange' | 'children'>;
|
|
15
|
+
/**
|
|
16
|
+
* Radio component with options rendering
|
|
17
|
+
*/
|
|
18
|
+
declare function Radio(props: RadioProps): react_jsx_runtime3.JSX.Element;
|
|
19
|
+
declare namespace Radio {
|
|
20
|
+
var displayName: string;
|
|
21
|
+
}
|
|
22
|
+
declare const ConnectedRadio: FC;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { ConnectedRadio, Radio };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{connect as e}from"@formily/react";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{Label as r,RadioGroup as i,RadioGroupItem as a}from"@pixpilot/shadcn";const o=i;function s(e){let{options:i,value:s=``,onChange:c,...l}=e;return t(o,{value:s,onValueChange:c,...l,children:i?.map(e=>n(`div`,{className:`flex items-center space-x-2`,children:[t(a,{value:e.value,id:`radio-${e.value}`}),t(r,{htmlFor:`radio-${e.value}`,children:e.label})]},e.value))})}s.displayName=`Radio`;const c=e(s);export{c as ConnectedRadio,s as Radio};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../_virtual/rolldown_runtime.cjs`);let t=require(`react`);t=e.__toESM(t);let n=require(`react/jsx-runtime`);n=e.__toESM(n);let r=require(`@pixpilot/shadcn`);r=e.__toESM(r);function i({className:e,children:t}){return(0,n.jsx)(`div`,{className:(0,r.cn)(`flex gap-4`,e),children:t})}exports.Row=i;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/row.d.ts
|
|
5
|
+
interface IRowProps {
|
|
6
|
+
/**
|
|
7
|
+
* Custom className (use Tailwind gap-* for spacing, flex-wrap, items-*, justify-*, etc.)
|
|
8
|
+
*/
|
|
9
|
+
className?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Children (should be Column components)
|
|
12
|
+
*/
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Row component for creating multi-column layouts in forms
|
|
17
|
+
* Should be used with Column components as children
|
|
18
|
+
* Use Tailwind classes for all styling: gap-4, flex-wrap, items-center, justify-between, etc.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <Row className="gap-4 flex-wrap">
|
|
23
|
+
* <Column className="flex-1">
|
|
24
|
+
* <FormItem label="First Name">
|
|
25
|
+
* <Input />
|
|
26
|
+
* </FormItem>
|
|
27
|
+
* </Column>
|
|
28
|
+
* <Column className="flex-1">
|
|
29
|
+
* <FormItem label="Last Name">
|
|
30
|
+
* <Input />
|
|
31
|
+
* </FormItem>
|
|
32
|
+
* </Column>
|
|
33
|
+
* </Row>
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
declare function Row({
|
|
37
|
+
className,
|
|
38
|
+
children
|
|
39
|
+
}: IRowProps): react_jsx_runtime2.JSX.Element;
|
|
40
|
+
//#endregion
|
|
41
|
+
export { Row };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/row.d.ts
|
|
5
|
+
interface IRowProps {
|
|
6
|
+
/**
|
|
7
|
+
* Custom className (use Tailwind gap-* for spacing, flex-wrap, items-*, justify-*, etc.)
|
|
8
|
+
*/
|
|
9
|
+
className?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Children (should be Column components)
|
|
12
|
+
*/
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Row component for creating multi-column layouts in forms
|
|
17
|
+
* Should be used with Column components as children
|
|
18
|
+
* Use Tailwind classes for all styling: gap-4, flex-wrap, items-center, justify-between, etc.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <Row className="gap-4 flex-wrap">
|
|
23
|
+
* <Column className="flex-1">
|
|
24
|
+
* <FormItem label="First Name">
|
|
25
|
+
* <Input />
|
|
26
|
+
* </FormItem>
|
|
27
|
+
* </Column>
|
|
28
|
+
* <Column className="flex-1">
|
|
29
|
+
* <FormItem label="Last Name">
|
|
30
|
+
* <Input />
|
|
31
|
+
* </FormItem>
|
|
32
|
+
* </Column>
|
|
33
|
+
* </Row>
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
declare function Row({
|
|
37
|
+
className,
|
|
38
|
+
children
|
|
39
|
+
}: IRowProps): react_jsx_runtime1.JSX.Element;
|
|
40
|
+
//#endregion
|
|
41
|
+
export { Row };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"react";import{jsx as t}from"react/jsx-runtime";import{cn as n}from"@pixpilot/shadcn";function r({className:e,children:r}){return t(`div`,{className:n(`flex gap-4`,e),children:r})}export{r as Row};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../_virtual/rolldown_runtime.cjs`),t=require(`./array-cards/array-cards.cjs`);require(`./array-cards/index.cjs`);const n=require(`./array-collapse/array-collapse.cjs`);require(`./array-collapse/index.cjs`);const r=require(`./checkbox.cjs`),i=require(`./column.cjs`),a=require(`./combobox.cjs`),o=require(`./date-picker.cjs`),s=require(`./file-upload-inline.cjs`),c=require(`./form-grid.cjs`),l=require(`./form-item.cjs`),u=require(`./input.cjs`),d=require(`./number-input.cjs`),f=require(`./radio.cjs`),p=require(`./row.cjs`),m=require(`./array-dialog/array-dialog.cjs`);require(`./array-dialog/index.cjs`);const h=require(`./array-popover/array-popover.cjs`);require(`./array-popover/index.cjs`);const g=require(`./select.cjs`),_=require(`./separator.cjs`),v=require(`./slider.cjs`),y=require(`./switch.cjs`),b=require(`./textarea.cjs`);let x=require(`@formily/react`);x=e.__toESM(x);let S=require(`@pixpilot/shadcn-ui`);S=e.__toESM(S);const C=(0,x.createSchemaField)({components:{FormItem:l.FormItem,FormGrid:c.FormGrid,Row:p.Row,Column:i.Column,Input:u.Input,Textarea:b.Textarea,Checkbox:r.Checkbox,Radio:f.ConnectedRadio,Select:g.Select,NumberInput:d.NumberInput,DatePicker:o.DatePicker,Combobox:a.Combobox,TagsInput:S.TagsInput,FileUploadInline:s.FileUploadInline,Separator:_.Separator,Slider:v.Slider,Switch:y.Switch,ArrayCards:t.ArrayCards,ArrayDialog:m.ArrayDialog,ArrayCollapse:n.ArrayCollapse,ArrayPopover:h.ArrayPopover}});exports.SchemaField=C;
|