@florid-kit/components 3.1.12 → 3.1.13
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/side-panel.d.ts +1 -1
- package/components/side-panel.mjs +229 -229
- package/index.mjs +1 -1
- package/loader.mjs +1 -1
- package/package.json +1 -1
|
@@ -62,7 +62,7 @@ export declare class OccitaneSidePanel extends OccitaneSidePanel_base {
|
|
|
62
62
|
private isUnavailableElement;
|
|
63
63
|
private getFocusableElements;
|
|
64
64
|
openPanel(): void;
|
|
65
|
-
closePanel(): void;
|
|
65
|
+
closePanel(e?: Event): void;
|
|
66
66
|
private handleClosePanel;
|
|
67
67
|
private handleFirstClick;
|
|
68
68
|
private handleSecondClick;
|
|
@@ -13,15 +13,15 @@ import { f as T } from "../directive-helpers-BHuwIghp.mjs";
|
|
|
13
13
|
* Copyright 2023 Google LLC
|
|
14
14
|
* SPDX-License-Identifier: Apache-2.0
|
|
15
15
|
*/
|
|
16
|
-
function q(
|
|
17
|
-
|
|
18
|
-
const o =
|
|
19
|
-
o.addEventListener("click", async (
|
|
20
|
-
const { type:
|
|
21
|
-
if (!(!l ||
|
|
16
|
+
function q(e) {
|
|
17
|
+
e.addInitializer((t) => {
|
|
18
|
+
const o = t;
|
|
19
|
+
o.addEventListener("click", async (i) => {
|
|
20
|
+
const { type: n, [B]: r } = o, { form: l } = r;
|
|
21
|
+
if (!(!l || n === "button") && (await new Promise((b) => {
|
|
22
22
|
setTimeout(b);
|
|
23
|
-
}), !
|
|
24
|
-
if (
|
|
23
|
+
}), !i.defaultPrevented)) {
|
|
24
|
+
if (n === "reset") {
|
|
25
25
|
l.reset();
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
@@ -45,54 +45,54 @@ function q(t) {
|
|
|
45
45
|
* Copyright 2017 Google LLC
|
|
46
46
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
47
|
*/
|
|
48
|
-
const v = (
|
|
49
|
-
var
|
|
50
|
-
const o =
|
|
48
|
+
const v = (e, t) => {
|
|
49
|
+
var i;
|
|
50
|
+
const o = e._$AN;
|
|
51
51
|
if (o === void 0) return !1;
|
|
52
|
-
for (const
|
|
52
|
+
for (const n of o) (i = n._$AO) == null || i.call(n, t, !1), v(n, t);
|
|
53
53
|
return !0;
|
|
54
|
-
}, y = (
|
|
55
|
-
let
|
|
54
|
+
}, y = (e) => {
|
|
55
|
+
let t, o;
|
|
56
56
|
do {
|
|
57
|
-
if ((
|
|
58
|
-
o =
|
|
57
|
+
if ((t = e._$AM) === void 0) break;
|
|
58
|
+
o = t._$AN, o.delete(e), e = t;
|
|
59
59
|
} while ((o == null ? void 0 : o.size) === 0);
|
|
60
|
-
}, D = (
|
|
61
|
-
for (let
|
|
62
|
-
let o =
|
|
63
|
-
if (o === void 0)
|
|
64
|
-
else if (o.has(
|
|
65
|
-
o.add(
|
|
60
|
+
}, D = (e) => {
|
|
61
|
+
for (let t; t = e._$AM; e = t) {
|
|
62
|
+
let o = t._$AN;
|
|
63
|
+
if (o === void 0) t._$AN = o = /* @__PURE__ */ new Set();
|
|
64
|
+
else if (o.has(e)) break;
|
|
65
|
+
o.add(e), K(t);
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
|
-
function H(
|
|
69
|
-
this._$AN !== void 0 ? (y(this), this._$AM =
|
|
68
|
+
function H(e) {
|
|
69
|
+
this._$AN !== void 0 ? (y(this), this._$AM = e, D(this)) : this._$AM = e;
|
|
70
70
|
}
|
|
71
|
-
function M(
|
|
72
|
-
const
|
|
73
|
-
if (
|
|
74
|
-
else
|
|
75
|
-
else v(this,
|
|
71
|
+
function M(e, t = !1, o = 0) {
|
|
72
|
+
const i = this._$AH, n = this._$AN;
|
|
73
|
+
if (n !== void 0 && n.size !== 0) if (t) if (Array.isArray(i)) for (let r = o; r < i.length; r++) v(i[r], !1), y(i[r]);
|
|
74
|
+
else i != null && (v(i, !1), y(i));
|
|
75
|
+
else v(this, e);
|
|
76
76
|
}
|
|
77
|
-
const K = (
|
|
78
|
-
|
|
77
|
+
const K = (e) => {
|
|
78
|
+
e.type == O.CHILD && (e._$AP ?? (e._$AP = M), e._$AQ ?? (e._$AQ = H));
|
|
79
79
|
};
|
|
80
80
|
class j extends L {
|
|
81
81
|
constructor() {
|
|
82
82
|
super(...arguments), this._$AN = void 0;
|
|
83
83
|
}
|
|
84
|
-
_$AT(
|
|
85
|
-
super._$AT(
|
|
84
|
+
_$AT(t, o, i) {
|
|
85
|
+
super._$AT(t, o, i), D(this), this.isConnected = t._$AU;
|
|
86
86
|
}
|
|
87
|
-
_$AO(
|
|
88
|
-
var
|
|
89
|
-
|
|
87
|
+
_$AO(t, o = !0) {
|
|
88
|
+
var i, n;
|
|
89
|
+
t !== this.isConnected && (this.isConnected = t, t ? (i = this.reconnected) == null || i.call(this) : (n = this.disconnected) == null || n.call(this)), o && (v(this, t), y(this));
|
|
90
90
|
}
|
|
91
|
-
setValue(
|
|
92
|
-
if (T(this._$Ct)) this._$Ct._$AI(
|
|
91
|
+
setValue(t) {
|
|
92
|
+
if (T(this._$Ct)) this._$Ct._$AI(t, this);
|
|
93
93
|
else {
|
|
94
94
|
const o = [...this._$Ct._$AH];
|
|
95
|
-
o[this._$Ci] =
|
|
95
|
+
o[this._$Ci] = t, this._$Ct._$AI(o, this, 0);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
disconnected() {
|
|
@@ -104,244 +104,244 @@ class N extends j {
|
|
|
104
104
|
constructor() {
|
|
105
105
|
super(...arguments), this.prevData = {};
|
|
106
106
|
}
|
|
107
|
-
render(
|
|
107
|
+
render(t) {
|
|
108
108
|
return p;
|
|
109
109
|
}
|
|
110
|
-
update(
|
|
111
|
-
var
|
|
112
|
-
this.element !==
|
|
110
|
+
update(t, [o]) {
|
|
111
|
+
var i;
|
|
112
|
+
this.element !== t.element && (this.element = t.element), this.host = ((i = t.options) === null || i === void 0 ? void 0 : i.host) || this.element, this.apply(o), this.groom(o), this.prevData = { ...o };
|
|
113
113
|
}
|
|
114
|
-
apply(
|
|
115
|
-
if (!
|
|
114
|
+
apply(t) {
|
|
115
|
+
if (!t)
|
|
116
116
|
return;
|
|
117
|
-
const { prevData: o, element:
|
|
118
|
-
for (const
|
|
119
|
-
const r =
|
|
120
|
-
r !== o[
|
|
117
|
+
const { prevData: o, element: i } = this;
|
|
118
|
+
for (const n in t) {
|
|
119
|
+
const r = t[n];
|
|
120
|
+
r !== o[n] && (i[n] = r);
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
groom(
|
|
124
|
-
const { prevData: o, element:
|
|
123
|
+
groom(t) {
|
|
124
|
+
const { prevData: o, element: i } = this;
|
|
125
125
|
if (o)
|
|
126
|
-
for (const
|
|
127
|
-
(!
|
|
126
|
+
for (const n in o)
|
|
127
|
+
(!t || !(n in t) && i[n] === o[n]) && (i[n] = void 0);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
class V extends N {
|
|
131
131
|
constructor() {
|
|
132
132
|
super(...arguments), this.eventData = {};
|
|
133
133
|
}
|
|
134
|
-
apply(
|
|
135
|
-
if (
|
|
136
|
-
for (const o in
|
|
137
|
-
const
|
|
138
|
-
|
|
134
|
+
apply(t) {
|
|
135
|
+
if (t)
|
|
136
|
+
for (const o in t) {
|
|
137
|
+
const i = t[o];
|
|
138
|
+
i !== this.eventData[o] && this.applyEvent(o, i);
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
applyEvent(
|
|
142
|
-
const { prevData:
|
|
143
|
-
this.eventData[
|
|
141
|
+
applyEvent(t, o) {
|
|
142
|
+
const { prevData: i, element: n } = this;
|
|
143
|
+
this.eventData[t] = o, i[t] && n.removeEventListener(t, this, o), n.addEventListener(t, this, o);
|
|
144
144
|
}
|
|
145
|
-
groom(
|
|
146
|
-
const { prevData: o, element:
|
|
145
|
+
groom(t) {
|
|
146
|
+
const { prevData: o, element: i } = this;
|
|
147
147
|
if (o)
|
|
148
|
-
for (const
|
|
149
|
-
(!
|
|
148
|
+
for (const n in o)
|
|
149
|
+
(!t || !(n in t) && i[n] === o[n]) && this.groomEvent(n, o[n]);
|
|
150
150
|
}
|
|
151
|
-
groomEvent(
|
|
152
|
-
const { element:
|
|
153
|
-
delete this.eventData[
|
|
151
|
+
groomEvent(t, o) {
|
|
152
|
+
const { element: i } = this;
|
|
153
|
+
delete this.eventData[t], i.removeEventListener(t, this, o);
|
|
154
154
|
}
|
|
155
|
-
handleEvent(
|
|
156
|
-
const o = this.eventData[
|
|
157
|
-
typeof o == "function" ? o.call(this.host,
|
|
155
|
+
handleEvent(t) {
|
|
156
|
+
const o = this.eventData[t.type];
|
|
157
|
+
typeof o == "function" ? o.call(this.host, t) : o.handleEvent(t);
|
|
158
158
|
}
|
|
159
159
|
disconnected() {
|
|
160
|
-
const { eventData:
|
|
161
|
-
for (const
|
|
162
|
-
const
|
|
163
|
-
o.removeEventListener(
|
|
160
|
+
const { eventData: t, element: o } = this;
|
|
161
|
+
for (const i in t) {
|
|
162
|
+
const n = i.slice(1), r = t[i];
|
|
163
|
+
o.removeEventListener(n, this, r);
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
reconnected() {
|
|
167
|
-
const { eventData:
|
|
168
|
-
for (const
|
|
169
|
-
const
|
|
170
|
-
o.addEventListener(
|
|
167
|
+
const { eventData: t, element: o } = this;
|
|
168
|
+
for (const i in t) {
|
|
169
|
+
const n = i.slice(1), r = t[i];
|
|
170
|
+
o.addEventListener(n, this, r);
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
class X extends V {
|
|
175
|
-
apply(
|
|
176
|
-
if (!
|
|
175
|
+
apply(t) {
|
|
176
|
+
if (!t)
|
|
177
177
|
return;
|
|
178
|
-
const { prevData: o, element:
|
|
179
|
-
for (const
|
|
180
|
-
const r =
|
|
181
|
-
if (r === o[
|
|
178
|
+
const { prevData: o, element: i } = this;
|
|
179
|
+
for (const n in t) {
|
|
180
|
+
const r = t[n];
|
|
181
|
+
if (r === o[n])
|
|
182
182
|
continue;
|
|
183
|
-
const l =
|
|
184
|
-
switch (
|
|
183
|
+
const l = n.slice(1);
|
|
184
|
+
switch (n[0]) {
|
|
185
185
|
case "@":
|
|
186
186
|
this.eventData[l] = r, this.applyEvent(l, r);
|
|
187
187
|
break;
|
|
188
188
|
case ".":
|
|
189
|
-
|
|
189
|
+
i[l] = r;
|
|
190
190
|
break;
|
|
191
191
|
case "?":
|
|
192
|
-
r ?
|
|
192
|
+
r ? i.setAttribute(l, "") : i.removeAttribute(l);
|
|
193
193
|
break;
|
|
194
194
|
default:
|
|
195
|
-
r != null ?
|
|
195
|
+
r != null ? i.setAttribute(n, String(r)) : i.removeAttribute(n);
|
|
196
196
|
break;
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
|
-
groom(
|
|
201
|
-
const { prevData: o, element:
|
|
200
|
+
groom(t) {
|
|
201
|
+
const { prevData: o, element: i } = this;
|
|
202
202
|
if (o)
|
|
203
|
-
for (const
|
|
204
|
-
const r =
|
|
205
|
-
if (!
|
|
206
|
-
switch (
|
|
203
|
+
for (const n in o) {
|
|
204
|
+
const r = n.slice(1);
|
|
205
|
+
if (!t || !(n in t) && i[r] === o[n])
|
|
206
|
+
switch (n[0]) {
|
|
207
207
|
case "@":
|
|
208
|
-
this.groomEvent(r, o[
|
|
208
|
+
this.groomEvent(r, o[n]);
|
|
209
209
|
break;
|
|
210
210
|
case ".":
|
|
211
|
-
|
|
211
|
+
i[r] = void 0;
|
|
212
212
|
break;
|
|
213
213
|
case "?":
|
|
214
|
-
|
|
214
|
+
i.removeAttribute(r);
|
|
215
215
|
break;
|
|
216
216
|
default:
|
|
217
|
-
|
|
217
|
+
i.removeAttribute(n);
|
|
218
218
|
break;
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
const k = R(X);
|
|
224
|
-
var U = Object.defineProperty, W = Object.getOwnPropertyDescriptor, c = (
|
|
225
|
-
for (var
|
|
226
|
-
(l =
|
|
227
|
-
return
|
|
224
|
+
var U = Object.defineProperty, W = Object.getOwnPropertyDescriptor, c = (e, t, o, i) => {
|
|
225
|
+
for (var n = i > 1 ? void 0 : i ? W(t, o) : t, r = e.length - 1, l; r >= 0; r--)
|
|
226
|
+
(l = e[r]) && (n = (i ? l(t, o, n) : l(n)) || n);
|
|
227
|
+
return i && n && U(t, o, n), n;
|
|
228
228
|
};
|
|
229
229
|
let a = class extends S(w) {
|
|
230
230
|
constructor() {
|
|
231
|
-
super(...arguments), this.open = !1, this.showHeader = !0, this.showFooter = !1, this.showHeaderStartIcon = !1, this.headerTitle = "", this.headerTitleClassName = "panel-title", this.labelDialog = "", this.labelAriaDialogPanel = "", this.addToBagProductCount = "", this.closeButtonLabel = "Close the modal", this.goBackButtonLabel = "Go back to", this.firstButtonLabel = "Close", this.firstButtonVariant = "primary", this.firstButtonProps = {}, this.onFirstButtonClickClose = !1, this.secondButtonLabel = "", this.secondButtonVariant = "secondary", this.secondButtonProps = {}, this.onSecondButtonClickClose = !1, this.stickyFooter = !1, this.disablePortal = !1, this.zIndex = 99, this.initialized = !1, this.showDetail = !1, this.isHidingDetail = !1, this.previousFocusedElement = null, this.previousFocusedSelector = null, this._hideTimeout = null, this._onOpenDetail = async (
|
|
232
|
-
var o,
|
|
233
|
-
const
|
|
234
|
-
if (this._detailOriginEl =
|
|
235
|
-
const
|
|
236
|
-
|
|
231
|
+
super(...arguments), this.open = !1, this.showHeader = !0, this.showFooter = !1, this.showHeaderStartIcon = !1, this.headerTitle = "", this.headerTitleClassName = "panel-title", this.labelDialog = "", this.labelAriaDialogPanel = "", this.addToBagProductCount = "", this.closeButtonLabel = "Close the modal", this.goBackButtonLabel = "Go back to", this.firstButtonLabel = "Close", this.firstButtonVariant = "primary", this.firstButtonProps = {}, this.onFirstButtonClickClose = !1, this.secondButtonLabel = "", this.secondButtonVariant = "secondary", this.secondButtonProps = {}, this.onSecondButtonClickClose = !1, this.stickyFooter = !1, this.disablePortal = !1, this.zIndex = 99, this.initialized = !1, this.showDetail = !1, this.isHidingDetail = !1, this.previousFocusedElement = null, this.previousFocusedSelector = null, this._hideTimeout = null, this._onOpenDetail = async (e) => {
|
|
232
|
+
var o, i;
|
|
233
|
+
const t = ((o = e.detail) == null ? void 0 : o.origin) ?? document.activeElement;
|
|
234
|
+
if (this._detailOriginEl = t, this._detailOriginClass = (t == null ? void 0 : t.className) ?? "", this.showDetail = !0, this.showHeaderStartIcon = !0, await this.updateComplete, this._detailOriginClass) {
|
|
235
|
+
const n = (i = this.shadowRoot) == null ? void 0 : i.querySelector(".detail-view");
|
|
236
|
+
n && n.setAttribute("fromelement", this._detailOriginClass);
|
|
237
237
|
}
|
|
238
238
|
await this.focusDetailReturnBtn();
|
|
239
|
-
}, this._detailOriginEl = null, this._detailOriginClass = "", this.handleKeyDown = (
|
|
240
|
-
this.open && (
|
|
241
|
-
}, this.handleClosePanel = (
|
|
242
|
-
if (
|
|
239
|
+
}, this._detailOriginEl = null, this._detailOriginClass = "", this.handleKeyDown = (e) => {
|
|
240
|
+
this.open && (e.key === "Escape" ? this.closePanel(e) : e.key === "Tab" && this.trapFocus(e));
|
|
241
|
+
}, this.handleClosePanel = (e) => {
|
|
242
|
+
if (e instanceof KeyboardEvent && e.key !== "Enter" && e.key !== " ")
|
|
243
243
|
return;
|
|
244
|
-
|
|
245
|
-
const
|
|
244
|
+
e.preventDefault(), e.type === "keydown" && e.stopPropagation();
|
|
245
|
+
const t = e.currentTarget, o = (t == null ? void 0 : t.getAttribute("data-role")) === "back";
|
|
246
246
|
if (this.showDetail && o) {
|
|
247
247
|
this.isHidingDetail = !0;
|
|
248
|
-
const
|
|
248
|
+
const i = this.renderRoot.querySelector(".content"), n = async () => {
|
|
249
249
|
this.showDetail = !1, this.isHidingDetail = !1, this.showHeaderStartIcon = !1, await this.updateComplete, this._restoreFocusToOrigin();
|
|
250
250
|
};
|
|
251
|
-
if (
|
|
251
|
+
if (i) {
|
|
252
252
|
this.showHeaderStartIcon = !1;
|
|
253
253
|
const r = () => {
|
|
254
|
-
this.showDetail = !1, this.isHidingDetail = !1,
|
|
254
|
+
this.showDetail = !1, this.isHidingDetail = !1, i.removeEventListener("animationend", r), n();
|
|
255
255
|
};
|
|
256
|
-
|
|
256
|
+
i.addEventListener("animationend", r);
|
|
257
257
|
} else
|
|
258
258
|
this.showDetail = !1, this.isHidingDetail = !1, this.showHeaderStartIcon = !1;
|
|
259
259
|
return;
|
|
260
260
|
}
|
|
261
|
-
this.closePanel();
|
|
261
|
+
this.closePanel(e);
|
|
262
262
|
};
|
|
263
263
|
}
|
|
264
264
|
focusFirstInPanel() {
|
|
265
|
-
var
|
|
266
|
-
(
|
|
265
|
+
var t, o, i;
|
|
266
|
+
(i = this.getFocusableElements().filter((n) => !!n && !n.hasAttribute("disabled"))[0] ?? ((t = this.shadowRoot) == null ? void 0 : t.querySelector(".close-btn")) ?? ((o = this.shadowRoot) == null ? void 0 : o.querySelector(".panel"))) == null || i.focus({ preventScroll: !0 });
|
|
267
267
|
}
|
|
268
|
-
resolveFocusable(
|
|
268
|
+
resolveFocusable(e) {
|
|
269
269
|
var o;
|
|
270
|
-
const
|
|
271
|
-
return
|
|
270
|
+
const t = e.tagName.toLowerCase();
|
|
271
|
+
return t === "o-icon-button" || t === "o-button" ? ((o = e.shadowRoot) == null ? void 0 : o.querySelector("button, .button")) ?? e : e;
|
|
272
272
|
}
|
|
273
273
|
connectedCallback() {
|
|
274
274
|
super.connectedCallback(), !this.disablePortal && this.parentElement !== document.body && document.body.appendChild(this), this.addEventListener("keydown", this.handleKeyDown), this.updateComplete.then(() => {
|
|
275
275
|
this.initialized = !0;
|
|
276
|
-
}), this.addEventListener("open-detail", this._onOpenDetail), this.addEventListener("focusin", (
|
|
277
|
-
|
|
276
|
+
}), this.addEventListener("open-detail", this._onOpenDetail), this.addEventListener("focusin", (e) => {
|
|
277
|
+
e.composedPath()[0] === this && this.focusFirstInPanel();
|
|
278
278
|
});
|
|
279
279
|
}
|
|
280
280
|
disconnectedCallback() {
|
|
281
281
|
document.body.style.overflow = "", document.body.removeAttribute("data-side-panel"), this.removeEventListener("keydown", this.handleKeyDown), super.disconnectedCallback(), this.removeEventListener("open-detail", this._onOpenDetail);
|
|
282
282
|
}
|
|
283
283
|
async focusDetailReturnBtn() {
|
|
284
|
-
var
|
|
284
|
+
var n, r, l, b, f;
|
|
285
285
|
await this.updateComplete;
|
|
286
|
-
const
|
|
287
|
-
if (
|
|
286
|
+
const e = this.getDeepActiveElement(document);
|
|
287
|
+
if (e && e !== document.body)
|
|
288
288
|
try {
|
|
289
|
-
|
|
289
|
+
e.blur();
|
|
290
290
|
} catch {
|
|
291
291
|
}
|
|
292
292
|
await new Promise(requestAnimationFrame);
|
|
293
|
-
const
|
|
294
|
-
if (!
|
|
295
|
-
|
|
296
|
-
const
|
|
297
|
-
|
|
293
|
+
const t = (n = this.shadowRoot) == null ? void 0 : n.querySelector(".detail-view .return-btn");
|
|
294
|
+
if (!t) return;
|
|
295
|
+
t.updateComplete && await t.updateComplete, (b = (l = ((r = t.shadowRoot) == null ? void 0 : r.querySelector("button")) ?? t) == null ? void 0 : l.focus) == null || b.call(l, { preventScroll: !0 });
|
|
296
|
+
const i = (f = this.shadowRoot) == null ? void 0 : f.querySelector('.panel[role="dialog"]');
|
|
297
|
+
i && i.setAttribute("aria-label", this.labelAriaDialogPanel || "panel-title");
|
|
298
298
|
}
|
|
299
299
|
_restoreFocusToOrigin() {
|
|
300
|
-
var
|
|
301
|
-
const
|
|
302
|
-
!
|
|
303
|
-
var
|
|
304
|
-
|
|
300
|
+
var t, o;
|
|
301
|
+
const e = this._detailOriginEl;
|
|
302
|
+
!e || !document.contains(e) || ((o = (t = document.activeElement) == null ? void 0 : t.blur) == null || o.call(t), requestAnimationFrame(() => {
|
|
303
|
+
var n;
|
|
304
|
+
e.classList.add("a--tabfocus"), (((n = e.shadowRoot) == null ? void 0 : n.querySelector('button, .button, [tabindex]:not([tabindex="-1"])')) ?? null ?? e).focus({ preventScroll: !0 });
|
|
305
305
|
}));
|
|
306
306
|
}
|
|
307
|
-
getDeepActiveElement(
|
|
308
|
-
let
|
|
309
|
-
for (;
|
|
310
|
-
|
|
311
|
-
return
|
|
307
|
+
getDeepActiveElement(e = this.shadowRoot) {
|
|
308
|
+
let t = e.activeElement;
|
|
309
|
+
for (; t && t.shadowRoot && t.shadowRoot.activeElement; )
|
|
310
|
+
t = t.shadowRoot.activeElement;
|
|
311
|
+
return t;
|
|
312
312
|
}
|
|
313
|
-
wrapFocus(
|
|
313
|
+
wrapFocus(e, t, o) {
|
|
314
314
|
var r;
|
|
315
315
|
if (!o.length) {
|
|
316
|
-
|
|
316
|
+
e.preventDefault(), e.stopPropagation(), (r = this.renderRoot.querySelector(".panel")) == null || r.focus({ preventScroll: !0 });
|
|
317
317
|
return;
|
|
318
318
|
}
|
|
319
|
-
const
|
|
320
|
-
!
|
|
319
|
+
const i = o[0], n = o[o.length - 1];
|
|
320
|
+
!t || !o.includes(t) ? (e.preventDefault(), e.stopPropagation(), (e.shiftKey ? n : i).focus({ preventScroll: !0 })) : !e.shiftKey && t === n ? (e.preventDefault(), e.stopPropagation(), i.focus({ preventScroll: !0 })) : e.shiftKey && t === i && (e.preventDefault(), e.stopPropagation(), n.focus({ preventScroll: !0 }));
|
|
321
321
|
}
|
|
322
|
-
trapFocus(
|
|
323
|
-
if (
|
|
324
|
-
const
|
|
325
|
-
if (!
|
|
322
|
+
trapFocus(e) {
|
|
323
|
+
if (e.key !== "Tab") return;
|
|
324
|
+
const t = this.shadowRoot;
|
|
325
|
+
if (!t) return;
|
|
326
326
|
const o = this.getFocusableElements();
|
|
327
|
-
|
|
328
|
-
const
|
|
327
|
+
e.target && e.target.closest("o-side-panel") && !o.includes(e.target) && o.splice(1, 0, e.target);
|
|
328
|
+
const i = e.composedPath()[0] ?? this.getDeepActiveElement(document);
|
|
329
329
|
if (this.showDetail) {
|
|
330
|
-
this.wrapFocus(
|
|
330
|
+
this.wrapFocus(e, i, o);
|
|
331
331
|
return;
|
|
332
332
|
}
|
|
333
333
|
if (document.querySelector("#refineandsortpopin")) {
|
|
334
|
-
const l =
|
|
335
|
-
|
|
334
|
+
const l = t.querySelector(".close-btn"), b = l ? this.resolveFocusable(l) : null, f = t.querySelector(".js-clear-refinements"), m = f ? this.resolveFocusable(f) : null, x = (P) => {
|
|
335
|
+
e.preventDefault(), e.stopPropagation(), P.focus();
|
|
336
336
|
};
|
|
337
337
|
if (b && m) {
|
|
338
|
-
if (!
|
|
339
|
-
if (
|
|
338
|
+
if (!e.shiftKey && i === m) return x(b);
|
|
339
|
+
if (e.shiftKey && i === b) return x(m);
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
const r = this.renderRoot.querySelector(".close-btn");
|
|
343
|
-
if (!
|
|
344
|
-
|
|
343
|
+
if (!e.shiftKey && r && r.contains(i)) {
|
|
344
|
+
e.preventDefault();
|
|
345
345
|
const l = this.renderRoot.querySelector(
|
|
346
346
|
".o-whats-inside--content p"
|
|
347
347
|
);
|
|
@@ -350,83 +350,83 @@ let a = class extends S(w) {
|
|
|
350
350
|
return;
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
|
-
this.wrapFocus(
|
|
353
|
+
this.wrapFocus(e, i, o);
|
|
354
354
|
}
|
|
355
|
-
isUnavailableElement(
|
|
356
|
-
if (!(
|
|
357
|
-
if (
|
|
358
|
-
const
|
|
355
|
+
isUnavailableElement(e) {
|
|
356
|
+
if (!(e instanceof HTMLElement)) return !1;
|
|
357
|
+
if (e.disabled || e.hasAttribute("disabled") || e.getAttribute("tabindex") === "-1" || e.closest("[hidden], [inert], [aria-hidden='true']")) return !0;
|
|
358
|
+
const t = e.ownerDocument.defaultView, o = t == null ? void 0 : t.getComputedStyle(e);
|
|
359
359
|
return (o == null ? void 0 : o.display) === "none" || (o == null ? void 0 : o.visibility) === "hidden" || (o == null ? void 0 : o.visibility) === "collapse";
|
|
360
360
|
}
|
|
361
361
|
getFocusableElements() {
|
|
362
|
-
const
|
|
363
|
-
if (!
|
|
364
|
-
const
|
|
365
|
-
if (
|
|
366
|
-
if (
|
|
362
|
+
const e = this.showDetail ? this.renderRoot.querySelector(".detail-view") : this.renderRoot.querySelector(".panel");
|
|
363
|
+
if (!e) return [];
|
|
364
|
+
const t = (r) => this.isUnavailableElement(r) ? !1 : r.matches(a.focusablesSelector), o = [], i = /* @__PURE__ */ new Set(), n = (r) => {
|
|
365
|
+
if (i.has(r) || (i.add(r), r instanceof HTMLElement && r.closest("[hidden], [inert], [aria-hidden='true']"))) return;
|
|
366
|
+
if (t(r)) {
|
|
367
367
|
const f = this.resolveFocusable(r);
|
|
368
368
|
f && !this.isUnavailableElement(f) && o.push(f);
|
|
369
369
|
}
|
|
370
370
|
const l = r.tagName.toLowerCase();
|
|
371
371
|
if (l === "o-icon-button" || l === "o-button") return;
|
|
372
372
|
if (r instanceof HTMLSlotElement) {
|
|
373
|
-
r.assignedElements({ flatten: !0 }).forEach(
|
|
373
|
+
r.assignedElements({ flatten: !0 }).forEach(n);
|
|
374
374
|
return;
|
|
375
375
|
}
|
|
376
376
|
const b = r.shadowRoot;
|
|
377
|
-
b && Array.from(b.children).forEach(
|
|
377
|
+
b && Array.from(b.children).forEach(n), Array.from(r.children).forEach(n);
|
|
378
378
|
};
|
|
379
|
-
return
|
|
379
|
+
return n(e), o;
|
|
380
380
|
}
|
|
381
381
|
openPanel() {
|
|
382
|
-
var
|
|
383
|
-
this.removeAttribute("hidden"), this.getBoundingClientRect(), this.previousFocusedElement = document.activeElement, this.previousFocusedSelector = (
|
|
384
|
-
const
|
|
385
|
-
|
|
386
|
-
var o,
|
|
382
|
+
var t;
|
|
383
|
+
this.removeAttribute("hidden"), this.getBoundingClientRect(), this.previousFocusedElement = document.activeElement, this.previousFocusedSelector = (t = this.previousFocusedElement) == null ? void 0 : t.getAttribute("paneltarget"), this.open = !0, document.body.style.overflow = "hidden", document.body.setAttribute("data-side-panel", "open");
|
|
384
|
+
const e = this.renderRoot.querySelector(".panel");
|
|
385
|
+
e && e.setAttribute("aria-modal", "true"), this.updateComplete.then(async () => {
|
|
386
|
+
var o, i;
|
|
387
387
|
if (this.showHeader) {
|
|
388
|
-
const
|
|
389
|
-
|
|
390
|
-
const r = this.resolveFocusable(
|
|
391
|
-
(
|
|
388
|
+
const n = (o = this.shadowRoot) == null ? void 0 : o.querySelector(".panel .close-btn");
|
|
389
|
+
n != null && n.updateComplete && await n.updateComplete;
|
|
390
|
+
const r = this.resolveFocusable(n);
|
|
391
|
+
(i = r == null ? void 0 : r.focus) == null || i.call(r, { preventScroll: !0 });
|
|
392
392
|
} else
|
|
393
393
|
this.focusFirstInPanel();
|
|
394
394
|
}), this.dispatchEvent(
|
|
395
395
|
new CustomEvent("open", { bubbles: !0, composed: !0 })
|
|
396
396
|
);
|
|
397
397
|
}
|
|
398
|
-
closePanel() {
|
|
399
|
-
var
|
|
398
|
+
closePanel(e) {
|
|
399
|
+
var i, n, r;
|
|
400
400
|
this.open = !1, this.showDetail = !1, document.body.style.overflow = "", document.body.removeAttribute("data-side-panel");
|
|
401
401
|
let t = this.previousFocusedElement;
|
|
402
|
-
t != null && t.isConnected || (t = document.querySelector(`[paneltarget="${this.previousFocusedSelector}"]`)), (t == null ? void 0 : t.tagName.toLowerCase()) === "o-button" ? (
|
|
403
|
-
const
|
|
404
|
-
|
|
405
|
-
new CustomEvent("close", { bubbles: !0, composed: !0 })
|
|
402
|
+
t != null && t.isConnected || (t = document.querySelector(`[paneltarget="${this.previousFocusedSelector}"]`)), (t == null ? void 0 : t.tagName.toLowerCase()) === "o-button" ? (r = (n = (i = t.shadowRoot) == null ? void 0 : i.querySelector(".button")) == null ? void 0 : n.focus) == null || r.call(n) : t == null || t.focus();
|
|
403
|
+
const o = this.renderRoot.querySelector(".panel");
|
|
404
|
+
o && o.removeAttribute("aria-modal"), this.dispatchEvent(
|
|
405
|
+
new CustomEvent("close", { bubbles: !0, composed: !0, detail: { event: e } })
|
|
406
406
|
);
|
|
407
407
|
}
|
|
408
|
-
handleFirstClick(
|
|
409
|
-
|
|
408
|
+
handleFirstClick(e) {
|
|
409
|
+
e instanceof KeyboardEvent && e.key !== "Enter" && e.key !== " " || (e.preventDefault(), e.stopPropagation(), this.onFirstButtonClickClose && this.closePanel(e), this.dispatchEvent(
|
|
410
410
|
new CustomEvent("firstbuttonclick", {
|
|
411
411
|
bubbles: !0,
|
|
412
412
|
composed: !0,
|
|
413
413
|
cancelable: !0,
|
|
414
414
|
detail: {
|
|
415
415
|
button: "first",
|
|
416
|
-
target:
|
|
416
|
+
target: e.target
|
|
417
417
|
}
|
|
418
418
|
})
|
|
419
419
|
));
|
|
420
420
|
}
|
|
421
|
-
handleSecondClick(
|
|
422
|
-
|
|
421
|
+
handleSecondClick(e) {
|
|
422
|
+
e instanceof KeyboardEvent && e.key !== "Enter" && e.key !== " " || (e.preventDefault(), e.stopPropagation(), this.onSecondButtonClickClose && this.closePanel(e), this.dispatchEvent(
|
|
423
423
|
new CustomEvent("secondbuttonclick", {
|
|
424
424
|
bubbles: !0,
|
|
425
425
|
composed: !0,
|
|
426
426
|
cancelable: !0,
|
|
427
427
|
detail: {
|
|
428
428
|
button: "second",
|
|
429
|
-
target:
|
|
429
|
+
target: e.target
|
|
430
430
|
}
|
|
431
431
|
})
|
|
432
432
|
));
|
|
@@ -437,7 +437,7 @@ let a = class extends S(w) {
|
|
|
437
437
|
}, 500);
|
|
438
438
|
}
|
|
439
439
|
render() {
|
|
440
|
-
const
|
|
440
|
+
const e = this.showHeader ? h`
|
|
441
441
|
<div tabindex="-1" part="header" class="header ${this.showDetail ? "detail-view-header" : ""}">
|
|
442
442
|
${this.showHeaderStartIcon ? h`
|
|
443
443
|
<o-icon-button
|
|
@@ -470,7 +470,7 @@ let a = class extends S(w) {
|
|
|
470
470
|
aria-describedby="panel-title"
|
|
471
471
|
></o-icon-button>
|
|
472
472
|
</div>
|
|
473
|
-
` : null,
|
|
473
|
+
` : null, t = this.showFooter ? h`
|
|
474
474
|
<div class="footer" part="footer">
|
|
475
475
|
${this.firstButtonVariant && this.firstButtonLabel ? h`
|
|
476
476
|
<o-button
|
|
@@ -505,13 +505,13 @@ let a = class extends S(w) {
|
|
|
505
505
|
tabindex="-1"
|
|
506
506
|
>
|
|
507
507
|
<div role="document">
|
|
508
|
-
${
|
|
508
|
+
${e}
|
|
509
509
|
|
|
510
510
|
<div part="content" class="content ${this.isHidingDetail ? "slide-out-right" : ""} ${this.showDetail ? "with-detail" : ""}">
|
|
511
511
|
|
|
512
512
|
${this.showDetail ? h`
|
|
513
513
|
<div class="detail-view">
|
|
514
|
-
${
|
|
514
|
+
${e}
|
|
515
515
|
<div class="detail-content">
|
|
516
516
|
<div class="detail-scroller">
|
|
517
517
|
<slot name="detail"></slot>
|
|
@@ -521,9 +521,9 @@ let a = class extends S(w) {
|
|
|
521
521
|
` : h`<slot></slot>`}
|
|
522
522
|
</div>
|
|
523
523
|
|
|
524
|
-
${this.stickyFooter ? null :
|
|
524
|
+
${this.stickyFooter ? null : t}
|
|
525
525
|
</div>
|
|
526
|
-
${this.stickyFooter ?
|
|
526
|
+
${this.stickyFooter ? t : null}
|
|
527
527
|
</div>
|
|
528
528
|
`;
|
|
529
529
|
}
|
|
@@ -856,10 +856,10 @@ c([
|
|
|
856
856
|
a = c([
|
|
857
857
|
E("o-side-panel")
|
|
858
858
|
], a);
|
|
859
|
-
var G = Object.defineProperty, Q = Object.getOwnPropertyDescriptor, u = (
|
|
860
|
-
for (var
|
|
861
|
-
(l =
|
|
862
|
-
return
|
|
859
|
+
var G = Object.defineProperty, Q = Object.getOwnPropertyDescriptor, u = (e, t, o, i) => {
|
|
860
|
+
for (var n = i > 1 ? void 0 : i ? Q(t, o) : t, r = e.length - 1, l; r >= 0; r--)
|
|
861
|
+
(l = e[r]) && (n = (i ? l(t, o, n) : l(n)) || n);
|
|
862
|
+
return i && n && G(t, o, n), n;
|
|
863
863
|
};
|
|
864
864
|
const J = S(A(w)), lt = ["primary", "secondary", "ghost", "tertiary", "link"];
|
|
865
865
|
let d = class extends J {
|
|
@@ -869,46 +869,46 @@ let d = class extends J {
|
|
|
869
869
|
get name() {
|
|
870
870
|
return this.getAttribute("name") ?? "";
|
|
871
871
|
}
|
|
872
|
-
set name(
|
|
873
|
-
this.setAttribute("name",
|
|
872
|
+
set name(e) {
|
|
873
|
+
this.setAttribute("name", e);
|
|
874
874
|
}
|
|
875
875
|
get form() {
|
|
876
876
|
return this[B].form;
|
|
877
877
|
}
|
|
878
|
-
handleClick(
|
|
879
|
-
if (!(
|
|
880
|
-
const
|
|
881
|
-
|
|
878
|
+
handleClick(e) {
|
|
879
|
+
if (!(e instanceof KeyboardEvent && !["Enter", " "].includes(e.key)) && this.panelTarget) {
|
|
880
|
+
const t = document.getElementById(this.panelTarget);
|
|
881
|
+
t instanceof a && (t != null && t.openPanel) && typeof t.openPanel == "function" ? (e.preventDefault(), t.openPanel()) : console.warn(`[o-button] No side panel with id="${this.panelTarget}" found or it does not have an openPanel method.`);
|
|
882
882
|
}
|
|
883
883
|
}
|
|
884
884
|
render() {
|
|
885
885
|
return this.href ? this.renderLink() : this.renderButton();
|
|
886
886
|
}
|
|
887
887
|
connectedCallback() {
|
|
888
|
-
var o,
|
|
888
|
+
var o, i;
|
|
889
889
|
super.connectedCallback();
|
|
890
|
-
const
|
|
891
|
-
(
|
|
890
|
+
const e = (o = this.startIconModel) == null ? void 0 : o.startsWith("occ-"), t = (i = this.endIconModel) == null ? void 0 : i.startsWith("occ-");
|
|
891
|
+
(e || t) && (e && $(this.startIconModel), t && $(this.endIconModel), this._unsubOcc = _(() => this.requestUpdate()));
|
|
892
892
|
}
|
|
893
893
|
disconnectedCallback() {
|
|
894
|
-
var
|
|
895
|
-
(
|
|
894
|
+
var e;
|
|
895
|
+
(e = this._unsubOcc) == null || e.call(this), super.disconnectedCallback();
|
|
896
896
|
}
|
|
897
|
-
renderIcon(
|
|
898
|
-
const
|
|
899
|
-
if (!
|
|
900
|
-
const o = I[
|
|
897
|
+
renderIcon(e) {
|
|
898
|
+
const t = e === "start" ? this.startIconModel : this.endIconModel;
|
|
899
|
+
if (!t) return p;
|
|
900
|
+
const o = I[t] ?? "";
|
|
901
901
|
if (!o) return p;
|
|
902
|
-
const
|
|
903
|
-
return h`<span class="${
|
|
902
|
+
const i = F(o);
|
|
903
|
+
return h`<span class="${e === "start" ? "icon-start" : "icon-end"}">${z(i)}</span>`;
|
|
904
904
|
}
|
|
905
905
|
renderButton() {
|
|
906
|
-
const
|
|
906
|
+
const e = this.text || this.textsecond;
|
|
907
907
|
return h`
|
|
908
908
|
<button type=${this.type} class="button" ?disabled=${this.disabled} @click=${this.handleClick} @keydown=${this.handleClick}
|
|
909
909
|
aria-describedby=${this.describedBy || p} aria-expanded=${this.ariaExpanded || p} >
|
|
910
910
|
${this.startIcon ? this.renderIcon("start") : p}
|
|
911
|
-
${
|
|
911
|
+
${e ? h`
|
|
912
912
|
${this.text ? h`<span class="text">${this.text}</span>` : p}
|
|
913
913
|
${this.textsecond ? h`<span class="text">${this.textsecond}</span>` : p}
|
|
914
914
|
${this.withbadge ? h`<slot></slot>` : p}
|
|
@@ -918,7 +918,7 @@ let d = class extends J {
|
|
|
918
918
|
`;
|
|
919
919
|
}
|
|
920
920
|
renderLink() {
|
|
921
|
-
const
|
|
921
|
+
const e = this.text || this.textsecond;
|
|
922
922
|
return h`
|
|
923
923
|
<a
|
|
924
924
|
href=${this.href}
|
|
@@ -931,7 +931,7 @@ let d = class extends J {
|
|
|
931
931
|
aria-describedby=${this.describedBy || p}
|
|
932
932
|
>
|
|
933
933
|
${this.startIcon ? this.renderIcon("start") : p}
|
|
934
|
-
${
|
|
934
|
+
${e ? h`
|
|
935
935
|
${this.text ? h`<span>${this.text}</span>` : p}
|
|
936
936
|
${this.textsecond ? h`<span>${this.textsecond}</span>` : p}
|
|
937
937
|
` : h`<slot></slot>`}
|
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.1.
|
|
7
|
+
globalThis.__FLORID_KIT__ = "3.1.13";
|
|
8
8
|
const i = {
|
|
9
9
|
"o-accordion": () => import("./components/accordion.mjs"),
|
|
10
10
|
"o-accordion-group": () => import("./components/accordion-group.mjs"),
|