@proximus/lavender-icon-common 2.0.0-alpha.117 → 2.0.0-alpha.118

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.
Files changed (2) hide show
  1. package/dist/index.es.js +18 -17
  2. 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, r, e) => r.has(o) || u("Cannot " + e);
5
- var s = (o, r, e) => (p(o, r, "read from private field"), e ? e.call(o) : r.get(o)), a = (o, r, e) => r.has(o) ? u("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(o) : r.set(o, e), d = (o, r, e, t) => (p(o, r, "write to private field"), t ? t.call(o, e) : r.set(o, e), e);
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 r = document.querySelector(
34
+ const i = document.querySelector(
35
35
  `style[data-name="${this.getAttribute("name")}"]`
36
36
  );
37
- r && r.remove();
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, i) {
83
- if (t !== i)
82
+ attributeChangedCallback(e, t, r) {
83
+ if (t !== r)
84
84
  switch (e) {
85
85
  case "name":
86
- this.updateName(t, i);
86
+ this.updateName(t, r);
87
87
  break;
88
88
  case "size":
89
- this.updateAttribute(e, t, i, f);
89
+ this.updateAttribute(e, t, r, f);
90
90
  break;
91
91
  case "color":
92
- this.updateAttribute(e, t, i, A);
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
- i ? (s(this, n).ariaHidden = "false", this.ariaHidden = "false") : (s(this, n).ariaHidden = "true", this.ariaHidden = "true");
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 t of e) {
109
- if (!t.getAttribute("name") || !t.getAttribute("src")) {
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
- t.getAttribute("name") === this.from && t.getAttribute("type") !== "font" && (d(this, c, t.getAttribute("src")), this.$el.firstElementChild.setAttribute(
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, i, v) {
121
- t !== null && t !== "" && (e === "size" ? this.$el.classList.toggle(`${e}-${t}`) : this.$el.classList.toggle(t)), i !== null && i !== "" && (e === "size" ? this.$el.classList.toggle(`${e}-${i}`) : this.$el.classList.toggle(i)), this.checkName(v, i) || b(
122
- `${i} is not an allowed ${e} value for ${this.tagName.toLowerCase()}`
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-icon-common",
3
- "version": "2.0.0-alpha.117",
3
+ "version": "2.0.0-alpha.118",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",