@taiga-ui/cdk 3.87.0-canary.95b57e0 → 3.87.0-canary.96c5656

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/bundles/taiga-ui-cdk-abstract.umd.js +971 -1118
  2. package/bundles/taiga-ui-cdk-abstract.umd.js.map +1 -1
  3. package/bundles/taiga-ui-cdk-components-dialog-host.umd.js +504 -650
  4. package/bundles/taiga-ui-cdk-components-dialog-host.umd.js.map +1 -1
  5. package/bundles/taiga-ui-cdk-components-dropdown-host.umd.js +404 -550
  6. package/bundles/taiga-ui-cdk-components-dropdown-host.umd.js.map +1 -1
  7. package/bundles/taiga-ui-cdk-components-scroll-controls.umd.js +591 -737
  8. package/bundles/taiga-ui-cdk-components-scroll-controls.umd.js.map +1 -1
  9. package/bundles/taiga-ui-cdk-date-time.umd.js +6 -152
  10. package/bundles/taiga-ui-cdk-date-time.umd.js.map +1 -1
  11. package/bundles/taiga-ui-cdk-decorators.umd.js +6 -152
  12. package/bundles/taiga-ui-cdk-decorators.umd.js.map +1 -1
  13. package/bundles/taiga-ui-cdk-directives-active-zone.umd.js +437 -583
  14. package/bundles/taiga-ui-cdk-directives-active-zone.umd.js.map +1 -1
  15. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js +706 -852
  16. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js.map +1 -1
  17. package/bundles/taiga-ui-cdk-directives-for-async.umd.js +426 -572
  18. package/bundles/taiga-ui-cdk-directives-for-async.umd.js.map +1 -1
  19. package/bundles/taiga-ui-cdk-directives-hovered.umd.js +410 -556
  20. package/bundles/taiga-ui-cdk-directives-hovered.umd.js.map +1 -1
  21. package/bundles/taiga-ui-cdk-directives-resizer.umd.js +482 -628
  22. package/bundles/taiga-ui-cdk-directives-resizer.umd.js.map +1 -1
  23. package/bundles/taiga-ui-cdk-exceptions.umd.js +426 -572
  24. package/bundles/taiga-ui-cdk-exceptions.umd.js.map +1 -1
  25. package/bundles/taiga-ui-cdk-pipes-filter.umd.js +373 -519
  26. package/bundles/taiga-ui-cdk-pipes-filter.umd.js.map +1 -1
  27. package/bundles/taiga-ui-cdk-pipes-mapper.umd.js +373 -519
  28. package/bundles/taiga-ui-cdk-pipes-mapper.umd.js.map +1 -1
  29. package/bundles/taiga-ui-cdk-services.umd.js +840 -986
  30. package/bundles/taiga-ui-cdk-services.umd.js.map +1 -1
  31. package/bundles/taiga-ui-cdk-tokens.umd.js +650 -796
  32. package/bundles/taiga-ui-cdk-tokens.umd.js.map +1 -1
  33. package/bundles/taiga-ui-cdk-utils-color.umd.js +6 -152
  34. package/bundles/taiga-ui-cdk-utils-color.umd.js.map +1 -1
  35. package/bundles/taiga-ui-cdk-utils-focus.umd.js +4 -1
  36. package/bundles/taiga-ui-cdk-utils-focus.umd.js.map +1 -1
  37. package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js +6 -152
  38. package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js.map +1 -1
  39. package/esm2015/utils/focus/set-native-mouse-focused.js +5 -2
  40. package/fesm2015/taiga-ui-cdk-utils-focus.js +4 -1
  41. package/fesm2015/taiga-ui-cdk-utils-focus.js.map +1 -1
  42. package/package.json +1 -1
@@ -1,874 +1,728 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@taiga-ui/cdk/coercion'), require('@taiga-ui/cdk/services'), require('rxjs'), require('rxjs/operators'), require('@ng-web-apis/common'), require('@taiga-ui/cdk/tokens'), require('@taiga-ui/cdk/utils/miscellaneous'), require('@taiga-ui/cdk/constants'), require('@taiga-ui/cdk/utils')) :
3
- typeof define === 'function' && define.amd ? define('@taiga-ui/cdk/directives/auto-focus', ['exports', '@angular/core', '@taiga-ui/cdk/coercion', '@taiga-ui/cdk/services', 'rxjs', 'rxjs/operators', '@ng-web-apis/common', '@taiga-ui/cdk/tokens', '@taiga-ui/cdk/utils/miscellaneous', '@taiga-ui/cdk/constants', '@taiga-ui/cdk/utils'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["taiga-ui"] = global["taiga-ui"] || {}, global["taiga-ui"].cdk = global["taiga-ui"].cdk || {}, global["taiga-ui"].cdk.directives = global["taiga-ui"].cdk.directives || {}, global["taiga-ui"].cdk.directives["auto-focus"] = {}), global.ng.core, global["taiga-ui"].cdk.coercion, global["taiga-ui"].cdk.services, global.rxjs, global.rxjs.operators, global.common, global["taiga-ui"].cdk.tokens, global["taiga-ui"].cdk.utils.miscellaneous, global["taiga-ui"].cdk.constants, global["taiga-ui"].cdk.utils));
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@taiga-ui/cdk/coercion'), require('@taiga-ui/cdk/services'), require('rxjs'), require('rxjs/operators'), require('@ng-web-apis/common'), require('@taiga-ui/cdk/tokens'), require('@taiga-ui/cdk/utils/miscellaneous'), require('@taiga-ui/cdk/constants'), require('@taiga-ui/cdk/utils')) :
3
+ typeof define === 'function' && define.amd ? define('@taiga-ui/cdk/directives/auto-focus', ['exports', '@angular/core', '@taiga-ui/cdk/coercion', '@taiga-ui/cdk/services', 'rxjs', 'rxjs/operators', '@ng-web-apis/common', '@taiga-ui/cdk/tokens', '@taiga-ui/cdk/utils/miscellaneous', '@taiga-ui/cdk/constants', '@taiga-ui/cdk/utils'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["taiga-ui"] = global["taiga-ui"] || {}, global["taiga-ui"].cdk = global["taiga-ui"].cdk || {}, global["taiga-ui"].cdk.directives = global["taiga-ui"].cdk.directives || {}, global["taiga-ui"].cdk.directives["auto-focus"] = {}), global.ng.core, global["taiga-ui"].cdk.coercion, global["taiga-ui"].cdk.services, global.rxjs, global.rxjs.operators, global.common, global["taiga-ui"].cdk.tokens, global["taiga-ui"].cdk.utils.miscellaneous, global["taiga-ui"].cdk.constants, global["taiga-ui"].cdk.utils));
5
5
  })(this, (function (exports, i0, coercion, i1$1, i1, operators, common, tokens, miscellaneous, constants, utils) { 'use strict';
6
6
 
7
- function _interopNamespace(e) {
8
- if (e && e.__esModule) return e;
9
- var n = Object.create(null);
10
- if (e) {
11
- Object.keys(e).forEach(function (k) {
12
- if (k !== 'default') {
13
- var d = Object.getOwnPropertyDescriptor(e, k);
14
- Object.defineProperty(n, k, d.get ? d : {
15
- enumerable: true,
16
- get: function () { return e[k]; }
17
- });
7
+ function _interopNamespace(e) {
8
+ if (e && e.__esModule) return e;
9
+ var n = Object.create(null);
10
+ if (e) {
11
+ Object.keys(e).forEach(function (k) {
12
+ if (k !== 'default') {
13
+ var d = Object.getOwnPropertyDescriptor(e, k);
14
+ Object.defineProperty(n, k, d.get ? d : {
15
+ enumerable: true,
16
+ get: function () { return e[k]; }
17
+ });
18
+ }
19
+ });
18
20
  }
19
- });
21
+ n["default"] = e;
22
+ return Object.freeze(n);
20
23
  }
21
- n["default"] = e;
22
- return Object.freeze(n);
23
- }
24
24
 
25
- var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
26
- var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
27
- var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
25
+ var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
26
+ var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
27
+ var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
28
28
 
29
- /******************************************************************************
30
- Copyright (c) Microsoft Corporation.
29
+ /*! *****************************************************************************
30
+ Copyright (c) Microsoft Corporation.
31
31
 
32
- Permission to use, copy, modify, and/or distribute this software for any
33
- purpose with or without fee is hereby granted.
32
+ Permission to use, copy, modify, and/or distribute this software for any
33
+ purpose with or without fee is hereby granted.
34
34
 
35
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
36
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
37
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
38
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
39
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
40
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
41
- PERFORMANCE OF THIS SOFTWARE.
42
- ***************************************************************************** */
43
- /* global Reflect, Promise, SuppressedError, Symbol */
44
- var extendStatics = function (d, b) {
45
- extendStatics = Object.setPrototypeOf ||
46
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
47
- function (d, b) { for (var p in b)
48
- if (Object.prototype.hasOwnProperty.call(b, p))
49
- d[p] = b[p]; };
50
- return extendStatics(d, b);
51
- };
52
- function __extends(d, b) {
53
- if (typeof b !== "function" && b !== null)
54
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
55
- extendStatics(d, b);
56
- function __() { this.constructor = d; }
57
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
58
- }
59
- var __assign = function () {
60
- __assign = Object.assign || function __assign(t) {
61
- for (var s, i = 1, n = arguments.length; i < n; i++) {
62
- s = arguments[i];
63
- for (var p in s)
64
- if (Object.prototype.hasOwnProperty.call(s, p))
65
- t[p] = s[p];
66
- }
67
- return t;
68
- };
69
- return __assign.apply(this, arguments);
70
- };
71
- function __rest(s, e) {
72
- var t = {};
73
- for (var p in s)
74
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
75
- t[p] = s[p];
76
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
77
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
78
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
79
- t[p[i]] = s[p[i]];
80
- }
81
- return t;
82
- }
83
- function __decorate(decorators, target, key, desc) {
84
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
85
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
86
- r = Reflect.decorate(decorators, target, key, desc);
87
- else
88
- for (var i = decorators.length - 1; i >= 0; i--)
89
- if (d = decorators[i])
90
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
91
- return c > 3 && r && Object.defineProperty(target, key, r), r;
92
- }
93
- function __param(paramIndex, decorator) {
94
- return function (target, key) { decorator(target, key, paramIndex); };
95
- }
96
- function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
97
- function accept(f) { if (f !== void 0 && typeof f !== "function")
98
- throw new TypeError("Function expected"); return f; }
99
- var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
100
- var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
101
- var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
102
- var _, done = false;
103
- for (var i = decorators.length - 1; i >= 0; i--) {
104
- var context = {};
105
- for (var p in contextIn)
106
- context[p] = p === "access" ? {} : contextIn[p];
107
- for (var p in contextIn.access)
108
- context.access[p] = contextIn.access[p];
109
- context.addInitializer = function (f) { if (done)
110
- throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
111
- var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
112
- if (kind === "accessor") {
113
- if (result === void 0)
114
- continue;
115
- if (result === null || typeof result !== "object")
116
- throw new TypeError("Object expected");
117
- if (_ = accept(result.get))
118
- descriptor.get = _;
119
- if (_ = accept(result.set))
120
- descriptor.set = _;
121
- if (_ = accept(result.init))
122
- initializers.unshift(_);
123
- }
124
- else if (_ = accept(result)) {
125
- if (kind === "field")
126
- initializers.unshift(_);
127
- else
128
- descriptor[key] = _;
129
- }
130
- }
131
- if (target)
132
- Object.defineProperty(target, contextIn.name, descriptor);
133
- done = true;
134
- }
135
- ;
136
- function __runInitializers(thisArg, initializers, value) {
137
- var useValue = arguments.length > 2;
138
- for (var i = 0; i < initializers.length; i++) {
139
- value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
140
- }
141
- return useValue ? value : void 0;
142
- }
143
- ;
144
- function __propKey(x) {
145
- return typeof x === "symbol" ? x : "".concat(x);
146
- }
147
- ;
148
- function __setFunctionName(f, name, prefix) {
149
- if (typeof name === "symbol")
150
- name = name.description ? "[".concat(name.description, "]") : "";
151
- return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
152
- }
153
- ;
154
- function __metadata(metadataKey, metadataValue) {
155
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
156
- return Reflect.metadata(metadataKey, metadataValue);
157
- }
158
- function __awaiter(thisArg, _arguments, P, generator) {
159
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
160
- return new (P || (P = Promise))(function (resolve, reject) {
161
- function fulfilled(value) { try {
162
- step(generator.next(value));
163
- }
164
- catch (e) {
165
- reject(e);
166
- } }
167
- function rejected(value) { try {
168
- step(generator["throw"](value));
169
- }
170
- catch (e) {
171
- reject(e);
172
- } }
173
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
174
- step((generator = generator.apply(thisArg, _arguments || [])).next());
175
- });
176
- }
177
- function __generator(thisArg, body) {
178
- var _ = { label: 0, sent: function () { if (t[0] & 1)
179
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
180
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
181
- function verb(n) { return function (v) { return step([n, v]); }; }
182
- function step(op) {
183
- if (f)
184
- throw new TypeError("Generator is already executing.");
185
- while (g && (g = 0, op[0] && (_ = 0)), _)
186
- try {
187
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
188
- return t;
189
- if (y = 0, t)
190
- op = [op[0] & 2, t.value];
191
- switch (op[0]) {
192
- case 0:
193
- case 1:
194
- t = op;
195
- break;
196
- case 4:
197
- _.label++;
198
- return { value: op[1], done: false };
199
- case 5:
200
- _.label++;
201
- y = op[1];
202
- op = [0];
203
- continue;
204
- case 7:
205
- op = _.ops.pop();
206
- _.trys.pop();
207
- continue;
208
- default:
209
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
210
- _ = 0;
211
- continue;
212
- }
213
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
214
- _.label = op[1];
215
- break;
216
- }
217
- if (op[0] === 6 && _.label < t[1]) {
218
- _.label = t[1];
219
- t = op;
220
- break;
221
- }
222
- if (t && _.label < t[2]) {
223
- _.label = t[2];
224
- _.ops.push(op);
225
- break;
226
- }
227
- if (t[2])
228
- _.ops.pop();
229
- _.trys.pop();
230
- continue;
231
- }
232
- op = body.call(thisArg, _);
233
- }
234
- catch (e) {
235
- op = [6, e];
236
- y = 0;
237
- }
238
- finally {
239
- f = t = 0;
240
- }
241
- if (op[0] & 5)
242
- throw op[1];
243
- return { value: op[0] ? op[1] : void 0, done: true };
244
- }
245
- }
246
- var __createBinding = Object.create ? (function (o, m, k, k2) {
247
- if (k2 === undefined)
248
- k2 = k;
249
- var desc = Object.getOwnPropertyDescriptor(m, k);
250
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
251
- desc = { enumerable: true, get: function () { return m[k]; } };
252
- }
253
- Object.defineProperty(o, k2, desc);
254
- }) : (function (o, m, k, k2) {
255
- if (k2 === undefined)
256
- k2 = k;
257
- o[k2] = m[k];
258
- });
259
- function __exportStar(m, o) {
260
- for (var p in m)
261
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
262
- __createBinding(o, m, p);
263
- }
264
- function __values(o) {
265
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
266
- if (m)
267
- return m.call(o);
268
- if (o && typeof o.length === "number")
269
- return {
270
- next: function () {
271
- if (o && i >= o.length)
272
- o = void 0;
273
- return { value: o && o[i++], done: !o };
274
- }
275
- };
276
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
277
- }
278
- function __read(o, n) {
279
- var m = typeof Symbol === "function" && o[Symbol.iterator];
280
- if (!m)
281
- return o;
282
- var i = m.call(o), r, ar = [], e;
283
- try {
284
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
285
- ar.push(r.value);
286
- }
287
- catch (error) {
288
- e = { error: error };
289
- }
290
- finally {
291
- try {
292
- if (r && !r.done && (m = i["return"]))
293
- m.call(i);
294
- }
295
- finally {
296
- if (e)
297
- throw e.error;
298
- }
299
- }
300
- return ar;
301
- }
302
- /** @deprecated */
303
- function __spread() {
304
- for (var ar = [], i = 0; i < arguments.length; i++)
305
- ar = ar.concat(__read(arguments[i]));
306
- return ar;
307
- }
308
- /** @deprecated */
309
- function __spreadArrays() {
310
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
311
- s += arguments[i].length;
312
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
313
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
314
- r[k] = a[j];
315
- return r;
316
- }
317
- function __spreadArray(to, from, pack) {
318
- if (pack || arguments.length === 2)
319
- for (var i = 0, l = from.length, ar; i < l; i++) {
320
- if (ar || !(i in from)) {
321
- if (!ar)
322
- ar = Array.prototype.slice.call(from, 0, i);
323
- ar[i] = from[i];
324
- }
325
- }
326
- return to.concat(ar || Array.prototype.slice.call(from));
327
- }
328
- function __await(v) {
329
- return this instanceof __await ? (this.v = v, this) : new __await(v);
330
- }
331
- function __asyncGenerator(thisArg, _arguments, generator) {
332
- if (!Symbol.asyncIterator)
333
- throw new TypeError("Symbol.asyncIterator is not defined.");
334
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
335
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
336
- function verb(n) { if (g[n])
337
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
338
- function resume(n, v) { try {
339
- step(g[n](v));
340
- }
341
- catch (e) {
342
- settle(q[0][3], e);
343
- } }
344
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
345
- function fulfill(value) { resume("next", value); }
346
- function reject(value) { resume("throw", value); }
347
- function settle(f, v) { if (f(v), q.shift(), q.length)
348
- resume(q[0][0], q[0][1]); }
349
- }
350
- function __asyncDelegator(o) {
351
- var i, p;
352
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
353
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
354
- }
355
- function __asyncValues(o) {
356
- if (!Symbol.asyncIterator)
357
- throw new TypeError("Symbol.asyncIterator is not defined.");
358
- var m = o[Symbol.asyncIterator], i;
359
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
360
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
361
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
362
- }
363
- function __makeTemplateObject(cooked, raw) {
364
- if (Object.defineProperty) {
365
- Object.defineProperty(cooked, "raw", { value: raw });
366
- }
367
- else {
368
- cooked.raw = raw;
369
- }
370
- return cooked;
371
- }
372
- ;
373
- var __setModuleDefault = Object.create ? (function (o, v) {
374
- Object.defineProperty(o, "default", { enumerable: true, value: v });
375
- }) : function (o, v) {
376
- o["default"] = v;
377
- };
378
- function __importStar(mod) {
379
- if (mod && mod.__esModule)
380
- return mod;
381
- var result = {};
382
- if (mod != null)
383
- for (var k in mod)
384
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
385
- __createBinding(result, mod, k);
386
- __setModuleDefault(result, mod);
387
- return result;
388
- }
389
- function __importDefault(mod) {
390
- return (mod && mod.__esModule) ? mod : { default: mod };
391
- }
392
- function __classPrivateFieldGet(receiver, state, kind, f) {
393
- if (kind === "a" && !f)
394
- throw new TypeError("Private accessor was defined without a getter");
395
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
396
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
397
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
398
- }
399
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
400
- if (kind === "m")
401
- throw new TypeError("Private method is not writable");
402
- if (kind === "a" && !f)
403
- throw new TypeError("Private accessor was defined without a setter");
404
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
405
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
406
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
407
- }
408
- function __classPrivateFieldIn(state, receiver) {
409
- if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function"))
410
- throw new TypeError("Cannot use 'in' operator on non-object");
411
- return typeof state === "function" ? receiver === state : state.has(receiver);
412
- }
413
- function __addDisposableResource(env, value, async) {
414
- if (value !== null && value !== void 0) {
415
- if (typeof value !== "object" && typeof value !== "function")
416
- throw new TypeError("Object expected.");
417
- var dispose;
418
- if (async) {
419
- if (!Symbol.asyncDispose)
420
- throw new TypeError("Symbol.asyncDispose is not defined.");
421
- dispose = value[Symbol.asyncDispose];
422
- }
423
- if (dispose === void 0) {
424
- if (!Symbol.dispose)
425
- throw new TypeError("Symbol.dispose is not defined.");
426
- dispose = value[Symbol.dispose];
427
- }
428
- if (typeof dispose !== "function")
429
- throw new TypeError("Object not disposable.");
430
- env.stack.push({ value: value, dispose: dispose, async: async });
431
- }
432
- else if (async) {
433
- env.stack.push({ async: true });
434
- }
435
- return value;
436
- }
437
- var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
438
- var e = new Error(message);
439
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
440
- };
441
- function __disposeResources(env) {
442
- function fail(e) {
443
- env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
444
- env.hasError = true;
445
- }
446
- function next() {
447
- while (env.stack.length) {
448
- var rec = env.stack.pop();
449
- try {
450
- var result = rec.dispose && rec.dispose.call(rec.value);
451
- if (rec.async)
452
- return Promise.resolve(result).then(next, function (e) { fail(e); return next(); });
453
- }
454
- catch (e) {
455
- fail(e);
456
- }
457
- }
458
- if (env.hasError)
459
- throw env.error;
460
- }
461
- return next();
462
- }
463
- var tslib_es6 = {
464
- __extends: __extends,
465
- __assign: __assign,
466
- __rest: __rest,
467
- __decorate: __decorate,
468
- __param: __param,
469
- __metadata: __metadata,
470
- __awaiter: __awaiter,
471
- __generator: __generator,
472
- __createBinding: __createBinding,
473
- __exportStar: __exportStar,
474
- __values: __values,
475
- __read: __read,
476
- __spread: __spread,
477
- __spreadArrays: __spreadArrays,
478
- __spreadArray: __spreadArray,
479
- __await: __await,
480
- __asyncGenerator: __asyncGenerator,
481
- __asyncDelegator: __asyncDelegator,
482
- __asyncValues: __asyncValues,
483
- __makeTemplateObject: __makeTemplateObject,
484
- __importStar: __importStar,
485
- __importDefault: __importDefault,
486
- __classPrivateFieldGet: __classPrivateFieldGet,
487
- __classPrivateFieldSet: __classPrivateFieldSet,
488
- __classPrivateFieldIn: __classPrivateFieldIn,
489
- __addDisposableResource: __addDisposableResource,
490
- __disposeResources: __disposeResources,
491
- };
35
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
36
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
37
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
38
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
39
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
40
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
41
+ PERFORMANCE OF THIS SOFTWARE.
42
+ ***************************************************************************** */
43
+ /* global Reflect, Promise */
44
+ var extendStatics = function (d, b) {
45
+ extendStatics = Object.setPrototypeOf ||
46
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
47
+ function (d, b) { for (var p in b)
48
+ if (Object.prototype.hasOwnProperty.call(b, p))
49
+ d[p] = b[p]; };
50
+ return extendStatics(d, b);
51
+ };
52
+ function __extends(d, b) {
53
+ if (typeof b !== "function" && b !== null)
54
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
55
+ extendStatics(d, b);
56
+ function __() { this.constructor = d; }
57
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
58
+ }
59
+ var __assign = function () {
60
+ __assign = Object.assign || function __assign(t) {
61
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
62
+ s = arguments[i];
63
+ for (var p in s)
64
+ if (Object.prototype.hasOwnProperty.call(s, p))
65
+ t[p] = s[p];
66
+ }
67
+ return t;
68
+ };
69
+ return __assign.apply(this, arguments);
70
+ };
71
+ function __rest(s, e) {
72
+ var t = {};
73
+ for (var p in s)
74
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
75
+ t[p] = s[p];
76
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
77
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
78
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
79
+ t[p[i]] = s[p[i]];
80
+ }
81
+ return t;
82
+ }
83
+ function __decorate(decorators, target, key, desc) {
84
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
85
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
86
+ r = Reflect.decorate(decorators, target, key, desc);
87
+ else
88
+ for (var i = decorators.length - 1; i >= 0; i--)
89
+ if (d = decorators[i])
90
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
91
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
92
+ }
93
+ function __param(paramIndex, decorator) {
94
+ return function (target, key) { decorator(target, key, paramIndex); };
95
+ }
96
+ function __metadata(metadataKey, metadataValue) {
97
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
98
+ return Reflect.metadata(metadataKey, metadataValue);
99
+ }
100
+ function __awaiter(thisArg, _arguments, P, generator) {
101
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
102
+ return new (P || (P = Promise))(function (resolve, reject) {
103
+ function fulfilled(value) { try {
104
+ step(generator.next(value));
105
+ }
106
+ catch (e) {
107
+ reject(e);
108
+ } }
109
+ function rejected(value) { try {
110
+ step(generator["throw"](value));
111
+ }
112
+ catch (e) {
113
+ reject(e);
114
+ } }
115
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
116
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
117
+ });
118
+ }
119
+ function __generator(thisArg, body) {
120
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
121
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
122
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
123
+ function verb(n) { return function (v) { return step([n, v]); }; }
124
+ function step(op) {
125
+ if (f)
126
+ throw new TypeError("Generator is already executing.");
127
+ while (_)
128
+ try {
129
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
130
+ return t;
131
+ if (y = 0, t)
132
+ op = [op[0] & 2, t.value];
133
+ switch (op[0]) {
134
+ case 0:
135
+ case 1:
136
+ t = op;
137
+ break;
138
+ case 4:
139
+ _.label++;
140
+ return { value: op[1], done: false };
141
+ case 5:
142
+ _.label++;
143
+ y = op[1];
144
+ op = [0];
145
+ continue;
146
+ case 7:
147
+ op = _.ops.pop();
148
+ _.trys.pop();
149
+ continue;
150
+ default:
151
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
152
+ _ = 0;
153
+ continue;
154
+ }
155
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
156
+ _.label = op[1];
157
+ break;
158
+ }
159
+ if (op[0] === 6 && _.label < t[1]) {
160
+ _.label = t[1];
161
+ t = op;
162
+ break;
163
+ }
164
+ if (t && _.label < t[2]) {
165
+ _.label = t[2];
166
+ _.ops.push(op);
167
+ break;
168
+ }
169
+ if (t[2])
170
+ _.ops.pop();
171
+ _.trys.pop();
172
+ continue;
173
+ }
174
+ op = body.call(thisArg, _);
175
+ }
176
+ catch (e) {
177
+ op = [6, e];
178
+ y = 0;
179
+ }
180
+ finally {
181
+ f = t = 0;
182
+ }
183
+ if (op[0] & 5)
184
+ throw op[1];
185
+ return { value: op[0] ? op[1] : void 0, done: true };
186
+ }
187
+ }
188
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
189
+ if (k2 === undefined)
190
+ k2 = k;
191
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
192
+ }) : (function (o, m, k, k2) {
193
+ if (k2 === undefined)
194
+ k2 = k;
195
+ o[k2] = m[k];
196
+ });
197
+ function __exportStar(m, o) {
198
+ for (var p in m)
199
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
200
+ __createBinding(o, m, p);
201
+ }
202
+ function __values(o) {
203
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
204
+ if (m)
205
+ return m.call(o);
206
+ if (o && typeof o.length === "number")
207
+ return {
208
+ next: function () {
209
+ if (o && i >= o.length)
210
+ o = void 0;
211
+ return { value: o && o[i++], done: !o };
212
+ }
213
+ };
214
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
215
+ }
216
+ function __read(o, n) {
217
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
218
+ if (!m)
219
+ return o;
220
+ var i = m.call(o), r, ar = [], e;
221
+ try {
222
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
223
+ ar.push(r.value);
224
+ }
225
+ catch (error) {
226
+ e = { error: error };
227
+ }
228
+ finally {
229
+ try {
230
+ if (r && !r.done && (m = i["return"]))
231
+ m.call(i);
232
+ }
233
+ finally {
234
+ if (e)
235
+ throw e.error;
236
+ }
237
+ }
238
+ return ar;
239
+ }
240
+ /** @deprecated */
241
+ function __spread() {
242
+ for (var ar = [], i = 0; i < arguments.length; i++)
243
+ ar = ar.concat(__read(arguments[i]));
244
+ return ar;
245
+ }
246
+ /** @deprecated */
247
+ function __spreadArrays() {
248
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
249
+ s += arguments[i].length;
250
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
251
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
252
+ r[k] = a[j];
253
+ return r;
254
+ }
255
+ function __spreadArray(to, from, pack) {
256
+ if (pack || arguments.length === 2)
257
+ for (var i = 0, l = from.length, ar; i < l; i++) {
258
+ if (ar || !(i in from)) {
259
+ if (!ar)
260
+ ar = Array.prototype.slice.call(from, 0, i);
261
+ ar[i] = from[i];
262
+ }
263
+ }
264
+ return to.concat(ar || from);
265
+ }
266
+ function __await(v) {
267
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
268
+ }
269
+ function __asyncGenerator(thisArg, _arguments, generator) {
270
+ if (!Symbol.asyncIterator)
271
+ throw new TypeError("Symbol.asyncIterator is not defined.");
272
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
273
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
274
+ function verb(n) { if (g[n])
275
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
276
+ function resume(n, v) { try {
277
+ step(g[n](v));
278
+ }
279
+ catch (e) {
280
+ settle(q[0][3], e);
281
+ } }
282
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
283
+ function fulfill(value) { resume("next", value); }
284
+ function reject(value) { resume("throw", value); }
285
+ function settle(f, v) { if (f(v), q.shift(), q.length)
286
+ resume(q[0][0], q[0][1]); }
287
+ }
288
+ function __asyncDelegator(o) {
289
+ var i, p;
290
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
291
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
292
+ }
293
+ function __asyncValues(o) {
294
+ if (!Symbol.asyncIterator)
295
+ throw new TypeError("Symbol.asyncIterator is not defined.");
296
+ var m = o[Symbol.asyncIterator], i;
297
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
298
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
299
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
300
+ }
301
+ function __makeTemplateObject(cooked, raw) {
302
+ if (Object.defineProperty) {
303
+ Object.defineProperty(cooked, "raw", { value: raw });
304
+ }
305
+ else {
306
+ cooked.raw = raw;
307
+ }
308
+ return cooked;
309
+ }
310
+ ;
311
+ var __setModuleDefault = Object.create ? (function (o, v) {
312
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
313
+ }) : function (o, v) {
314
+ o["default"] = v;
315
+ };
316
+ function __importStar(mod) {
317
+ if (mod && mod.__esModule)
318
+ return mod;
319
+ var result = {};
320
+ if (mod != null)
321
+ for (var k in mod)
322
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
323
+ __createBinding(result, mod, k);
324
+ __setModuleDefault(result, mod);
325
+ return result;
326
+ }
327
+ function __importDefault(mod) {
328
+ return (mod && mod.__esModule) ? mod : { default: mod };
329
+ }
330
+ function __classPrivateFieldGet(receiver, state, kind, f) {
331
+ if (kind === "a" && !f)
332
+ throw new TypeError("Private accessor was defined without a getter");
333
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
334
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
335
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
336
+ }
337
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
338
+ if (kind === "m")
339
+ throw new TypeError("Private method is not writable");
340
+ if (kind === "a" && !f)
341
+ throw new TypeError("Private accessor was defined without a setter");
342
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
343
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
344
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
345
+ }
492
346
 
493
- var AbstractTuiAutofocusHandler = /** @class */ (function () {
494
- function AbstractTuiAutofocusHandler(focusable, el) {
495
- this.focusable = focusable;
496
- this.el = el;
497
- }
498
- Object.defineProperty(AbstractTuiAutofocusHandler.prototype, "element", {
499
- get: function () {
500
- var _a;
501
- return ((_a = this.focusable) === null || _a === void 0 ? void 0 : _a.nativeFocusableElement) || this.el.nativeElement;
502
- },
503
- enumerable: false,
504
- configurable: true
505
- });
506
- Object.defineProperty(AbstractTuiAutofocusHandler.prototype, "isTextFieldElement", {
507
- get: function () {
508
- return this.element.matches('input, textarea, [contenteditable]');
509
- },
510
- enumerable: false,
511
- configurable: true
512
- });
513
- return AbstractTuiAutofocusHandler;
514
- }());
515
- AbstractTuiAutofocusHandler.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: AbstractTuiAutofocusHandler, deps: "invalid", target: i0__namespace.ɵɵFactoryTarget.Directive });
516
- AbstractTuiAutofocusHandler.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: AbstractTuiAutofocusHandler, ngImport: i0__namespace });
517
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: AbstractTuiAutofocusHandler, decorators: [{
518
- type: i0.Directive
519
- }], ctorParameters: function () { return [{ type: undefined }, { type: i0__namespace.ElementRef }]; } });
347
+ var AbstractTuiAutofocusHandler = /** @class */ (function () {
348
+ function AbstractTuiAutofocusHandler(focusable, el) {
349
+ this.focusable = focusable;
350
+ this.el = el;
351
+ }
352
+ Object.defineProperty(AbstractTuiAutofocusHandler.prototype, "element", {
353
+ get: function () {
354
+ var _a;
355
+ return ((_a = this.focusable) === null || _a === void 0 ? void 0 : _a.nativeFocusableElement) || this.el.nativeElement;
356
+ },
357
+ enumerable: false,
358
+ configurable: true
359
+ });
360
+ Object.defineProperty(AbstractTuiAutofocusHandler.prototype, "isTextFieldElement", {
361
+ get: function () {
362
+ return this.element.matches('input, textarea, [contenteditable]');
363
+ },
364
+ enumerable: false,
365
+ configurable: true
366
+ });
367
+ return AbstractTuiAutofocusHandler;
368
+ }());
369
+ AbstractTuiAutofocusHandler.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: AbstractTuiAutofocusHandler, deps: "invalid", target: i0__namespace.ɵɵFactoryTarget.Directive });
370
+ AbstractTuiAutofocusHandler.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: AbstractTuiAutofocusHandler, ngImport: i0__namespace });
371
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: AbstractTuiAutofocusHandler, decorators: [{
372
+ type: i0.Directive
373
+ }], ctorParameters: function () { return [{ type: undefined }, { type: i0__namespace.ElementRef }]; } });
520
374
 
521
- var TIMEOUT = 1000;
522
- var NG_ANIMATION_SELECTOR = '.ng-animating';
523
- var TuiDefaultAutofocusHandler = /** @class */ (function (_super) {
524
- __extends(TuiDefaultAutofocusHandler, _super);
525
- function TuiDefaultAutofocusHandler(focusable, el, animationFrame$) {
526
- var _this = _super.call(this, focusable, el) || this;
527
- _this.animationFrame$ = animationFrame$;
528
- return _this;
529
- }
530
- TuiDefaultAutofocusHandler.prototype.setFocus = function () {
531
- var _this = this;
532
- if (this.isTextFieldElement) {
533
- i1.race(i1.timer(TIMEOUT), this.animationFrame$.pipe(operators.throttleTime(constants.POLLING_TIME), operators.map(function () { return _this.element.closest(NG_ANIMATION_SELECTOR); }), operators.skipWhile(Boolean), operators.take(1))).subscribe(function () { return _this.element.focus({ preventScroll: true }); });
534
- }
535
- else {
536
- this.element.focus({ preventScroll: true });
537
- }
538
- };
539
- return TuiDefaultAutofocusHandler;
540
- }(AbstractTuiAutofocusHandler));
541
- TuiDefaultAutofocusHandler.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiDefaultAutofocusHandler, deps: [{ token: tokens.TUI_FOCUSABLE_ITEM_ACCESSOR, optional: true, self: true }, { token: i0.ElementRef }, { token: common.ANIMATION_FRAME }], target: i0__namespace.ɵɵFactoryTarget.Directive });
542
- TuiDefaultAutofocusHandler.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiDefaultAutofocusHandler, usesInheritance: true, ngImport: i0__namespace });
543
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiDefaultAutofocusHandler, decorators: [{
544
- type: i0.Directive
545
- }], ctorParameters: function () {
546
- return [{ type: undefined, decorators: [{
547
- type: i0.Optional
548
- }, {
549
- type: i0.Self
550
- }, {
551
- type: i0.Inject,
552
- args: [tokens.TUI_FOCUSABLE_ITEM_ACCESSOR]
553
- }] }, { type: i0__namespace.ElementRef, decorators: [{
554
- type: i0.Inject,
555
- args: [i0.ElementRef]
556
- }] }, { type: i1__namespace.Observable, decorators: [{
557
- type: i0.Inject,
558
- args: [common.ANIMATION_FRAME]
559
- }] }];
560
- } });
375
+ var TIMEOUT = 1000;
376
+ var NG_ANIMATION_SELECTOR = '.ng-animating';
377
+ var TuiDefaultAutofocusHandler = /** @class */ (function (_super) {
378
+ __extends(TuiDefaultAutofocusHandler, _super);
379
+ function TuiDefaultAutofocusHandler(focusable, el, animationFrame$) {
380
+ var _this = _super.call(this, focusable, el) || this;
381
+ _this.animationFrame$ = animationFrame$;
382
+ return _this;
383
+ }
384
+ TuiDefaultAutofocusHandler.prototype.setFocus = function () {
385
+ var _this = this;
386
+ if (this.isTextFieldElement) {
387
+ i1.race(i1.timer(TIMEOUT), this.animationFrame$.pipe(operators.throttleTime(constants.POLLING_TIME), operators.map(function () { return _this.element.closest(NG_ANIMATION_SELECTOR); }), operators.skipWhile(Boolean), operators.take(1))).subscribe(function () { return _this.element.focus({ preventScroll: true }); });
388
+ }
389
+ else {
390
+ this.element.focus({ preventScroll: true });
391
+ }
392
+ };
393
+ return TuiDefaultAutofocusHandler;
394
+ }(AbstractTuiAutofocusHandler));
395
+ TuiDefaultAutofocusHandler.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiDefaultAutofocusHandler, deps: [{ token: tokens.TUI_FOCUSABLE_ITEM_ACCESSOR, optional: true, self: true }, { token: i0.ElementRef }, { token: common.ANIMATION_FRAME }], target: i0__namespace.ɵɵFactoryTarget.Directive });
396
+ TuiDefaultAutofocusHandler.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiDefaultAutofocusHandler, usesInheritance: true, ngImport: i0__namespace });
397
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiDefaultAutofocusHandler, decorators: [{
398
+ type: i0.Directive
399
+ }], ctorParameters: function () {
400
+ return [{ type: undefined, decorators: [{
401
+ type: i0.Optional
402
+ }, {
403
+ type: i0.Self
404
+ }, {
405
+ type: i0.Inject,
406
+ args: [tokens.TUI_FOCUSABLE_ITEM_ACCESSOR]
407
+ }] }, { type: i0__namespace.ElementRef, decorators: [{
408
+ type: i0.Inject,
409
+ args: [i0.ElementRef]
410
+ }] }, { type: i1__namespace.Observable, decorators: [{
411
+ type: i0.Inject,
412
+ args: [common.ANIMATION_FRAME]
413
+ }] }];
414
+ } });
561
415
 
562
- var TEXTFIELD_ATTRS = [
563
- 'type',
564
- 'inputMode',
565
- 'autocomplete',
566
- 'accept',
567
- 'min',
568
- 'max',
569
- 'step',
570
- 'pattern',
571
- 'size',
572
- 'maxlength',
573
- ];
574
- var TuiIosAutofocusHandler = /** @class */ (function (_super) {
575
- __extends(TuiIosAutofocusHandler, _super);
576
- function TuiIosAutofocusHandler(focusable, el, renderer, zone, win) {
577
- var _this = _super.call(this, focusable, el) || this;
578
- _this.renderer = renderer;
579
- _this.zone = zone;
580
- _this.win = win;
581
- _this.patchCssStyles();
582
- return _this;
583
- }
584
- TuiIosAutofocusHandler.prototype.setFocus = function () {
585
- var _this = this;
586
- if (this.isTextFieldElement) {
587
- this.zone.runOutsideAngular(function () { return _this.iosWebkitAutofocus(); });
588
- }
589
- else {
590
- this.element.focus({ preventScroll: true });
591
- }
592
- };
593
- TuiIosAutofocusHandler.prototype.iosWebkitAutofocus = function () {
594
- var _this = this;
595
- var _a;
596
- var fakeInput = this.makeFakeInput();
597
- var duration = this.getDurationTimeBeforeFocus();
598
- var fakeFocusTimeoutId = 0;
599
- var elementFocusTimeoutId = 0;
600
- var blurHandler = function () { return fakeInput.focus({ preventScroll: true }); };
601
- var focusHandler = function () {
602
- clearTimeout(fakeFocusTimeoutId);
603
- fakeFocusTimeoutId = _this.win.setTimeout(function () {
604
- clearTimeout(elementFocusTimeoutId);
605
- fakeInput.removeEventListener('blur', blurHandler);
606
- fakeInput.removeEventListener('focus', focusHandler);
607
- elementFocusTimeoutId = _this.win.setTimeout(function () {
608
- _this.element.focus({ preventScroll: false });
609
- fakeInput.remove();
610
- }, duration);
611
- });
612
- };
613
- fakeInput.addEventListener('blur', blurHandler, { once: true });
614
- fakeInput.addEventListener('focus', focusHandler);
615
- if (this.insideDialog()) {
616
- this.win.document.body.appendChild(fakeInput);
617
- }
618
- else {
619
- (_a = this.element.parentElement) === null || _a === void 0 ? void 0 : _a.appendChild(fakeInput);
620
- }
621
- fakeInput.focus({ preventScroll: true });
622
- };
623
- /**
624
- * @note:
625
- * emulate textfield position in layout with cursor
626
- * before focus to real textfield element
627
- *
628
- * required note:
629
- * [fakeInput.readOnly = true] ~
630
- * don't use {readOnly: true} value, it's doesn't work for emulate autofill
631
- *
632
- * [fakeInput.style.opacity = 0] ~
633
- * don't use {opacity: 0}, sometimes it's doesn't work for emulate real input
634
- *
635
- * [fakeInput.style.fontSize = 16px] ~
636
- * disable possible auto zoom
637
- *
638
- * [fakeInput.style.top/left] ~
639
- * emulate position cursor before focus to real textfield element
640
- */
641
- TuiIosAutofocusHandler.prototype.makeFakeInput = function () {
642
- var fakeInput = this.renderer.createElement('input');
643
- var rect = this.element.getBoundingClientRect();
644
- this.patchFakeInputFromFocusableElement(fakeInput);
645
- fakeInput.style.height = utils.tuiPx(rect.height);
646
- fakeInput.style.width = utils.tuiPx(rect.width / 2);
647
- fakeInput.style.position = 'fixed';
648
- fakeInput.style.zIndex = '-99999999';
649
- fakeInput.style.caretColor = 'transparent';
650
- fakeInput.style.border = 'none';
651
- fakeInput.style.outline = 'none';
652
- fakeInput.style.color = 'transparent';
653
- fakeInput.style.background = 'transparent';
654
- fakeInput.style.cursor = 'none';
655
- fakeInput.style.fontSize = utils.tuiPx(16);
656
- fakeInput.style.top = utils.tuiPx(rect.top);
657
- fakeInput.style.left = utils.tuiPx(rect.left);
658
- return fakeInput;
659
- };
660
- TuiIosAutofocusHandler.prototype.getDurationTimeBeforeFocus = function () {
661
- return (parseFloat(this.win
662
- .getComputedStyle(this.element)
663
- .getPropertyValue('--tui-duration')) || 0);
664
- };
665
- /**
666
- * @note:
667
- * unfortunately, in older versions of iOS
668
- * there is a bug that the fake input cursor
669
- * will move along with the dialog animation
670
- * and then that dialog will be shaking
671
- */
672
- TuiIosAutofocusHandler.prototype.insideDialog = function () {
673
- return !!this.element.closest('tui-dialog');
674
- };
675
- /**
676
- * @note:
677
- * This is necessary so that the viewport isn't recalculated
678
- * and then the dialogs don't shake.
679
- *
680
- * Also, we need to fixed height viewport,
681
- * so that when focusing the dialogs don't shake
682
- */
683
- TuiIosAutofocusHandler.prototype.patchCssStyles = function () {
684
- [this.win.document.documentElement, this.win.document.body].forEach(function (element) {
685
- element.style.setProperty('overflow', 'auto');
686
- element.style.setProperty('height', '100%');
687
- });
688
- };
689
- /**
690
- * @note:
691
- * inherit basic attributes values from real input
692
- * for help iOS detect what do you want see on keyboard,
693
- * for example [inputMode=numeric, autocomplete=cc-number]
694
- */
695
- TuiIosAutofocusHandler.prototype.patchFakeInputFromFocusableElement = function (fakeInput) {
696
- var _this = this;
697
- TEXTFIELD_ATTRS.forEach(function (attr) {
698
- var value = _this.element.getAttribute(attr);
699
- if (utils.tuiIsPresent(value)) {
700
- fakeInput.setAttribute(attr, value);
701
- }
702
- });
703
- };
704
- return TuiIosAutofocusHandler;
705
- }(AbstractTuiAutofocusHandler));
706
- TuiIosAutofocusHandler.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiIosAutofocusHandler, deps: [{ token: tokens.TUI_FOCUSABLE_ITEM_ACCESSOR, optional: true, self: true }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: common.WINDOW }], target: i0__namespace.ɵɵFactoryTarget.Directive });
707
- TuiIosAutofocusHandler.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiIosAutofocusHandler, usesInheritance: true, ngImport: i0__namespace });
708
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiIosAutofocusHandler, decorators: [{
709
- type: i0.Directive
710
- }], ctorParameters: function () {
711
- return [{ type: undefined, decorators: [{
712
- type: i0.Optional
713
- }, {
714
- type: i0.Self
715
- }, {
716
- type: i0.Inject,
717
- args: [tokens.TUI_FOCUSABLE_ITEM_ACCESSOR]
718
- }] }, { type: i0__namespace.ElementRef, decorators: [{
719
- type: i0.Inject,
720
- args: [i0.ElementRef]
721
- }] }, { type: i0__namespace.Renderer2, decorators: [{
722
- type: i0.Inject,
723
- args: [i0.Renderer2]
724
- }] }, { type: i0__namespace.NgZone, decorators: [{
725
- type: i0.Inject,
726
- args: [i0.NgZone]
727
- }] }, { type: Window, decorators: [{
728
- type: i0.Inject,
729
- args: [common.WINDOW]
730
- }] }];
731
- } });
416
+ var TEXTFIELD_ATTRS = [
417
+ 'type',
418
+ 'inputMode',
419
+ 'autocomplete',
420
+ 'accept',
421
+ 'min',
422
+ 'max',
423
+ 'step',
424
+ 'pattern',
425
+ 'size',
426
+ 'maxlength',
427
+ ];
428
+ var TuiIosAutofocusHandler = /** @class */ (function (_super) {
429
+ __extends(TuiIosAutofocusHandler, _super);
430
+ function TuiIosAutofocusHandler(focusable, el, renderer, zone, win) {
431
+ var _this = _super.call(this, focusable, el) || this;
432
+ _this.renderer = renderer;
433
+ _this.zone = zone;
434
+ _this.win = win;
435
+ _this.patchCssStyles();
436
+ return _this;
437
+ }
438
+ TuiIosAutofocusHandler.prototype.setFocus = function () {
439
+ var _this = this;
440
+ if (this.isTextFieldElement) {
441
+ this.zone.runOutsideAngular(function () { return _this.iosWebkitAutofocus(); });
442
+ }
443
+ else {
444
+ this.element.focus({ preventScroll: true });
445
+ }
446
+ };
447
+ TuiIosAutofocusHandler.prototype.iosWebkitAutofocus = function () {
448
+ var _this = this;
449
+ var _a;
450
+ var fakeInput = this.makeFakeInput();
451
+ var duration = this.getDurationTimeBeforeFocus();
452
+ var fakeFocusTimeoutId = 0;
453
+ var elementFocusTimeoutId = 0;
454
+ var blurHandler = function () { return fakeInput.focus({ preventScroll: true }); };
455
+ var focusHandler = function () {
456
+ clearTimeout(fakeFocusTimeoutId);
457
+ fakeFocusTimeoutId = _this.win.setTimeout(function () {
458
+ clearTimeout(elementFocusTimeoutId);
459
+ fakeInput.removeEventListener('blur', blurHandler);
460
+ fakeInput.removeEventListener('focus', focusHandler);
461
+ elementFocusTimeoutId = _this.win.setTimeout(function () {
462
+ _this.element.focus({ preventScroll: false });
463
+ fakeInput.remove();
464
+ }, duration);
465
+ });
466
+ };
467
+ fakeInput.addEventListener('blur', blurHandler, { once: true });
468
+ fakeInput.addEventListener('focus', focusHandler);
469
+ if (this.insideDialog()) {
470
+ this.win.document.body.appendChild(fakeInput);
471
+ }
472
+ else {
473
+ (_a = this.element.parentElement) === null || _a === void 0 ? void 0 : _a.appendChild(fakeInput);
474
+ }
475
+ fakeInput.focus({ preventScroll: true });
476
+ };
477
+ /**
478
+ * @note:
479
+ * emulate textfield position in layout with cursor
480
+ * before focus to real textfield element
481
+ *
482
+ * required note:
483
+ * [fakeInput.readOnly = true] ~
484
+ * don't use {readOnly: true} value, it's doesn't work for emulate autofill
485
+ *
486
+ * [fakeInput.style.opacity = 0] ~
487
+ * don't use {opacity: 0}, sometimes it's doesn't work for emulate real input
488
+ *
489
+ * [fakeInput.style.fontSize = 16px] ~
490
+ * disable possible auto zoom
491
+ *
492
+ * [fakeInput.style.top/left] ~
493
+ * emulate position cursor before focus to real textfield element
494
+ */
495
+ TuiIosAutofocusHandler.prototype.makeFakeInput = function () {
496
+ var fakeInput = this.renderer.createElement('input');
497
+ var rect = this.element.getBoundingClientRect();
498
+ this.patchFakeInputFromFocusableElement(fakeInput);
499
+ fakeInput.style.height = utils.tuiPx(rect.height);
500
+ fakeInput.style.width = utils.tuiPx(rect.width / 2);
501
+ fakeInput.style.position = 'fixed';
502
+ fakeInput.style.zIndex = '-99999999';
503
+ fakeInput.style.caretColor = 'transparent';
504
+ fakeInput.style.border = 'none';
505
+ fakeInput.style.outline = 'none';
506
+ fakeInput.style.color = 'transparent';
507
+ fakeInput.style.background = 'transparent';
508
+ fakeInput.style.cursor = 'none';
509
+ fakeInput.style.fontSize = utils.tuiPx(16);
510
+ fakeInput.style.top = utils.tuiPx(rect.top);
511
+ fakeInput.style.left = utils.tuiPx(rect.left);
512
+ return fakeInput;
513
+ };
514
+ TuiIosAutofocusHandler.prototype.getDurationTimeBeforeFocus = function () {
515
+ return (parseFloat(this.win
516
+ .getComputedStyle(this.element)
517
+ .getPropertyValue('--tui-duration')) || 0);
518
+ };
519
+ /**
520
+ * @note:
521
+ * unfortunately, in older versions of iOS
522
+ * there is a bug that the fake input cursor
523
+ * will move along with the dialog animation
524
+ * and then that dialog will be shaking
525
+ */
526
+ TuiIosAutofocusHandler.prototype.insideDialog = function () {
527
+ return !!this.element.closest('tui-dialog');
528
+ };
529
+ /**
530
+ * @note:
531
+ * This is necessary so that the viewport isn't recalculated
532
+ * and then the dialogs don't shake.
533
+ *
534
+ * Also, we need to fixed height viewport,
535
+ * so that when focusing the dialogs don't shake
536
+ */
537
+ TuiIosAutofocusHandler.prototype.patchCssStyles = function () {
538
+ [this.win.document.documentElement, this.win.document.body].forEach(function (element) {
539
+ element.style.setProperty('overflow', 'auto');
540
+ element.style.setProperty('height', '100%');
541
+ });
542
+ };
543
+ /**
544
+ * @note:
545
+ * inherit basic attributes values from real input
546
+ * for help iOS detect what do you want see on keyboard,
547
+ * for example [inputMode=numeric, autocomplete=cc-number]
548
+ */
549
+ TuiIosAutofocusHandler.prototype.patchFakeInputFromFocusableElement = function (fakeInput) {
550
+ var _this = this;
551
+ TEXTFIELD_ATTRS.forEach(function (attr) {
552
+ var value = _this.element.getAttribute(attr);
553
+ if (utils.tuiIsPresent(value)) {
554
+ fakeInput.setAttribute(attr, value);
555
+ }
556
+ });
557
+ };
558
+ return TuiIosAutofocusHandler;
559
+ }(AbstractTuiAutofocusHandler));
560
+ TuiIosAutofocusHandler.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiIosAutofocusHandler, deps: [{ token: tokens.TUI_FOCUSABLE_ITEM_ACCESSOR, optional: true, self: true }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: common.WINDOW }], target: i0__namespace.ɵɵFactoryTarget.Directive });
561
+ TuiIosAutofocusHandler.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiIosAutofocusHandler, usesInheritance: true, ngImport: i0__namespace });
562
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiIosAutofocusHandler, decorators: [{
563
+ type: i0.Directive
564
+ }], ctorParameters: function () {
565
+ return [{ type: undefined, decorators: [{
566
+ type: i0.Optional
567
+ }, {
568
+ type: i0.Self
569
+ }, {
570
+ type: i0.Inject,
571
+ args: [tokens.TUI_FOCUSABLE_ITEM_ACCESSOR]
572
+ }] }, { type: i0__namespace.ElementRef, decorators: [{
573
+ type: i0.Inject,
574
+ args: [i0.ElementRef]
575
+ }] }, { type: i0__namespace.Renderer2, decorators: [{
576
+ type: i0.Inject,
577
+ args: [i0.Renderer2]
578
+ }] }, { type: i0__namespace.NgZone, decorators: [{
579
+ type: i0.Inject,
580
+ args: [i0.NgZone]
581
+ }] }, { type: Window, decorators: [{
582
+ type: i0.Inject,
583
+ args: [common.WINDOW]
584
+ }] }];
585
+ } });
732
586
 
733
- var TUI_AUTOFOCUS_DEFAULT_OPTIONS = {
734
- delay: NaN, // NaN = no delay/sync
735
- };
736
- var TUI_AUTOFOCUS_OPTIONS = miscellaneous.tuiCreateToken(TUI_AUTOFOCUS_DEFAULT_OPTIONS);
737
- function tuiAutoFocusOptionsProvider(options) {
738
- return miscellaneous.tuiProvideOptions(TUI_AUTOFOCUS_OPTIONS, options, TUI_AUTOFOCUS_DEFAULT_OPTIONS);
739
- }
740
- var TUI_AUTOFOCUS_HANDLER = new i0.InjectionToken('[TUI_AUTOFOCUS_HANDLER]');
741
- var TUI_AUTOFOCUS_PROVIDERS = [
742
- {
743
- provide: TUI_AUTOFOCUS_HANDLER,
744
- useFactory: function (focusable, el, animationFrame$, renderer, zone, win, isIos) { return isIos
745
- ? new TuiIosAutofocusHandler(focusable, el, renderer, zone, win)
746
- : new TuiDefaultAutofocusHandler(focusable, el, animationFrame$); },
747
- deps: [
748
- [new i0.Optional(), new i0.Self(), tokens.TUI_FOCUSABLE_ITEM_ACCESSOR],
749
- i0.ElementRef,
750
- common.ANIMATION_FRAME,
751
- i0.Renderer2,
752
- i0.NgZone,
753
- common.WINDOW,
754
- tokens.TUI_IS_IOS,
755
- ],
756
- },
757
- i1$1.TuiDestroyService,
758
- ];
587
+ var TUI_AUTOFOCUS_DEFAULT_OPTIONS = {
588
+ delay: NaN, // NaN = no delay/sync
589
+ };
590
+ var TUI_AUTOFOCUS_OPTIONS = miscellaneous.tuiCreateToken(TUI_AUTOFOCUS_DEFAULT_OPTIONS);
591
+ function tuiAutoFocusOptionsProvider(options) {
592
+ return miscellaneous.tuiProvideOptions(TUI_AUTOFOCUS_OPTIONS, options, TUI_AUTOFOCUS_DEFAULT_OPTIONS);
593
+ }
594
+ var TUI_AUTOFOCUS_HANDLER = new i0.InjectionToken('[TUI_AUTOFOCUS_HANDLER]');
595
+ var TUI_AUTOFOCUS_PROVIDERS = [
596
+ {
597
+ provide: TUI_AUTOFOCUS_HANDLER,
598
+ useFactory: function (focusable, el, animationFrame$, renderer, zone, win, isIos) { return isIos
599
+ ? new TuiIosAutofocusHandler(focusable, el, renderer, zone, win)
600
+ : new TuiDefaultAutofocusHandler(focusable, el, animationFrame$); },
601
+ deps: [
602
+ [new i0.Optional(), new i0.Self(), tokens.TUI_FOCUSABLE_ITEM_ACCESSOR],
603
+ i0.ElementRef,
604
+ common.ANIMATION_FRAME,
605
+ i0.Renderer2,
606
+ i0.NgZone,
607
+ common.WINDOW,
608
+ tokens.TUI_IS_IOS,
609
+ ],
610
+ },
611
+ i1$1.TuiDestroyService,
612
+ ];
759
613
 
760
- var TuiAutoFocusDirective = /** @class */ (function () {
761
- function TuiAutoFocusDirective(handler, options, destroy$) {
762
- this.handler = handler;
763
- this.options = options;
764
- this.destroy$ = destroy$;
765
- this.autoFocus = true;
766
- }
767
- TuiAutoFocusDirective.prototype.ngAfterViewInit = function () {
768
- if (coercion.tuiCoerceBooleanProperty(this.autoFocus)) {
769
- this.focus();
770
- }
771
- };
772
- TuiAutoFocusDirective.prototype.focus = function () {
773
- var _this = this;
774
- if (Number.isNaN(this.options.delay)) {
775
- void Promise.resolve().then(function () { return _this.handler.setFocus(); });
776
- }
777
- else {
778
- i1.timer(this.options.delay)
779
- .pipe(operators.takeUntil(this.destroy$))
780
- .subscribe(function () { return _this.handler.setFocus(); });
781
- }
782
- };
783
- return TuiAutoFocusDirective;
784
- }());
785
- TuiAutoFocusDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiAutoFocusDirective, deps: [{ token: TUI_AUTOFOCUS_HANDLER }, { token: TUI_AUTOFOCUS_OPTIONS }, { token: i1$1.TuiDestroyService, self: true }], target: i0__namespace.ɵɵFactoryTarget.Directive });
786
- TuiAutoFocusDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiAutoFocusDirective, selector: "[tuiAutoFocus]", inputs: { autoFocus: ["tuiAutoFocus", "autoFocus"] }, providers: TUI_AUTOFOCUS_PROVIDERS, ngImport: i0__namespace });
787
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiAutoFocusDirective, decorators: [{
788
- type: i0.Directive,
789
- args: [{
790
- selector: '[tuiAutoFocus]',
791
- providers: TUI_AUTOFOCUS_PROVIDERS,
792
- }]
793
- }], ctorParameters: function () {
794
- return [{ type: undefined, decorators: [{
795
- type: i0.Inject,
796
- args: [TUI_AUTOFOCUS_HANDLER]
797
- }] }, { type: undefined, decorators: [{
798
- type: i0.Inject,
799
- args: [TUI_AUTOFOCUS_OPTIONS]
800
- }] }, { type: i1__namespace$1.TuiDestroyService, decorators: [{
801
- type: i0.Self
802
- }, {
803
- type: i0.Inject,
804
- args: [i1$1.TuiDestroyService]
805
- }] }];
806
- }, propDecorators: { autoFocus: [{
807
- type: i0.Input,
808
- args: ['tuiAutoFocus']
809
- }] } });
614
+ var TuiAutoFocusDirective = /** @class */ (function () {
615
+ function TuiAutoFocusDirective(handler, options, destroy$) {
616
+ this.handler = handler;
617
+ this.options = options;
618
+ this.destroy$ = destroy$;
619
+ this.autoFocus = true;
620
+ }
621
+ TuiAutoFocusDirective.prototype.ngAfterViewInit = function () {
622
+ if (coercion.tuiCoerceBooleanProperty(this.autoFocus)) {
623
+ this.focus();
624
+ }
625
+ };
626
+ TuiAutoFocusDirective.prototype.focus = function () {
627
+ var _this = this;
628
+ if (Number.isNaN(this.options.delay)) {
629
+ void Promise.resolve().then(function () { return _this.handler.setFocus(); });
630
+ }
631
+ else {
632
+ i1.timer(this.options.delay)
633
+ .pipe(operators.takeUntil(this.destroy$))
634
+ .subscribe(function () { return _this.handler.setFocus(); });
635
+ }
636
+ };
637
+ return TuiAutoFocusDirective;
638
+ }());
639
+ TuiAutoFocusDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiAutoFocusDirective, deps: [{ token: TUI_AUTOFOCUS_HANDLER }, { token: TUI_AUTOFOCUS_OPTIONS }, { token: i1$1.TuiDestroyService, self: true }], target: i0__namespace.ɵɵFactoryTarget.Directive });
640
+ TuiAutoFocusDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiAutoFocusDirective, selector: "[tuiAutoFocus]", inputs: { autoFocus: ["tuiAutoFocus", "autoFocus"] }, providers: TUI_AUTOFOCUS_PROVIDERS, ngImport: i0__namespace });
641
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiAutoFocusDirective, decorators: [{
642
+ type: i0.Directive,
643
+ args: [{
644
+ selector: '[tuiAutoFocus]',
645
+ providers: TUI_AUTOFOCUS_PROVIDERS,
646
+ }]
647
+ }], ctorParameters: function () {
648
+ return [{ type: undefined, decorators: [{
649
+ type: i0.Inject,
650
+ args: [TUI_AUTOFOCUS_HANDLER]
651
+ }] }, { type: undefined, decorators: [{
652
+ type: i0.Inject,
653
+ args: [TUI_AUTOFOCUS_OPTIONS]
654
+ }] }, { type: i1__namespace$1.TuiDestroyService, decorators: [{
655
+ type: i0.Self
656
+ }, {
657
+ type: i0.Inject,
658
+ args: [i1$1.TuiDestroyService]
659
+ }] }];
660
+ }, propDecorators: { autoFocus: [{
661
+ type: i0.Input,
662
+ args: ['tuiAutoFocus']
663
+ }] } });
810
664
 
811
- var TuiAutoFocusModule = /** @class */ (function () {
812
- function TuiAutoFocusModule() {
813
- }
814
- return TuiAutoFocusModule;
815
- }());
816
- TuiAutoFocusModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiAutoFocusModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
817
- TuiAutoFocusModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiAutoFocusModule, declarations: [TuiAutoFocusDirective], exports: [TuiAutoFocusDirective] });
818
- TuiAutoFocusModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiAutoFocusModule });
819
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiAutoFocusModule, decorators: [{
820
- type: i0.NgModule,
821
- args: [{
822
- declarations: [TuiAutoFocusDirective],
823
- exports: [TuiAutoFocusDirective],
824
- }]
825
- }] });
665
+ var TuiAutoFocusModule = /** @class */ (function () {
666
+ function TuiAutoFocusModule() {
667
+ }
668
+ return TuiAutoFocusModule;
669
+ }());
670
+ TuiAutoFocusModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiAutoFocusModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
671
+ TuiAutoFocusModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiAutoFocusModule, declarations: [TuiAutoFocusDirective], exports: [TuiAutoFocusDirective] });
672
+ TuiAutoFocusModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiAutoFocusModule });
673
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiAutoFocusModule, decorators: [{
674
+ type: i0.NgModule,
675
+ args: [{
676
+ declarations: [TuiAutoFocusDirective],
677
+ exports: [TuiAutoFocusDirective],
678
+ }]
679
+ }] });
826
680
 
827
- var TuiSynchronousAutofocusHandler = /** @class */ (function (_super) {
828
- __extends(TuiSynchronousAutofocusHandler, _super);
829
- function TuiSynchronousAutofocusHandler(focusable, el) {
830
- return _super.call(this, focusable, el) || this;
831
- }
832
- TuiSynchronousAutofocusHandler.prototype.setFocus = function () {
833
- this.element.focus({ preventScroll: true });
834
- };
835
- return TuiSynchronousAutofocusHandler;
836
- }(AbstractTuiAutofocusHandler));
837
- TuiSynchronousAutofocusHandler.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiSynchronousAutofocusHandler, deps: [{ token: tokens.TUI_FOCUSABLE_ITEM_ACCESSOR, optional: true, self: true }, { token: i0.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
838
- TuiSynchronousAutofocusHandler.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiSynchronousAutofocusHandler, usesInheritance: true, ngImport: i0__namespace });
839
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiSynchronousAutofocusHandler, decorators: [{
840
- type: i0.Directive
841
- }], ctorParameters: function () {
842
- return [{ type: undefined, decorators: [{
843
- type: i0.Optional
844
- }, {
845
- type: i0.Self
846
- }, {
847
- type: i0.Inject,
848
- args: [tokens.TUI_FOCUSABLE_ITEM_ACCESSOR]
849
- }] }, { type: i0__namespace.ElementRef, decorators: [{
850
- type: i0.Inject,
851
- args: [i0.ElementRef]
852
- }] }];
853
- } });
681
+ var TuiSynchronousAutofocusHandler = /** @class */ (function (_super) {
682
+ __extends(TuiSynchronousAutofocusHandler, _super);
683
+ function TuiSynchronousAutofocusHandler(focusable, el) {
684
+ return _super.call(this, focusable, el) || this;
685
+ }
686
+ TuiSynchronousAutofocusHandler.prototype.setFocus = function () {
687
+ this.element.focus({ preventScroll: true });
688
+ };
689
+ return TuiSynchronousAutofocusHandler;
690
+ }(AbstractTuiAutofocusHandler));
691
+ TuiSynchronousAutofocusHandler.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiSynchronousAutofocusHandler, deps: [{ token: tokens.TUI_FOCUSABLE_ITEM_ACCESSOR, optional: true, self: true }, { token: i0.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
692
+ TuiSynchronousAutofocusHandler.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiSynchronousAutofocusHandler, usesInheritance: true, ngImport: i0__namespace });
693
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiSynchronousAutofocusHandler, decorators: [{
694
+ type: i0.Directive
695
+ }], ctorParameters: function () {
696
+ return [{ type: undefined, decorators: [{
697
+ type: i0.Optional
698
+ }, {
699
+ type: i0.Self
700
+ }, {
701
+ type: i0.Inject,
702
+ args: [tokens.TUI_FOCUSABLE_ITEM_ACCESSOR]
703
+ }] }, { type: i0__namespace.ElementRef, decorators: [{
704
+ type: i0.Inject,
705
+ args: [i0.ElementRef]
706
+ }] }];
707
+ } });
854
708
 
855
- /**
856
- * Generated bundle index. Do not edit.
857
- */
709
+ /**
710
+ * Generated bundle index. Do not edit.
711
+ */
858
712
 
859
- exports.AbstractTuiAutofocusHandler = AbstractTuiAutofocusHandler;
860
- exports.TUI_AUTOFOCUS_DEFAULT_OPTIONS = TUI_AUTOFOCUS_DEFAULT_OPTIONS;
861
- exports.TUI_AUTOFOCUS_HANDLER = TUI_AUTOFOCUS_HANDLER;
862
- exports.TUI_AUTOFOCUS_OPTIONS = TUI_AUTOFOCUS_OPTIONS;
863
- exports.TUI_AUTOFOCUS_PROVIDERS = TUI_AUTOFOCUS_PROVIDERS;
864
- exports.TuiAutoFocusDirective = TuiAutoFocusDirective;
865
- exports.TuiAutoFocusModule = TuiAutoFocusModule;
866
- exports.TuiDefaultAutofocusHandler = TuiDefaultAutofocusHandler;
867
- exports.TuiIosAutofocusHandler = TuiIosAutofocusHandler;
868
- exports.TuiSynchronousAutofocusHandler = TuiSynchronousAutofocusHandler;
869
- exports.tuiAutoFocusOptionsProvider = tuiAutoFocusOptionsProvider;
713
+ exports.AbstractTuiAutofocusHandler = AbstractTuiAutofocusHandler;
714
+ exports.TUI_AUTOFOCUS_DEFAULT_OPTIONS = TUI_AUTOFOCUS_DEFAULT_OPTIONS;
715
+ exports.TUI_AUTOFOCUS_HANDLER = TUI_AUTOFOCUS_HANDLER;
716
+ exports.TUI_AUTOFOCUS_OPTIONS = TUI_AUTOFOCUS_OPTIONS;
717
+ exports.TUI_AUTOFOCUS_PROVIDERS = TUI_AUTOFOCUS_PROVIDERS;
718
+ exports.TuiAutoFocusDirective = TuiAutoFocusDirective;
719
+ exports.TuiAutoFocusModule = TuiAutoFocusModule;
720
+ exports.TuiDefaultAutofocusHandler = TuiDefaultAutofocusHandler;
721
+ exports.TuiIosAutofocusHandler = TuiIosAutofocusHandler;
722
+ exports.TuiSynchronousAutofocusHandler = TuiSynchronousAutofocusHandler;
723
+ exports.tuiAutoFocusOptionsProvider = tuiAutoFocusOptionsProvider;
870
724
 
871
- Object.defineProperty(exports, '__esModule', { value: true });
725
+ Object.defineProperty(exports, '__esModule', { value: true });
872
726
 
873
727
  }));
874
728
  //# sourceMappingURL=taiga-ui-cdk-directives-auto-focus.umd.js.map