@proximus/lavender 1.4.7-alpha.4 → 1.4.7-alpha.6
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/dist/lavender.cjs.js +1 -1
- package/dist/lavender.es.js +111 -46
- package/dist/lavender.umd.js +1 -1
- package/package.json +1 -1
package/dist/lavender.es.js
CHANGED
|
@@ -7873,7 +7873,7 @@ class CellRadio extends WithExtraAttributes {
|
|
|
7873
7873
|
}
|
|
7874
7874
|
connectedCallback() {
|
|
7875
7875
|
var _a;
|
|
7876
|
-
this.tabIndex = ((_a = this.parentElement) == null ? void 0 : _a.
|
|
7876
|
+
this.tabIndex = ((_a = this.parentElement) == null ? void 0 : _a.querySelector("px-cell-radio")) === this ? 0 : -1;
|
|
7877
7877
|
this.role = "radio";
|
|
7878
7878
|
if (this.internals) {
|
|
7879
7879
|
this.internals.role = "radio";
|
|
@@ -9570,19 +9570,14 @@ class Drawer extends HTMLElement {
|
|
|
9570
9570
|
connectedCallback() {
|
|
9571
9571
|
var _a;
|
|
9572
9572
|
this.toggleFooterVisibility = this.toggleFooterVisibility.bind(this);
|
|
9573
|
-
if (
|
|
9574
|
-
this.
|
|
9573
|
+
if (this.$opener) {
|
|
9574
|
+
this.addOpenListener();
|
|
9575
9575
|
}
|
|
9576
|
-
if (this
|
|
9577
|
-
|
|
9578
|
-
`#${this.getAttribute("closedby")}`
|
|
9579
|
-
);
|
|
9580
|
-
$closer == null ? void 0 : $closer.addEventListener("click", () => {
|
|
9581
|
-
this.hide();
|
|
9582
|
-
});
|
|
9576
|
+
if (this.$closer) {
|
|
9577
|
+
this.addCloseListener();
|
|
9583
9578
|
}
|
|
9584
|
-
if (this.hasAttribute("
|
|
9585
|
-
this.
|
|
9579
|
+
if (!this.hasAttribute("showfrom")) {
|
|
9580
|
+
this.setAttribute("showfrom", "bottom");
|
|
9586
9581
|
}
|
|
9587
9582
|
this.$closeButton.addEventListener("click", () => {
|
|
9588
9583
|
this.hide();
|
|
@@ -9594,36 +9589,56 @@ class Drawer extends HTMLElement {
|
|
|
9594
9589
|
);
|
|
9595
9590
|
}
|
|
9596
9591
|
static get observedAttributes() {
|
|
9597
|
-
return ["open", "aria-label-close-button", "openedby"];
|
|
9592
|
+
return ["open", "aria-label-close-button", "openedby", "closedby"];
|
|
9598
9593
|
}
|
|
9599
|
-
attributeChangedCallback(
|
|
9594
|
+
attributeChangedCallback(attrName, oldValue, newValue) {
|
|
9600
9595
|
var _a, _b, _c;
|
|
9601
|
-
|
|
9602
|
-
|
|
9603
|
-
|
|
9604
|
-
|
|
9605
|
-
|
|
9606
|
-
|
|
9607
|
-
|
|
9608
|
-
|
|
9609
|
-
|
|
9610
|
-
|
|
9611
|
-
|
|
9612
|
-
|
|
9613
|
-
|
|
9614
|
-
|
|
9615
|
-
|
|
9616
|
-
|
|
9617
|
-
|
|
9618
|
-
|
|
9596
|
+
switch (attrName) {
|
|
9597
|
+
case "open":
|
|
9598
|
+
if (newValue !== null) {
|
|
9599
|
+
this.show();
|
|
9600
|
+
} else {
|
|
9601
|
+
this.hide();
|
|
9602
|
+
}
|
|
9603
|
+
break;
|
|
9604
|
+
case "aria-label-close-button":
|
|
9605
|
+
if (!newValue) {
|
|
9606
|
+
(_a = this.$closeButton) == null ? void 0 : _a.removeAttribute("aria-label");
|
|
9607
|
+
} else {
|
|
9608
|
+
(_c = (_b = this.$closeButton) == null ? void 0 : _b.setAttribute) == null ? void 0 : _c.call(
|
|
9609
|
+
_b,
|
|
9610
|
+
"aria-label",
|
|
9611
|
+
newValue || "Close drawer"
|
|
9612
|
+
);
|
|
9613
|
+
}
|
|
9614
|
+
break;
|
|
9615
|
+
case "openedby":
|
|
9616
|
+
if (newValue !== oldValue) {
|
|
9617
|
+
if (oldValue) {
|
|
9618
|
+
const oldOpener = document.querySelector(`#${oldValue}`);
|
|
9619
|
+
oldOpener == null ? void 0 : oldOpener.removeEventListener("click", () => this.show());
|
|
9620
|
+
}
|
|
9621
|
+
this.addOpenListener();
|
|
9622
|
+
}
|
|
9623
|
+
break;
|
|
9624
|
+
case "closedby":
|
|
9625
|
+
this.addCloseListener();
|
|
9626
|
+
break;
|
|
9619
9627
|
}
|
|
9620
9628
|
}
|
|
9621
9629
|
disconnectedCallback() {
|
|
9622
|
-
var _a;
|
|
9630
|
+
var _a, _b;
|
|
9623
9631
|
(_a = this.$slotFooter) == null ? void 0 : _a.removeEventListener(
|
|
9624
9632
|
"slotchange",
|
|
9625
9633
|
this.toggleFooterVisibility
|
|
9626
9634
|
);
|
|
9635
|
+
(_b = this.observer) == null ? void 0 : _b.disconnect();
|
|
9636
|
+
if (this.$opener) {
|
|
9637
|
+
this.$opener.removeEventListener("click", () => this.show());
|
|
9638
|
+
}
|
|
9639
|
+
if (this.$closer) {
|
|
9640
|
+
this.$closer.removeEventListener("click", () => this.hide());
|
|
9641
|
+
}
|
|
9627
9642
|
}
|
|
9628
9643
|
show() {
|
|
9629
9644
|
var _a, _b;
|
|
@@ -9649,15 +9664,41 @@ class Drawer extends HTMLElement {
|
|
|
9649
9664
|
}
|
|
9650
9665
|
}
|
|
9651
9666
|
addOpenListener() {
|
|
9652
|
-
|
|
9653
|
-
|
|
9654
|
-
|
|
9655
|
-
|
|
9667
|
+
if (this.$opener) {
|
|
9668
|
+
if (this.$opener.getAttribute("data-has-opener") !== "true") {
|
|
9669
|
+
this.$opener.setAttribute("data-has-opener", "true");
|
|
9670
|
+
this.$opener.addEventListener("click", () => this.show());
|
|
9671
|
+
}
|
|
9672
|
+
} else {
|
|
9673
|
+
this.observer = new MutationObserver(() => {
|
|
9674
|
+
if (this.$opener) {
|
|
9675
|
+
this.observer.disconnect();
|
|
9676
|
+
this.observer = null;
|
|
9677
|
+
this.addOpenListener();
|
|
9678
|
+
}
|
|
9679
|
+
});
|
|
9680
|
+
this.observer.observe(document.body, {
|
|
9681
|
+
childList: true,
|
|
9682
|
+
subtree: true
|
|
9683
|
+
});
|
|
9684
|
+
}
|
|
9685
|
+
}
|
|
9686
|
+
addCloseListener() {
|
|
9687
|
+
var _a;
|
|
9688
|
+
if (this.$closer) {
|
|
9689
|
+
(_a = this.$closer) == null ? void 0 : _a.addEventListener("click", () => {
|
|
9690
|
+
this.hide();
|
|
9691
|
+
});
|
|
9656
9692
|
}
|
|
9657
9693
|
}
|
|
9658
9694
|
get $opener() {
|
|
9659
9695
|
return document.querySelector(
|
|
9660
|
-
|
|
9696
|
+
`#${this.getAttribute("openedby")}`
|
|
9697
|
+
);
|
|
9698
|
+
}
|
|
9699
|
+
get $closer() {
|
|
9700
|
+
return document.querySelector(
|
|
9701
|
+
`#${this.getAttribute("closedby")}`
|
|
9661
9702
|
);
|
|
9662
9703
|
}
|
|
9663
9704
|
get $closeButton() {
|
|
@@ -9687,10 +9728,10 @@ class Drawer extends HTMLElement {
|
|
|
9687
9728
|
this.removeAttribute("open");
|
|
9688
9729
|
}
|
|
9689
9730
|
}
|
|
9690
|
-
get
|
|
9731
|
+
get AriaLabelCloseButton() {
|
|
9691
9732
|
return this.getAttribute("aria-label-close-button");
|
|
9692
9733
|
}
|
|
9693
|
-
set
|
|
9734
|
+
set AriaLabelCloseButton(value) {
|
|
9694
9735
|
this.setAttribute("aria-label-close-button", value);
|
|
9695
9736
|
}
|
|
9696
9737
|
get openedby() {
|
|
@@ -9699,6 +9740,12 @@ class Drawer extends HTMLElement {
|
|
|
9699
9740
|
set openedby(value) {
|
|
9700
9741
|
this.setAttribute("openedby", value);
|
|
9701
9742
|
}
|
|
9743
|
+
get closedby() {
|
|
9744
|
+
return this.getAttribute("closedby");
|
|
9745
|
+
}
|
|
9746
|
+
set closedby(value) {
|
|
9747
|
+
this.setAttribute("closedby", value);
|
|
9748
|
+
}
|
|
9702
9749
|
}
|
|
9703
9750
|
if (!customElements.get("px-drawer")) {
|
|
9704
9751
|
customElements.define("px-drawer", Drawer);
|
|
@@ -12693,6 +12740,7 @@ class Modal extends HTMLElement {
|
|
|
12693
12740
|
this.onOpenClick = () => this.show();
|
|
12694
12741
|
this.onCloseClick = () => this.close();
|
|
12695
12742
|
this.commandButtonCleanups = [];
|
|
12743
|
+
this.opener = null;
|
|
12696
12744
|
this.openerElement = null;
|
|
12697
12745
|
this.closerElement = null;
|
|
12698
12746
|
this.template = `<dialog>
|
|
@@ -12897,12 +12945,29 @@ class Modal extends HTMLElement {
|
|
|
12897
12945
|
addOpenListener() {
|
|
12898
12946
|
var _a;
|
|
12899
12947
|
this.removeOpenListener();
|
|
12900
|
-
|
|
12901
|
-
|
|
12948
|
+
if (this.$opener) {
|
|
12949
|
+
this.openerElement = this.$opener;
|
|
12950
|
+
this.openerElement.addEventListener("click", this.onOpenClick);
|
|
12951
|
+
} else {
|
|
12952
|
+
(_a = this.opener) == null ? void 0 : _a.disconnect();
|
|
12953
|
+
this.opener = new MutationObserver(() => {
|
|
12954
|
+
if (this.$opener) {
|
|
12955
|
+
this.opener.disconnect();
|
|
12956
|
+
this.opener = null;
|
|
12957
|
+
this.addOpenListener();
|
|
12958
|
+
}
|
|
12959
|
+
});
|
|
12960
|
+
this.opener.observe(document.body, {
|
|
12961
|
+
childList: true,
|
|
12962
|
+
subtree: true
|
|
12963
|
+
});
|
|
12964
|
+
}
|
|
12902
12965
|
}
|
|
12903
12966
|
removeOpenListener() {
|
|
12904
|
-
var _a;
|
|
12905
|
-
(_a = this.
|
|
12967
|
+
var _a, _b;
|
|
12968
|
+
(_a = this.opener) == null ? void 0 : _a.disconnect();
|
|
12969
|
+
this.opener = null;
|
|
12970
|
+
(_b = this.openerElement) == null ? void 0 : _b.removeEventListener("click", this.onOpenClick);
|
|
12906
12971
|
this.openerElement = null;
|
|
12907
12972
|
}
|
|
12908
12973
|
addCloseListener(value) {
|
|
@@ -13829,7 +13894,7 @@ class SelectableBoxRadio extends WithExtraAttributes {
|
|
|
13829
13894
|
this.internals.ariaChecked = `${this.checked}`;
|
|
13830
13895
|
}
|
|
13831
13896
|
this.ariaChecked = `${this.checked}`;
|
|
13832
|
-
this.tabIndex = ((_a = this.parentElement) == null ? void 0 : _a.
|
|
13897
|
+
this.tabIndex = ((_a = this.parentElement) == null ? void 0 : _a.querySelector("px-selectable-box-radio")) === this ? 0 : -1;
|
|
13833
13898
|
this.toggleFooterVisibility();
|
|
13834
13899
|
this.$slotFooter.addEventListener(
|
|
13835
13900
|
"slotchange",
|
|
@@ -16176,7 +16241,7 @@ class TileRadio extends WithExtraAttributes {
|
|
|
16176
16241
|
this.internals.ariaChecked = `${this.checked}`;
|
|
16177
16242
|
}
|
|
16178
16243
|
this.ariaChecked = `${this.checked}`;
|
|
16179
|
-
this.tabIndex = ((_a = this.parentElement) == null ? void 0 : _a.
|
|
16244
|
+
this.tabIndex = ((_a = this.parentElement) == null ? void 0 : _a.querySelector("px-tile-radio")) === this ? 0 : -1;
|
|
16180
16245
|
if (this.$slotPrefix) {
|
|
16181
16246
|
const prefixImg = this.querySelector('px-img[slot="prefix"]');
|
|
16182
16247
|
if (prefixImg) {
|