@itcase/forms 1.0.50 → 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 +21 -9
- package/dist/itcase-forms.esm.js +21 -9
- package/package.json +1 -1
package/dist/itcase-forms.cjs.js
CHANGED
|
@@ -341,6 +341,7 @@ const CheckboxField = /*#__PURE__*/React__default.default.memo(function Checkbox
|
|
|
341
341
|
const {
|
|
342
342
|
classNameGroupItem,
|
|
343
343
|
fieldProps,
|
|
344
|
+
initialValue,
|
|
344
345
|
inputProps,
|
|
345
346
|
isDisabled,
|
|
346
347
|
isRequired,
|
|
@@ -350,7 +351,8 @@ const CheckboxField = /*#__PURE__*/React__default.default.memo(function Checkbox
|
|
|
350
351
|
} = props;
|
|
351
352
|
return /*#__PURE__*/React__default.default.createElement(reactFinalForm.Field, {
|
|
352
353
|
name: name,
|
|
353
|
-
type: "checkbox"
|
|
354
|
+
type: "checkbox",
|
|
355
|
+
initialValue: initialValue
|
|
354
356
|
}, ({
|
|
355
357
|
input,
|
|
356
358
|
meta
|
|
@@ -394,6 +396,7 @@ CheckboxField.defaultProps = {
|
|
|
394
396
|
inputProps: {}
|
|
395
397
|
};
|
|
396
398
|
CheckboxField.propTypes = {
|
|
399
|
+
initialValue: PropTypes__default.default.bool,
|
|
397
400
|
classNameGroupItem: PropTypes__default.default.string,
|
|
398
401
|
fieldProps: PropTypes__default.default.object,
|
|
399
402
|
inputProps: PropTypes__default.default.object,
|
|
@@ -501,12 +504,14 @@ const CustomField = /*#__PURE__*/React__default.default.memo(function CustomFiel
|
|
|
501
504
|
isDisabled,
|
|
502
505
|
isRequired,
|
|
503
506
|
name,
|
|
507
|
+
initialValue,
|
|
504
508
|
fieldProps,
|
|
505
509
|
classNameGroupItem,
|
|
506
510
|
showMessage
|
|
507
511
|
} = props;
|
|
508
512
|
return /*#__PURE__*/React__default.default.createElement(reactFinalForm.Field, {
|
|
509
|
-
name: name
|
|
513
|
+
name: name,
|
|
514
|
+
initialValue: initialValue
|
|
510
515
|
}, ({
|
|
511
516
|
input,
|
|
512
517
|
meta
|
|
@@ -539,6 +544,7 @@ CustomField.propTypes = {
|
|
|
539
544
|
Component: PropTypes__default.default.element,
|
|
540
545
|
classNameGroupItem: PropTypes__default.default.string,
|
|
541
546
|
fieldProps: PropTypes__default.default.object,
|
|
547
|
+
initialValue: PropTypes__default.default.any,
|
|
542
548
|
inputProps: PropTypes__default.default.object,
|
|
543
549
|
isDisabled: PropTypes__default.default.bool,
|
|
544
550
|
isRequired: PropTypes__default.default.bool,
|
|
@@ -552,12 +558,14 @@ const CodeField = /*#__PURE__*/React__default.default.memo(function CodeField(pr
|
|
|
552
558
|
isDisabled,
|
|
553
559
|
name,
|
|
554
560
|
fieldProps,
|
|
561
|
+
initialValue,
|
|
555
562
|
inputProps,
|
|
556
563
|
classNameGroupItem,
|
|
557
564
|
showMessage
|
|
558
565
|
} = props;
|
|
559
566
|
return /*#__PURE__*/React__default.default.createElement(reactFinalForm.Field, {
|
|
560
|
-
name: name
|
|
567
|
+
name: name,
|
|
568
|
+
initialValue: initialValue
|
|
561
569
|
}, ({
|
|
562
570
|
input,
|
|
563
571
|
meta
|
|
@@ -593,6 +601,7 @@ CodeField.defaultProps = {
|
|
|
593
601
|
CodeField.propTypes = {
|
|
594
602
|
classNameGroupItem: PropTypes__default.default.string,
|
|
595
603
|
fieldProps: PropTypes__default.default.object,
|
|
604
|
+
initialValue: PropTypes__default.default.string,
|
|
596
605
|
inputProps: PropTypes__default.default.object,
|
|
597
606
|
isDisabled: PropTypes__default.default.bool,
|
|
598
607
|
isRequired: PropTypes__default.default.bool,
|
|
@@ -1304,9 +1313,10 @@ const InputField = /*#__PURE__*/React__default.default.memo(function InputField(
|
|
|
1304
1313
|
iconBorderHover,
|
|
1305
1314
|
iconFill,
|
|
1306
1315
|
iconFillHover,
|
|
1307
|
-
iconRevealableShow,
|
|
1308
1316
|
iconRevealableHide,
|
|
1317
|
+
iconRevealableShow,
|
|
1309
1318
|
iconShape,
|
|
1319
|
+
initialValue,
|
|
1310
1320
|
showMessage,
|
|
1311
1321
|
onChange,
|
|
1312
1322
|
classNameGroupItem
|
|
@@ -1325,7 +1335,8 @@ const InputField = /*#__PURE__*/React__default.default.memo(function InputField(
|
|
|
1325
1335
|
}, [setIsRevealed]);
|
|
1326
1336
|
return /*#__PURE__*/React__default.default.createElement(reactFinalForm.Field, {
|
|
1327
1337
|
name: name,
|
|
1328
|
-
parse: parse
|
|
1338
|
+
parse: parse,
|
|
1339
|
+
initialValue: initialValue
|
|
1329
1340
|
}, ({
|
|
1330
1341
|
input,
|
|
1331
1342
|
meta
|
|
@@ -1379,6 +1390,7 @@ InputField.defaultProps = {
|
|
|
1379
1390
|
};
|
|
1380
1391
|
InputField.propTypes = {
|
|
1381
1392
|
fieldProps: PropTypes__default.default.object,
|
|
1393
|
+
initialValue: PropTypes__default.default.oneOfType([PropTypes__default.default.string, PropTypes__default.default.number]),
|
|
1382
1394
|
inputProps: PropTypes__default.default.object,
|
|
1383
1395
|
isPassword: PropTypes__default.default.bool,
|
|
1384
1396
|
isRequired: PropTypes__default.default.bool,
|
|
@@ -1398,7 +1410,7 @@ function RadioGroupItem(props) {
|
|
|
1398
1410
|
if (event.target.checked) {
|
|
1399
1411
|
onChange(option.value);
|
|
1400
1412
|
}
|
|
1401
|
-
}, []);
|
|
1413
|
+
}, [onChange]);
|
|
1402
1414
|
return /*#__PURE__*/React__default.default.createElement(RadioButton.RadioButton, Object.assign({
|
|
1403
1415
|
className: "form-radio__item",
|
|
1404
1416
|
checked: option.value === input.value,
|
|
@@ -1598,6 +1610,9 @@ function SegmentedField(props) {
|
|
|
1598
1610
|
const {
|
|
1599
1611
|
change
|
|
1600
1612
|
} = reactFinalForm.useForm();
|
|
1613
|
+
const setActiveSegment = React.useCallback(option => {
|
|
1614
|
+
change(name, option.value);
|
|
1615
|
+
}, [change]);
|
|
1601
1616
|
return /*#__PURE__*/React__default.default.createElement(reactFinalForm.Field, {
|
|
1602
1617
|
name: name
|
|
1603
1618
|
}, ({
|
|
@@ -1615,9 +1630,6 @@ function SegmentedField(props) {
|
|
|
1615
1630
|
}
|
|
1616
1631
|
return emptyOption;
|
|
1617
1632
|
}, [input.value]);
|
|
1618
|
-
const setActiveSegment = React.useCallback(option => {
|
|
1619
|
-
change(name, option.value);
|
|
1620
|
-
}, [change]);
|
|
1621
1633
|
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
1622
1634
|
className: clsx__default.default('form-field_type_segmented', 'form__item_type_segmented'),
|
|
1623
1635
|
fieldClassName: "form-segmented",
|
package/dist/itcase-forms.esm.js
CHANGED
|
@@ -331,6 +331,7 @@ const CheckboxField = /*#__PURE__*/React.memo(function CheckboxField(props) {
|
|
|
331
331
|
const {
|
|
332
332
|
classNameGroupItem,
|
|
333
333
|
fieldProps,
|
|
334
|
+
initialValue,
|
|
334
335
|
inputProps,
|
|
335
336
|
isDisabled,
|
|
336
337
|
isRequired,
|
|
@@ -340,7 +341,8 @@ const CheckboxField = /*#__PURE__*/React.memo(function CheckboxField(props) {
|
|
|
340
341
|
} = props;
|
|
341
342
|
return /*#__PURE__*/React.createElement(Field, {
|
|
342
343
|
name: name,
|
|
343
|
-
type: "checkbox"
|
|
344
|
+
type: "checkbox",
|
|
345
|
+
initialValue: initialValue
|
|
344
346
|
}, ({
|
|
345
347
|
input,
|
|
346
348
|
meta
|
|
@@ -384,6 +386,7 @@ CheckboxField.defaultProps = {
|
|
|
384
386
|
inputProps: {}
|
|
385
387
|
};
|
|
386
388
|
CheckboxField.propTypes = {
|
|
389
|
+
initialValue: PropTypes.bool,
|
|
387
390
|
classNameGroupItem: PropTypes.string,
|
|
388
391
|
fieldProps: PropTypes.object,
|
|
389
392
|
inputProps: PropTypes.object,
|
|
@@ -491,12 +494,14 @@ const CustomField = /*#__PURE__*/React.memo(function CustomField(props) {
|
|
|
491
494
|
isDisabled,
|
|
492
495
|
isRequired,
|
|
493
496
|
name,
|
|
497
|
+
initialValue,
|
|
494
498
|
fieldProps,
|
|
495
499
|
classNameGroupItem,
|
|
496
500
|
showMessage
|
|
497
501
|
} = props;
|
|
498
502
|
return /*#__PURE__*/React.createElement(Field, {
|
|
499
|
-
name: name
|
|
503
|
+
name: name,
|
|
504
|
+
initialValue: initialValue
|
|
500
505
|
}, ({
|
|
501
506
|
input,
|
|
502
507
|
meta
|
|
@@ -529,6 +534,7 @@ CustomField.propTypes = {
|
|
|
529
534
|
Component: PropTypes.element,
|
|
530
535
|
classNameGroupItem: PropTypes.string,
|
|
531
536
|
fieldProps: PropTypes.object,
|
|
537
|
+
initialValue: PropTypes.any,
|
|
532
538
|
inputProps: PropTypes.object,
|
|
533
539
|
isDisabled: PropTypes.bool,
|
|
534
540
|
isRequired: PropTypes.bool,
|
|
@@ -542,12 +548,14 @@ const CodeField = /*#__PURE__*/React.memo(function CodeField(props) {
|
|
|
542
548
|
isDisabled,
|
|
543
549
|
name,
|
|
544
550
|
fieldProps,
|
|
551
|
+
initialValue,
|
|
545
552
|
inputProps,
|
|
546
553
|
classNameGroupItem,
|
|
547
554
|
showMessage
|
|
548
555
|
} = props;
|
|
549
556
|
return /*#__PURE__*/React.createElement(Field, {
|
|
550
|
-
name: name
|
|
557
|
+
name: name,
|
|
558
|
+
initialValue: initialValue
|
|
551
559
|
}, ({
|
|
552
560
|
input,
|
|
553
561
|
meta
|
|
@@ -583,6 +591,7 @@ CodeField.defaultProps = {
|
|
|
583
591
|
CodeField.propTypes = {
|
|
584
592
|
classNameGroupItem: PropTypes.string,
|
|
585
593
|
fieldProps: PropTypes.object,
|
|
594
|
+
initialValue: PropTypes.string,
|
|
586
595
|
inputProps: PropTypes.object,
|
|
587
596
|
isDisabled: PropTypes.bool,
|
|
588
597
|
isRequired: PropTypes.bool,
|
|
@@ -1294,9 +1303,10 @@ const InputField = /*#__PURE__*/React.memo(function InputField(props) {
|
|
|
1294
1303
|
iconBorderHover,
|
|
1295
1304
|
iconFill,
|
|
1296
1305
|
iconFillHover,
|
|
1297
|
-
iconRevealableShow,
|
|
1298
1306
|
iconRevealableHide,
|
|
1307
|
+
iconRevealableShow,
|
|
1299
1308
|
iconShape,
|
|
1309
|
+
initialValue,
|
|
1300
1310
|
showMessage,
|
|
1301
1311
|
onChange,
|
|
1302
1312
|
classNameGroupItem
|
|
@@ -1315,7 +1325,8 @@ const InputField = /*#__PURE__*/React.memo(function InputField(props) {
|
|
|
1315
1325
|
}, [setIsRevealed]);
|
|
1316
1326
|
return /*#__PURE__*/React.createElement(Field, {
|
|
1317
1327
|
name: name,
|
|
1318
|
-
parse: parse
|
|
1328
|
+
parse: parse,
|
|
1329
|
+
initialValue: initialValue
|
|
1319
1330
|
}, ({
|
|
1320
1331
|
input,
|
|
1321
1332
|
meta
|
|
@@ -1369,6 +1380,7 @@ InputField.defaultProps = {
|
|
|
1369
1380
|
};
|
|
1370
1381
|
InputField.propTypes = {
|
|
1371
1382
|
fieldProps: PropTypes.object,
|
|
1383
|
+
initialValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
1372
1384
|
inputProps: PropTypes.object,
|
|
1373
1385
|
isPassword: PropTypes.bool,
|
|
1374
1386
|
isRequired: PropTypes.bool,
|
|
@@ -1388,7 +1400,7 @@ function RadioGroupItem(props) {
|
|
|
1388
1400
|
if (event.target.checked) {
|
|
1389
1401
|
onChange(option.value);
|
|
1390
1402
|
}
|
|
1391
|
-
}, []);
|
|
1403
|
+
}, [onChange]);
|
|
1392
1404
|
return /*#__PURE__*/React.createElement(RadioButton, Object.assign({
|
|
1393
1405
|
className: "form-radio__item",
|
|
1394
1406
|
checked: option.value === input.value,
|
|
@@ -1588,6 +1600,9 @@ function SegmentedField(props) {
|
|
|
1588
1600
|
const {
|
|
1589
1601
|
change
|
|
1590
1602
|
} = useForm();
|
|
1603
|
+
const setActiveSegment = useCallback(option => {
|
|
1604
|
+
change(name, option.value);
|
|
1605
|
+
}, [change]);
|
|
1591
1606
|
return /*#__PURE__*/React.createElement(Field, {
|
|
1592
1607
|
name: name
|
|
1593
1608
|
}, ({
|
|
@@ -1605,9 +1620,6 @@ function SegmentedField(props) {
|
|
|
1605
1620
|
}
|
|
1606
1621
|
return emptyOption;
|
|
1607
1622
|
}, [input.value]);
|
|
1608
|
-
const setActiveSegment = useCallback(option => {
|
|
1609
|
-
change(name, option.value);
|
|
1610
|
-
}, [change]);
|
|
1611
1623
|
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
1612
1624
|
className: clsx('form-field_type_segmented', 'form__item_type_segmented'),
|
|
1613
1625
|
fieldClassName: "form-segmented",
|