@ionic/core 7.3.2-dev.11693262117.17edbf6d → 7.3.2-dev.11693321763.15a54694

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 (125) hide show
  1. package/components/action-sheet.js +17 -8
  2. package/components/alert.js +17 -8
  3. package/components/framework-delegate.js +21 -2
  4. package/components/ion-loading.js +17 -8
  5. package/components/ion-menu.js +1 -1
  6. package/components/ion-modal.js +34 -13
  7. package/components/ion-picker.js +17 -8
  8. package/components/ion-toast.js +17 -8
  9. package/components/overlays.js +1 -22
  10. package/components/popover.js +30 -9
  11. package/dist/cjs/{framework-delegate-e8174951.js → framework-delegate-c0873a6f.js} +21 -2
  12. package/dist/cjs/index.cjs.js +2 -2
  13. package/dist/cjs/ion-action-sheet.cjs.entry.js +18 -9
  14. package/dist/cjs/ion-alert.cjs.entry.js +18 -9
  15. package/dist/cjs/ion-app_8.cjs.entry.js +1 -1
  16. package/dist/cjs/ion-datetime_3.cjs.entry.js +18 -9
  17. package/dist/cjs/ion-loading.cjs.entry.js +18 -9
  18. package/dist/cjs/ion-menu_3.cjs.entry.js +2 -2
  19. package/dist/cjs/ion-modal.cjs.entry.js +35 -14
  20. package/dist/cjs/ion-nav_2.cjs.entry.js +1 -1
  21. package/dist/cjs/ion-popover.cjs.entry.js +31 -10
  22. package/dist/cjs/ion-select_3.cjs.entry.js +2 -2
  23. package/dist/cjs/ion-tab_2.cjs.entry.js +1 -1
  24. package/dist/cjs/ion-toast.cjs.entry.js +18 -9
  25. package/dist/cjs/{overlays-2b9fa92e.js → overlays-5c1706ed.js} +1 -23
  26. package/dist/collection/components/action-sheet/action-sheet.js +17 -8
  27. package/dist/collection/components/alert/alert.js +17 -8
  28. package/dist/collection/components/loading/loading.js +17 -8
  29. package/dist/collection/components/modal/modal.js +34 -13
  30. package/dist/collection/components/picker/picker.js +17 -8
  31. package/dist/collection/components/popover/popover.js +30 -9
  32. package/dist/collection/components/popover/test/async/popover.e2e.js +20 -0
  33. package/dist/collection/components/toast/toast.js +17 -8
  34. package/dist/collection/utils/framework-delegate.js +21 -2
  35. package/dist/collection/utils/overlays.js +0 -21
  36. package/dist/docs.json +1 -1
  37. package/dist/esm/{framework-delegate-2b76c681.js → framework-delegate-aa433dea.js} +21 -2
  38. package/dist/esm/index.js +2 -2
  39. package/dist/esm/ion-action-sheet.entry.js +18 -9
  40. package/dist/esm/ion-alert.entry.js +18 -9
  41. package/dist/esm/ion-app_8.entry.js +1 -1
  42. package/dist/esm/ion-datetime_3.entry.js +18 -9
  43. package/dist/esm/ion-loading.entry.js +18 -9
  44. package/dist/esm/ion-menu_3.entry.js +2 -2
  45. package/dist/esm/ion-modal.entry.js +35 -14
  46. package/dist/esm/ion-nav_2.entry.js +1 -1
  47. package/dist/esm/ion-popover.entry.js +31 -10
  48. package/dist/esm/ion-select_3.entry.js +2 -2
  49. package/dist/esm/ion-tab_2.entry.js +1 -1
  50. package/dist/esm/ion-toast.entry.js +18 -9
  51. package/dist/esm/{overlays-66222f79.js → overlays-e1dadfe6.js} +2 -23
  52. package/dist/esm-es5/framework-delegate-aa433dea.js +4 -0
  53. package/dist/esm-es5/index.js +1 -1
  54. package/dist/esm-es5/ion-action-sheet.entry.js +1 -1
  55. package/dist/esm-es5/ion-alert.entry.js +1 -1
  56. package/dist/esm-es5/ion-app_8.entry.js +1 -1
  57. package/dist/esm-es5/ion-datetime_3.entry.js +1 -1
  58. package/dist/esm-es5/ion-loading.entry.js +1 -1
  59. package/dist/esm-es5/ion-menu_3.entry.js +1 -1
  60. package/dist/esm-es5/ion-modal.entry.js +1 -1
  61. package/dist/esm-es5/ion-nav_2.entry.js +1 -1
  62. package/dist/esm-es5/ion-popover.entry.js +1 -1
  63. package/dist/esm-es5/ion-select_3.entry.js +1 -1
  64. package/dist/esm-es5/ion-tab_2.entry.js +1 -1
  65. package/dist/esm-es5/ion-toast.entry.js +1 -1
  66. package/dist/esm-es5/{overlays-66222f79.js → overlays-e1dadfe6.js} +1 -1
  67. package/dist/ionic/index.esm.js +1 -1
  68. package/dist/ionic/ionic.esm.js +1 -1
  69. package/dist/ionic/{p-9888a5a7.entry.js → p-091cd81e.entry.js} +1 -1
  70. package/dist/ionic/{p-d1356034.system.entry.js → p-0b68c41d.system.entry.js} +1 -1
  71. package/dist/ionic/{p-b2098e96.system.entry.js → p-28f5715a.system.entry.js} +1 -1
  72. package/dist/ionic/p-2bff71d5.system.entry.js +4 -0
  73. package/dist/ionic/p-3565c8a0.entry.js +4 -0
  74. package/dist/ionic/{p-8074bdd7.system.entry.js → p-45ee211b.system.entry.js} +1 -1
  75. package/dist/ionic/p-51669f1e.system.entry.js +4 -0
  76. package/dist/ionic/p-582dc7c1.js +4 -0
  77. package/dist/ionic/{p-7776d062.entry.js → p-5c17f888.entry.js} +1 -1
  78. package/dist/ionic/{p-8d9475b5.system.js → p-613d4042.system.js} +1 -1
  79. package/dist/ionic/p-721933ff.system.js +1 -1
  80. package/dist/ionic/p-79e3f0b6.entry.js +4 -0
  81. package/dist/ionic/p-7c9dd24d.entry.js +4 -0
  82. package/dist/ionic/p-84a95033.system.entry.js +4 -0
  83. package/dist/ionic/{p-a0ffdd91.system.js → p-8843b046.system.js} +1 -1
  84. package/dist/ionic/{p-229df0d8.entry.js → p-98ebc376.entry.js} +1 -1
  85. package/dist/ionic/p-b287ab05.js +4 -0
  86. package/dist/ionic/{p-f8e4da48.system.js → p-b32742f3.system.js} +1 -1
  87. package/dist/ionic/p-b3a58769.entry.js +4 -0
  88. package/dist/ionic/p-b54a1fcb.system.entry.js +4 -0
  89. package/dist/ionic/{p-20087c90.entry.js → p-c759a704.entry.js} +1 -1
  90. package/dist/ionic/{p-6b9bf14c.system.entry.js → p-d1d3b740.system.entry.js} +1 -1
  91. package/dist/ionic/{p-0494a5b7.system.entry.js → p-d693e765.system.entry.js} +1 -1
  92. package/dist/ionic/p-d9eb4632.system.entry.js +4 -0
  93. package/dist/ionic/p-dab7745f.system.entry.js +4 -0
  94. package/dist/ionic/p-e44233f5.entry.js +4 -0
  95. package/dist/ionic/p-f2c667c9.system.entry.js +4 -0
  96. package/dist/ionic/p-f789b7fa.entry.js +4 -0
  97. package/dist/ionic/{p-5c96dc4e.entry.js → p-f7faa32d.entry.js} +1 -1
  98. package/dist/ionic/p-f9708a54.entry.js +4 -0
  99. package/dist/types/components/action-sheet/action-sheet.d.ts +1 -1
  100. package/dist/types/components/alert/alert.d.ts +1 -1
  101. package/dist/types/components/loading/loading.d.ts +1 -1
  102. package/dist/types/components/modal/modal.d.ts +1 -1
  103. package/dist/types/components/picker/picker.d.ts +1 -1
  104. package/dist/types/components/popover/popover.d.ts +1 -1
  105. package/dist/types/components/toast/toast.d.ts +1 -1
  106. package/dist/types/utils/overlays.d.ts +0 -9
  107. package/hydrate/index.js +163 -78
  108. package/package.json +1 -1
  109. package/dist/esm-es5/framework-delegate-2b76c681.js +0 -4
  110. package/dist/ionic/p-16fd72f2.entry.js +0 -4
  111. package/dist/ionic/p-1c9e3bc7.entry.js +0 -4
  112. package/dist/ionic/p-2a51c81c.entry.js +0 -4
  113. package/dist/ionic/p-2a649b3e.system.entry.js +0 -4
  114. package/dist/ionic/p-3ef9e271.system.entry.js +0 -4
  115. package/dist/ionic/p-6d484719.system.entry.js +0 -4
  116. package/dist/ionic/p-70d137a0.js +0 -4
  117. package/dist/ionic/p-7ac9bdfa.system.entry.js +0 -4
  118. package/dist/ionic/p-8d53d5a5.entry.js +0 -4
  119. package/dist/ionic/p-a133c215.system.entry.js +0 -4
  120. package/dist/ionic/p-b34c1ae1.js +0 -4
  121. package/dist/ionic/p-c0b4ca5c.system.entry.js +0 -4
  122. package/dist/ionic/p-cf768a4f.entry.js +0 -4
  123. package/dist/ionic/p-ddffbfa9.entry.js +0 -4
  124. package/dist/ionic/p-e2e2c2b0.entry.js +0 -4
  125. package/dist/ionic/p-ebb442c4.system.entry.js +0 -4
package/hydrate/index.js CHANGED
@@ -8004,6 +8004,7 @@ const CoreDelegate = () => {
8004
8004
  const attachViewToDom = async (parentElement, userComponent, userComponentProps = {}, cssClasses = []) => {
8005
8005
  var _a, _b;
8006
8006
  BaseComponent = parentElement;
8007
+ let ChildComponent;
8007
8008
  /**
8008
8009
  * If passing in a component via the `component` props
8009
8010
  * we need to append it inside of our overlay component.
@@ -8030,6 +8031,7 @@ const CoreDelegate = () => {
8030
8031
  * inside of the overlay component.
8031
8032
  */
8032
8033
  BaseComponent.appendChild(el);
8034
+ ChildComponent = el;
8033
8035
  await new Promise((resolve) => componentOnReady(el, resolve));
8034
8036
  }
8035
8037
  else if (BaseComponent.children.length > 0 &&
@@ -8038,7 +8040,7 @@ const CoreDelegate = () => {
8038
8040
  * The delegate host wrapper el is only needed for modals and popovers
8039
8041
  * because they allow the dev to provide custom content to the overlay.
8040
8042
  */
8041
- const root = BaseComponent.children[0];
8043
+ const root = (ChildComponent = BaseComponent.children[0]);
8042
8044
  if (!root.classList.contains('ion-delegate-host')) {
8043
8045
  /**
8044
8046
  * If the root element is not a delegate host, it means
@@ -8053,6 +8055,12 @@ const CoreDelegate = () => {
8053
8055
  el.append(...BaseComponent.children);
8054
8056
  // Append the new parent element to the original parent element.
8055
8057
  BaseComponent.appendChild(el);
8058
+ /**
8059
+ * Update the ChildComponent to be the
8060
+ * newly created div in the event that one
8061
+ * does not already exist.
8062
+ */
8063
+ ChildComponent = el;
8056
8064
  }
8057
8065
  }
8058
8066
  /**
@@ -8068,7 +8076,18 @@ const CoreDelegate = () => {
8068
8076
  Reference = document.createComment('ionic teleport');
8069
8077
  BaseComponent.parentNode.insertBefore(Reference, BaseComponent);
8070
8078
  app.appendChild(BaseComponent);
8071
- return BaseComponent;
8079
+ /**
8080
+ * We return the child component rather than the overlay
8081
+ * reference itself since modal and popover will
8082
+ * use this to wait for any Ionic components in the child view
8083
+ * to be ready (i.e. componentOnReady) when using the
8084
+ * lazy loaded component bundle.
8085
+ *
8086
+ * However, we fall back to returning BaseComponent
8087
+ * in the event that a modal or popover is presented
8088
+ * with no child content.
8089
+ */
8090
+ return ChildComponent !== null && ChildComponent !== void 0 ? ChildComponent : BaseComponent;
8072
8091
  };
8073
8092
  const removeViewFromDom = () => {
8074
8093
  /**
@@ -8702,27 +8721,6 @@ const createDelegateController = (ref) => {
8702
8721
  removeViewFromDom,
8703
8722
  };
8704
8723
  };
8705
- /**
8706
- * Creates a lock controller.
8707
- *
8708
- * This function locks transitions.
8709
- * The unlock() function within it calls resolve on this function, unlocking the transitions.
8710
- */
8711
- const createLockController = () => {
8712
- let waitPromise;
8713
- const lock = async () => {
8714
- const p = waitPromise;
8715
- let resolve;
8716
- waitPromise = new Promise((r) => (resolve = r));
8717
- if (p !== undefined) {
8718
- await p;
8719
- }
8720
- return resolve;
8721
- };
8722
- return {
8723
- lock,
8724
- };
8725
- };
8726
8724
  /**
8727
8725
  * Constructs a trigger interaction for an overlay.
8728
8726
  * Presents an overlay when the trigger is clicked.
@@ -9894,7 +9892,6 @@ class ActionSheet {
9894
9892
  this.willDismissShorthand = createEvent(this, "willDismiss", 7);
9895
9893
  this.didDismissShorthand = createEvent(this, "didDismiss", 7);
9896
9894
  this.delegateController = createDelegateController(this);
9897
- this.lockController = createLockController();
9898
9895
  this.triggerController = createTriggerController();
9899
9896
  this.presented = false;
9900
9897
  this.onBackdropTap = () => {
@@ -9942,10 +9939,21 @@ class ActionSheet {
9942
9939
  * Present the action sheet overlay after it has been created.
9943
9940
  */
9944
9941
  async present() {
9945
- const unlock = await this.lockController.lock();
9942
+ /**
9943
+ * When using an inline action sheet
9944
+ * and dismissing a action sheet it is possible to
9945
+ * quickly present the action sheet while it is
9946
+ * dismissing. We need to await any current
9947
+ * transition to allow the dismiss to finish
9948
+ * before presenting again.
9949
+ */
9950
+ if (this.currentTransition !== undefined) {
9951
+ await this.currentTransition;
9952
+ }
9946
9953
  await this.delegateController.attachViewToDom();
9947
- await present(this, 'actionSheetEnter', iosEnterAnimation$6, mdEnterAnimation$5);
9948
- unlock();
9954
+ this.currentTransition = present(this, 'actionSheetEnter', iosEnterAnimation$6, mdEnterAnimation$5);
9955
+ await this.currentTransition;
9956
+ this.currentTransition = undefined;
9949
9957
  }
9950
9958
  /**
9951
9959
  * Dismiss the action sheet overlay after it has been presented.
@@ -9957,12 +9965,11 @@ class ActionSheet {
9957
9965
  * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
9958
9966
  */
9959
9967
  async dismiss(data, role) {
9960
- const unlock = await this.lockController.lock();
9961
- const dismissed = await dismiss(this, data, role, 'actionSheetLeave', iosLeaveAnimation$6, mdLeaveAnimation$5);
9968
+ this.currentTransition = dismiss(this, data, role, 'actionSheetLeave', iosLeaveAnimation$6, mdLeaveAnimation$5);
9969
+ const dismissed = await this.currentTransition;
9962
9970
  if (dismissed) {
9963
9971
  this.delegateController.removeViewFromDom();
9964
9972
  }
9965
- unlock();
9966
9973
  return dismissed;
9967
9974
  }
9968
9975
  /**
@@ -10372,7 +10379,6 @@ class Alert {
10372
10379
  this.willDismissShorthand = createEvent(this, "willDismiss", 7);
10373
10380
  this.didDismissShorthand = createEvent(this, "didDismiss", 7);
10374
10381
  this.delegateController = createDelegateController(this);
10375
- this.lockController = createLockController();
10376
10382
  this.triggerController = createTriggerController();
10377
10383
  this.customHTMLEnabled = config.get('innerHTMLTemplatesEnabled', ENABLE_HTML_CONTENT_DEFAULT);
10378
10384
  this.processedInputs = [];
@@ -10539,10 +10545,21 @@ class Alert {
10539
10545
  * Present the alert overlay after it has been created.
10540
10546
  */
10541
10547
  async present() {
10542
- const unlock = await this.lockController.lock();
10548
+ /**
10549
+ * When using an inline alert
10550
+ * and dismissing an alert it is possible to
10551
+ * quickly present the alert while it is
10552
+ * dismissing. We need to await any current
10553
+ * transition to allow the dismiss to finish
10554
+ * before presenting again.
10555
+ */
10556
+ if (this.currentTransition !== undefined) {
10557
+ await this.currentTransition;
10558
+ }
10543
10559
  await this.delegateController.attachViewToDom();
10544
- await present(this, 'alertEnter', iosEnterAnimation$5, mdEnterAnimation$4);
10545
- unlock();
10560
+ this.currentTransition = present(this, 'alertEnter', iosEnterAnimation$5, mdEnterAnimation$4);
10561
+ await this.currentTransition;
10562
+ this.currentTransition = undefined;
10546
10563
  }
10547
10564
  /**
10548
10565
  * Dismiss the alert overlay after it has been presented.
@@ -10554,12 +10571,11 @@ class Alert {
10554
10571
  * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
10555
10572
  */
10556
10573
  async dismiss(data, role) {
10557
- const unlock = await this.lockController.lock();
10558
- const dismissed = await dismiss(this, data, role, 'alertLeave', iosLeaveAnimation$5, mdLeaveAnimation$4);
10574
+ this.currentTransition = dismiss(this, data, role, 'alertLeave', iosLeaveAnimation$5, mdLeaveAnimation$4);
10575
+ const dismissed = await this.currentTransition;
10559
10576
  if (dismissed) {
10560
10577
  this.delegateController.removeViewFromDom();
10561
10578
  }
10562
- unlock();
10563
10579
  return dismissed;
10564
10580
  }
10565
10581
  /**
@@ -19797,7 +19813,6 @@ class Loading {
19797
19813
  this.willDismissShorthand = createEvent(this, "willDismiss", 7);
19798
19814
  this.didDismissShorthand = createEvent(this, "didDismiss", 7);
19799
19815
  this.delegateController = createDelegateController(this);
19800
- this.lockController = createLockController();
19801
19816
  this.triggerController = createTriggerController();
19802
19817
  this.customHTMLEnabled = config.get('innerHTMLTemplatesEnabled', ENABLE_HTML_CONTENT_DEFAULT);
19803
19818
  this.presented = false;
@@ -19863,13 +19878,24 @@ class Loading {
19863
19878
  * Present the loading overlay after it has been created.
19864
19879
  */
19865
19880
  async present() {
19866
- const unlock = await this.lockController.lock();
19881
+ /**
19882
+ * When using an inline loading indicator
19883
+ * and dismissing a loading indicator it is possible to
19884
+ * quickly present the loading indicator while it is
19885
+ * dismissing. We need to await any current
19886
+ * transition to allow the dismiss to finish
19887
+ * before presenting again.
19888
+ */
19889
+ if (this.currentTransition !== undefined) {
19890
+ await this.currentTransition;
19891
+ }
19867
19892
  await this.delegateController.attachViewToDom();
19868
- await present(this, 'loadingEnter', iosEnterAnimation$4, mdEnterAnimation$3);
19893
+ this.currentTransition = present(this, 'loadingEnter', iosEnterAnimation$4, mdEnterAnimation$3);
19894
+ await this.currentTransition;
19869
19895
  if (this.duration > 0) {
19870
19896
  this.durationTimeout = setTimeout(() => this.dismiss(), this.duration + 10);
19871
19897
  }
19872
- unlock();
19898
+ this.currentTransition = undefined;
19873
19899
  }
19874
19900
  /**
19875
19901
  * Dismiss the loading overlay after it has been presented.
@@ -19881,15 +19907,14 @@ class Loading {
19881
19907
  * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
19882
19908
  */
19883
19909
  async dismiss(data, role) {
19884
- const unlock = await this.lockController.lock();
19885
19910
  if (this.durationTimeout) {
19886
19911
  clearTimeout(this.durationTimeout);
19887
19912
  }
19888
- const dismissed = await dismiss(this, data, role, 'loadingLeave', iosLeaveAnimation$4, mdLeaveAnimation$3);
19913
+ this.currentTransition = dismiss(this, data, role, 'loadingLeave', iosLeaveAnimation$4, mdLeaveAnimation$3);
19914
+ const dismissed = await this.currentTransition;
19889
19915
  if (dismissed) {
19890
19916
  this.delegateController.removeViewFromDom();
19891
19917
  }
19892
- unlock();
19893
19918
  return dismissed;
19894
19919
  }
19895
19920
  /**
@@ -22390,7 +22415,6 @@ class Modal {
22390
22415
  this.willDismissShorthand = createEvent(this, "willDismiss", 7);
22391
22416
  this.didDismissShorthand = createEvent(this, "didDismiss", 7);
22392
22417
  this.ionMount = createEvent(this, "ionMount", 7);
22393
- this.lockController = createLockController();
22394
22418
  this.triggerController = createTriggerController();
22395
22419
  this.coreDelegate = CoreDelegate();
22396
22420
  this.isSheetModal = false;
@@ -22558,16 +22582,26 @@ class Modal {
22558
22582
  if (this.presented) {
22559
22583
  return;
22560
22584
  }
22561
- const unlock = await this.lockController.lock();
22562
22585
  const { presentingElement, el } = this;
22586
+ /**
22587
+ * When using an inline modal
22588
+ * and dismissing a modal it is possible to
22589
+ * quickly present the modal while it is
22590
+ * dismissing. We need to await any current
22591
+ * transition to allow the dismiss to finish
22592
+ * before presenting again.
22593
+ */
22594
+ if (this.currentTransition !== undefined) {
22595
+ await this.currentTransition;
22596
+ }
22563
22597
  /**
22564
22598
  * If the modal is presented multiple times (inline modals), we
22565
22599
  * need to reset the current breakpoint to the initial breakpoint.
22566
22600
  */
22567
22601
  this.currentBreakpoint = this.initialBreakpoint;
22568
22602
  const { inline, delegate } = this.getDelegate(true);
22569
- this.usersElement = await attachComponent(delegate, el, this.component, ['ion-page'], this.componentProps, inline);
22570
22603
  this.ionMount.emit();
22604
+ this.usersElement = await attachComponent(delegate, el, this.component, ['ion-page'], this.componentProps, inline);
22571
22605
  /**
22572
22606
  * When using the lazy loaded build of Stencil, we need to wait
22573
22607
  * for every Stencil component instance to be ready before presenting
@@ -22591,6 +22625,11 @@ class Modal {
22591
22625
  await waitForMount();
22592
22626
  }
22593
22627
  writeTask(() => this.el.classList.add('show-modal'));
22628
+ this.currentTransition = present(this, 'modalEnter', iosEnterAnimation$3, mdEnterAnimation$2, {
22629
+ presentingEl: presentingElement,
22630
+ currentBreakpoint: this.initialBreakpoint,
22631
+ backdropBreakpoint: this.backdropBreakpoint,
22632
+ });
22594
22633
  /* tslint:disable-next-line */
22595
22634
  if (typeof window !== 'undefined') {
22596
22635
  /**
@@ -22633,18 +22672,14 @@ class Modal {
22633
22672
  this.statusBarStyle = await StatusBar.getStyle();
22634
22673
  setCardStatusBarDark();
22635
22674
  }
22636
- await present(this, 'modalEnter', iosEnterAnimation$3, mdEnterAnimation$2, {
22637
- presentingEl: presentingElement,
22638
- currentBreakpoint: this.initialBreakpoint,
22639
- backdropBreakpoint: this.backdropBreakpoint,
22640
- });
22675
+ await this.currentTransition;
22641
22676
  if (this.isSheetModal) {
22642
22677
  this.initSheetGesture();
22643
22678
  }
22644
22679
  else if (hasCardModal) {
22645
22680
  this.initSwipeToClose();
22646
22681
  }
22647
- unlock();
22682
+ this.currentTransition = undefined;
22648
22683
  }
22649
22684
  initSwipeToClose() {
22650
22685
  var _a;
@@ -22734,7 +22769,6 @@ class Modal {
22734
22769
  if (this.gestureAnimationDismissing && role !== GESTURE) {
22735
22770
  return false;
22736
22771
  }
22737
- const unlock = await this.lockController.lock();
22738
22772
  /**
22739
22773
  * If a canDismiss handler is responsible
22740
22774
  * for calling the dismiss method, we should
@@ -22758,12 +22792,24 @@ class Modal {
22758
22792
  window.removeEventListener(KEYBOARD_DID_OPEN, this.keyboardOpenCallback);
22759
22793
  this.keyboardOpenCallback = undefined;
22760
22794
  }
22795
+ /**
22796
+ * When using an inline modal
22797
+ * and presenting a modal it is possible to
22798
+ * quickly dismiss the modal while it is
22799
+ * presenting. We need to await any current
22800
+ * transition to allow the present to finish
22801
+ * before dismissing again.
22802
+ */
22803
+ if (this.currentTransition !== undefined) {
22804
+ await this.currentTransition;
22805
+ }
22761
22806
  const enteringAnimation = activeAnimations.get(this) || [];
22762
- const dismissed = await dismiss(this, data, role, 'modalLeave', iosLeaveAnimation$3, mdLeaveAnimation$2, {
22807
+ this.currentTransition = dismiss(this, data, role, 'modalLeave', iosLeaveAnimation$3, mdLeaveAnimation$2, {
22763
22808
  presentingEl: presentingElement,
22764
22809
  currentBreakpoint: (_a = this.currentBreakpoint) !== null && _a !== void 0 ? _a : this.initialBreakpoint,
22765
22810
  backdropBreakpoint: this.backdropBreakpoint,
22766
22811
  });
22812
+ const dismissed = await this.currentTransition;
22767
22813
  if (dismissed) {
22768
22814
  const { delegate } = this.getDelegate();
22769
22815
  await detachComponent(delegate, this.usersElement);
@@ -22777,8 +22823,8 @@ class Modal {
22777
22823
  enteringAnimation.forEach((ani) => ani.destroy());
22778
22824
  }
22779
22825
  this.currentBreakpoint = undefined;
22826
+ this.currentTransition = undefined;
22780
22827
  this.animation = undefined;
22781
- unlock();
22782
22828
  return dismissed;
22783
22829
  }
22784
22830
  /**
@@ -23997,7 +24043,6 @@ class Picker {
23997
24043
  this.willDismissShorthand = createEvent(this, "willDismiss", 7);
23998
24044
  this.didDismissShorthand = createEvent(this, "didDismiss", 7);
23999
24045
  this.delegateController = createDelegateController(this);
24000
- this.lockController = createLockController();
24001
24046
  this.triggerController = createTriggerController();
24002
24047
  this.onBackdropTap = () => {
24003
24048
  this.dismiss(undefined, BACKDROP);
@@ -24064,13 +24109,24 @@ class Picker {
24064
24109
  * Present the picker overlay after it has been created.
24065
24110
  */
24066
24111
  async present() {
24067
- const unlock = await this.lockController.lock();
24112
+ /**
24113
+ * When using an inline picker
24114
+ * and dismissing an picker it is possible to
24115
+ * quickly present the picker while it is
24116
+ * dismissing. We need to await any current
24117
+ * transition to allow the dismiss to finish
24118
+ * before presenting again.
24119
+ */
24120
+ if (this.currentTransition !== undefined) {
24121
+ await this.currentTransition;
24122
+ }
24068
24123
  await this.delegateController.attachViewToDom();
24069
- await present(this, 'pickerEnter', iosEnterAnimation$2, iosEnterAnimation$2, undefined);
24124
+ this.currentTransition = present(this, 'pickerEnter', iosEnterAnimation$2, iosEnterAnimation$2, undefined);
24125
+ await this.currentTransition;
24126
+ this.currentTransition = undefined;
24070
24127
  if (this.duration > 0) {
24071
24128
  this.durationTimeout = setTimeout(() => this.dismiss(), this.duration);
24072
24129
  }
24073
- unlock();
24074
24130
  }
24075
24131
  /**
24076
24132
  * Dismiss the picker overlay after it has been presented.
@@ -24082,15 +24138,14 @@ class Picker {
24082
24138
  * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
24083
24139
  */
24084
24140
  async dismiss(data, role) {
24085
- const unlock = await this.lockController.lock();
24086
24141
  if (this.durationTimeout) {
24087
24142
  clearTimeout(this.durationTimeout);
24088
24143
  }
24089
- const dismissed = await dismiss(this, data, role, 'pickerLeave', iosLeaveAnimation$2, iosLeaveAnimation$2);
24144
+ this.currentTransition = dismiss(this, data, role, 'pickerLeave', iosLeaveAnimation$2, iosLeaveAnimation$2);
24145
+ const dismissed = await this.currentTransition;
24090
24146
  if (dismissed) {
24091
24147
  this.delegateController.removeViewFromDom();
24092
24148
  }
24093
- unlock();
24094
24149
  return dismissed;
24095
24150
  }
24096
24151
  /**
@@ -26411,7 +26466,6 @@ class Popover {
26411
26466
  this.ionMount = createEvent(this, "ionMount", 7);
26412
26467
  this.parentPopover = null;
26413
26468
  this.coreDelegate = CoreDelegate();
26414
- this.lockController = createLockController();
26415
26469
  this.inline = false;
26416
26470
  this.focusDescendantOnPresent = false;
26417
26471
  this.onBackdropTap = () => {
@@ -26588,15 +26642,25 @@ class Popover {
26588
26642
  if (this.presented) {
26589
26643
  return;
26590
26644
  }
26591
- const unlock = await this.lockController.lock();
26645
+ /**
26646
+ * When using an inline popover
26647
+ * and dismissing a popover it is possible to
26648
+ * quickly present the popover while it is
26649
+ * dismissing. We need to await any current
26650
+ * transition to allow the dismiss to finish
26651
+ * before presenting again.
26652
+ */
26653
+ if (this.currentTransition !== undefined) {
26654
+ await this.currentTransition;
26655
+ }
26592
26656
  const { el } = this;
26593
26657
  const { inline, delegate } = this.getDelegate(true);
26658
+ this.ionMount.emit();
26594
26659
  this.usersElement = await attachComponent(delegate, el, this.component, ['popover-viewport'], this.componentProps, inline);
26595
26660
  if (!this.keyboardEvents) {
26596
26661
  this.configureKeyboardInteraction();
26597
26662
  }
26598
26663
  this.configureDismissInteraction();
26599
- this.ionMount.emit();
26600
26664
  /**
26601
26665
  * When using the lazy loaded build of Stencil, we need to wait
26602
26666
  * for every Stencil component instance to be ready before presenting
@@ -26619,7 +26683,7 @@ class Popover {
26619
26683
  else if (!this.keepContentsMounted) {
26620
26684
  await waitForMount();
26621
26685
  }
26622
- await present(this, 'popoverEnter', iosEnterAnimation$1, mdEnterAnimation$1, {
26686
+ this.currentTransition = present(this, 'popoverEnter', iosEnterAnimation$1, mdEnterAnimation$1, {
26623
26687
  event: event || this.event,
26624
26688
  size: this.size,
26625
26689
  trigger: this.triggerEl,
@@ -26627,6 +26691,8 @@ class Popover {
26627
26691
  side: this.side,
26628
26692
  align: this.alignment,
26629
26693
  });
26694
+ await this.currentTransition;
26695
+ this.currentTransition = undefined;
26630
26696
  /**
26631
26697
  * If popover is nested and was
26632
26698
  * presented using the "Right" arrow key,
@@ -26636,7 +26702,6 @@ class Popover {
26636
26702
  if (this.focusDescendantOnPresent) {
26637
26703
  focusFirstDescendant(this.el, this.el);
26638
26704
  }
26639
- unlock();
26640
26705
  }
26641
26706
  /**
26642
26707
  * Dismiss the popover overlay after it has been presented.
@@ -26647,12 +26712,23 @@ class Popover {
26647
26712
  * a parent popover if this popover is nested. Defaults to `true`.
26648
26713
  */
26649
26714
  async dismiss(data, role, dismissParentPopover = true) {
26650
- const unlock = await this.lockController.lock();
26715
+ /**
26716
+ * When using an inline popover
26717
+ * and presenting a popover it is possible to
26718
+ * quickly dismiss the popover while it is
26719
+ * presenting. We need to await any current
26720
+ * transition to allow the present to finish
26721
+ * before dismissing again.
26722
+ */
26723
+ if (this.currentTransition !== undefined) {
26724
+ await this.currentTransition;
26725
+ }
26651
26726
  const { destroyKeyboardInteraction, destroyDismissInteraction } = this;
26652
26727
  if (dismissParentPopover && this.parentPopover) {
26653
26728
  this.parentPopover.dismiss(data, role, dismissParentPopover);
26654
26729
  }
26655
- const shouldDismiss = await dismiss(this, data, role, 'popoverLeave', iosLeaveAnimation$1, mdLeaveAnimation$1, this.event);
26730
+ this.currentTransition = dismiss(this, data, role, 'popoverLeave', iosLeaveAnimation$1, mdLeaveAnimation$1, this.event);
26731
+ const shouldDismiss = await this.currentTransition;
26656
26732
  if (shouldDismiss) {
26657
26733
  if (destroyKeyboardInteraction) {
26658
26734
  destroyKeyboardInteraction();
@@ -26670,7 +26746,7 @@ class Popover {
26670
26746
  const { delegate } = this.getDelegate();
26671
26747
  await detachComponent(delegate, this.usersElement);
26672
26748
  }
26673
- unlock();
26749
+ this.currentTransition = undefined;
26674
26750
  return shouldDismiss;
26675
26751
  }
26676
26752
  /**
@@ -33414,7 +33490,6 @@ class Toast {
33414
33490
  this.willDismissShorthand = createEvent(this, "willDismiss", 7);
33415
33491
  this.didDismissShorthand = createEvent(this, "didDismiss", 7);
33416
33492
  this.delegateController = createDelegateController(this);
33417
- this.lockController = createLockController();
33418
33493
  this.triggerController = createTriggerController();
33419
33494
  this.customHTMLEnabled = config.get('innerHTMLTemplatesEnabled', ENABLE_HTML_CONTENT_DEFAULT);
33420
33495
  this.presented = false;
@@ -33484,19 +33559,30 @@ class Toast {
33484
33559
  * Present the toast overlay after it has been created.
33485
33560
  */
33486
33561
  async present() {
33487
- const unlock = await this.lockController.lock();
33562
+ /**
33563
+ * When using an inline toast
33564
+ * and dismissing a toast it is possible to
33565
+ * quickly present the toast while it is
33566
+ * dismissing. We need to await any current
33567
+ * transition to allow the dismiss to finish
33568
+ * before presenting again.
33569
+ */
33570
+ if (this.currentTransition !== undefined) {
33571
+ await this.currentTransition;
33572
+ }
33488
33573
  await this.delegateController.attachViewToDom();
33489
- await present(this, 'toastEnter', iosEnterAnimation, mdEnterAnimation, this.position);
33574
+ this.currentTransition = present(this, 'toastEnter', iosEnterAnimation, mdEnterAnimation, this.position);
33575
+ await this.currentTransition;
33490
33576
  /**
33491
33577
  * Content is revealed to screen readers after
33492
33578
  * the transition to avoid jank since this
33493
33579
  * state updates will cause a re-render.
33494
33580
  */
33495
33581
  this.revealContentToScreenReader = true;
33582
+ this.currentTransition = undefined;
33496
33583
  if (this.duration > 0) {
33497
33584
  this.durationTimeout = setTimeout(() => this.dismiss(undefined, 'timeout'), this.duration);
33498
33585
  }
33499
- unlock();
33500
33586
  }
33501
33587
  /**
33502
33588
  * Dismiss the toast overlay after it has been presented.
@@ -33508,16 +33594,15 @@ class Toast {
33508
33594
  * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
33509
33595
  */
33510
33596
  async dismiss(data, role) {
33511
- const unlock = await this.lockController.lock();
33512
33597
  if (this.durationTimeout) {
33513
33598
  clearTimeout(this.durationTimeout);
33514
33599
  }
33515
- const dismissed = await dismiss(this, data, role, 'toastLeave', iosLeaveAnimation, mdLeaveAnimation, this.position);
33600
+ this.currentTransition = dismiss(this, data, role, 'toastLeave', iosLeaveAnimation, mdLeaveAnimation, this.position);
33601
+ const dismissed = await this.currentTransition;
33516
33602
  if (dismissed) {
33517
33603
  this.delegateController.removeViewFromDom();
33518
33604
  this.revealContentToScreenReader = false;
33519
33605
  }
33520
- unlock();
33521
33606
  return dismissed;
33522
33607
  }
33523
33608
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ionic/core",
3
- "version": "7.3.2-dev.11693262117.17edbf6d",
3
+ "version": "7.3.2-dev.11693321763.15a54694",
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};