@ionic/core 7.4.3-dev.11696260184.1e4ad047 → 7.4.3-dev.11696273737.1ba31223

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 (108) hide show
  1. package/components/animation.js +1 -60
  2. package/components/index4.js +0 -11
  3. package/components/ion-menu.js +19 -63
  4. package/dist/cjs/{animation-c8bdd3c7.js → animation-2bb33618.js} +1 -60
  5. package/dist/cjs/{index-c388851f.js → index-b183138a.js} +2 -2
  6. package/dist/cjs/{index-e50a18ba.js → index-d90b29dd.js} +1 -12
  7. package/dist/cjs/index.cjs.js +5 -5
  8. package/dist/cjs/ion-action-sheet.cjs.entry.js +1 -1
  9. package/dist/cjs/ion-alert.cjs.entry.js +1 -1
  10. package/dist/cjs/ion-app_8.cjs.entry.js +1 -1
  11. package/dist/cjs/ion-datetime_3.cjs.entry.js +1 -1
  12. package/dist/cjs/ion-loading.cjs.entry.js +1 -1
  13. package/dist/cjs/ion-menu_3.cjs.entry.js +24 -67
  14. package/dist/cjs/ion-modal.cjs.entry.js +2 -2
  15. package/dist/cjs/ion-nav_2.cjs.entry.js +1 -1
  16. package/dist/cjs/ion-popover.cjs.entry.js +2 -2
  17. package/dist/cjs/ion-refresher_2.cjs.entry.js +1 -1
  18. package/dist/cjs/ion-toast.cjs.entry.js +1 -1
  19. package/dist/cjs/{ios.transition-fd592869.js → ios.transition-4b93903d.js} +2 -2
  20. package/dist/cjs/{md.transition-a6040d41.js → md.transition-79f3a215.js} +2 -2
  21. package/dist/collection/components/menu/menu.js +19 -63
  22. package/dist/collection/components/menu/test/multiple/menu.e2e.js +36 -0
  23. package/dist/collection/utils/animation/animation.js +1 -60
  24. package/dist/collection/utils/menu-controller/index.js +0 -11
  25. package/dist/docs.json +1 -1
  26. package/dist/esm/{animation-92066c62.js → animation-a1d9e088.js} +1 -60
  27. package/dist/esm/{index-9b1940b1.js → index-39b3eab6.js} +1 -12
  28. package/dist/esm/{index-ca26aea8.js → index-87684bba.js} +2 -2
  29. package/dist/esm/index.js +5 -5
  30. package/dist/esm/ion-action-sheet.entry.js +1 -1
  31. package/dist/esm/ion-alert.entry.js +1 -1
  32. package/dist/esm/ion-app_8.entry.js +1 -1
  33. package/dist/esm/ion-datetime_3.entry.js +1 -1
  34. package/dist/esm/ion-loading.entry.js +1 -1
  35. package/dist/esm/ion-menu_3.entry.js +22 -65
  36. package/dist/esm/ion-modal.entry.js +2 -2
  37. package/dist/esm/ion-nav_2.entry.js +1 -1
  38. package/dist/esm/ion-popover.entry.js +2 -2
  39. package/dist/esm/ion-refresher_2.entry.js +1 -1
  40. package/dist/esm/ion-toast.entry.js +1 -1
  41. package/dist/esm/{ios.transition-d4be3bd5.js → ios.transition-81e1aed6.js} +2 -2
  42. package/dist/esm/{md.transition-ae47f354.js → md.transition-5becd8b5.js} +2 -2
  43. package/dist/esm-es5/animation-a1d9e088.js +4 -0
  44. package/dist/esm-es5/{index-9b1940b1.js → index-39b3eab6.js} +1 -1
  45. package/dist/esm-es5/{index-ca26aea8.js → index-87684bba.js} +1 -1
  46. package/dist/esm-es5/index.js +1 -1
  47. package/dist/esm-es5/ion-action-sheet.entry.js +1 -1
  48. package/dist/esm-es5/ion-alert.entry.js +1 -1
  49. package/dist/esm-es5/ion-app_8.entry.js +1 -1
  50. package/dist/esm-es5/ion-datetime_3.entry.js +1 -1
  51. package/dist/esm-es5/ion-loading.entry.js +1 -1
  52. package/dist/esm-es5/ion-menu_3.entry.js +1 -1
  53. package/dist/esm-es5/ion-modal.entry.js +1 -1
  54. package/dist/esm-es5/ion-nav_2.entry.js +1 -1
  55. package/dist/esm-es5/ion-popover.entry.js +1 -1
  56. package/dist/esm-es5/ion-refresher_2.entry.js +1 -1
  57. package/dist/esm-es5/ion-toast.entry.js +1 -1
  58. package/dist/esm-es5/{ios.transition-d4be3bd5.js → ios.transition-81e1aed6.js} +1 -1
  59. package/dist/esm-es5/{md.transition-ae47f354.js → md.transition-5becd8b5.js} +1 -1
  60. package/dist/ionic/index.esm.js +1 -1
  61. package/dist/ionic/ionic.esm.js +1 -1
  62. package/dist/ionic/{p-17f69cbc.system.entry.js → p-048d7153.system.entry.js} +1 -1
  63. package/dist/ionic/{p-eac9308b.system.entry.js → p-08c5b9f4.system.entry.js} +1 -1
  64. package/dist/ionic/p-13a7b105.entry.js +4 -0
  65. package/dist/ionic/{p-9f758520.entry.js → p-13a91505.entry.js} +1 -1
  66. package/dist/ionic/{p-4d2c9270.system.entry.js → p-1a36bf45.system.entry.js} +1 -1
  67. package/dist/ionic/{p-2a13187a.system.js → p-233cafdf.system.js} +1 -1
  68. package/dist/ionic/{p-b0c3f506.entry.js → p-27614d55.entry.js} +1 -1
  69. package/dist/ionic/{p-2624b777.system.entry.js → p-37456282.system.entry.js} +1 -1
  70. package/dist/ionic/{p-c6221536.system.js → p-43252033.system.js} +1 -1
  71. package/dist/ionic/{p-0505bc05.system.entry.js → p-4616f20a.system.entry.js} +1 -1
  72. package/dist/ionic/{p-f70372cf.js → p-5e2dc8e0.js} +1 -1
  73. package/dist/ionic/{p-9eea70fb.system.entry.js → p-65a4c12f.system.entry.js} +1 -1
  74. package/dist/ionic/p-6b2641f6.system.js +4 -0
  75. package/dist/ionic/{p-dcdc16e8.system.entry.js → p-6bc9c436.system.entry.js} +1 -1
  76. package/dist/ionic/p-6edbc09b.system.js +1 -1
  77. package/dist/ionic/p-72a1cbc7.js +4 -0
  78. package/dist/ionic/{p-f2bc4fc0.system.js → p-73f50e29.system.js} +1 -1
  79. package/dist/ionic/p-78a293a5.js +4 -0
  80. package/dist/ionic/{p-5c9f38bf.entry.js → p-7e46b6ab.entry.js} +1 -1
  81. package/dist/ionic/p-7e994a60.js +4 -0
  82. package/dist/ionic/{p-0fb0904b.system.js → p-8fdd4a2f.system.js} +1 -1
  83. package/dist/ionic/{p-24ebc805.entry.js → p-90d892fd.entry.js} +1 -1
  84. package/dist/ionic/{p-51163f34.system.js → p-918d5f19.system.js} +1 -1
  85. package/dist/ionic/p-94a4ce40.js +4 -0
  86. package/dist/ionic/{p-06a68207.system.entry.js → p-a6d8476b.system.entry.js} +1 -1
  87. package/dist/ionic/{p-003dbb0e.entry.js → p-a720dc73.entry.js} +1 -1
  88. package/dist/ionic/{p-d4f02009.entry.js → p-bf9b1560.entry.js} +1 -1
  89. package/dist/ionic/{p-26a785e9.system.entry.js → p-c5729044.system.entry.js} +1 -1
  90. package/dist/ionic/{p-d6e93d49.entry.js → p-c7fca267.entry.js} +1 -1
  91. package/dist/ionic/{p-40ffdeb5.system.entry.js → p-de676d36.system.entry.js} +1 -1
  92. package/dist/ionic/{p-a42bbc51.entry.js → p-ee6d9730.entry.js} +1 -1
  93. package/dist/ionic/{p-b1a04d35.entry.js → p-f547e62f.entry.js} +1 -1
  94. package/dist/ionic/p-f7d61a1c.system.entry.js +4 -0
  95. package/dist/ionic/{p-4df178d7.entry.js → p-f920f5ca.entry.js} +1 -1
  96. package/dist/types/components/menu/menu-interface.d.ts +0 -1
  97. package/dist/types/components/menu/menu.d.ts +1 -8
  98. package/dist/types/utils/menu-controller/index.d.ts +0 -1
  99. package/hydrate/index.js +20 -133
  100. package/package.json +1 -1
  101. package/dist/esm-es5/animation-92066c62.js +0 -4
  102. package/dist/ionic/p-015187e5.system.js +0 -4
  103. package/dist/ionic/p-0a39673e.js +0 -4
  104. package/dist/ionic/p-12b13ed4.entry.js +0 -4
  105. package/dist/ionic/p-1a6c0442.js +0 -4
  106. package/dist/ionic/p-37a0b769.js +0 -4
  107. package/dist/ionic/p-446230d7.js +0 -4
  108. package/dist/ionic/p-bff7659e.system.entry.js +0 -4
@@ -159,7 +159,6 @@ const createAnimation = (animationId) => {
159
159
  const id = animationId;
160
160
  const onFinishCallbacks = [];
161
161
  const onFinishOneTimeCallbacks = [];
162
- const onStopOneTimeCallbacks = [];
163
162
  const elements = [];
164
163
  const childAnimations = [];
165
164
  const stylesheets = [];
@@ -217,28 +216,6 @@ const createAnimation = (animationId) => {
217
216
  const isRunning = () => {
218
217
  return numAnimationsRunning !== 0 && !paused;
219
218
  };
220
- /**
221
- * @internal
222
- * Remove a callback from a chosen callback array
223
- * @param callbackToRemove: A reference to the callback that should be removed
224
- * @param callbackObjects: An array of callbacks that callbackToRemove should be removed from.
225
- */
226
- const clearCallback = (callbackToRemove, callbackObjects) => {
227
- const index = callbackObjects.findIndex((callbackObject) => callbackObject.c === callbackToRemove);
228
- if (index > -1) {
229
- callbackObjects.splice(index, 1);
230
- }
231
- };
232
- /**
233
- * @internal
234
- * Add a callback to be fired when an animation is stopped/cancelled.
235
- * @param callback: A reference to the callback that should be fired
236
- * @param opts: Any options associated with this particular callback
237
- */
238
- const onStop = (callback, opts) => {
239
- onStopOneTimeCallbacks.push({ c: callback, o: opts });
240
- return ani;
241
- };
242
219
  const onFinish = (callback, opts) => {
243
220
  const callbacks = (opts === null || opts === void 0 ? void 0 : opts.oneTimeCallback) ? onFinishOneTimeCallbacks : onFinishCallbacks;
244
221
  callbacks.push({ c: callback, o: opts });
@@ -907,33 +884,7 @@ const createAnimation = (animationId) => {
907
884
  numAnimationsRunning = childAnimations.length + 1;
908
885
  shouldCalculateNumAnimations = false;
909
886
  }
910
- /**
911
- * When one of these callbacks fires we
912
- * need to clear the other's callback otherwise
913
- * you can potentially get these callbacks
914
- * firing multiple times if the play method
915
- * is subsequently called.
916
- * Example:
917
- * animation.play() (onStop and onFinish callbacks are registered)
918
- * animation.stop() (onStop callback is fired, onFinish is not)
919
- * animation.play() (onStop and onFinish callbacks are registered)
920
- * Total onStop callbacks: 1
921
- * Total onFinish callbacks: 2
922
- */
923
- const onStopCallback = () => {
924
- clearCallback(onFinishCallback, onFinishOneTimeCallbacks);
925
- resolve();
926
- };
927
- const onFinishCallback = () => {
928
- clearCallback(onStopCallback, onStopOneTimeCallbacks);
929
- resolve();
930
- };
931
- /**
932
- * The play method resolves when an animation
933
- * run either finishes or is cancelled.
934
- */
935
- onFinish(onFinishCallback, { oneTimeCallback: true });
936
- onStop(onStopCallback, { oneTimeCallback: true });
887
+ onFinish(() => resolve(), { oneTimeCallback: true });
937
888
  childAnimations.forEach((animation) => {
938
889
  animation.play();
939
890
  });
@@ -946,14 +897,6 @@ const createAnimation = (animationId) => {
946
897
  paused = false;
947
898
  });
948
899
  };
949
- /**
950
- * Stops an animation and resets it state to the
951
- * beginning. This does not fire any onFinish
952
- * callbacks because the animation did not finish.
953
- * However, since the animation was not destroyed
954
- * (i.e. the animation could run again) we do not
955
- * clear the onFinish callbacks.
956
- */
957
900
  const stop = () => {
958
901
  childAnimations.forEach((animation) => {
959
902
  animation.stop();
@@ -963,8 +906,6 @@ const createAnimation = (animationId) => {
963
906
  initialized = false;
964
907
  }
965
908
  resetFlags();
966
- onStopOneTimeCallbacks.forEach((onStopCallback) => onStopCallback.c(0, ani));
967
- onStopOneTimeCallbacks.length = 0;
968
909
  };
969
910
  const from = (property, value) => {
970
911
  const firstFrame = _keyframes[0];
@@ -203,9 +203,6 @@ const createMenuController = () => {
203
203
  };
204
204
  const _register = (menu) => {
205
205
  if (menus.indexOf(menu) < 0) {
206
- if (!menu.disabled) {
207
- _setActiveMenu(menu);
208
- }
209
206
  menus.push(menu);
210
207
  }
211
208
  };
@@ -215,13 +212,6 @@ const createMenuController = () => {
215
212
  menus.splice(index, 1);
216
213
  }
217
214
  };
218
- const _setActiveMenu = (menu) => {
219
- // if this menu should be enabled
220
- // then find all the other menus on this same side
221
- // and automatically disable other same side menus
222
- const side = menu.side;
223
- menus.filter((m) => m.side === side && m !== menu).forEach((m) => (m.disabled = true));
224
- };
225
215
  const _setOpen = async (menu, shouldOpen, animated) => {
226
216
  if (isAnimatingSync()) {
227
217
  return false;
@@ -293,7 +283,6 @@ const createMenuController = () => {
293
283
  _register,
294
284
  _unregister,
295
285
  _setOpen,
296
- _setActiveMenu,
297
286
  };
298
287
  };
299
288
  const menuController = /*@__PURE__*/ createMenuController();
@@ -3,7 +3,6 @@
3
3
  */
4
4
  import { proxyCustomElement, HTMLElement, createEvent, Build, h, Host } from '@stencil/core/internal/client';
5
5
  import { g as getTimeGivenProgression } from './cubic-bezier.js';
6
- import { d as doc } from './index5.js';
7
6
  import { G as GESTURE_CONTROLLER } from './gesture-controller.js';
8
7
  import { o as isEndSide, i as inheritAriaAttributes, p as assert, m as clamp } from './helpers.js';
9
8
  import { m as menuController } from './index4.js';
@@ -33,14 +32,6 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
33
32
  this.lastOnEnd = 0;
34
33
  this.blocker = GESTURE_CONTROLLER.createBlocker({ disableScroll: true });
35
34
  this.didLoad = false;
36
- /**
37
- * Flag used to determine if an open/close
38
- * operation was cancelled. For example, if
39
- * an app calls "menu.open" then disables the menu
40
- * part way through the animation, then this would
41
- * be considered a cancelled operation.
42
- */
43
- this.operationCancelled = false;
44
35
  this.isAnimating = false;
45
36
  this._isOpen = false;
46
37
  this.inheritedAttributes = {};
@@ -309,15 +300,6 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
309
300
  this.beforeAnimation(shouldOpen);
310
301
  await this.loadAnimation();
311
302
  await this.startAnimation(shouldOpen, animated);
312
- /**
313
- * If the animation was cancelled then
314
- * return false because the operation
315
- * did not succeed.
316
- */
317
- if (this.operationCancelled) {
318
- this.operationCancelled = false;
319
- return false;
320
- }
321
303
  this.afterAnimation(shouldOpen);
322
304
  return true;
323
305
  }
@@ -354,23 +336,18 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
354
336
  const easingReverse = mode === 'ios' ? iosEasingReverse : mdEasingReverse;
355
337
  const ani = this.animation
356
338
  .direction(isReversed ? 'reverse' : 'normal')
357
- .easing(isReversed ? easingReverse : easing);
339
+ .easing(isReversed ? easingReverse : easing)
340
+ .onFinish(() => {
341
+ if (ani.getDirection() === 'reverse') {
342
+ ani.direction('normal');
343
+ }
344
+ });
358
345
  if (animated) {
359
346
  await ani.play();
360
347
  }
361
348
  else {
362
349
  ani.play({ sync: true });
363
350
  }
364
- /**
365
- * We run this after the play invocation
366
- * instead of using ani.onFinish so that
367
- * multiple onFinish callbacks do not get
368
- * run if an animation is played, stopped,
369
- * and then played again.
370
- */
371
- if (ani.getDirection() === 'reverse') {
372
- ani.direction('normal');
373
- }
374
351
  }
375
352
  _isActive() {
376
353
  return !this.disabled && !this.isPaneVisible;
@@ -507,6 +484,7 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
507
484
  }
508
485
  afterAnimation(isOpen) {
509
486
  var _a;
487
+ assert(this.isAnimating, '_before() should be called while animating');
510
488
  // keep opening/closing the menu disabled for a touch more yet
511
489
  // only add listeners/css if it's enabled and isOpen
512
490
  // and only remove listeners/css if it's not open
@@ -565,41 +543,19 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
565
543
  if (this.gesture) {
566
544
  this.gesture.enable(isActive && this.swipeGesture);
567
545
  }
568
- /**
569
- * If the menu is disabled but it is still open
570
- * then we should close the menu immediately.
571
- * Additionally, if the menu is in the process
572
- * of animating {open, close} and the menu is disabled
573
- * then it should still be closed immediately.
574
- */
575
- if (!isActive) {
576
- /**
577
- * It is possible to disable the menu while
578
- * it is mid-animation. When this happens, we
579
- * need to set the operationCancelled flag
580
- * so that this._setOpen knows to return false
581
- * and not run the "afterAnimation" callback.
582
- */
583
- if (this.isAnimating) {
584
- this.operationCancelled = true;
585
- }
586
- /**
587
- * If the menu is disabled then we should
588
- * forcibly close the menu even if it is open.
589
- */
590
- this.afterAnimation(false);
591
- }
592
- if (doc === null || doc === void 0 ? void 0 : doc.contains(this.el)) {
593
- /**
594
- * Only set the active menu if the menu element is
595
- * present in the DOM. Otherwise if it was destructively
596
- * re-hydrated (through Angular Universal), then ignore
597
- * setting the removed node as the active menu.
598
- */
599
- if (!this.disabled) {
600
- menuController._setActiveMenu(this);
601
- }
546
+ // Close menu immediately
547
+ if (!isActive && this._isOpen) {
548
+ // close if this menu is open, and should not be enabled
549
+ this.forceClosing();
602
550
  }
551
+ assert(!this.isAnimating, 'can not be animating');
552
+ }
553
+ forceClosing() {
554
+ assert(this._isOpen, 'menu cannot be closed');
555
+ this.isAnimating = true;
556
+ const ani = this.animation.direction('reverse');
557
+ ani.play({ sync: true });
558
+ this.afterAnimation(false);
603
559
  }
604
560
  render() {
605
561
  const { type, disabled, isPaneVisible, inheritedAttributes, side } = this;
@@ -161,7 +161,6 @@ const createAnimation = (animationId) => {
161
161
  const id = animationId;
162
162
  const onFinishCallbacks = [];
163
163
  const onFinishOneTimeCallbacks = [];
164
- const onStopOneTimeCallbacks = [];
165
164
  const elements = [];
166
165
  const childAnimations = [];
167
166
  const stylesheets = [];
@@ -219,28 +218,6 @@ const createAnimation = (animationId) => {
219
218
  const isRunning = () => {
220
219
  return numAnimationsRunning !== 0 && !paused;
221
220
  };
222
- /**
223
- * @internal
224
- * Remove a callback from a chosen callback array
225
- * @param callbackToRemove: A reference to the callback that should be removed
226
- * @param callbackObjects: An array of callbacks that callbackToRemove should be removed from.
227
- */
228
- const clearCallback = (callbackToRemove, callbackObjects) => {
229
- const index = callbackObjects.findIndex((callbackObject) => callbackObject.c === callbackToRemove);
230
- if (index > -1) {
231
- callbackObjects.splice(index, 1);
232
- }
233
- };
234
- /**
235
- * @internal
236
- * Add a callback to be fired when an animation is stopped/cancelled.
237
- * @param callback: A reference to the callback that should be fired
238
- * @param opts: Any options associated with this particular callback
239
- */
240
- const onStop = (callback, opts) => {
241
- onStopOneTimeCallbacks.push({ c: callback, o: opts });
242
- return ani;
243
- };
244
221
  const onFinish = (callback, opts) => {
245
222
  const callbacks = (opts === null || opts === void 0 ? void 0 : opts.oneTimeCallback) ? onFinishOneTimeCallbacks : onFinishCallbacks;
246
223
  callbacks.push({ c: callback, o: opts });
@@ -909,33 +886,7 @@ const createAnimation = (animationId) => {
909
886
  numAnimationsRunning = childAnimations.length + 1;
910
887
  shouldCalculateNumAnimations = false;
911
888
  }
912
- /**
913
- * When one of these callbacks fires we
914
- * need to clear the other's callback otherwise
915
- * you can potentially get these callbacks
916
- * firing multiple times if the play method
917
- * is subsequently called.
918
- * Example:
919
- * animation.play() (onStop and onFinish callbacks are registered)
920
- * animation.stop() (onStop callback is fired, onFinish is not)
921
- * animation.play() (onStop and onFinish callbacks are registered)
922
- * Total onStop callbacks: 1
923
- * Total onFinish callbacks: 2
924
- */
925
- const onStopCallback = () => {
926
- clearCallback(onFinishCallback, onFinishOneTimeCallbacks);
927
- resolve();
928
- };
929
- const onFinishCallback = () => {
930
- clearCallback(onStopCallback, onStopOneTimeCallbacks);
931
- resolve();
932
- };
933
- /**
934
- * The play method resolves when an animation
935
- * run either finishes or is cancelled.
936
- */
937
- onFinish(onFinishCallback, { oneTimeCallback: true });
938
- onStop(onStopCallback, { oneTimeCallback: true });
889
+ onFinish(() => resolve(), { oneTimeCallback: true });
939
890
  childAnimations.forEach((animation) => {
940
891
  animation.play();
941
892
  });
@@ -948,14 +899,6 @@ const createAnimation = (animationId) => {
948
899
  paused = false;
949
900
  });
950
901
  };
951
- /**
952
- * Stops an animation and resets it state to the
953
- * beginning. This does not fire any onFinish
954
- * callbacks because the animation did not finish.
955
- * However, since the animation was not destroyed
956
- * (i.e. the animation could run again) we do not
957
- * clear the onFinish callbacks.
958
- */
959
902
  const stop = () => {
960
903
  childAnimations.forEach((animation) => {
961
904
  animation.stop();
@@ -965,8 +908,6 @@ const createAnimation = (animationId) => {
965
908
  initialized = false;
966
909
  }
967
910
  resetFlags();
968
- onStopOneTimeCallbacks.forEach((onStopCallback) => onStopCallback.c(0, ani));
969
- onStopOneTimeCallbacks.length = 0;
970
911
  };
971
912
  const from = (property, value) => {
972
913
  const firstFrame = _keyframes[0];
@@ -12,8 +12,8 @@ const LIFECYCLE_WILL_LEAVE = 'ionViewWillLeave';
12
12
  const LIFECYCLE_DID_LEAVE = 'ionViewDidLeave';
13
13
  const LIFECYCLE_WILL_UNLOAD = 'ionViewWillUnload';
14
14
 
15
- const iosTransitionAnimation = () => Promise.resolve().then(function () { return require('./ios.transition-fd592869.js'); });
16
- const mdTransitionAnimation = () => Promise.resolve().then(function () { return require('./md.transition-a6040d41.js'); });
15
+ const iosTransitionAnimation = () => Promise.resolve().then(function () { return require('./ios.transition-4b93903d.js'); });
16
+ const mdTransitionAnimation = () => Promise.resolve().then(function () { return require('./md.transition-79f3a215.js'); });
17
17
  // TODO(FW-2832): types
18
18
  const transition = (opts) => {
19
19
  return new Promise((resolve, reject) => {
@@ -6,7 +6,7 @@
6
6
  const hardwareBackButton = require('./hardware-back-button-b67c8e75.js');
7
7
  const helpers = require('./helpers-ea4ccbcb.js');
8
8
  const ionicGlobal = require('./ionic-global-14a0604b.js');
9
- const animation = require('./animation-c8bdd3c7.js');
9
+ const animation = require('./animation-2bb33618.js');
10
10
 
11
11
  /**
12
12
  * baseAnimation
@@ -205,9 +205,6 @@ const createMenuController = () => {
205
205
  };
206
206
  const _register = (menu) => {
207
207
  if (menus.indexOf(menu) < 0) {
208
- if (!menu.disabled) {
209
- _setActiveMenu(menu);
210
- }
211
208
  menus.push(menu);
212
209
  }
213
210
  };
@@ -217,13 +214,6 @@ const createMenuController = () => {
217
214
  menus.splice(index, 1);
218
215
  }
219
216
  };
220
- const _setActiveMenu = (menu) => {
221
- // if this menu should be enabled
222
- // then find all the other menus on this same side
223
- // and automatically disable other same side menus
224
- const side = menu.side;
225
- menus.filter((m) => m.side === side && m !== menu).forEach((m) => (m.disabled = true));
226
- };
227
217
  const _setOpen = async (menu, shouldOpen, animated) => {
228
218
  if (isAnimatingSync()) {
229
219
  return false;
@@ -295,7 +285,6 @@ const createMenuController = () => {
295
285
  _register,
296
286
  _unregister,
297
287
  _setOpen,
298
- _setActiveMenu,
299
288
  };
300
289
  };
301
290
  const menuController = /*@__PURE__*/ createMenuController();
@@ -5,16 +5,16 @@
5
5
 
6
6
  Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
- const animation = require('./animation-c8bdd3c7.js');
9
- const index = require('./index-c388851f.js');
10
- const ios_transition = require('./ios.transition-fd592869.js');
11
- const md_transition = require('./md.transition-a6040d41.js');
8
+ const animation = require('./animation-2bb33618.js');
9
+ const index = require('./index-b183138a.js');
10
+ const ios_transition = require('./ios.transition-4b93903d.js');
11
+ const md_transition = require('./md.transition-79f3a215.js');
12
12
  const cubicBezier = require('./cubic-bezier-6b9222ad.js');
13
13
  const index$1 = require('./index-0ee995e4.js');
14
14
  const ionicGlobal = require('./ionic-global-14a0604b.js');
15
15
  const helpers = require('./helpers-ea4ccbcb.js');
16
16
  const config = require('./config-d5882735.js');
17
- const index$2 = require('./index-e50a18ba.js');
17
+ const index$2 = require('./index-d90b29dd.js');
18
18
  const overlays = require('./overlays-d3a13e61.js');
19
19
  require('./index-306a7476.js');
20
20
  require('./index-6f887430.js');
@@ -12,7 +12,7 @@ const lockController = require('./lock-controller-4ae2eb59.js');
12
12
  const overlays = require('./overlays-d3a13e61.js');
13
13
  const theme = require('./theme-fbc56b3b.js');
14
14
  const ionicGlobal = require('./ionic-global-14a0604b.js');
15
- const animation = require('./animation-c8bdd3c7.js');
15
+ const animation = require('./animation-2bb33618.js');
16
16
  require('./haptic-c5f6b4d5.js');
17
17
  require('./capacitor-2ffba62a.js');
18
18
  require('./index-306a7476.js');
@@ -13,7 +13,7 @@ const lockController = require('./lock-controller-4ae2eb59.js');
13
13
  const overlays = require('./overlays-d3a13e61.js');
14
14
  const theme = require('./theme-fbc56b3b.js');
15
15
  const ionicGlobal = require('./ionic-global-14a0604b.js');
16
- const animation = require('./animation-c8bdd3c7.js');
16
+ const animation = require('./animation-2bb33618.js');
17
17
  require('./haptic-c5f6b4d5.js');
18
18
  require('./capacitor-2ffba62a.js');
19
19
  require('./index-306a7476.js');
@@ -14,7 +14,7 @@ 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
16
  const frameworkDelegate = require('./framework-delegate-c0873a6f.js');
17
- const index$2 = require('./index-c388851f.js');
17
+ const index$2 = require('./index-b183138a.js');
18
18
  require('./index-cc7dfb7c.js');
19
19
  require('./index-306a7476.js');
20
20
  require('./keyboard-fd7db491.js');
@@ -16,7 +16,7 @@ const ionicGlobal = require('./ionic-global-14a0604b.js');
16
16
  const data = require('./data-db832785.js');
17
17
  const lockController = require('./lock-controller-4ae2eb59.js');
18
18
  const overlays = require('./overlays-d3a13e61.js');
19
- const animation = require('./animation-c8bdd3c7.js');
19
+ const animation = require('./animation-2bb33618.js');
20
20
  const haptic = require('./haptic-c5f6b4d5.js');
21
21
  require('./index-306a7476.js');
22
22
  require('./framework-delegate-c0873a6f.js');
@@ -12,7 +12,7 @@ const lockController = require('./lock-controller-4ae2eb59.js');
12
12
  const overlays = require('./overlays-d3a13e61.js');
13
13
  const theme = require('./theme-fbc56b3b.js');
14
14
  const ionicGlobal = require('./ionic-global-14a0604b.js');
15
- const animation = require('./animation-c8bdd3c7.js');
15
+ const animation = require('./animation-2bb33618.js');
16
16
  require('./index-306a7476.js');
17
17
  require('./framework-delegate-c0873a6f.js');
18
18
  require('./hardware-back-button-b67c8e75.js');
@@ -7,16 +7,16 @@ Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
8
  const index = require('./index-6f887430.js');
9
9
  const cubicBezier = require('./cubic-bezier-6b9222ad.js');
10
- const index$2 = require('./index-306a7476.js');
11
10
  const gestureController = require('./gesture-controller-b46721be.js');
12
11
  const helpers = require('./helpers-ea4ccbcb.js');
13
- const index$1 = require('./index-e50a18ba.js');
12
+ const index$1 = require('./index-d90b29dd.js');
14
13
  const overlays = require('./overlays-d3a13e61.js');
15
14
  const ionicGlobal = require('./ionic-global-14a0604b.js');
16
15
  const theme = require('./theme-fbc56b3b.js');
17
- const index$3 = require('./index-d8d1fc0b.js');
16
+ const index$2 = require('./index-d8d1fc0b.js');
18
17
  require('./hardware-back-button-b67c8e75.js');
19
- require('./animation-c8bdd3c7.js');
18
+ require('./animation-2bb33618.js');
19
+ require('./index-306a7476.js');
20
20
  require('./framework-delegate-c0873a6f.js');
21
21
  require('./index-cc7dfb7c.js');
22
22
 
@@ -40,14 +40,6 @@ const Menu = class {
40
40
  this.lastOnEnd = 0;
41
41
  this.blocker = gestureController.GESTURE_CONTROLLER.createBlocker({ disableScroll: true });
42
42
  this.didLoad = false;
43
- /**
44
- * Flag used to determine if an open/close
45
- * operation was cancelled. For example, if
46
- * an app calls "menu.open" then disables the menu
47
- * part way through the animation, then this would
48
- * be considered a cancelled operation.
49
- */
50
- this.operationCancelled = false;
51
43
  this.isAnimating = false;
52
44
  this._isOpen = false;
53
45
  this.inheritedAttributes = {};
@@ -313,15 +305,6 @@ const Menu = class {
313
305
  this.beforeAnimation(shouldOpen);
314
306
  await this.loadAnimation();
315
307
  await this.startAnimation(shouldOpen, animated);
316
- /**
317
- * If the animation was cancelled then
318
- * return false because the operation
319
- * did not succeed.
320
- */
321
- if (this.operationCancelled) {
322
- this.operationCancelled = false;
323
- return false;
324
- }
325
308
  this.afterAnimation(shouldOpen);
326
309
  return true;
327
310
  }
@@ -358,23 +341,18 @@ const Menu = class {
358
341
  const easingReverse = mode === 'ios' ? iosEasingReverse : mdEasingReverse;
359
342
  const ani = this.animation
360
343
  .direction(isReversed ? 'reverse' : 'normal')
361
- .easing(isReversed ? easingReverse : easing);
344
+ .easing(isReversed ? easingReverse : easing)
345
+ .onFinish(() => {
346
+ if (ani.getDirection() === 'reverse') {
347
+ ani.direction('normal');
348
+ }
349
+ });
362
350
  if (animated) {
363
351
  await ani.play();
364
352
  }
365
353
  else {
366
354
  ani.play({ sync: true });
367
355
  }
368
- /**
369
- * We run this after the play invocation
370
- * instead of using ani.onFinish so that
371
- * multiple onFinish callbacks do not get
372
- * run if an animation is played, stopped,
373
- * and then played again.
374
- */
375
- if (ani.getDirection() === 'reverse') {
376
- ani.direction('normal');
377
- }
378
356
  }
379
357
  _isActive() {
380
358
  return !this.disabled && !this.isPaneVisible;
@@ -511,6 +489,7 @@ const Menu = class {
511
489
  }
512
490
  afterAnimation(isOpen) {
513
491
  var _a;
492
+ helpers.assert(this.isAnimating, '_before() should be called while animating');
514
493
  // keep opening/closing the menu disabled for a touch more yet
515
494
  // only add listeners/css if it's enabled and isOpen
516
495
  // and only remove listeners/css if it's not open
@@ -569,41 +548,19 @@ const Menu = class {
569
548
  if (this.gesture) {
570
549
  this.gesture.enable(isActive && this.swipeGesture);
571
550
  }
572
- /**
573
- * If the menu is disabled but it is still open
574
- * then we should close the menu immediately.
575
- * Additionally, if the menu is in the process
576
- * of animating {open, close} and the menu is disabled
577
- * then it should still be closed immediately.
578
- */
579
- if (!isActive) {
580
- /**
581
- * It is possible to disable the menu while
582
- * it is mid-animation. When this happens, we
583
- * need to set the operationCancelled flag
584
- * so that this._setOpen knows to return false
585
- * and not run the "afterAnimation" callback.
586
- */
587
- if (this.isAnimating) {
588
- this.operationCancelled = true;
589
- }
590
- /**
591
- * If the menu is disabled then we should
592
- * forcibly close the menu even if it is open.
593
- */
594
- this.afterAnimation(false);
595
- }
596
- if (index$2.doc === null || index$2.doc === void 0 ? void 0 : index$2.doc.contains(this.el)) {
597
- /**
598
- * Only set the active menu if the menu element is
599
- * present in the DOM. Otherwise if it was destructively
600
- * re-hydrated (through Angular Universal), then ignore
601
- * setting the removed node as the active menu.
602
- */
603
- if (!this.disabled) {
604
- index$1.menuController._setActiveMenu(this);
605
- }
551
+ // Close menu immediately
552
+ if (!isActive && this._isOpen) {
553
+ // close if this menu is open, and should not be enabled
554
+ this.forceClosing();
606
555
  }
556
+ helpers.assert(!this.isAnimating, 'can not be animating');
557
+ }
558
+ forceClosing() {
559
+ helpers.assert(this._isOpen, 'menu cannot be closed');
560
+ this.isAnimating = true;
561
+ const ani = this.animation.direction('reverse');
562
+ ani.play({ sync: true });
563
+ this.afterAnimation(false);
607
564
  }
608
565
  render() {
609
566
  const { type, disabled, isPaneVisible, inheritedAttributes, side } = this;
@@ -679,7 +636,7 @@ const MenuButton = class {
679
636
  render() {
680
637
  const { color, disabled, inheritedAttributes } = this;
681
638
  const mode = ionicGlobal.getIonMode(this);
682
- const menuIcon = ionicGlobal.config.get('menuIcon', mode === 'ios' ? index$3.menuOutline : index$3.menuSharp);
639
+ const menuIcon = ionicGlobal.config.get('menuIcon', mode === 'ios' ? index$2.menuOutline : index$2.menuSharp);
683
640
  const hidden = this.autoHide && !this.visible;
684
641
  const attrs = {
685
642
  type: this.type,
@@ -14,10 +14,10 @@ const index$4 = require('./index-cc7dfb7c.js');
14
14
  const capacitor = require('./capacitor-2ffba62a.js');
15
15
  const overlays = require('./overlays-d3a13e61.js');
16
16
  const theme = require('./theme-fbc56b3b.js');
17
- const index$5 = require('./index-c388851f.js');
17
+ const index$5 = require('./index-b183138a.js');
18
18
  const ionicGlobal = require('./ionic-global-14a0604b.js');
19
19
  const keyboard = require('./keyboard-38f2bb7b.js');
20
- const animation = require('./animation-c8bdd3c7.js');
20
+ const animation = require('./animation-2bb33618.js');
21
21
  const cubicBezier = require('./cubic-bezier-6b9222ad.js');
22
22
  const index$1 = require('./index-0ee995e4.js');
23
23
  const index = require('./index-306a7476.js');
@@ -8,7 +8,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
8
8
  const index = require('./index-6f887430.js');
9
9
  const cubicBezier = require('./cubic-bezier-6b9222ad.js');
10
10
  const helpers = require('./helpers-ea4ccbcb.js');
11
- const index$1 = require('./index-c388851f.js');
11
+ const index$1 = require('./index-b183138a.js');
12
12
  const ionicGlobal = require('./ionic-global-14a0604b.js');
13
13
  const frameworkDelegate = require('./framework-delegate-c0873a6f.js');
14
14
 
@@ -13,8 +13,8 @@ const index$1 = require('./index-cc7dfb7c.js');
13
13
  const overlays = require('./overlays-d3a13e61.js');
14
14
  const ionicGlobal = require('./ionic-global-14a0604b.js');
15
15
  const theme = require('./theme-fbc56b3b.js');
16
- const index$2 = require('./index-c388851f.js');
17
- const animation = require('./animation-c8bdd3c7.js');
16
+ const index$2 = require('./index-b183138a.js');
17
+ const animation = require('./animation-2bb33618.js');
18
18
  require('./index-306a7476.js');
19
19
  require('./hardware-back-button-b67c8e75.js');
20
20