@vgip/meta-ui 1.7.3 → 1.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/esm2022/lib/common/metaNormalizer.mjs +7 -1
  2. package/esm2022/lib/fieldComposite/index.mjs +19 -2
  3. package/esm2022/lib/fieldDatetime/index.mjs +3 -3
  4. package/esm2022/lib/fieldInput/index.mjs +3 -3
  5. package/esm2022/lib/fieldReference/index.mjs +3 -3
  6. package/esm2022/lib/fieldSelect/index.mjs +3 -3
  7. package/esm2022/lib/metaField/index.mjs +3 -3
  8. package/fesm2022/{vgip-meta-ui-index-b6fcc07d.mjs → vgip-meta-ui-index-0349968f.mjs} +3 -3
  9. package/fesm2022/vgip-meta-ui-index-0349968f.mjs.map +1 -0
  10. package/fesm2022/{vgip-meta-ui-index-3bc3d41b.mjs → vgip-meta-ui-index-24fe289e.mjs} +8 -2
  11. package/fesm2022/vgip-meta-ui-index-24fe289e.mjs.map +1 -0
  12. package/fesm2022/{vgip-meta-ui-index-af4eda3c.mjs → vgip-meta-ui-index-44af92c9.mjs} +3 -3
  13. package/fesm2022/vgip-meta-ui-index-44af92c9.mjs.map +1 -0
  14. package/fesm2022/{vgip-meta-ui-index-3fda8c0e.mjs → vgip-meta-ui-index-9c99e9b0.mjs} +2 -2
  15. package/fesm2022/{vgip-meta-ui-index-3fda8c0e.mjs.map → vgip-meta-ui-index-9c99e9b0.mjs.map} +1 -1
  16. package/fesm2022/{vgip-meta-ui-index-fef499eb.mjs → vgip-meta-ui-index-9fd8e1b0.mjs} +20 -3
  17. package/fesm2022/vgip-meta-ui-index-9fd8e1b0.mjs.map +1 -0
  18. package/fesm2022/vgip-meta-ui-index-a3a43cf7.mjs +862 -0
  19. package/fesm2022/vgip-meta-ui-index-a3a43cf7.mjs.map +1 -0
  20. package/fesm2022/{vgip-meta-ui-index-b48e32ce.mjs → vgip-meta-ui-index-bc945c3c.mjs} +5 -5
  21. package/fesm2022/vgip-meta-ui-index-bc945c3c.mjs.map +1 -0
  22. package/fesm2022/{vgip-meta-ui-index-39011b04.mjs → vgip-meta-ui-index-c5756fbe.mjs} +9 -9
  23. package/fesm2022/vgip-meta-ui-index-c5756fbe.mjs.map +1 -0
  24. package/fesm2022/vgip-meta-ui.mjs +10 -10
  25. package/lib/fieldComposite/index.d.ts +6 -3
  26. package/package.json +1 -1
  27. package/fesm2022/vgip-meta-ui-index-39011b04.mjs.map +0 -1
  28. package/fesm2022/vgip-meta-ui-index-3bc3d41b.mjs.map +0 -1
  29. package/fesm2022/vgip-meta-ui-index-a2a973a6.mjs +0 -862
  30. package/fesm2022/vgip-meta-ui-index-a2a973a6.mjs.map +0 -1
  31. package/fesm2022/vgip-meta-ui-index-af4eda3c.mjs.map +0 -1
  32. package/fesm2022/vgip-meta-ui-index-b48e32ce.mjs.map +0 -1
  33. package/fesm2022/vgip-meta-ui-index-b6fcc07d.mjs.map +0 -1
  34. package/fesm2022/vgip-meta-ui-index-fef499eb.mjs.map +0 -1
@@ -0,0 +1,862 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, Injectable, Component } from '@angular/core';
3
+ import { F as FieldAbstract } from './vgip-meta-ui-fieldAbstract-9955be39.mjs';
4
+ import * as i2 from '@angular/forms';
5
+ import { ControlContainer, NgForm } from '@angular/forms';
6
+ import { Subject } from 'rxjs';
7
+ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
8
+ import { M as MetaRefDialog, b as MetaReferenceService, a as MetaResourceService, f as MetaMsgService } from './vgip-meta-ui-index-24fe289e.mjs';
9
+ import { M as MetaContextService } from './vgip-meta-ui-index-ea5c2466.mjs';
10
+ import * as i1 from '@angular/common';
11
+ import { M as MetaField } from './vgip-meta-ui-index-c5756fbe.mjs';
12
+ import { M as MetaModelPipe } from './vgip-meta-ui-metaModel.pipe-6b803e66.mjs';
13
+
14
+ /*
15
+ * @Author: Alexander.Vangelov@vonage.com
16
+ * @Date: 2019-09-19 17:35:19
17
+ * @Last Modified by: Alexander.Vangelov@vonage.com
18
+ * @Last Modified time: 2020-03-23 17:08:23
19
+ */
20
+ class MetaTrackerService {
21
+ constructor() {
22
+ this.events = new EventEmitter();
23
+ }
24
+ emit(event) {
25
+ if (!event.integration) {
26
+ event.integration = this.integrationCode || 'N/A';
27
+ }
28
+ if (!event.resource) {
29
+ event.resource = this.resourceType || 'N/A';
30
+ }
31
+ this.events.emit(event);
32
+ }
33
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: MetaTrackerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
34
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: MetaTrackerService, providedIn: 'root' }); }
35
+ }
36
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: MetaTrackerService, decorators: [{
37
+ type: Injectable,
38
+ args: [{
39
+ providedIn: 'root'
40
+ }]
41
+ }], ctorParameters: function () { return []; } });
42
+
43
+ class FieldReference extends FieldAbstract {
44
+ constructor(referenceService, metaResource, metaMsgService, metaContext, metaTracker, viewContainerRef) {
45
+ super();
46
+ this.referenceService = referenceService;
47
+ this.metaResource = metaResource;
48
+ this.metaMsgService = metaMsgService;
49
+ this.metaContext = metaContext;
50
+ this.metaTracker = metaTracker;
51
+ this.viewContainerRef = viewContainerRef;
52
+ this.searchResourceType = {};
53
+ this.searchTextChanged = new Subject();
54
+ this.isCreatable = false;
55
+ this.dropdownVisible = false;
56
+ this.searchResourceTypeMeta = {
57
+ type: 'select',
58
+ name: 'resourceType',
59
+ label: 'Type',
60
+ options: [],
61
+ standalone: true
62
+ };
63
+ this.filteredSuggestions = [];
64
+ this.smartSuggestions = [];
65
+ this.clickout = (event) => {
66
+ const internalControl = this.elementRef.nativeElement.contains(event.target);
67
+ if (internalControl && ['Vlt-dropdown__link', 'Vlt-dropdown__block'].indexOf(event.target.className) !== -1) {
68
+ this.focus();
69
+ }
70
+ else if (!internalControl && event.target !== this.input && event.target.className !== 'Vlt-dropdown__title') {
71
+ this.dismissDropdown();
72
+ }
73
+ else {
74
+ if (!internalControl && internalControl.tagName !== 'INPUT') {
75
+ this.focus();
76
+ }
77
+ }
78
+ };
79
+ this.keydown = (event) => {
80
+ switch (event.key) {
81
+ case 'ArrowDown': {
82
+ this.showDropdown();
83
+ if (typeof (this.activeSuggestionIndex) === 'undefined') {
84
+ this.activeSuggestionIndex = 0;
85
+ }
86
+ else {
87
+ this.activeSuggestionIndex++;
88
+ if (this.activeSuggestionIndex >= (this.searchResults || this.suggestions).length) {
89
+ this.activeSuggestionIndex = 0;
90
+ }
91
+ }
92
+ this.ensureDropdownOptionIsVisible();
93
+ event.preventDefault();
94
+ event.stopPropagation();
95
+ break;
96
+ }
97
+ case 'ArrowUp': {
98
+ this.showDropdown();
99
+ if (typeof (this.activeSuggestionIndex) === 'undefined') {
100
+ this.activeSuggestionIndex = (this.searchResults || this.suggestions).length - 1;
101
+ }
102
+ else {
103
+ this.activeSuggestionIndex--;
104
+ if (this.activeSuggestionIndex < 0) {
105
+ this.activeSuggestionIndex = (this.searchResults || this.suggestions).length - 1;
106
+ }
107
+ }
108
+ this.ensureDropdownOptionIsVisible();
109
+ event.preventDefault();
110
+ event.stopPropagation();
111
+ break;
112
+ }
113
+ case 'Space':
114
+ case 'Enter': {
115
+ if (typeof (this.activeSuggestionIndex) !== 'undefined') {
116
+ event.preventDefault();
117
+ event.stopPropagation();
118
+ this.onSuggestionSelect(event, (this.searchResults || this.suggestions)[this.activeSuggestionIndex]);
119
+ delete this.activeSuggestionIndex;
120
+ }
121
+ break;
122
+ }
123
+ case 'Escape': {
124
+ event.preventDefault();
125
+ event.stopPropagation();
126
+ this.dismissDropdown();
127
+ break;
128
+ }
129
+ case 'Backspace': {
130
+ if (!this.multiple && this.model) { // HPBR-8229
131
+ event.preventDefault();
132
+ event.stopPropagation();
133
+ this.removeSelection();
134
+ }
135
+ break;
136
+ }
137
+ }
138
+ };
139
+ }
140
+ get disabled() {
141
+ const superDisabled = this.logicalDisabled || this.validations.disabled || this.meta.disabled === true
142
+ || (this.meta.updatable === false && this.isPersistedParent);
143
+ this.searchResourceTypeMeta.disabled = superDisabled;
144
+ return superDisabled;
145
+ }
146
+ get showTypes() {
147
+ return (typeof (this.meta.showTypes) !== 'undefined') ? this.meta.showTypes : true;
148
+ }
149
+ get suggestions() {
150
+ return this.smartSuggestions.concat(!this.searchResourceType.resourceType ?
151
+ // eslint-disable-next-line max-len
152
+ (this.asyncSuggestions || this.meta.suggestions || []) : (this.asyncSuggestions || this.meta.suggestions || []).filter((s) => s.type === this.searchResourceType.resourceType));
153
+ }
154
+ get hasAppendButton() {
155
+ if (!this.multiple && this.model) {
156
+ if (this.isPolymorphic) {
157
+ for (const ref of this.metaReference) {
158
+ if ((ref.name || ref.resourceType) === (this.model.type || this.model.resourceType)) {
159
+ return ref.updatable || (ref.creatable && ref.updatable !== false);
160
+ }
161
+ }
162
+ }
163
+ else {
164
+ return this.metaReference.updatable || (this.metaReference.creatable && this.metaReference.updatable !== false); // VGIS-6911
165
+ }
166
+ }
167
+ else if (this.metaReference instanceof Array) {
168
+ // setTimeout(() => {
169
+ // this.searchResourceTypesScope = this.metaReference.map(rt => rt.name).join(',');
170
+ // }, 0);
171
+ for (const rt of this.metaReference) {
172
+ if (rt.hidden !== false && rt.creatable) {
173
+ return true;
174
+ }
175
+ }
176
+ }
177
+ else {
178
+ return this.metaReference.creatable;
179
+ }
180
+ }
181
+ get resourceService() {
182
+ if (!this.metaResourceService) {
183
+ const metaResourceConfig = {
184
+ integrationCode: this.integrationCode,
185
+ resourceType: this.resourceType
186
+ };
187
+ this.metaResourceService = this.metaResource.new(metaResourceConfig);
188
+ }
189
+ return this.metaResourceService;
190
+ }
191
+ get metaReference() {
192
+ return this.meta.reference || {};
193
+ }
194
+ ngOnInit() {
195
+ this.multiple = (this.meta.type === 'multireference') || this.meta.multiple;
196
+ this.searchResourceTypeMeta.label = this.meta.label;
197
+ if (!this.meta.valueType) {
198
+ // this.meta.valueType = 'object';
199
+ Object.defineProperty(this.meta, 'valueType', {
200
+ value: 'object'
201
+ });
202
+ }
203
+ if (this.metaReference instanceof Array) {
204
+ this.isPolymorphic = true;
205
+ this.isSearchable = true;
206
+ this.searchResourceTypesScope = this.metaReference.filter(rt => rt.hidden !== true).map(rt => rt.name).join(',');
207
+ for (const rt of this.metaReference) {
208
+ if (rt.creatable) {
209
+ this.isCreatable = true;
210
+ if (typeof (rt.searchable) !== 'undefined' && !rt.searchable) {
211
+ this.isSearchable = false;
212
+ }
213
+ }
214
+ }
215
+ this.metaReference.forEach((r) => {
216
+ if (!r.hidden) {
217
+ this.searchResourceTypeMeta.options.push({ id: r.name, label: r.label || r.name });
218
+ }
219
+ });
220
+ }
221
+ else {
222
+ this.isSearchable = typeof (this.metaReference.searchable) === 'undefined' || this.metaReference.searchable;
223
+ this.searchResourceType = this.metaReference;
224
+ this.searchResourceTypesScope = this.metaReference.name || this.metaReference.resourceType;
225
+ this.isCreatable = this.metaReference.creatable;
226
+ }
227
+ this.buildPlaceholderLabel();
228
+ this.searchTextChanged.pipe(debounceTime(300), distinctUntilChanged()).subscribe((value) => {
229
+ this.searchText = value;
230
+ this.search();
231
+ });
232
+ const origValue = this.parent[this.meta.name];
233
+ // this.suggestions = this.meta.suggestions; // TODO filter by default type
234
+ // console.log('this.suggestions', this.suggestions);
235
+ Object.defineProperty(this.parent, this.meta.name, {
236
+ set: (value) => {
237
+ if (value === '') {
238
+ value = null;
239
+ }
240
+ if (this.multiple) {
241
+ if (value && value instanceof Array) {
242
+ for (const v of value) {
243
+ if (!this.model) {
244
+ this.model = [];
245
+ }
246
+ if (typeof (v) === 'string') {
247
+ this.model.push({
248
+ id: v,
249
+ label: v,
250
+ type: this.metaReference.name
251
+ });
252
+ }
253
+ }
254
+ }
255
+ else {
256
+ value = null; // protect when value from server is not array
257
+ }
258
+ }
259
+ else {
260
+ if (typeof (value) === 'string') {
261
+ value = {
262
+ id: value,
263
+ label: value,
264
+ type: this.metaReference.name
265
+ };
266
+ }
267
+ this.searchText = value ?
268
+ ((!value.label || value.label === ' ') ? `N/A (${value.type}#${value.id})` : value.label || value) :
269
+ '';
270
+ // if (this.isPolymorphic && this.model) { //TODO show or not?
271
+ // this.searchResourceType = this.metaReference.find((rt)=> {
272
+ // return rt.name === this.model.type;
273
+ // });
274
+ // }
275
+ }
276
+ this.model = value;
277
+ if (!this.multiple) {
278
+ this.value = this.modelToValue(value, this.meta.valueType || 'object');
279
+ this.buildExternalLink();
280
+ }
281
+ else {
282
+ this.value = !this.model ? this.model : this.model.map((m) => this.modelToValue(m, this.meta.valueType || 'object'));
283
+ }
284
+ this.meta.$optional = this.isOptional;
285
+ },
286
+ get: () => this.value,
287
+ enumerable: this.sendToServer,
288
+ configurable: true
289
+ });
290
+ if (origValue) {
291
+ this.parent[this.meta.name] = origValue;
292
+ }
293
+ if (!this.model && this.default) {
294
+ if (this.multiple) {
295
+ this.parent[this.meta.name] = [];
296
+ if (this.default.length) {
297
+ for (const dv of this.default) {
298
+ if ((dv.id || dv.value) && dv.type) {
299
+ const item = {
300
+ id: dv.id || dv.value,
301
+ label: dv.label || dv.id || dv.value,
302
+ type: dv.type
303
+ };
304
+ if (dv.externalLink) {
305
+ item.externalLink = dv.externalLink;
306
+ }
307
+ this.parent[this.meta.name].push(item);
308
+ }
309
+ }
310
+ }
311
+ if (!this.parent[this.meta.name].length) {
312
+ this.clear();
313
+ }
314
+ }
315
+ else {
316
+ if (this.default.id && this.default.label && this.default.type) {
317
+ setTimeout(() => {
318
+ const item = {
319
+ id: this.default.id || this.default.value,
320
+ label: this.default.label || this.default.id || this.default.value,
321
+ type: this.default.type,
322
+ smart: true
323
+ };
324
+ if (this.default.externalLink) {
325
+ item.externalLink = this.default.externalLink;
326
+ }
327
+ this.parent[this.meta.name] = item;
328
+ }, 0);
329
+ }
330
+ else {
331
+ console.warn('!!!default value is not valid format', this.meta);
332
+ }
333
+ }
334
+ }
335
+ if (typeof (this.meta.disabled) !== 'undefined') {
336
+ if (typeof (this.meta.disabled) === 'object') {
337
+ for (const p of Object.keys(this.meta.disabled)) {
338
+ const props = p.split('.');
339
+ if (typeof (this.parent[props[0]]) !== 'undefined') {
340
+ let val = this.parent;
341
+ for (const prop of props) {
342
+ val = val[prop];
343
+ if (!val) {
344
+ break;
345
+ }
346
+ }
347
+ if (val === this.meta.disabled[p]) {
348
+ this.logicalDisabled = true;
349
+ this.clear();
350
+ }
351
+ }
352
+ this.parentChangeSubject.subscribe((value) => {
353
+ if (value && value.hasOwnProperty(props[0])) {
354
+ let val = this.parent;
355
+ for (const prop of props) {
356
+ val = val[prop];
357
+ if (!val) {
358
+ break;
359
+ }
360
+ }
361
+ if (val === this.meta.disabled[p]) {
362
+ this.logicalDisabled = true;
363
+ this.clear();
364
+ }
365
+ else {
366
+ delete this.logicalDisabled;
367
+ }
368
+ }
369
+ });
370
+ }
371
+ }
372
+ }
373
+ if (this.meta.auto && this.meta.auto.search) {
374
+ const searchParams = this.meta.auto.search.params;
375
+ if (searchParams) {
376
+ for (const par of Object.keys(searchParams)) {
377
+ const props = searchParams[par].split('.');
378
+ const field = props[0];
379
+ const prop = props[1];
380
+ let parValue = this.parent[field];
381
+ if (parValue) {
382
+ if (prop) {
383
+ parValue = parValue[prop];
384
+ }
385
+ if (parValue) {
386
+ const params = {};
387
+ params[par] = parValue;
388
+ this.searchAutoSuggestions(params);
389
+ }
390
+ }
391
+ this.parentChangeSubject.subscribe((value) => {
392
+ if (value && value.hasOwnProperty(field)) {
393
+ if (value[field]) {
394
+ if (prop) {
395
+ value[field] = value[field][prop];
396
+ }
397
+ const params = {};
398
+ params[par] = value[field];
399
+ this.searchAutoSuggestions(params);
400
+ }
401
+ }
402
+ });
403
+ }
404
+ }
405
+ }
406
+ }
407
+ clearSearchResourceType() {
408
+ this.searchResourceType = {};
409
+ this.onSearchResourceTypeChanged();
410
+ }
411
+ onSearchResourceTypeChanged(resourceType) {
412
+ if (!resourceType || !resourceType.id) {
413
+ this.searchResourceType.resourceType = null;
414
+ this.searchResourceTypesScope = (this.metaReference || []).filter(rt => rt.hidden !== true).map(rt => rt.name).join(',');
415
+ }
416
+ else {
417
+ this.searchResourceType.resourceType = resourceType.id;
418
+ this.searchResourceTypesScope = resourceType.id;
419
+ }
420
+ this.buildPlaceholderLabel();
421
+ this.focus();
422
+ if (!this.model && !this.searchText) { // filter suggestions by type
423
+ this.filteredSuggestions = !resourceType ? (this.meta.suggestions || []) : (this.meta.suggestions || []).filter((s) => s.type === resourceType.id);
424
+ }
425
+ else { // regular search (return scoped results)
426
+ if (!this.model) {
427
+ this.search();
428
+ }
429
+ else if (this.searchResults && resourceType) {
430
+ this.searchResults = this.searchResults.filter((s) => s.type === resourceType.id);
431
+ }
432
+ }
433
+ delete this.searchError;
434
+ }
435
+ onSearchTextChanged(value) {
436
+ this.searchTextChanged.next(value);
437
+ }
438
+ search() {
439
+ this.searching = true;
440
+ // this.activeSuggestionIndex;
441
+ if (!this.searchText || this.searchText.length < 2) {
442
+ this.searching = false;
443
+ delete this.searchResults;
444
+ return;
445
+ }
446
+ const showSearchResults = (results) => {
447
+ this.searching = false;
448
+ delete this.searchError;
449
+ delete this.activeSuggestionIndex;
450
+ if (!results || !(results instanceof Array)) {
451
+ results = [];
452
+ }
453
+ if (this.meta.acceptNew && this.meta.acceptNew.type && this.meta.acceptNew.pattern) {
454
+ const regex = new RegExp(this.meta.acceptNew.pattern);
455
+ if (regex.test(this.searchText)) {
456
+ results.unshift({ id: null, label: this.searchText, type: this.meta.acceptNew.type });
457
+ }
458
+ }
459
+ this.searchResults = results.map((r) => {
460
+ return { id: r.id, label: r.label, type: r.type || r.resourceType || this.searchResourceType.name, externalLink: r.externalLink };
461
+ });
462
+ if (!/Vlt-dropdown--expanded/.test(this.dropdown.className)) {
463
+ this.showDropdown();
464
+ }
465
+ };
466
+ if (this.meta.search) {
467
+ const searchParams = this.meta.search.params || {};
468
+ let searchUrl = `/fields/${this.meta.name}/search`;
469
+ if (this.meta.search.url) {
470
+ searchUrl = this.meta.search.url.replace(/\${\s*([\w.]+)\s*}/g, (match, key) => {
471
+ if (searchParams.hasOwnProperty(key)) {
472
+ const props = searchParams[key].split('.');
473
+ const field = props[0];
474
+ const prop = props[1];
475
+ delete searchParams[key]; // if it is URL param, remove it as query param
476
+ let parValue = this.parent[field];
477
+ if (parValue) {
478
+ if (prop) {
479
+ parValue = parValue[prop];
480
+ }
481
+ if (parValue) {
482
+ return parValue;
483
+ }
484
+ }
485
+ }
486
+ return 'undefined';
487
+ });
488
+ }
489
+ for (const p of Object.keys(searchParams)) {
490
+ searchUrl += `${searchUrl.indexOf('?') === -1 ? '?' : '&'}${encodeURIComponent(p)}=${encodeURIComponent(searchParams[p])}`;
491
+ }
492
+ searchUrl += `${searchUrl.indexOf('?') === -1 ? '?' : '&'}q=${encodeURIComponent(this.searchText)}`;
493
+ this.searching = true;
494
+ this.resourceService.getByPath(searchUrl).subscribe((results) => {
495
+ showSearchResults(results);
496
+ }, (error) => {
497
+ delete this.searching;
498
+ this.searchResults = [];
499
+ this.searchError = error.error ? error.error.message || error.error : error.message || error;
500
+ if (!/Vlt-dropdown--expanded/.test(this.dropdown.className)) {
501
+ this.showDropdown();
502
+ }
503
+ });
504
+ }
505
+ else {
506
+ if (!this.vr) {
507
+ this.vr = this.metaResource.new({
508
+ integrationCode: this.integrationCode,
509
+ resourceType: null
510
+ });
511
+ }
512
+ this.vr.searchIntegration(this.searchText, this.searchResourceType.name || this.searchResourceTypesScope).subscribe((results) => {
513
+ showSearchResults(results);
514
+ }, (error) => {
515
+ this.searching = false;
516
+ this.searchResults = [];
517
+ this.searchError = error.error ? error.error.message || error.error : error.message || error;
518
+ if (!/Vlt-dropdown--expanded/.test(this.dropdown.className)) {
519
+ this.showDropdown();
520
+ }
521
+ });
522
+ }
523
+ }
524
+ onActivated(ev) {
525
+ // ev.preventDefault();
526
+ // ev.stopPropagation();
527
+ this.input = ev.srcElement;
528
+ if (!this.dropdown) {
529
+ // this.dropdown = ev.srcElement.parentNode.parentNode;
530
+ this.dropdown = this.elementRef.nativeElement.querySelector('.dropdown-wrapper');
531
+ }
532
+ this.showDropdown();
533
+ }
534
+ onBlur(ev) {
535
+ let internalControl = false;
536
+ if (ev.relatedTarget) {
537
+ if (!this.elementRef.nativeElement.contains(ev.relatedTarget)) {
538
+ this.dismissDropdown();
539
+ }
540
+ else {
541
+ internalControl = true;
542
+ }
543
+ }
544
+ if (this.keyListenerActive && !internalControl) {
545
+ this.input.removeEventListener('keydown', this.keydown);
546
+ setTimeout(() => {
547
+ if (!this.keyListenerActive) {
548
+ document.removeEventListener('click', this.clickout);
549
+ }
550
+ }, 400);
551
+ delete this.keyListenerActive;
552
+ }
553
+ }
554
+ removeSelection(ev) {
555
+ if (ev) {
556
+ ev.preventDefault();
557
+ ev.stopPropagation();
558
+ }
559
+ if (this.model && !this.suggestions.find((s) => (s.id === this.model.id && s.type === this.model.type))) {
560
+ this.smartSuggestions.push({
561
+ id: this.model.id,
562
+ label: this.model.label,
563
+ type: this.model.type,
564
+ smart: true
565
+ });
566
+ }
567
+ this.metaTracker.emit(this.buildTrackEvent('REMOVE'));
568
+ this.clear();
569
+ }
570
+ onSuggestionSelect(ev, suggestion) {
571
+ if (!suggestion) {
572
+ return;
573
+ }
574
+ ev.preventDefault();
575
+ ev.stopPropagation();
576
+ this.focus();
577
+ this.metaTracker.emit(this.buildTrackEvent('SELECT'));
578
+ if (this.multiple) {
579
+ if (!this.model) {
580
+ this.model = [];
581
+ }
582
+ let existingEntry;
583
+ for (const entry of this.model) {
584
+ if (suggestion.id && (entry.id === suggestion.id)) {
585
+ existingEntry = entry;
586
+ break;
587
+ }
588
+ else if (suggestion.label === entry.label) { // create new (google emails)
589
+ existingEntry = entry;
590
+ break;
591
+ }
592
+ }
593
+ if (!existingEntry) {
594
+ this.model.push(suggestion);
595
+ }
596
+ this.onModelChange(this.model);
597
+ delete this.searchText;
598
+ this.searchTextChanged.next(this.searchText);
599
+ }
600
+ else {
601
+ this.model = suggestion;
602
+ this.externalLink = suggestion.externalLink;
603
+ this.onModelChange(suggestion);
604
+ this.searchText = suggestion.label;
605
+ this.activeSuggestionIndex = (this.searchResults || this.suggestions).indexOf(suggestion);
606
+ }
607
+ this.dismissDropdown();
608
+ // if (this.isPolymorphic) {
609
+ // this.searchResourceType = this.metaReference.find((rt)=> {
610
+ // return rt.name === suggestion.type;
611
+ // });
612
+ // }
613
+ }
614
+ showDropdown() {
615
+ this.dropdownVisible = true;
616
+ this.dropdown.classList.add('Vlt-dropdown--expanded');
617
+ if (!this.keyListenerActive) {
618
+ this.input.addEventListener('keydown', this.keydown);
619
+ setTimeout(() => {
620
+ document.addEventListener('click', this.clickout);
621
+ }, 200);
622
+ this.keyListenerActive = true;
623
+ }
624
+ if (typeof (this.activeSuggestionIndex) === 'undefined') {
625
+ if (this.model && (this.searchResults || this.suggestions)) {
626
+ for (let suggestionIndex = 0; suggestionIndex < (this.searchResults || this.suggestions).length; suggestionIndex++) {
627
+ const item = (this.searchResults || this.suggestions)[suggestionIndex];
628
+ if (this.model.id === item.id && this.model.type === item.type) {
629
+ this.activeSuggestionIndex = suggestionIndex;
630
+ break;
631
+ }
632
+ }
633
+ }
634
+ }
635
+ this.ensureDropdownIsVisible();
636
+ }
637
+ dismissDropdown(event) {
638
+ this.dropdownVisible = false;
639
+ if (event) {
640
+ this.focus();
641
+ }
642
+ if (this.dropdown) {
643
+ this.dropdown.classList.remove('Vlt-dropdown--expanded');
644
+ }
645
+ }
646
+ clear() {
647
+ this.prevModel = this.model;
648
+ delete this.searchText;
649
+ delete this.searchResults;
650
+ delete this.model;
651
+ delete this.activeSuggestionIndex;
652
+ this.onModelChange(this.model);
653
+ this.onSearchTextChanged(this.searchText);
654
+ this.focus();
655
+ }
656
+ revert() {
657
+ this.model = this.prevModel;
658
+ delete this.prevModel;
659
+ this.onModelChange(this.model);
660
+ this.focus();
661
+ }
662
+ remove(ev, item) {
663
+ ev.preventDefault();
664
+ ev.stopPropagation();
665
+ const optionIndex = this.model.indexOf(item);
666
+ if (optionIndex !== -1) {
667
+ this.model.splice(optionIndex, 1);
668
+ if (!this.model.length) {
669
+ delete this.model;
670
+ delete this.value;
671
+ }
672
+ this.onModelChange(this.model);
673
+ }
674
+ }
675
+ openResource(model) {
676
+ this.keyListenerActive = true; // suppress dropdown in this case
677
+ setTimeout(() => {
678
+ this.dismissDropdown();
679
+ });
680
+ const refDialogComponent = this.viewContainerRef.createComponent(MetaRefDialog);
681
+ this.metaTracker.emit(this.buildTrackEvent(model ? 'EDIT' : 'NEW'));
682
+ let theme = this.elementRef.nativeElement.dataset.theme;
683
+ if (!theme || theme === 'inherit') {
684
+ let parentComponent = this.elementRef.nativeElement.closest('vgip-meta-layout');
685
+ if (parentComponent) {
686
+ theme = parentComponent.dataset.theme;
687
+ }
688
+ if (!theme || theme === 'inherit') {
689
+ parentComponent = this.elementRef.nativeElement.closest('vgip-meta-resource');
690
+ if (parentComponent) {
691
+ theme = parentComponent.dataset.theme;
692
+ }
693
+ }
694
+ }
695
+ this.referenceService.openDialog(refDialogComponent, this.metaResource, this.integrationCode, (this.metaReference instanceof Array) ? this.metaReference.filter(rt => rt.hidden !== true) : this.metaReference, model, null, this.searchResourceType.resourceType, theme).subscribe((result) => {
696
+ if (result) {
697
+ this.parent[this.meta.name] = result;
698
+ this.onChange.emit(result);
699
+ const existingSuggestion = (this.meta.suggestions || []).find((s) => (s.id === result.id && s.type === result.type));
700
+ if (existingSuggestion) {
701
+ existingSuggestion.label = result.label;
702
+ }
703
+ else {
704
+ if (!this.meta.suggestions) {
705
+ this.meta.suggestions = [];
706
+ }
707
+ this.meta.suggestions.unshift(result);
708
+ }
709
+ this.metaTracker.emit(this.buildTrackEvent(model ? 'UPDATE' : 'CREATE', result.type || result.resourceType));
710
+ }
711
+ else {
712
+ this.metaTracker.emit(this.buildTrackEvent(model ? 'CANCEL_EDIT' : 'CANCEL_UPDATE'));
713
+ }
714
+ });
715
+ }
716
+ ensureDropdownIsVisible() {
717
+ setTimeout(() => {
718
+ const holder = this.dropdown.closest('.Vlt-card__content');
719
+ if (holder) {
720
+ const el = this.elementRef.nativeElement.querySelector('.Vlt-dropdown__panel');
721
+ const elRect = el.getBoundingClientRect();
722
+ const holderRect = holder.getBoundingClientRect();
723
+ if (holderRect.top + holderRect.height < elRect.top + elRect.height) {
724
+ el.scrollIntoView({ block: 'end' });
725
+ }
726
+ }
727
+ }, 400);
728
+ }
729
+ ensureDropdownOptionIsVisible() {
730
+ if (!this.dropdownScrollContainer) {
731
+ this.dropdownScrollContainer = this.dropdown.querySelector('.Vlt-dropdown__scroll');
732
+ }
733
+ if (this.dropdownScrollContainer && typeof (this.activeSuggestionIndex) === 'number') {
734
+ const scrollTop = 44 * this.activeSuggestionIndex;
735
+ const scrollBottom = 44 * (this.activeSuggestionIndex - 7);
736
+ if (scrollTop < this.dropdownScrollContainer.scrollTop) {
737
+ this.dropdownScrollContainer.scrollTop = scrollTop;
738
+ }
739
+ else if (scrollBottom > this.dropdownScrollContainer.scrollTop) {
740
+ this.dropdownScrollContainer.scrollTop = scrollBottom;
741
+ }
742
+ }
743
+ }
744
+ buildTrackEvent(action, value) {
745
+ const e = {
746
+ integration: this.integrationCode,
747
+ resource: this.model ? (this.model.type || this.model.resourceType) : this.searchResourceType.resourceType,
748
+ field: this.meta.name,
749
+ action
750
+ };
751
+ if (this.meta.$isContactable) {
752
+ e.isContactable = true;
753
+ }
754
+ if (typeof (value) !== 'undefined') {
755
+ e.value = value;
756
+ }
757
+ return e;
758
+ }
759
+ buildPlaceholderLabel() {
760
+ this.placeHolderLabel = this.meta.label;
761
+ if (this.multiple && !this.isPolymorphic) {
762
+ this.placeHolderLabel = '+Add ';
763
+ }
764
+ else {
765
+ this.placeHolderLabel = (this.isSearchable && (this.multiple || !this.isPolymorphic)) ? 'Search ' : '';
766
+ }
767
+ this.placeHolderLabel += this.searchResourceType.resourceType ? this.searchResourceType.resourceType : this.searchResourceTypesScope;
768
+ }
769
+ buildExternalLink() {
770
+ if (this.model) {
771
+ if (this.model.externalLink) {
772
+ this.externalLink = this.model.externalLink;
773
+ }
774
+ else if (this.metaContext.profiles[this.integrationCode.toUpperCase()]) {
775
+ delete this.externalLink;
776
+ this.metaMsgService.sendMessage(this.integrationCode.toUpperCase(), {
777
+ action: 'buildExternalLink',
778
+ integrationCode: this.integrationCode,
779
+ ref: this.model,
780
+ profile: this.metaContext.profiles[this.integrationCode.toUpperCase()]
781
+ }, (response) => {
782
+ if (!response.error) {
783
+ this.externalLink = response.externalLink;
784
+ }
785
+ else {
786
+ console.warn('No external link support for', this.integrationCode, this.model.resourceType || this.model.type);
787
+ }
788
+ });
789
+ }
790
+ }
791
+ else {
792
+ delete this.externalLink;
793
+ }
794
+ }
795
+ searchAutoSuggestions(params) {
796
+ let searchUrl = `/suggestions/${this.meta.name}/search`;
797
+ if (this.meta.auto && this.meta.auto.search) {
798
+ if (this.meta.auto.search.url) {
799
+ searchUrl = this.meta.auto.search.url.replace(/\${\s*([\w.]+)\s*}/g, (match, key) => {
800
+ if (params.hasOwnProperty(key)) {
801
+ const val = params[key];
802
+ delete params[key];
803
+ return val;
804
+ }
805
+ return '';
806
+ });
807
+ }
808
+ for (const p of Object.keys(params)) {
809
+ searchUrl += `${searchUrl.indexOf('?') === -1 ? '?' : '&'}${encodeURIComponent(p)}=${encodeURIComponent(params[p])}`;
810
+ }
811
+ this.searching = true;
812
+ this.resourceService.getByPath(searchUrl).subscribe((result) => {
813
+ delete this.searching;
814
+ if (result) {
815
+ let suggestions;
816
+ suggestions = result;
817
+ if (this.meta.auto.search.extract) {
818
+ suggestions = result[this.meta.auto.search.extract];
819
+ }
820
+ if (suggestions instanceof Array !== true) {
821
+ suggestions = [suggestions];
822
+ }
823
+ const asyncSuggestions = [];
824
+ suggestions.forEach((s) => {
825
+ if (s && s.id && s.type) { // TOOD check the type is acceptable
826
+ asyncSuggestions.push({
827
+ id: s.id,
828
+ label: s.label || `${s.type}#${s.id}`,
829
+ type: s.type
830
+ });
831
+ }
832
+ });
833
+ if (asyncSuggestions.length) {
834
+ if (asyncSuggestions.length === 1) {
835
+ this.parent[this.meta.name] = asyncSuggestions[0];
836
+ }
837
+ else {
838
+ delete this.asyncSuggestions;
839
+ }
840
+ }
841
+ this.asyncSuggestions = asyncSuggestions;
842
+ }
843
+ }, () => {
844
+ delete this.searching;
845
+ });
846
+ }
847
+ }
848
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: FieldReference, deps: [{ token: MetaReferenceService }, { token: MetaResourceService }, { token: MetaMsgService }, { token: MetaContextService }, { token: MetaTrackerService }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component }); }
849
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.11", type: FieldReference, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<div class='vgip-meta-field-preview' *ngIf='preview && model && (!multiple || (multiple && model.length))'>\n <div class='vgip-meta-field-label' [title]='meta.label || meta.name'>{{meta.label || meta.name}}</div>\n <div *ngIf='!multiple' class='vgip-meta-field-value __gu'>\n <svg class=\"Vlt-icon Vlt-icon--smaller\" style='margin-top: -3px;'>\n <use attr.xlink:href=\"volta/volta-brand-icons.svg#{{integrationIcon}}\" />\n </svg>\n {{model.label || model.id}} <span class='Vlt-grey'>({{model.type}})</span>\n </div>\n <div *ngIf='multiple' class='vgip-meta-field-value __gu'>\n <span *ngFor='let m of (model || [])' class='Vlt-badge Vlt-badge--app'>\n {{m.label || m.id || m}} <span class='Vlt-grey-dark' *ngIf='isPolymorphic'>({{m.type}})</span>\n </span>\n </div>\n <a [href]='externalLink || model.externalLink' target='_blank' rel='noopener'\n *ngIf='externalLink && (model && !multiple)' class=\"Vlt-composite__append--icon preview\" aria-label='Open external'>\n <div class=\"Vlt-composite__icon\">\n <svg>\n <use xlink:href=\"volta/volta-icons.svg#Vlt-icon-open\" />\n </svg>\n </div>\n </a>\n</div>\n<div *ngIf='!preview' class=\"meta-field-reference Vlt-form__element Vlt-form__element--big\"\n [ngClass]=\"{ 'Vlt-form__element--error': (searchError && keyListenerActive) || (f.invalid && ((f | metaModel)._parent.submitted || (ft | metaModel ).touched)), 'multiple': multiple, 'has-value': model, active: keyListenerActive }\">\n <div *ngIf='multiple' class='items-container' [ngClass]='{ creatable: isCreatable }'>\n <div *ngIf='model' class='badges-container keep-focus' (click)='focus()' style='width: 100%;'> <!-- eslint-disable-line -->\n <div *ngFor='let item of model' class=\"Vlt-badge Vlt-badge--app Vlt-badge--large keep-focus\" [ngClass]=\"{ grid: (item.label || item.id || '').length > 56}\">\n <span class='Vlt-truncate'>{{item.label || item.id || item }} <span *ngIf='isPolymorphic' class='Vlt-grey-dark' style='font-weight: normal;'>({{item.type}})</span></span>\n <button class=\"Vlt-badge__dismiss keep-focus\" (click)='remove($event, item)' style='position: absolute; right: 12px; top: 8px;' aria-label='Remove'></button>\n </div>\n </div>\n </div>\n <div class=\"Vlt-composite\">\n <div class='dropdown-wrapper Vlt-dropdown' style='width: 100%; position: absolute; top: 48px;'>\n <div class=\"Vlt-dropdown__panel\">\n <div *ngIf='searchError'>\n <div class=\"Vlt-callout Vlt-callout--critical keep-focus\">\n <i></i>\n <div class=\"Vlt-callout__content\">{{searchError}}</div>\n </div>\n </div>\n <div *ngIf='!searchError && (suggestions.length || searchResults)' [ngClass]=\"{ suggestions: !searchResults}\"\n class=\"Vlt-dropdown__panel__content Vlt-dropdown__panel__content--scroll-area\" style='padding: 0;'>\n <div class=\"Vlt-dropdown__block\"></div>\n <div *ngIf='!searchResults' class=\"Vlt-dropdown__scroll\">\n <a href='#' [ngClass]=\"{ 'Vlt-dropdown__link--selected': activeSuggestionIndex === i, smart: suggestion.smart }\" (click)='onSuggestionSelect($event, suggestion)' *ngFor='let suggestion of suggestions; let i = index' class=\"Vlt-dropdown__link has-type\">\n <svg class='Vlt-icon Vlt-icon--small'><use attr.xlink:href=\"volta/volta-brand-icons.svg#{{integrationIcon}}\"/></svg>\n <div class='__gu' [title]='suggestion.label'>{{ suggestion.label }}</div>\n <small class='Vlt-grey-dark' style='text-transform: capitalize;'>{{suggestion.type}}</small>\n </a>\n </div>\n <div *ngIf='searchResults' class=\"Vlt-dropdown__scroll\">\n <div *ngIf='!searchResults.length' class='Vlt-dropdown__block'> No records matching '<b style='pointer-events: none;'>{{searchText}}</b>' were found.</div>\n <a href='#' [ngClass]=\"{ 'Vlt-dropdown__link--selected': activeSuggestionIndex === i }\" (click)='onSuggestionSelect($event, suggestion)' *ngFor='let suggestion of searchResults; let i = index' class=\"Vlt-dropdown__link has-type\">\n <svg class='Vlt-icon Vlt-icon--small'><use attr.xlink:href=\"volta/volta-brand-icons.svg#{{integrationIcon}}\"/></svg>\n <div class='__gu' [title]='suggestion.label'>{{ suggestion.label }}</div>\n <small class='Vlt-grey-dark' style='text-transform: capitalize;'>{{suggestion.type}}</small>\n </a>\n </div>\n <!-- <div *ngIf='searchResults' class=\"Vlt-dropdown__block\" style='text-align: right; padding-top: 0;'>\n <small>\n {{ searchResults ? searchResults.length+' results' : 'Suggestions' }} <span style='font-style: italic; font-weight: normal;' *ngIf='searchResults'>~{{ model ? 'last search' : searchText}}</span>\n </small>\n </div> -->\n <div class=\"Vlt-dropdown__block\"></div>\n </div>\n </div>\n </div>\n <div class=\"Vlt-composite__prepend\"\n *ngIf='isPolymorphic && showTypes && (multiple || !model || (dropdownVisible && ((suggestions || searchResults || []).length || searchResourceType.resourceType)))'>\n <div class=\"search-scope\" [ngClass]=\"{ 'has-value': searchResourceType.resourceType }\">\n <vgip-meta-field class='shown' [meta]='searchResourceTypeMeta' [parent]='searchResourceType'\n (onChange)='onSearchResourceTypeChanged($event)' (onLeave)='onBlur($event)'\n [integrationCode]='integrationCode' theme='inherit'></vgip-meta-field>\n <svg class='Vlt-icon Vlt-grey Vlt-icon--smaller visible-mobile mobile-icon'\n style='position: absolute; top: 15px; left: 14px; pointer-events: none;'>\n <use xlink:href=\"volta/volta-icons.svg#Vlt-icon-menu\" />\n </svg>\n </div>\n </div>\n <div *ngIf='!(isPolymorphic && showTypes && (multiple || !model || dropdownVisible))'>\n <!-- required by css -->\n </div>\n <div class=\"Vlt-composite__wrapper Vlt-input\" style='overflow: hidden;'\n [ngClass]=\"{ 'has-append-button': hasAppendButton && !disabled, 'vgip-disable': disabled }\">\n <label class='wrapper'>\n <div class=\"Vlt-composite__prepend Vlt-composite__prepend--icon\" style='top: 0; padding-top: 15px;'>\n <div class=\"Vlt-composite__icon\">\n <svg *ngIf='isSearchable && (!model || multiple)' class='Vlt-grey'>\n <use attr.xlink:href=\"volta/volta-icons.svg#Vlt-icon-{{ multiple ? 'stack' : 'search'}}\" />\n </svg>\n <svg *ngIf='!isSearchable || (model && !multiple)'\n [ngStyle]=\"{fill: integrationIcon === 'Brand-icon-vonage' ? 'var(--vgip-meta-input-color)' : ''}\">\n <use attr.xlink:href=\"volta/volta-brand-icons.svg#{{integrationIcon}}\" />\n </svg>\n </div>\n <div *ngIf='suggestions.length' class=\"Vlt-badge Vlt-badge--small Vlt-badge--purple\"\n style='padding: 0px 4px; position: absolute; top: 26px; left: 4px; pointer-events: none; min-width: 14px;'>\n {{suggestions.length}}</div>\n </div>\n <input class='model' type='hidden' [required]='validations.required' [(ngModel)]='model' #f='ngModel' [name]='name' />\n <input class='main' [readonly]='!isSearchable || (model && !multiple)' [ngModel]='searchText' #ft='ngModel' (ngModelChange)='onSearchTextChanged($event)' [ngModelOptions]=\"{standalone: true}\" type=\"text\" placeholder=\"{{ placeHolderLabel || ' ' }}\" [ngClass]='{ ext: externalLink }' (click)='onActivated($event)' (focus)='onActivated($event)' (blur)='onBlur($event)' [disabled]='disabled' [title]=\"model ? model.label : ''\"/>\n <label class='Vlt-truncate hidden-mobile' style='padding-left: 25px; padding-right: 42px;'>{{ (multiple && isPolymorphic) ? '+Add ' : ((model || !isPolymorphic) ? meta.label : ( meta.searchLabel || 'Search')) }}<span *ngIf='validations.required' class='Vlt-red'>*</span>&nbsp;<span style='color: var(--vgip-meta-input-color); text-transform: capitalize;' *ngIf='model'>({{model.type || model.resourceType || model.length}})</span></label> <!-- eslint-disable-line @angular-eslint/template/label-has-associated-control-->\n <label class='Vlt-truncate hidden-desktop' style='padding-left: 25px; padding-right: 42px;'>{{meta.label || meta.name}}<span *ngIf='validations.required' class='Vlt-red'>*</span>&nbsp;<span style='color: var(--vgip-meta-input-color); text-transform: capitalize;' *ngIf='model'>({{model.type || model.resourceType || model.length}})</span></label> <!-- eslint-disable-line @angular-eslint/template/label-has-associated-control-->\n </label>\n <div *ngIf='searching' class='search-progress'>\n <div class=\"container\">\n <div class=\"bar Vlt-bg-purple\"></div>\n </div>\n </div>\n <div class='Vlt-composite__append right-actions'>\n <!-- <div *ngIf='prevModel && !model' class=\"Vlt-composite__append--icon\" (click)='revert()'>\n <div class=\"Vlt-composite__icon\">\n <svg><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-reply\"/></svg>\n </div>\n </div> -->\n <a href='#' *ngIf='model && !multiple' class=\"Vlt-composite__append--icon\" (click)='removeSelection($event)'>\n <div class=\"Vlt-composite__icon\">\n <svg>\n <use xlink:href=\"volta/volta-icons.svg#Vlt-icon-cross\" />\n </svg>\n </div>\n </a>\n <a [href]='externalLink || model.externalLink' target='_blank' rel='noopener' *ngIf='externalLink && (model && !multiple)' class=\"Vlt-composite__append--icon\" aria-label='Open external'>\n <div class=\"Vlt-composite__icon\">\n <svg>\n <use xlink:href=\"volta/volta-icons.svg#Vlt-icon-open\" />\n </svg>\n </div>\n </a>\n </div>\n </div>\n <!-- <span *ngIf='hasCreatables'>\n <button type='button' *ngIf='!model || multiple' (click)='openResource()' class=\"Vlt-btn Vlt-btn--secondary Vlt-btn--icon Vlt-btn--large\" style='margin-left: 12px;'>\n <svg><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-plus\"/></svg>\n </button>\n <button type='button' *ngIf='model && !multiple' (click)='openResource(model)' class=\"Vlt-btn Vlt-btn--primary Vlt-btn--icon Vlt-btn--large\" style='margin-left: 12px;'>\n <svg><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-edit\"/></svg>\n </button>\n </span> -->\n <div *ngIf='hasAppendButton && !disabled' class=\"Vlt-composite__append\">\n <button (focus)='onActivated($event)' (blur)='onBlur($event)' type='button' *ngIf='!model || multiple'\n (click)='openResource()' class=\"Vlt-btn Vlt-btn--white Vlt-btn--icon\" aria-label='Add new'>\n <svg>\n <use xlink:href=\"volta/volta-icons.svg#Vlt-icon-plus\" />\n </svg>\n </button>\n <button (focus)='onActivated($event)' (blur)='onBlur($event)' type='button' *ngIf='model && !multiple'\n (click)='openResource(model)' class=\"Vlt-btn Vlt-btn--white Vlt-btn--icon\" aria-label='Edit'>\n <svg>\n <use xlink:href=\"volta/volta-icons.svg#Vlt-icon-edit\" />\n </svg>\n </button>\n </div>\n </div>\n <small *ngIf='f.invalid && ((f | metaModel)._parent.submitted || ((ft | metaModel).touched && keyListenerActive))'\n class=\"Vlt-form__element__error\">\n <span *ngIf=\"f.errors.required\">Required</span>\n <span *ngIf=\"f.errors.pattern\">Should match '{{validations.pattern}}' pattern</span>\n <span *ngIf=\"f.errors.custom\">{{f.errors.custom}}&nbsp;</span>\n </small>\n <small *ngIf='meta.helpText || meta.hint' class=\"Vlt-form__element__hint\">{{meta.helpText || meta.hint}}</small>\n</div>", styles: [".Vlt-form__element--big .Vlt-input input:placeholder-shown:not(:focus)~label.Vlt-truncate{font-size:1.6rem;margin-top:-.8rem;top:50%}.Vlt-form__element--big ::ng-deep .search-scope vgip-meta-field .Vlt-input input.main.standalone{border-right:0;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.Vlt-form__element--big:hover .items-container,.Vlt-form__element--big:hover .main,.Vlt-form__element--big:hover .Vlt-composite__append button,.Vlt-form__element--big:hover ::ng-deep .search-scope vgip-meta-field .Vlt-input input.main.standalone,.Vlt-form__element--big.active .items-container,.Vlt-form__element--big.active .main,.Vlt-form__element--big.active .Vlt-composite__append button,.Vlt-form__element--big.active ::ng-deep .search-scope vgip-meta-field .Vlt-input input.main.standalone{border-color:var(--vgip-meta-input-active-border-color)}.Vlt-form__element--big.Vlt-form__element--error .items-container,.Vlt-form__element--big.Vlt-form__element--error .main,.Vlt-form__element--big.Vlt-form__element--error .Vlt-composite__append button,.Vlt-form__element--big.Vlt-form__element--error ::ng-deep .search-scope vgip-meta-field .Vlt-input input.main.standalone{border-color:#f25a6b}.Vlt-form__element--big.multiple .Vlt-composite.Vlt-dropdown{margin-top:3px}.Vlt-form__element--big.multiple:hover:not(.Vlt-form__element--error) .items-container,.Vlt-form__element--big.multiple:hover:not(.Vlt-form__element--error) .main,.Vlt-form__element--big.multiple:hover:not(.Vlt-form__element--error) .Vlt-composite__append button,.Vlt-form__element--big.multiple:hover:not(.Vlt-form__element--error) ::ng-deep .search-scope vgip-meta-field .Vlt-input input.main.standalone,.Vlt-form__element--big.multiple.active:not(.Vlt-form__element--error) .items-container,.Vlt-form__element--big.multiple.active:not(.Vlt-form__element--error) .main,.Vlt-form__element--big.multiple.active:not(.Vlt-form__element--error) .Vlt-composite__append button,.Vlt-form__element--big.multiple.active:not(.Vlt-form__element--error) ::ng-deep .search-scope vgip-meta-field .Vlt-input input.main.standalone{border-color:var(--vgip-meta-input-active-border-color)}.Vlt-form__element--big.multiple .items-container{background-color:var(--vgip-meta-input-bg-color);border:1px solid var(--vgip-meta-input-border-color);border-bottom:0;border-top-left-radius:6px;border-top-right-radius:6px}.Vlt-form__element--big.multiple .items-container .badges-container{overflow:auto;padding:6px 4px 3px 6px}.Vlt-form__element--big.multiple .items-container .badges-container .Vlt-badge{margin-bottom:3px;margin-left:0;margin-right:3px;overflow:hidden;max-width:100%;position:relative;padding-right:30px}.Vlt-form__element--big.multiple .items-container .badges-container .Vlt-badge.grid{display:grid}.Vlt-form__element--big.multiple:not(.has-value) .items-container{border:0}.Vlt-form__element--big.multiple.has-value .main,.Vlt-form__element--big.multiple.has-value .Vlt-composite__append button,.Vlt-form__element--big.multiple.has-value ::ng-deep .search-scope vgip-meta-field .Vlt-input input.main.standalone{border-top-left-radius:0;border-top-right-radius:0;height:48px}.Vlt-form__element--big.multiple.has-value .main:not(.Vlt-btn--icon),.Vlt-form__element--big.multiple.has-value .Vlt-composite__append button:not(.Vlt-btn--icon),.Vlt-form__element--big.multiple.has-value ::ng-deep .search-scope vgip-meta-field .Vlt-input input.main.standalone:not(.Vlt-btn--icon){border-top:0}.Vlt-form__element--big.multiple.has-value .Vlt-composite__prepend ::ng-deep .search-scope vgip-meta-field .Vlt-input input.main.standalone{border-top-right-radius:6px}.Vlt-form__element--big.multiple.has-value .Vlt-composite__append button{border-top-left-radius:6px;border-top:0}.Vlt-composite__prepend{z-index:initial}.Vlt-composite__prepend--icon{top:0;padding-top:15px;left:3px}.Vlt-input.has-append-button .Vlt-composite__append.right-actions{right:0}.Vlt-input.has-append-button .Vlt-composite__append.right-actions .Vlt-composite__append--icon:last-child{width:36px}.Vlt-composite__append.right-actions{position:absolute;top:5px;right:5px;cursor:pointer}.Vlt-composite__append.right-actions .Vlt-composite__append--icon{outline:none;position:initial;display:inline-block}.Vlt-composite__append.right-actions .Vlt-composite__append--icon svg{height:14px;width:14px}.Vlt-composite__append.right-actions .Vlt-composite__append--icon:hover svg,.Vlt-composite__append.right-actions .Vlt-composite__append--icon:focus svg{fill:var(--vgip-meta-input-accent-color)}.vgip-disable .Vlt-composite__append{cursor:not-allowed;pointer-events:none}.Vlt-composite__append--icon.preview{bottom:initial;padding:0 2px}.Vlt-composite__append button{height:48px;padding-right:16px;background:var(--vgip-meta-input-bg-color);border-color:var(--vgip-meta-input-border-color);padding-left:16px;border-left:0}.Vlt-composite__append button:hover{background:var(--vgip-meta-input-action-hover-bg-color)}.Vlt-composite__append button svg{margin:-2px 0 0;fill:var(--vgip-meta-input-accent-color)}.Vlt-input input{padding-left:38px;text-overflow:ellipsis;padding-right:36px}.Vlt-input input.ext{padding-right:72px}.Vlt-composite__wrapper.has-append-button input.main{border-top-right-radius:0;border-bottom-right-radius:0;border-right:0}.Vlt-input input{background:var(--vgip-meta-input-bg-color);border-color:var(--vgip-meta-input-border-color);font-weight:700}.Vlt-dropdown__panel{max-width:100%;width:100%;min-width:280px}.Vlt-dropdown__panel .Vlt-dropdown__link.smart{font-weight:700;background:var(--vgip-meta-dropdown-bg-color)}.Vlt-dropdown__panel .Vlt-dropdown__link.smart.hidden{display:none}.Vlt-dropdown__panel .Vlt-dropdown__link.bold:after{background-color:#e1e2e6;content:\"\";height:1px;left:0;position:absolute;right:0;bottom:0}.Vlt-dropdown__panel .Vlt-dropdown__link--selected{background:rgba(44,45,48,.05)}.Vlt-dropdown__panel .Vlt-dropdown__link>div{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.Vlt-dropdown__panel .Vlt-dropdown__link>svg{margin-right:8px}.vgip-meta-field-preview .Vlt-badge{margin:1px 3px 1px 0;overflow:hidden;max-width:100%}:host .search-scope{width:130px}:host .search-scope ::ng-deep .Vlt-form__element.has-value .Vlt-select:after{display:none}:host .search-scope ::ng-deep .Vlt-form__element .right-actions{right:12px}:host .search-scope ::ng-deep .Vlt-form__element label.Vlt-truncate{padding-right:48px}:host .search-scope .mobile-icon{display:none}@media only screen and (max-width: 575px){:host .search-scope{width:60px}:host .search-scope:not(.has-value) .mobile-icon{display:block}:host .search-scope.has-value .mobile-label{display:block}:host .search-scope ::ng-deep .Vlt-form__element.Vlt-form__element--big .Vlt-composite__append{display:none}:host .search-scope ::ng-deep .Vlt-form__element.Vlt-form__element--big .Vlt-select:after{margin-right:-7px}:host .search-scope ::ng-deep .Vlt-form__element.Vlt-form__element--big label.Vlt-truncate{visibility:hidden}}:host .search-scope ::ng-deep vgip-meta-field .Vlt-input input.main.standalone{padding-right:initial;background:var(--vgip-meta-input-accent-bg-color);border-color:var(--vgip-meta-input-border-color)}:host .search-scope ::ng-deep vgip-meta-field .Vlt-form__element{padding:0}:host .search-scope ::ng-deep vgip-meta-field .Vlt-form__element .Vlt-dropdown__panel{width:initial}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: MetaField, selector: "vgip-meta-field", inputs: ["meta", "parent", "integrationCode", "resourceType", "index", "scope", "preview", "theme"], outputs: ["onChange", "onLeave"] }, { kind: "pipe", type: MetaModelPipe, name: "metaModel" }], viewProviders: [{ provide: ControlContainer, useExisting: NgForm }] }); }
850
+ }
851
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: FieldReference, decorators: [{
852
+ type: Component,
853
+ args: [{ viewProviders: [{ provide: ControlContainer, useExisting: NgForm }], template: "<div class='vgip-meta-field-preview' *ngIf='preview && model && (!multiple || (multiple && model.length))'>\n <div class='vgip-meta-field-label' [title]='meta.label || meta.name'>{{meta.label || meta.name}}</div>\n <div *ngIf='!multiple' class='vgip-meta-field-value __gu'>\n <svg class=\"Vlt-icon Vlt-icon--smaller\" style='margin-top: -3px;'>\n <use attr.xlink:href=\"volta/volta-brand-icons.svg#{{integrationIcon}}\" />\n </svg>\n {{model.label || model.id}} <span class='Vlt-grey'>({{model.type}})</span>\n </div>\n <div *ngIf='multiple' class='vgip-meta-field-value __gu'>\n <span *ngFor='let m of (model || [])' class='Vlt-badge Vlt-badge--app'>\n {{m.label || m.id || m}} <span class='Vlt-grey-dark' *ngIf='isPolymorphic'>({{m.type}})</span>\n </span>\n </div>\n <a [href]='externalLink || model.externalLink' target='_blank' rel='noopener'\n *ngIf='externalLink && (model && !multiple)' class=\"Vlt-composite__append--icon preview\" aria-label='Open external'>\n <div class=\"Vlt-composite__icon\">\n <svg>\n <use xlink:href=\"volta/volta-icons.svg#Vlt-icon-open\" />\n </svg>\n </div>\n </a>\n</div>\n<div *ngIf='!preview' class=\"meta-field-reference Vlt-form__element Vlt-form__element--big\"\n [ngClass]=\"{ 'Vlt-form__element--error': (searchError && keyListenerActive) || (f.invalid && ((f | metaModel)._parent.submitted || (ft | metaModel ).touched)), 'multiple': multiple, 'has-value': model, active: keyListenerActive }\">\n <div *ngIf='multiple' class='items-container' [ngClass]='{ creatable: isCreatable }'>\n <div *ngIf='model' class='badges-container keep-focus' (click)='focus()' style='width: 100%;'> <!-- eslint-disable-line -->\n <div *ngFor='let item of model' class=\"Vlt-badge Vlt-badge--app Vlt-badge--large keep-focus\" [ngClass]=\"{ grid: (item.label || item.id || '').length > 56}\">\n <span class='Vlt-truncate'>{{item.label || item.id || item }} <span *ngIf='isPolymorphic' class='Vlt-grey-dark' style='font-weight: normal;'>({{item.type}})</span></span>\n <button class=\"Vlt-badge__dismiss keep-focus\" (click)='remove($event, item)' style='position: absolute; right: 12px; top: 8px;' aria-label='Remove'></button>\n </div>\n </div>\n </div>\n <div class=\"Vlt-composite\">\n <div class='dropdown-wrapper Vlt-dropdown' style='width: 100%; position: absolute; top: 48px;'>\n <div class=\"Vlt-dropdown__panel\">\n <div *ngIf='searchError'>\n <div class=\"Vlt-callout Vlt-callout--critical keep-focus\">\n <i></i>\n <div class=\"Vlt-callout__content\">{{searchError}}</div>\n </div>\n </div>\n <div *ngIf='!searchError && (suggestions.length || searchResults)' [ngClass]=\"{ suggestions: !searchResults}\"\n class=\"Vlt-dropdown__panel__content Vlt-dropdown__panel__content--scroll-area\" style='padding: 0;'>\n <div class=\"Vlt-dropdown__block\"></div>\n <div *ngIf='!searchResults' class=\"Vlt-dropdown__scroll\">\n <a href='#' [ngClass]=\"{ 'Vlt-dropdown__link--selected': activeSuggestionIndex === i, smart: suggestion.smart }\" (click)='onSuggestionSelect($event, suggestion)' *ngFor='let suggestion of suggestions; let i = index' class=\"Vlt-dropdown__link has-type\">\n <svg class='Vlt-icon Vlt-icon--small'><use attr.xlink:href=\"volta/volta-brand-icons.svg#{{integrationIcon}}\"/></svg>\n <div class='__gu' [title]='suggestion.label'>{{ suggestion.label }}</div>\n <small class='Vlt-grey-dark' style='text-transform: capitalize;'>{{suggestion.type}}</small>\n </a>\n </div>\n <div *ngIf='searchResults' class=\"Vlt-dropdown__scroll\">\n <div *ngIf='!searchResults.length' class='Vlt-dropdown__block'> No records matching '<b style='pointer-events: none;'>{{searchText}}</b>' were found.</div>\n <a href='#' [ngClass]=\"{ 'Vlt-dropdown__link--selected': activeSuggestionIndex === i }\" (click)='onSuggestionSelect($event, suggestion)' *ngFor='let suggestion of searchResults; let i = index' class=\"Vlt-dropdown__link has-type\">\n <svg class='Vlt-icon Vlt-icon--small'><use attr.xlink:href=\"volta/volta-brand-icons.svg#{{integrationIcon}}\"/></svg>\n <div class='__gu' [title]='suggestion.label'>{{ suggestion.label }}</div>\n <small class='Vlt-grey-dark' style='text-transform: capitalize;'>{{suggestion.type}}</small>\n </a>\n </div>\n <!-- <div *ngIf='searchResults' class=\"Vlt-dropdown__block\" style='text-align: right; padding-top: 0;'>\n <small>\n {{ searchResults ? searchResults.length+' results' : 'Suggestions' }} <span style='font-style: italic; font-weight: normal;' *ngIf='searchResults'>~{{ model ? 'last search' : searchText}}</span>\n </small>\n </div> -->\n <div class=\"Vlt-dropdown__block\"></div>\n </div>\n </div>\n </div>\n <div class=\"Vlt-composite__prepend\"\n *ngIf='isPolymorphic && showTypes && (multiple || !model || (dropdownVisible && ((suggestions || searchResults || []).length || searchResourceType.resourceType)))'>\n <div class=\"search-scope\" [ngClass]=\"{ 'has-value': searchResourceType.resourceType }\">\n <vgip-meta-field class='shown' [meta]='searchResourceTypeMeta' [parent]='searchResourceType'\n (onChange)='onSearchResourceTypeChanged($event)' (onLeave)='onBlur($event)'\n [integrationCode]='integrationCode' theme='inherit'></vgip-meta-field>\n <svg class='Vlt-icon Vlt-grey Vlt-icon--smaller visible-mobile mobile-icon'\n style='position: absolute; top: 15px; left: 14px; pointer-events: none;'>\n <use xlink:href=\"volta/volta-icons.svg#Vlt-icon-menu\" />\n </svg>\n </div>\n </div>\n <div *ngIf='!(isPolymorphic && showTypes && (multiple || !model || dropdownVisible))'>\n <!-- required by css -->\n </div>\n <div class=\"Vlt-composite__wrapper Vlt-input\" style='overflow: hidden;'\n [ngClass]=\"{ 'has-append-button': hasAppendButton && !disabled, 'vgip-disable': disabled }\">\n <label class='wrapper'>\n <div class=\"Vlt-composite__prepend Vlt-composite__prepend--icon\" style='top: 0; padding-top: 15px;'>\n <div class=\"Vlt-composite__icon\">\n <svg *ngIf='isSearchable && (!model || multiple)' class='Vlt-grey'>\n <use attr.xlink:href=\"volta/volta-icons.svg#Vlt-icon-{{ multiple ? 'stack' : 'search'}}\" />\n </svg>\n <svg *ngIf='!isSearchable || (model && !multiple)'\n [ngStyle]=\"{fill: integrationIcon === 'Brand-icon-vonage' ? 'var(--vgip-meta-input-color)' : ''}\">\n <use attr.xlink:href=\"volta/volta-brand-icons.svg#{{integrationIcon}}\" />\n </svg>\n </div>\n <div *ngIf='suggestions.length' class=\"Vlt-badge Vlt-badge--small Vlt-badge--purple\"\n style='padding: 0px 4px; position: absolute; top: 26px; left: 4px; pointer-events: none; min-width: 14px;'>\n {{suggestions.length}}</div>\n </div>\n <input class='model' type='hidden' [required]='validations.required' [(ngModel)]='model' #f='ngModel' [name]='name' />\n <input class='main' [readonly]='!isSearchable || (model && !multiple)' [ngModel]='searchText' #ft='ngModel' (ngModelChange)='onSearchTextChanged($event)' [ngModelOptions]=\"{standalone: true}\" type=\"text\" placeholder=\"{{ placeHolderLabel || ' ' }}\" [ngClass]='{ ext: externalLink }' (click)='onActivated($event)' (focus)='onActivated($event)' (blur)='onBlur($event)' [disabled]='disabled' [title]=\"model ? model.label : ''\"/>\n <label class='Vlt-truncate hidden-mobile' style='padding-left: 25px; padding-right: 42px;'>{{ (multiple && isPolymorphic) ? '+Add ' : ((model || !isPolymorphic) ? meta.label : ( meta.searchLabel || 'Search')) }}<span *ngIf='validations.required' class='Vlt-red'>*</span>&nbsp;<span style='color: var(--vgip-meta-input-color); text-transform: capitalize;' *ngIf='model'>({{model.type || model.resourceType || model.length}})</span></label> <!-- eslint-disable-line @angular-eslint/template/label-has-associated-control-->\n <label class='Vlt-truncate hidden-desktop' style='padding-left: 25px; padding-right: 42px;'>{{meta.label || meta.name}}<span *ngIf='validations.required' class='Vlt-red'>*</span>&nbsp;<span style='color: var(--vgip-meta-input-color); text-transform: capitalize;' *ngIf='model'>({{model.type || model.resourceType || model.length}})</span></label> <!-- eslint-disable-line @angular-eslint/template/label-has-associated-control-->\n </label>\n <div *ngIf='searching' class='search-progress'>\n <div class=\"container\">\n <div class=\"bar Vlt-bg-purple\"></div>\n </div>\n </div>\n <div class='Vlt-composite__append right-actions'>\n <!-- <div *ngIf='prevModel && !model' class=\"Vlt-composite__append--icon\" (click)='revert()'>\n <div class=\"Vlt-composite__icon\">\n <svg><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-reply\"/></svg>\n </div>\n </div> -->\n <a href='#' *ngIf='model && !multiple' class=\"Vlt-composite__append--icon\" (click)='removeSelection($event)'>\n <div class=\"Vlt-composite__icon\">\n <svg>\n <use xlink:href=\"volta/volta-icons.svg#Vlt-icon-cross\" />\n </svg>\n </div>\n </a>\n <a [href]='externalLink || model.externalLink' target='_blank' rel='noopener' *ngIf='externalLink && (model && !multiple)' class=\"Vlt-composite__append--icon\" aria-label='Open external'>\n <div class=\"Vlt-composite__icon\">\n <svg>\n <use xlink:href=\"volta/volta-icons.svg#Vlt-icon-open\" />\n </svg>\n </div>\n </a>\n </div>\n </div>\n <!-- <span *ngIf='hasCreatables'>\n <button type='button' *ngIf='!model || multiple' (click)='openResource()' class=\"Vlt-btn Vlt-btn--secondary Vlt-btn--icon Vlt-btn--large\" style='margin-left: 12px;'>\n <svg><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-plus\"/></svg>\n </button>\n <button type='button' *ngIf='model && !multiple' (click)='openResource(model)' class=\"Vlt-btn Vlt-btn--primary Vlt-btn--icon Vlt-btn--large\" style='margin-left: 12px;'>\n <svg><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-edit\"/></svg>\n </button>\n </span> -->\n <div *ngIf='hasAppendButton && !disabled' class=\"Vlt-composite__append\">\n <button (focus)='onActivated($event)' (blur)='onBlur($event)' type='button' *ngIf='!model || multiple'\n (click)='openResource()' class=\"Vlt-btn Vlt-btn--white Vlt-btn--icon\" aria-label='Add new'>\n <svg>\n <use xlink:href=\"volta/volta-icons.svg#Vlt-icon-plus\" />\n </svg>\n </button>\n <button (focus)='onActivated($event)' (blur)='onBlur($event)' type='button' *ngIf='model && !multiple'\n (click)='openResource(model)' class=\"Vlt-btn Vlt-btn--white Vlt-btn--icon\" aria-label='Edit'>\n <svg>\n <use xlink:href=\"volta/volta-icons.svg#Vlt-icon-edit\" />\n </svg>\n </button>\n </div>\n </div>\n <small *ngIf='f.invalid && ((f | metaModel)._parent.submitted || ((ft | metaModel).touched && keyListenerActive))'\n class=\"Vlt-form__element__error\">\n <span *ngIf=\"f.errors.required\">Required</span>\n <span *ngIf=\"f.errors.pattern\">Should match '{{validations.pattern}}' pattern</span>\n <span *ngIf=\"f.errors.custom\">{{f.errors.custom}}&nbsp;</span>\n </small>\n <small *ngIf='meta.helpText || meta.hint' class=\"Vlt-form__element__hint\">{{meta.helpText || meta.hint}}</small>\n</div>", styles: [".Vlt-form__element--big .Vlt-input input:placeholder-shown:not(:focus)~label.Vlt-truncate{font-size:1.6rem;margin-top:-.8rem;top:50%}.Vlt-form__element--big ::ng-deep .search-scope vgip-meta-field .Vlt-input input.main.standalone{border-right:0;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.Vlt-form__element--big:hover .items-container,.Vlt-form__element--big:hover .main,.Vlt-form__element--big:hover .Vlt-composite__append button,.Vlt-form__element--big:hover ::ng-deep .search-scope vgip-meta-field .Vlt-input input.main.standalone,.Vlt-form__element--big.active .items-container,.Vlt-form__element--big.active .main,.Vlt-form__element--big.active .Vlt-composite__append button,.Vlt-form__element--big.active ::ng-deep .search-scope vgip-meta-field .Vlt-input input.main.standalone{border-color:var(--vgip-meta-input-active-border-color)}.Vlt-form__element--big.Vlt-form__element--error .items-container,.Vlt-form__element--big.Vlt-form__element--error .main,.Vlt-form__element--big.Vlt-form__element--error .Vlt-composite__append button,.Vlt-form__element--big.Vlt-form__element--error ::ng-deep .search-scope vgip-meta-field .Vlt-input input.main.standalone{border-color:#f25a6b}.Vlt-form__element--big.multiple .Vlt-composite.Vlt-dropdown{margin-top:3px}.Vlt-form__element--big.multiple:hover:not(.Vlt-form__element--error) .items-container,.Vlt-form__element--big.multiple:hover:not(.Vlt-form__element--error) .main,.Vlt-form__element--big.multiple:hover:not(.Vlt-form__element--error) .Vlt-composite__append button,.Vlt-form__element--big.multiple:hover:not(.Vlt-form__element--error) ::ng-deep .search-scope vgip-meta-field .Vlt-input input.main.standalone,.Vlt-form__element--big.multiple.active:not(.Vlt-form__element--error) .items-container,.Vlt-form__element--big.multiple.active:not(.Vlt-form__element--error) .main,.Vlt-form__element--big.multiple.active:not(.Vlt-form__element--error) .Vlt-composite__append button,.Vlt-form__element--big.multiple.active:not(.Vlt-form__element--error) ::ng-deep .search-scope vgip-meta-field .Vlt-input input.main.standalone{border-color:var(--vgip-meta-input-active-border-color)}.Vlt-form__element--big.multiple .items-container{background-color:var(--vgip-meta-input-bg-color);border:1px solid var(--vgip-meta-input-border-color);border-bottom:0;border-top-left-radius:6px;border-top-right-radius:6px}.Vlt-form__element--big.multiple .items-container .badges-container{overflow:auto;padding:6px 4px 3px 6px}.Vlt-form__element--big.multiple .items-container .badges-container .Vlt-badge{margin-bottom:3px;margin-left:0;margin-right:3px;overflow:hidden;max-width:100%;position:relative;padding-right:30px}.Vlt-form__element--big.multiple .items-container .badges-container .Vlt-badge.grid{display:grid}.Vlt-form__element--big.multiple:not(.has-value) .items-container{border:0}.Vlt-form__element--big.multiple.has-value .main,.Vlt-form__element--big.multiple.has-value .Vlt-composite__append button,.Vlt-form__element--big.multiple.has-value ::ng-deep .search-scope vgip-meta-field .Vlt-input input.main.standalone{border-top-left-radius:0;border-top-right-radius:0;height:48px}.Vlt-form__element--big.multiple.has-value .main:not(.Vlt-btn--icon),.Vlt-form__element--big.multiple.has-value .Vlt-composite__append button:not(.Vlt-btn--icon),.Vlt-form__element--big.multiple.has-value ::ng-deep .search-scope vgip-meta-field .Vlt-input input.main.standalone:not(.Vlt-btn--icon){border-top:0}.Vlt-form__element--big.multiple.has-value .Vlt-composite__prepend ::ng-deep .search-scope vgip-meta-field .Vlt-input input.main.standalone{border-top-right-radius:6px}.Vlt-form__element--big.multiple.has-value .Vlt-composite__append button{border-top-left-radius:6px;border-top:0}.Vlt-composite__prepend{z-index:initial}.Vlt-composite__prepend--icon{top:0;padding-top:15px;left:3px}.Vlt-input.has-append-button .Vlt-composite__append.right-actions{right:0}.Vlt-input.has-append-button .Vlt-composite__append.right-actions .Vlt-composite__append--icon:last-child{width:36px}.Vlt-composite__append.right-actions{position:absolute;top:5px;right:5px;cursor:pointer}.Vlt-composite__append.right-actions .Vlt-composite__append--icon{outline:none;position:initial;display:inline-block}.Vlt-composite__append.right-actions .Vlt-composite__append--icon svg{height:14px;width:14px}.Vlt-composite__append.right-actions .Vlt-composite__append--icon:hover svg,.Vlt-composite__append.right-actions .Vlt-composite__append--icon:focus svg{fill:var(--vgip-meta-input-accent-color)}.vgip-disable .Vlt-composite__append{cursor:not-allowed;pointer-events:none}.Vlt-composite__append--icon.preview{bottom:initial;padding:0 2px}.Vlt-composite__append button{height:48px;padding-right:16px;background:var(--vgip-meta-input-bg-color);border-color:var(--vgip-meta-input-border-color);padding-left:16px;border-left:0}.Vlt-composite__append button:hover{background:var(--vgip-meta-input-action-hover-bg-color)}.Vlt-composite__append button svg{margin:-2px 0 0;fill:var(--vgip-meta-input-accent-color)}.Vlt-input input{padding-left:38px;text-overflow:ellipsis;padding-right:36px}.Vlt-input input.ext{padding-right:72px}.Vlt-composite__wrapper.has-append-button input.main{border-top-right-radius:0;border-bottom-right-radius:0;border-right:0}.Vlt-input input{background:var(--vgip-meta-input-bg-color);border-color:var(--vgip-meta-input-border-color);font-weight:700}.Vlt-dropdown__panel{max-width:100%;width:100%;min-width:280px}.Vlt-dropdown__panel .Vlt-dropdown__link.smart{font-weight:700;background:var(--vgip-meta-dropdown-bg-color)}.Vlt-dropdown__panel .Vlt-dropdown__link.smart.hidden{display:none}.Vlt-dropdown__panel .Vlt-dropdown__link.bold:after{background-color:#e1e2e6;content:\"\";height:1px;left:0;position:absolute;right:0;bottom:0}.Vlt-dropdown__panel .Vlt-dropdown__link--selected{background:rgba(44,45,48,.05)}.Vlt-dropdown__panel .Vlt-dropdown__link>div{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.Vlt-dropdown__panel .Vlt-dropdown__link>svg{margin-right:8px}.vgip-meta-field-preview .Vlt-badge{margin:1px 3px 1px 0;overflow:hidden;max-width:100%}:host .search-scope{width:130px}:host .search-scope ::ng-deep .Vlt-form__element.has-value .Vlt-select:after{display:none}:host .search-scope ::ng-deep .Vlt-form__element .right-actions{right:12px}:host .search-scope ::ng-deep .Vlt-form__element label.Vlt-truncate{padding-right:48px}:host .search-scope .mobile-icon{display:none}@media only screen and (max-width: 575px){:host .search-scope{width:60px}:host .search-scope:not(.has-value) .mobile-icon{display:block}:host .search-scope.has-value .mobile-label{display:block}:host .search-scope ::ng-deep .Vlt-form__element.Vlt-form__element--big .Vlt-composite__append{display:none}:host .search-scope ::ng-deep .Vlt-form__element.Vlt-form__element--big .Vlt-select:after{margin-right:-7px}:host .search-scope ::ng-deep .Vlt-form__element.Vlt-form__element--big label.Vlt-truncate{visibility:hidden}}:host .search-scope ::ng-deep vgip-meta-field .Vlt-input input.main.standalone{padding-right:initial;background:var(--vgip-meta-input-accent-bg-color);border-color:var(--vgip-meta-input-border-color)}:host .search-scope ::ng-deep vgip-meta-field .Vlt-form__element{padding:0}:host .search-scope ::ng-deep vgip-meta-field .Vlt-form__element .Vlt-dropdown__panel{width:initial}\n"] }]
854
+ }], ctorParameters: function () { return [{ type: MetaReferenceService }, { type: MetaResourceService }, { type: MetaMsgService }, { type: MetaContextService }, { type: MetaTrackerService }, { type: i0.ViewContainerRef }]; } });
855
+
856
+ var index = /*#__PURE__*/Object.freeze({
857
+ __proto__: null,
858
+ FieldReference: FieldReference
859
+ });
860
+
861
+ export { FieldReference as F, MetaTrackerService as M, index as i };
862
+ //# sourceMappingURL=vgip-meta-ui-index-a3a43cf7.mjs.map