mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(angular): avoid name conflict with router outlet in esbuild
This commit is contained in:
@@ -6,7 +6,7 @@ import { Config } from '../../providers/config';
|
||||
import { NavController } from '../../providers/nav-controller';
|
||||
import { ProxyCmp } from '../../utils/proxy';
|
||||
|
||||
import { IonRouterOutlet } from './router-outlet';
|
||||
import { IonRouterOutletBase } from './router-outlet';
|
||||
|
||||
const BACK_BUTTON_INPUTS = ['color', 'defaultHref', 'disabled', 'icon', 'mode', 'routerAnimation', 'text', 'type'];
|
||||
|
||||
@@ -31,7 +31,7 @@ export class IonBackButton {
|
||||
protected el: HTMLElement;
|
||||
|
||||
constructor(
|
||||
@Optional() private routerOutlet: IonRouterOutlet,
|
||||
@Optional() private routerOutlet: IonRouterOutletBase,
|
||||
private navCtrl: NavController,
|
||||
private config: Config,
|
||||
private r: ElementRef,
|
||||
|
||||
@@ -42,7 +42,7 @@ import { RouteView, StackDidChangeEvent, StackWillChangeEvent, getUrl, isTabSwit
|
||||
inputs: ['animated', 'animation', 'mode', 'swipeGesture'],
|
||||
})
|
||||
// eslint-disable-next-line @angular-eslint/directive-class-suffix
|
||||
export class IonRouterOutlet implements OnDestroy, OnInit {
|
||||
export class IonRouterOutletBase implements OnDestroy, OnInit {
|
||||
nativeEl: HTMLIonRouterOutletElement;
|
||||
activatedView: RouteView | null = null;
|
||||
tabsPrefix: string | undefined;
|
||||
@@ -116,7 +116,7 @@ export class IonRouterOutlet implements OnDestroy, OnInit {
|
||||
router: Router,
|
||||
zone: NgZone,
|
||||
activatedRoute: ActivatedRoute,
|
||||
@SkipSelf() @Optional() readonly parentOutlet?: IonRouterOutlet
|
||||
@SkipSelf() @Optional() readonly parentOutlet?: IonRouterOutletBase
|
||||
) {
|
||||
this.nativeEl = elementRef.nativeElement;
|
||||
this.name = name || PRIMARY_OUTLET;
|
||||
@@ -463,19 +463,19 @@ const INPUT_BINDER = new InjectionToken<RoutedComponentInputBinder>('');
|
||||
*/
|
||||
@Injectable()
|
||||
class RoutedComponentInputBinder {
|
||||
private outletDataSubscriptions = new Map<IonRouterOutlet, Subscription>();
|
||||
private outletDataSubscriptions = new Map<IonRouterOutletBase, Subscription>();
|
||||
|
||||
bindActivatedRouteToOutletComponent(outlet: IonRouterOutlet): void {
|
||||
bindActivatedRouteToOutletComponent(outlet: IonRouterOutletBase): void {
|
||||
this.unsubscribeFromRouteData(outlet);
|
||||
this.subscribeToRouteData(outlet);
|
||||
}
|
||||
|
||||
unsubscribeFromRouteData(outlet: IonRouterOutlet): void {
|
||||
unsubscribeFromRouteData(outlet: IonRouterOutletBase): void {
|
||||
this.outletDataSubscriptions.get(outlet)?.unsubscribe();
|
||||
this.outletDataSubscriptions.delete(outlet);
|
||||
}
|
||||
|
||||
private subscribeToRouteData(outlet: IonRouterOutlet) {
|
||||
private subscribeToRouteData(outlet: IonRouterOutletBase) {
|
||||
const { activatedRoute } = outlet;
|
||||
const dataSubscription = combineLatest([activatedRoute.queryParams, activatedRoute.params, activatedRoute.data])
|
||||
.pipe(
|
||||
|
||||
@@ -15,7 +15,7 @@ export { NavParams } from './directives/navigation/nav-params';
|
||||
export { IonPopover } from './overlays/popover';
|
||||
export { IonModal } from './overlays/modal';
|
||||
|
||||
export { IonRouterOutlet, provideComponentInputBinding } from './directives/navigation/router-outlet';
|
||||
export { IonRouterOutletBase, provideComponentInputBinding } from './directives/navigation/router-outlet';
|
||||
|
||||
export { IonBackButton } from './directives/navigation/back-button';
|
||||
export {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Injectable, Optional } from '@angular/core';
|
||||
import { NavigationExtras, Router, UrlSerializer, UrlTree, NavigationStart } from '@angular/router';
|
||||
import type { AnimationBuilder, NavDirection, RouterDirection } from '@ionic/core/components';
|
||||
|
||||
import { IonRouterOutlet } from '../directives/navigation/router-outlet';
|
||||
import { IonRouterOutletBase } from '../directives/navigation/router-outlet';
|
||||
|
||||
import { Platform } from './platform';
|
||||
|
||||
@@ -19,7 +19,7 @@ export interface NavigationOptions extends NavigationExtras, AnimationOptions {}
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class NavController {
|
||||
private topOutlet?: IonRouterOutlet;
|
||||
private topOutlet?: IonRouterOutletBase;
|
||||
private direction: 'forward' | 'back' | 'root' | 'auto' = DEFAULT_DIRECTION;
|
||||
private animated?: NavDirection = DEFAULT_ANIMATED;
|
||||
private animationBuilder?: AnimationBuilder;
|
||||
@@ -169,7 +169,7 @@ export class NavController {
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
setTopOutlet(outlet: IonRouterOutlet): void {
|
||||
setTopOutlet(outlet: IonRouterOutletBase): void {
|
||||
this.topOutlet = outlet;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Location } from '@angular/common';
|
||||
import { Directive, Attribute, Optional, SkipSelf, ElementRef, NgZone } from '@angular/core';
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
import { IonRouterOutlet as IonRouterOutletBase } from '@ionic/angular/common';
|
||||
import { IonRouterOutletBase } from '@ionic/angular/common';
|
||||
|
||||
@Directive({
|
||||
selector: 'ion-router-outlet',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Location } from '@angular/common';
|
||||
import { Directive, Attribute, Optional, SkipSelf, ElementRef, NgZone } from '@angular/core';
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
import { IonRouterOutlet as IonRouterOutletBase, ProxyCmp } from '@ionic/angular/common';
|
||||
import { IonRouterOutletBase, ProxyCmp } from '@ionic/angular/common';
|
||||
import { defineCustomElement } from '@ionic/core/components/ion-router-outlet.js';
|
||||
|
||||
@ProxyCmp({
|
||||
|
||||
Reference in New Issue
Block a user