@vgip/meta-ui 1.2.5 → 1.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/common/metaIcons.pipe.mjs +3 -3
- package/esm2020/lib/common/utils/relativeTimeBuilder.mjs +3 -3
- package/esm2020/lib/field.mjs +6 -6
- package/esm2020/lib/fieldAbstract.mjs +33 -1
- package/esm2020/lib/fieldDatetime/index.mjs +16 -3
- package/esm2020/lib/fieldInput/index.mjs +16 -3
- package/fesm2015/vgip-meta-ui.mjs +71 -13
- package/fesm2015/vgip-meta-ui.mjs.map +1 -1
- package/fesm2020/vgip-meta-ui.mjs +71 -13
- package/fesm2020/vgip-meta-ui.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -898,6 +898,38 @@ class FieldAbstract {
|
|
|
898
898
|
configurable: true,
|
|
899
899
|
enumerable: false
|
|
900
900
|
});
|
|
901
|
+
Object.defineProperty(this.meta, '$invisible', {
|
|
902
|
+
value: false,
|
|
903
|
+
writable: true,
|
|
904
|
+
configurable: true,
|
|
905
|
+
enumerable: false
|
|
906
|
+
});
|
|
907
|
+
if (typeof (this.meta.visible) !== undefined) {
|
|
908
|
+
if (typeof (this.meta.visible) === 'object') {
|
|
909
|
+
for (const par of Object.keys(this.meta.visible)) {
|
|
910
|
+
if (typeof (this.meta.visible[par]) === 'boolean') { // any value makes me visible
|
|
911
|
+
this.meta.$invisible = !this.parent[par];
|
|
912
|
+
}
|
|
913
|
+
else { // only specific value
|
|
914
|
+
this.meta.$invisible = this.parent[par] !== this.meta.visible[par];
|
|
915
|
+
}
|
|
916
|
+
this.parentChangeSubject.subscribe((value) => {
|
|
917
|
+
if (value && value.hasOwnProperty(par)) {
|
|
918
|
+
const parValue = value[par] ? (value[par].id || value[par].value || value[par]) : value[par];
|
|
919
|
+
if (typeof (this.meta.visible[par]) === 'boolean') { // any value makes me visible
|
|
920
|
+
this.meta.$invisible = !parValue;
|
|
921
|
+
}
|
|
922
|
+
else {
|
|
923
|
+
this.meta.$invisible = (parValue !== this.meta.visible[par]);
|
|
924
|
+
}
|
|
925
|
+
if (this.meta.$invisible) {
|
|
926
|
+
delete this.parent[this.meta.name];
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
});
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
}
|
|
901
933
|
if (this.theme !== 'inherit') {
|
|
902
934
|
const metaTheme = this.theme === 'dark' ? metaDark : metaLight;
|
|
903
935
|
for (const key of Object.keys(metaTheme.properties)) {
|
|
@@ -1182,10 +1214,10 @@ const wordToMilliseconds = {
|
|
|
1182
1214
|
days: 1000 * 60 * 60 * 24
|
|
1183
1215
|
};
|
|
1184
1216
|
const protoTime = (text) => {
|
|
1185
|
-
const protoMatch = (text || '').match(/^(-?)(\d+).(\S+)$/);
|
|
1217
|
+
const protoMatch = (text || '').match(/^(-?)((\d+).)?(\S+)$/);
|
|
1186
1218
|
if (protoMatch) {
|
|
1187
1219
|
const negative = protoMatch[1] === '-';
|
|
1188
|
-
const units = parseInt(protoMatch[
|
|
1220
|
+
const units = parseInt(protoMatch[3], 10) * (wordToMilliseconds[protoMatch[4]] || 0);
|
|
1189
1221
|
if (negative) {
|
|
1190
1222
|
return -units;
|
|
1191
1223
|
}
|
|
@@ -1366,6 +1398,9 @@ class FieldInput extends FieldAbstract {
|
|
|
1366
1398
|
let date;
|
|
1367
1399
|
if ((typeof (value) === 'number')) {
|
|
1368
1400
|
date = new Date(parseInt(value, 10));
|
|
1401
|
+
if ('date' === (this.meta.type || this.meta.subtype)) {
|
|
1402
|
+
date = new Date(date.getTime() + (date.getTimezoneOffset() * 60000));
|
|
1403
|
+
}
|
|
1369
1404
|
}
|
|
1370
1405
|
else {
|
|
1371
1406
|
if ('date' === (this.meta.subtype || this.meta.type)) {
|
|
@@ -1406,8 +1441,11 @@ class FieldInput extends FieldAbstract {
|
|
|
1406
1441
|
date.setHours(0);
|
|
1407
1442
|
date.setSeconds(0);
|
|
1408
1443
|
date.setMilliseconds(0);
|
|
1444
|
+
this.value = new Date(date.getTime() - (date.getTimezoneOffset() * 60000)).getTime();
|
|
1445
|
+
}
|
|
1446
|
+
else {
|
|
1447
|
+
this.value = date.getTime();
|
|
1409
1448
|
}
|
|
1410
|
-
this.value = date.getTime();
|
|
1411
1449
|
}
|
|
1412
1450
|
}
|
|
1413
1451
|
catch (e) {
|
|
@@ -1419,12 +1457,19 @@ class FieldInput extends FieldAbstract {
|
|
|
1419
1457
|
let date;
|
|
1420
1458
|
if (typeof (value) === 'number') {
|
|
1421
1459
|
date = new Date(parseInt(value, 10));
|
|
1460
|
+
if (value < 86400000) {
|
|
1461
|
+
date = new Date(date.getTime() + (date.getTimezoneOffset() * 60000));
|
|
1462
|
+
}
|
|
1422
1463
|
}
|
|
1423
1464
|
else {
|
|
1424
1465
|
date = new Date(Date.parse(new Date().toISOString().replace(/T.*Z/, `T${value}Z`)) + (new Date().getTimezoneOffset() * 60000));
|
|
1425
1466
|
}
|
|
1426
1467
|
this.model = date.toTimeString().split(' ')[0];
|
|
1427
|
-
|
|
1468
|
+
date.setFullYear(1970);
|
|
1469
|
+
date.setMonth(0);
|
|
1470
|
+
date.setDate(1);
|
|
1471
|
+
date.setMilliseconds(0);
|
|
1472
|
+
this.value = new Date(date.getTime() - (date.getTimezoneOffset() * 60000)).getTime();
|
|
1428
1473
|
}
|
|
1429
1474
|
catch (e) {
|
|
1430
1475
|
console.error('Date parse error', e.message, `"${value}"`, `(${typeof (value)})`);
|
|
@@ -1945,6 +1990,9 @@ class FieldDatetime extends FieldAbstract {
|
|
|
1945
1990
|
let date;
|
|
1946
1991
|
if ((typeof (value) === 'number')) {
|
|
1947
1992
|
date = new Date(parseInt(value, 10));
|
|
1993
|
+
if ('date' === (this.meta.type || this.meta.subtype)) {
|
|
1994
|
+
date = new Date(date.getTime() + (date.getTimezoneOffset() * 60000));
|
|
1995
|
+
}
|
|
1948
1996
|
}
|
|
1949
1997
|
else {
|
|
1950
1998
|
if ('date' === (this.meta.type || this.meta.subtype)) {
|
|
@@ -1985,8 +2033,11 @@ class FieldDatetime extends FieldAbstract {
|
|
|
1985
2033
|
date.setHours(0);
|
|
1986
2034
|
date.setSeconds(0);
|
|
1987
2035
|
date.setMilliseconds(0);
|
|
2036
|
+
this.value = new Date(date.getTime() - (date.getTimezoneOffset() * 60000)).getTime();
|
|
2037
|
+
}
|
|
2038
|
+
else {
|
|
2039
|
+
this.value = date.getTime();
|
|
1988
2040
|
}
|
|
1989
|
-
this.value = date.getTime();
|
|
1990
2041
|
}
|
|
1991
2042
|
}
|
|
1992
2043
|
catch (e) {
|
|
@@ -1998,12 +2049,19 @@ class FieldDatetime extends FieldAbstract {
|
|
|
1998
2049
|
let date;
|
|
1999
2050
|
if (typeof (value) === 'number') {
|
|
2000
2051
|
date = new Date(parseInt(value, 10));
|
|
2052
|
+
if (value < 86400000) {
|
|
2053
|
+
date = new Date(date.getTime() + (date.getTimezoneOffset() * 60000));
|
|
2054
|
+
}
|
|
2001
2055
|
}
|
|
2002
2056
|
else {
|
|
2003
2057
|
date = new Date(Date.parse(new Date().toISOString().replace(/T.*Z/, `T${value}Z`)) + (new Date().getTimezoneOffset() * 60000));
|
|
2004
2058
|
}
|
|
2005
2059
|
this.model = date.toTimeString().split(' ')[0];
|
|
2006
|
-
|
|
2060
|
+
date.setFullYear(1970);
|
|
2061
|
+
date.setMonth(0);
|
|
2062
|
+
date.setDate(1);
|
|
2063
|
+
date.setMilliseconds(0);
|
|
2064
|
+
this.value = new Date(date.getTime() - (date.getTimezoneOffset() * 60000)).getTime();
|
|
2007
2065
|
}
|
|
2008
2066
|
catch (e) {
|
|
2009
2067
|
console.error('Date parse error', e.message, `"${value}"`, `(${typeof (value)})`);
|
|
@@ -2755,10 +2813,10 @@ class FieldComposite extends FieldAbstract {
|
|
|
2755
2813
|
}
|
|
2756
2814
|
}
|
|
2757
2815
|
FieldComposite.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FieldComposite, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2758
|
-
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 class='shown' [index]='index' [meta]='field' [parent]='parent' [integrationCode]='integrationCode' [preview]='preview' theme='inherit'></vgip-meta-field>\n </div>\n</div>", 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"] }] });
|
|
2816
|
+
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 class='shown' [index]='index' [meta]='field' [parent]='parent' [integrationCode]='integrationCode' [preview]='preview' theme='inherit' [ngClass]=\"{ shown: !field.$invisible }\"></vgip-meta-field>\n </div>\n</div>", 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"] }] });
|
|
2759
2817
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: FieldComposite, decorators: [{
|
|
2760
2818
|
type: Component,
|
|
2761
|
-
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 class='shown' [index]='index' [meta]='field' [parent]='parent' [integrationCode]='integrationCode' [preview]='preview' theme='inherit'></vgip-meta-field>\n </div>\n</div>" }]
|
|
2819
|
+
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 class='shown' [index]='index' [meta]='field' [parent]='parent' [integrationCode]='integrationCode' [preview]='preview' theme='inherit' [ngClass]=\"{ shown: !field.$invisible }\"></vgip-meta-field>\n </div>\n</div>", styles: ["div>vgip-meta-field{display:none}div>vgip-meta-field.shown{display:initial}\n"] }]
|
|
2762
2820
|
}], propDecorators: { meta: [{
|
|
2763
2821
|
type: Input
|
|
2764
2822
|
}] } });
|
|
@@ -4155,10 +4213,10 @@ class MetaLayout {
|
|
|
4155
4213
|
}
|
|
4156
4214
|
}
|
|
4157
4215
|
MetaLayout.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MetaLayout, deps: [{ token: i0.ComponentFactoryResolver }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: MetaResourceService }, { token: MetaReferenceService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4158
|
-
MetaLayout.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.2", type: MetaLayout, selector: "vgip-meta-layout", inputs: { meta: "meta", resource: "resource", integration: "integration", type: "type", preview: "preview", theme: "theme" }, usesOnChanges: true, ngImport: i0, template: "<div *ngFor='let section of meta.sections' class='Vlt-section' [ngClass]=\"{ shown: showAll || section.visible || (!meta.oneTimeOptional && !section.$optional) || (meta.oneTimeOptional && !optionalFieldsCount) }\">\n\t<h5 *ngIf='section.label' class=\"Vlt-section__title\">{{section.label}}</h5>\n\t<div style='overflow: visible;' [ngClass]=\"{ 'for-preview': preview }\">\n\t\t<small *ngIf='section.description' class=\"Vlt-form__element__hint\">{{section.description}}</small>\n\t\t<div>\n\t\t\t<ng-container *ngFor='let field of section.fields'>\n\t\t\t\t<vgip-meta-field *ngIf='!field.$hidden && (showAll || section.visible || !field.$optional)' [meta]='field' [parent]='resource' [integrationCode]='integrationCode' [resourceType]='resourceType' [preview]='preview' [ngClass]=\"{ shown: showAll || true }\" theme='inherit' [attr.data-theme]='theme'></vgip-meta-field>\n\t\t\t</ng-container>\n\t\t</div>\n\t</div>\n</div>\n<div *ngIf='isPersistedResource && meta.children && preview'>\n\t<div *ngFor='let child of meta.children'>\n\t\t<h5 class='Vlt-children__title'>\n\t\t\t<svg class=\"Vlt-icon\"><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-stack\" /></svg> \n\t\t\t{{child.label}} <span class='Vlt-grey'>({{(resource[child.name] || []).length}})</span>\n\t\t</h5>\n\t\t<div *ngFor=\"let c of resource[child.name]\" style='position: relative;'>\n\n\t\t\t<div class=\"Vlt-card Vlt-bg-white\">\n\t\t\t\t<div class=\"Vlt-card__content Vlt-btn-on-hover\">\n\t\t\t\t\t<h5>{{c.Subject || c.subject || c.summary || c.title || c.CaseNumber || c.comment || c.body || c.name || c.topic || c.content || '...' }}</h5>\n\t\t\t\t\t<div style='font-size: 12px; line-height: 16px;'>\n\t\t\t\t\t\tCreated: <span class='Vlt-black'>{{c._vgis.createdDate | date:'mediumDate'}}</span>\n\t\t\t\t\t\tEdited: <span class='Vlt-black'>{{c._vgis.modifiedDate | date:'medium'}}</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"Vlt-badge Vlt-badge--app Vlt-badge--purple Vlt-badge--small\">{{c._vgis.resourceType}}</div>\n\t\t\t\t\t<div class=\"Vlt-btn-group Vlt-btn-group--hover\">\n\t\t\t\t\t\t<a *ngIf='c._vgis.externalLink' attr.href='{{c._vgis.externalLink}}' target='_blank' rel='noopener' rel='noopener' class=\"Vlt-btn Vlt-btn--tertiary Vlt-btn--icon\" aria-label='Open external'><svg style='margin-left: 0; margin-right: 0;'><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-open\"/></svg></a>\n\t\t\t\t\t\t<button type='button' (click)='openChild(child, c)' class=\"Vlt-btn Vlt-btn--tertiary Vlt-btn--icon\"><svg style='margin-left: 0; margin-right: 0;'><use attr.xlink:href=\"volta/volta-icons.svg#Vlt-icon-{{ child.reference.editable ? 'edit' : 'eye-negative' }}\"/></svg></button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<button style='width: 100%; margin-top: 0; max-width: 100%;' type='button' (click)='openChild(child)' class=\"Vlt-btn Vlt-btn--small Vlt-btn--secondary\" [disabled]='child.creatable === false'>\n\t\t\t<svg><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-plus\"/></svg>{{child.reference.label}}\n\t\t</button>\n\t</div>\n</div>\n<div *ngIf='!(meta.oneTimeOptional && showAll)' [ngClass]='{ centered: !meta.oneTimeOptional }'>\n\t<button *ngIf='!preview && optionalFieldsCount' type='button' (click)='toggleOptionalFields()' class=\"Vlt-btn Vlt-btn--small Vlt-btn--link more-button\" style='margin: 0; margin-bottom: 10px;'>\n\t\t<svg><use attr.xlink:href=\"volta/volta-icons.svg#Vlt-icon-chevron-{{ showAll ? 'up' : 'down' }}\"/></svg>\n\t\t{{ showAll ? 'Hide' : 'Show' }} Optional Fields ({{optionalFieldsCount}})\n\t</button>\n</div>\n", styles: ["vgip-meta-field{display:none}vgip-meta-field.shown{display:initial}.Vlt-section__title{line-height:14px;padding:16px 16px 14px 3px;margin:-9px -1px 8px;background-color:var(--vgip-meta-resource-bg-color);color:var(--vgip-meta-resource-color);position:sticky;top:-9px;z-index:3;border-bottom:1px solid var(--vgip-meta-separator-color)}.Vlt-section{margin:0;padding-bottom:8px;display:none}.Vlt-section.shown{display:block}.Vlt-btn.vlt-add-child:hover{transform:scale(1.02)}.for-preview{margin-top:-6px}.Vlt-card{margin-bottom:16px;padding:16px}.Vlt-card .Vlt-btn-group.Vlt-btn-group--hover{right:-8px}button.more-button:focus{font-weight:bold}.centered{text-align:center}.Vlt-btn--link{color:var(--vgip-meta-link-color)}.Vlt-btn--link:hover{color:var(--vgip-meta-link-hover-color)}.Vlt-btn--link svg{fill:var(--vgip-meta-link-color)}\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.NgForOf; }), selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i0.forwardRef(function () { return i1.NgClass; }), selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i0.forwardRef(function () { return i1.NgIf; }), selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "date": i0.forwardRef(function () { return i1.DatePipe; }) } });
|
|
4216
|
+
MetaLayout.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.2", type: MetaLayout, selector: "vgip-meta-layout", inputs: { meta: "meta", resource: "resource", integration: "integration", type: "type", preview: "preview", theme: "theme" }, usesOnChanges: true, ngImport: i0, template: "<div *ngFor='let section of meta.sections' class='Vlt-section' [ngClass]=\"{ shown: showAll || section.visible || (!meta.oneTimeOptional && !section.$optional) || (meta.oneTimeOptional && !optionalFieldsCount) }\">\n\t<h5 *ngIf='section.label' class=\"Vlt-section__title\">{{section.label}}</h5>\n\t<div style='overflow: visible;' [ngClass]=\"{ 'for-preview': preview }\">\n\t\t<small *ngIf='section.description' class=\"Vlt-form__element__hint\">{{section.description}}</small>\n\t\t<div>\n\t\t\t<ng-container *ngFor='let field of section.fields'>\n\t\t\t\t<vgip-meta-field *ngIf='!field.$hidden && (showAll || section.visible || !field.$optional)' [meta]='field' [parent]='resource' [integrationCode]='integrationCode' [resourceType]='resourceType' [preview]='preview' [ngClass]=\"{ shown: !field.$invisible && (showAll || true) }\" theme='inherit' [attr.data-theme]='theme'></vgip-meta-field>\n\t\t\t</ng-container>\n\t\t</div>\n\t</div>\n</div>\n<div *ngIf='isPersistedResource && meta.children && preview'>\n\t<div *ngFor='let child of meta.children'>\n\t\t<h5 class='Vlt-children__title'>\n\t\t\t<svg class=\"Vlt-icon\"><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-stack\" /></svg> \n\t\t\t{{child.label}} <span class='Vlt-grey'>({{(resource[child.name] || []).length}})</span>\n\t\t</h5>\n\t\t<div *ngFor=\"let c of resource[child.name]\" style='position: relative;'>\n\n\t\t\t<div class=\"Vlt-card Vlt-bg-white\">\n\t\t\t\t<div class=\"Vlt-card__content Vlt-btn-on-hover\">\n\t\t\t\t\t<h5>{{c.Subject || c.subject || c.summary || c.title || c.CaseNumber || c.comment || c.body || c.name || c.topic || c.content || '...' }}</h5>\n\t\t\t\t\t<div style='font-size: 12px; line-height: 16px;'>\n\t\t\t\t\t\tCreated: <span class='Vlt-black'>{{c._vgis.createdDate | date:'mediumDate'}}</span>\n\t\t\t\t\t\tEdited: <span class='Vlt-black'>{{c._vgis.modifiedDate | date:'medium'}}</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"Vlt-badge Vlt-badge--app Vlt-badge--purple Vlt-badge--small\">{{c._vgis.resourceType}}</div>\n\t\t\t\t\t<div class=\"Vlt-btn-group Vlt-btn-group--hover\">\n\t\t\t\t\t\t<a *ngIf='c._vgis.externalLink' attr.href='{{c._vgis.externalLink}}' target='_blank' rel='noopener' rel='noopener' class=\"Vlt-btn Vlt-btn--tertiary Vlt-btn--icon\" aria-label='Open external'><svg style='margin-left: 0; margin-right: 0;'><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-open\"/></svg></a>\n\t\t\t\t\t\t<button type='button' (click)='openChild(child, c)' class=\"Vlt-btn Vlt-btn--tertiary Vlt-btn--icon\"><svg style='margin-left: 0; margin-right: 0;'><use attr.xlink:href=\"volta/volta-icons.svg#Vlt-icon-{{ child.reference.editable ? 'edit' : 'eye-negative' }}\"/></svg></button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<button style='width: 100%; margin-top: 0; max-width: 100%;' type='button' (click)='openChild(child)' class=\"Vlt-btn Vlt-btn--small Vlt-btn--secondary\" [disabled]='child.creatable === false'>\n\t\t\t<svg><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-plus\"/></svg>{{child.reference.label}}\n\t\t</button>\n\t</div>\n</div>\n<div *ngIf='!(meta.oneTimeOptional && showAll)' [ngClass]='{ centered: !meta.oneTimeOptional }'>\n\t<button *ngIf='!preview && optionalFieldsCount' type='button' (click)='toggleOptionalFields()' class=\"Vlt-btn Vlt-btn--small Vlt-btn--link more-button\" style='margin: 0; margin-bottom: 10px;'>\n\t\t<svg><use attr.xlink:href=\"volta/volta-icons.svg#Vlt-icon-chevron-{{ showAll ? 'up' : 'down' }}\"/></svg>\n\t\t{{ showAll ? 'Hide' : 'Show' }} Optional Fields ({{optionalFieldsCount}})\n\t</button>\n</div>\n", styles: ["vgip-meta-field{display:none}vgip-meta-field.shown{display:initial}.Vlt-section__title{line-height:14px;padding:16px 16px 14px 3px;margin:-9px -1px 8px;background-color:var(--vgip-meta-resource-bg-color);color:var(--vgip-meta-resource-color);position:sticky;top:-9px;z-index:3;border-bottom:1px solid var(--vgip-meta-separator-color)}.Vlt-section{margin:0;padding-bottom:8px;display:none}.Vlt-section.shown{display:block}.Vlt-btn.vlt-add-child:hover{transform:scale(1.02)}.for-preview{margin-top:-6px}.Vlt-card{margin-bottom:16px;padding:16px}.Vlt-card .Vlt-btn-group.Vlt-btn-group--hover{right:-8px}button.more-button:focus{font-weight:bold}.centered{text-align:center}.Vlt-btn--link{color:var(--vgip-meta-link-color)}.Vlt-btn--link:hover{color:var(--vgip-meta-link-hover-color)}.Vlt-btn--link svg{fill:var(--vgip-meta-link-color)}\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.NgForOf; }), selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i0.forwardRef(function () { return i1.NgClass; }), selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i0.forwardRef(function () { return i1.NgIf; }), selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "date": i0.forwardRef(function () { return i1.DatePipe; }) } });
|
|
4159
4217
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MetaLayout, decorators: [{
|
|
4160
4218
|
type: Component,
|
|
4161
|
-
args: [{ selector: 'vgip-meta-layout', template: "<div *ngFor='let section of meta.sections' class='Vlt-section' [ngClass]=\"{ shown: showAll || section.visible || (!meta.oneTimeOptional && !section.$optional) || (meta.oneTimeOptional && !optionalFieldsCount) }\">\n\t<h5 *ngIf='section.label' class=\"Vlt-section__title\">{{section.label}}</h5>\n\t<div style='overflow: visible;' [ngClass]=\"{ 'for-preview': preview }\">\n\t\t<small *ngIf='section.description' class=\"Vlt-form__element__hint\">{{section.description}}</small>\n\t\t<div>\n\t\t\t<ng-container *ngFor='let field of section.fields'>\n\t\t\t\t<vgip-meta-field *ngIf='!field.$hidden && (showAll || section.visible || !field.$optional)' [meta]='field' [parent]='resource' [integrationCode]='integrationCode' [resourceType]='resourceType' [preview]='preview' [ngClass]=\"{ shown: showAll || true }\" theme='inherit' [attr.data-theme]='theme'></vgip-meta-field>\n\t\t\t</ng-container>\n\t\t</div>\n\t</div>\n</div>\n<div *ngIf='isPersistedResource && meta.children && preview'>\n\t<div *ngFor='let child of meta.children'>\n\t\t<h5 class='Vlt-children__title'>\n\t\t\t<svg class=\"Vlt-icon\"><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-stack\" /></svg> \n\t\t\t{{child.label}} <span class='Vlt-grey'>({{(resource[child.name] || []).length}})</span>\n\t\t</h5>\n\t\t<div *ngFor=\"let c of resource[child.name]\" style='position: relative;'>\n\n\t\t\t<div class=\"Vlt-card Vlt-bg-white\">\n\t\t\t\t<div class=\"Vlt-card__content Vlt-btn-on-hover\">\n\t\t\t\t\t<h5>{{c.Subject || c.subject || c.summary || c.title || c.CaseNumber || c.comment || c.body || c.name || c.topic || c.content || '...' }}</h5>\n\t\t\t\t\t<div style='font-size: 12px; line-height: 16px;'>\n\t\t\t\t\t\tCreated: <span class='Vlt-black'>{{c._vgis.createdDate | date:'mediumDate'}}</span>\n\t\t\t\t\t\tEdited: <span class='Vlt-black'>{{c._vgis.modifiedDate | date:'medium'}}</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"Vlt-badge Vlt-badge--app Vlt-badge--purple Vlt-badge--small\">{{c._vgis.resourceType}}</div>\n\t\t\t\t\t<div class=\"Vlt-btn-group Vlt-btn-group--hover\">\n\t\t\t\t\t\t<a *ngIf='c._vgis.externalLink' attr.href='{{c._vgis.externalLink}}' target='_blank' rel='noopener' rel='noopener' class=\"Vlt-btn Vlt-btn--tertiary Vlt-btn--icon\" aria-label='Open external'><svg style='margin-left: 0; margin-right: 0;'><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-open\"/></svg></a>\n\t\t\t\t\t\t<button type='button' (click)='openChild(child, c)' class=\"Vlt-btn Vlt-btn--tertiary Vlt-btn--icon\"><svg style='margin-left: 0; margin-right: 0;'><use attr.xlink:href=\"volta/volta-icons.svg#Vlt-icon-{{ child.reference.editable ? 'edit' : 'eye-negative' }}\"/></svg></button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<button style='width: 100%; margin-top: 0; max-width: 100%;' type='button' (click)='openChild(child)' class=\"Vlt-btn Vlt-btn--small Vlt-btn--secondary\" [disabled]='child.creatable === false'>\n\t\t\t<svg><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-plus\"/></svg>{{child.reference.label}}\n\t\t</button>\n\t</div>\n</div>\n<div *ngIf='!(meta.oneTimeOptional && showAll)' [ngClass]='{ centered: !meta.oneTimeOptional }'>\n\t<button *ngIf='!preview && optionalFieldsCount' type='button' (click)='toggleOptionalFields()' class=\"Vlt-btn Vlt-btn--small Vlt-btn--link more-button\" style='margin: 0; margin-bottom: 10px;'>\n\t\t<svg><use attr.xlink:href=\"volta/volta-icons.svg#Vlt-icon-chevron-{{ showAll ? 'up' : 'down' }}\"/></svg>\n\t\t{{ showAll ? 'Hide' : 'Show' }} Optional Fields ({{optionalFieldsCount}})\n\t</button>\n</div>\n", styles: ["vgip-meta-field{display:none}vgip-meta-field.shown{display:initial}.Vlt-section__title{line-height:14px;padding:16px 16px 14px 3px;margin:-9px -1px 8px;background-color:var(--vgip-meta-resource-bg-color);color:var(--vgip-meta-resource-color);position:sticky;top:-9px;z-index:3;border-bottom:1px solid var(--vgip-meta-separator-color)}.Vlt-section{margin:0;padding-bottom:8px;display:none}.Vlt-section.shown{display:block}.Vlt-btn.vlt-add-child:hover{transform:scale(1.02)}.for-preview{margin-top:-6px}.Vlt-card{margin-bottom:16px;padding:16px}.Vlt-card .Vlt-btn-group.Vlt-btn-group--hover{right:-8px}button.more-button:focus{font-weight:bold}.centered{text-align:center}.Vlt-btn--link{color:var(--vgip-meta-link-color)}.Vlt-btn--link:hover{color:var(--vgip-meta-link-hover-color)}.Vlt-btn--link svg{fill:var(--vgip-meta-link-color)}\n"] }]
|
|
4219
|
+
args: [{ selector: 'vgip-meta-layout', template: "<div *ngFor='let section of meta.sections' class='Vlt-section' [ngClass]=\"{ shown: showAll || section.visible || (!meta.oneTimeOptional && !section.$optional) || (meta.oneTimeOptional && !optionalFieldsCount) }\">\n\t<h5 *ngIf='section.label' class=\"Vlt-section__title\">{{section.label}}</h5>\n\t<div style='overflow: visible;' [ngClass]=\"{ 'for-preview': preview }\">\n\t\t<small *ngIf='section.description' class=\"Vlt-form__element__hint\">{{section.description}}</small>\n\t\t<div>\n\t\t\t<ng-container *ngFor='let field of section.fields'>\n\t\t\t\t<vgip-meta-field *ngIf='!field.$hidden && (showAll || section.visible || !field.$optional)' [meta]='field' [parent]='resource' [integrationCode]='integrationCode' [resourceType]='resourceType' [preview]='preview' [ngClass]=\"{ shown: !field.$invisible && (showAll || true) }\" theme='inherit' [attr.data-theme]='theme'></vgip-meta-field>\n\t\t\t</ng-container>\n\t\t</div>\n\t</div>\n</div>\n<div *ngIf='isPersistedResource && meta.children && preview'>\n\t<div *ngFor='let child of meta.children'>\n\t\t<h5 class='Vlt-children__title'>\n\t\t\t<svg class=\"Vlt-icon\"><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-stack\" /></svg> \n\t\t\t{{child.label}} <span class='Vlt-grey'>({{(resource[child.name] || []).length}})</span>\n\t\t</h5>\n\t\t<div *ngFor=\"let c of resource[child.name]\" style='position: relative;'>\n\n\t\t\t<div class=\"Vlt-card Vlt-bg-white\">\n\t\t\t\t<div class=\"Vlt-card__content Vlt-btn-on-hover\">\n\t\t\t\t\t<h5>{{c.Subject || c.subject || c.summary || c.title || c.CaseNumber || c.comment || c.body || c.name || c.topic || c.content || '...' }}</h5>\n\t\t\t\t\t<div style='font-size: 12px; line-height: 16px;'>\n\t\t\t\t\t\tCreated: <span class='Vlt-black'>{{c._vgis.createdDate | date:'mediumDate'}}</span>\n\t\t\t\t\t\tEdited: <span class='Vlt-black'>{{c._vgis.modifiedDate | date:'medium'}}</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"Vlt-badge Vlt-badge--app Vlt-badge--purple Vlt-badge--small\">{{c._vgis.resourceType}}</div>\n\t\t\t\t\t<div class=\"Vlt-btn-group Vlt-btn-group--hover\">\n\t\t\t\t\t\t<a *ngIf='c._vgis.externalLink' attr.href='{{c._vgis.externalLink}}' target='_blank' rel='noopener' rel='noopener' class=\"Vlt-btn Vlt-btn--tertiary Vlt-btn--icon\" aria-label='Open external'><svg style='margin-left: 0; margin-right: 0;'><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-open\"/></svg></a>\n\t\t\t\t\t\t<button type='button' (click)='openChild(child, c)' class=\"Vlt-btn Vlt-btn--tertiary Vlt-btn--icon\"><svg style='margin-left: 0; margin-right: 0;'><use attr.xlink:href=\"volta/volta-icons.svg#Vlt-icon-{{ child.reference.editable ? 'edit' : 'eye-negative' }}\"/></svg></button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<button style='width: 100%; margin-top: 0; max-width: 100%;' type='button' (click)='openChild(child)' class=\"Vlt-btn Vlt-btn--small Vlt-btn--secondary\" [disabled]='child.creatable === false'>\n\t\t\t<svg><use xlink:href=\"volta/volta-icons.svg#Vlt-icon-plus\"/></svg>{{child.reference.label}}\n\t\t</button>\n\t</div>\n</div>\n<div *ngIf='!(meta.oneTimeOptional && showAll)' [ngClass]='{ centered: !meta.oneTimeOptional }'>\n\t<button *ngIf='!preview && optionalFieldsCount' type='button' (click)='toggleOptionalFields()' class=\"Vlt-btn Vlt-btn--small Vlt-btn--link more-button\" style='margin: 0; margin-bottom: 10px;'>\n\t\t<svg><use attr.xlink:href=\"volta/volta-icons.svg#Vlt-icon-chevron-{{ showAll ? 'up' : 'down' }}\"/></svg>\n\t\t{{ showAll ? 'Hide' : 'Show' }} Optional Fields ({{optionalFieldsCount}})\n\t</button>\n</div>\n", styles: ["vgip-meta-field{display:none}vgip-meta-field.shown{display:initial}.Vlt-section__title{line-height:14px;padding:16px 16px 14px 3px;margin:-9px -1px 8px;background-color:var(--vgip-meta-resource-bg-color);color:var(--vgip-meta-resource-color);position:sticky;top:-9px;z-index:3;border-bottom:1px solid var(--vgip-meta-separator-color)}.Vlt-section{margin:0;padding-bottom:8px;display:none}.Vlt-section.shown{display:block}.Vlt-btn.vlt-add-child:hover{transform:scale(1.02)}.for-preview{margin-top:-6px}.Vlt-card{margin-bottom:16px;padding:16px}.Vlt-card .Vlt-btn-group.Vlt-btn-group--hover{right:-8px}button.more-button:focus{font-weight:bold}.centered{text-align:center}.Vlt-btn--link{color:var(--vgip-meta-link-color)}.Vlt-btn--link:hover{color:var(--vgip-meta-link-hover-color)}.Vlt-btn--link svg{fill:var(--vgip-meta-link-color)}\n"] }]
|
|
4162
4220
|
}], ctorParameters: function () { return [{ type: i0.ComponentFactoryResolver }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: MetaResourceService }, { type: MetaReferenceService }]; }, propDecorators: { meta: [{
|
|
4163
4221
|
type: Input
|
|
4164
4222
|
}], resource: [{
|
|
@@ -4380,7 +4438,7 @@ class MetaResource {
|
|
|
4380
4438
|
this.formErrors = parsedError.message || 'There is a problem with one or more fields';
|
|
4381
4439
|
if (parsedError.errors && parsedError.errors.length) {
|
|
4382
4440
|
this.formErrors += ` (${parsedError.errors.map(e => e.message).join(', ')})`;
|
|
4383
|
-
for (
|
|
4441
|
+
for (const pe of parsedError.errors) {
|
|
4384
4442
|
if (resourceForm.controls[pe.field]) {
|
|
4385
4443
|
resourceForm.controls[pe.field].setErrors({ invalid: true, custom: pe.message });
|
|
4386
4444
|
}
|
|
@@ -4813,9 +4871,9 @@ class MetaIconsPipe {
|
|
|
4813
4871
|
this.sanitizer = sanitizer;
|
|
4814
4872
|
}
|
|
4815
4873
|
transform(value, ...args) {
|
|
4816
|
-
if (value) {
|
|
4874
|
+
if (typeof (value) === 'string') {
|
|
4817
4875
|
value = value.replace(/\${\s*icon:([\w\-]+)\s*}/g, (match, val) => `<svg class='Vlt-icon'><use xlink:href="volta/volta-icons.svg#${val}"/></svg>`);
|
|
4818
|
-
return this.sanitizer.bypassSecurityTrustHtml(value);
|
|
4876
|
+
return value; //this.sanitizer.bypassSecurityTrustHtml(value);
|
|
4819
4877
|
}
|
|
4820
4878
|
}
|
|
4821
4879
|
}
|