envoc-form 5.0.5 → 5.0.7
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 +7 -7
- package/es/ConfirmBaseForm/ConfirmBaseForm.js +2 -2
- package/es/DatePicker/DatePickerGroup.js +2 -2
- package/es/Field/Field.d.ts +2 -1
- package/es/Field/Field.js +14 -6
- package/es/FieldArray/FieldArray.js +4 -4
- package/es/File/FileGroup.js +3 -3
- package/es/Form/Form.js +2 -2
- package/es/Group.js +3 -3
- package/es/Input/CheckboxGroup.js +3 -3
- package/es/Input/CheckboxInputGroup.js +2 -2
- package/es/Input/IconInputGroup.js +2 -2
- package/es/Input/InputGroup.js +2 -2
- package/es/Input/MoneyInputGroup.js +2 -2
- package/es/Input/NumberInputGroup.js +2 -2
- package/es/Input/PhoneNumberInputGroup.js +2 -2
- package/es/Input/StringInputGroup.js +2 -2
- package/es/Select/SelectGroup.js +3 -3
- package/es/StandardFormActions.js +3 -3
- package/es/SubmitFormButton.js +2 -2
- package/es/TextArea/TextAreaGroup.js +2 -2
- package/lib/ConfirmBaseForm/ConfirmBaseForm.js +2 -5
- package/lib/DatePicker/DatePickerGroup.js +2 -2
- package/lib/Field/Field.d.ts +2 -1
- package/lib/Field/Field.js +14 -6
- package/lib/FieldArray/FieldArray.js +4 -4
- package/lib/File/FileGroup.js +3 -3
- package/lib/Form/Form.js +2 -2
- package/lib/Group.js +3 -3
- package/lib/Input/CheckboxGroup.js +3 -3
- package/lib/Input/CheckboxInputGroup.js +2 -2
- package/lib/Input/IconInputGroup.js +2 -2
- package/lib/Input/InputGroup.js +2 -2
- package/lib/Input/MoneyInputGroup.js +2 -2
- package/lib/Input/NumberInputGroup.js +2 -2
- package/lib/Input/PhoneNumberInputGroup.js +2 -2
- package/lib/Input/StringInputGroup.js +2 -2
- package/lib/Select/SelectGroup.js +3 -3
- package/lib/StandardFormActions.js +3 -3
- package/lib/SubmitFormButton.js +2 -2
- package/lib/TextArea/TextAreaGroup.js +2 -2
- package/package.json +4 -4
- package/src/ConfirmBaseForm/ConfirmBaseForm.tsx +3 -3
- package/src/DatePicker/DatePickerGroup.tsx +3 -9
- package/src/Field/Field.tsx +21 -7
- package/src/FieldArray/FieldArray.tsx +4 -4
- package/src/File/FileGroup.tsx +3 -6
- package/src/Form/Form.tsx +2 -5
- package/src/Group.tsx +3 -3
- package/src/Input/CheckboxGroup.tsx +3 -3
- package/src/Input/CheckboxInputGroup.tsx +3 -3
- package/src/Input/IconInputGroup.tsx +2 -2
- package/src/Input/InputGroup.tsx +3 -9
- package/src/Input/MoneyInputGroup.tsx +2 -5
- package/src/Input/NumberInputGroup.tsx +2 -5
- package/src/Input/PhoneNumberInputGroup.tsx +2 -2
- package/src/Input/StringInputGroup.tsx +2 -5
- package/src/Select/SelectGroup.tsx +3 -3
- package/src/StandardFormActions.tsx +3 -3
- package/src/SubmitFormButton.tsx +2 -2
- package/src/TextArea/TextAreaGroup.tsx +3 -3
@@ -1,5 +1,5 @@
|
|
1
1
|
import React, { LegacyRef } from 'react';
|
2
|
-
import
|
2
|
+
import { clsx } from 'clsx';
|
3
3
|
import CheckboxGroup from './CheckboxGroup';
|
4
4
|
import { InputGroupProps } from './InputGroup';
|
5
5
|
import { FormDefaults } from '../FormDefaults';
|
@@ -35,7 +35,7 @@ function CheckboxInputGroup(
|
|
35
35
|
label={label}
|
36
36
|
helpText={helpText}
|
37
37
|
labelOnLeft={labelOnLeft}
|
38
|
-
className={
|
38
|
+
className={clsx(
|
39
39
|
className,
|
40
40
|
FormDefaults.cssClassPrefix + 'checkbox-group',
|
41
41
|
{ 'label-on-left': labelOnLeft },
|
@@ -46,7 +46,7 @@ function CheckboxInputGroup(
|
|
46
46
|
type="checkbox"
|
47
47
|
aria-invalid={!!meta.error}
|
48
48
|
aria-errormessage={!!meta.error ? `${input.name}-error` : undefined}
|
49
|
-
className={
|
49
|
+
className={clsx(
|
50
50
|
className,
|
51
51
|
FormDefaults.cssClassPrefix + 'checkbox-group'
|
52
52
|
)}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React, { LegacyRef } from 'react';
|
2
|
-
import
|
2
|
+
import { clsx } from 'clsx';
|
3
3
|
import InputGroupWithRef, { InputGroupProps } from './InputGroup';
|
4
4
|
import { FormDefaults } from '../FormDefaults';
|
5
5
|
|
@@ -28,7 +28,7 @@ function IconInputGroup(
|
|
28
28
|
<InputGroupWithRef
|
29
29
|
icon={icon}
|
30
30
|
ref={ref}
|
31
|
-
className={
|
31
|
+
className={clsx(
|
32
32
|
className,
|
33
33
|
FormDefaults.cssClassPrefix + 'icon-input-group'
|
34
34
|
)}
|
package/src/Input/InputGroup.tsx
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import React, { ChangeEventHandler, LegacyRef } from 'react';
|
2
|
-
import
|
2
|
+
import { clsx } from 'clsx';
|
3
3
|
import { InjectedFieldProps } from '../Field/InjectedFieldProps';
|
4
4
|
import { FormDefaults } from '../FormDefaults';
|
5
5
|
import Group, { GroupProps } from '../Group';
|
@@ -44,10 +44,7 @@ function InputGroup<TValue>(
|
|
44
44
|
disabled={disabled}
|
45
45
|
label={label}
|
46
46
|
helpText={helpText}
|
47
|
-
className={
|
48
|
-
className,
|
49
|
-
FormDefaults.cssClassPrefix + 'input-group'
|
50
|
-
)}>
|
47
|
+
className={clsx(className, FormDefaults.cssClassPrefix + 'input-group')}>
|
51
48
|
{icon}
|
52
49
|
<input
|
53
50
|
{...input}
|
@@ -57,10 +54,7 @@ function InputGroup<TValue>(
|
|
57
54
|
value={value ?? ''}
|
58
55
|
onChange={onChange}
|
59
56
|
ref={ref}
|
60
|
-
className={
|
61
|
-
className,
|
62
|
-
FormDefaults.cssClassPrefix + 'input-group'
|
63
|
-
)}
|
57
|
+
className={clsx(className, FormDefaults.cssClassPrefix + 'input-group')}
|
64
58
|
/>
|
65
59
|
</Group>
|
66
60
|
);
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React, { LegacyRef } from 'react';
|
2
|
-
import
|
2
|
+
import { clsx } from 'clsx';
|
3
3
|
import InputGroup, { InputGroupProps } from './InputGroup';
|
4
4
|
import { FormDefaults } from '../FormDefaults';
|
5
5
|
|
@@ -26,10 +26,7 @@ function MoneyInputGroup(
|
|
26
26
|
min={0}
|
27
27
|
{...rest}
|
28
28
|
type="number"
|
29
|
-
className={
|
30
|
-
className,
|
31
|
-
FormDefaults.cssClassPrefix + 'money-group'
|
32
|
-
)}
|
29
|
+
className={clsx(className, FormDefaults.cssClassPrefix + 'money-group')}
|
33
30
|
value={input.value || ''}
|
34
31
|
onChange={(e) => {
|
35
32
|
if (!e.target.value) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React, { LegacyRef } from 'react';
|
2
|
-
import
|
2
|
+
import { clsx } from 'clsx';
|
3
3
|
import InputGroup, { InputGroupProps } from './InputGroup';
|
4
4
|
import { FormDefaults } from '../FormDefaults';
|
5
5
|
|
@@ -24,10 +24,7 @@ function NumberInputGroup(
|
|
24
24
|
ref={ref}
|
25
25
|
{...rest}
|
26
26
|
type="number"
|
27
|
-
className={
|
28
|
-
className,
|
29
|
-
FormDefaults.cssClassPrefix + 'number-group'
|
30
|
-
)}
|
27
|
+
className={clsx(className, FormDefaults.cssClassPrefix + 'number-group')}
|
31
28
|
value={input.value || ''}
|
32
29
|
onChange={(e) => {
|
33
30
|
if (!e.target.value) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React, { LegacyRef } from 'react';
|
2
|
-
import
|
2
|
+
import { clsx } from 'clsx';
|
3
3
|
import InputGroup, { InputGroupProps } from './InputGroup';
|
4
4
|
import { FormDefaults } from '../FormDefaults';
|
5
5
|
import { phoneNumber } from '../Normalization/normalizers';
|
@@ -20,7 +20,7 @@ function PhoneNumberInputGroup(
|
|
20
20
|
autoComplete="tel-national"
|
21
21
|
{...rest}
|
22
22
|
type="text"
|
23
|
-
className={
|
23
|
+
className={clsx(
|
24
24
|
className,
|
25
25
|
FormDefaults.cssClassPrefix + 'phone-number-group'
|
26
26
|
)}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React, { LegacyRef } from 'react';
|
2
|
-
import
|
2
|
+
import { clsx } from 'clsx';
|
3
3
|
import InputGroup, { InputGroupProps } from './InputGroup';
|
4
4
|
import { FormDefaults } from '../FormDefaults';
|
5
5
|
|
@@ -29,10 +29,7 @@ function StringInputGroup(
|
|
29
29
|
<InputGroup
|
30
30
|
ref={ref}
|
31
31
|
{...rest}
|
32
|
-
className={
|
33
|
-
className,
|
34
|
-
FormDefaults.cssClassPrefix + 'string-group'
|
35
|
-
)}
|
32
|
+
className={clsx(className, FormDefaults.cssClassPrefix + 'string-group')}
|
36
33
|
value={input.value ?? ''}
|
37
34
|
onChange={(e) => {
|
38
35
|
if (!e.target.value) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { default as ReactSelect } from 'react-select';
|
2
|
-
import
|
2
|
+
import { clsx } from 'clsx';
|
3
3
|
import { InjectedFieldProps } from '../Field/InjectedFieldProps';
|
4
4
|
import { FormDefaults } from '../FormDefaults';
|
5
5
|
import Group, { GroupProps } from '../Group';
|
@@ -74,7 +74,7 @@ export default function SelectGroup<TValue>({
|
|
74
74
|
meta={meta}
|
75
75
|
required={required}
|
76
76
|
disabled={disabled}
|
77
|
-
className={
|
77
|
+
className={clsx(
|
78
78
|
className,
|
79
79
|
{
|
80
80
|
[FormDefaults.cssClassPrefix + 'multiple']: multiple,
|
@@ -100,7 +100,7 @@ export default function SelectGroup<TValue>({
|
|
100
100
|
}
|
101
101
|
}}
|
102
102
|
getOptionLabel={(option) => option?.label ?? ''}
|
103
|
-
className={
|
103
|
+
className={clsx(
|
104
104
|
className,
|
105
105
|
FormDefaults.cssClassPrefix + 'select-group'
|
106
106
|
)}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { MouseEventHandler } from 'react';
|
2
|
-
import
|
2
|
+
import { clsx } from 'clsx';
|
3
3
|
import { useFormikContext } from 'formik';
|
4
|
-
import SubmitFormButton from './SubmitFormButton';
|
5
4
|
import { FormDefaults } from './FormDefaults';
|
5
|
+
import SubmitFormButton from './SubmitFormButton';
|
6
6
|
|
7
7
|
export interface StandardFormActionsProps {
|
8
8
|
/** Allow the form to be submitted without any changes. By default this is not allowed. */
|
@@ -25,7 +25,7 @@ export default function StandardFormActions({
|
|
25
25
|
<SubmitFormButton allowPristineSubmit={allowPristineSubmit} />
|
26
26
|
|
27
27
|
<button
|
28
|
-
className={
|
28
|
+
className={clsx(
|
29
29
|
FormDefaults.cssClassPrefix + 'standard-form-actions-cancel-button'
|
30
30
|
)}
|
31
31
|
type="button"
|
package/src/SubmitFormButton.tsx
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import React, { LegacyRef } from 'react';
|
2
|
-
import
|
2
|
+
import { clsx } from 'clsx';
|
3
3
|
import { useFormikContext } from 'formik';
|
4
4
|
import { FormDefaults } from './FormDefaults';
|
5
5
|
|
@@ -39,7 +39,7 @@ function SubmitFormButton(
|
|
39
39
|
? "You haven't made any changes"
|
40
40
|
: ''
|
41
41
|
}
|
42
|
-
className={
|
42
|
+
className={clsx(
|
43
43
|
FormDefaults.cssClassPrefix + 'submit-form-button',
|
44
44
|
className
|
45
45
|
)}>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React, { LegacyRef } from 'react';
|
2
|
-
import
|
2
|
+
import { clsx } from 'clsx';
|
3
3
|
import { InjectedFieldProps } from '../Field/InjectedFieldProps';
|
4
4
|
import { FormDefaults } from '../FormDefaults';
|
5
5
|
import Group, { GroupProps } from '../Group';
|
@@ -36,7 +36,7 @@ function TextAreaGroup(
|
|
36
36
|
disabled={disabled}
|
37
37
|
label={label}
|
38
38
|
helpText={helpText}
|
39
|
-
className={
|
39
|
+
className={clsx(
|
40
40
|
className,
|
41
41
|
FormDefaults.cssClassPrefix + 'text-area-group'
|
42
42
|
)}>
|
@@ -47,7 +47,7 @@ function TextAreaGroup(
|
|
47
47
|
value={input.value ?? ''}
|
48
48
|
onChange={(val) => input.onChange(val.target.value)}
|
49
49
|
ref={ref}
|
50
|
-
className={
|
50
|
+
className={clsx(
|
51
51
|
className,
|
52
52
|
FormDefaults.cssClassPrefix + 'text-area-group'
|
53
53
|
)}
|