@ionic/angular 7.6.2-dev.11705355381.14b22962 → 7.6.2-dev.11706202387.1dfcd9b8
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/common/directives/navigation/nav.d.ts +2 -2
- package/common/index.d.ts +0 -1
- package/common/providers/angular-delegate.d.ts +4 -5
- package/directives/navigation/ion-nav.d.ts +2 -2
- package/esm2020/common/directives/navigation/nav.mjs +5 -5
- package/esm2020/common/index.mjs +1 -2
- package/esm2020/common/providers/angular-delegate.mjs +28 -44
- package/esm2020/directives/navigation/ion-nav.mjs +5 -5
- package/esm2020/index.mjs +2 -2
- package/esm2020/providers/modal-controller.mjs +3 -4
- package/esm2020/providers/popover-controller.mjs +3 -4
- package/esm2020/standalone/index.mjs +2 -2
- package/esm2020/standalone/navigation/nav.mjs +5 -5
- package/esm2020/standalone/providers/modal-controller.mjs +3 -4
- package/esm2020/standalone/providers/popover-controller.mjs +3 -4
- package/fesm2015/ionic-angular-common.mjs +33 -93
- package/fesm2015/ionic-angular-common.mjs.map +1 -1
- package/fesm2015/ionic-angular-standalone.mjs +8 -10
- package/fesm2015/ionic-angular-standalone.mjs.map +1 -1
- package/fesm2015/ionic-angular.mjs +8 -10
- package/fesm2015/ionic-angular.mjs.map +1 -1
- package/fesm2020/ionic-angular-common.mjs +32 -92
- package/fesm2020/ionic-angular-common.mjs.map +1 -1
- package/fesm2020/ionic-angular-standalone.mjs +8 -10
- package/fesm2020/ionic-angular-standalone.mjs.map +1 -1
- package/fesm2020/ionic-angular.mjs +8 -10
- package/fesm2020/ionic-angular.mjs.map +1 -1
- package/index.d.ts +1 -1
- package/package.json +2 -2
- package/providers/modal-controller.d.ts +0 -1
- package/providers/popover-controller.d.ts +0 -1
- package/standalone/index.d.ts +1 -1
- package/standalone/navigation/nav.d.ts +2 -2
- package/standalone/providers/modal-controller.d.ts +0 -1
- package/standalone/providers/popover-controller.d.ts +0 -1
- package/common/directives/navigation/nav-params.d.ts +0 -45
- package/esm2020/common/directives/navigation/nav-params.mjs +0 -45
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { inject, EnvironmentInjector } from '@angular/core';
|
|
2
2
|
import { AngularDelegate, OverlayBaseController } from '@ionic/angular/common';
|
|
3
3
|
import { popoverController } from '@ionic/core/components';
|
|
4
4
|
import { defineCustomElement } from '@ionic/core/components/ion-popover.js';
|
|
@@ -6,15 +6,14 @@ export class PopoverController extends OverlayBaseController {
|
|
|
6
6
|
constructor() {
|
|
7
7
|
super(popoverController);
|
|
8
8
|
this.angularDelegate = inject(AngularDelegate);
|
|
9
|
-
this.injector = inject(Injector);
|
|
10
9
|
this.environmentInjector = inject(EnvironmentInjector);
|
|
11
10
|
defineCustomElement();
|
|
12
11
|
}
|
|
13
12
|
create(opts) {
|
|
14
13
|
return super.create({
|
|
15
14
|
...opts,
|
|
16
|
-
delegate: this.angularDelegate.create(this.environmentInjector,
|
|
15
|
+
delegate: this.angularDelegate.create(this.environmentInjector, 'popover'),
|
|
17
16
|
});
|
|
18
17
|
}
|
|
19
18
|
}
|
|
20
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
19
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicG9wb3Zlci1jb250cm9sbGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3RhbmRhbG9uZS9zcmMvcHJvdmlkZXJzL3BvcG92ZXItY29udHJvbGxlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsTUFBTSxFQUFFLG1CQUFtQixFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQzVELE9BQU8sRUFBRSxlQUFlLEVBQUUscUJBQXFCLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUUvRSxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSx3QkFBd0IsQ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BQb3BvdmVyQ29udHJvbGxlciBleHRlbmRzIE92ZXJsYXlCYXNlQ29udHJvbGxlcjxQb3BvdmVyT3B0aW9ucywgSFRNTElvblBvcG92ZXJFbGVtZW50PiB7XG4gIHByaXZhdGUgYW5ndWxhckRlbGVnYXRlID0gaW5qZWN0KEFuZ3VsYXJEZWxlZ2F0ZSk7XG4gIHByaXZhdGUgZW52aXJvbm1lbnRJbmplY3RvciA9IGluamVjdChFbnZpcm9ubWVudEluamVjdG9yKTtcblxuICBjb25zdHJ1Y3RvcigpIHtcbiAgICBzdXBlcihwb3BvdmVyQ29udHJvbGxlcik7XG4gICAgZGVmaW5lQ3VzdG9tRWxlbWVudCgpO1xuICB9XG5cbiAgY3JlYXRlKG9wdHM6IFBvcG92ZXJPcHRpb25zKTogUHJvbWlzZTxIVE1MSW9uUG9wb3ZlckVsZW1lbnQ+IHtcbiAgICByZXR1cm4gc3VwZXIuY3JlYXRlKHtcbiAgICAgIC4uLm9wdHMsXG4gICAgICBkZWxlZ2F0ZTogdGhpcy5hbmd1bGFyRGVsZWdhdGUuY3JlYXRlKHRoaXMuZW52aXJvbm1lbnRJbmplY3RvciwgJ3BvcG92ZXInKSxcbiAgICB9KTtcbiAgfVxufVxuIl19
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, Inject, Optional, InjectionToken, inject, NgZone, ApplicationRef,
|
|
3
|
-
import { __awaiter, __decorate } from 'tslib';
|
|
2
|
+
import { Injectable, Inject, Optional, InjectionToken, inject, NgZone, ApplicationRef, createComponent, TemplateRef, Directive, ContentChild, EventEmitter, ViewContainerRef, EnvironmentInjector, Attribute, SkipSelf, Input, Output, reflectComponentType, HostListener, ElementRef, ViewChild } from '@angular/core';
|
|
3
|
+
import { __awaiter, __rest, __decorate } from 'tslib';
|
|
4
4
|
import * as i3 from '@angular/router';
|
|
5
5
|
import { NavigationStart, PRIMARY_OUTLET, ChildrenOutletContexts, ActivatedRoute, Router } from '@angular/router';
|
|
6
6
|
import * as i1 from '@angular/common';
|
|
@@ -679,59 +679,14 @@ const getConfig = () => {
|
|
|
679
679
|
return null;
|
|
680
680
|
};
|
|
681
681
|
|
|
682
|
-
/**
|
|
683
|
-
* @description
|
|
684
|
-
* NavParams are an object that exists on a page and can contain data for that particular view.
|
|
685
|
-
* Similar to how data was pass to a view in V1 with `$stateParams`, NavParams offer a much more flexible
|
|
686
|
-
* option with a simple `get` method.
|
|
687
|
-
*
|
|
688
|
-
* @usage
|
|
689
|
-
* ```ts
|
|
690
|
-
* import { NavParams } from '@ionic/angular';
|
|
691
|
-
*
|
|
692
|
-
* export class MyClass{
|
|
693
|
-
*
|
|
694
|
-
* constructor(navParams: NavParams){
|
|
695
|
-
* // userParams is an object we have in our nav-parameters
|
|
696
|
-
* navParams.get('userParams');
|
|
697
|
-
* }
|
|
698
|
-
*
|
|
699
|
-
* }
|
|
700
|
-
* ```
|
|
701
|
-
*/
|
|
702
|
-
class NavParams {
|
|
703
|
-
constructor(data = {}) {
|
|
704
|
-
this.data = data;
|
|
705
|
-
}
|
|
706
|
-
/**
|
|
707
|
-
* Get the value of a nav-parameter for the current view
|
|
708
|
-
*
|
|
709
|
-
* ```ts
|
|
710
|
-
* import { NavParams } from 'ionic-angular';
|
|
711
|
-
*
|
|
712
|
-
* export class MyClass{
|
|
713
|
-
* constructor(public navParams: NavParams){
|
|
714
|
-
* // userParams is an object we have in our nav-parameters
|
|
715
|
-
* this.navParams.get('userParams');
|
|
716
|
-
* }
|
|
717
|
-
* }
|
|
718
|
-
* ```
|
|
719
|
-
*
|
|
720
|
-
* @param param Which param you want to look up
|
|
721
|
-
*/
|
|
722
|
-
get(param) {
|
|
723
|
-
return this.data[param];
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
|
|
727
682
|
// TODO(FW-2827): types
|
|
728
683
|
class AngularDelegate {
|
|
729
684
|
constructor() {
|
|
730
685
|
this.zone = inject(NgZone);
|
|
731
686
|
this.applicationRef = inject(ApplicationRef);
|
|
732
687
|
}
|
|
733
|
-
create(environmentInjector,
|
|
734
|
-
return new AngularFrameworkDelegate(environmentInjector,
|
|
688
|
+
create(environmentInjector, elementReferenceKey) {
|
|
689
|
+
return new AngularFrameworkDelegate(environmentInjector, this.applicationRef, this.zone, elementReferenceKey);
|
|
735
690
|
}
|
|
736
691
|
}
|
|
737
692
|
/** @nocollapse */ AngularDelegate.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: AngularDelegate, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -740,9 +695,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
740
695
|
type: Injectable
|
|
741
696
|
}] });
|
|
742
697
|
class AngularFrameworkDelegate {
|
|
743
|
-
constructor(environmentInjector,
|
|
698
|
+
constructor(environmentInjector, applicationRef, zone, elementReferenceKey) {
|
|
744
699
|
this.environmentInjector = environmentInjector;
|
|
745
|
-
this.injector = injector;
|
|
746
700
|
this.applicationRef = applicationRef;
|
|
747
701
|
this.zone = zone;
|
|
748
702
|
this.elementReferenceKey = elementReferenceKey;
|
|
@@ -764,7 +718,7 @@ class AngularFrameworkDelegate {
|
|
|
764
718
|
if (this.elementReferenceKey !== undefined) {
|
|
765
719
|
componentProps[this.elementReferenceKey] = container;
|
|
766
720
|
}
|
|
767
|
-
const el = attachView(this.zone, this.environmentInjector, this.
|
|
721
|
+
const el = attachView(this.zone, this.environmentInjector, this.applicationRef, this.elRefMap, this.elEventsMap, container, component, componentProps, cssClasses, this.elementReferenceKey);
|
|
768
722
|
resolve(el);
|
|
769
723
|
});
|
|
770
724
|
});
|
|
@@ -787,26 +741,9 @@ class AngularFrameworkDelegate {
|
|
|
787
741
|
});
|
|
788
742
|
}
|
|
789
743
|
}
|
|
790
|
-
const attachView = (zone, environmentInjector,
|
|
791
|
-
/**
|
|
792
|
-
* Wraps the injector with a custom injector that
|
|
793
|
-
* provides NavParams to the component.
|
|
794
|
-
*
|
|
795
|
-
* NavParams is a legacy feature from Ionic v3 that allows
|
|
796
|
-
* Angular developers to provide data to a component
|
|
797
|
-
* and access it by providing NavParams as a dependency
|
|
798
|
-
* in the constructor.
|
|
799
|
-
*
|
|
800
|
-
* The modern approach is to access the data directly
|
|
801
|
-
* from the component's class instance.
|
|
802
|
-
*/
|
|
803
|
-
const childInjector = Injector.create({
|
|
804
|
-
providers: getProviders(params),
|
|
805
|
-
parent: injector,
|
|
806
|
-
});
|
|
744
|
+
const attachView = (zone, environmentInjector, applicationRef, elRefMap, elEventsMap, container, component, params, cssClasses, elementReferenceKey) => {
|
|
807
745
|
const componentRef = createComponent(component, {
|
|
808
746
|
environmentInjector,
|
|
809
|
-
elementInjector: childInjector,
|
|
810
747
|
});
|
|
811
748
|
const instance = componentRef.instance;
|
|
812
749
|
const hostElement = componentRef.location.nativeElement;
|
|
@@ -821,7 +758,27 @@ const attachView = (zone, environmentInjector, injector, applicationRef, elRefMa
|
|
|
821
758
|
if (elementReferenceKey && instance[elementReferenceKey] !== undefined) {
|
|
822
759
|
console.error(`[Ionic Error]: ${elementReferenceKey} is a reserved property when using ${container.tagName.toLowerCase()}. Rename or remove the "${elementReferenceKey}" property from ${component.name}.`);
|
|
823
760
|
}
|
|
824
|
-
|
|
761
|
+
const { modal, popover } = params, otherParams = __rest(params, ["modal", "popover"]);
|
|
762
|
+
/**
|
|
763
|
+
* Any key/value pairs set in componentProps
|
|
764
|
+
* must be set as inputs on the component instance.
|
|
765
|
+
*/
|
|
766
|
+
for (const key in otherParams) {
|
|
767
|
+
componentRef.setInput(key, otherParams[key]);
|
|
768
|
+
}
|
|
769
|
+
/**
|
|
770
|
+
* Using setInput will cause an error when
|
|
771
|
+
* setting modal/popover on a component that
|
|
772
|
+
* does not define them as an input. For backwards
|
|
773
|
+
* compatibility purposes we fall back to using
|
|
774
|
+
* Object.assign for these properties.
|
|
775
|
+
*/
|
|
776
|
+
if (modal !== undefined) {
|
|
777
|
+
Object.assign(instance, { modal });
|
|
778
|
+
}
|
|
779
|
+
if (popover !== undefined) {
|
|
780
|
+
Object.assign(instance, { popover });
|
|
781
|
+
}
|
|
825
782
|
}
|
|
826
783
|
if (cssClasses) {
|
|
827
784
|
for (const cssClass of cssClasses) {
|
|
@@ -852,23 +809,6 @@ const bindLifecycleEvents = (zone, instance, element) => {
|
|
|
852
809
|
return () => unregisters.forEach((fn) => fn());
|
|
853
810
|
});
|
|
854
811
|
};
|
|
855
|
-
const NavParamsToken = new InjectionToken('NavParamsToken');
|
|
856
|
-
const getProviders = (params) => {
|
|
857
|
-
return [
|
|
858
|
-
{
|
|
859
|
-
provide: NavParamsToken,
|
|
860
|
-
useValue: params,
|
|
861
|
-
},
|
|
862
|
-
{
|
|
863
|
-
provide: NavParams,
|
|
864
|
-
useFactory: provideNavParamsInjectable,
|
|
865
|
-
deps: [NavParamsToken],
|
|
866
|
-
},
|
|
867
|
-
];
|
|
868
|
-
};
|
|
869
|
-
const provideNavParamsInjectable = (params) => {
|
|
870
|
-
return new NavParams(params);
|
|
871
|
-
};
|
|
872
812
|
|
|
873
813
|
// TODO: Is there a way we can grab this from angular-component-lib instead?
|
|
874
814
|
const proxyInputs = (Cmp, inputs) => {
|
|
@@ -2064,15 +2004,15 @@ const NAV_METHODS = [
|
|
|
2064
2004
|
'getPrevious',
|
|
2065
2005
|
];
|
|
2066
2006
|
let IonNav = class IonNav {
|
|
2067
|
-
constructor(ref, environmentInjector,
|
|
2007
|
+
constructor(ref, environmentInjector, angularDelegate, z, c) {
|
|
2068
2008
|
this.z = z;
|
|
2069
2009
|
c.detach();
|
|
2070
2010
|
this.el = ref.nativeElement;
|
|
2071
|
-
ref.nativeElement.delegate = angularDelegate.create(environmentInjector
|
|
2011
|
+
ref.nativeElement.delegate = angularDelegate.create(environmentInjector);
|
|
2072
2012
|
proxyOutputs(this, this.el, ['ionNavDidChange', 'ionNavWillChange']);
|
|
2073
2013
|
}
|
|
2074
2014
|
};
|
|
2075
|
-
/** @nocollapse */ IonNav.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: IonNav, deps: [{ token: i0.ElementRef }, { token: i0.EnvironmentInjector }, { token:
|
|
2015
|
+
/** @nocollapse */ IonNav.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: IonNav, deps: [{ token: i0.ElementRef }, { token: i0.EnvironmentInjector }, { token: AngularDelegate }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2076
2016
|
/** @nocollapse */ IonNav.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.12", type: IonNav, inputs: { animated: "animated", animation: "animation", root: "root", rootParams: "rootParams", swipeGesture: "swipeGesture" }, ngImport: i0 });
|
|
2077
2017
|
IonNav = __decorate([
|
|
2078
2018
|
ProxyCmp({
|
|
@@ -2086,7 +2026,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
2086
2026
|
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
|
|
2087
2027
|
inputs: NAV_INPUTS,
|
|
2088
2028
|
}]
|
|
2089
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.EnvironmentInjector }, { type:
|
|
2029
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.EnvironmentInjector }, { type: AngularDelegate }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }]; } });
|
|
2090
2030
|
|
|
2091
2031
|
// eslint-disable-next-line @angular-eslint/directive-class-suffix
|
|
2092
2032
|
class IonTabs {
|
|
@@ -2480,5 +2420,5 @@ class OverlayBaseController {
|
|
|
2480
2420
|
* Generated bundle index. Do not edit.
|
|
2481
2421
|
*/
|
|
2482
2422
|
|
|
2483
|
-
export { AngularDelegate, Config, ConfigToken, DomController, IonBackButton, IonModal, IonNav, IonPopover, IonRouterOutlet, IonTabs, IonicRouteStrategy, MenuController, NavController,
|
|
2423
|
+
export { AngularDelegate, Config, ConfigToken, DomController, IonBackButton, IonModal, IonNav, IonPopover, IonRouterOutlet, IonTabs, IonicRouteStrategy, MenuController, NavController, OverlayBaseController, Platform, ProxyCmp, RouterLinkDelegateDirective, RouterLinkWithHrefDelegateDirective, ValueAccessor, bindLifecycleEvents, provideComponentInputBinding, raf, setIonicClasses };
|
|
2484
2424
|
//# sourceMappingURL=ionic-angular-common.mjs.map
|