a zip code crypto-currency system good for red ONLY

option.js 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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 Option
  16. * @description
  17. * `ion-option` is a child component of `ion-select`. Similar to the native option element, `ion-option` can take a value and a selected property.
  18. *
  19. * @demo /docs/demos/src/select/
  20. */
  21. var Option = (function () {
  22. function Option(_elementRef) {
  23. this._elementRef = _elementRef;
  24. this._selected = false;
  25. this._disabled = false;
  26. /**
  27. * @output {any} Event to evaluate when option is selected.
  28. */
  29. this.ionSelect = new core_1.EventEmitter();
  30. }
  31. Object.defineProperty(Option.prototype, "disabled", {
  32. /**
  33. * @input {boolean} If true, the user cannot interact with this element.
  34. */
  35. get: function () {
  36. return this._disabled;
  37. },
  38. set: function (val) {
  39. this._disabled = util_1.isTrueProperty(val);
  40. },
  41. enumerable: true,
  42. configurable: true
  43. });
  44. Object.defineProperty(Option.prototype, "selected", {
  45. /**
  46. * @input {boolean} If true, the element is selected.
  47. */
  48. get: function () {
  49. return this._selected;
  50. },
  51. set: function (val) {
  52. this._selected = util_1.isTrueProperty(val);
  53. },
  54. enumerable: true,
  55. configurable: true
  56. });
  57. Object.defineProperty(Option.prototype, "value", {
  58. /**
  59. * @input {any} The value of the option.
  60. */
  61. get: function () {
  62. if (util_1.isPresent(this._value)) {
  63. return this._value;
  64. }
  65. return this.text;
  66. },
  67. set: function (val) {
  68. this._value = val;
  69. },
  70. enumerable: true,
  71. configurable: true
  72. });
  73. Object.defineProperty(Option.prototype, "text", {
  74. /**
  75. * @hidden
  76. */
  77. get: function () {
  78. return this._elementRef.nativeElement.textContent;
  79. },
  80. enumerable: true,
  81. configurable: true
  82. });
  83. Option.decorators = [
  84. { type: core_1.Directive, args: [{
  85. selector: 'ion-option'
  86. },] },
  87. ];
  88. /** @nocollapse */
  89. Option.ctorParameters = function () { return [
  90. { type: core_1.ElementRef, },
  91. ]; };
  92. Option.propDecorators = {
  93. 'disabled': [{ type: core_1.Input },],
  94. 'selected': [{ type: core_1.Input },],
  95. 'value': [{ type: core_1.Input },],
  96. 'ionSelect': [{ type: core_1.Output },],
  97. };
  98. return Option;
  99. }());
  100. exports.Option = Option;
  101. });
  102. //# sourceMappingURL=option.js.map