@luzmo/lucero 1.0.3-alpha.6 → 1.0.3-alpha.8
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/components/action-menu/index.cjs +1 -1
- package/components/action-menu/index.js +1 -1
- package/components/{action-menu-DAzm6TyR.js → action-menu-BlR6cLpi.js} +2 -2
- package/components/{action-menu-BdCk6AXo.cjs → action-menu-C1C1Gx39.cjs} +1 -1
- package/components/color-area/color-area.d.ts +7 -0
- package/components/color-area/index.cjs +1 -1
- package/components/color-area/index.js +1 -1
- package/components/{color-area-DA3ps2-c.cjs → color-area-C3Y2d5cu.cjs} +2 -2
- package/components/{color-area-DViRjuKo.js → color-area-mWOctRNt.js} +8 -6
- package/components/color-menu/index.cjs +1 -1
- package/components/color-menu/index.js +1 -1
- package/components/{color-menu-DwbTxeqv.cjs → color-menu-BAKmi_EI.cjs} +1 -1
- package/components/{color-menu-Lxc9PTzl.js → color-menu-Cryp_5Gh.js} +1 -1
- package/components/color-picker/index.cjs +1 -1
- package/components/color-picker/index.js +1 -1
- package/components/{color-picker-CSWiU-X5.cjs → color-picker-DL7rqWnW.cjs} +1 -1
- package/components/{color-picker-DqjfTvYf.js → color-picker-DgjqWiVd.js} +2 -2
- package/components/date-range-picker/index.cjs +1 -1
- package/components/date-range-picker/index.js +1 -1
- package/components/{date-range-picker-BOTudFdP.cjs → date-range-picker-DdY9hGsU.cjs} +1 -1
- package/components/{date-range-picker-DaV1vcVx.js → date-range-picker-DocjwZKA.js} +1 -1
- package/components/date-time-picker/index.cjs +1 -1
- package/components/date-time-picker/index.js +1 -1
- package/components/{date-time-picker-qVon-GIh.js → date-time-picker-CPbIj4TN.js} +1 -1
- package/components/{date-time-picker-DpQWIAg0.cjs → date-time-picker-DdujhIkd.cjs} +1 -1
- package/components/index.cjs +1 -1
- package/components/index.js +14 -14
- package/components/menu/index.cjs +1 -1
- package/components/menu/index.d.ts +6 -4
- package/components/menu/index.js +1 -1
- package/components/menu/menu-item.d.ts +14 -0
- package/components/{menu--ukVtSq7.js → menu-Cdz2FEB7.js} +16 -7
- package/components/{menu-DAA51y45.cjs → menu-DFKS4sRU.cjs} +7 -7
- package/components/overlay/index.cjs +1 -1
- package/components/overlay/index.js +2 -2
- package/components/overlay/placement-controller.d.ts +8 -0
- package/components/{overlay-CMd2Dnpv.cjs → overlay-BGI4wOGe.cjs} +1 -1
- package/components/{overlay-8tN0KPbR.js → overlay-BbQuYBxp.js} +121 -115
- package/components/overlay-DU_p8MNs.cjs +47 -0
- package/components/{overlay-CwR_36OV.js → overlay-mdk7-NOt.js} +1 -1
- package/components/picker/index.cjs +1 -1
- package/components/picker/index.js +1 -1
- package/components/picker/picker.d.ts +7 -0
- package/components/{picker-C4RVOxLq.cjs → picker-CssPvvau.cjs} +13 -13
- package/components/{picker-agQW7YNo.js → picker-DOiM_cUu.js} +18 -15
- package/components/prompt-box/index.cjs +1 -1
- package/components/prompt-box/index.js +1 -1
- package/components/{prompt-box-BjjBnJ7C.cjs → prompt-box-6Z5LIjCF.cjs} +1 -1
- package/components/{prompt-box-CCh9aOjY.js → prompt-box-Bj0qIPOy.js} +3 -3
- package/components/select/index.cjs +1 -1
- package/components/select/index.js +1 -1
- package/components/select/select.d.ts +7 -0
- package/components/{select-BNDNv50o.js → select-C2gh8zRr.js} +10 -7
- package/components/{select-L6dKp-qu.cjs → select-qAKOLhmQ.cjs} +6 -6
- package/components/tags/index.cjs +1 -1
- package/components/tags/index.js +1 -1
- package/components/{tags-DQLiHnTr.js → tags-CBL5oFEo.js} +6 -3
- package/components/{tags-DBD74tKB.cjs → tags-CndS4S2k.cjs} +2 -2
- package/components/tooltip/index.cjs +1 -1
- package/components/tooltip/index.js +1 -1
- package/components/tooltip/tooltip.d.ts +30 -2
- package/components/{tooltip-DY1trLtg.cjs → tooltip-6y-g7e9V.cjs} +3 -3
- package/components/{tooltip-C3O4AQ1l.js → tooltip-CVSSKlDP.js} +23 -8
- package/custom-elements.json +1 -1
- package/package.json +1 -1
- package/components/overlay-DdrfkOry.cjs +0 -47
|
@@ -23,20 +23,20 @@ import { n as a, t as o } from "./element-resolution-Bs1x89vU.js";
|
|
|
23
23
|
import { n as s, t as c } from "./slottable-request-event-DZ2Z_BLk.js";
|
|
24
24
|
import { n as l } from "./focusable-selectors-Bg60_Kra.js";
|
|
25
25
|
import { a as u, t as d, u as f } from "./platform-D4V_cOJF.js";
|
|
26
|
-
import { html as p, unsafeCSS as
|
|
27
|
-
import { property as
|
|
28
|
-
import { ifDefined as
|
|
29
|
-
import { styleMap as
|
|
30
|
-
import { arrow as
|
|
26
|
+
import { html as p, unsafeCSS as m } from "lit";
|
|
27
|
+
import { property as h, query as g, queryAssignedElements as _, state as ee } from "lit/decorators.js";
|
|
28
|
+
import { ifDefined as v } from "lit/directives/if-defined.js";
|
|
29
|
+
import { styleMap as y } from "lit/directives/style-map.js";
|
|
30
|
+
import { arrow as te, autoUpdate as b, computePosition as x, flip as S, offset as ne, shift as re, size as ie } from "@floating-ui/dom";
|
|
31
31
|
//#region src/utils/reparent-child.ts
|
|
32
|
-
function
|
|
32
|
+
function ae(e, t, n = []) {
|
|
33
33
|
for (let [r, i] of t.entries()) {
|
|
34
34
|
let t = e[r], a = t.parentElement || t.getRootNode();
|
|
35
35
|
n[r] && n[r](i), a && a !== t && t.replaceWith(i), delete e[r];
|
|
36
36
|
}
|
|
37
37
|
return t;
|
|
38
38
|
}
|
|
39
|
-
var
|
|
39
|
+
var oe = (e, t, { position: n, prepareCallback: r } = { position: "beforeend" }) => {
|
|
40
40
|
let { length: i } = e;
|
|
41
41
|
if (i === 0) return () => e;
|
|
42
42
|
let a = 1, o = 0;
|
|
@@ -49,11 +49,11 @@ var se = (e, t, { position: n, prepareCallback: r } = { position: "beforeend" })
|
|
|
49
49
|
u && u !== i && u.replaceChild(s[o], i), t.insertAdjacentElement(n, i), o += a;
|
|
50
50
|
} while (--i > 0);
|
|
51
51
|
return function() {
|
|
52
|
-
return
|
|
52
|
+
return ae(s, e, c);
|
|
53
53
|
};
|
|
54
|
-
},
|
|
54
|
+
}, se = 1e3, C = 1e3, w = new class {
|
|
55
55
|
constructor(e = {}) {
|
|
56
|
-
this.warmUpDelay =
|
|
56
|
+
this.warmUpDelay = se, this.coolDownDelay = C, this.isWarm = !1, this.timeout = 0, Object.assign(this, e);
|
|
57
57
|
}
|
|
58
58
|
openTimer(e) {
|
|
59
59
|
if (this.cancelCooldownTimer(), !this.component || e !== this.component) return this.component && (this.close(this.component), this.cancelCooldownTimer()), this.component = e, this.isWarm ? Promise.resolve(!1) : (this.promise = new Promise((e) => {
|
|
@@ -75,7 +75,7 @@ var se = (e, t, { position: n, prepareCallback: r } = { position: "beforeend" })
|
|
|
75
75
|
cancelCooldownTimer() {
|
|
76
76
|
this.cooldownTimeout && typeof window < "u" && window.clearTimeout(this.cooldownTimeout), delete this.cooldownTimeout;
|
|
77
77
|
}
|
|
78
|
-
}(),
|
|
78
|
+
}(), T = () => {}, E = (e, t, n) => {
|
|
79
79
|
let r = new AbortController(), i = /* @__PURE__ */ new Map(), a = () => {
|
|
80
80
|
r.abort(), n();
|
|
81
81
|
}, o, s, c = requestAnimationFrame(() => {
|
|
@@ -91,12 +91,12 @@ var se = (e, t, { position: n, prepareCallback: r } = { position: "beforeend" })
|
|
|
91
91
|
t.target === e && (i.has(t.propertyName) || i.set(t.propertyName, 0), i.set(t.propertyName, i.get(t.propertyName) + 1), cancelAnimationFrame(c), cancelAnimationFrame(o), cancelAnimationFrame(s));
|
|
92
92
|
}, { signal: r.signal }), e.addEventListener("transitionend", l, { signal: r.signal }), e.addEventListener("transitioncancel", l, { signal: r.signal }), t();
|
|
93
93
|
};
|
|
94
|
-
function
|
|
94
|
+
function D() {
|
|
95
95
|
return new Promise((e) => requestAnimationFrame(() => e()));
|
|
96
96
|
}
|
|
97
|
-
var
|
|
97
|
+
var O = class e extends t {
|
|
98
98
|
constructor(...e) {
|
|
99
|
-
super(...e), this.dispose =
|
|
99
|
+
super(...e), this.dispose = T, this.offset = 0, this.willPreventClose = !1;
|
|
100
100
|
}
|
|
101
101
|
applyFocus(e, t) {}
|
|
102
102
|
/* c8 ignore next 6 */
|
|
@@ -158,7 +158,7 @@ var D = class e extends t {
|
|
|
158
158
|
}
|
|
159
159
|
static async open(t, n, r, i) {
|
|
160
160
|
await Promise.resolve().then(() => Z);
|
|
161
|
-
let a = arguments.length === 2, o = r || t, s = new this(), c = !1, l =
|
|
161
|
+
let a = arguments.length === 2, o = r || t, s = new this(), c = !1, l = oe([o], s, {
|
|
162
162
|
position: "beforeend",
|
|
163
163
|
prepareCallback: (e) => {
|
|
164
164
|
let t = e.slot;
|
|
@@ -172,7 +172,7 @@ var D = class e extends t {
|
|
|
172
172
|
c ||= (l(), !0), requestAnimationFrame(() => {
|
|
173
173
|
s.remove();
|
|
174
174
|
});
|
|
175
|
-
}), s.open = !1, s.dispose =
|
|
175
|
+
}), s.open = !1, s.dispose = T;
|
|
176
176
|
}, !a && o && i) {
|
|
177
177
|
let r = t, a = n, c = i;
|
|
178
178
|
return e.applyOptions(s, {
|
|
@@ -193,21 +193,21 @@ var D = class e extends t {
|
|
|
193
193
|
static applyOptions(e, t) {
|
|
194
194
|
e.delayed = !!t.delayed, e.receivesFocus = t.receivesFocus ?? "auto", e.triggerElement = t.trigger || null, e.type = t.type || "modal", e.offset = t.offset ?? 0, e.placement = t.placement, e.willPreventClose = !!t.notImmediatelyClosable;
|
|
195
195
|
}
|
|
196
|
-
},
|
|
196
|
+
}, k = (e) => e.querySelector(l), A = (e) => e.assignedElements().find((e) => e.matches(l)), j = class extends Event {
|
|
197
197
|
constructor() {
|
|
198
198
|
super("beforetoggle", {
|
|
199
199
|
bubbles: !1,
|
|
200
200
|
composed: !1
|
|
201
201
|
}), this.currentState = "open", this.newState = "closed";
|
|
202
202
|
}
|
|
203
|
-
},
|
|
203
|
+
}, M = class extends Event {
|
|
204
204
|
constructor() {
|
|
205
205
|
super("beforetoggle", {
|
|
206
206
|
bubbles: !1,
|
|
207
207
|
composed: !1
|
|
208
208
|
}), this.currentState = "closed", this.newState = "open";
|
|
209
209
|
}
|
|
210
|
-
},
|
|
210
|
+
}, N = class extends Event {
|
|
211
211
|
constructor(e, t, { publish: n, interaction: r, reason: i }) {
|
|
212
212
|
super(e, {
|
|
213
213
|
bubbles: n,
|
|
@@ -217,12 +217,12 @@ var D = class e extends t {
|
|
|
217
217
|
reason: i
|
|
218
218
|
};
|
|
219
219
|
}
|
|
220
|
-
},
|
|
220
|
+
}, P = class {
|
|
221
221
|
constructor(e, t, n) {
|
|
222
222
|
this.x = 0, this.y = 0, this.x = e, this.y = t, this.rectTop = n;
|
|
223
223
|
}
|
|
224
224
|
updateBoundingClientRect(e, t, n) {
|
|
225
|
-
this.x = e, this.y = t, this.rectTop = n,
|
|
225
|
+
this.x = e, this.y = t, this.rectTop = n, O.update();
|
|
226
226
|
}
|
|
227
227
|
getBoundingClientRect() {
|
|
228
228
|
let e = this.rectTop ?? this.y;
|
|
@@ -241,11 +241,11 @@ var D = class e extends t {
|
|
|
241
241
|
};
|
|
242
242
|
//#endregion
|
|
243
243
|
//#region src/components/overlay/overlay-dialog.ts
|
|
244
|
-
function
|
|
244
|
+
function ce(e) {
|
|
245
245
|
class t extends e {
|
|
246
246
|
async manageDialogOpen() {
|
|
247
247
|
let e = this.open;
|
|
248
|
-
if (await
|
|
248
|
+
if (await D(), await this.managePosition(), this.open !== e) return;
|
|
249
249
|
let t = await this.dialogMakeTransition(e);
|
|
250
250
|
this.open === e && await this.dialogApplyFocus(e, t);
|
|
251
251
|
}
|
|
@@ -258,15 +258,15 @@ function le(e) {
|
|
|
258
258
|
n.addEventListener("close", e);
|
|
259
259
|
}
|
|
260
260
|
if (r > 0) return;
|
|
261
|
-
let i = e ?
|
|
262
|
-
this.dispatchEvent(new i()), e && (n.matches(l) && (t = n), t ||=
|
|
263
|
-
t ||=
|
|
261
|
+
let i = e ? M : j;
|
|
262
|
+
this.dispatchEvent(new i()), e && (n.matches(l) && (t = n), t ||= k(n), t || n.querySelectorAll("slot").forEach((e) => {
|
|
263
|
+
t ||= A(e);
|
|
264
264
|
}), !(!this.isConnected || this.dialogEl.open) && this.dialogEl.showModal());
|
|
265
265
|
}, r = (t, n) => () => {
|
|
266
266
|
if (this.open !== e) return;
|
|
267
267
|
let r = e ? "luzmo-opened" : "luzmo-closed";
|
|
268
268
|
if (n > 0) {
|
|
269
|
-
t.dispatchEvent(new
|
|
269
|
+
t.dispatchEvent(new N(r, this, {
|
|
270
270
|
interaction: this.type,
|
|
271
271
|
publish: !1
|
|
272
272
|
}));
|
|
@@ -274,24 +274,24 @@ function le(e) {
|
|
|
274
274
|
}
|
|
275
275
|
if (!this.isConnected || e !== this.open) return;
|
|
276
276
|
let i = async () => {
|
|
277
|
-
let n = this.triggerElement instanceof
|
|
278
|
-
this.dispatchEvent(new
|
|
277
|
+
let n = this.triggerElement instanceof P;
|
|
278
|
+
this.dispatchEvent(new N(r, this, {
|
|
279
279
|
interaction: this.type,
|
|
280
280
|
publish: n
|
|
281
|
-
})), t.dispatchEvent(new
|
|
281
|
+
})), t.dispatchEvent(new N(r, this, {
|
|
282
282
|
interaction: this.type,
|
|
283
283
|
publish: !1
|
|
284
|
-
})), this.triggerElement && !n && this.triggerElement.dispatchEvent(new
|
|
284
|
+
})), this.triggerElement && !n && this.triggerElement.dispatchEvent(new N(r, this, {
|
|
285
285
|
interaction: this.type,
|
|
286
286
|
publish: !0
|
|
287
|
-
})), this.state = e ? "opened" : "closed", this.returnFocus(), await
|
|
287
|
+
})), this.state = e ? "opened" : "closed", this.returnFocus(), await D(), await D(), e === this.open && e === !1 && this.requestSlottable();
|
|
288
288
|
};
|
|
289
289
|
!e && this.dialogEl.open ? (this.dialogEl.addEventListener("close", () => {
|
|
290
290
|
i();
|
|
291
291
|
}, { once: !0 }), this.dialogEl.close()) : i();
|
|
292
292
|
};
|
|
293
293
|
return this.elements.forEach((e, t) => {
|
|
294
|
-
|
|
294
|
+
E(e, n(e, t), r(e, t));
|
|
295
295
|
}), t;
|
|
296
296
|
}
|
|
297
297
|
dialogApplyFocus(e, t) {
|
|
@@ -302,17 +302,17 @@ function le(e) {
|
|
|
302
302
|
}
|
|
303
303
|
//#endregion
|
|
304
304
|
//#region src/components/overlay/overlay-no-popover.ts
|
|
305
|
-
function
|
|
305
|
+
function le(e) {
|
|
306
306
|
class t extends e {
|
|
307
307
|
async managePopoverOpen() {
|
|
308
308
|
await this.managePosition();
|
|
309
309
|
}
|
|
310
310
|
async manageDelay(e) {
|
|
311
311
|
if (e === !1 || e !== this.open) {
|
|
312
|
-
|
|
312
|
+
w.close(this);
|
|
313
313
|
return;
|
|
314
314
|
}
|
|
315
|
-
this.delayed && await
|
|
315
|
+
this.delayed && await w.openTimer(this) && (this.open = !e);
|
|
316
316
|
}
|
|
317
317
|
ensureOnDOM(e) {
|
|
318
318
|
document.body.offsetHeight;
|
|
@@ -322,28 +322,28 @@ function ue(e) {
|
|
|
322
322
|
let t = null, n = (n, r) => () => {
|
|
323
323
|
if (e === this.open) {
|
|
324
324
|
if (n.open = e, r === 0) {
|
|
325
|
-
let t = e ?
|
|
325
|
+
let t = e ? M : j;
|
|
326
326
|
this.dispatchEvent(new t());
|
|
327
327
|
}
|
|
328
|
-
e === !0 && (n.matches(l) && (t = n), t ||=
|
|
329
|
-
t ||=
|
|
328
|
+
e === !0 && (n.matches(l) && (t = n), t ||= k(n), !t && n.querySelectorAll("slot").forEach((e) => {
|
|
329
|
+
t ||= A(e);
|
|
330
330
|
}));
|
|
331
331
|
}
|
|
332
332
|
}, r = (t, n) => async () => {
|
|
333
333
|
if (this.open !== e) return;
|
|
334
334
|
let r = e ? "luzmo-opened" : "luzmo-closed";
|
|
335
|
-
if (t.dispatchEvent(new
|
|
336
|
-
let i = this.triggerElement instanceof
|
|
337
|
-
this.dispatchEvent(new
|
|
335
|
+
if (t.dispatchEvent(new N(r, this, { interaction: this.type })), n > 0) return;
|
|
336
|
+
let i = this.triggerElement instanceof P;
|
|
337
|
+
this.dispatchEvent(new N(r, this, {
|
|
338
338
|
interaction: this.type,
|
|
339
339
|
publish: i
|
|
340
|
-
})), this.triggerElement && !i && this.triggerElement.dispatchEvent(new
|
|
340
|
+
})), this.triggerElement && !i && this.triggerElement.dispatchEvent(new N(r, this, {
|
|
341
341
|
interaction: this.type,
|
|
342
342
|
publish: !0
|
|
343
|
-
})), this.state = e ? "opened" : "closed", this.returnFocus(), await
|
|
343
|
+
})), this.state = e ? "opened" : "closed", this.returnFocus(), await D(), await D(), e === this.open && e === !1 && this.requestSlottable();
|
|
344
344
|
};
|
|
345
345
|
return this.elements.forEach((e, t) => {
|
|
346
|
-
|
|
346
|
+
E(e, n(e, t), r(e, t));
|
|
347
347
|
}), t;
|
|
348
348
|
}
|
|
349
349
|
}
|
|
@@ -351,8 +351,8 @@ function ue(e) {
|
|
|
351
351
|
}
|
|
352
352
|
//#endregion
|
|
353
353
|
//#region src/components/overlay/overlay-popover.ts
|
|
354
|
-
var
|
|
355
|
-
function
|
|
354
|
+
var ue = typeof CSS < "u" && CSS.supports("(overlay: auto)");
|
|
355
|
+
function F(e) {
|
|
356
356
|
let t = !1;
|
|
357
357
|
try {
|
|
358
358
|
t = e.matches(":popover-open");
|
|
@@ -363,21 +363,21 @@ function P(e) {
|
|
|
363
363
|
} catch {}
|
|
364
364
|
return t || n;
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function de(e) {
|
|
367
367
|
class t extends e {
|
|
368
368
|
async manageDelay(e) {
|
|
369
369
|
if (e === !1 || e !== this.open) {
|
|
370
|
-
|
|
370
|
+
w.close(this);
|
|
371
371
|
return;
|
|
372
372
|
}
|
|
373
|
-
this.delayed && await
|
|
373
|
+
this.delayed && await w.openTimer(this) && (this.open = !e);
|
|
374
374
|
}
|
|
375
375
|
shouldHidePopover(e) {
|
|
376
376
|
if (e && this.open !== e) return;
|
|
377
377
|
let t = async ({ newState: e } = {}) => {
|
|
378
378
|
e !== "open" && await this.placementController.resetOverlayPosition();
|
|
379
379
|
};
|
|
380
|
-
if (!
|
|
380
|
+
if (!F(this.dialogEl)) {
|
|
381
381
|
t();
|
|
382
382
|
return;
|
|
383
383
|
}
|
|
@@ -395,23 +395,23 @@ function F(e) {
|
|
|
395
395
|
e && this.open === e && !t && !n && this.isConnected && (this.dialogEl.showPopover(), this.managePosition());
|
|
396
396
|
}
|
|
397
397
|
async ensureOnDOM(e) {
|
|
398
|
-
|
|
398
|
+
ue || await this.shouldHidePopover(e), this.shouldShowPopover(e), await D();
|
|
399
399
|
}
|
|
400
400
|
makeTransition(e) {
|
|
401
401
|
if (this.open !== e) return null;
|
|
402
402
|
let t = null, n = (n, r) => () => {
|
|
403
403
|
if (n.open = e, r === 0) {
|
|
404
|
-
let t = e ?
|
|
404
|
+
let t = e ? M : j;
|
|
405
405
|
this.dispatchEvent(new t());
|
|
406
406
|
}
|
|
407
|
-
e && (n.matches(l) && (t = n), t ||=
|
|
408
|
-
t ||=
|
|
407
|
+
e && (n.matches(l) && (t = n), t ||= k(n), !t && n.querySelectorAll("slot").forEach((e) => {
|
|
408
|
+
t ||= A(e);
|
|
409
409
|
}));
|
|
410
410
|
}, r = (t, n) => () => {
|
|
411
411
|
if (this.open !== e) return;
|
|
412
412
|
let r = e ? "luzmo-opened" : "luzmo-closed";
|
|
413
413
|
if (n > 0) {
|
|
414
|
-
t.dispatchEvent(new
|
|
414
|
+
t.dispatchEvent(new N(r, this, {
|
|
415
415
|
interaction: this.type,
|
|
416
416
|
publish: !1
|
|
417
417
|
}));
|
|
@@ -419,27 +419,27 @@ function F(e) {
|
|
|
419
419
|
}
|
|
420
420
|
let i = async () => {
|
|
421
421
|
if (this.open !== e) return;
|
|
422
|
-
await
|
|
423
|
-
let n = this.triggerElement instanceof
|
|
424
|
-
this.dispatchEvent(new
|
|
422
|
+
await D();
|
|
423
|
+
let n = this.triggerElement instanceof P;
|
|
424
|
+
this.dispatchEvent(new N(r, this, {
|
|
425
425
|
interaction: this.type,
|
|
426
426
|
publish: n
|
|
427
|
-
})), t.dispatchEvent(new
|
|
427
|
+
})), t.dispatchEvent(new N(r, this, {
|
|
428
428
|
interaction: this.type,
|
|
429
429
|
publish: !1
|
|
430
|
-
})), this.triggerElement && !n && this.triggerElement.dispatchEvent(new
|
|
430
|
+
})), this.triggerElement && !n && this.triggerElement.dispatchEvent(new N(r, this, {
|
|
431
431
|
interaction: this.type,
|
|
432
432
|
publish: !0
|
|
433
|
-
})), this.state = e ? "opened" : "closed", this.returnFocus(), await
|
|
433
|
+
})), this.state = e ? "opened" : "closed", this.returnFocus(), await D(), await D(), e === this.open && e === !1 && this.requestSlottable();
|
|
434
434
|
};
|
|
435
435
|
if (this.open !== e) return;
|
|
436
|
-
let a =
|
|
436
|
+
let a = F(this.dialogEl);
|
|
437
437
|
e !== !0 && a && this.isConnected ? (this.dialogEl.addEventListener("beforetoggle", () => {
|
|
438
438
|
i();
|
|
439
439
|
}, { once: !0 }), this.dialogEl.hidePopover()) : i();
|
|
440
440
|
};
|
|
441
441
|
return this.elements.forEach((e, t) => {
|
|
442
|
-
|
|
442
|
+
E(e, n(e, t), r(e, t));
|
|
443
443
|
}), t;
|
|
444
444
|
}
|
|
445
445
|
}
|
|
@@ -604,7 +604,7 @@ var z = 8, B = 100, pe = (e) => ({
|
|
|
604
604
|
]
|
|
605
605
|
})[e] ?? [e], me = Symbol("placement updated"), V = class {
|
|
606
606
|
constructor(e) {
|
|
607
|
-
this.originalPlacements = /* @__PURE__ */ new WeakMap(), this.allowPlacementUpdate = !1, this.closeForAncestorUpdate = () => {
|
|
607
|
+
this.originalPlacements = /* @__PURE__ */ new WeakMap(), this.placementGeneration = 0, this.allowPlacementUpdate = !1, this.closeForAncestorUpdate = () => {
|
|
608
608
|
!this.allowPlacementUpdate && this.options.type !== "modal" && this.cleanup && this.target.dispatchEvent(new Event("close", { bubbles: !0 })), this.allowPlacementUpdate = !1;
|
|
609
609
|
}, this.updatePlacement = () => {
|
|
610
610
|
this.computePlacement();
|
|
@@ -613,35 +613,39 @@ var z = 8, B = 100, pe = (e) => ({
|
|
|
613
613
|
}, this.host = e, this.host.addController(this);
|
|
614
614
|
}
|
|
615
615
|
placeOverlay(e = this.target, t = this.options) {
|
|
616
|
-
if (this.target = e, this.options = t, !e || !t) return;
|
|
617
|
-
let n =
|
|
616
|
+
if (this.cleanup?.(), this.cleanup = void 0, this.target = e, this.options = t, !e || !t) return;
|
|
617
|
+
let n = b(t.trigger, e, this.closeForAncestorUpdate, {
|
|
618
618
|
ancestorResize: !1,
|
|
619
619
|
elementResize: !1,
|
|
620
620
|
layoutShift: !1
|
|
621
|
-
}), r =
|
|
622
|
-
|
|
623
|
-
|
|
621
|
+
}), r = b(t.trigger, e, this.updatePlacement, { ancestorScroll: !1 }), i = window.visualViewport, a = 0, o = !1, s = () => {
|
|
622
|
+
o || a || (a = requestAnimationFrame(() => {
|
|
623
|
+
a = 0, !o && this.updatePlacement();
|
|
624
|
+
}));
|
|
625
|
+
};
|
|
626
|
+
i && f() && (i.addEventListener("resize", s, { passive: !0 }), i.addEventListener("scroll", s, { passive: !0 })), this.cleanup = () => {
|
|
627
|
+
this.placementGeneration += 1, o = !0, this.host.elements?.forEach((e) => {
|
|
624
628
|
e.addEventListener("luzmo-closed", () => {
|
|
625
629
|
let t = this.originalPlacements.get(e);
|
|
626
630
|
t && e.setAttribute("placement", t), this.originalPlacements.delete(e);
|
|
627
631
|
}, { once: !0 });
|
|
628
|
-
}), n(), r();
|
|
632
|
+
}), n(), r(), i && f() && (i.removeEventListener("resize", s), i.removeEventListener("scroll", s), a &&= (cancelAnimationFrame(a), 0));
|
|
629
633
|
};
|
|
630
634
|
}
|
|
631
635
|
async computePlacement() {
|
|
632
|
-
let { options: e, target: t } = this;
|
|
633
|
-
await (document.fonts ? document.fonts.ready : Promise.resolve());
|
|
634
|
-
let
|
|
636
|
+
let { options: e, target: t } = this, n = this.placementGeneration, r = () => this.placementGeneration === n && !!this.target && this.target === t;
|
|
637
|
+
if (await (document.fonts ? document.fonts.ready : Promise.resolve()), !r() || f() && (await new Promise((e) => requestAnimationFrame(e)), !r())) return;
|
|
638
|
+
let i = e.trigger instanceof HTMLElement ? S() : S({
|
|
635
639
|
padding: z,
|
|
636
640
|
fallbackPlacements: pe(e.placement)
|
|
637
|
-
}), [
|
|
638
|
-
|
|
639
|
-
mainAxis:
|
|
640
|
-
crossAxis:
|
|
641
|
+
}), [a = 0, o = 0] = Array.isArray(e?.offset) ? e.offset : [e.offset, 0], s = this.host.elements.find((e) => e.tipElement)?.tipElement, c = [
|
|
642
|
+
ne({
|
|
643
|
+
mainAxis: a,
|
|
644
|
+
crossAxis: o
|
|
641
645
|
}),
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
646
|
+
re({ padding: z }),
|
|
647
|
+
i,
|
|
648
|
+
ie({
|
|
645
649
|
padding: z,
|
|
646
650
|
apply: ({ availableWidth: e, availableHeight: n, rects: { floating: r } }) => {
|
|
647
651
|
let i = Math.max(B, Math.floor(n)), a = r.height;
|
|
@@ -653,26 +657,28 @@ var z = 8, B = 100, pe = (e) => ({
|
|
|
653
657
|
});
|
|
654
658
|
}
|
|
655
659
|
}),
|
|
656
|
-
...
|
|
657
|
-
element:
|
|
660
|
+
...s ? [te({
|
|
661
|
+
element: s,
|
|
658
662
|
padding: e.tipPadding || z
|
|
659
663
|
})] : []
|
|
660
|
-
], { x:
|
|
664
|
+
], { x: l, y: u, placement: d, middlewareData: p } = await x(e.trigger, t, {
|
|
661
665
|
placement: e.placement,
|
|
662
|
-
middleware:
|
|
666
|
+
middleware: c,
|
|
663
667
|
strategy: "fixed"
|
|
664
668
|
});
|
|
665
|
-
if (
|
|
669
|
+
if (!r()) return;
|
|
670
|
+
let m = l, h = u, g = window.visualViewport;
|
|
671
|
+
if (g && f() && (m -= g.offsetLeft, h -= g.offsetTop), Object.assign(t.style, {
|
|
666
672
|
top: "0px",
|
|
667
673
|
left: "0px",
|
|
668
|
-
translate: `${R(
|
|
669
|
-
}), t.setAttribute("actual-placement",
|
|
670
|
-
this.originalPlacements.has(e) || this.originalPlacements.set(e, e.getAttribute("placement")), e.setAttribute("placement",
|
|
671
|
-
}),
|
|
672
|
-
let { x: e, y: t } =
|
|
673
|
-
Object.assign(
|
|
674
|
-
top:
|
|
675
|
-
left:
|
|
674
|
+
translate: `${R(m)}px ${R(h)}px`
|
|
675
|
+
}), t.setAttribute("actual-placement", d), this.host.elements?.forEach((e) => {
|
|
676
|
+
this.originalPlacements.has(e) || this.originalPlacements.set(e, e.getAttribute("placement")), e.setAttribute("placement", d);
|
|
677
|
+
}), s && p.arrow) {
|
|
678
|
+
let { x: e, y: t } = p.arrow;
|
|
679
|
+
Object.assign(s.style, {
|
|
680
|
+
top: d.startsWith("right") || d.startsWith("left") ? "0px" : "",
|
|
681
|
+
left: d.startsWith("bottom") || d.startsWith("top") ? "0px" : "",
|
|
676
682
|
translate: `${R(e)}px ${R(t)}px`
|
|
677
683
|
});
|
|
678
684
|
}
|
|
@@ -788,7 +794,7 @@ var z = 8, B = 100, pe = (e) => ({
|
|
|
788
794
|
prepareOverlayRelativeDescription() {
|
|
789
795
|
let e = r(this.target, "aria-describedby", [this.overlay.id]);
|
|
790
796
|
this.releaseDescription = () => {
|
|
791
|
-
e(), this.releaseDescription =
|
|
797
|
+
e(), this.releaseDescription = T;
|
|
792
798
|
};
|
|
793
799
|
}
|
|
794
800
|
prepareContentRelativeDescription() {
|
|
@@ -798,7 +804,7 @@ var z = 8, B = 100, pe = (e) => ({
|
|
|
798
804
|
this.releaseDescription = () => {
|
|
799
805
|
n(), this.overlay.elements.map((e, t) => {
|
|
800
806
|
e.id = this.elementIds[t];
|
|
801
|
-
}), this.releaseDescription =
|
|
807
|
+
}), this.releaseDescription = T;
|
|
802
808
|
};
|
|
803
809
|
}
|
|
804
810
|
doPointerleave() {
|
|
@@ -827,7 +833,7 @@ var z = 8, B = 100, pe = (e) => ({
|
|
|
827
833
|
mouse: "Click and hold for additional options"
|
|
828
834
|
}, Y = class extends G {
|
|
829
835
|
constructor(...e) {
|
|
830
|
-
super(...e), this.type = H.longpress, this.longpressState = null, this.releaseDescription =
|
|
836
|
+
super(...e), this.type = H.longpress, this.longpressState = null, this.releaseDescription = T, this.handlePointerup = () => {
|
|
831
837
|
clearTimeout(this.timeout), this.target && (this.longpressState = this.overlay?.state === "opening" ? "pressed" : null, document.removeEventListener("pointerup", this.handlePointerup), document.removeEventListener("pointercancel", this.handlePointerup));
|
|
832
838
|
};
|
|
833
839
|
}
|
|
@@ -864,14 +870,14 @@ var z = 8, B = 100, pe = (e) => ({
|
|
|
864
870
|
}
|
|
865
871
|
}
|
|
866
872
|
prepareDescription(e) {
|
|
867
|
-
if (this.releaseDescription !==
|
|
873
|
+
if (this.releaseDescription !== T || this.overlay.elements.length === 0) return;
|
|
868
874
|
let t = document.createElement("div");
|
|
869
875
|
t.id = `longpress-describedby-descriptor-${i()}`, t.textContent = J[u() || d() ? "touch" : "keyboard"], t.slot = "longpress-describedby-descriptor";
|
|
870
876
|
let n = e.getRootNode();
|
|
871
877
|
n === this.overlay.getRootNode() ? this.overlay.append(t) : (t.hidden = !("host" in n), e.after(t));
|
|
872
878
|
let a = r(e, "aria-describedby", [t.id]);
|
|
873
879
|
this.releaseDescription = () => {
|
|
874
|
-
a(), t.remove(), this.releaseDescription =
|
|
880
|
+
a(), t.remove(), this.releaseDescription = T;
|
|
875
881
|
};
|
|
876
882
|
}
|
|
877
883
|
shouldCompleteOpen() {
|
|
@@ -886,8 +892,8 @@ var z = 8, B = 100, pe = (e) => ({
|
|
|
886
892
|
click: K,
|
|
887
893
|
longpress: Y,
|
|
888
894
|
hover: q
|
|
889
|
-
}, Z = /* @__PURE__ */ e({ LuzmoOverlay: () => $ }), _e = typeof document < "u" && "showPopover" in document.createElement("div"), Q =
|
|
890
|
-
Q = _e ?
|
|
895
|
+
}, Z = /* @__PURE__ */ e({ LuzmoOverlay: () => $ }), _e = typeof document < "u" && "showPopover" in document.createElement("div"), Q = ce(O);
|
|
896
|
+
Q = _e ? de(Q) : le(Q);
|
|
891
897
|
var $ = class e extends Q {
|
|
892
898
|
constructor(...e) {
|
|
893
899
|
super(...e), this._delayed = !1, this._disabled = !1, this.offset = 0, this._open = !1, this.lastRequestSlottableState = !1, this.receivesFocus = "auto", this._state = "closed", this.triggerElement = null, this.type = "auto", this.wasOpen = !1, this.closeOnFocusOut = (e) => {
|
|
@@ -902,7 +908,7 @@ var $ = class e extends Q {
|
|
|
902
908
|
};
|
|
903
909
|
}
|
|
904
910
|
static {
|
|
905
|
-
this.styles = [
|
|
911
|
+
this.styles = [m(L)];
|
|
906
912
|
}
|
|
907
913
|
get delayed() {
|
|
908
914
|
return this.elements.at(-1)?.hasAttribute("delayed") || this._delayed;
|
|
@@ -917,7 +923,7 @@ var $ = class e extends Q {
|
|
|
917
923
|
this._disabled = e, e ? (this.strategy?.abort(), this.wasOpen = this.open, this.open = !1) : (this.bindEvents(), this.open = this.open || this.wasOpen, this.wasOpen = !1);
|
|
918
924
|
}
|
|
919
925
|
get hasNonVirtualTrigger() {
|
|
920
|
-
return !!this.triggerElement && !(this.triggerElement instanceof
|
|
926
|
+
return !!this.triggerElement && !(this.triggerElement instanceof P);
|
|
921
927
|
}
|
|
922
928
|
get placementController() {
|
|
923
929
|
return this._placementController ||= new V(this), this._placementController;
|
|
@@ -970,13 +976,13 @@ var $ = class e extends Q {
|
|
|
970
976
|
async managePopoverOpen() {
|
|
971
977
|
super.managePopoverOpen();
|
|
972
978
|
let e = this.open;
|
|
973
|
-
if (this.open !== e || (await this.manageDelay(e), this.open !== e) || (this.triggerInteraction === "longpress" && await
|
|
979
|
+
if (this.open !== e || (await this.manageDelay(e), this.open !== e) || (this.triggerInteraction === "longpress" && await D(), await this.ensureOnDOM(e), this.open !== e)) return;
|
|
974
980
|
let t = await this.makeTransition(e);
|
|
975
981
|
this.open === e && await this.applyFocus(e, t);
|
|
976
982
|
}
|
|
977
983
|
async applyFocus(e, t) {
|
|
978
984
|
if (!(this.receivesFocus === "false" || this.type === "hint")) {
|
|
979
|
-
if (await
|
|
985
|
+
if (await D(), await D(), e === this.open && !this.open) {
|
|
980
986
|
this.hasNonVirtualTrigger && this.contains(this.getRootNode().activeElement) && this.triggerElement.focus();
|
|
981
987
|
return;
|
|
982
988
|
}
|
|
@@ -1057,8 +1063,8 @@ var $ = class e extends Q {
|
|
|
1057
1063
|
<dialog
|
|
1058
1064
|
class="dialog"
|
|
1059
1065
|
part="dialog"
|
|
1060
|
-
placement=${
|
|
1061
|
-
style=${
|
|
1066
|
+
placement=${v(this.requiresPositioning ? this.placement || "right" : void 0)}
|
|
1067
|
+
style=${y(this.dialogStyleMap)}
|
|
1062
1068
|
@close=${this.handleBrowserClose}
|
|
1063
1069
|
@cancel=${this.handleDialogCancel}
|
|
1064
1070
|
@beforetoggle=${this.handleBeforetoggle}
|
|
@@ -1073,9 +1079,9 @@ var $ = class e extends Q {
|
|
|
1073
1079
|
<div
|
|
1074
1080
|
class="dialog"
|
|
1075
1081
|
part="dialog"
|
|
1076
|
-
placement=${
|
|
1077
|
-
popover=${
|
|
1078
|
-
style=${
|
|
1082
|
+
placement=${v(this.requiresPositioning ? this.placement || "right" : void 0)}
|
|
1083
|
+
popover=${v(this.popoverValue)}
|
|
1084
|
+
style=${y(this.dialogStyleMap)}
|
|
1079
1085
|
@beforetoggle=${this.handleBeforetoggle}
|
|
1080
1086
|
@close=${this.handleBrowserClose}
|
|
1081
1087
|
?is-visible=${this.state !== "closed"}
|
|
@@ -1101,15 +1107,15 @@ var $ = class e extends Q {
|
|
|
1101
1107
|
this.strategy?.releaseDescription(), this.open = !1, super.disconnectedCallback();
|
|
1102
1108
|
}
|
|
1103
1109
|
};
|
|
1104
|
-
n([
|
|
1110
|
+
n([h({ type: Boolean })], $.prototype, "delayed", null), n([g(".dialog")], $.prototype, "dialogEl", void 0), n([h({ type: Boolean })], $.prototype, "disabled", null), n([_({
|
|
1105
1111
|
flatten: !0,
|
|
1106
1112
|
selector: ":not([slot=\"longpress-describedby-descriptor\"], slot)"
|
|
1107
|
-
})], $.prototype, "elements", void 0), n([
|
|
1113
|
+
})], $.prototype, "elements", void 0), n([h({ type: Number })], $.prototype, "offset", void 0), n([h({
|
|
1108
1114
|
type: Boolean,
|
|
1109
1115
|
reflect: !0
|
|
1110
|
-
})], $.prototype, "open", null), n([
|
|
1116
|
+
})], $.prototype, "open", null), n([h()], $.prototype, "placement", void 0), n([h({ attribute: "receives-focus" })], $.prototype, "receivesFocus", void 0), n([g("slot")], $.prototype, "slotEl", void 0), n([ee()], $.prototype, "state", null), n([h({
|
|
1111
1117
|
type: Number,
|
|
1112
1118
|
attribute: "tip-padding"
|
|
1113
|
-
})], $.prototype, "tipPadding", void 0), n([
|
|
1119
|
+
})], $.prototype, "tipPadding", void 0), n([h()], $.prototype, "trigger", void 0), n([h({ attribute: !1 })], $.prototype, "triggerElement", void 0), n([h({ attribute: !1 })], $.prototype, "triggerInteraction", void 0), n([h()], $.prototype, "type", void 0);
|
|
1114
1120
|
//#endregion
|
|
1115
|
-
export {
|
|
1121
|
+
export { D as _, Y as a, G as c, U as d, V as f, E as g, O as h, J as i, H as l, P as m, Z as n, q as o, me as p, X as r, K as s, $ as t, W as u, T as v, w as y };
|