@florid-kit/components 3.3.0 → 3.3.1
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 +2 -0
- package/components/side-panel.mjs +73 -66
- package/index.mjs +1 -1
- package/loader.mjs +1 -1
- package/package.json +1 -1
package/components/button.d.ts
CHANGED
|
@@ -29,6 +29,8 @@ export declare class OccitaneButton extends buttonBaseClass implements FormSubmi
|
|
|
29
29
|
withbadge: boolean;
|
|
30
30
|
describedBy: string | null;
|
|
31
31
|
ariaExpanded: string | null;
|
|
32
|
+
private updateDescription;
|
|
33
|
+
protected updated(): void;
|
|
32
34
|
private handleClick;
|
|
33
35
|
protected render(): import('lit').TemplateResult<1>;
|
|
34
36
|
private _unsubOcc?;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as
|
|
1
|
+
import { E as b, i as E, a as w, m as C, x as u, t as S } from "../performance-mixin-D7YmSeqN.mjs";
|
|
2
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 D, m as P } from "../element-internals-Dw7LndlH.mjs";
|
|
@@ -77,7 +77,7 @@ function M(e, t = !1, o = 0) {
|
|
|
77
77
|
const K = (e) => {
|
|
78
78
|
e.type == O.CHILD && (e._$AP ?? (e._$AP = M), e._$AQ ?? (e._$AQ = H));
|
|
79
79
|
};
|
|
80
|
-
class
|
|
80
|
+
class N extends L {
|
|
81
81
|
constructor() {
|
|
82
82
|
super(...arguments), this._$AN = void 0;
|
|
83
83
|
}
|
|
@@ -100,12 +100,12 @@ class j extends L {
|
|
|
100
100
|
reconnected() {
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
class
|
|
103
|
+
class j extends N {
|
|
104
104
|
constructor() {
|
|
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
111
|
var n;
|
|
@@ -127,7 +127,7 @@ class N extends j {
|
|
|
127
127
|
(!t || !(i in t) && n[i] === o[i]) && (n[i] = void 0);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
class V extends
|
|
130
|
+
class V extends j {
|
|
131
131
|
constructor() {
|
|
132
132
|
super(...arguments), this.eventData = {};
|
|
133
133
|
}
|
|
@@ -226,7 +226,7 @@ var U = Object.defineProperty, W = Object.getOwnPropertyDescriptor, c = (e, t, o
|
|
|
226
226
|
(s = e[r]) && (i = (n ? s(t, o, i) : s(i)) || i);
|
|
227
227
|
return n && i && U(t, o, i), i;
|
|
228
228
|
};
|
|
229
|
-
let l = class extends
|
|
229
|
+
let l = class extends C(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;
|
|
@@ -456,9 +456,9 @@ let l = class extends E(w) {
|
|
|
456
456
|
}, 500);
|
|
457
457
|
}
|
|
458
458
|
render() {
|
|
459
|
-
const e = this.showHeader ?
|
|
459
|
+
const e = this.showHeader ? u`
|
|
460
460
|
<div tabindex="-1" part="header" class="header ${this.showDetail ? "detail-view-header" : ""}">
|
|
461
|
-
${this.showHeaderStartIcon ?
|
|
461
|
+
${this.showHeaderStartIcon ? u`
|
|
462
462
|
<o-icon-button
|
|
463
463
|
icon="arrowLeft"
|
|
464
464
|
size="small"
|
|
@@ -488,9 +488,9 @@ let l = class extends E(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 ? u`
|
|
492
492
|
<div class="footer" part="footer">
|
|
493
|
-
${this.firstButtonVariant && this.firstButtonLabel ?
|
|
493
|
+
${this.firstButtonVariant && this.firstButtonLabel ? u`
|
|
494
494
|
<o-button
|
|
495
495
|
.variant=${this.firstButtonVariant}
|
|
496
496
|
@click=${this.handleFirstClick}
|
|
@@ -500,7 +500,7 @@ let l = class extends E(w) {
|
|
|
500
500
|
${this.firstButtonLabel}
|
|
501
501
|
</o-button>
|
|
502
502
|
` : null}
|
|
503
|
-
${this.secondButtonVariant && this.secondButtonLabel ?
|
|
503
|
+
${this.secondButtonVariant && this.secondButtonLabel ? u`
|
|
504
504
|
<o-button
|
|
505
505
|
.variant=${this.secondButtonVariant}
|
|
506
506
|
@click=${this.handleSecondClick}
|
|
@@ -512,14 +512,14 @@ let l = class extends E(w) {
|
|
|
512
512
|
` : null}
|
|
513
513
|
</div>
|
|
514
514
|
` : null;
|
|
515
|
-
return
|
|
515
|
+
return u`
|
|
516
516
|
<div class="overlay" style="z-index: ${this.zIndex}" @click=${this.handleClosePanel}></div>
|
|
517
517
|
<div
|
|
518
518
|
class="panel"
|
|
519
519
|
role="dialog"
|
|
520
520
|
aria-modal="true"
|
|
521
|
-
aria-label="${this.labelAriaDialogPanel ||
|
|
522
|
-
aria-labelledby="${this.labelAriaDialogPanel ?
|
|
521
|
+
aria-label="${this.labelAriaDialogPanel || b}"
|
|
522
|
+
aria-labelledby="${this.labelAriaDialogPanel ? b : "panel-title"}"
|
|
523
523
|
style="z-index: ${this.zIndex + 1}"
|
|
524
524
|
tabindex="-1"
|
|
525
525
|
>
|
|
@@ -528,7 +528,7 @@ let l = class extends E(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 ? u`
|
|
532
532
|
<div class="detail-view">
|
|
533
533
|
${e}
|
|
534
534
|
<div class="detail-content">
|
|
@@ -537,7 +537,7 @@ let l = class extends E(w) {
|
|
|
537
537
|
</div>
|
|
538
538
|
</div>
|
|
539
539
|
</div>
|
|
540
|
-
` :
|
|
540
|
+
` : u`<slot></slot>`}
|
|
541
541
|
</div>
|
|
542
542
|
|
|
543
543
|
${this.stickyFooter ? null : t}
|
|
@@ -547,7 +547,7 @@ let l = class extends E(w) {
|
|
|
547
547
|
`;
|
|
548
548
|
}
|
|
549
549
|
};
|
|
550
|
-
l.styles =
|
|
550
|
+
l.styles = E`
|
|
551
551
|
:host {
|
|
552
552
|
--z-overlay: 99;
|
|
553
553
|
--z-panel: 100;
|
|
@@ -872,15 +872,20 @@ c([
|
|
|
872
872
|
l = c([
|
|
873
873
|
S("o-side-panel")
|
|
874
874
|
], l);
|
|
875
|
-
var G = Object.defineProperty, Q = Object.getOwnPropertyDescriptor,
|
|
875
|
+
var G = Object.defineProperty, Q = Object.getOwnPropertyDescriptor, p = (e, t, o, n) => {
|
|
876
876
|
for (var i = n > 1 ? void 0 : n ? Q(t, o) : t, r = e.length - 1, s; r >= 0; r--)
|
|
877
877
|
(s = e[r]) && (i = (n ? s(t, o, i) : s(i)) || i);
|
|
878
878
|
return n && i && G(t, o, i), i;
|
|
879
879
|
};
|
|
880
|
-
const J =
|
|
880
|
+
const J = C(P(w)), lt = ["primary", "secondary", "ghost", "tertiary", "link"];
|
|
881
881
|
let d = 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
|
|
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 = () => {
|
|
884
|
+
const e = this.renderRoot.querySelector(".button"), t = this.describedBy || this.getAttribute("aria-describedby");
|
|
885
|
+
if (!e || !t) return;
|
|
886
|
+
const o = this.getRootNode();
|
|
887
|
+
e.ariaDescribedByElements = t.split(/\s+/).map((n) => n && o.getElementById(n)).filter((n) => !!n);
|
|
888
|
+
};
|
|
884
889
|
}
|
|
885
890
|
get name() {
|
|
886
891
|
return this.getAttribute("name") ?? "";
|
|
@@ -891,6 +896,9 @@ let d = class extends J {
|
|
|
891
896
|
get form() {
|
|
892
897
|
return this[D].form;
|
|
893
898
|
}
|
|
899
|
+
updated() {
|
|
900
|
+
this.updateDescription();
|
|
901
|
+
}
|
|
894
902
|
handleClick(e) {
|
|
895
903
|
if (!(e instanceof KeyboardEvent && !["Enter", " "].includes(e.key)) && this.panelTarget) {
|
|
896
904
|
const t = document.getElementById(this.panelTarget);
|
|
@@ -902,64 +910,63 @@ let d = class extends J {
|
|
|
902
910
|
}
|
|
903
911
|
connectedCallback() {
|
|
904
912
|
var o, n;
|
|
905
|
-
super.connectedCallback();
|
|
913
|
+
super.connectedCallback(), this.addEventListener("focusin", this.updateDescription);
|
|
906
914
|
const e = (o = this.startIconModel) == null ? void 0 : o.startsWith("occ-"), t = (n = this.endIconModel) == null ? void 0 : n.startsWith("occ-");
|
|
907
915
|
(e || t) && (e && $(this.startIconModel), t && $(this.endIconModel), this._unsubOcc = _(() => this.requestUpdate()));
|
|
908
916
|
}
|
|
909
917
|
disconnectedCallback() {
|
|
910
918
|
var e;
|
|
911
|
-
(e = this._unsubOcc) == null || e.call(this), super.disconnectedCallback();
|
|
919
|
+
this.removeEventListener("focusin", this.updateDescription), (e = this._unsubOcc) == null || e.call(this), super.disconnectedCallback();
|
|
912
920
|
}
|
|
913
921
|
renderIcon(e) {
|
|
914
922
|
const t = e === "start" ? this.startIconModel : this.endIconModel;
|
|
915
|
-
if (!t) return
|
|
923
|
+
if (!t) return b;
|
|
916
924
|
const o = I[t] ?? "";
|
|
917
|
-
if (!o) return
|
|
925
|
+
if (!o) return b;
|
|
918
926
|
const n = z(o);
|
|
919
|
-
return
|
|
927
|
+
return u`<span class="${e === "start" ? "icon-start" : "icon-end"}">${F(n)}</span>`;
|
|
920
928
|
}
|
|
921
929
|
renderButton() {
|
|
922
930
|
const e = this.text || this.textsecond;
|
|
923
|
-
return
|
|
931
|
+
return u`
|
|
924
932
|
<button type=${this.type} class="button" ?disabled=${this.disabled} @click=${this.handleClick} @keydown=${this.handleClick}
|
|
925
|
-
title=${this.ctatitle ||
|
|
926
|
-
aria-
|
|
927
|
-
${this.startIcon ? this.renderIcon("start") :
|
|
928
|
-
${e ?
|
|
929
|
-
${this.text ?
|
|
930
|
-
${this.textsecond ?
|
|
931
|
-
${this.withbadge ?
|
|
932
|
-
` :
|
|
933
|
-
${this.endIcon ? this.renderIcon("end") :
|
|
933
|
+
title=${this.ctatitle || b}
|
|
934
|
+
aria-expanded=${this.ariaExpanded || b} >
|
|
935
|
+
${this.startIcon ? this.renderIcon("start") : b}
|
|
936
|
+
${e ? u`
|
|
937
|
+
${this.text ? u`<span class="text">${this.text}</span>` : b}
|
|
938
|
+
${this.textsecond ? u`<span class="text">${this.textsecond}</span>` : b}
|
|
939
|
+
${this.withbadge ? u`<slot></slot>` : b}
|
|
940
|
+
` : u`<slot></slot>`}
|
|
941
|
+
${this.endIcon ? this.renderIcon("end") : b}
|
|
934
942
|
</button>
|
|
935
943
|
`;
|
|
936
944
|
}
|
|
937
945
|
renderLink() {
|
|
938
946
|
const e = this.text || this.textsecond;
|
|
939
|
-
return
|
|
947
|
+
return u`
|
|
940
948
|
<a
|
|
941
949
|
href=${this.href}
|
|
942
|
-
target=${this.target ||
|
|
943
|
-
title=${this.ctatitle ||
|
|
950
|
+
target=${this.target || b}
|
|
951
|
+
title=${this.ctatitle || b}
|
|
944
952
|
class="button"
|
|
945
953
|
?disabled=${this.disabled}
|
|
946
954
|
@click=${this.handleClick}
|
|
947
955
|
@keydown=${this.handleClick}
|
|
948
|
-
aria-describedby=${this.describedBy || u}
|
|
949
956
|
>
|
|
950
|
-
${this.startIcon ? this.renderIcon("start") :
|
|
951
|
-
${e ?
|
|
952
|
-
${this.text ?
|
|
953
|
-
${this.textsecond ?
|
|
954
|
-
` :
|
|
955
|
-
${this.endIcon ? this.renderIcon("end") :
|
|
957
|
+
${this.startIcon ? this.renderIcon("start") : b}
|
|
958
|
+
${e ? u`
|
|
959
|
+
${this.text ? u`<span>${this.text}</span>` : b}
|
|
960
|
+
${this.textsecond ? u`<span>${this.textsecond}</span>` : b}
|
|
961
|
+
` : u`<slot></slot>`}
|
|
962
|
+
${this.endIcon ? this.renderIcon("end") : b}
|
|
956
963
|
</a>
|
|
957
964
|
`;
|
|
958
965
|
}
|
|
959
966
|
};
|
|
960
967
|
q(d);
|
|
961
968
|
d.formAssociated = !0;
|
|
962
|
-
d.styles =
|
|
969
|
+
d.styles = E`
|
|
963
970
|
:host {
|
|
964
971
|
--button-border: transparent;
|
|
965
972
|
--badge-outer-width: 19px;
|
|
@@ -1214,64 +1221,64 @@ d.styles = C`
|
|
|
1214
1221
|
transform: translateX(4px);
|
|
1215
1222
|
}
|
|
1216
1223
|
`;
|
|
1217
|
-
|
|
1224
|
+
p([
|
|
1218
1225
|
a()
|
|
1219
1226
|
], d.prototype, "type", 2);
|
|
1220
|
-
|
|
1227
|
+
p([
|
|
1221
1228
|
a()
|
|
1222
1229
|
], d.prototype, "value", 2);
|
|
1223
|
-
|
|
1230
|
+
p([
|
|
1224
1231
|
a({ type: String, reflect: !0 })
|
|
1225
1232
|
], d.prototype, "variant", 2);
|
|
1226
|
-
|
|
1233
|
+
p([
|
|
1227
1234
|
a({ type: String })
|
|
1228
1235
|
], d.prototype, "text", 2);
|
|
1229
|
-
|
|
1236
|
+
p([
|
|
1230
1237
|
a({ type: String })
|
|
1231
1238
|
], d.prototype, "textsecond", 2);
|
|
1232
|
-
|
|
1239
|
+
p([
|
|
1233
1240
|
a({ type: Boolean, reflect: !0 })
|
|
1234
1241
|
], d.prototype, "fullwidth", 2);
|
|
1235
|
-
|
|
1242
|
+
p([
|
|
1236
1243
|
a({ type: Boolean, reflect: !0 })
|
|
1237
1244
|
], d.prototype, "disabled", 2);
|
|
1238
|
-
|
|
1245
|
+
p([
|
|
1239
1246
|
a({ type: String })
|
|
1240
1247
|
], d.prototype, "startIconModel", 2);
|
|
1241
|
-
|
|
1248
|
+
p([
|
|
1242
1249
|
a({ type: String })
|
|
1243
1250
|
], d.prototype, "endIconModel", 2);
|
|
1244
|
-
|
|
1251
|
+
p([
|
|
1245
1252
|
a({ type: Boolean, reflect: !0, attribute: "starticon" })
|
|
1246
1253
|
], d.prototype, "startIcon", 2);
|
|
1247
|
-
|
|
1254
|
+
p([
|
|
1248
1255
|
a({ type: Boolean, reflect: !0, attribute: "endicon" })
|
|
1249
1256
|
], d.prototype, "endIcon", 2);
|
|
1250
|
-
|
|
1257
|
+
p([
|
|
1251
1258
|
a({ type: String, attribute: "paneltarget" })
|
|
1252
1259
|
], d.prototype, "panelTarget", 2);
|
|
1253
|
-
|
|
1260
|
+
p([
|
|
1254
1261
|
a({ type: String })
|
|
1255
1262
|
], d.prototype, "href", 2);
|
|
1256
|
-
|
|
1263
|
+
p([
|
|
1257
1264
|
a({ type: String })
|
|
1258
1265
|
], d.prototype, "target", 2);
|
|
1259
|
-
|
|
1266
|
+
p([
|
|
1260
1267
|
a({ type: String })
|
|
1261
1268
|
], d.prototype, "ctatitle", 2);
|
|
1262
|
-
|
|
1269
|
+
p([
|
|
1263
1270
|
a({ type: Boolean, reflect: !0 })
|
|
1264
1271
|
], d.prototype, "underlined", 2);
|
|
1265
|
-
|
|
1272
|
+
p([
|
|
1266
1273
|
a({ type: Boolean, reflect: !0 })
|
|
1267
1274
|
], d.prototype, "withbadge", 2);
|
|
1268
|
-
|
|
1275
|
+
p([
|
|
1269
1276
|
a({ reflect: !0, attribute: "describedby" })
|
|
1270
1277
|
], d.prototype, "describedBy", 2);
|
|
1271
|
-
|
|
1278
|
+
p([
|
|
1272
1279
|
a({ reflect: !0, attribute: "expanded" })
|
|
1273
1280
|
], d.prototype, "ariaExpanded", 2);
|
|
1274
|
-
d =
|
|
1281
|
+
d = p([
|
|
1275
1282
|
S("o-button")
|
|
1276
1283
|
], d);
|
|
1277
1284
|
export {
|
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.3.
|
|
7
|
+
globalThis.__FLORID_KIT__ = "3.3.1";
|
|
8
8
|
const i = {
|
|
9
9
|
"o-accordion": () => import("./components/accordion.mjs"),
|
|
10
10
|
"o-accordion-group": () => import("./components/accordion-group.mjs"),
|