fix(): update to Stencil One 🎉🎊

This commit is contained in:
Manu MA
2019-06-19 21:33:50 +02:00
committed by GitHub
parent 7f1829eb21
commit b40f7d36d5
572 changed files with 14833 additions and 10323 deletions

View File

@ -82,13 +82,6 @@ Type: `Promise<void>`
Navigate to the specified URL.
#### Parameters
| Name | Type | Description |
| ----------- | ------------------------------- | -------------------------------------------------------- |
| `url` | `string` | The url to navigate to. |
| `direction` | `"back" \| "forward" \| "root"` | The direction of the animation. Defaults to `"forward"`. |
#### Returns
Type: `Promise<boolean>`

View File

@ -73,7 +73,7 @@ export class Router implements ComponentInterface {
this.win.addEventListener('ionRouteDataChanged', debounce(this.onRoutesChanged.bind(this), 100));
}
@Listen('window:popstate')
@Listen('popstate', { target: 'window' })
protected onPopState() {
const direction = this.historyDirection();
const path = this.getPath();
@ -81,7 +81,7 @@ export class Router implements ComponentInterface {
return this.writeNavStateRoot(path, direction);
}
@Listen('document:ionBackButton')
@Listen('ionBackButton', { target: 'document' })
protected onBackButton(ev: BackButtonEvent) {
ev.detail.register(0, () => this.back());
}
@ -115,7 +115,7 @@ export class Router implements ComponentInterface {
/** @internal */
@Method()
printDebug() {
async printDebug() {
console.debug('CURRENT PATH', this.getPath());
console.debug('PREVIOUS PATH', this.previousPath);
printRoutes(readRoutes(this.el));

View File

@ -8,8 +8,8 @@
<link href="../../../../../css/ionic.bundle.css" rel="stylesheet">
<link href="../../../../../scripts/testing/styles.css" rel="stylesheet">
<script src="../../../../../scripts/testing/scripts.js"></script>
<script src="../../../../../dist/ionic.js"></script>
<script>
<script nomodule src="../../../../../dist/ionic/ionic.js"></script>
<script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script> <script>
class PageOne extends HTMLElement {
connectedCallback() {

View File

@ -1,4 +1,4 @@
import { mockWindow } from '@stencil/core/mock-doc';
import { mockWindow } from '@stencil/core/testing';
import { RouteChain, RouteID } from '../utils/interface';
import { routerIDsToChain, routerPathToChain } from '../utils/matching';

View File

@ -1,4 +1,4 @@
import { mockWindow } from '@stencil/core/mock-doc';
import { mockWindow } from '@stencil/core/testing';
import { RouteRedirect, RouteTree } from '../utils/interface';
import { flattenRouterTree, readRedirects, readRouteNodes } from '../utils/parser';

View File

@ -8,8 +8,8 @@
<link href="../../../../../css/ionic.bundle.css" rel="stylesheet">
<link href="../../../../../scripts/testing/styles.css" rel="stylesheet">
<script src="../../../../../scripts/testing/scripts.js"></script>
<script src="../../../../../dist/ionic.js"></script>
<script>
<script nomodule src="../../../../../dist/ionic/ionic.js"></script>
<script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script> <script>
class PageOne extends HTMLElement {
connectedCallback() {

View File

@ -1,5 +1,10 @@
import { ComponentProps } from '../../../interface';
export interface HTMLStencilElement extends HTMLElement {
componentOnReady(): Promise<this>;
forceUpdate(): void;
}
export interface NavOutlet {
setRouteId(id: string, params: ComponentProps | undefined, direction: RouterDirection): Promise<RouteWrite>;
getRouteId(): Promise<RouteID | undefined>;