@vgip/meta-ui 1.5.6 → 1.5.8

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 (98) hide show
  1. package/esm2020/lib/fieldAbstract.mjs +6 -6
  2. package/esm2020/lib/fieldComposite/index.mjs +65 -0
  3. package/esm2020/lib/fieldList/index.mjs +68 -0
  4. package/esm2020/lib/fieldReference/index.mjs +823 -0
  5. package/esm2020/lib/fieldSelect/index.mjs +488 -0
  6. package/esm2020/lib/index.mjs +10 -18
  7. package/esm2020/lib/layout/index.mjs +151 -0
  8. package/esm2020/lib/metaField/index.mjs +139 -0
  9. package/esm2020/lib/refDialog/index.mjs +127 -0
  10. package/esm2020/lib/resource/index.mjs +480 -0
  11. package/esm2020/lib/resourceCard/index.mjs +42 -0
  12. package/esm2020/lib/services/metaReference/index.mjs +2 -3
  13. package/fesm2015/vgip-meta-ui-fieldAbstract-2d0882f1.mjs +382 -0
  14. package/fesm2015/vgip-meta-ui-fieldAbstract-2d0882f1.mjs.map +1 -0
  15. package/fesm2015/vgip-meta-ui-index-0068fb77.mjs +368 -0
  16. package/fesm2015/vgip-meta-ui-index-0068fb77.mjs.map +1 -0
  17. package/fesm2015/vgip-meta-ui-index-3488da98.mjs +130 -0
  18. package/fesm2015/vgip-meta-ui-index-3488da98.mjs.map +1 -0
  19. package/fesm2015/vgip-meta-ui-index-4d489d76.mjs +71 -0
  20. package/fesm2015/vgip-meta-ui-index-4d489d76.mjs.map +1 -0
  21. package/fesm2015/vgip-meta-ui-index-5615e618.mjs +95 -0
  22. package/fesm2015/vgip-meta-ui-index-5615e618.mjs.map +1 -0
  23. package/fesm2015/vgip-meta-ui-index-65c10356.mjs +57 -0
  24. package/fesm2015/vgip-meta-ui-index-65c10356.mjs.map +1 -0
  25. package/fesm2015/vgip-meta-ui-index-6a77fa96.mjs +74 -0
  26. package/fesm2015/vgip-meta-ui-index-6a77fa96.mjs.map +1 -0
  27. package/fesm2015/vgip-meta-ui-index-6bd006d4.mjs +496 -0
  28. package/fesm2015/vgip-meta-ui-index-6bd006d4.mjs.map +1 -0
  29. package/fesm2015/vgip-meta-ui-index-8f5be5a7.mjs +24 -0
  30. package/fesm2015/vgip-meta-ui-index-8f5be5a7.mjs.map +1 -0
  31. package/fesm2015/vgip-meta-ui-index-92be02c0.mjs +145 -0
  32. package/fesm2015/vgip-meta-ui-index-92be02c0.mjs.map +1 -0
  33. package/fesm2015/vgip-meta-ui-index-934aeabf.mjs +68 -0
  34. package/fesm2015/vgip-meta-ui-index-934aeabf.mjs.map +1 -0
  35. package/fesm2015/vgip-meta-ui-index-9b5ee0c4.mjs +88 -0
  36. package/fesm2015/vgip-meta-ui-index-9b5ee0c4.mjs.map +1 -0
  37. package/fesm2015/vgip-meta-ui-index-a308ba4f.mjs +856 -0
  38. package/fesm2015/vgip-meta-ui-index-a308ba4f.mjs.map +1 -0
  39. package/fesm2015/vgip-meta-ui-index-def34ca9.mjs +1882 -0
  40. package/fesm2015/vgip-meta-ui-index-def34ca9.mjs.map +1 -0
  41. package/fesm2015/vgip-meta-ui-index-fa0b1b8b.mjs +460 -0
  42. package/fesm2015/vgip-meta-ui-index-fa0b1b8b.mjs.map +1 -0
  43. package/fesm2015/vgip-meta-ui-metaModel.pipe-725f401c.mjs +28 -0
  44. package/fesm2015/vgip-meta-ui-metaModel.pipe-725f401c.mjs.map +1 -0
  45. package/fesm2015/vgip-meta-ui-relativeTimeBuilder-31791ce4.mjs +51 -0
  46. package/fesm2015/vgip-meta-ui-relativeTimeBuilder-31791ce4.mjs.map +1 -0
  47. package/fesm2015/vgip-meta-ui.mjs +40 -5083
  48. package/fesm2015/vgip-meta-ui.mjs.map +1 -1
  49. package/fesm2020/vgip-meta-ui-fieldAbstract-2d0882f1.mjs +382 -0
  50. package/fesm2020/vgip-meta-ui-fieldAbstract-2d0882f1.mjs.map +1 -0
  51. package/fesm2020/vgip-meta-ui-index-0068fb77.mjs +368 -0
  52. package/fesm2020/vgip-meta-ui-index-0068fb77.mjs.map +1 -0
  53. package/fesm2020/vgip-meta-ui-index-3488da98.mjs +130 -0
  54. package/fesm2020/vgip-meta-ui-index-3488da98.mjs.map +1 -0
  55. package/fesm2020/vgip-meta-ui-index-3907f4b1.mjs +1879 -0
  56. package/fesm2020/vgip-meta-ui-index-3907f4b1.mjs.map +1 -0
  57. package/fesm2020/vgip-meta-ui-index-3d8c2fcd.mjs +856 -0
  58. package/fesm2020/vgip-meta-ui-index-3d8c2fcd.mjs.map +1 -0
  59. package/fesm2020/vgip-meta-ui-index-5615e618.mjs +95 -0
  60. package/fesm2020/vgip-meta-ui-index-5615e618.mjs.map +1 -0
  61. package/fesm2020/vgip-meta-ui-index-65c10356.mjs +57 -0
  62. package/fesm2020/vgip-meta-ui-index-65c10356.mjs.map +1 -0
  63. package/fesm2020/vgip-meta-ui-index-6f96198b.mjs +70 -0
  64. package/fesm2020/vgip-meta-ui-index-6f96198b.mjs.map +1 -0
  65. package/fesm2020/vgip-meta-ui-index-710246ac.mjs +73 -0
  66. package/fesm2020/vgip-meta-ui-index-710246ac.mjs.map +1 -0
  67. package/fesm2020/vgip-meta-ui-index-8f5be5a7.mjs +24 -0
  68. package/fesm2020/vgip-meta-ui-index-8f5be5a7.mjs.map +1 -0
  69. package/fesm2020/vgip-meta-ui-index-934aeabf.mjs +68 -0
  70. package/fesm2020/vgip-meta-ui-index-934aeabf.mjs.map +1 -0
  71. package/fesm2020/vgip-meta-ui-index-9b5ee0c4.mjs +88 -0
  72. package/fesm2020/vgip-meta-ui-index-9b5ee0c4.mjs.map +1 -0
  73. package/fesm2020/vgip-meta-ui-index-e743527e.mjs +495 -0
  74. package/fesm2020/vgip-meta-ui-index-e743527e.mjs.map +1 -0
  75. package/fesm2020/vgip-meta-ui-index-e8e3b16a.mjs +142 -0
  76. package/fesm2020/vgip-meta-ui-index-e8e3b16a.mjs.map +1 -0
  77. package/fesm2020/vgip-meta-ui-index-fa0b1b8b.mjs +460 -0
  78. package/fesm2020/vgip-meta-ui-index-fa0b1b8b.mjs.map +1 -0
  79. package/fesm2020/vgip-meta-ui-metaModel.pipe-725f401c.mjs +28 -0
  80. package/fesm2020/vgip-meta-ui-metaModel.pipe-725f401c.mjs.map +1 -0
  81. package/fesm2020/vgip-meta-ui-relativeTimeBuilder-31791ce4.mjs +51 -0
  82. package/fesm2020/vgip-meta-ui-relativeTimeBuilder-31791ce4.mjs.map +1 -0
  83. package/fesm2020/vgip-meta-ui.mjs +39 -5083
  84. package/fesm2020/vgip-meta-ui.mjs.map +1 -1
  85. package/lib/fieldComposite/index.d.ts +12 -0
  86. package/lib/fieldList/index.d.ts +14 -0
  87. package/lib/fieldReference/index.d.ts +73 -0
  88. package/lib/fieldSelect/index.d.ts +48 -0
  89. package/lib/index.d.ts +31 -23
  90. package/lib/layout/index.d.ts +39 -0
  91. package/lib/metaField/index.d.ts +26 -0
  92. package/lib/refDialog/index.d.ts +33 -0
  93. package/lib/resource/index.d.ts +58 -0
  94. package/lib/resourceCard/index.d.ts +18 -0
  95. package/lib/services/metaReference/index.d.ts +1 -1
  96. package/package.json +1 -1
  97. package/esm2020/lib/field.mjs +0 -2325
  98. package/lib/field.d.ts +0 -292
@@ -0,0 +1,856 @@
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-2d0882f1.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-3907f4b1.mjs';
9
+ import { M as MetaContextService } from './vgip-meta-ui-index-3488da98.mjs';
10
+ import * as i1 from '@angular/common';
11
+ import { M as MetaField } from './vgip-meta-ui-index-e8e3b16a.mjs';
12
+ import { M as MetaModelPipe } from './vgip-meta-ui-metaModel.pipe-725f401c.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
+ }
34
+ MetaTrackerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: MetaTrackerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
35
+ MetaTrackerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: MetaTrackerService, providedIn: 'root' });
36
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", 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.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.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
+ this.searchResourceTypeMeta.options.push({ id: r.name, label: r.label || r.name });
217
+ });
218
+ }
219
+ else {
220
+ this.isSearchable = typeof (this.metaReference.searchable) === 'undefined' || this.metaReference.searchable;
221
+ this.searchResourceType = this.metaReference;
222
+ this.searchResourceTypesScope = this.metaReference.name || this.metaReference.resourceType;
223
+ this.isCreatable = this.metaReference.creatable;
224
+ }
225
+ this.buildPlaceholderLabel();
226
+ this.searchTextChanged.pipe(debounceTime(300), distinctUntilChanged()).subscribe((value) => {
227
+ this.searchText = value;
228
+ this.search();
229
+ });
230
+ const origValue = this.parent[this.meta.name];
231
+ // this.suggestions = this.meta.suggestions; // TODO filter by default type
232
+ // console.log('this.suggestions', this.suggestions);
233
+ Object.defineProperty(this.parent, this.meta.name, {
234
+ set: (value) => {
235
+ if (value === '') {
236
+ value = null;
237
+ }
238
+ if (this.multiple) {
239
+ if (value && value instanceof Array) {
240
+ for (const v of value) {
241
+ if (!this.model) {
242
+ this.model = [];
243
+ }
244
+ if (typeof (v) === 'string') {
245
+ this.model.push({
246
+ id: v,
247
+ label: v,
248
+ type: this.metaReference.name
249
+ });
250
+ }
251
+ }
252
+ }
253
+ else {
254
+ value = null; // protect when value from server is not array
255
+ }
256
+ }
257
+ else {
258
+ if (typeof (value) === 'string') {
259
+ value = {
260
+ id: value,
261
+ label: value,
262
+ type: this.metaReference.name
263
+ };
264
+ }
265
+ this.searchText = value ?
266
+ ((!value.label || value.label === ' ') ? `N/A (${value.type}#${value.id})` : value.label || value) :
267
+ '';
268
+ // if (this.isPolymorphic && this.model) { //TODO show or not?
269
+ // this.searchResourceType = this.metaReference.find((rt)=> {
270
+ // return rt.name === this.model.type;
271
+ // });
272
+ // }
273
+ }
274
+ this.model = value;
275
+ if (!this.multiple) {
276
+ this.value = this.modelToValue(value, this.meta.valueType || 'object');
277
+ this.buildExternalLink();
278
+ }
279
+ else {
280
+ this.value = !this.model ? this.model : this.model.map((m) => this.modelToValue(m, this.meta.valueType || 'object'));
281
+ }
282
+ this.meta.$optional = this.isOptional;
283
+ },
284
+ get: () => this.value,
285
+ enumerable: this.sendToServer,
286
+ configurable: true
287
+ });
288
+ if (origValue) {
289
+ this.parent[this.meta.name] = origValue;
290
+ }
291
+ if (!this.model && this.default) {
292
+ if (this.multiple) {
293
+ this.parent[this.meta.name] = [];
294
+ if (this.default.length) {
295
+ for (const dv of this.default) {
296
+ if ((dv.id || dv.value) && dv.type) {
297
+ const item = {
298
+ id: dv.id || dv.value,
299
+ label: dv.label || dv.id || dv.value,
300
+ type: dv.type
301
+ };
302
+ if (dv.externalLink) {
303
+ item.externalLink = dv.externalLink;
304
+ }
305
+ this.parent[this.meta.name].push(item);
306
+ }
307
+ }
308
+ }
309
+ if (!this.parent[this.meta.name].length) {
310
+ this.clear();
311
+ }
312
+ }
313
+ else {
314
+ if (this.default.id && this.default.label && this.default.type) {
315
+ setTimeout(() => {
316
+ const item = {
317
+ id: this.default.id || this.default.value,
318
+ label: this.default.label || this.default.id || this.default.value,
319
+ type: this.default.type,
320
+ smart: true
321
+ };
322
+ if (this.default.externalLink) {
323
+ item.externalLink = this.default.externalLink;
324
+ }
325
+ this.parent[this.meta.name] = item;
326
+ }, 0);
327
+ }
328
+ else {
329
+ console.warn('!!!default value is not valid format', this.meta);
330
+ }
331
+ }
332
+ }
333
+ if (typeof (this.meta.disabled) !== undefined) {
334
+ if (typeof (this.meta.disabled) === 'object') {
335
+ for (const p of Object.keys(this.meta.disabled)) {
336
+ const props = p.split('.');
337
+ if (typeof (this.parent[props[0]]) !== 'undefined') {
338
+ let val = this.parent;
339
+ for (const prop of props) {
340
+ val = val[prop];
341
+ if (!val) {
342
+ break;
343
+ }
344
+ }
345
+ if (val === this.meta.disabled[p]) {
346
+ this.logicalDisabled = true;
347
+ this.clear();
348
+ }
349
+ }
350
+ this.parentChangeSubject.subscribe((value) => {
351
+ if (value && value.hasOwnProperty(props[0])) {
352
+ let val = this.parent;
353
+ for (const prop of props) {
354
+ val = val[prop];
355
+ if (!val) {
356
+ break;
357
+ }
358
+ }
359
+ if (val === this.meta.disabled[p]) {
360
+ this.logicalDisabled = true;
361
+ this.clear();
362
+ }
363
+ else {
364
+ delete this.logicalDisabled;
365
+ }
366
+ }
367
+ });
368
+ }
369
+ }
370
+ }
371
+ if (this.meta.auto && this.meta.auto.search) {
372
+ const searchParams = this.meta.auto.search.params;
373
+ if (searchParams) {
374
+ for (const par of Object.keys(searchParams)) {
375
+ const props = searchParams[par].split('.');
376
+ const field = props[0];
377
+ const prop = props[1];
378
+ let parValue = this.parent[field];
379
+ if (parValue) {
380
+ if (prop) {
381
+ parValue = parValue[prop];
382
+ }
383
+ if (parValue) {
384
+ const params = {};
385
+ params[par] = parValue;
386
+ this.searchAutoSuggestions(params);
387
+ }
388
+ }
389
+ this.parentChangeSubject.subscribe((value) => {
390
+ if (value && value.hasOwnProperty(field)) {
391
+ if (value[field]) {
392
+ if (prop) {
393
+ value[field] = value[field][prop];
394
+ }
395
+ const params = {};
396
+ params[par] = value[field];
397
+ this.searchAutoSuggestions(params);
398
+ }
399
+ }
400
+ });
401
+ }
402
+ }
403
+ }
404
+ }
405
+ clearSearchResourceType() {
406
+ this.searchResourceType = {};
407
+ this.onSearchResourceTypeChanged();
408
+ }
409
+ onSearchResourceTypeChanged(resourceType) {
410
+ if (!resourceType || !resourceType.id) {
411
+ this.searchResourceType.resourceType = null;
412
+ this.searchResourceTypesScope = (this.metaReference || []).map(rt => rt.name).join(',');
413
+ }
414
+ else {
415
+ this.searchResourceType.resourceType = resourceType.id;
416
+ this.searchResourceTypesScope = resourceType.id;
417
+ }
418
+ this.buildPlaceholderLabel();
419
+ this.focus();
420
+ if (!this.model && !this.searchText) { // filter suggestions by type
421
+ this.filteredSuggestions = !resourceType ? (this.meta.suggestions || []) : (this.meta.suggestions || []).filter((s) => s.type === resourceType.id);
422
+ }
423
+ else { // regular search (return scoped results)
424
+ if (!this.model) {
425
+ this.search();
426
+ }
427
+ else if (this.searchResults && resourceType) {
428
+ this.searchResults = this.searchResults.filter((s) => s.type === resourceType.id);
429
+ }
430
+ }
431
+ delete this.searchError;
432
+ }
433
+ onSearchTextChanged(value) {
434
+ this.searchTextChanged.next(value);
435
+ }
436
+ search() {
437
+ this.searching = true;
438
+ // this.activeSuggestionIndex;
439
+ if (!this.searchText || this.searchText.length < 2) {
440
+ this.searching = false;
441
+ delete this.searchResults;
442
+ return;
443
+ }
444
+ const showSearchResults = (results) => {
445
+ this.searching = false;
446
+ delete this.searchError;
447
+ delete this.activeSuggestionIndex;
448
+ if (!results || !(results instanceof Array)) {
449
+ results = [];
450
+ }
451
+ if (this.meta.acceptNew && this.meta.acceptNew.type && this.meta.acceptNew.pattern) {
452
+ const regex = new RegExp(this.meta.acceptNew.pattern);
453
+ if (regex.test(this.searchText)) {
454
+ results.unshift({ id: null, label: this.searchText, type: this.meta.acceptNew.type });
455
+ }
456
+ }
457
+ this.searchResults = results.map((r) => {
458
+ return { id: r.id, label: r.label, type: r.type || r.resourceType || this.searchResourceType.name, externalLink: r.externalLink };
459
+ });
460
+ if (!/Vlt-dropdown--expanded/.test(this.dropdown.className)) {
461
+ this.showDropdown();
462
+ }
463
+ };
464
+ if (this.meta.search) {
465
+ const searchParams = this.meta.search.params || {};
466
+ let searchUrl = `/fields/${this.meta.name}/search`;
467
+ if (this.meta.search.url) {
468
+ searchUrl = this.meta.search.url.replace(/\${\s*([\w\.]+)\s*}/g, (match, key) => {
469
+ if (searchParams.hasOwnProperty(key)) {
470
+ const props = searchParams[key].split('.');
471
+ const field = props[0];
472
+ const prop = props[1];
473
+ delete searchParams[key]; // if it is URL param, remove it as query param
474
+ let parValue = this.parent[field];
475
+ if (parValue) {
476
+ if (prop) {
477
+ parValue = parValue[prop];
478
+ }
479
+ if (parValue) {
480
+ return parValue;
481
+ }
482
+ }
483
+ }
484
+ return 'undefined';
485
+ });
486
+ }
487
+ for (const p of Object.keys(searchParams)) {
488
+ searchUrl += `${searchUrl.indexOf('?') === -1 ? '?' : '&'}${encodeURIComponent(p)}=${encodeURIComponent(searchParams[p])}`;
489
+ }
490
+ searchUrl += `${searchUrl.indexOf('?') === -1 ? '?' : '&'}q=${encodeURIComponent(this.searchText)}`;
491
+ this.searching = true;
492
+ this.resourceService.getByPath(searchUrl).subscribe((results) => {
493
+ showSearchResults(results);
494
+ }, (error) => {
495
+ delete this.searching;
496
+ this.searchResults = [];
497
+ this.searchError = error.error ? error.error.message || error.error : error.message || error;
498
+ if (!/Vlt-dropdown--expanded/.test(this.dropdown.className)) {
499
+ this.showDropdown();
500
+ }
501
+ });
502
+ }
503
+ else {
504
+ if (!this.vr) {
505
+ this.vr = this.metaResource.new({
506
+ integrationCode: this.integrationCode,
507
+ resourceType: null
508
+ });
509
+ }
510
+ this.vr.searchIntegration(this.searchText, this.searchResourceType.name || this.searchResourceTypesScope).subscribe((results) => {
511
+ showSearchResults(results);
512
+ }, (error) => {
513
+ this.searching = false;
514
+ this.searchResults = [];
515
+ this.searchError = error.error ? error.error.message || error.error : error.message || error;
516
+ if (!/Vlt-dropdown--expanded/.test(this.dropdown.className)) {
517
+ this.showDropdown();
518
+ }
519
+ });
520
+ }
521
+ }
522
+ onActivated(ev) {
523
+ // ev.preventDefault();
524
+ // ev.stopPropagation();
525
+ this.input = ev.srcElement;
526
+ if (!this.dropdown) {
527
+ // this.dropdown = ev.srcElement.parentNode.parentNode;
528
+ this.dropdown = this.elementRef.nativeElement.querySelector('.dropdown-wrapper');
529
+ }
530
+ this.showDropdown();
531
+ }
532
+ onBlur(ev) {
533
+ let internalControl = false;
534
+ if (ev.relatedTarget) {
535
+ if (!this.elementRef.nativeElement.contains(ev.relatedTarget)) {
536
+ this.dismissDropdown();
537
+ }
538
+ else {
539
+ internalControl = true;
540
+ }
541
+ }
542
+ if (this.keyListenerActive && !internalControl) {
543
+ this.input.removeEventListener('keydown', this.keydown);
544
+ setTimeout(() => {
545
+ if (!this.keyListenerActive) {
546
+ document.removeEventListener('click', this.clickout);
547
+ }
548
+ }, 400);
549
+ delete this.keyListenerActive;
550
+ }
551
+ }
552
+ removeSelection() {
553
+ if (this.model && !this.suggestions.find((s) => (s.id === this.model.id && s.type === this.model.type))) {
554
+ this.smartSuggestions.push({
555
+ id: this.model.id,
556
+ label: this.model.label,
557
+ type: this.model.type,
558
+ smart: true
559
+ });
560
+ }
561
+ this.metaTracker.emit(this.buildTrackEvent('REMOVE'));
562
+ this.clear();
563
+ }
564
+ onSuggestionSelect(ev, suggestion) {
565
+ if (!suggestion) {
566
+ return;
567
+ }
568
+ ev.preventDefault();
569
+ ev.stopPropagation();
570
+ this.focus();
571
+ this.metaTracker.emit(this.buildTrackEvent('SELECT'));
572
+ if (this.multiple) {
573
+ if (!this.model) {
574
+ this.model = [];
575
+ }
576
+ let existingEntry;
577
+ for (const entry of this.model) {
578
+ if (suggestion.id && (entry.id === suggestion.id)) {
579
+ existingEntry = entry;
580
+ break;
581
+ }
582
+ else if (suggestion.label === entry.label) { // create new (google emails)
583
+ existingEntry = entry;
584
+ break;
585
+ }
586
+ }
587
+ if (!existingEntry) {
588
+ this.model.push(suggestion);
589
+ }
590
+ this.onModelChange(this.model);
591
+ delete this.searchText;
592
+ this.searchTextChanged.next();
593
+ }
594
+ else {
595
+ this.model = suggestion;
596
+ this.externalLink = suggestion.externalLink;
597
+ this.onModelChange(suggestion);
598
+ this.searchText = suggestion.label;
599
+ this.activeSuggestionIndex = (this.searchResults || this.suggestions).indexOf(suggestion);
600
+ }
601
+ this.dismissDropdown();
602
+ // if (this.isPolymorphic) {
603
+ // this.searchResourceType = this.metaReference.find((rt)=> {
604
+ // return rt.name === suggestion.type;
605
+ // });
606
+ // }
607
+ }
608
+ showDropdown() {
609
+ this.dropdownVisible = true;
610
+ this.dropdown.classList.add('Vlt-dropdown--expanded');
611
+ if (!this.keyListenerActive) {
612
+ this.input.addEventListener('keydown', this.keydown);
613
+ setTimeout(() => {
614
+ document.addEventListener('click', this.clickout);
615
+ }, 200);
616
+ this.keyListenerActive = true;
617
+ }
618
+ if (typeof (this.activeSuggestionIndex) === 'undefined') {
619
+ if (this.model && (this.searchResults || this.suggestions)) {
620
+ for (let suggestionIndex = 0; suggestionIndex < (this.searchResults || this.suggestions).length; suggestionIndex++) {
621
+ const item = (this.searchResults || this.suggestions)[suggestionIndex];
622
+ if (this.model.id === item.id && this.model.type === item.type) {
623
+ this.activeSuggestionIndex = suggestionIndex;
624
+ break;
625
+ }
626
+ }
627
+ }
628
+ }
629
+ this.ensureDropdownIsVisible();
630
+ }
631
+ dismissDropdown(event) {
632
+ this.dropdownVisible = false;
633
+ if (event) {
634
+ this.focus();
635
+ }
636
+ if (this.dropdown) {
637
+ this.dropdown.classList.remove('Vlt-dropdown--expanded');
638
+ }
639
+ }
640
+ clear() {
641
+ this.prevModel = this.model;
642
+ delete this.searchText;
643
+ delete this.searchResults;
644
+ delete this.model;
645
+ delete this.activeSuggestionIndex;
646
+ this.onModelChange(this.model);
647
+ this.onSearchTextChanged(this.searchText);
648
+ this.focus();
649
+ }
650
+ revert() {
651
+ this.model = this.prevModel;
652
+ delete this.prevModel;
653
+ this.onModelChange(this.model);
654
+ this.focus();
655
+ }
656
+ remove(ev, item) {
657
+ ev.preventDefault();
658
+ ev.stopPropagation();
659
+ const optionIndex = this.model.indexOf(item);
660
+ if (optionIndex !== -1) {
661
+ this.model.splice(optionIndex, 1);
662
+ if (!this.model.length) {
663
+ delete this.model;
664
+ delete this.value;
665
+ }
666
+ this.onModelChange(this.model);
667
+ }
668
+ }
669
+ openResource(model) {
670
+ this.keyListenerActive = true; // suppress dropdown in this case
671
+ setTimeout(() => {
672
+ this.dismissDropdown();
673
+ });
674
+ const refDialogComponent = this.viewContainerRef.createComponent(MetaRefDialog);
675
+ this.metaTracker.emit(this.buildTrackEvent(model ? 'EDIT' : 'NEW'));
676
+ let theme = this.elementRef.nativeElement.dataset.theme;
677
+ if (!theme || theme === 'inherit') {
678
+ let parentComponent = this.elementRef.nativeElement.closest('vgip-meta-layout');
679
+ if (parentComponent) {
680
+ theme = parentComponent.dataset.theme;
681
+ }
682
+ if (!theme || theme === 'inherit') {
683
+ parentComponent = this.elementRef.nativeElement.closest('vgip-meta-resource');
684
+ if (parentComponent) {
685
+ theme = parentComponent.dataset.theme;
686
+ }
687
+ }
688
+ }
689
+ this.referenceService.openDialog(refDialogComponent, this.metaResource, this.integrationCode, this.metaReference, model, null, this.searchResourceType.resourceType, theme).subscribe((result) => {
690
+ if (result) {
691
+ this.parent[this.meta.name] = result;
692
+ this.onChange.emit(result);
693
+ const existingSuggestion = (this.meta.suggestions || []).find((s) => (s.id === result.id && s.type === result.type));
694
+ if (existingSuggestion) {
695
+ existingSuggestion.label = result.label;
696
+ }
697
+ else {
698
+ if (!this.meta.suggestions) {
699
+ this.meta.suggestions = [];
700
+ }
701
+ this.meta.suggestions.unshift(result);
702
+ }
703
+ this.metaTracker.emit(this.buildTrackEvent(model ? 'UPDATE' : 'CREATE', result.type || result.resourceType));
704
+ }
705
+ else {
706
+ this.metaTracker.emit(this.buildTrackEvent(model ? 'CANCEL_EDIT' : 'CANCEL_UPDATE'));
707
+ }
708
+ });
709
+ }
710
+ ensureDropdownIsVisible() {
711
+ setTimeout(() => {
712
+ const holder = this.dropdown.closest('.Vlt-card__content');
713
+ if (holder) {
714
+ const el = this.elementRef.nativeElement.querySelector('.Vlt-dropdown__panel');
715
+ const elRect = el.getBoundingClientRect();
716
+ const holderRect = holder.getBoundingClientRect();
717
+ if (holderRect.top + holderRect.height < elRect.top + elRect.height) {
718
+ el.scrollIntoView({ block: 'end' });
719
+ }
720
+ }
721
+ }, 400);
722
+ }
723
+ ensureDropdownOptionIsVisible() {
724
+ if (!this.dropdownScrollContainer) {
725
+ this.dropdownScrollContainer = this.dropdown.querySelector('.Vlt-dropdown__scroll');
726
+ }
727
+ if (this.dropdownScrollContainer && typeof (this.activeSuggestionIndex) === 'number') {
728
+ const scrollTop = 44 * this.activeSuggestionIndex;
729
+ const scrollBottom = 44 * (this.activeSuggestionIndex - 7);
730
+ if (scrollTop < this.dropdownScrollContainer.scrollTop) {
731
+ this.dropdownScrollContainer.scrollTop = scrollTop;
732
+ }
733
+ else if (scrollBottom > this.dropdownScrollContainer.scrollTop) {
734
+ this.dropdownScrollContainer.scrollTop = scrollBottom;
735
+ }
736
+ }
737
+ }
738
+ buildTrackEvent(action, value) {
739
+ const e = {
740
+ integration: this.integrationCode,
741
+ resource: this.model ? (this.model.type || this.model.resourceType) : this.searchResourceType.resourceType,
742
+ field: this.meta.name,
743
+ action
744
+ };
745
+ if (this.meta.$isContactable) {
746
+ e.isContactable = true;
747
+ }
748
+ if (typeof (value) !== 'undefined') {
749
+ e.value = value;
750
+ }
751
+ return e;
752
+ }
753
+ buildPlaceholderLabel() {
754
+ this.placeHolderLabel = this.meta.label;
755
+ if (this.multiple && !this.isPolymorphic) {
756
+ this.placeHolderLabel = '+Add ';
757
+ }
758
+ else {
759
+ this.placeHolderLabel = (this.isSearchable && (this.multiple || !this.isPolymorphic)) ? 'Search ' : '';
760
+ }
761
+ this.placeHolderLabel += this.searchResourceType.resourceType ? this.searchResourceType.resourceType : this.searchResourceTypesScope;
762
+ }
763
+ buildExternalLink() {
764
+ if (this.model) {
765
+ if (this.model.externalLink) {
766
+ this.externalLink = this.model.externalLink;
767
+ }
768
+ else if (this.metaContext.profiles[this.integrationCode.toUpperCase()]) {
769
+ delete this.externalLink;
770
+ this.metaMsgService.sendMessage(this.integrationCode.toUpperCase(), {
771
+ action: 'buildExternalLink',
772
+ integrationCode: this.integrationCode,
773
+ ref: this.model,
774
+ profile: this.metaContext.profiles[this.integrationCode.toUpperCase()]
775
+ }, (response) => {
776
+ if (!response.error) {
777
+ this.externalLink = response.externalLink;
778
+ }
779
+ else {
780
+ console.warn('No external link support for', this.integrationCode, this.model.resourceType || this.model.type);
781
+ }
782
+ });
783
+ }
784
+ }
785
+ else {
786
+ delete this.externalLink;
787
+ }
788
+ }
789
+ searchAutoSuggestions(params) {
790
+ let searchUrl = `/suggestions/${this.meta.name}/search`;
791
+ if (this.meta.auto && this.meta.auto.search) {
792
+ if (this.meta.auto.search.url) {
793
+ searchUrl = this.meta.auto.search.url.replace(/\${\s*([\w\.]+)\s*}/g, (match, key) => {
794
+ if (params.hasOwnProperty(key)) {
795
+ const val = params[key];
796
+ delete params[key];
797
+ return val;
798
+ }
799
+ return '';
800
+ });
801
+ }
802
+ for (const p of Object.keys(params)) {
803
+ searchUrl += `${searchUrl.indexOf('?') === -1 ? '?' : '&'}${encodeURIComponent(p)}=${encodeURIComponent(params[p])}`;
804
+ }
805
+ this.searching = true;
806
+ this.resourceService.getByPath(searchUrl).subscribe((result) => {
807
+ delete this.searching;
808
+ if (result) {
809
+ let suggestions;
810
+ suggestions = result;
811
+ if (this.meta.auto.search.extract) {
812
+ suggestions = result[this.meta.auto.search.extract];
813
+ }
814
+ if (suggestions instanceof Array !== true) {
815
+ suggestions = [suggestions];
816
+ }
817
+ const asyncSuggestions = [];
818
+ suggestions.forEach((s) => {
819
+ if (s && s.id && s.type) { // TOOD check the type is acceptable
820
+ asyncSuggestions.push({
821
+ id: s.id,
822
+ label: s.label || `${s.type}#${s.id}`,
823
+ type: s.type
824
+ });
825
+ }
826
+ });
827
+ if (asyncSuggestions.length) {
828
+ if (asyncSuggestions.length === 1) {
829
+ this.parent[this.meta.name] = asyncSuggestions[0];
830
+ }
831
+ else {
832
+ delete this.asyncSuggestions;
833
+ }
834
+ }
835
+ this.asyncSuggestions = asyncSuggestions;
836
+ }
837
+ }, (err) => {
838
+ delete this.searching;
839
+ });
840
+ }
841
+ }
842
+ }
843
+ FieldReference.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: FieldReference, deps: [{ token: MetaReferenceService }, { token: MetaResourceService }, { token: MetaMsgService }, { token: MetaContextService }, { token: MetaTrackerService }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
844
+ FieldReference.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.0", 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'>{{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;'><use attr.xlink:href=\"volta/volta-brand-icons.svg#{{integrationIcon}}\"/></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</div>\n<div *ngIf='!preview' class=\"meta-field-reference Vlt-form__element Vlt-form__element--big\" [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%;'>\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}\" 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 <div [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 </div>\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 <div [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 </div>\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\" *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' (onChange)='onSearchResourceTypeChanged($event)' (onLeave)='onBlur($event)' [integrationCode]='integrationCode' theme='inherit'></vgip-meta-field>\n <svg class='Vlt-icon Vlt-grey Vlt-icon--smaller visible-mobile mobile-icon' style='position: absolute; top: 15px; left: 14px; pointer-events: none;'>\n <use xlink:href=\"volta/volta-icons.svg#Vlt-icon-menu\"/>\n </svg>\n <label class='mobile-label hidden-mobile hidden-desktop'>Search</label>\n </div>\n </div>\n <div *ngIf='!(isPolymorphic && showTypes && (multiple || !model || dropdownVisible))'><!-- required by css --></div>\n <div class=\"Vlt-composite__wrapper Vlt-input\" style='overflow: hidden;' [ngClass]=\"{ 'has-append-button': hasAppendButton && !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'><use attr.xlink:href=\"volta/volta-icons.svg#Vlt-icon-{{ multiple ? 'stack' : 'search'}}\"/></svg>\n <svg *ngIf='!isSearchable || (model && !multiple)' [ngStyle]=\"{fill: integrationIcon === 'Brand-icon-vonage' ? 'var(--vgip-meta-input-color)' : ''}\"><use attr.xlink:href=\"volta/volta-brand-icons.svg#{{integrationIcon}}\"/></svg>\n </div>\n <div *ngIf='suggestions.length' class=\"Vlt-badge Vlt-badge--small Vlt-badge--purple\" style='padding: 0px 4px; position: absolute; top: 26px; left: 4px; pointer-events: none; min-width: 14px;'>{{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>\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>\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 <div *ngIf='model && !multiple' class=\"Vlt-composite__append--icon\" (click)='removeSelection()'>\n <div class=\"Vlt-composite__icon\">\n <svg><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-cross\"/></svg>\n </div>\n </div>\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><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-open\"/></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' (click)='openResource()' class=\"Vlt-btn Vlt-btn--white Vlt-btn--icon\" aria-label='Add new'>\n <svg><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-plus\"/></svg>\n </button>\n <button (focus)='onActivated($event)' (blur)='onBlur($event)' type='button' *ngIf='model && !multiple' (click)='openResource(model)' class=\"Vlt-btn Vlt-btn--white Vlt-btn--icon\" aria-label='Edit'>\n <svg><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-edit\"/></svg>\n </button>\n </div>\n </div>\n <small *ngIf='f.invalid && ((f | metaModel)._parent.submitted || ((ft | metaModel).touched && keyListenerActive))' 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)}.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", "preview", "theme"], outputs: ["onChange", "onLeave"] }, { kind: "pipe", type: MetaModelPipe, name: "metaModel" }], viewProviders: [{ provide: ControlContainer, useExisting: NgForm }] });
845
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: FieldReference, decorators: [{
846
+ type: Component,
847
+ 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'>{{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;'><use attr.xlink:href=\"volta/volta-brand-icons.svg#{{integrationIcon}}\"/></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</div>\n<div *ngIf='!preview' class=\"meta-field-reference Vlt-form__element Vlt-form__element--big\" [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%;'>\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}\" 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 <div [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 </div>\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 <div [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 </div>\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\" *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' (onChange)='onSearchResourceTypeChanged($event)' (onLeave)='onBlur($event)' [integrationCode]='integrationCode' theme='inherit'></vgip-meta-field>\n <svg class='Vlt-icon Vlt-grey Vlt-icon--smaller visible-mobile mobile-icon' style='position: absolute; top: 15px; left: 14px; pointer-events: none;'>\n <use xlink:href=\"volta/volta-icons.svg#Vlt-icon-menu\"/>\n </svg>\n <label class='mobile-label hidden-mobile hidden-desktop'>Search</label>\n </div>\n </div>\n <div *ngIf='!(isPolymorphic && showTypes && (multiple || !model || dropdownVisible))'><!-- required by css --></div>\n <div class=\"Vlt-composite__wrapper Vlt-input\" style='overflow: hidden;' [ngClass]=\"{ 'has-append-button': hasAppendButton && !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'><use attr.xlink:href=\"volta/volta-icons.svg#Vlt-icon-{{ multiple ? 'stack' : 'search'}}\"/></svg>\n <svg *ngIf='!isSearchable || (model && !multiple)' [ngStyle]=\"{fill: integrationIcon === 'Brand-icon-vonage' ? 'var(--vgip-meta-input-color)' : ''}\"><use attr.xlink:href=\"volta/volta-brand-icons.svg#{{integrationIcon}}\"/></svg>\n </div>\n <div *ngIf='suggestions.length' class=\"Vlt-badge Vlt-badge--small Vlt-badge--purple\" style='padding: 0px 4px; position: absolute; top: 26px; left: 4px; pointer-events: none; min-width: 14px;'>{{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>\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>\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 <div *ngIf='model && !multiple' class=\"Vlt-composite__append--icon\" (click)='removeSelection()'>\n <div class=\"Vlt-composite__icon\">\n <svg><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-cross\"/></svg>\n </div>\n </div>\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><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-open\"/></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' (click)='openResource()' class=\"Vlt-btn Vlt-btn--white Vlt-btn--icon\" aria-label='Add new'>\n <svg><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-plus\"/></svg>\n </button>\n <button (focus)='onActivated($event)' (blur)='onBlur($event)' type='button' *ngIf='model && !multiple' (click)='openResource(model)' class=\"Vlt-btn Vlt-btn--white Vlt-btn--icon\" aria-label='Edit'>\n <svg><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-edit\"/></svg>\n </button>\n </div>\n </div>\n <small *ngIf='f.invalid && ((f | metaModel)._parent.submitted || ((ft | metaModel).touched && keyListenerActive))' 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)}.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"] }]
848
+ }], ctorParameters: function () { return [{ type: MetaReferenceService }, { type: MetaResourceService }, { type: MetaMsgService }, { type: MetaContextService }, { type: MetaTrackerService }, { type: i0.ViewContainerRef }]; } });
849
+
850
+ var index = /*#__PURE__*/Object.freeze({
851
+ __proto__: null,
852
+ FieldReference: FieldReference
853
+ });
854
+
855
+ export { FieldReference as F, MetaTrackerService as M, index as i };
856
+ //# sourceMappingURL=vgip-meta-ui-index-3d8c2fcd.mjs.map