@proximus/lavender-icon-common 2.0.0-alpha.117 → 2.0.0-alpha.119
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/index.es.js +18 -17
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var u = (o) => {
|
|
2
2
|
throw TypeError(o);
|
|
3
3
|
};
|
|
4
|
-
var p = (o,
|
|
5
|
-
var s = (o,
|
|
4
|
+
var p = (o, i, e) => i.has(o) || u("Cannot " + e);
|
|
5
|
+
var s = (o, i, e) => (p(o, i, "read from private field"), e ? e.call(o) : i.get(o)), a = (o, i, e) => i.has(o) ? u("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(o) : i.set(o, e), d = (o, i, e, t) => (p(o, i, "write to private field"), t ? t.call(o, e) : i.set(o, e), e);
|
|
6
6
|
import { WithExtraAttributes as m, iconSizeValuesKC as f, log as b } from "@proximus/lavender-common";
|
|
7
7
|
class g extends HTMLElement {
|
|
8
8
|
constructor() {
|
|
@@ -31,10 +31,10 @@ class g extends HTMLElement {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
disconnectedCallback() {
|
|
34
|
-
const
|
|
34
|
+
const i = document.querySelector(
|
|
35
35
|
`style[data-name="${this.getAttribute("name")}"]`
|
|
36
36
|
);
|
|
37
|
-
|
|
37
|
+
i && i.remove();
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
customElements.get("px-icon-set") || customElements.define("px-icon-set", g);
|
|
@@ -79,17 +79,17 @@ class $ extends m {
|
|
|
79
79
|
"disabled"
|
|
80
80
|
];
|
|
81
81
|
}
|
|
82
|
-
attributeChangedCallback(e, t,
|
|
83
|
-
if (t !==
|
|
82
|
+
attributeChangedCallback(e, t, r) {
|
|
83
|
+
if (t !== r)
|
|
84
84
|
switch (e) {
|
|
85
85
|
case "name":
|
|
86
|
-
this.updateName(t,
|
|
86
|
+
this.updateName(t, r);
|
|
87
87
|
break;
|
|
88
88
|
case "size":
|
|
89
|
-
this.updateAttribute(e, t,
|
|
89
|
+
this.updateAttribute(e, t, r, f);
|
|
90
90
|
break;
|
|
91
91
|
case "color":
|
|
92
|
-
this.updateAttribute(e, t,
|
|
92
|
+
this.updateAttribute(e, t, r, A);
|
|
93
93
|
break;
|
|
94
94
|
case "disabled":
|
|
95
95
|
this.color = "state-disabled";
|
|
@@ -97,29 +97,30 @@ class $ extends m {
|
|
|
97
97
|
case "aria-label":
|
|
98
98
|
if (!s(this, n))
|
|
99
99
|
return;
|
|
100
|
-
|
|
100
|
+
r ? (s(this, n).ariaHidden = "false", this.ariaHidden = "false") : (s(this, n).ariaHidden = "true", this.ariaHidden = "true");
|
|
101
101
|
break;
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
connectedCallback() {
|
|
105
|
+
var t;
|
|
105
106
|
this.role = "img";
|
|
106
107
|
const e = document.querySelectorAll("px-icon-set");
|
|
107
108
|
e || console.log("<px-icon-set> component not found");
|
|
108
|
-
for (const
|
|
109
|
-
if (!
|
|
109
|
+
for (const r of e) {
|
|
110
|
+
if (!r.getAttribute("name") || !r.getAttribute("src")) {
|
|
110
111
|
console.error("Icon name or src not found");
|
|
111
112
|
continue;
|
|
112
113
|
}
|
|
113
|
-
|
|
114
|
+
r.getAttribute("name") === this.from && r.getAttribute("type") !== "font" && (d(this, c, r.getAttribute("src")), this.$el.firstElementChild.setAttribute(
|
|
114
115
|
"href",
|
|
115
116
|
`${s(this, c)}#icon-${this.name}`
|
|
116
117
|
));
|
|
117
118
|
}
|
|
118
|
-
!this.ariaLabel && s(this, n) && (s(this, n).ariaHidden = "true", this.ariaHidden = "true"), this.parentElement.localName === "px-a" && this.slot !== "before" && this.slot !== "after" && this.setAttribute("color", "inherit");
|
|
119
|
+
!this.ariaLabel && s(this, n) && (s(this, n).ariaHidden = "true", this.ariaHidden = "true"), ((t = this.parentElement) == null ? void 0 : t.localName) === "px-a" && this.slot !== "before" && this.slot !== "after" && (this.color || this.setAttribute("color", "inherit"));
|
|
119
120
|
}
|
|
120
|
-
updateAttribute(e, t,
|
|
121
|
-
t !== null && t !== "" && (e === "size" ? this.$el.classList.toggle(`${e}-${t}`) : this.$el.classList.toggle(t)),
|
|
122
|
-
`${
|
|
121
|
+
updateAttribute(e, t, r, v) {
|
|
122
|
+
t !== null && t !== "" && (e === "size" ? this.$el.classList.toggle(`${e}-${t}`) : this.$el.classList.toggle(t)), r !== null && r !== "" && (e === "size" ? this.$el.classList.toggle(`${e}-${r}`) : this.$el.classList.toggle(r)), this.checkName(v, r) || b(
|
|
123
|
+
`${r} is not an allowed ${e} value for ${this.tagName.toLowerCase()}`
|
|
123
124
|
);
|
|
124
125
|
}
|
|
125
126
|
updateName(e, t) {
|