@pepperi-addons/ngx-composite-lib 0.0.10-beta.4 → 0.0.10-beta.42
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/bundles/pepperi-addons-ngx-composite-lib-color-settings.umd.js +2 -1
- package/bundles/pepperi-addons-ngx-composite-lib-color-settings.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-composite-lib-dimx-export.umd.js +771 -0
- package/bundles/pepperi-addons-ngx-composite-lib-dimx-export.umd.js.map +1 -0
- package/bundles/pepperi-addons-ngx-composite-lib-file-status-panel.umd.js +119 -0
- package/bundles/pepperi-addons-ngx-composite-lib-file-status-panel.umd.js.map +1 -0
- package/bundles/pepperi-addons-ngx-composite-lib-generic-list.umd.js +493 -105
- package/bundles/pepperi-addons-ngx-composite-lib-generic-list.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-composite-lib-group-buttons-settings.umd.js +4 -1
- package/bundles/pepperi-addons-ngx-composite-lib-group-buttons-settings.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-composite-lib-shadow-settings.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-composite-lib.umd.js +586 -51
- package/bundles/pepperi-addons-ngx-composite-lib.umd.js.map +1 -1
- package/color-settings/package.json +0 -3
- package/core/common/directives/index.d.ts +1 -0
- package/core/common/directives/public-api.d.ts +1 -0
- package/core/common/directives/reset-configuration-field.directive.d.ts +38 -0
- package/core/common/index.d.ts +1 -0
- package/core/common/public-api.d.ts +2 -0
- package/core/common/services/index.d.ts +1 -0
- package/core/common/services/public-api.d.ts +1 -0
- package/core/common/services/utilities.service.d.ts +6 -0
- package/core/index.d.ts +1 -0
- package/core/public-api.d.ts +1 -0
- package/dimx-export/dimx.component.d.ts +73 -0
- package/dimx-export/dimx.model.d.ts +7 -0
- package/dimx-export/dimx.module.d.ts +15 -0
- package/dimx-export/dimx.service.d.ts +20 -0
- package/dimx-export/package.json +16 -0
- package/{draggable-item/pepperi-addons-ngx-composite-lib-draggable-item.d.ts → dimx-export/pepperi-addons-ngx-composite-lib-dimx-export.d.ts} +1 -1
- package/dimx-export/public-api.d.ts +3 -0
- package/esm2015/color-settings/color-settings.component.js +9 -8
- package/esm2015/color-settings/color-settings.model.js +1 -1
- package/esm2015/core/common/directives/index.js +5 -0
- package/esm2015/core/common/directives/public-api.js +5 -0
- package/esm2015/core/common/directives/reset-configuration-field.directive.js +153 -0
- package/esm2015/core/common/index.js +5 -0
- package/esm2015/core/common/public-api.js +6 -0
- package/esm2015/core/common/services/index.js +5 -0
- package/esm2015/core/common/services/public-api.js +5 -0
- package/esm2015/core/common/services/utilities.service.js +19 -0
- package/esm2015/core/index.js +5 -0
- package/esm2015/core/public-api.js +5 -0
- package/esm2015/dimx-export/dimx.component.js +241 -0
- package/esm2015/dimx-export/dimx.model.js +8 -0
- package/esm2015/dimx-export/dimx.module.js +49 -0
- package/esm2015/dimx-export/dimx.service.js +50 -0
- package/esm2015/dimx-export/pepperi-addons-ngx-composite-lib-dimx-export.js +5 -0
- package/esm2015/dimx-export/public-api.js +7 -0
- package/esm2015/file-status-panel/file-status-panel.component.js +34 -0
- package/esm2015/file-status-panel/file-status-panel.model.js +8 -0
- package/esm2015/file-status-panel/file-status-panel.module.js +40 -0
- package/esm2015/file-status-panel/pepperi-addons-ngx-composite-lib-file-status-panel.js +5 -0
- package/esm2015/file-status-panel/public-api.js +7 -0
- package/esm2015/generic-list/generic-list.component.js +337 -80
- package/esm2015/generic-list/generic-list.model.js +1 -1
- package/esm2015/generic-list/generic-list.module.js +18 -6
- package/esm2015/generic-list/generic-list.service.js +42 -0
- package/esm2015/generic-list/public-api.js +2 -1
- package/esm2015/group-buttons-settings/group-buttons-settings.component.js +5 -2
- package/esm2015/ngx-composite-lib.module.js +28 -9
- package/esm2015/public-api.js +2 -1
- package/esm2015/shadow-settings/shadow-settings.model.js +1 -1
- package/fesm2015/pepperi-addons-ngx-composite-lib-color-settings.js +8 -7
- package/fesm2015/pepperi-addons-ngx-composite-lib-color-settings.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-composite-lib-dimx-export.js +350 -0
- package/fesm2015/pepperi-addons-ngx-composite-lib-dimx-export.js.map +1 -0
- package/fesm2015/pepperi-addons-ngx-composite-lib-file-status-panel.js +90 -0
- package/fesm2015/pepperi-addons-ngx-composite-lib-file-status-panel.js.map +1 -0
- package/fesm2015/pepperi-addons-ngx-composite-lib-generic-list.js +391 -85
- package/fesm2015/pepperi-addons-ngx-composite-lib-generic-list.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-composite-lib-group-buttons-settings.js +4 -1
- package/fesm2015/pepperi-addons-ngx-composite-lib-group-buttons-settings.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-composite-lib-shadow-settings.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-composite-lib.js +225 -13
- package/fesm2015/pepperi-addons-ngx-composite-lib.js.map +1 -1
- package/file-status-panel/file-status-panel.component.d.ts +14 -0
- package/file-status-panel/file-status-panel.model.d.ts +6 -0
- package/file-status-panel/file-status-panel.module.d.ts +12 -0
- package/file-status-panel/package.json +10 -0
- package/file-status-panel/pepperi-addons-ngx-composite-lib-file-status-panel.d.ts +5 -0
- package/file-status-panel/public-api.d.ts +3 -0
- package/generic-list/generic-list.component.d.ts +68 -22
- package/generic-list/generic-list.model.d.ts +35 -5
- package/generic-list/generic-list.module.d.ts +2 -1
- package/generic-list/generic-list.service.d.ts +13 -0
- package/generic-list/package.json +0 -1
- package/generic-list/public-api.d.ts +1 -0
- package/group-buttons-settings/group-buttons-settings.component.d.ts +2 -1
- package/group-buttons-settings/package.json +0 -3
- package/ngx-composite-lib.module.d.ts +6 -1
- package/package.json +2 -2
- package/public-api.d.ts +1 -0
- package/shadow-settings/package.json +0 -3
- package/src/assets/i18n/en.ngx-composite-lib.json +5 -2
- package/src/core/style/abstracts/functions.scss +0 -0
- package/src/core/style/abstracts/mixins.scss +0 -0
- package/src/core/style/abstracts/variables.scss +0 -0
- package/src/core/style/base/helpers.scss +0 -0
- package/src/core/style/components/general.scss +0 -0
- package/styling.scss +11 -0
- package/bundles/pepperi-addons-ngx-composite-lib-draggable-item.umd.js +0 -112
- package/bundles/pepperi-addons-ngx-composite-lib-draggable-item.umd.js.map +0 -1
- package/draggable-item/draggable-item.component.d.ts +0 -11
- package/draggable-item/draggable-item.module.d.ts +0 -11
- package/draggable-item/package.json +0 -13
- package/draggable-item/public-api.d.ts +0 -2
- package/esm2015/draggable-item/draggable-item.component.js +0 -40
- package/esm2015/draggable-item/draggable-item.module.js +0 -36
- package/esm2015/draggable-item/pepperi-addons-ngx-composite-lib-draggable-item.js +0 -5
- package/esm2015/draggable-item/public-api.js +0 -6
- package/fesm2015/pepperi-addons-ngx-composite-lib-draggable-item.js +0 -84
- package/fesm2015/pepperi-addons-ngx-composite-lib-draggable-item.js.map +0 -1
- package/styles.scss +0 -38
|
@@ -1,62 +1,265 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, Component, ViewChild, Input, Output, NgModule } from '@angular/core';
|
|
3
|
-
import * as
|
|
2
|
+
import { Injectable, EventEmitter, ViewContainerRef, Component, ViewChild, Input, Output, NgModule } from '@angular/core';
|
|
3
|
+
import * as i9 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import { __awaiter } from 'tslib';
|
|
6
|
-
import * as
|
|
7
|
-
import { PepRowData, PepGuid, PepNgxLibModule } from '@pepperi-addons/ngx-lib';
|
|
8
|
-
import * as
|
|
9
|
-
import { PepListComponent, PepListModule } from '@pepperi-addons/ngx-lib/list';
|
|
6
|
+
import * as i2 from '@pepperi-addons/ngx-lib';
|
|
7
|
+
import { UIControl, PepRowData, PepGuid, PepNgxLibModule } from '@pepperi-addons/ngx-lib';
|
|
8
|
+
import * as i6 from '@pepperi-addons/ngx-lib/list';
|
|
9
|
+
import { PepListComponent, DEFAULT_PAGE_SIZE, PepSelectionData, PepListModule } from '@pepperi-addons/ngx-lib/list';
|
|
10
10
|
import { DataViewFieldTypes } from '@pepperi-addons/papi-sdk/dist/entities/data-view';
|
|
11
|
-
import
|
|
12
|
-
import
|
|
11
|
+
import { DataViewConverter } from '@pepperi-addons/data-views';
|
|
12
|
+
import { BehaviorSubject, Subscription } from 'rxjs';
|
|
13
|
+
import * as i3 from '@ngx-translate/core';
|
|
14
|
+
import * as i4 from '@pepperi-addons/ngx-lib/page-layout';
|
|
13
15
|
import { PepPageLayoutModule } from '@pepperi-addons/ngx-lib/page-layout';
|
|
14
|
-
import * as
|
|
16
|
+
import * as i5 from '@pepperi-addons/ngx-lib/top-bar';
|
|
15
17
|
import { PepTopBarModule } from '@pepperi-addons/ngx-lib/top-bar';
|
|
16
|
-
import * as
|
|
18
|
+
import * as i7 from '@pepperi-addons/ngx-lib/search';
|
|
17
19
|
import { PepSearchModule } from '@pepperi-addons/ngx-lib/search';
|
|
20
|
+
import * as i8 from '@pepperi-addons/ngx-lib/bread-crumbs';
|
|
21
|
+
import { PepBreadCrumbsModule } from '@pepperi-addons/ngx-lib/bread-crumbs';
|
|
18
22
|
import { PepFormModule } from '@pepperi-addons/ngx-lib/form';
|
|
19
23
|
import { PepMenuModule } from '@pepperi-addons/ngx-lib/menu';
|
|
20
24
|
|
|
25
|
+
//test
|
|
26
|
+
class PepGenericListService {
|
|
27
|
+
constructor() {
|
|
28
|
+
this._refresh$ = new BehaviorSubject(false);
|
|
29
|
+
this.refresh$ = this._refresh$.asObservable();
|
|
30
|
+
//
|
|
31
|
+
}
|
|
32
|
+
set pepList(val) {
|
|
33
|
+
this._pepList = val;
|
|
34
|
+
}
|
|
35
|
+
get pepList() {
|
|
36
|
+
return this._pepList;
|
|
37
|
+
}
|
|
38
|
+
getItemById(id) {
|
|
39
|
+
if (this._pepList) {
|
|
40
|
+
return this._pepList.getItemDataByID(id);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
getSelectedItems() {
|
|
47
|
+
if (this._pepList) {
|
|
48
|
+
return this._pepList.getSelectedItemsData();
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
PepGenericListService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: PepGenericListService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
56
|
+
PepGenericListService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: PepGenericListService, providedIn: 'root' });
|
|
57
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: PepGenericListService, decorators: [{
|
|
58
|
+
type: Injectable,
|
|
59
|
+
args: [{
|
|
60
|
+
providedIn: 'root'
|
|
61
|
+
}]
|
|
62
|
+
}], ctorParameters: function () { return []; } });
|
|
63
|
+
|
|
21
64
|
class GenericListComponent {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
this.
|
|
26
|
-
this.
|
|
27
|
-
this.
|
|
28
|
-
this.
|
|
29
|
-
|
|
65
|
+
constructor(_resolver, _genericListService, _dataConvertorService, _layoutService, _translate) {
|
|
66
|
+
this._resolver = _resolver;
|
|
67
|
+
this._genericListService = _genericListService;
|
|
68
|
+
this._dataConvertorService = _dataConvertorService;
|
|
69
|
+
this._layoutService = _layoutService;
|
|
70
|
+
this._translate = _translate;
|
|
71
|
+
this._dataSource = {
|
|
72
|
+
init: (params) => __awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
return {
|
|
74
|
+
dataView: {
|
|
75
|
+
Type: 'Grid'
|
|
76
|
+
},
|
|
77
|
+
totalCount: -1,
|
|
78
|
+
items: []
|
|
79
|
+
};
|
|
80
|
+
})
|
|
81
|
+
};
|
|
82
|
+
this.actions = {
|
|
83
|
+
get: (data) => __awaiter(this, void 0, void 0, function* () {
|
|
84
|
+
return [];
|
|
85
|
+
})
|
|
86
|
+
};
|
|
87
|
+
this.uuidMapping = 'key';
|
|
30
88
|
this.addPadding = false;
|
|
31
89
|
this.title = '';
|
|
32
90
|
this.inline = false;
|
|
33
91
|
this.showSearch = false;
|
|
34
|
-
this.
|
|
35
|
-
this.
|
|
36
|
-
this.allowMultipleSelection = false;
|
|
92
|
+
this.showTopBar = false;
|
|
93
|
+
this.breadCrumbsItems = new Array();
|
|
37
94
|
this.fieldClick = new EventEmitter();
|
|
38
|
-
|
|
39
|
-
|
|
95
|
+
this.valueChange = new EventEmitter();
|
|
96
|
+
this.breadCrumbItemClick = new EventEmitter();
|
|
97
|
+
this._resize$ = new Subscription();
|
|
98
|
+
this._dataView = {
|
|
99
|
+
Type: 'Grid'
|
|
100
|
+
};
|
|
101
|
+
this._tableInputs = {
|
|
102
|
+
supportSorting: false,
|
|
103
|
+
selectionType: 'single',
|
|
104
|
+
pager: {
|
|
105
|
+
type: 'scroll'
|
|
106
|
+
},
|
|
107
|
+
noDataFoundMsg: ''
|
|
108
|
+
};
|
|
109
|
+
this.totalRowCount = -1;
|
|
110
|
+
this.searchString = '';
|
|
111
|
+
this._sorting = undefined;
|
|
40
112
|
this.menuHandlers = {};
|
|
41
113
|
this.menuActions = [];
|
|
42
|
-
this.
|
|
43
|
-
//
|
|
114
|
+
this._resize$ = this._layoutService.onResize$.pipe().subscribe((size) => {
|
|
115
|
+
//
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
set pepListContainer(val) {
|
|
119
|
+
this._pepListContainer = val;
|
|
120
|
+
}
|
|
121
|
+
set dataSource(val) {
|
|
122
|
+
this._dataSource = val;
|
|
123
|
+
this.searchString = '';
|
|
124
|
+
this._sorting = undefined;
|
|
125
|
+
this.initTable();
|
|
126
|
+
}
|
|
127
|
+
set noDataFoundMsg(val) {
|
|
128
|
+
this._tableInputs.noDataFoundMsg = val;
|
|
129
|
+
}
|
|
130
|
+
set selectionType(val) {
|
|
131
|
+
this._tableInputs.selectionType = val;
|
|
132
|
+
}
|
|
133
|
+
set supportSorting(val) {
|
|
134
|
+
this._tableInputs.supportSorting = val;
|
|
135
|
+
}
|
|
136
|
+
set pager(val) {
|
|
137
|
+
this._tableInputs.pager = val;
|
|
138
|
+
}
|
|
139
|
+
set pepList(val) {
|
|
140
|
+
this._genericListService.pepList = val;
|
|
141
|
+
}
|
|
142
|
+
get pepList() {
|
|
143
|
+
return this._genericListService.pepList;
|
|
144
|
+
}
|
|
145
|
+
ngOnInit() {
|
|
146
|
+
//
|
|
147
|
+
}
|
|
148
|
+
initTable() {
|
|
149
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
150
|
+
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
151
|
+
var _a, _b, _c, _d, _e;
|
|
152
|
+
if (this._dataSource &&
|
|
153
|
+
this._pepListContainer) {
|
|
154
|
+
if (this._pepListContainer.length > 0) {
|
|
155
|
+
this._pepListContainer.remove();
|
|
156
|
+
}
|
|
157
|
+
const factory = this._resolver.resolveComponentFactory(PepListComponent);
|
|
158
|
+
const componentRef = this._pepListContainer.createComponent(factory);
|
|
159
|
+
this.pepList = componentRef.instance;
|
|
160
|
+
//merge selector inputs with callback inputs
|
|
161
|
+
const tableInputs = yield this.loadTableInputs();
|
|
162
|
+
const fromIndex = 0;
|
|
163
|
+
let toIndex = 0;
|
|
164
|
+
if (((_a = tableInputs.pager) === null || _a === void 0 ? void 0 : _a.type) === 'pages') {
|
|
165
|
+
toIndex = fromIndex + (((_b = tableInputs.pager) === null || _b === void 0 ? void 0 : _b.size) || DEFAULT_PAGE_SIZE) - 1;
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
toIndex = 100; //TO DO - get reesult from - this.customList.getTopItems()
|
|
169
|
+
}
|
|
170
|
+
const data = yield this.loadData(fromIndex, toIndex);
|
|
171
|
+
this.totalRowCount = (data === null || data === void 0 ? void 0 : data.totalCount) || 0;
|
|
172
|
+
componentRef.instance.viewType = 'table';
|
|
173
|
+
componentRef.instance.supportSorting = tableInputs.supportSorting;
|
|
174
|
+
componentRef.instance.selectionTypeForActions = tableInputs.selectionType;
|
|
175
|
+
componentRef.instance.pagerType = tableInputs.pager.type;
|
|
176
|
+
if (tableInputs.pager.type === 'pages') {
|
|
177
|
+
componentRef.instance.pageSize = ((_c = tableInputs.pager) === null || _c === void 0 ? void 0 : _c.size) || DEFAULT_PAGE_SIZE;
|
|
178
|
+
componentRef.instance.pageIndex = ((_d = tableInputs.pager) === null || _d === void 0 ? void 0 : _d.index) || 0;
|
|
179
|
+
}
|
|
180
|
+
componentRef.instance.noDataFoundMsg = tableInputs.noDataFoundMsg;
|
|
181
|
+
componentRef.instance.fieldClick.subscribe(($event) => {
|
|
182
|
+
this.onCustomizeFieldClick($event);
|
|
183
|
+
});
|
|
184
|
+
componentRef.instance.selectedItemsChange.subscribe(($event) => {
|
|
185
|
+
this.onSelectedItemsChanged($event);
|
|
186
|
+
});
|
|
187
|
+
componentRef.instance.loadItems.subscribe(($event) => {
|
|
188
|
+
this.onLoadItems($event);
|
|
189
|
+
});
|
|
190
|
+
componentRef.instance.loadPage.subscribe(($event) => {
|
|
191
|
+
this.onLoadPage($event);
|
|
192
|
+
});
|
|
193
|
+
componentRef.instance.valueChange.subscribe(($event) => {
|
|
194
|
+
this.onValueChanged($event);
|
|
195
|
+
});
|
|
196
|
+
componentRef.instance.sortingChange.subscribe(($event) => {
|
|
197
|
+
this.onSortingChange($event);
|
|
198
|
+
});
|
|
199
|
+
let convertedList = [];
|
|
200
|
+
if (data) {
|
|
201
|
+
if (((_e = data === null || data === void 0 ? void 0 : data.items) === null || _e === void 0 ? void 0 : _e.length) > 0) {
|
|
202
|
+
convertedList = this._dataConvertorService.convertListData(data.items);
|
|
203
|
+
}
|
|
204
|
+
const uiControl = this.getUiControl(DataViewConverter.toUIControlData(data.dataView));
|
|
205
|
+
componentRef.instance.initListData(uiControl, data.totalCount, convertedList);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}), 0);
|
|
44
209
|
});
|
|
45
210
|
}
|
|
211
|
+
/**
|
|
212
|
+
* checks if the object contains property
|
|
213
|
+
* @param obj object
|
|
214
|
+
* @param prop property name
|
|
215
|
+
* @returns true if contains, false otherwise
|
|
216
|
+
*/
|
|
217
|
+
hasProperty(obj, prop) {
|
|
218
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* loads callback inputs in case they are provided and merge with selector inputs
|
|
222
|
+
* @returns merged pep-list inputs
|
|
223
|
+
*/
|
|
224
|
+
loadTableInputs() {
|
|
225
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
226
|
+
const tableInputs = Object.assign({}, this._tableInputs);
|
|
227
|
+
if (this._dataSource.inputs) {
|
|
228
|
+
const inputs = yield this._dataSource.inputs();
|
|
229
|
+
if (inputs) {
|
|
230
|
+
Object.entries(inputs).forEach((item) => {
|
|
231
|
+
if (this.hasProperty(tableInputs, item[0])) {
|
|
232
|
+
tableInputs[item[0]] = item[1];
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
return tableInputs;
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
getUiControl(data) {
|
|
241
|
+
const uiControl = new UIControl();
|
|
242
|
+
uiControl.ControlFields = [];
|
|
243
|
+
if (data === null || data === void 0 ? void 0 : data.ControlFields) {
|
|
244
|
+
uiControl.ControlFields = data.ControlFields.map((field) => this.convertToUiControlField(field));
|
|
245
|
+
}
|
|
246
|
+
return uiControl;
|
|
247
|
+
}
|
|
46
248
|
loadMenuItems() {
|
|
47
|
-
if (this.
|
|
249
|
+
if (this._tableInputs.selectionType !== 'none') {
|
|
48
250
|
this.getMenuActions().then(x => this.menuActions = x);
|
|
49
251
|
}
|
|
50
252
|
}
|
|
51
253
|
convertToPepRowData(object, dataView) {
|
|
52
254
|
const row = new PepRowData();
|
|
255
|
+
row.UUID = object[this.uuidMapping] || undefined;
|
|
53
256
|
row.Fields = [];
|
|
54
257
|
if ((dataView === null || dataView === void 0 ? void 0 : dataView.Fields) && dataView.Columns) {
|
|
55
258
|
for (let index = 0; index < dataView.Fields.length; index++) {
|
|
56
|
-
|
|
259
|
+
const field = dataView.Fields[index];
|
|
57
260
|
row.Fields.push({
|
|
58
261
|
ApiName: field.FieldID,
|
|
59
|
-
Title: this.
|
|
262
|
+
Title: this._translate.instant(field.Title),
|
|
60
263
|
XAlignment: 1,
|
|
61
264
|
FormattedValue: (object[field.FieldID] || '').toString(),
|
|
62
265
|
Value: (object[field.FieldID] || '').toString(),
|
|
@@ -71,86 +274,169 @@ class GenericListComponent {
|
|
|
71
274
|
}
|
|
72
275
|
return row;
|
|
73
276
|
}
|
|
277
|
+
convertToUiControlField(field) {
|
|
278
|
+
return {
|
|
279
|
+
ApiName: field.ApiName,
|
|
280
|
+
FieldType: field.FieldType,
|
|
281
|
+
Title: field.Title,
|
|
282
|
+
ReadOnly: field.ReadOnlyField,
|
|
283
|
+
ColumnWidth: field.ColumnWidth,
|
|
284
|
+
ColumnWidthType: 1,
|
|
285
|
+
Layout: {
|
|
286
|
+
X: field.Layout.X,
|
|
287
|
+
Y: field.Layout.Y,
|
|
288
|
+
Width: field.Layout.Width,
|
|
289
|
+
Height: field.Layout.Field_Height,
|
|
290
|
+
XAlignment: field.Layout.xAlignment,
|
|
291
|
+
YAlignment: field.Layout.yAlignment,
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
}
|
|
74
295
|
getMenuActions() {
|
|
75
|
-
var _a;
|
|
76
296
|
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
-
const actions = yield ((_a = this.dataSource) === null || _a === void 0 ? void 0 : _a.getActions(this.getMenuObjects()));
|
|
78
297
|
const res = [];
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
-
this.menuHandlers
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
298
|
+
const result = this.getMenuObjects();
|
|
299
|
+
if (result.success) {
|
|
300
|
+
const actions = yield this.actions.get(result.data);
|
|
301
|
+
this.menuHandlers = {};
|
|
302
|
+
actions === null || actions === void 0 ? void 0 : actions.forEach(item => {
|
|
303
|
+
const uuid = PepGuid.newGuid();
|
|
304
|
+
this.menuHandlers[uuid] = item.handler;
|
|
305
|
+
res.push({
|
|
306
|
+
key: uuid,
|
|
307
|
+
text: item.title
|
|
308
|
+
});
|
|
86
309
|
});
|
|
87
|
-
}
|
|
310
|
+
}
|
|
88
311
|
return res;
|
|
89
312
|
});
|
|
90
313
|
}
|
|
91
314
|
getMenuObjects() {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
315
|
+
const menuObjects = {
|
|
316
|
+
success: false,
|
|
317
|
+
data: new PepSelectionData()
|
|
318
|
+
};
|
|
319
|
+
if (this.pepList) {
|
|
320
|
+
menuObjects.success = true;
|
|
321
|
+
menuObjects.data = this.pepList.getSelectedItemsData();
|
|
96
322
|
}
|
|
97
|
-
|
|
98
|
-
return objects;
|
|
323
|
+
return menuObjects;
|
|
99
324
|
}
|
|
100
|
-
|
|
101
|
-
|
|
325
|
+
onActionItemClicked(action) {
|
|
326
|
+
const result = this.getMenuObjects();
|
|
327
|
+
if (result.success) {
|
|
328
|
+
this.menuHandlers[action.source.key](result.data);
|
|
329
|
+
}
|
|
102
330
|
}
|
|
103
|
-
|
|
331
|
+
onSearchChanged(event) {
|
|
332
|
+
this.searchString = event.value;
|
|
333
|
+
this.initTable();
|
|
104
334
|
}
|
|
105
|
-
|
|
106
|
-
|
|
335
|
+
onSelectedItemsChanged(selectedRowsCount) {
|
|
336
|
+
//loading menu items after pep-list selected items are updated
|
|
337
|
+
setTimeout(() => {
|
|
338
|
+
this.loadMenuItems();
|
|
339
|
+
}, 0);
|
|
107
340
|
}
|
|
108
|
-
|
|
109
|
-
this.
|
|
341
|
+
onCustomizeFieldClick(fieldClickEvent) {
|
|
342
|
+
this.fieldClick.emit(fieldClickEvent);
|
|
110
343
|
}
|
|
111
|
-
|
|
112
|
-
this.
|
|
113
|
-
|
|
344
|
+
onBreadCrumbItemClick(event) {
|
|
345
|
+
this.breadCrumbItemClick.emit(event);
|
|
346
|
+
}
|
|
347
|
+
onValueChanged(event) {
|
|
348
|
+
this.valueChange.emit(event);
|
|
349
|
+
}
|
|
350
|
+
onSortingChange(event) {
|
|
351
|
+
this._sorting = event;
|
|
352
|
+
this.initTable();
|
|
114
353
|
}
|
|
115
|
-
|
|
354
|
+
loadData(fromIndex, toIndex) {
|
|
355
|
+
var _a;
|
|
116
356
|
return __awaiter(this, void 0, void 0, function* () {
|
|
117
|
-
|
|
118
|
-
this.
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
357
|
+
const data = yield this._dataSource.init({
|
|
358
|
+
searchString: this.searchString || undefined,
|
|
359
|
+
sorting: this._sorting || undefined,
|
|
360
|
+
fromIndex: fromIndex,
|
|
361
|
+
toIndex: toIndex
|
|
362
|
+
});
|
|
363
|
+
if (data) {
|
|
364
|
+
this._dataView = data.dataView;
|
|
365
|
+
if (((_a = data.items) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
366
|
+
data.items = data.items.map(item => this.convertToPepRowData(item, data.dataView));
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
return data;
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
updateDataList(fromIndex, toIndex, pageIndex = undefined) {
|
|
373
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
374
|
+
if (this._dataSource.update) {
|
|
375
|
+
const dataList = yield this._dataSource.update({
|
|
376
|
+
searchString: this.searchString || undefined,
|
|
377
|
+
sorting: this._sorting || undefined,
|
|
378
|
+
fromIndex: fromIndex,
|
|
379
|
+
toIndex: toIndex,
|
|
380
|
+
pageIndex: pageIndex
|
|
126
381
|
});
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
382
|
+
if ((dataList === null || dataList === void 0 ? void 0 : dataList.length) > 0) {
|
|
383
|
+
return dataList.map(item => this.convertToPepRowData(item, this._dataView));
|
|
384
|
+
}
|
|
385
|
+
else {
|
|
386
|
+
return [];
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
else {
|
|
390
|
+
return [];
|
|
130
391
|
}
|
|
131
392
|
});
|
|
132
393
|
}
|
|
133
|
-
|
|
134
|
-
|
|
394
|
+
/**
|
|
395
|
+
* loads virtual scroll items from api
|
|
396
|
+
*/
|
|
397
|
+
onLoadItems(event) {
|
|
398
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
399
|
+
const list = yield this.updateDataList(event.fromIndex, event.toIndex);
|
|
400
|
+
const convertedList = this._dataConvertorService.convertListData(list);
|
|
401
|
+
this.pepList.updateItems(convertedList, event);
|
|
402
|
+
});
|
|
135
403
|
}
|
|
136
|
-
|
|
137
|
-
|
|
404
|
+
/**
|
|
405
|
+
* loads paging bulk from api
|
|
406
|
+
*/
|
|
407
|
+
onLoadPage(event) {
|
|
408
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
409
|
+
const fromIndex = event.pageIndex * event.pageSize;
|
|
410
|
+
const toIndex = Math.min(fromIndex + event.pageSize - 1, this.totalRowCount - 1);
|
|
411
|
+
const list = yield this.updateDataList(fromIndex, toIndex, event.pageIndex);
|
|
412
|
+
const convertedList = this._dataConvertorService.convertListData(list);
|
|
413
|
+
this.pepList.updatePage(convertedList, event);
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
ngOnDestroy() {
|
|
417
|
+
if (this._resize$) {
|
|
418
|
+
this._resize$.unsubscribe();
|
|
419
|
+
}
|
|
138
420
|
}
|
|
139
421
|
}
|
|
140
|
-
GenericListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: GenericListComponent, deps: [{ token:
|
|
141
|
-
GenericListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.5", type: GenericListComponent, selector: "pep-generic-list", inputs: { dataSource: "dataSource", addPadding: "addPadding", title: "title", inline: "inline", showSearch: "showSearch",
|
|
422
|
+
GenericListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: GenericListComponent, deps: [{ token: i0.ComponentFactoryResolver }, { token: PepGenericListService }, { token: i2.PepDataConvertorService }, { token: i2.PepLayoutService }, { token: i3.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
423
|
+
GenericListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.5", type: GenericListComponent, selector: "pep-generic-list", inputs: { dataSource: "dataSource", actions: "actions", uuidMapping: "uuidMapping", addPadding: "addPadding", title: "title", inline: "inline", showSearch: "showSearch", noDataFoundMsg: "noDataFoundMsg", selectionType: "selectionType", supportSorting: "supportSorting", pager: "pager", showTopBar: "showTopBar", breadCrumbsItems: "breadCrumbsItems" }, outputs: { fieldClick: "fieldClick", valueChange: "valueChange", breadCrumbItemClick: "breadCrumbItemClick" }, viewQueries: [{ propertyName: "pepListContainer", first: true, predicate: ["pepListContainer"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<div *ngIf=\"inline\" class=\"inline-container\" [ngClass]=\"{ 'add-padding': addPadding }\">\n <div>\n <div *ngIf=\"showTopBar\" class=\"inline-top-bar-container\">\n <ng-container *ngTemplateOutlet=\"topBarTemplate\"></ng-container>\n </div>\n <ng-container *ngIf=\"breadCrumbsItems.length > 0\">\n <ng-container *ngTemplateOutlet=\"breadCrumbsTemplate\"></ng-container>\n </ng-container>\n </div>\n <ng-container *ngTemplateOutlet=\"listTemplate\"></ng-container>\n</div>\n\n<pep-page-layout *ngIf=\"!inline\" [addPadding]=\"addPadding\">\n <ng-container *ngIf=\"showTopBar\" pep-top-area>\n <ng-container *ngTemplateOutlet=\"topBarTemplate\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"breadCrumbsItems.length > 0\" pep-top-area>\n <ng-container *ngTemplateOutlet=\"breadCrumbsTemplate\"></ng-container>\n </ng-container>\n <div pep-main-area class=\"main-area-container\">\n <ng-container *ngTemplateOutlet=\"listTemplate\"></ng-container>\n </div>\n</pep-page-layout>\n\n<ng-template #topBarTemplate>\n <pep-top-bar [title]=\"title\" [inline]=\"inline\">\n <div header-start-content>\n <ng-content select=\"[left-buttons]\"></ng-content>\n </div>\n <div header-end-content>\n <ng-content select=\"[right-buttons]\"></ng-content>\n </div>\n\n <pep-list-actions *ngIf=\"menuActions.length > 0\" [sizeType]=\"inline ? 'sm' : 'md'\" [actions]=\"menuActions\"\n (actionClick)=\"onActionItemClicked($event)\"></pep-list-actions>\n <pep-list-total [sizeType]=\"inline ? 'sm' : 'md'\" [totalRows]=\"totalRowCount\">\n </pep-list-total>\n\n <pep-search *ngIf=\"showSearch\" [value]=\"searchString\" [sizeType]=\"inline ? 'sm' : 'md'\"\n (search)=\"onSearchChanged($event)\">\n </pep-search>\n </pep-top-bar>\n</ng-template>\n\n<ng-template #breadCrumbsTemplate>\n <pep-bread-crumbs class=\"bread-crumbs\" [items]=\"breadCrumbsItems\" [addSpacing]=\"true\" [displayType]=\"'items'\"\n (itemClick)=\"onBreadCrumbItemClick($event)\"></pep-bread-crumbs>\n</ng-template>\n\n<ng-template #listTemplate>\n <div class=\"list-container\">\n <ng-container #pepListContainer></ng-container>\n </div>\n</ng-template>", styles: [":host{height:inherit;display:block}.main-area-container{display:grid;height:inherit}.list-container{height:100%}.inline-container{height:inherit;display:grid;grid-template-rows:auto 1fr}.inline-container.add-padding{padding-inline:var(--pep-spacing-lg, 1rem)}.noDataFoundMsg{height:100%;width:100%;background:rgba(26,26,26,.12);display:flex;justify-content:center;align-items:center}.bread-crumbs{padding:var(--pep-spacing-lg, 1rem) 0 var(--pep-spacing-sm, .5rem) 0}\n"], components: [{ type: i4.PepPageLayoutComponent, selector: "pep-page-layout", inputs: ["addPadding", "showShadow"] }, { type: i5.PepTopBarComponent, selector: "pep-top-bar", inputs: ["inline", "title"], outputs: ["footerStateChange"] }, { type: i6.PepListActionsComponent, selector: "pep-list-actions", inputs: ["actions", "sizeType", "xPosition", "hidden"], outputs: ["actionClick", "stateChange", "menuClick"] }, { type: i6.PepListTotalComponent, selector: "pep-list-total", inputs: ["totalRows", "totalAmount", "isMapView", "sizeType"] }, { type: i7.PepSearchComponent, selector: "pep-search", inputs: ["triggerOn", "autoCompleteTop", "sizeType", "autoCompleteValues", "shrink", "value", "searchControl", "useAsWebComponent"], outputs: ["search", "autocompleteChange", "stateChange"] }, { type: i8.PepBreadCrumbsComponent, selector: "pep-bread-crumbs", inputs: ["addSpacing", "items", "displayType"], outputs: ["itemClick"] }], directives: [{ type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i9.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i9.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
142
424
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: GenericListComponent, decorators: [{
|
|
143
425
|
type: Component,
|
|
144
426
|
args: [{
|
|
145
427
|
selector: 'pep-generic-list',
|
|
146
428
|
templateUrl: './generic-list.component.html',
|
|
147
|
-
styleUrls: ['./generic-list.component.scss']
|
|
429
|
+
styleUrls: ['./generic-list.component.scss']
|
|
148
430
|
}]
|
|
149
|
-
}], ctorParameters: function () { return [{ type:
|
|
431
|
+
}], ctorParameters: function () { return [{ type: i0.ComponentFactoryResolver }, { type: PepGenericListService }, { type: i2.PepDataConvertorService }, { type: i2.PepLayoutService }, { type: i3.TranslateService }]; }, propDecorators: { pepListContainer: [{
|
|
150
432
|
type: ViewChild,
|
|
151
|
-
args: [
|
|
433
|
+
args: ['pepListContainer', { read: ViewContainerRef }]
|
|
152
434
|
}], dataSource: [{
|
|
153
435
|
type: Input
|
|
436
|
+
}], actions: [{
|
|
437
|
+
type: Input
|
|
438
|
+
}], uuidMapping: [{
|
|
439
|
+
type: Input
|
|
154
440
|
}], addPadding: [{
|
|
155
441
|
type: Input
|
|
156
442
|
}], title: [{
|
|
@@ -159,14 +445,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImpor
|
|
|
159
445
|
type: Input
|
|
160
446
|
}], showSearch: [{
|
|
161
447
|
type: Input
|
|
162
|
-
}],
|
|
448
|
+
}], noDataFoundMsg: [{
|
|
449
|
+
type: Input
|
|
450
|
+
}], selectionType: [{
|
|
451
|
+
type: Input
|
|
452
|
+
}], supportSorting: [{
|
|
453
|
+
type: Input
|
|
454
|
+
}], pager: [{
|
|
163
455
|
type: Input
|
|
164
|
-
}],
|
|
456
|
+
}], showTopBar: [{
|
|
165
457
|
type: Input
|
|
166
|
-
}],
|
|
458
|
+
}], breadCrumbsItems: [{
|
|
167
459
|
type: Input
|
|
168
460
|
}], fieldClick: [{
|
|
169
461
|
type: Output
|
|
462
|
+
}], valueChange: [{
|
|
463
|
+
type: Output
|
|
464
|
+
}], breadCrumbItemClick: [{
|
|
465
|
+
type: Output
|
|
170
466
|
}] } });
|
|
171
467
|
|
|
172
468
|
class PepGenericListModule {
|
|
@@ -179,8 +475,11 @@ PepGenericListModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", ve
|
|
|
179
475
|
PepMenuModule,
|
|
180
476
|
PepPageLayoutModule,
|
|
181
477
|
PepTopBarModule,
|
|
182
|
-
PepSearchModule
|
|
183
|
-
|
|
478
|
+
PepSearchModule,
|
|
479
|
+
PepBreadCrumbsModule], exports: [GenericListComponent] });
|
|
480
|
+
PepGenericListModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: PepGenericListModule, providers: [
|
|
481
|
+
PepGenericListService
|
|
482
|
+
], imports: [[
|
|
184
483
|
CommonModule,
|
|
185
484
|
PepNgxLibModule,
|
|
186
485
|
PepListModule,
|
|
@@ -188,7 +487,8 @@ PepGenericListModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", ve
|
|
|
188
487
|
PepMenuModule,
|
|
189
488
|
PepPageLayoutModule,
|
|
190
489
|
PepTopBarModule,
|
|
191
|
-
PepSearchModule
|
|
490
|
+
PepSearchModule,
|
|
491
|
+
PepBreadCrumbsModule
|
|
192
492
|
]] });
|
|
193
493
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: PepGenericListModule, decorators: [{
|
|
194
494
|
type: NgModule,
|
|
@@ -204,9 +504,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImpor
|
|
|
204
504
|
PepMenuModule,
|
|
205
505
|
PepPageLayoutModule,
|
|
206
506
|
PepTopBarModule,
|
|
207
|
-
PepSearchModule
|
|
507
|
+
PepSearchModule,
|
|
508
|
+
PepBreadCrumbsModule
|
|
509
|
+
],
|
|
510
|
+
exports: [
|
|
511
|
+
GenericListComponent
|
|
208
512
|
],
|
|
209
|
-
|
|
513
|
+
providers: [
|
|
514
|
+
PepGenericListService
|
|
515
|
+
]
|
|
210
516
|
}]
|
|
211
517
|
}] });
|
|
212
518
|
|
|
@@ -218,5 +524,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImpor
|
|
|
218
524
|
* Generated bundle index. Do not edit.
|
|
219
525
|
*/
|
|
220
526
|
|
|
221
|
-
export { GenericListComponent, PepGenericListModule };
|
|
527
|
+
export { GenericListComponent, PepGenericListModule, PepGenericListService };
|
|
222
528
|
//# sourceMappingURL=pepperi-addons-ngx-composite-lib-generic-list.js.map
|