@oneplatformdev/ui 0.0.1-beta.7 → 0.0.1-beta.71
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/Accordion/Accordion.d.ts +2 -2
- package/Accordion/Accordion.mjs +23 -20
- package/AlertDialog/AlertDialogRoot.d.ts +2 -2
- package/AlertDialog/AlertDialogRoot.mjs +7 -7
- package/Button/buttonVariants.mjs +4 -4
- package/Calendar/Calendar.mjs +3 -2
- package/Checkbox/Checkbox.d.ts +5 -4
- package/Checkbox/Checkbox.mjs +48 -21
- package/Checkbox/Checkbox.types.d.ts +10 -0
- package/Checkbox/index.d.ts +2 -1
- package/Checkbox/index.mjs +3 -2
- package/Combobox/Combobox.d.ts +2 -2
- package/Combobox/Combobox.mjs +127 -87
- package/Combobox/Combobox.types.d.ts +13 -1
- package/Command/Command.d.ts +1 -1
- package/DataTable/DataTable.d.ts +10 -3
- package/DataTable/DataTable.mjs +33 -33
- package/DataTable/DataTableColumnFilter.d.ts +4 -0
- package/DataTable/DataTableColumnFilter.mjs +31 -0
- package/DatePicker/DatePicker.mjs +2 -2
- package/Dialog/Dialog.d.ts +2 -2
- package/Dialog/Dialog.mjs +14 -12
- package/Dropzone/Dropzone.d.ts +22 -0
- package/Dropzone/Dropzone.mjs +151 -0
- package/Dropzone/Dropzone.types.d.ts +38 -0
- package/Dropzone/DropzoneFilePreview.d.ts +4 -0
- package/Dropzone/DropzoneFilePreview.mjs +9 -0
- package/Dropzone/DropzoneSinglePickPreview.d.ts +9 -0
- package/Dropzone/DropzoneSinglePickPreview.mjs +38 -0
- package/Dropzone/DropzoneUtils.d.ts +5 -0
- package/Dropzone/DropzoneUtils.mjs +24 -0
- package/Dropzone/index.d.ts +2 -0
- package/Dropzone/index.mjs +7 -0
- package/Dropzone/package.json +7 -0
- package/DropzoneFilePreview-Dhtv8F4u.js +67 -0
- package/Form/Form.d.ts +2 -2
- package/Form/Form.mjs +48 -45
- package/Form/FormRenderControl.d.ts +2 -3
- package/Form/FormRenderControl.mjs +10 -10
- package/Form/FormRenderControl.types.d.ts +5 -7
- package/FormCheckbox/FormCheckbox.d.ts +2 -3
- package/FormCheckbox/FormCheckbox.mjs +23 -23
- package/FormCheckbox/FormCheckbox.types.d.ts +3 -3
- package/FormCombobox/FormCombobox.d.ts +2 -2
- package/FormCombobox/FormCombobox.types.d.ts +2 -3
- package/FormDatePicker/FormDatePicker.d.ts +2 -2
- package/FormDatePicker/FormDatePicker.mjs +20 -18
- package/FormDatePicker/FormDatePicker.types.d.ts +2 -3
- package/FormDropzone/FormDropzone.d.ts +4 -0
- package/FormDropzone/FormDropzone.mjs +19 -0
- package/FormDropzone/FormDropzone.types.d.ts +6 -0
- package/FormDropzone/index.d.ts +2 -0
- package/FormDropzone/index.mjs +4 -0
- package/FormDropzone/package.json +7 -0
- package/FormInput/FormInput.d.ts +2 -3
- package/FormInput/FormInput.mjs +25 -17
- package/FormInput/FormInput.types.d.ts +2 -3
- package/FormRadio/FormRadio.d.ts +4 -0
- package/FormRadio/FormRadio.mjs +40 -0
- package/FormRadio/FormRadio.types.d.ts +6 -0
- package/FormRadio/index.d.ts +2 -0
- package/FormRadio/index.mjs +4 -0
- package/FormRadio/package.json +7 -0
- package/FormSelect/FormSelect.d.ts +2 -3
- package/FormSelect/FormSelect.mjs +19 -17
- package/FormSelect/FormSelect.types.d.ts +2 -3
- package/FormTextarea/FormTextarea.d.ts +2 -3
- package/FormTextarea/FormTextarea.mjs +13 -12
- package/FormTextarea/FormTextarea.types.d.ts +2 -3
- package/Input/Input.mjs +40 -34
- package/Input/Input.types.d.ts +4 -1
- package/Input/inputVariants.mjs +9 -3
- package/Label/Label.d.ts +2 -2
- package/Label/labelVariants.mjs +7 -4
- package/LazyLoader/LazyLoader.mjs +5 -4
- package/LoadingMask/LoadingMask.d.ts +4 -1
- package/LoadingMask/LoadingMask.mjs +18 -56
- package/LoadingMask/LoadingMask.types.d.ts +5 -0
- package/LoadingMask/RenderLoadingMask.d.ts +3 -0
- package/LoadingMask/RenderLoadingMask.mjs +108 -0
- package/LoadingMask/index.d.ts +2 -0
- package/LoadingMask/index.mjs +4 -2
- package/Radio/Radio.d.ts +4 -0
- package/Radio/Radio.mjs +12 -0
- package/Radio/Radio.types.d.ts +11 -0
- package/Radio/index.d.ts +2 -0
- package/Radio/index.mjs +4 -0
- package/Radio/package.json +7 -0
- package/RadioGroup/RadioGroup.d.ts +9 -3
- package/RadioGroup/RadioGroup.mjs +37 -19
- package/RadioGroup/index.mjs +4 -3
- package/ScrollArea/ScrollArea.d.ts +2 -2
- package/ScrollArea/ScrollArea.mjs +26 -13
- package/Select/Select.mjs +93 -63
- package/Select/Select.types.d.ts +9 -2
- package/Select/SelectRoot.d.ts +2 -2
- package/Select/SelectRoot.mjs +1 -0
- package/TablePagination/TablePagination.d.ts +16 -0
- package/TablePagination/TablePagination.mjs +74 -0
- package/TablePagination/index.d.ts +1 -0
- package/TablePagination/index.mjs +4 -0
- package/TablePagination/package.json +7 -0
- package/Tabs/Tabs.d.ts +3 -2
- package/Tabs/Tabs.mjs +20 -6
- package/Tabs/Tabs.types.d.ts +5 -2
- package/Tabs/index.mjs +8 -7
- package/Textarea/Textarea.d.ts +1 -1
- package/Textarea/Textarea.mjs +71 -15
- package/Textarea/Textarea.types.d.ts +16 -2
- package/Textarea/useAutosizeTextArea.d.ts +3 -0
- package/Textarea/useAutosizeTextArea.mjs +20 -0
- package/Toast/toastVariants.mjs +3 -3
- package/index.css +1 -1
- package/index.d.ts +3 -0
- package/index.mjs +332 -318
- package/package.json +9 -8
- package/tailwind.config.mjs +13 -13
package/Form/Form.mjs
CHANGED
@@ -1,95 +1,98 @@
|
|
1
|
-
import { jsx as
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
2
2
|
import * as s from "react";
|
3
3
|
import { Slot as F } from "@radix-ui/react-slot";
|
4
4
|
import { FormProvider as u, Controller as p, useFormContext as x } from "react-hook-form";
|
5
5
|
import { cn as a } from "@oneplatformdev/utils";
|
6
6
|
import { Label as I } from "../Label/Label.mjs";
|
7
7
|
import "../Label/labelVariants.mjs";
|
8
|
-
const M = u,
|
8
|
+
const M = u, l = s.createContext(
|
9
9
|
{}
|
10
10
|
), S = ({
|
11
11
|
...e
|
12
|
-
}) => /* @__PURE__ */
|
13
|
-
const e = s.useContext(
|
12
|
+
}) => /* @__PURE__ */ n(l.Provider, { value: { name: e.name }, children: /* @__PURE__ */ n(p, { ...e }) }), c = () => {
|
13
|
+
const e = s.useContext(l), t = s.useContext(f), { getFieldState: o, formState: r } = x(), m = o(e.name, r);
|
14
14
|
if (!e)
|
15
15
|
throw new Error("useFormField should be used within <FormField>");
|
16
|
-
const { id:
|
16
|
+
const { id: i } = t;
|
17
17
|
return {
|
18
|
-
id:
|
18
|
+
id: i,
|
19
19
|
name: e.name,
|
20
|
-
formItemId: `${
|
21
|
-
formDescriptionId: `${
|
22
|
-
formMessageId: `${
|
20
|
+
formItemId: `${i}-form-item`,
|
21
|
+
formDescriptionId: `${i}-form-item-description`,
|
22
|
+
formMessageId: `${i}-form-item-message`,
|
23
23
|
...m
|
24
24
|
};
|
25
|
-
},
|
25
|
+
}, f = s.createContext(
|
26
26
|
{}
|
27
|
-
),
|
28
|
-
const
|
29
|
-
return /* @__PURE__ */
|
27
|
+
), v = s.forwardRef(({ className: e, ...t }, o) => {
|
28
|
+
const r = s.useId();
|
29
|
+
return /* @__PURE__ */ n(f.Provider, { value: { id: r }, children: /* @__PURE__ */ n("div", { ref: o, className: a("space-y-1", e), ...t }) });
|
30
30
|
});
|
31
|
-
|
32
|
-
const
|
33
|
-
const { error:
|
34
|
-
return /* @__PURE__ */
|
31
|
+
v.displayName = "FormItem";
|
32
|
+
const C = s.forwardRef(({ className: e, ...t }, o) => {
|
33
|
+
const { error: r, formItemId: m } = c();
|
34
|
+
return /* @__PURE__ */ n(
|
35
35
|
I,
|
36
36
|
{
|
37
|
-
ref:
|
38
|
-
|
37
|
+
ref: o,
|
38
|
+
"data-state": r ? "invalid" : "valid",
|
39
|
+
className: a(r && "text-destructive", e),
|
39
40
|
htmlFor: m,
|
40
|
-
...
|
41
|
+
...t
|
41
42
|
}
|
42
43
|
);
|
43
44
|
});
|
44
|
-
|
45
|
-
const
|
46
|
-
const { error: r, formItemId:
|
47
|
-
return /* @__PURE__ */
|
45
|
+
C.displayName = "FormLabel";
|
46
|
+
const g = s.forwardRef(({ className: e, ...t }, o) => {
|
47
|
+
const { error: r, formItemId: m, formDescriptionId: i, formMessageId: d } = c();
|
48
|
+
return /* @__PURE__ */ n(
|
48
49
|
F,
|
49
50
|
{
|
50
51
|
ref: o,
|
51
|
-
id:
|
52
|
-
"
|
52
|
+
id: m,
|
53
|
+
"data-state": r ? "invalid" : "valid",
|
54
|
+
"aria-describedby": r ? `${i} ${d}` : `${i}`,
|
53
55
|
"aria-invalid": !!r,
|
54
|
-
|
56
|
+
className: a("group/form-control", e),
|
57
|
+
...t
|
55
58
|
}
|
56
59
|
);
|
57
60
|
});
|
58
|
-
|
59
|
-
const N = s.forwardRef(({ className: e, ...
|
60
|
-
const { formDescriptionId:
|
61
|
-
return /* @__PURE__ */
|
61
|
+
g.displayName = "FormControl";
|
62
|
+
const N = s.forwardRef(({ className: e, ...t }, o) => {
|
63
|
+
const { formDescriptionId: r } = c();
|
64
|
+
return /* @__PURE__ */ n(
|
62
65
|
"p",
|
63
66
|
{
|
64
|
-
ref:
|
65
|
-
id:
|
67
|
+
ref: o,
|
68
|
+
id: r,
|
66
69
|
className: a("text-[0.8rem] text-muted-foreground", e),
|
67
|
-
...
|
70
|
+
...t
|
68
71
|
}
|
69
72
|
);
|
70
73
|
});
|
71
74
|
N.displayName = "FormDescription";
|
72
|
-
const w = s.forwardRef(({ className: e, children:
|
73
|
-
const { error: m, formMessageId:
|
74
|
-
return
|
75
|
+
const w = s.forwardRef(({ className: e, children: t, ...o }, r) => {
|
76
|
+
const { error: m, formMessageId: i } = c(), d = m ? String(m == null ? void 0 : m.message) : t;
|
77
|
+
return d ? /* @__PURE__ */ n(
|
75
78
|
"p",
|
76
79
|
{
|
77
|
-
ref:
|
78
|
-
id:
|
80
|
+
ref: r,
|
81
|
+
id: i,
|
79
82
|
className: a("text-[0.8rem] font-medium text-destructive", e),
|
80
|
-
...
|
81
|
-
children:
|
83
|
+
...o,
|
84
|
+
children: d
|
82
85
|
}
|
83
86
|
) : null;
|
84
87
|
});
|
85
88
|
w.displayName = "FormMessage";
|
86
89
|
export {
|
87
90
|
M as Form,
|
88
|
-
|
91
|
+
g as FormControl,
|
89
92
|
N as FormDescription,
|
90
93
|
S as FormField,
|
91
|
-
|
92
|
-
|
94
|
+
v as FormItem,
|
95
|
+
C as FormLabel,
|
93
96
|
w as FormMessage,
|
94
|
-
|
97
|
+
c as useFormField
|
95
98
|
};
|
@@ -1,5 +1,4 @@
|
|
1
|
-
import { FieldValues } from 'react-hook-form
|
2
|
-
import { UseFormReturn } from 'react-hook-form';
|
1
|
+
import { FieldValues } from 'react-hook-form';
|
3
2
|
import { FormRenderControlProps } from './FormRenderControl.types';
|
4
3
|
|
5
|
-
export declare const FormRenderControl: <Data extends FieldValues
|
4
|
+
export declare const FormRenderControl: <Data extends FieldValues>(props: FormRenderControlProps<Data>) => import("react/jsx-runtime").JSX.Element;
|
@@ -1,21 +1,21 @@
|
|
1
|
-
import { jsx as r, jsxs as
|
2
|
-
import { FormField as d, FormItem as
|
3
|
-
const
|
4
|
-
const { form: n, name: m, label: o, render: t,
|
1
|
+
import { jsx as r, jsxs as a } from "react/jsx-runtime";
|
2
|
+
import { FormField as d, FormItem as i, FormLabel as F, FormMessage as p } from "./Form.mjs";
|
3
|
+
const b = (e) => {
|
4
|
+
const { form: n, name: m, label: o, render: t, containerProps: l = {}, ...s } = e;
|
5
5
|
return /* @__PURE__ */ r(
|
6
6
|
d,
|
7
7
|
{
|
8
8
|
control: n.control,
|
9
9
|
name: m,
|
10
|
-
render: (
|
11
|
-
!!o && /* @__PURE__ */ r(
|
12
|
-
t(
|
13
|
-
/* @__PURE__ */ r(
|
10
|
+
render: (c) => /* @__PURE__ */ a(i, { ...l, children: [
|
11
|
+
!!o && /* @__PURE__ */ r(F, { children: o }),
|
12
|
+
t(c),
|
13
|
+
/* @__PURE__ */ r(p, {})
|
14
14
|
] }),
|
15
|
-
...
|
15
|
+
...s
|
16
16
|
}
|
17
17
|
);
|
18
18
|
};
|
19
19
|
export {
|
20
|
-
|
20
|
+
b as FormRenderControl
|
21
21
|
};
|
@@ -1,7 +1,4 @@
|
|
1
|
-
import { ControllerFieldState, ControllerRenderProps } from 'react-hook-form
|
2
|
-
import { FieldPath, UseFormStateReturn } from 'react-hook-form/dist/types';
|
3
|
-
import { FieldValues } from 'react-hook-form/dist/types/fields';
|
4
|
-
import { UseFormReturn } from 'react-hook-form';
|
1
|
+
import { ControllerFieldState, ControllerRenderProps, FieldPath, FieldValues, UseFormReturn, UseFormStateReturn } from 'react-hook-form';
|
5
2
|
import { default as React } from 'react';
|
6
3
|
|
7
4
|
export type FormRenderProps<Data extends FieldValues> = ({ field, fieldState, formState, }: {
|
@@ -9,10 +6,11 @@ export type FormRenderProps<Data extends FieldValues> = ({ field, fieldState, fo
|
|
9
6
|
fieldState: ControllerFieldState;
|
10
7
|
formState: UseFormStateReturn<Data>;
|
11
8
|
}) => React.ReactElement;
|
12
|
-
export interface FormRenderControlProps<Data extends FieldValues
|
13
|
-
form:
|
9
|
+
export interface FormRenderControlProps<Data extends FieldValues> {
|
10
|
+
form: UseFormReturn<Data>;
|
14
11
|
name: FieldPath<Data>;
|
15
12
|
label?: string;
|
16
13
|
render: FormRenderProps<Data>;
|
14
|
+
containerProps?: React.HTMLAttributes<HTMLDivElement>;
|
17
15
|
}
|
18
|
-
export type FormRenderControlExtendProps<Data extends FieldValues
|
16
|
+
export type FormRenderControlExtendProps<Data extends FieldValues> = Omit<FormRenderControlProps<Data>, 'render'>;
|
@@ -1,5 +1,4 @@
|
|
1
|
-
import { UseFormReturn } from 'react-hook-form';
|
2
|
-
import { FieldValues } from 'react-hook-form/dist/types/fields';
|
3
1
|
import { FormCheckboxProps } from './FormCheckbox.types';
|
2
|
+
import { FieldValues } from 'react-hook-form';
|
4
3
|
|
5
|
-
export declare const FormCheckbox: <Data extends FieldValues
|
4
|
+
export declare const FormCheckbox: <Data extends FieldValues>(props: FormCheckboxProps<Data>) => import("react/jsx-runtime").JSX.Element;
|
@@ -1,30 +1,30 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
const
|
6
|
-
const { form:
|
7
|
-
return /* @__PURE__ */
|
8
|
-
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
2
|
+
import { FormControl as h } from "../Form/Form.mjs";
|
3
|
+
import { FormRenderControl as p } from "../Form/FormRenderControl.mjs";
|
4
|
+
import { CheckboxLabel as s } from "../Checkbox/Checkbox.mjs";
|
5
|
+
const i = (t) => {
|
6
|
+
const { form: c, label: a, name: l, onCheckedChange: o, ...m } = t;
|
7
|
+
return /* @__PURE__ */ e(
|
8
|
+
p,
|
9
9
|
{
|
10
|
-
form:
|
11
|
-
name:
|
12
|
-
render: ({ field:
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
10
|
+
form: c,
|
11
|
+
name: l,
|
12
|
+
render: ({ field: r }) => /* @__PURE__ */ e(h, { children: /* @__PURE__ */ e(
|
13
|
+
s,
|
14
|
+
{
|
15
|
+
...r,
|
16
|
+
...m,
|
17
|
+
label: a,
|
18
|
+
checked: r.value || !1,
|
19
|
+
onCheckedChange: (n) => {
|
20
|
+
r.onChange(n), o == null || o(n);
|
20
21
|
}
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
...c
|
22
|
+
}
|
23
|
+
) }),
|
24
|
+
...m
|
25
25
|
}
|
26
26
|
);
|
27
27
|
};
|
28
28
|
export {
|
29
|
-
|
29
|
+
i as FormCheckbox
|
30
30
|
};
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { UseFormReturn } from 'react-hook-form';
|
2
|
-
import { FieldValues } from 'react-hook-form/dist/types/fields';
|
3
1
|
import { FormRenderControlExtendProps } from '../Form';
|
2
|
+
import { FieldValues } from 'react-hook-form';
|
3
|
+
import { CheckboxProps } from '../Checkbox';
|
4
4
|
|
5
|
-
export interface FormCheckboxProps<Data extends FieldValues
|
5
|
+
export interface FormCheckboxProps<Data extends FieldValues> extends FormRenderControlExtendProps<Data>, Omit<CheckboxProps, 'form' | 'name' | 'label'> {
|
6
6
|
disabled?: boolean;
|
7
7
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { FieldValues
|
1
|
+
import { FieldValues } from 'react-hook-form';
|
2
2
|
import { FormComboboxProps } from './FormCombobox.types';
|
3
3
|
|
4
|
-
export declare const FormCombobox: <Data extends FieldValues
|
4
|
+
export declare const FormCombobox: <Data extends FieldValues>(props: FormComboboxProps<Data>) => import("react/jsx-runtime").JSX.Element;
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { FormRenderControlExtendProps } from '../Form';
|
2
2
|
import { ComboboxProps } from '../Combobox';
|
3
|
-
import {
|
4
|
-
import { FieldValues } from 'react-hook-form/dist/types/fields';
|
3
|
+
import { FieldValues } from 'react-hook-form';
|
5
4
|
|
6
|
-
export interface FormComboboxProps<Data extends FieldValues
|
5
|
+
export interface FormComboboxProps<Data extends FieldValues> extends FormRenderControlExtendProps<Data>, Omit<ComboboxProps, 'value' | 'onChange'> {
|
7
6
|
}
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import { FormDatePickerProps } from './FormDatePicker.types';
|
2
|
-
import { FieldValues
|
2
|
+
import { FieldValues } from 'react-hook-form';
|
3
3
|
|
4
|
-
export declare const FormDatePicker: <Data extends FieldValues
|
4
|
+
export declare const FormDatePicker: <Data extends FieldValues>(props: FormDatePickerProps<Data>) => import("react/jsx-runtime").JSX.Element;
|
@@ -1,27 +1,29 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { DatePicker as
|
3
|
-
import { FormControl as
|
4
|
-
import { FormRenderControl as
|
5
|
-
const
|
6
|
-
const { form:
|
7
|
-
return /* @__PURE__ */
|
8
|
-
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
2
|
+
import { DatePicker as l } from "../DatePicker/DatePicker.mjs";
|
3
|
+
import { FormControl as p } from "../Form/Form.mjs";
|
4
|
+
import { FormRenderControl as s } from "../Form/FormRenderControl.mjs";
|
5
|
+
const h = (m) => {
|
6
|
+
const { form: n, name: a, label: c, onDateChange: r, ...i } = m;
|
7
|
+
return /* @__PURE__ */ e(
|
8
|
+
s,
|
9
9
|
{
|
10
|
-
form:
|
11
|
-
name:
|
12
|
-
label:
|
13
|
-
render: ({ field:
|
14
|
-
|
10
|
+
form: n,
|
11
|
+
name: a,
|
12
|
+
label: c,
|
13
|
+
render: ({ field: o }) => /* @__PURE__ */ e(p, { children: /* @__PURE__ */ e(
|
14
|
+
l,
|
15
15
|
{
|
16
|
-
...
|
17
|
-
...
|
18
|
-
selectedDate:
|
19
|
-
onDateChange:
|
16
|
+
...o,
|
17
|
+
...i,
|
18
|
+
selectedDate: o.value,
|
19
|
+
onDateChange: (t) => {
|
20
|
+
o.onChange(t), r == null || r(t);
|
21
|
+
}
|
20
22
|
}
|
21
23
|
) })
|
22
24
|
}
|
23
25
|
);
|
24
26
|
};
|
25
27
|
export {
|
26
|
-
|
28
|
+
h as FormDatePicker
|
27
29
|
};
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { DatePickerProps } from '../DatePicker';
|
2
2
|
import { FormRenderControlExtendProps } from '../Form';
|
3
|
-
import {
|
4
|
-
import { FieldValues } from 'react-hook-form/dist/types/fields';
|
3
|
+
import { FieldValues } from 'react-hook-form';
|
5
4
|
|
6
|
-
export interface FormDatePickerProps<Data extends FieldValues
|
5
|
+
export interface FormDatePickerProps<Data extends FieldValues> extends FormRenderControlExtendProps<Data>, Omit<DatePickerProps, 'onDateChange'>, Partial<Pick<DatePickerProps, 'onDateChange'>> {
|
7
6
|
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
2
|
+
import { FormControl as a } from "../Form/Form.mjs";
|
3
|
+
import { FormRenderControl as l } from "../Form/FormRenderControl.mjs";
|
4
|
+
import { Dropzone as f } from "../Dropzone/Dropzone.mjs";
|
5
|
+
const h = (n) => {
|
6
|
+
const { form: e, label: m, name: t, ...p } = n;
|
7
|
+
return /* @__PURE__ */ o(
|
8
|
+
l,
|
9
|
+
{
|
10
|
+
form: e,
|
11
|
+
label: m,
|
12
|
+
name: t,
|
13
|
+
render: ({ field: r }) => /* @__PURE__ */ o(a, { children: /* @__PURE__ */ o(f, { ...p, ...r, onChangeValue: r.onChange }) })
|
14
|
+
}
|
15
|
+
);
|
16
|
+
};
|
17
|
+
export {
|
18
|
+
h as FormDropzone
|
19
|
+
};
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { FormRenderControlExtendProps } from '../Form';
|
2
|
+
import { DropzoneProps } from '../Dropzone';
|
3
|
+
import { FieldValues } from 'react-hook-form';
|
4
|
+
|
5
|
+
export interface FormDropzoneProps<Data extends FieldValues> extends FormRenderControlExtendProps<Data>, DropzoneProps {
|
6
|
+
}
|
package/FormInput/FormInput.d.ts
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
import {
|
2
|
-
import { FieldValues } from 'react-hook-form/dist/types/fields';
|
1
|
+
import { FieldValues } from 'react-hook-form';
|
3
2
|
import { FormInputProps } from './FormInput.types';
|
4
3
|
|
5
|
-
export declare const FormInput: <Data extends FieldValues
|
4
|
+
export declare const FormInput: <Data extends FieldValues>(props: FormInputProps<Data>) => import("react/jsx-runtime").JSX.Element;
|
package/FormInput/FormInput.mjs
CHANGED
@@ -1,26 +1,34 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { FormControl as
|
3
|
-
import { FormRenderControl as
|
4
|
-
import { Input as
|
5
|
-
const
|
6
|
-
const { form:
|
7
|
-
return /* @__PURE__ */
|
8
|
-
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
2
|
+
import { FormControl as F } from "../Form/Form.mjs";
|
3
|
+
import { FormRenderControl as h } from "../Form/FormRenderControl.mjs";
|
4
|
+
import { Input as v } from "../Input/Input.mjs";
|
5
|
+
const g = (u) => {
|
6
|
+
const { form: a, label: c, name: s, onChange: m, onBlur: t, ...C } = u;
|
7
|
+
return /* @__PURE__ */ p(
|
8
|
+
h,
|
9
9
|
{
|
10
|
-
form:
|
11
|
-
name:
|
12
|
-
label:
|
13
|
-
render: ({ field:
|
14
|
-
|
10
|
+
form: a,
|
11
|
+
name: s,
|
12
|
+
label: c,
|
13
|
+
render: ({ field: r }) => /* @__PURE__ */ p(F, { children: /* @__PURE__ */ p(
|
14
|
+
v,
|
15
15
|
{
|
16
|
-
...
|
17
|
-
|
18
|
-
|
16
|
+
...r,
|
17
|
+
...C,
|
18
|
+
value: r.value || "",
|
19
|
+
onChange: (...n) => {
|
20
|
+
var o;
|
21
|
+
(o = r.onChange) == null || o.call(r, ...n), m == null || m(...n);
|
22
|
+
},
|
23
|
+
onBlur: (...n) => {
|
24
|
+
var o;
|
25
|
+
(o = r.onBlur) == null || o.call(r), t == null || t(...n);
|
26
|
+
}
|
19
27
|
}
|
20
28
|
) })
|
21
29
|
}
|
22
30
|
);
|
23
31
|
};
|
24
32
|
export {
|
25
|
-
|
33
|
+
g as FormInput
|
26
34
|
};
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { InputProps } from '../Input';
|
2
2
|
import { FormRenderControlExtendProps } from '../Form';
|
3
|
-
import {
|
4
|
-
import { FieldValues } from 'react-hook-form/dist/types/fields';
|
3
|
+
import { FieldValues } from 'react-hook-form';
|
5
4
|
|
6
|
-
export interface FormInputProps<Data extends FieldValues
|
5
|
+
export interface FormInputProps<Data extends FieldValues> extends FormRenderControlExtendProps<Data>, Omit<InputProps, 'form' | 'name'> {
|
7
6
|
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
2
|
+
import { FormControl as t, FormItem as F } from "../Form/Form.mjs";
|
3
|
+
import { FormRenderControl as f } from "../Form/FormRenderControl.mjs";
|
4
|
+
import { Radio as i } from "../Radio/Radio.mjs";
|
5
|
+
const b = (n) => {
|
6
|
+
const {
|
7
|
+
form: u,
|
8
|
+
name: d,
|
9
|
+
label: c,
|
10
|
+
onValueChange: m,
|
11
|
+
value: h,
|
12
|
+
defaultValue: s,
|
13
|
+
renderOption: a,
|
14
|
+
...v
|
15
|
+
} = n;
|
16
|
+
return /* @__PURE__ */ e(
|
17
|
+
f,
|
18
|
+
{
|
19
|
+
form: u,
|
20
|
+
name: d,
|
21
|
+
label: c,
|
22
|
+
render: ({ field: o }) => /* @__PURE__ */ e(t, { children: /* @__PURE__ */ e(
|
23
|
+
i,
|
24
|
+
{
|
25
|
+
...o,
|
26
|
+
...v,
|
27
|
+
defaultValue: s || o.value,
|
28
|
+
value: h || o.value,
|
29
|
+
onValueChange: (r) => {
|
30
|
+
o.onChange(r), m == null || m(r);
|
31
|
+
},
|
32
|
+
renderOption: (r, l) => /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(t, { children: (a == null ? void 0 : a(r, l)) || /* @__PURE__ */ e(l, { ...r }) }) }, r.value)
|
33
|
+
}
|
34
|
+
) })
|
35
|
+
}
|
36
|
+
);
|
37
|
+
};
|
38
|
+
export {
|
39
|
+
b as FormRadio
|
40
|
+
};
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { RadioProps } from '../Radio';
|
2
|
+
import { FormRenderControlExtendProps } from '../Form';
|
3
|
+
import { FieldValues } from 'react-hook-form';
|
4
|
+
|
5
|
+
export interface FormRadioGroupProps<Data extends FieldValues> extends FormRenderControlExtendProps<Data>, Partial<Omit<RadioProps, 'name'>> {
|
6
|
+
}
|
@@ -1,5 +1,4 @@
|
|
1
|
-
import {
|
2
|
-
import { FieldValues } from 'react-hook-form/dist/types/fields';
|
1
|
+
import { FieldValues } from 'react-hook-form';
|
3
2
|
import { FormSelectProps } from './FormSelect.types';
|
4
3
|
|
5
|
-
export declare const FormSelect: <Data extends FieldValues,
|
4
|
+
export declare const FormSelect: <Data extends FieldValues, ExtendOptionData>(props: FormSelectProps<Data, ExtendOptionData>) => import("react/jsx-runtime").JSX.Element;
|