@vgip/meta-ui 1.4.1 → 1.4.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/lib/common/fieldNormalizer/index.mjs +7 -1
- package/esm2020/lib/common/metaNormalizer.mjs +10 -1
- package/esm2020/lib/common/utils/smartProp.mjs +17 -0
- package/esm2020/lib/field.mjs +5 -5
- package/esm2020/lib/fieldAbstract.mjs +51 -14
- package/esm2020/lib/fieldDatetime/index.mjs +20 -7
- package/fesm2015/vgip-meta-ui.mjs +104 -23
- package/fesm2015/vgip-meta-ui.mjs.map +1 -1
- package/fesm2020/vgip-meta-ui.mjs +104 -23
- package/fesm2020/vgip-meta-ui.mjs.map +1 -1
- package/lib/common/utils/smartProp.d.ts +1 -0
- package/package.json +1 -1
|
@@ -376,6 +376,9 @@ const fieldNormalizer = (field, uniqFieldNames) => {
|
|
|
376
376
|
if (field.selectable) {
|
|
377
377
|
f.selectable = field.selectable;
|
|
378
378
|
}
|
|
379
|
+
if (field.resourceType) {
|
|
380
|
+
f.resourceType = field.resourceType;
|
|
381
|
+
}
|
|
379
382
|
}
|
|
380
383
|
else {
|
|
381
384
|
f = {
|
|
@@ -437,6 +440,9 @@ const fieldNormalizer = (field, uniqFieldNames) => {
|
|
|
437
440
|
if (field.visible || field.alwaysVisible) {
|
|
438
441
|
f.visible = field.visible || field.alwaysVisible;
|
|
439
442
|
}
|
|
443
|
+
if (field.hidden) {
|
|
444
|
+
f.hidden = field.hidden;
|
|
445
|
+
}
|
|
440
446
|
if (field.hint || field.helpText) {
|
|
441
447
|
f.hint = field.hint || field.helpText;
|
|
442
448
|
}
|
|
@@ -787,6 +793,15 @@ const metaNormalizer = (meta, integration, resourceType) => {
|
|
|
787
793
|
metaV3.layout.editable = false;
|
|
788
794
|
}
|
|
789
795
|
}
|
|
796
|
+
else if (integrationCode === 'CLIO') {
|
|
797
|
+
if (resourceType === 'PhoneCommunication') {
|
|
798
|
+
for (const f of metaV3.layout.sections[0].fields) {
|
|
799
|
+
if (f.name === 'time_entries') {
|
|
800
|
+
f.hidden = 'update';
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
}
|
|
790
805
|
return sortObj(metaV3);
|
|
791
806
|
};
|
|
792
807
|
|
|
@@ -882,6 +897,23 @@ const templateBuilder = (metaContext, pattern) => {
|
|
|
882
897
|
return patternBuilder;
|
|
883
898
|
};
|
|
884
899
|
|
|
900
|
+
const extractValueBySmartProp = (rootObj, prop) => {
|
|
901
|
+
// { WhoId: { id: 1, type: 'Contact' } } // "WhoId.type" -> 'Contact'
|
|
902
|
+
if (rootObj.hasOwnProperty(prop)) {
|
|
903
|
+
return rootObj[prop];
|
|
904
|
+
}
|
|
905
|
+
else {
|
|
906
|
+
const parts = prop.split('.');
|
|
907
|
+
if (parts.length > 1) {
|
|
908
|
+
if (rootObj.hasOwnProperty(parts[0])) {
|
|
909
|
+
if (typeof (rootObj[parts[0]]) === 'object' && rootObj[parts[0]][parts[1]]) {
|
|
910
|
+
return extractValueBySmartProp(rootObj[parts[0]], prop.substring(parts[0].length + 1));
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
};
|
|
916
|
+
|
|
885
917
|
/*
|
|
886
918
|
* @Author: Alexander.Vangelov@vonage.com
|
|
887
919
|
* @Date: 2019-09-19 17:34:44
|
|
@@ -930,30 +962,60 @@ class FieldAbstract {
|
|
|
930
962
|
configurable: true,
|
|
931
963
|
enumerable: false
|
|
932
964
|
});
|
|
965
|
+
if (typeof (this.meta.hidden) !== 'undefined') {
|
|
966
|
+
if (typeof (this.meta.hidden) === 'object') {
|
|
967
|
+
const setHiddenByPropertyConfig = (par) => {
|
|
968
|
+
if (typeof (this.meta.hidden[par]) === 'boolean') { // any value makes me hidden
|
|
969
|
+
this.meta.$hidden = !!this.parent[par];
|
|
970
|
+
}
|
|
971
|
+
else {
|
|
972
|
+
const value = extractValueBySmartProp(this.parent, par);
|
|
973
|
+
const parValue = value ? (value.id || value.value || value) : value;
|
|
974
|
+
this.meta.$hidden = this.meta.hidden[par] === parValue;
|
|
975
|
+
}
|
|
976
|
+
};
|
|
977
|
+
for (const par of Object.keys(this.meta.hidden)) {
|
|
978
|
+
setHiddenByPropertyConfig(par);
|
|
979
|
+
this.parentChangeSubject.subscribe((value) => {
|
|
980
|
+
if (value && value.hasOwnProperty(par.split('.')[0])) {
|
|
981
|
+
setHiddenByPropertyConfig(par);
|
|
982
|
+
}
|
|
983
|
+
});
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
else if (this.meta.hidden === 'create') {
|
|
987
|
+
this.meta.$hidden = !this.isPersistedParent;
|
|
988
|
+
}
|
|
989
|
+
else if (this.meta.hidden === 'update') {
|
|
990
|
+
this.meta.$hidden = this.isPersistedParent;
|
|
991
|
+
}
|
|
992
|
+
else {
|
|
993
|
+
this.meta.$hidden = !!this.meta.hidden;
|
|
994
|
+
}
|
|
995
|
+
}
|
|
933
996
|
Object.defineProperty(this.meta, '$invisible', {
|
|
934
997
|
value: false,
|
|
935
998
|
writable: true,
|
|
936
999
|
configurable: true,
|
|
937
1000
|
enumerable: false
|
|
938
1001
|
});
|
|
939
|
-
if (typeof (this.meta.visible) !== undefined) {
|
|
1002
|
+
if (typeof (this.meta.visible) !== 'undefined') {
|
|
940
1003
|
if (typeof (this.meta.visible) === 'object') {
|
|
941
|
-
|
|
942
|
-
if (typeof (this.meta.visible[par]) === 'boolean') { // any value makes me
|
|
1004
|
+
const setInvisibleByPropertyConfig = (par) => {
|
|
1005
|
+
if (typeof (this.meta.visible[par]) === 'boolean') { // any value makes me hidden
|
|
943
1006
|
this.meta.$invisible = !this.parent[par];
|
|
944
1007
|
}
|
|
945
|
-
else {
|
|
946
|
-
|
|
1008
|
+
else {
|
|
1009
|
+
const value = extractValueBySmartProp(this.parent, par);
|
|
1010
|
+
const parValue = value ? (value.id || value.value || value) : value;
|
|
1011
|
+
this.meta.$invisible = this.meta.visible[par] !== parValue;
|
|
947
1012
|
}
|
|
1013
|
+
};
|
|
1014
|
+
for (const par of Object.keys(this.meta.visible)) {
|
|
1015
|
+
setInvisibleByPropertyConfig(par);
|
|
948
1016
|
this.parentChangeSubject.subscribe((value) => {
|
|
949
|
-
if (value && value.hasOwnProperty(par)) {
|
|
950
|
-
|
|
951
|
-
if (typeof (this.meta.visible[par]) === 'boolean') { // any value makes me visible
|
|
952
|
-
this.meta.$invisible = !parValue;
|
|
953
|
-
}
|
|
954
|
-
else {
|
|
955
|
-
this.meta.$invisible = (parValue !== this.meta.visible[par]);
|
|
956
|
-
}
|
|
1017
|
+
if (value && value.hasOwnProperty(par.split('.')[0])) {
|
|
1018
|
+
setInvisibleByPropertyConfig(par);
|
|
957
1019
|
if (this.meta.$invisible) {
|
|
958
1020
|
delete this.parent[this.meta.name];
|
|
959
1021
|
}
|
|
@@ -961,6 +1023,12 @@ class FieldAbstract {
|
|
|
961
1023
|
});
|
|
962
1024
|
}
|
|
963
1025
|
}
|
|
1026
|
+
else if (this.meta.visible === 'create') {
|
|
1027
|
+
this.meta.$invisible = this.isPersistedParent;
|
|
1028
|
+
}
|
|
1029
|
+
else if (this.meta.visible === 'update') {
|
|
1030
|
+
this.meta.$invisible = !this.isPersistedParent;
|
|
1031
|
+
}
|
|
964
1032
|
}
|
|
965
1033
|
if (this.theme !== 'inherit') {
|
|
966
1034
|
const metaTheme = this.theme === 'dark' ? metaDark : metaLight;
|
|
@@ -2063,7 +2131,10 @@ class FieldDatetime extends FieldAbstract {
|
|
|
2063
2131
|
}
|
|
2064
2132
|
}
|
|
2065
2133
|
}
|
|
2066
|
-
if (this.meta.valueType === '
|
|
2134
|
+
if (this.meta.valueType === 'isostring') {
|
|
2135
|
+
this.value = date.toISOString();
|
|
2136
|
+
}
|
|
2137
|
+
else if (this.meta.valueType === 'string') {
|
|
2067
2138
|
if ((this.meta.type || this.meta.subtype) === 'date') {
|
|
2068
2139
|
this.value = date.toISOString().split('T')[0];
|
|
2069
2140
|
}
|
|
@@ -2104,11 +2175,21 @@ class FieldDatetime extends FieldAbstract {
|
|
|
2104
2175
|
date = new Date(Date.parse(new Date().toISOString().replace(/T.*Z/, `T${value}Z`)) + (new Date().getTimezoneOffset() * 60000));
|
|
2105
2176
|
}
|
|
2106
2177
|
this.model = date.toTimeString().split(' ')[0];
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2178
|
+
if (this.meta.valueType === 'isostring') {
|
|
2179
|
+
this.value = date.toISOString();
|
|
2180
|
+
}
|
|
2181
|
+
else {
|
|
2182
|
+
date.setFullYear(1970);
|
|
2183
|
+
date.setMonth(0);
|
|
2184
|
+
date.setDate(1);
|
|
2185
|
+
date.setMilliseconds(0);
|
|
2186
|
+
if (this.meta.valueType === 'string') {
|
|
2187
|
+
this.value = new Date(date.getTime() - (date.getTimezoneOffset() * 60000)).toISOString().split('T')[1].substring(0, 8);
|
|
2188
|
+
}
|
|
2189
|
+
else {
|
|
2190
|
+
this.value = new Date(date.getTime() - (date.getTimezoneOffset() * 60000)).getTime();
|
|
2191
|
+
}
|
|
2192
|
+
}
|
|
2112
2193
|
}
|
|
2113
2194
|
catch (e) {
|
|
2114
2195
|
console.error('Date parse error', e.message, `"${value}"`, `(${typeof (value)})`);
|
|
@@ -2888,10 +2969,10 @@ class FieldComposite extends FieldAbstract {
|
|
|
2888
2969
|
}
|
|
2889
2970
|
}
|
|
2890
2971
|
FieldComposite.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FieldComposite, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2891
|
-
FieldComposite.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.2", type: FieldComposite, selector: "ng-component", inputs: { meta: "meta" }, usesInheritance: true, ngImport: i0, template: "<div [ngClass]=\"{ 'Vlt-grid Vlt-grid--narrow': isRow }\" >\n <div style='margin: 0;' [ngClass]=\"{ 'Vlt-col': isRow, 'Vlt-col--1of3': isRow && fields.length > 3 }\" *ngFor='let field of fields'>\n <vgip-meta-field *ngIf='!meta.$invisible' class='shown' [index]='index' [meta]='field' [parent]='value' [integrationCode]='integrationCode' [preview]='preview' theme='inherit'></vgip-meta-field>\n </div>\n</div>\n", styles: ["div>vgip-meta-field{display:none}div>vgip-meta-field.shown{display:initial}\n"], components: [{ type: i0.forwardRef(function () { return MetaField; }), selector: "vgip-meta-field", inputs: ["meta", "parent", "integrationCode", "resourceType", "index", "preview", "theme"], outputs: ["onChange", "onLeave"] }], directives: [{ type: i0.forwardRef(function () { return i1.NgClass; }), selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i0.forwardRef(function () { return i1.NgForOf; }), selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i0.forwardRef(function () { return i1.NgIf; }), selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
2972
|
+
FieldComposite.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.2", type: FieldComposite, selector: "ng-component", inputs: { meta: "meta" }, usesInheritance: true, ngImport: i0, template: "<div [ngClass]=\"{ 'Vlt-grid Vlt-grid--narrow': isRow }\" >\n <div style='margin: 0;' [ngClass]=\"{ 'Vlt-col': isRow, 'Vlt-col--1of3': isRow && fields.length > 3 }\" *ngFor='let field of fields'>\n <vgip-meta-field *ngIf='!meta.$invisible' class='shown' [index]='index' [meta]='field' [parent]='value' [integrationCode]='integrationCode' [resourceType]='resourceType' [preview]='preview' theme='inherit'></vgip-meta-field>\n </div>\n</div>\n", styles: ["div>vgip-meta-field{display:none}div>vgip-meta-field.shown{display:initial}\n"], components: [{ type: i0.forwardRef(function () { return MetaField; }), selector: "vgip-meta-field", inputs: ["meta", "parent", "integrationCode", "resourceType", "index", "preview", "theme"], outputs: ["onChange", "onLeave"] }], directives: [{ type: i0.forwardRef(function () { return i1.NgClass; }), selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i0.forwardRef(function () { return i1.NgForOf; }), selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i0.forwardRef(function () { return i1.NgIf; }), selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
2892
2973
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FieldComposite, decorators: [{
|
|
2893
2974
|
type: Component,
|
|
2894
|
-
args: [{ template: "<div [ngClass]=\"{ 'Vlt-grid Vlt-grid--narrow': isRow }\" >\n <div style='margin: 0;' [ngClass]=\"{ 'Vlt-col': isRow, 'Vlt-col--1of3': isRow && fields.length > 3 }\" *ngFor='let field of fields'>\n <vgip-meta-field *ngIf='!meta.$invisible' class='shown' [index]='index' [meta]='field' [parent]='value' [integrationCode]='integrationCode' [preview]='preview' theme='inherit'></vgip-meta-field>\n </div>\n</div>\n", styles: ["div>vgip-meta-field{display:none}div>vgip-meta-field.shown{display:initial}\n"] }]
|
|
2975
|
+
args: [{ template: "<div [ngClass]=\"{ 'Vlt-grid Vlt-grid--narrow': isRow }\" >\n <div style='margin: 0;' [ngClass]=\"{ 'Vlt-col': isRow, 'Vlt-col--1of3': isRow && fields.length > 3 }\" *ngFor='let field of fields'>\n <vgip-meta-field *ngIf='!meta.$invisible' class='shown' [index]='index' [meta]='field' [parent]='value' [integrationCode]='integrationCode' [resourceType]='resourceType' [preview]='preview' theme='inherit'></vgip-meta-field>\n </div>\n</div>\n", styles: ["div>vgip-meta-field{display:none}div>vgip-meta-field.shown{display:initial}\n"] }]
|
|
2895
2976
|
}], propDecorators: { meta: [{
|
|
2896
2977
|
type: Input
|
|
2897
2978
|
}] } });
|
|
@@ -4177,10 +4258,10 @@ class FieldList extends FieldAbstract {
|
|
|
4177
4258
|
}
|
|
4178
4259
|
}
|
|
4179
4260
|
FieldList.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FieldList, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
4180
|
-
FieldList.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.2", 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' [meta]='list' [parent]='item' [integrationCode]='integrationCode' 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\" [disabled]='model.length === (validations.min || 0)'
|
|
4261
|
+
FieldList.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.2", 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' [meta]='list' [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", 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"], components: [{ type: i0.forwardRef(function () { return MetaField; }), selector: "vgip-meta-field", inputs: ["meta", "parent", "integrationCode", "resourceType", "index", "preview", "theme"], outputs: ["onChange", "onLeave"] }], directives: [{ type: i0.forwardRef(function () { return i1.NgIf; }), selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i0.forwardRef(function () { return i1.NgClass; }), selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i0.forwardRef(function () { return i4.DefaultValueAccessor; }), selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i0.forwardRef(function () { return i4.RequiredValidator; }), selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i0.forwardRef(function () { return i4.NgControlStatus; }), selector: "[formControlName],[ngModel],[formControl]" }, { type: i0.forwardRef(function () { return i4.NgModel; }), selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i0.forwardRef(function () { return i1.NgForOf; }), selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "metaModel": i0.forwardRef(function () { return MetaModelPipe; }) }, viewProviders: [{ provide: ControlContainer, useExisting: NgForm }] });
|
|
4181
4262
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FieldList, decorators: [{
|
|
4182
4263
|
type: Component,
|
|
4183
|
-
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' [meta]='list' [parent]='item' [integrationCode]='integrationCode' 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\" [disabled]='model.length === (validations.min || 0)'
|
|
4264
|
+
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' [meta]='list' [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", 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"] }]
|
|
4184
4265
|
}] });
|
|
4185
4266
|
//// LAYOUT
|
|
4186
4267
|
class MetaLayout {
|