@florid-kit/components 3.2.23 → 3.2.25
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/dropdown-variant.d.ts +5 -0
- package/components/dropdown-variant.mjs +141 -118
- package/components/thumbnail-navigation.mjs +75 -56
- package/index.mjs +1 -1
- package/loader.mjs +1 -1
- package/package.json +1 -1
|
@@ -7,6 +7,7 @@ export declare class OccitaneDropdownVariant extends OccitaneDropdownVariant_bas
|
|
|
7
7
|
value: string;
|
|
8
8
|
label?: string;
|
|
9
9
|
imgurl?: string;
|
|
10
|
+
imgalt?: string;
|
|
10
11
|
url?: string;
|
|
11
12
|
disabled?: boolean;
|
|
12
13
|
additionaltext?: string;
|
|
@@ -17,6 +18,8 @@ export declare class OccitaneDropdownVariant extends OccitaneDropdownVariant_bas
|
|
|
17
18
|
additionaltext: string;
|
|
18
19
|
disabled: boolean;
|
|
19
20
|
width: string;
|
|
21
|
+
buttonLabel: string;
|
|
22
|
+
describedBy: undefined;
|
|
20
23
|
open: boolean;
|
|
21
24
|
activeIndex: number;
|
|
22
25
|
menuWidth: string;
|
|
@@ -32,8 +35,10 @@ export declare class OccitaneDropdownVariant extends OccitaneDropdownVariant_bas
|
|
|
32
35
|
connectedCallback(): void;
|
|
33
36
|
disconnectedCallback(): void;
|
|
34
37
|
_handleOutsideClick: (e: MouseEvent) => void;
|
|
38
|
+
private _handleListFocusOut;
|
|
35
39
|
private _startObserveVisibleItems;
|
|
36
40
|
private _stopObserveVisibleItems;
|
|
41
|
+
close(): void;
|
|
37
42
|
toggle(): void;
|
|
38
43
|
_focusActiveOption(): void;
|
|
39
44
|
selectOption(option: {
|
|
@@ -1,22 +1,29 @@
|
|
|
1
|
-
import { i as m, m as y, a as w, x as
|
|
2
|
-
import { n as
|
|
1
|
+
import { i as m, m as y, a as w, x as h, t as x } from "../performance-mixin-D7YmSeqN.mjs";
|
|
2
|
+
import { n as l } from "../property-S_Y9cb04.mjs";
|
|
3
3
|
import { r as f } from "../state-DjMxXomO.mjs";
|
|
4
|
-
import { e as _, o as
|
|
4
|
+
import { e as _, o as $, a as k } from "../icons-registry.mjs";
|
|
5
5
|
import { o as I } from "../unsafe-svg-BipL_msF.mjs";
|
|
6
|
-
import { o as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
import { o as a } from "../if-defined-j0wE2gL4.mjs";
|
|
7
|
+
import { s as O } from "../css-C8WrrxT-.mjs";
|
|
8
|
+
var S = Object.defineProperty, C = Object.getOwnPropertyDescriptor, s = (t, i, n, e) => {
|
|
9
|
+
for (var o = e > 1 ? void 0 : e ? C(i, n) : i, d = t.length - 1, c; d >= 0; d--)
|
|
10
|
+
(c = t[d]) && (o = (e ? c(i, n, o) : c(o)) || o);
|
|
11
|
+
return e && o && S(i, n, o), o;
|
|
11
12
|
};
|
|
12
|
-
let
|
|
13
|
+
let r = class extends y(w) {
|
|
13
14
|
constructor() {
|
|
14
|
-
super(...arguments), this.options = [], this.value = "", this.name = "", this.additionaltext = "+X variant(s)", this.disabled = !1, this.width = "100%", this.open = !1, this.activeIndex = -1, this.menuWidth = "", this._sent = /* @__PURE__ */ new Set(), this._pendingByKey = /* @__PURE__ */ new Map(), this._handleOutsideClick = (
|
|
15
|
-
this.contains(
|
|
15
|
+
super(...arguments), this.options = [], this.value = "", this.name = "", this.additionaltext = "+X variant(s)", this.disabled = !1, this.width = "100%", this.buttonLabel = "", this.describedBy = void 0, this.open = !1, this.activeIndex = -1, this.menuWidth = "", this._sent = /* @__PURE__ */ new Set(), this._pendingByKey = /* @__PURE__ */ new Map(), this._handleOutsideClick = (t) => {
|
|
16
|
+
this.contains(t.target) || (this.open = !1, this.activeIndex = -1, this._stopObserveVisibleItems());
|
|
17
|
+
}, this._handleListFocusOut = (t) => {
|
|
18
|
+
var o;
|
|
19
|
+
const i = t.relatedTarget;
|
|
20
|
+
if (!i) return;
|
|
21
|
+
const n = t.currentTarget, e = (o = this.renderRoot) == null ? void 0 : o.querySelector("button");
|
|
22
|
+
n.contains(i) || e != null && e.contains(i) || (this.open = !1, this.activeIndex = -1, this._stopObserveVisibleItems());
|
|
16
23
|
};
|
|
17
24
|
}
|
|
18
|
-
_getKey(
|
|
19
|
-
return (i == null ? void 0 : i.productId) ??
|
|
25
|
+
_getKey(t, i, n) {
|
|
26
|
+
return (i == null ? void 0 : i.productId) ?? t.value ?? String(n);
|
|
20
27
|
}
|
|
21
28
|
_scheduleFlush() {
|
|
22
29
|
this._flushTimer || (this._flushTimer = window.setTimeout(() => {
|
|
@@ -25,31 +32,31 @@ let a = class extends y(w) {
|
|
|
25
32
|
}
|
|
26
33
|
_flushPending() {
|
|
27
34
|
if (!this.open || this._pendingByKey.size === 0) return;
|
|
28
|
-
const
|
|
35
|
+
const t = Array.from(this._pendingByKey.values());
|
|
29
36
|
this._pendingByKey.clear(), this.dispatchEvent(
|
|
30
37
|
new CustomEvent("event-tracking", {
|
|
31
38
|
detail: {
|
|
32
|
-
products:
|
|
39
|
+
products: t
|
|
33
40
|
},
|
|
34
41
|
bubbles: !0,
|
|
35
42
|
composed: !0
|
|
36
43
|
})
|
|
37
44
|
);
|
|
38
45
|
}
|
|
39
|
-
_emitTrackingEvent(
|
|
40
|
-
const
|
|
41
|
-
if (!
|
|
42
|
-
let
|
|
46
|
+
_emitTrackingEvent(t, i) {
|
|
47
|
+
const n = t == null ? void 0 : t.dataproduct;
|
|
48
|
+
if (!n) return;
|
|
49
|
+
let e;
|
|
43
50
|
try {
|
|
44
|
-
|
|
45
|
-
} catch (
|
|
46
|
-
console.warn("Invalid dataproduct JSON:",
|
|
51
|
+
e = JSON.parse(n);
|
|
52
|
+
} catch (o) {
|
|
53
|
+
console.warn("Invalid dataproduct JSON:", n, o);
|
|
47
54
|
return;
|
|
48
55
|
}
|
|
49
56
|
this.dispatchEvent(
|
|
50
57
|
new CustomEvent("event-tracking", {
|
|
51
58
|
detail: {
|
|
52
|
-
product:
|
|
59
|
+
product: e
|
|
53
60
|
},
|
|
54
61
|
bubbles: !0,
|
|
55
62
|
composed: !0
|
|
@@ -57,26 +64,26 @@ let a = class extends y(w) {
|
|
|
57
64
|
);
|
|
58
65
|
}
|
|
59
66
|
connectedCallback() {
|
|
60
|
-
super.connectedCallback(), document.addEventListener("click", this._handleOutsideClick), _("occ-check-outlined"), this._unsubOcc =
|
|
67
|
+
super.connectedCallback(), document.addEventListener("click", this._handleOutsideClick), _("occ-check-outlined"), this._unsubOcc = $(() => this.requestUpdate());
|
|
61
68
|
}
|
|
62
69
|
disconnectedCallback() {
|
|
63
|
-
var
|
|
64
|
-
document.removeEventListener("click", this._handleOutsideClick), (
|
|
70
|
+
var t;
|
|
71
|
+
document.removeEventListener("click", this._handleOutsideClick), (t = this._unsubOcc) == null || t.call(this), super.disconnectedCallback();
|
|
65
72
|
}
|
|
66
73
|
_startObserveVisibleItems() {
|
|
67
74
|
var i;
|
|
68
75
|
this._stopObserveVisibleItems();
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
(
|
|
76
|
+
const t = (i = this.renderRoot) == null ? void 0 : i.querySelector("#dropdown-listbox");
|
|
77
|
+
t && (this._io = new IntersectionObserver(
|
|
78
|
+
(n) => {
|
|
72
79
|
if (this.open)
|
|
73
|
-
for (const
|
|
74
|
-
if (!
|
|
75
|
-
const
|
|
76
|
-
if (!
|
|
77
|
-
const
|
|
78
|
-
if (!
|
|
79
|
-
const u =
|
|
80
|
+
for (const e of n) {
|
|
81
|
+
if (!e.isIntersecting) continue;
|
|
82
|
+
const o = e.target, d = o.dataset.index;
|
|
83
|
+
if (!d) continue;
|
|
84
|
+
const c = Number(d), p = this.options[c];
|
|
85
|
+
if (!p || p.disabled) continue;
|
|
86
|
+
const u = p.dataproduct ?? o.dataset.product;
|
|
80
87
|
if (!u) continue;
|
|
81
88
|
let v;
|
|
82
89
|
try {
|
|
@@ -85,28 +92,31 @@ let a = class extends y(w) {
|
|
|
85
92
|
console.warn("Invalid dataproduct JSON:", u, g);
|
|
86
93
|
continue;
|
|
87
94
|
}
|
|
88
|
-
const b = this._getKey(
|
|
95
|
+
const b = this._getKey(p, v, c);
|
|
89
96
|
this._sent.has(b) || (this._sent.add(b), this._pendingByKey.set(b, v), this._scheduleFlush());
|
|
90
97
|
}
|
|
91
98
|
},
|
|
92
99
|
{
|
|
93
|
-
root:
|
|
100
|
+
root: t,
|
|
94
101
|
threshold: 0.75
|
|
95
102
|
}
|
|
96
|
-
),
|
|
97
|
-
var
|
|
98
|
-
return (
|
|
103
|
+
), t.querySelectorAll("li[role='option']").forEach((n) => {
|
|
104
|
+
var e;
|
|
105
|
+
return (e = this._io) == null ? void 0 : e.observe(n);
|
|
99
106
|
}));
|
|
100
107
|
}
|
|
101
108
|
_stopObserveVisibleItems() {
|
|
102
|
-
var
|
|
103
|
-
this._flushPending(), this._flushTimer && (clearTimeout(this._flushTimer), this._flushTimer = void 0), (
|
|
109
|
+
var t;
|
|
110
|
+
this._flushPending(), this._flushTimer && (clearTimeout(this._flushTimer), this._flushTimer = void 0), (t = this._io) == null || t.disconnect(), this._io = void 0;
|
|
111
|
+
}
|
|
112
|
+
close() {
|
|
113
|
+
this.open && this.toggle();
|
|
104
114
|
}
|
|
105
115
|
toggle() {
|
|
106
|
-
var
|
|
116
|
+
var t;
|
|
107
117
|
if (!this.disabled) {
|
|
108
118
|
if (this.open = !this.open, this.activeIndex = this.open ? this.options.findIndex((i) => i.value === this.value) : -1, this.open && this.width === "auto") {
|
|
109
|
-
const i = (
|
|
119
|
+
const i = (t = this.renderRoot) == null ? void 0 : t.querySelector("button");
|
|
110
120
|
i && (this.menuWidth = `${i.getBoundingClientRect().width}px`);
|
|
111
121
|
}
|
|
112
122
|
this.open ? this.updateComplete.then(() => {
|
|
@@ -116,41 +126,45 @@ let a = class extends y(w) {
|
|
|
116
126
|
}
|
|
117
127
|
_focusActiveOption() {
|
|
118
128
|
var i;
|
|
119
|
-
const
|
|
120
|
-
|
|
129
|
+
const t = (i = this.renderRoot) == null ? void 0 : i.querySelector(`#option-${this.activeIndex}`);
|
|
130
|
+
t == null || t.focus();
|
|
121
131
|
}
|
|
122
|
-
selectOption(
|
|
123
|
-
this.value =
|
|
124
|
-
detail: { value: this.value, url:
|
|
132
|
+
selectOption(t) {
|
|
133
|
+
this.value = t.value, this.dispatchEvent(new CustomEvent("change", {
|
|
134
|
+
detail: { value: this.value, url: t.url }
|
|
125
135
|
})), this.open = !1, this.activeIndex = -1;
|
|
126
136
|
}
|
|
127
|
-
handleKeydown(
|
|
137
|
+
handleKeydown(t) {
|
|
128
138
|
if (this.disabled) {
|
|
129
|
-
|
|
139
|
+
t.preventDefault();
|
|
130
140
|
return;
|
|
131
141
|
}
|
|
132
142
|
if (!this.open) {
|
|
133
|
-
(
|
|
143
|
+
(t.key === "ArrowDown" || t.key === "ArrowUp") && (t.preventDefault(), this.open = !0, this.activeIndex = this.options.findIndex((i) => i.value === this.value), this.updateComplete.then(() => this._focusActiveOption()));
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
if (t.key === "Tab" && t.shiftKey) {
|
|
147
|
+
this.open = !1, this.activeIndex = -1, this._stopObserveVisibleItems();
|
|
134
148
|
return;
|
|
135
149
|
}
|
|
136
|
-
switch (
|
|
150
|
+
switch (t.key) {
|
|
137
151
|
case "ArrowDown":
|
|
138
|
-
|
|
152
|
+
t.preventDefault(), this.activeIndex = (this.activeIndex + 1) % this.options.length, this.updateComplete.then(() => this._focusActiveOption());
|
|
139
153
|
break;
|
|
140
154
|
case "ArrowUp":
|
|
141
|
-
|
|
155
|
+
t.preventDefault(), this.activeIndex = (this.activeIndex - 1 + this.options.length) % this.options.length, this.updateComplete.then(() => this._focusActiveOption());
|
|
142
156
|
break;
|
|
143
157
|
case "Home":
|
|
144
|
-
|
|
158
|
+
t.preventDefault(), this.activeIndex = 0, this.updateComplete.then(() => this._focusActiveOption());
|
|
145
159
|
break;
|
|
146
160
|
case "End":
|
|
147
|
-
|
|
161
|
+
t.preventDefault(), this.activeIndex = this.options.length - 1, this.updateComplete.then(() => this._focusActiveOption());
|
|
148
162
|
break;
|
|
149
163
|
case "Enter":
|
|
150
|
-
|
|
164
|
+
t.preventDefault(), this.activeIndex >= 0 && this.selectOption(this.options[this.activeIndex]);
|
|
151
165
|
break;
|
|
152
166
|
case "Escape":
|
|
153
|
-
|
|
167
|
+
t.preventDefault(), this.open = !1, this.activeIndex = -1;
|
|
154
168
|
break;
|
|
155
169
|
}
|
|
156
170
|
}
|
|
@@ -158,31 +172,32 @@ let a = class extends y(w) {
|
|
|
158
172
|
this.options.length > 0 && (this.options.some((i) => i.value === this.value) || (this.value = this.options[0].value));
|
|
159
173
|
}
|
|
160
174
|
render() {
|
|
161
|
-
const
|
|
175
|
+
const t = k["occ-check-outlined"] ?? "", i = t ? t.replace(
|
|
162
176
|
"<svg",
|
|
163
177
|
'<svg aria-hidden="true" focusable="false" part="svg"'
|
|
164
|
-
) : "",
|
|
165
|
-
return
|
|
178
|
+
) : "", n = this.options.find((e) => e.value === this.value);
|
|
179
|
+
return h`
|
|
166
180
|
<button
|
|
167
|
-
role="combobox"
|
|
168
|
-
aria-haspopup="listbox"
|
|
169
181
|
aria-controls="dropdown-listbox"
|
|
170
182
|
aria-expanded="${this.open}"
|
|
171
183
|
aria-disabled="${this.disabled ? "true" : "false"}"
|
|
172
|
-
aria-labelledby="dropdown-label"
|
|
184
|
+
aria-labelledby="dropdown-label dropdown-addtext"
|
|
185
|
+
aria-describedby="${a(this.describedBy)}"
|
|
173
186
|
@click=${this.toggle}
|
|
174
187
|
@keydown=${this.handleKeydown}
|
|
175
188
|
style=${`width: ${this.width};`}
|
|
176
189
|
?disabled=${this.disabled}
|
|
177
190
|
class="btn-dropdown"
|
|
178
191
|
>
|
|
179
|
-
<img alt="${
|
|
192
|
+
<img alt="${(n == null ? void 0 : n.imgalt) || ""}" src="${a(n == null ? void 0 : n.imgurl)}" />
|
|
180
193
|
<span id="dropdown-label" class="label">
|
|
181
|
-
${
|
|
194
|
+
${n ? h`
|
|
195
|
+
<span id="button-label" class="sr-only">${this.buttonLabel}: </span> ${n.label}
|
|
196
|
+
` : h`<span id="button-label">${this.buttonLabel}</span>`}
|
|
182
197
|
</span>
|
|
183
|
-
<div class="right">
|
|
198
|
+
<div id="dropdown-addtext" class="right">
|
|
184
199
|
<span class="additional-text">${this.additionaltext}</span>
|
|
185
|
-
<span class="arrow">
|
|
200
|
+
<span class="arrow" aria-hidden="true">
|
|
186
201
|
<o-icon-button
|
|
187
202
|
icon="${this.open ? "occ-triangle-up" : "occ-triangle-down"}"
|
|
188
203
|
size="medium"
|
|
@@ -193,35 +208,33 @@ let a = class extends y(w) {
|
|
|
193
208
|
</div>
|
|
194
209
|
</button>
|
|
195
210
|
|
|
196
|
-
${this.open ?
|
|
211
|
+
${this.open ? h`
|
|
197
212
|
<ul
|
|
198
213
|
id="dropdown-listbox"
|
|
199
|
-
role="listbox"
|
|
200
|
-
aria-activedescendant="${this.activeIndex >= 0 ? "option-" + this.activeIndex : ""}"
|
|
201
214
|
style=${`width: ${this.width};`}
|
|
215
|
+
@focusout=${this._handleListFocusOut}
|
|
202
216
|
>
|
|
203
217
|
${this.options.map(
|
|
204
|
-
(
|
|
218
|
+
(e, o) => h`
|
|
205
219
|
<li
|
|
206
|
-
id="option-${
|
|
207
|
-
|
|
208
|
-
data-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
tabindex="${n === this.activeIndex ? "0" : "-1"}"
|
|
213
|
-
class="${n === this.activeIndex ? "active" : ""} ${t.disabled ? "disabled" : ""}"
|
|
214
|
-
@click=${(s) => {
|
|
215
|
-
this._emitTrackingEvent(t, n), this.selectOption(t);
|
|
220
|
+
id="option-${o}"
|
|
221
|
+
data-index="${o}"
|
|
222
|
+
data-product="${a(e.dataproduct)}"
|
|
223
|
+
class="${o === this.activeIndex ? "active" : ""} ${e.disabled ? "disabled" : ""}"
|
|
224
|
+
@click=${(d) => {
|
|
225
|
+
this._emitTrackingEvent(e, o), this.selectOption(e);
|
|
216
226
|
}}
|
|
217
227
|
>
|
|
218
228
|
|
|
219
|
-
<a href="${
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
229
|
+
<a href="${a(e.url)}" aria-current="${a(o === this.activeIndex ? "page" : void 0)}"
|
|
230
|
+
aria-describedby="button-label" tabindex="${a(o === this.activeIndex ? "-1" : void 0)}"
|
|
231
|
+
aria-labelledby="label-${o} label-addtext-${o}"
|
|
232
|
+
>
|
|
233
|
+
<img alt="${e.imgalt || ""}" src="${a(e.imgurl)}" />
|
|
234
|
+
<span class="label" id="label-${o}">${e.label}</span>
|
|
235
|
+
<div class="right" id="label-addtext-${o}">
|
|
236
|
+
<span class="additional-text">${a(e.additionaltext)}</span>
|
|
237
|
+
${e.value === this.value && !e.additionaltext ? h`
|
|
225
238
|
<span class="check">${I(i)}</span>` : null}
|
|
226
239
|
</div>
|
|
227
240
|
</a>
|
|
@@ -234,7 +247,7 @@ let a = class extends y(w) {
|
|
|
234
247
|
`;
|
|
235
248
|
}
|
|
236
249
|
};
|
|
237
|
-
|
|
250
|
+
r.styles = m`
|
|
238
251
|
:host {
|
|
239
252
|
display: inline-block;
|
|
240
253
|
position: relative;
|
|
@@ -410,37 +423,47 @@ a.styles = m`
|
|
|
410
423
|
input[type="hidden"] {
|
|
411
424
|
display: none;
|
|
412
425
|
}
|
|
426
|
+
|
|
427
|
+
.sr-only {
|
|
428
|
+
${O}
|
|
429
|
+
}
|
|
413
430
|
`;
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
],
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
],
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
],
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
],
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
],
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
],
|
|
432
|
-
|
|
431
|
+
s([
|
|
432
|
+
l({ type: Array, reflect: !0 })
|
|
433
|
+
], r.prototype, "options", 2);
|
|
434
|
+
s([
|
|
435
|
+
l({ type: String, reflect: !0 })
|
|
436
|
+
], r.prototype, "value", 2);
|
|
437
|
+
s([
|
|
438
|
+
l({ type: String, reflect: !0 })
|
|
439
|
+
], r.prototype, "name", 2);
|
|
440
|
+
s([
|
|
441
|
+
l({ type: String, reflect: !0 })
|
|
442
|
+
], r.prototype, "additionaltext", 2);
|
|
443
|
+
s([
|
|
444
|
+
l({ type: Boolean, reflect: !0 })
|
|
445
|
+
], r.prototype, "disabled", 2);
|
|
446
|
+
s([
|
|
447
|
+
l({ type: String, reflect: !0 })
|
|
448
|
+
], r.prototype, "width", 2);
|
|
449
|
+
s([
|
|
450
|
+
l({ type: String, reflect: !0, attribute: "button-label" })
|
|
451
|
+
], r.prototype, "buttonLabel", 2);
|
|
452
|
+
s([
|
|
453
|
+
l({ type: String, reflect: !0, attribute: "describedby" })
|
|
454
|
+
], r.prototype, "describedBy", 2);
|
|
455
|
+
s([
|
|
433
456
|
f()
|
|
434
|
-
],
|
|
435
|
-
|
|
457
|
+
], r.prototype, "open", 2);
|
|
458
|
+
s([
|
|
436
459
|
f()
|
|
437
|
-
],
|
|
438
|
-
|
|
460
|
+
], r.prototype, "activeIndex", 2);
|
|
461
|
+
s([
|
|
439
462
|
f()
|
|
440
|
-
],
|
|
441
|
-
|
|
463
|
+
], r.prototype, "menuWidth", 2);
|
|
464
|
+
r = s([
|
|
442
465
|
x("o-dropdown-variant")
|
|
443
|
-
],
|
|
466
|
+
], r);
|
|
444
467
|
export {
|
|
445
|
-
|
|
468
|
+
r as OccitaneDropdownVariant
|
|
446
469
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { i as u, m as h, a as
|
|
2
|
-
import { n as
|
|
1
|
+
import { i as u, m as h, a as b, x as d, t as p } from "../performance-mixin-D7YmSeqN.mjs";
|
|
2
|
+
import { n as l } from "../property-S_Y9cb04.mjs";
|
|
3
3
|
import { r as m } from "../state-DjMxXomO.mjs";
|
|
4
4
|
import "./icon-button.mjs";
|
|
5
|
-
var f = Object.defineProperty,
|
|
6
|
-
for (var
|
|
7
|
-
(
|
|
8
|
-
return
|
|
5
|
+
var f = Object.defineProperty, v = Object.getOwnPropertyDescriptor, n = (t, e, o, s) => {
|
|
6
|
+
for (var r = s > 1 ? void 0 : s ? v(e, o) : e, c = t.length - 1, a; c >= 0; c--)
|
|
7
|
+
(a = t[c]) && (r = (s ? a(e, o, r) : a(r)) || r);
|
|
8
|
+
return s && r && f(e, o, r), r;
|
|
9
9
|
};
|
|
10
|
-
let
|
|
10
|
+
let i = class extends h(b) {
|
|
11
11
|
constructor() {
|
|
12
12
|
super(...arguments), this.thumbnails = [], this.activeIndex = 0, this.disabledIndexes = [], this.maxWidth = "100%", this.altressource = "visual", this.focusedIndex = 0, this.playerIconTemplate = d`
|
|
13
13
|
<o-icon-button
|
|
@@ -55,13 +55,11 @@ let r = class extends h(p) {
|
|
|
55
55
|
}
|
|
56
56
|
onFocus(t) {
|
|
57
57
|
const e = t.currentTarget, o = Number(e.dataset.index);
|
|
58
|
-
this.focusedIndex = o
|
|
59
|
-
s.classList.remove("a--tabfocus");
|
|
60
|
-
}), e.classList.add("a--tabfocus"), this.requestUpdate();
|
|
58
|
+
this.focusedIndex = o;
|
|
61
59
|
}
|
|
62
60
|
onFocusOut(t) {
|
|
63
|
-
const e = t.currentTarget, o = Number(e.dataset.index),
|
|
64
|
-
(!
|
|
61
|
+
const e = t.currentTarget, o = Number(e.dataset.index), s = t.relatedTarget;
|
|
62
|
+
(!s || this.shadowRoot && !this.shadowRoot.contains(s)) && (o === this.lastIndex ? this.dispatchEvent(new CustomEvent("thumb-exit", {
|
|
65
63
|
detail: { from: "last", direction: "unspecified" },
|
|
66
64
|
bubbles: !0,
|
|
67
65
|
composed: !0
|
|
@@ -75,22 +73,22 @@ let r = class extends h(p) {
|
|
|
75
73
|
return d`
|
|
76
74
|
<ul class="scroll-container" style="max-width: ${this.maxWidth};">
|
|
77
75
|
${this.thumbnails.map((t, e) => {
|
|
78
|
-
const o = this.disabledIndexes.includes(e),
|
|
76
|
+
const o = this.disabledIndexes.includes(e), s = this.activeIndex === e, r = t.type === "video", c = t.alt || (r ? `video ${e}` : `${this.altressource} ${e + 1}`);
|
|
79
77
|
return d`
|
|
80
78
|
<li class="thumb-wrapper">
|
|
81
79
|
<button
|
|
82
80
|
class="thumb"
|
|
83
81
|
data-index="${e}"
|
|
84
82
|
?disabled=${o}
|
|
85
|
-
aria-current=${
|
|
83
|
+
aria-current=${s ? "true" : "false"}
|
|
86
84
|
@click=${() => this.selectThumbnail(e)}
|
|
87
85
|
@keydown=${this.handleKeyDown}
|
|
88
|
-
@focus=${(
|
|
89
|
-
@focusout=${(
|
|
86
|
+
@focus=${(a) => this.onFocus(a)}
|
|
87
|
+
@focusout=${(a) => this.onFocusOut(a)}
|
|
90
88
|
>
|
|
91
|
-
<img alt="${
|
|
89
|
+
<img alt="${c}" src="${t.src}" />
|
|
92
90
|
</button>
|
|
93
|
-
${
|
|
91
|
+
${r ? d`<div class="play-icon-wrapper">${this.playerIconTemplate}</div>` : null}
|
|
94
92
|
</li>
|
|
95
93
|
`;
|
|
96
94
|
})}
|
|
@@ -98,7 +96,7 @@ let r = class extends h(p) {
|
|
|
98
96
|
`;
|
|
99
97
|
}
|
|
100
98
|
};
|
|
101
|
-
|
|
99
|
+
i.styles = u`
|
|
102
100
|
:host {
|
|
103
101
|
display: flex;
|
|
104
102
|
gap: 5px;
|
|
@@ -112,33 +110,54 @@ r.styles = u`
|
|
|
112
110
|
.thumb {
|
|
113
111
|
width: 56px;
|
|
114
112
|
height: 70px;
|
|
115
|
-
background
|
|
116
|
-
|
|
117
|
-
|
|
113
|
+
background: var(--thumb-border);
|
|
114
|
+
--thumb-border: var(--color-alpha-dark-light);
|
|
115
|
+
--thumb-border-width: 0.5px;
|
|
116
|
+
border: none;
|
|
118
117
|
opacity: 1;
|
|
119
118
|
cursor: pointer;
|
|
120
119
|
outline: none;
|
|
121
|
-
transition:
|
|
122
|
-
padding:
|
|
120
|
+
transition: opacity 0.2s;
|
|
121
|
+
padding: var(--thumb-border-width);
|
|
123
122
|
margin: 0;
|
|
124
123
|
box-sizing: content-box;
|
|
125
124
|
position: relative;
|
|
126
125
|
|
|
127
126
|
img {
|
|
127
|
+
display: block;
|
|
128
128
|
width: 100%;
|
|
129
|
-
height:
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
height: 100%;
|
|
130
|
+
object-fit: cover;
|
|
131
|
+
background: linear-gradient(to bottom, #f9f5f0, #f7f2ea);
|
|
132
|
+
border: 1px solid var(--color-border-light);
|
|
132
133
|
box-sizing: border-box;
|
|
133
134
|
}
|
|
134
135
|
}
|
|
135
136
|
|
|
136
137
|
.thumb[aria-current="true"] {
|
|
137
|
-
|
|
138
|
+
--thumb-border: var(--color-container-action-primary-default);
|
|
139
|
+
--thumb-border-width: 1px;
|
|
138
140
|
}
|
|
139
141
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
+
@media (hover: hover) {
|
|
143
|
+
.thumb:hover {
|
|
144
|
+
--thumb-border: var(--color-alpha-dark-medium);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.thumb[aria-current="true"]:hover {
|
|
148
|
+
--thumb-border: var(--color-container-action-primary-hover);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.thumb:active {
|
|
153
|
+
--thumb-border: var(--color-alpha-dark-strong);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.thumb[aria-current="true"]:active {
|
|
157
|
+
--thumb-border: var(--color-container-action-primary-pressed);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.thumb:focus-visible::before {
|
|
142
161
|
content: "";
|
|
143
162
|
position: absolute;
|
|
144
163
|
top: 0;
|
|
@@ -151,13 +170,13 @@ r.styles = u`
|
|
|
151
170
|
}
|
|
152
171
|
|
|
153
172
|
.thumb[disabled] {
|
|
154
|
-
border:
|
|
173
|
+
--thumb-border: var(--color-border-disabled, #eee);
|
|
155
174
|
opacity: 0.4;
|
|
156
175
|
pointer-events: none;
|
|
157
176
|
}
|
|
158
177
|
|
|
159
178
|
.thumb:focus-visible {
|
|
160
|
-
border:
|
|
179
|
+
--thumb-border: var(--color-border-primary) !important;
|
|
161
180
|
}
|
|
162
181
|
|
|
163
182
|
.play-icon-wrapper {
|
|
@@ -207,30 +226,30 @@ r.styles = u`
|
|
|
207
226
|
width: 0;
|
|
208
227
|
}
|
|
209
228
|
`;
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
],
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
],
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
],
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
],
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
],
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
],
|
|
228
|
-
|
|
229
|
+
n([
|
|
230
|
+
l({ type: Array })
|
|
231
|
+
], i.prototype, "thumbnails", 2);
|
|
232
|
+
n([
|
|
233
|
+
l({ type: Number })
|
|
234
|
+
], i.prototype, "activeIndex", 2);
|
|
235
|
+
n([
|
|
236
|
+
l({ type: Array })
|
|
237
|
+
], i.prototype, "disabledIndexes", 2);
|
|
238
|
+
n([
|
|
239
|
+
l({ type: String })
|
|
240
|
+
], i.prototype, "maxWidth", 2);
|
|
241
|
+
n([
|
|
242
|
+
l({ type: String })
|
|
243
|
+
], i.prototype, "altressource", 2);
|
|
244
|
+
n([
|
|
245
|
+
l({ type: Object })
|
|
246
|
+
], i.prototype, "swiperInstance", 2);
|
|
247
|
+
n([
|
|
229
248
|
m()
|
|
230
|
-
],
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
],
|
|
249
|
+
], i.prototype, "focusedIndex", 2);
|
|
250
|
+
i = n([
|
|
251
|
+
p("thumbnail-navigation")
|
|
252
|
+
], i);
|
|
234
253
|
export {
|
|
235
|
-
|
|
254
|
+
i as ThumbnailNavigation
|
|
236
255
|
};
|
package/index.mjs
CHANGED
package/loader.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import "./components/link.mjs";
|
|
|
4
4
|
import "./components/header-simplify.mjs";
|
|
5
5
|
import "./components/breadcrumb.mjs";
|
|
6
6
|
import "./components/breadcrumbs.mjs";
|
|
7
|
-
globalThis.__FLORID_KIT__ = "3.2.
|
|
7
|
+
globalThis.__FLORID_KIT__ = "3.2.25";
|
|
8
8
|
const i = {
|
|
9
9
|
"o-accordion": () => import("./components/accordion.mjs"),
|
|
10
10
|
"o-accordion-group": () => import("./components/accordion-group.mjs"),
|