mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
chore(): make members private
This commit is contained in:
@ -39,10 +39,16 @@ export class IdRef {
|
||||
this.component = appViewManager.getComponent(elementRef);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
onInit() {
|
||||
this.app.register(this.id, this.component);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
onDestroy() {
|
||||
this.app.unregister(this.id);
|
||||
}
|
||||
@ -55,6 +61,10 @@ export class IdRef {
|
||||
})
|
||||
export class Attr {
|
||||
constructor(private renderer: Renderer, private elementRef: ElementRef) {}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
onInit() {
|
||||
this.renderer.setElementAttribute(this.elementRef, this.attr, '');
|
||||
}
|
||||
|
@ -61,9 +61,6 @@ export class Checkbox {
|
||||
if (ngControl) ngControl.valueAccessor = this;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*/
|
||||
onInit() {
|
||||
this.labelId = 'label-' + this.inputId;
|
||||
}
|
||||
@ -78,6 +75,7 @@ export class Checkbox {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* Click event handler to toggle the checkbox checked state.
|
||||
* @param {MouseEvent} ev The click event.
|
||||
*/
|
||||
@ -114,6 +112,9 @@ export class Checkbox {
|
||||
*/
|
||||
registerOnTouched(fn) { this.onTouched = fn; }
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
onDestroy() {
|
||||
this.form.deregister(this);
|
||||
}
|
||||
|
@ -47,7 +47,6 @@ export class Content extends Ion {
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO
|
||||
* @private
|
||||
*/
|
||||
onInit() {
|
||||
@ -132,6 +131,7 @@ export class Content extends Ion {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* Returns the content and scroll elements' dimensions.
|
||||
* @returns {Object} dimensions The content and scroll elements' dimensions
|
||||
* {Number} dimensions.contentHeight content offsetHeight
|
||||
@ -146,7 +146,6 @@ export class Content extends Ion {
|
||||
* {Number} dimensions.scrollWidth scroll scrollWidth
|
||||
* {Number} dimensions.scrollLeft scroll scrollLeft
|
||||
* {Number} dimensions.scrollRight scroll scrollLeft + scrollWidth
|
||||
* TODO: figure out how to get this to work
|
||||
*/
|
||||
getDimensions() {
|
||||
let scrollElement = this.scrollElement;
|
||||
|
@ -22,14 +22,15 @@ export class Icon {
|
||||
config: Config,
|
||||
private renderer: Renderer
|
||||
) {
|
||||
this.eleRef = elementRef;
|
||||
this.config = config;
|
||||
|
||||
this.mode = config.get('iconMode');
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
onInit() {
|
||||
let ele = this.eleRef.nativeElement;
|
||||
let ele = this.elementRef.nativeElement;
|
||||
|
||||
if (this.mode == 'ios' && this.ios) {
|
||||
this.name = this.ios;
|
||||
@ -59,15 +60,24 @@ export class Icon {
|
||||
this.update();
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
get isActive() {
|
||||
return (this._isActive === undefined || this._isActive === true || this._isActive === 'true');
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
set isActive(val) {
|
||||
this._isActive = val;
|
||||
this.update();
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
update() {
|
||||
if (this.name && this.mode == 'ios') {
|
||||
|
||||
|
@ -4,7 +4,6 @@ import {List} from '../list/list';
|
||||
|
||||
|
||||
/**
|
||||
* @name ionItem
|
||||
* @description
|
||||
* Creates a list-item that can easily be swiped,
|
||||
* deleted, reordered, edited, and more.
|
||||
|
@ -35,6 +35,9 @@ export class List extends Ion {
|
||||
this.ele = elementRef.nativeElement;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
onInit() {
|
||||
super.onInit();
|
||||
|
||||
@ -46,6 +49,9 @@ export class List extends Ion {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
onDestroy() {
|
||||
this.ele = null;
|
||||
this.slidingGesture && this.slidingGesture.unlisten();
|
||||
@ -53,7 +59,6 @@ export class List extends Ion {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* TODO
|
||||
*/
|
||||
_initVirtualScrolling() {
|
||||
if(!this.content) {
|
||||
@ -64,8 +69,7 @@ export class List extends Ion {
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO
|
||||
* @param {TODO} item TODO
|
||||
* @private
|
||||
*/
|
||||
setItemTemplate(item) {
|
||||
this.itemTemplate = item;
|
||||
@ -92,6 +96,9 @@ export class List extends Ion {
|
||||
this.slidingGesture && this.slidingGesture.closeOpened();
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
afterViewInit() {
|
||||
this._init = true;
|
||||
if (this._enableSliding) {
|
||||
@ -100,9 +107,7 @@ export class List extends Ion {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*/
|
||||
|
||||
@Directive({
|
||||
selector: 'ion-header',
|
||||
inputs: [
|
||||
|
@ -123,6 +123,9 @@ export class Menu extends Ion {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
_initGesture() {
|
||||
switch(this.side) {
|
||||
case 'right':
|
||||
@ -136,6 +139,9 @@ export class Menu extends Ion {
|
||||
this._targetGesture = new gestures.TargetGesture(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
_initType(type) {
|
||||
type = type && type.trim().toLowerCase();
|
||||
if (!type) {
|
||||
@ -170,6 +176,9 @@ export class Menu extends Ion {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
setProgressStart() {
|
||||
// user started swiping the menu open/close
|
||||
if (this._isPrevented() || !this.isEnabled) return;
|
||||
@ -179,6 +188,9 @@ export class Menu extends Ion {
|
||||
this._type.setProgressStart(this.isOpen);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
setProgess(value) {
|
||||
// user actively dragging the menu
|
||||
if (this.isEnabled) {
|
||||
@ -188,6 +200,9 @@ export class Menu extends Ion {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
setProgressEnd(shouldComplete) {
|
||||
// user has finished dragging the menu
|
||||
if (this.isEnabled) {
|
||||
@ -199,6 +214,9 @@ export class Menu extends Ion {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
_before() {
|
||||
// this places the menu into the correct location before it animates in
|
||||
// this css class doesn't actually kick off any animations
|
||||
@ -212,6 +230,9 @@ export class Menu extends Ion {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
_after(isOpen) {
|
||||
// keep opening/closing the menu disabled for a touch more yet
|
||||
if (this.isEnabled) {
|
||||
@ -233,12 +254,18 @@ export class Menu extends Ion {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
_prevent() {
|
||||
// used to prevent unwanted opening/closing after swiping open/close
|
||||
// or swiping open the menu while pressing down on the menu-toggle
|
||||
this._preventTime = Date.now() + 20;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
_isPrevented() {
|
||||
return this._preventTime > Date.now();
|
||||
}
|
||||
@ -267,29 +294,29 @@ export class Menu extends Ion {
|
||||
return this.setOpen(!this.isOpen);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
enable(shouldEnable) {
|
||||
this.isEnabled = shouldEnable;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO
|
||||
* @return {Element} The Menu element.
|
||||
* @private
|
||||
*/
|
||||
getMenuElement() {
|
||||
return this.getNativeElement();
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO
|
||||
* @return {Element} The Menu's associated content element.
|
||||
* @private
|
||||
*/
|
||||
getContentElement() {
|
||||
return this._cntEle;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO
|
||||
* @return {Element} The Menu's backdrop element.
|
||||
* @private
|
||||
*/
|
||||
getBackdropElement() {
|
||||
return this.backdrop.elementRef.nativeElement;
|
||||
@ -299,6 +326,9 @@ export class Menu extends Ion {
|
||||
menuTypes[name] = cls;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
onDestroy() {
|
||||
this.app.unregister(this.id);
|
||||
this._gesture && this._gesture.destroy();
|
||||
@ -312,9 +342,6 @@ export class Menu extends Ion {
|
||||
let menuTypes = {};
|
||||
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*/
|
||||
@Directive({
|
||||
selector: 'backdrop',
|
||||
host: {
|
||||
@ -322,10 +349,7 @@ let menuTypes = {};
|
||||
}
|
||||
})
|
||||
class MenuBackdrop {
|
||||
/**
|
||||
* TODO
|
||||
* @param {Menu} menu TODO
|
||||
*/
|
||||
|
||||
constructor(@Host() menu: Menu, elementRef: ElementRef) {
|
||||
this.menu = menu;
|
||||
this.elementRef = elementRef;
|
||||
@ -333,8 +357,7 @@ class MenuBackdrop {
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO
|
||||
* @param {TODO} event TODO
|
||||
* @private
|
||||
*/
|
||||
clicked(ev) {
|
||||
console.debug('backdrop clicked')
|
||||
|
@ -130,6 +130,9 @@ export class Nav extends NavController {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
onInit() {
|
||||
super.onInit();
|
||||
|
||||
|
@ -88,6 +88,7 @@ class ToolbarBackground {
|
||||
directives: [BackButton, BackButtonText, Icon, ToolbarBackground]
|
||||
})
|
||||
export class Navbar extends ToolbarBase {
|
||||
|
||||
constructor(
|
||||
app: IonicApp,
|
||||
@Optional() viewCtrl: ViewController,
|
||||
@ -110,6 +111,9 @@ export class Navbar extends ToolbarBase {
|
||||
this.bbDefault = config.get('backButtonText');
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
onInit() {
|
||||
super.onInit();
|
||||
let hideBackButton = this.hideBackButton;
|
||||
@ -122,34 +126,58 @@ export class Navbar extends ToolbarBase {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
getBackButtonRef() {
|
||||
return this.bbRef;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
setBackButtonRef(backButtonElementRef) {
|
||||
this.bbRef = backButtonElementRef;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
getBackButtonTextRef() {
|
||||
return this.bbtRef;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
setBackButtonTextRef(backButtonTextElementRef) {
|
||||
this.bbtRef = backButtonTextElementRef;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
setBackgroundRef(backgrouneElementRef) {
|
||||
this.bgRef = backgrouneElementRef;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
getBackgroundRef() {
|
||||
return this.bgRef;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
didEnter() {
|
||||
this.app.setTitle(this.getTitleText());
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
setHidden(isHidden) {
|
||||
this._hidden = isHidden
|
||||
}
|
||||
@ -157,10 +185,11 @@ export class Navbar extends ToolbarBase {
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Used to find and register headers in a view, and this directive's
|
||||
content will be moved up to the common navbar location, and created
|
||||
using the same context as the view's content area.
|
||||
/**
|
||||
* @private
|
||||
* Used to find and register headers in a view, and this directive's
|
||||
* content will be moved up to the common navbar location, and created
|
||||
* using the same context as the view's content area.
|
||||
*/
|
||||
@Directive({
|
||||
selector: 'template[navbar]'
|
||||
|
@ -3,6 +3,9 @@ import {Component, ElementRef, DynamicComponentLoader} from 'angular2/angular2';
|
||||
import {OverlayController} from './overlay-controller';
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
@Component({
|
||||
selector: 'ion-overlay',
|
||||
template: '<template #contents></template>'
|
||||
|
@ -41,7 +41,6 @@ import {ListHeader} from '../list/list';
|
||||
* </ion-radio-group>
|
||||
* ```
|
||||
*/
|
||||
|
||||
@Directive({
|
||||
selector: 'ion-radio-group',
|
||||
host: {
|
||||
@ -54,13 +53,6 @@ import {ListHeader} from '../list/list';
|
||||
export class RadioGroup extends Ion {
|
||||
radios: Array<RadioButton> = [];
|
||||
|
||||
/**
|
||||
* TODO
|
||||
* @param {ElementRef} elementRef TODO
|
||||
* @param {Config} config TODO
|
||||
* @param {NgControl=} ngControl TODO
|
||||
* @param {QueryList<ListHeader>} headerQuery TODO
|
||||
*/
|
||||
constructor(
|
||||
elementRef: ElementRef,
|
||||
config: Config,
|
||||
@ -77,6 +69,9 @@ export class RadioGroup extends Ion {
|
||||
if (ngControl) ngControl.valueAccessor = this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
onInit() {
|
||||
let header = this.headerQuery.first;
|
||||
if (header) {
|
||||
@ -88,6 +83,7 @@ export class RadioGroup extends Ion {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* Register the specified radio button with the radio group.
|
||||
* @param {RadioButton} radio The radio button to register.
|
||||
*/
|
||||
@ -102,6 +98,7 @@ export class RadioGroup extends Ion {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* Update which radio button in the group is checked, unchecking all others.
|
||||
* @param {RadioButton} checkedRadio The radio button to check.
|
||||
*/
|
||||
@ -147,8 +144,8 @@ export class RadioGroup extends Ion {
|
||||
registerOnTouched(fn) { this.onTouched = fn; }
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @name ionRadio
|
||||
* @description
|
||||
* A single radio component.
|
||||
*
|
||||
@ -192,12 +189,7 @@ export class RadioGroup extends Ion {
|
||||
'</div>'
|
||||
})
|
||||
export class RadioButton extends Ion {
|
||||
/**
|
||||
* Radio button constructor.
|
||||
* @param {RadioGroup=} group The parent radio group, if any.
|
||||
* @param {ElementRef} elementRef TODO
|
||||
* @param {Config} config TODO
|
||||
*/
|
||||
|
||||
constructor(
|
||||
@Host() @Optional() group: RadioGroup,
|
||||
elementRef: ElementRef,
|
||||
@ -209,12 +201,18 @@ export class RadioButton extends Ion {
|
||||
this.tabIndex = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
onInit() {
|
||||
super.onInit();
|
||||
this.group.registerRadio(this);
|
||||
this.labelId = 'label-' + this.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
click(ev) {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
|
@ -29,11 +29,7 @@ import * as util from 'ionic/util';
|
||||
'</scroll-content>'
|
||||
})
|
||||
export class Scroll extends Ion {
|
||||
/**
|
||||
* TODO
|
||||
* @param {ElementRef} elementRef TODO
|
||||
* @param {Config} config TODO
|
||||
*/
|
||||
|
||||
constructor(elementRef: ElementRef, Config: Config) {
|
||||
super(elementRef, Config);
|
||||
|
||||
@ -41,6 +37,9 @@ export class Scroll extends Ion {
|
||||
this.zoomDuration = 250;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
onInit() {
|
||||
this.scrollElement = this.getNativeElement().children[0];
|
||||
}
|
||||
@ -60,4 +59,5 @@ export class Scroll extends Ion {
|
||||
this.scrollElement.removeEventListener('scroll', handler);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -6,7 +6,6 @@ import {ConfigComponent} from '../../config/decorators';
|
||||
import {Icon} from '../icon/icon';
|
||||
|
||||
/**
|
||||
* @name Search Bar
|
||||
* @description
|
||||
* The Search Bar service adds an input field which can be used to search or filter items.
|
||||
*
|
||||
@ -42,14 +41,12 @@ import {Icon} from '../icon/icon';
|
||||
'<button *ng-if="showCancel" (click)="cancelAction($event, query)" class="searchbar-cancel">{{cancelText}}</button>',
|
||||
directives: [FORM_DIRECTIVES, NgIf, NgClass, Icon]
|
||||
})
|
||||
|
||||
export class SearchBar extends Ion {
|
||||
query: string;
|
||||
/**
|
||||
* TODO
|
||||
* @param {ElementRef} elementRef TODO
|
||||
* @param {Config} config TODO
|
||||
* @private
|
||||
*/
|
||||
query: string;
|
||||
|
||||
constructor(
|
||||
elementRef: ElementRef,
|
||||
config: Config,
|
||||
@ -68,7 +65,9 @@ export class SearchBar extends Ion {
|
||||
this.ngControl.valueAccessor = this;
|
||||
}
|
||||
|
||||
// Add the margin for iOS
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
afterViewInit() {
|
||||
this.cancelButton = this.elementRef.nativeElement.querySelector('.searchbar-cancel');
|
||||
|
||||
@ -83,6 +82,7 @@ export class SearchBar extends Ion {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* Much like ngModel, this is called from our valueAccessor for the attached
|
||||
* ControlDirective to update the value internally.
|
||||
*/
|
||||
@ -90,19 +90,31 @@ export class SearchBar extends Ion {
|
||||
this.query = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
registerOnChange(fn) {
|
||||
this.onChange = fn;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
registerOnTouched(fn) {
|
||||
this.onTouched = fn;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
inputChanged(event) {
|
||||
this.writeValue(event.target.value);
|
||||
this.onChange(event.target.value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
inputFocused() {
|
||||
this.isFocused = true;
|
||||
this.shouldLeftAlign = true;
|
||||
@ -112,6 +124,9 @@ export class SearchBar extends Ion {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
inputBlurred() {
|
||||
this.isFocused = false;
|
||||
this.shouldLeftAlign = this.ngControl.value && this.ngControl.value.trim() != '';
|
||||
@ -126,25 +141,3 @@ export class SearchBar extends Ion {
|
||||
this.onChange('');
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
export class SearchPipe extends Pipe {
|
||||
constructor() {
|
||||
super();
|
||||
this.state = 0;
|
||||
}
|
||||
|
||||
supports(newValue) {
|
||||
return true;
|
||||
}
|
||||
|
||||
transform(value, ...args) {
|
||||
return value;
|
||||
//return `${value} state:${this.state ++}`;
|
||||
}
|
||||
|
||||
create(cdRef) {
|
||||
return new SearchPipe(cdRef);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
@ -3,8 +3,8 @@ import {Directive, Renderer, ElementRef, Host, Optional, NgControl} from 'angula
|
||||
import {Ion} from '../ion';
|
||||
import {Config} from '../../config/config';
|
||||
|
||||
|
||||
/**
|
||||
* @name Segment
|
||||
* @description
|
||||
* A Segment is a group of buttons, sometimes known as Segmented Controls, that allow the user to interact with a compact group of a number of controls.
|
||||
*
|
||||
@ -41,14 +41,11 @@ import {Config} from '../../config/config';
|
||||
selector: 'ion-segment'
|
||||
})
|
||||
export class Segment extends Ion {
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
buttons: Array<SegmentButton> = [];
|
||||
|
||||
/**
|
||||
* TODO
|
||||
* @param {NgControl} ngControl TODO
|
||||
* @param {ElementRef} elementRef TODO
|
||||
* @param {Config} config TODO
|
||||
*/
|
||||
constructor(
|
||||
@Optional() ngControl: NgControl,
|
||||
elementRef: ElementRef,
|
||||
@ -62,15 +59,25 @@ export class Segment extends Ion {
|
||||
if (ngControl) ngControl.valueAccessor = this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
writeValue(value) {
|
||||
this.value = !value ? '' : value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
registerOnChange(fn) { this.onChange = fn; }
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
registerOnTouched(fn) { this.onTouched = fn; }
|
||||
|
||||
/**
|
||||
* @private
|
||||
* Called by child SegmentButtons to bind themselves to
|
||||
* the Segment.
|
||||
* @param {SegmentButton} segmentButton The child SegmentButton to register.
|
||||
@ -86,6 +93,7 @@ export class Segment extends Ion {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* Select the button with the given value.
|
||||
* @param {string} value Value of the button to select.
|
||||
*/
|
||||
@ -101,6 +109,7 @@ export class Segment extends Ion {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* Indicate a button should be selected.
|
||||
* @param {SegmentButton} segmentButton The button to select.
|
||||
*/
|
||||
@ -115,9 +124,7 @@ export class Segment extends Ion {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*/
|
||||
|
||||
@Directive({
|
||||
selector: 'ion-segment-button',
|
||||
inputs: [
|
||||
@ -129,11 +136,7 @@ export class Segment extends Ion {
|
||||
}
|
||||
})
|
||||
export class SegmentButton {
|
||||
/**
|
||||
* TODO
|
||||
* @param {Segment} segment TODO
|
||||
* @param {ElementRef} elementRef TODO
|
||||
*/
|
||||
|
||||
constructor(
|
||||
@Host() segment: Segment,
|
||||
elementRef: ElementRef,
|
||||
@ -145,10 +148,16 @@ export class SegmentButton {
|
||||
renderer.setElementAttribute(elementRef, 'outline', '');
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
onInit() {
|
||||
this.segment.register(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
click(event) {
|
||||
this.segment.selected(this, event);
|
||||
}
|
||||
|
@ -61,11 +61,7 @@ class DisplayWhen {
|
||||
}
|
||||
})
|
||||
export class ShowWhen extends DisplayWhen {
|
||||
/**
|
||||
* TODO
|
||||
* @param {string} showWhen The value of the element's 'show-when' attribute
|
||||
* @param {NgZone} ngZone TODO
|
||||
*/
|
||||
|
||||
constructor(
|
||||
@Attribute('show-when') showWhen: string,
|
||||
platform: Platform,
|
||||
@ -74,6 +70,9 @@ export class ShowWhen extends DisplayWhen {
|
||||
super(showWhen, platform, ngZone);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
get hidden() {
|
||||
return !this.isMatch;
|
||||
}
|
||||
@ -90,11 +89,7 @@ export class ShowWhen extends DisplayWhen {
|
||||
}
|
||||
})
|
||||
export class HideWhen extends DisplayWhen {
|
||||
/**
|
||||
* TODO
|
||||
* @param {string} showWhen The value of the element's 'hide-when' attribute
|
||||
* @param {NgZone} ngZone TODO
|
||||
*/
|
||||
|
||||
constructor(
|
||||
@Attribute('hide-when') hideWhen: string,
|
||||
platform: Platform,
|
||||
@ -103,6 +98,9 @@ export class HideWhen extends DisplayWhen {
|
||||
super(hideWhen, platform, ngZone);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
get hidden() {
|
||||
return this.isMatch;
|
||||
}
|
||||
|
@ -4,8 +4,8 @@ import {Form} from '../../util/form';
|
||||
import {Config} from '../../config/config';
|
||||
import {pointerCoord} from '../../util/dom';
|
||||
|
||||
|
||||
/**
|
||||
* @name mediaSwitch
|
||||
* @private
|
||||
*/
|
||||
@Directive({
|
||||
@ -99,12 +99,7 @@ class MediaSwitch {
|
||||
directives: [MediaSwitch]
|
||||
})
|
||||
export class Switch {
|
||||
/**
|
||||
* TODO
|
||||
* @param {ElementRef} elementRef TODO
|
||||
* @param {Config} config TODO
|
||||
* @param {NgControl=} ngControl TODO
|
||||
*/
|
||||
|
||||
constructor(
|
||||
form: Form,
|
||||
elementRef: ElementRef,
|
||||
@ -157,6 +152,9 @@ export class Switch {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
onInit() {
|
||||
this.labelId = 'label-' + this.inputId;
|
||||
}
|
||||
@ -177,10 +175,16 @@ export class Switch {
|
||||
this.check(!this.checked);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
writeValue(value) {
|
||||
this.checked = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
pointerDown(ev) {
|
||||
if (/touch/.test(ev.type)) {
|
||||
this.lastTouch = Date.now();
|
||||
@ -196,6 +200,9 @@ export class Switch {
|
||||
this.isActivated = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
pointerUp(ev) {
|
||||
if (this.isDisabled(ev)) return;
|
||||
|
||||
@ -213,18 +220,28 @@ export class Switch {
|
||||
this.isActivated = false;
|
||||
}
|
||||
|
||||
// Used by the view to update the model (Control)
|
||||
// Up to us to call it in update()
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
registerOnChange(fn) { this.onChange = fn; }
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
registerOnTouched(fn) { this.onTouched = fn; }
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
onDestroy() {
|
||||
this.removeMoveListener();
|
||||
this.switchEle = this.addMoveListener = this.removeMoveListener = null;
|
||||
this.form.deregister(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
isDisabled(ev) {
|
||||
return (this.lastTouch + 999 > Date.now() && /mouse/.test(ev.type)) || (this.mode == 'ios' && ev.target.tagName == 'ION-SWITCH');
|
||||
}
|
||||
|
@ -85,6 +85,9 @@ export class Tab extends NavController {
|
||||
this._isInitial = tabs.add(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
onInit() {
|
||||
if (this._isInitial) {
|
||||
this.tabs.select(this);
|
||||
@ -104,6 +107,9 @@ export class Tab extends NavController {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
load(opts, done) {
|
||||
if (!this._loaded && this.root) {
|
||||
this.push(this.root, null, opts).then(done);
|
||||
@ -114,6 +120,9 @@ export class Tab extends NavController {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
loadPage(viewCtrl, navbarContainerRef, done) {
|
||||
// by default a page's navbar goes into the shared tab's navbar section
|
||||
navbarContainerRef = this.tabs.navbarContainerRef;
|
||||
@ -138,6 +147,9 @@ export class Tab extends NavController {
|
||||
this.hideNavbars(!isSelected);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
hideNavbars(shouldHideNavbars) {
|
||||
this._views.forEach(viewCtrl => {
|
||||
let navbar = viewCtrl.getNavbar();
|
||||
|
@ -134,6 +134,9 @@ export class Tabs extends Ion {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
onInit() {
|
||||
super.onInit();
|
||||
if (this.highlight) {
|
||||
|
@ -16,6 +16,9 @@ let win = null;
|
||||
let doc = null;
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export function initTapClick(windowInstance, documentInstance, appInstance, config, fastdom) {
|
||||
win = windowInstance;
|
||||
doc = documentInstance;
|
||||
@ -185,6 +188,9 @@ function getActivatableTarget(ele) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export function isActivatable(ele) {
|
||||
if (ACTIVATABLE_ELEMENTS.test(ele.tagName)) {
|
||||
return true;
|
||||
|
@ -4,9 +4,7 @@ import {Config} from '../../config/config';
|
||||
import {TextInput} from './text-input';
|
||||
import {pointerCoord, hasPointerMoved} from '../../util/dom';
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*/
|
||||
|
||||
@Directive({
|
||||
selector: 'ion-label',
|
||||
inputs: [
|
||||
@ -21,10 +19,7 @@ import {pointerCoord, hasPointerMoved} from '../../util/dom';
|
||||
}
|
||||
})
|
||||
export class Label {
|
||||
/**
|
||||
* TODO
|
||||
* @param {Config} config
|
||||
*/
|
||||
|
||||
constructor(config: Config, @Optional() container: TextInput) {
|
||||
this.scrollAssist = config.get('scrollAssist');
|
||||
if (!this.id) {
|
||||
@ -35,8 +30,7 @@ export class Label {
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO
|
||||
* @param {TODO} ev TODO
|
||||
* @private
|
||||
*/
|
||||
pointerStart(ev) {
|
||||
if (this.scrollAssist) {
|
||||
@ -46,8 +40,7 @@ export class Label {
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO
|
||||
* @param {TODO} ev TODO
|
||||
* @private
|
||||
*/
|
||||
pointerEnd(ev) {
|
||||
if (this.container) {
|
||||
|
@ -55,15 +55,24 @@ export class TextInput {
|
||||
this.keyboardHeight = config.get('keyboardHeight');
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
registerInput(textInputElement) {
|
||||
this.input = textInputElement;
|
||||
this.type = textInputElement.type || 'text';
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
registerLabel(label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
onInit() {
|
||||
if (this.input && this.label) {
|
||||
// if there is an input and an label
|
||||
@ -83,6 +92,9 @@ export class TextInput {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
pointerStart(ev) {
|
||||
if (this.scrollAssist && this.app.isEnabled()) {
|
||||
// remember where the touchstart/mousedown started
|
||||
@ -90,6 +102,9 @@ export class TextInput {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
pointerEnd(ev) {
|
||||
if (!this.app.isEnabled()) {
|
||||
ev.preventDefault();
|
||||
@ -119,6 +134,9 @@ export class TextInput {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
initFocus() {
|
||||
// begin the process of setting focus to the inner input element
|
||||
|
||||
@ -170,7 +188,7 @@ export class TextInput {
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO
|
||||
* @private
|
||||
* @param {TODO} inputOffsetTop TODO
|
||||
* @param {TODO} inputOffsetHeight TODO
|
||||
* @param {TODO} scrollViewDimensions TODO
|
||||
@ -292,14 +310,23 @@ export class TextInput {
|
||||
return scrollData;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
focusChange(hasFocus) {
|
||||
this.renderer.setElementClass(this.elementRef, 'has-focus', hasFocus);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
hasValue(inputValue) {
|
||||
this.renderer.setElementClass(this.elementRef, 'has-value', inputValue && inputValue !== '');
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
setFocus() {
|
||||
if (this.input) {
|
||||
this.form.setAsFocused(this);
|
||||
@ -317,14 +344,23 @@ export class TextInput {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
deregListeners() {
|
||||
this.deregScroll && this.deregScroll();
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
get hasFocus() {
|
||||
return !!this.input && this.input.hasFocus;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
onDestroy() {
|
||||
this.deregListeners();
|
||||
this.form.deregister(this);
|
||||
@ -333,6 +369,9 @@ export class TextInput {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
@Directive({
|
||||
selector: 'textarea,input[type=text],input[type=password],input[type=number],input[type=search],input[type=email],input[type=url],input[type=tel]',
|
||||
inputs: ['value'],
|
||||
|
@ -20,23 +20,29 @@ export class ToolbarBase extends Ion {
|
||||
this.titleRef = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
setTitleCmp(titleCmp) {
|
||||
this.titleCmp = titleCmp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
getTitleText() {
|
||||
return (this.titleCmp && this.titleCmp.getTitleText()) || '';
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO
|
||||
* @returns {TODO} TODO
|
||||
* @private
|
||||
*/
|
||||
getTitleRef() {
|
||||
return this.titleCmp && this.titleCmp.elementRef;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* A toolbar items include the left and right side `ion-nav-items`,
|
||||
* and every `menu-toggle`. It does not include the `ion-title`.
|
||||
* @returns {TODO} Array of this toolbar's item ElementRefs.
|
||||
@ -45,6 +51,9 @@ export class ToolbarBase extends Ion {
|
||||
return this.itemRefs;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
addItemRef(itemElementRef) {
|
||||
this.itemRefs.push(itemElementRef);
|
||||
}
|
||||
@ -104,6 +113,9 @@ export class ToolbarTitle extends Ion {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
@Directive({
|
||||
selector: 'ion-nav-items,[menu-toggle]'
|
||||
})
|
||||
|
@ -57,15 +57,11 @@ import {isObject, isDefined, isFunction, isArray, extend} from '../util/util';
|
||||
* Simply add `?ionic<PROPERTYNAME>=<value>` to the url.
|
||||
*
|
||||
* ```
|
||||
* http://localhost:8100/?IonictabbarPlacement=bottom
|
||||
* http://localhost:8100/?ionicTabbarPlacement=bottom
|
||||
* ```
|
||||
**/
|
||||
export class Config {
|
||||
|
||||
/**
|
||||
* TODO
|
||||
* @param {Object} config The config for your app
|
||||
*/
|
||||
constructor(config) {
|
||||
this._s = config && isObject(config) && !isArray(config) ? config : {};
|
||||
this._c = {}; // cached values
|
||||
@ -246,8 +242,7 @@ export class Config {
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO
|
||||
* @param {Object} platform The platform
|
||||
* @private
|
||||
*/
|
||||
setPlatform(platform) {
|
||||
this._platform = platform;
|
||||
|
@ -78,7 +78,9 @@ export function Page(config={}) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export function ConfigComponent(config) {
|
||||
return function(cls) {
|
||||
var annotations = Reflect.getMetadata('annotations', cls) || [];
|
||||
@ -88,7 +90,9 @@ export function ConfigComponent(config) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
function appendConfig(cls, config) {
|
||||
config.host = config.host || {};
|
||||
|
||||
|
Reference in New Issue
Block a user