@warp-ds/elements 2.2.0-next.1 → 2.2.0-next.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.
package/dist/index.js CHANGED
@@ -5697,7 +5697,6 @@ if (!customElements.get("w-icon-arrow-left-16")) {
5697
5697
 
5698
5698
  // packages/modal/modal-header.js
5699
5699
  import WarpElement11 from "@warp-ds/elements-core";
5700
- import { createRef, ref } from "lit/directives/ref.js";
5701
5700
 
5702
5701
  // packages/modal/locales/da/messages.mjs
5703
5702
  var messages51 = JSON.parse('{"modal.aria.back":["Tilbage"],"modal.aria.close":["Luk"]}');
@@ -5719,7 +5718,6 @@ var NO_CLOSE_BUTTON = "no-close";
5719
5718
  var ModalHeader = class extends CanCloseMixin(WarpElement11) {
5720
5719
  constructor() {
5721
5720
  super();
5722
- __publicField(this, "titleEl", createRef());
5723
5721
  activateI18n7(messages60, messages62, messages61, messages51, messages63);
5724
5722
  this._hasTopContent = false;
5725
5723
  }
@@ -5729,15 +5727,18 @@ var ModalHeader = class extends CanCloseMixin(WarpElement11) {
5729
5727
  <slot name="top" @slotchange=${this.handleTopSlotChange}></slot>
5730
5728
  <div class="${this._hasTopContent ? "" : modalElement.headerTitleBar}">
5731
5729
  ${this.backButton}
5732
- <h1 ${ref(this.titleEl)} class="${this.titleClasses}">${this.title}</h1>
5730
+ <h1 class="title-el ${this.titleClasses}">${this.title}</h1>
5733
5731
  ${this.closeButton}
5734
5732
  </div>
5735
5733
  </div>
5736
5734
  `;
5737
5735
  }
5736
+ get titleEl() {
5737
+ return this.shadowRoot.querySelector(".title-el");
5738
+ }
5738
5739
  async willUpdate(changedProperties) {
5739
5740
  if (changedProperties.has("back")) {
5740
- const move = new Move(this.titleEl.value);
5741
+ const move = new Move(this.titleEl);
5741
5742
  move.when(async () => {
5742
5743
  await this.updateComplete;
5743
5744
  });
@@ -5796,7 +5797,6 @@ __publicField(ModalHeader, "styles", [WarpElement11.styles]);
5796
5797
  // packages/modal/modal-main.js
5797
5798
  import { css as css6, html as html21 } from "lit";
5798
5799
  import WarpElement12 from "@warp-ds/elements-core";
5799
- import { createRef as createRef2, ref as ref2 } from "lit/directives/ref.js";
5800
5800
 
5801
5801
  // node_modules/.pnpm/scroll-doctor@2.0.2/node_modules/scroll-doctor/dist/scroll-doctor.js
5802
5802
  var n = [];
@@ -5862,29 +5862,26 @@ var CONTENT_ID = "content-id";
5862
5862
  var ModalMain = class extends ProvidesCanCloseToSlotsMixin(WarpElement12) {
5863
5863
  constructor() {
5864
5864
  super();
5865
- __publicField(this, "dialogEl", createRef2());
5866
- __publicField(this, "dialogInnerEl", createRef2());
5867
- __publicField(this, "contentEl", createRef2());
5868
5865
  this.interceptEscape = this.interceptEscape.bind(this);
5869
5866
  this.closeOnBackdropClick = this.closeOnBackdropClick.bind(this);
5870
5867
  this.eventPreventer = this.eventPreventer.bind(this);
5871
5868
  this.modifyBorderRadius = this.modifyBorderRadius.bind(this);
5872
5869
  }
5873
5870
  async open() {
5874
- this.dialogEl.value.showModal();
5871
+ this.dialogEl.showModal();
5875
5872
  this.handleListeners();
5876
- E(this.contentEl.value);
5873
+ E(this.contentEl);
5877
5874
  await this.updateComplete;
5878
5875
  this.dispatchEvent(new CustomEvent("shown", { bubbles: true, composed: true }));
5879
5876
  }
5880
5877
  close() {
5881
5878
  this.handleListeners("removeEventListener");
5882
- this.dialogEl.value.classList.add("close");
5883
- this.dialogEl.value.addEventListener(
5879
+ this.dialogEl.classList.add("close");
5880
+ this.dialogEl.addEventListener(
5884
5881
  "animationend",
5885
5882
  async () => {
5886
- this.dialogEl.value.classList.remove("close");
5887
- this.dialogEl.value.close();
5883
+ this.dialogEl.classList.remove("close");
5884
+ this.dialogEl.close();
5888
5885
  T();
5889
5886
  await this.updateComplete;
5890
5887
  this.dispatchEvent(new CustomEvent("hidden", { bubbles: true, composed: true }));
@@ -5894,10 +5891,10 @@ var ModalMain = class extends ProvidesCanCloseToSlotsMixin(WarpElement12) {
5894
5891
  }
5895
5892
  render() {
5896
5893
  return html21`
5897
- <dialog ${ref2(this.dialogEl)} class="w-modal ${modalElement.dialogEl}">
5898
- <div ${ref2(this.dialogInnerEl)} class="${modalElement.dialogInner}">
5894
+ <dialog class="dialog-el w-modal ${modalElement.dialogEl}">
5895
+ <div class="dialog-inner-el ${modalElement.dialogInner}">
5899
5896
  <slot name="header" @slotchange="${this.handleSlotChange}"></slot>
5900
- <div ${ref2(this.contentEl)} class="${modalElement.contentSlot}" id=${this[CONTENT_ID]}>
5897
+ <div class="content-el ${modalElement.contentSlot}" id=${this[CONTENT_ID]}>
5901
5898
  <slot name="content" @slotchange="${this.handleSlotChange}"></slot>
5902
5899
  </div>
5903
5900
  <slot name="footer" @slotchange="${this.handleSlotChange}"></slot>
@@ -5905,15 +5902,24 @@ var ModalMain = class extends ProvidesCanCloseToSlotsMixin(WarpElement12) {
5905
5902
  </dialog>
5906
5903
  `;
5907
5904
  }
5908
- willUpdate(changedProperties) {
5905
+ get dialogEl() {
5906
+ return this.shadowRoot.querySelector(".dialog-el");
5907
+ }
5908
+ get dialogInnerEl() {
5909
+ return this.shadowRoot.querySelector(".dialog-inner-el");
5910
+ }
5911
+ get contentEl() {
5912
+ return this.shadowRoot.querySelector(".content-el");
5913
+ }
5914
+ updated(changedProperties) {
5909
5915
  if (changedProperties.has("show")) this[this.show ? "open" : "close"]();
5910
5916
  }
5911
5917
  handleListeners(verb = "addEventListener") {
5912
5918
  document[verb]("keydown", this.interceptEscape);
5913
- if (!this[NO_BACKDROP_CLICKS]) this.dialogEl.value[verb]("mousedown", this.closeOnBackdropClick);
5914
- this.dialogEl.value[verb]("close", this.eventPreventer);
5915
- this.dialogEl.value[verb]("cancel", this.eventPreventer);
5916
- this.dialogInnerEl.value[verb]("transitionend", this.modifyBorderRadius);
5919
+ if (!this[NO_BACKDROP_CLICKS]) this.dialogEl[verb]("mousedown", this.closeOnBackdropClick);
5920
+ this.dialogEl[verb]("close", this.eventPreventer);
5921
+ this.dialogEl[verb]("cancel", this.eventPreventer);
5922
+ this.dialogInnerEl[verb]("transitionend", this.modifyBorderRadius);
5917
5923
  }
5918
5924
  /** @param {Event} evt */
5919
5925
  eventPreventer(evt) {
@@ -5921,7 +5927,7 @@ var ModalMain = class extends ProvidesCanCloseToSlotsMixin(WarpElement12) {
5921
5927
  }
5922
5928
  /** @param {MouseEvent} evt */
5923
5929
  closeOnBackdropClick(evt) {
5924
- if (this.dialogEl.value === evt.target) this.close();
5930
+ if (this.dialogEl === evt.target) this.close();
5925
5931
  }
5926
5932
  /** @param {KeyboardEvent} evt */
5927
5933
  interceptEscape(evt) {
@@ -5931,8 +5937,8 @@ var ModalMain = class extends ProvidesCanCloseToSlotsMixin(WarpElement12) {
5931
5937
  }
5932
5938
  }
5933
5939
  modifyBorderRadius() {
5934
- if (this.dialogInnerEl.value.scrollHeight * 1.02 > innerHeight) this.dialogInnerEl.value.style.borderRadius = "0px";
5935
- else this.dialogInnerEl.value.style.borderRadius = null;
5940
+ if (this.dialogInnerEl.scrollHeight * 1.02 > innerHeight) this.dialogInnerEl.style.borderRadius = "0px";
5941
+ else this.dialogInnerEl.style.borderRadius = null;
5936
5942
  }
5937
5943
  };
5938
5944
  __publicField(ModalMain, "properties", {