@florid-kit/components 3.1.8 → 3.1.9
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.mjs +152 -150
- package/index.mjs +1 -1
- package/loader.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { E as p, i as
|
|
1
|
+
import { E as p, i as C, a as w, m as S, x as h, t as E } from "../performance-mixin-D7YmSeqN.mjs";
|
|
2
2
|
import { n as s } from "../property-S_Y9cb04.mjs";
|
|
3
|
-
import { f as
|
|
4
|
-
import { i as
|
|
5
|
-
import { e as
|
|
6
|
-
import { g as
|
|
7
|
-
import { o as
|
|
3
|
+
import { f as g } from "../css-C8WrrxT-.mjs";
|
|
4
|
+
import { i as B, m as A } from "../element-internals-Dw7LndlH.mjs";
|
|
5
|
+
import { e as $, o as _, a as I } from "../icons-registry.mjs";
|
|
6
|
+
import { g as F } from "../svg-utils-DOL__czZ.mjs";
|
|
7
|
+
import { o as z } from "../unsafe-svg-BipL_msF.mjs";
|
|
8
8
|
import "./icon-button.mjs";
|
|
9
|
-
import { i as
|
|
10
|
-
import { f as
|
|
9
|
+
import { i as L, t as O, e as R } from "../directive-oAbCiebi.mjs";
|
|
10
|
+
import { f as T } from "../directive-helpers-BHuwIghp.mjs";
|
|
11
11
|
/**
|
|
12
12
|
* @license
|
|
13
13
|
* Copyright 2023 Google LLC
|
|
14
14
|
* SPDX-License-Identifier: Apache-2.0
|
|
15
15
|
*/
|
|
16
|
-
function
|
|
16
|
+
function q(t) {
|
|
17
17
|
t.addInitializer((e) => {
|
|
18
18
|
const o = e;
|
|
19
|
-
o.addEventListener("click", async (
|
|
20
|
-
const { type:
|
|
21
|
-
if (!(!l ||
|
|
19
|
+
o.addEventListener("click", async (n) => {
|
|
20
|
+
const { type: i, [B]: r } = o, { form: l } = r;
|
|
21
|
+
if (!(!l || i === "button") && (await new Promise((b) => {
|
|
22
22
|
setTimeout(b);
|
|
23
|
-
}), !
|
|
24
|
-
if (
|
|
23
|
+
}), !n.defaultPrevented)) {
|
|
24
|
+
if (i === "reset") {
|
|
25
25
|
l.reset();
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
@@ -46,10 +46,10 @@ function T(t) {
|
|
|
46
46
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
47
|
*/
|
|
48
48
|
const v = (t, e) => {
|
|
49
|
-
var
|
|
49
|
+
var n;
|
|
50
50
|
const o = t._$AN;
|
|
51
51
|
if (o === void 0) return !1;
|
|
52
|
-
for (const
|
|
52
|
+
for (const i of o) (n = i._$AO) == null || n.call(i, e, !1), v(i, e);
|
|
53
53
|
return !0;
|
|
54
54
|
}, y = (t) => {
|
|
55
55
|
let e, o;
|
|
@@ -57,39 +57,39 @@ const v = (t, e) => {
|
|
|
57
57
|
if ((e = t._$AM) === void 0) break;
|
|
58
58
|
o = e._$AN, o.delete(t), t = e;
|
|
59
59
|
} while ((o == null ? void 0 : o.size) === 0);
|
|
60
|
-
},
|
|
60
|
+
}, D = (t) => {
|
|
61
61
|
for (let e; e = t._$AM; t = e) {
|
|
62
62
|
let o = e._$AN;
|
|
63
63
|
if (o === void 0) e._$AN = o = /* @__PURE__ */ new Set();
|
|
64
64
|
else if (o.has(t)) break;
|
|
65
|
-
o.add(t),
|
|
65
|
+
o.add(t), K(e);
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
|
-
function
|
|
69
|
-
this._$AN !== void 0 ? (y(this), this._$AM = t,
|
|
68
|
+
function H(t) {
|
|
69
|
+
this._$AN !== void 0 ? (y(this), this._$AM = t, D(this)) : this._$AM = t;
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
const
|
|
73
|
-
if (
|
|
74
|
-
else
|
|
71
|
+
function M(t, e = !1, o = 0) {
|
|
72
|
+
const n = this._$AH, i = this._$AN;
|
|
73
|
+
if (i !== void 0 && i.size !== 0) if (e) if (Array.isArray(n)) for (let r = o; r < n.length; r++) v(n[r], !1), y(n[r]);
|
|
74
|
+
else n != null && (v(n, !1), y(n));
|
|
75
75
|
else v(this, t);
|
|
76
76
|
}
|
|
77
|
-
const
|
|
78
|
-
t.type ==
|
|
77
|
+
const K = (t) => {
|
|
78
|
+
t.type == O.CHILD && (t._$AP ?? (t._$AP = M), t._$AQ ?? (t._$AQ = H));
|
|
79
79
|
};
|
|
80
|
-
class
|
|
80
|
+
class j extends L {
|
|
81
81
|
constructor() {
|
|
82
82
|
super(...arguments), this._$AN = void 0;
|
|
83
83
|
}
|
|
84
|
-
_$AT(e, o,
|
|
85
|
-
super._$AT(e, o,
|
|
84
|
+
_$AT(e, o, n) {
|
|
85
|
+
super._$AT(e, o, n), D(this), this.isConnected = e._$AU;
|
|
86
86
|
}
|
|
87
87
|
_$AO(e, o = !0) {
|
|
88
|
-
var
|
|
89
|
-
e !== this.isConnected && (this.isConnected = e, e ? (
|
|
88
|
+
var n, i;
|
|
89
|
+
e !== this.isConnected && (this.isConnected = e, e ? (n = this.reconnected) == null || n.call(this) : (i = this.disconnected) == null || i.call(this)), o && (v(this, e), y(this));
|
|
90
90
|
}
|
|
91
91
|
setValue(e) {
|
|
92
|
-
if (
|
|
92
|
+
if (T(this._$Ct)) this._$Ct._$AI(e, this);
|
|
93
93
|
else {
|
|
94
94
|
const o = [...this._$Ct._$AH];
|
|
95
95
|
o[this._$Ci] = e, this._$Ct._$AI(o, this, 0);
|
|
@@ -100,7 +100,7 @@ class K extends z {
|
|
|
100
100
|
reconnected() {
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
class
|
|
103
|
+
class N extends j {
|
|
104
104
|
constructor() {
|
|
105
105
|
super(...arguments), this.prevData = {};
|
|
106
106
|
}
|
|
@@ -108,49 +108,49 @@ class j extends K {
|
|
|
108
108
|
return p;
|
|
109
109
|
}
|
|
110
110
|
update(e, [o]) {
|
|
111
|
-
var
|
|
112
|
-
this.element !== e.element && (this.element = e.element), this.host = ((
|
|
111
|
+
var n;
|
|
112
|
+
this.element !== e.element && (this.element = e.element), this.host = ((n = e.options) === null || n === void 0 ? void 0 : n.host) || this.element, this.apply(o), this.groom(o), this.prevData = { ...o };
|
|
113
113
|
}
|
|
114
114
|
apply(e) {
|
|
115
115
|
if (!e)
|
|
116
116
|
return;
|
|
117
|
-
const { prevData: o, element:
|
|
118
|
-
for (const
|
|
119
|
-
const r = e[
|
|
120
|
-
r !== o[
|
|
117
|
+
const { prevData: o, element: n } = this;
|
|
118
|
+
for (const i in e) {
|
|
119
|
+
const r = e[i];
|
|
120
|
+
r !== o[i] && (n[i] = r);
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
groom(e) {
|
|
124
|
-
const { prevData: o, element:
|
|
124
|
+
const { prevData: o, element: n } = this;
|
|
125
125
|
if (o)
|
|
126
|
-
for (const
|
|
127
|
-
(!e || !(
|
|
126
|
+
for (const i in o)
|
|
127
|
+
(!e || !(i in e) && n[i] === o[i]) && (n[i] = void 0);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
class
|
|
130
|
+
class V extends N {
|
|
131
131
|
constructor() {
|
|
132
132
|
super(...arguments), this.eventData = {};
|
|
133
133
|
}
|
|
134
134
|
apply(e) {
|
|
135
135
|
if (e)
|
|
136
136
|
for (const o in e) {
|
|
137
|
-
const
|
|
138
|
-
|
|
137
|
+
const n = e[o];
|
|
138
|
+
n !== this.eventData[o] && this.applyEvent(o, n);
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
applyEvent(e, o) {
|
|
142
|
-
const { prevData:
|
|
143
|
-
this.eventData[e] = o,
|
|
142
|
+
const { prevData: n, element: i } = this;
|
|
143
|
+
this.eventData[e] = o, n[e] && i.removeEventListener(e, this, o), i.addEventListener(e, this, o);
|
|
144
144
|
}
|
|
145
145
|
groom(e) {
|
|
146
|
-
const { prevData: o, element:
|
|
146
|
+
const { prevData: o, element: n } = this;
|
|
147
147
|
if (o)
|
|
148
|
-
for (const
|
|
149
|
-
(!e || !(
|
|
148
|
+
for (const i in o)
|
|
149
|
+
(!e || !(i in e) && n[i] === o[i]) && this.groomEvent(i, o[i]);
|
|
150
150
|
}
|
|
151
151
|
groomEvent(e, o) {
|
|
152
|
-
const { element:
|
|
153
|
-
delete this.eventData[e],
|
|
152
|
+
const { element: n } = this;
|
|
153
|
+
delete this.eventData[e], n.removeEventListener(e, this, o);
|
|
154
154
|
}
|
|
155
155
|
handleEvent(e) {
|
|
156
156
|
const o = this.eventData[e.type];
|
|
@@ -158,82 +158,82 @@ class N extends j {
|
|
|
158
158
|
}
|
|
159
159
|
disconnected() {
|
|
160
160
|
const { eventData: e, element: o } = this;
|
|
161
|
-
for (const
|
|
162
|
-
const
|
|
163
|
-
o.removeEventListener(
|
|
161
|
+
for (const n in e) {
|
|
162
|
+
const i = n.slice(1), r = e[n];
|
|
163
|
+
o.removeEventListener(i, this, r);
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
reconnected() {
|
|
167
167
|
const { eventData: e, element: o } = this;
|
|
168
|
-
for (const
|
|
169
|
-
const
|
|
170
|
-
o.addEventListener(
|
|
168
|
+
for (const n in e) {
|
|
169
|
+
const i = n.slice(1), r = e[n];
|
|
170
|
+
o.addEventListener(i, this, r);
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
|
-
class
|
|
174
|
+
class X extends V {
|
|
175
175
|
apply(e) {
|
|
176
176
|
if (!e)
|
|
177
177
|
return;
|
|
178
|
-
const { prevData: o, element:
|
|
179
|
-
for (const
|
|
180
|
-
const r = e[
|
|
181
|
-
if (r === o[
|
|
178
|
+
const { prevData: o, element: n } = this;
|
|
179
|
+
for (const i in e) {
|
|
180
|
+
const r = e[i];
|
|
181
|
+
if (r === o[i])
|
|
182
182
|
continue;
|
|
183
|
-
const l =
|
|
184
|
-
switch (
|
|
183
|
+
const l = i.slice(1);
|
|
184
|
+
switch (i[0]) {
|
|
185
185
|
case "@":
|
|
186
186
|
this.eventData[l] = r, this.applyEvent(l, r);
|
|
187
187
|
break;
|
|
188
188
|
case ".":
|
|
189
|
-
|
|
189
|
+
n[l] = r;
|
|
190
190
|
break;
|
|
191
191
|
case "?":
|
|
192
|
-
r ?
|
|
192
|
+
r ? n.setAttribute(l, "") : n.removeAttribute(l);
|
|
193
193
|
break;
|
|
194
194
|
default:
|
|
195
|
-
r != null ?
|
|
195
|
+
r != null ? n.setAttribute(i, String(r)) : n.removeAttribute(i);
|
|
196
196
|
break;
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
200
|
groom(e) {
|
|
201
|
-
const { prevData: o, element:
|
|
201
|
+
const { prevData: o, element: n } = this;
|
|
202
202
|
if (o)
|
|
203
|
-
for (const
|
|
204
|
-
const r =
|
|
205
|
-
if (!e || !(
|
|
206
|
-
switch (
|
|
203
|
+
for (const i in o) {
|
|
204
|
+
const r = i.slice(1);
|
|
205
|
+
if (!e || !(i in e) && n[r] === o[i])
|
|
206
|
+
switch (i[0]) {
|
|
207
207
|
case "@":
|
|
208
|
-
this.groomEvent(r, o[
|
|
208
|
+
this.groomEvent(r, o[i]);
|
|
209
209
|
break;
|
|
210
210
|
case ".":
|
|
211
|
-
|
|
211
|
+
n[r] = void 0;
|
|
212
212
|
break;
|
|
213
213
|
case "?":
|
|
214
|
-
|
|
214
|
+
n.removeAttribute(r);
|
|
215
215
|
break;
|
|
216
216
|
default:
|
|
217
|
-
|
|
217
|
+
n.removeAttribute(i);
|
|
218
218
|
break;
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
const
|
|
224
|
-
var
|
|
225
|
-
for (var
|
|
226
|
-
(l = t[r]) && (
|
|
227
|
-
return
|
|
223
|
+
const k = R(X);
|
|
224
|
+
var U = Object.defineProperty, W = Object.getOwnPropertyDescriptor, c = (t, e, o, n) => {
|
|
225
|
+
for (var i = n > 1 ? void 0 : n ? W(e, o) : e, r = t.length - 1, l; r >= 0; r--)
|
|
226
|
+
(l = t[r]) && (i = (n ? l(e, o, i) : l(i)) || i);
|
|
227
|
+
return n && i && U(e, o, i), i;
|
|
228
228
|
};
|
|
229
|
-
let a = class extends
|
|
229
|
+
let a = class extends S(w) {
|
|
230
230
|
constructor() {
|
|
231
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 (t) => {
|
|
232
|
-
var o,
|
|
232
|
+
var o, n;
|
|
233
233
|
const e = ((o = t.detail) == null ? void 0 : o.origin) ?? document.activeElement;
|
|
234
234
|
if (this._detailOriginEl = e, this._detailOriginClass = (e == null ? void 0 : e.className) ?? "", this.showDetail = !0, this.showHeaderStartIcon = !0, await this.updateComplete, this._detailOriginClass) {
|
|
235
|
-
const
|
|
236
|
-
|
|
235
|
+
const i = (n = this.shadowRoot) == null ? void 0 : n.querySelector(".detail-view");
|
|
236
|
+
i && i.setAttribute("fromelement", this._detailOriginClass);
|
|
237
237
|
}
|
|
238
238
|
await this.focusDetailReturnBtn();
|
|
239
239
|
}, this._detailOriginEl = null, this._detailOriginClass = "", this.handleKeyDown = (t) => {
|
|
@@ -245,15 +245,15 @@ let a = class extends C(g) {
|
|
|
245
245
|
const e = t.currentTarget, o = (e == null ? void 0 : e.getAttribute("data-role")) === "back";
|
|
246
246
|
if (this.showDetail && o) {
|
|
247
247
|
this.isHidingDetail = !0;
|
|
248
|
-
const
|
|
248
|
+
const n = this.renderRoot.querySelector(".content"), i = async () => {
|
|
249
249
|
this.showDetail = !1, this.isHidingDetail = !1, this.showHeaderStartIcon = !1, await this.updateComplete, this._restoreFocusToOrigin();
|
|
250
250
|
};
|
|
251
|
-
if (
|
|
251
|
+
if (n) {
|
|
252
252
|
this.showHeaderStartIcon = !1;
|
|
253
253
|
const r = () => {
|
|
254
|
-
this.showDetail = !1, this.isHidingDetail = !1,
|
|
254
|
+
this.showDetail = !1, this.isHidingDetail = !1, n.removeEventListener("animationend", r), i();
|
|
255
255
|
};
|
|
256
|
-
|
|
256
|
+
n.addEventListener("animationend", r);
|
|
257
257
|
} else
|
|
258
258
|
this.showDetail = !1, this.isHidingDetail = !1, this.showHeaderStartIcon = !1;
|
|
259
259
|
return;
|
|
@@ -262,8 +262,8 @@ let a = class extends C(g) {
|
|
|
262
262
|
};
|
|
263
263
|
}
|
|
264
264
|
focusFirstInPanel() {
|
|
265
|
-
var e, o,
|
|
266
|
-
(
|
|
265
|
+
var e, o, n;
|
|
266
|
+
(n = this.getFocusableElements().filter((i) => !!i && !i.hasAttribute("disabled"))[0] ?? ((e = this.shadowRoot) == null ? void 0 : e.querySelector(".close-btn")) ?? ((o = this.shadowRoot) == null ? void 0 : o.querySelector(".panel"))) == null || n.focus({ preventScroll: !0 });
|
|
267
267
|
}
|
|
268
268
|
resolveFocusable(t) {
|
|
269
269
|
var o;
|
|
@@ -281,7 +281,7 @@ let a = class extends C(g) {
|
|
|
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 i, r, l, b, f;
|
|
285
285
|
await this.updateComplete;
|
|
286
286
|
const t = this.getDeepActiveElement(document);
|
|
287
287
|
if (t && t !== document.body)
|
|
@@ -290,18 +290,18 @@ let a = class extends C(g) {
|
|
|
290
290
|
} catch {
|
|
291
291
|
}
|
|
292
292
|
await new Promise(requestAnimationFrame);
|
|
293
|
-
const e = (
|
|
293
|
+
const e = (i = this.shadowRoot) == null ? void 0 : i.querySelector(".detail-view .return-btn");
|
|
294
294
|
if (!e) return;
|
|
295
295
|
e.updateComplete && await e.updateComplete, (b = (l = ((r = e.shadowRoot) == null ? void 0 : r.querySelector("button")) ?? e) == null ? void 0 : l.focus) == null || b.call(l, { preventScroll: !0 });
|
|
296
|
-
const
|
|
297
|
-
|
|
296
|
+
const n = (f = this.shadowRoot) == null ? void 0 : f.querySelector('.panel[role="dialog"]');
|
|
297
|
+
n && n.setAttribute("aria-label", this.labelAriaDialogPanel || "panel-title");
|
|
298
298
|
}
|
|
299
299
|
_restoreFocusToOrigin() {
|
|
300
300
|
var e, o;
|
|
301
301
|
const t = this._detailOriginEl;
|
|
302
302
|
!t || !document.contains(t) || ((o = (e = document.activeElement) == null ? void 0 : e.blur) == null || o.call(e), requestAnimationFrame(() => {
|
|
303
|
-
var
|
|
304
|
-
t.classList.add("a--tabfocus"), (((
|
|
303
|
+
var i;
|
|
304
|
+
t.classList.add("a--tabfocus"), (((i = t.shadowRoot) == null ? void 0 : i.querySelector('button, .button, [tabindex]:not([tabindex="-1"])')) ?? null ?? t).focus({ preventScroll: !0 });
|
|
305
305
|
}));
|
|
306
306
|
}
|
|
307
307
|
getDeepActiveElement(t = this.shadowRoot) {
|
|
@@ -316,39 +316,41 @@ let a = class extends C(g) {
|
|
|
316
316
|
t.preventDefault(), t.stopPropagation(), (r = this.renderRoot.querySelector(".panel")) == null || r.focus({ preventScroll: !0 });
|
|
317
317
|
return;
|
|
318
318
|
}
|
|
319
|
-
const
|
|
320
|
-
!e || !o.includes(e) ? (t.preventDefault(), t.stopPropagation(), (t.shiftKey ?
|
|
319
|
+
const n = o[0], i = o[o.length - 1];
|
|
320
|
+
!e || !o.includes(e) ? (t.preventDefault(), t.stopPropagation(), (t.shiftKey ? i : n).focus({ preventScroll: !0 })) : !t.shiftKey && e === i ? (t.preventDefault(), t.stopPropagation(), n.focus({ preventScroll: !0 })) : t.shiftKey && e === n && (t.preventDefault(), t.stopPropagation(), i.focus({ preventScroll: !0 }));
|
|
321
321
|
}
|
|
322
322
|
trapFocus(t) {
|
|
323
323
|
if (t.key !== "Tab") return;
|
|
324
324
|
const e = this.shadowRoot;
|
|
325
325
|
if (!e) return;
|
|
326
|
-
const o =
|
|
326
|
+
const o = this.getFocusableElements();
|
|
327
|
+
t.target && t.target.closest("o-side-panel") && !o.includes(t.target) && o.splice(1, 0, t.target);
|
|
328
|
+
const n = t.composedPath()[0] ?? this.getDeepActiveElement(document);
|
|
327
329
|
if (this.showDetail) {
|
|
328
|
-
this.wrapFocus(t,
|
|
330
|
+
this.wrapFocus(t, n, o);
|
|
329
331
|
return;
|
|
330
332
|
}
|
|
331
333
|
if (document.querySelector("#refineandsortpopin")) {
|
|
332
|
-
const
|
|
333
|
-
t.preventDefault(), t.stopPropagation(),
|
|
334
|
+
const l = e.querySelector(".close-btn"), b = l ? this.resolveFocusable(l) : null, f = e.querySelector(".js-clear-refinements"), m = f ? this.resolveFocusable(f) : null, x = (P) => {
|
|
335
|
+
t.preventDefault(), t.stopPropagation(), P.focus();
|
|
334
336
|
};
|
|
335
|
-
if (
|
|
336
|
-
if (!t.shiftKey &&
|
|
337
|
-
if (t.shiftKey &&
|
|
337
|
+
if (b && m) {
|
|
338
|
+
if (!t.shiftKey && n === m) return x(b);
|
|
339
|
+
if (t.shiftKey && n === b) return x(m);
|
|
338
340
|
}
|
|
339
341
|
}
|
|
340
|
-
const
|
|
341
|
-
if (!t.shiftKey &&
|
|
342
|
+
const r = this.renderRoot.querySelector(".close-btn");
|
|
343
|
+
if (!t.shiftKey && r && r.contains(n)) {
|
|
342
344
|
t.preventDefault();
|
|
343
|
-
const
|
|
345
|
+
const l = this.renderRoot.querySelector(
|
|
344
346
|
".o-whats-inside--content p"
|
|
345
347
|
);
|
|
346
|
-
if (
|
|
347
|
-
|
|
348
|
+
if (l) {
|
|
349
|
+
l.focus();
|
|
348
350
|
return;
|
|
349
351
|
}
|
|
350
352
|
}
|
|
351
|
-
this.wrapFocus(t,
|
|
353
|
+
this.wrapFocus(t, n, o);
|
|
352
354
|
}
|
|
353
355
|
isUnavailableElement(t) {
|
|
354
356
|
if (!(t instanceof HTMLElement)) return !1;
|
|
@@ -359,8 +361,8 @@ let a = class extends C(g) {
|
|
|
359
361
|
getFocusableElements() {
|
|
360
362
|
const t = this.showDetail ? this.renderRoot.querySelector(".detail-view") : this.renderRoot.querySelector(".panel");
|
|
361
363
|
if (!t) return [];
|
|
362
|
-
const e = (r) => this.isUnavailableElement(r) ? !1 : r.matches(a.focusablesSelector), o = [],
|
|
363
|
-
if (
|
|
364
|
+
const e = (r) => this.isUnavailableElement(r) ? !1 : r.matches(a.focusablesSelector), o = [], n = /* @__PURE__ */ new Set(), i = (r) => {
|
|
365
|
+
if (n.has(r) || (n.add(r), r instanceof HTMLElement && r.closest("[hidden], [inert], [aria-hidden='true']"))) return;
|
|
364
366
|
if (e(r)) {
|
|
365
367
|
const f = this.resolveFocusable(r);
|
|
366
368
|
f && !this.isUnavailableElement(f) && o.push(f);
|
|
@@ -368,25 +370,25 @@ let a = class extends C(g) {
|
|
|
368
370
|
const l = r.tagName.toLowerCase();
|
|
369
371
|
if (l === "o-icon-button" || l === "o-button") return;
|
|
370
372
|
if (r instanceof HTMLSlotElement) {
|
|
371
|
-
r.assignedElements({ flatten: !0 }).forEach(
|
|
373
|
+
r.assignedElements({ flatten: !0 }).forEach(i);
|
|
372
374
|
return;
|
|
373
375
|
}
|
|
374
376
|
const b = r.shadowRoot;
|
|
375
|
-
b && Array.from(b.children).forEach(
|
|
377
|
+
b && Array.from(b.children).forEach(i), Array.from(r.children).forEach(i);
|
|
376
378
|
};
|
|
377
|
-
return
|
|
379
|
+
return i(t), o;
|
|
378
380
|
}
|
|
379
381
|
openPanel() {
|
|
380
382
|
var e;
|
|
381
383
|
this.removeAttribute("hidden"), this.getBoundingClientRect(), this.previousFocusedElement = document.activeElement, this.previousFocusedSelector = (e = this.previousFocusedElement) == null ? void 0 : e.getAttribute("paneltarget"), this.open = !0, document.body.style.overflow = "hidden", document.body.setAttribute("data-side-panel", "open");
|
|
382
384
|
const t = this.renderRoot.querySelector(".panel");
|
|
383
385
|
t && t.setAttribute("aria-modal", "true"), this.updateComplete.then(async () => {
|
|
384
|
-
var o,
|
|
386
|
+
var o, n;
|
|
385
387
|
if (this.showHeader) {
|
|
386
|
-
const
|
|
387
|
-
|
|
388
|
-
const r = this.resolveFocusable(
|
|
389
|
-
(
|
|
388
|
+
const i = (o = this.shadowRoot) == null ? void 0 : o.querySelector(".panel .close-btn");
|
|
389
|
+
i != null && i.updateComplete && await i.updateComplete;
|
|
390
|
+
const r = this.resolveFocusable(i);
|
|
391
|
+
(n = r == null ? void 0 : r.focus) == null || n.call(r, { preventScroll: !0 });
|
|
390
392
|
} else
|
|
391
393
|
this.focusFirstInPanel();
|
|
392
394
|
}), this.dispatchEvent(
|
|
@@ -394,10 +396,10 @@ let a = class extends C(g) {
|
|
|
394
396
|
);
|
|
395
397
|
}
|
|
396
398
|
closePanel() {
|
|
397
|
-
var o,
|
|
399
|
+
var o, n, i;
|
|
398
400
|
this.open = !1, this.showDetail = !1, document.body.style.overflow = "", document.body.removeAttribute("data-side-panel");
|
|
399
401
|
let t = this.previousFocusedElement;
|
|
400
|
-
t != null && t.isConnected || (t = document.querySelector(`[paneltarget="${this.previousFocusedSelector}"]`)), (t == null ? void 0 : t.tagName.toLowerCase()) === "o-button" ? (
|
|
402
|
+
t != null && t.isConnected || (t = document.querySelector(`[paneltarget="${this.previousFocusedSelector}"]`)), (t == null ? void 0 : t.tagName.toLowerCase()) === "o-button" ? (i = (n = (o = t.shadowRoot) == null ? void 0 : o.querySelector(".button")) == null ? void 0 : n.focus) == null || i.call(n) : t == null || t.focus();
|
|
401
403
|
const e = this.renderRoot.querySelector(".panel");
|
|
402
404
|
e && e.removeAttribute("aria-modal"), this.dispatchEvent(
|
|
403
405
|
new CustomEvent("close", { bubbles: !0, composed: !0 })
|
|
@@ -475,7 +477,7 @@ let a = class extends C(g) {
|
|
|
475
477
|
.variant=${this.firstButtonVariant}
|
|
476
478
|
@click=${this.handleFirstClick}
|
|
477
479
|
@keydown=${this.handleFirstClick}
|
|
478
|
-
${
|
|
480
|
+
${k(this.firstButtonProps)}
|
|
479
481
|
>
|
|
480
482
|
${this.firstButtonLabel}
|
|
481
483
|
</o-button>
|
|
@@ -485,7 +487,7 @@ let a = class extends C(g) {
|
|
|
485
487
|
.variant=${this.secondButtonVariant}
|
|
486
488
|
@click=${this.handleSecondClick}
|
|
487
489
|
@keydown=${this.handleSecondClick}
|
|
488
|
-
${
|
|
490
|
+
${k(this.secondButtonProps)}
|
|
489
491
|
>
|
|
490
492
|
${this.secondButtonLabel}
|
|
491
493
|
</o-button>
|
|
@@ -526,7 +528,7 @@ let a = class extends C(g) {
|
|
|
526
528
|
`;
|
|
527
529
|
}
|
|
528
530
|
};
|
|
529
|
-
a.styles =
|
|
531
|
+
a.styles = C`
|
|
530
532
|
:host {
|
|
531
533
|
--z-overlay: 99;
|
|
532
534
|
--z-panel: 100;
|
|
@@ -668,7 +670,7 @@ a.styles = k`
|
|
|
668
670
|
|
|
669
671
|
.panel:focus-visible,
|
|
670
672
|
.close-btn:focus-visible {
|
|
671
|
-
${
|
|
673
|
+
${g}
|
|
672
674
|
}
|
|
673
675
|
|
|
674
676
|
[role="document"] {
|
|
@@ -772,7 +774,7 @@ a.styles = k`
|
|
|
772
774
|
a.focusablesSelector = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"]), o-icon-button, o-button';
|
|
773
775
|
a.focusablesCustomElementsSelector = "o-icon-button, o-button";
|
|
774
776
|
a.shadowRootOptions = {
|
|
775
|
-
...
|
|
777
|
+
...w.shadowRootOptions,
|
|
776
778
|
// This helps send focus into the first focusable in shadow when host is focused
|
|
777
779
|
delegatesFocus: !0
|
|
778
780
|
};
|
|
@@ -852,15 +854,15 @@ c([
|
|
|
852
854
|
s({ type: Boolean })
|
|
853
855
|
], a.prototype, "isHidingDetail", 2);
|
|
854
856
|
a = c([
|
|
855
|
-
|
|
857
|
+
E("o-side-panel")
|
|
856
858
|
], a);
|
|
857
|
-
var
|
|
858
|
-
for (var
|
|
859
|
-
(l = t[r]) && (
|
|
860
|
-
return
|
|
859
|
+
var G = Object.defineProperty, Q = Object.getOwnPropertyDescriptor, u = (t, e, o, n) => {
|
|
860
|
+
for (var i = n > 1 ? void 0 : n ? Q(e, o) : e, r = t.length - 1, l; r >= 0; r--)
|
|
861
|
+
(l = t[r]) && (i = (n ? l(e, o, i) : l(i)) || i);
|
|
862
|
+
return n && i && G(e, o, i), i;
|
|
861
863
|
};
|
|
862
|
-
const
|
|
863
|
-
let d = class extends
|
|
864
|
+
const J = S(A(w)), lt = ["primary", "secondary", "ghost", "tertiary", "link"];
|
|
865
|
+
let d = class extends J {
|
|
864
866
|
constructor() {
|
|
865
867
|
super(...arguments), this.type = "submit", this.value = "", this.variant = "primary", this.text = "", this.textsecond = "", this.fullwidth = !1, this.disabled = !1, this.startIconModel = "", this.endIconModel = "", this.startIcon = !1, this.endIcon = !1, this.panelTarget = "", this.href = "", this.target = "", this.underlined = !1, this.withbadge = !1, this.hideRoleButton = !1, this.describedBy = null, this.ariaExpanded = null;
|
|
866
868
|
}
|
|
@@ -871,7 +873,7 @@ let d = class extends Q {
|
|
|
871
873
|
this.setAttribute("name", t);
|
|
872
874
|
}
|
|
873
875
|
get form() {
|
|
874
|
-
return this[
|
|
876
|
+
return this[B].form;
|
|
875
877
|
}
|
|
876
878
|
handleClick(t) {
|
|
877
879
|
if (!(t instanceof KeyboardEvent && !["Enter", " "].includes(t.key)) && this.panelTarget) {
|
|
@@ -883,10 +885,10 @@ let d = class extends Q {
|
|
|
883
885
|
return this.href ? this.renderLink() : this.renderButton();
|
|
884
886
|
}
|
|
885
887
|
connectedCallback() {
|
|
886
|
-
var o,
|
|
888
|
+
var o, n;
|
|
887
889
|
super.connectedCallback();
|
|
888
|
-
const t = (o = this.startIconModel) == null ? void 0 : o.startsWith("occ-"), e = (
|
|
889
|
-
(t || e) && (t &&
|
|
890
|
+
const t = (o = this.startIconModel) == null ? void 0 : o.startsWith("occ-"), e = (n = this.endIconModel) == null ? void 0 : n.startsWith("occ-");
|
|
891
|
+
(t || e) && (t && $(this.startIconModel), e && $(this.endIconModel), this._unsubOcc = _(() => this.requestUpdate()));
|
|
890
892
|
}
|
|
891
893
|
disconnectedCallback() {
|
|
892
894
|
var t;
|
|
@@ -895,10 +897,10 @@ let d = class extends Q {
|
|
|
895
897
|
renderIcon(t) {
|
|
896
898
|
const e = t === "start" ? this.startIconModel : this.endIconModel;
|
|
897
899
|
if (!e) return p;
|
|
898
|
-
const o =
|
|
900
|
+
const o = I[e] ?? "";
|
|
899
901
|
if (!o) return p;
|
|
900
|
-
const
|
|
901
|
-
return h`<span class="${t === "start" ? "icon-start" : "icon-end"}">${
|
|
902
|
+
const n = F(o);
|
|
903
|
+
return h`<span class="${t === "start" ? "icon-start" : "icon-end"}">${z(n)}</span>`;
|
|
902
904
|
}
|
|
903
905
|
renderButton() {
|
|
904
906
|
const t = this.text || this.textsecond;
|
|
@@ -938,9 +940,9 @@ let d = class extends Q {
|
|
|
938
940
|
`;
|
|
939
941
|
}
|
|
940
942
|
};
|
|
941
|
-
|
|
943
|
+
q(d);
|
|
942
944
|
d.formAssociated = !0;
|
|
943
|
-
d.styles =
|
|
945
|
+
d.styles = C`
|
|
944
946
|
:host {
|
|
945
947
|
--button-border: transparent;
|
|
946
948
|
--badge-outer-width: 19px;
|
|
@@ -953,7 +955,7 @@ d.styles = k`
|
|
|
953
955
|
}
|
|
954
956
|
|
|
955
957
|
:host(.a--tabfocus) .button {
|
|
956
|
-
${
|
|
958
|
+
${g};
|
|
957
959
|
}
|
|
958
960
|
|
|
959
961
|
:host([fullwidth]) {
|
|
@@ -1104,7 +1106,7 @@ d.styles = k`
|
|
|
1104
1106
|
}
|
|
1105
1107
|
|
|
1106
1108
|
.button:focus-visible {
|
|
1107
|
-
${
|
|
1109
|
+
${g};
|
|
1108
1110
|
}
|
|
1109
1111
|
|
|
1110
1112
|
span.text + span.text::before {
|
|
@@ -1253,10 +1255,10 @@ u([
|
|
|
1253
1255
|
s({ reflect: !0, attribute: "expanded" })
|
|
1254
1256
|
], d.prototype, "ariaExpanded", 2);
|
|
1255
1257
|
d = u([
|
|
1256
|
-
|
|
1258
|
+
E("o-button")
|
|
1257
1259
|
], d);
|
|
1258
1260
|
export {
|
|
1259
1261
|
d as O,
|
|
1260
1262
|
a as OccitaneSidePanel,
|
|
1261
|
-
|
|
1263
|
+
lt as v
|
|
1262
1264
|
};
|
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.9";
|
|
8
8
|
const i = {
|
|
9
9
|
"o-accordion": () => import("./components/accordion.mjs"),
|
|
10
10
|
"o-accordion-group": () => import("./components/accordion-group.mjs"),
|