mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Merge branch 'master' into css-refactor
This commit is contained in:
@@ -9,8 +9,24 @@ import {Animation} from '../../animations/animation';
|
||||
import * as util from 'ionic/util';
|
||||
|
||||
/**
|
||||
* Scroll is a non-flexboxed scroll area that can scroll horizontally or
|
||||
* vertically.
|
||||
* @name Scroll
|
||||
* @description
|
||||
* Scroll is a non-flexboxed scroll area that can scroll horizontally or vertically. `ion-Scroll` Can be used in places were you may not need a full page scroller, but a highly customized one, such as image scubber or comment scroller.
|
||||
* @usage
|
||||
* ```html
|
||||
* <ion-scroll scroll-x="true">
|
||||
* </ion-scroll>
|
||||
*
|
||||
* <ion-scroll scroll-y="true">
|
||||
* </ion-scroll>
|
||||
*
|
||||
* <ion-scroll scroll-x="true" scroll-y="true">
|
||||
* </ion-scroll>
|
||||
* ```
|
||||
*@property {boolean} [scroll-x] - whether to enable scrolling along the X axis
|
||||
*@property {boolean} [scroll-y] - whether to enable scrolling along the Y axis
|
||||
*@property {boolean} [zoom] - whether to enable zooming
|
||||
*@property {number} [max-zoom] - set the max zoom amount for ion-scroll
|
||||
*/
|
||||
@Component({
|
||||
selector: 'ion-scroll',
|
||||
|
||||
@@ -5,10 +5,12 @@ import {Config} from '../../config/config';
|
||||
|
||||
|
||||
/**
|
||||
* @name Segment
|
||||
* @description
|
||||
* A Segment is a group of buttons, sometimes known as Segmented Controls, that allow the user to interact with a compact group of a number of controls.
|
||||
*
|
||||
* Segments provide functionality similar to tabs, selecting one will unselect all others. You should use a tab bar instead of a segmented control when you want to let the user move back and forth between distinct pages in your app.
|
||||
* You could use Angular 2's `ng-model` or `FormBuilder` API. For an overview on how `FormBuilder` works, checkout [Angular 2 Forms](http://learnangular2.com/forms/), or [Angular FormBuilder](https://angular.io/docs/ts/latest/api/common/FormBuilder-class.html)
|
||||
*
|
||||
*
|
||||
* @usage
|
||||
* ```html
|
||||
@@ -20,8 +22,11 @@ import {Config} from '../../config/config';
|
||||
* Enemies
|
||||
* </ion-segment-button>
|
||||
* </ion-segment>
|
||||
*```
|
||||
*
|
||||
* Or with `FormBuilder`
|
||||
*
|
||||
*```html
|
||||
* <form [ng-form-model]="myForm">
|
||||
* <ion-segment ng-control="mapStyle" danger>
|
||||
* <ion-segment-button value="standard">
|
||||
@@ -38,6 +43,7 @@ import {Config} from '../../config/config';
|
||||
* ```
|
||||
*
|
||||
* @see {@link /docs/v2/components#segment Segment Component Docs}
|
||||
* @see [Angular 2 Forms](http://learnangular2.com/forms/)
|
||||
*/
|
||||
@Directive({
|
||||
selector: 'ion-segment'
|
||||
@@ -127,6 +133,43 @@ export class Segment extends Ion {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @name SegmentButton
|
||||
* @description
|
||||
* The child buttons of the `ion-segment` component. Each `ion-segment-button` must have a value.
|
||||
* @property {string} [value] - the value of the segment-button.
|
||||
* @usage
|
||||
* ```html
|
||||
* <ion-segment [(ng-model)]="relationship" danger>
|
||||
* <ion-segment-button value="friends">
|
||||
* Friends
|
||||
* </ion-segment-button>
|
||||
* <ion-segment-button value="enemies">
|
||||
* Enemies
|
||||
* </ion-segment-button>
|
||||
* </ion-segment>
|
||||
*```
|
||||
*
|
||||
* Or with `FormBuilder`
|
||||
*
|
||||
*```html
|
||||
* <form [ng-form-model]="myForm">
|
||||
* <ion-segment ng-control="mapStyle" danger>
|
||||
* <ion-segment-button value="standard">
|
||||
* Standard
|
||||
* </ion-segment-button>
|
||||
* <ion-segment-button value="hybrid">
|
||||
* Hybrid
|
||||
* </ion-segment-button>
|
||||
* <ion-segment-button value="sat">
|
||||
* Satellite
|
||||
* </ion-segment-button>
|
||||
* </ion-segment>
|
||||
* </form>
|
||||
* ```
|
||||
* @see {@link /docs/v2/components#segment Segment Component Docs}
|
||||
* @see {@link /docs/v2/api/components/segment/Segment/ Segment API Docs}
|
||||
*/
|
||||
@Directive({
|
||||
selector: 'ion-segment-button',
|
||||
inputs: [
|
||||
|
||||
@@ -39,7 +39,10 @@ class MediaSwitch {
|
||||
* Switches can also have colors assigned to them, by adding any color attribute to them.
|
||||
*
|
||||
* See the [Angular 2 Docs](https://angular.io/docs/js/latest/api/forms/) for more info on forms and input.
|
||||
*
|
||||
* @property {any} [value] - the inital value of the switch
|
||||
* @property {boolean} [checked] - whether the switch it toggled or not
|
||||
* @property {boolean} [disabled] - whether the switch is disabled or not
|
||||
* @property {string} [id] - a unique ID for a switch
|
||||
* @usage
|
||||
* ```html
|
||||
* // Create a single switch
|
||||
|
||||
Reference in New Issue
Block a user