@ni/nimble-components 21.6.3 → 21.6.5

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.
@@ -2598,9 +2598,8 @@ const Dm=we`
2598
2598
  color: ${Nl};
2599
2599
  }
2600
2600
  `,Nm=Z`
2601
- ${""}
2602
- <section role="region" aria-labelledby="title-slot">
2603
- <slot name="title" id="title-slot"></slot>
2601
+ <section aria-labelledby="title-slot">
2602
+ <span id="title-slot"><slot name="title"></slot></span>
2604
2603
  <slot></slot>
2605
2604
  </section>
2606
2605
  `
@@ -3544,7 +3543,7 @@ const ag=Symbol("user dismissed"),lg=we`
3544
3543
  role="dialog"
3545
3544
  part="control"
3546
3545
  @cancel="${(e,t)=>e.cancelHandler(t.event)}"
3547
- @close="${e=>e.closeHandler()}"
3546
+ @close="${(e,t)=>e.closeHandler(t.event)}"
3548
3547
  aria-labelledby="header"
3549
3548
  >
3550
3549
  <header id="header">
@@ -3569,7 +3568,7 @@ const ag=Symbol("user dismissed"),lg=we`
3569
3568
  `
3570
3569
  class dg extends zt{constructor(){super(...arguments),this.preventDismiss=!1,this.headerHidden=!1,this.footerHidden=!1,this.footerIsEmpty=!0}get open(){return void 0!==this.resolveShow}async show(){if(this.open)throw new Error("Dialog is already open")
3571
3570
  return this.dialogElement.showModal(),new Promise(((e,t)=>{this.resolveShow=e}))}close(e){if(!this.open)throw new Error("Dialog is not open")
3572
- this.dialogElement.close(),this.doResolveShow(e)}slottedFooterElementsChanged(e,t){this.footerIsEmpty=!t?.length}cancelHandler(e){return this.preventDismiss?e.preventDefault():this.doResolveShow(ag),!0}closeHandler(){this.resolveShow&&this.doResolveShow(ag)}doResolveShow(e){if(!this.resolveShow)throw new Error("Do not call doResolveShow unless there is a promise to resolve")
3571
+ this.dialogElement.close(),this.doResolveShow(e)}slottedFooterElementsChanged(e,t){this.footerIsEmpty=!t?.length}cancelHandler(e){return this.preventDismiss?e.preventDefault():this.doResolveShow(ag),!0}closeHandler(e){e.target===this.dialogElement&&this.resolveShow&&this.doResolveShow(ag)}doResolveShow(e){if(!this.resolveShow)throw new Error("Do not call doResolveShow unless there is a promise to resolve")
3573
3572
  this.resolveShow(e),this.resolveShow=void 0}}dg.UserDismissed=ag,e([se({attribute:"prevent-dismiss",mode:"boolean"})],dg.prototype,"preventDismiss",void 0),e([se({attribute:"header-hidden",mode:"boolean"})],dg.prototype,"headerHidden",void 0),e([se({attribute:"footer-hidden",mode:"boolean"})],dg.prototype,"footerHidden",void 0),e([g],dg.prototype,"footerIsEmpty",void 0),e([g],dg.prototype,"slottedFooterElements",void 0),Ht(dg,un)
3574
3573
  const hg=dg.compose({baseName:"dialog",template:cg,styles:lg,baseClass:dg})
3575
3574
  bi.getOrCreate().withPrefix("nimble").register(hg())
@@ -3720,7 +3719,7 @@ const ug=we`
3720
3719
  ${Ne("dialog")}
3721
3720
  aria-label="${e=>e.ariaLabel}"
3722
3721
  @cancel="${(e,t)=>e.cancelHandler(t.event)}"
3723
- @close="${e=>e.closeHandler()}"
3722
+ @close="${(e,t)=>e.closeHandler(t.event)}"
3724
3723
  >
3725
3724
  <div class="dialog-contents">
3726
3725
  <slot></slot>
@@ -3729,7 +3728,7 @@ const ug=we`
3729
3728
  `,fg="right"
3730
3729
  class mg extends zt{constructor(){super(...arguments),this.location=fg,this.preventDismiss=!1,this.closing=!1,this.animationEndHandlerFunction=()=>this.animationEndHandler()}get open(){return void 0!==this.resolveShow}async show(){if(this.open)throw new Error("Drawer is already open")
3731
3730
  return this.openDialog(),new Promise(((e,t)=>{this.resolveShow=e}))}close(e){if(!this.open||this.closing)throw new Error("Drawer is not open or already closing")
3732
- this.closeReason=e,this.closeDialog()}cancelHandler(e){return e.preventDefault(),this.preventDismiss||(this.closeReason=ag,this.closeDialog()),!0}closeHandler(){this.resolveShow&&this.doResolveShow(ag)}doResolveShow(e){if(!this.resolveShow)throw new Error("Do not call doResolveShow unless there is a promise to resolve")
3731
+ this.closeReason=e,this.closeDialog()}cancelHandler(e){return e.preventDefault(),this.preventDismiss||(this.closeReason=ag,this.closeDialog()),!0}closeHandler(e){e.target===this.dialog&&this.resolveShow&&this.doResolveShow(ag)}doResolveShow(e){if(!this.resolveShow)throw new Error("Do not call doResolveShow unless there is a promise to resolve")
3733
3732
  this.resolveShow(e),this.resolveShow=void 0}openDialog(){this.dialog.showModal(),this.triggerAnimation()}closeDialog(){this.closing=!0,this.triggerAnimation()}triggerAnimation(){this.dialog.classList.add("animating"),this.closing&&this.dialog.classList.add("closing"),this.dialog.addEventListener(sa,this.animationEndHandlerFunction)}animationEndHandler(){this.dialog.removeEventListener(sa,this.animationEndHandlerFunction),this.dialog.classList.remove("animating"),this.closing&&(this.dialog.classList.remove("closing"),this.dialog.close(),this.closing=!1,this.doResolveShow(this.closeReason))}}mg.UserDismissed=ag,e([se],mg.prototype,"location",void 0),e([se({attribute:"prevent-dismiss",mode:"boolean"})],mg.prototype,"preventDismiss",void 0),Ht(mg,un)
3734
3733
  const gg=mg.compose({baseName:"drawer",template:pg,styles:ug})
3735
3734
  bi.getOrCreate().withPrefix("nimble").register(gg())