@ionic/angular 8.8.19-dev.11787076261.138d5922 → 8.8.19-dev.11787083540.1511caf2
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.
- package/README.md +7 -9
- package/{dist/common → common}/directives/control-value-accessors/value-accessor.d.ts +1 -1
- package/{dist/common → common}/directives/navigation/back-button.d.ts +1 -1
- package/{dist/common → common}/directives/navigation/nav.d.ts +1 -1
- package/{dist/common → common}/directives/navigation/router-link-delegate.d.ts +2 -2
- package/{dist/common → common}/directives/navigation/router-outlet.d.ts +1 -1
- package/{dist/common → common}/directives/navigation/tabs.d.ts +1 -9
- package/{dist/common → common}/index.d.ts +1 -1
- package/{dist/common → common}/overlays/modal.d.ts +1 -1
- package/{dist/common → common}/overlays/popover.d.ts +1 -1
- package/{dist/common → common}/providers/angular-delegate.d.ts +2 -2
- package/{dist/lazy/directives → directives}/control-value-accessors/boolean-value-accessor.d.ts +1 -1
- package/{dist/lazy/directives → directives}/control-value-accessors/numeric-value-accessor.d.ts +1 -1
- package/{dist/lazy/directives → directives}/control-value-accessors/select-value-accessor.d.ts +1 -1
- package/{dist/lazy/directives → directives}/control-value-accessors/text-value-accessor.d.ts +1 -1
- package/{dist/lazy/directives → directives}/proxies-list.d.ts +1 -1
- package/{dist/lazy/directives → directives}/proxies.d.ts +191 -290
- package/esm2022/app-initialize.mjs +29 -0
- package/esm2022/common/directives/control-value-accessors/index.mjs +2 -0
- package/esm2022/common/directives/control-value-accessors/value-accessor.mjs +153 -0
- package/esm2022/common/directives/navigation/back-button.mjs +61 -0
- package/esm2022/common/directives/navigation/nav-params.mjs +47 -0
- package/esm2022/common/directives/navigation/nav.mjs +49 -0
- package/esm2022/common/directives/navigation/router-link-delegate.mjs +190 -0
- package/esm2022/common/directives/navigation/router-outlet.mjs +480 -0
- package/esm2022/common/directives/navigation/stack-controller.mjs +283 -0
- package/esm2022/common/directives/navigation/stack-utils.mjs +73 -0
- package/esm2022/common/directives/navigation/tabs.mjs +279 -0
- package/esm2022/common/index.mjs +20 -0
- package/esm2022/common/ionic-angular-common.mjs +5 -0
- package/esm2022/common/overlays/modal.mjs +103 -0
- package/esm2022/common/overlays/popover.mjs +91 -0
- package/esm2022/common/providers/angular-delegate.mjs +210 -0
- package/esm2022/common/providers/config.mjs +45 -0
- package/esm2022/common/providers/dom-controller.mjs +45 -0
- package/esm2022/common/providers/menu-controller.mjs +114 -0
- package/esm2022/common/providers/nav-controller.mjs +235 -0
- package/esm2022/common/providers/platform.mjs +258 -0
- package/esm2022/common/types/interfaces.mjs +2 -0
- package/esm2022/common/types/ionic-lifecycle-hooks.mjs +5 -0
- package/esm2022/common/types/overlay-options.mjs +2 -0
- package/esm2022/common/utils/overlay.mjs +26 -0
- package/esm2022/common/utils/proxy.mjs +47 -0
- package/esm2022/common/utils/routing.mjs +55 -0
- package/esm2022/common/utils/util.mjs +10 -0
- package/esm2022/directives/angular-component-lib/utils.mjs +59 -0
- package/esm2022/directives/control-value-accessors/boolean-value-accessor.mjs +42 -0
- package/esm2022/directives/control-value-accessors/index.mjs +5 -0
- package/esm2022/directives/control-value-accessors/numeric-value-accessor.mjs +50 -0
- package/esm2022/directives/control-value-accessors/select-value-accessor.mjs +39 -0
- package/esm2022/directives/control-value-accessors/text-value-accessor.mjs +38 -0
- package/esm2022/directives/navigation/ion-back-button.mjs +24 -0
- package/esm2022/directives/navigation/ion-nav.mjs +21 -0
- package/esm2022/directives/navigation/ion-router-outlet.mjs +52 -0
- package/esm2022/directives/navigation/ion-tabs.mjs +59 -0
- package/esm2022/directives/navigation/router-link-delegate.mjs +32 -0
- package/esm2022/directives/overlays/modal.mjs +22 -0
- package/esm2022/directives/overlays/popover.mjs +18 -0
- package/esm2022/directives/proxies-list.mjs +90 -0
- package/esm2022/directives/proxies.mjs +2373 -0
- package/esm2022/directives/validators/index.mjs +3 -0
- package/esm2022/directives/validators/max-validator.mjs +27 -0
- package/esm2022/directives/validators/min-validator.mjs +27 -0
- package/esm2022/index.mjs +32 -0
- package/esm2022/ionic-angular.mjs +5 -0
- package/esm2022/ionic-module.mjs +111 -0
- package/esm2022/providers/action-sheet-controller.mjs +19 -0
- package/esm2022/providers/alert-controller.mjs +19 -0
- package/esm2022/providers/animation-controller.mjs +38 -0
- package/esm2022/providers/gesture-controller.mjs +33 -0
- package/esm2022/providers/loading-controller.mjs +19 -0
- package/esm2022/providers/menu-controller.mjs +19 -0
- package/esm2022/providers/modal-controller.mjs +26 -0
- package/esm2022/providers/picker-controller.mjs +22 -0
- package/esm2022/providers/popover-controller.mjs +19 -0
- package/esm2022/providers/toast-controller.mjs +19 -0
- package/esm2022/standalone/directives/angular-component-lib/utils.mjs +59 -0
- package/esm2022/standalone/directives/checkbox.mjs +76 -0
- package/esm2022/standalone/directives/datetime.mjs +95 -0
- package/esm2022/standalone/directives/icon.mjs +35 -0
- package/esm2022/standalone/directives/index.mjs +13 -0
- package/esm2022/standalone/directives/input-otp.mjs +90 -0
- package/esm2022/standalone/directives/input.mjs +113 -0
- package/esm2022/standalone/directives/proxies.mjs +2260 -0
- package/esm2022/standalone/directives/radio-group.mjs +60 -0
- package/esm2022/standalone/directives/range.mjs +78 -0
- package/esm2022/standalone/directives/searchbar.mjs +82 -0
- package/esm2022/standalone/directives/segment.mjs +60 -0
- package/esm2022/standalone/directives/select.mjs +84 -0
- package/esm2022/standalone/directives/textarea.mjs +91 -0
- package/esm2022/standalone/directives/toggle.mjs +76 -0
- package/esm2022/standalone/index.mjs +25 -0
- package/esm2022/standalone/ionic-angular-standalone.mjs +5 -0
- package/esm2022/standalone/navigation/back-button.mjs +32 -0
- package/esm2022/standalone/navigation/nav.mjs +28 -0
- package/esm2022/standalone/navigation/router-link-delegate.mjs +28 -0
- package/esm2022/standalone/navigation/router-outlet.mjs +60 -0
- package/esm2022/standalone/navigation/tabs.mjs +58 -0
- package/esm2022/standalone/overlays/modal.mjs +32 -0
- package/esm2022/standalone/overlays/popover.mjs +28 -0
- package/esm2022/standalone/providers/action-sheet-controller.mjs +21 -0
- package/esm2022/standalone/providers/alert-controller.mjs +21 -0
- package/esm2022/standalone/providers/animation-controller.mjs +38 -0
- package/esm2022/standalone/providers/gesture-controller.mjs +33 -0
- package/esm2022/standalone/providers/ionic-angular.mjs +38 -0
- package/esm2022/standalone/providers/loading-controller.mjs +21 -0
- package/esm2022/standalone/providers/menu-controller.mjs +19 -0
- package/esm2022/standalone/providers/modal-controller.mjs +28 -0
- package/esm2022/standalone/providers/picker-controller.mjs +24 -0
- package/esm2022/standalone/providers/popover-controller.mjs +21 -0
- package/esm2022/standalone/providers/toast-controller.mjs +21 -0
- package/fesm2022/ionic-angular-common.mjs +2791 -0
- package/fesm2022/ionic-angular-common.mjs.map +1 -0
- package/fesm2022/ionic-angular-standalone.mjs +3562 -0
- package/fesm2022/ionic-angular-standalone.mjs.map +1 -0
- package/fesm2022/ionic-angular.mjs +3139 -0
- package/fesm2022/ionic-angular.mjs.map +1 -0
- package/{dist/lazy/index.d.ts → index.d.ts} +2 -1
- package/ionic-module.d.ts +28 -0
- package/package.json +30 -172
- package/providers/picker-controller.d.ts +11 -0
- package/{dist/schematics → schematics}/add/index.js +6 -6
- package/schematics/utils/ast.js +32 -0
- package/{dist/schematics → schematics}/utils/config.js +11 -10
- package/{dist/schematics → schematics}/utils/package.js +4 -6
- package/standalone/directives/proxies.d.ts +1035 -0
- package/{dist/standalone → standalone}/index.d.ts +2 -1
- package/standalone/providers/picker-controller.d.ts +11 -0
- package/dist/common/directives/control-value-accessors/index.js +0 -2
- package/dist/common/directives/control-value-accessors/index.js.map +0 -1
- package/dist/common/directives/control-value-accessors/value-accessor.js +0 -152
- package/dist/common/directives/control-value-accessors/value-accessor.js.map +0 -1
- package/dist/common/directives/navigation/back-button.js +0 -61
- package/dist/common/directives/navigation/back-button.js.map +0 -1
- package/dist/common/directives/navigation/nav-params.js +0 -47
- package/dist/common/directives/navigation/nav-params.js.map +0 -1
- package/dist/common/directives/navigation/nav.js +0 -49
- package/dist/common/directives/navigation/nav.js.map +0 -1
- package/dist/common/directives/navigation/router-link-delegate.js +0 -188
- package/dist/common/directives/navigation/router-link-delegate.js.map +0 -1
- package/dist/common/directives/navigation/router-outlet.js +0 -476
- package/dist/common/directives/navigation/router-outlet.js.map +0 -1
- package/dist/common/directives/navigation/stack-controller.js +0 -282
- package/dist/common/directives/navigation/stack-controller.js.map +0 -1
- package/dist/common/directives/navigation/stack-utils.js +0 -73
- package/dist/common/directives/navigation/stack-utils.js.map +0 -1
- package/dist/common/directives/navigation/tabs.js +0 -290
- package/dist/common/directives/navigation/tabs.js.map +0 -1
- package/dist/common/index.js +0 -20
- package/dist/common/index.js.map +0 -1
- package/dist/common/overlays/modal.js +0 -96
- package/dist/common/overlays/modal.js.map +0 -1
- package/dist/common/overlays/popover.js +0 -84
- package/dist/common/overlays/popover.js.map +0 -1
- package/dist/common/providers/angular-delegate.js +0 -229
- package/dist/common/providers/angular-delegate.js.map +0 -1
- package/dist/common/providers/config.js +0 -44
- package/dist/common/providers/config.js.map +0 -1
- package/dist/common/providers/dom-controller.js +0 -44
- package/dist/common/providers/dom-controller.js.map +0 -1
- package/dist/common/providers/menu-controller.js +0 -114
- package/dist/common/providers/menu-controller.js.map +0 -1
- package/dist/common/providers/nav-controller.js +0 -232
- package/dist/common/providers/nav-controller.js.map +0 -1
- package/dist/common/providers/platform.js +0 -256
- package/dist/common/providers/platform.js.map +0 -1
- package/dist/common/types/interfaces.js +0 -2
- package/dist/common/types/interfaces.js.map +0 -1
- package/dist/common/types/ionic-lifecycle-hooks.js +0 -5
- package/dist/common/types/ionic-lifecycle-hooks.js.map +0 -1
- package/dist/common/types/overlay-options.js +0 -2
- package/dist/common/types/overlay-options.js.map +0 -1
- package/dist/common/utils/overlay.js +0 -26
- package/dist/common/utils/overlay.js.map +0 -1
- package/dist/common/utils/proxy.js +0 -47
- package/dist/common/utils/proxy.js.map +0 -1
- package/dist/common/utils/routing.js +0 -55
- package/dist/common/utils/routing.js.map +0 -1
- package/dist/common/utils/util.js +0 -10
- package/dist/common/utils/util.js.map +0 -1
- package/dist/lazy/app-initialize.js +0 -29
- package/dist/lazy/app-initialize.js.map +0 -1
- package/dist/lazy/directives/angular-component-lib/utils.js +0 -59
- package/dist/lazy/directives/angular-component-lib/utils.js.map +0 -1
- package/dist/lazy/directives/control-value-accessors/boolean-value-accessor.js +0 -47
- package/dist/lazy/directives/control-value-accessors/boolean-value-accessor.js.map +0 -1
- package/dist/lazy/directives/control-value-accessors/index.js +0 -5
- package/dist/lazy/directives/control-value-accessors/index.js.map +0 -1
- package/dist/lazy/directives/control-value-accessors/numeric-value-accessor.js +0 -55
- package/dist/lazy/directives/control-value-accessors/numeric-value-accessor.js.map +0 -1
- package/dist/lazy/directives/control-value-accessors/select-value-accessor.js +0 -44
- package/dist/lazy/directives/control-value-accessors/select-value-accessor.js.map +0 -1
- package/dist/lazy/directives/control-value-accessors/text-value-accessor.js +0 -43
- package/dist/lazy/directives/control-value-accessors/text-value-accessor.js.map +0 -1
- package/dist/lazy/directives/navigation/ion-back-button.js +0 -24
- package/dist/lazy/directives/navigation/ion-back-button.js.map +0 -1
- package/dist/lazy/directives/navigation/ion-nav.js +0 -21
- package/dist/lazy/directives/navigation/ion-nav.js.map +0 -1
- package/dist/lazy/directives/navigation/ion-router-outlet.js +0 -52
- package/dist/lazy/directives/navigation/ion-router-outlet.js.map +0 -1
- package/dist/lazy/directives/navigation/ion-tabs.js +0 -58
- package/dist/lazy/directives/navigation/ion-tabs.js.map +0 -1
- package/dist/lazy/directives/navigation/router-link-delegate.js +0 -32
- package/dist/lazy/directives/navigation/router-link-delegate.js.map +0 -1
- package/dist/lazy/directives/overlays/modal.js +0 -22
- package/dist/lazy/directives/overlays/modal.js.map +0 -1
- package/dist/lazy/directives/overlays/popover.js +0 -18
- package/dist/lazy/directives/overlays/popover.js.map +0 -1
- package/dist/lazy/directives/proxies-list.js +0 -89
- package/dist/lazy/directives/proxies-list.js.map +0 -1
- package/dist/lazy/directives/proxies.js +0 -2759
- package/dist/lazy/directives/proxies.js.map +0 -1
- package/dist/lazy/directives/validators/index.js +0 -3
- package/dist/lazy/directives/validators/index.js.map +0 -1
- package/dist/lazy/directives/validators/max-validator.js +0 -26
- package/dist/lazy/directives/validators/max-validator.js.map +0 -1
- package/dist/lazy/directives/validators/min-validator.js +0 -26
- package/dist/lazy/directives/validators/min-validator.js.map +0 -1
- package/dist/lazy/index.js +0 -34
- package/dist/lazy/index.js.map +0 -1
- package/dist/lazy/ionic-module.d.ts +0 -38
- package/dist/lazy/ionic-module.js +0 -121
- package/dist/lazy/ionic-module.js.map +0 -1
- package/dist/lazy/providers/action-sheet-controller.js +0 -18
- package/dist/lazy/providers/action-sheet-controller.js.map +0 -1
- package/dist/lazy/providers/alert-controller.js +0 -18
- package/dist/lazy/providers/alert-controller.js.map +0 -1
- package/dist/lazy/providers/animation-controller.js +0 -37
- package/dist/lazy/providers/animation-controller.js.map +0 -1
- package/dist/lazy/providers/gesture-controller.js +0 -32
- package/dist/lazy/providers/gesture-controller.js.map +0 -1
- package/dist/lazy/providers/loading-controller.js +0 -18
- package/dist/lazy/providers/loading-controller.js.map +0 -1
- package/dist/lazy/providers/menu-controller.js +0 -18
- package/dist/lazy/providers/menu-controller.js.map +0 -1
- package/dist/lazy/providers/modal-controller.js +0 -25
- package/dist/lazy/providers/modal-controller.js.map +0 -1
- package/dist/lazy/providers/popover-controller.js +0 -19
- package/dist/lazy/providers/popover-controller.js.map +0 -1
- package/dist/lazy/providers/toast-controller.js +0 -18
- package/dist/lazy/providers/toast-controller.js.map +0 -1
- package/dist/schematics/utils/ast.js +0 -64
- package/dist/standalone/directives/angular-component-lib/utils.js +0 -59
- package/dist/standalone/directives/angular-component-lib/utils.js.map +0 -1
- package/dist/standalone/directives/checkbox.js +0 -75
- package/dist/standalone/directives/checkbox.js.map +0 -1
- package/dist/standalone/directives/datetime.js +0 -93
- package/dist/standalone/directives/datetime.js.map +0 -1
- package/dist/standalone/directives/icon.js +0 -35
- package/dist/standalone/directives/icon.js.map +0 -1
- package/dist/standalone/directives/index.js +0 -13
- package/dist/standalone/directives/index.js.map +0 -1
- package/dist/standalone/directives/input-otp.js +0 -89
- package/dist/standalone/directives/input-otp.js.map +0 -1
- package/dist/standalone/directives/input.js +0 -112
- package/dist/standalone/directives/input.js.map +0 -1
- package/dist/standalone/directives/ion-accordion-group.d.ts +0 -21
- package/dist/standalone/directives/ion-accordion-group.js +0 -40
- package/dist/standalone/directives/ion-accordion-group.js.map +0 -1
- package/dist/standalone/directives/ion-accordion.d.ts +0 -12
- package/dist/standalone/directives/ion-accordion.js +0 -36
- package/dist/standalone/directives/ion-accordion.js.map +0 -1
- package/dist/standalone/directives/ion-action-sheet.d.ts +0 -58
- package/dist/standalone/directives/ion-action-sheet.js +0 -62
- package/dist/standalone/directives/ion-action-sheet.js.map +0 -1
- package/dist/standalone/directives/ion-alert.d.ts +0 -58
- package/dist/standalone/directives/ion-alert.js +0 -62
- package/dist/standalone/directives/ion-alert.js.map +0 -1
- package/dist/standalone/directives/ion-app.d.ts +0 -12
- package/dist/standalone/directives/ion-app.js +0 -36
- package/dist/standalone/directives/ion-app.js.map +0 -1
- package/dist/standalone/directives/ion-avatar.d.ts +0 -12
- package/dist/standalone/directives/ion-avatar.js +0 -35
- package/dist/standalone/directives/ion-avatar.js.map +0 -1
- package/dist/standalone/directives/ion-backdrop.d.ts +0 -18
- package/dist/standalone/directives/ion-backdrop.js +0 -40
- package/dist/standalone/directives/ion-backdrop.js.map +0 -1
- package/dist/standalone/directives/ion-badge.d.ts +0 -12
- package/dist/standalone/directives/ion-badge.js +0 -36
- package/dist/standalone/directives/ion-badge.js.map +0 -1
- package/dist/standalone/directives/ion-breadcrumb.d.ts +0 -23
- package/dist/standalone/directives/ion-breadcrumb.js +0 -43
- package/dist/standalone/directives/ion-breadcrumb.js.map +0 -1
- package/dist/standalone/directives/ion-breadcrumbs.d.ts +0 -19
- package/dist/standalone/directives/ion-breadcrumbs.js +0 -40
- package/dist/standalone/directives/ion-breadcrumbs.js.map +0 -1
- package/dist/standalone/directives/ion-button.d.ts +0 -23
- package/dist/standalone/directives/ion-button.js +0 -43
- package/dist/standalone/directives/ion-button.js.map +0 -1
- package/dist/standalone/directives/ion-buttons.d.ts +0 -12
- package/dist/standalone/directives/ion-buttons.js +0 -36
- package/dist/standalone/directives/ion-buttons.js.map +0 -1
- package/dist/standalone/directives/ion-card-content.d.ts +0 -12
- package/dist/standalone/directives/ion-card-content.js +0 -36
- package/dist/standalone/directives/ion-card-content.js.map +0 -1
- package/dist/standalone/directives/ion-card-header.d.ts +0 -12
- package/dist/standalone/directives/ion-card-header.js +0 -36
- package/dist/standalone/directives/ion-card-header.js.map +0 -1
- package/dist/standalone/directives/ion-card-subtitle.d.ts +0 -12
- package/dist/standalone/directives/ion-card-subtitle.js +0 -36
- package/dist/standalone/directives/ion-card-subtitle.js.map +0 -1
- package/dist/standalone/directives/ion-card-title.d.ts +0 -12
- package/dist/standalone/directives/ion-card-title.js +0 -36
- package/dist/standalone/directives/ion-card-title.js.map +0 -1
- package/dist/standalone/directives/ion-card.d.ts +0 -12
- package/dist/standalone/directives/ion-card.js +0 -36
- package/dist/standalone/directives/ion-card.js.map +0 -1
- package/dist/standalone/directives/ion-chip.d.ts +0 -12
- package/dist/standalone/directives/ion-chip.js +0 -36
- package/dist/standalone/directives/ion-chip.js.map +0 -1
- package/dist/standalone/directives/ion-col.d.ts +0 -12
- package/dist/standalone/directives/ion-col.js +0 -36
- package/dist/standalone/directives/ion-col.js.map +0 -1
- package/dist/standalone/directives/ion-content.d.ts +0 -33
- package/dist/standalone/directives/ion-content.js +0 -47
- package/dist/standalone/directives/ion-content.js.map +0 -1
- package/dist/standalone/directives/ion-datetime-button.d.ts +0 -12
- package/dist/standalone/directives/ion-datetime-button.js +0 -36
- package/dist/standalone/directives/ion-datetime-button.js.map +0 -1
- package/dist/standalone/directives/ion-fab-button.d.ts +0 -23
- package/dist/standalone/directives/ion-fab-button.js +0 -43
- package/dist/standalone/directives/ion-fab-button.js.map +0 -1
- package/dist/standalone/directives/ion-fab-list.d.ts +0 -12
- package/dist/standalone/directives/ion-fab-list.js +0 -36
- package/dist/standalone/directives/ion-fab-list.js.map +0 -1
- package/dist/standalone/directives/ion-fab.d.ts +0 -12
- package/dist/standalone/directives/ion-fab.js +0 -37
- package/dist/standalone/directives/ion-fab.js.map +0 -1
- package/dist/standalone/directives/ion-footer.d.ts +0 -12
- package/dist/standalone/directives/ion-footer.js +0 -36
- package/dist/standalone/directives/ion-footer.js.map +0 -1
- package/dist/standalone/directives/ion-grid.d.ts +0 -12
- package/dist/standalone/directives/ion-grid.js +0 -36
- package/dist/standalone/directives/ion-grid.js.map +0 -1
- package/dist/standalone/directives/ion-header.d.ts +0 -12
- package/dist/standalone/directives/ion-header.js +0 -36
- package/dist/standalone/directives/ion-header.js.map +0 -1
- package/dist/standalone/directives/ion-img.d.ts +0 -28
- package/dist/standalone/directives/ion-img.js +0 -46
- package/dist/standalone/directives/ion-img.js.map +0 -1
- package/dist/standalone/directives/ion-infinite-scroll-content.d.ts +0 -12
- package/dist/standalone/directives/ion-infinite-scroll-content.js +0 -36
- package/dist/standalone/directives/ion-infinite-scroll-content.js.map +0 -1
- package/dist/standalone/directives/ion-infinite-scroll.d.ts +0 -21
- package/dist/standalone/directives/ion-infinite-scroll.js +0 -41
- package/dist/standalone/directives/ion-infinite-scroll.js.map +0 -1
- package/dist/standalone/directives/ion-input-password-toggle.d.ts +0 -12
- package/dist/standalone/directives/ion-input-password-toggle.js +0 -36
- package/dist/standalone/directives/ion-input-password-toggle.js.map +0 -1
- package/dist/standalone/directives/ion-item-divider.d.ts +0 -12
- package/dist/standalone/directives/ion-item-divider.js +0 -36
- package/dist/standalone/directives/ion-item-divider.js.map +0 -1
- package/dist/standalone/directives/ion-item-group.d.ts +0 -12
- package/dist/standalone/directives/ion-item-group.js +0 -35
- package/dist/standalone/directives/ion-item-group.js.map +0 -1
- package/dist/standalone/directives/ion-item-option.d.ts +0 -12
- package/dist/standalone/directives/ion-item-option.js +0 -36
- package/dist/standalone/directives/ion-item-option.js.map +0 -1
- package/dist/standalone/directives/ion-item-options.d.ts +0 -18
- package/dist/standalone/directives/ion-item-options.js +0 -40
- package/dist/standalone/directives/ion-item-options.js.map +0 -1
- package/dist/standalone/directives/ion-item-sliding.d.ts +0 -18
- package/dist/standalone/directives/ion-item-sliding.js +0 -41
- package/dist/standalone/directives/ion-item-sliding.js.map +0 -1
- package/dist/standalone/directives/ion-item.d.ts +0 -12
- package/dist/standalone/directives/ion-item.js +0 -36
- package/dist/standalone/directives/ion-item.js.map +0 -1
- package/dist/standalone/directives/ion-label.d.ts +0 -12
- package/dist/standalone/directives/ion-label.js +0 -36
- package/dist/standalone/directives/ion-label.js.map +0 -1
- package/dist/standalone/directives/ion-list-header.d.ts +0 -12
- package/dist/standalone/directives/ion-list-header.js +0 -36
- package/dist/standalone/directives/ion-list-header.js.map +0 -1
- package/dist/standalone/directives/ion-list.d.ts +0 -12
- package/dist/standalone/directives/ion-list.js +0 -37
- package/dist/standalone/directives/ion-list.js.map +0 -1
- package/dist/standalone/directives/ion-loading.d.ts +0 -58
- package/dist/standalone/directives/ion-loading.js +0 -62
- package/dist/standalone/directives/ion-loading.js.map +0 -1
- package/dist/standalone/directives/ion-menu-button.d.ts +0 -12
- package/dist/standalone/directives/ion-menu-button.js +0 -36
- package/dist/standalone/directives/ion-menu-button.js.map +0 -1
- package/dist/standalone/directives/ion-menu-toggle.d.ts +0 -12
- package/dist/standalone/directives/ion-menu-toggle.js +0 -36
- package/dist/standalone/directives/ion-menu-toggle.js.map +0 -1
- package/dist/standalone/directives/ion-menu.d.ts +0 -34
- package/dist/standalone/directives/ion-menu.js +0 -50
- package/dist/standalone/directives/ion-menu.js.map +0 -1
- package/dist/standalone/directives/ion-nav-link.d.ts +0 -12
- package/dist/standalone/directives/ion-nav-link.js +0 -36
- package/dist/standalone/directives/ion-nav-link.js.map +0 -1
- package/dist/standalone/directives/ion-note.d.ts +0 -12
- package/dist/standalone/directives/ion-note.js +0 -36
- package/dist/standalone/directives/ion-note.js.map +0 -1
- package/dist/standalone/directives/ion-picker-column-option.d.ts +0 -12
- package/dist/standalone/directives/ion-picker-column-option.js +0 -36
- package/dist/standalone/directives/ion-picker-column-option.js.map +0 -1
- package/dist/standalone/directives/ion-picker-column.d.ts +0 -21
- package/dist/standalone/directives/ion-picker-column.js +0 -41
- package/dist/standalone/directives/ion-picker-column.js.map +0 -1
- package/dist/standalone/directives/ion-picker.d.ts +0 -12
- package/dist/standalone/directives/ion-picker.js +0 -36
- package/dist/standalone/directives/ion-picker.js.map +0 -1
- package/dist/standalone/directives/ion-progress-bar.d.ts +0 -12
- package/dist/standalone/directives/ion-progress-bar.js +0 -36
- package/dist/standalone/directives/ion-progress-bar.js.map +0 -1
- package/dist/standalone/directives/ion-radio.d.ts +0 -23
- package/dist/standalone/directives/ion-radio.js +0 -43
- package/dist/standalone/directives/ion-radio.js.map +0 -1
- package/dist/standalone/directives/ion-refresher-content.d.ts +0 -12
- package/dist/standalone/directives/ion-refresher-content.js +0 -36
- package/dist/standalone/directives/ion-refresher-content.js.map +0 -1
- package/dist/standalone/directives/ion-refresher.d.ts +0 -45
- package/dist/standalone/directives/ion-refresher.js +0 -53
- package/dist/standalone/directives/ion-refresher.js.map +0 -1
- package/dist/standalone/directives/ion-reorder-group.d.ts +0 -44
- package/dist/standalone/directives/ion-reorder-group.js +0 -50
- package/dist/standalone/directives/ion-reorder-group.js.map +0 -1
- package/dist/standalone/directives/ion-reorder.d.ts +0 -12
- package/dist/standalone/directives/ion-reorder.js +0 -35
- package/dist/standalone/directives/ion-reorder.js.map +0 -1
- package/dist/standalone/directives/ion-ripple-effect.d.ts +0 -12
- package/dist/standalone/directives/ion-ripple-effect.js +0 -37
- package/dist/standalone/directives/ion-ripple-effect.js.map +0 -1
- package/dist/standalone/directives/ion-row.d.ts +0 -12
- package/dist/standalone/directives/ion-row.js +0 -35
- package/dist/standalone/directives/ion-row.js.map +0 -1
- package/dist/standalone/directives/ion-segment-button.d.ts +0 -12
- package/dist/standalone/directives/ion-segment-button.js +0 -36
- package/dist/standalone/directives/ion-segment-button.js.map +0 -1
- package/dist/standalone/directives/ion-segment-content.d.ts +0 -12
- package/dist/standalone/directives/ion-segment-content.js +0 -35
- package/dist/standalone/directives/ion-segment-content.js.map +0 -1
- package/dist/standalone/directives/ion-segment-view.d.ts +0 -19
- package/dist/standalone/directives/ion-segment-view.js +0 -40
- package/dist/standalone/directives/ion-segment-view.js.map +0 -1
- package/dist/standalone/directives/ion-select-modal.d.ts +0 -12
- package/dist/standalone/directives/ion-select-modal.js +0 -36
- package/dist/standalone/directives/ion-select-modal.js.map +0 -1
- package/dist/standalone/directives/ion-select-option.d.ts +0 -12
- package/dist/standalone/directives/ion-select-option.js +0 -36
- package/dist/standalone/directives/ion-select-option.js.map +0 -1
- package/dist/standalone/directives/ion-skeleton-text.d.ts +0 -12
- package/dist/standalone/directives/ion-skeleton-text.js +0 -36
- package/dist/standalone/directives/ion-skeleton-text.js.map +0 -1
- package/dist/standalone/directives/ion-spinner.d.ts +0 -12
- package/dist/standalone/directives/ion-spinner.js +0 -36
- package/dist/standalone/directives/ion-spinner.js.map +0 -1
- package/dist/standalone/directives/ion-split-pane.d.ts +0 -22
- package/dist/standalone/directives/ion-split-pane.js +0 -40
- package/dist/standalone/directives/ion-split-pane.js.map +0 -1
- package/dist/standalone/directives/ion-tab-bar.d.ts +0 -12
- package/dist/standalone/directives/ion-tab-bar.js +0 -36
- package/dist/standalone/directives/ion-tab-bar.js.map +0 -1
- package/dist/standalone/directives/ion-tab-button.d.ts +0 -12
- package/dist/standalone/directives/ion-tab-button.js +0 -36
- package/dist/standalone/directives/ion-tab-button.js.map +0 -1
- package/dist/standalone/directives/ion-tab.d.ts +0 -12
- package/dist/standalone/directives/ion-tab.js +0 -37
- package/dist/standalone/directives/ion-tab.js.map +0 -1
- package/dist/standalone/directives/ion-text.d.ts +0 -12
- package/dist/standalone/directives/ion-text.js +0 -36
- package/dist/standalone/directives/ion-text.js.map +0 -1
- package/dist/standalone/directives/ion-thumbnail.d.ts +0 -12
- package/dist/standalone/directives/ion-thumbnail.js +0 -35
- package/dist/standalone/directives/ion-thumbnail.js.map +0 -1
- package/dist/standalone/directives/ion-title.d.ts +0 -12
- package/dist/standalone/directives/ion-title.js +0 -36
- package/dist/standalone/directives/ion-title.js.map +0 -1
- package/dist/standalone/directives/ion-toast.d.ts +0 -58
- package/dist/standalone/directives/ion-toast.js +0 -62
- package/dist/standalone/directives/ion-toast.js.map +0 -1
- package/dist/standalone/directives/ion-toolbar.d.ts +0 -12
- package/dist/standalone/directives/ion-toolbar.js +0 -36
- package/dist/standalone/directives/ion-toolbar.js.map +0 -1
- package/dist/standalone/directives/proxies.d.ts +0 -77
- package/dist/standalone/directives/proxies.js +0 -79
- package/dist/standalone/directives/proxies.js.map +0 -1
- package/dist/standalone/directives/radio-group.js +0 -59
- package/dist/standalone/directives/radio-group.js.map +0 -1
- package/dist/standalone/directives/range.js +0 -77
- package/dist/standalone/directives/range.js.map +0 -1
- package/dist/standalone/directives/searchbar.js +0 -81
- package/dist/standalone/directives/searchbar.js.map +0 -1
- package/dist/standalone/directives/segment.js +0 -59
- package/dist/standalone/directives/segment.js.map +0 -1
- package/dist/standalone/directives/select.js +0 -83
- package/dist/standalone/directives/select.js.map +0 -1
- package/dist/standalone/directives/textarea.js +0 -90
- package/dist/standalone/directives/textarea.js.map +0 -1
- package/dist/standalone/directives/toggle.js +0 -75
- package/dist/standalone/directives/toggle.js.map +0 -1
- package/dist/standalone/index.js +0 -24
- package/dist/standalone/index.js.map +0 -1
- package/dist/standalone/navigation/back-button.js +0 -32
- package/dist/standalone/navigation/back-button.js.map +0 -1
- package/dist/standalone/navigation/nav.js +0 -28
- package/dist/standalone/navigation/nav.js.map +0 -1
- package/dist/standalone/navigation/router-link-delegate.js +0 -26
- package/dist/standalone/navigation/router-link-delegate.js.map +0 -1
- package/dist/standalone/navigation/router-outlet.js +0 -60
- package/dist/standalone/navigation/router-outlet.js.map +0 -1
- package/dist/standalone/navigation/tabs.js +0 -57
- package/dist/standalone/navigation/tabs.js.map +0 -1
- package/dist/standalone/overlays/modal.js +0 -32
- package/dist/standalone/overlays/modal.js.map +0 -1
- package/dist/standalone/overlays/popover.js +0 -28
- package/dist/standalone/overlays/popover.js.map +0 -1
- package/dist/standalone/providers/action-sheet-controller.js +0 -20
- package/dist/standalone/providers/action-sheet-controller.js.map +0 -1
- package/dist/standalone/providers/alert-controller.js +0 -20
- package/dist/standalone/providers/alert-controller.js.map +0 -1
- package/dist/standalone/providers/animation-controller.js +0 -37
- package/dist/standalone/providers/animation-controller.js.map +0 -1
- package/dist/standalone/providers/gesture-controller.js +0 -32
- package/dist/standalone/providers/gesture-controller.js.map +0 -1
- package/dist/standalone/providers/ionic-angular.js +0 -38
- package/dist/standalone/providers/ionic-angular.js.map +0 -1
- package/dist/standalone/providers/loading-controller.js +0 -20
- package/dist/standalone/providers/loading-controller.js.map +0 -1
- package/dist/standalone/providers/menu-controller.js +0 -18
- package/dist/standalone/providers/menu-controller.js.map +0 -1
- package/dist/standalone/providers/modal-controller.js +0 -27
- package/dist/standalone/providers/modal-controller.js.map +0 -1
- package/dist/standalone/providers/popover-controller.js +0 -21
- package/dist/standalone/providers/popover-controller.js.map +0 -1
- package/dist/standalone/providers/toast-controller.js +0 -20
- package/dist/standalone/providers/toast-controller.js.map +0 -1
- /package/{dist/lazy/app-initialize.d.ts → app-initialize.d.ts} +0 -0
- /package/{dist/common → common}/directives/control-value-accessors/index.d.ts +0 -0
- /package/{dist/common → common}/directives/navigation/nav-params.d.ts +0 -0
- /package/{dist/common → common}/directives/navigation/stack-controller.d.ts +0 -0
- /package/{dist/common → common}/directives/navigation/stack-utils.d.ts +0 -0
- /package/{dist/common → common}/providers/config.d.ts +0 -0
- /package/{dist/common → common}/providers/dom-controller.d.ts +0 -0
- /package/{dist/common → common}/providers/menu-controller.d.ts +0 -0
- /package/{dist/common → common}/providers/nav-controller.d.ts +0 -0
- /package/{dist/common → common}/providers/platform.d.ts +0 -0
- /package/{dist/common → common}/types/interfaces.d.ts +0 -0
- /package/{dist/common → common}/types/ionic-lifecycle-hooks.d.ts +0 -0
- /package/{dist/common → common}/types/overlay-options.d.ts +0 -0
- /package/{dist/common → common}/utils/overlay.d.ts +0 -0
- /package/{dist/common → common}/utils/proxy.d.ts +0 -0
- /package/{dist/common → common}/utils/routing.d.ts +0 -0
- /package/{dist/common → common}/utils/util.d.ts +0 -0
- /package/{dist/lazy/directives → directives}/angular-component-lib/utils.d.ts +0 -0
- /package/{dist/lazy/directives → directives}/control-value-accessors/index.d.ts +0 -0
- /package/{dist/lazy/directives → directives}/navigation/ion-back-button.d.ts +0 -0
- /package/{dist/lazy/directives → directives}/navigation/ion-nav.d.ts +0 -0
- /package/{dist/lazy/directives → directives}/navigation/ion-router-outlet.d.ts +0 -0
- /package/{dist/lazy/directives → directives}/navigation/ion-tabs.d.ts +0 -0
- /package/{dist/lazy/directives → directives}/navigation/router-link-delegate.d.ts +0 -0
- /package/{dist/lazy/directives → directives}/overlays/modal.d.ts +0 -0
- /package/{dist/lazy/directives → directives}/overlays/popover.d.ts +0 -0
- /package/{dist/lazy/directives → directives}/validators/index.d.ts +0 -0
- /package/{dist/lazy/directives → directives}/validators/max-validator.d.ts +0 -0
- /package/{dist/lazy/directives → directives}/validators/min-validator.d.ts +0 -0
- /package/{dist/lazy/providers → providers}/action-sheet-controller.d.ts +0 -0
- /package/{dist/lazy/providers → providers}/alert-controller.d.ts +0 -0
- /package/{dist/lazy/providers → providers}/animation-controller.d.ts +0 -0
- /package/{dist/lazy/providers → providers}/gesture-controller.d.ts +0 -0
- /package/{dist/lazy/providers → providers}/loading-controller.d.ts +0 -0
- /package/{dist/lazy/providers → providers}/menu-controller.d.ts +0 -0
- /package/{dist/lazy/providers → providers}/modal-controller.d.ts +0 -0
- /package/{dist/lazy/providers → providers}/popover-controller.d.ts +0 -0
- /package/{dist/lazy/providers → providers}/toast-controller.d.ts +0 -0
- /package/{dist/schematics → schematics}/add/files/root/theme/variables.css +0 -0
- /package/{dist/schematics → schematics}/add/schema.json +0 -0
- /package/{dist/schematics → schematics}/collection.json +0 -0
- /package/{dist/standalone → standalone}/directives/angular-component-lib/utils.d.ts +0 -0
- /package/{dist/standalone → standalone}/directives/checkbox.d.ts +0 -0
- /package/{dist/standalone → standalone}/directives/datetime.d.ts +0 -0
- /package/{dist/standalone → standalone}/directives/icon.d.ts +0 -0
- /package/{dist/standalone → standalone}/directives/index.d.ts +0 -0
- /package/{dist/standalone → standalone}/directives/input-otp.d.ts +0 -0
- /package/{dist/standalone → standalone}/directives/input.d.ts +0 -0
- /package/{dist/standalone → standalone}/directives/radio-group.d.ts +0 -0
- /package/{dist/standalone → standalone}/directives/range.d.ts +0 -0
- /package/{dist/standalone → standalone}/directives/searchbar.d.ts +0 -0
- /package/{dist/standalone → standalone}/directives/segment.d.ts +0 -0
- /package/{dist/standalone → standalone}/directives/select.d.ts +0 -0
- /package/{dist/standalone → standalone}/directives/textarea.d.ts +0 -0
- /package/{dist/standalone → standalone}/directives/toggle.d.ts +0 -0
- /package/{dist/standalone → standalone}/navigation/back-button.d.ts +0 -0
- /package/{dist/standalone → standalone}/navigation/nav.d.ts +0 -0
- /package/{dist/standalone → standalone}/navigation/router-link-delegate.d.ts +0 -0
- /package/{dist/standalone → standalone}/navigation/router-outlet.d.ts +0 -0
- /package/{dist/standalone → standalone}/navigation/tabs.d.ts +0 -0
- /package/{dist/standalone → standalone}/overlays/modal.d.ts +0 -0
- /package/{dist/standalone → standalone}/overlays/popover.d.ts +0 -0
- /package/{dist/standalone → standalone}/providers/action-sheet-controller.d.ts +0 -0
- /package/{dist/standalone → standalone}/providers/alert-controller.d.ts +0 -0
- /package/{dist/standalone → standalone}/providers/animation-controller.d.ts +0 -0
- /package/{dist/standalone → standalone}/providers/gesture-controller.d.ts +0 -0
- /package/{dist/standalone → standalone}/providers/ionic-angular.d.ts +0 -0
- /package/{dist/standalone → standalone}/providers/loading-controller.d.ts +0 -0
- /package/{dist/standalone → standalone}/providers/menu-controller.d.ts +0 -0
- /package/{dist/standalone → standalone}/providers/modal-controller.d.ts +0 -0
- /package/{dist/standalone → standalone}/providers/popover-controller.d.ts +0 -0
- /package/{dist/standalone → standalone}/providers/toast-controller.d.ts +0 -0
|
@@ -1,282 +0,0 @@
|
|
|
1
|
-
import { bindLifecycleEvents } from '../../providers/angular-delegate';
|
|
2
|
-
import { computeStackId, destroyView, getUrl, insertView, isTabSwitch, toSegments, } from './stack-utils';
|
|
3
|
-
// TODO(FW-2827): types
|
|
4
|
-
export class StackController {
|
|
5
|
-
containerEl;
|
|
6
|
-
router;
|
|
7
|
-
navCtrl;
|
|
8
|
-
zone;
|
|
9
|
-
location;
|
|
10
|
-
views = [];
|
|
11
|
-
runningTask;
|
|
12
|
-
skipTransition = false;
|
|
13
|
-
tabsPrefix;
|
|
14
|
-
activeView;
|
|
15
|
-
nextId = 0;
|
|
16
|
-
constructor(tabsPrefix, containerEl, router, navCtrl, zone, location) {
|
|
17
|
-
this.containerEl = containerEl;
|
|
18
|
-
this.router = router;
|
|
19
|
-
this.navCtrl = navCtrl;
|
|
20
|
-
this.zone = zone;
|
|
21
|
-
this.location = location;
|
|
22
|
-
this.tabsPrefix = tabsPrefix !== undefined ? toSegments(tabsPrefix) : undefined;
|
|
23
|
-
}
|
|
24
|
-
createView(ref, activatedRoute) {
|
|
25
|
-
const url = getUrl(this.router, activatedRoute);
|
|
26
|
-
const element = ref?.location?.nativeElement;
|
|
27
|
-
const unlistenEvents = bindLifecycleEvents(this.zone, ref.changeDetectorRef, ref.instance, element);
|
|
28
|
-
return {
|
|
29
|
-
id: this.nextId++,
|
|
30
|
-
stackId: computeStackId(this.tabsPrefix, url),
|
|
31
|
-
unlistenEvents,
|
|
32
|
-
element,
|
|
33
|
-
ref,
|
|
34
|
-
url,
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
getExistingView(activatedRoute) {
|
|
38
|
-
const activatedUrlKey = getUrl(this.router, activatedRoute);
|
|
39
|
-
const view = this.views.find((vw) => vw.url === activatedUrlKey);
|
|
40
|
-
if (view) {
|
|
41
|
-
view.ref.changeDetectorRef.reattach();
|
|
42
|
-
}
|
|
43
|
-
return view;
|
|
44
|
-
}
|
|
45
|
-
setActive(enteringView) {
|
|
46
|
-
const consumeResult = this.navCtrl.consumeTransition();
|
|
47
|
-
let { direction, animation, animationBuilder } = consumeResult;
|
|
48
|
-
const leavingView = this.activeView;
|
|
49
|
-
const tabSwitch = isTabSwitch(enteringView, leavingView);
|
|
50
|
-
if (tabSwitch) {
|
|
51
|
-
direction = 'back';
|
|
52
|
-
animation = undefined;
|
|
53
|
-
}
|
|
54
|
-
const viewsSnapshot = this.views.slice();
|
|
55
|
-
let currentNavigation;
|
|
56
|
-
const router = this.router;
|
|
57
|
-
// Angular >= 7.2.0
|
|
58
|
-
if (router.getCurrentNavigation) {
|
|
59
|
-
currentNavigation = router.getCurrentNavigation();
|
|
60
|
-
// Angular < 7.2.0
|
|
61
|
-
}
|
|
62
|
-
else if (router.navigations?.value) {
|
|
63
|
-
currentNavigation = router.navigations.value;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* If the navigation action
|
|
67
|
-
* sets `replaceUrl: true`
|
|
68
|
-
* then we need to make sure
|
|
69
|
-
* we remove the last item
|
|
70
|
-
* from our views stack
|
|
71
|
-
*/
|
|
72
|
-
if (currentNavigation?.extras?.replaceUrl) {
|
|
73
|
-
if (this.views.length > 0) {
|
|
74
|
-
this.views.splice(-1, 1);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
const reused = this.views.includes(enteringView);
|
|
78
|
-
const views = this.insertView(enteringView, direction);
|
|
79
|
-
// Trigger change detection before transition starts
|
|
80
|
-
// This will call ngOnInit() the first time too, just after the view
|
|
81
|
-
// was attached to the dom, but BEFORE the transition starts
|
|
82
|
-
if (!reused) {
|
|
83
|
-
enteringView.ref.changeDetectorRef.detectChanges();
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* If we are going back from a page that
|
|
87
|
-
* was presented using a custom animation
|
|
88
|
-
* we should default to using that
|
|
89
|
-
* unless the developer explicitly
|
|
90
|
-
* provided another animation.
|
|
91
|
-
*/
|
|
92
|
-
const customAnimation = enteringView.animationBuilder;
|
|
93
|
-
if (animationBuilder === undefined && direction === 'back' && !tabSwitch && customAnimation !== undefined) {
|
|
94
|
-
animationBuilder = customAnimation;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Save any custom animation so that navigating
|
|
98
|
-
* back will use this custom animation by default.
|
|
99
|
-
*/
|
|
100
|
-
if (leavingView) {
|
|
101
|
-
leavingView.animationBuilder = animationBuilder;
|
|
102
|
-
}
|
|
103
|
-
// Wait until previous transitions finish
|
|
104
|
-
return this.zone.runOutsideAngular(() => {
|
|
105
|
-
return this.wait(() => {
|
|
106
|
-
// disconnect leaving page from change detection to
|
|
107
|
-
// reduce jank during the page transition
|
|
108
|
-
if (leavingView) {
|
|
109
|
-
leavingView.ref.changeDetectorRef.detach();
|
|
110
|
-
}
|
|
111
|
-
// In case the enteringView is the same as the leavingPage we need to reattach()
|
|
112
|
-
enteringView.ref.changeDetectorRef.reattach();
|
|
113
|
-
return this.transition(enteringView, leavingView, animation, this.canGoBack(1), false, animationBuilder)
|
|
114
|
-
.then(() => cleanupAsync(enteringView, views, viewsSnapshot, this.location, this.zone))
|
|
115
|
-
.then(() => ({
|
|
116
|
-
enteringView,
|
|
117
|
-
direction,
|
|
118
|
-
animation,
|
|
119
|
-
tabSwitch,
|
|
120
|
-
}));
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
canGoBack(deep, stackId = this.getActiveStackId()) {
|
|
125
|
-
return this.getStack(stackId).length > deep;
|
|
126
|
-
}
|
|
127
|
-
pop(deep, stackId = this.getActiveStackId()) {
|
|
128
|
-
return this.zone.run(() => {
|
|
129
|
-
const views = this.getStack(stackId);
|
|
130
|
-
if (views.length <= deep) {
|
|
131
|
-
return Promise.resolve(false);
|
|
132
|
-
}
|
|
133
|
-
const view = views[views.length - deep - 1];
|
|
134
|
-
let url = view.url;
|
|
135
|
-
const viewSavedData = view.savedData;
|
|
136
|
-
if (viewSavedData) {
|
|
137
|
-
const primaryOutlet = viewSavedData.get('primary');
|
|
138
|
-
if (primaryOutlet?.route?._routerState?.snapshot.url) {
|
|
139
|
-
url = primaryOutlet.route._routerState.snapshot.url;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
const { animationBuilder } = this.navCtrl.consumeTransition();
|
|
143
|
-
return this.navCtrl.navigateBack(url, { ...view.savedExtras, animation: animationBuilder }).then(() => true);
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
startBackTransition() {
|
|
147
|
-
const leavingView = this.activeView;
|
|
148
|
-
if (leavingView) {
|
|
149
|
-
const views = this.getStack(leavingView.stackId);
|
|
150
|
-
const enteringView = views[views.length - 2];
|
|
151
|
-
const customAnimation = enteringView.animationBuilder;
|
|
152
|
-
return this.wait(() => {
|
|
153
|
-
return this.transition(enteringView, // entering view
|
|
154
|
-
leavingView, // leaving view
|
|
155
|
-
'back', this.canGoBack(2), true, customAnimation);
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
return Promise.resolve();
|
|
159
|
-
}
|
|
160
|
-
endBackTransition(shouldComplete) {
|
|
161
|
-
if (shouldComplete) {
|
|
162
|
-
this.skipTransition = true;
|
|
163
|
-
this.pop(1);
|
|
164
|
-
}
|
|
165
|
-
else if (this.activeView) {
|
|
166
|
-
cleanup(this.activeView, this.views, this.views, this.location, this.zone);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
getLastUrl(stackId) {
|
|
170
|
-
const views = this.getStack(stackId);
|
|
171
|
-
return views.length > 0 ? views[views.length - 1] : undefined;
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* @internal
|
|
175
|
-
*/
|
|
176
|
-
getRootUrl(stackId) {
|
|
177
|
-
const views = this.getStack(stackId);
|
|
178
|
-
return views.length > 0 ? views[0] : undefined;
|
|
179
|
-
}
|
|
180
|
-
getActiveStackId() {
|
|
181
|
-
return this.activeView ? this.activeView.stackId : undefined;
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* @internal
|
|
185
|
-
*/
|
|
186
|
-
getActiveView() {
|
|
187
|
-
return this.activeView;
|
|
188
|
-
}
|
|
189
|
-
hasRunningTask() {
|
|
190
|
-
return this.runningTask !== undefined;
|
|
191
|
-
}
|
|
192
|
-
destroy() {
|
|
193
|
-
this.containerEl = undefined;
|
|
194
|
-
this.views.forEach(destroyView);
|
|
195
|
-
this.activeView = undefined;
|
|
196
|
-
this.views = [];
|
|
197
|
-
}
|
|
198
|
-
getStack(stackId) {
|
|
199
|
-
return this.views.filter((v) => v.stackId === stackId);
|
|
200
|
-
}
|
|
201
|
-
insertView(enteringView, direction) {
|
|
202
|
-
this.activeView = enteringView;
|
|
203
|
-
this.views = insertView(this.views, enteringView, direction);
|
|
204
|
-
return this.views.slice();
|
|
205
|
-
}
|
|
206
|
-
transition(enteringView, leavingView, direction, showGoBack, progressAnimation, animationBuilder) {
|
|
207
|
-
if (this.skipTransition) {
|
|
208
|
-
this.skipTransition = false;
|
|
209
|
-
return Promise.resolve(false);
|
|
210
|
-
}
|
|
211
|
-
if (leavingView === enteringView) {
|
|
212
|
-
return Promise.resolve(false);
|
|
213
|
-
}
|
|
214
|
-
const enteringEl = enteringView ? enteringView.element : undefined;
|
|
215
|
-
const leavingEl = leavingView ? leavingView.element : undefined;
|
|
216
|
-
const containerEl = this.containerEl;
|
|
217
|
-
if (enteringEl && enteringEl !== leavingEl) {
|
|
218
|
-
enteringEl.classList.add('ion-page');
|
|
219
|
-
enteringEl.classList.add('ion-page-invisible');
|
|
220
|
-
// containerEl is set to undefined when the stack controller is destroyed,
|
|
221
|
-
// so a transition that resolves after its outlet was destroyed must not
|
|
222
|
-
// dereference it (see destroy()).
|
|
223
|
-
if (containerEl?.commit) {
|
|
224
|
-
return containerEl.commit(enteringEl, leavingEl, {
|
|
225
|
-
duration: direction === undefined ? 0 : undefined,
|
|
226
|
-
direction,
|
|
227
|
-
showGoBack,
|
|
228
|
-
progressAnimation,
|
|
229
|
-
animationBuilder,
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
return Promise.resolve(false);
|
|
234
|
-
}
|
|
235
|
-
async wait(task) {
|
|
236
|
-
if (this.runningTask !== undefined) {
|
|
237
|
-
await this.runningTask;
|
|
238
|
-
this.runningTask = undefined;
|
|
239
|
-
}
|
|
240
|
-
const promise = (this.runningTask = task());
|
|
241
|
-
promise.finally(() => (this.runningTask = undefined));
|
|
242
|
-
return promise;
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
const cleanupAsync = (activeRoute, views, viewsSnapshot, location, zone) => {
|
|
246
|
-
if (typeof requestAnimationFrame === 'function') {
|
|
247
|
-
return new Promise((resolve) => {
|
|
248
|
-
requestAnimationFrame(() => {
|
|
249
|
-
cleanup(activeRoute, views, viewsSnapshot, location, zone);
|
|
250
|
-
resolve();
|
|
251
|
-
});
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
return Promise.resolve();
|
|
255
|
-
};
|
|
256
|
-
const cleanup = (activeRoute, views, viewsSnapshot, location, zone) => {
|
|
257
|
-
/**
|
|
258
|
-
* Re-enter the Angular zone when destroying page components. This will allow
|
|
259
|
-
* lifecycle events (`ngOnDestroy`) to be run inside the Angular zone.
|
|
260
|
-
*/
|
|
261
|
-
zone.run(() => viewsSnapshot.filter((view) => !views.includes(view)).forEach(destroyView));
|
|
262
|
-
views.forEach((view) => {
|
|
263
|
-
/**
|
|
264
|
-
* In the event that a user navigated multiple
|
|
265
|
-
* times in rapid succession, we want to make sure
|
|
266
|
-
* we don't pre-emptively detach a view while
|
|
267
|
-
* it is in mid-transition.
|
|
268
|
-
*
|
|
269
|
-
* In this instance we also do not care about query
|
|
270
|
-
* params or fragments as it will be the same view regardless
|
|
271
|
-
*/
|
|
272
|
-
const locationWithoutParams = location.path().split('?')[0];
|
|
273
|
-
const locationWithoutFragment = locationWithoutParams.split('#')[0];
|
|
274
|
-
if (view !== activeRoute && view.url !== locationWithoutFragment) {
|
|
275
|
-
const element = view.element;
|
|
276
|
-
element.setAttribute('aria-hidden', 'true');
|
|
277
|
-
element.classList.add('ion-page-hidden');
|
|
278
|
-
view.ref.changeDetectorRef.detach();
|
|
279
|
-
}
|
|
280
|
-
});
|
|
281
|
-
};
|
|
282
|
-
//# sourceMappingURL=stack-controller.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stack-controller.js","sourceRoot":"","sources":["../../../../src/common/directives/navigation/stack-controller.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAGvE,OAAO,EAGL,cAAc,EACd,WAAW,EACX,MAAM,EACN,UAAU,EACV,WAAW,EACX,UAAU,GACX,MAAM,eAAe,CAAC;AAEvB,uBAAuB;AAEvB,MAAM,OAAO,eAAe;IAUhB;IACA;IACA;IACA;IACA;IAbF,KAAK,GAAgB,EAAE,CAAC;IACxB,WAAW,CAAgB;IAC3B,cAAc,GAAG,KAAK,CAAC;IACvB,UAAU,CAAuB;IACjC,UAAU,CAAwB;IAClC,MAAM,GAAG,CAAC,CAAC;IAEnB,YACE,UAA8B,EACtB,WAAuC,EACvC,MAAc,EACd,OAAsB,EACtB,IAAY,EACZ,QAAkB;QAJlB,gBAAW,GAAX,WAAW,CAA4B;QACvC,WAAM,GAAN,MAAM,CAAQ;QACd,YAAO,GAAP,OAAO,CAAe;QACtB,SAAI,GAAJ,IAAI,CAAQ;QACZ,aAAQ,GAAR,QAAQ,CAAU;QAE1B,IAAI,CAAC,UAAU,GAAG,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,S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AAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC;QACtC,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { Location } from '@angular/common';\nimport { ComponentRef, NgZone } from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport type { AnimationBuilder, RouterDirection } from '@ionic/core/components';\n\nimport { bindLifecycleEvents } from '../../providers/angular-delegate';\nimport { NavController } from '../../providers/nav-controller';\n\nimport {\n RouteView,\n StackDidChangeEvent,\n computeStackId,\n destroyView,\n getUrl,\n insertView,\n isTabSwitch,\n toSegments,\n} from './stack-utils';\n\n// TODO(FW-2827): types\n\nexport class StackController {\n private views: RouteView[] = [];\n private runningTask?: Promise<any>;\n private skipTransition = false;\n private tabsPrefix: string[] | undefined;\n private activeView: RouteView | undefined;\n private nextId = 0;\n\n constructor(\n tabsPrefix: string | undefined,\n private containerEl: HTMLIonRouterOutletElement,\n private router: Router,\n private navCtrl: NavController,\n private zone: NgZone,\n private location: Location\n ) {\n this.tabsPrefix = tabsPrefix !== undefined ? toSegments(tabsPrefix) : undefined;\n }\n\n createView(ref: ComponentRef<any>, activatedRoute: ActivatedRoute): RouteView {\n const url = getUrl(this.router, activatedRoute);\n const element = ref?.location?.nativeElement as HTMLElement;\n const unlistenEvents = bindLifecycleEvents(this.zone, ref.changeDetectorRef, ref.instance, element);\n return {\n id: this.nextId++,\n stackId: computeStackId(this.tabsPrefix, url),\n unlistenEvents,\n element,\n ref,\n url,\n };\n }\n\n getExistingView(activatedRoute: ActivatedRoute): RouteView | undefined {\n const activatedUrlKey = getUrl(this.router, activatedRoute);\n const view = this.views.find((vw) => vw.url === activatedUrlKey);\n if (view) {\n view.ref.changeDetectorRef.reattach();\n }\n return view;\n }\n\n setActive(enteringView: RouteView): Promise<StackDidChangeEvent> {\n const consumeResult = this.navCtrl.consumeTransition();\n let { direction, animation, animationBuilder } = consumeResult;\n const leavingView = this.activeView;\n const tabSwitch = isTabSwitch(enteringView, leavingView);\n if (tabSwitch) {\n direction = 'back';\n animation = undefined;\n }\n\n const viewsSnapshot = this.views.slice();\n\n let currentNavigation;\n\n const router = this.router as any;\n\n // Angular >= 7.2.0\n if (router.getCurrentNavigation) {\n currentNavigation = router.getCurrentNavigation();\n\n // Angular < 7.2.0\n } else if (router.navigations?.value) {\n currentNavigation = router.navigations.value;\n }\n\n /**\n * If the navigation action\n * sets `replaceUrl: true`\n * then we need to make sure\n * we remove the last item\n * from our views stack\n */\n if (currentNavigation?.extras?.replaceUrl) {\n if (this.views.length > 0) {\n this.views.splice(-1, 1);\n }\n }\n\n const reused = this.views.includes(enteringView);\n const views = this.insertView(enteringView, direction);\n\n // Trigger change detection before transition starts\n // This will call ngOnInit() the first time too, just after the view\n // was attached to the dom, but BEFORE the transition starts\n if (!reused) {\n enteringView.ref.changeDetectorRef.detectChanges();\n }\n\n /**\n * If we are going back from a page that\n * was presented using a custom animation\n * we should default to using that\n * unless the developer explicitly\n * provided another animation.\n */\n const customAnimation = enteringView.animationBuilder;\n if (animationBuilder === undefined && direction === 'back' && !tabSwitch && customAnimation !== undefined) {\n animationBuilder = customAnimation;\n }\n\n /**\n * Save any custom animation so that navigating\n * back will use this custom animation by default.\n */\n if (leavingView) {\n leavingView.animationBuilder = animationBuilder;\n }\n\n // Wait until previous transitions finish\n return this.zone.runOutsideAngular(() => {\n return this.wait(() => {\n // disconnect leaving page from change detection to\n // reduce jank during the page transition\n if (leavingView) {\n leavingView.ref.changeDetectorRef.detach();\n }\n // In case the enteringView is the same as the leavingPage we need to reattach()\n enteringView.ref.changeDetectorRef.reattach();\n\n return this.transition(enteringView, leavingView, animation, this.canGoBack(1), false, animationBuilder)\n .then(() => cleanupAsync(enteringView, views, viewsSnapshot, this.location, this.zone))\n .then(() => ({\n enteringView,\n direction,\n animation,\n tabSwitch,\n }));\n });\n });\n }\n\n canGoBack(deep: number, stackId = this.getActiveStackId()): boolean {\n return this.getStack(stackId).length > deep;\n }\n\n pop(deep: number, stackId = this.getActiveStackId()): Promise<boolean> {\n return this.zone.run(() => {\n const views = this.getStack(stackId);\n if (views.length <= deep) {\n return Promise.resolve(false);\n }\n const view = views[views.length - deep - 1];\n let url = view.url;\n\n const viewSavedData = view.savedData;\n if (viewSavedData) {\n const primaryOutlet = viewSavedData.get('primary');\n if (primaryOutlet?.route?._routerState?.snapshot.url) {\n url = primaryOutlet.route._routerState.snapshot.url;\n }\n }\n const { animationBuilder } = this.navCtrl.consumeTransition();\n return this.navCtrl.navigateBack(url, { ...view.savedExtras, animation: animationBuilder }).then(() => true);\n });\n }\n\n startBackTransition(): Promise<boolean> | Promise<void> {\n const leavingView = this.activeView;\n if (leavingView) {\n const views = this.getStack(leavingView.stackId);\n const enteringView = views[views.length - 2];\n const customAnimation = enteringView.animationBuilder;\n\n return this.wait(() => {\n return this.transition(\n enteringView, // entering view\n leavingView, // leaving view\n 'back',\n this.canGoBack(2),\n true,\n customAnimation\n );\n });\n }\n return Promise.resolve();\n }\n\n endBackTransition(shouldComplete: boolean): void {\n if (shouldComplete) {\n this.skipTransition = true;\n this.pop(1);\n } else if (this.activeView) {\n cleanup(this.activeView, this.views, this.views, this.location, this.zone);\n }\n }\n\n getLastUrl(stackId?: string): RouteView | undefined {\n const views = this.getStack(stackId);\n return views.length > 0 ? views[views.length - 1] : undefined;\n }\n\n /**\n * @internal\n */\n getRootUrl(stackId?: string): RouteView | undefined {\n const views = this.getStack(stackId);\n return views.length > 0 ? views[0] : undefined;\n }\n\n getActiveStackId(): string | undefined {\n return this.activeView ? this.activeView.stackId : undefined;\n }\n\n /**\n * @internal\n */\n getActiveView(): RouteView | undefined {\n return this.activeView;\n }\n\n hasRunningTask(): boolean {\n return this.runningTask !== undefined;\n }\n\n destroy(): void {\n this.containerEl = undefined!;\n this.views.forEach(destroyView);\n this.activeView = undefined;\n this.views = [];\n }\n\n private getStack(stackId: string | undefined) {\n return this.views.filter((v) => v.stackId === stackId);\n }\n\n private insertView(enteringView: RouteView, direction: RouterDirection) {\n this.activeView = enteringView;\n this.views = insertView(this.views, enteringView, direction);\n return this.views.slice();\n }\n\n private transition(\n enteringView: RouteView | undefined,\n leavingView: RouteView | undefined,\n direction: 'forward' | 'back' | undefined,\n showGoBack: boolean,\n progressAnimation: boolean,\n animationBuilder?: AnimationBuilder\n ) {\n if (this.skipTransition) {\n this.skipTransition = false;\n return Promise.resolve(false);\n }\n if (leavingView === enteringView) {\n return Promise.resolve(false);\n }\n const enteringEl = enteringView ? enteringView.element : undefined;\n const leavingEl = leavingView ? leavingView.element : undefined;\n const containerEl = this.containerEl;\n if (enteringEl && enteringEl !== leavingEl) {\n enteringEl.classList.add('ion-page');\n enteringEl.classList.add('ion-page-invisible');\n\n // containerEl is set to undefined when the stack controller is destroyed,\n // so a transition that resolves after its outlet was destroyed must not\n // dereference it (see destroy()).\n if ((containerEl as any)?.commit) {\n return containerEl.commit(enteringEl, leavingEl, {\n duration: direction === undefined ? 0 : undefined,\n direction,\n showGoBack,\n progressAnimation,\n animationBuilder,\n });\n }\n }\n return Promise.resolve(false);\n }\n\n private async wait<T>(task: () => Promise<T>): Promise<T> {\n if (this.runningTask !== undefined) {\n await this.runningTask;\n this.runningTask = undefined;\n }\n const promise = (this.runningTask = task());\n promise.finally(() => (this.runningTask = undefined));\n return promise;\n }\n}\n\nconst cleanupAsync = (\n activeRoute: RouteView,\n views: RouteView[],\n viewsSnapshot: RouteView[],\n location: Location,\n zone: NgZone\n) => {\n if (typeof (requestAnimationFrame as any) === 'function') {\n return new Promise<void>((resolve) => {\n requestAnimationFrame(() => {\n cleanup(activeRoute, views, viewsSnapshot, location, zone);\n resolve();\n });\n });\n }\n return Promise.resolve();\n};\n\nconst cleanup = (\n activeRoute: RouteView,\n views: RouteView[],\n viewsSnapshot: RouteView[],\n location: Location,\n zone: NgZone\n) => {\n /**\n * Re-enter the Angular zone when destroying page components. This will allow\n * lifecycle events (`ngOnDestroy`) to be run inside the Angular zone.\n */\n zone.run(() => viewsSnapshot.filter((view) => !views.includes(view)).forEach(destroyView));\n\n views.forEach((view) => {\n /**\n * In the event that a user navigated multiple\n * times in rapid succession, we want to make sure\n * we don't pre-emptively detach a view while\n * it is in mid-transition.\n *\n * In this instance we also do not care about query\n * params or fragments as it will be the same view regardless\n */\n const locationWithoutParams = location.path().split('?')[0];\n const locationWithoutFragment = locationWithoutParams.split('#')[0];\n\n if (view !== activeRoute && view.url !== locationWithoutFragment) {\n const element = view.element;\n element.setAttribute('aria-hidden', 'true');\n element.classList.add('ion-page-hidden');\n view.ref.changeDetectorRef.detach();\n }\n });\n};\n"]}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
export const insertView = (views, view, direction) => {
|
|
2
|
-
if (direction === 'root') {
|
|
3
|
-
return setRoot(views, view);
|
|
4
|
-
}
|
|
5
|
-
else if (direction === 'forward') {
|
|
6
|
-
return setForward(views, view);
|
|
7
|
-
}
|
|
8
|
-
else {
|
|
9
|
-
return setBack(views, view);
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
const setRoot = (views, view) => {
|
|
13
|
-
views = views.filter((v) => v.stackId !== view.stackId);
|
|
14
|
-
views.push(view);
|
|
15
|
-
return views;
|
|
16
|
-
};
|
|
17
|
-
const setForward = (views, view) => {
|
|
18
|
-
const index = views.indexOf(view);
|
|
19
|
-
if (index >= 0) {
|
|
20
|
-
views = views.filter((v) => v.stackId !== view.stackId || v.id <= view.id);
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
views.push(view);
|
|
24
|
-
}
|
|
25
|
-
return views;
|
|
26
|
-
};
|
|
27
|
-
const setBack = (views, view) => {
|
|
28
|
-
const index = views.indexOf(view);
|
|
29
|
-
if (index >= 0) {
|
|
30
|
-
return views.filter((v) => v.stackId !== view.stackId || v.id <= view.id);
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
return setRoot(views, view);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
export const getUrl = (router, activatedRoute) => {
|
|
37
|
-
const urlTree = router.createUrlTree(['.'], { relativeTo: activatedRoute });
|
|
38
|
-
return router.serializeUrl(urlTree);
|
|
39
|
-
};
|
|
40
|
-
export const isTabSwitch = (enteringView, leavingView) => {
|
|
41
|
-
if (!leavingView) {
|
|
42
|
-
return true;
|
|
43
|
-
}
|
|
44
|
-
return enteringView.stackId !== leavingView.stackId;
|
|
45
|
-
};
|
|
46
|
-
export const computeStackId = (prefixUrl, url) => {
|
|
47
|
-
if (!prefixUrl) {
|
|
48
|
-
return undefined;
|
|
49
|
-
}
|
|
50
|
-
const segments = toSegments(url);
|
|
51
|
-
for (let i = 0; i < segments.length; i++) {
|
|
52
|
-
if (i >= prefixUrl.length) {
|
|
53
|
-
return segments[i];
|
|
54
|
-
}
|
|
55
|
-
if (segments[i] !== prefixUrl[i]) {
|
|
56
|
-
return undefined;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return undefined;
|
|
60
|
-
};
|
|
61
|
-
export const toSegments = (path) => {
|
|
62
|
-
return path
|
|
63
|
-
.split('/')
|
|
64
|
-
.map((s) => s.trim())
|
|
65
|
-
.filter((s) => s !== '');
|
|
66
|
-
};
|
|
67
|
-
export const destroyView = (view) => {
|
|
68
|
-
if (view) {
|
|
69
|
-
view.ref.destroy();
|
|
70
|
-
view.unlistenEvents();
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
//# sourceMappingURL=stack-utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stack-utils.js","sourceRoot":"","sources":["../../../../src/common/directives/navigation/stack-utils.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAkB,EAAE,IAAe,EAAE,SAA0B,EAAe,EAAE;IACzG,IAAI,SAAS,KAAK,MAAM,EAAE,CAAC;QACzB,OAAO,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC9B,CAAC;SAAM,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC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Y,EAAE;IACnD,OAAO,IAAI;SACR,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACpB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;AAC7B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAA2B,EAAQ,EAAE;IAC/D,IAAI,IAAI,EAAE,CAAC;QACT,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;QACnB,IAAI,CAAC,cAAc,EAAE,CAAC;IACxB,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { ComponentRef } from '@angular/core';\nimport { ActivatedRoute, NavigationExtras, Router } from '@angular/router';\nimport type { AnimationBuilder, NavDirection, RouterDirection } from '@ionic/core/components';\n\nexport const insertView = (views: RouteView[], view: RouteView, direction: RouterDirection): RouteView[] => {\n if (direction === 'root') {\n return setRoot(views, view);\n } else if (direction === 'forward') {\n return setForward(views, view);\n } else {\n return setBack(views, view);\n }\n};\n\nconst setRoot = (views: RouteView[], view: RouteView) => {\n views = views.filter((v) => v.stackId !== view.stackId);\n views.push(view);\n return views;\n};\n\nconst setForward = (views: RouteView[], view: RouteView) => {\n const index = views.indexOf(view);\n if (index >= 0) {\n views = views.filter((v) => v.stackId !== view.stackId || v.id <= view.id);\n } else {\n views.push(view);\n }\n return views;\n};\n\nconst setBack = (views: RouteView[], view: RouteView) => {\n const index = views.indexOf(view);\n if (index >= 0) {\n return views.filter((v) => v.stackId !== view.stackId || v.id <= view.id);\n } else {\n return setRoot(views, view);\n }\n};\n\nexport const getUrl = (router: Router, activatedRoute: ActivatedRoute): string => {\n const urlTree = router.createUrlTree(['.'], { relativeTo: activatedRoute });\n return router.serializeUrl(urlTree);\n};\n\nexport const isTabSwitch = (enteringView: RouteView, leavingView: RouteView | undefined): boolean => {\n if (!leavingView) {\n return true;\n }\n return enteringView.stackId !== leavingView.stackId;\n};\n\nexport const computeStackId = (prefixUrl: string[] | undefined, url: string): string | undefined => {\n if (!prefixUrl) {\n return undefined;\n }\n const segments = toSegments(url);\n for (let i = 0; i < segments.length; i++) {\n if (i >= prefixUrl.length) {\n return segments[i];\n }\n if (segments[i] !== prefixUrl[i]) {\n return undefined;\n }\n }\n return undefined;\n};\n\nexport const toSegments = (path: string): string[] => {\n return path\n .split('/')\n .map((s) => s.trim())\n .filter((s) => s !== '');\n};\n\nexport const destroyView = (view: RouteView | undefined): void => {\n if (view) {\n view.ref.destroy();\n view.unlistenEvents();\n }\n};\n\nexport interface StackWillChangeEvent {\n enteringView: RouteView;\n /**\n * `true` if the event is trigged as a result of a switch\n * between tab navigation stacks.\n */\n tabSwitch: boolean;\n}\n\nexport interface StackDidChangeEvent {\n enteringView: RouteView;\n direction: RouterDirection;\n animation: NavDirection | undefined;\n /**\n * `true` if the event is trigged as a result of a switch\n * between tab navigation stacks.\n */\n tabSwitch: boolean;\n}\n\n// TODO(FW-2827): types\nexport interface RouteView {\n id: number;\n url: string;\n stackId: string | undefined;\n element: HTMLElement;\n ref: ComponentRef<any>;\n savedData?: any;\n savedExtras?: NavigationExtras;\n unlistenEvents: () => void;\n animationBuilder?: AnimationBuilder;\n}\n"]}
|