@genesislcap/grid-pro 14.199.2-alpha-0c81553.0 → 14.199.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +111 -117
- package/dist/custom-elements.json +841 -2743
- package/dist/dts/datasource/base.datasource.d.ts +6 -22
- package/dist/dts/datasource/base.datasource.d.ts.map +1 -1
- package/dist/dts/datasource/server-side.datasource.d.ts +83 -27
- 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/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 +2 -16
- package/dist/dts/grid-pro.d.ts.map +1 -1
- package/dist/esm/datasource/base.datasource.js +9 -79
- package/dist/esm/datasource/client-side.grid-definitions.js +1 -1
- package/dist/esm/datasource/server-side.datasource.js +396 -220
- package/dist/esm/datasource/server-side.grid-definitions.js +7 -42
- package/dist/esm/grid-pro-genesis-datasource/grid-pro-genesis-datasource.js +61 -55
- package/dist/esm/grid-pro.js +4 -7
- package/dist/grid-pro.api.json +142 -21
- package/dist/grid-pro.d.ts +112 -77
- 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.destroy.md → grid-pro.gridprogenesisdatasource.auth.md} +3 -9
- package/docs/api/grid-pro.gridprogenesisdatasource.datasource.md +11 -0
- package/docs/api/grid-pro.gridprogenesisdatasource.deinit.md +0 -5
- package/docs/api/grid-pro.gridprogenesisdatasource.disablepolling.md +11 -0
- package/docs/api/grid-pro.gridprogenesisdatasource.handleerrors.md +2 -2
- package/docs/api/grid-pro.gridprogenesisdatasource.md +6 -2
- package/docs/api/grid-pro.gridprogenesisdatasource.pollinginterval.md +11 -0
- package/docs/api/grid-pro.gridprogenesisdatasource.request.md +11 -0
- package/docs/api/grid-pro.gridprogenesisdatasource.reset.md +1 -1
- package/docs/api-report.md +68 -19
- package/package.json +13 -13
- package/dist/dts/datasource/base.types.d.ts +0 -22
- package/dist/dts/datasource/base.types.d.ts.map +0 -1
- package/dist/dts/datasource/server-side.resource-base.d.ts +0 -55
- package/dist/dts/datasource/server-side.resource-base.d.ts.map +0 -1
- package/dist/dts/datasource/server-side.resource-dataserver.d.ts +0 -20
- package/dist/dts/datasource/server-side.resource-dataserver.d.ts.map +0 -1
- package/dist/dts/datasource/server-side.resource-reqrep.d.ts +0 -17
- package/dist/dts/datasource/server-side.resource-reqrep.d.ts.map +0 -1
- package/dist/esm/datasource/base.types.js +0 -1
- package/dist/esm/datasource/server-side.resource-base.js +0 -285
- package/dist/esm/datasource/server-side.resource-dataserver.js +0 -132
- package/dist/esm/datasource/server-side.resource-reqrep.js +0 -131
package/docs/api-report.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
```ts
|
|
6
6
|
|
|
7
7
|
import { ActionMenuItem } from '@genesislcap/foundation-ui';
|
|
8
|
-
import {
|
|
8
|
+
import { Auth } from '@genesislcap/foundation-comms';
|
|
9
9
|
import { Binding } from '@microsoft/fast-element';
|
|
10
10
|
import { CaptureType } from '@microsoft/fast-element';
|
|
11
11
|
import { ColDef } from '@ag-grid-community/core';
|
|
@@ -24,6 +24,7 @@ import { DatasourceStatusChangedEvent } from '@genesislcap/foundation-comms';
|
|
|
24
24
|
import { DOMContainer } from '@genesislcap/foundation-utils';
|
|
25
25
|
import { ElementStyles } from '@microsoft/fast-element';
|
|
26
26
|
import { FieldMetadata } from '@genesislcap/foundation-comms';
|
|
27
|
+
import { FilteredDataServerResult } from '@genesislcap/foundation-comms';
|
|
27
28
|
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
28
29
|
import { FoundationElementRegistry } from '@microsoft/fast-foundation';
|
|
29
30
|
import { FoundationLayoutContainer } from '@genesislcap/foundation-utils';
|
|
@@ -37,19 +38,23 @@ import { ICellRendererComp } from '@ag-grid-community/core';
|
|
|
37
38
|
import { ICellRendererFunc } from '@ag-grid-community/core';
|
|
38
39
|
import { ICellRendererParams } from '@ag-grid-community/core';
|
|
39
40
|
import { InterfaceSymbol } from '@microsoft/fast-foundation';
|
|
40
|
-
import {
|
|
41
|
+
import type { IServerSideDatasource } from '@ag-grid-community/core';
|
|
42
|
+
import type { IServerSideGetRowsParams } from '@ag-grid-community/core';
|
|
43
|
+
import type { IServerSideRowModel } from '@ag-grid-community/core';
|
|
41
44
|
import { ITooltipComp } from '@ag-grid-community/core';
|
|
42
45
|
import { ITooltipParams } from '@ag-grid-community/core';
|
|
43
46
|
import { KVStorage } from '@genesislcap/foundation-comms';
|
|
44
47
|
import { LayoutCacheContainer } from '@genesislcap/foundation-utils';
|
|
45
48
|
import { Logger } from '@genesislcap/foundation-logger';
|
|
49
|
+
import { MetadataDetail } from '@genesislcap/foundation-comms';
|
|
46
50
|
import { OverrideFoundationElementDefinition } from '@microsoft/fast-foundation';
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import { RowNodeTransaction } from '@ag-grid-community/core';
|
|
51
|
+
import type { RowDataTransaction } from '@ag-grid-community/core';
|
|
52
|
+
import type { RowNodeTransaction } from '@ag-grid-community/core';
|
|
50
53
|
import type { ServerSideTransaction } from '@ag-grid-community/core';
|
|
51
|
-
import { ServerSideTransactionResult } from '@ag-grid-community/core';
|
|
54
|
+
import type { ServerSideTransactionResult } from '@ag-grid-community/core';
|
|
52
55
|
import { Session } from '@genesislcap/foundation-comms';
|
|
56
|
+
import { SocketObservable } from '@genesislcap/foundation-comms';
|
|
57
|
+
import { SocketSubscription } from '@genesislcap/foundation-comms';
|
|
53
58
|
import { Swatch } from '@microsoft/fast-components';
|
|
54
59
|
import { SwatchRGB } from '@microsoft/fast-components';
|
|
55
60
|
import { TextField } from '@genesislcap/foundation-ui';
|
|
@@ -804,7 +809,7 @@ export const GridOptionsConfig: InterfaceSymbol<GridOptionsConfig>;
|
|
|
804
809
|
export class GridPro extends GridPro_base {
|
|
805
810
|
constructor();
|
|
806
811
|
// (undocumented)
|
|
807
|
-
addEventListener(
|
|
812
|
+
addEventListener(type: any, listener: any, options?: boolean | AddEventListenerOptions): void;
|
|
808
813
|
addIndex: number;
|
|
809
814
|
// (undocumented)
|
|
810
815
|
agAttributeChangedCallback(attName: any, oldValue: any, newValue: any): void;
|
|
@@ -1023,25 +1028,33 @@ export class GridProGenesisDatasource extends GridProGenesisDatasource_base {
|
|
|
1023
1028
|
// (undocumented)
|
|
1024
1029
|
applyTransactionAsync(agTransaction: RowDataTransaction, callback?: (res: RowNodeTransaction) => void): void;
|
|
1025
1030
|
// (undocumented)
|
|
1031
|
+
auth: Auth;
|
|
1032
|
+
// (undocumented)
|
|
1026
1033
|
connectedCallback(): void;
|
|
1027
1034
|
// (undocumented)
|
|
1028
1035
|
criteriaChanged(oldCriteria: string, newCriteria: string): void;
|
|
1029
1036
|
// (undocumented)
|
|
1037
|
+
datasource: Datasource;
|
|
1038
|
+
// (undocumented)
|
|
1030
1039
|
deepClone(): Node;
|
|
1031
|
-
// @deprecated
|
|
1032
1040
|
deinit(): void;
|
|
1033
|
-
|
|
1041
|
+
// (undocumented)
|
|
1042
|
+
disablePolling: boolean;
|
|
1034
1043
|
// (undocumented)
|
|
1035
1044
|
disconnectedCallback(): void;
|
|
1036
1045
|
// (undocumented)
|
|
1037
|
-
handleErrors(
|
|
1046
|
+
handleErrors(message: string): void;
|
|
1038
1047
|
init(columnDefinitions?: ColDef[], columnStates?: ColumnState[]): Promise<void>;
|
|
1039
1048
|
// (undocumented)
|
|
1040
1049
|
keepColDefsOnClearRowData: boolean;
|
|
1050
|
+
// (undocumented)
|
|
1051
|
+
pollingInterval: number;
|
|
1041
1052
|
refreshRows(): void;
|
|
1042
1053
|
// (undocumented)
|
|
1043
1054
|
removeFilter(fieldName: string): void;
|
|
1044
1055
|
// (undocumented)
|
|
1056
|
+
request: any;
|
|
1057
|
+
// (undocumented)
|
|
1045
1058
|
requestChanged(oldRequest: string, newRequest: string): void;
|
|
1046
1059
|
// @deprecated
|
|
1047
1060
|
reset(): void;
|
|
@@ -1114,27 +1127,21 @@ export class GridProServerSideDatasource extends GridProServerSideDatasource_bas
|
|
|
1114
1127
|
// (undocumented)
|
|
1115
1128
|
deepClone(): Node;
|
|
1116
1129
|
// (undocumented)
|
|
1117
|
-
|
|
1130
|
+
deinit(): void;
|
|
1118
1131
|
// (undocumented)
|
|
1119
1132
|
disconnectedCallback(): void;
|
|
1120
1133
|
// (undocumented)
|
|
1121
|
-
init():
|
|
1122
|
-
liveUpdates: boolean;
|
|
1123
|
-
// (undocumented)
|
|
1124
|
-
onPaginationChanged(event: PaginationChangedEvent): void;
|
|
1134
|
+
init(): void;
|
|
1125
1135
|
// (undocumented)
|
|
1126
1136
|
pagination: boolean;
|
|
1127
1137
|
// (undocumented)
|
|
1128
1138
|
get params(): any;
|
|
1129
1139
|
// (undocumented)
|
|
1130
|
-
request: any;
|
|
1131
|
-
// (undocumented)
|
|
1132
1140
|
resourceNameChanged(oldValue: string, newValue: string): void;
|
|
1133
1141
|
// (undocumented)
|
|
1134
|
-
restart():
|
|
1142
|
+
restart(): void;
|
|
1135
1143
|
// (undocumented)
|
|
1136
1144
|
get rowModel(): IServerSideRowModel;
|
|
1137
|
-
zeroBasedViewNumber: boolean;
|
|
1138
1145
|
}
|
|
1139
1146
|
|
|
1140
1147
|
// @public (undocumented)
|
|
@@ -1358,6 +1365,48 @@ export interface StatePersistence {
|
|
|
1358
1365
|
// @internal
|
|
1359
1366
|
export const StatePersistence: InterfaceSymbol<StatePersistence>;
|
|
1360
1367
|
|
|
1368
|
+
// Warning: (ae-forgotten-export) The symbol "StreamBaseDatasource" needs to be exported by the entry point index.d.ts
|
|
1369
|
+
//
|
|
1370
|
+
// @alpha
|
|
1371
|
+
export class StreamDatasource extends StreamBaseDatasource implements IServerSideDatasource {
|
|
1372
|
+
constructor(options: StreamDatasourceOptions);
|
|
1373
|
+
// (undocumented)
|
|
1374
|
+
auth: Auth;
|
|
1375
|
+
// @internal
|
|
1376
|
+
client_ROWS_COUNT: number;
|
|
1377
|
+
// (undocumented)
|
|
1378
|
+
connect: Connect;
|
|
1379
|
+
// (undocumented)
|
|
1380
|
+
createDataserverStreamFunc: (existingParams?: any) => Promise<SocketObservable<FilteredDataServerResult>>;
|
|
1381
|
+
// (undocumented)
|
|
1382
|
+
dataserverStream: SocketObservable<FilteredDataServerResult>;
|
|
1383
|
+
// (undocumented)
|
|
1384
|
+
dataserverStreamSubscription: SocketSubscription;
|
|
1385
|
+
// (undocumented)
|
|
1386
|
+
deinit(): Promise<void>;
|
|
1387
|
+
// (undocumented)
|
|
1388
|
+
getRows(params: IServerSideGetRowsParams): Promise<void>;
|
|
1389
|
+
// (undocumented)
|
|
1390
|
+
resourceParams: any;
|
|
1391
|
+
// @internal
|
|
1392
|
+
server_ROWS_COUNT: number;
|
|
1393
|
+
// (undocumented)
|
|
1394
|
+
streamSourceRef: string;
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
// @alpha
|
|
1398
|
+
export type StreamDatasourceOptions = {
|
|
1399
|
+
createDataserverStreamFunc: (existingParams?: any) => Promise<SocketObservable<FilteredDataServerResult>>;
|
|
1400
|
+
resourceName: string;
|
|
1401
|
+
resourceParams?: any;
|
|
1402
|
+
resourceIndexes?: Map<string, [string]>;
|
|
1403
|
+
resourceColDefs?: MetadataDetail[];
|
|
1404
|
+
maxRows?: number;
|
|
1405
|
+
maxView?: number;
|
|
1406
|
+
rowId?: string;
|
|
1407
|
+
pagination?: boolean;
|
|
1408
|
+
};
|
|
1409
|
+
|
|
1361
1410
|
// @public
|
|
1362
1411
|
export class StringEditor extends FoundationElement implements ICellEditorComp {
|
|
1363
1412
|
// (undocumented)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/grid-pro",
|
|
3
3
|
"description": "Genesis Foundation AG Grid",
|
|
4
|
-
"version": "14.199.2
|
|
4
|
+
"version": "14.199.2",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
@@ -38,20 +38,20 @@
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@genesislcap/foundation-testing": "14.199.2
|
|
42
|
-
"@genesislcap/genx": "14.199.2
|
|
43
|
-
"@genesislcap/rollup-builder": "14.199.2
|
|
44
|
-
"@genesislcap/ts-builder": "14.199.2
|
|
45
|
-
"@genesislcap/uvu-playwright-builder": "14.199.2
|
|
46
|
-
"@genesislcap/vite-builder": "14.199.2
|
|
47
|
-
"@genesislcap/webpack-builder": "14.199.2
|
|
41
|
+
"@genesislcap/foundation-testing": "14.199.2",
|
|
42
|
+
"@genesislcap/genx": "14.199.2",
|
|
43
|
+
"@genesislcap/rollup-builder": "14.199.2",
|
|
44
|
+
"@genesislcap/ts-builder": "14.199.2",
|
|
45
|
+
"@genesislcap/uvu-playwright-builder": "14.199.2",
|
|
46
|
+
"@genesislcap/vite-builder": "14.199.2",
|
|
47
|
+
"@genesislcap/webpack-builder": "14.199.2",
|
|
48
48
|
"rimraf": "^5.0.0"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@genesislcap/foundation-comms": "14.199.2
|
|
52
|
-
"@genesislcap/foundation-logger": "14.199.2
|
|
53
|
-
"@genesislcap/foundation-ui": "14.199.2
|
|
54
|
-
"@genesislcap/foundation-utils": "14.199.2
|
|
51
|
+
"@genesislcap/foundation-comms": "14.199.2",
|
|
52
|
+
"@genesislcap/foundation-logger": "14.199.2",
|
|
53
|
+
"@genesislcap/foundation-ui": "14.199.2",
|
|
54
|
+
"@genesislcap/foundation-utils": "14.199.2",
|
|
55
55
|
"@microsoft/fast-colors": "^5.3.1",
|
|
56
56
|
"@microsoft/fast-components": "^2.30.6",
|
|
57
57
|
"@microsoft/fast-element": "^1.12.0",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"access": "public"
|
|
78
78
|
},
|
|
79
79
|
"customElements": "dist/custom-elements.json",
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "7e312ac8f65e7153b76119b4b0160fab945fcdf4"
|
|
81
81
|
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { SocketObservable, FilteredDataServerResult, MetadataDetail, RequestServerResult } from '@genesislcap/foundation-comms';
|
|
2
|
-
/**
|
|
3
|
-
* Type definition for configuration options used for streams.
|
|
4
|
-
* @remarks
|
|
5
|
-
* Used by {@link @genesislcap/grid-pro#StreamDatasource} constructor to configure options for the stream.
|
|
6
|
-
* @alpha
|
|
7
|
-
*/
|
|
8
|
-
export type ServerSideDatasourceOptions = {
|
|
9
|
-
createDataserverStreamFunc?: (existingParams?: any) => Promise<SocketObservable<FilteredDataServerResult>>;
|
|
10
|
-
createReqRepRequestFunc?: (existingParams?: any) => Promise<RequestServerResult>;
|
|
11
|
-
reloadResourceDataFunc?: (params: any) => Promise<void>;
|
|
12
|
-
resourceName: string;
|
|
13
|
-
resourceParams?: any;
|
|
14
|
-
resourceIndexes?: Map<string, [string]>;
|
|
15
|
-
resourceColDefs?: MetadataDetail[];
|
|
16
|
-
maxRows?: number;
|
|
17
|
-
maxView?: number;
|
|
18
|
-
rowId?: string;
|
|
19
|
-
pagination?: boolean;
|
|
20
|
-
zeroBasedViewNumber?: boolean;
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=base.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.types.d.ts","sourceRoot":"","sources":["../../../src/datasource/base.types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EACxB,cAAc,EACd,mBAAmB,EACpB,MAAM,+BAA+B,CAAC;AAEvC;;;;;GAKG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACxC,0BAA0B,CAAC,EAAE,CAC3B,cAAc,CAAC,EAAE,GAAG,KACjB,OAAO,CAAC,gBAAgB,CAAC,wBAAwB,CAAC,CAAC,CAAC;IACzD,uBAAuB,CAAC,EAAE,CAAC,cAAc,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACjF,sBAAsB,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,GAAG,CAAC;IACrB,eAAe,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IACxC,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;IAEnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAC"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { IServerSideDatasource, LoadSuccessParams, SetFilterModel, SortModelItem, IServerSideGetRowsParams } from '@ag-grid-community/core';
|
|
2
|
-
import { Auth, Connect, MetadataDetail, DatasourceOptions } from '@genesislcap/foundation-comms';
|
|
3
|
-
import { UUID } from '@genesislcap/foundation-utils';
|
|
4
|
-
import { ServerSideDatasourceOptions } from './base.types';
|
|
5
|
-
export declare class BaseServerSideDatasource implements IServerSideDatasource {
|
|
6
|
-
auth: Auth;
|
|
7
|
-
connect: Connect;
|
|
8
|
-
uuid: UUID;
|
|
9
|
-
protected rowId: string;
|
|
10
|
-
protected rowData: Map<string, any>;
|
|
11
|
-
reloadResourceDataFunc: (params: DatasourceOptions) => Promise<void>;
|
|
12
|
-
protected resourceName: string;
|
|
13
|
-
resourceParams: any;
|
|
14
|
-
protected resourceIndexes: Map<string, [string]>;
|
|
15
|
-
protected resourceColDefs: MetadataDetail[];
|
|
16
|
-
protected maxRows: number;
|
|
17
|
-
protected maxView: number;
|
|
18
|
-
protected pagination: boolean;
|
|
19
|
-
protected zeroBasedViewNumber: boolean;
|
|
20
|
-
sourceRef: string;
|
|
21
|
-
isNewPageSize: boolean;
|
|
22
|
-
lastSuccessRowData: LoadSuccessParams;
|
|
23
|
-
/**
|
|
24
|
-
* The number of rows in the grid. THIS DO NOT CONSIDER CRITERIA_MATCH scenarios.
|
|
25
|
-
* @internal
|
|
26
|
-
*/
|
|
27
|
-
serverRowsCount: number;
|
|
28
|
-
/**
|
|
29
|
-
* The number of rows in the grid. THIS IS A LOCAL COUNT CONSIDERING CONSIDER CRITERIA_MATCH scenarios.
|
|
30
|
-
* @internal
|
|
31
|
-
*/
|
|
32
|
-
clientRowsCount: number;
|
|
33
|
-
protected moreRows: boolean;
|
|
34
|
-
protected calculatedRowsCount: number;
|
|
35
|
-
protected currentSequenceId: any;
|
|
36
|
-
protected currentFilterModel: SetFilterModel;
|
|
37
|
-
protected originalCriteriaMatch: string | string[];
|
|
38
|
-
protected currentSortModel: SortModelItem[];
|
|
39
|
-
constructor(options: ServerSideDatasourceOptions);
|
|
40
|
-
getRows(params: IServerSideGetRowsParams<any, any>): void;
|
|
41
|
-
protected setupFilteringAndSorting(params: IServerSideGetRowsParams): Promise<void>;
|
|
42
|
-
destroy?(): void;
|
|
43
|
-
protected refreshDatasource(params: IServerSideGetRowsParams): Promise<void>;
|
|
44
|
-
protected getOrderByAndToBeSortedColIds(map: any, searchValue: any): {
|
|
45
|
-
orderBy: any;
|
|
46
|
-
toBeSorted: any[];
|
|
47
|
-
};
|
|
48
|
-
protected buildCriteriaMatchFromFilters(): string;
|
|
49
|
-
protected criteriaFromFilters(): string[];
|
|
50
|
-
protected getFiltersByType(filterType: string): string[];
|
|
51
|
-
protected getPageNumber(start: number, recordsPerPage: number, totalRecords: number, zeroBasedViewNumber?: boolean): number;
|
|
52
|
-
protected getCorrectRowCount(params: IServerSideGetRowsParams<any, any>): any;
|
|
53
|
-
protected get isNotFirstViewNumber(): boolean;
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=server-side.resource-base.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server-side.resource-base.d.ts","sourceRoot":"","sources":["../../../src/datasource/server-side.resource-base.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,wBAAwB,EACzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,IAAI,EACJ,OAAO,EACP,cAAc,EAEd,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAErD,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAE3D,qBAAa,wBAAyB,YAAW,qBAAqB;IAC9D,IAAI,EAAG,IAAI,CAAC;IACT,OAAO,EAAG,OAAO,CAAC;IACrB,IAAI,EAAG,IAAI,CAAC;IAElB,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAa;IAEhD,sBAAsB,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAErE,SAAS,CAAC,YAAY,EAAE,MAAM,CAAC;IAC/B,cAAc,EAAE,GAAG,CAAC;IACpB,SAAS,CAAC,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IACjD,SAAS,CAAC,eAAe,EAAE,cAAc,EAAE,CAAC;IAE5C,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC;IAC9B,SAAS,CAAC,mBAAmB,EAAE,OAAO,CAAC;IAEvC,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;IACvB,kBAAkB,EAAE,iBAAiB,CAAC;IAEtC;;;OAGG;IACH,eAAe,SAAK;IAEpB;;;OAGG;IACH,eAAe,SAAK;IAEpB,SAAS,CAAC,QAAQ,UAAS;IAC3B,SAAS,CAAC,mBAAmB,SAAK;IAClC,SAAS,CAAC,iBAAiB,MAAQ;IAEnC,SAAS,CAAC,kBAAkB,EAAE,cAAc,CAAC;IAC7C,SAAS,CAAC,qBAAqB,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACnD,SAAS,CAAC,gBAAgB,EAAE,aAAa,EAAE,CAAC;gBAEhC,OAAO,EAAE,2BAA2B;IAkBhD,OAAO,CAAC,MAAM,EAAE,wBAAwB,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI;cAIzC,wBAAwB,CAAC,MAAM,EAAE,wBAAwB;IA0EzE,OAAO,CAAC,IAAI,IAAI;cAWA,iBAAiB,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC;IASlF,SAAS,CAAC,6BAA6B,CAAC,GAAG,KAAA,EAAE,WAAW,KAAA;;;;IAWxD,SAAS,CAAC,6BAA6B,IAAI,MAAM;IAkBjD,SAAS,CAAC,mBAAmB,IAAI,MAAM,EAAE;IAoHzC,SAAS,CAAC,gBAAgB,CAAC,UAAU,EAAE,MAAM;IAM7C,SAAS,CAAC,aAAa,CACrB,KAAK,EAAE,MAAM,EACb,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,MAAM,EACpB,mBAAmB,UAAO;IAS5B,SAAS,CAAC,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,CAAC,GAAG,EAAE,GAAG,CAAC;IAiCvE,SAAS,KAAK,oBAAoB,IAAI,OAAO,CAE5C;CACF"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { IServerSideDatasource, IServerSideGetRowsParams } from '@ag-grid-community/core';
|
|
2
|
-
import { SocketObservable, FilteredDataServerResult, SocketSubscription } from '@genesislcap/foundation-comms';
|
|
3
|
-
import { ServerSideDatasourceOptions } from './base.types';
|
|
4
|
-
import { BaseServerSideDatasource } from './server-side.resource-base';
|
|
5
|
-
/**
|
|
6
|
-
* The DATASERVER IServerSideDatasource implementation, used for SSRM (Server-Side Row Model) in the grid.
|
|
7
|
-
* @alpha
|
|
8
|
-
*/
|
|
9
|
-
export declare class DataserverServerSideDatasource extends BaseServerSideDatasource implements IServerSideDatasource {
|
|
10
|
-
dataserverStream: SocketObservable<FilteredDataServerResult>;
|
|
11
|
-
dataserverStreamSubscription: SocketSubscription;
|
|
12
|
-
createDataserverStreamFunc: (existingParams?: any) => Promise<SocketObservable<FilteredDataServerResult>>;
|
|
13
|
-
constructor(options: ServerSideDatasourceOptions);
|
|
14
|
-
protected refreshDatasource(params: IServerSideGetRowsParams): Promise<void>;
|
|
15
|
-
getRows(params: IServerSideGetRowsParams): Promise<void>;
|
|
16
|
-
private applyServerSideData;
|
|
17
|
-
destroy(): Promise<void>;
|
|
18
|
-
private handleCurrentStreamLoad;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=server-side.resource-dataserver.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server-side.resource-dataserver.d.ts","sourceRoot":"","sources":["../../../src/datasource/server-side.resource-dataserver.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EAEzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EACxB,kBAAkB,EAKnB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAEvE;;;GAGG;AACH,qBAAa,8BACX,SAAQ,wBACR,YAAW,qBAAqB;IAEhC,gBAAgB,EAAE,gBAAgB,CAAC,wBAAwB,CAAC,CAAC;IAC7D,4BAA4B,EAAE,kBAAkB,CAAC;IACjD,0BAA0B,EAAE,CAC1B,cAAc,CAAC,EAAE,GAAG,KACjB,OAAO,CAAC,gBAAgB,CAAC,wBAAwB,CAAC,CAAC,CAAC;gBAE7C,OAAO,EAAE,2BAA2B;cAKhC,iBAAiB,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC;IAO5E,OAAO,CAAC,MAAM,EAAE,wBAAwB;IAkE9C,OAAO,CAAC,mBAAmB;IA0CrB,OAAO;IAOb,OAAO,CAAC,uBAAuB;CAYhC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { IServerSideDatasource, IServerSideGetRowsParams } from '@ag-grid-community/core';
|
|
2
|
-
import { RequestServerResult } from '@genesislcap/foundation-comms';
|
|
3
|
-
import { ServerSideDatasourceOptions } from './base.types';
|
|
4
|
-
import { BaseServerSideDatasource } from './server-side.resource-base';
|
|
5
|
-
/**
|
|
6
|
-
* The REQUEST_SERVER IServerSideDatasource implementation, used for SSRM (Server-Side Row Model) in the grid.
|
|
7
|
-
* @alpha
|
|
8
|
-
*/
|
|
9
|
-
export declare class ReqRepServerSideDatasource extends BaseServerSideDatasource implements IServerSideDatasource {
|
|
10
|
-
createReqRepRequestFunc: (existingParams?: any) => Promise<RequestServerResult>;
|
|
11
|
-
constructor(options: ServerSideDatasourceOptions);
|
|
12
|
-
getRows(params: IServerSideGetRowsParams): Promise<void>;
|
|
13
|
-
private applyServerSideData;
|
|
14
|
-
protected getCorrectRowCount(params: IServerSideGetRowsParams): number;
|
|
15
|
-
private handleCurrentStreamLoad;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=server-side.resource-reqrep.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server-side.resource-reqrep.d.ts","sourceRoot":"","sources":["../../../src/datasource/server-side.resource-reqrep.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EAEzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,mBAAmB,EAIpB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAEvE;;;GAGG;AACH,qBAAa,0BACX,SAAQ,wBACR,YAAW,qBAAqB;IAEhC,uBAAuB,EAAE,CAAC,cAAc,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;gBAEpE,OAAO,EAAE,2BAA2B;IAQ1C,OAAO,CAAC,MAAM,EAAE,wBAAwB;IAqD9C,OAAO,CAAC,mBAAmB;IA0C3B,SAAS,CAAC,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,GAAG,MAAM;IAqCtE,OAAO,CAAC,uBAAuB;CAmBhC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
import { __awaiter, __decorate } from "tslib";
|
|
2
|
-
import { Auth, Connect, logger, } from '@genesislcap/foundation-comms';
|
|
3
|
-
import { UUID } from '@genesislcap/foundation-utils';
|
|
4
|
-
import { getAvailableIndexes, getAvailableIndexFields } from '../utils';
|
|
5
|
-
export class BaseServerSideDatasource {
|
|
6
|
-
constructor(options) {
|
|
7
|
-
this.rowData = new Map();
|
|
8
|
-
/**
|
|
9
|
-
* The number of rows in the grid. THIS DO NOT CONSIDER CRITERIA_MATCH scenarios.
|
|
10
|
-
* @internal
|
|
11
|
-
*/
|
|
12
|
-
this.serverRowsCount = 0;
|
|
13
|
-
/**
|
|
14
|
-
* The number of rows in the grid. THIS IS A LOCAL COUNT CONSIDERING CONSIDER CRITERIA_MATCH scenarios.
|
|
15
|
-
* @internal
|
|
16
|
-
*/
|
|
17
|
-
this.clientRowsCount = 0;
|
|
18
|
-
this.moreRows = false;
|
|
19
|
-
this.calculatedRowsCount = 0;
|
|
20
|
-
this.currentSequenceId = null;
|
|
21
|
-
this.reloadResourceDataFunc = options.reloadResourceDataFunc;
|
|
22
|
-
this.resourceName = options.resourceName;
|
|
23
|
-
this.resourceParams = options.resourceParams;
|
|
24
|
-
this.originalCriteriaMatch = options.resourceParams.CRITERIA_MATCH;
|
|
25
|
-
this.resourceIndexes = options.resourceIndexes;
|
|
26
|
-
this.resourceColDefs = options.resourceColDefs;
|
|
27
|
-
this.maxRows = options.maxRows;
|
|
28
|
-
this.maxView = options.maxView;
|
|
29
|
-
this.rowId = options.rowId;
|
|
30
|
-
this.pagination = options.pagination;
|
|
31
|
-
this.zeroBasedViewNumber = options.zeroBasedViewNumber;
|
|
32
|
-
}
|
|
33
|
-
getRows(params) {
|
|
34
|
-
throw new Error('Method not implemented.');
|
|
35
|
-
}
|
|
36
|
-
setupFilteringAndSorting(params) {
|
|
37
|
-
var _a;
|
|
38
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
-
const filterModelBeingApplied = params.request.filterModel;
|
|
40
|
-
const filtersAreBeingApplied = Object.keys(filterModelBeingApplied).length > 0;
|
|
41
|
-
const filtersAreGettingCleaned = Object.keys(filterModelBeingApplied).length === 0;
|
|
42
|
-
const filterModelBeingAppliedDiffersFromCurrent = JSON.stringify(filterModelBeingApplied) !== JSON.stringify(this.currentFilterModel);
|
|
43
|
-
if (filterModelBeingAppliedDiffersFromCurrent || filtersAreBeingApplied) {
|
|
44
|
-
if (filtersAreGettingCleaned && this.currentFilterModel) {
|
|
45
|
-
this.currentFilterModel = null;
|
|
46
|
-
this.resourceParams.CRITERIA_MATCH = this.originalCriteriaMatch;
|
|
47
|
-
yield this.refreshDatasource(params);
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
else if (filterModelBeingAppliedDiffersFromCurrent && filtersAreBeingApplied) {
|
|
51
|
-
this.currentFilterModel = filterModelBeingApplied;
|
|
52
|
-
this.resourceParams.CRITERIA_MATCH = this.buildCriteriaMatchFromFilters();
|
|
53
|
-
yield this.refreshDatasource(params);
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
const toBeAppliedSortModel = params.request.sortModel;
|
|
58
|
-
if (((_a = this.currentSortModel) === null || _a === void 0 ? void 0 : _a.length) !== toBeAppliedSortModel.length ||
|
|
59
|
-
toBeAppliedSortModel.length > 0) {
|
|
60
|
-
if (toBeAppliedSortModel.length === 0 && this.currentSortModel) {
|
|
61
|
-
this.calculatedRowsCount = 0;
|
|
62
|
-
this.currentSortModel = null;
|
|
63
|
-
this.resourceParams.ORDER_BY = null;
|
|
64
|
-
this.resourceParams.REVERSE = null;
|
|
65
|
-
yield this.refreshDatasource(params);
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
else if (toBeAppliedSortModel.length > 0) {
|
|
69
|
-
this.currentSortModel = toBeAppliedSortModel;
|
|
70
|
-
const coldIdBeingSorted = toBeAppliedSortModel[0].colId; // Not allowing multiple sorts by user
|
|
71
|
-
const sortTypeBeingApplied = toBeAppliedSortModel[0].sort;
|
|
72
|
-
const orderByAndToBeSortedColIds = this.getOrderByAndToBeSortedColIds(this.resourceIndexes, coldIdBeingSorted);
|
|
73
|
-
if (!orderByAndToBeSortedColIds) {
|
|
74
|
-
this.calculatedRowsCount = 0;
|
|
75
|
-
const availableIndexes = getAvailableIndexes(this.resourceIndexes);
|
|
76
|
-
const availableIndexFields = getAvailableIndexFields(this.resourceIndexes);
|
|
77
|
-
logger.warn('The FIELD/column (${coldIdBeingSorted}) being sorted is not part of an INDEX, required for the [orderBy] operation. See https://learn.genesis.global/docs/database/data-types/index-entities/');
|
|
78
|
-
logger.debug('Available indexes:', availableIndexes);
|
|
79
|
-
logger.debug('Columns that can be sorted with the available indexes:', availableIndexFields);
|
|
80
|
-
params.fail();
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
else if (JSON.stringify(toBeAppliedSortModel) !== JSON.stringify(this.currentSortModel)) {
|
|
84
|
-
this.resourceParams.ORDER_BY = orderByAndToBeSortedColIds.orderBy;
|
|
85
|
-
this.resourceParams.REVERSE = sortTypeBeingApplied === 'desc' ? true : false;
|
|
86
|
-
yield this.refreshDatasource(params);
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
destroy() {
|
|
94
|
-
this.rowData = new Map();
|
|
95
|
-
this.clientRowsCount = 0;
|
|
96
|
-
this.calculatedRowsCount = 0;
|
|
97
|
-
this.serverRowsCount = 0;
|
|
98
|
-
this.currentSequenceId = 0;
|
|
99
|
-
this.moreRows = false;
|
|
100
|
-
this.sourceRef = undefined;
|
|
101
|
-
this.lastSuccessRowData = undefined;
|
|
102
|
-
}
|
|
103
|
-
refreshDatasource(params) {
|
|
104
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
105
|
-
yield this.destroy();
|
|
106
|
-
yield this.reloadResourceDataFunc({
|
|
107
|
-
criteria: this.resourceParams.CRITERIA_MATCH,
|
|
108
|
-
orderBy: this.resourceParams.ORDER_BY,
|
|
109
|
-
reverse: this.resourceParams.REVERSE,
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
getOrderByAndToBeSortedColIds(map, searchValue) {
|
|
114
|
-
for (const [key, value] of map.entries()) {
|
|
115
|
-
const searchIndex = value.findIndex((x) => x === searchValue);
|
|
116
|
-
if (searchIndex !== -1) {
|
|
117
|
-
const copy = [...value];
|
|
118
|
-
const toBeSorted = copy.splice(searchIndex, 1);
|
|
119
|
-
return { orderBy: key, toBeSorted };
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
buildCriteriaMatchFromFilters() {
|
|
124
|
-
this.resourceParams.CRITERIA_MATCH = this.originalCriteriaMatch;
|
|
125
|
-
if (this.resourceParams.CRITERIA_MATCH &&
|
|
126
|
-
typeof this.resourceParams.CRITERIA_MATCH === 'string') {
|
|
127
|
-
this.resourceParams.CRITERIA_MATCH = this.resourceParams.CRITERIA_MATCH.split(';');
|
|
128
|
-
}
|
|
129
|
-
if (!this.resourceParams.CRITERIA_MATCH) {
|
|
130
|
-
this.resourceParams.CRITERIA_MATCH = [];
|
|
131
|
-
}
|
|
132
|
-
const criteria = this.resourceParams.CRITERIA_MATCH.concat(this.criteriaFromFilters());
|
|
133
|
-
return criteria.join(' && ');
|
|
134
|
-
}
|
|
135
|
-
criteriaFromFilters() {
|
|
136
|
-
const filters = [];
|
|
137
|
-
this.getFiltersByType('text').forEach((k) => {
|
|
138
|
-
if (!this.currentFilterModel[k].filter &&
|
|
139
|
-
(this.currentFilterModel[k].type === 'false' || this.currentFilterModel[k].type === 'true')) {
|
|
140
|
-
filters.push(`${k} == ${this.currentFilterModel[k].type}`);
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
switch (this.currentFilterModel[k].type) {
|
|
144
|
-
case 'blank':
|
|
145
|
-
filters.push(`${k} == ''`);
|
|
146
|
-
break;
|
|
147
|
-
case 'contains':
|
|
148
|
-
filters.push(`Expr.containsIgnoreCase(${k}, '${this.currentFilterModel[k].filter}')`);
|
|
149
|
-
break;
|
|
150
|
-
case 'equals':
|
|
151
|
-
filters.push(`${k} == '${this.currentFilterModel[k].filter}'`);
|
|
152
|
-
break;
|
|
153
|
-
case 'notBlank':
|
|
154
|
-
filters.push(`${k} != ''`);
|
|
155
|
-
break;
|
|
156
|
-
case 'notEqual':
|
|
157
|
-
filters.push(`${k} != '${this.currentFilterModel[k].filter}'`);
|
|
158
|
-
break;
|
|
159
|
-
case 'wordStartsWith':
|
|
160
|
-
filters.push(`Expr.containsWordsStartingWithIgnoreCase(${k}, '${this.currentFilterModel[k].filter}')`);
|
|
161
|
-
break;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
this.getFiltersByType('number').forEach((k) => {
|
|
166
|
-
const value = this.currentFilterModel[k].filter;
|
|
167
|
-
const valueTwo = this.currentFilterModel[k].filterTo;
|
|
168
|
-
switch (this.currentFilterModel[k].type) {
|
|
169
|
-
case 'equals':
|
|
170
|
-
!isNaN(value) && filters.push(`${k} == ${value}`);
|
|
171
|
-
break;
|
|
172
|
-
case 'notEqual':
|
|
173
|
-
!isNaN(value) && filters.push(`${k} != ${value}`);
|
|
174
|
-
break;
|
|
175
|
-
case 'greaterThan':
|
|
176
|
-
!isNaN(value) && filters.push(`${k} > ${value}`);
|
|
177
|
-
break;
|
|
178
|
-
case 'greaterThanOrEqual':
|
|
179
|
-
!isNaN(value) && filters.push(`${k} >= ${value}`);
|
|
180
|
-
break;
|
|
181
|
-
case 'lessThan':
|
|
182
|
-
!isNaN(value) && filters.push(`${k} < ${value}`);
|
|
183
|
-
break;
|
|
184
|
-
case 'lessThanOrEqual':
|
|
185
|
-
!isNaN(value) && filters.push(`${k} <= ${value}`);
|
|
186
|
-
break;
|
|
187
|
-
case 'inRange':
|
|
188
|
-
!isNaN(value) &&
|
|
189
|
-
!isNaN(valueTwo) &&
|
|
190
|
-
filters.push(`${k} >= ${value} && ${k} <= ${valueTwo}`);
|
|
191
|
-
break;
|
|
192
|
-
case 'blank':
|
|
193
|
-
filters.push(`${k} == 0`);
|
|
194
|
-
break;
|
|
195
|
-
case 'notBlank':
|
|
196
|
-
filters.push(`${k} != 0`);
|
|
197
|
-
break;
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
this.getFiltersByType('date').forEach((k) => {
|
|
201
|
-
var _a, _b;
|
|
202
|
-
const dateFrom = (_a = this.currentFilterModel[k].dateFrom) === null || _a === void 0 ? void 0 : _a.replace(/-/g, '').replace('T', '-').split(' ')[0];
|
|
203
|
-
const dateTo = (_b = this.currentFilterModel[k].dateTo) === null || _b === void 0 ? void 0 : _b.replace(/-/g, '').replace('T', '-').split(' ')[0];
|
|
204
|
-
switch (this.currentFilterModel[k].type) {
|
|
205
|
-
case 'equals':
|
|
206
|
-
filters.push(`Expr.dateIsEqual(${k}, '${dateFrom}')`);
|
|
207
|
-
break;
|
|
208
|
-
case 'lessThan':
|
|
209
|
-
filters.push(`Expr.dateIsBefore(${k}, '${dateFrom}')`);
|
|
210
|
-
break;
|
|
211
|
-
case 'greaterThan':
|
|
212
|
-
filters.push(`Expr.dateIsAfter(${k}, '${dateFrom}')`);
|
|
213
|
-
break;
|
|
214
|
-
case 'inRange':
|
|
215
|
-
filters.push(`Expr.dateIsAfter(${k}, '${dateFrom}') && Expr.dateIsBefore(${k}, '${dateTo}')`);
|
|
216
|
-
break;
|
|
217
|
-
case 'isToday':
|
|
218
|
-
const now = new Date();
|
|
219
|
-
const year = now.getFullYear();
|
|
220
|
-
const month = (now.getMonth() + 1).toString().padStart(2, '0');
|
|
221
|
-
const day = now.getDate().toString().padStart(2, '0');
|
|
222
|
-
const todayStr = `${year}-${month}-${day} 00:00:00`;
|
|
223
|
-
filters.push(`Expr.dateIsEqual(${k}, '${todayStr}')`);
|
|
224
|
-
break;
|
|
225
|
-
case 'blank':
|
|
226
|
-
filters.push(`${k} == null`);
|
|
227
|
-
break;
|
|
228
|
-
case 'notBlank':
|
|
229
|
-
filters.push(`${k} != null`);
|
|
230
|
-
break;
|
|
231
|
-
}
|
|
232
|
-
});
|
|
233
|
-
return filters;
|
|
234
|
-
}
|
|
235
|
-
getFiltersByType(filterType) {
|
|
236
|
-
return Object.keys(this.currentFilterModel)
|
|
237
|
-
.filter((k) => this.resourceColDefs.findIndex((o) => o.NAME === k) !== -1)
|
|
238
|
-
.filter((k) => this.currentFilterModel[k].filterType === filterType);
|
|
239
|
-
}
|
|
240
|
-
getPageNumber(start, recordsPerPage, totalRecords, zeroBasedViewNumber = true) {
|
|
241
|
-
if (start > totalRecords) {
|
|
242
|
-
start = Math.floor((totalRecords - 1) / recordsPerPage) * recordsPerPage + 1;
|
|
243
|
-
}
|
|
244
|
-
const currentPageIndex = Math.ceil(start / recordsPerPage);
|
|
245
|
-
return zeroBasedViewNumber ? currentPageIndex : currentPageIndex + 1;
|
|
246
|
-
}
|
|
247
|
-
getCorrectRowCount(params) {
|
|
248
|
-
const currentLastRowNumber = params.request.endRow;
|
|
249
|
-
this.calculatedRowsCount = this.clientRowsCount || currentLastRowNumber;
|
|
250
|
-
const defaultCount = Math.min(this.serverRowsCount, this.maxView);
|
|
251
|
-
let rowCount;
|
|
252
|
-
if (this.pagination) {
|
|
253
|
-
rowCount = !this.resourceParams.CRITERIA_MATCH
|
|
254
|
-
? Math.min(this.serverRowsCount, this.maxView)
|
|
255
|
-
: undefined;
|
|
256
|
-
if (this.resourceParams.CRITERIA_MATCH) {
|
|
257
|
-
rowCount = defaultCount;
|
|
258
|
-
}
|
|
259
|
-
return rowCount;
|
|
260
|
-
}
|
|
261
|
-
if (currentLastRowNumber === this.serverRowsCount) {
|
|
262
|
-
rowCount = this.serverRowsCount;
|
|
263
|
-
}
|
|
264
|
-
else if (currentLastRowNumber > this.maxView ||
|
|
265
|
-
currentLastRowNumber > this.calculatedRowsCount) {
|
|
266
|
-
rowCount = Math.min(defaultCount, this.calculatedRowsCount);
|
|
267
|
-
}
|
|
268
|
-
else if (!this.moreRows && this.serverRowsCount > this.calculatedRowsCount) {
|
|
269
|
-
rowCount = this.calculatedRowsCount;
|
|
270
|
-
}
|
|
271
|
-
return rowCount;
|
|
272
|
-
}
|
|
273
|
-
get isNotFirstViewNumber() {
|
|
274
|
-
return this.zeroBasedViewNumber ? this.currentSequenceId > 0 : this.currentSequenceId > 1;
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
__decorate([
|
|
278
|
-
Auth
|
|
279
|
-
], BaseServerSideDatasource.prototype, "auth", void 0);
|
|
280
|
-
__decorate([
|
|
281
|
-
Connect
|
|
282
|
-
], BaseServerSideDatasource.prototype, "connect", void 0);
|
|
283
|
-
__decorate([
|
|
284
|
-
UUID
|
|
285
|
-
], BaseServerSideDatasource.prototype, "uuid", void 0);
|