@itcase/forms 1.0.49 → 1.0.50
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,40 +335,18 @@ 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,
|
|
359
344
|
inputProps,
|
|
360
|
-
|
|
361
|
-
|
|
345
|
+
isDisabled,
|
|
346
|
+
isRequired,
|
|
347
|
+
name,
|
|
348
|
+
showMessage,
|
|
349
|
+
onChange
|
|
362
350
|
} = props;
|
|
363
351
|
return /*#__PURE__*/React__default.default.createElement(reactFinalForm.Field, {
|
|
364
352
|
name: name,
|
|
@@ -388,7 +376,7 @@ const CheckboxField = /*#__PURE__*/React__default.default.memo(function Checkbox
|
|
|
388
376
|
metaTouched: meta.touched,
|
|
389
377
|
metaValid: meta.valid,
|
|
390
378
|
tag: "label",
|
|
391
|
-
|
|
379
|
+
showMessage: showMessage
|
|
392
380
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(Checkbox.Checkbox, Object.assign({
|
|
393
381
|
autoComplete: "nope",
|
|
394
382
|
checked: input.checked,
|
|
@@ -402,14 +390,17 @@ const CheckboxField = /*#__PURE__*/React__default.default.memo(function Checkbox
|
|
|
402
390
|
});
|
|
403
391
|
});
|
|
404
392
|
CheckboxField.defaultProps = {
|
|
405
|
-
|
|
406
|
-
|
|
393
|
+
fieldProps: {},
|
|
394
|
+
inputProps: {}
|
|
407
395
|
};
|
|
408
396
|
CheckboxField.propTypes = {
|
|
397
|
+
classNameGroupItem: PropTypes__default.default.string,
|
|
409
398
|
fieldProps: PropTypes__default.default.object,
|
|
410
399
|
inputProps: PropTypes__default.default.object,
|
|
400
|
+
isDisabled: PropTypes__default.default.bool,
|
|
411
401
|
isRequired: PropTypes__default.default.bool,
|
|
412
402
|
name: PropTypes__default.default.string,
|
|
403
|
+
showMessage: PropTypes__default.default.bool,
|
|
413
404
|
onChange: PropTypes__default.default.func
|
|
414
405
|
};
|
|
415
406
|
|
|
@@ -417,7 +408,7 @@ const ChoiceField = /*#__PURE__*/React__default.default.memo(function ChoiceFiel
|
|
|
417
408
|
const {
|
|
418
409
|
classNameGroupItem,
|
|
419
410
|
fieldProps,
|
|
420
|
-
|
|
411
|
+
showMessage,
|
|
421
412
|
initialValue,
|
|
422
413
|
inputProps,
|
|
423
414
|
isMultiple,
|
|
@@ -473,7 +464,7 @@ const ChoiceField = /*#__PURE__*/React__default.default.memo(function ChoiceFiel
|
|
|
473
464
|
metaSubmitFailed: meta.submitFailed,
|
|
474
465
|
metaTouched: meta.touched,
|
|
475
466
|
metaValid: meta.valid,
|
|
476
|
-
|
|
467
|
+
showMessage: showMessage
|
|
477
468
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(Choice.Choice, Object.assign({
|
|
478
469
|
className: clsx__default.default(meta.active && 'form-choice_state_focus', meta.error && meta.touched && 'form-choice_state_error'),
|
|
479
470
|
options: options,
|
|
@@ -491,7 +482,7 @@ const ChoiceField = /*#__PURE__*/React__default.default.memo(function ChoiceFiel
|
|
|
491
482
|
ChoiceField.propTypes = {
|
|
492
483
|
classNameGroupItem: PropTypes__default.default.string,
|
|
493
484
|
fieldProps: PropTypes__default.default.object,
|
|
494
|
-
|
|
485
|
+
showMessage: PropTypes__default.default.bool,
|
|
495
486
|
initialValue: PropTypes__default.default.oneOfType([PropTypes__default.default.string, PropTypes__default.default.number, PropTypes__default.default.bool]),
|
|
496
487
|
inputProps: PropTypes__default.default.object,
|
|
497
488
|
isMultiple: PropTypes__default.default.bool,
|
|
@@ -512,7 +503,7 @@ const CustomField = /*#__PURE__*/React__default.default.memo(function CustomFiel
|
|
|
512
503
|
name,
|
|
513
504
|
fieldProps,
|
|
514
505
|
classNameGroupItem,
|
|
515
|
-
|
|
506
|
+
showMessage
|
|
516
507
|
} = props;
|
|
517
508
|
return /*#__PURE__*/React__default.default.createElement(reactFinalForm.Field, {
|
|
518
509
|
name: name
|
|
@@ -533,7 +524,7 @@ const CustomField = /*#__PURE__*/React__default.default.memo(function CustomFiel
|
|
|
533
524
|
metaSubmitFailed: meta.submitFailed,
|
|
534
525
|
metaTouched: meta.touched,
|
|
535
526
|
metaValid: meta.valid,
|
|
536
|
-
|
|
527
|
+
showMessage: showMessage
|
|
537
528
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(Component, Object.assign({}, props, {
|
|
538
529
|
isDisabled: isDisabled,
|
|
539
530
|
input: input,
|
|
@@ -545,10 +536,14 @@ CustomField.defaultProps = {
|
|
|
545
536
|
fieldProps: {}
|
|
546
537
|
};
|
|
547
538
|
CustomField.propTypes = {
|
|
548
|
-
|
|
549
|
-
|
|
539
|
+
Component: PropTypes__default.default.element,
|
|
540
|
+
classNameGroupItem: PropTypes__default.default.string,
|
|
550
541
|
fieldProps: PropTypes__default.default.object,
|
|
551
|
-
inputProps: PropTypes__default.default.object
|
|
542
|
+
inputProps: PropTypes__default.default.object,
|
|
543
|
+
isDisabled: PropTypes__default.default.bool,
|
|
544
|
+
isRequired: PropTypes__default.default.bool,
|
|
545
|
+
name: PropTypes__default.default.string.isRequired,
|
|
546
|
+
showMessage: PropTypes__default.default.bool
|
|
552
547
|
};
|
|
553
548
|
|
|
554
549
|
const CodeField = /*#__PURE__*/React__default.default.memo(function CodeField(props) {
|
|
@@ -559,7 +554,7 @@ const CodeField = /*#__PURE__*/React__default.default.memo(function CodeField(pr
|
|
|
559
554
|
fieldProps,
|
|
560
555
|
inputProps,
|
|
561
556
|
classNameGroupItem,
|
|
562
|
-
|
|
557
|
+
showMessage
|
|
563
558
|
} = props;
|
|
564
559
|
return /*#__PURE__*/React__default.default.createElement(reactFinalForm.Field, {
|
|
565
560
|
name: name
|
|
@@ -580,7 +575,7 @@ const CodeField = /*#__PURE__*/React__default.default.memo(function CodeField(pr
|
|
|
580
575
|
metaSubmitFailed: meta.submitFailed,
|
|
581
576
|
metaTouched: meta.touched,
|
|
582
577
|
metaValid: meta.valid,
|
|
583
|
-
|
|
578
|
+
showMessage: showMessage
|
|
584
579
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(Code.Code, Object.assign({
|
|
585
580
|
autoComplete: "nope",
|
|
586
581
|
name: input.name,
|
|
@@ -596,10 +591,13 @@ CodeField.defaultProps = {
|
|
|
596
591
|
fieldProps: {}
|
|
597
592
|
};
|
|
598
593
|
CodeField.propTypes = {
|
|
599
|
-
|
|
600
|
-
isRequired: PropTypes__default.default.bool,
|
|
594
|
+
classNameGroupItem: PropTypes__default.default.string,
|
|
601
595
|
fieldProps: PropTypes__default.default.object,
|
|
602
|
-
inputProps: PropTypes__default.default.object
|
|
596
|
+
inputProps: PropTypes__default.default.object,
|
|
597
|
+
isDisabled: PropTypes__default.default.bool,
|
|
598
|
+
isRequired: PropTypes__default.default.bool,
|
|
599
|
+
name: PropTypes__default.default.string.isRequired,
|
|
600
|
+
showMessage: PropTypes__default.default.bool
|
|
603
601
|
};
|
|
604
602
|
|
|
605
603
|
function DatePickerField(props) {
|
|
@@ -618,7 +616,7 @@ function DatePickerField(props) {
|
|
|
618
616
|
iconRevealableShow,
|
|
619
617
|
iconRevealableHide,
|
|
620
618
|
iconShape,
|
|
621
|
-
|
|
619
|
+
showMessage,
|
|
622
620
|
onChange,
|
|
623
621
|
classNameGroupItem
|
|
624
622
|
} = props;
|
|
@@ -648,7 +646,7 @@ function DatePickerField(props) {
|
|
|
648
646
|
metaSubmitFailed: meta.submitFailed,
|
|
649
647
|
metaTouched: meta.touched,
|
|
650
648
|
metaValid: meta.valid,
|
|
651
|
-
|
|
649
|
+
showMessage: showMessage
|
|
652
650
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(DatePicker.DatePickerInput, {
|
|
653
651
|
name: input.name,
|
|
654
652
|
value: input.value || '',
|
|
@@ -786,7 +784,7 @@ const FileInputDropzone = /*#__PURE__*/React__default.default.memo(function File
|
|
|
786
784
|
removeThumbText,
|
|
787
785
|
hintTitle,
|
|
788
786
|
hintDescription,
|
|
789
|
-
|
|
787
|
+
showFilename,
|
|
790
788
|
isPreviews,
|
|
791
789
|
loadingText,
|
|
792
790
|
dropzoneProps = {},
|
|
@@ -976,7 +974,7 @@ const FileInputDropzone = /*#__PURE__*/React__default.default.memo(function File
|
|
|
976
974
|
textColor: thumbNameTextColor,
|
|
977
975
|
textWrap: thumbNameTextWrap,
|
|
978
976
|
textWeight: thumbNameTextWeight
|
|
979
|
-
}, fileErrorText || file.error)),
|
|
977
|
+
}, fileErrorText || file.error)), showFilename && /*#__PURE__*/React__default.default.createElement("div", {
|
|
980
978
|
className: "form-dropzone__thumb-name"
|
|
981
979
|
}, /*#__PURE__*/React__default.default.createElement(Text.Text, {
|
|
982
980
|
size: thumbNameTextSize,
|
|
@@ -1045,7 +1043,7 @@ FileInputDropzone.propTypes = {
|
|
|
1045
1043
|
inputName: PropTypes__default.default.string,
|
|
1046
1044
|
inputValue: PropTypes__default.default.any,
|
|
1047
1045
|
isPreviews: PropTypes__default.default.bool,
|
|
1048
|
-
|
|
1046
|
+
showFilename: PropTypes__default.default.bool,
|
|
1049
1047
|
loadingText: PropTypes__default.default.string,
|
|
1050
1048
|
metaError: PropTypes__default.default.string,
|
|
1051
1049
|
metaTouched: PropTypes__default.default.bool,
|
|
@@ -1094,10 +1092,10 @@ const FileInput = /*#__PURE__*/React__default.default.memo(function FileInput(pr
|
|
|
1094
1092
|
hintDescriptionTextColor,
|
|
1095
1093
|
hintDescriptionTextWrap,
|
|
1096
1094
|
hintDescriptionTextWeight,
|
|
1097
|
-
|
|
1095
|
+
showMessage,
|
|
1098
1096
|
thumbDirection,
|
|
1099
1097
|
hintDescription,
|
|
1100
|
-
|
|
1098
|
+
showFilename,
|
|
1101
1099
|
fileErrorText,
|
|
1102
1100
|
dropzoneProps,
|
|
1103
1101
|
maxFiles,
|
|
@@ -1130,7 +1128,7 @@ const FileInput = /*#__PURE__*/React__default.default.memo(function FileInput(pr
|
|
|
1130
1128
|
metaSubmitFailed: meta.submitFailed,
|
|
1131
1129
|
metaTouched: meta.touched,
|
|
1132
1130
|
metaValid: meta.valid,
|
|
1133
|
-
|
|
1131
|
+
showMessage: showMessage,
|
|
1134
1132
|
width: width
|
|
1135
1133
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(FileInputDropzone, {
|
|
1136
1134
|
dropzoneProps: dropzoneProps,
|
|
@@ -1176,7 +1174,7 @@ const FileInput = /*#__PURE__*/React__default.default.memo(function FileInput(pr
|
|
|
1176
1174
|
errorMessageTextColor: errorMessageTextColor,
|
|
1177
1175
|
isPreviews: isPreviews,
|
|
1178
1176
|
shape: shape,
|
|
1179
|
-
|
|
1177
|
+
showFilename: showFilename,
|
|
1180
1178
|
metaError: meta.error,
|
|
1181
1179
|
metaTouched: meta.touched,
|
|
1182
1180
|
removeThumbText: removeThumbText,
|
|
@@ -1202,7 +1200,7 @@ FileInput.propTypes = {
|
|
|
1202
1200
|
inputClass: PropTypes__default.default.string,
|
|
1203
1201
|
isPreviews: PropTypes__default.default.bool,
|
|
1204
1202
|
isRequired: PropTypes__default.default.bool,
|
|
1205
|
-
|
|
1203
|
+
showFilename: PropTypes__default.default.bool,
|
|
1206
1204
|
label: PropTypes__default.default.any,
|
|
1207
1205
|
removeThumbText: PropTypes__default.default.string,
|
|
1208
1206
|
onAddFiles: PropTypes__default.default.func,
|
|
@@ -1227,7 +1225,7 @@ const Group = /*#__PURE__*/React__default.default.memo(function Group(props) {
|
|
|
1227
1225
|
messageTextColor,
|
|
1228
1226
|
children,
|
|
1229
1227
|
dataTour,
|
|
1230
|
-
|
|
1228
|
+
showGroupMessage,
|
|
1231
1229
|
name,
|
|
1232
1230
|
showErrorsOnSubmit
|
|
1233
1231
|
} = props;
|
|
@@ -1258,7 +1256,7 @@ const Group = /*#__PURE__*/React__default.default.memo(function Group(props) {
|
|
|
1258
1256
|
textWeight: labelTextWeight
|
|
1259
1257
|
}, label)), /*#__PURE__*/React__default.default.createElement("div", {
|
|
1260
1258
|
className: "form__group-items"
|
|
1261
|
-
}, children), after),
|
|
1259
|
+
}, children), after), showGroupMessage && /*#__PURE__*/React__default.default.createElement(React__default.default.Fragment, null, Boolean(showError) && /*#__PURE__*/React__default.default.createElement(Text.Text, {
|
|
1262
1260
|
className: "form__group-message form__group-message_type-error",
|
|
1263
1261
|
size: errorMessageTextSize,
|
|
1264
1262
|
textWeight: errorMessageTextWeight,
|
|
@@ -1309,7 +1307,7 @@ const InputField = /*#__PURE__*/React__default.default.memo(function InputField(
|
|
|
1309
1307
|
iconRevealableShow,
|
|
1310
1308
|
iconRevealableHide,
|
|
1311
1309
|
iconShape,
|
|
1312
|
-
|
|
1310
|
+
showMessage,
|
|
1313
1311
|
onChange,
|
|
1314
1312
|
classNameGroupItem
|
|
1315
1313
|
} = props;
|
|
@@ -1352,7 +1350,7 @@ const InputField = /*#__PURE__*/React__default.default.memo(function InputField(
|
|
|
1352
1350
|
metaSubmitFailed: meta.submitFailed,
|
|
1353
1351
|
metaTouched: meta.touched,
|
|
1354
1352
|
metaValid: meta.valid,
|
|
1355
|
-
|
|
1353
|
+
showMessage: showMessage
|
|
1356
1354
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(Input.Input, Object.assign({
|
|
1357
1355
|
className: clsx__default.default(meta.active && 'input_state_focus', meta.error && meta.touched && 'input_state_error'),
|
|
1358
1356
|
autoComplete: "nope",
|
|
@@ -1530,15 +1528,15 @@ RadioGroupList.propTypes = {
|
|
|
1530
1528
|
|
|
1531
1529
|
const RadioGroup = /*#__PURE__*/React__default.default.memo(function RadioGroup(props) {
|
|
1532
1530
|
const {
|
|
1533
|
-
isRequired,
|
|
1534
|
-
name,
|
|
1535
|
-
options,
|
|
1536
|
-
fieldProps,
|
|
1537
1531
|
editableProps,
|
|
1532
|
+
fieldProps,
|
|
1538
1533
|
inputProps,
|
|
1539
|
-
onChange,
|
|
1540
1534
|
isDisabled,
|
|
1541
|
-
|
|
1535
|
+
isRequired,
|
|
1536
|
+
name,
|
|
1537
|
+
options,
|
|
1538
|
+
showMessage,
|
|
1539
|
+
onChange
|
|
1542
1540
|
} = props;
|
|
1543
1541
|
return /*#__PURE__*/React__default.default.createElement(reactFinalForm.Field, {
|
|
1544
1542
|
name: name
|
|
@@ -1559,7 +1557,7 @@ const RadioGroup = /*#__PURE__*/React__default.default.memo(function RadioGroup(
|
|
|
1559
1557
|
metaSubmitFailed: meta.submitFailed,
|
|
1560
1558
|
metaTouched: meta.touched,
|
|
1561
1559
|
metaValid: meta.valid,
|
|
1562
|
-
|
|
1560
|
+
showMessage: showMessage
|
|
1563
1561
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(RadioGroupList, {
|
|
1564
1562
|
input: input,
|
|
1565
1563
|
options: options,
|
|
@@ -1570,22 +1568,23 @@ const RadioGroup = /*#__PURE__*/React__default.default.memo(function RadioGroup(
|
|
|
1570
1568
|
})));
|
|
1571
1569
|
});
|
|
1572
1570
|
RadioGroup.defaultProps = {
|
|
1573
|
-
fieldProps: {},
|
|
1574
1571
|
editableProps: {},
|
|
1572
|
+
fieldProps: {},
|
|
1575
1573
|
inputProps: {},
|
|
1576
1574
|
options: []
|
|
1577
1575
|
};
|
|
1578
1576
|
RadioGroup.propTypes = {
|
|
1579
|
-
|
|
1577
|
+
editableProps: PropTypes__default.default.object,
|
|
1580
1578
|
fieldProps: PropTypes__default.default.object,
|
|
1581
1579
|
inputProps: PropTypes__default.default.object,
|
|
1582
|
-
|
|
1580
|
+
isDisabled: PropTypes__default.default.bool,
|
|
1583
1581
|
isRequired: PropTypes__default.default.bool,
|
|
1582
|
+
name: PropTypes__default.default.string.isRequired,
|
|
1584
1583
|
options: PropTypes__default.default.array,
|
|
1584
|
+
showMessage: PropTypes__default.default.bool,
|
|
1585
1585
|
onChange: PropTypes__default.default.func
|
|
1586
1586
|
};
|
|
1587
1587
|
|
|
1588
|
-
// const SegmentedField = React.memo(
|
|
1589
1588
|
function SegmentedField(props) {
|
|
1590
1589
|
const {
|
|
1591
1590
|
options,
|
|
@@ -1594,7 +1593,7 @@ function SegmentedField(props) {
|
|
|
1594
1593
|
fieldProps,
|
|
1595
1594
|
inputProps,
|
|
1596
1595
|
isDisabled,
|
|
1597
|
-
|
|
1596
|
+
showMessage
|
|
1598
1597
|
} = props;
|
|
1599
1598
|
const {
|
|
1600
1599
|
change
|
|
@@ -1633,7 +1632,7 @@ function SegmentedField(props) {
|
|
|
1633
1632
|
metaSubmitFailed: meta.submitFailed,
|
|
1634
1633
|
metaTouched: meta.touched,
|
|
1635
1634
|
metaValid: meta.valid,
|
|
1636
|
-
|
|
1635
|
+
showMessage: showMessage
|
|
1637
1636
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(Segmented.Segmented, Object.assign({
|
|
1638
1637
|
segments: options,
|
|
1639
1638
|
isDisabled: isDisabled,
|
|
@@ -1642,18 +1641,18 @@ function SegmentedField(props) {
|
|
|
1642
1641
|
}, inputProps)));
|
|
1643
1642
|
});
|
|
1644
1643
|
}
|
|
1645
|
-
// )
|
|
1646
|
-
|
|
1647
1644
|
SegmentedField.propTypes = {
|
|
1648
|
-
options: PropTypes__default.default.array.isRequired,
|
|
1649
|
-
name: PropTypes__default.default.string.isRequired,
|
|
1650
1645
|
className: PropTypes__default.default.string,
|
|
1646
|
+
fieldProps: PropTypes__default.default.object,
|
|
1651
1647
|
inputClass: PropTypes__default.default.string,
|
|
1648
|
+
inputProps: PropTypes__default.default.object,
|
|
1649
|
+
isDisabled: PropTypes__default.default.bool,
|
|
1652
1650
|
isRequired: PropTypes__default.default.bool,
|
|
1653
1651
|
label: PropTypes__default.default.string,
|
|
1652
|
+
name: PropTypes__default.default.string.isRequired,
|
|
1653
|
+
options: PropTypes__default.default.array.isRequired,
|
|
1654
1654
|
placeholder: PropTypes__default.default.string,
|
|
1655
|
-
|
|
1656
|
-
inputProps: PropTypes__default.default.object
|
|
1655
|
+
showMessage: PropTypes__default.default.bool
|
|
1657
1656
|
};
|
|
1658
1657
|
|
|
1659
1658
|
function getDefaultValue(options, selectValue) {
|
|
@@ -1678,13 +1677,13 @@ const SelectField = /*#__PURE__*/React__default.default.memo(function SelectFiel
|
|
|
1678
1677
|
const {
|
|
1679
1678
|
classNameGroupItem,
|
|
1680
1679
|
fieldProps,
|
|
1681
|
-
hideMessage,
|
|
1682
1680
|
isDisabled,
|
|
1683
1681
|
isRequired,
|
|
1684
1682
|
name,
|
|
1685
1683
|
options,
|
|
1686
1684
|
selectProps,
|
|
1687
1685
|
selectRef,
|
|
1686
|
+
showMessage,
|
|
1688
1687
|
onChange
|
|
1689
1688
|
} = props;
|
|
1690
1689
|
return /*#__PURE__*/React__default.default.createElement(reactFinalForm.Field, {
|
|
@@ -1730,7 +1729,7 @@ const SelectField = /*#__PURE__*/React__default.default.memo(function SelectFiel
|
|
|
1730
1729
|
metaSubmitFailed: meta.submitFailed,
|
|
1731
1730
|
metaTouched: meta.touched,
|
|
1732
1731
|
metaValid: meta.valid,
|
|
1733
|
-
|
|
1732
|
+
showMessage: showMessage
|
|
1734
1733
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(Select.Select, Object.assign({
|
|
1735
1734
|
className: "form-select-item",
|
|
1736
1735
|
instanceId: `id_${input.name}`,
|
|
@@ -1743,25 +1742,30 @@ const SelectField = /*#__PURE__*/React__default.default.memo(function SelectFiel
|
|
|
1743
1742
|
});
|
|
1744
1743
|
});
|
|
1745
1744
|
SelectField.propTypes = {
|
|
1746
|
-
|
|
1747
|
-
|
|
1745
|
+
classNameGroupItem: PropTypes__default.default.string,
|
|
1746
|
+
fieldProps: PropTypes__default.default.object,
|
|
1747
|
+
isDisabled: PropTypes__default.default.bool,
|
|
1748
1748
|
isRequired: PropTypes__default.default.bool,
|
|
1749
1749
|
label: PropTypes__default.default.any,
|
|
1750
1750
|
messageType: PropTypes__default.default.string,
|
|
1751
|
+
name: PropTypes__default.default.string.isRequired,
|
|
1751
1752
|
options: PropTypes__default.default.array,
|
|
1753
|
+
selectProps: PropTypes__default.default.object,
|
|
1754
|
+
selectRef: PropTypes__default.default.any,
|
|
1755
|
+
showMessage: PropTypes__default.default.bool,
|
|
1752
1756
|
onChange: PropTypes__default.default.func
|
|
1753
1757
|
};
|
|
1754
1758
|
|
|
1755
1759
|
const SwitchField = /*#__PURE__*/React__default.default.memo(function SwitchField(props) {
|
|
1756
1760
|
const {
|
|
1757
|
-
|
|
1758
|
-
isDisabled,
|
|
1759
|
-
isRequired,
|
|
1760
|
-
onChange,
|
|
1761
|
+
classNameGroupItem,
|
|
1761
1762
|
fieldProps,
|
|
1762
1763
|
inputProps,
|
|
1763
|
-
|
|
1764
|
-
|
|
1764
|
+
isDisabled,
|
|
1765
|
+
isRequired,
|
|
1766
|
+
name,
|
|
1767
|
+
showMessage,
|
|
1768
|
+
onChange
|
|
1765
1769
|
} = props;
|
|
1766
1770
|
return /*#__PURE__*/React__default.default.createElement(reactFinalForm.Field, {
|
|
1767
1771
|
name: name,
|
|
@@ -1790,7 +1794,7 @@ const SwitchField = /*#__PURE__*/React__default.default.memo(function SwitchFiel
|
|
|
1790
1794
|
metaSubmitFailed: meta.submitFailed,
|
|
1791
1795
|
metaTouched: meta.touched,
|
|
1792
1796
|
metaValid: meta.valid,
|
|
1793
|
-
|
|
1797
|
+
showMessage: showMessage,
|
|
1794
1798
|
tag: "label"
|
|
1795
1799
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(Switch.Switch, Object.assign({
|
|
1796
1800
|
autoComplete: "nope",
|
|
@@ -1805,14 +1809,17 @@ const SwitchField = /*#__PURE__*/React__default.default.memo(function SwitchFiel
|
|
|
1805
1809
|
});
|
|
1806
1810
|
});
|
|
1807
1811
|
SwitchField.defaultProps = {
|
|
1808
|
-
|
|
1809
|
-
|
|
1812
|
+
fieldProps: {},
|
|
1813
|
+
inputProps: {}
|
|
1810
1814
|
};
|
|
1811
1815
|
SwitchField.propTypes = {
|
|
1816
|
+
classNameGroupItem: PropTypes__default.default.string,
|
|
1812
1817
|
fieldProps: PropTypes__default.default.object,
|
|
1813
1818
|
inputProps: PropTypes__default.default.object,
|
|
1819
|
+
isDisabled: PropTypes__default.default.bool,
|
|
1814
1820
|
isRequired: PropTypes__default.default.bool,
|
|
1815
1821
|
name: PropTypes__default.default.string,
|
|
1822
|
+
showMessage: PropTypes__default.default.bool,
|
|
1816
1823
|
onChange: PropTypes__default.default.func
|
|
1817
1824
|
};
|
|
1818
1825
|
|
|
@@ -1824,7 +1831,7 @@ const TextareaField = /*#__PURE__*/React__default.default.memo(function Textarea
|
|
|
1824
1831
|
fieldProps,
|
|
1825
1832
|
inputProps,
|
|
1826
1833
|
classNameGroupItem,
|
|
1827
|
-
|
|
1834
|
+
showMessage
|
|
1828
1835
|
} = props;
|
|
1829
1836
|
return /*#__PURE__*/React__default.default.createElement(reactFinalForm.Field, {
|
|
1830
1837
|
name: name
|
|
@@ -1845,7 +1852,7 @@ const TextareaField = /*#__PURE__*/React__default.default.memo(function Textarea
|
|
|
1845
1852
|
metaSubmitFailed: meta.submitFailed,
|
|
1846
1853
|
metaTouched: meta.touched,
|
|
1847
1854
|
metaValid: meta.valid,
|
|
1848
|
-
|
|
1855
|
+
showMessage: showMessage
|
|
1849
1856
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(Textarea.Textarea, Object.assign({
|
|
1850
1857
|
autoComplete: "nope",
|
|
1851
1858
|
name: input.name,
|
|
@@ -1861,10 +1868,13 @@ TextareaField.defaultProps = {
|
|
|
1861
1868
|
fieldProps: {}
|
|
1862
1869
|
};
|
|
1863
1870
|
TextareaField.propTypes = {
|
|
1864
|
-
|
|
1865
|
-
isRequired: PropTypes__default.default.bool,
|
|
1871
|
+
classNameGroupItem: PropTypes__default.default.string,
|
|
1866
1872
|
fieldProps: PropTypes__default.default.object,
|
|
1867
|
-
inputProps: PropTypes__default.default.object
|
|
1873
|
+
inputProps: PropTypes__default.default.object,
|
|
1874
|
+
isDisabled: PropTypes__default.default.bool,
|
|
1875
|
+
isRequired: PropTypes__default.default.bool,
|
|
1876
|
+
name: PropTypes__default.default.string.isRequired,
|
|
1877
|
+
showMessage: PropTypes__default.default.bool
|
|
1868
1878
|
};
|
|
1869
1879
|
|
|
1870
1880
|
const focusOnError = (formElementsList, errors) => {
|
|
@@ -2074,7 +2084,7 @@ function generateField(field, config, props) {
|
|
|
2074
2084
|
}, field, props), Object.entries(field.group).map(([key, value]) => {
|
|
2075
2085
|
const groupProps = {
|
|
2076
2086
|
...value,
|
|
2077
|
-
|
|
2087
|
+
showMessage: field.showMessage,
|
|
2078
2088
|
classNameGroupItem: value.classNameGroupItem || 'form__group-item'
|
|
2079
2089
|
};
|
|
2080
2090
|
return generateField(groupProps, {
|
package/dist/itcase-forms.esm.js
CHANGED
|
@@ -114,30 +114,33 @@ function FieldWrapperBase(props) {
|
|
|
114
114
|
beforeItem,
|
|
115
115
|
children,
|
|
116
116
|
className,
|
|
117
|
+
dataTour,
|
|
117
118
|
desc,
|
|
118
|
-
descTextSize,
|
|
119
119
|
descTextColor,
|
|
120
|
+
descTextSize,
|
|
120
121
|
descTextWidth,
|
|
121
|
-
divider,
|
|
122
122
|
dividerDirection,
|
|
123
123
|
dividerFill,
|
|
124
124
|
dividerSize,
|
|
125
125
|
dividerWidth,
|
|
126
|
+
errorMessageTextColor,
|
|
127
|
+
errorMessageTextSize,
|
|
128
|
+
errorMessageTextWeight,
|
|
126
129
|
fieldClassName,
|
|
127
130
|
id,
|
|
128
131
|
inputName,
|
|
129
132
|
inputValue,
|
|
133
|
+
isDisabled,
|
|
134
|
+
isHidden,
|
|
130
135
|
isRequired,
|
|
131
136
|
label,
|
|
132
|
-
|
|
137
|
+
labelHidden,
|
|
133
138
|
labelTextColor,
|
|
139
|
+
labelTextSize,
|
|
134
140
|
labelTextWidth,
|
|
135
|
-
errorMessageTextSize,
|
|
136
|
-
errorMessageTextWeight,
|
|
137
|
-
errorMessageTextColor,
|
|
138
141
|
message,
|
|
139
|
-
messageTextSize,
|
|
140
142
|
messageTextColor,
|
|
143
|
+
messageTextSize,
|
|
141
144
|
messageTextWeight,
|
|
142
145
|
metaActive,
|
|
143
146
|
metaError,
|
|
@@ -147,14 +150,11 @@ function FieldWrapperBase(props) {
|
|
|
147
150
|
metaTouched,
|
|
148
151
|
metaValid,
|
|
149
152
|
set,
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
isDisabled,
|
|
154
|
-
isHidden,
|
|
153
|
+
showDivider,
|
|
154
|
+
showErrorsOnSubmit,
|
|
155
|
+
showMessage,
|
|
155
156
|
tag: Tag,
|
|
156
|
-
|
|
157
|
-
showErrorsOnSubmit
|
|
157
|
+
type
|
|
158
158
|
} = props;
|
|
159
159
|
const error = metaError || !metaModifiedSinceLastSubmit && metaSubmitError || false;
|
|
160
160
|
const showError = useMemo(() => {
|
|
@@ -223,13 +223,13 @@ function FieldWrapperBase(props) {
|
|
|
223
223
|
className: clsx('form-field__content', inputFillClass, inputShapeClass)
|
|
224
224
|
}, /*#__PURE__*/React.createElement("div", {
|
|
225
225
|
className: clsx('form-field__content-inner', fieldClass)
|
|
226
|
-
}, beforeItem, children, afterItem),
|
|
226
|
+
}, beforeItem, children, afterItem), showDivider && /*#__PURE__*/React.createElement(Divider, {
|
|
227
227
|
className: "form-field__item-divider",
|
|
228
228
|
width: dividerWidth,
|
|
229
229
|
direction: dividerDirection,
|
|
230
230
|
size: dividerSize,
|
|
231
231
|
fill: dividerFill
|
|
232
|
-
})),
|
|
232
|
+
})), showMessage && /*#__PURE__*/React.createElement("div", {
|
|
233
233
|
className: "form-field__message"
|
|
234
234
|
}, Boolean(showError) && error && typeof error === 'string' && /*#__PURE__*/React.createElement(Text, {
|
|
235
235
|
className: "form-field__message-item form-field__message-item_type-error",
|
|
@@ -248,10 +248,10 @@ function FieldWrapperBase(props) {
|
|
|
248
248
|
}, '\u00A0')), after);
|
|
249
249
|
}
|
|
250
250
|
FieldWrapperBase.defaultProps = {
|
|
251
|
-
|
|
252
|
-
type: 'normal',
|
|
251
|
+
errorMessageTextColor: 'errorTextSecondary',
|
|
253
252
|
errorMessageTextSize: 's',
|
|
254
|
-
|
|
253
|
+
tag: 'div',
|
|
254
|
+
type: 'normal'
|
|
255
255
|
};
|
|
256
256
|
FieldWrapperBase.propTypes = {
|
|
257
257
|
after: PropTypes.any,
|
|
@@ -261,14 +261,19 @@ FieldWrapperBase.propTypes = {
|
|
|
261
261
|
beforeItem: PropTypes.any,
|
|
262
262
|
children: PropTypes.any,
|
|
263
263
|
className: PropTypes.string,
|
|
264
|
+
dataTour: PropTypes.string,
|
|
264
265
|
desc: PropTypes.string,
|
|
265
|
-
descTextSize: PropTypes.string,
|
|
266
266
|
descTextColor: PropTypes.string,
|
|
267
|
+
descTextSize: PropTypes.string,
|
|
267
268
|
descTextWidth: PropTypes.string,
|
|
268
269
|
dividerDirection: PropTypes.string,
|
|
269
270
|
dividerFill: PropTypes.string,
|
|
270
271
|
dividerSize: PropTypes.string,
|
|
271
272
|
dividerWidth: PropTypes.string,
|
|
273
|
+
errorMessageTextColor: PropTypes.string,
|
|
274
|
+
errorMessageTextSize: PropTypes.string,
|
|
275
|
+
errorMessageTextWeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
276
|
+
errorMessageTextWidth: PropTypes.string,
|
|
272
277
|
fieldClassName: PropTypes.string,
|
|
273
278
|
id: PropTypes.string,
|
|
274
279
|
inputName: PropTypes.string,
|
|
@@ -276,18 +281,20 @@ FieldWrapperBase.propTypes = {
|
|
|
276
281
|
inputOnChange: PropTypes.func,
|
|
277
282
|
inputOnFocus: PropTypes.func,
|
|
278
283
|
inputValue: PropTypes.any,
|
|
284
|
+
isDisabled: PropTypes.bool,
|
|
285
|
+
isHidden: PropTypes.bool,
|
|
279
286
|
isRequired: PropTypes.bool,
|
|
280
287
|
itemType: PropTypes.string,
|
|
281
288
|
label: PropTypes.any,
|
|
282
|
-
|
|
289
|
+
labelHidden: PropTypes.string,
|
|
283
290
|
labelTextColor: PropTypes.string,
|
|
291
|
+
labelTextSize: PropTypes.string,
|
|
284
292
|
labelTextWidth: PropTypes.string,
|
|
285
|
-
errorMessageTextSize: PropTypes.string,
|
|
286
|
-
errorMessageTextWidth: PropTypes.string,
|
|
287
|
-
errorMessageTextColor: PropTypes.string,
|
|
288
293
|
message: PropTypes.string,
|
|
289
294
|
messageSize: PropTypes.string,
|
|
290
295
|
messageTextColor: PropTypes.string,
|
|
296
|
+
messageTextSize: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
297
|
+
messageTextWeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
291
298
|
messageTextWidth: PropTypes.string,
|
|
292
299
|
metaActive: PropTypes.bool,
|
|
293
300
|
metaError: PropTypes.string,
|
|
@@ -297,7 +304,10 @@ FieldWrapperBase.propTypes = {
|
|
|
297
304
|
metaTouched: PropTypes.bool,
|
|
298
305
|
metaValid: PropTypes.bool,
|
|
299
306
|
set: PropTypes.string,
|
|
307
|
+
showDivider: PropTypes.bool,
|
|
300
308
|
showErrorsOnSubmit: PropTypes.bool,
|
|
309
|
+
showMessage: PropTypes.bool,
|
|
310
|
+
tag: PropTypes.oneOfType([PropTypes.elementType, PropTypes.string]),
|
|
301
311
|
type: PropTypes.string
|
|
302
312
|
};
|
|
303
313
|
function FieldWrapper(props) {
|
|
@@ -315,40 +325,18 @@ function FieldWrapper(props) {
|
|
|
315
325
|
}, []);
|
|
316
326
|
return /*#__PURE__*/React.createElement(FieldWrapperBase, props);
|
|
317
327
|
}
|
|
318
|
-
FieldWrapper.propTypes =
|
|
319
|
-
autoComplete: PropTypes.string,
|
|
320
|
-
children: PropTypes.any,
|
|
321
|
-
className: PropTypes.string,
|
|
322
|
-
fieldClassName: PropTypes.string,
|
|
323
|
-
hint: PropTypes.string,
|
|
324
|
-
inputName: PropTypes.string,
|
|
325
|
-
inputOnBlur: PropTypes.func,
|
|
326
|
-
inputOnChange: PropTypes.func,
|
|
327
|
-
inputOnFocus: PropTypes.func,
|
|
328
|
-
inputValue: PropTypes.any,
|
|
329
|
-
isRequired: PropTypes.bool,
|
|
330
|
-
itemType: PropTypes.string,
|
|
331
|
-
label: PropTypes.any,
|
|
332
|
-
metaActive: PropTypes.bool,
|
|
333
|
-
metaError: PropTypes.string,
|
|
334
|
-
metaModifiedSinceLastSubmit: PropTypes.bool,
|
|
335
|
-
metaSubmitError: PropTypes.string,
|
|
336
|
-
metaSubmitFailed: PropTypes.bool,
|
|
337
|
-
metaTouched: PropTypes.bool,
|
|
338
|
-
metaValid: PropTypes.bool,
|
|
339
|
-
showErrorsOnSubmit: PropTypes.bool
|
|
340
|
-
};
|
|
328
|
+
FieldWrapper.propTypes = FieldWrapperBase.propTypes;
|
|
341
329
|
|
|
342
330
|
const CheckboxField = /*#__PURE__*/React.memo(function CheckboxField(props) {
|
|
343
331
|
const {
|
|
344
|
-
|
|
345
|
-
isDisabled,
|
|
346
|
-
isRequired,
|
|
347
|
-
onChange,
|
|
332
|
+
classNameGroupItem,
|
|
348
333
|
fieldProps,
|
|
349
334
|
inputProps,
|
|
350
|
-
|
|
351
|
-
|
|
335
|
+
isDisabled,
|
|
336
|
+
isRequired,
|
|
337
|
+
name,
|
|
338
|
+
showMessage,
|
|
339
|
+
onChange
|
|
352
340
|
} = props;
|
|
353
341
|
return /*#__PURE__*/React.createElement(Field, {
|
|
354
342
|
name: name,
|
|
@@ -378,7 +366,7 @@ const CheckboxField = /*#__PURE__*/React.memo(function CheckboxField(props) {
|
|
|
378
366
|
metaTouched: meta.touched,
|
|
379
367
|
metaValid: meta.valid,
|
|
380
368
|
tag: "label",
|
|
381
|
-
|
|
369
|
+
showMessage: showMessage
|
|
382
370
|
}, fieldProps), /*#__PURE__*/React.createElement(Checkbox, Object.assign({
|
|
383
371
|
autoComplete: "nope",
|
|
384
372
|
checked: input.checked,
|
|
@@ -392,14 +380,17 @@ const CheckboxField = /*#__PURE__*/React.memo(function CheckboxField(props) {
|
|
|
392
380
|
});
|
|
393
381
|
});
|
|
394
382
|
CheckboxField.defaultProps = {
|
|
395
|
-
|
|
396
|
-
|
|
383
|
+
fieldProps: {},
|
|
384
|
+
inputProps: {}
|
|
397
385
|
};
|
|
398
386
|
CheckboxField.propTypes = {
|
|
387
|
+
classNameGroupItem: PropTypes.string,
|
|
399
388
|
fieldProps: PropTypes.object,
|
|
400
389
|
inputProps: PropTypes.object,
|
|
390
|
+
isDisabled: PropTypes.bool,
|
|
401
391
|
isRequired: PropTypes.bool,
|
|
402
392
|
name: PropTypes.string,
|
|
393
|
+
showMessage: PropTypes.bool,
|
|
403
394
|
onChange: PropTypes.func
|
|
404
395
|
};
|
|
405
396
|
|
|
@@ -407,7 +398,7 @@ const ChoiceField = /*#__PURE__*/React.memo(function ChoiceField(props) {
|
|
|
407
398
|
const {
|
|
408
399
|
classNameGroupItem,
|
|
409
400
|
fieldProps,
|
|
410
|
-
|
|
401
|
+
showMessage,
|
|
411
402
|
initialValue,
|
|
412
403
|
inputProps,
|
|
413
404
|
isMultiple,
|
|
@@ -463,7 +454,7 @@ const ChoiceField = /*#__PURE__*/React.memo(function ChoiceField(props) {
|
|
|
463
454
|
metaSubmitFailed: meta.submitFailed,
|
|
464
455
|
metaTouched: meta.touched,
|
|
465
456
|
metaValid: meta.valid,
|
|
466
|
-
|
|
457
|
+
showMessage: showMessage
|
|
467
458
|
}, fieldProps), /*#__PURE__*/React.createElement(Choice, Object.assign({
|
|
468
459
|
className: clsx(meta.active && 'form-choice_state_focus', meta.error && meta.touched && 'form-choice_state_error'),
|
|
469
460
|
options: options,
|
|
@@ -481,7 +472,7 @@ const ChoiceField = /*#__PURE__*/React.memo(function ChoiceField(props) {
|
|
|
481
472
|
ChoiceField.propTypes = {
|
|
482
473
|
classNameGroupItem: PropTypes.string,
|
|
483
474
|
fieldProps: PropTypes.object,
|
|
484
|
-
|
|
475
|
+
showMessage: PropTypes.bool,
|
|
485
476
|
initialValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool]),
|
|
486
477
|
inputProps: PropTypes.object,
|
|
487
478
|
isMultiple: PropTypes.bool,
|
|
@@ -502,7 +493,7 @@ const CustomField = /*#__PURE__*/React.memo(function CustomField(props) {
|
|
|
502
493
|
name,
|
|
503
494
|
fieldProps,
|
|
504
495
|
classNameGroupItem,
|
|
505
|
-
|
|
496
|
+
showMessage
|
|
506
497
|
} = props;
|
|
507
498
|
return /*#__PURE__*/React.createElement(Field, {
|
|
508
499
|
name: name
|
|
@@ -523,7 +514,7 @@ const CustomField = /*#__PURE__*/React.memo(function CustomField(props) {
|
|
|
523
514
|
metaSubmitFailed: meta.submitFailed,
|
|
524
515
|
metaTouched: meta.touched,
|
|
525
516
|
metaValid: meta.valid,
|
|
526
|
-
|
|
517
|
+
showMessage: showMessage
|
|
527
518
|
}, fieldProps), /*#__PURE__*/React.createElement(Component, Object.assign({}, props, {
|
|
528
519
|
isDisabled: isDisabled,
|
|
529
520
|
input: input,
|
|
@@ -535,10 +526,14 @@ CustomField.defaultProps = {
|
|
|
535
526
|
fieldProps: {}
|
|
536
527
|
};
|
|
537
528
|
CustomField.propTypes = {
|
|
538
|
-
|
|
539
|
-
|
|
529
|
+
Component: PropTypes.element,
|
|
530
|
+
classNameGroupItem: PropTypes.string,
|
|
540
531
|
fieldProps: PropTypes.object,
|
|
541
|
-
inputProps: PropTypes.object
|
|
532
|
+
inputProps: PropTypes.object,
|
|
533
|
+
isDisabled: PropTypes.bool,
|
|
534
|
+
isRequired: PropTypes.bool,
|
|
535
|
+
name: PropTypes.string.isRequired,
|
|
536
|
+
showMessage: PropTypes.bool
|
|
542
537
|
};
|
|
543
538
|
|
|
544
539
|
const CodeField = /*#__PURE__*/React.memo(function CodeField(props) {
|
|
@@ -549,7 +544,7 @@ const CodeField = /*#__PURE__*/React.memo(function CodeField(props) {
|
|
|
549
544
|
fieldProps,
|
|
550
545
|
inputProps,
|
|
551
546
|
classNameGroupItem,
|
|
552
|
-
|
|
547
|
+
showMessage
|
|
553
548
|
} = props;
|
|
554
549
|
return /*#__PURE__*/React.createElement(Field, {
|
|
555
550
|
name: name
|
|
@@ -570,7 +565,7 @@ const CodeField = /*#__PURE__*/React.memo(function CodeField(props) {
|
|
|
570
565
|
metaSubmitFailed: meta.submitFailed,
|
|
571
566
|
metaTouched: meta.touched,
|
|
572
567
|
metaValid: meta.valid,
|
|
573
|
-
|
|
568
|
+
showMessage: showMessage
|
|
574
569
|
}, fieldProps), /*#__PURE__*/React.createElement(Code, Object.assign({
|
|
575
570
|
autoComplete: "nope",
|
|
576
571
|
name: input.name,
|
|
@@ -586,10 +581,13 @@ CodeField.defaultProps = {
|
|
|
586
581
|
fieldProps: {}
|
|
587
582
|
};
|
|
588
583
|
CodeField.propTypes = {
|
|
589
|
-
|
|
590
|
-
isRequired: PropTypes.bool,
|
|
584
|
+
classNameGroupItem: PropTypes.string,
|
|
591
585
|
fieldProps: PropTypes.object,
|
|
592
|
-
inputProps: PropTypes.object
|
|
586
|
+
inputProps: PropTypes.object,
|
|
587
|
+
isDisabled: PropTypes.bool,
|
|
588
|
+
isRequired: PropTypes.bool,
|
|
589
|
+
name: PropTypes.string.isRequired,
|
|
590
|
+
showMessage: PropTypes.bool
|
|
593
591
|
};
|
|
594
592
|
|
|
595
593
|
function DatePickerField(props) {
|
|
@@ -608,7 +606,7 @@ function DatePickerField(props) {
|
|
|
608
606
|
iconRevealableShow,
|
|
609
607
|
iconRevealableHide,
|
|
610
608
|
iconShape,
|
|
611
|
-
|
|
609
|
+
showMessage,
|
|
612
610
|
onChange,
|
|
613
611
|
classNameGroupItem
|
|
614
612
|
} = props;
|
|
@@ -638,7 +636,7 @@ function DatePickerField(props) {
|
|
|
638
636
|
metaSubmitFailed: meta.submitFailed,
|
|
639
637
|
metaTouched: meta.touched,
|
|
640
638
|
metaValid: meta.valid,
|
|
641
|
-
|
|
639
|
+
showMessage: showMessage
|
|
642
640
|
}, fieldProps), /*#__PURE__*/React.createElement(DatePickerInput, {
|
|
643
641
|
name: input.name,
|
|
644
642
|
value: input.value || '',
|
|
@@ -776,7 +774,7 @@ const FileInputDropzone = /*#__PURE__*/React.memo(function FileInputDropzone(pro
|
|
|
776
774
|
removeThumbText,
|
|
777
775
|
hintTitle,
|
|
778
776
|
hintDescription,
|
|
779
|
-
|
|
777
|
+
showFilename,
|
|
780
778
|
isPreviews,
|
|
781
779
|
loadingText,
|
|
782
780
|
dropzoneProps = {},
|
|
@@ -966,7 +964,7 @@ const FileInputDropzone = /*#__PURE__*/React.memo(function FileInputDropzone(pro
|
|
|
966
964
|
textColor: thumbNameTextColor,
|
|
967
965
|
textWrap: thumbNameTextWrap,
|
|
968
966
|
textWeight: thumbNameTextWeight
|
|
969
|
-
}, fileErrorText || file.error)),
|
|
967
|
+
}, fileErrorText || file.error)), showFilename && /*#__PURE__*/React.createElement("div", {
|
|
970
968
|
className: "form-dropzone__thumb-name"
|
|
971
969
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
972
970
|
size: thumbNameTextSize,
|
|
@@ -1035,7 +1033,7 @@ FileInputDropzone.propTypes = {
|
|
|
1035
1033
|
inputName: PropTypes.string,
|
|
1036
1034
|
inputValue: PropTypes.any,
|
|
1037
1035
|
isPreviews: PropTypes.bool,
|
|
1038
|
-
|
|
1036
|
+
showFilename: PropTypes.bool,
|
|
1039
1037
|
loadingText: PropTypes.string,
|
|
1040
1038
|
metaError: PropTypes.string,
|
|
1041
1039
|
metaTouched: PropTypes.bool,
|
|
@@ -1084,10 +1082,10 @@ const FileInput = /*#__PURE__*/React.memo(function FileInput(props) {
|
|
|
1084
1082
|
hintDescriptionTextColor,
|
|
1085
1083
|
hintDescriptionTextWrap,
|
|
1086
1084
|
hintDescriptionTextWeight,
|
|
1087
|
-
|
|
1085
|
+
showMessage,
|
|
1088
1086
|
thumbDirection,
|
|
1089
1087
|
hintDescription,
|
|
1090
|
-
|
|
1088
|
+
showFilename,
|
|
1091
1089
|
fileErrorText,
|
|
1092
1090
|
dropzoneProps,
|
|
1093
1091
|
maxFiles,
|
|
@@ -1120,7 +1118,7 @@ const FileInput = /*#__PURE__*/React.memo(function FileInput(props) {
|
|
|
1120
1118
|
metaSubmitFailed: meta.submitFailed,
|
|
1121
1119
|
metaTouched: meta.touched,
|
|
1122
1120
|
metaValid: meta.valid,
|
|
1123
|
-
|
|
1121
|
+
showMessage: showMessage,
|
|
1124
1122
|
width: width
|
|
1125
1123
|
}, fieldProps), /*#__PURE__*/React.createElement(FileInputDropzone, {
|
|
1126
1124
|
dropzoneProps: dropzoneProps,
|
|
@@ -1166,7 +1164,7 @@ const FileInput = /*#__PURE__*/React.memo(function FileInput(props) {
|
|
|
1166
1164
|
errorMessageTextColor: errorMessageTextColor,
|
|
1167
1165
|
isPreviews: isPreviews,
|
|
1168
1166
|
shape: shape,
|
|
1169
|
-
|
|
1167
|
+
showFilename: showFilename,
|
|
1170
1168
|
metaError: meta.error,
|
|
1171
1169
|
metaTouched: meta.touched,
|
|
1172
1170
|
removeThumbText: removeThumbText,
|
|
@@ -1192,7 +1190,7 @@ FileInput.propTypes = {
|
|
|
1192
1190
|
inputClass: PropTypes.string,
|
|
1193
1191
|
isPreviews: PropTypes.bool,
|
|
1194
1192
|
isRequired: PropTypes.bool,
|
|
1195
|
-
|
|
1193
|
+
showFilename: PropTypes.bool,
|
|
1196
1194
|
label: PropTypes.any,
|
|
1197
1195
|
removeThumbText: PropTypes.string,
|
|
1198
1196
|
onAddFiles: PropTypes.func,
|
|
@@ -1217,7 +1215,7 @@ const Group = /*#__PURE__*/React.memo(function Group(props) {
|
|
|
1217
1215
|
messageTextColor,
|
|
1218
1216
|
children,
|
|
1219
1217
|
dataTour,
|
|
1220
|
-
|
|
1218
|
+
showGroupMessage,
|
|
1221
1219
|
name,
|
|
1222
1220
|
showErrorsOnSubmit
|
|
1223
1221
|
} = props;
|
|
@@ -1248,7 +1246,7 @@ const Group = /*#__PURE__*/React.memo(function Group(props) {
|
|
|
1248
1246
|
textWeight: labelTextWeight
|
|
1249
1247
|
}, label)), /*#__PURE__*/React.createElement("div", {
|
|
1250
1248
|
className: "form__group-items"
|
|
1251
|
-
}, children), after),
|
|
1249
|
+
}, children), after), showGroupMessage && /*#__PURE__*/React.createElement(React.Fragment, null, Boolean(showError) && /*#__PURE__*/React.createElement(Text, {
|
|
1252
1250
|
className: "form__group-message form__group-message_type-error",
|
|
1253
1251
|
size: errorMessageTextSize,
|
|
1254
1252
|
textWeight: errorMessageTextWeight,
|
|
@@ -1299,7 +1297,7 @@ const InputField = /*#__PURE__*/React.memo(function InputField(props) {
|
|
|
1299
1297
|
iconRevealableShow,
|
|
1300
1298
|
iconRevealableHide,
|
|
1301
1299
|
iconShape,
|
|
1302
|
-
|
|
1300
|
+
showMessage,
|
|
1303
1301
|
onChange,
|
|
1304
1302
|
classNameGroupItem
|
|
1305
1303
|
} = props;
|
|
@@ -1342,7 +1340,7 @@ const InputField = /*#__PURE__*/React.memo(function InputField(props) {
|
|
|
1342
1340
|
metaSubmitFailed: meta.submitFailed,
|
|
1343
1341
|
metaTouched: meta.touched,
|
|
1344
1342
|
metaValid: meta.valid,
|
|
1345
|
-
|
|
1343
|
+
showMessage: showMessage
|
|
1346
1344
|
}, fieldProps), /*#__PURE__*/React.createElement(Input, Object.assign({
|
|
1347
1345
|
className: clsx(meta.active && 'input_state_focus', meta.error && meta.touched && 'input_state_error'),
|
|
1348
1346
|
autoComplete: "nope",
|
|
@@ -1520,15 +1518,15 @@ RadioGroupList.propTypes = {
|
|
|
1520
1518
|
|
|
1521
1519
|
const RadioGroup = /*#__PURE__*/React.memo(function RadioGroup(props) {
|
|
1522
1520
|
const {
|
|
1523
|
-
isRequired,
|
|
1524
|
-
name,
|
|
1525
|
-
options,
|
|
1526
|
-
fieldProps,
|
|
1527
1521
|
editableProps,
|
|
1522
|
+
fieldProps,
|
|
1528
1523
|
inputProps,
|
|
1529
|
-
onChange,
|
|
1530
1524
|
isDisabled,
|
|
1531
|
-
|
|
1525
|
+
isRequired,
|
|
1526
|
+
name,
|
|
1527
|
+
options,
|
|
1528
|
+
showMessage,
|
|
1529
|
+
onChange
|
|
1532
1530
|
} = props;
|
|
1533
1531
|
return /*#__PURE__*/React.createElement(Field, {
|
|
1534
1532
|
name: name
|
|
@@ -1549,7 +1547,7 @@ const RadioGroup = /*#__PURE__*/React.memo(function RadioGroup(props) {
|
|
|
1549
1547
|
metaSubmitFailed: meta.submitFailed,
|
|
1550
1548
|
metaTouched: meta.touched,
|
|
1551
1549
|
metaValid: meta.valid,
|
|
1552
|
-
|
|
1550
|
+
showMessage: showMessage
|
|
1553
1551
|
}, fieldProps), /*#__PURE__*/React.createElement(RadioGroupList, {
|
|
1554
1552
|
input: input,
|
|
1555
1553
|
options: options,
|
|
@@ -1560,22 +1558,23 @@ const RadioGroup = /*#__PURE__*/React.memo(function RadioGroup(props) {
|
|
|
1560
1558
|
})));
|
|
1561
1559
|
});
|
|
1562
1560
|
RadioGroup.defaultProps = {
|
|
1563
|
-
fieldProps: {},
|
|
1564
1561
|
editableProps: {},
|
|
1562
|
+
fieldProps: {},
|
|
1565
1563
|
inputProps: {},
|
|
1566
1564
|
options: []
|
|
1567
1565
|
};
|
|
1568
1566
|
RadioGroup.propTypes = {
|
|
1569
|
-
|
|
1567
|
+
editableProps: PropTypes.object,
|
|
1570
1568
|
fieldProps: PropTypes.object,
|
|
1571
1569
|
inputProps: PropTypes.object,
|
|
1572
|
-
|
|
1570
|
+
isDisabled: PropTypes.bool,
|
|
1573
1571
|
isRequired: PropTypes.bool,
|
|
1572
|
+
name: PropTypes.string.isRequired,
|
|
1574
1573
|
options: PropTypes.array,
|
|
1574
|
+
showMessage: PropTypes.bool,
|
|
1575
1575
|
onChange: PropTypes.func
|
|
1576
1576
|
};
|
|
1577
1577
|
|
|
1578
|
-
// const SegmentedField = React.memo(
|
|
1579
1578
|
function SegmentedField(props) {
|
|
1580
1579
|
const {
|
|
1581
1580
|
options,
|
|
@@ -1584,7 +1583,7 @@ function SegmentedField(props) {
|
|
|
1584
1583
|
fieldProps,
|
|
1585
1584
|
inputProps,
|
|
1586
1585
|
isDisabled,
|
|
1587
|
-
|
|
1586
|
+
showMessage
|
|
1588
1587
|
} = props;
|
|
1589
1588
|
const {
|
|
1590
1589
|
change
|
|
@@ -1623,7 +1622,7 @@ function SegmentedField(props) {
|
|
|
1623
1622
|
metaSubmitFailed: meta.submitFailed,
|
|
1624
1623
|
metaTouched: meta.touched,
|
|
1625
1624
|
metaValid: meta.valid,
|
|
1626
|
-
|
|
1625
|
+
showMessage: showMessage
|
|
1627
1626
|
}, fieldProps), /*#__PURE__*/React.createElement(Segmented, Object.assign({
|
|
1628
1627
|
segments: options,
|
|
1629
1628
|
isDisabled: isDisabled,
|
|
@@ -1632,18 +1631,18 @@ function SegmentedField(props) {
|
|
|
1632
1631
|
}, inputProps)));
|
|
1633
1632
|
});
|
|
1634
1633
|
}
|
|
1635
|
-
// )
|
|
1636
|
-
|
|
1637
1634
|
SegmentedField.propTypes = {
|
|
1638
|
-
options: PropTypes.array.isRequired,
|
|
1639
|
-
name: PropTypes.string.isRequired,
|
|
1640
1635
|
className: PropTypes.string,
|
|
1636
|
+
fieldProps: PropTypes.object,
|
|
1641
1637
|
inputClass: PropTypes.string,
|
|
1638
|
+
inputProps: PropTypes.object,
|
|
1639
|
+
isDisabled: PropTypes.bool,
|
|
1642
1640
|
isRequired: PropTypes.bool,
|
|
1643
1641
|
label: PropTypes.string,
|
|
1642
|
+
name: PropTypes.string.isRequired,
|
|
1643
|
+
options: PropTypes.array.isRequired,
|
|
1644
1644
|
placeholder: PropTypes.string,
|
|
1645
|
-
|
|
1646
|
-
inputProps: PropTypes.object
|
|
1645
|
+
showMessage: PropTypes.bool
|
|
1647
1646
|
};
|
|
1648
1647
|
|
|
1649
1648
|
function getDefaultValue(options, selectValue) {
|
|
@@ -1668,13 +1667,13 @@ const SelectField = /*#__PURE__*/React.memo(function SelectField(props) {
|
|
|
1668
1667
|
const {
|
|
1669
1668
|
classNameGroupItem,
|
|
1670
1669
|
fieldProps,
|
|
1671
|
-
hideMessage,
|
|
1672
1670
|
isDisabled,
|
|
1673
1671
|
isRequired,
|
|
1674
1672
|
name,
|
|
1675
1673
|
options,
|
|
1676
1674
|
selectProps,
|
|
1677
1675
|
selectRef,
|
|
1676
|
+
showMessage,
|
|
1678
1677
|
onChange
|
|
1679
1678
|
} = props;
|
|
1680
1679
|
return /*#__PURE__*/React.createElement(Field, {
|
|
@@ -1720,7 +1719,7 @@ const SelectField = /*#__PURE__*/React.memo(function SelectField(props) {
|
|
|
1720
1719
|
metaSubmitFailed: meta.submitFailed,
|
|
1721
1720
|
metaTouched: meta.touched,
|
|
1722
1721
|
metaValid: meta.valid,
|
|
1723
|
-
|
|
1722
|
+
showMessage: showMessage
|
|
1724
1723
|
}, fieldProps), /*#__PURE__*/React.createElement(Select, Object.assign({
|
|
1725
1724
|
className: "form-select-item",
|
|
1726
1725
|
instanceId: `id_${input.name}`,
|
|
@@ -1733,25 +1732,30 @@ const SelectField = /*#__PURE__*/React.memo(function SelectField(props) {
|
|
|
1733
1732
|
});
|
|
1734
1733
|
});
|
|
1735
1734
|
SelectField.propTypes = {
|
|
1736
|
-
|
|
1737
|
-
|
|
1735
|
+
classNameGroupItem: PropTypes.string,
|
|
1736
|
+
fieldProps: PropTypes.object,
|
|
1737
|
+
isDisabled: PropTypes.bool,
|
|
1738
1738
|
isRequired: PropTypes.bool,
|
|
1739
1739
|
label: PropTypes.any,
|
|
1740
1740
|
messageType: PropTypes.string,
|
|
1741
|
+
name: PropTypes.string.isRequired,
|
|
1741
1742
|
options: PropTypes.array,
|
|
1743
|
+
selectProps: PropTypes.object,
|
|
1744
|
+
selectRef: PropTypes.any,
|
|
1745
|
+
showMessage: PropTypes.bool,
|
|
1742
1746
|
onChange: PropTypes.func
|
|
1743
1747
|
};
|
|
1744
1748
|
|
|
1745
1749
|
const SwitchField = /*#__PURE__*/React.memo(function SwitchField(props) {
|
|
1746
1750
|
const {
|
|
1747
|
-
|
|
1748
|
-
isDisabled,
|
|
1749
|
-
isRequired,
|
|
1750
|
-
onChange,
|
|
1751
|
+
classNameGroupItem,
|
|
1751
1752
|
fieldProps,
|
|
1752
1753
|
inputProps,
|
|
1753
|
-
|
|
1754
|
-
|
|
1754
|
+
isDisabled,
|
|
1755
|
+
isRequired,
|
|
1756
|
+
name,
|
|
1757
|
+
showMessage,
|
|
1758
|
+
onChange
|
|
1755
1759
|
} = props;
|
|
1756
1760
|
return /*#__PURE__*/React.createElement(Field, {
|
|
1757
1761
|
name: name,
|
|
@@ -1780,7 +1784,7 @@ const SwitchField = /*#__PURE__*/React.memo(function SwitchField(props) {
|
|
|
1780
1784
|
metaSubmitFailed: meta.submitFailed,
|
|
1781
1785
|
metaTouched: meta.touched,
|
|
1782
1786
|
metaValid: meta.valid,
|
|
1783
|
-
|
|
1787
|
+
showMessage: showMessage,
|
|
1784
1788
|
tag: "label"
|
|
1785
1789
|
}, fieldProps), /*#__PURE__*/React.createElement(Switch, Object.assign({
|
|
1786
1790
|
autoComplete: "nope",
|
|
@@ -1795,14 +1799,17 @@ const SwitchField = /*#__PURE__*/React.memo(function SwitchField(props) {
|
|
|
1795
1799
|
});
|
|
1796
1800
|
});
|
|
1797
1801
|
SwitchField.defaultProps = {
|
|
1798
|
-
|
|
1799
|
-
|
|
1802
|
+
fieldProps: {},
|
|
1803
|
+
inputProps: {}
|
|
1800
1804
|
};
|
|
1801
1805
|
SwitchField.propTypes = {
|
|
1806
|
+
classNameGroupItem: PropTypes.string,
|
|
1802
1807
|
fieldProps: PropTypes.object,
|
|
1803
1808
|
inputProps: PropTypes.object,
|
|
1809
|
+
isDisabled: PropTypes.bool,
|
|
1804
1810
|
isRequired: PropTypes.bool,
|
|
1805
1811
|
name: PropTypes.string,
|
|
1812
|
+
showMessage: PropTypes.bool,
|
|
1806
1813
|
onChange: PropTypes.func
|
|
1807
1814
|
};
|
|
1808
1815
|
|
|
@@ -1814,7 +1821,7 @@ const TextareaField = /*#__PURE__*/React.memo(function TextareaField(props) {
|
|
|
1814
1821
|
fieldProps,
|
|
1815
1822
|
inputProps,
|
|
1816
1823
|
classNameGroupItem,
|
|
1817
|
-
|
|
1824
|
+
showMessage
|
|
1818
1825
|
} = props;
|
|
1819
1826
|
return /*#__PURE__*/React.createElement(Field, {
|
|
1820
1827
|
name: name
|
|
@@ -1835,7 +1842,7 @@ const TextareaField = /*#__PURE__*/React.memo(function TextareaField(props) {
|
|
|
1835
1842
|
metaSubmitFailed: meta.submitFailed,
|
|
1836
1843
|
metaTouched: meta.touched,
|
|
1837
1844
|
metaValid: meta.valid,
|
|
1838
|
-
|
|
1845
|
+
showMessage: showMessage
|
|
1839
1846
|
}, fieldProps), /*#__PURE__*/React.createElement(Textarea, Object.assign({
|
|
1840
1847
|
autoComplete: "nope",
|
|
1841
1848
|
name: input.name,
|
|
@@ -1851,10 +1858,13 @@ TextareaField.defaultProps = {
|
|
|
1851
1858
|
fieldProps: {}
|
|
1852
1859
|
};
|
|
1853
1860
|
TextareaField.propTypes = {
|
|
1854
|
-
|
|
1855
|
-
isRequired: PropTypes.bool,
|
|
1861
|
+
classNameGroupItem: PropTypes.string,
|
|
1856
1862
|
fieldProps: PropTypes.object,
|
|
1857
|
-
inputProps: PropTypes.object
|
|
1863
|
+
inputProps: PropTypes.object,
|
|
1864
|
+
isDisabled: PropTypes.bool,
|
|
1865
|
+
isRequired: PropTypes.bool,
|
|
1866
|
+
name: PropTypes.string.isRequired,
|
|
1867
|
+
showMessage: PropTypes.bool
|
|
1858
1868
|
};
|
|
1859
1869
|
|
|
1860
1870
|
const focusOnError = (formElementsList, errors) => {
|
|
@@ -2064,7 +2074,7 @@ function generateField(field, config, props) {
|
|
|
2064
2074
|
}, field, props), Object.entries(field.group).map(([key, value]) => {
|
|
2065
2075
|
const groupProps = {
|
|
2066
2076
|
...value,
|
|
2067
|
-
|
|
2077
|
+
showMessage: field.showMessage,
|
|
2068
2078
|
classNameGroupItem: value.classNameGroupItem || 'form__group-item'
|
|
2069
2079
|
};
|
|
2070
2080
|
return generateField(groupProps, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itcase/forms",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.50",
|
|
4
4
|
"description": "Forms fields, inputs, etc.",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@itcase/common": "^1.1.11",
|
|
34
|
-
"@itcase/ui": "^1.0.
|
|
35
|
-
"axios": "^1.6.
|
|
34
|
+
"@itcase/ui": "^1.0.91",
|
|
35
|
+
"axios": "^1.6.3",
|
|
36
36
|
"clsx": "^2.0.0",
|
|
37
37
|
"date-fns": "2.0.0-alpha.7",
|
|
38
38
|
"final-form": "^4.20.10",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"libphonenumber-js": "^1.10.52",
|
|
41
41
|
"lodash": "^4.17.21",
|
|
42
42
|
"luxon": "^3.4.4",
|
|
43
|
+
"postcss": "^8.4.32",
|
|
43
44
|
"prop-types": "^15.8.1",
|
|
44
45
|
"react": "^18.2.0",
|
|
45
46
|
"react-date-range": "^1.4.0",
|