@rpcbase/ui 0.207.0 → 0.208.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/index.js +7 -7
- package/dist/index19.js +1 -1
- package/dist/index19.js.map +1 -1
- package/dist/index200.js +56 -55
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +60 -8
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +7 -15
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +15 -143
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +145 -4
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +4 -11
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +10 -104
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +94 -347
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +349 -87
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +73 -304
- package/dist/index209.js.map +1 -1
- package/dist/index210.js +309 -193
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +211 -19
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +18 -27
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +27 -187
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +186 -16
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +18 -44
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +60 -8
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +42 -23
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +9 -44
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +25 -18
- package/dist/index219.js.map +1 -1
- package/dist/index220.js +45 -3
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +17 -4
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +3 -21
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +4 -24
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +17 -64
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +23 -13
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +68 -4
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +14 -50
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +4 -6
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +50 -26
- package/dist/index229.js.map +1 -1
- package/dist/index230.js +5 -13
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +25 -8
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +17 -3
- package/dist/index232.js.map +1 -0
- package/dist/index233.js +8 -24
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +2 -71
- package/dist/index235.js +29 -3
- package/dist/index235.js.map +1 -0
- package/dist/index236.js +69 -12
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +3 -54
- package/dist/index238.js +11 -114
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +51 -6
- package/dist/index239.js.map +1 -1
- package/dist/index240.js +115 -13
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +6 -687
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +13 -253
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +662 -676
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +252 -7430
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +700 -6
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +7429 -11
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +5 -4
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +11 -458
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +5 -37
- package/dist/index249.js.map +1 -1
- package/dist/index250.js +458 -18
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +34 -24
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +19 -4
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +23 -54
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +4 -7
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +57 -11
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +8 -3
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +12 -16
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +3 -26
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +15 -42
- package/dist/index259.js.map +1 -1
- package/dist/index260.js +25 -13
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +40 -22
- package/dist/index261.js.map +1 -1
- package/dist/index262.js +13 -17
- package/dist/index262.js.map +1 -1
- package/dist/index263.js +24 -34
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +17 -5
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +35 -9
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +5 -8
- package/dist/index266.js.map +1 -1
- package/dist/index267.js +9 -9
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +8 -10
- package/dist/index268.js.map +1 -1
- package/dist/index269.js +9 -7
- package/dist/index269.js.map +1 -1
- package/dist/index270.js +9 -72
- package/dist/index270.js.map +1 -1
- package/dist/index271.js +7 -171
- package/dist/index271.js.map +1 -1
- package/dist/index272.js +63 -104
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +169 -12
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +109 -75
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +12 -44
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +79 -12
- package/dist/index276.js.map +1 -1
- package/dist/index277.js +45 -15
- package/dist/index277.js.map +1 -1
- package/dist/index278.js +12 -98
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +15 -55
- package/dist/index279.js.map +1 -1
- package/dist/index280.js +89 -98
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +27 -42
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +92 -97
- package/dist/index282.js.map +1 -1
- package/dist/index283.js +62 -46
- package/dist/index283.js.map +1 -1
- package/dist/index284.js +108 -38
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +48 -135
- package/dist/index285.js.map +1 -1
- package/dist/index286.js +43 -139
- package/dist/index286.js.map +1 -1
- package/dist/index287.js +105 -217
- package/dist/index287.js.map +1 -1
- package/dist/index288.js +109 -210
- package/dist/index288.js.map +1 -1
- package/dist/index289.js +168 -212
- package/dist/index289.js.map +1 -1
- package/dist/index290.js +240 -5
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +298 -6
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +5 -7
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +4 -4
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +7 -6
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +6 -21
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +6 -10
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +18 -123
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +10 -164
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +116 -58
- package/dist/index299.js.map +1 -1
- package/dist/index300.js +161 -106
- package/dist/index300.js.map +1 -1
- package/dist/index301.js +66 -489
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +106 -59
- package/dist/index302.js.map +1 -1
- package/dist/index303.js +492 -4
- package/dist/index303.js.map +1 -1
- package/dist/index304.js +62 -27
- package/dist/index304.js.map +1 -1
- package/dist/index305.js +4 -66
- package/dist/index305.js.map +1 -1
- package/dist/index306.js +27 -152
- package/dist/index306.js.map +1 -1
- package/dist/index307.js +59 -555
- package/dist/index307.js.map +1 -1
- package/dist/index308.js +143 -201
- package/dist/index308.js.map +1 -1
- package/dist/index309.js +56 -326
- package/dist/index309.js.map +1 -1
- package/dist/index310.js +553 -260
- package/dist/index310.js.map +1 -1
- package/dist/index311.js +214 -0
- package/dist/index311.js.map +1 -0
- package/dist/index312.js +335 -0
- package/dist/index312.js.map +1 -0
- package/dist/index313.js +272 -0
- package/dist/index313.js.map +1 -0
- package/package.json +2 -2
- package/dist/index234.js.map +0 -1
- package/dist/index237.js.map +0 -1
package/dist/index289.js
CHANGED
|
@@ -1,302 +1,258 @@
|
|
|
1
|
-
import e from "./
|
|
2
|
-
import
|
|
3
|
-
import n from "./
|
|
4
|
-
import r from "./
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
function c(e) {
|
|
1
|
+
import { VALID_PUNCTUATION as e } from "./index258.js";
|
|
2
|
+
import t from "./index266.js";
|
|
3
|
+
import { FIRST_GROUP_PATTERN as n } from "./index267.js";
|
|
4
|
+
import r from "./index276.js";
|
|
5
|
+
import { cutAndStripNonPairedParens as i, populateTemplateWithDigits as a, repeat as o } from "./index285.js";
|
|
6
|
+
import s, { canFormatCompleteNumber as c } from "./index286.js";
|
|
7
|
+
import { PatternMatcher as l } from "./index288.js";
|
|
8
|
+
//#region ../../node_modules/libphonenumber-js/es6/AsYouTypeFormatter.js
|
|
9
|
+
function u(e) {
|
|
11
10
|
"@babel/helpers - typeof";
|
|
12
|
-
return
|
|
11
|
+
return u = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
13
12
|
return typeof e;
|
|
14
13
|
} : function(e) {
|
|
15
14
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
16
|
-
},
|
|
17
|
-
}
|
|
18
|
-
function l(e, t) {
|
|
19
|
-
return m(e) || p(e, t) || d(e, t) || u();
|
|
20
|
-
}
|
|
21
|
-
function u() {
|
|
22
|
-
throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
15
|
+
}, u(e);
|
|
23
16
|
}
|
|
24
17
|
function d(e, t) {
|
|
18
|
+
var n = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
19
|
+
if (n) return (n = n.call(e)).next.bind(n);
|
|
20
|
+
if (Array.isArray(e) || (n = f(e)) || t && e && typeof e.length == "number") {
|
|
21
|
+
n && (e = n);
|
|
22
|
+
var r = 0;
|
|
23
|
+
return function() {
|
|
24
|
+
return r >= e.length ? { done: !0 } : {
|
|
25
|
+
done: !1,
|
|
26
|
+
value: e[r++]
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
31
|
+
}
|
|
32
|
+
function f(e, t) {
|
|
25
33
|
if (e) {
|
|
26
|
-
if (typeof e == "string") return
|
|
34
|
+
if (typeof e == "string") return p(e, t);
|
|
27
35
|
var n = {}.toString.call(e).slice(8, -1);
|
|
28
|
-
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ?
|
|
36
|
+
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? p(e, t) : void 0;
|
|
29
37
|
}
|
|
30
38
|
}
|
|
31
|
-
function
|
|
39
|
+
function p(e, t) {
|
|
32
40
|
(t == null || t > e.length) && (t = e.length);
|
|
33
41
|
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
34
42
|
return r;
|
|
35
43
|
}
|
|
36
|
-
function
|
|
37
|
-
var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
38
|
-
if (n != null) {
|
|
39
|
-
var r, i, a, o, s = [], c = !0, l = !1;
|
|
40
|
-
try {
|
|
41
|
-
if (a = (n = n.call(e)).next, t === 0) {
|
|
42
|
-
if (Object(n) !== n) return;
|
|
43
|
-
c = !1;
|
|
44
|
-
} else for (; !(c = (r = a.call(n)).done) && (s.push(r.value), s.length !== t); c = !0);
|
|
45
|
-
} catch (e) {
|
|
46
|
-
l = !0, i = e;
|
|
47
|
-
} finally {
|
|
48
|
-
try {
|
|
49
|
-
if (!c && n.return != null && (o = n.return(), Object(o) !== o)) return;
|
|
50
|
-
} finally {
|
|
51
|
-
if (l) throw i;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return s;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
function m(e) {
|
|
58
|
-
if (Array.isArray(e)) return e;
|
|
59
|
-
}
|
|
60
|
-
function h(e, t) {
|
|
44
|
+
function m(e, t) {
|
|
61
45
|
if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
|
|
62
46
|
}
|
|
63
|
-
function
|
|
47
|
+
function h(e, t) {
|
|
64
48
|
for (var n = 0; n < t.length; n++) {
|
|
65
49
|
var r = t[n];
|
|
66
|
-
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e,
|
|
50
|
+
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, _(r.key), r);
|
|
67
51
|
}
|
|
68
52
|
}
|
|
69
|
-
function
|
|
70
|
-
return t &&
|
|
53
|
+
function g(e, t, n) {
|
|
54
|
+
return t && h(e.prototype, t), n && h(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
|
|
71
55
|
}
|
|
72
|
-
function
|
|
73
|
-
var t =
|
|
74
|
-
return
|
|
56
|
+
function _(e) {
|
|
57
|
+
var t = v(e, "string");
|
|
58
|
+
return u(t) == "symbol" ? t : t + "";
|
|
75
59
|
}
|
|
76
|
-
function
|
|
77
|
-
if (
|
|
60
|
+
function v(e, t) {
|
|
61
|
+
if (u(e) != "object" || !e) return e;
|
|
78
62
|
var n = e[Symbol.toPrimitive];
|
|
79
63
|
if (n !== void 0) {
|
|
80
64
|
var r = n.call(e, t || "default");
|
|
81
|
-
if (
|
|
65
|
+
if (u(r) != "object") return r;
|
|
82
66
|
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
83
67
|
}
|
|
84
68
|
return (t === "string" ? String : Number)(e);
|
|
85
69
|
}
|
|
86
|
-
var b =
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
70
|
+
var y = "9", b = o(y, 15), x = /[- ]/, S = !0, C = S && function() {
|
|
71
|
+
return /\[([^\[\]])*\]/g;
|
|
72
|
+
}, w = S && function() {
|
|
73
|
+
return /\d(?=[^,}][^,}])/g;
|
|
74
|
+
}, T = RegExp("[" + e + "]*\\$1[" + e + "]*(\\$\\d[" + e + "]*)*$"), E = 3, D = /* @__PURE__ */ function() {
|
|
75
|
+
function e(t) {
|
|
76
|
+
t.state;
|
|
77
|
+
var n = t.metadata;
|
|
78
|
+
m(this, e), this.metadata = n, this.resetFormat();
|
|
91
79
|
}
|
|
92
|
-
return
|
|
80
|
+
return g(e, [
|
|
93
81
|
{
|
|
94
|
-
key: "
|
|
95
|
-
value: function(
|
|
96
|
-
|
|
97
|
-
return t && (e(t) ? (n = t.defaultCountry, r = t.defaultCallingCode) : n = t), n && !this.metadata.hasCountry(n) && (n = void 0), r && b && this.metadata.isNonGeographicCallingCode(r) && (n = "001"), [n, r];
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
key: "input",
|
|
102
|
-
value: function(e) {
|
|
103
|
-
var t = this.parser.input(e, this.state), n = t.digits;
|
|
104
|
-
if (t.justLeadingPlus) this.formattedOutput = "+";
|
|
105
|
-
else if (n) {
|
|
106
|
-
this.determineTheCountryIfNeeded(), this.state.nationalSignificantNumber && this.formatter.narrowDownMatchingFormats(this.state);
|
|
107
|
-
var r;
|
|
108
|
-
if (this.metadata.hasSelectedNumberingPlan() && (r = this.formatter.format(n, this.state)), r === void 0 && this.parser.reExtractNationalSignificantNumber(this.state)) {
|
|
109
|
-
this.determineTheCountryIfNeeded();
|
|
110
|
-
var i = this.state.getNationalDigits();
|
|
111
|
-
i && (r = this.formatter.format(i, this.state));
|
|
112
|
-
}
|
|
113
|
-
this.formattedOutput = r ? this.getFullNumber(r) : this.getNonFormattedNumber();
|
|
114
|
-
}
|
|
115
|
-
return this.formattedOutput;
|
|
82
|
+
key: "resetFormat",
|
|
83
|
+
value: function() {
|
|
84
|
+
this.chosenFormat = void 0, this.template = void 0, this.nationalNumberTemplate = void 0, this.populatedNationalNumberTemplate = void 0, this.populatedNationalNumberTemplatePosition = -1;
|
|
116
85
|
}
|
|
117
86
|
},
|
|
118
87
|
{
|
|
119
88
|
key: "reset",
|
|
120
|
-
value: function() {
|
|
121
|
-
|
|
122
|
-
return this.state = new a({
|
|
123
|
-
onCountryChange: function(t) {
|
|
124
|
-
e.country = t;
|
|
125
|
-
},
|
|
126
|
-
onCallingCodeChange: function(t, n) {
|
|
127
|
-
e.metadata.selectNumberingPlan(n, t), e.formatter.reset(e.metadata.numberingPlan, e.state), e.parser.reset(e.metadata.numberingPlan);
|
|
128
|
-
}
|
|
129
|
-
}), this.formatter = new o({
|
|
130
|
-
state: this.state,
|
|
131
|
-
metadata: this.metadata
|
|
132
|
-
}), this.parser = new s({
|
|
133
|
-
defaultCountry: this.defaultCountry,
|
|
134
|
-
defaultCallingCode: this.defaultCallingCode,
|
|
135
|
-
metadata: this.metadata,
|
|
136
|
-
state: this.state,
|
|
137
|
-
onNationalSignificantNumberChange: function() {
|
|
138
|
-
e.determineTheCountryIfNeeded(), e.formatter.reset(e.metadata.numberingPlan, e.state);
|
|
139
|
-
}
|
|
140
|
-
}), this.state.reset({
|
|
141
|
-
country: this.defaultCountry,
|
|
142
|
-
callingCode: this.defaultCallingCode
|
|
143
|
-
}), this.formattedOutput = "", this;
|
|
89
|
+
value: function(e, t) {
|
|
90
|
+
this.resetFormat(), e ? (this.isNANP = e.callingCode() === "1", this.matchingFormats = e.formats(), t.nationalSignificantNumber && this.narrowDownMatchingFormats(t)) : (this.isNANP = void 0, this.matchingFormats = []);
|
|
144
91
|
}
|
|
145
92
|
},
|
|
146
93
|
{
|
|
147
|
-
key: "
|
|
148
|
-
value: function() {
|
|
149
|
-
|
|
94
|
+
key: "format",
|
|
95
|
+
value: function(e, t) {
|
|
96
|
+
var n = this;
|
|
97
|
+
if (c(t.nationalSignificantNumber, t.country, this.metadata)) for (var r = d(this.matchingFormats), i; !(i = r()).done;) {
|
|
98
|
+
var a = i.value, o = s(t, a, {
|
|
99
|
+
metadata: this.metadata,
|
|
100
|
+
shouldTryNationalPrefixFormattingRule: function(e) {
|
|
101
|
+
return n.shouldTryNationalPrefixFormattingRule(e, {
|
|
102
|
+
international: t.international,
|
|
103
|
+
nationalPrefix: t.nationalPrefix
|
|
104
|
+
});
|
|
105
|
+
},
|
|
106
|
+
getSeparatorAfterNationalPrefix: function(e) {
|
|
107
|
+
return n.getSeparatorAfterNationalPrefix(e);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
if (o) return this.resetFormat(), this.chosenFormat = a, this.setNationalNumberTemplate(o.replace(/\d/g, "x"), t), this.populatedNationalNumberTemplate = o, this.populatedNationalNumberTemplatePosition = this.template.lastIndexOf("x"), o;
|
|
111
|
+
}
|
|
112
|
+
return this.formatNationalNumberWithNextDigits(e, t);
|
|
150
113
|
}
|
|
151
114
|
},
|
|
152
115
|
{
|
|
153
|
-
key: "
|
|
154
|
-
value: function() {
|
|
155
|
-
|
|
116
|
+
key: "formatNationalNumberWithNextDigits",
|
|
117
|
+
value: function(e, t) {
|
|
118
|
+
var n = this.chosenFormat, r = this.chooseFormat(t);
|
|
119
|
+
if (r) return r === n ? this.formatNextNationalNumberDigits(e) : this.formatNextNationalNumberDigits(t.getNationalDigits());
|
|
156
120
|
}
|
|
157
121
|
},
|
|
158
122
|
{
|
|
159
|
-
key: "
|
|
160
|
-
value: function() {
|
|
161
|
-
|
|
123
|
+
key: "narrowDownMatchingFormats",
|
|
124
|
+
value: function(e) {
|
|
125
|
+
var t = this, n = e.nationalSignificantNumber, r = e.nationalPrefix, i = e.international, a = n, o = a.length - E;
|
|
126
|
+
o < 0 && (o = 0), this.matchingFormats = this.matchingFormats.filter(function(e) {
|
|
127
|
+
return t.formatSuits(e, i, r) && t.formatMatches(e, a, o);
|
|
128
|
+
}), this.chosenFormat && this.matchingFormats.indexOf(this.chosenFormat) === -1 && this.resetFormat();
|
|
162
129
|
}
|
|
163
130
|
},
|
|
164
131
|
{
|
|
165
|
-
key: "
|
|
166
|
-
value: function() {
|
|
167
|
-
|
|
132
|
+
key: "formatSuits",
|
|
133
|
+
value: function(e, t, n) {
|
|
134
|
+
return !(n && !e.usesNationalPrefix() && !e.nationalPrefixIsOptionalWhenFormattingInNationalFormat() || !t && !n && e.nationalPrefixIsMandatoryWhenFormattingInNationalFormat());
|
|
168
135
|
}
|
|
169
136
|
},
|
|
170
137
|
{
|
|
171
|
-
key: "
|
|
172
|
-
value: function() {
|
|
173
|
-
var
|
|
174
|
-
if (
|
|
138
|
+
key: "formatMatches",
|
|
139
|
+
value: function(e, t, n) {
|
|
140
|
+
var r = e.leadingDigitsPatterns().length;
|
|
141
|
+
if (r === 0) return !0;
|
|
142
|
+
n = Math.min(n, r - 1);
|
|
143
|
+
var i = e.leadingDigitsPatterns()[n];
|
|
144
|
+
if (t.length < E) try {
|
|
145
|
+
return new l(i).match(t, { allowOverflow: !0 }) !== void 0;
|
|
146
|
+
} catch (e) /* istanbul ignore next */ {
|
|
147
|
+
return console.error(e), !0;
|
|
148
|
+
}
|
|
149
|
+
return RegExp(`^(${i})`).test(t);
|
|
175
150
|
}
|
|
176
151
|
},
|
|
177
152
|
{
|
|
178
|
-
key: "
|
|
179
|
-
value: function() {
|
|
180
|
-
|
|
153
|
+
key: "getFormatFormat",
|
|
154
|
+
value: function(e, t) {
|
|
155
|
+
return t ? e.internationalFormat() : e.format();
|
|
181
156
|
}
|
|
182
157
|
},
|
|
183
158
|
{
|
|
184
|
-
key: "
|
|
159
|
+
key: "chooseFormat",
|
|
185
160
|
value: function(e) {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
var n =
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
}
|
|
193
|
-
return
|
|
161
|
+
/* istanbul ignore next */
|
|
162
|
+
for (var t = this, n = function() {
|
|
163
|
+
var n = a.value;
|
|
164
|
+
return t.chosenFormat === n ? 0 : T.test(t.getFormatFormat(n, e.international)) ? t.createTemplateForFormat(n, e) ? (t.chosenFormat = n, 0) : (t.matchingFormats = t.matchingFormats.filter(function(e) {
|
|
165
|
+
return e !== n;
|
|
166
|
+
}), 1) : 1;
|
|
167
|
+
}, r, i = d(this.matchingFormats.slice()), a; !(a = i()).done && (r = n(), r !== 0););
|
|
168
|
+
return this.chosenFormat || this.resetFormat(), this.chosenFormat;
|
|
194
169
|
}
|
|
195
170
|
},
|
|
196
171
|
{
|
|
197
|
-
key: "
|
|
198
|
-
value: function() {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
{
|
|
204
|
-
key: "getNonFormattedNumber",
|
|
205
|
-
value: function() {
|
|
206
|
-
var e = this.state.nationalSignificantNumberIsModified;
|
|
207
|
-
return this.getFullNumber(e ? this.state.getNationalDigits() : this.getNonFormattedNationalNumberWithPrefix());
|
|
172
|
+
key: "createTemplateForFormat",
|
|
173
|
+
value: function(e, t) {
|
|
174
|
+
if (!(S && e.pattern().indexOf("|") >= 0)) {
|
|
175
|
+
var n = this.getTemplateForFormat(e, t);
|
|
176
|
+
if (n) return this.setNationalNumberTemplate(n, t), !0;
|
|
177
|
+
}
|
|
208
178
|
}
|
|
209
179
|
},
|
|
210
180
|
{
|
|
211
|
-
key: "
|
|
212
|
-
value: function() {
|
|
213
|
-
|
|
214
|
-
if (e) return e.replace(/[\+\d]/g, "x");
|
|
181
|
+
key: "getSeparatorAfterNationalPrefix",
|
|
182
|
+
value: function(e) {
|
|
183
|
+
return this.isNANP || e && e.nationalPrefixFormattingRule() && x.test(e.nationalPrefixFormattingRule()) ? " " : "";
|
|
215
184
|
}
|
|
216
185
|
},
|
|
217
186
|
{
|
|
218
|
-
key: "
|
|
219
|
-
value: function() {
|
|
220
|
-
var
|
|
221
|
-
return t && t.
|
|
187
|
+
key: "getInternationalPrefixBeforeCountryCallingCode",
|
|
188
|
+
value: function(e, t) {
|
|
189
|
+
var n = e.IDDPrefix, r = e.missingPlus;
|
|
190
|
+
return n ? t && t.spacing === !1 ? n : n + " " : r ? "" : "+";
|
|
222
191
|
}
|
|
223
192
|
},
|
|
224
193
|
{
|
|
225
|
-
key: "
|
|
226
|
-
value: function() {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}
|
|
194
|
+
key: "getTemplate",
|
|
195
|
+
value: function(e) {
|
|
196
|
+
if (this.template) {
|
|
197
|
+
for (var t = -1, n = 0, r = e.international ? this.getInternationalPrefixBeforeCountryCallingCode(e, { spacing: !1 }) : ""; n < r.length + e.getDigitsWithoutInternationalPrefix().length;) t = this.template.indexOf("x", t + 1), n++;
|
|
198
|
+
return i(this.template, t + 1);
|
|
199
|
+
}
|
|
231
200
|
}
|
|
232
201
|
},
|
|
233
202
|
{
|
|
234
|
-
key: "
|
|
235
|
-
value: function() {
|
|
236
|
-
|
|
237
|
-
if (t) {
|
|
238
|
-
if (this.isInternational()) return n ? "+" + n + i : "+" + t;
|
|
239
|
-
if (r || n) return "+" + (r ? this.metadata.countryCallingCode() : n) + i;
|
|
240
|
-
}
|
|
203
|
+
key: "setNationalNumberTemplate",
|
|
204
|
+
value: function(e, t) {
|
|
205
|
+
this.nationalNumberTemplate = e, this.populatedNationalNumberTemplate = e, this.populatedNationalNumberTemplatePosition = -1, t.international ? this.template = this.getInternationalPrefixBeforeCountryCallingCode(t).replace(/[\d\+]/g, "x") + o("x", t.callingCode.length) + " " + e : this.template = e;
|
|
241
206
|
}
|
|
242
207
|
},
|
|
243
208
|
{
|
|
244
|
-
key: "
|
|
245
|
-
value: function() {
|
|
246
|
-
var
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
209
|
+
key: "getTemplateForFormat",
|
|
210
|
+
value: function(e, i) {
|
|
211
|
+
var a = i.nationalSignificantNumber, s = i.international, c = i.nationalPrefix, l = i.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix, u = e.pattern();
|
|
212
|
+
/* istanbul ignore else */
|
|
213
|
+
S && (u = u.replace(C(), "\\d").replace(w(), "\\d"));
|
|
214
|
+
var d = b.match(u)[0];
|
|
215
|
+
if (!(a.length > d.length)) {
|
|
216
|
+
var f = RegExp("^" + u + "$"), p = a.replace(/\d/g, y);
|
|
217
|
+
f.test(p) && (d = p);
|
|
218
|
+
var m = this.getFormatFormat(e, s), h;
|
|
219
|
+
if (this.shouldTryNationalPrefixFormattingRule(e, {
|
|
220
|
+
international: s,
|
|
221
|
+
nationalPrefix: c
|
|
222
|
+
})) {
|
|
223
|
+
var g = m.replace(n, e.nationalPrefixFormattingRule());
|
|
224
|
+
/* istanbul ignore else */
|
|
225
|
+
if (r(e.nationalPrefixFormattingRule()) === (c || "") + r("$1") && (m = g, h = !0, c)) for (var _ = c.length; _ > 0;) m = m.replace(/\d/, "x"), _--;
|
|
259
226
|
}
|
|
260
|
-
var
|
|
261
|
-
return
|
|
227
|
+
var v = d.replace(new RegExp(u), m).replace(new RegExp(y, "g"), "x");
|
|
228
|
+
return h || (l ? v = o("x", l.length) + " " + v : c && (v = o("x", c.length) + this.getSeparatorAfterNationalPrefix(e) + v)), s && (v = t(v)), v;
|
|
262
229
|
}
|
|
263
230
|
}
|
|
264
231
|
},
|
|
265
232
|
{
|
|
266
|
-
key: "
|
|
267
|
-
value: function() {
|
|
268
|
-
var
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
value: function() {
|
|
275
|
-
var e = this.getNumber();
|
|
276
|
-
return e ? e.isValid() : !1;
|
|
277
|
-
}
|
|
278
|
-
},
|
|
279
|
-
{
|
|
280
|
-
key: "getNationalNumber",
|
|
281
|
-
value: function() {
|
|
282
|
-
return this.state.nationalSignificantNumber;
|
|
283
|
-
}
|
|
284
|
-
},
|
|
285
|
-
{
|
|
286
|
-
key: "getChars",
|
|
287
|
-
value: function() {
|
|
288
|
-
return (this.state.international ? "+" : "") + this.state.digits;
|
|
233
|
+
key: "formatNextNationalNumberDigits",
|
|
234
|
+
value: function(e) {
|
|
235
|
+
var t = a(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition, e);
|
|
236
|
+
if (!t) {
|
|
237
|
+
this.resetFormat();
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
return this.populatedNationalNumberTemplate = t[0], this.populatedNationalNumberTemplatePosition = t[1], i(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition + 1);
|
|
289
241
|
}
|
|
290
242
|
},
|
|
291
243
|
{
|
|
292
|
-
key: "
|
|
293
|
-
value: function() {
|
|
294
|
-
|
|
244
|
+
key: "shouldTryNationalPrefixFormattingRule",
|
|
245
|
+
value: function(e, t) {
|
|
246
|
+
var n = t.international, r = t.nationalPrefix;
|
|
247
|
+
if (e.nationalPrefixFormattingRule()) {
|
|
248
|
+
var i = e.usesNationalPrefix();
|
|
249
|
+
if (i && r || !i && !n) return !0;
|
|
250
|
+
}
|
|
295
251
|
}
|
|
296
252
|
}
|
|
297
253
|
]);
|
|
298
254
|
}();
|
|
299
255
|
//#endregion
|
|
300
|
-
export {
|
|
256
|
+
export { D as AsYouTypeFormatter };
|
|
301
257
|
|
|
302
258
|
//# sourceMappingURL=index289.js.map
|