@proximus/lavender-tile 2.0.0-alpha.1 → 2.0.0-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.
@@ -2,7 +2,7 @@ import { WithExtraAttributes } from '@proximus/lavender-common';
2
2
  import '@proximus/lavender-layout';
3
3
  import { Tile } from './Tile';
4
4
  import { type IRadio } from '@proximus/lavender-radio-group';
5
- import { type RadioBase } from '@proximus/lavender-radio-group';
5
+ import { type Radio } from '@proximus/lavender-radio-group';
6
6
  export declare class TileRadio extends WithExtraAttributes implements IRadio {
7
7
  protected internals: ElementInternals;
8
8
  protected template(): string;
@@ -18,7 +18,7 @@ export declare class TileRadio extends WithExtraAttributes implements IRadio {
18
18
  formData(): FormData;
19
19
  get $tile(): Tile;
20
20
  get $el(): HTMLElement;
21
- get $radio(): RadioBase;
21
+ get $radio(): Radio;
22
22
  get $slotPrefix(): Element;
23
23
  get $children(): NodeListOf<Element>;
24
24
  get centerContent(): boolean;
package/dist/index.es.js CHANGED
@@ -446,7 +446,7 @@ class L extends u {
446
446
  <div class="tile-radio">
447
447
  <px-tile hoverable>
448
448
  <slot name="prefix" slot="prefix"></slot>
449
- <px-radio-base slot="suffix" aria-hidden="true" tabindex="-1"></px-radio-base>
449
+ <px-radio slot="suffix" aria-hidden="true" tabindex="-1"></px-radio>
450
450
  <slot name="label" slot="label"></slot>
451
451
  <slot name="description" slot="description"></slot>
452
452
  </px-tile>
@@ -454,26 +454,27 @@ class L extends u {
454
454
  `;
455
455
  }
456
456
  constructor() {
457
- var t, e;
458
- super(C), this.shadowRoot.innerHTML = this.template(), this.internals = (t = this.attachInternals) == null ? void 0 : t.call(this), this.tabIndex = ((e = this.parentElement) == null ? void 0 : e.firstElementChild) === this ? 0 : -1, this.internals && (this.internals.role = "radio", this.internals.ariaChecked = `${this.checked}`);
457
+ var t;
458
+ super(C), this.shadowRoot.innerHTML = this.template(), this.internals = (t = this.attachInternals) == null ? void 0 : t.call(this), this.internals && (this.internals.role = "radio", this.internals.ariaChecked = `${this.checked}`);
459
459
  }
460
460
  connectedCallback() {
461
- if (this.$slotPrefix) {
462
- const t = this.querySelector('px-img[slot="prefix"]');
463
- t && l(t);
461
+ var t;
462
+ if (this.tabIndex = ((t = this.parentElement) == null ? void 0 : t.firstElementChild) === this ? 0 : -1, this.$slotPrefix) {
463
+ const e = this.querySelector('px-img[slot="prefix"]');
464
+ e && l(e);
464
465
  }
465
466
  this.addEventListener("mouseover", () => {
466
467
  this.$radio.setAttribute("hover", "");
467
468
  }), this.addEventListener("mouseout", () => {
468
469
  this.$radio.removeAttribute("hover");
469
- }), this.addEventListener("keypress", (t) => {
470
- switch (t.stopPropagation(), t.preventDefault(), t.code) {
470
+ }), this.addEventListener("keypress", (e) => {
471
+ switch (e.stopPropagation(), e.preventDefault(), e.code) {
471
472
  case "Space":
472
473
  this.click();
473
474
  break;
474
475
  }
475
- }), this.addEventListener("click", (t) => {
476
- this.checked || (this.checked = !0), t.stopPropagation(), t.preventDefault();
476
+ }), this.addEventListener("click", (e) => {
477
+ this.checked || (this.checked = !0), e.stopPropagation(), e.preventDefault();
477
478
  }), this.hasAttribute("checked") && (this.checked = !0);
478
479
  }
479
480
  static get observedAttributes() {
@@ -527,7 +528,7 @@ class L extends u {
527
528
  }
528
529
  handleCheckedAttributeChange(t) {
529
530
  var e;
530
- (e = this.internals) == null || e.setFormValue(this.formData()), t === null ? (this.internals && (this.internals.ariaChecked = "false"), this.setAttribute("tabIndex", "-1"), this.checked = !1, this.$radio && this.$radio.removeAttribute("checked")) : (this.internals && (this.internals.ariaChecked = "true"), this.setAttribute("tabIndex", "0"), this.checked = !0, this.$radio && this.$radio.setAttribute("checked", ""), this.dispatchEvent(
531
+ (e = this.internals) == null || e.setFormValue(this.formData()), t === null ? (this.internals && (this.internals.ariaChecked = "false"), this.tabIndex = -1, this.checked = !1, this.$radio && this.$radio.removeAttribute("checked")) : (this.internals && (this.internals.ariaChecked = "true"), this.tabIndex = 0, this.checked = !0, this.$radio && this.$radio.setAttribute("checked", ""), this.dispatchEvent(
531
532
  new Event("change", {
532
533
  bubbles: !0,
533
534
  composed: !0
@@ -559,7 +560,7 @@ class L extends u {
559
560
  return this.shadowRoot.querySelector(".tile-radio");
560
561
  }
561
562
  get $radio() {
562
- return this.shadowRoot.querySelector("px-radio-base");
563
+ return this.shadowRoot.querySelector("px-radio");
563
564
  }
564
565
  get $slotPrefix() {
565
566
  return this.querySelector('[slot="prefix"]');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-tile",
3
- "version": "2.0.0-alpha.1",
3
+ "version": "2.0.0-alpha.3",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",