@itcase/forms 1.0.49 → 1.0.51
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
CHANGED
|
@@ -124,30 +124,33 @@ function FieldWrapperBase(props) {
|
|
|
124
124
|
beforeItem,
|
|
125
125
|
children,
|
|
126
126
|
className,
|
|
127
|
+
dataTour,
|
|
127
128
|
desc,
|
|
128
|
-
descTextSize,
|
|
129
129
|
descTextColor,
|
|
130
|
+
descTextSize,
|
|
130
131
|
descTextWidth,
|
|
131
|
-
divider,
|
|
132
132
|
dividerDirection,
|
|
133
133
|
dividerFill,
|
|
134
134
|
dividerSize,
|
|
135
135
|
dividerWidth,
|
|
136
|
+
errorMessageTextColor,
|
|
137
|
+
errorMessageTextSize,
|
|
138
|
+
errorMessageTextWeight,
|
|
136
139
|
fieldClassName,
|
|
137
140
|
id,
|
|
138
141
|
inputName,
|
|
139
142
|
inputValue,
|
|
143
|
+
isDisabled,
|
|
144
|
+
isHidden,
|
|
140
145
|
isRequired,
|
|
141
146
|
label,
|
|
142
|
-
|
|
147
|
+
labelHidden,
|
|
143
148
|
labelTextColor,
|
|
149
|
+
labelTextSize,
|
|
144
150
|
labelTextWidth,
|
|
145
|
-
errorMessageTextSize,
|
|
146
|
-
errorMessageTextWeight,
|
|
147
|
-
errorMessageTextColor,
|
|
148
151
|
message,
|
|
149
|
-
messageTextSize,
|
|
150
152
|
messageTextColor,
|
|
153
|
+
messageTextSize,
|
|
151
154
|
messageTextWeight,
|
|
152
155
|
metaActive,
|
|
153
156
|
metaError,
|
|
@@ -157,14 +160,11 @@ function FieldWrapperBase(props) {
|
|
|
157
160
|
metaTouched,
|
|
158
161
|
metaValid,
|
|
159
162
|
set,
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
isDisabled,
|
|
164
|
-
isHidden,
|
|
163
|
+
showDivider,
|
|
164
|
+
showErrorsOnSubmit,
|
|
165
|
+
showMessage,
|
|
165
166
|
tag: Tag,
|
|
166
|
-
|
|
167
|
-
showErrorsOnSubmit
|
|
167
|
+
type
|
|
168
168
|
} = props;
|
|
169
169
|
const error = metaError || !metaModifiedSinceLastSubmit && metaSubmitError || false;
|
|
170
170
|
const showError = React.useMemo(() => {
|
|
@@ -233,13 +233,13 @@ function FieldWrapperBase(props) {
|
|
|
233
233
|
className: clsx__default.default('form-field__content', inputFillClass, inputShapeClass)
|
|
234
234
|
}, /*#__PURE__*/React__default.default.createElement("div", {
|
|
235
235
|
className: clsx__default.default('form-field__content-inner', fieldClass)
|
|
236
|
-
}, beforeItem, children, afterItem),
|
|
236
|
+
}, beforeItem, children, afterItem), showDivider && /*#__PURE__*/React__default.default.createElement(Divider.Divider, {
|
|
237
237
|
className: "form-field__item-divider",
|
|
238
238
|
width: dividerWidth,
|
|
239
239
|
direction: dividerDirection,
|
|
240
240
|
size: dividerSize,
|
|
241
241
|
fill: dividerFill
|
|
242
|
-
})),
|
|
242
|
+
})), showMessage && /*#__PURE__*/React__default.default.createElement("div", {
|
|
243
243
|
className: "form-field__message"
|
|
244
244
|
}, Boolean(showError) && error && typeof error === 'string' && /*#__PURE__*/React__default.default.createElement(Text.Text, {
|
|
245
245
|
className: "form-field__message-item form-field__message-item_type-error",
|
|
@@ -258,10 +258,10 @@ function FieldWrapperBase(props) {
|
|
|
258
258
|
}, '\u00A0')), after);
|
|
259
259
|
}
|
|
260
260
|
FieldWrapperBase.defaultProps = {
|
|
261
|
-
|
|
262
|
-
type: 'normal',
|
|
261
|
+
errorMessageTextColor: 'errorTextSecondary',
|
|
263
262
|
errorMessageTextSize: 's',
|
|
264
|
-
|
|
263
|
+
tag: 'div',
|
|
264
|
+
type: 'normal'
|
|
265
265
|
};
|
|
266
266
|
FieldWrapperBase.propTypes = {
|
|
267
267
|
after: PropTypes__default.default.any,
|
|
@@ -271,14 +271,19 @@ FieldWrapperBase.propTypes = {
|
|
|
271
271
|
beforeItem: PropTypes__default.default.any,
|
|
272
272
|
children: PropTypes__default.default.any,
|
|
273
273
|
className: PropTypes__default.default.string,
|
|
274
|
+
dataTour: PropTypes__default.default.string,
|
|
274
275
|
desc: PropTypes__default.default.string,
|
|
275
|
-
descTextSize: PropTypes__default.default.string,
|
|
276
276
|
descTextColor: PropTypes__default.default.string,
|
|
277
|
+
descTextSize: PropTypes__default.default.string,
|
|
277
278
|
descTextWidth: PropTypes__default.default.string,
|
|
278
279
|
dividerDirection: PropTypes__default.default.string,
|
|
279
280
|
dividerFill: PropTypes__default.default.string,
|
|
280
281
|
dividerSize: PropTypes__default.default.string,
|
|
281
282
|
dividerWidth: PropTypes__default.default.string,
|
|
283
|
+
errorMessageTextColor: PropTypes__default.default.string,
|
|
284
|
+
errorMessageTextSize: PropTypes__default.default.string,
|
|
285
|
+
errorMessageTextWeight: PropTypes__default.default.oneOfType([PropTypes__default.default.string, PropTypes__default.default.number]),
|
|
286
|
+
errorMessageTextWidth: PropTypes__default.default.string,
|
|
282
287
|
fieldClassName: PropTypes__default.default.string,
|
|
283
288
|
id: PropTypes__default.default.string,
|
|
284
289
|
inputName: PropTypes__default.default.string,
|
|
@@ -286,18 +291,20 @@ FieldWrapperBase.propTypes = {
|
|
|
286
291
|
inputOnChange: PropTypes__default.default.func,
|
|
287
292
|
inputOnFocus: PropTypes__default.default.func,
|
|
288
293
|
inputValue: PropTypes__default.default.any,
|
|
294
|
+
isDisabled: PropTypes__default.default.bool,
|
|
295
|
+
isHidden: PropTypes__default.default.bool,
|
|
289
296
|
isRequired: PropTypes__default.default.bool,
|
|
290
297
|
itemType: PropTypes__default.default.string,
|
|
291
298
|
label: PropTypes__default.default.any,
|
|
292
|
-
|
|
299
|
+
labelHidden: PropTypes__default.default.string,
|
|
293
300
|
labelTextColor: PropTypes__default.default.string,
|
|
301
|
+
labelTextSize: PropTypes__default.default.string,
|
|
294
302
|
labelTextWidth: PropTypes__default.default.string,
|
|
295
|
-
errorMessageTextSize: PropTypes__default.default.string,
|
|
296
|
-
errorMessageTextWidth: PropTypes__default.default.string,
|
|
297
|
-
errorMessageTextColor: PropTypes__default.default.string,
|
|
298
303
|
message: PropTypes__default.default.string,
|
|
299
304
|
messageSize: PropTypes__default.default.string,
|
|
300
305
|
messageTextColor: PropTypes__default.default.string,
|
|
306
|
+
messageTextSize: PropTypes__default.default.oneOfType([PropTypes__default.default.string, PropTypes__default.default.number]),
|
|
307
|
+
messageTextWeight: PropTypes__default.default.oneOfType([PropTypes__default.default.string, PropTypes__default.default.number]),
|
|
301
308
|
messageTextWidth: PropTypes__default.default.string,
|
|
302
309
|
metaActive: PropTypes__default.default.bool,
|
|
303
310
|
metaError: PropTypes__default.default.string,
|
|
@@ -307,7 +314,10 @@ FieldWrapperBase.propTypes = {
|
|
|
307
314
|
metaTouched: PropTypes__default.default.bool,
|
|
308
315
|
metaValid: PropTypes__default.default.bool,
|
|
309
316
|
set: PropTypes__default.default.string,
|
|
317
|
+
showDivider: PropTypes__default.default.bool,
|
|
310
318
|
showErrorsOnSubmit: PropTypes__default.default.bool,
|
|
319
|
+
showMessage: PropTypes__default.default.bool,
|
|
320
|
+
tag: PropTypes__default.default.oneOfType([PropTypes__default.default.elementType, PropTypes__default.default.string]),
|
|
311
321
|
type: PropTypes__default.default.string
|
|
312
322
|
};
|
|
313
323
|
function FieldWrapper(props) {
|
|
@@ -325,44 +335,24 @@ function FieldWrapper(props) {
|
|
|
325
335
|
}, []);
|
|
326
336
|
return /*#__PURE__*/React__default.default.createElement(FieldWrapperBase, props);
|
|
327
337
|
}
|
|
328
|
-
FieldWrapper.propTypes =
|
|
329
|
-
autoComplete: PropTypes__default.default.string,
|
|
330
|
-
children: PropTypes__default.default.any,
|
|
331
|
-
className: PropTypes__default.default.string,
|
|
332
|
-
fieldClassName: PropTypes__default.default.string,
|
|
333
|
-
hint: PropTypes__default.default.string,
|
|
334
|
-
inputName: PropTypes__default.default.string,
|
|
335
|
-
inputOnBlur: PropTypes__default.default.func,
|
|
336
|
-
inputOnChange: PropTypes__default.default.func,
|
|
337
|
-
inputOnFocus: PropTypes__default.default.func,
|
|
338
|
-
inputValue: PropTypes__default.default.any,
|
|
339
|
-
isRequired: PropTypes__default.default.bool,
|
|
340
|
-
itemType: PropTypes__default.default.string,
|
|
341
|
-
label: PropTypes__default.default.any,
|
|
342
|
-
metaActive: PropTypes__default.default.bool,
|
|
343
|
-
metaError: PropTypes__default.default.string,
|
|
344
|
-
metaModifiedSinceLastSubmit: PropTypes__default.default.bool,
|
|
345
|
-
metaSubmitError: PropTypes__default.default.string,
|
|
346
|
-
metaSubmitFailed: PropTypes__default.default.bool,
|
|
347
|
-
metaTouched: PropTypes__default.default.bool,
|
|
348
|
-
metaValid: PropTypes__default.default.bool,
|
|
349
|
-
showErrorsOnSubmit: PropTypes__default.default.bool
|
|
350
|
-
};
|
|
338
|
+
FieldWrapper.propTypes = FieldWrapperBase.propTypes;
|
|
351
339
|
|
|
352
340
|
const CheckboxField = /*#__PURE__*/React__default.default.memo(function CheckboxField(props) {
|
|
353
341
|
const {
|
|
354
|
-
|
|
355
|
-
isDisabled,
|
|
356
|
-
isRequired,
|
|
357
|
-
onChange,
|
|
342
|
+
classNameGroupItem,
|
|
358
343
|
fieldProps,
|
|
344
|
+
initialValue,
|
|
359
345
|
inputProps,
|
|
360
|
-
|
|
361
|
-
|
|
346
|
+
isDisabled,
|
|
347
|
+
isRequired,
|
|
348
|
+
name,
|
|
349
|
+
showMessage,
|
|
350
|
+
onChange
|
|
362
351
|
} = props;
|
|
363
352
|
return /*#__PURE__*/React__default.default.createElement(reactFinalForm.Field, {
|
|
364
353
|
name: name,
|
|
365
|
-
type: "checkbox"
|
|
354
|
+
type: "checkbox",
|
|
355
|
+
initialValue: initialValue
|
|
366
356
|
}, ({
|
|
367
357
|
input,
|
|
368
358
|
meta
|
|
@@ -388,7 +378,7 @@ const CheckboxField = /*#__PURE__*/React__default.default.memo(function Checkbox
|
|
|
388
378
|
metaTouched: meta.touched,
|
|
389
379
|
metaValid: meta.valid,
|
|
390
380
|
tag: "label",
|
|
391
|
-
|
|
381
|
+
showMessage: showMessage
|
|
392
382
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(Checkbox.Checkbox, Object.assign({
|
|
393
383
|
autoComplete: "nope",
|
|
394
384
|
checked: input.checked,
|
|
@@ -402,14 +392,18 @@ const CheckboxField = /*#__PURE__*/React__default.default.memo(function Checkbox
|
|
|
402
392
|
});
|
|
403
393
|
});
|
|
404
394
|
CheckboxField.defaultProps = {
|
|
405
|
-
|
|
406
|
-
|
|
395
|
+
fieldProps: {},
|
|
396
|
+
inputProps: {}
|
|
407
397
|
};
|
|
408
398
|
CheckboxField.propTypes = {
|
|
399
|
+
initialValue: PropTypes__default.default.bool,
|
|
400
|
+
classNameGroupItem: PropTypes__default.default.string,
|
|
409
401
|
fieldProps: PropTypes__default.default.object,
|
|
410
402
|
inputProps: PropTypes__default.default.object,
|
|
403
|
+
isDisabled: PropTypes__default.default.bool,
|
|
411
404
|
isRequired: PropTypes__default.default.bool,
|
|
412
405
|
name: PropTypes__default.default.string,
|
|
406
|
+
showMessage: PropTypes__default.default.bool,
|
|
413
407
|
onChange: PropTypes__default.default.func
|
|
414
408
|
};
|
|
415
409
|
|
|
@@ -417,7 +411,7 @@ const ChoiceField = /*#__PURE__*/React__default.default.memo(function ChoiceFiel
|
|
|
417
411
|
const {
|
|
418
412
|
classNameGroupItem,
|
|
419
413
|
fieldProps,
|
|
420
|
-
|
|
414
|
+
showMessage,
|
|
421
415
|
initialValue,
|
|
422
416
|
inputProps,
|
|
423
417
|
isMultiple,
|
|
@@ -473,7 +467,7 @@ const ChoiceField = /*#__PURE__*/React__default.default.memo(function ChoiceFiel
|
|
|
473
467
|
metaSubmitFailed: meta.submitFailed,
|
|
474
468
|
metaTouched: meta.touched,
|
|
475
469
|
metaValid: meta.valid,
|
|
476
|
-
|
|
470
|
+
showMessage: showMessage
|
|
477
471
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(Choice.Choice, Object.assign({
|
|
478
472
|
className: clsx__default.default(meta.active && 'form-choice_state_focus', meta.error && meta.touched && 'form-choice_state_error'),
|
|
479
473
|
options: options,
|
|
@@ -491,7 +485,7 @@ const ChoiceField = /*#__PURE__*/React__default.default.memo(function ChoiceFiel
|
|
|
491
485
|
ChoiceField.propTypes = {
|
|
492
486
|
classNameGroupItem: PropTypes__default.default.string,
|
|
493
487
|
fieldProps: PropTypes__default.default.object,
|
|
494
|
-
|
|
488
|
+
showMessage: PropTypes__default.default.bool,
|
|
495
489
|
initialValue: PropTypes__default.default.oneOfType([PropTypes__default.default.string, PropTypes__default.default.number, PropTypes__default.default.bool]),
|
|
496
490
|
inputProps: PropTypes__default.default.object,
|
|
497
491
|
isMultiple: PropTypes__default.default.bool,
|
|
@@ -510,12 +504,14 @@ const CustomField = /*#__PURE__*/React__default.default.memo(function CustomFiel
|
|
|
510
504
|
isDisabled,
|
|
511
505
|
isRequired,
|
|
512
506
|
name,
|
|
507
|
+
initialValue,
|
|
513
508
|
fieldProps,
|
|
514
509
|
classNameGroupItem,
|
|
515
|
-
|
|
510
|
+
showMessage
|
|
516
511
|
} = props;
|
|
517
512
|
return /*#__PURE__*/React__default.default.createElement(reactFinalForm.Field, {
|
|
518
|
-
name: name
|
|
513
|
+
name: name,
|
|
514
|
+
initialValue: initialValue
|
|
519
515
|
}, ({
|
|
520
516
|
input,
|
|
521
517
|
meta
|
|
@@ -533,7 +529,7 @@ const CustomField = /*#__PURE__*/React__default.default.memo(function CustomFiel
|
|
|
533
529
|
metaSubmitFailed: meta.submitFailed,
|
|
534
530
|
metaTouched: meta.touched,
|
|
535
531
|
metaValid: meta.valid,
|
|
536
|
-
|
|
532
|
+
showMessage: showMessage
|
|
537
533
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(Component, Object.assign({}, props, {
|
|
538
534
|
isDisabled: isDisabled,
|
|
539
535
|
input: input,
|
|
@@ -545,10 +541,15 @@ CustomField.defaultProps = {
|
|
|
545
541
|
fieldProps: {}
|
|
546
542
|
};
|
|
547
543
|
CustomField.propTypes = {
|
|
548
|
-
|
|
549
|
-
|
|
544
|
+
Component: PropTypes__default.default.element,
|
|
545
|
+
classNameGroupItem: PropTypes__default.default.string,
|
|
550
546
|
fieldProps: PropTypes__default.default.object,
|
|
551
|
-
|
|
547
|
+
initialValue: PropTypes__default.default.any,
|
|
548
|
+
inputProps: PropTypes__default.default.object,
|
|
549
|
+
isDisabled: PropTypes__default.default.bool,
|
|
550
|
+
isRequired: PropTypes__default.default.bool,
|
|
551
|
+
name: PropTypes__default.default.string.isRequired,
|
|
552
|
+
showMessage: PropTypes__default.default.bool
|
|
552
553
|
};
|
|
553
554
|
|
|
554
555
|
const CodeField = /*#__PURE__*/React__default.default.memo(function CodeField(props) {
|
|
@@ -557,12 +558,14 @@ const CodeField = /*#__PURE__*/React__default.default.memo(function CodeField(pr
|
|
|
557
558
|
isDisabled,
|
|
558
559
|
name,
|
|
559
560
|
fieldProps,
|
|
561
|
+
initialValue,
|
|
560
562
|
inputProps,
|
|
561
563
|
classNameGroupItem,
|
|
562
|
-
|
|
564
|
+
showMessage
|
|
563
565
|
} = props;
|
|
564
566
|
return /*#__PURE__*/React__default.default.createElement(reactFinalForm.Field, {
|
|
565
|
-
name: name
|
|
567
|
+
name: name,
|
|
568
|
+
initialValue: initialValue
|
|
566
569
|
}, ({
|
|
567
570
|
input,
|
|
568
571
|
meta
|
|
@@ -580,7 +583,7 @@ const CodeField = /*#__PURE__*/React__default.default.memo(function CodeField(pr
|
|
|
580
583
|
metaSubmitFailed: meta.submitFailed,
|
|
581
584
|
metaTouched: meta.touched,
|
|
582
585
|
metaValid: meta.valid,
|
|
583
|
-
|
|
586
|
+
showMessage: showMessage
|
|
584
587
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(Code.Code, Object.assign({
|
|
585
588
|
autoComplete: "nope",
|
|
586
589
|
name: input.name,
|
|
@@ -596,10 +599,14 @@ CodeField.defaultProps = {
|
|
|
596
599
|
fieldProps: {}
|
|
597
600
|
};
|
|
598
601
|
CodeField.propTypes = {
|
|
599
|
-
|
|
600
|
-
isRequired: PropTypes__default.default.bool,
|
|
602
|
+
classNameGroupItem: PropTypes__default.default.string,
|
|
601
603
|
fieldProps: PropTypes__default.default.object,
|
|
602
|
-
|
|
604
|
+
initialValue: PropTypes__default.default.string,
|
|
605
|
+
inputProps: PropTypes__default.default.object,
|
|
606
|
+
isDisabled: PropTypes__default.default.bool,
|
|
607
|
+
isRequired: PropTypes__default.default.bool,
|
|
608
|
+
name: PropTypes__default.default.string.isRequired,
|
|
609
|
+
showMessage: PropTypes__default.default.bool
|
|
603
610
|
};
|
|
604
611
|
|
|
605
612
|
function DatePickerField(props) {
|
|
@@ -618,7 +625,7 @@ function DatePickerField(props) {
|
|
|
618
625
|
iconRevealableShow,
|
|
619
626
|
iconRevealableHide,
|
|
620
627
|
iconShape,
|
|
621
|
-
|
|
628
|
+
showMessage,
|
|
622
629
|
onChange,
|
|
623
630
|
classNameGroupItem
|
|
624
631
|
} = props;
|
|
@@ -648,7 +655,7 @@ function DatePickerField(props) {
|
|
|
648
655
|
metaSubmitFailed: meta.submitFailed,
|
|
649
656
|
metaTouched: meta.touched,
|
|
650
657
|
metaValid: meta.valid,
|
|
651
|
-
|
|
658
|
+
showMessage: showMessage
|
|
652
659
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(DatePicker.DatePickerInput, {
|
|
653
660
|
name: input.name,
|
|
654
661
|
value: input.value || '',
|
|
@@ -786,7 +793,7 @@ const FileInputDropzone = /*#__PURE__*/React__default.default.memo(function File
|
|
|
786
793
|
removeThumbText,
|
|
787
794
|
hintTitle,
|
|
788
795
|
hintDescription,
|
|
789
|
-
|
|
796
|
+
showFilename,
|
|
790
797
|
isPreviews,
|
|
791
798
|
loadingText,
|
|
792
799
|
dropzoneProps = {},
|
|
@@ -976,7 +983,7 @@ const FileInputDropzone = /*#__PURE__*/React__default.default.memo(function File
|
|
|
976
983
|
textColor: thumbNameTextColor,
|
|
977
984
|
textWrap: thumbNameTextWrap,
|
|
978
985
|
textWeight: thumbNameTextWeight
|
|
979
|
-
}, fileErrorText || file.error)),
|
|
986
|
+
}, fileErrorText || file.error)), showFilename && /*#__PURE__*/React__default.default.createElement("div", {
|
|
980
987
|
className: "form-dropzone__thumb-name"
|
|
981
988
|
}, /*#__PURE__*/React__default.default.createElement(Text.Text, {
|
|
982
989
|
size: thumbNameTextSize,
|
|
@@ -1045,7 +1052,7 @@ FileInputDropzone.propTypes = {
|
|
|
1045
1052
|
inputName: PropTypes__default.default.string,
|
|
1046
1053
|
inputValue: PropTypes__default.default.any,
|
|
1047
1054
|
isPreviews: PropTypes__default.default.bool,
|
|
1048
|
-
|
|
1055
|
+
showFilename: PropTypes__default.default.bool,
|
|
1049
1056
|
loadingText: PropTypes__default.default.string,
|
|
1050
1057
|
metaError: PropTypes__default.default.string,
|
|
1051
1058
|
metaTouched: PropTypes__default.default.bool,
|
|
@@ -1094,10 +1101,10 @@ const FileInput = /*#__PURE__*/React__default.default.memo(function FileInput(pr
|
|
|
1094
1101
|
hintDescriptionTextColor,
|
|
1095
1102
|
hintDescriptionTextWrap,
|
|
1096
1103
|
hintDescriptionTextWeight,
|
|
1097
|
-
|
|
1104
|
+
showMessage,
|
|
1098
1105
|
thumbDirection,
|
|
1099
1106
|
hintDescription,
|
|
1100
|
-
|
|
1107
|
+
showFilename,
|
|
1101
1108
|
fileErrorText,
|
|
1102
1109
|
dropzoneProps,
|
|
1103
1110
|
maxFiles,
|
|
@@ -1130,7 +1137,7 @@ const FileInput = /*#__PURE__*/React__default.default.memo(function FileInput(pr
|
|
|
1130
1137
|
metaSubmitFailed: meta.submitFailed,
|
|
1131
1138
|
metaTouched: meta.touched,
|
|
1132
1139
|
metaValid: meta.valid,
|
|
1133
|
-
|
|
1140
|
+
showMessage: showMessage,
|
|
1134
1141
|
width: width
|
|
1135
1142
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(FileInputDropzone, {
|
|
1136
1143
|
dropzoneProps: dropzoneProps,
|
|
@@ -1176,7 +1183,7 @@ const FileInput = /*#__PURE__*/React__default.default.memo(function FileInput(pr
|
|
|
1176
1183
|
errorMessageTextColor: errorMessageTextColor,
|
|
1177
1184
|
isPreviews: isPreviews,
|
|
1178
1185
|
shape: shape,
|
|
1179
|
-
|
|
1186
|
+
showFilename: showFilename,
|
|
1180
1187
|
metaError: meta.error,
|
|
1181
1188
|
metaTouched: meta.touched,
|
|
1182
1189
|
removeThumbText: removeThumbText,
|
|
@@ -1202,7 +1209,7 @@ FileInput.propTypes = {
|
|
|
1202
1209
|
inputClass: PropTypes__default.default.string,
|
|
1203
1210
|
isPreviews: PropTypes__default.default.bool,
|
|
1204
1211
|
isRequired: PropTypes__default.default.bool,
|
|
1205
|
-
|
|
1212
|
+
showFilename: PropTypes__default.default.bool,
|
|
1206
1213
|
label: PropTypes__default.default.any,
|
|
1207
1214
|
removeThumbText: PropTypes__default.default.string,
|
|
1208
1215
|
onAddFiles: PropTypes__default.default.func,
|
|
@@ -1227,7 +1234,7 @@ const Group = /*#__PURE__*/React__default.default.memo(function Group(props) {
|
|
|
1227
1234
|
messageTextColor,
|
|
1228
1235
|
children,
|
|
1229
1236
|
dataTour,
|
|
1230
|
-
|
|
1237
|
+
showGroupMessage,
|
|
1231
1238
|
name,
|
|
1232
1239
|
showErrorsOnSubmit
|
|
1233
1240
|
} = props;
|
|
@@ -1258,7 +1265,7 @@ const Group = /*#__PURE__*/React__default.default.memo(function Group(props) {
|
|
|
1258
1265
|
textWeight: labelTextWeight
|
|
1259
1266
|
}, label)), /*#__PURE__*/React__default.default.createElement("div", {
|
|
1260
1267
|
className: "form__group-items"
|
|
1261
|
-
}, children), after),
|
|
1268
|
+
}, children), after), showGroupMessage && /*#__PURE__*/React__default.default.createElement(React__default.default.Fragment, null, Boolean(showError) && /*#__PURE__*/React__default.default.createElement(Text.Text, {
|
|
1262
1269
|
className: "form__group-message form__group-message_type-error",
|
|
1263
1270
|
size: errorMessageTextSize,
|
|
1264
1271
|
textWeight: errorMessageTextWeight,
|
|
@@ -1306,10 +1313,11 @@ const InputField = /*#__PURE__*/React__default.default.memo(function InputField(
|
|
|
1306
1313
|
iconBorderHover,
|
|
1307
1314
|
iconFill,
|
|
1308
1315
|
iconFillHover,
|
|
1309
|
-
iconRevealableShow,
|
|
1310
1316
|
iconRevealableHide,
|
|
1317
|
+
iconRevealableShow,
|
|
1311
1318
|
iconShape,
|
|
1312
|
-
|
|
1319
|
+
initialValue,
|
|
1320
|
+
showMessage,
|
|
1313
1321
|
onChange,
|
|
1314
1322
|
classNameGroupItem
|
|
1315
1323
|
} = props;
|
|
@@ -1327,7 +1335,8 @@ const InputField = /*#__PURE__*/React__default.default.memo(function InputField(
|
|
|
1327
1335
|
}, [setIsRevealed]);
|
|
1328
1336
|
return /*#__PURE__*/React__default.default.createElement(reactFinalForm.Field, {
|
|
1329
1337
|
name: name,
|
|
1330
|
-
parse: parse
|
|
1338
|
+
parse: parse,
|
|
1339
|
+
initialValue: initialValue
|
|
1331
1340
|
}, ({
|
|
1332
1341
|
input,
|
|
1333
1342
|
meta
|
|
@@ -1352,7 +1361,7 @@ const InputField = /*#__PURE__*/React__default.default.memo(function InputField(
|
|
|
1352
1361
|
metaSubmitFailed: meta.submitFailed,
|
|
1353
1362
|
metaTouched: meta.touched,
|
|
1354
1363
|
metaValid: meta.valid,
|
|
1355
|
-
|
|
1364
|
+
showMessage: showMessage
|
|
1356
1365
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(Input.Input, Object.assign({
|
|
1357
1366
|
className: clsx__default.default(meta.active && 'input_state_focus', meta.error && meta.touched && 'input_state_error'),
|
|
1358
1367
|
autoComplete: "nope",
|
|
@@ -1381,6 +1390,7 @@ InputField.defaultProps = {
|
|
|
1381
1390
|
};
|
|
1382
1391
|
InputField.propTypes = {
|
|
1383
1392
|
fieldProps: PropTypes__default.default.object,
|
|
1393
|
+
initialValue: PropTypes__default.default.oneOfType([PropTypes__default.default.string, PropTypes__default.default.number]),
|
|
1384
1394
|
inputProps: PropTypes__default.default.object,
|
|
1385
1395
|
isPassword: PropTypes__default.default.bool,
|
|
1386
1396
|
isRequired: PropTypes__default.default.bool,
|
|
@@ -1400,7 +1410,7 @@ function RadioGroupItem(props) {
|
|
|
1400
1410
|
if (event.target.checked) {
|
|
1401
1411
|
onChange(option.value);
|
|
1402
1412
|
}
|
|
1403
|
-
}, []);
|
|
1413
|
+
}, [onChange]);
|
|
1404
1414
|
return /*#__PURE__*/React__default.default.createElement(RadioButton.RadioButton, Object.assign({
|
|
1405
1415
|
className: "form-radio__item",
|
|
1406
1416
|
checked: option.value === input.value,
|
|
@@ -1530,15 +1540,15 @@ RadioGroupList.propTypes = {
|
|
|
1530
1540
|
|
|
1531
1541
|
const RadioGroup = /*#__PURE__*/React__default.default.memo(function RadioGroup(props) {
|
|
1532
1542
|
const {
|
|
1533
|
-
isRequired,
|
|
1534
|
-
name,
|
|
1535
|
-
options,
|
|
1536
|
-
fieldProps,
|
|
1537
1543
|
editableProps,
|
|
1544
|
+
fieldProps,
|
|
1538
1545
|
inputProps,
|
|
1539
|
-
onChange,
|
|
1540
1546
|
isDisabled,
|
|
1541
|
-
|
|
1547
|
+
isRequired,
|
|
1548
|
+
name,
|
|
1549
|
+
options,
|
|
1550
|
+
showMessage,
|
|
1551
|
+
onChange
|
|
1542
1552
|
} = props;
|
|
1543
1553
|
return /*#__PURE__*/React__default.default.createElement(reactFinalForm.Field, {
|
|
1544
1554
|
name: name
|
|
@@ -1559,7 +1569,7 @@ const RadioGroup = /*#__PURE__*/React__default.default.memo(function RadioGroup(
|
|
|
1559
1569
|
metaSubmitFailed: meta.submitFailed,
|
|
1560
1570
|
metaTouched: meta.touched,
|
|
1561
1571
|
metaValid: meta.valid,
|
|
1562
|
-
|
|
1572
|
+
showMessage: showMessage
|
|
1563
1573
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(RadioGroupList, {
|
|
1564
1574
|
input: input,
|
|
1565
1575
|
options: options,
|
|
@@ -1570,22 +1580,23 @@ const RadioGroup = /*#__PURE__*/React__default.default.memo(function RadioGroup(
|
|
|
1570
1580
|
})));
|
|
1571
1581
|
});
|
|
1572
1582
|
RadioGroup.defaultProps = {
|
|
1573
|
-
fieldProps: {},
|
|
1574
1583
|
editableProps: {},
|
|
1584
|
+
fieldProps: {},
|
|
1575
1585
|
inputProps: {},
|
|
1576
1586
|
options: []
|
|
1577
1587
|
};
|
|
1578
1588
|
RadioGroup.propTypes = {
|
|
1579
|
-
|
|
1589
|
+
editableProps: PropTypes__default.default.object,
|
|
1580
1590
|
fieldProps: PropTypes__default.default.object,
|
|
1581
1591
|
inputProps: PropTypes__default.default.object,
|
|
1582
|
-
|
|
1592
|
+
isDisabled: PropTypes__default.default.bool,
|
|
1583
1593
|
isRequired: PropTypes__default.default.bool,
|
|
1594
|
+
name: PropTypes__default.default.string.isRequired,
|
|
1584
1595
|
options: PropTypes__default.default.array,
|
|
1596
|
+
showMessage: PropTypes__default.default.bool,
|
|
1585
1597
|
onChange: PropTypes__default.default.func
|
|
1586
1598
|
};
|
|
1587
1599
|
|
|
1588
|
-
// const SegmentedField = React.memo(
|
|
1589
1600
|
function SegmentedField(props) {
|
|
1590
1601
|
const {
|
|
1591
1602
|
options,
|
|
@@ -1594,11 +1605,14 @@ function SegmentedField(props) {
|
|
|
1594
1605
|
fieldProps,
|
|
1595
1606
|
inputProps,
|
|
1596
1607
|
isDisabled,
|
|
1597
|
-
|
|
1608
|
+
showMessage
|
|
1598
1609
|
} = props;
|
|
1599
1610
|
const {
|
|
1600
1611
|
change
|
|
1601
1612
|
} = reactFinalForm.useForm();
|
|
1613
|
+
const setActiveSegment = React.useCallback(option => {
|
|
1614
|
+
change(name, option.value);
|
|
1615
|
+
}, [change]);
|
|
1602
1616
|
return /*#__PURE__*/React__default.default.createElement(reactFinalForm.Field, {
|
|
1603
1617
|
name: name
|
|
1604
1618
|
}, ({
|
|
@@ -1616,9 +1630,6 @@ function SegmentedField(props) {
|
|
|
1616
1630
|
}
|
|
1617
1631
|
return emptyOption;
|
|
1618
1632
|
}, [input.value]);
|
|
1619
|
-
const setActiveSegment = React.useCallback(option => {
|
|
1620
|
-
change(name, option.value);
|
|
1621
|
-
}, [change]);
|
|
1622
1633
|
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
1623
1634
|
className: clsx__default.default('form-field_type_segmented', 'form__item_type_segmented'),
|
|
1624
1635
|
fieldClassName: "form-segmented",
|
|
@@ -1633,7 +1644,7 @@ function SegmentedField(props) {
|
|
|
1633
1644
|
metaSubmitFailed: meta.submitFailed,
|
|
1634
1645
|
metaTouched: meta.touched,
|
|
1635
1646
|
metaValid: meta.valid,
|
|
1636
|
-
|
|
1647
|
+
showMessage: showMessage
|
|
1637
1648
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(Segmented.Segmented, Object.assign({
|
|
1638
1649
|
segments: options,
|
|
1639
1650
|
isDisabled: isDisabled,
|
|
@@ -1642,18 +1653,18 @@ function SegmentedField(props) {
|
|
|
1642
1653
|
}, inputProps)));
|
|
1643
1654
|
});
|
|
1644
1655
|
}
|
|
1645
|
-
// )
|
|
1646
|
-
|
|
1647
1656
|
SegmentedField.propTypes = {
|
|
1648
|
-
options: PropTypes__default.default.array.isRequired,
|
|
1649
|
-
name: PropTypes__default.default.string.isRequired,
|
|
1650
1657
|
className: PropTypes__default.default.string,
|
|
1658
|
+
fieldProps: PropTypes__default.default.object,
|
|
1651
1659
|
inputClass: PropTypes__default.default.string,
|
|
1660
|
+
inputProps: PropTypes__default.default.object,
|
|
1661
|
+
isDisabled: PropTypes__default.default.bool,
|
|
1652
1662
|
isRequired: PropTypes__default.default.bool,
|
|
1653
1663
|
label: PropTypes__default.default.string,
|
|
1664
|
+
name: PropTypes__default.default.string.isRequired,
|
|
1665
|
+
options: PropTypes__default.default.array.isRequired,
|
|
1654
1666
|
placeholder: PropTypes__default.default.string,
|
|
1655
|
-
|
|
1656
|
-
inputProps: PropTypes__default.default.object
|
|
1667
|
+
showMessage: PropTypes__default.default.bool
|
|
1657
1668
|
};
|
|
1658
1669
|
|
|
1659
1670
|
function getDefaultValue(options, selectValue) {
|
|
@@ -1678,13 +1689,13 @@ const SelectField = /*#__PURE__*/React__default.default.memo(function SelectFiel
|
|
|
1678
1689
|
const {
|
|
1679
1690
|
classNameGroupItem,
|
|
1680
1691
|
fieldProps,
|
|
1681
|
-
hideMessage,
|
|
1682
1692
|
isDisabled,
|
|
1683
1693
|
isRequired,
|
|
1684
1694
|
name,
|
|
1685
1695
|
options,
|
|
1686
1696
|
selectProps,
|
|
1687
1697
|
selectRef,
|
|
1698
|
+
showMessage,
|
|
1688
1699
|
onChange
|
|
1689
1700
|
} = props;
|
|
1690
1701
|
return /*#__PURE__*/React__default.default.createElement(reactFinalForm.Field, {
|
|
@@ -1730,7 +1741,7 @@ const SelectField = /*#__PURE__*/React__default.default.memo(function SelectFiel
|
|
|
1730
1741
|
metaSubmitFailed: meta.submitFailed,
|
|
1731
1742
|
metaTouched: meta.touched,
|
|
1732
1743
|
metaValid: meta.valid,
|
|
1733
|
-
|
|
1744
|
+
showMessage: showMessage
|
|
1734
1745
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(Select.Select, Object.assign({
|
|
1735
1746
|
className: "form-select-item",
|
|
1736
1747
|
instanceId: `id_${input.name}`,
|
|
@@ -1743,25 +1754,30 @@ const SelectField = /*#__PURE__*/React__default.default.memo(function SelectFiel
|
|
|
1743
1754
|
});
|
|
1744
1755
|
});
|
|
1745
1756
|
SelectField.propTypes = {
|
|
1746
|
-
|
|
1747
|
-
|
|
1757
|
+
classNameGroupItem: PropTypes__default.default.string,
|
|
1758
|
+
fieldProps: PropTypes__default.default.object,
|
|
1759
|
+
isDisabled: PropTypes__default.default.bool,
|
|
1748
1760
|
isRequired: PropTypes__default.default.bool,
|
|
1749
1761
|
label: PropTypes__default.default.any,
|
|
1750
1762
|
messageType: PropTypes__default.default.string,
|
|
1763
|
+
name: PropTypes__default.default.string.isRequired,
|
|
1751
1764
|
options: PropTypes__default.default.array,
|
|
1765
|
+
selectProps: PropTypes__default.default.object,
|
|
1766
|
+
selectRef: PropTypes__default.default.any,
|
|
1767
|
+
showMessage: PropTypes__default.default.bool,
|
|
1752
1768
|
onChange: PropTypes__default.default.func
|
|
1753
1769
|
};
|
|
1754
1770
|
|
|
1755
1771
|
const SwitchField = /*#__PURE__*/React__default.default.memo(function SwitchField(props) {
|
|
1756
1772
|
const {
|
|
1757
|
-
|
|
1758
|
-
isDisabled,
|
|
1759
|
-
isRequired,
|
|
1760
|
-
onChange,
|
|
1773
|
+
classNameGroupItem,
|
|
1761
1774
|
fieldProps,
|
|
1762
1775
|
inputProps,
|
|
1763
|
-
|
|
1764
|
-
|
|
1776
|
+
isDisabled,
|
|
1777
|
+
isRequired,
|
|
1778
|
+
name,
|
|
1779
|
+
showMessage,
|
|
1780
|
+
onChange
|
|
1765
1781
|
} = props;
|
|
1766
1782
|
return /*#__PURE__*/React__default.default.createElement(reactFinalForm.Field, {
|
|
1767
1783
|
name: name,
|
|
@@ -1790,7 +1806,7 @@ const SwitchField = /*#__PURE__*/React__default.default.memo(function SwitchFiel
|
|
|
1790
1806
|
metaSubmitFailed: meta.submitFailed,
|
|
1791
1807
|
metaTouched: meta.touched,
|
|
1792
1808
|
metaValid: meta.valid,
|
|
1793
|
-
|
|
1809
|
+
showMessage: showMessage,
|
|
1794
1810
|
tag: "label"
|
|
1795
1811
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(Switch.Switch, Object.assign({
|
|
1796
1812
|
autoComplete: "nope",
|
|
@@ -1805,14 +1821,17 @@ const SwitchField = /*#__PURE__*/React__default.default.memo(function SwitchFiel
|
|
|
1805
1821
|
});
|
|
1806
1822
|
});
|
|
1807
1823
|
SwitchField.defaultProps = {
|
|
1808
|
-
|
|
1809
|
-
|
|
1824
|
+
fieldProps: {},
|
|
1825
|
+
inputProps: {}
|
|
1810
1826
|
};
|
|
1811
1827
|
SwitchField.propTypes = {
|
|
1828
|
+
classNameGroupItem: PropTypes__default.default.string,
|
|
1812
1829
|
fieldProps: PropTypes__default.default.object,
|
|
1813
1830
|
inputProps: PropTypes__default.default.object,
|
|
1831
|
+
isDisabled: PropTypes__default.default.bool,
|
|
1814
1832
|
isRequired: PropTypes__default.default.bool,
|
|
1815
1833
|
name: PropTypes__default.default.string,
|
|
1834
|
+
showMessage: PropTypes__default.default.bool,
|
|
1816
1835
|
onChange: PropTypes__default.default.func
|
|
1817
1836
|
};
|
|
1818
1837
|
|
|
@@ -1824,7 +1843,7 @@ const TextareaField = /*#__PURE__*/React__default.default.memo(function Textarea
|
|
|
1824
1843
|
fieldProps,
|
|
1825
1844
|
inputProps,
|
|
1826
1845
|
classNameGroupItem,
|
|
1827
|
-
|
|
1846
|
+
showMessage
|
|
1828
1847
|
} = props;
|
|
1829
1848
|
return /*#__PURE__*/React__default.default.createElement(reactFinalForm.Field, {
|
|
1830
1849
|
name: name
|
|
@@ -1845,7 +1864,7 @@ const TextareaField = /*#__PURE__*/React__default.default.memo(function Textarea
|
|
|
1845
1864
|
metaSubmitFailed: meta.submitFailed,
|
|
1846
1865
|
metaTouched: meta.touched,
|
|
1847
1866
|
metaValid: meta.valid,
|
|
1848
|
-
|
|
1867
|
+
showMessage: showMessage
|
|
1849
1868
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(Textarea.Textarea, Object.assign({
|
|
1850
1869
|
autoComplete: "nope",
|
|
1851
1870
|
name: input.name,
|
|
@@ -1861,10 +1880,13 @@ TextareaField.defaultProps = {
|
|
|
1861
1880
|
fieldProps: {}
|
|
1862
1881
|
};
|
|
1863
1882
|
TextareaField.propTypes = {
|
|
1864
|
-
|
|
1865
|
-
isRequired: PropTypes__default.default.bool,
|
|
1883
|
+
classNameGroupItem: PropTypes__default.default.string,
|
|
1866
1884
|
fieldProps: PropTypes__default.default.object,
|
|
1867
|
-
inputProps: PropTypes__default.default.object
|
|
1885
|
+
inputProps: PropTypes__default.default.object,
|
|
1886
|
+
isDisabled: PropTypes__default.default.bool,
|
|
1887
|
+
isRequired: PropTypes__default.default.bool,
|
|
1888
|
+
name: PropTypes__default.default.string.isRequired,
|
|
1889
|
+
showMessage: PropTypes__default.default.bool
|
|
1868
1890
|
};
|
|
1869
1891
|
|
|
1870
1892
|
const focusOnError = (formElementsList, errors) => {
|
|
@@ -2074,7 +2096,7 @@ function generateField(field, config, props) {
|
|
|
2074
2096
|
}, field, props), Object.entries(field.group).map(([key, value]) => {
|
|
2075
2097
|
const groupProps = {
|
|
2076
2098
|
...value,
|
|
2077
|
-
|
|
2099
|
+
showMessage: field.showMessage,
|
|
2078
2100
|
classNameGroupItem: value.classNameGroupItem || 'form__group-item'
|
|
2079
2101
|
};
|
|
2080
2102
|
return generateField(groupProps, {
|