@cripty2001/utils 0.0.119 → 0.0.120
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/react-ui/form.d.ts +4 -2
- package/dist/react-ui/form.js +2 -2
- package/package.json +1 -1
package/dist/react-ui/form.d.ts
CHANGED
|
@@ -12,8 +12,10 @@ export type FormComponentPropsInput = {
|
|
|
12
12
|
});
|
|
13
13
|
export type FormComponentProps<T extends Record<string, string>> = {
|
|
14
14
|
inputs: FormComponentPropsInput[];
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
submit?: {
|
|
16
|
+
label: string;
|
|
17
|
+
callback: (values: T) => void | Promise<void>;
|
|
18
|
+
};
|
|
17
19
|
value: T;
|
|
18
20
|
setValue: React.Dispatch<React.SetStateAction<T>>;
|
|
19
21
|
variant: TypeofRecord<InputComponentPropsVariants> & {
|
package/dist/react-ui/form.js
CHANGED
|
@@ -32,6 +32,6 @@ function FormComponent(props) {
|
|
|
32
32
|
default:
|
|
33
33
|
return (0, jsx_runtime_1.jsx)("div", { style: { color: '#ef4444', backgroundColor: 'white' }, children: "Unknown input type" });
|
|
34
34
|
}
|
|
35
|
-
})()), props.
|
|
36
|
-
(0, jsx_runtime_1.jsx)(button_1.default, { className: variants.default.button, title: props.
|
|
35
|
+
})()), props.submit &&
|
|
36
|
+
(0, jsx_runtime_1.jsx)(button_1.default, { className: variants.default.button, title: props.submit.label, onClick: () => props.submit?.callback(props.value) })] }));
|
|
37
37
|
}
|
package/package.json
CHANGED