GULP DIST
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { _ as _createClass, a as _classCallCheck, b as _objectWithoutProperties } from '../../_rollupPluginBabelHelpers-a0b34764.js';
|
||||
import { _ as _createClass, a as _classCallCheck, b as _objectWithoutProperties } from '../../_rollupPluginBabelHelpers-b054ecd2.js';
|
||||
import createMask from '../factory.js';
|
||||
import ChangeDetails from '../../core/change-details.js';
|
||||
import { DIRECTION } from '../../core/utils.js';
|
||||
@@ -24,6 +24,8 @@ var PatternInputDefinition = /*#__PURE__*/function () {
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
function PatternInputDefinition(opts) {
|
||||
_classCallCheck(this, PatternInputDefinition);
|
||||
@@ -40,7 +42,7 @@ var PatternInputDefinition = /*#__PURE__*/function () {
|
||||
_createClass(PatternInputDefinition, [{
|
||||
key: "reset",
|
||||
value: function reset() {
|
||||
this._isFilled = false;
|
||||
this.isFilled = false;
|
||||
this.masked.reset();
|
||||
}
|
||||
}, {
|
||||
@@ -50,7 +52,7 @@ var PatternInputDefinition = /*#__PURE__*/function () {
|
||||
var toPos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length;
|
||||
|
||||
if (fromPos === 0 && toPos >= 1) {
|
||||
this._isFilled = false;
|
||||
this.isFilled = false;
|
||||
return this.masked.remove(fromPos, toPos);
|
||||
}
|
||||
|
||||
@@ -59,7 +61,7 @@ var PatternInputDefinition = /*#__PURE__*/function () {
|
||||
}, {
|
||||
key: "value",
|
||||
get: function get() {
|
||||
return this.masked.value || (this._isFilled && !this.isOptional ? this.placeholderChar : '');
|
||||
return this.masked.value || (this.isFilled && !this.isOptional ? this.placeholderChar : '');
|
||||
}
|
||||
}, {
|
||||
key: "unmaskedValue",
|
||||
@@ -73,12 +75,12 @@ var PatternInputDefinition = /*#__PURE__*/function () {
|
||||
}
|
||||
}, {
|
||||
key: "_appendChar",
|
||||
value: function _appendChar(str) {
|
||||
value: function _appendChar(ch) {
|
||||
var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
if (this._isFilled) return new ChangeDetails();
|
||||
if (this.isFilled) return new ChangeDetails();
|
||||
var state = this.masked.state; // simulate input
|
||||
|
||||
var details = this.masked._appendChar(str, flags);
|
||||
var details = this.masked._appendChar(ch, flags);
|
||||
|
||||
if (details.inserted && this.doValidate(flags) === false) {
|
||||
details.inserted = details.rawInserted = '';
|
||||
@@ -90,7 +92,7 @@ var PatternInputDefinition = /*#__PURE__*/function () {
|
||||
}
|
||||
|
||||
details.skip = !details.inserted && !this.isOptional;
|
||||
this._isFilled = Boolean(details.inserted);
|
||||
this.isFilled = Boolean(details.inserted);
|
||||
return details;
|
||||
}
|
||||
}, {
|
||||
@@ -98,17 +100,23 @@ var PatternInputDefinition = /*#__PURE__*/function () {
|
||||
value: function append() {
|
||||
var _this$masked;
|
||||
|
||||
// TODO probably should be done via _appendChar
|
||||
return (_this$masked = this.masked).append.apply(_this$masked, arguments);
|
||||
}
|
||||
}, {
|
||||
key: "_appendPlaceholder",
|
||||
value: function _appendPlaceholder() {
|
||||
var details = new ChangeDetails();
|
||||
if (this._isFilled || this.isOptional) return details;
|
||||
this._isFilled = true;
|
||||
if (this.isFilled || this.isOptional) return details;
|
||||
this.isFilled = true;
|
||||
details.inserted = this.placeholderChar;
|
||||
return details;
|
||||
}
|
||||
}, {
|
||||
key: "_appendEager",
|
||||
value: function _appendEager() {
|
||||
return new ChangeDetails();
|
||||
}
|
||||
}, {
|
||||
key: "extractTail",
|
||||
value: function extractTail() {
|
||||
@@ -170,12 +178,12 @@ var PatternInputDefinition = /*#__PURE__*/function () {
|
||||
get: function get() {
|
||||
return {
|
||||
masked: this.masked.state,
|
||||
_isFilled: this._isFilled
|
||||
isFilled: this.isFilled
|
||||
};
|
||||
},
|
||||
set: function set(state) {
|
||||
this.masked.state = state.masked;
|
||||
this._isFilled = state._isFilled;
|
||||
this.isFilled = state.isFilled;
|
||||
}
|
||||
}]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user