a zip code crypto-currency system good for red ONLY

form.js 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import { Injectable } from '@angular/core';
  2. import { removeArrayItem } from './util';
  3. /**
  4. * @hidden
  5. */
  6. var Form = (function () {
  7. function Form() {
  8. this._focused = null;
  9. this._ids = -1;
  10. this._inputs = [];
  11. }
  12. Form.prototype.register = function (input) {
  13. this._inputs.push(input);
  14. };
  15. Form.prototype.deregister = function (input) {
  16. removeArrayItem(this._inputs, input);
  17. this.unsetAsFocused(input);
  18. };
  19. Form.prototype.setAsFocused = function (input) {
  20. this._focused = input;
  21. };
  22. Form.prototype.unsetAsFocused = function (input) {
  23. if (input === this._focused) {
  24. this._focused = null;
  25. }
  26. };
  27. /**
  28. * Focuses the next input element, if it exists.
  29. */
  30. Form.prototype.tabFocus = function (currentInput) {
  31. var inputs = this._inputs;
  32. var index = inputs.indexOf(currentInput) + 1;
  33. if (index > 0 && index < inputs.length) {
  34. var nextInput = inputs[index];
  35. if (nextInput !== this._focused) {
  36. (void 0) /* console.debug */;
  37. return nextInput.initFocus();
  38. }
  39. }
  40. index = inputs.indexOf(this._focused);
  41. if (index > 0) {
  42. var previousInput = inputs[index - 1];
  43. if (previousInput) {
  44. (void 0) /* console.debug */;
  45. previousInput.initFocus();
  46. }
  47. }
  48. };
  49. Form.prototype.nextId = function () {
  50. return ++this._ids;
  51. };
  52. Form.decorators = [
  53. { type: Injectable },
  54. ];
  55. /** @nocollapse */
  56. Form.ctorParameters = function () { return []; };
  57. return Form;
  58. }());
  59. export { Form };
  60. /**
  61. * @hidden
  62. */
  63. var IonicTapInput = (function () {
  64. function IonicTapInput() {
  65. }
  66. return IonicTapInput;
  67. }());
  68. export { IonicTapInput };
  69. /**
  70. * @hidden
  71. */
  72. var IonicFormInput = (function () {
  73. function IonicFormInput() {
  74. }
  75. return IonicFormInput;
  76. }());
  77. export { IonicFormInput };
  78. //# sourceMappingURL=form.js.map