@itcase/forms 1.1.51 → 1.1.52
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 +25 -20
- package/dist/itcase-forms.esm.js +25 -20
- package/package.json +1 -1
package/dist/itcase-forms.cjs.js
CHANGED
|
@@ -383,12 +383,12 @@ function FieldWrapperBase(props) {
|
|
|
383
383
|
const errorTextWeight = props[`${errorKey}MessageTextWeight`];
|
|
384
384
|
return /*#__PURE__*/React__default.default.createElement(Tag, {
|
|
385
385
|
className: clsx__default.default(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),
|
|
386
|
-
"data-testid": `${inputName}
|
|
386
|
+
"data-testid": `${inputName}-field`,
|
|
387
387
|
"data-tour": dataTour,
|
|
388
388
|
style: formFieldStyles
|
|
389
389
|
}, before, (label || labelHidden) && /*#__PURE__*/React__default.default.createElement("div", {
|
|
390
390
|
className: clsx__default.default('form-field__label'),
|
|
391
|
-
"data-testid": `${inputName}
|
|
391
|
+
"data-testid": `${inputName}-field-label`,
|
|
392
392
|
htmlFor: id
|
|
393
393
|
}, /*#__PURE__*/React__default.default.createElement(Text.Text, {
|
|
394
394
|
size: labelTextSize,
|
|
@@ -398,7 +398,7 @@ function FieldWrapperBase(props) {
|
|
|
398
398
|
sizeTablet: labelTextSizeTablet
|
|
399
399
|
}, label, labelHidden && '\u00A0')), desc && /*#__PURE__*/React__default.default.createElement("div", {
|
|
400
400
|
className: "form-field__desc",
|
|
401
|
-
"data-testid": `${inputName}
|
|
401
|
+
"data-testid": `${inputName}-field-desc`
|
|
402
402
|
}, /*#__PURE__*/React__default.default.createElement(Text.Text, {
|
|
403
403
|
size: descTextSize,
|
|
404
404
|
textColor: descTextColor,
|
|
@@ -415,24 +415,24 @@ function FieldWrapperBase(props) {
|
|
|
415
415
|
fill: dividerFill
|
|
416
416
|
})), showMessage && /*#__PURE__*/React__default.default.createElement("div", {
|
|
417
417
|
className: "form-field__message",
|
|
418
|
-
"data-testid": `${inputName}
|
|
418
|
+
"data-testid": `${inputName}-field-message`
|
|
419
419
|
}, isErrorState && errorMessage && /*#__PURE__*/React__default.default.createElement(Text.Text, {
|
|
420
420
|
id: `${inputName}-error`,
|
|
421
421
|
className: "form-field__message-item form-field__message-item_type-error",
|
|
422
|
-
dataTestId: `${inputName}
|
|
422
|
+
dataTestId: `${inputName}-field-message-error`,
|
|
423
423
|
size: errorTextSize,
|
|
424
424
|
textColor: errorTextColor,
|
|
425
425
|
textWeight: errorTextWeight
|
|
426
426
|
}, errorMessage), Boolean(helpText) && (!isErrorState || !errorMessage) && /*#__PURE__*/React__default.default.createElement(Text.Text, {
|
|
427
427
|
className: "form-field__message-item form-field__message-item_type_help-text",
|
|
428
|
-
dataTestId: `${inputName}
|
|
428
|
+
dataTestId: `${inputName}-field-message-help-text`,
|
|
429
429
|
size: helpTextSize,
|
|
430
430
|
textColor: isValidState ? helpTextColorSuccess : helpTextColor,
|
|
431
431
|
textWeight: helpTextWeight,
|
|
432
432
|
sizeMobile: helpTextSizeMobile
|
|
433
433
|
}, helpText), (!isErrorState && !helpText || isErrorState && !helpText && !errorMessage) && /*#__PURE__*/React__default.default.createElement(Text.Text, {
|
|
434
434
|
className: "form-field__message-item form-field__message-item_type_help-text",
|
|
435
|
-
dataTestId: `${inputName}
|
|
435
|
+
dataTestId: `${inputName}field-message-help-text`,
|
|
436
436
|
size: messageTextSize
|
|
437
437
|
}, '\u00A0')), after);
|
|
438
438
|
}
|
|
@@ -1725,7 +1725,7 @@ const FormFieldInput = /*#__PURE__*/React__default.default.memo(function FormFie
|
|
|
1725
1725
|
isValidState: isValidState
|
|
1726
1726
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(Input.Input, Object.assign({
|
|
1727
1727
|
className: clsx__default.default(meta.active && 'input_state_focus', meta.error && meta.touched && `input_state_${errorKey}`),
|
|
1728
|
-
dataTestId: `${input.name}
|
|
1728
|
+
dataTestId: `${input.name}-field-input`,
|
|
1729
1729
|
type: "text",
|
|
1730
1730
|
name: input.name,
|
|
1731
1731
|
autoComplete: "nope",
|
|
@@ -1922,7 +1922,7 @@ const FormFieldPassword = /*#__PURE__*/React__default.default.memo(function Form
|
|
|
1922
1922
|
isValidState: isValidState
|
|
1923
1923
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(InputPassword.InputPassword, Object.assign({
|
|
1924
1924
|
className: clsx__default.default(meta.active && 'input-password_state_focus', meta.error && meta.touched && `input-password_state_${errorKey}`),
|
|
1925
|
-
dataTestId: `${input.name}
|
|
1925
|
+
dataTestId: `${input.name}-field-input-password`,
|
|
1926
1926
|
name: input.name,
|
|
1927
1927
|
autoComplete: "nope",
|
|
1928
1928
|
value: input.value || '',
|
|
@@ -2348,11 +2348,11 @@ const defaultTextareaProps = {
|
|
|
2348
2348
|
const FormFieldTextarea = /*#__PURE__*/React__default.default.memo(function FormFieldTextarea(props) {
|
|
2349
2349
|
const {
|
|
2350
2350
|
name,
|
|
2351
|
-
isDisabled,
|
|
2352
2351
|
classNameGroupItem,
|
|
2353
2352
|
fieldProps = {},
|
|
2354
2353
|
inputProps = {},
|
|
2355
2354
|
showMessage,
|
|
2355
|
+
isDisabled,
|
|
2356
2356
|
isRequired
|
|
2357
2357
|
} = props;
|
|
2358
2358
|
return /*#__PURE__*/React__default.default.createElement(reactFinalForm.Field, {
|
|
@@ -2371,8 +2371,8 @@ const FormFieldTextarea = /*#__PURE__*/React__default.default.memo(function Form
|
|
|
2371
2371
|
const {
|
|
2372
2372
|
errorKey,
|
|
2373
2373
|
errorMessage,
|
|
2374
|
-
isErrorState,
|
|
2375
2374
|
successKey,
|
|
2375
|
+
isErrorState,
|
|
2376
2376
|
isValidState
|
|
2377
2377
|
} = useFieldValidationState({
|
|
2378
2378
|
fieldProps: fieldProps,
|
|
@@ -2387,23 +2387,23 @@ const FormFieldTextarea = /*#__PURE__*/React__default.default.memo(function Form
|
|
|
2387
2387
|
className: clsx__default.default('form-field_textarea', 'form__item_textarea', classNameGroupItem),
|
|
2388
2388
|
errorKey: errorKey,
|
|
2389
2389
|
errorMessage: errorMessage,
|
|
2390
|
-
isErrorState: isErrorState,
|
|
2391
|
-
metaError: meta.error,
|
|
2392
|
-
isDisabled: isDisabled,
|
|
2393
2390
|
fieldClassName: 'form-textarea',
|
|
2394
2391
|
inputName: input.name,
|
|
2395
2392
|
inputValue: input.value,
|
|
2396
2393
|
metaActive: meta.active,
|
|
2394
|
+
metaError: meta.error,
|
|
2397
2395
|
showMessage: showMessage,
|
|
2396
|
+
isDisabled: isDisabled,
|
|
2397
|
+
isErrorState: isErrorState,
|
|
2398
2398
|
isRequired: isRequired,
|
|
2399
2399
|
isValidState: isValidState
|
|
2400
2400
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(Textarea.Textarea, Object.assign({
|
|
2401
|
-
dataTestId: `${input.name}FieldTextarea`,
|
|
2402
2401
|
className: clsx__default.default(meta.active && 'textarea_state_focus', meta.error && meta.touched && `textarea_state_${errorKey}`),
|
|
2402
|
+
dataTestId: `${input.name}-field-textarea`,
|
|
2403
2403
|
name: input.name,
|
|
2404
|
-
isDisabled: isDisabled,
|
|
2405
2404
|
autoComplete: "nope",
|
|
2406
2405
|
value: input.value || '',
|
|
2406
|
+
isDisabled: isDisabled,
|
|
2407
2407
|
onBlur: input.onBlur,
|
|
2408
2408
|
onChange: input.onChange,
|
|
2409
2409
|
onFocus: input.onFocus
|
|
@@ -2762,6 +2762,7 @@ const FinalForm = /*#__PURE__*/React__default.default.forwardRef(function FinalF
|
|
|
2762
2762
|
dataTestId,
|
|
2763
2763
|
dataTour,
|
|
2764
2764
|
type,
|
|
2765
|
+
name,
|
|
2765
2766
|
initialValues,
|
|
2766
2767
|
initialValuesEqual,
|
|
2767
2768
|
config,
|
|
@@ -2812,6 +2813,7 @@ const FinalForm = /*#__PURE__*/React__default.default.forwardRef(function FinalF
|
|
|
2812
2813
|
primaryButtonAppearance,
|
|
2813
2814
|
primaryButtonFill,
|
|
2814
2815
|
primaryButtonFillHover,
|
|
2816
|
+
primaryButtonHtmlType,
|
|
2815
2817
|
primaryButtonIsDisabled,
|
|
2816
2818
|
primaryButtonIsLoading,
|
|
2817
2819
|
primaryButtonLabel,
|
|
@@ -2819,6 +2821,7 @@ const FinalForm = /*#__PURE__*/React__default.default.forwardRef(function FinalF
|
|
|
2819
2821
|
primaryButtonLabelTextColor,
|
|
2820
2822
|
primaryButtonLabelTextWeight,
|
|
2821
2823
|
primaryButtonSize,
|
|
2824
|
+
primarySecondaryHtmlType,
|
|
2822
2825
|
renderFieldsWrapper = wrapperChildren => wrapperChildren,
|
|
2823
2826
|
secondaryButton,
|
|
2824
2827
|
secondaryButtonAppearance,
|
|
@@ -2877,14 +2880,14 @@ const FinalForm = /*#__PURE__*/React__default.default.forwardRef(function FinalF
|
|
|
2877
2880
|
}) => {
|
|
2878
2881
|
return /*#__PURE__*/React__default.default.createElement("form", {
|
|
2879
2882
|
className: clsx__default.default(className, 'form', type && `form_type_${type}`, widthClass && `width_${widthClass}`, heightClass && `height_${heightClass}`, titlePosition && `form_title-position_${titlePosition}`, buttonPosition && `form_button-position_${buttonPosition}`, directionClass && `direction_${directionClass}`, fillClass && `fill_${fillClass}`, shapeClass && `shape_${shapeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`, elevationClass && `elevation_${elevationClass}`),
|
|
2880
|
-
name: formName
|
|
2883
|
+
name: formName || 'form'
|
|
2881
2884
|
// We no need set reference to html element, we need reference to "final-form" instance
|
|
2882
2885
|
,
|
|
2883
2886
|
ref: () => onRefFormInstance(form),
|
|
2884
2887
|
autoCapitalize: disableFieldsAutoComplete ? 'off' : undefined,
|
|
2885
2888
|
autoComplete: disableFieldsAutoComplete ? 'off' : undefined,
|
|
2886
2889
|
autoCorrect: disableFieldsAutoComplete ? 'off' : undefined,
|
|
2887
|
-
"data-testid": dataTestId,
|
|
2890
|
+
"data-testid": dataTestId || name,
|
|
2888
2891
|
"data-tour": dataTour,
|
|
2889
2892
|
spellCheck: disableFieldsAutoComplete ? 'false' : undefined,
|
|
2890
2893
|
style: formStyles,
|
|
@@ -2941,7 +2944,7 @@ const FinalForm = /*#__PURE__*/React__default.default.forwardRef(function FinalF
|
|
|
2941
2944
|
}, primaryButtonLabel ? /*#__PURE__*/React__default.default.createElement(Button.Button, {
|
|
2942
2945
|
appearance: primaryButtonAppearance,
|
|
2943
2946
|
className: "form__button-item",
|
|
2944
|
-
dataTestId: dataTestIdPrimaryButton,
|
|
2947
|
+
dataTestId: dataTestIdPrimaryButton || (name ? `${name}-primary` : 'form-primary'),
|
|
2945
2948
|
dataTour: dataTourPrimaryButton,
|
|
2946
2949
|
width: "fill",
|
|
2947
2950
|
size: primaryButtonSize,
|
|
@@ -2951,12 +2954,13 @@ const FinalForm = /*#__PURE__*/React__default.default.forwardRef(function FinalF
|
|
|
2951
2954
|
labelTextColor: primaryButtonLabelTextColor,
|
|
2952
2955
|
labelTextSize: primaryButtonLabelSize,
|
|
2953
2956
|
labelTextWeight: primaryButtonLabelTextWeight,
|
|
2957
|
+
htmlType: primaryButtonHtmlType || 'submit',
|
|
2954
2958
|
loading: primaryButtonIsLoading,
|
|
2955
2959
|
isDisabled: primaryButtonIsDisabled
|
|
2956
2960
|
}) : primaryButton, secondaryButtonLabel ? /*#__PURE__*/React__default.default.createElement(Button.Button, {
|
|
2957
2961
|
appearance: secondaryButtonAppearance,
|
|
2958
2962
|
className: "form__button-item",
|
|
2959
|
-
dataTestId: dataTestIdSecondaryButton,
|
|
2963
|
+
dataTestId: dataTestIdSecondaryButton || (name ? `${name}-secondary` : 'form-secondary'),
|
|
2960
2964
|
dataTour: dataTourSecondaryButton,
|
|
2961
2965
|
width: "fill",
|
|
2962
2966
|
size: secondaryButtonSize,
|
|
@@ -2966,6 +2970,7 @@ const FinalForm = /*#__PURE__*/React__default.default.forwardRef(function FinalF
|
|
|
2966
2970
|
labelTextColor: secondaryButtonLabelTextColor,
|
|
2967
2971
|
labelTextSize: secondaryButtonLabelSize,
|
|
2968
2972
|
labelTextWeight: secondaryButtonLabelTextWeight,
|
|
2973
|
+
htmlType: primarySecondaryHtmlType,
|
|
2969
2974
|
loading: secondaryButtonIsLoading,
|
|
2970
2975
|
isDisabled: secondaryButtonIsDisabled,
|
|
2971
2976
|
onClick: onClickSecondaryButton
|
package/dist/itcase-forms.esm.js
CHANGED
|
@@ -372,12 +372,12 @@ function FieldWrapperBase(props) {
|
|
|
372
372
|
const errorTextWeight = props[`${errorKey}MessageTextWeight`];
|
|
373
373
|
return /*#__PURE__*/React.createElement(Tag, {
|
|
374
374
|
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),
|
|
375
|
-
"data-testid": `${inputName}
|
|
375
|
+
"data-testid": `${inputName}-field`,
|
|
376
376
|
"data-tour": dataTour,
|
|
377
377
|
style: formFieldStyles
|
|
378
378
|
}, before, (label || labelHidden) && /*#__PURE__*/React.createElement("div", {
|
|
379
379
|
className: clsx('form-field__label'),
|
|
380
|
-
"data-testid": `${inputName}
|
|
380
|
+
"data-testid": `${inputName}-field-label`,
|
|
381
381
|
htmlFor: id
|
|
382
382
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
383
383
|
size: labelTextSize,
|
|
@@ -387,7 +387,7 @@ function FieldWrapperBase(props) {
|
|
|
387
387
|
sizeTablet: labelTextSizeTablet
|
|
388
388
|
}, label, labelHidden && '\u00A0')), desc && /*#__PURE__*/React.createElement("div", {
|
|
389
389
|
className: "form-field__desc",
|
|
390
|
-
"data-testid": `${inputName}
|
|
390
|
+
"data-testid": `${inputName}-field-desc`
|
|
391
391
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
392
392
|
size: descTextSize,
|
|
393
393
|
textColor: descTextColor,
|
|
@@ -404,24 +404,24 @@ function FieldWrapperBase(props) {
|
|
|
404
404
|
fill: dividerFill
|
|
405
405
|
})), showMessage && /*#__PURE__*/React.createElement("div", {
|
|
406
406
|
className: "form-field__message",
|
|
407
|
-
"data-testid": `${inputName}
|
|
407
|
+
"data-testid": `${inputName}-field-message`
|
|
408
408
|
}, isErrorState && errorMessage && /*#__PURE__*/React.createElement(Text, {
|
|
409
409
|
id: `${inputName}-error`,
|
|
410
410
|
className: "form-field__message-item form-field__message-item_type-error",
|
|
411
|
-
dataTestId: `${inputName}
|
|
411
|
+
dataTestId: `${inputName}-field-message-error`,
|
|
412
412
|
size: errorTextSize,
|
|
413
413
|
textColor: errorTextColor,
|
|
414
414
|
textWeight: errorTextWeight
|
|
415
415
|
}, errorMessage), Boolean(helpText) && (!isErrorState || !errorMessage) && /*#__PURE__*/React.createElement(Text, {
|
|
416
416
|
className: "form-field__message-item form-field__message-item_type_help-text",
|
|
417
|
-
dataTestId: `${inputName}
|
|
417
|
+
dataTestId: `${inputName}-field-message-help-text`,
|
|
418
418
|
size: helpTextSize,
|
|
419
419
|
textColor: isValidState ? helpTextColorSuccess : helpTextColor,
|
|
420
420
|
textWeight: helpTextWeight,
|
|
421
421
|
sizeMobile: helpTextSizeMobile
|
|
422
422
|
}, helpText), (!isErrorState && !helpText || isErrorState && !helpText && !errorMessage) && /*#__PURE__*/React.createElement(Text, {
|
|
423
423
|
className: "form-field__message-item form-field__message-item_type_help-text",
|
|
424
|
-
dataTestId: `${inputName}
|
|
424
|
+
dataTestId: `${inputName}field-message-help-text`,
|
|
425
425
|
size: messageTextSize
|
|
426
426
|
}, '\u00A0')), after);
|
|
427
427
|
}
|
|
@@ -1714,7 +1714,7 @@ const FormFieldInput = /*#__PURE__*/React.memo(function FormFieldInput(props) {
|
|
|
1714
1714
|
isValidState: isValidState
|
|
1715
1715
|
}, fieldProps), /*#__PURE__*/React.createElement(Input, Object.assign({
|
|
1716
1716
|
className: clsx(meta.active && 'input_state_focus', meta.error && meta.touched && `input_state_${errorKey}`),
|
|
1717
|
-
dataTestId: `${input.name}
|
|
1717
|
+
dataTestId: `${input.name}-field-input`,
|
|
1718
1718
|
type: "text",
|
|
1719
1719
|
name: input.name,
|
|
1720
1720
|
autoComplete: "nope",
|
|
@@ -1911,7 +1911,7 @@ const FormFieldPassword = /*#__PURE__*/React.memo(function FormFieldPassword(pro
|
|
|
1911
1911
|
isValidState: isValidState
|
|
1912
1912
|
}, fieldProps), /*#__PURE__*/React.createElement(InputPassword, Object.assign({
|
|
1913
1913
|
className: clsx(meta.active && 'input-password_state_focus', meta.error && meta.touched && `input-password_state_${errorKey}`),
|
|
1914
|
-
dataTestId: `${input.name}
|
|
1914
|
+
dataTestId: `${input.name}-field-input-password`,
|
|
1915
1915
|
name: input.name,
|
|
1916
1916
|
autoComplete: "nope",
|
|
1917
1917
|
value: input.value || '',
|
|
@@ -2337,11 +2337,11 @@ const defaultTextareaProps = {
|
|
|
2337
2337
|
const FormFieldTextarea = /*#__PURE__*/React.memo(function FormFieldTextarea(props) {
|
|
2338
2338
|
const {
|
|
2339
2339
|
name,
|
|
2340
|
-
isDisabled,
|
|
2341
2340
|
classNameGroupItem,
|
|
2342
2341
|
fieldProps = {},
|
|
2343
2342
|
inputProps = {},
|
|
2344
2343
|
showMessage,
|
|
2344
|
+
isDisabled,
|
|
2345
2345
|
isRequired
|
|
2346
2346
|
} = props;
|
|
2347
2347
|
return /*#__PURE__*/React.createElement(Field, {
|
|
@@ -2360,8 +2360,8 @@ const FormFieldTextarea = /*#__PURE__*/React.memo(function FormFieldTextarea(pro
|
|
|
2360
2360
|
const {
|
|
2361
2361
|
errorKey,
|
|
2362
2362
|
errorMessage,
|
|
2363
|
-
isErrorState,
|
|
2364
2363
|
successKey,
|
|
2364
|
+
isErrorState,
|
|
2365
2365
|
isValidState
|
|
2366
2366
|
} = useFieldValidationState({
|
|
2367
2367
|
fieldProps: fieldProps,
|
|
@@ -2376,23 +2376,23 @@ const FormFieldTextarea = /*#__PURE__*/React.memo(function FormFieldTextarea(pro
|
|
|
2376
2376
|
className: clsx('form-field_textarea', 'form__item_textarea', classNameGroupItem),
|
|
2377
2377
|
errorKey: errorKey,
|
|
2378
2378
|
errorMessage: errorMessage,
|
|
2379
|
-
isErrorState: isErrorState,
|
|
2380
|
-
metaError: meta.error,
|
|
2381
|
-
isDisabled: isDisabled,
|
|
2382
2379
|
fieldClassName: 'form-textarea',
|
|
2383
2380
|
inputName: input.name,
|
|
2384
2381
|
inputValue: input.value,
|
|
2385
2382
|
metaActive: meta.active,
|
|
2383
|
+
metaError: meta.error,
|
|
2386
2384
|
showMessage: showMessage,
|
|
2385
|
+
isDisabled: isDisabled,
|
|
2386
|
+
isErrorState: isErrorState,
|
|
2387
2387
|
isRequired: isRequired,
|
|
2388
2388
|
isValidState: isValidState
|
|
2389
2389
|
}, fieldProps), /*#__PURE__*/React.createElement(Textarea, Object.assign({
|
|
2390
|
-
dataTestId: `${input.name}FieldTextarea`,
|
|
2391
2390
|
className: clsx(meta.active && 'textarea_state_focus', meta.error && meta.touched && `textarea_state_${errorKey}`),
|
|
2391
|
+
dataTestId: `${input.name}-field-textarea`,
|
|
2392
2392
|
name: input.name,
|
|
2393
|
-
isDisabled: isDisabled,
|
|
2394
2393
|
autoComplete: "nope",
|
|
2395
2394
|
value: input.value || '',
|
|
2395
|
+
isDisabled: isDisabled,
|
|
2396
2396
|
onBlur: input.onBlur,
|
|
2397
2397
|
onChange: input.onChange,
|
|
2398
2398
|
onFocus: input.onFocus
|
|
@@ -2751,6 +2751,7 @@ const FinalForm = /*#__PURE__*/React.forwardRef(function FinalForm(props, ref) {
|
|
|
2751
2751
|
dataTestId,
|
|
2752
2752
|
dataTour,
|
|
2753
2753
|
type,
|
|
2754
|
+
name,
|
|
2754
2755
|
initialValues,
|
|
2755
2756
|
initialValuesEqual,
|
|
2756
2757
|
config,
|
|
@@ -2801,6 +2802,7 @@ const FinalForm = /*#__PURE__*/React.forwardRef(function FinalForm(props, ref) {
|
|
|
2801
2802
|
primaryButtonAppearance,
|
|
2802
2803
|
primaryButtonFill,
|
|
2803
2804
|
primaryButtonFillHover,
|
|
2805
|
+
primaryButtonHtmlType,
|
|
2804
2806
|
primaryButtonIsDisabled,
|
|
2805
2807
|
primaryButtonIsLoading,
|
|
2806
2808
|
primaryButtonLabel,
|
|
@@ -2808,6 +2810,7 @@ const FinalForm = /*#__PURE__*/React.forwardRef(function FinalForm(props, ref) {
|
|
|
2808
2810
|
primaryButtonLabelTextColor,
|
|
2809
2811
|
primaryButtonLabelTextWeight,
|
|
2810
2812
|
primaryButtonSize,
|
|
2813
|
+
primarySecondaryHtmlType,
|
|
2811
2814
|
renderFieldsWrapper = wrapperChildren => wrapperChildren,
|
|
2812
2815
|
secondaryButton,
|
|
2813
2816
|
secondaryButtonAppearance,
|
|
@@ -2866,14 +2869,14 @@ const FinalForm = /*#__PURE__*/React.forwardRef(function FinalForm(props, ref) {
|
|
|
2866
2869
|
}) => {
|
|
2867
2870
|
return /*#__PURE__*/React.createElement("form", {
|
|
2868
2871
|
className: clsx(className, 'form', type && `form_type_${type}`, widthClass && `width_${widthClass}`, heightClass && `height_${heightClass}`, titlePosition && `form_title-position_${titlePosition}`, buttonPosition && `form_button-position_${buttonPosition}`, directionClass && `direction_${directionClass}`, fillClass && `fill_${fillClass}`, shapeClass && `shape_${shapeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`, elevationClass && `elevation_${elevationClass}`),
|
|
2869
|
-
name: formName
|
|
2872
|
+
name: formName || 'form'
|
|
2870
2873
|
// We no need set reference to html element, we need reference to "final-form" instance
|
|
2871
2874
|
,
|
|
2872
2875
|
ref: () => onRefFormInstance(form),
|
|
2873
2876
|
autoCapitalize: disableFieldsAutoComplete ? 'off' : undefined,
|
|
2874
2877
|
autoComplete: disableFieldsAutoComplete ? 'off' : undefined,
|
|
2875
2878
|
autoCorrect: disableFieldsAutoComplete ? 'off' : undefined,
|
|
2876
|
-
"data-testid": dataTestId,
|
|
2879
|
+
"data-testid": dataTestId || name,
|
|
2877
2880
|
"data-tour": dataTour,
|
|
2878
2881
|
spellCheck: disableFieldsAutoComplete ? 'false' : undefined,
|
|
2879
2882
|
style: formStyles,
|
|
@@ -2930,7 +2933,7 @@ const FinalForm = /*#__PURE__*/React.forwardRef(function FinalForm(props, ref) {
|
|
|
2930
2933
|
}, primaryButtonLabel ? /*#__PURE__*/React.createElement(Button, {
|
|
2931
2934
|
appearance: primaryButtonAppearance,
|
|
2932
2935
|
className: "form__button-item",
|
|
2933
|
-
dataTestId: dataTestIdPrimaryButton,
|
|
2936
|
+
dataTestId: dataTestIdPrimaryButton || (name ? `${name}-primary` : 'form-primary'),
|
|
2934
2937
|
dataTour: dataTourPrimaryButton,
|
|
2935
2938
|
width: "fill",
|
|
2936
2939
|
size: primaryButtonSize,
|
|
@@ -2940,12 +2943,13 @@ const FinalForm = /*#__PURE__*/React.forwardRef(function FinalForm(props, ref) {
|
|
|
2940
2943
|
labelTextColor: primaryButtonLabelTextColor,
|
|
2941
2944
|
labelTextSize: primaryButtonLabelSize,
|
|
2942
2945
|
labelTextWeight: primaryButtonLabelTextWeight,
|
|
2946
|
+
htmlType: primaryButtonHtmlType || 'submit',
|
|
2943
2947
|
loading: primaryButtonIsLoading,
|
|
2944
2948
|
isDisabled: primaryButtonIsDisabled
|
|
2945
2949
|
}) : primaryButton, secondaryButtonLabel ? /*#__PURE__*/React.createElement(Button, {
|
|
2946
2950
|
appearance: secondaryButtonAppearance,
|
|
2947
2951
|
className: "form__button-item",
|
|
2948
|
-
dataTestId: dataTestIdSecondaryButton,
|
|
2952
|
+
dataTestId: dataTestIdSecondaryButton || (name ? `${name}-secondary` : 'form-secondary'),
|
|
2949
2953
|
dataTour: dataTourSecondaryButton,
|
|
2950
2954
|
width: "fill",
|
|
2951
2955
|
size: secondaryButtonSize,
|
|
@@ -2955,6 +2959,7 @@ const FinalForm = /*#__PURE__*/React.forwardRef(function FinalForm(props, ref) {
|
|
|
2955
2959
|
labelTextColor: secondaryButtonLabelTextColor,
|
|
2956
2960
|
labelTextSize: secondaryButtonLabelSize,
|
|
2957
2961
|
labelTextWeight: secondaryButtonLabelTextWeight,
|
|
2962
|
+
htmlType: primarySecondaryHtmlType,
|
|
2958
2963
|
loading: secondaryButtonIsLoading,
|
|
2959
2964
|
isDisabled: secondaryButtonIsDisabled,
|
|
2960
2965
|
onClick: onClickSecondaryButton
|