mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +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 {Overlay} from '../overlay/overlay';
|
||||
import {IonicComponent} from '../../config/component';
|
||||
import {IonicComponent} from '../../config/annotations';
|
||||
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 {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 gestures from './extensions/gestures'
|
||||
import {dom} from 'ionic/util'
|
||||
|
@ -9,7 +9,7 @@ import {onInit} from 'angular2/angular2';
|
||||
|
||||
//pretty sure this has changed in the latest angular
|
||||
import {NgControl} from 'angular2/forms';
|
||||
import {IonicComponent} from '../../config/component';
|
||||
import {IonicComponent} from '../../config/annotations';
|
||||
import {Icon} from '../icon/icon';
|
||||
|
||||
|
||||
|
@ -1,15 +1,13 @@
|
||||
import {Renderer, ElementRef} from 'angular2/angular2'
|
||||
import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
|
||||
import {View} from 'angular2/src/core/annotations_impl/view';
|
||||
import {ElementRef} from 'angular2/angular2';
|
||||
|
||||
import {ItemPrimaryOptions, ItemSecondaryOptions} from './item-options'
|
||||
import {ItemPrimarySwipeButtons, ItemSecondarySwipeButtons} from './item-swipe-buttons'
|
||||
import {IonicComponent} from '../../config/component'
|
||||
import {dom} from 'ionic/util'
|
||||
import {ItemPrimaryOptions, ItemSecondaryOptions} from './item-options';
|
||||
import {ItemPrimarySwipeButtons, ItemSecondarySwipeButtons} from './item-swipe-buttons';
|
||||
import {IonicComponent, IonicView} from '../../config/annotations';
|
||||
import {dom} from 'ionic/util';
|
||||
|
||||
|
||||
@IonicComponent(Item)
|
||||
@View({
|
||||
@IonicView({
|
||||
template: `
|
||||
<!--
|
||||
<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 {IonicDirective} from 'ionic/config/component'
|
||||
import {ListVirtualScroll} from './virtual'
|
||||
|
||||
import {IonicDirective} from '../../config/annotations';
|
||||
import {ListVirtualScroll} from './virtual';
|
||||
import * as util from 'ionic/util';
|
||||
|
||||
|
||||
|
@ -7,7 +7,7 @@ import {bind} from 'angular2/di';
|
||||
|
||||
import {ViewController} from '../view/view-controller';
|
||||
import {SwipeHandle} from './swipe-handle';
|
||||
import {IonicComponent} from '../../config/component';
|
||||
import {IonicComponent} from '../../config/annotations';
|
||||
|
||||
|
||||
export class PaneController {
|
||||
|
@ -1,10 +1,9 @@
|
||||
import {ElementRef} from 'angular2/angular2'
|
||||
import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
|
||||
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 {IonicDirective, IonicComponent} from 'ionic/config/component';
|
||||
|
||||
import {IonicDirective, IonicComponent, IonicView} from '../../config/annotations';
|
||||
|
||||
|
||||
@IonicDirective(RadioGroup)
|
||||
@ -88,7 +87,7 @@ export class RadioGroup {
|
||||
|
||||
|
||||
@IonicComponent(RadioButton)
|
||||
@View({
|
||||
@IonicView({
|
||||
template: `
|
||||
<div class="item-content">
|
||||
|
||||
|
@ -1,21 +1,19 @@
|
||||
import {ElementRef, Pipe} from 'angular2/angular2'
|
||||
import {Component, Directive, onInit} from 'angular2/src/core/annotations_impl/annotations';
|
||||
import {View} from 'angular2/src/core/annotations_impl/view';
|
||||
|
||||
import {onInit} from 'angular2/src/core/annotations_impl/annotations';
|
||||
//import {ControlGroup, ControlDirective} from 'angular2/forms'
|
||||
|
||||
import {IonicComponent} from 'ionic/config/component'
|
||||
import {IonicComponent, IonicView} from '../../config/annotations';
|
||||
|
||||
|
||||
@IonicComponent(SearchBar)
|
||||
@View({
|
||||
@IonicView({
|
||||
template: `
|
||||
<div class="search-bar-input-container" [class.left-align]="shouldLeftAlign">
|
||||
<div class="search-bar-icon"></div>
|
||||
<input (focus)="inputFocused()" (blur)="inputBlurred()"
|
||||
(input)="inputChanged($event)" class="search-bar-input" type="search" [attr.placeholder]="placeholder">
|
||||
</div>
|
||||
<button class="search-bar-cancel">{{ cancelText }}</button>`
|
||||
<button class="search-bar-cancel">{{cancelText}}</button>`
|
||||
})
|
||||
export class SearchBar {
|
||||
|
||||
|
@ -1,15 +1,16 @@
|
||||
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 {View} from 'angular2/src/core/annotations_impl/view';
|
||||
|
||||
import {Control, NgControl,NgFormControl} from 'angular2/forms';
|
||||
import {ControlGroup, ControlDirective} from 'angular2/forms'
|
||||
import {dom} from 'ionic/util';
|
||||
import {IonicComponent} from 'ionic/config/component'
|
||||
import {IonicDirective, IonicComponent, IonicView} from '../../config/annotations'
|
||||
|
||||
@Directive({
|
||||
|
||||
@IonicDirective({
|
||||
selector: 'ion-segment',
|
||||
host: {
|
||||
'(change)': 'onChange($event.target.value)',
|
||||
@ -53,7 +54,7 @@ export class SegmentControlValueAccessor {
|
||||
|
||||
|
||||
@IonicComponent(Segment)
|
||||
@View({
|
||||
@IonicView({
|
||||
template: `<div class="ion-segment">
|
||||
<content></content>
|
||||
</div>
|
||||
@ -161,7 +162,7 @@ export class Segment {
|
||||
}
|
||||
|
||||
|
||||
@Directive({
|
||||
@IonicDirective({
|
||||
selector: 'ion-segment-button',
|
||||
properties: [
|
||||
'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 {Component, Directive, onInit} from 'angular2/src/core/annotations_impl/annotations';
|
||||
import {View} from 'angular2/src/core/annotations_impl/view';
|
||||
|
||||
import {onInit} from 'angular2/src/core/annotations_impl/annotations';
|
||||
import {DragGesture} from 'ionic/gestures/drag-gesture';
|
||||
import * as util 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';
|
||||
|
||||
|
||||
@ -30,7 +25,7 @@ import {Hammer} from 'ionic/gestures/hammer';
|
||||
* * TODO: Port over mouse handling
|
||||
*/
|
||||
@IonicComponent(Slides)
|
||||
@View({
|
||||
@IonicView({
|
||||
template: `<div class="slides-view"><content></content></div>`,
|
||||
directives: [Slide, SlidePager]
|
||||
})
|
||||
@ -478,7 +473,6 @@ export class Slide {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
translate(x, duration) {
|
||||
this._translateX = x;
|
||||
|
||||
@ -511,13 +505,12 @@ export class Slide {
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
@IonicComponent({
|
||||
selector: 'ion-pager',
|
||||
})
|
||||
@View({
|
||||
@IonicView({
|
||||
//[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>`,
|
||||
direcitves: [For]
|
||||
template: `<span class="slide-pager-page" *ng-for="#page of getSlides()">{{page.width}}<i class="icon ion-record"></i>X</span>`
|
||||
})
|
||||
export class SlidePager {
|
||||
constructor(
|
||||
|
@ -1,13 +1,11 @@
|
||||
import {Renderer, ElementRef} from 'angular2/angular2'
|
||||
import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
|
||||
import {View} from 'angular2/src/core/annotations_impl/view';
|
||||
import {ElementRef} from 'angular2/angular2'
|
||||
|
||||
import {ControlGroup, ControlDirective} from 'angular2/forms'
|
||||
import {dom} from 'ionic/util';
|
||||
import {IonicComponent} from 'ionic/config/component'
|
||||
import {IonicComponent, IonicView} from '../../config/annotations';
|
||||
|
||||
|
||||
@IonicComponent(Switch)
|
||||
@View({
|
||||
@IonicView({
|
||||
template: `
|
||||
<div class="item-content">
|
||||
<div class="item-title">
|
||||
|
@ -8,7 +8,7 @@ import {ViewController} from '../view/view-controller';
|
||||
import {ViewItem} from '../view/view-item';
|
||||
import {TabButton} from './tab-button';
|
||||
import {Icon} from '../icon/icon';
|
||||
import {IonicComponent} from '../../config/component';
|
||||
import {IonicComponent} from '../../config/annotations';
|
||||
|
||||
|
||||
@IonicComponent(Tabs)
|
||||
|
@ -1,9 +1,51 @@
|
||||
import {coreDirectives} from 'angular2/angular2';
|
||||
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 {Platform} from 'ionic/platform/platform';
|
||||
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 {
|
||||
@ -19,6 +61,10 @@ export class IonicComponent extends Component {
|
||||
}
|
||||
|
||||
function appendModeConfig(ComponentType) {
|
||||
if (typeof ComponentType === 'object') {
|
||||
return ComponentType;
|
||||
}
|
||||
|
||||
let config = ComponentType.config;
|
||||
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/component'
|
||||
export * from 'ionic/config/ionic-view'
|
||||
export * from 'ionic/config/annotations'
|
||||
|
||||
export * from 'ionic/net/http'
|
||||
|
||||
|
Reference in New Issue
Block a user