@pepperi-addons/ngx-composite-lib 0.4.1-beta.12 → 0.4.1-beta.13
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/color-settings/color-settings.component.d.ts +25 -25
- package/color-settings/color-settings.model.d.ts +6 -6
- package/color-settings/color-settings.module.d.ts +12 -12
- package/color-settings/index.d.ts +5 -5
- package/color-settings/public-api.d.ts +3 -3
- package/core/common/directives/index.d.ts +1 -1
- package/core/common/directives/public-api.d.ts +1 -1
- package/core/common/directives/reset-configuration-field.directive.d.ts +39 -39
- package/core/common/index.d.ts +1 -1
- package/core/common/public-api.d.ts +2 -2
- package/core/common/services/dimx.service.d.ts +46 -46
- package/core/common/services/index.d.ts +1 -1
- package/core/common/services/public-api.d.ts +2 -2
- package/core/common/services/utilities.service.d.ts +6 -6
- package/core/index.d.ts +1 -1
- package/core/public-api.d.ts +1 -1
- package/data-view-builder/data-view-builder.component.d.ts +35 -35
- package/data-view-builder/data-view-builder.model.d.ts +1 -1
- package/data-view-builder/data-view-builder.module.d.ts +23 -23
- package/data-view-builder/data-view-builder.service.d.ts +14 -14
- package/data-view-builder/index.d.ts +5 -5
- package/data-view-builder/menu-data-view/menu-data-view.component.d.ts +36 -36
- package/data-view-builder/public-api.d.ts +3 -3
- package/esm2020/color-settings/color-settings.component.mjs +86 -86
- package/esm2020/color-settings/color-settings.model.mjs +8 -8
- package/esm2020/color-settings/color-settings.module.mjs +37 -37
- package/esm2020/color-settings/pepperi-addons-ngx-composite-lib-color-settings.mjs +4 -4
- package/esm2020/color-settings/public-api.mjs +6 -6
- package/esm2020/core/common/directives/index.mjs +4 -4
- package/esm2020/core/common/directives/public-api.mjs +4 -4
- package/esm2020/core/common/directives/reset-configuration-field.directive.mjs +135 -135
- package/esm2020/core/common/index.mjs +4 -4
- package/esm2020/core/common/public-api.mjs +5 -5
- package/esm2020/core/common/services/dimx.service.mjs +63 -63
- package/esm2020/core/common/services/index.mjs +4 -4
- package/esm2020/core/common/services/public-api.mjs +5 -5
- package/esm2020/core/common/services/utilities.service.mjs +18 -18
- package/esm2020/core/index.mjs +4 -4
- package/esm2020/core/public-api.mjs +4 -4
- package/esm2020/data-view-builder/data-view-builder.component.mjs +116 -116
- package/esm2020/data-view-builder/data-view-builder.model.mjs +1 -1
- package/esm2020/data-view-builder/data-view-builder.module.mjs +79 -79
- package/esm2020/data-view-builder/data-view-builder.service.mjs +38 -38
- package/esm2020/data-view-builder/menu-data-view/menu-data-view.component.mjs +116 -116
- package/esm2020/data-view-builder/pepperi-addons-ngx-composite-lib-data-view-builder.mjs +4 -4
- package/esm2020/data-view-builder/public-api.mjs +6 -6
- package/esm2020/file-status-panel/file-status-panel.component.mjs +34 -34
- package/esm2020/file-status-panel/file-status-panel.model.mjs +8 -8
- package/esm2020/file-status-panel/file-status-panel.module.mjs +53 -53
- package/esm2020/file-status-panel/pepperi-addons-ngx-composite-lib-file-status-panel.mjs +4 -4
- package/esm2020/file-status-panel/public-api.mjs +6 -6
- package/esm2020/generic-form/generic-form.component.mjs +189 -189
- package/esm2020/generic-form/generic-form.model.mjs +1 -1
- package/esm2020/generic-form/generic-form.module.mjs +67 -67
- package/esm2020/generic-form/generic-form.service.mjs +58 -59
- package/esm2020/generic-form/pepperi-addons-ngx-composite-lib-generic-form.mjs +4 -4
- package/esm2020/generic-form/public-api.mjs +7 -7
- package/esm2020/generic-list/generic-list.component.mjs +458 -458
- package/esm2020/generic-list/generic-list.model.mjs +1 -1
- package/esm2020/generic-list/generic-list.module.mjs +106 -106
- package/esm2020/generic-list/generic-list.service.mjs +136 -136
- package/esm2020/generic-list/pepperi-addons-ngx-composite-lib-generic-list.mjs +4 -4
- package/esm2020/generic-list/public-api.mjs +7 -7
- package/esm2020/group-buttons-settings/group-buttons-settings.component.mjs +129 -129
- package/esm2020/group-buttons-settings/group-buttons-settings.model.mjs +1 -1
- package/esm2020/group-buttons-settings/group-buttons-settings.module.mjs +47 -47
- package/esm2020/group-buttons-settings/pepperi-addons-ngx-composite-lib-group-buttons-settings.mjs +4 -4
- package/esm2020/group-buttons-settings/public-api.mjs +6 -6
- package/esm2020/ngx-composite-lib.module.mjs +53 -53
- package/esm2020/pepperi-addons-ngx-composite-lib.mjs +4 -4
- package/esm2020/public-api.mjs +5 -5
- package/esm2020/shadow-settings/pepperi-addons-ngx-composite-lib-shadow-settings.mjs +4 -4
- package/esm2020/shadow-settings/public-api.mjs +6 -6
- package/esm2020/shadow-settings/shadow-settings.component.mjs +68 -68
- package/esm2020/shadow-settings/shadow-settings.model.mjs +7 -7
- package/esm2020/shadow-settings/shadow-settings.module.mjs +41 -41
- package/fesm2015/pepperi-addons-ngx-composite-lib-color-settings.mjs +116 -116
- package/fesm2015/pepperi-addons-ngx-composite-lib-data-view-builder.mjs +309 -309
- package/fesm2015/pepperi-addons-ngx-composite-lib-data-view-builder.mjs.map +1 -1
- package/fesm2015/pepperi-addons-ngx-composite-lib-file-status-panel.mjs +80 -80
- package/fesm2015/pepperi-addons-ngx-composite-lib-generic-form.mjs +285 -286
- package/fesm2015/pepperi-addons-ngx-composite-lib-generic-form.mjs.map +1 -1
- package/fesm2015/pepperi-addons-ngx-composite-lib-generic-list.mjs +674 -674
- package/fesm2015/pepperi-addons-ngx-composite-lib-group-buttons-settings.mjs +164 -164
- package/fesm2015/pepperi-addons-ngx-composite-lib-shadow-settings.mjs +101 -101
- package/fesm2015/pepperi-addons-ngx-composite-lib.mjs +271 -271
- package/fesm2020/pepperi-addons-ngx-composite-lib-color-settings.mjs +116 -116
- package/fesm2020/pepperi-addons-ngx-composite-lib-data-view-builder.mjs +307 -307
- package/fesm2020/pepperi-addons-ngx-composite-lib-data-view-builder.mjs.map +1 -1
- package/fesm2020/pepperi-addons-ngx-composite-lib-file-status-panel.mjs +78 -78
- package/fesm2020/pepperi-addons-ngx-composite-lib-generic-form.mjs +287 -288
- package/fesm2020/pepperi-addons-ngx-composite-lib-generic-form.mjs.map +1 -1
- package/fesm2020/pepperi-addons-ngx-composite-lib-generic-list.mjs +656 -656
- package/fesm2020/pepperi-addons-ngx-composite-lib-group-buttons-settings.mjs +163 -163
- package/fesm2020/pepperi-addons-ngx-composite-lib-shadow-settings.mjs +101 -101
- package/fesm2020/pepperi-addons-ngx-composite-lib.mjs +264 -264
- package/file-status-panel/file-status-panel.component.d.ts +14 -14
- package/file-status-panel/file-status-panel.model.d.ts +7 -7
- package/file-status-panel/file-status-panel.module.d.ts +17 -17
- package/file-status-panel/index.d.ts +5 -5
- package/file-status-panel/public-api.d.ts +3 -3
- package/generic-form/generic-form.component.d.ts +43 -43
- package/generic-form/generic-form.model.d.ts +42 -42
- package/generic-form/generic-form.module.d.ts +13 -13
- package/generic-form/generic-form.service.d.ts +15 -15
- package/generic-form/index.d.ts +5 -5
- package/generic-form/public-api.d.ts +4 -4
- package/generic-list/generic-list.component.d.ts +109 -109
- package/generic-list/generic-list.model.d.ts +66 -66
- package/generic-list/generic-list.module.d.ts +25 -25
- package/generic-list/generic-list.service.d.ts +44 -44
- package/generic-list/index.d.ts +5 -5
- package/generic-list/public-api.d.ts +4 -4
- package/group-buttons-settings/group-buttons-settings.component.d.ts +33 -33
- package/group-buttons-settings/group-buttons-settings.model.d.ts +1 -1
- package/group-buttons-settings/group-buttons-settings.module.d.ts +15 -15
- package/group-buttons-settings/index.d.ts +5 -5
- package/group-buttons-settings/public-api.d.ts +3 -3
- package/index.d.ts +5 -5
- package/ngx-composite-lib.module.d.ts +13 -13
- package/package.json +1 -1
- package/public-api.d.ts +2 -2
- package/shadow-settings/index.d.ts +5 -5
- package/shadow-settings/public-api.d.ts +3 -3
- package/shadow-settings/shadow-settings.component.d.ts +23 -23
- package/shadow-settings/shadow-settings.model.d.ts +8 -8
- package/shadow-settings/shadow-settings.module.d.ts +13 -13
|
@@ -25,325 +25,325 @@ import { BehaviorSubject } from 'rxjs';
|
|
|
25
25
|
import { distinctUntilChanged } from 'rxjs/operators';
|
|
26
26
|
import * as i9 from '@ngx-translate/core';
|
|
27
27
|
|
|
28
|
-
class DataViewBuilderService {
|
|
29
|
-
constructor() {
|
|
30
|
-
// This subject is for is grabbing mode.
|
|
31
|
-
this._isGrabbingSubject = new BehaviorSubject(false);
|
|
32
|
-
//
|
|
33
|
-
}
|
|
34
|
-
get isGrabbingChange$() {
|
|
35
|
-
return this._isGrabbingSubject.asObservable().pipe(distinctUntilChanged());
|
|
36
|
-
}
|
|
37
|
-
changeCursorOnDragStart() {
|
|
38
|
-
document.body.classList.add('inheritCursors');
|
|
39
|
-
document.body.style.cursor = 'grabbing';
|
|
40
|
-
this._isGrabbingSubject.next(true);
|
|
41
|
-
}
|
|
42
|
-
changeCursorOnDragEnd() {
|
|
43
|
-
document.body.classList.remove('inheritCursors');
|
|
44
|
-
document.body.style.cursor = 'unset';
|
|
45
|
-
this._isGrabbingSubject.next(false);
|
|
46
|
-
}
|
|
47
|
-
onDragStart(event) {
|
|
48
|
-
this.changeCursorOnDragStart();
|
|
49
|
-
}
|
|
50
|
-
onDragEnd(event) {
|
|
51
|
-
this.changeCursorOnDragEnd();
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
DataViewBuilderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: DataViewBuilderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
55
|
-
DataViewBuilderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: DataViewBuilderService, providedIn: 'root' });
|
|
56
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: DataViewBuilderService, decorators: [{
|
|
57
|
-
type: Injectable,
|
|
58
|
-
args: [{
|
|
59
|
-
providedIn: 'root'
|
|
60
|
-
}]
|
|
28
|
+
class DataViewBuilderService {
|
|
29
|
+
constructor() {
|
|
30
|
+
// This subject is for is grabbing mode.
|
|
31
|
+
this._isGrabbingSubject = new BehaviorSubject(false);
|
|
32
|
+
//
|
|
33
|
+
}
|
|
34
|
+
get isGrabbingChange$() {
|
|
35
|
+
return this._isGrabbingSubject.asObservable().pipe(distinctUntilChanged());
|
|
36
|
+
}
|
|
37
|
+
changeCursorOnDragStart() {
|
|
38
|
+
document.body.classList.add('inheritCursors');
|
|
39
|
+
document.body.style.cursor = 'grabbing';
|
|
40
|
+
this._isGrabbingSubject.next(true);
|
|
41
|
+
}
|
|
42
|
+
changeCursorOnDragEnd() {
|
|
43
|
+
document.body.classList.remove('inheritCursors');
|
|
44
|
+
document.body.style.cursor = 'unset';
|
|
45
|
+
this._isGrabbingSubject.next(false);
|
|
46
|
+
}
|
|
47
|
+
onDragStart(event) {
|
|
48
|
+
this.changeCursorOnDragStart();
|
|
49
|
+
}
|
|
50
|
+
onDragEnd(event) {
|
|
51
|
+
this.changeCursorOnDragEnd();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
DataViewBuilderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: DataViewBuilderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
55
|
+
DataViewBuilderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: DataViewBuilderService, providedIn: 'root' });
|
|
56
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: DataViewBuilderService, decorators: [{
|
|
57
|
+
type: Injectable,
|
|
58
|
+
args: [{
|
|
59
|
+
providedIn: 'root'
|
|
60
|
+
}]
|
|
61
61
|
}], ctorParameters: function () { return []; } });
|
|
62
62
|
|
|
63
|
-
class MenuDataViewComponent {
|
|
64
|
-
constructor(dialogService, dataViewBuilderService) {
|
|
65
|
-
this.dialogService = dialogService;
|
|
66
|
-
this.dataViewBuilderService = dataViewBuilderService;
|
|
67
|
-
this.fields = []; // The data view fields.
|
|
68
|
-
this.availableFieldsTitles = new Map(); // <FieldID, Original Title> from the available fields.
|
|
69
|
-
this.emptyDropAreaId = '';
|
|
70
|
-
this.mappedFieldsId = '';
|
|
71
|
-
this.fieldsChange = new EventEmitter();
|
|
72
|
-
this.isGrabbing = false;
|
|
73
|
-
this.dialogRef = null;
|
|
74
|
-
this.dataViewBuilderService.isGrabbingChange$.subscribe((value) => {
|
|
75
|
-
this.isGrabbing = value;
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
addNewField(draggableItem, index) {
|
|
79
|
-
// Add new menuField to the mappedFields.
|
|
80
|
-
const menuField = { FieldID: draggableItem.data.key, Title: draggableItem.title };
|
|
81
|
-
this.spliceMappedFields(index, 0, menuField);
|
|
82
|
-
}
|
|
83
|
-
spliceMappedFields(start, deleteCount, item) {
|
|
84
|
-
if (item) {
|
|
85
|
-
this.fields.splice(start, deleteCount, item);
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
this.fields.splice(start, deleteCount);
|
|
89
|
-
}
|
|
90
|
-
this.notifyFieldsChange();
|
|
91
|
-
}
|
|
92
|
-
changeTitle(menuField, title) {
|
|
93
|
-
menuField.Title = title;
|
|
94
|
-
this.notifyFieldsChange();
|
|
95
|
-
}
|
|
96
|
-
notifyFieldsChange() {
|
|
97
|
-
this.fieldsChange.emit(this.fields);
|
|
98
|
-
}
|
|
99
|
-
ngOnInit() {
|
|
100
|
-
//
|
|
101
|
-
}
|
|
102
|
-
addSeparator(index) {
|
|
103
|
-
const menuField = { FieldID: '', Title: '' };
|
|
104
|
-
this.spliceMappedFields(index, 0, menuField);
|
|
105
|
-
}
|
|
106
|
-
onDragStart(event) {
|
|
107
|
-
this.dataViewBuilderService.onDragStart(event);
|
|
108
|
-
}
|
|
109
|
-
onDragEnd(event) {
|
|
110
|
-
this.dataViewBuilderService.onDragEnd(event);
|
|
111
|
-
}
|
|
112
|
-
onDropField(event) {
|
|
113
|
-
if (event.previousContainer === event.container) {
|
|
114
|
-
moveItemInArray(event.container.data, event.previousIndex, event.currentIndex);
|
|
115
|
-
this.notifyFieldsChange();
|
|
116
|
-
}
|
|
117
|
-
else if (event.container.id === 'emptyDropArea') {
|
|
118
|
-
this.addNewField(event.previousContainer.data[event.previousIndex], this.fields.length);
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
this.addNewField(event.previousContainer.data[event.previousIndex], event.currentIndex);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
onTitleChanged(event, menuField) {
|
|
125
|
-
this.changeTitle(menuField, event);
|
|
126
|
-
}
|
|
127
|
-
onDeleteMappedField(event, menuField) {
|
|
128
|
-
const index = this.fields.findIndex(ms => ms === menuField);
|
|
129
|
-
if (index > -1) {
|
|
130
|
-
this.spliceMappedFields(index, 1);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
onEditSeparatorField(event, menuField) {
|
|
134
|
-
this.dialogRef = this.dialogService.openDialog(this.separatorTitleModalTemplate, { value: menuField.Title });
|
|
135
|
-
this.dialogRef.afterClosed().subscribe((titleValue) => {
|
|
136
|
-
if (titleValue !== undefined) {
|
|
137
|
-
this.changeTitle(menuField, titleValue);
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
setDialogValue(value) {
|
|
142
|
-
this.closeDialog(value);
|
|
143
|
-
}
|
|
144
|
-
closeDialog(value = undefined) {
|
|
145
|
-
var _a;
|
|
146
|
-
(_a = this.dialogRef) === null || _a === void 0 ? void 0 : _a.close(value);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
MenuDataViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: MenuDataViewComponent, deps: [{ token: i1.PepDialogService }, { token: DataViewBuilderService }], target: i0.ɵɵFactoryTarget.Component });
|
|
150
|
-
MenuDataViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: MenuDataViewComponent, selector: "menu-data-view", inputs: { fields: "fields", availableFieldsTitles: "availableFieldsTitles", emptyDropAreaId: "emptyDropAreaId", mappedFieldsId: "mappedFieldsId" }, outputs: { fieldsChange: "fieldsChange" }, viewQueries: [{ propertyName: "separatorTitleModalTemplate", first: true, predicate: ["separatorTitleModalTemplate"], descendants: true, read: TemplateRef }], ngImport: i0, template: "<ng-container *ngIf=\"fields === null || fields.length === 0; then emptyTemplate; else notEmptyTemplate\"></ng-container>\n<ng-template #emptyTemplate>\n <div [id]=\"emptyDropAreaId\" class=\"drop-field-here-area\" cdkDropList (cdkDropListDropped)=\"onDropField($event)\">\n <mat-icon class=\"pep-spacing-element\">\n <pep-icon name=\"arrow_down_alt\"></pep-icon>\n </mat-icon>\n <span class=\"body-sm ellipsis\">\n {{ 'DATA_VIEW_BUILDER.EMPTY_DROP_AREA_TEXT' | translate }}\n </span> \n </div>\n</ng-template>\n<ng-template #notEmptyTemplate>\n <div [id]=\"mappedFieldsId\" class=\"mapped-fields-area\" [ngClass]=\"{ 'no-row-gap': !isGrabbing }\"\n cdkDropList [cdkDropListData]=\"fields\" (cdkDropListDropped)=\"onDropField($event)\">\n <ng-container *ngFor=\"let menuField of fields; let i = index\" >\n <div class=\"mapped-field-container\" [ngClass]=\"{ 'separator-container': menuField.FieldID === '' }\" \n cdkDrag (cdkDragStarted)=\"onDragStart($event)\" (cdkDragEnded)=\"onDragEnd($event)\">\n <ng-container *ngTemplateOutlet=\"mappedFieldTemplate; context: { menuField: menuField }\"></ng-container>\n </div>\n <div *ngIf=\"!isGrabbing\" class=\"add-separator-container\">\n <pep-button class=\"add-separator\" styleType=\"regular\" sizeType=\"sm\" iconName=\"number_plus\" \n [value]=\"'DATA_VIEW_BUILDER.ADD_SEPARATOR' | translate\" (buttonClick)=\"addSeparator(i+1)\"></pep-button>\n </div>\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #mappedFieldTemplate let-menuField=\"menuField\">\n <ng-container *ngIf=\"menuField.FieldID !== ''; then menuItemTemplate; else separatorTemplate\"></ng-container>\n\n <ng-template #menuItemTemplate>\n <div class=\"fields-wrapper\">\n <pep-textbox [label]=\"'DATA_VIEW_BUILDER.MENU_ITEM_KEY_TITLE' | translate\" [value]=\"menuField.FieldID\" [disabled]=\"true\">\n </pep-textbox>\n \n <pep-textbox [label]=\"'DATA_VIEW_BUILDER.MENU_ITEM_VALUE_TITLE' | translate\" [hint]=\"'(' + (availableFieldsTitles.get(menuField.FieldID) || '') + ')'\"\n [value]=\"menuField.Title\" (valueChange)=\"onTitleChanged($event, menuField)\">\n </pep-textbox>\n \n <pep-button class=\"center-button\" iconName=\"system_bin\" [title]=\"'ACTIONS.DELETE' | translate\" (buttonClick)=\"onDeleteMappedField($event, menuField)\"></pep-button>\n </div>\n </ng-template>\n <ng-template #separatorTemplate>\n <div class=\"separator-wrapper \">\n <div class=\"pep-spacing-element title title-md color-dimmed\">\n <span [title]=\"menuField.Title\">{{ menuField.Title }}</span>\n </div>\n <div class=\"list-actions\">\n <pep-button iconName=\"system_edit\" [title]=\"'ACTIONS.EDIT' | translate\" sizeType=\"xs\" styleType=\"regular\" (buttonClick)=\"onEditSeparatorField($event, menuField)\"></pep-button>\n <pep-button iconName=\"system_bin\" [title]=\"'ACTIONS.DELETE' | translate\" sizeType=\"xs\" styleType=\"regular\" (buttonClick)=\"onDeleteMappedField($event, menuField)\"></pep-button>\n </div>\n </div>\n </ng-template>\n</ng-template>\n\n<ng-template #separatorTitleModalTemplate let-data>\n <pep-dialog [title]=\"'DATA_VIEW_BUILDER.SEPARATOR_TITLE' | translate\">\n <ng-container pep-dialog-content>\n <pep-textbox #txt [label]=\"'DATA_VIEW_BUILDER.ADD_A_TITLE' | translate\" [(value)]=\"data.value\">\n </pep-textbox>\n </ng-container>\n <ng-container pep-dialog-actions>\n <div class=\"pep-spacing-element-negative\">\n <button mat-button class=\"pep-spacing-element pep-button md weak\"\n (click)=\"closeDialog()\">\n {{'Cancel' | translate}}\n </button>\n <button mat-button class=\"pep-spacing-element pep-button md strong\"\n (click)=\"setDialogValue(txt.value)\">\n {{ 'Save' | translate}}\n </button>\n </div>\n </ng-container>\n </pep-dialog>\n</ng-template>", styles: ["html body.inheritCursors *{cursor:inherit!important}.cdk-drag-preview.mapped-field-container{max-width:600px;display:flex;justify-content:center;align-items:center;border-radius:var(--pep-border-radius-md, .25rem)}.cdk-drag-preview.mapped-field-container:not(.separator-container){padding-inline:var(--pep-spacing-lg, 1rem)}.cdk-drag-preview.mapped-field-container:not(.separator-container){gap:calc(var(--pep-spacing-lg, 1rem) * 2);background:hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),98%);box-shadow:var(--pep-shadow-xs-offset, 0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.08);border:1px solid hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),calc(var(--pep-color-regular-l, 10%) + 30%))}.cdk-drag-preview.mapped-field-container .fields-wrapper{display:grid;width:100%;grid-template-columns:1fr 1fr auto;gap:.5rem;padding-top:.5rem}.cdk-drag-preview.mapped-field-container .fields-wrapper .center-button{margin-top:var(--pep-form-field-title-height, 1.5rem)}.cdk-drag-preview.mapped-field-container .separator-wrapper{display:grid;width:100%;grid-template-columns:1fr auto;padding-bottom:var(--pep-spacing-xs, .25rem);border-bottom:1px solid hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),calc(var(--pep-color-regular-l, 10%) + 30%))}.cdk-drag-preview.mapped-field-container .separator-wrapper .list-actions{display:flex;gap:var(--pep-spacing-xs, .25rem)}.drop-field-here-area{min-height:5rem;max-width:600px;display:flex;justify-content:center;align-items:center;border-radius:var(--pep-border-radius-md, .25rem);background:hsla(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%),.12);position:relative}.drop-field-here-area:not(.separator-container){padding-inline:var(--pep-spacing-lg, 1rem)}.drop-field-here-area:after{z-index:0;content:\"\";transition:all .25s;display:block;position:absolute;inset:0;border-radius:inherit;border:1px dashed hsl(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),calc(var(--pep-color-system-primary-l, 10%) + 30%))}.drop-field-here-area.cdk-drop-list-dragging{box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsla(var(--pep-color-text-link-h, 207),var(--pep-color-text-link-s, 76%),var(--pep-color-text-link-l, 37%),.5)}.drop-field-here-area.cdk-drop-list-dragging:hover{background:hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),98%);box-shadow:var(--pep-shadow-xs-offset, 0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.16);border:1px solid hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),calc(var(--pep-color-regular-l, 10%) + 20%));box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsla(var(--pep-color-text-link-h, 207),var(--pep-color-text-link-s, 76%),var(--pep-color-text-link-l, 37%),.5)}.drop-field-here-area.cdk-drop-list-dragging ::ng-deep .placeholder-item{display:none}.mapped-fields-area{display:flex;flex-direction:column;column-gap:var(--pep-spacing-lg, 1rem)}.mapped-fields-area:not(.no-row-gap){row-gap:var(--pep-spacing-lg, 1rem)}.mapped-fields-area.cdk-drop-list-dragging ::ng-deep .placeholder-item{max-width:600px;display:flex;justify-content:center;align-items:center;border-radius:var(--pep-border-radius-md, .25rem);background:hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),98%);box-shadow:var(--pep-shadow-xs-offset, 0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.08);border:1px solid hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),calc(var(--pep-color-regular-l, 10%) + 30%));box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsla(var(--pep-color-text-link-h, 207),var(--pep-color-text-link-s, 76%),var(--pep-color-text-link-l, 37%),.5);height:2.5rem}.mapped-fields-area.cdk-drop-list-dragging ::ng-deep .placeholder-item:not(.separator-container){padding-inline:var(--pep-spacing-lg, 1rem)}.mapped-fields-area .mapped-field-container{cursor:grab;max-width:600px;display:flex;justify-content:center;align-items:center;border-radius:var(--pep-border-radius-md, .25rem)}.mapped-fields-area .mapped-field-container:not(.separator-container){padding-inline:var(--pep-spacing-lg, 1rem)}.mapped-fields-area .mapped-field-container:not(.separator-container){gap:calc(var(--pep-spacing-lg, 1rem) * 2);background:hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),98%);box-shadow:var(--pep-shadow-xs-offset, 0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.08);border:1px solid hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),calc(var(--pep-color-regular-l, 10%) + 30%))}.mapped-fields-area .mapped-field-container .fields-wrapper{display:grid;width:100%;grid-template-columns:1fr 1fr auto;gap:.5rem;padding-top:.5rem}.mapped-fields-area .mapped-field-container .fields-wrapper .center-button{margin-top:var(--pep-form-field-title-height, 1.5rem)}.mapped-fields-area .mapped-field-container .separator-wrapper{display:grid;width:100%;grid-template-columns:1fr auto;padding-bottom:var(--pep-spacing-xs, .25rem);border-bottom:1px solid hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),calc(var(--pep-color-regular-l, 10%) + 30%))}.mapped-fields-area .mapped-field-container .separator-wrapper .list-actions{display:flex;gap:var(--pep-spacing-xs, .25rem)}.mapped-fields-area .mapped-field-container.cdk-drag-placeholder{box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsla(var(--pep-color-text-link-h, 207),var(--pep-color-text-link-s, 76%),var(--pep-color-text-link-l, 37%),.5)}.mapped-fields-area .mapped-field-container.cdk-drag-placeholder .fields-wrapper,.mapped-fields-area .mapped-field-container.cdk-drag-placeholder .separator-wrapper{opacity:0}.mapped-fields-area .add-separator-container{max-width:600px;display:flex;justify-content:center;align-items:center;border-radius:var(--pep-border-radius-md, .25rem);height:var(--pep-spacing-lg, 1rem)}.mapped-fields-area .add-separator-container:not(.separator-container){padding-inline:var(--pep-spacing-lg, 1rem)}.mapped-fields-area .add-separator-container .add-separator{position:relative;display:none}.mapped-fields-area .add-separator-container:hover .add-separator{display:block}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i4.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i4.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i6.PepButtonComponent, selector: "pep-button", inputs: ["key", "value", "styleType", "styleStateType", "sizeType", "classNames", "disabled", "iconName", "iconPosition", "visible"], outputs: ["buttonClick"] }, { kind: "component", type: i1.PepDialogComponent, selector: "pep-dialog", inputs: ["title", "showClose", "showHeader", "showFooter"], outputs: ["close"] }, { kind: "component", type: i1$1.PepIconComponent, selector: "pep-icon", inputs: ["spin", "name", "fill"] }, { kind: "component", type: i8.PepTextboxComponent, selector: "pep-textbox", inputs: ["key", "value", "formattedValue", "minFractionDigits", "maxFractionDigits", "accessory", "label", "placeholder", "type", "mandatory", "disabled", "readonly", "maxFieldCharacters", "hint", "textColor", "xAlignment", "rowSpan", "minValue", "maxValue", "visible", "form", "isActive", "showTitle", "renderTitle", "renderError", "renderSymbol", "layoutType", "parentFieldKey", "regex", "regexError"], outputs: ["valueChange", "formValidationChange"] }, { kind: "pipe", type: i9.TranslatePipe, name: "translate" }] });
|
|
151
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: MenuDataViewComponent, decorators: [{
|
|
152
|
-
type: Component,
|
|
153
|
-
args: [{ selector: 'menu-data-view', template: "<ng-container *ngIf=\"fields === null || fields.length === 0; then emptyTemplate; else notEmptyTemplate\"></ng-container>\n<ng-template #emptyTemplate>\n <div [id]=\"emptyDropAreaId\" class=\"drop-field-here-area\" cdkDropList (cdkDropListDropped)=\"onDropField($event)\">\n <mat-icon class=\"pep-spacing-element\">\n <pep-icon name=\"arrow_down_alt\"></pep-icon>\n </mat-icon>\n <span class=\"body-sm ellipsis\">\n {{ 'DATA_VIEW_BUILDER.EMPTY_DROP_AREA_TEXT' | translate }}\n </span> \n </div>\n</ng-template>\n<ng-template #notEmptyTemplate>\n <div [id]=\"mappedFieldsId\" class=\"mapped-fields-area\" [ngClass]=\"{ 'no-row-gap': !isGrabbing }\"\n cdkDropList [cdkDropListData]=\"fields\" (cdkDropListDropped)=\"onDropField($event)\">\n <ng-container *ngFor=\"let menuField of fields; let i = index\" >\n <div class=\"mapped-field-container\" [ngClass]=\"{ 'separator-container': menuField.FieldID === '' }\" \n cdkDrag (cdkDragStarted)=\"onDragStart($event)\" (cdkDragEnded)=\"onDragEnd($event)\">\n <ng-container *ngTemplateOutlet=\"mappedFieldTemplate; context: { menuField: menuField }\"></ng-container>\n </div>\n <div *ngIf=\"!isGrabbing\" class=\"add-separator-container\">\n <pep-button class=\"add-separator\" styleType=\"regular\" sizeType=\"sm\" iconName=\"number_plus\" \n [value]=\"'DATA_VIEW_BUILDER.ADD_SEPARATOR' | translate\" (buttonClick)=\"addSeparator(i+1)\"></pep-button>\n </div>\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #mappedFieldTemplate let-menuField=\"menuField\">\n <ng-container *ngIf=\"menuField.FieldID !== ''; then menuItemTemplate; else separatorTemplate\"></ng-container>\n\n <ng-template #menuItemTemplate>\n <div class=\"fields-wrapper\">\n <pep-textbox [label]=\"'DATA_VIEW_BUILDER.MENU_ITEM_KEY_TITLE' | translate\" [value]=\"menuField.FieldID\" [disabled]=\"true\">\n </pep-textbox>\n \n <pep-textbox [label]=\"'DATA_VIEW_BUILDER.MENU_ITEM_VALUE_TITLE' | translate\" [hint]=\"'(' + (availableFieldsTitles.get(menuField.FieldID) || '') + ')'\"\n [value]=\"menuField.Title\" (valueChange)=\"onTitleChanged($event, menuField)\">\n </pep-textbox>\n \n <pep-button class=\"center-button\" iconName=\"system_bin\" [title]=\"'ACTIONS.DELETE' | translate\" (buttonClick)=\"onDeleteMappedField($event, menuField)\"></pep-button>\n </div>\n </ng-template>\n <ng-template #separatorTemplate>\n <div class=\"separator-wrapper \">\n <div class=\"pep-spacing-element title title-md color-dimmed\">\n <span [title]=\"menuField.Title\">{{ menuField.Title }}</span>\n </div>\n <div class=\"list-actions\">\n <pep-button iconName=\"system_edit\" [title]=\"'ACTIONS.EDIT' | translate\" sizeType=\"xs\" styleType=\"regular\" (buttonClick)=\"onEditSeparatorField($event, menuField)\"></pep-button>\n <pep-button iconName=\"system_bin\" [title]=\"'ACTIONS.DELETE' | translate\" sizeType=\"xs\" styleType=\"regular\" (buttonClick)=\"onDeleteMappedField($event, menuField)\"></pep-button>\n </div>\n </div>\n </ng-template>\n</ng-template>\n\n<ng-template #separatorTitleModalTemplate let-data>\n <pep-dialog [title]=\"'DATA_VIEW_BUILDER.SEPARATOR_TITLE' | translate\">\n <ng-container pep-dialog-content>\n <pep-textbox #txt [label]=\"'DATA_VIEW_BUILDER.ADD_A_TITLE' | translate\" [(value)]=\"data.value\">\n </pep-textbox>\n </ng-container>\n <ng-container pep-dialog-actions>\n <div class=\"pep-spacing-element-negative\">\n <button mat-button class=\"pep-spacing-element pep-button md weak\"\n (click)=\"closeDialog()\">\n {{'Cancel' | translate}}\n </button>\n <button mat-button class=\"pep-spacing-element pep-button md strong\"\n (click)=\"setDialogValue(txt.value)\">\n {{ 'Save' | translate}}\n </button>\n </div>\n </ng-container>\n </pep-dialog>\n</ng-template>", styles: ["html body.inheritCursors *{cursor:inherit!important}.cdk-drag-preview.mapped-field-container{max-width:600px;display:flex;justify-content:center;align-items:center;border-radius:var(--pep-border-radius-md, .25rem)}.cdk-drag-preview.mapped-field-container:not(.separator-container){padding-inline:var(--pep-spacing-lg, 1rem)}.cdk-drag-preview.mapped-field-container:not(.separator-container){gap:calc(var(--pep-spacing-lg, 1rem) * 2);background:hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),98%);box-shadow:var(--pep-shadow-xs-offset, 0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.08);border:1px solid hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),calc(var(--pep-color-regular-l, 10%) + 30%))}.cdk-drag-preview.mapped-field-container .fields-wrapper{display:grid;width:100%;grid-template-columns:1fr 1fr auto;gap:.5rem;padding-top:.5rem}.cdk-drag-preview.mapped-field-container .fields-wrapper .center-button{margin-top:var(--pep-form-field-title-height, 1.5rem)}.cdk-drag-preview.mapped-field-container .separator-wrapper{display:grid;width:100%;grid-template-columns:1fr auto;padding-bottom:var(--pep-spacing-xs, .25rem);border-bottom:1px solid hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),calc(var(--pep-color-regular-l, 10%) + 30%))}.cdk-drag-preview.mapped-field-container .separator-wrapper .list-actions{display:flex;gap:var(--pep-spacing-xs, .25rem)}.drop-field-here-area{min-height:5rem;max-width:600px;display:flex;justify-content:center;align-items:center;border-radius:var(--pep-border-radius-md, .25rem);background:hsla(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%),.12);position:relative}.drop-field-here-area:not(.separator-container){padding-inline:var(--pep-spacing-lg, 1rem)}.drop-field-here-area:after{z-index:0;content:\"\";transition:all .25s;display:block;position:absolute;inset:0;border-radius:inherit;border:1px dashed hsl(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),calc(var(--pep-color-system-primary-l, 10%) + 30%))}.drop-field-here-area.cdk-drop-list-dragging{box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsla(var(--pep-color-text-link-h, 207),var(--pep-color-text-link-s, 76%),var(--pep-color-text-link-l, 37%),.5)}.drop-field-here-area.cdk-drop-list-dragging:hover{background:hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),98%);box-shadow:var(--pep-shadow-xs-offset, 0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.16);border:1px solid hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),calc(var(--pep-color-regular-l, 10%) + 20%));box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsla(var(--pep-color-text-link-h, 207),var(--pep-color-text-link-s, 76%),var(--pep-color-text-link-l, 37%),.5)}.drop-field-here-area.cdk-drop-list-dragging ::ng-deep .placeholder-item{display:none}.mapped-fields-area{display:flex;flex-direction:column;column-gap:var(--pep-spacing-lg, 1rem)}.mapped-fields-area:not(.no-row-gap){row-gap:var(--pep-spacing-lg, 1rem)}.mapped-fields-area.cdk-drop-list-dragging ::ng-deep .placeholder-item{max-width:600px;display:flex;justify-content:center;align-items:center;border-radius:var(--pep-border-radius-md, .25rem);background:hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),98%);box-shadow:var(--pep-shadow-xs-offset, 0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.08);border:1px solid hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),calc(var(--pep-color-regular-l, 10%) + 30%));box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsla(var(--pep-color-text-link-h, 207),var(--pep-color-text-link-s, 76%),var(--pep-color-text-link-l, 37%),.5);height:2.5rem}.mapped-fields-area.cdk-drop-list-dragging ::ng-deep .placeholder-item:not(.separator-container){padding-inline:var(--pep-spacing-lg, 1rem)}.mapped-fields-area .mapped-field-container{cursor:grab;max-width:600px;display:flex;justify-content:center;align-items:center;border-radius:var(--pep-border-radius-md, .25rem)}.mapped-fields-area .mapped-field-container:not(.separator-container){padding-inline:var(--pep-spacing-lg, 1rem)}.mapped-fields-area .mapped-field-container:not(.separator-container){gap:calc(var(--pep-spacing-lg, 1rem) * 2);background:hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),98%);box-shadow:var(--pep-shadow-xs-offset, 0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.08);border:1px solid hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),calc(var(--pep-color-regular-l, 10%) + 30%))}.mapped-fields-area .mapped-field-container .fields-wrapper{display:grid;width:100%;grid-template-columns:1fr 1fr auto;gap:.5rem;padding-top:.5rem}.mapped-fields-area .mapped-field-container .fields-wrapper .center-button{margin-top:var(--pep-form-field-title-height, 1.5rem)}.mapped-fields-area .mapped-field-container .separator-wrapper{display:grid;width:100%;grid-template-columns:1fr auto;padding-bottom:var(--pep-spacing-xs, .25rem);border-bottom:1px solid hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),calc(var(--pep-color-regular-l, 10%) + 30%))}.mapped-fields-area .mapped-field-container .separator-wrapper .list-actions{display:flex;gap:var(--pep-spacing-xs, .25rem)}.mapped-fields-area .mapped-field-container.cdk-drag-placeholder{box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsla(var(--pep-color-text-link-h, 207),var(--pep-color-text-link-s, 76%),var(--pep-color-text-link-l, 37%),.5)}.mapped-fields-area .mapped-field-container.cdk-drag-placeholder .fields-wrapper,.mapped-fields-area .mapped-field-container.cdk-drag-placeholder .separator-wrapper{opacity:0}.mapped-fields-area .add-separator-container{max-width:600px;display:flex;justify-content:center;align-items:center;border-radius:var(--pep-border-radius-md, .25rem);height:var(--pep-spacing-lg, 1rem)}.mapped-fields-area .add-separator-container:not(.separator-container){padding-inline:var(--pep-spacing-lg, 1rem)}.mapped-fields-area .add-separator-container .add-separator{position:relative;display:none}.mapped-fields-area .add-separator-container:hover .add-separator{display:block}\n"] }]
|
|
154
|
-
}], ctorParameters: function () { return [{ type: i1.PepDialogService }, { type: DataViewBuilderService }]; }, propDecorators: { separatorTitleModalTemplate: [{
|
|
155
|
-
type: ViewChild,
|
|
156
|
-
args: ['separatorTitleModalTemplate', { read: TemplateRef }]
|
|
157
|
-
}], fields: [{
|
|
158
|
-
type: Input
|
|
159
|
-
}], availableFieldsTitles: [{
|
|
160
|
-
type: Input
|
|
161
|
-
}], emptyDropAreaId: [{
|
|
162
|
-
type: Input
|
|
163
|
-
}], mappedFieldsId: [{
|
|
164
|
-
type: Input
|
|
165
|
-
}], fieldsChange: [{
|
|
166
|
-
type: Output
|
|
63
|
+
class MenuDataViewComponent {
|
|
64
|
+
constructor(dialogService, dataViewBuilderService) {
|
|
65
|
+
this.dialogService = dialogService;
|
|
66
|
+
this.dataViewBuilderService = dataViewBuilderService;
|
|
67
|
+
this.fields = []; // The data view fields.
|
|
68
|
+
this.availableFieldsTitles = new Map(); // <FieldID, Original Title> from the available fields.
|
|
69
|
+
this.emptyDropAreaId = '';
|
|
70
|
+
this.mappedFieldsId = '';
|
|
71
|
+
this.fieldsChange = new EventEmitter();
|
|
72
|
+
this.isGrabbing = false;
|
|
73
|
+
this.dialogRef = null;
|
|
74
|
+
this.dataViewBuilderService.isGrabbingChange$.subscribe((value) => {
|
|
75
|
+
this.isGrabbing = value;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
addNewField(draggableItem, index) {
|
|
79
|
+
// Add new menuField to the mappedFields.
|
|
80
|
+
const menuField = { FieldID: draggableItem.data.key, Title: draggableItem.title };
|
|
81
|
+
this.spliceMappedFields(index, 0, menuField);
|
|
82
|
+
}
|
|
83
|
+
spliceMappedFields(start, deleteCount, item) {
|
|
84
|
+
if (item) {
|
|
85
|
+
this.fields.splice(start, deleteCount, item);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
this.fields.splice(start, deleteCount);
|
|
89
|
+
}
|
|
90
|
+
this.notifyFieldsChange();
|
|
91
|
+
}
|
|
92
|
+
changeTitle(menuField, title) {
|
|
93
|
+
menuField.Title = title;
|
|
94
|
+
this.notifyFieldsChange();
|
|
95
|
+
}
|
|
96
|
+
notifyFieldsChange() {
|
|
97
|
+
this.fieldsChange.emit(this.fields);
|
|
98
|
+
}
|
|
99
|
+
ngOnInit() {
|
|
100
|
+
//
|
|
101
|
+
}
|
|
102
|
+
addSeparator(index) {
|
|
103
|
+
const menuField = { FieldID: '', Title: '' };
|
|
104
|
+
this.spliceMappedFields(index, 0, menuField);
|
|
105
|
+
}
|
|
106
|
+
onDragStart(event) {
|
|
107
|
+
this.dataViewBuilderService.onDragStart(event);
|
|
108
|
+
}
|
|
109
|
+
onDragEnd(event) {
|
|
110
|
+
this.dataViewBuilderService.onDragEnd(event);
|
|
111
|
+
}
|
|
112
|
+
onDropField(event) {
|
|
113
|
+
if (event.previousContainer === event.container) {
|
|
114
|
+
moveItemInArray(event.container.data, event.previousIndex, event.currentIndex);
|
|
115
|
+
this.notifyFieldsChange();
|
|
116
|
+
}
|
|
117
|
+
else if (event.container.id === 'emptyDropArea') {
|
|
118
|
+
this.addNewField(event.previousContainer.data[event.previousIndex], this.fields.length);
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
this.addNewField(event.previousContainer.data[event.previousIndex], event.currentIndex);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
onTitleChanged(event, menuField) {
|
|
125
|
+
this.changeTitle(menuField, event);
|
|
126
|
+
}
|
|
127
|
+
onDeleteMappedField(event, menuField) {
|
|
128
|
+
const index = this.fields.findIndex(ms => ms === menuField);
|
|
129
|
+
if (index > -1) {
|
|
130
|
+
this.spliceMappedFields(index, 1);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
onEditSeparatorField(event, menuField) {
|
|
134
|
+
this.dialogRef = this.dialogService.openDialog(this.separatorTitleModalTemplate, { value: menuField.Title });
|
|
135
|
+
this.dialogRef.afterClosed().subscribe((titleValue) => {
|
|
136
|
+
if (titleValue !== undefined) {
|
|
137
|
+
this.changeTitle(menuField, titleValue);
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
setDialogValue(value) {
|
|
142
|
+
this.closeDialog(value);
|
|
143
|
+
}
|
|
144
|
+
closeDialog(value = undefined) {
|
|
145
|
+
var _a;
|
|
146
|
+
(_a = this.dialogRef) === null || _a === void 0 ? void 0 : _a.close(value);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
MenuDataViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: MenuDataViewComponent, deps: [{ token: i1.PepDialogService }, { token: DataViewBuilderService }], target: i0.ɵɵFactoryTarget.Component });
|
|
150
|
+
MenuDataViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: MenuDataViewComponent, selector: "menu-data-view", inputs: { fields: "fields", availableFieldsTitles: "availableFieldsTitles", emptyDropAreaId: "emptyDropAreaId", mappedFieldsId: "mappedFieldsId" }, outputs: { fieldsChange: "fieldsChange" }, viewQueries: [{ propertyName: "separatorTitleModalTemplate", first: true, predicate: ["separatorTitleModalTemplate"], descendants: true, read: TemplateRef }], ngImport: i0, template: "<ng-container *ngIf=\"fields === null || fields.length === 0; then emptyTemplate; else notEmptyTemplate\"></ng-container>\n<ng-template #emptyTemplate>\n <div [id]=\"emptyDropAreaId\" class=\"drop-field-here-area\" cdkDropList (cdkDropListDropped)=\"onDropField($event)\">\n <mat-icon class=\"pep-spacing-element\">\n <pep-icon name=\"arrow_down_alt\"></pep-icon>\n </mat-icon>\n <span class=\"body-sm ellipsis\">\n {{ 'DATA_VIEW_BUILDER.EMPTY_DROP_AREA_TEXT' | translate }}\n </span> \n </div>\n</ng-template>\n<ng-template #notEmptyTemplate>\n <div [id]=\"mappedFieldsId\" class=\"mapped-fields-area\" [ngClass]=\"{ 'no-row-gap': !isGrabbing }\"\n cdkDropList [cdkDropListData]=\"fields\" (cdkDropListDropped)=\"onDropField($event)\">\n <ng-container *ngFor=\"let menuField of fields; let i = index\" >\n <div class=\"mapped-field-container\" [ngClass]=\"{ 'separator-container': menuField.FieldID === '' }\" \n cdkDrag (cdkDragStarted)=\"onDragStart($event)\" (cdkDragEnded)=\"onDragEnd($event)\">\n <ng-container *ngTemplateOutlet=\"mappedFieldTemplate; context: { menuField: menuField }\"></ng-container>\n </div>\n <div *ngIf=\"!isGrabbing\" class=\"add-separator-container\">\n <pep-button class=\"add-separator\" styleType=\"regular\" sizeType=\"sm\" iconName=\"number_plus\" \n [value]=\"'DATA_VIEW_BUILDER.ADD_SEPARATOR' | translate\" (buttonClick)=\"addSeparator(i+1)\"></pep-button>\n </div>\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #mappedFieldTemplate let-menuField=\"menuField\">\n <ng-container *ngIf=\"menuField.FieldID !== ''; then menuItemTemplate; else separatorTemplate\"></ng-container>\n\n <ng-template #menuItemTemplate>\n <div class=\"fields-wrapper\">\n <pep-textbox [label]=\"'DATA_VIEW_BUILDER.MENU_ITEM_KEY_TITLE' | translate\" [value]=\"menuField.FieldID\" [disabled]=\"true\">\n </pep-textbox>\n \n <pep-textbox [label]=\"'DATA_VIEW_BUILDER.MENU_ITEM_VALUE_TITLE' | translate\" [hint]=\"'(' + (availableFieldsTitles.get(menuField.FieldID) || '') + ')'\"\n [value]=\"menuField.Title\" (valueChange)=\"onTitleChanged($event, menuField)\">\n </pep-textbox>\n \n <pep-button class=\"center-button\" iconName=\"system_bin\" [title]=\"'ACTIONS.DELETE' | translate\" (buttonClick)=\"onDeleteMappedField($event, menuField)\"></pep-button>\n </div>\n </ng-template>\n <ng-template #separatorTemplate>\n <div class=\"separator-wrapper \">\n <div class=\"pep-spacing-element title title-md color-dimmed\">\n <span [title]=\"menuField.Title\">{{ menuField.Title }}</span>\n </div>\n <div class=\"list-actions\">\n <pep-button iconName=\"system_edit\" [title]=\"'ACTIONS.EDIT' | translate\" sizeType=\"xs\" styleType=\"regular\" (buttonClick)=\"onEditSeparatorField($event, menuField)\"></pep-button>\n <pep-button iconName=\"system_bin\" [title]=\"'ACTIONS.DELETE' | translate\" sizeType=\"xs\" styleType=\"regular\" (buttonClick)=\"onDeleteMappedField($event, menuField)\"></pep-button>\n </div>\n </div>\n </ng-template>\n</ng-template>\n\n<ng-template #separatorTitleModalTemplate let-data>\n <pep-dialog [title]=\"'DATA_VIEW_BUILDER.SEPARATOR_TITLE' | translate\">\n <ng-container pep-dialog-content>\n <pep-textbox #txt [label]=\"'DATA_VIEW_BUILDER.ADD_A_TITLE' | translate\" [(value)]=\"data.value\">\n </pep-textbox>\n </ng-container>\n <ng-container pep-dialog-actions>\n <div class=\"pep-spacing-element-negative\">\n <button mat-button class=\"pep-spacing-element pep-button md weak\"\n (click)=\"closeDialog()\">\n {{'Cancel' | translate}}\n </button>\n <button mat-button class=\"pep-spacing-element pep-button md strong\"\n (click)=\"setDialogValue(txt.value)\">\n {{ 'Save' | translate}}\n </button>\n </div>\n </ng-container>\n </pep-dialog>\n</ng-template>", styles: ["html body.inheritCursors *{cursor:inherit!important}.cdk-drag-preview.mapped-field-container{max-width:600px;display:flex;justify-content:center;align-items:center;border-radius:var(--pep-border-radius-md, .25rem)}.cdk-drag-preview.mapped-field-container:not(.separator-container){padding-inline:var(--pep-spacing-lg, 1rem)}.cdk-drag-preview.mapped-field-container:not(.separator-container){gap:calc(var(--pep-spacing-lg, 1rem) * 2);background:hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),98%);box-shadow:var(--pep-shadow-xs-offset, 0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.08);border:1px solid hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),calc(var(--pep-color-regular-l, 10%) + 30%))}.cdk-drag-preview.mapped-field-container .fields-wrapper{display:grid;width:100%;grid-template-columns:1fr 1fr auto;gap:.5rem;padding-top:.5rem}.cdk-drag-preview.mapped-field-container .fields-wrapper .center-button{margin-top:var(--pep-form-field-title-height, 1.5rem)}.cdk-drag-preview.mapped-field-container .separator-wrapper{display:grid;width:100%;grid-template-columns:1fr auto;padding-bottom:var(--pep-spacing-xs, .25rem);border-bottom:1px solid hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),calc(var(--pep-color-regular-l, 10%) + 30%))}.cdk-drag-preview.mapped-field-container .separator-wrapper .list-actions{display:flex;gap:var(--pep-spacing-xs, .25rem)}.drop-field-here-area{min-height:5rem;max-width:600px;display:flex;justify-content:center;align-items:center;border-radius:var(--pep-border-radius-md, .25rem);background:hsla(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%),.12);position:relative}.drop-field-here-area:not(.separator-container){padding-inline:var(--pep-spacing-lg, 1rem)}.drop-field-here-area:after{z-index:0;content:\"\";transition:all .25s;display:block;position:absolute;inset:0;border-radius:inherit;border:1px dashed hsl(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),calc(var(--pep-color-system-primary-l, 10%) + 30%))}.drop-field-here-area.cdk-drop-list-dragging{box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsla(var(--pep-color-text-link-h, 207),var(--pep-color-text-link-s, 76%),var(--pep-color-text-link-l, 37%),.5)}.drop-field-here-area.cdk-drop-list-dragging:hover{background:hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),98%);box-shadow:var(--pep-shadow-xs-offset, 0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.16);border:1px solid hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),calc(var(--pep-color-regular-l, 10%) + 20%));box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsla(var(--pep-color-text-link-h, 207),var(--pep-color-text-link-s, 76%),var(--pep-color-text-link-l, 37%),.5)}.drop-field-here-area.cdk-drop-list-dragging ::ng-deep .placeholder-item{display:none}.mapped-fields-area{display:flex;flex-direction:column;column-gap:var(--pep-spacing-lg, 1rem)}.mapped-fields-area:not(.no-row-gap){row-gap:var(--pep-spacing-lg, 1rem)}.mapped-fields-area.cdk-drop-list-dragging ::ng-deep .placeholder-item{max-width:600px;display:flex;justify-content:center;align-items:center;border-radius:var(--pep-border-radius-md, .25rem);background:hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),98%);box-shadow:var(--pep-shadow-xs-offset, 0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.08);border:1px solid hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),calc(var(--pep-color-regular-l, 10%) + 30%));box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsla(var(--pep-color-text-link-h, 207),var(--pep-color-text-link-s, 76%),var(--pep-color-text-link-l, 37%),.5);height:2.5rem}.mapped-fields-area.cdk-drop-list-dragging ::ng-deep .placeholder-item:not(.separator-container){padding-inline:var(--pep-spacing-lg, 1rem)}.mapped-fields-area .mapped-field-container{cursor:grab;max-width:600px;display:flex;justify-content:center;align-items:center;border-radius:var(--pep-border-radius-md, .25rem)}.mapped-fields-area .mapped-field-container:not(.separator-container){padding-inline:var(--pep-spacing-lg, 1rem)}.mapped-fields-area .mapped-field-container:not(.separator-container){gap:calc(var(--pep-spacing-lg, 1rem) * 2);background:hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),98%);box-shadow:var(--pep-shadow-xs-offset, 0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.08);border:1px solid hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),calc(var(--pep-color-regular-l, 10%) + 30%))}.mapped-fields-area .mapped-field-container .fields-wrapper{display:grid;width:100%;grid-template-columns:1fr 1fr auto;gap:.5rem;padding-top:.5rem}.mapped-fields-area .mapped-field-container .fields-wrapper .center-button{margin-top:var(--pep-form-field-title-height, 1.5rem)}.mapped-fields-area .mapped-field-container .separator-wrapper{display:grid;width:100%;grid-template-columns:1fr auto;padding-bottom:var(--pep-spacing-xs, .25rem);border-bottom:1px solid hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),calc(var(--pep-color-regular-l, 10%) + 30%))}.mapped-fields-area .mapped-field-container .separator-wrapper .list-actions{display:flex;gap:var(--pep-spacing-xs, .25rem)}.mapped-fields-area .mapped-field-container.cdk-drag-placeholder{box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsla(var(--pep-color-text-link-h, 207),var(--pep-color-text-link-s, 76%),var(--pep-color-text-link-l, 37%),.5)}.mapped-fields-area .mapped-field-container.cdk-drag-placeholder .fields-wrapper,.mapped-fields-area .mapped-field-container.cdk-drag-placeholder .separator-wrapper{opacity:0}.mapped-fields-area .add-separator-container{max-width:600px;display:flex;justify-content:center;align-items:center;border-radius:var(--pep-border-radius-md, .25rem);height:var(--pep-spacing-lg, 1rem)}.mapped-fields-area .add-separator-container:not(.separator-container){padding-inline:var(--pep-spacing-lg, 1rem)}.mapped-fields-area .add-separator-container .add-separator{position:relative;display:none}.mapped-fields-area .add-separator-container:hover .add-separator{display:block}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i4.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i4.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i6.PepButtonComponent, selector: "pep-button", inputs: ["key", "value", "styleType", "styleStateType", "sizeType", "classNames", "disabled", "iconName", "iconPosition", "visible"], outputs: ["buttonClick"] }, { kind: "component", type: i1.PepDialogComponent, selector: "pep-dialog", inputs: ["title", "showClose", "showHeader", "showFooter"], outputs: ["close"] }, { kind: "component", type: i1$1.PepIconComponent, selector: "pep-icon", inputs: ["spin", "name", "fill"] }, { kind: "component", type: i8.PepTextboxComponent, selector: "pep-textbox", inputs: ["key", "value", "formattedValue", "minFractionDigits", "maxFractionDigits", "accessory", "label", "placeholder", "type", "mandatory", "disabled", "readonly", "maxFieldCharacters", "hint", "textColor", "xAlignment", "rowSpan", "minValue", "maxValue", "visible", "form", "isActive", "showTitle", "renderTitle", "renderError", "renderSymbol", "layoutType", "parentFieldKey", "regex", "regexError", "isInFocus"], outputs: ["valueChange", "formValidationChange"] }, { kind: "pipe", type: i9.TranslatePipe, name: "translate" }] });
|
|
151
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: MenuDataViewComponent, decorators: [{
|
|
152
|
+
type: Component,
|
|
153
|
+
args: [{ selector: 'menu-data-view', template: "<ng-container *ngIf=\"fields === null || fields.length === 0; then emptyTemplate; else notEmptyTemplate\"></ng-container>\n<ng-template #emptyTemplate>\n <div [id]=\"emptyDropAreaId\" class=\"drop-field-here-area\" cdkDropList (cdkDropListDropped)=\"onDropField($event)\">\n <mat-icon class=\"pep-spacing-element\">\n <pep-icon name=\"arrow_down_alt\"></pep-icon>\n </mat-icon>\n <span class=\"body-sm ellipsis\">\n {{ 'DATA_VIEW_BUILDER.EMPTY_DROP_AREA_TEXT' | translate }}\n </span> \n </div>\n</ng-template>\n<ng-template #notEmptyTemplate>\n <div [id]=\"mappedFieldsId\" class=\"mapped-fields-area\" [ngClass]=\"{ 'no-row-gap': !isGrabbing }\"\n cdkDropList [cdkDropListData]=\"fields\" (cdkDropListDropped)=\"onDropField($event)\">\n <ng-container *ngFor=\"let menuField of fields; let i = index\" >\n <div class=\"mapped-field-container\" [ngClass]=\"{ 'separator-container': menuField.FieldID === '' }\" \n cdkDrag (cdkDragStarted)=\"onDragStart($event)\" (cdkDragEnded)=\"onDragEnd($event)\">\n <ng-container *ngTemplateOutlet=\"mappedFieldTemplate; context: { menuField: menuField }\"></ng-container>\n </div>\n <div *ngIf=\"!isGrabbing\" class=\"add-separator-container\">\n <pep-button class=\"add-separator\" styleType=\"regular\" sizeType=\"sm\" iconName=\"number_plus\" \n [value]=\"'DATA_VIEW_BUILDER.ADD_SEPARATOR' | translate\" (buttonClick)=\"addSeparator(i+1)\"></pep-button>\n </div>\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #mappedFieldTemplate let-menuField=\"menuField\">\n <ng-container *ngIf=\"menuField.FieldID !== ''; then menuItemTemplate; else separatorTemplate\"></ng-container>\n\n <ng-template #menuItemTemplate>\n <div class=\"fields-wrapper\">\n <pep-textbox [label]=\"'DATA_VIEW_BUILDER.MENU_ITEM_KEY_TITLE' | translate\" [value]=\"menuField.FieldID\" [disabled]=\"true\">\n </pep-textbox>\n \n <pep-textbox [label]=\"'DATA_VIEW_BUILDER.MENU_ITEM_VALUE_TITLE' | translate\" [hint]=\"'(' + (availableFieldsTitles.get(menuField.FieldID) || '') + ')'\"\n [value]=\"menuField.Title\" (valueChange)=\"onTitleChanged($event, menuField)\">\n </pep-textbox>\n \n <pep-button class=\"center-button\" iconName=\"system_bin\" [title]=\"'ACTIONS.DELETE' | translate\" (buttonClick)=\"onDeleteMappedField($event, menuField)\"></pep-button>\n </div>\n </ng-template>\n <ng-template #separatorTemplate>\n <div class=\"separator-wrapper \">\n <div class=\"pep-spacing-element title title-md color-dimmed\">\n <span [title]=\"menuField.Title\">{{ menuField.Title }}</span>\n </div>\n <div class=\"list-actions\">\n <pep-button iconName=\"system_edit\" [title]=\"'ACTIONS.EDIT' | translate\" sizeType=\"xs\" styleType=\"regular\" (buttonClick)=\"onEditSeparatorField($event, menuField)\"></pep-button>\n <pep-button iconName=\"system_bin\" [title]=\"'ACTIONS.DELETE' | translate\" sizeType=\"xs\" styleType=\"regular\" (buttonClick)=\"onDeleteMappedField($event, menuField)\"></pep-button>\n </div>\n </div>\n </ng-template>\n</ng-template>\n\n<ng-template #separatorTitleModalTemplate let-data>\n <pep-dialog [title]=\"'DATA_VIEW_BUILDER.SEPARATOR_TITLE' | translate\">\n <ng-container pep-dialog-content>\n <pep-textbox #txt [label]=\"'DATA_VIEW_BUILDER.ADD_A_TITLE' | translate\" [(value)]=\"data.value\">\n </pep-textbox>\n </ng-container>\n <ng-container pep-dialog-actions>\n <div class=\"pep-spacing-element-negative\">\n <button mat-button class=\"pep-spacing-element pep-button md weak\"\n (click)=\"closeDialog()\">\n {{'Cancel' | translate}}\n </button>\n <button mat-button class=\"pep-spacing-element pep-button md strong\"\n (click)=\"setDialogValue(txt.value)\">\n {{ 'Save' | translate}}\n </button>\n </div>\n </ng-container>\n </pep-dialog>\n</ng-template>", styles: ["html body.inheritCursors *{cursor:inherit!important}.cdk-drag-preview.mapped-field-container{max-width:600px;display:flex;justify-content:center;align-items:center;border-radius:var(--pep-border-radius-md, .25rem)}.cdk-drag-preview.mapped-field-container:not(.separator-container){padding-inline:var(--pep-spacing-lg, 1rem)}.cdk-drag-preview.mapped-field-container:not(.separator-container){gap:calc(var(--pep-spacing-lg, 1rem) * 2);background:hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),98%);box-shadow:var(--pep-shadow-xs-offset, 0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.08);border:1px solid hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),calc(var(--pep-color-regular-l, 10%) + 30%))}.cdk-drag-preview.mapped-field-container .fields-wrapper{display:grid;width:100%;grid-template-columns:1fr 1fr auto;gap:.5rem;padding-top:.5rem}.cdk-drag-preview.mapped-field-container .fields-wrapper .center-button{margin-top:var(--pep-form-field-title-height, 1.5rem)}.cdk-drag-preview.mapped-field-container .separator-wrapper{display:grid;width:100%;grid-template-columns:1fr auto;padding-bottom:var(--pep-spacing-xs, .25rem);border-bottom:1px solid hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),calc(var(--pep-color-regular-l, 10%) + 30%))}.cdk-drag-preview.mapped-field-container .separator-wrapper .list-actions{display:flex;gap:var(--pep-spacing-xs, .25rem)}.drop-field-here-area{min-height:5rem;max-width:600px;display:flex;justify-content:center;align-items:center;border-radius:var(--pep-border-radius-md, .25rem);background:hsla(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%),.12);position:relative}.drop-field-here-area:not(.separator-container){padding-inline:var(--pep-spacing-lg, 1rem)}.drop-field-here-area:after{z-index:0;content:\"\";transition:all .25s;display:block;position:absolute;inset:0;border-radius:inherit;border:1px dashed hsl(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),calc(var(--pep-color-system-primary-l, 10%) + 30%))}.drop-field-here-area.cdk-drop-list-dragging{box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsla(var(--pep-color-text-link-h, 207),var(--pep-color-text-link-s, 76%),var(--pep-color-text-link-l, 37%),.5)}.drop-field-here-area.cdk-drop-list-dragging:hover{background:hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),98%);box-shadow:var(--pep-shadow-xs-offset, 0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.16);border:1px solid hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),calc(var(--pep-color-regular-l, 10%) + 20%));box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsla(var(--pep-color-text-link-h, 207),var(--pep-color-text-link-s, 76%),var(--pep-color-text-link-l, 37%),.5)}.drop-field-here-area.cdk-drop-list-dragging ::ng-deep .placeholder-item{display:none}.mapped-fields-area{display:flex;flex-direction:column;column-gap:var(--pep-spacing-lg, 1rem)}.mapped-fields-area:not(.no-row-gap){row-gap:var(--pep-spacing-lg, 1rem)}.mapped-fields-area.cdk-drop-list-dragging ::ng-deep .placeholder-item{max-width:600px;display:flex;justify-content:center;align-items:center;border-radius:var(--pep-border-radius-md, .25rem);background:hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),98%);box-shadow:var(--pep-shadow-xs-offset, 0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.08);border:1px solid hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),calc(var(--pep-color-regular-l, 10%) + 30%));box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsla(var(--pep-color-text-link-h, 207),var(--pep-color-text-link-s, 76%),var(--pep-color-text-link-l, 37%),.5);height:2.5rem}.mapped-fields-area.cdk-drop-list-dragging ::ng-deep .placeholder-item:not(.separator-container){padding-inline:var(--pep-spacing-lg, 1rem)}.mapped-fields-area .mapped-field-container{cursor:grab;max-width:600px;display:flex;justify-content:center;align-items:center;border-radius:var(--pep-border-radius-md, .25rem)}.mapped-fields-area .mapped-field-container:not(.separator-container){padding-inline:var(--pep-spacing-lg, 1rem)}.mapped-fields-area .mapped-field-container:not(.separator-container){gap:calc(var(--pep-spacing-lg, 1rem) * 2);background:hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),98%);box-shadow:var(--pep-shadow-xs-offset, 0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.08);border:1px solid hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),calc(var(--pep-color-regular-l, 10%) + 30%))}.mapped-fields-area .mapped-field-container .fields-wrapper{display:grid;width:100%;grid-template-columns:1fr 1fr auto;gap:.5rem;padding-top:.5rem}.mapped-fields-area .mapped-field-container .fields-wrapper .center-button{margin-top:var(--pep-form-field-title-height, 1.5rem)}.mapped-fields-area .mapped-field-container .separator-wrapper{display:grid;width:100%;grid-template-columns:1fr auto;padding-bottom:var(--pep-spacing-xs, .25rem);border-bottom:1px solid hsl(var(--pep-color-regular-h, 0),var(--pep-color-regular-s, 0%),calc(var(--pep-color-regular-l, 10%) + 30%))}.mapped-fields-area .mapped-field-container .separator-wrapper .list-actions{display:flex;gap:var(--pep-spacing-xs, .25rem)}.mapped-fields-area .mapped-field-container.cdk-drag-placeholder{box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsla(var(--pep-color-text-link-h, 207),var(--pep-color-text-link-s, 76%),var(--pep-color-text-link-l, 37%),.5)}.mapped-fields-area .mapped-field-container.cdk-drag-placeholder .fields-wrapper,.mapped-fields-area .mapped-field-container.cdk-drag-placeholder .separator-wrapper{opacity:0}.mapped-fields-area .add-separator-container{max-width:600px;display:flex;justify-content:center;align-items:center;border-radius:var(--pep-border-radius-md, .25rem);height:var(--pep-spacing-lg, 1rem)}.mapped-fields-area .add-separator-container:not(.separator-container){padding-inline:var(--pep-spacing-lg, 1rem)}.mapped-fields-area .add-separator-container .add-separator{position:relative;display:none}.mapped-fields-area .add-separator-container:hover .add-separator{display:block}\n"] }]
|
|
154
|
+
}], ctorParameters: function () { return [{ type: i1.PepDialogService }, { type: DataViewBuilderService }]; }, propDecorators: { separatorTitleModalTemplate: [{
|
|
155
|
+
type: ViewChild,
|
|
156
|
+
args: ['separatorTitleModalTemplate', { read: TemplateRef }]
|
|
157
|
+
}], fields: [{
|
|
158
|
+
type: Input
|
|
159
|
+
}], availableFieldsTitles: [{
|
|
160
|
+
type: Input
|
|
161
|
+
}], emptyDropAreaId: [{
|
|
162
|
+
type: Input
|
|
163
|
+
}], mappedFieldsId: [{
|
|
164
|
+
type: Input
|
|
165
|
+
}], fieldsChange: [{
|
|
166
|
+
type: Output
|
|
167
167
|
}] } });
|
|
168
168
|
|
|
169
|
-
class DataViewBuilderComponent {
|
|
170
|
-
constructor(dataViewBuilderService) {
|
|
171
|
-
this.dataViewBuilderService = dataViewBuilderService;
|
|
172
|
-
// @Input() title: string = '';
|
|
173
|
-
this.builderTitle = '';
|
|
174
|
-
this.builderTitleHint = '';
|
|
175
|
-
this._availableFields = [];
|
|
176
|
-
this.dataViewChange = new EventEmitter();
|
|
177
|
-
this.type = 'not-supported';
|
|
178
|
-
this.emptyDropAreaId = 'emptyDropArea';
|
|
179
|
-
this.mappedFieldsId = 'mappedFields';
|
|
180
|
-
this.availableFieldsTitles = new Map();
|
|
181
|
-
//
|
|
182
|
-
}
|
|
183
|
-
set availableFields(value) {
|
|
184
|
-
this._availableFields = value;
|
|
185
|
-
this.setTitlesMap();
|
|
186
|
-
}
|
|
187
|
-
get availableFields() {
|
|
188
|
-
return this._availableFields;
|
|
189
|
-
}
|
|
190
|
-
set dataView(value) {
|
|
191
|
-
this._dataView = value;
|
|
192
|
-
this.setType();
|
|
193
|
-
this.refreshAvailableFields();
|
|
194
|
-
}
|
|
195
|
-
get dataView() {
|
|
196
|
-
return this._dataView;
|
|
197
|
-
}
|
|
198
|
-
setType() {
|
|
199
|
-
if (this._dataView.Type === 'Menu') {
|
|
200
|
-
this.type = 'menu';
|
|
201
|
-
}
|
|
202
|
-
else if (this._dataView.Type === 'Grid') {
|
|
203
|
-
this.type = 'list';
|
|
204
|
-
}
|
|
205
|
-
else if ((this._dataView.Type === 'Card') ||
|
|
206
|
-
(this._dataView.Type === 'Form') ||
|
|
207
|
-
(this._dataView.Type === 'Large') ||
|
|
208
|
-
(this._dataView.Type === 'Line')) {
|
|
209
|
-
this.type = 'card';
|
|
210
|
-
}
|
|
211
|
-
else {
|
|
212
|
-
this.type = 'not-supported';
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
setAvailableFieldPermission(field, disable) {
|
|
216
|
-
// Find the item in the available fields
|
|
217
|
-
const item = this.availableFields.find(as => as.data.key === field);
|
|
218
|
-
// If exist disable or enable it.
|
|
219
|
-
if (item) {
|
|
220
|
-
item.disabled = disable;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
refreshAvailableFields() {
|
|
224
|
-
this.availableFields.forEach(af => af.disabled = false);
|
|
225
|
-
if (this.dataView && this.dataView.Fields) {
|
|
226
|
-
for (let index = 0; index < this.dataView.Fields.length; index++) {
|
|
227
|
-
this.setAvailableFieldPermission(this.dataView.Fields[index].FieldID, true);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
setTitlesMap() {
|
|
232
|
-
var _a, _b;
|
|
233
|
-
this.availableFieldsTitles.clear();
|
|
234
|
-
if (((_a = this.availableFields) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
235
|
-
for (let index = 0; index < this.availableFields.length; index++) {
|
|
236
|
-
const availableField = this.availableFields[index];
|
|
237
|
-
if (((_b = availableField === null || availableField === void 0 ? void 0 : availableField.data) === null || _b === void 0 ? void 0 : _b.key.length) > 0) {
|
|
238
|
-
this.availableFieldsTitles.set(availableField.data.key, availableField.title);
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
notifyDataViewChange() {
|
|
244
|
-
this.dataViewChange.emit(this.dataView);
|
|
245
|
-
// console.log(this.dataView);
|
|
246
|
-
}
|
|
247
|
-
ngOnInit() {
|
|
248
|
-
//
|
|
249
|
-
}
|
|
250
|
-
onDragStart(event) {
|
|
251
|
-
this.dataViewBuilderService.onDragStart(event);
|
|
252
|
-
}
|
|
253
|
-
onDragEnd(event) {
|
|
254
|
-
this.dataViewBuilderService.onDragEnd(event);
|
|
255
|
-
}
|
|
256
|
-
onFieldsChanged(fields) {
|
|
257
|
-
this.dataView.Fields = fields;
|
|
258
|
-
this.refreshAvailableFields();
|
|
259
|
-
this.notifyDataViewChange();
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
DataViewBuilderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: DataViewBuilderComponent, deps: [{ token: DataViewBuilderService }], target: i0.ɵɵFactoryTarget.Component });
|
|
263
|
-
DataViewBuilderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: DataViewBuilderComponent, selector: "pep-data-view-builder", inputs: { builderTitle: "builderTitle", builderTitleHint: "builderTitleHint", availableFields: "availableFields", dataView: "dataView" }, outputs: { dataViewChange: "dataViewChange" }, ngImport: i0, template: "<pep-page-layout >\n <!-- <ng-container pep-top-area>\n <pep-top-bar [title]=\"title\">\n <div header-end-content>\n </div>\n </pep-top-bar>\n </ng-container> -->\n <ng-container pep-main-area>\n <ng-container *ngIf=\"type === 'not-supported' ; then notSupportedTemplate; else supportedTemplate\"></ng-container>\n <ng-template #notSupportedTemplate>\n <span class=\"body-sm ellipsis\">\n {{ 'DATA_VIEW_BUILDER.TYPE_NOT_SUPPORTED' | translate }}\n </span> \n </ng-template>\n <ng-template #supportedTemplate>\n <div *ngIf=\"dataView && availableFields\" class=\"mapped-fields-container\">\n <div class=\"available-fields-side-area\">\n <pep-draggable-items [items]=\"availableFields\" [title]=\"'DATA_VIEW_BUILDER.AVAILABLE_FIELDS' | translate\" titleType=\"with-bottom-border\" titleSizeType=\"md\"\n itemPlaceholderType=\"weak\" [showSearch]=\"true\" [dropAreaIds]=\"['emptyDropArea', 'mappedFields']\" (itemDragStarted)=\"onDragStart($event)\" (itemDragEnded)=\"onDragEnd($event)\">\n </pep-draggable-items>\n </div>\n <div pep-main-area class=\"mapped-fields-main-area\">\n <div class=\"mapped-fields-top-area pep-border-bottom\"\n [title]=\"builderTitle + ' ' + (builderTitleHint ? ('(' + builderTitleHint + ')') : '')\">\n <span class=\"title-md\">{{ builderTitle }} </span>\n <span *ngIf=\"builderTitleHint\" class=\"color-dimmed\">({{ builderTitleHint }})</span>\n </div>\n \n <div class=\"data-view-by-type-area\" [ngSwitch]=\"type\">\n <ng-container *ngSwitchCase=\"'menu'\">\n <menu-data-view [fields]=\"dataView?.Fields || []\" [availableFieldsTitles]=\"availableFieldsTitles\" [emptyDropAreaId]=\"emptyDropAreaId\"\n [mappedFieldsId]=\"mappedFieldsId\" (fieldsChange)=\"onFieldsChanged($event)\">\n </menu-data-view>\n </ng-container>\n <!-- <ng-container *ngSwitchDefault>\n </ng-container> -->\n </div>\n </div>\n </div>\n </ng-template>\n </ng-container>\n</pep-page-layout>\n\n", styles: [".mapped-fields-container{display:grid;height:100%;grid-template-columns:auto 1fr;grid-template-areas:\"side-area main-area\"}.mapped-fields-container .available-fields-side-area{grid-area:side-area;width:240px;max-width:240px;overflow:auto;height:inherit;padding-top:var(--pep-spacing-2xl, 2rem);margin-inline-end:calc(var(--pep-spacing-lg, 1rem) * 2)}.mapped-fields-container .mapped-fields-main-area{display:grid;grid-template-rows:auto 1fr;grid-area:main-area;padding-top:var(--pep-spacing-2xl, 2rem);overflow:auto;height:inherit}.mapped-fields-container .mapped-fields-main-area .mapped-fields-top-area{height:var(--pep-top-bar-field-height, 2.5rem);display:flex;align-items:center}.mapped-fields-container .mapped-fields-main-area .data-view-by-type-area{overflow:auto;height:inherit;padding-top:var(--pep-spacing-lg, 1rem);padding-bottom:var(--pep-spacing-lg, 1rem);padding-inline:var(--pep-spacing-xs, .25rem)}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: i3$1.PepPageLayoutComponent, selector: "pep-page-layout", inputs: ["addPadding", "showShadow"] }, { kind: "component", type: i4$1.DraggableItemsComponent, selector: "pep-draggable-items", inputs: ["containerId", "showSearch", "title", "titleType", "titleSizeType", "itemPlaceholderType", "dropAreaIds", "items"], outputs: ["itemDragStarted", "itemDragEnded"] }, { kind: "component", type: MenuDataViewComponent, selector: "menu-data-view", inputs: ["fields", "availableFieldsTitles", "emptyDropAreaId", "mappedFieldsId"], outputs: ["fieldsChange"] }, { kind: "pipe", type: i9.TranslatePipe, name: "translate" }] });
|
|
264
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: DataViewBuilderComponent, decorators: [{
|
|
265
|
-
type: Component,
|
|
266
|
-
args: [{ selector: 'pep-data-view-builder', template: "<pep-page-layout >\n <!-- <ng-container pep-top-area>\n <pep-top-bar [title]=\"title\">\n <div header-end-content>\n </div>\n </pep-top-bar>\n </ng-container> -->\n <ng-container pep-main-area>\n <ng-container *ngIf=\"type === 'not-supported' ; then notSupportedTemplate; else supportedTemplate\"></ng-container>\n <ng-template #notSupportedTemplate>\n <span class=\"body-sm ellipsis\">\n {{ 'DATA_VIEW_BUILDER.TYPE_NOT_SUPPORTED' | translate }}\n </span> \n </ng-template>\n <ng-template #supportedTemplate>\n <div *ngIf=\"dataView && availableFields\" class=\"mapped-fields-container\">\n <div class=\"available-fields-side-area\">\n <pep-draggable-items [items]=\"availableFields\" [title]=\"'DATA_VIEW_BUILDER.AVAILABLE_FIELDS' | translate\" titleType=\"with-bottom-border\" titleSizeType=\"md\"\n itemPlaceholderType=\"weak\" [showSearch]=\"true\" [dropAreaIds]=\"['emptyDropArea', 'mappedFields']\" (itemDragStarted)=\"onDragStart($event)\" (itemDragEnded)=\"onDragEnd($event)\">\n </pep-draggable-items>\n </div>\n <div pep-main-area class=\"mapped-fields-main-area\">\n <div class=\"mapped-fields-top-area pep-border-bottom\"\n [title]=\"builderTitle + ' ' + (builderTitleHint ? ('(' + builderTitleHint + ')') : '')\">\n <span class=\"title-md\">{{ builderTitle }} </span>\n <span *ngIf=\"builderTitleHint\" class=\"color-dimmed\">({{ builderTitleHint }})</span>\n </div>\n \n <div class=\"data-view-by-type-area\" [ngSwitch]=\"type\">\n <ng-container *ngSwitchCase=\"'menu'\">\n <menu-data-view [fields]=\"dataView?.Fields || []\" [availableFieldsTitles]=\"availableFieldsTitles\" [emptyDropAreaId]=\"emptyDropAreaId\"\n [mappedFieldsId]=\"mappedFieldsId\" (fieldsChange)=\"onFieldsChanged($event)\">\n </menu-data-view>\n </ng-container>\n <!-- <ng-container *ngSwitchDefault>\n </ng-container> -->\n </div>\n </div>\n </div>\n </ng-template>\n </ng-container>\n</pep-page-layout>\n\n", styles: [".mapped-fields-container{display:grid;height:100%;grid-template-columns:auto 1fr;grid-template-areas:\"side-area main-area\"}.mapped-fields-container .available-fields-side-area{grid-area:side-area;width:240px;max-width:240px;overflow:auto;height:inherit;padding-top:var(--pep-spacing-2xl, 2rem);margin-inline-end:calc(var(--pep-spacing-lg, 1rem) * 2)}.mapped-fields-container .mapped-fields-main-area{display:grid;grid-template-rows:auto 1fr;grid-area:main-area;padding-top:var(--pep-spacing-2xl, 2rem);overflow:auto;height:inherit}.mapped-fields-container .mapped-fields-main-area .mapped-fields-top-area{height:var(--pep-top-bar-field-height, 2.5rem);display:flex;align-items:center}.mapped-fields-container .mapped-fields-main-area .data-view-by-type-area{overflow:auto;height:inherit;padding-top:var(--pep-spacing-lg, 1rem);padding-bottom:var(--pep-spacing-lg, 1rem);padding-inline:var(--pep-spacing-xs, .25rem)}\n"] }]
|
|
267
|
-
}], ctorParameters: function () { return [{ type: DataViewBuilderService }]; }, propDecorators: { builderTitle: [{
|
|
268
|
-
type: Input
|
|
269
|
-
}], builderTitleHint: [{
|
|
270
|
-
type: Input
|
|
271
|
-
}], availableFields: [{
|
|
272
|
-
type: Input
|
|
273
|
-
}], dataView: [{
|
|
274
|
-
type: Input
|
|
275
|
-
}], dataViewChange: [{
|
|
276
|
-
type: Output
|
|
169
|
+
class DataViewBuilderComponent {
|
|
170
|
+
constructor(dataViewBuilderService) {
|
|
171
|
+
this.dataViewBuilderService = dataViewBuilderService;
|
|
172
|
+
// @Input() title: string = '';
|
|
173
|
+
this.builderTitle = '';
|
|
174
|
+
this.builderTitleHint = '';
|
|
175
|
+
this._availableFields = [];
|
|
176
|
+
this.dataViewChange = new EventEmitter();
|
|
177
|
+
this.type = 'not-supported';
|
|
178
|
+
this.emptyDropAreaId = 'emptyDropArea';
|
|
179
|
+
this.mappedFieldsId = 'mappedFields';
|
|
180
|
+
this.availableFieldsTitles = new Map();
|
|
181
|
+
//
|
|
182
|
+
}
|
|
183
|
+
set availableFields(value) {
|
|
184
|
+
this._availableFields = value;
|
|
185
|
+
this.setTitlesMap();
|
|
186
|
+
}
|
|
187
|
+
get availableFields() {
|
|
188
|
+
return this._availableFields;
|
|
189
|
+
}
|
|
190
|
+
set dataView(value) {
|
|
191
|
+
this._dataView = value;
|
|
192
|
+
this.setType();
|
|
193
|
+
this.refreshAvailableFields();
|
|
194
|
+
}
|
|
195
|
+
get dataView() {
|
|
196
|
+
return this._dataView;
|
|
197
|
+
}
|
|
198
|
+
setType() {
|
|
199
|
+
if (this._dataView.Type === 'Menu') {
|
|
200
|
+
this.type = 'menu';
|
|
201
|
+
}
|
|
202
|
+
else if (this._dataView.Type === 'Grid') {
|
|
203
|
+
this.type = 'list';
|
|
204
|
+
}
|
|
205
|
+
else if ((this._dataView.Type === 'Card') ||
|
|
206
|
+
(this._dataView.Type === 'Form') ||
|
|
207
|
+
(this._dataView.Type === 'Large') ||
|
|
208
|
+
(this._dataView.Type === 'Line')) {
|
|
209
|
+
this.type = 'card';
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
this.type = 'not-supported';
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
setAvailableFieldPermission(field, disable) {
|
|
216
|
+
// Find the item in the available fields
|
|
217
|
+
const item = this.availableFields.find(as => as.data.key === field);
|
|
218
|
+
// If exist disable or enable it.
|
|
219
|
+
if (item) {
|
|
220
|
+
item.disabled = disable;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
refreshAvailableFields() {
|
|
224
|
+
this.availableFields.forEach(af => af.disabled = false);
|
|
225
|
+
if (this.dataView && this.dataView.Fields) {
|
|
226
|
+
for (let index = 0; index < this.dataView.Fields.length; index++) {
|
|
227
|
+
this.setAvailableFieldPermission(this.dataView.Fields[index].FieldID, true);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
setTitlesMap() {
|
|
232
|
+
var _a, _b;
|
|
233
|
+
this.availableFieldsTitles.clear();
|
|
234
|
+
if (((_a = this.availableFields) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
235
|
+
for (let index = 0; index < this.availableFields.length; index++) {
|
|
236
|
+
const availableField = this.availableFields[index];
|
|
237
|
+
if (((_b = availableField === null || availableField === void 0 ? void 0 : availableField.data) === null || _b === void 0 ? void 0 : _b.key.length) > 0) {
|
|
238
|
+
this.availableFieldsTitles.set(availableField.data.key, availableField.title);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
notifyDataViewChange() {
|
|
244
|
+
this.dataViewChange.emit(this.dataView);
|
|
245
|
+
// console.log(this.dataView);
|
|
246
|
+
}
|
|
247
|
+
ngOnInit() {
|
|
248
|
+
//
|
|
249
|
+
}
|
|
250
|
+
onDragStart(event) {
|
|
251
|
+
this.dataViewBuilderService.onDragStart(event);
|
|
252
|
+
}
|
|
253
|
+
onDragEnd(event) {
|
|
254
|
+
this.dataViewBuilderService.onDragEnd(event);
|
|
255
|
+
}
|
|
256
|
+
onFieldsChanged(fields) {
|
|
257
|
+
this.dataView.Fields = fields;
|
|
258
|
+
this.refreshAvailableFields();
|
|
259
|
+
this.notifyDataViewChange();
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
DataViewBuilderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: DataViewBuilderComponent, deps: [{ token: DataViewBuilderService }], target: i0.ɵɵFactoryTarget.Component });
|
|
263
|
+
DataViewBuilderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: DataViewBuilderComponent, selector: "pep-data-view-builder", inputs: { builderTitle: "builderTitle", builderTitleHint: "builderTitleHint", availableFields: "availableFields", dataView: "dataView" }, outputs: { dataViewChange: "dataViewChange" }, ngImport: i0, template: "<pep-page-layout >\n <!-- <ng-container pep-top-area>\n <pep-top-bar [title]=\"title\">\n <div header-end-content>\n </div>\n </pep-top-bar>\n </ng-container> -->\n <ng-container pep-main-area>\n <ng-container *ngIf=\"type === 'not-supported' ; then notSupportedTemplate; else supportedTemplate\"></ng-container>\n <ng-template #notSupportedTemplate>\n <span class=\"body-sm ellipsis\">\n {{ 'DATA_VIEW_BUILDER.TYPE_NOT_SUPPORTED' | translate }}\n </span> \n </ng-template>\n <ng-template #supportedTemplate>\n <div *ngIf=\"dataView && availableFields\" class=\"mapped-fields-container\">\n <div class=\"available-fields-side-area\">\n <pep-draggable-items [items]=\"availableFields\" [title]=\"'DATA_VIEW_BUILDER.AVAILABLE_FIELDS' | translate\" titleType=\"with-bottom-border\" titleSizeType=\"md\"\n itemPlaceholderType=\"weak\" [showSearch]=\"true\" [dropAreaIds]=\"['emptyDropArea', 'mappedFields']\" (itemDragStarted)=\"onDragStart($event)\" (itemDragEnded)=\"onDragEnd($event)\">\n </pep-draggable-items>\n </div>\n <div pep-main-area class=\"mapped-fields-main-area\">\n <div class=\"mapped-fields-top-area pep-border-bottom\"\n [title]=\"builderTitle + ' ' + (builderTitleHint ? ('(' + builderTitleHint + ')') : '')\">\n <span class=\"title-md\">{{ builderTitle }} </span>\n <span *ngIf=\"builderTitleHint\" class=\"color-dimmed\">({{ builderTitleHint }})</span>\n </div>\n \n <div class=\"data-view-by-type-area\" [ngSwitch]=\"type\">\n <ng-container *ngSwitchCase=\"'menu'\">\n <menu-data-view [fields]=\"dataView?.Fields || []\" [availableFieldsTitles]=\"availableFieldsTitles\" [emptyDropAreaId]=\"emptyDropAreaId\"\n [mappedFieldsId]=\"mappedFieldsId\" (fieldsChange)=\"onFieldsChanged($event)\">\n </menu-data-view>\n </ng-container>\n <!-- <ng-container *ngSwitchDefault>\n </ng-container> -->\n </div>\n </div>\n </div>\n </ng-template>\n </ng-container>\n</pep-page-layout>\n\n", styles: [".mapped-fields-container{display:grid;height:100%;grid-template-columns:auto 1fr;grid-template-areas:\"side-area main-area\"}.mapped-fields-container .available-fields-side-area{grid-area:side-area;width:240px;max-width:240px;overflow:auto;height:inherit;padding-top:var(--pep-spacing-2xl, 2rem);margin-inline-end:calc(var(--pep-spacing-lg, 1rem) * 2)}.mapped-fields-container .mapped-fields-main-area{display:grid;grid-template-rows:auto 1fr;grid-area:main-area;padding-top:var(--pep-spacing-2xl, 2rem);overflow:auto;height:inherit}.mapped-fields-container .mapped-fields-main-area .mapped-fields-top-area{height:var(--pep-top-bar-field-height, 2.5rem);display:flex;align-items:center}.mapped-fields-container .mapped-fields-main-area .data-view-by-type-area{overflow:auto;height:inherit;padding-top:var(--pep-spacing-lg, 1rem);padding-bottom:var(--pep-spacing-lg, 1rem);padding-inline:var(--pep-spacing-xs, .25rem)}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: i3$1.PepPageLayoutComponent, selector: "pep-page-layout", inputs: ["addPadding", "showShadow"] }, { kind: "component", type: i4$1.DraggableItemsComponent, selector: "pep-draggable-items", inputs: ["containerId", "showSearch", "title", "titleType", "titleSizeType", "itemPlaceholderType", "dropAreaIds", "items"], outputs: ["itemDragStarted", "itemDragEnded"] }, { kind: "component", type: MenuDataViewComponent, selector: "menu-data-view", inputs: ["fields", "availableFieldsTitles", "emptyDropAreaId", "mappedFieldsId"], outputs: ["fieldsChange"] }, { kind: "pipe", type: i9.TranslatePipe, name: "translate" }] });
|
|
264
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: DataViewBuilderComponent, decorators: [{
|
|
265
|
+
type: Component,
|
|
266
|
+
args: [{ selector: 'pep-data-view-builder', template: "<pep-page-layout >\n <!-- <ng-container pep-top-area>\n <pep-top-bar [title]=\"title\">\n <div header-end-content>\n </div>\n </pep-top-bar>\n </ng-container> -->\n <ng-container pep-main-area>\n <ng-container *ngIf=\"type === 'not-supported' ; then notSupportedTemplate; else supportedTemplate\"></ng-container>\n <ng-template #notSupportedTemplate>\n <span class=\"body-sm ellipsis\">\n {{ 'DATA_VIEW_BUILDER.TYPE_NOT_SUPPORTED' | translate }}\n </span> \n </ng-template>\n <ng-template #supportedTemplate>\n <div *ngIf=\"dataView && availableFields\" class=\"mapped-fields-container\">\n <div class=\"available-fields-side-area\">\n <pep-draggable-items [items]=\"availableFields\" [title]=\"'DATA_VIEW_BUILDER.AVAILABLE_FIELDS' | translate\" titleType=\"with-bottom-border\" titleSizeType=\"md\"\n itemPlaceholderType=\"weak\" [showSearch]=\"true\" [dropAreaIds]=\"['emptyDropArea', 'mappedFields']\" (itemDragStarted)=\"onDragStart($event)\" (itemDragEnded)=\"onDragEnd($event)\">\n </pep-draggable-items>\n </div>\n <div pep-main-area class=\"mapped-fields-main-area\">\n <div class=\"mapped-fields-top-area pep-border-bottom\"\n [title]=\"builderTitle + ' ' + (builderTitleHint ? ('(' + builderTitleHint + ')') : '')\">\n <span class=\"title-md\">{{ builderTitle }} </span>\n <span *ngIf=\"builderTitleHint\" class=\"color-dimmed\">({{ builderTitleHint }})</span>\n </div>\n \n <div class=\"data-view-by-type-area\" [ngSwitch]=\"type\">\n <ng-container *ngSwitchCase=\"'menu'\">\n <menu-data-view [fields]=\"dataView?.Fields || []\" [availableFieldsTitles]=\"availableFieldsTitles\" [emptyDropAreaId]=\"emptyDropAreaId\"\n [mappedFieldsId]=\"mappedFieldsId\" (fieldsChange)=\"onFieldsChanged($event)\">\n </menu-data-view>\n </ng-container>\n <!-- <ng-container *ngSwitchDefault>\n </ng-container> -->\n </div>\n </div>\n </div>\n </ng-template>\n </ng-container>\n</pep-page-layout>\n\n", styles: [".mapped-fields-container{display:grid;height:100%;grid-template-columns:auto 1fr;grid-template-areas:\"side-area main-area\"}.mapped-fields-container .available-fields-side-area{grid-area:side-area;width:240px;max-width:240px;overflow:auto;height:inherit;padding-top:var(--pep-spacing-2xl, 2rem);margin-inline-end:calc(var(--pep-spacing-lg, 1rem) * 2)}.mapped-fields-container .mapped-fields-main-area{display:grid;grid-template-rows:auto 1fr;grid-area:main-area;padding-top:var(--pep-spacing-2xl, 2rem);overflow:auto;height:inherit}.mapped-fields-container .mapped-fields-main-area .mapped-fields-top-area{height:var(--pep-top-bar-field-height, 2.5rem);display:flex;align-items:center}.mapped-fields-container .mapped-fields-main-area .data-view-by-type-area{overflow:auto;height:inherit;padding-top:var(--pep-spacing-lg, 1rem);padding-bottom:var(--pep-spacing-lg, 1rem);padding-inline:var(--pep-spacing-xs, .25rem)}\n"] }]
|
|
267
|
+
}], ctorParameters: function () { return [{ type: DataViewBuilderService }]; }, propDecorators: { builderTitle: [{
|
|
268
|
+
type: Input
|
|
269
|
+
}], builderTitleHint: [{
|
|
270
|
+
type: Input
|
|
271
|
+
}], availableFields: [{
|
|
272
|
+
type: Input
|
|
273
|
+
}], dataView: [{
|
|
274
|
+
type: Input
|
|
275
|
+
}], dataViewChange: [{
|
|
276
|
+
type: Output
|
|
277
277
|
}] } });
|
|
278
278
|
|
|
279
|
-
const pepIcons = [
|
|
280
|
-
pepIconSystemClose,
|
|
281
|
-
pepIconArrowDownAlt,
|
|
282
|
-
pepIconSystemBin,
|
|
283
|
-
pepIconNumberPlus
|
|
284
|
-
];
|
|
285
|
-
class PepDataViewBuilderModule {
|
|
286
|
-
constructor(pepIconRegistry) {
|
|
287
|
-
this.pepIconRegistry = pepIconRegistry;
|
|
288
|
-
this.pepIconRegistry.registerIcons(pepIcons);
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
PepDataViewBuilderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepDataViewBuilderModule, deps: [{ token: i1$1.PepIconRegistry }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
292
|
-
PepDataViewBuilderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.2", ngImport: i0, type: PepDataViewBuilderModule, declarations: [DataViewBuilderComponent, MenuDataViewComponent], imports: [CommonModule,
|
|
293
|
-
DragDropModule,
|
|
294
|
-
MatIconModule,
|
|
295
|
-
PepNgxLibModule,
|
|
296
|
-
PepButtonModule,
|
|
297
|
-
PepDialogModule,
|
|
298
|
-
PepIconModule,
|
|
299
|
-
PepMenuModule,
|
|
300
|
-
PepPageLayoutModule,
|
|
301
|
-
PepTextboxModule,
|
|
302
|
-
PepTopBarModule,
|
|
303
|
-
PepDraggableItemsModule], exports: [DataViewBuilderComponent] });
|
|
304
|
-
PepDataViewBuilderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepDataViewBuilderModule, providers: [DataViewBuilderService], imports: [CommonModule,
|
|
305
|
-
DragDropModule,
|
|
306
|
-
MatIconModule,
|
|
307
|
-
PepNgxLibModule,
|
|
308
|
-
PepButtonModule,
|
|
309
|
-
PepDialogModule,
|
|
310
|
-
PepIconModule,
|
|
311
|
-
PepMenuModule,
|
|
312
|
-
PepPageLayoutModule,
|
|
313
|
-
PepTextboxModule,
|
|
314
|
-
PepTopBarModule,
|
|
315
|
-
PepDraggableItemsModule] });
|
|
316
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepDataViewBuilderModule, decorators: [{
|
|
317
|
-
type: NgModule,
|
|
318
|
-
args: [{
|
|
319
|
-
declarations: [
|
|
320
|
-
DataViewBuilderComponent, MenuDataViewComponent
|
|
321
|
-
],
|
|
322
|
-
imports: [
|
|
323
|
-
CommonModule,
|
|
324
|
-
DragDropModule,
|
|
325
|
-
MatIconModule,
|
|
326
|
-
PepNgxLibModule,
|
|
327
|
-
PepButtonModule,
|
|
328
|
-
PepDialogModule,
|
|
329
|
-
PepIconModule,
|
|
330
|
-
PepMenuModule,
|
|
331
|
-
PepPageLayoutModule,
|
|
332
|
-
PepTextboxModule,
|
|
333
|
-
PepTopBarModule,
|
|
334
|
-
PepDraggableItemsModule,
|
|
335
|
-
],
|
|
336
|
-
exports: [DataViewBuilderComponent],
|
|
337
|
-
providers: [DataViewBuilderService]
|
|
338
|
-
}]
|
|
279
|
+
const pepIcons = [
|
|
280
|
+
pepIconSystemClose,
|
|
281
|
+
pepIconArrowDownAlt,
|
|
282
|
+
pepIconSystemBin,
|
|
283
|
+
pepIconNumberPlus
|
|
284
|
+
];
|
|
285
|
+
class PepDataViewBuilderModule {
|
|
286
|
+
constructor(pepIconRegistry) {
|
|
287
|
+
this.pepIconRegistry = pepIconRegistry;
|
|
288
|
+
this.pepIconRegistry.registerIcons(pepIcons);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
PepDataViewBuilderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepDataViewBuilderModule, deps: [{ token: i1$1.PepIconRegistry }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
292
|
+
PepDataViewBuilderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.2", ngImport: i0, type: PepDataViewBuilderModule, declarations: [DataViewBuilderComponent, MenuDataViewComponent], imports: [CommonModule,
|
|
293
|
+
DragDropModule,
|
|
294
|
+
MatIconModule,
|
|
295
|
+
PepNgxLibModule,
|
|
296
|
+
PepButtonModule,
|
|
297
|
+
PepDialogModule,
|
|
298
|
+
PepIconModule,
|
|
299
|
+
PepMenuModule,
|
|
300
|
+
PepPageLayoutModule,
|
|
301
|
+
PepTextboxModule,
|
|
302
|
+
PepTopBarModule,
|
|
303
|
+
PepDraggableItemsModule], exports: [DataViewBuilderComponent] });
|
|
304
|
+
PepDataViewBuilderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepDataViewBuilderModule, providers: [DataViewBuilderService], imports: [CommonModule,
|
|
305
|
+
DragDropModule,
|
|
306
|
+
MatIconModule,
|
|
307
|
+
PepNgxLibModule,
|
|
308
|
+
PepButtonModule,
|
|
309
|
+
PepDialogModule,
|
|
310
|
+
PepIconModule,
|
|
311
|
+
PepMenuModule,
|
|
312
|
+
PepPageLayoutModule,
|
|
313
|
+
PepTextboxModule,
|
|
314
|
+
PepTopBarModule,
|
|
315
|
+
PepDraggableItemsModule] });
|
|
316
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepDataViewBuilderModule, decorators: [{
|
|
317
|
+
type: NgModule,
|
|
318
|
+
args: [{
|
|
319
|
+
declarations: [
|
|
320
|
+
DataViewBuilderComponent, MenuDataViewComponent
|
|
321
|
+
],
|
|
322
|
+
imports: [
|
|
323
|
+
CommonModule,
|
|
324
|
+
DragDropModule,
|
|
325
|
+
MatIconModule,
|
|
326
|
+
PepNgxLibModule,
|
|
327
|
+
PepButtonModule,
|
|
328
|
+
PepDialogModule,
|
|
329
|
+
PepIconModule,
|
|
330
|
+
PepMenuModule,
|
|
331
|
+
PepPageLayoutModule,
|
|
332
|
+
PepTextboxModule,
|
|
333
|
+
PepTopBarModule,
|
|
334
|
+
PepDraggableItemsModule,
|
|
335
|
+
],
|
|
336
|
+
exports: [DataViewBuilderComponent],
|
|
337
|
+
providers: [DataViewBuilderService]
|
|
338
|
+
}]
|
|
339
339
|
}], ctorParameters: function () { return [{ type: i1$1.PepIconRegistry }]; } });
|
|
340
340
|
|
|
341
|
-
/*
|
|
342
|
-
* Public API Surface of ngx-composite-lib/data-view-builder
|
|
341
|
+
/*
|
|
342
|
+
* Public API Surface of ngx-composite-lib/data-view-builder
|
|
343
343
|
*/
|
|
344
344
|
|
|
345
|
-
/**
|
|
346
|
-
* Generated bundle index. Do not edit.
|
|
345
|
+
/**
|
|
346
|
+
* Generated bundle index. Do not edit.
|
|
347
347
|
*/
|
|
348
348
|
|
|
349
349
|
export { DataViewBuilderComponent, PepDataViewBuilderModule };
|