@luzmo/lucero 0.0.38 → 0.0.40
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/button/index.cjs +1 -1
- package/components/button/index.js +17 -17
- package/components/color-area/color-area.d.ts +44 -6
- package/components/color-area/index.cjs +5 -5
- package/components/color-area/index.js +70 -62
- package/components/color-controller-DTp1juRz.js +3198 -0
- package/components/color-controller-_ZwyhvaU.cjs +18 -0
- package/components/color-field/color-field.d.ts +3 -3
- package/components/color-field/index.cjs +5 -5
- package/components/color-field/index.js +25 -28
- package/components/color-menu/color-menu.d.ts +5 -3
- package/components/color-menu/index.cjs +6 -6
- package/components/color-menu/index.js +11 -8
- package/components/color-picker/index.cjs +2 -3
- package/components/color-picker/index.js +22 -22
- package/components/color-slider/index.cjs +1 -40
- package/components/color-slider/index.js +6 -296
- package/components/index-BwxgAdzi.cjs +57 -0
- package/components/index-HjQa8tew.js +1174 -0
- package/components/index.cjs +1 -1
- package/components/index.js +58 -56
- package/components/menu/index.cjs +1 -1
- package/components/menu/index.js +1 -1
- package/components/overlay/hover-controller.d.ts +2 -0
- package/components/overlay/index.cjs +7 -7
- package/components/overlay/index.js +114 -110
- package/components/overlay/interaction-controller.d.ts +11 -5
- package/components/overlay/overlay-stack.d.ts +1 -0
- package/components/overlay/overlay-trigger.d.ts +25 -2
- package/components/{overlay-BBNyvs8F.js → overlay-BtZCJ2M0.js} +421 -386
- package/components/overlay-DTCm3y_-.cjs +47 -0
- package/components/picker/index.cjs +1 -1
- package/components/picker/index.js +2 -2
- package/components/{picker-daUT4cUN.js → picker-BmoXv1jt.js} +1 -1
- package/components/{picker-0tQg3Aob.cjs → picker-DWsBWdPN.cjs} +1 -1
- package/components/select/index.cjs +1 -1
- package/components/select/index.js +1 -1
- package/components/strategies-BACP6MhR.cjs +18 -0
- package/custom-elements.json +1 -1
- package/package.json +1 -1
- package/utils/button-interaction-controllers/interaction-controller.d.ts +1 -0
- package/utils/button-interaction-controllers/mobile-controller.d.ts +0 -1
- package/utils/reactive-controllers/color-controller.d.ts +224 -0
- package/components/color-Bg3tYsAQ.js +0 -178
- package/components/color-DphK4hwx.cjs +0 -18
- package/components/index-C1chwzNp.js +0 -727
- package/components/index-DCKCHDTt.cjs +0 -18
- package/components/overlay-o0tLxsk-.cjs +0 -47
- package/components/strategies-DGwsR7Xf.cjs +0 -18
- package/components/{strategies-Bc3hG-HA.js → strategies-9indNIEb.js} +1 -1
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
16
|
* SOFTWARE.
|
|
17
17
|
* */
|
|
18
|
-
import { e as f, I as O, s as
|
|
19
|
-
import { C as
|
|
20
|
-
import { a as E, r as w, x as
|
|
21
|
-
import { r as
|
|
22
|
-
import { e as
|
|
23
|
-
import { e as
|
|
18
|
+
import { e as f, I as O, s as S, L as $ } from "../overlay-BtZCJ2M0.js";
|
|
19
|
+
import { C as D, H as M, b as J, c as K, d as Q, P as W, S as X, V as Y, g as Z, l as ee, a as te, n as oe, o as re, p as le } from "../overlay-BtZCJ2M0.js";
|
|
20
|
+
import { a as E, r as w, x as m, n as c, E as z, B as v } from "../base-WsynuqaS.js";
|
|
21
|
+
import { r as g } from "../state-Deh-vKYE.js";
|
|
22
|
+
import { e as h } from "../query-D_KR_GUc.js";
|
|
23
|
+
import { e as b } from "../directive-oAbCiebi.js";
|
|
24
24
|
import { f as A } from "../async-directive-BfcqVjDp.js";
|
|
25
25
|
import { r as y } from "../slottable-request-event-DggLA4Rx.js";
|
|
26
|
-
import { S as
|
|
26
|
+
import { S as ne } from "../slottable-request-event-DggLA4Rx.js";
|
|
27
27
|
const k = () => {
|
|
28
28
|
if (typeof document < "u" && !document.querySelector("style[data-luzmo-vars]")) {
|
|
29
29
|
const i = document.createElement("style");
|
|
@@ -32,12 +32,12 @@ const k = () => {
|
|
|
32
32
|
};
|
|
33
33
|
k();
|
|
34
34
|
const F = ":host([disabled]) ::slotted([slot=trigger]){pointer-events:none}slot[name=longpress-describedby-descriptor]{display:none}";
|
|
35
|
-
var
|
|
36
|
-
for (var
|
|
37
|
-
(a = i[n]) && (
|
|
38
|
-
return
|
|
35
|
+
var I = Object.defineProperty, s = (i, e, o, t) => {
|
|
36
|
+
for (var l = void 0, n = i.length - 1, a; n >= 0; n--)
|
|
37
|
+
(a = i[n]) && (l = a(e, o, l) || l);
|
|
38
|
+
return l && I(e, o, l), l;
|
|
39
39
|
};
|
|
40
|
-
class
|
|
40
|
+
class r extends E {
|
|
41
41
|
constructor() {
|
|
42
42
|
super(...arguments), this.content = "click hover longpress", this.offset = 6, this.disabled = !1, this.receivesFocus = "auto", this.clickContent = [], this.longpressContent = [], this.hoverContent = [], this.targetContent = [];
|
|
43
43
|
}
|
|
@@ -67,31 +67,30 @@ class l extends E {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
handleBeforetoggle(e) {
|
|
70
|
-
const { target:
|
|
71
|
-
let
|
|
72
|
-
if (
|
|
73
|
-
|
|
74
|
-
else if (
|
|
75
|
-
|
|
76
|
-
else if (
|
|
77
|
-
|
|
70
|
+
const { target: o } = e;
|
|
71
|
+
let t;
|
|
72
|
+
if (o === this.clickOverlayElement)
|
|
73
|
+
t = "click";
|
|
74
|
+
else if (o === this.longpressOverlayElement)
|
|
75
|
+
t = "longpress";
|
|
76
|
+
else if (o === this.hoverOverlayElement)
|
|
77
|
+
t = "hover";
|
|
78
78
|
else
|
|
79
79
|
return;
|
|
80
|
-
e.newState === "open" ? this.open =
|
|
80
|
+
e.newState === "open" ? this.open = t : this.open === t && (this.open = void 0);
|
|
81
81
|
}
|
|
82
82
|
update(e) {
|
|
83
|
-
var
|
|
84
|
-
e.has("clickContent") && (this.clickPlacement = ((
|
|
83
|
+
var o, t, l, n, a, u;
|
|
84
|
+
e.has("clickContent") && (this.clickPlacement = ((o = this.clickContent[0]) == null ? void 0 : o.getAttribute("placement")) || ((t = this.clickContent[0]) == null ? void 0 : t.getAttribute("direction")) || void 0), e.has("hoverContent") && (this.hoverPlacement = ((l = this.hoverContent[0]) == null ? void 0 : l.getAttribute("placement")) || ((n = this.hoverContent[0]) == null ? void 0 : n.getAttribute("direction")) || void 0), e.has("longpressContent") && (this.longpressPlacement = ((a = this.longpressContent[0]) == null ? void 0 : a.getAttribute("placement")) || ((u = this.longpressContent[0]) == null ? void 0 : u.getAttribute("direction")) || void 0), super.update(e);
|
|
85
85
|
}
|
|
86
86
|
renderSlot(e) {
|
|
87
|
-
return
|
|
87
|
+
return m`
|
|
88
88
|
<slot name=${e} @slotchange=${this.handleSlotContent}></slot>
|
|
89
89
|
`;
|
|
90
90
|
}
|
|
91
91
|
renderClickOverlay() {
|
|
92
|
-
|
|
93
|
-
const e = this.renderSlot("click-content")
|
|
94
|
-
return this.clickContent.length === 0 ? e : c`
|
|
92
|
+
var t;
|
|
93
|
+
const e = this.renderSlot("click-content"), o = m`
|
|
95
94
|
<luzmo-overlay
|
|
96
95
|
id="click-overlay"
|
|
97
96
|
?disabled=${this.disabled || this.clickContent.length === 0}
|
|
@@ -107,11 +106,11 @@ class l extends E {
|
|
|
107
106
|
${e}
|
|
108
107
|
</luzmo-overlay>
|
|
109
108
|
`;
|
|
109
|
+
return (t = this.triggeredBy) != null && t.includes("click") ? o : this.clickContent.length === 0 ? e : o;
|
|
110
110
|
}
|
|
111
111
|
renderHoverOverlay() {
|
|
112
|
-
|
|
113
|
-
const e = this.renderSlot("hover-content")
|
|
114
|
-
return this.hoverContent.length === 0 ? e : c`
|
|
112
|
+
var t;
|
|
113
|
+
const e = this.renderSlot("hover-content"), o = m`
|
|
115
114
|
<luzmo-overlay
|
|
116
115
|
id="hover-overlay"
|
|
117
116
|
?open=${this.open === "hover" && this.hoverContent.length > 0}
|
|
@@ -127,11 +126,11 @@ class l extends E {
|
|
|
127
126
|
${e}
|
|
128
127
|
</luzmo-overlay>
|
|
129
128
|
`;
|
|
129
|
+
return (t = this.triggeredBy) != null && t.includes("hover") ? o : this.hoverContent.length === 0 ? e : o;
|
|
130
130
|
}
|
|
131
131
|
renderLongpressOverlay() {
|
|
132
|
-
|
|
133
|
-
const e = this.renderSlot("longpress-content")
|
|
134
|
-
return this.longpressContent.length === 0 ? e : c`
|
|
132
|
+
var t;
|
|
133
|
+
const e = this.renderSlot("longpress-content"), o = m`
|
|
135
134
|
<luzmo-overlay
|
|
136
135
|
id="longpress-overlay"
|
|
137
136
|
?disabled=${this.disabled || this.longpressContent.length === 0}
|
|
@@ -148,19 +147,19 @@ class l extends E {
|
|
|
148
147
|
</luzmo-overlay>
|
|
149
148
|
<slot name="longpress-describedby-descriptor"></slot>
|
|
150
149
|
`;
|
|
150
|
+
return (t = this.triggeredBy) != null && t.includes("longpress") ? o : this.longpressContent.length === 0 ? e : o;
|
|
151
151
|
}
|
|
152
152
|
render() {
|
|
153
|
-
|
|
154
|
-
return c`
|
|
153
|
+
return m`
|
|
155
154
|
<slot
|
|
156
155
|
id="trigger"
|
|
157
156
|
name="trigger"
|
|
158
157
|
@slotchange=${this.handleTriggerContent}
|
|
159
158
|
></slot>
|
|
160
159
|
${[
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
160
|
+
this.renderClickOverlay(),
|
|
161
|
+
this.renderHoverOverlay(),
|
|
162
|
+
this.renderLongpressOverlay()
|
|
164
163
|
]}
|
|
165
164
|
`;
|
|
166
165
|
}
|
|
@@ -175,53 +174,56 @@ class l extends E {
|
|
|
175
174
|
}
|
|
176
175
|
}
|
|
177
176
|
s([
|
|
178
|
-
|
|
179
|
-
],
|
|
177
|
+
c()
|
|
178
|
+
], r.prototype, "content");
|
|
180
179
|
s([
|
|
181
|
-
|
|
182
|
-
],
|
|
180
|
+
c({ attribute: "triggered-by" })
|
|
181
|
+
], r.prototype, "triggeredBy");
|
|
183
182
|
s([
|
|
184
|
-
|
|
185
|
-
],
|
|
183
|
+
c({ reflect: !0 })
|
|
184
|
+
], r.prototype, "placement");
|
|
186
185
|
s([
|
|
187
|
-
|
|
188
|
-
],
|
|
186
|
+
c()
|
|
187
|
+
], r.prototype, "type");
|
|
189
188
|
s([
|
|
190
|
-
|
|
191
|
-
],
|
|
189
|
+
c({ type: Number })
|
|
190
|
+
], r.prototype, "offset");
|
|
192
191
|
s([
|
|
193
|
-
|
|
194
|
-
],
|
|
192
|
+
c({ reflect: !0 })
|
|
193
|
+
], r.prototype, "open");
|
|
195
194
|
s([
|
|
196
|
-
|
|
197
|
-
],
|
|
195
|
+
c({ type: Boolean, reflect: !0 })
|
|
196
|
+
], r.prototype, "disabled");
|
|
198
197
|
s([
|
|
199
|
-
|
|
200
|
-
],
|
|
198
|
+
c({ attribute: "receives-focus" })
|
|
199
|
+
], r.prototype, "receivesFocus");
|
|
201
200
|
s([
|
|
202
|
-
|
|
203
|
-
],
|
|
201
|
+
g()
|
|
202
|
+
], r.prototype, "clickContent");
|
|
204
203
|
s([
|
|
205
|
-
|
|
206
|
-
],
|
|
204
|
+
g()
|
|
205
|
+
], r.prototype, "longpressContent");
|
|
207
206
|
s([
|
|
208
|
-
|
|
209
|
-
],
|
|
207
|
+
g()
|
|
208
|
+
], r.prototype, "hoverContent");
|
|
210
209
|
s([
|
|
211
|
-
g(
|
|
212
|
-
],
|
|
210
|
+
g()
|
|
211
|
+
], r.prototype, "targetContent");
|
|
213
212
|
s([
|
|
214
|
-
|
|
215
|
-
],
|
|
213
|
+
h("#click-overlay", !0)
|
|
214
|
+
], r.prototype, "clickOverlayElement");
|
|
216
215
|
s([
|
|
217
|
-
|
|
218
|
-
],
|
|
219
|
-
|
|
216
|
+
h("#longpress-overlay", !0)
|
|
217
|
+
], r.prototype, "longpressOverlayElement");
|
|
218
|
+
s([
|
|
219
|
+
h("#hover-overlay", !0)
|
|
220
|
+
], r.prototype, "hoverOverlayElement");
|
|
221
|
+
function U(i, e, o, t) {
|
|
220
222
|
return f.open(
|
|
221
223
|
i,
|
|
222
224
|
e,
|
|
223
|
-
|
|
224
|
-
|
|
225
|
+
o,
|
|
226
|
+
t
|
|
225
227
|
);
|
|
226
228
|
}
|
|
227
229
|
class x extends A {
|
|
@@ -229,24 +231,24 @@ class x extends A {
|
|
|
229
231
|
render(e) {
|
|
230
232
|
return z;
|
|
231
233
|
}
|
|
232
|
-
update(e, [
|
|
233
|
-
this.template =
|
|
234
|
+
update(e, [o]) {
|
|
235
|
+
this.template = o, this.target !== e.element && (this.target = e.element, this.renderBefore = this.target.children[0]), this.listenerHost = this.target, this.init();
|
|
234
236
|
}
|
|
235
237
|
handleSlottableRequest(e) {
|
|
236
238
|
if (e.target !== e.currentTarget)
|
|
237
239
|
return;
|
|
238
|
-
const
|
|
239
|
-
|
|
240
|
+
const o = e.data === y;
|
|
241
|
+
v(o ? void 0 : this.template(), this.target, {
|
|
240
242
|
renderBefore: this.renderBefore
|
|
241
243
|
});
|
|
242
244
|
}
|
|
243
245
|
init() {
|
|
244
|
-
var
|
|
245
|
-
(
|
|
246
|
+
var o;
|
|
247
|
+
(o = this.listeners) == null || o.abort(), this.listeners = new AbortController();
|
|
246
248
|
const { signal: e } = this.listeners;
|
|
247
249
|
this.listenerHost.addEventListener(
|
|
248
250
|
"slottable-request",
|
|
249
|
-
(
|
|
251
|
+
(t) => this.handleSlottableRequest(t),
|
|
250
252
|
{ signal: e }
|
|
251
253
|
);
|
|
252
254
|
}
|
|
@@ -259,8 +261,8 @@ class x extends A {
|
|
|
259
261
|
this.init();
|
|
260
262
|
}
|
|
261
263
|
}
|
|
262
|
-
const N =
|
|
263
|
-
class
|
|
264
|
+
const N = b(x);
|
|
265
|
+
class R extends x {
|
|
264
266
|
constructor() {
|
|
265
267
|
super(...arguments), this.defaultOptions = {
|
|
266
268
|
triggerInteraction: "click",
|
|
@@ -273,70 +275,72 @@ class I extends x {
|
|
|
273
275
|
};
|
|
274
276
|
}
|
|
275
277
|
/* c8 ignore next 9 */
|
|
276
|
-
render(e,
|
|
278
|
+
render(e, o) {
|
|
277
279
|
return z;
|
|
278
280
|
}
|
|
279
|
-
update(e, [
|
|
280
|
-
var
|
|
281
|
+
update(e, [o, t]) {
|
|
282
|
+
var u, d, p;
|
|
281
283
|
this.options = {
|
|
282
284
|
...this.defaultOptions.overlayOptions,
|
|
283
|
-
...
|
|
284
|
-
}, this.insertionOptions =
|
|
285
|
-
let
|
|
286
|
-
const n = (
|
|
287
|
-
this.target !== e.element && (this.target = e.element,
|
|
285
|
+
...t == null ? void 0 : t.overlayOptions
|
|
286
|
+
}, this.insertionOptions = t == null ? void 0 : t.insertionOptions, this.template = o, this.host = (u = e.options) == null ? void 0 : u.host;
|
|
287
|
+
let l = !1;
|
|
288
|
+
const n = (t == null ? void 0 : t.triggerInteraction) || this.defaultOptions.triggerInteraction, a = O[(d = this.strategy) == null ? void 0 : d.type] !== n;
|
|
289
|
+
this.target !== e.element && (this.target = e.element, l = !0), (l || a) && ((p = this.strategy) == null || p.abort(), this.strategy = new S[n](this.target, {
|
|
288
290
|
isPersistent: !0,
|
|
289
291
|
handleOverlayReady: (C) => {
|
|
290
292
|
this.listenerHost = this.overlay = C, this.init();
|
|
291
293
|
}
|
|
292
|
-
})), this.strategy.open = (
|
|
294
|
+
})), this.strategy.open = (t == null ? void 0 : t.open) ?? !1;
|
|
293
295
|
}
|
|
294
296
|
handleSlottableRequest(e) {
|
|
295
|
-
var
|
|
297
|
+
var l, n;
|
|
296
298
|
if (e.target !== e.currentTarget)
|
|
297
299
|
return;
|
|
298
|
-
const
|
|
299
|
-
if (this.host && (
|
|
300
|
-
|
|
300
|
+
const o = e.data === y, t = {};
|
|
301
|
+
if (this.host && (t.host = this.host), v(
|
|
302
|
+
o ? void 0 : this.template(),
|
|
301
303
|
this.overlay,
|
|
302
|
-
|
|
303
|
-
),
|
|
304
|
+
t
|
|
305
|
+
), o)
|
|
304
306
|
this.overlay.remove();
|
|
305
307
|
else {
|
|
306
|
-
|
|
308
|
+
$.applyOptions(this.overlay, {
|
|
307
309
|
...this.options,
|
|
308
310
|
trigger: this.target
|
|
309
311
|
});
|
|
310
|
-
const a = typeof ((
|
|
311
|
-
a.insertAdjacentElement(
|
|
312
|
+
const a = typeof ((l = this.insertionOptions) == null ? void 0 : l.el) == "function" ? this.insertionOptions.el() : ((n = this.insertionOptions) == null ? void 0 : n.el) || this.target, { where: u = "afterend" } = this.insertionOptions || {};
|
|
313
|
+
a.insertAdjacentElement(u, this.overlay);
|
|
312
314
|
}
|
|
313
315
|
}
|
|
314
316
|
}
|
|
315
|
-
const
|
|
317
|
+
const G = b(R);
|
|
316
318
|
customElements.get("luzmo-overlay") || customElements.define("luzmo-overlay", f);
|
|
317
|
-
customElements.get("luzmo-overlay-trigger") || customElements.define("luzmo-overlay-trigger",
|
|
319
|
+
customElements.get("luzmo-overlay-trigger") || customElements.define("luzmo-overlay-trigger", r);
|
|
318
320
|
export {
|
|
319
|
-
|
|
321
|
+
D as ClickController,
|
|
320
322
|
M as HoverController,
|
|
321
323
|
J as InteractionController,
|
|
322
324
|
O as InteractionTypes,
|
|
323
325
|
K as LONGPRESS_INSTRUCTIONS,
|
|
324
326
|
Q as LongpressController,
|
|
325
|
-
|
|
327
|
+
$ as LuzmoAbstractOverlay,
|
|
326
328
|
f as LuzmoOverlay,
|
|
327
|
-
|
|
328
|
-
|
|
329
|
+
r as LuzmoOverlayTrigger,
|
|
330
|
+
R as OverlayTriggerDirective,
|
|
329
331
|
W as PlacementController,
|
|
332
|
+
X as SAFARI_FOCUS_RING_CLASS,
|
|
330
333
|
x as SlottableRequestDirective,
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
334
|
+
ne as SlottableRequestEvent,
|
|
335
|
+
Y as VirtualTrigger,
|
|
336
|
+
Z as guaranteedAllTransitionend,
|
|
337
|
+
ee as lastInteractionType,
|
|
338
|
+
te as nextFrame,
|
|
339
|
+
oe as noop,
|
|
336
340
|
U as openOverlay,
|
|
337
|
-
|
|
338
|
-
|
|
341
|
+
re as overlayTimer,
|
|
342
|
+
le as placementUpdatedSymbol,
|
|
339
343
|
y as removeSlottableRequest,
|
|
340
344
|
N as slottableRequest,
|
|
341
|
-
|
|
345
|
+
G as trigger
|
|
342
346
|
};
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import type { ReactiveController } from 'lit';
|
|
2
2
|
import { LuzmoAbstractOverlay } from './abstract-overlay';
|
|
3
3
|
export declare enum InteractionTypes {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
click = "click",
|
|
5
|
+
hover = "hover",
|
|
6
|
+
longpress = "longpress"
|
|
7
7
|
}
|
|
8
|
+
export declare const lastInteractionType: unique symbol;
|
|
9
|
+
export declare const SAFARI_FOCUS_RING_CLASS = "remove-focus-ring-safari-hack";
|
|
8
10
|
export type ControllerOptions = {
|
|
9
11
|
overlay?: LuzmoAbstractOverlay;
|
|
10
12
|
handleOverlayReady?: (overlay: LuzmoAbstractOverlay) => void;
|
|
11
13
|
isPersistent?: boolean;
|
|
12
14
|
};
|
|
15
|
+
type InteractionTarget = HTMLElement & {
|
|
16
|
+
[lastInteractionType]?: InteractionTypes;
|
|
17
|
+
};
|
|
13
18
|
export declare class InteractionController implements ReactiveController {
|
|
14
|
-
target:
|
|
19
|
+
target: InteractionTarget;
|
|
15
20
|
abortController: AbortController;
|
|
16
21
|
get activelyOpening(): boolean;
|
|
17
22
|
private handleOverlayReady?;
|
|
@@ -26,7 +31,7 @@ export declare class InteractionController implements ReactiveController {
|
|
|
26
31
|
private _overlay;
|
|
27
32
|
protected isPersistent: boolean;
|
|
28
33
|
type: InteractionTypes;
|
|
29
|
-
constructor(target:
|
|
34
|
+
constructor(target: InteractionTarget, { overlay, isPersistent, handleOverlayReady }: ControllerOptions);
|
|
30
35
|
prepareDescription(_: HTMLElement): void;
|
|
31
36
|
releaseDescription(): void;
|
|
32
37
|
shouldCompleteOpen(): void;
|
|
@@ -36,3 +41,4 @@ export declare class InteractionController implements ReactiveController {
|
|
|
36
41
|
hostConnected(): void;
|
|
37
42
|
hostDisconnected(): void;
|
|
38
43
|
}
|
|
44
|
+
export {};
|
|
@@ -3,21 +3,43 @@ import { CSSResultArray, PropertyValues, TemplateResult } from 'lit';
|
|
|
3
3
|
import { LuzmoElement } from '../../utils/base';
|
|
4
4
|
import { LuzmoOverlay } from './overlay';
|
|
5
5
|
import { OverlayTriggerInteractions } from './overlay-types';
|
|
6
|
+
import './overlay';
|
|
6
7
|
export type OverlayContentTypes = 'click' | 'hover' | 'longpress';
|
|
8
|
+
type Combinations<T extends string, U extends string = T> = T extends string ? T | `${T} ${Combinations<Exclude<U, T>>}` : never;
|
|
9
|
+
export type TriggeredByType = Combinations<OverlayContentTypes>;
|
|
7
10
|
/**
|
|
8
11
|
* @element overlay-trigger
|
|
9
12
|
*
|
|
10
13
|
* @slot trigger - The content that will trigger the various overlays
|
|
11
14
|
* @slot hover-content - The content that will be displayed on hover
|
|
12
15
|
* @slot click-content - The content that will be displayed on click
|
|
13
|
-
* @slot longpress-content - The content that will be displayed on
|
|
16
|
+
* @slot longpress-content - The content that will be displayed on longpress
|
|
17
|
+
* @slot longpress-describedby-descriptor - Description for longpress content
|
|
14
18
|
*
|
|
15
19
|
* @fires luzmo-opened - Announces that the overlay has been opened
|
|
16
20
|
* @fires luzmo-closed - Announces that the overlay has been closed
|
|
21
|
+
*
|
|
22
|
+
* @attr {string} placement - The placement of the overlay relative to the trigger
|
|
23
|
+
* @attr {number} offset - The distance between the overlay and the trigger
|
|
24
|
+
* @attr {boolean} disabled - Whether the overlay trigger is disabled
|
|
25
|
+
* @attr {string} receives-focus - How focus should be handled ('true'|'false'|'auto')
|
|
17
26
|
*/
|
|
18
27
|
export declare class LuzmoOverlayTrigger extends LuzmoElement {
|
|
19
28
|
static get styles(): CSSResultArray;
|
|
20
29
|
content: string;
|
|
30
|
+
/**
|
|
31
|
+
* Optional property to optimize performance and prevent race conditions.
|
|
32
|
+
*
|
|
33
|
+
* By explicitly declaring which content types are used (e.g. "click", "longpress hover"),
|
|
34
|
+
* we can avoid:
|
|
35
|
+
* 1. Extra renders from unnecessary slot reparenting
|
|
36
|
+
* 2. Potential infinite render loops during content detection
|
|
37
|
+
* 3. Race conditions during slot assignment
|
|
38
|
+
*
|
|
39
|
+
* By only returning overlay wrappers for explicitly declared content types,
|
|
40
|
+
* we minimize unecessary DOM nodes, operations and ensure a more stable rendering behavior.
|
|
41
|
+
*/
|
|
42
|
+
triggeredBy?: TriggeredByType;
|
|
21
43
|
/**
|
|
22
44
|
* @type {"top" | "top-start" | "top-end" | "right" | "right-start" | "right-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end"}
|
|
23
45
|
* @attr
|
|
@@ -48,6 +70,7 @@ export declare class LuzmoOverlayTrigger extends LuzmoElement {
|
|
|
48
70
|
protected renderHoverOverlay(): TemplateResult;
|
|
49
71
|
protected renderLongpressOverlay(): TemplateResult;
|
|
50
72
|
protected render(): TemplateResult;
|
|
51
|
-
protected updated(
|
|
73
|
+
protected updated(changedProperties: PropertyValues): void;
|
|
52
74
|
protected getUpdateComplete(): Promise<boolean>;
|
|
53
75
|
}
|
|
76
|
+
export {};
|