@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
package/hydrate/index.js CHANGED
@@ -7968,6 +7968,40 @@ const createButtonActiveGesture = (el, isButton) => {
7968
7968
  });
7969
7969
  };
7970
7970
 
7971
+ /**
7972
+ * Creates a lock controller.
7973
+ *
7974
+ * Claiming a lock means that nothing else can acquire the lock until it is released.
7975
+ * This can momentarily prevent execution of code that needs to wait for the earlier code to finish.
7976
+ * For example, this can be used to prevent multiple transitions from occurring at the same time.
7977
+ */
7978
+ const createLockController = () => {
7979
+ let waitPromise;
7980
+ /**
7981
+ * When lock() is called, the lock is claimed.
7982
+ * Once a lock has been claimed, it cannot be claimed again until it is released.
7983
+ * When this function gets resolved, the lock is released, allowing it to be claimed again.
7984
+ *
7985
+ * @example ```tsx
7986
+ * const unlock = await this.lockController.lock();
7987
+ * // do other stuff
7988
+ * unlock();
7989
+ * ```
7990
+ */
7991
+ const lock = async () => {
7992
+ const p = waitPromise;
7993
+ let resolve;
7994
+ waitPromise = new Promise((r) => (resolve = r));
7995
+ if (p !== undefined) {
7996
+ await p;
7997
+ }
7998
+ return resolve;
7999
+ };
8000
+ return {
8001
+ lock,
8002
+ };
8003
+ };
8004
+
7971
8005
  // TODO(FW-2832): types
7972
8006
  const attachComponent = async (delegate, container, component, cssClasses, componentProps, inline) => {
7973
8007
  var _a;
@@ -8004,6 +8038,7 @@ const CoreDelegate = () => {
8004
8038
  const attachViewToDom = async (parentElement, userComponent, userComponentProps = {}, cssClasses = []) => {
8005
8039
  var _a, _b;
8006
8040
  BaseComponent = parentElement;
8041
+ let ChildComponent;
8007
8042
  /**
8008
8043
  * If passing in a component via the `component` props
8009
8044
  * we need to append it inside of our overlay component.
@@ -8030,6 +8065,7 @@ const CoreDelegate = () => {
8030
8065
  * inside of the overlay component.
8031
8066
  */
8032
8067
  BaseComponent.appendChild(el);
8068
+ ChildComponent = el;
8033
8069
  await new Promise((resolve) => componentOnReady(el, resolve));
8034
8070
  }
8035
8071
  else if (BaseComponent.children.length > 0 &&
@@ -8038,7 +8074,7 @@ const CoreDelegate = () => {
8038
8074
  * The delegate host wrapper el is only needed for modals and popovers
8039
8075
  * because they allow the dev to provide custom content to the overlay.
8040
8076
  */
8041
- const root = BaseComponent.children[0];
8077
+ const root = (ChildComponent = BaseComponent.children[0]);
8042
8078
  if (!root.classList.contains('ion-delegate-host')) {
8043
8079
  /**
8044
8080
  * If the root element is not a delegate host, it means
@@ -8053,6 +8089,12 @@ const CoreDelegate = () => {
8053
8089
  el.append(...BaseComponent.children);
8054
8090
  // Append the new parent element to the original parent element.
8055
8091
  BaseComponent.appendChild(el);
8092
+ /**
8093
+ * Update the ChildComponent to be the
8094
+ * newly created div in the event that one
8095
+ * does not already exist.
8096
+ */
8097
+ ChildComponent = el;
8056
8098
  }
8057
8099
  }
8058
8100
  /**
@@ -8068,7 +8110,18 @@ const CoreDelegate = () => {
8068
8110
  Reference = document.createComment('ionic teleport');
8069
8111
  BaseComponent.parentNode.insertBefore(Reference, BaseComponent);
8070
8112
  app.appendChild(BaseComponent);
8071
- return BaseComponent;
8113
+ /**
8114
+ * We return the child component rather than the overlay
8115
+ * reference itself since modal and popover will
8116
+ * use this to wait for any Ionic components in the child view
8117
+ * to be ready (i.e. componentOnReady) when using the
8118
+ * lazy loaded component bundle.
8119
+ *
8120
+ * However, we fall back to returning BaseComponent
8121
+ * in the event that a modal or popover is presented
8122
+ * with no child content.
8123
+ */
8124
+ return ChildComponent !== null && ChildComponent !== void 0 ? ChildComponent : BaseComponent;
8072
8125
  };
8073
8126
  const removeViewFromDom = () => {
8074
8127
  /**
@@ -9873,6 +9926,7 @@ class ActionSheet {
9873
9926
  this.willDismissShorthand = createEvent(this, "willDismiss", 7);
9874
9927
  this.didDismissShorthand = createEvent(this, "didDismiss", 7);
9875
9928
  this.delegateController = createDelegateController(this);
9929
+ this.lockController = createLockController();
9876
9930
  this.triggerController = createTriggerController();
9877
9931
  this.presented = false;
9878
9932
  this.onBackdropTap = () => {
@@ -9920,21 +9974,10 @@ class ActionSheet {
9920
9974
  * Present the action sheet overlay after it has been created.
9921
9975
  */
9922
9976
  async present() {
9923
- /**
9924
- * When using an inline action sheet
9925
- * and dismissing a action sheet it is possible to
9926
- * quickly present the action sheet while it is
9927
- * dismissing. We need to await any current
9928
- * transition to allow the dismiss to finish
9929
- * before presenting again.
9930
- */
9931
- if (this.currentTransition !== undefined) {
9932
- await this.currentTransition;
9933
- }
9977
+ const unlock = await this.lockController.lock();
9934
9978
  await this.delegateController.attachViewToDom();
9935
- this.currentTransition = present(this, 'actionSheetEnter', iosEnterAnimation$6, mdEnterAnimation$5);
9936
- await this.currentTransition;
9937
- this.currentTransition = undefined;
9979
+ await present(this, 'actionSheetEnter', iosEnterAnimation$6, mdEnterAnimation$5);
9980
+ unlock();
9938
9981
  }
9939
9982
  /**
9940
9983
  * Dismiss the action sheet overlay after it has been presented.
@@ -9946,11 +9989,12 @@ class ActionSheet {
9946
9989
  * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
9947
9990
  */
9948
9991
  async dismiss(data, role) {
9949
- this.currentTransition = dismiss(this, data, role, 'actionSheetLeave', iosLeaveAnimation$6, mdLeaveAnimation$5);
9950
- const dismissed = await this.currentTransition;
9992
+ const unlock = await this.lockController.lock();
9993
+ const dismissed = await dismiss(this, data, role, 'actionSheetLeave', iosLeaveAnimation$6, mdLeaveAnimation$5);
9951
9994
  if (dismissed) {
9952
9995
  this.delegateController.removeViewFromDom();
9953
9996
  }
9997
+ unlock();
9954
9998
  return dismissed;
9955
9999
  }
9956
10000
  /**
@@ -10360,6 +10404,7 @@ class Alert {
10360
10404
  this.willDismissShorthand = createEvent(this, "willDismiss", 7);
10361
10405
  this.didDismissShorthand = createEvent(this, "didDismiss", 7);
10362
10406
  this.delegateController = createDelegateController(this);
10407
+ this.lockController = createLockController();
10363
10408
  this.triggerController = createTriggerController();
10364
10409
  this.customHTMLEnabled = config.get('innerHTMLTemplatesEnabled', ENABLE_HTML_CONTENT_DEFAULT);
10365
10410
  this.processedInputs = [];
@@ -10526,21 +10571,10 @@ class Alert {
10526
10571
  * Present the alert overlay after it has been created.
10527
10572
  */
10528
10573
  async present() {
10529
- /**
10530
- * When using an inline alert
10531
- * and dismissing an alert it is possible to
10532
- * quickly present the alert while it is
10533
- * dismissing. We need to await any current
10534
- * transition to allow the dismiss to finish
10535
- * before presenting again.
10536
- */
10537
- if (this.currentTransition !== undefined) {
10538
- await this.currentTransition;
10539
- }
10574
+ const unlock = await this.lockController.lock();
10540
10575
  await this.delegateController.attachViewToDom();
10541
- this.currentTransition = present(this, 'alertEnter', iosEnterAnimation$5, mdEnterAnimation$4);
10542
- await this.currentTransition;
10543
- this.currentTransition = undefined;
10576
+ await present(this, 'alertEnter', iosEnterAnimation$5, mdEnterAnimation$4);
10577
+ unlock();
10544
10578
  }
10545
10579
  /**
10546
10580
  * Dismiss the alert overlay after it has been presented.
@@ -10552,11 +10586,12 @@ class Alert {
10552
10586
  * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
10553
10587
  */
10554
10588
  async dismiss(data, role) {
10555
- this.currentTransition = dismiss(this, data, role, 'alertLeave', iosLeaveAnimation$5, mdLeaveAnimation$4);
10556
- const dismissed = await this.currentTransition;
10589
+ const unlock = await this.lockController.lock();
10590
+ const dismissed = await dismiss(this, data, role, 'alertLeave', iosLeaveAnimation$5, mdLeaveAnimation$4);
10557
10591
  if (dismissed) {
10558
10592
  this.delegateController.removeViewFromDom();
10559
10593
  }
10594
+ unlock();
10560
10595
  return dismissed;
10561
10596
  }
10562
10597
  /**
@@ -19794,6 +19829,7 @@ class Loading {
19794
19829
  this.willDismissShorthand = createEvent(this, "willDismiss", 7);
19795
19830
  this.didDismissShorthand = createEvent(this, "didDismiss", 7);
19796
19831
  this.delegateController = createDelegateController(this);
19832
+ this.lockController = createLockController();
19797
19833
  this.triggerController = createTriggerController();
19798
19834
  this.customHTMLEnabled = config.get('innerHTMLTemplatesEnabled', ENABLE_HTML_CONTENT_DEFAULT);
19799
19835
  this.presented = false;
@@ -19859,24 +19895,13 @@ class Loading {
19859
19895
  * Present the loading overlay after it has been created.
19860
19896
  */
19861
19897
  async present() {
19862
- /**
19863
- * When using an inline loading indicator
19864
- * and dismissing a loading indicator it is possible to
19865
- * quickly present the loading indicator while it is
19866
- * dismissing. We need to await any current
19867
- * transition to allow the dismiss to finish
19868
- * before presenting again.
19869
- */
19870
- if (this.currentTransition !== undefined) {
19871
- await this.currentTransition;
19872
- }
19898
+ const unlock = await this.lockController.lock();
19873
19899
  await this.delegateController.attachViewToDom();
19874
- this.currentTransition = present(this, 'loadingEnter', iosEnterAnimation$4, mdEnterAnimation$3);
19875
- await this.currentTransition;
19900
+ await present(this, 'loadingEnter', iosEnterAnimation$4, mdEnterAnimation$3);
19876
19901
  if (this.duration > 0) {
19877
19902
  this.durationTimeout = setTimeout(() => this.dismiss(), this.duration + 10);
19878
19903
  }
19879
- this.currentTransition = undefined;
19904
+ unlock();
19880
19905
  }
19881
19906
  /**
19882
19907
  * Dismiss the loading overlay after it has been presented.
@@ -19888,14 +19913,15 @@ class Loading {
19888
19913
  * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
19889
19914
  */
19890
19915
  async dismiss(data, role) {
19916
+ const unlock = await this.lockController.lock();
19891
19917
  if (this.durationTimeout) {
19892
19918
  clearTimeout(this.durationTimeout);
19893
19919
  }
19894
- this.currentTransition = dismiss(this, data, role, 'loadingLeave', iosLeaveAnimation$4, mdLeaveAnimation$3);
19895
- const dismissed = await this.currentTransition;
19920
+ const dismissed = await dismiss(this, data, role, 'loadingLeave', iosLeaveAnimation$4, mdLeaveAnimation$3);
19896
19921
  if (dismissed) {
19897
19922
  this.delegateController.removeViewFromDom();
19898
19923
  }
19924
+ unlock();
19899
19925
  return dismissed;
19900
19926
  }
19901
19927
  /**
@@ -22396,6 +22422,7 @@ class Modal {
22396
22422
  this.willDismissShorthand = createEvent(this, "willDismiss", 7);
22397
22423
  this.didDismissShorthand = createEvent(this, "didDismiss", 7);
22398
22424
  this.ionMount = createEvent(this, "ionMount", 7);
22425
+ this.lockController = createLockController();
22399
22426
  this.triggerController = createTriggerController();
22400
22427
  this.coreDelegate = CoreDelegate();
22401
22428
  this.isSheetModal = false;
@@ -22560,29 +22587,25 @@ class Modal {
22560
22587
  * Present the modal overlay after it has been created.
22561
22588
  */
22562
22589
  async present() {
22590
+ const unlock = await this.lockController.lock();
22563
22591
  if (this.presented) {
22592
+ unlock();
22564
22593
  return;
22565
22594
  }
22566
22595
  const { presentingElement, el } = this;
22567
- /**
22568
- * When using an inline modal
22569
- * and dismissing a modal it is possible to
22570
- * quickly present the modal while it is
22571
- * dismissing. We need to await any current
22572
- * transition to allow the dismiss to finish
22573
- * before presenting again.
22574
- */
22575
- if (this.currentTransition !== undefined) {
22576
- await this.currentTransition;
22577
- }
22578
22596
  /**
22579
22597
  * If the modal is presented multiple times (inline modals), we
22580
22598
  * need to reset the current breakpoint to the initial breakpoint.
22581
22599
  */
22582
22600
  this.currentBreakpoint = this.initialBreakpoint;
22583
22601
  const { inline, delegate } = this.getDelegate(true);
22584
- this.usersElement = await attachComponent(delegate, el, this.component, ['ion-page'], this.componentProps, inline);
22602
+ /**
22603
+ * Emit ionMount so JS Frameworks have an opportunity
22604
+ * to add the child component to the DOM. The child
22605
+ * component will be assigned to this.usersElement below.
22606
+ */
22585
22607
  this.ionMount.emit();
22608
+ this.usersElement = await attachComponent(delegate, el, this.component, ['ion-page'], this.componentProps, inline);
22586
22609
  /**
22587
22610
  * When using the lazy loaded build of Stencil, we need to wait
22588
22611
  * for every Stencil component instance to be ready before presenting
@@ -22606,7 +22629,7 @@ class Modal {
22606
22629
  await waitForMount();
22607
22630
  }
22608
22631
  writeTask(() => this.el.classList.add('show-modal'));
22609
- this.currentTransition = present(this, 'modalEnter', iosEnterAnimation$3, mdEnterAnimation$2, {
22632
+ await present(this, 'modalEnter', iosEnterAnimation$3, mdEnterAnimation$2, {
22610
22633
  presentingEl: presentingElement,
22611
22634
  currentBreakpoint: this.initialBreakpoint,
22612
22635
  backdropBreakpoint: this.backdropBreakpoint,
@@ -22653,14 +22676,13 @@ class Modal {
22653
22676
  this.statusBarStyle = await StatusBar.getStyle();
22654
22677
  setCardStatusBarDark();
22655
22678
  }
22656
- await this.currentTransition;
22657
22679
  if (this.isSheetModal) {
22658
22680
  this.initSheetGesture();
22659
22681
  }
22660
22682
  else if (hasCardModal) {
22661
22683
  this.initSwipeToClose();
22662
22684
  }
22663
- this.currentTransition = undefined;
22685
+ unlock();
22664
22686
  }
22665
22687
  initSwipeToClose() {
22666
22688
  var _a;
@@ -22750,12 +22772,19 @@ class Modal {
22750
22772
  if (this.gestureAnimationDismissing && role !== GESTURE) {
22751
22773
  return false;
22752
22774
  }
22775
+ /**
22776
+ * Because the canDismiss check below is async,
22777
+ * we need to claim a lock before the check happens,
22778
+ * in case the dismiss transition does run.
22779
+ */
22780
+ const unlock = await this.lockController.lock();
22753
22781
  /**
22754
22782
  * If a canDismiss handler is responsible
22755
22783
  * for calling the dismiss method, we should
22756
22784
  * not run the canDismiss check again.
22757
22785
  */
22758
22786
  if (role !== 'handler' && !(await this.checkCanDismiss(data, role))) {
22787
+ unlock();
22759
22788
  return false;
22760
22789
  }
22761
22790
  const { presentingElement } = this;
@@ -22773,24 +22802,12 @@ class Modal {
22773
22802
  window.removeEventListener(KEYBOARD_DID_OPEN, this.keyboardOpenCallback);
22774
22803
  this.keyboardOpenCallback = undefined;
22775
22804
  }
22776
- /**
22777
- * When using an inline modal
22778
- * and presenting a modal it is possible to
22779
- * quickly dismiss the modal while it is
22780
- * presenting. We need to await any current
22781
- * transition to allow the present to finish
22782
- * before dismissing again.
22783
- */
22784
- if (this.currentTransition !== undefined) {
22785
- await this.currentTransition;
22786
- }
22787
22805
  const enteringAnimation = activeAnimations.get(this) || [];
22788
- this.currentTransition = dismiss(this, data, role, 'modalLeave', iosLeaveAnimation$3, mdLeaveAnimation$2, {
22806
+ const dismissed = await dismiss(this, data, role, 'modalLeave', iosLeaveAnimation$3, mdLeaveAnimation$2, {
22789
22807
  presentingEl: presentingElement,
22790
22808
  currentBreakpoint: (_a = this.currentBreakpoint) !== null && _a !== void 0 ? _a : this.initialBreakpoint,
22791
22809
  backdropBreakpoint: this.backdropBreakpoint,
22792
22810
  });
22793
- const dismissed = await this.currentTransition;
22794
22811
  if (dismissed) {
22795
22812
  const { delegate } = this.getDelegate();
22796
22813
  await detachComponent(delegate, this.usersElement);
@@ -22804,8 +22821,8 @@ class Modal {
22804
22821
  enteringAnimation.forEach((ani) => ani.destroy());
22805
22822
  }
22806
22823
  this.currentBreakpoint = undefined;
22807
- this.currentTransition = undefined;
22808
22824
  this.animation = undefined;
22825
+ unlock();
22809
22826
  return dismissed;
22810
22827
  }
22811
22828
  /**
@@ -23900,13 +23917,7 @@ class NavLink {
23900
23917
  constructor(hostRef) {
23901
23918
  registerInstance(this, hostRef);
23902
23919
  this.onClick = () => {
23903
- const { el } = this;
23904
- const button = el.querySelector('button,ion-button,a');
23905
- if (button === null || button === void 0 ? void 0 : button.hasAttribute('disabled')) {
23906
- // Do not navigate if the button is disabled
23907
- return;
23908
- }
23909
- return navLink(el, this.routerDirection, this.component, this.componentProps, this.routerAnimation);
23920
+ return navLink(this.el, this.routerDirection, this.component, this.componentProps, this.routerAnimation);
23910
23921
  };
23911
23922
  this.component = undefined;
23912
23923
  this.componentProps = undefined;
@@ -24030,6 +24041,7 @@ class Picker {
24030
24041
  this.willDismissShorthand = createEvent(this, "willDismiss", 7);
24031
24042
  this.didDismissShorthand = createEvent(this, "didDismiss", 7);
24032
24043
  this.delegateController = createDelegateController(this);
24044
+ this.lockController = createLockController();
24033
24045
  this.triggerController = createTriggerController();
24034
24046
  this.onBackdropTap = () => {
24035
24047
  this.dismiss(undefined, BACKDROP);
@@ -24096,24 +24108,13 @@ class Picker {
24096
24108
  * Present the picker overlay after it has been created.
24097
24109
  */
24098
24110
  async present() {
24099
- /**
24100
- * When using an inline picker
24101
- * and dismissing an picker it is possible to
24102
- * quickly present the picker while it is
24103
- * dismissing. We need to await any current
24104
- * transition to allow the dismiss to finish
24105
- * before presenting again.
24106
- */
24107
- if (this.currentTransition !== undefined) {
24108
- await this.currentTransition;
24109
- }
24111
+ const unlock = await this.lockController.lock();
24110
24112
  await this.delegateController.attachViewToDom();
24111
- this.currentTransition = present(this, 'pickerEnter', iosEnterAnimation$2, iosEnterAnimation$2, undefined);
24112
- await this.currentTransition;
24113
- this.currentTransition = undefined;
24113
+ await present(this, 'pickerEnter', iosEnterAnimation$2, iosEnterAnimation$2, undefined);
24114
24114
  if (this.duration > 0) {
24115
24115
  this.durationTimeout = setTimeout(() => this.dismiss(), this.duration);
24116
24116
  }
24117
+ unlock();
24117
24118
  }
24118
24119
  /**
24119
24120
  * Dismiss the picker overlay after it has been presented.
@@ -24125,14 +24126,15 @@ class Picker {
24125
24126
  * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
24126
24127
  */
24127
24128
  async dismiss(data, role) {
24129
+ const unlock = await this.lockController.lock();
24128
24130
  if (this.durationTimeout) {
24129
24131
  clearTimeout(this.durationTimeout);
24130
24132
  }
24131
- this.currentTransition = dismiss(this, data, role, 'pickerLeave', iosLeaveAnimation$2, iosLeaveAnimation$2);
24132
- const dismissed = await this.currentTransition;
24133
+ const dismissed = await dismiss(this, data, role, 'pickerLeave', iosLeaveAnimation$2, iosLeaveAnimation$2);
24133
24134
  if (dismissed) {
24134
24135
  this.delegateController.removeViewFromDom();
24135
24136
  }
24137
+ unlock();
24136
24138
  return dismissed;
24137
24139
  }
24138
24140
  /**
@@ -26453,6 +26455,7 @@ class Popover {
26453
26455
  this.ionMount = createEvent(this, "ionMount", 7);
26454
26456
  this.parentPopover = null;
26455
26457
  this.coreDelegate = CoreDelegate();
26458
+ this.lockController = createLockController();
26456
26459
  this.inline = false;
26457
26460
  this.focusDescendantOnPresent = false;
26458
26461
  this.onBackdropTap = () => {
@@ -26626,28 +26629,24 @@ class Popover {
26626
26629
  * was dispatched.
26627
26630
  */
26628
26631
  async present(event) {
26632
+ const unlock = await this.lockController.lock();
26629
26633
  if (this.presented) {
26634
+ unlock();
26630
26635
  return;
26631
26636
  }
26632
- /**
26633
- * When using an inline popover
26634
- * and dismissing a popover it is possible to
26635
- * quickly present the popover while it is
26636
- * dismissing. We need to await any current
26637
- * transition to allow the dismiss to finish
26638
- * before presenting again.
26639
- */
26640
- if (this.currentTransition !== undefined) {
26641
- await this.currentTransition;
26642
- }
26643
26637
  const { el } = this;
26644
26638
  const { inline, delegate } = this.getDelegate(true);
26639
+ /**
26640
+ * Emit ionMount so JS Frameworks have an opportunity
26641
+ * to add the child component to the DOM. The child
26642
+ * component will be assigned to this.usersElement below.
26643
+ */
26644
+ this.ionMount.emit();
26645
26645
  this.usersElement = await attachComponent(delegate, el, this.component, ['popover-viewport'], this.componentProps, inline);
26646
26646
  if (!this.keyboardEvents) {
26647
26647
  this.configureKeyboardInteraction();
26648
26648
  }
26649
26649
  this.configureDismissInteraction();
26650
- this.ionMount.emit();
26651
26650
  /**
26652
26651
  * When using the lazy loaded build of Stencil, we need to wait
26653
26652
  * for every Stencil component instance to be ready before presenting
@@ -26670,7 +26669,7 @@ class Popover {
26670
26669
  else if (!this.keepContentsMounted) {
26671
26670
  await waitForMount();
26672
26671
  }
26673
- this.currentTransition = present(this, 'popoverEnter', iosEnterAnimation$1, mdEnterAnimation$1, {
26672
+ await present(this, 'popoverEnter', iosEnterAnimation$1, mdEnterAnimation$1, {
26674
26673
  event: event || this.event,
26675
26674
  size: this.size,
26676
26675
  trigger: this.triggerEl,
@@ -26678,8 +26677,6 @@ class Popover {
26678
26677
  side: this.side,
26679
26678
  align: this.alignment,
26680
26679
  });
26681
- await this.currentTransition;
26682
- this.currentTransition = undefined;
26683
26680
  /**
26684
26681
  * If popover is nested and was
26685
26682
  * presented using the "Right" arrow key,
@@ -26689,6 +26686,7 @@ class Popover {
26689
26686
  if (this.focusDescendantOnPresent) {
26690
26687
  focusFirstDescendant(this.el, this.el);
26691
26688
  }
26689
+ unlock();
26692
26690
  }
26693
26691
  /**
26694
26692
  * Dismiss the popover overlay after it has been presented.
@@ -26699,23 +26697,12 @@ class Popover {
26699
26697
  * a parent popover if this popover is nested. Defaults to `true`.
26700
26698
  */
26701
26699
  async dismiss(data, role, dismissParentPopover = true) {
26702
- /**
26703
- * When using an inline popover
26704
- * and presenting a popover it is possible to
26705
- * quickly dismiss the popover while it is
26706
- * presenting. We need to await any current
26707
- * transition to allow the present to finish
26708
- * before dismissing again.
26709
- */
26710
- if (this.currentTransition !== undefined) {
26711
- await this.currentTransition;
26712
- }
26700
+ const unlock = await this.lockController.lock();
26713
26701
  const { destroyKeyboardInteraction, destroyDismissInteraction } = this;
26714
26702
  if (dismissParentPopover && this.parentPopover) {
26715
26703
  this.parentPopover.dismiss(data, role, dismissParentPopover);
26716
26704
  }
26717
- this.currentTransition = dismiss(this, data, role, 'popoverLeave', iosLeaveAnimation$1, mdLeaveAnimation$1, this.event);
26718
- const shouldDismiss = await this.currentTransition;
26705
+ const shouldDismiss = await dismiss(this, data, role, 'popoverLeave', iosLeaveAnimation$1, mdLeaveAnimation$1, this.event);
26719
26706
  if (shouldDismiss) {
26720
26707
  if (destroyKeyboardInteraction) {
26721
26708
  destroyKeyboardInteraction();
@@ -26733,7 +26720,7 @@ class Popover {
26733
26720
  const { delegate } = this.getDelegate();
26734
26721
  await detachComponent(delegate, this.usersElement);
26735
26722
  }
26736
- this.currentTransition = undefined;
26723
+ unlock();
26737
26724
  return shouldDismiss;
26738
26725
  }
26739
26726
  /**
@@ -30419,6 +30406,7 @@ class RouterOutlet {
30419
30406
  this.ionNavDidChange.emit();
30420
30407
  return true;
30421
30408
  }
30409
+ // TODO: FW-5048 - Remove this code in favor of using lock controller from utils
30422
30410
  async lock() {
30423
30411
  const p = this.waitPromise;
30424
30412
  let resolve;
@@ -33477,6 +33465,7 @@ class Toast {
33477
33465
  this.willDismissShorthand = createEvent(this, "willDismiss", 7);
33478
33466
  this.didDismissShorthand = createEvent(this, "didDismiss", 7);
33479
33467
  this.delegateController = createDelegateController(this);
33468
+ this.lockController = createLockController();
33480
33469
  this.triggerController = createTriggerController();
33481
33470
  this.customHTMLEnabled = config.get('innerHTMLTemplatesEnabled', ENABLE_HTML_CONTENT_DEFAULT);
33482
33471
  this.presented = false;
@@ -33546,30 +33535,19 @@ class Toast {
33546
33535
  * Present the toast overlay after it has been created.
33547
33536
  */
33548
33537
  async present() {
33549
- /**
33550
- * When using an inline toast
33551
- * and dismissing a toast it is possible to
33552
- * quickly present the toast while it is
33553
- * dismissing. We need to await any current
33554
- * transition to allow the dismiss to finish
33555
- * before presenting again.
33556
- */
33557
- if (this.currentTransition !== undefined) {
33558
- await this.currentTransition;
33559
- }
33538
+ const unlock = await this.lockController.lock();
33560
33539
  await this.delegateController.attachViewToDom();
33561
- this.currentTransition = present(this, 'toastEnter', iosEnterAnimation, mdEnterAnimation, this.position);
33562
- await this.currentTransition;
33540
+ await present(this, 'toastEnter', iosEnterAnimation, mdEnterAnimation, this.position);
33563
33541
  /**
33564
33542
  * Content is revealed to screen readers after
33565
33543
  * the transition to avoid jank since this
33566
33544
  * state updates will cause a re-render.
33567
33545
  */
33568
33546
  this.revealContentToScreenReader = true;
33569
- this.currentTransition = undefined;
33570
33547
  if (this.duration > 0) {
33571
33548
  this.durationTimeout = setTimeout(() => this.dismiss(undefined, 'timeout'), this.duration);
33572
33549
  }
33550
+ unlock();
33573
33551
  }
33574
33552
  /**
33575
33553
  * Dismiss the toast overlay after it has been presented.
@@ -33581,15 +33559,16 @@ class Toast {
33581
33559
  * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
33582
33560
  */
33583
33561
  async dismiss(data, role) {
33562
+ const unlock = await this.lockController.lock();
33584
33563
  if (this.durationTimeout) {
33585
33564
  clearTimeout(this.durationTimeout);
33586
33565
  }
33587
- this.currentTransition = dismiss(this, data, role, 'toastLeave', iosLeaveAnimation, mdLeaveAnimation, this.position);
33588
- const dismissed = await this.currentTransition;
33566
+ const dismissed = await dismiss(this, data, role, 'toastLeave', iosLeaveAnimation, mdLeaveAnimation, this.position);
33589
33567
  if (dismissed) {
33590
33568
  this.delegateController.removeViewFromDom();
33591
33569
  this.revealContentToScreenReader = false;
33592
33570
  }
33571
+ unlock();
33593
33572
  return dismissed;
33594
33573
  }
33595
33574
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ionic/core",
3
- "version": "7.3.3-dev.11693454416.1cb6a7ec",
3
+ "version": "7.3.3-dev.11693533652.1969cc78",
4
4
  "description": "Base components for Ionic",
5
5
  "keywords": [
6
6
  "ionic",
@@ -1,4 +0,0 @@
1
- import{__awaiter,__generator}from"tslib";
2
- /*!
3
- * (C) Ionic http://ionicframework.com - MIT License
4
- */import{c as componentOnReady}from"./helpers-3379ba19.js";var attachComponent=function(e,n,t,r,o,i){return __awaiter(void 0,void 0,void 0,(function(){var a,c;return __generator(this,(function(s){switch(s.label){case 0:if(e){return[2,e.attachViewToDom(n,t,o,r)]}if(!i&&typeof t!=="string"&&!(t instanceof HTMLElement)){throw new Error("framework delegate is missing")}c=typeof t==="string"?(a=n.ownerDocument)===null||a===void 0?void 0:a.createElement(t):t;if(r){r.forEach((function(e){return c.classList.add(e)}))}if(o){Object.assign(c,o)}n.appendChild(c);return[4,new Promise((function(e){return componentOnReady(c,e)}))];case 1:s.sent();return[2,c]}}))}))};var detachComponent=function(e,n){if(n){if(e){var t=n.parentElement;return e.removeViewFromDom(t,n)}n.remove()}return Promise.resolve()};var CoreDelegate=function(){var e;var n;var t=function(t,r,o,i){if(o===void 0){o={}}if(i===void 0){i=[]}return __awaiter(void 0,void 0,void 0,(function(){var a,c,s,d,u,l;return __generator(this,(function(m){switch(m.label){case 0:e=t;if(!r)return[3,2];s=typeof r==="string"?(a=e.ownerDocument)===null||a===void 0?void 0:a.createElement(r):r;i.forEach((function(e){return s.classList.add(e)}));Object.assign(s,o);e.appendChild(s);return[4,new Promise((function(e){return componentOnReady(s,e)}))];case 1:m.sent();return[3,3];case 2:if(e.children.length>0&&(e.tagName==="ION-MODAL"||e.tagName==="ION-POPOVER")){d=e.children[0];if(!d.classList.contains("ion-delegate-host")){u=(c=e.ownerDocument)===null||c===void 0?void 0:c.createElement("div");u.classList.add("ion-delegate-host");i.forEach((function(e){return u.classList.add(e)}));u.append.apply(u,e.children);e.appendChild(u)}}m.label=3;case 3:l=document.querySelector("ion-app")||document.body;n=document.createComment("ionic teleport");e.parentNode.insertBefore(n,e);l.appendChild(e);return[2,e]}}))}))};var r=function(){if(e&&n){n.parentNode.insertBefore(e,n);n.remove()}return Promise.resolve()};return{attachViewToDom:t,removeViewFromDom:r}};export{CoreDelegate as C,attachComponent as a,detachComponent as d};