@itcase/forms 1.0.48 → 1.0.49
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.
|
@@ -9,6 +9,16 @@
|
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
+
&_disabled {
|
|
13
|
+
& .input {
|
|
14
|
+
background: var(--input-disabled-background, #ECECEC);
|
|
15
|
+
border: solid 1px var(--input-disabled-border, #747474);
|
|
16
|
+
&:hover {
|
|
17
|
+
background: var(--input-disabled-background, #ECECEC);
|
|
18
|
+
border: solid 1px var(--input-disabled-border, #747474);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
12
22
|
&_error {
|
|
13
23
|
& .input {
|
|
14
24
|
border: solid 1px var(--input-error-border);
|
package/dist/itcase-forms.cjs.js
CHANGED
|
@@ -160,6 +160,7 @@ function FieldWrapperBase(props) {
|
|
|
160
160
|
type,
|
|
161
161
|
labelHidden,
|
|
162
162
|
hideMessage,
|
|
163
|
+
isDisabled,
|
|
163
164
|
isHidden,
|
|
164
165
|
tag: Tag,
|
|
165
166
|
dataTour,
|
|
@@ -178,8 +179,8 @@ function FieldWrapperBase(props) {
|
|
|
178
179
|
const isModifiedAfterSubmit = !metaError && metaSubmitError && metaModifiedSinceLastSubmit;
|
|
179
180
|
return hasValue && (metaValid || isModifiedAfterSubmit);
|
|
180
181
|
}, [inputValue, metaValid, metaError, metaSubmitError, metaModifiedSinceLastSubmit]);
|
|
181
|
-
const formFieldClass = React.useMemo(() => clsx__default.default(className, showError && 'form__item_state_error', showValid && 'form__item_state_success', isRequired && 'form__item_state_required', metaActive && 'form__item_state_focus', inputValue && 'form__item_state_filled'), [className, showError, showValid, isRequired, metaActive, inputValue]);
|
|
182
|
-
const fieldClass = React.useMemo(() => clsx__default.default(fieldClassName, showError && `${fieldClassName}_state_error`, showValid && `${fieldClassName}_state_success`, metaActive && `${fieldClassName}_state_focus`, inputValue && `${fieldClassName}_state_filled`), [fieldClassName, showError, showValid, metaActive, inputValue]);
|
|
182
|
+
const formFieldClass = React.useMemo(() => clsx__default.default(className, showError && 'form__item_state_error', showValid && 'form__item_state_success', isRequired && 'form__item_state_required', isDisabled && 'form__item_state_disabled', metaActive && 'form__item_state_focus', inputValue && 'form__item_state_filled'), [className, showError, showValid, isRequired, metaActive, inputValue, isDisabled]);
|
|
183
|
+
const fieldClass = React.useMemo(() => clsx__default.default(fieldClassName, showError && `${fieldClassName}_state_error`, showValid && `${fieldClassName}_state_success`, metaActive && `${fieldClassName}_state_focus`, inputValue && `${fieldClassName}_state_filled`, isDisabled && `${fieldClassName}_state_disabled`), [fieldClassName, showError, showValid, metaActive, inputValue, isDisabled]);
|
|
183
184
|
const sizeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
184
185
|
prefix: 'form-field_size_',
|
|
185
186
|
propsKey: 'size'
|
|
@@ -212,7 +213,7 @@ function FieldWrapperBase(props) {
|
|
|
212
213
|
styles: formFieldStyles
|
|
213
214
|
} = useStyles.useStyles(props);
|
|
214
215
|
return /*#__PURE__*/React__default.default.createElement(Tag, {
|
|
215
|
-
className: clsx__default.default(formFieldClass, 'form__item', 'form-field', type && `form-field_type_${type}`, set && `form-field_set_${set}`, sizeClass, fillClass, shapeClass, isHidden && `form-field_state_hidden`, directionClass, widthClass),
|
|
216
|
+
className: clsx__default.default(formFieldClass, 'form__item', 'form-field', type && `form-field_type_${type}`, set && `form-field_set_${set}`, sizeClass, fillClass, shapeClass, isDisabled && `form-field_state_disabled`, isHidden && `form-field_state_hidden`, directionClass, widthClass),
|
|
216
217
|
"data-tour": dataTour,
|
|
217
218
|
style: formFieldStyles
|
|
218
219
|
}, before, (label || labelHidden) && /*#__PURE__*/React__default.default.createElement("div", {
|
|
@@ -351,6 +352,7 @@ FieldWrapper.propTypes = {
|
|
|
351
352
|
const CheckboxField = /*#__PURE__*/React__default.default.memo(function CheckboxField(props) {
|
|
352
353
|
const {
|
|
353
354
|
name,
|
|
355
|
+
isDisabled,
|
|
354
356
|
isRequired,
|
|
355
357
|
onChange,
|
|
356
358
|
fieldProps,
|
|
@@ -377,6 +379,7 @@ const CheckboxField = /*#__PURE__*/React__default.default.memo(function Checkbox
|
|
|
377
379
|
inputName: input.name,
|
|
378
380
|
inputValue: input.checked,
|
|
379
381
|
isRequired: isRequired,
|
|
382
|
+
isDisabled: isDisabled,
|
|
380
383
|
metaActive: meta.active,
|
|
381
384
|
metaError: meta.error,
|
|
382
385
|
metaModifiedSinceLastSubmit: meta.modifiedSinceLastSubmit,
|
|
@@ -390,6 +393,7 @@ const CheckboxField = /*#__PURE__*/React__default.default.memo(function Checkbox
|
|
|
390
393
|
autoComplete: "nope",
|
|
391
394
|
checked: input.checked,
|
|
392
395
|
name: input.name,
|
|
396
|
+
isDisabled: isDisabled,
|
|
393
397
|
type: "checkbox",
|
|
394
398
|
onBlur: input.onBlur,
|
|
395
399
|
onChange: onChangeField,
|
|
@@ -459,6 +463,7 @@ const ChoiceField = /*#__PURE__*/React__default.default.memo(function ChoiceFiel
|
|
|
459
463
|
inputName: input.name,
|
|
460
464
|
inputValue: input.value || [],
|
|
461
465
|
isRequired: isRequired,
|
|
466
|
+
isDisabled: isDisabled,
|
|
462
467
|
label: label,
|
|
463
468
|
messageType: messageType,
|
|
464
469
|
metaActive: meta.active,
|
|
@@ -502,6 +507,7 @@ ChoiceField.propTypes = {
|
|
|
502
507
|
const CustomField = /*#__PURE__*/React__default.default.memo(function CustomField(props) {
|
|
503
508
|
const {
|
|
504
509
|
Component,
|
|
510
|
+
isDisabled,
|
|
505
511
|
isRequired,
|
|
506
512
|
name,
|
|
507
513
|
fieldProps,
|
|
@@ -516,6 +522,7 @@ const CustomField = /*#__PURE__*/React__default.default.memo(function CustomFiel
|
|
|
516
522
|
}) => /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
517
523
|
className: clsx__default.default('form-field_type_custom', 'form__item_type_custom', classNameGroupItem),
|
|
518
524
|
fieldClassName: 'form-custom',
|
|
525
|
+
isDisabled: isDisabled,
|
|
519
526
|
inputName: input.name,
|
|
520
527
|
inputValue: input.value,
|
|
521
528
|
isRequired: isRequired,
|
|
@@ -528,6 +535,7 @@ const CustomField = /*#__PURE__*/React__default.default.memo(function CustomFiel
|
|
|
528
535
|
metaValid: meta.valid,
|
|
529
536
|
hideMessage: hideMessage
|
|
530
537
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(Component, Object.assign({}, props, {
|
|
538
|
+
isDisabled: isDisabled,
|
|
531
539
|
input: input,
|
|
532
540
|
meta: meta
|
|
533
541
|
}))));
|
|
@@ -546,6 +554,7 @@ CustomField.propTypes = {
|
|
|
546
554
|
const CodeField = /*#__PURE__*/React__default.default.memo(function CodeField(props) {
|
|
547
555
|
const {
|
|
548
556
|
isRequired,
|
|
557
|
+
isDisabled,
|
|
549
558
|
name,
|
|
550
559
|
fieldProps,
|
|
551
560
|
inputProps,
|
|
@@ -563,6 +572,7 @@ const CodeField = /*#__PURE__*/React__default.default.memo(function CodeField(pr
|
|
|
563
572
|
inputName: input.name,
|
|
564
573
|
inputValue: input.value,
|
|
565
574
|
isRequired: isRequired,
|
|
575
|
+
isDisabled: isDisabled,
|
|
566
576
|
metaActive: meta.active,
|
|
567
577
|
metaError: meta.error,
|
|
568
578
|
metaModifiedSinceLastSubmit: meta.modifiedSinceLastSubmit,
|
|
@@ -574,6 +584,7 @@ const CodeField = /*#__PURE__*/React__default.default.memo(function CodeField(pr
|
|
|
574
584
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(Code.Code, Object.assign({
|
|
575
585
|
autoComplete: "nope",
|
|
576
586
|
name: input.name,
|
|
587
|
+
isDisabled: isDisabled,
|
|
577
588
|
value: input.value,
|
|
578
589
|
onBlur: input.onBlur,
|
|
579
590
|
onChange: input.onChange,
|
|
@@ -603,6 +614,7 @@ function DatePickerField(props) {
|
|
|
603
614
|
iconBorderHover,
|
|
604
615
|
iconFill,
|
|
605
616
|
iconFillHover,
|
|
617
|
+
isDisabled,
|
|
606
618
|
iconRevealableShow,
|
|
607
619
|
iconRevealableHide,
|
|
608
620
|
iconShape,
|
|
@@ -628,6 +640,7 @@ function DatePickerField(props) {
|
|
|
628
640
|
inputName: input.name,
|
|
629
641
|
inputValue: input.value || '',
|
|
630
642
|
isRequired: isRequired,
|
|
643
|
+
isDisabled: isDisabled,
|
|
631
644
|
metaActive: meta.active,
|
|
632
645
|
metaError: meta.error,
|
|
633
646
|
metaModifiedSinceLastSubmit: meta.modifiedSinceLastSubmit,
|
|
@@ -640,6 +653,7 @@ function DatePickerField(props) {
|
|
|
640
653
|
name: input.name,
|
|
641
654
|
value: input.value || '',
|
|
642
655
|
onBlur: input.onBlur,
|
|
656
|
+
isDisabled: isDisabled,
|
|
643
657
|
onChange: onChangeField,
|
|
644
658
|
onFocus: input.onFocus,
|
|
645
659
|
inputProps: inputProps,
|
|
@@ -1330,6 +1344,7 @@ const InputField = /*#__PURE__*/React__default.default.memo(function InputField(
|
|
|
1330
1344
|
inputName: input.name,
|
|
1331
1345
|
inputValue: input.value || '',
|
|
1332
1346
|
isRequired: isRequired,
|
|
1347
|
+
isDisabled: isDisabled,
|
|
1333
1348
|
metaActive: meta.active,
|
|
1334
1349
|
metaError: meta.error,
|
|
1335
1350
|
metaModifiedSinceLastSubmit: meta.modifiedSinceLastSubmit,
|
|
@@ -1522,6 +1537,7 @@ const RadioGroup = /*#__PURE__*/React__default.default.memo(function RadioGroup(
|
|
|
1522
1537
|
editableProps,
|
|
1523
1538
|
inputProps,
|
|
1524
1539
|
onChange,
|
|
1540
|
+
isDisabled,
|
|
1525
1541
|
hideMessage
|
|
1526
1542
|
} = props;
|
|
1527
1543
|
return /*#__PURE__*/React__default.default.createElement(reactFinalForm.Field, {
|
|
@@ -1535,6 +1551,7 @@ const RadioGroup = /*#__PURE__*/React__default.default.memo(function RadioGroup(
|
|
|
1535
1551
|
inputName: input.name,
|
|
1536
1552
|
inputValue: input.value || '',
|
|
1537
1553
|
isRequired: isRequired,
|
|
1554
|
+
isDisabled: isDisabled,
|
|
1538
1555
|
metaActive: meta.active,
|
|
1539
1556
|
metaError: meta.error,
|
|
1540
1557
|
metaModifiedSinceLastSubmit: meta.modifiedSinceLastSubmit,
|
|
@@ -1546,6 +1563,7 @@ const RadioGroup = /*#__PURE__*/React__default.default.memo(function RadioGroup(
|
|
|
1546
1563
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(RadioGroupList, {
|
|
1547
1564
|
input: input,
|
|
1548
1565
|
options: options,
|
|
1566
|
+
isDisabled: isDisabled,
|
|
1549
1567
|
onChange: onChange,
|
|
1550
1568
|
editableProps: editableProps,
|
|
1551
1569
|
inputProps: inputProps
|
|
@@ -1575,6 +1593,7 @@ function SegmentedField(props) {
|
|
|
1575
1593
|
name,
|
|
1576
1594
|
fieldProps,
|
|
1577
1595
|
inputProps,
|
|
1596
|
+
isDisabled,
|
|
1578
1597
|
hideMessage
|
|
1579
1598
|
} = props;
|
|
1580
1599
|
const {
|
|
@@ -1606,6 +1625,7 @@ function SegmentedField(props) {
|
|
|
1606
1625
|
inputName: input.name,
|
|
1607
1626
|
inputValue: input.value || [],
|
|
1608
1627
|
isRequired: isRequired,
|
|
1628
|
+
isDisabled: isDisabled,
|
|
1609
1629
|
metaActive: meta.active,
|
|
1610
1630
|
metaError: meta.error,
|
|
1611
1631
|
metaModifiedSinceLastSubmit: meta.modifiedSinceLastSubmit,
|
|
@@ -1616,6 +1636,7 @@ function SegmentedField(props) {
|
|
|
1616
1636
|
hideMessage: hideMessage
|
|
1617
1637
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(Segmented.Segmented, Object.assign({
|
|
1618
1638
|
segments: options,
|
|
1639
|
+
isDisabled: isDisabled,
|
|
1619
1640
|
setActiveSegment: setActiveSegment,
|
|
1620
1641
|
activeSegment: activeOption
|
|
1621
1642
|
}, inputProps)));
|
|
@@ -1658,6 +1679,7 @@ const SelectField = /*#__PURE__*/React__default.default.memo(function SelectFiel
|
|
|
1658
1679
|
classNameGroupItem,
|
|
1659
1680
|
fieldProps,
|
|
1660
1681
|
hideMessage,
|
|
1682
|
+
isDisabled,
|
|
1661
1683
|
isRequired,
|
|
1662
1684
|
name,
|
|
1663
1685
|
options,
|
|
@@ -1700,6 +1722,7 @@ const SelectField = /*#__PURE__*/React__default.default.memo(function SelectFiel
|
|
|
1700
1722
|
inputName: input.name,
|
|
1701
1723
|
inputValue: input.value,
|
|
1702
1724
|
isRequired: isRequired,
|
|
1725
|
+
isDisabled: isDisabled,
|
|
1703
1726
|
metaActive: meta.active,
|
|
1704
1727
|
metaError: meta.error,
|
|
1705
1728
|
metaModifiedSinceLastSubmit: meta.modifiedSinceLastSubmit,
|
|
@@ -1713,6 +1736,7 @@ const SelectField = /*#__PURE__*/React__default.default.memo(function SelectFiel
|
|
|
1713
1736
|
instanceId: `id_${input.name}`,
|
|
1714
1737
|
value: selectedOptions,
|
|
1715
1738
|
onChange: onChangeValue,
|
|
1739
|
+
isDisabled: isDisabled,
|
|
1716
1740
|
options: options,
|
|
1717
1741
|
ref: selectRef
|
|
1718
1742
|
}, selectProps)));
|
|
@@ -1731,6 +1755,7 @@ SelectField.propTypes = {
|
|
|
1731
1755
|
const SwitchField = /*#__PURE__*/React__default.default.memo(function SwitchField(props) {
|
|
1732
1756
|
const {
|
|
1733
1757
|
name,
|
|
1758
|
+
isDisabled,
|
|
1734
1759
|
isRequired,
|
|
1735
1760
|
onChange,
|
|
1736
1761
|
fieldProps,
|
|
@@ -1757,6 +1782,7 @@ const SwitchField = /*#__PURE__*/React__default.default.memo(function SwitchFiel
|
|
|
1757
1782
|
inputName: input.name,
|
|
1758
1783
|
inputValue: input.checked,
|
|
1759
1784
|
isRequired: isRequired,
|
|
1785
|
+
isDisabled: isDisabled,
|
|
1760
1786
|
metaActive: meta.active,
|
|
1761
1787
|
metaError: meta.error,
|
|
1762
1788
|
metaModifiedSinceLastSubmit: meta.modifiedSinceLastSubmit,
|
|
@@ -1768,6 +1794,7 @@ const SwitchField = /*#__PURE__*/React__default.default.memo(function SwitchFiel
|
|
|
1768
1794
|
tag: "label"
|
|
1769
1795
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(Switch.Switch, Object.assign({
|
|
1770
1796
|
autoComplete: "nope",
|
|
1797
|
+
isDisabled: isDisabled,
|
|
1771
1798
|
checked: input.checked,
|
|
1772
1799
|
name: input.name,
|
|
1773
1800
|
type: "checkbox",
|
|
@@ -1792,6 +1819,7 @@ SwitchField.propTypes = {
|
|
|
1792
1819
|
const TextareaField = /*#__PURE__*/React__default.default.memo(function TextareaField(props) {
|
|
1793
1820
|
const {
|
|
1794
1821
|
isRequired,
|
|
1822
|
+
isDisabled,
|
|
1795
1823
|
name,
|
|
1796
1824
|
fieldProps,
|
|
1797
1825
|
inputProps,
|
|
@@ -1809,6 +1837,7 @@ const TextareaField = /*#__PURE__*/React__default.default.memo(function Textarea
|
|
|
1809
1837
|
inputName: input.name,
|
|
1810
1838
|
inputValue: input.value,
|
|
1811
1839
|
isRequired: isRequired,
|
|
1840
|
+
isDisabled: isDisabled,
|
|
1812
1841
|
metaActive: meta.active,
|
|
1813
1842
|
metaError: meta.error,
|
|
1814
1843
|
metaModifiedSinceLastSubmit: meta.modifiedSinceLastSubmit,
|
|
@@ -1821,6 +1850,7 @@ const TextareaField = /*#__PURE__*/React__default.default.memo(function Textarea
|
|
|
1821
1850
|
autoComplete: "nope",
|
|
1822
1851
|
name: input.name,
|
|
1823
1852
|
value: input.value,
|
|
1853
|
+
isDisabled: isDisabled,
|
|
1824
1854
|
onBlur: input.onBlur,
|
|
1825
1855
|
onChange: input.onChange,
|
|
1826
1856
|
onFocus: input.onFocus
|
package/dist/itcase-forms.esm.js
CHANGED
|
@@ -150,6 +150,7 @@ function FieldWrapperBase(props) {
|
|
|
150
150
|
type,
|
|
151
151
|
labelHidden,
|
|
152
152
|
hideMessage,
|
|
153
|
+
isDisabled,
|
|
153
154
|
isHidden,
|
|
154
155
|
tag: Tag,
|
|
155
156
|
dataTour,
|
|
@@ -168,8 +169,8 @@ function FieldWrapperBase(props) {
|
|
|
168
169
|
const isModifiedAfterSubmit = !metaError && metaSubmitError && metaModifiedSinceLastSubmit;
|
|
169
170
|
return hasValue && (metaValid || isModifiedAfterSubmit);
|
|
170
171
|
}, [inputValue, metaValid, metaError, metaSubmitError, metaModifiedSinceLastSubmit]);
|
|
171
|
-
const formFieldClass = useMemo(() => clsx(className, showError && 'form__item_state_error', showValid && 'form__item_state_success', isRequired && 'form__item_state_required', metaActive && 'form__item_state_focus', inputValue && 'form__item_state_filled'), [className, showError, showValid, isRequired, metaActive, inputValue]);
|
|
172
|
-
const fieldClass = useMemo(() => clsx(fieldClassName, showError && `${fieldClassName}_state_error`, showValid && `${fieldClassName}_state_success`, metaActive && `${fieldClassName}_state_focus`, inputValue && `${fieldClassName}_state_filled`), [fieldClassName, showError, showValid, metaActive, inputValue]);
|
|
172
|
+
const formFieldClass = useMemo(() => clsx(className, showError && 'form__item_state_error', showValid && 'form__item_state_success', isRequired && 'form__item_state_required', isDisabled && 'form__item_state_disabled', metaActive && 'form__item_state_focus', inputValue && 'form__item_state_filled'), [className, showError, showValid, isRequired, metaActive, inputValue, isDisabled]);
|
|
173
|
+
const fieldClass = useMemo(() => clsx(fieldClassName, showError && `${fieldClassName}_state_error`, showValid && `${fieldClassName}_state_success`, metaActive && `${fieldClassName}_state_focus`, inputValue && `${fieldClassName}_state_filled`, isDisabled && `${fieldClassName}_state_disabled`), [fieldClassName, showError, showValid, metaActive, inputValue, isDisabled]);
|
|
173
174
|
const sizeClass = useDeviceTargetClass(props, {
|
|
174
175
|
prefix: 'form-field_size_',
|
|
175
176
|
propsKey: 'size'
|
|
@@ -202,7 +203,7 @@ function FieldWrapperBase(props) {
|
|
|
202
203
|
styles: formFieldStyles
|
|
203
204
|
} = useStyles(props);
|
|
204
205
|
return /*#__PURE__*/React.createElement(Tag, {
|
|
205
|
-
className: clsx(formFieldClass, 'form__item', 'form-field', type && `form-field_type_${type}`, set && `form-field_set_${set}`, sizeClass, fillClass, shapeClass, isHidden && `form-field_state_hidden`, directionClass, widthClass),
|
|
206
|
+
className: clsx(formFieldClass, 'form__item', 'form-field', type && `form-field_type_${type}`, set && `form-field_set_${set}`, sizeClass, fillClass, shapeClass, isDisabled && `form-field_state_disabled`, isHidden && `form-field_state_hidden`, directionClass, widthClass),
|
|
206
207
|
"data-tour": dataTour,
|
|
207
208
|
style: formFieldStyles
|
|
208
209
|
}, before, (label || labelHidden) && /*#__PURE__*/React.createElement("div", {
|
|
@@ -341,6 +342,7 @@ FieldWrapper.propTypes = {
|
|
|
341
342
|
const CheckboxField = /*#__PURE__*/React.memo(function CheckboxField(props) {
|
|
342
343
|
const {
|
|
343
344
|
name,
|
|
345
|
+
isDisabled,
|
|
344
346
|
isRequired,
|
|
345
347
|
onChange,
|
|
346
348
|
fieldProps,
|
|
@@ -367,6 +369,7 @@ const CheckboxField = /*#__PURE__*/React.memo(function CheckboxField(props) {
|
|
|
367
369
|
inputName: input.name,
|
|
368
370
|
inputValue: input.checked,
|
|
369
371
|
isRequired: isRequired,
|
|
372
|
+
isDisabled: isDisabled,
|
|
370
373
|
metaActive: meta.active,
|
|
371
374
|
metaError: meta.error,
|
|
372
375
|
metaModifiedSinceLastSubmit: meta.modifiedSinceLastSubmit,
|
|
@@ -380,6 +383,7 @@ const CheckboxField = /*#__PURE__*/React.memo(function CheckboxField(props) {
|
|
|
380
383
|
autoComplete: "nope",
|
|
381
384
|
checked: input.checked,
|
|
382
385
|
name: input.name,
|
|
386
|
+
isDisabled: isDisabled,
|
|
383
387
|
type: "checkbox",
|
|
384
388
|
onBlur: input.onBlur,
|
|
385
389
|
onChange: onChangeField,
|
|
@@ -449,6 +453,7 @@ const ChoiceField = /*#__PURE__*/React.memo(function ChoiceField(props) {
|
|
|
449
453
|
inputName: input.name,
|
|
450
454
|
inputValue: input.value || [],
|
|
451
455
|
isRequired: isRequired,
|
|
456
|
+
isDisabled: isDisabled,
|
|
452
457
|
label: label,
|
|
453
458
|
messageType: messageType,
|
|
454
459
|
metaActive: meta.active,
|
|
@@ -492,6 +497,7 @@ ChoiceField.propTypes = {
|
|
|
492
497
|
const CustomField = /*#__PURE__*/React.memo(function CustomField(props) {
|
|
493
498
|
const {
|
|
494
499
|
Component,
|
|
500
|
+
isDisabled,
|
|
495
501
|
isRequired,
|
|
496
502
|
name,
|
|
497
503
|
fieldProps,
|
|
@@ -506,6 +512,7 @@ const CustomField = /*#__PURE__*/React.memo(function CustomField(props) {
|
|
|
506
512
|
}) => /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
507
513
|
className: clsx('form-field_type_custom', 'form__item_type_custom', classNameGroupItem),
|
|
508
514
|
fieldClassName: 'form-custom',
|
|
515
|
+
isDisabled: isDisabled,
|
|
509
516
|
inputName: input.name,
|
|
510
517
|
inputValue: input.value,
|
|
511
518
|
isRequired: isRequired,
|
|
@@ -518,6 +525,7 @@ const CustomField = /*#__PURE__*/React.memo(function CustomField(props) {
|
|
|
518
525
|
metaValid: meta.valid,
|
|
519
526
|
hideMessage: hideMessage
|
|
520
527
|
}, fieldProps), /*#__PURE__*/React.createElement(Component, Object.assign({}, props, {
|
|
528
|
+
isDisabled: isDisabled,
|
|
521
529
|
input: input,
|
|
522
530
|
meta: meta
|
|
523
531
|
}))));
|
|
@@ -536,6 +544,7 @@ CustomField.propTypes = {
|
|
|
536
544
|
const CodeField = /*#__PURE__*/React.memo(function CodeField(props) {
|
|
537
545
|
const {
|
|
538
546
|
isRequired,
|
|
547
|
+
isDisabled,
|
|
539
548
|
name,
|
|
540
549
|
fieldProps,
|
|
541
550
|
inputProps,
|
|
@@ -553,6 +562,7 @@ const CodeField = /*#__PURE__*/React.memo(function CodeField(props) {
|
|
|
553
562
|
inputName: input.name,
|
|
554
563
|
inputValue: input.value,
|
|
555
564
|
isRequired: isRequired,
|
|
565
|
+
isDisabled: isDisabled,
|
|
556
566
|
metaActive: meta.active,
|
|
557
567
|
metaError: meta.error,
|
|
558
568
|
metaModifiedSinceLastSubmit: meta.modifiedSinceLastSubmit,
|
|
@@ -564,6 +574,7 @@ const CodeField = /*#__PURE__*/React.memo(function CodeField(props) {
|
|
|
564
574
|
}, fieldProps), /*#__PURE__*/React.createElement(Code, Object.assign({
|
|
565
575
|
autoComplete: "nope",
|
|
566
576
|
name: input.name,
|
|
577
|
+
isDisabled: isDisabled,
|
|
567
578
|
value: input.value,
|
|
568
579
|
onBlur: input.onBlur,
|
|
569
580
|
onChange: input.onChange,
|
|
@@ -593,6 +604,7 @@ function DatePickerField(props) {
|
|
|
593
604
|
iconBorderHover,
|
|
594
605
|
iconFill,
|
|
595
606
|
iconFillHover,
|
|
607
|
+
isDisabled,
|
|
596
608
|
iconRevealableShow,
|
|
597
609
|
iconRevealableHide,
|
|
598
610
|
iconShape,
|
|
@@ -618,6 +630,7 @@ function DatePickerField(props) {
|
|
|
618
630
|
inputName: input.name,
|
|
619
631
|
inputValue: input.value || '',
|
|
620
632
|
isRequired: isRequired,
|
|
633
|
+
isDisabled: isDisabled,
|
|
621
634
|
metaActive: meta.active,
|
|
622
635
|
metaError: meta.error,
|
|
623
636
|
metaModifiedSinceLastSubmit: meta.modifiedSinceLastSubmit,
|
|
@@ -630,6 +643,7 @@ function DatePickerField(props) {
|
|
|
630
643
|
name: input.name,
|
|
631
644
|
value: input.value || '',
|
|
632
645
|
onBlur: input.onBlur,
|
|
646
|
+
isDisabled: isDisabled,
|
|
633
647
|
onChange: onChangeField,
|
|
634
648
|
onFocus: input.onFocus,
|
|
635
649
|
inputProps: inputProps,
|
|
@@ -1320,6 +1334,7 @@ const InputField = /*#__PURE__*/React.memo(function InputField(props) {
|
|
|
1320
1334
|
inputName: input.name,
|
|
1321
1335
|
inputValue: input.value || '',
|
|
1322
1336
|
isRequired: isRequired,
|
|
1337
|
+
isDisabled: isDisabled,
|
|
1323
1338
|
metaActive: meta.active,
|
|
1324
1339
|
metaError: meta.error,
|
|
1325
1340
|
metaModifiedSinceLastSubmit: meta.modifiedSinceLastSubmit,
|
|
@@ -1512,6 +1527,7 @@ const RadioGroup = /*#__PURE__*/React.memo(function RadioGroup(props) {
|
|
|
1512
1527
|
editableProps,
|
|
1513
1528
|
inputProps,
|
|
1514
1529
|
onChange,
|
|
1530
|
+
isDisabled,
|
|
1515
1531
|
hideMessage
|
|
1516
1532
|
} = props;
|
|
1517
1533
|
return /*#__PURE__*/React.createElement(Field, {
|
|
@@ -1525,6 +1541,7 @@ const RadioGroup = /*#__PURE__*/React.memo(function RadioGroup(props) {
|
|
|
1525
1541
|
inputName: input.name,
|
|
1526
1542
|
inputValue: input.value || '',
|
|
1527
1543
|
isRequired: isRequired,
|
|
1544
|
+
isDisabled: isDisabled,
|
|
1528
1545
|
metaActive: meta.active,
|
|
1529
1546
|
metaError: meta.error,
|
|
1530
1547
|
metaModifiedSinceLastSubmit: meta.modifiedSinceLastSubmit,
|
|
@@ -1536,6 +1553,7 @@ const RadioGroup = /*#__PURE__*/React.memo(function RadioGroup(props) {
|
|
|
1536
1553
|
}, fieldProps), /*#__PURE__*/React.createElement(RadioGroupList, {
|
|
1537
1554
|
input: input,
|
|
1538
1555
|
options: options,
|
|
1556
|
+
isDisabled: isDisabled,
|
|
1539
1557
|
onChange: onChange,
|
|
1540
1558
|
editableProps: editableProps,
|
|
1541
1559
|
inputProps: inputProps
|
|
@@ -1565,6 +1583,7 @@ function SegmentedField(props) {
|
|
|
1565
1583
|
name,
|
|
1566
1584
|
fieldProps,
|
|
1567
1585
|
inputProps,
|
|
1586
|
+
isDisabled,
|
|
1568
1587
|
hideMessage
|
|
1569
1588
|
} = props;
|
|
1570
1589
|
const {
|
|
@@ -1596,6 +1615,7 @@ function SegmentedField(props) {
|
|
|
1596
1615
|
inputName: input.name,
|
|
1597
1616
|
inputValue: input.value || [],
|
|
1598
1617
|
isRequired: isRequired,
|
|
1618
|
+
isDisabled: isDisabled,
|
|
1599
1619
|
metaActive: meta.active,
|
|
1600
1620
|
metaError: meta.error,
|
|
1601
1621
|
metaModifiedSinceLastSubmit: meta.modifiedSinceLastSubmit,
|
|
@@ -1606,6 +1626,7 @@ function SegmentedField(props) {
|
|
|
1606
1626
|
hideMessage: hideMessage
|
|
1607
1627
|
}, fieldProps), /*#__PURE__*/React.createElement(Segmented, Object.assign({
|
|
1608
1628
|
segments: options,
|
|
1629
|
+
isDisabled: isDisabled,
|
|
1609
1630
|
setActiveSegment: setActiveSegment,
|
|
1610
1631
|
activeSegment: activeOption
|
|
1611
1632
|
}, inputProps)));
|
|
@@ -1648,6 +1669,7 @@ const SelectField = /*#__PURE__*/React.memo(function SelectField(props) {
|
|
|
1648
1669
|
classNameGroupItem,
|
|
1649
1670
|
fieldProps,
|
|
1650
1671
|
hideMessage,
|
|
1672
|
+
isDisabled,
|
|
1651
1673
|
isRequired,
|
|
1652
1674
|
name,
|
|
1653
1675
|
options,
|
|
@@ -1690,6 +1712,7 @@ const SelectField = /*#__PURE__*/React.memo(function SelectField(props) {
|
|
|
1690
1712
|
inputName: input.name,
|
|
1691
1713
|
inputValue: input.value,
|
|
1692
1714
|
isRequired: isRequired,
|
|
1715
|
+
isDisabled: isDisabled,
|
|
1693
1716
|
metaActive: meta.active,
|
|
1694
1717
|
metaError: meta.error,
|
|
1695
1718
|
metaModifiedSinceLastSubmit: meta.modifiedSinceLastSubmit,
|
|
@@ -1703,6 +1726,7 @@ const SelectField = /*#__PURE__*/React.memo(function SelectField(props) {
|
|
|
1703
1726
|
instanceId: `id_${input.name}`,
|
|
1704
1727
|
value: selectedOptions,
|
|
1705
1728
|
onChange: onChangeValue,
|
|
1729
|
+
isDisabled: isDisabled,
|
|
1706
1730
|
options: options,
|
|
1707
1731
|
ref: selectRef
|
|
1708
1732
|
}, selectProps)));
|
|
@@ -1721,6 +1745,7 @@ SelectField.propTypes = {
|
|
|
1721
1745
|
const SwitchField = /*#__PURE__*/React.memo(function SwitchField(props) {
|
|
1722
1746
|
const {
|
|
1723
1747
|
name,
|
|
1748
|
+
isDisabled,
|
|
1724
1749
|
isRequired,
|
|
1725
1750
|
onChange,
|
|
1726
1751
|
fieldProps,
|
|
@@ -1747,6 +1772,7 @@ const SwitchField = /*#__PURE__*/React.memo(function SwitchField(props) {
|
|
|
1747
1772
|
inputName: input.name,
|
|
1748
1773
|
inputValue: input.checked,
|
|
1749
1774
|
isRequired: isRequired,
|
|
1775
|
+
isDisabled: isDisabled,
|
|
1750
1776
|
metaActive: meta.active,
|
|
1751
1777
|
metaError: meta.error,
|
|
1752
1778
|
metaModifiedSinceLastSubmit: meta.modifiedSinceLastSubmit,
|
|
@@ -1758,6 +1784,7 @@ const SwitchField = /*#__PURE__*/React.memo(function SwitchField(props) {
|
|
|
1758
1784
|
tag: "label"
|
|
1759
1785
|
}, fieldProps), /*#__PURE__*/React.createElement(Switch, Object.assign({
|
|
1760
1786
|
autoComplete: "nope",
|
|
1787
|
+
isDisabled: isDisabled,
|
|
1761
1788
|
checked: input.checked,
|
|
1762
1789
|
name: input.name,
|
|
1763
1790
|
type: "checkbox",
|
|
@@ -1782,6 +1809,7 @@ SwitchField.propTypes = {
|
|
|
1782
1809
|
const TextareaField = /*#__PURE__*/React.memo(function TextareaField(props) {
|
|
1783
1810
|
const {
|
|
1784
1811
|
isRequired,
|
|
1812
|
+
isDisabled,
|
|
1785
1813
|
name,
|
|
1786
1814
|
fieldProps,
|
|
1787
1815
|
inputProps,
|
|
@@ -1799,6 +1827,7 @@ const TextareaField = /*#__PURE__*/React.memo(function TextareaField(props) {
|
|
|
1799
1827
|
inputName: input.name,
|
|
1800
1828
|
inputValue: input.value,
|
|
1801
1829
|
isRequired: isRequired,
|
|
1830
|
+
isDisabled: isDisabled,
|
|
1802
1831
|
metaActive: meta.active,
|
|
1803
1832
|
metaError: meta.error,
|
|
1804
1833
|
metaModifiedSinceLastSubmit: meta.modifiedSinceLastSubmit,
|
|
@@ -1811,6 +1840,7 @@ const TextareaField = /*#__PURE__*/React.memo(function TextareaField(props) {
|
|
|
1811
1840
|
autoComplete: "nope",
|
|
1812
1841
|
name: input.name,
|
|
1813
1842
|
value: input.value,
|
|
1843
|
+
isDisabled: isDisabled,
|
|
1814
1844
|
onBlur: input.onBlur,
|
|
1815
1845
|
onChange: input.onChange,
|
|
1816
1846
|
onFocus: input.onFocus
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itcase/forms",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.49",
|
|
4
4
|
"description": "Forms fields, inputs, etc.",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
"registry": "https://registry.npmjs.org/"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@itcase/common": "^1.1.
|
|
34
|
-
"@itcase/ui": "^1.0.
|
|
33
|
+
"@itcase/common": "^1.1.11",
|
|
34
|
+
"@itcase/ui": "^1.0.88",
|
|
35
35
|
"axios": "^1.6.2",
|
|
36
36
|
"clsx": "^2.0.0",
|
|
37
37
|
"date-fns": "2.0.0-alpha.7",
|
|
38
38
|
"final-form": "^4.20.10",
|
|
39
39
|
"final-form-focus": "^1.1.2",
|
|
40
|
-
"libphonenumber-js": "^1.10.
|
|
40
|
+
"libphonenumber-js": "^1.10.52",
|
|
41
41
|
"lodash": "^4.17.21",
|
|
42
42
|
"luxon": "^3.4.4",
|
|
43
43
|
"prop-types": "^15.8.1",
|
|
@@ -63,12 +63,12 @@
|
|
|
63
63
|
"@semantic-release/git": "^10.0.1",
|
|
64
64
|
"babel-plugin-inline-react-svg": "^2.0.2",
|
|
65
65
|
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
|
|
66
|
-
"eslint": "8.
|
|
66
|
+
"eslint": "8.56.0",
|
|
67
67
|
"eslint-config-prettier": "^9.1.0",
|
|
68
68
|
"eslint-config-standard": "^17.1.0",
|
|
69
69
|
"eslint-plugin-import": "^2.29.1",
|
|
70
|
-
"eslint-plugin-n": "^16.
|
|
71
|
-
"eslint-plugin-prettier": "^5.
|
|
70
|
+
"eslint-plugin-n": "^16.5.0",
|
|
71
|
+
"eslint-plugin-prettier": "^5.1.2",
|
|
72
72
|
"eslint-plugin-promise": "^6.1.1",
|
|
73
73
|
"eslint-plugin-react": "^7.33.2",
|
|
74
74
|
"eslint-plugin-standard": "^5.0.0",
|
|
@@ -97,12 +97,12 @@
|
|
|
97
97
|
"postcss-responsive-type": "github:ITCase/postcss-responsive-type",
|
|
98
98
|
"postcss-sort-media-queries": "^5.2.0",
|
|
99
99
|
"prettier": "^3.1.1",
|
|
100
|
-
"react-datepicker": "^4.
|
|
101
|
-
"rollup": "^4.9.
|
|
100
|
+
"react-datepicker": "^4.25.0",
|
|
101
|
+
"rollup": "^4.9.1",
|
|
102
102
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
103
103
|
"semantic-release": "^22.0.12",
|
|
104
|
-
"stylelint": "^16.0
|
|
105
|
-
"stylelint-config-standard": "^
|
|
104
|
+
"stylelint": "^16.1.0",
|
|
105
|
+
"stylelint-config-standard": "^36.0.0",
|
|
106
106
|
"stylelint-no-unsupported-browser-features": "^7.0.0",
|
|
107
107
|
"stylelint-order": "^6.0.4"
|
|
108
108
|
}
|