@jasperoosthoek/react-toolbox 0.9.4 → 0.9.5
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 +455 -155
- package/change-log.md +8 -1
- package/dist/components/forms/FormField.d.ts +1 -0
- package/dist/components/forms/FormModal.d.ts +3 -2
- package/dist/components/forms/FormProvider.d.ts +3 -0
- package/dist/components/forms/fields/FormInput.d.ts +1 -1
- package/dist/index.es.js +2188 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.umd.js +28 -0
- package/dist/index.umd.js.map +1 -0
- package/package.json +26 -12
- package/src/components/forms/FormField.tsx +3 -0
- package/src/components/forms/FormModal.tsx +32 -19
- package/src/components/forms/FormProvider.tsx +7 -1
- package/src/components/forms/fields/FormBadgesSelection.tsx +3 -2
- package/src/components/forms/fields/FormCheckbox.tsx +8 -10
- package/src/components/forms/fields/FormDropdown.tsx +4 -4
- package/src/components/forms/fields/FormInput.tsx +6 -6
- package/src/components/forms/fields/FormSelect.tsx +4 -3
- package/src/components/tables/DataTable.tsx +1 -7
- package/dist/index.js +0 -3
- package/dist/index.js.LICENSE.txt +0 -15
- package/src/__tests__/buttons.test.tsx +0 -545
- package/src/__tests__/errors.test.tsx +0 -339
- package/src/__tests__/forms.test.tsx +0 -3021
- package/src/__tests__/hooks.test.tsx +0 -413
- package/src/__tests__/indicators.test.tsx +0 -284
- package/src/__tests__/localization.test.tsx +0 -462
- package/src/__tests__/login.test.tsx +0 -417
- package/src/__tests__/setupTests.ts +0 -328
- package/src/__tests__/tables.test.tsx +0 -609
- package/src/__tests__/timeAndDate.test.tsx +0 -308
- package/src/__tests__/utils.test.tsx +0 -422
|
@@ -8,6 +8,7 @@ export type FormFieldConfig = {
|
|
|
8
8
|
component?: any;
|
|
9
9
|
onChange?: (value: FormValue, formData?: any) => any;
|
|
10
10
|
label?: React.ReactElement | string;
|
|
11
|
+
placeholder?: string;
|
|
11
12
|
options?: Array<{
|
|
12
13
|
value: string | number;
|
|
13
14
|
label: string;
|
|
@@ -16,6 +17,7 @@ export type FormFieldConfig = {
|
|
|
16
17
|
list?: any[];
|
|
17
18
|
idKey?: string;
|
|
18
19
|
nameKey?: string;
|
|
20
|
+
rows?: number;
|
|
19
21
|
};
|
|
20
22
|
export type FormFields = {
|
|
21
23
|
[key: string]: FormFieldConfig;
|
|
@@ -29,6 +31,7 @@ export type OnSubmit<T> = (state: {
|
|
|
29
31
|
export type Validate = (state: any) => any;
|
|
30
32
|
type FormContextType<T extends FormFields> = {
|
|
31
33
|
formFields: T;
|
|
34
|
+
formId: string;
|
|
32
35
|
formData: {
|
|
33
36
|
[key in keyof T]: FormValue;
|
|
34
37
|
} | null;
|
|
@@ -4,7 +4,7 @@ export interface FormInputProps extends Omit<React.InputHTMLAttributes<HTMLInput
|
|
|
4
4
|
label?: React.ReactElement | string;
|
|
5
5
|
as?: string;
|
|
6
6
|
rows?: number;
|
|
7
|
-
onChange
|
|
7
|
+
onChange?: (value: string) => void;
|
|
8
8
|
}
|
|
9
9
|
export declare const FormInput: (props: FormInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export declare const FormTextarea: ({ rows, ...props }: FormInputProps) => import("react/jsx-runtime").JSX.Element;
|