a zip code crypto-currency system good for red ONLY

segment-button.js 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. (function (factory) {
  2. if (typeof module === "object" && typeof module.exports === "object") {
  3. var v = factory(require, exports);
  4. if (v !== undefined) module.exports = v;
  5. }
  6. else if (typeof define === "function" && define.amd) {
  7. define(["require", "exports", "@angular/core", "../../util/util"], factory);
  8. }
  9. })(function (require, exports) {
  10. "use strict";
  11. Object.defineProperty(exports, "__esModule", { value: true });
  12. var core_1 = require("@angular/core");
  13. var util_1 = require("../../util/util");
  14. /**
  15. * @name SegmentButton
  16. * @description
  17. * The child buttons of the `ion-segment` component. Each `ion-segment-button` must have a value.
  18. *
  19. * @usage
  20. *
  21. * ```html
  22. * <ion-content>
  23. * <!-- Segment buttons with icons -->
  24. * <ion-segment [(ngModel)]="icons" color="secondary">
  25. * <ion-segment-button value="camera">
  26. * <ion-icon name="camera"></ion-icon>
  27. * </ion-segment-button>
  28. * <ion-segment-button value="bookmark">
  29. * <ion-icon name="bookmark"></ion-icon>
  30. * </ion-segment-button>
  31. * </ion-segment>
  32. *
  33. * <!-- Segment buttons with text -->
  34. * <ion-segment [(ngModel)]="relationship" color="primary">
  35. * <ion-segment-button value="friends" (ionSelect)="selectedFriends()">
  36. * Friends
  37. * </ion-segment-button>
  38. * <ion-segment-button value="enemies" (ionSelect)="selectedEnemies()">
  39. * Enemies
  40. * </ion-segment-button>
  41. * </ion-segment>
  42. * </ion-content>
  43. * ```
  44. *
  45. *
  46. * @demo /docs/demos/src/segment/
  47. * @see {@link /docs/components#segment Segment Component Docs}
  48. * @see {@link /docs/api/components/segment/Segment/ Segment API Docs}
  49. */
  50. var SegmentButton = (function () {
  51. function SegmentButton() {
  52. this.isActive = false;
  53. this._disabled = false;
  54. /**
  55. * @output {SegmentButton} Emitted when a segment button has been clicked.
  56. */
  57. this.ionSelect = new core_1.EventEmitter();
  58. }
  59. Object.defineProperty(SegmentButton.prototype, "disabled", {
  60. /**
  61. * @input {boolean} If true, the user cannot interact with this element.
  62. */
  63. get: function () {
  64. return this._disabled;
  65. },
  66. set: function (val) {
  67. this._disabled = util_1.isTrueProperty(val);
  68. },
  69. enumerable: true,
  70. configurable: true
  71. });
  72. /**
  73. * @hidden
  74. * On click of a SegmentButton
  75. */
  76. SegmentButton.prototype.onClick = function () {
  77. (void 0) /* console.debug */;
  78. this.ionSelect.emit(this);
  79. };
  80. /**
  81. * @hidden
  82. */
  83. SegmentButton.prototype.ngOnInit = function () {
  84. if (!util_1.isPresent(this.value)) {
  85. console.warn('<ion-segment-button> requires a "value" attribute');
  86. }
  87. };
  88. SegmentButton.decorators = [
  89. { type: core_1.Component, args: [{
  90. selector: 'ion-segment-button',
  91. template: '<ng-content></ng-content>' +
  92. '<div class="button-effect"></div>',
  93. host: {
  94. 'tappable': '',
  95. 'class': 'segment-button',
  96. 'role': 'button',
  97. '[class.segment-button-disabled]': '_disabled',
  98. '[class.segment-activated]': 'isActive',
  99. '[attr.aria-pressed]': 'isActive'
  100. },
  101. encapsulation: core_1.ViewEncapsulation.None,
  102. },] },
  103. ];
  104. /** @nocollapse */
  105. SegmentButton.ctorParameters = function () { return []; };
  106. SegmentButton.propDecorators = {
  107. 'value': [{ type: core_1.Input },],
  108. 'ionSelect': [{ type: core_1.Output },],
  109. 'disabled': [{ type: core_1.Input },],
  110. 'onClick': [{ type: core_1.HostListener, args: ['click',] },],
  111. };
  112. return SegmentButton;
  113. }());
  114. exports.SegmentButton = SegmentButton;
  115. });
  116. //# sourceMappingURL=segment-button.js.map