@florid-kit/components 4.1.0 → 4.1.2
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/button.d.ts +5 -0
- package/components/side-panel.mjs +204 -178
- package/index.mjs +1 -1
- package/loader.mjs +1 -1
- package/package.json +1 -1
package/components/button.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { FormSubmitter, FormSubmitterType } from '../controllers/form-submitter'
|
|
|
3
3
|
|
|
4
4
|
declare const buttonBaseClass: import('../behaviors/mixin').MixinReturn<import('../behaviors/mixin').MixinReturn<typeof LitElement, import('../behaviors/element-internals.js').WithElementInternals>>;
|
|
5
5
|
type ButtonVariant = "primary" | "secondary" | "ghost" | "tertiary" | "link";
|
|
6
|
+
type ButtonLinkTemplate = "standard" | "discret";
|
|
6
7
|
export declare const variants: string[];
|
|
7
8
|
export declare class OccitaneButton extends buttonBaseClass implements FormSubmitter {
|
|
8
9
|
static readonly formAssociated = true;
|
|
@@ -13,6 +14,8 @@ export declare class OccitaneButton extends buttonBaseClass implements FormSubmi
|
|
|
13
14
|
set name(name: string);
|
|
14
15
|
get form(): HTMLFormElement | null;
|
|
15
16
|
variant: ButtonVariant;
|
|
17
|
+
/** Only applies to variant="link" (same templates as o-link). */
|
|
18
|
+
template: ButtonLinkTemplate;
|
|
16
19
|
text: string;
|
|
17
20
|
textsecond: string;
|
|
18
21
|
fullwidth: boolean;
|
|
@@ -29,9 +32,11 @@ export declare class OccitaneButton extends buttonBaseClass implements FormSubmi
|
|
|
29
32
|
withbadge: boolean;
|
|
30
33
|
describedBy: string | null;
|
|
31
34
|
ariaExpanded: string | null;
|
|
35
|
+
asButton: boolean;
|
|
32
36
|
private updateDescription;
|
|
33
37
|
protected updated(): void;
|
|
34
38
|
private handleClick;
|
|
39
|
+
private handleLinkKeyUp;
|
|
35
40
|
protected render(): import('lit').TemplateResult<1>;
|
|
36
41
|
private _unsubOcc?;
|
|
37
42
|
connectedCallback(): void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { E as b, i as E, a as w, m as
|
|
2
|
-
import { n as
|
|
1
|
+
import { E as b, i as E, a as w, m as S, x as p, t as C } from "../performance-mixin-D7YmSeqN.mjs";
|
|
2
|
+
import { n as s } from "../property-S_Y9cb04.mjs";
|
|
3
3
|
import { f as g } from "../css-C8WrrxT-.mjs";
|
|
4
4
|
import { i as D, m as P } from "../element-internals-Dw7LndlH.mjs";
|
|
5
|
-
import { e as
|
|
5
|
+
import { e as k, o as _, a as I } from "../icons-registry.mjs";
|
|
6
6
|
import { g as z } from "../svg-utils-DOL__czZ.mjs";
|
|
7
7
|
import { o as F } from "../unsafe-svg-BipL_msF.mjs";
|
|
8
8
|
import "./icon-button.mjs";
|
|
@@ -17,15 +17,15 @@ function q(e) {
|
|
|
17
17
|
e.addInitializer((t) => {
|
|
18
18
|
const o = t;
|
|
19
19
|
o.addEventListener("click", async (n) => {
|
|
20
|
-
const { type: i, [D]: r } = o, { form:
|
|
21
|
-
if (!(!
|
|
20
|
+
const { type: i, [D]: r } = o, { form: a } = r;
|
|
21
|
+
if (!(!a || i === "button") && (await new Promise((h) => {
|
|
22
22
|
setTimeout(h);
|
|
23
23
|
}), !n.defaultPrevented)) {
|
|
24
24
|
if (i === "reset") {
|
|
25
|
-
|
|
25
|
+
a.reset();
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
|
-
|
|
28
|
+
a.addEventListener(
|
|
29
29
|
"submit",
|
|
30
30
|
(h) => {
|
|
31
31
|
Object.defineProperty(h, "submitter", {
|
|
@@ -35,7 +35,7 @@ function q(e) {
|
|
|
35
35
|
});
|
|
36
36
|
},
|
|
37
37
|
{ capture: !0, once: !0 }
|
|
38
|
-
), r.setFormValue(o.value),
|
|
38
|
+
), r.setFormValue(o.value), a.requestSubmit();
|
|
39
39
|
}
|
|
40
40
|
});
|
|
41
41
|
});
|
|
@@ -171,7 +171,7 @@ class V extends j {
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
|
-
class
|
|
174
|
+
class U extends V {
|
|
175
175
|
apply(t) {
|
|
176
176
|
if (!t)
|
|
177
177
|
return;
|
|
@@ -180,16 +180,16 @@ class X extends V {
|
|
|
180
180
|
const r = t[i];
|
|
181
181
|
if (r === o[i])
|
|
182
182
|
continue;
|
|
183
|
-
const
|
|
183
|
+
const a = i.slice(1);
|
|
184
184
|
switch (i[0]) {
|
|
185
185
|
case "@":
|
|
186
|
-
this.eventData[
|
|
186
|
+
this.eventData[a] = r, this.applyEvent(a, r);
|
|
187
187
|
break;
|
|
188
188
|
case ".":
|
|
189
|
-
n[
|
|
189
|
+
n[a] = r;
|
|
190
190
|
break;
|
|
191
191
|
case "?":
|
|
192
|
-
r ? n.setAttribute(
|
|
192
|
+
r ? n.setAttribute(a, "") : n.removeAttribute(a);
|
|
193
193
|
break;
|
|
194
194
|
default:
|
|
195
195
|
r != null ? n.setAttribute(i, String(r)) : n.removeAttribute(i);
|
|
@@ -220,13 +220,13 @@ class X extends V {
|
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
const
|
|
224
|
-
var
|
|
225
|
-
for (var i = n > 1 ? void 0 : n ? W(t, o) : t, r = e.length - 1,
|
|
226
|
-
(
|
|
227
|
-
return n && i &&
|
|
223
|
+
const $ = R(U);
|
|
224
|
+
var X = Object.defineProperty, W = Object.getOwnPropertyDescriptor, d = (e, t, o, n) => {
|
|
225
|
+
for (var i = n > 1 ? void 0 : n ? W(t, o) : t, r = e.length - 1, a; r >= 0; r--)
|
|
226
|
+
(a = e[r]) && (i = (n ? a(t, o, i) : a(i)) || i);
|
|
227
|
+
return n && i && X(t, o, i), i;
|
|
228
228
|
};
|
|
229
|
-
let l = class extends
|
|
229
|
+
let l = 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.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
232
|
var o, n;
|
|
@@ -286,7 +286,7 @@ let l = class extends C(w) {
|
|
|
286
286
|
document.body.style.overflow = "", document.body.removeAttribute("data-side-panel"), this.removeEventListener("keydown", this.handleKeyDown), super.disconnectedCallback(), this.removeEventListener("open-detail", this._onOpenDetail);
|
|
287
287
|
}
|
|
288
288
|
async focusDetailReturnBtn() {
|
|
289
|
-
var i, r,
|
|
289
|
+
var i, r, a, h, f;
|
|
290
290
|
await this.updateComplete;
|
|
291
291
|
const e = this.getDeepActiveElement(document);
|
|
292
292
|
if (e && e !== document.body)
|
|
@@ -297,7 +297,7 @@ let l = class extends C(w) {
|
|
|
297
297
|
await new Promise(requestAnimationFrame);
|
|
298
298
|
const t = (i = this.shadowRoot) == null ? void 0 : i.querySelector(".detail-view .return-btn");
|
|
299
299
|
if (!t) return;
|
|
300
|
-
t.updateComplete && await t.updateComplete, (h = (
|
|
300
|
+
t.updateComplete && await t.updateComplete, (h = (a = ((r = t.shadowRoot) == null ? void 0 : r.querySelector("button")) ?? t) == null ? void 0 : a.focus) == null || h.call(a, { preventScroll: !0 });
|
|
301
301
|
const n = (f = this.shadowRoot) == null ? void 0 : f.querySelector('.panel[role="dialog"]');
|
|
302
302
|
n && (this.labelAriaDialogPanel ? n.setAttribute("aria-label", this.labelAriaDialogPanel) : n.setAttribute("aria-labelledby", "panel-title"));
|
|
303
303
|
}
|
|
@@ -336,7 +336,7 @@ let l = class extends C(w) {
|
|
|
336
336
|
return;
|
|
337
337
|
}
|
|
338
338
|
if (document.querySelector("#refineandsortpopin")) {
|
|
339
|
-
const
|
|
339
|
+
const a = t.querySelector(".close-btn"), h = a ? this.resolveFocusable(a) : null, f = t.querySelector(".js-clear-refinements"), m = f ? this.resolveFocusable(f) : null, x = (A) => {
|
|
340
340
|
e.preventDefault(), e.stopPropagation(), A.focus();
|
|
341
341
|
};
|
|
342
342
|
if (h && m) {
|
|
@@ -347,11 +347,11 @@ let l = class extends C(w) {
|
|
|
347
347
|
const r = this.renderRoot.querySelector(".close-btn");
|
|
348
348
|
if (!e.shiftKey && r && r.contains(n)) {
|
|
349
349
|
e.preventDefault();
|
|
350
|
-
const
|
|
350
|
+
const a = this.renderRoot.querySelector(
|
|
351
351
|
".o-whats-inside--content p"
|
|
352
352
|
);
|
|
353
|
-
if (
|
|
354
|
-
|
|
353
|
+
if (a) {
|
|
354
|
+
a.focus();
|
|
355
355
|
return;
|
|
356
356
|
}
|
|
357
357
|
}
|
|
@@ -372,8 +372,8 @@ let l = class extends C(w) {
|
|
|
372
372
|
const f = this.resolveFocusable(r);
|
|
373
373
|
f && !this.isUnavailableElement(f) && o.push(f);
|
|
374
374
|
}
|
|
375
|
-
const
|
|
376
|
-
if (
|
|
375
|
+
const a = r.tagName.toLowerCase();
|
|
376
|
+
if (a === "o-icon-button" || a === "o-button") return;
|
|
377
377
|
if (r instanceof HTMLSlotElement) {
|
|
378
378
|
r.assignedElements({ flatten: !0 }).forEach(i);
|
|
379
379
|
return;
|
|
@@ -395,11 +395,11 @@ let l = class extends C(w) {
|
|
|
395
395
|
o && o.setAttribute("aria-modal", "true"), this.updateComplete.then(async () => {
|
|
396
396
|
var i, r;
|
|
397
397
|
if (this.showHeader && !t) {
|
|
398
|
-
const
|
|
399
|
-
|
|
400
|
-
const h = this.resolveFocusable(
|
|
401
|
-
(r = h == null ? void 0 : h.focus) == null || r.call(h, { preventScroll: !0 }), e || (
|
|
402
|
-
|
|
398
|
+
const a = (i = this.shadowRoot) == null ? void 0 : i.querySelector(".panel .close-btn");
|
|
399
|
+
a != null && a.updateComplete && await a.updateComplete;
|
|
400
|
+
const h = this.resolveFocusable(a);
|
|
401
|
+
(r = h == null ? void 0 : h.focus) == null || r.call(h, { preventScroll: !0 }), e || (a == null || a.classList.add("no-outline"), h == null || h.addEventListener("focusout", () => {
|
|
402
|
+
a == null || a.classList.remove("no-outline");
|
|
403
403
|
}, { once: !0 }));
|
|
404
404
|
} else
|
|
405
405
|
this.focusFirstInPanel();
|
|
@@ -456,9 +456,9 @@ let l = class extends C(w) {
|
|
|
456
456
|
}, 500);
|
|
457
457
|
}
|
|
458
458
|
render() {
|
|
459
|
-
const e = this.showHeader ?
|
|
459
|
+
const e = this.showHeader ? p`
|
|
460
460
|
<div tabindex="-1" part="header" class="header ${this.showDetail ? "detail-view-header" : ""}">
|
|
461
|
-
${this.showHeaderStartIcon ?
|
|
461
|
+
${this.showHeaderStartIcon ? p`
|
|
462
462
|
<o-icon-button
|
|
463
463
|
icon="arrowLeft"
|
|
464
464
|
size="small"
|
|
@@ -488,31 +488,31 @@ let l = class extends C(w) {
|
|
|
488
488
|
aria-describedby="panel-title"
|
|
489
489
|
></o-icon-button>
|
|
490
490
|
</div>
|
|
491
|
-
` : null, t = this.showFooter ?
|
|
491
|
+
` : null, t = this.showFooter ? p`
|
|
492
492
|
<div class="footer" part="footer">
|
|
493
|
-
${this.firstButtonVariant && this.firstButtonLabel ?
|
|
493
|
+
${this.firstButtonVariant && this.firstButtonLabel ? p`
|
|
494
494
|
<o-button
|
|
495
495
|
.variant=${this.firstButtonVariant}
|
|
496
496
|
@click=${this.handleFirstClick}
|
|
497
497
|
@keydown=${this.handleFirstClick}
|
|
498
|
-
${
|
|
498
|
+
${$(this.firstButtonProps)}
|
|
499
499
|
>
|
|
500
500
|
${this.firstButtonLabel}
|
|
501
501
|
</o-button>
|
|
502
502
|
` : null}
|
|
503
|
-
${this.secondButtonVariant && this.secondButtonLabel ?
|
|
503
|
+
${this.secondButtonVariant && this.secondButtonLabel ? p`
|
|
504
504
|
<o-button
|
|
505
505
|
.variant=${this.secondButtonVariant}
|
|
506
506
|
@click=${this.handleSecondClick}
|
|
507
507
|
@keydown=${this.handleSecondClick}
|
|
508
|
-
${
|
|
508
|
+
${$(this.secondButtonProps)}
|
|
509
509
|
>
|
|
510
510
|
${this.secondButtonLabel}
|
|
511
511
|
</o-button>
|
|
512
512
|
` : null}
|
|
513
513
|
</div>
|
|
514
514
|
` : null;
|
|
515
|
-
return
|
|
515
|
+
return p`
|
|
516
516
|
<div class="overlay" style="z-index: ${this.zIndex}" @click=${this.handleClosePanel}></div>
|
|
517
517
|
<div
|
|
518
518
|
class="panel"
|
|
@@ -528,7 +528,7 @@ let l = class extends C(w) {
|
|
|
528
528
|
|
|
529
529
|
<div part="content" class="content ${this.isHidingDetail ? "slide-out-right" : ""} ${this.showDetail ? "with-detail" : ""}">
|
|
530
530
|
|
|
531
|
-
${this.showDetail ?
|
|
531
|
+
${this.showDetail ? p`
|
|
532
532
|
<div class="detail-view">
|
|
533
533
|
${e}
|
|
534
534
|
<div class="detail-content">
|
|
@@ -537,7 +537,7 @@ let l = class extends C(w) {
|
|
|
537
537
|
</div>
|
|
538
538
|
</div>
|
|
539
539
|
</div>
|
|
540
|
-
` :
|
|
540
|
+
` : p`<slot></slot>`}
|
|
541
541
|
</div>
|
|
542
542
|
|
|
543
543
|
${this.stickyFooter ? null : t}
|
|
@@ -797,90 +797,90 @@ l.shadowRootOptions = {
|
|
|
797
797
|
// This helps send focus into the first focusable in shadow when host is focused
|
|
798
798
|
delegatesFocus: !0
|
|
799
799
|
};
|
|
800
|
-
|
|
801
|
-
|
|
800
|
+
d([
|
|
801
|
+
s({ type: Boolean, reflect: !0 })
|
|
802
802
|
], l.prototype, "open", 2);
|
|
803
|
-
|
|
804
|
-
|
|
803
|
+
d([
|
|
804
|
+
s({ type: Boolean })
|
|
805
805
|
], l.prototype, "showHeader", 2);
|
|
806
|
-
|
|
807
|
-
|
|
806
|
+
d([
|
|
807
|
+
s({ type: Boolean })
|
|
808
808
|
], l.prototype, "showFooter", 2);
|
|
809
|
-
|
|
810
|
-
|
|
809
|
+
d([
|
|
810
|
+
s({ type: Boolean })
|
|
811
811
|
], l.prototype, "showHeaderStartIcon", 2);
|
|
812
|
-
|
|
813
|
-
|
|
812
|
+
d([
|
|
813
|
+
s({ type: String })
|
|
814
814
|
], l.prototype, "headerTitle", 2);
|
|
815
|
-
|
|
816
|
-
|
|
815
|
+
d([
|
|
816
|
+
s({ type: String })
|
|
817
817
|
], l.prototype, "headerTitleClassName", 2);
|
|
818
|
-
|
|
819
|
-
|
|
818
|
+
d([
|
|
819
|
+
s({ type: String })
|
|
820
820
|
], l.prototype, "labelDialog", 2);
|
|
821
|
-
|
|
822
|
-
|
|
821
|
+
d([
|
|
822
|
+
s({ type: String })
|
|
823
823
|
], l.prototype, "labelAriaDialogPanel", 2);
|
|
824
|
-
|
|
825
|
-
|
|
824
|
+
d([
|
|
825
|
+
s({ type: String })
|
|
826
826
|
], l.prototype, "closeButtonLabel", 2);
|
|
827
|
-
|
|
828
|
-
|
|
827
|
+
d([
|
|
828
|
+
s({ type: String })
|
|
829
829
|
], l.prototype, "goBackButtonLabel", 2);
|
|
830
|
-
|
|
831
|
-
|
|
830
|
+
d([
|
|
831
|
+
s({ type: String })
|
|
832
832
|
], l.prototype, "firstButtonLabel", 2);
|
|
833
|
-
|
|
834
|
-
|
|
833
|
+
d([
|
|
834
|
+
s({ type: String })
|
|
835
835
|
], l.prototype, "firstButtonVariant", 2);
|
|
836
|
-
|
|
837
|
-
|
|
836
|
+
d([
|
|
837
|
+
s({ type: Object })
|
|
838
838
|
], l.prototype, "firstButtonProps", 2);
|
|
839
|
-
|
|
840
|
-
|
|
839
|
+
d([
|
|
840
|
+
s({ type: Boolean })
|
|
841
841
|
], l.prototype, "onFirstButtonClickClose", 2);
|
|
842
|
-
|
|
843
|
-
|
|
842
|
+
d([
|
|
843
|
+
s({ type: String })
|
|
844
844
|
], l.prototype, "secondButtonLabel", 2);
|
|
845
|
-
|
|
846
|
-
|
|
845
|
+
d([
|
|
846
|
+
s({ type: String })
|
|
847
847
|
], l.prototype, "secondButtonVariant", 2);
|
|
848
|
-
|
|
849
|
-
|
|
848
|
+
d([
|
|
849
|
+
s({ type: Object })
|
|
850
850
|
], l.prototype, "secondButtonProps", 2);
|
|
851
|
-
|
|
852
|
-
|
|
851
|
+
d([
|
|
852
|
+
s({ type: Boolean })
|
|
853
853
|
], l.prototype, "onSecondButtonClickClose", 2);
|
|
854
|
-
|
|
855
|
-
|
|
854
|
+
d([
|
|
855
|
+
s({ type: Boolean, reflect: !0 })
|
|
856
856
|
], l.prototype, "stickyFooter", 2);
|
|
857
|
-
|
|
858
|
-
|
|
857
|
+
d([
|
|
858
|
+
s({ type: Boolean })
|
|
859
859
|
], l.prototype, "disablePortal", 2);
|
|
860
|
-
|
|
861
|
-
|
|
860
|
+
d([
|
|
861
|
+
s({ type: Number })
|
|
862
862
|
], l.prototype, "zIndex", 2);
|
|
863
|
-
|
|
864
|
-
|
|
863
|
+
d([
|
|
864
|
+
s({ type: Boolean, reflect: !0 })
|
|
865
865
|
], l.prototype, "initialized", 2);
|
|
866
|
-
|
|
867
|
-
|
|
866
|
+
d([
|
|
867
|
+
s({ type: Boolean })
|
|
868
868
|
], l.prototype, "showDetail", 2);
|
|
869
|
-
|
|
870
|
-
|
|
869
|
+
d([
|
|
870
|
+
s({ type: Boolean })
|
|
871
871
|
], l.prototype, "isHidingDetail", 2);
|
|
872
|
-
l =
|
|
873
|
-
|
|
872
|
+
l = d([
|
|
873
|
+
C("o-side-panel")
|
|
874
874
|
], l);
|
|
875
|
-
var G = Object.defineProperty, Q = Object.getOwnPropertyDescriptor,
|
|
876
|
-
for (var i = n > 1 ? void 0 : n ? Q(t, o) : t, r = e.length - 1,
|
|
877
|
-
(
|
|
875
|
+
var G = Object.defineProperty, Q = Object.getOwnPropertyDescriptor, u = (e, t, o, n) => {
|
|
876
|
+
for (var i = n > 1 ? void 0 : n ? Q(t, o) : t, r = e.length - 1, a; r >= 0; r--)
|
|
877
|
+
(a = e[r]) && (i = (n ? a(t, o, i) : a(i)) || i);
|
|
878
878
|
return n && i && G(t, o, i), i;
|
|
879
879
|
};
|
|
880
|
-
const J =
|
|
881
|
-
let
|
|
880
|
+
const J = S(P(w)), lt = ["primary", "secondary", "ghost", "tertiary", "link"];
|
|
881
|
+
let c = class extends J {
|
|
882
882
|
constructor() {
|
|
883
|
-
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.ctatitle = "", this.underlined = !1, this.withbadge = !1, this.describedBy = null, this.ariaExpanded = null, this.updateDescription = () => {
|
|
883
|
+
super(...arguments), this.type = "submit", this.value = "", this.variant = "primary", this.template = "standard", 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.ctatitle = "", this.underlined = !1, this.withbadge = !1, this.describedBy = null, this.ariaExpanded = null, this.asButton = !1, this.updateDescription = () => {
|
|
884
884
|
const e = this.renderRoot.querySelector(".button"), t = this.describedBy || this.getAttribute("aria-describedby");
|
|
885
885
|
if (!e || !t) return;
|
|
886
886
|
const o = this.getRootNode();
|
|
@@ -900,11 +900,20 @@ let d = class extends J {
|
|
|
900
900
|
this.updateDescription();
|
|
901
901
|
}
|
|
902
902
|
handleClick(e) {
|
|
903
|
-
if (!(e instanceof KeyboardEvent && !["Enter", " "].includes(e.key))
|
|
904
|
-
|
|
905
|
-
|
|
903
|
+
if (!(e instanceof KeyboardEvent && !["Enter", " "].includes(e.key))) {
|
|
904
|
+
if (this.asButton && e instanceof KeyboardEvent && e.key === " ") {
|
|
905
|
+
e.preventDefault();
|
|
906
|
+
return;
|
|
907
|
+
}
|
|
908
|
+
if (this.panelTarget) {
|
|
909
|
+
const t = document.getElementById(this.panelTarget);
|
|
910
|
+
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.`);
|
|
911
|
+
}
|
|
906
912
|
}
|
|
907
913
|
}
|
|
914
|
+
handleLinkKeyUp(e) {
|
|
915
|
+
this.asButton && e.key === " " && (e.preventDefault(), e.currentTarget.click());
|
|
916
|
+
}
|
|
908
917
|
render() {
|
|
909
918
|
return this.href ? this.renderLink() : this.renderButton();
|
|
910
919
|
}
|
|
@@ -912,7 +921,7 @@ let d = class extends J {
|
|
|
912
921
|
var o, n;
|
|
913
922
|
super.connectedCallback(), this.addEventListener("focusin", this.updateDescription);
|
|
914
923
|
const e = (o = this.startIconModel) == null ? void 0 : o.startsWith("occ-"), t = (n = this.endIconModel) == null ? void 0 : n.startsWith("occ-");
|
|
915
|
-
(e || t) && (e &&
|
|
924
|
+
(e || t) && (e && k(this.startIconModel), t && k(this.endIconModel), this._unsubOcc = _(() => this.requestUpdate()));
|
|
916
925
|
}
|
|
917
926
|
disconnectedCallback() {
|
|
918
927
|
var e;
|
|
@@ -924,28 +933,29 @@ let d = class extends J {
|
|
|
924
933
|
const o = I[t] ?? "";
|
|
925
934
|
if (!o) return b;
|
|
926
935
|
const n = z(o);
|
|
927
|
-
return
|
|
936
|
+
return p`<span class="${e === "start" ? "icon-start" : "icon-end"}">${F(n)}</span>`;
|
|
928
937
|
}
|
|
929
938
|
renderButton() {
|
|
930
939
|
const e = this.text || this.textsecond;
|
|
931
|
-
return
|
|
940
|
+
return p`
|
|
932
941
|
<button type=${this.type} class="button" ?disabled=${this.disabled} @click=${this.handleClick} @keydown=${this.handleClick}
|
|
933
942
|
title=${this.ctatitle || b}
|
|
934
943
|
aria-expanded=${this.ariaExpanded || b} >
|
|
935
944
|
${this.startIcon ? this.renderIcon("start") : b}
|
|
936
|
-
${e ?
|
|
937
|
-
${this.text ?
|
|
938
|
-
${this.textsecond ?
|
|
939
|
-
${this.withbadge ?
|
|
940
|
-
` :
|
|
945
|
+
${e ? p`
|
|
946
|
+
${this.text ? p`<span class="text">${this.text}</span>` : b}
|
|
947
|
+
${this.textsecond ? p`<span class="text">${this.textsecond}</span>` : b}
|
|
948
|
+
${this.withbadge ? p`<slot></slot>` : b}
|
|
949
|
+
` : p`<slot></slot>`}
|
|
941
950
|
${this.endIcon ? this.renderIcon("end") : b}
|
|
942
951
|
</button>
|
|
943
952
|
`;
|
|
944
953
|
}
|
|
945
954
|
renderLink() {
|
|
946
955
|
const e = this.text || this.textsecond;
|
|
947
|
-
return
|
|
956
|
+
return p`
|
|
948
957
|
<a
|
|
958
|
+
role=${this.asButton ? "button" : b}
|
|
949
959
|
href=${this.href}
|
|
950
960
|
target=${this.target || b}
|
|
951
961
|
title=${this.ctatitle || b}
|
|
@@ -953,20 +963,21 @@ let d = class extends J {
|
|
|
953
963
|
?disabled=${this.disabled}
|
|
954
964
|
@click=${this.handleClick}
|
|
955
965
|
@keydown=${this.handleClick}
|
|
966
|
+
@keyup=${this.handleLinkKeyUp}
|
|
956
967
|
>
|
|
957
968
|
${this.startIcon ? this.renderIcon("start") : b}
|
|
958
|
-
${e ?
|
|
959
|
-
${this.text ?
|
|
960
|
-
${this.textsecond ?
|
|
961
|
-
` :
|
|
969
|
+
${e ? p`
|
|
970
|
+
${this.text ? p`<span>${this.text}</span>` : b}
|
|
971
|
+
${this.textsecond ? p`<span>${this.textsecond}</span>` : b}
|
|
972
|
+
` : p`<slot></slot>`}
|
|
962
973
|
${this.endIcon ? this.renderIcon("end") : b}
|
|
963
974
|
</a>
|
|
964
975
|
`;
|
|
965
976
|
}
|
|
966
977
|
};
|
|
967
|
-
q(
|
|
968
|
-
|
|
969
|
-
|
|
978
|
+
q(c);
|
|
979
|
+
c.formAssociated = !0;
|
|
980
|
+
c.styles = E`
|
|
970
981
|
:host {
|
|
971
982
|
--button-border: transparent;
|
|
972
983
|
--badge-outer-width: 19px;
|
|
@@ -1080,6 +1091,15 @@ d.styles = E`
|
|
|
1080
1091
|
opacity: 0;
|
|
1081
1092
|
}
|
|
1082
1093
|
|
|
1094
|
+
:host([variant="link"][template="discret"]) .button,
|
|
1095
|
+
:host([variant="link"][template="discret"]) .button span {
|
|
1096
|
+
font-family: var(--font-family-loccitane-sans);
|
|
1097
|
+
font-size: var(--font-size-150);
|
|
1098
|
+
font-weight: var(--font-weight-400);
|
|
1099
|
+
line-height: var(--line-height-200);
|
|
1100
|
+
letter-spacing: 0;
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1083
1103
|
:host([disabled]),
|
|
1084
1104
|
:host([aria-disabled="true"]),
|
|
1085
1105
|
:host([aria-disabled="true"]:hover) {
|
|
@@ -1221,68 +1241,74 @@ d.styles = E`
|
|
|
1221
1241
|
transform: translateX(4px);
|
|
1222
1242
|
}
|
|
1223
1243
|
`;
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
],
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
],
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
],
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
],
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
],
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
],
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
],
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
],
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
],
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
],
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
],
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
],
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
],
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
],
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
],
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
],
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
],
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
],
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
],
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
],
|
|
1244
|
+
u([
|
|
1245
|
+
s()
|
|
1246
|
+
], c.prototype, "type", 2);
|
|
1247
|
+
u([
|
|
1248
|
+
s()
|
|
1249
|
+
], c.prototype, "value", 2);
|
|
1250
|
+
u([
|
|
1251
|
+
s({ type: String, reflect: !0 })
|
|
1252
|
+
], c.prototype, "variant", 2);
|
|
1253
|
+
u([
|
|
1254
|
+
s({ type: String, reflect: !0 })
|
|
1255
|
+
], c.prototype, "template", 2);
|
|
1256
|
+
u([
|
|
1257
|
+
s({ type: String })
|
|
1258
|
+
], c.prototype, "text", 2);
|
|
1259
|
+
u([
|
|
1260
|
+
s({ type: String })
|
|
1261
|
+
], c.prototype, "textsecond", 2);
|
|
1262
|
+
u([
|
|
1263
|
+
s({ type: Boolean, reflect: !0 })
|
|
1264
|
+
], c.prototype, "fullwidth", 2);
|
|
1265
|
+
u([
|
|
1266
|
+
s({ type: Boolean, reflect: !0 })
|
|
1267
|
+
], c.prototype, "disabled", 2);
|
|
1268
|
+
u([
|
|
1269
|
+
s({ type: String })
|
|
1270
|
+
], c.prototype, "startIconModel", 2);
|
|
1271
|
+
u([
|
|
1272
|
+
s({ type: String })
|
|
1273
|
+
], c.prototype, "endIconModel", 2);
|
|
1274
|
+
u([
|
|
1275
|
+
s({ type: Boolean, reflect: !0, attribute: "starticon" })
|
|
1276
|
+
], c.prototype, "startIcon", 2);
|
|
1277
|
+
u([
|
|
1278
|
+
s({ type: Boolean, reflect: !0, attribute: "endicon" })
|
|
1279
|
+
], c.prototype, "endIcon", 2);
|
|
1280
|
+
u([
|
|
1281
|
+
s({ type: String, attribute: "paneltarget" })
|
|
1282
|
+
], c.prototype, "panelTarget", 2);
|
|
1283
|
+
u([
|
|
1284
|
+
s({ type: String })
|
|
1285
|
+
], c.prototype, "href", 2);
|
|
1286
|
+
u([
|
|
1287
|
+
s({ type: String })
|
|
1288
|
+
], c.prototype, "target", 2);
|
|
1289
|
+
u([
|
|
1290
|
+
s({ type: String })
|
|
1291
|
+
], c.prototype, "ctatitle", 2);
|
|
1292
|
+
u([
|
|
1293
|
+
s({ type: Boolean, reflect: !0 })
|
|
1294
|
+
], c.prototype, "underlined", 2);
|
|
1295
|
+
u([
|
|
1296
|
+
s({ type: Boolean, reflect: !0 })
|
|
1297
|
+
], c.prototype, "withbadge", 2);
|
|
1298
|
+
u([
|
|
1299
|
+
s({ reflect: !0, attribute: "describedby" })
|
|
1300
|
+
], c.prototype, "describedBy", 2);
|
|
1301
|
+
u([
|
|
1302
|
+
s({ reflect: !0, attribute: "expanded" })
|
|
1303
|
+
], c.prototype, "ariaExpanded", 2);
|
|
1304
|
+
u([
|
|
1305
|
+
s({ type: Boolean, attribute: "asbutton" })
|
|
1306
|
+
], c.prototype, "asButton", 2);
|
|
1307
|
+
c = u([
|
|
1308
|
+
C("o-button")
|
|
1309
|
+
], c);
|
|
1284
1310
|
export {
|
|
1285
|
-
|
|
1311
|
+
c as O,
|
|
1286
1312
|
l as OccitaneSidePanel,
|
|
1287
1313
|
lt as v
|
|
1288
1314
|
};
|
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__ = "4.1.
|
|
7
|
+
globalThis.__FLORID_KIT__ = "4.1.2";
|
|
8
8
|
const i = {
|
|
9
9
|
"o-accordion": () => import("./components/accordion.mjs"),
|
|
10
10
|
"o-accordion-group": () => import("./components/accordion-group.mjs"),
|