a zip code crypto-currency system good for red ONLY

label.js 2.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. import { Attribute, Directive, ElementRef, Input, Renderer } from '@angular/core';
  2. import { Config } from '../../config/config';
  3. import { Ion } from '../ion';
  4. /**
  5. * @name Label
  6. * @description
  7. * Labels are placed inside of an `ion-item` element and can be used
  8. * to describe an `ion-input`, `ion-toggle`, `ion-checkbox`, and more.
  9. *
  10. * @property [fixed] - A persistent label that sits next the input.
  11. * @property [floating] - A label that will float above the input if the input is empty or loses focus.
  12. * @property [stacked] - A stacked label will always appear on top of the input.
  13. *
  14. * @usage
  15. * ```html
  16. * <ion-item>
  17. * <ion-label>Username</ion-label>
  18. * <ion-input></ion-input>
  19. * </ion-item>
  20. *
  21. * <ion-item>
  22. * <ion-label fixed>Website</ion-label>
  23. * <ion-input type="url"></ion-input>
  24. * </ion-item>
  25. *
  26. * <ion-item>
  27. * <ion-label floating>Email</ion-label>
  28. * <ion-input type="email"></ion-input>
  29. * </ion-item>
  30. *
  31. * <ion-item>
  32. * <ion-label stacked>Phone</ion-label>
  33. * <ion-input type="tel"></ion-input>
  34. * </ion-item>
  35. *
  36. * <ion-item>
  37. * <ion-label>Toggle</ion-label>
  38. * <ion-toggle></ion-toggle>
  39. * </ion-item>
  40. *
  41. * <ion-item>
  42. * <ion-label>Checkbox</ion-label>
  43. * <ion-checkbox></ion-checkbox>
  44. * </ion-item>
  45. * ```
  46. *
  47. * @demo /docs/demos/src/label/
  48. * @see {@link ../../../../components#inputs Input Component Docs}
  49. * @see {@link ../../input/Input Input API Docs}
  50. *
  51. */
  52. export class Label extends Ion {
  53. constructor(config, elementRef, renderer, isFloating, isStacked, isFixed, isInset) {
  54. super(config, elementRef, renderer, 'label');
  55. this.type = (isFloating === '' ? 'floating' : (isStacked === '' ? 'stacked' : (isFixed === '' ? 'fixed' : (isInset === '' ? 'inset' : null))));
  56. }
  57. /**
  58. * @hidden
  59. */
  60. get id() {
  61. return this._id;
  62. }
  63. set id(val) {
  64. this._id = val;
  65. if (val) {
  66. this.setElementAttribute('id', val);
  67. }
  68. }
  69. /**
  70. * @hidden
  71. */
  72. get text() {
  73. return this.getNativeElement().textContent || '';
  74. }
  75. }
  76. Label.decorators = [
  77. { type: Directive, args: [{
  78. selector: 'ion-label'
  79. },] },
  80. ];
  81. /** @nocollapse */
  82. Label.ctorParameters = () => [
  83. { type: Config, },
  84. { type: ElementRef, },
  85. { type: Renderer, },
  86. { type: undefined, decorators: [{ type: Attribute, args: ['floating',] },] },
  87. { type: undefined, decorators: [{ type: Attribute, args: ['stacked',] },] },
  88. { type: undefined, decorators: [{ type: Attribute, args: ['fixed',] },] },
  89. { type: undefined, decorators: [{ type: Attribute, args: ['inset',] },] },
  90. ];
  91. Label.propDecorators = {
  92. 'id': [{ type: Input },],
  93. };
  94. //# sourceMappingURL=label.js.map