@arthurzakharov/ui-kit 1.3.9 → 1.4.0
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/_commonjsHelpers-CqEciG1_.js +31 -0
- package/dist/animations/animation-fade-grow/animation-fade-grow.component.d.ts +2 -0
- package/dist/animations/animation-fade-grow/animation-fade-grow.component.js +34 -0
- package/dist/animations/animation-fade-grow/index.d.ts +1 -0
- package/dist/animations/animation-fade-grow/index.js +4 -0
- package/dist/animations/animation-fade-scale/animation-fade-scale.component.d.ts +2 -0
- package/dist/animations/animation-fade-scale/animation-fade-scale.component.js +33 -0
- package/dist/animations/animation-fade-scale/index.d.ts +1 -0
- package/dist/animations/animation-fade-scale/index.js +4 -0
- package/dist/animations/animation-fade-slide/animation-fade-slide.component.d.ts +6 -0
- package/dist/animations/animation-fade-slide/animation-fade-slide.component.js +33 -0
- package/dist/animations/animation-fade-slide/index.d.ts +1 -0
- package/dist/animations/animation-fade-slide/index.js +4 -0
- package/dist/animations/animation-rotate/animation-rotate.component.d.ts +8 -0
- package/dist/animations/animation-rotate/animation-rotate.component.js +38 -0
- package/dist/animations/animation-rotate/index.d.ts +1 -0
- package/dist/animations/animation-rotate/index.js +4 -0
- package/dist/animations/hook/index.d.ts +1 -0
- package/dist/animations/hook/index.js +4 -0
- package/dist/animations/hook/use-animation-lifecycle/index.d.ts +1 -0
- package/dist/animations/hook/use-animation-lifecycle/index.js +4 -0
- package/dist/animations/hook/use-animation-lifecycle/use-animation-lifecycle.hook.d.ts +12 -0
- package/dist/animations/hook/use-animation-lifecycle/use-animation-lifecycle.hook.js +31 -0
- package/dist/animations/utils/default-props.d.ts +5 -0
- package/dist/animations/utils/default-props.js +17 -0
- package/dist/animations/utils/index.d.ts +2 -0
- package/dist/animations/utils/index.js +4 -0
- package/dist/animations/utils/types.d.ts +15 -0
- package/dist/animations/utils/types.js +1 -0
- package/dist/assets/control-box-Dx-QKPgf.css +1 -0
- package/dist/assets/control-button-Tzg6F5Dp.css +1 -0
- package/dist/assets/control-button-card-Cb8_vJbQ.css +1 -0
- package/dist/assets/control-button-radio-BodzD0rU.css +1 -0
- package/dist/assets/control-button-text-BbE_5ebO.css +1 -0
- package/dist/assets/control-card-image-BYT3bzTE.css +1 -0
- package/dist/assets/control-card-text-Cvv3bL2p.css +1 -0
- package/dist/assets/control-checkbox-uLtXjmYN.css +1 -0
- package/dist/assets/control-choice-BAHN-VTm.css +1 -0
- package/dist/assets/control-dropdown-DaS5KsvG.css +1 -0
- package/dist/assets/control-error-message-CKgqmo1U.css +1 -0
- package/dist/assets/control-hidden-input-BhMdNmnP.css +1 -0
- package/dist/assets/control-input-nR0XQHHp.css +1 -0
- package/dist/assets/control-label-C8pjaWEU.css +1 -0
- package/dist/assets/control-radio-Bo1rvcg2.css +1 -0
- package/dist/assets/control-radio-label-CgZ-FNj0.css +1 -0
- package/dist/assets/control-radio-text-S7MEO4a2.css +1 -0
- package/dist/assets/control-status-DPNvkGlM.css +1 -0
- package/dist/assets/control-text-n-qi7e2Y.css +1 -0
- package/dist/assets/control-textarea-B6gWlJs3.css +1 -0
- package/dist/assets/data-protected-label-BN19_NZF.css +1 -0
- package/dist/assets/dialog-article-WnyHZI47.css +1 -0
- package/dist/assets/expenses-AU5q4idk.css +1 -0
- package/dist/assets/loader-DadlBlOF.css +1 -0
- package/dist/assets/main-DlyWXITA.css +1 -0
- package/dist/assets/message-block-DG1cePyB.css +1 -0
- package/dist/components/accordion-table/accordion-table.component.d.ts +9 -7
- package/dist/components/accordion-table/accordion-table.component.js +44 -41
- package/dist/components/bottom-bar/bottom-bar.component.js +2 -2
- package/dist/components/certifications/certifications.component.d.ts +6 -3
- package/dist/components/certifications/certifications.component.js +54 -46
- package/dist/components/data-protected-label/data-protected-label.component.d.ts +8 -3
- package/dist/components/data-protected-label/data-protected-label.component.js +31 -28
- package/dist/components/data-protected-label/index.d.ts +1 -0
- package/dist/components/data-protected-label/index.js +4 -0
- package/dist/components/dialog-article/dialog-article.component.d.ts +9 -3
- package/dist/components/dialog-article/dialog-article.component.js +51 -21
- package/dist/components/dialog-article/index.d.ts +1 -0
- package/dist/components/dialog-article/index.js +4 -0
- package/dist/components/expenses/expenses.component.d.ts +12 -7
- package/dist/components/expenses/expenses.component.js +26 -20
- package/dist/components/expenses/index.d.ts +1 -0
- package/dist/components/expenses/index.js +4 -0
- package/dist/components/flex/flex.component.d.ts +158 -158
- package/dist/components/footer/footer.component.d.ts +6 -3
- package/dist/components/footer/footer.component.js +39 -31
- package/dist/components/footer/index.d.ts +1 -1
- package/dist/components/info-panel/info-panel.component.d.ts +6 -3
- package/dist/components/info-panel/info-panel.component.js +20 -12
- package/dist/components/information/index.d.ts +1 -1
- package/dist/components/information/information.component.d.ts +5 -4
- package/dist/components/information/information.component.js +21 -12
- package/dist/components/loader/index.d.ts +1 -1
- package/dist/components/loader/loader.component.d.ts +9 -5
- package/dist/components/loader/loader.component.js +42 -55
- package/dist/components/loader/loader.utils.d.ts +2 -0
- package/dist/components/loader/loader.utils.js +13 -0
- package/dist/components/main-attachment/main-attachment.component.js +2 -2
- package/dist/components/message/index.d.ts +1 -1
- package/dist/components/message/message.component.d.ts +6 -3
- package/dist/components/message/message.component.js +23 -22
- package/dist/components/message-block/index.d.ts +1 -0
- package/dist/components/message-block/index.js +4 -0
- package/dist/components/message-block/message-block.component.d.ts +7 -2
- package/dist/components/message-block/message-block.component.js +36 -18
- package/dist/components/not-found/not-found.component.d.ts +6 -3
- package/dist/components/not-found/not-found.component.js +35 -27
- package/dist/components/payment/components/glass/glass.component.js +1 -1
- package/dist/components/sidebar/components/step/step.component.d.ts +1 -1
- package/dist/components/sidebar/components/step/step.component.js +6 -6
- package/dist/components/sidebar/sidebar.component.d.ts +1 -1
- package/dist/components/sidebar/sidebar.component.js +9 -9
- package/dist/components/signature/index.d.ts +1 -1
- package/dist/components/signature/signature.component.d.ts +2 -2
- package/dist/components/signature/signature.component.js +255 -263
- package/dist/components/text/components/tag/tag.component.d.ts +316 -316
- package/dist/components/text/text.component.d.ts +316 -316
- package/dist/components/user-panel/user-panel.component.d.ts +6 -3
- package/dist/components/user-panel/user-panel.component.js +35 -27
- package/dist/components/warranty/warranty.component.d.ts +6 -3
- package/dist/components/warranty/warranty.component.js +26 -19
- package/dist/controls/control-box/control-box.component.d.ts +15 -0
- package/dist/controls/control-box/control-box.component.js +33 -0
- package/dist/controls/control-box/index.d.ts +2 -0
- package/dist/controls/control-box/index.js +4 -0
- package/dist/controls/control-button/control-button.component.d.ts +18 -0
- package/dist/controls/control-button/control-button.component.js +84 -0
- package/dist/controls/control-button/index.d.ts +2 -0
- package/dist/controls/control-button/index.js +4 -0
- package/dist/{components/control/components/button-card/button-card.component.d.ts → controls/control-button-card/control-button-card.component.d.ts} +4 -3
- package/dist/controls/control-button-card/control-button-card.component.js +65 -0
- package/dist/controls/control-button-card/index.d.ts +2 -0
- package/dist/controls/control-button-card/index.js +4 -0
- package/dist/controls/control-button-radio/control-button-radio.component.d.ts +19 -0
- package/dist/controls/control-button-radio/control-button-radio.component.js +69 -0
- package/dist/controls/control-button-radio/index.d.ts +2 -0
- package/dist/controls/control-button-radio/index.js +4 -0
- package/dist/controls/control-button-text/control-button-text.component.d.ts +20 -0
- package/dist/controls/control-button-text/control-button-text.component.js +87 -0
- package/dist/controls/control-button-text/index.d.ts +2 -0
- package/dist/controls/control-button-text/index.js +4 -0
- package/dist/controls/control-card-image/control-card-image.component.d.ts +8 -0
- package/dist/controls/control-card-image/control-card-image.component.js +53 -0
- package/dist/controls/control-card-image/index.d.ts +2 -0
- package/dist/controls/control-card-image/index.js +4 -0
- package/dist/controls/control-card-text/control-card-text.component.d.ts +7 -0
- package/dist/controls/control-card-text/control-card-text.component.js +48 -0
- package/dist/controls/control-card-text/index.d.ts +2 -0
- package/dist/controls/control-card-text/index.js +4 -0
- package/dist/controls/control-checkbox/control-checkbox.component.d.ts +11 -0
- package/dist/controls/control-checkbox/control-checkbox.component.js +96 -0
- package/dist/controls/control-checkbox/index.d.ts +2 -0
- package/dist/controls/control-checkbox/index.js +4 -0
- package/dist/controls/control-choice/control-choice.component.d.ts +12 -0
- package/dist/controls/control-choice/control-choice.component.js +64 -0
- package/dist/controls/control-choice/index.d.ts +2 -0
- package/dist/controls/control-choice/index.js +4 -0
- package/dist/{components/control/components/dropdown/dropdown.component.d.ts → controls/control-dropdown/control-dropdown.component.d.ts} +4 -3
- package/dist/controls/control-dropdown/control-dropdown.component.js +106 -0
- package/dist/controls/control-dropdown/index.d.ts +2 -0
- package/dist/controls/control-dropdown/index.js +4 -0
- package/dist/controls/control-error-message/control-error-message.component.d.ts +7 -0
- package/dist/controls/control-error-message/control-error-message.component.js +16 -0
- package/dist/controls/control-error-message/index.d.ts +1 -0
- package/dist/controls/control-error-message/index.js +4 -0
- package/dist/controls/control-hidden-input/control-hidden-input.component.d.ts +15 -0
- package/dist/controls/control-hidden-input/control-hidden-input.component.js +41 -0
- package/dist/controls/control-hidden-input/index.d.ts +2 -0
- package/dist/controls/control-hidden-input/index.js +4 -0
- package/dist/controls/control-input/control-input.component.d.ts +11 -0
- package/dist/controls/control-input/control-input.component.js +973 -0
- package/dist/controls/control-input/index.d.ts +2 -0
- package/dist/controls/control-input/index.js +4 -0
- package/dist/controls/control-label/control-label.component.d.ts +13 -0
- package/dist/controls/control-label/control-label.component.js +30 -0
- package/dist/controls/control-label/index.d.ts +1 -0
- package/dist/controls/control-label/index.js +4 -0
- package/dist/controls/control-radio/control-radio.component.d.ts +14 -0
- package/dist/controls/control-radio/control-radio.component.js +79 -0
- package/dist/controls/control-radio/index.d.ts +2 -0
- package/dist/controls/control-radio/index.js +4 -0
- package/dist/controls/control-radio-label/control-radio-label.component.d.ts +22 -0
- package/dist/controls/control-radio-label/control-radio-label.component.js +39 -0
- package/dist/controls/control-radio-label/index.d.ts +1 -0
- package/dist/controls/control-radio-label/index.js +4 -0
- package/dist/controls/control-radio-text/control-radio-text.component.d.ts +10 -0
- package/dist/controls/control-radio-text/control-radio-text.component.js +45 -0
- package/dist/controls/control-radio-text/index.d.ts +2 -0
- package/dist/controls/control-radio-text/index.js +4 -0
- package/dist/controls/control-status/control-status.component.d.ts +11 -0
- package/dist/controls/control-status/control-status.component.js +42 -0
- package/dist/controls/control-status/index.d.ts +1 -0
- package/dist/controls/control-status/index.js +4 -0
- package/dist/controls/control-text/control-text.component.d.ts +11 -0
- package/dist/controls/control-text/control-text.component.js +70 -0
- package/dist/controls/control-text/index.d.ts +2 -0
- package/dist/controls/control-text/index.js +4 -0
- package/dist/controls/control-textarea/control-textarea.component.d.ts +15 -0
- package/dist/controls/control-textarea/control-textarea.component.js +63 -0
- package/dist/controls/control-textarea/index.d.ts +1 -0
- package/dist/controls/control-textarea/index.js +4 -0
- package/dist/controls/hooks/index.d.ts +1 -0
- package/dist/controls/hooks/index.js +4 -0
- package/dist/controls/hooks/use-choice/index.d.ts +1 -0
- package/dist/controls/hooks/use-choice/index.js +4 -0
- package/dist/{components/control/hooks/useChoice/useChoice.hook.d.ts → controls/hooks/use-choice/use-choice.hook.d.ts} +2 -2
- package/dist/controls/utils/functions/index.d.ts +1 -0
- package/dist/controls/utils/functions/index.js +7 -0
- package/dist/controls/utils/index.d.ts +2 -0
- package/dist/controls/utils/index.js +7 -0
- package/dist/{components/control/control.types.d.ts → controls/utils/types.d.ts} +11 -3
- package/dist/main.d.ts +35 -13
- package/dist/main.js +101 -59
- package/dist/utils/functions/functions.util.d.ts +12 -2
- package/dist/utils/functions/functions.util.js +7 -3
- package/dist/utils/functions/index.js +5 -4
- package/dist/utils/svg/svg.component.d.ts +2 -2
- package/dist/utils/types.d.ts +6 -1
- package/package.json +6 -1
- package/dist/animations/animation.component.d.ts +0 -10
- package/dist/animations/animation.component.js +0 -13
- package/dist/animations/fade-grow/fade-grow.component.d.ts +0 -14
- package/dist/animations/fade-grow/fade-grow.component.js +0 -40
- package/dist/animations/fade-scale/fade-scale.component.d.ts +0 -14
- package/dist/animations/fade-scale/fade-scale.component.js +0 -40
- package/dist/animations/fade-slide/fade-slide.component.d.ts +0 -15
- package/dist/animations/fade-slide/fade-slide.component.js +0 -41
- package/dist/animations/rotate/rotate.component.d.ts +0 -18
- package/dist/animations/rotate/rotate.component.js +0 -43
- package/dist/assets/box-b_yPaNPs.css +0 -1
- package/dist/assets/button-4MJZ7yPE.css +0 -1
- package/dist/assets/button-text-CNXFsTky.css +0 -1
- package/dist/assets/choice-pCBafXqx.css +0 -1
- package/dist/assets/control-Dk23qyF8.css +0 -1
- package/dist/assets/data-protected-label-zRn9upL6.css +0 -1
- package/dist/assets/dialog-article-lpJC_c40.css +0 -1
- package/dist/assets/expenses-8eaHjdlH.css +0 -1
- package/dist/assets/fade-grow-B23oZuuD.css +0 -1
- package/dist/assets/hidden-input-DHJQHUKd.css +0 -1
- package/dist/assets/input-Cckwgcro.css +0 -1
- package/dist/assets/label-bo2ALC-X.css +0 -1
- package/dist/assets/loader-C0f3AvRU.css +0 -1
- package/dist/assets/main-BK_1RcKG.css +0 -1
- package/dist/assets/message-block-BVk5u9rO.css +0 -1
- package/dist/assets/radio-label-Bd5UiESO.css +0 -1
- package/dist/assets/radio-text-BI17l0wD.css +0 -1
- package/dist/assets/status-6MH80dkz.css +0 -1
- package/dist/components/control/components/box/box.component.d.ts +0 -10
- package/dist/components/control/components/box/box.component.js +0 -32
- package/dist/components/control/components/button/button.component.d.ts +0 -16
- package/dist/components/control/components/button/button.component.js +0 -82
- package/dist/components/control/components/button-card/button-card.component.js +0 -9
- package/dist/components/control/components/button-radio/button-radio.component.d.ts +0 -17
- package/dist/components/control/components/button-radio/button-radio.component.js +0 -7
- package/dist/components/control/components/button-text/button-text.component.d.ts +0 -18
- package/dist/components/control/components/button-text/button-text.component.js +0 -86
- package/dist/components/control/components/card-image/card-image.component.d.ts +0 -7
- package/dist/components/control/components/card-image/card-image.component.js +0 -7
- package/dist/components/control/components/card-text/card-text.component.d.ts +0 -6
- package/dist/components/control/components/card-text/card-text.component.js +0 -7
- package/dist/components/control/components/checkbox/checkbox.component.d.ts +0 -9
- package/dist/components/control/components/checkbox/checkbox.component.js +0 -8
- package/dist/components/control/components/choice/choice.component.d.ts +0 -10
- package/dist/components/control/components/choice/choice.component.js +0 -52
- package/dist/components/control/components/dropdown/dropdown.component.js +0 -11
- package/dist/components/control/components/hidden-input/hidden-input.component.d.ts +0 -12
- package/dist/components/control/components/hidden-input/hidden-input.component.js +0 -25
- package/dist/components/control/components/input/input.component.d.ts +0 -10
- package/dist/components/control/components/input/input.component.js +0 -7
- package/dist/components/control/components/label/label.component.d.ts +0 -7
- package/dist/components/control/components/label/label.component.js +0 -28
- package/dist/components/control/components/radio/radio.component.d.ts +0 -9
- package/dist/components/control/components/radio/radio.component.js +0 -7
- package/dist/components/control/components/radio-label/radio-label.component.d.ts +0 -17
- package/dist/components/control/components/radio-label/radio-label.component.js +0 -37
- package/dist/components/control/components/radio-text/radio-text.component.d.ts +0 -9
- package/dist/components/control/components/radio-text/radio-text.component.js +0 -29
- package/dist/components/control/components/status/status.component.d.ts +0 -6
- package/dist/components/control/components/status/status.component.js +0 -37
- package/dist/components/control/components/text/text.component.d.ts +0 -9
- package/dist/components/control/components/text/text.component.js +0 -8
- package/dist/components/control/components/textarea/textarea.component.d.ts +0 -9
- package/dist/components/control/components/textarea/textarea.component.js +0 -6
- package/dist/components/control/control.component.d.ts +0 -41
- package/dist/components/control/control.component.js +0 -14
- package/dist/control.component-B9Ao9mfl.js +0 -557
- package/dist/input.component-C5xcmnfu.js +0 -999
- /package/dist/{components/control/hooks/useChoice/useChoice.hook.js → controls/hooks/use-choice/use-choice.hook.js} +0 -0
- /package/dist/{components/control → controls}/utils/functions/functions.util.d.ts +0 -0
- /package/dist/{components/control → controls}/utils/functions/functions.util.js +0 -0
|
@@ -0,0 +1,973 @@
|
|
|
1
|
+
import { jsx as ve } from "react/jsx-runtime";
|
|
2
|
+
import Ie, { useRef as be } from "react";
|
|
3
|
+
import { g as Ee } from "../../_commonjsHelpers-CqEciG1_.js";
|
|
4
|
+
import { r as De } from "../../index-D3EuHLHH.js";
|
|
5
|
+
import ge from "clsx";
|
|
6
|
+
import { findEndIndex as Oe } from "../utils/functions/functions.util.js";
|
|
7
|
+
import '../../assets/control-input-nR0XQHHp.css';var te = { exports: {} }, ce, ke;
|
|
8
|
+
function ye() {
|
|
9
|
+
if (ke) return ce;
|
|
10
|
+
ke = 1;
|
|
11
|
+
function E(n) {
|
|
12
|
+
return n && typeof n == "object" && "default" in n ? n.default : n;
|
|
13
|
+
}
|
|
14
|
+
var b = E(Ie), T = De();
|
|
15
|
+
function A(n, r) {
|
|
16
|
+
for (var a = Object.getOwnPropertyNames(r), t = 0; t < a.length; t++) {
|
|
17
|
+
var e = a[t], o = Object.getOwnPropertyDescriptor(r, e);
|
|
18
|
+
o && o.configurable && n[e] === void 0 && Object.defineProperty(n, e, o);
|
|
19
|
+
}
|
|
20
|
+
return n;
|
|
21
|
+
}
|
|
22
|
+
function L() {
|
|
23
|
+
return (L = Object.assign || function(n) {
|
|
24
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
25
|
+
var a = arguments[r];
|
|
26
|
+
for (var t in a) Object.prototype.hasOwnProperty.call(a, t) && (n[t] = a[t]);
|
|
27
|
+
}
|
|
28
|
+
return n;
|
|
29
|
+
}).apply(this, arguments);
|
|
30
|
+
}
|
|
31
|
+
function P(n, r) {
|
|
32
|
+
n.prototype = Object.create(r.prototype), A(n.prototype.constructor = n, r);
|
|
33
|
+
}
|
|
34
|
+
function V(n, r) {
|
|
35
|
+
if (n == null) return {};
|
|
36
|
+
var a, t, e = {}, o = Object.keys(n);
|
|
37
|
+
for (t = 0; t < o.length; t++) a = o[t], 0 <= r.indexOf(a) || (e[a] = n[a]);
|
|
38
|
+
return e;
|
|
39
|
+
}
|
|
40
|
+
function O(n) {
|
|
41
|
+
if (n === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
42
|
+
return n;
|
|
43
|
+
}
|
|
44
|
+
var U = function(n, r, a, t, e, o, d, k) {
|
|
45
|
+
if (!n) {
|
|
46
|
+
var s;
|
|
47
|
+
if (r === void 0) s = new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");
|
|
48
|
+
else {
|
|
49
|
+
var c = [a, t, e, o, d, k], p = 0;
|
|
50
|
+
(s = new Error(r.replace(/%s/g, function() {
|
|
51
|
+
return c[p++];
|
|
52
|
+
}))).name = "Invariant Violation";
|
|
53
|
+
}
|
|
54
|
+
throw s.framesToPop = 1, s;
|
|
55
|
+
}
|
|
56
|
+
}, y = U;
|
|
57
|
+
function q(n, r, a) {
|
|
58
|
+
if ("selectionStart" in n && "selectionEnd" in n) n.selectionStart = r, n.selectionEnd = a;
|
|
59
|
+
else {
|
|
60
|
+
var t = n.createTextRange();
|
|
61
|
+
t.collapse(!0), t.moveStart("character", r), t.moveEnd("character", a - r), t.select();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function Y(n) {
|
|
65
|
+
var r = 0, a = 0;
|
|
66
|
+
if ("selectionStart" in n && "selectionEnd" in n) r = n.selectionStart, a = n.selectionEnd;
|
|
67
|
+
else {
|
|
68
|
+
var t = document.selection.createRange();
|
|
69
|
+
t.parentElement() === n && (r = -t.moveStart("character", -n.value.length), a = -t.moveEnd("character", -n.value.length));
|
|
70
|
+
}
|
|
71
|
+
return { start: r, end: a, length: a - r };
|
|
72
|
+
}
|
|
73
|
+
var B = { 9: "[0-9]", a: "[A-Za-z]", "*": "[A-Za-z0-9]" }, J = "_";
|
|
74
|
+
function $(n, r, a) {
|
|
75
|
+
var t = "", e = "", o = null, d = [];
|
|
76
|
+
if (r === void 0 && (r = J), a == null && (a = B), !n || typeof n != "string") return { maskChar: r, formatChars: a, mask: null, prefix: null, lastEditablePosition: null, permanents: [] };
|
|
77
|
+
var k = !1;
|
|
78
|
+
return n.split("").forEach(function(s) {
|
|
79
|
+
k = !k && s === "\\" || (k || !a[s] ? (d.push(t.length), t.length === d.length - 1 && (e += s)) : o = t.length + 1, t += s, !1);
|
|
80
|
+
}), { maskChar: r, formatChars: a, prefix: e, mask: t, lastEditablePosition: o, permanents: d };
|
|
81
|
+
}
|
|
82
|
+
function g(n, r) {
|
|
83
|
+
return n.permanents.indexOf(r) !== -1;
|
|
84
|
+
}
|
|
85
|
+
function D(n, r, a) {
|
|
86
|
+
var t = n.mask, e = n.formatChars;
|
|
87
|
+
if (!a) return !1;
|
|
88
|
+
if (g(n, r)) return t[r] === a;
|
|
89
|
+
var o = e[t[r]];
|
|
90
|
+
return new RegExp(o).test(a);
|
|
91
|
+
}
|
|
92
|
+
function z(n, r) {
|
|
93
|
+
return r.split("").every(function(a, t) {
|
|
94
|
+
return g(n, t) || !D(n, t, a);
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function x(n, r) {
|
|
98
|
+
var a = n.maskChar, t = n.prefix;
|
|
99
|
+
if (!a) {
|
|
100
|
+
for (; r.length > t.length && g(n, r.length - 1); ) r = r.slice(0, r.length - 1);
|
|
101
|
+
return r.length;
|
|
102
|
+
}
|
|
103
|
+
for (var e = t.length, o = r.length; o >= t.length; o--) {
|
|
104
|
+
var d = r[o];
|
|
105
|
+
if (!g(n, o) && D(n, o, d)) {
|
|
106
|
+
e = o + 1;
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return e;
|
|
111
|
+
}
|
|
112
|
+
function Q(n, r) {
|
|
113
|
+
return x(n, r) === n.mask.length;
|
|
114
|
+
}
|
|
115
|
+
function _(n, r) {
|
|
116
|
+
var a = n.maskChar, t = n.mask, e = n.prefix;
|
|
117
|
+
if (!a) {
|
|
118
|
+
for ((r = Z(n, "", r, 0)).length < e.length && (r = e); r.length < t.length && g(n, r.length); ) r += t[r.length];
|
|
119
|
+
return r;
|
|
120
|
+
}
|
|
121
|
+
if (r) return Z(n, _(n, ""), r, 0);
|
|
122
|
+
for (var o = 0; o < t.length; o++) g(n, o) ? r += t[o] : r += a;
|
|
123
|
+
return r;
|
|
124
|
+
}
|
|
125
|
+
function re(n, r, a, t) {
|
|
126
|
+
var e = a + t, o = n.maskChar, d = n.mask, k = n.prefix, s = r.split("");
|
|
127
|
+
if (o) return s.map(function(p, h) {
|
|
128
|
+
return h < a || e <= h ? p : g(n, h) ? d[h] : o;
|
|
129
|
+
}).join("");
|
|
130
|
+
for (var c = e; c < s.length; c++) g(n, c) && (s[c] = "");
|
|
131
|
+
return a = Math.max(k.length, a), s.splice(a, e - a), r = s.join(""), _(n, r);
|
|
132
|
+
}
|
|
133
|
+
function Z(n, r, a, t) {
|
|
134
|
+
var e = n.mask, o = n.maskChar, d = n.prefix, k = a.split(""), s = Q(n, r);
|
|
135
|
+
return !o && t > r.length && (r += e.slice(r.length, t)), k.every(function(c) {
|
|
136
|
+
for (; C = c, g(n, u = t) && C !== e[u]; ) {
|
|
137
|
+
if (t >= r.length && (r += e[t]), p = c, h = t, o && g(n, h) && p === o) return !0;
|
|
138
|
+
if (++t >= e.length) return !1;
|
|
139
|
+
}
|
|
140
|
+
var p, h, u, C;
|
|
141
|
+
return !D(n, t, c) && c !== o || (t < r.length ? r = o || s || t < d.length ? r.slice(0, t) + c + r.slice(t + 1) : (r = r.slice(0, t) + c + r.slice(t), _(n, r)) : o || (r += c), ++t < e.length);
|
|
142
|
+
}), r;
|
|
143
|
+
}
|
|
144
|
+
function ae(n, r, a, t) {
|
|
145
|
+
var e = n.mask, o = n.maskChar, d = a.split(""), k = t;
|
|
146
|
+
return d.every(function(s) {
|
|
147
|
+
for (; p = s, g(n, c = t) && p !== e[c]; ) if (++t >= e.length) return !1;
|
|
148
|
+
var c, p;
|
|
149
|
+
return (D(n, t, s) || s === o) && t++, t < e.length;
|
|
150
|
+
}), t - k;
|
|
151
|
+
}
|
|
152
|
+
function oe(n, r) {
|
|
153
|
+
for (var a = r; 0 <= a; --a) if (!g(n, a)) return a;
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
function j(n, r) {
|
|
157
|
+
for (var a = n.mask, t = r; t < a.length; ++t) if (!g(n, t)) return t;
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
160
|
+
function K(n) {
|
|
161
|
+
return n || n === 0 ? n + "" : "";
|
|
162
|
+
}
|
|
163
|
+
function ie(n, r, a, t, e) {
|
|
164
|
+
var o = n.mask, d = n.prefix, k = n.lastEditablePosition, s = r, c = "", p = 0, h = 0, u = Math.min(e.start, a.start);
|
|
165
|
+
return a.end > e.start ? h = (p = ae(n, t, c = s.slice(e.start, a.end), u)) ? e.length : 0 : s.length < t.length && (h = t.length - s.length), s = t, h && (h === 1 && !e.length && (u = e.start === a.start ? j(n, a.start) : oe(n, a.start)), s = re(n, s, u, h)), s = Z(n, s, c, u), (u += p) >= o.length ? u = o.length : u < d.length && !p ? u = d.length : u >= d.length && u < k && p && (u = j(n, u)), c || (c = null), { value: s = _(n, s), enteredString: c, selection: { start: u, end: u } };
|
|
166
|
+
}
|
|
167
|
+
function se() {
|
|
168
|
+
var n = new RegExp("windows", "i"), r = new RegExp("phone", "i"), a = navigator.userAgent;
|
|
169
|
+
return n.test(a) && r.test(a);
|
|
170
|
+
}
|
|
171
|
+
function M(n) {
|
|
172
|
+
return typeof n == "function";
|
|
173
|
+
}
|
|
174
|
+
function le() {
|
|
175
|
+
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame;
|
|
176
|
+
}
|
|
177
|
+
function ee() {
|
|
178
|
+
return window.cancelAnimationFrame || window.webkitCancelRequestAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame;
|
|
179
|
+
}
|
|
180
|
+
function ne(n) {
|
|
181
|
+
return (ee() ? le() : function() {
|
|
182
|
+
return setTimeout(n, 1e3 / 60);
|
|
183
|
+
})(n);
|
|
184
|
+
}
|
|
185
|
+
function H(n) {
|
|
186
|
+
(ee() || clearTimeout)(n);
|
|
187
|
+
}
|
|
188
|
+
var ue = (function(n) {
|
|
189
|
+
function r(t) {
|
|
190
|
+
var e = n.call(this, t) || this;
|
|
191
|
+
e.focused = !1, e.mounted = !1, e.previousSelection = null, e.selectionDeferId = null, e.saveSelectionLoopDeferId = null, e.saveSelectionLoop = function() {
|
|
192
|
+
e.previousSelection = e.getSelection(), e.saveSelectionLoopDeferId = ne(e.saveSelectionLoop);
|
|
193
|
+
}, e.runSaveSelectionLoop = function() {
|
|
194
|
+
e.saveSelectionLoopDeferId === null && e.saveSelectionLoop();
|
|
195
|
+
}, e.stopSaveSelectionLoop = function() {
|
|
196
|
+
e.saveSelectionLoopDeferId !== null && (H(e.saveSelectionLoopDeferId), e.saveSelectionLoopDeferId = null, e.previousSelection = null);
|
|
197
|
+
}, e.getInputDOMNode = function() {
|
|
198
|
+
if (!e.mounted) return null;
|
|
199
|
+
var l = T.findDOMNode(O(O(e))), i = typeof window < "u" && l instanceof window.Element;
|
|
200
|
+
if (l && !i) return null;
|
|
201
|
+
if (l.nodeName !== "INPUT" && (l = l.querySelector("input")), !l) throw new Error("react-input-mask: inputComponent doesn't contain input node");
|
|
202
|
+
return l;
|
|
203
|
+
}, e.getInputValue = function() {
|
|
204
|
+
var l = e.getInputDOMNode();
|
|
205
|
+
return l ? l.value : null;
|
|
206
|
+
}, e.setInputValue = function(l) {
|
|
207
|
+
var i = e.getInputDOMNode();
|
|
208
|
+
i && (e.value = l, i.value = l);
|
|
209
|
+
}, e.setCursorToEnd = function() {
|
|
210
|
+
var l = x(e.maskOptions, e.value), i = j(e.maskOptions, l);
|
|
211
|
+
i !== null && e.setCursorPosition(i);
|
|
212
|
+
}, e.setSelection = function(l, i, f) {
|
|
213
|
+
f === void 0 && (f = {});
|
|
214
|
+
var m = e.getInputDOMNode(), v = e.isFocused();
|
|
215
|
+
m && v && (f.deferred || q(m, l, i), e.selectionDeferId !== null && H(e.selectionDeferId), e.selectionDeferId = ne(function() {
|
|
216
|
+
e.selectionDeferId = null, q(m, l, i);
|
|
217
|
+
}), e.previousSelection = { start: l, end: i, length: Math.abs(i - l) });
|
|
218
|
+
}, e.getSelection = function() {
|
|
219
|
+
return Y(e.getInputDOMNode());
|
|
220
|
+
}, e.getCursorPosition = function() {
|
|
221
|
+
return e.getSelection().start;
|
|
222
|
+
}, e.setCursorPosition = function(l) {
|
|
223
|
+
e.setSelection(l, l);
|
|
224
|
+
}, e.isFocused = function() {
|
|
225
|
+
return e.focused;
|
|
226
|
+
}, e.getBeforeMaskedValueChangeConfig = function() {
|
|
227
|
+
var l = e.maskOptions, i = l.mask, f = l.maskChar, m = l.permanents, v = l.formatChars;
|
|
228
|
+
return { mask: i, maskChar: f, permanents: m, alwaysShowMask: !!e.props.alwaysShowMask, formatChars: v };
|
|
229
|
+
}, e.isInputAutofilled = function(l, i, f, m) {
|
|
230
|
+
var v = e.getInputDOMNode();
|
|
231
|
+
try {
|
|
232
|
+
if (v.matches(":-webkit-autofill")) return !0;
|
|
233
|
+
} catch {
|
|
234
|
+
}
|
|
235
|
+
return !e.focused || m.end < f.length && i.end === l.length;
|
|
236
|
+
}, e.onChange = function(l) {
|
|
237
|
+
var i = O(O(e)).beforePasteState, f = O(O(e)).previousSelection, m = e.props.beforeMaskedValueChange, v = e.getInputValue(), w = e.value, S = e.getSelection();
|
|
238
|
+
e.isInputAutofilled(v, S, w, f) && (w = _(e.maskOptions, ""), f = { start: 0, end: 0, length: 0 }), i && (f = i.selection, w = i.value, S = { start: f.start + v.length, end: f.start + v.length, length: 0 }, v = w.slice(0, f.start) + v + w.slice(f.end), e.beforePasteState = null);
|
|
239
|
+
var I = ie(e.maskOptions, v, S, w, f), F = I.enteredString, R = I.selection, N = I.value;
|
|
240
|
+
if (M(m)) {
|
|
241
|
+
var W = m({ value: N, selection: R }, { value: w, selection: f }, F, e.getBeforeMaskedValueChangeConfig());
|
|
242
|
+
N = W.value, R = W.selection;
|
|
243
|
+
}
|
|
244
|
+
e.setInputValue(N), M(e.props.onChange) && e.props.onChange(l), e.isWindowsPhoneBrowser ? e.setSelection(R.start, R.end, { deferred: !0 }) : e.setSelection(R.start, R.end);
|
|
245
|
+
}, e.onFocus = function(l) {
|
|
246
|
+
var i = e.props.beforeMaskedValueChange, f = e.maskOptions, m = f.mask, v = f.prefix;
|
|
247
|
+
if (e.focused = !0, e.mounted = !0, m) {
|
|
248
|
+
if (e.value) x(e.maskOptions, e.value) < e.maskOptions.mask.length && e.setCursorToEnd();
|
|
249
|
+
else {
|
|
250
|
+
var w = _(e.maskOptions, v), S = _(e.maskOptions, w), I = x(e.maskOptions, S), F = j(e.maskOptions, I), R = { start: F, end: F };
|
|
251
|
+
if (M(i)) {
|
|
252
|
+
var N = i({ value: S, selection: R }, { value: e.value, selection: null }, null, e.getBeforeMaskedValueChangeConfig());
|
|
253
|
+
S = N.value, R = N.selection;
|
|
254
|
+
}
|
|
255
|
+
var W = S !== e.getInputValue();
|
|
256
|
+
W && e.setInputValue(S), W && M(e.props.onChange) && e.props.onChange(l), e.setSelection(R.start, R.end);
|
|
257
|
+
}
|
|
258
|
+
e.runSaveSelectionLoop();
|
|
259
|
+
}
|
|
260
|
+
M(e.props.onFocus) && e.props.onFocus(l);
|
|
261
|
+
}, e.onBlur = function(l) {
|
|
262
|
+
var i = e.props.beforeMaskedValueChange, f = e.maskOptions.mask;
|
|
263
|
+
if (e.stopSaveSelectionLoop(), e.focused = !1, f && !e.props.alwaysShowMask && z(e.maskOptions, e.value)) {
|
|
264
|
+
var m = "";
|
|
265
|
+
M(i) && (m = i({ value: m, selection: null }, { value: e.value, selection: e.previousSelection }, null, e.getBeforeMaskedValueChangeConfig()).value);
|
|
266
|
+
var v = m !== e.getInputValue();
|
|
267
|
+
v && e.setInputValue(m), v && M(e.props.onChange) && e.props.onChange(l);
|
|
268
|
+
}
|
|
269
|
+
M(e.props.onBlur) && e.props.onBlur(l);
|
|
270
|
+
}, e.onMouseDown = function(l) {
|
|
271
|
+
if (!e.focused && document.addEventListener) {
|
|
272
|
+
e.mouseDownX = l.clientX, e.mouseDownY = l.clientY, e.mouseDownTime = (/* @__PURE__ */ new Date()).getTime();
|
|
273
|
+
var i = function f(m) {
|
|
274
|
+
if (document.removeEventListener("mouseup", f), e.focused) {
|
|
275
|
+
var v = Math.abs(m.clientX - e.mouseDownX), w = Math.abs(m.clientY - e.mouseDownY), S = Math.max(v, w), I = (/* @__PURE__ */ new Date()).getTime() - e.mouseDownTime;
|
|
276
|
+
(S <= 10 && I <= 200 || S <= 5 && I <= 300) && e.setCursorToEnd();
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
document.addEventListener("mouseup", i);
|
|
280
|
+
}
|
|
281
|
+
M(e.props.onMouseDown) && e.props.onMouseDown(l);
|
|
282
|
+
}, e.onPaste = function(l) {
|
|
283
|
+
M(e.props.onPaste) && e.props.onPaste(l), l.defaultPrevented || (e.beforePasteState = { value: e.getInputValue(), selection: e.getSelection() }, e.setInputValue(""));
|
|
284
|
+
}, e.handleRef = function(l) {
|
|
285
|
+
e.props.children == null && M(e.props.inputRef) && e.props.inputRef(l);
|
|
286
|
+
};
|
|
287
|
+
var o = t.mask, d = t.maskChar, k = t.formatChars, s = t.alwaysShowMask, c = t.beforeMaskedValueChange, p = t.defaultValue, h = t.value;
|
|
288
|
+
e.maskOptions = $(o, d, k), p == null && (p = ""), h == null && (h = p);
|
|
289
|
+
var u = K(h);
|
|
290
|
+
if (e.maskOptions.mask && (s || u) && (u = _(e.maskOptions, u), M(c))) {
|
|
291
|
+
var C = t.value;
|
|
292
|
+
t.value == null && (C = p), u = c({ value: u, selection: null }, { value: C = K(C), selection: null }, null, e.getBeforeMaskedValueChangeConfig()).value;
|
|
293
|
+
}
|
|
294
|
+
return e.value = u, e;
|
|
295
|
+
}
|
|
296
|
+
P(r, n);
|
|
297
|
+
var a = r.prototype;
|
|
298
|
+
return a.componentDidMount = function() {
|
|
299
|
+
this.mounted = !0, this.getInputDOMNode() && (this.isWindowsPhoneBrowser = se(), this.maskOptions.mask && this.getInputValue() !== this.value && this.setInputValue(this.value));
|
|
300
|
+
}, a.componentDidUpdate = function() {
|
|
301
|
+
var t = this.previousSelection, e = this.props, o = e.beforeMaskedValueChange, d = e.alwaysShowMask, k = e.mask, s = e.maskChar, c = e.formatChars, p = this.maskOptions, h = d || this.isFocused(), u = this.props.value != null, C = u ? K(this.props.value) : this.value, l = t ? t.start : null;
|
|
302
|
+
if (this.maskOptions = $(k, s, c), this.maskOptions.mask) {
|
|
303
|
+
!p.mask && this.isFocused() && this.runSaveSelectionLoop();
|
|
304
|
+
var i = this.maskOptions.mask && this.maskOptions.mask !== p.mask;
|
|
305
|
+
if (p.mask || u || (C = this.getInputValue()), (i || this.maskOptions.mask && (C || h)) && (C = _(this.maskOptions, C)), i) {
|
|
306
|
+
var f = x(this.maskOptions, C);
|
|
307
|
+
(l === null || f < l) && (l = Q(this.maskOptions, C) ? f : j(this.maskOptions, f));
|
|
308
|
+
}
|
|
309
|
+
!this.maskOptions.mask || !z(this.maskOptions, C) || h || u && this.props.value || (C = "");
|
|
310
|
+
var m = { start: l, end: l };
|
|
311
|
+
if (M(o)) {
|
|
312
|
+
var v = o({ value: C, selection: m }, { value: this.value, selection: this.previousSelection }, null, this.getBeforeMaskedValueChangeConfig());
|
|
313
|
+
C = v.value, m = v.selection;
|
|
314
|
+
}
|
|
315
|
+
this.value = C;
|
|
316
|
+
var w = this.getInputValue() !== this.value;
|
|
317
|
+
w ? (this.setInputValue(this.value), this.forceUpdate()) : i && this.forceUpdate();
|
|
318
|
+
var S = !1;
|
|
319
|
+
m.start != null && m.end != null && (S = !t || t.start !== m.start || t.end !== m.end), (S || w) && this.setSelection(m.start, m.end);
|
|
320
|
+
} else p.mask && (this.stopSaveSelectionLoop(), this.forceUpdate());
|
|
321
|
+
}, a.componentWillUnmount = function() {
|
|
322
|
+
this.mounted = !1, this.selectionDeferId !== null && H(this.selectionDeferId), this.stopSaveSelectionLoop();
|
|
323
|
+
}, a.render = function() {
|
|
324
|
+
var t, e = this.props, o = (e.mask, e.alwaysShowMask, e.maskChar, e.formatChars, e.inputRef, e.beforeMaskedValueChange, e.children), d = V(e, ["mask", "alwaysShowMask", "maskChar", "formatChars", "inputRef", "beforeMaskedValueChange", "children"]);
|
|
325
|
+
if (o) {
|
|
326
|
+
M(o) || y(!1);
|
|
327
|
+
var k = ["onChange", "onPaste", "onMouseDown", "onFocus", "onBlur", "value", "disabled", "readOnly"], s = L({}, d);
|
|
328
|
+
k.forEach(function(p) {
|
|
329
|
+
return delete s[p];
|
|
330
|
+
}), t = o(s), k.filter(function(p) {
|
|
331
|
+
return t.props[p] != null && t.props[p] !== d[p];
|
|
332
|
+
}).length && y(!1);
|
|
333
|
+
} else t = b.createElement("input", L({ ref: this.handleRef }, d));
|
|
334
|
+
var c = { onFocus: this.onFocus, onBlur: this.onBlur };
|
|
335
|
+
return this.maskOptions.mask && (d.disabled || d.readOnly || (c.onChange = this.onChange, c.onPaste = this.onPaste, c.onMouseDown = this.onMouseDown), d.value != null && (c.value = this.value)), t = b.cloneElement(t, c);
|
|
336
|
+
}, r;
|
|
337
|
+
})(b.Component);
|
|
338
|
+
return ce = ue, ce;
|
|
339
|
+
}
|
|
340
|
+
var he, we;
|
|
341
|
+
function Ve() {
|
|
342
|
+
if (we) return he;
|
|
343
|
+
we = 1;
|
|
344
|
+
var E = function(b, T, A, L, P, V, O, U) {
|
|
345
|
+
if (process.env.NODE_ENV !== "production" && T === void 0)
|
|
346
|
+
throw new Error("invariant requires an error message argument");
|
|
347
|
+
if (!b) {
|
|
348
|
+
var y;
|
|
349
|
+
if (T === void 0)
|
|
350
|
+
y = new Error(
|
|
351
|
+
"Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings."
|
|
352
|
+
);
|
|
353
|
+
else {
|
|
354
|
+
var q = [A, L, P, V, O, U], Y = 0;
|
|
355
|
+
y = new Error(
|
|
356
|
+
T.replace(/%s/g, function() {
|
|
357
|
+
return q[Y++];
|
|
358
|
+
})
|
|
359
|
+
), y.name = "Invariant Violation";
|
|
360
|
+
}
|
|
361
|
+
throw y.framesToPop = 1, y;
|
|
362
|
+
}
|
|
363
|
+
};
|
|
364
|
+
return he = E, he;
|
|
365
|
+
}
|
|
366
|
+
var pe, Ce;
|
|
367
|
+
function _e() {
|
|
368
|
+
if (Ce) return pe;
|
|
369
|
+
Ce = 1;
|
|
370
|
+
var E = process.env.NODE_ENV !== "production", b = function() {
|
|
371
|
+
};
|
|
372
|
+
if (E) {
|
|
373
|
+
var T = function(L, P) {
|
|
374
|
+
var V = arguments.length;
|
|
375
|
+
P = new Array(V > 1 ? V - 1 : 0);
|
|
376
|
+
for (var O = 1; O < V; O++)
|
|
377
|
+
P[O - 1] = arguments[O];
|
|
378
|
+
var U = 0, y = "Warning: " + L.replace(/%s/g, function() {
|
|
379
|
+
return P[U++];
|
|
380
|
+
});
|
|
381
|
+
typeof console < "u" && console.error(y);
|
|
382
|
+
try {
|
|
383
|
+
throw new Error(y);
|
|
384
|
+
} catch {
|
|
385
|
+
}
|
|
386
|
+
};
|
|
387
|
+
b = function(A, L, P) {
|
|
388
|
+
var V = arguments.length;
|
|
389
|
+
P = new Array(V > 2 ? V - 2 : 0);
|
|
390
|
+
for (var O = 2; O < V; O++)
|
|
391
|
+
P[O - 2] = arguments[O];
|
|
392
|
+
if (L === void 0)
|
|
393
|
+
throw new Error(
|
|
394
|
+
"`warning(condition, format, ...args)` requires a warning message argument"
|
|
395
|
+
);
|
|
396
|
+
A || T.apply(null, [L].concat(P));
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
return pe = b, pe;
|
|
400
|
+
}
|
|
401
|
+
var de, Se;
|
|
402
|
+
function Re() {
|
|
403
|
+
if (Se) return de;
|
|
404
|
+
Se = 1;
|
|
405
|
+
function E(n) {
|
|
406
|
+
return n && typeof n == "object" && "default" in n ? n.default : n;
|
|
407
|
+
}
|
|
408
|
+
var b = E(Ie), T = De(), A = E(Ve()), L = E(_e());
|
|
409
|
+
function P(n, r) {
|
|
410
|
+
for (var a = Object.getOwnPropertyNames(r), t = 0; t < a.length; t++) {
|
|
411
|
+
var e = a[t], o = Object.getOwnPropertyDescriptor(r, e);
|
|
412
|
+
o && o.configurable && n[e] === void 0 && Object.defineProperty(n, e, o);
|
|
413
|
+
}
|
|
414
|
+
return n;
|
|
415
|
+
}
|
|
416
|
+
function V() {
|
|
417
|
+
return V = Object.assign || function(n) {
|
|
418
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
419
|
+
var a = arguments[r];
|
|
420
|
+
for (var t in a)
|
|
421
|
+
Object.prototype.hasOwnProperty.call(a, t) && (n[t] = a[t]);
|
|
422
|
+
}
|
|
423
|
+
return n;
|
|
424
|
+
}, V.apply(this, arguments);
|
|
425
|
+
}
|
|
426
|
+
function O(n, r) {
|
|
427
|
+
n.prototype = Object.create(r.prototype), n.prototype.constructor = n, P(n, r);
|
|
428
|
+
}
|
|
429
|
+
function U(n, r) {
|
|
430
|
+
if (n == null) return {};
|
|
431
|
+
var a = {}, t = Object.keys(n), e, o;
|
|
432
|
+
for (o = 0; o < t.length; o++)
|
|
433
|
+
e = t[o], !(r.indexOf(e) >= 0) && (a[e] = n[e]);
|
|
434
|
+
return a;
|
|
435
|
+
}
|
|
436
|
+
function y(n) {
|
|
437
|
+
if (n === void 0)
|
|
438
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
439
|
+
return n;
|
|
440
|
+
}
|
|
441
|
+
function q(n, r, a) {
|
|
442
|
+
if ("selectionStart" in n && "selectionEnd" in n)
|
|
443
|
+
n.selectionStart = r, n.selectionEnd = a;
|
|
444
|
+
else {
|
|
445
|
+
var t = n.createTextRange();
|
|
446
|
+
t.collapse(!0), t.moveStart("character", r), t.moveEnd("character", a - r), t.select();
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
function Y(n) {
|
|
450
|
+
var r = 0, a = 0;
|
|
451
|
+
if ("selectionStart" in n && "selectionEnd" in n)
|
|
452
|
+
r = n.selectionStart, a = n.selectionEnd;
|
|
453
|
+
else {
|
|
454
|
+
var t = document.selection.createRange();
|
|
455
|
+
t.parentElement() === n && (r = -t.moveStart("character", -n.value.length), a = -t.moveEnd("character", -n.value.length));
|
|
456
|
+
}
|
|
457
|
+
return {
|
|
458
|
+
start: r,
|
|
459
|
+
end: a,
|
|
460
|
+
length: a - r
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
var B = {
|
|
464
|
+
9: "[0-9]",
|
|
465
|
+
a: "[A-Za-z]",
|
|
466
|
+
"*": "[A-Za-z0-9]"
|
|
467
|
+
}, J = "_";
|
|
468
|
+
function $(n, r, a) {
|
|
469
|
+
var t = "", e = "", o = null, d = [];
|
|
470
|
+
if (r === void 0 && (r = J), a == null && (a = B), !n || typeof n != "string")
|
|
471
|
+
return {
|
|
472
|
+
maskChar: r,
|
|
473
|
+
formatChars: a,
|
|
474
|
+
mask: null,
|
|
475
|
+
prefix: null,
|
|
476
|
+
lastEditablePosition: null,
|
|
477
|
+
permanents: []
|
|
478
|
+
};
|
|
479
|
+
var k = !1;
|
|
480
|
+
return n.split("").forEach(function(s) {
|
|
481
|
+
!k && s === "\\" ? k = !0 : (k || !a[s] ? (d.push(t.length), t.length === d.length - 1 && (e += s)) : o = t.length + 1, t += s, k = !1);
|
|
482
|
+
}), {
|
|
483
|
+
maskChar: r,
|
|
484
|
+
formatChars: a,
|
|
485
|
+
prefix: e,
|
|
486
|
+
mask: t,
|
|
487
|
+
lastEditablePosition: o,
|
|
488
|
+
permanents: d
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
function g(n, r) {
|
|
492
|
+
return n.permanents.indexOf(r) !== -1;
|
|
493
|
+
}
|
|
494
|
+
function D(n, r, a) {
|
|
495
|
+
var t = n.mask, e = n.formatChars;
|
|
496
|
+
if (!a)
|
|
497
|
+
return !1;
|
|
498
|
+
if (g(n, r))
|
|
499
|
+
return t[r] === a;
|
|
500
|
+
var o = t[r], d = e[o];
|
|
501
|
+
return new RegExp(d).test(a);
|
|
502
|
+
}
|
|
503
|
+
function z(n, r) {
|
|
504
|
+
return r.split("").every(function(a, t) {
|
|
505
|
+
return g(n, t) || !D(n, t, a);
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
function x(n, r) {
|
|
509
|
+
var a = n.maskChar, t = n.prefix;
|
|
510
|
+
if (!a) {
|
|
511
|
+
for (; r.length > t.length && g(n, r.length - 1); )
|
|
512
|
+
r = r.slice(0, r.length - 1);
|
|
513
|
+
return r.length;
|
|
514
|
+
}
|
|
515
|
+
for (var e = t.length, o = r.length; o >= t.length; o--) {
|
|
516
|
+
var d = r[o], k = !g(n, o) && D(n, o, d);
|
|
517
|
+
if (k) {
|
|
518
|
+
e = o + 1;
|
|
519
|
+
break;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
return e;
|
|
523
|
+
}
|
|
524
|
+
function Q(n, r) {
|
|
525
|
+
return x(n, r) === n.mask.length;
|
|
526
|
+
}
|
|
527
|
+
function _(n, r) {
|
|
528
|
+
var a = n.maskChar, t = n.mask, e = n.prefix;
|
|
529
|
+
if (!a) {
|
|
530
|
+
for (r = Z(n, "", r, 0), r.length < e.length && (r = e); r.length < t.length && g(n, r.length); )
|
|
531
|
+
r += t[r.length];
|
|
532
|
+
return r;
|
|
533
|
+
}
|
|
534
|
+
if (r) {
|
|
535
|
+
var o = _(n, "");
|
|
536
|
+
return Z(n, o, r, 0);
|
|
537
|
+
}
|
|
538
|
+
for (var d = 0; d < t.length; d++)
|
|
539
|
+
g(n, d) ? r += t[d] : r += a;
|
|
540
|
+
return r;
|
|
541
|
+
}
|
|
542
|
+
function re(n, r, a, t) {
|
|
543
|
+
var e = a + t, o = n.maskChar, d = n.mask, k = n.prefix, s = r.split("");
|
|
544
|
+
if (!o) {
|
|
545
|
+
for (var c = e; c < s.length; c++)
|
|
546
|
+
g(n, c) && (s[c] = "");
|
|
547
|
+
return a = Math.max(k.length, a), s.splice(a, e - a), r = s.join(""), _(n, r);
|
|
548
|
+
}
|
|
549
|
+
return s.map(function(p, h) {
|
|
550
|
+
return h < a || h >= e ? p : g(n, h) ? d[h] : o;
|
|
551
|
+
}).join("");
|
|
552
|
+
}
|
|
553
|
+
function Z(n, r, a, t) {
|
|
554
|
+
var e = n.mask, o = n.maskChar, d = n.prefix, k = a.split(""), s = Q(n, r), c = function(u, C) {
|
|
555
|
+
return !g(n, u) || C === e[u];
|
|
556
|
+
}, p = function(u, C) {
|
|
557
|
+
return !o || !g(n, C) || u !== o;
|
|
558
|
+
};
|
|
559
|
+
return !o && t > r.length && (r += e.slice(r.length, t)), k.every(function(h) {
|
|
560
|
+
for (; !c(t, h); ) {
|
|
561
|
+
if (t >= r.length && (r += e[t]), !p(h, t))
|
|
562
|
+
return !0;
|
|
563
|
+
if (t++, t >= e.length)
|
|
564
|
+
return !1;
|
|
565
|
+
}
|
|
566
|
+
var u = D(n, t, h) || h === o;
|
|
567
|
+
return u ? (t < r.length ? o || s || t < d.length ? r = r.slice(0, t) + h + r.slice(t + 1) : (r = r.slice(0, t) + h + r.slice(t), r = _(n, r)) : o || (r += h), t++, t < e.length) : !0;
|
|
568
|
+
}), r;
|
|
569
|
+
}
|
|
570
|
+
function ae(n, r, a, t) {
|
|
571
|
+
var e = n.mask, o = n.maskChar, d = a.split(""), k = t, s = function(p, h) {
|
|
572
|
+
return !g(n, p) || h === e[p];
|
|
573
|
+
};
|
|
574
|
+
return d.every(function(c) {
|
|
575
|
+
for (; !s(t, c); )
|
|
576
|
+
if (t++, t >= e.length)
|
|
577
|
+
return !1;
|
|
578
|
+
var p = D(n, t, c) || c === o;
|
|
579
|
+
return p && t++, t < e.length;
|
|
580
|
+
}), t - k;
|
|
581
|
+
}
|
|
582
|
+
function oe(n, r) {
|
|
583
|
+
for (var a = r; a >= 0; --a)
|
|
584
|
+
if (!g(n, a))
|
|
585
|
+
return a;
|
|
586
|
+
return null;
|
|
587
|
+
}
|
|
588
|
+
function j(n, r) {
|
|
589
|
+
for (var a = n.mask, t = r; t < a.length; ++t)
|
|
590
|
+
if (!g(n, t))
|
|
591
|
+
return t;
|
|
592
|
+
return null;
|
|
593
|
+
}
|
|
594
|
+
function K(n) {
|
|
595
|
+
return !n && n !== 0 ? "" : n + "";
|
|
596
|
+
}
|
|
597
|
+
function ie(n, r, a, t, e) {
|
|
598
|
+
var o = n.mask, d = n.prefix, k = n.lastEditablePosition, s = r, c = "", p = 0, h = 0, u = Math.min(e.start, a.start);
|
|
599
|
+
if (a.end > e.start ? (c = s.slice(e.start, a.end), p = ae(n, t, c, u), p ? h = e.length : h = 0) : s.length < t.length && (h = t.length - s.length), s = t, h) {
|
|
600
|
+
if (h === 1 && !e.length) {
|
|
601
|
+
var C = e.start === a.start;
|
|
602
|
+
u = C ? j(n, a.start) : oe(n, a.start);
|
|
603
|
+
}
|
|
604
|
+
s = re(n, s, u, h);
|
|
605
|
+
}
|
|
606
|
+
return s = Z(n, s, c, u), u = u + p, u >= o.length ? u = o.length : u < d.length && !p ? u = d.length : u >= d.length && u < k && p && (u = j(n, u)), s = _(n, s), c || (c = null), {
|
|
607
|
+
value: s,
|
|
608
|
+
enteredString: c,
|
|
609
|
+
selection: {
|
|
610
|
+
start: u,
|
|
611
|
+
end: u
|
|
612
|
+
}
|
|
613
|
+
};
|
|
614
|
+
}
|
|
615
|
+
function se() {
|
|
616
|
+
var n = new RegExp("windows", "i"), r = new RegExp("phone", "i"), a = navigator.userAgent;
|
|
617
|
+
return n.test(a) && r.test(a);
|
|
618
|
+
}
|
|
619
|
+
function M(n) {
|
|
620
|
+
return typeof n == "function";
|
|
621
|
+
}
|
|
622
|
+
function le() {
|
|
623
|
+
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame;
|
|
624
|
+
}
|
|
625
|
+
function ee() {
|
|
626
|
+
return window.cancelAnimationFrame || window.webkitCancelRequestAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame;
|
|
627
|
+
}
|
|
628
|
+
function ne(n) {
|
|
629
|
+
var r = !!ee(), a;
|
|
630
|
+
return r ? a = le() : a = function() {
|
|
631
|
+
return setTimeout(n, 1e3 / 60);
|
|
632
|
+
}, a(n);
|
|
633
|
+
}
|
|
634
|
+
function H(n) {
|
|
635
|
+
var r = ee() || clearTimeout;
|
|
636
|
+
r(n);
|
|
637
|
+
}
|
|
638
|
+
var ue = /* @__PURE__ */ (function(n) {
|
|
639
|
+
O(r, n);
|
|
640
|
+
function r(t) {
|
|
641
|
+
var e;
|
|
642
|
+
e = n.call(this, t) || this, e.focused = !1, e.mounted = !1, e.previousSelection = null, e.selectionDeferId = null, e.saveSelectionLoopDeferId = null, e.saveSelectionLoop = function() {
|
|
643
|
+
e.previousSelection = e.getSelection(), e.saveSelectionLoopDeferId = ne(e.saveSelectionLoop);
|
|
644
|
+
}, e.runSaveSelectionLoop = function() {
|
|
645
|
+
e.saveSelectionLoopDeferId === null && e.saveSelectionLoop();
|
|
646
|
+
}, e.stopSaveSelectionLoop = function() {
|
|
647
|
+
e.saveSelectionLoopDeferId !== null && (H(e.saveSelectionLoopDeferId), e.saveSelectionLoopDeferId = null, e.previousSelection = null);
|
|
648
|
+
}, e.getInputDOMNode = function() {
|
|
649
|
+
if (!e.mounted)
|
|
650
|
+
return null;
|
|
651
|
+
var i = T.findDOMNode(y(y(e))), f = typeof window < "u" && i instanceof window.Element;
|
|
652
|
+
if (i && !f)
|
|
653
|
+
return null;
|
|
654
|
+
if (i.nodeName !== "INPUT" && (i = i.querySelector("input")), !i)
|
|
655
|
+
throw new Error("react-input-mask: inputComponent doesn't contain input node");
|
|
656
|
+
return i;
|
|
657
|
+
}, e.getInputValue = function() {
|
|
658
|
+
var i = e.getInputDOMNode();
|
|
659
|
+
return i ? i.value : null;
|
|
660
|
+
}, e.setInputValue = function(i) {
|
|
661
|
+
var f = e.getInputDOMNode();
|
|
662
|
+
f && (e.value = i, f.value = i);
|
|
663
|
+
}, e.setCursorToEnd = function() {
|
|
664
|
+
var i = x(e.maskOptions, e.value), f = j(e.maskOptions, i);
|
|
665
|
+
f !== null && e.setCursorPosition(f);
|
|
666
|
+
}, e.setSelection = function(i, f, m) {
|
|
667
|
+
m === void 0 && (m = {});
|
|
668
|
+
var v = e.getInputDOMNode(), w = e.isFocused();
|
|
669
|
+
if (!(!v || !w)) {
|
|
670
|
+
var S = m, I = S.deferred;
|
|
671
|
+
I || q(v, i, f), e.selectionDeferId !== null && H(e.selectionDeferId), e.selectionDeferId = ne(function() {
|
|
672
|
+
e.selectionDeferId = null, q(v, i, f);
|
|
673
|
+
}), e.previousSelection = {
|
|
674
|
+
start: i,
|
|
675
|
+
end: f,
|
|
676
|
+
length: Math.abs(f - i)
|
|
677
|
+
};
|
|
678
|
+
}
|
|
679
|
+
}, e.getSelection = function() {
|
|
680
|
+
var i = e.getInputDOMNode();
|
|
681
|
+
return Y(i);
|
|
682
|
+
}, e.getCursorPosition = function() {
|
|
683
|
+
return e.getSelection().start;
|
|
684
|
+
}, e.setCursorPosition = function(i) {
|
|
685
|
+
e.setSelection(i, i);
|
|
686
|
+
}, e.isFocused = function() {
|
|
687
|
+
return e.focused;
|
|
688
|
+
}, e.getBeforeMaskedValueChangeConfig = function() {
|
|
689
|
+
var i = e.maskOptions, f = i.mask, m = i.maskChar, v = i.permanents, w = i.formatChars, S = e.props.alwaysShowMask;
|
|
690
|
+
return {
|
|
691
|
+
mask: f,
|
|
692
|
+
maskChar: m,
|
|
693
|
+
permanents: v,
|
|
694
|
+
alwaysShowMask: !!S,
|
|
695
|
+
formatChars: w
|
|
696
|
+
};
|
|
697
|
+
}, e.isInputAutofilled = function(i, f, m, v) {
|
|
698
|
+
var w = e.getInputDOMNode();
|
|
699
|
+
try {
|
|
700
|
+
if (w.matches(":-webkit-autofill"))
|
|
701
|
+
return !0;
|
|
702
|
+
} catch {
|
|
703
|
+
}
|
|
704
|
+
return e.focused ? v.end < m.length && f.end === i.length : !0;
|
|
705
|
+
}, e.onChange = function(i) {
|
|
706
|
+
var f = y(y(e)), m = f.beforePasteState, v = y(y(e)), w = v.previousSelection, S = e.props.beforeMaskedValueChange, I = e.getInputValue(), F = e.value, R = e.getSelection();
|
|
707
|
+
e.isInputAutofilled(I, R, F, w) && (F = _(e.maskOptions, ""), w = {
|
|
708
|
+
start: 0,
|
|
709
|
+
end: 0,
|
|
710
|
+
length: 0
|
|
711
|
+
}), m && (w = m.selection, F = m.value, R = {
|
|
712
|
+
start: w.start + I.length,
|
|
713
|
+
end: w.start + I.length,
|
|
714
|
+
length: 0
|
|
715
|
+
}, I = F.slice(0, w.start) + I + F.slice(w.end), e.beforePasteState = null);
|
|
716
|
+
var N = ie(e.maskOptions, I, R, F, w), W = N.enteredString, X = N.selection, fe = N.value;
|
|
717
|
+
if (M(S)) {
|
|
718
|
+
var me = S({
|
|
719
|
+
value: fe,
|
|
720
|
+
selection: X
|
|
721
|
+
}, {
|
|
722
|
+
value: F,
|
|
723
|
+
selection: w
|
|
724
|
+
}, W, e.getBeforeMaskedValueChangeConfig());
|
|
725
|
+
fe = me.value, X = me.selection;
|
|
726
|
+
}
|
|
727
|
+
e.setInputValue(fe), M(e.props.onChange) && e.props.onChange(i), e.isWindowsPhoneBrowser ? e.setSelection(X.start, X.end, {
|
|
728
|
+
deferred: !0
|
|
729
|
+
}) : e.setSelection(X.start, X.end);
|
|
730
|
+
}, e.onFocus = function(i) {
|
|
731
|
+
var f = e.props.beforeMaskedValueChange, m = e.maskOptions, v = m.mask, w = m.prefix;
|
|
732
|
+
if (e.focused = !0, e.mounted = !0, v) {
|
|
733
|
+
if (e.value)
|
|
734
|
+
x(e.maskOptions, e.value) < e.maskOptions.mask.length && e.setCursorToEnd();
|
|
735
|
+
else {
|
|
736
|
+
var S = _(e.maskOptions, w), I = _(e.maskOptions, S), F = x(e.maskOptions, I), R = j(e.maskOptions, F), N = {
|
|
737
|
+
start: R,
|
|
738
|
+
end: R
|
|
739
|
+
};
|
|
740
|
+
if (M(f)) {
|
|
741
|
+
var W = f({
|
|
742
|
+
value: I,
|
|
743
|
+
selection: N
|
|
744
|
+
}, {
|
|
745
|
+
value: e.value,
|
|
746
|
+
selection: null
|
|
747
|
+
}, null, e.getBeforeMaskedValueChangeConfig());
|
|
748
|
+
I = W.value, N = W.selection;
|
|
749
|
+
}
|
|
750
|
+
var X = I !== e.getInputValue();
|
|
751
|
+
X && e.setInputValue(I), X && M(e.props.onChange) && e.props.onChange(i), e.setSelection(N.start, N.end);
|
|
752
|
+
}
|
|
753
|
+
e.runSaveSelectionLoop();
|
|
754
|
+
}
|
|
755
|
+
M(e.props.onFocus) && e.props.onFocus(i);
|
|
756
|
+
}, e.onBlur = function(i) {
|
|
757
|
+
var f = e.props.beforeMaskedValueChange, m = e.maskOptions.mask;
|
|
758
|
+
if (e.stopSaveSelectionLoop(), e.focused = !1, m && !e.props.alwaysShowMask && z(e.maskOptions, e.value)) {
|
|
759
|
+
var v = "";
|
|
760
|
+
if (M(f)) {
|
|
761
|
+
var w = f({
|
|
762
|
+
value: v,
|
|
763
|
+
selection: null
|
|
764
|
+
}, {
|
|
765
|
+
value: e.value,
|
|
766
|
+
selection: e.previousSelection
|
|
767
|
+
}, null, e.getBeforeMaskedValueChangeConfig());
|
|
768
|
+
v = w.value;
|
|
769
|
+
}
|
|
770
|
+
var S = v !== e.getInputValue();
|
|
771
|
+
S && e.setInputValue(v), S && M(e.props.onChange) && e.props.onChange(i);
|
|
772
|
+
}
|
|
773
|
+
M(e.props.onBlur) && e.props.onBlur(i);
|
|
774
|
+
}, e.onMouseDown = function(i) {
|
|
775
|
+
if (!e.focused && document.addEventListener) {
|
|
776
|
+
e.mouseDownX = i.clientX, e.mouseDownY = i.clientY, e.mouseDownTime = (/* @__PURE__ */ new Date()).getTime();
|
|
777
|
+
var f = function m(v) {
|
|
778
|
+
if (document.removeEventListener("mouseup", m), !!e.focused) {
|
|
779
|
+
var w = Math.abs(v.clientX - e.mouseDownX), S = Math.abs(v.clientY - e.mouseDownY), I = Math.max(w, S), F = (/* @__PURE__ */ new Date()).getTime() - e.mouseDownTime;
|
|
780
|
+
(I <= 10 && F <= 200 || I <= 5 && F <= 300) && e.setCursorToEnd();
|
|
781
|
+
}
|
|
782
|
+
};
|
|
783
|
+
document.addEventListener("mouseup", f);
|
|
784
|
+
}
|
|
785
|
+
M(e.props.onMouseDown) && e.props.onMouseDown(i);
|
|
786
|
+
}, e.onPaste = function(i) {
|
|
787
|
+
M(e.props.onPaste) && e.props.onPaste(i), i.defaultPrevented || (e.beforePasteState = {
|
|
788
|
+
value: e.getInputValue(),
|
|
789
|
+
selection: e.getSelection()
|
|
790
|
+
}, e.setInputValue(""));
|
|
791
|
+
}, e.handleRef = function(i) {
|
|
792
|
+
e.props.children == null && M(e.props.inputRef) && e.props.inputRef(i);
|
|
793
|
+
};
|
|
794
|
+
var o = t.mask, d = t.maskChar, k = t.formatChars, s = t.alwaysShowMask, c = t.beforeMaskedValueChange, p = t.defaultValue, h = t.value;
|
|
795
|
+
e.maskOptions = $(o, d, k), p == null && (p = ""), h == null && (h = p);
|
|
796
|
+
var u = K(h);
|
|
797
|
+
if (e.maskOptions.mask && (s || u) && (u = _(e.maskOptions, u), M(c))) {
|
|
798
|
+
var C = t.value;
|
|
799
|
+
t.value == null && (C = p), C = K(C);
|
|
800
|
+
var l = c({
|
|
801
|
+
value: u,
|
|
802
|
+
selection: null
|
|
803
|
+
}, {
|
|
804
|
+
value: C,
|
|
805
|
+
selection: null
|
|
806
|
+
}, null, e.getBeforeMaskedValueChangeConfig());
|
|
807
|
+
u = l.value;
|
|
808
|
+
}
|
|
809
|
+
return e.value = u, e;
|
|
810
|
+
}
|
|
811
|
+
var a = r.prototype;
|
|
812
|
+
return a.componentDidMount = function() {
|
|
813
|
+
this.mounted = !0, this.getInputDOMNode() && (this.isWindowsPhoneBrowser = se(), this.maskOptions.mask && this.getInputValue() !== this.value && this.setInputValue(this.value));
|
|
814
|
+
}, a.componentDidUpdate = function() {
|
|
815
|
+
var e = this.previousSelection, o = this.props, d = o.beforeMaskedValueChange, k = o.alwaysShowMask, s = o.mask, c = o.maskChar, p = o.formatChars, h = this.maskOptions, u = k || this.isFocused(), C = this.props.value != null, l = C ? K(this.props.value) : this.value, i = e ? e.start : null;
|
|
816
|
+
if (this.maskOptions = $(s, c, p), this.maskOptions.mask)
|
|
817
|
+
!h.mask && this.isFocused() && this.runSaveSelectionLoop();
|
|
818
|
+
else {
|
|
819
|
+
h.mask && (this.stopSaveSelectionLoop(), this.forceUpdate());
|
|
820
|
+
return;
|
|
821
|
+
}
|
|
822
|
+
var f = this.maskOptions.mask && this.maskOptions.mask !== h.mask;
|
|
823
|
+
if (!h.mask && !C && (l = this.getInputValue()), (f || this.maskOptions.mask && (l || u)) && (l = _(this.maskOptions, l)), f) {
|
|
824
|
+
var m = x(this.maskOptions, l);
|
|
825
|
+
(i === null || m < i) && (Q(this.maskOptions, l) ? i = m : i = j(this.maskOptions, m));
|
|
826
|
+
}
|
|
827
|
+
this.maskOptions.mask && z(this.maskOptions, l) && !u && (!C || !this.props.value) && (l = "");
|
|
828
|
+
var v = {
|
|
829
|
+
start: i,
|
|
830
|
+
end: i
|
|
831
|
+
};
|
|
832
|
+
if (M(d)) {
|
|
833
|
+
var w = d({
|
|
834
|
+
value: l,
|
|
835
|
+
selection: v
|
|
836
|
+
}, {
|
|
837
|
+
value: this.value,
|
|
838
|
+
selection: this.previousSelection
|
|
839
|
+
}, null, this.getBeforeMaskedValueChangeConfig());
|
|
840
|
+
l = w.value, v = w.selection;
|
|
841
|
+
}
|
|
842
|
+
this.value = l;
|
|
843
|
+
var S = this.getInputValue() !== this.value;
|
|
844
|
+
S ? (this.setInputValue(this.value), this.forceUpdate()) : f && this.forceUpdate();
|
|
845
|
+
var I = !1;
|
|
846
|
+
v.start != null && v.end != null && (I = !e || e.start !== v.start || e.end !== v.end), (I || S) && this.setSelection(v.start, v.end);
|
|
847
|
+
}, a.componentWillUnmount = function() {
|
|
848
|
+
this.mounted = !1, this.selectionDeferId !== null && H(this.selectionDeferId), this.stopSaveSelectionLoop();
|
|
849
|
+
}, a.render = function() {
|
|
850
|
+
var e = this.props, o = e.mask;
|
|
851
|
+
e.alwaysShowMask;
|
|
852
|
+
var d = e.maskChar, k = e.formatChars, s = e.inputRef;
|
|
853
|
+
e.beforeMaskedValueChange;
|
|
854
|
+
var c = e.children, p = U(e, ["mask", "alwaysShowMask", "maskChar", "formatChars", "inputRef", "beforeMaskedValueChange", "children"]), h;
|
|
855
|
+
if (process.env.NODE_ENV !== "production" && L(
|
|
856
|
+
// parse mask to test against actual mask prop as this.maskOptions
|
|
857
|
+
// will be updated later in componentDidUpdate
|
|
858
|
+
!p.maxLength || !$(o, d, k).mask,
|
|
859
|
+
"react-input-mask: maxLength property shouldn't be passed to the masked input. It breaks masking and unnecessary because length is limited by the mask length."
|
|
860
|
+
), c) {
|
|
861
|
+
M(c) || (process.env.NODE_ENV !== "production" ? A(!1, "react-input-mask: children must be a function") : A(!1));
|
|
862
|
+
var u = ["onChange", "onPaste", "onMouseDown", "onFocus", "onBlur", "value", "disabled", "readOnly"], C = V({}, p);
|
|
863
|
+
u.forEach(function(f) {
|
|
864
|
+
return delete C[f];
|
|
865
|
+
}), h = c(C);
|
|
866
|
+
var l = u.filter(function(f) {
|
|
867
|
+
return h.props[f] != null && h.props[f] !== p[f];
|
|
868
|
+
});
|
|
869
|
+
l.length && (process.env.NODE_ENV !== "production" ? A(!1, "react-input-mask: the following props should be passed to the react-input-mask's component and should not be altered in children's function: " + l.join(", ")) : A(!1)), process.env.NODE_ENV !== "production" && L(!s, "react-input-mask: inputRef is ignored when children is passed, attach ref to the children instead");
|
|
870
|
+
} else
|
|
871
|
+
h = b.createElement("input", V({
|
|
872
|
+
ref: this.handleRef
|
|
873
|
+
}, p));
|
|
874
|
+
var i = {
|
|
875
|
+
onFocus: this.onFocus,
|
|
876
|
+
onBlur: this.onBlur
|
|
877
|
+
};
|
|
878
|
+
return this.maskOptions.mask && (!p.disabled && !p.readOnly && (i.onChange = this.onChange, i.onPaste = this.onPaste, i.onMouseDown = this.onMouseDown), p.value != null && (i.value = this.value)), h = b.cloneElement(h, i), h;
|
|
879
|
+
}, r;
|
|
880
|
+
})(b.Component);
|
|
881
|
+
return de = ue, de;
|
|
882
|
+
}
|
|
883
|
+
var Me;
|
|
884
|
+
function xe() {
|
|
885
|
+
return Me || (Me = 1, process.env.NODE_ENV === "production" ? te.exports = ye() : te.exports = Re()), te.exports;
|
|
886
|
+
}
|
|
887
|
+
var Fe = xe();
|
|
888
|
+
const Le = /* @__PURE__ */ Ee(Fe), Pe = "_ControlInput_1rfnu_1", G = {
|
|
889
|
+
ControlInput: Pe,
|
|
890
|
+
"autofill-start": "_autofill-start_1rfnu_1",
|
|
891
|
+
"autofill-cancel": "_autofill-cancel_1rfnu_1"
|
|
892
|
+
}, Ue = ({
|
|
893
|
+
id: E,
|
|
894
|
+
value: b,
|
|
895
|
+
disabled: T = !1,
|
|
896
|
+
dateMask: A = !1,
|
|
897
|
+
maxLength: L,
|
|
898
|
+
type: P = "text",
|
|
899
|
+
onAutofill: V,
|
|
900
|
+
onAutofillCancel: O,
|
|
901
|
+
onChange: U,
|
|
902
|
+
onFocus: y,
|
|
903
|
+
onBlur: q,
|
|
904
|
+
className: Y
|
|
905
|
+
}) => {
|
|
906
|
+
const B = be(null), J = (g) => {
|
|
907
|
+
const D = Oe(b);
|
|
908
|
+
D < b.length - 1 && B.current && (g.preventDefault(), B.current.setSelectionRange(D + 1, D + 1, "none"));
|
|
909
|
+
}, $ = (g) => {
|
|
910
|
+
if ((g.code === "ArrowUp" || g.code === "ArrowDown") && g.preventDefault(), g.code === "ArrowRight" && B.current) {
|
|
911
|
+
const D = B.current.selectionStart || 0, z = b[D + 1] === "/" ? b[D + 2] : b[D + 1];
|
|
912
|
+
if (!/^\d+$/.test(z))
|
|
913
|
+
g.preventDefault();
|
|
914
|
+
else {
|
|
915
|
+
const x = b[D + 1] === "/" ? 1 : 0;
|
|
916
|
+
B.current.setSelectionRange(D + x, D + x, "none");
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
if (g.code === "ArrowLeft" && B.current) {
|
|
920
|
+
g.preventDefault();
|
|
921
|
+
const D = B.current.selectionStart || 0, z = b[D - 1] === "/" ? b[D - 2] : b[D - 1];
|
|
922
|
+
if (!/^\d+$/.test(z))
|
|
923
|
+
g.preventDefault();
|
|
924
|
+
else {
|
|
925
|
+
const x = b[D - 1] === "/" ? 2 : 1;
|
|
926
|
+
B.current.setSelectionRange(D - x, D - x, "none");
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
};
|
|
930
|
+
return A ? /* @__PURE__ */ ve(
|
|
931
|
+
Le,
|
|
932
|
+
{
|
|
933
|
+
"data-testid": "input-masked",
|
|
934
|
+
ref: B,
|
|
935
|
+
value: b,
|
|
936
|
+
id: E,
|
|
937
|
+
className: ge(G.ControlInput, Y),
|
|
938
|
+
disabled: T,
|
|
939
|
+
mask: "99/99/9999",
|
|
940
|
+
maskChar: "_",
|
|
941
|
+
alwaysShowMask: !1,
|
|
942
|
+
onClick: J,
|
|
943
|
+
onKeyDown: $,
|
|
944
|
+
onChange: (g) => U(g.target.value, E, "keyboard"),
|
|
945
|
+
onAnimationStart: (g) => {
|
|
946
|
+
g.animationName === G["autofill-start"] && V?.call(null, E), g.animationName === G["autofill-cancel"] && (g.currentTarget.blur(), O?.call(null, E));
|
|
947
|
+
},
|
|
948
|
+
onFocus: () => y?.call(null, E),
|
|
949
|
+
onBlur: () => q?.call(null, E)
|
|
950
|
+
}
|
|
951
|
+
) : /* @__PURE__ */ ve(
|
|
952
|
+
"input",
|
|
953
|
+
{
|
|
954
|
+
"data-testid": "input",
|
|
955
|
+
disabled: T,
|
|
956
|
+
maxLength: L,
|
|
957
|
+
type: P,
|
|
958
|
+
id: E,
|
|
959
|
+
name: E,
|
|
960
|
+
value: b,
|
|
961
|
+
className: ge(G.ControlInput, Y),
|
|
962
|
+
onChange: (g) => U(g.target.value, E, "keyboard"),
|
|
963
|
+
onAnimationStart: (g) => {
|
|
964
|
+
g.animationName === G["autofill-start"] && V?.call(null, E), g.animationName === G["autofill-cancel"] && (g.currentTarget.blur(), O?.call(null, E));
|
|
965
|
+
},
|
|
966
|
+
onFocus: () => y?.call(null, E),
|
|
967
|
+
onBlur: () => q?.call(null, E)
|
|
968
|
+
}
|
|
969
|
+
);
|
|
970
|
+
};
|
|
971
|
+
export {
|
|
972
|
+
Ue as ControlInput
|
|
973
|
+
};
|