a zip code crypto-currency system good for red ONLY

segment.js 5.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. var __extends = (this && this.__extends) || (function () {
  2. var extendStatics = Object.setPrototypeOf ||
  3. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  4. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  5. return function (d, b) {
  6. extendStatics(d, b);
  7. function __() { this.constructor = d; }
  8. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  9. };
  10. })();
  11. (function (factory) {
  12. if (typeof module === "object" && typeof module.exports === "object") {
  13. var v = factory(require, exports);
  14. if (v !== undefined) module.exports = v;
  15. }
  16. else if (typeof define === "function" && define.amd) {
  17. define(["require", "exports", "@angular/core", "@angular/forms", "../../config/config", "../../util/base-input", "./segment-button"], factory);
  18. }
  19. })(function (require, exports) {
  20. "use strict";
  21. Object.defineProperty(exports, "__esModule", { value: true });
  22. var core_1 = require("@angular/core");
  23. var forms_1 = require("@angular/forms");
  24. var config_1 = require("../../config/config");
  25. var base_input_1 = require("../../util/base-input");
  26. var segment_button_1 = require("./segment-button");
  27. /**
  28. * @name Segment
  29. * @description
  30. * 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.
  31. * 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.
  32. * You could use Angular's `ngModel` or `FormBuilder` API. For an overview on how `FormBuilder` works, checkout [Angular Forms](http://learnangular2.com/forms/), or [Angular FormBuilder](https://angular.io/docs/ts/latest/api/forms/index/FormBuilder-class.html)
  33. *
  34. *
  35. * ```html
  36. * <!-- Segment in a header -->
  37. * <ion-header>
  38. * <ion-toolbar>
  39. * <ion-segment [(ngModel)]="icons" color="secondary">
  40. * <ion-segment-button value="camera">
  41. * <ion-icon name="camera"></ion-icon>
  42. * </ion-segment-button>
  43. * <ion-segment-button value="bookmark">
  44. * <ion-icon name="bookmark"></ion-icon>
  45. * </ion-segment-button>
  46. * </ion-segment>
  47. * </ion-toolbar>
  48. * </ion-header>
  49. *
  50. * <ion-content>
  51. * <!-- Segment in content -->
  52. * <ion-segment [(ngModel)]="relationship" color="primary" (ionChange)="segmentChanged($event)">
  53. * <ion-segment-button value="friends">
  54. * Friends
  55. * </ion-segment-button>
  56. * <ion-segment-button value="enemies">
  57. * Enemies
  58. * </ion-segment-button>
  59. * </ion-segment>
  60. *
  61. * <!-- Segment in a form -->
  62. * <form [formGroup]="myForm">
  63. * <ion-segment formControlName="mapStyle" color="danger">
  64. * <ion-segment-button value="standard">
  65. * Standard
  66. * </ion-segment-button>
  67. * <ion-segment-button value="hybrid">
  68. * Hybrid
  69. * </ion-segment-button>
  70. * <ion-segment-button value="sat">
  71. * Satellite
  72. * </ion-segment-button>
  73. * </ion-segment>
  74. * </form>
  75. * </ion-content>
  76. * ```
  77. *
  78. *
  79. * @demo /docs/demos/src/segment/
  80. * @see {@link /docs/components#segment Segment Component Docs}
  81. * @see [Angular Forms](http://learnangular2.com/forms/)
  82. */
  83. var Segment = (function (_super) {
  84. __extends(Segment, _super);
  85. function Segment(config, elementRef, renderer, ngControl) {
  86. return _super.call(this, config, elementRef, renderer, 'segment', null, null, null, ngControl) || this;
  87. }
  88. /**
  89. * @hidden
  90. */
  91. Segment.prototype.ngAfterContentInit = function () {
  92. var _this = this;
  93. this._initialize();
  94. this._buttons.forEach(function (button) {
  95. button.ionSelect.subscribe(function (selectedButton) {
  96. _this.value = selectedButton.value;
  97. _this._fireTouched();
  98. });
  99. });
  100. };
  101. /**
  102. * @hidden
  103. * Write a new value to the element.
  104. */
  105. Segment.prototype._inputUpdated = function () {
  106. if (!this._buttons) {
  107. (void 0) /* assert */;
  108. return;
  109. }
  110. var buttons = this._buttons.toArray();
  111. var value = this.value;
  112. for (var _i = 0, buttons_1 = buttons; _i < buttons_1.length; _i++) {
  113. var button = buttons_1[_i];
  114. button.isActive = (button.value === value);
  115. }
  116. };
  117. Segment.decorators = [
  118. { type: core_1.Directive, args: [{
  119. selector: 'ion-segment',
  120. host: {
  121. '[class.segment-disabled]': '_disabled'
  122. }
  123. },] },
  124. ];
  125. /** @nocollapse */
  126. Segment.ctorParameters = function () { return [
  127. { type: config_1.Config, },
  128. { type: core_1.ElementRef, },
  129. { type: core_1.Renderer, },
  130. { type: forms_1.NgControl, decorators: [{ type: core_1.Optional },] },
  131. ]; };
  132. Segment.propDecorators = {
  133. '_buttons': [{ type: core_1.ContentChildren, args: [segment_button_1.SegmentButton,] },],
  134. };
  135. return Segment;
  136. }(base_input_1.BaseInput));
  137. exports.Segment = Segment;
  138. });
  139. //# sourceMappingURL=segment.js.map