@ionic/angular 7.6.2-dev.11705694334.11b34c62 → 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.
Files changed (64) hide show
  1. package/common/directives/navigation/nav.d.ts +2 -2
  2. package/common/directives/navigation/router-outlet.d.ts +4 -3
  3. package/common/index.d.ts +0 -1
  4. package/common/providers/angular-delegate.d.ts +4 -5
  5. package/css/core.css +101 -34
  6. package/css/core.css.map +1 -1
  7. package/css/global.bundle.css +1 -1
  8. package/css/ionic.bundle.css +1 -1
  9. package/css/ionic.bundle.css.map +1 -1
  10. package/css/themes/dark.always.css +122 -0
  11. package/css/themes/dark.always.css.map +1 -0
  12. package/css/themes/dark.class.css +122 -0
  13. package/css/themes/dark.class.css.map +1 -0
  14. package/css/themes/dark.css +3 -0
  15. package/css/themes/dark.css.map +1 -0
  16. package/css/themes/dark.system.css +124 -0
  17. package/css/themes/dark.system.css.map +1 -0
  18. package/css/typography.css +1 -1
  19. package/directives/navigation/ion-nav.d.ts +2 -2
  20. package/directives/navigation/ion-router-outlet.d.ts +12 -4
  21. package/directives/proxies.d.ts +1 -1
  22. package/esm2020/common/directives/navigation/nav.mjs +5 -5
  23. package/esm2020/common/directives/navigation/router-outlet.mjs +15 -6
  24. package/esm2020/common/directives/navigation/stack-controller.mjs +1 -4
  25. package/esm2020/common/index.mjs +1 -2
  26. package/esm2020/common/providers/angular-delegate.mjs +28 -44
  27. package/esm2020/directives/navigation/ion-nav.mjs +5 -5
  28. package/esm2020/directives/navigation/ion-router-outlet.mjs +13 -9
  29. package/esm2020/directives/navigation/ion-tabs.mjs +1 -1
  30. package/esm2020/directives/proxies.mjs +4 -4
  31. package/esm2020/index.mjs +2 -2
  32. package/esm2020/providers/modal-controller.mjs +3 -4
  33. package/esm2020/providers/popover-controller.mjs +3 -4
  34. package/esm2020/standalone/directives/proxies.mjs +4 -4
  35. package/esm2020/standalone/index.mjs +2 -2
  36. package/esm2020/standalone/navigation/nav.mjs +5 -5
  37. package/esm2020/standalone/navigation/router-outlet.mjs +13 -9
  38. package/esm2020/standalone/navigation/tabs.mjs +1 -1
  39. package/esm2020/standalone/providers/modal-controller.mjs +3 -4
  40. package/esm2020/standalone/providers/popover-controller.mjs +3 -4
  41. package/fesm2015/ionic-angular-common.mjs +47 -101
  42. package/fesm2015/ionic-angular-common.mjs.map +1 -1
  43. package/fesm2015/ionic-angular-standalone.mjs +23 -21
  44. package/fesm2015/ionic-angular-standalone.mjs.map +1 -1
  45. package/fesm2015/ionic-angular.mjs +23 -21
  46. package/fesm2015/ionic-angular.mjs.map +1 -1
  47. package/fesm2020/ionic-angular-common.mjs +46 -100
  48. package/fesm2020/ionic-angular-common.mjs.map +1 -1
  49. package/fesm2020/ionic-angular-standalone.mjs +23 -21
  50. package/fesm2020/ionic-angular-standalone.mjs.map +1 -1
  51. package/fesm2020/ionic-angular.mjs +23 -21
  52. package/fesm2020/ionic-angular.mjs.map +1 -1
  53. package/index.d.ts +1 -1
  54. package/package.json +2 -2
  55. package/providers/modal-controller.d.ts +0 -1
  56. package/providers/popover-controller.d.ts +0 -1
  57. package/standalone/directives/proxies.d.ts +1 -1
  58. package/standalone/index.d.ts +1 -1
  59. package/standalone/navigation/nav.d.ts +2 -2
  60. package/standalone/navigation/router-outlet.d.ts +12 -4
  61. package/standalone/providers/modal-controller.d.ts +0 -1
  62. package/standalone/providers/popover-controller.d.ts +0 -1
  63. package/common/directives/navigation/nav-params.d.ts +0 -45
  64. package/esm2020/common/directives/navigation/nav-params.mjs +0 -45
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, Inject, Optional, InjectionToken, inject, NgZone, ApplicationRef, Injector, createComponent, TemplateRef, Directive, ContentChild, EventEmitter, ViewContainerRef, EnvironmentInjector, Attribute, SkipSelf, Input, Output, reflectComponentType, HostListener, ElementRef, ViewChild } from '@angular/core';
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
3
  import * as i3 from '@angular/router';
4
4
  import { NavigationStart, PRIMARY_OUTLET, ChildrenOutletContexts, ActivatedRoute, Router } from '@angular/router';
5
5
  import * as i1 from '@angular/common';
@@ -671,59 +671,14 @@ const getConfig = () => {
671
671
  return null;
672
672
  };
673
673
 
674
- /**
675
- * @description
676
- * NavParams are an object that exists on a page and can contain data for that particular view.
677
- * Similar to how data was pass to a view in V1 with `$stateParams`, NavParams offer a much more flexible
678
- * option with a simple `get` method.
679
- *
680
- * @usage
681
- * ```ts
682
- * import { NavParams } from '@ionic/angular';
683
- *
684
- * export class MyClass{
685
- *
686
- * constructor(navParams: NavParams){
687
- * // userParams is an object we have in our nav-parameters
688
- * navParams.get('userParams');
689
- * }
690
- *
691
- * }
692
- * ```
693
- */
694
- class NavParams {
695
- constructor(data = {}) {
696
- this.data = data;
697
- }
698
- /**
699
- * Get the value of a nav-parameter for the current view
700
- *
701
- * ```ts
702
- * import { NavParams } from 'ionic-angular';
703
- *
704
- * export class MyClass{
705
- * constructor(public navParams: NavParams){
706
- * // userParams is an object we have in our nav-parameters
707
- * this.navParams.get('userParams');
708
- * }
709
- * }
710
- * ```
711
- *
712
- * @param param Which param you want to look up
713
- */
714
- get(param) {
715
- return this.data[param];
716
- }
717
- }
718
-
719
674
  // TODO(FW-2827): types
720
675
  class AngularDelegate {
721
676
  constructor() {
722
677
  this.zone = inject(NgZone);
723
678
  this.applicationRef = inject(ApplicationRef);
724
679
  }
725
- create(environmentInjector, injector, elementReferenceKey) {
726
- return new AngularFrameworkDelegate(environmentInjector, injector, this.applicationRef, this.zone, elementReferenceKey);
680
+ create(environmentInjector, elementReferenceKey) {
681
+ return new AngularFrameworkDelegate(environmentInjector, this.applicationRef, this.zone, elementReferenceKey);
727
682
  }
728
683
  }
729
684
  /** @nocollapse */ AngularDelegate.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: AngularDelegate, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
@@ -732,9 +687,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
732
687
  type: Injectable
733
688
  }] });
734
689
  class AngularFrameworkDelegate {
735
- constructor(environmentInjector, injector, applicationRef, zone, elementReferenceKey) {
690
+ constructor(environmentInjector, applicationRef, zone, elementReferenceKey) {
736
691
  this.environmentInjector = environmentInjector;
737
- this.injector = injector;
738
692
  this.applicationRef = applicationRef;
739
693
  this.zone = zone;
740
694
  this.elementReferenceKey = elementReferenceKey;
@@ -758,7 +712,7 @@ class AngularFrameworkDelegate {
758
712
  if (this.elementReferenceKey !== undefined) {
759
713
  componentProps[this.elementReferenceKey] = container;
760
714
  }
761
- const el = attachView(this.zone, this.environmentInjector, this.injector, this.applicationRef, this.elRefMap, this.elEventsMap, container, component, componentProps, cssClasses, this.elementReferenceKey);
715
+ const el = attachView(this.zone, this.environmentInjector, this.applicationRef, this.elRefMap, this.elEventsMap, container, component, componentProps, cssClasses, this.elementReferenceKey);
762
716
  resolve(el);
763
717
  });
764
718
  });
@@ -781,26 +735,9 @@ class AngularFrameworkDelegate {
781
735
  });
782
736
  }
783
737
  }
784
- const attachView = (zone, environmentInjector, injector, applicationRef, elRefMap, elEventsMap, container, component, params, cssClasses, elementReferenceKey) => {
785
- /**
786
- * Wraps the injector with a custom injector that
787
- * provides NavParams to the component.
788
- *
789
- * NavParams is a legacy feature from Ionic v3 that allows
790
- * Angular developers to provide data to a component
791
- * and access it by providing NavParams as a dependency
792
- * in the constructor.
793
- *
794
- * The modern approach is to access the data directly
795
- * from the component's class instance.
796
- */
797
- const childInjector = Injector.create({
798
- providers: getProviders(params),
799
- parent: injector,
800
- });
738
+ const attachView = (zone, environmentInjector, applicationRef, elRefMap, elEventsMap, container, component, params, cssClasses, elementReferenceKey) => {
801
739
  const componentRef = createComponent(component, {
802
740
  environmentInjector,
803
- elementInjector: childInjector,
804
741
  });
805
742
  const instance = componentRef.instance;
806
743
  const hostElement = componentRef.location.nativeElement;
@@ -815,7 +752,27 @@ const attachView = (zone, environmentInjector, injector, applicationRef, elRefMa
815
752
  if (elementReferenceKey && instance[elementReferenceKey] !== undefined) {
816
753
  console.error(`[Ionic Error]: ${elementReferenceKey} is a reserved property when using ${container.tagName.toLowerCase()}. Rename or remove the "${elementReferenceKey}" property from ${component.name}.`);
817
754
  }
818
- Object.assign(instance, params);
755
+ const { modal, popover, ...otherParams } = params;
756
+ /**
757
+ * Any key/value pairs set in componentProps
758
+ * must be set as inputs on the component instance.
759
+ */
760
+ for (const key in otherParams) {
761
+ componentRef.setInput(key, otherParams[key]);
762
+ }
763
+ /**
764
+ * Using setInput will cause an error when
765
+ * setting modal/popover on a component that
766
+ * does not define them as an input. For backwards
767
+ * compatibility purposes we fall back to using
768
+ * Object.assign for these properties.
769
+ */
770
+ if (modal !== undefined) {
771
+ Object.assign(instance, { modal });
772
+ }
773
+ if (popover !== undefined) {
774
+ Object.assign(instance, { popover });
775
+ }
819
776
  }
820
777
  if (cssClasses) {
821
778
  for (const cssClass of cssClasses) {
@@ -846,23 +803,6 @@ const bindLifecycleEvents = (zone, instance, element) => {
846
803
  return () => unregisters.forEach((fn) => fn());
847
804
  });
848
805
  };
849
- const NavParamsToken = new InjectionToken('NavParamsToken');
850
- const getProviders = (params) => {
851
- return [
852
- {
853
- provide: NavParamsToken,
854
- useValue: params,
855
- },
856
- {
857
- provide: NavParams,
858
- useFactory: provideNavParamsInjectable,
859
- deps: [NavParamsToken],
860
- },
861
- ];
862
- };
863
- const provideNavParamsInjectable = (params) => {
864
- return new NavParams(params);
865
- };
866
806
 
867
807
  // TODO: Is there a way we can grab this from angular-component-lib instead?
868
808
  const proxyInputs = (Cmp, inputs) => {
@@ -1347,9 +1287,6 @@ class StackController {
1347
1287
  if (enteringEl && enteringEl !== leavingEl) {
1348
1288
  enteringEl.classList.add('ion-page');
1349
1289
  enteringEl.classList.add('ion-page-invisible');
1350
- if (enteringEl.parentElement !== containerEl) {
1351
- containerEl.appendChild(enteringEl);
1352
- }
1353
1290
  if (containerEl.commit) {
1354
1291
  return containerEl.commit(enteringEl, leavingEl, {
1355
1292
  duration: direction === undefined ? 0 : undefined,
@@ -1413,7 +1350,8 @@ const cleanup = (activeRoute, views, viewsSnapshot, location, zone) => {
1413
1350
  // TODO(FW-2827): types
1414
1351
  // eslint-disable-next-line @angular-eslint/directive-class-suffix
1415
1352
  class IonRouterOutlet {
1416
- constructor(name, tabs, commonLocation, elementRef, router, zone, activatedRoute, parentOutlet) {
1353
+ constructor(name, tabs, commonLocation, elementRef, router, zone, activatedRoute, outletContent, parentOutlet) {
1354
+ this.outletContent = outletContent;
1417
1355
  this.parentOutlet = parentOutlet;
1418
1356
  this.activatedView = null;
1419
1357
  // Maintain map of activated route proxies for each component instance
@@ -1600,8 +1538,16 @@ class IonRouterOutlet {
1600
1538
  const injector = new OutletInjector(activatedRouteProxy, childContexts, this.location.injector);
1601
1539
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1602
1540
  const component = snapshot.routeConfig.component ?? snapshot.component;
1603
- cmpRef = this.activated = this.location.createComponent(component, {
1604
- index: this.location.length,
1541
+ /**
1542
+ * View components need to be added as a child of ion-router-outlet
1543
+ * for page transitions and swipe to go back.
1544
+ * However, createComponent mounts components as siblings of the
1545
+ * ViewContainerRef. As a result, outletContent must reference
1546
+ * an ng-container inside of ion-router-outlet and not
1547
+ * ion-router-outlet itself.
1548
+ */
1549
+ cmpRef = this.activated = this.outletContent.createComponent(component, {
1550
+ index: this.outletContent.length,
1605
1551
  injector,
1606
1552
  environmentInjector: environmentInjector ?? this.environmentInjector,
1607
1553
  });
@@ -1720,7 +1666,7 @@ class IonRouterOutlet {
1720
1666
  this.currentActivatedRoute$.next({ component, activatedRoute });
1721
1667
  }
1722
1668
  }
1723
- /** @nocollapse */ IonRouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: IonRouterOutlet, deps: [{ token: 'name', attribute: true }, { token: 'tabs', attribute: true, optional: true }, { token: i1.Location }, { token: i0.ElementRef }, { token: i3.Router }, { token: i0.NgZone }, { token: i3.ActivatedRoute }, { token: IonRouterOutlet, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Directive });
1669
+ /** @nocollapse */ IonRouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: IonRouterOutlet, deps: [{ token: 'name', attribute: true }, { token: 'tabs', attribute: true, optional: true }, { token: i1.Location }, { token: i0.ElementRef }, { token: i3.Router }, { token: i0.NgZone }, { token: i3.ActivatedRoute }, { token: i0.ViewContainerRef }, { token: IonRouterOutlet, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Directive });
1724
1670
  /** @nocollapse */ IonRouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.12", type: IonRouterOutlet, selector: "ion-router-outlet", inputs: { animated: "animated", animation: "animation", mode: "mode", swipeGesture: "swipeGesture", name: "name" }, outputs: { stackWillChange: "stackWillChange", stackDidChange: "stackDidChange", activateEvents: "activate", deactivateEvents: "deactivate" }, exportAs: ["outlet"], ngImport: i0 });
1725
1671
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: IonRouterOutlet, decorators: [{
1726
1672
  type: Directive,
@@ -1738,7 +1684,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
1738
1684
  }, {
1739
1685
  type: Attribute,
1740
1686
  args: ['tabs']
1741
- }] }, { type: i1.Location }, { type: i0.ElementRef }, { type: i3.Router }, { type: i0.NgZone }, { type: i3.ActivatedRoute }, { type: IonRouterOutlet, decorators: [{
1687
+ }] }, { type: i1.Location }, { type: i0.ElementRef }, { type: i3.Router }, { type: i0.NgZone }, { type: i3.ActivatedRoute }, { type: i0.ViewContainerRef }, { type: IonRouterOutlet, decorators: [{
1742
1688
  type: SkipSelf
1743
1689
  }, {
1744
1690
  type: Optional
@@ -2033,15 +1979,15 @@ const NAV_METHODS = [
2033
1979
  'getPrevious',
2034
1980
  ];
2035
1981
  let IonNav = class IonNav {
2036
- constructor(ref, environmentInjector, injector, angularDelegate, z, c) {
1982
+ constructor(ref, environmentInjector, angularDelegate, z, c) {
2037
1983
  this.z = z;
2038
1984
  c.detach();
2039
1985
  this.el = ref.nativeElement;
2040
- ref.nativeElement.delegate = angularDelegate.create(environmentInjector, injector);
1986
+ ref.nativeElement.delegate = angularDelegate.create(environmentInjector);
2041
1987
  proxyOutputs(this, this.el, ['ionNavDidChange', 'ionNavWillChange']);
2042
1988
  }
2043
1989
  };
2044
- /** @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: i0.Injector }, { token: AngularDelegate }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
1990
+ /** @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 });
2045
1991
  /** @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 });
2046
1992
  IonNav = __decorate([
2047
1993
  ProxyCmp({
@@ -2055,7 +2001,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
2055
2001
  // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
2056
2002
  inputs: NAV_INPUTS,
2057
2003
  }]
2058
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.EnvironmentInjector }, { type: i0.Injector }, { type: AngularDelegate }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }]; } });
2004
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.EnvironmentInjector }, { type: AngularDelegate }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }]; } });
2059
2005
 
2060
2006
  // eslint-disable-next-line @angular-eslint/directive-class-suffix
2061
2007
  class IonTabs {
@@ -2457,5 +2403,5 @@ class OverlayBaseController {
2457
2403
  * Generated bundle index. Do not edit.
2458
2404
  */
2459
2405
 
2460
- export { AngularDelegate, Config, ConfigToken, DomController, IonBackButton, IonModal, IonNav, IonPopover, IonRouterOutlet, IonTabs, IonicRouteStrategy, MenuController, NavController, NavParams, OverlayBaseController, Platform, ProxyCmp, RouterLinkDelegateDirective, RouterLinkWithHrefDelegateDirective, ValueAccessor, bindLifecycleEvents, provideComponentInputBinding, raf, setIonicClasses };
2406
+ export { AngularDelegate, Config, ConfigToken, DomController, IonBackButton, IonModal, IonNav, IonPopover, IonRouterOutlet, IonTabs, IonicRouteStrategy, MenuController, NavController, OverlayBaseController, Platform, ProxyCmp, RouterLinkDelegateDirective, RouterLinkWithHrefDelegateDirective, ValueAccessor, bindLifecycleEvents, provideComponentInputBinding, raf, setIonicClasses };
2461
2407
  //# sourceMappingURL=ionic-angular-common.mjs.map