@vgip/meta-ui 1.5.6 → 1.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/fieldAbstract.mjs +6 -6
- package/esm2020/lib/fieldComposite/index.mjs +65 -0
- package/esm2020/lib/fieldList/index.mjs +68 -0
- package/esm2020/lib/fieldReference/index.mjs +823 -0
- package/esm2020/lib/fieldSelect/index.mjs +488 -0
- package/esm2020/lib/index.mjs +10 -18
- package/esm2020/lib/layout/index.mjs +151 -0
- package/esm2020/lib/metaField/index.mjs +139 -0
- package/esm2020/lib/refDialog/index.mjs +127 -0
- package/esm2020/lib/resource/index.mjs +480 -0
- package/esm2020/lib/resourceCard/index.mjs +42 -0
- package/esm2020/lib/services/metaReference/index.mjs +2 -3
- package/fesm2015/vgip-meta-ui-fieldAbstract-2d0882f1.mjs +382 -0
- package/fesm2015/vgip-meta-ui-fieldAbstract-2d0882f1.mjs.map +1 -0
- package/fesm2015/vgip-meta-ui-index-0068fb77.mjs +368 -0
- package/fesm2015/vgip-meta-ui-index-0068fb77.mjs.map +1 -0
- package/fesm2015/vgip-meta-ui-index-3488da98.mjs +130 -0
- package/fesm2015/vgip-meta-ui-index-3488da98.mjs.map +1 -0
- package/fesm2015/vgip-meta-ui-index-4d489d76.mjs +71 -0
- package/fesm2015/vgip-meta-ui-index-4d489d76.mjs.map +1 -0
- package/fesm2015/vgip-meta-ui-index-5615e618.mjs +95 -0
- package/fesm2015/vgip-meta-ui-index-5615e618.mjs.map +1 -0
- package/fesm2015/vgip-meta-ui-index-65c10356.mjs +57 -0
- package/fesm2015/vgip-meta-ui-index-65c10356.mjs.map +1 -0
- package/fesm2015/vgip-meta-ui-index-6a77fa96.mjs +74 -0
- package/fesm2015/vgip-meta-ui-index-6a77fa96.mjs.map +1 -0
- package/fesm2015/vgip-meta-ui-index-6bd006d4.mjs +496 -0
- package/fesm2015/vgip-meta-ui-index-6bd006d4.mjs.map +1 -0
- package/fesm2015/vgip-meta-ui-index-8f5be5a7.mjs +24 -0
- package/fesm2015/vgip-meta-ui-index-8f5be5a7.mjs.map +1 -0
- package/fesm2015/vgip-meta-ui-index-92be02c0.mjs +145 -0
- package/fesm2015/vgip-meta-ui-index-92be02c0.mjs.map +1 -0
- package/fesm2015/vgip-meta-ui-index-934aeabf.mjs +68 -0
- package/fesm2015/vgip-meta-ui-index-934aeabf.mjs.map +1 -0
- package/fesm2015/vgip-meta-ui-index-9b5ee0c4.mjs +88 -0
- package/fesm2015/vgip-meta-ui-index-9b5ee0c4.mjs.map +1 -0
- package/fesm2015/vgip-meta-ui-index-a308ba4f.mjs +856 -0
- package/fesm2015/vgip-meta-ui-index-a308ba4f.mjs.map +1 -0
- package/fesm2015/vgip-meta-ui-index-def34ca9.mjs +1882 -0
- package/fesm2015/vgip-meta-ui-index-def34ca9.mjs.map +1 -0
- package/fesm2015/vgip-meta-ui-index-fa0b1b8b.mjs +460 -0
- package/fesm2015/vgip-meta-ui-index-fa0b1b8b.mjs.map +1 -0
- package/fesm2015/vgip-meta-ui-metaModel.pipe-725f401c.mjs +28 -0
- package/fesm2015/vgip-meta-ui-metaModel.pipe-725f401c.mjs.map +1 -0
- package/fesm2015/vgip-meta-ui-relativeTimeBuilder-31791ce4.mjs +51 -0
- package/fesm2015/vgip-meta-ui-relativeTimeBuilder-31791ce4.mjs.map +1 -0
- package/fesm2015/vgip-meta-ui.mjs +40 -5083
- package/fesm2015/vgip-meta-ui.mjs.map +1 -1
- package/fesm2020/vgip-meta-ui-fieldAbstract-2d0882f1.mjs +382 -0
- package/fesm2020/vgip-meta-ui-fieldAbstract-2d0882f1.mjs.map +1 -0
- package/fesm2020/vgip-meta-ui-index-0068fb77.mjs +368 -0
- package/fesm2020/vgip-meta-ui-index-0068fb77.mjs.map +1 -0
- package/fesm2020/vgip-meta-ui-index-3488da98.mjs +130 -0
- package/fesm2020/vgip-meta-ui-index-3488da98.mjs.map +1 -0
- package/fesm2020/vgip-meta-ui-index-3907f4b1.mjs +1879 -0
- package/fesm2020/vgip-meta-ui-index-3907f4b1.mjs.map +1 -0
- package/fesm2020/vgip-meta-ui-index-3d8c2fcd.mjs +856 -0
- package/fesm2020/vgip-meta-ui-index-3d8c2fcd.mjs.map +1 -0
- package/fesm2020/vgip-meta-ui-index-5615e618.mjs +95 -0
- package/fesm2020/vgip-meta-ui-index-5615e618.mjs.map +1 -0
- package/fesm2020/vgip-meta-ui-index-65c10356.mjs +57 -0
- package/fesm2020/vgip-meta-ui-index-65c10356.mjs.map +1 -0
- package/fesm2020/vgip-meta-ui-index-6f96198b.mjs +70 -0
- package/fesm2020/vgip-meta-ui-index-6f96198b.mjs.map +1 -0
- package/fesm2020/vgip-meta-ui-index-710246ac.mjs +73 -0
- package/fesm2020/vgip-meta-ui-index-710246ac.mjs.map +1 -0
- package/fesm2020/vgip-meta-ui-index-8f5be5a7.mjs +24 -0
- package/fesm2020/vgip-meta-ui-index-8f5be5a7.mjs.map +1 -0
- package/fesm2020/vgip-meta-ui-index-934aeabf.mjs +68 -0
- package/fesm2020/vgip-meta-ui-index-934aeabf.mjs.map +1 -0
- package/fesm2020/vgip-meta-ui-index-9b5ee0c4.mjs +88 -0
- package/fesm2020/vgip-meta-ui-index-9b5ee0c4.mjs.map +1 -0
- package/fesm2020/vgip-meta-ui-index-e743527e.mjs +495 -0
- package/fesm2020/vgip-meta-ui-index-e743527e.mjs.map +1 -0
- package/fesm2020/vgip-meta-ui-index-e8e3b16a.mjs +142 -0
- package/fesm2020/vgip-meta-ui-index-e8e3b16a.mjs.map +1 -0
- package/fesm2020/vgip-meta-ui-index-fa0b1b8b.mjs +460 -0
- package/fesm2020/vgip-meta-ui-index-fa0b1b8b.mjs.map +1 -0
- package/fesm2020/vgip-meta-ui-metaModel.pipe-725f401c.mjs +28 -0
- package/fesm2020/vgip-meta-ui-metaModel.pipe-725f401c.mjs.map +1 -0
- package/fesm2020/vgip-meta-ui-relativeTimeBuilder-31791ce4.mjs +51 -0
- package/fesm2020/vgip-meta-ui-relativeTimeBuilder-31791ce4.mjs.map +1 -0
- package/fesm2020/vgip-meta-ui.mjs +39 -5083
- package/fesm2020/vgip-meta-ui.mjs.map +1 -1
- package/lib/fieldComposite/index.d.ts +12 -0
- package/lib/fieldList/index.d.ts +14 -0
- package/lib/fieldReference/index.d.ts +73 -0
- package/lib/fieldSelect/index.d.ts +48 -0
- package/lib/index.d.ts +31 -23
- package/lib/layout/index.d.ts +39 -0
- package/lib/metaField/index.d.ts +26 -0
- package/lib/refDialog/index.d.ts +33 -0
- package/lib/resource/index.d.ts +58 -0
- package/lib/resourceCard/index.d.ts +18 -0
- package/lib/services/metaReference/index.d.ts +1 -1
- package/package.json +1 -1
- package/esm2020/lib/field.mjs +0 -2325
- package/lib/field.d.ts +0 -292
|
@@ -0,0 +1,496 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component } from '@angular/core';
|
|
3
|
+
import { F as FieldAbstract } from './vgip-meta-ui-fieldAbstract-2d0882f1.mjs';
|
|
4
|
+
import * as i2 from '@angular/forms';
|
|
5
|
+
import { ControlContainer, NgForm } from '@angular/forms';
|
|
6
|
+
import { M as MetaRefDialog, b as MetaReferenceService, a as MetaResourceService } from './vgip-meta-ui-index-def34ca9.mjs';
|
|
7
|
+
import * as i1 from '@angular/common';
|
|
8
|
+
import { M as MetaModelPipe } from './vgip-meta-ui-metaModel.pipe-725f401c.mjs';
|
|
9
|
+
import 'rxjs';
|
|
10
|
+
import 'rxjs/operators';
|
|
11
|
+
import './vgip-meta-ui-index-3488da98.mjs';
|
|
12
|
+
import '@angular/common/http';
|
|
13
|
+
import 'tslib';
|
|
14
|
+
import '@angular/router';
|
|
15
|
+
import './vgip-meta-ui-index-92be02c0.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.filterOptions();
|
|
218
|
+
this.parentChangeSubject.subscribe((value) => {
|
|
219
|
+
if (value && value.hasOwnProperty(par)) {
|
|
220
|
+
this.logicalDisabled = !value[par];
|
|
221
|
+
if (this.logicalDisabled) {
|
|
222
|
+
this.clear();
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
this.filterOptions();
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
}
|
|
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
|
+
this.filteredOptions = this.optionsBackup.filter(option => option.label.match(search));
|
|
396
|
+
}
|
|
397
|
+
clearSearchField() {
|
|
398
|
+
this.searchInputText = '';
|
|
399
|
+
this.onSearchChange();
|
|
400
|
+
}
|
|
401
|
+
ensureDropdownIsVisible() {
|
|
402
|
+
setTimeout(() => {
|
|
403
|
+
const holder = this.dropdown.closest('.Vlt-card__content');
|
|
404
|
+
if (holder) {
|
|
405
|
+
const el = this.elementRef.nativeElement.querySelector('.Vlt-dropdown__panel');
|
|
406
|
+
const elRect = el.getBoundingClientRect();
|
|
407
|
+
const holderRect = holder.getBoundingClientRect();
|
|
408
|
+
if (holderRect.top + holderRect.height < elRect.top + elRect.height) {
|
|
409
|
+
el.scrollIntoView({ block: 'end' });
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}, 400);
|
|
413
|
+
}
|
|
414
|
+
ensureDropdownOptionIsVisible() {
|
|
415
|
+
if (!this.dropdownScrollContainer) {
|
|
416
|
+
this.dropdownScrollContainer = this.dropdown.querySelector('.Vlt-dropdown__scroll');
|
|
417
|
+
}
|
|
418
|
+
if (this.dropdownScrollContainer && typeof (this.activeSuggestionIndex) === 'number') {
|
|
419
|
+
const scrollTop = 44 * this.activeSuggestionIndex;
|
|
420
|
+
const scrollBottom = 44 * (this.activeSuggestionIndex - 7);
|
|
421
|
+
if (scrollTop < this.dropdownScrollContainer.scrollTop) {
|
|
422
|
+
this.dropdownScrollContainer.scrollTop = scrollTop;
|
|
423
|
+
}
|
|
424
|
+
else if (scrollBottom > this.dropdownScrollContainer.scrollTop) {
|
|
425
|
+
this.dropdownScrollContainer.scrollTop = scrollBottom;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
filterOptions() {
|
|
430
|
+
this.asyncOptions = [];
|
|
431
|
+
if (!this.logicalDisabled) {
|
|
432
|
+
for (const o of this.meta.options) {
|
|
433
|
+
if (o.for) {
|
|
434
|
+
for (const par of Object.keys(o.for)) {
|
|
435
|
+
const parValue = this.parent[par];
|
|
436
|
+
if (o.for[par].indexOf(parValue) !== -1) {
|
|
437
|
+
this.asyncOptions.push(o);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
else {
|
|
442
|
+
this.asyncOptions.push(o);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
// remove current selection if not one of the filtered options
|
|
447
|
+
if (this.asyncOptions.indexOf(this.model) === -1) {
|
|
448
|
+
delete this.model;
|
|
449
|
+
delete this.value;
|
|
450
|
+
delete this.showText;
|
|
451
|
+
delete this.parent[this.meta.name];
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
searchOptions(params) {
|
|
455
|
+
let searchUrl = `/fields/${this.meta.name}/search`;
|
|
456
|
+
if (this.meta.search) {
|
|
457
|
+
if (this.meta.search.url) {
|
|
458
|
+
searchUrl = this.meta.search.url;
|
|
459
|
+
}
|
|
460
|
+
const searchParams = this.meta.search.params;
|
|
461
|
+
if (searchParams) {
|
|
462
|
+
for (const par of Object.keys(searchParams)) {
|
|
463
|
+
const val = this.parent[searchParams[par]];
|
|
464
|
+
if (val) {
|
|
465
|
+
searchUrl += `${searchUrl.indexOf('?') === -1 ? '?' : '&'}${par}=${val.id || val}`;
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
this.searching = true;
|
|
471
|
+
this.resourceService.getByPath(searchUrl).subscribe((options) => {
|
|
472
|
+
this.asyncOptions = options;
|
|
473
|
+
let validValue = false;
|
|
474
|
+
if (this.value) {
|
|
475
|
+
for (const o of options) {
|
|
476
|
+
if ((o.id || o) === (this.value.id || this.value)) {
|
|
477
|
+
validValue = true;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
if (!validValue) {
|
|
481
|
+
this.clear();
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
delete this.searching;
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
FieldSelect.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: FieldSelect, deps: [{ token: MetaReferenceService }, { token: MetaResourceService }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
489
|
+
FieldSelect.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.0", 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'>{{meta.label || meta.name}}</div>\n <div class='vgip-meta-field-value __gu'>\n {{model.label || model.id || model}}\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. </span>\n <span *ngIf=\"f.errors.custom\">{{f.errors.custom}} </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 }] });
|
|
490
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: FieldSelect, decorators: [{
|
|
491
|
+
type: Component,
|
|
492
|
+
args: [{ viewProviders: [{ provide: ControlContainer, useExisting: NgForm }], template: "<div class='vgip-meta-field-preview' *ngIf='preview && model'>\n <div class='vgip-meta-field-label'>{{meta.label || meta.name}}</div>\n <div class='vgip-meta-field-value __gu'>\n {{model.label || model.id || model}}\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. </span>\n <span *ngIf=\"f.errors.custom\">{{f.errors.custom}} </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"] }]
|
|
493
|
+
}], ctorParameters: function () { return [{ type: MetaReferenceService }, { type: MetaResourceService }, { type: i0.ViewContainerRef }]; } });
|
|
494
|
+
|
|
495
|
+
export { FieldSelect };
|
|
496
|
+
//# sourceMappingURL=vgip-meta-ui-index-6bd006d4.mjs.map
|