@ionic/core 7.3.3-dev.11693454416.1cb6a7ec → 7.3.3-dev.11693533652.1969cc78

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 (142) 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-nav-link.js +1 -7
  7. package/components/ion-picker.js +8 -16
  8. package/components/ion-router-outlet.js +1 -0
  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 +2 -8
  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-toast.cjs.entry.js +10 -18
  26. package/dist/cjs/lock-controller-4ae2eb59.js +40 -0
  27. package/dist/cjs/{overlays-0ea06fcb.js → overlays-5c1706ed.js} +1 -1
  28. package/dist/collection/components/action-sheet/action-sheet.js +8 -16
  29. package/dist/collection/components/alert/alert.js +8 -16
  30. package/dist/collection/components/datetime/test/presentation/datetime.e2e.js +48 -17
  31. package/dist/collection/components/loading/loading.js +8 -16
  32. package/dist/collection/components/modal/modal.js +21 -29
  33. package/dist/collection/components/nav-link/nav-link.js +1 -7
  34. package/dist/collection/components/picker/picker.js +8 -16
  35. package/dist/collection/components/popover/popover.js +15 -29
  36. package/dist/collection/components/popover/test/async/popover.e2e.js +42 -0
  37. package/dist/collection/components/router-outlet/router-outlet.js +1 -0
  38. package/dist/collection/components/textarea/test/bottom-content/textarea.e2e.js +6 -6
  39. package/dist/collection/components/textarea/test/card/textarea.e2e.js +1 -1
  40. package/dist/collection/components/textarea/test/color/textarea.e2e.js +15 -15
  41. package/dist/collection/components/textarea/test/fill/textarea.e2e.js +10 -10
  42. package/dist/collection/components/textarea/test/highlight/textarea.e2e.js +9 -9
  43. package/dist/collection/components/textarea/test/item/textarea.e2e.js +2 -2
  44. package/dist/collection/components/textarea/test/label-placement/textarea.e2e.js +21 -21
  45. package/dist/collection/components/textarea/test/legacy/autogrow/textarea.e2e.js +5 -5
  46. package/dist/collection/components/textarea/test/states/textarea.e2e.js +2 -2
  47. package/dist/collection/components/toast/toast.js +8 -16
  48. package/dist/collection/utils/framework-delegate.js +21 -2
  49. package/dist/collection/utils/lock-controller.js +36 -0
  50. package/dist/docs.json +1 -1
  51. package/dist/esm/{framework-delegate-2b76c681.js → framework-delegate-aa433dea.js} +21 -2
  52. package/dist/esm/index.js +2 -2
  53. package/dist/esm/ion-action-sheet.entry.js +10 -18
  54. package/dist/esm/ion-alert.entry.js +10 -18
  55. package/dist/esm/ion-app_8.entry.js +2 -1
  56. package/dist/esm/ion-datetime_3.entry.js +10 -18
  57. package/dist/esm/ion-loading.entry.js +10 -18
  58. package/dist/esm/ion-menu_3.entry.js +2 -2
  59. package/dist/esm/ion-modal.entry.js +23 -31
  60. package/dist/esm/ion-nav_2.entry.js +2 -8
  61. package/dist/esm/ion-popover.entry.js +17 -31
  62. package/dist/esm/ion-select_3.entry.js +2 -2
  63. package/dist/esm/ion-tab_2.entry.js +1 -1
  64. package/dist/esm/ion-toast.entry.js +10 -18
  65. package/dist/esm/lock-controller-e8c6c051.js +38 -0
  66. package/dist/esm/{overlays-c3387ec0.js → overlays-e1dadfe6.js} +1 -1
  67. package/dist/esm-es5/framework-delegate-aa433dea.js +4 -0
  68. package/dist/esm-es5/index.js +1 -1
  69. package/dist/esm-es5/ion-action-sheet.entry.js +1 -1
  70. package/dist/esm-es5/ion-alert.entry.js +1 -1
  71. package/dist/esm-es5/ion-app_8.entry.js +1 -1
  72. package/dist/esm-es5/ion-datetime_3.entry.js +1 -1
  73. package/dist/esm-es5/ion-loading.entry.js +1 -1
  74. package/dist/esm-es5/ion-menu_3.entry.js +1 -1
  75. package/dist/esm-es5/ion-modal.entry.js +1 -1
  76. package/dist/esm-es5/ion-nav_2.entry.js +1 -1
  77. package/dist/esm-es5/ion-popover.entry.js +1 -1
  78. package/dist/esm-es5/ion-select_3.entry.js +1 -1
  79. package/dist/esm-es5/ion-tab_2.entry.js +1 -1
  80. package/dist/esm-es5/ion-toast.entry.js +1 -1
  81. package/dist/esm-es5/lock-controller-e8c6c051.js +4 -0
  82. package/dist/esm-es5/{overlays-c3387ec0.js → overlays-e1dadfe6.js} +1 -1
  83. package/dist/ionic/index.esm.js +1 -1
  84. package/dist/ionic/ionic.esm.js +1 -1
  85. package/dist/ionic/{p-958bde76.entry.js → p-091cd81e.entry.js} +1 -1
  86. package/dist/ionic/{p-c32e09fe.system.entry.js → p-0b68c41d.system.entry.js} +1 -1
  87. package/dist/ionic/p-0cc2bf5a.system.entry.js +4 -0
  88. package/dist/ionic/p-208f640c.entry.js +4 -0
  89. package/dist/ionic/p-2539e967.system.entry.js +4 -0
  90. package/dist/ionic/{p-74bd26b8.system.entry.js → p-28f5715a.system.entry.js} +1 -1
  91. package/dist/ionic/p-38dd9aec.entry.js +4 -0
  92. package/dist/ionic/p-3ff018da.entry.js +4 -0
  93. package/dist/ionic/{p-8074bdd7.system.entry.js → p-45ee211b.system.entry.js} +1 -1
  94. package/dist/ionic/p-5009cb46.entry.js +4 -0
  95. package/dist/ionic/p-53b2a46f.js +4 -0
  96. package/dist/ionic/{p-5ef91692.js → p-582dc7c1.js} +1 -1
  97. package/dist/ionic/{p-c0d1e5a1.entry.js → p-5c17f888.entry.js} +1 -1
  98. package/dist/ionic/{p-8d9475b5.system.js → p-613d4042.system.js} +1 -1
  99. package/dist/ionic/p-647d15d4.system.entry.js +4 -0
  100. package/dist/ionic/p-653f2fc6.entry.js +4 -0
  101. package/dist/ionic/p-721933ff.system.js +1 -1
  102. package/dist/ionic/p-772f6c84.system.js +4 -0
  103. package/dist/ionic/p-87383d00.system.entry.js +4 -0
  104. package/dist/ionic/{p-db46fc66.system.js → p-8843b046.system.js} +1 -1
  105. package/dist/ionic/p-93e47822.entry.js +4 -0
  106. package/dist/ionic/{p-0e6ca480.entry.js → p-98ebc376.entry.js} +1 -1
  107. package/dist/ionic/p-af0bc751.system.entry.js +4 -0
  108. package/dist/ionic/p-b0e9e0b8.system.entry.js +4 -0
  109. package/dist/ionic/p-b287ab05.js +4 -0
  110. package/dist/ionic/{p-81b46714.system.js → p-b32742f3.system.js} +1 -1
  111. package/dist/ionic/p-b3394798.system.entry.js +4 -0
  112. package/dist/ionic/{p-20087c90.entry.js → p-c759a704.entry.js} +1 -1
  113. package/dist/ionic/{p-6b9bf14c.system.entry.js → p-d1d3b740.system.entry.js} +1 -1
  114. package/dist/ionic/{p-8fa43732.system.entry.js → p-d693e765.system.entry.js} +1 -1
  115. package/dist/ionic/{p-5c96dc4e.entry.js → p-f7faa32d.entry.js} +1 -1
  116. package/dist/ionic/p-fabb7294.entry.js +4 -0
  117. package/dist/types/components/action-sheet/action-sheet.d.ts +1 -1
  118. package/dist/types/components/alert/alert.d.ts +1 -1
  119. package/dist/types/components/loading/loading.d.ts +1 -1
  120. package/dist/types/components/modal/modal.d.ts +1 -1
  121. package/dist/types/components/picker/picker.d.ts +1 -1
  122. package/dist/types/components/popover/popover.d.ts +1 -1
  123. package/dist/types/components/toast/toast.d.ts +1 -1
  124. package/dist/types/utils/lock-controller.d.ts +10 -0
  125. package/hydrate/index.js +126 -147
  126. package/package.json +1 -1
  127. package/dist/esm-es5/framework-delegate-2b76c681.js +0 -4
  128. package/dist/ionic/p-06f1f560.system.entry.js +0 -4
  129. package/dist/ionic/p-2936ec7f.system.entry.js +0 -4
  130. package/dist/ionic/p-29b3e70a.entry.js +0 -4
  131. package/dist/ionic/p-2bc49e5d.system.entry.js +0 -4
  132. package/dist/ionic/p-2da3e015.system.entry.js +0 -4
  133. package/dist/ionic/p-423d5a4d.entry.js +0 -4
  134. package/dist/ionic/p-564aaba3.entry.js +0 -4
  135. package/dist/ionic/p-61769039.entry.js +0 -4
  136. package/dist/ionic/p-74723f41.entry.js +0 -4
  137. package/dist/ionic/p-9b3c3564.entry.js +0 -4
  138. package/dist/ionic/p-b34c1ae1.js +0 -4
  139. package/dist/ionic/p-ccea9adc.system.entry.js +0 -4
  140. package/dist/ionic/p-d5db0834.system.entry.js +0 -4
  141. package/dist/ionic/p-d8538837.entry.js +0 -4
  142. package/dist/ionic/p-dd0b6889.system.entry.js +0 -4
@@ -4,6 +4,7 @@
4
4
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
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
+ import { c as createLockController } from './lock-controller.js';
7
8
  import { p as printIonWarning } from './index6.js';
8
9
  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';
9
10
  import { b as getIonMode, a as isPlatform } from './ionic-global.js';
@@ -984,6 +985,7 @@ const Popover = /*@__PURE__*/ proxyCustomElement(class Popover extends HTMLEleme
984
985
  this.ionMount = createEvent(this, "ionMount", 7);
985
986
  this.parentPopover = null;
986
987
  this.coreDelegate = CoreDelegate();
988
+ this.lockController = createLockController();
987
989
  this.inline = false;
988
990
  this.focusDescendantOnPresent = false;
989
991
  this.onBackdropTap = () => {
@@ -1157,28 +1159,24 @@ const Popover = /*@__PURE__*/ proxyCustomElement(class Popover extends HTMLEleme
1157
1159
  * was dispatched.
1158
1160
  */
1159
1161
  async present(event) {
1162
+ const unlock = await this.lockController.lock();
1160
1163
  if (this.presented) {
1164
+ unlock();
1161
1165
  return;
1162
1166
  }
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
- }
1174
1167
  const { el } = this;
1175
1168
  const { inline, delegate } = this.getDelegate(true);
1169
+ /**
1170
+ * Emit ionMount so JS Frameworks have an opportunity
1171
+ * to add the child component to the DOM. The child
1172
+ * component will be assigned to this.usersElement below.
1173
+ */
1174
+ this.ionMount.emit();
1176
1175
  this.usersElement = await attachComponent(delegate, el, this.component, ['popover-viewport'], this.componentProps, inline);
1177
1176
  if (!this.keyboardEvents) {
1178
1177
  this.configureKeyboardInteraction();
1179
1178
  }
1180
1179
  this.configureDismissInteraction();
1181
- this.ionMount.emit();
1182
1180
  /**
1183
1181
  * When using the lazy loaded build of Stencil, we need to wait
1184
1182
  * for every Stencil component instance to be ready before presenting
@@ -1201,7 +1199,7 @@ const Popover = /*@__PURE__*/ proxyCustomElement(class Popover extends HTMLEleme
1201
1199
  else if (!this.keepContentsMounted) {
1202
1200
  await waitForMount();
1203
1201
  }
1204
- this.currentTransition = present(this, 'popoverEnter', iosEnterAnimation, mdEnterAnimation, {
1202
+ await present(this, 'popoverEnter', iosEnterAnimation, mdEnterAnimation, {
1205
1203
  event: event || this.event,
1206
1204
  size: this.size,
1207
1205
  trigger: this.triggerEl,
@@ -1209,8 +1207,6 @@ const Popover = /*@__PURE__*/ proxyCustomElement(class Popover extends HTMLEleme
1209
1207
  side: this.side,
1210
1208
  align: this.alignment,
1211
1209
  });
1212
- await this.currentTransition;
1213
- this.currentTransition = undefined;
1214
1210
  /**
1215
1211
  * If popover is nested and was
1216
1212
  * presented using the "Right" arrow key,
@@ -1220,6 +1216,7 @@ const Popover = /*@__PURE__*/ proxyCustomElement(class Popover extends HTMLEleme
1220
1216
  if (this.focusDescendantOnPresent) {
1221
1217
  focusFirstDescendant(this.el, this.el);
1222
1218
  }
1219
+ unlock();
1223
1220
  }
1224
1221
  /**
1225
1222
  * Dismiss the popover overlay after it has been presented.
@@ -1230,23 +1227,12 @@ const Popover = /*@__PURE__*/ proxyCustomElement(class Popover extends HTMLEleme
1230
1227
  * a parent popover if this popover is nested. Defaults to `true`.
1231
1228
  */
1232
1229
  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
- }
1230
+ const unlock = await this.lockController.lock();
1244
1231
  const { destroyKeyboardInteraction, destroyDismissInteraction } = this;
1245
1232
  if (dismissParentPopover && this.parentPopover) {
1246
1233
  this.parentPopover.dismiss(data, role, dismissParentPopover);
1247
1234
  }
1248
- this.currentTransition = dismiss(this, data, role, 'popoverLeave', iosLeaveAnimation, mdLeaveAnimation, this.event);
1249
- const shouldDismiss = await this.currentTransition;
1235
+ const shouldDismiss = await dismiss(this, data, role, 'popoverLeave', iosLeaveAnimation, mdLeaveAnimation, this.event);
1250
1236
  if (shouldDismiss) {
1251
1237
  if (destroyKeyboardInteraction) {
1252
1238
  destroyKeyboardInteraction();
@@ -1264,7 +1250,7 @@ const Popover = /*@__PURE__*/ proxyCustomElement(class Popover extends HTMLEleme
1264
1250
  const { delegate } = this.getDelegate();
1265
1251
  await detachComponent(delegate, this.usersElement);
1266
1252
  }
1267
- this.currentTransition = undefined;
1253
+ unlock();
1268
1254
  return shouldDismiss;
1269
1255
  }
1270
1256
  /**
@@ -41,6 +41,7 @@ const CoreDelegate = () => {
41
41
  const attachViewToDom = async (parentElement, userComponent, userComponentProps = {}, cssClasses = []) => {
42
42
  var _a, _b;
43
43
  BaseComponent = parentElement;
44
+ let ChildComponent;
44
45
  /**
45
46
  * If passing in a component via the `component` props
46
47
  * we need to append it inside of our overlay component.
@@ -67,6 +68,7 @@ const CoreDelegate = () => {
67
68
  * inside of the overlay component.
68
69
  */
69
70
  BaseComponent.appendChild(el);
71
+ ChildComponent = el;
70
72
  await new Promise((resolve) => helpers.componentOnReady(el, resolve));
71
73
  }
72
74
  else if (BaseComponent.children.length > 0 &&
@@ -75,7 +77,7 @@ const CoreDelegate = () => {
75
77
  * The delegate host wrapper el is only needed for modals and popovers
76
78
  * because they allow the dev to provide custom content to the overlay.
77
79
  */
78
- const root = BaseComponent.children[0];
80
+ const root = (ChildComponent = BaseComponent.children[0]);
79
81
  if (!root.classList.contains('ion-delegate-host')) {
80
82
  /**
81
83
  * If the root element is not a delegate host, it means
@@ -90,6 +92,12 @@ const CoreDelegate = () => {
90
92
  el.append(...BaseComponent.children);
91
93
  // Append the new parent element to the original parent element.
92
94
  BaseComponent.appendChild(el);
95
+ /**
96
+ * Update the ChildComponent to be the
97
+ * newly created div in the event that one
98
+ * does not already exist.
99
+ */
100
+ ChildComponent = el;
93
101
  }
94
102
  }
95
103
  /**
@@ -105,7 +113,18 @@ const CoreDelegate = () => {
105
113
  Reference = document.createComment('ionic teleport');
106
114
  BaseComponent.parentNode.insertBefore(Reference, BaseComponent);
107
115
  app.appendChild(BaseComponent);
108
- return BaseComponent;
116
+ /**
117
+ * We return the child component rather than the overlay
118
+ * reference itself since modal and popover will
119
+ * use this to wait for any Ionic components in the child view
120
+ * to be ready (i.e. componentOnReady) when using the
121
+ * lazy loaded component bundle.
122
+ *
123
+ * However, we fall back to returning BaseComponent
124
+ * in the event that a modal or popover is presented
125
+ * with no child content.
126
+ */
127
+ return ChildComponent !== null && ChildComponent !== void 0 ? ChildComponent : BaseComponent;
109
128
  };
110
129
  const removeViewFromDom = () => {
111
130
  /**
@@ -15,12 +15,12 @@ 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-5c1706ed.js');
19
19
  require('./index-306a7476.js');
20
20
  require('./gesture-controller-b46721be.js');
21
21
  require('./index-484b1104.js');
22
22
  require('./hardware-back-button-b67c8e75.js');
23
- require('./framework-delegate-e8174951.js');
23
+ require('./framework-delegate-c0873a6f.js');
24
24
  require('./index-cc7dfb7c.js');
25
25
 
26
26
  const IonicSlides = (opts) => {
@@ -8,7 +8,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
8
8
  const index = require('./index-484b1104.js');
9
9
  const buttonActive = require('./button-active-dfd2756e.js');
10
10
  const helpers = require('./helpers-ea4ccbcb.js');
11
- const overlays = require('./overlays-0ea06fcb.js');
11
+ const lockController = require('./lock-controller-4ae2eb59.js');
12
+ const overlays = require('./overlays-5c1706ed.js');
12
13
  const theme = require('./theme-fbc56b3b.js');
13
14
  const ionicGlobal = require('./ionic-global-f81d8b73.js');
14
15
  const animation = require('./animation-2bb33618.js');
@@ -17,7 +18,7 @@ require('./capacitor-2ffba62a.js');
17
18
  require('./index-306a7476.js');
18
19
  require('./index-0ee995e4.js');
19
20
  require('./gesture-controller-b46721be.js');
20
- require('./framework-delegate-e8174951.js');
21
+ require('./framework-delegate-c0873a6f.js');
21
22
  require('./hardware-back-button-b67c8e75.js');
22
23
  require('./index-cc7dfb7c.js');
23
24
 
@@ -121,6 +122,7 @@ const ActionSheet = class {
121
122
  this.willDismissShorthand = index.createEvent(this, "willDismiss", 7);
122
123
  this.didDismissShorthand = index.createEvent(this, "didDismiss", 7);
123
124
  this.delegateController = overlays.createDelegateController(this);
125
+ this.lockController = lockController.createLockController();
124
126
  this.triggerController = overlays.createTriggerController();
125
127
  this.presented = false;
126
128
  this.onBackdropTap = () => {
@@ -168,21 +170,10 @@ const ActionSheet = class {
168
170
  * Present the action sheet overlay after it has been created.
169
171
  */
170
172
  async present() {
171
- /**
172
- * When using an inline action sheet
173
- * and dismissing a action sheet it is possible to
174
- * quickly present the action sheet while it is
175
- * dismissing. We need to await any current
176
- * transition to allow the dismiss to finish
177
- * before presenting again.
178
- */
179
- if (this.currentTransition !== undefined) {
180
- await this.currentTransition;
181
- }
173
+ const unlock = await this.lockController.lock();
182
174
  await this.delegateController.attachViewToDom();
183
- this.currentTransition = overlays.present(this, 'actionSheetEnter', iosEnterAnimation, mdEnterAnimation);
184
- await this.currentTransition;
185
- this.currentTransition = undefined;
175
+ await overlays.present(this, 'actionSheetEnter', iosEnterAnimation, mdEnterAnimation);
176
+ unlock();
186
177
  }
187
178
  /**
188
179
  * Dismiss the action sheet overlay after it has been presented.
@@ -194,11 +185,12 @@ const ActionSheet = class {
194
185
  * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
195
186
  */
196
187
  async dismiss(data, role) {
197
- this.currentTransition = overlays.dismiss(this, data, role, 'actionSheetLeave', iosLeaveAnimation, mdLeaveAnimation);
198
- const dismissed = await this.currentTransition;
188
+ const unlock = await this.lockController.lock();
189
+ const dismissed = await overlays.dismiss(this, data, role, 'actionSheetLeave', iosLeaveAnimation, mdLeaveAnimation);
199
190
  if (dismissed) {
200
191
  this.delegateController.removeViewFromDom();
201
192
  }
193
+ unlock();
202
194
  return dismissed;
203
195
  }
204
196
  /**
@@ -9,7 +9,8 @@ const index = require('./index-484b1104.js');
9
9
  const config = require('./config-d5882735.js');
10
10
  const buttonActive = require('./button-active-dfd2756e.js');
11
11
  const helpers = require('./helpers-ea4ccbcb.js');
12
- const overlays = require('./overlays-0ea06fcb.js');
12
+ const lockController = require('./lock-controller-4ae2eb59.js');
13
+ const overlays = require('./overlays-5c1706ed.js');
13
14
  const theme = require('./theme-fbc56b3b.js');
14
15
  const ionicGlobal = require('./ionic-global-f81d8b73.js');
15
16
  const animation = require('./animation-2bb33618.js');
@@ -18,7 +19,7 @@ require('./capacitor-2ffba62a.js');
18
19
  require('./index-306a7476.js');
19
20
  require('./index-0ee995e4.js');
20
21
  require('./gesture-controller-b46721be.js');
21
- require('./framework-delegate-e8174951.js');
22
+ require('./framework-delegate-c0873a6f.js');
22
23
  require('./hardware-back-button-b67c8e75.js');
23
24
  require('./index-cc7dfb7c.js');
24
25
 
@@ -123,6 +124,7 @@ const Alert = class {
123
124
  this.willDismissShorthand = index.createEvent(this, "willDismiss", 7);
124
125
  this.didDismissShorthand = index.createEvent(this, "didDismiss", 7);
125
126
  this.delegateController = overlays.createDelegateController(this);
127
+ this.lockController = lockController.createLockController();
126
128
  this.triggerController = overlays.createTriggerController();
127
129
  this.customHTMLEnabled = ionicGlobal.config.get('innerHTMLTemplatesEnabled', config.ENABLE_HTML_CONTENT_DEFAULT);
128
130
  this.processedInputs = [];
@@ -289,21 +291,10 @@ const Alert = class {
289
291
  * Present the alert overlay after it has been created.
290
292
  */
291
293
  async present() {
292
- /**
293
- * When using an inline alert
294
- * and dismissing an alert it is possible to
295
- * quickly present the alert while it is
296
- * dismissing. We need to await any current
297
- * transition to allow the dismiss to finish
298
- * before presenting again.
299
- */
300
- if (this.currentTransition !== undefined) {
301
- await this.currentTransition;
302
- }
294
+ const unlock = await this.lockController.lock();
303
295
  await this.delegateController.attachViewToDom();
304
- this.currentTransition = overlays.present(this, 'alertEnter', iosEnterAnimation, mdEnterAnimation);
305
- await this.currentTransition;
306
- this.currentTransition = undefined;
296
+ await overlays.present(this, 'alertEnter', iosEnterAnimation, mdEnterAnimation);
297
+ unlock();
307
298
  }
308
299
  /**
309
300
  * Dismiss the alert overlay after it has been presented.
@@ -315,11 +306,12 @@ const Alert = class {
315
306
  * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
316
307
  */
317
308
  async dismiss(data, role) {
318
- this.currentTransition = overlays.dismiss(this, data, role, 'alertLeave', iosLeaveAnimation, mdLeaveAnimation);
319
- const dismissed = await this.currentTransition;
309
+ const unlock = await this.lockController.lock();
310
+ const dismissed = await overlays.dismiss(this, data, role, 'alertLeave', iosLeaveAnimation, mdLeaveAnimation);
320
311
  if (dismissed) {
321
312
  this.delegateController.removeViewFromDom();
322
313
  }
314
+ unlock();
323
315
  return dismissed;
324
316
  }
325
317
  /**
@@ -13,7 +13,7 @@ const theme = require('./theme-fbc56b3b.js');
13
13
  const index$1 = require('./index-10873539.js');
14
14
  const keyboardController = require('./keyboard-controller-50beb83a.js');
15
15
  const cubicBezier = require('./cubic-bezier-6b9222ad.js');
16
- const frameworkDelegate = require('./framework-delegate-e8174951.js');
16
+ const frameworkDelegate = require('./framework-delegate-c0873a6f.js');
17
17
  const index$2 = require('./index-8568bedb.js');
18
18
  require('./index-cc7dfb7c.js');
19
19
  require('./index-306a7476.js');
@@ -1111,6 +1111,7 @@ const RouterOutlet = class {
1111
1111
  this.ionNavDidChange.emit();
1112
1112
  return true;
1113
1113
  }
1114
+ // TODO: FW-5048 - Remove this code in favor of using lock controller from utils
1114
1115
  async lock() {
1115
1116
  const p = this.waitPromise;
1116
1117
  let resolve;
@@ -14,10 +14,11 @@ const theme = require('./theme-fbc56b3b.js');
14
14
  const index$2 = require('./index-d8d1fc0b.js');
15
15
  const ionicGlobal = require('./ionic-global-f81d8b73.js');
16
16
  const data = require('./data-967b9c15.js');
17
- const overlays = require('./overlays-0ea06fcb.js');
17
+ const lockController = require('./lock-controller-4ae2eb59.js');
18
+ const overlays = require('./overlays-5c1706ed.js');
18
19
  const animation = require('./animation-2bb33618.js');
19
20
  const haptic = require('./haptic-c5f6b4d5.js');
20
- require('./framework-delegate-e8174951.js');
21
+ require('./framework-delegate-c0873a6f.js');
21
22
  require('./hardware-back-button-b67c8e75.js');
22
23
  require('./index-306a7476.js');
23
24
  require('./capacitor-2ffba62a.js');
@@ -1730,6 +1731,7 @@ const Picker = class {
1730
1731
  this.willDismissShorthand = index$1.createEvent(this, "willDismiss", 7);
1731
1732
  this.didDismissShorthand = index$1.createEvent(this, "didDismiss", 7);
1732
1733
  this.delegateController = overlays.createDelegateController(this);
1734
+ this.lockController = lockController.createLockController();
1733
1735
  this.triggerController = overlays.createTriggerController();
1734
1736
  this.onBackdropTap = () => {
1735
1737
  this.dismiss(undefined, overlays.BACKDROP);
@@ -1796,24 +1798,13 @@ const Picker = class {
1796
1798
  * Present the picker overlay after it has been created.
1797
1799
  */
1798
1800
  async present() {
1799
- /**
1800
- * When using an inline picker
1801
- * and dismissing an picker it is possible to
1802
- * quickly present the picker while it is
1803
- * dismissing. We need to await any current
1804
- * transition to allow the dismiss to finish
1805
- * before presenting again.
1806
- */
1807
- if (this.currentTransition !== undefined) {
1808
- await this.currentTransition;
1809
- }
1801
+ const unlock = await this.lockController.lock();
1810
1802
  await this.delegateController.attachViewToDom();
1811
- this.currentTransition = overlays.present(this, 'pickerEnter', iosEnterAnimation, iosEnterAnimation, undefined);
1812
- await this.currentTransition;
1813
- this.currentTransition = undefined;
1803
+ await overlays.present(this, 'pickerEnter', iosEnterAnimation, iosEnterAnimation, undefined);
1814
1804
  if (this.duration > 0) {
1815
1805
  this.durationTimeout = setTimeout(() => this.dismiss(), this.duration);
1816
1806
  }
1807
+ unlock();
1817
1808
  }
1818
1809
  /**
1819
1810
  * Dismiss the picker overlay after it has been presented.
@@ -1825,14 +1816,15 @@ const Picker = class {
1825
1816
  * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
1826
1817
  */
1827
1818
  async dismiss(data, role) {
1819
+ const unlock = await this.lockController.lock();
1828
1820
  if (this.durationTimeout) {
1829
1821
  clearTimeout(this.durationTimeout);
1830
1822
  }
1831
- this.currentTransition = overlays.dismiss(this, data, role, 'pickerLeave', iosLeaveAnimation, iosLeaveAnimation);
1832
- const dismissed = await this.currentTransition;
1823
+ const dismissed = await overlays.dismiss(this, data, role, 'pickerLeave', iosLeaveAnimation, iosLeaveAnimation);
1833
1824
  if (dismissed) {
1834
1825
  this.delegateController.removeViewFromDom();
1835
1826
  }
1827
+ unlock();
1836
1828
  return dismissed;
1837
1829
  }
1838
1830
  /**
@@ -8,11 +8,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
8
8
  const index = require('./index-484b1104.js');
9
9
  const config = require('./config-d5882735.js');
10
10
  const helpers = require('./helpers-ea4ccbcb.js');
11
- const overlays = require('./overlays-0ea06fcb.js');
11
+ const lockController = require('./lock-controller-4ae2eb59.js');
12
+ const overlays = require('./overlays-5c1706ed.js');
12
13
  const theme = require('./theme-fbc56b3b.js');
13
14
  const ionicGlobal = require('./ionic-global-f81d8b73.js');
14
15
  const animation = require('./animation-2bb33618.js');
15
- require('./framework-delegate-e8174951.js');
16
+ require('./framework-delegate-c0873a6f.js');
16
17
  require('./hardware-back-button-b67c8e75.js');
17
18
  require('./index-cc7dfb7c.js');
18
19
  require('./index-306a7476.js');
@@ -121,6 +122,7 @@ const Loading = class {
121
122
  this.willDismissShorthand = index.createEvent(this, "willDismiss", 7);
122
123
  this.didDismissShorthand = index.createEvent(this, "didDismiss", 7);
123
124
  this.delegateController = overlays.createDelegateController(this);
125
+ this.lockController = lockController.createLockController();
124
126
  this.triggerController = overlays.createTriggerController();
125
127
  this.customHTMLEnabled = ionicGlobal.config.get('innerHTMLTemplatesEnabled', config.ENABLE_HTML_CONTENT_DEFAULT);
126
128
  this.presented = false;
@@ -186,24 +188,13 @@ const Loading = class {
186
188
  * Present the loading overlay after it has been created.
187
189
  */
188
190
  async present() {
189
- /**
190
- * When using an inline loading indicator
191
- * and dismissing a loading indicator it is possible to
192
- * quickly present the loading indicator while it is
193
- * dismissing. We need to await any current
194
- * transition to allow the dismiss to finish
195
- * before presenting again.
196
- */
197
- if (this.currentTransition !== undefined) {
198
- await this.currentTransition;
199
- }
191
+ const unlock = await this.lockController.lock();
200
192
  await this.delegateController.attachViewToDom();
201
- this.currentTransition = overlays.present(this, 'loadingEnter', iosEnterAnimation, mdEnterAnimation);
202
- await this.currentTransition;
193
+ await overlays.present(this, 'loadingEnter', iosEnterAnimation, mdEnterAnimation);
203
194
  if (this.duration > 0) {
204
195
  this.durationTimeout = setTimeout(() => this.dismiss(), this.duration + 10);
205
196
  }
206
- this.currentTransition = undefined;
197
+ unlock();
207
198
  }
208
199
  /**
209
200
  * Dismiss the loading overlay after it has been presented.
@@ -215,14 +206,15 @@ const Loading = class {
215
206
  * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
216
207
  */
217
208
  async dismiss(data, role) {
209
+ const unlock = await this.lockController.lock();
218
210
  if (this.durationTimeout) {
219
211
  clearTimeout(this.durationTimeout);
220
212
  }
221
- this.currentTransition = overlays.dismiss(this, data, role, 'loadingLeave', iosLeaveAnimation, mdLeaveAnimation);
222
- const dismissed = await this.currentTransition;
213
+ const dismissed = await overlays.dismiss(this, data, role, 'loadingLeave', iosLeaveAnimation, mdLeaveAnimation);
223
214
  if (dismissed) {
224
215
  this.delegateController.removeViewFromDom();
225
216
  }
217
+ unlock();
226
218
  return dismissed;
227
219
  }
228
220
  /**
@@ -11,13 +11,13 @@ const index$2 = require('./index-306a7476.js');
11
11
  const gestureController = require('./gesture-controller-b46721be.js');
12
12
  const helpers = require('./helpers-ea4ccbcb.js');
13
13
  const index$1 = require('./index-653be4df.js');
14
- const overlays = require('./overlays-0ea06fcb.js');
14
+ const overlays = require('./overlays-5c1706ed.js');
15
15
  const ionicGlobal = require('./ionic-global-f81d8b73.js');
16
16
  const theme = require('./theme-fbc56b3b.js');
17
17
  const index$3 = require('./index-d8d1fc0b.js');
18
18
  require('./hardware-back-button-b67c8e75.js');
19
19
  require('./animation-2bb33618.js');
20
- require('./framework-delegate-e8174951.js');
20
+ require('./framework-delegate-c0873a6f.js');
21
21
  require('./index-cc7dfb7c.js');
22
22
 
23
23
  const menuIosCss = ":host{--width:304px;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--background:var(--ion-background-color, #fff);left:0;right:0;top:0;bottom:0;display:none;position:absolute;contain:strict}:host(.show-menu){display:block}.menu-inner{-webkit-transform:translateX(-9999px);transform:translateX(-9999px);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);contain:strict}:host(.menu-side-start) .menu-inner{--ion-safe-area-right:0px;top:0;bottom:0}@supports (inset-inline-start: 0){:host(.menu-side-start) .menu-inner{inset-inline-start:0;inset-inline-end:auto}}@supports not (inset-inline-start: 0){:host(.menu-side-start) .menu-inner{left:0;right:auto}:host-context([dir=rtl]):host(.menu-side-start) .menu-inner,:host-context([dir=rtl]).menu-side-start .menu-inner{left:unset;right:unset;left:auto;right:0}@supports selector(:dir(rtl)){:host(.menu-side-start) .menu-inner:dir(rtl){left:unset;right:unset;left:auto;right:0}}}:host(.menu-side-end) .menu-inner{--ion-safe-area-left:0px;top:0;bottom:0}@supports (inset-inline-start: 0){:host(.menu-side-end) .menu-inner{inset-inline-start:auto;inset-inline-end:0}}@supports not (inset-inline-start: 0){:host(.menu-side-end) .menu-inner{left:auto;right:0}:host-context([dir=rtl]):host(.menu-side-end) .menu-inner,:host-context([dir=rtl]).menu-side-end .menu-inner{left:unset;right:unset;left:0;right:auto}@supports selector(:dir(rtl)){:host(.menu-side-end) .menu-inner:dir(rtl){left:unset;right:unset;left:0;right:auto}}}ion-backdrop{display:none;opacity:0.01;z-index:-1}@media (max-width: 340px){.menu-inner{--width:264px}}:host(.menu-type-reveal){z-index:0}:host(.menu-type-reveal.show-menu) .menu-inner{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}:host(.menu-type-overlay){z-index:1000}:host(.menu-type-overlay) .show-backdrop{display:block;cursor:pointer}:host(.menu-pane-visible){width:var(--width);min-width:var(--min-width);max-width:var(--max-width)}:host(.menu-pane-visible) .menu-inner{left:0;right:0;width:auto;-webkit-transform:none !important;transform:none !important;-webkit-box-shadow:none !important;box-shadow:none !important}:host(.menu-pane-visible) ion-backdrop{display:hidden !important;}:host(.menu-type-push){z-index:1000}:host(.menu-type-push) .show-backdrop{display:block}";
@@ -7,11 +7,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
8
  const index$3 = require('./index-484b1104.js');
9
9
  const index$2 = require('./index-10873539.js');
10
- const frameworkDelegate = require('./framework-delegate-e8174951.js');
10
+ const frameworkDelegate = require('./framework-delegate-c0873a6f.js');
11
11
  const helpers = require('./helpers-ea4ccbcb.js');
12
+ const lockController = require('./lock-controller-4ae2eb59.js');
12
13
  const index$4 = require('./index-cc7dfb7c.js');
13
14
  const capacitor = require('./capacitor-2ffba62a.js');
14
- const overlays = require('./overlays-0ea06fcb.js');
15
+ const overlays = require('./overlays-5c1706ed.js');
15
16
  const theme = require('./theme-fbc56b3b.js');
16
17
  const index$5 = require('./index-8568bedb.js');
17
18
  const ionicGlobal = require('./ionic-global-f81d8b73.js');
@@ -1117,6 +1118,7 @@ const Modal = class {
1117
1118
  this.willDismissShorthand = index$3.createEvent(this, "willDismiss", 7);
1118
1119
  this.didDismissShorthand = index$3.createEvent(this, "didDismiss", 7);
1119
1120
  this.ionMount = index$3.createEvent(this, "ionMount", 7);
1121
+ this.lockController = lockController.createLockController();
1120
1122
  this.triggerController = overlays.createTriggerController();
1121
1123
  this.coreDelegate = frameworkDelegate.CoreDelegate();
1122
1124
  this.isSheetModal = false;
@@ -1281,29 +1283,25 @@ const Modal = class {
1281
1283
  * Present the modal overlay after it has been created.
1282
1284
  */
1283
1285
  async present() {
1286
+ const unlock = await this.lockController.lock();
1284
1287
  if (this.presented) {
1288
+ unlock();
1285
1289
  return;
1286
1290
  }
1287
1291
  const { presentingElement, el } = this;
1288
- /**
1289
- * When using an inline modal
1290
- * and dismissing a modal it is possible to
1291
- * quickly present the modal while it is
1292
- * dismissing. We need to await any current
1293
- * transition to allow the dismiss to finish
1294
- * before presenting again.
1295
- */
1296
- if (this.currentTransition !== undefined) {
1297
- await this.currentTransition;
1298
- }
1299
1292
  /**
1300
1293
  * If the modal is presented multiple times (inline modals), we
1301
1294
  * need to reset the current breakpoint to the initial breakpoint.
1302
1295
  */
1303
1296
  this.currentBreakpoint = this.initialBreakpoint;
1304
1297
  const { inline, delegate } = this.getDelegate(true);
1305
- this.usersElement = await frameworkDelegate.attachComponent(delegate, el, this.component, ['ion-page'], this.componentProps, inline);
1298
+ /**
1299
+ * Emit ionMount so JS Frameworks have an opportunity
1300
+ * to add the child component to the DOM. The child
1301
+ * component will be assigned to this.usersElement below.
1302
+ */
1306
1303
  this.ionMount.emit();
1304
+ this.usersElement = await frameworkDelegate.attachComponent(delegate, el, this.component, ['ion-page'], this.componentProps, inline);
1307
1305
  /**
1308
1306
  * When using the lazy loaded build of Stencil, we need to wait
1309
1307
  * for every Stencil component instance to be ready before presenting
@@ -1327,7 +1325,7 @@ const Modal = class {
1327
1325
  await index$5.waitForMount();
1328
1326
  }
1329
1327
  index$3.writeTask(() => this.el.classList.add('show-modal'));
1330
- this.currentTransition = overlays.present(this, 'modalEnter', iosEnterAnimation, mdEnterAnimation, {
1328
+ await overlays.present(this, 'modalEnter', iosEnterAnimation, mdEnterAnimation, {
1331
1329
  presentingEl: presentingElement,
1332
1330
  currentBreakpoint: this.initialBreakpoint,
1333
1331
  backdropBreakpoint: this.backdropBreakpoint,
@@ -1374,14 +1372,13 @@ const Modal = class {
1374
1372
  this.statusBarStyle = await StatusBar.getStyle();
1375
1373
  setCardStatusBarDark();
1376
1374
  }
1377
- await this.currentTransition;
1378
1375
  if (this.isSheetModal) {
1379
1376
  this.initSheetGesture();
1380
1377
  }
1381
1378
  else if (hasCardModal) {
1382
1379
  this.initSwipeToClose();
1383
1380
  }
1384
- this.currentTransition = undefined;
1381
+ unlock();
1385
1382
  }
1386
1383
  initSwipeToClose() {
1387
1384
  var _a;
@@ -1471,12 +1468,19 @@ const Modal = class {
1471
1468
  if (this.gestureAnimationDismissing && role !== overlays.GESTURE) {
1472
1469
  return false;
1473
1470
  }
1471
+ /**
1472
+ * Because the canDismiss check below is async,
1473
+ * we need to claim a lock before the check happens,
1474
+ * in case the dismiss transition does run.
1475
+ */
1476
+ const unlock = await this.lockController.lock();
1474
1477
  /**
1475
1478
  * If a canDismiss handler is responsible
1476
1479
  * for calling the dismiss method, we should
1477
1480
  * not run the canDismiss check again.
1478
1481
  */
1479
1482
  if (role !== 'handler' && !(await this.checkCanDismiss(data, role))) {
1483
+ unlock();
1480
1484
  return false;
1481
1485
  }
1482
1486
  const { presentingElement } = this;
@@ -1494,24 +1498,12 @@ const Modal = class {
1494
1498
  window.removeEventListener(keyboard.KEYBOARD_DID_OPEN, this.keyboardOpenCallback);
1495
1499
  this.keyboardOpenCallback = undefined;
1496
1500
  }
1497
- /**
1498
- * When using an inline modal
1499
- * and presenting a modal it is possible to
1500
- * quickly dismiss the modal while it is
1501
- * presenting. We need to await any current
1502
- * transition to allow the present to finish
1503
- * before dismissing again.
1504
- */
1505
- if (this.currentTransition !== undefined) {
1506
- await this.currentTransition;
1507
- }
1508
1501
  const enteringAnimation = overlays.activeAnimations.get(this) || [];
1509
- this.currentTransition = overlays.dismiss(this, data, role, 'modalLeave', iosLeaveAnimation, mdLeaveAnimation, {
1502
+ const dismissed = await overlays.dismiss(this, data, role, 'modalLeave', iosLeaveAnimation, mdLeaveAnimation, {
1510
1503
  presentingEl: presentingElement,
1511
1504
  currentBreakpoint: (_a = this.currentBreakpoint) !== null && _a !== void 0 ? _a : this.initialBreakpoint,
1512
1505
  backdropBreakpoint: this.backdropBreakpoint,
1513
1506
  });
1514
- const dismissed = await this.currentTransition;
1515
1507
  if (dismissed) {
1516
1508
  const { delegate } = this.getDelegate();
1517
1509
  await frameworkDelegate.detachComponent(delegate, this.usersElement);
@@ -1525,8 +1517,8 @@ const Modal = class {
1525
1517
  enteringAnimation.forEach((ani) => ani.destroy());
1526
1518
  }
1527
1519
  this.currentBreakpoint = undefined;
1528
- this.currentTransition = undefined;
1529
1520
  this.animation = undefined;
1521
+ unlock();
1530
1522
  return dismissed;
1531
1523
  }
1532
1524
  /**
@@ -10,7 +10,7 @@ const cubicBezier = require('./cubic-bezier-6b9222ad.js');
10
10
  const helpers = require('./helpers-ea4ccbcb.js');
11
11
  const index$1 = require('./index-8568bedb.js');
12
12
  const ionicGlobal = require('./ionic-global-f81d8b73.js');
13
- const frameworkDelegate = require('./framework-delegate-e8174951.js');
13
+ const frameworkDelegate = require('./framework-delegate-c0873a6f.js');
14
14
 
15
15
  const VIEW_STATE_NEW = 1;
16
16
  const VIEW_STATE_ATTACHED = 2;
@@ -931,13 +931,7 @@ const NavLink = class {
931
931
  constructor(hostRef) {
932
932
  index.registerInstance(this, hostRef);
933
933
  this.onClick = () => {
934
- const { el } = this;
935
- const button = el.querySelector('button,ion-button,a');
936
- if (button === null || button === void 0 ? void 0 : button.hasAttribute('disabled')) {
937
- // Do not navigate if the button is disabled
938
- return;
939
- }
940
- return navLink(el, this.routerDirection, this.component, this.componentProps, this.routerAnimation);
934
+ return navLink(this.el, this.routerDirection, this.component, this.componentProps, this.routerAnimation);
941
935
  };
942
936
  this.component = undefined;
943
937
  this.componentProps = undefined;