@ionic/core 7.3.2-dev.11692887667.1614d10a → 7.3.2-dev.11693262117.17edbf6d

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.
Files changed (105) hide show
  1. package/components/action-sheet.js +8 -17
  2. package/components/alert.js +8 -17
  3. package/components/ion-loading.js +8 -17
  4. package/components/ion-menu.js +15 -2
  5. package/components/ion-modal.js +12 -33
  6. package/components/ion-picker.js +8 -17
  7. package/components/ion-toast.js +8 -17
  8. package/components/overlays.js +22 -1
  9. package/components/popover.js +8 -29
  10. package/dist/cjs/index.cjs.js +1 -1
  11. package/dist/cjs/ion-action-sheet.cjs.entry.js +8 -17
  12. package/dist/cjs/ion-alert.cjs.entry.js +8 -17
  13. package/dist/cjs/ion-datetime_3.cjs.entry.js +8 -17
  14. package/dist/cjs/ion-loading.cjs.entry.js +8 -17
  15. package/dist/cjs/ion-menu_3.cjs.entry.js +15 -2
  16. package/dist/cjs/ion-modal.cjs.entry.js +12 -33
  17. package/dist/cjs/ion-popover.cjs.entry.js +8 -29
  18. package/dist/cjs/ion-select_3.cjs.entry.js +1 -1
  19. package/dist/cjs/ion-toast.cjs.entry.js +8 -17
  20. package/dist/cjs/{overlays-0ea06fcb.js → overlays-2b9fa92e.js} +22 -0
  21. package/dist/collection/components/action-sheet/action-sheet.js +8 -17
  22. package/dist/collection/components/alert/alert.js +8 -17
  23. package/dist/collection/components/loading/loading.js +8 -17
  24. package/dist/collection/components/menu/menu.js +14 -1
  25. package/dist/collection/components/menu-button/test/async/menu-button.e2e.js +23 -0
  26. package/dist/collection/components/modal/modal.js +12 -33
  27. package/dist/collection/components/picker/picker.js +8 -17
  28. package/dist/collection/components/popover/popover.js +8 -29
  29. package/dist/collection/components/toast/toast.js +8 -17
  30. package/dist/collection/utils/overlays.js +21 -0
  31. package/dist/docs.json +1 -1
  32. package/dist/esm/index.js +1 -1
  33. package/dist/esm/ion-action-sheet.entry.js +8 -17
  34. package/dist/esm/ion-alert.entry.js +8 -17
  35. package/dist/esm/ion-datetime_3.entry.js +8 -17
  36. package/dist/esm/ion-loading.entry.js +8 -17
  37. package/dist/esm/ion-menu_3.entry.js +15 -2
  38. package/dist/esm/ion-modal.entry.js +12 -33
  39. package/dist/esm/ion-popover.entry.js +8 -29
  40. package/dist/esm/ion-select_3.entry.js +1 -1
  41. package/dist/esm/ion-toast.entry.js +8 -17
  42. package/dist/esm/{overlays-c3387ec0.js → overlays-66222f79.js} +22 -1
  43. package/dist/esm-es5/index.js +1 -1
  44. package/dist/esm-es5/ion-action-sheet.entry.js +1 -1
  45. package/dist/esm-es5/ion-alert.entry.js +1 -1
  46. package/dist/esm-es5/ion-datetime_3.entry.js +1 -1
  47. package/dist/esm-es5/ion-loading.entry.js +1 -1
  48. package/dist/esm-es5/ion-menu_3.entry.js +1 -1
  49. package/dist/esm-es5/ion-modal.entry.js +1 -1
  50. package/dist/esm-es5/ion-popover.entry.js +1 -1
  51. package/dist/esm-es5/ion-select_3.entry.js +1 -1
  52. package/dist/esm-es5/ion-toast.entry.js +1 -1
  53. package/dist/esm-es5/{overlays-c3387ec0.js → overlays-66222f79.js} +1 -1
  54. package/dist/ionic/index.esm.js +1 -1
  55. package/dist/ionic/ionic.esm.js +1 -1
  56. package/dist/ionic/{p-8fa43732.system.entry.js → p-0494a5b7.system.entry.js} +1 -1
  57. package/dist/ionic/p-16fd72f2.entry.js +4 -0
  58. package/dist/ionic/p-1c9e3bc7.entry.js +4 -0
  59. package/dist/ionic/p-2a51c81c.entry.js +4 -0
  60. package/dist/ionic/p-2a649b3e.system.entry.js +4 -0
  61. package/dist/ionic/p-3ef9e271.system.entry.js +4 -0
  62. package/dist/ionic/p-6d484719.system.entry.js +4 -0
  63. package/dist/ionic/p-70d137a0.js +4 -0
  64. package/dist/ionic/p-721933ff.system.js +1 -1
  65. package/dist/ionic/{p-c0d1e5a1.entry.js → p-7776d062.entry.js} +1 -1
  66. package/dist/ionic/p-7ac9bdfa.system.entry.js +4 -0
  67. package/dist/ionic/p-8d53d5a5.entry.js +4 -0
  68. package/dist/ionic/p-9888a5a7.entry.js +4 -0
  69. package/dist/ionic/{p-db46fc66.system.js → p-a0ffdd91.system.js} +1 -1
  70. package/dist/ionic/p-a133c215.system.entry.js +4 -0
  71. package/dist/ionic/p-b2098e96.system.entry.js +4 -0
  72. package/dist/ionic/p-c0b4ca5c.system.entry.js +4 -0
  73. package/dist/ionic/p-cf768a4f.entry.js +4 -0
  74. package/dist/ionic/p-ddffbfa9.entry.js +4 -0
  75. package/dist/ionic/p-e2e2c2b0.entry.js +4 -0
  76. package/dist/ionic/p-ebb442c4.system.entry.js +4 -0
  77. package/dist/ionic/{p-81b46714.system.js → p-f8e4da48.system.js} +1 -1
  78. package/dist/types/components/action-sheet/action-sheet.d.ts +1 -1
  79. package/dist/types/components/alert/alert.d.ts +1 -1
  80. package/dist/types/components/loading/loading.d.ts +1 -1
  81. package/dist/types/components/menu/menu.d.ts +2 -0
  82. package/dist/types/components/modal/modal.d.ts +1 -1
  83. package/dist/types/components/picker/picker.d.ts +1 -1
  84. package/dist/types/components/popover/popover.d.ts +1 -1
  85. package/dist/types/components/toast/toast.d.ts +1 -1
  86. package/dist/types/utils/overlays.d.ts +9 -0
  87. package/hydrate/index.js +87 -141
  88. package/package.json +2 -2
  89. package/dist/ionic/p-06f1f560.system.entry.js +0 -4
  90. package/dist/ionic/p-2936ec7f.system.entry.js +0 -4
  91. package/dist/ionic/p-29b3e70a.entry.js +0 -4
  92. package/dist/ionic/p-2bc49e5d.system.entry.js +0 -4
  93. package/dist/ionic/p-2da3e015.system.entry.js +0 -4
  94. package/dist/ionic/p-423d5a4d.entry.js +0 -4
  95. package/dist/ionic/p-564aaba3.entry.js +0 -4
  96. package/dist/ionic/p-5ef91692.js +0 -4
  97. package/dist/ionic/p-61769039.entry.js +0 -4
  98. package/dist/ionic/p-74723f41.entry.js +0 -4
  99. package/dist/ionic/p-8b55f026.entry.js +0 -4
  100. package/dist/ionic/p-9b3c3564.entry.js +0 -4
  101. package/dist/ionic/p-ac80da6c.system.entry.js +0 -4
  102. package/dist/ionic/p-ccea9adc.system.entry.js +0 -4
  103. package/dist/ionic/p-d5db0834.system.entry.js +0 -4
  104. package/dist/ionic/p-d8538837.entry.js +0 -4
  105. package/dist/ionic/p-dd0b6889.system.entry.js +0 -4
@@ -4,7 +4,7 @@
4
4
  import { proxyCustomElement, HTMLElement, createEvent, readTask, h, Host } from '@stencil/core/internal/client';
5
5
  import { c as createButtonActiveGesture } from './button-active.js';
6
6
  import { r as raf } from './helpers.js';
7
- import { d as createDelegateController, e as createTriggerController, B as BACKDROP, i as isCancel, f as present, g as dismiss, h as eventMethod, s as safeCall, j as prepareOverlay, k as setOverlayId } from './overlays.js';
7
+ import { d as createDelegateController, e as createLockController, f as createTriggerController, B as BACKDROP, i as isCancel, g as present, h as dismiss, j as eventMethod, s as safeCall, k as prepareOverlay, n as setOverlayId } from './overlays.js';
8
8
  import { g as getClassMap } from './theme.js';
9
9
  import { b as getIonMode } from './ionic-global.js';
10
10
  import { c as createAnimation } from './animation.js';
@@ -113,6 +113,7 @@ const ActionSheet = /*@__PURE__*/ proxyCustomElement(class ActionSheet extends H
113
113
  this.willDismissShorthand = createEvent(this, "willDismiss", 7);
114
114
  this.didDismissShorthand = createEvent(this, "didDismiss", 7);
115
115
  this.delegateController = createDelegateController(this);
116
+ this.lockController = createLockController();
116
117
  this.triggerController = createTriggerController();
117
118
  this.presented = false;
118
119
  this.onBackdropTap = () => {
@@ -160,21 +161,10 @@ const ActionSheet = /*@__PURE__*/ proxyCustomElement(class ActionSheet extends H
160
161
  * Present the action sheet overlay after it has been created.
161
162
  */
162
163
  async present() {
163
- /**
164
- * When using an inline action sheet
165
- * and dismissing a action sheet it is possible to
166
- * quickly present the action sheet while it is
167
- * dismissing. We need to await any current
168
- * transition to allow the dismiss to finish
169
- * before presenting again.
170
- */
171
- if (this.currentTransition !== undefined) {
172
- await this.currentTransition;
173
- }
164
+ const unlock = await this.lockController.lock();
174
165
  await this.delegateController.attachViewToDom();
175
- this.currentTransition = present(this, 'actionSheetEnter', iosEnterAnimation, mdEnterAnimation);
176
- await this.currentTransition;
177
- this.currentTransition = undefined;
166
+ await present(this, 'actionSheetEnter', iosEnterAnimation, mdEnterAnimation);
167
+ unlock();
178
168
  }
179
169
  /**
180
170
  * Dismiss the action sheet overlay after it has been presented.
@@ -186,11 +176,12 @@ const ActionSheet = /*@__PURE__*/ proxyCustomElement(class ActionSheet extends H
186
176
  * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
187
177
  */
188
178
  async dismiss(data, role) {
189
- this.currentTransition = dismiss(this, data, role, 'actionSheetLeave', iosLeaveAnimation, mdLeaveAnimation);
190
- const dismissed = await this.currentTransition;
179
+ const unlock = await this.lockController.lock();
180
+ const dismissed = await dismiss(this, data, role, 'actionSheetLeave', iosLeaveAnimation, mdLeaveAnimation);
191
181
  if (dismissed) {
192
182
  this.delegateController.removeViewFromDom();
193
183
  }
184
+ unlock();
194
185
  return dismissed;
195
186
  }
196
187
  /**
@@ -5,7 +5,7 @@ import { proxyCustomElement, HTMLElement, createEvent, forceUpdate, h, Host } fr
5
5
  import { E as ENABLE_HTML_CONTENT_DEFAULT, a as sanitizeDOMString } from './config.js';
6
6
  import { c as createButtonActiveGesture } from './button-active.js';
7
7
  import { r as raf } from './helpers.js';
8
- import { d as createDelegateController, e as createTriggerController, B as BACKDROP, i as isCancel, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod, s as safeCall } from './overlays.js';
8
+ import { d as createDelegateController, e as createLockController, f as createTriggerController, B as BACKDROP, i as isCancel, k as prepareOverlay, n as setOverlayId, g as present, h as dismiss, j as eventMethod, s as safeCall } from './overlays.js';
9
9
  import { g as getClassMap } from './theme.js';
10
10
  import { c as config, b as getIonMode } from './ionic-global.js';
11
11
  import { c as createAnimation } from './animation.js';
@@ -114,6 +114,7 @@ const Alert = /*@__PURE__*/ proxyCustomElement(class Alert extends HTMLElement {
114
114
  this.willDismissShorthand = createEvent(this, "willDismiss", 7);
115
115
  this.didDismissShorthand = createEvent(this, "didDismiss", 7);
116
116
  this.delegateController = createDelegateController(this);
117
+ this.lockController = createLockController();
117
118
  this.triggerController = createTriggerController();
118
119
  this.customHTMLEnabled = config.get('innerHTMLTemplatesEnabled', ENABLE_HTML_CONTENT_DEFAULT);
119
120
  this.processedInputs = [];
@@ -280,21 +281,10 @@ const Alert = /*@__PURE__*/ proxyCustomElement(class Alert extends HTMLElement {
280
281
  * Present the alert overlay after it has been created.
281
282
  */
282
283
  async present() {
283
- /**
284
- * When using an inline alert
285
- * and dismissing an alert it is possible to
286
- * quickly present the alert while it is
287
- * dismissing. We need to await any current
288
- * transition to allow the dismiss to finish
289
- * before presenting again.
290
- */
291
- if (this.currentTransition !== undefined) {
292
- await this.currentTransition;
293
- }
284
+ const unlock = await this.lockController.lock();
294
285
  await this.delegateController.attachViewToDom();
295
- this.currentTransition = present(this, 'alertEnter', iosEnterAnimation, mdEnterAnimation);
296
- await this.currentTransition;
297
- this.currentTransition = undefined;
286
+ await present(this, 'alertEnter', iosEnterAnimation, mdEnterAnimation);
287
+ unlock();
298
288
  }
299
289
  /**
300
290
  * Dismiss the alert overlay after it has been presented.
@@ -306,11 +296,12 @@ const Alert = /*@__PURE__*/ proxyCustomElement(class Alert extends HTMLElement {
306
296
  * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
307
297
  */
308
298
  async dismiss(data, role) {
309
- this.currentTransition = dismiss(this, data, role, 'alertLeave', iosLeaveAnimation, mdLeaveAnimation);
310
- const dismissed = await this.currentTransition;
299
+ const unlock = await this.lockController.lock();
300
+ const dismissed = await dismiss(this, data, role, 'alertLeave', iosLeaveAnimation, mdLeaveAnimation);
311
301
  if (dismissed) {
312
302
  this.delegateController.removeViewFromDom();
313
303
  }
304
+ unlock();
314
305
  return dismissed;
315
306
  }
316
307
  /**
@@ -4,7 +4,7 @@
4
4
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
5
5
  import { E as ENABLE_HTML_CONTENT_DEFAULT, a as sanitizeDOMString } from './config.js';
6
6
  import { r as raf } from './helpers.js';
7
- import { d as createDelegateController, e as createTriggerController, B as BACKDROP, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod } from './overlays.js';
7
+ import { d as createDelegateController, e as createLockController, f as createTriggerController, B as BACKDROP, k as prepareOverlay, n as setOverlayId, g as present, h as dismiss, j as eventMethod } from './overlays.js';
8
8
  import { g as getClassMap } from './theme.js';
9
9
  import { c as config, b as getIonMode } from './ionic-global.js';
10
10
  import { c as createAnimation } from './animation.js';
@@ -116,6 +116,7 @@ const Loading = /*@__PURE__*/ proxyCustomElement(class Loading extends HTMLEleme
116
116
  this.willDismissShorthand = createEvent(this, "willDismiss", 7);
117
117
  this.didDismissShorthand = createEvent(this, "didDismiss", 7);
118
118
  this.delegateController = createDelegateController(this);
119
+ this.lockController = createLockController();
119
120
  this.triggerController = createTriggerController();
120
121
  this.customHTMLEnabled = config.get('innerHTMLTemplatesEnabled', ENABLE_HTML_CONTENT_DEFAULT);
121
122
  this.presented = false;
@@ -181,24 +182,13 @@ const Loading = /*@__PURE__*/ proxyCustomElement(class Loading extends HTMLEleme
181
182
  * Present the loading overlay after it has been created.
182
183
  */
183
184
  async present() {
184
- /**
185
- * When using an inline loading indicator
186
- * and dismissing a loading indicator it is possible to
187
- * quickly present the loading indicator while it is
188
- * dismissing. We need to await any current
189
- * transition to allow the dismiss to finish
190
- * before presenting again.
191
- */
192
- if (this.currentTransition !== undefined) {
193
- await this.currentTransition;
194
- }
185
+ const unlock = await this.lockController.lock();
195
186
  await this.delegateController.attachViewToDom();
196
- this.currentTransition = present(this, 'loadingEnter', iosEnterAnimation, mdEnterAnimation);
197
- await this.currentTransition;
187
+ await present(this, 'loadingEnter', iosEnterAnimation, mdEnterAnimation);
198
188
  if (this.duration > 0) {
199
189
  this.durationTimeout = setTimeout(() => this.dismiss(), this.duration + 10);
200
190
  }
201
- this.currentTransition = undefined;
191
+ unlock();
202
192
  }
203
193
  /**
204
194
  * Dismiss the loading overlay after it has been presented.
@@ -210,14 +200,15 @@ const Loading = /*@__PURE__*/ proxyCustomElement(class Loading extends HTMLEleme
210
200
  * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
211
201
  */
212
202
  async dismiss(data, role) {
203
+ const unlock = await this.lockController.lock();
213
204
  if (this.durationTimeout) {
214
205
  clearTimeout(this.durationTimeout);
215
206
  }
216
- this.currentTransition = dismiss(this, data, role, 'loadingLeave', iosLeaveAnimation, mdLeaveAnimation);
217
- const dismissed = await this.currentTransition;
207
+ const dismissed = await dismiss(this, data, role, 'loadingLeave', iosLeaveAnimation, mdLeaveAnimation);
218
208
  if (dismissed) {
219
209
  this.delegateController.removeViewFromDom();
220
210
  }
211
+ unlock();
221
212
  return dismissed;
222
213
  }
223
214
  /**
@@ -7,7 +7,7 @@ import { d as doc } from './index5.js';
7
7
  import { G as GESTURE_CONTROLLER } from './gesture-controller.js';
8
8
  import { o as isEndSide, i as inheritAriaAttributes, p as assert, m as clamp } from './helpers.js';
9
9
  import { m as menuController } from './index4.js';
10
- import { o as getOverlay } from './overlays.js';
10
+ import { q as getOverlay } from './overlays.js';
11
11
  import { c as config, b as getIonMode } from './ionic-global.js';
12
12
  import { d as defineCustomElement$2 } from './backdrop.js';
13
13
 
@@ -32,6 +32,7 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
32
32
  this.ionMenuChange = createEvent(this, "ionMenuChange", 7);
33
33
  this.lastOnEnd = 0;
34
34
  this.blocker = GESTURE_CONTROLLER.createBlocker({ disableScroll: true });
35
+ this.didLoad = false;
35
36
  this.isAnimating = false;
36
37
  this._isOpen = false;
37
38
  this.inheritedAttributes = {};
@@ -119,6 +120,7 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
119
120
  this.sideChanged();
120
121
  // register this menu with the app's menu controller
121
122
  menuController._register(this);
123
+ this.menuChanged();
122
124
  this.gesture = (await import('./index2.js')).createGesture({
123
125
  el: document,
124
126
  gestureName: 'menu-swipe',
@@ -137,9 +139,20 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
137
139
  this.inheritedAttributes = inheritAriaAttributes(this.el);
138
140
  }
139
141
  async componentDidLoad() {
140
- this.ionMenuChange.emit({ disabled: this.disabled, open: this._isOpen });
142
+ this.didLoad = true;
143
+ this.menuChanged();
141
144
  this.updateState();
142
145
  }
146
+ menuChanged() {
147
+ /**
148
+ * Inform dependent components such as ion-menu-button
149
+ * that the menu is ready. Note that we only want to do this
150
+ * once the menu has been rendered which is why we check for didLoad.
151
+ */
152
+ if (this.didLoad) {
153
+ this.ionMenuChange.emit({ disabled: this.disabled, open: this._isOpen });
154
+ }
155
+ }
143
156
  async disconnectedCallback() {
144
157
  /**
145
158
  * The menu should be closed when it is
@@ -7,7 +7,7 @@ import { C as CoreDelegate, a as attachComponent, d as detachComponent } from '.
7
7
  import { g as getElementRoot, m as clamp, r as raf, d as inheritAttributes, l as hasLazyBuild } from './helpers.js';
8
8
  import { p as printIonWarning } from './index6.js';
9
9
  import { g as getCapacitor } from './capacitor.js';
10
- import { G as GESTURE, e as createTriggerController, B as BACKDROP, j as prepareOverlay, k as setOverlayId, f as present, q as activeAnimations, g as dismiss, h as eventMethod } from './overlays.js';
10
+ import { G as GESTURE, e as createLockController, f as createTriggerController, B as BACKDROP, k as prepareOverlay, n as setOverlayId, g as present, r as activeAnimations, h as dismiss, j as eventMethod } from './overlays.js';
11
11
  import { g as getClassMap } from './theme.js';
12
12
  import { e as deepReady, w as waitForMount } from './index3.js';
13
13
  import { b as getIonMode, c as config } from './ionic-global.js';
@@ -1113,6 +1113,7 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
1113
1113
  this.willDismissShorthand = createEvent(this, "willDismiss", 7);
1114
1114
  this.didDismissShorthand = createEvent(this, "didDismiss", 7);
1115
1115
  this.ionMount = createEvent(this, "ionMount", 7);
1116
+ this.lockController = createLockController();
1116
1117
  this.triggerController = createTriggerController();
1117
1118
  this.coreDelegate = CoreDelegate();
1118
1119
  this.isSheetModal = false;
@@ -1280,18 +1281,8 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
1280
1281
  if (this.presented) {
1281
1282
  return;
1282
1283
  }
1284
+ const unlock = await this.lockController.lock();
1283
1285
  const { presentingElement, el } = this;
1284
- /**
1285
- * When using an inline modal
1286
- * and dismissing a modal it is possible to
1287
- * quickly present the modal while it is
1288
- * dismissing. We need to await any current
1289
- * transition to allow the dismiss to finish
1290
- * before presenting again.
1291
- */
1292
- if (this.currentTransition !== undefined) {
1293
- await this.currentTransition;
1294
- }
1295
1286
  /**
1296
1287
  * If the modal is presented multiple times (inline modals), we
1297
1288
  * need to reset the current breakpoint to the initial breakpoint.
@@ -1323,11 +1314,6 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
1323
1314
  await waitForMount();
1324
1315
  }
1325
1316
  writeTask(() => this.el.classList.add('show-modal'));
1326
- this.currentTransition = present(this, 'modalEnter', iosEnterAnimation, mdEnterAnimation, {
1327
- presentingEl: presentingElement,
1328
- currentBreakpoint: this.initialBreakpoint,
1329
- backdropBreakpoint: this.backdropBreakpoint,
1330
- });
1331
1317
  /* tslint:disable-next-line */
1332
1318
  if (typeof window !== 'undefined') {
1333
1319
  /**
@@ -1370,14 +1356,18 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
1370
1356
  this.statusBarStyle = await StatusBar.getStyle();
1371
1357
  setCardStatusBarDark();
1372
1358
  }
1373
- await this.currentTransition;
1359
+ await present(this, 'modalEnter', iosEnterAnimation, mdEnterAnimation, {
1360
+ presentingEl: presentingElement,
1361
+ currentBreakpoint: this.initialBreakpoint,
1362
+ backdropBreakpoint: this.backdropBreakpoint,
1363
+ });
1374
1364
  if (this.isSheetModal) {
1375
1365
  this.initSheetGesture();
1376
1366
  }
1377
1367
  else if (hasCardModal) {
1378
1368
  this.initSwipeToClose();
1379
1369
  }
1380
- this.currentTransition = undefined;
1370
+ unlock();
1381
1371
  }
1382
1372
  initSwipeToClose() {
1383
1373
  var _a;
@@ -1467,6 +1457,7 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
1467
1457
  if (this.gestureAnimationDismissing && role !== GESTURE) {
1468
1458
  return false;
1469
1459
  }
1460
+ const unlock = await this.lockController.lock();
1470
1461
  /**
1471
1462
  * If a canDismiss handler is responsible
1472
1463
  * for calling the dismiss method, we should
@@ -1490,24 +1481,12 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
1490
1481
  window.removeEventListener(KEYBOARD_DID_OPEN, this.keyboardOpenCallback);
1491
1482
  this.keyboardOpenCallback = undefined;
1492
1483
  }
1493
- /**
1494
- * When using an inline modal
1495
- * and presenting a modal it is possible to
1496
- * quickly dismiss the modal while it is
1497
- * presenting. We need to await any current
1498
- * transition to allow the present to finish
1499
- * before dismissing again.
1500
- */
1501
- if (this.currentTransition !== undefined) {
1502
- await this.currentTransition;
1503
- }
1504
1484
  const enteringAnimation = activeAnimations.get(this) || [];
1505
- this.currentTransition = dismiss(this, data, role, 'modalLeave', iosLeaveAnimation, mdLeaveAnimation, {
1485
+ const dismissed = await dismiss(this, data, role, 'modalLeave', iosLeaveAnimation, mdLeaveAnimation, {
1506
1486
  presentingEl: presentingElement,
1507
1487
  currentBreakpoint: (_a = this.currentBreakpoint) !== null && _a !== void 0 ? _a : this.initialBreakpoint,
1508
1488
  backdropBreakpoint: this.backdropBreakpoint,
1509
1489
  });
1510
- const dismissed = await this.currentTransition;
1511
1490
  if (dismissed) {
1512
1491
  const { delegate } = this.getDelegate();
1513
1492
  await detachComponent(delegate, this.usersElement);
@@ -1521,8 +1500,8 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
1521
1500
  enteringAnimation.forEach((ani) => ani.destroy());
1522
1501
  }
1523
1502
  this.currentBreakpoint = undefined;
1524
- this.currentTransition = undefined;
1525
1503
  this.animation = undefined;
1504
+ unlock();
1526
1505
  return dismissed;
1527
1506
  }
1528
1507
  /**
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
5
5
  import { r as raf } from './helpers.js';
6
- import { d as createDelegateController, e as createTriggerController, B as BACKDROP, i as isCancel, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod, s as safeCall } from './overlays.js';
6
+ import { d as createDelegateController, e as createLockController, f as createTriggerController, B as BACKDROP, i as isCancel, k as prepareOverlay, n as setOverlayId, g as present, h as dismiss, j as eventMethod, s as safeCall } from './overlays.js';
7
7
  import { g as getClassMap } from './theme.js';
8
8
  import { b as getIonMode } from './ionic-global.js';
9
9
  import { c as createAnimation } from './animation.js';
@@ -71,6 +71,7 @@ const Picker = /*@__PURE__*/ proxyCustomElement(class Picker extends HTMLElement
71
71
  this.willDismissShorthand = createEvent(this, "willDismiss", 7);
72
72
  this.didDismissShorthand = createEvent(this, "didDismiss", 7);
73
73
  this.delegateController = createDelegateController(this);
74
+ this.lockController = createLockController();
74
75
  this.triggerController = createTriggerController();
75
76
  this.onBackdropTap = () => {
76
77
  this.dismiss(undefined, BACKDROP);
@@ -137,24 +138,13 @@ const Picker = /*@__PURE__*/ proxyCustomElement(class Picker extends HTMLElement
137
138
  * Present the picker overlay after it has been created.
138
139
  */
139
140
  async present() {
140
- /**
141
- * When using an inline picker
142
- * and dismissing an picker it is possible to
143
- * quickly present the picker while it is
144
- * dismissing. We need to await any current
145
- * transition to allow the dismiss to finish
146
- * before presenting again.
147
- */
148
- if (this.currentTransition !== undefined) {
149
- await this.currentTransition;
150
- }
141
+ const unlock = await this.lockController.lock();
151
142
  await this.delegateController.attachViewToDom();
152
- this.currentTransition = present(this, 'pickerEnter', iosEnterAnimation, iosEnterAnimation, undefined);
153
- await this.currentTransition;
154
- this.currentTransition = undefined;
143
+ await present(this, 'pickerEnter', iosEnterAnimation, iosEnterAnimation, undefined);
155
144
  if (this.duration > 0) {
156
145
  this.durationTimeout = setTimeout(() => this.dismiss(), this.duration);
157
146
  }
147
+ unlock();
158
148
  }
159
149
  /**
160
150
  * Dismiss the picker overlay after it has been presented.
@@ -166,14 +156,15 @@ const Picker = /*@__PURE__*/ proxyCustomElement(class Picker extends HTMLElement
166
156
  * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
167
157
  */
168
158
  async dismiss(data, role) {
159
+ const unlock = await this.lockController.lock();
169
160
  if (this.durationTimeout) {
170
161
  clearTimeout(this.durationTimeout);
171
162
  }
172
- this.currentTransition = dismiss(this, data, role, 'pickerLeave', iosLeaveAnimation, iosLeaveAnimation);
173
- const dismissed = await this.currentTransition;
163
+ const dismissed = await dismiss(this, data, role, 'pickerLeave', iosLeaveAnimation, iosLeaveAnimation);
174
164
  if (dismissed) {
175
165
  this.delegateController.removeViewFromDom();
176
166
  }
167
+ unlock();
177
168
  return dismissed;
178
169
  }
179
170
  /**
@@ -5,7 +5,7 @@ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/
5
5
  import { E as ENABLE_HTML_CONTENT_DEFAULT, a as sanitizeDOMString } from './config.js';
6
6
  import { g as getElementRoot, r as raf } from './helpers.js';
7
7
  import { p as printIonWarning } from './index6.js';
8
- import { d as createDelegateController, e as createTriggerController, i as isCancel, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod, s as safeCall } from './overlays.js';
8
+ import { d as createDelegateController, e as createLockController, f as createTriggerController, i as isCancel, k as prepareOverlay, n as setOverlayId, g as present, h as dismiss, j as eventMethod, s as safeCall } from './overlays.js';
9
9
  import { g as getClassMap, c as createColorClasses } from './theme.js';
10
10
  import { c as config, b as getIonMode } from './ionic-global.js';
11
11
  import { c as createAnimation } from './animation.js';
@@ -123,6 +123,7 @@ const Toast = /*@__PURE__*/ proxyCustomElement(class Toast extends HTMLElement {
123
123
  this.willDismissShorthand = createEvent(this, "willDismiss", 7);
124
124
  this.didDismissShorthand = createEvent(this, "didDismiss", 7);
125
125
  this.delegateController = createDelegateController(this);
126
+ this.lockController = createLockController();
126
127
  this.triggerController = createTriggerController();
127
128
  this.customHTMLEnabled = config.get('innerHTMLTemplatesEnabled', ENABLE_HTML_CONTENT_DEFAULT);
128
129
  this.presented = false;
@@ -192,30 +193,19 @@ const Toast = /*@__PURE__*/ proxyCustomElement(class Toast extends HTMLElement {
192
193
  * Present the toast overlay after it has been created.
193
194
  */
194
195
  async present() {
195
- /**
196
- * When using an inline toast
197
- * and dismissing a toast it is possible to
198
- * quickly present the toast while it is
199
- * dismissing. We need to await any current
200
- * transition to allow the dismiss to finish
201
- * before presenting again.
202
- */
203
- if (this.currentTransition !== undefined) {
204
- await this.currentTransition;
205
- }
196
+ const unlock = await this.lockController.lock();
206
197
  await this.delegateController.attachViewToDom();
207
- this.currentTransition = present(this, 'toastEnter', iosEnterAnimation, mdEnterAnimation, this.position);
208
- await this.currentTransition;
198
+ await present(this, 'toastEnter', iosEnterAnimation, mdEnterAnimation, this.position);
209
199
  /**
210
200
  * Content is revealed to screen readers after
211
201
  * the transition to avoid jank since this
212
202
  * state updates will cause a re-render.
213
203
  */
214
204
  this.revealContentToScreenReader = true;
215
- this.currentTransition = undefined;
216
205
  if (this.duration > 0) {
217
206
  this.durationTimeout = setTimeout(() => this.dismiss(undefined, 'timeout'), this.duration);
218
207
  }
208
+ unlock();
219
209
  }
220
210
  /**
221
211
  * Dismiss the toast overlay after it has been presented.
@@ -227,15 +217,16 @@ const Toast = /*@__PURE__*/ proxyCustomElement(class Toast extends HTMLElement {
227
217
  * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
228
218
  */
229
219
  async dismiss(data, role) {
220
+ const unlock = await this.lockController.lock();
230
221
  if (this.durationTimeout) {
231
222
  clearTimeout(this.durationTimeout);
232
223
  }
233
- this.currentTransition = dismiss(this, data, role, 'toastLeave', iosLeaveAnimation, mdLeaveAnimation, this.position);
234
- const dismissed = await this.currentTransition;
224
+ const dismissed = await dismiss(this, data, role, 'toastLeave', iosLeaveAnimation, mdLeaveAnimation, this.position);
235
225
  if (dismissed) {
236
226
  this.delegateController.removeViewFromDom();
237
227
  this.revealContentToScreenReader = false;
238
228
  }
229
+ unlock();
239
230
  return dismissed;
240
231
  }
241
232
  /**
@@ -617,6 +617,27 @@ const createDelegateController = (ref) => {
617
617
  removeViewFromDom,
618
618
  };
619
619
  };
620
+ /**
621
+ * Creates a lock controller.
622
+ *
623
+ * This function locks transitions.
624
+ * The unlock() function within it calls resolve on this function, unlocking the transitions.
625
+ */
626
+ const createLockController = () => {
627
+ let waitPromise;
628
+ const lock = async () => {
629
+ const p = waitPromise;
630
+ let resolve;
631
+ waitPromise = new Promise((r) => (resolve = r));
632
+ if (p !== undefined) {
633
+ await p;
634
+ }
635
+ return resolve;
636
+ };
637
+ return {
638
+ lock,
639
+ };
640
+ };
620
641
  /**
621
642
  * Constructs a trigger interaction for an overlay.
622
643
  * Presents an overlay when the trigger is clicked.
@@ -668,4 +689,4 @@ const createTriggerController = () => {
668
689
  };
669
690
  };
670
691
 
671
- export { BACKDROP as B, GESTURE as G, alertController as a, actionSheetController as b, popoverController as c, createDelegateController as d, createTriggerController as e, present as f, dismiss as g, eventMethod as h, isCancel as i, prepareOverlay as j, setOverlayId as k, loadingController as l, modalController as m, focusFirstDescendant as n, getOverlay as o, pickerController as p, activeAnimations as q, safeCall as s, toastController as t };
692
+ export { BACKDROP as B, GESTURE as G, alertController as a, actionSheetController as b, popoverController as c, createDelegateController as d, createLockController as e, createTriggerController as f, present as g, dismiss as h, isCancel as i, eventMethod as j, prepareOverlay as k, loadingController as l, modalController as m, setOverlayId as n, focusFirstDescendant as o, pickerController as p, getOverlay as q, activeAnimations as r, safeCall as s, toastController as t };
@@ -5,7 +5,7 @@ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/
5
5
  import { C as CoreDelegate, a as attachComponent, d as detachComponent } from './framework-delegate.js';
6
6
  import { r as raf, g as getElementRoot, a as addEventListener, l as hasLazyBuild } from './helpers.js';
7
7
  import { p as printIonWarning } from './index6.js';
8
- import { B as BACKDROP, j as prepareOverlay, k as setOverlayId, f as present, n as focusFirstDescendant, g as dismiss, h as eventMethod } from './overlays.js';
8
+ import { e as createLockController, B as BACKDROP, k as prepareOverlay, n as setOverlayId, g as present, o as focusFirstDescendant, h as dismiss, j as eventMethod } from './overlays.js';
9
9
  import { b as getIonMode, a as isPlatform } from './ionic-global.js';
10
10
  import { g as getClassMap } from './theme.js';
11
11
  import { e as deepReady, w as waitForMount } from './index3.js';
@@ -984,6 +984,7 @@ const Popover = /*@__PURE__*/ proxyCustomElement(class Popover extends HTMLEleme
984
984
  this.ionMount = createEvent(this, "ionMount", 7);
985
985
  this.parentPopover = null;
986
986
  this.coreDelegate = CoreDelegate();
987
+ this.lockController = createLockController();
987
988
  this.inline = false;
988
989
  this.focusDescendantOnPresent = false;
989
990
  this.onBackdropTap = () => {
@@ -1160,17 +1161,7 @@ const Popover = /*@__PURE__*/ proxyCustomElement(class Popover extends HTMLEleme
1160
1161
  if (this.presented) {
1161
1162
  return;
1162
1163
  }
1163
- /**
1164
- * When using an inline popover
1165
- * and dismissing a popover it is possible to
1166
- * quickly present the popover while it is
1167
- * dismissing. We need to await any current
1168
- * transition to allow the dismiss to finish
1169
- * before presenting again.
1170
- */
1171
- if (this.currentTransition !== undefined) {
1172
- await this.currentTransition;
1173
- }
1164
+ const unlock = await this.lockController.lock();
1174
1165
  const { el } = this;
1175
1166
  const { inline, delegate } = this.getDelegate(true);
1176
1167
  this.usersElement = await attachComponent(delegate, el, this.component, ['popover-viewport'], this.componentProps, inline);
@@ -1201,7 +1192,7 @@ const Popover = /*@__PURE__*/ proxyCustomElement(class Popover extends HTMLEleme
1201
1192
  else if (!this.keepContentsMounted) {
1202
1193
  await waitForMount();
1203
1194
  }
1204
- this.currentTransition = present(this, 'popoverEnter', iosEnterAnimation, mdEnterAnimation, {
1195
+ await present(this, 'popoverEnter', iosEnterAnimation, mdEnterAnimation, {
1205
1196
  event: event || this.event,
1206
1197
  size: this.size,
1207
1198
  trigger: this.triggerEl,
@@ -1209,8 +1200,6 @@ const Popover = /*@__PURE__*/ proxyCustomElement(class Popover extends HTMLEleme
1209
1200
  side: this.side,
1210
1201
  align: this.alignment,
1211
1202
  });
1212
- await this.currentTransition;
1213
- this.currentTransition = undefined;
1214
1203
  /**
1215
1204
  * If popover is nested and was
1216
1205
  * presented using the "Right" arrow key,
@@ -1220,6 +1209,7 @@ const Popover = /*@__PURE__*/ proxyCustomElement(class Popover extends HTMLEleme
1220
1209
  if (this.focusDescendantOnPresent) {
1221
1210
  focusFirstDescendant(this.el, this.el);
1222
1211
  }
1212
+ unlock();
1223
1213
  }
1224
1214
  /**
1225
1215
  * Dismiss the popover overlay after it has been presented.
@@ -1230,23 +1220,12 @@ const Popover = /*@__PURE__*/ proxyCustomElement(class Popover extends HTMLEleme
1230
1220
  * a parent popover if this popover is nested. Defaults to `true`.
1231
1221
  */
1232
1222
  async dismiss(data, role, dismissParentPopover = true) {
1233
- /**
1234
- * When using an inline popover
1235
- * and presenting a popover it is possible to
1236
- * quickly dismiss the popover while it is
1237
- * presenting. We need to await any current
1238
- * transition to allow the present to finish
1239
- * before dismissing again.
1240
- */
1241
- if (this.currentTransition !== undefined) {
1242
- await this.currentTransition;
1243
- }
1223
+ const unlock = await this.lockController.lock();
1244
1224
  const { destroyKeyboardInteraction, destroyDismissInteraction } = this;
1245
1225
  if (dismissParentPopover && this.parentPopover) {
1246
1226
  this.parentPopover.dismiss(data, role, dismissParentPopover);
1247
1227
  }
1248
- this.currentTransition = dismiss(this, data, role, 'popoverLeave', iosLeaveAnimation, mdLeaveAnimation, this.event);
1249
- const shouldDismiss = await this.currentTransition;
1228
+ const shouldDismiss = await dismiss(this, data, role, 'popoverLeave', iosLeaveAnimation, mdLeaveAnimation, this.event);
1250
1229
  if (shouldDismiss) {
1251
1230
  if (destroyKeyboardInteraction) {
1252
1231
  destroyKeyboardInteraction();
@@ -1264,7 +1243,7 @@ const Popover = /*@__PURE__*/ proxyCustomElement(class Popover extends HTMLEleme
1264
1243
  const { delegate } = this.getDelegate();
1265
1244
  await detachComponent(delegate, this.usersElement);
1266
1245
  }
1267
- this.currentTransition = undefined;
1246
+ unlock();
1268
1247
  return shouldDismiss;
1269
1248
  }
1270
1249
  /**
@@ -15,7 +15,7 @@ const helpers = require('./helpers-ea4ccbcb.js');
15
15
  const config = require('./config-d5882735.js');
16
16
  const index$1 = require('./index-8568bedb.js');
17
17
  const index$2 = require('./index-653be4df.js');
18
- const overlays = require('./overlays-0ea06fcb.js');
18
+ const overlays = require('./overlays-2b9fa92e.js');
19
19
  require('./index-306a7476.js');
20
20
  require('./gesture-controller-b46721be.js');
21
21
  require('./index-484b1104.js');