From 8c7bfc6da2f0ca9953650851c74b4bdeecd01cac Mon Sep 17 00:00:00 2001 From: mhartington Date: Tue, 2 Feb 2016 12:41:05 -0500 Subject: [PATCH 01/38] docs(pullToRefresh): update docs --- ionic/components/scroll/pull-to-refresh.ts | 122 +++++++++++++++++++-- 1 file changed, 111 insertions(+), 11 deletions(-) diff --git a/ionic/components/scroll/pull-to-refresh.ts b/ionic/components/scroll/pull-to-refresh.ts index 469ee8e0cb..a429d404cd 100644 --- a/ionic/components/scroll/pull-to-refresh.ts +++ b/ionic/components/scroll/pull-to-refresh.ts @@ -81,54 +81,154 @@ import {raf, ready, CSS} from '../../util/dom'; directives: [NgIf, NgClass, Icon] }) export class Refresher { - private ele: HTMLElement; + private _ele: HTMLElement; private _touchMoveListener; private _touchEndListener; private _handleScrollListener; + + /** + * @private + */ isActive: boolean; + + /** + * @private + */ isDragging: boolean = false; + + /** + * @private + */ isOverscrolling: boolean = false; + + /** + * @private + */ dragOffset: number = 0; + + /** + * @private + */ lastOverscroll: number = 0; + + /** + * @private + */ ptrThreshold: number = 0; + + /** + * @private + */ activated: boolean = false; + + /** + * @private + */ scrollTime: number = 500; + + /** + * @private + */ canOverscroll: boolean = true; + + /** + * @private + */ startY; + + /** + * @private + */ deltaY; + + /** + * @private + */ scrollHost; + + /** + * @private + */ scrollChild; + + /** + * @private + */ showIcon: boolean; + + /** + * @private + */ showSpinner: boolean; + + /** + * @private + */ isRefreshing: boolean; + + /** + * @private + */ isRefreshingTail: boolean; + + /** + * @private + */ @Input() pullingIcon: string; + + /** + * @private + */ @Input() pullingText: string; + + /** + * @private + */ @Input() refreshingIcon: string; + + /** + * @private + */ @Input() refreshingText: string; + + /** + * @private + */ @Input() spinner: string; + + /** + * @private + */ @Output() pulling: EventEmitter = new EventEmitter(); + + /** + * @private + */ @Output() refresh: EventEmitter = new EventEmitter(); + + /** + * @private + */ @Output() starting: EventEmitter = new EventEmitter(); constructor( - @Host() private content: Content, - element: ElementRef + @Host() private _content: Content, + _element: ElementRef ) { - this.ele = element.nativeElement; - this.ele.classList.add('content'); + this._ele = _element.nativeElement; + this._ele.classList.add('content'); } /** * @private */ ngOnInit() { - let sp = this.content.getNativeElement(); - let sc = this.content.scrollElement; + let sp = this._content.getNativeElement(); + let sc = this._content.scrollElement; this.startY = null; this.deltaY = null; @@ -156,7 +256,7 @@ export class Refresher { * @private */ ngOnDestroy() { - let sc = this.content.scrollElement; + let sc = this._content.scrollElement; sc.removeEventListener('touchmove', this._touchMoveListener); sc.removeEventListener('touchend', this._touchEndListener); sc.removeEventListener('scroll', this._handleScrollListener); @@ -245,7 +345,7 @@ export class Refresher { */ show() { // showCallback - this.ele.classList.remove('invisible'); + this._ele.classList.remove('invisible'); } /** @@ -253,7 +353,7 @@ export class Refresher { */ hide() { // showCallback - this.ele.classList.add('invisible'); + this._ele.classList.add('invisible'); } /** @@ -261,7 +361,7 @@ export class Refresher { */ tail() { // tailCallback - this.ele.classList.add('refreshing-tail'); + this._ele.classList.add('refreshing-tail'); } /** From 9ceb7f2fcc85b26c6dd3710145973e5ecd47c302 Mon Sep 17 00:00:00 2001 From: mhartington Date: Tue, 2 Feb 2016 13:13:41 -0500 Subject: [PATCH 02/38] docs(scroll): update docs --- ionic/components/scroll/scroll.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ionic/components/scroll/scroll.ts b/ionic/components/scroll/scroll.ts index 05e6656e99..9f22e9b6c5 100644 --- a/ionic/components/scroll/scroll.ts +++ b/ionic/components/scroll/scroll.ts @@ -45,8 +45,17 @@ import * as util from '../../util'; '' }) export class Scroll extends Ion { + /** + * @private + */ private maxScale: number = 3; + /** + * @private + */ private zoomDuration: number = 250; + /** + * @private + */ private scrollElement: HTMLElement; constructor(elementRef: ElementRef) { From 7f068a25ece5f0f56969c4f2920279232872de62 Mon Sep 17 00:00:00 2001 From: mhartington Date: Tue, 2 Feb 2016 13:15:09 -0500 Subject: [PATCH 03/38] docs(searchbar): update docs --- ionic/components/searchbar/searchbar.ts | 30 +++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/ionic/components/searchbar/searchbar.ts b/ionic/components/searchbar/searchbar.ts index 8d55f724b1..6db1911909 100644 --- a/ionic/components/searchbar/searchbar.ts +++ b/ionic/components/searchbar/searchbar.ts @@ -72,6 +72,9 @@ export class SearchbarInput { directives: [FORM_DIRECTIVES, NgIf, NgClass, Icon, Button, SearchbarInput] }) export class Searchbar extends Ion { + /** + * @private + */ @ViewChild(SearchbarInput) searchbarInput; /** @@ -112,13 +115,40 @@ export class Searchbar extends Ion { */ @Output() clear: EventEmitter = new EventEmitter(); + /** + * @private + */ value: string = ''; + + /** + * @private + */ blurInput: boolean = true; + + /** + * @private + */ inputElement: any; + + /** + * @private + */ searchIconElement: any; + + /** + * @private + */ mode: string; + + /** + * @private + */ @HostBinding('class.searchbar-focused') isFocused; + + /** + * @private + */ @HostBinding('class.searchbar-left-aligned') shouldLeftAlign; constructor( From ed027fa951594f4e5c1d6b531c9def3302d4f92c Mon Sep 17 00:00:00 2001 From: mhartington Date: Tue, 2 Feb 2016 13:36:53 -0500 Subject: [PATCH 04/38] docs(segment): update docs --- ionic/components/segment/segment.ts | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/ionic/components/segment/segment.ts b/ionic/components/segment/segment.ts index 8f503c856a..eb5d297dbc 100644 --- a/ionic/components/segment/segment.ts +++ b/ionic/components/segment/segment.ts @@ -8,7 +8,6 @@ import {isDefined} from '../../util/util'; * @name SegmentButton * @description * The child buttons of the `ion-segment` component. Each `ion-segment-button` must have a value. - * @property {string} [value] - the value of the segment-button. Required. * @usage * ```html * @@ -39,7 +38,9 @@ import {isDefined} from '../../util/util'; * * ``` * + * @property {string} [value] - the value of the segment-button. Required. * @property {Any} [click] - expression to evaluate when a segment button has been clicked + * @property {Any} (select) - expression to evaluate when a segment selection has been changed * * @demo /docs/v2/demos/segment/ * @see {@link /docs/v2/components#segment Segment Component Docs} @@ -54,7 +55,15 @@ import {isDefined} from '../../util/util'; } }) export class SegmentButton { + + /** + * @private + */ @Input() value: string; + + /** + * @private + */ @Output() select: EventEmitter = new EventEmitter(); constructor(private _renderer: Renderer, private _elementRef: ElementRef) {} @@ -137,10 +146,22 @@ export class SegmentButton { selector: 'ion-segment' }) export class Segment { + + /** + * @private + */ value: string; + + /** + * @private + */ @Output() change: EventEmitter = new EventEmitter(); + + /** + * @private + */ @ContentChildren(SegmentButton) _buttons: QueryList; constructor(@Optional() ngControl: NgControl) { From ba659a760674ed7e76c7a3d52c929df4e54c6790 Mon Sep 17 00:00:00 2001 From: Perry Govier Date: Tue, 2 Feb 2016 12:37:30 -0600 Subject: [PATCH 05/38] docs(demos): document how to deploy API demos --- scripts/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/README.md b/scripts/README.md index 1a629243c2..0734dd2cfa 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -68,4 +68,6 @@ See [ionic-preview-app](https://github.com/driftyco/ionic-preview-app#updating-ionic-site) ### Releasing API Demos -TODO +Ionic API demos are automatically compiled and deployed to the [ionic staging site](http://ionic-site-staging.herokuapp.com/) on every commit. No action is necessary. + +If you'd like to manually update the demos, clone the [`ionic-site`](https://github.com/driftyco/ionic-site) repo as a sibling of `ionic`. From `ionic` run gulp docs, and it'll compile and copy the demos to the `ionic-site` repo, ready for testing or committing. From ab01be765d0e3550dba84458e72e5ec76496150f Mon Sep 17 00:00:00 2001 From: Perry Govier Date: Tue, 2 Feb 2016 12:46:04 -0600 Subject: [PATCH 06/38] docs(demos): copy explanation of how to update component demos on ionic-site --- scripts/README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/README.md b/scripts/README.md index 0734dd2cfa..336b685b23 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -65,7 +65,14 @@ 6. Sit back and have a beer :beer: (or wine :wine_glass:) ### Releasing Component Demos -See [ionic-preview-app](https://github.com/driftyco/ionic-preview-app#updating-ionic-site) + +(Copied from [ionic-preview-app](https://github.com/driftyco/ionic-preview-app#updating-ionic-site), check there for updates) + +- Set [production mode](https://github.com/driftyco/ionic-preview-app/blob/master/app/app.ts#L11) to true +- Rebuild app +- Copy the contents of this entire repo to `ionic-site/dist/preview-app/` (`cp -R * ../path/to/ionic-site/dist/preview-app/`) + + ### Releasing API Demos Ionic API demos are automatically compiled and deployed to the [ionic staging site](http://ionic-site-staging.herokuapp.com/) on every commit. No action is necessary. From 0fb297fe344c3cb51de187f264ae8a00e8e20fd5 Mon Sep 17 00:00:00 2001 From: mhartington Date: Tue, 2 Feb 2016 14:16:16 -0500 Subject: [PATCH 07/38] docs(select): update docs --- ionic/components/select/select.ts | 52 ++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/ionic/components/select/select.ts b/ionic/components/select/select.ts index 2d4efb199c..272147659b 100644 --- a/ionic/components/select/select.ts +++ b/ionic/components/select/select.ts @@ -92,7 +92,13 @@ import {Option} from '../option/option'; * subTitle: 'Select your toppings' * }; * ``` - * + * @property [cancelText] - The text of the cancel button. Defatuls to 'cancel' + * @property [okText] - The text of the ok button. Defatuls to 'OK' + * @property [alertOptions] - Any addition options that an alert can take. Title, Subtitle, etc. + * @property [multiple] - Whether or not the select component can accept multipl selections + * @property [disabled] - Whether or not the select component is disabled or not + * @property (change) - Any expression you want to evaluate when the selection has changed + */ @Component({ selector: 'ion-select', @@ -125,11 +131,29 @@ export class Select { */ id: string; + /** + * @private + */ @Input() cancelText: string = 'Cancel'; + + /** + * @private + */ @Input() okText: string = 'OK'; + + /** + * @private + */ @Input() alertOptions: any = {}; + + /** + * @private + */ @Input() checked: any = false; + /** + * @private + */ @Output() change: EventEmitter = new EventEmitter(); constructor( @@ -215,6 +239,10 @@ export class Select { this._nav.present(alert, alertOptions); } + + /** + * @private + */ @Input() get multiple() { return this._multi; @@ -224,6 +252,10 @@ export class Select { this._multi = isTrueProperty(val); } + + /** + * @private + */ @Input() get value(): any { return (this._multi ? this._values : this._values.join()); @@ -235,10 +267,17 @@ export class Select { this.updateOptions(); } + + /** + * @private + */ get text() { return (this._multi ? this._texts : this._texts.join()); } + /** + * @private + */ @ContentChildren(Option) private set options(val: QueryList