@aurodesignsystem-dev/auro-drawer 0.0.0-pr131.19 → 0.0.0-pr131.20

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/demo/api.min.js CHANGED
@@ -3332,6 +3332,7 @@ class AuroFloater extends i$1 {
3332
3332
  * and allow free keyboard flow to background content (WCAG 2.1.2).
3333
3333
  */
3334
3334
  async show() {
3335
+ clearTimeout(this._closeTimeout);
3335
3336
  this.floater.showBib();
3336
3337
  if (!this.bib?.dialog) {
3337
3338
  await this.bib?.updateComplete;
@@ -3364,12 +3365,16 @@ class AuroFloater extends i$1 {
3364
3365
  * Closes the native dialog.
3365
3366
  */
3366
3367
  hide(eventType = undefined) {
3368
+ // Cancel any in-flight close timer so a rapid hide→show sequence doesn't
3369
+ // let a stale timeout fire and close the dialog that was just reopened.
3370
+ clearTimeout(this._closeTimeout);
3371
+
3367
3372
  // Capture now — floater.disconnect() may move or nullify this.bib before
3368
3373
  // the deferred close fires (e.g. when the element is removed from the DOM).
3369
3374
  const dialog = this.bib?.dialog;
3370
3375
  if (dialog?.open) {
3371
3376
  // Modal and nested drawers: opened via showModal() or setAttribute('open').
3372
- setTimeout(() => {
3377
+ this._closeTimeout = setTimeout(() => {
3373
3378
  if (dialog.open) {
3374
3379
  dialog.close();
3375
3380
  }
@@ -3379,7 +3384,7 @@ class AuroFloater extends i$1 {
3379
3384
  // so the popover stays in the top layer unless hidePopover() is called.
3380
3385
  // Guard on hidePopover support: matches(':popover-open') throws a SyntaxError
3381
3386
  // on browsers that don't implement the Popover API.
3382
- setTimeout(() => {
3387
+ this._closeTimeout = setTimeout(() => {
3383
3388
  if (dialog.matches?.(':popover-open')) {
3384
3389
  dialog.hidePopover();
3385
3390
  }
package/demo/index.min.js CHANGED
@@ -3084,6 +3084,7 @@ class AuroFloater extends i$1 {
3084
3084
  * and allow free keyboard flow to background content (WCAG 2.1.2).
3085
3085
  */
3086
3086
  async show() {
3087
+ clearTimeout(this._closeTimeout);
3087
3088
  this.floater.showBib();
3088
3089
  if (!this.bib?.dialog) {
3089
3090
  await this.bib?.updateComplete;
@@ -3116,12 +3117,16 @@ class AuroFloater extends i$1 {
3116
3117
  * Closes the native dialog.
3117
3118
  */
3118
3119
  hide(eventType = undefined) {
3120
+ // Cancel any in-flight close timer so a rapid hide→show sequence doesn't
3121
+ // let a stale timeout fire and close the dialog that was just reopened.
3122
+ clearTimeout(this._closeTimeout);
3123
+
3119
3124
  // Capture now — floater.disconnect() may move or nullify this.bib before
3120
3125
  // the deferred close fires (e.g. when the element is removed from the DOM).
3121
3126
  const dialog = this.bib?.dialog;
3122
3127
  if (dialog?.open) {
3123
3128
  // Modal and nested drawers: opened via showModal() or setAttribute('open').
3124
- setTimeout(() => {
3129
+ this._closeTimeout = setTimeout(() => {
3125
3130
  if (dialog.open) {
3126
3131
  dialog.close();
3127
3132
  }
@@ -3131,7 +3136,7 @@ class AuroFloater extends i$1 {
3131
3136
  // so the popover stays in the top layer unless hidePopover() is called.
3132
3137
  // Guard on hidePopover support: matches(':popover-open') throws a SyntaxError
3133
3138
  // on browsers that don't implement the Popover API.
3134
- setTimeout(() => {
3139
+ this._closeTimeout = setTimeout(() => {
3135
3140
  if (dialog.matches?.(':popover-open')) {
3136
3141
  dialog.hidePopover();
3137
3142
  }
@@ -7,7 +7,7 @@ import{unsafeStatic as e,literal as t,html as o}from"lit/static-html.js";import{
7
7
  <div class="backdrop" part="backdrop"></div>
8
8
  <slot></slot>
9
9
  </dialog>
10
- `}}class Pe extends a{constructor(e){super(),this.behavior=e,this.floater=void 0;const t=`${this.floaterConfig.prefix.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}-bib`;this.floaterBibTag=c.prototype.generateTag(t,"0.0.0",Ue)}get floaterConfig(){return{prefix:"auroFloater"}}static get properties(){return{isPopoverVisible:{attribute:"open",type:Boolean,reflect:!0},triggerElement:{attribute:!1}}}firstUpdated(){this.floater=new Me(this,this.behavior),this.floater.configure(this,this.floaterConfig.prefix),this.bib.addEventListener("dialog-cancel",()=>{this.modal||this.hide()}),this.bib.addEventListener("dialog-backdrop-click",()=>{this.modal||Me.topOpeningFloatingUI===this.floater&&this.hide()})}disconnectedCallback(){this.floater&&this.hide("disconnect")}updated(e){this.floater.handleUpdate(e),e.has("triggerElement")&&(this.floater.configure(this,this.floaterConfig.prefix),this.bib.bibLabel=this.triggerElement?.textContent.trim()),e.has("isPopoverVisible")&&(this.isPopoverVisible?this.show():this.hide())}async show(){if(this.floater.showBib(),this.bib?.dialog||await(this.bib?.updateComplete),!this.bib?.dialog)return;const e=this.nested??!1,t=this.modal??!1;e?this.bib.dialog.setAttribute("open",""):t?(this.bib.dialog.removeAttribute("popover"),this.bib.dialog.showModal()):"function"==typeof this.bib.dialog.showPopover?(this.bib.dialog.setAttribute("popover","manual"),this.bib.dialog.showPopover()):(this.bib.dialog.removeAttribute("popover"),this.bib.dialog.show())}hide(e=void 0){const t=this.bib?.dialog;t?.open?setTimeout(()=>{t.open&&t.close()},300):"function"==typeof t?.hidePopover&&t.matches?.(":popover-open")&&setTimeout(()=>{t.matches?.(":popover-open")&&t.hidePopover(),t.removeAttribute("popover")},300),this.floater.hideBib(e),"disconnect"===e&&this.floater.disconnect()}render(){return o`
10
+ `}}class Pe extends a{constructor(e){super(),this.behavior=e,this.floater=void 0;const t=`${this.floaterConfig.prefix.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}-bib`;this.floaterBibTag=c.prototype.generateTag(t,"0.0.0",Ue)}get floaterConfig(){return{prefix:"auroFloater"}}static get properties(){return{isPopoverVisible:{attribute:"open",type:Boolean,reflect:!0},triggerElement:{attribute:!1}}}firstUpdated(){this.floater=new Me(this,this.behavior),this.floater.configure(this,this.floaterConfig.prefix),this.bib.addEventListener("dialog-cancel",()=>{this.modal||this.hide()}),this.bib.addEventListener("dialog-backdrop-click",()=>{this.modal||Me.topOpeningFloatingUI===this.floater&&this.hide()})}disconnectedCallback(){this.floater&&this.hide("disconnect")}updated(e){this.floater.handleUpdate(e),e.has("triggerElement")&&(this.floater.configure(this,this.floaterConfig.prefix),this.bib.bibLabel=this.triggerElement?.textContent.trim()),e.has("isPopoverVisible")&&(this.isPopoverVisible?this.show():this.hide())}async show(){if(clearTimeout(this._closeTimeout),this.floater.showBib(),this.bib?.dialog||await(this.bib?.updateComplete),!this.bib?.dialog)return;const e=this.nested??!1,t=this.modal??!1;e?this.bib.dialog.setAttribute("open",""):t?(this.bib.dialog.removeAttribute("popover"),this.bib.dialog.showModal()):"function"==typeof this.bib.dialog.showPopover?(this.bib.dialog.setAttribute("popover","manual"),this.bib.dialog.showPopover()):(this.bib.dialog.removeAttribute("popover"),this.bib.dialog.show())}hide(e=void 0){clearTimeout(this._closeTimeout);const t=this.bib?.dialog;t?.open?this._closeTimeout=setTimeout(()=>{t.open&&t.close()},300):"function"==typeof t?.hidePopover&&t.matches?.(":popover-open")&&(this._closeTimeout=setTimeout(()=>{t.matches?.(":popover-open")&&t.hidePopover(),t.removeAttribute("popover")},300)),this.floater.hideBib(e),"disconnect"===e&&this.floater.disconnect()}render(){return o`
11
11
  <${this.floaterBibTag} id="bib"
12
12
  ?data-show=${this.isPopoverVisible}
13
13
  ?onBackdrop="${this.floaterConfig.backdrop}">
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export{A as AuroDrawer}from"./auro-drawer-Bi1OkedP.js";import"lit/static-html.js";import"lit";import"lit/directives/class-map.js";import"lit/directives/if-defined.js";
1
+ export{A as AuroDrawer}from"./auro-drawer-qq2pu5QY.js";import"lit/static-html.js";import"lit";import"lit/directives/class-map.js";import"lit/directives/if-defined.js";
@@ -1 +1 @@
1
- import{A as i}from"./auro-drawer-Bi1OkedP.js";import"lit/static-html.js";import"lit";import"lit/directives/class-map.js";import"lit/directives/if-defined.js";i.register();
1
+ import{A as i}from"./auro-drawer-qq2pu5QY.js";import"lit/static-html.js";import"lit";import"lit/directives/class-map.js";import"lit/directives/if-defined.js";i.register();
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "================================================================================"
8
8
  ],
9
9
  "name": "@aurodesignsystem-dev/auro-drawer",
10
- "version": "0.0.0-pr131.19",
10
+ "version": "0.0.0-pr131.20",
11
11
  "description": "auro-drawer HTML custom element",
12
12
  "repository": {
13
13
  "type": "git",