@itcase/forms 1.1.27 → 1.1.29
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/dist/itcase-forms.cjs.js +76 -82
- package/dist/itcase-forms.esm.js +170 -176
- package/package.json +1 -1
package/dist/itcase-forms.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isPossiblePhoneNumber } from 'libphonenumber-js';
|
|
2
|
-
import React
|
|
2
|
+
import React, { useMemo, useEffect, useState, useCallback } from 'react';
|
|
3
3
|
import { setIn, FORM_ERROR, getIn } from 'final-form';
|
|
4
4
|
import { useForm, Field, Form, FormSpy } from 'react-final-form';
|
|
5
5
|
export { Field, useForm, useFormState } from 'react-final-form';
|
|
@@ -179,8 +179,8 @@ function useFieldValidationState(props) {
|
|
|
179
179
|
// looks at what props were in initialProps, if they are there then changes
|
|
180
180
|
function useValidationAppearanceInputProps(props) {
|
|
181
181
|
const {
|
|
182
|
-
|
|
183
|
-
|
|
182
|
+
inputProps,
|
|
183
|
+
validationStateKey
|
|
184
184
|
} = props;
|
|
185
185
|
|
|
186
186
|
// TODO: need to add props that can change during errors in this field
|
|
@@ -194,7 +194,7 @@ function useValidationAppearanceInputProps(props) {
|
|
|
194
194
|
// }
|
|
195
195
|
const updatedInputProps = {};
|
|
196
196
|
if (validationStateKey) {
|
|
197
|
-
Object.entries(inputProps).forEach(([propKey, propValue]) => {
|
|
197
|
+
Object.entries(inputProps || {}).forEach(([propKey, propValue]) => {
|
|
198
198
|
// Convert the input property key to "snake_case" format.
|
|
199
199
|
// e.g. "requiredBorderColor" -> "required_border_color".
|
|
200
200
|
const propKeySnake = snakeCase(propKey);
|
|
@@ -339,56 +339,56 @@ function FieldWrapperBase(props) {
|
|
|
339
339
|
const errorTextSize = props[`${errorKey}MessageTextSize`];
|
|
340
340
|
const errorTextColor = props[`${errorKey}MessageTextColor`];
|
|
341
341
|
const errorTextWeight = props[`${errorKey}MessageTextWeight`];
|
|
342
|
-
return /*#__PURE__*/React
|
|
342
|
+
return /*#__PURE__*/React.createElement(Tag, {
|
|
343
343
|
dataTestId: `${inputName}Field`,
|
|
344
344
|
dataTour: dataTour,
|
|
345
345
|
className: clsx(formFieldClass, 'form__item', 'form-field', type && `form-field_type_${type}`, sizeClass, fillClass, shapeClass, isDisabled && `form-field_state_disabled`, isHidden && `form-field_state_hidden`, directionClass, widthClass),
|
|
346
346
|
style: formFieldStyles
|
|
347
|
-
}, before, (label || labelHidden) && /*#__PURE__*/React
|
|
347
|
+
}, before, (label || labelHidden) && /*#__PURE__*/React.createElement("div", {
|
|
348
348
|
dataTestId: `${inputName}FieldLabel`,
|
|
349
349
|
className: clsx('form-field__label'),
|
|
350
350
|
htmlFor: id
|
|
351
|
-
}, /*#__PURE__*/React
|
|
351
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
352
352
|
size: labelTextSize,
|
|
353
353
|
textColor: labelTextColor,
|
|
354
354
|
textWeight: labelTextWeight,
|
|
355
355
|
sizeMobile: labelTextSizeMobile,
|
|
356
356
|
sizeTablet: labelTextSizeTablet
|
|
357
|
-
}, label, labelHidden && '\u00A0')), desc && /*#__PURE__*/React
|
|
357
|
+
}, label, labelHidden && '\u00A0')), desc && /*#__PURE__*/React.createElement("div", {
|
|
358
358
|
className: "form-field__desc",
|
|
359
359
|
dataTestId: `${inputName}FieldDesc`
|
|
360
|
-
}, /*#__PURE__*/React
|
|
360
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
361
361
|
size: descTextSize,
|
|
362
362
|
textColor: descTextColor,
|
|
363
363
|
textWeight: descTextWeight
|
|
364
|
-
}, desc)), /*#__PURE__*/React
|
|
364
|
+
}, desc)), /*#__PURE__*/React.createElement("div", {
|
|
365
365
|
className: clsx('form-field__content', inputFillClass, inputShapeClass)
|
|
366
|
-
}, /*#__PURE__*/React
|
|
366
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
367
367
|
className: clsx('form-field__content-inner', fieldClass)
|
|
368
|
-
}, beforeItem, children, afterItem), showDivider && /*#__PURE__*/React
|
|
368
|
+
}, beforeItem, children, afterItem), showDivider && /*#__PURE__*/React.createElement(Divider, {
|
|
369
369
|
className: "form-field__item-divider",
|
|
370
370
|
width: dividerWidth,
|
|
371
371
|
direction: dividerDirection,
|
|
372
372
|
size: dividerSize,
|
|
373
373
|
fill: dividerFill
|
|
374
|
-
})), showMessage && /*#__PURE__*/React
|
|
374
|
+
})), showMessage && /*#__PURE__*/React.createElement("div", {
|
|
375
375
|
dataTestId: `${inputName}FieldMessage`,
|
|
376
376
|
className: "form-field__message"
|
|
377
|
-
}, isErrorState && errorMessage && /*#__PURE__*/React
|
|
377
|
+
}, isErrorState && errorMessage && /*#__PURE__*/React.createElement(Text, {
|
|
378
378
|
id: `${inputName}-error`,
|
|
379
379
|
dataTestId: `${inputName}FieldMessageError`,
|
|
380
380
|
className: "form-field__message-item form-field__message-item_type-error",
|
|
381
381
|
size: errorTextSize,
|
|
382
382
|
textColor: errorTextColor,
|
|
383
383
|
textWeight: errorTextWeight
|
|
384
|
-
}, errorMessage), Boolean(helpText) && (!isErrorState || !errorMessage) && /*#__PURE__*/React
|
|
384
|
+
}, errorMessage), Boolean(helpText) && (!isErrorState || !errorMessage) && /*#__PURE__*/React.createElement(Text, {
|
|
385
385
|
dataTestId: `${inputName}FieldMessageHelpText`,
|
|
386
386
|
className: "form-field__message-item form-field__message-item_type_help-text",
|
|
387
387
|
size: helpTextSize,
|
|
388
388
|
textColor: isValidState ? helpTextColorSuccess : helpTextColor,
|
|
389
389
|
textWeight: helpTextWeight,
|
|
390
390
|
sizeMobile: helpTextSizeMobile
|
|
391
|
-
}, helpText), (!isErrorState && !helpText || isErrorState && !helpText && !errorMessage) && /*#__PURE__*/React
|
|
391
|
+
}, helpText), (!isErrorState && !helpText || isErrorState && !helpText && !errorMessage) && /*#__PURE__*/React.createElement(Text, {
|
|
392
392
|
dataTestId: `${inputName}FieldMessageHelpText`,
|
|
393
393
|
className: "form-field__message-item form-field__message-item_type_help-text",
|
|
394
394
|
size: messageTextSize
|
|
@@ -407,7 +407,7 @@ function FieldWrapper(props) {
|
|
|
407
407
|
change(inputName, undefined);
|
|
408
408
|
};
|
|
409
409
|
}, []);
|
|
410
|
-
return /*#__PURE__*/React
|
|
410
|
+
return /*#__PURE__*/React.createElement(FieldWrapperBase, props);
|
|
411
411
|
}
|
|
412
412
|
|
|
413
413
|
const defaultDropzoneProps = {
|
|
@@ -431,7 +431,7 @@ const defaultDropzoneProps = {
|
|
|
431
431
|
isPreviews: true
|
|
432
432
|
};
|
|
433
433
|
|
|
434
|
-
const FileInputDropzone = /*#__PURE__*/React
|
|
434
|
+
const FileInputDropzone = /*#__PURE__*/React.memo(function FileInputDropzone(props) {
|
|
435
435
|
const {
|
|
436
436
|
className,
|
|
437
437
|
maxFiles,
|
|
@@ -614,85 +614,85 @@ const FileInputDropzone = /*#__PURE__*/React$1.memo(function FileInputDropzone(p
|
|
|
614
614
|
thumbNameTextWeight,
|
|
615
615
|
thumbNameTextWrap
|
|
616
616
|
} = propsGenerator;
|
|
617
|
-
return /*#__PURE__*/React
|
|
617
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", getRootProps({
|
|
618
618
|
className: `form-dropzone__dropzone dropzone ${className} form-dropzone__dropzone_size_${size} ${shapeClass}`
|
|
619
|
-
}), /*#__PURE__*/React
|
|
619
|
+
}), /*#__PURE__*/React.createElement("input", Object.assign({}, getInputProps(), {
|
|
620
620
|
name: inputName
|
|
621
|
-
})), /*#__PURE__*/React
|
|
621
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
622
622
|
className: clsx('form-dropzone__dropzone-wrapper', thumbColumn && `form-dropzone__dropzone-wrapper_column_${thumbColumn}`, fillClass, fillHoverClass, borderWidthClass, borderColorClass, borderColorHoverClass, borderTypeClass)
|
|
623
|
-
}, filesList.map((file, index) => /*#__PURE__*/React
|
|
623
|
+
}, filesList.map((file, index) => /*#__PURE__*/React.createElement("aside", {
|
|
624
624
|
className: clsx('form-dropzone__thumb', fillClass, thumbDirectionClass, thumbBorderWidthClass, thumbBorderColorClass, thumbBorderColorHoverClass, thumbBorderTypeClass),
|
|
625
625
|
key: file.id || `${file.name}_${index}`
|
|
626
|
-
}, isPreviews && !file.error && /*#__PURE__*/React
|
|
626
|
+
}, isPreviews && !file.error && /*#__PURE__*/React.createElement("div", {
|
|
627
627
|
className: "form-dropzone__thumb-image"
|
|
628
|
-
}, /*#__PURE__*/React
|
|
628
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
629
629
|
className: "form-dropzone__thumb-image-inner",
|
|
630
630
|
src: file.preview || file.image,
|
|
631
631
|
onLoad: () => {
|
|
632
632
|
// Revoke data uri after image is loaded
|
|
633
633
|
URL.revokeObjectURL(file.preview);
|
|
634
634
|
}
|
|
635
|
-
})), file.error && /*#__PURE__*/React
|
|
635
|
+
})), file.error && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Text, {
|
|
636
636
|
size: thumbNameTextSize,
|
|
637
637
|
textColor: thumbNameTextColor,
|
|
638
638
|
textWeight: thumbNameTextWeight,
|
|
639
639
|
textWrap: thumbNameTextWrap
|
|
640
|
-
}, fileErrorText || file.error)), showFilename && /*#__PURE__*/React
|
|
640
|
+
}, fileErrorText || file.error)), showFilename && /*#__PURE__*/React.createElement("div", {
|
|
641
641
|
className: "form-dropzone__thumb-name"
|
|
642
|
-
}, /*#__PURE__*/React
|
|
642
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
643
643
|
className: "form-dropzone__thumb-name-inner",
|
|
644
644
|
size: thumbNameTextSize,
|
|
645
645
|
textColor: thumbNameTextColor,
|
|
646
646
|
textWeight: thumbNameTextWeight,
|
|
647
647
|
textWrap: thumbNameTextWrap
|
|
648
|
-
}, file.name)), fileIsLoading && /*#__PURE__*/React
|
|
648
|
+
}, file.name)), fileIsLoading && /*#__PURE__*/React.createElement("div", {
|
|
649
649
|
className: "form-dropzone__thumb-loader"
|
|
650
|
-
}, /*#__PURE__*/React
|
|
650
|
+
}, /*#__PURE__*/React.createElement(Loader, {
|
|
651
651
|
width: "fill",
|
|
652
652
|
height: "fill",
|
|
653
653
|
fill: "surfacePrimary",
|
|
654
654
|
itemFill: "surfaceItemAccent",
|
|
655
655
|
set: "simple"
|
|
656
|
-
})), /*#__PURE__*/React
|
|
656
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
657
657
|
className: clsx('form-dropzone__thumb-remove')
|
|
658
|
-
}, /*#__PURE__*/React
|
|
658
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
659
659
|
className: "form-dropzone__thumb-remove-text",
|
|
660
660
|
appearance: removeThumbAppearance,
|
|
661
661
|
label: removeThumbText || 'Удалить',
|
|
662
662
|
labelTextWeight: removeThumbTextWeight,
|
|
663
663
|
shape: removeThumbShape,
|
|
664
664
|
onClick: event => removeFile(event, index)
|
|
665
|
-
})))), !filesList.length ? /*#__PURE__*/React
|
|
665
|
+
})))), !filesList.length ? /*#__PURE__*/React.createElement("div", {
|
|
666
666
|
className: "form-dropzone__hint"
|
|
667
|
-
}, /*#__PURE__*/React
|
|
667
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
668
668
|
className: "form-dropzone__hint-title",
|
|
669
669
|
size: hintTitleTextSize,
|
|
670
670
|
textColor: hintTitleTextColor,
|
|
671
671
|
textWeight: hintTitleTextWeight,
|
|
672
672
|
textWrap: hintTitleTextWrap
|
|
673
|
-
}, hintTitle || 'Select a file or drag in form'), hintDescription && /*#__PURE__*/React
|
|
673
|
+
}, hintTitle || 'Select a file or drag in form'), hintDescription && /*#__PURE__*/React.createElement(Text, {
|
|
674
674
|
className: "form-dropzone__hint-text",
|
|
675
675
|
size: hintDescriptionTextSize,
|
|
676
676
|
textColor: hintDescriptionTextColor,
|
|
677
677
|
textWeight: hintDescriptionTextWeight,
|
|
678
678
|
textWrap: hintDescriptionTextWrap
|
|
679
|
-
}, hintDescription)) : /*#__PURE__*/React
|
|
679
|
+
}, hintDescription)) : /*#__PURE__*/React.createElement("div", {
|
|
680
680
|
className: "form-dropzone__hint form-dropzone__hint_type_add-more"
|
|
681
|
-
}, /*#__PURE__*/React
|
|
681
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
682
682
|
className: "form-dropzone__hint-title",
|
|
683
683
|
size: hintTitleTextSize,
|
|
684
684
|
textColor: hintTitleTextColor,
|
|
685
685
|
textWeight: hintTitleTextWeight,
|
|
686
686
|
textWrap: hintTitleTextWrap
|
|
687
|
-
}, hintTitle || 'Select a file or drag in form'), hintDescription && /*#__PURE__*/React
|
|
687
|
+
}, hintTitle || 'Select a file or drag in form'), hintDescription && /*#__PURE__*/React.createElement(Text, {
|
|
688
688
|
className: "form-dropzone__hint-text",
|
|
689
689
|
size: hintDescriptionTextSize,
|
|
690
690
|
textColor: hintDescriptionTextColor,
|
|
691
691
|
textWeight: hintDescriptionTextWeight,
|
|
692
692
|
textWrap: hintDescriptionTextWrap
|
|
693
|
-
}, hintDescription)))), fileError && /*#__PURE__*/React
|
|
693
|
+
}, hintDescription)))), fileError && /*#__PURE__*/React.createElement("div", {
|
|
694
694
|
className: "form-field__message"
|
|
695
|
-
}, /*#__PURE__*/React
|
|
695
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
696
696
|
className: "form-field__message-item form-field__message-item_type_message",
|
|
697
697
|
size: errorMessageTextSize,
|
|
698
698
|
textColor: errorMessageTextColor,
|
|
@@ -771,7 +771,7 @@ function setFileDataURL(file, resolve) {
|
|
|
771
771
|
}
|
|
772
772
|
}
|
|
773
773
|
|
|
774
|
-
const FileInput = /*#__PURE__*/React
|
|
774
|
+
const FileInput = /*#__PURE__*/React.memo(function FileInput(props) {
|
|
775
775
|
const {
|
|
776
776
|
className,
|
|
777
777
|
name,
|
|
@@ -828,7 +828,7 @@ const FileInput = /*#__PURE__*/React$1.memo(function FileInput(props) {
|
|
|
828
828
|
thumbNameTextWeight,
|
|
829
829
|
thumbNameTextWrap
|
|
830
830
|
} = propsGenerator;
|
|
831
|
-
return /*#__PURE__*/React
|
|
831
|
+
return /*#__PURE__*/React.createElement(Field, {
|
|
832
832
|
name: name
|
|
833
833
|
}, function Render({
|
|
834
834
|
input,
|
|
@@ -859,7 +859,7 @@ const FileInput = /*#__PURE__*/React$1.memo(function FileInput(props) {
|
|
|
859
859
|
/** TODO:
|
|
860
860
|
* REFACTOR PROPERTIES
|
|
861
861
|
*/
|
|
862
|
-
return /*#__PURE__*/React
|
|
862
|
+
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
863
863
|
className: clsx('form-field_type_dropzone', 'form__item_type_dropzone', classNameGroupItem),
|
|
864
864
|
width: width,
|
|
865
865
|
label: label,
|
|
@@ -876,7 +876,7 @@ const FileInput = /*#__PURE__*/React$1.memo(function FileInput(props) {
|
|
|
876
876
|
showMessage: showMessage,
|
|
877
877
|
isRequired: isRequired,
|
|
878
878
|
isValidState: isValidState
|
|
879
|
-
}, fieldProps), /*#__PURE__*/React
|
|
879
|
+
}, fieldProps), /*#__PURE__*/React.createElement(FileInputDropzone, {
|
|
880
880
|
className: className,
|
|
881
881
|
maxFiles: maxFiles,
|
|
882
882
|
maxSize: maxSize,
|
|
@@ -936,7 +936,7 @@ const defaultGroupProps = {
|
|
|
936
936
|
labelTextWeight: 500
|
|
937
937
|
};
|
|
938
938
|
|
|
939
|
-
const FormBlockGroup = /*#__PURE__*/React
|
|
939
|
+
const FormBlockGroup = /*#__PURE__*/React.memo(function Group(props) {
|
|
940
940
|
const {
|
|
941
941
|
className,
|
|
942
942
|
name,
|
|
@@ -960,7 +960,7 @@ const FormBlockGroup = /*#__PURE__*/React$1.memo(function Group(props) {
|
|
|
960
960
|
isHidden,
|
|
961
961
|
children
|
|
962
962
|
} = props;
|
|
963
|
-
return /*#__PURE__*/React
|
|
963
|
+
return /*#__PURE__*/React.createElement(Field, {
|
|
964
964
|
name: name
|
|
965
965
|
}, function Render({
|
|
966
966
|
input,
|
|
@@ -986,37 +986,37 @@ const FormBlockGroup = /*#__PURE__*/React$1.memo(function Group(props) {
|
|
|
986
986
|
inputProps: props,
|
|
987
987
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
988
988
|
});
|
|
989
|
-
return /*#__PURE__*/React
|
|
989
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
990
990
|
className: clsx('form__group', className, isHidden && 'form__group_hidden', column && `form__group_column_${column}`),
|
|
991
991
|
"data-tour": dataTour
|
|
992
|
-
}, /*#__PURE__*/React
|
|
992
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
993
993
|
className: "form__group-wrapper"
|
|
994
|
-
}, before, title && /*#__PURE__*/React
|
|
994
|
+
}, before, title && /*#__PURE__*/React.createElement("div", {
|
|
995
995
|
className: "form__group-title"
|
|
996
|
-
}, /*#__PURE__*/React
|
|
996
|
+
}, /*#__PURE__*/React.createElement(Title, {
|
|
997
997
|
size: titleTextSize,
|
|
998
998
|
textColor: titleTextColor,
|
|
999
999
|
textWeight: titleTextWeight
|
|
1000
|
-
}, title)), label && /*#__PURE__*/React
|
|
1000
|
+
}, title)), label && /*#__PURE__*/React.createElement("div", {
|
|
1001
1001
|
className: "form__group-label"
|
|
1002
|
-
}, /*#__PURE__*/React
|
|
1002
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
1003
1003
|
size: labelTextSize,
|
|
1004
1004
|
textColor: labelTextColor,
|
|
1005
1005
|
textWeight: labelTextWeight
|
|
1006
|
-
}, label)), /*#__PURE__*/React
|
|
1006
|
+
}, label)), /*#__PURE__*/React.createElement("div", {
|
|
1007
1007
|
className: "form__group-items"
|
|
1008
|
-
}, children), after), showGroupMessage && /*#__PURE__*/React
|
|
1008
|
+
}, children), after), showGroupMessage && /*#__PURE__*/React.createElement(React.Fragment, null, isErrorState && errorMessage && /*#__PURE__*/React.createElement(Text, {
|
|
1009
1009
|
className: `form__group-message form__group-message_type-${errorKey}`,
|
|
1010
1010
|
id: `${name}-error`,
|
|
1011
1011
|
size: updatedProps.messageTextSize,
|
|
1012
1012
|
textColor: updatedProps.messageTextColor,
|
|
1013
1013
|
textWeight: updatedProps.messageTextWeight
|
|
1014
|
-
}, errorMessage), Boolean(message) && (!isErrorState || !errorMessage) && /*#__PURE__*/React
|
|
1014
|
+
}, errorMessage), Boolean(message) && (!isErrorState || !errorMessage) && /*#__PURE__*/React.createElement(Text, {
|
|
1015
1015
|
className: "form__group-message",
|
|
1016
1016
|
size: messageTextSize,
|
|
1017
1017
|
textColor: messageTextColor,
|
|
1018
1018
|
textWeight: messageTextWeight
|
|
1019
|
-
}, message), !isErrorState && !message && /*#__PURE__*/React
|
|
1019
|
+
}, message), !isErrorState && !message && /*#__PURE__*/React.createElement(Text, {
|
|
1020
1020
|
className: "form__group-message",
|
|
1021
1021
|
size: messageTextSize
|
|
1022
1022
|
}, '\u00A0')));
|
|
@@ -1035,7 +1035,7 @@ const defaultCheckboxProps = {
|
|
|
1035
1035
|
requiredBorderColor: 'warningBorderSecondary'
|
|
1036
1036
|
};
|
|
1037
1037
|
|
|
1038
|
-
const FormFieldCheckbox = /*#__PURE__*/React
|
|
1038
|
+
const FormFieldCheckbox = /*#__PURE__*/React.memo(function FormFieldCheckbox(props) {
|
|
1039
1039
|
const {
|
|
1040
1040
|
name,
|
|
1041
1041
|
initialValue,
|
|
@@ -1047,7 +1047,7 @@ const FormFieldCheckbox = /*#__PURE__*/React$1.memo(function FormFieldCheckbox(p
|
|
|
1047
1047
|
isRequired,
|
|
1048
1048
|
onChange
|
|
1049
1049
|
} = props;
|
|
1050
|
-
return /*#__PURE__*/React
|
|
1050
|
+
return /*#__PURE__*/React.createElement(Field, {
|
|
1051
1051
|
type: "checkbox",
|
|
1052
1052
|
name: name,
|
|
1053
1053
|
initialValue: initialValue
|
|
@@ -1082,7 +1082,7 @@ const FormFieldCheckbox = /*#__PURE__*/React$1.memo(function FormFieldCheckbox(p
|
|
|
1082
1082
|
inputProps: inputProps,
|
|
1083
1083
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
1084
1084
|
});
|
|
1085
|
-
return /*#__PURE__*/React
|
|
1085
|
+
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
1086
1086
|
className: clsx('form-field_type_checkbox', 'form__item_type_checkbox', classNameGroupItem),
|
|
1087
1087
|
errorKey: errorKey,
|
|
1088
1088
|
errorMessage: errorMessage,
|
|
@@ -1097,7 +1097,7 @@ const FormFieldCheckbox = /*#__PURE__*/React$1.memo(function FormFieldCheckbox(p
|
|
|
1097
1097
|
tag: "label",
|
|
1098
1098
|
isRequired: isRequired,
|
|
1099
1099
|
isValidState: isValidState
|
|
1100
|
-
}, fieldProps), /*#__PURE__*/React
|
|
1100
|
+
}, fieldProps), /*#__PURE__*/React.createElement(Checkbox, Object.assign({
|
|
1101
1101
|
type: "checkbox",
|
|
1102
1102
|
name: input.name,
|
|
1103
1103
|
isDisabled: isDisabled,
|
|
@@ -1148,7 +1148,7 @@ function FormFieldChips(props) {
|
|
|
1148
1148
|
// update the form value only when the initialValue changes, so use disable eslint to ignore the warning
|
|
1149
1149
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1150
1150
|
}, [initialValue]);
|
|
1151
|
-
return /*#__PURE__*/React
|
|
1151
|
+
return /*#__PURE__*/React.createElement(Field, {
|
|
1152
1152
|
name: name,
|
|
1153
1153
|
initialValue: initialValue
|
|
1154
1154
|
}, function Render({
|
|
@@ -1180,7 +1180,7 @@ function FormFieldChips(props) {
|
|
|
1180
1180
|
}
|
|
1181
1181
|
return emptyOptionsList;
|
|
1182
1182
|
}, [input.value]);
|
|
1183
|
-
return /*#__PURE__*/React
|
|
1183
|
+
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
1184
1184
|
className: clsx('form-field_type_chips', 'form__item_type_chips', classNameGroupItem),
|
|
1185
1185
|
errorKey: errorKey,
|
|
1186
1186
|
errorMessage: errorMessage,
|
|
@@ -1194,11 +1194,11 @@ function FormFieldChips(props) {
|
|
|
1194
1194
|
showMessage: showMessage,
|
|
1195
1195
|
isRequired: isRequired,
|
|
1196
1196
|
isValidState: isValidState
|
|
1197
|
-
}, fieldProps), options.length ? /*#__PURE__*/React
|
|
1197
|
+
}, fieldProps), options.length ? /*#__PURE__*/React.createElement(ChipsGroup, {
|
|
1198
1198
|
direction: "horizontal",
|
|
1199
1199
|
gap: "1m",
|
|
1200
1200
|
wrap: "wrap"
|
|
1201
|
-
}, options.map(option => /*#__PURE__*/React
|
|
1201
|
+
}, options.map(option => /*#__PURE__*/React.createElement(Chips, Object.assign({
|
|
1202
1202
|
className: clsx(meta.active && 'form-chips_state_focus', meta.error && meta.touched && `form-chips_state_${errorKey}`),
|
|
1203
1203
|
key: option.value,
|
|
1204
1204
|
label: option.label,
|
|
@@ -1206,7 +1206,7 @@ function FormFieldChips(props) {
|
|
|
1206
1206
|
value: option.value,
|
|
1207
1207
|
isActive: activeOptionsList.some(activeOption => activeOption.value === option.value),
|
|
1208
1208
|
onClick: () => onChangeSomeInput(input.value, option.value)
|
|
1209
|
-
}, updatedInputProps)))) : /*#__PURE__*/React
|
|
1209
|
+
}, updatedInputProps)))) : /*#__PURE__*/React.createElement(Text, {
|
|
1210
1210
|
size: emptyMessageTextSize,
|
|
1211
1211
|
textColor: emptyMessageTextColor
|
|
1212
1212
|
}, emptyMessage));
|
|
@@ -1220,7 +1220,7 @@ const defaultChoiceProps = {
|
|
|
1220
1220
|
requiredBorderColor: 'warningBorderPrimary'
|
|
1221
1221
|
};
|
|
1222
1222
|
|
|
1223
|
-
const FormFieldChoice = /*#__PURE__*/React
|
|
1223
|
+
const FormFieldChoice = /*#__PURE__*/React.memo(function FormFieldChoice(props) {
|
|
1224
1224
|
const {
|
|
1225
1225
|
name,
|
|
1226
1226
|
initialValue,
|
|
@@ -1246,7 +1246,7 @@ const FormFieldChoice = /*#__PURE__*/React$1.memo(function FormFieldChoice(props
|
|
|
1246
1246
|
onChange(option.value, name, isChecked);
|
|
1247
1247
|
}
|
|
1248
1248
|
}, [change, onChange]);
|
|
1249
|
-
return /*#__PURE__*/React
|
|
1249
|
+
return /*#__PURE__*/React.createElement(Field, {
|
|
1250
1250
|
initialValue: initialValue,
|
|
1251
1251
|
name: name
|
|
1252
1252
|
}, function Render({
|
|
@@ -1284,7 +1284,7 @@ const FormFieldChoice = /*#__PURE__*/React$1.memo(function FormFieldChoice(props
|
|
|
1284
1284
|
inputProps: inputProps,
|
|
1285
1285
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
1286
1286
|
});
|
|
1287
|
-
return /*#__PURE__*/React
|
|
1287
|
+
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
1288
1288
|
className: clsx('form-field_type_choice', 'form__item_type_choice', classNameGroupItem),
|
|
1289
1289
|
label: label,
|
|
1290
1290
|
errorKey: errorKey,
|
|
@@ -1300,7 +1300,7 @@ const FormFieldChoice = /*#__PURE__*/React$1.memo(function FormFieldChoice(props
|
|
|
1300
1300
|
showMessage: showMessage,
|
|
1301
1301
|
isRequired: isRequired,
|
|
1302
1302
|
isValidState: isValidState
|
|
1303
|
-
}, fieldProps), /*#__PURE__*/React
|
|
1303
|
+
}, fieldProps), /*#__PURE__*/React.createElement(Choice, Object.assign({
|
|
1304
1304
|
className: clsx(meta.active && 'form-choice_state_focus', meta.error && meta.touched && `form-choice_state_${errorKey}`),
|
|
1305
1305
|
name: input.name,
|
|
1306
1306
|
isDisabled: isDisabled,
|
|
@@ -1319,7 +1319,7 @@ const defaultCodeProps = {
|
|
|
1319
1319
|
appearance: 'defaultPrimary sizeL solid rounded'
|
|
1320
1320
|
};
|
|
1321
1321
|
|
|
1322
|
-
const FormFieldCode = /*#__PURE__*/React
|
|
1322
|
+
const FormFieldCode = /*#__PURE__*/React.memo(function FormFieldCode(props) {
|
|
1323
1323
|
const {
|
|
1324
1324
|
name,
|
|
1325
1325
|
initialValue,
|
|
@@ -1330,7 +1330,7 @@ const FormFieldCode = /*#__PURE__*/React$1.memo(function FormFieldCode(props) {
|
|
|
1330
1330
|
showMessage,
|
|
1331
1331
|
isRequired
|
|
1332
1332
|
} = props;
|
|
1333
|
-
return /*#__PURE__*/React
|
|
1333
|
+
return /*#__PURE__*/React.createElement(Field, {
|
|
1334
1334
|
name: name,
|
|
1335
1335
|
initialValue: initialValue
|
|
1336
1336
|
}, function Render({
|
|
@@ -1356,7 +1356,7 @@ const FormFieldCode = /*#__PURE__*/React$1.memo(function FormFieldCode(props) {
|
|
|
1356
1356
|
inputProps: inputProps,
|
|
1357
1357
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
1358
1358
|
});
|
|
1359
|
-
return /*#__PURE__*/React
|
|
1359
|
+
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
1360
1360
|
className: clsx('form-field_type_code', 'form__item_type_code', classNameGroupItem),
|
|
1361
1361
|
fieldClassName: 'form-code',
|
|
1362
1362
|
inputName: input.name,
|
|
@@ -1365,7 +1365,7 @@ const FormFieldCode = /*#__PURE__*/React$1.memo(function FormFieldCode(props) {
|
|
|
1365
1365
|
showMessage: showMessage,
|
|
1366
1366
|
isRequired: isRequired,
|
|
1367
1367
|
isValidState: isValidState
|
|
1368
|
-
}, fieldProps), /*#__PURE__*/React
|
|
1368
|
+
}, fieldProps), /*#__PURE__*/React.createElement(Code, Object.assign({
|
|
1369
1369
|
name: input.name,
|
|
1370
1370
|
isDisabled: isDisabled,
|
|
1371
1371
|
autoComplete: "nope",
|
|
@@ -1377,7 +1377,7 @@ const FormFieldCode = /*#__PURE__*/React$1.memo(function FormFieldCode(props) {
|
|
|
1377
1377
|
});
|
|
1378
1378
|
});
|
|
1379
1379
|
|
|
1380
|
-
const FormFieldCustom = /*#__PURE__*/React
|
|
1380
|
+
const FormFieldCustom = /*#__PURE__*/React.memo(function FormFieldCustom(props) {
|
|
1381
1381
|
const {
|
|
1382
1382
|
Component,
|
|
1383
1383
|
isDisabled,
|
|
@@ -1394,7 +1394,7 @@ const FormFieldCustom = /*#__PURE__*/React$1.memo(function FormFieldCustom(props
|
|
|
1394
1394
|
clearIconSize,
|
|
1395
1395
|
onClickClearIcon
|
|
1396
1396
|
} = props;
|
|
1397
|
-
return /*#__PURE__*/React
|
|
1397
|
+
return /*#__PURE__*/React.createElement(Field, {
|
|
1398
1398
|
initialValue: initialValue,
|
|
1399
1399
|
name: name
|
|
1400
1400
|
}, function Render({
|
|
@@ -1423,7 +1423,7 @@ const FormFieldCustom = /*#__PURE__*/React$1.memo(function FormFieldCustom(props
|
|
|
1423
1423
|
// For "Custom" field we pass all props. Can contain some special props, we don't known.
|
|
1424
1424
|
inputProps: props
|
|
1425
1425
|
});
|
|
1426
|
-
return /*#__PURE__*/React
|
|
1426
|
+
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
1427
1427
|
className: clsx('form-field_type_custom', 'form__item_type_custom', classNameGroupItem),
|
|
1428
1428
|
errorKey: errorKey,
|
|
1429
1429
|
errorMessage: errorMessage,
|
|
@@ -1437,11 +1437,11 @@ const FormFieldCustom = /*#__PURE__*/React$1.memo(function FormFieldCustom(props
|
|
|
1437
1437
|
metaActive: meta.active,
|
|
1438
1438
|
metaError: meta.error,
|
|
1439
1439
|
showMessage: showMessage
|
|
1440
|
-
}, fieldProps), /*#__PURE__*/React
|
|
1440
|
+
}, fieldProps), /*#__PURE__*/React.createElement(Component, Object.assign({}, updatedInputProps, {
|
|
1441
1441
|
input: input,
|
|
1442
1442
|
isDisabled: isDisabled,
|
|
1443
1443
|
meta: meta
|
|
1444
|
-
})), clearIcon && /*#__PURE__*/React
|
|
1444
|
+
})), clearIcon && /*#__PURE__*/React.createElement(Icon, {
|
|
1445
1445
|
className: "form-field__icon",
|
|
1446
1446
|
iconFill: clearIconFill,
|
|
1447
1447
|
iconFillHover: clearIconFillHover,
|
|
@@ -1479,7 +1479,7 @@ function FormFieldDatePicker(props) {
|
|
|
1479
1479
|
isRequired,
|
|
1480
1480
|
onChange
|
|
1481
1481
|
} = props;
|
|
1482
|
-
return /*#__PURE__*/React
|
|
1482
|
+
return /*#__PURE__*/React.createElement(Field, {
|
|
1483
1483
|
name: name
|
|
1484
1484
|
}, function Render({
|
|
1485
1485
|
input,
|
|
@@ -1522,7 +1522,7 @@ function FormFieldDatePicker(props) {
|
|
|
1522
1522
|
inputProps: inputProps,
|
|
1523
1523
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
1524
1524
|
});
|
|
1525
|
-
return /*#__PURE__*/React
|
|
1525
|
+
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
1526
1526
|
className: clsx('form-field_type_datepicker', 'form__item_type_datepicker', classNameGroupItem),
|
|
1527
1527
|
errorKey: errorKey,
|
|
1528
1528
|
errorMessage: errorMessage,
|
|
@@ -1536,7 +1536,7 @@ function FormFieldDatePicker(props) {
|
|
|
1536
1536
|
showMessage: showMessage,
|
|
1537
1537
|
isRequired: isRequired,
|
|
1538
1538
|
isValidState: isValidState
|
|
1539
|
-
}, fieldProps), /*#__PURE__*/React
|
|
1539
|
+
}, fieldProps), /*#__PURE__*/React.createElement(DatePickerInput, {
|
|
1540
1540
|
name: input.name,
|
|
1541
1541
|
isDisabled: isDisabled,
|
|
1542
1542
|
datePickerProps: datePickerProps,
|
|
@@ -1557,7 +1557,7 @@ const defaultInputProps = {
|
|
|
1557
1557
|
requiredBorderColor: 'warningBorderSecondary'
|
|
1558
1558
|
};
|
|
1559
1559
|
|
|
1560
|
-
const FormFieldInput = /*#__PURE__*/React
|
|
1560
|
+
const FormFieldInput = /*#__PURE__*/React.memo(function FormFieldInput(props) {
|
|
1561
1561
|
const {
|
|
1562
1562
|
name,
|
|
1563
1563
|
initialValue,
|
|
@@ -1579,7 +1579,7 @@ const FormFieldInput = /*#__PURE__*/React$1.memo(function FormFieldInput(props)
|
|
|
1579
1579
|
onChange,
|
|
1580
1580
|
onClickClearIcon
|
|
1581
1581
|
} = props;
|
|
1582
|
-
return /*#__PURE__*/React
|
|
1582
|
+
return /*#__PURE__*/React.createElement(Field, {
|
|
1583
1583
|
name: name,
|
|
1584
1584
|
initialValue: initialValue,
|
|
1585
1585
|
parse: parse
|
|
@@ -1614,7 +1614,7 @@ const FormFieldInput = /*#__PURE__*/React$1.memo(function FormFieldInput(props)
|
|
|
1614
1614
|
inputProps: inputProps,
|
|
1615
1615
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
1616
1616
|
});
|
|
1617
|
-
return /*#__PURE__*/React
|
|
1617
|
+
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
1618
1618
|
className: clsx('form-field_type_input', 'form__item_type_input', classNameGroupItem),
|
|
1619
1619
|
errorKey: errorKey,
|
|
1620
1620
|
errorMessage: errorMessage,
|
|
@@ -1628,7 +1628,7 @@ const FormFieldInput = /*#__PURE__*/React$1.memo(function FormFieldInput(props)
|
|
|
1628
1628
|
showMessage: showMessage,
|
|
1629
1629
|
isRequired: isRequired,
|
|
1630
1630
|
isValidState: isValidState
|
|
1631
|
-
}, fieldProps), /*#__PURE__*/React
|
|
1631
|
+
}, fieldProps), /*#__PURE__*/React.createElement(Input, Object.assign({
|
|
1632
1632
|
dataTestId: `${input.name}FieldInput`,
|
|
1633
1633
|
className: clsx(meta.active && 'input_state_focus', meta.error && meta.touched && `input_state_${errorKey}`),
|
|
1634
1634
|
type: "text",
|
|
@@ -1639,7 +1639,7 @@ const FormFieldInput = /*#__PURE__*/React$1.memo(function FormFieldInput(props)
|
|
|
1639
1639
|
onBlur: input.onBlur,
|
|
1640
1640
|
onChange: onChangeField,
|
|
1641
1641
|
onFocus: input.onFocus
|
|
1642
|
-
}, updatedInputProps)), clearIcon && /*#__PURE__*/React
|
|
1642
|
+
}, updatedInputProps)), clearIcon && /*#__PURE__*/React.createElement(Icon, {
|
|
1643
1643
|
className: "form-field__icon",
|
|
1644
1644
|
size: clearIconSize,
|
|
1645
1645
|
iconFill: clearIconFill,
|
|
@@ -1659,19 +1659,13 @@ const defaultPasswordProps = {
|
|
|
1659
1659
|
iconFill: 'surfaceItemQuaternary'
|
|
1660
1660
|
};
|
|
1661
1661
|
|
|
1662
|
-
const FormFieldPassword = /*#__PURE__*/React
|
|
1662
|
+
const FormFieldPassword = /*#__PURE__*/React.memo(function FormFieldPassword(props) {
|
|
1663
1663
|
const {
|
|
1664
1664
|
name,
|
|
1665
1665
|
initialValue,
|
|
1666
1666
|
isDisabled,
|
|
1667
1667
|
classNameGroupItem,
|
|
1668
1668
|
fieldProps,
|
|
1669
|
-
iconFill,
|
|
1670
|
-
iconFillHover,
|
|
1671
|
-
iconRevealableHide,
|
|
1672
|
-
iconRevealableShow,
|
|
1673
|
-
iconShape,
|
|
1674
|
-
iconSize,
|
|
1675
1669
|
inputProps,
|
|
1676
1670
|
parse,
|
|
1677
1671
|
showMessage,
|
|
@@ -1686,7 +1680,7 @@ const FormFieldPassword = /*#__PURE__*/React$1.memo(function FormFieldPassword(p
|
|
|
1686
1680
|
event.preventDefault();
|
|
1687
1681
|
setIsRevealed(prev => !prev);
|
|
1688
1682
|
}, []);
|
|
1689
|
-
return /*#__PURE__*/React
|
|
1683
|
+
return /*#__PURE__*/React.createElement(Field, {
|
|
1690
1684
|
name: name,
|
|
1691
1685
|
initialValue: initialValue,
|
|
1692
1686
|
parse: parse
|
|
@@ -1708,10 +1702,10 @@ const FormFieldPassword = /*#__PURE__*/React$1.memo(function FormFieldPassword(p
|
|
|
1708
1702
|
}
|
|
1709
1703
|
}, [onChange, input.onChange]);
|
|
1710
1704
|
const {
|
|
1711
|
-
isErrorState,
|
|
1712
|
-
isValidState,
|
|
1713
1705
|
errorKey,
|
|
1714
|
-
errorMessage
|
|
1706
|
+
errorMessage,
|
|
1707
|
+
isErrorState,
|
|
1708
|
+
isValidState
|
|
1715
1709
|
} = useFieldValidationState({
|
|
1716
1710
|
fieldProps: fieldProps,
|
|
1717
1711
|
input: input,
|
|
@@ -1721,7 +1715,7 @@ const FormFieldPassword = /*#__PURE__*/React$1.memo(function FormFieldPassword(p
|
|
|
1721
1715
|
inputProps: inputProps,
|
|
1722
1716
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
1723
1717
|
});
|
|
1724
|
-
return /*#__PURE__*/React
|
|
1718
|
+
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
1725
1719
|
className: clsx('form-field_type_input', 'form__item_type_input', classNameGroupItem),
|
|
1726
1720
|
errorKey: errorKey,
|
|
1727
1721
|
errorMessage: errorMessage,
|
|
@@ -1735,7 +1729,7 @@ const FormFieldPassword = /*#__PURE__*/React$1.memo(function FormFieldPassword(p
|
|
|
1735
1729
|
showMessage: showMessage,
|
|
1736
1730
|
isRequired: isRequired,
|
|
1737
1731
|
isValidState: isValidState
|
|
1738
|
-
}, fieldProps), /*#__PURE__*/React
|
|
1732
|
+
}, fieldProps), /*#__PURE__*/React.createElement(Input, Object.assign({
|
|
1739
1733
|
dataTestId: `${input.name}FieldInputPassword`,
|
|
1740
1734
|
className: clsx(meta.active && 'input_state_focus', meta.error && meta.touched && `input_state_${errorKey}`),
|
|
1741
1735
|
type: inputType,
|
|
@@ -1746,11 +1740,11 @@ const FormFieldPassword = /*#__PURE__*/React$1.memo(function FormFieldPassword(p
|
|
|
1746
1740
|
onBlur: input.onBlur,
|
|
1747
1741
|
onChange: onChangeField,
|
|
1748
1742
|
onFocus: input.onFocus
|
|
1749
|
-
}, updatedInputProps)), /*#__PURE__*/React
|
|
1743
|
+
}, updatedInputProps)), /*#__PURE__*/React.createElement(Icon, {
|
|
1750
1744
|
className: "form-field__icon",
|
|
1751
|
-
size: inputProps
|
|
1752
|
-
iconFill: inputProps
|
|
1753
|
-
SvgImage: isRevealed ? inputProps
|
|
1745
|
+
size: inputProps?.iconSize,
|
|
1746
|
+
iconFill: inputProps?.iconFill,
|
|
1747
|
+
SvgImage: isRevealed ? inputProps?.iconRevealableHide : inputProps?.iconRevealableShow,
|
|
1754
1748
|
onClick: onClickIconReveal
|
|
1755
1749
|
}));
|
|
1756
1750
|
});
|
|
@@ -1779,7 +1773,7 @@ function FormFieldSegmented(props) {
|
|
|
1779
1773
|
const setActiveSegment = useCallback(option => {
|
|
1780
1774
|
change(name, option.value);
|
|
1781
1775
|
}, [change]);
|
|
1782
|
-
return /*#__PURE__*/React
|
|
1776
|
+
return /*#__PURE__*/React.createElement(Field, {
|
|
1783
1777
|
name: name
|
|
1784
1778
|
}, function Render({
|
|
1785
1779
|
input,
|
|
@@ -1817,7 +1811,7 @@ function FormFieldSegmented(props) {
|
|
|
1817
1811
|
inputProps: inputProps,
|
|
1818
1812
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
1819
1813
|
});
|
|
1820
|
-
return /*#__PURE__*/React
|
|
1814
|
+
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
1821
1815
|
className: clsx('form-field_type_segmented', 'form__item_type_segmented'),
|
|
1822
1816
|
errorKey: errorKey,
|
|
1823
1817
|
errorMessage: errorMessage,
|
|
@@ -1831,7 +1825,7 @@ function FormFieldSegmented(props) {
|
|
|
1831
1825
|
showMessage: showMessage,
|
|
1832
1826
|
isRequired: isRequired,
|
|
1833
1827
|
isValidState: isValidState
|
|
1834
|
-
}, fieldProps), /*#__PURE__*/React
|
|
1828
|
+
}, fieldProps), /*#__PURE__*/React.createElement(Segmented, Object.assign({
|
|
1835
1829
|
isDisabled: isDisabled,
|
|
1836
1830
|
activeSegment: activeOption,
|
|
1837
1831
|
segments: options,
|
|
@@ -1862,7 +1856,7 @@ function getDefaultValue(options, selectValue) {
|
|
|
1862
1856
|
});
|
|
1863
1857
|
return result;
|
|
1864
1858
|
}
|
|
1865
|
-
const FormFieldSelect = /*#__PURE__*/React
|
|
1859
|
+
const FormFieldSelect = /*#__PURE__*/React.memo(function FormFieldSelect(props) {
|
|
1866
1860
|
const {
|
|
1867
1861
|
isDisabled,
|
|
1868
1862
|
isRequired,
|
|
@@ -1877,7 +1871,7 @@ const FormFieldSelect = /*#__PURE__*/React$1.memo(function FormFieldSelect(props
|
|
|
1877
1871
|
onChange,
|
|
1878
1872
|
onInputChange
|
|
1879
1873
|
} = props;
|
|
1880
|
-
return /*#__PURE__*/React
|
|
1874
|
+
return /*#__PURE__*/React.createElement(Field, {
|
|
1881
1875
|
name: name,
|
|
1882
1876
|
initialValue: initialValue
|
|
1883
1877
|
}, function Render({
|
|
@@ -1929,7 +1923,7 @@ const FormFieldSelect = /*#__PURE__*/React$1.memo(function FormFieldSelect(props
|
|
|
1929
1923
|
inputProps: selectProps,
|
|
1930
1924
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
1931
1925
|
});
|
|
1932
|
-
return /*#__PURE__*/React
|
|
1926
|
+
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
1933
1927
|
className: clsx('form-field_type_select', 'form__item_type_select', classNameGroupItem),
|
|
1934
1928
|
errorKey: errorKey,
|
|
1935
1929
|
errorMessage: errorMessage,
|
|
@@ -1943,7 +1937,7 @@ const FormFieldSelect = /*#__PURE__*/React$1.memo(function FormFieldSelect(props
|
|
|
1943
1937
|
showMessage: showMessage,
|
|
1944
1938
|
isRequired: isRequired,
|
|
1945
1939
|
isValidState: isValidState
|
|
1946
|
-
}, fieldProps), /*#__PURE__*/React
|
|
1940
|
+
}, fieldProps), /*#__PURE__*/React.createElement(Select, Object.assign({
|
|
1947
1941
|
className: "form-select-item",
|
|
1948
1942
|
ref: selectRef,
|
|
1949
1943
|
isDisabled: isDisabled,
|
|
@@ -1960,7 +1954,7 @@ const defaultSwitchProps = {
|
|
|
1960
1954
|
appearance: 'defaultPrimary sizeL solid rounded'
|
|
1961
1955
|
};
|
|
1962
1956
|
|
|
1963
|
-
const FormFieldSwitch = /*#__PURE__*/React
|
|
1957
|
+
const FormFieldSwitch = /*#__PURE__*/React.memo(function FormFieldSwitch(props) {
|
|
1964
1958
|
const {
|
|
1965
1959
|
name,
|
|
1966
1960
|
isDisabled,
|
|
@@ -1971,7 +1965,7 @@ const FormFieldSwitch = /*#__PURE__*/React$1.memo(function FormFieldSwitch(props
|
|
|
1971
1965
|
isRequired,
|
|
1972
1966
|
onChange
|
|
1973
1967
|
} = props;
|
|
1974
|
-
return /*#__PURE__*/React
|
|
1968
|
+
return /*#__PURE__*/React.createElement(Field, {
|
|
1975
1969
|
type: "checkbox",
|
|
1976
1970
|
name: name
|
|
1977
1971
|
}, function Render({
|
|
@@ -2005,7 +1999,7 @@ const FormFieldSwitch = /*#__PURE__*/React$1.memo(function FormFieldSwitch(props
|
|
|
2005
1999
|
inputProps: inputProps,
|
|
2006
2000
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
2007
2001
|
});
|
|
2008
|
-
return /*#__PURE__*/React
|
|
2002
|
+
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
2009
2003
|
className: clsx('form-field_type_switch', 'form__item_type_switch', classNameGroupItem),
|
|
2010
2004
|
errorKey: errorKey,
|
|
2011
2005
|
errorMessage: errorMessage,
|
|
@@ -2020,7 +2014,7 @@ const FormFieldSwitch = /*#__PURE__*/React$1.memo(function FormFieldSwitch(props
|
|
|
2020
2014
|
tag: "label",
|
|
2021
2015
|
isRequired: isRequired,
|
|
2022
2016
|
isValidState: isValidState
|
|
2023
|
-
}, fieldProps), /*#__PURE__*/React
|
|
2017
|
+
}, fieldProps), /*#__PURE__*/React.createElement(Switch, Object.assign({
|
|
2024
2018
|
type: "checkbox",
|
|
2025
2019
|
name: input.name,
|
|
2026
2020
|
isDisabled: isDisabled,
|
|
@@ -2039,7 +2033,7 @@ const defaultTextareaProps = {
|
|
|
2039
2033
|
requiredBorderColor: 'warningBorderSecondary'
|
|
2040
2034
|
};
|
|
2041
2035
|
|
|
2042
|
-
const FormFieldTextarea = /*#__PURE__*/React
|
|
2036
|
+
const FormFieldTextarea = /*#__PURE__*/React.memo(function FormFieldTextarea(props) {
|
|
2043
2037
|
const {
|
|
2044
2038
|
name,
|
|
2045
2039
|
isDisabled,
|
|
@@ -2049,7 +2043,7 @@ const FormFieldTextarea = /*#__PURE__*/React$1.memo(function FormFieldTextarea(p
|
|
|
2049
2043
|
showMessage,
|
|
2050
2044
|
isRequired
|
|
2051
2045
|
} = props;
|
|
2052
|
-
return /*#__PURE__*/React
|
|
2046
|
+
return /*#__PURE__*/React.createElement(Field, {
|
|
2053
2047
|
name: name
|
|
2054
2048
|
}, function Render({
|
|
2055
2049
|
input,
|
|
@@ -2076,7 +2070,7 @@ const FormFieldTextarea = /*#__PURE__*/React$1.memo(function FormFieldTextarea(p
|
|
|
2076
2070
|
inputProps: inputProps,
|
|
2077
2071
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
2078
2072
|
});
|
|
2079
|
-
return /*#__PURE__*/React
|
|
2073
|
+
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
2080
2074
|
className: clsx('form-field_type_textarea', 'form__item_type_textarea', classNameGroupItem),
|
|
2081
2075
|
errorKey: errorKey,
|
|
2082
2076
|
errorMessage: errorMessage,
|
|
@@ -2090,7 +2084,7 @@ const FormFieldTextarea = /*#__PURE__*/React$1.memo(function FormFieldTextarea(p
|
|
|
2090
2084
|
showMessage: showMessage,
|
|
2091
2085
|
isRequired: isRequired,
|
|
2092
2086
|
isValidState: isValidState
|
|
2093
|
-
}, fieldProps), /*#__PURE__*/React
|
|
2087
|
+
}, fieldProps), /*#__PURE__*/React.createElement(Textarea, Object.assign({
|
|
2094
2088
|
dataTestId: `${input.name}FieldTextarea`,
|
|
2095
2089
|
className: clsx(meta.active && 'textarea_state_focus', meta.error && meta.touched && `textarea_state_${errorKey}`),
|
|
2096
2090
|
name: input.name,
|
|
@@ -2104,7 +2098,7 @@ const FormFieldTextarea = /*#__PURE__*/React$1.memo(function FormFieldTextarea(p
|
|
|
2104
2098
|
});
|
|
2105
2099
|
});
|
|
2106
2100
|
|
|
2107
|
-
const FormFieldMaskedInput = /*#__PURE__*/React
|
|
2101
|
+
const FormFieldMaskedInput = /*#__PURE__*/React.memo(function FormFieldMaskedInput(props) {
|
|
2108
2102
|
const {
|
|
2109
2103
|
name,
|
|
2110
2104
|
initialValue,
|
|
@@ -2123,7 +2117,7 @@ const FormFieldMaskedInput = /*#__PURE__*/React$1.memo(function FormFieldMaskedI
|
|
|
2123
2117
|
isRequired,
|
|
2124
2118
|
onClickClearIcon
|
|
2125
2119
|
} = props;
|
|
2126
|
-
return /*#__PURE__*/React
|
|
2120
|
+
return /*#__PURE__*/React.createElement(Field, {
|
|
2127
2121
|
name: name,
|
|
2128
2122
|
initialValue: initialValue
|
|
2129
2123
|
}, function Render({
|
|
@@ -2168,7 +2162,7 @@ const FormFieldMaskedInput = /*#__PURE__*/React$1.memo(function FormFieldMaskedI
|
|
|
2168
2162
|
inputProps: inputProps,
|
|
2169
2163
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
2170
2164
|
});
|
|
2171
|
-
return /*#__PURE__*/React
|
|
2165
|
+
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
2172
2166
|
className: clsx('form-field_type_maskedInput', 'form__item_type_maskedInput', classNameGroupItem),
|
|
2173
2167
|
errorKey: errorKey,
|
|
2174
2168
|
errorMessage: errorMessage,
|
|
@@ -2182,13 +2176,13 @@ const FormFieldMaskedInput = /*#__PURE__*/React$1.memo(function FormFieldMaskedI
|
|
|
2182
2176
|
showMessage: showMessage,
|
|
2183
2177
|
isRequired: isRequired,
|
|
2184
2178
|
isValidState: isValidState
|
|
2185
|
-
}, fieldProps), /*#__PURE__*/React
|
|
2179
|
+
}, fieldProps), /*#__PURE__*/React.createElement(Input, Object.assign({
|
|
2186
2180
|
className: clsx(meta.active && 'input_state_focus', meta.error && meta.touched && `input_state_${errorKey}`),
|
|
2187
2181
|
ref: ref,
|
|
2188
2182
|
value: value,
|
|
2189
2183
|
onBlur: input.onBlur,
|
|
2190
2184
|
onFocus: input.onFocus
|
|
2191
|
-
}, updatedInputProps)), clearIcon && /*#__PURE__*/React
|
|
2185
|
+
}, updatedInputProps)), clearIcon && /*#__PURE__*/React.createElement(Icon, {
|
|
2192
2186
|
className: "form-field__icon",
|
|
2193
2187
|
size: clearIconSize,
|
|
2194
2188
|
iconFill: clearIconFill,
|
|
@@ -2296,7 +2290,7 @@ function RadioGroupList(props) {
|
|
|
2296
2290
|
setEditableValue(value);
|
|
2297
2291
|
onChangeSomeInput(value);
|
|
2298
2292
|
}, [onChangeSomeInput]);
|
|
2299
|
-
return /*#__PURE__*/React
|
|
2293
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, options.map(option => option.editable ? /*#__PURE__*/React.createElement(RadioGroupInput, {
|
|
2300
2294
|
key: option.label,
|
|
2301
2295
|
editableProps: editableProps,
|
|
2302
2296
|
input: input,
|
|
@@ -2304,7 +2298,7 @@ function RadioGroupList(props) {
|
|
|
2304
2298
|
option: option,
|
|
2305
2299
|
value: editableValue,
|
|
2306
2300
|
onChange: onChangeEditable
|
|
2307
|
-
}) : /*#__PURE__*/React
|
|
2301
|
+
}) : /*#__PURE__*/React.createElement(RadioGroupItem, {
|
|
2308
2302
|
key: option.value,
|
|
2309
2303
|
input: input,
|
|
2310
2304
|
inputProps: inputProps,
|
|
@@ -2313,7 +2307,7 @@ function RadioGroupList(props) {
|
|
|
2313
2307
|
})));
|
|
2314
2308
|
}
|
|
2315
2309
|
|
|
2316
|
-
const RadioGroup = /*#__PURE__*/React
|
|
2310
|
+
const RadioGroup = /*#__PURE__*/React.memo(function RadioGroup(props) {
|
|
2317
2311
|
const {
|
|
2318
2312
|
name,
|
|
2319
2313
|
isDisabled,
|
|
@@ -2326,7 +2320,7 @@ const RadioGroup = /*#__PURE__*/React$1.memo(function RadioGroup(props) {
|
|
|
2326
2320
|
isRequired,
|
|
2327
2321
|
onChange
|
|
2328
2322
|
} = props;
|
|
2329
|
-
return /*#__PURE__*/React
|
|
2323
|
+
return /*#__PURE__*/React.createElement(Field, {
|
|
2330
2324
|
name: name
|
|
2331
2325
|
}, function Render({
|
|
2332
2326
|
input,
|
|
@@ -2353,7 +2347,7 @@ const RadioGroup = /*#__PURE__*/React$1.memo(function RadioGroup(props) {
|
|
|
2353
2347
|
inputProps: inputProps,
|
|
2354
2348
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
2355
2349
|
});
|
|
2356
|
-
return /*#__PURE__*/React
|
|
2350
|
+
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
2357
2351
|
className: clsx('form-field_type_radio', 'form__item_type_radio"', classNameGroupItem),
|
|
2358
2352
|
errorKey: errorKey,
|
|
2359
2353
|
errorMessage: errorMessage,
|
|
@@ -2367,7 +2361,7 @@ const RadioGroup = /*#__PURE__*/React$1.memo(function RadioGroup(props) {
|
|
|
2367
2361
|
showMessage: showMessage,
|
|
2368
2362
|
isRequired: isRequired,
|
|
2369
2363
|
isValidState: isValidState
|
|
2370
|
-
}, fieldProps), /*#__PURE__*/React
|
|
2364
|
+
}, fieldProps), /*#__PURE__*/React.createElement(RadioGroupList, {
|
|
2371
2365
|
isDisabled: isDisabled,
|
|
2372
2366
|
editableProps: editableProps,
|
|
2373
2367
|
input: input,
|
|
@@ -2400,97 +2394,97 @@ function generateField(field, config, props) {
|
|
|
2400
2394
|
switch (field.type) {
|
|
2401
2395
|
case formTypes.checkbox:
|
|
2402
2396
|
{
|
|
2403
|
-
return /*#__PURE__*/React
|
|
2397
|
+
return /*#__PURE__*/React.createElement(FormFieldCheckbox, Object.assign({
|
|
2404
2398
|
key: config.key
|
|
2405
2399
|
}, field, props));
|
|
2406
2400
|
}
|
|
2407
2401
|
case formTypes.choice:
|
|
2408
2402
|
{
|
|
2409
|
-
return /*#__PURE__*/React
|
|
2403
|
+
return /*#__PURE__*/React.createElement(FormFieldChoice, Object.assign({
|
|
2410
2404
|
key: config.key
|
|
2411
2405
|
}, field, props));
|
|
2412
2406
|
}
|
|
2413
2407
|
case formTypes.chips:
|
|
2414
2408
|
{
|
|
2415
|
-
return /*#__PURE__*/React
|
|
2409
|
+
return /*#__PURE__*/React.createElement(FormFieldChips, Object.assign({
|
|
2416
2410
|
key: config.key
|
|
2417
2411
|
}, field, props));
|
|
2418
2412
|
}
|
|
2419
2413
|
case formTypes.code:
|
|
2420
2414
|
{
|
|
2421
|
-
return /*#__PURE__*/React
|
|
2415
|
+
return /*#__PURE__*/React.createElement(FormFieldCode, Object.assign({
|
|
2422
2416
|
key: config.key
|
|
2423
2417
|
}, field, props));
|
|
2424
2418
|
}
|
|
2425
2419
|
case formTypes.switch:
|
|
2426
2420
|
{
|
|
2427
|
-
return /*#__PURE__*/React
|
|
2421
|
+
return /*#__PURE__*/React.createElement(FormFieldSwitch, Object.assign({
|
|
2428
2422
|
key: config.key
|
|
2429
2423
|
}, field, props));
|
|
2430
2424
|
}
|
|
2431
2425
|
case formTypes.segmented:
|
|
2432
2426
|
{
|
|
2433
|
-
return /*#__PURE__*/React
|
|
2427
|
+
return /*#__PURE__*/React.createElement(FormFieldSegmented, Object.assign({
|
|
2434
2428
|
key: config.key
|
|
2435
2429
|
}, field, props));
|
|
2436
2430
|
}
|
|
2437
2431
|
case formTypes.datePicker:
|
|
2438
2432
|
{
|
|
2439
|
-
return /*#__PURE__*/React
|
|
2433
|
+
return /*#__PURE__*/React.createElement(FormFieldDatePicker, Object.assign({
|
|
2440
2434
|
key: config.key
|
|
2441
2435
|
}, field, props));
|
|
2442
2436
|
}
|
|
2443
2437
|
case formTypes.fileInput:
|
|
2444
2438
|
{
|
|
2445
|
-
return /*#__PURE__*/React
|
|
2439
|
+
return /*#__PURE__*/React.createElement(FileInput, Object.assign({
|
|
2446
2440
|
key: config.key
|
|
2447
2441
|
}, field, props));
|
|
2448
2442
|
}
|
|
2449
2443
|
case formTypes.radioGroup:
|
|
2450
2444
|
{
|
|
2451
|
-
return /*#__PURE__*/React
|
|
2445
|
+
return /*#__PURE__*/React.createElement(RadioGroup, Object.assign({
|
|
2452
2446
|
key: config.key
|
|
2453
2447
|
}, field, props));
|
|
2454
2448
|
}
|
|
2455
2449
|
case formTypes.select:
|
|
2456
2450
|
{
|
|
2457
|
-
return /*#__PURE__*/React
|
|
2451
|
+
return /*#__PURE__*/React.createElement(FormFieldSelect, Object.assign({
|
|
2458
2452
|
key: config.key
|
|
2459
2453
|
}, field, props));
|
|
2460
2454
|
}
|
|
2461
2455
|
case formTypes.text:
|
|
2462
2456
|
{
|
|
2463
|
-
return /*#__PURE__*/React
|
|
2457
|
+
return /*#__PURE__*/React.createElement(FormFieldInput, Object.assign({
|
|
2464
2458
|
key: config.key
|
|
2465
2459
|
}, field, props));
|
|
2466
2460
|
}
|
|
2467
2461
|
case formTypes.password:
|
|
2468
2462
|
{
|
|
2469
|
-
return /*#__PURE__*/React
|
|
2463
|
+
return /*#__PURE__*/React.createElement(FormFieldPassword, Object.assign({
|
|
2470
2464
|
key: config.key
|
|
2471
2465
|
}, field, props));
|
|
2472
2466
|
}
|
|
2473
2467
|
case formTypes.textarea:
|
|
2474
2468
|
{
|
|
2475
|
-
return /*#__PURE__*/React
|
|
2469
|
+
return /*#__PURE__*/React.createElement(FormFieldTextarea, Object.assign({
|
|
2476
2470
|
key: config.key
|
|
2477
2471
|
}, field, props));
|
|
2478
2472
|
}
|
|
2479
2473
|
case formTypes.maskedInput:
|
|
2480
2474
|
{
|
|
2481
|
-
return /*#__PURE__*/React
|
|
2475
|
+
return /*#__PURE__*/React.createElement(FormFieldMaskedInput, Object.assign({
|
|
2482
2476
|
key: config.key
|
|
2483
2477
|
}, field, props));
|
|
2484
2478
|
}
|
|
2485
2479
|
case formTypes.custom:
|
|
2486
2480
|
{
|
|
2487
|
-
return /*#__PURE__*/React
|
|
2481
|
+
return /*#__PURE__*/React.createElement(FormFieldCustom, Object.assign({
|
|
2488
2482
|
key: config.key
|
|
2489
2483
|
}, field, props));
|
|
2490
2484
|
}
|
|
2491
2485
|
case formTypes.group:
|
|
2492
2486
|
{
|
|
2493
|
-
return /*#__PURE__*/React
|
|
2487
|
+
return /*#__PURE__*/React.createElement(FormBlockGroup, Object.assign({
|
|
2494
2488
|
key: config.key
|
|
2495
2489
|
}, field, props), Object.entries(field.group).map(([key, value]) => {
|
|
2496
2490
|
const groupProps = {
|
|
@@ -2616,13 +2610,16 @@ const sendFormDataToServer = async (url, data) => {
|
|
|
2616
2610
|
}
|
|
2617
2611
|
};
|
|
2618
2612
|
|
|
2619
|
-
const FinalForm = /*#__PURE__*/React
|
|
2613
|
+
const FinalForm = /*#__PURE__*/React.forwardRef(function FinalForm(props, ref) {
|
|
2620
2614
|
const {
|
|
2615
|
+
dataTestId,
|
|
2616
|
+
dataTour,
|
|
2621
2617
|
className,
|
|
2622
2618
|
type,
|
|
2623
2619
|
initialValues,
|
|
2624
2620
|
initialValuesEqual,
|
|
2625
2621
|
config,
|
|
2622
|
+
validationSchema,
|
|
2626
2623
|
title,
|
|
2627
2624
|
titleFill,
|
|
2628
2625
|
titleTextColor,
|
|
@@ -2632,6 +2629,7 @@ const FinalForm = /*#__PURE__*/React$1.forwardRef(function FinalForm(props, ref)
|
|
|
2632
2629
|
descSize,
|
|
2633
2630
|
descTextColor,
|
|
2634
2631
|
descTextWeight,
|
|
2632
|
+
buttonGap,
|
|
2635
2633
|
dataTestIdPrimaryButton,
|
|
2636
2634
|
dataTourPrimaryButton,
|
|
2637
2635
|
primaryButton,
|
|
@@ -2673,13 +2671,10 @@ const FinalForm = /*#__PURE__*/React$1.forwardRef(function FinalForm(props, ref)
|
|
|
2673
2671
|
additionalProps = {},
|
|
2674
2672
|
buttonDirection = 'vertical',
|
|
2675
2673
|
buttonFill,
|
|
2676
|
-
buttonGap,
|
|
2677
2674
|
buttonJustifyContent,
|
|
2678
2675
|
buttonPadding,
|
|
2679
2676
|
buttonPosition,
|
|
2680
|
-
dataTestId,
|
|
2681
2677
|
dataTestIdButtons,
|
|
2682
|
-
dataTour,
|
|
2683
2678
|
dataTourButtons,
|
|
2684
2679
|
disableFieldsAutoComplete = false,
|
|
2685
2680
|
fieldsGap,
|
|
@@ -2698,7 +2693,6 @@ const FinalForm = /*#__PURE__*/React$1.forwardRef(function FinalForm(props, ref)
|
|
|
2698
2693
|
notificationCloseButton,
|
|
2699
2694
|
notificationType,
|
|
2700
2695
|
renderFieldsWrapper = wrapperChildren => wrapperChildren,
|
|
2701
|
-
validationSchema,
|
|
2702
2696
|
before,
|
|
2703
2697
|
after,
|
|
2704
2698
|
isLoading,
|
|
@@ -2722,7 +2716,7 @@ const FinalForm = /*#__PURE__*/React$1.forwardRef(function FinalForm(props, ref)
|
|
|
2722
2716
|
styles: formStyles,
|
|
2723
2717
|
wrapper: wrapperStyles
|
|
2724
2718
|
} = useStyles(props);
|
|
2725
|
-
return /*#__PURE__*/React
|
|
2719
|
+
return /*#__PURE__*/React.createElement(Form, {
|
|
2726
2720
|
initialValues: initialValues,
|
|
2727
2721
|
initialValuesEqual: initialValuesEqual,
|
|
2728
2722
|
render: ({
|
|
@@ -2731,53 +2725,53 @@ const FinalForm = /*#__PURE__*/React$1.forwardRef(function FinalForm(props, ref)
|
|
|
2731
2725
|
handleSubmit,
|
|
2732
2726
|
modifiedSinceLastSubmit
|
|
2733
2727
|
}) => {
|
|
2734
|
-
return /*#__PURE__*/React
|
|
2728
|
+
return /*#__PURE__*/React.createElement("form", {
|
|
2735
2729
|
className: clsx(className, 'form', type && `form_type_${type}`, buttonPosition && `form_button-position_${buttonPosition}`, directionClass, fillClass, shapeClass, elevationClass),
|
|
2736
|
-
name: formName
|
|
2730
|
+
name: formName
|
|
2731
|
+
// We no need set reference to html element, we need reference to "final-form" instance
|
|
2732
|
+
,
|
|
2733
|
+
ref: () => onRefFormInstance(form),
|
|
2737
2734
|
autoCapitalize: disableFieldsAutoComplete ? 'off' : undefined,
|
|
2738
2735
|
autoComplete: disableFieldsAutoComplete ? 'off' : undefined,
|
|
2739
2736
|
autoCorrect: disableFieldsAutoComplete ? 'off' : undefined,
|
|
2740
2737
|
"data-test-id": dataTestId,
|
|
2741
|
-
"data-tour": dataTour
|
|
2742
|
-
// We no need set reference to html element, we need reference to "final-form" instance
|
|
2743
|
-
,
|
|
2744
|
-
ref: () => onRefFormInstance(form),
|
|
2738
|
+
"data-tour": dataTour,
|
|
2745
2739
|
spellCheck: disableFieldsAutoComplete ? 'false' : undefined,
|
|
2746
2740
|
style: formStyles,
|
|
2747
2741
|
onSubmit: handleSubmit
|
|
2748
|
-
}, before, title && /*#__PURE__*/React
|
|
2742
|
+
}, before, title && /*#__PURE__*/React.createElement(Title, {
|
|
2749
2743
|
className: "form__title",
|
|
2750
2744
|
size: titleTextSize,
|
|
2751
2745
|
fill: titleFill,
|
|
2752
2746
|
textColor: titleTextColor,
|
|
2753
2747
|
textWeight: titleTextWeight
|
|
2754
|
-
}, title), desc && /*#__PURE__*/React
|
|
2748
|
+
}, title), desc && /*#__PURE__*/React.createElement(Text, {
|
|
2755
2749
|
className: "form__desc",
|
|
2756
2750
|
size: descSize,
|
|
2757
2751
|
textColor: descTextColor,
|
|
2758
2752
|
textWeight: descTextWeight
|
|
2759
|
-
}, desc), submitError && !modifiedSinceLastSubmit && /*#__PURE__*/React
|
|
2753
|
+
}, desc), submitError && !modifiedSinceLastSubmit && /*#__PURE__*/React.createElement("div", {
|
|
2760
2754
|
className: clsx('notification', 'form-notification', notificationType ? `form-notification_${notificationType}` : 'form-notification_global')
|
|
2761
|
-
}, /*#__PURE__*/React
|
|
2755
|
+
}, /*#__PURE__*/React.createElement(Notification, {
|
|
2762
2756
|
className: "form-notification__item",
|
|
2763
2757
|
appearance: "errorPrimary",
|
|
2764
2758
|
title: form.getState().submitError,
|
|
2765
2759
|
titleTextSize: "h6",
|
|
2766
2760
|
status: "error",
|
|
2767
2761
|
closeButton: notificationCloseButton
|
|
2768
|
-
})), onChangeFormValues && /*#__PURE__*/React
|
|
2762
|
+
})), onChangeFormValues && /*#__PURE__*/React.createElement(FormSpy, {
|
|
2769
2763
|
subscription: {
|
|
2770
2764
|
values: true
|
|
2771
2765
|
},
|
|
2772
2766
|
onChange: onChangeFormValues
|
|
2773
|
-
}), Boolean(Object.keys(config).length) && /*#__PURE__*/React
|
|
2767
|
+
}), Boolean(config && Object.keys(config).length) && /*#__PURE__*/React.createElement(React.Fragment, null, renderFieldsWrapper(/*#__PURE__*/React.createElement(Group, {
|
|
2774
2768
|
className: "form__wrapper",
|
|
2775
2769
|
direction: "vertical",
|
|
2776
2770
|
gap: fieldsGap || groupGap,
|
|
2777
2771
|
style: wrapperStyles
|
|
2778
2772
|
}, Object.keys(config).map(key => generateField(config[key], {
|
|
2779
2773
|
key
|
|
2780
|
-
}, additionalProps[config[key].name])), isLoading && (loader || /*#__PURE__*/React
|
|
2774
|
+
}, additionalProps[config[key].name])), isLoading && (loader || /*#__PURE__*/React.createElement(Loader, {
|
|
2781
2775
|
className: "form__loader",
|
|
2782
2776
|
type: loaderType,
|
|
2783
2777
|
appearance: loaderAppearance,
|
|
@@ -2786,16 +2780,18 @@ const FinalForm = /*#__PURE__*/React$1.forwardRef(function FinalForm(props, ref)
|
|
|
2786
2780
|
text: loaderText,
|
|
2787
2781
|
itemFill: loaderItemFill,
|
|
2788
2782
|
shape: loaderShape
|
|
2789
|
-
}))))), (primaryButtonLabel || primaryButton || secondaryButtonLabel || secondaryButton || tertiaryButton || tertiaryButtonLabel) && /*#__PURE__*/React
|
|
2783
|
+
}))))), (primaryButtonLabel || primaryButton || secondaryButtonLabel || secondaryButton || tertiaryButton || tertiaryButtonLabel) && /*#__PURE__*/React.createElement(Group, {
|
|
2784
|
+
dataTestId: dataTestIdButtons,
|
|
2785
|
+
dataTour: dataTourButtons,
|
|
2790
2786
|
className: "form__button",
|
|
2791
2787
|
direction: buttonDirection,
|
|
2792
2788
|
justifyContent: buttonJustifyContent,
|
|
2793
2789
|
fill: buttonFill,
|
|
2794
2790
|
padding: buttonPadding,
|
|
2795
|
-
gap: buttonGap
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2791
|
+
gap: buttonGap
|
|
2792
|
+
}, primaryButtonLabel ? /*#__PURE__*/React.createElement(Button, {
|
|
2793
|
+
dataTestId: dataTestIdPrimaryButton,
|
|
2794
|
+
dataTour: dataTourPrimaryButton,
|
|
2799
2795
|
className: "form__button-item",
|
|
2800
2796
|
appearance: primaryButtonAppearance,
|
|
2801
2797
|
width: "fill",
|
|
@@ -2807,10 +2803,10 @@ const FinalForm = /*#__PURE__*/React$1.forwardRef(function FinalForm(props, ref)
|
|
|
2807
2803
|
labelTextSize: primaryButtonLabelSize,
|
|
2808
2804
|
labelTextWeight: primaryButtonLabelTextWeight,
|
|
2809
2805
|
isDisabled: primaryButtonIsDisabled,
|
|
2810
|
-
dataTestId: dataTestIdPrimaryButton,
|
|
2811
|
-
dataTour: dataTourPrimaryButton,
|
|
2812
2806
|
loading: primaryButtonIsLoading
|
|
2813
|
-
}) : primaryButton, secondaryButtonLabel ? /*#__PURE__*/React
|
|
2807
|
+
}) : primaryButton, secondaryButtonLabel ? /*#__PURE__*/React.createElement(Button, {
|
|
2808
|
+
dataTestId: dataTestIdSecondaryButton,
|
|
2809
|
+
dataTour: dataTourSecondaryButton,
|
|
2814
2810
|
className: "form__button-item",
|
|
2815
2811
|
appearance: secondaryButtonAppearance,
|
|
2816
2812
|
width: "fill",
|
|
@@ -2822,11 +2818,11 @@ const FinalForm = /*#__PURE__*/React$1.forwardRef(function FinalForm(props, ref)
|
|
|
2822
2818
|
labelTextSize: secondaryButtonLabelSize,
|
|
2823
2819
|
labelTextWeight: secondaryButtonLabelTextWeight,
|
|
2824
2820
|
isDisabled: secondaryButtonIsDisabled,
|
|
2825
|
-
dataTestId: dataTestIdSecondaryButton,
|
|
2826
|
-
dataTour: dataTourSecondaryButton,
|
|
2827
2821
|
loading: secondaryButtonIsLoading,
|
|
2828
2822
|
onClick: onClickSecondaryButton
|
|
2829
|
-
}) : secondaryButton, tertiaryButtonLabel ? /*#__PURE__*/React
|
|
2823
|
+
}) : secondaryButton, tertiaryButtonLabel ? /*#__PURE__*/React.createElement(Button, {
|
|
2824
|
+
dataTestId: dataTestIdTertiaryButton,
|
|
2825
|
+
dataTour: dataTourTertiaryButton,
|
|
2830
2826
|
className: "form__button-item",
|
|
2831
2827
|
width: "fill",
|
|
2832
2828
|
size: tertiaryButtonSize,
|
|
@@ -2836,8 +2832,6 @@ const FinalForm = /*#__PURE__*/React$1.forwardRef(function FinalForm(props, ref)
|
|
|
2836
2832
|
labelTextColor: tertiaryButtonLabelTextColor,
|
|
2837
2833
|
labelTextSize: tertiaryButtonLabelSize,
|
|
2838
2834
|
labelTextWeight: tertiaryButtonLabelTextWeight,
|
|
2839
|
-
dataTestId: dataTestIdTertiaryButton,
|
|
2840
|
-
dataTour: dataTourTertiaryButton,
|
|
2841
2835
|
onClick: onClickTertiaryButton
|
|
2842
2836
|
}) : tertiaryButton), after);
|
|
2843
2837
|
},
|