ab-ui-library 1.66.0 → 1.67.1
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.
|
@@ -75,7 +75,8 @@ var CardSelectGroup = function CardSelectGroup(props) {
|
|
|
75
75
|
dataId = _ref.dataId,
|
|
76
76
|
popoverAddons = _ref.popoverAddons,
|
|
77
77
|
tooltipAddons = _ref.tooltipAddons,
|
|
78
|
-
actionAddons = _ref.actionAddons
|
|
78
|
+
actionAddons = _ref.actionAddons,
|
|
79
|
+
customContent = _ref.customContent;
|
|
79
80
|
return /*#__PURE__*/React.createElement(CardSelect, {
|
|
80
81
|
dataId: dataId,
|
|
81
82
|
className: 'card-select-group__item',
|
|
@@ -96,7 +97,8 @@ var CardSelectGroup = function CardSelectGroup(props) {
|
|
|
96
97
|
popoverAddons: popoverAddons,
|
|
97
98
|
tooltipAddons: tooltipAddons,
|
|
98
99
|
actionAddons: actionAddons,
|
|
99
|
-
disabled: cardsGroupDisable || disabled
|
|
100
|
+
disabled: cardsGroupDisable || disabled,
|
|
101
|
+
customContent: customContent
|
|
100
102
|
});
|
|
101
103
|
}));
|
|
102
104
|
};
|
|
@@ -107,6 +107,29 @@ var OneTimePassword = /*#__PURE__*/React.forwardRef(function (_ref) {
|
|
|
107
107
|
(_inputRefs$current4 = inputRefs.current[index + 1]) === null || _inputRefs$current4 === void 0 || _inputRefs$current4.focus();
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
|
+
var handlePaste = function handlePaste(e) {
|
|
111
|
+
var _inputRefs$current$ne;
|
|
112
|
+
e.preventDefault();
|
|
113
|
+
var pastedText = e.clipboardData.getData('text');
|
|
114
|
+
if (!pastedText) return;
|
|
115
|
+
var sanitized = allowLetters ? pastedText.replace(/\s+/g, '') : pastedText.replace(/\D/g, '');
|
|
116
|
+
if (!sanitized) return;
|
|
117
|
+
var chars = sanitized.slice(0, count).split('');
|
|
118
|
+
var newOtp = _toConsumableArray(otp);
|
|
119
|
+
chars.forEach(function (_char, i) {
|
|
120
|
+
newOtp[i] = _char;
|
|
121
|
+
});
|
|
122
|
+
setOtp(newOtp);
|
|
123
|
+
var currentValue = newOtp.join('');
|
|
124
|
+
if (handleChange) {
|
|
125
|
+
handleChange(e, currentValue);
|
|
126
|
+
}
|
|
127
|
+
if (setFieldValue && name) {
|
|
128
|
+
setFieldValue(name, currentValue);
|
|
129
|
+
}
|
|
130
|
+
var nextIndex = Math.min(chars.length, count - 1);
|
|
131
|
+
(_inputRefs$current$ne = inputRefs.current[nextIndex]) === null || _inputRefs$current$ne === void 0 || _inputRefs$current$ne.focus();
|
|
132
|
+
};
|
|
110
133
|
var setInputRef = useCallback(function (el, index) {
|
|
111
134
|
inputRefs.current[index] = el;
|
|
112
135
|
}, []);
|
|
@@ -128,6 +151,7 @@ var OneTimePassword = /*#__PURE__*/React.forwardRef(function (_ref) {
|
|
|
128
151
|
},
|
|
129
152
|
max: 1,
|
|
130
153
|
type: type,
|
|
154
|
+
onPaste: handlePaste,
|
|
131
155
|
pattern: pattern,
|
|
132
156
|
hasError: hasError,
|
|
133
157
|
isValid: isValid,
|