@vgip/meta-ui 1.6.9 → 1.7.2
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 → esm2022}/lib/common/metaAutofocus.directive.mjs +4 -4
- package/{esm2020 → esm2022}/lib/common/metaIcons.pipe.mjs +4 -4
- package/{esm2020 → esm2022}/lib/common/metaModel.pipe.mjs +4 -4
- package/{esm2020 → esm2022}/lib/common/metaNormalizer.mjs +16 -1
- package/{esm2020 → esm2022}/lib/common/metaStripHtml.pipe.mjs +4 -4
- package/{esm2020 → esm2022}/lib/fieldAbstract.mjs +5 -5
- package/esm2022/lib/fieldBoolean/index.mjs +56 -0
- package/{esm2020 → esm2022}/lib/fieldComposite/index.mjs +4 -4
- package/{esm2020 → esm2022}/lib/fieldDatetime/index.mjs +5 -5
- package/{esm2020 → esm2022}/lib/fieldHidden/index.mjs +4 -4
- package/{esm2020 → esm2022}/lib/fieldInput/index.mjs +5 -5
- package/{esm2020 → esm2022}/lib/fieldList/index.mjs +4 -4
- package/{esm2020 → esm2022}/lib/fieldRadio/index.mjs +5 -5
- package/esm2022/lib/fieldReference/index.mjs +825 -0
- package/esm2022/lib/fieldRichtext/index.mjs +95 -0
- package/esm2022/lib/fieldSelect/index.mjs +490 -0
- package/esm2022/lib/fieldText/index.mjs +65 -0
- package/{esm2020 → esm2022}/lib/fieldUnknown/index.mjs +4 -4
- package/esm2022/lib/index.mjs +163 -0
- package/{esm2020 → esm2022}/lib/layout/index.mjs +4 -4
- package/{esm2020 → esm2022}/lib/metaField/index.mjs +7 -7
- package/{esm2020 → esm2022}/lib/refDialog/index.mjs +4 -4
- package/{esm2020 → esm2022}/lib/resource/index.mjs +4 -4
- package/{esm2020 → esm2022}/lib/resourceCard/index.mjs +4 -4
- package/{esm2020 → esm2022}/lib/services/metaContext/index.mjs +4 -4
- package/{esm2020 → esm2022}/lib/services/metaMsg/index.mjs +4 -4
- package/{esm2020 → esm2022}/lib/services/metaReference/index.mjs +4 -4
- package/{esm2020 → esm2022}/lib/services/metaResource/index.mjs +4 -4
- package/{esm2020 → esm2022}/lib/services/metaResource/metaHttpClient.mjs +4 -4
- package/{esm2020 → esm2022}/lib/services/metaTracker/index.mjs +4 -4
- package/{esm2020 → esm2022}/lib/services/resourceDrafts/index.mjs +4 -4
- package/{fesm2020/vgip-meta-ui-fieldAbstract-17f26446.mjs → fesm2022/vgip-meta-ui-fieldAbstract-ce47588e.mjs} +5 -5
- package/fesm2022/vgip-meta-ui-fieldAbstract-ce47588e.mjs.map +1 -0
- package/{fesm2015/vgip-meta-ui-index-6e77c362.mjs → fesm2022/vgip-meta-ui-index-1467556e.mjs} +4 -4
- package/{fesm2020/vgip-meta-ui-index-6e77c362.mjs.map → fesm2022/vgip-meta-ui-index-1467556e.mjs.map} +1 -1
- package/fesm2022/vgip-meta-ui-index-5509b1d2.mjs +68 -0
- package/fesm2022/vgip-meta-ui-index-5509b1d2.mjs.map +1 -0
- package/fesm2022/vgip-meta-ui-index-5d664781.mjs +858 -0
- package/fesm2022/vgip-meta-ui-index-5d664781.mjs.map +1 -0
- package/{fesm2020/vgip-meta-ui-index-b428f3c0.mjs → fesm2022/vgip-meta-ui-index-617c4bac.mjs} +43 -28
- package/fesm2022/vgip-meta-ui-index-617c4bac.mjs.map +1 -0
- package/fesm2022/vgip-meta-ui-index-6dcb4942.mjs +24 -0
- package/{fesm2015/vgip-meta-ui-index-5a12f79d.mjs.map → fesm2022/vgip-meta-ui-index-6dcb4942.mjs.map} +1 -1
- package/{fesm2015/vgip-meta-ui-index-8c0d0972.mjs → fesm2022/vgip-meta-ui-index-78d7b9be.mjs} +7 -7
- package/fesm2022/vgip-meta-ui-index-78d7b9be.mjs.map +1 -0
- package/fesm2022/vgip-meta-ui-index-85109066.mjs +97 -0
- package/fesm2022/vgip-meta-ui-index-85109066.mjs.map +1 -0
- package/{fesm2015/vgip-meta-ui-index-fda3d1e2.mjs → fesm2022/vgip-meta-ui-index-86211382.mjs} +7 -8
- package/{fesm2020/vgip-meta-ui-index-39177940.mjs.map → fesm2022/vgip-meta-ui-index-86211382.mjs.map} +1 -1
- package/fesm2022/vgip-meta-ui-index-adb42356.mjs +95 -0
- package/fesm2022/vgip-meta-ui-index-adb42356.mjs.map +1 -0
- package/{fesm2020/vgip-meta-ui-index-db9a2218.mjs → fesm2022/vgip-meta-ui-index-cb0d4f82.mjs} +5 -5
- package/{fesm2015/vgip-meta-ui-index-db9a2218.mjs.map → fesm2022/vgip-meta-ui-index-cb0d4f82.mjs.map} +1 -1
- package/fesm2022/vgip-meta-ui-index-cfb67422.mjs +497 -0
- package/fesm2022/vgip-meta-ui-index-cfb67422.mjs.map +1 -0
- package/{fesm2020/vgip-meta-ui-index-8f956c8f.mjs → fesm2022/vgip-meta-ui-index-eba0dd05.mjs} +8 -8
- package/fesm2022/vgip-meta-ui-index-eba0dd05.mjs.map +1 -0
- package/fesm2022/vgip-meta-ui-index-eef5fc0f.mjs +61 -0
- package/fesm2022/vgip-meta-ui-index-eef5fc0f.mjs.map +1 -0
- package/{fesm2020/vgip-meta-ui-index-dae4cc15.mjs → fesm2022/vgip-meta-ui-index-f0fa2cbd.mjs} +6 -6
- package/{fesm2020/vgip-meta-ui-index-dae4cc15.mjs.map → fesm2022/vgip-meta-ui-index-f0fa2cbd.mjs.map} +1 -1
- package/{fesm2020/vgip-meta-ui-index-b0cee687.mjs → fesm2022/vgip-meta-ui-index-f5e42e1d.mjs} +20 -20
- package/{fesm2020/vgip-meta-ui-index-b0cee687.mjs.map → fesm2022/vgip-meta-ui-index-f5e42e1d.mjs.map} +1 -1
- package/{fesm2015/vgip-meta-ui-metaModel.pipe-4b068359.mjs → fesm2022/vgip-meta-ui-metaModel.pipe-3487ede2.mjs} +4 -4
- package/{fesm2015/vgip-meta-ui-metaModel.pipe-4b068359.mjs.map → fesm2022/vgip-meta-ui-metaModel.pipe-3487ede2.mjs.map} +1 -1
- package/{fesm2020 → fesm2022}/vgip-meta-ui.mjs +96 -91
- package/{fesm2015 → fesm2022}/vgip-meta-ui.mjs.map +1 -1
- package/lib/common/metaAutofocus.directive.d.ts +1 -1
- package/lib/fieldBoolean/index.d.ts +1 -1
- package/lib/fieldComposite/index.d.ts +1 -1
- package/lib/fieldRadio/index.d.ts +1 -1
- package/lib/fieldRichtext/index.d.ts +6 -8
- package/lib/fieldText/index.d.ts +1 -1
- package/lib/layout/index.d.ts +1 -1
- package/lib/metaField/index.d.ts +1 -1
- package/lib/resource/index.d.ts +1 -1
- package/lib/resourceCard/index.d.ts +1 -1
- package/package.json +8 -14
- package/esm2020/lib/fieldBoolean/index.mjs +0 -56
- package/esm2020/lib/fieldReference/index.mjs +0 -825
- package/esm2020/lib/fieldRichtext/index.mjs +0 -85
- package/esm2020/lib/fieldSelect/index.mjs +0 -488
- package/esm2020/lib/fieldText/index.mjs +0 -65
- package/esm2020/lib/index.mjs +0 -158
- package/fesm2015/vgip-meta-ui-fieldAbstract-17f26446.mjs +0 -397
- package/fesm2015/vgip-meta-ui-fieldAbstract-17f26446.mjs.map +0 -1
- package/fesm2015/vgip-meta-ui-index-0fc1c4a5.mjs +0 -68
- package/fesm2015/vgip-meta-ui-index-0fc1c4a5.mjs.map +0 -1
- package/fesm2015/vgip-meta-ui-index-5a12f79d.mjs +0 -24
- package/fesm2015/vgip-meta-ui-index-6e77c362.mjs.map +0 -1
- package/fesm2015/vgip-meta-ui-index-89b8d1d4.mjs +0 -858
- package/fesm2015/vgip-meta-ui-index-89b8d1d4.mjs.map +0 -1
- package/fesm2015/vgip-meta-ui-index-8a2f9dbf.mjs +0 -151
- package/fesm2015/vgip-meta-ui-index-8a2f9dbf.mjs.map +0 -1
- package/fesm2015/vgip-meta-ui-index-8c0d0972.mjs.map +0 -1
- package/fesm2015/vgip-meta-ui-index-8f956c8f.mjs +0 -460
- package/fesm2015/vgip-meta-ui-index-8f956c8f.mjs.map +0 -1
- package/fesm2015/vgip-meta-ui-index-91a02c0f.mjs +0 -95
- package/fesm2015/vgip-meta-ui-index-91a02c0f.mjs.map +0 -1
- package/fesm2015/vgip-meta-ui-index-9af6e01b.mjs +0 -88
- package/fesm2015/vgip-meta-ui-index-9af6e01b.mjs.map +0 -1
- package/fesm2015/vgip-meta-ui-index-9ca39230.mjs +0 -1900
- package/fesm2015/vgip-meta-ui-index-9ca39230.mjs.map +0 -1
- package/fesm2015/vgip-meta-ui-index-a276b206.mjs +0 -61
- package/fesm2015/vgip-meta-ui-index-a276b206.mjs.map +0 -1
- package/fesm2015/vgip-meta-ui-index-b79a6173.mjs +0 -72
- package/fesm2015/vgip-meta-ui-index-b79a6173.mjs.map +0 -1
- package/fesm2015/vgip-meta-ui-index-db9a2218.mjs +0 -23
- package/fesm2015/vgip-meta-ui-index-e4e3a171.mjs +0 -496
- package/fesm2015/vgip-meta-ui-index-e4e3a171.mjs.map +0 -1
- package/fesm2015/vgip-meta-ui-index-fda3d1e2.mjs.map +0 -1
- package/fesm2015/vgip-meta-ui.mjs +0 -525
- package/fesm2020/vgip-meta-ui-fieldAbstract-17f26446.mjs.map +0 -1
- package/fesm2020/vgip-meta-ui-index-0fc1c4a5.mjs +0 -68
- package/fesm2020/vgip-meta-ui-index-0fc1c4a5.mjs.map +0 -1
- package/fesm2020/vgip-meta-ui-index-39177940.mjs +0 -74
- package/fesm2020/vgip-meta-ui-index-5a12f79d.mjs +0 -24
- package/fesm2020/vgip-meta-ui-index-5a12f79d.mjs.map +0 -1
- package/fesm2020/vgip-meta-ui-index-6e77c362.mjs +0 -130
- package/fesm2020/vgip-meta-ui-index-8c0d0972.mjs +0 -368
- package/fesm2020/vgip-meta-ui-index-8c0d0972.mjs.map +0 -1
- package/fesm2020/vgip-meta-ui-index-8f956c8f.mjs.map +0 -1
- package/fesm2020/vgip-meta-ui-index-91a02c0f.mjs +0 -95
- package/fesm2020/vgip-meta-ui-index-91a02c0f.mjs.map +0 -1
- package/fesm2020/vgip-meta-ui-index-9af6e01b.mjs +0 -88
- package/fesm2020/vgip-meta-ui-index-9af6e01b.mjs.map +0 -1
- package/fesm2020/vgip-meta-ui-index-a276b206.mjs +0 -61
- package/fesm2020/vgip-meta-ui-index-a276b206.mjs.map +0 -1
- package/fesm2020/vgip-meta-ui-index-ad59c1c4.mjs +0 -495
- package/fesm2020/vgip-meta-ui-index-ad59c1c4.mjs.map +0 -1
- package/fesm2020/vgip-meta-ui-index-b428f3c0.mjs.map +0 -1
- package/fesm2020/vgip-meta-ui-index-db9a2218.mjs.map +0 -1
- package/fesm2020/vgip-meta-ui-index-e5f4755f.mjs +0 -858
- package/fesm2020/vgip-meta-ui-index-e5f4755f.mjs.map +0 -1
- package/fesm2020/vgip-meta-ui-metaModel.pipe-4b068359.mjs +0 -28
- package/fesm2020/vgip-meta-ui-metaModel.pipe-4b068359.mjs.map +0 -1
- package/fesm2020/vgip-meta-ui-relativeTimeBuilder-31791ce4.mjs +0 -51
- package/fesm2020/vgip-meta-ui-relativeTimeBuilder-31791ce4.mjs.map +0 -1
- package/fesm2020/vgip-meta-ui.mjs.map +0 -1
- /package/{esm2020 → esm2022}/lib/common/fieldNormalizer/boolean.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/common/fieldNormalizer/datetime.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/common/fieldNormalizer/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/common/fieldNormalizer/number.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/common/fieldNormalizer/options.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/common/fieldNormalizer/radio.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/common/fieldNormalizer/reference.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/common/fieldNormalizer/richtext.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/common/fieldNormalizer/string.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/common/fieldNormalizer/text.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/common/fieldNormalizer/uniqueNameFilter.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/common/utils/colorThemes.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/common/utils/indexedDbStore/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/common/utils/relativeTimeBuilder.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/common/utils/resourceCardLabel.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/common/utils/smartProp.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/common/utils/templateBuilder.mjs +0 -0
- /package/{esm2020 → esm2022}/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/vgip-meta-ui.mjs +0 -0
- /package/{fesm2015 → fesm2022}/vgip-meta-ui-relativeTimeBuilder-31791ce4.mjs +0 -0
- /package/{fesm2015 → fesm2022}/vgip-meta-ui-relativeTimeBuilder-31791ce4.mjs.map +0 -0
|
@@ -1,68 +0,0 @@
|
|
|
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-17f26446.mjs';
|
|
6
|
-
import { t as templateBuilder, M as MetaContextService } from './vgip-meta-ui-index-6e77c362.mjs';
|
|
7
|
-
import * as i1 from '@angular/common';
|
|
8
|
-
import { M as MetaModelPipe } from './vgip-meta-ui-metaModel.pipe-4b068359.mjs';
|
|
9
|
-
import 'rxjs';
|
|
10
|
-
import 'rxjs/operators';
|
|
11
|
-
|
|
12
|
-
/*
|
|
13
|
-
* @Author: Alexander.Vangelov@vonage.com
|
|
14
|
-
* @Date: 2019-09-19 17:35:13
|
|
15
|
-
* @Last Modified by: Alexander.Vangelov@vonage.com
|
|
16
|
-
* @Last Modified time: 2020-02-26 20:00:33
|
|
17
|
-
*/
|
|
18
|
-
class FieldText extends FieldAbstract {
|
|
19
|
-
constructor(metaContext) {
|
|
20
|
-
super();
|
|
21
|
-
this.metaContext = metaContext;
|
|
22
|
-
}
|
|
23
|
-
static setup(instance, parent, meta) {
|
|
24
|
-
const d = meta.default || meta.defaultValue;
|
|
25
|
-
if (d && !parent[meta.name]) {
|
|
26
|
-
if (typeof (d) === 'string') {
|
|
27
|
-
parent[meta.name] = d;
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
parent[meta.name] = d.id || d.value;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
ngOnInit() {
|
|
35
|
-
if (typeof (this.parent[this.meta.name]) === 'string') {
|
|
36
|
-
this.parent[this.meta.name] = templateBuilder(this.metaContext, this.parent[this.meta.name]);
|
|
37
|
-
}
|
|
38
|
-
// if (this.default && !this.model) {
|
|
39
|
-
// setTimeout(()=>{
|
|
40
|
-
// if (typeof(this.default) == 'string') {
|
|
41
|
-
// this.parent[this.meta.name] = this.default;
|
|
42
|
-
// } else {
|
|
43
|
-
// this.parent[this.meta.name] = this.default.id || this.default.value;
|
|
44
|
-
// }
|
|
45
|
-
// }, 0);
|
|
46
|
-
// }
|
|
47
|
-
}
|
|
48
|
-
onModelChangeLocal(value) {
|
|
49
|
-
if (!value && this.prevModel && this.isPersistedParent) {
|
|
50
|
-
value = '';
|
|
51
|
-
}
|
|
52
|
-
this.onModelChange(value);
|
|
53
|
-
}
|
|
54
|
-
textToSpeech() {
|
|
55
|
-
this.focus();
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
FieldText.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FieldText, deps: [{ token: MetaContextService }], target: i0.ɵɵFactoryTarget.Component });
|
|
59
|
-
FieldText.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: FieldText, selector: "ng-component", inputs: { meta: "meta" }, usesInheritance: true, ngImport: i0, template: "<div class='vgip-meta-field-preview' *ngIf='preview && parent[meta.name]'>\n <div class='vgip-meta-field-label'>{{meta.label || meta.name}}</div>\n <div class='vgip-meta-field-value __gu'>{{parent[meta.name]}}</div>\n</div>\n<div *ngIf='!preview' class=\"Vlt-form__element Vlt-form__element--big\" [ngClass]=\"{ 'Vlt-form__element--error': f.invalid && ((f | metaModel)._parent.submitted || (f | metaModel ).touched) }\">\n <label class='wrapper'>\n <div class=\"Vlt-textarea\">\n <textarea class='main model' [required]='validations.required' [maxlength]='validations.maxlength' rows=\"{{ meta.rows || 4 }}\" placeholder=' ' [(ngModel)]='parent[meta.name]' (ngModelChange)=\"onModelChangeLocal($event)\" #f='ngModel' [name]='name'></textarea>\n <!-- <div class=\"Vlt-composite__append Vlt-composite__append--icon\">\n <div class=\"Vlt-composite__icon\" (click)='textToSpeech()'>\n <svg><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-microphone\"/></svg>\n </div>\n </div> -->\n <label class=\"Vlt-label\">{{meta.label || meta.name}}<span *ngIf='validations.required' class='Vlt-red'>*</span></label>\n </div>\n </label>\n <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.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>", styles: [".Vlt-composite__append--icon{bottom:7px;right:16px;padding:3px;width:initial;height:initial;cursor:pointer}.Vlt-composite__append--icon:hover svg{fill:#2c2d30}.Vlt-form__element--big .Vlt-textarea .Vlt-label{right:18px;background:transparent}.Vlt-form__element--error textarea{border-color:#f25a6b;background:var(--vgip-meta-input-bg-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.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.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { 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 }] });
|
|
60
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FieldText, decorators: [{
|
|
61
|
-
type: Component,
|
|
62
|
-
args: [{ viewProviders: [{ provide: ControlContainer, useExisting: NgForm }], template: "<div class='vgip-meta-field-preview' *ngIf='preview && parent[meta.name]'>\n <div class='vgip-meta-field-label'>{{meta.label || meta.name}}</div>\n <div class='vgip-meta-field-value __gu'>{{parent[meta.name]}}</div>\n</div>\n<div *ngIf='!preview' class=\"Vlt-form__element Vlt-form__element--big\" [ngClass]=\"{ 'Vlt-form__element--error': f.invalid && ((f | metaModel)._parent.submitted || (f | metaModel ).touched) }\">\n <label class='wrapper'>\n <div class=\"Vlt-textarea\">\n <textarea class='main model' [required]='validations.required' [maxlength]='validations.maxlength' rows=\"{{ meta.rows || 4 }}\" placeholder=' ' [(ngModel)]='parent[meta.name]' (ngModelChange)=\"onModelChangeLocal($event)\" #f='ngModel' [name]='name'></textarea>\n <!-- <div class=\"Vlt-composite__append Vlt-composite__append--icon\">\n <div class=\"Vlt-composite__icon\" (click)='textToSpeech()'>\n <svg><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-microphone\"/></svg>\n </div>\n </div> -->\n <label class=\"Vlt-label\">{{meta.label || meta.name}}<span *ngIf='validations.required' class='Vlt-red'>*</span></label>\n </div>\n </label>\n <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.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>", styles: [".Vlt-composite__append--icon{bottom:7px;right:16px;padding:3px;width:initial;height:initial;cursor:pointer}.Vlt-composite__append--icon:hover svg{fill:#2c2d30}.Vlt-form__element--big .Vlt-textarea .Vlt-label{right:18px;background:transparent}.Vlt-form__element--error textarea{border-color:#f25a6b;background:var(--vgip-meta-input-bg-color)}\n"] }]
|
|
63
|
-
}], ctorParameters: function () { return [{ type: MetaContextService }]; }, propDecorators: { meta: [{
|
|
64
|
-
type: Input
|
|
65
|
-
}] } });
|
|
66
|
-
|
|
67
|
-
export { FieldText };
|
|
68
|
-
//# sourceMappingURL=vgip-meta-ui-index-0fc1c4a5.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vgip-meta-ui-index-0fc1c4a5.mjs","sources":["../../../projects/meta-ui/src/lib/fieldText/index.ts","../../../projects/meta-ui/src/lib/fieldText/view.html"],"sourcesContent":["/*\n * @Author: Alexander.Vangelov@vonage.com\n * @Date: 2019-09-19 17:35:13\n * @Last Modified by: Alexander.Vangelov@vonage.com\n * @Last Modified time: 2020-02-26 20:00:33\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'\nimport { templateBuilder } from '../common/utils/templateBuilder';\nimport { MetaContextService } from '../services/metaContext';\n\n@Component({\n templateUrl: './view.html',\n styleUrls: ['./style.scss'],\n viewProviders: [ { provide: ControlContainer, useExisting: NgForm } ]\n})\nexport class FieldText extends FieldAbstract implements OnInit {\n @Input() meta: any;\n\n constructor( private metaContext: MetaContextService ) {\n super();\n }\n\n static setup(instance, parent, meta) {\n const d = meta.default || meta.defaultValue;\n if (d && !parent[meta.name]) {\n if (typeof(d) === 'string') {\n parent[meta.name] = d;\n } else {\n parent[meta.name] = d.id || d.value;\n }\n }\n }\n\n ngOnInit() {\n if (typeof(this.parent[this.meta.name]) === 'string') {\n this.parent[this.meta.name] = templateBuilder(this.metaContext, this.parent[this.meta.name]);\n }\n // if (this.default && !this.model) {\n // setTimeout(()=>{\n // if (typeof(this.default) == 'string') {\n // this.parent[this.meta.name] = this.default;\n // } else {\n // this.parent[this.meta.name] = this.default.id || this.default.value;\n // }\n // }, 0);\n // }\n }\n\n onModelChangeLocal(value) {\n if (!value && this.prevModel && this.isPersistedParent) {\n value = '';\n }\n this.onModelChange(value);\n }\n\n textToSpeech() {\n this.focus();\n }\n\n}\n","<div class='vgip-meta-field-preview' *ngIf='preview && parent[meta.name]'>\n <div class='vgip-meta-field-label'>{{meta.label || meta.name}}</div>\n <div class='vgip-meta-field-value __gu'>{{parent[meta.name]}}</div>\n</div>\n<div *ngIf='!preview' class=\"Vlt-form__element Vlt-form__element--big\" [ngClass]=\"{ 'Vlt-form__element--error': f.invalid && ((f | metaModel)._parent.submitted || (f | metaModel ).touched) }\">\n <label class='wrapper'>\n <div class=\"Vlt-textarea\">\n <textarea class='main model' [required]='validations.required' [maxlength]='validations.maxlength' rows=\"{{ meta.rows || 4 }}\" placeholder=' ' [(ngModel)]='parent[meta.name]' (ngModelChange)=\"onModelChangeLocal($event)\" #f='ngModel' [name]='name'></textarea>\n <!-- <div class=\"Vlt-composite__append Vlt-composite__append--icon\">\n <div class=\"Vlt-composite__icon\" (click)='textToSpeech()'>\n <svg><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-microphone\"/></svg>\n </div>\n </div> -->\n <label class=\"Vlt-label\">{{meta.label || meta.name}}<span *ngIf='validations.required' class='Vlt-red'>*</span></label>\n </div>\n </label>\n <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.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>"],"names":["i1.MetaContextService","i2","i3","i4.MetaModelPipe"],"mappings":"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"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component } from '@angular/core';
|
|
3
|
-
import { F as FieldAbstract } from './vgip-meta-ui-fieldAbstract-17f26446.mjs';
|
|
4
|
-
import * as i2 from '@angular/forms';
|
|
5
|
-
import { ControlContainer, NgForm } from '@angular/forms';
|
|
6
|
-
import * as i1 from '@angular/common';
|
|
7
|
-
import { M as MetaField } from './vgip-meta-ui-index-b0cee687.mjs';
|
|
8
|
-
import { M as MetaModelPipe } from './vgip-meta-ui-metaModel.pipe-4b068359.mjs';
|
|
9
|
-
import 'rxjs';
|
|
10
|
-
import 'rxjs/operators';
|
|
11
|
-
|
|
12
|
-
class FieldList extends FieldAbstract {
|
|
13
|
-
constructor() {
|
|
14
|
-
super(...arguments);
|
|
15
|
-
this.items = [];
|
|
16
|
-
}
|
|
17
|
-
get list() {
|
|
18
|
-
return this.meta.list || this.meta.reference;
|
|
19
|
-
}
|
|
20
|
-
get cloneList() {
|
|
21
|
-
return JSON.parse(JSON.stringify(this.list));
|
|
22
|
-
}
|
|
23
|
-
ngOnInit() {
|
|
24
|
-
this.scope += `${this.meta.name}_`;
|
|
25
|
-
const origValue = this.parent[this.meta.name];
|
|
26
|
-
Object.defineProperty(this.parent, this.meta.name, {
|
|
27
|
-
set: (value) => {
|
|
28
|
-
this.model = [];
|
|
29
|
-
if (value && value.length) {
|
|
30
|
-
for (const i of value) {
|
|
31
|
-
if (this.model.indexOf(i) === -1) {
|
|
32
|
-
this.model.push(i);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
this.value = this.model;
|
|
37
|
-
this.meta.$optional = this.isOptional;
|
|
38
|
-
},
|
|
39
|
-
get: () => this.value,
|
|
40
|
-
enumerable: true,
|
|
41
|
-
configurable: true
|
|
42
|
-
});
|
|
43
|
-
if (origValue) {
|
|
44
|
-
this.parent[this.meta.name] = origValue;
|
|
45
|
-
}
|
|
46
|
-
if (!this.model && this.validations.min) {
|
|
47
|
-
for (let i = 0; i < this.validations.min; i++) {
|
|
48
|
-
this.add();
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
add() {
|
|
53
|
-
if (!this.model) {
|
|
54
|
-
this.model = [];
|
|
55
|
-
}
|
|
56
|
-
if (!this.validations.max || (this.validations.max > this.model.length)) {
|
|
57
|
-
this.model.push({});
|
|
58
|
-
this.value = this.model;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
remove(itemIndex) {
|
|
62
|
-
this.model.splice(itemIndex, 1);
|
|
63
|
-
this.value = this.model;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
FieldList.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FieldList, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
67
|
-
FieldList.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: FieldList, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<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' [scope]='scope' [meta]='cloneList' [parent]='item' [integrationCode]='integrationCode' [resourceType]='meta.resourceType || resourceType' theme='inherit' [preview]='preview'></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 *ngIf='!preview' 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='!preview && (!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", styles: [".Vlt-btn--link:not([disabled]) svg{fill:#e84545}.Vlt-btn--link:not([disabled]):hover svg{fill:#de1c1c}.item-add-button{background-color:var(--vgip-meta-input-action-hover-bg-color);color:var(--vgip-meta-input-color)}.item-add-button svg{fill:var(--vgip-meta-input-color)}.item-add-button:hover{transform:scale(1.02);box-shadow:inset 0 0 0 1px var(--vgip-meta-input-active-border-color)}.item-remove-button{border:0}.item-remove-button:disabled{cursor:not-allowed}\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: "component", type: MetaField, selector: "vgip-meta-field", inputs: ["meta", "parent", "integrationCode", "resourceType", "index", "scope", "preview", "theme"], outputs: ["onChange", "onLeave"] }, { kind: "pipe", type: MetaModelPipe, name: "metaModel" }], viewProviders: [{ provide: ControlContainer, useExisting: NgForm }] });
|
|
68
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FieldList, decorators: [{
|
|
69
|
-
type: Component,
|
|
70
|
-
args: [{ viewProviders: [{ provide: ControlContainer, useExisting: NgForm }], template: "<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' [scope]='scope' [meta]='cloneList' [parent]='item' [integrationCode]='integrationCode' [resourceType]='meta.resourceType || resourceType' theme='inherit' [preview]='preview'></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 *ngIf='!preview' 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='!preview && (!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", styles: [".Vlt-btn--link:not([disabled]) svg{fill:#e84545}.Vlt-btn--link:not([disabled]):hover svg{fill:#de1c1c}.item-add-button{background-color:var(--vgip-meta-input-action-hover-bg-color);color:var(--vgip-meta-input-color)}.item-add-button svg{fill:var(--vgip-meta-input-color)}.item-add-button:hover{transform:scale(1.02);box-shadow:inset 0 0 0 1px var(--vgip-meta-input-active-border-color)}.item-remove-button{border:0}.item-remove-button:disabled{cursor:not-allowed}\n"] }]
|
|
71
|
-
}] });
|
|
72
|
-
|
|
73
|
-
export { FieldList };
|
|
74
|
-
//# sourceMappingURL=vgip-meta-ui-index-39177940.mjs.map
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component } from '@angular/core';
|
|
3
|
-
import { F as FieldAbstract } from './vgip-meta-ui-fieldAbstract-17f26446.mjs';
|
|
4
|
-
import * as i1 from '@angular/common';
|
|
5
|
-
import 'rxjs';
|
|
6
|
-
import 'rxjs/operators';
|
|
7
|
-
|
|
8
|
-
/*
|
|
9
|
-
* @Author: Alexander.Vangelov@vonage.com
|
|
10
|
-
* @Date: 2019-09-19 17:35:19
|
|
11
|
-
* @Last Modified by: Alexander.Vangelov@vonage.com
|
|
12
|
-
* @Last Modified time: 2019-11-15 13:04:01
|
|
13
|
-
*/
|
|
14
|
-
class FieldUnknown extends FieldAbstract {
|
|
15
|
-
}
|
|
16
|
-
FieldUnknown.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FieldUnknown, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
17
|
-
FieldUnknown.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: FieldUnknown, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<div class=\"Vlt-form__element Vlt-form__element--big\">\n <div class=\"Vlt-input\">\n <input class='main model' type=\"text\" placeholder=\"\" value=\"Unknown field type '{{meta.type}}'.\" disabled/>\n <label class=\"Vlt-label Vlt-truncate\" style='padding-right: 20px;'>{{meta.label || meta.name}}</label>\n </div>\n <small *ngIf='meta.hint' class=\"Vlt-form__element__hint\">{{meta.hint}}</small>\n</div>", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
18
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FieldUnknown, decorators: [{
|
|
19
|
-
type: Component,
|
|
20
|
-
args: [{ template: "<div class=\"Vlt-form__element Vlt-form__element--big\">\n <div class=\"Vlt-input\">\n <input class='main model' type=\"text\" placeholder=\"\" value=\"Unknown field type '{{meta.type}}'.\" disabled/>\n <label class=\"Vlt-label Vlt-truncate\" style='padding-right: 20px;'>{{meta.label || meta.name}}</label>\n </div>\n <small *ngIf='meta.hint' class=\"Vlt-form__element__hint\">{{meta.hint}}</small>\n</div>" }]
|
|
21
|
-
}] });
|
|
22
|
-
|
|
23
|
-
export { FieldUnknown };
|
|
24
|
-
//# sourceMappingURL=vgip-meta-ui-index-5a12f79d.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vgip-meta-ui-index-5a12f79d.mjs","sources":["../../../projects/meta-ui/src/lib/fieldUnknown/index.ts","../../../projects/meta-ui/src/lib/fieldUnknown/view.html"],"sourcesContent":["/*\n * @Author: Alexander.Vangelov@vonage.com \n * @Date: 2019-09-19 17:35:19 \n * @Last Modified by: Alexander.Vangelov@vonage.com\n * @Last Modified time: 2019-11-15 13:04:01\n */\n\nimport { Component, Input, OnInit } from '@angular/core';\nimport { FieldAbstract } from '../fieldAbstract';\n\n@Component({\n templateUrl: './view.html'\n})\nexport class FieldUnknown extends FieldAbstract {}\n","<div class=\"Vlt-form__element Vlt-form__element--big\">\n <div class=\"Vlt-input\">\n <input class='main model' type=\"text\" placeholder=\"\" value=\"Unknown field type '{{meta.type}}'.\" disabled/>\n <label class=\"Vlt-label Vlt-truncate\" style='padding-right: 20px;'>{{meta.label || meta.name}}</label>\n </div>\n <small *ngIf='meta.hint' class=\"Vlt-form__element__hint\">{{meta.hint}}</small>\n</div>"],"names":[],"mappings":";;;;;;;AAAA;;;;;AAKG;AAQG,MAAO,YAAa,SAAQ,aAAa,CAAA;;yGAAlC,YAAY,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAZ,YAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAY,2ECbzB,kaAMM,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,IAAA,EAAA,QAAA,EAAA,QAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,UAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;2FDOO,YAAY,EAAA,UAAA,EAAA,CAAA;kBAHxB,SAAS;;;;;;"}
|
|
@@ -1,130 +0,0 @@
|
|
|
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.2.8", ngImport: i0, type: MetaContextService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
121
|
-
MetaContextService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: MetaContextService, providedIn: 'root' });
|
|
122
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", 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-6e77c362.mjs.map
|