@7shifts/sous-chef 3.31.1-beta → 3.31.1-beta2
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/index.js +16 -4
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +16 -4
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8984,8 +8984,11 @@ var calculateMask = function calculateMask(_ref) {
|
|
|
8984
8984
|
var slotsSet = new Set(slots);
|
|
8985
8985
|
var accept = new RegExp('\\d', 'g');
|
|
8986
8986
|
var inputMatches = value.match(accept) || [];
|
|
8987
|
-
|
|
8988
|
-
|
|
8987
|
+
var _calculateDigitReplac = calculateDigitReplacement(slots, format, inputMatches.length, cursorPosition),
|
|
8988
|
+
isReplacingDigit = _calculateDigitReplac.isReplacingDigit,
|
|
8989
|
+
isReplacingAt = _calculateDigitReplac.isReplacingAt;
|
|
8990
|
+
if (isReplacingDigit) {
|
|
8991
|
+
inputMatches.splice(isReplacingAt, 1);
|
|
8989
8992
|
}
|
|
8990
8993
|
if (isDeletingAnchor) {
|
|
8991
8994
|
inputMatches.pop();
|
|
@@ -9024,10 +9027,19 @@ var calculateCursorPosition = function calculateCursorPosition(params) {
|
|
|
9024
9027
|
});
|
|
9025
9028
|
return calculatedCursorRange;
|
|
9026
9029
|
};
|
|
9027
|
-
var
|
|
9030
|
+
var calculateDigitReplacement = function calculateDigitReplacement(slots, format, amountOfDigitsTyped, cursorPosition) {
|
|
9028
9031
|
var slotsRegExp = new RegExp("[" + slots.split('').join('|') + "]", 'g');
|
|
9029
9032
|
var slotsMatches = format.match(slotsRegExp) || [];
|
|
9030
|
-
|
|
9033
|
+
var isReplacingDigit = amountOfDigitsTyped > slotsMatches.length;
|
|
9034
|
+
var getCharacterPosition = function getCharacterPosition() {
|
|
9035
|
+
var formatUntilTheCursorPoint = format.slice(0, cursorPosition.selectionStart);
|
|
9036
|
+
var slotsFormatSlicedMatches = formatUntilTheCursorPoint.match(slotsRegExp) || [];
|
|
9037
|
+
return slotsFormatSlicedMatches.length;
|
|
9038
|
+
};
|
|
9039
|
+
return {
|
|
9040
|
+
isReplacingDigit: isReplacingDigit,
|
|
9041
|
+
isReplacingAt: isReplacingDigit ? getCharacterPosition() : 0
|
|
9042
|
+
};
|
|
9031
9043
|
};
|
|
9032
9044
|
|
|
9033
9045
|
var useFieldMask = function useFieldMask(format) {
|