@pod-os/elements 0.7.0 → 0.7.1-2196a40.0

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 (409) hide show
  1. package/dist/cjs/{animation-5840e4df.js → animation-9bea118f.js} +115 -84
  2. package/dist/cjs/{app-globals-1aedd05c.js → app-globals-6352043e.js} +1 -1
  3. package/dist/cjs/{cubic-bezier-dcb7bfef.js → cubic-bezier-0b702a31.js} +13 -12
  4. package/dist/cjs/data-0c9489d7.js +1510 -0
  5. package/dist/cjs/dir-011f46ea.js +20 -0
  6. package/dist/cjs/elements.cjs.js +4 -4
  7. package/dist/cjs/focus-visible-2624ec15.js +76 -0
  8. package/dist/cjs/framework-delegate-437c0645.js +119 -0
  9. package/dist/cjs/{gesture-controller-fbbe9a65.js → gesture-controller-00a6b02f.js} +6 -2
  10. package/dist/cjs/{haptic-09e73337.js → haptic-7358cb0b.js} +37 -8
  11. package/dist/cjs/{hardware-back-button-01027575.js → hardware-back-button-25372ec7.js} +11 -8
  12. package/dist/cjs/{helpers-398ced09.js → helpers-cb08f5ae.js} +115 -15
  13. package/dist/cjs/{index-2067b305.js → index-1b07c737.js} +35 -24
  14. package/dist/cjs/{index-68ae43d2.js → index-2dc3637c.js} +34 -28
  15. package/dist/cjs/index-57b9fa9e.js +30 -0
  16. package/dist/cjs/{index-d01d9183.js → index-643851c6.js} +34 -19
  17. package/dist/cjs/index-731691ca.js +48 -0
  18. package/dist/cjs/{index-6bbae9b1.js → index-7d56774d.js} +12 -8
  19. package/dist/cjs/index-9fca5d6f.js +140 -0
  20. package/dist/cjs/index-b2a479e4.js +38 -0
  21. package/dist/cjs/{index-b4a9ece2.js → index-eaa0d16e.js} +7 -0
  22. package/dist/cjs/{tap-click-f24cb477.js → index-ed2ce04f.js} +37 -19
  23. package/dist/cjs/{input-shims-e959d9e2.js → input-shims-427999f7.js} +89 -38
  24. package/dist/cjs/ion-accordion-group.cjs.entry.js +205 -0
  25. package/dist/cjs/ion-accordion.cjs.entry.js +336 -0
  26. package/dist/cjs/ion-action-sheet_3.cjs.entry.js +865 -0
  27. package/dist/cjs/{ion-app_45.cjs.entry.js → ion-app_46.cjs.entry.js} +1694 -1406
  28. package/dist/cjs/ion-avatar.cjs.entry.js +2 -2
  29. package/dist/cjs/ion-back-button.cjs.entry.js +12 -11
  30. package/dist/cjs/ion-backdrop.cjs.entry.js +4 -4
  31. package/dist/cjs/ion-breadcrumb.cjs.entry.js +101 -0
  32. package/dist/cjs/ion-breadcrumbs.cjs.entry.js +133 -0
  33. package/dist/cjs/ion-buttons_3.cjs.entry.js +793 -0
  34. package/dist/cjs/ion-card-subtitle.cjs.entry.js +4 -4
  35. package/dist/cjs/{ion-list-header_3.cjs.entry.js → ion-checkbox_4.cjs.entry.js} +124 -23
  36. package/dist/cjs/ion-chip.cjs.entry.js +5 -10
  37. package/dist/cjs/ion-datetime-button.cjs.entry.js +346 -0
  38. package/dist/cjs/ion-datetime.cjs.entry.js +1548 -856
  39. package/dist/cjs/ion-fab-button.cjs.entry.js +26 -9
  40. package/dist/cjs/ion-fab-list.cjs.entry.js +4 -4
  41. package/dist/cjs/ion-fab.cjs.entry.js +15 -13
  42. package/dist/cjs/ion-img.cjs.entry.js +28 -4
  43. package/dist/cjs/ion-infinite-scroll-content.cjs.entry.js +5 -5
  44. package/dist/cjs/ion-infinite-scroll.cjs.entry.js +13 -13
  45. package/dist/cjs/ion-input.cjs.entry.js +57 -23
  46. package/dist/cjs/ion-item-option.cjs.entry.js +8 -8
  47. package/dist/cjs/ion-item-options.cjs.entry.js +5 -5
  48. package/dist/cjs/ion-item-sliding.cjs.entry.js +59 -63
  49. package/dist/cjs/ion-loading.cjs.entry.js +37 -36
  50. package/dist/cjs/ion-menu-button.cjs.entry.js +14 -12
  51. package/dist/cjs/ion-menu-toggle.cjs.entry.js +8 -7
  52. package/dist/cjs/ion-menu.cjs.entry.js +71 -57
  53. package/dist/cjs/ion-modal.cjs.entry.js +1384 -154
  54. package/dist/cjs/ion-nav-link.cjs.entry.js +5 -2
  55. package/dist/cjs/ion-nav.cjs.entry.js +177 -171
  56. package/dist/cjs/ion-picker-column.cjs.entry.js +25 -27
  57. package/dist/cjs/ion-picker.cjs.entry.js +22 -17
  58. package/dist/cjs/ion-popover.cjs.entry.js +1208 -182
  59. package/dist/cjs/ion-range.cjs.entry.js +137 -57
  60. package/dist/cjs/ion-refresher-content.cjs.entry.js +7 -12
  61. package/dist/cjs/ion-refresher.cjs.entry.js +150 -148
  62. package/dist/cjs/ion-reorder-group.cjs.entry.js +42 -35
  63. package/dist/cjs/ion-reorder.cjs.entry.js +5 -4
  64. package/dist/cjs/ion-route-redirect.cjs.entry.js +1 -1
  65. package/dist/cjs/ion-route.cjs.entry.js +1 -1
  66. package/dist/cjs/ion-router-link.cjs.entry.js +5 -5
  67. package/dist/cjs/ion-router-outlet.cjs.entry.js +24 -20
  68. package/dist/cjs/ion-router.cjs.entry.js +291 -194
  69. package/dist/cjs/ion-segment-button.cjs.entry.js +10 -17
  70. package/dist/cjs/ion-segment.cjs.entry.js +119 -26
  71. package/dist/cjs/ion-select-option.cjs.entry.js +3 -3
  72. package/dist/cjs/ion-select.cjs.entry.js +113 -78
  73. package/dist/cjs/ion-slide.cjs.entry.js +3 -3
  74. package/dist/cjs/ion-slides.cjs.entry.js +26 -27
  75. package/dist/cjs/ion-spinner.cjs.entry.js +10 -9
  76. package/dist/cjs/ion-split-pane.cjs.entry.js +16 -12
  77. package/dist/cjs/ion-tab-bar.cjs.entry.js +16 -23
  78. package/dist/cjs/ion-tab-button.cjs.entry.js +6 -6
  79. package/dist/cjs/ion-tab.cjs.entry.js +4 -4
  80. package/dist/cjs/ion-tabs.cjs.entry.js +4 -5
  81. package/dist/cjs/ion-text.cjs.entry.js +3 -3
  82. package/dist/cjs/ion-textarea.cjs.entry.js +31 -29
  83. package/dist/cjs/ion-thumbnail.cjs.entry.js +2 -2
  84. package/dist/cjs/ion-toast.cjs.entry.js +49 -59
  85. package/dist/cjs/ion-toggle.cjs.entry.js +41 -22
  86. package/dist/cjs/ion-virtual-scroll.cjs.entry.js +39 -31
  87. package/dist/cjs/{ionic-global-56e10eb5.js → ionic-global-f2d95fd3.js} +112 -93
  88. package/dist/cjs/{ios.transition-32e4623d.js → ios.transition-0f31ec9a.js} +78 -53
  89. package/dist/cjs/{keyboard-9e8103e4.js → keyboard-79afcba2.js} +6 -3
  90. package/dist/cjs/keyboard-controller-a934d106.js +42 -0
  91. package/dist/cjs/loader.cjs.js +4 -4
  92. package/dist/cjs/{md.transition-169c54f0.js → md.transition-d2a33a23.js} +15 -17
  93. package/dist/cjs/{menu-toggle-util-087678e0.js → menu-toggle-util-0a43ff7c.js} +5 -2
  94. package/dist/cjs/{overlays-49fe9ba7.js → overlays-65c716aa.js} +187 -71
  95. package/dist/cjs/spinner-configs-cd0abbeb.js +147 -0
  96. package/dist/cjs/{status-tap-ada894ff.js → status-tap-beaa3a71.js} +10 -5
  97. package/dist/cjs/{swipe-back-c4a778df.js → swipe-back-666ea8e6.js} +34 -15
  98. package/dist/cjs/test-component.cjs.entry.js +1 -1
  99. package/dist/cjs/{theme-2259d0f5.js → theme-fc63803b.js} +9 -5
  100. package/dist/collection/collection-manifest.json +7 -0
  101. package/dist/custom-elements/index.js +12689 -4785
  102. package/dist/custom-elements/{tap-click.js → index2.js} +36 -18
  103. package/dist/custom-elements/input-shims.js +87 -38
  104. package/dist/custom-elements/ios.transition.js +74 -50
  105. package/dist/custom-elements/md.transition.js +11 -14
  106. package/dist/custom-elements/status-tap.js +7 -4
  107. package/dist/custom-elements/swipe-back.js +31 -13
  108. package/dist/elements/elements.css +1 -1
  109. package/dist/elements/elements.esm.js +1 -1
  110. package/dist/elements/p-0268cbd3.entry.js +7 -0
  111. package/dist/elements/p-0587332d.entry.js +1 -0
  112. package/dist/elements/{p-cfc0e54d.js → p-0991c811.js} +3 -0
  113. package/dist/elements/p-0a69a563.entry.js +1 -0
  114. package/dist/elements/p-0b95be17.entry.js +1 -0
  115. package/dist/elements/p-0d284fe0.entry.js +1 -0
  116. package/dist/elements/p-0fd77b33.entry.js +1 -0
  117. package/dist/elements/p-120dec2b.entry.js +1 -0
  118. package/dist/elements/p-12880671.entry.js +1 -0
  119. package/dist/elements/p-14ccd586.entry.js +1 -0
  120. package/dist/elements/{p-83d45051.entry.js → p-14df6ac0.entry.js} +1 -1
  121. package/dist/elements/{p-e860be6a.entry.js → p-17079f06.entry.js} +1 -1
  122. package/dist/elements/p-19e4a688.js +4 -0
  123. package/dist/elements/p-1afc4eb4.js +4 -0
  124. package/dist/elements/p-1beaf6bf.js +4 -0
  125. package/dist/elements/p-1d1c6a6f.entry.js +1 -0
  126. package/dist/elements/{p-31d30e42.entry.js → p-1d98f84b.entry.js} +1 -1
  127. package/dist/elements/p-278ca4c9.js +4 -0
  128. package/dist/elements/p-27f5629c.entry.js +1 -0
  129. package/dist/elements/p-29c0f03f.js +4 -0
  130. package/dist/elements/p-2da59aca.js +4 -0
  131. package/dist/elements/p-3152143f.js +4 -0
  132. package/dist/elements/p-343ff720.entry.js +7 -0
  133. package/dist/elements/p-36d4c9a8.js +4 -0
  134. package/dist/elements/p-3a30dfb2.entry.js +1 -0
  135. package/dist/elements/p-3c013bf1.entry.js +1 -0
  136. package/dist/elements/{p-74ba1e42.entry.js → p-3c318da5.entry.js} +1 -1
  137. package/dist/elements/p-3cee3222.entry.js +1 -0
  138. package/dist/elements/p-480b3c4f.entry.js +1 -0
  139. package/dist/elements/p-4e9d8f18.entry.js +1 -0
  140. package/dist/elements/p-53e23176.js +2 -0
  141. package/dist/elements/p-548524f3.js +4 -0
  142. package/dist/elements/p-5739fa41.entry.js +1 -0
  143. package/dist/elements/p-5808c505.js +1 -0
  144. package/dist/elements/p-58a8cc2a.js +4 -0
  145. package/dist/elements/p-6035415e.entry.js +1 -0
  146. package/dist/elements/p-60eeae90.js +4 -0
  147. package/dist/elements/p-610b03ff.entry.js +4 -0
  148. package/dist/elements/p-67777478.entry.js +1 -0
  149. package/dist/elements/p-6ab826e1.entry.js +1 -0
  150. package/dist/elements/p-6f5a2827.entry.js +1 -0
  151. package/dist/elements/p-779676c5.entry.js +1 -0
  152. package/dist/elements/p-7916ecc5.entry.js +1 -0
  153. package/dist/elements/p-79f06b80.entry.js +1 -0
  154. package/dist/elements/p-7b5991c1.entry.js +1 -0
  155. package/dist/elements/p-7d0def79.js +5 -0
  156. package/dist/elements/p-8112afea.js +4 -0
  157. package/dist/elements/p-83678d7d.entry.js +4 -0
  158. package/dist/elements/p-87e45c94.entry.js +1 -0
  159. package/dist/elements/p-8da6a31e.entry.js +1 -0
  160. package/dist/elements/p-8f80768f.entry.js +4 -0
  161. package/dist/elements/p-8fe0433b.js +4 -0
  162. package/dist/elements/{p-4cb27b48.entry.js → p-9147d82b.entry.js} +1 -1
  163. package/dist/elements/p-97abb434.entry.js +1 -0
  164. package/dist/elements/p-98497a4b.entry.js +1 -0
  165. package/dist/elements/p-9c719139.js +4 -0
  166. package/dist/elements/p-9ca37332.js +4 -0
  167. package/dist/elements/{p-37de7110.js → p-9d48def2.js} +3 -0
  168. package/dist/elements/p-a79a6ad9.entry.js +79 -0
  169. package/dist/elements/p-a805f2f9.entry.js +1 -0
  170. package/dist/elements/p-a86a5bfa.entry.js +1 -0
  171. package/dist/elements/{p-9c1dbe52.entry.js → p-ac34eab7.entry.js} +1 -1
  172. package/dist/elements/p-ad366eab.entry.js +4 -0
  173. package/dist/elements/p-aef3a931.js +7 -0
  174. package/dist/elements/p-b0537eb3.entry.js +1 -0
  175. package/dist/elements/p-b337f3b8.js +4 -0
  176. package/dist/elements/p-b34bf73f.entry.js +7 -0
  177. package/dist/elements/p-b41e66f0.entry.js +1 -0
  178. package/dist/elements/p-b47e7091.entry.js +1 -0
  179. package/dist/elements/p-b840320e.js +4 -0
  180. package/dist/elements/p-b934ac5d.entry.js +1 -0
  181. package/dist/elements/p-b98314e0.entry.js +4 -0
  182. package/dist/elements/p-bd12806f.entry.js +1 -0
  183. package/dist/elements/p-c16d38d5.js +4 -0
  184. package/dist/elements/p-c84205a3.js +4 -0
  185. package/dist/elements/{p-06675ac7.entry.js → p-cbe318f8.entry.js} +1 -1
  186. package/dist/elements/p-cfed7395.js +4 -0
  187. package/dist/elements/p-d22a1dc7.entry.js +7 -0
  188. package/dist/elements/p-d3e75c94.entry.js +1 -0
  189. package/dist/elements/p-d8f6d3ce.entry.js +14 -0
  190. package/dist/elements/p-d9880221.entry.js +4 -0
  191. package/dist/elements/p-da5db8fb.entry.js +1 -0
  192. package/dist/elements/{p-91fe653f.js → p-dcc6b03c.js} +3 -0
  193. package/dist/elements/{p-305e246c.entry.js → p-dd846020.entry.js} +1 -1
  194. package/dist/elements/p-df240b2a.entry.js +4 -0
  195. package/dist/elements/p-dffd8689.js +4 -0
  196. package/dist/elements/p-e495a095.js +4 -0
  197. package/dist/elements/p-e5fc7d42.entry.js +1 -0
  198. package/dist/elements/{p-aaa8393e.entry.js → p-eb137e9d.entry.js} +1 -1
  199. package/dist/elements/p-f4e54a17.js +7 -0
  200. package/dist/elements/p-f67d0717.entry.js +1 -0
  201. package/dist/elements/p-f7f4c640.js +1 -0
  202. package/dist/elements/p-f851b91a.js +4 -0
  203. package/dist/elements/p-fb27ee76.entry.js +1 -0
  204. package/dist/elements/p-fbddca35.entry.js +1 -0
  205. package/dist/elements/p-fc1df8e0.entry.js +7 -0
  206. package/dist/elements/p-fdac5f3a.js +4 -0
  207. package/dist/esm/{animation-fe6ed422.js → animation-801a007a.js} +115 -84
  208. package/dist/esm/{app-globals-27d92837.js → app-globals-05a3abfb.js} +1 -1
  209. package/dist/esm/{cubic-bezier-108b8579.js → cubic-bezier-538b6253.js} +13 -12
  210. package/dist/esm/data-62c81c24.js +1463 -0
  211. package/dist/esm/dir-defb16c6.js +18 -0
  212. package/dist/esm/elements.js +4 -4
  213. package/dist/esm/focus-visible-78d55799.js +74 -0
  214. package/dist/esm/framework-delegate-7e2b767b.js +115 -0
  215. package/dist/esm/{gesture-controller-8f35af24.js → gesture-controller-c466ff14.js} +6 -2
  216. package/dist/esm/{haptic-c424e670.js → haptic-e7d5ef4d.js} +38 -9
  217. package/dist/esm/{hardware-back-button-bb4c578a.js → hardware-back-button-242191a7.js} +11 -8
  218. package/dist/esm/{helpers-44e3bd9f.js → helpers-aeff219b.js} +113 -16
  219. package/dist/esm/index-0dbaca1a.js +28 -0
  220. package/dist/esm/index-1f3d8582.js +34 -0
  221. package/dist/esm/{index-97199683.js → index-2be9a18b.js} +34 -28
  222. package/dist/esm/{index-8d682224.js → index-51e4a829.js} +12 -8
  223. package/dist/esm/{index-8a463a85.js → index-6048aed6.js} +35 -24
  224. package/dist/esm/index-65ecd543.js +25 -0
  225. package/dist/esm/{tap-click-a7e55ef5.js → index-b212db1c.js} +37 -19
  226. package/dist/esm/{index-e4deec27.js → index-cb938ffb.js} +7 -1
  227. package/dist/esm/{index-3a1bd803.js → index-d39eb62b.js} +35 -20
  228. package/dist/esm/index-ebf7f059.js +128 -0
  229. package/dist/esm/{input-shims-3b48722f.js → input-shims-8a389148.js} +89 -38
  230. package/dist/esm/ion-accordion-group.entry.js +201 -0
  231. package/dist/esm/ion-accordion.entry.js +332 -0
  232. package/dist/esm/ion-action-sheet_3.entry.js +859 -0
  233. package/dist/esm/{ion-app_45.entry.js → ion-app_46.entry.js} +1694 -1407
  234. package/dist/esm/ion-avatar.entry.js +2 -2
  235. package/dist/esm/ion-back-button.entry.js +12 -11
  236. package/dist/esm/ion-backdrop.entry.js +4 -4
  237. package/dist/esm/ion-breadcrumb.entry.js +97 -0
  238. package/dist/esm/ion-breadcrumbs.entry.js +129 -0
  239. package/dist/esm/ion-buttons_3.entry.js +787 -0
  240. package/dist/esm/ion-card-subtitle.entry.js +4 -4
  241. package/dist/esm/{ion-list-header_3.entry.js → ion-checkbox_4.entry.js} +124 -24
  242. package/dist/esm/ion-chip.entry.js +5 -10
  243. package/dist/esm/ion-datetime-button.entry.js +342 -0
  244. package/dist/esm/ion-datetime.entry.js +1548 -856
  245. package/dist/esm/ion-fab-button.entry.js +26 -9
  246. package/dist/esm/ion-fab-list.entry.js +4 -4
  247. package/dist/esm/ion-fab.entry.js +15 -13
  248. package/dist/esm/ion-img.entry.js +28 -4
  249. package/dist/esm/ion-infinite-scroll-content.entry.js +5 -5
  250. package/dist/esm/ion-infinite-scroll.entry.js +13 -13
  251. package/dist/esm/ion-input.entry.js +57 -23
  252. package/dist/esm/ion-item-option.entry.js +8 -8
  253. package/dist/esm/ion-item-options.entry.js +5 -5
  254. package/dist/esm/ion-item-sliding.entry.js +59 -63
  255. package/dist/esm/ion-loading.entry.js +37 -36
  256. package/dist/esm/ion-menu-button.entry.js +14 -12
  257. package/dist/esm/ion-menu-toggle.entry.js +8 -7
  258. package/dist/esm/ion-menu.entry.js +71 -57
  259. package/dist/esm/ion-modal.entry.js +1375 -145
  260. package/dist/esm/ion-nav-link.entry.js +5 -2
  261. package/dist/esm/ion-nav.entry.js +177 -171
  262. package/dist/esm/ion-picker-column.entry.js +25 -27
  263. package/dist/esm/ion-picker.entry.js +22 -17
  264. package/dist/esm/ion-popover.entry.js +1208 -182
  265. package/dist/esm/ion-range.entry.js +137 -57
  266. package/dist/esm/ion-refresher-content.entry.js +7 -12
  267. package/dist/esm/ion-refresher.entry.js +149 -147
  268. package/dist/esm/ion-reorder-group.entry.js +42 -35
  269. package/dist/esm/ion-reorder.entry.js +5 -4
  270. package/dist/esm/ion-route-redirect.entry.js +1 -1
  271. package/dist/esm/ion-route.entry.js +1 -1
  272. package/dist/esm/ion-router-link.entry.js +5 -5
  273. package/dist/esm/ion-router-outlet.entry.js +24 -20
  274. package/dist/esm/ion-router.entry.js +291 -194
  275. package/dist/esm/ion-segment-button.entry.js +10 -17
  276. package/dist/esm/ion-segment.entry.js +119 -26
  277. package/dist/esm/ion-select-option.entry.js +3 -3
  278. package/dist/esm/ion-select.entry.js +113 -78
  279. package/dist/esm/ion-slide.entry.js +3 -3
  280. package/dist/esm/ion-slides.entry.js +26 -27
  281. package/dist/esm/ion-spinner.entry.js +10 -9
  282. package/dist/esm/ion-split-pane.entry.js +16 -12
  283. package/dist/esm/ion-tab-bar.entry.js +16 -23
  284. package/dist/esm/ion-tab-button.entry.js +6 -6
  285. package/dist/esm/ion-tab.entry.js +4 -4
  286. package/dist/esm/ion-tabs.entry.js +4 -5
  287. package/dist/esm/ion-text.entry.js +3 -3
  288. package/dist/esm/ion-textarea.entry.js +31 -29
  289. package/dist/esm/ion-thumbnail.entry.js +2 -2
  290. package/dist/esm/ion-toast.entry.js +49 -59
  291. package/dist/esm/ion-toggle.entry.js +41 -22
  292. package/dist/esm/ion-virtual-scroll.entry.js +39 -31
  293. package/dist/esm/{ionic-global-2e28f7c7.js → ionic-global-6cd57191.js} +112 -93
  294. package/dist/esm/{ios.transition-a783e3cd.js → ios.transition-bbd952f2.js} +78 -53
  295. package/dist/{custom-elements/keyboard.js → esm/keyboard-413afe04.js} +6 -3
  296. package/dist/esm/keyboard-controller-33693bc2.js +40 -0
  297. package/dist/esm/loader.js +4 -4
  298. package/dist/esm/{md.transition-5a4a8c82.js → md.transition-5170a6d3.js} +15 -17
  299. package/dist/esm/{menu-toggle-util-562dfc9c.js → menu-toggle-util-82bf888a.js} +5 -2
  300. package/dist/esm/{overlays-fc9a0625.js → overlays-0c7f05e1.js} +186 -71
  301. package/dist/esm/spinner-configs-cbcd1f62.js +145 -0
  302. package/dist/esm/{status-tap-69e62ad6.js → status-tap-ad757b8a.js} +10 -5
  303. package/dist/esm/swipe-back-7ef22876.js +69 -0
  304. package/dist/esm/test-component.entry.js +1 -1
  305. package/dist/esm/{theme-d21826a7.js → theme-7cf2cab0.js} +9 -5
  306. package/package.json +4 -5
  307. package/LICENSE +0 -21
  308. package/dist/cjs/button-active-c14dab31.js +0 -66
  309. package/dist/cjs/focus-visible-16c98640.js +0 -45
  310. package/dist/cjs/framework-delegate-c45292a3.js +0 -37
  311. package/dist/cjs/ion-action-sheet.cjs.entry.js +0 -265
  312. package/dist/cjs/ion-alert.cjs.entry.js +0 -456
  313. package/dist/cjs/ion-buttons.cjs.entry.js +0 -42
  314. package/dist/cjs/ion-checkbox.cjs.entry.js +0 -117
  315. package/dist/cjs/ion-note.cjs.entry.js +0 -29
  316. package/dist/cjs/ion-select-popover.cjs.entry.js +0 -35
  317. package/dist/cjs/spinner-configs-fb16b986.js +0 -112
  318. package/dist/custom-elements/focus-visible.js +0 -43
  319. package/dist/elements/p-03bda390.js +0 -1
  320. package/dist/elements/p-0be044f1.entry.js +0 -1
  321. package/dist/elements/p-119c7c6c.entry.js +0 -1
  322. package/dist/elements/p-14c7c3ea.entry.js +0 -1
  323. package/dist/elements/p-1d4a2c61.js +0 -1
  324. package/dist/elements/p-1d894ac4.entry.js +0 -1
  325. package/dist/elements/p-1dafa1ce.entry.js +0 -1
  326. package/dist/elements/p-23b89ccb.entry.js +0 -1
  327. package/dist/elements/p-2c03b9ab.entry.js +0 -1
  328. package/dist/elements/p-346985f2.js +0 -1
  329. package/dist/elements/p-360f1c62.entry.js +0 -1
  330. package/dist/elements/p-373e1f25.entry.js +0 -1
  331. package/dist/elements/p-40547acb.entry.js +0 -1
  332. package/dist/elements/p-40b68014.entry.js +0 -1
  333. package/dist/elements/p-42e4f702.entry.js +0 -1
  334. package/dist/elements/p-489807e5.js +0 -1
  335. package/dist/elements/p-4ad72d54.entry.js +0 -1
  336. package/dist/elements/p-4cca7b5e.entry.js +0 -1
  337. package/dist/elements/p-4f24d306.js +0 -1
  338. package/dist/elements/p-519d6a53.entry.js +0 -1
  339. package/dist/elements/p-536e8e52.entry.js +0 -1
  340. package/dist/elements/p-599bb53f.entry.js +0 -1
  341. package/dist/elements/p-5eb7a546.js +0 -1
  342. package/dist/elements/p-60df2bed.entry.js +0 -1
  343. package/dist/elements/p-65133e33.js +0 -1
  344. package/dist/elements/p-6693fce8.js +0 -1
  345. package/dist/elements/p-689bdcc1.entry.js +0 -1
  346. package/dist/elements/p-70713b3d.entry.js +0 -1
  347. package/dist/elements/p-707d5d76.js +0 -1
  348. package/dist/elements/p-7212b7f2.js +0 -1
  349. package/dist/elements/p-73992898.entry.js +0 -1
  350. package/dist/elements/p-792c1e0f.entry.js +0 -1
  351. package/dist/elements/p-7e5300af.js +0 -2
  352. package/dist/elements/p-8068987c.entry.js +0 -1
  353. package/dist/elements/p-83accf46.entry.js +0 -1
  354. package/dist/elements/p-86635d06.entry.js +0 -1
  355. package/dist/elements/p-874c2b44.js +0 -1
  356. package/dist/elements/p-89c12ce8.entry.js +0 -1
  357. package/dist/elements/p-8bcba3f7.entry.js +0 -1
  358. package/dist/elements/p-8c759f51.entry.js +0 -1
  359. package/dist/elements/p-8f945e6b.entry.js +0 -1
  360. package/dist/elements/p-9300ab6a.js +0 -1
  361. package/dist/elements/p-93cacd51.entry.js +0 -1
  362. package/dist/elements/p-9408d0b4.entry.js +0 -1
  363. package/dist/elements/p-98c79eda.js +0 -1
  364. package/dist/elements/p-99f8abed.js +0 -1
  365. package/dist/elements/p-9ca7e079.js +0 -1
  366. package/dist/elements/p-a4648b74.entry.js +0 -1
  367. package/dist/elements/p-aab0f63c.js +0 -1
  368. package/dist/elements/p-ad4e2295.entry.js +0 -1
  369. package/dist/elements/p-afb8f7d5.entry.js +0 -1
  370. package/dist/elements/p-b055ec44.js +0 -1
  371. package/dist/elements/p-b078d63b.entry.js +0 -1
  372. package/dist/elements/p-b3460325.entry.js +0 -1
  373. package/dist/elements/p-b5406b58.entry.js +0 -1
  374. package/dist/elements/p-b5ef0c91.entry.js +0 -1
  375. package/dist/elements/p-b6ba623e.entry.js +0 -1
  376. package/dist/elements/p-b9926d8b.entry.js +0 -1
  377. package/dist/elements/p-bfd4cfcd.entry.js +0 -1
  378. package/dist/elements/p-c08dd7d0.entry.js +0 -1
  379. package/dist/elements/p-c0db9c51.entry.js +0 -1
  380. package/dist/elements/p-c1e7fbfb.js +0 -1
  381. package/dist/elements/p-ca69d6c9.js +0 -1
  382. package/dist/elements/p-cc4cb1ac.entry.js +0 -1
  383. package/dist/elements/p-cf8a7031.entry.js +0 -1
  384. package/dist/elements/p-cff82b6f.js +0 -1
  385. package/dist/elements/p-d01009b8.entry.js +0 -67
  386. package/dist/elements/p-d6d1e65f.entry.js +0 -1
  387. package/dist/elements/p-d9462b66.entry.js +0 -1
  388. package/dist/elements/p-e2e0fee9.entry.js +0 -1
  389. package/dist/elements/p-e642b266.entry.js +0 -1
  390. package/dist/elements/p-e953934f.entry.js +0 -1
  391. package/dist/elements/p-f0474f46.js +0 -1
  392. package/dist/elements/p-f10a94f6.entry.js +0 -1
  393. package/dist/elements/p-f2426182.entry.js +0 -1
  394. package/dist/elements/p-f327fd21.js +0 -1
  395. package/dist/elements/p-f84987ee.js +0 -1
  396. package/dist/elements/p-f8a3367d.entry.js +0 -1
  397. package/dist/esm/button-active-fd9d6d91.js +0 -64
  398. package/dist/esm/focus-visible-edb28f19.js +0 -43
  399. package/dist/esm/framework-delegate-9cd8048f.js +0 -34
  400. package/dist/esm/ion-action-sheet.entry.js +0 -261
  401. package/dist/esm/ion-alert.entry.js +0 -452
  402. package/dist/esm/ion-buttons.entry.js +0 -38
  403. package/dist/esm/ion-checkbox.entry.js +0 -113
  404. package/dist/esm/ion-note.entry.js +0 -25
  405. package/dist/esm/ion-select-popover.entry.js +0 -31
  406. package/dist/esm/keyboard-e6abcb80.js +0 -125
  407. package/dist/esm/spinner-configs-aaf2a1a9.js +0 -110
  408. package/dist/esm/swipe-back-d84cfc8a.js +0 -50
  409. package/readme.md +0 -55
@@ -1,15 +1,19 @@
1
- import { r as registerInstance, c as createEvent, a as getElement } from './index-e4deec27.js';
2
- import { a as componentOnReady, o as debounce } from './helpers-44e3bd9f.js';
1
+ import { r as registerInstance, d as createEvent, c as getElement } from './index-cb938ffb.js';
2
+ import { c as componentOnReady, p as debounce } from './helpers-aeff219b.js';
3
3
 
4
+ /*!
5
+ * (C) Ionic http://ionicframework.com - MIT License
6
+ */
4
7
  const ROUTER_INTENT_NONE = 'root';
5
8
  const ROUTER_INTENT_FORWARD = 'forward';
6
9
  const ROUTER_INTENT_BACK = 'back';
7
10
 
8
- // Join the non empty segments with "/".
11
+ /*!
12
+ * (C) Ionic http://ionicframework.com - MIT License
13
+ */
14
+ /** Join the non empty segments with "/". */
9
15
  const generatePath = (segments) => {
10
- const path = segments
11
- .filter(s => s.length > 0)
12
- .join('/');
16
+ const path = segments.filter((s) => s.length > 0).join('/');
13
17
  return '/' + path;
14
18
  };
15
19
  const generateUrl = (segments, useHash, queryString) => {
@@ -22,8 +26,8 @@ const generateUrl = (segments, useHash, queryString) => {
22
26
  }
23
27
  return url;
24
28
  };
25
- const writePath = (history, root, useHash, path, direction, state, queryString) => {
26
- const url = generateUrl([...parsePath(root).segments, ...path], useHash, queryString);
29
+ const writeSegments = (history, root, useHash, segments, direction, state, queryString) => {
30
+ const url = generateUrl([...parsePath(root).segments, ...segments], useHash, queryString);
27
31
  if (direction === ROUTER_INTENT_FORWARD) {
28
32
  history.pushState(state, '', url);
29
33
  }
@@ -31,67 +35,79 @@ const writePath = (history, root, useHash, path, direction, state, queryString)
31
35
  history.replaceState(state, '', url);
32
36
  }
33
37
  };
34
- const chainToPath = (chain) => {
35
- const path = [];
38
+ /**
39
+ * Transforms a chain to a list of segments.
40
+ *
41
+ * Notes:
42
+ * - parameter segments of the form :param are replaced with their value,
43
+ * - null is returned when a value is missing for any parameter segment.
44
+ */
45
+ const chainToSegments = (chain) => {
46
+ const segments = [];
36
47
  for (const route of chain) {
37
- for (const segment of route.path) {
48
+ for (const segment of route.segments) {
38
49
  if (segment[0] === ':') {
39
50
  const param = route.params && route.params[segment.slice(1)];
40
51
  if (!param) {
41
52
  return null;
42
53
  }
43
- path.push(param);
54
+ segments.push(param);
44
55
  }
45
56
  else if (segment !== '') {
46
- path.push(segment);
57
+ segments.push(segment);
47
58
  }
48
59
  }
49
60
  }
50
- return path;
61
+ return segments;
51
62
  };
52
- // Remove the prefix segments from the path segments.
53
- //
54
- // Return:
55
- // - null when the path segments do not start with the passed prefix,
56
- // - the path segments after the prefix otherwise.
57
- const removePrefix = (prefix, path) => {
58
- if (prefix.length > path.length) {
63
+ /**
64
+ * Removes the prefix segments from the path segments.
65
+ *
66
+ * Return:
67
+ * - null when the path segments do not start with the passed prefix,
68
+ * - the path segments after the prefix otherwise.
69
+ */
70
+ const removePrefix = (prefix, segments) => {
71
+ if (prefix.length > segments.length) {
59
72
  return null;
60
73
  }
61
74
  if (prefix.length <= 1 && prefix[0] === '') {
62
- return path;
75
+ return segments;
63
76
  }
64
77
  for (let i = 0; i < prefix.length; i++) {
65
- if (prefix[i] !== path[i]) {
78
+ if (prefix[i] !== segments[i]) {
66
79
  return null;
67
80
  }
68
81
  }
69
- if (path.length === prefix.length) {
82
+ if (segments.length === prefix.length) {
70
83
  return [''];
71
84
  }
72
- return path.slice(prefix.length);
85
+ return segments.slice(prefix.length);
73
86
  };
74
- const readPath = (loc, root, useHash) => {
87
+ const readSegments = (loc, root, useHash) => {
75
88
  const prefix = parsePath(root).segments;
76
89
  const pathname = useHash ? loc.hash.slice(1) : loc.pathname;
77
- const path = parsePath(pathname).segments;
78
- return removePrefix(prefix, path);
90
+ const segments = parsePath(pathname).segments;
91
+ return removePrefix(prefix, segments);
79
92
  };
80
- // Parses the path to:
81
- // - segments an array of '/' separated parts,
82
- // - queryString (undefined when no query string).
93
+ /**
94
+ * Parses the path to:
95
+ * - segments an array of '/' separated parts,
96
+ * - queryString (undefined when no query string).
97
+ */
83
98
  const parsePath = (path) => {
84
99
  let segments = [''];
85
100
  let queryString;
86
101
  if (path != null) {
87
102
  const qsStart = path.indexOf('?');
88
103
  if (qsStart > -1) {
89
- queryString = path.substr(qsStart + 1);
90
- path = path.substr(0, qsStart);
104
+ queryString = path.substring(qsStart + 1);
105
+ path = path.substring(0, qsStart);
91
106
  }
92
- segments = path.split('/')
93
- .map(s => s.trim())
94
- .filter(s => s.length > 0);
107
+ segments = path
108
+ .split('/')
109
+ .map((s) => s.trim())
110
+ .filter((s) => s.length > 0);
95
111
  if (segments.length === 0) {
96
112
  segments = [''];
97
113
  }
@@ -99,13 +115,16 @@ const parsePath = (path) => {
99
115
  return { segments, queryString };
100
116
  };
101
117
 
118
+ /*!
119
+ * (C) Ionic http://ionicframework.com - MIT License
120
+ */
102
121
  const printRoutes = (routes) => {
103
122
  console.group(`[ion-core] ROUTES[${routes.length}]`);
104
123
  for (const chain of routes) {
105
- const path = [];
106
- chain.forEach(r => path.push(...r.path));
107
- const ids = chain.map(r => r.id);
108
- console.debug(`%c ${generatePath(path)}`, 'font-weight: bold; padding-left: 20px', '=>\t', `(${ids.join(', ')})`);
124
+ const segments = [];
125
+ chain.forEach((r) => segments.push(...r.segments));
126
+ const ids = chain.map((r) => r.id);
127
+ console.debug(`%c ${generatePath(segments)}`, 'font-weight: bold; padding-left: 20px', '=>\t', `(${ids.join(', ')})`);
109
128
  }
110
129
  console.groupEnd();
111
130
  };
@@ -119,6 +138,17 @@ const printRedirects = (redirects) => {
119
138
  console.groupEnd();
120
139
  };
121
140
 
141
+ /*!
142
+ * (C) Ionic http://ionicframework.com - MIT License
143
+ */
144
+ /**
145
+ * Activates the passed route chain.
146
+ *
147
+ * There must be exactly one outlet per route entry in the chain.
148
+ *
149
+ * The methods calls setRouteId on each of the outlet with the corresponding route entry in the chain.
150
+ * setRouteId will create or select the view in the outlet.
151
+ */
122
152
  const writeNavState = async (root, chain, direction, index, changed = false, animation) => {
123
153
  try {
124
154
  // find next navigation outlet in the DOM
@@ -127,7 +157,7 @@ const writeNavState = async (root, chain, direction, index, changed = false, ani
127
157
  if (index >= chain.length || !outlet) {
128
158
  return changed;
129
159
  }
130
- await new Promise(resolve => componentOnReady(outlet, resolve));
160
+ await new Promise((resolve) => componentOnReady(outlet, resolve));
131
161
  const route = chain[index];
132
162
  const result = await outlet.setRouteId(route.id, route.params, direction, animation);
133
163
  // if the outlet changed the page, reset navigation to neutral (no direction)
@@ -150,23 +180,22 @@ const writeNavState = async (root, chain, direction, index, changed = false, ani
150
180
  return false;
151
181
  }
152
182
  };
183
+ /**
184
+ * Recursively walks the outlet in the DOM.
185
+ *
186
+ * The function returns a list of RouteID corresponding to each of the outlet and the last outlet without a RouteID.
187
+ */
153
188
  const readNavState = async (root) => {
154
189
  const ids = [];
155
190
  let outlet;
156
191
  let node = root;
157
- // tslint:disable-next-line:no-constant-condition
158
- while (true) {
159
- outlet = searchNavNode(node);
160
- if (outlet) {
161
- const id = await outlet.getRouteId();
162
- if (id) {
163
- node = id.element;
164
- id.element = undefined;
165
- ids.push(id);
166
- }
167
- else {
168
- break;
169
- }
192
+ // eslint-disable-next-line no-cond-assign
193
+ while ((outlet = searchNavNode(node))) {
194
+ const id = await outlet.getRouteId();
195
+ if (id) {
196
+ node = id.element;
197
+ id.element = undefined;
198
+ ids.push(id);
170
199
  }
171
200
  else {
172
201
  break;
@@ -178,33 +207,39 @@ const waitUntilNavNode = () => {
178
207
  if (searchNavNode(document.body)) {
179
208
  return Promise.resolve();
180
209
  }
181
- return new Promise(resolve => {
182
- window.addEventListener('ionNavWillLoad', resolve, { once: true });
210
+ return new Promise((resolve) => {
211
+ window.addEventListener('ionNavWillLoad', () => resolve(), { once: true });
183
212
  });
184
213
  };
185
- const QUERY = ':not([no-router]) ion-nav, :not([no-router]) ion-tabs, :not([no-router]) ion-router-outlet';
214
+ /** Selector for all the outlets supported by the router. */
215
+ const OUTLET_SELECTOR = ':not([no-router]) ion-nav, :not([no-router]) ion-tabs, :not([no-router]) ion-router-outlet';
186
216
  const searchNavNode = (root) => {
187
217
  if (!root) {
188
218
  return undefined;
189
219
  }
190
- if (root.matches(QUERY)) {
220
+ if (root.matches(OUTLET_SELECTOR)) {
191
221
  return root;
192
222
  }
193
- const outlet = root.querySelector(QUERY);
223
+ const outlet = root.querySelector(OUTLET_SELECTOR);
194
224
  return outlet !== null && outlet !== void 0 ? outlet : undefined;
195
225
  };
196
226
 
197
- // Returns whether the given redirect matches the given path segments.
198
- //
199
- // A redirect matches when the segments of the path and redirect.from are equal.
200
- // Note that segments are only checked until redirect.from contains a '*' which matches any path segment.
201
- // The path ['some', 'path', 'to', 'page'] matches both ['some', 'path', 'to', 'page'] and ['some', 'path', '*'].
202
- const matchesRedirect = (path, redirect) => {
227
+ /*!
228
+ * (C) Ionic http://ionicframework.com - MIT License
229
+ */
230
+ /**
231
+ * Returns whether the given redirect matches the given path segments.
232
+ *
233
+ * A redirect matches when the segments of the path and redirect.from are equal.
234
+ * Note that segments are only checked until redirect.from contains a '*' which matches any path segment.
235
+ * The path ['some', 'path', 'to', 'page'] matches both ['some', 'path', 'to', 'page'] and ['some', 'path', '*'].
236
+ */
237
+ const matchesRedirect = (segments, redirect) => {
203
238
  const { from, to } = redirect;
204
239
  if (to === undefined) {
205
240
  return false;
206
241
  }
207
- if (from.length > path.length) {
242
+ if (from.length > segments.length) {
208
243
  return false;
209
244
  }
210
245
  for (let i = 0; i < from.length; i++) {
@@ -212,15 +247,15 @@ const matchesRedirect = (path, redirect) => {
212
247
  if (expected === '*') {
213
248
  return true;
214
249
  }
215
- if (expected !== path[i]) {
250
+ if (expected !== segments[i]) {
216
251
  return false;
217
252
  }
218
253
  }
219
- return from.length === path.length;
254
+ return from.length === segments.length;
220
255
  };
221
- // Returns the first redirect matching the path segments or undefined when no match found.
222
- const findRouteRedirect = (path, redirects) => {
223
- return redirects.find(redirect => matchesRedirect(path, redirect));
256
+ /** Returns the first redirect matching the path segments or undefined when no match found. */
257
+ const findRouteRedirect = (segments, redirects) => {
258
+ return redirects.find((redirect) => matchesRedirect(segments, redirect));
224
259
  };
225
260
  const matchesIDs = (ids, chain) => {
226
261
  const len = Math.min(ids.length, chain.length);
@@ -234,33 +269,30 @@ const matchesIDs = (ids, chain) => {
234
269
  }
235
270
  if (routeId.params) {
236
271
  const routeIdParams = Object.keys(routeId.params);
237
- /**
238
- * Only compare routes with the chain that have the same number of parameters.
239
- */
240
- if (routeIdParams.length === routeChain.path.length) {
241
- /**
242
- * Maps the route's params into a path based on the path variable names,
243
- * to compare against the route chain format.
244
- *
245
- * Before:
246
- * ```ts
247
- * {
248
- * params: {
249
- * s1: 'a',
250
- * s2: 'b'
251
- * }
252
- * }
253
- * ```
254
- *
255
- * After:
256
- * ```ts
257
- * [':s1',':s2']
258
- * ```
259
- */
260
- const pathWithParams = routeIdParams.map(key => `:${key}`);
272
+ // Only compare routes with the chain that have the same number of parameters.
273
+ if (routeIdParams.length === routeChain.segments.length) {
274
+ // Maps the route's params into a path based on the path variable names,
275
+ // to compare against the route chain format.
276
+ //
277
+ // Before:
278
+ // ```ts
279
+ // {
280
+ // params: {
281
+ // s1: 'a',
282
+ // s2: 'b'
283
+ // }
284
+ // }
285
+ // ```
286
+ //
287
+ // After:
288
+ // ```ts
289
+ // [':s1',':s2']
290
+ // ```
291
+ //
292
+ const pathWithParams = routeIdParams.map((key) => `:${key}`);
261
293
  for (let j = 0; j < pathWithParams.length; j++) {
262
294
  // Skip results where the path variable is not a match
263
- if (pathWithParams[j].toLowerCase() !== routeChain.path[j]) {
295
+ if (pathWithParams[j].toLowerCase() !== routeChain.segments[j]) {
264
296
  break;
265
297
  }
266
298
  // Weight path matches for the same index higher.
@@ -273,18 +305,25 @@ const matchesIDs = (ids, chain) => {
273
305
  }
274
306
  return score;
275
307
  };
276
- const matchesPath = (inputPath, chain) => {
277
- const segments = new RouterSegments(inputPath);
308
+ /**
309
+ * Matches the segments against the chain.
310
+ *
311
+ * Returns:
312
+ * - null when there is no match,
313
+ * - a chain with the params properties updated with the parameter segments on match.
314
+ */
315
+ const matchesSegments = (segments, chain) => {
316
+ const inputSegments = new RouterSegments(segments);
278
317
  let matchesDefault = false;
279
318
  let allparams;
280
319
  for (let i = 0; i < chain.length; i++) {
281
- const path = chain[i].path;
282
- if (path[0] === '') {
320
+ const chainSegments = chain[i].segments;
321
+ if (chainSegments[0] === '') {
283
322
  matchesDefault = true;
284
323
  }
285
324
  else {
286
- for (const segment of path) {
287
- const data = segments.next();
325
+ for (const segment of chainSegments) {
326
+ const data = inputSegments.next();
288
327
  // data param
289
328
  if (segment[0] === ':') {
290
329
  if (data === '') {
@@ -301,29 +340,36 @@ const matchesPath = (inputPath, chain) => {
301
340
  matchesDefault = false;
302
341
  }
303
342
  }
304
- const matches = (matchesDefault)
305
- ? matchesDefault === (segments.next() === '')
306
- : true;
343
+ const matches = matchesDefault ? matchesDefault === (inputSegments.next() === '') : true;
307
344
  if (!matches) {
308
345
  return null;
309
346
  }
310
347
  if (allparams) {
311
348
  return chain.map((route, i) => ({
312
349
  id: route.id,
313
- path: route.path,
350
+ segments: route.segments,
314
351
  params: mergeParams(route.params, allparams[i]),
315
352
  beforeEnter: route.beforeEnter,
316
- beforeLeave: route.beforeLeave
353
+ beforeLeave: route.beforeLeave,
317
354
  }));
318
355
  }
319
356
  return chain;
320
357
  };
321
- // Merges the route parameter objects.
322
- // Returns undefined when both parameters are undefined.
358
+ /**
359
+ * Merges the route parameter objects.
360
+ * Returns undefined when both parameters are undefined.
361
+ */
323
362
  const mergeParams = (a, b) => {
324
363
  return a || b ? Object.assign(Object.assign({}, a), b) : undefined;
325
364
  };
326
- const routerIDsToChain = (ids, chains) => {
365
+ /**
366
+ * Finds the best match for the ids in the chains.
367
+ *
368
+ * Returns the best match or null when no match is found.
369
+ * When a chain is returned the parameters are updated from the RouteIDs.
370
+ * That is they contain both the componentProps of the <ion-route> and the parameter segment.
371
+ */
372
+ const findChainForIDs = (ids, chains) => {
327
373
  let match = null;
328
374
  let maxMatches = 0;
329
375
  for (const chain of chains) {
@@ -334,38 +380,59 @@ const routerIDsToChain = (ids, chains) => {
334
380
  }
335
381
  }
336
382
  if (match) {
337
- return match.map((route, i) => ({
338
- id: route.id,
339
- path: route.path,
340
- params: mergeParams(route.params, ids[i] && ids[i].params)
341
- }));
383
+ return match.map((route, i) => {
384
+ var _a;
385
+ return ({
386
+ id: route.id,
387
+ segments: route.segments,
388
+ params: mergeParams(route.params, (_a = ids[i]) === null || _a === void 0 ? void 0 : _a.params),
389
+ });
390
+ });
342
391
  }
343
392
  return null;
344
393
  };
345
- const routerPathToChain = (path, chains) => {
394
+ /**
395
+ * Finds the best match for the segments in the chains.
396
+ *
397
+ * Returns the best match or null when no match is found.
398
+ * When a chain is returned the parameters are updated from the segments.
399
+ * That is they contain both the componentProps of the <ion-route> and the parameter segments.
400
+ */
401
+ const findChainForSegments = (segments, chains) => {
346
402
  let match = null;
347
- let matches = 0;
403
+ let bestScore = 0;
348
404
  for (const chain of chains) {
349
- const matchedChain = matchesPath(path, chain);
405
+ const matchedChain = matchesSegments(segments, chain);
350
406
  if (matchedChain !== null) {
351
407
  const score = computePriority(matchedChain);
352
- if (score > matches) {
353
- matches = score;
408
+ if (score > bestScore) {
409
+ bestScore = score;
354
410
  match = matchedChain;
355
411
  }
356
412
  }
357
413
  }
358
414
  return match;
359
415
  };
416
+ /**
417
+ * Computes the priority of a chain.
418
+ *
419
+ * Parameter segments are given a lower priority over fixed segments.
420
+ *
421
+ * Considering the following 2 chains matching the path /path/to/page:
422
+ * - /path/to/:where
423
+ * - /path/to/page
424
+ *
425
+ * The second one will be given a higher priority because "page" is a fixed segment (vs ":where", a parameter segment).
426
+ */
360
427
  const computePriority = (chain) => {
361
428
  let score = 1;
362
429
  let level = 1;
363
430
  for (const route of chain) {
364
- for (const path of route.path) {
365
- if (path[0] === ':') {
431
+ for (const segment of route.segments) {
432
+ if (segment[0] === ':') {
366
433
  score += Math.pow(1, level);
367
434
  }
368
- else if (path !== '') {
435
+ else if (segment !== '') {
369
436
  score += Math.pow(2, level);
370
437
  }
371
438
  level++;
@@ -374,17 +441,20 @@ const computePriority = (chain) => {
374
441
  return score;
375
442
  };
376
443
  class RouterSegments {
377
- constructor(path) {
378
- this.path = path.slice();
444
+ constructor(segments) {
445
+ this.segments = segments.slice();
379
446
  }
380
447
  next() {
381
- if (this.path.length > 0) {
382
- return this.path.shift();
448
+ if (this.segments.length > 0) {
449
+ return this.segments.shift();
383
450
  }
384
451
  return '';
385
452
  }
386
453
  }
387
454
 
455
+ /*!
456
+ * (C) Ionic http://ionicframework.com - MIT License
457
+ */
388
458
  const readProp = (el, prop) => {
389
459
  if (prop in el) {
390
460
  return el[prop];
@@ -394,10 +464,15 @@ const readProp = (el, prop) => {
394
464
  }
395
465
  return null;
396
466
  };
467
+ /**
468
+ * Extracts the redirects (that is <ion-route-redirect> elements inside the root).
469
+ *
470
+ * The redirects are returned as a list of RouteRedirect.
471
+ */
397
472
  const readRedirects = (root) => {
398
473
  return Array.from(root.children)
399
- .filter(el => el.tagName === 'ION-ROUTE-REDIRECT')
400
- .map(el => {
474
+ .filter((el) => el.tagName === 'ION-ROUTE-REDIRECT')
475
+ .map((el) => {
401
476
  const to = readProp(el, 'to');
402
477
  return {
403
478
  from: parsePath(readProp(el, 'from')).segments,
@@ -405,24 +480,39 @@ const readRedirects = (root) => {
405
480
  };
406
481
  });
407
482
  };
483
+ /**
484
+ * Extracts all the routes (that is <ion-route> elements inside the root).
485
+ *
486
+ * The routes are returned as a list of chains - the flattened tree.
487
+ */
408
488
  const readRoutes = (root) => {
409
489
  return flattenRouterTree(readRouteNodes(root));
410
490
  };
491
+ /**
492
+ * Reads the route nodes as a tree modeled after the DOM tree of <ion-route> elements.
493
+ *
494
+ * Note: routes without a component are ignored together with their children.
495
+ */
411
496
  const readRouteNodes = (node) => {
412
497
  return Array.from(node.children)
413
- .filter(el => el.tagName === 'ION-ROUTE' && el.component)
414
- .map(el => {
498
+ .filter((el) => el.tagName === 'ION-ROUTE' && el.component)
499
+ .map((el) => {
415
500
  const component = readProp(el, 'component');
416
501
  return {
417
- path: parsePath(readProp(el, 'url')).segments,
502
+ segments: parsePath(readProp(el, 'url')).segments,
418
503
  id: component.toLowerCase(),
419
504
  params: el.componentProps,
420
505
  beforeLeave: el.beforeLeave,
421
506
  beforeEnter: el.beforeEnter,
422
- children: readRouteNodes(el)
507
+ children: readRouteNodes(el),
423
508
  };
424
509
  });
425
510
  };
511
+ /**
512
+ * Flattens a RouterTree in a list of chains.
513
+ *
514
+ * Each chain represents a path from the root node to a terminal node.
515
+ */
426
516
  const flattenRouterTree = (nodes) => {
427
517
  const chains = [];
428
518
  for (const node of nodes) {
@@ -430,15 +520,18 @@ const flattenRouterTree = (nodes) => {
430
520
  }
431
521
  return chains;
432
522
  };
523
+ /** Flattens a route node recursively and push each branch to the chains list. */
433
524
  const flattenNode = (chain, chains, node) => {
434
- chain = chain.slice();
435
- chain.push({
436
- id: node.id,
437
- path: node.path,
438
- params: node.params,
439
- beforeLeave: node.beforeLeave,
440
- beforeEnter: node.beforeEnter
441
- });
525
+ chain = [
526
+ ...chain,
527
+ {
528
+ id: node.id,
529
+ segments: node.segments,
530
+ params: node.params,
531
+ beforeLeave: node.beforeLeave,
532
+ beforeEnter: node.beforeEnter,
533
+ },
534
+ ];
442
535
  if (node.children.length === 0) {
443
536
  chains.push(chain);
444
537
  return;
@@ -480,12 +573,12 @@ const Router = class {
480
573
  }
481
574
  async componentWillLoad() {
482
575
  await waitUntilNavNode();
483
- const canProceed = await this.runGuards(this.getPath());
576
+ const canProceed = await this.runGuards(this.getSegments());
484
577
  if (canProceed !== true) {
485
578
  if (typeof canProceed === 'object') {
486
579
  const { redirect } = canProceed;
487
580
  const path = parsePath(redirect);
488
- this.setPath(path.segments, ROUTER_INTENT_NONE, path.queryString);
581
+ this.setSegments(path.segments, ROUTER_INTENT_NONE, path.queryString);
489
582
  await this.writeNavStateRoot(path.segments, ROUTER_INTENT_NONE);
490
583
  }
491
584
  }
@@ -499,7 +592,7 @@ const Router = class {
499
592
  }
500
593
  async onPopState() {
501
594
  const direction = this.historyDirection();
502
- let segments = this.getPath();
595
+ let segments = this.getSegments();
503
596
  const canProceed = await this.runGuards(segments);
504
597
  if (canProceed !== true) {
505
598
  if (typeof canProceed === 'object') {
@@ -512,7 +605,7 @@ const Router = class {
512
605
  return this.writeNavStateRoot(segments, direction);
513
606
  }
514
607
  onBackButton(ev) {
515
- ev.detail.register(0, processNextHandler => {
608
+ ev.detail.register(0, (processNextHandler) => {
516
609
  this.back();
517
610
  processNextHandler();
518
611
  });
@@ -531,16 +624,20 @@ const Router = class {
531
624
  return true;
532
625
  }
533
626
  /**
534
- * Navigate to the specified URL.
627
+ * Navigate to the specified path.
535
628
  *
536
- * @param url The url to navigate to.
629
+ * @param path The path to navigate to.
537
630
  * @param direction The direction of the animation. Defaults to `"forward"`.
538
631
  */
539
- async push(url, direction = 'forward', animation) {
540
- if (url.startsWith('.')) {
541
- url = (new URL(url, window.location.href)).pathname;
632
+ async push(path, direction = 'forward', animation) {
633
+ var _a;
634
+ if (path.startsWith('.')) {
635
+ const currentPath = (_a = this.previousPath) !== null && _a !== void 0 ? _a : '/';
636
+ // Convert currentPath to an URL by pre-pending a protocol and a host to resolve the relative path.
637
+ const url = new URL(path, `https://host/${currentPath}`);
638
+ path = url.pathname + url.search;
542
639
  }
543
- let parsedPath = parsePath(url);
640
+ let parsedPath = parsePath(path);
544
641
  const canProceed = await this.runGuards(parsedPath.segments);
545
642
  if (canProceed !== true) {
546
643
  if (typeof canProceed === 'object') {
@@ -550,12 +647,10 @@ const Router = class {
550
647
  return false;
551
648
  }
552
649
  }
553
- this.setPath(parsedPath.segments, direction, parsedPath.queryString);
650
+ this.setSegments(parsedPath.segments, direction, parsedPath.queryString);
554
651
  return this.writeNavStateRoot(parsedPath.segments, direction, animation);
555
652
  }
556
- /**
557
- * Go back to previous page in the window.history.
558
- */
653
+ /** Go back to previous page in the window.history. */
559
654
  back() {
560
655
  window.history.back();
561
656
  return Promise.resolve(this.waitPromise);
@@ -573,30 +668,30 @@ const Router = class {
573
668
  }
574
669
  const { ids, outlet } = await readNavState(window.document.body);
575
670
  const routes = readRoutes(this.el);
576
- const chain = routerIDsToChain(ids, routes);
671
+ const chain = findChainForIDs(ids, routes);
577
672
  if (!chain) {
578
- console.warn('[ion-router] no matching URL for ', ids.map(i => i.id));
673
+ console.warn('[ion-router] no matching URL for ', ids.map((i) => i.id));
579
674
  return false;
580
675
  }
581
- const path = chainToPath(chain);
582
- if (!path) {
676
+ const segments = chainToSegments(chain);
677
+ if (!segments) {
583
678
  console.warn('[ion-router] router could not match path because some required param is missing');
584
679
  return false;
585
680
  }
586
- this.setPath(path, direction);
587
- await this.safeWriteNavState(outlet, chain, ROUTER_INTENT_NONE, path, null, ids.length);
681
+ this.setSegments(segments, direction);
682
+ await this.safeWriteNavState(outlet, chain, ROUTER_INTENT_NONE, segments, null, ids.length);
588
683
  return true;
589
684
  }
590
- // This handler gets called when a `ion-route-redirect` component is added to the DOM or if the from or to property of such node changes.
685
+ /** This handler gets called when a `ion-route-redirect` component is added to the DOM or if the from or to property of such node changes. */
591
686
  onRedirectChanged() {
592
- const path = this.getPath();
593
- if (path && findRouteRedirect(path, readRedirects(this.el))) {
594
- this.writeNavStateRoot(path, ROUTER_INTENT_NONE);
687
+ const segments = this.getSegments();
688
+ if (segments && findRouteRedirect(segments, readRedirects(this.el))) {
689
+ this.writeNavStateRoot(segments, ROUTER_INTENT_NONE);
595
690
  }
596
691
  }
597
- // This handler gets called when a `ion-route` component is added to the DOM or if the from or to property of such node changes.
692
+ /** This handler gets called when a `ion-route` component is added to the DOM or if the from or to property of such node changes. */
598
693
  onRoutesChanged() {
599
- return this.writeNavStateRoot(this.getPath(), ROUTER_INTENT_NONE);
694
+ return this.writeNavStateRoot(this.getSegments(), ROUTER_INTENT_NONE);
600
695
  }
601
696
  historyDirection() {
602
697
  var _a;
@@ -616,36 +711,36 @@ const Router = class {
616
711
  }
617
712
  return ROUTER_INTENT_NONE;
618
713
  }
619
- async writeNavStateRoot(path, direction, animation) {
620
- if (!path) {
714
+ async writeNavStateRoot(segments, direction, animation) {
715
+ if (!segments) {
621
716
  console.error('[ion-router] URL is not part of the routing set');
622
717
  return false;
623
718
  }
624
719
  // lookup redirect rule
625
720
  const redirects = readRedirects(this.el);
626
- const redirect = findRouteRedirect(path, redirects);
721
+ const redirect = findRouteRedirect(segments, redirects);
627
722
  let redirectFrom = null;
628
723
  if (redirect) {
629
- const { segments, queryString } = redirect.to;
630
- this.setPath(segments, direction, queryString);
724
+ const { segments: toSegments, queryString } = redirect.to;
725
+ this.setSegments(toSegments, direction, queryString);
631
726
  redirectFrom = redirect.from;
632
- path = segments;
727
+ segments = toSegments;
633
728
  }
634
729
  // lookup route chain
635
730
  const routes = readRoutes(this.el);
636
- const chain = routerPathToChain(path, routes);
731
+ const chain = findChainForSegments(segments, routes);
637
732
  if (!chain) {
638
733
  console.error('[ion-router] the path does not match any route');
639
734
  return false;
640
735
  }
641
736
  // write DOM give
642
- return this.safeWriteNavState(document.body, chain, direction, path, redirectFrom, 0, animation);
737
+ return this.safeWriteNavState(document.body, chain, direction, segments, redirectFrom, 0, animation);
643
738
  }
644
- async safeWriteNavState(node, chain, direction, path, redirectFrom, index = 0, animation) {
739
+ async safeWriteNavState(node, chain, direction, segments, redirectFrom, index = 0, animation) {
645
740
  const unlock = await this.lock();
646
741
  let changed = false;
647
742
  try {
648
- changed = await this.writeNavState(node, chain, direction, path, redirectFrom, index, animation);
743
+ changed = await this.writeNavState(node, chain, direction, segments, redirectFrom, index, animation);
649
744
  }
650
745
  catch (e) {
651
746
  console.error(e);
@@ -656,17 +751,19 @@ const Router = class {
656
751
  async lock() {
657
752
  const p = this.waitPromise;
658
753
  let resolve;
659
- this.waitPromise = new Promise(r => resolve = r);
754
+ this.waitPromise = new Promise((r) => (resolve = r));
660
755
  if (p !== undefined) {
661
756
  await p;
662
757
  }
663
758
  return resolve;
664
759
  }
665
- // Executes the beforeLeave hook of the source route and the beforeEnter hook of the target route if they exist.
666
- //
667
- // When the beforeLeave hook does not return true (to allow navigating) then that value is returned early and the beforeEnter is executed.
668
- // Otherwise the beforeEnterHook hook of the target route is executed.
669
- async runGuards(to = this.getPath(), from) {
760
+ /**
761
+ * Executes the beforeLeave hook of the source route and the beforeEnter hook of the target route if they exist.
762
+ *
763
+ * When the beforeLeave hook does not return true (to allow navigating) then that value is returned early and the beforeEnter is executed.
764
+ * Otherwise the beforeEnterHook hook of the target route is executed.
765
+ */
766
+ async runGuards(to = this.getSegments(), from) {
670
767
  if (from === undefined) {
671
768
  from = parsePath(this.previousPath).segments;
672
769
  }
@@ -674,24 +771,24 @@ const Router = class {
674
771
  return true;
675
772
  }
676
773
  const routes = readRoutes(this.el);
677
- const fromChain = routerPathToChain(from, routes);
774
+ const fromChain = findChainForSegments(from, routes);
678
775
  const beforeLeaveHook = fromChain && fromChain[fromChain.length - 1].beforeLeave;
679
776
  const canLeave = beforeLeaveHook ? await beforeLeaveHook() : true;
680
777
  if (canLeave === false || typeof canLeave === 'object') {
681
778
  return canLeave;
682
779
  }
683
- const toChain = routerPathToChain(to, routes);
780
+ const toChain = findChainForSegments(to, routes);
684
781
  const beforeEnterHook = toChain && toChain[toChain.length - 1].beforeEnter;
685
782
  return beforeEnterHook ? beforeEnterHook() : true;
686
783
  }
687
- async writeNavState(node, chain, direction, path, redirectFrom, index = 0, animation) {
784
+ async writeNavState(node, chain, direction, segments, redirectFrom, index = 0, animation) {
688
785
  if (this.busy) {
689
786
  console.warn('[ion-router] router is busy, transition was cancelled');
690
787
  return false;
691
788
  }
692
789
  this.busy = true;
693
790
  // generate route event and emit will change
694
- const routeEvent = this.routeChangeEvent(path, redirectFrom);
791
+ const routeEvent = this.routeChangeEvent(segments, redirectFrom);
695
792
  if (routeEvent) {
696
793
  this.ionRouteWillChange.emit(routeEvent);
697
794
  }
@@ -703,21 +800,21 @@ const Router = class {
703
800
  }
704
801
  return changed;
705
802
  }
706
- setPath(path, direction, queryString) {
803
+ setSegments(segments, direction, queryString) {
707
804
  this.state++;
708
- writePath(window.history, this.root, this.useHash, path, direction, this.state, queryString);
805
+ writeSegments(window.history, this.root, this.useHash, segments, direction, this.state, queryString);
709
806
  }
710
- getPath() {
711
- return readPath(window.location, this.root, this.useHash);
807
+ getSegments() {
808
+ return readSegments(window.location, this.root, this.useHash);
712
809
  }
713
- routeChangeEvent(path, redirectFromPath) {
810
+ routeChangeEvent(toSegments, redirectFromSegments) {
714
811
  const from = this.previousPath;
715
- const to = generatePath(path);
812
+ const to = generatePath(toSegments);
716
813
  this.previousPath = to;
717
814
  if (to === from) {
718
815
  return null;
719
816
  }
720
- const redirectedFrom = redirectFromPath ? generatePath(redirectFromPath) : null;
817
+ const redirectedFrom = redirectFromSegments ? generatePath(redirectFromSegments) : null;
721
818
  return {
722
819
  from,
723
820
  redirectedFrom,