@vgip/meta-ui 1.7.4 → 1.7.6

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 (60) hide show
  1. package/esm2022/lib/fieldAbstract.mjs +1 -1
  2. package/esm2022/lib/fieldBoolean/index.mjs +4 -6
  3. package/esm2022/lib/fieldComposite/index.mjs +4 -8
  4. package/esm2022/lib/fieldList/index.mjs +2 -2
  5. package/esm2022/lib/fieldRadio/index.mjs +4 -6
  6. package/esm2022/lib/fieldReference/index.mjs +15 -13
  7. package/esm2022/lib/fieldRichtext/index.mjs +4 -6
  8. package/esm2022/lib/fieldSelect/index.mjs +19 -4
  9. package/esm2022/lib/fieldText/index.mjs +25 -16
  10. package/esm2022/lib/layout/index.mjs +5 -4
  11. package/esm2022/lib/metaField/index.mjs +5 -2
  12. package/esm2022/lib/refDialog/index.mjs +1 -1
  13. package/esm2022/lib/resource/index.mjs +20 -4
  14. package/esm2022/lib/services/metaReference/index.mjs +8 -3
  15. package/esm2022/lib/services/metaResource/index.mjs +4 -4
  16. package/fesm2022/vgip-meta-ui-fieldAbstract-9955be39.mjs.map +1 -1
  17. package/fesm2022/vgip-meta-ui-index-1799a060.mjs +864 -0
  18. package/fesm2022/vgip-meta-ui-index-1799a060.mjs.map +1 -0
  19. package/fesm2022/{vgip-meta-ui-index-9fd8e1b0.mjs → vgip-meta-ui-index-45a741f4.mjs} +5 -9
  20. package/fesm2022/vgip-meta-ui-index-45a741f4.mjs.map +1 -0
  21. package/fesm2022/{vgip-meta-ui-index-24fe289e.mjs → vgip-meta-ui-index-46c7f4e4.mjs} +36 -16
  22. package/fesm2022/vgip-meta-ui-index-46c7f4e4.mjs.map +1 -0
  23. package/fesm2022/{vgip-meta-ui-index-bc945c3c.mjs → vgip-meta-ui-index-6f647ae9.mjs} +21 -6
  24. package/fesm2022/vgip-meta-ui-index-6f647ae9.mjs.map +1 -0
  25. package/fesm2022/{vgip-meta-ui-index-c39ea0ec.mjs → vgip-meta-ui-index-8b2ba164.mjs} +4 -6
  26. package/fesm2022/vgip-meta-ui-index-8b2ba164.mjs.map +1 -0
  27. package/fesm2022/{vgip-meta-ui-index-c5756fbe.mjs → vgip-meta-ui-index-aa21fd6a.mjs} +13 -10
  28. package/fesm2022/vgip-meta-ui-index-aa21fd6a.mjs.map +1 -0
  29. package/fesm2022/{vgip-meta-ui-index-b0a76073.mjs → vgip-meta-ui-index-b3099377.mjs} +4 -6
  30. package/fesm2022/vgip-meta-ui-index-b3099377.mjs.map +1 -0
  31. package/fesm2022/vgip-meta-ui-index-ea3cad77.mjs +77 -0
  32. package/fesm2022/vgip-meta-ui-index-ea3cad77.mjs.map +1 -0
  33. package/fesm2022/{vgip-meta-ui-index-9c99e9b0.mjs → vgip-meta-ui-index-ebaddb9b.mjs} +3 -3
  34. package/fesm2022/{vgip-meta-ui-index-9c99e9b0.mjs.map → vgip-meta-ui-index-ebaddb9b.mjs.map} +1 -1
  35. package/fesm2022/{vgip-meta-ui-index-5871a6f2.mjs → vgip-meta-ui-index-ee4a5a52.mjs} +4 -6
  36. package/fesm2022/vgip-meta-ui-index-ee4a5a52.mjs.map +1 -0
  37. package/fesm2022/vgip-meta-ui.mjs +12 -12
  38. package/lib/fieldAbstract.d.ts +1 -0
  39. package/lib/fieldBoolean/index.d.ts +1 -2
  40. package/lib/fieldComposite/index.d.ts +1 -3
  41. package/lib/fieldRadio/index.d.ts +1 -2
  42. package/lib/fieldRichtext/index.d.ts +1 -2
  43. package/lib/fieldSelect/index.d.ts +0 -1
  44. package/lib/fieldText/index.d.ts +2 -2
  45. package/lib/layout/index.d.ts +1 -0
  46. package/lib/metaField/index.d.ts +2 -1
  47. package/lib/resource/index.d.ts +5 -1
  48. package/lib/services/metaReference/index.d.ts +1 -1
  49. package/package.json +1 -1
  50. package/fesm2022/vgip-meta-ui-index-24fe289e.mjs.map +0 -1
  51. package/fesm2022/vgip-meta-ui-index-5871a6f2.mjs.map +0 -1
  52. package/fesm2022/vgip-meta-ui-index-9e4137fe.mjs +0 -68
  53. package/fesm2022/vgip-meta-ui-index-9e4137fe.mjs.map +0 -1
  54. package/fesm2022/vgip-meta-ui-index-9fd8e1b0.mjs.map +0 -1
  55. package/fesm2022/vgip-meta-ui-index-a3a43cf7.mjs +0 -862
  56. package/fesm2022/vgip-meta-ui-index-a3a43cf7.mjs.map +0 -1
  57. package/fesm2022/vgip-meta-ui-index-b0a76073.mjs.map +0 -1
  58. package/fesm2022/vgip-meta-ui-index-bc945c3c.mjs.map +0 -1
  59. package/fesm2022/vgip-meta-ui-index-c39ea0ec.mjs.map +0 -1
  60. package/fesm2022/vgip-meta-ui-index-c5756fbe.mjs.map +0 -1
@@ -0,0 +1,864 @@
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-46c7f4e4.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-aa21fd6a.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
+ if (!this.model) {
319
+ const item = {
320
+ id: this.default.id || this.default.value,
321
+ label: this.default.label || this.default.id || this.default.value,
322
+ type: this.default.type,
323
+ smart: true
324
+ };
325
+ if (this.default.externalLink) {
326
+ item.externalLink = this.default.externalLink;
327
+ }
328
+ this.parent[this.meta.name] = item;
329
+ }
330
+ }, 0);
331
+ }
332
+ else {
333
+ console.warn('!!!default value is not valid format', this.meta);
334
+ }
335
+ }
336
+ }
337
+ if (typeof (this.meta.disabled) !== 'undefined') {
338
+ if (typeof (this.meta.disabled) === 'object') {
339
+ for (const p of Object.keys(this.meta.disabled)) {
340
+ const props = p.split('.');
341
+ if (typeof (this.parent[props[0]]) !== 'undefined') {
342
+ let val = this.parent;
343
+ for (const prop of props) {
344
+ val = val[prop];
345
+ if (!val) {
346
+ break;
347
+ }
348
+ }
349
+ if (val === this.meta.disabled[p]) {
350
+ this.logicalDisabled = true;
351
+ this.clear();
352
+ }
353
+ }
354
+ this.parentChangeSubject.subscribe((value) => {
355
+ if (value && value.hasOwnProperty(props[0])) {
356
+ let val = this.parent;
357
+ for (const prop of props) {
358
+ val = val[prop];
359
+ if (!val) {
360
+ break;
361
+ }
362
+ }
363
+ if (val === this.meta.disabled[p]) {
364
+ this.logicalDisabled = true;
365
+ this.clear();
366
+ }
367
+ else {
368
+ delete this.logicalDisabled;
369
+ }
370
+ }
371
+ });
372
+ }
373
+ }
374
+ }
375
+ if (this.meta.auto && this.meta.auto.search) {
376
+ const searchParams = this.meta.auto.search.params;
377
+ if (searchParams) {
378
+ for (const par of Object.keys(searchParams)) {
379
+ const props = searchParams[par].split('.');
380
+ const field = props[0];
381
+ const prop = props[1];
382
+ let parValue = this.parent[field];
383
+ if (parValue) {
384
+ if (prop) {
385
+ parValue = parValue[prop];
386
+ }
387
+ if (parValue) {
388
+ const params = {};
389
+ params[par] = parValue;
390
+ this.searchAutoSuggestions(params);
391
+ }
392
+ }
393
+ this.parentChangeSubject.subscribe((value) => {
394
+ if (value && value.hasOwnProperty(field)) {
395
+ if (value[field]) {
396
+ if (prop) {
397
+ value[field] = value[field][prop];
398
+ }
399
+ const params = {};
400
+ params[par] = value[field];
401
+ this.searchAutoSuggestions(params);
402
+ }
403
+ }
404
+ });
405
+ }
406
+ }
407
+ }
408
+ }
409
+ clearSearchResourceType() {
410
+ this.searchResourceType = {};
411
+ this.onSearchResourceTypeChanged();
412
+ }
413
+ onSearchResourceTypeChanged(resourceType) {
414
+ if (!resourceType || !resourceType.id) {
415
+ this.searchResourceType.resourceType = null;
416
+ this.searchResourceTypesScope = (this.metaReference || []).filter(rt => rt.hidden !== true).map(rt => rt.name).join(',');
417
+ }
418
+ else {
419
+ this.searchResourceType.resourceType = resourceType.id;
420
+ this.searchResourceTypesScope = resourceType.id;
421
+ }
422
+ this.buildPlaceholderLabel();
423
+ this.focus();
424
+ if (!this.model && !this.searchText) { // filter suggestions by type
425
+ this.filteredSuggestions = !resourceType ? (this.meta.suggestions || []) : (this.meta.suggestions || []).filter((s) => s.type === resourceType.id);
426
+ }
427
+ else { // regular search (return scoped results)
428
+ if (!this.model) {
429
+ this.search();
430
+ }
431
+ else if (this.searchResults && resourceType) {
432
+ this.searchResults = this.searchResults.filter((s) => s.type === resourceType.id);
433
+ }
434
+ }
435
+ delete this.searchError;
436
+ }
437
+ onSearchTextChanged(value) {
438
+ this.searchTextChanged.next(value);
439
+ }
440
+ search() {
441
+ this.searching = true;
442
+ // this.activeSuggestionIndex;
443
+ if (!this.searchText || this.searchText.length < 2) {
444
+ this.searching = false;
445
+ delete this.searchResults;
446
+ return;
447
+ }
448
+ const showSearchResults = (results) => {
449
+ this.searching = false;
450
+ delete this.searchError;
451
+ delete this.activeSuggestionIndex;
452
+ if (!results || !(results instanceof Array)) {
453
+ results = [];
454
+ }
455
+ if (this.meta.acceptNew && this.meta.acceptNew.type && this.meta.acceptNew.pattern) {
456
+ const regex = new RegExp(this.meta.acceptNew.pattern);
457
+ if (regex.test(this.searchText)) {
458
+ results.unshift({ id: null, label: this.searchText, type: this.meta.acceptNew.type });
459
+ }
460
+ }
461
+ this.searchResults = results.map((r) => {
462
+ return { id: r.id, label: r.label, type: r.type || r.resourceType || this.searchResourceType.name, externalLink: r.externalLink };
463
+ });
464
+ if (!/Vlt-dropdown--expanded/.test(this.dropdown.className)) {
465
+ this.showDropdown();
466
+ }
467
+ };
468
+ if (this.meta.search) {
469
+ const searchParams = this.meta.search.params || {};
470
+ let searchUrl = `/fields/${this.meta.name}/search`;
471
+ if (this.meta.search.url) {
472
+ searchUrl = this.meta.search.url.replace(/\${\s*([\w.]+)\s*}/g, (match, key) => {
473
+ if (searchParams.hasOwnProperty(key)) {
474
+ const props = searchParams[key].split('.');
475
+ const field = props[0];
476
+ const prop = props[1];
477
+ delete searchParams[key]; // if it is URL param, remove it as query param
478
+ let parValue = this.parent[field];
479
+ if (parValue) {
480
+ if (prop) {
481
+ parValue = parValue[prop];
482
+ }
483
+ if (parValue) {
484
+ return parValue;
485
+ }
486
+ }
487
+ }
488
+ return 'undefined';
489
+ });
490
+ }
491
+ for (const p of Object.keys(searchParams)) {
492
+ searchUrl += `${searchUrl.indexOf('?') === -1 ? '?' : '&'}${encodeURIComponent(p)}=${encodeURIComponent(searchParams[p])}`;
493
+ }
494
+ searchUrl += `${searchUrl.indexOf('?') === -1 ? '?' : '&'}q=${encodeURIComponent(this.searchText)}`;
495
+ this.searching = true;
496
+ this.resourceService.getByPath(searchUrl).subscribe((results) => {
497
+ showSearchResults(results);
498
+ }, (error) => {
499
+ delete this.searching;
500
+ this.searchResults = [];
501
+ this.searchError = error.error ? error.error.message || error.error : error.message || error;
502
+ if (!/Vlt-dropdown--expanded/.test(this.dropdown.className)) {
503
+ this.showDropdown();
504
+ }
505
+ });
506
+ }
507
+ else {
508
+ if (!this.vr) {
509
+ this.vr = this.metaResource.new({
510
+ integrationCode: this.integrationCode,
511
+ resourceType: null
512
+ });
513
+ }
514
+ this.vr.searchIntegration(this.searchText, this.searchResourceType.name || this.searchResourceTypesScope).subscribe((results) => {
515
+ showSearchResults(results);
516
+ }, (error) => {
517
+ this.searching = false;
518
+ this.searchResults = [];
519
+ this.searchError = error.error ? error.error.message || error.error : error.message || error;
520
+ if (!/Vlt-dropdown--expanded/.test(this.dropdown.className)) {
521
+ this.showDropdown();
522
+ }
523
+ });
524
+ }
525
+ }
526
+ onActivated(ev) {
527
+ // ev.preventDefault();
528
+ // ev.stopPropagation();
529
+ this.input = ev.srcElement;
530
+ if (!this.dropdown) {
531
+ // this.dropdown = ev.srcElement.parentNode.parentNode;
532
+ this.dropdown = this.elementRef.nativeElement.querySelector('.dropdown-wrapper');
533
+ }
534
+ this.showDropdown();
535
+ }
536
+ onBlur(ev) {
537
+ let internalControl = false;
538
+ if (ev.relatedTarget) {
539
+ if (!this.elementRef.nativeElement.contains(ev.relatedTarget)) {
540
+ this.dismissDropdown();
541
+ }
542
+ else {
543
+ internalControl = true;
544
+ }
545
+ }
546
+ if (this.keyListenerActive && !internalControl) {
547
+ this.input.removeEventListener('keydown', this.keydown);
548
+ setTimeout(() => {
549
+ if (!this.keyListenerActive) {
550
+ document.removeEventListener('click', this.clickout);
551
+ }
552
+ }, 400);
553
+ delete this.keyListenerActive;
554
+ }
555
+ }
556
+ removeSelection(ev) {
557
+ if (ev) {
558
+ ev.preventDefault();
559
+ ev.stopPropagation();
560
+ }
561
+ if (this.model && !this.suggestions.find((s) => (s.id === this.model.id && s.type === this.model.type))) {
562
+ this.smartSuggestions.push({
563
+ id: this.model.id,
564
+ label: this.model.label,
565
+ type: this.model.type,
566
+ smart: true
567
+ });
568
+ }
569
+ this.metaTracker.emit(this.buildTrackEvent('REMOVE'));
570
+ this.clear();
571
+ }
572
+ onSuggestionSelect(ev, suggestion) {
573
+ if (!suggestion) {
574
+ return;
575
+ }
576
+ ev.preventDefault();
577
+ ev.stopPropagation();
578
+ this.focus();
579
+ this.metaTracker.emit(this.buildTrackEvent('SELECT'));
580
+ if (this.multiple) {
581
+ if (!this.model) {
582
+ this.model = [];
583
+ }
584
+ let existingEntry;
585
+ for (const entry of this.model) {
586
+ if (suggestion.id && (entry.id === suggestion.id)) {
587
+ existingEntry = entry;
588
+ break;
589
+ }
590
+ else if (suggestion.label === entry.label) { // create new (google emails)
591
+ existingEntry = entry;
592
+ break;
593
+ }
594
+ }
595
+ if (!existingEntry) {
596
+ this.model.push(suggestion);
597
+ }
598
+ this.onModelChange(this.model);
599
+ delete this.searchText;
600
+ this.searchTextChanged.next(this.searchText);
601
+ }
602
+ else {
603
+ this.model = suggestion;
604
+ this.externalLink = suggestion.externalLink;
605
+ this.onModelChange(suggestion);
606
+ this.searchText = suggestion.label;
607
+ this.activeSuggestionIndex = (this.searchResults || this.suggestions).indexOf(suggestion);
608
+ }
609
+ this.dismissDropdown();
610
+ // if (this.isPolymorphic) {
611
+ // this.searchResourceType = this.metaReference.find((rt)=> {
612
+ // return rt.name === suggestion.type;
613
+ // });
614
+ // }
615
+ }
616
+ showDropdown() {
617
+ this.dropdownVisible = true;
618
+ this.dropdown.classList.add('Vlt-dropdown--expanded');
619
+ if (!this.keyListenerActive) {
620
+ this.input.addEventListener('keydown', this.keydown);
621
+ setTimeout(() => {
622
+ document.addEventListener('click', this.clickout);
623
+ }, 200);
624
+ this.keyListenerActive = true;
625
+ }
626
+ if (typeof (this.activeSuggestionIndex) === 'undefined') {
627
+ if (this.model && (this.searchResults || this.suggestions)) {
628
+ for (let suggestionIndex = 0; suggestionIndex < (this.searchResults || this.suggestions).length; suggestionIndex++) {
629
+ const item = (this.searchResults || this.suggestions)[suggestionIndex];
630
+ if (this.model.id === item.id && this.model.type === item.type) {
631
+ this.activeSuggestionIndex = suggestionIndex;
632
+ break;
633
+ }
634
+ }
635
+ }
636
+ }
637
+ this.ensureDropdownIsVisible();
638
+ }
639
+ dismissDropdown(event) {
640
+ this.dropdownVisible = false;
641
+ if (event) {
642
+ this.focus();
643
+ }
644
+ if (this.dropdown) {
645
+ this.dropdown.classList.remove('Vlt-dropdown--expanded');
646
+ }
647
+ }
648
+ clear() {
649
+ this.prevModel = this.model;
650
+ delete this.searchText;
651
+ delete this.searchResults;
652
+ delete this.model;
653
+ delete this.activeSuggestionIndex;
654
+ this.onModelChange(this.model);
655
+ this.onSearchTextChanged(this.searchText);
656
+ this.focus();
657
+ }
658
+ revert() {
659
+ this.model = this.prevModel;
660
+ delete this.prevModel;
661
+ this.onModelChange(this.model);
662
+ this.focus();
663
+ }
664
+ remove(ev, item) {
665
+ ev.preventDefault();
666
+ ev.stopPropagation();
667
+ const optionIndex = this.model.indexOf(item);
668
+ if (optionIndex !== -1) {
669
+ this.model.splice(optionIndex, 1);
670
+ if (!this.model.length) {
671
+ delete this.model;
672
+ delete this.value;
673
+ }
674
+ this.onModelChange(this.model);
675
+ }
676
+ }
677
+ openResource(model) {
678
+ this.keyListenerActive = true; // suppress dropdown in this case
679
+ setTimeout(() => {
680
+ this.dismissDropdown();
681
+ });
682
+ const refDialogComponent = this.viewContainerRef.createComponent(MetaRefDialog);
683
+ this.metaTracker.emit(this.buildTrackEvent(model ? 'EDIT' : 'NEW'));
684
+ let theme = this.elementRef.nativeElement.dataset.theme;
685
+ if (!theme || theme === 'inherit') {
686
+ let parentComponent = this.elementRef.nativeElement.closest('vgip-meta-layout');
687
+ if (parentComponent) {
688
+ theme = parentComponent.dataset.theme;
689
+ }
690
+ if (!theme || theme === 'inherit') {
691
+ parentComponent = this.elementRef.nativeElement.closest('vgip-meta-resource');
692
+ if (parentComponent) {
693
+ theme = parentComponent.dataset.theme;
694
+ }
695
+ }
696
+ }
697
+ 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, this.overlayContainer).subscribe((result) => {
698
+ if (result) {
699
+ this.parent[this.meta.name] = result;
700
+ this.onChange.emit(result);
701
+ const existingSuggestion = (this.meta.suggestions || []).find((s) => (s.id === result.id && s.type === result.type));
702
+ if (existingSuggestion) {
703
+ existingSuggestion.label = result.label;
704
+ }
705
+ else {
706
+ if (!this.meta.suggestions) {
707
+ this.meta.suggestions = [];
708
+ }
709
+ this.meta.suggestions.unshift(result);
710
+ }
711
+ this.metaTracker.emit(this.buildTrackEvent(model ? 'UPDATE' : 'CREATE', result.type || result.resourceType));
712
+ }
713
+ else {
714
+ this.metaTracker.emit(this.buildTrackEvent(model ? 'CANCEL_EDIT' : 'CANCEL_UPDATE'));
715
+ }
716
+ });
717
+ }
718
+ ensureDropdownIsVisible() {
719
+ setTimeout(() => {
720
+ const holder = this.dropdown.closest('.Vlt-card__content');
721
+ if (holder) {
722
+ const el = this.elementRef.nativeElement.querySelector('.Vlt-dropdown__panel');
723
+ const elRect = el.getBoundingClientRect();
724
+ const holderRect = holder.getBoundingClientRect();
725
+ if (holderRect.top + holderRect.height < elRect.top + elRect.height) {
726
+ el.scrollIntoView({ block: 'end' });
727
+ }
728
+ }
729
+ }, 400);
730
+ }
731
+ ensureDropdownOptionIsVisible() {
732
+ if (!this.dropdownScrollContainer) {
733
+ this.dropdownScrollContainer = this.dropdown.querySelector('.Vlt-dropdown__scroll');
734
+ }
735
+ if (this.dropdownScrollContainer && typeof (this.activeSuggestionIndex) === 'number') {
736
+ const scrollTop = 44 * this.activeSuggestionIndex;
737
+ const scrollBottom = 44 * (this.activeSuggestionIndex - 7);
738
+ if (scrollTop < this.dropdownScrollContainer.scrollTop) {
739
+ this.dropdownScrollContainer.scrollTop = scrollTop;
740
+ }
741
+ else if (scrollBottom > this.dropdownScrollContainer.scrollTop) {
742
+ this.dropdownScrollContainer.scrollTop = scrollBottom;
743
+ }
744
+ }
745
+ }
746
+ buildTrackEvent(action, value) {
747
+ const e = {
748
+ integration: this.integrationCode,
749
+ resource: this.model ? (this.model.type || this.model.resourceType) : this.searchResourceType.resourceType,
750
+ field: this.meta.name,
751
+ action
752
+ };
753
+ if (this.meta.$isContactable) {
754
+ e.isContactable = true;
755
+ }
756
+ if (typeof (value) !== 'undefined') {
757
+ e.value = value;
758
+ }
759
+ return e;
760
+ }
761
+ buildPlaceholderLabel() {
762
+ this.placeHolderLabel = this.meta.label;
763
+ if (this.multiple && !this.isPolymorphic) {
764
+ this.placeHolderLabel = '+Add ';
765
+ }
766
+ else {
767
+ this.placeHolderLabel = (this.isSearchable && (this.multiple || !this.isPolymorphic)) ? 'Search ' : '';
768
+ }
769
+ this.placeHolderLabel += this.searchResourceType.resourceType ? this.searchResourceType.resourceType : this.searchResourceTypesScope;
770
+ }
771
+ buildExternalLink() {
772
+ if (this.model) {
773
+ if (this.model.externalLink) {
774
+ this.externalLink = this.model.externalLink;
775
+ }
776
+ else if (this.metaContext.profiles[this.integrationCode.toUpperCase()]) {
777
+ delete this.externalLink;
778
+ this.metaMsgService.sendMessage(this.integrationCode.toUpperCase(), {
779
+ action: 'buildExternalLink',
780
+ integrationCode: this.integrationCode,
781
+ ref: this.model,
782
+ profile: this.metaContext.profiles[this.integrationCode.toUpperCase()]
783
+ }, (response) => {
784
+ if (!response.error) {
785
+ this.externalLink = response.externalLink;
786
+ }
787
+ else {
788
+ console.warn('No external link support for', this.integrationCode, this.model.resourceType || this.model.type);
789
+ }
790
+ });
791
+ }
792
+ }
793
+ else {
794
+ delete this.externalLink;
795
+ }
796
+ }
797
+ searchAutoSuggestions(params) {
798
+ let searchUrl = `/suggestions/${this.meta.name}/search`;
799
+ if (this.meta.auto && this.meta.auto.search) {
800
+ if (this.meta.auto.search.url) {
801
+ searchUrl = this.meta.auto.search.url.replace(/\${\s*([\w.]+)\s*}/g, (match, key) => {
802
+ if (params.hasOwnProperty(key)) {
803
+ const val = params[key];
804
+ delete params[key];
805
+ return val;
806
+ }
807
+ return '';
808
+ });
809
+ }
810
+ for (const p of Object.keys(params)) {
811
+ searchUrl += `${searchUrl.indexOf('?') === -1 ? '?' : '&'}${encodeURIComponent(p)}=${encodeURIComponent(params[p])}`;
812
+ }
813
+ this.searching = true;
814
+ this.resourceService.getByPath(searchUrl).subscribe((result) => {
815
+ delete this.searching;
816
+ if (result) {
817
+ let suggestions;
818
+ suggestions = result;
819
+ if (this.meta.auto.search.extract) {
820
+ suggestions = result[this.meta.auto.search.extract];
821
+ }
822
+ if (suggestions instanceof Array !== true) {
823
+ suggestions = [suggestions];
824
+ }
825
+ const asyncSuggestions = [];
826
+ suggestions.forEach((s) => {
827
+ if (s && s.id && s.type) { // TOOD check the type is acceptable
828
+ asyncSuggestions.push({
829
+ id: s.id,
830
+ label: s.label || `${s.type}#${s.id}`,
831
+ type: s.type
832
+ });
833
+ }
834
+ });
835
+ if (asyncSuggestions.length) {
836
+ if (asyncSuggestions.length === 1) {
837
+ this.parent[this.meta.name] = asyncSuggestions[0];
838
+ }
839
+ else {
840
+ delete this.asyncSuggestions;
841
+ }
842
+ }
843
+ this.asyncSuggestions = asyncSuggestions;
844
+ }
845
+ }, () => {
846
+ delete this.searching;
847
+ });
848
+ }
849
+ }
850
+ 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 }); }
851
+ 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' [ngClass]=\"{ 'has-external-link': externalLink || model.externalLink }\">\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>\n", 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", "overlayContainer"], outputs: ["onChange", "onLeave"] }, { kind: "pipe", type: MetaModelPipe, name: "metaModel" }], viewProviders: [{ provide: ControlContainer, useExisting: NgForm }] }); }
852
+ }
853
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: FieldReference, decorators: [{
854
+ type: Component,
855
+ 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' [ngClass]=\"{ 'has-external-link': externalLink || model.externalLink }\">\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>\n", 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"] }]
856
+ }], ctorParameters: function () { return [{ type: MetaReferenceService }, { type: MetaResourceService }, { type: MetaMsgService }, { type: MetaContextService }, { type: MetaTrackerService }, { type: i0.ViewContainerRef }]; } });
857
+
858
+ var index = /*#__PURE__*/Object.freeze({
859
+ __proto__: null,
860
+ FieldReference: FieldReference
861
+ });
862
+
863
+ export { FieldReference as F, MetaTrackerService as M, index as i };
864
+ //# sourceMappingURL=vgip-meta-ui-index-1799a060.mjs.map