envoc-form 3.0.0 → 3.3.0

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 (34) hide show
  1. package/es/AddressInput/index.js +2 -1
  2. package/es/DatePickerInput/DatePickerInput.js +1 -1
  3. package/es/FileInput/index.js +2 -1
  4. package/es/Form/index.js +3 -1
  5. package/es/FormInput/FormInput.js +6 -0
  6. package/es/MoneyFormattedInput/MoneyFormattedInput.js +106 -0
  7. package/es/MoneyFormattedInput/index.js +2 -0
  8. package/es/ReactSelectField/ReactSelectField.js +36 -2
  9. package/es/index.js +20 -10
  10. package/es/validators/validators.js +2 -2
  11. package/lib/AddressInput/index.js +13 -3
  12. package/lib/DatePickerInput/DatePickerInput.js +2 -2
  13. package/lib/FileInput/index.js +9 -1
  14. package/lib/Form/index.js +16 -0
  15. package/lib/FormInput/FormInput.js +7 -0
  16. package/lib/MoneyFormattedInput/MoneyFormattedInput.js +126 -0
  17. package/lib/MoneyFormattedInput/index.js +15 -0
  18. package/lib/ReactSelectField/ReactSelectField.js +37 -2
  19. package/lib/index.js +166 -38
  20. package/lib/validators/validators.js +2 -2
  21. package/package.json +3 -2
  22. package/src/AddressInput/__snapshots__/AddesssInput.test.js.snap +1 -1
  23. package/src/AddressInput/index.js +2 -1
  24. package/src/BoolInput/__snapshots__/BoolInput.test.js.snap +1 -1
  25. package/src/DatePickerInput/DatePickerInput.js +1 -1
  26. package/src/FileInput/index.js +2 -1
  27. package/src/Form/index.js +9 -1
  28. package/src/FormInput/FormInput.js +3 -0
  29. package/src/FormInput/__snapshots__/FormInput.test.js.snap +1 -1
  30. package/src/MoneyFormattedInput/MoneyFormattedInput.js +115 -0
  31. package/src/MoneyFormattedInput/index.js +3 -0
  32. package/src/ReactSelectField/ReactSelectField.js +34 -1
  33. package/src/index.js +54 -17
  34. package/src/validators/validators.js +2 -2
package/src/index.js CHANGED
@@ -1,33 +1,70 @@
1
- import Form from './Form';
1
+ import * as normalizers from './normalizers';
2
+
3
+ import { BoolInput, InlineBoolInput } from './BoolInput';
4
+ import { InlineMoneyInput, MoneyInput } from './MoneyInput';
5
+ import { MoneyFormattedInput } from './MoneyFormattedInput';
6
+
7
+ import AddressInput, { UsStates } from './AddressInput';
8
+ import ConfirmBaseForm from './ConfirmBaseForm';
9
+ import ConfirmDeleteForm from './ConfirmDeleteForm';
10
+ import DatePickerInput from './DatePickerInput';
11
+ import ErrorScrollTarget from './ErrorScrollTarget';
12
+ import { FileInput, DropzoneFileInput, DefaultFileList } from './FileInput';
13
+ import Form, {
14
+ ServerErrorContext,
15
+ FocusError,
16
+ FormBasedPreventNavigation,
17
+ } from './Form';
18
+ import FormGroup from './FormGroup';
19
+ import FormGroupWrapper from './FormGroupWrapper';
2
20
  import FormInput from './FormInput';
3
- import InlineFormInput from './InlineFormInput';
4
21
  import FormInputArray from './FormInputArray';
22
+ import FormSection from './FormSection';
5
23
  import IconInput from './IconInput';
6
- import { BoolInput, InlineBoolInput } from './BoolInput';
24
+ import InlineFormInput from './InlineFormInput';
7
25
  import StandardFormActions from './StandardFormActions';
8
- import validators from './validators';
9
- import * as normalizers from './normalizers';
10
- import ConfirmBaseForm from './ConfirmBaseForm';
11
- import ConfirmDeleteForm from './ConfirmDeleteForm';
12
26
  import SubmitFormButton from './SubmitFormButton';
13
- import AddressInput from './AddressInput';
14
- import { MoneyInput, InlineMoneyInput } from './MoneyInput';
27
+ import useStandardFormInput from './useStandardFormInput';
28
+ import validators from './validators';
29
+ import ReactSelectField, {
30
+ customStyles as customReactSelectFieldStyles,
31
+ overrideTheme as overrideReactSelectFieldStyles,
32
+ } from './ReactSelectField';
33
+ import NestedFormFieldContext from './NestedFormFieldContext';
15
34
 
16
35
  export {
36
+ AddressInput,
37
+ UsStates,
38
+ BoolInput,
39
+ ConfirmBaseForm,
40
+ ConfirmDeleteForm,
41
+ DatePickerInput,
42
+ ErrorScrollTarget,
43
+ FileInput,
44
+ DropzoneFileInput,
45
+ DefaultFileList,
17
46
  Form,
47
+ FormGroup,
48
+ FormGroupWrapper,
18
49
  FormInput,
19
- InlineFormInput,
20
50
  FormInputArray,
51
+ FormSection,
21
52
  IconInput,
22
- BoolInput,
23
53
  InlineBoolInput,
24
- validators,
54
+ InlineFormInput,
55
+ InlineMoneyInput,
56
+ MoneyInput,
57
+ MoneyFormattedInput,
25
58
  normalizers,
26
59
  StandardFormActions,
27
- ConfirmBaseForm,
28
- ConfirmDeleteForm,
29
60
  SubmitFormButton,
30
- AddressInput,
31
- MoneyInput,
32
- InlineMoneyInput,
61
+ useStandardFormInput,
62
+ validators,
63
+ ServerErrorContext,
64
+ FocusError,
65
+ FormBasedPreventNavigation,
66
+ ReactSelectField,
67
+ customReactSelectFieldStyles,
68
+ overrideReactSelectFieldStyles,
69
+ NestedFormFieldContext,
33
70
  };
@@ -55,7 +55,7 @@ export function minCount(count) {
55
55
 
56
56
  export const maxValue = function maxValue(value) {
57
57
  return (inputValue) => {
58
- if (inputValue && value) {
58
+ if (inputValue != null && value != null) {
59
59
  return inputValue <= value
60
60
  ? undefined
61
61
  : `Maximum value ${value} exceeded`;
@@ -67,7 +67,7 @@ export const maxValue = function maxValue(value) {
67
67
 
68
68
  export const minValue = function minValue(value) {
69
69
  return (inputValue) => {
70
- if (inputValue && value) {
70
+ if (inputValue != null && value != null) {
71
71
  return inputValue >= value ? undefined : `Minimum value ${value} not met`;
72
72
  } else {
73
73
  return undefined;