UI for Zipcoin Blue

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import { Directive, ElementRef, EventEmitter, Input, Output } from '@angular/core';
  2. import { Platform } from '../../platform/platform';
  3. import { isRightSide } from '../../util/util';
  4. /**
  5. * @name ItemOptions
  6. * @description
  7. * The option buttons for an `ion-item-sliding`. These buttons can be placed either on the left or right side.
  8. * You can combine the `(ionSwipe)` event plus the `expandable` directive to create a full swipe action for the item.
  9. *
  10. * @usage
  11. *
  12. * ```html
  13. * <ion-item-sliding>
  14. * <ion-item>
  15. * Item 1
  16. * </ion-item>
  17. * <ion-item-options side="right" (ionSwipe)="saveItem(item)">
  18. * <button ion-button expandable (click)="saveItem(item)">
  19. * <ion-icon name="star"></ion-icon>
  20. * </button>
  21. * </ion-item-options>
  22. * </ion-item-sliding>
  23. *```
  24. */
  25. var ItemOptions = (function () {
  26. function ItemOptions(_elementRef, _plt) {
  27. this._elementRef = _elementRef;
  28. this._plt = _plt;
  29. /**
  30. * @output {event} Emitted when the item has been fully swiped.
  31. */
  32. this.ionSwipe = new EventEmitter();
  33. }
  34. /**
  35. * @hidden
  36. */
  37. ItemOptions.prototype.isRightSide = function () {
  38. return isRightSide(this.side, this._plt.isRTL, true);
  39. };
  40. /**
  41. * @hidden
  42. */
  43. ItemOptions.prototype.width = function () {
  44. return this._elementRef.nativeElement.offsetWidth;
  45. };
  46. ItemOptions.decorators = [
  47. { type: Directive, args: [{
  48. selector: 'ion-item-options',
  49. },] },
  50. ];
  51. /** @nocollapse */
  52. ItemOptions.ctorParameters = function () { return [
  53. { type: ElementRef, },
  54. { type: Platform, },
  55. ]; };
  56. ItemOptions.propDecorators = {
  57. 'side': [{ type: Input },],
  58. 'ionSwipe': [{ type: Output },],
  59. };
  60. return ItemOptions;
  61. }());
  62. export { ItemOptions };
  63. //# sourceMappingURL=item-options.js.map