@nubisco/ui 4.1.1 → 4.1.3
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/{Breadcrumbs-DoLgQpBy.cjs → Breadcrumbs-BQ61cxAo.cjs} +1 -1
- package/dist/{Breadcrumbs-B-nZ8ABp.js → Breadcrumbs-CbN5yrrZ.js} +1 -1
- package/dist/InfoHint-DesESwdO.cjs +1 -0
- package/dist/InfoHint-JwhhBFZP.js +165 -0
- package/dist/NotificationCenter-D51ty3Lq.cjs +1 -0
- package/dist/{NotificationCenter-CrwDwpt6.js → NotificationCenter-DL_Tshyb.js} +193 -192
- package/dist/all.cjs +1 -1
- package/dist/all.mjs +3 -3
- package/dist/components/Breadcrumbs.cjs +1 -1
- package/dist/components/Breadcrumbs.mjs +1 -1
- package/dist/components/Breadcrumbs.vue.d.ts.map +1 -1
- package/dist/components/InfoHint.cjs +1 -1
- package/dist/components/InfoHint.mjs +1 -1
- package/dist/components/InfoHint.vue.d.ts.map +1 -1
- package/dist/components/NotificationCenter.cjs +1 -1
- package/dist/components/NotificationCenter.mjs +1 -1
- package/dist/components/NotificationCenter.vue.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +3 -3
- package/dist/plugins/vite/imports.d.ts +51 -0
- package/dist/plugins/vite/imports.d.ts.map +1 -0
- package/dist/plugins/vite/imports.js +125 -0
- package/dist/plugins/vite/index.d.ts +4 -0
- package/dist/plugins/vite/index.d.ts.map +1 -1
- package/dist/plugins/vite/index.js +35 -0
- package/dist/styles/Breadcrumbs.css +1 -1
- package/dist/styles/InfoHint.css +1 -1
- package/dist/ui.css +2 -2
- package/package.json +4 -3
- package/src/plugins/vite/imports.ts +192 -0
- package/src/plugins/vite/index.ts +44 -0
- package/dist/InfoHint-BH3UEadb.cjs +0 -1
- package/dist/InfoHint-Cj0Us0mD.js +0 -164
- package/dist/NotificationCenter-CrCoVe8p.cjs +0 -1
|
@@ -6,22 +6,23 @@ import { t as i } from "./Skeleton-CC7LVdxd.js";
|
|
|
6
6
|
import { t as a } from "./NotificationCenterItem-ZkLsiQIV.js";
|
|
7
7
|
import { Fragment as o, Teleport as s, Transition as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createSlots as ee, createTextVNode as te, createVNode as m, defineComponent as h, mergeProps as ne, nextTick as g, normalizeClass as re, normalizeStyle as _, onBeforeUnmount as ie, openBlock as v, ref as y, renderList as ae, renderSlot as b, toDisplayString as x, unref as oe, useId as se, useSlots as ce, watch as S, withCtx as C } from "vue";
|
|
8
8
|
import { regular as le } from "@nubisco/ui/icons/warning-circle";
|
|
9
|
+
import * as ue from "@nubisco/ui/icons/bell";
|
|
9
10
|
//#region src/components/NotificationCenter.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
-
var
|
|
11
|
+
var de = {
|
|
11
12
|
key: 0,
|
|
12
13
|
class: "nb-notification-center__badge",
|
|
13
14
|
"aria-hidden": "true"
|
|
14
|
-
},
|
|
15
|
+
}, fe = ["aria-describedby", "aria-busy"], pe = { class: "nb-notification-center__header" }, me = {
|
|
15
16
|
class: "nb-notification-center__sr",
|
|
16
17
|
role: "status"
|
|
17
|
-
},
|
|
18
|
+
}, he = { class: "nb-notification-center__stale-text" }, ge = { class: "nb-notification-center__sr" }, _e = ["tabindex"], ve = {
|
|
18
19
|
key: 4,
|
|
19
20
|
class: "nb-notification-center__empty"
|
|
20
|
-
},
|
|
21
|
+
}, ye = {
|
|
21
22
|
key: 5,
|
|
22
23
|
class: "nb-notification-center__footer"
|
|
23
24
|
}, w = /* @__PURE__ */ new Set(), T = 8, E = 8, D = 96, O = 88, k = 200;
|
|
24
|
-
function
|
|
25
|
+
function be(e, { align: t, width: n, maxHeight: r, viewport: i }) {
|
|
25
26
|
let a = t === "start" ? e.left : e.left + e.width - n, o = Math.min(Math.max(a, E), Math.max(E, i.width - n - E)), s = e.top + e.height, c = i.height - s - T - E, l = e.top - T - E, u = c < k && l > c ? "top" : "bottom", d = Math.max(O, u === "top" ? l : c), f = Math.max(O, Math.min(r, d - D)), p = Math.min(r + D, d);
|
|
26
27
|
return {
|
|
27
28
|
top: u === "top" ? Math.max(E, e.top - T - p) : s + T,
|
|
@@ -30,7 +31,7 @@ function ye(e, { align: t, width: n, maxHeight: r, viewport: i }) {
|
|
|
30
31
|
maxListHeight: f
|
|
31
32
|
};
|
|
32
33
|
}
|
|
33
|
-
function
|
|
34
|
+
function xe(e, t) {
|
|
34
35
|
return e.left <= t.width && e.left + e.width >= 0 && e.top <= t.height && e.top + e.height >= 0;
|
|
35
36
|
}
|
|
36
37
|
//#endregion
|
|
@@ -95,7 +96,7 @@ var A = /* @__PURE__ */ h({
|
|
|
95
96
|
type: Boolean,
|
|
96
97
|
default: !1
|
|
97
98
|
},
|
|
98
|
-
icon: { default:
|
|
99
|
+
icon: { default: void 0 },
|
|
99
100
|
locale: { default: void 0 },
|
|
100
101
|
unreadLabel: { default: "Unread" },
|
|
101
102
|
readLabel: { default: "Read" },
|
|
@@ -113,328 +114,328 @@ var A = /* @__PURE__ */ h({
|
|
|
113
114
|
"retry"
|
|
114
115
|
],
|
|
115
116
|
setup(h, { expose: T, emit: E }) {
|
|
116
|
-
let D = h, O =
|
|
117
|
+
let D = h, O = l(() => D.icon ?? ue), k = E, A = ce(), j = `nb-notification-center-${se()}`, Se = `${j}-title`, Ce = `${j}-trigger`, M = `${j}-error`, N = y(null), we = y(null), P = y(null), F = y(null), Te = y(!1), I = l(() => D.open === void 0 ? Te.value : D.open), L = l(() => typeof D.unreadCount == "number" ? Math.max(0, D.unreadCount) : D.items.filter((e) => !e.read).length), Ee = l(() => L.value > D.maxCount ? `${D.maxCount}+` : String(L.value)), De = l(() => L.value > 0 ? `${D.label}, ${D.formatUnread(L.value)}` : D.label), Oe = l(() => {
|
|
117
118
|
if (typeof D.itemCount == "number") return Math.max(0, D.itemCount);
|
|
118
|
-
if (!
|
|
119
|
-
}),
|
|
119
|
+
if (!A.default) return D.items.length;
|
|
120
|
+
}), ke = l(() => (Oe.value ?? 0) > 0), R = l(() => {
|
|
120
121
|
if (D.loading) return "loading";
|
|
121
|
-
let e =
|
|
122
|
+
let e = Oe.value;
|
|
122
123
|
return D.error && (e === void 0 || e === 0) ? "error" : e === void 0 || e > 0 ? "list" : "empty";
|
|
123
|
-
}),
|
|
124
|
+
}), Ae = l(() => D.error && !D.loading && R.value === "list" && ke.value);
|
|
124
125
|
y(!1), S(() => [
|
|
125
|
-
|
|
126
|
-
!!
|
|
126
|
+
I.value,
|
|
127
|
+
!!A.default,
|
|
127
128
|
D.itemCount
|
|
128
129
|
], ([e, t, n]) => {}, { immediate: !0 });
|
|
129
|
-
function
|
|
130
|
-
|
|
130
|
+
function z() {
|
|
131
|
+
k("retry");
|
|
131
132
|
}
|
|
132
|
-
let
|
|
133
|
-
id:
|
|
133
|
+
let je = l(() => ({
|
|
134
|
+
id: Ce,
|
|
134
135
|
"aria-haspopup": "dialog",
|
|
135
|
-
"aria-expanded":
|
|
136
|
-
"aria-controls":
|
|
137
|
-
"aria-label":
|
|
136
|
+
"aria-expanded": I.value ? "true" : "false",
|
|
137
|
+
"aria-controls": I.value ? j : void 0,
|
|
138
|
+
"aria-label": De.value,
|
|
138
139
|
disabled: D.disabled || void 0
|
|
139
|
-
})),
|
|
140
|
+
})), Me = l(() => ({
|
|
140
141
|
type: "button",
|
|
141
|
-
disabled:
|
|
142
|
+
disabled: L.value === 0 && !D.markAllPending,
|
|
142
143
|
"aria-disabled": D.markAllPending ? "true" : void 0,
|
|
143
144
|
"aria-busy": D.markAllPending ? "true" : void 0,
|
|
144
|
-
onClick:
|
|
145
|
-
})),
|
|
146
|
-
function
|
|
145
|
+
onClick: $e
|
|
146
|
+
})), Ne = l(() => Ae.value || R.value === "error" ? M : void 0);
|
|
147
|
+
function Pe(e) {
|
|
147
148
|
if (!e) {
|
|
148
|
-
|
|
149
|
+
P.value = null;
|
|
149
150
|
return;
|
|
150
151
|
}
|
|
151
152
|
let t = e instanceof HTMLElement ? e : e.$el;
|
|
152
|
-
|
|
153
|
+
P.value = t instanceof HTMLElement ? t : null;
|
|
153
154
|
}
|
|
154
|
-
let
|
|
155
|
+
let B = y({
|
|
155
156
|
top: 0,
|
|
156
157
|
left: 0,
|
|
157
158
|
side: "bottom",
|
|
158
159
|
maxListHeight: D.maxHeight
|
|
159
160
|
});
|
|
160
|
-
function
|
|
161
|
+
function Fe() {
|
|
161
162
|
return {
|
|
162
163
|
width: window.innerWidth,
|
|
163
164
|
height: window.innerHeight
|
|
164
165
|
};
|
|
165
166
|
}
|
|
166
|
-
function
|
|
167
|
-
let e =
|
|
168
|
-
e && (
|
|
167
|
+
function V() {
|
|
168
|
+
let e = N.value?.getBoundingClientRect();
|
|
169
|
+
e && (B.value = be(e, {
|
|
169
170
|
align: D.align,
|
|
170
171
|
width: D.width,
|
|
171
172
|
maxHeight: D.maxHeight,
|
|
172
|
-
viewport:
|
|
173
|
+
viewport: Fe()
|
|
173
174
|
}));
|
|
174
175
|
}
|
|
175
|
-
let
|
|
176
|
-
top: `${Math.round(
|
|
177
|
-
left: `${Math.round(
|
|
176
|
+
let Ie = l(() => ({
|
|
177
|
+
top: `${Math.round(B.value.top)}px`,
|
|
178
|
+
left: `${Math.round(B.value.left)}px`,
|
|
178
179
|
width: `${D.width}px`
|
|
179
|
-
})),
|
|
180
|
+
})), Le = l(() => ({ maxHeight: `${Math.round(B.value.maxListHeight)}px` })), Re = l(() => ({
|
|
180
181
|
"nb-notification-center__panel--start": D.align === "start",
|
|
181
|
-
"nb-notification-center__panel--above":
|
|
182
|
+
"nb-notification-center__panel--above": B.value.side === "top"
|
|
182
183
|
}));
|
|
183
|
-
function
|
|
184
|
-
D.open === void 0 && (
|
|
184
|
+
function ze(e) {
|
|
185
|
+
D.open === void 0 && (Te.value = e), k("update:open", e);
|
|
185
186
|
}
|
|
186
|
-
function
|
|
187
|
-
D.disabled ||
|
|
187
|
+
function H() {
|
|
188
|
+
D.disabled || I.value || (V(), ze(!0), k("open"));
|
|
188
189
|
}
|
|
189
|
-
function
|
|
190
|
-
if (!
|
|
191
|
-
let t =
|
|
192
|
-
|
|
190
|
+
function U(e = {}) {
|
|
191
|
+
if (!I.value) return;
|
|
192
|
+
let t = F.value?.contains(document.activeElement);
|
|
193
|
+
ze(!1), k("close"), (e.restoreFocus ?? t) && g(Be);
|
|
193
194
|
}
|
|
194
|
-
function
|
|
195
|
-
let e =
|
|
195
|
+
function Be() {
|
|
196
|
+
let e = P.value;
|
|
196
197
|
if (e?.isConnected) {
|
|
197
198
|
e.focus();
|
|
198
199
|
return;
|
|
199
200
|
}
|
|
200
|
-
(
|
|
201
|
+
(N.value?.querySelector(Y))?.focus();
|
|
201
202
|
}
|
|
202
|
-
function
|
|
203
|
-
|
|
203
|
+
function W() {
|
|
204
|
+
I.value ? U({ restoreFocus: !0 }) : H();
|
|
204
205
|
}
|
|
205
|
-
let
|
|
206
|
+
let G = y(0), Ve = new Set([
|
|
206
207
|
"button",
|
|
207
208
|
"link",
|
|
208
209
|
"menuitem",
|
|
209
210
|
"option"
|
|
210
211
|
]);
|
|
211
|
-
function
|
|
212
|
+
function He(e) {
|
|
212
213
|
if (e.tagName === "BUTTON") return !e.hasAttribute("disabled");
|
|
213
214
|
if (e.tagName === "A") return e.hasAttribute("href");
|
|
214
215
|
let t = e.getAttribute("role");
|
|
215
|
-
return t !== null &&
|
|
216
|
+
return t !== null && Ve.has(t);
|
|
216
217
|
}
|
|
217
|
-
function
|
|
218
|
-
return
|
|
218
|
+
function K() {
|
|
219
|
+
return F.value ? Array.from(F.value.querySelectorAll("[data-nb-notification-item]")).filter((e) => !!He(e)) : [];
|
|
219
220
|
}
|
|
220
|
-
let
|
|
221
|
-
function
|
|
222
|
-
let t =
|
|
223
|
-
|
|
221
|
+
let Ue = y(void 0);
|
|
222
|
+
function We(e) {
|
|
223
|
+
let t = we.value;
|
|
224
|
+
Ue.value = t && t.childElementCount > 0 && e.length === 0 ? 0 : void 0;
|
|
224
225
|
}
|
|
225
|
-
function
|
|
226
|
-
let t =
|
|
227
|
-
|
|
228
|
-
e.setAttribute("tabindex", t ===
|
|
226
|
+
function q(e) {
|
|
227
|
+
let t = K();
|
|
228
|
+
We(t), t.length && (G.value = Math.min(Math.max(e, 0), t.length - 1), t.forEach((e, t) => {
|
|
229
|
+
e.setAttribute("tabindex", t === G.value ? "0" : "-1");
|
|
229
230
|
}));
|
|
230
231
|
}
|
|
231
|
-
function
|
|
232
|
-
let t =
|
|
232
|
+
function J(e) {
|
|
233
|
+
let t = K();
|
|
233
234
|
if (!t.length) return !1;
|
|
234
235
|
let n = Math.min(Math.max(e, 0), t.length - 1);
|
|
235
|
-
return
|
|
236
|
+
return q(n), t[n]?.focus(), !0;
|
|
236
237
|
}
|
|
237
|
-
function
|
|
238
|
+
function Ge(e) {
|
|
238
239
|
let t = e.target?.closest("[data-nb-notification-item]");
|
|
239
240
|
if (!t) return;
|
|
240
|
-
let n =
|
|
241
|
-
n >= 0 &&
|
|
241
|
+
let n = K().indexOf(t);
|
|
242
|
+
n >= 0 && q(n);
|
|
242
243
|
}
|
|
243
|
-
let
|
|
244
|
-
function
|
|
244
|
+
let Y = "a[href]:not([tabindex=\"-1\"]), button:not([disabled]):not([tabindex=\"-1\"]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex=\"0\"]";
|
|
245
|
+
function Ke(e) {
|
|
245
246
|
return !!e?.closest?.("input, textarea, select, [contenteditable=\"\"], [contenteditable=\"true\"]");
|
|
246
247
|
}
|
|
247
|
-
function
|
|
248
|
-
let t =
|
|
248
|
+
function qe(e) {
|
|
249
|
+
let t = K(), n = e.target?.closest("[data-nb-notification-item]"), r = n ? t.indexOf(n) : -1;
|
|
249
250
|
if (e.key === "Escape") {
|
|
250
|
-
if (!
|
|
251
|
-
e.preventDefault(), e.stopPropagation(),
|
|
251
|
+
if (!Je(e)) return;
|
|
252
|
+
e.preventDefault(), e.stopPropagation(), U({ restoreFocus: !0 });
|
|
252
253
|
return;
|
|
253
254
|
}
|
|
254
255
|
if (e.key === "Tab") {
|
|
255
|
-
|
|
256
|
+
Ye(e);
|
|
256
257
|
return;
|
|
257
258
|
}
|
|
258
|
-
if (!
|
|
259
|
+
if (!Ke(e.target)) switch (e.key) {
|
|
259
260
|
case "ArrowDown":
|
|
260
|
-
|
|
261
|
+
J(r < 0 ? 0 : r + 1) && e.preventDefault();
|
|
261
262
|
break;
|
|
262
263
|
case "ArrowUp":
|
|
263
|
-
|
|
264
|
+
J(r < 0 ? t.length - 1 : r - 1) && e.preventDefault();
|
|
264
265
|
break;
|
|
265
266
|
case "Home":
|
|
266
|
-
r >= 0 && (e.preventDefault(),
|
|
267
|
+
r >= 0 && (e.preventDefault(), J(0));
|
|
267
268
|
break;
|
|
268
269
|
case "End":
|
|
269
|
-
r >= 0 && (e.preventDefault(),
|
|
270
|
+
r >= 0 && (e.preventDefault(), J(t.length - 1));
|
|
270
271
|
break;
|
|
271
272
|
default: break;
|
|
272
273
|
}
|
|
273
274
|
}
|
|
274
|
-
function
|
|
275
|
+
function Je(e) {
|
|
275
276
|
if (e.defaultPrevented) return !1;
|
|
276
277
|
let t = (e.target ?? document.activeElement)?.closest?.("[aria-modal=\"true\"]");
|
|
277
|
-
return !(t && t !==
|
|
278
|
+
return !(t && t !== F.value);
|
|
278
279
|
}
|
|
279
|
-
function
|
|
280
|
-
let t =
|
|
280
|
+
function Ye(e) {
|
|
281
|
+
let t = F.value;
|
|
281
282
|
if (!t) return;
|
|
282
|
-
let n = Array.from(t.querySelectorAll(
|
|
283
|
+
let n = Array.from(t.querySelectorAll(Y)), r = document.activeElement, i = n[0], a = n[n.length - 1], o = !n.length || r === i || !t.contains(r), s = !n.length || r === a;
|
|
283
284
|
if (e.shiftKey ? !o : !s) return;
|
|
284
285
|
e.preventDefault();
|
|
285
|
-
let c = e.shiftKey ?
|
|
286
|
-
|
|
287
|
-
c?.isConnected ? c.focus() :
|
|
286
|
+
let c = e.shiftKey ? P.value : Xe();
|
|
287
|
+
U({ restoreFocus: !1 }), g(() => {
|
|
288
|
+
c?.isConnected ? c.focus() : Be();
|
|
288
289
|
});
|
|
289
290
|
}
|
|
290
|
-
function
|
|
291
|
-
let e =
|
|
291
|
+
function Xe() {
|
|
292
|
+
let e = P.value;
|
|
292
293
|
if (!e) return null;
|
|
293
|
-
let t = Array.from(document.querySelectorAll(
|
|
294
|
+
let t = Array.from(document.querySelectorAll(Y)).filter((e) => !F.value?.contains(e)).filter((e) => e.tabIndex >= 0), n = t.indexOf(e);
|
|
294
295
|
return n < 0 ? null : t[n + 1] ?? null;
|
|
295
296
|
}
|
|
296
|
-
function
|
|
297
|
-
|
|
297
|
+
function Ze(e, t) {
|
|
298
|
+
k("select", e, t), D.closeOnSelect && U({ restoreFocus: !1 });
|
|
298
299
|
}
|
|
299
|
-
function
|
|
300
|
-
if (!
|
|
300
|
+
function Qe(e) {
|
|
301
|
+
if (!A.default) return;
|
|
301
302
|
let t = e.target?.closest("[data-nb-notification-item]");
|
|
302
|
-
if (t &&
|
|
303
|
+
if (t && He(t)) {
|
|
303
304
|
if (e.type === "keydown") {
|
|
304
305
|
let n = e.key;
|
|
305
306
|
if (n !== "Enter" && n !== " " || t.tagName === "BUTTON" || t.tagName === "A") return;
|
|
306
307
|
e.preventDefault();
|
|
307
308
|
}
|
|
308
|
-
|
|
309
|
+
k("select", null, e), D.closeOnSelect && U({ restoreFocus: !1 });
|
|
309
310
|
}
|
|
310
311
|
}
|
|
311
|
-
function
|
|
312
|
-
D.markAllPending ||
|
|
312
|
+
function $e() {
|
|
313
|
+
D.markAllPending || k("mark-all-read");
|
|
313
314
|
}
|
|
314
|
-
function
|
|
315
|
+
function et(e) {
|
|
315
316
|
let t = e.target;
|
|
316
|
-
|
|
317
|
+
N.value?.contains(t) || F.value?.contains(t) || U({ restoreFocus: !1 });
|
|
317
318
|
}
|
|
318
|
-
function
|
|
319
|
-
e.key === "Escape" && (
|
|
319
|
+
function tt(e) {
|
|
320
|
+
e.key === "Escape" && (F.value?.contains(document.activeElement) || Je(e) && U({ restoreFocus: N.value?.contains(document.activeElement) ?? !1 }));
|
|
320
321
|
}
|
|
321
322
|
let X = 0;
|
|
322
323
|
function Z() {
|
|
323
|
-
!
|
|
324
|
-
X = 0,
|
|
324
|
+
!I.value || X || (X = requestAnimationFrame(() => {
|
|
325
|
+
X = 0, rt();
|
|
325
326
|
}));
|
|
326
327
|
}
|
|
327
|
-
function
|
|
328
|
+
function nt() {
|
|
328
329
|
X &&= (cancelAnimationFrame(X), 0);
|
|
329
330
|
}
|
|
330
|
-
function
|
|
331
|
-
if (!
|
|
332
|
-
let e =
|
|
333
|
-
if (e && !
|
|
334
|
-
|
|
331
|
+
function rt() {
|
|
332
|
+
if (!I.value) return;
|
|
333
|
+
let e = N.value?.getBoundingClientRect();
|
|
334
|
+
if (e && !xe(e, Fe())) {
|
|
335
|
+
U({ restoreFocus: !1 });
|
|
335
336
|
return;
|
|
336
337
|
}
|
|
337
|
-
|
|
338
|
+
V();
|
|
338
339
|
}
|
|
339
340
|
function Q() {
|
|
340
|
-
D.closeOnNavigate &&
|
|
341
|
+
D.closeOnNavigate && U({ restoreFocus: !1 });
|
|
341
342
|
}
|
|
342
|
-
function
|
|
343
|
+
function it() {
|
|
343
344
|
return window.navigation;
|
|
344
345
|
}
|
|
345
|
-
function
|
|
346
|
-
document.addEventListener("mousedown",
|
|
346
|
+
function at() {
|
|
347
|
+
document.addEventListener("mousedown", et), document.addEventListener("keydown", tt), window.addEventListener("resize", Z), window.addEventListener("scroll", Z, !0), window.addEventListener("popstate", Q), window.addEventListener("hashchange", Q), it()?.addEventListener("navigate", Q);
|
|
347
348
|
}
|
|
348
|
-
function
|
|
349
|
-
|
|
349
|
+
function ot() {
|
|
350
|
+
nt(), document.removeEventListener("mousedown", et), document.removeEventListener("keydown", tt), window.removeEventListener("resize", Z), window.removeEventListener("scroll", Z, !0), window.removeEventListener("popstate", Q), window.removeEventListener("hashchange", Q), it()?.removeEventListener("navigate", Q);
|
|
350
351
|
}
|
|
351
|
-
let $ = () =>
|
|
352
|
-
return S(
|
|
352
|
+
let $ = () => U({ restoreFocus: !1 });
|
|
353
|
+
return S(I, (e) => {
|
|
353
354
|
if (e) {
|
|
354
355
|
for (let e of [...w]) e !== $ && e();
|
|
355
|
-
w.add($),
|
|
356
|
-
|
|
356
|
+
w.add($), at(), g(() => {
|
|
357
|
+
V(), q(0), J(0) || F.value?.focus();
|
|
357
358
|
});
|
|
358
|
-
} else w.delete($),
|
|
359
|
-
}), S(() => [D.items.length,
|
|
360
|
-
|
|
359
|
+
} else w.delete($), ot(), G.value = 0;
|
|
360
|
+
}), S(() => [D.items.length, R.value], () => {
|
|
361
|
+
I.value && g(() => q(G.value));
|
|
361
362
|
}), ie(() => {
|
|
362
|
-
|
|
363
|
-
let e =
|
|
363
|
+
ot(), w.delete($);
|
|
364
|
+
let e = F.value;
|
|
364
365
|
e?.isConnected && e.remove();
|
|
365
366
|
}), T({
|
|
366
|
-
show:
|
|
367
|
-
close:
|
|
368
|
-
toggle:
|
|
369
|
-
isOpen:
|
|
370
|
-
unreadCount:
|
|
367
|
+
show: H,
|
|
368
|
+
close: U,
|
|
369
|
+
toggle: W,
|
|
370
|
+
isOpen: I,
|
|
371
|
+
unreadCount: L
|
|
371
372
|
}), (l, g) => (v(), f("div", {
|
|
372
373
|
ref_key: "rootRef",
|
|
373
|
-
ref:
|
|
374
|
+
ref: N,
|
|
374
375
|
class: "nb-notification-center"
|
|
375
376
|
}, [b(l.$slots, "trigger", {
|
|
376
|
-
open:
|
|
377
|
-
toggle:
|
|
378
|
-
show:
|
|
379
|
-
close:
|
|
380
|
-
unreadCount:
|
|
381
|
-
badge:
|
|
382
|
-
panelId:
|
|
383
|
-
triggerProps:
|
|
384
|
-
setTriggerRef:
|
|
377
|
+
open: I.value,
|
|
378
|
+
toggle: W,
|
|
379
|
+
show: H,
|
|
380
|
+
close: U,
|
|
381
|
+
unreadCount: L.value,
|
|
382
|
+
badge: Ee.value,
|
|
383
|
+
panelId: j,
|
|
384
|
+
triggerProps: je.value,
|
|
385
|
+
setTriggerRef: Pe
|
|
385
386
|
}, () => [p("button", ne({
|
|
386
|
-
ref:
|
|
387
|
+
ref: Pe,
|
|
387
388
|
type: "button",
|
|
388
|
-
class: ["nb-notification-center__trigger", { "nb-notification-center__trigger--active":
|
|
389
|
-
},
|
|
390
|
-
name:
|
|
389
|
+
class: ["nb-notification-center__trigger", { "nb-notification-center__trigger--active": I.value }]
|
|
390
|
+
}, je.value, { onClick: W }), [m(e, {
|
|
391
|
+
name: O.value,
|
|
391
392
|
size: 18
|
|
392
|
-
}, null, 8, ["name"]),
|
|
393
|
-
default: C(() => [
|
|
393
|
+
}, null, 8, ["name"]), L.value > 0 ? (v(), f("span", de, x(Ee.value), 1)) : d("", !0)], 16)]), (v(), u(s, { to: "body" }, [m(c, { name: "nb-notification-center-pop" }, {
|
|
394
|
+
default: C(() => [I.value ? (v(), f("div", {
|
|
394
395
|
key: 0,
|
|
395
|
-
id:
|
|
396
|
+
id: j,
|
|
396
397
|
ref_key: "panelRef",
|
|
397
|
-
ref:
|
|
398
|
-
class: re(["nb-notification-center__panel",
|
|
399
|
-
style: _(
|
|
398
|
+
ref: F,
|
|
399
|
+
class: re(["nb-notification-center__panel", Re.value]),
|
|
400
|
+
style: _(Ie.value),
|
|
400
401
|
role: "dialog",
|
|
401
402
|
tabindex: "-1",
|
|
402
|
-
"aria-labelledby":
|
|
403
|
-
"aria-describedby":
|
|
403
|
+
"aria-labelledby": Se,
|
|
404
|
+
"aria-describedby": Ne.value,
|
|
404
405
|
"aria-busy": h.loading ? "true" : void 0,
|
|
405
|
-
onKeydown:
|
|
406
|
-
onFocusin:
|
|
406
|
+
onKeydown: qe,
|
|
407
|
+
onFocusin: Ge
|
|
407
408
|
}, [
|
|
408
|
-
p("div",
|
|
409
|
+
p("div", pe, [
|
|
409
410
|
p("h2", {
|
|
410
|
-
id:
|
|
411
|
+
id: Se,
|
|
411
412
|
class: "nb-notification-center__title"
|
|
412
413
|
}, x(h.label), 1),
|
|
413
414
|
b(l.$slots, "header-start", {
|
|
414
|
-
close:
|
|
415
|
-
unreadCount:
|
|
415
|
+
close: U,
|
|
416
|
+
unreadCount: L.value
|
|
416
417
|
}),
|
|
417
418
|
b(l.$slots, "header-actions", {
|
|
418
|
-
close:
|
|
419
|
-
unreadCount:
|
|
420
|
-
markAllRead:
|
|
419
|
+
close: U,
|
|
420
|
+
unreadCount: L.value,
|
|
421
|
+
markAllRead: $e,
|
|
421
422
|
markAllPending: h.markAllPending,
|
|
422
|
-
markAllProps:
|
|
423
|
+
markAllProps: Me.value,
|
|
423
424
|
markAllText: h.markAllPending ? h.markAllPendingLabel : h.markAllLabel
|
|
424
425
|
}, () => [h.showMarkAll ? (v(), f("button", ne({
|
|
425
426
|
key: 0,
|
|
426
427
|
class: "nb-notification-center__mark-all"
|
|
427
|
-
},
|
|
428
|
+
}, Me.value), [h.markAllPending ? (v(), u(r, {
|
|
428
429
|
key: 0,
|
|
429
430
|
size: "xs",
|
|
430
431
|
tone: "inherit",
|
|
431
432
|
decorative: ""
|
|
432
433
|
})) : d("", !0), te(" " + x(h.markAllPending ? h.markAllPendingLabel : h.markAllLabel), 1)], 16)) : d("", !0)])
|
|
433
434
|
]),
|
|
434
|
-
p("span",
|
|
435
|
-
|
|
435
|
+
p("span", me, x(h.markAllPending ? h.markAllPendingLabel : ""), 1),
|
|
436
|
+
Ae.value ? (v(), f("div", {
|
|
436
437
|
key: 0,
|
|
437
|
-
id:
|
|
438
|
+
id: M,
|
|
438
439
|
class: "nb-notification-center__stale",
|
|
439
440
|
role: "status"
|
|
440
441
|
}, [
|
|
@@ -443,31 +444,31 @@ var A = /* @__PURE__ */ h({
|
|
|
443
444
|
size: 14,
|
|
444
445
|
"aria-hidden": "true"
|
|
445
446
|
}, null, 8, ["name"]),
|
|
446
|
-
p("span",
|
|
447
|
+
p("span", he, x(h.errorStaleLabel), 1),
|
|
447
448
|
h.showRetry ? (v(), f("button", {
|
|
448
449
|
key: 0,
|
|
449
450
|
type: "button",
|
|
450
451
|
class: "nb-notification-center__retry",
|
|
451
|
-
onClick:
|
|
452
|
+
onClick: z
|
|
452
453
|
}, x(h.retryLabel), 1)) : d("", !0)
|
|
453
454
|
])) : d("", !0),
|
|
454
|
-
|
|
455
|
+
R.value === "loading" ? (v(), f("div", {
|
|
455
456
|
key: 1,
|
|
456
457
|
class: "nb-notification-center__loading",
|
|
457
458
|
role: "status",
|
|
458
|
-
style: _(
|
|
459
|
-
}, [p("span",
|
|
459
|
+
style: _(Le.value)
|
|
460
|
+
}, [p("span", ge, x(h.loadingLabel), 1), (v(), f(o, null, ae(3, (e) => m(i, {
|
|
460
461
|
key: e,
|
|
461
462
|
variant: "text",
|
|
462
463
|
type: "body-sm",
|
|
463
464
|
lines: 2,
|
|
464
465
|
"last-line-width": "60%"
|
|
465
|
-
})), 64))], 4)) :
|
|
466
|
+
})), 64))], 4)) : R.value === "error" ? (v(), f("div", {
|
|
466
467
|
key: 2,
|
|
467
|
-
id:
|
|
468
|
+
id: M,
|
|
468
469
|
class: "nb-notification-center__error",
|
|
469
470
|
role: "alert"
|
|
470
|
-
}, [b(l.$slots, "error", { retry:
|
|
471
|
+
}, [b(l.$slots, "error", { retry: z }, () => [m(t, {
|
|
471
472
|
size: "sm",
|
|
472
473
|
kind: "error",
|
|
473
474
|
title: h.errorTitle,
|
|
@@ -477,24 +478,24 @@ var A = /* @__PURE__ */ h({
|
|
|
477
478
|
fn: C(() => [m(n, {
|
|
478
479
|
size: "sm",
|
|
479
480
|
variant: "secondary",
|
|
480
|
-
onClick:
|
|
481
|
+
onClick: z
|
|
481
482
|
}, {
|
|
482
483
|
default: C(() => [te(x(h.retryLabel), 1)]),
|
|
483
484
|
_: 1
|
|
484
485
|
})]),
|
|
485
486
|
key: "0"
|
|
486
|
-
} : void 0]), 1032, ["title", "description"])])])) :
|
|
487
|
+
} : void 0]), 1032, ["title", "description"])])])) : R.value === "list" ? (v(), f("ul", {
|
|
487
488
|
key: 3,
|
|
488
489
|
ref_key: "listRef",
|
|
489
|
-
ref:
|
|
490
|
+
ref: we,
|
|
490
491
|
class: "nb-notification-center__list",
|
|
491
492
|
role: "list",
|
|
492
|
-
tabindex:
|
|
493
|
-
style: _(
|
|
494
|
-
onClick:
|
|
495
|
-
onKeydown:
|
|
493
|
+
tabindex: Ue.value,
|
|
494
|
+
style: _(Le.value),
|
|
495
|
+
onClick: Qe,
|
|
496
|
+
onKeydown: Qe
|
|
496
497
|
}, [b(l.$slots, "default", {
|
|
497
|
-
close:
|
|
498
|
+
close: U,
|
|
498
499
|
items: h.items
|
|
499
500
|
}, () => [(v(!0), f(o, null, ae(h.items, (e) => (v(), u(a, {
|
|
500
501
|
key: e.id,
|
|
@@ -510,7 +511,7 @@ var A = /* @__PURE__ */ h({
|
|
|
510
511
|
locale: h.locale,
|
|
511
512
|
"unread-label": h.unreadLabel,
|
|
512
513
|
"read-label": h.readLabel,
|
|
513
|
-
onSelect: (t) =>
|
|
514
|
+
onSelect: (t) => Ze(e, t)
|
|
514
515
|
}, null, 8, [
|
|
515
516
|
"title",
|
|
516
517
|
"body",
|
|
@@ -525,9 +526,9 @@ var A = /* @__PURE__ */ h({
|
|
|
525
526
|
"unread-label",
|
|
526
527
|
"read-label",
|
|
527
528
|
"onSelect"
|
|
528
|
-
]))), 128))])], 44,
|
|
529
|
+
]))), 128))])], 44, _e)) : R.value === "empty" ? (v(), f("div", ve, [b(l.$slots, "empty", {}, () => [m(t, {
|
|
529
530
|
size: "sm",
|
|
530
|
-
icon:
|
|
531
|
+
icon: O.value,
|
|
531
532
|
title: h.emptyTitle,
|
|
532
533
|
description: h.emptyDescription
|
|
533
534
|
}, null, 8, [
|
|
@@ -535,8 +536,8 @@ var A = /* @__PURE__ */ h({
|
|
|
535
536
|
"title",
|
|
536
537
|
"description"
|
|
537
538
|
])])])) : d("", !0),
|
|
538
|
-
l.$slots.footer ? (v(), f("div",
|
|
539
|
-
], 46,
|
|
539
|
+
l.$slots.footer ? (v(), f("div", ye, [b(l.$slots, "footer", { close: U })])) : d("", !0)
|
|
540
|
+
], 46, fe)) : d("", !0)]),
|
|
540
541
|
_: 3
|
|
541
542
|
})]))], 512));
|
|
542
543
|
}
|