@proximus/lavender-light 1.4.4-alpha.9 → 1.4.4-beta.2

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.
@@ -3415,19 +3415,14 @@ class Modal extends HTMLElement {
3415
3415
  });
3416
3416
  }
3417
3417
  if (this.hasAttribute("openedby")) {
3418
- const $opener = document.querySelector(
3419
- `px-button#${this.getAttribute("openedby")}`
3420
- );
3421
- $opener == null ? void 0 : $opener.addEventListener("click", () => {
3422
- this.show();
3423
- });
3418
+ this.addOpenListener();
3424
3419
  }
3425
3420
  if (this.hasAttribute("media-src")) {
3426
3421
  this.updateMediaSrc(this.getAttribute("media-src"));
3427
3422
  }
3428
3423
  }
3429
3424
  static get observedAttributes() {
3430
- return ["open", "status", "media-src"];
3425
+ return ["open", "status", "media-src", "openedby"];
3431
3426
  }
3432
3427
  attributeChangedCallback(attrName, oldValue, newValue) {
3433
3428
  switch (attrName) {
@@ -3440,6 +3435,9 @@ class Modal extends HTMLElement {
3440
3435
  case "media-src":
3441
3436
  this.updateMediaSrc(newValue);
3442
3437
  break;
3438
+ case "openedby":
3439
+ this.addOpenListener();
3440
+ break;
3443
3441
  }
3444
3442
  }
3445
3443
  handleOpenChange() {
@@ -3503,12 +3501,30 @@ class Modal extends HTMLElement {
3503
3501
  updateMediaSrc(src) {
3504
3502
  this.$mediaContainer.style.backgroundImage = `url(${src})`;
3505
3503
  }
3504
+ addOpenListener() {
3505
+ var _a, _b, _c;
3506
+ if (((_a = this.$opener) == null ? void 0 : _a.getAttribute("data-has-opener")) !== "true") {
3507
+ (_b = this.$opener) == null ? void 0 : _b.setAttribute("data-has-opener", "true");
3508
+ (_c = this.$opener) == null ? void 0 : _c.addEventListener("click", () => this.show());
3509
+ }
3510
+ }
3511
+ get $opener() {
3512
+ return document.querySelector(
3513
+ `px-button#${this.getAttribute("openedby")}`
3514
+ );
3515
+ }
3506
3516
  get status() {
3507
3517
  return this.getAttribute("status");
3508
3518
  }
3509
3519
  set status(value) {
3510
3520
  this.setAttribute("status", value);
3511
3521
  }
3522
+ get openedby() {
3523
+ return this.getAttribute("openedby");
3524
+ }
3525
+ set openedby(value) {
3526
+ this.setAttribute("openedby", value);
3527
+ }
3512
3528
  get $closeButton() {
3513
3529
  return this.shadowRoot.querySelector("px-button-icon");
3514
3530
  }
@@ -5515,20 +5531,20 @@ const _ContentHeader = class _ContentHeader extends PxElement {
5515
5531
  }
5516
5532
  createGridding(value) {
5517
5533
  const breakpoints = [
5518
- { prop: "hasGridding", gridAttr: "grid-cols", attr: "col-span" },
5534
+ { prop: "hasGridding", gridProp: "gridCols", attr: "col-span" },
5519
5535
  {
5520
5536
  prop: "hasGriddingMobile",
5521
- gridAttr: "grid-cols--mobile",
5537
+ gridProp: "gridColsMobile",
5522
5538
  attr: "col-span--mobile"
5523
5539
  },
5524
5540
  {
5525
5541
  prop: "hasGriddingTablet",
5526
- gridAttr: "grid-cols--tablet",
5542
+ gridProp: "gridColsTablet",
5527
5543
  attr: "col-span--tablet"
5528
5544
  },
5529
5545
  {
5530
5546
  prop: "hasGriddingLaptop",
5531
- gridAttr: "grid-cols--laptop",
5547
+ gridProp: "gridColsLaptop",
5532
5548
  attr: "col-span--laptop"
5533
5549
  }
5534
5550
  ];
@@ -5536,16 +5552,16 @@ const _ContentHeader = class _ContentHeader extends PxElement {
5536
5552
  "px-grid > px-container"
5537
5553
  );
5538
5554
  if (value !== null) {
5539
- breakpoints.forEach(({ prop, gridAttr, attr }) => {
5555
+ breakpoints.forEach(({ prop, gridProp, attr }) => {
5540
5556
  if (this[prop]) {
5541
- this.$grid.setAttribute(gridAttr, "3");
5542
- spanElement == null ? void 0 : spanElement.setAttribute(attr, "2");
5557
+ this.$grid[gridProp] = "3";
5558
+ spanElement.setAttribute(attr, "2");
5543
5559
  }
5544
5560
  });
5545
5561
  } else {
5546
- breakpoints.forEach(({ gridAttr, attr }) => {
5547
- this.$grid.setAttribute(gridAttr, "1");
5548
- spanElement == null ? void 0 : spanElement.setAttribute(attr, "1");
5562
+ breakpoints.forEach(({ gridProp, attr }) => {
5563
+ this.$grid[gridProp] = "1";
5564
+ spanElement.removeAttribute(attr);
5549
5565
  });
5550
5566
  }
5551
5567
  }