@solidpb/ui-kit 0.6.2 → 0.6.3
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/README.md +1 -1
- package/dist/components/Form.d.ts +2 -2
- package/dist/components/Form.jsx +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JSXElement
|
|
1
|
+
import { JSXElement } from "solid-js";
|
|
2
2
|
import { type SwitchProps } from "./Switch";
|
|
3
3
|
import { type SelectProps } from "./Select";
|
|
4
4
|
import { type InputRootProps } from "./Input";
|
|
@@ -11,7 +11,7 @@ import { type FileInputProps } from "./FileInput";
|
|
|
11
11
|
import { RelationPickerProps } from "./RelationPicker";
|
|
12
12
|
export interface FormProps<T> {
|
|
13
13
|
data: Partial<T>;
|
|
14
|
-
setData:
|
|
14
|
+
setData: (data: Partial<T>) => void;
|
|
15
15
|
title?: string;
|
|
16
16
|
onSave?: (values: Partial<T>) => Promise<void>;
|
|
17
17
|
onCancel?: () => void;
|
package/dist/components/Form.jsx
CHANGED
|
@@ -18,7 +18,7 @@ const formClass = tv({
|
|
|
18
18
|
export function createForm() {
|
|
19
19
|
const Form = (props) => {
|
|
20
20
|
const setValue = (key, value) => {
|
|
21
|
-
props.setData(
|
|
21
|
+
props.setData({ ...props.data, [key]: value });
|
|
22
22
|
};
|
|
23
23
|
const getValue = (key) => {
|
|
24
24
|
return props.data[key];
|