@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.
- package/README.md +9 -7
- package/dist/common/directives/control-value-accessors/index.js +2 -0
- package/dist/common/directives/control-value-accessors/index.js.map +1 -0
- package/{common → dist/common}/directives/control-value-accessors/value-accessor.d.ts +1 -1
- package/dist/common/directives/control-value-accessors/value-accessor.js +152 -0
- package/dist/common/directives/control-value-accessors/value-accessor.js.map +1 -0
- package/{common → dist/common}/directives/navigation/back-button.d.ts +1 -1
- package/dist/common/directives/navigation/back-button.js +61 -0
- package/dist/common/directives/navigation/back-button.js.map +1 -0
- package/dist/common/directives/navigation/nav-params.js +47 -0
- package/dist/common/directives/navigation/nav-params.js.map +1 -0
- package/{common → dist/common}/directives/navigation/nav.d.ts +1 -1
- package/dist/common/directives/navigation/nav.js +49 -0
- package/dist/common/directives/navigation/nav.js.map +1 -0
- package/{common → dist/common}/directives/navigation/router-link-delegate.d.ts +2 -2
- package/dist/common/directives/navigation/router-link-delegate.js +188 -0
- package/dist/common/directives/navigation/router-link-delegate.js.map +1 -0
- package/{common → dist/common}/directives/navigation/router-outlet.d.ts +1 -1
- package/dist/common/directives/navigation/router-outlet.js +476 -0
- package/dist/common/directives/navigation/router-outlet.js.map +1 -0
- package/dist/common/directives/navigation/stack-controller.js +282 -0
- package/dist/common/directives/navigation/stack-controller.js.map +1 -0
- package/dist/common/directives/navigation/stack-utils.js +73 -0
- package/dist/common/directives/navigation/stack-utils.js.map +1 -0
- package/{common → dist/common}/directives/navigation/tabs.d.ts +9 -1
- package/dist/common/directives/navigation/tabs.js +290 -0
- package/dist/common/directives/navigation/tabs.js.map +1 -0
- package/{common → dist/common}/index.d.ts +1 -1
- package/dist/common/index.js +20 -0
- package/dist/common/index.js.map +1 -0
- package/{common → dist/common}/overlays/modal.d.ts +1 -1
- package/dist/common/overlays/modal.js +96 -0
- package/dist/common/overlays/modal.js.map +1 -0
- package/{common → dist/common}/overlays/popover.d.ts +1 -1
- package/dist/common/overlays/popover.js +84 -0
- package/dist/common/overlays/popover.js.map +1 -0
- package/{common → dist/common}/providers/angular-delegate.d.ts +2 -2
- package/dist/common/providers/angular-delegate.js +229 -0
- package/dist/common/providers/angular-delegate.js.map +1 -0
- package/dist/common/providers/config.js +44 -0
- package/dist/common/providers/config.js.map +1 -0
- package/dist/common/providers/dom-controller.js +44 -0
- package/dist/common/providers/dom-controller.js.map +1 -0
- package/dist/common/providers/menu-controller.js +114 -0
- package/dist/common/providers/menu-controller.js.map +1 -0
- package/dist/common/providers/nav-controller.js +232 -0
- package/dist/common/providers/nav-controller.js.map +1 -0
- package/dist/common/providers/platform.js +256 -0
- package/dist/common/providers/platform.js.map +1 -0
- package/dist/common/types/interfaces.js +2 -0
- package/dist/common/types/interfaces.js.map +1 -0
- package/dist/common/types/ionic-lifecycle-hooks.js +5 -0
- package/dist/common/types/ionic-lifecycle-hooks.js.map +1 -0
- package/dist/common/types/overlay-options.js +2 -0
- package/dist/common/types/overlay-options.js.map +1 -0
- package/dist/common/utils/overlay.js +26 -0
- package/dist/common/utils/overlay.js.map +1 -0
- package/dist/common/utils/proxy.js +47 -0
- package/dist/common/utils/proxy.js.map +1 -0
- package/dist/common/utils/routing.js +55 -0
- package/dist/common/utils/routing.js.map +1 -0
- package/dist/common/utils/util.js +10 -0
- package/dist/common/utils/util.js.map +1 -0
- package/dist/lazy/app-initialize.js +29 -0
- package/dist/lazy/app-initialize.js.map +1 -0
- package/dist/lazy/directives/angular-component-lib/utils.js +59 -0
- package/dist/lazy/directives/angular-component-lib/utils.js.map +1 -0
- package/{directives → dist/lazy/directives}/control-value-accessors/boolean-value-accessor.d.ts +1 -1
- package/dist/lazy/directives/control-value-accessors/boolean-value-accessor.js +47 -0
- package/dist/lazy/directives/control-value-accessors/boolean-value-accessor.js.map +1 -0
- package/dist/lazy/directives/control-value-accessors/index.js +5 -0
- package/dist/lazy/directives/control-value-accessors/index.js.map +1 -0
- package/{directives → dist/lazy/directives}/control-value-accessors/numeric-value-accessor.d.ts +1 -1
- package/dist/lazy/directives/control-value-accessors/numeric-value-accessor.js +55 -0
- package/dist/lazy/directives/control-value-accessors/numeric-value-accessor.js.map +1 -0
- package/{directives → dist/lazy/directives}/control-value-accessors/select-value-accessor.d.ts +1 -1
- package/dist/lazy/directives/control-value-accessors/select-value-accessor.js +44 -0
- package/dist/lazy/directives/control-value-accessors/select-value-accessor.js.map +1 -0
- package/{directives → dist/lazy/directives}/control-value-accessors/text-value-accessor.d.ts +1 -1
- package/dist/lazy/directives/control-value-accessors/text-value-accessor.js +43 -0
- package/dist/lazy/directives/control-value-accessors/text-value-accessor.js.map +1 -0
- package/dist/lazy/directives/navigation/ion-back-button.js +24 -0
- package/dist/lazy/directives/navigation/ion-back-button.js.map +1 -0
- package/dist/lazy/directives/navigation/ion-nav.js +21 -0
- package/dist/lazy/directives/navigation/ion-nav.js.map +1 -0
- package/dist/lazy/directives/navigation/ion-router-outlet.js +52 -0
- package/dist/lazy/directives/navigation/ion-router-outlet.js.map +1 -0
- package/dist/lazy/directives/navigation/ion-tabs.js +58 -0
- package/dist/lazy/directives/navigation/ion-tabs.js.map +1 -0
- package/dist/lazy/directives/navigation/router-link-delegate.js +32 -0
- package/dist/lazy/directives/navigation/router-link-delegate.js.map +1 -0
- package/dist/lazy/directives/overlays/modal.js +22 -0
- package/dist/lazy/directives/overlays/modal.js.map +1 -0
- package/dist/lazy/directives/overlays/popover.js +18 -0
- package/dist/lazy/directives/overlays/popover.js.map +1 -0
- package/{directives → dist/lazy/directives}/proxies-list.d.ts +1 -1
- package/dist/lazy/directives/proxies-list.js +89 -0
- package/dist/lazy/directives/proxies-list.js.map +1 -0
- package/{directives → dist/lazy/directives}/proxies.d.ts +290 -191
- package/dist/lazy/directives/proxies.js +2759 -0
- package/dist/lazy/directives/proxies.js.map +1 -0
- package/dist/lazy/directives/validators/index.js +3 -0
- package/dist/lazy/directives/validators/index.js.map +1 -0
- package/dist/lazy/directives/validators/max-validator.js +26 -0
- package/dist/lazy/directives/validators/max-validator.js.map +1 -0
- package/dist/lazy/directives/validators/min-validator.js +26 -0
- package/dist/lazy/directives/validators/min-validator.js.map +1 -0
- package/{index.d.ts → dist/lazy/index.d.ts} +1 -2
- package/dist/lazy/index.js +34 -0
- package/dist/lazy/index.js.map +1 -0
- package/dist/lazy/ionic-module.d.ts +38 -0
- package/dist/lazy/ionic-module.js +121 -0
- package/dist/lazy/ionic-module.js.map +1 -0
- package/dist/lazy/providers/action-sheet-controller.js +18 -0
- package/dist/lazy/providers/action-sheet-controller.js.map +1 -0
- package/dist/lazy/providers/alert-controller.js +18 -0
- package/dist/lazy/providers/alert-controller.js.map +1 -0
- package/dist/lazy/providers/animation-controller.js +37 -0
- package/dist/lazy/providers/animation-controller.js.map +1 -0
- package/dist/lazy/providers/gesture-controller.js +32 -0
- package/dist/lazy/providers/gesture-controller.js.map +1 -0
- package/dist/lazy/providers/loading-controller.js +18 -0
- package/dist/lazy/providers/loading-controller.js.map +1 -0
- package/dist/lazy/providers/menu-controller.js +18 -0
- package/dist/lazy/providers/menu-controller.js.map +1 -0
- package/dist/lazy/providers/modal-controller.js +25 -0
- package/dist/lazy/providers/modal-controller.js.map +1 -0
- package/dist/lazy/providers/popover-controller.js +19 -0
- package/dist/lazy/providers/popover-controller.js.map +1 -0
- package/dist/lazy/providers/toast-controller.js +18 -0
- package/dist/lazy/providers/toast-controller.js.map +1 -0
- package/{schematics → dist/schematics}/add/index.js +6 -6
- package/dist/schematics/utils/ast.js +64 -0
- package/{schematics → dist/schematics}/utils/config.js +10 -11
- package/{schematics → dist/schematics}/utils/package.js +6 -4
- package/dist/standalone/directives/angular-component-lib/utils.js +59 -0
- package/dist/standalone/directives/angular-component-lib/utils.js.map +1 -0
- package/dist/standalone/directives/checkbox.js +75 -0
- package/dist/standalone/directives/checkbox.js.map +1 -0
- package/dist/standalone/directives/datetime.js +93 -0
- package/dist/standalone/directives/datetime.js.map +1 -0
- package/dist/standalone/directives/icon.js +35 -0
- package/dist/standalone/directives/icon.js.map +1 -0
- package/dist/standalone/directives/index.js +13 -0
- package/dist/standalone/directives/index.js.map +1 -0
- package/dist/standalone/directives/input-otp.js +89 -0
- package/dist/standalone/directives/input-otp.js.map +1 -0
- package/dist/standalone/directives/input.js +112 -0
- package/dist/standalone/directives/input.js.map +1 -0
- package/dist/standalone/directives/ion-accordion-group.d.ts +21 -0
- package/dist/standalone/directives/ion-accordion-group.js +40 -0
- package/dist/standalone/directives/ion-accordion-group.js.map +1 -0
- package/dist/standalone/directives/ion-accordion.d.ts +12 -0
- package/dist/standalone/directives/ion-accordion.js +36 -0
- package/dist/standalone/directives/ion-accordion.js.map +1 -0
- package/dist/standalone/directives/ion-action-sheet.d.ts +58 -0
- package/dist/standalone/directives/ion-action-sheet.js +62 -0
- package/dist/standalone/directives/ion-action-sheet.js.map +1 -0
- package/dist/standalone/directives/ion-alert.d.ts +58 -0
- package/dist/standalone/directives/ion-alert.js +62 -0
- package/dist/standalone/directives/ion-alert.js.map +1 -0
- package/dist/standalone/directives/ion-app.d.ts +12 -0
- package/dist/standalone/directives/ion-app.js +36 -0
- package/dist/standalone/directives/ion-app.js.map +1 -0
- package/dist/standalone/directives/ion-avatar.d.ts +12 -0
- package/dist/standalone/directives/ion-avatar.js +35 -0
- package/dist/standalone/directives/ion-avatar.js.map +1 -0
- package/dist/standalone/directives/ion-backdrop.d.ts +18 -0
- package/dist/standalone/directives/ion-backdrop.js +40 -0
- package/dist/standalone/directives/ion-backdrop.js.map +1 -0
- package/dist/standalone/directives/ion-badge.d.ts +12 -0
- package/dist/standalone/directives/ion-badge.js +36 -0
- package/dist/standalone/directives/ion-badge.js.map +1 -0
- package/dist/standalone/directives/ion-breadcrumb.d.ts +23 -0
- package/dist/standalone/directives/ion-breadcrumb.js +43 -0
- package/dist/standalone/directives/ion-breadcrumb.js.map +1 -0
- package/dist/standalone/directives/ion-breadcrumbs.d.ts +19 -0
- package/dist/standalone/directives/ion-breadcrumbs.js +40 -0
- package/dist/standalone/directives/ion-breadcrumbs.js.map +1 -0
- package/dist/standalone/directives/ion-button.d.ts +23 -0
- package/dist/standalone/directives/ion-button.js +43 -0
- package/dist/standalone/directives/ion-button.js.map +1 -0
- package/dist/standalone/directives/ion-buttons.d.ts +12 -0
- package/dist/standalone/directives/ion-buttons.js +36 -0
- package/dist/standalone/directives/ion-buttons.js.map +1 -0
- package/dist/standalone/directives/ion-card-content.d.ts +12 -0
- package/dist/standalone/directives/ion-card-content.js +36 -0
- package/dist/standalone/directives/ion-card-content.js.map +1 -0
- package/dist/standalone/directives/ion-card-header.d.ts +12 -0
- package/dist/standalone/directives/ion-card-header.js +36 -0
- package/dist/standalone/directives/ion-card-header.js.map +1 -0
- package/dist/standalone/directives/ion-card-subtitle.d.ts +12 -0
- package/dist/standalone/directives/ion-card-subtitle.js +36 -0
- package/dist/standalone/directives/ion-card-subtitle.js.map +1 -0
- package/dist/standalone/directives/ion-card-title.d.ts +12 -0
- package/dist/standalone/directives/ion-card-title.js +36 -0
- package/dist/standalone/directives/ion-card-title.js.map +1 -0
- package/dist/standalone/directives/ion-card.d.ts +12 -0
- package/dist/standalone/directives/ion-card.js +36 -0
- package/dist/standalone/directives/ion-card.js.map +1 -0
- package/dist/standalone/directives/ion-chip.d.ts +12 -0
- package/dist/standalone/directives/ion-chip.js +36 -0
- package/dist/standalone/directives/ion-chip.js.map +1 -0
- package/dist/standalone/directives/ion-col.d.ts +12 -0
- package/dist/standalone/directives/ion-col.js +36 -0
- package/dist/standalone/directives/ion-col.js.map +1 -0
- package/dist/standalone/directives/ion-content.d.ts +33 -0
- package/dist/standalone/directives/ion-content.js +47 -0
- package/dist/standalone/directives/ion-content.js.map +1 -0
- package/dist/standalone/directives/ion-datetime-button.d.ts +12 -0
- package/dist/standalone/directives/ion-datetime-button.js +36 -0
- package/dist/standalone/directives/ion-datetime-button.js.map +1 -0
- package/dist/standalone/directives/ion-fab-button.d.ts +23 -0
- package/dist/standalone/directives/ion-fab-button.js +43 -0
- package/dist/standalone/directives/ion-fab-button.js.map +1 -0
- package/dist/standalone/directives/ion-fab-list.d.ts +12 -0
- package/dist/standalone/directives/ion-fab-list.js +36 -0
- package/dist/standalone/directives/ion-fab-list.js.map +1 -0
- package/dist/standalone/directives/ion-fab.d.ts +12 -0
- package/dist/standalone/directives/ion-fab.js +37 -0
- package/dist/standalone/directives/ion-fab.js.map +1 -0
- package/dist/standalone/directives/ion-footer.d.ts +12 -0
- package/dist/standalone/directives/ion-footer.js +36 -0
- package/dist/standalone/directives/ion-footer.js.map +1 -0
- package/dist/standalone/directives/ion-grid.d.ts +12 -0
- package/dist/standalone/directives/ion-grid.js +36 -0
- package/dist/standalone/directives/ion-grid.js.map +1 -0
- package/dist/standalone/directives/ion-header.d.ts +12 -0
- package/dist/standalone/directives/ion-header.js +36 -0
- package/dist/standalone/directives/ion-header.js.map +1 -0
- package/dist/standalone/directives/ion-img.d.ts +28 -0
- package/dist/standalone/directives/ion-img.js +46 -0
- package/dist/standalone/directives/ion-img.js.map +1 -0
- package/dist/standalone/directives/ion-infinite-scroll-content.d.ts +12 -0
- package/dist/standalone/directives/ion-infinite-scroll-content.js +36 -0
- package/dist/standalone/directives/ion-infinite-scroll-content.js.map +1 -0
- package/dist/standalone/directives/ion-infinite-scroll.d.ts +21 -0
- package/dist/standalone/directives/ion-infinite-scroll.js +41 -0
- package/dist/standalone/directives/ion-infinite-scroll.js.map +1 -0
- package/dist/standalone/directives/ion-input-password-toggle.d.ts +12 -0
- package/dist/standalone/directives/ion-input-password-toggle.js +36 -0
- package/dist/standalone/directives/ion-input-password-toggle.js.map +1 -0
- package/dist/standalone/directives/ion-item-divider.d.ts +12 -0
- package/dist/standalone/directives/ion-item-divider.js +36 -0
- package/dist/standalone/directives/ion-item-divider.js.map +1 -0
- package/dist/standalone/directives/ion-item-group.d.ts +12 -0
- package/dist/standalone/directives/ion-item-group.js +35 -0
- package/dist/standalone/directives/ion-item-group.js.map +1 -0
- package/dist/standalone/directives/ion-item-option.d.ts +12 -0
- package/dist/standalone/directives/ion-item-option.js +36 -0
- package/dist/standalone/directives/ion-item-option.js.map +1 -0
- package/dist/standalone/directives/ion-item-options.d.ts +18 -0
- package/dist/standalone/directives/ion-item-options.js +40 -0
- package/dist/standalone/directives/ion-item-options.js.map +1 -0
- package/dist/standalone/directives/ion-item-sliding.d.ts +18 -0
- package/dist/standalone/directives/ion-item-sliding.js +41 -0
- package/dist/standalone/directives/ion-item-sliding.js.map +1 -0
- package/dist/standalone/directives/ion-item.d.ts +12 -0
- package/dist/standalone/directives/ion-item.js +36 -0
- package/dist/standalone/directives/ion-item.js.map +1 -0
- package/dist/standalone/directives/ion-label.d.ts +12 -0
- package/dist/standalone/directives/ion-label.js +36 -0
- package/dist/standalone/directives/ion-label.js.map +1 -0
- package/dist/standalone/directives/ion-list-header.d.ts +12 -0
- package/dist/standalone/directives/ion-list-header.js +36 -0
- package/dist/standalone/directives/ion-list-header.js.map +1 -0
- package/dist/standalone/directives/ion-list.d.ts +12 -0
- package/dist/standalone/directives/ion-list.js +37 -0
- package/dist/standalone/directives/ion-list.js.map +1 -0
- package/dist/standalone/directives/ion-loading.d.ts +58 -0
- package/dist/standalone/directives/ion-loading.js +62 -0
- package/dist/standalone/directives/ion-loading.js.map +1 -0
- package/dist/standalone/directives/ion-menu-button.d.ts +12 -0
- package/dist/standalone/directives/ion-menu-button.js +36 -0
- package/dist/standalone/directives/ion-menu-button.js.map +1 -0
- package/dist/standalone/directives/ion-menu-toggle.d.ts +12 -0
- package/dist/standalone/directives/ion-menu-toggle.js +36 -0
- package/dist/standalone/directives/ion-menu-toggle.js.map +1 -0
- package/dist/standalone/directives/ion-menu.d.ts +34 -0
- package/dist/standalone/directives/ion-menu.js +50 -0
- package/dist/standalone/directives/ion-menu.js.map +1 -0
- package/dist/standalone/directives/ion-nav-link.d.ts +12 -0
- package/dist/standalone/directives/ion-nav-link.js +36 -0
- package/dist/standalone/directives/ion-nav-link.js.map +1 -0
- package/dist/standalone/directives/ion-note.d.ts +12 -0
- package/dist/standalone/directives/ion-note.js +36 -0
- package/dist/standalone/directives/ion-note.js.map +1 -0
- package/dist/standalone/directives/ion-picker-column-option.d.ts +12 -0
- package/dist/standalone/directives/ion-picker-column-option.js +36 -0
- package/dist/standalone/directives/ion-picker-column-option.js.map +1 -0
- package/dist/standalone/directives/ion-picker-column.d.ts +21 -0
- package/dist/standalone/directives/ion-picker-column.js +41 -0
- package/dist/standalone/directives/ion-picker-column.js.map +1 -0
- package/dist/standalone/directives/ion-picker.d.ts +12 -0
- package/dist/standalone/directives/ion-picker.js +36 -0
- package/dist/standalone/directives/ion-picker.js.map +1 -0
- package/dist/standalone/directives/ion-progress-bar.d.ts +12 -0
- package/dist/standalone/directives/ion-progress-bar.js +36 -0
- package/dist/standalone/directives/ion-progress-bar.js.map +1 -0
- package/dist/standalone/directives/ion-radio.d.ts +23 -0
- package/dist/standalone/directives/ion-radio.js +43 -0
- package/dist/standalone/directives/ion-radio.js.map +1 -0
- package/dist/standalone/directives/ion-refresher-content.d.ts +12 -0
- package/dist/standalone/directives/ion-refresher-content.js +36 -0
- package/dist/standalone/directives/ion-refresher-content.js.map +1 -0
- package/dist/standalone/directives/ion-refresher.d.ts +45 -0
- package/dist/standalone/directives/ion-refresher.js +53 -0
- package/dist/standalone/directives/ion-refresher.js.map +1 -0
- package/dist/standalone/directives/ion-reorder-group.d.ts +44 -0
- package/dist/standalone/directives/ion-reorder-group.js +50 -0
- package/dist/standalone/directives/ion-reorder-group.js.map +1 -0
- package/dist/standalone/directives/ion-reorder.d.ts +12 -0
- package/dist/standalone/directives/ion-reorder.js +35 -0
- package/dist/standalone/directives/ion-reorder.js.map +1 -0
- package/dist/standalone/directives/ion-ripple-effect.d.ts +12 -0
- package/dist/standalone/directives/ion-ripple-effect.js +37 -0
- package/dist/standalone/directives/ion-ripple-effect.js.map +1 -0
- package/dist/standalone/directives/ion-row.d.ts +12 -0
- package/dist/standalone/directives/ion-row.js +35 -0
- package/dist/standalone/directives/ion-row.js.map +1 -0
- package/dist/standalone/directives/ion-segment-button.d.ts +12 -0
- package/dist/standalone/directives/ion-segment-button.js +36 -0
- package/dist/standalone/directives/ion-segment-button.js.map +1 -0
- package/dist/standalone/directives/ion-segment-content.d.ts +12 -0
- package/dist/standalone/directives/ion-segment-content.js +35 -0
- package/dist/standalone/directives/ion-segment-content.js.map +1 -0
- package/dist/standalone/directives/ion-segment-view.d.ts +19 -0
- package/dist/standalone/directives/ion-segment-view.js +40 -0
- package/dist/standalone/directives/ion-segment-view.js.map +1 -0
- package/dist/standalone/directives/ion-select-modal.d.ts +12 -0
- package/dist/standalone/directives/ion-select-modal.js +36 -0
- package/dist/standalone/directives/ion-select-modal.js.map +1 -0
- package/dist/standalone/directives/ion-select-option.d.ts +12 -0
- package/dist/standalone/directives/ion-select-option.js +36 -0
- package/dist/standalone/directives/ion-select-option.js.map +1 -0
- package/dist/standalone/directives/ion-skeleton-text.d.ts +12 -0
- package/dist/standalone/directives/ion-skeleton-text.js +36 -0
- package/dist/standalone/directives/ion-skeleton-text.js.map +1 -0
- package/dist/standalone/directives/ion-spinner.d.ts +12 -0
- package/dist/standalone/directives/ion-spinner.js +36 -0
- package/dist/standalone/directives/ion-spinner.js.map +1 -0
- package/dist/standalone/directives/ion-split-pane.d.ts +22 -0
- package/dist/standalone/directives/ion-split-pane.js +40 -0
- package/dist/standalone/directives/ion-split-pane.js.map +1 -0
- package/dist/standalone/directives/ion-tab-bar.d.ts +12 -0
- package/dist/standalone/directives/ion-tab-bar.js +36 -0
- package/dist/standalone/directives/ion-tab-bar.js.map +1 -0
- package/dist/standalone/directives/ion-tab-button.d.ts +12 -0
- package/dist/standalone/directives/ion-tab-button.js +36 -0
- package/dist/standalone/directives/ion-tab-button.js.map +1 -0
- package/dist/standalone/directives/ion-tab.d.ts +12 -0
- package/dist/standalone/directives/ion-tab.js +37 -0
- package/dist/standalone/directives/ion-tab.js.map +1 -0
- package/dist/standalone/directives/ion-text.d.ts +12 -0
- package/dist/standalone/directives/ion-text.js +36 -0
- package/dist/standalone/directives/ion-text.js.map +1 -0
- package/dist/standalone/directives/ion-thumbnail.d.ts +12 -0
- package/dist/standalone/directives/ion-thumbnail.js +35 -0
- package/dist/standalone/directives/ion-thumbnail.js.map +1 -0
- package/dist/standalone/directives/ion-title.d.ts +12 -0
- package/dist/standalone/directives/ion-title.js +36 -0
- package/dist/standalone/directives/ion-title.js.map +1 -0
- package/dist/standalone/directives/ion-toast.d.ts +58 -0
- package/dist/standalone/directives/ion-toast.js +62 -0
- package/dist/standalone/directives/ion-toast.js.map +1 -0
- package/dist/standalone/directives/ion-toolbar.d.ts +12 -0
- package/dist/standalone/directives/ion-toolbar.js +36 -0
- package/dist/standalone/directives/ion-toolbar.js.map +1 -0
- package/dist/standalone/directives/proxies.d.ts +77 -0
- package/dist/standalone/directives/proxies.js +79 -0
- package/dist/standalone/directives/proxies.js.map +1 -0
- package/dist/standalone/directives/radio-group.js +59 -0
- package/dist/standalone/directives/radio-group.js.map +1 -0
- package/dist/standalone/directives/range.js +77 -0
- package/dist/standalone/directives/range.js.map +1 -0
- package/dist/standalone/directives/searchbar.js +81 -0
- package/dist/standalone/directives/searchbar.js.map +1 -0
- package/dist/standalone/directives/segment.js +59 -0
- package/dist/standalone/directives/segment.js.map +1 -0
- package/dist/standalone/directives/select.js +83 -0
- package/dist/standalone/directives/select.js.map +1 -0
- package/dist/standalone/directives/textarea.js +90 -0
- package/dist/standalone/directives/textarea.js.map +1 -0
- package/dist/standalone/directives/toggle.js +75 -0
- package/dist/standalone/directives/toggle.js.map +1 -0
- package/{standalone → dist/standalone}/index.d.ts +1 -2
- package/dist/standalone/index.js +24 -0
- package/dist/standalone/index.js.map +1 -0
- package/dist/standalone/navigation/back-button.js +32 -0
- package/dist/standalone/navigation/back-button.js.map +1 -0
- package/dist/standalone/navigation/nav.js +28 -0
- package/dist/standalone/navigation/nav.js.map +1 -0
- package/dist/standalone/navigation/router-link-delegate.js +26 -0
- package/dist/standalone/navigation/router-link-delegate.js.map +1 -0
- package/dist/standalone/navigation/router-outlet.js +60 -0
- package/dist/standalone/navigation/router-outlet.js.map +1 -0
- package/dist/standalone/navigation/tabs.js +57 -0
- package/dist/standalone/navigation/tabs.js.map +1 -0
- package/dist/standalone/overlays/modal.js +32 -0
- package/dist/standalone/overlays/modal.js.map +1 -0
- package/dist/standalone/overlays/popover.js +28 -0
- package/dist/standalone/overlays/popover.js.map +1 -0
- package/dist/standalone/providers/action-sheet-controller.js +20 -0
- package/dist/standalone/providers/action-sheet-controller.js.map +1 -0
- package/dist/standalone/providers/alert-controller.js +20 -0
- package/dist/standalone/providers/alert-controller.js.map +1 -0
- package/dist/standalone/providers/animation-controller.js +37 -0
- package/dist/standalone/providers/animation-controller.js.map +1 -0
- package/dist/standalone/providers/gesture-controller.js +32 -0
- package/dist/standalone/providers/gesture-controller.js.map +1 -0
- package/dist/standalone/providers/ionic-angular.js +38 -0
- package/dist/standalone/providers/ionic-angular.js.map +1 -0
- package/dist/standalone/providers/loading-controller.js +20 -0
- package/dist/standalone/providers/loading-controller.js.map +1 -0
- package/dist/standalone/providers/menu-controller.js +18 -0
- package/dist/standalone/providers/menu-controller.js.map +1 -0
- package/dist/standalone/providers/modal-controller.js +27 -0
- package/dist/standalone/providers/modal-controller.js.map +1 -0
- package/dist/standalone/providers/popover-controller.js +21 -0
- package/dist/standalone/providers/popover-controller.js.map +1 -0
- package/dist/standalone/providers/toast-controller.js +20 -0
- package/dist/standalone/providers/toast-controller.js.map +1 -0
- package/package.json +172 -30
- package/esm2022/app-initialize.mjs +0 -29
- package/esm2022/common/directives/control-value-accessors/index.mjs +0 -2
- package/esm2022/common/directives/control-value-accessors/value-accessor.mjs +0 -153
- package/esm2022/common/directives/navigation/back-button.mjs +0 -61
- package/esm2022/common/directives/navigation/nav-params.mjs +0 -47
- package/esm2022/common/directives/navigation/nav.mjs +0 -49
- package/esm2022/common/directives/navigation/router-link-delegate.mjs +0 -190
- package/esm2022/common/directives/navigation/router-outlet.mjs +0 -480
- package/esm2022/common/directives/navigation/stack-controller.mjs +0 -283
- package/esm2022/common/directives/navigation/stack-utils.mjs +0 -73
- package/esm2022/common/directives/navigation/tabs.mjs +0 -279
- package/esm2022/common/index.mjs +0 -20
- package/esm2022/common/ionic-angular-common.mjs +0 -5
- package/esm2022/common/overlays/modal.mjs +0 -103
- package/esm2022/common/overlays/popover.mjs +0 -91
- package/esm2022/common/providers/angular-delegate.mjs +0 -210
- package/esm2022/common/providers/config.mjs +0 -45
- package/esm2022/common/providers/dom-controller.mjs +0 -45
- package/esm2022/common/providers/menu-controller.mjs +0 -114
- package/esm2022/common/providers/nav-controller.mjs +0 -235
- package/esm2022/common/providers/platform.mjs +0 -258
- package/esm2022/common/types/interfaces.mjs +0 -2
- package/esm2022/common/types/ionic-lifecycle-hooks.mjs +0 -5
- package/esm2022/common/types/overlay-options.mjs +0 -2
- package/esm2022/common/utils/overlay.mjs +0 -26
- package/esm2022/common/utils/proxy.mjs +0 -47
- package/esm2022/common/utils/routing.mjs +0 -55
- package/esm2022/common/utils/util.mjs +0 -10
- package/esm2022/directives/angular-component-lib/utils.mjs +0 -59
- package/esm2022/directives/control-value-accessors/boolean-value-accessor.mjs +0 -42
- package/esm2022/directives/control-value-accessors/index.mjs +0 -5
- package/esm2022/directives/control-value-accessors/numeric-value-accessor.mjs +0 -50
- package/esm2022/directives/control-value-accessors/select-value-accessor.mjs +0 -39
- package/esm2022/directives/control-value-accessors/text-value-accessor.mjs +0 -38
- package/esm2022/directives/navigation/ion-back-button.mjs +0 -24
- package/esm2022/directives/navigation/ion-nav.mjs +0 -21
- package/esm2022/directives/navigation/ion-router-outlet.mjs +0 -52
- package/esm2022/directives/navigation/ion-tabs.mjs +0 -59
- package/esm2022/directives/navigation/router-link-delegate.mjs +0 -32
- package/esm2022/directives/overlays/modal.mjs +0 -22
- package/esm2022/directives/overlays/popover.mjs +0 -18
- package/esm2022/directives/proxies-list.mjs +0 -90
- package/esm2022/directives/proxies.mjs +0 -2373
- package/esm2022/directives/validators/index.mjs +0 -3
- package/esm2022/directives/validators/max-validator.mjs +0 -27
- package/esm2022/directives/validators/min-validator.mjs +0 -27
- package/esm2022/index.mjs +0 -32
- package/esm2022/ionic-angular.mjs +0 -5
- package/esm2022/ionic-module.mjs +0 -111
- package/esm2022/providers/action-sheet-controller.mjs +0 -19
- package/esm2022/providers/alert-controller.mjs +0 -19
- package/esm2022/providers/animation-controller.mjs +0 -38
- package/esm2022/providers/gesture-controller.mjs +0 -33
- package/esm2022/providers/loading-controller.mjs +0 -19
- package/esm2022/providers/menu-controller.mjs +0 -19
- package/esm2022/providers/modal-controller.mjs +0 -26
- package/esm2022/providers/picker-controller.mjs +0 -22
- package/esm2022/providers/popover-controller.mjs +0 -19
- package/esm2022/providers/toast-controller.mjs +0 -19
- package/esm2022/standalone/directives/angular-component-lib/utils.mjs +0 -59
- package/esm2022/standalone/directives/checkbox.mjs +0 -76
- package/esm2022/standalone/directives/datetime.mjs +0 -95
- package/esm2022/standalone/directives/icon.mjs +0 -35
- package/esm2022/standalone/directives/index.mjs +0 -13
- package/esm2022/standalone/directives/input-otp.mjs +0 -90
- package/esm2022/standalone/directives/input.mjs +0 -113
- package/esm2022/standalone/directives/proxies.mjs +0 -2260
- package/esm2022/standalone/directives/radio-group.mjs +0 -60
- package/esm2022/standalone/directives/range.mjs +0 -78
- package/esm2022/standalone/directives/searchbar.mjs +0 -82
- package/esm2022/standalone/directives/segment.mjs +0 -60
- package/esm2022/standalone/directives/select.mjs +0 -84
- package/esm2022/standalone/directives/textarea.mjs +0 -91
- package/esm2022/standalone/directives/toggle.mjs +0 -76
- package/esm2022/standalone/index.mjs +0 -25
- package/esm2022/standalone/ionic-angular-standalone.mjs +0 -5
- package/esm2022/standalone/navigation/back-button.mjs +0 -32
- package/esm2022/standalone/navigation/nav.mjs +0 -28
- package/esm2022/standalone/navigation/router-link-delegate.mjs +0 -28
- package/esm2022/standalone/navigation/router-outlet.mjs +0 -60
- package/esm2022/standalone/navigation/tabs.mjs +0 -58
- package/esm2022/standalone/overlays/modal.mjs +0 -32
- package/esm2022/standalone/overlays/popover.mjs +0 -28
- package/esm2022/standalone/providers/action-sheet-controller.mjs +0 -21
- package/esm2022/standalone/providers/alert-controller.mjs +0 -21
- package/esm2022/standalone/providers/animation-controller.mjs +0 -38
- package/esm2022/standalone/providers/gesture-controller.mjs +0 -33
- package/esm2022/standalone/providers/ionic-angular.mjs +0 -38
- package/esm2022/standalone/providers/loading-controller.mjs +0 -21
- package/esm2022/standalone/providers/menu-controller.mjs +0 -19
- package/esm2022/standalone/providers/modal-controller.mjs +0 -28
- package/esm2022/standalone/providers/picker-controller.mjs +0 -24
- package/esm2022/standalone/providers/popover-controller.mjs +0 -21
- package/esm2022/standalone/providers/toast-controller.mjs +0 -21
- package/fesm2022/ionic-angular-common.mjs +0 -2791
- package/fesm2022/ionic-angular-common.mjs.map +0 -1
- package/fesm2022/ionic-angular-standalone.mjs +0 -3562
- package/fesm2022/ionic-angular-standalone.mjs.map +0 -1
- package/fesm2022/ionic-angular.mjs +0 -3139
- package/fesm2022/ionic-angular.mjs.map +0 -1
- package/ionic-module.d.ts +0 -28
- package/providers/picker-controller.d.ts +0 -11
- package/schematics/utils/ast.js +0 -32
- package/standalone/directives/proxies.d.ts +0 -1035
- package/standalone/providers/picker-controller.d.ts +0 -11
- /package/{common → dist/common}/directives/control-value-accessors/index.d.ts +0 -0
- /package/{common → dist/common}/directives/navigation/nav-params.d.ts +0 -0
- /package/{common → dist/common}/directives/navigation/stack-controller.d.ts +0 -0
- /package/{common → dist/common}/directives/navigation/stack-utils.d.ts +0 -0
- /package/{common → dist/common}/providers/config.d.ts +0 -0
- /package/{common → dist/common}/providers/dom-controller.d.ts +0 -0
- /package/{common → dist/common}/providers/menu-controller.d.ts +0 -0
- /package/{common → dist/common}/providers/nav-controller.d.ts +0 -0
- /package/{common → dist/common}/providers/platform.d.ts +0 -0
- /package/{common → dist/common}/types/interfaces.d.ts +0 -0
- /package/{common → dist/common}/types/ionic-lifecycle-hooks.d.ts +0 -0
- /package/{common → dist/common}/types/overlay-options.d.ts +0 -0
- /package/{common → dist/common}/utils/overlay.d.ts +0 -0
- /package/{common → dist/common}/utils/proxy.d.ts +0 -0
- /package/{common → dist/common}/utils/routing.d.ts +0 -0
- /package/{common → dist/common}/utils/util.d.ts +0 -0
- /package/{app-initialize.d.ts → dist/lazy/app-initialize.d.ts} +0 -0
- /package/{directives → dist/lazy/directives}/angular-component-lib/utils.d.ts +0 -0
- /package/{directives → dist/lazy/directives}/control-value-accessors/index.d.ts +0 -0
- /package/{directives → dist/lazy/directives}/navigation/ion-back-button.d.ts +0 -0
- /package/{directives → dist/lazy/directives}/navigation/ion-nav.d.ts +0 -0
- /package/{directives → dist/lazy/directives}/navigation/ion-router-outlet.d.ts +0 -0
- /package/{directives → dist/lazy/directives}/navigation/ion-tabs.d.ts +0 -0
- /package/{directives → dist/lazy/directives}/navigation/router-link-delegate.d.ts +0 -0
- /package/{directives → dist/lazy/directives}/overlays/modal.d.ts +0 -0
- /package/{directives → dist/lazy/directives}/overlays/popover.d.ts +0 -0
- /package/{directives → dist/lazy/directives}/validators/index.d.ts +0 -0
- /package/{directives → dist/lazy/directives}/validators/max-validator.d.ts +0 -0
- /package/{directives → dist/lazy/directives}/validators/min-validator.d.ts +0 -0
- /package/{providers → dist/lazy/providers}/action-sheet-controller.d.ts +0 -0
- /package/{providers → dist/lazy/providers}/alert-controller.d.ts +0 -0
- /package/{providers → dist/lazy/providers}/animation-controller.d.ts +0 -0
- /package/{providers → dist/lazy/providers}/gesture-controller.d.ts +0 -0
- /package/{providers → dist/lazy/providers}/loading-controller.d.ts +0 -0
- /package/{providers → dist/lazy/providers}/menu-controller.d.ts +0 -0
- /package/{providers → dist/lazy/providers}/modal-controller.d.ts +0 -0
- /package/{providers → dist/lazy/providers}/popover-controller.d.ts +0 -0
- /package/{providers → dist/lazy/providers}/toast-controller.d.ts +0 -0
- /package/{schematics → dist/schematics}/add/files/root/theme/variables.css +0 -0
- /package/{schematics → dist/schematics}/add/schema.json +0 -0
- /package/{schematics → dist/schematics}/collection.json +0 -0
- /package/{standalone → dist/standalone}/directives/angular-component-lib/utils.d.ts +0 -0
- /package/{standalone → dist/standalone}/directives/checkbox.d.ts +0 -0
- /package/{standalone → dist/standalone}/directives/datetime.d.ts +0 -0
- /package/{standalone → dist/standalone}/directives/icon.d.ts +0 -0
- /package/{standalone → dist/standalone}/directives/index.d.ts +0 -0
- /package/{standalone → dist/standalone}/directives/input-otp.d.ts +0 -0
- /package/{standalone → dist/standalone}/directives/input.d.ts +0 -0
- /package/{standalone → dist/standalone}/directives/radio-group.d.ts +0 -0
- /package/{standalone → dist/standalone}/directives/range.d.ts +0 -0
- /package/{standalone → dist/standalone}/directives/searchbar.d.ts +0 -0
- /package/{standalone → dist/standalone}/directives/segment.d.ts +0 -0
- /package/{standalone → dist/standalone}/directives/select.d.ts +0 -0
- /package/{standalone → dist/standalone}/directives/textarea.d.ts +0 -0
- /package/{standalone → dist/standalone}/directives/toggle.d.ts +0 -0
- /package/{standalone → dist/standalone}/navigation/back-button.d.ts +0 -0
- /package/{standalone → dist/standalone}/navigation/nav.d.ts +0 -0
- /package/{standalone → dist/standalone}/navigation/router-link-delegate.d.ts +0 -0
- /package/{standalone → dist/standalone}/navigation/router-outlet.d.ts +0 -0
- /package/{standalone → dist/standalone}/navigation/tabs.d.ts +0 -0
- /package/{standalone → dist/standalone}/overlays/modal.d.ts +0 -0
- /package/{standalone → dist/standalone}/overlays/popover.d.ts +0 -0
- /package/{standalone → dist/standalone}/providers/action-sheet-controller.d.ts +0 -0
- /package/{standalone → dist/standalone}/providers/alert-controller.d.ts +0 -0
- /package/{standalone → dist/standalone}/providers/animation-controller.d.ts +0 -0
- /package/{standalone → dist/standalone}/providers/gesture-controller.d.ts +0 -0
- /package/{standalone → dist/standalone}/providers/ionic-angular.d.ts +0 -0
- /package/{standalone → dist/standalone}/providers/loading-controller.d.ts +0 -0
- /package/{standalone → dist/standalone}/providers/menu-controller.d.ts +0 -0
- /package/{standalone → dist/standalone}/providers/modal-controller.d.ts +0 -0
- /package/{standalone → dist/standalone}/providers/popover-controller.d.ts +0 -0
- /package/{standalone → dist/standalone}/providers/toast-controller.d.ts +0 -0
package/README.md
CHANGED
|
@@ -57,7 +57,6 @@ This guide shows you how to test the local Ionic Framework build with a new Angu
|
|
|
57
57
|
|
|
58
58
|
5. Create a tarball:
|
|
59
59
|
```sh
|
|
60
|
-
cd dist
|
|
61
60
|
npm pack
|
|
62
61
|
```
|
|
63
62
|
|
|
@@ -72,7 +71,7 @@ This guide shows you how to test the local Ionic Framework build with a new Angu
|
|
|
72
71
|
```sh
|
|
73
72
|
# Change to whichever directory you want the app in
|
|
74
73
|
cd ~/Documents/
|
|
75
|
-
ng new my-app --style=css --ssr=false
|
|
74
|
+
ng new my-app --style=css --ssr=false
|
|
76
75
|
cd my-app
|
|
77
76
|
```
|
|
78
77
|
|
|
@@ -99,16 +98,19 @@ The local Ionic Framework build is now active in the Angular app. Changes to the
|
|
|
99
98
|
|
|
100
99
|
This is where logic that is shared between lazy loaded and standalone components live. For example, the lazy loaded IonPopover and standalone IonPopover components extend from a base IonPopover implementation that exists in this directory.
|
|
101
100
|
|
|
102
|
-
**Note:** This directory exposes internal APIs and is only accessed in the `standalone` and `
|
|
101
|
+
**Note:** This directory exposes internal APIs and is only accessed in the `standalone` and `lazy` submodules. Ionic developers should never import directly from `@ionic/angular/common`. Instead, they should import from `@ionic/angular` or `@ionic/angular/lazy`.
|
|
103
102
|
|
|
104
103
|
**standalone**
|
|
105
104
|
|
|
106
|
-
This is where the standalone component implementations live. It was added as a separate entry point to avoid any lazy loaded logic from accidentally being pulled in to the final build. Having a separate directory allows the lazy loaded implementation to remain accessible from `@ionic/angular` for backwards compatibility.
|
|
105
|
+
This is where the standalone component implementations live. It was added as a separate entry point to avoid any lazy loaded logic from accidentally being pulled in to the final build. Having a separate directory allows the lazy loaded implementation to remain accessible from `@ionic/angular/lazy` for backwards compatibility.
|
|
107
106
|
|
|
108
|
-
Ionic developers can access this by importing from `@ionic/angular
|
|
107
|
+
Ionic developers can access this by importing from `@ionic/angular`.
|
|
109
108
|
|
|
110
|
-
**
|
|
109
|
+
**lazy**
|
|
111
110
|
|
|
112
111
|
This is where the lazy loaded component implementations live.
|
|
113
112
|
|
|
114
|
-
Ionic developers can access this by importing from `@ionic/angular`.
|
|
113
|
+
Ionic developers can access this by importing from `@ionic/angular/lazy`.
|
|
114
|
+
|
|
115
|
+
> [!CAUTION]
|
|
116
|
+
> The lazy loaded build, including `IonicModule`, is deprecated and will be removed in a future major version. New code should use the standalone components and `provideIonicAngular()` imported from `@ionic/angular`.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/common/directives/control-value-accessors/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC","sourcesContent":["export * from './value-accessor';\n"]}
|
|
@@ -31,6 +31,6 @@ export declare class ValueAccessor implements ControlValueAccessor, AfterViewIni
|
|
|
31
31
|
ngOnDestroy(): void;
|
|
32
32
|
ngAfterViewInit(): void;
|
|
33
33
|
static ɵfac: i0.ɵɵFactoryDeclaration<ValueAccessor, never>;
|
|
34
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<ValueAccessor, never, never, {}, {}, never, never,
|
|
34
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ValueAccessor, never, never, {}, {}, never, never, true, never>;
|
|
35
35
|
}
|
|
36
36
|
export declare const setIonicClasses: (element: ElementRef) => void;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { Directive, HostListener } from '@angular/core';
|
|
2
|
+
import { NgControl } from '@angular/forms';
|
|
3
|
+
import { raf } from '../../utils/util';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
// TODO(FW-2827): types
|
|
6
|
+
export class ValueAccessor {
|
|
7
|
+
injector;
|
|
8
|
+
elementRef;
|
|
9
|
+
onChange = () => {
|
|
10
|
+
/**/
|
|
11
|
+
};
|
|
12
|
+
onTouched = () => {
|
|
13
|
+
/**/
|
|
14
|
+
};
|
|
15
|
+
lastValue;
|
|
16
|
+
statusChanges;
|
|
17
|
+
constructor(injector, elementRef) {
|
|
18
|
+
this.injector = injector;
|
|
19
|
+
this.elementRef = elementRef;
|
|
20
|
+
}
|
|
21
|
+
writeValue(value) {
|
|
22
|
+
this.elementRef.nativeElement.value = this.lastValue = value;
|
|
23
|
+
setIonicClasses(this.elementRef);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Notifies the ControlValueAccessor of a change in the value of the control.
|
|
27
|
+
*
|
|
28
|
+
* This is called by each of the ValueAccessor directives when we want to update
|
|
29
|
+
* the status and validity of the form control. For example with text components this
|
|
30
|
+
* is called when the ionInput event is fired. For select components this is called
|
|
31
|
+
* when the ionChange event is fired.
|
|
32
|
+
*
|
|
33
|
+
* This also updates the Ionic form status classes on the element.
|
|
34
|
+
*
|
|
35
|
+
* @param el The component element.
|
|
36
|
+
* @param value The new value of the control.
|
|
37
|
+
*/
|
|
38
|
+
handleValueChange(el, value) {
|
|
39
|
+
if (el === this.elementRef.nativeElement) {
|
|
40
|
+
if (value !== this.lastValue) {
|
|
41
|
+
this.lastValue = value;
|
|
42
|
+
this.onChange(value);
|
|
43
|
+
}
|
|
44
|
+
setIonicClasses(this.elementRef);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
_handleBlurEvent(el) {
|
|
48
|
+
if (el === this.elementRef.nativeElement) {
|
|
49
|
+
this.onTouched();
|
|
50
|
+
setIonicClasses(this.elementRef);
|
|
51
|
+
// When ion-radio is blurred, el and this.elementRef.nativeElement are
|
|
52
|
+
// different so we need to check if the closest ion-radio-group is the same
|
|
53
|
+
// as this.elementRef.nativeElement and if so, we need to mark the radio group
|
|
54
|
+
// as touched
|
|
55
|
+
}
|
|
56
|
+
else if (el.closest('ion-radio-group') === this.elementRef.nativeElement) {
|
|
57
|
+
this.onTouched();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
registerOnChange(fn) {
|
|
61
|
+
this.onChange = fn;
|
|
62
|
+
}
|
|
63
|
+
registerOnTouched(fn) {
|
|
64
|
+
this.onTouched = fn;
|
|
65
|
+
}
|
|
66
|
+
setDisabledState(isDisabled) {
|
|
67
|
+
this.elementRef.nativeElement.disabled = isDisabled;
|
|
68
|
+
}
|
|
69
|
+
ngOnDestroy() {
|
|
70
|
+
if (this.statusChanges) {
|
|
71
|
+
this.statusChanges.unsubscribe();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
ngAfterViewInit() {
|
|
75
|
+
let ngControl;
|
|
76
|
+
try {
|
|
77
|
+
ngControl = this.injector.get(NgControl);
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
/* No FormControl or ngModel binding */
|
|
81
|
+
}
|
|
82
|
+
if (!ngControl) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
// Listen for changes in validity, disabled, or pending states
|
|
86
|
+
if (ngControl.statusChanges) {
|
|
87
|
+
this.statusChanges = ngControl.statusChanges.subscribe(() => setIonicClasses(this.elementRef));
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* TODO FW-2787: Remove this in favor of https://github.com/angular/angular/issues/10887
|
|
91
|
+
* whenever it is implemented.
|
|
92
|
+
*/
|
|
93
|
+
const formControl = ngControl.control;
|
|
94
|
+
if (formControl) {
|
|
95
|
+
const methodsToPatch = ['markAsTouched', 'markAllAsTouched', 'markAsUntouched', 'markAsDirty', 'markAsPristine'];
|
|
96
|
+
methodsToPatch.forEach((method) => {
|
|
97
|
+
if (typeof formControl[method] !== 'undefined') {
|
|
98
|
+
const oldFn = formControl[method].bind(formControl);
|
|
99
|
+
formControl[method] = (...params) => {
|
|
100
|
+
oldFn(...params);
|
|
101
|
+
setIonicClasses(this.elementRef);
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: ValueAccessor, deps: [{ token: i0.Injector }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
108
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.0", type: ValueAccessor, isStandalone: true, host: { listeners: { "ionBlur": "_handleBlurEvent($event.target)" } }, ngImport: i0 });
|
|
109
|
+
}
|
|
110
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: ValueAccessor, decorators: [{
|
|
111
|
+
type: Directive
|
|
112
|
+
}], ctorParameters: () => [{ type: i0.Injector }, { type: i0.ElementRef }], propDecorators: { _handleBlurEvent: [{
|
|
113
|
+
type: HostListener,
|
|
114
|
+
args: ['ionBlur', ['$event.target']]
|
|
115
|
+
}] } });
|
|
116
|
+
export const setIonicClasses = (element) => {
|
|
117
|
+
raf(() => {
|
|
118
|
+
const input = element.nativeElement;
|
|
119
|
+
const hasValue = input.value != null && input.value.toString().length > 0;
|
|
120
|
+
const classes = getClasses(input);
|
|
121
|
+
setClasses(input, classes);
|
|
122
|
+
const item = input.closest('ion-item');
|
|
123
|
+
if (item) {
|
|
124
|
+
if (hasValue) {
|
|
125
|
+
setClasses(item, [...classes, 'item-has-value']);
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
setClasses(item, classes);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
const getClasses = (element) => {
|
|
134
|
+
const classList = element.classList;
|
|
135
|
+
const classes = [];
|
|
136
|
+
for (let i = 0; i < classList.length; i++) {
|
|
137
|
+
const item = classList.item(i);
|
|
138
|
+
if (item !== null && startsWith(item, 'ng-')) {
|
|
139
|
+
classes.push(`ion-${item.substring(3)}`);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return classes;
|
|
143
|
+
};
|
|
144
|
+
const setClasses = (element, classes) => {
|
|
145
|
+
const classList = element.classList;
|
|
146
|
+
classList.remove('ion-valid', 'ion-invalid', 'ion-touched', 'ion-untouched', 'ion-dirty', 'ion-pristine');
|
|
147
|
+
classList.add(...classes);
|
|
148
|
+
};
|
|
149
|
+
const startsWith = (input, search) => {
|
|
150
|
+
return input.substring(0, search.length) === search;
|
|
151
|
+
};
|
|
152
|
+
//# sourceMappingURL=value-accessor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value-accessor.js","sourceRoot":"","sources":["../../../../src/common/directives/control-value-accessors/value-accessor.ts"],"names":[],"mappings":"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","sourcesContent":["import { AfterViewInit, ElementRef, Injector, OnDestroy, Directive, HostListener } from '@angular/core';\nimport { ControlValueAccessor, NgControl } from '@angular/forms';\nimport { Subscription } from 'rxjs';\n\nimport { raf } from '../../utils/util';\n\n// TODO(FW-2827): types\n\n@Directive()\nexport class ValueAccessor implements ControlValueAccessor, AfterViewInit, OnDestroy {\n private onChange: (value: any) => void = () => {\n /**/\n };\n private onTouched: () => void = () => {\n /**/\n };\n protected lastValue: any;\n private statusChanges?: Subscription;\n\n constructor(protected injector: Injector, protected elementRef: ElementRef) {}\n\n writeValue(value: any): void {\n this.elementRef.nativeElement.value = this.lastValue = value;\n setIonicClasses(this.elementRef);\n }\n\n /**\n * Notifies the ControlValueAccessor of a change in the value of the control.\n *\n * This is called by each of the ValueAccessor directives when we want to update\n * the status and validity of the form control. For example with text components this\n * is called when the ionInput event is fired. For select components this is called\n * when the ionChange event is fired.\n *\n * This also updates the Ionic form status classes on the element.\n *\n * @param el The component element.\n * @param value The new value of the control.\n */\n handleValueChange(el: HTMLElement, value: any): void {\n if (el === this.elementRef.nativeElement) {\n if (value !== this.lastValue) {\n this.lastValue = value;\n this.onChange(value);\n }\n setIonicClasses(this.elementRef);\n }\n }\n\n @HostListener('ionBlur', ['$event.target'])\n _handleBlurEvent(el: any): void {\n if (el === this.elementRef.nativeElement) {\n this.onTouched();\n setIonicClasses(this.elementRef);\n\n // When ion-radio is blurred, el and this.elementRef.nativeElement are\n // different so we need to check if the closest ion-radio-group is the same\n // as this.elementRef.nativeElement and if so, we need to mark the radio group\n // as touched\n } else if (el.closest('ion-radio-group') === this.elementRef.nativeElement) {\n this.onTouched();\n }\n }\n\n registerOnChange(fn: (value: any) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.elementRef.nativeElement.disabled = isDisabled;\n }\n\n ngOnDestroy(): void {\n if (this.statusChanges) {\n this.statusChanges.unsubscribe();\n }\n }\n\n ngAfterViewInit(): void {\n let ngControl;\n try {\n ngControl = this.injector.get<NgControl>(NgControl);\n } catch {\n /* No FormControl or ngModel binding */\n }\n\n if (!ngControl) {\n return;\n }\n\n // Listen for changes in validity, disabled, or pending states\n if (ngControl.statusChanges) {\n this.statusChanges = ngControl.statusChanges.subscribe(() => setIonicClasses(this.elementRef));\n }\n\n /**\n * TODO FW-2787: Remove this in favor of https://github.com/angular/angular/issues/10887\n * whenever it is implemented.\n */\n const formControl = ngControl.control as any;\n if (formControl) {\n const methodsToPatch = ['markAsTouched', 'markAllAsTouched', 'markAsUntouched', 'markAsDirty', 'markAsPristine'];\n methodsToPatch.forEach((method) => {\n if (typeof formControl[method] !== 'undefined') {\n const oldFn = formControl[method].bind(formControl);\n formControl[method] = (...params: any[]) => {\n oldFn(...params);\n setIonicClasses(this.elementRef);\n };\n }\n });\n }\n }\n}\n\nexport const setIonicClasses = (element: ElementRef): void => {\n raf(() => {\n const input = element.nativeElement as HTMLInputElement;\n const hasValue = input.value != null && input.value.toString().length > 0;\n const classes = getClasses(input);\n setClasses(input, classes);\n const item = input.closest('ion-item');\n if (item) {\n if (hasValue) {\n setClasses(item, [...classes, 'item-has-value']);\n } else {\n setClasses(item, classes);\n }\n }\n });\n};\n\nconst getClasses = (element: HTMLElement) => {\n const classList = element.classList;\n const classes: string[] = [];\n for (let i = 0; i < classList.length; i++) {\n const item = classList.item(i);\n if (item !== null && startsWith(item, 'ng-')) {\n classes.push(`ion-${item.substring(3)}`);\n }\n }\n return classes;\n};\n\nconst setClasses = (element: HTMLElement, classes: string[]) => {\n const classList = element.classList;\n classList.remove('ion-valid', 'ion-invalid', 'ion-touched', 'ion-untouched', 'ion-dirty', 'ion-pristine');\n classList.add(...classes);\n};\n\nconst startsWith = (input: string, search: string): boolean => {\n return input.substring(0, search.length) === search;\n};\n"]}
|
|
@@ -19,5 +19,5 @@ export declare class IonBackButton {
|
|
|
19
19
|
*/
|
|
20
20
|
onClick(ev: Event): void;
|
|
21
21
|
static ɵfac: i0.ɵɵFactoryDeclaration<IonBackButton, [{ optional: true; }, null, null, null, null, null]>;
|
|
22
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<IonBackButton, never, never, { "color": { "alias": "color"; "required": false; }; "defaultHref": { "alias": "defaultHref"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "routerAnimation": { "alias": "routerAnimation"; "required": false; }; "text": { "alias": "text"; "required": false; }; "type": { "alias": "type"; "required": false; }; }, {}, never, never,
|
|
22
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<IonBackButton, never, never, { "color": { "alias": "color"; "required": false; }; "defaultHref": { "alias": "defaultHref"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "routerAnimation": { "alias": "routerAnimation"; "required": false; }; "text": { "alias": "text"; "required": false; }; "type": { "alias": "type"; "required": false; }; }, {}, never, never, true, never>;
|
|
23
23
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { HostListener, Optional, Directive } from '@angular/core';
|
|
3
|
+
import { ProxyCmp } from '../../utils/proxy';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import * as i1 from "./router-outlet";
|
|
6
|
+
import * as i2 from "../../providers/nav-controller";
|
|
7
|
+
import * as i3 from "../../providers/config";
|
|
8
|
+
const BACK_BUTTON_INPUTS = ['color', 'defaultHref', 'disabled', 'icon', 'mode', 'routerAnimation', 'text', 'type'];
|
|
9
|
+
let IonBackButton = class IonBackButton {
|
|
10
|
+
routerOutlet;
|
|
11
|
+
navCtrl;
|
|
12
|
+
config;
|
|
13
|
+
r;
|
|
14
|
+
z;
|
|
15
|
+
el;
|
|
16
|
+
constructor(routerOutlet, navCtrl, config, r, z, c) {
|
|
17
|
+
this.routerOutlet = routerOutlet;
|
|
18
|
+
this.navCtrl = navCtrl;
|
|
19
|
+
this.config = config;
|
|
20
|
+
this.r = r;
|
|
21
|
+
this.z = z;
|
|
22
|
+
c.detach();
|
|
23
|
+
this.el = this.r.nativeElement;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
onClick(ev) {
|
|
29
|
+
const defaultHref = this.defaultHref || this.config.get('backButtonDefaultHref');
|
|
30
|
+
if (this.routerOutlet?.canGoBack()) {
|
|
31
|
+
this.navCtrl.setDirection('back', undefined, undefined, this.routerAnimation);
|
|
32
|
+
this.routerOutlet.pop();
|
|
33
|
+
ev.preventDefault();
|
|
34
|
+
}
|
|
35
|
+
else if (defaultHref != null) {
|
|
36
|
+
this.navCtrl.navigateBack(defaultHref, { animation: this.routerAnimation });
|
|
37
|
+
ev.preventDefault();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: IonBackButton, deps: [{ token: i1.IonRouterOutlet, optional: true }, { token: i2.NavController }, { token: i3.Config }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
41
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.0", type: IonBackButton, isStandalone: true, inputs: { color: "color", defaultHref: "defaultHref", disabled: "disabled", icon: "icon", mode: "mode", routerAnimation: "routerAnimation", text: "text", type: "type" }, host: { listeners: { "click": "onClick($event)" } }, ngImport: i0 });
|
|
42
|
+
};
|
|
43
|
+
IonBackButton = __decorate([
|
|
44
|
+
ProxyCmp({
|
|
45
|
+
inputs: BACK_BUTTON_INPUTS,
|
|
46
|
+
})
|
|
47
|
+
], IonBackButton);
|
|
48
|
+
export { IonBackButton };
|
|
49
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: IonBackButton, decorators: [{
|
|
50
|
+
type: Directive,
|
|
51
|
+
args: [{
|
|
52
|
+
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
|
|
53
|
+
inputs: BACK_BUTTON_INPUTS,
|
|
54
|
+
}]
|
|
55
|
+
}], ctorParameters: () => [{ type: i1.IonRouterOutlet, decorators: [{
|
|
56
|
+
type: Optional
|
|
57
|
+
}] }, { type: i2.NavController }, { type: i3.Config }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }], propDecorators: { onClick: [{
|
|
58
|
+
type: HostListener,
|
|
59
|
+
args: ['click', ['$event']]
|
|
60
|
+
}] } });
|
|
61
|
+
//# sourceMappingURL=back-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"back-button.js","sourceRoot":"","sources":["../../../../src/common/directives/navigation/back-button.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAyC,SAAS,EAAE,MAAM,eAAe,CAAC;AAKzG,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;;;;;AAI7C,MAAM,kBAAkB,GAAG,CAAC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAY5G,IAAM,aAAa,GAAnB,MAAM,aAAa;IAIF;IACZ;IACA;IACA;IACE;IAPF,EAAE,CAAc;IAE1B,YACsB,YAA6B,EACzC,OAAsB,EACtB,MAAc,EACd,CAAa,EACX,CAAS,EACnB,CAAoB;QALA,iBAAY,GAAZ,YAAY,CAAiB;QACzC,YAAO,GAAP,OAAO,CAAe;QACtB,WAAM,GAAN,MAAM,CAAQ;QACd,MAAC,GAAD,CAAC,CAAY;QACX,MAAC,GAAD,CAAC,CAAQ;QAGnB,CAAC,CAAC,MAAM,EAAE,CAAC;QACX,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC;IACjC,CAAC;IAED;;OAEG;IAEH,OAAO,CAAC,EAAS;QACf,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;QAEjF,IAAI,IAAI,CAAC,YAAY,EAAE,SAAS,EAAE,EAAE,CAAC;YACnC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;YAC9E,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC;YACxB,EAAE,CAAC,cAAc,EAAE,CAAC;QACtB,CAAC;aAAM,IAAI,WAAW,IAAI,IAAI,EAAE,CAAC;YAC/B,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC;YAC5E,EAAE,CAAC,cAAc,EAAE,CAAC;QACtB,CAAC;IACH,CAAC;0HA9BU,aAAa;8GAAb,aAAa;;AAAb,aAAa;IAPzB,QAAQ,CAAC;QACR,MAAM,EAAE,kBAAkB;KAC3B,CAAC;GAKW,aAAa,CA+BzB;;2FA/BY,aAAa;kBAJzB,SAAS;mBAAC;oBACT,uEAAuE;oBACvE,MAAM,EAAE,kBAAkB;iBAC3B;;0BAKI,QAAQ;;sBAcV,YAAY;uBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC","sourcesContent":["import { HostListener, Optional, ElementRef, NgZone, ChangeDetectorRef, Directive } from '@angular/core';\nimport type { Components } from '@ionic/core';\n\nimport { Config } from '../../providers/config';\nimport { NavController } from '../../providers/nav-controller';\nimport { ProxyCmp } from '../../utils/proxy';\n\nimport { IonRouterOutlet } from './router-outlet';\n\nconst BACK_BUTTON_INPUTS = ['color', 'defaultHref', 'disabled', 'icon', 'mode', 'routerAnimation', 'text', 'type'];\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport declare interface IonBackButton extends Components.IonBackButton {}\n\n@ProxyCmp({\n inputs: BACK_BUTTON_INPUTS,\n})\n@Directive({\n // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property\n inputs: BACK_BUTTON_INPUTS,\n})\nexport class IonBackButton {\n protected el: HTMLElement;\n\n constructor(\n @Optional() private routerOutlet: IonRouterOutlet,\n private navCtrl: NavController,\n private config: Config,\n private r: ElementRef,\n protected z: NgZone,\n c: ChangeDetectorRef\n ) {\n c.detach();\n this.el = this.r.nativeElement;\n }\n\n /**\n * @internal\n */\n @HostListener('click', ['$event'])\n onClick(ev: Event): void {\n const defaultHref = this.defaultHref || this.config.get('backButtonDefaultHref');\n\n if (this.routerOutlet?.canGoBack()) {\n this.navCtrl.setDirection('back', undefined, undefined, this.routerAnimation);\n this.routerOutlet.pop();\n ev.preventDefault();\n } else if (defaultHref != null) {\n this.navCtrl.navigateBack(defaultHref, { animation: this.routerAnimation });\n ev.preventDefault();\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description
|
|
3
|
+
* NavParams are an object that exists on a page and can contain data for that particular view.
|
|
4
|
+
* Similar to how data was pass to a view in V1 with `$stateParams`, NavParams offer a much more flexible
|
|
5
|
+
* option with a simple `get` method.
|
|
6
|
+
*
|
|
7
|
+
* @usage
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { NavParams } from '@ionic/angular';
|
|
10
|
+
*
|
|
11
|
+
* export class MyClass{
|
|
12
|
+
*
|
|
13
|
+
* constructor(navParams: NavParams){
|
|
14
|
+
* // userParams is an object we have in our nav-parameters
|
|
15
|
+
* navParams.get('userParams');
|
|
16
|
+
* }
|
|
17
|
+
*
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export class NavParams {
|
|
22
|
+
data;
|
|
23
|
+
constructor(data = {}) {
|
|
24
|
+
this.data = data;
|
|
25
|
+
console.warn(`[Ionic Warning]: NavParams has been deprecated in favor of using Angular's input API. Developers should migrate to either the @Input decorator or the Signals-based input API.`);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get the value of a nav-parameter for the current view
|
|
29
|
+
*
|
|
30
|
+
* ```ts
|
|
31
|
+
* import { NavParams } from 'ionic-angular';
|
|
32
|
+
*
|
|
33
|
+
* export class MyClass{
|
|
34
|
+
* constructor(public navParams: NavParams){
|
|
35
|
+
* // userParams is an object we have in our nav-parameters
|
|
36
|
+
* this.navParams.get('userParams');
|
|
37
|
+
* }
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @param param Which param you want to look up
|
|
42
|
+
*/
|
|
43
|
+
get(param) {
|
|
44
|
+
return this.data[param];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=nav-params.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav-params.js","sourceRoot":"","sources":["../../../../src/common/directives/navigation/nav-params.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,SAAS;IACD;IAAnB,YAAmB,OAA+B,EAAE;QAAjC,SAAI,GAAJ,IAAI,CAA6B;QAClD,OAAO,CAAC,IAAI,CACV,gLAAgL,CACjL,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,GAAG,CAAU,KAAa;QACxB,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;CACF","sourcesContent":["/**\n * @description\n * NavParams are an object that exists on a page and can contain data for that particular view.\n * Similar to how data was pass to a view in V1 with `$stateParams`, NavParams offer a much more flexible\n * option with a simple `get` method.\n *\n * @usage\n * ```ts\n * import { NavParams } from '@ionic/angular';\n *\n * export class MyClass{\n *\n * constructor(navParams: NavParams){\n * // userParams is an object we have in our nav-parameters\n * navParams.get('userParams');\n * }\n *\n * }\n * ```\n */\nexport class NavParams {\n constructor(public data: { [key: string]: any } = {}) {\n console.warn(\n `[Ionic Warning]: NavParams has been deprecated in favor of using Angular's input API. Developers should migrate to either the @Input decorator or the Signals-based input API.`\n );\n }\n\n /**\n * Get the value of a nav-parameter for the current view\n *\n * ```ts\n * import { NavParams } from 'ionic-angular';\n *\n * export class MyClass{\n * constructor(public navParams: NavParams){\n * // userParams is an object we have in our nav-parameters\n * this.navParams.get('userParams');\n * }\n * }\n * ```\n *\n * @param param Which param you want to look up\n */\n get<T = any>(param: string): T {\n return this.data[param];\n }\n}\n"]}
|
|
@@ -17,5 +17,5 @@ export declare class IonNav {
|
|
|
17
17
|
protected el: HTMLElement;
|
|
18
18
|
constructor(ref: ElementRef, environmentInjector: EnvironmentInjector, injector: Injector, angularDelegate: AngularDelegate, z: NgZone, c: ChangeDetectorRef);
|
|
19
19
|
static ɵfac: i0.ɵɵFactoryDeclaration<IonNav, never>;
|
|
20
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<IonNav, never, never, { "animated": { "alias": "animated"; "required": false; }; "animation": { "alias": "animation"; "required": false; }; "root": { "alias": "root"; "required": false; }; "rootParams": { "alias": "rootParams"; "required": false; }; "swipeGesture": { "alias": "swipeGesture"; "required": false; }; }, {}, never, never,
|
|
20
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<IonNav, never, never, { "animated": { "alias": "animated"; "required": false; }; "animation": { "alias": "animation"; "required": false; }; "root": { "alias": "root"; "required": false; }; "rootParams": { "alias": "rootParams"; "required": false; }; "swipeGesture": { "alias": "swipeGesture"; "required": false; }; }, {}, never, never, true, never>;
|
|
21
21
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { Directive, } from '@angular/core';
|
|
3
|
+
import { ProxyCmp, proxyOutputs } from '../../utils/proxy';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import * as i1 from "../../providers/angular-delegate";
|
|
6
|
+
const NAV_INPUTS = ['animated', 'animation', 'root', 'rootParams', 'swipeGesture'];
|
|
7
|
+
const NAV_METHODS = [
|
|
8
|
+
'push',
|
|
9
|
+
'insert',
|
|
10
|
+
'insertPages',
|
|
11
|
+
'pop',
|
|
12
|
+
'popTo',
|
|
13
|
+
'popToRoot',
|
|
14
|
+
'removeIndex',
|
|
15
|
+
'setRoot',
|
|
16
|
+
'setPages',
|
|
17
|
+
'getActive',
|
|
18
|
+
'getByIndex',
|
|
19
|
+
'canGoBack',
|
|
20
|
+
'getPrevious',
|
|
21
|
+
];
|
|
22
|
+
let IonNav = class IonNav {
|
|
23
|
+
z;
|
|
24
|
+
el;
|
|
25
|
+
constructor(ref, environmentInjector, injector, angularDelegate, z, c) {
|
|
26
|
+
this.z = z;
|
|
27
|
+
c.detach();
|
|
28
|
+
this.el = ref.nativeElement;
|
|
29
|
+
ref.nativeElement.delegate = angularDelegate.create(environmentInjector, injector);
|
|
30
|
+
proxyOutputs(this, this.el, ['ionNavDidChange', 'ionNavWillChange']);
|
|
31
|
+
}
|
|
32
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: IonNav, deps: [{ token: i0.ElementRef }, { token: i0.EnvironmentInjector }, { token: i0.Injector }, { token: i1.AngularDelegate }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
33
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.0", type: IonNav, isStandalone: true, inputs: { animated: "animated", animation: "animation", root: "root", rootParams: "rootParams", swipeGesture: "swipeGesture" }, ngImport: i0 });
|
|
34
|
+
};
|
|
35
|
+
IonNav = __decorate([
|
|
36
|
+
ProxyCmp({
|
|
37
|
+
inputs: NAV_INPUTS,
|
|
38
|
+
methods: NAV_METHODS,
|
|
39
|
+
})
|
|
40
|
+
], IonNav);
|
|
41
|
+
export { IonNav };
|
|
42
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: IonNav, decorators: [{
|
|
43
|
+
type: Directive,
|
|
44
|
+
args: [{
|
|
45
|
+
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
|
|
46
|
+
inputs: NAV_INPUTS,
|
|
47
|
+
}]
|
|
48
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.EnvironmentInjector }, { type: i0.Injector }, { type: i1.AngularDelegate }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }] });
|
|
49
|
+
//# sourceMappingURL=nav.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav.js","sourceRoot":"","sources":["../../../../src/common/directives/navigation/nav.ts"],"names":[],"mappings":";AAAA,OAAO,EAML,SAAS,GAEV,MAAM,eAAe,CAAC;AAIvB,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;;;AAE3D,MAAM,UAAU,GAAG,CAAC,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,CAAC,CAAC;AAEnF,MAAM,WAAW,GAAG;IAClB,MAAM;IACN,QAAQ;IACR,aAAa;IACb,KAAK;IACL,OAAO;IACP,WAAW;IACX,aAAa;IACb,SAAS;IACT,UAAU;IACV,WAAW;IACX,YAAY;IACZ,WAAW;IACX,aAAa;CACd,CAAC;AAqBK,IAAM,MAAM,GAAZ,MAAM,MAAM;IAOL;IANF,EAAE,CAAc;IAC1B,YACE,GAAe,EACf,mBAAwC,EACxC,QAAkB,EAClB,eAAgC,EACtB,CAAS,EACnB,CAAoB;QADV,MAAC,GAAD,CAAC,CAAQ;QAGnB,CAAC,CAAC,MAAM,EAAE,CAAC;QACX,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC,aAAa,CAAC;QAC5B,GAAG,CAAC,aAAa,CAAC,QAAQ,GAAG,eAAe,CAAC,MAAM,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC;QACnF,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAAC,CAAC;IACvE,CAAC;0HAdU,MAAM;8GAAN,MAAM;;AAAN,MAAM;IARlB,QAAQ,CAAC;QACR,MAAM,EAAE,UAAU;QAClB,OAAO,EAAE,WAAW;KACrB,CAAC;GAKW,MAAM,CAelB;;2FAfY,MAAM;kBAJlB,SAAS;mBAAC;oBACT,uEAAuE;oBACvE,MAAM,EAAE,UAAU;iBACnB","sourcesContent":["import {\n ElementRef,\n Injector,\n EnvironmentInjector,\n NgZone,\n ChangeDetectorRef,\n Directive,\n EventEmitter,\n} from '@angular/core';\nimport type { Components } from '@ionic/core';\n\nimport { AngularDelegate } from '../../providers/angular-delegate';\nimport { ProxyCmp, proxyOutputs } from '../../utils/proxy';\n\nconst NAV_INPUTS = ['animated', 'animation', 'root', 'rootParams', 'swipeGesture'];\n\nconst NAV_METHODS = [\n 'push',\n 'insert',\n 'insertPages',\n 'pop',\n 'popTo',\n 'popToRoot',\n 'removeIndex',\n 'setRoot',\n 'setPages',\n 'getActive',\n 'getByIndex',\n 'canGoBack',\n 'getPrevious',\n];\n\nexport declare interface IonNav extends Components.IonNav {\n /**\n * Event fired when the nav will change components\n */\n ionNavWillChange: EventEmitter<CustomEvent<void>>;\n /**\n * Event fired when the nav has changed components\n */\n ionNavDidChange: EventEmitter<CustomEvent<void>>;\n}\n\n@ProxyCmp({\n inputs: NAV_INPUTS,\n methods: NAV_METHODS,\n})\n@Directive({\n // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property\n inputs: NAV_INPUTS,\n})\nexport class IonNav {\n protected el: HTMLElement;\n constructor(\n ref: ElementRef,\n environmentInjector: EnvironmentInjector,\n injector: Injector,\n angularDelegate: AngularDelegate,\n protected z: NgZone,\n c: ChangeDetectorRef\n ) {\n c.detach();\n this.el = ref.nativeElement;\n ref.nativeElement.delegate = angularDelegate.create(environmentInjector, injector);\n proxyOutputs(this, this.el, ['ionNavDidChange', 'ionNavWillChange']);\n }\n}\n"]}
|
|
@@ -47,7 +47,7 @@ export declare class RouterLinkDelegateDirective implements OnInit, OnChanges, O
|
|
|
47
47
|
*/
|
|
48
48
|
onClick(ev: UIEvent): void;
|
|
49
49
|
static ɵfac: i0.ɵɵFactoryDeclaration<RouterLinkDelegateDirective, [null, null, null, null, { optional: true; }]>;
|
|
50
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RouterLinkDelegateDirective, ":not(a):not(area)[routerLink]", never, { "routerDirection": { "alias": "routerDirection"; "required": false; }; "routerAnimation": { "alias": "routerAnimation"; "required": false; }; }, {}, never, never,
|
|
50
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RouterLinkDelegateDirective, ":not(a):not(area)[routerLink]", never, { "routerDirection": { "alias": "routerDirection"; "required": false; }; "routerAnimation": { "alias": "routerAnimation"; "required": false; }; }, {}, never, never, true, never>;
|
|
51
51
|
}
|
|
52
52
|
export declare class RouterLinkWithHrefDelegateDirective implements OnInit, OnChanges {
|
|
53
53
|
private locationStrategy;
|
|
@@ -66,5 +66,5 @@ export declare class RouterLinkWithHrefDelegateDirective implements OnInit, OnCh
|
|
|
66
66
|
*/
|
|
67
67
|
onClick(): void;
|
|
68
68
|
static ɵfac: i0.ɵɵFactoryDeclaration<RouterLinkWithHrefDelegateDirective, [null, null, null, null, { optional: true; }]>;
|
|
69
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RouterLinkWithHrefDelegateDirective, "a[routerLink],area[routerLink]", never, { "routerDirection": { "alias": "routerDirection"; "required": false; }; "routerAnimation": { "alias": "routerAnimation"; "required": false; }; }, {}, never, never,
|
|
69
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RouterLinkWithHrefDelegateDirective, "a[routerLink],area[routerLink]", never, { "routerDirection": { "alias": "routerDirection"; "required": false; }; "routerAnimation": { "alias": "routerAnimation"; "required": false; }; }, {}, never, never, true, never>;
|
|
70
70
|
}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { Directive, HostListener, Input, Optional } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import * as i1 from "@angular/common";
|
|
4
|
+
import * as i2 from "../../providers/nav-controller";
|
|
5
|
+
import * as i3 from "@angular/router";
|
|
6
|
+
/**
|
|
7
|
+
* Adds support for Ionic routing directions and animations to the base Angular router link directive.
|
|
8
|
+
*
|
|
9
|
+
* When the router link is clicked, the directive will assign the direction and
|
|
10
|
+
* animation so that the routing integration will transition correctly.
|
|
11
|
+
*/
|
|
12
|
+
export class RouterLinkDelegateDirective {
|
|
13
|
+
locationStrategy;
|
|
14
|
+
navCtrl;
|
|
15
|
+
elementRef;
|
|
16
|
+
router;
|
|
17
|
+
routerLink;
|
|
18
|
+
routerDirection = 'forward';
|
|
19
|
+
routerAnimation;
|
|
20
|
+
constructor(locationStrategy, navCtrl, elementRef, router, routerLink) {
|
|
21
|
+
this.locationStrategy = locationStrategy;
|
|
22
|
+
this.navCtrl = navCtrl;
|
|
23
|
+
this.elementRef = elementRef;
|
|
24
|
+
this.router = router;
|
|
25
|
+
this.routerLink = routerLink;
|
|
26
|
+
}
|
|
27
|
+
ngOnInit() {
|
|
28
|
+
this.updateTargetUrlAndHref();
|
|
29
|
+
this.updateTabindex();
|
|
30
|
+
/**
|
|
31
|
+
* Ionic components like `ion-item` render a native anchor in their shadow DOM,
|
|
32
|
+
* so a modifier click (ctrl/meta/shift/alt) or a non-`_self` target should let
|
|
33
|
+
* the browser handle the navigation natively (new tab, new window, download)
|
|
34
|
+
* instead of navigating in-app.
|
|
35
|
+
*
|
|
36
|
+
* We listen in the capture phase so this runs before Angular's `RouterLink`
|
|
37
|
+
* handler and our own bubble-phase `onClick`. On a native-navigation intent it
|
|
38
|
+
* stops propagation to cancel the in-app navigation, but leaves `preventDefault`
|
|
39
|
+
* alone so the native anchor can still act.
|
|
40
|
+
*/
|
|
41
|
+
this.elementRef.nativeElement.addEventListener('click', this.onCaptureClick, { capture: true });
|
|
42
|
+
}
|
|
43
|
+
ngOnChanges() {
|
|
44
|
+
this.updateTargetUrlAndHref();
|
|
45
|
+
}
|
|
46
|
+
ngOnDestroy() {
|
|
47
|
+
this.elementRef.nativeElement.removeEventListener('click', this.onCaptureClick, { capture: true });
|
|
48
|
+
}
|
|
49
|
+
onCaptureClick = (ev) => {
|
|
50
|
+
if (this.opensNatively(ev)) {
|
|
51
|
+
ev.stopImmediatePropagation();
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* True when the browser should handle the click natively instead of routing
|
|
56
|
+
* in-app: a modifier was held (ctrl/meta/shift/alt), or the host targets
|
|
57
|
+
* something other than `_self`. This mirrors the modifier set Angular's own
|
|
58
|
+
* `RouterLink` guards on, so an Ionic `routerLink` behaves like a plain anchor
|
|
59
|
+
* for new-tab, new-window, and download intents.
|
|
60
|
+
*/
|
|
61
|
+
opensNatively(ev) {
|
|
62
|
+
if (ev instanceof MouseEvent && (ev.ctrlKey || ev.metaKey || ev.shiftKey || ev.altKey)) {
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
const target = this.elementRef.nativeElement.target;
|
|
66
|
+
return target != null && target !== '' && target !== '_self';
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The `tabindex` is set to `0` by default on the host element when
|
|
70
|
+
* the `routerLink` directive is used. This causes issues with Ionic
|
|
71
|
+
* components that wrap an `a` or `button` element, such as `ion-item`.
|
|
72
|
+
* See issue https://github.com/angular/angular/issues/28345
|
|
73
|
+
*
|
|
74
|
+
* This method removes the `tabindex` attribute from the host element
|
|
75
|
+
* to allow the Ionic component to manage the focus state correctly.
|
|
76
|
+
*/
|
|
77
|
+
updateTabindex() {
|
|
78
|
+
// Ionic components that render a native anchor or button element
|
|
79
|
+
const ionicComponents = [
|
|
80
|
+
'ION-BACK-BUTTON',
|
|
81
|
+
'ION-BREADCRUMB',
|
|
82
|
+
'ION-BUTTON',
|
|
83
|
+
'ION-CARD',
|
|
84
|
+
'ION-FAB-BUTTON',
|
|
85
|
+
'ION-ITEM',
|
|
86
|
+
'ION-ITEM-OPTION',
|
|
87
|
+
'ION-MENU-BUTTON',
|
|
88
|
+
'ION-SEGMENT-BUTTON',
|
|
89
|
+
'ION-TAB-BUTTON',
|
|
90
|
+
];
|
|
91
|
+
const hostElement = this.elementRef.nativeElement;
|
|
92
|
+
if (ionicComponents.includes(hostElement.tagName)) {
|
|
93
|
+
if (hostElement.getAttribute('tabindex') === '0') {
|
|
94
|
+
hostElement.removeAttribute('tabindex');
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
updateTargetUrlAndHref() {
|
|
99
|
+
if (this.routerLink?.urlTree) {
|
|
100
|
+
const href = this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.routerLink.urlTree));
|
|
101
|
+
this.elementRef.nativeElement.href = href;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* @internal
|
|
106
|
+
*/
|
|
107
|
+
onClick(ev) {
|
|
108
|
+
this.navCtrl.setDirection(this.routerDirection, undefined, undefined, this.routerAnimation);
|
|
109
|
+
/**
|
|
110
|
+
* This prevents the browser from
|
|
111
|
+
* performing a page reload when pressing
|
|
112
|
+
* an Ionic component with routerLink.
|
|
113
|
+
* The page reload interferes with routing
|
|
114
|
+
* and causes ion-back-button to disappear
|
|
115
|
+
* since the local history is wiped on reload.
|
|
116
|
+
*/
|
|
117
|
+
ev.preventDefault();
|
|
118
|
+
}
|
|
119
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: RouterLinkDelegateDirective, deps: [{ token: i1.LocationStrategy }, { token: i2.NavController }, { token: i0.ElementRef }, { token: i3.Router }, { token: i3.RouterLink, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
120
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.0", type: RouterLinkDelegateDirective, isStandalone: true, selector: ":not(a):not(area)[routerLink]", inputs: { routerDirection: "routerDirection", routerAnimation: "routerAnimation" }, host: { listeners: { "click": "onClick($event)" } }, usesOnChanges: true, ngImport: i0 });
|
|
121
|
+
}
|
|
122
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: RouterLinkDelegateDirective, decorators: [{
|
|
123
|
+
type: Directive,
|
|
124
|
+
args: [{
|
|
125
|
+
selector: ':not(a):not(area)[routerLink]',
|
|
126
|
+
}]
|
|
127
|
+
}], ctorParameters: () => [{ type: i1.LocationStrategy }, { type: i2.NavController }, { type: i0.ElementRef }, { type: i3.Router }, { type: i3.RouterLink, decorators: [{
|
|
128
|
+
type: Optional
|
|
129
|
+
}] }], propDecorators: { routerDirection: [{
|
|
130
|
+
type: Input
|
|
131
|
+
}], routerAnimation: [{
|
|
132
|
+
type: Input
|
|
133
|
+
}], onClick: [{
|
|
134
|
+
type: HostListener,
|
|
135
|
+
args: ['click', ['$event']]
|
|
136
|
+
}] } });
|
|
137
|
+
export class RouterLinkWithHrefDelegateDirective {
|
|
138
|
+
locationStrategy;
|
|
139
|
+
navCtrl;
|
|
140
|
+
elementRef;
|
|
141
|
+
router;
|
|
142
|
+
routerLink;
|
|
143
|
+
routerDirection = 'forward';
|
|
144
|
+
routerAnimation;
|
|
145
|
+
constructor(locationStrategy, navCtrl, elementRef, router, routerLink) {
|
|
146
|
+
this.locationStrategy = locationStrategy;
|
|
147
|
+
this.navCtrl = navCtrl;
|
|
148
|
+
this.elementRef = elementRef;
|
|
149
|
+
this.router = router;
|
|
150
|
+
this.routerLink = routerLink;
|
|
151
|
+
}
|
|
152
|
+
ngOnInit() {
|
|
153
|
+
this.updateTargetUrlAndHref();
|
|
154
|
+
}
|
|
155
|
+
ngOnChanges() {
|
|
156
|
+
this.updateTargetUrlAndHref();
|
|
157
|
+
}
|
|
158
|
+
updateTargetUrlAndHref() {
|
|
159
|
+
if (this.routerLink?.urlTree) {
|
|
160
|
+
const href = this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.routerLink.urlTree));
|
|
161
|
+
this.elementRef.nativeElement.href = href;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* @internal
|
|
166
|
+
*/
|
|
167
|
+
onClick() {
|
|
168
|
+
this.navCtrl.setDirection(this.routerDirection, undefined, undefined, this.routerAnimation);
|
|
169
|
+
}
|
|
170
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: RouterLinkWithHrefDelegateDirective, deps: [{ token: i1.LocationStrategy }, { token: i2.NavController }, { token: i0.ElementRef }, { token: i3.Router }, { token: i3.RouterLink, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
171
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.0", type: RouterLinkWithHrefDelegateDirective, isStandalone: true, selector: "a[routerLink],area[routerLink]", inputs: { routerDirection: "routerDirection", routerAnimation: "routerAnimation" }, host: { listeners: { "click": "onClick()" } }, usesOnChanges: true, ngImport: i0 });
|
|
172
|
+
}
|
|
173
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: RouterLinkWithHrefDelegateDirective, decorators: [{
|
|
174
|
+
type: Directive,
|
|
175
|
+
args: [{
|
|
176
|
+
selector: 'a[routerLink],area[routerLink]',
|
|
177
|
+
}]
|
|
178
|
+
}], ctorParameters: () => [{ type: i1.LocationStrategy }, { type: i2.NavController }, { type: i0.ElementRef }, { type: i3.Router }, { type: i3.RouterLink, decorators: [{
|
|
179
|
+
type: Optional
|
|
180
|
+
}] }], propDecorators: { routerDirection: [{
|
|
181
|
+
type: Input
|
|
182
|
+
}], routerAnimation: [{
|
|
183
|
+
type: Input
|
|
184
|
+
}], onClick: [{
|
|
185
|
+
type: HostListener,
|
|
186
|
+
args: ['click']
|
|
187
|
+
}] } });
|
|
188
|
+
//# sourceMappingURL=router-link-delegate.js.map
|