mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Compare commits
91 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c60588a290 | ||
|
|
77fcaef436 | ||
|
|
9c2181b8f9 | ||
|
|
4db20a648c | ||
|
|
f6d6596912 | ||
|
|
39e7da3840 | ||
|
|
9b3fb78a68 | ||
|
|
559f4d3bd5 | ||
|
|
f1a676e4c2 | ||
|
|
1573043f4e | ||
|
|
0a49648fe8 | ||
|
|
599bf3df5e | ||
|
|
fce5d8a04f | ||
|
|
108fc0fc3f | ||
|
|
521402b548 | ||
|
|
921ccbb79e | ||
|
|
c08de08d5f | ||
|
|
4199accdc2 | ||
|
|
70ab2a4e74 | ||
|
|
eacc5d4f23 | ||
|
|
112d4f5490 | ||
|
|
f42e81b02b | ||
|
|
9b5c0e035b | ||
|
|
4e56458b5c | ||
|
|
b5bfda2c42 | ||
|
|
200fa935b8 | ||
|
|
66faa1d959 | ||
|
|
b248eb7508 | ||
|
|
c7b2b186ec | ||
|
|
86210750d5 | ||
|
|
794d88d455 | ||
|
|
a48d02a966 | ||
|
|
d028a29d0e | ||
|
|
288c00a641 | ||
|
|
3b5c34c801 | ||
|
|
f2dc8b24b1 | ||
|
|
547ab8d8ef | ||
|
|
e2b3d753a7 | ||
|
|
3fb0371927 | ||
|
|
59f97e780d | ||
|
|
468dcd32fa | ||
|
|
cfd9e3b3a9 | ||
|
|
86e2742d58 | ||
|
|
8c207e827e | ||
|
|
fdacbbf1d0 | ||
|
|
ac04710b8a | ||
|
|
d0cad6b31e | ||
|
|
f5ef1ca552 | ||
|
|
830f885a06 | ||
|
|
318737535f | ||
|
|
04fe92cd58 | ||
|
|
b809665944 | ||
|
|
4d786b30ba | ||
|
|
4f49f27824 | ||
|
|
7e8bd5a8fe | ||
|
|
f4539aacc9 | ||
|
|
4911d9f01a | ||
|
|
6e64b8d915 | ||
|
|
e3216da03e | ||
|
|
bd0c265978 | ||
|
|
846eb09991 | ||
|
|
ac4a043314 | ||
|
|
106950533c | ||
|
|
295fe783b0 | ||
|
|
0a6bb3bb21 | ||
|
|
1b9c3daef1 | ||
|
|
54cdf00454 | ||
|
|
5bb3e73296 | ||
|
|
ae94f5ecea | ||
|
|
b87d212829 | ||
|
|
26b09f1d49 | ||
|
|
1e9539b9df | ||
|
|
17b3a39f0d | ||
|
|
475b722c7d | ||
|
|
50beafae6a | ||
|
|
f605f0a74c | ||
|
|
e401997a42 | ||
|
|
16f2ebe241 | ||
|
|
584afd040f | ||
|
|
de0f9d5f28 | ||
|
|
4596dbe5c0 | ||
|
|
400aa549d4 | ||
|
|
add0c4ecfe | ||
|
|
519d657e6e | ||
|
|
a8ceee467b | ||
|
|
97f9522110 | ||
|
|
961bfc3ebb | ||
|
|
5b9fe5e81a | ||
|
|
c4e7552b56 | ||
|
|
cec718c6c7 | ||
|
|
ab511c4744 |
30
.github/ISSUE_TEMPLATE.md
vendored
30
.github/ISSUE_TEMPLATE.md
vendored
@@ -1,12 +1,19 @@
|
||||
**Resources:**
|
||||
Before submitting an issue, please consult our troubleshooting guide (http://ionicframework.com/docs/troubleshooting/) and developer resources (http://ionicframework.com/docs/developer-resources/)
|
||||
|
||||
Please make sure you are posting an issue pertaining to the Ionic Framework. If you are having an issue with the Ionic Pro services (Ionic View, Ionic Deploy, etc.) please consult the Ionic Pro support portal (http://support.ionicjs.com)
|
||||
|
||||
**Ionic version:** (check one with "x")
|
||||
[ ] **1.x** (For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1)
|
||||
(For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1)
|
||||
[ ] **2.x**
|
||||
[ ] **3.x**
|
||||
[ ] **4.x**
|
||||
|
||||
**I'm submitting a ...** (check one with "x")
|
||||
[ ] bug report
|
||||
[ ] feature request
|
||||
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/
|
||||
|
||||
Please do not submit support requests or "How to" questions here. Instead, please use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/
|
||||
|
||||
**Current behavior:**
|
||||
<!-- Describe how the bug manifests. -->
|
||||
@@ -15,17 +22,22 @@
|
||||
<!-- Describe what the behavior would be without the bug. -->
|
||||
|
||||
**Steps to reproduce:**
|
||||
<!-- If you are able to illustrate the bug or feature request with an example, please provide steps to reproduce and if possible a demo using one of the following templates:
|
||||
|
||||
For Ionic V1 issues - http://plnkr.co/edit/Xo1QyAUx35ny1Xf9ODHx?p=preview
|
||||
|
||||
For Ionic issues - http://plnkr.co/edit/cpeRJs?p=preview
|
||||
-->
|
||||
<!-- Please explain the steps required to duplicate the issue, especially if you are able to provide a sample application. -->
|
||||
|
||||
**Related code:**
|
||||
|
||||
<!-- If you are able to illustrate the bug or feature request with an example, please provide a sample application via one of the following means:
|
||||
|
||||
A sample application via GitHub
|
||||
|
||||
StackBlitz (https://stackblitz.com)
|
||||
|
||||
Plunker (http://plnkr.co/edit/cpeRJs?p=preview)
|
||||
|
||||
-->
|
||||
|
||||
```
|
||||
insert any relevant code here
|
||||
insert short code snippets here
|
||||
```
|
||||
|
||||
**Other information:**
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -9,6 +9,7 @@ log.txt
|
||||
*.sublime-workspace
|
||||
|
||||
.idea/
|
||||
.sourcemaps/
|
||||
.vscode/
|
||||
.sass-cache/
|
||||
.versions/
|
||||
|
||||
148
CHANGELOG.md
148
CHANGELOG.md
@@ -1,3 +1,151 @@
|
||||
<a name="3.7.0"></a>
|
||||
# [3.7.0](https://github.com/ionic-team/ionic/compare/v3.6.1...v3.7.0) (2017-09-28)
|
||||
|
||||
### Notes
|
||||
This release adds support for the latest version of Angular (4.4.3) as well as the initial iteration of support for the iPhone X.
|
||||
|
||||
### Upgrade Instructions
|
||||
|
||||
These are the latest versions of `@angular`, `rxjs`, `zone.js` and `ionic-angular`. Update your `package.json` to match the following dependencies, remove the existing `node_modules` directory, and then run `npm install`:
|
||||
|
||||
```
|
||||
...
|
||||
"dependencies": {
|
||||
"@angular/common": "4.4.3",
|
||||
"@angular/compiler": "4.4.3",
|
||||
"@angular/compiler-cli": "4.4.3",
|
||||
"@angular/core": "4.4.3",
|
||||
"@angular/forms": "4.4.3",
|
||||
"@angular/http": "4.4.3",
|
||||
"@angular/platform-browser": "4.4.3",
|
||||
"@angular/platform-browser-dynamic": "4.4.3",
|
||||
"ionic-angular": "3.7.0",
|
||||
"rxjs": "5.4.3",
|
||||
"zone.js": "0.8.17"
|
||||
}
|
||||
"devDependencies": {
|
||||
"@ionic/app-scripts": "3.0.0"
|
||||
}
|
||||
...
|
||||
```
|
||||
|
||||
If you're using a `package-lock.json` file, make sure that is updated as well.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **input:** mark ion-input touched on blur instead of changed ([#12812](https://github.com/ionic-team/ionic/issues/12812)) ([d0cad6b](https://github.com/ionic-team/ionic/commit/d0cad6b)), closes [#12102](https://github.com/ionic-team/ionic/issues/12102)
|
||||
* **swiper:** change var to let to avoid variable shadowing ([f5ef1ca](https://github.com/ionic-team/ionic/commit/f5ef1ca))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* initial iphoneX support ([112d4f5](https://github.com/ionic-team/ionic/commit/112d4f5))
|
||||
|
||||
|
||||
<a name="3.6.1"></a>
|
||||
## [3.6.1](https://github.com/ionic-team/ionic/compare/v3.6.0...v3.6.1) (2017-09-07)
|
||||
|
||||
### Upgrade Instructions
|
||||
|
||||
`ionic-angular@3.6.1` is a drop-in replacement for 3.6.0. To install it, please run:
|
||||
|
||||
```
|
||||
npm install -g ionic@latest
|
||||
npm install @ionic/app-scripts@2.1.4 --save-dev
|
||||
npm install ionic-angular@3.6.1 --save
|
||||
```
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **generators:** Update documentation URLs for templates ([475b722](https://github.com/ionic-team/ionic/commit/475b722))
|
||||
* **navigation:** check existence of done transition callback ([#12640](https://github.com/ionic-team/ionic/issues/12640)) ([0a6bb3b](https://github.com/ionic-team/ionic/commit/0a6bb3b))
|
||||
* **navigation:** ensure secondaryId always has a string value ([#12641](https://github.com/ionic-team/ionic/issues/12641)) ([1069505](https://github.com/ionic-team/ionic/commit/1069505))
|
||||
* **navigation:** fix popTo signature and make usage uniform ([3187375](https://github.com/ionic-team/ionic/commit/3187375))
|
||||
* **slider:** guard the processing of _slides ([b809665](https://github.com/ionic-team/ionic/commit/b809665)), closes [#12791](https://github.com/ionic-team/ionic/issues/12791)
|
||||
|
||||
|
||||
|
||||
<a name="3.6.0"></a>
|
||||
# [3.6.0](https://github.com/ionic-team/ionic/compare/v3.5.3...v3.6.0) (2017-07-27)
|
||||
|
||||
|
||||
### Upgrade Instructions
|
||||
|
||||
`ionic-angular` 3.6.0 requires developer's to update to the latest version of the `Ionic CLI` and `@ionic/app-scripts`.
|
||||
|
||||
To upgrade, please run
|
||||
|
||||
```
|
||||
npm install -g ionic@latest
|
||||
npm install @ionic/app-scripts@latest --save-dev
|
||||
npm install ionic-angular@latest --save
|
||||
```
|
||||
|
||||
### Notes
|
||||
|
||||
The URL when using deep linking is shortened and improved in this release. Due to a limitation in our nav system, if you're using `ion-tabs` and have a tab name that matches a segment, meaning you have a tab name of `schedule` and a segment of `schedule`, there could potentially be issues. To mitigate these issues, make sure you set the `tabUrlPath` property on the `ion-tab` and give it a unique name. This limitation will require an API change to fix so it will be resolved in `ionic-angular` 4.x.
|
||||
|
||||
|
||||
The upgrades include necessary changes to generators that add back lazy loading functionality, as well as an improved way of generating component/directives/and pipes.
|
||||
|
||||
### New Generators
|
||||
|
||||
The release adds back the functionality to generate lazy loaded pages.
|
||||
To generate a lazy loaded page, run:
|
||||
|
||||
```bash
|
||||
ionic g page <Page-Name>
|
||||
```
|
||||
|
||||
This will include a `.module.ts` file in the page directory created. If you do not want to generate a lazy loaded page, you can run:
|
||||
|
||||
```bash
|
||||
ionic g page <Page-Name> --no-module
|
||||
```
|
||||
|
||||
This will also generate lazy loaded tabs as well, accepting the `--no-module` flag as well to disable it.
|
||||
|
||||
|
||||
For pipes/components/components, we now generate a shared common module for each of these.
|
||||
|
||||
So running:
|
||||
|
||||
```bash
|
||||
ionic g component music-card
|
||||
```
|
||||
|
||||
Will create a `components/components.module.ts` file that declares and exports the `music-card` component.
|
||||
We think that this will allow developers to get up and running with custom components much faster and will less overhead.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **list:** remove margin of MD buttons in ion-item-options ([#12263](https://github.com/ionic-team/ionic/issues/12263)) ([97f9522](https://github.com/ionic-team/ionic/commit/97f9522))
|
||||
* **nav:** make call to setPages return the promise so if it rejects it doesn't get lost ([de0f9d5](https://github.com/ionic-team/ionic/commit/de0f9d5))
|
||||
* **navigation:** account for race conditions in developer's code ([4596dbe](https://github.com/ionic-team/ionic/commit/4596dbe))
|
||||
* **navigation:** fix bug where that occurred when tab identifier and segment had the exact same string ([add0c4e](https://github.com/ionic-team/ionic/commit/add0c4e))
|
||||
* **navigation:** fix null pointer exceptions that would occur when destroying a nav controller while its transitioning ([584afd0](https://github.com/ionic-team/ionic/commit/584afd0))
|
||||
* **navigation:** reduce urls to minimum set of fields ([a8ceee4](https://github.com/ionic-team/ionic/commit/a8ceee4))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **generators:** refactor generators ([400aa54](https://github.com/ionic-team/ionic/commit/400aa54))
|
||||
|
||||
|
||||
|
||||
<a name="3.5.3"></a>
|
||||
## [3.5.3](https://github.com/ionic-team/ionic/compare/v3.5.2...v3.5.3) (2017-07-14)
|
||||
|
||||
## Upgrade Instructions
|
||||
`ionic-angular@3.5.3` is a drop-in replacement for `3.5.2`. To install it, simply run `npm install ionic-angular@3.5.3 --save --save-exact`.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **app:** restore getActiveNav api ([2d49e10](https://github.com/ionic-team/ionic/commit/2d49e10))
|
||||
|
||||
|
||||
|
||||
<a name="3.5.2"></a>
|
||||
## [3.5.2](https://github.com/ionic-team/ionic/compare/v3.5.1...v3.5.2) (2017-07-13)
|
||||
|
||||
|
||||
2
LICENSE
2
LICENSE
@@ -20,4 +20,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -4,6 +4,9 @@ jobs:
|
||||
working_directory: ~/ionic/
|
||||
docker:
|
||||
- image: node:7
|
||||
branches:
|
||||
ignore:
|
||||
- mono-refactor
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
|
||||
@@ -16,7 +16,7 @@ export class PageOne {
|
||||
|
||||
filterItems(ev: any) {
|
||||
this.setItems();
|
||||
let val = ev.value;
|
||||
let val = ev.target.value;
|
||||
|
||||
if (val && val.trim() !== '') {
|
||||
this.items = this.items.filter(function(item) {
|
||||
|
||||
3248
package-lock.json
generated
3248
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
33
package.json
33
package.json
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "ionic2",
|
||||
"version": "3.5.2",
|
||||
"version": "3.7.0",
|
||||
"description": "A powerful framework for building mobile and progressive web apps with JavaScript and Angular",
|
||||
"keywords": [
|
||||
"ionic",
|
||||
@@ -26,20 +26,20 @@
|
||||
"tsc": "tsc --outdir .tmp"
|
||||
},
|
||||
"dependencies": {
|
||||
"@angular/common": "4.1.3",
|
||||
"@angular/compiler": "4.1.3",
|
||||
"@angular/compiler-cli": "4.1.3",
|
||||
"@angular/core": "4.1.3",
|
||||
"@angular/forms": "4.1.3",
|
||||
"@angular/http": "4.1.3",
|
||||
"@angular/platform-browser": "4.1.3",
|
||||
"@angular/platform-browser-dynamic": "4.1.3",
|
||||
"@angular/common": "4.4.3",
|
||||
"@angular/compiler": "4.4.3",
|
||||
"@angular/compiler-cli": "4.4.3",
|
||||
"@angular/core": "4.4.3",
|
||||
"@angular/forms": "4.4.3",
|
||||
"@angular/http": "4.4.3",
|
||||
"@angular/platform-browser": "4.4.3",
|
||||
"@angular/platform-browser-dynamic": "4.4.3",
|
||||
"ionicons": "~3.0.0",
|
||||
"rxjs": "5.4.0",
|
||||
"zone.js": "0.8.12"
|
||||
"rxjs": "5.4.3",
|
||||
"zone.js": "0.8.18"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ionic/app-scripts": "^1.3.11",
|
||||
"@ionic/app-scripts": "3.0.0",
|
||||
"@ionic/commit-hooks": "1.0.3",
|
||||
"@types/connect": "3.4.30",
|
||||
"@types/del": "2.2.31",
|
||||
@@ -52,7 +52,7 @@
|
||||
"@types/lodash": "4.14.35",
|
||||
"@types/merge2": "0.3.29",
|
||||
"@types/mkdirp": "0.3.29",
|
||||
"@types/node": "^6.0.34",
|
||||
"@types/node": "^6.0.88",
|
||||
"@types/protractor": "^4.0.0",
|
||||
"@types/run-sequence": "0.0.28",
|
||||
"@types/semver": "5.3.30",
|
||||
@@ -131,12 +131,11 @@
|
||||
"sw-toolbox": "3.4.0",
|
||||
"systemjs": "0.19.38",
|
||||
"through2": "2.0.1",
|
||||
"ts-node": "1.3.0",
|
||||
"ts-node": "3.3.0",
|
||||
"tslint": "^5.4.3",
|
||||
"tslint-ionic-rules": "0.0.11",
|
||||
"typescript": "~2.3.3",
|
||||
"typescript": "~2.3.2",
|
||||
"vinyl": "1.2.0",
|
||||
"webpack": "^2.1.0-beta.27",
|
||||
"yargs": "5.0.0"
|
||||
},
|
||||
"config": {
|
||||
@@ -148,4 +147,4 @@
|
||||
"pre-push#master": [
|
||||
"test"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<ion-app></ion-app>
|
||||
|
||||
<script src="./build/polyfills.js"></script>
|
||||
<script src="./build/vendor.js"></script>
|
||||
<script src="./build/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -29,6 +29,14 @@ module.exports = function jekyll(renderDocsProcessor) {
|
||||
if (docs[i].href) {
|
||||
docs[i].href = doc.href.replace('content/', '');
|
||||
}
|
||||
if (docs[i].description) {
|
||||
docs[i].description = docs[i].description.replace(/(\#\#\#).+/g, (section) => {
|
||||
const title = section.replace(/^(\#+\s?)/, '');
|
||||
const segment = title.replace(/[^a-zA-Z0-9]+/g, '-').toLowerCase();
|
||||
|
||||
return `\n<h3><a class="anchor" name="${segment}" href="#${segment}">${title}</a></h3>\n`;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
docs.push({
|
||||
|
||||
23
scripts/docs/templates/common.template.html
vendored
23
scripts/docs/templates/common.template.html
vendored
@@ -242,7 +242,7 @@ Improve this doc
|
||||
|
||||
<!-- @usage tag -->
|
||||
<@ if doc.usage @>
|
||||
<h2><a class="anchor" name="usage" href="#usage"></a>Usage</h2>
|
||||
<h2><a class="anchor" name="usage" href="#usage">Usage</a></h2>
|
||||
<@ block usage @>
|
||||
<$ doc.usage | marked $>
|
||||
<@ endblock @>
|
||||
@@ -250,7 +250,7 @@ Improve this doc
|
||||
|
||||
<!-- @property tags -->
|
||||
<@ if doc.properties @>
|
||||
<h2><a class="anchor" name="attributes" href="#attributes"></a>Attributes:</h2>
|
||||
<h2><a class="anchor" name="attributes" href="#attributes">Attributes</a></h2>
|
||||
<table class="table" style="margin:0;">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -293,10 +293,10 @@ Improve this doc
|
||||
|
||||
|
||||
<@- if doc.statics.length -@>
|
||||
<h2><a class="anchor" name="static-members" href="#static-members"></a>Static Members</h2>
|
||||
<h2><a class="anchor" name="static-members" href="#static-members">Static Members</a></h2>
|
||||
<@- for method in doc.statics @><@ if not method.internal @>
|
||||
<div id="<$ method.name $>"></div>
|
||||
<h3><a class="anchor" name="<$ method.name $>" href="#<$ method.name $>"></a><$ functionSyntax(method) $></h3>
|
||||
<h3><a class="anchor" name="<$ method.name $>" href="#<$ method.name $>"><$ functionSyntax(method) $></a></h3>
|
||||
|
||||
<$ method.description $>
|
||||
|
||||
@@ -327,14 +327,15 @@ Improve this doc
|
||||
<!-- instance methods on the class -->
|
||||
<@- if doc.members and doc.members.length @>
|
||||
|
||||
<h2><a class="anchor" name="instance-members" href="#instance-members"></a>Instance Members</h2>
|
||||
<h2><a class="anchor" name="instance-members" href="#instance-members">Instance Members</a></h2>
|
||||
<@- for method in doc.members @>
|
||||
|
||||
<div id="<$ method.name $>"></div>
|
||||
|
||||
<h3>
|
||||
<a class="anchor" name="<$ method.name $>" href="#<$ method.name $>"></a>
|
||||
<a class="anchor" name="<$ method.name $>" href="#<$ method.name $>">
|
||||
<$ functionSyntax(method) $>
|
||||
</a>
|
||||
</h3>
|
||||
|
||||
<$ method.description $>
|
||||
@@ -366,26 +367,26 @@ Improve this doc
|
||||
|
||||
<@- if doc.inputs and doc.inputs.length @>
|
||||
<!-- input methods on the class -->
|
||||
<h2><a class="anchor" name="input-properties" href="#input-properties"></a>Input Properties</h2>
|
||||
<h2><a class="anchor" name="input-properties" href="#input-properties">Input Properties</a></h2>
|
||||
<$ inputTable(doc.inputs) $>
|
||||
<@- endif -@>
|
||||
|
||||
<@- if doc.outputs and doc.outputs.length @>
|
||||
<!-- output events on the class -->
|
||||
<h2><a class="anchor" name="output-events" href="#output-events"></a>Output Events</h2>
|
||||
<h2><a class="anchor" name="output-events" href="#output-events">Output Events</a></h2>
|
||||
<$ outputTable(doc.outputs) $>
|
||||
<@- endif -@>
|
||||
|
||||
|
||||
<@ block advanced @>
|
||||
<@- if doc.advanced -@>
|
||||
<h2><a class="anchor" name="advanced" href="#advanced"></a>Advanced</h2>
|
||||
<h2><a class="anchor" name="advanced" href="#advanced">Advanced</a></h2>
|
||||
<$ doc.advanced | marked $>
|
||||
<@- endif -@>
|
||||
<@ endblock @>
|
||||
|
||||
<@ if doc.sassVariables @>
|
||||
<h2 id="sass-variable-header"><a class="anchor" name="sass-variables" href="#sass-variables"></a>Sass Variables</h2>
|
||||
<h2 id="sass-variable-header"><a class="anchor" name="sass-variables" href="#sass-variables">Sass Variables</a></h2>
|
||||
<$ sassTable(doc.sassVariables) $>
|
||||
<@ endif @>
|
||||
|
||||
@@ -393,7 +394,7 @@ Improve this doc
|
||||
<!-- related link -->
|
||||
<@- if doc.see @>
|
||||
|
||||
<h2><a class="anchor" name="related" href="#related"></a>Related</h2>
|
||||
<h2><a class="anchor" name="related" href="#related">Related</a></h2>
|
||||
<@ for s in doc.see @>
|
||||
<$ s | safe $> <@- if not loop.last @>,<@- endif -@>
|
||||
<@- endfor -@>
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
}
|
||||
</script>
|
||||
<script src="./build/polyfills.ng.js"></script>
|
||||
<script src="./build/vendor.js"></script>
|
||||
<script src="./build/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -59,9 +59,9 @@ function getDemosEntryPoints() {
|
||||
|
||||
|
||||
function buildDemos(filePaths: string[]) {
|
||||
var batches = chunkArrayInGroups(filePaths, argv.batches || 1);
|
||||
var batch = argv.batch || 0;
|
||||
if(batch >= batches.length) {
|
||||
const batches = chunkArrayInGroups(filePaths, argv.batches || 1);
|
||||
const batch = argv.batch || 0;
|
||||
if (batch >= batches.length) {
|
||||
throw new Error(`Batch number higher than total number of batches.`);
|
||||
}
|
||||
|
||||
@@ -99,15 +99,23 @@ function buildDemo(filePath: string) {
|
||||
const appNgModulePath = join(dirname(filePath), 'app.module.ts');
|
||||
const distDir = join(distTestRoot, 'www');
|
||||
|
||||
const minifyCss = argv.noMinifyCss ? false : true;
|
||||
const minifyJs = argv.noMinifyJs ? false : true;
|
||||
const optimizeJs = argv.noOptimizeJs ? false : true;
|
||||
|
||||
return runAppScriptsBuild(
|
||||
appEntryPoint,
|
||||
appNgModulePath,
|
||||
ionicAngularDir,
|
||||
distDir,
|
||||
pathToWriteFile,
|
||||
ionicAngularDir,
|
||||
sassConfigPath,
|
||||
copyConfigPath
|
||||
appEntryPoint,
|
||||
appNgModulePath,
|
||||
ionicAngularDir,
|
||||
distDir,
|
||||
pathToWriteFile,
|
||||
ionicAngularDir,
|
||||
sassConfigPath,
|
||||
copyConfigPath,
|
||||
false,
|
||||
minifyCss,
|
||||
minifyJs,
|
||||
optimizeJs
|
||||
).then(() => {
|
||||
const end = Date.now();
|
||||
console.log(`${filePath} took a total of ${(end - start) / 1000} seconds to build`);
|
||||
@@ -116,8 +124,8 @@ function buildDemo(filePath: string) {
|
||||
}
|
||||
|
||||
function chunkArrayInGroups(arr, size) {
|
||||
var result = [];
|
||||
for(var i = 0; i < arr.length; i++) {
|
||||
const result = [];
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
if (!Array.isArray(result[i % size])) {
|
||||
result[i % size] = [];
|
||||
}
|
||||
@@ -129,7 +137,7 @@ function chunkArrayInGroups(arr, size) {
|
||||
function uploadToS3(path) {
|
||||
// fail silently if envars not present
|
||||
if (!process.env.AWS_KEY || !process.env.AWS_SECRET) {
|
||||
return new Promise((resolve) => {resolve();});
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
let client = s3.createClient({
|
||||
@@ -143,23 +151,23 @@ function uploadToS3(path) {
|
||||
let demo = path.split('/')[path.split('/').length - 2];
|
||||
|
||||
let params = {
|
||||
localDir: path.replace('tsconfig.json',''),
|
||||
deleteRemoved: true,
|
||||
localDir: path.replace('tsconfig.json', ''),
|
||||
deleteRemoved: true,
|
||||
s3Params: {
|
||||
Bucket: "ionic-demos",
|
||||
Bucket: 'ionic-demos',
|
||||
Prefix: demo,
|
||||
},
|
||||
};
|
||||
|
||||
var uploader = client.uploadDir(params);
|
||||
const uploader = client.uploadDir(params);
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
uploader.on('error', function(err) {
|
||||
console.error("s3 Upload Error:", err.stack);
|
||||
console.error('s3 Upload Error:', err.stack);
|
||||
reject();
|
||||
});
|
||||
uploader.on('end', function() {
|
||||
console.log(demo, " demo uploaded to s3");
|
||||
console.log(demo, ' demo uploaded to s3');
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
@@ -167,7 +175,7 @@ function uploadToS3(path) {
|
||||
|
||||
task('demos.download', (done: Function) => {
|
||||
if (!process.env.AWS_KEY || !process.env.AWS_SECRET) {
|
||||
return new Promise((resolve) => {resolve();});
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
let client = s3.createClient({
|
||||
@@ -180,23 +188,23 @@ task('demos.download', (done: Function) => {
|
||||
let params = {
|
||||
localDir: join(process.cwd(), 'dist', 'demos', 'src'),
|
||||
s3Params: {
|
||||
Bucket: "ionic-demos",
|
||||
Bucket: 'ionic-demos',
|
||||
},
|
||||
};
|
||||
|
||||
let uploader = client.downloadDir(params);
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
uploader.on('error', function(err) {
|
||||
console.error("s3 Download Error:", err.stack);
|
||||
console.error('s3 Download Error:', err.stack);
|
||||
reject();
|
||||
});
|
||||
uploader.on('end', function() {
|
||||
console.log("Demos downloaded from s3");
|
||||
console.log('Demos downloaded from s3');
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
task('demos.clean', (done: Function) => {
|
||||
// this is a super hack, but it works for now
|
||||
|
||||
@@ -22,34 +22,10 @@ task('demos.polyfill', (done: Function) => {
|
||||
});
|
||||
});
|
||||
|
||||
task('demos.copyAndCompile', (done: (err: any) => void) => {
|
||||
runSequence(
|
||||
'demos.copySource',
|
||||
'demos.compileTests',
|
||||
'demos.bundle',
|
||||
done);
|
||||
});
|
||||
|
||||
task('demos.copyExternalDependencies', () => {
|
||||
src([`${SCRIPTS_ROOT}/${DEMOS_NAME}/*.css`]).pipe(dest(`${DIST_DEMOS_ROOT}/css`));
|
||||
});
|
||||
|
||||
task('demos.sass', () => {
|
||||
// ensure there is a version.scss file
|
||||
setSassIonicVersion(`E2E-${createTimestamp()}`);
|
||||
return compileSass(`${DIST_DEMOS_ROOT}/css`);
|
||||
});
|
||||
|
||||
task('demos.fonts', () => {
|
||||
return copyFonts(`${DIST_DEMOS_ROOT}/fonts`);
|
||||
});
|
||||
|
||||
task('demos.serve', function() {
|
||||
connect.server({
|
||||
root: './',
|
||||
port: LOCAL_SERVER_PORT,
|
||||
livereload: {
|
||||
port: 35700
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -133,7 +133,11 @@ function buildTest(filePath: string) {
|
||||
const appNgModulePath = join(dirname(appEntryPoint), 'app.module.ts');
|
||||
const distDir = join(distTestRoot, 'www');
|
||||
|
||||
return runAppScriptsBuild(appEntryPoint, appNgModulePath, ionicAngularDir, distDir, pathToWriteFile, ionicAngularDir, sassConfigPath, copyConfigPath, argv.dev).then(() => {
|
||||
const minifyCss = argv.minifyCss ? true : false;
|
||||
const minifyJs = argv.minifyJs ? true : false;
|
||||
const optimizeJs = argv.optimizeJs ? true : false;
|
||||
|
||||
return runAppScriptsBuild(appEntryPoint, appNgModulePath, ionicAngularDir, distDir, pathToWriteFile, ionicAngularDir, sassConfigPath, copyConfigPath, argv.dev, minifyCss, minifyJs, optimizeJs).then(() => {
|
||||
const end = Date.now();
|
||||
console.log(`${filePath} took a total of ${(end - start) / 1000} seconds to build`);
|
||||
}).catch((err) => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { task, src, dest } from 'gulp';
|
||||
import { writePolyfills } from '../util';
|
||||
import { dest, src, task } from 'gulp';
|
||||
import { readFileAsync, writeFileAsync, writePolyfills } from '../util';
|
||||
import { join } from 'path';
|
||||
|
||||
task('polyfill', ['polyfill.copy-readme', 'polyfill.write']);
|
||||
@@ -13,6 +13,9 @@ task('polyfill.write', (done: Function) => {
|
||||
});
|
||||
|
||||
task('polyfill.copy-readme', (done: Function) => {
|
||||
return src(join('scripts', 'polyfill', 'readme.md'))
|
||||
.pipe(dest(join('dist', 'ionic-angular', 'polyfills')), done);
|
||||
return readFileAsync(join('scripts', 'polyfill', 'readme.md')).then((fileContent: string) => {
|
||||
return writeFileAsync(join('dist', 'ionic-angular', 'polyfills', 'readme.md'), fileContent);
|
||||
}).then(() => {
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -246,10 +246,10 @@ export function runAppScriptsServe(testOrDemoName: string, appEntryPoint: string
|
||||
});
|
||||
}
|
||||
|
||||
export function runAppScriptsBuild(appEntryPoint: string, appNgModulePath: string, srcDir: string, distDir: string, tsConfig: string, ionicAngularDir: string, sassConfigPath: string, copyConfigPath: string, isDev: boolean = false) {
|
||||
export function runAppScriptsBuild(appEntryPoint: string, appNgModulePath: string, srcDir: string, distDir: string, tsConfig: string, ionicAngularDir: string, sassConfigPath: string, copyConfigPath: string, isDev: boolean = false, minifyCss: boolean = true, minifyJs: boolean = true, optimizeJs: boolean = true) {
|
||||
const pathToAppScripts = join(NODE_MODULES_ROOT, '.bin', 'ionic-app-scripts');
|
||||
const debug: boolean = argv.debug;
|
||||
return runWorker(pathToAppScripts, debug, appEntryPoint, appNgModulePath, srcDir, distDir, tsConfig, ionicAngularDir, sassConfigPath, copyConfigPath, isDev);
|
||||
return runWorker(pathToAppScripts, debug, appEntryPoint, appNgModulePath, srcDir, distDir, tsConfig, ionicAngularDir, sassConfigPath, copyConfigPath, isDev, minifyCss, minifyJs, optimizeJs);
|
||||
}
|
||||
|
||||
/** Resolves the path for a node package executable. */
|
||||
@@ -325,7 +325,7 @@ export function writePolyfills(outputDirectory: string) {
|
||||
promises.push(bundlePolyfill(NG_ENTRIES, join(outputDirectory, 'polyfills.ng.js')));
|
||||
|
||||
return Promise.all(promises);
|
||||
};
|
||||
}
|
||||
|
||||
function bundlePolyfill(pathsToIncludeInPolyfill: string[], outputPath: string) {
|
||||
return rollup({
|
||||
|
||||
@@ -3,7 +3,7 @@ import { dirname, join } from 'path';
|
||||
|
||||
import { MessageToWorker, WorkerProcess } from './interfaces';
|
||||
|
||||
export function runWorker(pathToAppScripts: string, debug: boolean, appEntryPoint: string, appNgModulePath: string, srcDir: string, distDir: string, tsConfig: string, ionicAngularDir: string, sassConfigPath: string, copyConfigPath: string, isDev: boolean) {
|
||||
export function runWorker(pathToAppScripts: string, debug: boolean, appEntryPoint: string, appNgModulePath: string, srcDir: string, distDir: string, tsConfig: string, ionicAngularDir: string, sassConfigPath: string, copyConfigPath: string, isDev: boolean, minifyCss: boolean, minifyJs: boolean, optimizeJs: boolean) {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
const msgToWorker: MessageToWorker = {
|
||||
@@ -17,7 +17,10 @@ export function runWorker(pathToAppScripts: string, debug: boolean, appEntryPoin
|
||||
ionicAngularDir: ionicAngularDir,
|
||||
sassConfigPath: sassConfigPath,
|
||||
copyConfigPath: copyConfigPath,
|
||||
isDev: isDev
|
||||
isDev: isDev,
|
||||
minifyCss: minifyCss,
|
||||
minifyJs: minifyJs,
|
||||
optimizeJs: optimizeJs
|
||||
};
|
||||
|
||||
const worker = <ChildProcess>createWorker(msgToWorker);
|
||||
@@ -84,6 +87,18 @@ export function createWorker(msg: MessageToWorker): any {
|
||||
scriptArgs.push('--debug');
|
||||
}
|
||||
|
||||
if (msg.minifyJs) {
|
||||
scriptArgs.push('--minifyJs');
|
||||
}
|
||||
|
||||
if (msg.minifyCss) {
|
||||
scriptArgs.push('--minifyCss');
|
||||
}
|
||||
|
||||
if (msg.optimizeJs) {
|
||||
scriptArgs.push('--optimizeJs');
|
||||
}
|
||||
|
||||
const workerModule = join(process.cwd(), 'node_modules', '@ionic', 'app-scripts', 'bin', 'ionic-app-scripts.js');
|
||||
const worker = fork(workerModule, scriptArgs, {
|
||||
env: {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
export interface WorkerProcess {
|
||||
appEntryPoint: string;
|
||||
worker: any;
|
||||
};
|
||||
}
|
||||
|
||||
export interface MessageToWorker {
|
||||
pathToAppScripts: string;
|
||||
@@ -16,4 +16,8 @@ export interface MessageToWorker {
|
||||
sassConfigPath: string;
|
||||
copyConfigPath: string;
|
||||
isDev: boolean;
|
||||
};
|
||||
minifyJs: boolean;
|
||||
minifyCss: boolean;
|
||||
optimizeJs: boolean;
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ export function config(config) {
|
||||
'dist/ionic-angular/umd/**/!(*spec).js': ['coverage'],
|
||||
'dist/ionic-angular/**/*.js': ['sourcemap']
|
||||
},
|
||||
reporters: ['dots', 'coverage', 'spec'],
|
||||
reporters: ['coverage', 'spec'],
|
||||
specReporter: {
|
||||
maxLogLines: 5, // limit number of lines logged per test
|
||||
suppressErrorSummary: true, // do not print error summary
|
||||
|
||||
@@ -3,8 +3,8 @@ import { Component } from '@angular/core';
|
||||
/**
|
||||
* Generated class for the $CLASSNAME component.
|
||||
*
|
||||
* See https://angular.io/docs/ts/latest/api/core/index/ComponentMetadata-class.html
|
||||
* for more info on Angular Components.
|
||||
* See https://angular.io/api/core/Component for more info on Angular
|
||||
* Components.
|
||||
*/
|
||||
@Component({
|
||||
selector: '$FILENAME',
|
||||
|
||||
@@ -3,8 +3,8 @@ import { Directive } from '@angular/core';
|
||||
/**
|
||||
* Generated class for the $CLASSNAME directive.
|
||||
*
|
||||
* See https://angular.io/docs/ts/latest/api/core/index/DirectiveMetadata-class.html
|
||||
* for more info on Angular Directives.
|
||||
* See https://angular.io/api/core/Directive for more info on Angular
|
||||
* Directives.
|
||||
*/
|
||||
@Directive({
|
||||
selector: '[$FILENAME]' // Attribute selector
|
||||
|
||||
@@ -9,8 +9,5 @@ import { $CLASSNAME } from './$FILENAME';
|
||||
imports: [
|
||||
IonicPageModule.forChild($CLASSNAME),
|
||||
],
|
||||
exports: [
|
||||
$CLASSNAME
|
||||
]
|
||||
})
|
||||
export class $CLASSNAMEModule {}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { NavController, NavParams } from 'ionic-angular';
|
||||
$IMPORTSTATEMENT
|
||||
|
||||
/**
|
||||
* Generated class for the $CLASSNAME page.
|
||||
*
|
||||
* See http://ionicframework.com/docs/components/#navigation for more info
|
||||
* on Ionic pages and navigation.
|
||||
* See https://ionicframework.com/docs/components/#navigation for more info on
|
||||
* Ionic pages and navigation.
|
||||
*/
|
||||
|
||||
$IONICPAGE
|
||||
@Component({
|
||||
selector: 'page-$FILENAME',
|
||||
templateUrl: '$FILENAME.html',
|
||||
|
||||
@@ -3,11 +3,10 @@ import { Pipe, PipeTransform } from '@angular/core';
|
||||
/**
|
||||
* Generated class for the $CLASSNAME pipe.
|
||||
*
|
||||
* See https://angular.io/docs/ts/latest/guide/pipes.html for more info on
|
||||
* Angular Pipes.
|
||||
* See https://angular.io/api/core/Pipe for more info on Angular Pipes.
|
||||
*/
|
||||
@Pipe({
|
||||
name: '$FILENAME',
|
||||
name: '$PIPENAME',
|
||||
})
|
||||
export class $CLASSNAME implements PipeTransform {
|
||||
/**
|
||||
|
||||
@@ -5,8 +5,8 @@ import 'rxjs/add/operator/map';
|
||||
/*
|
||||
Generated class for the $CLASSNAME provider.
|
||||
|
||||
See https://angular.io/docs/ts/latest/guide/dependency-injection.html
|
||||
for more info on providers and Angular DI.
|
||||
See https://angular.io/guide/dependency-injection for more info on providers
|
||||
and Angular DI.
|
||||
*/
|
||||
@Injectable()
|
||||
export class $CLASSNAME {
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { NavController } from 'ionic-angular';
|
||||
$TABS_IMPORTSTATEMENT
|
||||
|
||||
/**
|
||||
* Generated class for the $CLASSNAME tabs.
|
||||
*
|
||||
* See https://angular.io/docs/ts/latest/guide/dependency-injection.html for
|
||||
* more info on providers and Angular DI.
|
||||
* See https://ionicframework.com/docs/components/#navigation for more info on
|
||||
* Ionic pages and navigation.
|
||||
*/
|
||||
$IONICPAGE
|
||||
@Component({
|
||||
selector: 'page-$FILENAME',
|
||||
templateUrl: '$FILENAME.html'
|
||||
|
||||
@@ -39,10 +39,10 @@ import { Config } from '../../config/config';
|
||||
*
|
||||
* export class MyClass{
|
||||
*
|
||||
* constructor(public actionSheetCtrl: ActionSheetController) {}
|
||||
* constructor(public actionSheetCtrl: ActionSheetController) { }
|
||||
*
|
||||
* presentActionSheet() {
|
||||
* let actionSheet = this.actionSheetCtrl.create({
|
||||
* const actionSheet = this.actionSheetCtrl.create({
|
||||
* title: 'Modify your album',
|
||||
* buttons: [
|
||||
* {
|
||||
@@ -115,7 +115,7 @@ import { Config } from '../../config/config';
|
||||
* out first, *then* start the next transition.
|
||||
*
|
||||
* ```ts
|
||||
* let actionSheet = this.actionSheetCtrl.create({
|
||||
* const actionSheet = this.actionSheetCtrl.create({
|
||||
* title: 'Hello',
|
||||
* buttons: [{
|
||||
* text: 'Ok',
|
||||
|
||||
@@ -89,6 +89,10 @@ $action-sheet-ios-button-cancel-font-weight: 600 !default;
|
||||
@include text-align($action-sheet-ios-text-align);
|
||||
}
|
||||
|
||||
.action-sheet-ios .action-sheet-wrapper {
|
||||
@include margin(auto, auto, constant(safe-area-inset-bottom), auto);
|
||||
}
|
||||
|
||||
.action-sheet-ios .action-sheet-container {
|
||||
@include deprecated-variable(padding, $action-sheet-ios-padding) {
|
||||
@include padding($action-sheet-ios-padding-top, $action-sheet-ios-padding-end, $action-sheet-ios-padding-bottom, $action-sheet-ios-padding-start);
|
||||
|
||||
@@ -51,12 +51,10 @@ import { Config } from '../../config/config';
|
||||
* ```ts
|
||||
* import { AlertController } from 'ionic-angular';
|
||||
*
|
||||
* constructor(private alertCtrl: AlertController) {
|
||||
*
|
||||
* }
|
||||
* constructor(public alertCtrl: AlertController) { }
|
||||
*
|
||||
* presentAlert() {
|
||||
* let alert = this.alertCtrl.create({
|
||||
* const alert = this.alertCtrl.create({
|
||||
* title: 'Low battery',
|
||||
* subTitle: '10% of battery remaining',
|
||||
* buttons: ['Dismiss']
|
||||
@@ -65,7 +63,7 @@ import { Config } from '../../config/config';
|
||||
* }
|
||||
*
|
||||
* presentConfirm() {
|
||||
* let alert = this.alertCtrl.create({
|
||||
* const alert = this.alertCtrl.create({
|
||||
* title: 'Confirm purchase',
|
||||
* message: 'Do you want to buy this book?',
|
||||
* buttons: [
|
||||
@@ -88,7 +86,7 @@ import { Config } from '../../config/config';
|
||||
* }
|
||||
*
|
||||
* presentPrompt() {
|
||||
* let alert = this.alertCtrl.create({
|
||||
* const alert = this.alertCtrl.create({
|
||||
* title: 'Login',
|
||||
* inputs: [
|
||||
* {
|
||||
@@ -181,14 +179,14 @@ import { Config } from '../../config/config';
|
||||
* out first, *then* start the next transition.
|
||||
*
|
||||
* ```ts
|
||||
* let alert = this.alertCtrl.create({
|
||||
* const alert = this.alertCtrl.create({
|
||||
* title: 'Hello',
|
||||
* buttons: [{
|
||||
* text: 'Ok',
|
||||
* handler: () => {
|
||||
* // user has clicked the alert button
|
||||
* // begin the alert's dismiss transition
|
||||
* let navTransition = alert.dismiss();
|
||||
* const navTransition = alert.dismiss();
|
||||
*
|
||||
* // start some async method
|
||||
* someAsyncOperation().then(() => {
|
||||
|
||||
@@ -419,8 +419,31 @@ export class App {
|
||||
}
|
||||
}
|
||||
|
||||
getNavByIdOrName(id: string) {
|
||||
const navs = Array.from(this._rootNavs.values());
|
||||
for (const navContainer of navs) {
|
||||
const match = getNavByIdOrName(navContainer, id);
|
||||
if (match) {
|
||||
return match;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export function getNavByIdOrName(nav: NavigationContainer, id: string): NavigationContainer {
|
||||
if (nav.id === id || nav.name === id) {
|
||||
return nav;
|
||||
}
|
||||
for (const child of nav.getAllChildNavs()) {
|
||||
const tmp = getNavByIdOrName(child, id);
|
||||
if (tmp) {
|
||||
return tmp;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function getPoppableNav(nav: NavControllerBase): NavControllerBase {
|
||||
if (!nav) {
|
||||
@@ -455,6 +478,7 @@ export function findTopNavs(nav: NavigationContainer): NavigationContainer[] {
|
||||
return containers;
|
||||
}
|
||||
|
||||
|
||||
const SKIP_BLURRING = ['INPUT', 'TEXTAREA', 'ION-INPUT', 'ION-TEXTAREA'];
|
||||
const ACTIVE_SCROLLING_TIME = 100;
|
||||
const CLICK_BLOCK_BUFFER_IN_MILLIS = 64;
|
||||
|
||||
@@ -767,6 +767,149 @@ describe('App', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('getNavByIdOrName', () => {
|
||||
it('should return a basic root nav', () => {
|
||||
const nav = mockNavController();
|
||||
app.registerRootNav(nav);
|
||||
const result = app.getNavByIdOrName(nav.id);
|
||||
expect(result).toEqual(nav);
|
||||
});
|
||||
|
||||
it('should return a child nav', () => {
|
||||
const rootNav = mockNavController();
|
||||
app.registerRootNav(rootNav);
|
||||
|
||||
const childNav = mockNavController();
|
||||
childNav.parent = rootNav;
|
||||
rootNav.registerChildNav(childNav);
|
||||
|
||||
const childChildNav = mockNavController();
|
||||
childChildNav.parent = childNav;
|
||||
childNav.registerChildNav(childChildNav);
|
||||
|
||||
|
||||
const expectedChildNav = app.getNavByIdOrName(childNav.id);
|
||||
expect(expectedChildNav).toEqual(childNav);
|
||||
|
||||
const expectedChildChildNav = app.getNavByIdOrName(childChildNav.id);
|
||||
expect(expectedChildChildNav).toEqual(childChildNav);
|
||||
});
|
||||
|
||||
it('should return a child nav when there is a tabs in there', () => {
|
||||
const rootNav = mockNavController();
|
||||
app.registerRootNav(rootNav);
|
||||
|
||||
const tabs = mockTabs();
|
||||
tabs.parent = rootNav;
|
||||
rootNav.registerChildNav(tabs);
|
||||
|
||||
const tab1 = mockTab(tabs);
|
||||
const tab2 = mockTab(tabs);
|
||||
const tab3 = mockTab(tabs);
|
||||
|
||||
const tabChildNav = mockNavController();
|
||||
tabChildNav.parent = tab2;
|
||||
tab2.registerChildNav(tabChildNav);
|
||||
|
||||
const tabChildChildNav = mockNavController();
|
||||
tabChildChildNav.parent = tabChildNav;
|
||||
tabChildNav.registerChildNav(tabChildChildNav);
|
||||
|
||||
const expectedTab1 = app.getNavByIdOrName(tab1.id);
|
||||
expect(expectedTab1).toEqual(tab1);
|
||||
|
||||
const expectedTab2 = app.getNavByIdOrName(tab2.id);
|
||||
expect(expectedTab2).toEqual(tab2);
|
||||
|
||||
const expectedTab3 = app.getNavByIdOrName(tab3.id);
|
||||
expect(expectedTab3).toEqual(tab3);
|
||||
|
||||
const expectedTabChildNav = app.getNavByIdOrName(tabChildNav.id);
|
||||
expect(expectedTabChildNav).toEqual(tabChildNav);
|
||||
|
||||
const expectedTabChildChildNav = app.getNavByIdOrName(tabChildChildNav.id);
|
||||
expect(expectedTabChildChildNav).toEqual(tabChildChildNav);
|
||||
});
|
||||
|
||||
it('should return a basic root nav when the are multiple root navs', () => {
|
||||
const rootNavOne = mockNavController();
|
||||
const rootNavTwo = mockNavController();
|
||||
const rootNavThree = mockNavController();
|
||||
app.registerRootNav(rootNavOne);
|
||||
app.registerRootNav(rootNavTwo);
|
||||
app.registerRootNav(rootNavThree);
|
||||
|
||||
const expectedRootNavOne = app.getNavByIdOrName(rootNavOne.id);
|
||||
expect(expectedRootNavOne).toEqual(rootNavOne);
|
||||
|
||||
const expectedRootNavTwo = app.getNavByIdOrName(rootNavTwo.id);
|
||||
expect(expectedRootNavTwo).toEqual(rootNavTwo);
|
||||
|
||||
const expectedRootNavThree = app.getNavByIdOrName(rootNavThree.id);
|
||||
expect(expectedRootNavThree).toEqual(rootNavThree);
|
||||
});
|
||||
|
||||
it('should return a proper navs when there are multiple root navs with nested navs', () => {
|
||||
const rootNavOne = mockNavController();
|
||||
const rootNavTwo = mockNavController();
|
||||
const rootNavThree = mockNavController();
|
||||
app.registerRootNav(rootNavOne);
|
||||
app.registerRootNav(rootNavTwo);
|
||||
app.registerRootNav(rootNavThree);
|
||||
|
||||
const childNavOne = mockNavController();
|
||||
childNavOne.parent = rootNavOne;
|
||||
rootNavOne.registerChildNav(childNavOne);
|
||||
|
||||
const childChildNavOne = mockNavController();
|
||||
childChildNavOne.parent = childNavOne;
|
||||
childNavOne.registerChildNav(childChildNavOne);
|
||||
|
||||
const childNavTwo = mockNavController();
|
||||
childNavOne.parent = rootNavTwo;
|
||||
rootNavTwo.registerChildNav(childNavTwo);
|
||||
|
||||
const childChildNavTwo = mockNavController();
|
||||
childChildNavTwo.parent = childNavTwo;
|
||||
childNavTwo.registerChildNav(childChildNavTwo);
|
||||
|
||||
const childNavThree = mockNavController();
|
||||
childNavThree.parent = rootNavThree;
|
||||
rootNavThree.registerChildNav(childNavThree);
|
||||
|
||||
const childChildNavThree = mockNavController();
|
||||
childChildNavThree.parent = childNavThree;
|
||||
childNavThree.registerChildNav(childChildNavThree);
|
||||
|
||||
const expectedRootNavOne = app.getNavByIdOrName(rootNavOne.id);
|
||||
expect(expectedRootNavOne).toEqual(rootNavOne);
|
||||
|
||||
const expectedChildNavOne = app.getNavByIdOrName(childNavOne.id);
|
||||
expect(expectedChildNavOne).toEqual(childNavOne);
|
||||
|
||||
const expectedChildChildNavOne = app.getNavByIdOrName(childChildNavOne.id);
|
||||
expect(expectedChildChildNavOne).toEqual(childChildNavOne);
|
||||
|
||||
const expectedRootNavTwo = app.getNavByIdOrName(rootNavTwo.id);
|
||||
expect(expectedRootNavTwo).toEqual(rootNavTwo);
|
||||
|
||||
const expectedChildNavTwo = app.getNavByIdOrName(childNavTwo.id);
|
||||
expect(expectedChildNavTwo).toEqual(childNavTwo);
|
||||
|
||||
const expectedChildChildNavTwo = app.getNavByIdOrName(childChildNavTwo.id);
|
||||
expect(expectedChildChildNavTwo).toEqual(childChildNavTwo);
|
||||
|
||||
const expectedRootNavThree = app.getNavByIdOrName(rootNavThree.id);
|
||||
expect(expectedRootNavThree).toEqual(rootNavThree);
|
||||
|
||||
const expectedChildNavThree = app.getNavByIdOrName(childNavThree.id);
|
||||
expect(expectedChildNavThree).toEqual(childNavThree);
|
||||
|
||||
const expectedChildChildNavThree = app.getNavByIdOrName(childChildNavThree.id);
|
||||
expect(expectedChildChildNavThree).toEqual(childChildNavThree);
|
||||
});
|
||||
});
|
||||
|
||||
let app: App;
|
||||
let config: Config;
|
||||
let plt: MockPlatform;
|
||||
|
||||
@@ -126,6 +126,7 @@ export class Checkbox extends BaseInput<boolean> implements IonicTapInput, OnDes
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
this.value = !this.value;
|
||||
this._fireTouched();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -141,5 +142,4 @@ export class Checkbox extends BaseInput<boolean> implements IonicTapInput, OnDes
|
||||
_inputUpdated() {
|
||||
this._item && this._item.setElementClass('item-checkbox-checked', this._value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -91,40 +91,66 @@ ion-app [no-padding] .scroll-content {
|
||||
}
|
||||
|
||||
@mixin content-padding($mode, $content-padding) {
|
||||
ion-app.#{$mode} [padding],
|
||||
ion-app.#{$mode} [padding] .scroll-content {
|
||||
ion-app.#{$mode} [padding] {
|
||||
@include padding($content-padding);
|
||||
}
|
||||
|
||||
ion-app.#{$mode} [padding-top],
|
||||
ion-app.#{$mode} [padding-top] .scroll-content {
|
||||
ion-app.#{$mode} [padding-top] {
|
||||
@include padding($content-padding, null, null, null);
|
||||
}
|
||||
|
||||
ion-app.#{$mode} [padding-left],
|
||||
ion-app.#{$mode} [padding-left] .scroll-content {
|
||||
ion-app.#{$mode} [padding-left] {
|
||||
@include padding-horizontal($content-padding, null);
|
||||
}
|
||||
|
||||
ion-app.#{$mode} [padding-right],
|
||||
ion-app.#{$mode} [padding-right] .scroll-content {
|
||||
ion-app.#{$mode} [padding-right] {
|
||||
@include padding-horizontal(null, $content-padding);
|
||||
}
|
||||
|
||||
ion-app.#{$mode} [padding-bottom],
|
||||
ion-app.#{$mode} [padding-bottom] .scroll-content {
|
||||
ion-app.#{$mode} [padding-bottom] {
|
||||
@include padding(null, null, $content-padding, null);
|
||||
}
|
||||
|
||||
ion-app.#{$mode} [padding-vertical],
|
||||
ion-app.#{$mode} [padding-vertical] .scroll-content {
|
||||
ion-app.#{$mode} [padding-vertical] {
|
||||
@include padding($content-padding, null, $content-padding, null);
|
||||
}
|
||||
|
||||
ion-app.#{$mode} [padding-horizontal],
|
||||
ion-app.#{$mode} [padding-horizontal] .scroll-content {
|
||||
ion-app.#{$mode} [padding-horizontal] {
|
||||
@include padding-horizontal($content-padding);
|
||||
}
|
||||
|
||||
// Scroll content should use safe-area-padding
|
||||
ion-app.#{$mode} [padding] .scroll-content {
|
||||
@include safe-area-padding($content-padding);
|
||||
}
|
||||
|
||||
ion-app.#{$mode} .scroll-content {
|
||||
@include safe-area-no-padding($content-padding);
|
||||
}
|
||||
|
||||
ion-app.#{$mode} [padding-top] .scroll-content {
|
||||
@include safe-area-padding($content-padding, null, null, null);
|
||||
}
|
||||
|
||||
ion-app.#{$mode} [padding-left] .scroll-content {
|
||||
@include safe-area-padding-horizontal($content-padding, null);
|
||||
}
|
||||
|
||||
ion-app.#{$mode} [padding-right] .scroll-content {
|
||||
@include safe-area-padding-horizontal(null, $content-padding);
|
||||
}
|
||||
|
||||
ion-app.#{$mode} [padding-bottom] .scroll-content {
|
||||
@include safe-area-padding(null, null, $content-padding, null);
|
||||
}
|
||||
|
||||
ion-app.#{$mode} [padding-vertical] .scroll-content {
|
||||
@include safe-area-padding($content-padding, null, $content-padding, null);
|
||||
}
|
||||
|
||||
ion-app.#{$mode} [padding-horizontal] .scroll-content {
|
||||
@include safe-area-padding-horizontal($content-padding);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, NgZone, OnDestroy, Optional, Output, Renderer, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, EventEmitter, HostListener, Input, NgZone, OnDestroy, Optional, Output, Renderer, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
|
||||
import { App } from '../app/app';
|
||||
import { Config } from '../../config/config';
|
||||
@@ -31,7 +31,7 @@ export class EventEmitterProxy<T> extends EventEmitter<T> {
|
||||
* The Content component provides an easy to use content area with
|
||||
* some useful methods to control the scrollable area. There should
|
||||
* only be one content in a single view component. If additional scrollable
|
||||
* elements are need, use [ionScroll](../../scroll/Scroll).
|
||||
* elements are needed, use [ionScroll](../../scroll/Scroll).
|
||||
*
|
||||
*
|
||||
* The content area can also implement pull-to-refresh with the
|
||||
@@ -670,6 +670,7 @@ export class Content extends Ion implements OnDestroy, AfterViewInit, IContent {
|
||||
* Tell the content to recalculate its dimensions. This should be called
|
||||
* after dynamically adding/removing headers, footers, or tabs.
|
||||
*/
|
||||
@HostListener('window:resize')
|
||||
resize() {
|
||||
this._dom.read(this._readDimensions.bind(this));
|
||||
this._dom.write(this._writeDimensions.bind(this));
|
||||
|
||||
@@ -12,6 +12,7 @@ import { assert, clamp, deepCopy, isArray, isBlank, isObject, isPresent, isStrin
|
||||
import {
|
||||
DateTimeData,
|
||||
LocaleData,
|
||||
compareDates,
|
||||
convertDataToISO,
|
||||
convertFormatToKey,
|
||||
dateDataSortValue,
|
||||
@@ -135,6 +136,8 @@ import {
|
||||
* to serialize and pass within JSON objects, and sending databases a standardized
|
||||
* format which it can be easily parsed if need be.
|
||||
*
|
||||
* To create an ISO datetime string for the current date and time, e.g. use `const currentDate = (new Date()).toISOString();`.
|
||||
*
|
||||
* An ISO format can be used as a simple year, or just the hour and minute, or get more
|
||||
* detailed down to the millisecond and timezone. Any of the ISO formats below can be used,
|
||||
* and after a user selects a new value, Ionic will continue to use the same ISO format
|
||||
@@ -167,7 +170,7 @@ import {
|
||||
* ## Min and Max Datetimes
|
||||
*
|
||||
* Dates are infinite in either direction, so for a user's selection there should be at
|
||||
* least some form of restricting the dates that can be selected. Be default, the maximum
|
||||
* least some form of restricting the dates that can be selected. By default, the maximum
|
||||
* date is to the end of the current year, and the minimum date is from the beginning
|
||||
* of the year that was 100 years ago.
|
||||
*
|
||||
@@ -319,6 +322,14 @@ export class DateTime extends BaseInput<DateTimeData> implements AfterContentIni
|
||||
*/
|
||||
@Input() displayFormat: string;
|
||||
|
||||
/**
|
||||
* @input {string} The default datetime selected in picker modal if field value is empty.
|
||||
* Value must be a date string following the
|
||||
* [ISO 8601 datetime format standard](https://www.w3.org/TR/NOTE-datetime),
|
||||
* `1996-12-19`.
|
||||
*/
|
||||
@Input() initialValue: string;
|
||||
|
||||
/**
|
||||
* @input {string} The format of the date and time picker columns the user selects.
|
||||
* A datetime input can have one or many datetime parts, each getting their
|
||||
@@ -508,6 +519,7 @@ export class DateTime extends BaseInput<DateTimeData> implements AfterContentIni
|
||||
if (this.isFocus() || this._disabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
console.debug('datetime, open picker');
|
||||
|
||||
// the user may have assigned some options specifically for the alert
|
||||
@@ -596,7 +608,7 @@ export class DateTime extends BaseInput<DateTimeData> implements AfterContentIni
|
||||
|
||||
// cool, we've loaded up the columns with options
|
||||
// preselect the option for this column
|
||||
const optValue = getValueFromFormat(this.getValue(), format);
|
||||
const optValue = getValueFromFormat(this.getValueOrDefault(), format);
|
||||
const selectedIndex = column.options.findIndex(opt => opt.value === optValue);
|
||||
if (selectedIndex >= 0) {
|
||||
// set the select index for this column's options
|
||||
@@ -772,6 +784,51 @@ export class DateTime extends BaseInput<DateTimeData> implements AfterContentIni
|
||||
return this._value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
getValueOrDefault(): DateTimeData {
|
||||
if (this.hasValue()) {
|
||||
return this._value;
|
||||
}
|
||||
|
||||
const initialDateString = this.getDefaultValueDateString();
|
||||
const _default = {};
|
||||
updateDate(_default, initialDateString);
|
||||
return _default;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the default value as a date string
|
||||
* @hidden
|
||||
*/
|
||||
getDefaultValueDateString() {
|
||||
if (this.initialValue) {
|
||||
return this.initialValue;
|
||||
}
|
||||
|
||||
const nowString = (new Date).toISOString();
|
||||
if (this.max) {
|
||||
const now = parseDate(nowString);
|
||||
const max = parseDate(this.max);
|
||||
|
||||
let v;
|
||||
for (let i in max) {
|
||||
v = (<any>max)[i];
|
||||
if (v === null) {
|
||||
(<any>max)[i] = (<any>now)[i];
|
||||
}
|
||||
}
|
||||
|
||||
const diff = compareDates(now, max);
|
||||
// If max is before current time, return max
|
||||
if (diff > 0) {
|
||||
return this.max;
|
||||
}
|
||||
}
|
||||
return nowString;
|
||||
}
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
@@ -835,7 +892,6 @@ export class DateTime extends BaseInput<DateTimeData> implements AfterContentIni
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,7 +16,12 @@
|
||||
|
||||
<ion-item>
|
||||
<ion-label>MM DD YY</ion-label>
|
||||
<ion-datetime displayFormat="MM DD YY" [(ngModel)]="placeholderDate" placeholder="Select Date"></ion-datetime>
|
||||
<ion-datetime pickerFormat="YYYY-MM-DDThh:mm" [(ngModel)]="placeholderDate" placeholder="Select Date"></ion-datetime>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<ion-label>MM DD YY</ion-label>
|
||||
<ion-datetime displayFormat="MM DD YY" [(ngModel)]="placeholderDate" placeholder="Select Date" initialValue="1987-10-19"></ion-datetime>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
@@ -77,6 +82,11 @@
|
||||
<ion-datetime monthValues="6,7,8" yearValues="2014,2015" dayValues="01,02,03,04,05,06,08,09,10, 11, 12, 13, 14" displayFormat="DD/MMM/YYYY" [(ngModel)]="specificDaysMonthsYears"></ion-datetime>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<ion-label>Default value</ion-label>
|
||||
<ion-datetime max="2100" pickerDefault="2017-08-06" [(ngModel)]="defaultValue"></ion-datetime>
|
||||
</ion-item>
|
||||
|
||||
<p aria-hidden="true" padding>
|
||||
<code>monthOnly: {{monthOnly}}</code><br>
|
||||
<code>wwwInvented: {{wwwInvented}}</code><br>
|
||||
@@ -88,6 +98,7 @@
|
||||
<code>time: {{time}}</code><br>
|
||||
<code>Leap year, summer months: {{leapYearsSummerMonths}}</code><br>
|
||||
<code>Specific days/months/years: {{specificDaysMonthsYears}}</code><br>
|
||||
<code>Default value: {{defaultValue}}</code><br>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
@@ -17,6 +17,7 @@ export class RootPage {
|
||||
leapYearsSummerMonths = '';
|
||||
convertedDate = '';
|
||||
specificDaysMonthsYears = '';
|
||||
defaultValue: any;
|
||||
|
||||
leapYearsArray = [2020, 2016, 2008, 2004, 2000, 1996];
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { DateTime } from '../datetime';
|
||||
import { Form } from '../../../util/form';
|
||||
import { Picker } from '../../picker/picker';
|
||||
import { PickerController } from '../../picker/picker-controller';
|
||||
import * as datetime from '../../../util/datetime-util';
|
||||
import * as datetimeUtil from '../../../util/datetime-util';
|
||||
import { mockApp, mockConfig, mockElementRef, mockRenderer } from '../../../util/mock-providers';
|
||||
|
||||
|
||||
@@ -491,6 +491,53 @@ describe('DateTime', () => {
|
||||
|
||||
});
|
||||
|
||||
describe('defaultValue', () => {
|
||||
it('should default to now if no initial value or bounds supplied', () => {
|
||||
const now = datetimeUtil.parseDate(new Date().toISOString());
|
||||
datetime.pickerFormat = 'YYYY-MM-DDThh:mm';
|
||||
datetime.generate();
|
||||
var columns = picker.getColumns();
|
||||
expect(columns[0].options[columns[0].selectedIndex].value).toEqual(now.year);
|
||||
expect(columns[1].options[columns[1].selectedIndex].value).toEqual(now.month);
|
||||
expect(columns[2].options[columns[2].selectedIndex].value).toEqual(now.day);
|
||||
expect(columns[3].options[columns[3].selectedIndex].value).toEqual(now.hour % 12);
|
||||
expect(columns[4].options[columns[4].selectedIndex].value).toEqual(now.minute);
|
||||
});
|
||||
|
||||
it('should default to max if no initial value supplied but max specified and max before current', () => {
|
||||
datetime.max = '1987-10-19';
|
||||
datetime.generate();
|
||||
var columns = picker.getColumns();
|
||||
expect(columns[0].options[columns[0].selectedIndex].value).toEqual(10);
|
||||
expect(columns[1].options[columns[1].selectedIndex].value).toEqual(19);
|
||||
expect(columns[2].options[columns[2].selectedIndex].value).toEqual(1987);
|
||||
});
|
||||
|
||||
it('should default to current if no initial value supplied but max specified and max after current', () => {
|
||||
const now = datetimeUtil.parseDate(new Date().toISOString());
|
||||
datetime.max = '2100-10-19';
|
||||
datetime.generate();
|
||||
var columns = picker.getColumns();
|
||||
expect(columns[0].options[columns[0].selectedIndex].value).toEqual(now.month);
|
||||
expect(columns[1].options[columns[1].selectedIndex].value).toEqual(now.day);
|
||||
expect(columns[2].options[columns[2].selectedIndex].value).toEqual(now.year);
|
||||
});
|
||||
|
||||
it('should use pickerDefault if has no value', zoned(() => {
|
||||
datetime.max = '2100-12-31';
|
||||
datetime.pickerFormat = 'DD MMMM YYYY';
|
||||
datetime.initialValue = '2004-08-06';
|
||||
|
||||
datetime.generate();
|
||||
var columns = picker.getColumns();
|
||||
|
||||
expect(columns[0].options[columns[0].selectedIndex].value).toEqual(6);
|
||||
expect(columns[1].options[columns[1].selectedIndex].value).toEqual(8);
|
||||
expect(columns[2].options[columns[2].selectedIndex].value).toEqual(2004);
|
||||
}));
|
||||
|
||||
});
|
||||
|
||||
describe('setValue', () => {
|
||||
|
||||
it('should update existing time value with 12-hour PM DateTimeData value', zoned(() => {
|
||||
@@ -683,7 +730,7 @@ describe('DateTime', () => {
|
||||
console.warn = function(){};
|
||||
|
||||
// pt-br
|
||||
var customLocale: datetime.LocaleData = {
|
||||
var customLocale: datetimeUtil.LocaleData = {
|
||||
dayNames: [
|
||||
'domingo',
|
||||
'segunda-feira',
|
||||
@@ -736,7 +783,7 @@ describe('DateTime', () => {
|
||||
|
||||
function zoned(fn: () => any): (done: DoneFn) => void {
|
||||
return () => {
|
||||
const zone = new NgZone(false);
|
||||
const zone = new NgZone({enableLongStackTrace: false});
|
||||
zone.run(fn);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -211,12 +211,12 @@ export class TextInput extends BaseInput<string> implements IonicFormInput {
|
||||
@ViewChild('textInput', { read: ElementRef }) _native: ElementRef;
|
||||
|
||||
/**
|
||||
* @input {string} Instructional text that shows before the input has a value.
|
||||
* @input {string} Set the input's autocomplete property. Values: `"on"`, `"off"`. Default `"off"`.
|
||||
*/
|
||||
@Input() autocomplete: string = '';
|
||||
|
||||
/**
|
||||
* @input {string} Instructional text that shows before the input has a value.
|
||||
* @input {string} Set the input's autocorrect property. Values: `"on"`, `"off"`. Default `"off"`.
|
||||
*/
|
||||
@Input() autocorrect: string = '';
|
||||
|
||||
|
||||
@@ -87,14 +87,14 @@ $list-md-header-color: #757575 !default;
|
||||
}
|
||||
|
||||
.list-md ion-item-options .button {
|
||||
@include margin(1px, 0);
|
||||
@include margin(0);
|
||||
@include border-radius(0);
|
||||
|
||||
display: inline-flex;
|
||||
|
||||
align-items: center;
|
||||
|
||||
height: calc(100% - 2px);
|
||||
height: 100%;
|
||||
|
||||
border: 0;
|
||||
|
||||
|
||||
@@ -47,12 +47,12 @@ import { LoadingOptions } from './loading-options';
|
||||
*
|
||||
* @usage
|
||||
* ```ts
|
||||
* constructor(public loadingCtrl: LoadingController) {
|
||||
* import { LoadingController } from 'ionic-angular';
|
||||
*
|
||||
* }
|
||||
* constructor(public loadingCtrl: LoadingController) { }
|
||||
*
|
||||
* presentLoadingDefault() {
|
||||
* let loading = this.loadingCtrl.create({
|
||||
* const loading = this.loadingCtrl.create({
|
||||
* content: 'Please wait...'
|
||||
* });
|
||||
*
|
||||
@@ -64,7 +64,7 @@ import { LoadingOptions } from './loading-options';
|
||||
* }
|
||||
*
|
||||
* presentLoadingCustom() {
|
||||
* let loading = this.loadingCtrl.create({
|
||||
* const loading = this.loadingCtrl.create({
|
||||
* spinner: 'hide',
|
||||
* content: `
|
||||
* <div class="custom-spinner-container">
|
||||
@@ -81,7 +81,7 @@ import { LoadingOptions } from './loading-options';
|
||||
* }
|
||||
*
|
||||
* presentLoadingText() {
|
||||
* let loading = this.loadingCtrl.create({
|
||||
* const loading = this.loadingCtrl.create({
|
||||
* spinner: 'hide',
|
||||
* content: 'Loading Please Wait...'
|
||||
* });
|
||||
|
||||
@@ -9,7 +9,7 @@ import { ViewController } from '../../navigation/view-controller';
|
||||
* @name MenuToggle
|
||||
* @description
|
||||
* The `menuToggle` directive can be placed on any button to toggle a menu open or closed.
|
||||
* If it is added to the [NavBar](../../navbar/NavBar) of a page, the button will only appear
|
||||
* If it is added to the [NavBar](../../toolbar/Navbar) of a page, the button will only appear
|
||||
* when the page it's in is currently a root page. See the [Menu Navigation Bar Behavior](../Menu#navigation-bar-behavior)
|
||||
* docs for more information.
|
||||
*
|
||||
|
||||
@@ -19,7 +19,7 @@ import { DeepLinker } from '../../navigation/deep-linker';
|
||||
*
|
||||
* When a modal (or any other overlay such as an alert or actionsheet) is
|
||||
* "presented" to a nav controller, the overlay is added to the app's root nav.
|
||||
* After the modal has been presented, from within the component instance The
|
||||
* After the modal has been presented, from within the component instance, the
|
||||
* modal can later be closed or "dismissed" by using the ViewController's
|
||||
* `dismiss` method. Additionally, you can dismiss any overlay by using `pop`
|
||||
* on the root nav controller. Modals are not reusable. When a modal is dismissed
|
||||
@@ -38,12 +38,10 @@ import { DeepLinker } from '../../navigation/deep-linker';
|
||||
* @Component(...)
|
||||
* class HomePage {
|
||||
*
|
||||
* constructor(public modalCtrl: ModalController) {
|
||||
*
|
||||
* }
|
||||
* constructor(public modalCtrl: ModalController) { }
|
||||
*
|
||||
* presentProfileModal() {
|
||||
* let profileModal = this.modalCtrl.create(Profile, { userId: 8675309 });
|
||||
* const profileModal = this.modalCtrl.create(Profile, { userId: 8675309 });
|
||||
* profileModal.present();
|
||||
* }
|
||||
*
|
||||
@@ -112,6 +110,25 @@ import { DeepLinker } from '../../navigation/deep-linker';
|
||||
*
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* A common issue is that a developer may try to implement navigation in a modal, but when you try NavController.push(),
|
||||
* you will notice that the status bar on iOS gets cut off. The proper way to implement navigation in a modal is to
|
||||
* make the modal component a navigation container, and set the root page to the page you want to show in your modal.
|
||||
*
|
||||
* ```ts
|
||||
* @Component({
|
||||
* template: '<ion-nav [root]="rootPage" [rootParams]="rootParams"></ion-nav>'
|
||||
* })
|
||||
* export class MyModalWrapper {
|
||||
* rootPage = 'MyModalContentPage'; // This is the page you want your modal to display
|
||||
* rootParams;
|
||||
*
|
||||
* constructor(navParams: NavParams, private viewCtrl: ViewController) {
|
||||
* this.rootParams = Object.assign({}, navParams.data, {viewCtrl: viewCtrl});
|
||||
* // This line will send the view controller into your child views, so you can dismiss the modals from there.
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
* @demo /docs/demos/src/modal/
|
||||
* @see {@link /docs/components#modals Modal Component Docs}
|
||||
*/
|
||||
|
||||
@@ -32,8 +32,8 @@ import { Page } from '../../navigation/nav-util';
|
||||
* template: `<button ion-button [navPush]="pushPage" [navParams]="params">Go</button>`
|
||||
* })
|
||||
* class MyPage {
|
||||
* params: Object;
|
||||
* pushPage: any;
|
||||
* params: Object;
|
||||
* constructor(){
|
||||
* this.pushPage = LoginPage;
|
||||
* this.params = { id: 42 };
|
||||
|
||||
@@ -114,7 +114,7 @@ export class Nav extends NavControllerBase implements AfterViewInit, RootNode, I
|
||||
|
||||
if (segment && (segment.component || segment.loadChildren)) {
|
||||
return this._linker.initViews(segment).then(views => {
|
||||
this.setPages(views, null, null);
|
||||
return this.setPages(views, null, null);
|
||||
});
|
||||
} else if (this._root) {
|
||||
// no segment match, so use the root property but don't set the url I guess
|
||||
@@ -133,6 +133,7 @@ export class Nav extends NavControllerBase implements AfterViewInit, RootNode, I
|
||||
get root(): any {
|
||||
return this._root;
|
||||
}
|
||||
|
||||
set root(page: any) {
|
||||
this._root = page;
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ import { Component } from '@angular/core';
|
||||
@Component({
|
||||
template: `
|
||||
<ion-split-pane>
|
||||
<ion-nav [root]="rootOne"></ion-nav>
|
||||
<ion-nav [root]="rootTwo" main #content></ion-nav>
|
||||
<ion-nav [root]="rootOne" name="left"></ion-nav>
|
||||
<ion-nav [root]="rootTwo" main #content name="right"></ion-nav>
|
||||
|
||||
</ion-split-pane>
|
||||
`
|
||||
|
||||
@@ -19,7 +19,6 @@ import { IonicPage, NavController, NavParams } from '../../../../../../..';
|
||||
<div>
|
||||
Name: {{paramTwo}}
|
||||
</div>
|
||||
<button ion-button (click)="goToNext()">Next</button>
|
||||
</ion-content>
|
||||
`
|
||||
})
|
||||
|
||||
@@ -14,10 +14,10 @@ import { IonicPage, NavController, NavParams } from '../../../../../../..';
|
||||
<ion-content>
|
||||
Tabs 1 Tab 2 Page 3
|
||||
<div>
|
||||
Param One: {{userId}}
|
||||
Param One: {{paramOne}}
|
||||
</div>
|
||||
<div>
|
||||
Param Two: {{name}}
|
||||
Param Two: {{paramTwo}}
|
||||
</div>
|
||||
</ion-content>
|
||||
`
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
template: `<ion-nav [root]="root"></ion-nav>`
|
||||
})
|
||||
export class AppComponent {
|
||||
root = 'LoginPage';
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { IonicApp, IonicModule } from '../../../../..';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(AppComponent, { swipeBackEnabled: true, preloadModules: true }),
|
||||
],
|
||||
bootstrap: [IonicApp]
|
||||
})
|
||||
export class AppModule {}
|
||||
@@ -0,0 +1,5 @@
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
||||
@@ -0,0 +1,13 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../..';
|
||||
import { LandingPage } from './landing-page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
IonicPageModule.forChild(LandingPage)
|
||||
],
|
||||
declarations: [
|
||||
LandingPage
|
||||
]
|
||||
})
|
||||
export class LandingPageModule { }
|
||||
@@ -0,0 +1,30 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { IonicPage, NavController, } from '../../../../../..';
|
||||
|
||||
@IonicPage()
|
||||
@Component({
|
||||
template: `
|
||||
<ion-header>
|
||||
<ion-navbar>
|
||||
<ion-title>My Super Cool, multi-pane App</ion-title>
|
||||
</ion-navbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
<ion-grid>
|
||||
<ion-row>
|
||||
<ion-col style="height: 1000px; background-color: blue">
|
||||
<ion-nav root="FirstPage" name="left"></ion-nav>
|
||||
</ion-col>
|
||||
<ion-col style="height: 1000px; background-color: green">
|
||||
<ion-nav root="FourthPage" name="right"></ion-nav>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
</ion-content>
|
||||
`
|
||||
})
|
||||
export class LandingPage {
|
||||
constructor(public nav: NavController) {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<ion-header>
|
||||
<ion-navbar>
|
||||
<ion-title>Page One</ion-title>
|
||||
</ion-navbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
<h2>Page One</h2>
|
||||
<button ion-button (click)="goToPageTwo()">Go to Page Two</button>
|
||||
</ion-content>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../../..';
|
||||
import { FirstPage } from './first-page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
IonicPageModule.forChild(FirstPage)
|
||||
],
|
||||
declarations: [
|
||||
FirstPage
|
||||
]
|
||||
})
|
||||
export class FirstPageModule { }
|
||||
@@ -0,0 +1,15 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { IonicPage, NavController, } from '../../../../../../..';
|
||||
|
||||
@IonicPage()
|
||||
@Component({
|
||||
templateUrl: 'first-page.html'
|
||||
})
|
||||
export class FirstPage {
|
||||
constructor(public nav: NavController) {
|
||||
}
|
||||
|
||||
goToPageTwo() {
|
||||
this.nav.push('SecondPage', { userId: '123', name: 'Michael Scott'});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<ion-header>
|
||||
<ion-navbar>
|
||||
<ion-title>Page Two</ion-title>
|
||||
</ion-navbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
<h2>Page Two</h2>
|
||||
<div>
|
||||
User ID: {{userId}}
|
||||
</div>
|
||||
<div>
|
||||
Name {{name}}
|
||||
</div>
|
||||
<button ion-button (click)="goToNextPage()">Go to Next</button>
|
||||
</ion-content>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../../..';
|
||||
import { SecondPage } from './second-page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
IonicPageModule.forChild(SecondPage)
|
||||
],
|
||||
declarations: [
|
||||
SecondPage
|
||||
]
|
||||
})
|
||||
export class SecondPageModule { }
|
||||
@@ -0,0 +1,22 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { IonicPage, NavController, NavParams } from '../../../../../../..';
|
||||
|
||||
@IonicPage({
|
||||
segment: 'pageTwo/user/:userId/name/:name'
|
||||
})
|
||||
@Component({
|
||||
templateUrl: 'second-page.html'
|
||||
})
|
||||
export class SecondPage {
|
||||
|
||||
userId: string;
|
||||
name: string;
|
||||
constructor(public nav: NavController, public params: NavParams) {
|
||||
this.userId = this.params.data.userId;
|
||||
this.name = this.params.data.name;
|
||||
}
|
||||
|
||||
goToNextPage() {
|
||||
this.nav.push('ThirdPage', { paramOne: 'mono', paramTwo: 'stereo'});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<ion-header>
|
||||
<ion-navbar>
|
||||
<ion-title>Page Three</ion-title>
|
||||
</ion-navbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
Page Three
|
||||
<div>
|
||||
Param One: {{paramOne}}
|
||||
</div>
|
||||
<div>
|
||||
Param Two: {{paramTwo}}
|
||||
</div>
|
||||
</ion-content>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../../..';
|
||||
import { ThirdPage } from './third-page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
IonicPageModule.forChild(ThirdPage)
|
||||
],
|
||||
declarations: [
|
||||
ThirdPage
|
||||
]
|
||||
})
|
||||
export class ThirdPageModule { }
|
||||
@@ -0,0 +1,17 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { IonicPage, NavController, NavParams} from '../../../../../../..';
|
||||
|
||||
@IonicPage({
|
||||
segment: 'thirdPage/paramOne/:paramOne/paramTwo/:paramTwo'
|
||||
})
|
||||
@Component({
|
||||
templateUrl: 'third-page.html'
|
||||
})
|
||||
export class ThirdPage {
|
||||
paramOne: string;
|
||||
paramTwo: string;
|
||||
constructor(public nav: NavController, public params: NavParams) {
|
||||
this.paramOne = params.data.paramOne;
|
||||
this.paramTwo = params.data.paramTwo;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../..';
|
||||
import { LoginPage } from './login-page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
IonicPageModule.forChild(LoginPage)
|
||||
],
|
||||
declarations: [
|
||||
LoginPage
|
||||
]
|
||||
})
|
||||
export class LoginPageModule { }
|
||||
@@ -0,0 +1,24 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { IonicPage, NavController, } from '../../../../../..';
|
||||
|
||||
@IonicPage()
|
||||
@Component({
|
||||
template: `
|
||||
<ion-header>
|
||||
<ion-navbar>
|
||||
<ion-title>Login</ion-title>
|
||||
</ion-navbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
<button ion-button (click)="clickMe()">Login</button>
|
||||
</ion-content>
|
||||
`
|
||||
})
|
||||
export class LoginPage {
|
||||
constructor(public nav: NavController) {
|
||||
}
|
||||
|
||||
clickMe() {
|
||||
this.nav.push('LandingPage');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<ion-header>
|
||||
<ion-navbar>
|
||||
<ion-title>Page Five</ion-title>
|
||||
</ion-navbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
<h2>Page Five</h2>
|
||||
<div>
|
||||
User ID: {{userId}}
|
||||
</div>
|
||||
<div>
|
||||
Name {{name}}
|
||||
</div>
|
||||
<button ion-button (click)="goToNextPage()">Go to Next</button>
|
||||
</ion-content>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../../..';
|
||||
import { FifthPage } from './fifth-page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
IonicPageModule.forChild(FifthPage)
|
||||
],
|
||||
declarations: [
|
||||
FifthPage
|
||||
]
|
||||
})
|
||||
export class FifthPageModule { }
|
||||
@@ -0,0 +1,22 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { IonicPage, NavController, NavParams } from '../../../../../../..';
|
||||
|
||||
@IonicPage({
|
||||
segment: 'pageFive/user/:userId/name/:name'
|
||||
})
|
||||
@Component({
|
||||
templateUrl: 'fifth-page.html'
|
||||
})
|
||||
export class FifthPage {
|
||||
|
||||
userId: string;
|
||||
name: string;
|
||||
constructor(public nav: NavController, public params: NavParams) {
|
||||
this.userId = this.params.data.userId;
|
||||
this.name = this.params.data.name;
|
||||
}
|
||||
|
||||
goToNextPage() {
|
||||
this.nav.push('SixthPage', { paramOne: 'Tobey', paramTwo: 'Holly'});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<ion-header>
|
||||
<ion-navbar>
|
||||
<ion-title>Page Four</ion-title>
|
||||
</ion-navbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
<h2>Page Four</h2>
|
||||
<button ion-button (click)="goToPageTwo()">Next</button>
|
||||
</ion-content>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../../..';
|
||||
import { FourthPage } from './fourth-page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
IonicPageModule.forChild(FourthPage)
|
||||
],
|
||||
declarations: [
|
||||
FourthPage
|
||||
]
|
||||
})
|
||||
export class FourthPageModule { }
|
||||
@@ -0,0 +1,15 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { IonicPage, NavController, } from '../../../../../../..';
|
||||
|
||||
@IonicPage()
|
||||
@Component({
|
||||
templateUrl: 'fourth-page.html'
|
||||
})
|
||||
export class FourthPage {
|
||||
constructor(public nav: NavController) {
|
||||
}
|
||||
|
||||
goToPageTwo() {
|
||||
this.nav.push('FifthPage', { userId: '567', name: 'Pamela Beasley'});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<ion-header>
|
||||
<ion-navbar>
|
||||
<ion-title>Page Six</ion-title>
|
||||
</ion-navbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
Page Six
|
||||
<div>
|
||||
Param One: {{paramOne}}
|
||||
</div>
|
||||
<div>
|
||||
Param Two: {{paramTwo}}
|
||||
</div>
|
||||
</ion-content>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../../..';
|
||||
import { SixthPage } from './sixth-page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
IonicPageModule.forChild(SixthPage)
|
||||
],
|
||||
declarations: [
|
||||
SixthPage
|
||||
]
|
||||
})
|
||||
export class SixthPageModule { }
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { IonicPage, NavController, NavParams} from '../../../../../../..';
|
||||
|
||||
@IonicPage({
|
||||
segment: 'sixthPage/paramOne/:paramOne/paramTwo/:paramTwo'
|
||||
})
|
||||
@Component({
|
||||
templateUrl: 'sixth-page.html'
|
||||
})
|
||||
export class SixthPage {
|
||||
|
||||
paramOne: string;
|
||||
paramTwo: string;
|
||||
constructor(public nav: NavController, public params: NavParams) {
|
||||
this.paramOne = params.data.paramOne;
|
||||
this.paramTwo = params.data.paramTwo;
|
||||
}
|
||||
}
|
||||
@@ -51,6 +51,7 @@ ion-picker-cmp {
|
||||
}
|
||||
|
||||
.picker-columns {
|
||||
@include margin(null, null, constant(safe-area-inset-bottom), null);
|
||||
position: relative;
|
||||
display: flex;
|
||||
|
||||
|
||||
@@ -42,15 +42,18 @@ export class PageOne {
|
||||
}
|
||||
|
||||
setApple() {
|
||||
this.fruitsCtrl.updateValueAndValidity('apple');
|
||||
this.fruitsCtrl.setValue('apple');
|
||||
this.fruitsCtrl.updateValueAndValidity();
|
||||
}
|
||||
|
||||
setBanana() {
|
||||
this.fruitsCtrl.updateValueAndValidity('banana');
|
||||
this.fruitsCtrl.setValue('banana');
|
||||
this.fruitsCtrl.updateValueAndValidity();
|
||||
}
|
||||
|
||||
setCherry() {
|
||||
this.fruitsCtrl.updateValueAndValidity('cherry');
|
||||
this.fruitsCtrl.setValue('cherry');
|
||||
this.fruitsCtrl.updateValueAndValidity();
|
||||
}
|
||||
|
||||
doSubmit(ev: UIEvent) {
|
||||
|
||||
@@ -90,7 +90,10 @@ export class Segment extends BaseInput<string> implements AfterContentInit {
|
||||
ngAfterContentInit() {
|
||||
this._initialize();
|
||||
this._buttons.forEach(button => {
|
||||
button.ionSelect.subscribe((selectedButton: any) => this.value = selectedButton.value);
|
||||
button.ionSelect.subscribe((selectedButton: any) => {
|
||||
this.value = selectedButton.value;
|
||||
this._fireTouched();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -109,6 +112,4 @@ export class Segment extends BaseInput<string> implements AfterContentInit {
|
||||
button.isActive = (button.value === value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -106,6 +106,34 @@ import { ViewController } from '../../navigation/view-controller';
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* ### Zooming
|
||||
* If your slides contain images, you can enable zooming on them by setting `zoom="true" and
|
||||
* wrapping each image in a `div` with the class `swiper-zoom-container`. Zoom supports
|
||||
* `img`, `svg`, `canvas`, and `ion-img`.
|
||||
*
|
||||
* ```html
|
||||
* <ion-slidesj zoom="true">
|
||||
* <ion-slide>
|
||||
* <div class="swiper-zoom-container">
|
||||
* <img src="assets/img/dog.jpg">
|
||||
* </div>
|
||||
* <ion-label>Woof</ion-label>
|
||||
* </ion-slide>
|
||||
* <ion-slide>
|
||||
* <div class="swiper-zoom-container">
|
||||
* <img src="assets/img/cat.jpg">
|
||||
* </div>
|
||||
* <ion-label>Meow</ion-label>
|
||||
* </ion-slide>
|
||||
* <ion-slide>
|
||||
* <div class="swiper-zoom-container">
|
||||
* <img src="assets/img/fish.jpg">
|
||||
* </div>
|
||||
* <ion-label>Just keep swimming</ion-label>
|
||||
* </ion-slide>
|
||||
* </ion-slides>
|
||||
* ```
|
||||
*
|
||||
* @advanced
|
||||
*
|
||||
* There are several options available to create customized slides. Ionic exposes
|
||||
|
||||
@@ -462,7 +462,7 @@ export function resetZoomEvents(s: Slides, plt: Platform) {
|
||||
|
||||
// Scale image
|
||||
if (s._supportGestures) {
|
||||
for (var i = 0; i < slides.length; i++) {
|
||||
for (let i = 0; i < slides.length; i++) {
|
||||
slide = slides[i];
|
||||
// gesturestart
|
||||
plt.registerListener(slide, 'gesturestart', (ev: TouchEvent) => {
|
||||
|
||||
@@ -693,8 +693,10 @@ function destroyLoop(s: Slides) {
|
||||
eachChild(s._wrapper, '.' + CLS.slide + '.' + CLS.slideDuplicate, ele => {
|
||||
ele.parentElement.removeChild(ele);
|
||||
});
|
||||
for (var i = 0; i < s._slides.length; i++) {
|
||||
s._slides[i].removeAttribute('data-swiper-slide-index');
|
||||
if (s._slides) {
|
||||
for (var i = 0; i < s._slides.length; i++) {
|
||||
s._slides[i].removeAttribute('data-swiper-slide-index');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import { GestureController } from '../../gestures/gesture-controller';
|
||||
import { isTrueProperty } from '../../util/util';
|
||||
import { Tab as ITab } from '../../navigation/nav-interfaces';
|
||||
import { NavControllerBase } from '../../navigation/nav-controller-base';
|
||||
import { NavOptions } from '../../navigation/nav-util';
|
||||
import { NavOptions, TransitionDoneFn } from '../../navigation/nav-util';
|
||||
import { Platform } from '../../platform/platform';
|
||||
import { TabButton } from './tab-button';
|
||||
import { Tabs } from './tabs';
|
||||
@@ -98,7 +98,7 @@ import { ViewController } from '../../navigation/view-controller';
|
||||
* ```html
|
||||
* <ion-tabs>
|
||||
* <ion-tab (ionSelect)="chat()" tabTitle="Show Modal"></ion-tab>
|
||||
* </ion-tabs>
|
||||
* </ion-tabs>pop
|
||||
* ```
|
||||
*
|
||||
* ```ts
|
||||
@@ -304,7 +304,7 @@ export class Tab extends NavControllerBase implements ITab {
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
load(opts: NavOptions, done?: () => void) {
|
||||
load(opts: NavOptions, done?: TransitionDoneFn) {
|
||||
if (this._lazyRootFromUrl || (!this._loaded && this.root)) {
|
||||
this.setElementClass('show-tab', true);
|
||||
// okay, first thing we need to do if check if the view already exists
|
||||
@@ -317,7 +317,10 @@ export class Tab extends NavControllerBase implements ITab {
|
||||
if (i === numViews) {
|
||||
// this is the last view in the stack and it's the same
|
||||
// as the segment so there's no change needed
|
||||
return done();
|
||||
if (done) {
|
||||
done(false, false);
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
// it's not the exact view as the end
|
||||
// let's have this nav go back to this exact view
|
||||
@@ -343,7 +346,10 @@ export class Tab extends NavControllerBase implements ITab {
|
||||
this._dom.read(() => {
|
||||
this.resize();
|
||||
});
|
||||
return done();
|
||||
if (done) {
|
||||
done(false, false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,9 @@ $tabs-ios-tab-icon-color-active: $tabs-ios-tab-color-active !default;
|
||||
/// @prop - Font size of the tab button text
|
||||
$tabs-ios-tab-font-size: 10px !default;
|
||||
|
||||
/// @prop - Font weight of the tab button text
|
||||
$tabs-ios-tab-font-weight: 500 !default;
|
||||
|
||||
/// @prop - Size of the tab button icon
|
||||
$tabs-ios-tab-icon-size: 30px !default;
|
||||
|
||||
@@ -63,6 +66,7 @@ $tabs-ios-tab-icon-size: 30px !default;
|
||||
min-height: $tabs-ios-tab-min-height;
|
||||
|
||||
font-size: $tabs-ios-tab-font-size;
|
||||
font-weight: $tabs-ios-tab-font-weight;
|
||||
color: $tabs-ios-tab-text-color;
|
||||
|
||||
@include deprecated-variable(padding, $tabs-ios-tab-padding) {
|
||||
|
||||
@@ -507,6 +507,13 @@ export class Tabs extends Ion implements AfterViewInit, RootNode, ITabs, Navigat
|
||||
return selected ? [selected] : [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
getAllChildNavs(): any[] {
|
||||
return this._tabs;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
@@ -635,7 +642,7 @@ export class Tabs extends Ion implements AfterViewInit, RootNode, ITabs, Navigat
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
_getSelectedTabIndex(secondaryId: string, fallbackIndex: number = 0): number {
|
||||
_getSelectedTabIndex(secondaryId: string = '', fallbackIndex: number = 0): number {
|
||||
// we found a segment which probably represents which tab to select
|
||||
const indexMatch = secondaryId.match(/tab-(\d+)/);
|
||||
if (indexMatch) {
|
||||
|
||||
@@ -39,12 +39,10 @@ import { ToastOptions } from './toast-options';
|
||||
* ```ts
|
||||
* import { ToastController } from 'ionic-angular';
|
||||
*
|
||||
* constructor(private toastCtrl: ToastController) {
|
||||
*
|
||||
* }
|
||||
* constructor(public toastCtrl: ToastController) { }
|
||||
*
|
||||
* presentToast() {
|
||||
* let toast = this.toastCtrl.create({
|
||||
* const toast = this.toastCtrl.create({
|
||||
* message: 'User was added successfully',
|
||||
* duration: 3000,
|
||||
* position: 'top'
|
||||
|
||||
@@ -48,6 +48,7 @@ $toast-ios-title-padding-start: $toast-ios-title-padding-end !
|
||||
|
||||
.toast-ios .toast-wrapper.toast-top {
|
||||
@include transform(translate3d(0, -100%, 0));
|
||||
@include margin(constant(safe-area-inset-top), auto, auto, auto);
|
||||
|
||||
top: 0;
|
||||
}
|
||||
@@ -55,6 +56,7 @@ $toast-ios-title-padding-start: $toast-ios-title-padding-end !
|
||||
.toast-ios .toast-wrapper.toast-bottom {
|
||||
@include transform(translate3d(0, 100%, 0));
|
||||
|
||||
@include margin(auto, auto, constant(safe-area-inset-bottom), auto);
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import { ViewController } from '../../navigation/view-controller';
|
||||
* @name Header
|
||||
* @description
|
||||
* Header is a parent component that holds the navbar and toolbar component.
|
||||
* It's important to note that `ion-header` needs to be the one of the three root elements of a page
|
||||
* It's important to note that `ion-header` needs to be one of the three root elements of a page
|
||||
*
|
||||
* @usage
|
||||
*
|
||||
|
||||
@@ -88,7 +88,7 @@ import { VirtualHeader } from './virtual-header';
|
||||
* ### Approximate Widths and Heights
|
||||
*
|
||||
* If the height of items in the virtual scroll are not close to the
|
||||
* default size of 40px, it is extremely important to provide an value for
|
||||
* default size of 40px, it is extremely important to provide a value for
|
||||
* approxItemHeight height. An exact pixel-perfect size is not necessary,
|
||||
* but without an estimate the virtual scroll will not render correctly.
|
||||
*
|
||||
|
||||
@@ -116,8 +116,11 @@ import { isArray, isDefined, isFunction, isObject } from '../util/util';
|
||||
* | `pickerEnter` | `string` | The name of the transition to use while a picker is presented. |
|
||||
* | `pickerLeave` | `string` | The name of the transition to use while a picker is dismissed. |
|
||||
* | `popoverEnter` | `string` | The name of the transition to use while a popover is presented. |
|
||||
* | `popoverLeave` | `string` | The name of the transition to use while a popover is dismissed. |
|
||||
* | `popoverLeave` | `string` | The name of the transition to use while a popover is dismissed.
|
||||
* | `scrollAssist` | `boolean` | Used to avoid the input to be hidden by the keyboard if it's near the bottom of the page.
|
||||
* | `scrollPadding` | `boolean` | Used to remove the extra padding on ion-content when keyboard is displayed.
|
||||
* | `spinner` | `string` | The default spinner to use when a name is not defined. |
|
||||
* | `statusbarPadding` | `boolean` | Whether to hide extra padding for statusbar. |
|
||||
* | `swipeBackEnabled` | `boolean` | Whether native iOS swipe to go back functionality is enabled. |
|
||||
* | `tabsHighlight` | `boolean` | Whether to show a highlight line under the tab when it is selected. |
|
||||
* | `tabsLayout` | `string` | The layout to use for all tabs. Available options: `"icon-top"`, `"icon-start"`, `"icon-end"`, `"icon-bottom"`, `"icon-hide"`, `"title-hide"`. |
|
||||
|
||||
@@ -69,7 +69,7 @@ export class Simulate {
|
||||
velocity(vel: number): Simulate {
|
||||
let p1 = this.getLastPoint();
|
||||
let p2 = this.getPreviousPoint();
|
||||
let d = distance(p1, p2);
|
||||
let d = distance(p1.coord, p2.coord);
|
||||
return this.duration(d / vel);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ describe('recognizers', () => {
|
||||
let p = new PanRecognizer('x', 2, 2);
|
||||
expect(p.pan()).toEqual(0);
|
||||
|
||||
Simulate.from(0, 0).to(99, 0).run((coord: Coordinates) => {
|
||||
Simulate.from(0, 0).to(99, 0).run((coord: any) => {
|
||||
expect(p.detect(coord)).toEqual(false);
|
||||
});
|
||||
});
|
||||
@@ -18,7 +18,7 @@ describe('recognizers', () => {
|
||||
p.start({ x: 0, y: 0 });
|
||||
expect(p.pan()).toEqual(0);
|
||||
|
||||
Simulate.from(0, 0).to(10, 0).run((coord: Coordinates) => {
|
||||
Simulate.from(0, 0).to(10, 0).run((coord: any) => {
|
||||
p.detect(coord);
|
||||
});
|
||||
expect(p.pan()).toEqual(1);
|
||||
@@ -26,7 +26,7 @@ describe('recognizers', () => {
|
||||
p.start({ x: 0, y: 0 });
|
||||
expect(p.pan()).toEqual(0);
|
||||
|
||||
Simulate.from(0, 0).to(-10, 0).run((coord: Coordinates) => {
|
||||
Simulate.from(0, 0).to(-10, 0).run((coord: any) => {
|
||||
p.detect(coord);
|
||||
});
|
||||
expect(p.pan()).toEqual(-1);
|
||||
@@ -40,11 +40,11 @@ describe('recognizers', () => {
|
||||
Simulate
|
||||
.from(0, 0).to(99, 0)
|
||||
// Since threshold is 100, it should not fire yet
|
||||
.run((coord: Coordinates) => expect(p.detect(coord)).toEqual(false))
|
||||
.run((coord: any) => expect(p.detect(coord)).toEqual(false))
|
||||
|
||||
// Now it should fire
|
||||
.delta(2, 0)
|
||||
.run((coord: Coordinates) => {
|
||||
.run((coord: any) => {
|
||||
if (p.detect(coord)) {
|
||||
// it should detect a horizontal pan
|
||||
expect(p.pan()).toEqual(1);
|
||||
@@ -56,7 +56,7 @@ describe('recognizers', () => {
|
||||
.delta(20, 0)
|
||||
.to(0, 0)
|
||||
.to(102, 0)
|
||||
.run((coord: Coordinates) => expect(p.detect(coord)).toEqual(false));
|
||||
.run((coord: any) => expect(p.detect(coord)).toEqual(false));
|
||||
|
||||
expect(detected).toEqual(true);
|
||||
});
|
||||
@@ -66,13 +66,13 @@ describe('recognizers', () => {
|
||||
p.start({ x: 0, y: 0 });
|
||||
Simulate
|
||||
.from(0, 0).deltaPolar(19, 21).delta(-30, 0)
|
||||
.run((coord: Coordinates) => p.detect(coord));
|
||||
.run((coord: any) => p.detect(coord));
|
||||
expect(p.pan()).toEqual(1);
|
||||
|
||||
p.start({ x: 0, y: 0 });
|
||||
Simulate
|
||||
.from(0, 0).deltaPolar(-19, 21).delta(-30, 0)
|
||||
.run((coord: Coordinates) => p.detect(coord));
|
||||
.run((coord: any) => p.detect(coord));
|
||||
expect(p.pan()).toEqual(1);
|
||||
});
|
||||
|
||||
@@ -81,13 +81,13 @@ describe('recognizers', () => {
|
||||
p.start({ x: 0, y: 0 });
|
||||
Simulate
|
||||
.from(0, 0).deltaPolar(180 - 19, 21).delta(30, 0)
|
||||
.run((coord: Coordinates) => p.detect(coord));
|
||||
.run((coord: any) => p.detect(coord));
|
||||
expect(p.pan()).toEqual(-1);
|
||||
|
||||
p.start({ x: 0, y: 0 });
|
||||
Simulate
|
||||
.from(0, 0).deltaPolar(180 + 19, 21).delta(30, 0)
|
||||
.run((coord: Coordinates) => p.detect(coord));
|
||||
.run((coord: any) => p.detect(coord));
|
||||
expect(p.pan()).toEqual(-1);
|
||||
});
|
||||
|
||||
@@ -96,13 +96,13 @@ describe('recognizers', () => {
|
||||
p.start({ x: 0, y: 0 });
|
||||
Simulate
|
||||
.from(0, 0).deltaPolar(21, 21).delta(-30, 0)
|
||||
.run((coord: Coordinates) => p.detect(coord));
|
||||
.run((coord: any) => p.detect(coord));
|
||||
expect(p.pan()).toEqual(0);
|
||||
|
||||
p.start({ x: 0, y: 0 });
|
||||
Simulate
|
||||
.from(0, 0).deltaPolar(-21, 21).delta(-30, 0)
|
||||
.run((coord: Coordinates) => p.detect(coord));
|
||||
.run((coord: any) => p.detect(coord));
|
||||
expect(p.pan()).toEqual(0);
|
||||
});
|
||||
|
||||
@@ -111,13 +111,13 @@ describe('recognizers', () => {
|
||||
p.start({ x: 0, y: 0 });
|
||||
Simulate
|
||||
.from(0, 0).deltaPolar(180 - 21, 21).delta(30, 0)
|
||||
.run((coord: Coordinates) => p.detect(coord));
|
||||
.run((coord: any) => p.detect(coord));
|
||||
expect(p.pan()).toEqual(0);
|
||||
|
||||
p.start({ x: 0, y: 0 });
|
||||
Simulate
|
||||
.from(0, 0).deltaPolar(180 + 21, 21).delta(30, 0)
|
||||
.run((coord: Coordinates) => p.detect(coord));
|
||||
.run((coord: any) => p.detect(coord));
|
||||
expect(p.pan()).toEqual(0);
|
||||
});
|
||||
|
||||
@@ -128,13 +128,13 @@ describe('recognizers', () => {
|
||||
p.start({ x: 0, y: 0 });
|
||||
Simulate
|
||||
.from(0, 0).deltaPolar(90 - 19, 21).delta(-30, 0)
|
||||
.run((coord: Coordinates) => p.detect(coord));
|
||||
.run((coord: any) => p.detect(coord));
|
||||
expect(p.pan()).toEqual(1);
|
||||
|
||||
p.start({ x: 0, y: 0 });
|
||||
Simulate
|
||||
.from(0, 0).deltaPolar(90 + 19, 21).delta(-30, 0)
|
||||
.run((coord: Coordinates) => p.detect(coord));
|
||||
.run((coord: any) => p.detect(coord));
|
||||
expect(p.pan()).toEqual(1);
|
||||
});
|
||||
|
||||
@@ -143,13 +143,13 @@ describe('recognizers', () => {
|
||||
p.start({ x: 0, y: 0 });
|
||||
Simulate
|
||||
.from(0, 0).deltaPolar(-90 + 19, 21).delta(30, 0)
|
||||
.run((coord: Coordinates) => p.detect(coord));
|
||||
.run((coord: any) => p.detect(coord));
|
||||
expect(p.pan()).toEqual(-1);
|
||||
|
||||
p.start({ x: 0, y: 0 });
|
||||
Simulate
|
||||
.from(0, 0).deltaPolar(-90 - 19, 21).delta(30, 0)
|
||||
.run((coord: Coordinates) => p.detect(coord));
|
||||
.run((coord: any) => p.detect(coord));
|
||||
expect(p.pan()).toEqual(-1);
|
||||
});
|
||||
|
||||
@@ -158,13 +158,13 @@ describe('recognizers', () => {
|
||||
p.start({ x: 0, y: 0 });
|
||||
Simulate
|
||||
.from(0, 0).deltaPolar(90 - 21, 21).delta(-30, 0)
|
||||
.run((coord: Coordinates) => p.detect(coord));
|
||||
.run((coord: any) => p.detect(coord));
|
||||
expect(p.pan()).toEqual(0);
|
||||
|
||||
p.start({ x: 0, y: 0 });
|
||||
Simulate
|
||||
.from(0, 0).deltaPolar(90 + 21, 21).delta(-30, 0)
|
||||
.run((coord: Coordinates) => p.detect(coord));
|
||||
.run((coord: any) => p.detect(coord));
|
||||
expect(p.pan()).toEqual(0);
|
||||
});
|
||||
|
||||
@@ -173,13 +173,13 @@ describe('recognizers', () => {
|
||||
p.start({ x: 0, y: 0 });
|
||||
Simulate
|
||||
.from(0, 0).deltaPolar(-90 + 21, 21).delta(30, 0)
|
||||
.run((coord: Coordinates) => p.detect(coord));
|
||||
.run((coord: any) => p.detect(coord));
|
||||
expect(p.pan()).toEqual(0);
|
||||
|
||||
p.start({ x: 0, y: 0 });
|
||||
Simulate
|
||||
.from(0, 0).deltaPolar(-90 - 21, 21).delta(30, 0)
|
||||
.run((coord: Coordinates) => p.detect(coord));
|
||||
.run((coord: any) => p.detect(coord));
|
||||
expect(p.pan()).toEqual(0);
|
||||
});
|
||||
|
||||
@@ -188,7 +188,7 @@ describe('recognizers', () => {
|
||||
p.start({ x: 0, y: 0 });
|
||||
Simulate
|
||||
.from(0, 0).deltaPolar(90, 21).delta(30, 0)
|
||||
.run((coord: Coordinates) => p.detect(coord));
|
||||
.run((coord: any) => p.detect(coord));
|
||||
|
||||
expect(p.pan()).toEqual(0);
|
||||
});
|
||||
@@ -198,7 +198,7 @@ describe('recognizers', () => {
|
||||
p.start({ x: 0, y: 0 });
|
||||
Simulate
|
||||
.from(0, 0).delta(30, 0)
|
||||
.run((coord: Coordinates) => p.detect(coord));
|
||||
.run((coord: any) => p.detect(coord));
|
||||
|
||||
expect(p.pan()).toEqual(0);
|
||||
});
|
||||
|
||||
@@ -3,7 +3,7 @@ export { IonicApp } from './components/app/app-root';
|
||||
export { MenuController } from './components/app/menu-controller';
|
||||
export { ActionSheet } from './components/action-sheet/action-sheet';
|
||||
export { ActionSheetController } from './components/action-sheet/action-sheet-controller';
|
||||
export { ActionSheetOptions } from './components/action-sheet/action-sheet-options';
|
||||
export { ActionSheetButton, ActionSheetOptions } from './components/action-sheet/action-sheet-options';
|
||||
export { ActionSheetCmp } from './components/action-sheet/action-sheet-component';
|
||||
export { Alert } from './components/alert/alert';
|
||||
export { AlertController } from './components/alert/alert-controller';
|
||||
|
||||
@@ -445,7 +445,7 @@ export class IonicModule {
|
||||
|
||||
{ provide: ModuleLoader, useFactory: provideModuleLoader, deps: [NgModuleLoader, Injector]},
|
||||
{ provide: LocationStrategy, useFactory: provideLocationStrategy, deps: [ PlatformLocation, [new Inject(APP_BASE_HREF), new Optional()], Config ] },
|
||||
{ provide: UrlSerializer, useFactory: setupUrlSerializer, deps: [ DeepLinkConfigToken ] },
|
||||
{ provide: UrlSerializer, useFactory: setupUrlSerializer, deps: [ App, DeepLinkConfigToken ] },
|
||||
{ provide: DeepLinker, useFactory: setupDeepLinker, deps: [ App, UrlSerializer, Location, ModuleLoader, ComponentFactoryResolver ] },
|
||||
]
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@ import { ComponentFactory, ComponentFactoryResolver } from '@angular/core';
|
||||
import { Location } from '@angular/common';
|
||||
|
||||
import { App } from '../components/app/app';
|
||||
import { DIRECTION_BACK, NavLink, NavSegment, convertToViews, isNav, isTab, isTabs, } from './nav-util';
|
||||
import { DIRECTION_BACK, NavLink, NavSegment, TransitionDoneFn, convertToViews, isNav, isTab, isTabs } from './nav-util';
|
||||
import { ModuleLoader } from '../util/module-loader';
|
||||
import { isArray, isPresent } from '../util/util';
|
||||
import { Tab, Tabs } from './nav-interfaces';
|
||||
@@ -131,18 +131,23 @@ export class DeepLinker {
|
||||
*/
|
||||
navChange(direction: string) {
|
||||
if (direction) {
|
||||
const rootNavContainers = this._app.getActiveNavContainers();
|
||||
const activeNavContainers = this._app.getActiveNavContainers();
|
||||
// the only time you'll ever get a TABS here is when loading directly from a URL
|
||||
// this method will be called again when the TAB is loaded
|
||||
// so just don't worry about the TABS for now
|
||||
// if you encounter a TABS, just return
|
||||
let segments: NavSegment[] = [];
|
||||
for (const rootNavContainer of rootNavContainers) {
|
||||
if (isTabs(rootNavContainer) || (rootNavContainer as NavController).isTransitioning()) {
|
||||
for (const activeNavContainer of activeNavContainers) {
|
||||
if (isTabs(activeNavContainer) || (activeNavContainer as NavController).isTransitioning()) {
|
||||
return;
|
||||
}
|
||||
const segmentsForNav = this.getSegmentsFromNav(rootNavContainer);
|
||||
segments = segments.concat(segmentsForNav);
|
||||
}
|
||||
|
||||
// okay, get the root navs and build the segments up
|
||||
let segments: NavSegment[] = [];
|
||||
const navContainers: NavigationContainer[] = this._app.getRootNavs();
|
||||
for (const navContainer of navContainers) {
|
||||
const segmentsForNav = this.getSegmentsFromNav(navContainer);
|
||||
segments = segments.concat(segmentsForNav);
|
||||
}
|
||||
segments = segments.filter(segment => !!segment);
|
||||
if (segments.length) {
|
||||
@@ -153,19 +158,16 @@ export class DeepLinker {
|
||||
}
|
||||
|
||||
getSegmentsFromNav(nav: NavigationContainer): NavSegment[] {
|
||||
const segments: NavSegment[] = [];
|
||||
while (nav) {
|
||||
if (isNav(nav)) {
|
||||
segments.push(this.getSegmentFromNav(nav as NavController));
|
||||
nav = nav.parent;
|
||||
} else if (isTab(nav)) {
|
||||
segments.push(this.getSegmentFromTab(nav));
|
||||
nav = nav.parent && nav.parent.parent;
|
||||
} else {
|
||||
nav = nav.parent;
|
||||
}
|
||||
let segments: NavSegment[] = [];
|
||||
if (isNav(nav)) {
|
||||
segments.push(this.getSegmentFromNav(nav as NavController));
|
||||
} else if (isTab(nav)) {
|
||||
segments.push(this.getSegmentFromTab(nav));
|
||||
}
|
||||
return segments.reverse();
|
||||
nav.getActiveChildNavs().forEach(child => {
|
||||
segments = segments.concat(this.getSegmentsFromNav(child));
|
||||
});
|
||||
return segments;
|
||||
}
|
||||
|
||||
getSegmentFromNav(nav: NavController, component?: any, data?: any): NavSegment {
|
||||
@@ -176,7 +178,7 @@ export class DeepLinker {
|
||||
data = viewController.data;
|
||||
}
|
||||
}
|
||||
return this._serializer.serializeComponent({ navId: nav.name && nav.name.length ? nav.name : nav.id, secondaryId: null, type: 'nav'}, component, data);
|
||||
return this._serializer.serializeComponent(nav, component, data);
|
||||
}
|
||||
|
||||
getSegmentFromTab(navContainer: NavigationContainer, component?: any, data?: any): NavSegment {
|
||||
@@ -190,7 +192,7 @@ export class DeepLinker {
|
||||
component = viewController.component;
|
||||
data = viewController.data;
|
||||
}
|
||||
return this._serializer.serializeComponent({ navId: tabsNavContainer.name || tabsNavContainer.id, secondaryId: tabsNavContainer.getSecondaryIdentifier(), type: 'tabs'}, component, data);
|
||||
return this._serializer.serializeComponent(tabsNavContainer, component, data);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -378,9 +380,9 @@ export class DeepLinker {
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
_loadViewForSegment(navContainer: NavigationContainer, segment: NavSegment, done: Function) {
|
||||
_loadViewForSegment(navContainer: NavigationContainer, segment: NavSegment, done: TransitionDoneFn) {
|
||||
if (!segment) {
|
||||
return done();
|
||||
return done(false, false);
|
||||
}
|
||||
|
||||
if (isTabs(navContainer) || (isTab(navContainer) && navContainer.parent)) {
|
||||
@@ -393,7 +395,7 @@ export class DeepLinker {
|
||||
updateUrl: false,
|
||||
animate: false
|
||||
}, true);
|
||||
return done();
|
||||
return done(false, false);
|
||||
}
|
||||
|
||||
const navController = <NavController> <any> navContainer;
|
||||
@@ -408,7 +410,7 @@ export class DeepLinker {
|
||||
if (i === numViews) {
|
||||
// this is the last view in the stack and it's the same
|
||||
// as the segment so there's no change needed
|
||||
return done();
|
||||
return done(false, false);
|
||||
} else {
|
||||
// it's not the exact view as the end
|
||||
// let's have this nav go back to this exact view
|
||||
|
||||
@@ -24,6 +24,7 @@ import {
|
||||
STATE_DESTROYED,
|
||||
STATE_INITIALIZED,
|
||||
STATE_NEW,
|
||||
TransitionDoneFn,
|
||||
TransitionInstruction,
|
||||
convertToViews,
|
||||
} from './nav-util';
|
||||
@@ -62,6 +63,7 @@ export class NavControllerBase extends Ion implements NavController {
|
||||
_viewport: ViewContainerRef;
|
||||
_views: ViewController[] = [];
|
||||
_zIndexOffset: number = 0;
|
||||
_destroyed: boolean;
|
||||
|
||||
viewDidLoad: EventEmitter<any> = new EventEmitter();
|
||||
viewWillEnter: EventEmitter<any> = new EventEmitter();
|
||||
@@ -102,9 +104,10 @@ export class NavControllerBase extends Ion implements NavController {
|
||||
this._sbEnabled = config.getBoolean('swipeBackEnabled');
|
||||
this._children = [];
|
||||
this.id = 'n' + (++ctrlIds);
|
||||
this._destroyed = false;
|
||||
}
|
||||
|
||||
push(page: any, params?: any, opts?: NavOptions, done?: () => void): Promise<any> {
|
||||
push(page: any, params?: any, opts?: NavOptions, done?: TransitionDoneFn): Promise<any> {
|
||||
return this._queueTrns({
|
||||
insertStart: -1,
|
||||
insertViews: [{ page: page, params: params }],
|
||||
@@ -112,7 +115,7 @@ export class NavControllerBase extends Ion implements NavController {
|
||||
}, done);
|
||||
}
|
||||
|
||||
insert(insertIndex: number, page: any, params?: any, opts?: NavOptions, done?: () => void): Promise<any> {
|
||||
insert(insertIndex: number, page: any, params?: any, opts?: NavOptions, done?: TransitionDoneFn): Promise<any> {
|
||||
return this._queueTrns({
|
||||
insertStart: insertIndex,
|
||||
insertViews: [{ page: page, params: params }],
|
||||
@@ -120,7 +123,7 @@ export class NavControllerBase extends Ion implements NavController {
|
||||
}, done);
|
||||
}
|
||||
|
||||
insertPages(insertIndex: number, insertPages: any[], opts?: NavOptions, done?: () => void): Promise<any> {
|
||||
insertPages(insertIndex: number, insertPages: any[], opts?: NavOptions, done?: TransitionDoneFn): Promise<any> {
|
||||
return this._queueTrns({
|
||||
insertStart: insertIndex,
|
||||
insertViews: insertPages,
|
||||
@@ -128,7 +131,7 @@ export class NavControllerBase extends Ion implements NavController {
|
||||
}, done);
|
||||
}
|
||||
|
||||
pop(opts?: NavOptions, done?: () => void): Promise<any> {
|
||||
pop(opts?: NavOptions, done?: TransitionDoneFn): Promise<any> {
|
||||
return this._queueTrns({
|
||||
removeStart: -1,
|
||||
removeCount: 1,
|
||||
@@ -136,7 +139,7 @@ export class NavControllerBase extends Ion implements NavController {
|
||||
}, done);
|
||||
}
|
||||
|
||||
popTo(indexOrViewCtrl: any, opts?: NavOptions, done?: () => void): Promise<any> {
|
||||
popTo(indexOrViewCtrl: any, opts?: NavOptions, done?: TransitionDoneFn): Promise<any> {
|
||||
let config: TransitionInstruction = {
|
||||
removeStart: -1,
|
||||
removeCount: -1,
|
||||
@@ -151,7 +154,7 @@ export class NavControllerBase extends Ion implements NavController {
|
||||
return this._queueTrns(config, done);
|
||||
}
|
||||
|
||||
popToRoot(opts?: NavOptions, done?: () => void): Promise<any> {
|
||||
popToRoot(opts?: NavOptions, done?: TransitionDoneFn): Promise<any> {
|
||||
return this._queueTrns({
|
||||
removeStart: 1,
|
||||
removeCount: -1,
|
||||
@@ -167,7 +170,7 @@ export class NavControllerBase extends Ion implements NavController {
|
||||
return Promise.all(promises);
|
||||
}
|
||||
|
||||
remove(startIndex: number, removeCount: number = 1, opts?: NavOptions, done?: () => void): Promise<any> {
|
||||
remove(startIndex: number, removeCount: number = 1, opts?: NavOptions, done?: TransitionDoneFn): Promise<any> {
|
||||
return this._queueTrns({
|
||||
removeStart: startIndex,
|
||||
removeCount: removeCount,
|
||||
@@ -175,7 +178,7 @@ export class NavControllerBase extends Ion implements NavController {
|
||||
}, done);
|
||||
}
|
||||
|
||||
removeView(viewController: ViewController, opts?: NavOptions, done?: () => void): Promise<any> {
|
||||
removeView(viewController: ViewController, opts?: NavOptions, done?: TransitionDoneFn): Promise<any> {
|
||||
return this._queueTrns({
|
||||
removeView: viewController,
|
||||
removeStart: 0,
|
||||
@@ -184,12 +187,12 @@ export class NavControllerBase extends Ion implements NavController {
|
||||
}, done);
|
||||
}
|
||||
|
||||
setRoot(pageOrViewCtrl: any, params?: any, opts?: NavOptions, done?: () => void): Promise<any> {
|
||||
setRoot(pageOrViewCtrl: any, params?: any, opts?: NavOptions, done?: TransitionDoneFn): Promise<any> {
|
||||
return this.setPages([{ page: pageOrViewCtrl, params: params }], opts, done);
|
||||
}
|
||||
|
||||
|
||||
setPages(viewControllers: any[], opts?: NavOptions, done?: () => void): Promise<any> {
|
||||
setPages(viewControllers: any[], opts?: NavOptions, done?: TransitionDoneFn): Promise<any> {
|
||||
if (isBlank(opts)) {
|
||||
opts = {};
|
||||
}
|
||||
@@ -216,7 +219,7 @@ export class NavControllerBase extends Ion implements NavController {
|
||||
// 7. _transitionStart(): called once the transition actually starts, it initializes the Animation underneath.
|
||||
// 8. _transitionFinish(): called once the transition finishes
|
||||
// 9. _cleanup(): syncs the navigation internal state with the DOM. For example it removes the pages from the DOM or hides/show them.
|
||||
_queueTrns(ti: TransitionInstruction, done: () => void): Promise<boolean> {
|
||||
_queueTrns(ti: TransitionInstruction, done: TransitionDoneFn): Promise<boolean> {
|
||||
const promise = new Promise<boolean>((resolve, reject) => {
|
||||
ti.resolve = resolve;
|
||||
ti.reject = reject;
|
||||
@@ -284,7 +287,7 @@ export class NavControllerBase extends Ion implements NavController {
|
||||
if (ti.done) {
|
||||
ti.done(false, false, rejectReason);
|
||||
}
|
||||
if (ti.reject) {
|
||||
if (ti.reject && !this._destroyed) {
|
||||
ti.reject(rejectReason);
|
||||
} else {
|
||||
ti.resolve(false);
|
||||
@@ -594,7 +597,6 @@ export class NavControllerBase extends Ion implements NavController {
|
||||
}
|
||||
|
||||
_transition(enteringView: ViewController, leavingView: ViewController, ti: TransitionInstruction): Promise<NavResult> {
|
||||
|
||||
if (!ti.requiresTransition) {
|
||||
// transition is not required, so we are already done!
|
||||
// they're inserting/removing the views somewhere in the middle or
|
||||
@@ -856,35 +858,38 @@ export class NavControllerBase extends Ion implements NavController {
|
||||
_cleanup(activeView: ViewController) {
|
||||
// ok, cleanup time!! Destroy all of the views that are
|
||||
// INACTIVE and come after the active view
|
||||
const activeViewIndex = this._views.indexOf(activeView);
|
||||
const views = this._views;
|
||||
let reorderZIndexes = false;
|
||||
let view: ViewController;
|
||||
let i: number;
|
||||
// only do this if the views exist, though
|
||||
if (!this._destroyed) {
|
||||
const activeViewIndex = this._views.indexOf(activeView);
|
||||
const views = this._views;
|
||||
let reorderZIndexes = false;
|
||||
let view: ViewController;
|
||||
let i: number;
|
||||
|
||||
for (i = views.length - 1; i >= 0; i--) {
|
||||
view = views[i];
|
||||
if (i > activeViewIndex) {
|
||||
// this view comes after the active view
|
||||
// let's unload it
|
||||
this._willUnload(view);
|
||||
this._destroyView(view);
|
||||
|
||||
} else if (i < activeViewIndex && !this._isPortal) {
|
||||
// this view comes before the active view
|
||||
// and it is not a portal then ensure it is hidden
|
||||
view._domShow(false, this._renderer);
|
||||
}
|
||||
if (view._zIndex <= 0) {
|
||||
reorderZIndexes = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!this._isPortal && reorderZIndexes) {
|
||||
for (i = 0; i < views.length; i++) {
|
||||
for (i = views.length - 1; i >= 0; i--) {
|
||||
view = views[i];
|
||||
// ******** DOM WRITE ****************
|
||||
view._setZIndex(view._zIndex + INIT_ZINDEX + 1, this._renderer);
|
||||
if (i > activeViewIndex) {
|
||||
// this view comes after the active view
|
||||
// let's unload it
|
||||
this._willUnload(view);
|
||||
this._destroyView(view);
|
||||
|
||||
} else if (i < activeViewIndex && !this._isPortal) {
|
||||
// this view comes before the active view
|
||||
// and it is not a portal then ensure it is hidden
|
||||
view._domShow(false, this._renderer);
|
||||
}
|
||||
if (view._zIndex <= 0) {
|
||||
reorderZIndexes = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!this._isPortal && reorderZIndexes) {
|
||||
for (i = 0; i < views.length; i++) {
|
||||
view = views[i];
|
||||
// ******** DOM WRITE ****************
|
||||
view._setZIndex(view._zIndex + INIT_ZINDEX + 1, this._renderer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -991,6 +996,10 @@ export class NavControllerBase extends Ion implements NavController {
|
||||
return this._children;
|
||||
}
|
||||
|
||||
getAllChildNavs(): any[] {
|
||||
return this._children;
|
||||
}
|
||||
|
||||
registerChildNav(container: NavigationContainer) {
|
||||
this._children.push(container);
|
||||
}
|
||||
@@ -1017,6 +1026,8 @@ export class NavControllerBase extends Ion implements NavController {
|
||||
if (this.parent && this.parent.unregisterChildNav) {
|
||||
this.parent.unregisterChildNav(this);
|
||||
}
|
||||
|
||||
this._destroyed = true;
|
||||
}
|
||||
|
||||
swipeBackStart() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { EventEmitter } from '@angular/core';
|
||||
|
||||
import { Config } from '../config/config';
|
||||
import { NavOptions } from './nav-util';
|
||||
import { NavOptions, TransitionDoneFn } from './nav-util';
|
||||
import { Page } from './nav-util';
|
||||
import { ViewController } from './view-controller';
|
||||
import { NavigationContainer } from './navigation-container';
|
||||
@@ -420,7 +420,7 @@ export abstract class NavController implements NavigationContainer {
|
||||
* @param {object} [opts={}] Nav options to go with this transition.
|
||||
* @returns {Promise} Returns a promise which is resolved when the transition has completed.
|
||||
*/
|
||||
abstract push(page: Page | string, params?: any, opts?: NavOptions, done?: Function): Promise<any>;
|
||||
abstract push(page: Page | string, params?: any, opts?: NavOptions, done?: TransitionDoneFn): Promise<any>;
|
||||
|
||||
/**
|
||||
* Inserts a component into the nav stack at the specified index. This is useful if
|
||||
@@ -433,7 +433,7 @@ export abstract class NavController implements NavigationContainer {
|
||||
* @param {object} [opts={}] Nav options to go with this transition.
|
||||
* @returns {Promise} Returns a promise which is resolved when the transition has completed.
|
||||
*/
|
||||
abstract insert(insertIndex: number, page: Page | string, params?: any, opts?: NavOptions, done?: Function): Promise<any>;
|
||||
abstract insert(insertIndex: number, page: Page | string, params?: any, opts?: NavOptions, done?: TransitionDoneFn): Promise<any>;
|
||||
|
||||
/**
|
||||
* Inserts an array of components into the nav stack at the specified index.
|
||||
@@ -445,7 +445,7 @@ export abstract class NavController implements NavigationContainer {
|
||||
* @param {object} [opts={}] Nav options to go with this transition.
|
||||
* @returns {Promise} Returns a promise which is resolved when the transition has completed.
|
||||
*/
|
||||
abstract insertPages(insertIndex: number, insertPages: Array<{page: Page | string, params?: any}>, opts?: NavOptions, done?: Function): Promise<any>;
|
||||
abstract insertPages(insertIndex: number, insertPages: Array<{page: Page | string, params?: any}>, opts?: NavOptions, done?: TransitionDoneFn): Promise<any>;
|
||||
|
||||
/**
|
||||
* Call to navigate back from a current component. Similar to `push()`, you
|
||||
@@ -454,7 +454,7 @@ export abstract class NavController implements NavigationContainer {
|
||||
* @param {object} [opts={}] Nav options to go with this transition.
|
||||
* @returns {Promise} Returns a promise which is resolved when the transition has completed.
|
||||
*/
|
||||
abstract pop(opts?: NavOptions, done?: Function): Promise<any>;
|
||||
abstract pop(opts?: NavOptions, done?: TransitionDoneFn): Promise<any>;
|
||||
|
||||
/**
|
||||
* Navigate back to the root of the stack, no matter how far back that is.
|
||||
@@ -462,7 +462,7 @@ export abstract class NavController implements NavigationContainer {
|
||||
* @param {object} [opts={}] Nav options to go with this transition.
|
||||
* @returns {Promise} Returns a promise which is resolved when the transition has completed.
|
||||
*/
|
||||
abstract popToRoot(opts?: NavOptions, done?: Function): Promise<any>;
|
||||
abstract popToRoot(opts?: NavOptions, done?: TransitionDoneFn): Promise<any>;
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
@@ -475,11 +475,10 @@ export abstract class NavController implements NavigationContainer {
|
||||
* when a new instance needs to be created.
|
||||
*
|
||||
* @param {Page|string|ViewController} page The component class or deeplink name you want to push onto the navigation stack.
|
||||
* @param {object} [params={}] Any NavParams to be used when a new view instance is created at the root.
|
||||
* @param {object} [opts={}] Nav options to go with this transition.
|
||||
* @returns {Promise} Returns a promise which is resolved when the transition has completed.
|
||||
*/
|
||||
abstract popTo(page: Page | string | ViewController, params?: any, opts?: NavOptions, done?: Function): Promise<any>;
|
||||
abstract popTo(page: Page | string | ViewController, opts?: NavOptions, done?: TransitionDoneFn): Promise<any>;
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
@@ -497,7 +496,7 @@ export abstract class NavController implements NavigationContainer {
|
||||
* @param {object} [opts={}] Any options you want to use pass to transtion.
|
||||
* @returns {Promise} Returns a promise which is resolved when the transition has completed.
|
||||
*/
|
||||
abstract remove(startIndex: number, removeCount?: number, opts?: NavOptions, done?: Function): Promise<any>;
|
||||
abstract remove(startIndex: number, removeCount?: number, opts?: NavOptions, done?: TransitionDoneFn): Promise<any>;
|
||||
|
||||
/**
|
||||
* Removes the specified view controller from the nav stack.
|
||||
@@ -506,7 +505,7 @@ export abstract class NavController implements NavigationContainer {
|
||||
* @param {object} [opts={}] Any options you want to use pass to transtion.
|
||||
* @returns {Promise} Returns a promise which is resolved when the transition has completed.
|
||||
*/
|
||||
abstract removeView(viewController: ViewController, opts?: NavOptions, done?: Function): Promise<any>;
|
||||
abstract removeView(viewController: ViewController, opts?: NavOptions, done?: TransitionDoneFn): Promise<any>;
|
||||
|
||||
/**
|
||||
* Set the root for the current navigation stack.
|
||||
@@ -516,7 +515,7 @@ export abstract class NavController implements NavigationContainer {
|
||||
* @param {Function} done Callback function on done.
|
||||
* @returns {Promise} Returns a promise which is resolved when the transition has completed.
|
||||
*/
|
||||
abstract setRoot(pageOrViewCtrl: Page | string | ViewController, params?: any, opts?: NavOptions, done?: Function): Promise<any>;
|
||||
abstract setRoot(pageOrViewCtrl: Page | string | ViewController, params?: any, opts?: NavOptions, done?: TransitionDoneFn): Promise<any>;
|
||||
abstract goToRoot(options: NavOptions): Promise<any>;
|
||||
|
||||
/**
|
||||
@@ -529,7 +528,7 @@ export abstract class NavController implements NavigationContainer {
|
||||
* @param {Object} [opts={}] Nav options to go with this transition.
|
||||
* @returns {Promise} Returns a promise which is resolved when the transition has completed.
|
||||
*/
|
||||
abstract setPages(pages: ({page: Page | string, params?: any} | ViewController)[], opts?: NavOptions, done?: Function): Promise<any>;
|
||||
abstract setPages(pages: ({page: Page | string, params?: any} | ViewController)[], opts?: NavOptions, done?: TransitionDoneFn): Promise<any>;
|
||||
|
||||
/**
|
||||
* @param {number} index The index of the page to get.
|
||||
@@ -599,6 +598,11 @@ export abstract class NavController implements NavigationContainer {
|
||||
*/
|
||||
abstract getActiveChildNav(): any;
|
||||
|
||||
/**
|
||||
* Returns a list of all child navigation containers
|
||||
*/
|
||||
abstract getAllChildNavs(): any[];
|
||||
|
||||
|
||||
/**
|
||||
* Returns if the nav controller is actively transitioning or not.
|
||||
|
||||
@@ -7,11 +7,15 @@
|
||||
*
|
||||
* @usage
|
||||
* ```ts
|
||||
* import { NavParams } from 'ionic-angular';
|
||||
*
|
||||
* export class MyClass{
|
||||
* constructor(public navParams: NavParams){
|
||||
*
|
||||
* constructor(navParams: NavParams){
|
||||
* // userParams is an object we have in our nav-parameters
|
||||
* this.navParams.get('userParams');
|
||||
* navParams.get('userParams');
|
||||
* }
|
||||
*
|
||||
* }
|
||||
* ```
|
||||
* @demo /docs/demos/src/nav-params/
|
||||
@@ -32,6 +36,8 @@ export class NavParams {
|
||||
* Get the value of a nav-parameter for the current view
|
||||
*
|
||||
* ```ts
|
||||
* import { NavParams } from 'ionic-angular';
|
||||
*
|
||||
* export class MyClass{
|
||||
* constructor(public navParams: NavParams){
|
||||
* // userParams is an object we have in our nav-parameters
|
||||
|
||||
@@ -163,16 +163,26 @@ export interface NavResult {
|
||||
direction?: string;
|
||||
}
|
||||
|
||||
export interface NavSegment {
|
||||
export interface NavSegment extends DehydratedSegment {
|
||||
type: string;
|
||||
navId: string;
|
||||
secondaryId: string;
|
||||
requiresExplicitNavPrefix?: boolean;
|
||||
}
|
||||
|
||||
export interface DehydratedSegment {
|
||||
id: string;
|
||||
name: string;
|
||||
component?: any;
|
||||
loadChildren?: string;
|
||||
data: any;
|
||||
type: string;
|
||||
navId: string;
|
||||
secondaryId: string;
|
||||
defaultHistory?: NavSegment[];
|
||||
secondaryId?: string;
|
||||
}
|
||||
|
||||
export interface DehydratedSegmentPair {
|
||||
segments: DehydratedSegment[];
|
||||
navGroup: NavGroup;
|
||||
}
|
||||
|
||||
export interface NavGroup {
|
||||
@@ -211,6 +221,10 @@ export interface TransitionRejectFn {
|
||||
(rejectReason: any, transition?: Transition): void;
|
||||
}
|
||||
|
||||
export interface TransitionDoneFn {
|
||||
(hasCompleted: boolean, requiresTransition: boolean, enteringName?: string, leavingName?: string, direction?: string): void;
|
||||
}
|
||||
|
||||
export interface TransitionInstruction {
|
||||
opts: NavOptions;
|
||||
insertStart?: number;
|
||||
@@ -220,7 +234,7 @@ export interface TransitionInstruction {
|
||||
removeCount?: number;
|
||||
resolve?: (hasCompleted: boolean) => void;
|
||||
reject?: (rejectReason: string) => void;
|
||||
done?: Function;
|
||||
done?: TransitionDoneFn;
|
||||
leavingRequiresTransition?: boolean;
|
||||
enteringRequiresTransition?: boolean;
|
||||
requiresTransition?: boolean;
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
import { NavController } from './nav-controller';
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
export interface NavigationContainer {
|
||||
id: string;
|
||||
name: string;
|
||||
parent: NavController;
|
||||
getActiveChildNavs(): NavigationContainer[];
|
||||
getAllChildNavs?(): NavigationContainer[];
|
||||
getType(): string;
|
||||
getSecondaryIdentifier(): string;
|
||||
}
|
||||
|
||||
@@ -457,9 +457,7 @@ describe('DeepLinker', () => {
|
||||
|
||||
linker.getSegmentFromNav(mockNav, null, null);
|
||||
|
||||
expect(spy.calls.first().args[0].navId).toEqual(mockNav.name);
|
||||
expect(spy.calls.first().args[0].secondaryId).toBeFalsy();
|
||||
expect(spy.calls.first().args[0].type).toEqual('nav');
|
||||
expect(spy.calls.first().args[0]).toEqual(mockNav);
|
||||
});
|
||||
|
||||
it('should use the id of the nav when name doesnt exists', () => {
|
||||
@@ -472,9 +470,7 @@ describe('DeepLinker', () => {
|
||||
|
||||
linker.getSegmentFromNav(mockNav, null, null);
|
||||
|
||||
expect(spy.calls.first().args[0].navId).toEqual(mockNav.id);
|
||||
expect(spy.calls.first().args[0].secondaryId).toBeFalsy();
|
||||
expect(spy.calls.first().args[0].type).toEqual('nav');
|
||||
expect(spy.calls.first().args[0]).toEqual(mockNav);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -493,7 +489,7 @@ describe('DeepLinker', () => {
|
||||
linker.getSegmentFromTab(tabOne, null, null);
|
||||
|
||||
expect(spy).toHaveBeenCalled();
|
||||
expect(spy.calls.first().args[0].navId).toEqual(tabs.name);
|
||||
expect(spy.calls.first().args[0]).toEqual(tabs);
|
||||
|
||||
});
|
||||
|
||||
@@ -511,7 +507,7 @@ describe('DeepLinker', () => {
|
||||
linker.getSegmentFromTab(tabOne, null, null);
|
||||
|
||||
expect(spy).toHaveBeenCalled();
|
||||
expect(spy.calls.first().args[0].navId).toEqual(tabs.id);
|
||||
expect(spy.calls.first().args[0]).toEqual(tabs);
|
||||
|
||||
});
|
||||
});
|
||||
@@ -685,7 +681,7 @@ describe('DeepLinker', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
let linkConfig = mockDeepLinkConfig();
|
||||
serializer = new UrlSerializer(linkConfig);
|
||||
serializer = new UrlSerializer(mockApp(), linkConfig);
|
||||
|
||||
let moduleLoader = mockModuleLoader();
|
||||
let baseCfr: any = null;
|
||||
|
||||
@@ -1099,13 +1099,13 @@ describe('NavController', () => {
|
||||
|
||||
it('should not crash when destroyed while transitioning', (done) => {
|
||||
let view1 = mockView(MockView1);
|
||||
nav.push(view1).then(() => {
|
||||
fail('it should not succeed');
|
||||
nav.push(view1).then((succeded: boolean) => {
|
||||
expect(succeded).toEqual(false);
|
||||
done();
|
||||
}).catch((err: any) => {
|
||||
expect(err).toEqual('nav controller was destroyed');
|
||||
}).catch(() => {
|
||||
fail('should never get here');
|
||||
done();
|
||||
});
|
||||
});
|
||||
nav.destroy();
|
||||
}, 10000);
|
||||
});
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user