1 | import { Injectable } from '@angular/core';
|
2 | import { removeArrayItem } from './util';
|
3 |
|
4 |
|
5 |
|
6 | var Form = (function () {
|
7 | function Form() {
|
8 | this._focused = null;
|
9 | this._ids = -1;
|
10 | this._inputs = [];
|
11 | }
|
12 | |
13 |
|
14 |
|
15 |
|
16 | Form.prototype.register = function (input) {
|
17 | this._inputs.push(input);
|
18 | };
|
19 | |
20 |
|
21 |
|
22 |
|
23 | Form.prototype.deregister = function (input) {
|
24 | removeArrayItem(this._inputs, input);
|
25 | this.unsetAsFocused(input);
|
26 | };
|
27 | |
28 |
|
29 |
|
30 |
|
31 | Form.prototype.setAsFocused = function (input) {
|
32 | this._focused = input;
|
33 | };
|
34 | |
35 |
|
36 |
|
37 |
|
38 | Form.prototype.unsetAsFocused = function (input) {
|
39 | if (input === this._focused) {
|
40 | this._focused = null;
|
41 | }
|
42 | };
|
43 | |
44 |
|
45 |
|
46 |
|
47 |
|
48 | Form.prototype.tabFocus = function (currentInput) {
|
49 | var inputs = this._inputs;
|
50 | var index = inputs.indexOf(currentInput) + 1;
|
51 | if (index > 0 && index < inputs.length) {
|
52 | var nextInput = inputs[index];
|
53 | if (nextInput !== this._focused) {
|
54 | (void 0) ;
|
55 | return nextInput.initFocus();
|
56 | }
|
57 | }
|
58 | index = inputs.indexOf(this._focused);
|
59 | if (index > 0) {
|
60 | var previousInput = inputs[index - 1];
|
61 | if (previousInput) {
|
62 | (void 0) ;
|
63 | previousInput.initFocus();
|
64 | }
|
65 | }
|
66 | };
|
67 | |
68 |
|
69 |
|
70 | Form.prototype.nextId = function () {
|
71 | return ++this._ids;
|
72 | };
|
73 | return Form;
|
74 | }());
|
75 | export { Form };
|
76 | Form.decorators = [
|
77 | { type: Injectable },
|
78 | ];
|
79 |
|
80 |
|
81 |
|
82 | Form.ctorParameters = function () { return []; };
|
83 | function Form_tsickle_Closure_declarations() {
|
84 |
|
85 | Form.decorators;
|
86 | |
87 |
|
88 |
|
89 |
|
90 | Form.ctorParameters;
|
91 |
|
92 | Form.prototype._focused;
|
93 |
|
94 | Form.prototype._ids;
|
95 |
|
96 | Form.prototype._inputs;
|
97 | }
|
98 |
|
99 |
|
100 |
|
101 |
|
102 | var IonicTapInput = (function () {
|
103 | function IonicTapInput() {
|
104 | }
|
105 | |
106 |
|
107 |
|
108 |
|
109 | IonicTapInput.prototype.initFocus = function () { };
|
110 | |
111 |
|
112 |
|
113 |
|
114 | IonicTapInput.prototype.checked = function () { };
|
115 | |
116 |
|
117 |
|
118 |
|
119 |
|
120 | IonicTapInput.prototype.checked = function (val) { };
|
121 | |
122 |
|
123 |
|
124 |
|
125 | IonicTapInput.prototype.disabled = function () { };
|
126 | |
127 |
|
128 |
|
129 |
|
130 |
|
131 | IonicTapInput.prototype.disabled = function (val) { };
|
132 | return IonicTapInput;
|
133 | }());
|
134 | export { IonicTapInput };
|
135 |
|
136 |
|
137 |
|
138 |
|
139 | var IonicFormInput = (function () {
|
140 | function IonicFormInput() {
|
141 | }
|
142 | |
143 |
|
144 |
|
145 |
|
146 | IonicFormInput.prototype.initFocus = function () { };
|
147 | return IonicFormInput;
|
148 | }());
|
149 | export { IonicFormInput };
|
150 |
|
\ | No newline at end of file |