mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 04:14:21 +08:00
component renamed to annotations
This commit is contained in:
@ -15,7 +15,7 @@ import {IonicApp} from '../app/app';
|
|||||||
import * as util from 'ionic/util';
|
import * as util from 'ionic/util';
|
||||||
|
|
||||||
import {Overlay} from '../overlay/overlay';
|
import {Overlay} from '../overlay/overlay';
|
||||||
import {IonicComponent} from '../../config/component';
|
import {IonicComponent} from '../../config/annotations';
|
||||||
import {Animation} from 'ionic/animations/animation';
|
import {Animation} from 'ionic/animations/animation';
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import {EventEmitter, ElementRef} from 'angular2/angular2'
|
|||||||
import {onInit} from 'angular2/src/core/annotations_impl/annotations';
|
import {onInit} from 'angular2/src/core/annotations_impl/annotations';
|
||||||
import {View} from 'angular2/src/core/annotations_impl/view';
|
import {View} from 'angular2/src/core/annotations_impl/view';
|
||||||
|
|
||||||
import {IonicComponent} from '../../config/component';
|
import {IonicComponent} from '../../config/annotations';
|
||||||
import * as types from './extensions/types'
|
import * as types from './extensions/types'
|
||||||
import * as gestures from './extensions/gestures'
|
import * as gestures from './extensions/gestures'
|
||||||
import {dom} from 'ionic/util'
|
import {dom} from 'ionic/util'
|
||||||
|
@ -9,7 +9,7 @@ import {onInit} from 'angular2/angular2';
|
|||||||
|
|
||||||
//pretty sure this has changed in the latest angular
|
//pretty sure this has changed in the latest angular
|
||||||
import {NgControl} from 'angular2/forms';
|
import {NgControl} from 'angular2/forms';
|
||||||
import {IonicComponent} from '../../config/component';
|
import {IonicComponent} from '../../config/annotations';
|
||||||
import {Icon} from '../icon/icon';
|
import {Icon} from '../icon/icon';
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
import {Renderer, ElementRef} from 'angular2/angular2'
|
import {ElementRef} from 'angular2/angular2';
|
||||||
import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
|
|
||||||
import {View} from 'angular2/src/core/annotations_impl/view';
|
|
||||||
|
|
||||||
import {ItemPrimaryOptions, ItemSecondaryOptions} from './item-options'
|
import {ItemPrimaryOptions, ItemSecondaryOptions} from './item-options';
|
||||||
import {ItemPrimarySwipeButtons, ItemSecondarySwipeButtons} from './item-swipe-buttons'
|
import {ItemPrimarySwipeButtons, ItemSecondarySwipeButtons} from './item-swipe-buttons';
|
||||||
import {IonicComponent} from '../../config/component'
|
import {IonicComponent, IonicView} from '../../config/annotations';
|
||||||
import {dom} from 'ionic/util'
|
import {dom} from 'ionic/util';
|
||||||
|
|
||||||
|
|
||||||
@IonicComponent(Item)
|
@IonicComponent(Item)
|
||||||
@View({
|
@IonicView({
|
||||||
template: `
|
template: `
|
||||||
<!--
|
<!--
|
||||||
<content select="ion-primary-options"></content>
|
<content select="ion-primary-options"></content>
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
import {ElementRef} from 'angular2/angular2'
|
import {ElementRef} from 'angular2/angular2';
|
||||||
import {onInit} from 'angular2/src/core/annotations_impl/annotations';
|
import {onInit} from 'angular2/src/core/annotations_impl/annotations';
|
||||||
|
|
||||||
import {IonicDirective} from 'ionic/config/component'
|
import {IonicDirective} from '../../config/annotations';
|
||||||
import {ListVirtualScroll} from './virtual'
|
import {ListVirtualScroll} from './virtual';
|
||||||
|
|
||||||
import * as util from 'ionic/util';
|
import * as util from 'ionic/util';
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ import {bind} from 'angular2/di';
|
|||||||
|
|
||||||
import {ViewController} from '../view/view-controller';
|
import {ViewController} from '../view/view-controller';
|
||||||
import {SwipeHandle} from './swipe-handle';
|
import {SwipeHandle} from './swipe-handle';
|
||||||
import {IonicComponent} from '../../config/component';
|
import {IonicComponent} from '../../config/annotations';
|
||||||
|
|
||||||
|
|
||||||
export class PaneController {
|
export class PaneController {
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
import {ElementRef} from 'angular2/angular2'
|
import {ElementRef} from 'angular2/angular2'
|
||||||
import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
|
import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
|
||||||
import {Ancestor} from 'angular2/src/core/annotations_impl/visibility';
|
import {Ancestor} from 'angular2/src/core/annotations_impl/visibility';
|
||||||
import {View} from 'angular2/src/core/annotations_impl/view';
|
|
||||||
|
|
||||||
//import {ControlGroup, ControlDirective} from 'angular2/forms'
|
//import {ControlGroup, ControlDirective} from 'angular2/forms'
|
||||||
import {IonicDirective, IonicComponent} from 'ionic/config/component';
|
|
||||||
|
import {IonicDirective, IonicComponent, IonicView} from '../../config/annotations';
|
||||||
|
|
||||||
|
|
||||||
@IonicDirective(RadioGroup)
|
@IonicDirective(RadioGroup)
|
||||||
@ -88,7 +87,7 @@ export class RadioGroup {
|
|||||||
|
|
||||||
|
|
||||||
@IonicComponent(RadioButton)
|
@IonicComponent(RadioButton)
|
||||||
@View({
|
@IonicView({
|
||||||
template: `
|
template: `
|
||||||
<div class="item-content">
|
<div class="item-content">
|
||||||
|
|
||||||
|
@ -1,21 +1,19 @@
|
|||||||
import {ElementRef, Pipe} from 'angular2/angular2'
|
import {ElementRef, Pipe} from 'angular2/angular2'
|
||||||
import {Component, Directive, onInit} from 'angular2/src/core/annotations_impl/annotations';
|
import {onInit} from 'angular2/src/core/annotations_impl/annotations';
|
||||||
import {View} from 'angular2/src/core/annotations_impl/view';
|
|
||||||
|
|
||||||
//import {ControlGroup, ControlDirective} from 'angular2/forms'
|
//import {ControlGroup, ControlDirective} from 'angular2/forms'
|
||||||
|
|
||||||
import {IonicComponent} from 'ionic/config/component'
|
import {IonicComponent, IonicView} from '../../config/annotations';
|
||||||
|
|
||||||
|
|
||||||
@IonicComponent(SearchBar)
|
@IonicComponent(SearchBar)
|
||||||
@View({
|
@IonicView({
|
||||||
template: `
|
template: `
|
||||||
<div class="search-bar-input-container" [class.left-align]="shouldLeftAlign">
|
<div class="search-bar-input-container" [class.left-align]="shouldLeftAlign">
|
||||||
<div class="search-bar-icon"></div>
|
<div class="search-bar-icon"></div>
|
||||||
<input (focus)="inputFocused()" (blur)="inputBlurred()"
|
<input (focus)="inputFocused()" (blur)="inputBlurred()"
|
||||||
(input)="inputChanged($event)" class="search-bar-input" type="search" [attr.placeholder]="placeholder">
|
(input)="inputChanged($event)" class="search-bar-input" type="search" [attr.placeholder]="placeholder">
|
||||||
</div>
|
</div>
|
||||||
<button class="search-bar-cancel">{{ cancelText }}</button>`
|
<button class="search-bar-cancel">{{cancelText}}</button>`
|
||||||
})
|
})
|
||||||
export class SearchBar {
|
export class SearchBar {
|
||||||
|
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
import {Renderer, ElementRef, EventEmitter} from 'angular2/angular2'
|
import {Renderer, ElementRef, EventEmitter} from 'angular2/angular2'
|
||||||
|
|
||||||
import {Component, Directive, onInit} from 'angular2/src/core/annotations_impl/annotations';
|
import {onInit} from 'angular2/src/core/annotations_impl/annotations';
|
||||||
import {Ancestor} from 'angular2/src/core/annotations_impl/visibility';
|
import {Ancestor} from 'angular2/src/core/annotations_impl/visibility';
|
||||||
import {View} from 'angular2/src/core/annotations_impl/view';
|
import {View} from 'angular2/src/core/annotations_impl/view';
|
||||||
|
|
||||||
import {Control, NgControl,NgFormControl} from 'angular2/forms';
|
import {Control, NgControl,NgFormControl} from 'angular2/forms';
|
||||||
import {ControlGroup, ControlDirective} from 'angular2/forms'
|
import {ControlGroup, ControlDirective} from 'angular2/forms'
|
||||||
import {dom} from 'ionic/util';
|
import {dom} from 'ionic/util';
|
||||||
import {IonicComponent} from 'ionic/config/component'
|
import {IonicDirective, IonicComponent, IonicView} from '../../config/annotations'
|
||||||
|
|
||||||
@Directive({
|
|
||||||
|
@IonicDirective({
|
||||||
selector: 'ion-segment',
|
selector: 'ion-segment',
|
||||||
host: {
|
host: {
|
||||||
'(change)': 'onChange($event.target.value)',
|
'(change)': 'onChange($event.target.value)',
|
||||||
@ -53,7 +54,7 @@ export class SegmentControlValueAccessor {
|
|||||||
|
|
||||||
|
|
||||||
@IonicComponent(Segment)
|
@IonicComponent(Segment)
|
||||||
@View({
|
@IonicView({
|
||||||
template: `<div class="ion-segment">
|
template: `<div class="ion-segment">
|
||||||
<content></content>
|
<content></content>
|
||||||
</div>
|
</div>
|
||||||
@ -161,7 +162,7 @@ export class Segment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Directive({
|
@IonicDirective({
|
||||||
selector: 'ion-segment-button',
|
selector: 'ion-segment-button',
|
||||||
properties: [
|
properties: [
|
||||||
'value'
|
'value'
|
||||||
|
@ -1,16 +1,11 @@
|
|||||||
import {For, ElementRef, Inject, Parent} from 'angular2/angular2'
|
import {ElementRef} from 'angular2/angular2'
|
||||||
|
|
||||||
import {Ancestor} from 'angular2/src/core/annotations_impl/visibility';
|
import {Ancestor} from 'angular2/src/core/annotations_impl/visibility';
|
||||||
|
|
||||||
import {Component, Directive, onInit} from 'angular2/src/core/annotations_impl/annotations';
|
import {onInit} from 'angular2/src/core/annotations_impl/annotations';
|
||||||
import {View} from 'angular2/src/core/annotations_impl/view';
|
|
||||||
|
|
||||||
import {DragGesture} from 'ionic/gestures/drag-gesture';
|
import {DragGesture} from 'ionic/gestures/drag-gesture';
|
||||||
import * as util from 'ionic/util';
|
import * as util from 'ionic/util';
|
||||||
|
|
||||||
import {dom} from 'ionic/util'
|
import {dom} from 'ionic/util'
|
||||||
import {IonicComponent, IonicDirective} from 'ionic/config/component'
|
import {IonicComponent, IonicDirective, IonicView} from '../../config/annotations';
|
||||||
|
|
||||||
import {Hammer} from 'ionic/gestures/hammer';
|
import {Hammer} from 'ionic/gestures/hammer';
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +25,7 @@ import {Hammer} from 'ionic/gestures/hammer';
|
|||||||
* * TODO: Port over mouse handling
|
* * TODO: Port over mouse handling
|
||||||
*/
|
*/
|
||||||
@IonicComponent(Slides)
|
@IonicComponent(Slides)
|
||||||
@View({
|
@IonicView({
|
||||||
template: `<div class="slides-view"><content></content></div>`,
|
template: `<div class="slides-view"><content></content></div>`,
|
||||||
directives: [Slide, SlidePager]
|
directives: [Slide, SlidePager]
|
||||||
})
|
})
|
||||||
@ -478,7 +473,6 @@ export class Slide {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
translate(x, duration) {
|
translate(x, duration) {
|
||||||
this._translateX = x;
|
this._translateX = x;
|
||||||
|
|
||||||
@ -511,13 +505,12 @@ export class Slide {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@IonicComponent({
|
||||||
selector: 'ion-pager',
|
selector: 'ion-pager',
|
||||||
})
|
})
|
||||||
@View({
|
@IonicView({
|
||||||
//[class.active]="$index == currentSlide}" ng-click="pagerClick($index)"><i class="icon ion-record"></i></span></div>',
|
//[class.active]="$index == currentSlide}" ng-click="pagerClick($index)"><i class="icon ion-record"></i></span></div>',
|
||||||
template: `<span class="slide-pager-page" *for="#page of getSlides()">{{page.width}}<i class="icon ion-record"></i>X</span>`,
|
template: `<span class="slide-pager-page" *ng-for="#page of getSlides()">{{page.width}}<i class="icon ion-record"></i>X</span>`
|
||||||
direcitves: [For]
|
|
||||||
})
|
})
|
||||||
export class SlidePager {
|
export class SlidePager {
|
||||||
constructor(
|
constructor(
|
||||||
|
@ -1,13 +1,11 @@
|
|||||||
import {Renderer, ElementRef} from 'angular2/angular2'
|
import {ElementRef} from 'angular2/angular2'
|
||||||
import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
|
|
||||||
import {View} from 'angular2/src/core/annotations_impl/view';
|
|
||||||
|
|
||||||
import {ControlGroup, ControlDirective} from 'angular2/forms'
|
import {ControlGroup, ControlDirective} from 'angular2/forms'
|
||||||
import {dom} from 'ionic/util';
|
import {IonicComponent, IonicView} from '../../config/annotations';
|
||||||
import {IonicComponent} from 'ionic/config/component'
|
|
||||||
|
|
||||||
@IonicComponent(Switch)
|
@IonicComponent(Switch)
|
||||||
@View({
|
@IonicView({
|
||||||
template: `
|
template: `
|
||||||
<div class="item-content">
|
<div class="item-content">
|
||||||
<div class="item-title">
|
<div class="item-title">
|
||||||
|
@ -8,7 +8,7 @@ import {ViewController} from '../view/view-controller';
|
|||||||
import {ViewItem} from '../view/view-item';
|
import {ViewItem} from '../view/view-item';
|
||||||
import {TabButton} from './tab-button';
|
import {TabButton} from './tab-button';
|
||||||
import {Icon} from '../icon/icon';
|
import {Icon} from '../icon/icon';
|
||||||
import {IonicComponent} from '../../config/component';
|
import {IonicComponent} from '../../config/annotations';
|
||||||
|
|
||||||
|
|
||||||
@IonicComponent(Tabs)
|
@IonicComponent(Tabs)
|
||||||
|
@ -1,9 +1,51 @@
|
|||||||
|
import {coreDirectives} from 'angular2/angular2';
|
||||||
import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
|
import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
|
||||||
import {DirectiveMetadata} from 'angular2/src/render/api';
|
import {View} from 'angular2/src/core/annotations_impl/view';
|
||||||
|
|
||||||
import * as util from 'ionic/util';
|
import * as util from 'ionic/util';
|
||||||
import {Platform} from 'ionic/platform/platform';
|
|
||||||
import {GlobalIonicConfig} from '../components/app/app';
|
import {GlobalIonicConfig} from '../components/app/app';
|
||||||
|
import {
|
||||||
|
Aside, Content, Refresher,
|
||||||
|
Slides, Slide, SlidePager,
|
||||||
|
Tabs, Tab,
|
||||||
|
List, Item,
|
||||||
|
Icon,
|
||||||
|
Checkbox, Switch, Label, Input,
|
||||||
|
Segment, SegmentButton, SegmentControlValueAccessor,
|
||||||
|
RadioGroup, RadioButton, SearchBar,
|
||||||
|
Nav, NavbarTemplate, Navbar, NavPush, NavPop
|
||||||
|
} from 'ionic/ionic';
|
||||||
|
|
||||||
|
|
||||||
|
export class IonicView extends View {
|
||||||
|
constructor(config) {
|
||||||
|
let directives = [
|
||||||
|
|
||||||
|
// Angular
|
||||||
|
coreDirectives,
|
||||||
|
|
||||||
|
// Content
|
||||||
|
Aside, Content, Refresher,
|
||||||
|
List, Item,
|
||||||
|
Slides, Slide, SlidePager,
|
||||||
|
Tabs, Tab,
|
||||||
|
|
||||||
|
// Media
|
||||||
|
Icon,
|
||||||
|
|
||||||
|
// Form elements
|
||||||
|
Segment, SegmentButton, SegmentControlValueAccessor,
|
||||||
|
//Checkbox, Switch, Label, Input
|
||||||
|
//RadioGroup, RadioButton, SearchBar,
|
||||||
|
|
||||||
|
// Nav
|
||||||
|
Nav, NavbarTemplate, Navbar, NavPush, NavPop
|
||||||
|
];
|
||||||
|
|
||||||
|
config.directives = (config.directives || []).concat(directives);
|
||||||
|
super(config);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export class IonicDirective extends Directive {
|
export class IonicDirective extends Directive {
|
||||||
@ -19,6 +61,10 @@ export class IonicComponent extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function appendModeConfig(ComponentType) {
|
function appendModeConfig(ComponentType) {
|
||||||
|
if (typeof ComponentType === 'object') {
|
||||||
|
return ComponentType;
|
||||||
|
}
|
||||||
|
|
||||||
let config = ComponentType.config;
|
let config = ComponentType.config;
|
||||||
config.host = config.host || {};
|
config.host = config.host || {};
|
||||||
|
|
@ -1,45 +0,0 @@
|
|||||||
import {coreDirectives} from 'angular2/angular2';
|
|
||||||
|
|
||||||
import {View} from 'angular2/src/core/annotations_impl/view';
|
|
||||||
|
|
||||||
import {
|
|
||||||
Aside, Content, Refresher,
|
|
||||||
Slides, Slide, SlidePager,
|
|
||||||
Tabs, Tab,
|
|
||||||
List, Item,
|
|
||||||
Icon,
|
|
||||||
Checkbox, Switch, Label, Input, Segment, SegmentButton, SegmentControlValueAccessor,
|
|
||||||
RadioGroup, RadioButton, SearchBar,
|
|
||||||
Nav, NavbarTemplate, Navbar, NavPush, NavPop
|
|
||||||
} from 'ionic/ionic';
|
|
||||||
|
|
||||||
|
|
||||||
export class IonicView extends View {
|
|
||||||
constructor(config) {
|
|
||||||
let directives = [
|
|
||||||
|
|
||||||
// Angular
|
|
||||||
coreDirectives,
|
|
||||||
|
|
||||||
// Content
|
|
||||||
Aside, Content, Refresher,
|
|
||||||
List, Item,
|
|
||||||
Slides, Slide, SlidePager,
|
|
||||||
Tabs, Tab,
|
|
||||||
|
|
||||||
// Media
|
|
||||||
Icon,
|
|
||||||
|
|
||||||
// Form elements
|
|
||||||
Segment, SegmentButton, SegmentControlValueAccessor,
|
|
||||||
//Checkbox, Switch, Label, Input
|
|
||||||
//RadioGroup, RadioButton, SearchBar,
|
|
||||||
|
|
||||||
// Nav
|
|
||||||
Nav, NavbarTemplate, Navbar, NavPush, NavPop
|
|
||||||
];
|
|
||||||
|
|
||||||
config.directives = (config.directives || []).concat(directives);
|
|
||||||
super(config);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,7 +1,6 @@
|
|||||||
|
|
||||||
export * from 'ionic/config/config'
|
export * from 'ionic/config/config'
|
||||||
export * from 'ionic/config/component'
|
export * from 'ionic/config/annotations'
|
||||||
export * from 'ionic/config/ionic-view'
|
|
||||||
|
|
||||||
export * from 'ionic/net/http'
|
export * from 'ionic/net/http'
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user