@melodicdev/components 1.0.15 → 1.0.17

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.
@@ -1777,12 +1777,21 @@ var TemplateResult = class TemplateResult {
1777
1777
  }
1778
1778
  renderNestedTemplate(part, template) {
1779
1779
  this.ensureMarkers(part);
1780
+ if (part.nestedContainer) {
1781
+ if (part.nestedContainer.__templateKey === getTemplateKey(template.strings)) {
1782
+ template.renderInto(part.nestedContainer);
1783
+ return;
1784
+ }
1785
+ const oldParts = part.nestedContainer.__parts;
1786
+ if (oldParts) this.cleanupParts(oldParts);
1787
+ }
1780
1788
  this.clearRenderedNodes(part);
1781
1789
  part.node.textContent = "";
1782
- const fragment = document.createDocumentFragment();
1783
- template.renderInto(fragment);
1784
- part.renderedNodes = Array.from(fragment.childNodes);
1785
- part.endMarker.parentNode.insertBefore(fragment, part.endMarker);
1790
+ const container = document.createDocumentFragment();
1791
+ template.renderInto(container);
1792
+ part.nestedContainer = container;
1793
+ part.renderedNodes = Array.from(container.childNodes);
1794
+ part.endMarker.parentNode.insertBefore(container, part.endMarker);
1786
1795
  }
1787
1796
  renderNode(part, node) {
1788
1797
  this.ensureMarkers(part);
@@ -11966,6 +11975,7 @@ const tableStyles = () => css`
11966
11975
 
11967
11976
  .ml-table--hoverable .ml-table__row:hover {
11968
11977
  background-color: var(--ml-color-surface-sunken);
11978
+ cursor: pointer;
11969
11979
  }
11970
11980
 
11971
11981
  .ml-table__row--selected {
@@ -18538,13 +18548,6 @@ var DialogRef = class {
18538
18548
  this._dialogEl.addEventListener("cancel", this._handleCancel);
18539
18549
  this._dialogEl.addEventListener("click", this._handleBackdropClick);
18540
18550
  }
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
- }
18548
18551
  get dialogID() {
18549
18552
  return this._dialogID;
18550
18553
  }
@@ -18616,35 +18619,9 @@ var DialogService = class DialogService$1 {
18616
18619
  if (config) dialogElements.dialogRef.applyConfig(config);
18617
18620
  dialogComponent.component.onDialogRefSet?.(dialogElements.dialogRef);
18618
18621
  }
18619
- if (!dialogElements) {
18620
- const mlDialog = this.findDialogElement(dialogID);
18621
- if (mlDialog) {
18622
- mlDialog.component.open();
18623
- dialogElements = this._dialogs.get(dialogID);
18624
- }
18625
- if (!dialogElements) throw new Error(`Dialog "${dialogID}" not found. Ensure an <ml-dialog #${dialogID}> exists in the DOM.`);
18626
- return dialogElements.dialogRef;
18627
- }
18628
18622
  dialogElements.dialogRef.open();
18629
18623
  return dialogElements.dialogRef;
18630
18624
  }
18631
- findDialogElement(dialogID) {
18632
- for (const child of document.body.querySelectorAll("*")) if (child.shadowRoot) {
18633
- const result = this.deepFindDialog(child, dialogID);
18634
- if (result) return result;
18635
- }
18636
- return null;
18637
- }
18638
- deepFindDialog(root, dialogID) {
18639
- const shadowRoot = root.shadowRoot;
18640
- if (!shadowRoot) return null;
18641
- for (const el of shadowRoot.querySelectorAll("ml-dialog")) if (el.hasAttribute(`#${dialogID}`)) return el;
18642
- for (const child of shadowRoot.querySelectorAll("*")) if (child.shadowRoot) {
18643
- const result = this.deepFindDialog(child, dialogID);
18644
- if (result) return result;
18645
- }
18646
- return null;
18647
- }
18648
18625
  close(dialogID, result) {
18649
18626
  if (this._dialogs.has(dialogID)) this._dialogs.get(dialogID).dialogRef.close(result);
18650
18627
  }
@@ -18670,9 +18647,6 @@ var DialogComponent = class DialogComponent$1 {
18670
18647
  this._dialogID = newID();
18671
18648
  this._registered = false;
18672
18649
  }
18673
- onCreate() {
18674
- this.registerDialog();
18675
- }
18676
18650
  registerDialog() {
18677
18651
  if (this._registered) return;
18678
18652
  const dialogEl = this.elementRef.shadowRoot?.querySelector("dialog");
@@ -18688,11 +18662,6 @@ var DialogComponent = class DialogComponent$1 {
18688
18662
  }
18689
18663
  open() {
18690
18664
  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
- }
18696
18665
  this._dialogRef.open();
18697
18666
  }
18698
18667
  close(result) {