GULP DIST
This commit is contained in:
24
dist/assets/vendor/imask/esm/masked/number.js
vendored
24
dist/assets/vendor/imask/esm/masked/number.js
vendored
@@ -1,5 +1,5 @@
|
||||
import { d as _inherits, e as _createSuper, a as _classCallCheck, _ as _createClass, g as _get, h as _getPrototypeOf, f as _slicedToArray, i as _set } from '../_rollupPluginBabelHelpers-a0b34764.js';
|
||||
import { escapeRegExp, DIRECTION } from '../core/utils.js';
|
||||
import { d as _inherits, e as _createSuper, a as _classCallCheck, _ as _createClass, g as _get, h as _getPrototypeOf, f as _slicedToArray, i as _set } from '../_rollupPluginBabelHelpers-b054ecd2.js';
|
||||
import { escapeRegExp, normalizePrepare, DIRECTION } from '../core/utils.js';
|
||||
import ChangeDetails from '../core/change-details.js';
|
||||
import Masked from './base.js';
|
||||
import IMask from '../core/holder.js';
|
||||
@@ -95,14 +95,24 @@ var MaskedNumber = /*#__PURE__*/function (_Masked) {
|
||||
|
||||
}, {
|
||||
key: "doPrepare",
|
||||
value: function doPrepare(str) {
|
||||
value: function doPrepare(ch) {
|
||||
var _get2;
|
||||
|
||||
ch = ch.replace(this._mapToRadixRegExp, this.radix);
|
||||
|
||||
var noSepCh = this._removeThousandsSeparators(ch);
|
||||
|
||||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||||
args[_key - 1] = arguments[_key];
|
||||
}
|
||||
|
||||
return (_get2 = _get(_getPrototypeOf(MaskedNumber.prototype), "doPrepare", this)).call.apply(_get2, [this, this._removeThousandsSeparators(str.replace(this._mapToRadixRegExp, this.radix))].concat(args));
|
||||
var _normalizePrepare = normalizePrepare((_get2 = _get(_getPrototypeOf(MaskedNumber.prototype), "doPrepare", this)).call.apply(_get2, [this, noSepCh].concat(args))),
|
||||
_normalizePrepare2 = _slicedToArray(_normalizePrepare, 2),
|
||||
prepCh = _normalizePrepare2[0],
|
||||
details = _normalizePrepare2[1];
|
||||
|
||||
if (ch && !noSepCh) details.skip = true;
|
||||
return [prepCh, details];
|
||||
}
|
||||
/** */
|
||||
|
||||
@@ -282,7 +292,9 @@ var MaskedNumber = /*#__PURE__*/function (_Masked) {
|
||||
if (valid) {
|
||||
// validate as number
|
||||
var number = this.number;
|
||||
valid = valid && !isNaN(number) && (this.min == null || this.min >= 0 || this.min <= this.number) && (this.max == null || this.max <= 0 || this.number <= this.max);
|
||||
valid = valid && !isNaN(number) && ( // check min bound for negative values
|
||||
this.min == null || this.min >= 0 || this.min <= this.number) && ( // check max bound for positive values
|
||||
this.max == null || this.max <= 0 || this.number <= this.max);
|
||||
}
|
||||
|
||||
return valid && _get(_getPrototypeOf(MaskedNumber.prototype), "doValidate", this).call(this, flags);
|
||||
@@ -303,7 +315,7 @@ var MaskedNumber = /*#__PURE__*/function (_Masked) {
|
||||
if (validnum !== number) this.unmaskedValue = String(validnum);
|
||||
var formatted = this.value;
|
||||
if (this.normalizeZeros) formatted = this._normalizeZeros(formatted);
|
||||
if (this.padFractionalZeros) formatted = this._padFractionalZeros(formatted);
|
||||
if (this.padFractionalZeros && this.scale > 0) formatted = this._padFractionalZeros(formatted);
|
||||
this._value = formatted;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user