@ni/nimble-components 32.2.9 → 32.2.10

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.
@@ -3652,7 +3652,7 @@ const tv=Symbol("user dismissed"),ev=Mt`
3652
3652
  </template>
3653
3653
  `
3654
3654
  class iv extends We{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")
3655
- return this.dialogElement.showModal(),new Promise(((t,e)=>{this.resolveShow=t}))}close(t){if(!this.open)throw new Error("Dialog is not open")
3655
+ return this.dialogElement.showModal(),await new Promise(((t,e)=>{this.resolveShow=t}))}close(t){if(!this.open)throw new Error("Dialog is not open")
3656
3656
  this.dialogElement.close(),this.doResolveShow(t)}slottedFooterElementsChanged(t,e){this.footerIsEmpty=!e?.length}cancelHandler(t){return this.preventDismiss?t.preventDefault():this.doResolveShow(tv),!0}closeHandler(t){t.target===this.dialogElement&&this.resolveShow&&this.doResolveShow(tv)}doResolveShow(t){if(!this.resolveShow)throw new Error("Do not call doResolveShow unless there is a promise to resolve")
3657
3657
  this.resolveShow(t),this.resolveShow=void 0}}iv.UserDismissed=tv,t([ft({attribute:"prevent-dismiss",mode:"boolean"})],iv.prototype,"preventDismiss",void 0),t([ft({attribute:"header-hidden",mode:"boolean"})],iv.prototype,"headerHidden",void 0),t([ft({attribute:"footer-hidden",mode:"boolean"})],iv.prototype,"footerHidden",void 0),t([C],iv.prototype,"footerIsEmpty",void 0),t([C],iv.prototype,"slottedFooterElements",void 0),Ke(iv,wn)
3658
3658
  const sv=iv.compose({baseName:"dialog",template:nv,styles:ev,baseClass:iv})
@@ -3803,7 +3803,7 @@ const ov=Mt`
3803
3803
  </dialog>
3804
3804
  `,av="right"
3805
3805
  class lv extends We{constructor(){super(...arguments),this.location=av,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")
3806
- return this.openDialog(),new Promise(((t,e)=>{this.resolveShow=t}))}close(t){if(!this.open||this.closing)throw new Error("Drawer is not open or already closing")
3806
+ return this.openDialog(),await new Promise(((t,e)=>{this.resolveShow=t}))}close(t){if(!this.open||this.closing)throw new Error("Drawer is not open or already closing")
3807
3807
  this.closeReason=t,this.closeDialog()}cancelHandler(t){return t.preventDefault(),this.preventDismiss||(this.closeReason=tv,this.closeDialog()),!0}closeHandler(t){t.target===this.dialog&&this.resolveShow&&this.doResolveShow(tv)}doResolveShow(t){if(!this.resolveShow)throw new Error("Do not call doResolveShow unless there is a promise to resolve")
3808
3808
  this.resolveShow(t),this.resolveShow=void 0}openDialog(){this.dialog.showModal(),this.triggerAnimation()}closeDialog(){this.closing=!0,this.triggerAnimation()}triggerAnimation(){this.dialog.offsetHeight,this.dialog.classList.add("animating"),this.closing&&this.dialog.classList.add("closing"),this.dialog.addEventListener(Pa,this.animationEndHandlerFunction)}animationEndHandler(){this.dialog.removeEventListener(Pa,this.animationEndHandlerFunction),this.dialog.classList.remove("animating"),this.closing&&(this.dialog.classList.remove("closing"),this.dialog.close(),this.closing=!1,this.doResolveShow(this.closeReason))}}lv.UserDismissed=tv,t([ft],lv.prototype,"location",void 0),t([ft({attribute:"prevent-dismiss",mode:"boolean"})],lv.prototype,"preventDismiss",void 0),Ke(lv,wn)
3809
3809
  const cv=lv.compose({baseName:"drawer",template:rv,styles:ov})
@@ -8684,7 +8684,7 @@ break
8684
8684
  case"pattern":this.track("pattern")
8685
8685
  break
8686
8686
  case"buttonLabel":this.track("buttonLabel")}this.queueUpdate()}trackMentionElementsInstancesChanged(){this.track("pattern"),this.track("mappingConfigs"),this.track("buttonLabel"),this.queueUpdate()}queueUpdate(){this.richText.$fastController.isConnected&&(this.updateQueued||(this.updateQueued=!0,b.queueUpdate((()=>{this.richText.createConfig(),this.untrackAll(),this.updateQueued=!1}))))}}class iE{constructor(){this.invalidMentionConfiguration=!1,this.duplicateMentionConfiguration=!1}getValidity(){return{invalidMentionConfiguration:this.invalidMentionConfiguration,duplicateMentionConfiguration:this.duplicateMentionConfiguration}}isValid(){return Object.values(this.getValidity()).every((t=>!1===t))}validate(t){this.validateDuplicateMentionConfigurations(t),this.validateMentionConfigurations(t)}validateMentionConfigurations(t){return this.invalidMentionConfiguration=t.some((t=>!t.mentionInternals.validator.isValid())),!this.invalidMentionConfiguration}validateDuplicateMentionConfigurations(t){const e=t.map((t=>t.mentionInternals.character))
8687
- return this.duplicateMentionConfiguration=e.length!==new Set(e).size,!this.duplicateMentionConfiguration}}async function sE(t){const e=t.map((async t=>t.matches(":not(:defined)")?customElements.whenDefined(t.localName):Promise.resolve()))
8687
+ return this.duplicateMentionConfiguration=e.length!==new Set(e).size,!this.duplicateMentionConfiguration}}async function sE(t){const e=t.map((async t=>{t.matches(":not(:defined)")&&await customElements.whenDefined(t.localName)}))
8688
8688
  await Promise.all(e)}class oE extends We{constructor(){super(...arguments),this.mentionInternalsNotifiers=[],this.childItems=[],this.richTextUpdateTracker=new nE(this),this.richTextValidator=new iE}get validity(){return this.richTextValidator.getValidity()}checkValidity(){return this.richTextValidator.isValid()}handleChange(t,e){t instanceof KD&&"string"==typeof e&&this.richTextUpdateTracker.trackMentionInternalsPropertyChanged(e)}createConfig(){this.validate(),this.richTextValidator.isValid()?(this.richTextUpdateTracker.updateMappingConfigs||this.richTextUpdateTracker.updatePattern)&&(this.configuration=new JD(this.mentionElements)):this.configuration=void 0}validate(){this.richTextValidator.validate(this.mentionElements)}childItemsChanged(t,e){void 0!==t&&this.updateMentionElementsFromChildItems()}async updateMentionElementsFromChildItems(){await sE(this.childItems),this.mentionElements=this.childItems.filter((t=>t instanceof YD)),this.observeMentionInternals(),this.richTextUpdateTracker.trackMentionElementsInstancesChanged()}observeMentionInternals(){this.removeMentionInternalsObservers()
8689
8689
  for(const t of this.mentionElements){const e=x.getNotifier(t.mentionInternals)
8690
8690
  e.subscribe(this),this.mentionInternalsNotifiers.push(e)}}removeMentionInternalsObservers(){this.mentionInternalsNotifiers.forEach((t=>{t.unsubscribe(this)})),this.mentionInternalsNotifiers=[]}}t([C],oE.prototype,"childItems",void 0),t([C],oE.prototype,"configuration",void 0)