@genesislcap/grid-pro 14.199.0 → 14.199.2-alpha-6f7195d.0
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/README.md +117 -111
- package/dist/custom-elements.json +2741 -839
- package/dist/dts/datasource/base.datasource.d.ts +22 -6
- package/dist/dts/datasource/base.datasource.d.ts.map +1 -1
- package/dist/dts/datasource/base.types.d.ts +22 -0
- package/dist/dts/datasource/base.types.d.ts.map +1 -0
- package/dist/dts/datasource/server-side.datasource.d.ts +27 -83
- package/dist/dts/datasource/server-side.datasource.d.ts.map +1 -1
- package/dist/dts/datasource/server-side.grid-definitions.d.ts.map +1 -1
- package/dist/dts/datasource/server-side.resource-base.d.ts +55 -0
- package/dist/dts/datasource/server-side.resource-base.d.ts.map +1 -0
- package/dist/dts/datasource/server-side.resource-dataserver.d.ts +20 -0
- package/dist/dts/datasource/server-side.resource-dataserver.d.ts.map +1 -0
- package/dist/dts/datasource/server-side.resource-reqrep.d.ts +17 -0
- package/dist/dts/datasource/server-side.resource-reqrep.d.ts.map +1 -0
- package/dist/dts/grid-pro-genesis-datasource/grid-pro-genesis-datasource.d.ts +13 -13
- package/dist/dts/grid-pro-genesis-datasource/grid-pro-genesis-datasource.d.ts.map +1 -1
- package/dist/dts/grid-pro.d.ts +16 -2
- package/dist/dts/grid-pro.d.ts.map +1 -1
- package/dist/esm/datasource/base.datasource.js +80 -10
- package/dist/esm/datasource/base.types.js +1 -0
- package/dist/esm/datasource/client-side.grid-definitions.js +1 -1
- package/dist/esm/datasource/server-side.datasource.js +220 -396
- package/dist/esm/datasource/server-side.grid-definitions.js +42 -7
- package/dist/esm/datasource/server-side.resource-base.js +285 -0
- package/dist/esm/datasource/server-side.resource-dataserver.js +132 -0
- package/dist/esm/datasource/server-side.resource-reqrep.js +131 -0
- package/dist/esm/grid-pro-genesis-datasource/grid-pro-genesis-datasource.js +49 -57
- package/dist/esm/grid-pro.js +7 -4
- package/dist/grid-pro.api.json +21 -142
- package/dist/grid-pro.d.ts +77 -112
- package/docs/api/grid-pro.gridpro.addeventlistener.md +2 -2
- package/docs/api/grid-pro.gridpro.md +1 -1
- package/docs/api/grid-pro.gridprogenesisdatasource.deinit.md +5 -0
- package/docs/api/{grid-pro.gridprogenesisdatasource.auth.md → grid-pro.gridprogenesisdatasource.destroy.md} +9 -3
- package/docs/api/grid-pro.gridprogenesisdatasource.handleerrors.md +2 -2
- package/docs/api/grid-pro.gridprogenesisdatasource.md +2 -6
- package/docs/api/grid-pro.gridprogenesisdatasource.reset.md +1 -1
- package/docs/api-report.md +19 -68
- package/package.json +13 -13
- package/docs/api/grid-pro.gridprogenesisdatasource.datasource.md +0 -11
- package/docs/api/grid-pro.gridprogenesisdatasource.disablepolling.md +0 -11
- package/docs/api/grid-pro.gridprogenesisdatasource.pollinginterval.md +0 -11
- package/docs/api/grid-pro.gridprogenesisdatasource.request.md +0 -11
|
@@ -1,19 +1,31 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { DatasourceDefaults, DatasourceEventHandler, FieldTypeEnum, logger, ResourceType, } from '@genesislcap/foundation-comms';
|
|
2
|
+
import { Datasource, DatasourceDefaults, DatasourceEventHandler, FieldTypeEnum, logger, normaliseCriteria, ResourceType, } from '@genesislcap/foundation-comms';
|
|
3
3
|
import { Connect } from '@genesislcap/foundation-comms';
|
|
4
|
-
import { attr, observable } from '@microsoft/fast-element';
|
|
4
|
+
import { attr, observable, volatile } from '@microsoft/fast-element';
|
|
5
5
|
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
6
|
+
import { BehaviorSubject } from 'rxjs';
|
|
6
7
|
import { dateValueFormatter, dateTimeValueFormatter, getColumnType, getFilterByFieldType, } from '../grid-pro.definitions';
|
|
7
8
|
import { GridProRendererTypes } from '../grid-pro.types';
|
|
9
|
+
export const criteriaDelimiter = ';';
|
|
10
|
+
export const criteriaJoin = ' && ';
|
|
8
11
|
export class GenesisGridDatasourceElement extends DatasourceEventHandler(FoundationElement) {
|
|
9
12
|
constructor() {
|
|
10
13
|
super(...arguments);
|
|
11
14
|
this.isSnapshot = false;
|
|
12
15
|
this.maxRows = DatasourceDefaults.MAX_ROWS_250;
|
|
13
16
|
this.maxView = DatasourceDefaults.MAX_VIEW_1000;
|
|
14
|
-
this.movingView =
|
|
17
|
+
this.movingView = true;
|
|
15
18
|
this.reverse = false;
|
|
16
|
-
this.
|
|
19
|
+
this.pollingInterval = DatasourceDefaults.REQ_REP_POLLING_INTERVAL_MS;
|
|
20
|
+
this.disablePolling = false;
|
|
21
|
+
/**
|
|
22
|
+
* Attribute to set whether the REQUEST object should be automatically set up.
|
|
23
|
+
* @remarks Defaults to `true`. Only applies to REQUEST_SERVER (REQ-REP) resources.
|
|
24
|
+
* @privateRemarks To avoid breaking changes for now, once V15 is out this will be removed and the default behavior will be the same as `false` here.
|
|
25
|
+
*/
|
|
26
|
+
this.requestAutoSetup = true;
|
|
27
|
+
this.criteriaFromFilters = new Map();
|
|
28
|
+
this.update = new BehaviorSubject(new Map());
|
|
17
29
|
}
|
|
18
30
|
/* Returns the `row-id` attribute, depending on the resource type.
|
|
19
31
|
* @remarks Will favour the `row-id` attribute if set.
|
|
@@ -40,8 +52,50 @@ export class GenesisGridDatasourceElement extends DatasourceEventHandler(Foundat
|
|
|
40
52
|
? DatasourceDefaults.REQUEST_SERVER_ROW_ID
|
|
41
53
|
: DatasourceDefaults.DATASERVER_ROW_ID;
|
|
42
54
|
}
|
|
55
|
+
datasourceOptions() {
|
|
56
|
+
return {
|
|
57
|
+
// Common between DATASERVER and REQUEST_SERVER (REQ-REP)
|
|
58
|
+
resourceName: this.resourceName,
|
|
59
|
+
isSnapshot: this.isSnapshot,
|
|
60
|
+
criteria: this.buildCriteria(),
|
|
61
|
+
maxRows: +this.maxRows,
|
|
62
|
+
viewNumber: this.viewNumber,
|
|
63
|
+
// DATASERVER only
|
|
64
|
+
fields: this.fields,
|
|
65
|
+
maxView: +this.maxView,
|
|
66
|
+
movingView: this.movingView,
|
|
67
|
+
orderBy: this.orderBy,
|
|
68
|
+
reverse: this.reverse,
|
|
69
|
+
// REQUEST_SERVER only
|
|
70
|
+
disablePolling: this.disablePolling,
|
|
71
|
+
pollingInterval: this.pollingInterval,
|
|
72
|
+
request: this.request,
|
|
73
|
+
requestAutoSetup: this.requestAutoSetup,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
buildCriteria() {
|
|
77
|
+
var _a;
|
|
78
|
+
const initialCriteria = ((_a = this.criteria) === null || _a === void 0 ? void 0 : _a.split(criteriaDelimiter)) || [];
|
|
79
|
+
const criteria = initialCriteria.concat(Array.from(this.criteriaFromFilters.values()));
|
|
80
|
+
const normalisedCriteria = normaliseCriteria(criteria.join(criteriaJoin), criteriaDelimiter);
|
|
81
|
+
return normalisedCriteria ? normalisedCriteria : undefined;
|
|
82
|
+
}
|
|
83
|
+
setFilter(fieldName, newFilter) {
|
|
84
|
+
this.criteriaFromFilters.set(fieldName, newFilter);
|
|
85
|
+
this.update.next(this.criteriaFromFilters);
|
|
86
|
+
}
|
|
87
|
+
removeFilter(fieldName) {
|
|
88
|
+
this.criteriaFromFilters.delete(fieldName);
|
|
89
|
+
this.update.next(this.criteriaFromFilters);
|
|
90
|
+
}
|
|
91
|
+
get isRequestServer() {
|
|
92
|
+
var _a;
|
|
93
|
+
return ((_a = this.datasource.status) === null || _a === void 0 ? void 0 : _a.type) === ResourceType.REQUEST_SERVER;
|
|
94
|
+
}
|
|
95
|
+
// protected isRequestServer = false;
|
|
43
96
|
datasourceStatusChanged(prev, next) {
|
|
44
|
-
this.isRequestServer = next.type === ResourceType.REQUEST_SERVER;
|
|
97
|
+
// this.isRequestServer = next.type === ResourceType.REQUEST_SERVER;
|
|
98
|
+
// TODO: this is not triggered after first init :(
|
|
45
99
|
}
|
|
46
100
|
get agGrid() {
|
|
47
101
|
return this.parentElement;
|
|
@@ -50,6 +104,9 @@ export class GenesisGridDatasourceElement extends DatasourceEventHandler(Foundat
|
|
|
50
104
|
__decorate([
|
|
51
105
|
Connect
|
|
52
106
|
], GenesisGridDatasourceElement.prototype, "connect", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
Datasource
|
|
109
|
+
], GenesisGridDatasourceElement.prototype, "datasource", void 0);
|
|
53
110
|
__decorate([
|
|
54
111
|
observable
|
|
55
112
|
], GenesisGridDatasourceElement.prototype, "deferredGridOptions", void 0);
|
|
@@ -86,9 +143,27 @@ __decorate([
|
|
|
86
143
|
__decorate([
|
|
87
144
|
attr({ mode: 'boolean' })
|
|
88
145
|
], GenesisGridDatasourceElement.prototype, "reverse", void 0);
|
|
146
|
+
__decorate([
|
|
147
|
+
attr({ attribute: 'view-number' })
|
|
148
|
+
], GenesisGridDatasourceElement.prototype, "viewNumber", void 0);
|
|
149
|
+
__decorate([
|
|
150
|
+
attr({ attribute: 'polling-interval' })
|
|
151
|
+
], GenesisGridDatasourceElement.prototype, "pollingInterval", void 0);
|
|
152
|
+
__decorate([
|
|
153
|
+
attr({ mode: 'boolean', attribute: 'disable-polling' })
|
|
154
|
+
], GenesisGridDatasourceElement.prototype, "disablePolling", void 0);
|
|
155
|
+
__decorate([
|
|
156
|
+
observable
|
|
157
|
+
], GenesisGridDatasourceElement.prototype, "request", void 0);
|
|
158
|
+
__decorate([
|
|
159
|
+
attr({ mode: 'boolean', attribute: 'request-auto-setup' })
|
|
160
|
+
], GenesisGridDatasourceElement.prototype, "requestAutoSetup", void 0);
|
|
89
161
|
__decorate([
|
|
90
162
|
attr({ attribute: 'row-id' })
|
|
91
163
|
], GenesisGridDatasourceElement.prototype, "rowIdAttr", void 0);
|
|
164
|
+
__decorate([
|
|
165
|
+
volatile
|
|
166
|
+
], GenesisGridDatasourceElement.prototype, "isRequestServer", null);
|
|
92
167
|
/**
|
|
93
168
|
* The operation type for the {@link @genesislcap/grid-pro#GridProBaseDatasource.mapTransaction} method.
|
|
94
169
|
* @internal
|
|
@@ -270,8 +345,3 @@ export class GridProBaseDatasource extends GenesisGridDatasourceElement {
|
|
|
270
345
|
return mappedTransaction;
|
|
271
346
|
}
|
|
272
347
|
}
|
|
273
|
-
export class StreamBaseDatasource {
|
|
274
|
-
constructor() {
|
|
275
|
-
this.rowData = new Map();
|
|
276
|
-
}
|
|
277
|
-
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|