bitboss-ui 0.2.8 → 0.2.10
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/index101.js +3 -3
- package/dist/index103.js +2 -2
- package/dist/index109.js +1 -1
- package/dist/index11.js +2 -2
- package/dist/index111.js +5 -5
- package/dist/index113.js +1 -1
- package/dist/index116.js +1 -1
- package/dist/index117.js +1 -1
- package/dist/index118.js +1 -1
- package/dist/index119.js +1 -1
- package/dist/index121.js +1 -1
- package/dist/index125.js +1 -1
- package/dist/index126.js +1 -1
- package/dist/index128.js +2 -2
- package/dist/index15.js +8 -8
- package/dist/index17.js +9 -9
- package/dist/index19.js +3 -3
- package/dist/index195.js +351 -2
- package/dist/index195.js.map +1 -1
- package/dist/index196.js +134 -2
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +5 -4
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +19 -3
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +2 -35
- package/dist/index199.js.map +1 -1
- package/dist/index200.js +2 -6
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +171 -336
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +23 -134
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +369 -5
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +3 -19
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +3 -2
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +16 -2
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +14 -184
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +20 -23
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +27 -367
- package/dist/index209.js.map +1 -1
- package/dist/index21.js +2 -2
- package/dist/index210.js +8 -3
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +3 -3
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +32 -232
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +6 -2
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +2 -10
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +4 -2
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +235 -16
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +10 -16
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +2 -20
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +2 -29
- package/dist/index219.js.map +1 -1
- package/dist/index220.js +2 -8
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +27 -8
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +12 -115
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +8 -27
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +115 -12
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +1 -1
- package/dist/index226.js +6 -4
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +2 -435
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +294 -88
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +2 -6
- package/dist/index229.js.map +1 -1
- package/dist/index23.js +1 -1
- package/dist/index230.js +2 -2
- package/dist/index231.js +116 -294
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +106 -2
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +224 -2
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +246 -105
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +2 -106
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +2 -200
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +2 -2
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +2 -2
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +2 -69
- package/dist/index239.js.map +1 -1
- package/dist/index240.js +4 -162
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +435 -2
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +83 -218
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +161 -257
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +2 -2
- package/dist/index245.js +69 -2
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +2 -2
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +200 -2
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +1 -1
- package/dist/index25.js +2 -2
- package/dist/index252.js +3 -2
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +2 -3
- package/dist/index253.js.map +1 -1
- package/dist/index29.js +3 -3
- package/dist/index31.js +6 -6
- package/dist/index33.js +2 -2
- package/dist/index35.js +2 -2
- package/dist/index47.js +1 -1
- package/dist/index49.js +1 -1
- package/dist/index65.js +5 -5
- package/dist/index69.js +2 -2
- package/dist/index72.js +1 -1
- package/dist/index75.js +1 -1
- package/dist/index79.js +4 -4
- package/dist/index8.js +64 -65
- package/dist/index8.js.map +1 -1
- package/dist/index81.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index201.js
CHANGED
|
@@ -1,354 +1,189 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const e = M(t);
|
|
20
|
-
if (!v(e))
|
|
21
|
-
return x(1);
|
|
22
|
-
const o = e.getBoundingClientRect(), {
|
|
23
|
-
width: i,
|
|
24
|
-
height: n,
|
|
25
|
-
$: c
|
|
26
|
-
} = j(e);
|
|
27
|
-
let s = (c ? A(o.width) : o.width) / i, r = (c ? A(o.height) : o.height) / n;
|
|
28
|
-
return (!s || !Number.isFinite(s)) && (s = 1), (!r || !Number.isFinite(r)) && (r = 1), {
|
|
29
|
-
x: s,
|
|
30
|
-
y: r
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
const et = /* @__PURE__ */ x(0);
|
|
34
|
-
function G(t) {
|
|
35
|
-
const e = E(t);
|
|
36
|
-
return !_() || !e.visualViewport ? et : {
|
|
37
|
-
x: e.visualViewport.offsetLeft,
|
|
38
|
-
y: e.visualViewport.offsetTop
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
function ot(t, e, o) {
|
|
42
|
-
return e === void 0 && (e = !1), !o || e && o !== E(t) ? !1 : e;
|
|
43
|
-
}
|
|
44
|
-
function O(t, e, o, i) {
|
|
45
|
-
e === void 0 && (e = !1), o === void 0 && (o = !1);
|
|
46
|
-
const n = t.getBoundingClientRect(), c = M(t);
|
|
47
|
-
let s = x(1);
|
|
48
|
-
e && (i ? y(i) && (s = L(i)) : s = L(t));
|
|
49
|
-
const r = ot(c, o, i) ? G(c) : x(0);
|
|
50
|
-
let l = (n.left + r.x) / s.x, f = (n.top + r.y) / s.y, p = n.width / s.x, d = n.height / s.y;
|
|
51
|
-
if (c) {
|
|
52
|
-
const w = E(c), a = i && y(i) ? E(i) : i;
|
|
53
|
-
let g = w.frameElement;
|
|
54
|
-
for (; g && i && a !== w; ) {
|
|
55
|
-
const h = L(g), R = g.getBoundingClientRect(), u = m(g), C = R.left + (g.clientLeft + parseFloat(u.paddingLeft)) * h.x, W = R.top + (g.clientTop + parseFloat(u.paddingTop)) * h.y;
|
|
56
|
-
l *= h.x, f *= h.y, p *= h.x, d *= h.y, l += C, f += W, g = E(g).frameElement;
|
|
57
|
-
}
|
|
1
|
+
/*! maska v2.1.10 | (c) Alexander Shabunevich | Released under the MIT license */
|
|
2
|
+
var W = Object.defineProperty, L = (a, t, e) => t in a ? W(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e, g = (a, t, e) => (L(a, typeof t != "symbol" ? t + "" : t, e), e);
|
|
3
|
+
const b = {
|
|
4
|
+
"#": { pattern: /[0-9]/ },
|
|
5
|
+
"@": { pattern: /[a-zA-Z]/ },
|
|
6
|
+
"*": { pattern: /[a-zA-Z0-9]/ }
|
|
7
|
+
};
|
|
8
|
+
class w {
|
|
9
|
+
constructor(t = {}) {
|
|
10
|
+
g(this, "opts", {}), g(this, "memo", /* @__PURE__ */ new Map());
|
|
11
|
+
const e = { ...t };
|
|
12
|
+
if (e.tokens != null) {
|
|
13
|
+
e.tokens = e.tokensReplace ? { ...e.tokens } : { ...b, ...e.tokens };
|
|
14
|
+
for (const s of Object.values(e.tokens))
|
|
15
|
+
typeof s.pattern == "string" && (s.pattern = new RegExp(s.pattern));
|
|
16
|
+
} else
|
|
17
|
+
e.tokens = b;
|
|
18
|
+
Array.isArray(e.mask) && (e.mask.length > 1 ? e.mask = [...e.mask].sort((s, n) => s.length - n.length) : e.mask = e.mask[0] ?? ""), e.mask === "" && (e.mask = null), this.opts = e;
|
|
58
19
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
height: d,
|
|
62
|
-
x: l,
|
|
63
|
-
y: f
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
function it(t) {
|
|
67
|
-
let {
|
|
68
|
-
rect: e,
|
|
69
|
-
offsetParent: o,
|
|
70
|
-
strategy: i
|
|
71
|
-
} = t;
|
|
72
|
-
const n = v(o), c = b(o);
|
|
73
|
-
if (o === c)
|
|
74
|
-
return e;
|
|
75
|
-
let s = {
|
|
76
|
-
scrollLeft: 0,
|
|
77
|
-
scrollTop: 0
|
|
78
|
-
}, r = x(1);
|
|
79
|
-
const l = x(0);
|
|
80
|
-
if ((n || !n && i !== "fixed") && ((F(o) !== "body" || z(c)) && (s = N(o)), v(o))) {
|
|
81
|
-
const f = O(o);
|
|
82
|
-
r = L(o), l.x = f.x + o.clientLeft, l.y = f.y + o.clientTop;
|
|
20
|
+
masked(t) {
|
|
21
|
+
return this.process(t, this.findMask(t));
|
|
83
22
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
height: e.height * r.y,
|
|
87
|
-
x: e.x * r.x - s.scrollLeft * r.x + l.x,
|
|
88
|
-
y: e.y * r.y - s.scrollTop * r.y + l.y
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
function nt(t) {
|
|
92
|
-
return Array.from(t.getClientRects());
|
|
93
|
-
}
|
|
94
|
-
function J(t) {
|
|
95
|
-
return O(b(t)).left + N(t).scrollLeft;
|
|
96
|
-
}
|
|
97
|
-
function st(t) {
|
|
98
|
-
const e = b(t), o = N(t), i = t.ownerDocument.body, n = T(e.scrollWidth, e.clientWidth, i.scrollWidth, i.clientWidth), c = T(e.scrollHeight, e.clientHeight, i.scrollHeight, i.clientHeight);
|
|
99
|
-
let s = -o.scrollLeft + J(t);
|
|
100
|
-
const r = -o.scrollTop;
|
|
101
|
-
return m(i).direction === "rtl" && (s += T(e.clientWidth, i.clientWidth) - n), {
|
|
102
|
-
width: n,
|
|
103
|
-
height: c,
|
|
104
|
-
x: s,
|
|
105
|
-
y: r
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
function rt(t, e) {
|
|
109
|
-
const o = E(t), i = b(t), n = o.visualViewport;
|
|
110
|
-
let c = i.clientWidth, s = i.clientHeight, r = 0, l = 0;
|
|
111
|
-
if (n) {
|
|
112
|
-
c = n.width, s = n.height;
|
|
113
|
-
const f = _();
|
|
114
|
-
(!f || f && e === "fixed") && (r = n.offsetLeft, l = n.offsetTop);
|
|
23
|
+
unmasked(t) {
|
|
24
|
+
return this.process(t, this.findMask(t), !1);
|
|
115
25
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
height: s,
|
|
119
|
-
x: r,
|
|
120
|
-
y: l
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
function ct(t, e) {
|
|
124
|
-
const o = O(t, !0, e === "fixed"), i = o.top + t.clientTop, n = o.left + t.clientLeft, c = v(t) ? L(t) : x(1), s = t.clientWidth * c.x, r = t.clientHeight * c.y, l = n * c.x, f = i * c.y;
|
|
125
|
-
return {
|
|
126
|
-
width: s,
|
|
127
|
-
height: r,
|
|
128
|
-
x: l,
|
|
129
|
-
y: f
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
function k(t, e, o) {
|
|
133
|
-
let i;
|
|
134
|
-
if (e === "viewport")
|
|
135
|
-
i = rt(t, o);
|
|
136
|
-
else if (e === "document")
|
|
137
|
-
i = st(b(t));
|
|
138
|
-
else if (y(e))
|
|
139
|
-
i = ct(e, o);
|
|
140
|
-
else {
|
|
141
|
-
const n = G(t);
|
|
142
|
-
i = {
|
|
143
|
-
...e,
|
|
144
|
-
x: e.x - n.x,
|
|
145
|
-
y: e.y - n.y
|
|
146
|
-
};
|
|
26
|
+
isEager() {
|
|
27
|
+
return this.opts.eager === !0;
|
|
147
28
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
function Q(t, e) {
|
|
151
|
-
const o = V(t);
|
|
152
|
-
return o === e || !y(o) || X(o) ? !1 : m(o).position === "fixed" || Q(o, e);
|
|
153
|
-
}
|
|
154
|
-
function lt(t, e) {
|
|
155
|
-
const o = e.get(t);
|
|
156
|
-
if (o)
|
|
157
|
-
return o;
|
|
158
|
-
let i = I(t, [], !1).filter((r) => y(r) && F(r) !== "body"), n = null;
|
|
159
|
-
const c = m(t).position === "fixed";
|
|
160
|
-
let s = c ? V(t) : t;
|
|
161
|
-
for (; y(s) && !X(s); ) {
|
|
162
|
-
const r = m(s), l = K(s);
|
|
163
|
-
!l && r.position === "fixed" && (n = null), (c ? !l && !n : !l && r.position === "static" && !!n && ["absolute", "fixed"].includes(n.position) || z(s) && !l && Q(t, s)) ? i = i.filter((p) => p !== s) : n = r, s = V(s);
|
|
29
|
+
isReversed() {
|
|
30
|
+
return this.opts.reversed === !0;
|
|
164
31
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
return o;
|
|
215
|
-
let i = q(t, e);
|
|
216
|
-
for (; i && P(i) && m(i).position === "static"; )
|
|
217
|
-
i = q(i, e);
|
|
218
|
-
return i && (F(i) === "html" || F(i) === "body" && m(i).position === "static" && !K(i)) ? o : i || tt(t) || o;
|
|
219
|
-
}
|
|
220
|
-
const at = async function(t) {
|
|
221
|
-
let {
|
|
222
|
-
reference: e,
|
|
223
|
-
floating: o,
|
|
224
|
-
strategy: i
|
|
225
|
-
} = t;
|
|
226
|
-
const n = this.getOffsetParent || Y, c = this.getDimensions;
|
|
227
|
-
return {
|
|
228
|
-
reference: ht(e, await n(o), i),
|
|
229
|
-
floating: {
|
|
230
|
-
x: 0,
|
|
231
|
-
y: 0,
|
|
232
|
-
...await c(o)
|
|
32
|
+
completed(t) {
|
|
33
|
+
const e = this.findMask(t);
|
|
34
|
+
if (this.opts.mask == null || e == null)
|
|
35
|
+
return !1;
|
|
36
|
+
const s = this.process(t, e).length;
|
|
37
|
+
return typeof this.opts.mask == "string" ? s >= this.opts.mask.length : typeof this.opts.mask == "function" ? s >= e.length : this.opts.mask.filter((n) => s >= n.length).length === this.opts.mask.length;
|
|
38
|
+
}
|
|
39
|
+
findMask(t) {
|
|
40
|
+
const e = this.opts.mask;
|
|
41
|
+
if (e == null)
|
|
42
|
+
return null;
|
|
43
|
+
if (typeof e == "string")
|
|
44
|
+
return e;
|
|
45
|
+
if (typeof e == "function")
|
|
46
|
+
return e(t);
|
|
47
|
+
const s = this.process(t, e.slice(-1).pop() ?? "", !1);
|
|
48
|
+
return e.find((n) => this.process(t, n, !1).length >= s.length) ?? "";
|
|
49
|
+
}
|
|
50
|
+
escapeMask(t) {
|
|
51
|
+
const e = [], s = [];
|
|
52
|
+
return t.split("").forEach((n, i) => {
|
|
53
|
+
n === "!" && t[i - 1] !== "!" ? s.push(i - s.length) : e.push(n);
|
|
54
|
+
}), { mask: e.join(""), escaped: s };
|
|
55
|
+
}
|
|
56
|
+
process(t, e, s = !0) {
|
|
57
|
+
var n;
|
|
58
|
+
if (e == null)
|
|
59
|
+
return t;
|
|
60
|
+
const i = `value=${t},mask=${e},masked=${s ? 1 : 0}`;
|
|
61
|
+
if (this.memo.has(i))
|
|
62
|
+
return this.memo.get(i);
|
|
63
|
+
const { mask: o, escaped: p } = this.escapeMask(e), h = [], k = this.opts.tokens != null ? this.opts.tokens : {}, l = this.isReversed() ? -1 : 1, c = this.isReversed() ? "unshift" : "push", v = this.isReversed() ? 0 : o.length - 1, S = this.isReversed() ? () => r > -1 && u > -1 : () => r < o.length && u < t.length, V = (m) => !this.isReversed() && m <= v || this.isReversed() && m >= v;
|
|
64
|
+
let y, f = -1, r = this.isReversed() ? o.length - 1 : 0, u = this.isReversed() ? t.length - 1 : 0;
|
|
65
|
+
for (; S(); ) {
|
|
66
|
+
const m = o.charAt(r), d = k[m], E = (d == null ? void 0 : d.transform) != null ? d.transform(t.charAt(u)) : t.charAt(u);
|
|
67
|
+
if (!p.includes(r) && d != null) {
|
|
68
|
+
if (E.match(d.pattern) != null)
|
|
69
|
+
h[c](E), d.repeated ? (f === -1 ? f = r : r === v && r !== f && (r = f - l), v === f && (r -= l)) : d.multiple && (r -= l), r += l;
|
|
70
|
+
else if (d.multiple) {
|
|
71
|
+
const P = ((n = h[u - l]) == null ? void 0 : n.match(d.pattern)) != null, R = o.charAt(r + l);
|
|
72
|
+
P && R !== "" && k[R] == null ? (r += l, u -= l) : h[c]("");
|
|
73
|
+
} else
|
|
74
|
+
E === y ? y = void 0 : d.optional && (r += l, u -= l);
|
|
75
|
+
u += l;
|
|
76
|
+
} else
|
|
77
|
+
s && !this.isEager() && h[c](m), E === m && !this.isEager() ? u += l : y = m, this.isEager() || (r += l);
|
|
78
|
+
if (this.isEager())
|
|
79
|
+
for (; V(r) && (k[o.charAt(r)] == null || p.includes(r)); )
|
|
80
|
+
s ? h[c](o.charAt(r)) : o.charAt(r) === t.charAt(u) && (u += l), r += l;
|
|
233
81
|
}
|
|
234
|
-
|
|
235
|
-
};
|
|
236
|
-
function dt(t) {
|
|
237
|
-
return m(t).direction === "rtl";
|
|
238
|
-
}
|
|
239
|
-
const gt = {
|
|
240
|
-
convertOffsetParentRelativeRectToViewportRelativeRect: it,
|
|
241
|
-
getDocumentElement: b,
|
|
242
|
-
getClippingRect: ft,
|
|
243
|
-
getOffsetParent: Y,
|
|
244
|
-
getElementRects: at,
|
|
245
|
-
getClientRects: nt,
|
|
246
|
-
getDimensions: ut,
|
|
247
|
-
getScale: L,
|
|
248
|
-
isElement: y,
|
|
249
|
-
isRTL: dt
|
|
250
|
-
};
|
|
251
|
-
function pt(t, e) {
|
|
252
|
-
let o = null, i;
|
|
253
|
-
const n = b(t);
|
|
254
|
-
function c() {
|
|
255
|
-
clearTimeout(i), o && o.disconnect(), o = null;
|
|
82
|
+
return this.memo.set(i, h.join("")), this.memo.get(i);
|
|
256
83
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
84
|
+
}
|
|
85
|
+
const T = (a) => JSON.parse(a.replaceAll("'", '"')), O = (a, t = {}) => {
|
|
86
|
+
const e = { ...t };
|
|
87
|
+
return a.dataset.maska != null && a.dataset.maska !== "" && (e.mask = j(a.dataset.maska)), a.dataset.maskaEager != null && (e.eager = M(a.dataset.maskaEager)), a.dataset.maskaReversed != null && (e.reversed = M(a.dataset.maskaReversed)), a.dataset.maskaTokensReplace != null && (e.tokensReplace = M(a.dataset.maskaTokensReplace)), a.dataset.maskaTokens != null && (e.tokens = C(a.dataset.maskaTokens)), e;
|
|
88
|
+
}, M = (a) => a !== "" ? !!JSON.parse(a) : !0, j = (a) => a.startsWith("[") && a.endsWith("]") ? T(a) : a, C = (a) => {
|
|
89
|
+
if (a.startsWith("{") && a.endsWith("}"))
|
|
90
|
+
return T(a);
|
|
91
|
+
const t = {};
|
|
92
|
+
return a.split("|").forEach((e) => {
|
|
93
|
+
const s = e.split(":");
|
|
94
|
+
t[s[0]] = {
|
|
95
|
+
pattern: new RegExp(s[1]),
|
|
96
|
+
optional: s[2] === "optional",
|
|
97
|
+
multiple: s[2] === "multiple",
|
|
98
|
+
repeated: s[2] === "repeated"
|
|
270
99
|
};
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
100
|
+
}), t;
|
|
101
|
+
};
|
|
102
|
+
class J {
|
|
103
|
+
constructor(t, e = {}) {
|
|
104
|
+
g(this, "items", /* @__PURE__ */ new Map()), g(this, "beforeinputEvent", (s) => {
|
|
105
|
+
const n = s.target, i = this.items.get(n);
|
|
106
|
+
i.isEager() && "inputType" in s && s.inputType.startsWith("delete") && i.unmasked(n.value).length <= 1 && this.setMaskedValue(n, "");
|
|
107
|
+
}), g(this, "inputEvent", (s) => {
|
|
108
|
+
if (s instanceof CustomEvent && s.type === "input" && s.detail != null && typeof s.detail == "object" && "masked" in s.detail)
|
|
109
|
+
return;
|
|
110
|
+
const n = s.target, i = this.items.get(n), o = n.value, p = n.selectionStart, h = n.selectionEnd;
|
|
111
|
+
let k = o;
|
|
112
|
+
if (i.isEager()) {
|
|
113
|
+
const l = i.masked(o), c = i.unmasked(o);
|
|
114
|
+
c === "" && "data" in s && s.data != null ? k = s.data : c !== i.unmasked(l) && (k = c);
|
|
280
115
|
}
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
116
|
+
if (this.setMaskedValue(n, k), "inputType" in s && (s.inputType.startsWith("delete") || p != null && p < o.length))
|
|
117
|
+
try {
|
|
118
|
+
n.setSelectionRange(p, h);
|
|
119
|
+
} catch {
|
|
120
|
+
}
|
|
121
|
+
}), this.options = e, typeof t == "string" ? this.init(
|
|
122
|
+
Array.from(document.querySelectorAll(t)),
|
|
123
|
+
this.getMaskOpts(e)
|
|
124
|
+
) : this.init(
|
|
125
|
+
"length" in t ? Array.from(t) : [t],
|
|
126
|
+
this.getMaskOpts(e)
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
destroy() {
|
|
130
|
+
for (const t of this.items.keys())
|
|
131
|
+
t.removeEventListener("input", this.inputEvent), t.removeEventListener("beforeinput", this.beforeinputEvent);
|
|
132
|
+
this.items.clear();
|
|
133
|
+
}
|
|
134
|
+
needUpdateOptions(t, e) {
|
|
135
|
+
const s = this.items.get(t), n = new w(O(t, this.getMaskOpts(e)));
|
|
136
|
+
return JSON.stringify(s.opts) !== JSON.stringify(n.opts);
|
|
137
|
+
}
|
|
138
|
+
needUpdateValue(t) {
|
|
139
|
+
const e = t.dataset.maskaValue;
|
|
140
|
+
return e == null && t.value !== "" || e != null && e !== t.value;
|
|
141
|
+
}
|
|
142
|
+
getMaskOpts(t) {
|
|
143
|
+
const { onMaska: e, preProcess: s, postProcess: n, ...i } = t;
|
|
144
|
+
return i;
|
|
145
|
+
}
|
|
146
|
+
init(t, e) {
|
|
147
|
+
for (const s of t) {
|
|
148
|
+
const n = new w(O(s, e));
|
|
149
|
+
this.items.set(s, n), s.value !== "" && this.setMaskedValue(s, s.value), s.addEventListener("input", this.inputEvent), s.addEventListener("beforeinput", this.beforeinputEvent);
|
|
291
150
|
}
|
|
292
|
-
o.observe(t);
|
|
293
151
|
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
ancestorScroll: n = !0,
|
|
300
|
-
ancestorResize: c = !0,
|
|
301
|
-
elementResize: s = typeof ResizeObserver == "function",
|
|
302
|
-
layoutShift: r = typeof IntersectionObserver == "function",
|
|
303
|
-
animationFrame: l = !1
|
|
304
|
-
} = i, f = M(t), p = n || c ? [...f ? I(f) : [], ...I(e)] : [];
|
|
305
|
-
p.forEach((u) => {
|
|
306
|
-
n && u.addEventListener("scroll", o, {
|
|
307
|
-
passive: !0
|
|
308
|
-
}), c && u.addEventListener("resize", o);
|
|
309
|
-
});
|
|
310
|
-
const d = f && r ? pt(f, o) : null;
|
|
311
|
-
let w = -1, a = null;
|
|
312
|
-
s && (a = new ResizeObserver((u) => {
|
|
313
|
-
let [C] = u;
|
|
314
|
-
C && C.target === f && a && (a.unobserve(e), cancelAnimationFrame(w), w = requestAnimationFrame(() => {
|
|
315
|
-
a && a.observe(e);
|
|
316
|
-
})), o();
|
|
317
|
-
}), f && !l && a.observe(f), a.observe(e));
|
|
318
|
-
let g, h = l ? O(t) : null;
|
|
319
|
-
l && R();
|
|
320
|
-
function R() {
|
|
321
|
-
const u = O(t);
|
|
322
|
-
h && (u.x !== h.x || u.y !== h.y || u.width !== h.width || u.height !== h.height) && o(), h = u, g = requestAnimationFrame(R);
|
|
152
|
+
setMaskedValue(t, e) {
|
|
153
|
+
const s = this.items.get(t);
|
|
154
|
+
this.options.preProcess != null && (e = this.options.preProcess(e));
|
|
155
|
+
const n = s.masked(e), i = s.unmasked(s.isEager() ? n : e), o = s.completed(e), p = { masked: n, unmasked: i, completed: o };
|
|
156
|
+
e = n, this.options.postProcess != null && (e = this.options.postProcess(e)), t.value = e, t.dataset.maskaValue = e, this.options.onMaska != null && (Array.isArray(this.options.onMaska) ? this.options.onMaska.forEach((h) => h(p)) : this.options.onMaska(p)), t.dispatchEvent(new CustomEvent("maska", { detail: p })), t.dispatchEvent(new CustomEvent("input", { detail: p }));
|
|
323
157
|
}
|
|
324
|
-
return o(), () => {
|
|
325
|
-
p.forEach((u) => {
|
|
326
|
-
n && u.removeEventListener("scroll", o), c && u.removeEventListener("resize", o);
|
|
327
|
-
}), d && d(), a && a.disconnect(), a = null, l && cancelAnimationFrame(g);
|
|
328
|
-
};
|
|
329
158
|
}
|
|
330
|
-
const
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
}, c = {
|
|
335
|
-
...n.platform,
|
|
336
|
-
_c: i
|
|
337
|
-
};
|
|
338
|
-
return Z(t, e, {
|
|
339
|
-
...n,
|
|
340
|
-
platform: c
|
|
159
|
+
const A = /* @__PURE__ */ new WeakMap(), N = (a) => {
|
|
160
|
+
setTimeout(() => {
|
|
161
|
+
var t;
|
|
162
|
+
((t = A.get(a)) == null ? void 0 : t.needUpdateValue(a)) === !0 && a.dispatchEvent(new CustomEvent("input"));
|
|
341
163
|
});
|
|
164
|
+
}, U = (a, t) => {
|
|
165
|
+
const e = a instanceof HTMLInputElement ? a : a.querySelector("input"), s = { ...t.arg };
|
|
166
|
+
if (e == null || (e == null ? void 0 : e.type) === "file")
|
|
167
|
+
return;
|
|
168
|
+
N(e);
|
|
169
|
+
const n = A.get(e);
|
|
170
|
+
if (n != null) {
|
|
171
|
+
if (!n.needUpdateOptions(e, s))
|
|
172
|
+
return;
|
|
173
|
+
n.destroy();
|
|
174
|
+
}
|
|
175
|
+
if (t.value != null) {
|
|
176
|
+
const i = t.value, o = (p) => {
|
|
177
|
+
i.masked = p.masked, i.unmasked = p.unmasked, i.completed = p.completed;
|
|
178
|
+
};
|
|
179
|
+
s.onMaska = s.onMaska == null ? o : Array.isArray(s.onMaska) ? [...s.onMaska, o] : [s.onMaska, o];
|
|
180
|
+
}
|
|
181
|
+
A.set(e, new J(e, s));
|
|
342
182
|
};
|
|
343
183
|
export {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
Ot as flip,
|
|
349
|
-
I as getOverflowAncestors,
|
|
350
|
-
Tt as offset,
|
|
351
|
-
gt as platform,
|
|
352
|
-
Lt as shift
|
|
184
|
+
w as Mask,
|
|
185
|
+
J as MaskInput,
|
|
186
|
+
b as tokens,
|
|
187
|
+
U as vMaska
|
|
353
188
|
};
|
|
354
189
|
//# sourceMappingURL=index201.js.map
|