@florid-kit/components 3.2.1 → 3.2.3
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/aria.d.ts +1 -1
- package/components/button.d.ts +0 -1
- package/components/icon-button.mjs +1 -1
- package/components/minitile.mjs +4 -4
- package/components/side-panel.d.ts +10 -1
- package/components/side-panel.mjs +279 -264
- package/components/wishlist-button.mjs +2 -2
- package/index.mjs +1 -1
- package/loader.mjs +1 -1
- package/package.json +1 -1
package/aria.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export type ARIAAttribute = ARIAPropertyToAttribute<ARIAProperty>;
|
|
|
15
15
|
/**
|
|
16
16
|
* Accessibility Object Model aria attributes.
|
|
17
17
|
*/
|
|
18
|
-
export declare const ARIA_ATTRIBUTES: ("aria-label" | "aria-modal" | "aria-
|
|
18
|
+
export declare const ARIA_ATTRIBUTES: ("aria-label" | "aria-modal" | "aria-hidden" | "aria-expanded" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-current" | "aria-description" | "aria-disabled" | "aria-haspopup" | "aria-invalid" | "aria-keyshortcuts" | "aria-level" | "aria-live" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext")[];
|
|
19
19
|
/**
|
|
20
20
|
* Checks if an attribute is one of the AOM aria attributes.
|
|
21
21
|
*
|
package/components/button.d.ts
CHANGED
|
@@ -26,7 +26,6 @@ export declare class OccitaneButton extends buttonBaseClass implements FormSubmi
|
|
|
26
26
|
target: "_blank" | "_self" | "_top" | "_parent" | "";
|
|
27
27
|
underlined: boolean;
|
|
28
28
|
withbadge: boolean;
|
|
29
|
-
hideRoleButton: boolean;
|
|
30
29
|
describedBy: string | null;
|
|
31
30
|
ariaExpanded: string | null;
|
|
32
31
|
private handleClick;
|
package/components/minitile.mjs
CHANGED
|
@@ -18,10 +18,10 @@ const c = class c extends d(f) {
|
|
|
18
18
|
new CustomEvent("tile-click", { bubbles: !0, composed: !0 })
|
|
19
19
|
));
|
|
20
20
|
}
|
|
21
|
-
onClickIcons() {
|
|
22
|
-
var
|
|
23
|
-
(
|
|
24
|
-
new CustomEvent("tile-icon-click", { bubbles: !0, composed: !0 })
|
|
21
|
+
onClickIcons(r) {
|
|
22
|
+
var s;
|
|
23
|
+
(s = this.onClickIcon) == null || s.call(this), this.dispatchEvent(
|
|
24
|
+
new CustomEvent("tile-icon-click", { bubbles: !0, composed: !0, detail: { event: r } })
|
|
25
25
|
);
|
|
26
26
|
}
|
|
27
27
|
get icons() {
|
|
@@ -46,6 +46,10 @@ export declare class OccitaneSidePanel extends OccitaneSidePanel_base {
|
|
|
46
46
|
mode: ShadowRootMode;
|
|
47
47
|
slotAssignment?: SlotAssignmentMode | undefined;
|
|
48
48
|
};
|
|
49
|
+
/**
|
|
50
|
+
* Focus the first focusable and interactive element and return it.
|
|
51
|
+
* @returns {HTMLElement?}
|
|
52
|
+
*/
|
|
49
53
|
private focusFirstInPanel;
|
|
50
54
|
private resolveFocusable;
|
|
51
55
|
connectedCallback(): void;
|
|
@@ -61,7 +65,12 @@ export declare class OccitaneSidePanel extends OccitaneSidePanel_base {
|
|
|
61
65
|
private trapFocus;
|
|
62
66
|
private isUnavailableElement;
|
|
63
67
|
private getFocusableElements;
|
|
64
|
-
|
|
68
|
+
/**
|
|
69
|
+
* Open the panel.
|
|
70
|
+
* @param {Boolean} withVisibleFocus whether to have the visible tabfocus or not. Defaults to FALSE.
|
|
71
|
+
* @param {HTMLElement|String|null} elementToFocus the element inside the sidepanel to focus. Otherwise, default focus behavior.
|
|
72
|
+
*/
|
|
73
|
+
openPanel(withVisibleFocus?: boolean, elementToFocus?: HTMLElement | String | null): void;
|
|
65
74
|
closePanel(e?: Event): void;
|
|
66
75
|
private handleClosePanel;
|
|
67
76
|
private handleFirstClick;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { E as
|
|
2
|
-
import { n as
|
|
1
|
+
import { E as b, i as C, a as w, m as E, x as u, t as S } from "../performance-mixin-D7YmSeqN.mjs";
|
|
2
|
+
import { n as a } from "../property-S_Y9cb04.mjs";
|
|
3
3
|
import { f as g } from "../css-C8WrrxT-.mjs";
|
|
4
4
|
import { i as B, m as A } from "../element-internals-Dw7LndlH.mjs";
|
|
5
5
|
import { e as $, o as _, a as I } from "../icons-registry.mjs";
|
|
6
|
-
import { g as
|
|
7
|
-
import { o as
|
|
6
|
+
import { g as z } from "../svg-utils-DOL__czZ.mjs";
|
|
7
|
+
import { o as F } from "../unsafe-svg-BipL_msF.mjs";
|
|
8
8
|
import "./icon-button.mjs";
|
|
9
9
|
import { i as L, t as O, e as R } from "../directive-oAbCiebi.mjs";
|
|
10
10
|
import { f as T } from "../directive-helpers-BHuwIghp.mjs";
|
|
@@ -16,26 +16,26 @@ import { f as T } from "../directive-helpers-BHuwIghp.mjs";
|
|
|
16
16
|
function q(e) {
|
|
17
17
|
e.addInitializer((t) => {
|
|
18
18
|
const o = t;
|
|
19
|
-
o.addEventListener("click", async (
|
|
20
|
-
const { type:
|
|
21
|
-
if (!(!
|
|
22
|
-
setTimeout(
|
|
23
|
-
}), !
|
|
24
|
-
if (
|
|
25
|
-
|
|
19
|
+
o.addEventListener("click", async (n) => {
|
|
20
|
+
const { type: i, [B]: r } = o, { form: s } = r;
|
|
21
|
+
if (!(!s || i === "button") && (await new Promise((h) => {
|
|
22
|
+
setTimeout(h);
|
|
23
|
+
}), !n.defaultPrevented)) {
|
|
24
|
+
if (i === "reset") {
|
|
25
|
+
s.reset();
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
|
-
|
|
28
|
+
s.addEventListener(
|
|
29
29
|
"submit",
|
|
30
|
-
(
|
|
31
|
-
Object.defineProperty(
|
|
30
|
+
(h) => {
|
|
31
|
+
Object.defineProperty(h, "submitter", {
|
|
32
32
|
configurable: !0,
|
|
33
33
|
enumerable: !0,
|
|
34
34
|
get: () => o
|
|
35
35
|
});
|
|
36
36
|
},
|
|
37
37
|
{ capture: !0, once: !0 }
|
|
38
|
-
), r.setFormValue(o.value),
|
|
38
|
+
), r.setFormValue(o.value), s.requestSubmit();
|
|
39
39
|
}
|
|
40
40
|
});
|
|
41
41
|
});
|
|
@@ -46,10 +46,10 @@ function q(e) {
|
|
|
46
46
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
47
|
*/
|
|
48
48
|
const v = (e, t) => {
|
|
49
|
-
var
|
|
49
|
+
var n;
|
|
50
50
|
const o = e._$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, t, !1), v(i, t);
|
|
53
53
|
return !0;
|
|
54
54
|
}, y = (e) => {
|
|
55
55
|
let t, o;
|
|
@@ -69,9 +69,9 @@ function H(e) {
|
|
|
69
69
|
this._$AN !== void 0 ? (y(this), this._$AM = e, D(this)) : this._$AM = e;
|
|
70
70
|
}
|
|
71
71
|
function M(e, t = !1, o = 0) {
|
|
72
|
-
const
|
|
73
|
-
if (
|
|
74
|
-
else
|
|
72
|
+
const n = this._$AH, i = this._$AN;
|
|
73
|
+
if (i !== void 0 && i.size !== 0) if (t) 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, e);
|
|
76
76
|
}
|
|
77
77
|
const K = (e) => {
|
|
@@ -81,12 +81,12 @@ class j extends L {
|
|
|
81
81
|
constructor() {
|
|
82
82
|
super(...arguments), this._$AN = void 0;
|
|
83
83
|
}
|
|
84
|
-
_$AT(t, o,
|
|
85
|
-
super._$AT(t, o,
|
|
84
|
+
_$AT(t, o, n) {
|
|
85
|
+
super._$AT(t, o, n), D(this), this.isConnected = t._$AU;
|
|
86
86
|
}
|
|
87
87
|
_$AO(t, o = !0) {
|
|
88
|
-
var
|
|
89
|
-
t !== this.isConnected && (this.isConnected = t, t ? (
|
|
88
|
+
var n, i;
|
|
89
|
+
t !== this.isConnected && (this.isConnected = t, t ? (n = this.reconnected) == null || n.call(this) : (i = this.disconnected) == null || i.call(this)), o && (v(this, t), y(this));
|
|
90
90
|
}
|
|
91
91
|
setValue(t) {
|
|
92
92
|
if (T(this._$Ct)) this._$Ct._$AI(t, this);
|
|
@@ -105,26 +105,26 @@ class N extends j {
|
|
|
105
105
|
super(...arguments), this.prevData = {};
|
|
106
106
|
}
|
|
107
107
|
render(t) {
|
|
108
|
-
return
|
|
108
|
+
return b;
|
|
109
109
|
}
|
|
110
110
|
update(t, [o]) {
|
|
111
|
-
var
|
|
112
|
-
this.element !== t.element && (this.element = t.element), this.host = ((
|
|
111
|
+
var n;
|
|
112
|
+
this.element !== t.element && (this.element = t.element), this.host = ((n = t.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(t) {
|
|
115
115
|
if (!t)
|
|
116
116
|
return;
|
|
117
|
-
const { prevData: o, element:
|
|
118
|
-
for (const
|
|
119
|
-
const r = t[
|
|
120
|
-
r !== o[
|
|
117
|
+
const { prevData: o, element: n } = this;
|
|
118
|
+
for (const i in t) {
|
|
119
|
+
const r = t[i];
|
|
120
|
+
r !== o[i] && (n[i] = r);
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
groom(t) {
|
|
124
|
-
const { prevData: o, element:
|
|
124
|
+
const { prevData: o, element: n } = this;
|
|
125
125
|
if (o)
|
|
126
|
-
for (const
|
|
127
|
-
(!t || !(
|
|
126
|
+
for (const i in o)
|
|
127
|
+
(!t || !(i in t) && n[i] === o[i]) && (n[i] = void 0);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
class V extends N {
|
|
@@ -134,23 +134,23 @@ class V extends N {
|
|
|
134
134
|
apply(t) {
|
|
135
135
|
if (t)
|
|
136
136
|
for (const o in t) {
|
|
137
|
-
const
|
|
138
|
-
|
|
137
|
+
const n = t[o];
|
|
138
|
+
n !== this.eventData[o] && this.applyEvent(o, n);
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
applyEvent(t, o) {
|
|
142
|
-
const { prevData:
|
|
143
|
-
this.eventData[t] = o,
|
|
142
|
+
const { prevData: n, element: i } = this;
|
|
143
|
+
this.eventData[t] = o, n[t] && i.removeEventListener(t, this, o), i.addEventListener(t, this, o);
|
|
144
144
|
}
|
|
145
145
|
groom(t) {
|
|
146
|
-
const { prevData: o, element:
|
|
146
|
+
const { prevData: o, element: n } = this;
|
|
147
147
|
if (o)
|
|
148
|
-
for (const
|
|
149
|
-
(!t || !(
|
|
148
|
+
for (const i in o)
|
|
149
|
+
(!t || !(i in t) && n[i] === o[i]) && this.groomEvent(i, o[i]);
|
|
150
150
|
}
|
|
151
151
|
groomEvent(t, o) {
|
|
152
|
-
const { element:
|
|
153
|
-
delete this.eventData[t],
|
|
152
|
+
const { element: n } = this;
|
|
153
|
+
delete this.eventData[t], n.removeEventListener(t, this, o);
|
|
154
154
|
}
|
|
155
155
|
handleEvent(t) {
|
|
156
156
|
const o = this.eventData[t.type];
|
|
@@ -158,16 +158,16 @@ class V extends N {
|
|
|
158
158
|
}
|
|
159
159
|
disconnected() {
|
|
160
160
|
const { eventData: t, element: o } = this;
|
|
161
|
-
for (const
|
|
162
|
-
const
|
|
163
|
-
o.removeEventListener(
|
|
161
|
+
for (const n in t) {
|
|
162
|
+
const i = n.slice(1), r = t[n];
|
|
163
|
+
o.removeEventListener(i, this, r);
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
reconnected() {
|
|
167
167
|
const { eventData: t, element: o } = this;
|
|
168
|
-
for (const
|
|
169
|
-
const
|
|
170
|
-
o.addEventListener(
|
|
168
|
+
for (const n in t) {
|
|
169
|
+
const i = n.slice(1), r = t[n];
|
|
170
|
+
o.addEventListener(i, this, r);
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
}
|
|
@@ -175,65 +175,65 @@ class X extends V {
|
|
|
175
175
|
apply(t) {
|
|
176
176
|
if (!t)
|
|
177
177
|
return;
|
|
178
|
-
const { prevData: o, element:
|
|
179
|
-
for (const
|
|
180
|
-
const r = t[
|
|
181
|
-
if (r === o[
|
|
178
|
+
const { prevData: o, element: n } = this;
|
|
179
|
+
for (const i in t) {
|
|
180
|
+
const r = t[i];
|
|
181
|
+
if (r === o[i])
|
|
182
182
|
continue;
|
|
183
|
-
const
|
|
184
|
-
switch (
|
|
183
|
+
const s = i.slice(1);
|
|
184
|
+
switch (i[0]) {
|
|
185
185
|
case "@":
|
|
186
|
-
this.eventData[
|
|
186
|
+
this.eventData[s] = r, this.applyEvent(s, r);
|
|
187
187
|
break;
|
|
188
188
|
case ".":
|
|
189
|
-
|
|
189
|
+
n[s] = r;
|
|
190
190
|
break;
|
|
191
191
|
case "?":
|
|
192
|
-
r ?
|
|
192
|
+
r ? n.setAttribute(s, "") : n.removeAttribute(s);
|
|
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(t) {
|
|
201
|
-
const { prevData: o, element:
|
|
201
|
+
const { prevData: o, element: n } = this;
|
|
202
202
|
if (o)
|
|
203
|
-
for (const
|
|
204
|
-
const r =
|
|
205
|
-
if (!t || !(
|
|
206
|
-
switch (
|
|
203
|
+
for (const i in o) {
|
|
204
|
+
const r = i.slice(1);
|
|
205
|
+
if (!t || !(i in t) && 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
223
|
const k = R(X);
|
|
224
|
-
var U = Object.defineProperty, W = Object.getOwnPropertyDescriptor, c = (e, t, o,
|
|
225
|
-
for (var
|
|
226
|
-
(
|
|
227
|
-
return
|
|
224
|
+
var U = Object.defineProperty, W = Object.getOwnPropertyDescriptor, c = (e, t, o, n) => {
|
|
225
|
+
for (var i = n > 1 ? void 0 : n ? W(t, o) : t, r = e.length - 1, s; r >= 0; r--)
|
|
226
|
+
(s = e[r]) && (i = (n ? s(t, o, i) : s(i)) || i);
|
|
227
|
+
return n && i && U(t, o, i), i;
|
|
228
228
|
};
|
|
229
|
-
let
|
|
229
|
+
let l = class extends E(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 (e) => {
|
|
232
|
-
var o,
|
|
232
|
+
var o, n;
|
|
233
233
|
const t = ((o = e.detail) == null ? void 0 : o.origin) ?? document.activeElement;
|
|
234
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
|
|
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 = (e) => {
|
|
@@ -245,15 +245,15 @@ let a = class extends S(w) {
|
|
|
245
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 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;
|
|
@@ -261,9 +261,14 @@ let a = class extends S(w) {
|
|
|
261
261
|
this.closePanel(e);
|
|
262
262
|
};
|
|
263
263
|
}
|
|
264
|
+
/**
|
|
265
|
+
* Focus the first focusable and interactive element and return it.
|
|
266
|
+
* @returns {HTMLElement?}
|
|
267
|
+
*/
|
|
264
268
|
focusFirstInPanel() {
|
|
265
|
-
var
|
|
266
|
-
|
|
269
|
+
var o, n;
|
|
270
|
+
const t = this.getFocusableElements().filter((i) => !!i && !i.hasAttribute("disabled"))[0] ?? ((o = this.shadowRoot) == null ? void 0 : o.querySelector(".close-btn")) ?? ((n = this.shadowRoot) == null ? void 0 : n.querySelector(".panel"));
|
|
271
|
+
return t == null || t.focus({ preventScroll: !0 }), t;
|
|
267
272
|
}
|
|
268
273
|
resolveFocusable(e) {
|
|
269
274
|
var o;
|
|
@@ -281,7 +286,7 @@ let a = class extends S(w) {
|
|
|
281
286
|
document.body.style.overflow = "", document.body.removeAttribute("data-side-panel"), this.removeEventListener("keydown", this.handleKeyDown), super.disconnectedCallback(), this.removeEventListener("open-detail", this._onOpenDetail);
|
|
282
287
|
}
|
|
283
288
|
async focusDetailReturnBtn() {
|
|
284
|
-
var
|
|
289
|
+
var i, r, s, h, f;
|
|
285
290
|
await this.updateComplete;
|
|
286
291
|
const e = this.getDeepActiveElement(document);
|
|
287
292
|
if (e && e !== document.body)
|
|
@@ -290,18 +295,18 @@ let a = class extends S(w) {
|
|
|
290
295
|
} catch {
|
|
291
296
|
}
|
|
292
297
|
await new Promise(requestAnimationFrame);
|
|
293
|
-
const t = (
|
|
298
|
+
const t = (i = this.shadowRoot) == null ? void 0 : i.querySelector(".detail-view .return-btn");
|
|
294
299
|
if (!t) return;
|
|
295
|
-
t.updateComplete && await t.updateComplete, (
|
|
296
|
-
const
|
|
297
|
-
|
|
300
|
+
t.updateComplete && await t.updateComplete, (h = (s = ((r = t.shadowRoot) == null ? void 0 : r.querySelector("button")) ?? t) == null ? void 0 : s.focus) == null || h.call(s, { preventScroll: !0 });
|
|
301
|
+
const n = (f = this.shadowRoot) == null ? void 0 : f.querySelector('.panel[role="dialog"]');
|
|
302
|
+
n && n.setAttribute("aria-label", this.labelAriaDialogPanel || "panel-title");
|
|
298
303
|
}
|
|
299
304
|
_restoreFocusToOrigin() {
|
|
300
305
|
var t, o;
|
|
301
306
|
const e = this._detailOriginEl;
|
|
302
307
|
!e || !document.contains(e) || ((o = (t = document.activeElement) == null ? void 0 : t.blur) == null || o.call(t), requestAnimationFrame(() => {
|
|
303
|
-
var
|
|
304
|
-
e.classList.add("a--tabfocus"), (((
|
|
308
|
+
var i;
|
|
309
|
+
e.classList.add("a--tabfocus"), (((i = e.shadowRoot) == null ? void 0 : i.querySelector('button, .button, [tabindex]:not([tabindex="-1"])')) ?? null ?? e).focus({ preventScroll: !0 });
|
|
305
310
|
}));
|
|
306
311
|
}
|
|
307
312
|
getDeepActiveElement(e = this.shadowRoot) {
|
|
@@ -316,8 +321,8 @@ let a = class extends S(w) {
|
|
|
316
321
|
e.preventDefault(), e.stopPropagation(), (r = this.renderRoot.querySelector(".panel")) == null || r.focus({ preventScroll: !0 });
|
|
317
322
|
return;
|
|
318
323
|
}
|
|
319
|
-
const
|
|
320
|
-
!t || !o.includes(t) ? (e.preventDefault(), e.stopPropagation(), (e.shiftKey ?
|
|
324
|
+
const n = o[0], i = o[o.length - 1];
|
|
325
|
+
!t || !o.includes(t) ? (e.preventDefault(), e.stopPropagation(), (e.shiftKey ? i : n).focus({ preventScroll: !0 })) : !e.shiftKey && t === i ? (e.preventDefault(), e.stopPropagation(), n.focus({ preventScroll: !0 })) : e.shiftKey && t === n && (e.preventDefault(), e.stopPropagation(), i.focus({ preventScroll: !0 }));
|
|
321
326
|
}
|
|
322
327
|
trapFocus(e) {
|
|
323
328
|
if (e.key !== "Tab") return;
|
|
@@ -325,32 +330,32 @@ let a = class extends S(w) {
|
|
|
325
330
|
if (!t) return;
|
|
326
331
|
const o = this.getFocusableElements();
|
|
327
332
|
e.target && e.target.closest("o-side-panel") && !o.includes(e.target) && o.splice(1, 0, e.target);
|
|
328
|
-
const
|
|
333
|
+
const n = e.composedPath()[0] ?? this.getDeepActiveElement(document);
|
|
329
334
|
if (this.showDetail) {
|
|
330
|
-
this.wrapFocus(e,
|
|
335
|
+
this.wrapFocus(e, n, o);
|
|
331
336
|
return;
|
|
332
337
|
}
|
|
333
338
|
if (document.querySelector("#refineandsortpopin")) {
|
|
334
|
-
const
|
|
339
|
+
const s = t.querySelector(".close-btn"), h = s ? this.resolveFocusable(s) : null, f = t.querySelector(".js-clear-refinements"), m = f ? this.resolveFocusable(f) : null, x = (P) => {
|
|
335
340
|
e.preventDefault(), e.stopPropagation(), P.focus();
|
|
336
341
|
};
|
|
337
|
-
if (
|
|
338
|
-
if (!e.shiftKey &&
|
|
339
|
-
if (e.shiftKey &&
|
|
342
|
+
if (h && m) {
|
|
343
|
+
if (!e.shiftKey && n === m) return x(h);
|
|
344
|
+
if (e.shiftKey && n === h) return x(m);
|
|
340
345
|
}
|
|
341
346
|
}
|
|
342
347
|
const r = this.renderRoot.querySelector(".close-btn");
|
|
343
|
-
if (!e.shiftKey && r && r.contains(
|
|
348
|
+
if (!e.shiftKey && r && r.contains(n)) {
|
|
344
349
|
e.preventDefault();
|
|
345
|
-
const
|
|
350
|
+
const s = this.renderRoot.querySelector(
|
|
346
351
|
".o-whats-inside--content p"
|
|
347
352
|
);
|
|
348
|
-
if (
|
|
349
|
-
|
|
353
|
+
if (s) {
|
|
354
|
+
s.focus();
|
|
350
355
|
return;
|
|
351
356
|
}
|
|
352
357
|
}
|
|
353
|
-
this.wrapFocus(e,
|
|
358
|
+
this.wrapFocus(e, n, o);
|
|
354
359
|
}
|
|
355
360
|
isUnavailableElement(e) {
|
|
356
361
|
if (!(e instanceof HTMLElement)) return !1;
|
|
@@ -361,45 +366,59 @@ let a = class extends S(w) {
|
|
|
361
366
|
getFocusableElements() {
|
|
362
367
|
const e = this.showDetail ? this.renderRoot.querySelector(".detail-view") : this.renderRoot.querySelector(".panel");
|
|
363
368
|
if (!e) return [];
|
|
364
|
-
const t = (r) => this.isUnavailableElement(r) ? !1 : r.matches(
|
|
365
|
-
if (
|
|
369
|
+
const t = (r) => this.isUnavailableElement(r) ? !1 : r.matches(l.focusablesSelector), o = [], n = /* @__PURE__ */ new Set(), i = (r) => {
|
|
370
|
+
if (n.has(r) || (n.add(r), r instanceof HTMLElement && r.closest("[hidden], [inert], [aria-hidden='true']"))) return;
|
|
366
371
|
if (t(r)) {
|
|
367
372
|
const f = this.resolveFocusable(r);
|
|
368
373
|
f && !this.isUnavailableElement(f) && o.push(f);
|
|
369
374
|
}
|
|
370
|
-
const
|
|
371
|
-
if (
|
|
375
|
+
const s = r.tagName.toLowerCase();
|
|
376
|
+
if (s === "o-icon-button" || s === "o-button") return;
|
|
372
377
|
if (r instanceof HTMLSlotElement) {
|
|
373
|
-
r.assignedElements({ flatten: !0 }).forEach(
|
|
378
|
+
r.assignedElements({ flatten: !0 }).forEach(i);
|
|
374
379
|
return;
|
|
375
380
|
}
|
|
376
|
-
const
|
|
377
|
-
|
|
381
|
+
const h = r.shadowRoot;
|
|
382
|
+
h && Array.from(h.children).forEach(i), Array.from(r.children).forEach(i);
|
|
378
383
|
};
|
|
379
|
-
return
|
|
384
|
+
return i(e), o;
|
|
380
385
|
}
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
386
|
+
/**
|
|
387
|
+
* Open the panel.
|
|
388
|
+
* @param {Boolean} withVisibleFocus whether to have the visible tabfocus or not. Defaults to FALSE.
|
|
389
|
+
* @param {HTMLElement|String|null} elementToFocus the element inside the sidepanel to focus. Otherwise, default focus behavior.
|
|
390
|
+
*/
|
|
391
|
+
openPanel(e = !1, t = null) {
|
|
392
|
+
var n;
|
|
393
|
+
this.removeAttribute("hidden"), this.getBoundingClientRect(), this.previousFocusedElement = document.activeElement, this.previousFocusedSelector = (n = this.previousFocusedElement) == null ? void 0 : n.getAttribute("paneltarget"), this.open = !0, document.body.style.overflow = "hidden", document.body.setAttribute("data-side-panel", "open");
|
|
394
|
+
const o = this.renderRoot.querySelector(".panel");
|
|
395
|
+
o && o.setAttribute("aria-modal", "true"), this.updateComplete.then(async () => {
|
|
396
|
+
var i, r;
|
|
397
|
+
if (this.showHeader && !t) {
|
|
398
|
+
const s = (i = this.shadowRoot) == null ? void 0 : i.querySelector(".panel .close-btn");
|
|
399
|
+
s != null && s.updateComplete && await s.updateComplete;
|
|
400
|
+
const h = this.resolveFocusable(s);
|
|
401
|
+
(r = h == null ? void 0 : h.focus) == null || r.call(h, { preventScroll: !0 }), e || (s == null || s.classList.add("no-outline"), h == null || h.addEventListener("focusout", () => {
|
|
402
|
+
s == null || s.classList.remove("no-outline");
|
|
403
|
+
}, { once: !0 }));
|
|
392
404
|
} else
|
|
393
405
|
this.focusFirstInPanel();
|
|
394
406
|
}), this.dispatchEvent(
|
|
395
|
-
new CustomEvent("open", {
|
|
407
|
+
new CustomEvent("open", {
|
|
408
|
+
bubbles: !0,
|
|
409
|
+
composed: !0,
|
|
410
|
+
detail: {
|
|
411
|
+
withVisibleFocus: e,
|
|
412
|
+
elementToFocus: t
|
|
413
|
+
}
|
|
414
|
+
})
|
|
396
415
|
);
|
|
397
416
|
}
|
|
398
417
|
closePanel(e) {
|
|
399
|
-
var
|
|
418
|
+
var n, i, r;
|
|
400
419
|
this.open = !1, this.showDetail = !1, document.body.style.overflow = "", document.body.removeAttribute("data-side-panel");
|
|
401
420
|
let t = this.previousFocusedElement;
|
|
402
|
-
t != null && t.isConnected || (t = document.querySelector(`[paneltarget="${this.previousFocusedSelector}"]`)), (t == null ? void 0 : t.tagName.toLowerCase()) === "o-button" ? (r = (
|
|
421
|
+
t != null && t.isConnected || (t = document.querySelector(`[paneltarget="${this.previousFocusedSelector}"]`)), (t == null ? void 0 : t.tagName.toLowerCase()) === "o-button" ? (r = (i = (n = t.shadowRoot) == null ? void 0 : n.querySelector(".button")) == null ? void 0 : i.focus) == null || r.call(i) : t == null || t.focus();
|
|
403
422
|
const o = this.renderRoot.querySelector(".panel");
|
|
404
423
|
o && o.removeAttribute("aria-modal"), this.dispatchEvent(
|
|
405
424
|
new CustomEvent("close", { bubbles: !0, composed: !0, detail: { event: e } })
|
|
@@ -437,9 +456,9 @@ let a = class extends S(w) {
|
|
|
437
456
|
}, 500);
|
|
438
457
|
}
|
|
439
458
|
render() {
|
|
440
|
-
const e = this.showHeader ?
|
|
459
|
+
const e = this.showHeader ? u`
|
|
441
460
|
<div tabindex="-1" part="header" class="header ${this.showDetail ? "detail-view-header" : ""}">
|
|
442
|
-
${this.showHeaderStartIcon ?
|
|
461
|
+
${this.showHeaderStartIcon ? u`
|
|
443
462
|
<o-icon-button
|
|
444
463
|
icon="arrowLeft"
|
|
445
464
|
size="small"
|
|
@@ -456,7 +475,7 @@ let a = class extends S(w) {
|
|
|
456
475
|
<p role="heading" aria-level="1" id="panel-title" class="${this.headerTitleClassName}">
|
|
457
476
|
${this.headerTitle}
|
|
458
477
|
</p>
|
|
459
|
-
${this.addToBagProductCount ?
|
|
478
|
+
${this.addToBagProductCount ? u`<span class="a-quantity">${this.addToBagProductCount}</span>` : null}
|
|
460
479
|
</div>
|
|
461
480
|
<o-icon-button
|
|
462
481
|
icon="occ-close-outlined"
|
|
@@ -470,9 +489,9 @@ let a = class extends S(w) {
|
|
|
470
489
|
aria-describedby="panel-title"
|
|
471
490
|
></o-icon-button>
|
|
472
491
|
</div>
|
|
473
|
-
` : null, t = this.showFooter ?
|
|
492
|
+
` : null, t = this.showFooter ? u`
|
|
474
493
|
<div class="footer" part="footer">
|
|
475
|
-
${this.firstButtonVariant && this.firstButtonLabel ?
|
|
494
|
+
${this.firstButtonVariant && this.firstButtonLabel ? u`
|
|
476
495
|
<o-button
|
|
477
496
|
.variant=${this.firstButtonVariant}
|
|
478
497
|
@click=${this.handleFirstClick}
|
|
@@ -482,7 +501,7 @@ let a = class extends S(w) {
|
|
|
482
501
|
${this.firstButtonLabel}
|
|
483
502
|
</o-button>
|
|
484
503
|
` : null}
|
|
485
|
-
${this.secondButtonVariant && this.secondButtonLabel ?
|
|
504
|
+
${this.secondButtonVariant && this.secondButtonLabel ? u`
|
|
486
505
|
<o-button
|
|
487
506
|
.variant=${this.secondButtonVariant}
|
|
488
507
|
@click=${this.handleSecondClick}
|
|
@@ -494,7 +513,7 @@ let a = class extends S(w) {
|
|
|
494
513
|
` : null}
|
|
495
514
|
</div>
|
|
496
515
|
` : null;
|
|
497
|
-
return
|
|
516
|
+
return u`
|
|
498
517
|
<div class="overlay" style="z-index: ${this.zIndex}" @click=${this.handleClosePanel}></div>
|
|
499
518
|
<div
|
|
500
519
|
class="panel"
|
|
@@ -509,7 +528,7 @@ let a = class extends S(w) {
|
|
|
509
528
|
|
|
510
529
|
<div part="content" class="content ${this.isHidingDetail ? "slide-out-right" : ""} ${this.showDetail ? "with-detail" : ""}">
|
|
511
530
|
|
|
512
|
-
${this.showDetail ?
|
|
531
|
+
${this.showDetail ? u`
|
|
513
532
|
<div class="detail-view">
|
|
514
533
|
${e}
|
|
515
534
|
<div class="detail-content">
|
|
@@ -518,7 +537,7 @@ let a = class extends S(w) {
|
|
|
518
537
|
</div>
|
|
519
538
|
</div>
|
|
520
539
|
</div>
|
|
521
|
-
` :
|
|
540
|
+
` : u`<slot></slot>`}
|
|
522
541
|
</div>
|
|
523
542
|
|
|
524
543
|
${this.stickyFooter ? null : t}
|
|
@@ -528,7 +547,7 @@ let a = class extends S(w) {
|
|
|
528
547
|
`;
|
|
529
548
|
}
|
|
530
549
|
};
|
|
531
|
-
|
|
550
|
+
l.styles = C`
|
|
532
551
|
:host {
|
|
533
552
|
--z-overlay: 99;
|
|
534
553
|
--z-panel: 100;
|
|
@@ -771,100 +790,100 @@ a.styles = C`
|
|
|
771
790
|
box-sizing: border-box;
|
|
772
791
|
}
|
|
773
792
|
`;
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
793
|
+
l.focusablesSelector = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"]), o-icon-button, o-button';
|
|
794
|
+
l.focusablesCustomElementsSelector = "o-icon-button, o-button";
|
|
795
|
+
l.shadowRootOptions = {
|
|
777
796
|
...w.shadowRootOptions,
|
|
778
797
|
// This helps send focus into the first focusable in shadow when host is focused
|
|
779
798
|
delegatesFocus: !0
|
|
780
799
|
};
|
|
781
800
|
c([
|
|
782
|
-
|
|
783
|
-
],
|
|
801
|
+
a({ type: Boolean, reflect: !0 })
|
|
802
|
+
], l.prototype, "open", 2);
|
|
784
803
|
c([
|
|
785
|
-
|
|
786
|
-
],
|
|
804
|
+
a({ type: Boolean })
|
|
805
|
+
], l.prototype, "showHeader", 2);
|
|
787
806
|
c([
|
|
788
|
-
|
|
789
|
-
],
|
|
807
|
+
a({ type: Boolean })
|
|
808
|
+
], l.prototype, "showFooter", 2);
|
|
790
809
|
c([
|
|
791
|
-
|
|
792
|
-
],
|
|
810
|
+
a({ type: Boolean })
|
|
811
|
+
], l.prototype, "showHeaderStartIcon", 2);
|
|
793
812
|
c([
|
|
794
|
-
|
|
795
|
-
],
|
|
813
|
+
a({ type: String })
|
|
814
|
+
], l.prototype, "headerTitle", 2);
|
|
796
815
|
c([
|
|
797
|
-
|
|
798
|
-
],
|
|
816
|
+
a({ type: String })
|
|
817
|
+
], l.prototype, "headerTitleClassName", 2);
|
|
799
818
|
c([
|
|
800
|
-
|
|
801
|
-
],
|
|
819
|
+
a({ type: String })
|
|
820
|
+
], l.prototype, "labelDialog", 2);
|
|
802
821
|
c([
|
|
803
|
-
|
|
804
|
-
],
|
|
822
|
+
a({ type: String })
|
|
823
|
+
], l.prototype, "labelAriaDialogPanel", 2);
|
|
805
824
|
c([
|
|
806
|
-
|
|
807
|
-
],
|
|
825
|
+
a({ type: String })
|
|
826
|
+
], l.prototype, "addToBagProductCount", 2);
|
|
808
827
|
c([
|
|
809
|
-
|
|
810
|
-
],
|
|
828
|
+
a({ type: String })
|
|
829
|
+
], l.prototype, "closeButtonLabel", 2);
|
|
811
830
|
c([
|
|
812
|
-
|
|
813
|
-
],
|
|
831
|
+
a({ type: String })
|
|
832
|
+
], l.prototype, "goBackButtonLabel", 2);
|
|
814
833
|
c([
|
|
815
|
-
|
|
816
|
-
],
|
|
834
|
+
a({ type: String })
|
|
835
|
+
], l.prototype, "firstButtonLabel", 2);
|
|
817
836
|
c([
|
|
818
|
-
|
|
819
|
-
],
|
|
837
|
+
a({ type: String })
|
|
838
|
+
], l.prototype, "firstButtonVariant", 2);
|
|
820
839
|
c([
|
|
821
|
-
|
|
822
|
-
],
|
|
840
|
+
a({ type: Object })
|
|
841
|
+
], l.prototype, "firstButtonProps", 2);
|
|
823
842
|
c([
|
|
824
|
-
|
|
825
|
-
],
|
|
843
|
+
a({ type: Boolean })
|
|
844
|
+
], l.prototype, "onFirstButtonClickClose", 2);
|
|
826
845
|
c([
|
|
827
|
-
|
|
828
|
-
],
|
|
846
|
+
a({ type: String })
|
|
847
|
+
], l.prototype, "secondButtonLabel", 2);
|
|
829
848
|
c([
|
|
830
|
-
|
|
831
|
-
],
|
|
849
|
+
a({ type: String })
|
|
850
|
+
], l.prototype, "secondButtonVariant", 2);
|
|
832
851
|
c([
|
|
833
|
-
|
|
834
|
-
],
|
|
852
|
+
a({ type: Object })
|
|
853
|
+
], l.prototype, "secondButtonProps", 2);
|
|
835
854
|
c([
|
|
836
|
-
|
|
837
|
-
],
|
|
855
|
+
a({ type: Boolean })
|
|
856
|
+
], l.prototype, "onSecondButtonClickClose", 2);
|
|
838
857
|
c([
|
|
839
|
-
|
|
840
|
-
],
|
|
858
|
+
a({ type: Boolean, reflect: !0 })
|
|
859
|
+
], l.prototype, "stickyFooter", 2);
|
|
841
860
|
c([
|
|
842
|
-
|
|
843
|
-
],
|
|
861
|
+
a({ type: Boolean })
|
|
862
|
+
], l.prototype, "disablePortal", 2);
|
|
844
863
|
c([
|
|
845
|
-
|
|
846
|
-
],
|
|
864
|
+
a({ type: Number })
|
|
865
|
+
], l.prototype, "zIndex", 2);
|
|
847
866
|
c([
|
|
848
|
-
|
|
849
|
-
],
|
|
867
|
+
a({ type: Boolean, reflect: !0 })
|
|
868
|
+
], l.prototype, "initialized", 2);
|
|
850
869
|
c([
|
|
851
|
-
|
|
852
|
-
],
|
|
870
|
+
a({ type: Boolean })
|
|
871
|
+
], l.prototype, "showDetail", 2);
|
|
853
872
|
c([
|
|
854
|
-
|
|
855
|
-
],
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
],
|
|
859
|
-
var G = Object.defineProperty, Q = Object.getOwnPropertyDescriptor,
|
|
860
|
-
for (var
|
|
861
|
-
(
|
|
862
|
-
return
|
|
873
|
+
a({ type: Boolean })
|
|
874
|
+
], l.prototype, "isHidingDetail", 2);
|
|
875
|
+
l = c([
|
|
876
|
+
S("o-side-panel")
|
|
877
|
+
], l);
|
|
878
|
+
var G = Object.defineProperty, Q = Object.getOwnPropertyDescriptor, p = (e, t, o, n) => {
|
|
879
|
+
for (var i = n > 1 ? void 0 : n ? Q(t, o) : t, r = e.length - 1, s; r >= 0; r--)
|
|
880
|
+
(s = e[r]) && (i = (n ? s(t, o, i) : s(i)) || i);
|
|
881
|
+
return n && i && G(t, o, i), i;
|
|
863
882
|
};
|
|
864
|
-
const J =
|
|
883
|
+
const J = E(A(w)), lt = ["primary", "secondary", "ghost", "tertiary", "link"];
|
|
865
884
|
let d = class extends J {
|
|
866
885
|
constructor() {
|
|
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.
|
|
886
|
+
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.describedBy = null, this.ariaExpanded = null;
|
|
868
887
|
}
|
|
869
888
|
get name() {
|
|
870
889
|
return this.getAttribute("name") ?? "";
|
|
@@ -878,16 +897,16 @@ let d = class extends J {
|
|
|
878
897
|
handleClick(e) {
|
|
879
898
|
if (!(e instanceof KeyboardEvent && !["Enter", " "].includes(e.key)) && this.panelTarget) {
|
|
880
899
|
const t = document.getElementById(this.panelTarget);
|
|
881
|
-
t instanceof
|
|
900
|
+
t instanceof l && (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
901
|
}
|
|
883
902
|
}
|
|
884
903
|
render() {
|
|
885
904
|
return this.href ? this.renderLink() : this.renderButton();
|
|
886
905
|
}
|
|
887
906
|
connectedCallback() {
|
|
888
|
-
var o,
|
|
907
|
+
var o, n;
|
|
889
908
|
super.connectedCallback();
|
|
890
|
-
const e = (o = this.startIconModel) == null ? void 0 : o.startsWith("occ-"), t = (
|
|
909
|
+
const e = (o = this.startIconModel) == null ? void 0 : o.startsWith("occ-"), t = (n = this.endIconModel) == null ? void 0 : n.startsWith("occ-");
|
|
891
910
|
(e || t) && (e && $(this.startIconModel), t && $(this.endIconModel), this._unsubOcc = _(() => this.requestUpdate()));
|
|
892
911
|
}
|
|
893
912
|
disconnectedCallback() {
|
|
@@ -896,46 +915,45 @@ let d = class extends J {
|
|
|
896
915
|
}
|
|
897
916
|
renderIcon(e) {
|
|
898
917
|
const t = e === "start" ? this.startIconModel : this.endIconModel;
|
|
899
|
-
if (!t) return
|
|
918
|
+
if (!t) return b;
|
|
900
919
|
const o = I[t] ?? "";
|
|
901
|
-
if (!o) return
|
|
902
|
-
const
|
|
903
|
-
return
|
|
920
|
+
if (!o) return b;
|
|
921
|
+
const n = z(o);
|
|
922
|
+
return u`<span class="${e === "start" ? "icon-start" : "icon-end"}">${F(n)}</span>`;
|
|
904
923
|
}
|
|
905
924
|
renderButton() {
|
|
906
925
|
const e = this.text || this.textsecond;
|
|
907
|
-
return
|
|
926
|
+
return u`
|
|
908
927
|
<button type=${this.type} class="button" ?disabled=${this.disabled} @click=${this.handleClick} @keydown=${this.handleClick}
|
|
909
|
-
aria-describedby=${this.describedBy ||
|
|
910
|
-
${this.startIcon ? this.renderIcon("start") :
|
|
911
|
-
${e ?
|
|
912
|
-
${this.text ?
|
|
913
|
-
${this.textsecond ?
|
|
914
|
-
${this.withbadge ?
|
|
915
|
-
` :
|
|
916
|
-
${this.endIcon ? this.renderIcon("end") :
|
|
928
|
+
aria-describedby=${this.describedBy || b} aria-expanded=${this.ariaExpanded || b} >
|
|
929
|
+
${this.startIcon ? this.renderIcon("start") : b}
|
|
930
|
+
${e ? u`
|
|
931
|
+
${this.text ? u`<span class="text">${this.text}</span>` : b}
|
|
932
|
+
${this.textsecond ? u`<span class="text">${this.textsecond}</span>` : b}
|
|
933
|
+
${this.withbadge ? u`<slot></slot>` : b}
|
|
934
|
+
` : u`<slot></slot>`}
|
|
935
|
+
${this.endIcon ? this.renderIcon("end") : b}
|
|
917
936
|
</button>
|
|
918
937
|
`;
|
|
919
938
|
}
|
|
920
939
|
renderLink() {
|
|
921
940
|
const e = this.text || this.textsecond;
|
|
922
|
-
return
|
|
941
|
+
return u`
|
|
923
942
|
<a
|
|
924
943
|
href=${this.href}
|
|
925
|
-
target=${this.target ||
|
|
944
|
+
target=${this.target || b}
|
|
926
945
|
class="button"
|
|
927
946
|
?disabled=${this.disabled}
|
|
928
|
-
role=${this.hideRoleButton ? p : "button"}
|
|
929
947
|
@click=${this.handleClick}
|
|
930
948
|
@keydown=${this.handleClick}
|
|
931
|
-
aria-describedby=${this.describedBy ||
|
|
949
|
+
aria-describedby=${this.describedBy || b}
|
|
932
950
|
>
|
|
933
|
-
${this.startIcon ? this.renderIcon("start") :
|
|
934
|
-
${e ?
|
|
935
|
-
${this.text ?
|
|
936
|
-
${this.textsecond ?
|
|
937
|
-
` :
|
|
938
|
-
${this.endIcon ? this.renderIcon("end") :
|
|
951
|
+
${this.startIcon ? this.renderIcon("start") : b}
|
|
952
|
+
${e ? u`
|
|
953
|
+
${this.text ? u`<span>${this.text}</span>` : b}
|
|
954
|
+
${this.textsecond ? u`<span>${this.textsecond}</span>` : b}
|
|
955
|
+
` : u`<slot></slot>`}
|
|
956
|
+
${this.endIcon ? this.renderIcon("end") : b}
|
|
939
957
|
</a>
|
|
940
958
|
`;
|
|
941
959
|
}
|
|
@@ -1197,68 +1215,65 @@ d.styles = C`
|
|
|
1197
1215
|
transform: translateX(4px);
|
|
1198
1216
|
}
|
|
1199
1217
|
`;
|
|
1200
|
-
|
|
1201
|
-
|
|
1218
|
+
p([
|
|
1219
|
+
a()
|
|
1202
1220
|
], d.prototype, "type", 2);
|
|
1203
|
-
|
|
1204
|
-
|
|
1221
|
+
p([
|
|
1222
|
+
a()
|
|
1205
1223
|
], d.prototype, "value", 2);
|
|
1206
|
-
|
|
1207
|
-
|
|
1224
|
+
p([
|
|
1225
|
+
a({ type: String, reflect: !0 })
|
|
1208
1226
|
], d.prototype, "variant", 2);
|
|
1209
|
-
|
|
1210
|
-
|
|
1227
|
+
p([
|
|
1228
|
+
a({ type: String })
|
|
1211
1229
|
], d.prototype, "text", 2);
|
|
1212
|
-
|
|
1213
|
-
|
|
1230
|
+
p([
|
|
1231
|
+
a({ type: String })
|
|
1214
1232
|
], d.prototype, "textsecond", 2);
|
|
1215
|
-
|
|
1216
|
-
|
|
1233
|
+
p([
|
|
1234
|
+
a({ type: Boolean, reflect: !0 })
|
|
1217
1235
|
], d.prototype, "fullwidth", 2);
|
|
1218
|
-
|
|
1219
|
-
|
|
1236
|
+
p([
|
|
1237
|
+
a({ type: Boolean, reflect: !0 })
|
|
1220
1238
|
], d.prototype, "disabled", 2);
|
|
1221
|
-
|
|
1222
|
-
|
|
1239
|
+
p([
|
|
1240
|
+
a({ type: String })
|
|
1223
1241
|
], d.prototype, "startIconModel", 2);
|
|
1224
|
-
|
|
1225
|
-
|
|
1242
|
+
p([
|
|
1243
|
+
a({ type: String })
|
|
1226
1244
|
], d.prototype, "endIconModel", 2);
|
|
1227
|
-
|
|
1228
|
-
|
|
1245
|
+
p([
|
|
1246
|
+
a({ type: Boolean, reflect: !0, attribute: "starticon" })
|
|
1229
1247
|
], d.prototype, "startIcon", 2);
|
|
1230
|
-
|
|
1231
|
-
|
|
1248
|
+
p([
|
|
1249
|
+
a({ type: Boolean, reflect: !0, attribute: "endicon" })
|
|
1232
1250
|
], d.prototype, "endIcon", 2);
|
|
1233
|
-
|
|
1234
|
-
|
|
1251
|
+
p([
|
|
1252
|
+
a({ type: String, attribute: "paneltarget" })
|
|
1235
1253
|
], d.prototype, "panelTarget", 2);
|
|
1236
|
-
|
|
1237
|
-
|
|
1254
|
+
p([
|
|
1255
|
+
a({ type: String })
|
|
1238
1256
|
], d.prototype, "href", 2);
|
|
1239
|
-
|
|
1240
|
-
|
|
1257
|
+
p([
|
|
1258
|
+
a({ type: String })
|
|
1241
1259
|
], d.prototype, "target", 2);
|
|
1242
|
-
|
|
1243
|
-
|
|
1260
|
+
p([
|
|
1261
|
+
a({ type: Boolean, reflect: !0 })
|
|
1244
1262
|
], d.prototype, "underlined", 2);
|
|
1245
|
-
|
|
1246
|
-
|
|
1263
|
+
p([
|
|
1264
|
+
a({ type: Boolean, reflect: !0 })
|
|
1247
1265
|
], d.prototype, "withbadge", 2);
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
], d.prototype, "hideRoleButton", 2);
|
|
1251
|
-
u([
|
|
1252
|
-
s({ reflect: !0, attribute: "describedby" })
|
|
1266
|
+
p([
|
|
1267
|
+
a({ reflect: !0, attribute: "describedby" })
|
|
1253
1268
|
], d.prototype, "describedBy", 2);
|
|
1254
|
-
|
|
1255
|
-
|
|
1269
|
+
p([
|
|
1270
|
+
a({ reflect: !0, attribute: "expanded" })
|
|
1256
1271
|
], d.prototype, "ariaExpanded", 2);
|
|
1257
|
-
d =
|
|
1258
|
-
|
|
1272
|
+
d = p([
|
|
1273
|
+
S("o-button")
|
|
1259
1274
|
], d);
|
|
1260
1275
|
export {
|
|
1261
1276
|
d as O,
|
|
1262
|
-
|
|
1277
|
+
l as OccitaneSidePanel,
|
|
1263
1278
|
lt as v
|
|
1264
1279
|
};
|
|
@@ -20,7 +20,7 @@ let s = class extends d(b) {
|
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
connectedCallback() {
|
|
23
|
-
super.connectedCallback(),
|
|
23
|
+
super.connectedCallback(), u("occ-wishlist-outlined"), u("occ-wishlist-filled"), this._unsubOcc = g(() => this.requestUpdate());
|
|
24
24
|
}
|
|
25
25
|
disconnectedCallback() {
|
|
26
26
|
var t;
|
|
@@ -33,7 +33,7 @@ let s = class extends d(b) {
|
|
|
33
33
|
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), this.toggleStatus());
|
|
34
34
|
}
|
|
35
35
|
applyStatus(t) {
|
|
36
|
-
this.status = t, this.icon = t === "filled" ? "occ-wishlist-filled" : "occ-wishlist-outlined", this.bgstyle = t === "filled" ? "none-contrast" : "none-light"
|
|
36
|
+
this.status = t, this.icon = t === "filled" ? "occ-wishlist-filled" : "occ-wishlist-outlined", this.bgstyle = t === "filled" ? "none-contrast" : "none-light";
|
|
37
37
|
}
|
|
38
38
|
render() {
|
|
39
39
|
const t = v[this.icon] ?? "";
|
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.3";
|
|
8
8
|
const i = {
|
|
9
9
|
"o-accordion": () => import("./components/accordion.mjs"),
|
|
10
10
|
"o-accordion-group": () => import("./components/accordion-group.mjs"),
|