@rpcbase/ui 0.178.0 → 0.180.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/index147.js +1 -1
- package/dist/index148.js +599 -40
- package/dist/index148.js.map +1 -1
- package/dist/index149.js +5 -205
- package/dist/index149.js.map +1 -1
- package/dist/index150.js +69 -22
- package/dist/index150.js.map +1 -1
- package/dist/index151.js +2 -25
- package/dist/index151.js.map +1 -1
- package/dist/index152.js +342 -378
- package/dist/index152.js.map +1 -1
- package/dist/index153.js +261 -5
- package/dist/index153.js.map +1 -1
- package/dist/index154.js +51 -59
- package/dist/index154.js.map +1 -1
- package/dist/index155.js +47 -2
- package/dist/index155.js.map +1 -1
- package/dist/index156.js +146 -340
- package/dist/index156.js.map +1 -1
- package/dist/index157.js +97 -249
- package/dist/index157.js.map +1 -1
- package/dist/index158.js +24 -60
- package/dist/index158.js.map +1 -1
- package/dist/index159.js +8 -47
- package/dist/index159.js.map +1 -1
- package/dist/index160.js +4 -169
- package/dist/index160.js.map +1 -1
- package/dist/index161.js +5 -109
- package/dist/index161.js.map +1 -1
- package/dist/index162.js +4 -24
- package/dist/index162.js.map +1 -1
- package/dist/index163.js +467 -8
- package/dist/index163.js.map +1 -1
- package/dist/index164.js +185 -4
- package/dist/index164.js.map +1 -1
- package/dist/index165.js +107 -5
- package/dist/index165.js.map +1 -1
- package/dist/index166.js +262 -4
- package/dist/index166.js.map +1 -1
- package/dist/index167.js +9 -466
- package/dist/index167.js.map +1 -1
- package/dist/index168.js +37 -180
- package/dist/index168.js.map +1 -1
- package/dist/index169.js +4 -107
- package/dist/index169.js.map +1 -1
- package/dist/index170.js +44 -260
- package/dist/index170.js.map +1 -1
- package/dist/index171.js +204 -8
- package/dist/index171.js.map +1 -1
- package/dist/index172.js +22 -43
- package/dist/index172.js.map +1 -1
- package/dist/index173.js +24 -4
- package/dist/index173.js.map +1 -1
- package/dist/index174.js +383 -589
- package/dist/index174.js.map +1 -1
- package/dist/index23.js +1 -1
- package/dist/index235.js +65 -22
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +179 -27
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +47 -5
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +1 -1
- package/dist/index240.js +1 -1
- package/dist/index241.js +1 -1
- package/dist/index242.js +1 -1
- package/dist/index243.js +1 -1
- package/dist/index244.js +4 -4
- package/dist/index245.js +2 -2
- package/dist/index247.js +1 -1
- package/dist/index250.js +1 -1
- package/dist/index252.js +4 -4
- package/dist/index253.js +1 -1
- package/dist/index256.js +2 -2
- package/dist/index257.js +1 -1
- package/dist/index258.js +1 -1
- package/dist/index259.js +1 -1
- package/dist/index260.js +17 -65
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +26 -178
- package/dist/index261.js.map +1 -1
- package/dist/index262.js +14 -44
- package/dist/index262.js.map +1 -1
- package/dist/index263.js +24 -19
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +29 -29
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +5 -17
- package/dist/index265.js.map +1 -1
- package/dist/index269.js +21 -5
- package/dist/index269.js.map +1 -1
- package/dist/index270.js +5 -3
- package/dist/index270.js.map +1 -1
- package/dist/index271.js +3 -24
- package/dist/index271.js.map +1 -1
- package/dist/index272.js +22 -111
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +111 -14
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +14 -523
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +511 -114
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +111 -117
- package/dist/index276.js.map +1 -1
- package/dist/index277.js +133 -20
- package/dist/index277.js.map +1 -1
- package/dist/index29.js +5 -5
- package/dist/index295.js +65 -69
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +68 -8
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +9 -14
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +14 -66
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +65 -64
- package/dist/index299.js.map +1 -1
- package/dist/index33.js +1 -1
- package/dist/index37.js +1 -1
- package/dist/index38.js +2 -2
- package/dist/index41.js +2 -2
- package/dist/index42.js +20 -20
- package/dist/index46.js +1 -1
- package/dist/index47.js +1 -1
- package/dist/index48.js +205 -7
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +6 -33
- package/dist/index49.js.map +1 -1
- package/dist/index50.js +33 -26
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +26 -7
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +7 -11
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +12 -205
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +5 -3
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +7 -47
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +5 -50
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +3 -7
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +47 -14
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +46 -129
- package/dist/index59.js.map +1 -1
- package/dist/index60.js +7 -10
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +13 -215
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +133 -12
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +10 -46
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +213 -46
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +13 -4
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +46 -5
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +50 -28
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +3 -49
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +6 -9
- package/dist/index69.js.map +1 -1
- package/dist/index70.js +28 -6
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +50 -8
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +9 -6
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +2 -54
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +2 -2
- package/dist/index75.js +54 -2
- package/dist/index75.js.map +1 -1
- package/package.json +1 -1
package/dist/index152.js
CHANGED
|
@@ -1,403 +1,367 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import g from "./index163.js";
|
|
2
|
+
import c from "./index164.js";
|
|
3
|
+
import y from "./index165.js";
|
|
4
|
+
import C from "./index153.js";
|
|
5
|
+
import b from "./index166.js";
|
|
6
|
+
import v from "./index167.js";
|
|
7
|
+
import p from "./index168.js";
|
|
8
|
+
import N from "./index169.js";
|
|
9
|
+
import { DIGIT_PLACEHOLDER as P } from "./index154.js";
|
|
10
|
+
function f(n) {
|
|
11
|
+
"@babel/helpers - typeof";
|
|
12
|
+
return f = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
13
|
+
return typeof e;
|
|
14
|
+
} : function(e) {
|
|
15
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
16
|
+
}, f(n);
|
|
13
17
|
}
|
|
14
|
-
function
|
|
15
|
-
return
|
|
18
|
+
function S(n, e) {
|
|
19
|
+
return A(n) || _(n, e) || k(n, e) || T();
|
|
16
20
|
}
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return y(1);
|
|
21
|
-
const o = e.getBoundingClientRect(), {
|
|
22
|
-
width: i,
|
|
23
|
-
height: n,
|
|
24
|
-
$: r
|
|
25
|
-
} = Z(e);
|
|
26
|
-
let s = (r ? D(o.width) : o.width) / i, c = (r ? D(o.height) : o.height) / n;
|
|
27
|
-
return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
|
|
28
|
-
x: s,
|
|
29
|
-
y: c
|
|
30
|
-
};
|
|
21
|
+
function T() {
|
|
22
|
+
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
23
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
31
24
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
y: e.visualViewport.offsetTop
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
function mt(t, e, o) {
|
|
41
|
-
return e === void 0 && (e = !1), !o || e && o !== L(t) ? !1 : e;
|
|
42
|
-
}
|
|
43
|
-
function T(t, e, o, i) {
|
|
44
|
-
e === void 0 && (e = !1), o === void 0 && (o = !1);
|
|
45
|
-
const n = t.getBoundingClientRect(), r = X(t);
|
|
46
|
-
let s = y(1);
|
|
47
|
-
e && (i ? v(i) && (s = F(i)) : s = F(t));
|
|
48
|
-
const c = mt(r, o, i) ? tt(r) : y(0);
|
|
49
|
-
let f = (n.left + c.x) / s.x, l = (n.top + c.y) / s.y, u = n.width / s.x, h = n.height / s.y;
|
|
50
|
-
if (r) {
|
|
51
|
-
const d = L(r), a = i && v(i) ? L(i) : i;
|
|
52
|
-
let m = d, p = U(m);
|
|
53
|
-
for (; p && i && a !== m; ) {
|
|
54
|
-
const w = F(p), g = p.getBoundingClientRect(), x = b(p), O = g.left + (p.clientLeft + parseFloat(x.paddingLeft)) * w.x, W = g.top + (p.clientTop + parseFloat(x.paddingTop)) * w.y;
|
|
55
|
-
f *= w.x, l *= w.y, u *= w.x, h *= w.y, f += O, l += W, m = L(p), p = U(m);
|
|
56
|
-
}
|
|
25
|
+
function k(n, e) {
|
|
26
|
+
if (n) {
|
|
27
|
+
if (typeof n == "string") return h(n, e);
|
|
28
|
+
var t = {}.toString.call(n).slice(8, -1);
|
|
29
|
+
return t === "Object" && n.constructor && (t = n.constructor.name), t === "Map" || t === "Set" ? Array.from(n) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? h(n, e) : void 0;
|
|
57
30
|
}
|
|
58
|
-
return J({
|
|
59
|
-
width: u,
|
|
60
|
-
height: h,
|
|
61
|
-
x: f,
|
|
62
|
-
y: l
|
|
63
|
-
});
|
|
64
31
|
}
|
|
65
|
-
function
|
|
66
|
-
|
|
67
|
-
|
|
32
|
+
function h(n, e) {
|
|
33
|
+
(e == null || e > n.length) && (e = n.length);
|
|
34
|
+
for (var t = 0, i = Array(e); t < e; t++) i[t] = n[t];
|
|
35
|
+
return i;
|
|
68
36
|
}
|
|
69
|
-
function
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
return o;
|
|
86
|
-
let f = {
|
|
87
|
-
scrollLeft: 0,
|
|
88
|
-
scrollTop: 0
|
|
89
|
-
}, l = y(1);
|
|
90
|
-
const u = y(0), h = C(i);
|
|
91
|
-
if ((h || !h && !r) && ((_(i) !== "body" || q(s)) && (f = H(i)), C(i))) {
|
|
92
|
-
const a = T(i);
|
|
93
|
-
l = F(i), u.x = a.x + i.clientLeft, u.y = a.y + i.clientTop;
|
|
37
|
+
function _(n, e) {
|
|
38
|
+
var t = n == null ? null : typeof Symbol < "u" && n[Symbol.iterator] || n["@@iterator"];
|
|
39
|
+
if (t != null) {
|
|
40
|
+
var i, a, o, r, u = [], l = !0, s = !1;
|
|
41
|
+
try {
|
|
42
|
+
if (o = (t = t.call(n)).next, e !== 0) for (; !(l = (i = o.call(t)).done) && (u.push(i.value), u.length !== e); l = !0) ;
|
|
43
|
+
} catch (d) {
|
|
44
|
+
s = !0, a = d;
|
|
45
|
+
} finally {
|
|
46
|
+
try {
|
|
47
|
+
if (!l && t.return != null && (r = t.return(), Object(r) !== r)) return;
|
|
48
|
+
} finally {
|
|
49
|
+
if (s) throw a;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return u;
|
|
94
53
|
}
|
|
95
|
-
const d = s && !h && !r ? et(s, f) : y(0);
|
|
96
|
-
return {
|
|
97
|
-
width: o.width * l.x,
|
|
98
|
-
height: o.height * l.y,
|
|
99
|
-
x: o.x * l.x - f.scrollLeft * l.x + u.x + d.x,
|
|
100
|
-
y: o.y * l.y - f.scrollTop * l.y + u.y + d.y
|
|
101
|
-
};
|
|
102
54
|
}
|
|
103
|
-
function
|
|
104
|
-
|
|
55
|
+
function A(n) {
|
|
56
|
+
if (Array.isArray(n)) return n;
|
|
105
57
|
}
|
|
106
|
-
function
|
|
107
|
-
|
|
108
|
-
let s = -o.scrollLeft + I(t);
|
|
109
|
-
const c = -o.scrollTop;
|
|
110
|
-
return b(i).direction === "rtl" && (s += E(e.clientWidth, i.clientWidth) - n), {
|
|
111
|
-
width: n,
|
|
112
|
-
height: r,
|
|
113
|
-
x: s,
|
|
114
|
-
y: c
|
|
115
|
-
};
|
|
58
|
+
function I(n, e) {
|
|
59
|
+
if (!(n instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
116
60
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
if (n) {
|
|
122
|
-
r = n.width, s = n.height;
|
|
123
|
-
const u = Y();
|
|
124
|
-
(!u || u && e === "fixed") && (c = n.offsetLeft, f = n.offsetTop);
|
|
61
|
+
function F(n, e) {
|
|
62
|
+
for (var t = 0; t < e.length; t++) {
|
|
63
|
+
var i = e[t];
|
|
64
|
+
i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(n, x(i.key), i);
|
|
125
65
|
}
|
|
126
|
-
const l = I(i);
|
|
127
|
-
if (l <= 0) {
|
|
128
|
-
const u = i.ownerDocument, h = u.body, d = getComputedStyle(h), a = u.compatMode === "CSS1Compat" && parseFloat(d.marginLeft) + parseFloat(d.marginRight) || 0, m = Math.abs(i.clientWidth - h.clientWidth - a);
|
|
129
|
-
m <= K && (r -= m);
|
|
130
|
-
} else l <= K && (r += l);
|
|
131
|
-
return {
|
|
132
|
-
width: r,
|
|
133
|
-
height: s,
|
|
134
|
-
x: c,
|
|
135
|
-
y: f
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
const bt = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
139
|
-
function Rt(t, e) {
|
|
140
|
-
const o = T(t, !0, e === "fixed"), i = o.top + t.clientTop, n = o.left + t.clientLeft, r = C(t) ? F(t) : y(1), s = t.clientWidth * r.x, c = t.clientHeight * r.y, f = n * r.x, l = i * r.y;
|
|
141
|
-
return {
|
|
142
|
-
width: s,
|
|
143
|
-
height: c,
|
|
144
|
-
x: f,
|
|
145
|
-
y: l
|
|
146
|
-
};
|
|
147
66
|
}
|
|
148
|
-
function
|
|
149
|
-
|
|
150
|
-
if (e === "viewport")
|
|
151
|
-
i = vt(t, o);
|
|
152
|
-
else if (e === "document")
|
|
153
|
-
i = xt(R(t));
|
|
154
|
-
else if (v(e))
|
|
155
|
-
i = Rt(e, o);
|
|
156
|
-
else {
|
|
157
|
-
const n = tt(t);
|
|
158
|
-
i = {
|
|
159
|
-
x: e.x - n.x,
|
|
160
|
-
y: e.y - n.y,
|
|
161
|
-
width: e.width,
|
|
162
|
-
height: e.height
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
return J(i);
|
|
67
|
+
function w(n, e, t) {
|
|
68
|
+
return e && F(n.prototype, e), Object.defineProperty(n, "prototype", { writable: !1 }), n;
|
|
166
69
|
}
|
|
167
|
-
function
|
|
168
|
-
|
|
169
|
-
return
|
|
70
|
+
function x(n) {
|
|
71
|
+
var e = j(n, "string");
|
|
72
|
+
return f(e) == "symbol" ? e : e + "";
|
|
170
73
|
}
|
|
171
|
-
function
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
for (; v(s) && !z(s); ) {
|
|
179
|
-
const c = b(s), f = Q(s);
|
|
180
|
-
!f && c.position === "fixed" && (n = null), (r ? !f && !n : !f && c.position === "static" && !!n && bt.has(n.position) || q(s) && !f && it(t, s)) ? i = i.filter((u) => u !== s) : n = c, s = S(s);
|
|
74
|
+
function j(n, e) {
|
|
75
|
+
if (f(n) != "object" || !n) return n;
|
|
76
|
+
var t = n[Symbol.toPrimitive];
|
|
77
|
+
if (t !== void 0) {
|
|
78
|
+
var i = t.call(n, e);
|
|
79
|
+
if (f(i) != "object") return i;
|
|
80
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
181
81
|
}
|
|
182
|
-
return
|
|
183
|
-
}
|
|
184
|
-
function Ot(t) {
|
|
185
|
-
let {
|
|
186
|
-
element: e,
|
|
187
|
-
boundary: o,
|
|
188
|
-
rootBoundary: i,
|
|
189
|
-
strategy: n
|
|
190
|
-
} = t;
|
|
191
|
-
const s = [...o === "clippingAncestors" ? V(e) ? [] : Ct(e, this._c) : [].concat(o), i], c = s[0], f = s.reduce((l, u) => {
|
|
192
|
-
const h = j(e, u, n);
|
|
193
|
-
return l.top = E(h.top, l.top), l.right = N(h.right, l.right), l.bottom = N(h.bottom, l.bottom), l.left = E(h.left, l.left), l;
|
|
194
|
-
}, j(e, c, n));
|
|
195
|
-
return {
|
|
196
|
-
width: f.right - f.left,
|
|
197
|
-
height: f.bottom - f.top,
|
|
198
|
-
x: f.left,
|
|
199
|
-
y: f.top
|
|
200
|
-
};
|
|
201
|
-
}
|
|
202
|
-
function Lt(t) {
|
|
203
|
-
const {
|
|
204
|
-
width: e,
|
|
205
|
-
height: o
|
|
206
|
-
} = Z(t);
|
|
207
|
-
return {
|
|
208
|
-
width: e,
|
|
209
|
-
height: o
|
|
210
|
-
};
|
|
82
|
+
return String(n);
|
|
211
83
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
};
|
|
218
|
-
const f = y(0);
|
|
219
|
-
function l() {
|
|
220
|
-
f.x = I(n);
|
|
84
|
+
var H = /* @__PURE__ */ (function() {
|
|
85
|
+
function n(e, t) {
|
|
86
|
+
I(this, n), this.metadata = new g(t);
|
|
87
|
+
var i = this.getCountryAndCallingCode(e), a = S(i, 2), o = a[0], r = a[1];
|
|
88
|
+
this.defaultCountry = o, this.defaultCallingCode = r, this.reset();
|
|
221
89
|
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
r && !i && n && l();
|
|
228
|
-
const u = n && !i && !r ? et(n, c) : y(0), h = s.left + c.scrollLeft - f.x - u.x, d = s.top + c.scrollTop - f.y - u.y;
|
|
229
|
-
return {
|
|
230
|
-
x: h,
|
|
231
|
-
y: d,
|
|
232
|
-
width: s.width,
|
|
233
|
-
height: s.height
|
|
234
|
-
};
|
|
235
|
-
}
|
|
236
|
-
function M(t) {
|
|
237
|
-
return b(t).position === "static";
|
|
238
|
-
}
|
|
239
|
-
function G(t, e) {
|
|
240
|
-
if (!C(t) || b(t).position === "fixed")
|
|
241
|
-
return null;
|
|
242
|
-
if (e)
|
|
243
|
-
return e(t);
|
|
244
|
-
let o = t.offsetParent;
|
|
245
|
-
return R(t) === o && (o = o.ownerDocument.body), o;
|
|
246
|
-
}
|
|
247
|
-
function ot(t, e) {
|
|
248
|
-
const o = L(t);
|
|
249
|
-
if (V(t))
|
|
250
|
-
return o;
|
|
251
|
-
if (!C(t)) {
|
|
252
|
-
let n = S(t);
|
|
253
|
-
for (; n && !z(n); ) {
|
|
254
|
-
if (v(n) && !M(n))
|
|
255
|
-
return n;
|
|
256
|
-
n = S(n);
|
|
90
|
+
return w(n, [{
|
|
91
|
+
key: "getCountryAndCallingCode",
|
|
92
|
+
value: function(t) {
|
|
93
|
+
var i, a;
|
|
94
|
+
return t && (N(t) ? (i = t.defaultCountry, a = t.defaultCallingCode) : i = t), i && !this.metadata.hasCountry(i) && (i = void 0), [i, a];
|
|
257
95
|
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
96
|
+
/**
|
|
97
|
+
* Inputs "next" phone number characters.
|
|
98
|
+
* @param {string} text
|
|
99
|
+
* @return {string} Formatted phone number characters that have been input so far.
|
|
100
|
+
*/
|
|
101
|
+
}, {
|
|
102
|
+
key: "input",
|
|
103
|
+
value: function(t) {
|
|
104
|
+
var i = this.parser.input(t, this.state), a = i.digits, o = i.justLeadingPlus;
|
|
105
|
+
if (o)
|
|
106
|
+
this.formattedOutput = "+";
|
|
107
|
+
else if (a) {
|
|
108
|
+
this.determineTheCountryIfNeeded(), this.state.nationalSignificantNumber && this.formatter.narrowDownMatchingFormats(this.state);
|
|
109
|
+
var r;
|
|
110
|
+
if (this.metadata.hasSelectedNumberingPlan() && (r = this.formatter.format(a, this.state)), r === void 0 && this.parser.reExtractNationalSignificantNumber(this.state)) {
|
|
111
|
+
this.determineTheCountryIfNeeded();
|
|
112
|
+
var u = this.state.getNationalDigits();
|
|
113
|
+
u && (r = this.formatter.format(u, this.state));
|
|
114
|
+
}
|
|
115
|
+
this.formattedOutput = r ? this.getFullNumber(r) : this.getNonFormattedNumber();
|
|
116
|
+
}
|
|
117
|
+
return this.formattedOutput;
|
|
274
118
|
}
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
function
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
119
|
+
}, {
|
|
120
|
+
key: "reset",
|
|
121
|
+
value: function() {
|
|
122
|
+
var t = this;
|
|
123
|
+
return this.state = new y({
|
|
124
|
+
onCountryChange: function(a) {
|
|
125
|
+
t.country = a;
|
|
126
|
+
},
|
|
127
|
+
onCallingCodeChange: function(a, o) {
|
|
128
|
+
t.metadata.selectNumberingPlan(o, a), t.formatter.reset(t.metadata.numberingPlan, t.state), t.parser.reset(t.metadata.numberingPlan);
|
|
129
|
+
}
|
|
130
|
+
}), this.formatter = new C({
|
|
131
|
+
state: this.state,
|
|
132
|
+
metadata: this.metadata
|
|
133
|
+
}), this.parser = new b({
|
|
134
|
+
defaultCountry: this.defaultCountry,
|
|
135
|
+
defaultCallingCode: this.defaultCallingCode,
|
|
136
|
+
metadata: this.metadata,
|
|
137
|
+
state: this.state,
|
|
138
|
+
onNationalSignificantNumberChange: function() {
|
|
139
|
+
t.determineTheCountryIfNeeded(), t.formatter.reset(t.metadata.numberingPlan, t.state);
|
|
140
|
+
}
|
|
141
|
+
}), this.state.reset({
|
|
142
|
+
country: this.defaultCountry,
|
|
143
|
+
callingCode: this.defaultCallingCode
|
|
144
|
+
}), this.formattedOutput = "", this;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Returns `true` if the phone number is being input in international format.
|
|
148
|
+
* In other words, returns `true` if and only if the parsed phone number starts with a `"+"`.
|
|
149
|
+
* @return {boolean}
|
|
150
|
+
*/
|
|
151
|
+
}, {
|
|
152
|
+
key: "isInternational",
|
|
153
|
+
value: function() {
|
|
154
|
+
return this.state.international;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Returns the "calling code" part of the phone number when it's being input
|
|
158
|
+
* in an international format.
|
|
159
|
+
* If no valid calling code has been entered so far, returns `undefined`.
|
|
160
|
+
* @return {string} [callingCode]
|
|
161
|
+
*/
|
|
162
|
+
}, {
|
|
163
|
+
key: "getCallingCode",
|
|
164
|
+
value: function() {
|
|
165
|
+
if (this.isInternational())
|
|
166
|
+
return this.state.callingCode;
|
|
167
|
+
}
|
|
168
|
+
// A legacy alias.
|
|
169
|
+
}, {
|
|
170
|
+
key: "getCountryCallingCode",
|
|
171
|
+
value: function() {
|
|
172
|
+
return this.getCallingCode();
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Returns a two-letter country code of the phone number.
|
|
176
|
+
* Returns `undefined` for "non-geographic" phone numbering plans.
|
|
177
|
+
* Returns `undefined` if no phone number has been input yet.
|
|
178
|
+
* @return {string} [country]
|
|
179
|
+
*/
|
|
180
|
+
}, {
|
|
181
|
+
key: "getCountry",
|
|
182
|
+
value: function() {
|
|
183
|
+
var t = this.state.digits;
|
|
184
|
+
if (t)
|
|
185
|
+
return this._getCountry();
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Returns a two-letter country code of the phone number.
|
|
189
|
+
* Returns `undefined` for "non-geographic" phone numbering plans.
|
|
190
|
+
* @return {string} [country]
|
|
191
|
+
*/
|
|
192
|
+
}, {
|
|
193
|
+
key: "_getCountry",
|
|
194
|
+
value: function() {
|
|
195
|
+
var t = this.state.country;
|
|
196
|
+
return t;
|
|
197
|
+
}
|
|
198
|
+
}, {
|
|
199
|
+
key: "determineTheCountryIfNeeded",
|
|
200
|
+
value: function() {
|
|
201
|
+
(!this.state.country || this.isCountryCallingCodeAmbiguous()) && this.determineTheCountry();
|
|
202
|
+
}
|
|
203
|
+
// Prepends `+CountryCode ` in case of an international phone number
|
|
204
|
+
}, {
|
|
205
|
+
key: "getFullNumber",
|
|
206
|
+
value: function(t) {
|
|
207
|
+
var i = this;
|
|
208
|
+
if (this.isInternational()) {
|
|
209
|
+
var a = function(u) {
|
|
210
|
+
return i.formatter.getInternationalPrefixBeforeCountryCallingCode(i.state, {
|
|
211
|
+
spacing: !!u
|
|
212
|
+
}) + u;
|
|
213
|
+
}, o = this.state.callingCode;
|
|
214
|
+
return a(o ? t ? "".concat(o, " ").concat(t) : o : "".concat(this.state.getDigitsWithoutInternationalPrefix()));
|
|
325
215
|
}
|
|
326
|
-
|
|
216
|
+
return t;
|
|
327
217
|
}
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
});
|
|
334
|
-
} catch {
|
|
335
|
-
o = new IntersectionObserver(k, O);
|
|
218
|
+
}, {
|
|
219
|
+
key: "getNonFormattedNationalNumberWithPrefix",
|
|
220
|
+
value: function() {
|
|
221
|
+
var t = this.state, i = t.nationalSignificantNumber, a = t.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix, o = t.nationalPrefix, r = i, u = a || o;
|
|
222
|
+
return u && (r = u + r), r;
|
|
336
223
|
}
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
224
|
+
}, {
|
|
225
|
+
key: "getNonFormattedNumber",
|
|
226
|
+
value: function() {
|
|
227
|
+
var t = this.state.nationalSignificantNumberIsModified;
|
|
228
|
+
return this.getFullNumber(t ? this.state.getNationalDigits() : this.getNonFormattedNationalNumberWithPrefix());
|
|
229
|
+
}
|
|
230
|
+
}, {
|
|
231
|
+
key: "getNonFormattedTemplate",
|
|
232
|
+
value: function() {
|
|
233
|
+
var t = this.getNonFormattedNumber();
|
|
234
|
+
if (t)
|
|
235
|
+
return t.replace(/[\+\d]/g, P);
|
|
236
|
+
}
|
|
237
|
+
}, {
|
|
238
|
+
key: "isCountryCallingCodeAmbiguous",
|
|
239
|
+
value: function() {
|
|
240
|
+
var t = this.state.callingCode, i = this.metadata.getCountryCodesForCallingCode(t);
|
|
241
|
+
return i && i.length > 1;
|
|
242
|
+
}
|
|
243
|
+
// Determines the exact country of the phone number
|
|
244
|
+
// entered so far based on the country phone code
|
|
245
|
+
// and the national phone number.
|
|
246
|
+
}, {
|
|
247
|
+
key: "determineTheCountry",
|
|
248
|
+
value: function() {
|
|
249
|
+
this.state.setCountry(v(this.isInternational() ? this.state.callingCode : this.defaultCallingCode, {
|
|
250
|
+
nationalNumber: this.state.nationalSignificantNumber,
|
|
251
|
+
metadata: this.metadata
|
|
252
|
+
}));
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Returns a E.164 phone number value for the user's input.
|
|
256
|
+
*
|
|
257
|
+
* For example, for country `"US"` and input `"(222) 333-4444"`
|
|
258
|
+
* it will return `"+12223334444"`.
|
|
259
|
+
*
|
|
260
|
+
* For international phone number input, it will also auto-correct
|
|
261
|
+
* some minor errors such as using a national prefix when writing
|
|
262
|
+
* an international phone number. For example, if the user inputs
|
|
263
|
+
* `"+44 0 7400 000000"` then it will return an auto-corrected
|
|
264
|
+
* `"+447400000000"` phone number value.
|
|
265
|
+
*
|
|
266
|
+
* Will return `undefined` if no digits have been input,
|
|
267
|
+
* or when inputting a phone number in national format and no
|
|
268
|
+
* default country or default "country calling code" have been set.
|
|
269
|
+
*
|
|
270
|
+
* @return {string} [value]
|
|
271
|
+
*/
|
|
272
|
+
}, {
|
|
273
|
+
key: "getNumberValue",
|
|
274
|
+
value: function() {
|
|
275
|
+
var t = this.state, i = t.digits, a = t.callingCode, o = t.country, r = t.nationalSignificantNumber;
|
|
276
|
+
if (i) {
|
|
277
|
+
if (this.isInternational())
|
|
278
|
+
return a ? "+" + a + r : "+" + i;
|
|
279
|
+
if (o || a) {
|
|
280
|
+
var u = o ? this.metadata.countryCallingCode() : a;
|
|
281
|
+
return "+" + u + r;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Returns an instance of `PhoneNumber` class.
|
|
287
|
+
* Will return `undefined` if no national (significant) number
|
|
288
|
+
* digits have been entered so far, or if no `defaultCountry` has been
|
|
289
|
+
* set and the user enters a phone number not in international format.
|
|
290
|
+
*/
|
|
291
|
+
}, {
|
|
292
|
+
key: "getNumber",
|
|
293
|
+
value: function() {
|
|
294
|
+
var t = this.state, i = t.nationalSignificantNumber, a = t.carrierCode, o = t.callingCode, r = this._getCountry();
|
|
295
|
+
if (i && !(!r && !o)) {
|
|
296
|
+
if (r && r === this.defaultCountry) {
|
|
297
|
+
var u = new g(this.metadata.metadata);
|
|
298
|
+
u.selectNumberingPlan(r);
|
|
299
|
+
var l = u.numberingPlan.callingCode(), s = this.metadata.getCountryCodesForCallingCode(l);
|
|
300
|
+
if (s.length > 1) {
|
|
301
|
+
var d = p(i, {
|
|
302
|
+
countries: s,
|
|
303
|
+
metadata: this.metadata.metadata
|
|
304
|
+
});
|
|
305
|
+
d && (r = d);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
var m = new c(r || o, i, this.metadata.metadata);
|
|
309
|
+
return a && (m.carrierCode = a), m;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Returns `true` if the phone number is "possible".
|
|
314
|
+
* Is just a shortcut for `PhoneNumber.isPossible()`.
|
|
315
|
+
* @return {boolean}
|
|
316
|
+
*/
|
|
317
|
+
}, {
|
|
318
|
+
key: "isPossible",
|
|
319
|
+
value: function() {
|
|
320
|
+
var t = this.getNumber();
|
|
321
|
+
return t ? t.isPossible() : !1;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Returns `true` if the phone number is "valid".
|
|
325
|
+
* Is just a shortcut for `PhoneNumber.isValid()`.
|
|
326
|
+
* @return {boolean}
|
|
327
|
+
*/
|
|
328
|
+
}, {
|
|
329
|
+
key: "isValid",
|
|
330
|
+
value: function() {
|
|
331
|
+
var t = this.getNumber();
|
|
332
|
+
return t ? t.isValid() : !1;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* @deprecated
|
|
336
|
+
* This method is used in `react-phone-number-input/source/input-control.js`
|
|
337
|
+
* in versions before `3.0.16`.
|
|
338
|
+
*/
|
|
339
|
+
}, {
|
|
340
|
+
key: "getNationalNumber",
|
|
341
|
+
value: function() {
|
|
342
|
+
return this.state.nationalSignificantNumber;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Returns the phone number characters entered by the user.
|
|
346
|
+
* @return {string}
|
|
347
|
+
*/
|
|
348
|
+
}, {
|
|
349
|
+
key: "getChars",
|
|
350
|
+
value: function() {
|
|
351
|
+
return (this.state.international ? "+" : "") + this.state.digits;
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Returns the template for the formatted phone number.
|
|
355
|
+
* @return {string}
|
|
356
|
+
*/
|
|
357
|
+
}, {
|
|
358
|
+
key: "getTemplate",
|
|
359
|
+
value: function() {
|
|
360
|
+
return this.formatter.getTemplate(this.state) || this.getNonFormattedTemplate() || "";
|
|
361
|
+
}
|
|
362
|
+
}]);
|
|
363
|
+
})();
|
|
390
364
|
export {
|
|
391
|
-
|
|
392
|
-
zt as autoUpdate,
|
|
393
|
-
qt as computePosition,
|
|
394
|
-
Mt as flip,
|
|
395
|
-
$ as getOverflowAncestors,
|
|
396
|
-
$t as hide,
|
|
397
|
-
_t as limitShift,
|
|
398
|
-
Ht as offset,
|
|
399
|
-
St as platform,
|
|
400
|
-
It as shift,
|
|
401
|
-
Nt as size
|
|
365
|
+
H as default
|
|
402
366
|
};
|
|
403
367
|
//# sourceMappingURL=index152.js.map
|