@apo100l/ace-ui-kit 0.5.0 → 0.6.1
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/ace-compat.css +1 -1
- package/dist/ace-ui-kit.css +1 -1
- package/dist/ace-ui-kit.js +130 -111
- package/dist/ace-ui-kit.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/js/init.d.ts +1 -1
- package/dist/js/table.d.ts +2 -0
- package/package.json +1 -1
- package/src/scss/_tokens.scss +2 -0
- package/src/scss/compat/_nav-rows.scss +76 -0
- package/src/scss/compat/index.scss +1 -0
- package/src/scss/components/_sidebar-profile.scss +73 -0
- package/src/scss/components/_table.scss +12 -2
- package/src/scss/index.scss +1 -0
package/dist/ace-ui-kit.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
let
|
|
2
|
-
function
|
|
1
|
+
let D = !1;
|
|
2
|
+
function Y(e) {
|
|
3
3
|
e.open || (e.showModal(), document.documentElement.classList.add("ak-dialog-open"));
|
|
4
4
|
}
|
|
5
|
-
function
|
|
5
|
+
function C(e, t) {
|
|
6
6
|
e.open && e.close(t);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function G() {
|
|
9
9
|
const e = document.querySelector("dialog.ak-dialog[open]");
|
|
10
10
|
document.documentElement.classList.toggle("ak-dialog-open", !!e);
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
|
|
12
|
+
function J() {
|
|
13
|
+
D || (D = !0, document.addEventListener("click", (e) => {
|
|
14
14
|
const t = e.target instanceof Element ? e.target : null;
|
|
15
15
|
if (!t) return;
|
|
16
16
|
const n = t.closest("[data-ak-dialog-open]");
|
|
17
17
|
if (n) {
|
|
18
18
|
const a = document.getElementById(n.dataset.akDialogOpen ?? "");
|
|
19
|
-
a instanceof HTMLDialogElement && (e.preventDefault(),
|
|
19
|
+
a instanceof HTMLDialogElement && (e.preventDefault(), Y(a));
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
const o = t.closest("[data-ak-dialog-close]");
|
|
23
23
|
if (o) {
|
|
24
24
|
const a = o.closest("dialog");
|
|
25
|
-
a &&
|
|
25
|
+
a && C(a, o.dataset.akDialogClose || void 0);
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
28
|
if (t instanceof HTMLDialogElement && t.open && t.classList.contains("ak-dialog") && !t.hasAttribute("data-ak-static")) {
|
|
29
29
|
const a = t.getBoundingClientRect(), { clientX: i, clientY: s } = e;
|
|
30
|
-
(i < a.left || i > a.right || s < a.top || s > a.bottom) &&
|
|
30
|
+
(i < a.left || i > a.right || s < a.top || s > a.bottom) && C(t, "cancel");
|
|
31
31
|
}
|
|
32
|
-
}), document.addEventListener("close",
|
|
32
|
+
}), document.addEventListener("close", G, !0));
|
|
33
33
|
}
|
|
34
|
-
const
|
|
35
|
-
function
|
|
34
|
+
const q = "akBound";
|
|
35
|
+
function Q(e = document) {
|
|
36
36
|
e.querySelectorAll("[data-ak-dismiss]").forEach((t) => {
|
|
37
|
-
t.dataset[
|
|
37
|
+
t.dataset[q] || (t.dataset[q] = "1", t.addEventListener("click", () => {
|
|
38
38
|
t.closest("[data-ak-dismissible], .ak-alert")?.remove();
|
|
39
39
|
}));
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
let
|
|
43
|
-
const
|
|
44
|
-
function
|
|
42
|
+
let N = !1;
|
|
43
|
+
const Z = (e) => e < 1024 ? `${e} Б` : e < 1048576 ? `${(e / 1024).toFixed(0)} КБ` : `${(e / 1048576).toFixed(1).replace(".", ",")} МБ`;
|
|
44
|
+
function tt(e, t) {
|
|
45
45
|
const n = e.querySelector(".ak-file__list");
|
|
46
46
|
if (!n) return;
|
|
47
47
|
const o = Number(t.dataset.maxSize) || 1 / 0;
|
|
@@ -50,19 +50,19 @@ function Q(e, t) {
|
|
|
50
50
|
const s = document.createElement("span");
|
|
51
51
|
s.className = "ak-file__item";
|
|
52
52
|
const l = i.size > o;
|
|
53
|
-
return s.toggleAttribute("data-invalid", l), s.textContent = `${i.name} · ${
|
|
53
|
+
return s.toggleAttribute("data-invalid", l), s.textContent = `${i.name} · ${Z(i.size)}${l ? " — больше допустимого" : ""}`, s;
|
|
54
54
|
})
|
|
55
55
|
);
|
|
56
56
|
const a = [...t.files ?? []].some((i) => i.size > o);
|
|
57
57
|
t.setCustomValidity(a ? "Файл больше допустимого размера" : ""), e.toggleAttribute("data-has-files", !!t.files?.length);
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
if (
|
|
61
|
-
|
|
59
|
+
function et() {
|
|
60
|
+
if (N) return;
|
|
61
|
+
N = !0, document.addEventListener("change", (t) => {
|
|
62
62
|
const n = t.target;
|
|
63
63
|
if (!(n instanceof HTMLInputElement) || n.type !== "file") return;
|
|
64
64
|
const o = n.closest(".ak-file");
|
|
65
|
-
o &&
|
|
65
|
+
o && tt(o, n);
|
|
66
66
|
});
|
|
67
67
|
const e = (t) => t.target?.closest?.(".ak-file") ?? null;
|
|
68
68
|
document.addEventListener("dragover", (t) => {
|
|
@@ -81,26 +81,26 @@ function Z() {
|
|
|
81
81
|
[...a].slice(0, o.multiple ? void 0 : 1).forEach((s) => i.items.add(s)), o.files = i.files, o.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
-
let
|
|
85
|
-
const v = '.ak-menu__item:not(:disabled):not([aria-disabled="true"])',
|
|
86
|
-
function
|
|
84
|
+
let _ = !1;
|
|
85
|
+
const v = '.ak-menu__item:not(:disabled):not([aria-disabled="true"])', nt = typeof CSS < "u" && CSS.supports?.("position-area", "block-end");
|
|
86
|
+
function ot(e) {
|
|
87
87
|
return e.id ? document.querySelector(`[popovertarget="${CSS.escape(e.id)}"]`) : null;
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function at(e, t) {
|
|
90
90
|
const n = t.getBoundingClientRect(), o = e.getBoundingClientRect();
|
|
91
91
|
let i = e.classList.contains("ak-menu--end") ? n.right - o.width : n.left;
|
|
92
92
|
i = Math.max(8, Math.min(i, window.innerWidth - o.width - 8));
|
|
93
93
|
let s = n.bottom + 4;
|
|
94
94
|
s + o.height > window.innerHeight - 8 && n.top - o.height - 4 > 8 && (s = n.top - o.height - 4), e.style.position = "fixed", e.style.left = `${Math.round(i)}px`, e.style.top = `${Math.round(s)}px`, e.style.margin = "0";
|
|
95
95
|
}
|
|
96
|
-
function
|
|
97
|
-
|
|
96
|
+
function it() {
|
|
97
|
+
_ || (_ = !0, document.addEventListener(
|
|
98
98
|
"toggle",
|
|
99
99
|
(e) => {
|
|
100
100
|
const t = e.target;
|
|
101
101
|
if (!(t instanceof HTMLElement) || !t.classList.contains("ak-menu")) return;
|
|
102
|
-
const n = e.newState === "open", o =
|
|
103
|
-
o?.setAttribute("aria-expanded", String(n)), n && (o && !
|
|
102
|
+
const n = e.newState === "open", o = ot(t);
|
|
103
|
+
o?.setAttribute("aria-expanded", String(n)), n && (o && !nt && at(t, o), t.querySelector(v)?.focus());
|
|
104
104
|
},
|
|
105
105
|
!0
|
|
106
106
|
), document.addEventListener("keydown", (e) => {
|
|
@@ -115,48 +115,48 @@ function ot() {
|
|
|
115
115
|
e.target?.closest?.(v)?.closest(".ak-menu:popover-open")?.hidePopover();
|
|
116
116
|
}));
|
|
117
117
|
}
|
|
118
|
-
const
|
|
119
|
-
let
|
|
120
|
-
function
|
|
118
|
+
const L = "ak-mode";
|
|
119
|
+
let I = !1;
|
|
120
|
+
function st(e) {
|
|
121
121
|
const t = document.cookie.match(new RegExp(`(?:^|; )${e.replace(/[.$?*|{}()[\]\\/+^]/g, "\\$&")}=([^;]*)`));
|
|
122
122
|
return t ? decodeURIComponent(t[1]) : null;
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function j() {
|
|
125
125
|
const e = document.documentElement;
|
|
126
126
|
return e.dataset.akMode === "dark" || e.dataset.akTheme === "dark" ? "dark" : "light";
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function rt(e, t = L) {
|
|
129
129
|
const n = document.documentElement;
|
|
130
130
|
e === "dark" ? n.dataset.akMode = "dark" : delete n.dataset.akMode, n.dataset.akTheme === "dark" && delete n.dataset.akTheme;
|
|
131
131
|
const o = location.protocol === "https:" ? "; Secure" : "";
|
|
132
|
-
document.cookie = `${t}=${e}; path=/; max-age=31536000; SameSite=Lax${o}`,
|
|
132
|
+
document.cookie = `${t}=${e}; path=/; max-age=31536000; SameSite=Lax${o}`, S(), n.dispatchEvent(new CustomEvent("ak:mode-change", { bubbles: !0, detail: { mode: e } }));
|
|
133
133
|
}
|
|
134
|
-
function
|
|
135
|
-
const e =
|
|
134
|
+
function S() {
|
|
135
|
+
const e = j() === "dark";
|
|
136
136
|
document.querySelectorAll("[data-ak-mode-toggle]").forEach((t) => {
|
|
137
137
|
t.setAttribute("aria-pressed", String(e));
|
|
138
138
|
const n = e ? t.dataset.akLabelLight : t.dataset.akLabelDark;
|
|
139
139
|
n && (t.setAttribute("aria-label", n), t.hasAttribute("title") && (t.title = n));
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
|
-
function
|
|
143
|
-
if (
|
|
144
|
-
|
|
142
|
+
function lt() {
|
|
143
|
+
if (I) {
|
|
144
|
+
S();
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
|
-
|
|
148
|
-
const t = document.querySelector("[data-ak-mode-toggle]")?.dataset.akModeToggle ||
|
|
149
|
-
!n.dataset.akMode &&
|
|
147
|
+
I = !0;
|
|
148
|
+
const t = document.querySelector("[data-ak-mode-toggle]")?.dataset.akModeToggle || L, n = document.documentElement;
|
|
149
|
+
!n.dataset.akMode && st(t) === "dark" && (n.dataset.akMode = "dark"), S(), document.addEventListener("click", (o) => {
|
|
150
150
|
const a = o.target?.closest?.("[data-ak-mode-toggle]");
|
|
151
|
-
a && (o.preventDefault(),
|
|
151
|
+
a && (o.preventDefault(), rt(j() === "dark" ? "light" : "dark", a.dataset.akModeToggle || L));
|
|
152
152
|
});
|
|
153
153
|
}
|
|
154
|
-
let
|
|
154
|
+
let O = !1;
|
|
155
155
|
function y(e, t) {
|
|
156
156
|
e.toggleAttribute("data-sidebar-open", t), e.querySelectorAll("[data-ak-sidebar-toggle]").forEach((n) => n.setAttribute("aria-expanded", String(t)));
|
|
157
157
|
}
|
|
158
|
-
function
|
|
159
|
-
|
|
158
|
+
function ct() {
|
|
159
|
+
O || (O = !0, document.addEventListener("click", (e) => {
|
|
160
160
|
const t = e.target instanceof Element ? e.target : null, n = t?.closest("[data-ak-sidebar-toggle]"), o = t?.closest(".ak-app");
|
|
161
161
|
if (o) {
|
|
162
162
|
if (n) {
|
|
@@ -176,7 +176,7 @@ const f = (e, t) => {
|
|
|
176
176
|
const n = Number(e);
|
|
177
177
|
return e !== "" && Number.isFinite(n) ? n : t;
|
|
178
178
|
};
|
|
179
|
-
function
|
|
179
|
+
function H(e) {
|
|
180
180
|
const t = e.querySelector("input");
|
|
181
181
|
if (!t) return;
|
|
182
182
|
const n = f(t.value, 0);
|
|
@@ -185,20 +185,38 @@ function O(e) {
|
|
|
185
185
|
o.disabled = t.disabled || (a < 0 ? n <= f(t.min, -1 / 0) : n >= f(t.max, 1 / 0));
|
|
186
186
|
});
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function dt(e, t) {
|
|
189
189
|
const n = f(e.step, 1) || 1, o = Math.min(f(e.max, 1 / 0), Math.max(f(e.min, -1 / 0), f(e.value, 0) + t * n)), a = (String(n).split(".")[1] ?? "").length;
|
|
190
190
|
e.value = o.toFixed(a), e.dispatchEvent(new Event("input", { bubbles: !0 })), e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
191
191
|
}
|
|
192
|
-
function
|
|
193
|
-
e.querySelectorAll(".ak-stepper").forEach(
|
|
192
|
+
function ut(e = document) {
|
|
193
|
+
e.querySelectorAll(".ak-stepper").forEach(H), !B && (B = !0, document.addEventListener("click", (t) => {
|
|
194
194
|
const n = t.target?.closest?.(".ak-stepper [data-ak-step]"), o = n?.closest(".ak-stepper"), a = o?.querySelector("input");
|
|
195
|
-
!n || !o || !a || (t.preventDefault(),
|
|
195
|
+
!n || !o || !a || (t.preventDefault(), dt(a, Number(n.dataset.akStep) || 1));
|
|
196
196
|
}), document.addEventListener("input", (t) => {
|
|
197
197
|
const n = t.target?.closest?.(".ak-stepper");
|
|
198
|
-
n &&
|
|
198
|
+
n && H(n);
|
|
199
199
|
}));
|
|
200
200
|
}
|
|
201
|
-
let
|
|
201
|
+
let A = null;
|
|
202
|
+
function R(e) {
|
|
203
|
+
const t = e.querySelector(":scope > table");
|
|
204
|
+
t && (e.removeAttribute("data-overflow"), e.toggleAttribute("data-overflow", t.scrollWidth > e.clientWidth + 1));
|
|
205
|
+
}
|
|
206
|
+
function ft(e = document) {
|
|
207
|
+
typeof ResizeObserver > "u" || (A ??= new ResizeObserver((t) => {
|
|
208
|
+
t.forEach((n) => {
|
|
209
|
+
const o = n.target;
|
|
210
|
+
R(o.matches(".ak-table-wrap") ? o : o.closest(".ak-table-wrap") ?? o);
|
|
211
|
+
});
|
|
212
|
+
}), e.querySelectorAll(".ak-table-wrap--page-sticky").forEach((t) => {
|
|
213
|
+
if (t.dataset.akObserved) return;
|
|
214
|
+
t.dataset.akObserved = "1", A?.observe(t);
|
|
215
|
+
const n = t.querySelector(":scope > table");
|
|
216
|
+
n && A?.observe(n), R(t);
|
|
217
|
+
}));
|
|
218
|
+
}
|
|
219
|
+
let z = !1;
|
|
202
220
|
function w(e) {
|
|
203
221
|
return [...e.querySelectorAll(':scope > [role="tab"]')];
|
|
204
222
|
}
|
|
@@ -214,11 +232,11 @@ function F(e, t = !1) {
|
|
|
214
232
|
t && e.focus(), n.dispatchEvent(new CustomEvent("ak:tab-change", { bubbles: !0, detail: { tab: e } }));
|
|
215
233
|
}
|
|
216
234
|
}
|
|
217
|
-
function
|
|
235
|
+
function mt(e = document) {
|
|
218
236
|
e.querySelectorAll('[role="tablist"]').forEach((t) => {
|
|
219
237
|
const n = w(t), o = n.find((a) => a.getAttribute("aria-selected") === "true") ?? n[0];
|
|
220
238
|
n.forEach((a) => a.tabIndex = a === o ? 0 : -1);
|
|
221
|
-
}), !
|
|
239
|
+
}), !z && (z = !0, document.addEventListener("click", (t) => {
|
|
222
240
|
const n = t.target?.closest?.('[role="tablist"] > [role="tab"]');
|
|
223
241
|
n && F(n);
|
|
224
242
|
}), document.addEventListener("keydown", (t) => {
|
|
@@ -229,13 +247,13 @@ function dt(e = document) {
|
|
|
229
247
|
t.key === "ArrowRight" ? i = o[(a + 1) % o.length] : t.key === "ArrowLeft" ? i = o[(a - 1 + o.length) % o.length] : t.key === "Home" ? i = o[0] : t.key === "End" && (i = o[o.length - 1]), i && (t.preventDefault(), F(i, !0));
|
|
230
248
|
}));
|
|
231
249
|
}
|
|
232
|
-
const
|
|
250
|
+
const bt = 4;
|
|
233
251
|
let u = null;
|
|
234
|
-
function
|
|
252
|
+
function gt() {
|
|
235
253
|
return u?.isConnected || (u = document.createElement("section"), u.className = "ak-toaster", u.setAttribute("aria-label", "Уведомления"), document.body.append(u)), u;
|
|
236
254
|
}
|
|
237
|
-
function
|
|
238
|
-
const a =
|
|
255
|
+
function pt(e, { tone: t = "neutral", duration: n, action: o } = {}) {
|
|
256
|
+
const a = gt(), i = document.createElement("div");
|
|
239
257
|
i.className = `ak-toast ak-toast--${t}`, i.setAttribute("role", t === "negative" ? "alert" : "status"), i.setAttribute("aria-live", t === "negative" ? "assertive" : "polite");
|
|
240
258
|
const s = document.createElement("p");
|
|
241
259
|
if (s.className = "ak-toast__text", s.textContent = e, i.append(s), o) {
|
|
@@ -246,113 +264,114 @@ function mt(e, { tone: t = "neutral", duration: n, action: o } = {}) {
|
|
|
246
264
|
}
|
|
247
265
|
const l = document.createElement("button");
|
|
248
266
|
l.type = "button", l.className = "ak-toast__close", l.setAttribute("aria-label", "Закрыть"), l.textContent = "×", l.addEventListener("click", () => g()), i.append(l), a.append(i);
|
|
249
|
-
const
|
|
250
|
-
|
|
251
|
-
const
|
|
252
|
-
let E =
|
|
253
|
-
const
|
|
254
|
-
|
|
267
|
+
const x = a.querySelectorAll(".ak-toast:not([data-leaving])");
|
|
268
|
+
x.length > bt && x[0]._close?.(), requestAnimationFrame(() => requestAnimationFrame(() => i.setAttribute("data-shown", "")));
|
|
269
|
+
const T = n ?? (t === "negative" ? 0 : 5e3);
|
|
270
|
+
let E = T, $ = 0, b = 0;
|
|
271
|
+
const p = () => {
|
|
272
|
+
b && (clearTimeout(b), b = 0, E -= Date.now() - $);
|
|
255
273
|
}, k = () => {
|
|
256
|
-
!
|
|
257
|
-
},
|
|
258
|
-
i.addEventListener("mouseenter",
|
|
274
|
+
!T || b || E <= 0 || document.hidden || ($ = Date.now(), b = window.setTimeout(g, E));
|
|
275
|
+
}, M = () => document.hidden ? p() : k();
|
|
276
|
+
i.addEventListener("mouseenter", p), i.addEventListener("mouseleave", k), i.addEventListener("focusin", p), i.addEventListener("focusout", k), document.addEventListener("visibilitychange", M), k();
|
|
259
277
|
function g() {
|
|
260
278
|
if (i.hasAttribute("data-leaving")) return;
|
|
261
|
-
|
|
279
|
+
p(), document.removeEventListener("visibilitychange", M), i.setAttribute("data-leaving", ""), i.removeAttribute("data-shown");
|
|
262
280
|
const d = () => i.remove();
|
|
263
281
|
i.addEventListener("transitionend", d, { once: !0 }), window.setTimeout(d, 400);
|
|
264
282
|
}
|
|
265
283
|
return i._close = g, { close: g };
|
|
266
284
|
}
|
|
267
|
-
function
|
|
285
|
+
function kt(e = document) {
|
|
268
286
|
e.querySelectorAll("[data-ak-toast]:not([data-ak-bound])").forEach((t) => {
|
|
269
287
|
t.setAttribute("data-ak-bound", "");
|
|
270
288
|
const n = (t instanceof HTMLTemplateElement ? t.content.textContent : t.textContent)?.trim();
|
|
271
289
|
if (!n) return;
|
|
272
290
|
const o = t.dataset.akToast || "neutral", a = t.dataset.akDuration ? Number(t.dataset.akDuration) : void 0;
|
|
273
|
-
|
|
291
|
+
pt(n, { tone: o, duration: a }), t instanceof HTMLTemplateElement || (t.hidden = !0);
|
|
274
292
|
});
|
|
275
293
|
}
|
|
276
|
-
const
|
|
277
|
-
let
|
|
278
|
-
function
|
|
294
|
+
const ht = 500, Et = 400;
|
|
295
|
+
let W = !1, c = null, r = null, h = 0, K = 0;
|
|
296
|
+
function vt() {
|
|
279
297
|
return c?.isConnected || (c = document.createElement("div"), c.className = "ak-tooltip", c.id = "ak-tooltip", c.setAttribute("role", "tooltip"), document.body.append(c)), c;
|
|
280
298
|
}
|
|
281
|
-
function
|
|
299
|
+
function yt(e) {
|
|
282
300
|
return (e.dataset.akTooltip || e.getAttribute("aria-label") || e.getAttribute("title") || "").trim();
|
|
283
301
|
}
|
|
284
|
-
function
|
|
302
|
+
function At(e, t) {
|
|
285
303
|
const n = e.getBoundingClientRect(), o = t.getBoundingClientRect();
|
|
286
304
|
let a = n.top - o.height - 6, i = "top";
|
|
287
305
|
a < 8 && (a = n.bottom + 6, i = "bottom");
|
|
288
306
|
const s = Math.max(8, Math.min(n.left + n.width / 2 - o.width / 2, window.innerWidth - o.width - 8));
|
|
289
307
|
t.style.top = `${Math.round(a)}px`, t.style.left = `${Math.round(s)}px`, t.dataset.side = i;
|
|
290
308
|
}
|
|
291
|
-
function
|
|
292
|
-
const n =
|
|
309
|
+
function U(e, t) {
|
|
310
|
+
const n = yt(e);
|
|
293
311
|
if (!n) return;
|
|
294
|
-
const o =
|
|
295
|
-
r = e, o.textContent = n, o.toggleAttribute("data-instant", t), o.setAttribute("data-open", ""),
|
|
312
|
+
const o = vt();
|
|
313
|
+
r = e, o.textContent = n, o.toggleAttribute("data-instant", t), o.setAttribute("data-open", ""), At(e, o);
|
|
296
314
|
const a = e.getAttribute("aria-describedby") ?? "";
|
|
297
315
|
a.split(" ").includes(o.id) || e.setAttribute("aria-describedby", `${a} ${o.id}`.trim());
|
|
298
316
|
}
|
|
299
317
|
function m() {
|
|
300
318
|
if (clearTimeout(h), h = 0, !r) return;
|
|
301
319
|
const e = (r.getAttribute("aria-describedby") ?? "").split(" ").filter((t) => t && t !== "ak-tooltip");
|
|
302
|
-
e.length ? r.setAttribute("aria-describedby", e.join(" ")) : r.removeAttribute("aria-describedby"), r = null, c?.removeAttribute("data-open"),
|
|
320
|
+
e.length ? r.setAttribute("aria-describedby", e.join(" ")) : r.removeAttribute("aria-describedby"), r = null, c?.removeAttribute("data-open"), K = Date.now();
|
|
303
321
|
}
|
|
304
|
-
function
|
|
322
|
+
function P(e, t) {
|
|
305
323
|
if (r === e) return;
|
|
306
324
|
clearTimeout(h);
|
|
307
|
-
const n = !!r || Date.now() -
|
|
308
|
-
r && m(), t || n ?
|
|
325
|
+
const n = !!r || Date.now() - K < Et;
|
|
326
|
+
r && m(), t || n ? U(e, n) : h = window.setTimeout(() => U(e, !1), ht);
|
|
309
327
|
}
|
|
310
|
-
function
|
|
311
|
-
if (
|
|
312
|
-
|
|
328
|
+
function Lt() {
|
|
329
|
+
if (W) return;
|
|
330
|
+
W = !0;
|
|
313
331
|
const e = (t) => t.target?.closest?.("[data-ak-tooltip]") ?? null;
|
|
314
332
|
document.addEventListener("pointerover", (t) => {
|
|
315
333
|
if (t.pointerType === "touch") return;
|
|
316
334
|
const n = e(t);
|
|
317
|
-
n &&
|
|
335
|
+
n && P(n, !1);
|
|
318
336
|
}), document.addEventListener("pointerout", (t) => {
|
|
319
337
|
const n = e(t);
|
|
320
338
|
n && !n.contains(t.relatedTarget) && m();
|
|
321
339
|
}), document.addEventListener("focusin", (t) => {
|
|
322
340
|
const n = e(t);
|
|
323
|
-
n && n.matches(":focus-visible") &&
|
|
341
|
+
n && n.matches(":focus-visible") && P(n, !0);
|
|
324
342
|
}), document.addEventListener("focusout", (t) => {
|
|
325
343
|
e(t) && m();
|
|
326
344
|
}), document.addEventListener("keydown", (t) => {
|
|
327
345
|
t.key === "Escape" && r && m();
|
|
328
346
|
}), window.addEventListener("scroll", m, { passive: !0, capture: !0 }), document.addEventListener("pointerdown", m);
|
|
329
347
|
}
|
|
330
|
-
function
|
|
331
|
-
|
|
348
|
+
function St({ root: e = document } = {}) {
|
|
349
|
+
J(), it(), ct(), Lt(), lt(), et(), mt(e), ut(e), ft(e), Q(e), kt(e);
|
|
332
350
|
}
|
|
333
|
-
const
|
|
334
|
-
let
|
|
335
|
-
function
|
|
336
|
-
|
|
351
|
+
const V = "http://www.w3.org/2000/svg";
|
|
352
|
+
let X = "";
|
|
353
|
+
function wt(e) {
|
|
354
|
+
X = e;
|
|
337
355
|
}
|
|
338
|
-
function
|
|
339
|
-
const a = document.createElementNS(
|
|
356
|
+
function xt(e, { size: t, label: n, className: o } = {}) {
|
|
357
|
+
const a = document.createElementNS(V, "svg");
|
|
340
358
|
a.setAttribute("class", ["ak-icon", t && `ak-icon--${t}`, o].filter(Boolean).join(" ")), n ? (a.setAttribute("role", "img"), a.setAttribute("aria-label", n)) : a.setAttribute("aria-hidden", "true"), a.setAttribute("focusable", "false");
|
|
341
|
-
const i = document.createElementNS(
|
|
342
|
-
return i.setAttribute("href", `${
|
|
359
|
+
const i = document.createElementNS(V, "use");
|
|
360
|
+
return i.setAttribute("href", `${X}#${e}`), a.append(i), a;
|
|
343
361
|
}
|
|
344
362
|
export {
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
363
|
+
C as closeDialog,
|
|
364
|
+
Q as dismissible,
|
|
365
|
+
j as getMode,
|
|
366
|
+
xt as icon,
|
|
367
|
+
St as init,
|
|
368
|
+
Y as openDialog,
|
|
351
369
|
F as selectTab,
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
pt as
|
|
370
|
+
wt as setIconSprite,
|
|
371
|
+
rt as setMode,
|
|
372
|
+
dt as stepBy,
|
|
373
|
+
ft as stickyTables,
|
|
374
|
+
pt as toast,
|
|
375
|
+
kt as toastsFromDom
|
|
357
376
|
};
|
|
358
377
|
//# sourceMappingURL=ace-ui-kit.js.map
|