@vgip/meta-ui 1.5.6 → 1.5.7
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 +481 -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-1911ddae.mjs +1882 -0
- package/fesm2015/vgip-meta-ui-index-1911ddae.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-3f6cd57a.mjs +74 -0
- package/fesm2015/vgip-meta-ui-index-3f6cd57a.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-6dcd556a.mjs +145 -0
- package/fesm2015/vgip-meta-ui-index-6dcd556a.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-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-b925a3a8.mjs +856 -0
- package/fesm2015/vgip-meta-ui-index-b925a3a8.mjs.map +1 -0
- package/fesm2015/vgip-meta-ui-index-dc1b440d.mjs +489 -0
- package/fesm2015/vgip-meta-ui-index-dc1b440d.mjs.map +1 -0
- package/fesm2015/vgip-meta-ui-index-f026e8e5.mjs +71 -0
- package/fesm2015/vgip-meta-ui-index-f026e8e5.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-1a54864a.mjs +70 -0
- package/fesm2020/vgip-meta-ui-index-1a54864a.mjs.map +1 -0
- package/fesm2020/vgip-meta-ui-index-2e6b2b56.mjs +73 -0
- package/fesm2020/vgip-meta-ui-index-2e6b2b56.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-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-7f4f2d15.mjs +142 -0
- package/fesm2020/vgip-meta-ui-index-7f4f2d15.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-9b33fba1.mjs +856 -0
- package/fesm2020/vgip-meta-ui-index-9b33fba1.mjs.map +1 -0
- package/fesm2020/vgip-meta-ui-index-9b590fc8.mjs +488 -0
- package/fesm2020/vgip-meta-ui-index-9b590fc8.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-e73dc574.mjs +1879 -0
- package/fesm2020/vgip-meta-ui-index-e73dc574.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 @@
|
|
|
1
|
+
{"version":3,"file":"vgip-meta-ui-index-2e6b2b56.mjs","sources":["../../../projects/meta-ui/src/lib/fieldList/index.ts","../../../projects/meta-ui/src/lib/fieldList/view.html"],"sourcesContent":["import { Component, OnInit } from '@angular/core';\nimport { FieldAbstract } from '../fieldAbstract';\nimport { ControlContainer, NgForm } from '@angular/forms';\n\n@Component({\n templateUrl: './view.html',\n styleUrls: ['./style.scss'],\n viewProviders: [{ provide: ControlContainer, useExisting: NgForm }]\n})\nexport class FieldList extends FieldAbstract implements OnInit {\n items: Array<any> = [];\n value: any;\n\n get list() {\n return this.meta.list || this.meta.reference;\n }\n\n get cloneList() {\n return JSON.parse(JSON.stringify(this.list));\n }\n\n ngOnInit() {\n const origValue = this.parent[this.meta.name];\n Object.defineProperty(this.parent, this.meta.name, {\n set: (value) => {\n this.model = [];\n if (value && value.length) {\n for (const i of value) {\n if (this.model.indexOf(i) === -1) {\n this.model.push(i);\n }\n }\n }\n this.value = this.model;\n this.meta.$optional = this.isOptional;\n },\n get: () => this.value,\n enumerable: true,\n configurable: true\n });\n if (origValue) {\n this.parent[this.meta.name] = origValue;\n }\n if (!this.model && this.validations.min) {\n for (let i = 0; i < this.validations.min; i++) {\n this.add();\n }\n }\n }\n\n add() {\n if (!this.model) {\n this.model = [];\n }\n if (!this.validations.max || (this.validations.max > this.model.length)) {\n this.model.push({});\n this.value = this.model;\n }\n }\n\n remove(itemIndex) {\n this.model.splice(itemIndex, 1);\n this.value = this.model;\n }\n}\n","<div *ngIf='true' class=\"Vlt-form__element\" [ngClass]=\"{ 'Vlt-form__element--error': (f | metaModel)._parent.submitted && f.invalid }\">\n <label class=\"Vlt-label\">{{meta.label || meta.name}} ({{(model || []).length}})<span *ngIf='validations.required' class='Vlt-red'>*</span></label>\n <small style='margin-bottom: 4px;' *ngIf='meta.hint' class=\"Vlt-form__element__hint\">{{meta.hint}}</small>\n <input class='model' type='hidden' [required]='validations.required' [(ngModel)]='model' #f='ngModel' [name]='name' />\n <ng-container *ngIf='model'>\n <div *ngFor='let item of model; let i = index;' style='display: flex; border-bottom: 1px solid var(--vgip-meta-separator-color);'>\n <vgip-meta-field style='flex: 1;' [index]='i' [meta]='cloneList' [parent]='item' [integrationCode]='integrationCode' [resourceType]='meta.resourceType || resourceType' theme='inherit'></vgip-meta-field>\n <vgip-meta-field *ngIf='meta.selectable' [meta]=\"{ name: meta.selectable.name, label: ' ', type: 'radio', options: [ { id: meta.selectable.value, label: meta.selectable.label } ] }\" [parent]='item' [integrationCode]='integrationCode' theme='inherit' style='margin-left: 12px; margin-top: 12px; margin-right: -12px;'></vgip-meta-field>\n <div style='padding-left: 12px; margin-top: 3px;'>\n <button type='button' (click)='remove(i)' class=\"Vlt-btn Vlt-btn--link item-remove-button\" [disabled]='model.length === (validations.min || 0)' aria-label='Remove'>\n <svg><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-bin\"/></svg>\n </button>\n </div>\n </div>\n </ng-container>\n <button *ngIf='!validations.max || !model || model.length < validations.max' style='width: 100%;' type='button' (click)='add()' class=\"Vlt-btn Vlt-btn--small Vlt-btn--tertiary Vlt-btn--app Vlt-btn--no-focus item-add-button\" [disabled]='validations.max && model && model.length === validations.max'>\n <svg><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-plus\"/></svg>{{list.label}}\n </button>\n <small *ngIf='(f | metaModel)._parent.submitted && f.invalid' class=\"Vlt-form__element__error\">\n <span *ngIf=\"f.errors.required\">Required</span>\n <span *ngIf=\"f.errors.maxlength\">Length can not exceed {{validations.maxlength}} characters</span>\n <span *ngIf=\"f.errors.custom\">{{f.errors.custom}} </span>\n </small>\n <small *ngIf='meta.helpText' class=\"Vlt-form__element__hint\">{{meta.helpText}}</small>\n</div>\n"],"names":["i3.MetaField","i4.MetaModelPipe"],"mappings":";;;;;;;;;;;AASM,MAAO,SAAU,SAAQ,aAAa,CAAA;AAL5C,IAAA,WAAA,GAAA;;QAME,IAAK,CAAA,KAAA,GAAe,EAAE,CAAC;AAsDxB,KAAA;AAnDC,IAAA,IAAI,IAAI,GAAA;QACN,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC;KAC9C;AAED,IAAA,IAAI,SAAS,GAAA;AACX,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;KAC9C;IAED,QAAQ,GAAA;AACN,QAAA,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC9C,QAAA,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;AACjD,YAAA,GAAG,EAAE,CAAC,KAAK,KAAI;AACb,gBAAA,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;AAChB,gBAAA,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE;AACzB,oBAAA,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE;wBACrB,IAAI,IAAI,CAAC,KAAK,CAAC,OA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,CAAA,iBAAA,EAAA,QAAA,EAAA,wIAAA,EAAA,MAAA,EAAA,CAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,qDAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,SAAA,EAAA,gBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAA,SAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,cAAA,EAAA,OAAA,EAAA,SAAA,EAAA,OAAA,CAAA,EAAA,OAAA,EAAA,CAAA,UAAA,EAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAAC,aAAA,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,aAAA,EAAA,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,EAAA,CAAA,CAAA;2FAExD,SAAS,EAAA,UAAA,EAAA,CAAA;kBALrB,SAAS;oCAGO,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,EAAA,QAAA,EAAA,66EAAA,EAAA,MAAA,EAAA,CAAA,mdAAA,CAAA,EAAA,CAAA;;;;;"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
const templateBuilder = (metaContext, pattern) => {
|
|
5
|
+
const context = (metaContext || {}).context;
|
|
6
|
+
if (!context) {
|
|
7
|
+
if (!pattern || typeof (pattern) !== 'string') {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
return (pattern || '').replace(/\${\s*([\w\.]+)\s*}/g, 'N/A');
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
const padTime = (t) => t < 10 ? '0' + t : t;
|
|
15
|
+
const patternBuilder = (pattern || '').replace(/\${\s*([\w\.]+)\s*}/g, (match, value) => {
|
|
16
|
+
switch (value) {
|
|
17
|
+
case 'direction': {
|
|
18
|
+
return (context[value] || '').toUpperCase() === 'INBOUND' ? 'Inbound' : 'Outbound';
|
|
19
|
+
}
|
|
20
|
+
case 'name': {
|
|
21
|
+
return context.contact ? context.contact.name : (context.callerId || 'Unknown');
|
|
22
|
+
}
|
|
23
|
+
case 'contact': { // (FE-BE contract violation)
|
|
24
|
+
return context.contact ? context.contact.name : (context.callerId || 'Unknown');
|
|
25
|
+
}
|
|
26
|
+
case 'type': {
|
|
27
|
+
return context.type ? context.type : '';
|
|
28
|
+
}
|
|
29
|
+
case 'phoneNumber': {
|
|
30
|
+
return context[value];
|
|
31
|
+
}
|
|
32
|
+
case 'directionArrow': {
|
|
33
|
+
return (context.direction || '').toUpperCase() === 'INBOUND' ? '⬇' : '⬆';
|
|
34
|
+
}
|
|
35
|
+
case 'timestamp': {
|
|
36
|
+
try {
|
|
37
|
+
const callTime = new Date(context.answerTime || context.startTime || Date.now());
|
|
38
|
+
const date = callTime.toDateString();
|
|
39
|
+
const time = callTime.toLocaleTimeString();
|
|
40
|
+
return date + ', ' + time;
|
|
41
|
+
}
|
|
42
|
+
catch (e) {
|
|
43
|
+
console.error('context without startTime', e);
|
|
44
|
+
}
|
|
45
|
+
return '';
|
|
46
|
+
}
|
|
47
|
+
case 'duration': {
|
|
48
|
+
try {
|
|
49
|
+
if (typeof (context[value]) === 'number' && context.endTime) {
|
|
50
|
+
return '(' + (context[value]).toFixed() + 'ms)';
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
catch (e) {
|
|
54
|
+
console.error('context without duration', e);
|
|
55
|
+
}
|
|
56
|
+
return '(0ms)';
|
|
57
|
+
}
|
|
58
|
+
case 'durationSec': {
|
|
59
|
+
try {
|
|
60
|
+
if (typeof (context.duration) === 'number' && context.endTime) {
|
|
61
|
+
return '(' + (context.duration / 1000).toFixed() + 's)';
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
catch (e) {
|
|
65
|
+
console.error('call without duration', e);
|
|
66
|
+
}
|
|
67
|
+
return '(0s)';
|
|
68
|
+
}
|
|
69
|
+
case 'durationTime': {
|
|
70
|
+
try {
|
|
71
|
+
if (typeof (context.duration) === 'number' && context.endTime) {
|
|
72
|
+
const duration = context.duration / 1000; // convert it to seconds
|
|
73
|
+
if (duration < 0) {
|
|
74
|
+
return '00:00';
|
|
75
|
+
}
|
|
76
|
+
const hours = Math.floor(duration / 3600);
|
|
77
|
+
const minutes = Math.floor((duration % 3600) / 60);
|
|
78
|
+
const seconds = Math.floor(duration % 60);
|
|
79
|
+
const checkHours = hours ? padTime(hours) + ':' : '';
|
|
80
|
+
return checkHours + padTime(minutes) + ':' + padTime(seconds);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
catch (e) {
|
|
84
|
+
console.error('context without duration', e);
|
|
85
|
+
}
|
|
86
|
+
return '00:00';
|
|
87
|
+
}
|
|
88
|
+
default: {
|
|
89
|
+
return context[value];
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
return patternBuilder;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
/*
|
|
97
|
+
* @Author: Alexander.Vangelov@vonage.com
|
|
98
|
+
* @Date: 2019-09-19 17:35:19
|
|
99
|
+
* @Last Modified by: Alexander.Vangelov@vonage.com
|
|
100
|
+
* @Last Modified time: 2020-03-06 10:10:09
|
|
101
|
+
*/
|
|
102
|
+
class MetaContextService {
|
|
103
|
+
constructor() {
|
|
104
|
+
this.defaultContactables = {};
|
|
105
|
+
this.workers = {};
|
|
106
|
+
this.contactables = {};
|
|
107
|
+
this.profiles = {};
|
|
108
|
+
}
|
|
109
|
+
set(context) {
|
|
110
|
+
if (context) {
|
|
111
|
+
if (context.phoneNumber) {
|
|
112
|
+
this.phoneNumber = context.phoneNumber;
|
|
113
|
+
}
|
|
114
|
+
if (context.displayName) {
|
|
115
|
+
this.displayName = context.displayName;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
MetaContextService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: MetaContextService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
121
|
+
MetaContextService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: MetaContextService, providedIn: 'root' });
|
|
122
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: MetaContextService, decorators: [{
|
|
123
|
+
type: Injectable,
|
|
124
|
+
args: [{
|
|
125
|
+
providedIn: 'root'
|
|
126
|
+
}]
|
|
127
|
+
}], ctorParameters: function () { return []; } });
|
|
128
|
+
|
|
129
|
+
export { MetaContextService as M, templateBuilder as t };
|
|
130
|
+
//# sourceMappingURL=vgip-meta-ui-index-3488da98.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vgip-meta-ui-index-3488da98.mjs","sources":["../../../projects/meta-ui/src/lib/common/utils/templateBuilder.ts","../../../projects/meta-ui/src/lib/services/metaContext/index.ts"],"sourcesContent":["export const templateBuilder = (metaContext, pattern) => {\n const context = (metaContext || {}).context;\n if (!context) {\n if (!pattern || typeof(pattern) !== 'string') {\n return;\n } else {\n return (pattern || '').replace(/\\${\\s*([\\w\\.]+)\\s*}/g, 'N/A');\n }\n }\n\n const padTime = (t) => t < 10 ? '0' + t : t;\n\n const patternBuilder = (pattern || '').replace(/\\${\\s*([\\w\\.]+)\\s*}/g, (match, value) => {\n switch (value) {\n case 'direction': {\n return (context[value] || '').toUpperCase() === 'INBOUND' ? 'Inbound' : 'Outbound';\n }\n case 'name': {\n return context.contact ? context.contact.name : (context.callerId || 'Unknown');\n }\n case 'contact': { // (FE-BE contract violation)\n return context.contact ? context.contact.name : (context.callerId || 'Unknown');\n }\n case 'type': {\n return context.type ? context.type : '';\n }\n case 'phoneNumber': {\n return context[value];\n }\n case 'directionArrow': {\n return (context.direction || '').toUpperCase() === 'INBOUND' ? '⬇' : '⬆';\n }\n case 'timestamp': {\n try {\n const callTime = new Date(context.answerTime || context.startTime || Date.now());\n const date = callTime.toDateString();\n const time = callTime.toLocaleTimeString();\n return date + ', ' + time;\n } catch (e) {\n console.error('context without startTime', e);\n }\n return '';\n }\n case 'duration': {\n try {\n if (typeof (context[value]) === 'number' && context.endTime) {\n return '(' + (context[value]).toFixed() + 'ms)';\n }\n } catch (e) {\n console.error('context without duration', e);\n }\n return '(0ms)';\n }\n case 'durationSec': {\n try {\n if (typeof (context.duration) === 'number' && context.endTime) {\n return '(' + (context.duration / 1000).toFixed() + 's)';\n }\n } catch (e) {\n console.error('call without duration', e);\n }\n return '(0s)';\n }\n case 'durationTime': {\n try {\n if (typeof (context.duration) === 'number' && context.endTime) {\n const duration = context.duration / 1000; // convert it to seconds\n if (duration < 0) {\n return '00:00';\n }\n\n const hours = Math.floor(duration / 3600);\n const minutes = Math.floor((duration % 3600) / 60);\n const seconds = Math.floor(duration % 60);\n\n const checkHours = hours ? padTime(hours) + ':' : '';\n return checkHours + padTime(minutes) + ':' + padTime(seconds);\n }\n } catch (e) {\n console.error('context without duration', e);\n }\n return '00:00';\n }\n default: {\n return context[value];\n }\n }\n });\n return patternBuilder;\n};\n","/*\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: 2020-03-06 10:10:09\n */\n\nimport { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class MetaContextService {\n phoneNumber: string;\n displayName: string;\n defaultContactables: {[integrationCode: string]: any} = {};\n workers: {[integrationCode: string]: any} = {};\n contactables: {[integrationCode: string]: any} = {};\n profiles: {[integrationCode: string]: any} = {};\n vgipEventId: string;\n vgipUserId: string;\n context: any;\n uid: string;\n subject: string;\n\n constructor() {\n\n }\n\n set(context?) {\n if (context) {\n if (context.phoneNumber) {\n this.phoneNumber = context.phoneNumber;\n }\n if (context.displayName) {\n this.displayName = context.displayName;\n }\n }\n }\n}\n"],"names":[],"mappings":";;;MAAa,eAAe,GAAG,CAAC,WAAW,EAAE,OAAO,KAAI;IACtD,MAAM,OAAO,GAAG,CAAC,WAAW,IAAI,EAAE,EAAE,OAAO,CAAC;IAC5C,IAAI,CAAC,OAAO,EAAE;QACZ,IAAI,CAAC,OAAO,IAAI,QAAO,OAAO,CAAC,KAAK,QAAQ,EAAE;YAC5C,OAAO;AACR,SAAA;AAAM,aAAA;AACL,YAAA,OAAO,CAAC,OAAO,IAAI,EAAE,EAAE,OAAO,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;AAC/D,SAAA;AACF,KAAA;IAED,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;AAE5C,IAAA,MAAM,cAAc,GAAG,CAAC,OAAO,IAAI,EAAE,EAAE,OAAO,CAAC,sBAAsB,EAAE,CAAC,KAAK,EAAE,KAAK,KAAI;AACtF,QAAA,QAAQ,KAAK;YACX,KAAK,WAAW,EAAE;gBAChB,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,WAAW,EAAE,KAAK,SAAS,GAAI,SAAS,GAAG,UAAU,CAAC;AACrF,aAAA;YACD,KAAK,MAAM,EAAE;gBACX,OAAO,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,QAAQ,IAAI,SAAS,CAAC,CAAC;AACjF,aAAA;AACD,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AA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,cAFjB,MAAM,EAAA,CAAA,CAAA;2FAEP,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAH9B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;;;"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, Input } from '@angular/core';
|
|
3
|
+
import * as i2 from '@angular/forms';
|
|
4
|
+
import { ControlContainer, NgForm } from '@angular/forms';
|
|
5
|
+
import { F as FieldAbstract } from './vgip-meta-ui-fieldAbstract-2d0882f1.mjs';
|
|
6
|
+
import * as i1 from '@angular/common';
|
|
7
|
+
import { M as MetaModelPipe } from './vgip-meta-ui-metaModel.pipe-725f401c.mjs';
|
|
8
|
+
import 'rxjs';
|
|
9
|
+
import 'rxjs/operators';
|
|
10
|
+
|
|
11
|
+
/*
|
|
12
|
+
* @Author: Alexander.Vangelov@vonage.com
|
|
13
|
+
* @Date: 2019-09-19 17:35:19
|
|
14
|
+
* @Last Modified by: Alexander.Vangelov@vonage.com
|
|
15
|
+
* @Last Modified time: 2020-03-26 12:56:38
|
|
16
|
+
*/
|
|
17
|
+
class FieldRadio extends FieldAbstract {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
this.keydown = (event) => {
|
|
21
|
+
switch (event.key) {
|
|
22
|
+
case 'Backspace': {
|
|
23
|
+
event.preventDefault();
|
|
24
|
+
event.stopPropagation();
|
|
25
|
+
this.clear();
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
get options() {
|
|
32
|
+
return this.meta.options || this.meta.picklist;
|
|
33
|
+
}
|
|
34
|
+
ngOnInit() {
|
|
35
|
+
this.validationAttributes = ['required'];
|
|
36
|
+
const origValue = this.parent[this.meta.name];
|
|
37
|
+
Object.defineProperty(this.parent, this.meta.name, {
|
|
38
|
+
set: (value) => {
|
|
39
|
+
if (value) {
|
|
40
|
+
for (const o of this.options) {
|
|
41
|
+
if ((value.id || value) === (o.id || o.value || o.name || o)) {
|
|
42
|
+
this.model = o;
|
|
43
|
+
this.value = this.modelToValue(o, this.meta.valueType);
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
delete this.model;
|
|
50
|
+
delete this.value;
|
|
51
|
+
}
|
|
52
|
+
this.meta.$optional = this.isOptional;
|
|
53
|
+
},
|
|
54
|
+
get: () => this.value,
|
|
55
|
+
enumerable: this.sendToServer,
|
|
56
|
+
configurable: true
|
|
57
|
+
});
|
|
58
|
+
if (origValue) {
|
|
59
|
+
this.parent[this.meta.name] = origValue;
|
|
60
|
+
}
|
|
61
|
+
if (this.default && !this.model) {
|
|
62
|
+
setTimeout(() => {
|
|
63
|
+
this.parent[this.meta.name] = this.meta.valueType === 'object' ? this.default : (this.default.id || this.default);
|
|
64
|
+
setTimeout(() => {
|
|
65
|
+
this.onModelChange(this.model);
|
|
66
|
+
}, 0);
|
|
67
|
+
}, 0);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
onOptionChange(model) {
|
|
71
|
+
this.model = model;
|
|
72
|
+
this.onModelChange(this.model);
|
|
73
|
+
}
|
|
74
|
+
onActivated(ev) {
|
|
75
|
+
if (!this.keyListenerActive) {
|
|
76
|
+
ev.srcElement.addEventListener('keydown', this.keydown);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
onBlur(ev) {
|
|
80
|
+
if (this.keyListenerActive) {
|
|
81
|
+
ev.srcElement.removeEventListener('keydown', this.keydown);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
FieldRadio.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: FieldRadio, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
86
|
+
FieldRadio.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.0", type: FieldRadio, selector: "ng-component", inputs: { meta: "meta" }, usesInheritance: true, ngImport: i0, template: "<div class=\"Vlt-form__element\" [ngClass]=\"{ 'Vlt-form__element--error': f && f.invalid && ((f | metaModel)._parent.submitted || (f | metaModel ).touched) }\">\n\t<label class=\"Vlt-label\">{{meta.label || meta.name}}<span *ngIf='validations.required' class='Vlt-red'>*</span></label>\n\t<input class='model' type='hidden' [required]='validations.required' [(ngModel)]='model' #f='ngModel' [name]='name' />\n\t<fieldset *ngFor='let option of options' class=\"Vlt-radio Vlt-radio--inline\">\n\t\t<label style='cursor: pointer;'>\n\t\t\t<span class=\"Vlt-radio__button\">\n <input class='main' (change)='onOptionChange(option)' type=\"radio\" [checked]='option === model' [value]='option' [name]='name' (focus)='onActivated($event)' (blur)='onBlur($event)'/>\n <span class=\"Vlt-radio__icon\"></span>\n </span>\n\t\t\t<span style='white-space: nowrap;'>{{option.label || option}}</span>\n\t\t</label>\n\t</fieldset>\n\t<small *ngIf='f && f.invalid && ((f | metaModel)._parent.submitted || (f | metaModel ).touched)' class=\"Vlt-form__element__error\">\n\t\t<span *ngIf=\"f.errors.required\">Required. </span>\n\t\t<span *ngIf=\"f.errors.custom\">{{f.errors.custom}} </span>\n\t</small>\n\t<small *ngIf='meta.hint' class=\"Vlt-form__element__hint\">{{meta.hint}}</small>\n</div>", styles: [".Vlt-form__element{padding-bottom:4px}.Vlt-form__element__hint,.Vlt-form__element__error{margin-top:4px}.Vlt-radio--inline{margin-bottom:4px}.Vlt-radio .Vlt-radio__icon{border-color:var(--vgip-meta-input-border-color)}.Vlt-radio:hover .Vlt-radio__icon{border-color:var(--vgip-meta-input-active-border-color)}.Vlt-radio input:checked~.Vlt-radio__icon{border-color:var(--vgip-meta-input-active-border-color)}.Vlt-radio input:checked~.Vlt-radio__icon:after{background:var(--vgip-meta-input-active-border-color)}.Vlt-radio input:focus+.Vlt-radio__icon,.Vlt-radio input:active+.Vlt-radio__icon{background:var(--vgip-meta-input-bg-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.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 }] });
|
|
87
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: FieldRadio, decorators: [{
|
|
88
|
+
type: Component,
|
|
89
|
+
args: [{ viewProviders: [{ provide: ControlContainer, useExisting: NgForm }], template: "<div class=\"Vlt-form__element\" [ngClass]=\"{ 'Vlt-form__element--error': f && f.invalid && ((f | metaModel)._parent.submitted || (f | metaModel ).touched) }\">\n\t<label class=\"Vlt-label\">{{meta.label || meta.name}}<span *ngIf='validations.required' class='Vlt-red'>*</span></label>\n\t<input class='model' type='hidden' [required]='validations.required' [(ngModel)]='model' #f='ngModel' [name]='name' />\n\t<fieldset *ngFor='let option of options' class=\"Vlt-radio Vlt-radio--inline\">\n\t\t<label style='cursor: pointer;'>\n\t\t\t<span class=\"Vlt-radio__button\">\n <input class='main' (change)='onOptionChange(option)' type=\"radio\" [checked]='option === model' [value]='option' [name]='name' (focus)='onActivated($event)' (blur)='onBlur($event)'/>\n <span class=\"Vlt-radio__icon\"></span>\n </span>\n\t\t\t<span style='white-space: nowrap;'>{{option.label || option}}</span>\n\t\t</label>\n\t</fieldset>\n\t<small *ngIf='f && f.invalid && ((f | metaModel)._parent.submitted || (f | metaModel ).touched)' class=\"Vlt-form__element__error\">\n\t\t<span *ngIf=\"f.errors.required\">Required. </span>\n\t\t<span *ngIf=\"f.errors.custom\">{{f.errors.custom}} </span>\n\t</small>\n\t<small *ngIf='meta.hint' class=\"Vlt-form__element__hint\">{{meta.hint}}</small>\n</div>", styles: [".Vlt-form__element{padding-bottom:4px}.Vlt-form__element__hint,.Vlt-form__element__error{margin-top:4px}.Vlt-radio--inline{margin-bottom:4px}.Vlt-radio .Vlt-radio__icon{border-color:var(--vgip-meta-input-border-color)}.Vlt-radio:hover .Vlt-radio__icon{border-color:var(--vgip-meta-input-active-border-color)}.Vlt-radio input:checked~.Vlt-radio__icon{border-color:var(--vgip-meta-input-active-border-color)}.Vlt-radio input:checked~.Vlt-radio__icon:after{background:var(--vgip-meta-input-active-border-color)}.Vlt-radio input:focus+.Vlt-radio__icon,.Vlt-radio input:active+.Vlt-radio__icon{background:var(--vgip-meta-input-bg-color)}\n"] }]
|
|
90
|
+
}], propDecorators: { meta: [{
|
|
91
|
+
type: Input
|
|
92
|
+
}] } });
|
|
93
|
+
|
|
94
|
+
export { FieldRadio };
|
|
95
|
+
//# sourceMappingURL=vgip-meta-ui-index-5615e618.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vgip-meta-ui-index-5615e618.mjs","sources":["../../../projects/meta-ui/src/lib/fieldRadio/index.ts","../../../projects/meta-ui/src/lib/fieldRadio/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: 2020-03-26 12:56:38\n */\n\nimport { Component, Input, OnInit } from '@angular/core';\nimport { ControlContainer, NgForm } from '@angular/forms';\n\nimport { FieldAbstract } from '../fieldAbstract';\n\n@Component({\n templateUrl: './view.html',\n styleUrls: ['./style.scss'],\n viewProviders: [{ provide: ControlContainer, useExisting: NgForm }]\n})\n\nexport class FieldRadio extends FieldAbstract implements OnInit {\n @Input() meta: any;\n value: any;\n\n get options() {\n return this.meta.options || this.meta.picklist;\n }\n\n ngOnInit() {\n this.validationAttributes = ['required'];\n const origValue = this.parent[this.meta.name];\n Object.defineProperty(this.parent, this.meta.name, {\n set: (value) => {\n if (value) {\n for (const o of this.options) {\n if ((value.id || value) === (o.id || o.value || o.name || o)) {\n this.model = o;\n this.value = this.modelToValue(o, this.meta.valueType);\n break;\n }\n }\n } else {\n delete this.model;\n delete this.value;\n }\n this.meta.$optional = this.isOptional;\n },\n get: () => this.value,\n enumerable: this.sendToServer,\n configurable: true\n });\n\n if (origValue) {\n this.parent[this.meta.name] = origValue;\n }\n\n if (this.default && !this.model) {\n setTimeout(() => {\n this.parent[this.meta.name] = this.meta.valueType === 'object' ? this.default : (this.default.id || this.default);\n setTimeout(() => {\n this.onModelChange(this.model);\n }, 0);\n }, 0);\n }\n }\n\n onOptionChange(model) {\n this.model = model;\n this.onModelChange(this.model);\n }\n\n onActivated(ev) {\n if (!this.keyListenerActive) {\n ev.srcElement.addEventListener('keydown', this.keydown);\n }\n }\n\n onBlur(ev) {\n if (this.keyListenerActive) {\n ev.srcElement.removeEventListener('keydown', this.keydown);\n }\n }\n\n private keydown = (event) => {\n switch (event.key) {\n case 'Backspace': {\n event.preventDefault();\n event.stopPropagation();\n this.clear();\n break;\n }\n }\n };\n}\n","<div class=\"Vlt-form__element\" [ngClass]=\"{ 'Vlt-form__element--error': f && f.invalid && ((f | metaModel)._parent.submitted || (f | metaModel ).touched) }\">\n\t<label class=\"Vlt-label\">{{meta.label || meta.name}}<span *ngIf='validations.required' class='Vlt-red'>*</span></label>\n\t<input class='model' type='hidden' [required]='validations.required' [(ngModel)]='model' #f='ngModel' [name]='name' />\n\t<fieldset *ngFor='let option of options' class=\"Vlt-radio Vlt-radio--inline\">\n\t\t<label style='cursor: pointer;'>\n\t\t\t<span class=\"Vlt-radio__button\">\n <input class='main' (change)='onOptionChange(option)' type=\"radio\" [checked]='option === model' [value]='option' [name]='name' (focus)='onActivated($event)' (blur)='onBlur($event)'/>\n <span class=\"Vlt-radio__icon\"></span>\n </span>\n\t\t\t<span style='white-space: nowrap;'>{{option.label || option}}</span>\n\t\t</label>\n\t</fieldset>\n\t<small *ngIf='f && f.invalid && ((f | metaModel)._parent.submitted || (f | metaModel ).touched)' class=\"Vlt-form__element__error\">\n\t\t<span *ngIf=\"f.errors.required\">Required. </span>\n\t\t<span *ngIf=\"f.errors.custom\">{{f.errors.custom}} </span>\n\t</small>\n\t<small *ngIf='meta.hint' class=\"Vlt-form__element__hint\">{{meta.hint}}</small>\n</div>"],"names":["i3.MetaModelPipe"],"mappings":";;;;;;;;;;AAAA;;;;;AAKG;AAaG,MAAO,UAAW,SAAQ,aAAa,CAAA;AAN7C,IAAA,WAAA,GAAA;;AAqEU,QAAA,IAAA,CAAA,OAAO,GAAG,CAAC,KAAK,KAAI;YAC1B,QAAQ,KAAK,CAAC,GAAG;gBACf,KAAK,WAAW,EAAE;oBAChB,KAAK,CAAC,cAAc,EAAE,CAAC;oBACvB,KAAK,CAAC,eAAe,EAAE,CAAC;oBACxB,IAAI,CAAC,KAAK,EAAE,CAAC;oBACb,MAAM;AACP,iBAAA;AACF,aAAA;AACH,SAAC,CAAC;AACH,KAAA;AArEC,IAAA,IAAI,OAAO,GAAA;QACT,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;KAChD;I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AAA,EAAA,IAAA,EAAAA,aAAA,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,aAAA,EAAA,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,EAAA,CAAA,CAAA;2FAGxD,UAAU,EAAA,UAAA,EAAA,CAAA;kBANtB,SAAS;oCAGO,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,EAAA,QAAA,EAAA,4xCAAA,EAAA,MAAA,EAAA,CAAA,4nBAAA,CAAA,EAAA,CAAA;8BAI1D,IAAI,EAAA,CAAA;sBAAZ,KAAK;;;;;"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, Input } from '@angular/core';
|
|
3
|
+
import * as i2 from '@angular/forms';
|
|
4
|
+
import { ControlContainer, NgForm } from '@angular/forms';
|
|
5
|
+
import { F as FieldAbstract } from './vgip-meta-ui-fieldAbstract-2d0882f1.mjs';
|
|
6
|
+
import * as i1 from '@angular/common';
|
|
7
|
+
import { M as MetaModelPipe } from './vgip-meta-ui-metaModel.pipe-725f401c.mjs';
|
|
8
|
+
import 'rxjs';
|
|
9
|
+
import 'rxjs/operators';
|
|
10
|
+
|
|
11
|
+
/*
|
|
12
|
+
* @Author: Alexander.Vangelov@vonage.com
|
|
13
|
+
* @Date: 2019-09-19 17:34:49
|
|
14
|
+
* @Last Modified by: Alexander.Vangelov@vonage.com
|
|
15
|
+
* @Last Modified time: 2020-03-26 12:57:51
|
|
16
|
+
*/
|
|
17
|
+
// import { tMetaField } from '../../../metaTypes/tMetaField'
|
|
18
|
+
class FieldBoolean extends FieldAbstract {
|
|
19
|
+
ngOnInit() {
|
|
20
|
+
const origValue = this.parent[this.meta.name];
|
|
21
|
+
Object.defineProperty(this.parent, this.meta.name, {
|
|
22
|
+
set: (value) => {
|
|
23
|
+
if (typeof (value) === 'object' && value !== null) {
|
|
24
|
+
value = value.value || value.id || false;
|
|
25
|
+
}
|
|
26
|
+
if (!value && (typeof (this.prevModel) === 'boolean') && this.isPersistedParent) {
|
|
27
|
+
value = false;
|
|
28
|
+
}
|
|
29
|
+
this.model = (value === true) || (value != null && (['true', '1'].indexOf(value.toString().toLowerCase()) !== -1));
|
|
30
|
+
this.value = this.model;
|
|
31
|
+
this.meta.$optional = this.isOptional;
|
|
32
|
+
},
|
|
33
|
+
get: () => this.value,
|
|
34
|
+
enumerable: this.sendToServer,
|
|
35
|
+
configurable: true
|
|
36
|
+
});
|
|
37
|
+
if (typeof (origValue) !== 'undefined') {
|
|
38
|
+
this.parent[this.meta.name] = origValue;
|
|
39
|
+
}
|
|
40
|
+
if (typeof (this.meta.default) !== 'undefined' && typeof (this.model) === 'undefined' && !(this.meta.default instanceof Array)) {
|
|
41
|
+
setTimeout(() => {
|
|
42
|
+
this.parent[this.meta.name] = this.meta.default;
|
|
43
|
+
}, 0);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
FieldBoolean.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: FieldBoolean, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
48
|
+
FieldBoolean.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.0", type: FieldBoolean, selector: "ng-component", inputs: { meta: "meta" }, 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 ? '\u2714' : '\u2718'}}\n </div>\n</div>\n<div *ngIf='!preview' class=\"Vlt-form__element\" [ngClass]=\"{ 'Vlt-form__element--error': f.invalid && ((f | metaModel)._parent.submitted || (f | metaModel ).touched) }\">\n\t<input class='model' type='hidden' [required]='validations.required' [(ngModel)]='model' #f='ngModel' [name]='name' />\n\t<div class=\"Vlt-switch\" *ngIf=\"meta.subtype === 'switch'\">\n\t\t<label style='vertical-align: middle;'>\n\t\t\t<input class='model' type=\"checkbox\" [(ngModel)]='parent[meta.name]' [name]='name'/>\n\t\t\t<span class=\"Vlt-switch__slider\"></span>\n\t\t\t<span style='margin-left: 60px; line-height: 30px; white-space: nowrap;'>{{meta.label || meta.name}}</span>\n\t\t</label>\n\t</div>\n\t<div class=\"Vlt-checkbox\" *ngIf=\"meta.subtype !== 'switch'\">\n\t\t<label style='cursor: pointer;'>\n\t\t\t<span class=\"Vlt-checkbox__button\">\n\t\t\t\t<input class='model' type=\"checkbox\" [(ngModel)]='parent[meta.name]' [name]='name'/>\n\t\t\t\t<span class=\"Vlt-checkbox__icon\"></span>\n\t\t\t</span>\n\t\t\t{{meta.label || meta.name}}\n\t\t</label>\n\t</div>\n\t<small *ngIf='f.invalid && ((f | metaModel)._parent.submitted || ((f | metaModel ).touched))' 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\t<small *ngIf='meta.hint' class=\"Vlt-form__element__hint\">{{meta.hint}}</small>\n</div>\n", styles: [".Vlt-checkbox+.Vlt-form__element__hint{margin-top:4px}.Vlt-checkbox__button input:not(:checked)~.Vlt-checkbox__icon{background-color:var(--vgip-meta-input-bg-color);border-color:var(--vgip-meta-input-border-color)}.Vlt-checkbox__button input:checked~.Vlt-checkbox__icon{border-color:var(--vgip-meta-input-border-color)}.Vlt-checkbox__button input:hover:not(:checked)~.Vlt-checkbox__icon,.Vlt-checkbox__button input:focus:not(:checked)~.Vlt-checkbox__icon,.Vlt-checkbox__button input:active:not(:checked)~.Vlt-checkbox__icon{border-color:var(--vgip-meta-input-active-border-color)}.Vlt-checkbox__button input:hover:checked~.Vlt-checkbox__icon,.Vlt-checkbox__button input:focus:checked~.Vlt-checkbox__icon,.Vlt-checkbox__button input:active:checked~.Vlt-checkbox__icon{border-color:var(--vgip-meta-input-accent-color)}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { 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.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { 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 }] });
|
|
49
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: FieldBoolean, decorators: [{
|
|
50
|
+
type: Component,
|
|
51
|
+
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 ? '\u2714' : '\u2718'}}\n </div>\n</div>\n<div *ngIf='!preview' class=\"Vlt-form__element\" [ngClass]=\"{ 'Vlt-form__element--error': f.invalid && ((f | metaModel)._parent.submitted || (f | metaModel ).touched) }\">\n\t<input class='model' type='hidden' [required]='validations.required' [(ngModel)]='model' #f='ngModel' [name]='name' />\n\t<div class=\"Vlt-switch\" *ngIf=\"meta.subtype === 'switch'\">\n\t\t<label style='vertical-align: middle;'>\n\t\t\t<input class='model' type=\"checkbox\" [(ngModel)]='parent[meta.name]' [name]='name'/>\n\t\t\t<span class=\"Vlt-switch__slider\"></span>\n\t\t\t<span style='margin-left: 60px; line-height: 30px; white-space: nowrap;'>{{meta.label || meta.name}}</span>\n\t\t</label>\n\t</div>\n\t<div class=\"Vlt-checkbox\" *ngIf=\"meta.subtype !== 'switch'\">\n\t\t<label style='cursor: pointer;'>\n\t\t\t<span class=\"Vlt-checkbox__button\">\n\t\t\t\t<input class='model' type=\"checkbox\" [(ngModel)]='parent[meta.name]' [name]='name'/>\n\t\t\t\t<span class=\"Vlt-checkbox__icon\"></span>\n\t\t\t</span>\n\t\t\t{{meta.label || meta.name}}\n\t\t</label>\n\t</div>\n\t<small *ngIf='f.invalid && ((f | metaModel)._parent.submitted || ((f | metaModel ).touched))' 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\t<small *ngIf='meta.hint' class=\"Vlt-form__element__hint\">{{meta.hint}}</small>\n</div>\n", styles: [".Vlt-checkbox+.Vlt-form__element__hint{margin-top:4px}.Vlt-checkbox__button input:not(:checked)~.Vlt-checkbox__icon{background-color:var(--vgip-meta-input-bg-color);border-color:var(--vgip-meta-input-border-color)}.Vlt-checkbox__button input:checked~.Vlt-checkbox__icon{border-color:var(--vgip-meta-input-border-color)}.Vlt-checkbox__button input:hover:not(:checked)~.Vlt-checkbox__icon,.Vlt-checkbox__button input:focus:not(:checked)~.Vlt-checkbox__icon,.Vlt-checkbox__button input:active:not(:checked)~.Vlt-checkbox__icon{border-color:var(--vgip-meta-input-active-border-color)}.Vlt-checkbox__button input:hover:checked~.Vlt-checkbox__icon,.Vlt-checkbox__button input:focus:checked~.Vlt-checkbox__icon,.Vlt-checkbox__button input:active:checked~.Vlt-checkbox__icon{border-color:var(--vgip-meta-input-accent-color)}\n"] }]
|
|
52
|
+
}], propDecorators: { meta: [{
|
|
53
|
+
type: Input
|
|
54
|
+
}] } });
|
|
55
|
+
|
|
56
|
+
export { FieldBoolean };
|
|
57
|
+
//# sourceMappingURL=vgip-meta-ui-index-65c10356.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vgip-meta-ui-index-65c10356.mjs","sources":["../../../projects/meta-ui/src/lib/fieldBoolean/index.ts","../../../projects/meta-ui/src/lib/fieldBoolean/view.html"],"sourcesContent":["/*\n * @Author: Alexander.Vangelov@vonage.com \n * @Date: 2019-09-19 17:34:49 \n * @Last Modified by: Alexander.Vangelov@vonage.com\n * @Last Modified time: 2020-03-26 12:57:51\n */\n\nimport { Component, Input, OnInit } from '@angular/core';\nimport { ControlContainer, NgForm } from '@angular/forms';\n\nimport { FieldAbstract } from '../fieldAbstract';\n// import { tMetaField } from '../../../metaTypes/tMetaField'\n\n@Component({\n templateUrl: './view.html',\n styleUrls: ['./style.scss'],\n viewProviders: [{ provide: ControlContainer, useExisting: NgForm }]\n})\nexport class FieldBoolean extends FieldAbstract implements OnInit {\n @Input() meta: any;\n value: boolean;\n\n ngOnInit() {\n const origValue = this.parent[this.meta.name];\n Object.defineProperty(this.parent, this.meta.name, {\n set: (value) => {\n if (typeof (value) === 'object' && value !== null) {\n value = value.value || value.id || false;\n }\n if (!value && (typeof(this.prevModel) === 'boolean') && this.isPersistedParent) {\n value = false;\n }\n this.model = (value === true) || (value != null && (['true', '1'].indexOf(value.toString().toLowerCase()) !== -1));\n this.value = this.model;\n this.meta.$optional = this.isOptional;\n },\n get: () => this.value,\n enumerable: this.sendToServer,\n configurable: true\n });\n if (typeof(origValue) !== 'undefined') {\n this.parent[this.meta.name] = origValue;\n }\n if (typeof(this.meta.default) !== 'undefined' && typeof(this.model) === 'undefined' && !(this.meta.default instanceof Array)) {\n setTimeout(() => {\n this.parent[this.meta.name] = this.meta.default;\n }, 0);\n }\n }\n}\n","<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 ? '✔' : '✘'}}\n </div>\n</div>\n<div *ngIf='!preview' class=\"Vlt-form__element\" [ngClass]=\"{ 'Vlt-form__element--error': f.invalid && ((f | metaModel)._parent.submitted || (f | metaModel ).touched) }\">\n\t<input class='model' type='hidden' [required]='validations.required' [(ngModel)]='model' #f='ngModel' [name]='name' />\n\t<div class=\"Vlt-switch\" *ngIf=\"meta.subtype === 'switch'\">\n\t\t<label style='vertical-align: middle;'>\n\t\t\t<input class='model' type=\"checkbox\" [(ngModel)]='parent[meta.name]' [name]='name'/>\n\t\t\t<span class=\"Vlt-switch__slider\"></span>\n\t\t\t<span style='margin-left: 60px; line-height: 30px; white-space: nowrap;'>{{meta.label || meta.name}}</span>\n\t\t</label>\n\t</div>\n\t<div class=\"Vlt-checkbox\" *ngIf=\"meta.subtype !== 'switch'\">\n\t\t<label style='cursor: pointer;'>\n\t\t\t<span class=\"Vlt-checkbox__button\">\n\t\t\t\t<input class='model' type=\"checkbox\" [(ngModel)]='parent[meta.name]' [name]='name'/>\n\t\t\t\t<span class=\"Vlt-checkbox__icon\"></span>\n\t\t\t</span>\n\t\t\t{{meta.label || meta.name}}\n\t\t</label>\n\t</div>\n\t<small *ngIf='f.invalid && ((f | metaModel)._parent.submitted || ((f | metaModel ).touched))' 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\t<small *ngIf='meta.hint' class=\"Vlt-form__element__hint\">{{meta.hint}}</small>\n</div>\n"],"names":["i3.MetaModelPipe"],"mappings":";;;;;;;;;;AAAA;;;;;AAKG;AAMH;AAOM,MAAO,YAAa,SAAQ,aAAa,CAAA;IAI7C,QAAQ,GAAA;AACN,QAAA,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,I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,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,QAAA,EAAA,2CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,iBAAA,EAAA,QAAA,EAAA,wIAAA,EAAA,MAAA,EAAA,CAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,qDAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,SAAA,EAAA,gBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAAA,aAAA,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,aAAA,EAAA,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,EAAA,CAAA,CAAA;2FAExD,YAAY,EAAA,UAAA,EAAA,CAAA;kBALxB,SAAS;oCAGO,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,EAAA,QAAA,EAAA,goDAAA,EAAA,MAAA,EAAA,CAAA,ozBAAA,CAAA,EAAA,CAAA;8BAG1D,IAAI,EAAA,CAAA;sBAAZ,KAAK;;;;;"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Directive, EventEmitter, Component, Input, Output, ViewChild } from '@angular/core';
|
|
3
|
+
import { F as FieldAbstract } from './vgip-meta-ui-fieldAbstract-2d0882f1.mjs';
|
|
4
|
+
|
|
5
|
+
const FMAP = async (fType) => {
|
|
6
|
+
switch (fType) {
|
|
7
|
+
case '':
|
|
8
|
+
case null:
|
|
9
|
+
case undefined:
|
|
10
|
+
case 'number':
|
|
11
|
+
// case 'datetime':
|
|
12
|
+
// case 'time':
|
|
13
|
+
// case 'date':
|
|
14
|
+
case 'string': { // eslint-disable-line no-fallthrough
|
|
15
|
+
// return FieldInput;
|
|
16
|
+
return import('./vgip-meta-ui-index-fa0b1b8b.mjs').then(m => m.FieldInput);
|
|
17
|
+
}
|
|
18
|
+
case 'textarea':
|
|
19
|
+
case 'text': {
|
|
20
|
+
// return FieldText;
|
|
21
|
+
return import('./vgip-meta-ui-index-934aeabf.mjs').then(m => m.FieldText);
|
|
22
|
+
}
|
|
23
|
+
case 'select':
|
|
24
|
+
case 'options': {
|
|
25
|
+
// return FieldSelect;
|
|
26
|
+
return import('./vgip-meta-ui-index-9b590fc8.mjs').then(m => m.FieldSelect);
|
|
27
|
+
}
|
|
28
|
+
case 'reference': {
|
|
29
|
+
// return FieldReference;
|
|
30
|
+
return import('./vgip-meta-ui-index-9b33fba1.mjs').then(function (n) { return n.i; }).then(m => m.FieldReference);
|
|
31
|
+
}
|
|
32
|
+
case 'composite': {
|
|
33
|
+
// return FieldComposite;
|
|
34
|
+
return import('./vgip-meta-ui-index-1a54864a.mjs').then(m => m.FieldComposite);
|
|
35
|
+
}
|
|
36
|
+
case 'boolean': {
|
|
37
|
+
// return FieldBoolean;
|
|
38
|
+
return import('./vgip-meta-ui-index-65c10356.mjs').then(m => m.FieldBoolean);
|
|
39
|
+
}
|
|
40
|
+
case 'radio': {
|
|
41
|
+
// return FieldRadio;
|
|
42
|
+
return import('./vgip-meta-ui-index-5615e618.mjs').then(m => m.FieldRadio);
|
|
43
|
+
}
|
|
44
|
+
case 'list': {
|
|
45
|
+
// return FieldList;
|
|
46
|
+
return import('./vgip-meta-ui-index-2e6b2b56.mjs').then(m => m.FieldList);
|
|
47
|
+
}
|
|
48
|
+
case 'richtext': {
|
|
49
|
+
// return FieldRichtext;
|
|
50
|
+
return import('./vgip-meta-ui-index-9b5ee0c4.mjs').then(m => m.FieldRichtext);
|
|
51
|
+
}
|
|
52
|
+
case 'datetime':
|
|
53
|
+
case 'time':
|
|
54
|
+
case 'date': {
|
|
55
|
+
// return FieldDatetime;
|
|
56
|
+
return import('./vgip-meta-ui-index-0068fb77.mjs').then(m => m.FieldDatetime);
|
|
57
|
+
}
|
|
58
|
+
default: {
|
|
59
|
+
// return FieldUnknown;
|
|
60
|
+
return import('./vgip-meta-ui-index-8f5be5a7.mjs').then(m => m.FieldUnknown);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
class MetaFieldContentDirective {
|
|
65
|
+
constructor(viewContainerRef) {
|
|
66
|
+
this.viewContainerRef = viewContainerRef;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
MetaFieldContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: MetaFieldContentDirective, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
70
|
+
MetaFieldContentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0", type: MetaFieldContentDirective, selector: "[metaFieldContent]", ngImport: i0 });
|
|
71
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: MetaFieldContentDirective, decorators: [{
|
|
72
|
+
type: Directive,
|
|
73
|
+
args: [{
|
|
74
|
+
selector: '[metaFieldContent]'
|
|
75
|
+
}]
|
|
76
|
+
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; } });
|
|
77
|
+
class MetaField extends FieldAbstract {
|
|
78
|
+
constructor(el) {
|
|
79
|
+
super();
|
|
80
|
+
this.el = el;
|
|
81
|
+
// eslint-disable-next-line
|
|
82
|
+
this.onChange = new EventEmitter();
|
|
83
|
+
// eslint-disable-next-line
|
|
84
|
+
this.onLeave = new EventEmitter();
|
|
85
|
+
}
|
|
86
|
+
async ngOnInit() {
|
|
87
|
+
const component = await FMAP(this.meta.type);
|
|
88
|
+
this.fieldContent.viewContainerRef.clear();
|
|
89
|
+
const componentRef = this.fieldContent.viewContainerRef.createComponent(component);
|
|
90
|
+
const field = componentRef.instance;
|
|
91
|
+
if (component.setup) {
|
|
92
|
+
// console.log('setup', {a: this.el.nativeElement.parentNode.parentNode})
|
|
93
|
+
component.setup(field, this.parent, this.meta);
|
|
94
|
+
}
|
|
95
|
+
field.meta = this.meta;
|
|
96
|
+
field.parent = this.parent;
|
|
97
|
+
field.integrationCode = (this.integrationCode || '').toLowerCase();
|
|
98
|
+
field.resourceType = (this.resourceType || '');
|
|
99
|
+
field.index = this.index;
|
|
100
|
+
field.elementRef = this.el;
|
|
101
|
+
field.onChange = this.onChange;
|
|
102
|
+
field.onLeave = this.onLeave;
|
|
103
|
+
field.preview = this.preview;
|
|
104
|
+
field.theme = this.theme;
|
|
105
|
+
Object.defineProperty(field.meta, 'unset', {
|
|
106
|
+
value: false,
|
|
107
|
+
writable: true,
|
|
108
|
+
configurable: true,
|
|
109
|
+
enumerable: false
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
MetaField.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: MetaField, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
114
|
+
MetaField.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.0", type: MetaField, selector: "vgip-meta-field", inputs: { meta: "meta", parent: "parent", integrationCode: "integrationCode", resourceType: "resourceType", index: "index", preview: "preview", theme: "theme" }, outputs: { onChange: "onChange", onLeave: "onLeave" }, viewQueries: [{ propertyName: "fieldContent", first: true, predicate: MetaFieldContentDirective, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: '<ng-template metaFieldContent>Loading</ng-template>', isInline: true, styles: [":host ::ng-deep label.wrapper{padding:0;pointer-events:initial;position:initial;top:initial;transition:none}@media only screen and (max-width: 575px){:host ::ng-deep .hidden-mobile{display:none}}@media only screen and (min-width: 576px){:host ::ng-deep .hidden-desktop{display:none}}:host ::ng-deep .Vlt-form__element>.Vlt-label,:host ::ng-deep .Vlt-form__element>label>.Vlt-label{margin-top:-6px}:host ::ng-deep .Vlt-form__element .Vlt-form__element__hint{color:var(--vgip-meta-input-hint-color)}:host ::ng-deep .Vlt-form__element .Vlt-input input,:host ::ng-deep .Vlt-form__element .Vlt-select select,:host ::ng-deep .Vlt-form__element .Vlt-textarea textarea{color:var(--vgip-meta-input-color)}@media (hover: none){:host ::ng-deep .Vlt-form__element .Vlt-input input,:host ::ng-deep .Vlt-form__element .Vlt-select select,:host ::ng-deep .Vlt-form__element .Vlt-textarea textarea{font-size:16px}}:host ::ng-deep .Vlt-form__element .Vlt-input input::placeholder,:host ::ng-deep .Vlt-form__element .Vlt-select select::placeholder,:host ::ng-deep .Vlt-form__element .Vlt-textarea textarea::placeholder{color:var(--vgip-meta-input-placeholder-color)}:host ::ng-deep .Vlt-form__element label{color:var(--vgip-meta-input-label-color)}:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-form-error-style,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-input input,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-input input.ng-untouched:invalid,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-select select.ng-untouched:invalid,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-textarea textarea,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-textarea textarea.ng-untouched:invalid,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-custom-select__input:invalid,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-radio input.ng-untouched:invalid+.Vlt-radio__icon,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-radio input.ng-untouched:invalid+.Vlt-checkbox__icon,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-checkbox input.ng-untouched:invalid+.Vlt-radio__icon,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-checkbox input.ng-untouched:invalid+.Vlt-checkbox__icon{background:var(--vgip-meta-input-bg-color);border-color:var(--vgip-meta-input-border-color)}:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-form-error-style:disabled,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-input input:disabled,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-input input.ng-untouched:invalid:disabled,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-select select.ng-untouched:invalid:disabled,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-textarea textarea:disabled,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-textarea textarea.ng-untouched:invalid:disabled,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-custom-select__input:invalid:disabled,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-radio input.ng-untouched:invalid+.Vlt-radio__icon:disabled,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-radio input.ng-untouched:invalid+.Vlt-checkbox__icon:disabled,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-checkbox input.ng-untouched:invalid+.Vlt-radio__icon:disabled,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-checkbox input.ng-untouched:invalid+.Vlt-checkbox__icon:disabled{background:var(--vgip-meta-input-disabled-bg-color);border-color:var(--vgip-meta-input-disabled-border-color)}:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-form-error-style:hover,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-form-error-style:focus,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-form-error-style .active,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-input input:hover,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-input input:focus,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-input input .active,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-input input.ng-untouched:invalid:hover,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-input input.ng-untouched:invalid:focus,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-input input.ng-untouched:invalid .active,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-select select.ng-untouched:invalid:hover,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-select select.ng-untouched:invalid:focus,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-select select.ng-untouched:invalid .active,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-textarea textarea:hover,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-textarea textarea:focus,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-textarea textarea .active,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-textarea textarea.ng-untouched:invalid:hover,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-textarea textarea.ng-untouched:invalid:focus,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-textarea textarea.ng-untouched:invalid .active,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-custom-select__input:invalid:hover,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-custom-select__input:invalid:focus,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-custom-select__input:invalid .active,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-radio input.ng-untouched:invalid+.Vlt-radio__icon:hover,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-radio input.ng-untouched:invalid+.Vlt-radio__icon:focus,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-radio input.ng-untouched:invalid+.Vlt-radio__icon .active,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-radio input.ng-untouched:invalid+.Vlt-checkbox__icon:hover,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-radio input.ng-untouched:invalid+.Vlt-checkbox__icon:focus,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-radio input.ng-untouched:invalid+.Vlt-checkbox__icon .active,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-checkbox input.ng-untouched:invalid+.Vlt-radio__icon:hover,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-checkbox input.ng-untouched:invalid+.Vlt-radio__icon:focus,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-checkbox input.ng-untouched:invalid+.Vlt-radio__icon .active,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-checkbox input.ng-untouched:invalid+.Vlt-checkbox__icon:hover,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-checkbox input.ng-untouched:invalid+.Vlt-checkbox__icon:focus,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-checkbox input.ng-untouched:invalid+.Vlt-checkbox__icon .active{border-color:var(--vgip-meta-input-active-border-color)}:host ::ng-deep .Vlt-form__element.Vlt-form__element--error .Vlt-input input:focus,:host ::ng-deep .Vlt-form__element.Vlt-form__element--error .Vlt-select select:focus,:host ::ng-deep .Vlt-form__element.Vlt-form__element--error .Vlt-textarea textarea:focus,:host ::ng-deep .Vlt-form__element.Vlt-form__element--error .Vlt-custom-select__input:focus{border-color:#f25a6b}:host ::ng-deep .Vlt-dropdown__link{padding:12px}:host ::ng-deep .Vlt-dropdown__link svg{margin-left:0}:host ::ng-deep .Vlt-dropdown__link small{line-height:inherit}:host ::ng-deep .Vlt-dropdown__link.Vlt-dropdown__link--selected:after{width:20px;top:14px;background:var(--vgip-meta-dropdown-check-icon) no-repeat right center;background-size:contain}:host ::ng-deep .Vlt-dropdown__block{padding:2px 16px}:host ::ng-deep .meta-field-reference .Vlt-dropdown__link.has-type.Vlt-dropdown__link--selected:after{position:initial}:host ::ng-deep .Vlt-dropdown__panel__content{background:var(--vgip-meta-dropdown-bg-color);box-shadow:var(--vgip-meta-dropdown-shadow)}:host ::ng-deep .Vlt-dropdown__panel__content .Vlt-dropdown__link,:host ::ng-deep .Vlt-dropdown__panel__content .Vlt-dropdown__block{color:var(--vgip-meta-input-color)}:host ::ng-deep .Vlt-dropdown__panel__content .Vlt-dropdown__scroll::-webkit-scrollbar{width:8px}:host ::ng-deep .Vlt-dropdown__panel__content .Vlt-dropdown__scroll::-webkit-scrollbar-thumb{background-color:var(--vgip-meta-scrollbar-color);border:2px solid transparent;border-radius:6px;background-clip:content-box}:host ::ng-deep .Vlt-dropdown__panel__content.suggestions{background:var(--vgip-meta-suggestions-bg-color)}:host ::ng-deep .Vlt-dropdown__panel{z-index:999}:host ::ng-deep .Vlt-dropdown__panel__content--scroll-area{padding:0}:host ::ng-deep .Vlt-composite__append--icon{bottom:0;height:initial}:host ::ng-deep .search-progress{display:block;position:relative;width:100%;height:3px;margin-top:-3px;padding-top:0!important;margin-bottom:0!important}:host ::ng-deep .search-progress .container{display:block;position:relative;overflow:hidden;width:100%;height:3px;transform:translate(0) scale(1)}:host ::ng-deep .search-progress .container .bar{position:absolute;left:0;top:0;bottom:0;width:100%;height:3px;border-radius:50%;transition:all .3s linear;animation:query .9s infinite cubic-bezier(.3,.6,.6,1)}@keyframes query{0%{opacity:1;transform:translate(35%) scaleX(.3)}to{opacity:0;transform:translate(-50%) scaleX(0)}}::ng-deep vgip-meta-field.shown vgip-meta-field{display:initial}::ng-deep vgip-meta-field .vgip-meta-field-preview{display:flex;flex-direction:row;padding-bottom:5px;padding-top:5px;margin-left:10px;border-bottom:1px solid #e7ebee}::ng-deep vgip-meta-field .vgip-meta-field-preview .vgip-meta-field-label{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-right:2px}::ng-deep vgip-meta-field .vgip-meta-field-preview .vgip-meta-field-value{min-width:0;width:0;box-sizing:border-box;flex:1;font-weight:700}\n"], dependencies: [{ kind: "directive", type: MetaFieldContentDirective, selector: "[metaFieldContent]" }] });
|
|
115
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: MetaField, decorators: [{
|
|
116
|
+
type: Component,
|
|
117
|
+
args: [{ selector: 'vgip-meta-field', template: '<ng-template metaFieldContent>Loading</ng-template>', styles: [":host ::ng-deep label.wrapper{padding:0;pointer-events:initial;position:initial;top:initial;transition:none}@media only screen and (max-width: 575px){:host ::ng-deep .hidden-mobile{display:none}}@media only screen and (min-width: 576px){:host ::ng-deep .hidden-desktop{display:none}}:host ::ng-deep .Vlt-form__element>.Vlt-label,:host ::ng-deep .Vlt-form__element>label>.Vlt-label{margin-top:-6px}:host ::ng-deep .Vlt-form__element .Vlt-form__element__hint{color:var(--vgip-meta-input-hint-color)}:host ::ng-deep .Vlt-form__element .Vlt-input input,:host ::ng-deep .Vlt-form__element .Vlt-select select,:host ::ng-deep .Vlt-form__element .Vlt-textarea textarea{color:var(--vgip-meta-input-color)}@media (hover: none){:host ::ng-deep .Vlt-form__element .Vlt-input input,:host ::ng-deep .Vlt-form__element .Vlt-select select,:host ::ng-deep .Vlt-form__element .Vlt-textarea textarea{font-size:16px}}:host ::ng-deep .Vlt-form__element .Vlt-input input::placeholder,:host ::ng-deep .Vlt-form__element .Vlt-select select::placeholder,:host ::ng-deep .Vlt-form__element .Vlt-textarea textarea::placeholder{color:var(--vgip-meta-input-placeholder-color)}:host ::ng-deep .Vlt-form__element label{color:var(--vgip-meta-input-label-color)}:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-form-error-style,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-input input,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-input input.ng-untouched:invalid,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-select select.ng-untouched:invalid,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-textarea textarea,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-textarea textarea.ng-untouched:invalid,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-custom-select__input:invalid,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-radio input.ng-untouched:invalid+.Vlt-radio__icon,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-radio input.ng-untouched:invalid+.Vlt-checkbox__icon,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-checkbox input.ng-untouched:invalid+.Vlt-radio__icon,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-checkbox input.ng-untouched:invalid+.Vlt-checkbox__icon{background:var(--vgip-meta-input-bg-color);border-color:var(--vgip-meta-input-border-color)}:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-form-error-style:disabled,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-input input:disabled,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-input input.ng-untouched:invalid:disabled,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-select select.ng-untouched:invalid:disabled,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-textarea textarea:disabled,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-textarea textarea.ng-untouched:invalid:disabled,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-custom-select__input:invalid:disabled,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-radio input.ng-untouched:invalid+.Vlt-radio__icon:disabled,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-radio input.ng-untouched:invalid+.Vlt-checkbox__icon:disabled,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-checkbox input.ng-untouched:invalid+.Vlt-radio__icon:disabled,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-checkbox input.ng-untouched:invalid+.Vlt-checkbox__icon:disabled{background:var(--vgip-meta-input-disabled-bg-color);border-color:var(--vgip-meta-input-disabled-border-color)}:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-form-error-style:hover,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-form-error-style:focus,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-form-error-style .active,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-input input:hover,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-input input:focus,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-input input .active,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-input input.ng-untouched:invalid:hover,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-input input.ng-untouched:invalid:focus,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-input input.ng-untouched:invalid .active,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-select select.ng-untouched:invalid:hover,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-select select.ng-untouched:invalid:focus,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-select select.ng-untouched:invalid .active,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-textarea textarea:hover,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-textarea textarea:focus,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-textarea textarea .active,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-textarea textarea.ng-untouched:invalid:hover,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-textarea textarea.ng-untouched:invalid:focus,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-textarea textarea.ng-untouched:invalid .active,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-custom-select__input:invalid:hover,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-custom-select__input:invalid:focus,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-custom-select__input:invalid .active,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-radio input.ng-untouched:invalid+.Vlt-radio__icon:hover,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-radio input.ng-untouched:invalid+.Vlt-radio__icon:focus,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-radio input.ng-untouched:invalid+.Vlt-radio__icon .active,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-radio input.ng-untouched:invalid+.Vlt-checkbox__icon:hover,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-radio input.ng-untouched:invalid+.Vlt-checkbox__icon:focus,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-radio input.ng-untouched:invalid+.Vlt-checkbox__icon .active,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-checkbox input.ng-untouched:invalid+.Vlt-radio__icon:hover,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-checkbox input.ng-untouched:invalid+.Vlt-radio__icon:focus,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-checkbox input.ng-untouched:invalid+.Vlt-radio__icon .active,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-checkbox input.ng-untouched:invalid+.Vlt-checkbox__icon:hover,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-checkbox input.ng-untouched:invalid+.Vlt-checkbox__icon:focus,:host ::ng-deep .Vlt-form__element:not(.Vlt-form__element--error) .Vlt-checkbox input.ng-untouched:invalid+.Vlt-checkbox__icon .active{border-color:var(--vgip-meta-input-active-border-color)}:host ::ng-deep .Vlt-form__element.Vlt-form__element--error .Vlt-input input:focus,:host ::ng-deep .Vlt-form__element.Vlt-form__element--error .Vlt-select select:focus,:host ::ng-deep .Vlt-form__element.Vlt-form__element--error .Vlt-textarea textarea:focus,:host ::ng-deep .Vlt-form__element.Vlt-form__element--error .Vlt-custom-select__input:focus{border-color:#f25a6b}:host ::ng-deep .Vlt-dropdown__link{padding:12px}:host ::ng-deep .Vlt-dropdown__link svg{margin-left:0}:host ::ng-deep .Vlt-dropdown__link small{line-height:inherit}:host ::ng-deep .Vlt-dropdown__link.Vlt-dropdown__link--selected:after{width:20px;top:14px;background:var(--vgip-meta-dropdown-check-icon) no-repeat right center;background-size:contain}:host ::ng-deep .Vlt-dropdown__block{padding:2px 16px}:host ::ng-deep .meta-field-reference .Vlt-dropdown__link.has-type.Vlt-dropdown__link--selected:after{position:initial}:host ::ng-deep .Vlt-dropdown__panel__content{background:var(--vgip-meta-dropdown-bg-color);box-shadow:var(--vgip-meta-dropdown-shadow)}:host ::ng-deep .Vlt-dropdown__panel__content .Vlt-dropdown__link,:host ::ng-deep .Vlt-dropdown__panel__content .Vlt-dropdown__block{color:var(--vgip-meta-input-color)}:host ::ng-deep .Vlt-dropdown__panel__content .Vlt-dropdown__scroll::-webkit-scrollbar{width:8px}:host ::ng-deep .Vlt-dropdown__panel__content .Vlt-dropdown__scroll::-webkit-scrollbar-thumb{background-color:var(--vgip-meta-scrollbar-color);border:2px solid transparent;border-radius:6px;background-clip:content-box}:host ::ng-deep .Vlt-dropdown__panel__content.suggestions{background:var(--vgip-meta-suggestions-bg-color)}:host ::ng-deep .Vlt-dropdown__panel{z-index:999}:host ::ng-deep .Vlt-dropdown__panel__content--scroll-area{padding:0}:host ::ng-deep .Vlt-composite__append--icon{bottom:0;height:initial}:host ::ng-deep .search-progress{display:block;position:relative;width:100%;height:3px;margin-top:-3px;padding-top:0!important;margin-bottom:0!important}:host ::ng-deep .search-progress .container{display:block;position:relative;overflow:hidden;width:100%;height:3px;transform:translate(0) scale(1)}:host ::ng-deep .search-progress .container .bar{position:absolute;left:0;top:0;bottom:0;width:100%;height:3px;border-radius:50%;transition:all .3s linear;animation:query .9s infinite cubic-bezier(.3,.6,.6,1)}@keyframes query{0%{opacity:1;transform:translate(35%) scaleX(.3)}to{opacity:0;transform:translate(-50%) scaleX(0)}}::ng-deep vgip-meta-field.shown vgip-meta-field{display:initial}::ng-deep vgip-meta-field .vgip-meta-field-preview{display:flex;flex-direction:row;padding-bottom:5px;padding-top:5px;margin-left:10px;border-bottom:1px solid #e7ebee}::ng-deep vgip-meta-field .vgip-meta-field-preview .vgip-meta-field-label{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-right:2px}::ng-deep vgip-meta-field .vgip-meta-field-preview .vgip-meta-field-value{min-width:0;width:0;box-sizing:border-box;flex:1;font-weight:700}\n"] }]
|
|
118
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { meta: [{
|
|
119
|
+
type: Input
|
|
120
|
+
}], parent: [{
|
|
121
|
+
type: Input
|
|
122
|
+
}], integrationCode: [{
|
|
123
|
+
type: Input
|
|
124
|
+
}], resourceType: [{
|
|
125
|
+
type: Input
|
|
126
|
+
}], index: [{
|
|
127
|
+
type: Input
|
|
128
|
+
}], preview: [{
|
|
129
|
+
type: Input
|
|
130
|
+
}], theme: [{
|
|
131
|
+
type: Input
|
|
132
|
+
}], onChange: [{
|
|
133
|
+
type: Output
|
|
134
|
+
}], onLeave: [{
|
|
135
|
+
type: Output
|
|
136
|
+
}], fieldContent: [{
|
|
137
|
+
type: ViewChild,
|
|
138
|
+
args: [MetaFieldContentDirective, { static: true }]
|
|
139
|
+
}] } });
|
|
140
|
+
|
|
141
|
+
export { MetaField as M, MetaFieldContentDirective as a };
|
|
142
|
+
//# sourceMappingURL=vgip-meta-ui-index-7f4f2d15.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vgip-meta-ui-index-7f4f2d15.mjs","sources":["../../../projects/meta-ui/src/lib/metaField/index.ts"],"sourcesContent":["import { Component, Directive, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild, ViewContainerRef } from '@angular/core';\nimport { FieldAbstract } from '../fieldAbstract';\n\nconst FMAP = async (fType) => {\n switch (fType) {\n case '':\n case null:\n case undefined:\n case 'number':\n // case 'datetime':\n // case 'time':\n // case 'date':\n case 'string': { // eslint-disable-line no-fallthrough\n // return FieldInput;\n return import('../fieldInput').then(m => m.FieldInput);\n }\n case 'textarea':\n case 'text': {\n // return FieldText;\n return import('../fieldText').then(m => m.FieldText);\n }\n case 'select':\n case 'options': {\n // return FieldSelect;\n return import('../fieldSelect').then(m => m.FieldSelect);\n }\n case 'reference': {\n // return FieldReference;\n return import('../fieldReference').then(m => m.FieldReference);\n }\n case 'composite': {\n // return FieldComposite;\n return import('../fieldComposite').then(m => m.FieldComposite);\n }\n case 'boolean': {\n // return FieldBoolean;\n return import('../fieldBoolean').then(m => m.FieldBoolean);\n }\n case 'radio': {\n // return FieldRadio;\n return import('../fieldRadio').then(m => m.FieldRadio);\n }\n case 'list': {\n // return FieldList;\n return import('../fieldList').then(m => m.FieldList);\n }\n case 'richtext': {\n // return FieldRichtext;\n return import('../fieldRichtext').then(m => m.FieldRichtext);\n }\n case 'datetime':\n case 'time':\n case 'date': {\n // return FieldDatetime;\n return import('../fieldDatetime').then(m => m.FieldDatetime);\n }\n default: {\n // return FieldUnknown;\n return import('../fieldUnknown').then(m => m.FieldUnknown);\n }\n }\n};\n\n@Directive({\n selector: '[metaFieldContent]'\n})\nexport class MetaFieldContentDirective {\n constructor(public viewContainerRef: ViewContainerRef) { }\n}\n\n@Component({\n selector: 'vgip-meta-field',\n template: '<ng-template metaFieldContent>Loading</ng-template>',\n styleUrls: ['../field.scss']\n})\nexport class MetaField extends FieldAbstract implements OnInit {\n @Input() meta: any;\n @Input() parent: any;\n @Input() integrationCode: any;\n @Input() resourceType: any;\n @Input() index: number;\n @Input() preview: boolean;\n @Input() theme: string;\n // eslint-disable-next-line\n @Output() onChange = new EventEmitter();\n // eslint-disable-next-line\n @Output() onLeave = new EventEmitter();\n\n @ViewChild(MetaFieldContentDirective, { static: true }) fieldContent: MetaFieldContentDirective;\n\n constructor(private el: ElementRef) {\n super();\n }\n\n async ngOnInit() {\n const component = await FMAP(this.meta.type);\n this.fieldContent.viewContainerRef.clear();\n const componentRef = this.fieldContent.viewContainerRef.createComponent(component);\n const field: FieldAbstract = componentRef.instance;\n if (component.setup) {\n // console.log('setup', {a: this.el.nativeElement.parentNode.parentNode})\n component.setup(field, this.parent, this.meta);\n }\n field.meta = this.meta;\n field.parent = this.parent;\n field.integrationCode = (this.integrationCode || '').toLowerCase();\n field.resourceType = (this.resourceType || '');\n field.index = this.index;\n field.elementRef = this.el;\n field.onChange = this.onChange;\n field.onLeave = this.onLeave;\n field.preview = this.preview;\n field.theme = this.theme;\n Object.defineProperty(field.meta, 'unset', {\n value: false,\n writable: true,\n configurable: true,\n enumerable: false\n });\n }\n}\n"],"names":[],"mappings":";;;;AAGA,MAAM,IAAI,GAAG,OAAO,KAAK,KAAI;AACzB,IAAA,QAAQ,KAAK;AACT,QAAA,KAAK,EAAE,CAAC;AACR,QAAA,KAAK,IAAI,CAAC;AACV,QAAA,KAAK,SAAS,CAAC;AACf,QAAA,KAAK,QAAQ,CAAC;;;;AAId,QAAA,KAAK,QAAQ,EAAE;;AAE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