diff --git a/ionic/components/app/test/sink/card.jpg b/ionic/components/app/test/sink/card.jpg new file mode 100644 index 0000000000..9594fcda7b Binary files /dev/null and b/ionic/components/app/test/sink/card.jpg differ diff --git a/ionic/components/app/test/sink/index.js b/ionic/components/app/test/sink/index.js index 40328c6885..a8cd200a54 100644 --- a/ionic/components/app/test/sink/index.js +++ b/ionic/components/app/test/sink/index.js @@ -9,9 +9,16 @@ console.log(Query, QueryList); import {Ionic, Nav, Toolbar, ViewContainer, Aside, List, Item, Content, Button} from 'ionic/ionic'; import {ButtonPage} from './pages/button' +import {NavPage} from './pages/nav' +import {ListPage} from './pages/list' +import {CardPage} from './pages/card' +import {FormPage} from './pages/form' +import {SegmentPage} from './pages/segment' +import {SearchBar} from './pages/search-bar' +import {IconsPage} from './pages/ionicons' +import {AsidePage} from './pages/aside' import {ActionMenuPage} from './pages/action-menu' import {ModalPage} from './pages/modal' -import {ListPage} from './pages/list' @Component({ selector: 'ion-app', @@ -25,8 +32,15 @@ export class IonicApp { Ionic.setRootElementRef(elementRef); this.components = [ + { title: 'Navigation', component: NavPage }, { title: 'Buttons', component: ButtonPage }, { title: 'Lists', component: ListPage }, + { title: 'Cards', component: CardPage }, + { title: 'Forms', component: FormPage }, + { title: 'Segments', component: SegmentPage }, + { title: 'Search Bar', component: SearchBar}, + { title: 'Icons', component: IconsPage }, + { title: 'Aside', component: AsidePage }, { title: 'Action Menu', component: ActionMenuPage }, { title: 'Modal', component: ModalPage } ]; diff --git a/ionic/components/app/test/sink/pages/aside.js b/ionic/components/app/test/sink/pages/aside.js new file mode 100644 index 0000000000..a0e56adb09 --- /dev/null +++ b/ionic/components/app/test/sink/pages/aside.js @@ -0,0 +1,42 @@ +import {NgFor, DynamicComponentLoader, Injector, DomRenderer, ElementRef} from 'angular2/angular2'; +import {Ancestor} from 'angular2/src/core/annotations_impl/visibility'; +import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations'; +import {View} from 'angular2/src/core/annotations_impl/view'; + +import {List, Item, ActionMenu, Modal, ModalRef, + NavbarTemplate, Navbar, NavController, Button, Content} from 'ionic/ionic'; + +@Component({ + selector: 'ion-view' +}) +@View({ + template: ` + Asides + + +

Aside

+

+ Asides, also known as side menus or "hamburger" menus, are menus that slide + or swipe in to show menus or information. +

+

+ Try it! Just swipe from the left edge of the screen to the right to expose + the app menu. +

+

+

+

+

+ +

+
+ `, + directives: [NavbarTemplate, Navbar, Content, List, Item] +}) +export class AsidePage { + constructor() { + } + openMenu() { + + } +} diff --git a/ionic/components/app/test/sink/pages/card.js b/ionic/components/app/test/sink/pages/card.js new file mode 100644 index 0000000000..d9a1923245 --- /dev/null +++ b/ionic/components/app/test/sink/pages/card.js @@ -0,0 +1,58 @@ +import {NgFor, DynamicComponentLoader, Injector, DomRenderer, ElementRef} from 'angular2/angular2'; +import {Ancestor} from 'angular2/src/core/annotations_impl/visibility'; +import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations'; +import {View} from 'angular2/src/core/annotations_impl/view'; + +import {List, Item, ActionMenu, Modal, ModalRef, + NavbarTemplate, Navbar, NavController, Button, Content} from 'ionic/ionic'; + +@Component({ + selector: 'ion-view' +}) +@View({ + template: ` + Cards + + +

Cards

+

+ Cards are an emerging UI concept where a bit of content is displayed + like it would be on an index card or a piece of paper. +

+

+ Cards are great for displaying contextual informaion in a small amount of space, + like a Tweet, today's weather report, and a photo. +

+
+ +
+
+
+ Card Header +
+
+
+ +
+
+ +
+
+ + + +
+
+ `, + directives: [NavbarTemplate, Navbar, Content, List, Item] +}) +export class CardPage { + constructor() { + } +} diff --git a/ionic/components/app/test/sink/pages/form.js b/ionic/components/app/test/sink/pages/form.js new file mode 100644 index 0000000000..85089e93c3 --- /dev/null +++ b/ionic/components/app/test/sink/pages/form.js @@ -0,0 +1,33 @@ +import {NgFor, DynamicComponentLoader, Injector, DomRenderer, ElementRef} from 'angular2/angular2'; +import {Ancestor} from 'angular2/src/core/annotations_impl/visibility'; +import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations'; +import {View} from 'angular2/src/core/annotations_impl/view'; + +import {List, Item, ActionMenu, Modal, ModalRef, + NavbarTemplate, Navbar, NavController, Button, Content} from 'ionic/ionic'; + +@Component({ + selector: 'ion-view' +}) +@View({ + template: ` + Cards + + +

Forms

+

+ Forms help you gather important information from the user, like + login information or content to send to your server. +

+

+ Ionic comes with a variety of useful from controls, like + text inputs, text areas, toggle switches, and sliders. +

+
+ `, + directives: [NavbarTemplate, Navbar, Content, List, Item] +}) +export class FormPage { + constructor() { + } +} diff --git a/ionic/components/app/test/sink/pages/ionicons.js b/ionic/components/app/test/sink/pages/ionicons.js new file mode 100644 index 0000000000..4cca3aab0a --- /dev/null +++ b/ionic/components/app/test/sink/pages/ionicons.js @@ -0,0 +1,35 @@ +import {NgFor, DynamicComponentLoader, Injector, DomRenderer, ElementRef} from 'angular2/angular2'; +import {Ancestor} from 'angular2/src/core/annotations_impl/visibility'; +import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations'; +import {View} from 'angular2/src/core/annotations_impl/view'; + +import {List, Item, ActionMenu, Modal, ModalRef, + NavbarTemplate, Navbar, NavController, Button, Content} from 'ionic/ionic'; + +@Component({ + selector: 'ion-view' +}) +@View({ + template: ` + Ionicons + + +

Ionicons

+

+ Ionic comes with a totally free (in price and license), icon pack with over 700 + icons for your app. +

+

+ Ionicons is an icon font, and can be used with simple CSS icon classes (recommended), or + with unicode characters. +

+
+
+
+ `, + directives: [NavbarTemplate, Navbar, Content, List, Item] +}) +export class IconsPage { + constructor() { + } +} diff --git a/ionic/components/app/test/sink/pages/nav.js b/ionic/components/app/test/sink/pages/nav.js new file mode 100644 index 0000000000..81175c4a61 --- /dev/null +++ b/ionic/components/app/test/sink/pages/nav.js @@ -0,0 +1,58 @@ +import {NgFor, DynamicComponentLoader, Injector, DomRenderer, ElementRef} from 'angular2/angular2'; +import {Ancestor} from 'angular2/src/core/annotations_impl/visibility'; +import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations'; +import {View} from 'angular2/src/core/annotations_impl/view'; + +import {List, Item, ActionMenu, Modal, ModalRef, + NavbarTemplate, Navbar, NavController, Button, Content} from 'ionic/ionic'; + +@Component({ + selector: 'ion-view' +}) +@View({ + template: ` + Cards + + +

Navigation

+

+ Navigation makes your app feel like, well, an app! +

+

+ With the navigation features in Ionic, we can navigate to new pages, + go back in history (including swipe-to-go-back), and control the stack + of pages the user can navigate between. +

+ +
+ `, + directives: [NavbarTemplate, Navbar, Content, List, Item, Button] +}) +export class NavPage { + constructor(nav: NavController) { + this.nav = nav; + } + push() { + this.nav.push(NavSecondPage); + } +} + +@Component({selector: 'ion-view'}) +@View({ + template: ` + Second Page + + + + `, + directives: [NavbarTemplate, Navbar, Content, Button] +}) +export class NavSecondPage { + constructor(nav: NavController) { + this.nav = nav; + } + + pop() { + this.nav.pop(); + } +} diff --git a/ionic/components/app/test/sink/pages/search-bar.js b/ionic/components/app/test/sink/pages/search-bar.js new file mode 100644 index 0000000000..f9f16ea1d7 --- /dev/null +++ b/ionic/components/app/test/sink/pages/search-bar.js @@ -0,0 +1,41 @@ +import {NgFor, DynamicComponentLoader, Injector, DomRenderer, ElementRef} from 'angular2/angular2'; +import {Ancestor} from 'angular2/src/core/annotations_impl/visibility'; +import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations'; +import {View} from 'angular2/src/core/annotations_impl/view'; +import {FormBuilder, Validators, FormDirectives, ControlGroup} from 'angular2/forms'; + +import {Segment, SegmentButton, List, Item, ActionMenu, Modal, ModalRef, + NavbarTemplate, Navbar, NavController, Button, Content} from 'ionic/ionic'; + +@Component({ + selector: 'ion-view' +}) +@View({ + template: ` + Cards + + +

Search Bar

+

+ The Search Bar is a multi-function search component. +

+

+ The bar can sit standalone as part of a form or header search, + or it can also handle and display a list of search results. +

+ +
+
+
+ `, + directives: [NavbarTemplate, Navbar, Content, List, Item, Segment, SegmentButton] +}) +export class SegmentPage { + constructor() { + var fb = new FormBuilder(); + this.form = fb.group({ + mapStyle: ['hybrid', Validators.required] + }); + + } +} diff --git a/ionic/components/app/test/sink/pages/segment.js b/ionic/components/app/test/sink/pages/segment.js new file mode 100644 index 0000000000..99ad6341fd --- /dev/null +++ b/ionic/components/app/test/sink/pages/segment.js @@ -0,0 +1,85 @@ +import {NgFor, DynamicComponentLoader, Injector, DomRenderer, ElementRef} from 'angular2/angular2'; +import {Ancestor} from 'angular2/src/core/annotations_impl/visibility'; +import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations'; +import {View} from 'angular2/src/core/annotations_impl/view'; +import {FormBuilder, Validators, formDirectives, ControlGroup} from 'angular2/forms'; + +import {Segment, SegmentButton, List, Item, ActionMenu, Modal, ModalRef, + NavbarTemplate, Navbar, NavController, Button, Content} from 'ionic/ionic'; + +console.log('imporrted', formDirectives, Segment, SegmentButton); + +@Component({ + selector: 'ion-view' +}) +@View({ + template: ` + Cards + + +

Segment

+

+ A segment is a radio-style filter bar to let the user toggle between + multiple, exclusive options. +

+

+ Segments are useful for quick filtering, like switching the + the map display between street, hybrid, and satellite. +

+ +
+ + + + Standard + + + Hybrid + + + Satellite + + + + + +
+ + Map mode: {{form.controls.mapStyle.value}} + +
+
+

Standard

+
+
+

Hybrid

+
+
+

Satellite!!

+
+
+
+ `, + directives: [NavbarTemplate, Navbar, Content, List, Item, Button, Segment, SegmentButton, formDirectives] +}) +export class SegmentPage { + constructor() { + var fb = new FormBuilder(); + this.form = fb.group({ + mapStyle: ['hybrid', Validators.required] + }); + + } +} diff --git a/ionic/components/item/item.scss b/ionic/components/item/item.scss index 4001d74364..21f4b2944a 100644 --- a/ionic/components/item/item.scss +++ b/ionic/components/item/item.scss @@ -95,6 +95,7 @@ ion-primary-swipe-buttons { flex-wrap: nowrap; align-items: center; + max-width: 100%; min-height: $item-min-height; padding: 0;