@ionic/core 7.3.3-nightly.20230831 → 7.3.3-nightly.20230905

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 (161) hide show
  1. package/components/action-sheet.js +8 -16
  2. package/components/alert.js +8 -16
  3. package/components/framework-delegate.js +21 -2
  4. package/components/ion-loading.js +8 -16
  5. package/components/ion-modal.js +21 -29
  6. package/components/ion-picker.js +8 -16
  7. package/components/ion-router-outlet.js +1 -0
  8. package/components/ion-textarea.js +3 -3
  9. package/components/ion-toast.js +8 -16
  10. package/components/lock-controller.js +38 -0
  11. package/components/popover.js +15 -29
  12. package/dist/cjs/{framework-delegate-e8174951.js → framework-delegate-c0873a6f.js} +21 -2
  13. package/dist/cjs/index.cjs.js +2 -2
  14. package/dist/cjs/ion-action-sheet.cjs.entry.js +10 -18
  15. package/dist/cjs/ion-alert.cjs.entry.js +10 -18
  16. package/dist/cjs/ion-app_8.cjs.entry.js +2 -1
  17. package/dist/cjs/ion-datetime_3.cjs.entry.js +10 -18
  18. package/dist/cjs/ion-loading.cjs.entry.js +10 -18
  19. package/dist/cjs/ion-menu_3.cjs.entry.js +2 -2
  20. package/dist/cjs/ion-modal.cjs.entry.js +23 -31
  21. package/dist/cjs/ion-nav_2.cjs.entry.js +1 -1
  22. package/dist/cjs/ion-popover.cjs.entry.js +17 -31
  23. package/dist/cjs/ion-select_3.cjs.entry.js +2 -2
  24. package/dist/cjs/ion-tab_2.cjs.entry.js +1 -1
  25. package/dist/cjs/ion-textarea.cjs.entry.js +2 -2
  26. package/dist/cjs/ion-toast.cjs.entry.js +10 -18
  27. package/dist/cjs/ionic.cjs.js +1 -1
  28. package/dist/cjs/loader.cjs.js +1 -1
  29. package/dist/cjs/lock-controller-4ae2eb59.js +40 -0
  30. package/dist/cjs/{overlays-0ea06fcb.js → overlays-5c1706ed.js} +1 -1
  31. package/dist/collection/components/action-sheet/action-sheet.js +8 -16
  32. package/dist/collection/components/alert/alert.js +8 -16
  33. package/dist/collection/components/datetime/test/presentation/datetime.e2e.js +48 -17
  34. package/dist/collection/components/loading/loading.js +8 -16
  35. package/dist/collection/components/modal/modal.js +21 -29
  36. package/dist/collection/components/picker/picker.js +8 -16
  37. package/dist/collection/components/popover/popover.js +15 -29
  38. package/dist/collection/components/popover/test/async/popover.e2e.js +42 -0
  39. package/dist/collection/components/progress-bar/test/buffer/progress-bar.e2e.js +20 -0
  40. package/dist/collection/components/progress-bar/test/determinate/progress-bar.e2e.js +20 -0
  41. package/dist/collection/components/radio/test/item/radio.e2e.js +1 -1
  42. package/dist/collection/components/router-outlet/router-outlet.js +1 -0
  43. package/dist/collection/components/textarea/test/bottom-content/textarea.e2e.js +6 -6
  44. package/dist/collection/components/textarea/test/card/textarea.e2e.js +1 -1
  45. package/dist/collection/components/textarea/test/color/textarea.e2e.js +15 -15
  46. package/dist/collection/components/textarea/test/cols/textarea.e2e.js +37 -0
  47. package/dist/collection/components/textarea/test/fill/textarea.e2e.js +10 -10
  48. package/dist/collection/components/textarea/test/highlight/textarea.e2e.js +9 -9
  49. package/dist/collection/components/textarea/test/item/textarea.e2e.js +2 -2
  50. package/dist/collection/components/textarea/test/label-placement/textarea.e2e.js +21 -21
  51. package/dist/collection/components/textarea/test/legacy/autogrow/textarea.e2e.js +5 -5
  52. package/dist/collection/components/textarea/test/states/textarea.e2e.js +2 -2
  53. package/dist/collection/components/textarea/textarea.ios.css +16 -0
  54. package/dist/collection/components/textarea/textarea.js +1 -1
  55. package/dist/collection/components/textarea/textarea.md.css +16 -0
  56. package/dist/collection/components/toast/toast.js +8 -16
  57. package/dist/collection/utils/framework-delegate.js +21 -2
  58. package/dist/collection/utils/lock-controller.js +36 -0
  59. package/dist/docs.json +2 -2
  60. package/dist/esm/{framework-delegate-2b76c681.js → framework-delegate-aa433dea.js} +21 -2
  61. package/dist/esm/index.js +2 -2
  62. package/dist/esm/ion-action-sheet.entry.js +10 -18
  63. package/dist/esm/ion-alert.entry.js +10 -18
  64. package/dist/esm/ion-app_8.entry.js +2 -1
  65. package/dist/esm/ion-datetime_3.entry.js +10 -18
  66. package/dist/esm/ion-loading.entry.js +10 -18
  67. package/dist/esm/ion-menu_3.entry.js +2 -2
  68. package/dist/esm/ion-modal.entry.js +23 -31
  69. package/dist/esm/ion-nav_2.entry.js +1 -1
  70. package/dist/esm/ion-popover.entry.js +17 -31
  71. package/dist/esm/ion-select_3.entry.js +2 -2
  72. package/dist/esm/ion-tab_2.entry.js +1 -1
  73. package/dist/esm/ion-textarea.entry.js +2 -2
  74. package/dist/esm/ion-toast.entry.js +10 -18
  75. package/dist/esm/ionic.js +1 -1
  76. package/dist/esm/loader.js +1 -1
  77. package/dist/esm/lock-controller-e8c6c051.js +38 -0
  78. package/dist/esm/{overlays-c3387ec0.js → overlays-e1dadfe6.js} +1 -1
  79. package/dist/esm-es5/framework-delegate-aa433dea.js +4 -0
  80. package/dist/esm-es5/index.js +1 -1
  81. package/dist/esm-es5/ion-action-sheet.entry.js +1 -1
  82. package/dist/esm-es5/ion-alert.entry.js +1 -1
  83. package/dist/esm-es5/ion-app_8.entry.js +1 -1
  84. package/dist/esm-es5/ion-datetime_3.entry.js +1 -1
  85. package/dist/esm-es5/ion-loading.entry.js +1 -1
  86. package/dist/esm-es5/ion-menu_3.entry.js +1 -1
  87. package/dist/esm-es5/ion-modal.entry.js +1 -1
  88. package/dist/esm-es5/ion-nav_2.entry.js +1 -1
  89. package/dist/esm-es5/ion-popover.entry.js +1 -1
  90. package/dist/esm-es5/ion-select_3.entry.js +1 -1
  91. package/dist/esm-es5/ion-tab_2.entry.js +1 -1
  92. package/dist/esm-es5/ion-textarea.entry.js +1 -1
  93. package/dist/esm-es5/ion-toast.entry.js +1 -1
  94. package/dist/esm-es5/ionic.js +1 -1
  95. package/dist/esm-es5/loader.js +1 -1
  96. package/dist/esm-es5/lock-controller-e8c6c051.js +4 -0
  97. package/dist/esm-es5/{overlays-c3387ec0.js → overlays-e1dadfe6.js} +1 -1
  98. package/dist/ionic/index.esm.js +1 -1
  99. package/dist/ionic/ionic.esm.js +1 -1
  100. package/dist/ionic/{p-958bde76.entry.js → p-091cd81e.entry.js} +1 -1
  101. package/dist/ionic/{p-d1356034.system.entry.js → p-0b68c41d.system.entry.js} +1 -1
  102. package/dist/ionic/p-0cc2bf5a.system.entry.js +4 -0
  103. package/dist/ionic/p-208f640c.entry.js +4 -0
  104. package/dist/ionic/p-2539e967.system.entry.js +4 -0
  105. package/dist/ionic/{p-74bd26b8.system.entry.js → p-28f5715a.system.entry.js} +1 -1
  106. package/dist/ionic/p-38dd9aec.entry.js +4 -0
  107. package/dist/ionic/p-3ff018da.entry.js +4 -0
  108. package/dist/ionic/{p-8074bdd7.system.entry.js → p-45ee211b.system.entry.js} +1 -1
  109. package/dist/ionic/p-48144921.entry.js +4 -0
  110. package/dist/ionic/p-5009cb46.entry.js +4 -0
  111. package/dist/ionic/p-53b2a46f.js +4 -0
  112. package/dist/ionic/{p-5ef91692.js → p-582dc7c1.js} +1 -1
  113. package/dist/ionic/{p-c0d1e5a1.entry.js → p-5c17f888.entry.js} +1 -1
  114. package/dist/ionic/{p-8d9475b5.system.js → p-613d4042.system.js} +1 -1
  115. package/dist/ionic/p-647d15d4.system.entry.js +4 -0
  116. package/dist/ionic/p-653f2fc6.entry.js +4 -0
  117. package/dist/ionic/p-721933ff.system.js +1 -1
  118. package/dist/ionic/p-772f6c84.system.js +4 -0
  119. package/dist/ionic/p-87383d00.system.entry.js +4 -0
  120. package/dist/ionic/{p-db46fc66.system.js → p-8843b046.system.js} +1 -1
  121. package/dist/ionic/p-93e47822.entry.js +4 -0
  122. package/dist/ionic/{p-229df0d8.entry.js → p-98ebc376.entry.js} +1 -1
  123. package/dist/ionic/p-af0bc751.system.entry.js +4 -0
  124. package/dist/ionic/p-b0e9e0b8.system.entry.js +4 -0
  125. package/dist/ionic/p-b287ab05.js +4 -0
  126. package/dist/ionic/{p-81b46714.system.js → p-b32742f3.system.js} +1 -1
  127. package/dist/ionic/p-b3394798.system.entry.js +4 -0
  128. package/dist/ionic/p-bbae0ac3.system.entry.js +4 -0
  129. package/dist/ionic/{p-20087c90.entry.js → p-c759a704.entry.js} +1 -1
  130. package/dist/ionic/{p-6b9bf14c.system.entry.js → p-d1d3b740.system.entry.js} +1 -1
  131. package/dist/ionic/{p-8fa43732.system.entry.js → p-d693e765.system.entry.js} +1 -1
  132. package/dist/ionic/{p-5c96dc4e.entry.js → p-f7faa32d.entry.js} +1 -1
  133. package/dist/ionic/p-fabb7294.entry.js +4 -0
  134. package/dist/types/components/action-sheet/action-sheet.d.ts +1 -1
  135. package/dist/types/components/alert/alert.d.ts +1 -1
  136. package/dist/types/components/loading/loading.d.ts +1 -1
  137. package/dist/types/components/modal/modal.d.ts +1 -1
  138. package/dist/types/components/picker/picker.d.ts +1 -1
  139. package/dist/types/components/popover/popover.d.ts +1 -1
  140. package/dist/types/components/toast/toast.d.ts +1 -1
  141. package/dist/types/utils/lock-controller.d.ts +10 -0
  142. package/hydrate/index.js +129 -144
  143. package/package.json +1 -1
  144. package/dist/esm-es5/framework-delegate-2b76c681.js +0 -4
  145. package/dist/ionic/p-06f1f560.system.entry.js +0 -4
  146. package/dist/ionic/p-2936ec7f.system.entry.js +0 -4
  147. package/dist/ionic/p-29b3e70a.entry.js +0 -4
  148. package/dist/ionic/p-2bc49e5d.system.entry.js +0 -4
  149. package/dist/ionic/p-2da3e015.system.entry.js +0 -4
  150. package/dist/ionic/p-423d5a4d.entry.js +0 -4
  151. package/dist/ionic/p-564aaba3.entry.js +0 -4
  152. package/dist/ionic/p-61769039.entry.js +0 -4
  153. package/dist/ionic/p-74723f41.entry.js +0 -4
  154. package/dist/ionic/p-7d93084b.entry.js +0 -4
  155. package/dist/ionic/p-9b3c3564.entry.js +0 -4
  156. package/dist/ionic/p-b34c1ae1.js +0 -4
  157. package/dist/ionic/p-c328936a.system.entry.js +0 -4
  158. package/dist/ionic/p-ccea9adc.system.entry.js +0 -4
  159. package/dist/ionic/p-d5db0834.system.entry.js +0 -4
  160. package/dist/ionic/p-d8538837.entry.js +0 -4
  161. package/dist/ionic/p-dd0b6889.system.entry.js +0 -4
@@ -4,6 +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 { c as createLockController } from './lock-controller.js';
7
8
  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';
8
9
  import { g as getClassMap } from './theme.js';
9
10
  import { b as getIonMode } from './ionic-global.js';
@@ -113,6 +114,7 @@ const ActionSheet = /*@__PURE__*/ proxyCustomElement(class ActionSheet extends H
113
114
  this.willDismissShorthand = createEvent(this, "willDismiss", 7);
114
115
  this.didDismissShorthand = createEvent(this, "didDismiss", 7);
115
116
  this.delegateController = createDelegateController(this);
117
+ this.lockController = createLockController();
116
118
  this.triggerController = createTriggerController();
117
119
  this.presented = false;
118
120
  this.onBackdropTap = () => {
@@ -160,21 +162,10 @@ const ActionSheet = /*@__PURE__*/ proxyCustomElement(class ActionSheet extends H
160
162
  * Present the action sheet overlay after it has been created.
161
163
  */
162
164
  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
- }
165
+ const unlock = await this.lockController.lock();
174
166
  await this.delegateController.attachViewToDom();
175
- this.currentTransition = present(this, 'actionSheetEnter', iosEnterAnimation, mdEnterAnimation);
176
- await this.currentTransition;
177
- this.currentTransition = undefined;
167
+ await present(this, 'actionSheetEnter', iosEnterAnimation, mdEnterAnimation);
168
+ unlock();
178
169
  }
179
170
  /**
180
171
  * Dismiss the action sheet overlay after it has been presented.
@@ -186,11 +177,12 @@ const ActionSheet = /*@__PURE__*/ proxyCustomElement(class ActionSheet extends H
186
177
  * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
187
178
  */
188
179
  async dismiss(data, role) {
189
- this.currentTransition = dismiss(this, data, role, 'actionSheetLeave', iosLeaveAnimation, mdLeaveAnimation);
190
- const dismissed = await this.currentTransition;
180
+ const unlock = await this.lockController.lock();
181
+ const dismissed = await dismiss(this, data, role, 'actionSheetLeave', iosLeaveAnimation, mdLeaveAnimation);
191
182
  if (dismissed) {
192
183
  this.delegateController.removeViewFromDom();
193
184
  }
185
+ unlock();
194
186
  return dismissed;
195
187
  }
196
188
  /**
@@ -5,6 +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 { c as createLockController } from './lock-controller.js';
8
9
  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';
9
10
  import { g as getClassMap } from './theme.js';
10
11
  import { c as config, b as getIonMode } from './ionic-global.js';
@@ -114,6 +115,7 @@ const Alert = /*@__PURE__*/ proxyCustomElement(class Alert extends HTMLElement {
114
115
  this.willDismissShorthand = createEvent(this, "willDismiss", 7);
115
116
  this.didDismissShorthand = createEvent(this, "didDismiss", 7);
116
117
  this.delegateController = createDelegateController(this);
118
+ this.lockController = createLockController();
117
119
  this.triggerController = createTriggerController();
118
120
  this.customHTMLEnabled = config.get('innerHTMLTemplatesEnabled', ENABLE_HTML_CONTENT_DEFAULT);
119
121
  this.processedInputs = [];
@@ -280,21 +282,10 @@ const Alert = /*@__PURE__*/ proxyCustomElement(class Alert extends HTMLElement {
280
282
  * Present the alert overlay after it has been created.
281
283
  */
282
284
  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
- }
285
+ const unlock = await this.lockController.lock();
294
286
  await this.delegateController.attachViewToDom();
295
- this.currentTransition = present(this, 'alertEnter', iosEnterAnimation, mdEnterAnimation);
296
- await this.currentTransition;
297
- this.currentTransition = undefined;
287
+ await present(this, 'alertEnter', iosEnterAnimation, mdEnterAnimation);
288
+ unlock();
298
289
  }
299
290
  /**
300
291
  * Dismiss the alert overlay after it has been presented.
@@ -306,11 +297,12 @@ const Alert = /*@__PURE__*/ proxyCustomElement(class Alert extends HTMLElement {
306
297
  * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
307
298
  */
308
299
  async dismiss(data, role) {
309
- this.currentTransition = dismiss(this, data, role, 'alertLeave', iosLeaveAnimation, mdLeaveAnimation);
310
- const dismissed = await this.currentTransition;
300
+ const unlock = await this.lockController.lock();
301
+ const dismissed = await dismiss(this, data, role, 'alertLeave', iosLeaveAnimation, mdLeaveAnimation);
311
302
  if (dismissed) {
312
303
  this.delegateController.removeViewFromDom();
313
304
  }
305
+ unlock();
314
306
  return dismissed;
315
307
  }
316
308
  /**
@@ -39,6 +39,7 @@ const CoreDelegate = () => {
39
39
  const attachViewToDom = async (parentElement, userComponent, userComponentProps = {}, cssClasses = []) => {
40
40
  var _a, _b;
41
41
  BaseComponent = parentElement;
42
+ let ChildComponent;
42
43
  /**
43
44
  * If passing in a component via the `component` props
44
45
  * we need to append it inside of our overlay component.
@@ -65,6 +66,7 @@ const CoreDelegate = () => {
65
66
  * inside of the overlay component.
66
67
  */
67
68
  BaseComponent.appendChild(el);
69
+ ChildComponent = el;
68
70
  await new Promise((resolve) => componentOnReady(el, resolve));
69
71
  }
70
72
  else if (BaseComponent.children.length > 0 &&
@@ -73,7 +75,7 @@ const CoreDelegate = () => {
73
75
  * The delegate host wrapper el is only needed for modals and popovers
74
76
  * because they allow the dev to provide custom content to the overlay.
75
77
  */
76
- const root = BaseComponent.children[0];
78
+ const root = (ChildComponent = BaseComponent.children[0]);
77
79
  if (!root.classList.contains('ion-delegate-host')) {
78
80
  /**
79
81
  * If the root element is not a delegate host, it means
@@ -88,6 +90,12 @@ const CoreDelegate = () => {
88
90
  el.append(...BaseComponent.children);
89
91
  // Append the new parent element to the original parent element.
90
92
  BaseComponent.appendChild(el);
93
+ /**
94
+ * Update the ChildComponent to be the
95
+ * newly created div in the event that one
96
+ * does not already exist.
97
+ */
98
+ ChildComponent = el;
91
99
  }
92
100
  }
93
101
  /**
@@ -103,7 +111,18 @@ const CoreDelegate = () => {
103
111
  Reference = document.createComment('ionic teleport');
104
112
  BaseComponent.parentNode.insertBefore(Reference, BaseComponent);
105
113
  app.appendChild(BaseComponent);
106
- return BaseComponent;
114
+ /**
115
+ * We return the child component rather than the overlay
116
+ * reference itself since modal and popover will
117
+ * use this to wait for any Ionic components in the child view
118
+ * to be ready (i.e. componentOnReady) when using the
119
+ * lazy loaded component bundle.
120
+ *
121
+ * However, we fall back to returning BaseComponent
122
+ * in the event that a modal or popover is presented
123
+ * with no child content.
124
+ */
125
+ return ChildComponent !== null && ChildComponent !== void 0 ? ChildComponent : BaseComponent;
107
126
  };
108
127
  const removeViewFromDom = () => {
109
128
  /**
@@ -4,6 +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 { c as createLockController } from './lock-controller.js';
7
8
  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';
8
9
  import { g as getClassMap } from './theme.js';
9
10
  import { c as config, b as getIonMode } from './ionic-global.js';
@@ -116,6 +117,7 @@ const Loading = /*@__PURE__*/ proxyCustomElement(class Loading extends HTMLEleme
116
117
  this.willDismissShorthand = createEvent(this, "willDismiss", 7);
117
118
  this.didDismissShorthand = createEvent(this, "didDismiss", 7);
118
119
  this.delegateController = createDelegateController(this);
120
+ this.lockController = createLockController();
119
121
  this.triggerController = createTriggerController();
120
122
  this.customHTMLEnabled = config.get('innerHTMLTemplatesEnabled', ENABLE_HTML_CONTENT_DEFAULT);
121
123
  this.presented = false;
@@ -181,24 +183,13 @@ const Loading = /*@__PURE__*/ proxyCustomElement(class Loading extends HTMLEleme
181
183
  * Present the loading overlay after it has been created.
182
184
  */
183
185
  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
- }
186
+ const unlock = await this.lockController.lock();
195
187
  await this.delegateController.attachViewToDom();
196
- this.currentTransition = present(this, 'loadingEnter', iosEnterAnimation, mdEnterAnimation);
197
- await this.currentTransition;
188
+ await present(this, 'loadingEnter', iosEnterAnimation, mdEnterAnimation);
198
189
  if (this.duration > 0) {
199
190
  this.durationTimeout = setTimeout(() => this.dismiss(), this.duration + 10);
200
191
  }
201
- this.currentTransition = undefined;
192
+ unlock();
202
193
  }
203
194
  /**
204
195
  * Dismiss the loading overlay after it has been presented.
@@ -210,14 +201,15 @@ const Loading = /*@__PURE__*/ proxyCustomElement(class Loading extends HTMLEleme
210
201
  * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
211
202
  */
212
203
  async dismiss(data, role) {
204
+ const unlock = await this.lockController.lock();
213
205
  if (this.durationTimeout) {
214
206
  clearTimeout(this.durationTimeout);
215
207
  }
216
- this.currentTransition = dismiss(this, data, role, 'loadingLeave', iosLeaveAnimation, mdLeaveAnimation);
217
- const dismissed = await this.currentTransition;
208
+ const dismissed = await dismiss(this, data, role, 'loadingLeave', iosLeaveAnimation, mdLeaveAnimation);
218
209
  if (dismissed) {
219
210
  this.delegateController.removeViewFromDom();
220
211
  }
212
+ unlock();
221
213
  return dismissed;
222
214
  }
223
215
  /**
@@ -5,6 +5,7 @@ import { proxyCustomElement, HTMLElement, createEvent, writeTask, h, Host } from
5
5
  import { a as findClosestIonContent, i as isIonContent, d as disableContentScrollY, r as resetContentScrollY, f as findIonContent, p as printIonContentErrorMsg } from './index8.js';
6
6
  import { C as CoreDelegate, a as attachComponent, d as detachComponent } from './framework-delegate.js';
7
7
  import { g as getElementRoot, m as clamp, r as raf, d as inheritAttributes, l as hasLazyBuild } from './helpers.js';
8
+ import { c as createLockController } from './lock-controller.js';
8
9
  import { p as printIonWarning } from './index6.js';
9
10
  import { g as getCapacitor } from './capacitor.js';
10
11
  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';
@@ -1113,6 +1114,7 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
1113
1114
  this.willDismissShorthand = createEvent(this, "willDismiss", 7);
1114
1115
  this.didDismissShorthand = createEvent(this, "didDismiss", 7);
1115
1116
  this.ionMount = createEvent(this, "ionMount", 7);
1117
+ this.lockController = createLockController();
1116
1118
  this.triggerController = createTriggerController();
1117
1119
  this.coreDelegate = CoreDelegate();
1118
1120
  this.isSheetModal = false;
@@ -1277,29 +1279,25 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
1277
1279
  * Present the modal overlay after it has been created.
1278
1280
  */
1279
1281
  async present() {
1282
+ const unlock = await this.lockController.lock();
1280
1283
  if (this.presented) {
1284
+ unlock();
1281
1285
  return;
1282
1286
  }
1283
1287
  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
1288
  /**
1296
1289
  * If the modal is presented multiple times (inline modals), we
1297
1290
  * need to reset the current breakpoint to the initial breakpoint.
1298
1291
  */
1299
1292
  this.currentBreakpoint = this.initialBreakpoint;
1300
1293
  const { inline, delegate } = this.getDelegate(true);
1301
- this.usersElement = await attachComponent(delegate, el, this.component, ['ion-page'], this.componentProps, inline);
1294
+ /**
1295
+ * Emit ionMount so JS Frameworks have an opportunity
1296
+ * to add the child component to the DOM. The child
1297
+ * component will be assigned to this.usersElement below.
1298
+ */
1302
1299
  this.ionMount.emit();
1300
+ this.usersElement = await attachComponent(delegate, el, this.component, ['ion-page'], this.componentProps, inline);
1303
1301
  /**
1304
1302
  * When using the lazy loaded build of Stencil, we need to wait
1305
1303
  * for every Stencil component instance to be ready before presenting
@@ -1323,7 +1321,7 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
1323
1321
  await waitForMount();
1324
1322
  }
1325
1323
  writeTask(() => this.el.classList.add('show-modal'));
1326
- this.currentTransition = present(this, 'modalEnter', iosEnterAnimation, mdEnterAnimation, {
1324
+ await present(this, 'modalEnter', iosEnterAnimation, mdEnterAnimation, {
1327
1325
  presentingEl: presentingElement,
1328
1326
  currentBreakpoint: this.initialBreakpoint,
1329
1327
  backdropBreakpoint: this.backdropBreakpoint,
@@ -1370,14 +1368,13 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
1370
1368
  this.statusBarStyle = await StatusBar.getStyle();
1371
1369
  setCardStatusBarDark();
1372
1370
  }
1373
- await this.currentTransition;
1374
1371
  if (this.isSheetModal) {
1375
1372
  this.initSheetGesture();
1376
1373
  }
1377
1374
  else if (hasCardModal) {
1378
1375
  this.initSwipeToClose();
1379
1376
  }
1380
- this.currentTransition = undefined;
1377
+ unlock();
1381
1378
  }
1382
1379
  initSwipeToClose() {
1383
1380
  var _a;
@@ -1467,12 +1464,19 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
1467
1464
  if (this.gestureAnimationDismissing && role !== GESTURE) {
1468
1465
  return false;
1469
1466
  }
1467
+ /**
1468
+ * Because the canDismiss check below is async,
1469
+ * we need to claim a lock before the check happens,
1470
+ * in case the dismiss transition does run.
1471
+ */
1472
+ const unlock = await this.lockController.lock();
1470
1473
  /**
1471
1474
  * If a canDismiss handler is responsible
1472
1475
  * for calling the dismiss method, we should
1473
1476
  * not run the canDismiss check again.
1474
1477
  */
1475
1478
  if (role !== 'handler' && !(await this.checkCanDismiss(data, role))) {
1479
+ unlock();
1476
1480
  return false;
1477
1481
  }
1478
1482
  const { presentingElement } = this;
@@ -1490,24 +1494,12 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
1490
1494
  window.removeEventListener(KEYBOARD_DID_OPEN, this.keyboardOpenCallback);
1491
1495
  this.keyboardOpenCallback = undefined;
1492
1496
  }
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
1497
  const enteringAnimation = activeAnimations.get(this) || [];
1505
- this.currentTransition = dismiss(this, data, role, 'modalLeave', iosLeaveAnimation, mdLeaveAnimation, {
1498
+ const dismissed = await dismiss(this, data, role, 'modalLeave', iosLeaveAnimation, mdLeaveAnimation, {
1506
1499
  presentingEl: presentingElement,
1507
1500
  currentBreakpoint: (_a = this.currentBreakpoint) !== null && _a !== void 0 ? _a : this.initialBreakpoint,
1508
1501
  backdropBreakpoint: this.backdropBreakpoint,
1509
1502
  });
1510
- const dismissed = await this.currentTransition;
1511
1503
  if (dismissed) {
1512
1504
  const { delegate } = this.getDelegate();
1513
1505
  await detachComponent(delegate, this.usersElement);
@@ -1521,8 +1513,8 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
1521
1513
  enteringAnimation.forEach((ani) => ani.destroy());
1522
1514
  }
1523
1515
  this.currentBreakpoint = undefined;
1524
- this.currentTransition = undefined;
1525
1516
  this.animation = undefined;
1517
+ unlock();
1526
1518
  return dismissed;
1527
1519
  }
1528
1520
  /**
@@ -3,6 +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 { c as createLockController } from './lock-controller.js';
6
7
  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';
7
8
  import { g as getClassMap } from './theme.js';
8
9
  import { b as getIonMode } from './ionic-global.js';
@@ -71,6 +72,7 @@ const Picker = /*@__PURE__*/ proxyCustomElement(class Picker extends HTMLElement
71
72
  this.willDismissShorthand = createEvent(this, "willDismiss", 7);
72
73
  this.didDismissShorthand = createEvent(this, "didDismiss", 7);
73
74
  this.delegateController = createDelegateController(this);
75
+ this.lockController = createLockController();
74
76
  this.triggerController = createTriggerController();
75
77
  this.onBackdropTap = () => {
76
78
  this.dismiss(undefined, BACKDROP);
@@ -137,24 +139,13 @@ const Picker = /*@__PURE__*/ proxyCustomElement(class Picker extends HTMLElement
137
139
  * Present the picker overlay after it has been created.
138
140
  */
139
141
  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
- }
142
+ const unlock = await this.lockController.lock();
151
143
  await this.delegateController.attachViewToDom();
152
- this.currentTransition = present(this, 'pickerEnter', iosEnterAnimation, iosEnterAnimation, undefined);
153
- await this.currentTransition;
154
- this.currentTransition = undefined;
144
+ await present(this, 'pickerEnter', iosEnterAnimation, iosEnterAnimation, undefined);
155
145
  if (this.duration > 0) {
156
146
  this.durationTimeout = setTimeout(() => this.dismiss(), this.duration);
157
147
  }
148
+ unlock();
158
149
  }
159
150
  /**
160
151
  * Dismiss the picker overlay after it has been presented.
@@ -166,14 +157,15 @@ const Picker = /*@__PURE__*/ proxyCustomElement(class Picker extends HTMLElement
166
157
  * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
167
158
  */
168
159
  async dismiss(data, role) {
160
+ const unlock = await this.lockController.lock();
169
161
  if (this.durationTimeout) {
170
162
  clearTimeout(this.durationTimeout);
171
163
  }
172
- this.currentTransition = dismiss(this, data, role, 'pickerLeave', iosLeaveAnimation, iosLeaveAnimation);
173
- const dismissed = await this.currentTransition;
164
+ const dismissed = await dismiss(this, data, role, 'pickerLeave', iosLeaveAnimation, iosLeaveAnimation);
174
165
  if (dismissed) {
175
166
  this.delegateController.removeViewFromDom();
176
167
  }
168
+ unlock();
177
169
  return dismissed;
178
170
  }
179
171
  /**
@@ -182,6 +182,7 @@ const RouterOutlet = /*@__PURE__*/ proxyCustomElement(class RouterOutlet extends
182
182
  this.ionNavDidChange.emit();
183
183
  return true;
184
184
  }
185
+ // TODO: FW-5048 - Remove this code in favor of using lock controller from utils
185
186
  async lock() {
186
187
  const p = this.waitPromise;
187
188
  let resolve;