@ionic/core 7.4.4-dev.11696860023.1b8ee3ef → 7.4.4-dev.11696893919.1af6b3c1

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 (153) hide show
  1. package/components/animation.js +60 -1
  2. package/components/checkbox.js +3 -0
  3. package/components/ion-footer.js +11 -21
  4. package/components/ion-menu.js +51 -19
  5. package/components/ion-tab-bar.js +11 -21
  6. package/components/ion-toggle.js +3 -0
  7. package/components/radio-group.js +1 -1
  8. package/components/radio.js +4 -1
  9. package/components/swipe-back.js +5 -1
  10. package/dist/cjs/{animation-2bb33618.js → animation-c8bdd3c7.js} +60 -1
  11. package/dist/cjs/{index-97a3eade.js → index-1f1ea05f.js} +1 -1
  12. package/dist/cjs/{index-acf6bdf0.js → index-fa649bd8.js} +2 -2
  13. package/dist/cjs/index.cjs.js +5 -5
  14. package/dist/cjs/ion-action-sheet.cjs.entry.js +1 -1
  15. package/dist/cjs/ion-alert.cjs.entry.js +1 -1
  16. package/dist/cjs/ion-app_8.cjs.entry.js +14 -23
  17. package/dist/cjs/ion-checkbox.cjs.entry.js +3 -0
  18. package/dist/cjs/ion-datetime_3.cjs.entry.js +1 -1
  19. package/dist/cjs/ion-loading.cjs.entry.js +1 -1
  20. package/dist/cjs/ion-menu_3.cjs.entry.js +53 -21
  21. package/dist/cjs/ion-modal.cjs.entry.js +2 -2
  22. package/dist/cjs/ion-nav_2.cjs.entry.js +2 -2
  23. package/dist/cjs/ion-popover.cjs.entry.js +2 -2
  24. package/dist/cjs/ion-radio_2.cjs.entry.js +5 -2
  25. package/dist/cjs/ion-refresher_2.cjs.entry.js +1 -1
  26. package/dist/cjs/ion-tab-bar_2.cjs.entry.js +12 -21
  27. package/dist/cjs/ion-toast.cjs.entry.js +1 -1
  28. package/dist/cjs/ion-toggle.cjs.entry.js +3 -0
  29. package/dist/cjs/{ios.transition-e31445c2.js → ios.transition-4195d10d.js} +2 -2
  30. package/dist/cjs/{md.transition-fb13ac79.js → md.transition-0713f667.js} +2 -2
  31. package/dist/cjs/{swipe-back-6c57d1df.js → swipe-back-d0412fb6.js} +5 -1
  32. package/dist/collection/components/checkbox/checkbox.js +3 -0
  33. package/dist/collection/components/footer/footer.js +11 -21
  34. package/dist/collection/components/menu/menu.js +51 -19
  35. package/dist/collection/components/menu/test/disable/menu.e2e.js +55 -0
  36. package/dist/collection/components/radio/radio.js +4 -1
  37. package/dist/collection/components/radio-group/radio-group.js +1 -1
  38. package/dist/collection/components/tab-bar/tab-bar.js +11 -21
  39. package/dist/collection/components/toggle/toggle.js +3 -0
  40. package/dist/collection/utils/animation/animation.js +60 -1
  41. package/dist/collection/utils/gesture/swipe-back.js +5 -1
  42. package/dist/collection/utils/keyboard/keyboard-controller.js +1 -1
  43. package/dist/docs.json +1 -1
  44. package/dist/esm/{animation-a1d9e088.js → animation-92066c62.js} +60 -1
  45. package/dist/esm/{index-32c6828b.js → index-0b0dd67c.js} +2 -2
  46. package/dist/esm/{index-3d6aefa2.js → index-97a2bb98.js} +1 -1
  47. package/dist/esm/index.js +5 -5
  48. package/dist/esm/ion-action-sheet.entry.js +1 -1
  49. package/dist/esm/ion-alert.entry.js +1 -1
  50. package/dist/esm/ion-app_8.entry.js +14 -23
  51. package/dist/esm/ion-checkbox.entry.js +3 -0
  52. package/dist/esm/ion-datetime_3.entry.js +1 -1
  53. package/dist/esm/ion-loading.entry.js +1 -1
  54. package/dist/esm/ion-menu_3.entry.js +53 -21
  55. package/dist/esm/ion-modal.entry.js +2 -2
  56. package/dist/esm/ion-nav_2.entry.js +2 -2
  57. package/dist/esm/ion-popover.entry.js +2 -2
  58. package/dist/esm/ion-radio_2.entry.js +5 -2
  59. package/dist/esm/ion-refresher_2.entry.js +1 -1
  60. package/dist/esm/ion-tab-bar_2.entry.js +12 -21
  61. package/dist/esm/ion-toast.entry.js +1 -1
  62. package/dist/esm/ion-toggle.entry.js +3 -0
  63. package/dist/esm/{ios.transition-d8223b18.js → ios.transition-875ba2ea.js} +2 -2
  64. package/dist/esm/{md.transition-caed184e.js → md.transition-54c79f72.js} +2 -2
  65. package/dist/esm/{swipe-back-6d4c0a4e.js → swipe-back-0f3bfc8e.js} +5 -1
  66. package/dist/esm-es5/animation-92066c62.js +4 -0
  67. package/dist/esm-es5/{index-32c6828b.js → index-0b0dd67c.js} +1 -1
  68. package/dist/esm-es5/{index-3d6aefa2.js → index-97a2bb98.js} +1 -1
  69. package/dist/esm-es5/index.js +1 -1
  70. package/dist/esm-es5/ion-action-sheet.entry.js +1 -1
  71. package/dist/esm-es5/ion-alert.entry.js +1 -1
  72. package/dist/esm-es5/ion-app_8.entry.js +1 -1
  73. package/dist/esm-es5/ion-checkbox.entry.js +1 -1
  74. package/dist/esm-es5/ion-datetime_3.entry.js +1 -1
  75. package/dist/esm-es5/ion-loading.entry.js +1 -1
  76. package/dist/esm-es5/ion-menu_3.entry.js +1 -1
  77. package/dist/esm-es5/ion-modal.entry.js +1 -1
  78. package/dist/esm-es5/ion-nav_2.entry.js +1 -1
  79. package/dist/esm-es5/ion-popover.entry.js +1 -1
  80. package/dist/esm-es5/ion-radio_2.entry.js +1 -1
  81. package/dist/esm-es5/ion-refresher_2.entry.js +1 -1
  82. package/dist/esm-es5/ion-tab-bar_2.entry.js +1 -1
  83. package/dist/esm-es5/ion-toast.entry.js +1 -1
  84. package/dist/esm-es5/ion-toggle.entry.js +1 -1
  85. package/dist/esm-es5/{ios.transition-d8223b18.js → ios.transition-875ba2ea.js} +1 -1
  86. package/dist/esm-es5/{md.transition-caed184e.js → md.transition-54c79f72.js} +1 -1
  87. package/dist/esm-es5/{swipe-back-6d4c0a4e.js → swipe-back-0f3bfc8e.js} +1 -1
  88. package/dist/ionic/index.esm.js +1 -1
  89. package/dist/ionic/ionic.esm.js +1 -1
  90. package/dist/ionic/p-00d3814a.system.entry.js +4 -0
  91. package/dist/ionic/p-015187e5.system.js +4 -0
  92. package/dist/ionic/{p-96ad49f1.entry.js → p-07c816fb.entry.js} +1 -1
  93. package/dist/ionic/{p-1d2d1ab5.system.entry.js → p-0c7d0167.system.entry.js} +1 -1
  94. package/dist/ionic/{p-95e44641.system.entry.js → p-0dcdf480.system.entry.js} +1 -1
  95. package/dist/ionic/{p-8957b1de.system.entry.js → p-0fc8a522.system.entry.js} +1 -1
  96. package/dist/ionic/{p-57c5eca2.system.js → p-15041a8c.system.js} +1 -1
  97. package/dist/ionic/{p-30b04d8d.js → p-2062958e.js} +1 -1
  98. package/dist/ionic/{p-4b23f472.entry.js → p-2134558d.entry.js} +1 -1
  99. package/dist/ionic/{p-037e2738.system.entry.js → p-2330af92.system.entry.js} +1 -1
  100. package/dist/ionic/{p-e88ed929.system.entry.js → p-24952f8a.system.entry.js} +1 -1
  101. package/dist/ionic/{p-1caf1ec6.entry.js → p-32eaa293.entry.js} +1 -1
  102. package/dist/ionic/{p-fb18f74b.system.entry.js → p-3d278648.system.entry.js} +1 -1
  103. package/dist/ionic/p-446230d7.js +4 -0
  104. package/dist/ionic/p-4c274938.entry.js +4 -0
  105. package/dist/ionic/{p-58565369.system.entry.js → p-52e5f8f0.system.entry.js} +1 -1
  106. package/dist/ionic/p-53d4606a.entry.js +4 -0
  107. package/dist/ionic/{p-d580cbb7.system.entry.js → p-63b4ef44.system.entry.js} +1 -1
  108. package/dist/ionic/{p-7cad90ed.entry.js → p-678f37d7.entry.js} +1 -1
  109. package/dist/ionic/{p-c381a9a9.system.entry.js → p-7061fa75.system.entry.js} +1 -1
  110. package/dist/ionic/p-73eba881.system.js +1 -1
  111. package/dist/ionic/p-775f3749.entry.js +4 -0
  112. package/dist/ionic/p-77872abc.entry.js +4 -0
  113. package/dist/ionic/p-77b9d68a.system.entry.js +4 -0
  114. package/dist/ionic/p-7b15d413.entry.js +4 -0
  115. package/dist/ionic/p-8b33cfef.entry.js +4 -0
  116. package/dist/ionic/{p-c57cde35.system.js → p-8dbdb163.system.js} +1 -1
  117. package/dist/ionic/p-8f36cde3.system.entry.js +4 -0
  118. package/dist/ionic/{p-9e727d1d.entry.js → p-979dc719.entry.js} +1 -1
  119. package/dist/ionic/{p-9d0916cb.system.js → p-9e6bf328.system.js} +1 -1
  120. package/dist/ionic/{p-e7d69cad.entry.js → p-a1528344.entry.js} +1 -1
  121. package/dist/ionic/p-a1e2f98c.js +4 -0
  122. package/dist/ionic/{p-c2d6b2fb.entry.js → p-ab37db48.entry.js} +1 -1
  123. package/dist/ionic/p-af39c1c5.js +4 -0
  124. package/dist/ionic/{p-a760fd9a.system.js → p-b7258ddb.system.js} +1 -1
  125. package/dist/ionic/p-c5395981.js +4 -0
  126. package/dist/ionic/{p-043e8328.system.js → p-c9524896.system.js} +1 -1
  127. package/dist/ionic/{p-6db9035a.system.entry.js → p-cd075e75.system.entry.js} +1 -1
  128. package/dist/ionic/{p-a0e2f6d8.entry.js → p-d055bba9.entry.js} +1 -1
  129. package/dist/ionic/p-d17638e9.system.js +4 -0
  130. package/dist/ionic/{p-6b3784a2.system.entry.js → p-df951755.system.entry.js} +1 -1
  131. package/dist/ionic/p-e627ed84.js +4 -0
  132. package/dist/ionic/{p-ab7edc16.system.entry.js → p-e92068d4.system.entry.js} +1 -1
  133. package/dist/ionic/{p-e3272ed8.entry.js → p-eaa58d23.entry.js} +1 -1
  134. package/dist/types/components/menu/menu.d.ts +8 -1
  135. package/hydrate/index.js +149 -63
  136. package/package.json +1 -1
  137. package/dist/esm-es5/animation-a1d9e088.js +0 -4
  138. package/dist/ionic/p-0cbec498.system.entry.js +0 -4
  139. package/dist/ionic/p-1c59608c.system.entry.js +0 -4
  140. package/dist/ionic/p-469d6a98.entry.js +0 -4
  141. package/dist/ionic/p-4af11953.entry.js +0 -4
  142. package/dist/ionic/p-606fddbe.system.entry.js +0 -4
  143. package/dist/ionic/p-6641d7fa.js +0 -4
  144. package/dist/ionic/p-686a9d53.entry.js +0 -4
  145. package/dist/ionic/p-68b405cc.entry.js +0 -4
  146. package/dist/ionic/p-6b2641f6.system.js +0 -4
  147. package/dist/ionic/p-90ebbca0.entry.js +0 -4
  148. package/dist/ionic/p-94a4ce40.js +0 -4
  149. package/dist/ionic/p-9649c54e.js +0 -4
  150. package/dist/ionic/p-a0b19468.entry.js +0 -4
  151. package/dist/ionic/p-a732cfec.system.js +0 -4
  152. package/dist/ionic/p-b370d1b4.js +0 -4
  153. package/dist/ionic/p-df7357c5.js +0 -4
@@ -159,6 +159,7 @@ const createAnimation = (animationId) => {
159
159
  const id = animationId;
160
160
  const onFinishCallbacks = [];
161
161
  const onFinishOneTimeCallbacks = [];
162
+ const onStopOneTimeCallbacks = [];
162
163
  const elements = [];
163
164
  const childAnimations = [];
164
165
  const stylesheets = [];
@@ -216,6 +217,28 @@ const createAnimation = (animationId) => {
216
217
  const isRunning = () => {
217
218
  return numAnimationsRunning !== 0 && !paused;
218
219
  };
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
+ };
219
242
  const onFinish = (callback, opts) => {
220
243
  const callbacks = (opts === null || opts === void 0 ? void 0 : opts.oneTimeCallback) ? onFinishOneTimeCallbacks : onFinishCallbacks;
221
244
  callbacks.push({ c: callback, o: opts });
@@ -884,7 +907,33 @@ const createAnimation = (animationId) => {
884
907
  numAnimationsRunning = childAnimations.length + 1;
885
908
  shouldCalculateNumAnimations = false;
886
909
  }
887
- onFinish(() => resolve(), { oneTimeCallback: true });
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 });
888
937
  childAnimations.forEach((animation) => {
889
938
  animation.play();
890
939
  });
@@ -897,6 +946,14 @@ const createAnimation = (animationId) => {
897
946
  paused = false;
898
947
  });
899
948
  };
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
+ */
900
957
  const stop = () => {
901
958
  childAnimations.forEach((animation) => {
902
959
  animation.stop();
@@ -906,6 +963,8 @@ const createAnimation = (animationId) => {
906
963
  initialized = false;
907
964
  }
908
965
  resetFlags();
966
+ onStopOneTimeCallbacks.forEach((onStopCallback) => onStopCallback.c(0, ani));
967
+ onStopOneTimeCallbacks.length = 0;
909
968
  };
910
969
  const from = (property, value) => {
911
970
  const firstFrame = _keyframes[0];
@@ -52,6 +52,9 @@ const Checkbox = /*@__PURE__*/ proxyCustomElement(class Checkbox extends HTMLEle
52
52
  this.ionBlur.emit();
53
53
  };
54
54
  this.onClick = (ev) => {
55
+ if (this.disabled) {
56
+ return;
57
+ }
55
58
  this.toggleChecked(ev);
56
59
  };
57
60
  this.color = undefined;
@@ -4,7 +4,6 @@
4
4
  import { readTask, writeTask, proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
5
5
  import { f as findIonContent, p as printIonContentErrorMsg, g as getScrollElement } from './index8.js';
6
6
  import { c as createKeyboardController } from './keyboard-controller.js';
7
- import { K as Keyboard, a as KeyboardResize } from './keyboard.js';
8
7
  import { b as getIonMode } from './ionic-global.js';
9
8
  import { m as clamp } from './helpers.js';
10
9
 
@@ -86,26 +85,17 @@ const Footer = /*@__PURE__*/ proxyCustomElement(class Footer extends HTMLElement
86
85
  this.checkCollapsibleFooter();
87
86
  }
88
87
  async connectedCallback() {
89
- const resizeMode = await Keyboard.getResizeMode();
90
- /**
91
- * If the resize mode is set to None then we don't want to
92
- * hide the tab bar here since it will never sit on top
93
- * of the keyboard. Hiding the tab bar will cause a layout shift
94
- * in apps that have resize set to None.
95
- */
96
- if (resizeMode === undefined || resizeMode.mode !== KeyboardResize.None) {
97
- this.keyboardCtrl = await createKeyboardController(async (keyboardOpen, waitForResize) => {
98
- /**
99
- * If the keyboard is hiding, then we need to wait
100
- * for the webview to resize. Otherwise, the footer
101
- * will flicker before the webview resizes.
102
- */
103
- if (keyboardOpen === false && waitForResize !== undefined) {
104
- await waitForResize;
105
- }
106
- this.keyboardVisible = keyboardOpen; // trigger re-render by updating state
107
- });
108
- }
88
+ this.keyboardCtrl = await createKeyboardController(async (keyboardOpen, waitForResize) => {
89
+ /**
90
+ * If the keyboard is hiding, then we need to wait
91
+ * for the webview to resize. Otherwise, the footer
92
+ * will flicker before the webview resizes.
93
+ */
94
+ if (keyboardOpen === false && waitForResize !== undefined) {
95
+ await waitForResize;
96
+ }
97
+ this.keyboardVisible = keyboardOpen; // trigger re-render by updating state
98
+ });
109
99
  }
110
100
  disconnectedCallback() {
111
101
  if (this.keyboardCtrl) {
@@ -33,6 +33,14 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
33
33
  this.lastOnEnd = 0;
34
34
  this.blocker = GESTURE_CONTROLLER.createBlocker({ disableScroll: true });
35
35
  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;
36
44
  this.isAnimating = false;
37
45
  this._isOpen = false;
38
46
  this.inheritedAttributes = {};
@@ -301,6 +309,15 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
301
309
  this.beforeAnimation(shouldOpen);
302
310
  await this.loadAnimation();
303
311
  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
+ }
304
321
  this.afterAnimation(shouldOpen);
305
322
  return true;
306
323
  }
@@ -337,18 +354,23 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
337
354
  const easingReverse = mode === 'ios' ? iosEasingReverse : mdEasingReverse;
338
355
  const ani = this.animation
339
356
  .direction(isReversed ? 'reverse' : 'normal')
340
- .easing(isReversed ? easingReverse : easing)
341
- .onFinish(() => {
342
- if (ani.getDirection() === 'reverse') {
343
- ani.direction('normal');
344
- }
345
- });
357
+ .easing(isReversed ? easingReverse : easing);
346
358
  if (animated) {
347
359
  await ani.play();
348
360
  }
349
361
  else {
350
362
  ani.play({ sync: true });
351
363
  }
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
+ }
352
374
  }
353
375
  _isActive() {
354
376
  return !this.disabled && !this.isPaneVisible;
@@ -485,7 +507,6 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
485
507
  }
486
508
  afterAnimation(isOpen) {
487
509
  var _a;
488
- assert(this.isAnimating, '_before() should be called while animating');
489
510
  // keep opening/closing the menu disabled for a touch more yet
490
511
  // only add listeners/css if it's enabled and isOpen
491
512
  // and only remove listeners/css if it's not open
@@ -544,10 +565,29 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
544
565
  if (this.gesture) {
545
566
  this.gesture.enable(isActive && this.swipeGesture);
546
567
  }
547
- // Close menu immediately
548
- if (!isActive && this._isOpen) {
549
- // close if this menu is open, and should not be enabled
550
- this.forceClosing();
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);
551
591
  }
552
592
  if (doc === null || doc === void 0 ? void 0 : doc.contains(this.el)) {
553
593
  /**
@@ -560,14 +600,6 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
560
600
  menuController._setActiveMenu(this);
561
601
  }
562
602
  }
563
- assert(!this.isAnimating, 'can not be animating');
564
- }
565
- forceClosing() {
566
- assert(this._isOpen, 'menu cannot be closed');
567
- this.isAnimating = true;
568
- const ani = this.animation.direction('reverse');
569
- ani.play({ sync: true });
570
- this.afterAnimation(false);
571
603
  }
572
604
  render() {
573
605
  const { type, disabled, isPaneVisible, inheritedAttributes, side } = this;
@@ -3,7 +3,6 @@
3
3
  */
4
4
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
5
5
  import { c as createKeyboardController } from './keyboard-controller.js';
6
- import { K as Keyboard, a as KeyboardResize } from './keyboard.js';
7
6
  import { c as createColorClasses } from './theme.js';
8
7
  import { b as getIonMode } from './ionic-global.js';
9
8
 
@@ -35,26 +34,17 @@ const TabBar = /*@__PURE__*/ proxyCustomElement(class TabBar extends HTMLElement
35
34
  this.selectedTabChanged();
36
35
  }
37
36
  async connectedCallback() {
38
- const resizeMode = await Keyboard.getResizeMode();
39
- /**
40
- * If the resize mode is set to None then we don't want to
41
- * hide the tab bar here since it will never sit on top
42
- * of the keyboard. Hiding the tab bar will cause a layout shift
43
- * in apps that have resize set to None.
44
- */
45
- if (resizeMode === undefined || resizeMode.mode !== KeyboardResize.None) {
46
- this.keyboardCtrl = await createKeyboardController(async (keyboardOpen, waitForResize) => {
47
- /**
48
- * If the keyboard is hiding, then we need to wait
49
- * for the webview to resize. Otherwise, the tab bar
50
- * will flicker before the webview resizes.
51
- */
52
- if (keyboardOpen === false && waitForResize !== undefined) {
53
- await waitForResize;
54
- }
55
- this.keyboardVisible = keyboardOpen; // trigger re-render by updating state
56
- });
57
- }
37
+ this.keyboardCtrl = await createKeyboardController(async (keyboardOpen, waitForResize) => {
38
+ /**
39
+ * If the keyboard is hiding, then we need to wait
40
+ * for the webview to resize. Otherwise, the tab bar
41
+ * will flicker before the webview resizes.
42
+ */
43
+ if (keyboardOpen === false && waitForResize !== undefined) {
44
+ await waitForResize;
45
+ }
46
+ this.keyboardVisible = keyboardOpen; // trigger re-render by updating state
47
+ });
58
48
  }
59
49
  disconnectedCallback() {
60
50
  if (this.keyboardCtrl) {
@@ -48,6 +48,9 @@ const Toggle = /*@__PURE__*/ proxyCustomElement(class Toggle extends HTMLElement
48
48
  }
49
49
  };
50
50
  this.onClick = (ev) => {
51
+ if (this.disabled) {
52
+ return;
53
+ }
51
54
  ev.preventDefault();
52
55
  if (this.lastDrag + 300 < Date.now()) {
53
56
  this.toggleChecked();
@@ -38,7 +38,7 @@ const RadioGroup = /*@__PURE__*/ proxyCustomElement(class RadioGroup extends HTM
38
38
  * using the `name` attribute.
39
39
  */
40
40
  const selectedRadio = ev.target && ev.target.closest('ion-radio');
41
- if (selectedRadio) {
41
+ if (selectedRadio && selectedRadio.disabled === false) {
42
42
  const currentValue = this.value;
43
43
  const newValue = selectedRadio.value;
44
44
  if (newValue !== currentValue) {
@@ -30,7 +30,10 @@ const Radio = /*@__PURE__*/ proxyCustomElement(class Radio extends HTMLElement {
30
30
  }
31
31
  };
32
32
  this.onClick = () => {
33
- const { radioGroup, checked } = this;
33
+ const { radioGroup, checked, disabled } = this;
34
+ if (disabled) {
35
+ return;
36
+ }
34
37
  /**
35
38
  * The legacy control uses a native input inside
36
39
  * of the radio host, so we can set this.checked
@@ -62,7 +62,11 @@ const createSwipeBackGesture = (el, canStartHandler, onStartHandler, onMoveHandl
62
62
  return createGesture({
63
63
  el,
64
64
  gestureName: 'goback-swipe',
65
- gesturePriority: 40,
65
+ /**
66
+ * Swipe to go back should have priority over other horizontal swipe
67
+ * gestures. These gestures have a priority of 100 which is why 101 was chosen here.
68
+ */
69
+ gesturePriority: 101,
66
70
  threshold: 10,
67
71
  canStart,
68
72
  onStart: onStartHandler,
@@ -161,6 +161,7 @@ const createAnimation = (animationId) => {
161
161
  const id = animationId;
162
162
  const onFinishCallbacks = [];
163
163
  const onFinishOneTimeCallbacks = [];
164
+ const onStopOneTimeCallbacks = [];
164
165
  const elements = [];
165
166
  const childAnimations = [];
166
167
  const stylesheets = [];
@@ -218,6 +219,28 @@ const createAnimation = (animationId) => {
218
219
  const isRunning = () => {
219
220
  return numAnimationsRunning !== 0 && !paused;
220
221
  };
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
+ };
221
244
  const onFinish = (callback, opts) => {
222
245
  const callbacks = (opts === null || opts === void 0 ? void 0 : opts.oneTimeCallback) ? onFinishOneTimeCallbacks : onFinishCallbacks;
223
246
  callbacks.push({ c: callback, o: opts });
@@ -886,7 +909,33 @@ const createAnimation = (animationId) => {
886
909
  numAnimationsRunning = childAnimations.length + 1;
887
910
  shouldCalculateNumAnimations = false;
888
911
  }
889
- onFinish(() => resolve(), { oneTimeCallback: true });
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 });
890
939
  childAnimations.forEach((animation) => {
891
940
  animation.play();
892
941
  });
@@ -899,6 +948,14 @@ const createAnimation = (animationId) => {
899
948
  paused = false;
900
949
  });
901
950
  };
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
+ */
902
959
  const stop = () => {
903
960
  childAnimations.forEach((animation) => {
904
961
  animation.stop();
@@ -908,6 +965,8 @@ const createAnimation = (animationId) => {
908
965
  initialized = false;
909
966
  }
910
967
  resetFlags();
968
+ onStopOneTimeCallbacks.forEach((onStopCallback) => onStopCallback.c(0, ani));
969
+ onStopOneTimeCallbacks.length = 0;
911
970
  };
912
971
  const from = (property, value) => {
913
972
  const firstFrame = _keyframes[0];
@@ -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-a71608df.js');
9
- const animation = require('./animation-2bb33618.js');
9
+ const animation = require('./animation-c8bdd3c7.js');
10
10
 
11
11
  /**
12
12
  * baseAnimation
@@ -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-e31445c2.js'); });
16
- const mdTransitionAnimation = () => Promise.resolve().then(function () { return require('./md.transition-fb13ac79.js'); });
15
+ const iosTransitionAnimation = () => Promise.resolve().then(function () { return require('./ios.transition-4195d10d.js'); });
16
+ const mdTransitionAnimation = () => Promise.resolve().then(function () { return require('./md.transition-0713f667.js'); });
17
17
  // TODO(FW-2832): types
18
18
  const transition = (opts) => {
19
19
  return new Promise((resolve, reject) => {
@@ -5,16 +5,16 @@
5
5
 
6
6
  Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
- const animation = require('./animation-2bb33618.js');
9
- const index = require('./index-acf6bdf0.js');
10
- const ios_transition = require('./ios.transition-e31445c2.js');
11
- const md_transition = require('./md.transition-fb13ac79.js');
8
+ const animation = require('./animation-c8bdd3c7.js');
9
+ const index = require('./index-fa649bd8.js');
10
+ const ios_transition = require('./ios.transition-4195d10d.js');
11
+ const md_transition = require('./md.transition-0713f667.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-a71608df.js');
15
15
  const helpers = require('./helpers-ea4ccbcb.js');
16
16
  const config = require('./config-d5882735.js');
17
- const index$2 = require('./index-97a3eade.js');
17
+ const index$2 = require('./index-1f1ea05f.js');
18
18
  const overlays = require('./overlays-efc9d511.js');
19
19
  require('./index-306a7476.js');
20
20
  require('./index-14a4821e.js');
@@ -12,7 +12,7 @@ const lockController = require('./lock-controller-4ae2eb59.js');
12
12
  const overlays = require('./overlays-efc9d511.js');
13
13
  const theme = require('./theme-fbc56b3b.js');
14
14
  const ionicGlobal = require('./ionic-global-a71608df.js');
15
- const animation = require('./animation-2bb33618.js');
15
+ const animation = require('./animation-c8bdd3c7.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-efc9d511.js');
14
14
  const theme = require('./theme-fbc56b3b.js');
15
15
  const ionicGlobal = require('./ionic-global-a71608df.js');
16
- const animation = require('./animation-2bb33618.js');
16
+ const animation = require('./animation-c8bdd3c7.js');
17
17
  require('./haptic-c5f6b4d5.js');
18
18
  require('./capacitor-2ffba62a.js');
19
19
  require('./index-306a7476.js');
@@ -12,13 +12,13 @@ const dir = require('./dir-f1e0ca26.js');
12
12
  const theme = require('./theme-fbc56b3b.js');
13
13
  const index$1 = require('./index-10873539.js');
14
14
  const keyboardController = require('./keyboard-controller-50beb83a.js');
15
- const keyboard = require('./keyboard-fd7db491.js');
16
15
  const cubicBezier = require('./cubic-bezier-6b9222ad.js');
17
16
  const frameworkDelegate = require('./framework-delegate-c0873a6f.js');
18
17
  const lockController = require('./lock-controller-4ae2eb59.js');
19
- const index$2 = require('./index-acf6bdf0.js');
18
+ const index$2 = require('./index-fa649bd8.js');
20
19
  require('./index-cc7dfb7c.js');
21
20
  require('./index-306a7476.js');
21
+ require('./keyboard-fd7db491.js');
22
22
  require('./capacitor-2ffba62a.js');
23
23
 
24
24
  const appCss = "html.plt-mobile ion-app{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}html.plt-mobile ion-app [contenteditable]{-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}ion-app.force-statusbar-padding{--ion-safe-area-top:20px}";
@@ -614,26 +614,17 @@ const Footer = class {
614
614
  this.checkCollapsibleFooter();
615
615
  }
616
616
  async connectedCallback() {
617
- const resizeMode = await keyboard.Keyboard.getResizeMode();
618
- /**
619
- * If the resize mode is set to None then we don't want to
620
- * hide the tab bar here since it will never sit on top
621
- * of the keyboard. Hiding the tab bar will cause a layout shift
622
- * in apps that have resize set to None.
623
- */
624
- if (resizeMode === undefined || resizeMode.mode !== keyboard.KeyboardResize.None) {
625
- this.keyboardCtrl = await keyboardController.createKeyboardController(async (keyboardOpen, waitForResize) => {
626
- /**
627
- * If the keyboard is hiding, then we need to wait
628
- * for the webview to resize. Otherwise, the footer
629
- * will flicker before the webview resizes.
630
- */
631
- if (keyboardOpen === false && waitForResize !== undefined) {
632
- await waitForResize;
633
- }
634
- this.keyboardVisible = keyboardOpen; // trigger re-render by updating state
635
- });
636
- }
617
+ this.keyboardCtrl = await keyboardController.createKeyboardController(async (keyboardOpen, waitForResize) => {
618
+ /**
619
+ * If the keyboard is hiding, then we need to wait
620
+ * for the webview to resize. Otherwise, the footer
621
+ * will flicker before the webview resizes.
622
+ */
623
+ if (keyboardOpen === false && waitForResize !== undefined) {
624
+ await waitForResize;
625
+ }
626
+ this.keyboardVisible = keyboardOpen; // trigger re-render by updating state
627
+ });
637
628
  }
638
629
  disconnectedCallback() {
639
630
  if (this.keyboardCtrl) {
@@ -1023,7 +1014,7 @@ const RouterOutlet = class {
1023
1014
  this.swipeHandler.onStart();
1024
1015
  }
1025
1016
  };
1026
- this.gesture = (await Promise.resolve().then(function () { return require('./swipe-back-6c57d1df.js'); })).createSwipeBackGesture(this.el, () => !this.gestureOrAnimationInProgress && !!this.swipeHandler && this.swipeHandler.canStart(), () => onStart(), (step) => { var _a; return (_a = this.ani) === null || _a === void 0 ? void 0 : _a.progressStep(step); }, (shouldComplete, step, dur) => {
1017
+ this.gesture = (await Promise.resolve().then(function () { return require('./swipe-back-d0412fb6.js'); })).createSwipeBackGesture(this.el, () => !this.gestureOrAnimationInProgress && !!this.swipeHandler && this.swipeHandler.canStart(), () => onStart(), (step) => { var _a; return (_a = this.ani) === null || _a === void 0 ? void 0 : _a.progressStep(step); }, (shouldComplete, step, dur) => {
1027
1018
  if (this.ani) {
1028
1019
  this.ani.onFinish(() => {
1029
1020
  this.gestureOrAnimationInProgress = false;
@@ -54,6 +54,9 @@ const Checkbox = class {
54
54
  this.ionBlur.emit();
55
55
  };
56
56
  this.onClick = (ev) => {
57
+ if (this.disabled) {
58
+ return;
59
+ }
57
60
  this.toggleChecked(ev);
58
61
  };
59
62
  this.color = undefined;
@@ -16,7 +16,7 @@ const ionicGlobal = require('./ionic-global-a71608df.js');
16
16
  const data = require('./data-db832785.js');
17
17
  const lockController = require('./lock-controller-4ae2eb59.js');
18
18
  const overlays = require('./overlays-efc9d511.js');
19
- const animation = require('./animation-2bb33618.js');
19
+ const animation = require('./animation-c8bdd3c7.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-efc9d511.js');
13
13
  const theme = require('./theme-fbc56b3b.js');
14
14
  const ionicGlobal = require('./ionic-global-a71608df.js');
15
- const animation = require('./animation-2bb33618.js');
15
+ const animation = require('./animation-c8bdd3c7.js');
16
16
  require('./index-306a7476.js');
17
17
  require('./framework-delegate-c0873a6f.js');
18
18
  require('./hardware-back-button-b67c8e75.js');