a zip code crypto-currency system good for red ONLY

range-knob.js 2.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import { Component, EventEmitter, HostListener, Input, Output } from '@angular/core';
  2. import { KEY_DOWN, KEY_LEFT, KEY_RIGHT, KEY_UP } from '../../platform/key';
  3. /**
  4. * @hidden
  5. */
  6. var RangeKnob = (function () {
  7. function RangeKnob() {
  8. this.ionIncrease = new EventEmitter();
  9. this.ionDecrease = new EventEmitter();
  10. }
  11. Object.defineProperty(RangeKnob.prototype, "ratio", {
  12. set: function (r) {
  13. this._x = r * 100 + "%";
  14. },
  15. enumerable: true,
  16. configurable: true
  17. });
  18. RangeKnob.prototype._keyup = function (ev) {
  19. var keyCode = ev.keyCode;
  20. if (keyCode === KEY_LEFT || keyCode === KEY_DOWN) {
  21. (void 0) /* console.debug */;
  22. this.ionDecrease.emit();
  23. ev.preventDefault();
  24. ev.stopPropagation();
  25. }
  26. else if (keyCode === KEY_RIGHT || keyCode === KEY_UP) {
  27. (void 0) /* console.debug */;
  28. this.ionIncrease.emit();
  29. ev.preventDefault();
  30. ev.stopPropagation();
  31. }
  32. };
  33. RangeKnob.decorators = [
  34. { type: Component, args: [{
  35. selector: '.range-knob-handle',
  36. template: '<div class="range-pin" *ngIf="pin" role="presentation">{{val}}</div>' +
  37. '<div class="range-knob" role="presentation"></div>',
  38. host: {
  39. '[class.range-knob-pressed]': 'pressed',
  40. '[class.range-knob-min]': 'val===min||val===undefined',
  41. '[class.range-knob-max]': 'val===max',
  42. '[style.left]': '_x',
  43. '[attr.aria-valuenow]': 'val',
  44. '[attr.aria-valuemin]': 'min',
  45. '[attr.aria-valuemax]': 'max',
  46. '[attr.aria-disabled]': 'disabled',
  47. '[attr.aria-labelledby]': 'labelId',
  48. '[tabindex]': 'disabled?-1:0',
  49. 'role': 'slider'
  50. }
  51. },] },
  52. ];
  53. /** @nocollapse */
  54. RangeKnob.ctorParameters = function () { return []; };
  55. RangeKnob.propDecorators = {
  56. 'ratio': [{ type: Input },],
  57. 'pressed': [{ type: Input },],
  58. 'pin': [{ type: Input },],
  59. 'min': [{ type: Input },],
  60. 'max': [{ type: Input },],
  61. 'val': [{ type: Input },],
  62. 'disabled': [{ type: Input },],
  63. 'labelId': [{ type: Input },],
  64. 'ionIncrease': [{ type: Output },],
  65. 'ionDecrease': [{ type: Output },],
  66. '_keyup': [{ type: HostListener, args: ['keydown', ['$event'],] },],
  67. };
  68. return RangeKnob;
  69. }());
  70. export { RangeKnob };
  71. //# sourceMappingURL=range-knob.js.map