@proximus/lavender-light 2.0.0-alpha.65 → 2.0.0-alpha.69
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.
|
@@ -963,7 +963,6 @@ class AttributeBreakpointHandlerDelegate {
|
|
|
963
963
|
}
|
|
964
964
|
const containerStyles = new CSSStyleSheet();
|
|
965
965
|
containerStyles.replaceSync(containerCss);
|
|
966
|
-
const anchorValues = ["anchor-right", "anchor-left", "anchor-full"];
|
|
967
966
|
const attributeBreakpointCSSSelector$1 = (attributeName, attributeValue, device) => `:host([${attributeName}${device ? `--${device}` : ""}='${attributeValue}']) .container`;
|
|
968
967
|
const paddingPrefix = "px-padding";
|
|
969
968
|
const _Container = class _Container extends PxElement {
|
|
@@ -1070,12 +1069,19 @@ const _Container = class _Container extends PxElement {
|
|
|
1070
1069
|
if (!this.borderColor) {
|
|
1071
1070
|
this.borderColor = "main";
|
|
1072
1071
|
}
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
if (anchorValues.includes(anchorSlot.getAttribute("slot"))) {
|
|
1076
|
-
this.shadowRoot.querySelector(".container").classList.toggle("anchored");
|
|
1077
|
-
}
|
|
1072
|
+
if (this.$slotAnchor) {
|
|
1073
|
+
this.addAnchorClass();
|
|
1078
1074
|
}
|
|
1075
|
+
this.contentObserver = new MutationObserver(() => {
|
|
1076
|
+
if (this.$slotAnchor) {
|
|
1077
|
+
this.addAnchorClass();
|
|
1078
|
+
}
|
|
1079
|
+
});
|
|
1080
|
+
this.contentObserver.observe(this, {
|
|
1081
|
+
childList: true,
|
|
1082
|
+
subtree: true,
|
|
1083
|
+
characterData: true
|
|
1084
|
+
});
|
|
1079
1085
|
this._bgObserver = new IntersectionObserver((entries) => {
|
|
1080
1086
|
entries.forEach((entry) => {
|
|
1081
1087
|
var _a;
|
|
@@ -1091,6 +1097,7 @@ const _Container = class _Container extends PxElement {
|
|
|
1091
1097
|
disconnectedCallback() {
|
|
1092
1098
|
var _a;
|
|
1093
1099
|
(_a = this._bgObserver) == null ? void 0 : _a.disconnect();
|
|
1100
|
+
this.contentObserver.disconnect();
|
|
1094
1101
|
}
|
|
1095
1102
|
attributeChangedCallback(attrName, oldValue, newValue) {
|
|
1096
1103
|
if (oldValue !== newValue) {
|
|
@@ -1303,6 +1310,14 @@ const _Container = class _Container extends PxElement {
|
|
|
1303
1310
|
updateAnchorOffsetStyle(oldValue);
|
|
1304
1311
|
updateAnchorOffsetStyle(newValue);
|
|
1305
1312
|
}
|
|
1313
|
+
addAnchorClass() {
|
|
1314
|
+
if (!this.$el.classList.contains("anchored")) {
|
|
1315
|
+
this.$el.classList.add("anchored");
|
|
1316
|
+
}
|
|
1317
|
+
}
|
|
1318
|
+
get $slotAnchor() {
|
|
1319
|
+
return this.querySelector('[slot^="anchor"]');
|
|
1320
|
+
}
|
|
1306
1321
|
get padding() {
|
|
1307
1322
|
return this.getAttribute("padding");
|
|
1308
1323
|
}
|
|
@@ -2657,6 +2672,7 @@ class Icon extends WithExtraAttributes {
|
|
|
2657
2672
|
<use xlink:href="#icon-${this.name}"></use>
|
|
2658
2673
|
</svg>`);
|
|
2659
2674
|
this.shadowRoot.innerHTML = __privateGet(this, _template).call(this);
|
|
2675
|
+
this.role = "img";
|
|
2660
2676
|
__privateSet(this, _internals, (_a = this.attachInternals) == null ? void 0 : _a.call(this));
|
|
2661
2677
|
if (__privateGet(this, _internals)) {
|
|
2662
2678
|
__privateGet(this, _internals).role = "img";
|