a zip code crypto-currency system good for red ONLY

form.js 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. (function (factory) {
  2. if (typeof module === "object" && typeof module.exports === "object") {
  3. var v = factory(require, exports);
  4. if (v !== undefined) module.exports = v;
  5. }
  6. else if (typeof define === "function" && define.amd) {
  7. define(["require", "exports", "@angular/core", "./util"], factory);
  8. }
  9. })(function (require, exports) {
  10. "use strict";
  11. Object.defineProperty(exports, "__esModule", { value: true });
  12. var core_1 = require("@angular/core");
  13. var util_1 = require("./util");
  14. /**
  15. * @hidden
  16. */
  17. var Form = (function () {
  18. function Form() {
  19. this._focused = null;
  20. this._ids = -1;
  21. this._inputs = [];
  22. }
  23. Form.prototype.register = function (input) {
  24. this._inputs.push(input);
  25. };
  26. Form.prototype.deregister = function (input) {
  27. util_1.removeArrayItem(this._inputs, input);
  28. this.unsetAsFocused(input);
  29. };
  30. Form.prototype.setAsFocused = function (input) {
  31. this._focused = input;
  32. };
  33. Form.prototype.unsetAsFocused = function (input) {
  34. if (input === this._focused) {
  35. this._focused = null;
  36. }
  37. };
  38. /**
  39. * Focuses the next input element, if it exists.
  40. */
  41. Form.prototype.tabFocus = function (currentInput) {
  42. var inputs = this._inputs;
  43. var index = inputs.indexOf(currentInput) + 1;
  44. if (index > 0 && index < inputs.length) {
  45. var nextInput = inputs[index];
  46. if (nextInput !== this._focused) {
  47. (void 0) /* console.debug */;
  48. return nextInput.initFocus();
  49. }
  50. }
  51. index = inputs.indexOf(this._focused);
  52. if (index > 0) {
  53. var previousInput = inputs[index - 1];
  54. if (previousInput) {
  55. (void 0) /* console.debug */;
  56. previousInput.initFocus();
  57. }
  58. }
  59. };
  60. Form.prototype.nextId = function () {
  61. return ++this._ids;
  62. };
  63. Form.decorators = [
  64. { type: core_1.Injectable },
  65. ];
  66. /** @nocollapse */
  67. Form.ctorParameters = function () { return []; };
  68. return Form;
  69. }());
  70. exports.Form = Form;
  71. /**
  72. * @hidden
  73. */
  74. var IonicTapInput = (function () {
  75. function IonicTapInput() {
  76. }
  77. return IonicTapInput;
  78. }());
  79. exports.IonicTapInput = IonicTapInput;
  80. /**
  81. * @hidden
  82. */
  83. var IonicFormInput = (function () {
  84. function IonicFormInput() {
  85. }
  86. return IonicFormInput;
  87. }());
  88. exports.IonicFormInput = IonicFormInput;
  89. });
  90. //# sourceMappingURL=form.js.map