refresher-content.js 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import { Component, Input, ViewEncapsulation } from '@angular/core';
  2. import { Config } from '../../config/config';
  3. import { Refresher } from './refresher';
  4. /**
  5. * @hidden
  6. */
  7. export class RefresherContent {
  8. constructor(r, _config) {
  9. this.r = r;
  10. this._config = _config;
  11. }
  12. /**
  13. * @hidden
  14. */
  15. ngOnInit() {
  16. if (!this.pullingIcon) {
  17. this.pullingIcon = this._config.get('ionPullIcon', 'arrow-down');
  18. }
  19. if (!this.refreshingSpinner) {
  20. this.refreshingSpinner = this._config.get('ionRefreshingSpinner', this._config.get('spinner', 'ios'));
  21. }
  22. }
  23. }
  24. RefresherContent.decorators = [
  25. { type: Component, args: [{
  26. selector: 'ion-refresher-content',
  27. template: '<div class="refresher-pulling">' +
  28. '<div class="refresher-pulling-icon" *ngIf="pullingIcon">' +
  29. '<ion-icon [name]="pullingIcon"></ion-icon>' +
  30. '</div>' +
  31. '<div class="refresher-pulling-text" [innerHTML]="pullingText" *ngIf="pullingText"></div>' +
  32. '</div>' +
  33. '<div class="refresher-refreshing">' +
  34. '<div class="refresher-refreshing-icon">' +
  35. '<ion-spinner [name]="refreshingSpinner"></ion-spinner>' +
  36. '</div>' +
  37. '<div class="refresher-refreshing-text" [innerHTML]="refreshingText" *ngIf="refreshingText"></div>' +
  38. '</div>',
  39. host: {
  40. '[attr.state]': 'r.state'
  41. },
  42. encapsulation: ViewEncapsulation.None,
  43. },] },
  44. ];
  45. /** @nocollapse */
  46. RefresherContent.ctorParameters = () => [
  47. { type: Refresher, },
  48. { type: Config, },
  49. ];
  50. RefresherContent.propDecorators = {
  51. 'pullingIcon': [{ type: Input },],
  52. 'pullingText': [{ type: Input },],
  53. 'refreshingSpinner': [{ type: Input },],
  54. 'refreshingText': [{ type: Input },],
  55. };
  56. //# sourceMappingURL=refresher-content.js.map