bitboss-ui 2.1.110 → 2.1.111
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/composables/useConfirm.d.ts +3 -3
- package/dist/composables/useToast.d.ts +2 -2
- package/dist/composables/useWizard.d.ts +3 -0
- package/dist/index.d.ts +2 -2
- package/dist/index109.js +9 -9
- package/dist/index110.js +17 -17
- package/dist/index124.js +4 -4
- package/dist/index126.js +13 -13
- package/dist/index134.js +1 -1
- package/dist/index136.js +5 -5
- package/dist/index138.js +1 -1
- package/dist/index14.js +1 -1
- package/dist/index140.js +2 -2
- package/dist/index143.js +1 -1
- package/dist/index147.js +1 -1
- package/dist/index16.js +3 -3
- package/dist/index18.js +2 -2
- package/dist/index20.js +8 -8
- package/dist/index22.js +14 -14
- package/dist/index222.js +2 -2
- package/dist/index223.js +2 -2
- package/dist/index224.js +1 -1
- package/dist/index225.js +1 -1
- package/dist/index226.js +32 -3
- package/dist/index227.js +27 -12
- package/dist/index229.js +7 -2
- package/dist/index230.js +2 -2
- package/dist/index232.js +4 -9
- package/dist/index233.js +2 -13
- package/dist/index234.js +2 -135
- package/dist/index235.js +15 -0
- package/dist/index236.js +33 -23
- package/dist/index237.js +3 -4
- package/dist/index238.js +7 -22
- package/dist/index239.js +6 -4
- package/dist/index24.js +10 -10
- package/dist/index240.js +15 -85
- package/dist/index241.js +5 -0
- package/dist/index242.js +11 -28
- package/dist/index243.js +135 -18
- package/dist/index245.js +4 -51
- package/dist/index246.js +22 -17
- package/dist/index247.js +5 -3
- package/dist/index248.js +5 -12
- package/dist/index249.js +5 -5
- package/dist/index250.js +5 -5
- package/dist/index251.js +2 -5
- package/dist/index252.js +6 -5
- package/dist/index253.js +268 -2
- package/dist/index254.js +52 -6
- package/dist/index255.js +50 -6
- package/dist/index256.js +27 -263
- package/dist/index257.js +51 -43
- package/dist/index258.js +7 -50
- package/dist/index259.js +20 -31
- package/dist/index26.js +3 -3
- package/dist/index260.js +30 -60
- package/dist/index261.js +18 -34
- package/dist/index262.js +17 -3
- package/dist/index263.js +51 -2
- package/dist/index264.js +12 -2
- package/dist/index265.js +52 -6
- package/dist/index266.js +10 -7
- package/dist/index267.js +2 -6
- package/dist/index268.js +3 -33
- package/dist/index269.js +84 -26
- package/dist/index271.js +18 -9
- package/dist/index272.js +371 -19
- package/dist/index274.js +3 -8
- package/dist/index275.js +18 -31
- package/dist/index276.js +5 -25
- package/dist/index277.js +5 -3
- package/dist/index278.js +5 -18
- package/dist/index279.js +3 -12
- package/dist/index28.js +1 -1
- package/dist/index280.js +5 -106
- package/dist/index281.js +13 -0
- package/dist/index282.js +17 -99
- package/dist/index283.js +14 -0
- package/dist/index284.js +2 -2
- package/dist/index285.js +6 -11
- package/dist/index286.js +105 -187
- package/dist/index288.js +100 -3
- package/dist/index290.js +183 -368
- package/dist/{index287.js → index291.js} +1 -1
- package/dist/index292.js +9 -6
- package/dist/index293.js +23 -5
- package/dist/index294.js +34 -5
- package/dist/index295.js +3 -5
- package/dist/index296.js +2 -5
- package/dist/index297.js +6 -9
- package/dist/index298.js +7 -3
- package/dist/index299.js +9 -67
- package/dist/index30.js +3 -3
- package/dist/index300.js +67 -3
- package/dist/index301.js +13 -6
- package/dist/index302.js +25 -16
- package/dist/index304.js +5 -0
- package/dist/index305.js +4 -3
- package/dist/index306.js +719 -3
- package/dist/index307.js +365 -3
- package/dist/index308.js +57 -2
- package/dist/index317.js +1 -1
- package/dist/index318.js +1 -1
- package/dist/index319.js +1 -1
- package/dist/index32.js +1 -1
- package/dist/index320.js +1 -1
- package/dist/index322.js +1 -1
- package/dist/index323.js +7 -17
- package/dist/index324.js +5 -3
- package/dist/index325.js +3 -4
- package/dist/index326.js +17 -3
- package/dist/index327.js +1 -1
- package/dist/index328.js +3 -2
- package/dist/index329.js +2 -5
- package/dist/index330.js +3 -5
- package/dist/index331.js +125 -3
- package/dist/index332.js +2 -125
- package/dist/index333.js +15 -2
- package/dist/index334.js +2 -15
- package/dist/index335.js +19 -2
- package/dist/index336.js +2 -19
- package/dist/index337.js +3 -2
- package/dist/index338.js +3 -5
- package/dist/index339.js +1 -1
- package/dist/index34.js +8 -8
- package/dist/index340.js +2 -7
- package/dist/index341.js +5 -5
- package/dist/index342.js +6 -719
- package/dist/index343.js +7 -366
- package/dist/index344.js +5 -57
- package/dist/index350.js +1 -1
- package/dist/index351.js +1 -1
- package/dist/index352.js +227 -66
- package/dist/index353.js +40 -40
- package/dist/index354.js +65 -198
- package/dist/index355.js +149 -208
- package/dist/index356.js +257 -226
- package/dist/index36.js +3 -3
- package/dist/index360.js +1 -1
- package/dist/index361.js +1 -1
- package/dist/index362.js +1 -1
- package/dist/index366.js +1 -1
- package/dist/index38.js +19 -19
- package/dist/index40.js +6 -6
- package/dist/index42.js +1 -1
- package/dist/index44.js +8 -8
- package/dist/index46.js +6 -6
- package/dist/index50.js +2 -2
- package/dist/index54.js +1 -1
- package/dist/index58.js +1 -1
- package/dist/index60.js +2 -2
- package/dist/index62.js +5 -5
- package/dist/index68.js +1 -1
- package/dist/index74.js +4 -4
- package/dist/index82.js +6 -6
- package/dist/index84.js +1 -1
- package/dist/index86.js +2 -2
- package/dist/index88.js +2 -2
- package/dist/index90.js +1 -1
- package/dist/index93.js +3 -3
- package/dist/index95.js +2 -2
- package/dist/index97.js +5 -5
- package/dist/index99.js +1 -1
- package/package.json +1 -1
- package/dist/index228.js +0 -22
- package/dist/index244.js +0 -19
- package/dist/index273.js +0 -55
- package/dist/index289.js +0 -15
- package/dist/index303.js +0 -9
package/dist/index290.js
CHANGED
|
@@ -1,375 +1,190 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
},
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
parseInt(a.slice(4, 6), 16),
|
|
43
|
-
1
|
|
44
|
-
] : a.length === 8 ? [
|
|
45
|
-
parseInt(a.slice(0, 2), 16),
|
|
46
|
-
parseInt(a.slice(2, 4), 16),
|
|
47
|
-
parseInt(a.slice(4, 6), 16),
|
|
48
|
-
parseInt(a.slice(6, 8), 16) / 255
|
|
49
|
-
] : [0, 0, 0, 1];
|
|
50
|
-
}
|
|
51
|
-
function F(e) {
|
|
52
|
-
return Math.round(Math.max(0, Math.min(255, e))).toString(16).padStart(2, "0");
|
|
53
|
-
}
|
|
54
|
-
function ie(e, a, t, n, r) {
|
|
55
|
-
const l = `#${F(e)}${F(a)}${F(t)}`;
|
|
56
|
-
return r ? l + F(n * 255) : l;
|
|
57
|
-
}
|
|
58
|
-
const ce = [
|
|
59
|
-
["#FFCDD2", "#EF9A9A", "#F44336", "#D32F2F", "#B71C1C"],
|
|
60
|
-
// Red
|
|
61
|
-
["#FFE0B2", "#FFCC80", "#FF9800", "#F57C00", "#E65100"],
|
|
62
|
-
// Orange
|
|
63
|
-
["#FFF9C4", "#FFF59D", "#FFEB3B", "#FBC02D", "#F57F17"],
|
|
64
|
-
// Yellow
|
|
65
|
-
["#C8E6C9", "#A5D6A7", "#4CAF50", "#388E3C", "#1B5E20"],
|
|
66
|
-
// Green
|
|
67
|
-
["#BBDEFB", "#90CAF9", "#2196F3", "#1976D2", "#0D47A1"],
|
|
68
|
-
// Blue
|
|
69
|
-
["#E1BEE7", "#CE93D8", "#9C27B0", "#7B1FA2", "#4A148C"]
|
|
70
|
-
// Purple
|
|
71
|
-
], o = le, ue = se, { t: M } = $e(), i = c(0), v = c(1), p = c(1), h = c(1), S = L(() => {
|
|
72
|
-
const [e, a, t] = k(i.value, v.value, p.value);
|
|
73
|
-
return ie(e, a, t, h.value, o.alpha);
|
|
74
|
-
}), ve = L(() => {
|
|
75
|
-
const [e, a, t] = k(i.value, v.value, p.value);
|
|
76
|
-
return o.alpha ? `rgba(${e},${a},${t},${h.value})` : `rgb(${e},${a},${t})`;
|
|
77
|
-
}), pe = L(() => !!o.swatches), he = L(
|
|
78
|
-
() => Array.isArray(o.swatches) ? o.swatches : ce
|
|
79
|
-
), z = c(null), m = c(null), B = c(null), D = c(null), P = c(null), A = c(null), x = c(null), C = () => {
|
|
80
|
-
const e = m.value;
|
|
81
|
-
if (!e || e.width === 0 || e.height === 0) return;
|
|
82
|
-
const a = e.getContext("2d");
|
|
83
|
-
if (!a) return;
|
|
84
|
-
const [t, n, r] = k(i.value, 1, 1), l = a.createLinearGradient(0, 0, e.width, 0);
|
|
85
|
-
l.addColorStop(0, "#ffffff"), l.addColorStop(1, `rgb(${t},${n},${r})`), a.fillStyle = l, a.fillRect(0, 0, e.width, e.height);
|
|
86
|
-
const s = a.createLinearGradient(0, 0, 0, e.height);
|
|
87
|
-
s.addColorStop(0, "rgba(0,0,0,0)"), s.addColorStop(1, "rgba(0,0,0,1)"), a.fillStyle = s, a.fillRect(0, 0, e.width, e.height);
|
|
88
|
-
}, de = () => {
|
|
89
|
-
const e = B.value;
|
|
90
|
-
if (!e || e.width === 0 || e.height === 0) return;
|
|
91
|
-
const a = e.getContext("2d");
|
|
92
|
-
if (!a) return;
|
|
93
|
-
const t = a.createLinearGradient(0, 0, e.width, 0);
|
|
94
|
-
for (let n = 0; n <= 6; n++)
|
|
95
|
-
t.addColorStop(n / 6, `hsl(${n * 60},100%,50%)`);
|
|
96
|
-
a.fillStyle = t, a.fillRect(0, 0, e.width, e.height);
|
|
97
|
-
}, f = () => {
|
|
98
|
-
const e = D.value;
|
|
99
|
-
if (!e || e.width === 0 || e.height === 0) return;
|
|
100
|
-
const a = e.getContext("2d");
|
|
101
|
-
if (!a) return;
|
|
102
|
-
a.clearRect(0, 0, e.width, e.height);
|
|
103
|
-
const [t, n, r] = k(i.value, v.value, p.value), l = a.createLinearGradient(0, 0, e.width, 0);
|
|
104
|
-
l.addColorStop(0, `rgba(${t},${n},${r},0)`), l.addColorStop(1, `rgba(${t},${n},${r},1)`), a.fillStyle = l, a.fillRect(0, 0, e.width, e.height);
|
|
105
|
-
}, fe = () => {
|
|
106
|
-
C(), de(), o.alpha && f();
|
|
107
|
-
};
|
|
108
|
-
let I = null;
|
|
109
|
-
const E = (e) => {
|
|
110
|
-
e.width = e.offsetWidth, e.height = e.offsetHeight;
|
|
111
|
-
}, X = () => {
|
|
112
|
-
const e = m.value, a = B.value;
|
|
113
|
-
!e || !a || e.offsetWidth === 0 || (E(e), E(a), o.alpha && D.value && E(D.value), fe());
|
|
1
|
+
var C = Object.defineProperty, x = (a, e, t) => e in a ? C(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t, y = (a, e, t) => x(a, typeof e != "symbol" ? e + "" : e, t);
|
|
2
|
+
const M = {
|
|
3
|
+
"#": { pattern: /[0-9]/ },
|
|
4
|
+
"@": { pattern: /[a-zA-Z]/ },
|
|
5
|
+
"*": { pattern: /[a-zA-Z0-9]/ }
|
|
6
|
+
}, w = (a, e, t) => a.replaceAll(e, "").replace(t, ".").replace("..", ".").replace(/[^.\d]/g, ""), N = (a, e, t) => {
|
|
7
|
+
var s;
|
|
8
|
+
return new Intl.NumberFormat(((s = t.number) == null ? void 0 : s.locale) ?? "en", {
|
|
9
|
+
minimumFractionDigits: a,
|
|
10
|
+
maximumFractionDigits: e,
|
|
11
|
+
roundingMode: "trunc"
|
|
12
|
+
});
|
|
13
|
+
}, P = (a, e = !0, t) => {
|
|
14
|
+
var s, r, n, l;
|
|
15
|
+
const u = ((s = t.number) == null ? void 0 : s.unsigned) !== !0 && a.startsWith("-") ? "-" : "", p = ((r = t.number) == null ? void 0 : r.fraction) ?? 0;
|
|
16
|
+
let o = N(0, p, t);
|
|
17
|
+
const k = o.formatToParts(1000.12), m = ((n = k.find((i) => i.type === "group")) == null ? void 0 : n.value) ?? " ", f = ((l = k.find((i) => i.type === "decimal")) == null ? void 0 : l.value) ?? ".", c = w(a, m, f);
|
|
18
|
+
if (Number.isNaN(parseFloat(c))) return u;
|
|
19
|
+
const v = c.split(".");
|
|
20
|
+
if (v[1] != null && v[1].length >= 1) {
|
|
21
|
+
const i = v[1].length <= p ? v[1].length : p;
|
|
22
|
+
o = N(i, p, t);
|
|
23
|
+
}
|
|
24
|
+
let d = o.format(parseFloat(c));
|
|
25
|
+
return e ? p > 0 && c.endsWith(".") && !c.slice(0, -1).includes(".") && (d += f) : d = w(d, m, f), u + d;
|
|
26
|
+
}, I = (a) => JSON.parse(a.replaceAll("'", '"')), T = (a, e = {}) => {
|
|
27
|
+
const t = { ...e };
|
|
28
|
+
a.dataset.maska != null && a.dataset.maska !== "" && (t.mask = F(a.dataset.maska)), a.dataset.maskaEager != null && (t.eager = E(a.dataset.maskaEager)), a.dataset.maskaReversed != null && (t.reversed = E(a.dataset.maskaReversed)), a.dataset.maskaTokensReplace != null && (t.tokensReplace = E(a.dataset.maskaTokensReplace)), a.dataset.maskaTokens != null && (t.tokens = O(a.dataset.maskaTokens));
|
|
29
|
+
const s = {};
|
|
30
|
+
return a.dataset.maskaNumberLocale != null && (s.locale = a.dataset.maskaNumberLocale), a.dataset.maskaNumberFraction != null && (s.fraction = parseInt(a.dataset.maskaNumberFraction)), a.dataset.maskaNumberUnsigned != null && (s.unsigned = E(a.dataset.maskaNumberUnsigned)), (a.dataset.maskaNumber != null || Object.values(s).length > 0) && (t.number = s), t;
|
|
31
|
+
}, E = (a) => a !== "" ? !!JSON.parse(a) : !0, F = (a) => a.startsWith("[") && a.endsWith("]") ? I(a) : a, O = (a) => {
|
|
32
|
+
if (a.startsWith("{") && a.endsWith("}"))
|
|
33
|
+
return I(a);
|
|
34
|
+
const e = {};
|
|
35
|
+
return a.split("|").forEach((t) => {
|
|
36
|
+
const s = t.split(":");
|
|
37
|
+
e[s[0]] = {
|
|
38
|
+
pattern: S() ? new RegExp(s[1], "u") : new RegExp(s[1]),
|
|
39
|
+
optional: s[2] === "optional",
|
|
40
|
+
multiple: s[2] === "multiple",
|
|
41
|
+
repeated: s[2] === "repeated"
|
|
114
42
|
};
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
43
|
+
}), e;
|
|
44
|
+
}, S = () => {
|
|
45
|
+
try {
|
|
46
|
+
return new RegExp("\\p{L}", "u"), !0;
|
|
47
|
+
} catch {
|
|
48
|
+
return !1;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
class W {
|
|
52
|
+
constructor(e = {}) {
|
|
53
|
+
y(this, "opts", {}), y(this, "memo", /* @__PURE__ */ new Map());
|
|
54
|
+
const t = { ...e };
|
|
55
|
+
if (t.tokens != null) {
|
|
56
|
+
t.tokens = t.tokensReplace ? { ...t.tokens } : { ...M, ...t.tokens };
|
|
57
|
+
for (const s of Object.values(t.tokens))
|
|
58
|
+
typeof s.pattern == "string" && (s.pattern = S() ? new RegExp(s.pattern, "u") : new RegExp(s.pattern));
|
|
59
|
+
} else
|
|
60
|
+
t.tokens = M;
|
|
61
|
+
Array.isArray(t.mask) && (t.mask.length > 1 ? t.mask = [...t.mask].sort((s, r) => s.length - r.length) : t.mask = t.mask[0] ?? ""), t.mask === "" && (t.mask = null), this.opts = t;
|
|
62
|
+
}
|
|
63
|
+
masked(e) {
|
|
64
|
+
return this.process(String(e), this.findMask(String(e)));
|
|
65
|
+
}
|
|
66
|
+
unmasked(e) {
|
|
67
|
+
return this.process(String(e), this.findMask(String(e)), !1);
|
|
68
|
+
}
|
|
69
|
+
isEager() {
|
|
70
|
+
return this.opts.eager === !0;
|
|
71
|
+
}
|
|
72
|
+
isReversed() {
|
|
73
|
+
return this.opts.reversed === !0;
|
|
74
|
+
}
|
|
75
|
+
completed(e) {
|
|
76
|
+
const t = this.findMask(String(e));
|
|
77
|
+
if (this.opts.mask == null || t == null) return !1;
|
|
78
|
+
const s = this.process(String(e), t).length;
|
|
79
|
+
return typeof this.opts.mask == "string" ? s >= this.opts.mask.length : s >= t.length;
|
|
80
|
+
}
|
|
81
|
+
findMask(e) {
|
|
82
|
+
const t = this.opts.mask;
|
|
83
|
+
if (t == null)
|
|
84
|
+
return null;
|
|
85
|
+
if (typeof t == "string")
|
|
86
|
+
return t;
|
|
87
|
+
if (typeof t == "function")
|
|
88
|
+
return t(e);
|
|
89
|
+
const s = this.process(e, t.slice(-1).pop() ?? "", !1);
|
|
90
|
+
return t.find((r) => this.process(e, r, !1).length >= s.length) ?? "";
|
|
91
|
+
}
|
|
92
|
+
escapeMask(e) {
|
|
93
|
+
const t = [], s = [];
|
|
94
|
+
return e.split("").forEach((r, n) => {
|
|
95
|
+
r === "!" && e[n - 1] !== "!" ? s.push(n - s.length) : t.push(r);
|
|
96
|
+
}), { mask: t.join(""), escaped: s };
|
|
97
|
+
}
|
|
98
|
+
process(e, t, s = !0) {
|
|
99
|
+
if (this.opts.number != null) return P(e, s, this.opts);
|
|
100
|
+
if (t == null) return e;
|
|
101
|
+
const r = `v=${e},mr=${t},m=${s ? 1 : 0}`;
|
|
102
|
+
if (this.memo.has(r)) return this.memo.get(r);
|
|
103
|
+
const { mask: n, escaped: l } = this.escapeMask(t), u = [], p = this.opts.tokens != null ? this.opts.tokens : {}, o = this.isReversed() ? -1 : 1, k = this.isReversed() ? "unshift" : "push", m = this.isReversed() ? 0 : n.length - 1, f = this.isReversed() ? () => i > -1 && h > -1 : () => i < n.length && h < e.length, c = (b) => !this.isReversed() && b <= m || this.isReversed() && b >= m;
|
|
104
|
+
let v, d = -1, i = this.isReversed() ? n.length - 1 : 0, h = this.isReversed() ? e.length - 1 : 0, R = !1;
|
|
105
|
+
for (; f(); ) {
|
|
106
|
+
const b = n.charAt(i), g = p[b], A = g?.transform != null ? g.transform(e.charAt(h)) : e.charAt(h);
|
|
107
|
+
if (!l.includes(i) && g != null ? (A.match(g.pattern) != null ? (u[k](A), g.repeated ? (d === -1 ? d = i : i === m && i !== d && (i = d - o), m === d && (i -= o)) : g.multiple && (R = !0, i -= o), i += o) : g.multiple ? R && (i += o, h -= o, R = !1) : A === v ? v = void 0 : g.optional && (i += o, h -= o), h += o) : (s && !this.isEager() && u[k](b), A === b && !this.isEager() ? h += o : v = b, this.isEager() || (i += o)), this.isEager())
|
|
108
|
+
for (; c(i) && (p[n.charAt(i)] == null || l.includes(i)); ) {
|
|
109
|
+
if (s) {
|
|
110
|
+
if (u[k](n.charAt(i)), e.charAt(h) === n.charAt(i)) {
|
|
111
|
+
i += o, h += o;
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
} else n.charAt(i) === e.charAt(h) && (h += o);
|
|
115
|
+
i += o;
|
|
126
116
|
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
)
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
case "ArrowRight":
|
|
159
|
-
v.value = Math.min(1, v.value + a);
|
|
160
|
-
break;
|
|
161
|
-
case "ArrowUp":
|
|
162
|
-
p.value = Math.min(1, p.value + a);
|
|
163
|
-
break;
|
|
164
|
-
case "ArrowDown":
|
|
165
|
-
p.value = Math.max(0, p.value - a);
|
|
166
|
-
break;
|
|
167
|
-
default:
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
o.alpha && f(), d(), e.preventDefault();
|
|
171
|
-
}, W = c(!1), Z = (e) => {
|
|
172
|
-
const a = A.value;
|
|
173
|
-
if (!a) return i.value;
|
|
174
|
-
const t = a.getBoundingClientRect();
|
|
175
|
-
return Math.max(
|
|
176
|
-
0,
|
|
177
|
-
Math.min(360, (e.clientX - t.left) / t.width * 360)
|
|
178
|
-
);
|
|
179
|
-
}, me = (e) => {
|
|
180
|
-
A.value?.setPointerCapture(e.pointerId), W.value = !0, i.value = Z(e), C(), o.alpha && f(), d();
|
|
181
|
-
}, ge = (e) => {
|
|
182
|
-
W.value && (i.value = Z(e), C(), o.alpha && f(), d());
|
|
183
|
-
}, j = (e) => {
|
|
184
|
-
A.value?.releasePointerCapture(e.pointerId), W.value = !1;
|
|
185
|
-
}, _e = (e) => {
|
|
186
|
-
const a = e.shiftKey ? 10 : 1;
|
|
187
|
-
switch (e.key) {
|
|
188
|
-
case "ArrowLeft":
|
|
189
|
-
i.value = Math.max(0, i.value - a);
|
|
190
|
-
break;
|
|
191
|
-
case "ArrowRight":
|
|
192
|
-
i.value = Math.min(360, i.value + a);
|
|
193
|
-
break;
|
|
194
|
-
default:
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
C(), o.alpha && f(), d(), e.preventDefault();
|
|
198
|
-
}, K = c(!1), q = (e) => {
|
|
199
|
-
const a = x.value;
|
|
200
|
-
if (!a) return h.value;
|
|
201
|
-
const t = a.getBoundingClientRect();
|
|
202
|
-
return Math.max(0, Math.min(1, (e.clientX - t.left) / t.width));
|
|
203
|
-
}, ye = (e) => {
|
|
204
|
-
x.value?.setPointerCapture(e.pointerId), K.value = !0, h.value = q(e), d();
|
|
205
|
-
}, ke = (e) => {
|
|
206
|
-
K.value && (h.value = q(e), d());
|
|
207
|
-
}, J = (e) => {
|
|
208
|
-
x.value?.releasePointerCapture(e.pointerId), K.value = !1;
|
|
209
|
-
}, Fe = (e) => {
|
|
210
|
-
const a = e.shiftKey ? 0.05 : 0.01;
|
|
211
|
-
switch (e.key) {
|
|
212
|
-
case "ArrowLeft":
|
|
213
|
-
h.value = Math.max(0, h.value - a);
|
|
214
|
-
break;
|
|
215
|
-
case "ArrowRight":
|
|
216
|
-
h.value = Math.min(1, h.value + a);
|
|
217
|
-
break;
|
|
218
|
-
default:
|
|
219
|
-
return;
|
|
117
|
+
}
|
|
118
|
+
return this.memo.set(r, u.join("")), this.memo.get(r);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
class V {
|
|
122
|
+
constructor(e, t = {}) {
|
|
123
|
+
y(this, "items", /* @__PURE__ */ new Map()), y(this, "eventAbortController"), y(this, "onInput", (s) => {
|
|
124
|
+
if (s instanceof CustomEvent && s.type === "input" && !s.isTrusted && !s.bubbles)
|
|
125
|
+
return;
|
|
126
|
+
const r = s.target, n = this.items.get(r);
|
|
127
|
+
if (n === void 0) return;
|
|
128
|
+
const l = "inputType" in s && s.inputType.startsWith("delete"), u = n.isEager(), p = l && u && n.unmasked(r.value) === "" ? "" : r.value;
|
|
129
|
+
this.fixCursor(r, l, () => this.setValue(r, p));
|
|
130
|
+
}), this.options = t, this.eventAbortController = new AbortController(), this.init(this.getInputs(e));
|
|
131
|
+
}
|
|
132
|
+
update(e = {}) {
|
|
133
|
+
this.options = { ...e }, this.init(Array.from(this.items.keys()));
|
|
134
|
+
}
|
|
135
|
+
updateValue(e) {
|
|
136
|
+
var t;
|
|
137
|
+
e.value !== "" && e.value !== ((t = this.processInput(e)) == null ? void 0 : t.masked) && this.setValue(e, e.value);
|
|
138
|
+
}
|
|
139
|
+
destroy() {
|
|
140
|
+
this.eventAbortController.abort(), this.items.clear();
|
|
141
|
+
}
|
|
142
|
+
init(e) {
|
|
143
|
+
const t = this.getOptions(this.options);
|
|
144
|
+
for (const s of e) {
|
|
145
|
+
if (!this.items.has(s)) {
|
|
146
|
+
const { signal: n } = this.eventAbortController;
|
|
147
|
+
s.addEventListener("input", this.onInput, { capture: !0, signal: n });
|
|
220
148
|
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
149
|
+
const r = new W(T(s, t));
|
|
150
|
+
this.items.set(s, r), queueMicrotask(() => this.updateValue(s)), s.selectionStart === null && r.isEager() && console.warn("Maska: input of `%s` type is not supported", s.type);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
getInputs(e) {
|
|
154
|
+
return typeof e == "string" ? Array.from(document.querySelectorAll(e)) : "length" in e ? Array.from(e) : [e];
|
|
155
|
+
}
|
|
156
|
+
getOptions(e) {
|
|
157
|
+
const { onMaska: t, preProcess: s, postProcess: r, ...n } = e;
|
|
158
|
+
return n;
|
|
159
|
+
}
|
|
160
|
+
fixCursor(e, t, s) {
|
|
161
|
+
var r, n;
|
|
162
|
+
const l = e.selectionStart, u = e.value;
|
|
163
|
+
if (s(), l === null || l === u.length && !t) return;
|
|
164
|
+
const p = e.value, o = u.slice(0, l), k = p.slice(0, l), m = (r = this.processInput(e, o)) == null ? void 0 : r.unmasked, f = (n = this.processInput(e, k)) == null ? void 0 : n.unmasked;
|
|
165
|
+
if (m === void 0 || f === void 0) return;
|
|
166
|
+
let c = l;
|
|
167
|
+
o !== k && (c += t ? p.length - u.length : m.length - f.length), e.setSelectionRange(c, c);
|
|
168
|
+
}
|
|
169
|
+
setValue(e, t) {
|
|
170
|
+
const s = this.processInput(e, t);
|
|
171
|
+
s !== void 0 && (e.value = s.masked, this.options.onMaska != null && (Array.isArray(this.options.onMaska) ? this.options.onMaska.forEach((r) => r(s)) : this.options.onMaska(s)), e.dispatchEvent(new CustomEvent("maska", { detail: s })), e.dispatchEvent(new CustomEvent("input", { detail: s.masked })));
|
|
172
|
+
}
|
|
173
|
+
processInput(e, t) {
|
|
174
|
+
const s = this.items.get(e);
|
|
175
|
+
if (s === void 0) return;
|
|
176
|
+
let r = t ?? e.value;
|
|
177
|
+
this.options.preProcess != null && (r = this.options.preProcess(r));
|
|
178
|
+
let n = s.masked(r);
|
|
179
|
+
return this.options.postProcess != null && (n = this.options.postProcess(n)), {
|
|
180
|
+
masked: n,
|
|
181
|
+
unmasked: s.unmasked(r),
|
|
182
|
+
completed: s.completed(r)
|
|
235
183
|
};
|
|
236
|
-
return oe({ el: z }), (e, a) => (w(), b("div", {
|
|
237
|
-
ref_key: "pickerRef",
|
|
238
|
-
ref: z,
|
|
239
|
-
class: "bb-color-palette"
|
|
240
|
-
}, [
|
|
241
|
-
u("div", {
|
|
242
|
-
ref_key: "canvasWrapRef",
|
|
243
|
-
ref: P,
|
|
244
|
-
class: "bb-color-palette__canvas-wrap",
|
|
245
|
-
role: "application",
|
|
246
|
-
tabindex: "0",
|
|
247
|
-
"aria-label": $(M)("colorInput.mainCanvasDesc").value,
|
|
248
|
-
onPointerdown: be,
|
|
249
|
-
onPointermove: we,
|
|
250
|
-
onPointerup: Y,
|
|
251
|
-
onPointercancel: Y,
|
|
252
|
-
onKeydown: Ce
|
|
253
|
-
}, [
|
|
254
|
-
u("canvas", {
|
|
255
|
-
ref_key: "mainCanvasRef",
|
|
256
|
-
ref: m,
|
|
257
|
-
class: "bb-color-palette__canvas",
|
|
258
|
-
"aria-hidden": "true"
|
|
259
|
-
}, null, 512),
|
|
260
|
-
u("div", {
|
|
261
|
-
class: "bb-color-palette__canvas-thumb",
|
|
262
|
-
style: y({ left: `${v.value * 100}%`, top: `${(1 - p.value) * 100}%` }),
|
|
263
|
-
"aria-hidden": "true"
|
|
264
|
-
}, null, 4)
|
|
265
|
-
], 40, Se),
|
|
266
|
-
u("div", Be, [
|
|
267
|
-
u("div", Ie, [
|
|
268
|
-
u("div", {
|
|
269
|
-
class: te(["bb-color-palette__preview", { "bb-color-palette__preview--alpha": e.alpha }]),
|
|
270
|
-
style: y({ "--bb-picker-preview-color": ve.value })
|
|
271
|
-
}, null, 6)
|
|
272
|
-
]),
|
|
273
|
-
u("div", Ee, [
|
|
274
|
-
u("div", {
|
|
275
|
-
ref_key: "hueWrapRef",
|
|
276
|
-
ref: A,
|
|
277
|
-
class: "bb-color-palette__slider-wrap",
|
|
278
|
-
role: "slider",
|
|
279
|
-
tabindex: "0",
|
|
280
|
-
"aria-label": $(M)("colorInput.hueCanvasDesc").value,
|
|
281
|
-
"aria-valuenow": Math.round(i.value),
|
|
282
|
-
"aria-valuemin": "0",
|
|
283
|
-
"aria-valuemax": "360",
|
|
284
|
-
onPointerdown: me,
|
|
285
|
-
onPointermove: ge,
|
|
286
|
-
onPointerup: j,
|
|
287
|
-
onPointercancel: j,
|
|
288
|
-
onKeydown: _e
|
|
289
|
-
}, [
|
|
290
|
-
u("canvas", {
|
|
291
|
-
ref_key: "hueCanvasRef",
|
|
292
|
-
ref: B,
|
|
293
|
-
class: "bb-color-palette__slider-track",
|
|
294
|
-
"aria-hidden": "true"
|
|
295
|
-
}, null, 512),
|
|
296
|
-
u("div", {
|
|
297
|
-
class: "bb-color-palette__slider-thumb",
|
|
298
|
-
style: y({ left: `${i.value / 360 * 100}%` }),
|
|
299
|
-
"aria-hidden": "true"
|
|
300
|
-
}, null, 4)
|
|
301
|
-
], 40, He),
|
|
302
|
-
e.alpha ? (w(), b("div", {
|
|
303
|
-
key: 0,
|
|
304
|
-
ref_key: "alphaWrapRef",
|
|
305
|
-
ref: x,
|
|
306
|
-
class: "bb-color-palette__slider-wrap bb-color-palette__slider-wrap--alpha",
|
|
307
|
-
role: "slider",
|
|
308
|
-
tabindex: "0",
|
|
309
|
-
"aria-label": $(M)("colorInput.alphaSliderDesc").value,
|
|
310
|
-
"aria-valuenow": Math.round(h.value * 100),
|
|
311
|
-
"aria-valuemin": "0",
|
|
312
|
-
"aria-valuemax": "100",
|
|
313
|
-
onPointerdown: ye,
|
|
314
|
-
onPointermove: ke,
|
|
315
|
-
onPointerup: J,
|
|
316
|
-
onPointercancel: J,
|
|
317
|
-
onKeydown: Fe
|
|
318
|
-
}, [
|
|
319
|
-
u("canvas", {
|
|
320
|
-
ref_key: "alphaCanvasRef",
|
|
321
|
-
ref: D,
|
|
322
|
-
class: "bb-color-palette__slider-track",
|
|
323
|
-
"aria-hidden": "true"
|
|
324
|
-
}, null, 512),
|
|
325
|
-
u("div", {
|
|
326
|
-
class: "bb-color-palette__slider-thumb",
|
|
327
|
-
style: y({ left: `${h.value * 100}%` }),
|
|
328
|
-
"aria-hidden": "true"
|
|
329
|
-
}, null, 4)
|
|
330
|
-
], 40, We)) : G("", !0)
|
|
331
|
-
]),
|
|
332
|
-
e.picker && Q ? (w(), b("button", {
|
|
333
|
-
key: 0,
|
|
334
|
-
class: "bb-color-palette__eyedropper",
|
|
335
|
-
type: "button",
|
|
336
|
-
"aria-label": $(M)("colorInput.eyeDropper").value,
|
|
337
|
-
disabled: V.value || void 0,
|
|
338
|
-
onClick: Me
|
|
339
|
-
}, a[0] || (a[0] = [
|
|
340
|
-
u("svg", {
|
|
341
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
342
|
-
width: "16",
|
|
343
|
-
height: "16",
|
|
344
|
-
viewBox: "0 0 24 24",
|
|
345
|
-
fill: "currentColor",
|
|
346
|
-
"aria-hidden": "true"
|
|
347
|
-
}, [
|
|
348
|
-
u("path", { d: "M20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L13.71,3.71L12.29,5.12L13.41,6.24L3,16.59V21H7.41L17.76,10.59L18.88,11.71L20.29,10.29L18.88,8.88L20.71,7.04C21.1,6.65 21.1,6 20.71,5.63M6.58,19H5V17.42L13.29,9.12L14.88,10.71L6.58,19Z" })
|
|
349
|
-
], -1)
|
|
350
|
-
]), 8, Ke)) : G("", !0)
|
|
351
|
-
]),
|
|
352
|
-
pe.value ? (w(), b("div", Ve, [
|
|
353
|
-
(w(!0), b(ne, null, re(he.value, (t, n) => (w(), b("div", {
|
|
354
|
-
key: n,
|
|
355
|
-
class: "bb-color-palette__swatch-group"
|
|
356
|
-
}, [
|
|
357
|
-
(w(!0), b(ne, null, re(t, (r) => (w(), b("button", {
|
|
358
|
-
key: r,
|
|
359
|
-
class: te(["bb-color-palette__swatch", {
|
|
360
|
-
"bb-color-palette__swatch--active": ee(r)
|
|
361
|
-
}]),
|
|
362
|
-
style: y({ background: r }),
|
|
363
|
-
"aria-label": r,
|
|
364
|
-
"aria-pressed": ee(r),
|
|
365
|
-
type: "button",
|
|
366
|
-
onClick: (l) => ae(r)
|
|
367
|
-
}, null, 14, Ge))), 128))
|
|
368
|
-
]))), 128))
|
|
369
|
-
])) : G("", !0)
|
|
370
|
-
], 512));
|
|
371
184
|
}
|
|
372
|
-
}
|
|
185
|
+
}
|
|
373
186
|
export {
|
|
374
|
-
|
|
187
|
+
W as Mask,
|
|
188
|
+
V as MaskInput,
|
|
189
|
+
M as tokens
|
|
375
190
|
};
|
package/dist/index292.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
const o = (
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
const o = (n, t) => {
|
|
2
|
+
for (let e = n.length - 1; e >= 0; e--) {
|
|
3
|
+
const i = n[e];
|
|
4
|
+
if (t(i, e, n))
|
|
5
|
+
return e;
|
|
6
|
+
}
|
|
7
|
+
return -1;
|
|
8
|
+
};
|
|
6
9
|
export {
|
|
7
|
-
o as
|
|
10
|
+
o as findRightIndex
|
|
8
11
|
};
|
package/dist/index293.js
CHANGED
|
@@ -1,7 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const e = {
|
|
2
|
+
inert: ":not([inert]):not([inert] *)",
|
|
3
|
+
negTabIndex: ':not([tabindex^="-"])',
|
|
4
|
+
disabled: ":not(:disabled)"
|
|
5
|
+
}, n = [
|
|
6
|
+
`a[href]${e.inert}${e.negTabIndex}`,
|
|
7
|
+
`area[href]${e.inert}${e.negTabIndex}`,
|
|
8
|
+
`input:not([type="hidden"]):not([type="radio"])${e.inert}${e.negTabIndex}${e.disabled}`,
|
|
9
|
+
`input[type="radio"]${e.inert}${e.negTabIndex}${e.disabled}`,
|
|
10
|
+
`select${e.inert}${e.negTabIndex}${e.disabled}`,
|
|
11
|
+
`textarea${e.inert}${e.negTabIndex}${e.disabled}`,
|
|
12
|
+
`button${e.inert}${e.negTabIndex}${e.disabled}`,
|
|
13
|
+
`details${e.inert} > summary:first-of-type${e.negTabIndex}`,
|
|
14
|
+
// Discard until Firefox supports `:has()`
|
|
15
|
+
// See: https://github.com/KittyGiraudel/focusable-selectors/issues/12
|
|
16
|
+
// `details:not(:has(> summary))${not.inert}${not.negTabIndex}`,
|
|
17
|
+
`iframe${e.inert}${e.negTabIndex}`,
|
|
18
|
+
`audio[controls]${e.inert}${e.negTabIndex}`,
|
|
19
|
+
`video[controls]${e.inert}${e.negTabIndex}`,
|
|
20
|
+
`[contenteditable]${e.inert}${e.negTabIndex}`,
|
|
21
|
+
`[tabindex]${e.inert}${e.negTabIndex}`
|
|
22
|
+
];
|
|
5
23
|
export {
|
|
6
|
-
|
|
24
|
+
n as default
|
|
7
25
|
};
|