refactor(demos): forms and input

This commit is contained in:
Drew Rygh
2015-11-04 19:37:41 -06:00
parent 19ce43a182
commit a766c20d65
50 changed files with 306 additions and 296 deletions

View File

@ -0,0 +1,13 @@
import {Page} from 'ionic/ionic';
import {forwardRef} from 'angular2/angular2';
import {AndroidAttribute} from '../../helpers';
@Page({
templateUrl: 'cards/advanced-map/template.html',
directives: [forwardRef(() => AndroidAttribute)]
})
export class AdvancedMapPage {
constructor() {
}
}

View File

@ -0,0 +1,13 @@
import {Page} from 'ionic/ionic';
import {forwardRef} from 'angular2/angular2';
import {AndroidAttribute} from '../../helpers';
@Page({
templateUrl: 'cards/advanced-social/template.html',
directives: [forwardRef(() => AndroidAttribute)]
})
export class AdvancedSocialPage {
constructor() {
}
}

View File

@ -0,0 +1,13 @@
import {Page} from 'ionic/ionic';
import {forwardRef} from 'angular2/angular2';
import {AndroidAttribute} from '../../helpers';
@Page({
templateUrl: 'cards/advanced-weather/template.html',
directives: [forwardRef(() => AndroidAttribute)]
})
export class AdvancedWeatherPage {
constructor() {
}
}

View File

@ -3,7 +3,7 @@ import {forwardRef} from 'angular2/angular2';
import {AndroidAttribute} from '../../helpers';
@Page({
templateUrl: 'cards/cards-background/main.html',
templateUrl: 'cards/background/template.html',
directives: [forwardRef(() => AndroidAttribute)]
})
export class BackgroundPage {

View File

@ -0,0 +1,13 @@
import {Page} from 'ionic/ionic';
import {forwardRef} from 'angular2/angular2';
import {AndroidAttribute} from '../../helpers';
@Page({
templateUrl: 'cards/basic/template.html',
directives: [forwardRef(() => AndroidAttribute)]
})
export class BasicPage {
constructor() {
}
}

View File

@ -1,36 +0,0 @@
<ion-navbar *navbar hide-back-button class="show-navbar android-attr">
<ion-title>Background Images</ion-title>
</ion-navbar>
<ion-content class="has-header components-demo cards-bg">
<ion-card class="advanced-background">
<img src="img/card-saopaolo.png"/>
<p class="advanced-background-title">São Paulo</p>
<p class="advanced-background-subtitle">41 Listings</p>
</ion-card>
<ion-card class="advanced-background">
<img src="img/card-amsterdam.png"/>
<p class="advanced-background-title">Amsterdam</p>
<p class="advanced-background-subtitle">64 Listings</p>
</ion-card>
<ion-card class="advanced-background">
<img src="img/card-sf.png"/>
<p class="advanced-background-title">San Francisco</p>
<p class="advanced-background-subtitle">72 Listings</p>
</ion-card>
<ion-card class="advanced-background">
<img src="img/card-madison.png"/>
<p class="advanced-background-title">Madison</p>
<p class="advanced-background-subtitle">28 Listings</p>
</ion-card>
</ion-content>

View File

@ -1,76 +1,8 @@
import {Page} from 'ionic/ionic';
import {forwardRef} from 'angular2/angular2';
import {AndroidAttribute} from '../helpers';
export * from './cards-background/pages';
@Page({
templateUrl: 'cards/cards-basic.html',
directives: [forwardRef(() => AndroidAttribute)]
})
export class BasicPage {
constructor() {
}
}
@Page({
templateUrl: 'cards/cards-header.html',
directives: [forwardRef(() => AndroidAttribute)]
})
export class HeaderPage {
constructor() {
}
}
@Page({
templateUrl: 'cards/cards-list.html',
directives: [forwardRef(() => AndroidAttribute)]
})
export class ListPage {
constructor() {
}
}
@Page({
templateUrl: 'cards/cards-image.html',
directives: [forwardRef(() => AndroidAttribute)]
})
export class ImagePage {
constructor() {
}
}
@Page({
templateUrl: 'cards/cards-advanced-social.html',
directives: [forwardRef(() => AndroidAttribute)]
})
export class AdvancedSocialPage {
constructor() {
}
}
@Page({
templateUrl: 'cards/cards-advanced-map.html',
directives: [forwardRef(() => AndroidAttribute)]
})
export class AdvancedMapPage {
constructor() {
}
}
@Page({
templateUrl: 'cards/cards-advanced-weather.html',
directives: [forwardRef(() => AndroidAttribute)]
})
export class AdvancedWeatherPage {
constructor() {
}
}
export * from './advanced-map/pages';
export * from './advanced-social/pages';
export * from './advanced-weather/pages';
export * from './background/pages';
export * from './basic/pages';
export * from './header/pages';
export * from './image/pages';
export * from './list/pages';

View File

@ -0,0 +1,13 @@
import {Page} from 'ionic/ionic';
import {forwardRef} from 'angular2/angular2';
import {AndroidAttribute} from '../../helpers';
@Page({
templateUrl: 'cards/header/template.html',
directives: [forwardRef(() => AndroidAttribute)]
})
export class HeaderPage {
constructor() {
}
}

View File

@ -0,0 +1,13 @@
import {Page} from 'ionic/ionic';
import {forwardRef} from 'angular2/angular2';
import {AndroidAttribute} from '../../helpers';
@Page({
templateUrl: 'cards/image/template.html',
directives: [forwardRef(() => AndroidAttribute)]
})
export class ImagePage {
constructor() {
}
}

View File

@ -0,0 +1,13 @@
import {Page} from 'ionic/ionic';
import {forwardRef} from 'angular2/angular2';
import {AndroidAttribute} from '../../helpers';
@Page({
templateUrl: 'cards/list/template.html',
directives: [forwardRef(() => AndroidAttribute)]
})
export class ListPage {
constructor() {
}
}

View File

@ -1,91 +0,0 @@
import {FORM_DIRECTIVES, FormBuilder, forwardRef, Validators, Control, ControlGroup} from 'angular2/angular2';
import {Page} from 'ionic/ionic';
import {AndroidAttribute} from '../helpers';
@Page({
templateUrl: 'forms/forms.html',
providers: [FormBuilder],
directives: [forwardRef(() => AndroidAttribute)]
})
export class FormsPage {
constructor() {
this.form = new ControlGroup({
firstName: new Control("", Validators.required),
lastName: new Control("", Validators.required)
});
}
processForm(event) {
// TODO: display input in a popup
console.log(event);
}
}
@Page({
templateUrl: 'forms/fixed-inline.html',
directives: [forwardRef(() => AndroidAttribute)]
})
export class FixedInlinePage {
constructor() {
}
}
@Page({
templateUrl: 'forms/floating.html',
directives: [forwardRef(() => AndroidAttribute)]
})
export class FloatingPage {
constructor() {
}
}
@Page({
templateUrl: 'forms/inline.html',
directives: [forwardRef(() => AndroidAttribute)]
})
export class InlinePage {
constructor() {
}
}
@Page({
templateUrl: 'forms/inset.html',
directives: [forwardRef(() => AndroidAttribute)]
})
export class InsetPage {
constructor() {
}
}
@Page({
templateUrl: 'forms/placeholder.html',
directives: [forwardRef(() => AndroidAttribute)]
})
export class PlaceholderPage {
constructor() {
}
}
@Page({
templateUrl: 'forms/stacked.html',
directives: [forwardRef(() => AndroidAttribute)]
})
export class StackedPage {
constructor() {
}
}

View File

@ -5,22 +5,9 @@ import {Platform, Navbar} from 'ionic/ionic';
import * as actionSheets from './action-sheets/action-sheets';
import * as buttons from './buttons/buttons';
import * as cards from './cards/cards';
import {FormsPage,
FixedInlinePage,
FloatingPage,
InlinePage,
InsetPage,
PlaceholderPage,
StackedPage} from './forms/forms';
import {IconsPage} from './icons/icons';
import {CheckboxPage,
RadioPage,
RangePage,
SelectPage,
SwitchPage} from './inputs/inputs';
import * as labels from './labels/labels';
import * as icons from './icons/icons';
import * as inputs from './inputs/inputs';
import {BasicListsPage,
AvatarListsPage,
@ -117,21 +104,21 @@ export function getPageFor(hash) {
'card-advanced-social': cards.AdvancedSocialPage,
'card-advanced-weather': cards.AdvancedWeatherPage,
'checkbox': CheckboxPage,
'radio': RadioPage,
'range': RangePage,
'select': SelectPage,
'switch': SwitchPage,
'checkbox': inputs.CheckboxPage,
'radio': inputs.RadioPage,
'range': inputs.RangePage,
'select': inputs.SelectPage,
'switch': inputs.SwitchPage,
'inputs': FormsPage,
'fixed-inline-labels': FixedInlinePage,
'floating-labels': FloatingPage,
'inline-labels': InlinePage,
'inset-labels': InsetPage,
'placeholder-labels': PlaceholderPage,
'stacked-labels': StackedPage,
'inputs': labels.BasicPage,
'fixed-inline-labels': labels.FixedInlinePage,
'floating-labels': labels.FloatingPage,
'inline-labels': labels.InlinePage,
'inset-labels': labels.InsetPage,
'placeholder-labels': labels.PlaceholderPage,
'stacked-labels': labels.StackedPage,
'icons': IconsPage,
'icons': icons.BasicPage,
'lists': BasicListsPage,
'avatar-list': AvatarListsPage,

View File

@ -0,0 +1,13 @@
import {Page} from 'ionic/ionic';
import {forwardRef} from 'angular2/angular2';
import {AndroidAttribute} from '../../helpers';
@Page({
templateUrl: 'icons/basic/template.html',
directives: [forwardRef(() => AndroidAttribute)]
})
export class BasicPage {
constructor() {
}
}

View File

@ -1,13 +1 @@
import {Page} from 'ionic/ionic';
import {forwardRef} from 'angular2/angular2';
import {AndroidAttribute} from '../helpers';
@Page({
templateUrl: 'icons/icons.html',
directives: [forwardRef(() => AndroidAttribute)]
})
export class IconsPage {
constructor() {
}
}
export * from './basic/pages';

View File

@ -1,7 +1,7 @@
import {App, IonicApp, Platform, ActionSheet} from 'ionic/ionic';
import {Page, Config, Events} from 'ionic/ionic';
import {PageOne, PageTwo, PageThree} from './menus/menus';
import {ActionSheetPage} from './actionSheet/actionSheet';
import * as actionSheets from './action-sheets/action-sheets';
import * as helpers from './helpers';
@ -32,7 +32,7 @@ class DemoApp {
if (data.hash) {
this.nextPage = helpers.getPageFor(data.hash.replace('#', ''));
} else {
this.nextPage = ActionSheetPage;
this.nextPage = actionSheets.BasicPage;
}
let nav = this.app.getComponent('nav');
nav.setRoot(this.nextPage);

View File

@ -0,0 +1,12 @@
import {Page} from 'ionic/ionic';
import {forwardRef} from 'angular2/angular2';
import {AndroidAttribute} from '../../helpers';
@Page({
templateUrl: 'inputs/checkbox/template.html',
directives: [forwardRef(() => helpers.AndroidAttribute)]
})
export class CheckboxPage{
constructor() {
}
}

View File

@ -1,48 +1,5 @@
import {App, IonicApp, Page} from 'ionic/ionic';
import {forwardRef} from 'angular2/angular2';
import * as helpers from '../helpers';
@Page({
templateUrl: 'inputs/checkbox.html',
directives: [forwardRef(() => helpers.AndroidAttribute)]
})
export class CheckboxPage{
constructor() {
}
}
@Page({
templateUrl: 'inputs/radio.html',
directives: [forwardRef(() => helpers.AndroidAttribute)]
})
export class RadioPage{
constructor() {
}
}
@Page({
templateUrl: 'inputs/range.html',
directives: [forwardRef(() => helpers.AndroidAttribute)]
})
export class RangePage{
constructor() {
}
}
@Page({
templateUrl: 'inputs/select.html',
directives: [forwardRef(() => helpers.AndroidAttribute)]
})
export class SelectPage{
constructor() {
}
}
@Page({
templateUrl: 'inputs/switch.html',
directives: [forwardRef(() => helpers.AndroidAttribute)]
})
export class SwitchPage{
constructor() {
}
}
export * from './checkbox/pages';
export * from './radio/pages';
export * from './range/pages';
export * from './select/pages';
export * from './switch/pages';

View File

@ -0,0 +1,12 @@
import {App, IonicApp, Page} from 'ionic/ionic';
import {forwardRef} from 'angular2/angular2';
import * as helpers from '../../helpers';
@Page({
templateUrl: 'inputs/radio/template.html',
directives: [forwardRef(() => helpers.AndroidAttribute)]
})
export class RadioPage {
constructor() {
}
}

View File

@ -0,0 +1,12 @@
import {Page} from 'ionic/ionic';
import {forwardRef} from 'angular2/angular2';
import {AndroidAttribute} from '../../helpers';
@Page({
templateUrl: 'inputs/range/template.html',
directives: [forwardRef(() => helpers.AndroidAttribute)]
})
export class RangePage{
constructor() {
}
}

View File

@ -0,0 +1,12 @@
import {Page} from 'ionic/ionic';
import {forwardRef} from 'angular2/angular2';
import {AndroidAttribute} from '../../helpers';
@Page({
templateUrl: 'inputs/select/template.html',
directives: [forwardRef(() => helpers.AndroidAttribute)]
})
export class SelectPage{
constructor() {
}
}

View File

@ -0,0 +1,12 @@
import {Page} from 'ionic/ionic';
import {forwardRef} from 'angular2/angular2';
import {AndroidAttribute} from '../../helpers';
@Page({
templateUrl: 'inputs/switch/template.html',
directives: [forwardRef(() => helpers.AndroidAttribute)]
})
export class SwitchPage{
constructor() {
}
}

View File

@ -0,0 +1,24 @@
import {FORM_DIRECTIVES, FormBuilder, forwardRef, Validators, Control, ControlGroup} from 'angular2/angular2';
import {Page} from 'ionic/ionic';
import {AndroidAttribute} from '../../helpers';
@Page({
templateUrl: 'labels/basic/template.html',
providers: [FormBuilder],
directives: [forwardRef(() => AndroidAttribute)]
})
export class BasicPage {
constructor() {
this.form = new ControlGroup({
firstName: new Control("", Validators.required),
lastName: new Control("", Validators.required)
});
}
processForm(event) {
// TODO: display input in a popup
console.log(event);
}
}

View File

@ -0,0 +1,13 @@
import {Page} from 'ionic/ionic';
import {forwardRef} from 'angular2/angular2';
import {AndroidAttribute} from '../../helpers';
@Page({
templateUrl: 'labels/fixed-inline/template.html',
directives: [forwardRef(() => AndroidAttribute)]
})
export class FixedInlinePage {
constructor() {
}
}

View File

@ -0,0 +1,13 @@
import {Page} from 'ionic/ionic';
import {forwardRef} from 'angular2/angular2';
import {AndroidAttribute} from '../../helpers';
@Page({
templateUrl: 'labels/floating/template.html',
directives: [forwardRef(() => AndroidAttribute)]
})
export class FloatingPage {
constructor() {
}
}

View File

@ -0,0 +1,13 @@
import {Page} from 'ionic/ionic';
import {forwardRef} from 'angular2/angular2';
import {AndroidAttribute} from '../../helpers';
@Page({
templateUrl: 'labels/inline/template.html',
directives: [forwardRef(() => AndroidAttribute)]
})
export class InlinePage {
constructor() {
}
}

View File

@ -0,0 +1,13 @@
import {Page} from 'ionic/ionic';
import {forwardRef} from 'angular2/angular2';
import {AndroidAttribute} from '../../helpers';
@Page({
templateUrl: 'labels/inset/template.html',
directives: [forwardRef(() => AndroidAttribute)]
})
export class InsetPage {
constructor() {
}
}

View File

@ -0,0 +1,7 @@
export * from './basic/pages';
export * from './fixed-inline/pages';
export * from './floating/pages';
export * from './inline/pages';
export * from './inset/pages';
export * from './placeholder/pages';
export * from './stacked/pages';

View File

@ -0,0 +1,13 @@
import {Page} from 'ionic/ionic';
import {forwardRef} from 'angular2/angular2';
import {AndroidAttribute} from '../../helpers';
@Page({
templateUrl: 'labels/placeholder/template.html',
directives: [forwardRef(() => AndroidAttribute)]
})
export class PlaceholderPage {
constructor() {
}
}

View File

@ -0,0 +1,13 @@
import {Page} from 'ionic/ionic';
import {forwardRef} from 'angular2/angular2';
import {AndroidAttribute} from '../../helpers';
@Page({
templateUrl: 'labels/stacked/template.html',
directives: [forwardRef(() => AndroidAttribute)]
})
export class StackedPage {
constructor() {
}
}