diff --git a/js/tabler.js b/js/tabler.js index 8a3d0e8553eede6c3174347918d65044fdcafb25..444e2efcf0df7fef439279799c24825497f04619 100644 --- a/js/tabler.js +++ b/js/tabler.js @@ -121,7 +121,6 @@ $(document).ready(function () { (function() { var $elem = $('[data-toggle="autosize"]'); - console.log('$elem', $elem); if ($elem) { $elem.each(function() { @@ -131,6 +130,24 @@ $(document).ready(function () { })(); } + + /* + Imask plugin + */ + if(window.IMask) { + (function() { + var $elem = $('[data-mask]'); + + if ($elem) { + $elem.each(function() { + IMask($(this).get(0), { + mask: $(this).attr('data-mask'), + lazy: $(this).attr('data-mask-visible') === 'true' + }) + }); + } + })(); + } }); window.tabler = tabler; diff --git a/package.json b/package.json index b4ce5e8a72fdba65fa096a247cbcdcb9639f03c7..ccd5db3fc1a6bae44f022ab45975bf9b18b45721 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,8 @@ }, "dependencies": { "apexcharts": "3.6.2", + "autosize": "4.0.2", "bootstrap": "twbs/bootstrap#41fcd13", - "autosize": "4.0.2" + "imask": "^5.1.5" } } diff --git a/pages/_data/docs.yml b/pages/_data/docs.yml index e525cfed7e44724a892e687257c9d587fca457a0..ed3d99171dc44c7d87e9937b207fcb1d7a54777a 100644 --- a/pages/_data/docs.yml +++ b/pages/_data/docs.yml @@ -9,6 +9,7 @@ - page: divider - page: flags - page: form-helpers +- page: input-mask - page: ribbons - page: spinners - page: steps diff --git a/pages/_docs/input-mask.md b/pages/_docs/input-mask.md new file mode 100644 index 0000000000000000000000000000000000000000..b2b5a0e56c8600c66ec7c990549b50ec7e7a482a --- /dev/null +++ b/pages/_docs/input-mask.md @@ -0,0 +1,8 @@ +--- +title: Input mask +--- + +{% example %} + +{% include ui/input-mask.html mask="(00) 0000-0000" placeholder="(00) 0000-0000" visible=true %} +{% endexample %} diff --git a/pages/_includes/cards/form-elements.html b/pages/_includes/cards/form-elements.html index b9cc99d80015b4d1be94120811bfd01f2b649c09..15362c02bc611e680d812810549ff304edc482d1 100644 --- a/pages/_includes/cards/form-elements.html +++ b/pages/_includes/cards/form-elements.html @@ -4,379 +4,23 @@
-
-
- -
Username
-
-
- - -
-
- - -
-
- - -
-
- - -
- - {% include parts/input-image.html %} - - {% include parts/input-color.html %} - -
- -
- - - - -
-
-
- -
- - -
-
- - {% include parts/input-icon.html %} - -
- -
-
- -
- - - -
-
-
- -
-
- -
- - ? - -
+
+
+
{% include forms/form-elements-1.html %}
+
{% include forms/form-elements-2.html %}
-
-
- - -
- -
- - - - -
- -
- - -
Invalid feedback
- - -
- -
- - -
-
- - -
-
- - {% include ui/input-selectgroup.html values="S,M,L,XL,XXL" type="radio" name="size" %} -
-
- - {% include ui/input-selectgroup.html values="Unregistered,Priority Mail,Express Mail" class="selectgroup-vertical" type="radio" name="shipping-method" %} -
-
- - {% include ui/input-selectgroup.html values="i:smartphone,i:tablet,i:monitor,i:x" class="w-100" type="radio" name="device" %} -
- -
- - {% include ui/input-selectgroup.html values="i:sun,i:moon,i:cloud-rain,i:cloud,Other" class="selectgroup-pills" %} -
- -
- - {% include ui/input-selectgroup.html values="HTML,CSS,PHP,JavaScript" class="selectgroup-pills" %} -
- - {% include parts/input-toggle.html %} - -
-
Toggle switch single
- -
- -
-
Radios
-
- - - - -
+
+
+
{% include forms/form-elements-3.html %}
+
{% include forms/form-elements-4.html %}
-
-
- -
-
Inline Radios
-
- - - -
-
-
-
Checkboxes
-
- - - - -
-
-
-
Inline Checkboxes
-
- - - -
-
-
-
Bootstrap's Custom File Input
-
- - -
+
+
+
{% include forms/form-elements-5.html %}
+
{% include forms/form-elements-6.html %}
- -
- -
-
- -
-
- -
-
- -
-
-
- - -
- - {% include forms/input-group.html prepend="@" placeholder="username" %} -
- -
- - {% include forms/input-group.html append=".tabler.io" placeholder="subdomain" %} -
- -
- - {% include forms/input-group.html prepend="https://example.com/users/" %} -
- -
- - {% include forms/input-group.html prepend="$" append=".00" %} -
- -
- -
- - -
-
- -
- - -
- -
- - -
- -
- - -
- -
- - -
-
- -
- {% include parts/form-fieldset.html %}
diff --git a/pages/_includes/forms/form-elements-1.html b/pages/_includes/forms/form-elements-1.html new file mode 100644 index 0000000000000000000000000000000000000000..754370e609d4f1943a9115d82bc97411a7a3adfb --- /dev/null +++ b/pages/_includes/forms/form-elements-1.html @@ -0,0 +1,85 @@ +
+ +
Username
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +{% include parts/input-image.html %} + +{% include parts/input-color.html %} + +
+ +
+ + + + +
+
+
+ +
+ + +
+
+ +{% include parts/input-icon.html %} + +
+ +
+
+ +
+ + + +
+
+
+ +
+
+ +
+ + ? + +
+
diff --git a/pages/_includes/forms/form-elements-2.html b/pages/_includes/forms/form-elements-2.html new file mode 100644 index 0000000000000000000000000000000000000000..495e0dce544bac2f3476bf365a33d07fdd001b65 --- /dev/null +++ b/pages/_includes/forms/form-elements-2.html @@ -0,0 +1,89 @@ +
+ + +
+ +
+ + + + +
+ +
+ + +
Invalid feedback
+ + +
+ +
+ + +
+
+ + +
+
+ + {% include ui/input-selectgroup.html values="S,M,L,XL,XXL" type="radio" name="size" %} +
+
+ + {% include ui/input-selectgroup.html values="Unregistered,Priority Mail,Express Mail" class="selectgroup-vertical" type="radio" name="shipping-method" %} +
+
+ + {% include ui/input-selectgroup.html values="i:smartphone,i:tablet,i:monitor,i:x" class="w-100" type="radio" name="device" %} +
+ +
+ + {% include ui/input-selectgroup.html values="i:sun,i:moon,i:cloud-rain,i:cloud,Other" class="selectgroup-pills" %} +
+ +
+ + {% include ui/input-selectgroup.html values="HTML,CSS,PHP,JavaScript" class="selectgroup-pills" %} +
+ +{% include parts/input-toggle.html %} + +
+
Toggle switch single
+ +
+ +
+
Radios
+
+ + + + +
+
diff --git a/pages/_includes/forms/form-elements-3.html b/pages/_includes/forms/form-elements-3.html new file mode 100644 index 0000000000000000000000000000000000000000..eb88953f5451b6bea806d891195d06102fcf4e13 --- /dev/null +++ b/pages/_includes/forms/form-elements-3.html @@ -0,0 +1,188 @@ +
+
Inline Radios
+
+ + + +
+
+
+
Checkboxes
+
+ + + + +
+
+
+
Inline Checkboxes
+
+ + + +
+
+
+
Bootstrap's Custom File Input
+
+ + +
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ + +
+ + {% include ui/input-group.html prepend="@" placeholder="username" %} +
+ +
+ + {% include ui/input-group.html append=".tabler.io" placeholder="subdomain" %} +
+ +
+ + {% include ui/input-group.html prepend="https://example.com/users/" %} +
+ +
+ + {% include ui/input-group.html prepend="$" append=".00" %} +
+ +
+ +
+ + +
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
diff --git a/pages/_includes/forms/form-elements-4.html b/pages/_includes/forms/form-elements-4.html new file mode 100644 index 0000000000000000000000000000000000000000..c22b3d66359f4fe2ca1a623b22c47019e1b8f5cb --- /dev/null +++ b/pages/_includes/forms/form-elements-4.html @@ -0,0 +1,10 @@ +{% include parts/form-fieldset.html %} + +
+ + {% include ui/input-mask.html mask="00/00/0000" placeholder="00/00/0000" visible=true %} +
+
+ + {% include ui/input-mask.html mask="(00) 0000-0000" placeholder="(00) 0000-0000" visible=true %} +
diff --git a/pages/_includes/forms/form-elements-5.html b/pages/_includes/forms/form-elements-5.html new file mode 100644 index 0000000000000000000000000000000000000000..7ed6ff82de6bcc2a78243fc9c54d3ef5ac14da69 --- /dev/null +++ b/pages/_includes/forms/form-elements-5.html @@ -0,0 +1 @@ +5 diff --git a/pages/_includes/forms/form-elements-6.html b/pages/_includes/forms/form-elements-6.html new file mode 100644 index 0000000000000000000000000000000000000000..1e8b314962144c26d5e0e50fd29d2ca327864913 --- /dev/null +++ b/pages/_includes/forms/form-elements-6.html @@ -0,0 +1 @@ +6 diff --git a/pages/_includes/layout/js.html b/pages/_includes/layout/js.html index 7527b0daf806562c597304724c9359feb36b9db8..bfe0785d94a219a94cbeb658eb8c11c324551dd3 100644 --- a/pages/_includes/layout/js.html +++ b/pages/_includes/layout/js.html @@ -4,6 +4,7 @@ + diff --git a/pages/_includes/forms/input-group.html b/pages/_includes/ui/input-group.html similarity index 100% rename from pages/_includes/forms/input-group.html rename to pages/_includes/ui/input-group.html diff --git a/pages/_includes/ui/input-mask.html b/pages/_includes/ui/input-mask.html new file mode 100644 index 0000000000000000000000000000000000000000..bf15efd6ae62096ffa9aa95024b3eddb30c5efed --- /dev/null +++ b/pages/_includes/ui/input-mask.html @@ -0,0 +1 @@ + diff --git a/scss/ui/_inputs.scss b/scss/ui/_inputs.scss index 845e49efa9b85a81cbb5b494e4ba4cb303acae0b..6ca5d8a9bf93c80d825e6258be53cc23a66e3d0f 100644 --- a/scss/ui/_inputs.scss +++ b/scss/ui/_inputs.scss @@ -38,6 +38,7 @@ textarea { .form-fieldset { padding: 1rem; + margin-bottom: 1rem; background: $min-black; border: 1px solid $border-color; border-radius: $border-radius; diff --git a/static/libs/imask/imask.min.js b/static/libs/imask/imask.min.js new file mode 100644 index 0000000000000000000000000000000000000000..1774b9cc85b7f498f439502aa78780f653c7eb8d --- /dev/null +++ b/static/libs/imask/imask.min.js @@ -0,0 +1,2 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).IMask=e()}(this,function(){"use strict";var t=Math.ceil,e=Math.floor,n=function(n){return isNaN(n=+n)?0:(n>0?e:t)(n)},u=Math.min,i=function(t){return t>0?u(n(t),9007199254740991):0},r=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},a="".repeat||function(t){var e=String(r(this)),u="",i=n(t);if(i<0||i==1/0)throw RangeError("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(e+=e))1&i&&(u+=e);return u},s=function(t,e,n,u){var s,o,l=String(r(t)),h=l.length,c=void 0===n?" ":String(n),f=i(e);return f<=h||""==c?l:(s=f-h,(o=a.call(c,Math.ceil(s/c.length))).length>s&&(o=o.slice(0,s)),u?o+l:l+o)},o="object"==typeof window&&window&&window.Math==Math?window:"object"==typeof self&&self&&self.Math==Math?self:Function("return this")(),l=o.navigator,h=l&&l.userAgent||"",c=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(h),f=function(t){try{return!!t()}catch(t){return!0}},p=!f(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),d={}.propertyIsEnumerable,v=Object.getOwnPropertyDescriptor,k={f:v&&!d.call({1:2},1)?function(t){var e=v(this,t);return!!e&&e.enumerable}:d},g=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},y={}.toString,m="".split,_=f(function(){return!Object("z").propertyIsEnumerable(0)})?function(t){return"String"==function(t){return y.call(t).slice(8,-1)}(t)?m.call(t,""):Object(t)}:Object,A=function(t){return _(r(t))},C=function(t){return"object"==typeof t?null!==t:"function"==typeof t},F=function(t,e){if(!C(t))return t;var n,u;if(e&&"function"==typeof(n=t.toString)&&!C(u=n.call(t)))return u;if("function"==typeof(n=t.valueOf)&&!C(u=n.call(t)))return u;if(!e&&"function"==typeof(n=t.toString)&&!C(u=n.call(t)))return u;throw TypeError("Can't convert object to primitive value")},E={}.hasOwnProperty,b=function(t,e){return E.call(t,e)},S=o.document,B=C(S)&&C(S.createElement),D=!p&&!f(function(){return 7!=Object.defineProperty((t="div",B?S.createElement(t):{}),"a",{get:function(){return 7}}).a;var t}),w=Object.getOwnPropertyDescriptor,T={f:p?w:function(t,e){if(t=A(t),e=F(e,!0),D)try{return w(t,e)}catch(t){}if(b(t,e))return g(!k.f.call(t,e),t[e])}},x=function(t){if(!C(t))throw TypeError(String(t)+" is not an object");return t},P=Object.defineProperty,M={f:p?P:function(t,e,n){if(x(t),e=F(e,!0),x(n),D)try{return P(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},O=p?function(t,e,n){return M.f(t,e,g(1,n))}:function(t,e,n){return t[e]=n,t};function I(t,e){return t(e={exports:{}},e.exports),e.exports}var R,V,j,N,L=function(t,e){try{O(o,t,e)}catch(n){o[t]=e}return e},H=I(function(t){var e=o["__core-js_shared__"]||L("__core-js_shared__",{});(t.exports=function(t,n){return e[t]||(e[t]=void 0!==n?n:{})})("versions",[]).push({version:"3.0.1",mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}),G=H("native-function-to-string",Function.toString),z=o.WeakMap,U="function"==typeof z&&/native code/.test(G.call(z)),Y=0,Z=Math.random(),W=H("keys"),$={},K=o.WeakMap;if(U){var q=new K,J=q.get,Q=q.has,X=q.set;R=function(t,e){return X.call(q,t,e),e},V=function(t){return J.call(q,t)||{}},j=function(t){return Q.call(q,t)}}else{var tt=W[N="state"]||(W[N]=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++Y+Z).toString(36))}(N));$[tt]=!0,R=function(t,e){return O(t,tt,e),e},V=function(t){return b(t,tt)?t[tt]:{}},j=function(t){return b(t,tt)}}var et,nt={set:R,get:V,has:j,enforce:function(t){return j(t)?V(t):R(t,{})},getterFor:function(t){return function(e){var n;if(!C(e)||(n=V(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},ut=I(function(t){var e=nt.get,n=nt.enforce,u=String(G).split("toString");H("inspectSource",function(t){return G.call(t)}),(t.exports=function(t,e,i,r){var a=!!r&&!!r.unsafe,s=!!r&&!!r.enumerable,l=!!r&&!!r.noTargetGet;"function"==typeof i&&("string"!=typeof e||b(i,"name")||O(i,"name",e),n(i).source=u.join("string"==typeof e?e:"")),t!==o?(a?!l&&t[e]&&(s=!0):delete t[e],s?t[e]=i:O(t,e,i)):s?t[e]=i:L(e,i)})(Function.prototype,"toString",function(){return"function"==typeof this&&e(this).source||G.call(this)})}),it=Math.max,rt=Math.min,at=(et=!1,function(t,e,u){var r,a=A(t),s=i(a.length),o=function(t,e){var u=n(t);return u<0?it(u+e,0):rt(u,e)}(u,s);if(et&&e!=e){for(;s>o;)if((r=a[o++])!=r)return!0}else for(;s>o;o++)if((et||o in a)&&a[o]===e)return et||o||0;return!et&&-1}),st=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype"),ot={f:Object.getOwnPropertyNames||function(t){return function(t,e){var n,u=A(t),i=0,r=[];for(n in u)!b($,n)&&b(u,n)&&r.push(n);for(;e.length>i;)b(u,n=e[i++])&&(~at(r,n)||r.push(n));return r}(t,st)}},lt={f:Object.getOwnPropertySymbols},ht=o.Reflect,ct=ht&&ht.ownKeys||function(t){var e=ot.f(x(t)),n=lt.f;return n?e.concat(n(t)):e},ft=function(t,e){for(var n=ct(e),u=M.f,i=T.f,r=0;r=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(u=0;u=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Mt(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ot(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Tt(t)););return t}function It(t,e,n){return(It="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var u=Ot(t,e);if(u){var i=Object.getOwnPropertyDescriptor(u,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function Rt(t,e,n,u){return(Rt="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(t,e,n,u){var i,r=Ot(t,e);if(r){if((i=Object.getOwnPropertyDescriptor(r,e)).set)return i.set.call(u,n),!0;if(!i.writable)return!1}if(i=Object.getOwnPropertyDescriptor(u,e)){if(!i.writable)return!1;i.value=n,Object.defineProperty(u,e,i)}else St(u,e,n);return!0})(t,e,n,u)}function Vt(t,e,n,u,i){if(!Rt(t,e,n,u||t)&&i)throw new Error("failed to set property");return n}function jt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],u=!0,i=!1,r=void 0;try{for(var a,s=t[Symbol.iterator]();!(u=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);u=!0);}catch(t){i=!0,r=t}finally{try{u||null==s.return||s.return()}finally{if(i)throw r}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Nt(t){return"string"==typeof t||t instanceof String}At({target:"String",proto:!0,forced:c},{padEnd:function(t){return s(this,t,arguments.length>1?arguments[1]:void 0,!1)}}),At({target:"String",proto:!0,forced:c},{padStart:function(t){return s(this,t,arguments.length>1?arguments[1]:void 0,!0)}}),At({target:"String",proto:!0},{repeat:a});var Lt={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function Ht(t){return t.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}var Gt="undefined"!=typeof window&&window||"undefined"!=typeof global&&global.global===global&&global||"undefined"!=typeof self&&self.self===self&&self||{},zt=function(){function t(e,n,u,i){for(Ft(this,t),this.value=e,this.cursorPos=n,this.oldValue=u,this.oldSelection=i;this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start}return bt(t,[{key:"startChangePos",get:function(){return Math.min(this.cursorPos,this.oldSelection.start)}},{key:"insertedCount",get:function(){return this.cursorPos-this.startChangePos}},{key:"inserted",get:function(){return this.value.substr(this.startChangePos,this.insertedCount)}},{key:"removedCount",get:function(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}},{key:"removed",get:function(){return this.oldValue.substr(this.startChangePos,this.removedCount)}},{key:"head",get:function(){return this.value.substring(0,this.startChangePos)}},{key:"tail",get:function(){return this.value.substring(this.startChangePos+this.insertedCount)}},{key:"removeDirection",get:function(){return!this.removedCount||this.insertedCount?Lt.NONE:this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos?Lt.RIGHT:Lt.LEFT}}]),t}(),Ut=function(){function t(e){Ft(this,t),Bt(this,{inserted:"",rawInserted:"",skip:!1,tailShift:0},e)}return bt(t,[{key:"aggregate",value:function(t){return this.rawInserted+=t.rawInserted,this.skip=this.skip||t.skip,this.inserted+=t.inserted,this.tailShift+=t.tailShift,this}},{key:"offset",get:function(){return this.tailShift+this.inserted.length}}]),t}(),Yt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,u=arguments.length>2?arguments[2]:void 0;Ft(this,t),this.value=e,this.from=n,this.stop=u}return bt(t,[{key:"toString",value:function(){return this.value}},{key:"extend",value:function(t){this.value+=String(t)}},{key:"appendTo",value:function(t){return t.append(this.toString(),{tail:!0})}},{key:"shiftBefore",value:function(t){if(this.from>=t||!this.value.length)return"";var e=this.value[0];return this.value=this.value.slice(1),e}},{key:"state",get:function(){return{value:this.value,from:this.from,stop:this.stop}},set:function(t){Bt(this,t)}}]),t}(),Zt=function(){function t(e){Ft(this,t),this._value="",this._update(e),this.isInitialized=!0}return bt(t,[{key:"updateOptions",value:function(t){Object.keys(t).length&&this.withValueRefresh(this._update.bind(this,t))}},{key:"_update",value:function(t){Bt(this,t)}},{key:"reset",value:function(){this._value=""}},{key:"resolve",value:function(t){return this.reset(),this.append(t,{input:!0},""),this.doCommit(),this.value}},{key:"nearestInputPos",value:function(t,e){return t}},{key:"extractInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return this.value.slice(t,e)}},{key:"extractTail",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return new Yt(this.extractInput(t,e),t)}},{key:"_storeBeforeTailState",value:function(){this._beforeTailState=this.state}},{key:"_restoreBeforeTailState",value:function(){this.state=this._beforeTailState}},{key:"_resetBeforeTailState",value:function(){this._beforeTailState=null}},{key:"appendTail",value:function(t){return Nt(t)&&(t=new Yt(String(t))),t.appendTo(this)}},{key:"_appendCharRaw",value:function(t){return this._value+=t,new Ut({inserted:t,rawInserted:t})}},{key:"_appendChar",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;if(!(t=this.doPrepare(t,e)))return new Ut({skip:!0});var u,i=this.state,r=this._appendCharRaw(t,e);if(r.inserted){var a=!1!==this.doValidate(e);if(a&&null!=n){this._storeBeforeTailState(),this.overwrite&&(u=n.state,n.shiftBefore(this.value.length));var s=this.appendTail(n);(a=s.rawInserted===n.toString())&&s.inserted&&this._restoreBeforeTailState()}a||(r.rawInserted=r.inserted="",this.state=i,n&&u&&(n.state=u))}return r}},{key:"append",value:function(t,e,n){if(!Nt(t))throw new Error("value should be string");for(var u=new Ut,i=Nt(n)?new Yt(String(n)):n,r=0;r0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return this._value=this.value.slice(0,t)+this.value.slice(e),new Ut}},{key:"withValueRefresh",value:function(t){if(this._refreshing||!this.isInitialized)return t();this._refreshing=!0;var e=this.unmaskedValue,n=this.value,u=t();return this.resolve(n)!==n&&(this.unmaskedValue=e),delete this._refreshing,u}},{key:"doPrepare",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.prepare?this.prepare(t,this,e):t}},{key:"doValidate",value:function(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}},{key:"doCommit",value:function(){this.commit&&this.commit(this.value,this)}},{key:"splice",value:function(t,e,n,u){var i=t+e,r=this.extractTail(i),a=this.nearestInputPos(t,u);return new Ut({tailShift:a-t}).aggregate(this.remove(a)).aggregate(this.append(n,{input:!0},r))}},{key:"state",get:function(){return{_value:this.value}},set:function(t){this._value=t._value}},{key:"value",get:function(){return this._value},set:function(t){this.resolve(t)}},{key:"unmaskedValue",get:function(){return this.value},set:function(t){this.reset(),this.append(t,{},""),this.doCommit()}},{key:"typedValue",get:function(){return this.unmaskedValue},set:function(t){this.unmaskedValue=t}},{key:"rawInputValue",get:function(){return this.extractInput(0,this.value.length,{raw:!0})},set:function(t){this.reset(),this.append(t,{raw:!0},""),this.doCommit()}},{key:"isComplete",get:function(){return!0}}]),t}();function Wt(t){if(null==t)throw new Error("mask property should be defined");return t instanceof RegExp?Gt.IMask.MaskedRegExp:Nt(t)?Gt.IMask.MaskedPattern:t instanceof Date||t===Date?Gt.IMask.MaskedDate:t instanceof Number||"number"==typeof t||t===Number?Gt.IMask.MaskedNumber:Array.isArray(t)||t===Array?Gt.IMask.MaskedDynamic:t.prototype instanceof Gt.IMask.Masked?t:t instanceof Function?Gt.IMask.MaskedFunction:(console.warn("Mask not found for mask",t),Gt.IMask.Masked)}function $t(t){var e=(t=Dt({},t)).mask;return e instanceof Gt.IMask.Masked?e:new(Wt(e))(t)}var Kt={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./},qt=function(){function t(e){Ft(this,t);var n=e.mask,u=Pt(e,["mask"]);this.masked=$t({mask:n}),Bt(this,u)}return bt(t,[{key:"reset",value:function(){this._isFilled=!1,this.masked.reset()}},{key:"remove",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return 0===t&&e>=1?(this._isFilled=!1,this.masked.remove(t,e)):new Ut}},{key:"_appendChar",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._isFilled)return new Ut;var n=this.masked.state,u=this.masked._appendChar(t,e);return u.inserted&&!1===this.doValidate(e)&&(u.inserted=u.rawInserted="",this.masked.state=n),u.inserted||this.isOptional||this.lazy||e.input||(u.inserted=this.placeholderChar),u.skip=!u.inserted&&!this.isOptional,this._isFilled=Boolean(u.inserted),u}},{key:"append",value:function(){var t;return(t=this.masked).append.apply(t,arguments)}},{key:"_appendPlaceholder",value:function(){var t=new Ut;return this._isFilled||this.isOptional?t:(this._isFilled=!0,t.inserted=this.placeholderChar,t)}},{key:"extractTail",value:function(){var t;return(t=this.masked).extractTail.apply(t,arguments)}},{key:"appendTail",value:function(){var t;return(t=this.masked).appendTail.apply(t,arguments)}},{key:"extractInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=arguments.length>2?arguments[2]:void 0;return this.masked.extractInput(t,e,n)}},{key:"nearestInputPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Lt.NONE,n=this.value.length,u=Math.min(Math.max(t,0),n);switch(e){case Lt.LEFT:case Lt.FORCE_LEFT:return this.isComplete?u:0;case Lt.RIGHT:case Lt.FORCE_RIGHT:return this.isComplete?u:n;case Lt.NONE:default:return u}}},{key:"doValidate",value:function(){var t,e;return(t=this.masked).doValidate.apply(t,arguments)&&(!this.parent||(e=this.parent).doValidate.apply(e,arguments))}},{key:"doCommit",value:function(){this.masked.doCommit()}},{key:"value",get:function(){return this.masked.value||(this._isFilled&&!this.isOptional?this.placeholderChar:"")}},{key:"unmaskedValue",get:function(){return this.masked.unmaskedValue}},{key:"isComplete",get:function(){return Boolean(this.masked.value)||this.isOptional}},{key:"state",get:function(){return{masked:this.masked.state,_isFilled:this._isFilled}},set:function(t){this.masked.state=t.masked,this._isFilled=t._isFilled}}]),t}(),Jt=function(){function t(e){Ft(this,t),Bt(this,e),this._value=""}return bt(t,[{key:"reset",value:function(){this._isRawInput=!1,this._value=""}},{key:"remove",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._value.length;return this._value=this._value.slice(0,t)+this._value.slice(e),this._value||(this._isRawInput=!1),new Ut}},{key:"nearestInputPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Lt.NONE,n=this._value.length;switch(e){case Lt.LEFT:case Lt.FORCE_LEFT:return 0;case Lt.NONE:case Lt.RIGHT:case Lt.FORCE_RIGHT:default:return n}}},{key:"extractInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._value.length;return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).raw&&this._isRawInput&&this._value.slice(t,e)||""}},{key:"_appendChar",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new Ut;if(this._value)return n;var u=this.char===t[0]&&(this.isUnmasking||e.input||e.raw)&&!e.tail;return u&&(n.rawInserted=this.char),this._value=n.inserted=this.char,this._isRawInput=u&&(e.raw||e.input),n}},{key:"_appendPlaceholder",value:function(){var t=new Ut;return this._value?t:(this._value=t.inserted=this.char,t)}},{key:"extractTail",value:function(){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return new Yt("")}},{key:"appendTail",value:function(t){return Nt(t)&&(t=new Yt(String(t))),t.appendTo(this)}},{key:"append",value:function(t,e,n){var u=this._appendChar(t,e);return null!=n&&(u.tailShift+=this.appendTail(n).tailShift),u}},{key:"doCommit",value:function(){}},{key:"value",get:function(){return this._value}},{key:"unmaskedValue",get:function(){return this.isUnmasking?this.value:""}},{key:"isComplete",get:function(){return!0}},{key:"state",get:function(){return{_value:this._value,_isRawInput:this._isRawInput}},set:function(t){Bt(this,t)}}]),t}(),Qt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Ft(this,t),this.chunks=e,this.from=n}return bt(t,[{key:"toString",value:function(){return this.chunks.map(String).join("")}},{key:"extend",value:function(e){if(String(e)){Nt(e)&&(e=new Yt(String(e)));var n=this.chunks[this.chunks.length-1],u=n&&(n.stop===e.stop||null==e.stop)&&e.from===n.from+n.toString().length;if(e instanceof Yt)u?n.extend(e.toString()):this.chunks.push(e);else if(e instanceof t){if(null==e.stop)for(var i;e.chunks.length&&null==e.chunks[0].stop;)(i=e.chunks.shift()).from+=e.from,this.extend(i);e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}}},{key:"appendTo",value:function(e){if(!(e instanceof Gt.IMask.MaskedPattern))return new Yt(this.toString()).appendTo(e);for(var n=new Ut,u=0;u=0)&&n.aggregate(e._appendPlaceholder(a)),s=i instanceof t&&e._blocks[a]),s){var o=s.appendTail(i);o.skip=!1,n.aggregate(o),e._value+=o.inserted;var l=i.toString().slice(o.rawInserted.length);l&&n.aggregate(e.append(l,{tail:!0}))}else n.aggregate(e.append(i.toString(),{tail:!0}))}return n}},{key:"shiftBefore",value:function(t){if(this.from>=t||!this.chunks.length)return"";for(var e=t-this.from,n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return Ft(this,e),t.definitions=Bt({},Kt,t.definitions),Mt(this,Tt(e).call(this,Dt({},e.DEFAULTS,t)))}return wt(e,Zt),bt(e,[{key:"_update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.definitions=Bt({},this.definitions,t.definitions),It(Tt(e.prototype),"_update",this).call(this,t),this._rebuildMask()}},{key:"_rebuildMask",value:function(){var t=this,n=this.definitions;this._blocks=[],this._stops=[],this._maskedBlocks={};var u=this.mask;if(u&&n)for(var i=!1,r=!1,a=0;a1&&void 0!==arguments[1]?arguments[1]:{},n=this._mapPosToBlock(this.value.length),u=new Ut;if(!n)return u;for(var i=n.index;;++i){var r=this._blocks[i];if(!r)break;var a=r._appendChar(t,e),s=a.skip;if(u.aggregate(a),s||a.rawInserted)break}return u}},{key:"extractTail",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,u=new Qt;return e===n?u:(this._forEachBlocksInRange(e,n,function(e,n,i,r){var a=e.extractTail(i,r);a.stop=t._findStopBefore(n),a.from=t._blockStartPos(n),a instanceof Qt&&(a.blockIndex=n),u.extend(a)}),u)}},{key:"extractInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t===e)return"";var u="";return this._forEachBlocksInRange(t,e,function(t,e,i,r){u+=t.extractInput(i,r,n)}),u}},{key:"_findStopBefore",value:function(t){for(var e,n=0;n1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=arguments.length>2?arguments[2]:void 0,u=this._mapPosToBlock(t);if(u){var i=this._mapPosToBlock(e),r=i&&u.index===i.index,a=u.offset,s=i&&r?i.offset:this._blocks[u.index].value.length;if(n(this._blocks[u.index],u.index,a,s),i&&!r){for(var o=u.index+1;o0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,u=It(Tt(e.prototype),"remove",this).call(this,t,n);return this._forEachBlocksInRange(t,n,function(t,e,n,i){u.aggregate(t.remove(n,i))}),u}},{key:"nearestInputPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Lt.NONE,n=this._mapPosToBlock(t)||{index:0,offset:0},u=n.offset,i=n.index,r=this._blocks[i];if(!r)return t;var a=u;0!==a&&a0){var l=o-1,h=this._blocks[l],c=h.nearestInputPos(0,Lt.NONE);if(!h.value.length||c!==h.value.length)return this._blockStartPos(o)}for(var f=o;f=0;--A){var C=this._blocks[A],F=C.nearestInputPos(C.value.length,Lt.FORCE_LEFT);if(null!=m||C.value&&0===F||(m=A),0!==F){if(F!==C.value.length)return this._blockStartPos(A)+F;_=A;break}}if(e===Lt.LEFT)for(var E=_+1;E<=Math.min(o,this._blocks.length-1);++E){var b=this._blocks[E],S=b.nearestInputPos(0,Lt.NONE),B=this._blockStartPos(E)+S;if((!b.value.length&&B===this.value.length||S!==b.value.length)&&B<=t)return B}if(_>=0)return this._blockStartPos(_)+this._blocks[_].value.length;if(e===Lt.FORCE_LEFT||this.lazy&&!this.extractInput()&&!function(t){if(!t)return!1;var e=t.value;return!e||t.nearestInputPos(0,Lt.NONE)!==e.length}(this._blocks[o]))return 0;if(null!=m)return this._blockStartPos(m);for(var D=o;D=0;--N){var L=this._blocks[N],H=L.nearestInputPos(L.value.length,Lt.LEFT);if(0!==H){var G=this._blockStartPos(N)+H;if(G>=t)return G;break}}}return t}},{key:"maskedBlock",value:function(t){return this.maskedBlocks(t)[0]}},{key:"maskedBlocks",value:function(t){var e=this,n=this._maskedBlocks[t];return n?n.map(function(t){return e._blocks[t]}):[]}},{key:"state",get:function(){return Dt({},It(Tt(e.prototype),"state",this),{_blocks:this._blocks.map(function(t){return t.state})})},set:function(t){var n=t._blocks,u=Pt(t,["_blocks"]);this._blocks.forEach(function(t,e){return t.state=n[e]}),Vt(Tt(e.prototype),"state",u,this,!0)}},{key:"isComplete",get:function(){return this._blocks.every(function(t){return t.isComplete})}},{key:"unmaskedValue",get:function(){return this._blocks.reduce(function(t,e){return t+e.unmaskedValue},"")},set:function(t){Vt(Tt(e.prototype),"unmaskedValue",t,this,!0)}},{key:"value",get:function(){return this._blocks.reduce(function(t,e){return t+e.value},"")},set:function(t){Vt(Tt(e.prototype),"value",t,this,!0)}}]),e}();Xt.DEFAULTS={lazy:!0,placeholderChar:"_"},Xt.STOP_CHAR="`",Xt.ESCAPE_CHAR="\\",Xt.InputDefinition=qt,Xt.FixedDefinition=Jt;var te=function(t){function e(){return Ft(this,e),Mt(this,Tt(e).apply(this,arguments))}return wt(e,Xt),bt(e,[{key:"_update",value:function(t){t=Dt({to:this.to||0,from:this.from||0},t);var n=String(t.to).length;null!=t.maxLength&&(n=Math.max(n,t.maxLength)),t.maxLength=n;for(var u=String(t.from).padStart(n,"0"),i=String(t.to).padStart(n,"0"),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};if(t=It(Tt(e.prototype),"doPrepare",this).call(this,t,n).replace(/\D/g,""),!this.autofix)return t;for(var u=String(this.from).padStart(this.maxLength,"0"),i=String(this.to).padStart(this.maxLength,"0"),r=this.value,a="",s=0;sthis.to?a+=i[o.length-1]:a+=t[s]}return a}},{key:"doValidate",value:function(){var t,n=this.value;if(-1===n.search(/[^0]/)&&n.length<=this._matchFrom)return!0;for(var u=jt(this.boundaries(n),2),i=u[0],r=u[1],a=arguments.length,s=new Array(a),o=0;o=0&&this._listeners[t].splice(n,1),this}},{key:"_onInput",value:function(){if(this._abortUpdateCursor(),!this._selection)return this.updateValue();var t=new zt(this.el.value,this.cursorPos,this.value,this._selection),e=this.masked.rawInputValue,n=this.masked.splice(t.startChangePos,t.removed.length,t.inserted,t.removeDirection).offset,u=e===this.masked.rawInputValue?t.removeDirection:Lt.NONE,i=this.masked.nearestInputPos(t.startChangePos+n,u);this.updateControl(),this.updateCursor(i)}},{key:"_onChange",value:function(){this.value!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}},{key:"_onDrop",value:function(t){t.preventDefault(),t.stopPropagation()}},{key:"_onFocus",value:function(t){this.selectionStart===this.cursorPos&&(this._selection&&(this.cursorPos=this._selection.end),this.alignCursorFriendly())}},{key:"destroy",value:function(){this._unbindEvents(),this._listeners.length=0,delete this.el}},{key:"mask",get:function(){return this.masked.mask},set:function(t){if(!(null==t||t===this.masked.mask||t===Date&&this.masked instanceof ee))if(this.masked.constructor!==Wt(t)){var e=$t({mask:t});e.unmaskedValue=this.masked.unmaskedValue,this.masked=e}else this.masked.updateOptions({mask:t})}},{key:"value",get:function(){return this._value},set:function(t){this.masked.value=t,this.updateControl(),this.alignCursor()}},{key:"unmaskedValue",get:function(){return this._unmaskedValue},set:function(t){this.masked.unmaskedValue=t,this.updateControl(),this.alignCursor()}},{key:"typedValue",get:function(){return this.masked.typedValue},set:function(t){this.masked.typedValue=t,this.updateControl(),this.alignCursor()}},{key:"selectionStart",get:function(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}},{key:"cursorPos",get:function(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd},set:function(t){this.el.isActive&&(this.el.select(t,t),this._saveSelection())}}]),t}(),re=function(t){function e(){return Ft(this,e),Mt(this,Tt(e).apply(this,arguments))}return wt(e,Xt),bt(e,[{key:"_update",value:function(t){t.enum&&(t.mask="*".repeat(t.enum[0].length)),It(Tt(e.prototype),"_update",this).call(this,t)}},{key:"doValidate",value:function(){for(var t,n=this,u=arguments.length,i=new Array(u),r=0;r=0})&&(t=It(Tt(e.prototype),"doValidate",this)).call.apply(t,[this].concat(i))}}]),e}(),ae=function(t){function e(t){return Ft(this,e),Mt(this,Tt(e).call(this,Dt({},e.DEFAULTS,t)))}return wt(e,Zt),bt(e,[{key:"_update",value:function(t){It(Tt(e.prototype),"_update",this).call(this,t),this._updateRegExps()}},{key:"_updateRegExps",value:function(){var t="^"+(this.allowNegative?"[+|\\-]?":""),e=(this.scale?"("+Ht(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExpInput=new RegExp(t+"(0|([1-9]+\\d*))?"+e),this._numberRegExp=new RegExp(t+"\\d*"+e),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(Ht).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(Ht(this.thousandsSeparator),"g")}},{key:"_removeThousandsSeparators",value:function(t){return t.replace(this._thousandsSeparatorRegExp,"")}},{key:"_insertThousandsSeparators",value:function(t){var e=t.split(this.radix);return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),e.join(this.radix)}},{key:"doPrepare",value:function(t){for(var n,u=arguments.length,i=new Array(u>1?u-1:0),r=1;r1&&void 0!==arguments[1]&&arguments[1],n=0,u=0;u0&&void 0!==arguments[0]?arguments[0]:this._value;return this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}},{key:"extractInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,u=arguments.length>2?arguments[2]:void 0,i=jt(this._adjustRangeWithSeparators(t,n),2);return t=i[0],n=i[1],this._removeThousandsSeparators(It(Tt(e.prototype),"extractInput",this).call(this,t,n,u))}},{key:"_appendCharRaw",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.thousandsSeparator)return It(Tt(e.prototype),"_appendCharRaw",this).call(this,t,n);var u=this._separatorsCountFromSlice(n.tail&&this._beforeTailState?this._beforeTailState._value:this._value);this._value=this._removeThousandsSeparators(this.value);var i=It(Tt(e.prototype),"_appendCharRaw",this).call(this,t,n);this._value=this._insertThousandsSeparators(this._value);var r=this._separatorsCountFromSlice(n.tail&&this._beforeTailState?this._beforeTailState._value:this._value);return i.tailShift+=(r-u)*this.thousandsSeparator.length,i}},{key:"_findSeparatorAround",value:function(t){if(this.thousandsSeparator){var e=t-this.thousandsSeparator.length+1,n=this.value.indexOf(this.thousandsSeparator,e);if(n<=t)return n}return-1}},{key:"_adjustRangeWithSeparators",value:function(t,e){var n=this._findSeparatorAround(t);n>=0&&(t=n);var u=this._findSeparatorAround(e);return u>=0&&(e=u+this.thousandsSeparator.length),[t,e]}},{key:"remove",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=jt(this._adjustRangeWithSeparators(t,e),2);t=n[0],e=n[1];var u=this.value.slice(0,t),i=this.value.slice(e),r=this._separatorsCount(u.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(u+i));var a=this._separatorsCountFromSlice(u);return new Ut({tailShift:(a-r)*this.thousandsSeparator.length})}},{key:"nearestInputPos",value:function(t,e){if(!this.thousandsSeparator)return t;switch(e){case Lt.NONE:case Lt.LEFT:case Lt.FORCE_LEFT:var n=this._findSeparatorAround(t-1);if(n>=0){var u=n+this.thousandsSeparator.length;if(t=0)return i+this.thousandsSeparator.length}return t}},{key:"doValidate",value:function(t){var n=(t.input?this._numberRegExpInput:this._numberRegExp).test(this._removeThousandsSeparators(this.value));if(n){var u=this.number;n=n&&!isNaN(u)&&(null==this.min||this.min>=0||this.min<=this.number)&&(null==this.max||this.max<=0||this.number<=this.max)}return n&&It(Tt(e.prototype),"doValidate",this).call(this,t)}},{key:"doCommit",value:function(){if(this.value){var t=this.number,n=t;null!=this.min&&(n=Math.max(n,this.min)),null!=this.max&&(n=Math.min(n,this.max)),n!==t&&(this.unmaskedValue=String(n));var u=this.value;this.normalizeZeros&&(u=this._normalizeZeros(u)),this.padFractionalZeros&&(u=this._padFractionalZeros(u)),this._value=u}It(Tt(e.prototype),"doCommit",this).call(this)}},{key:"_normalizeZeros",value:function(t){var e=this._removeThousandsSeparators(t).split(this.radix);return e[0]=e[0].replace(/^(\D*)(0*)(\d*)/,function(t,e,n,u){return e+u}),t.length&&!/\d$/.test(e[0])&&(e[0]=e[0]+"0"),e.length>1&&(e[1]=e[1].replace(/0*$/,""),e[1].length||(e.length=1)),this._insertThousandsSeparators(e.join(this.radix))}},{key:"_padFractionalZeros",value:function(t){if(!t)return t;var e=t.split(this.radix);return e.length<2&&e.push(""),e[1]=e[1].padEnd(this.scale,"0"),e.join(this.radix)}},{key:"unmaskedValue",get:function(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,".")},set:function(t){Vt(Tt(e.prototype),"unmaskedValue",t.replace(".",this.radix),this,!0)}},{key:"number",get:function(){return Number(this.unmaskedValue)},set:function(t){this.unmaskedValue=String(t)}},{key:"typedValue",get:function(){return this.number},set:function(t){this.number=t}},{key:"allowNegative",get:function(){return this.signed||null!=this.min&&this.min<0||null!=this.max&&this.max<0}}]),e}();ae.DEFAULTS={radix:",",thousandsSeparator:"",mapToRadix:["."],scale:2,signed:!1,normalizeZeros:!0,padFractionalZeros:!1};var se=function(t){function e(){return Ft(this,e),Mt(this,Tt(e).apply(this,arguments))}return wt(e,Zt),bt(e,[{key:"_update",value:function(t){t.mask&&(t.validate=function(e){return e.search(t.mask)>=0}),It(Tt(e.prototype),"_update",this).call(this,t)}}]),e}(),oe=function(t){function e(){return Ft(this,e),Mt(this,Tt(e).apply(this,arguments))}return wt(e,Zt),bt(e,[{key:"_update",value:function(t){t.mask&&(t.validate=t.mask),It(Tt(e.prototype),"_update",this).call(this,t)}}]),e}(),le=function(t){function e(t){var n;return Ft(this,e),(n=Mt(this,Tt(e).call(this,Dt({},e.DEFAULTS,t)))).currentMask=null,n}return wt(e,Zt),bt(e,[{key:"_update",value:function(t){It(Tt(e.prototype),"_update",this).call(this,t),"mask"in t&&(this.compiledMasks=Array.isArray(t.mask)?t.mask.map(function(t){return $t(t)}):[])}},{key:"_appendCharRaw",value:function(){var t,e=this._applyDispatch.apply(this,arguments);this.currentMask&&e.aggregate((t=this.currentMask)._appendChar.apply(t,arguments));return e}},{key:"_applyDispatch",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.tail&&this._beforeTailState?this._beforeTailState._value:this.value,u=this.rawInputValue,i=e.tail&&this._beforeTailState?this._beforeTailState._rawInputValue:u,r=u.slice(i.length),a=this.currentMask,s=new Ut,o=a&&a.state,l=a&&a._beforeTailState;if(this.currentMask=this.doDispatch(t,e),this.currentMask)if(this.currentMask!==a){this.currentMask.reset();var h=this.currentMask.append(i,{raw:!0});s.tailShift=h.inserted.length-n.length,r&&(s.tailShift+=this.currentMask.append(r,{raw:!0,tail:!0}).tailShift)}else this.currentMask.state=o,this.currentMask._beforeTailState=l;return s}},{key:"doDispatch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.dispatch(t,this,e)}},{key:"doValidate",value:function(){for(var t,n,u=arguments.length,i=new Array(u),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};return new ie(t,e)}return le.DEFAULTS={dispatch:function(t,e,n){if(e.compiledMasks.length){var u=e.rawInputValue,i=e.compiledMasks.map(function(e,i){return e.rawInputValue=u,e.append(t,n),{weight:e.rawInputValue.length,index:i}});return i.sort(function(t,e){return e.weight-t.weight}),e.compiledMasks[i[0].index]}}},he.InputMask=ie,he.Masked=Zt,he.MaskedPattern=Xt,he.MaskedEnum=re,he.MaskedRange=te,he.MaskedNumber=ae,he.MaskedDate=ee,he.MaskedRegExp=se,he.MaskedFunction=oe,he.MaskedDynamic=le,he.createMask=$t,he.MaskElement=ne,he.HTMLMaskElement=ue,Gt.IMask=he,he}); +//# sourceMappingURL=imask.min.js.map diff --git a/static/libs/imask/imask.min.js.map b/static/libs/imask/imask.min.js.map new file mode 100644 index 0000000000000000000000000000000000000000..8481f5144af3d25b3075df2f3d105ab891e01d8e Binary files /dev/null and b/static/libs/imask/imask.min.js.map differ