@jasperoosthoek/react-toolbox 0.6.5 → 0.6.6
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/change-log.md +4 -0
- package/dist/components/forms/FormFields.d.ts +14 -13
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/src/components/forms/FormFields.tsx +51 -53
package/change-log.md
CHANGED
|
@@ -24,28 +24,28 @@ export type FormType = {
|
|
|
24
24
|
keyName: string;
|
|
25
25
|
pristine: boolean;
|
|
26
26
|
};
|
|
27
|
-
export
|
|
27
|
+
export interface FormInputProps extends Omit<FormControlProps, 'onChange'>, FormType {
|
|
28
28
|
onChange: (value: FormValue) => void;
|
|
29
29
|
controlId?: string;
|
|
30
30
|
label?: ReactElement;
|
|
31
31
|
onEnter?: () => void;
|
|
32
32
|
rows?: number;
|
|
33
|
-
}
|
|
33
|
+
}
|
|
34
34
|
export declare const FormInput: ({ label, value, onEnter, placeholder, onChange, controlId, state, setState, initialState, initialValue, keyName, pristine, id, ...formProps }: FormInputProps) => React.JSX.Element;
|
|
35
35
|
export declare const FormTextArea: ({ as, rows, ...restProps }: FormInputProps) => React.JSX.Element;
|
|
36
36
|
export declare const FormDate: (props: FormInputProps) => React.JSX.Element;
|
|
37
|
-
export
|
|
37
|
+
export interface FormDateTimeProps extends Omit<FormInputProps, 'onChange' | 'value'> {
|
|
38
38
|
value: string | Moment;
|
|
39
39
|
onChange: (value: string) => void;
|
|
40
|
-
}
|
|
40
|
+
}
|
|
41
41
|
export declare const FormDateTime: ({ value, onChange, ...restProps }: FormDateTimeProps) => React.JSX.Element;
|
|
42
|
-
export
|
|
42
|
+
export interface FormCheckboxProps extends Omit<FormCheckProps, 'onChange'>, FormType {
|
|
43
43
|
onChange: (value: boolean) => void;
|
|
44
44
|
controlId?: string;
|
|
45
45
|
label?: ReactElement;
|
|
46
46
|
onEnter?: () => void;
|
|
47
47
|
rows?: number;
|
|
48
|
-
}
|
|
48
|
+
}
|
|
49
49
|
export declare const FormCheckbox: ({ value, onChange, state, label, keyName, controlId, initialState, initialValue, setState, pristine, id, ...restProps }: FormCheckboxProps) => React.JSX.Element;
|
|
50
50
|
export declare const FormSwitch: ({ className, ...restProps }: FormCheckboxProps) => React.JSX.Element;
|
|
51
51
|
export type DisabledProps = {
|
|
@@ -55,7 +55,7 @@ export type DisabledProps = {
|
|
|
55
55
|
initialState: any;
|
|
56
56
|
initialValue: any;
|
|
57
57
|
};
|
|
58
|
-
export
|
|
58
|
+
export interface FormSelectProps extends Omit<FormInputProps, 'disabled' | 'onChange' | 'list'> {
|
|
59
59
|
onChange: (value: number | string | number[] | string[] | null) => void;
|
|
60
60
|
list: any[];
|
|
61
61
|
multiple?: boolean;
|
|
@@ -63,7 +63,7 @@ export type FormSelectProps = Omit<FormInputProps, 'disabled' | 'onChange'> & {
|
|
|
63
63
|
formatTitle?: (item: any) => ReactElement;
|
|
64
64
|
idKey?: string;
|
|
65
65
|
disabled?: boolean | ((props: DisabledProps) => boolean);
|
|
66
|
-
}
|
|
66
|
+
}
|
|
67
67
|
export declare const FormSelect: ({ list, idKey, integer, value, defaultValue, onChange, label, controlId, htmlSize, state, formatTitle, multiple, disabled, isInvalid, initialState, initialValue, keyName, pristine, }: FormSelectProps) => React.JSX.Element;
|
|
68
68
|
export interface BadgeSelectionProps extends BadgeProps {
|
|
69
69
|
selected: boolean;
|
|
@@ -73,11 +73,12 @@ export interface BadgeSelectionProps extends BadgeProps {
|
|
|
73
73
|
export declare const BadgeSelection: ({ selected, disabled, cursor, onClick, style, bg, ...restProps }: BadgeSelectionProps) => React.JSX.Element;
|
|
74
74
|
export type FormBadgesSelectionProps = FormSelectProps;
|
|
75
75
|
export declare const FormBadgesSelection: ({ list, idKey, value, onChange, multiple, label, integer, controlId, isInvalid, state, setState, disabled, initialState, initialValue, keyName, pristine, ...restProps }: FormBadgesSelectionProps) => React.JSX.Element;
|
|
76
|
-
export
|
|
76
|
+
export interface FormDropdownProps<T> extends Omit<FormInputProps, 'disabled' | 'onChange' | 'list'> {
|
|
77
77
|
onChange: (value: number | string | number[] | string[] | null) => void;
|
|
78
|
-
list:
|
|
79
|
-
idKey?:
|
|
78
|
+
list: T[];
|
|
79
|
+
idKey?: keyof T;
|
|
80
|
+
nameKey?: keyof T;
|
|
80
81
|
disabled?: boolean | ((props: DisabledProps) => boolean);
|
|
81
82
|
variant?: Variant;
|
|
82
|
-
}
|
|
83
|
-
export declare const FormDropdown: ({ list,
|
|
83
|
+
}
|
|
84
|
+
export declare const FormDropdown: <T>({ list: listBase, idKey, nameKey, value, onChange, label, controlId, isInvalid, state, setState, disabled, initialState, initialValue, variant, pristine, keyName, ...restProps }: FormDropdownProps<T>) => React.JSX.Element;
|