@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.
Files changed (33) hide show
  1. package/README.md +455 -155
  2. package/change-log.md +8 -1
  3. package/dist/components/forms/FormField.d.ts +1 -0
  4. package/dist/components/forms/FormModal.d.ts +3 -2
  5. package/dist/components/forms/FormProvider.d.ts +3 -0
  6. package/dist/components/forms/fields/FormInput.d.ts +1 -1
  7. package/dist/index.es.js +2188 -0
  8. package/dist/index.es.js.map +1 -0
  9. package/dist/index.umd.js +28 -0
  10. package/dist/index.umd.js.map +1 -0
  11. package/package.json +26 -12
  12. package/src/components/forms/FormField.tsx +3 -0
  13. package/src/components/forms/FormModal.tsx +32 -19
  14. package/src/components/forms/FormProvider.tsx +7 -1
  15. package/src/components/forms/fields/FormBadgesSelection.tsx +3 -2
  16. package/src/components/forms/fields/FormCheckbox.tsx +8 -10
  17. package/src/components/forms/fields/FormDropdown.tsx +4 -4
  18. package/src/components/forms/fields/FormInput.tsx +6 -6
  19. package/src/components/forms/fields/FormSelect.tsx +4 -3
  20. package/src/components/tables/DataTable.tsx +1 -7
  21. package/dist/index.js +0 -3
  22. package/dist/index.js.LICENSE.txt +0 -15
  23. package/src/__tests__/buttons.test.tsx +0 -545
  24. package/src/__tests__/errors.test.tsx +0 -339
  25. package/src/__tests__/forms.test.tsx +0 -3021
  26. package/src/__tests__/hooks.test.tsx +0 -413
  27. package/src/__tests__/indicators.test.tsx +0 -284
  28. package/src/__tests__/localization.test.tsx +0 -462
  29. package/src/__tests__/login.test.tsx +0 -417
  30. package/src/__tests__/setupTests.ts +0 -328
  31. package/src/__tests__/tables.test.tsx +0 -609
  32. package/src/__tests__/timeAndDate.test.tsx +0 -308
  33. 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: (value: string) => void;
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;