@itcase/forms 1.1.44 → 1.1.45
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/css/form/Form/Form.css +2 -6
- package/dist/itcase-forms.cjs.js +16 -22
- package/dist/itcase-forms.esm.js +16 -22
- package/package.json +1 -1
package/dist/itcase-forms.cjs.js
CHANGED
|
@@ -535,7 +535,7 @@ const defaultChipsProps = {
|
|
|
535
535
|
// Error
|
|
536
536
|
errorAppearance: 'errorPrimary sizeM solid rounded',
|
|
537
537
|
// Required
|
|
538
|
-
requiredAppearance: '
|
|
538
|
+
requiredAppearance: 'warningPrimary sizeM solid rounded'
|
|
539
539
|
// Success
|
|
540
540
|
// successAppearance: 'successPrimary sizeM solid rounded',
|
|
541
541
|
};
|
|
@@ -544,7 +544,6 @@ function FormFieldChips(props) {
|
|
|
544
544
|
const {
|
|
545
545
|
name,
|
|
546
546
|
initialValue,
|
|
547
|
-
isDisabled,
|
|
548
547
|
classNameGroupItem,
|
|
549
548
|
emptyMessage,
|
|
550
549
|
emptyMessageTextColor,
|
|
@@ -553,6 +552,7 @@ function FormFieldChips(props) {
|
|
|
553
552
|
inputProps,
|
|
554
553
|
options,
|
|
555
554
|
showMessage,
|
|
555
|
+
isDisabled,
|
|
556
556
|
isRequired,
|
|
557
557
|
onChange
|
|
558
558
|
} = props;
|
|
@@ -581,8 +581,8 @@ function FormFieldChips(props) {
|
|
|
581
581
|
const {
|
|
582
582
|
errorKey,
|
|
583
583
|
errorMessage,
|
|
584
|
-
isErrorState,
|
|
585
584
|
successKey,
|
|
585
|
+
isErrorState,
|
|
586
586
|
isValidState
|
|
587
587
|
} = useFieldValidationState({
|
|
588
588
|
fieldProps: fieldProps,
|
|
@@ -608,14 +608,14 @@ function FormFieldChips(props) {
|
|
|
608
608
|
className: clsx__default.default('form-field_chips', 'form__item_chips', classNameGroupItem),
|
|
609
609
|
errorKey: errorKey,
|
|
610
610
|
errorMessage: errorMessage,
|
|
611
|
-
isErrorState: isErrorState,
|
|
612
|
-
metaError: meta.error,
|
|
613
|
-
isDisabled: isDisabled,
|
|
614
611
|
fieldClassName: "form-chips",
|
|
615
612
|
inputName: input.name,
|
|
616
613
|
inputValue: input.value,
|
|
617
614
|
metaActive: meta.active,
|
|
615
|
+
metaError: meta.error,
|
|
618
616
|
showMessage: showMessage,
|
|
617
|
+
isDisabled: isDisabled,
|
|
618
|
+
isErrorState: isErrorState,
|
|
619
619
|
isRequired: isRequired,
|
|
620
620
|
isValidState: isValidState
|
|
621
621
|
}, fieldProps), options.length ? /*#__PURE__*/React__default.default.createElement(Chips.ChipsGroup, {
|
|
@@ -626,9 +626,9 @@ function FormFieldChips(props) {
|
|
|
626
626
|
className: clsx__default.default(meta.active && 'form-chips_state_focus', meta.error && meta.touched && `form-chips_state_${errorKey}`),
|
|
627
627
|
key: option.value,
|
|
628
628
|
label: option.label,
|
|
629
|
-
isDisabled: option.isDisabled,
|
|
630
629
|
value: option.value,
|
|
631
630
|
isActive: activeOptionsList.some(activeOption => activeOption.value === option.value),
|
|
631
|
+
isDisabled: option.isDisabled,
|
|
632
632
|
onClick: () => onChangeSomeInput(input.value, option.value)
|
|
633
633
|
}, updatedInputProps)))) : /*#__PURE__*/React__default.default.createElement(Text.Text, {
|
|
634
634
|
size: emptyMessageTextSize,
|
|
@@ -1732,6 +1732,7 @@ const FormFieldMaskedInput = /*#__PURE__*/React__default.default.memo(function F
|
|
|
1732
1732
|
const {
|
|
1733
1733
|
name,
|
|
1734
1734
|
initialValue,
|
|
1735
|
+
isDisabled,
|
|
1735
1736
|
classNameGroupItem,
|
|
1736
1737
|
clearIcon,
|
|
1737
1738
|
clearIconFill,
|
|
@@ -1743,7 +1744,6 @@ const FormFieldMaskedInput = /*#__PURE__*/React__default.default.memo(function F
|
|
|
1743
1744
|
optionsMask,
|
|
1744
1745
|
showMessage,
|
|
1745
1746
|
unmasked,
|
|
1746
|
-
isDisabled,
|
|
1747
1747
|
isRequired,
|
|
1748
1748
|
onClickClearIcon
|
|
1749
1749
|
} = props;
|
|
@@ -1763,10 +1763,11 @@ const FormFieldMaskedInput = /*#__PURE__*/React__default.default.memo(function F
|
|
|
1763
1763
|
|
|
1764
1764
|
const {
|
|
1765
1765
|
ref,
|
|
1766
|
+
setUnmaskedValue,
|
|
1766
1767
|
unmaskedValue,
|
|
1767
|
-
value
|
|
1768
|
-
setUnmaskedValue
|
|
1768
|
+
value
|
|
1769
1769
|
} = reactImask.useIMask(optionsMask, {
|
|
1770
|
+
defaultValue: initialValue,
|
|
1770
1771
|
onAccept: (newValue, event, element) => {
|
|
1771
1772
|
if (element) {
|
|
1772
1773
|
input.onChange(event._unmaskedValue);
|
|
@@ -1778,18 +1779,11 @@ const FormFieldMaskedInput = /*#__PURE__*/React__default.default.memo(function F
|
|
|
1778
1779
|
setUnmaskedValue(input.value.replace(unmasked, ''));
|
|
1779
1780
|
}
|
|
1780
1781
|
}, [input.value]);
|
|
1781
|
-
|
|
1782
|
-
// useEffect(() => {
|
|
1783
|
-
// if (unmaskedValue !== input.value) {
|
|
1784
|
-
// input.onChange(unmaskedValue)
|
|
1785
|
-
// }
|
|
1786
|
-
// }, [unmaskedValue])
|
|
1787
|
-
|
|
1788
1782
|
const {
|
|
1789
1783
|
errorKey,
|
|
1790
1784
|
errorMessage,
|
|
1791
|
-
successKey,
|
|
1792
1785
|
isErrorState,
|
|
1786
|
+
successKey,
|
|
1793
1787
|
isValidState
|
|
1794
1788
|
} = useFieldValidationState({
|
|
1795
1789
|
fieldProps: fieldProps,
|
|
@@ -1804,14 +1798,14 @@ const FormFieldMaskedInput = /*#__PURE__*/React__default.default.memo(function F
|
|
|
1804
1798
|
className: clsx__default.default('form-field-masked-input', 'form__item_masked-input', classNameGroupItem),
|
|
1805
1799
|
errorKey: errorKey,
|
|
1806
1800
|
errorMessage: errorMessage,
|
|
1801
|
+
isErrorState: isErrorState,
|
|
1802
|
+
metaError: meta.error,
|
|
1803
|
+
isDisabled: isDisabled,
|
|
1807
1804
|
fieldClassName: 'form-maskedInput',
|
|
1808
1805
|
inputName: input.name,
|
|
1809
|
-
inputValue: input.value,
|
|
1806
|
+
inputValue: input.value || unmasked,
|
|
1810
1807
|
metaActive: meta.active,
|
|
1811
|
-
metaError: meta.error,
|
|
1812
1808
|
showMessage: showMessage,
|
|
1813
|
-
isDisabled: isDisabled,
|
|
1814
|
-
isErrorState: isErrorState,
|
|
1815
1809
|
isRequired: isRequired,
|
|
1816
1810
|
isValidState: isValidState
|
|
1817
1811
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(Input.Input, Object.assign({
|
package/dist/itcase-forms.esm.js
CHANGED
|
@@ -524,7 +524,7 @@ const defaultChipsProps = {
|
|
|
524
524
|
// Error
|
|
525
525
|
errorAppearance: 'errorPrimary sizeM solid rounded',
|
|
526
526
|
// Required
|
|
527
|
-
requiredAppearance: '
|
|
527
|
+
requiredAppearance: 'warningPrimary sizeM solid rounded'
|
|
528
528
|
// Success
|
|
529
529
|
// successAppearance: 'successPrimary sizeM solid rounded',
|
|
530
530
|
};
|
|
@@ -533,7 +533,6 @@ function FormFieldChips(props) {
|
|
|
533
533
|
const {
|
|
534
534
|
name,
|
|
535
535
|
initialValue,
|
|
536
|
-
isDisabled,
|
|
537
536
|
classNameGroupItem,
|
|
538
537
|
emptyMessage,
|
|
539
538
|
emptyMessageTextColor,
|
|
@@ -542,6 +541,7 @@ function FormFieldChips(props) {
|
|
|
542
541
|
inputProps,
|
|
543
542
|
options,
|
|
544
543
|
showMessage,
|
|
544
|
+
isDisabled,
|
|
545
545
|
isRequired,
|
|
546
546
|
onChange
|
|
547
547
|
} = props;
|
|
@@ -570,8 +570,8 @@ function FormFieldChips(props) {
|
|
|
570
570
|
const {
|
|
571
571
|
errorKey,
|
|
572
572
|
errorMessage,
|
|
573
|
-
isErrorState,
|
|
574
573
|
successKey,
|
|
574
|
+
isErrorState,
|
|
575
575
|
isValidState
|
|
576
576
|
} = useFieldValidationState({
|
|
577
577
|
fieldProps: fieldProps,
|
|
@@ -597,14 +597,14 @@ function FormFieldChips(props) {
|
|
|
597
597
|
className: clsx('form-field_chips', 'form__item_chips', classNameGroupItem),
|
|
598
598
|
errorKey: errorKey,
|
|
599
599
|
errorMessage: errorMessage,
|
|
600
|
-
isErrorState: isErrorState,
|
|
601
|
-
metaError: meta.error,
|
|
602
|
-
isDisabled: isDisabled,
|
|
603
600
|
fieldClassName: "form-chips",
|
|
604
601
|
inputName: input.name,
|
|
605
602
|
inputValue: input.value,
|
|
606
603
|
metaActive: meta.active,
|
|
604
|
+
metaError: meta.error,
|
|
607
605
|
showMessage: showMessage,
|
|
606
|
+
isDisabled: isDisabled,
|
|
607
|
+
isErrorState: isErrorState,
|
|
608
608
|
isRequired: isRequired,
|
|
609
609
|
isValidState: isValidState
|
|
610
610
|
}, fieldProps), options.length ? /*#__PURE__*/React.createElement(ChipsGroup, {
|
|
@@ -615,9 +615,9 @@ function FormFieldChips(props) {
|
|
|
615
615
|
className: clsx(meta.active && 'form-chips_state_focus', meta.error && meta.touched && `form-chips_state_${errorKey}`),
|
|
616
616
|
key: option.value,
|
|
617
617
|
label: option.label,
|
|
618
|
-
isDisabled: option.isDisabled,
|
|
619
618
|
value: option.value,
|
|
620
619
|
isActive: activeOptionsList.some(activeOption => activeOption.value === option.value),
|
|
620
|
+
isDisabled: option.isDisabled,
|
|
621
621
|
onClick: () => onChangeSomeInput(input.value, option.value)
|
|
622
622
|
}, updatedInputProps)))) : /*#__PURE__*/React.createElement(Text, {
|
|
623
623
|
size: emptyMessageTextSize,
|
|
@@ -1721,6 +1721,7 @@ const FormFieldMaskedInput = /*#__PURE__*/React.memo(function FormFieldMaskedInp
|
|
|
1721
1721
|
const {
|
|
1722
1722
|
name,
|
|
1723
1723
|
initialValue,
|
|
1724
|
+
isDisabled,
|
|
1724
1725
|
classNameGroupItem,
|
|
1725
1726
|
clearIcon,
|
|
1726
1727
|
clearIconFill,
|
|
@@ -1732,7 +1733,6 @@ const FormFieldMaskedInput = /*#__PURE__*/React.memo(function FormFieldMaskedInp
|
|
|
1732
1733
|
optionsMask,
|
|
1733
1734
|
showMessage,
|
|
1734
1735
|
unmasked,
|
|
1735
|
-
isDisabled,
|
|
1736
1736
|
isRequired,
|
|
1737
1737
|
onClickClearIcon
|
|
1738
1738
|
} = props;
|
|
@@ -1752,10 +1752,11 @@ const FormFieldMaskedInput = /*#__PURE__*/React.memo(function FormFieldMaskedInp
|
|
|
1752
1752
|
|
|
1753
1753
|
const {
|
|
1754
1754
|
ref,
|
|
1755
|
+
setUnmaskedValue,
|
|
1755
1756
|
unmaskedValue,
|
|
1756
|
-
value
|
|
1757
|
-
setUnmaskedValue
|
|
1757
|
+
value
|
|
1758
1758
|
} = useIMask(optionsMask, {
|
|
1759
|
+
defaultValue: initialValue,
|
|
1759
1760
|
onAccept: (newValue, event, element) => {
|
|
1760
1761
|
if (element) {
|
|
1761
1762
|
input.onChange(event._unmaskedValue);
|
|
@@ -1767,18 +1768,11 @@ const FormFieldMaskedInput = /*#__PURE__*/React.memo(function FormFieldMaskedInp
|
|
|
1767
1768
|
setUnmaskedValue(input.value.replace(unmasked, ''));
|
|
1768
1769
|
}
|
|
1769
1770
|
}, [input.value]);
|
|
1770
|
-
|
|
1771
|
-
// useEffect(() => {
|
|
1772
|
-
// if (unmaskedValue !== input.value) {
|
|
1773
|
-
// input.onChange(unmaskedValue)
|
|
1774
|
-
// }
|
|
1775
|
-
// }, [unmaskedValue])
|
|
1776
|
-
|
|
1777
1771
|
const {
|
|
1778
1772
|
errorKey,
|
|
1779
1773
|
errorMessage,
|
|
1780
|
-
successKey,
|
|
1781
1774
|
isErrorState,
|
|
1775
|
+
successKey,
|
|
1782
1776
|
isValidState
|
|
1783
1777
|
} = useFieldValidationState({
|
|
1784
1778
|
fieldProps: fieldProps,
|
|
@@ -1793,14 +1787,14 @@ const FormFieldMaskedInput = /*#__PURE__*/React.memo(function FormFieldMaskedInp
|
|
|
1793
1787
|
className: clsx('form-field-masked-input', 'form__item_masked-input', classNameGroupItem),
|
|
1794
1788
|
errorKey: errorKey,
|
|
1795
1789
|
errorMessage: errorMessage,
|
|
1790
|
+
isErrorState: isErrorState,
|
|
1791
|
+
metaError: meta.error,
|
|
1792
|
+
isDisabled: isDisabled,
|
|
1796
1793
|
fieldClassName: 'form-maskedInput',
|
|
1797
1794
|
inputName: input.name,
|
|
1798
|
-
inputValue: input.value,
|
|
1795
|
+
inputValue: input.value || unmasked,
|
|
1799
1796
|
metaActive: meta.active,
|
|
1800
|
-
metaError: meta.error,
|
|
1801
1797
|
showMessage: showMessage,
|
|
1802
|
-
isDisabled: isDisabled,
|
|
1803
|
-
isErrorState: isErrorState,
|
|
1804
1798
|
isRequired: isRequired,
|
|
1805
1799
|
isValidState: isValidState
|
|
1806
1800
|
}, fieldProps), /*#__PURE__*/React.createElement(Input, Object.assign({
|