@proximus/lavender-tabs 1.4.3-alpha.2 → 1.4.3-alpha.3

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/PxTabs.d.ts CHANGED
@@ -3,6 +3,7 @@ import { Tab } from './Tab.ts';
3
3
  import { TabPanel } from './TabPanel.ts';
4
4
  export declare class PxTabs extends Tabs {
5
5
  constructor();
6
+ connectedCallback(): void;
6
7
  }
7
8
  export declare class PxTab extends Tab {
8
9
  constructor();
package/dist/index.es.js CHANGED
@@ -11,7 +11,7 @@ class b extends HTMLElement {
11
11
  <px-button-icon id="previous" aria-hidden="true">
12
12
  <px-icon name="chevron_left" from="lavender"></px-icon>
13
13
  </px-button-icon>
14
- <div id="tablist" aria-labelledby="${this._label}">
14
+ <div id="tablist">
15
15
  <slot name="tabs"></slot>
16
16
  </div>
17
17
  <px-button-icon id="next" aria-hidden="true">
@@ -22,7 +22,7 @@ class b extends HTMLElement {
22
22
  <slot name="tabpanels"></slot>
23
23
  </div>
24
24
  </div>
25
- `, this.attachShadow({ mode: "open" }), this.getAttribute("label") && (this._label = this.getAttribute("label")), this.shadowRoot.innerHTML = this.template(), this.shadowRoot.adoptedStyleSheets = [l], this.internals = (t = this.attachInternals) == null ? void 0 : t.call(this), this.role = "tablist", this.internals && (this.internals.role = "tablist"), this.addEventListener("px-tab-connected", () => {
25
+ `, this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template(), this.shadowRoot.adoptedStyleSheets = [l], this.internals = (t = this.attachInternals) == null ? void 0 : t.call(this), this.addEventListener("px-tab-connected", () => {
26
26
  this.tabsConnected++, this.handleNextPreviousDisplay();
27
27
  }), window.addEventListener("resize", () => {
28
28
  this.handleNextPreviousDisplay();
@@ -51,7 +51,7 @@ class b extends HTMLElement {
51
51
  }
52
52
  connectedCallback() {
53
53
  var t, i, e, n;
54
- this.checkNextPreviousButtonsVisibility(), this.addEventListener("click", (s) => {
54
+ this.shadowRoot.querySelector("#tablist").setAttribute("aria-labelledby", this._label), this.getAttribute("label") && (this.label = this.getAttribute("label")), this.role = "tablist", this.internals && (this.internals.role = "tablist"), this.checkNextPreviousButtonsVisibility(), this.addEventListener("click", (s) => {
55
55
  var o;
56
56
  if ((o = s.target.localName) != null && o.endsWith("-tab")) {
57
57
  this.$activePanel.selected = !1, this.$activeTab.selected = !1;
@@ -146,13 +146,13 @@ class p extends HTMLElement {
146
146
  <button type="button" tabindex="-1" >
147
147
  <span><slot></slot></span>
148
148
  </button>
149
- `, this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template(), this.shadowRoot.adoptedStyleSheets = [d], this.internals = (t = this.attachInternals) == null ? void 0 : t.call(this), this.role = "tab", this.internals && (this.internals.role = "tab"), this.ariaSelected = `${this.selected}`;
149
+ `, this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template(), this.shadowRoot.adoptedStyleSheets = [d], this.internals = (t = this.attachInternals) == null ? void 0 : t.call(this);
150
150
  }
151
151
  static get observedAttributes() {
152
152
  return ["selected", "for", "name"];
153
153
  }
154
154
  connectedCallback() {
155
- this.slot = "tabs", this.parentElement.inverted && (this.setAttribute("inverted", ""), this.$button.setAttribute("inverted", "")), this.dispatchEvent(
155
+ this.role = "tab", this.internals && (this.internals.role = "tab"), this.ariaSelected = `${this.selected}`, this.slot = "tabs", this.parentElement.inverted && (this.setAttribute("inverted", ""), this.$button.setAttribute("inverted", "")), this.dispatchEvent(
156
156
  new CustomEvent("px-tab-connected", { bubbles: !0, composed: !0 })
157
157
  );
158
158
  }
@@ -190,7 +190,7 @@ class p extends HTMLElement {
190
190
  class f extends HTMLElement {
191
191
  constructor() {
192
192
  super(), this.template = () => `
193
- <div role="tabpanel" aria-labelledby="${this.name}" tabindex="0">
193
+ <div role="tabpanel" tabindex="0">
194
194
  <slot></slot>
195
195
  </div>
196
196
  `, this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template(), this.shadowRoot.adoptedStyleSheets = [l];
@@ -202,7 +202,7 @@ class f extends HTMLElement {
202
202
  t === "name" && this.$panel.setAttribute("aria-labelledby", e);
203
203
  }
204
204
  connectedCallback() {
205
- this.slot = "tabpanels";
205
+ this.name && this.$panel.setAttribute("aria-labelledby", this.name), this.slot = "tabpanels";
206
206
  const t = this.parentElement.querySelector(
207
207
  `[for="${this.getAttribute("name")}"]`
208
208
  );
@@ -230,8 +230,12 @@ class f extends HTMLElement {
230
230
  }
231
231
  class v extends b {
232
232
  constructor() {
233
- super(), this.querySelectorAll("px-tab").forEach((t) => {
234
- t.setAttribute("slot", "tabs");
233
+ super();
234
+ }
235
+ connectedCallback() {
236
+ var t;
237
+ (t = super.connectedCallback) == null || t.call(this), this.querySelectorAll("px-tab").forEach((i) => {
238
+ i.setAttribute("slot", "tabs");
235
239
  });
236
240
  }
237
241
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-tabs",
3
- "version": "1.4.3-alpha.2",
3
+ "version": "1.4.3-alpha.3",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",