@melodicdev/components 1.0.14 → 1.0.15

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.
@@ -18538,6 +18538,13 @@ var DialogRef = class {
18538
18538
  this._dialogEl.addEventListener("cancel", this._handleCancel);
18539
18539
  this._dialogEl.addEventListener("click", this._handleBackdropClick);
18540
18540
  }
18541
+ updateDialogElement(dialogEl) {
18542
+ this._dialogEl.removeEventListener("cancel", this._handleCancel);
18543
+ this._dialogEl.removeEventListener("click", this._handleBackdropClick);
18544
+ this._dialogEl = dialogEl;
18545
+ this._dialogEl.addEventListener("cancel", this._handleCancel);
18546
+ this._dialogEl.addEventListener("click", this._handleBackdropClick);
18547
+ }
18541
18548
  get dialogID() {
18542
18549
  return this._dialogID;
18543
18550
  }
@@ -18669,10 +18676,7 @@ var DialogComponent = class DialogComponent$1 {
18669
18676
  registerDialog() {
18670
18677
  if (this._registered) return;
18671
18678
  const dialogEl = this.elementRef.shadowRoot?.querySelector("dialog");
18672
- if (!dialogEl) {
18673
- console.warn(`[ml-dialog] registerDialog failed: <dialog> not found in shadow root for #${this.createDialogID()}. elementRef:`, this.elementRef, "shadowRoot:", this.elementRef.shadowRoot, "shadowRoot children:", this.elementRef.shadowRoot?.children);
18674
- return;
18675
- }
18679
+ if (!dialogEl) return;
18676
18680
  this._dialogEl = dialogEl;
18677
18681
  this._dialogID = this.createDialogID();
18678
18682
  this._dialogEl.id = this._dialogID;
@@ -18684,6 +18688,11 @@ var DialogComponent = class DialogComponent$1 {
18684
18688
  }
18685
18689
  open() {
18686
18690
  this.registerDialog();
18691
+ const dialogEl = this.elementRef.shadowRoot?.querySelector("dialog");
18692
+ if (dialogEl && dialogEl !== this._dialogEl) {
18693
+ this._dialogEl = dialogEl;
18694
+ this._dialogRef.updateDialogElement(dialogEl);
18695
+ }
18687
18696
  this._dialogRef.open();
18688
18697
  }
18689
18698
  close(result) {