mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c463b065c7 | ||
|
|
5883da20fd | ||
|
|
b224a65f22 | ||
|
|
e1948be1f8 | ||
|
|
248a1ceced | ||
|
|
75cf887f91 | ||
|
|
32c5bed546 | ||
|
|
4f3e91bdfa | ||
|
|
236e7f8393 | ||
|
|
ea710044ef | ||
|
|
efd6605f98 | ||
|
|
aaa3cac917 | ||
|
|
4cc54eeb5d | ||
|
|
cfdba88754 | ||
|
|
7c583938a2 | ||
|
|
d659676ba2 | ||
|
|
e555eae1f5 | ||
|
|
5742540a36 | ||
|
|
6978bb551f | ||
|
|
e7ac15f9be | ||
|
|
2ab8385ee0 | ||
|
|
616786b387 | ||
|
|
6b5f9f113f | ||
|
|
2bba548253 | ||
|
|
1497d83a0e | ||
|
|
7f7f60ede5 |
180
CHANGELOG.md
180
CHANGELOG.md
@@ -1,3 +1,183 @@
|
||||
<a name="3.9.1"></a>
|
||||
## [3.9.1](https://github.com/ionic-team/ionic/compare/v3.9.0...v3.9.1) (2017-11-08)
|
||||
|
||||
## Upgrade Instructions
|
||||
`ionic-angular` 3.9.1 is patch release of `ionic-angular` 3.9.0. To upgrade, follow the instructions [here](https://github.com/ionic-team/ionic/blob/master/CHANGELOG.md#390-2017-11-08) for updating to `ionic-angular` 3.9.0. After completing those steps, update the `ionic-angular` version to 3.9.1.
|
||||
|
||||
```
|
||||
npm install ionic-angular@3.9.1 --save
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **datetime:** avoid adding cancel and done button repeatedly ([248a1ce](https://github.com/ionic-team/ionic/commit/248a1ce))
|
||||
|
||||
|
||||
|
||||
<a name="3.9.0"></a>
|
||||
# [3.9.0](https://github.com/ionic-team/ionic/compare/v3.8.0...v3.9.0) (2017-11-08)
|
||||
|
||||
### Upgrade Instructions
|
||||
`ionic-angular` 3.9.0 adds support for `@angular` 5.0.0 :tada:! It is a drop-in replacement for `ionic-angular` 3.8.x.
|
||||
|
||||
To update, remove existing `node_modules` and any lock files, and then update `package.json` to the following deps.
|
||||
|
||||
```
|
||||
"dependencies" : {
|
||||
...
|
||||
"@angular/common": "5.0.0",
|
||||
"@angular/compiler": "5.0.0",
|
||||
"@angular/compiler-cli": "5.0.0",
|
||||
"@angular/core": "5.0.0",
|
||||
"@angular/forms": "5.0.0",
|
||||
"@angular/http": "5.0.0",
|
||||
"@angular/platform-browser": "5.0.0",
|
||||
"@angular/platform-browser-dynamic": "5.0.0",
|
||||
"@ionic/storage": "2.1.3",
|
||||
"ionic-angular": "3.9.0",
|
||||
"rxjs": "5.5.2",
|
||||
"zone.js": "0.8.18"
|
||||
...
|
||||
},
|
||||
"devDependencies: {
|
||||
"@ionic/app-scripts": "3.1.0"
|
||||
"typescript" : "2.4.2"
|
||||
}
|
||||
```
|
||||
|
||||
If your app uses RXJS, see the instructions below to update.
|
||||
|
||||
### RXJS 5.5.2 Updates
|
||||
|
||||
The recent update of RXJS includes a change in how operators are applied.
|
||||
|
||||
Traditionally, operators were applied like this:
|
||||
|
||||
```typescript
|
||||
import 'rxjs/add/operator/debounceTime';
|
||||
import 'rxjs/add/operator/switchMap';
|
||||
|
||||
export MyClass {
|
||||
|
||||
|
||||
someMethod(){
|
||||
// Using Reactive Forms
|
||||
this.input.valueChanges
|
||||
.debounceTime(500)
|
||||
.switchMap(inputVal => this.service.get(inputVal))
|
||||
.subscribe(res => console.log(res))
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This approach involved modifying the Observable prototype and patching on the
|
||||
methods.
|
||||
|
||||
RXJS 5.5 introduces a different way to do this that can lead to significantly
|
||||
smaller code bundles, lettable operators.
|
||||
|
||||
To use lettable operators, modify the code from above to look like this:
|
||||
|
||||
```typescript
|
||||
//Use Deep imports here for smallest bunlde size
|
||||
import { debounceTime } from 'rxjs/operators/debounceTime';
|
||||
import { switch } from 'rxjs/operators/switchMap';
|
||||
|
||||
export MyClass {
|
||||
|
||||
|
||||
someMethod(){
|
||||
// Using Reactive Forms
|
||||
// We use the new `.pipe` method on the observable
|
||||
// too apply operators now
|
||||
|
||||
this.input.valueChanges
|
||||
.pipe(
|
||||
debounceTime(500),
|
||||
switchMap(inputVal => this.service.get(inputVal))
|
||||
)
|
||||
.subscribe(res => console.log(res))
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This slight change allows only import the operators we need in our code. This will result in a smaller, faster application. This example uses Deep Imports, which allow the module we want to import to be isolated.
|
||||
|
||||
Take a look at [this
|
||||
doc](https://github.com/ReactiveX/rxjs/blob/master/doc/lettable-operators.md) for more information.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **action-sheet:** move box-shadow to first group ([4f3e91b](https://github.com/ionic-team/ionic/commit/4f3e91b))
|
||||
* **alert:** focus input after it is ready ([#13259](https://github.com/ionic-team/ionic/issues/13259)) ([e555eae](https://github.com/ionic-team/ionic/commit/e555eae))
|
||||
* **datetime:** use spread operator to copy pickerOptions ([#13202](https://github.com/ionic-team/ionic/issues/13202)) ([2ab8385](https://github.com/ionic-team/ionic/commit/2ab8385)), closes [#11641](https://github.com/ionic-team/ionic/issues/11641)
|
||||
* **input:** better support for WKKeyboard ([#13106](https://github.com/ionic-team/ionic/issues/13106)) ([e7ac15f](https://github.com/ionic-team/ionic/commit/e7ac15f))
|
||||
* **tabs:** no safe area padding for top tabs ([236e7f8](https://github.com/ionic-team/ionic/commit/236e7f8))
|
||||
* **tap-click:** clear activated state on activable element when appropriate ([#13258](https://github.com/ionic-team/ionic/issues/13258)) ([5742540](https://github.com/ionic-team/ionic/commit/5742540)), closes [#13044](https://github.com/ionic-team/ionic/issues/13044)
|
||||
* **VirtualScroll:** stop from resizing while out of view ([#13143](https://github.com/ionic-team/ionic/issues/13143)) ([6978bb5](https://github.com/ionic-team/ionic/commit/6978bb5))
|
||||
|
||||
|
||||
|
||||
<a name="3.8.0"></a>
|
||||
# [3.8.0](https://github.com/ionic-team/ionic/compare/v3.7.1...v3.8.0) (2017-10-26)
|
||||
|
||||
|
||||
### Upgrade Instructions
|
||||
|
||||
This release includes improvements for iOS11 and specifically, the iPhone X. Please also read over the [iOS 11 checklist](http://blog.ionic.io/ios-11-checklist/) blog post for additional information.
|
||||
|
||||
To update, install the latest version of `ionic-angular` and `@ionic/app-scripts`:
|
||||
|
||||
```bash
|
||||
npm install ionic-angular@latest --save
|
||||
npm install @ionic/app-scripts@latest --save-dev
|
||||
```
|
||||
|
||||
This release uses version `4.4.4` of Angular. Please update the version number of any `@angular` packages in your `package.json` file:
|
||||
|
||||
```
|
||||
"dependencies": {
|
||||
"@angular/common": "4.4.4",
|
||||
"@angular/compiler": "4.4.4",
|
||||
"@angular/compiler-cli": "4.4.4",
|
||||
"@angular/core": "4.4.4",
|
||||
"@angular/forms": "4.4.4",
|
||||
"@angular/http": "4.4.4",
|
||||
"@angular/platform-browser": "4.4.4",
|
||||
"@angular/platform-browser-dynamic": "4.4.4",
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **action-sheet:** fix action sheet so it will scroll when the options exceed the screen ([#13049](https://github.com/ionic-team/ionic/issues/13049)) ([199cb00](https://github.com/ionic-team/ionic/commit/199cb00))
|
||||
* **content:** reize on orientationchange only ([6b848a0](https://github.com/ionic-team/ionic/commit/6b848a0))
|
||||
* **cordova:** size footer correctly ([33960f1](https://github.com/ionic-team/ionic/commit/33960f1))
|
||||
* **item:** safe-padding on last item only ([af36358](https://github.com/ionic-team/ionic/commit/af36358))
|
||||
* **nav:** remove bad assert ([ae4be66](https://github.com/ionic-team/ionic/commit/ae4be66))
|
||||
* **navigation:** account for condition of toggling one view with tabs to another view with tabs ([c963745](https://github.com/ionic-team/ionic/commit/c963745))
|
||||
* **navigation:** add defaultHistory support to ion-tabs ([2646ebe](https://github.com/ionic-team/ionic/commit/2646ebe))
|
||||
* **navigation:** unregister root navs when appropriate ([2bd89fe](https://github.com/ionic-team/ionic/commit/2bd89fe))
|
||||
* **overlay:** onWillDismiss is called as expected ([#12056](https://github.com/ionic-team/ionic/issues/12056)) ([c91223b](https://github.com/ionic-team/ionic/commit/c91223b)), closes [#11702](https://github.com/ionic-team/ionic/issues/11702)
|
||||
* **popover:** improve positioning in ios11 ([73f6a82](https://github.com/ionic-team/ionic/commit/73f6a82))
|
||||
* **select:** overlay types should use shared interface ([c4e9b5d](https://github.com/ionic-team/ionic/commit/c4e9b5d)), closes [#13103](https://github.com/ionic-team/ionic/issues/13103)
|
||||
* **swiper:** add safe-guards when user tries to zoom a slide without an image ([#12931](https://github.com/ionic-team/ionic/issues/12931)) ([e0c8309](https://github.com/ionic-team/ionic/commit/e0c8309)), closes [#12861](https://github.com/ionic-team/ionic/issues/12861)
|
||||
* **swiper:** allow for multiple swipers on a page ([#12213](https://github.com/ionic-team/ionic/issues/12213)) ([dd66f9a](https://github.com/ionic-team/ionic/commit/dd66f9a)), closes [#12008](https://github.com/ionic-team/ionic/issues/12008)
|
||||
* **tabs:** emit viewDidEnter and viewDidLeave on app during tab change ([c8be8e2](https://github.com/ionic-team/ionic/commit/c8be8e2))
|
||||
* **tabs:** return promises where appropriate ([a77bb2c](https://github.com/ionic-team/ionic/commit/a77bb2c))
|
||||
* **virtual-scroll:** flickering issue fixes ([88b2e83](https://github.com/ionic-team/ionic/commit/88b2e83))
|
||||
* **viewController** move resize logic to viewCtrl ([ebdf22d](https://github.com/ionic-team/ionic/commit/ebdf22d))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **alert:** export AlertButton interface ([0ba33d9](https://github.com/ionic-team/ionic/commit/0ba33d9)), closes [#12545](https://github.com/ionic-team/ionic/issues/12545)
|
||||
* **input:** add dir attribute for different language directions ([#13043](https://github.com/ionic-team/ionic/issues/13043)) ([b180351](https://github.com/ionic-team/ionic/commit/b180351))
|
||||
* improved ios11 support ([49e0c37](https://github.com/ionic-team/ionic/commit/49e0c37))
|
||||
|
||||
|
||||
|
||||
<a name="3.7.1"></a>
|
||||
## [3.7.1](https://github.com/ionic-team/ionic/compare/v3.7.0...v3.7.1) (2017-09-29)
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ jobs:
|
||||
branches:
|
||||
ignore:
|
||||
- mono-refactor
|
||||
- core
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
|
||||
2268
package-lock.json
generated
2268
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
26
package.json
26
package.json
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "ionic2",
|
||||
"version": "3.7.1",
|
||||
"version": "3.9.1",
|
||||
"description": "A powerful framework for building mobile and progressive web apps with JavaScript and Angular",
|
||||
"keywords": [
|
||||
"ionic",
|
||||
@@ -26,16 +26,16 @@
|
||||
"tsc": "tsc --outdir .tmp"
|
||||
},
|
||||
"dependencies": {
|
||||
"@angular/common": "4.4.4",
|
||||
"@angular/compiler": "4.4.4",
|
||||
"@angular/compiler-cli": "4.4.4",
|
||||
"@angular/core": "4.4.4",
|
||||
"@angular/forms": "4.4.4",
|
||||
"@angular/http": "4.4.4",
|
||||
"@angular/platform-browser": "4.4.4",
|
||||
"@angular/platform-browser-dynamic": "4.4.4",
|
||||
"@angular/common": "4.4.6",
|
||||
"@angular/compiler": "4.4.6",
|
||||
"@angular/compiler-cli": "4.4.6",
|
||||
"@angular/core": "4.4.6",
|
||||
"@angular/forms": "4.4.6",
|
||||
"@angular/http": "4.4.6",
|
||||
"@angular/platform-browser": "4.4.6",
|
||||
"@angular/platform-browser-dynamic": "4.4.6",
|
||||
"ionicons": "~3.0.0",
|
||||
"rxjs": "5.4.3",
|
||||
"rxjs": "5.5.2",
|
||||
"zone.js": "0.8.18"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -64,7 +64,7 @@
|
||||
"canonical-path": "0.0.2",
|
||||
"connect": "3.5.0",
|
||||
"conventional-changelog": "1.1.0",
|
||||
"core-js": "2.4.1",
|
||||
"core-js": "2.5.1",
|
||||
"cpr": "2.0.0",
|
||||
"cross-spawn": "^5.1.0",
|
||||
"del": "2.2.2",
|
||||
@@ -134,7 +134,7 @@
|
||||
"ts-node": "3.3.0",
|
||||
"tslint": "^5.4.3",
|
||||
"tslint-ionic-rules": "0.0.11",
|
||||
"typescript": "~2.3.4",
|
||||
"typescript": "~2.4.2",
|
||||
"vinyl": "1.2.0",
|
||||
"yargs": "5.0.0"
|
||||
},
|
||||
@@ -147,4 +147,4 @@
|
||||
"pre-push#master": [
|
||||
"test"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import { task } from 'gulp';
|
||||
import { join } from 'path';
|
||||
import { DIST_BUILD_ROOT, DIST_BUILD_ES2015_ROOT, DIST_BUILD_UMD_ROOT, ES5, ES_2015, PROJECT_ROOT, UMD_MODULE } from '../constants';
|
||||
import { DIST_BUILD_ES2015_ROOT, DIST_BUILD_ROOT, DIST_BUILD_UMD_ROOT, ES5, ES_2015, PROJECT_ROOT, UMD_MODULE } from '../constants';
|
||||
import { copySourceToDest, createTempTsConfig, deleteFiles, runNgc, runTsc } from '../util';
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import * as runSequence from 'run-sequence';
|
||||
import * as semver from 'semver';
|
||||
import { obj } from 'through2';
|
||||
|
||||
import { DIST_BUILD_UMD_BUNDLE_ENTRYPOINT, DIST_BUILD_ROOT, DIST_BUNDLE_ROOT, PROJECT_ROOT, SCRIPTS_ROOT, SRC_ROOT } from '../constants';
|
||||
import { DIST_BUILD_ROOT, DIST_BUILD_UMD_BUNDLE_ENTRYPOINT, DIST_BUNDLE_ROOT, PROJECT_ROOT, SCRIPTS_ROOT, SRC_ROOT } from '../constants';
|
||||
import { compileSass, copyFonts, createTimestamp, setSassIonicVersion, writePolyfills } from '../util';
|
||||
|
||||
var promptAnswers;
|
||||
@@ -85,7 +85,7 @@ task('release.publishGithubRelease', (done: Function) => {
|
||||
return changelog({
|
||||
preset: 'angular'
|
||||
})
|
||||
.pipe(obj(function(file, enc, cb){
|
||||
.pipe(obj(function(file, enc, cb) {
|
||||
github.releases.createRelease({
|
||||
owner: 'ionic-team',
|
||||
repo: 'ionic',
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { spawn } from 'cross-spawn';
|
||||
import { NODE_MODULES_ROOT, SRC_ROOT } from './constants';
|
||||
import { src, dest } from 'gulp';
|
||||
import { dirname, join } from 'path';
|
||||
import { ensureDirSync, readdirSync, readFile, readFileSync, statSync, writeFile, writeFileSync } from 'fs-extra';
|
||||
import { dest, src } from 'gulp';
|
||||
import { dirname, join, resolve } from 'path';
|
||||
import { ensureDirSync, readFile, readFileSync, readdirSync, statSync, writeFile, writeFileSync } from 'fs-extra';
|
||||
import { rollup } from 'rollup';
|
||||
import { Replacer } from 'strip-function';
|
||||
import * as commonjs from 'rollup-plugin-commonjs';
|
||||
@@ -25,10 +25,10 @@ export function mergeObjects(obj1: any, obj2: any ) {
|
||||
obj2 = {};
|
||||
}
|
||||
var obj3 = {};
|
||||
for (var attrname in obj1) {
|
||||
for (let attrname in obj1) {
|
||||
(<any>obj3)[attrname] = obj1[attrname];
|
||||
}
|
||||
for (var attrname in obj2) {
|
||||
for (let attrname in obj2) {
|
||||
(<any>obj3)[attrname] = obj2[attrname];
|
||||
}
|
||||
return obj3;
|
||||
@@ -214,7 +214,8 @@ export function runAppScriptsServe(testOrDemoName: string, appEntryPoint: string
|
||||
'--ionicAngularDir', ionicAngularDir,
|
||||
'--sass', sassConfigPath,
|
||||
'--copy', copyConfigPath,
|
||||
'--enableLint', 'false'
|
||||
'--enableLint', 'false',
|
||||
'--skipIonicAngularVersion', 'true'
|
||||
];
|
||||
if (devApp) {
|
||||
scriptArgs.push('--bonjour');
|
||||
@@ -349,6 +350,8 @@ function bundlePolyfill(pathsToIncludeInPolyfill: string[], outputPath: string)
|
||||
moduleName: 'MyBundle',
|
||||
dest: outputPath
|
||||
});
|
||||
}).catch(err => {
|
||||
console.log('caught rollup error: ', err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -76,6 +76,7 @@ export function createWorker(msg: MessageToWorker): any {
|
||||
'--sass', msg.sassConfigPath,
|
||||
'--copy', msg.copyConfigPath,
|
||||
'--enableLint', 'false',
|
||||
'--skipIonicAngularVersion', 'true'
|
||||
];
|
||||
|
||||
// TODO, use prod once we're a little more settled
|
||||
|
||||
@@ -12,15 +12,5 @@
|
||||
"module": "index.js",
|
||||
"es2015": "es2015/index.js",
|
||||
"peerDependencies": {
|
||||
"@angular/common": "",
|
||||
"@angular/compiler": "",
|
||||
"@angular/compiler-cli": "",
|
||||
"@angular/core": "",
|
||||
"@angular/forms": "",
|
||||
"@angular/http": "",
|
||||
"@angular/platform-browser": "",
|
||||
"@angular/platform-browser-dynamic": "",
|
||||
"rxjs": "",
|
||||
"zone.js": ""
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Http } from '@angular/http';
|
||||
import 'rxjs/add/operator/map';
|
||||
|
||||
/*
|
||||
Generated class for the $CLASSNAME provider.
|
||||
@@ -11,7 +10,7 @@ import 'rxjs/add/operator/map';
|
||||
@Injectable()
|
||||
export class $CLASSNAME {
|
||||
|
||||
constructor(public http: Http) {
|
||||
constructor(public http: HttpClient) {
|
||||
console.log('Hello $CLASSNAME Provider');
|
||||
}
|
||||
|
||||
|
||||
@@ -110,9 +110,12 @@ $action-sheet-ios-button-cancel-font-weight: 600 !default;
|
||||
background: $action-sheet-ios-background;
|
||||
|
||||
// scss-lint:disable VendorPrefix
|
||||
-webkit-overflow-scrolling: touch;
|
||||
// TODO Removing this temporarily because it causes a flicker
|
||||
// when there are not enough elements to overflow
|
||||
// https://github.com/ionic-team/ionic/issues/13262
|
||||
// -webkit-overflow-scrolling: touch;
|
||||
// Prevents borders from going outside of the container
|
||||
-webkit-mask-image: -webkit-radial-gradient(circle, #fff, #000);
|
||||
// -webkit-mask-image: -webkit-radial-gradient(circle, #fff, #000);
|
||||
}
|
||||
|
||||
.action-sheet-ios .action-sheet-group:first-child {
|
||||
|
||||
@@ -106,10 +106,6 @@ $action-sheet-wp-icon-margin-bottom: 0 !default;
|
||||
$action-sheet-wp-icon-margin-start: 0 !default;
|
||||
|
||||
|
||||
.action-sheet-wp .action-sheet-wrapper {
|
||||
box-shadow: $action-sheet-wp-box-shadow;
|
||||
}
|
||||
|
||||
.action-sheet-wp .action-sheet-title {
|
||||
@include text-align($action-sheet-wp-title-text-align);
|
||||
|
||||
@@ -159,6 +155,8 @@ $action-sheet-wp-icon-margin-start: 0 !default;
|
||||
|
||||
.action-sheet-wp .action-sheet-group:first-child {
|
||||
@include padding($action-sheet-wp-padding-top, null, null, null);
|
||||
|
||||
box-shadow: $action-sheet-wp-box-shadow;
|
||||
}
|
||||
|
||||
.action-sheet-wp .action-sheet-group:last-child {
|
||||
|
||||
@@ -204,7 +204,7 @@ export class AlertCmp {
|
||||
// and ionViewDidEnter is not in the same callstack as the touch event :(
|
||||
const focusableEle = this._elementRef.nativeElement.querySelector('input,button');
|
||||
if (focusableEle) {
|
||||
focusableEle.focus();
|
||||
setTimeout(() => focusableEle.focus());
|
||||
}
|
||||
this.enabled = true;
|
||||
}
|
||||
|
||||
@@ -639,6 +639,10 @@ export class Content extends Ion implements OnDestroy, AfterViewInit, IContent {
|
||||
*/
|
||||
addScrollPadding(newPadding: number) {
|
||||
assert(typeof this._scrollPadding === 'number', '_scrollPadding must be a number');
|
||||
if (newPadding === 0) {
|
||||
this._inputPolling = false;
|
||||
this._scrollPadding = -1;
|
||||
}
|
||||
if (newPadding > this._scrollPadding) {
|
||||
console.debug(`content, addScrollPadding, newPadding: ${newPadding}, this._scrollPadding: ${this._scrollPadding}`);
|
||||
|
||||
@@ -663,13 +667,13 @@ export class Content extends Ion implements OnDestroy, AfterViewInit, IContent {
|
||||
|
||||
this._keyboard.onClose(() => {
|
||||
console.debug(`content, clearScrollPaddingFocusOut _keyboard.onClose`);
|
||||
this._inputPolling = false;
|
||||
this._scrollPadding = -1;
|
||||
this.addScrollPadding(0);
|
||||
}, 200, 3000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Tell the content to recalculate its dimensions. This should be called
|
||||
* after dynamically adding/removing headers, footers, or tabs.
|
||||
|
||||
@@ -8,7 +8,7 @@ import { PickerColumn } from '../picker/picker-options';
|
||||
import { Form } from '../../util/form';
|
||||
import { BaseInput } from '../../util/base-input';
|
||||
import { Item } from '../item/item';
|
||||
import { assert, clamp, deepCopy, isArray, isBlank, isObject, isPresent, isString } from '../../util/util';
|
||||
import { assert, clamp, isArray, isBlank, isObject, isPresent, isString } from '../../util/util';
|
||||
import {
|
||||
DateTimeData,
|
||||
LocaleData,
|
||||
@@ -522,20 +522,23 @@ export class DateTime extends BaseInput<DateTimeData> implements AfterContentIni
|
||||
|
||||
console.debug('datetime, open picker');
|
||||
|
||||
// the user may have assigned some options specifically for the alert
|
||||
const pickerOptions = deepCopy(this.pickerOptions);
|
||||
// the user may have assigned some options specifically for the picker
|
||||
const pickerOptions = {...this.pickerOptions};
|
||||
|
||||
// Configure picker under the hood
|
||||
const picker = this._picker = this._pickerCtrl.create(pickerOptions);
|
||||
picker.addButton({
|
||||
// Add a cancel and done button by default to the picker
|
||||
const defaultButtons = [{
|
||||
text: this.cancelText,
|
||||
role: 'cancel',
|
||||
handler: () => this.ionCancel.emit(this)
|
||||
});
|
||||
picker.addButton({
|
||||
}, {
|
||||
text: this.doneText,
|
||||
handler: (data: any) => this.value = data,
|
||||
});
|
||||
}];
|
||||
|
||||
pickerOptions.buttons = (pickerOptions.buttons || []).concat(defaultButtons);
|
||||
|
||||
// Configure picker under the hood
|
||||
const picker = this._picker = this._pickerCtrl.create(pickerOptions);
|
||||
|
||||
picker.ionChange.subscribe(() => {
|
||||
this.validate();
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
<ion-item>
|
||||
<ion-label>MM DD YY</ion-label>
|
||||
<ion-datetime pickerFormat="YYYY-MM-DDThh:mm" [(ngModel)]="placeholderDate" placeholder="Select Date"></ion-datetime>
|
||||
<ion-datetime pickerFormat="YYYY-MM-DDThh:mm" [pickerOptions]="customOptions" [(ngModel)]="placeholderDate" placeholder="Select Date"></ion-datetime>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
|
||||
@@ -31,6 +31,16 @@ export class RootPage {
|
||||
'l\u00f8r'
|
||||
];
|
||||
|
||||
customOptions: any = {
|
||||
buttons: [{
|
||||
text: 'Save',
|
||||
handler: () => console.log('Clicked Save!')
|
||||
}, {
|
||||
text: 'Log',
|
||||
handler: () => console.log('Clicked Log!')
|
||||
}]
|
||||
};
|
||||
|
||||
onChange(ev: any) {
|
||||
console.log('Changed', ev);
|
||||
}
|
||||
|
||||
@@ -727,7 +727,7 @@ describe('DateTime', () => {
|
||||
datetime._picker = picker = new Picker(mockApp(), null, mockConfig());
|
||||
});
|
||||
|
||||
console.warn = function(){};
|
||||
console.warn = function() {};
|
||||
|
||||
// pt-br
|
||||
var customLocale: datetimeUtil.LocaleData = {
|
||||
|
||||
@@ -284,19 +284,24 @@ export class TextInput extends BaseInput<string> implements IonicFormInput {
|
||||
return;
|
||||
}
|
||||
|
||||
const blurOnScroll = config.getBoolean('hideCaretOnScroll', false);
|
||||
if (blurOnScroll) {
|
||||
const hideCaretOnScroll = config.getBoolean('hideCaretOnScroll', false);
|
||||
if (hideCaretOnScroll) {
|
||||
this._enableHideCaretOnScroll();
|
||||
}
|
||||
|
||||
const resizeAssist = config.getBoolean('resizeAssist', false);
|
||||
if (resizeAssist) {
|
||||
this._keyboardHeight = 60;
|
||||
this._enableResizeAssist();
|
||||
const win = _plt.win() as any;
|
||||
const keyboardPlugin = win.Ionic && win.Ionic.keyboardPlugin;
|
||||
if (keyboardPlugin) {
|
||||
const keyboardResizes = config.getBoolean('keyboardResizes', false);
|
||||
if (keyboardResizes) {
|
||||
this._keyboardHeight = config.getNumber('keyboardSafeArea', 60);
|
||||
this._enableScrollMove();
|
||||
} else {
|
||||
this._enableScrollPadding();
|
||||
this._enableScrollMove();
|
||||
}
|
||||
|
||||
} else {
|
||||
this._useAssist = config.getBoolean('scrollAssist', false);
|
||||
|
||||
const usePadding = config.getBoolean('scrollPadding', this._useAssist);
|
||||
if (usePadding) {
|
||||
this._enableScrollPadding();
|
||||
@@ -528,9 +533,8 @@ export class TextInput extends BaseInput<string> implements IonicFormInput {
|
||||
|
||||
this.ionFocus.subscribe(() => {
|
||||
const content = this._content;
|
||||
|
||||
// add padding to the bottom of the scroll view (if needed)
|
||||
content.addScrollPadding(this._getScrollData().scrollPadding);
|
||||
const scrollPadding = this._getScrollData().scrollPadding;
|
||||
content.addScrollPadding(scrollPadding);
|
||||
content.clearScrollPaddingFocusOut();
|
||||
});
|
||||
}
|
||||
@@ -560,13 +564,13 @@ export class TextInput extends BaseInput<string> implements IonicFormInput {
|
||||
}
|
||||
}
|
||||
|
||||
_enableResizeAssist() {
|
||||
_enableScrollMove() {
|
||||
assert(this._content, 'content is undefined');
|
||||
|
||||
console.debug('Input: enableAutoScroll');
|
||||
this.ionFocus.subscribe(() => {
|
||||
const scrollData = this._getScrollData();
|
||||
if (Math.abs(scrollData.scrollAmount) > 100) {
|
||||
if (Math.abs(scrollData.scrollAmount) > 4) {
|
||||
this._content.scrollTo(0, scrollData.scrollTo, scrollData.scrollDuration);
|
||||
}
|
||||
});
|
||||
@@ -722,7 +726,8 @@ export function getScrollData(
|
||||
inputOffsetHeight: number,
|
||||
scrollViewDimensions: ContentDimensions,
|
||||
keyboardHeight: number,
|
||||
plaformHeight: number): ScrollData {
|
||||
plaformHeight: number
|
||||
): ScrollData {
|
||||
// compute input's Y values relative to the body
|
||||
const inputTop = (inputOffsetTop + scrollViewDimensions.contentTop - scrollViewDimensions.scrollTop);
|
||||
const inputBottom = (inputTop + inputOffsetHeight);
|
||||
@@ -753,6 +758,15 @@ export function getScrollData(
|
||||
|
||||
const scrollData: ScrollData = newScrollData();
|
||||
|
||||
// when auto-scrolling, there also needs to be enough
|
||||
// content padding at the bottom of the scroll view
|
||||
// always add scroll padding when a text input has focus
|
||||
// this allows for the content to scroll above of the keyboard
|
||||
// content behind the keyboard would be blank
|
||||
// some cases may not need it, but when jumping around it's best
|
||||
// to have the padding already rendered so there's no jank
|
||||
scrollData.scrollPadding = keyboardHeight;
|
||||
|
||||
if (inputTopWithinSafeArea && inputBottomWithinSafeArea) {
|
||||
// Input top within safe area, bottom within safe area
|
||||
// no need to scroll to a position, it's good as-is
|
||||
@@ -788,15 +802,6 @@ export function getScrollData(
|
||||
// figure out where it should scroll to for the best position to the input
|
||||
scrollData.scrollTo = (scrollViewDimensions.scrollTop - scrollData.scrollAmount);
|
||||
|
||||
// when auto-scrolling, there also needs to be enough
|
||||
// content padding at the bottom of the scroll view
|
||||
// always add scroll padding when a text input has focus
|
||||
// this allows for the content to scroll above of the keyboard
|
||||
// content behind the keyboard would be blank
|
||||
// some cases may not need it, but when jumping around it's best
|
||||
// to have the padding already rendered so there's no jank
|
||||
scrollData.scrollPadding = keyboardHeight;
|
||||
|
||||
// calculate animation duration
|
||||
const distance = Math.abs(scrollData.scrollAmount);
|
||||
const duration = distance / SCROLL_ASSIST_SPEED;
|
||||
|
||||
@@ -251,7 +251,7 @@ describe('Refresher', () => {
|
||||
type: 'mockTouch',
|
||||
pageX: 0,
|
||||
pageY: y,
|
||||
preventDefault: function(){}
|
||||
preventDefault: function() {}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ export function getTranslate(s: Slides, plt: Platform, el: HTMLElement, axis: st
|
||||
if (win.WebKitCSSMatrix) {
|
||||
curTransform = curStyle.transform || curStyle.webkitTransform;
|
||||
if (curTransform.split(',').length > 6) {
|
||||
curTransform = curTransform.split(', ').map(function(a: any){
|
||||
curTransform = curTransform.split(', ').map(function(a: any) {
|
||||
return a.replace(',', '.');
|
||||
}).join(', ');
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Component, NgModule, ViewChild } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { Http } from '@angular/http';
|
||||
|
||||
import { IonicApp, IonicModule, Slides } from '../../../..';
|
||||
|
||||
@@ -12,7 +12,7 @@ export class E2EPage {
|
||||
images: string[] = [];
|
||||
@ViewChild(Slides) slider: Slides;
|
||||
|
||||
constructor(private http: Http) {}
|
||||
constructor(private http: HttpClient) {}
|
||||
|
||||
ngAfterViewInit() {
|
||||
let tags = 'madison wisconsin';
|
||||
@@ -22,8 +22,8 @@ export class E2EPage {
|
||||
|
||||
this.http.get(baseUrl + '?method=flickr.groups.pools.getPhotos&group_id=1463451@N25&safe_search=1&api_key='
|
||||
+ FLICKR_API_KEY + '&nojsoncallback=1&format=json&tags=' + tags)
|
||||
.subscribe(data => {
|
||||
this.images = data.json().photos.photo.slice(0, 20);
|
||||
.subscribe((data: any) => {
|
||||
this.images = data.photos.photo.slice(0, 20);
|
||||
setTimeout(() => {
|
||||
this.slider.update();
|
||||
});
|
||||
|
||||
@@ -610,6 +610,11 @@ export class VirtualScroll implements DoCheck, OnChanges, AfterContentInit, OnDe
|
||||
return;
|
||||
}
|
||||
|
||||
// check if component is rendered in the dom currently
|
||||
if (this._elementRef.nativeElement.offsetParent === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
console.debug('virtual-scroll', 'resized window');
|
||||
this.calcDimensions();
|
||||
this.writeUpdate(false);
|
||||
|
||||
@@ -2,7 +2,7 @@ import { InjectionToken } from '@angular/core';
|
||||
|
||||
import { App } from '../components/app/app';
|
||||
import { NavigationContainer } from './navigation-container';
|
||||
import { DeepLinkConfig, DehydratedSegment, DehydratedSegmentPair, NavGroup, NavLink, NavSegment, isTabs } from './nav-util';
|
||||
import { DeepLinkConfig, DehydratedSegment, DehydratedSegmentPair, NavGroup, NavLink, NavSegment } from './nav-util';
|
||||
import { isArray, isBlank, isPresent } from '../util/util';
|
||||
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ $cordova-statusbar-padding-modal-max-width: 767px !default;
|
||||
|
||||
|
||||
@mixin footer-safe-area($toolbar-height, $toolbar-padding) {
|
||||
.tabs .tabbar {
|
||||
.tabs:not(.tabs-ios[tabsPlacement=top]) .tabbar {
|
||||
@include padding(null, null, constant(safe-area-inset-bottom), null);
|
||||
@include padding(null, null, env(safe-area-inset-bottom), null);
|
||||
}
|
||||
|
||||
@@ -27,9 +27,9 @@ export class Keyboard {
|
||||
|
||||
_tmr: number;
|
||||
|
||||
willShow = new EventEmitter<void>();
|
||||
willShow = new EventEmitter<number>();
|
||||
willHide = new EventEmitter<void>();
|
||||
didShow = new EventEmitter<void>();
|
||||
didShow = new EventEmitter<number>();
|
||||
didHide = new EventEmitter<void>();
|
||||
|
||||
eventsAvailable = false;
|
||||
@@ -43,7 +43,7 @@ export class Keyboard {
|
||||
this.focusOutline(config.get('focusOutline'));
|
||||
|
||||
const win = <any>_plt.win();
|
||||
if (config.getBoolean('keyboardResizes', false)) {
|
||||
if (win.Ionic && win.Ionic.keyboardPlugin) {
|
||||
this.listenV2(win);
|
||||
} else {
|
||||
this.listenV1(win);
|
||||
@@ -52,9 +52,9 @@ export class Keyboard {
|
||||
|
||||
private listenV2(win: any) {
|
||||
const platform = this._plt;
|
||||
platform.registerListener(win, 'keyboardWillShow', () => {
|
||||
platform.registerListener(win, 'keyboardWillShow', (ev: any) => {
|
||||
this._zone.run(() => {
|
||||
this.willShow.emit();
|
||||
this.willShow.emit(ev.keyboardHeight);
|
||||
});
|
||||
}, { zone: false, passive: true });
|
||||
|
||||
@@ -64,9 +64,9 @@ export class Keyboard {
|
||||
});
|
||||
}, { zone: false, passive: true });
|
||||
|
||||
platform.registerListener(win, 'keyboardDidShow', () => {
|
||||
platform.registerListener(win, 'keyboardDidShow', (ev: any) => {
|
||||
this._zone.run(() => {
|
||||
this.didShow.emit();
|
||||
this.didShow.emit(ev.keyboardHeight);
|
||||
});
|
||||
}, { zone: false, passive: true });
|
||||
|
||||
@@ -268,6 +268,18 @@ export class Keyboard {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set to true to hide the additional toolbar that is on top of the keyboard.
|
||||
* This toolbar features the Prev, Next, and Done buttons.
|
||||
* @param hidden
|
||||
*/
|
||||
hideFormAccessoryBar(hidden: boolean) {
|
||||
const win = this._plt.win() as any;
|
||||
if (win && win.Keyboard && win.Keyboard.hideFormAccessoryBar) {
|
||||
win.Keyboard.hideFormAccessoryBar(hidden);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -109,16 +109,15 @@ export const PLATFORM_CONFIGS: { [key: string]: PlatformConfig } = {
|
||||
hoverCSS: false,
|
||||
inputBlurring: isIos,
|
||||
inputCloning: isIos,
|
||||
keyboardHeight: 300,
|
||||
keyboardHeight: 250,
|
||||
mode: 'ios',
|
||||
scrollAssist: isIos,
|
||||
statusbarPadding: isCordova,
|
||||
swipeBackEnabled: isIos,
|
||||
tapPolyfill: isIosUIWebView,
|
||||
virtualScrollEventAssist: isIosUIWebView,
|
||||
disableScrollAssist: isIos,
|
||||
scrollAssist: isIos,
|
||||
keyboardResizes: keyboardResizes,
|
||||
resizeAssist: keyboardResizes,
|
||||
},
|
||||
isMatch(plt: Platform) {
|
||||
return plt.isPlatformMatch('ios', ['iphone', 'ipad', 'ipod'], ['windows phone']);
|
||||
|
||||
@@ -23,6 +23,7 @@ export class TapClick {
|
||||
private usePolyfill: boolean;
|
||||
private activator: ActivatorBase;
|
||||
private startCoord: any;
|
||||
private activatableEle: HTMLElement;
|
||||
private events: UIEventManager;
|
||||
private pointerEvents: PointerEvents;
|
||||
private lastTouchEnd: number;
|
||||
@@ -77,14 +78,14 @@ export class TapClick {
|
||||
return true;
|
||||
}
|
||||
|
||||
let activatableEle = getActivatableTarget(ev.target);
|
||||
if (!activatableEle) {
|
||||
this.activatableEle = getActivatableTarget(ev.target);
|
||||
if (!this.activatableEle) {
|
||||
this.startCoord = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
this.startCoord = pointerCoord(ev);
|
||||
this.activator && this.activator.downAction(ev, activatableEle, this.startCoord);
|
||||
this.activator && this.activator.downAction(ev, this.activatableEle, this.startCoord);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -103,7 +104,7 @@ export class TapClick {
|
||||
return;
|
||||
}
|
||||
if (this.activator && ev.target !== this.plt.doc()) {
|
||||
let activatableEle = getActivatableTarget(ev.target);
|
||||
let activatableEle = getActivatableTarget(ev.target) || this.activatableEle;
|
||||
if (activatableEle) {
|
||||
this.activator.upAction(ev, activatableEle, this.startCoord);
|
||||
}
|
||||
@@ -112,12 +113,14 @@ export class TapClick {
|
||||
this.handleTapPolyfill(ev);
|
||||
}
|
||||
this.startCoord = null;
|
||||
this.activatableEle = null;
|
||||
}
|
||||
|
||||
pointerCancel(ev: UIEvent) {
|
||||
console.debug(`pointerCancel from ${ev.type} ${Date.now()}`);
|
||||
|
||||
this.startCoord = null;
|
||||
this.activatableEle = null;
|
||||
this.dispatchClick = false;
|
||||
this.activator && this.activator.clearState(false);
|
||||
this.pointerEvents.stop();
|
||||
|
||||
@@ -42,7 +42,7 @@ import { ErrorHandler } from '@angular/core';
|
||||
*/
|
||||
export class IonicErrorHandler extends ErrorHandler {
|
||||
constructor() {
|
||||
super(false);
|
||||
super();
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
|
||||
@@ -27,10 +27,5 @@
|
||||
"buildOnSave": false,
|
||||
"atom": {
|
||||
"rewriteTsconfig": false
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"annotationsAs": "static fields",
|
||||
"annotateForClosureCompiler": true,
|
||||
"strictMetadataEmit": true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user