@vgip/meta-ui 1.7.2 → 1.7.4

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