a zip code crypto-currency system good for red ONLY

scroll.js 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. import { ChangeDetectionStrategy, Component, ElementRef, Input, ViewChild, ViewEncapsulation } from '@angular/core';
  2. import { isTrueProperty } from '../../util/util';
  3. /**
  4. * @name Scroll
  5. * @description
  6. * Scroll is a non-flexboxed scroll area that can scroll horizontally or vertically. `ion-Scroll` Can be used in places where you may not need a full page scroller, but a highly customized one, such as image scubber or comment scroller.
  7. * @usage
  8. * ```html
  9. * <ion-scroll scrollX="true">
  10. * </ion-scroll>
  11. *
  12. * <ion-scroll scrollY="true">
  13. * </ion-scroll>
  14. *
  15. * <ion-scroll scrollX="true" scrollY="true">
  16. * </ion-scroll>
  17. * ```
  18. * @demo /docs/demos/src/scroll/
  19. */
  20. export class Scroll {
  21. constructor() {
  22. this._scrollX = false;
  23. this._scrollY = false;
  24. this._zoom = false;
  25. this._maxZoom = 1;
  26. /**
  27. * @hidden
  28. */
  29. this.maxScale = 3;
  30. /**
  31. * @hidden
  32. */
  33. this.zoomDuration = 250;
  34. }
  35. /**
  36. * @input {boolean} If true, scrolling along the X axis is enabled.
  37. */
  38. get scrollX() {
  39. return this._scrollX;
  40. }
  41. set scrollX(val) {
  42. this._scrollX = isTrueProperty(val);
  43. }
  44. /**
  45. * @input {boolean} If true, scrolling along the Y axis is enabled; requires the following CSS declaration: ion-scroll { white-space: nowrap; }
  46. */
  47. get scrollY() {
  48. return this._scrollY;
  49. }
  50. set scrollY(val) {
  51. this._scrollY = isTrueProperty(val);
  52. }
  53. /**
  54. * @input {boolean} If true, zooming is enabled.
  55. */
  56. get zoom() {
  57. return this._zoom;
  58. }
  59. set zoom(val) {
  60. this._zoom = isTrueProperty(val);
  61. }
  62. /**
  63. * @input {number} Set the max zoom amount.
  64. */
  65. get maxZoom() {
  66. return this._maxZoom;
  67. }
  68. set maxZoom(val) {
  69. this._maxZoom = val;
  70. }
  71. /**
  72. * @hidden
  73. * Add a scroll event handler to the scroll element if it exists.
  74. * @param {Function} handler The scroll handler to add to the scroll element.
  75. * @returns {?Function} a function to remove the specified handler, otherwise
  76. * undefined if the scroll element doesn't exist.
  77. */
  78. addScrollEventListener(handler) {
  79. (void 0) /* assert */;
  80. const ele = this._scrollContent.nativeElement;
  81. ele.addEventListener('scroll', handler);
  82. return () => {
  83. ele.removeEventListener('scroll', handler);
  84. };
  85. }
  86. }
  87. Scroll.decorators = [
  88. { type: Component, args: [{
  89. selector: 'ion-scroll',
  90. template: '<div class="scroll-content" #scrollContent>' +
  91. '<div class="scroll-zoom-wrapper">' +
  92. '<ng-content></ng-content>' +
  93. '</div>' +
  94. '</div>',
  95. host: {
  96. '[class.scroll-x]': 'scrollX',
  97. '[class.scroll-y]': 'scrollY'
  98. },
  99. changeDetection: ChangeDetectionStrategy.OnPush,
  100. encapsulation: ViewEncapsulation.None,
  101. },] },
  102. ];
  103. /** @nocollapse */
  104. Scroll.ctorParameters = () => [];
  105. Scroll.propDecorators = {
  106. 'scrollX': [{ type: Input },],
  107. 'scrollY': [{ type: Input },],
  108. 'zoom': [{ type: Input },],
  109. 'maxZoom': [{ type: Input },],
  110. '_scrollContent': [{ type: ViewChild, args: ['scrollContent', { read: ElementRef },] },],
  111. };
  112. //# sourceMappingURL=scroll.js.map