@ionic/angular 8.8.19 → 8.8.20-dev.11787158518.168a2fea

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 (600) hide show
  1. package/README.md +9 -7
  2. package/dist/common/directives/control-value-accessors/index.js +2 -0
  3. package/dist/common/directives/control-value-accessors/index.js.map +1 -0
  4. package/{common → dist/common}/directives/control-value-accessors/value-accessor.d.ts +1 -1
  5. package/dist/common/directives/control-value-accessors/value-accessor.js +152 -0
  6. package/dist/common/directives/control-value-accessors/value-accessor.js.map +1 -0
  7. package/{common → dist/common}/directives/navigation/back-button.d.ts +1 -1
  8. package/dist/common/directives/navigation/back-button.js +61 -0
  9. package/dist/common/directives/navigation/back-button.js.map +1 -0
  10. package/dist/common/directives/navigation/nav-params.js +47 -0
  11. package/dist/common/directives/navigation/nav-params.js.map +1 -0
  12. package/{common → dist/common}/directives/navigation/nav.d.ts +1 -1
  13. package/dist/common/directives/navigation/nav.js +49 -0
  14. package/dist/common/directives/navigation/nav.js.map +1 -0
  15. package/{common → dist/common}/directives/navigation/router-link-delegate.d.ts +2 -2
  16. package/dist/common/directives/navigation/router-link-delegate.js +188 -0
  17. package/dist/common/directives/navigation/router-link-delegate.js.map +1 -0
  18. package/{common → dist/common}/directives/navigation/router-outlet.d.ts +1 -1
  19. package/dist/common/directives/navigation/router-outlet.js +476 -0
  20. package/dist/common/directives/navigation/router-outlet.js.map +1 -0
  21. package/dist/common/directives/navigation/stack-controller.js +282 -0
  22. package/dist/common/directives/navigation/stack-controller.js.map +1 -0
  23. package/dist/common/directives/navigation/stack-utils.js +73 -0
  24. package/dist/common/directives/navigation/stack-utils.js.map +1 -0
  25. package/{common → dist/common}/directives/navigation/tabs.d.ts +9 -1
  26. package/dist/common/directives/navigation/tabs.js +290 -0
  27. package/dist/common/directives/navigation/tabs.js.map +1 -0
  28. package/{common → dist/common}/index.d.ts +1 -1
  29. package/dist/common/index.js +20 -0
  30. package/dist/common/index.js.map +1 -0
  31. package/{common → dist/common}/overlays/modal.d.ts +1 -1
  32. package/dist/common/overlays/modal.js +96 -0
  33. package/dist/common/overlays/modal.js.map +1 -0
  34. package/{common → dist/common}/overlays/popover.d.ts +1 -1
  35. package/dist/common/overlays/popover.js +84 -0
  36. package/dist/common/overlays/popover.js.map +1 -0
  37. package/{common → dist/common}/providers/angular-delegate.d.ts +2 -2
  38. package/dist/common/providers/angular-delegate.js +229 -0
  39. package/dist/common/providers/angular-delegate.js.map +1 -0
  40. package/dist/common/providers/config.js +44 -0
  41. package/dist/common/providers/config.js.map +1 -0
  42. package/dist/common/providers/dom-controller.js +44 -0
  43. package/dist/common/providers/dom-controller.js.map +1 -0
  44. package/dist/common/providers/menu-controller.js +114 -0
  45. package/dist/common/providers/menu-controller.js.map +1 -0
  46. package/dist/common/providers/nav-controller.js +232 -0
  47. package/dist/common/providers/nav-controller.js.map +1 -0
  48. package/dist/common/providers/platform.js +256 -0
  49. package/dist/common/providers/platform.js.map +1 -0
  50. package/dist/common/types/interfaces.js +2 -0
  51. package/dist/common/types/interfaces.js.map +1 -0
  52. package/dist/common/types/ionic-lifecycle-hooks.js +5 -0
  53. package/dist/common/types/ionic-lifecycle-hooks.js.map +1 -0
  54. package/dist/common/types/overlay-options.js +2 -0
  55. package/dist/common/types/overlay-options.js.map +1 -0
  56. package/dist/common/utils/overlay.js +26 -0
  57. package/dist/common/utils/overlay.js.map +1 -0
  58. package/dist/common/utils/proxy.js +47 -0
  59. package/dist/common/utils/proxy.js.map +1 -0
  60. package/dist/common/utils/routing.js +55 -0
  61. package/dist/common/utils/routing.js.map +1 -0
  62. package/dist/common/utils/util.js +10 -0
  63. package/dist/common/utils/util.js.map +1 -0
  64. package/dist/lazy/app-initialize.js +29 -0
  65. package/dist/lazy/app-initialize.js.map +1 -0
  66. package/dist/lazy/directives/angular-component-lib/utils.js +59 -0
  67. package/dist/lazy/directives/angular-component-lib/utils.js.map +1 -0
  68. package/{directives → dist/lazy/directives}/control-value-accessors/boolean-value-accessor.d.ts +1 -1
  69. package/dist/lazy/directives/control-value-accessors/boolean-value-accessor.js +47 -0
  70. package/dist/lazy/directives/control-value-accessors/boolean-value-accessor.js.map +1 -0
  71. package/dist/lazy/directives/control-value-accessors/index.js +5 -0
  72. package/dist/lazy/directives/control-value-accessors/index.js.map +1 -0
  73. package/{directives → dist/lazy/directives}/control-value-accessors/numeric-value-accessor.d.ts +1 -1
  74. package/dist/lazy/directives/control-value-accessors/numeric-value-accessor.js +55 -0
  75. package/dist/lazy/directives/control-value-accessors/numeric-value-accessor.js.map +1 -0
  76. package/{directives → dist/lazy/directives}/control-value-accessors/select-value-accessor.d.ts +1 -1
  77. package/dist/lazy/directives/control-value-accessors/select-value-accessor.js +44 -0
  78. package/dist/lazy/directives/control-value-accessors/select-value-accessor.js.map +1 -0
  79. package/{directives → dist/lazy/directives}/control-value-accessors/text-value-accessor.d.ts +1 -1
  80. package/dist/lazy/directives/control-value-accessors/text-value-accessor.js +43 -0
  81. package/dist/lazy/directives/control-value-accessors/text-value-accessor.js.map +1 -0
  82. package/dist/lazy/directives/navigation/ion-back-button.js +24 -0
  83. package/dist/lazy/directives/navigation/ion-back-button.js.map +1 -0
  84. package/dist/lazy/directives/navigation/ion-nav.js +21 -0
  85. package/dist/lazy/directives/navigation/ion-nav.js.map +1 -0
  86. package/dist/lazy/directives/navigation/ion-router-outlet.js +52 -0
  87. package/dist/lazy/directives/navigation/ion-router-outlet.js.map +1 -0
  88. package/dist/lazy/directives/navigation/ion-tabs.js +58 -0
  89. package/dist/lazy/directives/navigation/ion-tabs.js.map +1 -0
  90. package/dist/lazy/directives/navigation/router-link-delegate.js +32 -0
  91. package/dist/lazy/directives/navigation/router-link-delegate.js.map +1 -0
  92. package/dist/lazy/directives/overlays/modal.js +22 -0
  93. package/dist/lazy/directives/overlays/modal.js.map +1 -0
  94. package/dist/lazy/directives/overlays/popover.js +18 -0
  95. package/dist/lazy/directives/overlays/popover.js.map +1 -0
  96. package/{directives → dist/lazy/directives}/proxies-list.d.ts +1 -1
  97. package/dist/lazy/directives/proxies-list.js +89 -0
  98. package/dist/lazy/directives/proxies-list.js.map +1 -0
  99. package/{directives → dist/lazy/directives}/proxies.d.ts +290 -191
  100. package/dist/lazy/directives/proxies.js +2759 -0
  101. package/dist/lazy/directives/proxies.js.map +1 -0
  102. package/dist/lazy/directives/validators/index.js +3 -0
  103. package/dist/lazy/directives/validators/index.js.map +1 -0
  104. package/dist/lazy/directives/validators/max-validator.js +26 -0
  105. package/dist/lazy/directives/validators/max-validator.js.map +1 -0
  106. package/dist/lazy/directives/validators/min-validator.js +26 -0
  107. package/dist/lazy/directives/validators/min-validator.js.map +1 -0
  108. package/{index.d.ts → dist/lazy/index.d.ts} +1 -2
  109. package/dist/lazy/index.js +34 -0
  110. package/dist/lazy/index.js.map +1 -0
  111. package/dist/lazy/ionic-module.d.ts +38 -0
  112. package/dist/lazy/ionic-module.js +121 -0
  113. package/dist/lazy/ionic-module.js.map +1 -0
  114. package/dist/lazy/providers/action-sheet-controller.js +18 -0
  115. package/dist/lazy/providers/action-sheet-controller.js.map +1 -0
  116. package/dist/lazy/providers/alert-controller.js +18 -0
  117. package/dist/lazy/providers/alert-controller.js.map +1 -0
  118. package/dist/lazy/providers/animation-controller.js +37 -0
  119. package/dist/lazy/providers/animation-controller.js.map +1 -0
  120. package/dist/lazy/providers/gesture-controller.js +32 -0
  121. package/dist/lazy/providers/gesture-controller.js.map +1 -0
  122. package/dist/lazy/providers/loading-controller.js +18 -0
  123. package/dist/lazy/providers/loading-controller.js.map +1 -0
  124. package/dist/lazy/providers/menu-controller.js +18 -0
  125. package/dist/lazy/providers/menu-controller.js.map +1 -0
  126. package/dist/lazy/providers/modal-controller.js +25 -0
  127. package/dist/lazy/providers/modal-controller.js.map +1 -0
  128. package/dist/lazy/providers/popover-controller.js +19 -0
  129. package/dist/lazy/providers/popover-controller.js.map +1 -0
  130. package/dist/lazy/providers/toast-controller.js +18 -0
  131. package/dist/lazy/providers/toast-controller.js.map +1 -0
  132. package/{schematics → dist/schematics}/add/index.js +6 -6
  133. package/dist/schematics/utils/ast.js +64 -0
  134. package/{schematics → dist/schematics}/utils/config.js +10 -11
  135. package/{schematics → dist/schematics}/utils/package.js +6 -4
  136. package/dist/standalone/directives/angular-component-lib/utils.js +59 -0
  137. package/dist/standalone/directives/angular-component-lib/utils.js.map +1 -0
  138. package/dist/standalone/directives/checkbox.js +75 -0
  139. package/dist/standalone/directives/checkbox.js.map +1 -0
  140. package/dist/standalone/directives/datetime.js +93 -0
  141. package/dist/standalone/directives/datetime.js.map +1 -0
  142. package/dist/standalone/directives/icon.js +35 -0
  143. package/dist/standalone/directives/icon.js.map +1 -0
  144. package/dist/standalone/directives/index.js +13 -0
  145. package/dist/standalone/directives/index.js.map +1 -0
  146. package/dist/standalone/directives/input-otp.js +89 -0
  147. package/dist/standalone/directives/input-otp.js.map +1 -0
  148. package/dist/standalone/directives/input.js +112 -0
  149. package/dist/standalone/directives/input.js.map +1 -0
  150. package/dist/standalone/directives/ion-accordion-group.d.ts +21 -0
  151. package/dist/standalone/directives/ion-accordion-group.js +40 -0
  152. package/dist/standalone/directives/ion-accordion-group.js.map +1 -0
  153. package/dist/standalone/directives/ion-accordion.d.ts +12 -0
  154. package/dist/standalone/directives/ion-accordion.js +36 -0
  155. package/dist/standalone/directives/ion-accordion.js.map +1 -0
  156. package/dist/standalone/directives/ion-action-sheet.d.ts +58 -0
  157. package/dist/standalone/directives/ion-action-sheet.js +62 -0
  158. package/dist/standalone/directives/ion-action-sheet.js.map +1 -0
  159. package/dist/standalone/directives/ion-alert.d.ts +58 -0
  160. package/dist/standalone/directives/ion-alert.js +62 -0
  161. package/dist/standalone/directives/ion-alert.js.map +1 -0
  162. package/dist/standalone/directives/ion-app.d.ts +12 -0
  163. package/dist/standalone/directives/ion-app.js +36 -0
  164. package/dist/standalone/directives/ion-app.js.map +1 -0
  165. package/dist/standalone/directives/ion-avatar.d.ts +12 -0
  166. package/dist/standalone/directives/ion-avatar.js +35 -0
  167. package/dist/standalone/directives/ion-avatar.js.map +1 -0
  168. package/dist/standalone/directives/ion-backdrop.d.ts +18 -0
  169. package/dist/standalone/directives/ion-backdrop.js +40 -0
  170. package/dist/standalone/directives/ion-backdrop.js.map +1 -0
  171. package/dist/standalone/directives/ion-badge.d.ts +12 -0
  172. package/dist/standalone/directives/ion-badge.js +36 -0
  173. package/dist/standalone/directives/ion-badge.js.map +1 -0
  174. package/dist/standalone/directives/ion-breadcrumb.d.ts +23 -0
  175. package/dist/standalone/directives/ion-breadcrumb.js +43 -0
  176. package/dist/standalone/directives/ion-breadcrumb.js.map +1 -0
  177. package/dist/standalone/directives/ion-breadcrumbs.d.ts +19 -0
  178. package/dist/standalone/directives/ion-breadcrumbs.js +40 -0
  179. package/dist/standalone/directives/ion-breadcrumbs.js.map +1 -0
  180. package/dist/standalone/directives/ion-button.d.ts +23 -0
  181. package/dist/standalone/directives/ion-button.js +43 -0
  182. package/dist/standalone/directives/ion-button.js.map +1 -0
  183. package/dist/standalone/directives/ion-buttons.d.ts +12 -0
  184. package/dist/standalone/directives/ion-buttons.js +36 -0
  185. package/dist/standalone/directives/ion-buttons.js.map +1 -0
  186. package/dist/standalone/directives/ion-card-content.d.ts +12 -0
  187. package/dist/standalone/directives/ion-card-content.js +36 -0
  188. package/dist/standalone/directives/ion-card-content.js.map +1 -0
  189. package/dist/standalone/directives/ion-card-header.d.ts +12 -0
  190. package/dist/standalone/directives/ion-card-header.js +36 -0
  191. package/dist/standalone/directives/ion-card-header.js.map +1 -0
  192. package/dist/standalone/directives/ion-card-subtitle.d.ts +12 -0
  193. package/dist/standalone/directives/ion-card-subtitle.js +36 -0
  194. package/dist/standalone/directives/ion-card-subtitle.js.map +1 -0
  195. package/dist/standalone/directives/ion-card-title.d.ts +12 -0
  196. package/dist/standalone/directives/ion-card-title.js +36 -0
  197. package/dist/standalone/directives/ion-card-title.js.map +1 -0
  198. package/dist/standalone/directives/ion-card.d.ts +12 -0
  199. package/dist/standalone/directives/ion-card.js +36 -0
  200. package/dist/standalone/directives/ion-card.js.map +1 -0
  201. package/dist/standalone/directives/ion-chip.d.ts +12 -0
  202. package/dist/standalone/directives/ion-chip.js +36 -0
  203. package/dist/standalone/directives/ion-chip.js.map +1 -0
  204. package/dist/standalone/directives/ion-col.d.ts +12 -0
  205. package/dist/standalone/directives/ion-col.js +36 -0
  206. package/dist/standalone/directives/ion-col.js.map +1 -0
  207. package/dist/standalone/directives/ion-content.d.ts +33 -0
  208. package/dist/standalone/directives/ion-content.js +47 -0
  209. package/dist/standalone/directives/ion-content.js.map +1 -0
  210. package/dist/standalone/directives/ion-datetime-button.d.ts +12 -0
  211. package/dist/standalone/directives/ion-datetime-button.js +36 -0
  212. package/dist/standalone/directives/ion-datetime-button.js.map +1 -0
  213. package/dist/standalone/directives/ion-fab-button.d.ts +23 -0
  214. package/dist/standalone/directives/ion-fab-button.js +43 -0
  215. package/dist/standalone/directives/ion-fab-button.js.map +1 -0
  216. package/dist/standalone/directives/ion-fab-list.d.ts +12 -0
  217. package/dist/standalone/directives/ion-fab-list.js +36 -0
  218. package/dist/standalone/directives/ion-fab-list.js.map +1 -0
  219. package/dist/standalone/directives/ion-fab.d.ts +12 -0
  220. package/dist/standalone/directives/ion-fab.js +37 -0
  221. package/dist/standalone/directives/ion-fab.js.map +1 -0
  222. package/dist/standalone/directives/ion-footer.d.ts +12 -0
  223. package/dist/standalone/directives/ion-footer.js +36 -0
  224. package/dist/standalone/directives/ion-footer.js.map +1 -0
  225. package/dist/standalone/directives/ion-grid.d.ts +12 -0
  226. package/dist/standalone/directives/ion-grid.js +36 -0
  227. package/dist/standalone/directives/ion-grid.js.map +1 -0
  228. package/dist/standalone/directives/ion-header.d.ts +12 -0
  229. package/dist/standalone/directives/ion-header.js +36 -0
  230. package/dist/standalone/directives/ion-header.js.map +1 -0
  231. package/dist/standalone/directives/ion-img.d.ts +28 -0
  232. package/dist/standalone/directives/ion-img.js +46 -0
  233. package/dist/standalone/directives/ion-img.js.map +1 -0
  234. package/dist/standalone/directives/ion-infinite-scroll-content.d.ts +12 -0
  235. package/dist/standalone/directives/ion-infinite-scroll-content.js +36 -0
  236. package/dist/standalone/directives/ion-infinite-scroll-content.js.map +1 -0
  237. package/dist/standalone/directives/ion-infinite-scroll.d.ts +21 -0
  238. package/dist/standalone/directives/ion-infinite-scroll.js +41 -0
  239. package/dist/standalone/directives/ion-infinite-scroll.js.map +1 -0
  240. package/dist/standalone/directives/ion-input-password-toggle.d.ts +12 -0
  241. package/dist/standalone/directives/ion-input-password-toggle.js +36 -0
  242. package/dist/standalone/directives/ion-input-password-toggle.js.map +1 -0
  243. package/dist/standalone/directives/ion-item-divider.d.ts +12 -0
  244. package/dist/standalone/directives/ion-item-divider.js +36 -0
  245. package/dist/standalone/directives/ion-item-divider.js.map +1 -0
  246. package/dist/standalone/directives/ion-item-group.d.ts +12 -0
  247. package/dist/standalone/directives/ion-item-group.js +35 -0
  248. package/dist/standalone/directives/ion-item-group.js.map +1 -0
  249. package/dist/standalone/directives/ion-item-option.d.ts +12 -0
  250. package/dist/standalone/directives/ion-item-option.js +36 -0
  251. package/dist/standalone/directives/ion-item-option.js.map +1 -0
  252. package/dist/standalone/directives/ion-item-options.d.ts +18 -0
  253. package/dist/standalone/directives/ion-item-options.js +40 -0
  254. package/dist/standalone/directives/ion-item-options.js.map +1 -0
  255. package/dist/standalone/directives/ion-item-sliding.d.ts +18 -0
  256. package/dist/standalone/directives/ion-item-sliding.js +41 -0
  257. package/dist/standalone/directives/ion-item-sliding.js.map +1 -0
  258. package/dist/standalone/directives/ion-item.d.ts +12 -0
  259. package/dist/standalone/directives/ion-item.js +36 -0
  260. package/dist/standalone/directives/ion-item.js.map +1 -0
  261. package/dist/standalone/directives/ion-label.d.ts +12 -0
  262. package/dist/standalone/directives/ion-label.js +36 -0
  263. package/dist/standalone/directives/ion-label.js.map +1 -0
  264. package/dist/standalone/directives/ion-list-header.d.ts +12 -0
  265. package/dist/standalone/directives/ion-list-header.js +36 -0
  266. package/dist/standalone/directives/ion-list-header.js.map +1 -0
  267. package/dist/standalone/directives/ion-list.d.ts +12 -0
  268. package/dist/standalone/directives/ion-list.js +37 -0
  269. package/dist/standalone/directives/ion-list.js.map +1 -0
  270. package/dist/standalone/directives/ion-loading.d.ts +58 -0
  271. package/dist/standalone/directives/ion-loading.js +62 -0
  272. package/dist/standalone/directives/ion-loading.js.map +1 -0
  273. package/dist/standalone/directives/ion-menu-button.d.ts +12 -0
  274. package/dist/standalone/directives/ion-menu-button.js +36 -0
  275. package/dist/standalone/directives/ion-menu-button.js.map +1 -0
  276. package/dist/standalone/directives/ion-menu-toggle.d.ts +12 -0
  277. package/dist/standalone/directives/ion-menu-toggle.js +36 -0
  278. package/dist/standalone/directives/ion-menu-toggle.js.map +1 -0
  279. package/dist/standalone/directives/ion-menu.d.ts +34 -0
  280. package/dist/standalone/directives/ion-menu.js +50 -0
  281. package/dist/standalone/directives/ion-menu.js.map +1 -0
  282. package/dist/standalone/directives/ion-nav-link.d.ts +12 -0
  283. package/dist/standalone/directives/ion-nav-link.js +36 -0
  284. package/dist/standalone/directives/ion-nav-link.js.map +1 -0
  285. package/dist/standalone/directives/ion-note.d.ts +12 -0
  286. package/dist/standalone/directives/ion-note.js +36 -0
  287. package/dist/standalone/directives/ion-note.js.map +1 -0
  288. package/dist/standalone/directives/ion-picker-column-option.d.ts +12 -0
  289. package/dist/standalone/directives/ion-picker-column-option.js +36 -0
  290. package/dist/standalone/directives/ion-picker-column-option.js.map +1 -0
  291. package/dist/standalone/directives/ion-picker-column.d.ts +21 -0
  292. package/dist/standalone/directives/ion-picker-column.js +41 -0
  293. package/dist/standalone/directives/ion-picker-column.js.map +1 -0
  294. package/dist/standalone/directives/ion-picker.d.ts +12 -0
  295. package/dist/standalone/directives/ion-picker.js +36 -0
  296. package/dist/standalone/directives/ion-picker.js.map +1 -0
  297. package/dist/standalone/directives/ion-progress-bar.d.ts +12 -0
  298. package/dist/standalone/directives/ion-progress-bar.js +36 -0
  299. package/dist/standalone/directives/ion-progress-bar.js.map +1 -0
  300. package/dist/standalone/directives/ion-radio.d.ts +23 -0
  301. package/dist/standalone/directives/ion-radio.js +43 -0
  302. package/dist/standalone/directives/ion-radio.js.map +1 -0
  303. package/dist/standalone/directives/ion-refresher-content.d.ts +12 -0
  304. package/dist/standalone/directives/ion-refresher-content.js +36 -0
  305. package/dist/standalone/directives/ion-refresher-content.js.map +1 -0
  306. package/dist/standalone/directives/ion-refresher.d.ts +45 -0
  307. package/dist/standalone/directives/ion-refresher.js +53 -0
  308. package/dist/standalone/directives/ion-refresher.js.map +1 -0
  309. package/dist/standalone/directives/ion-reorder-group.d.ts +44 -0
  310. package/dist/standalone/directives/ion-reorder-group.js +50 -0
  311. package/dist/standalone/directives/ion-reorder-group.js.map +1 -0
  312. package/dist/standalone/directives/ion-reorder.d.ts +12 -0
  313. package/dist/standalone/directives/ion-reorder.js +35 -0
  314. package/dist/standalone/directives/ion-reorder.js.map +1 -0
  315. package/dist/standalone/directives/ion-ripple-effect.d.ts +12 -0
  316. package/dist/standalone/directives/ion-ripple-effect.js +37 -0
  317. package/dist/standalone/directives/ion-ripple-effect.js.map +1 -0
  318. package/dist/standalone/directives/ion-row.d.ts +12 -0
  319. package/dist/standalone/directives/ion-row.js +35 -0
  320. package/dist/standalone/directives/ion-row.js.map +1 -0
  321. package/dist/standalone/directives/ion-segment-button.d.ts +12 -0
  322. package/dist/standalone/directives/ion-segment-button.js +36 -0
  323. package/dist/standalone/directives/ion-segment-button.js.map +1 -0
  324. package/dist/standalone/directives/ion-segment-content.d.ts +12 -0
  325. package/dist/standalone/directives/ion-segment-content.js +35 -0
  326. package/dist/standalone/directives/ion-segment-content.js.map +1 -0
  327. package/dist/standalone/directives/ion-segment-view.d.ts +19 -0
  328. package/dist/standalone/directives/ion-segment-view.js +40 -0
  329. package/dist/standalone/directives/ion-segment-view.js.map +1 -0
  330. package/dist/standalone/directives/ion-select-modal.d.ts +12 -0
  331. package/dist/standalone/directives/ion-select-modal.js +36 -0
  332. package/dist/standalone/directives/ion-select-modal.js.map +1 -0
  333. package/dist/standalone/directives/ion-select-option.d.ts +12 -0
  334. package/dist/standalone/directives/ion-select-option.js +36 -0
  335. package/dist/standalone/directives/ion-select-option.js.map +1 -0
  336. package/dist/standalone/directives/ion-skeleton-text.d.ts +12 -0
  337. package/dist/standalone/directives/ion-skeleton-text.js +36 -0
  338. package/dist/standalone/directives/ion-skeleton-text.js.map +1 -0
  339. package/dist/standalone/directives/ion-spinner.d.ts +12 -0
  340. package/dist/standalone/directives/ion-spinner.js +36 -0
  341. package/dist/standalone/directives/ion-spinner.js.map +1 -0
  342. package/dist/standalone/directives/ion-split-pane.d.ts +22 -0
  343. package/dist/standalone/directives/ion-split-pane.js +40 -0
  344. package/dist/standalone/directives/ion-split-pane.js.map +1 -0
  345. package/dist/standalone/directives/ion-tab-bar.d.ts +12 -0
  346. package/dist/standalone/directives/ion-tab-bar.js +36 -0
  347. package/dist/standalone/directives/ion-tab-bar.js.map +1 -0
  348. package/dist/standalone/directives/ion-tab-button.d.ts +12 -0
  349. package/dist/standalone/directives/ion-tab-button.js +36 -0
  350. package/dist/standalone/directives/ion-tab-button.js.map +1 -0
  351. package/dist/standalone/directives/ion-tab.d.ts +12 -0
  352. package/dist/standalone/directives/ion-tab.js +37 -0
  353. package/dist/standalone/directives/ion-tab.js.map +1 -0
  354. package/dist/standalone/directives/ion-text.d.ts +12 -0
  355. package/dist/standalone/directives/ion-text.js +36 -0
  356. package/dist/standalone/directives/ion-text.js.map +1 -0
  357. package/dist/standalone/directives/ion-thumbnail.d.ts +12 -0
  358. package/dist/standalone/directives/ion-thumbnail.js +35 -0
  359. package/dist/standalone/directives/ion-thumbnail.js.map +1 -0
  360. package/dist/standalone/directives/ion-title.d.ts +12 -0
  361. package/dist/standalone/directives/ion-title.js +36 -0
  362. package/dist/standalone/directives/ion-title.js.map +1 -0
  363. package/dist/standalone/directives/ion-toast.d.ts +58 -0
  364. package/dist/standalone/directives/ion-toast.js +62 -0
  365. package/dist/standalone/directives/ion-toast.js.map +1 -0
  366. package/dist/standalone/directives/ion-toolbar.d.ts +12 -0
  367. package/dist/standalone/directives/ion-toolbar.js +36 -0
  368. package/dist/standalone/directives/ion-toolbar.js.map +1 -0
  369. package/dist/standalone/directives/proxies.d.ts +77 -0
  370. package/dist/standalone/directives/proxies.js +79 -0
  371. package/dist/standalone/directives/proxies.js.map +1 -0
  372. package/dist/standalone/directives/radio-group.js +59 -0
  373. package/dist/standalone/directives/radio-group.js.map +1 -0
  374. package/dist/standalone/directives/range.js +77 -0
  375. package/dist/standalone/directives/range.js.map +1 -0
  376. package/dist/standalone/directives/searchbar.js +81 -0
  377. package/dist/standalone/directives/searchbar.js.map +1 -0
  378. package/dist/standalone/directives/segment.js +59 -0
  379. package/dist/standalone/directives/segment.js.map +1 -0
  380. package/dist/standalone/directives/select.js +83 -0
  381. package/dist/standalone/directives/select.js.map +1 -0
  382. package/dist/standalone/directives/textarea.js +90 -0
  383. package/dist/standalone/directives/textarea.js.map +1 -0
  384. package/dist/standalone/directives/toggle.js +75 -0
  385. package/dist/standalone/directives/toggle.js.map +1 -0
  386. package/{standalone → dist/standalone}/index.d.ts +1 -2
  387. package/dist/standalone/index.js +24 -0
  388. package/dist/standalone/index.js.map +1 -0
  389. package/dist/standalone/navigation/back-button.js +32 -0
  390. package/dist/standalone/navigation/back-button.js.map +1 -0
  391. package/dist/standalone/navigation/nav.js +28 -0
  392. package/dist/standalone/navigation/nav.js.map +1 -0
  393. package/dist/standalone/navigation/router-link-delegate.js +26 -0
  394. package/dist/standalone/navigation/router-link-delegate.js.map +1 -0
  395. package/dist/standalone/navigation/router-outlet.js +60 -0
  396. package/dist/standalone/navigation/router-outlet.js.map +1 -0
  397. package/dist/standalone/navigation/tabs.js +57 -0
  398. package/dist/standalone/navigation/tabs.js.map +1 -0
  399. package/dist/standalone/overlays/modal.js +32 -0
  400. package/dist/standalone/overlays/modal.js.map +1 -0
  401. package/dist/standalone/overlays/popover.js +28 -0
  402. package/dist/standalone/overlays/popover.js.map +1 -0
  403. package/dist/standalone/providers/action-sheet-controller.js +20 -0
  404. package/dist/standalone/providers/action-sheet-controller.js.map +1 -0
  405. package/dist/standalone/providers/alert-controller.js +20 -0
  406. package/dist/standalone/providers/alert-controller.js.map +1 -0
  407. package/dist/standalone/providers/animation-controller.js +37 -0
  408. package/dist/standalone/providers/animation-controller.js.map +1 -0
  409. package/dist/standalone/providers/gesture-controller.js +32 -0
  410. package/dist/standalone/providers/gesture-controller.js.map +1 -0
  411. package/dist/standalone/providers/ionic-angular.js +38 -0
  412. package/dist/standalone/providers/ionic-angular.js.map +1 -0
  413. package/dist/standalone/providers/loading-controller.js +20 -0
  414. package/dist/standalone/providers/loading-controller.js.map +1 -0
  415. package/dist/standalone/providers/menu-controller.js +18 -0
  416. package/dist/standalone/providers/menu-controller.js.map +1 -0
  417. package/dist/standalone/providers/modal-controller.js +27 -0
  418. package/dist/standalone/providers/modal-controller.js.map +1 -0
  419. package/dist/standalone/providers/popover-controller.js +21 -0
  420. package/dist/standalone/providers/popover-controller.js.map +1 -0
  421. package/dist/standalone/providers/toast-controller.js +20 -0
  422. package/dist/standalone/providers/toast-controller.js.map +1 -0
  423. package/package.json +172 -30
  424. package/esm2022/app-initialize.mjs +0 -29
  425. package/esm2022/common/directives/control-value-accessors/index.mjs +0 -2
  426. package/esm2022/common/directives/control-value-accessors/value-accessor.mjs +0 -153
  427. package/esm2022/common/directives/navigation/back-button.mjs +0 -61
  428. package/esm2022/common/directives/navigation/nav-params.mjs +0 -47
  429. package/esm2022/common/directives/navigation/nav.mjs +0 -49
  430. package/esm2022/common/directives/navigation/router-link-delegate.mjs +0 -190
  431. package/esm2022/common/directives/navigation/router-outlet.mjs +0 -480
  432. package/esm2022/common/directives/navigation/stack-controller.mjs +0 -283
  433. package/esm2022/common/directives/navigation/stack-utils.mjs +0 -73
  434. package/esm2022/common/directives/navigation/tabs.mjs +0 -279
  435. package/esm2022/common/index.mjs +0 -20
  436. package/esm2022/common/ionic-angular-common.mjs +0 -5
  437. package/esm2022/common/overlays/modal.mjs +0 -103
  438. package/esm2022/common/overlays/popover.mjs +0 -91
  439. package/esm2022/common/providers/angular-delegate.mjs +0 -210
  440. package/esm2022/common/providers/config.mjs +0 -45
  441. package/esm2022/common/providers/dom-controller.mjs +0 -45
  442. package/esm2022/common/providers/menu-controller.mjs +0 -114
  443. package/esm2022/common/providers/nav-controller.mjs +0 -235
  444. package/esm2022/common/providers/platform.mjs +0 -258
  445. package/esm2022/common/types/interfaces.mjs +0 -2
  446. package/esm2022/common/types/ionic-lifecycle-hooks.mjs +0 -5
  447. package/esm2022/common/types/overlay-options.mjs +0 -2
  448. package/esm2022/common/utils/overlay.mjs +0 -26
  449. package/esm2022/common/utils/proxy.mjs +0 -47
  450. package/esm2022/common/utils/routing.mjs +0 -55
  451. package/esm2022/common/utils/util.mjs +0 -10
  452. package/esm2022/directives/angular-component-lib/utils.mjs +0 -59
  453. package/esm2022/directives/control-value-accessors/boolean-value-accessor.mjs +0 -42
  454. package/esm2022/directives/control-value-accessors/index.mjs +0 -5
  455. package/esm2022/directives/control-value-accessors/numeric-value-accessor.mjs +0 -50
  456. package/esm2022/directives/control-value-accessors/select-value-accessor.mjs +0 -39
  457. package/esm2022/directives/control-value-accessors/text-value-accessor.mjs +0 -38
  458. package/esm2022/directives/navigation/ion-back-button.mjs +0 -24
  459. package/esm2022/directives/navigation/ion-nav.mjs +0 -21
  460. package/esm2022/directives/navigation/ion-router-outlet.mjs +0 -52
  461. package/esm2022/directives/navigation/ion-tabs.mjs +0 -59
  462. package/esm2022/directives/navigation/router-link-delegate.mjs +0 -32
  463. package/esm2022/directives/overlays/modal.mjs +0 -22
  464. package/esm2022/directives/overlays/popover.mjs +0 -18
  465. package/esm2022/directives/proxies-list.mjs +0 -90
  466. package/esm2022/directives/proxies.mjs +0 -2373
  467. package/esm2022/directives/validators/index.mjs +0 -3
  468. package/esm2022/directives/validators/max-validator.mjs +0 -27
  469. package/esm2022/directives/validators/min-validator.mjs +0 -27
  470. package/esm2022/index.mjs +0 -32
  471. package/esm2022/ionic-angular.mjs +0 -5
  472. package/esm2022/ionic-module.mjs +0 -111
  473. package/esm2022/providers/action-sheet-controller.mjs +0 -19
  474. package/esm2022/providers/alert-controller.mjs +0 -19
  475. package/esm2022/providers/animation-controller.mjs +0 -38
  476. package/esm2022/providers/gesture-controller.mjs +0 -33
  477. package/esm2022/providers/loading-controller.mjs +0 -19
  478. package/esm2022/providers/menu-controller.mjs +0 -19
  479. package/esm2022/providers/modal-controller.mjs +0 -26
  480. package/esm2022/providers/picker-controller.mjs +0 -22
  481. package/esm2022/providers/popover-controller.mjs +0 -19
  482. package/esm2022/providers/toast-controller.mjs +0 -19
  483. package/esm2022/standalone/directives/angular-component-lib/utils.mjs +0 -59
  484. package/esm2022/standalone/directives/checkbox.mjs +0 -76
  485. package/esm2022/standalone/directives/datetime.mjs +0 -95
  486. package/esm2022/standalone/directives/icon.mjs +0 -35
  487. package/esm2022/standalone/directives/index.mjs +0 -13
  488. package/esm2022/standalone/directives/input-otp.mjs +0 -90
  489. package/esm2022/standalone/directives/input.mjs +0 -113
  490. package/esm2022/standalone/directives/proxies.mjs +0 -2260
  491. package/esm2022/standalone/directives/radio-group.mjs +0 -60
  492. package/esm2022/standalone/directives/range.mjs +0 -78
  493. package/esm2022/standalone/directives/searchbar.mjs +0 -82
  494. package/esm2022/standalone/directives/segment.mjs +0 -60
  495. package/esm2022/standalone/directives/select.mjs +0 -84
  496. package/esm2022/standalone/directives/textarea.mjs +0 -91
  497. package/esm2022/standalone/directives/toggle.mjs +0 -76
  498. package/esm2022/standalone/index.mjs +0 -25
  499. package/esm2022/standalone/ionic-angular-standalone.mjs +0 -5
  500. package/esm2022/standalone/navigation/back-button.mjs +0 -32
  501. package/esm2022/standalone/navigation/nav.mjs +0 -28
  502. package/esm2022/standalone/navigation/router-link-delegate.mjs +0 -28
  503. package/esm2022/standalone/navigation/router-outlet.mjs +0 -60
  504. package/esm2022/standalone/navigation/tabs.mjs +0 -58
  505. package/esm2022/standalone/overlays/modal.mjs +0 -32
  506. package/esm2022/standalone/overlays/popover.mjs +0 -28
  507. package/esm2022/standalone/providers/action-sheet-controller.mjs +0 -21
  508. package/esm2022/standalone/providers/alert-controller.mjs +0 -21
  509. package/esm2022/standalone/providers/animation-controller.mjs +0 -38
  510. package/esm2022/standalone/providers/gesture-controller.mjs +0 -33
  511. package/esm2022/standalone/providers/ionic-angular.mjs +0 -38
  512. package/esm2022/standalone/providers/loading-controller.mjs +0 -21
  513. package/esm2022/standalone/providers/menu-controller.mjs +0 -19
  514. package/esm2022/standalone/providers/modal-controller.mjs +0 -28
  515. package/esm2022/standalone/providers/picker-controller.mjs +0 -24
  516. package/esm2022/standalone/providers/popover-controller.mjs +0 -21
  517. package/esm2022/standalone/providers/toast-controller.mjs +0 -21
  518. package/fesm2022/ionic-angular-common.mjs +0 -2791
  519. package/fesm2022/ionic-angular-common.mjs.map +0 -1
  520. package/fesm2022/ionic-angular-standalone.mjs +0 -3562
  521. package/fesm2022/ionic-angular-standalone.mjs.map +0 -1
  522. package/fesm2022/ionic-angular.mjs +0 -3139
  523. package/fesm2022/ionic-angular.mjs.map +0 -1
  524. package/ionic-module.d.ts +0 -28
  525. package/providers/picker-controller.d.ts +0 -11
  526. package/schematics/utils/ast.js +0 -32
  527. package/standalone/directives/proxies.d.ts +0 -1035
  528. package/standalone/providers/picker-controller.d.ts +0 -11
  529. /package/{common → dist/common}/directives/control-value-accessors/index.d.ts +0 -0
  530. /package/{common → dist/common}/directives/navigation/nav-params.d.ts +0 -0
  531. /package/{common → dist/common}/directives/navigation/stack-controller.d.ts +0 -0
  532. /package/{common → dist/common}/directives/navigation/stack-utils.d.ts +0 -0
  533. /package/{common → dist/common}/providers/config.d.ts +0 -0
  534. /package/{common → dist/common}/providers/dom-controller.d.ts +0 -0
  535. /package/{common → dist/common}/providers/menu-controller.d.ts +0 -0
  536. /package/{common → dist/common}/providers/nav-controller.d.ts +0 -0
  537. /package/{common → dist/common}/providers/platform.d.ts +0 -0
  538. /package/{common → dist/common}/types/interfaces.d.ts +0 -0
  539. /package/{common → dist/common}/types/ionic-lifecycle-hooks.d.ts +0 -0
  540. /package/{common → dist/common}/types/overlay-options.d.ts +0 -0
  541. /package/{common → dist/common}/utils/overlay.d.ts +0 -0
  542. /package/{common → dist/common}/utils/proxy.d.ts +0 -0
  543. /package/{common → dist/common}/utils/routing.d.ts +0 -0
  544. /package/{common → dist/common}/utils/util.d.ts +0 -0
  545. /package/{app-initialize.d.ts → dist/lazy/app-initialize.d.ts} +0 -0
  546. /package/{directives → dist/lazy/directives}/angular-component-lib/utils.d.ts +0 -0
  547. /package/{directives → dist/lazy/directives}/control-value-accessors/index.d.ts +0 -0
  548. /package/{directives → dist/lazy/directives}/navigation/ion-back-button.d.ts +0 -0
  549. /package/{directives → dist/lazy/directives}/navigation/ion-nav.d.ts +0 -0
  550. /package/{directives → dist/lazy/directives}/navigation/ion-router-outlet.d.ts +0 -0
  551. /package/{directives → dist/lazy/directives}/navigation/ion-tabs.d.ts +0 -0
  552. /package/{directives → dist/lazy/directives}/navigation/router-link-delegate.d.ts +0 -0
  553. /package/{directives → dist/lazy/directives}/overlays/modal.d.ts +0 -0
  554. /package/{directives → dist/lazy/directives}/overlays/popover.d.ts +0 -0
  555. /package/{directives → dist/lazy/directives}/validators/index.d.ts +0 -0
  556. /package/{directives → dist/lazy/directives}/validators/max-validator.d.ts +0 -0
  557. /package/{directives → dist/lazy/directives}/validators/min-validator.d.ts +0 -0
  558. /package/{providers → dist/lazy/providers}/action-sheet-controller.d.ts +0 -0
  559. /package/{providers → dist/lazy/providers}/alert-controller.d.ts +0 -0
  560. /package/{providers → dist/lazy/providers}/animation-controller.d.ts +0 -0
  561. /package/{providers → dist/lazy/providers}/gesture-controller.d.ts +0 -0
  562. /package/{providers → dist/lazy/providers}/loading-controller.d.ts +0 -0
  563. /package/{providers → dist/lazy/providers}/menu-controller.d.ts +0 -0
  564. /package/{providers → dist/lazy/providers}/modal-controller.d.ts +0 -0
  565. /package/{providers → dist/lazy/providers}/popover-controller.d.ts +0 -0
  566. /package/{providers → dist/lazy/providers}/toast-controller.d.ts +0 -0
  567. /package/{schematics → dist/schematics}/add/files/root/theme/variables.css +0 -0
  568. /package/{schematics → dist/schematics}/add/schema.json +0 -0
  569. /package/{schematics → dist/schematics}/collection.json +0 -0
  570. /package/{standalone → dist/standalone}/directives/angular-component-lib/utils.d.ts +0 -0
  571. /package/{standalone → dist/standalone}/directives/checkbox.d.ts +0 -0
  572. /package/{standalone → dist/standalone}/directives/datetime.d.ts +0 -0
  573. /package/{standalone → dist/standalone}/directives/icon.d.ts +0 -0
  574. /package/{standalone → dist/standalone}/directives/index.d.ts +0 -0
  575. /package/{standalone → dist/standalone}/directives/input-otp.d.ts +0 -0
  576. /package/{standalone → dist/standalone}/directives/input.d.ts +0 -0
  577. /package/{standalone → dist/standalone}/directives/radio-group.d.ts +0 -0
  578. /package/{standalone → dist/standalone}/directives/range.d.ts +0 -0
  579. /package/{standalone → dist/standalone}/directives/searchbar.d.ts +0 -0
  580. /package/{standalone → dist/standalone}/directives/segment.d.ts +0 -0
  581. /package/{standalone → dist/standalone}/directives/select.d.ts +0 -0
  582. /package/{standalone → dist/standalone}/directives/textarea.d.ts +0 -0
  583. /package/{standalone → dist/standalone}/directives/toggle.d.ts +0 -0
  584. /package/{standalone → dist/standalone}/navigation/back-button.d.ts +0 -0
  585. /package/{standalone → dist/standalone}/navigation/nav.d.ts +0 -0
  586. /package/{standalone → dist/standalone}/navigation/router-link-delegate.d.ts +0 -0
  587. /package/{standalone → dist/standalone}/navigation/router-outlet.d.ts +0 -0
  588. /package/{standalone → dist/standalone}/navigation/tabs.d.ts +0 -0
  589. /package/{standalone → dist/standalone}/overlays/modal.d.ts +0 -0
  590. /package/{standalone → dist/standalone}/overlays/popover.d.ts +0 -0
  591. /package/{standalone → dist/standalone}/providers/action-sheet-controller.d.ts +0 -0
  592. /package/{standalone → dist/standalone}/providers/alert-controller.d.ts +0 -0
  593. /package/{standalone → dist/standalone}/providers/animation-controller.d.ts +0 -0
  594. /package/{standalone → dist/standalone}/providers/gesture-controller.d.ts +0 -0
  595. /package/{standalone → dist/standalone}/providers/ionic-angular.d.ts +0 -0
  596. /package/{standalone → dist/standalone}/providers/loading-controller.d.ts +0 -0
  597. /package/{standalone → dist/standalone}/providers/menu-controller.d.ts +0 -0
  598. /package/{standalone → dist/standalone}/providers/modal-controller.d.ts +0 -0
  599. /package/{standalone → dist/standalone}/providers/popover-controller.d.ts +0 -0
  600. /package/{standalone → dist/standalone}/providers/toast-controller.d.ts +0 -0
@@ -0,0 +1,232 @@
1
+ import { Injectable, Optional } from '@angular/core';
2
+ import { NavigationStart, NavigationCancel, NavigationError, } from '@angular/router';
3
+ import * as i0 from "@angular/core";
4
+ import * as i1 from "./platform";
5
+ import * as i2 from "@angular/common";
6
+ import * as i3 from "@angular/router";
7
+ export class NavController {
8
+ location;
9
+ serializer;
10
+ router;
11
+ topOutlet;
12
+ direction = DEFAULT_DIRECTION;
13
+ animated = DEFAULT_ANIMATED;
14
+ animationBuilder;
15
+ guessDirection = 'forward';
16
+ guessAnimation;
17
+ lastNavId = -1;
18
+ constructor(platform, location, serializer, router) {
19
+ this.location = location;
20
+ this.serializer = serializer;
21
+ this.router = router;
22
+ // Subscribe to router events to detect direction
23
+ if (router) {
24
+ router.events.subscribe((ev) => {
25
+ if (ev instanceof NavigationStart) {
26
+ // restoredState is set if the browser back/forward button is used
27
+ const id = ev.restoredState ? ev.restoredState.navigationId : ev.id;
28
+ this.guessDirection = this.guessAnimation = id < this.lastNavId ? 'back' : 'forward';
29
+ this.lastNavId = this.guessDirection === 'forward' ? ev.id : id;
30
+ }
31
+ // Reset explicit direction when navigation is canceled (e.g., guard rejection)
32
+ // to prevent stale direction from leaking into the next navigation
33
+ if (ev instanceof NavigationCancel || ev instanceof NavigationError) {
34
+ this.direction = DEFAULT_DIRECTION;
35
+ this.animated = DEFAULT_ANIMATED;
36
+ this.animationBuilder = undefined;
37
+ }
38
+ });
39
+ }
40
+ // Subscribe to backButton events
41
+ platform.backButton.subscribeWithPriority(0, (processNextHandler) => {
42
+ this.pop();
43
+ processNextHandler();
44
+ });
45
+ }
46
+ /**
47
+ * This method uses Angular's [Router](https://angular.io/api/router/Router) under the hood,
48
+ * it's equivalent to calling `this.router.navigateByUrl()`, but it's explicit about the **direction** of the transition.
49
+ *
50
+ * Going **forward** means that a new page is going to be pushed to the stack of the outlet (ion-router-outlet),
51
+ * and that it will show a "forward" animation by default.
52
+ *
53
+ * Navigating forward can also be triggered in a declarative manner by using the `[routerDirection]` directive:
54
+ *
55
+ * ```html
56
+ * <a routerLink="/path/to/page" routerDirection="forward">Link</a>
57
+ * ```
58
+ */
59
+ navigateForward(url, options = {}) {
60
+ this.setDirection('forward', options.animated, options.animationDirection, options.animation);
61
+ return this.navigate(url, options);
62
+ }
63
+ /**
64
+ * This method uses Angular's [Router](https://angular.io/api/router/Router) under the hood,
65
+ * it's equivalent to calling:
66
+ *
67
+ * ```ts
68
+ * this.navController.setDirection('back');
69
+ * this.router.navigateByUrl(path);
70
+ * ```
71
+ *
72
+ * Going **back** means that all the pages in the stack until the navigated page is found will be popped,
73
+ * and that it will show a "back" animation by default.
74
+ *
75
+ * Navigating back can also be triggered in a declarative manner by using the `[routerDirection]` directive:
76
+ *
77
+ * ```html
78
+ * <a routerLink="/path/to/page" routerDirection="back">Link</a>
79
+ * ```
80
+ */
81
+ navigateBack(url, options = {}) {
82
+ this.setDirection('back', options.animated, options.animationDirection, options.animation);
83
+ return this.navigate(url, options);
84
+ }
85
+ /**
86
+ * This method uses Angular's [Router](https://angular.io/api/router/Router) under the hood,
87
+ * it's equivalent to calling:
88
+ *
89
+ * ```ts
90
+ * this.navController.setDirection('root');
91
+ * this.router.navigateByUrl(path);
92
+ * ```
93
+ *
94
+ * Going **root** means that all existing pages in the stack will be removed,
95
+ * and the navigated page will become the single page in the stack.
96
+ *
97
+ * Navigating root can also be triggered in a declarative manner by using the `[routerDirection]` directive:
98
+ *
99
+ * ```html
100
+ * <a routerLink="/path/to/page" routerDirection="root">Link</a>
101
+ * ```
102
+ */
103
+ navigateRoot(url, options = {}) {
104
+ this.setDirection('root', options.animated, options.animationDirection, options.animation);
105
+ return this.navigate(url, options);
106
+ }
107
+ /**
108
+ * Same as [Location](https://angular.io/api/common/Location)'s back() method.
109
+ * It will use the standard `window.history.back()` under the hood, but featuring a `back` animation
110
+ * by default.
111
+ */
112
+ back(options = { animated: true, animationDirection: 'back' }) {
113
+ this.setDirection('back', options.animated, options.animationDirection, options.animation);
114
+ return this.location.back();
115
+ }
116
+ /**
117
+ * This methods goes back in the context of Ionic's stack navigation.
118
+ *
119
+ * It recursively finds the top active `ion-router-outlet` and calls `pop()`.
120
+ * This is the recommended way to go back when you are using `ion-router-outlet`.
121
+ *
122
+ * Resolves to `true` if it was able to pop.
123
+ */
124
+ async pop() {
125
+ let outlet = this.topOutlet;
126
+ while (outlet) {
127
+ if (await outlet.pop()) {
128
+ return true;
129
+ }
130
+ else {
131
+ outlet = outlet.parentOutlet;
132
+ }
133
+ }
134
+ return false;
135
+ }
136
+ /**
137
+ * This methods specifies the direction of the next navigation performed by the Angular router.
138
+ *
139
+ * `setDirection()` does not trigger any transition, it just sets some flags to be consumed by `ion-router-outlet`.
140
+ *
141
+ * It's recommended to use `navigateForward()`, `navigateBack()` and `navigateRoot()` instead of `setDirection()`.
142
+ */
143
+ setDirection(direction, animated, animationDirection, animationBuilder) {
144
+ this.direction = direction;
145
+ this.animated = getAnimation(direction, animated, animationDirection);
146
+ this.animationBuilder = animationBuilder;
147
+ }
148
+ /**
149
+ * @internal
150
+ */
151
+ setTopOutlet(outlet) {
152
+ this.topOutlet = outlet;
153
+ }
154
+ /**
155
+ * @internal
156
+ */
157
+ consumeTransition() {
158
+ let direction = 'root';
159
+ let animation;
160
+ const animationBuilder = this.animationBuilder;
161
+ if (this.direction === 'auto') {
162
+ direction = this.guessDirection;
163
+ animation = this.guessAnimation;
164
+ }
165
+ else {
166
+ animation = this.animated;
167
+ direction = this.direction;
168
+ }
169
+ this.direction = DEFAULT_DIRECTION;
170
+ this.animated = DEFAULT_ANIMATED;
171
+ this.animationBuilder = undefined;
172
+ return {
173
+ direction,
174
+ animation,
175
+ animationBuilder,
176
+ };
177
+ }
178
+ navigate(url, options) {
179
+ if (Array.isArray(url)) {
180
+ return this.router.navigate(url, options);
181
+ }
182
+ else {
183
+ /**
184
+ * navigateByUrl ignores any properties that
185
+ * would change the url, so things like queryParams
186
+ * would be ignored unless we create a url tree
187
+ * More Info: https://github.com/angular/angular/issues/18798
188
+ */
189
+ const urlTree = this.serializer.parse(url.toString());
190
+ if (options.queryParams !== undefined) {
191
+ urlTree.queryParams = { ...options.queryParams };
192
+ }
193
+ if (options.fragment !== undefined) {
194
+ urlTree.fragment = options.fragment;
195
+ }
196
+ /**
197
+ * `navigateByUrl` will still apply `NavigationExtras` properties
198
+ * that do not modify the url, such as `replaceUrl` which is why
199
+ * `options` is passed in here.
200
+ */
201
+ return this.router.navigateByUrl(urlTree, options);
202
+ }
203
+ }
204
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NavController, deps: [{ token: i1.Platform }, { token: i2.Location }, { token: i3.UrlSerializer }, { token: i3.Router, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
205
+ /** @nocollapse */ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NavController, providedIn: 'root' });
206
+ }
207
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NavController, decorators: [{
208
+ type: Injectable,
209
+ args: [{
210
+ providedIn: 'root',
211
+ }]
212
+ }], ctorParameters: () => [{ type: i1.Platform }, { type: i2.Location }, { type: i3.UrlSerializer }, { type: i3.Router, decorators: [{
213
+ type: Optional
214
+ }] }] });
215
+ const getAnimation = (direction, animated, animationDirection) => {
216
+ if (animated === false) {
217
+ return undefined;
218
+ }
219
+ if (animationDirection !== undefined) {
220
+ return animationDirection;
221
+ }
222
+ if (direction === 'forward' || direction === 'back') {
223
+ return direction;
224
+ }
225
+ else if (direction === 'root' && animated === true) {
226
+ return 'forward';
227
+ }
228
+ return undefined;
229
+ };
230
+ const DEFAULT_DIRECTION = 'auto';
231
+ const DEFAULT_ANIMATED = undefined;
232
+ //# sourceMappingURL=nav-controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nav-controller.js","sourceRoot":"","sources":["../../../src/common/providers/nav-controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAKL,eAAe,EACf,gBAAgB,EAChB,eAAe,GAChB,MAAM,iBAAiB,CAAC;;;;;AAkBzB,MAAM,OAAO,aAAa;IAWd;IACA;IACY;IAZd,SAAS,CAAmB;IAC5B,SAAS,GAAyC,iBAAiB,CAAC;IACpE,QAAQ,GAAkB,gBAAgB,CAAC;IAC3C,gBAAgB,CAAoB;IACpC,cAAc,GAAoB,SAAS,CAAC;IAC5C,cAAc,CAAgB;IAC9B,SAAS,GAAG,CAAC,CAAC,CAAC;IAEvB,YACE,QAAkB,EACV,QAAkB,EAClB,UAAyB,EACb,MAAe;QAF3B,aAAQ,GAAR,QAAQ,CAAU;QAClB,eAAU,GAAV,UAAU,CAAe;QACb,WAAM,GAAN,MAAM,CAAS;QAEnC,iDAAiD;QACjD,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,EAAE;gBAC7B,IAAI,EAAE,YAAY,eAAe,EAAE,CAAC;oBAClC,kEAAkE;oBAClE,MAAM,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,YA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AAO,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;gBACnC,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;YACtC,CAAC;YAED;;;;eAIG;YACH,OAAO,IAAI,CAAC,MAAO,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;0HA5NU,aAAa;8HAAb,aAAa,cAFZ,MAAM;;2FAEP,aAAa;kBAHzB,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB;;0BAcI,QAAQ;;AAkNb,MAAM,YAAY,GAAG,CACnB,SAA0B,EAC1B,QAA6B,EAC7B,kBAAkD,EACxB,EAAE;IAC5B,IAAI,QAAQ,KAAK,KAAK,EAAE,CAAC;QACvB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,kBAAkB,KAAK,SAAS,EAAE,CAAC;QACrC,OAAO,kBAAkB,CAAC;IAC5B,CAAC;IACD,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,MAAM,EAAE,CAAC;QACpD,OAAO,SAAS,CAAC;IACnB,CAAC;SAAM,IAAI,SAAS,KAAK,MAAM,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACrD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,MAAM,CAAC;AACjC,MAAM,gBAAgB,GAAG,SAAS,CAAC","sourcesContent":["import { Location } from '@angular/common';\nimport { Injectable, Optional } from '@angular/core';\nimport {\n NavigationExtras,\n Router,\n UrlSerializer,\n UrlTree,\n NavigationStart,\n NavigationCancel,\n NavigationError,\n} from '@angular/router';\nimport type { AnimationBuilder, NavDirection, RouterDirection } from '@ionic/core/components';\n\nimport { IonRouterOutlet } from '../directives/navigation/router-outlet';\n\nimport { Platform } from './platform';\n\nexport interface AnimationOptions {\n animated?: boolean;\n animation?: AnimationBuilder;\n animationDirection?: 'forward' | 'back';\n}\n\nexport interface NavigationOptions extends NavigationExtras, AnimationOptions {}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class NavController {\n private topOutlet?: IonRouterOutlet;\n private direction: 'forward' | 'back' | 'root' | 'auto' = DEFAULT_DIRECTION;\n private animated?: NavDirection = DEFAULT_ANIMATED;\n private animationBuilder?: AnimationBuilder;\n private guessDirection: RouterDirection = 'forward';\n private guessAnimation?: NavDirection;\n private lastNavId = -1;\n\n constructor(\n platform: Platform,\n private location: Location,\n private serializer: UrlSerializer,\n @Optional() private router?: Router\n ) {\n // Subscribe to router events to detect direction\n if (router) {\n router.events.subscribe((ev) => {\n if (ev instanceof NavigationStart) {\n // restoredState is set if the browser back/forward button is used\n const id = ev.restoredState ? ev.restoredState.navigationId : ev.id;\n this.guessDirection = this.guessAnimation = id < this.lastNavId ? 'back' : 'forward';\n this.lastNavId = this.guessDirection === 'forward' ? ev.id : id;\n }\n\n // Reset explicit direction when navigation is canceled (e.g., guard rejection)\n // to prevent stale direction from leaking into the next navigation\n if (ev instanceof NavigationCancel || ev instanceof NavigationError) {\n this.direction = DEFAULT_DIRECTION;\n this.animated = DEFAULT_ANIMATED;\n this.animationBuilder = undefined;\n }\n });\n }\n\n // Subscribe to backButton events\n platform.backButton.subscribeWithPriority(0, (processNextHandler) => {\n this.pop();\n processNextHandler();\n });\n }\n\n /**\n * This method uses Angular's [Router](https://angular.io/api/router/Router) under the hood,\n * it's equivalent to calling `this.router.navigateByUrl()`, but it's explicit about the **direction** of the transition.\n *\n * Going **forward** means that a new page is going to be pushed to the stack of the outlet (ion-router-outlet),\n * and that it will show a \"forward\" animation by default.\n *\n * Navigating forward can also be triggered in a declarative manner by using the `[routerDirection]` directive:\n *\n * ```html\n * <a routerLink=\"/path/to/page\" routerDirection=\"forward\">Link</a>\n * ```\n */\n navigateForward(url: string | UrlTree | any[], options: NavigationOptions = {}): Promise<boolean> {\n this.setDirection('forward', options.animated, options.animationDirection, options.animation);\n return this.navigate(url, options);\n }\n\n /**\n * This method uses Angular's [Router](https://angular.io/api/router/Router) under the hood,\n * it's equivalent to calling:\n *\n * ```ts\n * this.navController.setDirection('back');\n * this.router.navigateByUrl(path);\n * ```\n *\n * Going **back** means that all the pages in the stack until the navigated page is found will be popped,\n * and that it will show a \"back\" animation by default.\n *\n * Navigating back can also be triggered in a declarative manner by using the `[routerDirection]` directive:\n *\n * ```html\n * <a routerLink=\"/path/to/page\" routerDirection=\"back\">Link</a>\n * ```\n */\n navigateBack(url: string | UrlTree | any[], options: NavigationOptions = {}): Promise<boolean> {\n this.setDirection('back', options.animated, options.animationDirection, options.animation);\n return this.navigate(url, options);\n }\n\n /**\n * This method uses Angular's [Router](https://angular.io/api/router/Router) under the hood,\n * it's equivalent to calling:\n *\n * ```ts\n * this.navController.setDirection('root');\n * this.router.navigateByUrl(path);\n * ```\n *\n * Going **root** means that all existing pages in the stack will be removed,\n * and the navigated page will become the single page in the stack.\n *\n * Navigating root can also be triggered in a declarative manner by using the `[routerDirection]` directive:\n *\n * ```html\n * <a routerLink=\"/path/to/page\" routerDirection=\"root\">Link</a>\n * ```\n */\n navigateRoot(url: string | UrlTree | any[], options: NavigationOptions = {}): Promise<boolean> {\n this.setDirection('root', options.animated, options.animationDirection, options.animation);\n return this.navigate(url, options);\n }\n\n /**\n * Same as [Location](https://angular.io/api/common/Location)'s back() method.\n * It will use the standard `window.history.back()` under the hood, but featuring a `back` animation\n * by default.\n */\n back(options: AnimationOptions = { animated: true, animationDirection: 'back' }): void {\n this.setDirection('back', options.animated, options.animationDirection, options.animation);\n return this.location.back();\n }\n\n /**\n * This methods goes back in the context of Ionic's stack navigation.\n *\n * It recursively finds the top active `ion-router-outlet` and calls `pop()`.\n * This is the recommended way to go back when you are using `ion-router-outlet`.\n *\n * Resolves to `true` if it was able to pop.\n */\n async pop(): Promise<boolean> {\n let outlet = this.topOutlet;\n\n while (outlet) {\n if (await outlet.pop()) {\n return true;\n } else {\n outlet = outlet.parentOutlet;\n }\n }\n\n return false;\n }\n\n /**\n * This methods specifies the direction of the next navigation performed by the Angular router.\n *\n * `setDirection()` does not trigger any transition, it just sets some flags to be consumed by `ion-router-outlet`.\n *\n * It's recommended to use `navigateForward()`, `navigateBack()` and `navigateRoot()` instead of `setDirection()`.\n */\n setDirection(\n direction: RouterDirection,\n animated?: boolean,\n animationDirection?: 'forward' | 'back',\n animationBuilder?: AnimationBuilder\n ): void {\n this.direction = direction;\n this.animated = getAnimation(direction, animated, animationDirection);\n this.animationBuilder = animationBuilder;\n }\n\n /**\n * @internal\n */\n setTopOutlet(outlet: IonRouterOutlet): void {\n this.topOutlet = outlet;\n }\n\n /**\n * @internal\n */\n consumeTransition(): {\n direction: RouterDirection;\n animation: NavDirection | undefined;\n animationBuilder: AnimationBuilder | undefined;\n } {\n let direction: RouterDirection = 'root';\n let animation: NavDirection | undefined;\n const animationBuilder = this.animationBuilder;\n\n if (this.direction === 'auto') {\n direction = this.guessDirection;\n animation = this.guessAnimation;\n } else {\n animation = this.animated;\n direction = this.direction;\n }\n this.direction = DEFAULT_DIRECTION;\n this.animated = DEFAULT_ANIMATED;\n this.animationBuilder = undefined;\n\n return {\n direction,\n animation,\n animationBuilder,\n };\n }\n\n private navigate(url: string | UrlTree | any[], options: NavigationOptions) {\n if (Array.isArray(url)) {\n return this.router!.navigate(url, options);\n } else {\n /**\n * navigateByUrl ignores any properties that\n * would change the url, so things like queryParams\n * would be ignored unless we create a url tree\n * More Info: https://github.com/angular/angular/issues/18798\n */\n const urlTree = this.serializer.parse(url.toString());\n\n if (options.queryParams !== undefined) {\n urlTree.queryParams = { ...options.queryParams };\n }\n\n if (options.fragment !== undefined) {\n urlTree.fragment = options.fragment;\n }\n\n /**\n * `navigateByUrl` will still apply `NavigationExtras` properties\n * that do not modify the url, such as `replaceUrl` which is why\n * `options` is passed in here.\n */\n return this.router!.navigateByUrl(urlTree, options);\n }\n }\n}\n\nconst getAnimation = (\n direction: RouterDirection,\n animated: boolean | undefined,\n animationDirection: 'forward' | 'back' | undefined\n): NavDirection | undefined => {\n if (animated === false) {\n return undefined;\n }\n if (animationDirection !== undefined) {\n return animationDirection;\n }\n if (direction === 'forward' || direction === 'back') {\n return direction;\n } else if (direction === 'root' && animated === true) {\n return 'forward';\n }\n return undefined;\n};\n\nconst DEFAULT_DIRECTION = 'auto';\nconst DEFAULT_ANIMATED = undefined;\n"]}
@@ -0,0 +1,256 @@
1
+ import { DOCUMENT } from '@angular/common';
2
+ import { Inject, Injectable } from '@angular/core';
3
+ import { getPlatforms, isPlatform } from '@ionic/core/components';
4
+ import { Subject } from 'rxjs';
5
+ import * as i0 from "@angular/core";
6
+ export class Platform {
7
+ doc;
8
+ _readyPromise;
9
+ win;
10
+ /**
11
+ * @hidden
12
+ */
13
+ backButton = new Subject();
14
+ /**
15
+ * The keyboardDidShow event emits when the
16
+ * on-screen keyboard is presented.
17
+ */
18
+ keyboardDidShow = new Subject();
19
+ /**
20
+ * The keyboardDidHide event emits when the
21
+ * on-screen keyboard is hidden.
22
+ */
23
+ keyboardDidHide = new Subject();
24
+ /**
25
+ * The pause event emits when the native platform puts the application
26
+ * into the background, typically when the user switches to a different
27
+ * application. This event would emit when a Cordova app is put into
28
+ * the background, however, it would not fire on a standard web browser.
29
+ */
30
+ pause = new Subject();
31
+ /**
32
+ * The resume event emits when the native platform pulls the application
33
+ * out from the background. This event would emit when a Cordova app comes
34
+ * out from the background, however, it would not fire on a standard web browser.
35
+ */
36
+ resume = new Subject();
37
+ /**
38
+ * The resize event emits when the browser window has changed dimensions. This
39
+ * could be from a browser window being physically resized, or from a device
40
+ * changing orientation.
41
+ */
42
+ resize = new Subject();
43
+ constructor(doc, zone) {
44
+ this.doc = doc;
45
+ zone.run(() => {
46
+ this.win = doc.defaultView;
47
+ this.backButton.subscribeWithPriority = function (priority, callback) {
48
+ return this.subscribe((ev) => {
49
+ return ev.register(priority, (processNextHandler) => zone.run(() => callback(processNextHandler)));
50
+ });
51
+ };
52
+ proxyEvent(this.pause, doc, 'pause', zone);
53
+ proxyEvent(this.resume, doc, 'resume', zone);
54
+ proxyEvent(this.backButton, doc, 'ionBackButton', zone);
55
+ proxyEvent(this.resize, this.win, 'resize', zone);
56
+ proxyEvent(this.keyboardDidShow, this.win, 'ionKeyboardDidShow', zone);
57
+ proxyEvent(this.keyboardDidHide, this.win, 'ionKeyboardDidHide', zone);
58
+ let readyResolve;
59
+ this._readyPromise = new Promise((res) => {
60
+ readyResolve = res;
61
+ });
62
+ if (this.win?.['cordova']) {
63
+ doc.addEventListener('deviceready', () => {
64
+ readyResolve('cordova');
65
+ }, { once: true });
66
+ }
67
+ else {
68
+ readyResolve('dom');
69
+ }
70
+ });
71
+ }
72
+ /**
73
+ * @returns returns true/false based on platform.
74
+ * @description
75
+ * Depending on the platform the user is on, `is(platformName)` will
76
+ * return `true` or `false`. Note that the same app can return `true`
77
+ * for more than one platform name. For example, an app running from
78
+ * an iPad would return `true` for the platform names: `mobile`,
79
+ * `ios`, `ipad`, and `tablet`. Additionally, if the app was running
80
+ * from Cordova then `cordova` would be true, and if it was running
81
+ * from a web browser on the iPad then `mobileweb` would be `true`.
82
+ *
83
+ * ```
84
+ * import { Platform } from 'ionic-angular';
85
+ *
86
+ * @Component({...})
87
+ * export MyPage {
88
+ * constructor(public platform: Platform) {
89
+ * if (this.platform.is('ios')) {
90
+ * // This will only print when on iOS
91
+ * console.log('I am an iOS device!');
92
+ * }
93
+ * }
94
+ * }
95
+ * ```
96
+ *
97
+ * | Platform Name | Description |
98
+ * |-----------------|------------------------------------|
99
+ * | android | on a device running Android. |
100
+ * | capacitor | on a device running Capacitor. |
101
+ * | cordova | on a device running Cordova. |
102
+ * | ios | on a device running iOS. |
103
+ * | ipad | on an iPad device. |
104
+ * | iphone | on an iPhone device. |
105
+ * | phablet | on a phablet device. |
106
+ * | tablet | on a tablet device. |
107
+ * | electron | in Electron on a desktop device. |
108
+ * | pwa | as a PWA app. |
109
+ * | mobile | on a mobile device. |
110
+ * | mobileweb | on a mobile device in a browser. |
111
+ * | desktop | on a desktop device. |
112
+ * | hybrid | is a cordova or capacitor app. |
113
+ *
114
+ */
115
+ is(platformName) {
116
+ return isPlatform(this.win, platformName);
117
+ }
118
+ /**
119
+ * @returns the array of platforms
120
+ * @description
121
+ * Depending on what device you are on, `platforms` can return multiple values.
122
+ * Each possible value is a hierarchy of platforms. For example, on an iPhone,
123
+ * it would return `mobile`, `ios`, and `iphone`.
124
+ *
125
+ * ```
126
+ * import { Platform } from 'ionic-angular';
127
+ *
128
+ * @Component({...})
129
+ * export MyPage {
130
+ * constructor(public platform: Platform) {
131
+ * // This will print an array of the current platforms
132
+ * console.log(this.platform.platforms());
133
+ * }
134
+ * }
135
+ * ```
136
+ */
137
+ platforms() {
138
+ return getPlatforms(this.win);
139
+ }
140
+ /**
141
+ * Returns a promise when the platform is ready and native functionality
142
+ * can be called. If the app is running from within a web browser, then
143
+ * the promise will resolve when the DOM is ready. When the app is running
144
+ * from an application engine such as Cordova, then the promise will
145
+ * resolve when Cordova triggers the `deviceready` event.
146
+ *
147
+ * The resolved value is the `readySource`, which states which platform
148
+ * ready was used. For example, when Cordova is ready, the resolved ready
149
+ * source is `cordova`. The default ready source value will be `dom`. The
150
+ * `readySource` is useful if different logic should run depending on the
151
+ * platform the app is running from. For example, only Cordova can execute
152
+ * the status bar plugin, so the web should not run status bar plugin logic.
153
+ *
154
+ * ```
155
+ * import { Component } from '@angular/core';
156
+ * import { Platform } from 'ionic-angular';
157
+ *
158
+ * @Component({...})
159
+ * export MyApp {
160
+ * constructor(public platform: Platform) {
161
+ * this.platform.ready().then((readySource) => {
162
+ * console.log('Platform ready from', readySource);
163
+ * // Platform now ready, execute any required native code
164
+ * });
165
+ * }
166
+ * }
167
+ * ```
168
+ */
169
+ ready() {
170
+ return this._readyPromise;
171
+ }
172
+ /**
173
+ * Returns if this app is using right-to-left language direction or not.
174
+ * We recommend the app's `index.html` file already has the correct `dir`
175
+ * attribute value set, such as `<html dir="ltr">` or `<html dir="rtl">`.
176
+ * [W3C: Structural markup and right-to-left text in HTML](http://www.w3.org/International/questions/qa-html-dir)
177
+ */
178
+ get isRTL() {
179
+ return this.doc.dir === 'rtl';
180
+ }
181
+ /**
182
+ * Get the query string parameter
183
+ */
184
+ getQueryParam(key) {
185
+ return readQueryParam(this.win.location.href, key);
186
+ }
187
+ /**
188
+ * Returns `true` if the app is in landscape mode.
189
+ */
190
+ isLandscape() {
191
+ return !this.isPortrait();
192
+ }
193
+ /**
194
+ * Returns `true` if the app is in portrait mode.
195
+ */
196
+ isPortrait() {
197
+ return this.win.matchMedia?.('(orientation: portrait)').matches;
198
+ }
199
+ testUserAgent(expression) {
200
+ const nav = this.win.navigator;
201
+ return !!(nav?.userAgent && nav.userAgent.indexOf(expression) >= 0);
202
+ }
203
+ /**
204
+ * Get the current url.
205
+ */
206
+ url() {
207
+ return this.win.location.href;
208
+ }
209
+ /**
210
+ * Gets the width of the platform's viewport using `window.innerWidth`.
211
+ */
212
+ width() {
213
+ return this.win.innerWidth;
214
+ }
215
+ /**
216
+ * Gets the height of the platform's viewport using `window.innerHeight`.
217
+ */
218
+ height() {
219
+ return this.win.innerHeight;
220
+ }
221
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: Platform, deps: [{ token: DOCUMENT }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
222
+ /** @nocollapse */ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: Platform, providedIn: 'root' });
223
+ }
224
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: Platform, decorators: [{
225
+ type: Injectable,
226
+ args: [{
227
+ providedIn: 'root',
228
+ }]
229
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
230
+ type: Inject,
231
+ args: [DOCUMENT]
232
+ }] }, { type: i0.NgZone }] });
233
+ const readQueryParam = (url, key) => {
234
+ key = key.replace(/[[\]\\]/g, '\\$&');
235
+ const regex = new RegExp('[\\?&]' + key + '=([^&#]*)');
236
+ const results = regex.exec(url);
237
+ return results ? decodeURIComponent(results[1].replace(/\+/g, ' ')) : null;
238
+ };
239
+ const proxyEvent = (emitter, el, eventName, zone) => {
240
+ if (el) {
241
+ el.addEventListener(eventName, (ev) => {
242
+ /**
243
+ * `zone.run` is required to make sure that we are running inside the Angular zone
244
+ * at all times. This is necessary since an app that has Capacitor will
245
+ * override the `document.addEventListener` with its own implementation.
246
+ * The override causes the event to no longer be in the Angular zone.
247
+ */
248
+ zone.run(() => {
249
+ // ?? cordova might emit "null" events
250
+ const value = ev != null ? ev.detail : undefined;
251
+ emitter.next(value);
252
+ });
253
+ });
254
+ }
255
+ };
256
+ //# sourceMappingURL=platform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform.js","sourceRoot":"","sources":["../../../src/common/providers/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAU,MAAM,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,EAAgB,OAAO,EAAE,MAAM,MAAM,CAAC;;AAc7C,MAAM,OAAO,QAAQ;IA2CmB;IA1C9B,aAAa,CAAkB;IAC/B,GAAG,CAAM;IAEjB;;OAEG;IACH,UAAU,GAAG,IAAI,OAAO,EAA8C,CAAC;IAEvE;;;OAGG;IACH,eAAe,GAAG,IAAI,OAAO,EAAuB,CAAC;IAErD;;;OAGG;IACH,eAAe,GAAG,IAAI,OAAO,EAAQ,CAAC;IAEtC;;;;;OAKG;IACH,KAAK,GAAG,IAAI,OAAO,EAAQ,CAAC;IAE5B;;;;OAIG;IACH,MAAM,GAAG,IAAI,OAAO,EAAQ,CAAC;IAE7B;;;;OAIG;IACH,MAAM,GAAG,IAAI,OAAO,EAAQ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C,GAAG,CAAC,GAAG,EAAE;gBACZ,sCAAsC;gBACtC,MAAM,KAAK,GAAG,EAAE,IAAI,IAAI,CAAC,CAAC,CAAE,EAAU,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;gBAC1D,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACtB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { DOCUMENT } from '@angular/common';\nimport { NgZone, Inject, Injectable } from '@angular/core';\nimport { getPlatforms, isPlatform } from '@ionic/core/components';\nimport type { BackButtonEventDetail, KeyboardEventDetail, Platforms } from '@ionic/core/components';\nimport { Subscription, Subject } from 'rxjs';\n\n// TODO(FW-2827): types\n\nexport interface BackButtonEmitter extends Subject<BackButtonEventDetail> {\n subscribeWithPriority(\n priority: number,\n callback: (processNextHandler: () => void) => Promise<any> | void\n ): Subscription;\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class Platform {\n private _readyPromise: Promise<string>;\n private win: any;\n\n /**\n * @hidden\n */\n backButton = new Subject<BackButtonEventDetail>() as BackButtonEmitter;\n\n /**\n * The keyboardDidShow event emits when the\n * on-screen keyboard is presented.\n */\n keyboardDidShow = new Subject<KeyboardEventDetail>();\n\n /**\n * The keyboardDidHide event emits when the\n * on-screen keyboard is hidden.\n */\n keyboardDidHide = new Subject<void>();\n\n /**\n * The pause event emits when the native platform puts the application\n * into the background, typically when the user switches to a different\n * application. This event would emit when a Cordova app is put into\n * the background, however, it would not fire on a standard web browser.\n */\n pause = new Subject<void>();\n\n /**\n * The resume event emits when the native platform pulls the application\n * out from the background. This event would emit when a Cordova app comes\n * out from the background, however, it would not fire on a standard web browser.\n */\n resume = new Subject<void>();\n\n /**\n * The resize event emits when the browser window has changed dimensions. This\n * could be from a browser window being physically resized, or from a device\n * changing orientation.\n */\n resize = new Subject<void>();\n\n constructor(@Inject(DOCUMENT) private doc: any, zone: NgZone) {\n zone.run(() => {\n this.win = doc.defaultView;\n this.backButton.subscribeWithPriority = function (priority, callback) {\n return this.subscribe((ev) => {\n return ev.register(priority, (processNextHandler) => zone.run(() => callback(processNextHandler)));\n });\n };\n\n proxyEvent(this.pause, doc, 'pause', zone);\n proxyEvent(this.resume, doc, 'resume', zone);\n proxyEvent(this.backButton, doc, 'ionBackButton', zone);\n proxyEvent(this.resize, this.win, 'resize', zone);\n proxyEvent(this.keyboardDidShow, this.win, 'ionKeyboardDidShow', zone);\n proxyEvent(this.keyboardDidHide, this.win, 'ionKeyboardDidHide', zone);\n\n let readyResolve: (value: string) => void;\n this._readyPromise = new Promise((res) => {\n readyResolve = res;\n });\n if (this.win?.['cordova']) {\n doc.addEventListener(\n 'deviceready',\n () => {\n readyResolve('cordova');\n },\n { once: true }\n );\n } else {\n readyResolve!('dom');\n }\n });\n }\n\n /**\n * @returns returns true/false based on platform.\n * @description\n * Depending on the platform the user is on, `is(platformName)` will\n * return `true` or `false`. Note that the same app can return `true`\n * for more than one platform name. For example, an app running from\n * an iPad would return `true` for the platform names: `mobile`,\n * `ios`, `ipad`, and `tablet`. Additionally, if the app was running\n * from Cordova then `cordova` would be true, and if it was running\n * from a web browser on the iPad then `mobileweb` would be `true`.\n *\n * ```\n * import { Platform } from 'ionic-angular';\n *\n * @Component({...})\n * export MyPage {\n * constructor(public platform: Platform) {\n * if (this.platform.is('ios')) {\n * // This will only print when on iOS\n * console.log('I am an iOS device!');\n * }\n * }\n * }\n * ```\n *\n * | Platform Name | Description |\n * |-----------------|------------------------------------|\n * | android | on a device running Android. |\n * | capacitor | on a device running Capacitor. |\n * | cordova | on a device running Cordova. |\n * | ios | on a device running iOS. |\n * | ipad | on an iPad device. |\n * | iphone | on an iPhone device. |\n * | phablet | on a phablet device. |\n * | tablet | on a tablet device. |\n * | electron | in Electron on a desktop device. |\n * | pwa | as a PWA app. |\n * | mobile | on a mobile device. |\n * | mobileweb | on a mobile device in a browser. |\n * | desktop | on a desktop device. |\n * | hybrid | is a cordova or capacitor app. |\n *\n */\n is(platformName: Platforms): boolean {\n return isPlatform(this.win, platformName);\n }\n\n /**\n * @returns the array of platforms\n * @description\n * Depending on what device you are on, `platforms` can return multiple values.\n * Each possible value is a hierarchy of platforms. For example, on an iPhone,\n * it would return `mobile`, `ios`, and `iphone`.\n *\n * ```\n * import { Platform } from 'ionic-angular';\n *\n * @Component({...})\n * export MyPage {\n * constructor(public platform: Platform) {\n * // This will print an array of the current platforms\n * console.log(this.platform.platforms());\n * }\n * }\n * ```\n */\n platforms(): string[] {\n return getPlatforms(this.win);\n }\n\n /**\n * Returns a promise when the platform is ready and native functionality\n * can be called. If the app is running from within a web browser, then\n * the promise will resolve when the DOM is ready. When the app is running\n * from an application engine such as Cordova, then the promise will\n * resolve when Cordova triggers the `deviceready` event.\n *\n * The resolved value is the `readySource`, which states which platform\n * ready was used. For example, when Cordova is ready, the resolved ready\n * source is `cordova`. The default ready source value will be `dom`. The\n * `readySource` is useful if different logic should run depending on the\n * platform the app is running from. For example, only Cordova can execute\n * the status bar plugin, so the web should not run status bar plugin logic.\n *\n * ```\n * import { Component } from '@angular/core';\n * import { Platform } from 'ionic-angular';\n *\n * @Component({...})\n * export MyApp {\n * constructor(public platform: Platform) {\n * this.platform.ready().then((readySource) => {\n * console.log('Platform ready from', readySource);\n * // Platform now ready, execute any required native code\n * });\n * }\n * }\n * ```\n */\n ready(): Promise<string> {\n return this._readyPromise;\n }\n\n /**\n * Returns if this app is using right-to-left language direction or not.\n * We recommend the app's `index.html` file already has the correct `dir`\n * attribute value set, such as `<html dir=\"ltr\">` or `<html dir=\"rtl\">`.\n * [W3C: Structural markup and right-to-left text in HTML](http://www.w3.org/International/questions/qa-html-dir)\n */\n get isRTL(): boolean {\n return this.doc.dir === 'rtl';\n }\n\n /**\n * Get the query string parameter\n */\n getQueryParam(key: string): string | null {\n return readQueryParam(this.win.location.href, key);\n }\n\n /**\n * Returns `true` if the app is in landscape mode.\n */\n isLandscape(): boolean {\n return !this.isPortrait();\n }\n\n /**\n * Returns `true` if the app is in portrait mode.\n */\n isPortrait(): boolean {\n return this.win.matchMedia?.('(orientation: portrait)').matches;\n }\n\n testUserAgent(expression: string): boolean {\n const nav = this.win.navigator;\n return !!(nav?.userAgent && nav.userAgent.indexOf(expression) >= 0);\n }\n\n /**\n * Get the current url.\n */\n url(): string {\n return this.win.location.href;\n }\n\n /**\n * Gets the width of the platform's viewport using `window.innerWidth`.\n */\n width(): number {\n return this.win.innerWidth;\n }\n\n /**\n * Gets the height of the platform's viewport using `window.innerHeight`.\n */\n height(): number {\n return this.win.innerHeight;\n }\n}\n\nconst readQueryParam = (url: string, key: string) => {\n key = key.replace(/[[\\]\\\\]/g, '\\\\$&');\n const regex = new RegExp('[\\\\?&]' + key + '=([^&#]*)');\n const results = regex.exec(url);\n return results ? decodeURIComponent(results[1].replace(/\\+/g, ' ')) : null;\n};\n\nconst proxyEvent = <T>(emitter: Subject<T>, el: EventTarget, eventName: string, zone: NgZone) => {\n if (el) {\n el.addEventListener(eventName, (ev) => {\n /**\n * `zone.run` is required to make sure that we are running inside the Angular zone\n * at all times. This is necessary since an app that has Capacitor will\n * override the `document.addEventListener` with its own implementation.\n * The override causes the event to no longer be in the Angular zone.\n */\n zone.run(() => {\n // ?? cordova might emit \"null\" events\n const value = ev != null ? (ev as any).detail : undefined;\n emitter.next(value);\n });\n });\n }\n};\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/common/types/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["export interface IonicGlobal {\n config?: any; // TODO(FW-2827): type\n asyncQueue?: boolean;\n}\n\nexport interface IonicWindow extends Window {\n Ionic: IonicGlobal;\n __zone_symbol__requestAnimationFrame?: (ts: FrameRequestCallback) => number;\n}\n"]}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * https://ionicframework.com/docs/api/router-outlet#life-cycle-hooks
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=ionic-lifecycle-hooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ionic-lifecycle-hooks.js","sourceRoot":"","sources":["../../../src/common/types/ionic-lifecycle-hooks.ts"],"names":[],"mappings":"AAAA;;GAEG","sourcesContent":["/**\n * https://ionicframework.com/docs/api/router-outlet#life-cycle-hooks\n */\n\nexport interface ViewWillEnter {\n /**\n * Fired when the component routing to is about to animate into view.\n */\n ionViewWillEnter(): void;\n}\n\nexport interface ViewDidEnter {\n /**\n * Fired when the component routing to has finished animating.\n */\n ionViewDidEnter(): void;\n}\n\nexport interface ViewWillLeave {\n /**\n * Fired when the component routing from is about to animate.\n */\n ionViewWillLeave(): void;\n}\n\nexport interface ViewDidLeave {\n /**\n * Fired when the component routing to has finished animating.\n */\n ionViewDidLeave(): void;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=overlay-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlay-options.js","sourceRoot":"","sources":["../../../src/common/types/overlay-options.ts"],"names":[],"mappings":"","sourcesContent":["import type { Injector } from '@angular/core';\nimport type {\n ComponentRef,\n ModalOptions as CoreModalOptions,\n PopoverOptions as CorePopoverOptions,\n} from '@ionic/core/components';\n\n/**\n * Modal options with Angular-specific injector support.\n * Extends @ionic/core ModalOptions with an optional injector property.\n */\nexport type ModalOptions<T extends ComponentRef = ComponentRef> = CoreModalOptions<T> & {\n injector?: Injector;\n};\n\n/**\n * Popover options with Angular-specific injector support.\n * Extends @ionic/core PopoverOptions with an optional injector property.\n */\nexport type PopoverOptions<T extends ComponentRef = ComponentRef> = CorePopoverOptions<T> & {\n injector?: Injector;\n};\n"]}
@@ -0,0 +1,26 @@
1
+ // TODO(FW-2827): types
2
+ export class OverlayBaseController {
3
+ ctrl;
4
+ constructor(ctrl) {
5
+ this.ctrl = ctrl;
6
+ }
7
+ /**
8
+ * Creates a new overlay
9
+ */
10
+ create(opts) {
11
+ return this.ctrl.create((opts || {}));
12
+ }
13
+ /**
14
+ * When `id` is not provided, it dismisses the top overlay.
15
+ */
16
+ dismiss(data, role, id) {
17
+ return this.ctrl.dismiss(data, role, id);
18
+ }
19
+ /**
20
+ * Returns the top overlay.
21
+ */
22
+ getTop() {
23
+ return this.ctrl.getTop();
24
+ }
25
+ }
26
+ //# sourceMappingURL=overlay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlay.js","sourceRoot":"","sources":["../../../src/common/utils/overlay.ts"],"names":[],"mappings":"AAAA,uBAAuB;AAQvB,MAAM,OAAO,qBAAqB;IACZ;IAApB,YAAoB,IAAoC;QAApC,SAAI,GAAJ,IAAI,CAAgC;IAAG,CAAC;IAE5D;;OAEG;IACH,MAAM,CAAC,IAAW;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,IAAI,EAAE,CAAQ,CAAC,CAAC;IAC/C,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,IAAU,EAAE,IAAa,EAAE,EAAW;QAC5C,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,MAAM;QACJ,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IAC5B,CAAC;CACF","sourcesContent":["// TODO(FW-2827): types\n\nexport interface ControllerShape<Opts, HTMLElm> {\n create(options: Opts): Promise<HTMLElm>;\n dismiss(data?: any, role?: string, id?: string): Promise<boolean>;\n getTop(): Promise<HTMLElm | undefined>;\n}\n\nexport class OverlayBaseController<Opts, Overlay> implements ControllerShape<Opts, Overlay> {\n constructor(private ctrl: ControllerShape<Opts, Overlay>) {}\n\n /**\n * Creates a new overlay\n */\n create(opts?: Opts): Promise<Overlay> {\n return this.ctrl.create((opts || {}) as any);\n }\n\n /**\n * When `id` is not provided, it dismisses the top overlay.\n */\n dismiss(data?: any, role?: string, id?: string): Promise<boolean> {\n return this.ctrl.dismiss(data, role, id);\n }\n\n /**\n * Returns the top overlay.\n */\n getTop(): Promise<Overlay | undefined> {\n return this.ctrl.getTop();\n }\n}\n"]}
@@ -0,0 +1,47 @@
1
+ // TODO: Is there a way we can grab this from angular-component-lib instead?
2
+ /* eslint-disable */
3
+ /* tslint:disable */
4
+ import { fromEvent } from 'rxjs';
5
+ export const proxyInputs = (Cmp, inputs) => {
6
+ const Prototype = Cmp.prototype;
7
+ inputs.forEach((item) => {
8
+ Object.defineProperty(Prototype, item, {
9
+ get() {
10
+ return this.el[item];
11
+ },
12
+ set(val) {
13
+ this.z.runOutsideAngular(() => (this.el[item] = val));
14
+ },
15
+ });
16
+ });
17
+ };
18
+ export const proxyMethods = (Cmp, methods) => {
19
+ const Prototype = Cmp.prototype;
20
+ methods.forEach((methodName) => {
21
+ Prototype[methodName] = function () {
22
+ const args = arguments;
23
+ return this.z.runOutsideAngular(() => this.el[methodName].apply(this.el, args));
24
+ };
25
+ });
26
+ };
27
+ export const proxyOutputs = (instance, el, events) => {
28
+ events.forEach((eventName) => (instance[eventName] = fromEvent(el, eventName)));
29
+ };
30
+ // tslint:disable-next-line: only-arrow-functions
31
+ export function ProxyCmp(opts) {
32
+ const decorator = function (cls) {
33
+ const { defineCustomElementFn, inputs, methods } = opts;
34
+ if (defineCustomElementFn !== undefined) {
35
+ defineCustomElementFn();
36
+ }
37
+ if (inputs) {
38
+ proxyInputs(cls, inputs);
39
+ }
40
+ if (methods) {
41
+ proxyMethods(cls, methods);
42
+ }
43
+ return cls;
44
+ };
45
+ return decorator;
46
+ }
47
+ //# sourceMappingURL=proxy.js.map