123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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", "../../config/config", "../ion"], 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 config_1 = require("../../config/config");
  24. var ion_1 = require("../ion");
  25. /**
  26. * @name Chip
  27. * @module ionic
  28. * @description
  29. * Chips represent complex entities in small blocks, such as a contact.
  30. *
  31. *
  32. * @usage
  33. *
  34. * ```html
  35. * <ion-chip>
  36. * <ion-label>Default</ion-label>
  37. * </ion-chip>
  38. *
  39. * <ion-chip>
  40. * <ion-label color="secondary">Secondary Label</ion-label>
  41. * </ion-chip>
  42. *
  43. * <ion-chip color="secondary">
  44. * <ion-label color="dark">Secondary w/ Dark label</ion-label>
  45. * </ion-chip>
  46. *
  47. * <ion-chip color="danger">
  48. * <ion-label>Danger</ion-label>
  49. * </ion-chip>
  50. *
  51. * <ion-chip>
  52. * <ion-icon name="pin"></ion-icon>
  53. * <ion-label>Default</ion-label>
  54. * </ion-chip>
  55. *
  56. * <ion-chip>
  57. * <ion-icon name="heart" color="dark"></ion-icon>
  58. * <ion-label>Default</ion-label>
  59. * </ion-chip>
  60. *
  61. * <ion-chip>
  62. * <ion-avatar>
  63. * <img src="assets/img/my-img.png">
  64. * </ion-avatar>
  65. * <ion-label>Default</ion-label>
  66. * </ion-chip>
  67. * ```
  68. *
  69. *
  70. * @advanced
  71. *
  72. * ```html
  73. * <ion-chip #chip1>
  74. * <ion-label>Default</ion-label>
  75. * <button ion-button clear color="light" (click)="delete(chip1)">
  76. * <ion-icon name="close-circle"></ion-icon>
  77. * </button>
  78. * </ion-chip>
  79. *
  80. * <ion-chip #chip2>
  81. * <ion-icon name="pin" color="primary"></ion-icon>
  82. * <ion-label>With Icon</ion-label>
  83. * <button ion-button (click)="delete(chip2)">
  84. * <ion-icon name="close"></ion-icon>
  85. * </button>
  86. * </ion-chip>
  87. *
  88. * <ion-chip #chip3>
  89. * <ion-avatar>
  90. * <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAAAAACH5BAAAAAAALAAAAAABAAEAAAICTAEAOw==">
  91. * </ion-avatar>
  92. * <ion-label>With Avatar</ion-label>
  93. * <button ion-button clear color="dark" (click)="delete(chip3)">
  94. * <ion-icon name="close-circle"></ion-icon>
  95. * </button>
  96. * </ion-chip>
  97. * ```
  98. *
  99. * ```ts
  100. * @Component({
  101. * templateUrl: 'main.html'
  102. * })
  103. * class E2EPage {
  104. * delete(chip: Element) {
  105. * chip.remove();
  106. * }
  107. * }
  108. * ```
  109. *
  110. * @demo /docs/demos/src/chip/
  111. **/
  112. var Chip = (function (_super) {
  113. __extends(Chip, _super);
  114. function Chip(config, elementRef, renderer) {
  115. return _super.call(this, config, elementRef, renderer, 'chip') || this;
  116. }
  117. Chip.decorators = [
  118. { type: core_1.Directive, args: [{
  119. selector: 'ion-chip'
  120. },] },
  121. ];
  122. /** @nocollapse */
  123. Chip.ctorParameters = function () { return [
  124. { type: config_1.Config, },
  125. { type: core_1.ElementRef, },
  126. { type: core_1.Renderer, },
  127. ]; };
  128. return Chip;
  129. }(ion_1.Ion));
  130. exports.Chip = Chip;
  131. });
  132. //# sourceMappingURL=chip.js.map