@vgip/meta-ui 2.0.0 → 2.1.0

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