rename src to ionic

This commit is contained in:
Andrew
2015-04-25 10:59:04 -05:00
parent 4473463909
commit 9039297110
231 changed files with 0 additions and 0 deletions

View File

@ -1,85 +0,0 @@
import {Component, Template, NgElement, PropertySetter} from 'angular2/angular2'
import {IonicComponent} from 'ionic2/config/component'
@Component({
selector: 'ion-checkbox',
bind: {
checked: 'checked'
},
events: {
'^click': 'onClick()'
}
})
@Template({
inline: `
<div class="item-media media-checkbox">
<icon class="checkbox-off"></icon>
<icon class="checkbox-on"></icon>
</div>
<div class="item-content">
<div class="item-label">
<content></content>
</div>
</div>`
})
export class Checkbox {
constructor(
@NgElement() ngElement: NgElement,
@PropertySetter('attr.role') setAriaRole: Function,
@PropertySetter('attr.aria-checked') setAriaChecked: Function,
@PropertySetter('attr.aria-invalid') setAriaInvalid: Function,
@PropertySetter('attr.aria-disabled') setAriaDisabled: Function
) {
this.domElement = ngElement.domElement
this.domElement.classList.add('item')
this.config = Checkbox.config.invoke(this)
setAriaRole('checkbox')
setAriaInvalid('false')
setAriaDisabled('false')
this.setAriaRole = setAriaRole
this.setAriaChecked = setAriaChecked
this.setAriaInvalid = setAriaInvalid
this.setAriaDisabled = setAriaDisabled
// TODO: FIXME!! MAKE MORE GOOD!!!!
this.domElement.querySelector('.checkbox-off').classList.add(this.iconOff)
this.domElement.querySelector('.checkbox-on').classList.add(this.iconOn)
}
set checked(checked) {
this._checked = checked
this.setAriaChecked(checked)
}
get checked() {
return this._checked
}
onClick() {
this.checked = !this.checked;
}
}
new IonicComponent(Checkbox, {
bind: {
iconOff: {
defaults: {
ios: 'ion-ios-circle-outline',
android: 'ion-android-checkbox-outline-blank',
core: 'ion-android-checkbox-outline-blank'
}
},
iconOn: {
defaults: {
ios: 'ion-ios-checkmark',
android: 'ion-android-checkbox',
core: 'ion-android-checkbox',
}
}
}
})

View File

@ -1,39 +0,0 @@
// Checkbox
// --------------------------------------------------
.checkbox {
display: block;
cursor: pointer;
@include user-select(none);
}
.checkbox-on {
display: none;
}
.checkbox-off {
display: block;
}
.checkbox[aria-checked=true] {
.checkbox-on {
display: block;
}
.checkbox-off {
display: none;
}
}
.checkbox[aria-disabled=true] {
opacity: 0.5;
color: gray;
.media-checkbox {
color: inherit;
}
}

View File

@ -1,15 +0,0 @@
// iOS Checkbox
// --------------------------------------------------
$checkbox-ios-color: #007aff;
.checkbox-ios {
.media-checkbox {
min-width: 20px;
color: $checkbox-ios-color;
}
}

View File

@ -1 +0,0 @@

View File

@ -1,26 +0,0 @@
<ion-view nav-title="Checkboxes">
<ion-content>
<div class="list-header">Some Checkboxes</div>
<ion-list>
<ion-checkbox [checked]="true">
Apples
</ion-checkbox>
<ion-checkbox>
Bananas
</ion-checkbox>
<ion-checkbox [disabled]="true">
Oranges
</ion-checkbox>
</ion-list>
</ion-content>
</ion-view>

View File

@ -1,20 +0,0 @@
import {bootstrap} from 'angular2/core';
import {Component, Template} from 'angular2/angular2';
import {View} from 'ionic2/components/view/view';
import {Content} from 'ionic2/components/content/content';
import {Icon} from 'ionic2/components/icon/icon';
import {Checkbox} from 'ionic2/components/checkbox/checkbox';
import {List} from 'ionic2/components/list/list';
@Component({ selector: '[ion-app]' })
@Template({
url: 'main.html',
directives: [View, Content, Icon, Checkbox, List]
})
class IonicApp {
constructor() {
console.log('IonicApp Start')
}
}
bootstrap(IonicApp)