@skyux/lookup 5.5.0 → 5.6.2
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.
- package/bundles/skyux-lookup.umd.js +1034 -1049
- package/documentation.json +664 -782
- package/esm2015/lib/modules/autocomplete/autocomplete-adapter.service.js +0 -1
- package/esm2015/lib/modules/autocomplete/autocomplete-adapter.service.js.map +1 -1
- package/esm2015/lib/modules/autocomplete/autocomplete-default-search-function.js.map +1 -1
- package/esm2015/lib/modules/autocomplete/autocomplete-input.directive.js +6 -5
- package/esm2015/lib/modules/autocomplete/autocomplete-input.directive.js.map +1 -1
- package/esm2015/lib/modules/autocomplete/autocomplete-search-async-disabled.pipe.js.map +1 -1
- package/esm2015/lib/modules/autocomplete/autocomplete.component.js +11 -5
- package/esm2015/lib/modules/autocomplete/autocomplete.component.js.map +1 -1
- package/esm2015/lib/modules/autocomplete/autocomplete.module.js +1 -1
- package/esm2015/lib/modules/autocomplete/autocomplete.module.js.map +1 -1
- package/esm2015/lib/modules/autocomplete/types/autocomplete-search-async-args.js.map +1 -1
- package/esm2015/lib/modules/autocomplete/types/autocomplete-search-async-function.js.map +1 -1
- package/esm2015/lib/modules/country-field/country-field.component.js +9 -9
- package/esm2015/lib/modules/country-field/country-field.component.js.map +1 -1
- package/esm2015/lib/modules/country-field/country-field.module.js +1 -1
- package/esm2015/lib/modules/country-field/country-field.module.js.map +1 -1
- package/esm2015/lib/modules/lookup/lookup-autocomplete-adapter.js +7 -1
- package/esm2015/lib/modules/lookup/lookup-autocomplete-adapter.js.map +1 -1
- package/esm2015/lib/modules/lookup/lookup-show-more-async-modal.component.js.map +1 -1
- package/esm2015/lib/modules/lookup/lookup-show-more-modal.component.js +6 -6
- package/esm2015/lib/modules/lookup/lookup-show-more-modal.component.js.map +1 -1
- package/esm2015/lib/modules/lookup/lookup.component.js +16 -14
- package/esm2015/lib/modules/lookup/lookup.component.js.map +1 -1
- package/esm2015/lib/modules/lookup/lookup.module.js +4 -4
- package/esm2015/lib/modules/lookup/lookup.module.js.map +1 -1
- package/esm2015/lib/modules/lookup/types/lookup-show-more-config.js.map +1 -1
- package/esm2015/lib/modules/lookup/types/lookup-show-more-native-picker-async-context.js.map +1 -1
- package/esm2015/lib/modules/lookup/types/lookup-show-more-native-picker-context.js.map +1 -1
- package/esm2015/lib/modules/search/search-adapter.service.js +3 -3
- package/esm2015/lib/modules/search/search-adapter.service.js.map +1 -1
- package/esm2015/lib/modules/search/search.component.js +2 -2
- package/esm2015/lib/modules/search/search.component.js.map +1 -1
- package/esm2015/lib/modules/search/search.module.js +1 -1
- package/esm2015/lib/modules/search/search.module.js.map +1 -1
- package/esm2015/lib/modules/shared/sky-lookup-resources.module.js +1 -1
- package/esm2015/lib/modules/shared/sky-lookup-resources.module.js.map +1 -1
- package/esm2015/testing/country-field/country-field-fixture.js.map +1 -1
- package/esm2015/testing/country-field/country-field-testing.module.js.map +1 -1
- package/esm2015/testing/search/search-fixture.js.map +1 -1
- package/esm2015/testing/search/search-testing.module.js.map +1 -1
- package/fesm2015/skyux-lookup-testing.js.map +1 -1
- package/fesm2015/skyux-lookup.js +523 -538
- package/fesm2015/skyux-lookup.js.map +1 -1
- package/lib/modules/autocomplete/autocomplete-adapter.service.d.ts +0 -1
- package/lib/modules/autocomplete/autocomplete-default-search-function.d.ts +1 -1
- package/lib/modules/autocomplete/autocomplete.component.d.ts +10 -4
- package/lib/modules/autocomplete/types/autocomplete-search-async-args.d.ts +1 -1
- package/lib/modules/country-field/country-field.component.d.ts +5 -5
- package/lib/modules/lookup/lookup-autocomplete-adapter.d.ts +7 -1
- package/lib/modules/lookup/lookup.component.d.ts +3 -3
- package/lib/modules/search/search.component.d.ts +1 -1
- package/package.json +21 -18
- package/esm2015/lib/polyfills.js +0 -30
- package/esm2015/lib/polyfills.js.map +0 -1
- package/lib/polyfills.d.ts +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/forms'), require('@skyux/core'), require('@skyux/indicators'), require('@skyux/theme'), require('@skyux/i18n'), require('rxjs'), require('rxjs/operators'), require('@skyux/forms'), require('intl-tel-input'), require('@skyux/layout'), require('@skyux/lists'), require('@skyux/modals'), require('@angular/animations')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define('@skyux/lookup', ['exports', '@angular/common', '@angular/core', '@angular/forms', '@skyux/core', '@skyux/indicators', '@skyux/theme', '@skyux/i18n', 'rxjs', 'rxjs/operators', '@skyux/forms', 'intl-tel-input', '@skyux/layout', '@skyux/lists', '@skyux/modals', '@angular/animations'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.skyux = global.skyux || {}, global.skyux.lookup = {}), global.ng.common, global.ng.core, global.ng.forms, global.i1, global.i4, global.i7, global.i5, global.rxjs, global.rxjs.operators, global.i6, null, global.
|
|
5
|
-
})(this, (function (exports, i6$1, i0, i8, i1, i4, i7, i5, rxjs, operators, i6, intlTelInput,
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.skyux = global.skyux || {}, global.skyux.lookup = {}), global.ng.common, global.ng.core, global.ng.forms, global.i1, global.i4, global.i7, global.i5, global.rxjs, global.rxjs.operators, global.i6, null, global.i4$1, global.i7$1, global.i1$1, global.ng.animations));
|
|
5
|
+
})(this, (function (exports, i6$1, i0, i8, i1, i4, i7, i5, rxjs, operators, i6, intlTelInput, i4$1, i7$1, i1$1, animations) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespace(e) {
|
|
8
8
|
if (e && e.__esModule) return e;
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
var i7__namespace = /*#__PURE__*/_interopNamespace(i7);
|
|
31
31
|
var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
|
|
32
32
|
var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
|
|
33
|
-
var
|
|
33
|
+
var i4__namespace$1 = /*#__PURE__*/_interopNamespace(i4$1);
|
|
34
34
|
var i7__namespace$1 = /*#__PURE__*/_interopNamespace(i7$1);
|
|
35
35
|
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
|
|
36
36
|
|
|
@@ -109,476 +109,6 @@
|
|
|
109
109
|
}]
|
|
110
110
|
}] });
|
|
111
111
|
|
|
112
|
-
/*! *****************************************************************************
|
|
113
|
-
Copyright (c) Microsoft Corporation.
|
|
114
|
-
|
|
115
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
116
|
-
purpose with or without fee is hereby granted.
|
|
117
|
-
|
|
118
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
119
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
120
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
121
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
122
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
123
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
124
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
125
|
-
***************************************************************************** */
|
|
126
|
-
/* global Reflect, Promise */
|
|
127
|
-
var extendStatics = function (d, b) {
|
|
128
|
-
extendStatics = Object.setPrototypeOf ||
|
|
129
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
130
|
-
function (d, b) { for (var p in b)
|
|
131
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
132
|
-
d[p] = b[p]; };
|
|
133
|
-
return extendStatics(d, b);
|
|
134
|
-
};
|
|
135
|
-
function __extends(d, b) {
|
|
136
|
-
if (typeof b !== "function" && b !== null)
|
|
137
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
138
|
-
extendStatics(d, b);
|
|
139
|
-
function __() { this.constructor = d; }
|
|
140
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
141
|
-
}
|
|
142
|
-
var __assign = function () {
|
|
143
|
-
__assign = Object.assign || function __assign(t) {
|
|
144
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
145
|
-
s = arguments[i];
|
|
146
|
-
for (var p in s)
|
|
147
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
148
|
-
t[p] = s[p];
|
|
149
|
-
}
|
|
150
|
-
return t;
|
|
151
|
-
};
|
|
152
|
-
return __assign.apply(this, arguments);
|
|
153
|
-
};
|
|
154
|
-
function __rest(s, e) {
|
|
155
|
-
var t = {};
|
|
156
|
-
for (var p in s)
|
|
157
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
158
|
-
t[p] = s[p];
|
|
159
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
160
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
161
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
162
|
-
t[p[i]] = s[p[i]];
|
|
163
|
-
}
|
|
164
|
-
return t;
|
|
165
|
-
}
|
|
166
|
-
function __decorate(decorators, target, key, desc) {
|
|
167
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
168
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
169
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
170
|
-
else
|
|
171
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
172
|
-
if (d = decorators[i])
|
|
173
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
174
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
175
|
-
}
|
|
176
|
-
function __param(paramIndex, decorator) {
|
|
177
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
|
178
|
-
}
|
|
179
|
-
function __metadata(metadataKey, metadataValue) {
|
|
180
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
181
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
|
182
|
-
}
|
|
183
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
184
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
185
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
186
|
-
function fulfilled(value) { try {
|
|
187
|
-
step(generator.next(value));
|
|
188
|
-
}
|
|
189
|
-
catch (e) {
|
|
190
|
-
reject(e);
|
|
191
|
-
} }
|
|
192
|
-
function rejected(value) { try {
|
|
193
|
-
step(generator["throw"](value));
|
|
194
|
-
}
|
|
195
|
-
catch (e) {
|
|
196
|
-
reject(e);
|
|
197
|
-
} }
|
|
198
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
199
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
function __generator(thisArg, body) {
|
|
203
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
204
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
205
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
206
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
207
|
-
function step(op) {
|
|
208
|
-
if (f)
|
|
209
|
-
throw new TypeError("Generator is already executing.");
|
|
210
|
-
while (_)
|
|
211
|
-
try {
|
|
212
|
-
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)
|
|
213
|
-
return t;
|
|
214
|
-
if (y = 0, t)
|
|
215
|
-
op = [op[0] & 2, t.value];
|
|
216
|
-
switch (op[0]) {
|
|
217
|
-
case 0:
|
|
218
|
-
case 1:
|
|
219
|
-
t = op;
|
|
220
|
-
break;
|
|
221
|
-
case 4:
|
|
222
|
-
_.label++;
|
|
223
|
-
return { value: op[1], done: false };
|
|
224
|
-
case 5:
|
|
225
|
-
_.label++;
|
|
226
|
-
y = op[1];
|
|
227
|
-
op = [0];
|
|
228
|
-
continue;
|
|
229
|
-
case 7:
|
|
230
|
-
op = _.ops.pop();
|
|
231
|
-
_.trys.pop();
|
|
232
|
-
continue;
|
|
233
|
-
default:
|
|
234
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
235
|
-
_ = 0;
|
|
236
|
-
continue;
|
|
237
|
-
}
|
|
238
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
239
|
-
_.label = op[1];
|
|
240
|
-
break;
|
|
241
|
-
}
|
|
242
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
243
|
-
_.label = t[1];
|
|
244
|
-
t = op;
|
|
245
|
-
break;
|
|
246
|
-
}
|
|
247
|
-
if (t && _.label < t[2]) {
|
|
248
|
-
_.label = t[2];
|
|
249
|
-
_.ops.push(op);
|
|
250
|
-
break;
|
|
251
|
-
}
|
|
252
|
-
if (t[2])
|
|
253
|
-
_.ops.pop();
|
|
254
|
-
_.trys.pop();
|
|
255
|
-
continue;
|
|
256
|
-
}
|
|
257
|
-
op = body.call(thisArg, _);
|
|
258
|
-
}
|
|
259
|
-
catch (e) {
|
|
260
|
-
op = [6, e];
|
|
261
|
-
y = 0;
|
|
262
|
-
}
|
|
263
|
-
finally {
|
|
264
|
-
f = t = 0;
|
|
265
|
-
}
|
|
266
|
-
if (op[0] & 5)
|
|
267
|
-
throw op[1];
|
|
268
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
272
|
-
if (k2 === undefined)
|
|
273
|
-
k2 = k;
|
|
274
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
275
|
-
}) : (function (o, m, k, k2) {
|
|
276
|
-
if (k2 === undefined)
|
|
277
|
-
k2 = k;
|
|
278
|
-
o[k2] = m[k];
|
|
279
|
-
});
|
|
280
|
-
function __exportStar(m, o) {
|
|
281
|
-
for (var p in m)
|
|
282
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
283
|
-
__createBinding(o, m, p);
|
|
284
|
-
}
|
|
285
|
-
function __values(o) {
|
|
286
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
287
|
-
if (m)
|
|
288
|
-
return m.call(o);
|
|
289
|
-
if (o && typeof o.length === "number")
|
|
290
|
-
return {
|
|
291
|
-
next: function () {
|
|
292
|
-
if (o && i >= o.length)
|
|
293
|
-
o = void 0;
|
|
294
|
-
return { value: o && o[i++], done: !o };
|
|
295
|
-
}
|
|
296
|
-
};
|
|
297
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
298
|
-
}
|
|
299
|
-
function __read(o, n) {
|
|
300
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
301
|
-
if (!m)
|
|
302
|
-
return o;
|
|
303
|
-
var i = m.call(o), r, ar = [], e;
|
|
304
|
-
try {
|
|
305
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
306
|
-
ar.push(r.value);
|
|
307
|
-
}
|
|
308
|
-
catch (error) {
|
|
309
|
-
e = { error: error };
|
|
310
|
-
}
|
|
311
|
-
finally {
|
|
312
|
-
try {
|
|
313
|
-
if (r && !r.done && (m = i["return"]))
|
|
314
|
-
m.call(i);
|
|
315
|
-
}
|
|
316
|
-
finally {
|
|
317
|
-
if (e)
|
|
318
|
-
throw e.error;
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
return ar;
|
|
322
|
-
}
|
|
323
|
-
/** @deprecated */
|
|
324
|
-
function __spread() {
|
|
325
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
326
|
-
ar = ar.concat(__read(arguments[i]));
|
|
327
|
-
return ar;
|
|
328
|
-
}
|
|
329
|
-
/** @deprecated */
|
|
330
|
-
function __spreadArrays() {
|
|
331
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
332
|
-
s += arguments[i].length;
|
|
333
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
334
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
335
|
-
r[k] = a[j];
|
|
336
|
-
return r;
|
|
337
|
-
}
|
|
338
|
-
function __spreadArray(to, from, pack) {
|
|
339
|
-
if (pack || arguments.length === 2)
|
|
340
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
341
|
-
if (ar || !(i in from)) {
|
|
342
|
-
if (!ar)
|
|
343
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
344
|
-
ar[i] = from[i];
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
348
|
-
}
|
|
349
|
-
function __await(v) {
|
|
350
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
351
|
-
}
|
|
352
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
353
|
-
if (!Symbol.asyncIterator)
|
|
354
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
355
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
356
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
357
|
-
function verb(n) { if (g[n])
|
|
358
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
359
|
-
function resume(n, v) { try {
|
|
360
|
-
step(g[n](v));
|
|
361
|
-
}
|
|
362
|
-
catch (e) {
|
|
363
|
-
settle(q[0][3], e);
|
|
364
|
-
} }
|
|
365
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
366
|
-
function fulfill(value) { resume("next", value); }
|
|
367
|
-
function reject(value) { resume("throw", value); }
|
|
368
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
369
|
-
resume(q[0][0], q[0][1]); }
|
|
370
|
-
}
|
|
371
|
-
function __asyncDelegator(o) {
|
|
372
|
-
var i, p;
|
|
373
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
374
|
-
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; }
|
|
375
|
-
}
|
|
376
|
-
function __asyncValues(o) {
|
|
377
|
-
if (!Symbol.asyncIterator)
|
|
378
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
379
|
-
var m = o[Symbol.asyncIterator], i;
|
|
380
|
-
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);
|
|
381
|
-
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); }); }; }
|
|
382
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
383
|
-
}
|
|
384
|
-
function __makeTemplateObject(cooked, raw) {
|
|
385
|
-
if (Object.defineProperty) {
|
|
386
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
|
387
|
-
}
|
|
388
|
-
else {
|
|
389
|
-
cooked.raw = raw;
|
|
390
|
-
}
|
|
391
|
-
return cooked;
|
|
392
|
-
}
|
|
393
|
-
;
|
|
394
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
395
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
396
|
-
}) : function (o, v) {
|
|
397
|
-
o["default"] = v;
|
|
398
|
-
};
|
|
399
|
-
function __importStar(mod) {
|
|
400
|
-
if (mod && mod.__esModule)
|
|
401
|
-
return mod;
|
|
402
|
-
var result = {};
|
|
403
|
-
if (mod != null)
|
|
404
|
-
for (var k in mod)
|
|
405
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
406
|
-
__createBinding(result, mod, k);
|
|
407
|
-
__setModuleDefault(result, mod);
|
|
408
|
-
return result;
|
|
409
|
-
}
|
|
410
|
-
function __importDefault(mod) {
|
|
411
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
412
|
-
}
|
|
413
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
414
|
-
if (kind === "a" && !f)
|
|
415
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
416
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
417
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
418
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
419
|
-
}
|
|
420
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
421
|
-
if (kind === "m")
|
|
422
|
-
throw new TypeError("Private method is not writable");
|
|
423
|
-
if (kind === "a" && !f)
|
|
424
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
425
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
426
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
427
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
/**
|
|
431
|
-
* @internal
|
|
432
|
-
*/
|
|
433
|
-
var SkyAutocompleteMessageType;
|
|
434
|
-
(function (SkyAutocompleteMessageType) {
|
|
435
|
-
/**
|
|
436
|
-
* Closes the dropdown.
|
|
437
|
-
*/
|
|
438
|
-
SkyAutocompleteMessageType[SkyAutocompleteMessageType["CloseDropdown"] = 0] = "CloseDropdown";
|
|
439
|
-
/**
|
|
440
|
-
* Repositions the dropdown.
|
|
441
|
-
*/
|
|
442
|
-
SkyAutocompleteMessageType[SkyAutocompleteMessageType["RepositionDropdown"] = 1] = "RepositionDropdown";
|
|
443
|
-
})(SkyAutocompleteMessageType || (SkyAutocompleteMessageType = {}));
|
|
444
|
-
|
|
445
|
-
// tslint:disable:no-null-keyword
|
|
446
|
-
/* istanbul ignore file */
|
|
447
|
-
// Polyfill for Element.closest().
|
|
448
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#Polyfill
|
|
449
|
-
// Returns the closest ancestor of the current element (or the current element itself) which
|
|
450
|
-
// matches the selectors given in parameter. If there isn't such an ancestor, it returns null.
|
|
451
|
-
if (!Element.prototype.closest) {
|
|
452
|
-
Element.prototype.closest = function (s) {
|
|
453
|
-
var el = this;
|
|
454
|
-
if (!document.documentElement.contains(el)) {
|
|
455
|
-
return null;
|
|
456
|
-
}
|
|
457
|
-
do {
|
|
458
|
-
if (el.matches(s)) {
|
|
459
|
-
return el;
|
|
460
|
-
}
|
|
461
|
-
el = el.parentElement || el.parentNode;
|
|
462
|
-
} while (el !== null && el.nodeType === 1);
|
|
463
|
-
return null;
|
|
464
|
-
};
|
|
465
|
-
}
|
|
466
|
-
// Polyfill for Element.matches().
|
|
467
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/Element/matches
|
|
468
|
-
// Returns true if the element would be selected by the specified selector string.
|
|
469
|
-
if (!Element.prototype.matches) {
|
|
470
|
-
Element.prototype.matches =
|
|
471
|
-
Element.prototype.msMatchesSelector ||
|
|
472
|
-
/* istanbul ignore next */ Element.prototype.webkitMatchesSelector;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
/**
|
|
476
|
-
* @internal
|
|
477
|
-
*/
|
|
478
|
-
var SkyAutocompleteAdapterService = /** @class */ (function () {
|
|
479
|
-
function SkyAutocompleteAdapterService(coreAdapterService, rendererFactory) {
|
|
480
|
-
this.coreAdapterService = coreAdapterService;
|
|
481
|
-
this.rendererFactory = rendererFactory;
|
|
482
|
-
this.renderer = this.rendererFactory.createRenderer(undefined, undefined);
|
|
483
|
-
}
|
|
484
|
-
/**
|
|
485
|
-
* Adds the className for the provided element.
|
|
486
|
-
*/
|
|
487
|
-
SkyAutocompleteAdapterService.prototype.addCSSClass = function (element, className) {
|
|
488
|
-
/* Sanity check */
|
|
489
|
-
/* istanbul ignore else */
|
|
490
|
-
if (element) {
|
|
491
|
-
this.renderer.addClass(element, className);
|
|
492
|
-
}
|
|
493
|
-
};
|
|
494
|
-
SkyAutocompleteAdapterService.prototype.getOverlayFocusableElements = function (overlay) {
|
|
495
|
-
return this.coreAdapterService.getFocusableChildren(
|
|
496
|
-
/* Sanity check - calling function also has null check */
|
|
497
|
-
/* istanbul ignore next */
|
|
498
|
-
overlay === null || overlay === void 0 ? void 0 : overlay.componentRef.location.nativeElement, { ignoreTabIndex: true });
|
|
499
|
-
};
|
|
500
|
-
/**
|
|
501
|
-
* Removes the className for the provided element.
|
|
502
|
-
*/
|
|
503
|
-
SkyAutocompleteAdapterService.prototype.removeCSSClass = function (element, className) {
|
|
504
|
-
/* Sanity check */
|
|
505
|
-
/* istanbul ignore else */
|
|
506
|
-
if (element) {
|
|
507
|
-
this.renderer.removeClass(element, className);
|
|
508
|
-
}
|
|
509
|
-
};
|
|
510
|
-
SkyAutocompleteAdapterService.prototype.setDropdownWidth = function (elementRef, dropdownRef, isInputBox) {
|
|
511
|
-
var parentElement = isInputBox
|
|
512
|
-
? elementRef.nativeElement.closest('.sky-input-box')
|
|
513
|
-
: elementRef.nativeElement;
|
|
514
|
-
if (parentElement) {
|
|
515
|
-
var width = parentElement.getBoundingClientRect().width;
|
|
516
|
-
this.renderer.setStyle(dropdownRef.nativeElement, 'width', width + "px");
|
|
517
|
-
}
|
|
518
|
-
};
|
|
519
|
-
/**
|
|
520
|
-
* Sets the `tabIndex` of the `element` to the provided `tabIndex`.
|
|
521
|
-
*/
|
|
522
|
-
SkyAutocompleteAdapterService.prototype.setTabIndex = function (element, tabIndex) {
|
|
523
|
-
element.tabIndex = tabIndex;
|
|
524
|
-
};
|
|
525
|
-
return SkyAutocompleteAdapterService;
|
|
526
|
-
}());
|
|
527
|
-
SkyAutocompleteAdapterService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAutocompleteAdapterService, deps: [{ token: i1__namespace.SkyCoreAdapterService }, { token: i0__namespace.RendererFactory2 }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
528
|
-
SkyAutocompleteAdapterService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAutocompleteAdapterService });
|
|
529
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAutocompleteAdapterService, decorators: [{
|
|
530
|
-
type: i0.Injectable
|
|
531
|
-
}], ctorParameters: function () { return [{ type: i1__namespace.SkyCoreAdapterService }, { type: i0__namespace.RendererFactory2 }]; } });
|
|
532
|
-
|
|
533
|
-
/**
|
|
534
|
-
* Removes diacritical characters from strings and replaces them with their normalized equivalent.
|
|
535
|
-
* For example: è becomes e, Å becomes A.
|
|
536
|
-
*/
|
|
537
|
-
function normalizeDiacritics(value) {
|
|
538
|
-
return value.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
function skyAutocompleteDefaultSearchFunction(options) {
|
|
542
|
-
var filterData = function (searchText, data) {
|
|
543
|
-
return data.filter(function (item) {
|
|
544
|
-
if (!options.searchFilters || !options.searchFilters.length) {
|
|
545
|
-
return true;
|
|
546
|
-
}
|
|
547
|
-
// Find the first failing filter (we can skip the others if one fails).
|
|
548
|
-
var failedFilter = options.searchFilters.find(function (filter) {
|
|
549
|
-
return !filter.call({}, searchText, item);
|
|
550
|
-
});
|
|
551
|
-
return failedFilter === undefined;
|
|
552
|
-
});
|
|
553
|
-
};
|
|
554
|
-
var search = function (searchText, data) {
|
|
555
|
-
var results = [];
|
|
556
|
-
/* Sanity check - autocomplete will not call search with empty search text */
|
|
557
|
-
/* istanbul ignore if */
|
|
558
|
-
if (!searchText) {
|
|
559
|
-
return results;
|
|
560
|
-
}
|
|
561
|
-
var searchTextNormalized = normalizeDiacritics(searchText).toUpperCase();
|
|
562
|
-
var filteredData = filterData(searchText, data);
|
|
563
|
-
var _loop_1 = function (i, n) {
|
|
564
|
-
var result = filteredData[i];
|
|
565
|
-
var isMatch = options.propertiesToSearch.find(function (property) {
|
|
566
|
-
var value = (result[property] || '').toString();
|
|
567
|
-
value = normalizeDiacritics(value).toUpperCase();
|
|
568
|
-
return value.indexOf(searchTextNormalized) > -1;
|
|
569
|
-
});
|
|
570
|
-
if (isMatch) {
|
|
571
|
-
results.push(result);
|
|
572
|
-
}
|
|
573
|
-
};
|
|
574
|
-
for (var i = 0, n = filteredData.length; i < n; i++) {
|
|
575
|
-
_loop_1(i, n);
|
|
576
|
-
}
|
|
577
|
-
return results;
|
|
578
|
-
};
|
|
579
|
-
return search;
|
|
580
|
-
}
|
|
581
|
-
|
|
582
112
|
// tslint:disable:no-forward-ref no-use-before-declare
|
|
583
113
|
var SKY_AUTOCOMPLETE_VALUE_ACCESSOR = {
|
|
584
114
|
provide: i8.NG_VALUE_ACCESSOR,
|
|
@@ -601,7 +131,8 @@
|
|
|
601
131
|
this._disabled = false;
|
|
602
132
|
this._focus = new rxjs.Subject();
|
|
603
133
|
this._textChanges = new rxjs.Subject();
|
|
604
|
-
|
|
134
|
+
// istanbul ignore next
|
|
135
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
605
136
|
this.onValidatorChange = function () { };
|
|
606
137
|
}
|
|
607
138
|
Object.defineProperty(SkyAutocompleteInputDirective.prototype, "autocompleteAttribute", {
|
|
@@ -711,146 +242,586 @@
|
|
|
711
242
|
this.isFirstChange = false;
|
|
712
243
|
}
|
|
713
244
|
}
|
|
714
|
-
},
|
|
715
|
-
enumerable: false,
|
|
716
|
-
configurable: true
|
|
717
|
-
});
|
|
718
|
-
SkyAutocompleteInputDirective.prototype.ngOnInit = function () {
|
|
719
|
-
var _this = this;
|
|
720
|
-
var element = this.elementRef.nativeElement;
|
|
721
|
-
this.setAttributes(element);
|
|
722
|
-
rxjs.fromEvent(element, 'input')
|
|
245
|
+
},
|
|
246
|
+
enumerable: false,
|
|
247
|
+
configurable: true
|
|
248
|
+
});
|
|
249
|
+
SkyAutocompleteInputDirective.prototype.ngOnInit = function () {
|
|
250
|
+
var _this = this;
|
|
251
|
+
var element = this.elementRef.nativeElement;
|
|
252
|
+
this.setAttributes(element);
|
|
253
|
+
rxjs.fromEvent(element, 'input')
|
|
254
|
+
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
255
|
+
.subscribe(function () {
|
|
256
|
+
/** Sanity check */
|
|
257
|
+
if (!_this.disabled) {
|
|
258
|
+
_this._textChanges.next({
|
|
259
|
+
value: _this.elementRef.nativeElement.value,
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
rxjs.fromEvent(element, 'blur')
|
|
264
|
+
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
265
|
+
.subscribe(function () {
|
|
266
|
+
/** Sanity check */
|
|
267
|
+
if (!_this.disabled) {
|
|
268
|
+
_this._blur.next();
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
rxjs.fromEvent(element, 'focus')
|
|
272
|
+
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
273
|
+
.subscribe(function () {
|
|
274
|
+
/** Sanity check */
|
|
275
|
+
if (!_this.disabled) {
|
|
276
|
+
_this._focus.next();
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
rxjs.fromEvent(element, 'change')
|
|
723
280
|
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
724
281
|
.subscribe(function () {
|
|
725
282
|
/** Sanity check */
|
|
283
|
+
/* istanbul ignore else */
|
|
726
284
|
if (!_this.disabled) {
|
|
727
|
-
_this.
|
|
728
|
-
|
|
729
|
-
|
|
285
|
+
_this.isFirstChange = false;
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
};
|
|
289
|
+
SkyAutocompleteInputDirective.prototype.ngOnDestroy = function () {
|
|
290
|
+
this._blur.complete();
|
|
291
|
+
this._textChanges.complete();
|
|
292
|
+
this.ngUnsubscribe.next();
|
|
293
|
+
this.ngUnsubscribe.complete();
|
|
294
|
+
this._blur = this._textChanges = this.ngUnsubscribe = undefined;
|
|
295
|
+
};
|
|
296
|
+
SkyAutocompleteInputDirective.prototype.writeValue = function (value) {
|
|
297
|
+
this.value = value;
|
|
298
|
+
};
|
|
299
|
+
SkyAutocompleteInputDirective.prototype.registerOnChange = function (fn) {
|
|
300
|
+
this.onChange = fn;
|
|
301
|
+
};
|
|
302
|
+
SkyAutocompleteInputDirective.prototype.registerOnTouched = function (fn) {
|
|
303
|
+
this.onTouched = fn;
|
|
304
|
+
};
|
|
305
|
+
SkyAutocompleteInputDirective.prototype.registerOnValidatorChange = function (fn) {
|
|
306
|
+
this.onValidatorChange = fn;
|
|
307
|
+
};
|
|
308
|
+
SkyAutocompleteInputDirective.prototype.restoreInputTextValueToPreviousState = function () {
|
|
309
|
+
var modelValue = this.getValueByKey();
|
|
310
|
+
// If the search field contains text, make sure that the value
|
|
311
|
+
// matches the selected descriptor key.
|
|
312
|
+
if (this.inputTextValue !== modelValue) {
|
|
313
|
+
this.inputTextValue = modelValue;
|
|
314
|
+
}
|
|
315
|
+
this.onTouched();
|
|
316
|
+
};
|
|
317
|
+
SkyAutocompleteInputDirective.prototype.setDisabledState = function (disabled) {
|
|
318
|
+
this.disabled = disabled;
|
|
319
|
+
};
|
|
320
|
+
SkyAutocompleteInputDirective.prototype.validate = function (control) {
|
|
321
|
+
if (!this.control) {
|
|
322
|
+
this.control = control;
|
|
323
|
+
}
|
|
324
|
+
return;
|
|
325
|
+
};
|
|
326
|
+
// See: https://www.w3.org/TR/wai-aria-practices/#kbd_focus_activedescendant
|
|
327
|
+
SkyAutocompleteInputDirective.prototype.setActiveDescendant = function (descendantId) {
|
|
328
|
+
if (descendantId) {
|
|
329
|
+
this.renderer.setAttribute(this.elementRef.nativeElement, 'aria-activedescendant', descendantId);
|
|
330
|
+
}
|
|
331
|
+
else {
|
|
332
|
+
this.renderer.removeAttribute(this.elementRef.nativeElement, 'aria-activedescendant');
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
// Angular automatically constructs these methods.
|
|
336
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
337
|
+
SkyAutocompleteInputDirective.prototype.onChange = function (value) { };
|
|
338
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
339
|
+
SkyAutocompleteInputDirective.prototype.onTouched = function () { };
|
|
340
|
+
SkyAutocompleteInputDirective.prototype.setAttributes = function (element) {
|
|
341
|
+
this.renderer.setAttribute(element, 'autocomplete', this.autocompleteAttribute);
|
|
342
|
+
this.renderer.setAttribute(element, 'autocapitalize', 'none');
|
|
343
|
+
this.renderer.setAttribute(element, 'autocorrect', 'off');
|
|
344
|
+
this.renderer.setAttribute(element, 'spellcheck', 'false');
|
|
345
|
+
this.renderer.addClass(element, 'sky-form-control');
|
|
346
|
+
};
|
|
347
|
+
SkyAutocompleteInputDirective.prototype.getValueByKey = function () {
|
|
348
|
+
return this.value ? this.value[this.displayWith] : undefined;
|
|
349
|
+
};
|
|
350
|
+
return SkyAutocompleteInputDirective;
|
|
351
|
+
}());
|
|
352
|
+
SkyAutocompleteInputDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAutocompleteInputDirective, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.Renderer2 }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
353
|
+
SkyAutocompleteInputDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: SkyAutocompleteInputDirective, selector: "input[skyAutocomplete], textarea[skyAutocomplete]", inputs: { autocompleteAttribute: "autocompleteAttribute", disabled: "disabled" }, providers: [SKY_AUTOCOMPLETE_VALUE_ACCESSOR, SKY_AUTOCOMPLETE_VALIDATOR], ngImport: i0__namespace });
|
|
354
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAutocompleteInputDirective, decorators: [{
|
|
355
|
+
type: i0.Directive,
|
|
356
|
+
args: [{
|
|
357
|
+
selector: 'input[skyAutocomplete], textarea[skyAutocomplete]',
|
|
358
|
+
providers: [SKY_AUTOCOMPLETE_VALUE_ACCESSOR, SKY_AUTOCOMPLETE_VALIDATOR],
|
|
359
|
+
}]
|
|
360
|
+
}], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.Renderer2 }]; }, propDecorators: { autocompleteAttribute: [{
|
|
361
|
+
type: i0.Input
|
|
362
|
+
}], disabled: [{
|
|
363
|
+
type: i0.Input
|
|
364
|
+
}] } });
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* @internal
|
|
368
|
+
*/
|
|
369
|
+
var SkyAutcompleteSearchAsyncDisabledPipe = /** @class */ (function () {
|
|
370
|
+
function SkyAutcompleteSearchAsyncDisabledPipe() {
|
|
371
|
+
}
|
|
372
|
+
SkyAutcompleteSearchAsyncDisabledPipe.prototype.transform = function (searchAsync, searchAsyncDisabled) {
|
|
373
|
+
return searchAsyncDisabled || searchAsync.observers.length === 0;
|
|
374
|
+
};
|
|
375
|
+
return SkyAutcompleteSearchAsyncDisabledPipe;
|
|
376
|
+
}());
|
|
377
|
+
SkyAutcompleteSearchAsyncDisabledPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAutcompleteSearchAsyncDisabledPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
378
|
+
SkyAutcompleteSearchAsyncDisabledPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAutcompleteSearchAsyncDisabledPipe, name: "skyAutocompleteSearchAsyncDisabled" });
|
|
379
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAutcompleteSearchAsyncDisabledPipe, decorators: [{
|
|
380
|
+
type: i0.Pipe,
|
|
381
|
+
args: [{
|
|
382
|
+
name: 'skyAutocompleteSearchAsyncDisabled',
|
|
383
|
+
}]
|
|
384
|
+
}] });
|
|
385
|
+
|
|
386
|
+
/*! *****************************************************************************
|
|
387
|
+
Copyright (c) Microsoft Corporation.
|
|
388
|
+
|
|
389
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
390
|
+
purpose with or without fee is hereby granted.
|
|
391
|
+
|
|
392
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
393
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
394
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
395
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
396
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
397
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
398
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
399
|
+
***************************************************************************** */
|
|
400
|
+
/* global Reflect, Promise */
|
|
401
|
+
var extendStatics = function (d, b) {
|
|
402
|
+
extendStatics = Object.setPrototypeOf ||
|
|
403
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
404
|
+
function (d, b) { for (var p in b)
|
|
405
|
+
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
406
|
+
d[p] = b[p]; };
|
|
407
|
+
return extendStatics(d, b);
|
|
408
|
+
};
|
|
409
|
+
function __extends(d, b) {
|
|
410
|
+
if (typeof b !== "function" && b !== null)
|
|
411
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
412
|
+
extendStatics(d, b);
|
|
413
|
+
function __() { this.constructor = d; }
|
|
414
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
415
|
+
}
|
|
416
|
+
var __assign = function () {
|
|
417
|
+
__assign = Object.assign || function __assign(t) {
|
|
418
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
419
|
+
s = arguments[i];
|
|
420
|
+
for (var p in s)
|
|
421
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
422
|
+
t[p] = s[p];
|
|
423
|
+
}
|
|
424
|
+
return t;
|
|
425
|
+
};
|
|
426
|
+
return __assign.apply(this, arguments);
|
|
427
|
+
};
|
|
428
|
+
function __rest(s, e) {
|
|
429
|
+
var t = {};
|
|
430
|
+
for (var p in s)
|
|
431
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
432
|
+
t[p] = s[p];
|
|
433
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
434
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
435
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
436
|
+
t[p[i]] = s[p[i]];
|
|
437
|
+
}
|
|
438
|
+
return t;
|
|
439
|
+
}
|
|
440
|
+
function __decorate(decorators, target, key, desc) {
|
|
441
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
442
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
443
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
444
|
+
else
|
|
445
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
446
|
+
if (d = decorators[i])
|
|
447
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
448
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
449
|
+
}
|
|
450
|
+
function __param(paramIndex, decorator) {
|
|
451
|
+
return function (target, key) { decorator(target, key, paramIndex); };
|
|
452
|
+
}
|
|
453
|
+
function __metadata(metadataKey, metadataValue) {
|
|
454
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
455
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
456
|
+
}
|
|
457
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
458
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
459
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
460
|
+
function fulfilled(value) { try {
|
|
461
|
+
step(generator.next(value));
|
|
462
|
+
}
|
|
463
|
+
catch (e) {
|
|
464
|
+
reject(e);
|
|
465
|
+
} }
|
|
466
|
+
function rejected(value) { try {
|
|
467
|
+
step(generator["throw"](value));
|
|
468
|
+
}
|
|
469
|
+
catch (e) {
|
|
470
|
+
reject(e);
|
|
471
|
+
} }
|
|
472
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
473
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
function __generator(thisArg, body) {
|
|
477
|
+
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
478
|
+
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
479
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
480
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
481
|
+
function step(op) {
|
|
482
|
+
if (f)
|
|
483
|
+
throw new TypeError("Generator is already executing.");
|
|
484
|
+
while (_)
|
|
485
|
+
try {
|
|
486
|
+
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)
|
|
487
|
+
return t;
|
|
488
|
+
if (y = 0, t)
|
|
489
|
+
op = [op[0] & 2, t.value];
|
|
490
|
+
switch (op[0]) {
|
|
491
|
+
case 0:
|
|
492
|
+
case 1:
|
|
493
|
+
t = op;
|
|
494
|
+
break;
|
|
495
|
+
case 4:
|
|
496
|
+
_.label++;
|
|
497
|
+
return { value: op[1], done: false };
|
|
498
|
+
case 5:
|
|
499
|
+
_.label++;
|
|
500
|
+
y = op[1];
|
|
501
|
+
op = [0];
|
|
502
|
+
continue;
|
|
503
|
+
case 7:
|
|
504
|
+
op = _.ops.pop();
|
|
505
|
+
_.trys.pop();
|
|
506
|
+
continue;
|
|
507
|
+
default:
|
|
508
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
509
|
+
_ = 0;
|
|
510
|
+
continue;
|
|
511
|
+
}
|
|
512
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
513
|
+
_.label = op[1];
|
|
514
|
+
break;
|
|
515
|
+
}
|
|
516
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
517
|
+
_.label = t[1];
|
|
518
|
+
t = op;
|
|
519
|
+
break;
|
|
520
|
+
}
|
|
521
|
+
if (t && _.label < t[2]) {
|
|
522
|
+
_.label = t[2];
|
|
523
|
+
_.ops.push(op);
|
|
524
|
+
break;
|
|
525
|
+
}
|
|
526
|
+
if (t[2])
|
|
527
|
+
_.ops.pop();
|
|
528
|
+
_.trys.pop();
|
|
529
|
+
continue;
|
|
530
|
+
}
|
|
531
|
+
op = body.call(thisArg, _);
|
|
730
532
|
}
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
.subscribe(function () {
|
|
735
|
-
/** Sanity check */
|
|
736
|
-
if (!_this.disabled) {
|
|
737
|
-
_this._blur.next();
|
|
533
|
+
catch (e) {
|
|
534
|
+
op = [6, e];
|
|
535
|
+
y = 0;
|
|
738
536
|
}
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
742
|
-
.subscribe(function () {
|
|
743
|
-
/** Sanity check */
|
|
744
|
-
if (!_this.disabled) {
|
|
745
|
-
_this._focus.next();
|
|
537
|
+
finally {
|
|
538
|
+
f = t = 0;
|
|
746
539
|
}
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
540
|
+
if (op[0] & 5)
|
|
541
|
+
throw op[1];
|
|
542
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
546
|
+
if (k2 === undefined)
|
|
547
|
+
k2 = k;
|
|
548
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
549
|
+
}) : (function (o, m, k, k2) {
|
|
550
|
+
if (k2 === undefined)
|
|
551
|
+
k2 = k;
|
|
552
|
+
o[k2] = m[k];
|
|
553
|
+
});
|
|
554
|
+
function __exportStar(m, o) {
|
|
555
|
+
for (var p in m)
|
|
556
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
557
|
+
__createBinding(o, m, p);
|
|
558
|
+
}
|
|
559
|
+
function __values(o) {
|
|
560
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
561
|
+
if (m)
|
|
562
|
+
return m.call(o);
|
|
563
|
+
if (o && typeof o.length === "number")
|
|
564
|
+
return {
|
|
565
|
+
next: function () {
|
|
566
|
+
if (o && i >= o.length)
|
|
567
|
+
o = void 0;
|
|
568
|
+
return { value: o && o[i++], done: !o };
|
|
755
569
|
}
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
|
|
570
|
+
};
|
|
571
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
572
|
+
}
|
|
573
|
+
function __read(o, n) {
|
|
574
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
575
|
+
if (!m)
|
|
576
|
+
return o;
|
|
577
|
+
var i = m.call(o), r, ar = [], e;
|
|
578
|
+
try {
|
|
579
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
580
|
+
ar.push(r.value);
|
|
581
|
+
}
|
|
582
|
+
catch (error) {
|
|
583
|
+
e = { error: error };
|
|
584
|
+
}
|
|
585
|
+
finally {
|
|
586
|
+
try {
|
|
587
|
+
if (r && !r.done && (m = i["return"]))
|
|
588
|
+
m.call(i);
|
|
589
|
+
}
|
|
590
|
+
finally {
|
|
591
|
+
if (e)
|
|
592
|
+
throw e.error;
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
return ar;
|
|
596
|
+
}
|
|
597
|
+
/** @deprecated */
|
|
598
|
+
function __spread() {
|
|
599
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
600
|
+
ar = ar.concat(__read(arguments[i]));
|
|
601
|
+
return ar;
|
|
602
|
+
}
|
|
603
|
+
/** @deprecated */
|
|
604
|
+
function __spreadArrays() {
|
|
605
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
606
|
+
s += arguments[i].length;
|
|
607
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
608
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
609
|
+
r[k] = a[j];
|
|
610
|
+
return r;
|
|
611
|
+
}
|
|
612
|
+
function __spreadArray(to, from, pack) {
|
|
613
|
+
if (pack || arguments.length === 2)
|
|
614
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
615
|
+
if (ar || !(i in from)) {
|
|
616
|
+
if (!ar)
|
|
617
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
618
|
+
ar[i] = from[i];
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
622
|
+
}
|
|
623
|
+
function __await(v) {
|
|
624
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
625
|
+
}
|
|
626
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
627
|
+
if (!Symbol.asyncIterator)
|
|
628
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
629
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
630
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
631
|
+
function verb(n) { if (g[n])
|
|
632
|
+
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
633
|
+
function resume(n, v) { try {
|
|
634
|
+
step(g[n](v));
|
|
635
|
+
}
|
|
636
|
+
catch (e) {
|
|
637
|
+
settle(q[0][3], e);
|
|
638
|
+
} }
|
|
639
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
640
|
+
function fulfill(value) { resume("next", value); }
|
|
641
|
+
function reject(value) { resume("throw", value); }
|
|
642
|
+
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
643
|
+
resume(q[0][0], q[0][1]); }
|
|
644
|
+
}
|
|
645
|
+
function __asyncDelegator(o) {
|
|
646
|
+
var i, p;
|
|
647
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
648
|
+
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; }
|
|
649
|
+
}
|
|
650
|
+
function __asyncValues(o) {
|
|
651
|
+
if (!Symbol.asyncIterator)
|
|
652
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
653
|
+
var m = o[Symbol.asyncIterator], i;
|
|
654
|
+
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);
|
|
655
|
+
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); }); }; }
|
|
656
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
657
|
+
}
|
|
658
|
+
function __makeTemplateObject(cooked, raw) {
|
|
659
|
+
if (Object.defineProperty) {
|
|
660
|
+
Object.defineProperty(cooked, "raw", { value: raw });
|
|
661
|
+
}
|
|
662
|
+
else {
|
|
663
|
+
cooked.raw = raw;
|
|
664
|
+
}
|
|
665
|
+
return cooked;
|
|
666
|
+
}
|
|
667
|
+
;
|
|
668
|
+
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
669
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
670
|
+
}) : function (o, v) {
|
|
671
|
+
o["default"] = v;
|
|
672
|
+
};
|
|
673
|
+
function __importStar(mod) {
|
|
674
|
+
if (mod && mod.__esModule)
|
|
675
|
+
return mod;
|
|
676
|
+
var result = {};
|
|
677
|
+
if (mod != null)
|
|
678
|
+
for (var k in mod)
|
|
679
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
680
|
+
__createBinding(result, mod, k);
|
|
681
|
+
__setModuleDefault(result, mod);
|
|
682
|
+
return result;
|
|
683
|
+
}
|
|
684
|
+
function __importDefault(mod) {
|
|
685
|
+
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
686
|
+
}
|
|
687
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
688
|
+
if (kind === "a" && !f)
|
|
689
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
690
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
691
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
692
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
693
|
+
}
|
|
694
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
695
|
+
if (kind === "m")
|
|
696
|
+
throw new TypeError("Private method is not writable");
|
|
697
|
+
if (kind === "a" && !f)
|
|
698
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
699
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
700
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
701
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
/**
|
|
705
|
+
* Removes diacritical characters from strings and replaces them with their normalized equivalent.
|
|
706
|
+
* For example: è becomes e, Å becomes A.
|
|
707
|
+
*/
|
|
708
|
+
function normalizeDiacritics(value) {
|
|
709
|
+
return value.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
/**
|
|
713
|
+
* @internal
|
|
714
|
+
*/
|
|
715
|
+
var SkyAutocompleteAdapterService = /** @class */ (function () {
|
|
716
|
+
function SkyAutocompleteAdapterService(coreAdapterService, rendererFactory) {
|
|
717
|
+
this.coreAdapterService = coreAdapterService;
|
|
718
|
+
this.rendererFactory = rendererFactory;
|
|
719
|
+
this.renderer = this.rendererFactory.createRenderer(undefined, undefined);
|
|
720
|
+
}
|
|
721
|
+
/**
|
|
722
|
+
* Adds the className for the provided element.
|
|
723
|
+
*/
|
|
724
|
+
SkyAutocompleteAdapterService.prototype.addCSSClass = function (element, className) {
|
|
725
|
+
/* Sanity check */
|
|
726
|
+
/* istanbul ignore else */
|
|
727
|
+
if (element) {
|
|
728
|
+
this.renderer.addClass(element, className);
|
|
729
|
+
}
|
|
770
730
|
};
|
|
771
|
-
|
|
772
|
-
this.
|
|
731
|
+
SkyAutocompleteAdapterService.prototype.getOverlayFocusableElements = function (overlay) {
|
|
732
|
+
return this.coreAdapterService.getFocusableChildren(
|
|
733
|
+
/* Sanity check - calling function also has null check */
|
|
734
|
+
/* istanbul ignore next */
|
|
735
|
+
overlay === null || overlay === void 0 ? void 0 : overlay.componentRef.location.nativeElement, { ignoreTabIndex: true });
|
|
773
736
|
};
|
|
774
|
-
|
|
775
|
-
|
|
737
|
+
/**
|
|
738
|
+
* Removes the className for the provided element.
|
|
739
|
+
*/
|
|
740
|
+
SkyAutocompleteAdapterService.prototype.removeCSSClass = function (element, className) {
|
|
741
|
+
/* Sanity check */
|
|
742
|
+
/* istanbul ignore else */
|
|
743
|
+
if (element) {
|
|
744
|
+
this.renderer.removeClass(element, className);
|
|
745
|
+
}
|
|
776
746
|
};
|
|
777
|
-
|
|
778
|
-
var
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
if (
|
|
782
|
-
|
|
747
|
+
SkyAutocompleteAdapterService.prototype.setDropdownWidth = function (elementRef, dropdownRef, isInputBox) {
|
|
748
|
+
var parentElement = isInputBox
|
|
749
|
+
? elementRef.nativeElement.closest('.sky-input-box')
|
|
750
|
+
: elementRef.nativeElement;
|
|
751
|
+
if (parentElement) {
|
|
752
|
+
var width = parentElement.getBoundingClientRect().width;
|
|
753
|
+
this.renderer.setStyle(dropdownRef.nativeElement, 'width', width + "px");
|
|
783
754
|
}
|
|
784
|
-
this.onTouched();
|
|
785
755
|
};
|
|
786
|
-
|
|
787
|
-
|
|
756
|
+
/**
|
|
757
|
+
* Sets the `tabIndex` of the `element` to the provided `tabIndex`.
|
|
758
|
+
*/
|
|
759
|
+
SkyAutocompleteAdapterService.prototype.setTabIndex = function (element, tabIndex) {
|
|
760
|
+
element.tabIndex = tabIndex;
|
|
788
761
|
};
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
762
|
+
return SkyAutocompleteAdapterService;
|
|
763
|
+
}());
|
|
764
|
+
SkyAutocompleteAdapterService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAutocompleteAdapterService, deps: [{ token: i1__namespace.SkyCoreAdapterService }, { token: i0__namespace.RendererFactory2 }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
765
|
+
SkyAutocompleteAdapterService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAutocompleteAdapterService });
|
|
766
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAutocompleteAdapterService, decorators: [{
|
|
767
|
+
type: i0.Injectable
|
|
768
|
+
}], ctorParameters: function () { return [{ type: i1__namespace.SkyCoreAdapterService }, { type: i0__namespace.RendererFactory2 }]; } });
|
|
769
|
+
|
|
770
|
+
function skyAutocompleteDefaultSearchFunction(options) {
|
|
771
|
+
var filterData = function (searchText, data) {
|
|
772
|
+
return data.filter(function (item) {
|
|
773
|
+
if (!options.searchFilters || !options.searchFilters.length) {
|
|
774
|
+
return true;
|
|
775
|
+
}
|
|
776
|
+
// Find the first failing filter (we can skip the others if one fails).
|
|
777
|
+
var failedFilter = options.searchFilters.find(function (filter) {
|
|
778
|
+
return !filter.call({}, searchText, item);
|
|
779
|
+
});
|
|
780
|
+
return failedFilter === undefined;
|
|
781
|
+
});
|
|
794
782
|
};
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
783
|
+
var search = function (searchText, data) {
|
|
784
|
+
var results = [];
|
|
785
|
+
/* Sanity check - autocomplete will not call search with empty search text */
|
|
786
|
+
/* istanbul ignore if */
|
|
787
|
+
if (!searchText) {
|
|
788
|
+
return results;
|
|
799
789
|
}
|
|
800
|
-
|
|
801
|
-
|
|
790
|
+
var searchTextNormalized = normalizeDiacritics(searchText).toUpperCase();
|
|
791
|
+
var filteredData = filterData(searchText, data);
|
|
792
|
+
var _loop_1 = function (i, n) {
|
|
793
|
+
var result = filteredData[i];
|
|
794
|
+
var isMatch = options.propertiesToSearch.find(function (property) {
|
|
795
|
+
var value = (result[property] || '').toString();
|
|
796
|
+
value = normalizeDiacritics(value).toUpperCase();
|
|
797
|
+
return value.indexOf(searchTextNormalized) > -1;
|
|
798
|
+
});
|
|
799
|
+
if (isMatch) {
|
|
800
|
+
results.push(result);
|
|
801
|
+
}
|
|
802
|
+
};
|
|
803
|
+
for (var i = 0, n = filteredData.length; i < n; i++) {
|
|
804
|
+
_loop_1(i, n);
|
|
802
805
|
}
|
|
806
|
+
return results;
|
|
803
807
|
};
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
SkyAutocompleteInputDirective.prototype.onChange = function (value) { };
|
|
807
|
-
/* istanbul ignore next */
|
|
808
|
-
SkyAutocompleteInputDirective.prototype.onTouched = function () { };
|
|
809
|
-
SkyAutocompleteInputDirective.prototype.setAttributes = function (element) {
|
|
810
|
-
this.renderer.setAttribute(element, 'autocomplete', this.autocompleteAttribute);
|
|
811
|
-
this.renderer.setAttribute(element, 'autocapitalize', 'none');
|
|
812
|
-
this.renderer.setAttribute(element, 'autocorrect', 'off');
|
|
813
|
-
this.renderer.setAttribute(element, 'spellcheck', 'false');
|
|
814
|
-
this.renderer.addClass(element, 'sky-form-control');
|
|
815
|
-
};
|
|
816
|
-
SkyAutocompleteInputDirective.prototype.getValueByKey = function () {
|
|
817
|
-
return this.value ? this.value[this.displayWith] : undefined;
|
|
818
|
-
};
|
|
819
|
-
return SkyAutocompleteInputDirective;
|
|
820
|
-
}());
|
|
821
|
-
SkyAutocompleteInputDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAutocompleteInputDirective, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.Renderer2 }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
822
|
-
SkyAutocompleteInputDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: SkyAutocompleteInputDirective, selector: "input[skyAutocomplete], textarea[skyAutocomplete]", inputs: { autocompleteAttribute: "autocompleteAttribute", disabled: "disabled" }, providers: [SKY_AUTOCOMPLETE_VALUE_ACCESSOR, SKY_AUTOCOMPLETE_VALIDATOR], ngImport: i0__namespace });
|
|
823
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAutocompleteInputDirective, decorators: [{
|
|
824
|
-
type: i0.Directive,
|
|
825
|
-
args: [{
|
|
826
|
-
selector: 'input[skyAutocomplete], textarea[skyAutocomplete]',
|
|
827
|
-
providers: [SKY_AUTOCOMPLETE_VALUE_ACCESSOR, SKY_AUTOCOMPLETE_VALIDATOR],
|
|
828
|
-
}]
|
|
829
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.Renderer2 }]; }, propDecorators: { autocompleteAttribute: [{
|
|
830
|
-
type: i0.Input
|
|
831
|
-
}], disabled: [{
|
|
832
|
-
type: i0.Input
|
|
833
|
-
}] } });
|
|
808
|
+
return search;
|
|
809
|
+
}
|
|
834
810
|
|
|
835
811
|
/**
|
|
836
812
|
* @internal
|
|
837
813
|
*/
|
|
838
|
-
var
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
type: i0.Pipe,
|
|
850
|
-
args: [{
|
|
851
|
-
name: 'skyAutocompleteSearchAsyncDisabled',
|
|
852
|
-
}]
|
|
853
|
-
}] });
|
|
814
|
+
var SkyAutocompleteMessageType;
|
|
815
|
+
(function (SkyAutocompleteMessageType) {
|
|
816
|
+
/**
|
|
817
|
+
* Closes the dropdown.
|
|
818
|
+
*/
|
|
819
|
+
SkyAutocompleteMessageType[SkyAutocompleteMessageType["CloseDropdown"] = 0] = "CloseDropdown";
|
|
820
|
+
/**
|
|
821
|
+
* Repositions the dropdown.
|
|
822
|
+
*/
|
|
823
|
+
SkyAutocompleteMessageType[SkyAutocompleteMessageType["RepositionDropdown"] = 1] = "RepositionDropdown";
|
|
824
|
+
})(SkyAutocompleteMessageType || (SkyAutocompleteMessageType = {}));
|
|
854
825
|
|
|
855
826
|
var uniqueId$1 = 0;
|
|
856
827
|
var SkyAutocompleteComponent = /** @class */ (function () {
|
|
@@ -887,6 +858,10 @@
|
|
|
887
858
|
* Fires when users select the button to view all options.
|
|
888
859
|
*/
|
|
889
860
|
this.showMoreClick = new i0.EventEmitter();
|
|
861
|
+
/**
|
|
862
|
+
* Fires when users enter new search information and allows results to be
|
|
863
|
+
* returned via an observable.
|
|
864
|
+
*/
|
|
890
865
|
this.searchAsync = new i0.EventEmitter();
|
|
891
866
|
this.isOpen = false;
|
|
892
867
|
this.isSearchingAsync = false;
|
|
@@ -914,7 +889,7 @@
|
|
|
914
889
|
/**
|
|
915
890
|
* Specifies a static data source for the autocomplete component to search
|
|
916
891
|
* when users enter text. For a dynamic data source such as an array that
|
|
917
|
-
* changes due to server calls, use
|
|
892
|
+
* changes due to server calls, use `search` or `searchAsync` instead.
|
|
918
893
|
*/
|
|
919
894
|
set: function (value) {
|
|
920
895
|
this._data = value;
|
|
@@ -993,7 +968,9 @@
|
|
|
993
968
|
* Specifies a function to dynamically manage the data source when users
|
|
994
969
|
* change the text in the autocomplete field. The search function must return
|
|
995
970
|
* an array or a promise of an array. The `search` property is particularly
|
|
996
|
-
* useful when the data source does not live in the source code.
|
|
971
|
+
* useful when the data source does not live in the source code. If the
|
|
972
|
+
* search requires calling a remote data source, use `searchAsync` instead of
|
|
973
|
+
* `search`.
|
|
997
974
|
*/
|
|
998
975
|
set: function (value) {
|
|
999
976
|
this._search = value;
|
|
@@ -1721,9 +1698,9 @@
|
|
|
1721
1698
|
this._disabled = false;
|
|
1722
1699
|
this._includePhoneInfo = false;
|
|
1723
1700
|
// Angular automatically constructs these methods.
|
|
1724
|
-
|
|
1701
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1725
1702
|
this.onChange = function (value) { };
|
|
1726
|
-
|
|
1703
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1727
1704
|
this.onTouched = function () { };
|
|
1728
1705
|
this.setupCountries();
|
|
1729
1706
|
this.countrySearchFormControl = new i8.FormControl();
|
|
@@ -1993,7 +1970,7 @@
|
|
|
1993
1970
|
// Ignoring coverage here as this will be removed in the next release.
|
|
1994
1971
|
// istanbul ignore next
|
|
1995
1972
|
if (!this.includePhoneInfo && !this.hideSelectedCountryFlag) {
|
|
1996
|
-
if ((_b = (_a =
|
|
1973
|
+
if ((_b = (_a = this.elRef.nativeElement.parentElement) === null || _a === void 0 ? void 0 : _a.classList) === null || _b === void 0 ? void 0 : _b.contains('sky-phone-field-country-search')) {
|
|
1997
1974
|
this.includePhoneInfo = true;
|
|
1998
1975
|
this.hideSelectedCountryFlag = true;
|
|
1999
1976
|
}
|
|
@@ -2141,125 +2118,11 @@
|
|
|
2141
2118
|
i4.SkyIconModule,
|
|
2142
2119
|
i5.SkyI18nModule,
|
|
2143
2120
|
SkyLookupResourcesModule,
|
|
2144
|
-
i7.SkyThemeModule,
|
|
2145
|
-
],
|
|
2146
|
-
exports: [SkyCountryFieldComponent],
|
|
2147
|
-
}]
|
|
2148
|
-
}] });
|
|
2149
|
-
|
|
2150
|
-
/**
|
|
2151
|
-
* @internal
|
|
2152
|
-
*/
|
|
2153
|
-
var SkyLookupAutocompleteAdapter = /** @class */ (function () {
|
|
2154
|
-
function SkyLookupAutocompleteAdapter() {
|
|
2155
|
-
this.searchAsync = new i0.EventEmitter();
|
|
2156
|
-
}
|
|
2157
|
-
Object.defineProperty(SkyLookupAutocompleteAdapter.prototype, "descriptorProperty", {
|
|
2158
|
-
get: function () {
|
|
2159
|
-
return this._descriptorProperty || 'name';
|
|
2160
|
-
},
|
|
2161
|
-
/**
|
|
2162
|
-
* Specifies an object property to display in the text input after users
|
|
2163
|
-
* select an item in the dropdown list.
|
|
2164
|
-
* @default "name"
|
|
2165
|
-
*/
|
|
2166
|
-
set: function (value) {
|
|
2167
|
-
this._descriptorProperty = value;
|
|
2168
|
-
},
|
|
2169
|
-
enumerable: false,
|
|
2170
|
-
configurable: true
|
|
2171
|
-
});
|
|
2172
|
-
Object.defineProperty(SkyLookupAutocompleteAdapter.prototype, "propertiesToSearch", {
|
|
2173
|
-
get: function () {
|
|
2174
|
-
return this._propertiesToSearch || ['name'];
|
|
2175
|
-
},
|
|
2176
|
-
/**
|
|
2177
|
-
* Specifies an array of object properties to search.
|
|
2178
|
-
* @default ["name"]
|
|
2179
|
-
*/
|
|
2180
|
-
set: function (value) {
|
|
2181
|
-
this._propertiesToSearch = value;
|
|
2182
|
-
},
|
|
2183
|
-
enumerable: false,
|
|
2184
|
-
configurable: true
|
|
2185
|
-
});
|
|
2186
|
-
Object.defineProperty(SkyLookupAutocompleteAdapter.prototype, "search", {
|
|
2187
|
-
get: function () {
|
|
2188
|
-
return (this._search ||
|
|
2189
|
-
skyAutocompleteDefaultSearchFunction({
|
|
2190
|
-
propertiesToSearch: this.propertiesToSearch,
|
|
2191
|
-
searchFilters: this.searchFilters,
|
|
2192
|
-
}));
|
|
2193
|
-
},
|
|
2194
|
-
/**
|
|
2195
|
-
* Specifies a function to dynamically manage the data source when users
|
|
2196
|
-
* change the text in the lookup field. The search function must return
|
|
2197
|
-
* an array or a promise of an array. The `search` property is particularly
|
|
2198
|
-
* useful when the data source does not live in the source code.
|
|
2199
|
-
*/
|
|
2200
|
-
set: function (value) {
|
|
2201
|
-
this._search = value;
|
|
2202
|
-
},
|
|
2203
|
-
enumerable: false,
|
|
2204
|
-
configurable: true
|
|
2205
|
-
});
|
|
2206
|
-
return SkyLookupAutocompleteAdapter;
|
|
2207
|
-
}());
|
|
2208
|
-
SkyLookupAutocompleteAdapter.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLookupAutocompleteAdapter, deps: [], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
2209
|
-
SkyLookupAutocompleteAdapter.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: SkyLookupAutocompleteAdapter, inputs: { debounceTime: "debounceTime", descriptorProperty: "descriptorProperty", propertiesToSearch: "propertiesToSearch", search: "search", searchResultTemplate: "searchResultTemplate", searchTextMinimumCharacters: "searchTextMinimumCharacters", searchFilters: "searchFilters", searchResultsLimit: "searchResultsLimit" }, outputs: { searchAsync: "searchAsync" }, ngImport: i0__namespace });
|
|
2210
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLookupAutocompleteAdapter, decorators: [{
|
|
2211
|
-
type: i0.Directive
|
|
2212
|
-
}], propDecorators: { debounceTime: [{
|
|
2213
|
-
type: i0.Input
|
|
2214
|
-
}], descriptorProperty: [{
|
|
2215
|
-
type: i0.Input
|
|
2216
|
-
}], propertiesToSearch: [{
|
|
2217
|
-
type: i0.Input
|
|
2218
|
-
}], search: [{
|
|
2219
|
-
type: i0.Input
|
|
2220
|
-
}], searchResultTemplate: [{
|
|
2221
|
-
type: i0.Input
|
|
2222
|
-
}], searchTextMinimumCharacters: [{
|
|
2223
|
-
type: i0.Input
|
|
2224
|
-
}], searchFilters: [{
|
|
2225
|
-
type: i0.Input
|
|
2226
|
-
}], searchResultsLimit: [{
|
|
2227
|
-
type: i0.Input
|
|
2228
|
-
}], searchAsync: [{
|
|
2229
|
-
type: i0.Output
|
|
2230
|
-
}] } });
|
|
2231
|
-
|
|
2232
|
-
/**
|
|
2233
|
-
* @internal
|
|
2234
|
-
*/
|
|
2235
|
-
var SkyLookupAdapterService = /** @class */ (function () {
|
|
2236
|
-
function SkyLookupAdapterService() {
|
|
2237
|
-
}
|
|
2238
|
-
SkyLookupAdapterService.prototype.focusInput = function (elRef) {
|
|
2239
|
-
var inputEl = elRef.nativeElement.querySelector('.sky-lookup-input');
|
|
2240
|
-
/* Sanity check */
|
|
2241
|
-
/* istanbul ignore else */
|
|
2242
|
-
if (inputEl) {
|
|
2243
|
-
inputEl.focus();
|
|
2244
|
-
}
|
|
2245
|
-
};
|
|
2246
|
-
return SkyLookupAdapterService;
|
|
2247
|
-
}());
|
|
2248
|
-
SkyLookupAdapterService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLookupAdapterService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
2249
|
-
SkyLookupAdapterService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLookupAdapterService });
|
|
2250
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLookupAdapterService, decorators: [{
|
|
2251
|
-
type: i0.Injectable
|
|
2252
|
-
}] });
|
|
2253
|
-
|
|
2254
|
-
/**
|
|
2255
|
-
* @internal
|
|
2256
|
-
* Context for the show more native picker. These values are provided by the lookup component.
|
|
2257
|
-
*/
|
|
2258
|
-
var SkyLookupShowMoreNativePickerContext = /** @class */ (function () {
|
|
2259
|
-
function SkyLookupShowMoreNativePickerContext() {
|
|
2260
|
-
}
|
|
2261
|
-
return SkyLookupShowMoreNativePickerContext;
|
|
2262
|
-
}());
|
|
2121
|
+
i7.SkyThemeModule,
|
|
2122
|
+
],
|
|
2123
|
+
exports: [SkyCountryFieldComponent],
|
|
2124
|
+
}]
|
|
2125
|
+
}] });
|
|
2263
2126
|
|
|
2264
2127
|
/**
|
|
2265
2128
|
* @internal
|
|
@@ -2552,6 +2415,279 @@
|
|
|
2552
2415
|
type: i0.Input
|
|
2553
2416
|
}] } });
|
|
2554
2417
|
|
|
2418
|
+
var SkySearchModule = /** @class */ (function () {
|
|
2419
|
+
function SkySearchModule() {
|
|
2420
|
+
}
|
|
2421
|
+
return SkySearchModule;
|
|
2422
|
+
}());
|
|
2423
|
+
SkySearchModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkySearchModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
2424
|
+
SkySearchModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkySearchModule, declarations: [SkySearchComponent], imports: [i6$1.CommonModule,
|
|
2425
|
+
i6.SkyInputBoxModule,
|
|
2426
|
+
SkyLookupResourcesModule,
|
|
2427
|
+
i8.FormsModule,
|
|
2428
|
+
i4.SkyIconModule,
|
|
2429
|
+
i7.SkyThemeModule,
|
|
2430
|
+
i1.SkyIdModule], exports: [SkySearchComponent] });
|
|
2431
|
+
SkySearchModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkySearchModule, imports: [[
|
|
2432
|
+
i6$1.CommonModule,
|
|
2433
|
+
i6.SkyInputBoxModule,
|
|
2434
|
+
SkyLookupResourcesModule,
|
|
2435
|
+
i8.FormsModule,
|
|
2436
|
+
i4.SkyIconModule,
|
|
2437
|
+
i7.SkyThemeModule,
|
|
2438
|
+
i1.SkyIdModule,
|
|
2439
|
+
]] });
|
|
2440
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkySearchModule, decorators: [{
|
|
2441
|
+
type: i0.NgModule,
|
|
2442
|
+
args: [{
|
|
2443
|
+
declarations: [SkySearchComponent],
|
|
2444
|
+
imports: [
|
|
2445
|
+
i6$1.CommonModule,
|
|
2446
|
+
i6.SkyInputBoxModule,
|
|
2447
|
+
SkyLookupResourcesModule,
|
|
2448
|
+
i8.FormsModule,
|
|
2449
|
+
i4.SkyIconModule,
|
|
2450
|
+
i7.SkyThemeModule,
|
|
2451
|
+
i1.SkyIdModule,
|
|
2452
|
+
],
|
|
2453
|
+
exports: [SkySearchComponent],
|
|
2454
|
+
}]
|
|
2455
|
+
}] });
|
|
2456
|
+
|
|
2457
|
+
var SkyLookupItemSelectedPipe = /** @class */ (function () {
|
|
2458
|
+
function SkyLookupItemSelectedPipe() {
|
|
2459
|
+
}
|
|
2460
|
+
SkyLookupItemSelectedPipe.prototype.transform = function (id, selectedIdMap) {
|
|
2461
|
+
return selectedIdMap.has(id);
|
|
2462
|
+
};
|
|
2463
|
+
return SkyLookupItemSelectedPipe;
|
|
2464
|
+
}());
|
|
2465
|
+
SkyLookupItemSelectedPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLookupItemSelectedPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
2466
|
+
SkyLookupItemSelectedPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLookupItemSelectedPipe, name: "skyLookupItemSelected" });
|
|
2467
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLookupItemSelectedPipe, decorators: [{
|
|
2468
|
+
type: i0.Pipe,
|
|
2469
|
+
args: [{
|
|
2470
|
+
name: 'skyLookupItemSelected',
|
|
2471
|
+
}]
|
|
2472
|
+
}] });
|
|
2473
|
+
|
|
2474
|
+
/**
|
|
2475
|
+
* @internal
|
|
2476
|
+
* Context for the show more native picker. These values are provided by the lookup component.
|
|
2477
|
+
*/
|
|
2478
|
+
var SkyLookupShowMoreNativePickerAsyncContext = /** @class */ (function () {
|
|
2479
|
+
function SkyLookupShowMoreNativePickerAsyncContext() {
|
|
2480
|
+
}
|
|
2481
|
+
return SkyLookupShowMoreNativePickerAsyncContext;
|
|
2482
|
+
}());
|
|
2483
|
+
|
|
2484
|
+
/**
|
|
2485
|
+
* @internal
|
|
2486
|
+
* Internal component to implement the native picker.
|
|
2487
|
+
*/
|
|
2488
|
+
var SkyLookupShowMoreAsyncModalComponent = /** @class */ (function () {
|
|
2489
|
+
function SkyLookupShowMoreAsyncModalComponent(modalInstance, context, changeDetector) {
|
|
2490
|
+
this.modalInstance = modalInstance;
|
|
2491
|
+
this.context = context;
|
|
2492
|
+
this.changeDetector = changeDetector;
|
|
2493
|
+
/**
|
|
2494
|
+
* @internal
|
|
2495
|
+
* Fires when users select the button to add new options to the list.
|
|
2496
|
+
*/
|
|
2497
|
+
this.addClick = new rxjs.Subject();
|
|
2498
|
+
this.displayedItems = [];
|
|
2499
|
+
this.onlyShowSelected = false;
|
|
2500
|
+
this.isSearching = false;
|
|
2501
|
+
this.hasMoreItems = false;
|
|
2502
|
+
this.isLoadingMore = false;
|
|
2503
|
+
this.offset = 0;
|
|
2504
|
+
this.ngUnsubscribe = new rxjs.Subject();
|
|
2505
|
+
}
|
|
2506
|
+
SkyLookupShowMoreAsyncModalComponent.prototype.ngOnInit = function () {
|
|
2507
|
+
this.searchText = this.context.initialSearch;
|
|
2508
|
+
this.createInitialSelectedItemsMap();
|
|
2509
|
+
this.loadSearchResults();
|
|
2510
|
+
};
|
|
2511
|
+
SkyLookupShowMoreAsyncModalComponent.prototype.ngOnDestroy = function () {
|
|
2512
|
+
this.cancelCurrentSearch();
|
|
2513
|
+
this.ngUnsubscribe.next();
|
|
2514
|
+
this.ngUnsubscribe.complete();
|
|
2515
|
+
};
|
|
2516
|
+
SkyLookupShowMoreAsyncModalComponent.prototype.addButtonClicked = function () {
|
|
2517
|
+
this.addClick.next();
|
|
2518
|
+
};
|
|
2519
|
+
SkyLookupShowMoreAsyncModalComponent.prototype.clearAll = function () {
|
|
2520
|
+
var e_1, _a;
|
|
2521
|
+
this.selectedIdMap = new Map(this.selectedIdMap);
|
|
2522
|
+
try {
|
|
2523
|
+
// Only deselect items that have been loaded; items that would be loaded
|
|
2524
|
+
// after an infinite scroll event should remain selected.
|
|
2525
|
+
for (var _b = __values(this.items), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
2526
|
+
var item = _c.value;
|
|
2527
|
+
this.selectedIdMap.delete(item[this.context.idProperty]);
|
|
2528
|
+
}
|
|
2529
|
+
}
|
|
2530
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
2531
|
+
finally {
|
|
2532
|
+
try {
|
|
2533
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2534
|
+
}
|
|
2535
|
+
finally { if (e_1) throw e_1.error; }
|
|
2536
|
+
}
|
|
2537
|
+
this.updateDisplayedItems();
|
|
2538
|
+
this.changeDetector.markForCheck();
|
|
2539
|
+
};
|
|
2540
|
+
SkyLookupShowMoreAsyncModalComponent.prototype.itemClick = function (selectedItem) {
|
|
2541
|
+
if (this.context.selectMode === 'single') {
|
|
2542
|
+
this.onItemSelect(!selectedItem.selected, selectedItem);
|
|
2543
|
+
}
|
|
2544
|
+
};
|
|
2545
|
+
SkyLookupShowMoreAsyncModalComponent.prototype.onItemSelect = function (newSelectState, itemToSelect) {
|
|
2546
|
+
var itemId = itemToSelect[this.context.idProperty];
|
|
2547
|
+
// Create a new Map so the pipe transform will execute on the next
|
|
2548
|
+
// change detection cycle.
|
|
2549
|
+
this.selectedIdMap = new Map(this.selectedIdMap);
|
|
2550
|
+
if (this.context.selectMode === 'single') {
|
|
2551
|
+
if (newSelectState) {
|
|
2552
|
+
this.selectedIdMap.clear();
|
|
2553
|
+
this.selectedIdMap.set(itemId, itemToSelect);
|
|
2554
|
+
}
|
|
2555
|
+
}
|
|
2556
|
+
else {
|
|
2557
|
+
if (newSelectState) {
|
|
2558
|
+
this.selectedIdMap.set(itemId, itemToSelect);
|
|
2559
|
+
}
|
|
2560
|
+
else {
|
|
2561
|
+
this.selectedIdMap.delete(itemId);
|
|
2562
|
+
}
|
|
2563
|
+
}
|
|
2564
|
+
this.updateDisplayedItems();
|
|
2565
|
+
};
|
|
2566
|
+
SkyLookupShowMoreAsyncModalComponent.prototype.searchApplied = function (searchText) {
|
|
2567
|
+
this.offset = 0;
|
|
2568
|
+
this.searchText = searchText;
|
|
2569
|
+
this.loadSearchResults();
|
|
2570
|
+
};
|
|
2571
|
+
SkyLookupShowMoreAsyncModalComponent.prototype.selectAll = function () {
|
|
2572
|
+
var e_2, _a;
|
|
2573
|
+
this.selectedIdMap = new Map();
|
|
2574
|
+
try {
|
|
2575
|
+
for (var _b = __values(this.items), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
2576
|
+
var item = _c.value;
|
|
2577
|
+
this.selectedIdMap.set(item[this.context.idProperty], item);
|
|
2578
|
+
}
|
|
2579
|
+
}
|
|
2580
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
2581
|
+
finally {
|
|
2582
|
+
try {
|
|
2583
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2584
|
+
}
|
|
2585
|
+
finally { if (e_2) throw e_2.error; }
|
|
2586
|
+
}
|
|
2587
|
+
this.updateDisplayedItems();
|
|
2588
|
+
};
|
|
2589
|
+
SkyLookupShowMoreAsyncModalComponent.prototype.infiniteScrollEnd = function () {
|
|
2590
|
+
var _this = this;
|
|
2591
|
+
this.cancelCurrentSearch();
|
|
2592
|
+
/* Sanity check - else case would only happen if this was called directly */
|
|
2593
|
+
/* istanbul ignore else */
|
|
2594
|
+
if (this.hasMoreItems) {
|
|
2595
|
+
this.isLoadingMore = true;
|
|
2596
|
+
this.performSearch(function (result) {
|
|
2597
|
+
_this.items = _this.items.concat(result.items);
|
|
2598
|
+
_this.updateDisplayedItems();
|
|
2599
|
+
_this.isLoadingMore = false;
|
|
2600
|
+
});
|
|
2601
|
+
}
|
|
2602
|
+
};
|
|
2603
|
+
SkyLookupShowMoreAsyncModalComponent.prototype.save = function () {
|
|
2604
|
+
var _this = this;
|
|
2605
|
+
var selectedItems = Array.from(this.selectedIdMap.values(), function (itemData, index) { return ({
|
|
2606
|
+
index: index,
|
|
2607
|
+
itemData: itemData,
|
|
2608
|
+
}); }).sort(function (a, b) {
|
|
2609
|
+
return _this.items.indexOf(a.itemData) < _this.items.indexOf(b.itemData)
|
|
2610
|
+
? -1
|
|
2611
|
+
: 1;
|
|
2612
|
+
});
|
|
2613
|
+
this.modalInstance.save(selectedItems);
|
|
2614
|
+
};
|
|
2615
|
+
SkyLookupShowMoreAsyncModalComponent.prototype.loadSearchResults = function () {
|
|
2616
|
+
var _this = this;
|
|
2617
|
+
this.cancelCurrentSearch();
|
|
2618
|
+
this.isSearching = true;
|
|
2619
|
+
this.performSearch(function (result) {
|
|
2620
|
+
_this.isSearching = false;
|
|
2621
|
+
_this.items = result.items;
|
|
2622
|
+
});
|
|
2623
|
+
};
|
|
2624
|
+
SkyLookupShowMoreAsyncModalComponent.prototype.createInitialSelectedItemsMap = function () {
|
|
2625
|
+
var _this = this;
|
|
2626
|
+
this.selectedIdMap = new Map(this.context.initialValue.map(function (item) { return [
|
|
2627
|
+
item[_this.context.idProperty],
|
|
2628
|
+
item,
|
|
2629
|
+
]; }));
|
|
2630
|
+
};
|
|
2631
|
+
SkyLookupShowMoreAsyncModalComponent.prototype.performSearch = function (processResults) {
|
|
2632
|
+
var _this = this;
|
|
2633
|
+
this.currentSearchSub = this.context
|
|
2634
|
+
.searchAsync({
|
|
2635
|
+
displayType: 'modal',
|
|
2636
|
+
offset: this.offset,
|
|
2637
|
+
searchText: this.searchText || '',
|
|
2638
|
+
continuationData: this.continuationData,
|
|
2639
|
+
})
|
|
2640
|
+
.pipe(operators.take(1))
|
|
2641
|
+
.subscribe(function (result) {
|
|
2642
|
+
processResults(result);
|
|
2643
|
+
_this.continuationData = result.continuationData;
|
|
2644
|
+
_this.hasMoreItems = result.hasMore;
|
|
2645
|
+
_this.offset = _this.items.length;
|
|
2646
|
+
_this.updateDisplayedItems();
|
|
2647
|
+
_this.changeDetector.markForCheck();
|
|
2648
|
+
});
|
|
2649
|
+
};
|
|
2650
|
+
SkyLookupShowMoreAsyncModalComponent.prototype.updateDisplayedItems = function () {
|
|
2651
|
+
var _this = this;
|
|
2652
|
+
if (this.onlyShowSelected) {
|
|
2653
|
+
this.displayedItems = this.items.filter(function (item) { return _this.selectedIdMap.has(item[_this.context.idProperty]); });
|
|
2654
|
+
}
|
|
2655
|
+
else {
|
|
2656
|
+
this.displayedItems = this.items;
|
|
2657
|
+
}
|
|
2658
|
+
};
|
|
2659
|
+
SkyLookupShowMoreAsyncModalComponent.prototype.cancelCurrentSearch = function () {
|
|
2660
|
+
if (this.currentSearchSub) {
|
|
2661
|
+
this.currentSearchSub.unsubscribe();
|
|
2662
|
+
this.currentSearchSub = undefined;
|
|
2663
|
+
this.isLoadingMore = false;
|
|
2664
|
+
this.isSearching = false;
|
|
2665
|
+
}
|
|
2666
|
+
};
|
|
2667
|
+
return SkyLookupShowMoreAsyncModalComponent;
|
|
2668
|
+
}());
|
|
2669
|
+
SkyLookupShowMoreAsyncModalComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLookupShowMoreAsyncModalComponent, deps: [{ token: i1__namespace$1.SkyModalInstance }, { token: SkyLookupShowMoreNativePickerAsyncContext }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2670
|
+
SkyLookupShowMoreAsyncModalComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyLookupShowMoreAsyncModalComponent, selector: "sky-lookup-show-more-async-modal", ngImport: i0__namespace, template: "<sky-modal>\n <sky-modal-header>\n <ng-container *ngIf=\"context.userConfig?.title; else defaultTitle\">\n {{ context.userConfig.title }}\n </ng-container>\n </sky-modal-header>\n <sky-modal-content>\n <sky-wait [isWaiting]=\"isSearching\"></sky-wait>\n <div\n [skyViewkeeper]=\"[\n '.sky-lookup-show-more-modal-toolbar',\n '.sky-lookup-show-more-modal-muiltiselect-toolbar'\n ]\"\n >\n <sky-toolbar class=\"sky-lookup-show-more-modal-toolbar\">\n <sky-toolbar-section>\n <sky-toolbar-item>\n <sky-search\n [debounceTime]=\"250\"\n [searchText]=\"searchText\"\n (searchApply)=\"searchApplied($event)\"\n >\n </sky-search>\n </sky-toolbar-item>\n <sky-toolbar-view-actions>\n <button\n *ngIf=\"context.showAddButton\"\n type=\"button\"\n class=\"sky-btn sky-btn-link sky-lookup-show-more-modal-add\"\n (click)=\"addButtonClicked()\"\n >\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"add\"\n iconType=\"skyux\"\n ></sky-icon>\n <sky-icon *skyThemeIf=\"'default'\" icon=\"plus-circle\"></sky-icon>\n {{ 'skyux_lookup_show_more_add' | skyLibResources }}\n </button>\n </sky-toolbar-view-actions>\n </sky-toolbar-section>\n </sky-toolbar>\n <sky-toolbar\n *ngIf=\"context.selectMode === 'multiple'\"\n class=\"sky-lookup-show-more-modal-muiltiselect-toolbar\"\n >\n <sky-toolbar-section>\n <sky-toolbar-item>\n <button\n class=\"\n sky-btn sky-btn-link sky-lookup-show-more-modal-select-all-btn\n \"\n type=\"button\"\n (click)=\"selectAll()\"\n >\n {{\n 'skyux_lookup_show_more_select_all_button_title'\n | skyLibResources\n }}\n </button>\n </sky-toolbar-item>\n <sky-toolbar-item>\n <button\n class=\"\n sky-btn sky-btn-link sky-lookup-show-more-modal-clear-all-btn\n \"\n type=\"button\"\n (click)=\"clearAll()\"\n >\n {{\n 'skyux_lookup_show_more_clear_all_button_title'\n | skyLibResources\n }}\n </button>\n </sky-toolbar-item>\n <sky-toolbar-view-actions>\n <sky-checkbox\n [(checked)]=\"onlyShowSelected\"\n (change)=\"updateDisplayedItems()\"\n >\n <sky-checkbox-label>\n {{\n 'skyux_lookup_show_more_show_selected_option_title'\n | skyLibResources\n }}\n </sky-checkbox-label>\n </sky-checkbox>\n </sky-toolbar-view-actions>\n </sky-toolbar-section>\n </sky-toolbar>\n </div>\n <div\n *ngIf=\"!isSearching && displayedItems.length === 0\"\n class=\"sky-font-deemphasized sky-lookup-show-more-no-results\"\n >\n {{ 'skyux_lookup_show_more_no_results' | skyLibResources }}\n </div>\n <sky-repeater class=\"sky-lookup-show-more-repeater\" expandMode=\"none\">\n <sky-repeater-item\n *ngFor=\"let item of displayedItems\"\n [isSelected]=\"\n item[context.idProperty] | skyLookupItemSelected: selectedIdMap\n \"\n [selectable]=\"context.selectMode === 'multiple'\"\n (click)=\"itemClick(item)\"\n (keyup.enter)=\"itemClick(item)\"\n (isSelectedChange)=\"onItemSelect($event, item)\"\n >\n <sky-repeater-item-content>\n <ng-container\n *ngTemplateOutlet=\"\n context.userConfig?.itemTemplate\n ? context.userConfig?.itemTemplate\n : defaultItemTemplate;\n context: { item: item }\n \"\n >\n </ng-container>\n </sky-repeater-item-content>\n </sky-repeater-item>\n </sky-repeater>\n <sky-infinite-scroll\n [enabled]=\"hasMoreItems\"\n [loading]=\"isLoadingMore\"\n (scrollEnd)=\"infiniteScrollEnd()\"\n >\n </sky-infinite-scroll>\n </sky-modal-content>\n <sky-modal-footer>\n <button\n class=\"\n sky-btn\n sky-btn-primary\n sky-margin-inline-compact\n sky-lookup-show-more-modal-save\n \"\n type=\"button\"\n [disabled]=\"isSearching\"\n (click)=\"save()\"\n >\n {{ 'skyux_lookup_show_more_select' | skyLibResources }}\n </button>\n <button\n class=\"sky-btn sky-btn-link sky-lookup-show-more-modal-close\"\n type=\"button\"\n (click)=\"modalInstance.close()\"\n >\n {{ 'skyux_lookup_show_more_cancel' | skyLibResources }}\n </button>\n </sky-modal-footer>\n</sky-modal>\n\n<ng-template let-item=\"item\" #defaultItemTemplate>\n {{ item[context.descriptorProperty] }}\n</ng-template>\n\n<ng-template #defaultTitle>\n <ng-container *ngIf=\"context.selectMode === 'single'\">\n {{ 'skyux_lookup_show_more_modal_title_single' | skyLibResources }}\n </ng-container>\n <ng-container *ngIf=\"context.selectMode === 'multiple'\">\n {{ 'skyux_lookup_show_more_modal_title_multiple' | skyLibResources }}\n </ng-container>\n</ng-template>\n", styles: [".sky-lookup-show-more-no-results{padding:20px 0}:host-context(.sky-theme-modern) .sky-lookup-show-more-no-results{padding:30px 0}.sky-theme-modern .sky-lookup-show-more-no-results{padding:30px 0}\n"], components: [{ type: i1__namespace$1.λ5, selector: "sky-modal", inputs: ["ariaRole", "tiledBody"] }, { type: i1__namespace$1.λ4, selector: "sky-modal-header" }, { type: i1__namespace$1.λ2, selector: "sky-modal-content" }, { type: i4__namespace.λ14, selector: "sky-wait", inputs: ["ariaLabel", "isWaiting", "isFullPage", "isNonBlocking"] }, { type: i4__namespace$1.λ37, selector: "sky-toolbar" }, { type: i4__namespace$1.λ38, selector: "sky-toolbar-section" }, { type: i4__namespace$1.λ39, selector: "sky-toolbar-item" }, { type: SkySearchComponent, selector: "sky-search", inputs: ["searchText", "expandMode", "debounceTime", "disabled", "placeholderText"], outputs: ["searchApply", "searchChange", "searchClear"] }, { type: i4__namespace$1.λ40, selector: "sky-toolbar-view-actions" }, { type: i4__namespace.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }, { type: i6__namespace.λ3, selector: "sky-checkbox", inputs: ["label", "labelledBy", "id", "disabled", "tabindex", "name", "icon", "checkboxType", "checked", "required"], outputs: ["change", "checkedChange", "disabledChange"] }, { type: i6__namespace.λ4, selector: "sky-checkbox-label" }, { type: i7__namespace$1.λ11, selector: "sky-repeater", inputs: ["activeIndex", "ariaLabel", "reorderable", "expandMode"], outputs: ["activeIndexChange", "orderChange"] }, { type: i7__namespace$1.λ10, selector: "sky-repeater-item", inputs: ["itemName", "inlineFormConfig", "inlineFormTemplate", "isExpanded", "isSelected", "reorderable", "selectable", "showInlineForm", "tag"], outputs: ["collapse", "expand", "inlineFormClose", "isSelectedChange"] }, { type: i7__namespace$1.λ8, selector: "sky-repeater-item-content" }, { type: i7__namespace$1.λ6, selector: "sky-infinite-scroll", inputs: ["enabled", "loading"], outputs: ["scrollEnd"] }, { type: i1__namespace$1.λ3, selector: "sky-modal-footer" }], directives: [{ type: i6__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace.λ3, selector: "[skyViewkeeper]", inputs: ["skyViewkeeper"] }, { type: i7__namespace.λ3, selector: "[skyThemeIf]", inputs: ["skyThemeIf"] }, { type: i6__namespace$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "skyLibResources": i5__namespace.SkyLibResourcesPipe, "skyLookupItemSelected": SkyLookupItemSelectedPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
2671
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLookupShowMoreAsyncModalComponent, decorators: [{
|
|
2672
|
+
type: i0.Component,
|
|
2673
|
+
args: [{
|
|
2674
|
+
selector: 'sky-lookup-show-more-async-modal',
|
|
2675
|
+
template: "<sky-modal>\n <sky-modal-header>\n <ng-container *ngIf=\"context.userConfig?.title; else defaultTitle\">\n {{ context.userConfig.title }}\n </ng-container>\n </sky-modal-header>\n <sky-modal-content>\n <sky-wait [isWaiting]=\"isSearching\"></sky-wait>\n <div\n [skyViewkeeper]=\"[\n '.sky-lookup-show-more-modal-toolbar',\n '.sky-lookup-show-more-modal-muiltiselect-toolbar'\n ]\"\n >\n <sky-toolbar class=\"sky-lookup-show-more-modal-toolbar\">\n <sky-toolbar-section>\n <sky-toolbar-item>\n <sky-search\n [debounceTime]=\"250\"\n [searchText]=\"searchText\"\n (searchApply)=\"searchApplied($event)\"\n >\n </sky-search>\n </sky-toolbar-item>\n <sky-toolbar-view-actions>\n <button\n *ngIf=\"context.showAddButton\"\n type=\"button\"\n class=\"sky-btn sky-btn-link sky-lookup-show-more-modal-add\"\n (click)=\"addButtonClicked()\"\n >\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"add\"\n iconType=\"skyux\"\n ></sky-icon>\n <sky-icon *skyThemeIf=\"'default'\" icon=\"plus-circle\"></sky-icon>\n {{ 'skyux_lookup_show_more_add' | skyLibResources }}\n </button>\n </sky-toolbar-view-actions>\n </sky-toolbar-section>\n </sky-toolbar>\n <sky-toolbar\n *ngIf=\"context.selectMode === 'multiple'\"\n class=\"sky-lookup-show-more-modal-muiltiselect-toolbar\"\n >\n <sky-toolbar-section>\n <sky-toolbar-item>\n <button\n class=\"\n sky-btn sky-btn-link sky-lookup-show-more-modal-select-all-btn\n \"\n type=\"button\"\n (click)=\"selectAll()\"\n >\n {{\n 'skyux_lookup_show_more_select_all_button_title'\n | skyLibResources\n }}\n </button>\n </sky-toolbar-item>\n <sky-toolbar-item>\n <button\n class=\"\n sky-btn sky-btn-link sky-lookup-show-more-modal-clear-all-btn\n \"\n type=\"button\"\n (click)=\"clearAll()\"\n >\n {{\n 'skyux_lookup_show_more_clear_all_button_title'\n | skyLibResources\n }}\n </button>\n </sky-toolbar-item>\n <sky-toolbar-view-actions>\n <sky-checkbox\n [(checked)]=\"onlyShowSelected\"\n (change)=\"updateDisplayedItems()\"\n >\n <sky-checkbox-label>\n {{\n 'skyux_lookup_show_more_show_selected_option_title'\n | skyLibResources\n }}\n </sky-checkbox-label>\n </sky-checkbox>\n </sky-toolbar-view-actions>\n </sky-toolbar-section>\n </sky-toolbar>\n </div>\n <div\n *ngIf=\"!isSearching && displayedItems.length === 0\"\n class=\"sky-font-deemphasized sky-lookup-show-more-no-results\"\n >\n {{ 'skyux_lookup_show_more_no_results' | skyLibResources }}\n </div>\n <sky-repeater class=\"sky-lookup-show-more-repeater\" expandMode=\"none\">\n <sky-repeater-item\n *ngFor=\"let item of displayedItems\"\n [isSelected]=\"\n item[context.idProperty] | skyLookupItemSelected: selectedIdMap\n \"\n [selectable]=\"context.selectMode === 'multiple'\"\n (click)=\"itemClick(item)\"\n (keyup.enter)=\"itemClick(item)\"\n (isSelectedChange)=\"onItemSelect($event, item)\"\n >\n <sky-repeater-item-content>\n <ng-container\n *ngTemplateOutlet=\"\n context.userConfig?.itemTemplate\n ? context.userConfig?.itemTemplate\n : defaultItemTemplate;\n context: { item: item }\n \"\n >\n </ng-container>\n </sky-repeater-item-content>\n </sky-repeater-item>\n </sky-repeater>\n <sky-infinite-scroll\n [enabled]=\"hasMoreItems\"\n [loading]=\"isLoadingMore\"\n (scrollEnd)=\"infiniteScrollEnd()\"\n >\n </sky-infinite-scroll>\n </sky-modal-content>\n <sky-modal-footer>\n <button\n class=\"\n sky-btn\n sky-btn-primary\n sky-margin-inline-compact\n sky-lookup-show-more-modal-save\n \"\n type=\"button\"\n [disabled]=\"isSearching\"\n (click)=\"save()\"\n >\n {{ 'skyux_lookup_show_more_select' | skyLibResources }}\n </button>\n <button\n class=\"sky-btn sky-btn-link sky-lookup-show-more-modal-close\"\n type=\"button\"\n (click)=\"modalInstance.close()\"\n >\n {{ 'skyux_lookup_show_more_cancel' | skyLibResources }}\n </button>\n </sky-modal-footer>\n</sky-modal>\n\n<ng-template let-item=\"item\" #defaultItemTemplate>\n {{ item[context.descriptorProperty] }}\n</ng-template>\n\n<ng-template #defaultTitle>\n <ng-container *ngIf=\"context.selectMode === 'single'\">\n {{ 'skyux_lookup_show_more_modal_title_single' | skyLibResources }}\n </ng-container>\n <ng-container *ngIf=\"context.selectMode === 'multiple'\">\n {{ 'skyux_lookup_show_more_modal_title_multiple' | skyLibResources }}\n </ng-container>\n</ng-template>\n",
|
|
2676
|
+
styles: [".sky-lookup-show-more-no-results{padding:20px 0}:host-context(.sky-theme-modern) .sky-lookup-show-more-no-results{padding:30px 0}.sky-theme-modern .sky-lookup-show-more-no-results{padding:30px 0}\n"],
|
|
2677
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
2678
|
+
}]
|
|
2679
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$1.SkyModalInstance }, { type: SkyLookupShowMoreNativePickerAsyncContext }, { type: i0__namespace.ChangeDetectorRef }]; } });
|
|
2680
|
+
|
|
2681
|
+
/**
|
|
2682
|
+
* @internal
|
|
2683
|
+
* Context for the show more native picker. These values are provided by the lookup component.
|
|
2684
|
+
*/
|
|
2685
|
+
var SkyLookupShowMoreNativePickerContext = /** @class */ (function () {
|
|
2686
|
+
function SkyLookupShowMoreNativePickerContext() {
|
|
2687
|
+
}
|
|
2688
|
+
return SkyLookupShowMoreNativePickerContext;
|
|
2689
|
+
}());
|
|
2690
|
+
|
|
2555
2691
|
/**
|
|
2556
2692
|
* @internal
|
|
2557
2693
|
* Internal component to implement the native picker.
|
|
@@ -2720,308 +2856,194 @@
|
|
|
2720
2856
|
});
|
|
2721
2857
|
}
|
|
2722
2858
|
}
|
|
2723
|
-
else {
|
|
2724
|
-
return Promise.resolve(items);
|
|
2725
|
-
}
|
|
2726
|
-
};
|
|
2727
|
-
SkyLookupShowMoreModalComponent.prototype.selectAll = function () {
|
|
2728
|
-
var _this = this;
|
|
2729
|
-
var selectedItems = this.selectedItems;
|
|
2730
|
-
this.displayedItems.forEach(function (item) {
|
|
2731
|
-
if (!item.selected) {
|
|
2732
|
-
item.selected = true;
|
|
2733
|
-
var index_1 = _this.items.indexOf(item);
|
|
2734
|
-
/* Sanity check */
|
|
2735
|
-
/* istanbul ignore else */
|
|
2736
|
-
if (selectedItems.findIndex(function (selectedItem) { return selectedItem.index === index_1; }) < 0) {
|
|
2737
|
-
selectedItems.push({
|
|
2738
|
-
index: index_1,
|
|
2739
|
-
itemData: _this.items[index_1].value,
|
|
2740
|
-
});
|
|
2741
|
-
}
|
|
2742
|
-
}
|
|
2743
|
-
});
|
|
2744
|
-
this.selectedItems = selectedItems;
|
|
2745
|
-
this.updateDataState();
|
|
2746
|
-
this.changeDetector.markForCheck();
|
|
2747
|
-
};
|
|
2748
|
-
SkyLookupShowMoreModalComponent.prototype.updateDataState = function () {
|
|
2749
|
-
var _this = this;
|
|
2750
|
-
var selectedItems = this.selectedItems;
|
|
2751
|
-
this.items.forEach(function (item, index) {
|
|
2752
|
-
item.selected =
|
|
2753
|
-
selectedItems.findIndex(function (selectedItem) { return selectedItem.index === index; }) !== -1;
|
|
2754
|
-
});
|
|
2755
|
-
this.searchItems(this.items).then(function (searchedItems) {
|
|
2756
|
-
if (_this.onlyShowSelected) {
|
|
2757
|
-
searchedItems = searchedItems.filter(function (item) { return item.selected; });
|
|
2758
|
-
}
|
|
2759
|
-
_this.displayedItems = searchedItems.slice(0, _this.itemIndex);
|
|
2760
|
-
if (_this.itemIndex > searchedItems.length) {
|
|
2761
|
-
_this.itemsHaveMore = false;
|
|
2762
|
-
}
|
|
2763
|
-
else {
|
|
2764
|
-
_this.itemsHaveMore = true;
|
|
2765
|
-
}
|
|
2766
|
-
_this.changeDetector.markForCheck();
|
|
2767
|
-
});
|
|
2768
|
-
};
|
|
2769
|
-
SkyLookupShowMoreModalComponent.prototype.updateItemData = function (data) {
|
|
2770
|
-
var _this = this;
|
|
2771
|
-
this.context.items = data;
|
|
2772
|
-
this.items = undefined;
|
|
2773
|
-
this.itemIndex = 10;
|
|
2774
|
-
this.selectedItems.forEach(function (selectedItem) {
|
|
2775
|
-
_this.context.items.forEach(function (item, index) {
|
|
2776
|
-
if (selectedItem.itemData === item) {
|
|
2777
|
-
selectedItem.index = index;
|
|
2778
|
-
}
|
|
2779
|
-
});
|
|
2780
|
-
});
|
|
2781
|
-
this.addItems();
|
|
2782
|
-
this.changeDetector.markForCheck();
|
|
2783
|
-
};
|
|
2784
|
-
return SkyLookupShowMoreModalComponent;
|
|
2785
|
-
}());
|
|
2786
|
-
SkyLookupShowMoreModalComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLookupShowMoreModalComponent, deps: [{ token: i1__namespace$1.SkyModalInstance }, { token: SkyLookupShowMoreNativePickerContext }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2787
|
-
SkyLookupShowMoreModalComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyLookupShowMoreModalComponent, selector: "skyux-lookup-show-more-modal", ngImport: i0__namespace, template: "<sky-modal>\n <sky-modal-header>\n <ng-container *ngIf=\"context.userConfig?.title; else defaultTitle\">\n {{ context.userConfig.title }}\n </ng-container>\n </sky-modal-header>\n <sky-modal-content>\n <div\n [skyViewkeeper]=\"[\n '.sky-lookup-show-more-modal-toolbar',\n '.sky-lookup-show-more-modal-muiltiselect-toolbar'\n ]\"\n >\n <sky-toolbar class=\"sky-lookup-show-more-modal-toolbar\">\n <sky-toolbar-section>\n <sky-toolbar-item>\n <sky-search\n [debounceTime]=\"250\"\n [searchText]=\"searchText\"\n (searchApply)=\"searchApplied($event)\"\n >\n </sky-search>\n </sky-toolbar-item>\n <sky-toolbar-view-actions>\n <button\n *ngIf=\"context.showAddButton\"\n type=\"button\"\n class=\"sky-btn sky-btn-link sky-lookup-show-more-modal-add\"\n (click)=\"addButtonClicked()\"\n >\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"add\"\n iconType=\"skyux\"\n ></sky-icon>\n <sky-icon *skyThemeIf=\"'default'\" icon=\"plus-circle\"></sky-icon>\n {{ 'skyux_lookup_show_more_add' | skyLibResources }}\n </button>\n </sky-toolbar-view-actions>\n </sky-toolbar-section>\n </sky-toolbar>\n <sky-toolbar\n *ngIf=\"context.selectMode === 'multiple'\"\n class=\"sky-lookup-show-more-modal-muiltiselect-toolbar\"\n >\n <sky-toolbar-section>\n <sky-toolbar-item>\n <button\n class=\"\n sky-btn sky-btn-link sky-lookup-show-more-modal-select-all-btn\n \"\n type=\"button\"\n (click)=\"selectAll()\"\n >\n {{\n 'skyux_lookup_show_more_select_all_button_title'\n | skyLibResources\n }}\n </button>\n </sky-toolbar-item>\n <sky-toolbar-item>\n <button\n class=\"\n sky-btn sky-btn-link sky-lookup-show-more-modal-clear-all-btn\n \"\n type=\"button\"\n (click)=\"clearAll()\"\n >\n {{\n 'skyux_lookup_show_more_clear_all_button_title'\n | skyLibResources\n }}\n </button>\n </sky-toolbar-item>\n <sky-toolbar-view-actions>\n <sky-checkbox\n [(checked)]=\"onlyShowSelected\"\n (change)=\"updateDataState()\"\n >\n <sky-checkbox-label>\n {{\n 'skyux_lookup_show_more_show_selected_option_title'\n | skyLibResources\n }}\n </sky-checkbox-label>\n </sky-checkbox>\n </sky-toolbar-view-actions>\n </sky-toolbar-section>\n </sky-toolbar>\n </div>\n <div\n *ngIf=\"displayedItems.length === 0\"\n class=\"sky-font-deemphasized sky-lookup-show-more-no-results\"\n >\n {{ 'skyux_lookup_show_more_no_results' | skyLibResources }}\n </div>\n <sky-repeater class=\"sky-lookup-show-more-repeater\" expandMode=\"none\">\n <sky-repeater-item\n *ngFor=\"let item of displayedItems\"\n [selectable]=\"context.selectMode === 'multiple'\"\n [(isSelected)]=\"item.selected\"\n (click)=\"itemClick(item)\"\n (keyup.enter)=\"itemClick(item)\"\n (isSelectedChange)=\"onItemSelect($event, item)\"\n >\n <sky-repeater-item-content>\n <ng-container\n *ngTemplateOutlet=\"\n context.userConfig?.itemTemplate\n ? context.userConfig?.itemTemplate\n : defaultItemTemplate;\n context: { item: item.value }\n \"\n >\n </ng-container>\n </sky-repeater-item-content>\n </sky-repeater-item>\n </sky-repeater>\n <sky-infinite-scroll [enabled]=\"itemsHaveMore\" (scrollEnd)=\"addItems()\">\n </sky-infinite-scroll>\n </sky-modal-content>\n <sky-modal-footer>\n <button\n class=\"\n sky-btn\n sky-btn-primary\n sky-margin-inline-compact\n sky-lookup-show-more-modal-save\n \"\n type=\"button\"\n (click)=\"modalInstance.save(selectedItems)\"\n >\n {{ 'skyux_lookup_show_more_select' | skyLibResources }}\n </button>\n <button\n class=\"sky-btn sky-btn-link sky-lookup-show-more-modal-close\"\n type=\"button\"\n (click)=\"modalInstance.close()\"\n >\n {{ 'skyux_lookup_show_more_cancel' | skyLibResources }}\n </button>\n </sky-modal-footer>\n</sky-modal>\n\n<ng-template let-item=\"item\" #defaultItemTemplate>\n {{ item[context.descriptorProperty] }}\n</ng-template>\n\n<ng-template #defaultTitle>\n <ng-container *ngIf=\"context.selectMode === 'single'\">\n {{ 'skyux_lookup_show_more_modal_title_single' | skyLibResources }}\n </ng-container>\n <ng-container *ngIf=\"context.selectMode === 'multiple'\">\n {{ 'skyux_lookup_show_more_modal_title_multiple' | skyLibResources }}\n </ng-container>\n</ng-template>\n", styles: [".sky-lookup-show-more-no-results{padding:20px 0}:host-context(.sky-theme-modern) .sky-lookup-show-more-no-results{padding:30px 0}.sky-theme-modern .sky-lookup-show-more-no-results{padding:30px 0}\n"], components: [{ type: i1__namespace$1.λ5, selector: "sky-modal", inputs: ["ariaRole", "tiledBody"] }, { type: i1__namespace$1.λ4, selector: "sky-modal-header" }, { type: i1__namespace$1.λ2, selector: "sky-modal-content" }, { type: i3__namespace.λ37, selector: "sky-toolbar" }, { type: i3__namespace.λ38, selector: "sky-toolbar-section" }, { type: i3__namespace.λ39, selector: "sky-toolbar-item" }, { type: SkySearchComponent, selector: "sky-search", inputs: ["searchText", "expandMode", "debounceTime", "disabled", "placeholderText"], outputs: ["searchApply", "searchChange", "searchClear"] }, { type: i3__namespace.λ40, selector: "sky-toolbar-view-actions" }, { type: i4__namespace.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }, { type: i6__namespace.λ3, selector: "sky-checkbox", inputs: ["label", "labelledBy", "id", "disabled", "tabindex", "name", "icon", "checkboxType", "checked", "required"], outputs: ["change", "checkedChange", "disabledChange"] }, { type: i6__namespace.λ4, selector: "sky-checkbox-label" }, { type: i7__namespace$1.λ11, selector: "sky-repeater", inputs: ["activeIndex", "ariaLabel", "reorderable", "expandMode"], outputs: ["activeIndexChange", "orderChange"] }, { type: i7__namespace$1.λ10, selector: "sky-repeater-item", inputs: ["itemName", "inlineFormConfig", "inlineFormTemplate", "isExpanded", "isSelected", "reorderable", "selectable", "showInlineForm", "tag"], outputs: ["collapse", "expand", "inlineFormClose", "isSelectedChange"] }, { type: i7__namespace$1.λ8, selector: "sky-repeater-item-content" }, { type: i7__namespace$1.λ6, selector: "sky-infinite-scroll", inputs: ["enabled", "loading"], outputs: ["scrollEnd"] }, { type: i1__namespace$1.λ3, selector: "sky-modal-footer" }], directives: [{ type: i6__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace.λ3, selector: "[skyViewkeeper]", inputs: ["skyViewkeeper"] }, { type: i7__namespace.λ3, selector: "[skyThemeIf]", inputs: ["skyThemeIf"] }, { type: i6__namespace$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "skyLibResources": i5__namespace.SkyLibResourcesPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
2788
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLookupShowMoreModalComponent, decorators: [{
|
|
2789
|
-
type: i0.Component,
|
|
2790
|
-
args: [{
|
|
2791
|
-
// Suppress this error rather than fix the selector since consumers with unit tests
|
|
2792
|
-
// may be looking for an element with this selector. We can change it in the next major
|
|
2793
|
-
// version of SKY UX.
|
|
2794
|
-
// eslint-disable-next-line @angular-eslint/component-selector
|
|
2795
|
-
selector: 'skyux-lookup-show-more-modal',
|
|
2796
|
-
template: "<sky-modal>\n <sky-modal-header>\n <ng-container *ngIf=\"context.userConfig?.title; else defaultTitle\">\n {{ context.userConfig.title }}\n </ng-container>\n </sky-modal-header>\n <sky-modal-content>\n <div\n [skyViewkeeper]=\"[\n '.sky-lookup-show-more-modal-toolbar',\n '.sky-lookup-show-more-modal-muiltiselect-toolbar'\n ]\"\n >\n <sky-toolbar class=\"sky-lookup-show-more-modal-toolbar\">\n <sky-toolbar-section>\n <sky-toolbar-item>\n <sky-search\n [debounceTime]=\"250\"\n [searchText]=\"searchText\"\n (searchApply)=\"searchApplied($event)\"\n >\n </sky-search>\n </sky-toolbar-item>\n <sky-toolbar-view-actions>\n <button\n *ngIf=\"context.showAddButton\"\n type=\"button\"\n class=\"sky-btn sky-btn-link sky-lookup-show-more-modal-add\"\n (click)=\"addButtonClicked()\"\n >\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"add\"\n iconType=\"skyux\"\n ></sky-icon>\n <sky-icon *skyThemeIf=\"'default'\" icon=\"plus-circle\"></sky-icon>\n {{ 'skyux_lookup_show_more_add' | skyLibResources }}\n </button>\n </sky-toolbar-view-actions>\n </sky-toolbar-section>\n </sky-toolbar>\n <sky-toolbar\n *ngIf=\"context.selectMode === 'multiple'\"\n class=\"sky-lookup-show-more-modal-muiltiselect-toolbar\"\n >\n <sky-toolbar-section>\n <sky-toolbar-item>\n <button\n class=\"\n sky-btn sky-btn-link sky-lookup-show-more-modal-select-all-btn\n \"\n type=\"button\"\n (click)=\"selectAll()\"\n >\n {{\n 'skyux_lookup_show_more_select_all_button_title'\n | skyLibResources\n }}\n </button>\n </sky-toolbar-item>\n <sky-toolbar-item>\n <button\n class=\"\n sky-btn sky-btn-link sky-lookup-show-more-modal-clear-all-btn\n \"\n type=\"button\"\n (click)=\"clearAll()\"\n >\n {{\n 'skyux_lookup_show_more_clear_all_button_title'\n | skyLibResources\n }}\n </button>\n </sky-toolbar-item>\n <sky-toolbar-view-actions>\n <sky-checkbox\n [(checked)]=\"onlyShowSelected\"\n (change)=\"updateDataState()\"\n >\n <sky-checkbox-label>\n {{\n 'skyux_lookup_show_more_show_selected_option_title'\n | skyLibResources\n }}\n </sky-checkbox-label>\n </sky-checkbox>\n </sky-toolbar-view-actions>\n </sky-toolbar-section>\n </sky-toolbar>\n </div>\n <div\n *ngIf=\"displayedItems.length === 0\"\n class=\"sky-font-deemphasized sky-lookup-show-more-no-results\"\n >\n {{ 'skyux_lookup_show_more_no_results' | skyLibResources }}\n </div>\n <sky-repeater class=\"sky-lookup-show-more-repeater\" expandMode=\"none\">\n <sky-repeater-item\n *ngFor=\"let item of displayedItems\"\n [selectable]=\"context.selectMode === 'multiple'\"\n [(isSelected)]=\"item.selected\"\n (click)=\"itemClick(item)\"\n (keyup.enter)=\"itemClick(item)\"\n (isSelectedChange)=\"onItemSelect($event, item)\"\n >\n <sky-repeater-item-content>\n <ng-container\n *ngTemplateOutlet=\"\n context.userConfig?.itemTemplate\n ? context.userConfig?.itemTemplate\n : defaultItemTemplate;\n context: { item: item.value }\n \"\n >\n </ng-container>\n </sky-repeater-item-content>\n </sky-repeater-item>\n </sky-repeater>\n <sky-infinite-scroll [enabled]=\"itemsHaveMore\" (scrollEnd)=\"addItems()\">\n </sky-infinite-scroll>\n </sky-modal-content>\n <sky-modal-footer>\n <button\n class=\"\n sky-btn\n sky-btn-primary\n sky-margin-inline-compact\n sky-lookup-show-more-modal-save\n \"\n type=\"button\"\n (click)=\"modalInstance.save(selectedItems)\"\n >\n {{ 'skyux_lookup_show_more_select' | skyLibResources }}\n </button>\n <button\n class=\"sky-btn sky-btn-link sky-lookup-show-more-modal-close\"\n type=\"button\"\n (click)=\"modalInstance.close()\"\n >\n {{ 'skyux_lookup_show_more_cancel' | skyLibResources }}\n </button>\n </sky-modal-footer>\n</sky-modal>\n\n<ng-template let-item=\"item\" #defaultItemTemplate>\n {{ item[context.descriptorProperty] }}\n</ng-template>\n\n<ng-template #defaultTitle>\n <ng-container *ngIf=\"context.selectMode === 'single'\">\n {{ 'skyux_lookup_show_more_modal_title_single' | skyLibResources }}\n </ng-container>\n <ng-container *ngIf=\"context.selectMode === 'multiple'\">\n {{ 'skyux_lookup_show_more_modal_title_multiple' | skyLibResources }}\n </ng-container>\n</ng-template>\n",
|
|
2797
|
-
styles: [".sky-lookup-show-more-no-results{padding:20px 0}:host-context(.sky-theme-modern) .sky-lookup-show-more-no-results{padding:30px 0}.sky-theme-modern .sky-lookup-show-more-no-results{padding:30px 0}\n"],
|
|
2798
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
2799
|
-
}]
|
|
2800
|
-
}], ctorParameters: function () { return [{ type: i1__namespace$1.SkyModalInstance }, { type: SkyLookupShowMoreNativePickerContext }, { type: i0__namespace.ChangeDetectorRef }]; } });
|
|
2801
|
-
|
|
2802
|
-
/**
|
|
2803
|
-
* @internal
|
|
2804
|
-
* Context for the show more native picker. These values are provided by the lookup component.
|
|
2805
|
-
*/
|
|
2806
|
-
var SkyLookupShowMoreNativePickerAsyncContext = /** @class */ (function () {
|
|
2807
|
-
function SkyLookupShowMoreNativePickerAsyncContext() {
|
|
2808
|
-
}
|
|
2809
|
-
return SkyLookupShowMoreNativePickerAsyncContext;
|
|
2810
|
-
}());
|
|
2811
|
-
|
|
2812
|
-
var SkyLookupItemSelectedPipe = /** @class */ (function () {
|
|
2813
|
-
function SkyLookupItemSelectedPipe() {
|
|
2814
|
-
}
|
|
2815
|
-
SkyLookupItemSelectedPipe.prototype.transform = function (id, selectedIdMap) {
|
|
2816
|
-
return selectedIdMap.has(id);
|
|
2817
|
-
};
|
|
2818
|
-
return SkyLookupItemSelectedPipe;
|
|
2819
|
-
}());
|
|
2820
|
-
SkyLookupItemSelectedPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLookupItemSelectedPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
2821
|
-
SkyLookupItemSelectedPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLookupItemSelectedPipe, name: "skyLookupItemSelected" });
|
|
2822
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLookupItemSelectedPipe, decorators: [{
|
|
2823
|
-
type: i0.Pipe,
|
|
2824
|
-
args: [{
|
|
2825
|
-
name: 'skyLookupItemSelected',
|
|
2826
|
-
}]
|
|
2827
|
-
}] });
|
|
2828
|
-
|
|
2829
|
-
/**
|
|
2830
|
-
* @internal
|
|
2831
|
-
* Internal component to implement the native picker.
|
|
2832
|
-
*/
|
|
2833
|
-
var SkyLookupShowMoreAsyncModalComponent = /** @class */ (function () {
|
|
2834
|
-
function SkyLookupShowMoreAsyncModalComponent(modalInstance, context, changeDetector) {
|
|
2835
|
-
this.modalInstance = modalInstance;
|
|
2836
|
-
this.context = context;
|
|
2837
|
-
this.changeDetector = changeDetector;
|
|
2838
|
-
/**
|
|
2839
|
-
* @internal
|
|
2840
|
-
* Fires when users select the button to add new options to the list.
|
|
2841
|
-
*/
|
|
2842
|
-
this.addClick = new rxjs.Subject();
|
|
2843
|
-
this.displayedItems = [];
|
|
2844
|
-
this.onlyShowSelected = false;
|
|
2845
|
-
this.isSearching = false;
|
|
2846
|
-
this.hasMoreItems = false;
|
|
2847
|
-
this.isLoadingMore = false;
|
|
2848
|
-
this.offset = 0;
|
|
2849
|
-
this.ngUnsubscribe = new rxjs.Subject();
|
|
2850
|
-
}
|
|
2851
|
-
SkyLookupShowMoreAsyncModalComponent.prototype.ngOnInit = function () {
|
|
2852
|
-
this.searchText = this.context.initialSearch;
|
|
2853
|
-
this.createInitialSelectedItemsMap();
|
|
2854
|
-
this.loadSearchResults();
|
|
2855
|
-
};
|
|
2856
|
-
SkyLookupShowMoreAsyncModalComponent.prototype.ngOnDestroy = function () {
|
|
2857
|
-
this.cancelCurrentSearch();
|
|
2858
|
-
this.ngUnsubscribe.next();
|
|
2859
|
-
this.ngUnsubscribe.complete();
|
|
2860
|
-
};
|
|
2861
|
-
SkyLookupShowMoreAsyncModalComponent.prototype.addButtonClicked = function () {
|
|
2862
|
-
this.addClick.next();
|
|
2863
|
-
};
|
|
2864
|
-
SkyLookupShowMoreAsyncModalComponent.prototype.clearAll = function () {
|
|
2865
|
-
var e_1, _a;
|
|
2866
|
-
this.selectedIdMap = new Map(this.selectedIdMap);
|
|
2867
|
-
try {
|
|
2868
|
-
// Only deselect items that have been loaded; items that would be loaded
|
|
2869
|
-
// after an infinite scroll event should remain selected.
|
|
2870
|
-
for (var _b = __values(this.items), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
2871
|
-
var item = _c.value;
|
|
2872
|
-
this.selectedIdMap.delete(item[this.context.idProperty]);
|
|
2873
|
-
}
|
|
2874
|
-
}
|
|
2875
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
2876
|
-
finally {
|
|
2877
|
-
try {
|
|
2878
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2879
|
-
}
|
|
2880
|
-
finally { if (e_1) throw e_1.error; }
|
|
2881
|
-
}
|
|
2882
|
-
this.updateDisplayedItems();
|
|
2883
|
-
this.changeDetector.markForCheck();
|
|
2884
|
-
};
|
|
2885
|
-
SkyLookupShowMoreAsyncModalComponent.prototype.itemClick = function (selectedItem) {
|
|
2886
|
-
if (this.context.selectMode === 'single') {
|
|
2887
|
-
this.onItemSelect(!selectedItem.selected, selectedItem);
|
|
2888
|
-
}
|
|
2889
|
-
};
|
|
2890
|
-
SkyLookupShowMoreAsyncModalComponent.prototype.onItemSelect = function (newSelectState, itemToSelect) {
|
|
2891
|
-
var itemId = itemToSelect[this.context.idProperty];
|
|
2892
|
-
// Create a new Map so the pipe transform will execute on the next
|
|
2893
|
-
// change detection cycle.
|
|
2894
|
-
this.selectedIdMap = new Map(this.selectedIdMap);
|
|
2895
|
-
if (this.context.selectMode === 'single') {
|
|
2896
|
-
if (newSelectState) {
|
|
2897
|
-
this.selectedIdMap.clear();
|
|
2898
|
-
this.selectedIdMap.set(itemId, itemToSelect);
|
|
2899
|
-
}
|
|
2900
|
-
}
|
|
2901
|
-
else {
|
|
2902
|
-
if (newSelectState) {
|
|
2903
|
-
this.selectedIdMap.set(itemId, itemToSelect);
|
|
2904
|
-
}
|
|
2905
|
-
else {
|
|
2906
|
-
this.selectedIdMap.delete(itemId);
|
|
2907
|
-
}
|
|
2908
|
-
}
|
|
2909
|
-
this.updateDisplayedItems();
|
|
2910
|
-
};
|
|
2911
|
-
SkyLookupShowMoreAsyncModalComponent.prototype.searchApplied = function (searchText) {
|
|
2912
|
-
this.offset = 0;
|
|
2913
|
-
this.searchText = searchText;
|
|
2914
|
-
this.loadSearchResults();
|
|
2915
|
-
};
|
|
2916
|
-
SkyLookupShowMoreAsyncModalComponent.prototype.selectAll = function () {
|
|
2917
|
-
var e_2, _a;
|
|
2918
|
-
this.selectedIdMap = new Map();
|
|
2919
|
-
try {
|
|
2920
|
-
for (var _b = __values(this.items), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
2921
|
-
var item = _c.value;
|
|
2922
|
-
this.selectedIdMap.set(item[this.context.idProperty], item);
|
|
2923
|
-
}
|
|
2924
|
-
}
|
|
2925
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
2926
|
-
finally {
|
|
2927
|
-
try {
|
|
2928
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2929
|
-
}
|
|
2930
|
-
finally { if (e_2) throw e_2.error; }
|
|
2931
|
-
}
|
|
2932
|
-
this.updateDisplayedItems();
|
|
2933
|
-
};
|
|
2934
|
-
SkyLookupShowMoreAsyncModalComponent.prototype.infiniteScrollEnd = function () {
|
|
2935
|
-
var _this = this;
|
|
2936
|
-
this.cancelCurrentSearch();
|
|
2937
|
-
/* Sanity check - else case would only happen if this was called directly */
|
|
2938
|
-
/* istanbul ignore else */
|
|
2939
|
-
if (this.hasMoreItems) {
|
|
2940
|
-
this.isLoadingMore = true;
|
|
2941
|
-
this.performSearch(function (result) {
|
|
2942
|
-
_this.items = _this.items.concat(result.items);
|
|
2943
|
-
_this.updateDisplayedItems();
|
|
2944
|
-
_this.isLoadingMore = false;
|
|
2945
|
-
});
|
|
2946
|
-
}
|
|
2947
|
-
};
|
|
2948
|
-
SkyLookupShowMoreAsyncModalComponent.prototype.save = function () {
|
|
2949
|
-
var _this = this;
|
|
2950
|
-
var selectedItems = Array.from(this.selectedIdMap.values(), function (itemData, index) { return ({
|
|
2951
|
-
index: index,
|
|
2952
|
-
itemData: itemData,
|
|
2953
|
-
}); }).sort(function (a, b) {
|
|
2954
|
-
return _this.items.indexOf(a.itemData) < _this.items.indexOf(b.itemData)
|
|
2955
|
-
? -1
|
|
2956
|
-
: 1;
|
|
2957
|
-
});
|
|
2958
|
-
this.modalInstance.save(selectedItems);
|
|
2859
|
+
else {
|
|
2860
|
+
return Promise.resolve(items);
|
|
2861
|
+
}
|
|
2959
2862
|
};
|
|
2960
|
-
|
|
2863
|
+
SkyLookupShowMoreModalComponent.prototype.selectAll = function () {
|
|
2961
2864
|
var _this = this;
|
|
2962
|
-
this.
|
|
2963
|
-
this.
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2865
|
+
var selectedItems = this.selectedItems;
|
|
2866
|
+
this.displayedItems.forEach(function (item) {
|
|
2867
|
+
if (!item.selected) {
|
|
2868
|
+
item.selected = true;
|
|
2869
|
+
var index_1 = _this.items.indexOf(item);
|
|
2870
|
+
/* Sanity check */
|
|
2871
|
+
/* istanbul ignore else */
|
|
2872
|
+
if (selectedItems.findIndex(function (selectedItem) { return selectedItem.index === index_1; }) < 0) {
|
|
2873
|
+
selectedItems.push({
|
|
2874
|
+
index: index_1,
|
|
2875
|
+
itemData: _this.items[index_1].value,
|
|
2876
|
+
});
|
|
2877
|
+
}
|
|
2878
|
+
}
|
|
2967
2879
|
});
|
|
2880
|
+
this.selectedItems = selectedItems;
|
|
2881
|
+
this.updateDataState();
|
|
2882
|
+
this.changeDetector.markForCheck();
|
|
2968
2883
|
};
|
|
2969
|
-
|
|
2970
|
-
var _this = this;
|
|
2971
|
-
this.selectedIdMap = new Map(this.context.initialValue.map(function (item) { return [
|
|
2972
|
-
item[_this.context.idProperty],
|
|
2973
|
-
item,
|
|
2974
|
-
]; }));
|
|
2975
|
-
};
|
|
2976
|
-
SkyLookupShowMoreAsyncModalComponent.prototype.performSearch = function (processResults) {
|
|
2884
|
+
SkyLookupShowMoreModalComponent.prototype.updateDataState = function () {
|
|
2977
2885
|
var _this = this;
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
_this.
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2886
|
+
var selectedItems = this.selectedItems;
|
|
2887
|
+
this.items.forEach(function (item, index) {
|
|
2888
|
+
item.selected =
|
|
2889
|
+
selectedItems.findIndex(function (selectedItem) { return selectedItem.index === index; }) !== -1;
|
|
2890
|
+
});
|
|
2891
|
+
this.searchItems(this.items).then(function (searchedItems) {
|
|
2892
|
+
if (_this.onlyShowSelected) {
|
|
2893
|
+
searchedItems = searchedItems.filter(function (item) { return item.selected; });
|
|
2894
|
+
}
|
|
2895
|
+
_this.displayedItems = searchedItems.slice(0, _this.itemIndex);
|
|
2896
|
+
if (_this.itemIndex > searchedItems.length) {
|
|
2897
|
+
_this.itemsHaveMore = false;
|
|
2898
|
+
}
|
|
2899
|
+
else {
|
|
2900
|
+
_this.itemsHaveMore = true;
|
|
2901
|
+
}
|
|
2992
2902
|
_this.changeDetector.markForCheck();
|
|
2993
2903
|
});
|
|
2994
2904
|
};
|
|
2995
|
-
|
|
2905
|
+
SkyLookupShowMoreModalComponent.prototype.updateItemData = function (data) {
|
|
2996
2906
|
var _this = this;
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
this.isSearching = false;
|
|
3010
|
-
}
|
|
2907
|
+
this.context.items = data;
|
|
2908
|
+
this.items = undefined;
|
|
2909
|
+
this.itemIndex = 10;
|
|
2910
|
+
this.selectedItems.forEach(function (selectedItem) {
|
|
2911
|
+
_this.context.items.forEach(function (item, index) {
|
|
2912
|
+
if (selectedItem.itemData === item) {
|
|
2913
|
+
selectedItem.index = index;
|
|
2914
|
+
}
|
|
2915
|
+
});
|
|
2916
|
+
});
|
|
2917
|
+
this.addItems();
|
|
2918
|
+
this.changeDetector.markForCheck();
|
|
3011
2919
|
};
|
|
3012
|
-
return
|
|
2920
|
+
return SkyLookupShowMoreModalComponent;
|
|
3013
2921
|
}());
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type:
|
|
2922
|
+
SkyLookupShowMoreModalComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLookupShowMoreModalComponent, deps: [{ token: i1__namespace$1.SkyModalInstance }, { token: SkyLookupShowMoreNativePickerContext }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2923
|
+
SkyLookupShowMoreModalComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyLookupShowMoreModalComponent, selector: "skyux-lookup-show-more-modal", ngImport: i0__namespace, template: "<sky-modal>\n <sky-modal-header>\n <ng-container *ngIf=\"context.userConfig?.title; else defaultTitle\">\n {{ context.userConfig.title }}\n </ng-container>\n </sky-modal-header>\n <sky-modal-content>\n <div\n [skyViewkeeper]=\"[\n '.sky-lookup-show-more-modal-toolbar',\n '.sky-lookup-show-more-modal-muiltiselect-toolbar'\n ]\"\n >\n <sky-toolbar class=\"sky-lookup-show-more-modal-toolbar\">\n <sky-toolbar-section>\n <sky-toolbar-item>\n <sky-search\n [debounceTime]=\"250\"\n [searchText]=\"searchText\"\n (searchApply)=\"searchApplied($event)\"\n >\n </sky-search>\n </sky-toolbar-item>\n <sky-toolbar-view-actions>\n <button\n *ngIf=\"context.showAddButton\"\n type=\"button\"\n class=\"sky-btn sky-btn-link sky-lookup-show-more-modal-add\"\n (click)=\"addButtonClicked()\"\n >\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"add\"\n iconType=\"skyux\"\n ></sky-icon>\n <sky-icon *skyThemeIf=\"'default'\" icon=\"plus-circle\"></sky-icon>\n {{ 'skyux_lookup_show_more_add' | skyLibResources }}\n </button>\n </sky-toolbar-view-actions>\n </sky-toolbar-section>\n </sky-toolbar>\n <sky-toolbar\n *ngIf=\"context.selectMode === 'multiple'\"\n class=\"sky-lookup-show-more-modal-muiltiselect-toolbar\"\n >\n <sky-toolbar-section>\n <sky-toolbar-item>\n <button\n class=\"\n sky-btn sky-btn-link sky-lookup-show-more-modal-select-all-btn\n \"\n type=\"button\"\n (click)=\"selectAll()\"\n >\n {{\n 'skyux_lookup_show_more_select_all_button_title'\n | skyLibResources\n }}\n </button>\n </sky-toolbar-item>\n <sky-toolbar-item>\n <button\n class=\"\n sky-btn sky-btn-link sky-lookup-show-more-modal-clear-all-btn\n \"\n type=\"button\"\n (click)=\"clearAll()\"\n >\n {{\n 'skyux_lookup_show_more_clear_all_button_title'\n | skyLibResources\n }}\n </button>\n </sky-toolbar-item>\n <sky-toolbar-view-actions>\n <sky-checkbox\n [(checked)]=\"onlyShowSelected\"\n (change)=\"updateDataState()\"\n >\n <sky-checkbox-label>\n {{\n 'skyux_lookup_show_more_show_selected_option_title'\n | skyLibResources\n }}\n </sky-checkbox-label>\n </sky-checkbox>\n </sky-toolbar-view-actions>\n </sky-toolbar-section>\n </sky-toolbar>\n </div>\n <div\n *ngIf=\"displayedItems.length === 0\"\n class=\"sky-font-deemphasized sky-lookup-show-more-no-results\"\n >\n {{ 'skyux_lookup_show_more_no_results' | skyLibResources }}\n </div>\n <sky-repeater class=\"sky-lookup-show-more-repeater\" expandMode=\"none\">\n <sky-repeater-item\n *ngFor=\"let item of displayedItems\"\n [selectable]=\"context.selectMode === 'multiple'\"\n [(isSelected)]=\"item.selected\"\n (click)=\"itemClick(item)\"\n (keyup.enter)=\"itemClick(item)\"\n (isSelectedChange)=\"onItemSelect($event, item)\"\n >\n <sky-repeater-item-content>\n <ng-container\n *ngTemplateOutlet=\"\n context.userConfig?.itemTemplate\n ? context.userConfig?.itemTemplate\n : defaultItemTemplate;\n context: { item: item.value }\n \"\n >\n </ng-container>\n </sky-repeater-item-content>\n </sky-repeater-item>\n </sky-repeater>\n <sky-infinite-scroll [enabled]=\"itemsHaveMore\" (scrollEnd)=\"addItems()\">\n </sky-infinite-scroll>\n </sky-modal-content>\n <sky-modal-footer>\n <button\n class=\"\n sky-btn\n sky-btn-primary\n sky-margin-inline-compact\n sky-lookup-show-more-modal-save\n \"\n type=\"button\"\n (click)=\"modalInstance.save(selectedItems)\"\n >\n {{ 'skyux_lookup_show_more_select' | skyLibResources }}\n </button>\n <button\n class=\"sky-btn sky-btn-link sky-lookup-show-more-modal-close\"\n type=\"button\"\n (click)=\"modalInstance.close()\"\n >\n {{ 'skyux_lookup_show_more_cancel' | skyLibResources }}\n </button>\n </sky-modal-footer>\n</sky-modal>\n\n<ng-template let-item=\"item\" #defaultItemTemplate>\n {{ item[context.descriptorProperty] }}\n</ng-template>\n\n<ng-template #defaultTitle>\n <ng-container *ngIf=\"context.selectMode === 'single'\">\n {{ 'skyux_lookup_show_more_modal_title_single' | skyLibResources }}\n </ng-container>\n <ng-container *ngIf=\"context.selectMode === 'multiple'\">\n {{ 'skyux_lookup_show_more_modal_title_multiple' | skyLibResources }}\n </ng-container>\n</ng-template>\n", styles: [".sky-lookup-show-more-no-results{padding:20px 0}:host-context(.sky-theme-modern) .sky-lookup-show-more-no-results{padding:30px 0}.sky-theme-modern .sky-lookup-show-more-no-results{padding:30px 0}\n"], components: [{ type: i1__namespace$1.λ5, selector: "sky-modal", inputs: ["ariaRole", "tiledBody"] }, { type: i1__namespace$1.λ4, selector: "sky-modal-header" }, { type: i1__namespace$1.λ2, selector: "sky-modal-content" }, { type: i4__namespace$1.λ37, selector: "sky-toolbar" }, { type: i4__namespace$1.λ38, selector: "sky-toolbar-section" }, { type: i4__namespace$1.λ39, selector: "sky-toolbar-item" }, { type: SkySearchComponent, selector: "sky-search", inputs: ["searchText", "expandMode", "debounceTime", "disabled", "placeholderText"], outputs: ["searchApply", "searchChange", "searchClear"] }, { type: i4__namespace$1.λ40, selector: "sky-toolbar-view-actions" }, { type: i4__namespace.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }, { type: i6__namespace.λ3, selector: "sky-checkbox", inputs: ["label", "labelledBy", "id", "disabled", "tabindex", "name", "icon", "checkboxType", "checked", "required"], outputs: ["change", "checkedChange", "disabledChange"] }, { type: i6__namespace.λ4, selector: "sky-checkbox-label" }, { type: i7__namespace$1.λ11, selector: "sky-repeater", inputs: ["activeIndex", "ariaLabel", "reorderable", "expandMode"], outputs: ["activeIndexChange", "orderChange"] }, { type: i7__namespace$1.λ10, selector: "sky-repeater-item", inputs: ["itemName", "inlineFormConfig", "inlineFormTemplate", "isExpanded", "isSelected", "reorderable", "selectable", "showInlineForm", "tag"], outputs: ["collapse", "expand", "inlineFormClose", "isSelectedChange"] }, { type: i7__namespace$1.λ8, selector: "sky-repeater-item-content" }, { type: i7__namespace$1.λ6, selector: "sky-infinite-scroll", inputs: ["enabled", "loading"], outputs: ["scrollEnd"] }, { type: i1__namespace$1.λ3, selector: "sky-modal-footer" }], directives: [{ type: i6__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace.λ3, selector: "[skyViewkeeper]", inputs: ["skyViewkeeper"] }, { type: i7__namespace.λ3, selector: "[skyThemeIf]", inputs: ["skyThemeIf"] }, { type: i6__namespace$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "skyLibResources": i5__namespace.SkyLibResourcesPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
2924
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLookupShowMoreModalComponent, decorators: [{
|
|
3017
2925
|
type: i0.Component,
|
|
3018
2926
|
args: [{
|
|
3019
|
-
selector
|
|
3020
|
-
|
|
2927
|
+
// Suppress this error rather than fix the selector since consumers with unit tests
|
|
2928
|
+
// may be looking for an element with this selector. We can change it in the next major
|
|
2929
|
+
// version of SKY UX.
|
|
2930
|
+
// eslint-disable-next-line @angular-eslint/component-selector
|
|
2931
|
+
selector: 'skyux-lookup-show-more-modal',
|
|
2932
|
+
template: "<sky-modal>\n <sky-modal-header>\n <ng-container *ngIf=\"context.userConfig?.title; else defaultTitle\">\n {{ context.userConfig.title }}\n </ng-container>\n </sky-modal-header>\n <sky-modal-content>\n <div\n [skyViewkeeper]=\"[\n '.sky-lookup-show-more-modal-toolbar',\n '.sky-lookup-show-more-modal-muiltiselect-toolbar'\n ]\"\n >\n <sky-toolbar class=\"sky-lookup-show-more-modal-toolbar\">\n <sky-toolbar-section>\n <sky-toolbar-item>\n <sky-search\n [debounceTime]=\"250\"\n [searchText]=\"searchText\"\n (searchApply)=\"searchApplied($event)\"\n >\n </sky-search>\n </sky-toolbar-item>\n <sky-toolbar-view-actions>\n <button\n *ngIf=\"context.showAddButton\"\n type=\"button\"\n class=\"sky-btn sky-btn-link sky-lookup-show-more-modal-add\"\n (click)=\"addButtonClicked()\"\n >\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"add\"\n iconType=\"skyux\"\n ></sky-icon>\n <sky-icon *skyThemeIf=\"'default'\" icon=\"plus-circle\"></sky-icon>\n {{ 'skyux_lookup_show_more_add' | skyLibResources }}\n </button>\n </sky-toolbar-view-actions>\n </sky-toolbar-section>\n </sky-toolbar>\n <sky-toolbar\n *ngIf=\"context.selectMode === 'multiple'\"\n class=\"sky-lookup-show-more-modal-muiltiselect-toolbar\"\n >\n <sky-toolbar-section>\n <sky-toolbar-item>\n <button\n class=\"\n sky-btn sky-btn-link sky-lookup-show-more-modal-select-all-btn\n \"\n type=\"button\"\n (click)=\"selectAll()\"\n >\n {{\n 'skyux_lookup_show_more_select_all_button_title'\n | skyLibResources\n }}\n </button>\n </sky-toolbar-item>\n <sky-toolbar-item>\n <button\n class=\"\n sky-btn sky-btn-link sky-lookup-show-more-modal-clear-all-btn\n \"\n type=\"button\"\n (click)=\"clearAll()\"\n >\n {{\n 'skyux_lookup_show_more_clear_all_button_title'\n | skyLibResources\n }}\n </button>\n </sky-toolbar-item>\n <sky-toolbar-view-actions>\n <sky-checkbox\n [(checked)]=\"onlyShowSelected\"\n (change)=\"updateDataState()\"\n >\n <sky-checkbox-label>\n {{\n 'skyux_lookup_show_more_show_selected_option_title'\n | skyLibResources\n }}\n </sky-checkbox-label>\n </sky-checkbox>\n </sky-toolbar-view-actions>\n </sky-toolbar-section>\n </sky-toolbar>\n </div>\n <div\n *ngIf=\"displayedItems.length === 0\"\n class=\"sky-font-deemphasized sky-lookup-show-more-no-results\"\n >\n {{ 'skyux_lookup_show_more_no_results' | skyLibResources }}\n </div>\n <sky-repeater class=\"sky-lookup-show-more-repeater\" expandMode=\"none\">\n <sky-repeater-item\n *ngFor=\"let item of displayedItems\"\n [selectable]=\"context.selectMode === 'multiple'\"\n [(isSelected)]=\"item.selected\"\n (click)=\"itemClick(item)\"\n (keyup.enter)=\"itemClick(item)\"\n (isSelectedChange)=\"onItemSelect($event, item)\"\n >\n <sky-repeater-item-content>\n <ng-container\n *ngTemplateOutlet=\"\n context.userConfig?.itemTemplate\n ? context.userConfig?.itemTemplate\n : defaultItemTemplate;\n context: { item: item.value }\n \"\n >\n </ng-container>\n </sky-repeater-item-content>\n </sky-repeater-item>\n </sky-repeater>\n <sky-infinite-scroll [enabled]=\"itemsHaveMore\" (scrollEnd)=\"addItems()\">\n </sky-infinite-scroll>\n </sky-modal-content>\n <sky-modal-footer>\n <button\n class=\"\n sky-btn\n sky-btn-primary\n sky-margin-inline-compact\n sky-lookup-show-more-modal-save\n \"\n type=\"button\"\n (click)=\"modalInstance.save(selectedItems)\"\n >\n {{ 'skyux_lookup_show_more_select' | skyLibResources }}\n </button>\n <button\n class=\"sky-btn sky-btn-link sky-lookup-show-more-modal-close\"\n type=\"button\"\n (click)=\"modalInstance.close()\"\n >\n {{ 'skyux_lookup_show_more_cancel' | skyLibResources }}\n </button>\n </sky-modal-footer>\n</sky-modal>\n\n<ng-template let-item=\"item\" #defaultItemTemplate>\n {{ item[context.descriptorProperty] }}\n</ng-template>\n\n<ng-template #defaultTitle>\n <ng-container *ngIf=\"context.selectMode === 'single'\">\n {{ 'skyux_lookup_show_more_modal_title_single' | skyLibResources }}\n </ng-container>\n <ng-container *ngIf=\"context.selectMode === 'multiple'\">\n {{ 'skyux_lookup_show_more_modal_title_multiple' | skyLibResources }}\n </ng-container>\n</ng-template>\n",
|
|
3021
2933
|
styles: [".sky-lookup-show-more-no-results{padding:20px 0}:host-context(.sky-theme-modern) .sky-lookup-show-more-no-results{padding:30px 0}.sky-theme-modern .sky-lookup-show-more-no-results{padding:30px 0}\n"],
|
|
3022
2934
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
3023
2935
|
}]
|
|
3024
|
-
}], ctorParameters: function () { return [{ type: i1__namespace$1.SkyModalInstance }, { type:
|
|
2936
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$1.SkyModalInstance }, { type: SkyLookupShowMoreNativePickerContext }, { type: i0__namespace.ChangeDetectorRef }]; } });
|
|
2937
|
+
|
|
2938
|
+
/**
|
|
2939
|
+
* @internal
|
|
2940
|
+
*/
|
|
2941
|
+
var SkyLookupAdapterService = /** @class */ (function () {
|
|
2942
|
+
function SkyLookupAdapterService() {
|
|
2943
|
+
}
|
|
2944
|
+
SkyLookupAdapterService.prototype.focusInput = function (elRef) {
|
|
2945
|
+
var inputEl = elRef.nativeElement.querySelector('.sky-lookup-input');
|
|
2946
|
+
/* Sanity check */
|
|
2947
|
+
/* istanbul ignore else */
|
|
2948
|
+
if (inputEl) {
|
|
2949
|
+
inputEl.focus();
|
|
2950
|
+
}
|
|
2951
|
+
};
|
|
2952
|
+
return SkyLookupAdapterService;
|
|
2953
|
+
}());
|
|
2954
|
+
SkyLookupAdapterService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLookupAdapterService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
2955
|
+
SkyLookupAdapterService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLookupAdapterService });
|
|
2956
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLookupAdapterService, decorators: [{
|
|
2957
|
+
type: i0.Injectable
|
|
2958
|
+
}] });
|
|
2959
|
+
|
|
2960
|
+
/**
|
|
2961
|
+
* @internal
|
|
2962
|
+
*/
|
|
2963
|
+
var SkyLookupAutocompleteAdapter = /** @class */ (function () {
|
|
2964
|
+
function SkyLookupAutocompleteAdapter() {
|
|
2965
|
+
/**
|
|
2966
|
+
* Fires when users enter new search information and allows results to be
|
|
2967
|
+
* returned via an observable.
|
|
2968
|
+
*/
|
|
2969
|
+
this.searchAsync = new i0.EventEmitter();
|
|
2970
|
+
}
|
|
2971
|
+
Object.defineProperty(SkyLookupAutocompleteAdapter.prototype, "descriptorProperty", {
|
|
2972
|
+
get: function () {
|
|
2973
|
+
return this._descriptorProperty || 'name';
|
|
2974
|
+
},
|
|
2975
|
+
/**
|
|
2976
|
+
* Specifies an object property to display in the text input after users
|
|
2977
|
+
* select an item in the dropdown list.
|
|
2978
|
+
* @default "name"
|
|
2979
|
+
*/
|
|
2980
|
+
set: function (value) {
|
|
2981
|
+
this._descriptorProperty = value;
|
|
2982
|
+
},
|
|
2983
|
+
enumerable: false,
|
|
2984
|
+
configurable: true
|
|
2985
|
+
});
|
|
2986
|
+
Object.defineProperty(SkyLookupAutocompleteAdapter.prototype, "propertiesToSearch", {
|
|
2987
|
+
get: function () {
|
|
2988
|
+
return this._propertiesToSearch || ['name'];
|
|
2989
|
+
},
|
|
2990
|
+
/**
|
|
2991
|
+
* Specifies an array of object properties to search.
|
|
2992
|
+
* @default ["name"]
|
|
2993
|
+
*/
|
|
2994
|
+
set: function (value) {
|
|
2995
|
+
this._propertiesToSearch = value;
|
|
2996
|
+
},
|
|
2997
|
+
enumerable: false,
|
|
2998
|
+
configurable: true
|
|
2999
|
+
});
|
|
3000
|
+
Object.defineProperty(SkyLookupAutocompleteAdapter.prototype, "search", {
|
|
3001
|
+
get: function () {
|
|
3002
|
+
return (this._search ||
|
|
3003
|
+
skyAutocompleteDefaultSearchFunction({
|
|
3004
|
+
propertiesToSearch: this.propertiesToSearch,
|
|
3005
|
+
searchFilters: this.searchFilters,
|
|
3006
|
+
}));
|
|
3007
|
+
},
|
|
3008
|
+
/**
|
|
3009
|
+
* Specifies a function to dynamically manage the data source when users
|
|
3010
|
+
* change the text in the lookup field. The search function must return
|
|
3011
|
+
* an array or a promise of an array. The `search` property is particularly
|
|
3012
|
+
* useful when the data source does not live in the source code. If the
|
|
3013
|
+
* search requires calling a remote data source, use `searchAsync` instead of
|
|
3014
|
+
* `search`.
|
|
3015
|
+
*/
|
|
3016
|
+
set: function (value) {
|
|
3017
|
+
this._search = value;
|
|
3018
|
+
},
|
|
3019
|
+
enumerable: false,
|
|
3020
|
+
configurable: true
|
|
3021
|
+
});
|
|
3022
|
+
return SkyLookupAutocompleteAdapter;
|
|
3023
|
+
}());
|
|
3024
|
+
SkyLookupAutocompleteAdapter.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLookupAutocompleteAdapter, deps: [], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
3025
|
+
SkyLookupAutocompleteAdapter.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: SkyLookupAutocompleteAdapter, inputs: { debounceTime: "debounceTime", descriptorProperty: "descriptorProperty", propertiesToSearch: "propertiesToSearch", search: "search", searchResultTemplate: "searchResultTemplate", searchTextMinimumCharacters: "searchTextMinimumCharacters", searchFilters: "searchFilters", searchResultsLimit: "searchResultsLimit" }, outputs: { searchAsync: "searchAsync" }, ngImport: i0__namespace });
|
|
3026
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLookupAutocompleteAdapter, decorators: [{
|
|
3027
|
+
type: i0.Directive
|
|
3028
|
+
}], propDecorators: { debounceTime: [{
|
|
3029
|
+
type: i0.Input
|
|
3030
|
+
}], descriptorProperty: [{
|
|
3031
|
+
type: i0.Input
|
|
3032
|
+
}], propertiesToSearch: [{
|
|
3033
|
+
type: i0.Input
|
|
3034
|
+
}], search: [{
|
|
3035
|
+
type: i0.Input
|
|
3036
|
+
}], searchResultTemplate: [{
|
|
3037
|
+
type: i0.Input
|
|
3038
|
+
}], searchTextMinimumCharacters: [{
|
|
3039
|
+
type: i0.Input
|
|
3040
|
+
}], searchFilters: [{
|
|
3041
|
+
type: i0.Input
|
|
3042
|
+
}], searchResultsLimit: [{
|
|
3043
|
+
type: i0.Input
|
|
3044
|
+
}], searchAsync: [{
|
|
3045
|
+
type: i0.Output
|
|
3046
|
+
}] } });
|
|
3025
3047
|
|
|
3026
3048
|
var SkyLookupComponent = /** @class */ (function (_super) {
|
|
3027
3049
|
__extends(SkyLookupComponent, _super);
|
|
@@ -3058,9 +3080,9 @@
|
|
|
3058
3080
|
_this.idle = new rxjs.Subject();
|
|
3059
3081
|
_this.markForTokenFocusOnKeyUp = false;
|
|
3060
3082
|
// Angular automatically constructs these methods.
|
|
3061
|
-
|
|
3083
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
3062
3084
|
_this.onChange = function (value) { };
|
|
3063
|
-
|
|
3085
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
3064
3086
|
_this.onTouched = function () { };
|
|
3065
3087
|
ngControl.valueAccessor = _this;
|
|
3066
3088
|
return _this;
|
|
@@ -3347,8 +3369,9 @@
|
|
|
3347
3369
|
var isValueInTextBox = false;
|
|
3348
3370
|
if (this.selectMode === 'single') {
|
|
3349
3371
|
isValueInTextBox =
|
|
3350
|
-
this.autocompleteInputDirective.
|
|
3351
|
-
this.autocompleteInputDirective.
|
|
3372
|
+
this.autocompleteInputDirective.value &&
|
|
3373
|
+
this.autocompleteInputDirective.inputTextValue ===
|
|
3374
|
+
this.autocompleteInputDirective.value[this.descriptorProperty];
|
|
3352
3375
|
}
|
|
3353
3376
|
this.openPicker(isValueInTextBox ? '' : this.autocompleteInputDirective.inputTextValue);
|
|
3354
3377
|
this.autocompleteInputDirective.restoreInputTextValueToPreviousState();
|
|
@@ -3519,7 +3542,8 @@
|
|
|
3519
3542
|
}
|
|
3520
3543
|
if (this.data.indexOf(args.item) >= 0) {
|
|
3521
3544
|
if (this.openNativePicker) {
|
|
3522
|
-
|
|
3545
|
+
this.openNativePicker
|
|
3546
|
+
.componentInstance.onItemSelect(true, { value: args.item, selected: false });
|
|
3523
3547
|
}
|
|
3524
3548
|
else {
|
|
3525
3549
|
var newValue = this.value;
|
|
@@ -3637,45 +3661,6 @@
|
|
|
3637
3661
|
}]
|
|
3638
3662
|
}] } });
|
|
3639
3663
|
|
|
3640
|
-
var SkySearchModule = /** @class */ (function () {
|
|
3641
|
-
function SkySearchModule() {
|
|
3642
|
-
}
|
|
3643
|
-
return SkySearchModule;
|
|
3644
|
-
}());
|
|
3645
|
-
SkySearchModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkySearchModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
3646
|
-
SkySearchModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkySearchModule, declarations: [SkySearchComponent], imports: [i6$1.CommonModule,
|
|
3647
|
-
i6.SkyInputBoxModule,
|
|
3648
|
-
SkyLookupResourcesModule,
|
|
3649
|
-
i8.FormsModule,
|
|
3650
|
-
i4.SkyIconModule,
|
|
3651
|
-
i7.SkyThemeModule,
|
|
3652
|
-
i1.SkyIdModule], exports: [SkySearchComponent] });
|
|
3653
|
-
SkySearchModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkySearchModule, imports: [[
|
|
3654
|
-
i6$1.CommonModule,
|
|
3655
|
-
i6.SkyInputBoxModule,
|
|
3656
|
-
SkyLookupResourcesModule,
|
|
3657
|
-
i8.FormsModule,
|
|
3658
|
-
i4.SkyIconModule,
|
|
3659
|
-
i7.SkyThemeModule,
|
|
3660
|
-
i1.SkyIdModule,
|
|
3661
|
-
]] });
|
|
3662
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkySearchModule, decorators: [{
|
|
3663
|
-
type: i0.NgModule,
|
|
3664
|
-
args: [{
|
|
3665
|
-
declarations: [SkySearchComponent],
|
|
3666
|
-
imports: [
|
|
3667
|
-
i6$1.CommonModule,
|
|
3668
|
-
i6.SkyInputBoxModule,
|
|
3669
|
-
SkyLookupResourcesModule,
|
|
3670
|
-
i8.FormsModule,
|
|
3671
|
-
i4.SkyIconModule,
|
|
3672
|
-
i7.SkyThemeModule,
|
|
3673
|
-
i1.SkyIdModule,
|
|
3674
|
-
],
|
|
3675
|
-
exports: [SkySearchComponent],
|
|
3676
|
-
}]
|
|
3677
|
-
}] });
|
|
3678
|
-
|
|
3679
3664
|
var SkyLookupModule = /** @class */ (function () {
|
|
3680
3665
|
function SkyLookupModule() {
|
|
3681
3666
|
}
|
|
@@ -3698,7 +3683,7 @@
|
|
|
3698
3683
|
SkySearchModule,
|
|
3699
3684
|
i7.SkyThemeModule,
|
|
3700
3685
|
i4.SkyTokensModule,
|
|
3701
|
-
|
|
3686
|
+
i4$1.SkyToolbarModule,
|
|
3702
3687
|
i1.SkyViewkeeperModule,
|
|
3703
3688
|
i4.SkyWaitModule], exports: [SkyLookupComponent] });
|
|
3704
3689
|
SkyLookupModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLookupModule, imports: [[
|
|
@@ -3715,7 +3700,7 @@
|
|
|
3715
3700
|
SkySearchModule,
|
|
3716
3701
|
i7.SkyThemeModule,
|
|
3717
3702
|
i4.SkyTokensModule,
|
|
3718
|
-
|
|
3703
|
+
i4$1.SkyToolbarModule,
|
|
3719
3704
|
i1.SkyViewkeeperModule,
|
|
3720
3705
|
i4.SkyWaitModule,
|
|
3721
3706
|
]] });
|
|
@@ -3742,7 +3727,7 @@
|
|
|
3742
3727
|
SkySearchModule,
|
|
3743
3728
|
i7.SkyThemeModule,
|
|
3744
3729
|
i4.SkyTokensModule,
|
|
3745
|
-
|
|
3730
|
+
i4$1.SkyToolbarModule,
|
|
3746
3731
|
i1.SkyViewkeeperModule,
|
|
3747
3732
|
i4.SkyWaitModule,
|
|
3748
3733
|
],
|