diff --git a/packages/angular/src/directives/ion-nav.ts b/packages/angular/src/directives/ion-nav.ts index 6f0b601eb4..db9212c232 100644 --- a/packages/angular/src/directives/ion-nav.ts +++ b/packages/angular/src/directives/ion-nav.ts @@ -3,10 +3,10 @@ import { Directive, ElementRef, Injector, + Optional, Type, } from '@angular/core'; - import { FrameworkDelegate } from '@ionic/core'; import { AngularComponentMounter, AngularEscapeHatch } from '..'; @@ -22,10 +22,10 @@ export class IonNav implements FrameworkDelegate { public elementRef: ElementRef, protected angularComponentMounter: AngularComponentMounter, protected cfr: ComponentFactoryResolver, - protected injector: Injector) { + protected injector: Injector + ) { this.elementRef.nativeElement.delegate = this; - } attachViewToDom(elementOrContainerToMountTo: HTMLIonNavElement, diff --git a/packages/angular/src/router/outlet.ts b/packages/angular/src/router/outlet.ts index 8da2596b1d..6423459f92 100644 --- a/packages/angular/src/router/outlet.ts +++ b/packages/angular/src/router/outlet.ts @@ -22,16 +22,19 @@ import { Router } from '@angular/router'; +import { NavResult, RouterDelegate } from '@ionic/core'; + +import { OutletInjector } from './outlet-injector'; +import { RouteEventHandler } from './route-event-handler'; import { AngularComponentMounter, AngularEscapeHatch } from '..'; -import { OutletInjector } from './outlet-injector'; let id = 0; @Directive({ selector: 'ion-nav', }) -export class RouterOutlet implements OnDestroy, OnInit { +export class RouterOutlet implements OnDestroy, OnInit, RouterDelegate { public name: string; public activationStatus = NOT_ACTIVATED; @@ -53,12 +56,24 @@ export class RouterOutlet implements OnDestroy, OnInit { protected parentContexts: ChildrenOutletContexts, protected cfr: ComponentFactoryResolver, protected injector: Injector, + protected router: Router, + private routeEventHandler: RouteEventHandler, @Attribute('name') name: string) { + (this.elementRef.nativeElement as HTMLIonNavElement).routerDelegate = this; this.name = name || PRIMARY_OUTLET; parentContexts.onChildOutletCreated(this.name, this as any); } + pushUrlState(urlSegment: string): Promise { + return this.router.navigateByUrl(urlSegment); + } + + popUrlState(): Promise { + window.history.back(); + return Promise.resolve(); + } + ngOnDestroy(): void { console.debug(`Nav ${this.id} ngOnDestroy`); this.parentContexts.onChildOutletDestroyed(this.name); @@ -93,6 +108,7 @@ export class RouterOutlet implements OnDestroy, OnInit { } activateWith(activatedRoute: ActivatedRoute, cfr: ComponentFactoryResolver): Promise { + this.routeEventHandler.externalNavStart(); if (this.activationStatus !== NOT_ACTIVATED) { return Promise.resolve(); } @@ -105,7 +121,8 @@ export class RouterOutlet implements OnDestroy, OnInit { const childContexts = this.parentContexts.getOrCreateContext(this.name).children; const injector = new OutletInjector(activatedRoute, childContexts, this.location.injector); - return activateRoute(this.elementRef.nativeElement, component, cfr, injector).then(() => { + const isTopLevel = !hasChildComponent(activatedRoute); + return activateRoute(this.elementRef.nativeElement, component, cfr, injector, isTopLevel).then(() => { this.changeDetector.markForCheck(); this.activateEvents.emit(null); this.activationStatus = ACTIVATED; @@ -114,16 +131,16 @@ export class RouterOutlet implements OnDestroy, OnInit { } export function activateRoute(navElement: HTMLIonNavElement, - component: Type, cfr: ComponentFactoryResolver, injector: Injector): Promise { + component: Type, cfr: ComponentFactoryResolver, injector: Injector, isTopLevel: boolean): Promise { return navElement.componentOnReady().then(() => { // check if the nav has an `` as a parent if (isParentTab(navElement)) { // check if the tab is selected - return updateTab(navElement, component, cfr, injector); + return updateTab(navElement, component, cfr, injector, isTopLevel); } else { - return updateNav(navElement, component, cfr, injector); + return updateNav(navElement, component, cfr, injector, isTopLevel); } }); } @@ -148,42 +165,47 @@ function getSelected(tabsElement: HTMLIonTabsElement) { } function updateTab(navElement: HTMLIonNavElement, - component: Type, cfr: ComponentFactoryResolver, injector: Injector) { + component: Type, cfr: ComponentFactoryResolver, injector: Injector, isTopLevel: boolean) { const tab = navElement.parentElement as HTMLIonTabElement; + // tab.externalNav = true; + + // (tab.parentElement as HTMLIonTabsElement).externalInitialize = true; // yeah yeah, I know this is kind of ugly but oh well, I know the internal structure of const tabs = tab.parentElement.parentElement as HTMLIonTabsElement; + // tabs.externalInitialize = true; return isTabSelected(tabs, tab).then((isSelected: boolean) => { if (!isSelected) { + const promise = updateNav(navElement, component, cfr, injector, isTopLevel); + (window as any).externalNavPromise = promise // okay, the tab is not selected, so we need to do a "switch" transition // basically, we should update the nav, and then swap the tabs - return updateNav(navElement, component, cfr, injector).then(() => { + return promise.then(() => { return tabs.select(tab); }); } // okay cool, the tab is already selected, so we want to see a transition - return updateNav(navElement, component, cfr, injector); + return updateNav(navElement, component, cfr, injector, isTopLevel); }) } function updateNav(navElement: HTMLIonNavElement, - component: Type, cfr: ComponentFactoryResolver, injector: Injector) { + component: Type, cfr: ComponentFactoryResolver, injector: Injector, isTopLevel: boolean): Promise { + + const escapeHatch = getEscapeHatch(cfr, injector); // check if the component is the top view const activeViews = navElement.getViews(); if (activeViews.length === 0) { // there isn't a view in the stack, so push one - return navElement.push(component, {}, {}, { - cfr, - injector - }); + return navElement.setRoot(component, {}, {}, escapeHatch); } const currentView = activeViews[activeViews.length - 1]; if (currentView.component === component) { // the top view is already the component being activated, so there is no change needed - return Promise.resolve(); + return Promise.resolve(null); } // check if the component is the previous view, if so, pop back to it @@ -192,7 +214,7 @@ function updateNav(navElement: HTMLIonNavElement, const previousView = activeViews[activeViews.length - 2]; if (previousView.component === component) { // cool, we match the previous view, so pop it - return navElement.pop(); + return navElement.pop(null, escapeHatch); } } @@ -200,17 +222,33 @@ function updateNav(navElement: HTMLIonNavElement, for (const view of activeViews) { if (view.component === component) { // cool, we found the match, pop back to that bad boy - return navElement.popTo(view); + return navElement.popTo(view, null, escapeHatch); } } - // since it's none of those things, we should probably just push that bad boy and call it a day - return navElement.push(component, {}, {}, { - cfr, - injector - }); + // it's the top level nav, and it's not one of those other behaviors, so do a push so the user gets a chill animation + return navElement.push(component, {}, { animate: isTopLevel }, escapeHatch); } export const NOT_ACTIVATED = 0; export const ACTIVATION_IN_PROGRESS = 1; export const ACTIVATED = 2; + +export function hasChildComponent(activatedRoute: ActivatedRoute): boolean { + // don't worry about recursion for now, that's a future problem that may or may not manifest itself + for (const childRoute of activatedRoute.children) { + if (childRoute.component) { + return true; + } + } + return false; +} + +export function getEscapeHatch(cfr: ComponentFactoryResolver, injector: Injector): AngularEscapeHatch { + return { + cfr, + injector, + fromExternalRouter: true, + url: location.pathname + }; +} diff --git a/packages/angular/src/router/route-event-handler.ts b/packages/angular/src/router/route-event-handler.ts new file mode 100644 index 0000000000..2ad4be81b9 --- /dev/null +++ b/packages/angular/src/router/route-event-handler.ts @@ -0,0 +1,27 @@ +import { Injectable } from '@angular/core'; +import { + Event, + NavigationEnd, + NavigationStart, + Router +} from '@angular/router'; + +let initialized = false; + +@Injectable() +export class RouteEventHandler { + + constructor(private router: Router) { + (window as any).externalNav = false; + + router.events.subscribe((event: Event) => { + if (event instanceof NavigationEnd) { + (window as any).externalNav = false; + } + }); + } + + externalNavStart() { + (window as any).externalNav = true; + } +} \ No newline at end of file diff --git a/packages/angular/src/router/router-module.ts b/packages/angular/src/router/router-module.ts index a403790d11..4d8c8e5bcc 100644 --- a/packages/angular/src/router/router-module.ts +++ b/packages/angular/src/router/router-module.ts @@ -30,6 +30,7 @@ import { IonicAngularModule } from '../module'; import { PushPopOutletContexts } from './push-pop-outlet-contexts'; import { CustomRouter } from './router'; +import { RouteEventHandler } from './route-event-handler'; import { RouterOutlet } from './outlet'; import { flatten } from './router-utils'; @@ -62,6 +63,7 @@ export class IonicRouterModule { [UrlHandlingStrategy, new Optional()], [RouteReuseStrategy, new Optional()] ] }, + RouteEventHandler ] }; } diff --git a/packages/angular/src/router/router.ts b/packages/angular/src/router/router.ts index 7e7e6f6a88..eb97fb0bc8 100644 --- a/packages/angular/src/router/router.ts +++ b/packages/angular/src/router/router.ts @@ -20,8 +20,6 @@ export class CustomRouter extends Router { protected activateRoutes(state: Observable<{appliedUrl: string, state: RouterState, shouldActivate: boolean}>, storedState: RouterState, storedUrl: UrlTree, id: number, url: UrlTree, rawUrl: UrlTree, skipLocationChange: boolean, replaceUrl: boolean, resolvePromise: any, rejectPromise: any) { - console.log('custom activateRoutes!!!!1'); - // applied the new router state // this operation has side effects let navigationIsSuccessful: boolean; diff --git a/packages/angular/src/types/interfaces.ts b/packages/angular/src/types/interfaces.ts index 401e0d1bdd..184e134b2e 100644 --- a/packages/angular/src/types/interfaces.ts +++ b/packages/angular/src/types/interfaces.ts @@ -6,7 +6,7 @@ import { } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; -import { FrameworkMountingData } from '@ionic/core'; +import { EscapeHatch, FrameworkMountingData} from '@ionic/core'; export interface AngularMountingData extends FrameworkMountingData { componentFactory?: ComponentFactory; @@ -16,7 +16,7 @@ export interface AngularMountingData extends FrameworkMountingData { angularHostElement?: HTMLElement; } -export interface AngularEscapeHatch { +export interface AngularEscapeHatch extends EscapeHatch { activatedRoute?: ActivatedRoute; cfr?: ComponentFactoryResolver; injector?: Injector; diff --git a/packages/core/package-lock.json b/packages/core/package-lock.json index ad68eefe64..2611c37204 100644 --- a/packages/core/package-lock.json +++ b/packages/core/package-lock.json @@ -14,9 +14,9 @@ } }, "@stencil/core": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@stencil/core/-/core-0.4.3.tgz", - "integrity": "sha512-+oGFiJeCD51WaqvRtSibnvDNDNU2KxvmEP3rtvZpL5Rc6M+j3e19ZOytH54i+x2x1ISk7rLiI0Xf4Ub5Zxpt2Q==", + "version": "0.5.0-0", + "resolved": "https://registry.npmjs.org/@stencil/core/-/core-0.5.0-0.tgz", + "integrity": "sha512-3owUXWvcpVAh397WJHrHyciXeapP8xJLCq4l+eHMKu12cD1bVa3gUVuBrW8eJsyh4aF5blQQlPTO4l4itjeHdw==", "dev": true, "requires": { "chokidar": "2.0.1", @@ -30,74 +30,6 @@ "typescript": "2.7.1", "uglify-es": "3.3.9", "workbox-build": "3.0.0-alpha.6" - }, - "dependencies": { - "chokidar": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.1.tgz", - "integrity": "sha512-rv5iP8ENhpqvDWr677rAXcB+SMoPQ1urd4ch79+PhM4lQwbATdJUQK69t0lJIKNB+VXpqxt5V1gvqs59XEPKnw==", - "dev": true, - "requires": { - "anymatch": "2.0.0", - "async-each": "1.0.1", - "braces": "2.3.0", - "fsevents": "1.1.3", - "glob-parent": "3.1.0", - "inherits": "2.0.3", - "is-binary-path": "1.0.1", - "is-glob": "4.0.0", - "normalize-path": "2.1.1", - "path-is-absolute": "1.0.1", - "readdirp": "2.1.0", - "upath": "1.0.0" - } - }, - "commander": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.13.0.tgz", - "integrity": "sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "uglify-es": { - "version": "3.3.9", - "resolved": "https://registry.npmjs.org/uglify-es/-/uglify-es-3.3.9.tgz", - "integrity": "sha512-r+MU0rfv4L/0eeW3xZrd16t4NZfK8Ld4SWVglYBb7ez5uXFWHuVRs6xCTrf1yirs9a4j4Y27nn7SRfO6v67XsQ==", - "dev": true, - "requires": { - "commander": "2.13.0", - "source-map": "0.6.1" - } - }, - "workbox-build": { - "version": "3.0.0-alpha.6", - "resolved": "https://registry.npmjs.org/workbox-build/-/workbox-build-3.0.0-alpha.6.tgz", - "integrity": "sha512-iOzD11LXbuZtzBAC3X1wpD5KLBKtt5suGxq36nT6gggOgwWI+xwTU+lL28QroRuD8oEf1cLo2K1wZzVQUqM89w==", - "dev": true, - "requires": { - "babel-runtime": "6.26.0", - "common-tags": "1.7.2", - "fs-extra": "4.0.3", - "glob": "7.1.2", - "joi": "11.4.0", - "lodash.template": "4.4.0", - "workbox-background-sync": "3.0.0-beta.0", - "workbox-broadcast-cache-update": "3.0.0-beta.0", - "workbox-cache-expiration": "3.0.0-beta.0", - "workbox-cacheable-response": "3.0.0-beta.0", - "workbox-core": "3.0.0-beta.0", - "workbox-google-analytics": "3.0.0-beta.0", - "workbox-precaching": "3.0.0-beta.0", - "workbox-routing": "3.0.0-beta.0", - "workbox-strategies": "3.0.0-beta.0", - "workbox-sw": "3.0.0-beta.0" - } - } } }, "@stencil/dev-server": { @@ -253,9 +185,9 @@ "dev": true }, "@types/node": { - "version": "9.4.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-9.4.1.tgz", - "integrity": "sha512-9ESUxmXt1Isc1xKfDBZ7tpULyTPY5ZCywcfvQTXoLUqP+n4D+MBH+0n75hdzrcmfCc3eWByOi27+GLmMuAvcUA==", + "version": "9.4.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-9.4.5.tgz", + "integrity": "sha512-DvC7bzO5797bkApgukxouHmkOdYN2D0yL5olw0RncDpXUa6n39qTVsUi/5g2QJjPgl8qn4zh+4h0sofNoWGLRg==", "dev": true }, "abab": { @@ -463,7 +395,7 @@ "dev": true, "requires": { "delegates": "1.0.0", - "readable-stream": "2.3.3" + "readable-stream": "2.3.4" } }, "argparse": { @@ -580,6 +512,14 @@ "dev": true, "requires": { "lodash": "4.17.5" + }, + "dependencies": { + "lodash": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", + "dev": true + } } }, "async-each": { @@ -654,6 +594,14 @@ "private": "0.1.8", "slash": "1.0.0", "source-map": "0.5.7" + }, + "dependencies": { + "lodash": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", + "dev": true + } } }, "babel-generator": { @@ -670,6 +618,14 @@ "lodash": "4.17.5", "source-map": "0.5.7", "trim-right": "1.0.1" + }, + "dependencies": { + "lodash": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", + "dev": true + } } }, "babel-helpers": { @@ -758,6 +714,14 @@ "lodash": "4.17.5", "mkdirp": "0.5.1", "source-map-support": "0.4.18" + }, + "dependencies": { + "lodash": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", + "dev": true + } } }, "babel-runtime": { @@ -781,6 +745,14 @@ "babel-types": "6.26.0", "babylon": "6.18.0", "lodash": "4.17.5" + }, + "dependencies": { + "lodash": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", + "dev": true + } } }, "babel-traverse": { @@ -798,6 +770,14 @@ "globals": "9.18.0", "invariant": "2.2.2", "lodash": "4.17.5" + }, + "dependencies": { + "lodash": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", + "dev": true + } } }, "babel-types": { @@ -810,6 +790,14 @@ "esutils": "2.0.2", "lodash": "4.17.5", "to-fast-properties": "1.0.3" + }, + "dependencies": { + "lodash": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", + "dev": true + } } }, "babylon": { @@ -835,7 +823,7 @@ "component-emitter": "1.2.1", "define-property": "1.0.0", "isobject": "3.0.1", - "mixin-deep": "1.3.0", + "mixin-deep": "1.3.1", "pascalcase": "0.1.1" } }, @@ -934,7 +922,7 @@ "requires": { "ansi-align": "2.0.0", "camelcase": "4.1.0", - "chalk": "2.3.0", + "chalk": "2.3.1", "cli-boxes": "1.0.0", "string-width": "2.1.1", "term-size": "1.2.0", @@ -963,14 +951,14 @@ "dev": true }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz", + "integrity": "sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g==", "dev": true, "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.2.0" } }, "is-fullwidth-code-point": { @@ -999,20 +987,20 @@ } }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.2.0.tgz", + "integrity": "sha512-F39vS48la4YvTZUPVeTqsjsFNrvcMwrV3RLZINsmHo+7djCvuUzSIeXOnZ5hmjef4bajL1dNccN+tg5XAliO5Q==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } }, "brace-expansion": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", - "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { "balanced-match": "1.0.0", @@ -1305,6 +1293,26 @@ "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", "dev": true }, + "chokidar": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.1.tgz", + "integrity": "sha512-rv5iP8ENhpqvDWr677rAXcB+SMoPQ1urd4ch79+PhM4lQwbATdJUQK69t0lJIKNB+VXpqxt5V1gvqs59XEPKnw==", + "dev": true, + "requires": { + "anymatch": "2.0.0", + "async-each": "1.0.1", + "braces": "2.3.0", + "fsevents": "1.1.3", + "glob-parent": "3.1.0", + "inherits": "2.0.3", + "is-binary-path": "1.0.1", + "is-glob": "4.0.0", + "normalize-path": "2.1.1", + "path-is-absolute": "1.0.1", + "readdirp": "2.1.0", + "upath": "1.0.0" + } + }, "chromedriver": { "version": "2.35.0", "resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-2.35.0.tgz", @@ -1554,7 +1562,7 @@ "dev": true, "requires": { "inherits": "2.0.3", - "readable-stream": "2.3.3", + "readable-stream": "2.3.4", "typedarray": "0.0.6" } }, @@ -2210,6 +2218,12 @@ "through": "2.3.8" } }, + "lodash": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", + "dev": true + }, "onetime": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", @@ -3948,6 +3962,14 @@ "glob": "7.1.2", "lodash": "4.17.5", "minimatch": "3.0.4" + }, + "dependencies": { + "lodash": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", + "dev": true + } } }, "gonzales-pe-sl": { @@ -4119,9 +4141,9 @@ } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "has-unicode": { @@ -4350,7 +4372,7 @@ "dev": true, "requires": { "ansi-escapes": "3.0.0", - "chalk": "2.3.0", + "chalk": "2.3.1", "cli-cursor": "2.1.0", "cli-width": "2.2.0", "external-editor": "2.1.0", @@ -4381,14 +4403,14 @@ } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz", + "integrity": "sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g==", "dev": true, "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.2.0" } }, "is-fullwidth-code-point": { @@ -4397,6 +4419,12 @@ "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, + "lodash": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", + "dev": true + }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", @@ -4417,12 +4445,12 @@ } }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.2.0.tgz", + "integrity": "sha512-F39vS48la4YvTZUPVeTqsjsFNrvcMwrV3RLZINsmHo+7djCvuUzSIeXOnZ5hmjef4bajL1dNccN+tg5XAliO5Q==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -4971,14 +4999,14 @@ "dev": true }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz", + "integrity": "sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g==", "dev": true, "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.2.0" } }, "expand-brackets": { @@ -5036,7 +5064,7 @@ "dev": true, "requires": { "ansi-escapes": "3.0.0", - "chalk": "2.3.0", + "chalk": "2.3.1", "glob": "7.1.2", "graceful-fs": "4.1.11", "is-ci": "1.1.0", @@ -5197,12 +5225,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.2.0.tgz", + "integrity": "sha512-F39vS48la4YvTZUPVeTqsjsFNrvcMwrV3RLZINsmHo+7djCvuUzSIeXOnZ5hmjef4bajL1dNccN+tg5XAliO5Q==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } }, "which-module": { @@ -5258,7 +5286,7 @@ "integrity": "sha512-fJru5HtlD/5l2o25eY9xT0doK3t2dlglrqoGpbktduyoI0T5CwuB++2YfoNZCrgZipTwPuAGonYv0q7+8yDc/A==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.3.1", "glob": "7.1.2", "jest-environment-jsdom": "21.2.1", "jest-environment-node": "21.2.1", @@ -5281,23 +5309,23 @@ } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz", + "integrity": "sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g==", "dev": true, "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.2.0" } }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.2.0.tgz", + "integrity": "sha512-F39vS48la4YvTZUPVeTqsjsFNrvcMwrV3RLZINsmHo+7djCvuUzSIeXOnZ5hmjef4bajL1dNccN+tg5XAliO5Q==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -5308,7 +5336,7 @@ "integrity": "sha512-E5fu6r7PvvPr5qAWE1RaUwIh/k6Zx/3OOkZ4rk5dBJkEWRrUuSgbMt2EO8IUTPTd6DOqU3LW6uTIwX5FRvXoFA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.3.1", "diff": "3.4.0", "jest-get-type": "21.2.0", "pretty-format": "21.2.1" @@ -5324,23 +5352,23 @@ } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz", + "integrity": "sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g==", "dev": true, "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.2.0" } }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.2.0.tgz", + "integrity": "sha512-F39vS48la4YvTZUPVeTqsjsFNrvcMwrV3RLZINsmHo+7djCvuUzSIeXOnZ5hmjef4bajL1dNccN+tg5XAliO5Q==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -5462,7 +5490,7 @@ "graceful-fs": "4.1.11", "jest-docblock": "21.2.0", "micromatch": "2.3.11", - "sane": "2.3.0", + "sane": "2.4.1", "worker-farm": "1.5.2" }, "dependencies": { @@ -5563,7 +5591,7 @@ "integrity": "sha512-lw8FXXIEekD+jYNlStfgNsUHpfMWhWWCgHV7n0B7mA/vendH7vBFs8xybjQsDzJSduptBZJHqQX9SMssya9+3A==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.3.1", "expect": "21.2.1", "graceful-fs": "4.1.11", "jest-diff": "21.2.1", @@ -5583,23 +5611,23 @@ } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz", + "integrity": "sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g==", "dev": true, "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.2.0" } }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.2.0.tgz", + "integrity": "sha512-F39vS48la4YvTZUPVeTqsjsFNrvcMwrV3RLZINsmHo+7djCvuUzSIeXOnZ5hmjef4bajL1dNccN+tg5XAliO5Q==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -5610,7 +5638,7 @@ "integrity": "sha512-kn56My+sekD43dwQPrXBl9Zn9tAqwoy25xxe7/iY4u+mG8P3ALj5IK7MLHZ4Mi3xW7uWVCjGY8cm4PqgbsqMCg==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.3.1", "jest-get-type": "21.2.0", "pretty-format": "21.2.1" }, @@ -5625,23 +5653,23 @@ } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz", + "integrity": "sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g==", "dev": true, "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.2.0" } }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.2.0.tgz", + "integrity": "sha512-F39vS48la4YvTZUPVeTqsjsFNrvcMwrV3RLZINsmHo+7djCvuUzSIeXOnZ5hmjef4bajL1dNccN+tg5XAliO5Q==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -5652,7 +5680,7 @@ "integrity": "sha512-EbC1X2n0t9IdeMECJn2BOg7buOGivCvVNjqKMXTzQOu7uIfLml+keUfCALDh8o4rbtndIeyGU8/BKfoTr/LVDQ==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.3.1", "micromatch": "2.3.11", "slash": "1.0.0" }, @@ -5693,14 +5721,14 @@ } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz", + "integrity": "sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g==", "dev": true, "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.2.0" } }, "expand-brackets": { @@ -5767,12 +5795,12 @@ } }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.2.0.tgz", + "integrity": "sha512-F39vS48la4YvTZUPVeTqsjsFNrvcMwrV3RLZINsmHo+7djCvuUzSIeXOnZ5hmjef4bajL1dNccN+tg5XAliO5Q==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -5796,7 +5824,7 @@ "dev": true, "requires": { "browser-resolve": "1.11.2", - "chalk": "2.3.0", + "chalk": "2.3.1", "is-builtin-module": "1.0.0" }, "dependencies": { @@ -5810,23 +5838,23 @@ } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz", + "integrity": "sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g==", "dev": true, "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.2.0" } }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.2.0.tgz", + "integrity": "sha512-F39vS48la4YvTZUPVeTqsjsFNrvcMwrV3RLZINsmHo+7djCvuUzSIeXOnZ5hmjef4bajL1dNccN+tg5XAliO5Q==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -5875,7 +5903,7 @@ "babel-core": "6.26.0", "babel-jest": "21.2.0", "babel-plugin-istanbul": "4.1.5", - "chalk": "2.3.0", + "chalk": "2.3.1", "convert-source-map": "1.5.1", "graceful-fs": "4.1.11", "jest-config": "21.2.1", @@ -5939,14 +5967,14 @@ "dev": true }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz", + "integrity": "sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g==", "dev": true, "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.2.0" } }, "expand-brackets": { @@ -6106,12 +6134,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.2.0.tgz", + "integrity": "sha512-F39vS48la4YvTZUPVeTqsjsFNrvcMwrV3RLZINsmHo+7djCvuUzSIeXOnZ5hmjef4bajL1dNccN+tg5XAliO5Q==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } }, "which-module": { @@ -6158,7 +6186,7 @@ "integrity": "sha512-bpaeBnDpdqaRTzN8tWg0DqOTo2DvD3StOemxn67CUd1p1Po+BUpvePAp44jdJ7Pxcjfg+42o4NHw1SxdCA2rvg==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.3.1", "jest-diff": "21.2.1", "jest-matcher-utils": "21.2.1", "mkdirp": "0.5.1", @@ -6176,23 +6204,23 @@ } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz", + "integrity": "sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g==", "dev": true, "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.2.0" } }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.2.0.tgz", + "integrity": "sha512-F39vS48la4YvTZUPVeTqsjsFNrvcMwrV3RLZINsmHo+7djCvuUzSIeXOnZ5hmjef4bajL1dNccN+tg5XAliO5Q==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -6204,7 +6232,7 @@ "dev": true, "requires": { "callsites": "2.0.0", - "chalk": "2.3.0", + "chalk": "2.3.1", "graceful-fs": "4.1.11", "jest-message-util": "21.2.1", "jest-mock": "21.2.0", @@ -6222,23 +6250,23 @@ } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz", + "integrity": "sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g==", "dev": true, "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.2.0" } }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.2.0.tgz", + "integrity": "sha512-F39vS48la4YvTZUPVeTqsjsFNrvcMwrV3RLZINsmHo+7djCvuUzSIeXOnZ5hmjef4bajL1dNccN+tg5XAliO5Q==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -6249,7 +6277,7 @@ "integrity": "sha512-k4HLI1rZQjlU+EC682RlQ6oZvLrE5SCh3brseQc24vbZTxzT/k/3urar5QMCVgjadmSO7lECeGdc6YxnM3yEGg==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.3.1", "jest-get-type": "21.2.0", "leven": "2.1.0", "pretty-format": "21.2.1" @@ -6265,23 +6293,23 @@ } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz", + "integrity": "sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g==", "dev": true, "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.2.0" } }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.2.0.tgz", + "integrity": "sha512-F39vS48la4YvTZUPVeTqsjsFNrvcMwrV3RLZINsmHo+7djCvuUzSIeXOnZ5hmjef4bajL1dNccN+tg5XAliO5Q==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -6463,6 +6491,12 @@ "integrity": "sha1-+rg/uwstjchfpjbEudNMdUIMbWU=", "dev": true }, + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", + "dev": true + }, "readable-stream": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", @@ -6985,9 +7019,9 @@ } }, "lodash": { - "version": "4.17.5", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", - "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", + "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=", "dev": true }, "lodash._reinterpolate": { @@ -7057,7 +7091,7 @@ "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", "dev": true, "requires": { - "chalk": "2.3.0" + "chalk": "2.3.1" }, "dependencies": { "ansi-styles": { @@ -7070,23 +7104,23 @@ } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz", + "integrity": "sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g==", "dev": true, "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.2.0" } }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.2.0.tgz", + "integrity": "sha512-F39vS48la4YvTZUPVeTqsjsFNrvcMwrV3RLZINsmHo+7djCvuUzSIeXOnZ5hmjef4bajL1dNccN+tg5XAliO5Q==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -7368,7 +7402,7 @@ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "brace-expansion": "1.1.8" + "brace-expansion": "1.1.11" } }, "minimist": { @@ -7388,9 +7422,9 @@ } }, "mixin-deep": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.0.tgz", - "integrity": "sha512-dgaCvoh6i1nosAUBKb0l0pfJ78K8+S9fluyIR2YvAeUD/QuMahnFnF3xYty5eYXMjhGSsB0DsW6A0uAZyetoAg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", + "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", "dev": true, "requires": { "for-in": "1.0.2", @@ -7464,6 +7498,12 @@ "integrity": "sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww==", "dev": true }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "dev": true + }, "supports-color": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", @@ -7782,7 +7822,7 @@ "dev": true, "requires": { "any-observable": "0.2.0", - "chalk": "2.3.0", + "chalk": "2.3.1", "del": "3.0.0", "execa": "0.8.0", "has-yarn": "1.0.0", @@ -7828,14 +7868,14 @@ } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz", + "integrity": "sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g==", "dev": true, "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.2.0" } }, "cross-spawn": { @@ -7983,12 +8023,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.2.0.tgz", + "integrity": "sha512-F39vS48la4YvTZUPVeTqsjsFNrvcMwrV3RLZINsmHo+7djCvuUzSIeXOnZ5hmjef4bajL1dNccN+tg5XAliO5Q==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } }, "trim-newlines": { @@ -8424,7 +8464,7 @@ "integrity": "sha512-rgO9Zg5LLLkfJF9E6CCmXlSE4UVceloys8JrFqCcHloC3usd/kJCyPDwH2SOlzix2j3xaP9sUX3e8+kvkuleAA==", "dev": true, "requires": { - "@types/node": "9.4.1" + "@types/node": "9.4.5" } }, "pascalcase": { @@ -8611,9 +8651,9 @@ "dev": true }, "process-nextick-args": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "dev": true }, "progress": { @@ -8757,15 +8797,15 @@ } }, "readable-stream": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", - "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.4.tgz", + "integrity": "sha512-vuYxeWYM+fde14+rajzqgeohAI7YoJcHE7kXDAc4Nk0EbuKnJfqtY9YtRkLo/tqkuF7MsBQRhPnPeyjYITp3ZQ==", "dev": true, "requires": { "core-util-is": "1.0.2", "inherits": "2.0.3", "isarray": "1.0.0", - "process-nextick-args": "1.0.7", + "process-nextick-args": "2.0.0", "safe-buffer": "5.1.1", "string_decoder": "1.0.3", "util-deprecate": "1.0.2" @@ -8779,7 +8819,7 @@ "requires": { "graceful-fs": "4.1.11", "minimatch": "3.0.4", - "readable-stream": "2.3.3", + "readable-stream": "2.3.4", "set-immediate-shim": "1.0.1" } }, @@ -8919,6 +8959,14 @@ "dev": true, "requires": { "lodash": "4.17.5" + }, + "dependencies": { + "lodash": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", + "dev": true + } } }, "request-promise-native": { @@ -9256,9 +9304,9 @@ "dev": true }, "sane": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/sane/-/sane-2.3.0.tgz", - "integrity": "sha512-6GB9zPCsqJqQPAGcvEkUPijM1ZUFI+A/DrscL++dXO3Ltt5q5mPDayGxZtr3cBRkrbb4akbwszVVkTIFefEkcg==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/sane/-/sane-2.4.1.tgz", + "integrity": "sha512-fW9svvNd81XzHDZyis9/tEY1bZikDGryy8Hi1BErPyNPYv47CdLseUN+tI5FBHWXEENRtj1SWtX/jBnggLaP0w==", "dev": true, "requires": { "anymatch": "1.3.2", @@ -9390,6 +9438,12 @@ "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", "dev": true }, + "lodash": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", + "dev": true + }, "yargs": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", @@ -9934,7 +9988,7 @@ "integrity": "sha1-osfIWH5U2UJ+qe2zrD8s1SLfN4s=", "dev": true, "requires": { - "readable-stream": "2.3.3" + "readable-stream": "2.3.4" } }, "stealthy-require": { @@ -10110,6 +10164,12 @@ "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, + "lodash": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", + "dev": true + }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", @@ -10508,7 +10568,7 @@ "requires": { "babel-code-frame": "6.26.0", "builtin-modules": "1.1.1", - "chalk": "2.3.0", + "chalk": "2.3.1", "commander": "2.14.1", "diff": "3.4.0", "glob": "7.1.2", @@ -10517,7 +10577,7 @@ "resolve": "1.5.0", "semver": "5.5.0", "tslib": "1.9.0", - "tsutils": "2.21.0" + "tsutils": "2.21.1" }, "dependencies": { "ansi-styles": { @@ -10530,23 +10590,23 @@ } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz", + "integrity": "sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g==", "dev": true, "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.2.0" } }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.2.0.tgz", + "integrity": "sha512-F39vS48la4YvTZUPVeTqsjsFNrvcMwrV3RLZINsmHo+7djCvuUzSIeXOnZ5hmjef4bajL1dNccN+tg5XAliO5Q==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -10602,9 +10662,9 @@ } }, "tsutils": { - "version": "2.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.21.0.tgz", - "integrity": "sha512-zlOHTYtTwvTiKxUyAU8wiKzPpAgwZrGjb7AY18VUlxuCgBiTMVorIl5HjrCT8V64Hm34RI1BZITJMVQpBLMxVg==", + "version": "2.21.1", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.21.1.tgz", + "integrity": "sha512-heMkdeQ9iUc90ynfiNo5Y+GXrEEGy86KMvnSTfHO+Q40AuNQ1lZGXcv58fuU9XTUxI0V7YIN9xPN+CO9b1Gn3w==", "dev": true, "requires": { "tslib": "1.9.0" @@ -10659,6 +10719,30 @@ "integrity": "sha512-bqB1yS6o9TNA9ZC/MJxM0FZzPnZdtHj0xWK/IZ5khzVqdpGul/R/EIiHRgFXlwTD7PSIaYVnGKq1QgMCu2mnqw==", "dev": true }, + "uglify-es": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/uglify-es/-/uglify-es-3.3.9.tgz", + "integrity": "sha512-r+MU0rfv4L/0eeW3xZrd16t4NZfK8Ld4SWVglYBb7ez5uXFWHuVRs6xCTrf1yirs9a4j4Y27nn7SRfO6v67XsQ==", + "dev": true, + "requires": { + "commander": "2.13.0", + "source-map": "0.6.1" + }, + "dependencies": { + "commander": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.13.0.tgz", + "integrity": "sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, "uglify-to-browserify": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", @@ -10767,14 +10851,6 @@ "requires": { "lodash": "3.10.1", "underscore.string": "2.3.3" - }, - "dependencies": { - "lodash": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", - "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=", - "dev": true - } } }, "update-notifier": { @@ -10784,7 +10860,7 @@ "dev": true, "requires": { "boxen": "1.3.0", - "chalk": "2.3.0", + "chalk": "2.3.1", "configstore": "3.1.1", "import-lazy": "2.1.0", "is-installed-globally": "0.1.0", @@ -10804,23 +10880,23 @@ } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz", + "integrity": "sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g==", "dev": true, "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.2.0" } }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.2.0.tgz", + "integrity": "sha512-F39vS48la4YvTZUPVeTqsjsFNrvcMwrV3RLZINsmHo+7djCvuUzSIeXOnZ5hmjef4bajL1dNccN+tg5XAliO5Q==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -11148,6 +11224,30 @@ "workbox-core": "3.0.0-beta.0" } }, + "workbox-build": { + "version": "3.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/workbox-build/-/workbox-build-3.0.0-alpha.6.tgz", + "integrity": "sha512-iOzD11LXbuZtzBAC3X1wpD5KLBKtt5suGxq36nT6gggOgwWI+xwTU+lL28QroRuD8oEf1cLo2K1wZzVQUqM89w==", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "common-tags": "1.7.2", + "fs-extra": "4.0.3", + "glob": "7.1.2", + "joi": "11.4.0", + "lodash.template": "4.4.0", + "workbox-background-sync": "3.0.0-beta.0", + "workbox-broadcast-cache-update": "3.0.0-beta.0", + "workbox-cache-expiration": "3.0.0-beta.0", + "workbox-cacheable-response": "3.0.0-beta.0", + "workbox-core": "3.0.0-beta.0", + "workbox-google-analytics": "3.0.0-beta.0", + "workbox-precaching": "3.0.0-beta.0", + "workbox-routing": "3.0.0-beta.0", + "workbox-strategies": "3.0.0-beta.0", + "workbox-sw": "3.0.0-beta.0" + } + }, "workbox-cache-expiration": { "version": "3.0.0-beta.0", "resolved": "https://registry.npmjs.org/workbox-cache-expiration/-/workbox-cache-expiration-3.0.0-beta.0.tgz", @@ -11282,13 +11382,13 @@ "dev": true, "requires": { "sax": "1.2.4", - "xmlbuilder": "9.0.4" + "xmlbuilder": "9.0.7" } }, "xmlbuilder": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.4.tgz", - "integrity": "sha1-UZy0ymhtAFqEINNJbz8MruzKWA8=", + "version": "9.0.7", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", + "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=", "dev": true }, "xtend": { diff --git a/packages/core/src/components.d.ts b/packages/core/src/components.d.ts index 917f392a74..1692152644 100644 --- a/packages/core/src/components.d.ts +++ b/packages/core/src/components.d.ts @@ -14,6 +14,7 @@ import { FrameworkDelegate, PickerColumn, PickerOptions, + RouterDelegate, } from './index'; import { AlertButton, @@ -1837,6 +1838,7 @@ declare global { lazy?: boolean; mode?: string; root?: any; + routerDelegate?: RouterDelegate; swipeBackEnabled?: boolean; useUrls?: boolean; } diff --git a/packages/core/src/components.d.ts.orig b/packages/core/src/components.d.ts.orig deleted file mode 100644 index aaa27b6587..0000000000 --- a/packages/core/src/components.d.ts.orig +++ /dev/null @@ -1,3430 +0,0 @@ -/** - * This is an autogenerated file created by the Stencil build process. - * It contains typing information for all components that exist in this project - * and imports for stencil collections that might be configured in your stencil.config.js file - */ - -import 'ionicons'; - -import { - ActionSheetButton, -} from './components/action-sheet/action-sheet'; -import { - AnimationBuilder, - FrameworkDelegate, - PickerColumn, - PickerOptions, -} from './index'; -import { - AlertButton, - AlertInput, -} from './components/alert/alert'; -import { - ElementRef, - Side, -} from './utils/helpers'; -import { - GestureCallback, - GestureDetail, -} from './components/gesture/gesture'; -import { - PickerButton, - PickerColumn as PickerColumn2, -} from './components/picker/picker'; -import { - Event, -} from '@stencil/core'; -import { - ScrollCallback, -} from './components/scroll/scroll'; -import { - SelectPopoverOption, -} from './components/select-popover/select-popover'; -import { - DomRenderFn, - HeaderFn, - ItemHeightFn, - ItemRenderFn, - NodeHeightFn, -} from './components/virtual-scroll/virtual-scroll-utils'; - -declare global { - interface HTMLStencilElement extends HTMLElement { - componentOnReady(): Promise; - componentOnReady(done: (ele?: this) => void): void; - } -} - - - -import { - ActionSheetController as IonActionSheetController -} from './components/action-sheet-controller/action-sheet-controller'; - -declare global { - interface HTMLIonActionSheetControllerElement extends IonActionSheetController, HTMLStencilElement { - } - var HTMLIonActionSheetControllerElement: { - prototype: HTMLIonActionSheetControllerElement; - new (): HTMLIonActionSheetControllerElement; - }; - interface HTMLElementTagNameMap { - "ion-action-sheet-controller": HTMLIonActionSheetControllerElement; - } - interface ElementTagNameMap { - "ion-action-sheet-controller": HTMLIonActionSheetControllerElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-action-sheet-controller": JSXElements.IonActionSheetControllerAttributes; - } - } - namespace JSXElements { - export interface IonActionSheetControllerAttributes extends HTMLAttributes { - - } - } -} - - -import { - ActionSheet as IonActionSheet -} from './components/action-sheet/action-sheet'; - -declare global { - interface HTMLIonActionSheetElement extends IonActionSheet, HTMLStencilElement { - } - var HTMLIonActionSheetElement: { - prototype: HTMLIonActionSheetElement; - new (): HTMLIonActionSheetElement; - }; - interface HTMLElementTagNameMap { - "ion-action-sheet": HTMLIonActionSheetElement; - } - interface ElementTagNameMap { - "ion-action-sheet": HTMLIonActionSheetElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-action-sheet": JSXElements.IonActionSheetAttributes; - } - } - namespace JSXElements { - export interface IonActionSheetAttributes extends HTMLAttributes { - buttons?: ActionSheetButton[]; - cssClass?: string; - enableBackdropDismiss?: boolean; - enterAnimation?: AnimationBuilder; - leaveAnimation?: AnimationBuilder; - subTitle?: string; - title?: string; - translucent?: boolean; - willAnimate?: boolean; - } - } -} - - -import { - AlertController as IonAlertController -} from './components/alert-controller/alert-controller'; - -declare global { - interface HTMLIonAlertControllerElement extends IonAlertController, HTMLStencilElement { - } - var HTMLIonAlertControllerElement: { - prototype: HTMLIonAlertControllerElement; - new (): HTMLIonAlertControllerElement; - }; - interface HTMLElementTagNameMap { - "ion-alert-controller": HTMLIonAlertControllerElement; - } - interface ElementTagNameMap { - "ion-alert-controller": HTMLIonAlertControllerElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-alert-controller": JSXElements.IonAlertControllerAttributes; - } - } - namespace JSXElements { - export interface IonAlertControllerAttributes extends HTMLAttributes { - - } - } -} - - -import { - Alert as IonAlert -} from './components/alert/alert'; - -declare global { - interface HTMLIonAlertElement extends IonAlert, HTMLStencilElement { - } - var HTMLIonAlertElement: { - prototype: HTMLIonAlertElement; - new (): HTMLIonAlertElement; - }; - interface HTMLElementTagNameMap { - "ion-alert": HTMLIonAlertElement; - } - interface ElementTagNameMap { - "ion-alert": HTMLIonAlertElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-alert": JSXElements.IonAlertAttributes; - } - } - namespace JSXElements { - export interface IonAlertAttributes extends HTMLAttributes { - buttons?: AlertButton[]; - cssClass?: string; - enableBackdropDismiss?: boolean; - enterAnimation?: AnimationBuilder; - inputs?: AlertInput[]; - leaveAnimation?: AnimationBuilder; - message?: string; - subTitle?: string; - title?: string; - translucent?: boolean; - willAnimate?: boolean; - } - } -} - - -import { - AnimationControllerImpl as IonAnimationController -} from './components/animation-controller/animation-controller'; - -declare global { - interface HTMLIonAnimationControllerElement extends IonAnimationController, HTMLStencilElement { - } - var HTMLIonAnimationControllerElement: { - prototype: HTMLIonAnimationControllerElement; - new (): HTMLIonAnimationControllerElement; - }; - interface HTMLElementTagNameMap { - "ion-animation-controller": HTMLIonAnimationControllerElement; - } - interface ElementTagNameMap { - "ion-animation-controller": HTMLIonAnimationControllerElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-animation-controller": JSXElements.IonAnimationControllerAttributes; - } - } - namespace JSXElements { - export interface IonAnimationControllerAttributes extends HTMLAttributes { - - } - } -} - - -import { - App as IonApp -} from './components/app/app'; - -declare global { - interface HTMLIonAppElement extends IonApp, HTMLStencilElement { - } - var HTMLIonAppElement: { - prototype: HTMLIonAppElement; - new (): HTMLIonAppElement; - }; - interface HTMLElementTagNameMap { - "ion-app": HTMLIonAppElement; - } - interface ElementTagNameMap { - "ion-app": HTMLIonAppElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-app": JSXElements.IonAppAttributes; - } - } - namespace JSXElements { - export interface IonAppAttributes extends HTMLAttributes { - - } - } -} - - -import { - Avatar as IonAvatar -} from './components/avatar/avatar'; - -declare global { - interface HTMLIonAvatarElement extends IonAvatar, HTMLStencilElement { - } - var HTMLIonAvatarElement: { - prototype: HTMLIonAvatarElement; - new (): HTMLIonAvatarElement; - }; - interface HTMLElementTagNameMap { - "ion-avatar": HTMLIonAvatarElement; - } - interface ElementTagNameMap { - "ion-avatar": HTMLIonAvatarElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-avatar": JSXElements.IonAvatarAttributes; - } - } - namespace JSXElements { - export interface IonAvatarAttributes extends HTMLAttributes { - - } - } -} - - -import { - BackButton as IonBackButton -} from './components/back-button/back-button'; - -declare global { - interface HTMLIonBackButtonElement extends IonBackButton, HTMLStencilElement { - } - var HTMLIonBackButtonElement: { - prototype: HTMLIonBackButtonElement; - new (): HTMLIonBackButtonElement; - }; - interface HTMLElementTagNameMap { - "ion-back-button": HTMLIonBackButtonElement; - } - interface ElementTagNameMap { - "ion-back-button": HTMLIonBackButtonElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-back-button": JSXElements.IonBackButtonAttributes; - } - } - namespace JSXElements { - export interface IonBackButtonAttributes extends HTMLAttributes { - - } - } -} - - -import { - Backdrop as IonBackdrop -} from './components/backdrop/backdrop'; - -declare global { - interface HTMLIonBackdropElement extends IonBackdrop, HTMLStencilElement { - } - var HTMLIonBackdropElement: { - prototype: HTMLIonBackdropElement; - new (): HTMLIonBackdropElement; - }; - interface HTMLElementTagNameMap { - "ion-backdrop": HTMLIonBackdropElement; - } - interface ElementTagNameMap { - "ion-backdrop": HTMLIonBackdropElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-backdrop": JSXElements.IonBackdropAttributes; - } - } - namespace JSXElements { - export interface IonBackdropAttributes extends HTMLAttributes { - mode?: 'ios' | 'md'; - } - } -} - - -import { - Badge as IonBadge -} from './components/badge/badge'; - -declare global { - interface HTMLIonBadgeElement extends IonBadge, HTMLStencilElement { - } - var HTMLIonBadgeElement: { - prototype: HTMLIonBadgeElement; - new (): HTMLIonBadgeElement; - }; - interface HTMLElementTagNameMap { - "ion-badge": HTMLIonBadgeElement; - } - interface ElementTagNameMap { - "ion-badge": HTMLIonBadgeElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-badge": JSXElements.IonBadgeAttributes; - } - } - namespace JSXElements { - export interface IonBadgeAttributes extends HTMLAttributes { - color?: string; - mode?: 'ios' | 'md'; - } - } -} - - -import { - Button as IonButton -} from './components/button/button'; - -declare global { - interface HTMLIonButtonElement extends IonButton, HTMLStencilElement { - } - var HTMLIonButtonElement: { - prototype: HTMLIonButtonElement; - new (): HTMLIonButtonElement; - }; - interface HTMLElementTagNameMap { - "ion-button": HTMLIonButtonElement; - } - interface ElementTagNameMap { - "ion-button": HTMLIonButtonElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-button": JSXElements.IonButtonAttributes; - } - } - namespace JSXElements { - export interface IonButtonAttributes extends HTMLAttributes { - buttonType?: string; - color?: string; - disabled?: boolean; - expand?: 'full' | 'block'; - fill?: 'clear' | 'outline' | 'solid' | 'default'; - href?: string; - mode?: 'ios' | 'md'; - round?: boolean; - size?: 'small' | 'default' | 'large'; - strong?: boolean; - } - } -} - - -import { - Buttons as IonButtons -} from './components/buttons/buttons'; - -declare global { - interface HTMLIonButtonsElement extends IonButtons, HTMLStencilElement { - } - var HTMLIonButtonsElement: { - prototype: HTMLIonButtonsElement; - new (): HTMLIonButtonsElement; - }; - interface HTMLElementTagNameMap { - "ion-buttons": HTMLIonButtonsElement; - } - interface ElementTagNameMap { - "ion-buttons": HTMLIonButtonsElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-buttons": JSXElements.IonButtonsAttributes; - } - } - namespace JSXElements { - export interface IonButtonsAttributes extends HTMLAttributes { - - } - } -} - - -import { - CardContent as IonCardContent -} from './components/card-content/card-content'; - -declare global { - interface HTMLIonCardContentElement extends IonCardContent, HTMLStencilElement { - } - var HTMLIonCardContentElement: { - prototype: HTMLIonCardContentElement; - new (): HTMLIonCardContentElement; - }; - interface HTMLElementTagNameMap { - "ion-card-content": HTMLIonCardContentElement; - } - interface ElementTagNameMap { - "ion-card-content": HTMLIonCardContentElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-card-content": JSXElements.IonCardContentAttributes; - } - } - namespace JSXElements { - export interface IonCardContentAttributes extends HTMLAttributes { - color?: string; - mode?: 'ios' | 'md'; - } - } -} - - -import { - CardHeader as IonCardHeader -} from './components/card-header/card-header'; - -declare global { - interface HTMLIonCardHeaderElement extends IonCardHeader, HTMLStencilElement { - } - var HTMLIonCardHeaderElement: { - prototype: HTMLIonCardHeaderElement; - new (): HTMLIonCardHeaderElement; - }; - interface HTMLElementTagNameMap { - "ion-card-header": HTMLIonCardHeaderElement; - } - interface ElementTagNameMap { - "ion-card-header": HTMLIonCardHeaderElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-card-header": JSXElements.IonCardHeaderAttributes; - } - } - namespace JSXElements { - export interface IonCardHeaderAttributes extends HTMLAttributes { - color?: string; - mode?: 'ios' | 'md'; - translucent?: boolean; - } - } -} - - -import { - CardSubtitle as IonCardSubtitle -} from './components/card-subtitle/card-subtitle'; - -declare global { - interface HTMLIonCardSubtitleElement extends IonCardSubtitle, HTMLStencilElement { - } - var HTMLIonCardSubtitleElement: { - prototype: HTMLIonCardSubtitleElement; - new (): HTMLIonCardSubtitleElement; - }; - interface HTMLElementTagNameMap { - "ion-card-subtitle": HTMLIonCardSubtitleElement; - } - interface ElementTagNameMap { - "ion-card-subtitle": HTMLIonCardSubtitleElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-card-subtitle": JSXElements.IonCardSubtitleAttributes; - } - } - namespace JSXElements { - export interface IonCardSubtitleAttributes extends HTMLAttributes { - color?: string; - mode?: 'ios' | 'md'; - } - } -} - - -import { - CardTitle as IonCardTitle -} from './components/card-title/card-title'; - -declare global { - interface HTMLIonCardTitleElement extends IonCardTitle, HTMLStencilElement { - } - var HTMLIonCardTitleElement: { - prototype: HTMLIonCardTitleElement; - new (): HTMLIonCardTitleElement; - }; - interface HTMLElementTagNameMap { - "ion-card-title": HTMLIonCardTitleElement; - } - interface ElementTagNameMap { - "ion-card-title": HTMLIonCardTitleElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-card-title": JSXElements.IonCardTitleAttributes; - } - } - namespace JSXElements { - export interface IonCardTitleAttributes extends HTMLAttributes { - color?: string; - mode?: 'ios' | 'md'; - } - } -} - - -import { - Card as IonCard -} from './components/card/card'; - -declare global { - interface HTMLIonCardElement extends IonCard, HTMLStencilElement { - } - var HTMLIonCardElement: { - prototype: HTMLIonCardElement; - new (): HTMLIonCardElement; - }; - interface HTMLElementTagNameMap { - "ion-card": HTMLIonCardElement; - } - interface ElementTagNameMap { - "ion-card": HTMLIonCardElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-card": JSXElements.IonCardAttributes; - } - } - namespace JSXElements { - export interface IonCardAttributes extends HTMLAttributes { - color?: string; - mode?: 'ios' | 'md'; - } - } -} - - -import { - Checkbox as IonCheckbox -} from './components/checkbox/checkbox'; - -declare global { - interface HTMLIonCheckboxElement extends IonCheckbox, HTMLStencilElement { - } - var HTMLIonCheckboxElement: { - prototype: HTMLIonCheckboxElement; - new (): HTMLIonCheckboxElement; - }; - interface HTMLElementTagNameMap { - "ion-checkbox": HTMLIonCheckboxElement; - } - interface ElementTagNameMap { - "ion-checkbox": HTMLIonCheckboxElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-checkbox": JSXElements.IonCheckboxAttributes; - } - } - namespace JSXElements { - export interface IonCheckboxAttributes extends HTMLAttributes { - checked?: boolean; - color?: string; - disabled?: boolean; - mode?: 'ios' | 'md'; - name?: string; - value?: string; - } - } -} - - -import { - ChipButton as IonChipButton -} from './components/chip-button/chip-button'; - -declare global { - interface HTMLIonChipButtonElement extends IonChipButton, HTMLStencilElement { - } - var HTMLIonChipButtonElement: { - prototype: HTMLIonChipButtonElement; - new (): HTMLIonChipButtonElement; - }; - interface HTMLElementTagNameMap { - "ion-chip-button": HTMLIonChipButtonElement; - } - interface ElementTagNameMap { - "ion-chip-button": HTMLIonChipButtonElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-chip-button": JSXElements.IonChipButtonAttributes; - } - } - namespace JSXElements { - export interface IonChipButtonAttributes extends HTMLAttributes { - color?: string; - disabled?: boolean; - fill?: string; - href?: string; - mode?: 'ios' | 'md'; - } - } -} - - -import { - Chip as IonChip -} from './components/chip/chip'; - -declare global { - interface HTMLIonChipElement extends IonChip, HTMLStencilElement { - } - var HTMLIonChipElement: { - prototype: HTMLIonChipElement; - new (): HTMLIonChipElement; - }; - interface HTMLElementTagNameMap { - "ion-chip": HTMLIonChipElement; - } - interface ElementTagNameMap { - "ion-chip": HTMLIonChipElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-chip": JSXElements.IonChipAttributes; - } - } - namespace JSXElements { - export interface IonChipAttributes extends HTMLAttributes { - color?: string; - mode?: 'ios' | 'md'; - } - } -} - - -import { - Col as IonCol -} from './components/col/col'; - -declare global { - interface HTMLIonColElement extends IonCol, HTMLStencilElement { - } - var HTMLIonColElement: { - prototype: HTMLIonColElement; - new (): HTMLIonColElement; - }; - interface HTMLElementTagNameMap { - "ion-col": HTMLIonColElement; - } - interface ElementTagNameMap { - "ion-col": HTMLIonColElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-col": JSXElements.IonColAttributes; - } - } - namespace JSXElements { - export interface IonColAttributes extends HTMLAttributes { - - } - } -} - - -import { - Content as IonContent -} from './components/content/content'; - -declare global { - interface HTMLIonContentElement extends IonContent, HTMLStencilElement { - } - var HTMLIonContentElement: { - prototype: HTMLIonContentElement; - new (): HTMLIonContentElement; - }; - interface HTMLElementTagNameMap { - "ion-content": HTMLIonContentElement; - } - interface ElementTagNameMap { - "ion-content": HTMLIonContentElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-content": JSXElements.IonContentAttributes; - } - } - namespace JSXElements { - export interface IonContentAttributes extends HTMLAttributes { - fullscreen?: boolean; - ionScroll?: Function; - ionScrollEnd?: Function; - ionScrollStart?: Function; - } - } -} - - -import { - CordovaPlatform as IonCordovaPlatform -} from './components/cordova-platform/cordova-platform'; - -declare global { - interface HTMLIonCordovaPlatformElement extends IonCordovaPlatform, HTMLStencilElement { - } - var HTMLIonCordovaPlatformElement: { - prototype: HTMLIonCordovaPlatformElement; - new (): HTMLIonCordovaPlatformElement; - }; - interface HTMLElementTagNameMap { - "ion-cordova-platform": HTMLIonCordovaPlatformElement; - } - interface ElementTagNameMap { - "ion-cordova-platform": HTMLIonCordovaPlatformElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-cordova-platform": JSXElements.IonCordovaPlatformAttributes; - } - } - namespace JSXElements { - export interface IonCordovaPlatformAttributes extends HTMLAttributes { - - } - } -} - - -import { - Datetime as IonDatetime -} from './components/datetime/datetime'; - -declare global { - interface HTMLIonDatetimeElement extends IonDatetime, HTMLStencilElement { - } - var HTMLIonDatetimeElement: { - prototype: HTMLIonDatetimeElement; - new (): HTMLIonDatetimeElement; - }; - interface HTMLElementTagNameMap { - "ion-datetime": HTMLIonDatetimeElement; - } - interface ElementTagNameMap { - "ion-datetime": HTMLIonDatetimeElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-datetime": JSXElements.IonDatetimeAttributes; - } - } - namespace JSXElements { - export interface IonDatetimeAttributes extends HTMLAttributes { - cancelText?: string; - dayNames?: string[] | string; - dayShortNames?: string[] | string; - dayValues?: number[] | number | string; - disabled?: boolean; - displayFormat?: string; - doneText?: string; - hourValues?: number[] | number | string; - max?: string; - min?: string; - minuteValues?: number[] | number | string; - monthNames?: string[] | string; - monthShortNames?: string[] | string; - monthValues?: number[] | number | string; - pickerFormat?: string; - pickerOptions?: PickerOptions; - placeholder?: string; - value?: string; - yearValues?: number[] | number | string; - } - } -} - - -import { - Events as IonEvents -} from './components/events/events'; - -declare global { - interface HTMLIonEventsElement extends IonEvents, HTMLStencilElement { - } - var HTMLIonEventsElement: { - prototype: HTMLIonEventsElement; - new (): HTMLIonEventsElement; - }; - interface HTMLElementTagNameMap { - "ion-events": HTMLIonEventsElement; - } - interface ElementTagNameMap { - "ion-events": HTMLIonEventsElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-events": JSXElements.IonEventsAttributes; - } - } - namespace JSXElements { - export interface IonEventsAttributes extends HTMLAttributes { - - } - } -} - - -import { - FabButton as IonFabButton -} from './components/fab-button/fab-button'; - -declare global { - interface HTMLIonFabButtonElement extends IonFabButton, HTMLStencilElement { - } - var HTMLIonFabButtonElement: { - prototype: HTMLIonFabButtonElement; - new (): HTMLIonFabButtonElement; - }; - interface HTMLElementTagNameMap { - "ion-fab-button": HTMLIonFabButtonElement; - } - interface ElementTagNameMap { - "ion-fab-button": HTMLIonFabButtonElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-fab-button": JSXElements.IonFabButtonAttributes; - } - } - namespace JSXElements { - export interface IonFabButtonAttributes extends HTMLAttributes { - activated?: boolean; - color?: string; - disabled?: boolean; - href?: string; - mode?: 'ios' | 'md'; - show?: boolean; - toggleActive?: Function; - translucent?: boolean; - } - } -} - - -import { - FabList as IonFabList -} from './components/fab-list/fab-list'; - -declare global { - interface HTMLIonFabListElement extends IonFabList, HTMLStencilElement { - } - var HTMLIonFabListElement: { - prototype: HTMLIonFabListElement; - new (): HTMLIonFabListElement; - }; - interface HTMLElementTagNameMap { - "ion-fab-list": HTMLIonFabListElement; - } - interface ElementTagNameMap { - "ion-fab-list": HTMLIonFabListElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-fab-list": JSXElements.IonFabListAttributes; - } - } - namespace JSXElements { - export interface IonFabListAttributes extends HTMLAttributes { - activated?: boolean; - } - } -} - - -import { - Fab as IonFab -} from './components/fab/fab'; - -declare global { - interface HTMLIonFabElement extends IonFab, HTMLStencilElement { - } - var HTMLIonFabElement: { - prototype: HTMLIonFabElement; - new (): HTMLIonFabElement; - }; - interface HTMLElementTagNameMap { - "ion-fab": HTMLIonFabElement; - } - interface ElementTagNameMap { - "ion-fab": HTMLIonFabElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-fab": JSXElements.IonFabAttributes; - } - } - namespace JSXElements { - export interface IonFabAttributes extends HTMLAttributes { - - } - } -} - - -import { - Footer as IonFooter -} from './components/footer/footer'; - -declare global { - interface HTMLIonFooterElement extends IonFooter, HTMLStencilElement { - } - var HTMLIonFooterElement: { - prototype: HTMLIonFooterElement; - new (): HTMLIonFooterElement; - }; - interface HTMLElementTagNameMap { - "ion-footer": HTMLIonFooterElement; - } - interface ElementTagNameMap { - "ion-footer": HTMLIonFooterElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-footer": JSXElements.IonFooterAttributes; - } - } - namespace JSXElements { - export interface IonFooterAttributes extends HTMLAttributes { - translucent?: boolean; - } - } -} - - -import { - Gesture as IonGesture -} from './components/gesture/gesture'; - -declare global { - interface HTMLIonGestureElement extends IonGesture, HTMLStencilElement { - } - var HTMLIonGestureElement: { - prototype: HTMLIonGestureElement; - new (): HTMLIonGestureElement; - }; - interface HTMLElementTagNameMap { - "ion-gesture": HTMLIonGestureElement; - } - interface ElementTagNameMap { - "ion-gesture": HTMLIonGestureElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-gesture": JSXElements.IonGestureAttributes; - } - } - namespace JSXElements { - export interface IonGestureAttributes extends HTMLAttributes { - attachTo?: ElementRef; - autoBlockAll?: boolean; - block?: string; - canStart?: GestureCallback; - direction?: string; - disabled?: boolean; - disableScroll?: boolean; - gestureName?: string; - gesturePriority?: number; - maxAngle?: number; - notCaptured?: GestureCallback; - onEnd?: GestureCallback; - onMove?: GestureCallback; - onPress?: GestureCallback; - onStart?: GestureCallback; - onWillStart?: (_: GestureDetail) => Promise; - passive?: boolean; - threshold?: number; - type?: string; - } - } -} - - -import { - Grid as IonGrid -} from './components/grid/grid'; - -declare global { - interface HTMLIonGridElement extends IonGrid, HTMLStencilElement { - } - var HTMLIonGridElement: { - prototype: HTMLIonGridElement; - new (): HTMLIonGridElement; - }; - interface HTMLElementTagNameMap { - "ion-grid": HTMLIonGridElement; - } - interface ElementTagNameMap { - "ion-grid": HTMLIonGridElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-grid": JSXElements.IonGridAttributes; - } - } - namespace JSXElements { - export interface IonGridAttributes extends HTMLAttributes { - - } - } -} - - -import { - Header as IonHeader -} from './components/header/header'; - -declare global { - interface HTMLIonHeaderElement extends IonHeader, HTMLStencilElement { - } - var HTMLIonHeaderElement: { - prototype: HTMLIonHeaderElement; - new (): HTMLIonHeaderElement; - }; - interface HTMLElementTagNameMap { - "ion-header": HTMLIonHeaderElement; - } - interface ElementTagNameMap { - "ion-header": HTMLIonHeaderElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-header": JSXElements.IonHeaderAttributes; - } - } - namespace JSXElements { - export interface IonHeaderAttributes extends HTMLAttributes { - translucent?: boolean; - } - } -} - - -import { - InfiniteScrollContent as IonInfiniteScrollContent -} from './components/infinite-scroll-content/infinite-scroll-content'; - -declare global { - interface HTMLIonInfiniteScrollContentElement extends IonInfiniteScrollContent, HTMLStencilElement { - } - var HTMLIonInfiniteScrollContentElement: { - prototype: HTMLIonInfiniteScrollContentElement; - new (): HTMLIonInfiniteScrollContentElement; - }; - interface HTMLElementTagNameMap { - "ion-infinite-scroll-content": HTMLIonInfiniteScrollContentElement; - } - interface ElementTagNameMap { - "ion-infinite-scroll-content": HTMLIonInfiniteScrollContentElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-infinite-scroll-content": JSXElements.IonInfiniteScrollContentAttributes; - } - } - namespace JSXElements { - export interface IonInfiniteScrollContentAttributes extends HTMLAttributes { - loadingSpinner?: string; - loadingText?: string; - } - } -} - - -import { - InfiniteScroll as IonInfiniteScroll -} from './components/infinite-scroll/infinite-scroll'; - -declare global { - interface HTMLIonInfiniteScrollElement extends IonInfiniteScroll, HTMLStencilElement { - } - var HTMLIonInfiniteScrollElement: { - prototype: HTMLIonInfiniteScrollElement; - new (): HTMLIonInfiniteScrollElement; - }; - interface HTMLElementTagNameMap { - "ion-infinite-scroll": HTMLIonInfiniteScrollElement; - } - interface ElementTagNameMap { - "ion-infinite-scroll": HTMLIonInfiniteScrollElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-infinite-scroll": JSXElements.IonInfiniteScrollAttributes; - } - } - namespace JSXElements { - export interface IonInfiniteScrollAttributes extends HTMLAttributes { - disabled?: boolean; - position?: string; - threshold?: string; - } - } -} - - -import { - Input as IonInput -} from './components/input/input'; - -declare global { - interface HTMLIonInputElement extends IonInput, HTMLStencilElement { - } - var HTMLIonInputElement: { - prototype: HTMLIonInputElement; - new (): HTMLIonInputElement; - }; - interface HTMLElementTagNameMap { - "ion-input": HTMLIonInputElement; - } - interface ElementTagNameMap { - "ion-input": HTMLIonInputElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-input": JSXElements.IonInputAttributes; - } - } - namespace JSXElements { - export interface IonInputAttributes extends HTMLAttributes { - accept?: string; - autocapitalize?: string; - autocomplete?: string; - autocorrect?: string; - autofocus?: boolean; - checked?: boolean; - clearInput?: boolean; - clearOnEdit?: boolean; - debounce?: number; - disabled?: boolean; - inputmode?: string; - max?: string; - maxlength?: number; - min?: string; - minlength?: number; - multiple?: boolean; - name?: string; - pattern?: string; - placeholder?: string; - readonly?: boolean; - required?: boolean; - results?: number; - size?: number; - spellcheck?: boolean; - step?: string; - type?: string; - value?: string; - } - } -} - - -import { - ItemDivider as IonItemDivider -} from './components/item-divider/item-divider'; - -declare global { - interface HTMLIonItemDividerElement extends IonItemDivider, HTMLStencilElement { - } - var HTMLIonItemDividerElement: { - prototype: HTMLIonItemDividerElement; - new (): HTMLIonItemDividerElement; - }; - interface HTMLElementTagNameMap { - "ion-item-divider": HTMLIonItemDividerElement; - } - interface ElementTagNameMap { - "ion-item-divider": HTMLIonItemDividerElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-item-divider": JSXElements.IonItemDividerAttributes; - } - } - namespace JSXElements { - export interface IonItemDividerAttributes extends HTMLAttributes { - color?: string; - mode?: 'ios' | 'md'; - } - } -} - - -import { - ItemGroup as IonItemGroup -} from './components/item-group/item-group'; - -declare global { - interface HTMLIonItemGroupElement extends IonItemGroup, HTMLStencilElement { - } - var HTMLIonItemGroupElement: { - prototype: HTMLIonItemGroupElement; - new (): HTMLIonItemGroupElement; - }; - interface HTMLElementTagNameMap { - "ion-item-group": HTMLIonItemGroupElement; - } - interface ElementTagNameMap { - "ion-item-group": HTMLIonItemGroupElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-item-group": JSXElements.IonItemGroupAttributes; - } - } - namespace JSXElements { - export interface IonItemGroupAttributes extends HTMLAttributes { - - } - } -} - - -import { - ItemOption as IonItemOption -} from './components/item-option/item-option'; - -declare global { - interface HTMLIonItemOptionElement extends IonItemOption, HTMLStencilElement { - } - var HTMLIonItemOptionElement: { - prototype: HTMLIonItemOptionElement; - new (): HTMLIonItemOptionElement; - }; - interface HTMLElementTagNameMap { - "ion-item-option": HTMLIonItemOptionElement; - } - interface ElementTagNameMap { - "ion-item-option": HTMLIonItemOptionElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-item-option": JSXElements.IonItemOptionAttributes; - } - } - namespace JSXElements { - export interface IonItemOptionAttributes extends HTMLAttributes { - color?: string; - disabled?: boolean; - href?: string; - mode?: 'ios' | 'md'; - } - } -} - - -import { - ItemOptions as IonItemOptions -} from './components/item-options/item-options'; - -declare global { - interface HTMLIonItemOptionsElement extends IonItemOptions, HTMLStencilElement { - } - var HTMLIonItemOptionsElement: { - prototype: HTMLIonItemOptionsElement; - new (): HTMLIonItemOptionsElement; - }; - interface HTMLElementTagNameMap { - "ion-item-options": HTMLIonItemOptionsElement; - } - interface ElementTagNameMap { - "ion-item-options": HTMLIonItemOptionsElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-item-options": JSXElements.IonItemOptionsAttributes; - } - } - namespace JSXElements { - export interface IonItemOptionsAttributes extends HTMLAttributes { - side?: Side; - } - } -} - - -import { - ItemSliding as IonItemSliding -} from './components/item-sliding/item-sliding'; - -declare global { - interface HTMLIonItemSlidingElement extends IonItemSliding, HTMLStencilElement { - } - var HTMLIonItemSlidingElement: { - prototype: HTMLIonItemSlidingElement; - new (): HTMLIonItemSlidingElement; - }; - interface HTMLElementTagNameMap { - "ion-item-sliding": HTMLIonItemSlidingElement; - } - interface ElementTagNameMap { - "ion-item-sliding": HTMLIonItemSlidingElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-item-sliding": JSXElements.IonItemSlidingAttributes; - } - } - namespace JSXElements { - export interface IonItemSlidingAttributes extends HTMLAttributes { - - } - } -} - - -import { - Item as IonItem -} from './components/item/item'; - -declare global { - interface HTMLIonItemElement extends IonItem, HTMLStencilElement { - } - var HTMLIonItemElement: { - prototype: HTMLIonItemElement; - new (): HTMLIonItemElement; - }; - interface HTMLElementTagNameMap { - "ion-item": HTMLIonItemElement; - } - interface ElementTagNameMap { - "ion-item": HTMLIonItemElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-item": JSXElements.IonItemAttributes; - } - } - namespace JSXElements { - export interface IonItemAttributes extends HTMLAttributes { - color?: string; - href?: string; - mode?: 'ios' | 'md'; - onclick?: (this: HTMLElement, ev: MouseEvent) => any; - tappable?: boolean; - } - } -} - - -import { - KeyboardController as IonKeyboardController -} from './components/keyboard-controller/keyboard-controller'; - -declare global { - interface HTMLIonKeyboardControllerElement extends IonKeyboardController, HTMLStencilElement { - } - var HTMLIonKeyboardControllerElement: { - prototype: HTMLIonKeyboardControllerElement; - new (): HTMLIonKeyboardControllerElement; - }; - interface HTMLElementTagNameMap { - "ion-keyboard-controller": HTMLIonKeyboardControllerElement; - } - interface ElementTagNameMap { - "ion-keyboard-controller": HTMLIonKeyboardControllerElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-keyboard-controller": JSXElements.IonKeyboardControllerAttributes; - } - } - namespace JSXElements { - export interface IonKeyboardControllerAttributes extends HTMLAttributes { - - } - } -} - - -import { - Label as IonLabel -} from './components/label/label'; - -declare global { - interface HTMLIonLabelElement extends IonLabel, HTMLStencilElement { - } - var HTMLIonLabelElement: { - prototype: HTMLIonLabelElement; - new (): HTMLIonLabelElement; - }; - interface HTMLElementTagNameMap { - "ion-label": HTMLIonLabelElement; - } - interface ElementTagNameMap { - "ion-label": HTMLIonLabelElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-label": JSXElements.IonLabelAttributes; - } - } - namespace JSXElements { - export interface IonLabelAttributes extends HTMLAttributes { - color?: string; - fixed?: boolean; - floating?: boolean; - mode?: 'ios' | 'md'; - stacked?: boolean; - } - } -} - - -import { - ListHeader as IonListHeader -} from './components/list-header/list-header'; - -declare global { - interface HTMLIonListHeaderElement extends IonListHeader, HTMLStencilElement { - } - var HTMLIonListHeaderElement: { - prototype: HTMLIonListHeaderElement; - new (): HTMLIonListHeaderElement; - }; - interface HTMLElementTagNameMap { - "ion-list-header": HTMLIonListHeaderElement; - } - interface ElementTagNameMap { - "ion-list-header": HTMLIonListHeaderElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-list-header": JSXElements.IonListHeaderAttributes; - } - } - namespace JSXElements { - export interface IonListHeaderAttributes extends HTMLAttributes { - color?: string; - mode?: 'ios' | 'md'; - } - } -} - - -import { - List as IonList -} from './components/list/list'; - -declare global { - interface HTMLIonListElement extends IonList, HTMLStencilElement { - } - var HTMLIonListElement: { - prototype: HTMLIonListElement; - new (): HTMLIonListElement; - }; - interface HTMLElementTagNameMap { - "ion-list": HTMLIonListElement; - } - interface ElementTagNameMap { - "ion-list": HTMLIonListElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-list": JSXElements.IonListAttributes; - } - } - namespace JSXElements { - export interface IonListAttributes extends HTMLAttributes { - - } - } -} - - -import { - LoadingController as IonLoadingController -} from './components/loading-controller/loading-controller'; - -declare global { - interface HTMLIonLoadingControllerElement extends IonLoadingController, HTMLStencilElement { - } - var HTMLIonLoadingControllerElement: { - prototype: HTMLIonLoadingControllerElement; - new (): HTMLIonLoadingControllerElement; - }; - interface HTMLElementTagNameMap { - "ion-loading-controller": HTMLIonLoadingControllerElement; - } - interface ElementTagNameMap { - "ion-loading-controller": HTMLIonLoadingControllerElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-loading-controller": JSXElements.IonLoadingControllerAttributes; - } - } - namespace JSXElements { - export interface IonLoadingControllerAttributes extends HTMLAttributes { - - } - } -} - - -import { - Loading as IonLoading -} from './components/loading/loading'; - -declare global { - interface HTMLIonLoadingElement extends IonLoading, HTMLStencilElement { - } - var HTMLIonLoadingElement: { - prototype: HTMLIonLoadingElement; - new (): HTMLIonLoadingElement; - }; - interface HTMLElementTagNameMap { - "ion-loading": HTMLIonLoadingElement; - } - interface ElementTagNameMap { - "ion-loading": HTMLIonLoadingElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-loading": JSXElements.IonLoadingAttributes; - } - } - namespace JSXElements { - export interface IonLoadingAttributes extends HTMLAttributes { - content?: string; - cssClass?: string; - dismissOnPageChange?: boolean; - duration?: number; - enterAnimation?: AnimationBuilder; - leaveAnimation?: AnimationBuilder; - showBackdrop?: boolean; - spinner?: string; - translucent?: boolean; - willAnimate?: boolean; - } - } -} - - -import { - MenuController as IonMenuController -} from './components/menu-controller/menu-controller'; - -declare global { - interface HTMLIonMenuControllerElement extends IonMenuController, HTMLStencilElement { - } - var HTMLIonMenuControllerElement: { - prototype: HTMLIonMenuControllerElement; - new (): HTMLIonMenuControllerElement; - }; - interface HTMLElementTagNameMap { - "ion-menu-controller": HTMLIonMenuControllerElement; - } - interface ElementTagNameMap { - "ion-menu-controller": HTMLIonMenuControllerElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-menu-controller": JSXElements.IonMenuControllerAttributes; - } - } - namespace JSXElements { - export interface IonMenuControllerAttributes extends HTMLAttributes { - - } - } -} - - -import { - MenuToggle as IonMenuToggle -} from './components/menu-toggle/menu-toggle'; - -declare global { - interface HTMLIonMenuToggleElement extends IonMenuToggle, HTMLStencilElement { - } - var HTMLIonMenuToggleElement: { - prototype: HTMLIonMenuToggleElement; - new (): HTMLIonMenuToggleElement; - }; - interface HTMLElementTagNameMap { - "ion-menu-toggle": HTMLIonMenuToggleElement; - } - interface ElementTagNameMap { - "ion-menu-toggle": HTMLIonMenuToggleElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-menu-toggle": JSXElements.IonMenuToggleAttributes; - } - } - namespace JSXElements { - export interface IonMenuToggleAttributes extends HTMLAttributes { - menu?: string; - } - } -} - - -import { - Menu as IonMenu -} from './components/menu/menu'; - -declare global { - interface HTMLIonMenuElement extends IonMenu, HTMLStencilElement { - } - var HTMLIonMenuElement: { - prototype: HTMLIonMenuElement; - new (): HTMLIonMenuElement; - }; - interface HTMLElementTagNameMap { - "ion-menu": HTMLIonMenuElement; - } - interface ElementTagNameMap { - "ion-menu": HTMLIonMenuElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-menu": JSXElements.IonMenuAttributes; - } - } - namespace JSXElements { - export interface IonMenuAttributes extends HTMLAttributes { - content?: string; - disabled?: boolean; - maxEdgeStart?: number; - menuId?: string; - persistent?: boolean; - side?: Side; - swipeEnabled?: boolean; - type?: string; - } - } -} - - -import { - ModalController as IonModalController -} from './components/modal-controller/modal-controller'; - -declare global { - interface HTMLIonModalControllerElement extends IonModalController, HTMLStencilElement { - } - var HTMLIonModalControllerElement: { - prototype: HTMLIonModalControllerElement; - new (): HTMLIonModalControllerElement; - }; - interface HTMLElementTagNameMap { - "ion-modal-controller": HTMLIonModalControllerElement; - } - interface ElementTagNameMap { - "ion-modal-controller": HTMLIonModalControllerElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-modal-controller": JSXElements.IonModalControllerAttributes; - } - } - namespace JSXElements { - export interface IonModalControllerAttributes extends HTMLAttributes { - - } - } -} - - -import { - Modal as IonModal -} from './components/modal/modal'; - -declare global { - interface HTMLIonModalElement extends IonModal, HTMLStencilElement { - } - var HTMLIonModalElement: { - prototype: HTMLIonModalElement; - new (): HTMLIonModalElement; - }; - interface HTMLElementTagNameMap { - "ion-modal": HTMLIonModalElement; - } - interface ElementTagNameMap { - "ion-modal": HTMLIonModalElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-modal": JSXElements.IonModalAttributes; - } - } - namespace JSXElements { - export interface IonModalAttributes extends HTMLAttributes { - color?: string; - component?: any; - cssClass?: string; - data?: any; - delegate?: FrameworkDelegate; - enableBackdropDismiss?: boolean; - enterAnimation?: AnimationBuilder; - leaveAnimation?: AnimationBuilder; - modalId?: number; - mode?: 'ios' | 'md'; - showBackdrop?: boolean; - willAnimate?: boolean; - } - } -} - - -import { - NavPop as IonNavPop -} from './components/nav-pop/nav-pop'; - -declare global { - interface HTMLIonNavPopElement extends IonNavPop, HTMLStencilElement { - } - var HTMLIonNavPopElement: { - prototype: HTMLIonNavPopElement; - new (): HTMLIonNavPopElement; - }; - interface HTMLElementTagNameMap { - "ion-nav-pop": HTMLIonNavPopElement; - } - interface ElementTagNameMap { - "ion-nav-pop": HTMLIonNavPopElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-nav-pop": JSXElements.IonNavPopAttributes; - } - } - namespace JSXElements { - export interface IonNavPopAttributes extends HTMLAttributes { - - } - } -} - - -import { - Nav as IonNav -} from './components/nav/nav'; - -declare global { - interface HTMLIonNavElement extends IonNav, HTMLStencilElement { - } - var HTMLIonNavElement: { - prototype: HTMLIonNavElement; - new (): HTMLIonNavElement; - }; - interface HTMLElementTagNameMap { - "ion-nav": HTMLIonNavElement; - } - interface ElementTagNameMap { - "ion-nav": HTMLIonNavElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-nav": JSXElements.IonNavAttributes; - } - } - namespace JSXElements { - export interface IonNavAttributes extends HTMLAttributes { - delegate?: FrameworkDelegate; - lazy?: boolean; - mode?: string; - root?: any; - swipeBackEnabled?: boolean; - useUrls?: boolean; - } - } -} - - -import { - Note as IonNote -} from './components/note/note'; - -declare global { - interface HTMLIonNoteElement extends IonNote, HTMLStencilElement { - } - var HTMLIonNoteElement: { - prototype: HTMLIonNoteElement; - new (): HTMLIonNoteElement; - }; - interface HTMLElementTagNameMap { - "ion-note": HTMLIonNoteElement; - } - interface ElementTagNameMap { - "ion-note": HTMLIonNoteElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-note": JSXElements.IonNoteAttributes; - } - } - namespace JSXElements { - export interface IonNoteAttributes extends HTMLAttributes { - color?: string; - mode?: 'ios' | 'md'; - } - } -} - - -import { - Page as IonPage -} from './components/page/page'; - -declare global { - interface HTMLIonPageElement extends IonPage, HTMLStencilElement { - } - var HTMLIonPageElement: { - prototype: HTMLIonPageElement; - new (): HTMLIonPageElement; - }; - interface HTMLElementTagNameMap { - "ion-page": HTMLIonPageElement; - } - interface ElementTagNameMap { - "ion-page": HTMLIonPageElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-page": JSXElements.IonPageAttributes; - } - } - namespace JSXElements { - export interface IonPageAttributes extends HTMLAttributes { - - } - } -} - - -import { - PickerColumnCmp as IonPickerColumn -} from './components/picker-column/picker-column'; - -declare global { - interface HTMLIonPickerColumnElement extends IonPickerColumn, HTMLStencilElement { - } - var HTMLIonPickerColumnElement: { - prototype: HTMLIonPickerColumnElement; - new (): HTMLIonPickerColumnElement; - }; - interface HTMLElementTagNameMap { - "ion-picker-column": HTMLIonPickerColumnElement; - } - interface ElementTagNameMap { - "ion-picker-column": HTMLIonPickerColumnElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-picker-column": JSXElements.IonPickerColumnAttributes; - } - } - namespace JSXElements { - export interface IonPickerColumnAttributes extends HTMLAttributes { - col?: PickerColumn; - } - } -} - - -import { - PickerController as IonPickerController -} from './components/picker-controller/picker-controller'; - -declare global { - interface HTMLIonPickerControllerElement extends IonPickerController, HTMLStencilElement { - } - var HTMLIonPickerControllerElement: { - prototype: HTMLIonPickerControllerElement; - new (): HTMLIonPickerControllerElement; - }; - interface HTMLElementTagNameMap { - "ion-picker-controller": HTMLIonPickerControllerElement; - } - interface ElementTagNameMap { - "ion-picker-controller": HTMLIonPickerControllerElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-picker-controller": JSXElements.IonPickerControllerAttributes; - } - } - namespace JSXElements { - export interface IonPickerControllerAttributes extends HTMLAttributes { - - } - } -} - - -import { - Picker as IonPicker -} from './components/picker/picker'; - -declare global { - interface HTMLIonPickerElement extends IonPicker, HTMLStencilElement { - } - var HTMLIonPickerElement: { - prototype: HTMLIonPickerElement; - new (): HTMLIonPickerElement; - }; - interface HTMLElementTagNameMap { - "ion-picker": HTMLIonPickerElement; - } - interface ElementTagNameMap { - "ion-picker": HTMLIonPickerElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-picker": JSXElements.IonPickerAttributes; - } - } - namespace JSXElements { - export interface IonPickerAttributes extends HTMLAttributes { - buttons?: PickerButton[]; - columns?: PickerColumn[]; - content?: string; - cssClass?: string; - dismissOnPageChange?: boolean; - duration?: number; - enableBackdropDismiss?: boolean; - enterAnimation?: AnimationBuilder; - leaveAnimation?: AnimationBuilder; - pickerId?: number; - showBackdrop?: boolean; - willAnimate?: boolean; - } - } -} - - -import { - PopoverController as IonPopoverController -} from './components/popover-controller/popover-controller'; - -declare global { - interface HTMLIonPopoverControllerElement extends IonPopoverController, HTMLStencilElement { - } - var HTMLIonPopoverControllerElement: { - prototype: HTMLIonPopoverControllerElement; - new (): HTMLIonPopoverControllerElement; - }; - interface HTMLElementTagNameMap { - "ion-popover-controller": HTMLIonPopoverControllerElement; - } - interface ElementTagNameMap { - "ion-popover-controller": HTMLIonPopoverControllerElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-popover-controller": JSXElements.IonPopoverControllerAttributes; - } - } - namespace JSXElements { - export interface IonPopoverControllerAttributes extends HTMLAttributes { - - } - } -} - - -import { - Popover as IonPopover -} from './components/popover/popover'; - -declare global { - interface HTMLIonPopoverElement extends IonPopover, HTMLStencilElement { - } - var HTMLIonPopoverElement: { - prototype: HTMLIonPopoverElement; - new (): HTMLIonPopoverElement; - }; - interface HTMLElementTagNameMap { - "ion-popover": HTMLIonPopoverElement; - } - interface ElementTagNameMap { - "ion-popover": HTMLIonPopoverElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-popover": JSXElements.IonPopoverAttributes; - } - } - namespace JSXElements { - export interface IonPopoverAttributes extends HTMLAttributes { - color?: string; - component?: string; - cssClass?: string; - data?: any; - delegate?: FrameworkDelegate; - enableBackdropDismiss?: boolean; - enterAnimation?: AnimationBuilder; - ev?: Event; - leaveAnimation?: AnimationBuilder; - mode?: 'ios' | 'md'; - popoverId?: number; - showBackdrop?: boolean; - translucent?: boolean; - willAnimate?: boolean; - } - } -} - - -import { - RadioGroup as IonRadioGroup -} from './components/radio-group/radio-group'; - -declare global { - interface HTMLIonRadioGroupElement extends IonRadioGroup, HTMLStencilElement { - } - var HTMLIonRadioGroupElement: { - prototype: HTMLIonRadioGroupElement; - new (): HTMLIonRadioGroupElement; - }; - interface HTMLElementTagNameMap { - "ion-radio-group": HTMLIonRadioGroupElement; - } - interface ElementTagNameMap { - "ion-radio-group": HTMLIonRadioGroupElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-radio-group": JSXElements.IonRadioGroupAttributes; - } - } - namespace JSXElements { - export interface IonRadioGroupAttributes extends HTMLAttributes { - allowEmptySelection?: boolean; - disabled?: boolean; - name?: string; - value?: string; - } - } -} - - -import { - Radio as IonRadio -} from './components/radio/radio'; - -declare global { - interface HTMLIonRadioElement extends IonRadio, HTMLStencilElement { - } - var HTMLIonRadioElement: { - prototype: HTMLIonRadioElement; - new (): HTMLIonRadioElement; - }; - interface HTMLElementTagNameMap { - "ion-radio": HTMLIonRadioElement; - } - interface ElementTagNameMap { - "ion-radio": HTMLIonRadioElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-radio": JSXElements.IonRadioAttributes; - } - } - namespace JSXElements { - export interface IonRadioAttributes extends HTMLAttributes { - checked?: boolean; - color?: string; - disabled?: boolean; - mode?: 'ios' | 'md'; - name?: string; - value?: string; - } - } -} - - -import { - RangeKnob as IonRangeKnob -} from './components/range-knob/range-knob'; - -declare global { - interface HTMLIonRangeKnobElement extends IonRangeKnob, HTMLStencilElement { - } - var HTMLIonRangeKnobElement: { - prototype: HTMLIonRangeKnobElement; - new (): HTMLIonRangeKnobElement; - }; - interface HTMLElementTagNameMap { - "ion-range-knob": HTMLIonRangeKnobElement; - } - interface ElementTagNameMap { - "ion-range-knob": HTMLIonRangeKnobElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-range-knob": JSXElements.IonRangeKnobAttributes; - } - } - namespace JSXElements { - export interface IonRangeKnobAttributes extends HTMLAttributes { - disabled?: boolean; - knob?: string; - labelId?: string; - max?: number; - min?: number; - pin?: boolean; - pressed?: boolean; - ratio?: number; - val?: number; - } - } -} - - -import { - Range as IonRange -} from './components/range/range'; - -declare global { - interface HTMLIonRangeElement extends IonRange, HTMLStencilElement { - } - var HTMLIonRangeElement: { - prototype: HTMLIonRangeElement; - new (): HTMLIonRangeElement; - }; - interface HTMLElementTagNameMap { - "ion-range": HTMLIonRangeElement; - } - interface ElementTagNameMap { - "ion-range": HTMLIonRangeElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-range": JSXElements.IonRangeAttributes; - } - } - namespace JSXElements { - export interface IonRangeAttributes extends HTMLAttributes { - color?: string; - debounce?: number; - disabled?: boolean; - dualKnobs?: boolean; - max?: number; - min?: number; - mode?: 'ios' | 'md'; - pin?: boolean; - snaps?: boolean; - step?: number; - value?: any; - } - } -} - - -import { - RefresherContent as IonRefresherContent -} from './components/refresher-content/refresher-content'; - -declare global { - interface HTMLIonRefresherContentElement extends IonRefresherContent, HTMLStencilElement { - } - var HTMLIonRefresherContentElement: { - prototype: HTMLIonRefresherContentElement; - new (): HTMLIonRefresherContentElement; - }; - interface HTMLElementTagNameMap { - "ion-refresher-content": HTMLIonRefresherContentElement; - } - interface ElementTagNameMap { - "ion-refresher-content": HTMLIonRefresherContentElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-refresher-content": JSXElements.IonRefresherContentAttributes; - } - } - namespace JSXElements { - export interface IonRefresherContentAttributes extends HTMLAttributes { - pullingIcon?: string; - pullingText?: string; - refreshingSpinner?: string; - refreshingText?: string; - } - } -} - - -import { - Refresher as IonRefresher -} from './components/refresher/refresher'; - -declare global { - interface HTMLIonRefresherElement extends IonRefresher, HTMLStencilElement { - } - var HTMLIonRefresherElement: { - prototype: HTMLIonRefresherElement; - new (): HTMLIonRefresherElement; - }; - interface HTMLElementTagNameMap { - "ion-refresher": HTMLIonRefresherElement; - } - interface ElementTagNameMap { - "ion-refresher": HTMLIonRefresherElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-refresher": JSXElements.IonRefresherAttributes; - } - } - namespace JSXElements { - export interface IonRefresherAttributes extends HTMLAttributes { - closeDuration?: string; - disabled?: boolean; - pullMax?: any; - pullMin?: number; - snapbackDuration?: string; - } - } -} - - -import { - ReorderGroup as IonReorderGroup -} from './components/reorder-group/reorder-group'; - -declare global { - interface HTMLIonReorderGroupElement extends IonReorderGroup, HTMLStencilElement { - } - var HTMLIonReorderGroupElement: { - prototype: HTMLIonReorderGroupElement; - new (): HTMLIonReorderGroupElement; - }; - interface HTMLElementTagNameMap { - "ion-reorder-group": HTMLIonReorderGroupElement; - } - interface ElementTagNameMap { - "ion-reorder-group": HTMLIonReorderGroupElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-reorder-group": JSXElements.IonReorderGroupAttributes; - } - } - namespace JSXElements { - export interface IonReorderGroupAttributes extends HTMLAttributes { - disabled?: boolean; - } - } -} - - -import { - Reorder as IonReorder -} from './components/reorder/reorder'; - -declare global { - interface HTMLIonReorderElement extends IonReorder, HTMLStencilElement { - } - var HTMLIonReorderElement: { - prototype: HTMLIonReorderElement; - new (): HTMLIonReorderElement; - }; - interface HTMLElementTagNameMap { - "ion-reorder": HTMLIonReorderElement; - } - interface ElementTagNameMap { - "ion-reorder": HTMLIonReorderElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-reorder": JSXElements.IonReorderAttributes; - } - } - namespace JSXElements { - export interface IonReorderAttributes extends HTMLAttributes { - - } - } -} - - -import { - RippleEffect as IonRippleEffect -} from './components/ripple-effect/ripple-effect'; - -declare global { - interface HTMLIonRippleEffectElement extends IonRippleEffect, HTMLStencilElement { - } - var HTMLIonRippleEffectElement: { - prototype: HTMLIonRippleEffectElement; - new (): HTMLIonRippleEffectElement; - }; - interface HTMLElementTagNameMap { - "ion-ripple-effect": HTMLIonRippleEffectElement; - } - interface ElementTagNameMap { - "ion-ripple-effect": HTMLIonRippleEffectElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-ripple-effect": JSXElements.IonRippleEffectAttributes; - } - } - namespace JSXElements { - export interface IonRippleEffectAttributes extends HTMLAttributes { - useTapClick?: boolean; - } - } -} - - -import { - RouteLink as IonRouteLink -} from './components/route-link/route-link'; - -declare global { - interface HTMLIonRouteLinkElement extends IonRouteLink, HTMLStencilElement { - } - var HTMLIonRouteLinkElement: { - prototype: HTMLIonRouteLinkElement; - new (): HTMLIonRouteLinkElement; - }; - interface HTMLElementTagNameMap { - "ion-route-link": HTMLIonRouteLinkElement; - } - interface ElementTagNameMap { - "ion-route-link": HTMLIonRouteLinkElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-route-link": JSXElements.IonRouteLinkAttributes; - } - } - namespace JSXElements { - export interface IonRouteLinkAttributes extends HTMLAttributes { - router?: any; - url?: string; - } - } -} - - -import { - Route as IonRoute -} from './components/route/route'; - -declare global { - interface HTMLIonRouteElement extends IonRoute, HTMLStencilElement { - } - var HTMLIonRouteElement: { - prototype: HTMLIonRouteElement; - new (): HTMLIonRouteElement; - }; - interface HTMLElementTagNameMap { - "ion-route": HTMLIonRouteElement; - } - interface ElementTagNameMap { - "ion-route": HTMLIonRouteElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-route": JSXElements.IonRouteAttributes; - } - } - namespace JSXElements { - export interface IonRouteAttributes extends HTMLAttributes { - component?: string; - path?: string; - props?: any; - } - } -} - - -import { - Router as IonRouter -} from './components/router/router'; - -declare global { -<<<<<<< Updated upstream - interface HTMLIonRouterControllerElement extends IonRouterController, HTMLStencilElement { -======= - interface HTMLIonRouterElement extends IonRouter, HTMLElement { ->>>>>>> Stashed changes - } - var HTMLIonRouterElement: { - prototype: HTMLIonRouterElement; - new (): HTMLIonRouterElement; - }; - interface HTMLElementTagNameMap { - "ion-router": HTMLIonRouterElement; - } - interface ElementTagNameMap { - "ion-router": HTMLIonRouterElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-router": JSXElements.IonRouterAttributes; - } - } - namespace JSXElements { - export interface IonRouterAttributes extends HTMLAttributes { - base?: string; - useHash?: boolean; - } - } -} - - -import { - Row as IonRow -} from './components/row/row'; - -declare global { - interface HTMLIonRowElement extends IonRow, HTMLStencilElement { - } - var HTMLIonRowElement: { - prototype: HTMLIonRowElement; - new (): HTMLIonRowElement; - }; - interface HTMLElementTagNameMap { - "ion-row": HTMLIonRowElement; - } - interface ElementTagNameMap { - "ion-row": HTMLIonRowElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-row": JSXElements.IonRowAttributes; - } - } - namespace JSXElements { - export interface IonRowAttributes extends HTMLAttributes { - - } - } -} - - -import { - Scroll as IonScroll -} from './components/scroll/scroll'; - -declare global { - interface HTMLIonScrollElement extends IonScroll, HTMLStencilElement { - } - var HTMLIonScrollElement: { - prototype: HTMLIonScrollElement; - new (): HTMLIonScrollElement; - }; - interface HTMLElementTagNameMap { - "ion-scroll": HTMLIonScrollElement; - } - interface ElementTagNameMap { - "ion-scroll": HTMLIonScrollElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-scroll": JSXElements.IonScrollAttributes; - } - } - namespace JSXElements { - export interface IonScrollAttributes extends HTMLAttributes { - disabled?: boolean; - onionScroll?: ScrollCallback; - onionScrollEnd?: ScrollCallback; - onionScrollStart?: ScrollCallback; - } - } -} - - -import { - Searchbar as IonSearchbar -} from './components/searchbar/searchbar'; - -declare global { - interface HTMLIonSearchbarElement extends IonSearchbar, HTMLStencilElement { - } - var HTMLIonSearchbarElement: { - prototype: HTMLIonSearchbarElement; - new (): HTMLIonSearchbarElement; - }; - interface HTMLElementTagNameMap { - "ion-searchbar": HTMLIonSearchbarElement; - } - interface ElementTagNameMap { - "ion-searchbar": HTMLIonSearchbarElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-searchbar": JSXElements.IonSearchbarAttributes; - } - } - namespace JSXElements { - export interface IonSearchbarAttributes extends HTMLAttributes { - animated?: boolean; - autocomplete?: string; - autocorrect?: string; - cancelButtonText?: string; - color?: string; - debounce?: number; - mode?: 'ios' | 'md'; - placeholder?: string; - showCancelButton?: boolean; - spellcheck?: boolean; - type?: string; - value?: string; - } - } -} - - -import { - SegmentButton as IonSegmentButton -} from './components/segment-button/segment-button'; - -declare global { - interface HTMLIonSegmentButtonElement extends IonSegmentButton, HTMLStencilElement { - } - var HTMLIonSegmentButtonElement: { - prototype: HTMLIonSegmentButtonElement; - new (): HTMLIonSegmentButtonElement; - }; - interface HTMLElementTagNameMap { - "ion-segment-button": HTMLIonSegmentButtonElement; - } - interface ElementTagNameMap { - "ion-segment-button": HTMLIonSegmentButtonElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-segment-button": JSXElements.IonSegmentButtonAttributes; - } - } - namespace JSXElements { - export interface IonSegmentButtonAttributes extends HTMLAttributes { - activated?: boolean; - checked?: boolean; - color?: string; - disabled?: boolean; - href?: string; - mode?: 'ios' | 'md'; - value?: string; - } - } -} - - -import { - Segment as IonSegment -} from './components/segment/segment'; - -declare global { - interface HTMLIonSegmentElement extends IonSegment, HTMLStencilElement { - } - var HTMLIonSegmentElement: { - prototype: HTMLIonSegmentElement; - new (): HTMLIonSegmentElement; - }; - interface HTMLElementTagNameMap { - "ion-segment": HTMLIonSegmentElement; - } - interface ElementTagNameMap { - "ion-segment": HTMLIonSegmentElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-segment": JSXElements.IonSegmentAttributes; - } - } - namespace JSXElements { - export interface IonSegmentAttributes extends HTMLAttributes { - color?: string; - disabled?: boolean; - mode?: 'ios' | 'md'; - value?: string; - } - } -} - - -import { - SelectOption as IonSelectOption -} from './components/select-option/select-option'; - -declare global { - interface HTMLIonSelectOptionElement extends IonSelectOption, HTMLStencilElement { - } - var HTMLIonSelectOptionElement: { - prototype: HTMLIonSelectOptionElement; - new (): HTMLIonSelectOptionElement; - }; - interface HTMLElementTagNameMap { - "ion-select-option": HTMLIonSelectOptionElement; - } - interface ElementTagNameMap { - "ion-select-option": HTMLIonSelectOptionElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-select-option": JSXElements.IonSelectOptionAttributes; - } - } - namespace JSXElements { - export interface IonSelectOptionAttributes extends HTMLAttributes { - disabled?: boolean; - selected?: boolean; - value?: string; - } - } -} - - -import { - SelectPopover as IonSelectPopover -} from './components/select-popover/select-popover'; - -declare global { - interface HTMLIonSelectPopoverElement extends IonSelectPopover, HTMLStencilElement { - } - var HTMLIonSelectPopoverElement: { - prototype: HTMLIonSelectPopoverElement; - new (): HTMLIonSelectPopoverElement; - }; - interface HTMLElementTagNameMap { - "ion-select-popover": HTMLIonSelectPopoverElement; - } - interface ElementTagNameMap { - "ion-select-popover": HTMLIonSelectPopoverElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-select-popover": JSXElements.IonSelectPopoverAttributes; - } - } - namespace JSXElements { - export interface IonSelectPopoverAttributes extends HTMLAttributes { - message?: string; - options?: SelectPopoverOption[]; - subTitle?: string; - title?: string; - } - } -} - - -import { - Select as IonSelect -} from './components/select/select'; - -declare global { - interface HTMLIonSelectElement extends IonSelect, HTMLStencilElement { - } - var HTMLIonSelectElement: { - prototype: HTMLIonSelectElement; - new (): HTMLIonSelectElement; - }; - interface HTMLElementTagNameMap { - "ion-select": HTMLIonSelectElement; - } - interface ElementTagNameMap { - "ion-select": HTMLIonSelectElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-select": JSXElements.IonSelectAttributes; - } - } - namespace JSXElements { - export interface IonSelectAttributes extends HTMLAttributes { - cancelText?: string; - disabled?: boolean; - interface?: string; - interfaceOptions?: any; - multiple?: boolean; - name?: string; - okText?: string; - placeholder?: string; - selectedText?: string; - value?: string | string[]; - } - } -} - - -import { - SkeletonText as IonSkeletonText -} from './components/skeleton-text/skeleton-text'; - -declare global { - interface HTMLIonSkeletonTextElement extends IonSkeletonText, HTMLStencilElement { - } - var HTMLIonSkeletonTextElement: { - prototype: HTMLIonSkeletonTextElement; - new (): HTMLIonSkeletonTextElement; - }; - interface HTMLElementTagNameMap { - "ion-skeleton-text": HTMLIonSkeletonTextElement; - } - interface ElementTagNameMap { - "ion-skeleton-text": HTMLIonSkeletonTextElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-skeleton-text": JSXElements.IonSkeletonTextAttributes; - } - } - namespace JSXElements { - export interface IonSkeletonTextAttributes extends HTMLAttributes { - width?: string; - } - } -} - - -import { - Slide as IonSlide -} from './components/slide/slide'; - -declare global { - interface HTMLIonSlideElement extends IonSlide, HTMLStencilElement { - } - var HTMLIonSlideElement: { - prototype: HTMLIonSlideElement; - new (): HTMLIonSlideElement; - }; - interface HTMLElementTagNameMap { - "ion-slide": HTMLIonSlideElement; - } - interface ElementTagNameMap { - "ion-slide": HTMLIonSlideElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-slide": JSXElements.IonSlideAttributes; - } - } - namespace JSXElements { - export interface IonSlideAttributes extends HTMLAttributes { - - } - } -} - - -import { - Slides as IonSlides -} from './components/slides/slides'; - -declare global { - interface HTMLIonSlidesElement extends IonSlides, HTMLStencilElement { - } - var HTMLIonSlidesElement: { - prototype: HTMLIonSlidesElement; - new (): HTMLIonSlidesElement; - }; - interface HTMLElementTagNameMap { - "ion-slides": HTMLIonSlidesElement; - } - interface ElementTagNameMap { - "ion-slides": HTMLIonSlidesElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-slides": JSXElements.IonSlidesAttributes; - } - } - namespace JSXElements { - export interface IonSlidesAttributes extends HTMLAttributes { - options?: any; - pager?: boolean; - } - } -} - - -import { - Spinner as IonSpinner -} from './components/spinner/spinner'; - -declare global { - interface HTMLIonSpinnerElement extends IonSpinner, HTMLStencilElement { - } - var HTMLIonSpinnerElement: { - prototype: HTMLIonSpinnerElement; - new (): HTMLIonSpinnerElement; - }; - interface HTMLElementTagNameMap { - "ion-spinner": HTMLIonSpinnerElement; - } - interface ElementTagNameMap { - "ion-spinner": HTMLIonSpinnerElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-spinner": JSXElements.IonSpinnerAttributes; - } - } - namespace JSXElements { - export interface IonSpinnerAttributes extends HTMLAttributes { - color?: string; - duration?: number; - mode?: 'ios' | 'md'; - name?: string; - paused?: boolean; - } - } -} - - -import { - SplitPane as IonSplitPane -} from './components/split-pane/split-pane'; - -declare global { - interface HTMLIonSplitPaneElement extends IonSplitPane, HTMLStencilElement { - } - var HTMLIonSplitPaneElement: { - prototype: HTMLIonSplitPaneElement; - new (): HTMLIonSplitPaneElement; - }; - interface HTMLElementTagNameMap { - "ion-split-pane": HTMLIonSplitPaneElement; - } - interface ElementTagNameMap { - "ion-split-pane": HTMLIonSplitPaneElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-split-pane": JSXElements.IonSplitPaneAttributes; - } - } - namespace JSXElements { - export interface IonSplitPaneAttributes extends HTMLAttributes { - disabled?: boolean; - when?: string | boolean; - } - } -} - - -import { - StatusTap as IonStatusTap -} from './components/status-tap/status-tap'; - -declare global { - interface HTMLIonStatusTapElement extends IonStatusTap, HTMLStencilElement { - } - var HTMLIonStatusTapElement: { - prototype: HTMLIonStatusTapElement; - new (): HTMLIonStatusTapElement; - }; - interface HTMLElementTagNameMap { - "ion-status-tap": HTMLIonStatusTapElement; - } - interface ElementTagNameMap { - "ion-status-tap": HTMLIonStatusTapElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-status-tap": JSXElements.IonStatusTapAttributes; - } - } - namespace JSXElements { - export interface IonStatusTapAttributes extends HTMLAttributes { - duration?: number; - } - } -} - - -import { - TabButton as IonTabButton -} from './components/tab-button/tab-button'; - -declare global { - interface HTMLIonTabButtonElement extends IonTabButton, HTMLStencilElement { - } - var HTMLIonTabButtonElement: { - prototype: HTMLIonTabButtonElement; - new (): HTMLIonTabButtonElement; - }; - interface HTMLElementTagNameMap { - "ion-tab-button": HTMLIonTabButtonElement; - } - interface ElementTagNameMap { - "ion-tab-button": HTMLIonTabButtonElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-tab-button": JSXElements.IonTabButtonAttributes; - } - } - namespace JSXElements { - export interface IonTabButtonAttributes extends HTMLAttributes { - mode?: 'ios' | 'md'; - selected?: boolean; - tab?: HTMLIonTabElement; - } - } -} - - -import { - Tab as IonTab -} from './components/tab/tab'; - -declare global { - interface HTMLIonTabElement extends IonTab, HTMLStencilElement { - } - var HTMLIonTabElement: { - prototype: HTMLIonTabElement; - new (): HTMLIonTabElement; - }; - interface HTMLElementTagNameMap { - "ion-tab": HTMLIonTabElement; - } - interface ElementTagNameMap { - "ion-tab": HTMLIonTabElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-tab": JSXElements.IonTabAttributes; - } - } - namespace JSXElements { - export interface IonTabAttributes extends HTMLAttributes { - badge?: string; - badgeStyle?: string; - btnId?: string; - disabled?: boolean; - icon?: string; - path?: string; - selected?: boolean; - show?: boolean; - tabsHideOnSubPages?: boolean; - title?: string; - } - } -} - - -import { - Tabbar as IonTabbar -} from './components/tabbar/tabbar'; - -declare global { - interface HTMLIonTabbarElement extends IonTabbar, HTMLStencilElement { - } - var HTMLIonTabbarElement: { - prototype: HTMLIonTabbarElement; - new (): HTMLIonTabbarElement; - }; - interface HTMLElementTagNameMap { - "ion-tabbar": HTMLIonTabbarElement; - } - interface ElementTagNameMap { - "ion-tabbar": HTMLIonTabbarElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-tabbar": JSXElements.IonTabbarAttributes; - } - } - namespace JSXElements { - export interface IonTabbarAttributes extends HTMLAttributes { - highlight?: boolean; - layout?: string; - placement?: string; - scrollable?: Boolean; - selectedTab?: HTMLIonTabElement; - tabs?: HTMLIonTabElement[]; - translucent?: boolean; - } - } -} - - -import { - Tabs as IonTabs -} from './components/tabs/tabs'; - -declare global { - interface HTMLIonTabsElement extends IonTabs, HTMLStencilElement { - } - var HTMLIonTabsElement: { - prototype: HTMLIonTabsElement; - new (): HTMLIonTabsElement; - }; - interface HTMLElementTagNameMap { - "ion-tabs": HTMLIonTabsElement; - } - interface ElementTagNameMap { - "ion-tabs": HTMLIonTabsElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-tabs": JSXElements.IonTabsAttributes; - } - } - namespace JSXElements { - export interface IonTabsAttributes extends HTMLAttributes { - color?: string; - name?: string; - scrollable?: boolean; - tabbarHidden?: boolean; - tabbarHighlight?: boolean; - tabbarLayout?: string; - tabbarPlacement?: string; - translucent?: boolean; - } - } -} - - -import { - TapClick as IonTapClick -} from './components/tap-click/tap-click'; - -declare global { - interface HTMLIonTapClickElement extends IonTapClick, HTMLStencilElement { - } - var HTMLIonTapClickElement: { - prototype: HTMLIonTapClickElement; - new (): HTMLIonTapClickElement; - }; - interface HTMLElementTagNameMap { - "ion-tap-click": HTMLIonTapClickElement; - } - interface ElementTagNameMap { - "ion-tap-click": HTMLIonTapClickElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-tap-click": JSXElements.IonTapClickAttributes; - } - } - namespace JSXElements { - export interface IonTapClickAttributes extends HTMLAttributes { - - } - } -} - - -import { - Text as IonText -} from './components/text/text'; - -declare global { - interface HTMLIonTextElement extends IonText, HTMLStencilElement { - } - var HTMLIonTextElement: { - prototype: HTMLIonTextElement; - new (): HTMLIonTextElement; - }; - interface HTMLElementTagNameMap { - "ion-text": HTMLIonTextElement; - } - interface ElementTagNameMap { - "ion-text": HTMLIonTextElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-text": JSXElements.IonTextAttributes; - } - } - namespace JSXElements { - export interface IonTextAttributes extends HTMLAttributes { - color?: string; - mode?: 'ios' | 'md'; - } - } -} - - -import { - Textarea as IonTextarea -} from './components/textarea/textarea'; - -declare global { - interface HTMLIonTextareaElement extends IonTextarea, HTMLStencilElement { - } - var HTMLIonTextareaElement: { - prototype: HTMLIonTextareaElement; - new (): HTMLIonTextareaElement; - }; - interface HTMLElementTagNameMap { - "ion-textarea": HTMLIonTextareaElement; - } - interface ElementTagNameMap { - "ion-textarea": HTMLIonTextareaElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-textarea": JSXElements.IonTextareaAttributes; - } - } - namespace JSXElements { - export interface IonTextareaAttributes extends HTMLAttributes { - autocapitalize?: string; - autocomplete?: string; - autofocus?: boolean; - clearOnEdit?: boolean; - cols?: number; - debounce?: number; - disabled?: boolean; - maxlength?: number; - minlength?: number; - name?: string; - placeholder?: string; - readonly?: boolean; - required?: boolean; - rows?: number; - spellcheck?: boolean; - value?: string; - wrap?: string; - } - } -} - - -import { - Thumbnail as IonThumbnail -} from './components/thumbnail/thumbnail'; - -declare global { - interface HTMLIonThumbnailElement extends IonThumbnail, HTMLStencilElement { - } - var HTMLIonThumbnailElement: { - prototype: HTMLIonThumbnailElement; - new (): HTMLIonThumbnailElement; - }; - interface HTMLElementTagNameMap { - "ion-thumbnail": HTMLIonThumbnailElement; - } - interface ElementTagNameMap { - "ion-thumbnail": HTMLIonThumbnailElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-thumbnail": JSXElements.IonThumbnailAttributes; - } - } - namespace JSXElements { - export interface IonThumbnailAttributes extends HTMLAttributes { - - } - } -} - - -import { - ToolbarTitle as IonTitle -} from './components/title/title'; - -declare global { - interface HTMLIonTitleElement extends IonTitle, HTMLStencilElement { - } - var HTMLIonTitleElement: { - prototype: HTMLIonTitleElement; - new (): HTMLIonTitleElement; - }; - interface HTMLElementTagNameMap { - "ion-title": HTMLIonTitleElement; - } - interface ElementTagNameMap { - "ion-title": HTMLIonTitleElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-title": JSXElements.IonTitleAttributes; - } - } - namespace JSXElements { - export interface IonTitleAttributes extends HTMLAttributes { - - } - } -} - - -import { - ToastController as IonToastController -} from './components/toast-controller/toast-controller'; - -declare global { - interface HTMLIonToastControllerElement extends IonToastController, HTMLStencilElement { - } - var HTMLIonToastControllerElement: { - prototype: HTMLIonToastControllerElement; - new (): HTMLIonToastControllerElement; - }; - interface HTMLElementTagNameMap { - "ion-toast-controller": HTMLIonToastControllerElement; - } - interface ElementTagNameMap { - "ion-toast-controller": HTMLIonToastControllerElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-toast-controller": JSXElements.IonToastControllerAttributes; - } - } - namespace JSXElements { - export interface IonToastControllerAttributes extends HTMLAttributes { - - } - } -} - - -import { - Toast as IonToast -} from './components/toast/toast'; - -declare global { - interface HTMLIonToastElement extends IonToast, HTMLStencilElement { - } - var HTMLIonToastElement: { - prototype: HTMLIonToastElement; - new (): HTMLIonToastElement; - }; - interface HTMLElementTagNameMap { - "ion-toast": HTMLIonToastElement; - } - interface ElementTagNameMap { - "ion-toast": HTMLIonToastElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-toast": JSXElements.IonToastAttributes; - } - } - namespace JSXElements { - export interface IonToastAttributes extends HTMLAttributes { - closeButtonText?: string; - cssClass?: string; - dismissOnPageChange?: boolean; - duration?: number; - enterAnimation?: AnimationBuilder; - leaveAnimation?: AnimationBuilder; - message?: string; - position?: string; - showCloseButton?: boolean; - toastId?: number; - translucent?: boolean; - willAnimate?: boolean; - } - } -} - - -import { - Toggle as IonToggle -} from './components/toggle/toggle'; - -declare global { - interface HTMLIonToggleElement extends IonToggle, HTMLStencilElement { - } - var HTMLIonToggleElement: { - prototype: HTMLIonToggleElement; - new (): HTMLIonToggleElement; - }; - interface HTMLElementTagNameMap { - "ion-toggle": HTMLIonToggleElement; - } - interface ElementTagNameMap { - "ion-toggle": HTMLIonToggleElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-toggle": JSXElements.IonToggleAttributes; - } - } - namespace JSXElements { - export interface IonToggleAttributes extends HTMLAttributes { - checked?: boolean; - color?: string; - disabled?: boolean; - mode?: 'ios' | 'md'; - name?: string; - value?: string; - } - } -} - - -import { - Toolbar as IonToolbar -} from './components/toolbar/toolbar'; - -declare global { - interface HTMLIonToolbarElement extends IonToolbar, HTMLStencilElement { - } - var HTMLIonToolbarElement: { - prototype: HTMLIonToolbarElement; - new (): HTMLIonToolbarElement; - }; - interface HTMLElementTagNameMap { - "ion-toolbar": HTMLIonToolbarElement; - } - interface ElementTagNameMap { - "ion-toolbar": HTMLIonToolbarElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-toolbar": JSXElements.IonToolbarAttributes; - } - } - namespace JSXElements { - export interface IonToolbarAttributes extends HTMLAttributes { - color?: string; - mode?: 'ios' | 'md'; - translucent?: boolean; - } - } -} - - -import { - VirtualScroll as IonVirtualScroll -} from './components/virtual-scroll/virtual-scroll'; - -declare global { - interface HTMLIonVirtualScrollElement extends IonVirtualScroll, HTMLStencilElement { - } - var HTMLIonVirtualScrollElement: { - prototype: HTMLIonVirtualScrollElement; - new (): HTMLIonVirtualScrollElement; - }; - interface HTMLElementTagNameMap { - "ion-virtual-scroll": HTMLIonVirtualScrollElement; - } - interface ElementTagNameMap { - "ion-virtual-scroll": HTMLIonVirtualScrollElement; - } - namespace JSX { - interface IntrinsicElements { - "ion-virtual-scroll": JSXElements.IonVirtualScrollAttributes; - } - } - namespace JSXElements { - export interface IonVirtualScrollAttributes extends HTMLAttributes { - approxFooterHeight?: number; - approxHeaderHeight?: number; - approxItemHeight?: number; - domRender?: DomRenderFn; - footerFn?: HeaderFn; - headerFn?: HeaderFn; - itemHeight?: ItemHeightFn; - itemRender?: ItemRenderFn; - items?: any[]; - nodeHeight?: NodeHeightFn; - } - } -} - -declare global { namespace JSX { interface StencilJSX {} } } diff --git a/packages/core/src/components/nav-pop/nav-pop.tsx b/packages/core/src/components/nav-pop/nav-pop.tsx index 326f35dc34..8193147e8d 100644 --- a/packages/core/src/components/nav-pop/nav-pop.tsx +++ b/packages/core/src/components/nav-pop/nav-pop.tsx @@ -1,5 +1,6 @@ import { Component, Element, Listen } from '@stencil/core'; +import { NavResult } from '../..'; @Component({ tag: 'ion-nav-pop', }) @@ -8,12 +9,12 @@ export class NavPop { @Element() element: HTMLElement; @Listen('child:click') - pop() { + pop(): Promise { const nav = this.element.closest('ion-nav') as HTMLIonNavElement; if (nav) { return nav.pop(); } - return Promise.resolve(); + return Promise.resolve(null); } render() { diff --git a/packages/core/src/components/nav/nav-interfaces.ts b/packages/core/src/components/nav/nav-interfaces.ts index a2369945e8..d43f0a9d74 100644 --- a/packages/core/src/components/nav/nav-interfaces.ts +++ b/packages/core/src/components/nav/nav-interfaces.ts @@ -36,6 +36,7 @@ export interface PublicNav { name?: string; element?: HTMLElement; parent?: PublicNav; + initialized?: boolean; } export interface NavOptions { @@ -71,9 +72,9 @@ export interface TransitionInstruction { nav?: Nav; delegate?: FrameworkDelegate; animation?: Animation; - escapeHatch?: any; + escapeHatch?: EscapeHatch; method?: string; - mountingData?: any; + mountingData?: FrameworkMountingData; } export interface NavResult { @@ -86,6 +87,18 @@ export interface ComponentDataPair { data: any; } +export interface ExternalNavData { + url: string; + method: string; + resolve: Function; + reject: Function; +} + +export interface EscapeHatch { + fromExternalRouter?: boolean; + url?: string; +} + export interface Transition extends Animation { enteringView?: ViewController; leavingView?: ViewController; diff --git a/packages/core/src/components/nav/nav-utils.ts b/packages/core/src/components/nav/nav-utils.ts index 51cd12458c..5d9d60cc1f 100644 --- a/packages/core/src/components/nav/nav-utils.ts +++ b/packages/core/src/components/nav/nav-utils.ts @@ -29,22 +29,12 @@ export let VIEW_ID_START = 2000; let transitionIds = 0; const activeTransitions = new Map(); -let portalZindex = 9999; - export function isViewController(object: any): boolean { return !!(object && object.didLoad && object.willUnload); } export function setZIndex(nav: Nav, enteringView: ViewController, leavingView: ViewController, direction: string) { if (enteringView) { - if (nav.isPortal) { - if (direction === DIRECTION_FORWARD) { - // TODO - fix typing - updateZIndex(enteringView, (nav as any).zIndexOffset + portalZindex); - } - portalZindex++; - return; - } leavingView = leavingView || nav.getPrevious(enteringView) as ViewController; diff --git a/packages/core/src/components/nav/nav.tsx b/packages/core/src/components/nav/nav.tsx index 95bc687cbe..31156be6cf 100644 --- a/packages/core/src/components/nav/nav.tsx +++ b/packages/core/src/components/nav/nav.tsx @@ -5,12 +5,16 @@ import { AnimationOptions, ComponentDataPair, Config, + EscapeHatch, + ExternalNavData, FrameworkDelegate, NavOptions, NavOutlet, NavResult, PublicNav, PublicViewController, + RouterDelegate, + RouterEntries, Transition, TransitionInstruction, } from '../../index'; @@ -40,12 +44,14 @@ import { } from './nav-utils'; import { DomFrameworkDelegate } from '../../utils/dom-framework-delegate'; +import { DomRouterDelegate } from '../../utils/dom-router-delegate'; import { assert, focusOutActiveElement, isDef, isNumber, + normalizeUrl, } from '../../utils/helpers'; @@ -53,8 +59,8 @@ import { buildIOSTransition } from './transitions/transition.ios'; import { buildMdTransition } from './transitions/transition.md'; import { GestureDetail } from '../gesture/gesture'; -const queueMap = new Map(); -const urlMap = new Map(); +const transitionQueue = new Map(); +const allTransitionsCompleteHandlerQueue = new Map(); /* it is very important to keep this class in sync with ./nav-interface interface */ @Component({ @@ -67,21 +73,23 @@ export class Nav implements PublicNav, NavOutlet { @Event() navInit: EventEmitter; @Event() ionNavChanged: EventEmitter; - navId: number; - init = false; - parent: Nav; + useRouter = false; + navId = getNextNavId(); + routes: RouterEntries = []; + parent: Nav = null; views: ViewController[] = []; - transitioning?: boolean; - destroyed?: boolean; - transitionId?: number; - isViewInitialized?: boolean; - isPortal: boolean; + transitioning = false; + destroyed = false; + transitionId = NOT_TRANSITIONING_TRANSITION_ID; + initialized = false; sbTrns: any; // TODO Transition childNavs?: Nav[]; + urlExternalNavMap = new Map(); @Prop() mode: string; @Prop() root: any; @Prop() delegate: FrameworkDelegate; + @Prop() routerDelegate: RouterDelegate; @Prop() useUrls = false; @Prop({ context: 'config' }) config: Config; @Prop({ connect: 'ion-animation-controller' }) animationCtrl: AnimationController; @@ -93,20 +101,15 @@ export class Nav implements PublicNav, NavOutlet { } componentDidLoad() { - if (this.init) { - return; - } - this.init = true; - if (!this.lazy) { - componentDidLoadImpl(this); - } + return componentDidLoadImpl(this); } @Watch('root') - updateRootComponent(): any { - if (this.init) { + updateRootComponent(): Promise { + if (this.initialized) { return this.setRoot(this.root); } + return Promise.resolve(null); } @Method() @@ -115,52 +118,52 @@ export class Nav implements PublicNav, NavOutlet { } @Method() - push(component: any, data?: any, opts?: NavOptions, escapeHatch: any = {}): Promise { + push(component: any, data?: any, opts?: NavOptions, escapeHatch: EscapeHatch = getDefaultEscapeHatch()): Promise { return pushImpl(this, component, data, opts, escapeHatch); } @Method() - pop(opts?: NavOptions, escapeHatch: any = {}): Promise { + pop(opts?: NavOptions, escapeHatch: EscapeHatch = getDefaultEscapeHatch()): Promise { return popImpl(this, opts, escapeHatch); } @Method() - setRoot(component: any, data?: any, opts?: NavOptions, escapeHatch: any = {}): Promise { + setRoot(component: any, data?: any, opts?: NavOptions, escapeHatch: EscapeHatch = getDefaultEscapeHatch()): Promise { return setRootImpl(this, component, data, opts, escapeHatch); } @Method() - insert(insertIndex: number, page: any, params?: any, opts?: NavOptions, escapeHatch: any = {}): Promise { + insert(insertIndex: number, page: any, params?: any, opts?: NavOptions, escapeHatch: EscapeHatch = getDefaultEscapeHatch()): Promise { return insertImpl(this, insertIndex, page, params, opts, escapeHatch); } @Method() - insertPages(insertIndex: number, insertPages: any[], opts?: NavOptions, escapeHatch: any = {}): Promise { + insertPages(insertIndex: number, insertPages: any[], opts?: NavOptions, escapeHatch: EscapeHatch = getDefaultEscapeHatch()): Promise { return insertPagesImpl(this, insertIndex, insertPages, opts, escapeHatch); } @Method() - popToRoot(opts?: NavOptions, escapeHatch: any = {}): Promise { + popToRoot(opts?: NavOptions, escapeHatch: EscapeHatch = getDefaultEscapeHatch()): Promise { return popToRootImpl(this, opts, escapeHatch); } @Method() - popTo(indexOrViewCtrl: any, opts?: NavOptions, escapeHatch: any = {}): Promise { + popTo(indexOrViewCtrl: any, opts?: NavOptions, escapeHatch: EscapeHatch = getDefaultEscapeHatch()): Promise { return popToImpl(this, indexOrViewCtrl, opts, escapeHatch); } @Method() - removeIndex(startIndex: number, removeCount?: number, opts?: NavOptions, escapeHatch: any = {}): Promise { + removeIndex(startIndex: number, removeCount?: number, opts?: NavOptions, escapeHatch: EscapeHatch = getDefaultEscapeHatch()): Promise { return removeImpl(this, startIndex, removeCount, opts, escapeHatch); } @Method() - removeView(viewController: PublicViewController, opts?: NavOptions, escapeHatch: any = {}): Promise { + removeView(viewController: PublicViewController, opts?: NavOptions, escapeHatch: EscapeHatch = getDefaultEscapeHatch()): Promise { return removeViewImpl(this, viewController, opts, escapeHatch); } @Method() - setPages(componentDataPairs: ComponentDataPair[], opts?: NavOptions, escapeHatch: any = {}): Promise { + setPages(componentDataPairs: ComponentDataPair[], opts?: NavOptions, escapeHatch: EscapeHatch = getDefaultEscapeHatch()): Promise { return setPagesImpl(this, componentDataPairs, opts, escapeHatch); } @@ -190,10 +193,11 @@ export class Nav implements PublicNav, NavOutlet { } @Method() - setRouteId(id: string, _: any = {}): Promise { + setRouteId(id: string, _: any = {}): Promise { + assert(this.useRouter, 'routing is disabled'); const active = this.getActive(); if (active && active.component === id) { - return Promise.resolve(); + return Promise.resolve(null); } return this.setRoot(id); } @@ -224,7 +228,7 @@ export class Nav implements PublicNav, NavOutlet { @Method() isTransitioning() { - return !!this.transitionId; + return this.transitionId >= 0; } @Method() @@ -238,13 +242,8 @@ export class Nav implements PublicNav, NavOutlet { } @Method() - getTransitionInfoForUrl(url: string): TransitionInstruction { - return urlMap.get(url); - } - - @Method() - clearTransitionInfoForUrl(url: string) { - urlMap.delete(url); + onAllTransitionsComplete() { + return allTransitionsCompleteImpl(this); } canSwipeBack(): boolean { @@ -330,48 +329,60 @@ export class Nav implements PublicNav, NavOutlet { } export function componentDidLoadImpl(nav: Nav) { + if (nav.initialized) { + return; + } + nav.initialized = true; nav.navInit.emit(); - if (nav.root) { - nav.setRoot(nav.root); + if (!nav.useRouter) { + if (nav.root && !nav.lazy) { + nav.setRoot(nav.root); + } } } -export async function pushImpl(nav: Nav, component: any, data: any, opts: NavOptions, escapeHatch: any) { +export async function pushImpl(nav: Nav, component: any, data: any, opts: NavOptions, escapeHatch: EscapeHatch) { const animation = await hydrateAnimationController(nav.animationCtrl); - return push(nav, nav.delegate, animation, component, data, opts, escapeHatch); + return push(nav, nav.delegate, animation, component, data, opts, escapeHatch).then((navResult) => { + return navResult; + }); } -export async function popImpl(nav: Nav, opts: NavOptions, escapeHatch: any) { +export async function popImpl(nav: Nav, opts: NavOptions, escapeHatch: EscapeHatch) { const animation = await hydrateAnimationController(nav.animationCtrl); - return pop(nav, nav.delegate, animation, opts, escapeHatch); + return pop(nav, nav.delegate, animation, opts, escapeHatch).then((navResult) => { + return navResult; + }); } -export async function setRootImpl(nav: Nav, component: any, data: any, opts: NavOptions, escapeHatch: any) { +export async function setRootImpl(nav: Nav, component: any, data: any, opts: NavOptions, escapeHatch: EscapeHatch) { const animation = await hydrateAnimationController(nav.animationCtrl); - return setRoot(nav, nav.delegate, animation, component, data, opts, escapeHatch); + return setRoot(nav, nav.delegate, animation, component, data, opts, escapeHatch).then((navResult) => { + return navResult; + }); } -export async function insertImpl(nav: Nav, insertIndex: number, page: any, params: any, opts: NavOptions, escapeHatch: any) { +export async function insertImpl(nav: Nav, insertIndex: number, page: any, params: any, opts: NavOptions, escapeHatch: EscapeHatch) { const animation = await hydrateAnimationController(nav.animationCtrl); return insert(nav, nav.delegate, animation, insertIndex, page, params, opts, escapeHatch); } -export async function insertPagesImpl(nav: Nav, insertIndex: number, pagesToInsert: any[], opts: NavOptions, escapeHatch: any) { +export async function insertPagesImpl(nav: Nav, insertIndex: number, pagesToInsert: any[], opts: NavOptions, escapeHatch: EscapeHatch) { const animation = await hydrateAnimationController(nav.animationCtrl); return insertPages(nav, nav.delegate, animation, insertIndex, pagesToInsert, opts, escapeHatch); } -export async function popToRootImpl(nav: Nav, opts: NavOptions, escapeHatch: any) { +export async function popToRootImpl(nav: Nav, opts: NavOptions, escapeHatch: EscapeHatch) { const animation = await hydrateAnimationController(nav.animationCtrl); return popToRoot(nav, nav.delegate, animation, opts, escapeHatch); } -export async function popToImpl(nav: Nav, indexOrViewCtrl: any, opts: NavOptions, escapeHatch: any) { +export async function popToImpl(nav: Nav, indexOrViewCtrl: any, opts: NavOptions, escapeHatch: EscapeHatch) { const animation = await hydrateAnimationController(nav.animationCtrl); return popTo(nav, nav.delegate, animation, indexOrViewCtrl, opts, escapeHatch); } -export async function removeImpl(nav: Nav, startIndex: number, removeCount: number, opts: NavOptions, escapeHatch: any) { +export async function removeImpl(nav: Nav, startIndex: number, removeCount: number, opts: NavOptions, escapeHatch: EscapeHatch) { const animation = await hydrateAnimationController(nav.animationCtrl); return remove(nav, nav.delegate, animation, startIndex, removeCount, opts, escapeHatch); } @@ -381,9 +392,9 @@ export async function removeViewImpl(nav: Nav, viewController: PublicViewControl return removeView(nav, nav.delegate, animation, viewController as ViewController, opts, escapeHatch); } -export async function setPagesImpl(nav: Nav, componentDataPairs: ComponentDataPair[], opts: NavOptions, escapeHatch: any) { +export async function setPagesImpl(nav: Nav, componentDataPairs: ComponentDataPair[], opts: NavOptions, escapeHatch: EscapeHatch) { const animation = await hydrateAnimationController(nav.animationCtrl); - return setPages(nav, nav.delegate, animation, componentDataPairs, opts, escapeHatch); + return setPages(nav, nav.delegate, animation, componentDataPairs, opts, escapeHatch, null); } export function canGoBackImpl(nav: Nav) { @@ -407,11 +418,10 @@ export function hydrateAnimationController(animationController: AnimationControl return animationController.create(); } - // public api -export function push(nav: Nav, delegate: FrameworkDelegate, animation: Animation, component: any, data: any, opts: NavOptions, escapeHatch: any): Promise { - return queueTransaction({ +export function push(nav: Nav, delegate: FrameworkDelegate, animation: Animation, component: any, data: any, opts: NavOptions, escapeHatch: EscapeHatch): Promise { + return preprocessTransaction({ component: component, insertStart: -1, insertViews: [{component, data}], @@ -421,12 +431,12 @@ export function push(nav: Nav, delegate: FrameworkDelegate, animation: Animation id: nav.navId, animation, escapeHatch, - method: 'push' + method: PUSH }); } -export function insert(nav: Nav, delegate: FrameworkDelegate, animation: Animation, insertIndex: number, component: any, data: any, opts: NavOptions, escapeHatch: any): Promise { - return queueTransaction({ +export function insert(nav: Nav, delegate: FrameworkDelegate, animation: Animation, insertIndex: number, component: any, data: any, opts: NavOptions, escapeHatch: EscapeHatch): Promise { + return preprocessTransaction({ component: component, insertStart: insertIndex, insertViews: [{ component, data }], @@ -440,8 +450,8 @@ export function insert(nav: Nav, delegate: FrameworkDelegate, animation: Animati }); } -export function insertPages(nav: Nav, delegate: FrameworkDelegate, animation: Animation, insertIndex: number, insertPages: any[], opts: NavOptions, escapeHatch: any): Promise { - return queueTransaction({ +export function insertPages(nav: Nav, delegate: FrameworkDelegate, animation: Animation, insertIndex: number, insertPages: any[], opts: NavOptions, escapeHatch: EscapeHatch): Promise { + return preprocessTransaction({ component: null, insertStart: insertIndex, insertViews: insertPages, @@ -455,8 +465,8 @@ export function insertPages(nav: Nav, delegate: FrameworkDelegate, animation: An }); } -export function pop(nav: Nav, delegate: FrameworkDelegate, animation: Animation, opts: NavOptions, escapeHatch: any): Promise { - return queueTransaction({ +export function pop(nav: Nav, delegate: FrameworkDelegate, animation: Animation, opts: NavOptions, escapeHatch: EscapeHatch): Promise { + return preprocessTransaction({ component: null, removeStart: -1, removeCount: 1, @@ -466,12 +476,12 @@ export function pop(nav: Nav, delegate: FrameworkDelegate, animation: Animation, id: nav.navId, animation, escapeHatch, - method: 'pop' + method: POP }); } -export function popToRoot(nav: Nav, delegate: FrameworkDelegate, animation: Animation, opts: NavOptions, escapeHatch: any): Promise { - return queueTransaction({ +export function popToRoot(nav: Nav, delegate: FrameworkDelegate, animation: Animation, opts: NavOptions, escapeHatch: EscapeHatch): Promise { + return preprocessTransaction({ component: null, removeStart: 1, removeCount: -1, @@ -485,7 +495,7 @@ export function popToRoot(nav: Nav, delegate: FrameworkDelegate, animation: Anim }); } -export function popTo(nav: Nav, delegate: FrameworkDelegate, animation: Animation, indexOrViewCtrl: any, opts: NavOptions, escapeHatch: any): Promise { +export function popTo(nav: Nav, delegate: FrameworkDelegate, animation: Animation, indexOrViewCtrl: any, opts: NavOptions, escapeHatch: EscapeHatch): Promise { const config: TransitionInstruction = { component: null, removeStart: -1, @@ -504,11 +514,11 @@ export function popTo(nav: Nav, delegate: FrameworkDelegate, animation: Animatio } else if (isNumber(indexOrViewCtrl)) { config.removeStart = indexOrViewCtrl + 1; } - return queueTransaction(config); + return preprocessTransaction(config); } -export function remove(nav: Nav, delegate: FrameworkDelegate, animation: Animation, startIndex: number, removeCount = 1, opts: NavOptions, escapeHatch: any): Promise { - return queueTransaction({ +export function remove(nav: Nav, delegate: FrameworkDelegate, animation: Animation, startIndex: number, removeCount = 1, opts: NavOptions, escapeHatch: EscapeHatch): Promise { + return preprocessTransaction({ component: null, removeStart: startIndex, removeCount: removeCount, @@ -522,8 +532,8 @@ export function remove(nav: Nav, delegate: FrameworkDelegate, animation: Animati }); } -export function removeView(nav: Nav, delegate: FrameworkDelegate, animation: Animation, viewController: ViewController, opts: NavOptions, escapeHatch: any): Promise { - return queueTransaction({ +export function removeView(nav: Nav, delegate: FrameworkDelegate, animation: Animation, viewController: ViewController, opts: NavOptions, escapeHatch: EscapeHatch): Promise { + return preprocessTransaction({ component: null, removeView: viewController, removeStart: 0, @@ -538,18 +548,18 @@ export function removeView(nav: Nav, delegate: FrameworkDelegate, animation: Ani }); } -export function setRoot(nav: Nav, delegate: FrameworkDelegate, animation: Animation, component: any, data: any, opts: NavOptions, escapeHatch: any): Promise { - return setPages(nav, delegate, animation, [{ component, data }], opts, escapeHatch); +export function setRoot(nav: Nav, delegate: FrameworkDelegate, animation: Animation, component: any, data: any, opts: NavOptions, escapeHatch: EscapeHatch): Promise { + return setPages(nav, delegate, animation, [{ component, data }], opts, escapeHatch, SET_ROOT); } -export function setPages(nav: Nav, delegate: FrameworkDelegate, animation: Animation, componentDataPairs: ComponentDataPair[], opts: NavOptions, escapeHatch: any): Promise { +export function setPages(nav: Nav, delegate: FrameworkDelegate, animation: Animation, componentDataPairs: ComponentDataPair[], opts: NavOptions, escapeHatch: EscapeHatch, methodName: string): Promise { if (!isDef(opts)) { opts = {}; } if (opts.animate !== true) { opts.animate = false; } - return queueTransaction({ + return preprocessTransaction({ component: componentDataPairs.length === 1 ? componentDataPairs[0].component : null, insertStart: 0, insertViews: componentDataPairs, @@ -561,22 +571,49 @@ export function setPages(nav: Nav, delegate: FrameworkDelegate, animation: Anima id: nav.navId, animation, escapeHatch, - method: 'setPages' + method: methodName ? methodName : 'setPages' }); } -// private api, exported for testing - -export function queueOrNavigate(ti: TransitionInstruction): void | Promise { - if (isComponentUrl(ti.component)) { - urlMap.set(ti.component as string, ti); - window.location.href = ti.component; +export function preprocessTransaction(ti: TransitionInstruction): Promise { + if (isUrl(ti.component)) { + if (ti.method === PUSH || ti.method === POP || ti.method === SET_ROOT) { + return navigateToUrl(ti.nav, normalizeUrl(ti.component) as string, ti.method); + } else { + return Promise.reject(new Error('only push, pop, and setRoot methods support urls')); + } } + + const response = checkIfPopRedirectRequired(ti); + if (response.required) { + return navigateToUrl(ti.nav, response.url, POP); + } + return queueTransaction(ti); } -export function isComponentUrl(component: any) { - return component && typeof component === 'string' && component.charAt(0) === '/'; +export function isUrl(component: any): boolean { + return typeof component === 'string' && component.charAt(0) === '/'; +} + +export function navigateToUrl(nav: Nav, url: string, method: string): Promise { + let routingPromise: Promise = null; + return new Promise((resolve, reject) => { + nav.urlExternalNavMap.set(url, { + url, + method, + resolve, + reject + }); + if (!nav.routerDelegate) { + nav.routerDelegate = new DomRouterDelegate(); + } + routingPromise = nav.routerDelegate.pushUrlState(url); + }).then((navResult: NavResult) => { + return routingPromise.then(() => { + return navResult; + }); + }); } export function queueTransaction(ti: TransitionInstruction): Promise { @@ -617,16 +654,68 @@ export function nextTransaction(nav: Nav): Promise { const topTransaction = getTopTransaction(nav.navId); if (!topTransaction) { + // cool, there are no transitions going for this nav + processAllTransitionCompleteQueue(nav.navId); return Promise.resolve(); } return doNav(nav, topTransaction); } +export function checkIfPopRedirectRequired(ti: TransitionInstruction): IsRedirectRequired { + if (ti.method === POP) { + + if (ti.escapeHatch.fromExternalRouter) { + // if the pop method is called from a router, that means the redirect already happened + // so just do a normal pop because the url is in a good place. Basically, the router is telling us to + // pop + return { + required: false + }; + } + + // check if we need to redirect to a url for the pop operation + const popToIndex = ti.nav.views.length - 2; + if (popToIndex >= 0) { + const viewController = ti.nav.views[popToIndex]; + return { + required: viewController.fromExternalRouter, + url: viewController.url + }; + } + } + + return { + required: false, + }; +} + +export function processAllTransitionCompleteQueue(navId: number) { + const queue = allTransitionsCompleteHandlerQueue.get(navId) || []; + for (const callback of queue) { + callback(); + } + allTransitionsCompleteHandlerQueue.set(navId, []); +} + +export function allTransitionsCompleteImpl(nav: Nav) { + return new Promise((resolve) => { + const queue = transitionQueue.get(nav.navId) || []; + if (queue.length) { + // there are pending transitions, so queue it up and we'll be notified when it's done + const handlers = allTransitionsCompleteHandlerQueue.get(nav.navId) || []; + handlers.push(resolve); + return allTransitionsCompleteHandlerQueue.set(nav.navId, handlers); + } + // there are no pending transitions, so just resolve right away + return resolve(); + }); +} + export function doNav(nav: Nav, ti: TransitionInstruction) { let enteringView: ViewController; let leavingView: ViewController; - return initializeViewBeforeTransition(nav, ti).then(([_enteringView, _leavingView]) => { + return initializeViewBeforeTransition(ti).then(([_enteringView, _leavingView]) => { enteringView = _enteringView; leavingView = _leavingView; return attachViewToDom(nav, enteringView, ti); @@ -647,8 +736,8 @@ export function successfullyTransitioned(ti: TransitionInstruction) { return fireError(new Error('Queue is null, the nav must have been destroyed'), ti); } - ti.nav.isViewInitialized = true; - ti.nav.transitionId = null; + ti.nav.initialized = true; + ti.nav.transitionId = NOT_TRANSITIONING_TRANSITION_ID; ti.nav.transitioning = false; // TODO - check if it's a swipe back @@ -739,7 +828,7 @@ export function loadViewAndTransition(nav: Nav, enteringView: ViewController, le export function executeAsyncTransition(nav: Nav, transition: Transition, enteringView: ViewController, leavingView: ViewController, delegate: FrameworkDelegate, opts: NavOptions, configShouldAnimate: boolean): Promise { assert(nav.transitioning, 'must be transitioning'); - nav.transitionId = null; + nav.transitionId = NOT_TRANSITIONING_TRANSITION_ID; setZIndex(nav, enteringView, leavingView, opts.direction); // always ensure the entering view is viewable @@ -751,8 +840,8 @@ export function executeAsyncTransition(nav: Nav, transition: Transition, enterin // ******** DOM WRITE **************** leavingView && toggleHidden(leavingView.element, false); - const isFirstPage = !nav.isViewInitialized && nav.views.length === 1; - const shouldNotAnimate = isFirstPage && !nav.isPortal; + const isFirstPage = !nav.initialized && nav.views.length === 1; + const shouldNotAnimate = isFirstPage; if (configShouldAnimate || shouldNotAnimate) { opts.animate = false; } @@ -847,7 +936,7 @@ export function cleanUpView(nav: Nav, delegate: FrameworkDelegate, activeViewCon // this view comes after the active view inactiveViewController.willUnload(); promises.push(destroyView(nav, delegate, inactiveViewController)); - } else if ( i < activeIndex && !nav.isPortal) { + } else if ( i < activeIndex) { // this view comes before the active view // and it is not a portal then ensure it is hidden toggleHidden(inactiveViewController.element, true); @@ -875,11 +964,11 @@ export function attachViewToDom(nav: Nav, enteringView: ViewController, ti: Tran return Promise.resolve(); } -export function initializeViewBeforeTransition(nav: Nav, ti: TransitionInstruction): Promise { +export function initializeViewBeforeTransition(ti: TransitionInstruction): Promise { let leavingView: ViewController = null; let enteringView: ViewController = null; return startTransaction(ti).then(() => { - const viewControllers = convertComponentToViewController(nav, ti); + const viewControllers = convertComponentToViewController(ti); ti.viewControllers = viewControllers; leavingView = ti.nav.getActive() as ViewController; enteringView = getEnteringView(ti, ti.nav, leavingView); @@ -925,7 +1014,7 @@ export function updateNavStacks(enteringView: ViewController, leavingView: ViewC const finalBalance = ti.nav.views.length + (ti.insertViews ? ti.insertViews.length : 0) - (ti.removeCount ? ti.removeCount : 0); assert(finalBalance >= 0, 'final balance can not be negative'); - if (finalBalance === 0 && !ti.nav.isPortal) { + if (finalBalance === 0) { console.warn(`You can't remove all the pages in the navigation stack. nav.pop() is probably called too many times.`); throw new Error('Navigation stack needs at least one root page'); } @@ -1001,7 +1090,7 @@ export function insertViewIntoNav(nav: Nav, view: ViewController, index: number) assert(view.nav === nav, 'view is not part of the nav'); nav.views.splice(index, 0, nav.views.splice(existingIndex, 1)[0]); } else { - assert(!view.nav || (nav.isPortal && view.nav === nav), 'nav is used'); + assert(!view.nav, 'nav is used'); // this is a new view to add to the stack // create the new entering view view.nav = nav; @@ -1117,17 +1206,18 @@ export function getEnteringView(ti: TransitionInstruction, nav: Nav, leavingView return null; } -export function convertViewsToViewControllers(pairs: ComponentDataPair[]): ViewController[] { +export function convertViewsToViewControllers(pairs: ComponentDataPair[], escapeHatch: EscapeHatch): ViewController[] { return pairs.filter(pair => !!pair) .map(pair => { - return new ViewController(pair.component, pair.data); + const applyEscapeHatch = pair === pairs[pairs.length - 1]; + return new ViewController(pair.component, pair.data, applyEscapeHatch ? escapeHatch.fromExternalRouter : false, applyEscapeHatch ? escapeHatch.url : null); }); } -export function convertComponentToViewController(_: Nav, ti: TransitionInstruction): ViewController[] { +export function convertComponentToViewController(ti: TransitionInstruction): ViewController[] { if (ti.insertViews) { assert(ti.insertViews.length > 0, 'length can not be zero'); - const viewControllers = convertViewsToViewControllers(ti.insertViews); + const viewControllers = convertViewsToViewControllers(ti.insertViews, ti.escapeHatch); assert(ti.insertViews.length === viewControllers.length, 'lengths does not match'); if (viewControllers.length === 0) { throw new Error('No views to insert'); @@ -1147,17 +1237,17 @@ export function convertComponentToViewController(_: Nav, ti: TransitionInstructi } export function addToQueue(ti: TransitionInstruction) { - const list = queueMap.get(ti.id) || []; + const list = transitionQueue.get(ti.id) || []; list.push(ti); - queueMap.set(ti.id, list); + transitionQueue.set(ti.id, list); } export function getQueue(id: number) { - return queueMap.get(id) || []; + return transitionQueue.get(id) || []; } export function resetQueue(id: number) { - queueMap.set(id, []); + transitionQueue.set(id, []); } export function getTopTransaction(id: number) { @@ -1167,7 +1257,7 @@ export function getTopTransaction(id: number) { } const tmp = queue.concat(); const toReturn = tmp.shift(); - queueMap.set(id, tmp); + transitionQueue.set(id, tmp); return toReturn; } @@ -1177,6 +1267,7 @@ export function getDefaultTransition(config: Config) { let viewIds = VIEW_ID_START; const DISABLE_APP_MINIMUM_DURATION = 64; +const NOT_TRANSITIONING_TRANSITION_ID = -1; export interface NavEvent extends CustomEvent { target: HTMLIonNavElement; @@ -1186,3 +1277,18 @@ export interface NavEvent extends CustomEvent { export interface NavEventDetail { isPop?: boolean; } + +export function getDefaultEscapeHatch(): EscapeHatch { + return { + fromExternalRouter: false, + }; +} + +export interface IsRedirectRequired { + required: boolean; + url?: string; +} + +export const POP = 'pop'; +export const PUSH = 'push'; +export const SET_ROOT = 'setRoot'; diff --git a/packages/core/src/components/nav/readme.md b/packages/core/src/components/nav/readme.md index 912de220a0..624110cd1e 100644 --- a/packages/core/src/components/nav/readme.md +++ b/packages/core/src/components/nav/readme.md @@ -27,6 +27,11 @@ string any +#### routerDelegate + + + + #### swipeBackEnabled boolean @@ -59,6 +64,11 @@ string any +#### router-delegate + + + + #### swipe-back-enabled boolean @@ -82,9 +92,6 @@ boolean #### canGoBack() -#### clearTransitionInfoForUrl() - - #### first() @@ -106,9 +113,6 @@ boolean #### getRouteId() -#### getTransitionInfoForUrl() - - #### getViews() @@ -124,6 +128,9 @@ boolean #### last() +#### onAllTransitionsComplete() + + #### pop() diff --git a/packages/core/src/components/nav/transitions/transition.ios.ts b/packages/core/src/components/nav/transitions/transition.ios.ts index f76da51cb5..5ce74e9e4a 100644 --- a/packages/core/src/components/nav/transitions/transition.ios.ts +++ b/packages/core/src/components/nav/transitions/transition.ios.ts @@ -14,10 +14,10 @@ const SHOW_BACK_BTN_CSS = 'show-back-button'; export function buildIOSTransition(rootTransition: Transition, enteringView: ViewController, leavingView: ViewController, opts: AnimationOptions): Promise { const componentReadyPromise: Promise[] = []; // Let makes sure everything is hydrated and ready to animate - if (enteringView) { + if (enteringView && (enteringView.element as any).componentOnReady) { componentReadyPromise.push((enteringView.element as any).componentOnReady()); } - if (leavingView) { + if (leavingView && (leavingView.element as any).componentOnReady) { componentReadyPromise.push((leavingView.element as any).componentOnReady()); } diff --git a/packages/core/src/components/nav/transitions/transition.md.ts b/packages/core/src/components/nav/transitions/transition.md.ts index 495cca6539..40c55dda9a 100644 --- a/packages/core/src/components/nav/transitions/transition.md.ts +++ b/packages/core/src/components/nav/transitions/transition.md.ts @@ -10,10 +10,10 @@ const SHOW_BACK_BTN_CSS = 'show-back-button'; export function buildMdTransition(rootTransition: Transition, enteringView: ViewController, leavingView: ViewController, opts: AnimationOptions): Promise { const componentReadyPromise: Promise[] = []; - if (enteringView) { + if (enteringView && (enteringView.element as any).componentOnReady) { componentReadyPromise.push((enteringView.element as any).componentOnReady()); } - if (leavingView) { + if (leavingView && (leavingView.element as any).componentOnReady) { componentReadyPromise.push((leavingView.element as any).componentOnReady()); } @@ -32,8 +32,7 @@ export function buildMdTransition(rootTransition: Transition, enteringView: View // animate the component itself if (backDirection) { rootTransition.duration(isDef(opts.duration) ? opts.duration : 200).easing('cubic-bezier(0.47,0,0.745,0.715)'); - } - else { + } else { rootTransition.duration(isDef(opts.duration) ? opts.duration : 280).easing('cubic-bezier(0.36,0.66,0.04,1)'); rootTransition diff --git a/packages/core/src/components/nav/view-controller.ts b/packages/core/src/components/nav/view-controller.ts index e587f70702..4a7cb1a82b 100644 --- a/packages/core/src/components/nav/view-controller.ts +++ b/packages/core/src/components/nav/view-controller.ts @@ -1,7 +1,10 @@ import { FrameworkDelegate, Nav, PublicViewController } from '../../index'; import { STATE_ATTACHED, STATE_DESTROYED, STATE_INITIALIZED, STATE_NEW } from './nav-utils'; -import { assert } from '../../utils/helpers'; +import { + assert, + normalizeUrl +} from '../../utils/helpers'; export class ViewController implements PublicViewController { @@ -15,13 +18,15 @@ export class ViewController implements PublicViewController { zIndex: number; dismissProxy: any; timestamp: number; + fromExternalRouter: boolean; + url: string; onDidDismiss: (data: any, role: string) => void; onWillDismiss: (data: any, role: string) => void; - constructor(public component: any, data?: any) { - initializeNewViewController(this, data); + constructor(public component: any, data: any, fromExternalRouter: boolean, url: string) { + initializeNewViewController(this, data, fromExternalRouter, url); } /** @@ -159,8 +164,10 @@ export function didLoadImpl(viewController: ViewController) { callLifeCycleFunction(viewController.instance, 'ionViewDidLoad'); } -export function initializeNewViewController(viewController: ViewController, data: any) { +export function initializeNewViewController(viewController: ViewController, data: any, fromExternalRouter: boolean, url: string) { viewController.timestamp = Date.now(); viewController.state = STATE_NEW; viewController.data = data || {}; + viewController.fromExternalRouter = fromExternalRouter; + viewController.url = url && normalizeUrl(url); } diff --git a/packages/core/src/components/router/router-utils.ts b/packages/core/src/components/router/router-utils.ts index 95cba589e6..36e4815dae 100644 --- a/packages/core/src/components/router/router-utils.ts +++ b/packages/core/src/components/router/router-utils.ts @@ -1,5 +1,5 @@ export interface NavOutlet { - setRouteId(id: any, data?: any): Promise; + setRouteId(id: any, data?: any): Promise; getRouteId(): string; getContentElement(): HTMLElement | null; } diff --git a/packages/core/src/components/tab/tab.tsx b/packages/core/src/components/tab/tab.tsx index c004510fd5..8612fdda50 100644 --- a/packages/core/src/components/tab/tab.tsx +++ b/packages/core/src/components/tab/tab.tsx @@ -1,5 +1,4 @@ import { Component, Element, Event, EventEmitter, Method, Prop, State, Watch } from '@stencil/core'; - import { getNavAsChildIfExists } from '../../utils/helpers'; import { FrameworkDelegate } from '../..'; @@ -9,7 +8,7 @@ import { FrameworkDelegate } from '../..'; }) export class Tab { - private loaded = false; + // private loaded = false; @Element() el: HTMLElement; @State() init = false; @@ -66,6 +65,7 @@ export class Tab { @Prop({ mutable: true }) selected = false; + @Watch('selected') selectedChanged(selected: boolean) { if (selected) { @@ -81,7 +81,30 @@ export class Tab { @Method() setActive(active: boolean): Promise { this.active = active; - if (this.loaded || !active) { + if (active) { + const nav = getNavAsChildIfExists(this.el); + if (nav) { + // the tab's nav has been initialized externally + if ((window as any).externalNavPromise) { + return (window as any).externalNavPromise.then(() => { + (window as any).externalNavPromise = null; + }); + } else { + // the tab's nav has not been initialized externally, so + // check if we need to initiailize it + return (nav as any).componentOnReady().then(() => { + return nav.onAllTransitionsComplete(); + }).then(() => { + if (!nav.getViews().length && !nav.isTransitioning() && !nav.initialized) { + return nav.setRoot(nav.root); + } + return Promise.resolve(); + }); + } + } + } + + /*if (this.loaded || !active) { return Promise.resolve(); } @@ -97,6 +120,8 @@ export class Tab { promise = Promise.resolve(); } return promise.then(() => this.fireChildren()); + */ + return Promise.resolve(); } @Method() @@ -110,7 +135,7 @@ export class Tab { return null; } - private fireChildren() { + /*private fireChildren() { const nav = getNavAsChildIfExists(this.el); if (nav && nav.getViews().length === 0 && nav.root) { // we need to initialize @@ -119,6 +144,7 @@ export class Tab { // it's already been initialized if it exists return Promise.resolve(); } + */ hostData() { const visible = this.active && this.selected; @@ -127,7 +153,7 @@ export class Tab { 'aria-labelledby': this.btnId, 'role': 'tabpanel', class: { - 'show-tab': this.active + 'show-tab': visible } }; } @@ -137,14 +163,15 @@ export class Tab { } } -function attachViewToDom(container: HTMLElement, cmp: string): Promise { +/*function attachViewToDom(container: HTMLElement, cmp: string): Promise { const el = document.createElement(cmp) as HTMLStencilElement; container.appendChild(el); - if (el.componentOnReady ) { + if (el.componentOnReady) { return el.componentOnReady(); } return Promise.resolve(); } +*/ export interface TabEvent extends CustomEvent { detail: TabEventDetail; diff --git a/packages/core/src/components/tabs/tabs.tsx b/packages/core/src/components/tabs/tabs.tsx index eeabdcbcd8..3a376c622c 100644 --- a/packages/core/src/components/tabs/tabs.tsx +++ b/packages/core/src/components/tabs/tabs.tsx @@ -9,6 +9,7 @@ import { Config, NavEventDetail, NavOutlet } from '../../index'; export class Tabs implements NavOutlet { private ids = -1; private tabsId: number = (++tabIds); + initialized = false; @Element() el: HTMLElement; @@ -70,8 +71,14 @@ export class Tabs implements NavOutlet { this.loadConfig('tabsLayout', 'icon-top'); this.loadConfig('tabsHighlight', true); - this.initTabs(); - this.initSelect(); + return this.initTabs().then(() => { + if (! (window as any).externalNav) { + return this.initSelect(); + } + return null; + }).then(() => { + this.initialized = true; + }); } componentDidUnload() { @@ -171,16 +178,19 @@ export class Tabs implements NavOutlet { private initTabs() { const tabs = this.tabs = Array.from(this.el.querySelectorAll('ion-tab')); + const tabPromises: Promise[] = []; for (const tab of tabs) { const id = `t-${this.tabsId}-${++this.ids}`; tab.btnId = 'tab-' + id; tab.id = 'tabpanel-' + id; + tabPromises.push((tab as any).componentOnReady()); } + return Promise.all(tabPromises); } private initSelect() { if (document.querySelector('ion-router')) { - return; + return Promise.resolve(); } // find pre-selected tabs const selectedTab = this.tabs.find(t => t.selected) || @@ -192,10 +202,10 @@ export class Tabs implements NavOutlet { tab.selected = false; } } - if (selectedTab) { - selectedTab.setActive(true); - } - this.selectedTab = selectedTab; + const promise = selectedTab ? selectedTab.setActive(true) : Promise.resolve(); + return promise.then(() => { + this.selectedTab = selectedTab; + }); } private loadConfig(attrKey: string, fallback: any) { diff --git a/packages/core/src/index.d.ts b/packages/core/src/index.d.ts index 3a188265fd..92f9ac354c 100644 --- a/packages/core/src/index.d.ts +++ b/packages/core/src/index.d.ts @@ -146,6 +146,11 @@ export interface FrameworkDelegate { removeViewFromDom(elementOrContainerToUnmountFrom: any, elementOrComponentToUnmount: any, escapeHatch?: any): Promise; } +export interface RouterDelegate { + pushUrlState(urlSegment: string, stateObject?: any, title?: string): Promise; + popUrlState(): Promise; +} + export interface FrameworkMountingData { element: HTMLElement; component: any; diff --git a/packages/core/src/utils/dom-framework-delegate.ts b/packages/core/src/utils/dom-framework-delegate.ts index 5f83e317d2..1ce3e98272 100644 --- a/packages/core/src/utils/dom-framework-delegate.ts +++ b/packages/core/src/utils/dom-framework-delegate.ts @@ -28,12 +28,4 @@ export class DomFrameworkDelegate implements FrameworkDelegate { parentElement.removeChild(childElement); return Promise.resolve(); } - - shouldDeferToRouter(_elementOrComponentToMount: any): Promise { - return Promise.resolve(false); - } - - routeToUrl(_elementOrComponentToMount: any): Promise { - return Promise.resolve('todo'); - } } diff --git a/packages/core/src/utils/dom-router-delegate.ts b/packages/core/src/utils/dom-router-delegate.ts new file mode 100644 index 0000000000..815c356656 --- /dev/null +++ b/packages/core/src/utils/dom-router-delegate.ts @@ -0,0 +1,16 @@ + + +import { RouterDelegate } from '../index'; + +export class DomRouterDelegate implements RouterDelegate { + + pushUrlState(urlSegment: string, stateObject: any = null, title = ''): Promise { + history.pushState(stateObject, title, urlSegment); + return Promise.resolve(); + } + + popUrlState() { + history.back(); + return Promise.resolve(); + } +} diff --git a/packages/core/src/utils/helpers.ts b/packages/core/src/utils/helpers.ts index 5599001df8..1394d0b913 100644 --- a/packages/core/src/utils/helpers.ts +++ b/packages/core/src/utils/helpers.ts @@ -303,3 +303,16 @@ export function getNavAsChildIfExists(element: HTMLElement): HTMLIonNavElement|n } return null; } + +export function normalizeUrl(url: string) { + url = url.trim(); + if (url.charAt(0) !== '/') { + // ensure first char is a / + url = '/' + url; + } + if (url.length > 1 && url.charAt(url.length - 1) === '/') { + // ensure last char is not a / + url = url.substr(0, url.length - 1); + } + return url; +} diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index 2473650c43..ecf95bce1e 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { - "allowSyntheticDefaultImports": true, "allowUnreachableCode": false, "alwaysStrict": true, + "declaration": true, "experimentalDecorators": true, "forceConsistentCasingInFileNames": true, "jsx": "react", diff --git a/packages/demos/angular/src/app/app-routing.module.ts b/packages/demos/angular/src/app/app-routing.module.ts index e92056a598..d440aff028 100644 --- a/packages/demos/angular/src/app/app-routing.module.ts +++ b/packages/demos/angular/src/app/app-routing.module.ts @@ -14,12 +14,15 @@ const routes: Routes = [ { path: 'content', loadChildren: 'app/content/content.module#ContentModule' }, { path: 'toast', loadChildren: 'app/toast/toast.module#ToastModule' }, { path: 'loading', loadChildren: 'app/loading/loading.module#LoadingModule' }, - { path: 'no-routing-nav', loadChildren: 'app/no-routing-nav/no-routing-nav.module#NoRoutingNavModule' }, { path: 'modal', loadChildren: 'app/modal/modal.module#ModalModule' }, { path: 'popover', loadChildren: 'app/popover/popover.module#PopoverModule' }, { path: 'segment', loadChildren: 'app/segment/segment.module#SegmentModule' }, { path: 'virtual-scroll', loadChildren: 'app/virtual-scroll/virtual-scroll.module#VirtualScrollModule' }, + { path: 'no-routing-nav', loadChildren: 'app/no-routing-nav/no-routing-nav.module#NoRoutingNavModule' }, + { path: 'simple-nav', loadChildren: 'app/simple-nav/simple-nav.module#SimpleNavModule' }, + { path: 'nested-nav', loadChildren: 'app/nested-nav/nested-nav.module#NestedNavModule' }, + { path: 'nav-then-tabs', loadChildren: 'app/nav-then-tabs/nav-then-tabs.module#NavThenTabsModule' }, ]; @NgModule({ diff --git a/packages/demos/angular/src/app/home-page/home-page.component.html b/packages/demos/angular/src/app/home-page/home-page.component.html index 971db75ec0..8246db096f 100644 --- a/packages/demos/angular/src/app/home-page/home-page.component.html +++ b/packages/demos/angular/src/app/home-page/home-page.component.html @@ -51,5 +51,19 @@

Nav Tests

- No Routing + +
diff --git a/packages/demos/angular/src/app/nav-then-tabs/login/login-routing.module.ts b/packages/demos/angular/src/app/nav-then-tabs/login/login-routing.module.ts new file mode 100644 index 0000000000..cf7ca97be3 --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/login/login-routing.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { LoginPage } from './login'; + +const routes: Routes = [ + { path: '', component: LoginPage} +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class LoginRoutingModule { } diff --git a/packages/demos/angular/src/app/nav-then-tabs/login/login.module.ts b/packages/demos/angular/src/app/nav-then-tabs/login/login.module.ts new file mode 100644 index 0000000000..9fad36095d --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/login/login.module.ts @@ -0,0 +1,17 @@ +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { LoginPage } from './login'; +import { LoginRoutingModule } from './login-routing.module'; + +@NgModule({ + imports: [ + CommonModule, + LoginRoutingModule + ], + declarations: [LoginPage], + schemas: [ + CUSTOM_ELEMENTS_SCHEMA + ] +}) +export class LoginModule { } diff --git a/packages/demos/angular/src/app/nav-then-tabs/login/login.ts b/packages/demos/angular/src/app/nav-then-tabs/login/login.ts new file mode 100644 index 0000000000..62c8691b41 --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/login/login.ts @@ -0,0 +1,38 @@ +import { Component, ViewEncapsulation } from '@angular/core'; +import { NavController } from '@ionic/angular'; + +@Component({ + selector: 'login', + template: ` + + + + Login Page + + + + Login - {{ts}} +
+ Login to app +
+
+
+ ` +}) +export class LoginPage { + + ts: number; + constructor(private navController: NavController) { + setInterval(() => { + this.ts = Date.now(); + }, 500); + } + + + pushPageTwoComponent() { + this.navController.push('/nav-then-tabs/app/tabs/(tab-one:one)'); + } + + + +} diff --git a/packages/demos/angular/src/app/nav-then-tabs/nav-then-tabs-routing.module.ts b/packages/demos/angular/src/app/nav-then-tabs/nav-then-tabs-routing.module.ts new file mode 100644 index 0000000000..d1e1135389 --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/nav-then-tabs-routing.module.ts @@ -0,0 +1,21 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { NavThenTabsPageComponent } from './nav-then-tabs.component'; + +const routes: Routes = [ + { + path: '', + component: NavThenTabsPageComponent, + children: [ + { path: 'login', loadChildren: './login/login.module#LoginModule' }, + { path: 'app', loadChildren: './tabs-page/tabs-page.module#TabsPageModule' } + ] + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class NavThenTabsRoutingModule { } diff --git a/packages/demos/angular/src/app/nav-then-tabs/nav-then-tabs.component.ts b/packages/demos/angular/src/app/nav-then-tabs/nav-then-tabs.component.ts new file mode 100644 index 0000000000..dea3511214 --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/nav-then-tabs.component.ts @@ -0,0 +1,15 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-nav-page', + template: ` + + + + ` +}) +export class NavThenTabsPageComponent { + constructor() { + } + +} diff --git a/packages/demos/angular/src/app/nav-then-tabs/nav-then-tabs.module.ts b/packages/demos/angular/src/app/nav-then-tabs/nav-then-tabs.module.ts new file mode 100644 index 0000000000..5b262ac11f --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/nav-then-tabs.module.ts @@ -0,0 +1,21 @@ +import { CommonModule } from '@angular/common'; +import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; + +import { NavThenTabsPageComponent } from './nav-then-tabs.component'; +import { NavThenTabsRoutingModule } from './nav-then-tabs-routing.module'; + +import { IonicAngularModule, IonicRouterModule } from '@ionic/angular'; + +@NgModule({ + declarations: [ + NavThenTabsPageComponent, + ], + imports: [ + CommonModule, + IonicAngularModule, + IonicRouterModule, + NavThenTabsRoutingModule + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}) +export class NavThenTabsModule {} diff --git a/packages/demos/angular/src/app/nav-then-tabs/tab-one-page-one/tab-one-page-one-routing.module.ts b/packages/demos/angular/src/app/nav-then-tabs/tab-one-page-one/tab-one-page-one-routing.module.ts new file mode 100644 index 0000000000..497ee5094a --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/tab-one-page-one/tab-one-page-one-routing.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { TabOnePageOne } from './tab-one-page-one'; + +const routes: Routes = [ + { path: '', component: TabOnePageOne} +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class TabOnePageOneRoutingModule { } diff --git a/packages/demos/angular/src/app/nav-then-tabs/tab-one-page-one/tab-one-page-one.module.ts b/packages/demos/angular/src/app/nav-then-tabs/tab-one-page-one/tab-one-page-one.module.ts new file mode 100644 index 0000000000..ec32cdf16c --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/tab-one-page-one/tab-one-page-one.module.ts @@ -0,0 +1,17 @@ +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { TabOnePageOne } from './tab-one-page-one'; +import { TabOnePageOneRoutingModule } from './tab-one-page-one-routing.module'; + +@NgModule({ + imports: [ + CommonModule, + TabOnePageOneRoutingModule + ], + declarations: [TabOnePageOne], + schemas: [ + CUSTOM_ELEMENTS_SCHEMA + ] +}) +export class TabOnePageOneModule { } diff --git a/packages/demos/angular/src/app/nav-then-tabs/tab-one-page-one/tab-one-page-one.ts b/packages/demos/angular/src/app/nav-then-tabs/tab-one-page-one/tab-one-page-one.ts new file mode 100644 index 0000000000..fbeafdb9a6 --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/tab-one-page-one/tab-one-page-one.ts @@ -0,0 +1,34 @@ +import { Component, ViewEncapsulation } from '@angular/core'; +import { NavController } from '@ionic/angular'; + +@Component({ + selector: 'tab-one-page-one', + template: ` + + + + Tab One Page One + + + + Tab One Page One {{ts}} +
+ Go to Page Two +
+
+
+ ` +}) +export class TabOnePageOne { + + ts: number; + constructor(private navController: NavController) { + setInterval(() => { + this.ts = Date.now(); + }, 500); + } + + next() { + this.navController.push('/nav-then-tabs/app/tabs/(tab-one:two)'); + } +} diff --git a/packages/demos/angular/src/app/nav-then-tabs/tab-one-page-three/tab-one-page-three-routing.module.ts b/packages/demos/angular/src/app/nav-then-tabs/tab-one-page-three/tab-one-page-three-routing.module.ts new file mode 100644 index 0000000000..7720330ea3 --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/tab-one-page-three/tab-one-page-three-routing.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { TabOnePageThree } from './tab-one-page-three'; + +const routes: Routes = [ + { path: '', component: TabOnePageThree} +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class TabOnePageThreeRoutingModule { } diff --git a/packages/demos/angular/src/app/nav-then-tabs/tab-one-page-three/tab-one-page-three.module.ts b/packages/demos/angular/src/app/nav-then-tabs/tab-one-page-three/tab-one-page-three.module.ts new file mode 100644 index 0000000000..ed94b0e16a --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/tab-one-page-three/tab-one-page-three.module.ts @@ -0,0 +1,17 @@ +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { TabOnePageThree } from './tab-one-page-three'; +import { TabOnePageThreeRoutingModule } from './tab-one-page-three-routing.module'; + +@NgModule({ + imports: [ + CommonModule, + TabOnePageThreeRoutingModule + ], + declarations: [TabOnePageThree], + schemas: [ + CUSTOM_ELEMENTS_SCHEMA + ] +}) +export class TabOnePageThreeModule { } diff --git a/packages/demos/angular/src/app/nav-then-tabs/tab-one-page-three/tab-one-page-three.ts b/packages/demos/angular/src/app/nav-then-tabs/tab-one-page-three/tab-one-page-three.ts new file mode 100644 index 0000000000..22060c7995 --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/tab-one-page-three/tab-one-page-three.ts @@ -0,0 +1,34 @@ +import { Component, ViewEncapsulation } from '@angular/core'; +import { NavController } from '@ionic/angular'; + +@Component({ + selector: 'tab-one-page-three', + template: ` + + + + Tab One Page Three + + + + Tab One Page Three {{ts}} +
+ Go Back +
+
+
+ ` +}) +export class TabOnePageThree { + + ts: number; + constructor(private navController: NavController) { + setInterval(() => { + this.ts = Date.now(); + }, 500); + } + + back() { + this.navController.pop(); + } +} diff --git a/packages/demos/angular/src/app/nav-then-tabs/tab-one-page-two/tab-one-page-two-routing.module.ts b/packages/demos/angular/src/app/nav-then-tabs/tab-one-page-two/tab-one-page-two-routing.module.ts new file mode 100644 index 0000000000..44a965a932 --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/tab-one-page-two/tab-one-page-two-routing.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { TabOnePageTwo } from './tab-one-page-two'; + +const routes: Routes = [ + { path: '', component: TabOnePageTwo} +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class TabOnePageTwoRoutingModule { } diff --git a/packages/demos/angular/src/app/nav-then-tabs/tab-one-page-two/tab-one-page-two.module.ts b/packages/demos/angular/src/app/nav-then-tabs/tab-one-page-two/tab-one-page-two.module.ts new file mode 100644 index 0000000000..a4cebff94f --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/tab-one-page-two/tab-one-page-two.module.ts @@ -0,0 +1,17 @@ +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { TabOnePageTwo } from './tab-one-page-two'; +import { TabOnePageTwoRoutingModule } from './tab-one-page-two-routing.module'; + +@NgModule({ + imports: [ + CommonModule, + TabOnePageTwoRoutingModule + ], + declarations: [TabOnePageTwo], + schemas: [ + CUSTOM_ELEMENTS_SCHEMA + ] +}) +export class TabOnePageTwoModule { } diff --git a/packages/demos/angular/src/app/nav-then-tabs/tab-one-page-two/tab-one-page-two.ts b/packages/demos/angular/src/app/nav-then-tabs/tab-one-page-two/tab-one-page-two.ts new file mode 100644 index 0000000000..079d974c10 --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/tab-one-page-two/tab-one-page-two.ts @@ -0,0 +1,41 @@ +import { Component, ViewEncapsulation } from '@angular/core'; +import { NavController } from '@ionic/angular'; + +@Component({ + selector: 'tab-one-page-two', + template: ` + + + + Tab One Page Two + + + + Tab One Page Two {{ts}} +
+ Go to Page Three +
+
+ Go Back +
+
+
+ ` +}) +export class TabOnePageTwo { + + ts: number; + constructor(private navController: NavController) { + setInterval(() => { + this.ts = Date.now(); + }, 500); + } + + next() { + this.navController.push('/nav-then-tabs/app/tabs/(tab-one:three)'); + } + + back() { + this.navController.pop(); + } +} diff --git a/packages/demos/angular/src/app/nav-then-tabs/tab-three-page-one/tab-three-page-one-routing.module.ts b/packages/demos/angular/src/app/nav-then-tabs/tab-three-page-one/tab-three-page-one-routing.module.ts new file mode 100644 index 0000000000..0e08991d50 --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/tab-three-page-one/tab-three-page-one-routing.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { TabThreePageOne } from './tab-three-page-one'; + +const routes: Routes = [ + { path: '', component: TabThreePageOne} +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class TabThreePageOneRoutingModule { } diff --git a/packages/demos/angular/src/app/nav-then-tabs/tab-three-page-one/tab-three-page-one.module.ts b/packages/demos/angular/src/app/nav-then-tabs/tab-three-page-one/tab-three-page-one.module.ts new file mode 100644 index 0000000000..ac8493f8cb --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/tab-three-page-one/tab-three-page-one.module.ts @@ -0,0 +1,17 @@ +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { TabThreePageOne } from './tab-three-page-one'; +import { TabThreePageOneRoutingModule } from './tab-three-page-one-routing.module'; + +@NgModule({ + imports: [ + CommonModule, + TabThreePageOneRoutingModule + ], + declarations: [TabThreePageOne], + schemas: [ + CUSTOM_ELEMENTS_SCHEMA + ] +}) +export class TabThreePageOneModule { } diff --git a/packages/demos/angular/src/app/nav-then-tabs/tab-three-page-one/tab-three-page-one.ts b/packages/demos/angular/src/app/nav-then-tabs/tab-three-page-one/tab-three-page-one.ts new file mode 100644 index 0000000000..5cc8192051 --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/tab-three-page-one/tab-three-page-one.ts @@ -0,0 +1,34 @@ +import { Component, ViewEncapsulation } from '@angular/core'; +import { NavController } from '@ionic/angular'; + +@Component({ + selector: 'tab-three-page-one', + template: ` + + + + Tab Three Page One + + + + Tab Three Page One {{ts}} +
+ Go to Page Two +
+
+
+ ` +}) +export class TabThreePageOne { + + ts: number; + constructor(private navController: NavController) { + setInterval(() => { + this.ts = Date.now(); + }, 500); + } + + next() { + this.navController.push('/nav-then-tabs/app/tabs/(tab-three:two)'); + } +} diff --git a/packages/demos/angular/src/app/nav-then-tabs/tab-three-page-three/tab-three-page-three-routing.module.ts b/packages/demos/angular/src/app/nav-then-tabs/tab-three-page-three/tab-three-page-three-routing.module.ts new file mode 100644 index 0000000000..dad9208605 --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/tab-three-page-three/tab-three-page-three-routing.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { TabThreePageThree } from './tab-three-page-three'; + +const routes: Routes = [ + { path: '', component: TabThreePageThree} +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class TabThreePageThreeRoutingModule { } diff --git a/packages/demos/angular/src/app/nav-then-tabs/tab-three-page-three/tab-three-page-three.module.ts b/packages/demos/angular/src/app/nav-then-tabs/tab-three-page-three/tab-three-page-three.module.ts new file mode 100644 index 0000000000..57d2097774 --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/tab-three-page-three/tab-three-page-three.module.ts @@ -0,0 +1,17 @@ +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { TabThreePageThree } from './tab-three-page-three'; +import { TabThreePageThreeRoutingModule } from './tab-three-page-three-routing.module'; + +@NgModule({ + imports: [ + CommonModule, + TabThreePageThreeRoutingModule + ], + declarations: [TabThreePageThree], + schemas: [ + CUSTOM_ELEMENTS_SCHEMA + ] +}) +export class TabThreePageThreeModule { } diff --git a/packages/demos/angular/src/app/nav-then-tabs/tab-three-page-three/tab-three-page-three.ts b/packages/demos/angular/src/app/nav-then-tabs/tab-three-page-three/tab-three-page-three.ts new file mode 100644 index 0000000000..100411289d --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/tab-three-page-three/tab-three-page-three.ts @@ -0,0 +1,34 @@ +import { Component, ViewEncapsulation } from '@angular/core'; +import { NavController } from '@ionic/angular'; + +@Component({ + selector: 'tab-three-page-three', + template: ` + + + + Tab Three Page Three + + + + Tab Three Page Three {{ts}} +
+ Go Back +
+
+
+ ` +}) +export class TabThreePageThree { + + ts: number; + constructor(private navController: NavController) { + setInterval(() => { + this.ts = Date.now(); + }, 500); + } + + back() { + this.navController.pop(); + } +} diff --git a/packages/demos/angular/src/app/nav-then-tabs/tab-three-page-two/tab-three-page-two-routing.module.ts b/packages/demos/angular/src/app/nav-then-tabs/tab-three-page-two/tab-three-page-two-routing.module.ts new file mode 100644 index 0000000000..ef0a749287 --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/tab-three-page-two/tab-three-page-two-routing.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { TabThreePageTwo } from './tab-three-page-two'; + +const routes: Routes = [ + { path: '', component: TabThreePageTwo} +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class TabThreePageTwoRoutingModule { } diff --git a/packages/demos/angular/src/app/nav-then-tabs/tab-three-page-two/tab-three-page-two.module.ts b/packages/demos/angular/src/app/nav-then-tabs/tab-three-page-two/tab-three-page-two.module.ts new file mode 100644 index 0000000000..91c76bc342 --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/tab-three-page-two/tab-three-page-two.module.ts @@ -0,0 +1,17 @@ +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { TabThreePageTwo } from './tab-three-page-two'; +import { TabThreePageTwoRoutingModule } from './tab-three-page-two-routing.module'; + +@NgModule({ + imports: [ + CommonModule, + TabThreePageTwoRoutingModule + ], + declarations: [TabThreePageTwo], + schemas: [ + CUSTOM_ELEMENTS_SCHEMA + ] +}) +export class TabThreePageTwoModule { } diff --git a/packages/demos/angular/src/app/nav-then-tabs/tab-three-page-two/tab-three-page-two.ts b/packages/demos/angular/src/app/nav-then-tabs/tab-three-page-two/tab-three-page-two.ts new file mode 100644 index 0000000000..0714107f0f --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/tab-three-page-two/tab-three-page-two.ts @@ -0,0 +1,41 @@ +import { Component, ViewEncapsulation } from '@angular/core'; +import { NavController } from '@ionic/angular'; + +@Component({ + selector: 'tab-three-page-two', + template: ` + + + + Tab Three Page Two + + + + Tab Three Page Two {{ts}} +
+ Go to Page Three +
+
+ Go Back +
+
+
+ ` +}) +export class TabThreePageTwo { + + ts: number; + constructor(private navController: NavController) { + setInterval(() => { + this.ts = Date.now(); + }, 500); + } + + next() { + this.navController.push('/nav-then-tabs/app/tabs/(tab-three:three)'); + } + + back() { + this.navController.pop(); + } +} diff --git a/packages/demos/angular/src/app/nav-then-tabs/tab-two-page-one/tab-two-page-one-routing.module.ts b/packages/demos/angular/src/app/nav-then-tabs/tab-two-page-one/tab-two-page-one-routing.module.ts new file mode 100644 index 0000000000..b4a32b67f2 --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/tab-two-page-one/tab-two-page-one-routing.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { TabTwoPageOne } from './tab-two-page-one'; + +const routes: Routes = [ + { path: '', component: TabTwoPageOne} +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class TabTwoPageOneRoutingModule { } diff --git a/packages/demos/angular/src/app/nav-then-tabs/tab-two-page-one/tab-two-page-one.module.ts b/packages/demos/angular/src/app/nav-then-tabs/tab-two-page-one/tab-two-page-one.module.ts new file mode 100644 index 0000000000..1f5310c258 --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/tab-two-page-one/tab-two-page-one.module.ts @@ -0,0 +1,17 @@ +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { TabTwoPageOne } from './tab-two-page-one'; +import { TabTwoPageOneRoutingModule } from './tab-two-page-one-routing.module'; + +@NgModule({ + imports: [ + CommonModule, + TabTwoPageOneRoutingModule + ], + declarations: [TabTwoPageOne], + schemas: [ + CUSTOM_ELEMENTS_SCHEMA + ] +}) +export class TabTwoPageOneModule { } diff --git a/packages/demos/angular/src/app/nav-then-tabs/tab-two-page-one/tab-two-page-one.ts b/packages/demos/angular/src/app/nav-then-tabs/tab-two-page-one/tab-two-page-one.ts new file mode 100644 index 0000000000..512e40d8dc --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/tab-two-page-one/tab-two-page-one.ts @@ -0,0 +1,34 @@ +import { Component, ViewEncapsulation } from '@angular/core'; +import { NavController } from '@ionic/angular'; + +@Component({ + selector: 'tab-two-page-one', + template: ` + + + + Tab Two Page One + + + + Tab Two Page One {{ts}} +
+ Go to Page Two +
+
+
+ ` +}) +export class TabTwoPageOne { + + ts: number; + constructor(private navController: NavController) { + setInterval(() => { + this.ts = Date.now(); + }, 500); + } + + next() { + this.navController.push('/nav-then-tabs/app/tabs/(tab-two:two)'); + } +} diff --git a/packages/demos/angular/src/app/nav-then-tabs/tab-two-page-three/tab-two-page-three-routing.module.ts b/packages/demos/angular/src/app/nav-then-tabs/tab-two-page-three/tab-two-page-three-routing.module.ts new file mode 100644 index 0000000000..c2d868e2dc --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/tab-two-page-three/tab-two-page-three-routing.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { TabTwoPageThree } from './tab-two-page-three'; + +const routes: Routes = [ + { path: '', component: TabTwoPageThree} +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class TabTwoPageThreeRoutingModule { } diff --git a/packages/demos/angular/src/app/nav-then-tabs/tab-two-page-three/tab-two-page-three.module.ts b/packages/demos/angular/src/app/nav-then-tabs/tab-two-page-three/tab-two-page-three.module.ts new file mode 100644 index 0000000000..7004e500fe --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/tab-two-page-three/tab-two-page-three.module.ts @@ -0,0 +1,17 @@ +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { TabTwoPageThree } from './tab-two-page-three'; +import { TabTwoPageThreeRoutingModule } from './tab-two-page-three-routing.module'; + +@NgModule({ + imports: [ + CommonModule, + TabTwoPageThreeRoutingModule + ], + declarations: [TabTwoPageThree], + schemas: [ + CUSTOM_ELEMENTS_SCHEMA + ] +}) +export class TabTwoPageThreeModule { } diff --git a/packages/demos/angular/src/app/nav-then-tabs/tab-two-page-three/tab-two-page-three.ts b/packages/demos/angular/src/app/nav-then-tabs/tab-two-page-three/tab-two-page-three.ts new file mode 100644 index 0000000000..184d602474 --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/tab-two-page-three/tab-two-page-three.ts @@ -0,0 +1,34 @@ +import { Component, ViewEncapsulation } from '@angular/core'; +import { NavController } from '@ionic/angular'; + +@Component({ + selector: 'tab-two-page-three', + template: ` + + + + Tab Two Page Three + + + + Tab Two Page Three {{ts}} +
+ Go Back +
+
+
+ ` +}) +export class TabTwoPageThree { + + ts: number; + constructor(private navController: NavController) { + setInterval(() => { + this.ts = Date.now(); + }, 500); + } + + back() { + this.navController.pop(); + } +} diff --git a/packages/demos/angular/src/app/nav-then-tabs/tab-two-page-two/tab-two-page-two-routing.module.ts b/packages/demos/angular/src/app/nav-then-tabs/tab-two-page-two/tab-two-page-two-routing.module.ts new file mode 100644 index 0000000000..4989518f14 --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/tab-two-page-two/tab-two-page-two-routing.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { TabTwoPageTwo } from './tab-two-page-two'; + +const routes: Routes = [ + { path: '', component: TabTwoPageTwo} +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class TabTwoPageTwoRoutingModule { } diff --git a/packages/demos/angular/src/app/nav-then-tabs/tab-two-page-two/tab-two-page-two.module.ts b/packages/demos/angular/src/app/nav-then-tabs/tab-two-page-two/tab-two-page-two.module.ts new file mode 100644 index 0000000000..10cbb71781 --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/tab-two-page-two/tab-two-page-two.module.ts @@ -0,0 +1,17 @@ +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { TabTwoPageTwo } from './tab-two-page-two'; +import { TabTwoPageTwoRoutingModule } from './tab-two-page-two-routing.module'; + +@NgModule({ + imports: [ + CommonModule, + TabTwoPageTwoRoutingModule + ], + declarations: [TabTwoPageTwo], + schemas: [ + CUSTOM_ELEMENTS_SCHEMA + ] +}) +export class TabTwoPageTwoModule { } diff --git a/packages/demos/angular/src/app/nav-then-tabs/tab-two-page-two/tab-two-page-two.ts b/packages/demos/angular/src/app/nav-then-tabs/tab-two-page-two/tab-two-page-two.ts new file mode 100644 index 0000000000..ed58bee019 --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/tab-two-page-two/tab-two-page-two.ts @@ -0,0 +1,41 @@ +import { Component, ViewEncapsulation } from '@angular/core'; +import { NavController } from '@ionic/angular'; + +@Component({ + selector: 'tab-two-page-two', + template: ` + + + + Tab Two Page Two + + + + Tab Two Page Two {{ts}} +
+ Go to Page Three +
+
+ Go Back +
+
+
+ ` +}) +export class TabTwoPageTwo { + + ts: number; + constructor(private navController: NavController) { + setInterval(() => { + this.ts = Date.now(); + }, 500); + } + + next() { + this.navController.push('/nav-then-tabs/app/tabs/(tab-two:three)'); + } + + back() { + this.navController.pop(); + } +} diff --git a/packages/demos/angular/src/app/nav-then-tabs/tabs-page/tabs-page-routing.module.ts b/packages/demos/angular/src/app/nav-then-tabs/tabs-page/tabs-page-routing.module.ts new file mode 100644 index 0000000000..a5222372a5 --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/tabs-page/tabs-page-routing.module.ts @@ -0,0 +1,76 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { TabsPage } from './tabs-page'; + +import { TabOnePageOne } from '../tab-one-page-one/tab-one-page-one'; +import { TabOnePageTwo } from '../tab-one-page-two/tab-one-page-two'; +import { TabOnePageThree } from '../tab-one-page-three/tab-one-page-three'; + +import { TabTwoPageOne } from '../tab-two-page-one/tab-two-page-one'; +import { TabTwoPageTwo } from '../tab-two-page-two/tab-two-page-two'; +import { TabTwoPageThree } from '../tab-two-page-three/tab-two-page-three'; + +import { TabThreePageOne } from '../tab-three-page-one/tab-three-page-one'; +import { TabThreePageTwo } from '../tab-three-page-two/tab-three-page-two'; +import { TabThreePageThree } from '../tab-three-page-three/tab-three-page-three'; + +const routes: Routes = [ + { + path: 'tabs', + component: TabsPage, + children: [ + { + path: 'one', + component: TabOnePageOne, + outlet: 'tab-one' + }, + { + path: 'two', + component: TabOnePageTwo, + outlet: 'tab-one' + }, + { + path: 'three', + component: TabOnePageThree, + outlet: 'tab-one' + }, + { + path: 'one', + component: TabTwoPageOne, + outlet: 'tab-two' + }, + { + path: 'two', + component: TabTwoPageTwo, + outlet: 'tab-two' + }, + { + path: 'three', + component: TabTwoPageThree, + outlet: 'tab-two' + }, + { + path: 'one', + component: TabThreePageOne, + outlet: 'tab-three' + }, + { + path: 'two', + component: TabThreePageTwo, + outlet: 'tab-three' + }, + { + path: 'three', + component: TabThreePageThree, + outlet: 'tab-three' + } + ] + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class TabsPageRoutingModule { } diff --git a/packages/demos/angular/src/app/nav-then-tabs/tabs-page/tabs-page.module.ts b/packages/demos/angular/src/app/nav-then-tabs/tabs-page/tabs-page.module.ts new file mode 100644 index 0000000000..0204104133 --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/tabs-page/tabs-page.module.ts @@ -0,0 +1,52 @@ +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { + IonicAngularModule, + IonicRouterModule +} from '@ionic/angular'; + +import { TabsPage } from './tabs-page'; + +import { TabsPageRoutingModule } from './tabs-page-routing.module'; + +import { TabOnePageOneModule } from '../tab-one-page-one/tab-one-page-one.module'; +import { TabOnePageTwoModule } from '../tab-one-page-two/tab-one-page-two.module'; +import { TabOnePageThreeModule } from '../tab-one-page-three/tab-one-page-three.module'; + +import { TabTwoPageOneModule } from '../tab-two-page-one/tab-two-page-one.module'; +import { TabTwoPageTwoModule } from '../tab-two-page-two/tab-two-page-two.module'; +import { TabTwoPageThreeModule } from '../tab-two-page-three/tab-two-page-three.module'; + +import { TabThreePageOneModule } from '../tab-three-page-one/tab-three-page-one.module'; +import { TabThreePageTwoModule } from '../tab-three-page-two/tab-three-page-two.module'; +import { TabThreePageThreeModule } from '../tab-three-page-three/tab-three-page-three.module'; + +@NgModule({ + imports: [ + CommonModule, + TabsPageRoutingModule, + IonicAngularModule, + IonicRouterModule, + TabOnePageOneModule, + TabOnePageTwoModule, + TabOnePageThreeModule, + + + TabTwoPageOneModule, + TabTwoPageTwoModule, + TabTwoPageThreeModule, + + + TabThreePageOneModule, + TabThreePageTwoModule, + TabThreePageThreeModule + ], + declarations: [ + TabsPage, + ], + schemas: [ + CUSTOM_ELEMENTS_SCHEMA + ] +}) +export class TabsPageModule { } diff --git a/packages/demos/angular/src/app/nav-then-tabs/tabs-page/tabs-page.ts b/packages/demos/angular/src/app/nav-then-tabs/tabs-page/tabs-page.ts new file mode 100644 index 0000000000..dfb26b10e0 --- /dev/null +++ b/packages/demos/angular/src/app/nav-then-tabs/tabs-page/tabs-page.ts @@ -0,0 +1,38 @@ +import { Component, ElementRef, ViewChild, ViewEncapsulation } from '@angular/core'; +import { Location } from '@angular/common'; +import { Router } from '@angular/router'; +import { NavController } from '@ionic/angular'; + +@Component({ + selector: 'tabs-page', + template: ` + + + + + + + + + + + + ` +}) +export class TabsPage { + + tabOnePageOne = '/nav-then-tabs/app/tabs/(tab-one:one)'; + tabTwoPageOne = '/nav-then-tabs/app/tabs/(tab-two:one)'; + tabThreePageOne = '/nav-then-tabs/app/tabs/(tab-three:one)'; + + @ViewChild('tabOne') tabOne: ElementRef; + @ViewChild('tabTwo') tabTwo: ElementRef; + @ViewChild('tabThree') tabThree: ElementRef; + + constructor(private router: Router, private location: Location) { + } + + goBack() { + window.history.back(); + } +} diff --git a/packages/demos/angular/src/app/nested-nav/nested-nav-routing.module.ts b/packages/demos/angular/src/app/nested-nav/nested-nav-routing.module.ts new file mode 100644 index 0000000000..b89c01d642 --- /dev/null +++ b/packages/demos/angular/src/app/nested-nav/nested-nav-routing.module.ts @@ -0,0 +1,22 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { NestedNavPageComponent } from './nested-nav.component'; + +const routes: Routes = [ + { + path: '', + component: NestedNavPageComponent, + children: [ + { path: 'nested-page-one', loadChildren: './nested-page-one/page-one.module#PageOneModule' }, + { path: 'nested-page-two', loadChildren: './nested-page-two/page-two.module#PageTwoModule' }, + { path: 'nested-page-three', loadChildren: './nested-page-three/page-three.module#PageThreeModule' } + ] + }, +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class NestedNavRoutingModule { } diff --git a/packages/demos/angular/src/app/nested-nav/nested-nav.component.ts b/packages/demos/angular/src/app/nested-nav/nested-nav.component.ts new file mode 100644 index 0000000000..4d227a465a --- /dev/null +++ b/packages/demos/angular/src/app/nested-nav/nested-nav.component.ts @@ -0,0 +1,15 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-nav-page', + template: ` + + + + ` +}) +export class NestedNavPageComponent { + constructor() { + } + +} diff --git a/packages/demos/angular/src/app/nested-nav/nested-nav.module.ts b/packages/demos/angular/src/app/nested-nav/nested-nav.module.ts new file mode 100644 index 0000000000..0f49f67f8d --- /dev/null +++ b/packages/demos/angular/src/app/nested-nav/nested-nav.module.ts @@ -0,0 +1,21 @@ +import { CommonModule } from '@angular/common'; +import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; + +import { NestedNavPageComponent } from './nested-nav.component'; +import { NestedNavRoutingModule } from './nested-nav-routing.module'; + +import { IonicAngularModule, IonicRouterModule } from '@ionic/angular'; + +@NgModule({ + declarations: [ + NestedNavPageComponent, + ], + imports: [ + CommonModule, + IonicAngularModule, + IonicRouterModule, + NestedNavRoutingModule + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}) +export class NestedNavModule {} diff --git a/packages/demos/angular/src/app/nested-nav/nested-page-one/page-one-routing.module.ts b/packages/demos/angular/src/app/nested-nav/nested-page-one/page-one-routing.module.ts new file mode 100644 index 0000000000..25ae75ef7d --- /dev/null +++ b/packages/demos/angular/src/app/nested-nav/nested-page-one/page-one-routing.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { PageOne } from './page-one'; + +const routes: Routes = [ + { path: '', component: PageOne} +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class PageOneRoutingModule { } diff --git a/packages/demos/angular/src/app/nested-nav/nested-page-one/page-one.module.ts b/packages/demos/angular/src/app/nested-nav/nested-page-one/page-one.module.ts new file mode 100644 index 0000000000..91b73d4c54 --- /dev/null +++ b/packages/demos/angular/src/app/nested-nav/nested-page-one/page-one.module.ts @@ -0,0 +1,17 @@ +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { PageOne } from './page-one'; +import { PageOneRoutingModule } from './page-one-routing.module'; + +@NgModule({ + imports: [ + CommonModule, + PageOneRoutingModule + ], + declarations: [PageOne], + schemas: [ + CUSTOM_ELEMENTS_SCHEMA + ] +}) +export class PageOneModule { } diff --git a/packages/demos/angular/src/app/nested-nav/nested-page-one/page-one.ts b/packages/demos/angular/src/app/nested-nav/nested-page-one/page-one.ts new file mode 100644 index 0000000000..4848d1d4fd --- /dev/null +++ b/packages/demos/angular/src/app/nested-nav/nested-page-one/page-one.ts @@ -0,0 +1,36 @@ +import { Component, ViewEncapsulation } from '@angular/core'; +import { Router } from '@angular/router'; +import { NavController } from '@ionic/angular'; + +@Component({ + selector: 'page-one', + template: ` + + + + Nested Page One + + + + Page One - {{ts}} +
+ Go to Page Two +
+
+
+ ` +}) +export class PageOne { + + ts: number; + constructor(private navController: NavController) { + setInterval(() => { + this.ts = Date.now(); + }, 500); + } + + + pushPageTwoComponent() { + this.navController.push('/nested-nav/nested-page-two/section-one'); + } +} diff --git a/packages/demos/angular/src/app/nested-nav/nested-page-three/page-three-routing.module.ts b/packages/demos/angular/src/app/nested-nav/nested-page-three/page-three-routing.module.ts new file mode 100644 index 0000000000..d534208893 --- /dev/null +++ b/packages/demos/angular/src/app/nested-nav/nested-page-three/page-three-routing.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { PageThree } from './page-three'; + +const routes: Routes = [ + { path: '', component: PageThree } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class PageThreeRoutingModule { } diff --git a/packages/demos/angular/src/app/nested-nav/nested-page-three/page-three.module.ts b/packages/demos/angular/src/app/nested-nav/nested-page-three/page-three.module.ts new file mode 100644 index 0000000000..1f75e6350f --- /dev/null +++ b/packages/demos/angular/src/app/nested-nav/nested-page-three/page-three.module.ts @@ -0,0 +1,19 @@ +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { PageThree } from './page-three'; +import { PageThreeRoutingModule } from './page-three-routing.module'; + +@NgModule({ + imports: [ + CommonModule, + PageThreeRoutingModule + ], + declarations: [ + PageThree + ], + schemas: [ + CUSTOM_ELEMENTS_SCHEMA + ] +}) +export class PageThreeModule { } diff --git a/packages/demos/angular/src/app/nested-nav/nested-page-three/page-three.ts b/packages/demos/angular/src/app/nested-nav/nested-page-three/page-three.ts new file mode 100644 index 0000000000..027af14e7a --- /dev/null +++ b/packages/demos/angular/src/app/nested-nav/nested-page-three/page-three.ts @@ -0,0 +1,39 @@ +import { Component, ViewEncapsulation } from '@angular/core'; +import { Location } from '@angular/common'; +import { Router } from '@angular/router'; +import { NavController } from '@ionic/angular'; + +@Component({ + selector: 'page-three', + template: ` + + + + Page Three + + + + Page Three {{ts}} +
+ Go Back +
+
+
+ ` +}) +export class PageThree { + + ts: number; + constructor(private router: Router, private location: Location) { + + setInterval(() => { + this.ts = Date.now(); + }, 500); + } + + + navPop() { + window.history.back(); + } + +} diff --git a/packages/demos/angular/src/app/nested-nav/nested-page-two/page-two-routing.module.ts b/packages/demos/angular/src/app/nested-nav/nested-page-two/page-two-routing.module.ts new file mode 100644 index 0000000000..c26197b19a --- /dev/null +++ b/packages/demos/angular/src/app/nested-nav/nested-page-two/page-two-routing.module.ts @@ -0,0 +1,29 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { PageTwo } from './page-two'; +import { PageTwoSectionOne } from './page-two-section-one'; +import { PageTwoSectionTwo } from './page-two-section-two'; + +const routes: Routes = [ + { + path: '', + component: PageTwo, + children: [ + { + path: 'section-one', + component: PageTwoSectionOne, + }, + { + path: 'section-two', + component: PageTwoSectionTwo, + } + ] + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class PageTwoRoutingModule { } diff --git a/packages/demos/angular/src/app/nested-nav/nested-page-two/page-two-section-one.ts b/packages/demos/angular/src/app/nested-nav/nested-page-two/page-two-section-one.ts new file mode 100644 index 0000000000..bccb52d18e --- /dev/null +++ b/packages/demos/angular/src/app/nested-nav/nested-page-two/page-two-section-one.ts @@ -0,0 +1,43 @@ +import { Component, ViewEncapsulation } from '@angular/core'; +import { Router } from '@angular/router'; +import { NavController } from '@ionic/angular'; + +@Component({ + selector: 'page-two-section-one', + template: ` + + + + Page Two Section One + + + + Page Two Section One - TS {{ts}} +
+ Go to Section Two +
+
+ Go Back +
+
+
+ ` +}) +export class PageTwoSectionOne { + + ts: number; + + constructor(private router: Router) { + setInterval(() => { + this.ts = Date.now(); + }, 500); + } + + pushPageTwoComponent() { + this.router.navigateByUrl('/nested-nav/nested-page-two/section-two'); + } + + goBack() { + this.router.navigateByUrl('/nested-nav/nested-page-one'); + } +} diff --git a/packages/demos/angular/src/app/nested-nav/nested-page-two/page-two-section-two.ts b/packages/demos/angular/src/app/nested-nav/nested-page-two/page-two-section-two.ts new file mode 100644 index 0000000000..2e3495e304 --- /dev/null +++ b/packages/demos/angular/src/app/nested-nav/nested-page-two/page-two-section-two.ts @@ -0,0 +1,42 @@ +import { Component, ViewEncapsulation } from '@angular/core'; +import { Router } from '@angular/router'; +import { NavController } from '@ionic/angular'; + +@Component({ + selector: 'page-two-section-two', + template: ` + + + + Page Two Section Two + + + + Page Two Section Two {{ts}} +
+ Go to Page Three +
+
+ Go Back +
+
+
+ ` +}) +export class PageTwoSectionTwo { + + ts: number; + constructor(private router: Router) { + setInterval(() => { + this.ts = Date.now(); + }, 500); + } + + pushPageTwoComponent() { + this.router.navigateByUrl('/nested-nav/nested-page-three'); + } + + goBack() { + this.router.navigateByUrl('/nested-nav/nested-page-two/section-one'); + } +} diff --git a/packages/demos/angular/src/app/nested-nav/nested-page-two/page-two.module.ts b/packages/demos/angular/src/app/nested-nav/nested-page-two/page-two.module.ts new file mode 100644 index 0000000000..7b4f10879a --- /dev/null +++ b/packages/demos/angular/src/app/nested-nav/nested-page-two/page-two.module.ts @@ -0,0 +1,32 @@ +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { + IonicAngularModule, + IonicRouterModule +} from '@ionic/angular'; + +import { PageTwo } from './page-two'; +import { PageTwoSectionOne } from './page-two-section-one'; +import { PageTwoSectionTwo } from './page-two-section-two'; + +import { PageTwoRoutingModule } from './page-two-routing.module'; + + +@NgModule({ + imports: [ + CommonModule, + PageTwoRoutingModule, + IonicAngularModule, + IonicRouterModule + ], + declarations: [ + PageTwo, + PageTwoSectionOne, + PageTwoSectionTwo + ], + schemas: [ + CUSTOM_ELEMENTS_SCHEMA + ] +}) +export class PageTwoModule { } diff --git a/packages/demos/angular/src/app/nested-nav/nested-page-two/page-two.ts b/packages/demos/angular/src/app/nested-nav/nested-page-two/page-two.ts new file mode 100644 index 0000000000..4186feca6c --- /dev/null +++ b/packages/demos/angular/src/app/nested-nav/nested-page-two/page-two.ts @@ -0,0 +1,24 @@ +import { Component, ViewEncapsulation } from '@angular/core'; +import { NavController } from '@ionic/angular'; + + +@Component({ + selector: 'page-two', + template: ` + + + ` +}) +export class PageTwo { + + constructor(private navController: NavController) { + } + + pushPageThree() { + this.navController.push('/nested-nav/nested-page-three'); + } + + goBack() { + window.history.back(); + } +} diff --git a/packages/demos/angular/src/app/no-routing-nav/pages/page-three.ts b/packages/demos/angular/src/app/no-routing-nav/pages/page-three.ts index ffca811b68..984d6c185e 100644 --- a/packages/demos/angular/src/app/no-routing-nav/pages/page-three.ts +++ b/packages/demos/angular/src/app/no-routing-nav/pages/page-three.ts @@ -6,6 +6,9 @@ import { Component } from '@angular/core'; + + + Page Three diff --git a/packages/demos/angular/src/app/no-routing-nav/pages/page-two.ts b/packages/demos/angular/src/app/no-routing-nav/pages/page-two.ts index 8ccdb35c0f..87b85e07ae 100644 --- a/packages/demos/angular/src/app/no-routing-nav/pages/page-two.ts +++ b/packages/demos/angular/src/app/no-routing-nav/pages/page-two.ts @@ -8,6 +8,9 @@ import { PageThree } from './page-three'; + + + Page Two diff --git a/packages/demos/angular/src/app/simple-nav/page-one/page-one-routing.module.ts b/packages/demos/angular/src/app/simple-nav/page-one/page-one-routing.module.ts new file mode 100644 index 0000000000..25ae75ef7d --- /dev/null +++ b/packages/demos/angular/src/app/simple-nav/page-one/page-one-routing.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { PageOne } from './page-one'; + +const routes: Routes = [ + { path: '', component: PageOne} +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class PageOneRoutingModule { } diff --git a/packages/demos/angular/src/app/simple-nav/page-one/page-one.module.ts b/packages/demos/angular/src/app/simple-nav/page-one/page-one.module.ts new file mode 100644 index 0000000000..91b73d4c54 --- /dev/null +++ b/packages/demos/angular/src/app/simple-nav/page-one/page-one.module.ts @@ -0,0 +1,17 @@ +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { PageOne } from './page-one'; +import { PageOneRoutingModule } from './page-one-routing.module'; + +@NgModule({ + imports: [ + CommonModule, + PageOneRoutingModule + ], + declarations: [PageOne], + schemas: [ + CUSTOM_ELEMENTS_SCHEMA + ] +}) +export class PageOneModule { } diff --git a/packages/demos/angular/src/app/simple-nav/page-one/page-one.ts b/packages/demos/angular/src/app/simple-nav/page-one/page-one.ts new file mode 100644 index 0000000000..684b7cff63 --- /dev/null +++ b/packages/demos/angular/src/app/simple-nav/page-one/page-one.ts @@ -0,0 +1,40 @@ +import { Component, ViewEncapsulation } from '@angular/core'; +import { NavController } from '@ionic/angular'; + +import { PageTwo } from '../page-two/page-two'; + +@Component({ + selector: 'page-one', + template: ` + + + + Simple Page One + + + + Page One - {{ts}} +
+ Go to Page Two +
+
+
+ ` +}) +export class PageOne { + + ts: number; + constructor(private navController: NavController) { + setInterval(() => { + this.ts = Date.now(); + }, 500); + } + + + pushPageTwoComponent() { + this.navController.push('/simple-nav/page-two'); + } + + + +} diff --git a/packages/demos/angular/src/app/simple-nav/page-three/page-three-routing.module.ts b/packages/demos/angular/src/app/simple-nav/page-three/page-three-routing.module.ts new file mode 100644 index 0000000000..d534208893 --- /dev/null +++ b/packages/demos/angular/src/app/simple-nav/page-three/page-three-routing.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { PageThree } from './page-three'; + +const routes: Routes = [ + { path: '', component: PageThree } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class PageThreeRoutingModule { } diff --git a/packages/demos/angular/src/app/simple-nav/page-three/page-three.module.ts b/packages/demos/angular/src/app/simple-nav/page-three/page-three.module.ts new file mode 100644 index 0000000000..1f75e6350f --- /dev/null +++ b/packages/demos/angular/src/app/simple-nav/page-three/page-three.module.ts @@ -0,0 +1,19 @@ +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { PageThree } from './page-three'; +import { PageThreeRoutingModule } from './page-three-routing.module'; + +@NgModule({ + imports: [ + CommonModule, + PageThreeRoutingModule + ], + declarations: [ + PageThree + ], + schemas: [ + CUSTOM_ELEMENTS_SCHEMA + ] +}) +export class PageThreeModule { } diff --git a/packages/demos/angular/src/app/simple-nav/page-three/page-three.ts b/packages/demos/angular/src/app/simple-nav/page-three/page-three.ts new file mode 100644 index 0000000000..1cb84e23b7 --- /dev/null +++ b/packages/demos/angular/src/app/simple-nav/page-three/page-three.ts @@ -0,0 +1,37 @@ +import { Component, ViewEncapsulation } from '@angular/core'; +import { NavController } from '@ionic/angular'; + +@Component({ + selector: 'page-three', + template: ` + + + + Page Three + + + + Page Three {{ts}} +
+ Go Back +
+
+
+ ` +}) +export class PageThree { + + ts: number; + constructor(private navController: NavController) { + + setInterval(() => { + this.ts = Date.now(); + }, 500); + } + + + navPop() { + this.navController.pop(); + } + +} diff --git a/packages/demos/angular/src/app/simple-nav/page-two/page-two-routing.module.ts b/packages/demos/angular/src/app/simple-nav/page-two/page-two-routing.module.ts new file mode 100644 index 0000000000..4700b6c8b5 --- /dev/null +++ b/packages/demos/angular/src/app/simple-nav/page-two/page-two-routing.module.ts @@ -0,0 +1,17 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { PageTwo } from './page-two'; + +const routes: Routes = [ + { + path: '', + component: PageTwo, + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class PageTwoRoutingModule { } diff --git a/packages/demos/angular/src/app/simple-nav/page-two/page-two.module.ts b/packages/demos/angular/src/app/simple-nav/page-two/page-two.module.ts new file mode 100644 index 0000000000..726d67cfd1 --- /dev/null +++ b/packages/demos/angular/src/app/simple-nav/page-two/page-two.module.ts @@ -0,0 +1,27 @@ +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { + IonicAngularModule, + IonicRouterModule +} from '@ionic/angular'; + +import { PageTwo } from './page-two'; +import { PageTwoRoutingModule } from './page-two-routing.module'; + + +@NgModule({ + imports: [ + CommonModule, + PageTwoRoutingModule, + IonicAngularModule, + IonicRouterModule + ], + declarations: [ + PageTwo, + ], + schemas: [ + CUSTOM_ELEMENTS_SCHEMA + ] +}) +export class PageTwoModule { } diff --git a/packages/demos/angular/src/app/simple-nav/page-two/page-two.ts b/packages/demos/angular/src/app/simple-nav/page-two/page-two.ts new file mode 100644 index 0000000000..9dc99216f4 --- /dev/null +++ b/packages/demos/angular/src/app/simple-nav/page-two/page-two.ts @@ -0,0 +1,39 @@ +import { Component, ViewEncapsulation } from '@angular/core'; +import { Location } from '@angular/common'; +import { NavController } from '@ionic/angular'; + + +@Component({ + selector: 'page-two', + template: ` + + + + Page Two + + + + Page Two - {{ts}} +
+ Go to Page Three +
+
+ Go Back +
+
+
+ ` +}) +export class PageTwo { + + constructor(private navController: NavController) { + } + + pushPageThreeComponent() { + this.navController.push('/simple-nav/page-three'); + } + + goBack() { + this.navController.pop(); + } +} diff --git a/packages/demos/angular/src/app/simple-nav/simple-nav-routing.module.ts b/packages/demos/angular/src/app/simple-nav/simple-nav-routing.module.ts new file mode 100644 index 0000000000..17494b42cd --- /dev/null +++ b/packages/demos/angular/src/app/simple-nav/simple-nav-routing.module.ts @@ -0,0 +1,22 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { SimpleNavPageComponent } from './simple-nav.component'; + +const routes: Routes = [ + { + path: '', + component: SimpleNavPageComponent, + children: [ + { path: 'page-one', loadChildren: './page-one/page-one.module#PageOneModule' }, + { path: 'page-two', loadChildren: './page-two/page-two.module#PageTwoModule' }, + { path: 'page-three', loadChildren: './page-three/page-three.module#PageThreeModule' } + ] + }, +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class SimpleNavRoutingModule { } diff --git a/packages/demos/angular/src/app/simple-nav/simple-nav.component.ts b/packages/demos/angular/src/app/simple-nav/simple-nav.component.ts new file mode 100644 index 0000000000..205c2b9cd2 --- /dev/null +++ b/packages/demos/angular/src/app/simple-nav/simple-nav.component.ts @@ -0,0 +1,15 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-nav-page', + template: ` + + + + ` +}) +export class SimpleNavPageComponent { + constructor() { + } + +} diff --git a/packages/demos/angular/src/app/simple-nav/simple-nav.module.ts b/packages/demos/angular/src/app/simple-nav/simple-nav.module.ts new file mode 100644 index 0000000000..89299b0dd7 --- /dev/null +++ b/packages/demos/angular/src/app/simple-nav/simple-nav.module.ts @@ -0,0 +1,21 @@ +import { CommonModule } from '@angular/common'; +import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; + +import { SimpleNavPageComponent } from './simple-nav.component'; +import { SimpleNavRoutingModule } from './simple-nav-routing.module'; + +import { IonicAngularModule, IonicRouterModule } from '@ionic/angular'; + +@NgModule({ + declarations: [ + SimpleNavPageComponent, + ], + imports: [ + CommonModule, + IonicAngularModule, + IonicRouterModule, + SimpleNavRoutingModule + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}) +export class SimpleNavModule {}