@ionic/core 7.4.4-dev.11696956070.1faa3cfe → 7.4.4-dev.11699471770.1b7273c4

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 (211) hide show
  1. package/components/alert.js +8 -0
  2. package/components/checkbox.js +0 -3
  3. package/components/data.js +96 -22
  4. package/components/haptic.js +1 -0
  5. package/components/index.js +1 -0
  6. package/components/ion-datetime-button.js +4 -4
  7. package/components/ion-datetime.js +3 -3
  8. package/components/ion-nav.js +1 -0
  9. package/components/ion-router.js +3 -0
  10. package/components/ion-select.js +1 -1
  11. package/components/ion-toast.js +157 -13
  12. package/components/ion-toggle.js +0 -3
  13. package/components/ios.transition.js +1 -0
  14. package/components/overlays.js +1 -0
  15. package/components/radio-group.js +1 -1
  16. package/components/radio.js +1 -4
  17. package/dist/cjs/{button-active-c358e83c.js → button-active-f2147e85.js} +1 -1
  18. package/dist/cjs/{data-db832785.js → data-c8d21093.js} +96 -22
  19. package/dist/cjs/{haptic-c5f6b4d5.js → haptic-678abc9f.js} +1 -0
  20. package/dist/cjs/{index-fa649bd8.js → index-33d2809c.js} +2 -2
  21. package/dist/cjs/index.cjs.js +6 -4
  22. package/dist/cjs/ion-action-sheet.cjs.entry.js +3 -3
  23. package/dist/cjs/ion-alert.cjs.entry.js +11 -3
  24. package/dist/cjs/ion-app_8.cjs.entry.js +1 -1
  25. package/dist/cjs/ion-checkbox.cjs.entry.js +0 -3
  26. package/dist/cjs/ion-datetime-button.cjs.entry.js +4 -4
  27. package/dist/cjs/ion-datetime_3.cjs.entry.js +5 -5
  28. package/dist/cjs/ion-loading.cjs.entry.js +1 -1
  29. package/dist/cjs/ion-menu_3.cjs.entry.js +1 -1
  30. package/dist/cjs/ion-modal.cjs.entry.js +2 -2
  31. package/dist/cjs/ion-nav_2.cjs.entry.js +2 -1
  32. package/dist/cjs/ion-picker-column-internal.cjs.entry.js +1 -1
  33. package/dist/cjs/ion-popover.cjs.entry.js +2 -2
  34. package/dist/cjs/ion-radio_2.cjs.entry.js +2 -5
  35. package/dist/cjs/ion-refresher_2.cjs.entry.js +1 -1
  36. package/dist/cjs/ion-reorder_2.cjs.entry.js +1 -1
  37. package/dist/cjs/ion-route_4.cjs.entry.js +3 -0
  38. package/dist/cjs/ion-select_3.cjs.entry.js +2 -2
  39. package/dist/cjs/ion-toast.cjs.entry.js +174 -32
  40. package/dist/cjs/ion-toggle.cjs.entry.js +1 -4
  41. package/dist/cjs/ionic.cjs.js +1 -1
  42. package/dist/cjs/{ios.transition-4195d10d.js → ios.transition-8ddf91e6.js} +2 -1
  43. package/dist/cjs/loader.cjs.js +1 -1
  44. package/dist/cjs/{md.transition-0713f667.js → md.transition-44ff8566.js} +1 -1
  45. package/dist/cjs/{overlays-efc9d511.js → overlays-9cab437c.js} +1 -0
  46. package/dist/collection/components/alert/alert.js +8 -0
  47. package/dist/collection/components/alert/test/a11y/alert.e2e.js +11 -0
  48. package/dist/collection/components/checkbox/checkbox.js +0 -3
  49. package/dist/collection/components/datetime/datetime.js +12 -6
  50. package/dist/collection/components/datetime/test/hour-cycle/datetime.e2e.js +14 -0
  51. package/dist/collection/components/datetime/utils/data.js +33 -7
  52. package/dist/collection/components/datetime/utils/format.js +27 -10
  53. package/dist/collection/components/datetime/utils/helpers.js +37 -5
  54. package/dist/collection/components/datetime-button/datetime-button.js +4 -4
  55. package/dist/collection/components/nav/nav.js +1 -0
  56. package/dist/collection/components/radio/radio.js +1 -4
  57. package/dist/collection/components/radio-group/radio-group.js +1 -1
  58. package/dist/collection/components/router/router.js +2 -0
  59. package/dist/collection/components/router/utils/path.js +1 -0
  60. package/dist/collection/components/select/select.js +1 -1
  61. package/dist/collection/components/toast/animations/ios.enter.js +2 -3
  62. package/dist/collection/components/toast/animations/ios.leave.js +2 -3
  63. package/dist/collection/components/toast/animations/md.enter.js +2 -3
  64. package/dist/collection/components/toast/animations/utils.js +85 -0
  65. package/dist/collection/components/toast/test/position-anchor/toast.e2e.js +45 -0
  66. package/dist/collection/components/toast/toast.js +98 -9
  67. package/dist/collection/components/toggle/toggle.js +0 -3
  68. package/dist/collection/index.js +1 -0
  69. package/dist/collection/utils/native/haptic.js +1 -0
  70. package/dist/collection/utils/overlays.js +1 -0
  71. package/dist/collection/utils/transition/ios.transition.js +1 -0
  72. package/dist/docs.json +73 -10
  73. package/dist/esm/{button-active-7180a130.js → button-active-3dd473a1.js} +1 -1
  74. package/dist/esm/{data-009dbf15.js → data-44d9e816.js} +96 -22
  75. package/dist/esm/{haptic-6447af60.js → haptic-1243b917.js} +1 -0
  76. package/dist/esm/{index-0b0dd67c.js → index-6e10cd02.js} +2 -2
  77. package/dist/esm/index.js +5 -4
  78. package/dist/esm/ion-action-sheet.entry.js +3 -3
  79. package/dist/esm/ion-alert.entry.js +11 -3
  80. package/dist/esm/ion-app_8.entry.js +1 -1
  81. package/dist/esm/ion-checkbox.entry.js +0 -3
  82. package/dist/esm/ion-datetime-button.entry.js +4 -4
  83. package/dist/esm/ion-datetime_3.entry.js +5 -5
  84. package/dist/esm/ion-loading.entry.js +1 -1
  85. package/dist/esm/ion-menu_3.entry.js +1 -1
  86. package/dist/esm/ion-modal.entry.js +2 -2
  87. package/dist/esm/ion-nav_2.entry.js +2 -1
  88. package/dist/esm/ion-picker-column-internal.entry.js +1 -1
  89. package/dist/esm/ion-popover.entry.js +2 -2
  90. package/dist/esm/ion-radio_2.entry.js +2 -5
  91. package/dist/esm/ion-refresher_2.entry.js +1 -1
  92. package/dist/esm/ion-reorder_2.entry.js +1 -1
  93. package/dist/esm/ion-route_4.entry.js +3 -0
  94. package/dist/esm/ion-select_3.entry.js +2 -2
  95. package/dist/esm/ion-toast.entry.js +157 -15
  96. package/dist/esm/ion-toggle.entry.js +1 -4
  97. package/dist/esm/ionic.js +1 -1
  98. package/dist/esm/{ios.transition-875ba2ea.js → ios.transition-6707a3a1.js} +2 -1
  99. package/dist/esm/loader.js +1 -1
  100. package/dist/esm/{md.transition-54c79f72.js → md.transition-957964fd.js} +1 -1
  101. package/dist/esm/{overlays-84621c0a.js → overlays-753933fc.js} +1 -0
  102. package/dist/esm-es5/{button-active-7180a130.js → button-active-3dd473a1.js} +1 -1
  103. package/dist/esm-es5/data-44d9e816.js +4 -0
  104. package/dist/esm-es5/{index-0b0dd67c.js → index-6e10cd02.js} +1 -1
  105. package/dist/esm-es5/index.js +1 -1
  106. package/dist/esm-es5/ion-action-sheet.entry.js +1 -1
  107. package/dist/esm-es5/ion-alert.entry.js +1 -1
  108. package/dist/esm-es5/ion-app_8.entry.js +1 -1
  109. package/dist/esm-es5/ion-checkbox.entry.js +1 -1
  110. package/dist/esm-es5/ion-datetime-button.entry.js +1 -1
  111. package/dist/esm-es5/ion-datetime_3.entry.js +1 -1
  112. package/dist/esm-es5/ion-loading.entry.js +1 -1
  113. package/dist/esm-es5/ion-menu_3.entry.js +1 -1
  114. package/dist/esm-es5/ion-modal.entry.js +1 -1
  115. package/dist/esm-es5/ion-nav_2.entry.js +1 -1
  116. package/dist/esm-es5/ion-picker-column-internal.entry.js +1 -1
  117. package/dist/esm-es5/ion-popover.entry.js +1 -1
  118. package/dist/esm-es5/ion-radio_2.entry.js +1 -1
  119. package/dist/esm-es5/ion-refresher_2.entry.js +1 -1
  120. package/dist/esm-es5/ion-reorder_2.entry.js +1 -1
  121. package/dist/esm-es5/ion-select_3.entry.js +1 -1
  122. package/dist/esm-es5/ion-toast.entry.js +1 -1
  123. package/dist/esm-es5/ion-toggle.entry.js +1 -1
  124. package/dist/esm-es5/ionic.js +1 -1
  125. package/dist/esm-es5/{ios.transition-875ba2ea.js → ios.transition-6707a3a1.js} +1 -1
  126. package/dist/esm-es5/loader.js +1 -1
  127. package/dist/esm-es5/{md.transition-54c79f72.js → md.transition-957964fd.js} +1 -1
  128. package/dist/html.html-data.json +11 -1
  129. package/dist/ionic/index.esm.js +1 -1
  130. package/dist/ionic/ionic.esm.js +1 -1
  131. package/dist/ionic/{p-2134558d.entry.js → p-0023e6eb.entry.js} +1 -1
  132. package/dist/ionic/{p-0dcdf480.system.entry.js → p-00f709ca.system.entry.js} +1 -1
  133. package/dist/ionic/{p-2330af92.system.entry.js → p-037e2738.system.entry.js} +1 -1
  134. package/dist/ionic/{p-678f37d7.entry.js → p-03f7e3cc.entry.js} +1 -1
  135. package/dist/ionic/{p-8c17d825.js → p-0d198537.js} +1 -1
  136. package/dist/ionic/p-100ea813.system.entry.js +4 -0
  137. package/dist/ionic/{p-f4267847.system.entry.js → p-10fcb3a3.system.entry.js} +1 -1
  138. package/dist/ionic/{p-00d3814a.system.entry.js → p-14fd96a2.system.entry.js} +1 -1
  139. package/dist/ionic/p-17240d90.js +4 -0
  140. package/dist/ionic/{p-af39c1c5.js → p-1d9b39f3.js} +1 -1
  141. package/dist/ionic/{p-a1528344.entry.js → p-2acea831.entry.js} +1 -1
  142. package/dist/ionic/{p-cd075e75.system.entry.js → p-2c9e9915.system.entry.js} +1 -1
  143. package/dist/ionic/{p-979dc719.entry.js → p-44fa0a61.entry.js} +1 -1
  144. package/dist/ionic/p-469d6a98.entry.js +4 -0
  145. package/dist/ionic/p-4965f2d7.entry.js +4 -0
  146. package/dist/ionic/p-520789c2.js +4 -0
  147. package/dist/ionic/{p-24952f8a.system.entry.js → p-5cafe439.system.entry.js} +1 -1
  148. package/dist/ionic/{p-eaa58d23.entry.js → p-60dee335.entry.js} +1 -1
  149. package/dist/ionic/p-68b405cc.entry.js +4 -0
  150. package/dist/ionic/p-73eba881.system.js +1 -1
  151. package/dist/ionic/{p-0c7d0167.system.entry.js → p-7520e873.system.entry.js} +1 -1
  152. package/dist/ionic/{p-df951755.system.entry.js → p-88a1a4fe.system.entry.js} +1 -1
  153. package/dist/ionic/{p-0fc8a522.system.entry.js → p-8957b1de.system.entry.js} +1 -1
  154. package/dist/ionic/{p-9e6bf328.system.js → p-90012797.system.js} +1 -1
  155. package/dist/ionic/{p-4c274938.entry.js → p-93c4333b.entry.js} +1 -1
  156. package/dist/ionic/{p-a8403bed.system.entry.js → p-9736406a.system.entry.js} +1 -1
  157. package/dist/ionic/{p-0e070fbe.entry.js → p-9b796813.entry.js} +1 -1
  158. package/dist/ionic/p-9bd70bd2.entry.js +4 -0
  159. package/dist/ionic/{p-2062958e.js → p-9dbc208c.js} +1 -1
  160. package/dist/ionic/{p-52e5f8f0.system.entry.js → p-a157df46.system.entry.js} +1 -1
  161. package/dist/ionic/{p-a6c52452.entry.js → p-a7361c85.entry.js} +1 -1
  162. package/dist/ionic/{p-d511de89.system.entry.js → p-aa4b083c.system.entry.js} +1 -1
  163. package/dist/ionic/p-aae05032.entry.js +4 -0
  164. package/dist/ionic/{p-e92068d4.system.entry.js → p-ae8121f5.system.entry.js} +1 -1
  165. package/dist/ionic/{p-d17638e9.system.js → p-b25a96b7.system.js} +1 -1
  166. package/dist/ionic/{p-53d4606a.entry.js → p-b4f14d9e.entry.js} +1 -1
  167. package/dist/ionic/p-b8c3f071.system.js +4 -0
  168. package/dist/ionic/p-b92d3bf2.system.js +4 -0
  169. package/dist/ionic/{p-ab37db48.entry.js → p-be02d76a.entry.js} +1 -1
  170. package/dist/ionic/{p-7061fa75.system.entry.js → p-c215a78a.system.entry.js} +1 -1
  171. package/dist/ionic/{p-67e21699.entry.js → p-c42d0ea3.entry.js} +1 -1
  172. package/dist/ionic/{p-32eaa293.entry.js → p-cb16123b.entry.js} +1 -1
  173. package/dist/ionic/p-d0d59328.entry.js +4 -0
  174. package/dist/ionic/{p-b7258ddb.system.js → p-e0f66356.system.js} +1 -1
  175. package/dist/ionic/{p-f1c2678b.system.entry.js → p-e62d80e5.system.entry.js} +1 -1
  176. package/dist/ionic/{p-3d278648.system.entry.js → p-e690be9f.system.entry.js} +1 -1
  177. package/dist/ionic/{p-7c901810.system.js → p-ec25d547.system.js} +1 -1
  178. package/dist/ionic/{p-77b9d68a.system.entry.js → p-fe268c4d.system.entry.js} +1 -1
  179. package/dist/types/components/datetime/datetime-interface.d.ts +1 -0
  180. package/dist/types/components/datetime/datetime.d.ts +2 -2
  181. package/dist/types/components/datetime/utils/data.d.ts +3 -3
  182. package/dist/types/components/datetime/utils/format.d.ts +3 -3
  183. package/dist/types/components/datetime/utils/helpers.d.ts +15 -1
  184. package/dist/types/components/toast/animations/ios.enter.d.ts +2 -1
  185. package/dist/types/components/toast/animations/ios.leave.d.ts +2 -2
  186. package/dist/types/components/toast/animations/md.enter.d.ts +2 -1
  187. package/dist/types/components/toast/animations/utils.d.ts +18 -0
  188. package/dist/types/components/toast/toast-interface.d.ts +11 -0
  189. package/dist/types/components/toast/toast.d.ts +21 -1
  190. package/dist/types/components.d.ts +16 -8
  191. package/dist/types/index.d.ts +1 -0
  192. package/hydrate/index.js +274 -51
  193. package/package.json +4 -5
  194. package/dist/esm-es5/data-009dbf15.js +0 -4
  195. package/dist/ionic/p-07c816fb.entry.js +0 -4
  196. package/dist/ionic/p-15278928.entry.js +0 -4
  197. package/dist/ionic/p-44ef7224.system.js +0 -4
  198. package/dist/ionic/p-63b4ef44.system.entry.js +0 -4
  199. package/dist/ionic/p-775f3749.entry.js +0 -4
  200. package/dist/ionic/p-77872abc.entry.js +0 -4
  201. package/dist/ionic/p-7cfd253c.js +0 -4
  202. package/dist/ionic/p-8b33cfef.entry.js +0 -4
  203. package/dist/ionic/p-c5395981.js +0 -4
  204. package/dist/ionic/p-c9524896.system.js +0 -4
  205. package/dist/ionic/p-d055bba9.entry.js +0 -4
  206. /package/dist/esm-es5/{haptic-6447af60.js → haptic-1243b917.js} +0 -0
  207. /package/dist/esm-es5/{overlays-84621c0a.js → overlays-753933fc.js} +0 -0
  208. /package/dist/ionic/{p-c8ec0d79.system.js → p-82c72668.system.js} +0 -0
  209. /package/dist/ionic/{p-14d7b7e2.system.js → p-b4b4bb29.system.js} +0 -0
  210. /package/dist/ionic/{p-bb6f38ed.js → p-b923f3d7.js} +0 -0
  211. /package/dist/ionic/{p-68a3da51.js → p-ee8881d0.js} +0 -0
package/hydrate/index.js CHANGED
@@ -7149,6 +7149,7 @@ const HapticEngine = {
7149
7149
  * if the browser does not support the Vibrate API.
7150
7150
  */
7151
7151
  if ((capacitor === null || capacitor === void 0 ? void 0 : capacitor.getPlatform()) === 'web') {
7152
+ // eslint-disable-next-line @typescript-eslint/prefer-optional-chain
7152
7153
  return typeof navigator !== 'undefined' && navigator.vibrate !== undefined;
7153
7154
  }
7154
7155
  return true;
@@ -8218,6 +8219,7 @@ const setOverlayId = (el) => {
8218
8219
  return el.id;
8219
8220
  };
8220
8221
  const createOverlay = (tagName, opts) => {
8222
+ // eslint-disable-next-line @typescript-eslint/prefer-optional-chain
8221
8223
  if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined') {
8222
8224
  return window.customElements.whenDefined(tagName).then(() => {
8223
8225
  const element = document.createElement(tagName);
@@ -10546,6 +10548,14 @@ class Alert {
10546
10548
  }
10547
10549
  onKeydown(ev) {
10548
10550
  const inputTypes = new Set(this.processedInputs.map((i) => i.type));
10551
+ /**
10552
+ * Based on keyboard navigation requirements, the
10553
+ * checkbox should not respond to the enter keydown event.
10554
+ */
10555
+ if (inputTypes.has('checkbox') && ev.key === 'Enter') {
10556
+ ev.preventDefault();
10557
+ return;
10558
+ }
10549
10559
  // The only inputs we want to navigate between using arrow keys are the radios
10550
10560
  // ignore the keydown event if it is not on a radio button
10551
10561
  if (!inputTypes.has('radio') ||
@@ -12185,9 +12195,6 @@ class Checkbox {
12185
12195
  this.ionBlur.emit();
12186
12196
  };
12187
12197
  this.onClick = (ev) => {
12188
- if (this.disabled) {
12189
- return;
12190
- }
12191
12198
  this.toggleChecked(ev);
12192
12199
  };
12193
12200
  this.color = undefined;
@@ -13075,13 +13082,19 @@ const warnIfValueOutOfBounds = (value, min, max) => {
13075
13082
  const isLeapYear = (year) => {
13076
13083
  return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
13077
13084
  };
13078
- const is24Hour = (locale, hourCycle) => {
13085
+ /**
13086
+ * Determines the hour cycle for a user.
13087
+ * If the hour cycle is explicitly defined, just use that.
13088
+ * Otherwise, we try to derive it from either the specified
13089
+ * locale extension tags or from Intl.DateTimeFormat directly.
13090
+ */
13091
+ const getHourCycle = (locale, hourCycle) => {
13079
13092
  /**
13080
- * If developer has explicitly enabled h23 time
13093
+ * If developer has explicitly enabled 24-hour time
13081
13094
  * then return early and do not look at the system default.
13082
13095
  */
13083
13096
  if (hourCycle !== undefined) {
13084
- return hourCycle === 'h23';
13097
+ return hourCycle;
13085
13098
  }
13086
13099
  /**
13087
13100
  * If hourCycle was not specified, check the locale
@@ -13092,7 +13105,7 @@ const is24Hour = (locale, hourCycle) => {
13092
13105
  const formatted = new Intl.DateTimeFormat(locale, { hour: 'numeric' });
13093
13106
  const options = formatted.resolvedOptions();
13094
13107
  if (options.hourCycle !== undefined) {
13095
- return options.hourCycle === 'h23';
13108
+ return options.hourCycle;
13096
13109
  }
13097
13110
  /**
13098
13111
  * If hourCycle is not specified (either through lack
@@ -13105,7 +13118,33 @@ const is24Hour = (locale, hourCycle) => {
13105
13118
  if (!hour) {
13106
13119
  throw new Error('Hour value not found from DateTimeFormat');
13107
13120
  }
13108
- return hour.value === '00';
13121
+ /**
13122
+ * Midnight for h11 starts at 0:00am
13123
+ * Midnight for h12 starts at 12:00am
13124
+ * Midnight for h23 starts at 00:00
13125
+ * Midnight for h24 starts at 24:00
13126
+ */
13127
+ switch (hour.value) {
13128
+ case '0':
13129
+ return 'h11';
13130
+ case '12':
13131
+ return 'h12';
13132
+ case '00':
13133
+ return 'h23';
13134
+ case '24':
13135
+ return 'h24';
13136
+ default:
13137
+ throw new Error(`Invalid hour cycle "${hourCycle}"`);
13138
+ }
13139
+ };
13140
+ /**
13141
+ * Determine if the hour cycle uses a 24-hour format.
13142
+ * Returns true for h23 and h24. Returns false otherwise.
13143
+ * If you don't know the hourCycle, use getHourCycle above
13144
+ * and pass the result into this function.
13145
+ */
13146
+ const is24Hour = (hourCycle) => {
13147
+ return hourCycle === 'h23' || hourCycle === 'h24';
13109
13148
  };
13110
13149
  /**
13111
13150
  * Given a date object, returns the number
@@ -13772,7 +13811,7 @@ const getFormattedDayPeriod = (dayPeriod) => {
13772
13811
  }
13773
13812
  return dayPeriod.toUpperCase();
13774
13813
  };
13775
- const getLocalizedTime = (locale, refParts, use24Hour) => {
13814
+ const getLocalizedTime = (locale, refParts, hourCycle) => {
13776
13815
  const timeParts = {
13777
13816
  hour: refParts.hour,
13778
13817
  minute: refParts.minute,
@@ -13794,7 +13833,7 @@ const getLocalizedTime = (locale, refParts, use24Hour) => {
13794
13833
  * We use hourCycle here instead of hour12 due to:
13795
13834
  * https://bugs.chromium.org/p/chromium/issues/detail?id=1347316&q=hour12&can=2
13796
13835
  */
13797
- hourCycle: use24Hour ? 'h23' : 'h12',
13836
+ hourCycle,
13798
13837
  /**
13799
13838
  * Setting Z at the end indicates that this
13800
13839
  * date string is in the UTC time zone. This
@@ -13832,17 +13871,33 @@ const addTimePadding = (value) => {
13832
13871
  * 12 hour times it ensures that
13833
13872
  * hour 0 is formatted as '12'.
13834
13873
  */
13835
- const getFormattedHour = (hour, use24Hour) => {
13836
- if (use24Hour) {
13837
- return addTimePadding(hour);
13838
- }
13874
+ const getFormattedHour = (hour, hourCycle) => {
13839
13875
  /**
13840
- * If using 12 hour
13841
- * format, make sure hour
13842
- * 0 is formatted as '12'.
13876
+ * Midnight for h11 starts at 0:00am
13877
+ * Midnight for h12 starts at 12:00am
13878
+ * Midnight for h23 starts at 00:00
13879
+ * Midnight for h24 starts at 24:00
13843
13880
  */
13844
13881
  if (hour === 0) {
13845
- return '12';
13882
+ switch (hourCycle) {
13883
+ case 'h11':
13884
+ return '0';
13885
+ case 'h12':
13886
+ return '12';
13887
+ case 'h23':
13888
+ return '00';
13889
+ case 'h24':
13890
+ return '24';
13891
+ default:
13892
+ throw new Error(`Invalid hour cycle "${hourCycle}"`);
13893
+ }
13894
+ }
13895
+ const use24Hour = is24Hour(hourCycle);
13896
+ /**
13897
+ * h23 and h24 use 24 hour times.
13898
+ */
13899
+ if (use24Hour) {
13900
+ return addTimePadding(hour);
13846
13901
  }
13847
13902
  return hour.toString();
13848
13903
  };
@@ -14077,8 +14132,14 @@ const minutes = [
14077
14132
  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
14078
14133
  32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
14079
14134
  ];
14135
+ // h11 hour system uses 0-11. Midnight starts at 0:00am.
14136
+ const hour11 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
14137
+ // h12 hour system uses 0-12. Midnight starts at 12:00am.
14080
14138
  const hour12 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
14139
+ // h23 hour system uses 0-23. Midnight starts at 0:00.
14081
14140
  const hour23 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23];
14141
+ // h24 hour system uses 1-24. Midnight starts at 24:00.
14142
+ const hour24 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 0];
14082
14143
  /**
14083
14144
  * Given a locale and a mode,
14084
14145
  * return an array with formatted days
@@ -14147,14 +14208,33 @@ const getDaysOfMonth = (month, year, firstDayOfWeek) => {
14147
14208
  }
14148
14209
  return days;
14149
14210
  };
14211
+ /**
14212
+ * Returns an array of pre-defined hour
14213
+ * values based on the provided hourCycle.
14214
+ */
14215
+ const getHourData = (hourCycle) => {
14216
+ switch (hourCycle) {
14217
+ case 'h11':
14218
+ return hour11;
14219
+ case 'h12':
14220
+ return hour12;
14221
+ case 'h23':
14222
+ return hour23;
14223
+ case 'h24':
14224
+ return hour24;
14225
+ default:
14226
+ throw new Error(`Invalid hour cycle "${hourCycle}"`);
14227
+ }
14228
+ };
14150
14229
  /**
14151
14230
  * Given a local, reference datetime parts and option
14152
14231
  * max/min bound datetime parts, calculate the acceptable
14153
14232
  * hour and minute values according to the bounds and locale.
14154
14233
  */
14155
- const generateTime = (refParts, hourCycle = 'h12', minParts, maxParts, hourValues, minuteValues) => {
14156
- const use24Hour = hourCycle === 'h23';
14157
- let processedHours = use24Hour ? hour23 : hour12;
14234
+ const generateTime = (locale, refParts, hourCycle = 'h12', minParts, maxParts, hourValues, minuteValues) => {
14235
+ const computedHourCycle = getHourCycle(locale, hourCycle);
14236
+ const use24Hour = is24Hour(computedHourCycle);
14237
+ let processedHours = getHourData(computedHourCycle);
14158
14238
  let processedMinutes = minutes;
14159
14239
  let isAMAllowed = true;
14160
14240
  let isPMAllowed = true;
@@ -14486,11 +14566,12 @@ const getCombinedDateColumnData = (locale, todayParts, minParts, maxParts, dayVa
14486
14566
  };
14487
14567
  };
14488
14568
  const getTimeColumnsData = (locale, refParts, hourCycle, minParts, maxParts, allowedHourValues, allowedMinuteValues) => {
14489
- const use24Hour = is24Hour(locale, hourCycle);
14490
- const { hours, minutes, am, pm } = generateTime(refParts, use24Hour ? 'h23' : 'h12', minParts, maxParts, allowedHourValues, allowedMinuteValues);
14569
+ const computedHourCycle = getHourCycle(locale, hourCycle);
14570
+ const use24Hour = is24Hour(computedHourCycle);
14571
+ const { hours, minutes, am, pm } = generateTime(locale, refParts, computedHourCycle, minParts, maxParts, allowedHourValues, allowedMinuteValues);
14491
14572
  const hoursItems = hours.map((hour) => {
14492
14573
  return {
14493
- text: getFormattedHour(hour, use24Hour),
14574
+ text: getFormattedHour(hour, computedHourCycle),
14494
14575
  value: getInternalHourValue(hour, use24Hour, refParts.ampm),
14495
14576
  };
14496
14577
  });
@@ -16053,7 +16134,7 @@ class Datetime {
16053
16134
  }
16054
16135
  renderTimeOverlay() {
16055
16136
  const { hourCycle, isTimePopoverOpen, locale } = this;
16056
- const use24Hour = is24Hour(locale, hourCycle);
16137
+ const computedHourCycle = getHourCycle(locale, hourCycle);
16057
16138
  const activePart = this.getActivePartsWithFallback();
16058
16139
  return [
16059
16140
  hAsync("div", { class: "time-header" }, this.renderTimeLabel()),
@@ -16072,7 +16153,7 @@ class Datetime {
16072
16153
  await popoverRef.onWillDismiss();
16073
16154
  this.isTimePopoverOpen = false;
16074
16155
  }
16075
- } }, getLocalizedTime(locale, activePart, use24Hour)),
16156
+ } }, getLocalizedTime(locale, activePart, computedHourCycle)),
16076
16157
  hAsync("ion-popover", { alignment: "center", translucent: true, overlayIndex: 1, arrow: false, onWillPresent: (ev) => {
16077
16158
  /**
16078
16159
  * Intersection Observers do not consistently fire between Blink and Webkit
@@ -16337,13 +16418,13 @@ class DatetimeButton {
16337
16418
  * warning in the console.
16338
16419
  */
16339
16420
  const firstParsedDatetime = parsedDatetimes[0];
16340
- const use24Hour = is24Hour(locale, hourCycle);
16421
+ const computedHourCycle = getHourCycle(locale, hourCycle);
16341
16422
  this.dateText = this.timeText = undefined;
16342
16423
  switch (datetimePresentation) {
16343
16424
  case 'date-time':
16344
16425
  case 'time-date':
16345
16426
  const dateText = getMonthDayAndYear(locale, firstParsedDatetime);
16346
- const timeText = getLocalizedTime(locale, firstParsedDatetime, use24Hour);
16427
+ const timeText = getLocalizedTime(locale, firstParsedDatetime, computedHourCycle);
16347
16428
  if (preferWheel) {
16348
16429
  this.dateText = `${dateText} ${timeText}`;
16349
16430
  }
@@ -16370,7 +16451,7 @@ class DatetimeButton {
16370
16451
  }
16371
16452
  break;
16372
16453
  case 'time':
16373
- this.timeText = getLocalizedTime(locale, firstParsedDatetime, use24Hour);
16454
+ this.timeText = getLocalizedTime(locale, firstParsedDatetime, computedHourCycle);
16374
16455
  break;
16375
16456
  case 'month-year':
16376
16457
  this.dateText = getMonthAndYear(locale, firstParsedDatetime);
@@ -23985,6 +24066,7 @@ class Nav {
23985
24066
  : undefined;
23986
24067
  const mode = getIonMode$1(this);
23987
24068
  const enteringEl = enteringView.element;
24069
+ // eslint-disable-next-line @typescript-eslint/prefer-optional-chain
23988
24070
  const leavingEl = leavingView && leavingView.element;
23989
24071
  const animationOpts = Object.assign(Object.assign({ mode, showGoBack: this.canGoBackSync(enteringView), baseEl: this.el, progressCallback, animated: this.animated && config.getBoolean('animated', true), enteringEl,
23990
24072
  leavingEl }, opts), { animationBuilder: opts.animationBuilder || this.animation || config.get('navAnimation') });
@@ -27195,10 +27277,7 @@ class Radio {
27195
27277
  }
27196
27278
  };
27197
27279
  this.onClick = () => {
27198
- const { radioGroup, checked, disabled } = this;
27199
- if (disabled) {
27200
- return;
27201
- }
27280
+ const { radioGroup, checked } = this;
27202
27281
  /**
27203
27282
  * The legacy control uses a native input inside
27204
27283
  * of the radio host, so we can set this.checked
@@ -27419,7 +27498,7 @@ class RadioGroup {
27419
27498
  * using the `name` attribute.
27420
27499
  */
27421
27500
  const selectedRadio = ev.target && ev.target.closest('ion-radio');
27422
- if (selectedRadio && selectedRadio.disabled === false) {
27501
+ if (selectedRadio) {
27423
27502
  const currentValue = this.value;
27424
27503
  const newValue = selectedRadio.value;
27425
27504
  if (newValue !== currentValue) {
@@ -29746,6 +29825,7 @@ const chainToSegments = (chain) => {
29746
29825
  for (const route of chain) {
29747
29826
  for (const segment of route.segments) {
29748
29827
  if (segment[0] === ':') {
29828
+ // eslint-disable-next-line @typescript-eslint/prefer-optional-chain
29749
29829
  const param = route.params && route.params[segment.slice(1)];
29750
29830
  if (!param) {
29751
29831
  return null;
@@ -30441,12 +30521,14 @@ class Router {
30441
30521
  }
30442
30522
  const routes = readRoutes(this.el);
30443
30523
  const fromChain = findChainForSegments(from, routes);
30524
+ // eslint-disable-next-line @typescript-eslint/prefer-optional-chain
30444
30525
  const beforeLeaveHook = fromChain && fromChain[fromChain.length - 1].beforeLeave;
30445
30526
  const canLeave = beforeLeaveHook ? await beforeLeaveHook() : true;
30446
30527
  if (canLeave === false || typeof canLeave === 'object') {
30447
30528
  return canLeave;
30448
30529
  }
30449
30530
  const toChain = findChainForSegments(to, routes);
30531
+ // eslint-disable-next-line @typescript-eslint/prefer-optional-chain
30450
30532
  const beforeEnterHook = toChain && toChain[toChain.length - 1].beforeEnter;
30451
30533
  return beforeEnterHook ? beforeEnterHook() : true;
30452
30534
  }
@@ -32332,7 +32414,7 @@ Developers can use the "legacy" property to continue using the legacy form marku
32332
32414
  }
32333
32415
  renderListbox() {
32334
32416
  const { disabled, inputId, isExpanded } = this;
32335
- return (hAsync("button", { disabled: disabled, id: inputId, "aria-label": this.ariaLabel, "aria-haspopup": "listbox", "aria-expanded": `${isExpanded}`, onFocus: this.onFocus, onBlur: this.onBlur, ref: (focusEl) => (this.focusEl = focusEl) }));
32417
+ return (hAsync("button", { disabled: disabled, id: inputId, "aria-label": this.ariaLabel, "aria-haspopup": "dialog", "aria-expanded": `${isExpanded}`, onFocus: this.onFocus, onBlur: this.onBlur, ref: (focusEl) => (this.focusEl = focusEl) }));
32336
32418
  }
32337
32419
  render() {
32338
32420
  const { legacyFormController } = this;
@@ -33674,13 +33756,12 @@ class Thumbnail {
33674
33756
  /**
33675
33757
  * iOS Toast Enter Animation
33676
33758
  */
33677
- const iosEnterAnimation = (baseEl, position) => {
33759
+ const iosEnterAnimation = (baseEl, opts) => {
33678
33760
  const baseAnimation = createAnimation();
33679
33761
  const wrapperAnimation = createAnimation();
33762
+ const { position, top, bottom } = opts;
33680
33763
  const root = getElementRoot(baseEl);
33681
33764
  const wrapperEl = root.querySelector('.toast-wrapper');
33682
- const bottom = `calc(-10px - var(--ion-safe-area-bottom, 0px))`;
33683
- const top = `calc(10px + var(--ion-safe-area-top, 0px))`;
33684
33765
  wrapperAnimation.addElement(wrapperEl);
33685
33766
  switch (position) {
33686
33767
  case 'top':
@@ -33701,13 +33782,12 @@ const iosEnterAnimation = (baseEl, position) => {
33701
33782
  /**
33702
33783
  * iOS Toast Leave Animation
33703
33784
  */
33704
- const iosLeaveAnimation = (baseEl, position) => {
33785
+ const iosLeaveAnimation = (baseEl, opts) => {
33705
33786
  const baseAnimation = createAnimation();
33706
33787
  const wrapperAnimation = createAnimation();
33788
+ const { position, top, bottom } = opts;
33707
33789
  const root = getElementRoot(baseEl);
33708
33790
  const wrapperEl = root.querySelector('.toast-wrapper');
33709
- const bottom = `calc(-10px - var(--ion-safe-area-bottom, 0px))`;
33710
- const top = `calc(10px + var(--ion-safe-area-top, 0px))`;
33711
33791
  wrapperAnimation.addElement(wrapperEl);
33712
33792
  switch (position) {
33713
33793
  case 'top':
@@ -33726,13 +33806,12 @@ const iosLeaveAnimation = (baseEl, position) => {
33726
33806
  /**
33727
33807
  * MD Toast Enter Animation
33728
33808
  */
33729
- const mdEnterAnimation = (baseEl, position) => {
33809
+ const mdEnterAnimation = (baseEl, opts) => {
33730
33810
  const baseAnimation = createAnimation();
33731
33811
  const wrapperAnimation = createAnimation();
33812
+ const { position, top, bottom } = opts;
33732
33813
  const root = getElementRoot(baseEl);
33733
33814
  const wrapperEl = root.querySelector('.toast-wrapper');
33734
- const bottom = `calc(8px + var(--ion-safe-area-bottom, 0px))`;
33735
- const top = `calc(8px + var(--ion-safe-area-top, 0px))`;
33736
33815
  wrapperAnimation.addElement(wrapperEl);
33737
33816
  switch (position) {
33738
33817
  case 'top':
@@ -33764,6 +33843,87 @@ const mdLeaveAnimation = (baseEl) => {
33764
33843
  return baseAnimation.easing('cubic-bezier(.36,.66,.04,1)').duration(300).addAnimation(wrapperAnimation);
33765
33844
  };
33766
33845
 
33846
+ /**
33847
+ * Calculate the CSS top and bottom position of the toast, to be used
33848
+ * as starting points for the animation keyframes.
33849
+ *
33850
+ * Note that MD animates bottom-positioned toasts using style.bottom,
33851
+ * which calculates from the bottom edge of the screen, while iOS uses
33852
+ * translateY, which calculates from the top edge of the screen. This
33853
+ * is why the bottom calculates differ slightly between modes.
33854
+ *
33855
+ * @param position The value of the toast's position prop.
33856
+ * @param positionAnchor The element the toast should be anchored to,
33857
+ * if applicable.
33858
+ * @param mode The toast component's mode (md, ios, etc).
33859
+ * @param toast A reference to the toast element itself.
33860
+ */
33861
+ function getAnimationPosition(position, positionAnchor, mode, toast) {
33862
+ /**
33863
+ * Start with a predefined offset from the edge the toast will be
33864
+ * positioned relative to, whether on the screen or anchor element.
33865
+ */
33866
+ let offset;
33867
+ if (mode === 'md') {
33868
+ offset = 8;
33869
+ }
33870
+ else {
33871
+ offset = position === 'top' ? 10 : -10;
33872
+ }
33873
+ /**
33874
+ * If positionAnchor is defined, add in the distance from the target
33875
+ * screen edge to the target anchor edge. For position="top", the
33876
+ * bottom anchor edge is targeted. For position="bottom", the top
33877
+ * anchor edge is targeted.
33878
+ */
33879
+ if (positionAnchor && win$1) {
33880
+ warnIfAnchorIsHidden(positionAnchor, toast);
33881
+ const box = positionAnchor.getBoundingClientRect();
33882
+ if (position === 'top') {
33883
+ offset += box.bottom;
33884
+ }
33885
+ else if (position === 'bottom') {
33886
+ /**
33887
+ * Just box.top is the distance from the top edge of the screen
33888
+ * to the top edge of the anchor. We want to calculate from the
33889
+ * bottom edge of the screen instead.
33890
+ */
33891
+ if (mode === 'md') {
33892
+ offset += win$1.innerHeight - box.top;
33893
+ }
33894
+ else {
33895
+ offset -= win$1.innerHeight - box.top;
33896
+ }
33897
+ }
33898
+ /**
33899
+ * We don't include safe area here because that should already be
33900
+ * accounted for when checking the position of the anchor.
33901
+ */
33902
+ return {
33903
+ top: `${offset}px`,
33904
+ bottom: `${offset}px`,
33905
+ };
33906
+ }
33907
+ else {
33908
+ return {
33909
+ top: `calc(${offset}px + var(--ion-safe-area-top, 0px))`,
33910
+ bottom: mode === 'md'
33911
+ ? `calc(${offset}px + var(--ion-safe-area-bottom, 0px))`
33912
+ : `calc(${offset}px - var(--ion-safe-area-bottom, 0px))`,
33913
+ };
33914
+ }
33915
+ }
33916
+ /**
33917
+ * If the anchor element is hidden, getBoundingClientRect()
33918
+ * will return all 0s for it, which can cause unexpected
33919
+ * results in the position calculation when animating.
33920
+ */
33921
+ function warnIfAnchorIsHidden(positionAnchor, toast) {
33922
+ if (positionAnchor.offsetParent === null) {
33923
+ printIonWarning('The positionAnchor element for ion-toast was found in the DOM, but appears to be hidden. This may lead to unexpected positioning of the toast.', toast);
33924
+ }
33925
+ }
33926
+
33767
33927
  const toastIosCss = "/*!@:host*/.sc-ion-toast-ios-h{--border-width:0;--border-style:none;--border-color:initial;--box-shadow:none;--min-width:auto;--width:auto;--min-height:auto;--height:auto;--max-height:auto;--white-space:normal;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;color:var(--color);font-family:var(--ion-font-family, inherit);contain:strict;z-index:1001;pointer-events:none}@supports (inset-inline-start: 0){/*!@:host*/.sc-ion-toast-ios-h{inset-inline-start:0}}@supports not (inset-inline-start: 0){/*!@:host*/.sc-ion-toast-ios-h{left:0}/*!@:host-context([dir=rtl])*/[dir=rtl].sc-ion-toast-ios-h,[dir=rtl] .sc-ion-toast-ios-h{left:unset;right:unset;right:0}/*!@@supports selector(:dir(rtl))*/@supports .sc-ion-toast-ios selector(.sc-ion-toast-ios:dir(rtl)){.sc-ion-toast-ios-h:dir(rtl){left:unset;right:unset;right:0}}}/*!@:host(.overlay-hidden)*/.overlay-hidden.sc-ion-toast-ios-h{display:none}/*!@:host(.ion-color)*/.ion-color.sc-ion-toast-ios-h{--button-color:inherit;color:var(--ion-color-contrast)}/*!@:host(.ion-color) .toast-button-cancel*/.ion-color.sc-ion-toast-ios-h .toast-button-cancel.sc-ion-toast-ios{color:inherit}/*!@:host(.ion-color) .toast-wrapper*/.ion-color.sc-ion-toast-ios-h .toast-wrapper.sc-ion-toast-ios{background:var(--ion-color-base)}/*!@.toast-wrapper*/.toast-wrapper.sc-ion-toast-ios{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow)}@supports (inset-inline-start: 0){/*!@.toast-wrapper*/.toast-wrapper.sc-ion-toast-ios{inset-inline-start:var(--start);inset-inline-end:var(--end)}}@supports not (inset-inline-start: 0){/*!@.toast-wrapper*/.toast-wrapper.sc-ion-toast-ios{left:var(--start);right:var(--end)}/*!@:host-context([dir=rtl]) .toast-wrapper*/[dir=rtl].sc-ion-toast-ios-h .toast-wrapper.sc-ion-toast-ios,[dir=rtl] .sc-ion-toast-ios-h .toast-wrapper.sc-ion-toast-ios{left:unset;right:unset;left:var(--end);right:var(--start)}/*!@[dir=rtl] .toast-wrapper*/[dir=rtl].sc-ion-toast-ios .toast-wrapper.sc-ion-toast-ios{left:unset;right:unset;left:var(--end);right:var(--start)}/*!@@supports selector(:dir(rtl))*/@supports .sc-ion-toast-ios selector(.sc-ion-toast-ios:dir(rtl)){.toast-wrapper:dir(rtl){left:unset;right:unset;left:var(--end);right:var(--start)}}}/*!@.toast-container*/.toast-container.sc-ion-toast-ios{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;pointer-events:auto;height:inherit;min-height:inherit;max-height:inherit;contain:content}/*!@.toast-layout-stacked .toast-container*/.toast-layout-stacked.sc-ion-toast-ios .toast-container.sc-ion-toast-ios{-ms-flex-wrap:wrap;flex-wrap:wrap}/*!@.toast-layout-baseline .toast-content*/.toast-layout-baseline.sc-ion-toast-ios .toast-content.sc-ion-toast-ios{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center}/*!@.toast-icon*/.toast-icon.sc-ion-toast-ios{-webkit-margin-start:16px;margin-inline-start:16px}/*!@.toast-message*/.toast-message.sc-ion-toast-ios{-ms-flex:1;flex:1;white-space:var(--white-space)}/*!@.toast-button-group*/.toast-button-group.sc-ion-toast-ios{display:-ms-flexbox;display:flex}/*!@.toast-layout-stacked .toast-button-group*/.toast-layout-stacked.sc-ion-toast-ios .toast-button-group.sc-ion-toast-ios{-ms-flex-pack:end;justify-content:end;width:100%}/*!@.toast-button*/.toast-button.sc-ion-toast-ios{border:0;outline:none;color:var(--button-color);z-index:0}/*!@.toast-icon,\n.toast-button-icon*/.toast-icon.sc-ion-toast-ios,.toast-button-icon.sc-ion-toast-ios{font-size:1.4em}/*!@.toast-button-inner*/.toast-button-inner.sc-ion-toast-ios{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}@media (any-hover: hover){/*!@.toast-button:hover*/.toast-button.sc-ion-toast-ios:hover{cursor:pointer}}/*!@:host*/.sc-ion-toast-ios-h{--background:var(--ion-color-step-50, #f2f2f2);--border-radius:14px;--button-color:var(--ion-color-primary, #3880ff);--color:var(--ion-color-step-850, #262626);--max-width:700px;--start:10px;--end:10px;font-size:14px}/*!@.toast-wrapper*/.toast-wrapper.sc-ion-toast-ios{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:auto;margin-bottom:auto;display:block;position:absolute;z-index:10}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){/*!@:host(.toast-translucent) .toast-wrapper*/.toast-translucent.sc-ion-toast-ios-h .toast-wrapper.sc-ion-toast-ios{background:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px)}/*!@:host(.ion-color.toast-translucent) .toast-wrapper*/.ion-color.toast-translucent.sc-ion-toast-ios-h .toast-wrapper.sc-ion-toast-ios{background:rgba(var(--ion-color-base-rgb), 0.8)}}/*!@.toast-wrapper.toast-top*/.toast-wrapper.toast-top.sc-ion-toast-ios{-webkit-transform:translate3d(0, -100%, 0);transform:translate3d(0, -100%, 0);top:0}/*!@.toast-wrapper.toast-middle*/.toast-wrapper.toast-middle.sc-ion-toast-ios{opacity:0.01}/*!@.toast-wrapper.toast-bottom*/.toast-wrapper.toast-bottom.sc-ion-toast-ios{-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);bottom:0}/*!@.toast-content*/.toast-content.sc-ion-toast-ios{-webkit-padding-start:15px;padding-inline-start:15px;-webkit-padding-end:15px;padding-inline-end:15px;padding-top:15px;padding-bottom:15px}/*!@.toast-header*/.toast-header.sc-ion-toast-ios{margin-bottom:2px;font-weight:500}/*!@.toast-button*/.toast-button.sc-ion-toast-ios{-webkit-padding-start:15px;padding-inline-start:15px;-webkit-padding-end:15px;padding-inline-end:15px;padding-top:10px;padding-bottom:10px;height:44px;-webkit-transition:background-color, opacity 100ms linear;transition:background-color, opacity 100ms linear;border:0;background-color:transparent;font-family:var(--ion-font-family);font-size:17px;font-weight:500;overflow:hidden}/*!@.toast-button.ion-activated*/.toast-button.ion-activated.sc-ion-toast-ios{opacity:0.4}@media (any-hover: hover){/*!@.toast-button:hover*/.toast-button.sc-ion-toast-ios:hover{opacity:0.6}}";
33768
33928
 
33769
33929
  const toastMdCss = "/*!@:host*/.sc-ion-toast-md-h{--border-width:0;--border-style:none;--border-color:initial;--box-shadow:none;--min-width:auto;--width:auto;--min-height:auto;--height:auto;--max-height:auto;--white-space:normal;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;color:var(--color);font-family:var(--ion-font-family, inherit);contain:strict;z-index:1001;pointer-events:none}@supports (inset-inline-start: 0){/*!@:host*/.sc-ion-toast-md-h{inset-inline-start:0}}@supports not (inset-inline-start: 0){/*!@:host*/.sc-ion-toast-md-h{left:0}/*!@:host-context([dir=rtl])*/[dir=rtl].sc-ion-toast-md-h,[dir=rtl] .sc-ion-toast-md-h{left:unset;right:unset;right:0}/*!@@supports selector(:dir(rtl))*/@supports .sc-ion-toast-md selector(.sc-ion-toast-md:dir(rtl)){.sc-ion-toast-md-h:dir(rtl){left:unset;right:unset;right:0}}}/*!@:host(.overlay-hidden)*/.overlay-hidden.sc-ion-toast-md-h{display:none}/*!@:host(.ion-color)*/.ion-color.sc-ion-toast-md-h{--button-color:inherit;color:var(--ion-color-contrast)}/*!@:host(.ion-color) .toast-button-cancel*/.ion-color.sc-ion-toast-md-h .toast-button-cancel.sc-ion-toast-md{color:inherit}/*!@:host(.ion-color) .toast-wrapper*/.ion-color.sc-ion-toast-md-h .toast-wrapper.sc-ion-toast-md{background:var(--ion-color-base)}/*!@.toast-wrapper*/.toast-wrapper.sc-ion-toast-md{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow)}@supports (inset-inline-start: 0){/*!@.toast-wrapper*/.toast-wrapper.sc-ion-toast-md{inset-inline-start:var(--start);inset-inline-end:var(--end)}}@supports not (inset-inline-start: 0){/*!@.toast-wrapper*/.toast-wrapper.sc-ion-toast-md{left:var(--start);right:var(--end)}/*!@:host-context([dir=rtl]) .toast-wrapper*/[dir=rtl].sc-ion-toast-md-h .toast-wrapper.sc-ion-toast-md,[dir=rtl] .sc-ion-toast-md-h .toast-wrapper.sc-ion-toast-md{left:unset;right:unset;left:var(--end);right:var(--start)}/*!@[dir=rtl] .toast-wrapper*/[dir=rtl].sc-ion-toast-md .toast-wrapper.sc-ion-toast-md{left:unset;right:unset;left:var(--end);right:var(--start)}/*!@@supports selector(:dir(rtl))*/@supports .sc-ion-toast-md selector(.sc-ion-toast-md:dir(rtl)){.toast-wrapper:dir(rtl){left:unset;right:unset;left:var(--end);right:var(--start)}}}/*!@.toast-container*/.toast-container.sc-ion-toast-md{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;pointer-events:auto;height:inherit;min-height:inherit;max-height:inherit;contain:content}/*!@.toast-layout-stacked .toast-container*/.toast-layout-stacked.sc-ion-toast-md .toast-container.sc-ion-toast-md{-ms-flex-wrap:wrap;flex-wrap:wrap}/*!@.toast-layout-baseline .toast-content*/.toast-layout-baseline.sc-ion-toast-md .toast-content.sc-ion-toast-md{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center}/*!@.toast-icon*/.toast-icon.sc-ion-toast-md{-webkit-margin-start:16px;margin-inline-start:16px}/*!@.toast-message*/.toast-message.sc-ion-toast-md{-ms-flex:1;flex:1;white-space:var(--white-space)}/*!@.toast-button-group*/.toast-button-group.sc-ion-toast-md{display:-ms-flexbox;display:flex}/*!@.toast-layout-stacked .toast-button-group*/.toast-layout-stacked.sc-ion-toast-md .toast-button-group.sc-ion-toast-md{-ms-flex-pack:end;justify-content:end;width:100%}/*!@.toast-button*/.toast-button.sc-ion-toast-md{border:0;outline:none;color:var(--button-color);z-index:0}/*!@.toast-icon,\n.toast-button-icon*/.toast-icon.sc-ion-toast-md,.toast-button-icon.sc-ion-toast-md{font-size:1.4em}/*!@.toast-button-inner*/.toast-button-inner.sc-ion-toast-md{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}@media (any-hover: hover){/*!@.toast-button:hover*/.toast-button.sc-ion-toast-md:hover{cursor:pointer}}/*!@:host*/.sc-ion-toast-md-h{--background:var(--ion-color-step-800, #333333);--border-radius:4px;--box-shadow:0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12);--button-color:var(--ion-color-primary, #3880ff);--color:var(--ion-color-step-50, #f2f2f2);--max-width:700px;--start:8px;--end:8px;font-size:14px}/*!@.toast-wrapper*/.toast-wrapper.sc-ion-toast-md{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:auto;margin-bottom:auto;display:block;position:absolute;opacity:0.01;z-index:10}/*!@.toast-content*/.toast-content.sc-ion-toast-md{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:14px;padding-bottom:14px}/*!@.toast-header*/.toast-header.sc-ion-toast-md{margin-bottom:2px;font-weight:500;line-height:20px}/*!@.toast-message*/.toast-message.sc-ion-toast-md{line-height:20px}/*!@.toast-layout-baseline .toast-button-group-start*/.toast-layout-baseline.sc-ion-toast-md .toast-button-group-start.sc-ion-toast-md{-webkit-margin-start:8px;margin-inline-start:8px}/*!@.toast-layout-stacked .toast-button-group-start*/.toast-layout-stacked.sc-ion-toast-md .toast-button-group-start.sc-ion-toast-md{-webkit-margin-end:8px;margin-inline-end:8px;margin-top:8px}/*!@.toast-layout-baseline .toast-button-group-end*/.toast-layout-baseline.sc-ion-toast-md .toast-button-group-end.sc-ion-toast-md{-webkit-margin-end:8px;margin-inline-end:8px}/*!@.toast-layout-stacked .toast-button-group-end*/.toast-layout-stacked.sc-ion-toast-md .toast-button-group-end.sc-ion-toast-md{-webkit-margin-end:8px;margin-inline-end:8px;margin-bottom:8px}/*!@.toast-button*/.toast-button.sc-ion-toast-md{-webkit-padding-start:15px;padding-inline-start:15px;-webkit-padding-end:15px;padding-inline-end:15px;padding-top:10px;padding-bottom:10px;position:relative;background-color:transparent;font-family:var(--ion-font-family);font-size:14px;font-weight:500;letter-spacing:0.84px;text-transform:uppercase;overflow:hidden}/*!@.toast-button-cancel*/.toast-button-cancel.sc-ion-toast-md{color:var(--ion-color-step-100, #e6e6e6)}/*!@.toast-button-icon-only*/.toast-button-icon-only.sc-ion-toast-md{border-radius:50%;-webkit-padding-start:9px;padding-inline-start:9px;-webkit-padding-end:9px;padding-inline-end:9px;padding-top:9px;padding-bottom:9px;width:36px;height:36px}@media (any-hover: hover){/*!@.toast-button:hover*/.toast-button.sc-ion-toast-md:hover{background-color:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.08)}/*!@.toast-button-cancel:hover*/.toast-button-cancel.sc-ion-toast-md:hover{background-color:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.08)}}";
@@ -33816,6 +33976,7 @@ class Toast {
33816
33976
  this.message = undefined;
33817
33977
  this.keyboardClose = false;
33818
33978
  this.position = 'bottom';
33979
+ this.positionAnchor = undefined;
33819
33980
  this.buttons = undefined;
33820
33981
  this.translucent = false;
33821
33982
  this.animated = true;
@@ -33863,7 +34024,19 @@ class Toast {
33863
34024
  async present() {
33864
34025
  const unlock = await this.lockController.lock();
33865
34026
  await this.delegateController.attachViewToDom();
33866
- await present(this, 'toastEnter', iosEnterAnimation, mdEnterAnimation, this.position);
34027
+ const { el, position } = this;
34028
+ const anchor = this.getAnchorElement();
34029
+ const animationPosition = getAnimationPosition(position, anchor, getIonMode$1(this), el);
34030
+ /**
34031
+ * Cache the calculated position of the toast, so we can re-use it
34032
+ * in the dismiss animation.
34033
+ */
34034
+ this.lastPresentedPosition = animationPosition;
34035
+ await present(this, 'toastEnter', iosEnterAnimation, mdEnterAnimation, {
34036
+ position,
34037
+ top: animationPosition.top,
34038
+ bottom: animationPosition.bottom,
34039
+ });
33867
34040
  /**
33868
34041
  * Content is revealed to screen readers after
33869
34042
  * the transition to avoid jank since this
@@ -33885,15 +34058,28 @@ class Toast {
33885
34058
  * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
33886
34059
  */
33887
34060
  async dismiss(data, role) {
34061
+ var _a, _b;
33888
34062
  const unlock = await this.lockController.lock();
33889
- if (this.durationTimeout) {
33890
- clearTimeout(this.durationTimeout);
34063
+ const { durationTimeout, position, lastPresentedPosition } = this;
34064
+ if (durationTimeout) {
34065
+ clearTimeout(durationTimeout);
33891
34066
  }
33892
- const dismissed = await dismiss(this, data, role, 'toastLeave', iosLeaveAnimation, mdLeaveAnimation, this.position);
34067
+ const dismissed = await dismiss(this, data, role, 'toastLeave', iosLeaveAnimation, mdLeaveAnimation,
34068
+ /**
34069
+ * Fetch the cached position that was calculated back in the present
34070
+ * animation. We always want to animate the dismiss from the same
34071
+ * position the present stopped at, so the animation looks continuous.
34072
+ */
34073
+ {
34074
+ position,
34075
+ top: (_a = lastPresentedPosition === null || lastPresentedPosition === void 0 ? void 0 : lastPresentedPosition.top) !== null && _a !== void 0 ? _a : '',
34076
+ bottom: (_b = lastPresentedPosition === null || lastPresentedPosition === void 0 ? void 0 : lastPresentedPosition.bottom) !== null && _b !== void 0 ? _b : '',
34077
+ });
33893
34078
  if (dismissed) {
33894
34079
  this.delegateController.removeViewFromDom();
33895
34080
  this.revealContentToScreenReader = false;
33896
34081
  }
34082
+ this.lastPresentedPosition = undefined;
33897
34083
  unlock();
33898
34084
  return dismissed;
33899
34085
  }
@@ -33917,6 +34103,44 @@ class Toast {
33917
34103
  : [];
33918
34104
  return buttons;
33919
34105
  }
34106
+ /**
34107
+ * Returns the element specified by the positionAnchor prop,
34108
+ * or undefined if prop's value is an ID string and the element
34109
+ * is not found in the DOM.
34110
+ */
34111
+ getAnchorElement() {
34112
+ const { position, positionAnchor, el } = this;
34113
+ /**
34114
+ * If positionAnchor is undefined then
34115
+ * no anchor should be used when presenting the toast.
34116
+ */
34117
+ if (positionAnchor === undefined) {
34118
+ return;
34119
+ }
34120
+ if (position === 'middle' && positionAnchor !== undefined) {
34121
+ printIonWarning('The positionAnchor property is ignored when using position="middle".', this.el);
34122
+ return undefined;
34123
+ }
34124
+ if (typeof positionAnchor === 'string') {
34125
+ /**
34126
+ * If the anchor is defined as an ID, find the element.
34127
+ * We do this on every present so the toast doesn't need
34128
+ * to account for the surrounding DOM changing since the
34129
+ * last time it was presented.
34130
+ */
34131
+ const foundEl = document.getElementById(positionAnchor);
34132
+ if (foundEl === null) {
34133
+ printIonWarning(`An anchor element with an ID of "${positionAnchor}" was not found in the DOM.`, el);
34134
+ return undefined;
34135
+ }
34136
+ return foundEl;
34137
+ }
34138
+ if (positionAnchor instanceof HTMLElement) {
34139
+ return positionAnchor;
34140
+ }
34141
+ printIonWarning('Invalid positionAnchor value:', positionAnchor, el);
34142
+ return undefined;
34143
+ }
33920
34144
  async buttonClick(button) {
33921
34145
  const role = button.role;
33922
34146
  if (isCancel(role)) {
@@ -34024,6 +34248,7 @@ class Toast {
34024
34248
  "message": [1],
34025
34249
  "keyboardClose": [4, "keyboard-close"],
34026
34250
  "position": [1],
34251
+ "positionAnchor": [1, "position-anchor"],
34027
34252
  "buttons": [16],
34028
34253
  "translucent": [4],
34029
34254
  "animated": [4],
@@ -34091,9 +34316,6 @@ class Toggle {
34091
34316
  }
34092
34317
  };
34093
34318
  this.onClick = (ev) => {
34094
- if (this.disabled) {
34095
- return;
34096
- }
34097
34319
  ev.preventDefault();
34098
34320
  if (this.lastDrag + 300 < Date.now()) {
34099
34321
  this.toggleChecked();
@@ -34744,6 +34966,7 @@ const iosTransitionAnimation = (navEl, opts) => {
34744
34966
  .easing(opts.easing || EASING)
34745
34967
  .fill('both')
34746
34968
  .beforeRemoveClass('ion-page-invisible');
34969
+ // eslint-disable-next-line @typescript-eslint/prefer-optional-chain
34747
34970
  if (leavingEl && navEl !== null && navEl !== undefined) {
34748
34971
  const navDecorAnimation = createAnimation();
34749
34972
  navDecorAnimation.addElement(navEl);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ionic/core",
3
- "version": "7.4.4-dev.11696956070.1faa3cfe",
3
+ "version": "7.4.4-dev.11699471770.1b7273c4",
4
4
  "description": "Base components for Ionic",
5
5
  "keywords": [
6
6
  "ionic",
@@ -53,8 +53,8 @@
53
53
  "@stencil/vue-output-target": "^0.8.6",
54
54
  "@types/jest": "^27.5.2",
55
55
  "@types/node": "^14.6.0",
56
- "@typescript-eslint/eslint-plugin": "^5.17.0",
57
- "@typescript-eslint/parser": "^5.17.0",
56
+ "@typescript-eslint/eslint-plugin": "^6.7.2",
57
+ "@typescript-eslint/parser": "^6.7.2",
58
58
  "clean-css-cli": "^5.6.1",
59
59
  "domino": "^2.1.6",
60
60
  "eslint": "^7.32.0",
@@ -69,8 +69,7 @@
69
69
  "sass": "^1.26.10",
70
70
  "serve": "^14.0.1",
71
71
  "stylelint": "^13.13.1",
72
- "stylelint-order": "^4.1.0",
73
- "typescript": "^4.0.5"
72
+ "stylelint-order": "^4.1.0"
74
73
  },
75
74
  "scripts": {
76
75
  "build": "npm run clean && npm run build.css && stencil build --es5 --docs-json dist/docs.json",