@vgip/meta-ui 1.6.8 → 1.7.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 (105) hide show
  1. package/esm2020/lib/common/utils/smartProp.mjs +15 -1
  2. package/esm2020/lib/fieldAbstract.mjs +4 -4
  3. package/esm2020/lib/fieldBoolean/index.mjs +4 -5
  4. package/esm2020/lib/fieldDatetime/index.mjs +3 -3
  5. package/esm2020/lib/fieldInput/index.mjs +3 -3
  6. package/esm2020/lib/fieldRadio/index.mjs +3 -3
  7. package/esm2020/lib/fieldReference/index.mjs +3 -3
  8. package/esm2020/lib/fieldRichtext/index.mjs +3 -3
  9. package/esm2020/lib/fieldSelect/index.mjs +6 -4
  10. package/esm2020/lib/fieldText/index.mjs +3 -3
  11. package/fesm2015/{vgip-meta-ui-fieldAbstract-5d159575.mjs → vgip-meta-ui-fieldAbstract-f7d80db6.mjs} +17 -3
  12. package/fesm2015/vgip-meta-ui-fieldAbstract-f7d80db6.mjs.map +1 -0
  13. package/fesm2015/vgip-meta-ui-index-1d2b4c69.mjs +68 -0
  14. package/fesm2015/vgip-meta-ui-index-1d2b4c69.mjs.map +1 -0
  15. package/fesm2015/{vgip-meta-ui-index-215dcd7f.mjs → vgip-meta-ui-index-2737c81e.mjs} +3 -3
  16. package/fesm2015/{vgip-meta-ui-index-215dcd7f.mjs.map → vgip-meta-ui-index-2737c81e.mjs.map} +1 -1
  17. package/{fesm2020/vgip-meta-ui-index-6055a61f.mjs → fesm2015/vgip-meta-ui-index-2b20afc8.mjs} +4 -4
  18. package/fesm2015/vgip-meta-ui-index-2b20afc8.mjs.map +1 -0
  19. package/fesm2015/{vgip-meta-ui-index-e1a8b144.mjs → vgip-meta-ui-index-3eefa50a.mjs} +3 -3
  20. package/fesm2015/{vgip-meta-ui-index-e1a8b144.mjs.map → vgip-meta-ui-index-3eefa50a.mjs.map} +1 -1
  21. package/fesm2015/{vgip-meta-ui-index-b1f2dc7e.mjs → vgip-meta-ui-index-476b6cb7.mjs} +2 -2
  22. package/fesm2015/{vgip-meta-ui-index-b1f2dc7e.mjs.map → vgip-meta-ui-index-476b6cb7.mjs.map} +1 -1
  23. package/fesm2015/{vgip-meta-ui-index-241d05f3.mjs → vgip-meta-ui-index-4b8d731c.mjs} +14 -14
  24. package/fesm2015/{vgip-meta-ui-index-241d05f3.mjs.map → vgip-meta-ui-index-4b8d731c.mjs.map} +1 -1
  25. package/fesm2015/{vgip-meta-ui-index-6fa7cbd7.mjs → vgip-meta-ui-index-4ecdd48a.mjs} +3 -3
  26. package/fesm2015/{vgip-meta-ui-index-6fa7cbd7.mjs.map → vgip-meta-ui-index-4ecdd48a.mjs.map} +1 -1
  27. package/fesm2015/vgip-meta-ui-index-62be0e3e.mjs +858 -0
  28. package/fesm2015/vgip-meta-ui-index-62be0e3e.mjs.map +1 -0
  29. package/fesm2015/vgip-meta-ui-index-640f8e62.mjs +95 -0
  30. package/fesm2015/vgip-meta-ui-index-640f8e62.mjs.map +1 -0
  31. package/fesm2015/vgip-meta-ui-index-695384af.mjs +88 -0
  32. package/fesm2015/vgip-meta-ui-index-695384af.mjs.map +1 -0
  33. package/{fesm2020/vgip-meta-ui-index-bcc42b36.mjs → fesm2015/vgip-meta-ui-index-81aa79dc.mjs} +4 -4
  34. package/fesm2015/vgip-meta-ui-index-81aa79dc.mjs.map +1 -0
  35. package/fesm2015/{vgip-meta-ui-index-eb92e6e3.mjs → vgip-meta-ui-index-87041aad.mjs} +2 -2
  36. package/fesm2015/{vgip-meta-ui-index-eb92e6e3.mjs.map → vgip-meta-ui-index-87041aad.mjs.map} +1 -1
  37. package/fesm2015/vgip-meta-ui-index-a76ba482.mjs +498 -0
  38. package/fesm2015/vgip-meta-ui-index-a76ba482.mjs.map +1 -0
  39. package/fesm2015/vgip-meta-ui-index-bf5b6c0f.mjs +61 -0
  40. package/fesm2015/vgip-meta-ui-index-bf5b6c0f.mjs.map +1 -0
  41. package/fesm2015/vgip-meta-ui.mjs +17 -17
  42. package/fesm2020/{vgip-meta-ui-fieldAbstract-5d159575.mjs → vgip-meta-ui-fieldAbstract-f7d80db6.mjs} +17 -3
  43. package/fesm2020/vgip-meta-ui-fieldAbstract-f7d80db6.mjs.map +1 -0
  44. package/fesm2020/vgip-meta-ui-index-1d2b4c69.mjs +68 -0
  45. package/fesm2020/vgip-meta-ui-index-1d2b4c69.mjs.map +1 -0
  46. package/{fesm2015/vgip-meta-ui-index-6055a61f.mjs → fesm2020/vgip-meta-ui-index-2b20afc8.mjs} +4 -4
  47. package/fesm2020/vgip-meta-ui-index-2b20afc8.mjs.map +1 -0
  48. package/fesm2020/{vgip-meta-ui-index-4054fc59.mjs → vgip-meta-ui-index-301b28cd.mjs} +14 -14
  49. package/fesm2020/{vgip-meta-ui-index-4054fc59.mjs.map → vgip-meta-ui-index-301b28cd.mjs.map} +1 -1
  50. package/fesm2020/{vgip-meta-ui-index-b1f2dc7e.mjs → vgip-meta-ui-index-476b6cb7.mjs} +2 -2
  51. package/fesm2020/{vgip-meta-ui-index-b1f2dc7e.mjs.map → vgip-meta-ui-index-476b6cb7.mjs.map} +1 -1
  52. package/fesm2020/vgip-meta-ui-index-4c4a4daf.mjs +858 -0
  53. package/fesm2020/vgip-meta-ui-index-4c4a4daf.mjs.map +1 -0
  54. package/fesm2020/{vgip-meta-ui-index-44b1b402.mjs → vgip-meta-ui-index-4fcefde0.mjs} +3 -3
  55. package/fesm2020/{vgip-meta-ui-index-44b1b402.mjs.map → vgip-meta-ui-index-4fcefde0.mjs.map} +1 -1
  56. package/fesm2020/vgip-meta-ui-index-640f8e62.mjs +95 -0
  57. package/fesm2020/vgip-meta-ui-index-640f8e62.mjs.map +1 -0
  58. package/fesm2020/vgip-meta-ui-index-695384af.mjs +88 -0
  59. package/fesm2020/vgip-meta-ui-index-695384af.mjs.map +1 -0
  60. package/{fesm2015/vgip-meta-ui-index-bcc42b36.mjs → fesm2020/vgip-meta-ui-index-81aa79dc.mjs} +4 -4
  61. package/fesm2020/vgip-meta-ui-index-81aa79dc.mjs.map +1 -0
  62. package/fesm2020/{vgip-meta-ui-index-eb92e6e3.mjs → vgip-meta-ui-index-87041aad.mjs} +2 -2
  63. package/fesm2020/{vgip-meta-ui-index-eb92e6e3.mjs.map → vgip-meta-ui-index-87041aad.mjs.map} +1 -1
  64. package/fesm2020/vgip-meta-ui-index-aee28354.mjs +497 -0
  65. package/fesm2020/vgip-meta-ui-index-aee28354.mjs.map +1 -0
  66. package/fesm2020/{vgip-meta-ui-index-eb68eace.mjs → vgip-meta-ui-index-b92a559b.mjs} +3 -3
  67. package/fesm2020/{vgip-meta-ui-index-eb68eace.mjs.map → vgip-meta-ui-index-b92a559b.mjs.map} +1 -1
  68. package/fesm2020/vgip-meta-ui-index-bf5b6c0f.mjs +61 -0
  69. package/fesm2020/vgip-meta-ui-index-bf5b6c0f.mjs.map +1 -0
  70. package/fesm2020/{vgip-meta-ui-index-8394e00c.mjs → vgip-meta-ui-index-f7370960.mjs} +3 -3
  71. package/fesm2020/{vgip-meta-ui-index-8394e00c.mjs.map → vgip-meta-ui-index-f7370960.mjs.map} +1 -1
  72. package/fesm2020/vgip-meta-ui.mjs +17 -17
  73. package/lib/common/utils/smartProp.d.ts +1 -0
  74. package/lib/fieldBoolean/index.d.ts +1 -1
  75. package/package.json +1 -1
  76. package/fesm2015/vgip-meta-ui-fieldAbstract-5d159575.mjs.map +0 -1
  77. package/fesm2015/vgip-meta-ui-index-50b9fec5.mjs +0 -95
  78. package/fesm2015/vgip-meta-ui-index-50b9fec5.mjs.map +0 -1
  79. package/fesm2015/vgip-meta-ui-index-6055a61f.mjs.map +0 -1
  80. package/fesm2015/vgip-meta-ui-index-9a626253.mjs +0 -62
  81. package/fesm2015/vgip-meta-ui-index-9a626253.mjs.map +0 -1
  82. package/fesm2015/vgip-meta-ui-index-a03a7056.mjs +0 -88
  83. package/fesm2015/vgip-meta-ui-index-a03a7056.mjs.map +0 -1
  84. package/fesm2015/vgip-meta-ui-index-a9800f48.mjs +0 -858
  85. package/fesm2015/vgip-meta-ui-index-a9800f48.mjs.map +0 -1
  86. package/fesm2015/vgip-meta-ui-index-bcc42b36.mjs.map +0 -1
  87. package/fesm2015/vgip-meta-ui-index-dc3b86fd.mjs +0 -68
  88. package/fesm2015/vgip-meta-ui-index-dc3b86fd.mjs.map +0 -1
  89. package/fesm2015/vgip-meta-ui-index-ff52eb27.mjs +0 -496
  90. package/fesm2015/vgip-meta-ui-index-ff52eb27.mjs.map +0 -1
  91. package/fesm2020/vgip-meta-ui-fieldAbstract-5d159575.mjs.map +0 -1
  92. package/fesm2020/vgip-meta-ui-index-50b9fec5.mjs +0 -95
  93. package/fesm2020/vgip-meta-ui-index-50b9fec5.mjs.map +0 -1
  94. package/fesm2020/vgip-meta-ui-index-6055a61f.mjs.map +0 -1
  95. package/fesm2020/vgip-meta-ui-index-97a4fa1f.mjs +0 -858
  96. package/fesm2020/vgip-meta-ui-index-97a4fa1f.mjs.map +0 -1
  97. package/fesm2020/vgip-meta-ui-index-9a626253.mjs +0 -62
  98. package/fesm2020/vgip-meta-ui-index-9a626253.mjs.map +0 -1
  99. package/fesm2020/vgip-meta-ui-index-a03a7056.mjs +0 -88
  100. package/fesm2020/vgip-meta-ui-index-a03a7056.mjs.map +0 -1
  101. package/fesm2020/vgip-meta-ui-index-a945dd34.mjs +0 -495
  102. package/fesm2020/vgip-meta-ui-index-a945dd34.mjs.map +0 -1
  103. package/fesm2020/vgip-meta-ui-index-bcc42b36.mjs.map +0 -1
  104. package/fesm2020/vgip-meta-ui-index-dc3b86fd.mjs +0 -68
  105. package/fesm2020/vgip-meta-ui-index-dc3b86fd.mjs.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Component } from '@angular/core';
3
- import { F as FieldAbstract } from './vgip-meta-ui-fieldAbstract-5d159575.mjs';
3
+ import { F as FieldAbstract } from './vgip-meta-ui-fieldAbstract-f7d80db6.mjs';
4
4
  import 'rxjs';
5
5
  import 'rxjs/operators';
6
6
 
@@ -20,4 +20,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
20
20
  }] });
21
21
 
22
22
  export { FieldHidden };
23
- //# sourceMappingURL=vgip-meta-ui-index-eb92e6e3.mjs.map
23
+ //# sourceMappingURL=vgip-meta-ui-index-87041aad.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"vgip-meta-ui-index-eb92e6e3.mjs","sources":["../../../projects/meta-ui/src/lib/fieldHidden/index.ts","../../../projects/meta-ui/src/lib/fieldHidden/view.html"],"sourcesContent":["/*\n * @Author: Alexander.Vangelov@vonage.com\n * @Date: 2019-09-19 17:35:19\n * @Last Modified by: Alexander.Vangelov@vonage.com\n * @Last Modified time: 2019-11-15 13:04:01\n */\n\nimport { Component } from '@angular/core';\nimport { FieldAbstract } from '../fieldAbstract';\n\n@Component({\n templateUrl: './view.html'\n})\nexport class FieldHidden extends FieldAbstract {}\n",""],"names":[],"mappings":";;;;;;AAAA;;;;;AAKG;AAQG,MAAO,WAAY,SAAQ,aAAa,CAAA;;wGAAjC,WAAW,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAX,WAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,WAAW,2ECbxB,EAAA,EAAA,CAAA,CAAA;2FDaa,WAAW,EAAA,UAAA,EAAA,CAAA;kBAHvB,SAAS;;;;;;"}
1
+ {"version":3,"file":"vgip-meta-ui-index-87041aad.mjs","sources":["../../../projects/meta-ui/src/lib/fieldHidden/index.ts","../../../projects/meta-ui/src/lib/fieldHidden/view.html"],"sourcesContent":["/*\n * @Author: Alexander.Vangelov@vonage.com\n * @Date: 2019-09-19 17:35:19\n * @Last Modified by: Alexander.Vangelov@vonage.com\n * @Last Modified time: 2019-11-15 13:04:01\n */\n\nimport { Component } from '@angular/core';\nimport { FieldAbstract } from '../fieldAbstract';\n\n@Component({\n templateUrl: './view.html'\n})\nexport class FieldHidden extends FieldAbstract {}\n",""],"names":[],"mappings":";;;;;;AAAA;;;;;AAKG;AAQG,MAAO,WAAY,SAAQ,aAAa,CAAA;;wGAAjC,WAAW,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAX,WAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,WAAW,2ECbxB,EAAA,EAAA,CAAA,CAAA;2FDaa,WAAW,EAAA,UAAA,EAAA,CAAA;kBAHvB,SAAS;;;;;;"}
@@ -0,0 +1,498 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Component } from '@angular/core';
3
+ import { F as FieldAbstract } from './vgip-meta-ui-fieldAbstract-f7d80db6.mjs';
4
+ import * as i2 from '@angular/forms';
5
+ import { ControlContainer, NgForm } from '@angular/forms';
6
+ import { M as MetaRefDialog, b as MetaReferenceService, a as MetaResourceService } from './vgip-meta-ui-index-2737c81e.mjs';
7
+ import * as i1 from '@angular/common';
8
+ import { M as MetaModelPipe } from './vgip-meta-ui-metaModel.pipe-4b068359.mjs';
9
+ import 'rxjs';
10
+ import 'rxjs/operators';
11
+ import './vgip-meta-ui-index-6e77c362.mjs';
12
+ import '@angular/common/http';
13
+ import 'tslib';
14
+ import '@angular/router';
15
+ import './vgip-meta-ui-index-4b8d731c.mjs';
16
+
17
+ class FieldSelect extends FieldAbstract {
18
+ constructor(referenceService, metaResource, viewContainerRef) {
19
+ super();
20
+ this.referenceService = referenceService;
21
+ this.metaResource = metaResource;
22
+ this.viewContainerRef = viewContainerRef;
23
+ this.isCreatable = false;
24
+ this.clickout = (event) => {
25
+ if (event.target.className === 'Vlt-dropdown__link' && this.elementRef.nativeElement.contains(event.target)) {
26
+ this.focus();
27
+ }
28
+ else if (event.target !== this.input &&
29
+ !event.target.classList.contains('Vlt-dropdown__block') &&
30
+ !this.detectSearchBlock(event.target)) {
31
+ this.dismissDropdown();
32
+ }
33
+ else if (this.detectSearchBlock(event.target)) {
34
+ event.target.focus();
35
+ }
36
+ else {
37
+ this.focus();
38
+ }
39
+ };
40
+ this.keydown = (event) => {
41
+ switch (event.key) {
42
+ case 'ArrowDown': {
43
+ this.showDropdown();
44
+ if (typeof (this.activeSuggestionIndex) === 'undefined') {
45
+ this.activeSuggestionIndex = 0;
46
+ }
47
+ else {
48
+ this.activeSuggestionIndex++;
49
+ if (this.activeSuggestionIndex >= this.options.length) {
50
+ this.activeSuggestionIndex = 0;
51
+ }
52
+ }
53
+ this.ensureDropdownOptionIsVisible();
54
+ event.preventDefault();
55
+ event.stopPropagation();
56
+ break;
57
+ }
58
+ case 'ArrowUp': {
59
+ this.showDropdown();
60
+ if (typeof (this.activeSuggestionIndex) === 'undefined') {
61
+ this.activeSuggestionIndex = this.options.length - 1;
62
+ }
63
+ else {
64
+ this.activeSuggestionIndex--;
65
+ if (this.activeSuggestionIndex < 0) {
66
+ this.activeSuggestionIndex = this.options.length - 1;
67
+ }
68
+ }
69
+ this.ensureDropdownOptionIsVisible();
70
+ event.preventDefault();
71
+ event.stopPropagation();
72
+ break;
73
+ }
74
+ case 'Enter':
75
+ case 'Space':
76
+ case ' ': {
77
+ if (typeof (this.activeSuggestionIndex) !== 'undefined') {
78
+ event.preventDefault();
79
+ event.stopPropagation();
80
+ this.onOptionSelect(event, this.options[this.activeSuggestionIndex]);
81
+ if (!this.multiple) {
82
+ delete this.activeSuggestionIndex;
83
+ }
84
+ }
85
+ break;
86
+ }
87
+ case 'Escape': {
88
+ event.preventDefault();
89
+ event.stopPropagation();
90
+ this.dismissDropdown();
91
+ break;
92
+ }
93
+ case 'Backspace': {
94
+ if (!this.dropdown.classList.contains('Vlt-dropdown--expanded')) {
95
+ event.preventDefault();
96
+ event.stopPropagation();
97
+ this.clear();
98
+ }
99
+ break;
100
+ }
101
+ }
102
+ };
103
+ }
104
+ get options() {
105
+ return this.filteredOptions || this.asyncOptions || this.meta.options || this.meta.picklist || [];
106
+ }
107
+ get groupedOptions() {
108
+ return this.options.reduce((r, { group }) => {
109
+ if (!r.some(o => o.group === group)) {
110
+ r.push({ group, groupItem: this.options.filter(v => v.group === group) });
111
+ }
112
+ return r;
113
+ }, []);
114
+ }
115
+ get resourceService() {
116
+ if (!this.metaResourceService) {
117
+ const metaResourceConfig = {
118
+ integrationCode: this.integrationCode,
119
+ resourceType: this.resourceType
120
+ };
121
+ this.metaResourceService = this.metaResource.new(metaResourceConfig);
122
+ }
123
+ return this.metaResourceService;
124
+ }
125
+ get optionsBackup() {
126
+ return this.asyncOptions || this.meta.options || this.meta.picklist || [];
127
+ }
128
+ static setup(instance, parent, meta) { }
129
+ ngOnInit() {
130
+ // console.log('parent', this.parent);
131
+ this.validationAttributes = ['required'];
132
+ this.multiple = (this.meta.type === 'multipicklist') || this.meta.multiple;
133
+ const origValue = this.parent[this.meta.name];
134
+ if (this.meta.reference) {
135
+ this.isCreatable = true;
136
+ }
137
+ Object.defineProperty(this.parent, this.meta.name, {
138
+ set: (value) => {
139
+ if (this.multiple) {
140
+ if (value && value instanceof Array === false) {
141
+ for (const o of this.options) {
142
+ if ((value.id || value) === (o.id || o.value || o.name || 0)) {
143
+ this.model = [o];
144
+ this.value = [this.modelToValue(o, this.meta.valueType)];
145
+ break;
146
+ }
147
+ }
148
+ }
149
+ if (!value || value.length) {
150
+ const values = (value instanceof Array) ? value : (value || '').split(';'); // should not handle incorrect values
151
+ this.value = [];
152
+ this.model = [];
153
+ for (const v of values) {
154
+ if (v) {
155
+ for (const o of this.options) {
156
+ if ((v.id || v) === (o.id || o.value || o.name || 0)) {
157
+ this.model.push(o);
158
+ this.value.push(this.modelToValue(o, this.meta.valueType));
159
+ break;
160
+ }
161
+ }
162
+ }
163
+ }
164
+ if (!this.model.length && !this.isPersistedParent) {
165
+ delete this.model;
166
+ delete this.value;
167
+ delete this.showText;
168
+ }
169
+ else {
170
+ this.showText = (this.model || []).map((o) => o.label || o).join(', ');
171
+ }
172
+ }
173
+ }
174
+ else {
175
+ if (value) {
176
+ for (const o of this.options) {
177
+ if ((value.id || value) === (o.id || o.value || o.name || o)) {
178
+ this.model = o;
179
+ this.value = this.modelToValue(o, this.meta.valueType);
180
+ this.showText = o.label || o;
181
+ break;
182
+ }
183
+ }
184
+ }
185
+ else {
186
+ delete this.model;
187
+ delete this.value;
188
+ delete this.showText;
189
+ }
190
+ }
191
+ this.onSubjectChange(this.model);
192
+ this.meta.$optional = this.isOptional;
193
+ },
194
+ get: () => this.value,
195
+ enumerable: this.sendToServer,
196
+ configurable: true
197
+ });
198
+ if (origValue) {
199
+ this.parent[this.meta.name] = origValue;
200
+ }
201
+ if (this.default && !this.model) {
202
+ setTimeout(() => {
203
+ this.parent[this.meta.name] = this.default.id || this.default;
204
+ }, 0);
205
+ }
206
+ if (typeof (this.meta.enabled) !== undefined) {
207
+ if (typeof (this.meta.enabled) === 'object') {
208
+ for (const par of Object.keys(this.meta.enabled)) {
209
+ const parValue = this.parent[par];
210
+ if (parValue) {
211
+ // logic for specific values, this works only for true
212
+ }
213
+ else {
214
+ this.logicalDisabled = true;
215
+ this.clear();
216
+ }
217
+ this.parentChangeSubject.subscribe((value) => {
218
+ if (value && value.hasOwnProperty(par)) {
219
+ this.logicalDisabled = !value[par];
220
+ if (this.logicalDisabled) {
221
+ this.clear();
222
+ }
223
+ else {
224
+ this.filterOptions();
225
+ }
226
+ }
227
+ });
228
+ }
229
+ this.filterOptions();
230
+ }
231
+ }
232
+ if (this.meta.search) {
233
+ const searchParams = this.meta.search.params;
234
+ if (searchParams) {
235
+ for (const par of Object.keys(searchParams)) {
236
+ const parValue = this.parent[searchParams[par]];
237
+ if (parValue) {
238
+ const params = {};
239
+ params[par] = parValue;
240
+ this.searchOptions(params);
241
+ }
242
+ this.parentChangeSubject.subscribe((value) => {
243
+ if (value && value.hasOwnProperty(searchParams[par])) {
244
+ this.searchOptions(value);
245
+ }
246
+ });
247
+ }
248
+ }
249
+ }
250
+ }
251
+ onActivated(ev) {
252
+ // ev.preventDefault();
253
+ // ev.stopPropagation();
254
+ this.input = ev.srcElement;
255
+ if (!this.dropdown) {
256
+ this.dropdown = ev.srcElement.parentNode.parentNode.parentNode;
257
+ this.searchInput = this.dropdown.querySelector('.vgip-search_input');
258
+ }
259
+ this.showDropdown();
260
+ }
261
+ detectSearchBlock(element) {
262
+ return this.elementRef.nativeElement.querySelector('.Vlt-search_wrap').contains(element);
263
+ }
264
+ onBlur(ev) {
265
+ let internalControl = false;
266
+ if (ev.relatedTarget) {
267
+ if (!this.detectSearchBlock(ev.relatedTarget) && !this.elementRef.nativeElement.contains(ev.relatedTarget)) {
268
+ this.dismissDropdown();
269
+ }
270
+ else {
271
+ internalControl = true;
272
+ }
273
+ }
274
+ if (this.keyListenerActive && !internalControl) {
275
+ this.input.removeEventListener('keydown', this.keydown);
276
+ if (this.searchInput) {
277
+ this.searchInput.removeEventListener('keydown', this.keydown);
278
+ }
279
+ setTimeout(() => {
280
+ if (!this.keyListenerActive) {
281
+ document.removeEventListener('click', this.clickout);
282
+ }
283
+ }, 400);
284
+ delete this.keyListenerActive;
285
+ }
286
+ this.onLeave.emit(ev);
287
+ }
288
+ onOptionSelect(ev, option) {
289
+ if (ev) {
290
+ ev.preventDefault();
291
+ ev.stopPropagation();
292
+ }
293
+ this.focus();
294
+ if (this.multiple) {
295
+ if (!this.model) {
296
+ this.model = [];
297
+ }
298
+ const optionIndex = this.model.indexOf(option);
299
+ if (optionIndex === -1) {
300
+ this.model.push(option);
301
+ }
302
+ else {
303
+ this.model.splice(optionIndex, 1);
304
+ if (!this.model.length) {
305
+ delete this.model;
306
+ }
307
+ }
308
+ this.onModelChange(this.model);
309
+ if (this.model) {
310
+ this.showText = (this.model || []).map((o) => o.label || o).join(', ');
311
+ }
312
+ else {
313
+ delete this.showText;
314
+ }
315
+ }
316
+ else {
317
+ this.dismissDropdown();
318
+ if (typeof option !== 'undefined') {
319
+ this.model = option;
320
+ this.onModelChange(option);
321
+ this.showText = option.label || (option.id === '' ? '--empty--' : option);
322
+ if (typeof (option) === 'object' && !option.id && option.id !== '') {
323
+ delete this.showText;
324
+ }
325
+ }
326
+ }
327
+ }
328
+ clear(ev) {
329
+ delete this.model;
330
+ this.onModelChange(this.model);
331
+ delete this.showText;
332
+ if (ev) {
333
+ ev.preventDefault();
334
+ ev.stopPropagation();
335
+ return false;
336
+ }
337
+ }
338
+ openResource(ev) {
339
+ const refDialogComponent = this.viewContainerRef.createComponent(MetaRefDialog);
340
+ this.referenceService.openDialog(refDialogComponent, this.metaResource, this.integrationCode, this.meta.reference, null).subscribe((result) => {
341
+ if (result) {
342
+ const existingOptions = (this.meta.options || []).find((o) => (o.id === result.id && o.type === result.type));
343
+ if (existingOptions) {
344
+ existingOptions.label = result.label;
345
+ }
346
+ else {
347
+ if (!this.meta.options) {
348
+ this.meta.options = [];
349
+ }
350
+ this.meta.options.unshift(result);
351
+ }
352
+ this.onOptionSelect(ev, result);
353
+ }
354
+ });
355
+ }
356
+ showDropdown() {
357
+ this.dropdown.classList.add('Vlt-dropdown--expanded');
358
+ if (!this.keyListenerActive) {
359
+ if (this.searchInput) {
360
+ this.searchInput.focus(); // Focus directly on search input first visit
361
+ this.searchInput.addEventListener('keydown', this.keydown);
362
+ }
363
+ this.input.addEventListener('keydown', this.keydown);
364
+ setTimeout(() => {
365
+ document.addEventListener('click', this.clickout);
366
+ }, 200);
367
+ this.keyListenerActive = true;
368
+ if (this.options && this.model) {
369
+ for (let suggestionIndex = 0; suggestionIndex < this.options.length; suggestionIndex++) {
370
+ if (this.model === this.options[suggestionIndex]) {
371
+ this.activeSuggestionIndex = suggestionIndex;
372
+ }
373
+ }
374
+ }
375
+ }
376
+ this.ensureDropdownIsVisible();
377
+ }
378
+ dismissDropdown(event) {
379
+ if (event) {
380
+ this.focus();
381
+ }
382
+ if (this.dropdown) {
383
+ this.dropdown.classList.remove('Vlt-dropdown--expanded');
384
+ }
385
+ if (this.searchInput) {
386
+ this.clearSearchField();
387
+ }
388
+ delete this.activeSuggestionIndex;
389
+ }
390
+ onSearchChange() {
391
+ const search = new RegExp(this.searchInputText, 'gi');
392
+ if (this.searchInputText === '') {
393
+ this.filteredOptions = [...this.optionsBackup];
394
+ }
395
+ else {
396
+ this.filteredOptions = this.optionsBackup.filter(option => (option.label || option.id || option.name || option).match(search));
397
+ }
398
+ }
399
+ clearSearchField() {
400
+ this.searchInputText = '';
401
+ this.onSearchChange();
402
+ }
403
+ ensureDropdownIsVisible() {
404
+ setTimeout(() => {
405
+ const holder = this.dropdown.closest('.Vlt-card__content');
406
+ if (holder) {
407
+ const el = this.elementRef.nativeElement.querySelector('.Vlt-dropdown__panel');
408
+ const elRect = el.getBoundingClientRect();
409
+ const holderRect = holder.getBoundingClientRect();
410
+ if (holderRect.top + holderRect.height < elRect.top + elRect.height) {
411
+ el.scrollIntoView({ block: 'end' });
412
+ }
413
+ }
414
+ }, 400);
415
+ }
416
+ ensureDropdownOptionIsVisible() {
417
+ if (!this.dropdownScrollContainer) {
418
+ this.dropdownScrollContainer = this.dropdown.querySelector('.Vlt-dropdown__scroll');
419
+ }
420
+ if (this.dropdownScrollContainer && typeof (this.activeSuggestionIndex) === 'number') {
421
+ const scrollTop = 44 * this.activeSuggestionIndex;
422
+ const scrollBottom = 44 * (this.activeSuggestionIndex - 7);
423
+ if (scrollTop < this.dropdownScrollContainer.scrollTop) {
424
+ this.dropdownScrollContainer.scrollTop = scrollTop;
425
+ }
426
+ else if (scrollBottom > this.dropdownScrollContainer.scrollTop) {
427
+ this.dropdownScrollContainer.scrollTop = scrollBottom;
428
+ }
429
+ }
430
+ }
431
+ filterOptions() {
432
+ this.asyncOptions = [];
433
+ if (!this.logicalDisabled) {
434
+ for (const o of this.meta.options) {
435
+ if (o.for) {
436
+ for (const par of Object.keys(o.for)) {
437
+ const parValue = this.parent[par];
438
+ if (o.for[par].indexOf(parValue) !== -1) {
439
+ this.asyncOptions.push(o);
440
+ }
441
+ }
442
+ }
443
+ else {
444
+ this.asyncOptions.push(o);
445
+ }
446
+ }
447
+ }
448
+ // remove current selection if not one of the filtered options
449
+ if (this.model && this.asyncOptions.indexOf(this.model) === -1) {
450
+ delete this.model;
451
+ delete this.value;
452
+ delete this.showText;
453
+ delete this.parent[this.meta.name];
454
+ }
455
+ }
456
+ searchOptions(params) {
457
+ let searchUrl = `/fields/${this.meta.name}/search`;
458
+ if (this.meta.search) {
459
+ if (this.meta.search.url) {
460
+ searchUrl = this.meta.search.url;
461
+ }
462
+ const searchParams = this.meta.search.params;
463
+ if (searchParams) {
464
+ for (const par of Object.keys(searchParams)) {
465
+ const val = this.parent[searchParams[par]];
466
+ if (val) {
467
+ searchUrl += `${searchUrl.indexOf('?') === -1 ? '?' : '&'}${par}=${val.id || val}`;
468
+ }
469
+ }
470
+ }
471
+ }
472
+ this.searching = true;
473
+ this.resourceService.getByPath(searchUrl).subscribe((options) => {
474
+ this.asyncOptions = options;
475
+ let validValue = false;
476
+ if (this.value) {
477
+ for (const o of options) {
478
+ if ((o.id || o) === (this.value.id || this.value)) {
479
+ validValue = true;
480
+ }
481
+ }
482
+ if (!validValue) {
483
+ this.clear();
484
+ }
485
+ }
486
+ delete this.searching;
487
+ });
488
+ }
489
+ }
490
+ FieldSelect.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FieldSelect, deps: [{ token: MetaReferenceService }, { token: MetaResourceService }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
491
+ FieldSelect.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: FieldSelect, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<div class='vgip-meta-field-preview' *ngIf='preview && model'>\n <div class='vgip-meta-field-label' [title]='meta.label || meta.name'>{{meta.label || meta.name}}</div>\n <div class='vgip-meta-field-value __gu'>\n {{showText}}\n </div>\n</div>\n<div *ngIf='!preview' class=\"Vlt-form__element\"\n [ngClass]=\"{ 'Vlt-form__element--big': !meta.small ,'has-value': f.value, active: keyListenerActive, 'Vlt-form__element--error': f.invalid && ((f | metaModel)._parent.submitted || (ft | metaModel ).touched), 'no-x': meta.noX }\">\n <div class=\"Vlt-composite Vlt-dropdown Vlt-input\" style='display: block;'\n [ngClass]=\"{ 'has-append-button': isCreatable && !disabled }\">\n <div class=\"Vlt-select\">\n <label class='wrapper'>\n <label class='Vlt-truncate'>{{meta.label || meta.name}}<span\n *ngIf='validations.required && options.length' class='Vlt-red'>*</span></label>\n <input class='main' [required]='validations.required && !!options.length' readonly [ngModel]='showText'\n #ft='ngModel' [ngModelOptions]=\"{standalone: true}\" type=\"text\"\n [placeholder]=\"meta.placeholder || ' '\" (click)='onActivated($event)' (focus)='onActivated($event)'\n (blur)='onBlur($event)' [ngClass]=\"{ 'standalone': meta.standalone }\"\n [disabled]='disabled' [attr.aria-label]='meta.label' />\n </label>\n <select class='model' [required]='validations.required && !!options.length' style='display: none;'\n [(ngModel)]='model' [ngModelOptions]=\"{standalone: meta.standalone}\"\n (ngModelChange)=\"onModelChange($event)\" #f='ngModel' [name]='name'></select>\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='model && !meta.noX && !disabled' class=\"Vlt-composite__append--icon\"\n (click)='clear($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 </div>\n </div>\n </div>\n <div class='Vlt-dropdown__panel'>\n <div class=\"Vlt-dropdown__panel__content Vlt-dropdown__panel__content--scroll-area\">\n <!-- <div class=\"Vlt-dropdown__title\" style='padding-left: 15px;'>\n Select ({{options.length}})\n <div class=\"Vlt-dropdown__close Vlt-white\" (click)='dismissDropdown($event)'>\n <svg class='Vlt-icon Vlt-icon--small'><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-cross\"/></svg>\n </div>\n </div> -->\n <div class=\"Vlt-dropdown__block Vlt-search_wrap\">\n <div *ngIf=\"optionsBackup.length > 12\" class=\"Vlt-composite\">\n <div class=\"Vlt-composite__prepend Vlt-composite__prepend--icon\"\n style=\"top: 0; padding-top: 15px;\">\n <div class=\"Vlt-composite__icon\">\n <svg class='Vlt-grey'>\n <use xlink:href=\"volta/volta-icons.svg#Vlt-icon-search\"></use>\n </svg>\n </div>\n </div>\n <div class=\"Vlt-input\">\n <input type=\"text\" class=\"vgip-search_input\" [(ngModel)]=\"searchInputText\" placeholder=\"Search\" (input)=\"onSearchChange()\" (blur)='onBlur($event)' [ngModelOptions]=\"{standalone: true}\">\n </div>\n <div class=\"Vlt-composite__append--icon\"\n style=\"top: 2px;\" (click)=\"clearSearchField()\" [hidden]=\"searchInputText === ''\">\n <div class=\"Vlt-composite__icon\">\n <svg class='Vlt-icon Vlt-icon--small'>\n <use xlink:href=\"volta/volta-icons.svg#Vlt-icon-cross\"/>\n </svg>\n </div>\n </div>\n </div>\n </div>\n <div *ngIf='dropdown' class='Vlt-dropdown__scroll'>\n <div [ngClass]=\"{ 'Vlt-dropdown__link--selected': activeSuggestionIndex === i }\"\n (click)='onOptionSelect($event, option)' *ngFor='let option of options; let i = index'\n class=\"Vlt-dropdown__link\">\n <div *ngIf='multiple' class=\"Vlt-checkbox\" style='width: 100%;'>\n <label>\n <span class=\"Vlt-checkbox__button\">\n <input type=\"checkbox\" [checked]='model && model.indexOf(option) !== -1' />\n <span class=\"Vlt-checkbox__icon\"></span>\n </span>\n {{option.label || (option.id === '' ? '--empty--' : option)}}\n </label>\n </div>\n <div *ngIf='!multiple' style='padding: 12px 20px;'>{{option.label || (option.id === '' ?\n '--empty--' : option)}}</div>\n </div>\n <!-- No Option Found -->\n <div class=\"Vlt-dropdown__link\" *ngIf=\"options.length === 0\">\n <div style='padding: 12px 20px;'>No Option Found</div>\n </div>\n </div>\n <div *ngIf='!multiple' class=\"Vlt-dropdown__block\"></div>\n <div *ngIf='multiple' class=\"Vlt-dropdown__block Vlt-dropdown__block--nowrap\"\n style='padding: 8px 16px 16px;'>\n <button (click)='clear($event)' type='button'\n class=\"Vlt-btn Vlt-btn--secondary Vlt-btn--app Vlt-btn--small Vlt-btn--outline\"\n style='margin-right: 8px;'>Clear all</button>\n <button (click)='dismissDropdown($event)' type='button'\n class=\"Vlt-btn Vlt-btn--secondary Vlt-btn--app Vlt-btn--small\">Done</button>\n </div>\n </div>\n </div>\n <!-- <span *ngIf='isCreatable'>\n <button type='button' (click)='openResource($event)' 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 </span> -->\n <div *ngIf='isCreatable && !disabled' class=\"Vlt-composite__append\">\n <button (focus)='onActivated($event)' (blur)='onBlur($event)' type='button' (click)='openResource($event)'\n class=\"Vlt-btn Vlt-btn--white Vlt-btn--icon add-button\" aria-label='Add new'>\n <svg>\n <use xlink:href=\"volta/volta-icons.svg#Vlt-icon-plus\" />\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.&nbsp;</span>\n <span *ngIf=\"f.errors.custom\">{{f.errors.custom}}&nbsp;</span>\n </small>\n <small *ngIf='meta.hint' class=\"Vlt-form__element__hint\">{{meta.hint}}</small>\n</div>\n", styles: [".Vlt-form__element.no-x input.main{padding-right:40px}.Vlt-form__element--big:not(.has-value)>.Vlt-input>.Vlt-select>label>label{font-size:1.6rem;margin-top:-.8rem;top:50%}.Vlt-form__element--big input[readonly].main:not([disabled]){background:var(--vgip-meta-input-bg-color);border:1px solid var(--vgip-meta-input-border-color)}.Vlt-form__element--big:hover input[readonly].main,.Vlt-form__element--big:hover .Vlt-composite__append button,.Vlt-form__element--big:focus input[readonly].main,.Vlt-form__element--big:focus .Vlt-composite__append button,.Vlt-form__element--big.active input[readonly].main,.Vlt-form__element--big.active .Vlt-composite__append button{border-color:var(--vgip-meta-input-active-border-color)}.Vlt-form__element--big.Vlt-form__element--error input[readonly].main,.Vlt-form__element--big.Vlt-form__element--error .Vlt-composite__append button{border-color:#f25a6b;box-shadow:none}.Vlt-form__element--big .Vlt-select:after{background-image:var(--vgip-meta-dropdown-icon);margin-right:2px}.Vlt-form__element--big .Vlt-form__element__hint{color:var(--vgip-meta-input-hint-color)}.Vlt-composite.has-append-button input[readonly].main{border-top-right-radius:0;border-bottom-right-radius:0;border-right:0}.Vlt-composite.has-append-button .Vlt-select:after{margin-right:-10px}.Vlt-composite__append{z-index:initial}.Vlt-composite__append button{height:48px;background:var(--vgip-meta-input-bg-color);border-color:var(--vgip-meta-input-border-color);padding-right:16px;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-dropdown__panel{width:100%}.Vlt-dropdown__panel .Vlt-dropdown__link{padding:0 20px 0 0}.Vlt-dropdown__panel .Vlt-dropdown__link.Vlt-dropdown__link--selected{background:rgba(44,45,48,.05)}.Vlt-dropdown__panel label{margin-top:0;padding:12px 20px;top:0;left:0;pointer-events:initial;position:initial;color:initial;font-size:inherit;transition:none;cursor:pointer}.Vlt-dropdown__panel label input{height:0}input.main{cursor:pointer;padding-right:76px}.Vlt-input.has-append-button .Vlt-composite__append.right-actions{right:42px}.Vlt-composite__append.right-actions{position:absolute;top:5px;right:53px;cursor:pointer}.Vlt-composite__append.right-actions .Vlt-composite__append--icon{width:36px;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-search_wrap{padding-top:10px}.Vlt-search_wrap .vgip-search_input{padding:8px 36px 8px 38px;width:100%;border:1px solid var(--vgip-meta-input-border-color)!important;border-radius:6px!important}.Vlt-search_wrap .vgip-search_input:focus,.Vlt-search_wrap .vgip-search_input:active,.Vlt-search_wrap .vgip-search_input:hover{border-color:var(--vgip-meta-input-active-border-color)!important}.Vlt-search_wrap .Vlt-composite__append--icon{cursor:pointer}.Vlt-search_wrap .Vlt-composite__append--icon svg{height:14px;width:14px}.Vlt-search_wrap .Vlt-composite__append--icon:focus svg,.Vlt-search_wrap .Vlt-composite__append--icon:active svg,.Vlt-search_wrap .Vlt-composite__append--icon:hover svg{fill:var(--vgip-meta-input-accent-color)}\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: 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.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { 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: "pipe", type: MetaModelPipe, name: "metaModel" }], viewProviders: [{ provide: ControlContainer, useExisting: NgForm }] });
492
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FieldSelect, decorators: [{
493
+ type: Component,
494
+ args: [{ viewProviders: [{ provide: ControlContainer, useExisting: NgForm }], template: "<div class='vgip-meta-field-preview' *ngIf='preview && model'>\n <div class='vgip-meta-field-label' [title]='meta.label || meta.name'>{{meta.label || meta.name}}</div>\n <div class='vgip-meta-field-value __gu'>\n {{showText}}\n </div>\n</div>\n<div *ngIf='!preview' class=\"Vlt-form__element\"\n [ngClass]=\"{ 'Vlt-form__element--big': !meta.small ,'has-value': f.value, active: keyListenerActive, 'Vlt-form__element--error': f.invalid && ((f | metaModel)._parent.submitted || (ft | metaModel ).touched), 'no-x': meta.noX }\">\n <div class=\"Vlt-composite Vlt-dropdown Vlt-input\" style='display: block;'\n [ngClass]=\"{ 'has-append-button': isCreatable && !disabled }\">\n <div class=\"Vlt-select\">\n <label class='wrapper'>\n <label class='Vlt-truncate'>{{meta.label || meta.name}}<span\n *ngIf='validations.required && options.length' class='Vlt-red'>*</span></label>\n <input class='main' [required]='validations.required && !!options.length' readonly [ngModel]='showText'\n #ft='ngModel' [ngModelOptions]=\"{standalone: true}\" type=\"text\"\n [placeholder]=\"meta.placeholder || ' '\" (click)='onActivated($event)' (focus)='onActivated($event)'\n (blur)='onBlur($event)' [ngClass]=\"{ 'standalone': meta.standalone }\"\n [disabled]='disabled' [attr.aria-label]='meta.label' />\n </label>\n <select class='model' [required]='validations.required && !!options.length' style='display: none;'\n [(ngModel)]='model' [ngModelOptions]=\"{standalone: meta.standalone}\"\n (ngModelChange)=\"onModelChange($event)\" #f='ngModel' [name]='name'></select>\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='model && !meta.noX && !disabled' class=\"Vlt-composite__append--icon\"\n (click)='clear($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 </div>\n </div>\n </div>\n <div class='Vlt-dropdown__panel'>\n <div class=\"Vlt-dropdown__panel__content Vlt-dropdown__panel__content--scroll-area\">\n <!-- <div class=\"Vlt-dropdown__title\" style='padding-left: 15px;'>\n Select ({{options.length}})\n <div class=\"Vlt-dropdown__close Vlt-white\" (click)='dismissDropdown($event)'>\n <svg class='Vlt-icon Vlt-icon--small'><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-cross\"/></svg>\n </div>\n </div> -->\n <div class=\"Vlt-dropdown__block Vlt-search_wrap\">\n <div *ngIf=\"optionsBackup.length > 12\" class=\"Vlt-composite\">\n <div class=\"Vlt-composite__prepend Vlt-composite__prepend--icon\"\n style=\"top: 0; padding-top: 15px;\">\n <div class=\"Vlt-composite__icon\">\n <svg class='Vlt-grey'>\n <use xlink:href=\"volta/volta-icons.svg#Vlt-icon-search\"></use>\n </svg>\n </div>\n </div>\n <div class=\"Vlt-input\">\n <input type=\"text\" class=\"vgip-search_input\" [(ngModel)]=\"searchInputText\" placeholder=\"Search\" (input)=\"onSearchChange()\" (blur)='onBlur($event)' [ngModelOptions]=\"{standalone: true}\">\n </div>\n <div class=\"Vlt-composite__append--icon\"\n style=\"top: 2px;\" (click)=\"clearSearchField()\" [hidden]=\"searchInputText === ''\">\n <div class=\"Vlt-composite__icon\">\n <svg class='Vlt-icon Vlt-icon--small'>\n <use xlink:href=\"volta/volta-icons.svg#Vlt-icon-cross\"/>\n </svg>\n </div>\n </div>\n </div>\n </div>\n <div *ngIf='dropdown' class='Vlt-dropdown__scroll'>\n <div [ngClass]=\"{ 'Vlt-dropdown__link--selected': activeSuggestionIndex === i }\"\n (click)='onOptionSelect($event, option)' *ngFor='let option of options; let i = index'\n class=\"Vlt-dropdown__link\">\n <div *ngIf='multiple' class=\"Vlt-checkbox\" style='width: 100%;'>\n <label>\n <span class=\"Vlt-checkbox__button\">\n <input type=\"checkbox\" [checked]='model && model.indexOf(option) !== -1' />\n <span class=\"Vlt-checkbox__icon\"></span>\n </span>\n {{option.label || (option.id === '' ? '--empty--' : option)}}\n </label>\n </div>\n <div *ngIf='!multiple' style='padding: 12px 20px;'>{{option.label || (option.id === '' ?\n '--empty--' : option)}}</div>\n </div>\n <!-- No Option Found -->\n <div class=\"Vlt-dropdown__link\" *ngIf=\"options.length === 0\">\n <div style='padding: 12px 20px;'>No Option Found</div>\n </div>\n </div>\n <div *ngIf='!multiple' class=\"Vlt-dropdown__block\"></div>\n <div *ngIf='multiple' class=\"Vlt-dropdown__block Vlt-dropdown__block--nowrap\"\n style='padding: 8px 16px 16px;'>\n <button (click)='clear($event)' type='button'\n class=\"Vlt-btn Vlt-btn--secondary Vlt-btn--app Vlt-btn--small Vlt-btn--outline\"\n style='margin-right: 8px;'>Clear all</button>\n <button (click)='dismissDropdown($event)' type='button'\n class=\"Vlt-btn Vlt-btn--secondary Vlt-btn--app Vlt-btn--small\">Done</button>\n </div>\n </div>\n </div>\n <!-- <span *ngIf='isCreatable'>\n <button type='button' (click)='openResource($event)' 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 </span> -->\n <div *ngIf='isCreatable && !disabled' class=\"Vlt-composite__append\">\n <button (focus)='onActivated($event)' (blur)='onBlur($event)' type='button' (click)='openResource($event)'\n class=\"Vlt-btn Vlt-btn--white Vlt-btn--icon add-button\" aria-label='Add new'>\n <svg>\n <use xlink:href=\"volta/volta-icons.svg#Vlt-icon-plus\" />\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.&nbsp;</span>\n <span *ngIf=\"f.errors.custom\">{{f.errors.custom}}&nbsp;</span>\n </small>\n <small *ngIf='meta.hint' class=\"Vlt-form__element__hint\">{{meta.hint}}</small>\n</div>\n", styles: [".Vlt-form__element.no-x input.main{padding-right:40px}.Vlt-form__element--big:not(.has-value)>.Vlt-input>.Vlt-select>label>label{font-size:1.6rem;margin-top:-.8rem;top:50%}.Vlt-form__element--big input[readonly].main:not([disabled]){background:var(--vgip-meta-input-bg-color);border:1px solid var(--vgip-meta-input-border-color)}.Vlt-form__element--big:hover input[readonly].main,.Vlt-form__element--big:hover .Vlt-composite__append button,.Vlt-form__element--big:focus input[readonly].main,.Vlt-form__element--big:focus .Vlt-composite__append button,.Vlt-form__element--big.active input[readonly].main,.Vlt-form__element--big.active .Vlt-composite__append button{border-color:var(--vgip-meta-input-active-border-color)}.Vlt-form__element--big.Vlt-form__element--error input[readonly].main,.Vlt-form__element--big.Vlt-form__element--error .Vlt-composite__append button{border-color:#f25a6b;box-shadow:none}.Vlt-form__element--big .Vlt-select:after{background-image:var(--vgip-meta-dropdown-icon);margin-right:2px}.Vlt-form__element--big .Vlt-form__element__hint{color:var(--vgip-meta-input-hint-color)}.Vlt-composite.has-append-button input[readonly].main{border-top-right-radius:0;border-bottom-right-radius:0;border-right:0}.Vlt-composite.has-append-button .Vlt-select:after{margin-right:-10px}.Vlt-composite__append{z-index:initial}.Vlt-composite__append button{height:48px;background:var(--vgip-meta-input-bg-color);border-color:var(--vgip-meta-input-border-color);padding-right:16px;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-dropdown__panel{width:100%}.Vlt-dropdown__panel .Vlt-dropdown__link{padding:0 20px 0 0}.Vlt-dropdown__panel .Vlt-dropdown__link.Vlt-dropdown__link--selected{background:rgba(44,45,48,.05)}.Vlt-dropdown__panel label{margin-top:0;padding:12px 20px;top:0;left:0;pointer-events:initial;position:initial;color:initial;font-size:inherit;transition:none;cursor:pointer}.Vlt-dropdown__panel label input{height:0}input.main{cursor:pointer;padding-right:76px}.Vlt-input.has-append-button .Vlt-composite__append.right-actions{right:42px}.Vlt-composite__append.right-actions{position:absolute;top:5px;right:53px;cursor:pointer}.Vlt-composite__append.right-actions .Vlt-composite__append--icon{width:36px;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-search_wrap{padding-top:10px}.Vlt-search_wrap .vgip-search_input{padding:8px 36px 8px 38px;width:100%;border:1px solid var(--vgip-meta-input-border-color)!important;border-radius:6px!important}.Vlt-search_wrap .vgip-search_input:focus,.Vlt-search_wrap .vgip-search_input:active,.Vlt-search_wrap .vgip-search_input:hover{border-color:var(--vgip-meta-input-active-border-color)!important}.Vlt-search_wrap .Vlt-composite__append--icon{cursor:pointer}.Vlt-search_wrap .Vlt-composite__append--icon svg{height:14px;width:14px}.Vlt-search_wrap .Vlt-composite__append--icon:focus svg,.Vlt-search_wrap .Vlt-composite__append--icon:active svg,.Vlt-search_wrap .Vlt-composite__append--icon:hover svg{fill:var(--vgip-meta-input-accent-color)}\n"] }]
495
+ }], ctorParameters: function () { return [{ type: MetaReferenceService }, { type: MetaResourceService }, { type: i0.ViewContainerRef }]; } });
496
+
497
+ export { FieldSelect };
498
+ //# sourceMappingURL=vgip-meta-ui-index-a76ba482.mjs.map