@proximus/lavender-icon-common 1.4.10-beta.4 → 1.4.10

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 +17 -18
  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, 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);
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);
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 i = document.querySelector(
34
+ const r = document.querySelector(
35
35
  `style[data-name="${this.getAttribute("name")}"]`
36
36
  );
37
- i && i.remove();
37
+ r && r.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, r) {
83
- if (t !== r)
82
+ attributeChangedCallback(e, t, i) {
83
+ if (t !== i)
84
84
  switch (e) {
85
85
  case "name":
86
- this.updateName(t, r);
86
+ this.updateName(t, i);
87
87
  break;
88
88
  case "size":
89
- this.updateAttribute(e, t, r, f);
89
+ this.updateAttribute(e, t, i, f);
90
90
  break;
91
91
  case "color":
92
- this.updateAttribute(e, t, r, A);
92
+ this.updateAttribute(e, t, i, A);
93
93
  break;
94
94
  case "disabled":
95
95
  this.color = "state-disabled";
@@ -97,30 +97,29 @@ class $ extends m {
97
97
  case "aria-label":
98
98
  if (!s(this, n))
99
99
  return;
100
- r ? (s(this, n).ariaHidden = "false", this.ariaHidden = "false") : (s(this, n).ariaHidden = "true", this.ariaHidden = "true");
100
+ i ? (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;
106
105
  this.role = "img";
107
106
  const e = document.querySelectorAll("px-icon-set");
108
107
  e || console.log("<px-icon-set> component not found");
109
- for (const r of e) {
110
- if (!r.getAttribute("name") || !r.getAttribute("src")) {
108
+ for (const t of e) {
109
+ if (!t.getAttribute("name") || !t.getAttribute("src")) {
111
110
  console.error("Icon name or src not found");
112
111
  continue;
113
112
  }
114
- r.getAttribute("name") === this.from && r.getAttribute("type") !== "font" && (d(this, c, r.getAttribute("src")), this.$el.firstElementChild.setAttribute(
113
+ t.getAttribute("name") === this.from && t.getAttribute("type") !== "font" && (d(this, c, t.getAttribute("src")), this.$el.firstElementChild.setAttribute(
115
114
  "href",
116
115
  `${s(this, c)}#icon-${this.name}`
117
116
  ));
118
117
  }
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"));
118
+ !this.ariaLabel && s(this, n) && (s(this, n).ariaHidden = "true", this.ariaHidden = "true");
120
119
  }
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()}`
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()}`
124
123
  );
125
124
  }
126
125
  updateName(e, t) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-icon-common",
3
- "version": "1.4.10-beta.4",
3
+ "version": "1.4.10",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",