@genesislcap/grid-pro 14.482.1 → 14.482.2-alpha-397d953.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/dist/custom-elements.json +841 -521
- package/dist/dts/datasource/server-side.datasource.d.ts.map +1 -1
- package/dist/dts/datasource/server-side.resource-base.d.ts +23 -2
- package/dist/dts/datasource/server-side.resource-base.d.ts.map +1 -1
- package/dist/dts/datasource/server-side.resource-dataserver.d.ts +32 -1
- package/dist/dts/datasource/server-side.resource-dataserver.d.ts.map +1 -1
- package/dist/dts/datasource/server-side.resource-reqrep.d.ts +1 -1
- package/dist/dts/datasource/server-side.resource-reqrep.d.ts.map +1 -1
- package/dist/dts/react.d.ts +9 -9
- package/dist/esm/datasource/server-side.datasource.js +13 -2
- package/dist/esm/datasource/server-side.resource-base.js +193 -135
- package/dist/esm/datasource/server-side.resource-dataserver.js +284 -28
- package/dist/esm/datasource/server-side.resource-reqrep.js +11 -5
- package/dist/react.cjs +6 -6
- package/dist/react.mjs +5 -5
- package/package.json +14 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-side.datasource.d.ts","sourceRoot":"","sources":["../../../src/datasource/server-side.datasource.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,UAAU,EACV,iBAAiB,EAYlB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAEL,cAAc,EAEf,MAAM,+BAA+B,CAAC;AAUvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;;;;;;;kBAoDb,CAAC;;;;;;;;8BAwBuD,CAAA,cACtF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAiBH,CAAH;4IAEkE,CAAA;wFAIL,CAAC;+IAOzC,CAAC;2FAEb,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAmCJ,CAAF;;;;;;;;;;;;;;;;;;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;IAIvC,QAAQ;CAGlB"}
|
|
@@ -45,6 +45,12 @@ export declare abstract class BaseServerSideDatasource implements IServerSideDat
|
|
|
45
45
|
protected moreRows: boolean;
|
|
46
46
|
protected calculatedRowsCount: number;
|
|
47
47
|
protected currentSequenceId: any;
|
|
48
|
+
/**
|
|
49
|
+
* Whether the corrective ROWS_COUNT snapshot() has resolved for the current CRITERIA_MATCH.
|
|
50
|
+
* Reset in destroy() so it re-resolves on filter/sort changes.
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
protected criteriaRowCountResolved: boolean;
|
|
48
54
|
protected currentFilterModel: SetFilterModel;
|
|
49
55
|
protected originalCriteriaMatch: string | string[];
|
|
50
56
|
protected currentSortModel: SortModelItem[];
|
|
@@ -67,15 +73,20 @@ export declare abstract class BaseServerSideDatasource implements IServerSideDat
|
|
|
67
73
|
/**
|
|
68
74
|
* Handles filtering setup for server-side datasources.
|
|
69
75
|
* Common logic used by both dataserver and req-rep implementations.
|
|
76
|
+
*
|
|
77
|
+
* @returns `true` when a filter change triggered {@link refreshDatasource} - the current
|
|
78
|
+
* getRows() request is then superseded and the caller must stop processing it.
|
|
70
79
|
*/
|
|
71
|
-
protected setupFiltering(params: IServerSideGetRowsParams): Promise<
|
|
80
|
+
protected setupFiltering(params: IServerSideGetRowsParams): Promise<boolean>;
|
|
72
81
|
/**
|
|
73
82
|
* Handles sorting setup. Must be implemented by each datasource type.
|
|
74
83
|
* Different datasource types have different sorting requirements:
|
|
75
84
|
* - Dataserver: Requires indexed columns
|
|
76
85
|
* - Req-rep: Can sort by any column
|
|
86
|
+
*
|
|
87
|
+
* @returns `true` when a sort change triggered a refresh (same contract as {@link setupFiltering}).
|
|
77
88
|
*/
|
|
78
|
-
protected abstract setupSorting(params: IServerSideGetRowsParams): Promise<
|
|
89
|
+
protected abstract setupSorting(params: IServerSideGetRowsParams): Promise<boolean>;
|
|
79
90
|
/**
|
|
80
91
|
* Legacy method that combines filtering and sorting.
|
|
81
92
|
* Kept for backward compatibility. New implementations should use setupFiltering and setupSorting directly.
|
|
@@ -91,6 +102,16 @@ export declare abstract class BaseServerSideDatasource implements IServerSideDat
|
|
|
91
102
|
};
|
|
92
103
|
protected buildCriteriaMatchFromFilters(): string;
|
|
93
104
|
protected criteriaFromFilters(): string[];
|
|
105
|
+
/**
|
|
106
|
+
* Builds a single criteria fragment for one filter model (flat per-column model or a
|
|
107
|
+
* multi-filter sub-model).
|
|
108
|
+
* @internal
|
|
109
|
+
*/
|
|
110
|
+
protected criteriaForSingleModel(k: string, model: any): string | null;
|
|
111
|
+
protected criteriaForTextModel(k: string, model: any): string | null;
|
|
112
|
+
protected criteriaForSetModel(k: string, model: any): string | null;
|
|
113
|
+
protected criteriaForNumberModel(k: string, model: any): string | null;
|
|
114
|
+
protected criteriaForDateModel(k: string, model: any): string | null;
|
|
94
115
|
protected getFiltersByType(filterType: string): string[];
|
|
95
116
|
protected getPageNumber(start: number, recordsPerPage: number, totalRecords?: number, zeroBasedViewNumber?: boolean): number;
|
|
96
117
|
protected getCorrectRowCount(params: IServerSideGetRowsParams<any, any>): any;
|
|
@@ -1 +1 @@
|
|
|
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;AACrD,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD;;;;;GAKG;AACH,8BAAsB,wBAAyB,YAAW,qBAAqB;IACvE,IAAI,EAAG,IAAI,CAAC;IAC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,cAAc,CAAC;IAC7C,SAAS,CAAC,qBAAqB,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACnD,SAAS,CAAC,gBAAgB,EAAE,aAAa,EAAE,CAAC;gBAEhC,OAAO,EAAE,2BAA2B;IAuBhD;;;;;OAKG;IACH,SAAS,CAAC,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG;IAS5C;;;;;OAKG;IACH,SAAS,CAAC,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAUzD,OAAO,CAAC,MAAM,EAAE,wBAAwB,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI;IAIzD
|
|
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;AACrD,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD;;;;;GAKG;AACH,8BAAsB,wBAAyB,YAAW,qBAAqB;IACvE,IAAI,EAAG,IAAI,CAAC;IACT,OAAO,EAAG,OAAO,CAAC;IACrB,IAAI,EAAG,IAAI,CAAC;IAElB,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAa;IAEtC,sBAAsB,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,gBAAgB,EAAE,CAAC,OAAO,EA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AM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM,GAAG,IAAI;IA4BpE,SAAS,CAAC,gBAAgB,CAAC,UAAU,EAAE,MAAM;IAM7C,SAAS,CAAC,aAAa,CACrB,KAAK,EAAE,MAAM,EACb,cAAc,EAAE,MAAM,EACtB,YAAY,CAAC,EAAE,MAAM,EACrB,mBAAmB,UAAO;IAS5B,SAAS,CAAC,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,CAAC,GAAG,EAAE,GAAG,CAAC;IAsCvE,SAAS,KAAK,oBAAoB,IAAI,OAAO,CAE5C;IAED,sHAAsH;IACtH,SAAS,CAAC,mBAAmB,CAAC,MAAM,EAAE,wBAAwB,GAAG,IAAI;IAWrE,uFAAuF;IACvF,SAAS,CAAC,4BAA4B,CACpC,MAAM,EAAE,wBAAwB,EAChC,cAAc,EAAE,iBAAiB,GAChC,IAAI;IAWP,SAAS,CAAC,qBAAqB,IAAI,IAAI;IAIvC,SAAS,CAAC,mBAAmB,IAAI,IAAI;IAIrC;;OAEG;IACH,SAAS,CAAC,sBAAsB,IAAI,UAAU;CAgB/C"}
|
|
@@ -7,18 +7,49 @@ import { BaseServerSideDatasource } from './server-side.resource-base';
|
|
|
7
7
|
* @beta
|
|
8
8
|
*/
|
|
9
9
|
export declare class DataserverServerSideDatasource extends BaseServerSideDatasource implements IServerSideDatasource {
|
|
10
|
+
/**
|
|
11
|
+
* Max time a non-paginated SSRM block may stay pending before the safety valve in
|
|
12
|
+
* getRows() resolves it with the rows accumulated so far.
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
private static readonly BLOCK_RESOLVE_TIMEOUT_MS;
|
|
16
|
+
/**
|
|
17
|
+
* Blocks awaiting stream messages. Settled blocks remove themselves; destroy() cancels
|
|
18
|
+
* (fails) the rest so AG Grid's concurrent-request slots are always released.
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
private pendingBlocks;
|
|
22
|
+
/**
|
|
23
|
+
* Highest absolute row index already handed to AG Grid this session (non-pagination).
|
|
24
|
+
* Live DELETEs below this watermark must not remove cache entries - see
|
|
25
|
+
* handleCurrentStreamLoad.
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
private deliveredRowCount;
|
|
10
29
|
dataserverStream: SocketObservable<FilteredDataServerResult>;
|
|
11
30
|
dataserverStreamSubscription: SocketSubscription;
|
|
12
31
|
createDataserverStreamFunc: (existingParams?: any) => Promise<SocketObservable<FilteredDataServerResult>>;
|
|
13
32
|
constructor(options: ServerSideDatasourceOptions);
|
|
14
33
|
refreshDatasource(params: DatasourceOptions): Promise<void>;
|
|
15
34
|
getRows(params: IServerSideGetRowsParams): Promise<void>;
|
|
35
|
+
/** @internal */
|
|
36
|
+
private cancelAllPendingBlocks;
|
|
37
|
+
/**
|
|
38
|
+
* Lazily attaches the single stream subscription for this datasource session.
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
private ensureStreamSubscription;
|
|
42
|
+
/**
|
|
43
|
+
* Fan-out: accumulate shared infinite-scroll state once, then notify each pending block.
|
|
44
|
+
* @internal
|
|
45
|
+
*/
|
|
46
|
+
private dispatchStreamMessage;
|
|
16
47
|
private applyServerSideData;
|
|
17
48
|
/**
|
|
18
49
|
* Dataserver-specific sorting setup that validates columns are part of an index.
|
|
19
50
|
* This is required because dataserver needs indexed columns for efficient sorting.
|
|
20
51
|
*/
|
|
21
|
-
protected setupSorting(params: IServerSideGetRowsParams): Promise<
|
|
52
|
+
protected setupSorting(params: IServerSideGetRowsParams): Promise<boolean>;
|
|
22
53
|
destroy(): Promise<void>;
|
|
23
54
|
private handleCurrentStreamLoad;
|
|
24
55
|
}
|
|
@@ -1 +1 @@
|
|
|
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,iBAAiB,EACjB,wBAAwB,EAGxB,gBAAgB,EAChB,kBAAkB,EAGnB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;
|
|
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,iBAAiB,EACjB,wBAAwB,EAGxB,gBAAgB,EAChB,kBAAkB,EAGnB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAYvE;;;GAGG;AACH,qBAAa,8BACX,SAAQ,wBACR,YAAW,qBAAqB;IAEhC;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,wBAAwB,CAAS;IAEzD;;;;OAIG;IACH,OAAO,CAAC,aAAa,CAAgC;IAErD;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB,CAAK;IAE9B,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;IAK1C,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAU3D,OAAO,CAAC,MAAM,EAAE,wBAAwB;IAsO9C,gBAAgB;IAChB,OAAO,CAAC,sBAAsB;IAQ9B;;;OAGG;IACH,OAAO,CAAC,wBAAwB;IAShC;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IAmC7B,OAAO,CAAC,mBAAmB;IAgE3B;;;OAGG;cACa,YAAY,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,OAAO,CAAC;IA2E1E,OAAO;IASb,OAAO,CAAC,uBAAuB;CAgDhC"}
|
|
@@ -74,7 +74,7 @@ export declare class ReqRepServerSideDatasource extends BaseServerSideDatasource
|
|
|
74
74
|
* Req-rep specific sorting setup that allows any column to be sorted
|
|
75
75
|
* (unlike dataserver which requires indexed columns only)
|
|
76
76
|
*/
|
|
77
|
-
protected setupSorting(params: IServerSideGetRowsParams): Promise<
|
|
77
|
+
protected setupSorting(params: IServerSideGetRowsParams): Promise<boolean>;
|
|
78
78
|
refreshDatasource(params: DatasourceOptions): Promise<void>;
|
|
79
79
|
destroy(): Promise<void>;
|
|
80
80
|
/**
|
|
@@ -1 +1 @@
|
|
|
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,EAInB,iBAAiB,EAGlB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAOvE;;;GAGG;AACH,qBAAa,0BACX,SAAQ,wBACR,YAAW,qBAAqB;IAEhC,uBAAuB,EAAE,CAAC,cAAc,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEhF;;;OAGG;IACH,OAAO,CAAC,sBAAsB,CAAC,CAG5B;IAEH;;OAEG;IACH,OAAO,CAAC,mBAAmB,CAAC,CAAwC;IAEpE;;OAEG;IACH,OAAO,CAAC,yBAAyB,CAAC,CAAqB;IAEvD;;;OAGG;IACH,OAAO,CAAC,uBAAuB,CAAC,CAAM;IAEtC;;OAEG;IACH,OAAO,CAAC,UAAU,CAAU;IAE5B;;OAEG;IACH,OAAO,CAAC,eAAe,CAAC,CAAwC;IAEhE;;OAEG;IACH,OAAO,CAAC,uBAAuB,CAAC,CAAa;IAE7C;;;OAGG;IACH,OAAO,CAAC,mBAAmB,CAAC,CAAgB;IAE5C;;;OAGG;IACH,OAAO,CAAC,qBAAqB,CAA8B;IAG3D,OAAO,CAAC,uBAAuB,CAAuB;IACtD,OAAO,CAAC,iBAAiB,CAAa;gBAE1B,OAAO,EAAE,2BAA2B;IA6B1C,OAAO,CAAC,MAAM,EAAE,wBAAwB;
|
|
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,EAInB,iBAAiB,EAGlB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAOvE;;;GAGG;AACH,qBAAa,0BACX,SAAQ,wBACR,YAAW,qBAAqB;IAEhC,uBAAuB,EAAE,CAAC,cAAc,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEhF;;;OAGG;IACH,OAAO,CAAC,sBAAsB,CAAC,CAG5B;IAEH;;OAEG;IACH,OAAO,CAAC,mBAAmB,CAAC,CAAwC;IAEpE;;OAEG;IACH,OAAO,CAAC,yBAAyB,CAAC,CAAqB;IAEvD;;;OAGG;IACH,OAAO,CAAC,uBAAuB,CAAC,CAAM;IAEtC;;OAEG;IACH,OAAO,CAAC,UAAU,CAAU;IAE5B;;OAEG;IACH,OAAO,CAAC,eAAe,CAAC,CAAwC;IAEhE;;OAEG;IACH,OAAO,CAAC,uBAAuB,CAAC,CAAa;IAE7C;;;OAGG;IACH,OAAO,CAAC,mBAAmB,CAAC,CAAgB;IAE5C;;;OAGG;IACH,OAAO,CAAC,qBAAqB,CAA8B;IAG3D,OAAO,CAAC,uBAAuB,CAAuB;IACtD,OAAO,CAAC,iBAAiB,CAAa;gBAE1B,OAAO,EAAE,2BAA2B;IA6B1C,OAAO,CAAC,MAAM,EAAE,wBAAwB;IAwC9C;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAwB9B;;OAEG;YACW,mBAAmB;IAsCjC;;;;;OAKG;IACH,OAAO,CAAC,qBAAqB;IAO7B,OAAO,CAAC,mBAAmB;IAoF3B,SAAS,CAAC,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,GAAG,MAAM;IA0BtE,OAAO,CAAC,uBAAuB;IAoB/B;;;OAGG;cACa,YAAY,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,OAAO,CAAC;IAgC1E,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAgB3D,OAAO;IAUb;;;;;;;;;;OAUG;YACW,mBAAmB;IAkCjC;;;;;;;;OAQG;IACH,OAAO,CAAC,oBAAoB;IAqB5B,OAAO,CAAC,mBAAmB;CAoB5B"}
|
package/dist/dts/react.d.ts
CHANGED
|
@@ -133,6 +133,15 @@ export declare const StringEditor: React.ForwardRefExoticComponent<
|
|
|
133
133
|
>;
|
|
134
134
|
export type StringEditorRef = StringEditorWC;
|
|
135
135
|
|
|
136
|
+
export declare const GridProColumn: React.ForwardRefExoticComponent<
|
|
137
|
+
React.PropsWithChildren<
|
|
138
|
+
Omit<PublicOf<GridProColumnWC>, 'children' | 'style'> &
|
|
139
|
+
HTMLWCProps & {
|
|
140
|
+
}
|
|
141
|
+
> & React.RefAttributes<GridProColumnWC>
|
|
142
|
+
>;
|
|
143
|
+
export type GridProColumnRef = GridProColumnWC;
|
|
144
|
+
|
|
136
145
|
export declare const ActionRenderer: React.ForwardRefExoticComponent<
|
|
137
146
|
React.PropsWithChildren<
|
|
138
147
|
Omit<PublicOf<ActionRendererWC>, 'children' | 'style'> &
|
|
@@ -205,15 +214,6 @@ export declare const AgTextRenderer: React.ForwardRefExoticComponent<
|
|
|
205
214
|
>;
|
|
206
215
|
export type AgTextRendererRef = AgTextRendererWC;
|
|
207
216
|
|
|
208
|
-
export declare const GridProColumn: React.ForwardRefExoticComponent<
|
|
209
|
-
React.PropsWithChildren<
|
|
210
|
-
Omit<PublicOf<GridProColumnWC>, 'children' | 'style'> &
|
|
211
|
-
HTMLWCProps & {
|
|
212
|
-
}
|
|
213
|
-
> & React.RefAttributes<GridProColumnWC>
|
|
214
|
-
>;
|
|
215
|
-
export type GridProColumnRef = GridProColumnWC;
|
|
216
|
-
|
|
217
217
|
export declare const GridProClientSideDatasource: React.ForwardRefExoticComponent<
|
|
218
218
|
React.PropsWithChildren<
|
|
219
219
|
Omit<PublicOf<GridProClientSideDatasourceWC>, 'children' | 'style'> &
|
|
@@ -178,18 +178,29 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
|
|
|
178
178
|
this.$emit(datasourceEventNames.cacheFilterConfig);
|
|
179
179
|
this.clearRowData(withoutColumnDefs);
|
|
180
180
|
this.setDisconnected(false);
|
|
181
|
-
// Emit event to refresh server side with purge
|
|
182
|
-
this.$emit(datasourceEventNames.refreshServerSide, { purge: true });
|
|
183
181
|
if (params) {
|
|
184
182
|
const options = Object.assign(Object.assign({}, this.datasourceOptions()), params);
|
|
185
183
|
const initOK = yield this.initializeDatasource(options, true, false);
|
|
186
184
|
if (!initOK) {
|
|
187
185
|
// Emit event to set server side datasource to null
|
|
188
186
|
this.$emit(datasourceEventNames.setServerSideDatasource, { datasource: null });
|
|
187
|
+
// Purge AG Grid's SSRM cache even on failure, otherwise the pre-filter rows linger
|
|
188
|
+
// on screen (clearRowData emits an empty remove transaction, which clears nothing).
|
|
189
|
+
// The datasource is now null, so the purge clears the display without re-invoking
|
|
190
|
+
// getRows() against a dead datasource.
|
|
191
|
+
this.$emit(datasourceEventNames.refreshServerSide, { purge: true });
|
|
189
192
|
logger.error('Genesis Datasource re-init failed on filtering/sorting.');
|
|
193
|
+
return;
|
|
190
194
|
}
|
|
195
|
+
// Purge AG Grid's SSRM cache only AFTER the re-init completed: the purge makes AG Grid
|
|
196
|
+
// re-invoke getRows() immediately, and purging before initializeDatasource let that
|
|
197
|
+
// call race the destroyed/half-initialized datasource (stale rows, broken first loads).
|
|
198
|
+
this.$emit(datasourceEventNames.refreshServerSide, { purge: true });
|
|
191
199
|
}
|
|
192
200
|
else {
|
|
201
|
+
// Full re-init path: init() re-creates the whole ssrmDatasource, so no race here -
|
|
202
|
+
// purge up-front as before.
|
|
203
|
+
this.$emit(datasourceEventNames.refreshServerSide, { purge: true });
|
|
193
204
|
if (this.ssrmDatasource) {
|
|
194
205
|
yield this.ssrmDatasource.destroy();
|
|
195
206
|
this.ssrmDatasource = undefined;
|
|
@@ -24,6 +24,12 @@ export class BaseServerSideDatasource {
|
|
|
24
24
|
this.moreRows = false;
|
|
25
25
|
this.calculatedRowsCount = 0;
|
|
26
26
|
this.currentSequenceId = null;
|
|
27
|
+
/**
|
|
28
|
+
* Whether the corrective ROWS_COUNT snapshot() has resolved for the current CRITERIA_MATCH.
|
|
29
|
+
* Reset in destroy() so it re-resolves on filter/sort changes.
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
this.criteriaRowCountResolved = false;
|
|
27
33
|
this.reloadResourceDataFunc = options.reloadResourceDataFunc;
|
|
28
34
|
this.errorHandlerFunc = options.errorHandlerFunc;
|
|
29
35
|
this.onNoDataAvailableFunc = options.onNoDataAvailableFunc;
|
|
@@ -79,6 +85,9 @@ export class BaseServerSideDatasource {
|
|
|
79
85
|
/**
|
|
80
86
|
* Handles filtering setup for server-side datasources.
|
|
81
87
|
* Common logic used by both dataserver and req-rep implementations.
|
|
88
|
+
*
|
|
89
|
+
* @returns `true` when a filter change triggered {@link refreshDatasource} - the current
|
|
90
|
+
* getRows() request is then superseded and the caller must stop processing it.
|
|
82
91
|
*/
|
|
83
92
|
setupFiltering(params) {
|
|
84
93
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -91,15 +100,18 @@ export class BaseServerSideDatasource {
|
|
|
91
100
|
this.currentFilterModel = null;
|
|
92
101
|
this.setResourceParam('CRITERIA_MATCH', this.originalCriteriaMatch);
|
|
93
102
|
yield this.refreshDatasource(params);
|
|
94
|
-
|
|
103
|
+
// The refresh re-initialized the datasource and purged AG Grid's SSRM cache, so
|
|
104
|
+
// getRows() is re-invoked with fresh params - this invocation is superseded.
|
|
105
|
+
return true;
|
|
95
106
|
}
|
|
96
107
|
else if (filterModelBeingAppliedDiffersFromCurrent && filtersAreBeingApplied) {
|
|
97
108
|
this.currentFilterModel = filterModelBeingApplied;
|
|
98
109
|
this.setResourceParam('CRITERIA_MATCH', this.buildCriteriaMatchFromFilters());
|
|
99
110
|
yield this.refreshDatasource(params);
|
|
100
|
-
return;
|
|
111
|
+
return true;
|
|
101
112
|
}
|
|
102
113
|
}
|
|
114
|
+
return false;
|
|
103
115
|
});
|
|
104
116
|
}
|
|
105
117
|
/**
|
|
@@ -122,6 +134,7 @@ export class BaseServerSideDatasource {
|
|
|
122
134
|
this.moreRows = false;
|
|
123
135
|
this.sourceRef = undefined;
|
|
124
136
|
this.lastSuccessRowData = undefined;
|
|
137
|
+
this.criteriaRowCountResolved = false;
|
|
125
138
|
}
|
|
126
139
|
refreshDatasource(params) {
|
|
127
140
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -173,142 +186,184 @@ export class BaseServerSideDatasource {
|
|
|
173
186
|
criteriaFromFilters() {
|
|
174
187
|
const filters = [];
|
|
175
188
|
this.getFiltersByType('text').forEach((k) => {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
filters.push(
|
|
179
|
-
}
|
|
180
|
-
else {
|
|
181
|
-
switch (this.currentFilterModel[k].type) {
|
|
182
|
-
case 'blank':
|
|
183
|
-
filters.push(`(${k} == '' || ${k} == null)`);
|
|
184
|
-
break;
|
|
185
|
-
case 'contains':
|
|
186
|
-
filters.push(`Expr.containsIgnoreCase(${k}, '${this.currentFilterModel[k].filter}')`);
|
|
187
|
-
break;
|
|
188
|
-
case 'equals':
|
|
189
|
-
filters.push(`${k} == '${this.currentFilterModel[k].filter}'`);
|
|
190
|
-
break;
|
|
191
|
-
case 'notBlank':
|
|
192
|
-
filters.push(`(${k} != '' && ${k} != null)`);
|
|
193
|
-
break;
|
|
194
|
-
case 'notEqual':
|
|
195
|
-
filters.push(`${k} != '${this.currentFilterModel[k].filter}'`);
|
|
196
|
-
break;
|
|
197
|
-
case 'wordStartsWith':
|
|
198
|
-
filters.push(`Expr.containsWordsStartingWithIgnoreCase(${k}, '${this.currentFilterModel[k].filter}')`);
|
|
199
|
-
break;
|
|
200
|
-
}
|
|
189
|
+
const fragment = this.criteriaForSingleModel(k, this.currentFilterModel[k]);
|
|
190
|
+
if (fragment) {
|
|
191
|
+
filters.push(fragment);
|
|
201
192
|
}
|
|
202
193
|
});
|
|
203
|
-
// TODO: Handle multi filters if we decide we want to use them in SSRM
|
|
204
194
|
// Handle set filters (typically used for enum fields with ag-set-column-filter)
|
|
205
195
|
this.getFiltersByType('set').forEach((k) => {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
if (!selectedValues || selectedValues.length === 0) {
|
|
210
|
-
// Nothing selected means no additional criteria
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
// Try to detect "all values selected" using VALID_VALUES from metadata.
|
|
214
|
-
// In that case we don't want to send any criteria, as it would be equivalent
|
|
215
|
-
// to no filter at all.
|
|
216
|
-
const colMeta = (_c = this.resourceColDefs) === null || _c === void 0 ? void 0 : _c.find((o) => o.NAME === k);
|
|
217
|
-
let allValues;
|
|
218
|
-
if (colMeta === null || colMeta === void 0 ? void 0 : colMeta.VALID_VALUES) {
|
|
219
|
-
try {
|
|
220
|
-
allValues = Array.isArray(colMeta.VALID_VALUES)
|
|
221
|
-
? colMeta.VALID_VALUES
|
|
222
|
-
: colMeta.VALID_VALUES.split('|');
|
|
223
|
-
}
|
|
224
|
-
catch (_d) {
|
|
225
|
-
allValues = undefined;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
if (allValues &&
|
|
229
|
-
allValues.length === selectedValues.length &&
|
|
230
|
-
allValues.every((v) => selectedValues.includes(v))) {
|
|
231
|
-
// All enum options are selected – skip adding criteria for this column
|
|
232
|
-
return;
|
|
233
|
-
}
|
|
234
|
-
const orConditions = selectedValues.map((val) => {
|
|
235
|
-
const safeVal = String(val).replace(/'/g, "\\'");
|
|
236
|
-
return `${k} == '${safeVal}'`;
|
|
237
|
-
});
|
|
238
|
-
if (orConditions.length > 0) {
|
|
239
|
-
filters.push(`(${orConditions.join(' || ')})`);
|
|
196
|
+
const fragment = this.criteriaForSingleModel(k, this.currentFilterModel[k]);
|
|
197
|
+
if (fragment) {
|
|
198
|
+
filters.push(fragment);
|
|
240
199
|
}
|
|
241
200
|
});
|
|
242
201
|
this.getFiltersByType('number').forEach((k) => {
|
|
243
|
-
const
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
case 'equals':
|
|
247
|
-
!isNaN(value) && filters.push(`${k} == ${value}`);
|
|
248
|
-
break;
|
|
249
|
-
case 'notEqual':
|
|
250
|
-
!isNaN(value) && filters.push(`${k} != ${value}`);
|
|
251
|
-
break;
|
|
252
|
-
case 'greaterThan':
|
|
253
|
-
!isNaN(value) && filters.push(`${k} > ${value}`);
|
|
254
|
-
break;
|
|
255
|
-
case 'greaterThanOrEqual':
|
|
256
|
-
!isNaN(value) && filters.push(`${k} >= ${value}`);
|
|
257
|
-
break;
|
|
258
|
-
case 'lessThan':
|
|
259
|
-
!isNaN(value) && filters.push(`${k} < ${value}`);
|
|
260
|
-
break;
|
|
261
|
-
case 'lessThanOrEqual':
|
|
262
|
-
!isNaN(value) && filters.push(`${k} <= ${value}`);
|
|
263
|
-
break;
|
|
264
|
-
case 'inRange':
|
|
265
|
-
!isNaN(value) &&
|
|
266
|
-
!isNaN(valueTwo) &&
|
|
267
|
-
filters.push(`${k} >= ${value} && ${k} <= ${valueTwo}`);
|
|
268
|
-
break;
|
|
269
|
-
case 'blank':
|
|
270
|
-
filters.push(`${k} == 0`);
|
|
271
|
-
break;
|
|
272
|
-
case 'notBlank':
|
|
273
|
-
filters.push(`${k} != 0`);
|
|
274
|
-
break;
|
|
202
|
+
const fragment = this.criteriaForSingleModel(k, this.currentFilterModel[k]);
|
|
203
|
+
if (fragment) {
|
|
204
|
+
filters.push(fragment);
|
|
275
205
|
}
|
|
276
206
|
});
|
|
277
207
|
this.getFiltersByType('date').forEach((k) => {
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
const todayStr = `${year}-${month}-${day} 00:00:00`;
|
|
300
|
-
filters.push(`Expr.dateIsEqual(${k}, '${todayStr}')`);
|
|
301
|
-
break;
|
|
302
|
-
case 'blank':
|
|
303
|
-
filters.push(`${k} == null`);
|
|
304
|
-
break;
|
|
305
|
-
case 'notBlank':
|
|
306
|
-
filters.push(`${k} != null`);
|
|
307
|
-
break;
|
|
208
|
+
const fragment = this.criteriaForSingleModel(k, this.currentFilterModel[k]);
|
|
209
|
+
if (fragment) {
|
|
210
|
+
filters.push(fragment);
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
// Multi filters (ag-multi-column-filter) wrap sub-filters as { filterType: 'multi',
|
|
214
|
+
// filterModels: [...] } - unwrap them so they contribute to CRITERIA_MATCH instead of
|
|
215
|
+
// being silently dropped.
|
|
216
|
+
this.getFiltersByType('multi').forEach((k) => {
|
|
217
|
+
var _a;
|
|
218
|
+
const subModels = (_a = this.currentFilterModel[k].filterModels) !== null && _a !== void 0 ? _a : [];
|
|
219
|
+
const operator = (this.currentFilterModel[k].operator || 'AND').toUpperCase();
|
|
220
|
+
const joiner = operator === 'OR' ? ' || ' : ' && ';
|
|
221
|
+
const fragments = subModels
|
|
222
|
+
.map((subModel) => this.criteriaForSingleModel(k, subModel))
|
|
223
|
+
.filter((f) => !!f);
|
|
224
|
+
if (fragments.length === 1) {
|
|
225
|
+
filters.push(fragments[0]);
|
|
226
|
+
}
|
|
227
|
+
else if (fragments.length > 1) {
|
|
228
|
+
filters.push(`(${fragments.join(joiner)})`);
|
|
308
229
|
}
|
|
309
230
|
});
|
|
310
231
|
return filters;
|
|
311
232
|
}
|
|
233
|
+
/**
|
|
234
|
+
* Builds a single criteria fragment for one filter model (flat per-column model or a
|
|
235
|
+
* multi-filter sub-model).
|
|
236
|
+
* @internal
|
|
237
|
+
*/
|
|
238
|
+
criteriaForSingleModel(k, model) {
|
|
239
|
+
if (!model)
|
|
240
|
+
return null;
|
|
241
|
+
switch (model.filterType) {
|
|
242
|
+
case 'text':
|
|
243
|
+
return this.criteriaForTextModel(k, model);
|
|
244
|
+
case 'set':
|
|
245
|
+
return this.criteriaForSetModel(k, model);
|
|
246
|
+
case 'number':
|
|
247
|
+
return this.criteriaForNumberModel(k, model);
|
|
248
|
+
case 'date':
|
|
249
|
+
return this.criteriaForDateModel(k, model);
|
|
250
|
+
default:
|
|
251
|
+
return null;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
criteriaForTextModel(k, model) {
|
|
255
|
+
const type = model.type;
|
|
256
|
+
const val = model.filter;
|
|
257
|
+
if (!val && (type === 'false' || type === 'true')) {
|
|
258
|
+
return `${k} == ${type}`;
|
|
259
|
+
}
|
|
260
|
+
const safeVal = val ? String(val).replace(/'/g, "\\'") : '';
|
|
261
|
+
switch (type) {
|
|
262
|
+
case 'blank':
|
|
263
|
+
return `(${k} == '' || ${k} == null)`;
|
|
264
|
+
case 'contains':
|
|
265
|
+
return `Expr.containsIgnoreCase(${k}, '${safeVal}')`;
|
|
266
|
+
case 'equals':
|
|
267
|
+
return `${k} == '${safeVal}'`;
|
|
268
|
+
case 'notBlank':
|
|
269
|
+
return `(${k} != '' && ${k} != null)`;
|
|
270
|
+
case 'notEqual':
|
|
271
|
+
return `${k} != '${safeVal}'`;
|
|
272
|
+
case 'wordStartsWith':
|
|
273
|
+
return `Expr.containsWordsStartingWithIgnoreCase(${k}, '${safeVal}')`;
|
|
274
|
+
default:
|
|
275
|
+
return null;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
criteriaForSetModel(k, model) {
|
|
279
|
+
var _a, _b;
|
|
280
|
+
const selectedValues = ((_a = model.values) !== null && _a !== void 0 ? _a : []);
|
|
281
|
+
if (!selectedValues.length) {
|
|
282
|
+
// Nothing selected means no additional criteria
|
|
283
|
+
return null;
|
|
284
|
+
}
|
|
285
|
+
// Try to detect "all values selected" using VALID_VALUES from metadata.
|
|
286
|
+
// In that case we don't want to send any criteria, as it would be equivalent
|
|
287
|
+
// to no filter at all.
|
|
288
|
+
const colMeta = (_b = this.resourceColDefs) === null || _b === void 0 ? void 0 : _b.find((o) => o.NAME === k);
|
|
289
|
+
let allValues;
|
|
290
|
+
if (colMeta === null || colMeta === void 0 ? void 0 : colMeta.VALID_VALUES) {
|
|
291
|
+
try {
|
|
292
|
+
allValues = Array.isArray(colMeta.VALID_VALUES)
|
|
293
|
+
? colMeta.VALID_VALUES
|
|
294
|
+
: colMeta.VALID_VALUES.split('|');
|
|
295
|
+
}
|
|
296
|
+
catch (_c) {
|
|
297
|
+
allValues = undefined;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
if (allValues &&
|
|
301
|
+
allValues.length === selectedValues.length &&
|
|
302
|
+
allValues.every((v) => selectedValues.includes(v))) {
|
|
303
|
+
// All enum options are selected – skip adding criteria for this column
|
|
304
|
+
return null;
|
|
305
|
+
}
|
|
306
|
+
const orConditions = selectedValues.map((val) => {
|
|
307
|
+
const safeVal = String(val).replace(/'/g, "\\'");
|
|
308
|
+
return `${k} == '${safeVal}'`;
|
|
309
|
+
});
|
|
310
|
+
return orConditions.length ? `(${orConditions.join(' || ')})` : null;
|
|
311
|
+
}
|
|
312
|
+
criteriaForNumberModel(k, model) {
|
|
313
|
+
const value = model.filter;
|
|
314
|
+
const valueTwo = model.filterTo;
|
|
315
|
+
const isNum = (v) => v !== null && v !== '' && !isNaN(Number(v));
|
|
316
|
+
switch (model.type) {
|
|
317
|
+
case 'equals':
|
|
318
|
+
return isNum(value) ? `${k} == ${value}` : null;
|
|
319
|
+
case 'notEqual':
|
|
320
|
+
return isNum(value) ? `${k} != ${value}` : null;
|
|
321
|
+
case 'greaterThan':
|
|
322
|
+
return isNum(value) ? `${k} > ${value}` : null;
|
|
323
|
+
case 'greaterThanOrEqual':
|
|
324
|
+
return isNum(value) ? `${k} >= ${value}` : null;
|
|
325
|
+
case 'lessThan':
|
|
326
|
+
return isNum(value) ? `${k} < ${value}` : null;
|
|
327
|
+
case 'lessThanOrEqual':
|
|
328
|
+
return isNum(value) ? `${k} <= ${value}` : null;
|
|
329
|
+
case 'inRange':
|
|
330
|
+
return isNum(value) && isNum(valueTwo) ? `${k} >= ${value} && ${k} <= ${valueTwo}` : null;
|
|
331
|
+
case 'blank':
|
|
332
|
+
return `${k} == 0`;
|
|
333
|
+
case 'notBlank':
|
|
334
|
+
return `${k} != 0`;
|
|
335
|
+
default:
|
|
336
|
+
return null;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
criteriaForDateModel(k, model) {
|
|
340
|
+
var _a, _b;
|
|
341
|
+
const dateFrom = (_a = model.dateFrom) === null || _a === void 0 ? void 0 : _a.replace(/-/g, '').replace('T', '-').split(' ')[0];
|
|
342
|
+
const dateTo = (_b = model.dateTo) === null || _b === void 0 ? void 0 : _b.replace(/-/g, '').replace('T', '-').split(' ')[0];
|
|
343
|
+
switch (model.type) {
|
|
344
|
+
case 'equals':
|
|
345
|
+
return `Expr.dateIsEqual(${k}, '${dateFrom}')`;
|
|
346
|
+
case 'lessThan':
|
|
347
|
+
return `Expr.dateIsBefore(${k}, '${dateFrom}')`;
|
|
348
|
+
case 'greaterThan':
|
|
349
|
+
return `Expr.dateIsAfter(${k}, '${dateFrom}')`;
|
|
350
|
+
case 'inRange':
|
|
351
|
+
return `Expr.dateIsAfter(${k}, '${dateFrom}') && Expr.dateIsBefore(${k}, '${dateTo}')`;
|
|
352
|
+
case 'isToday': {
|
|
353
|
+
const now = new Date();
|
|
354
|
+
const year = now.getFullYear();
|
|
355
|
+
const month = (now.getMonth() + 1).toString().padStart(2, '0');
|
|
356
|
+
const day = now.getDate().toString().padStart(2, '0');
|
|
357
|
+
return `Expr.dateIsEqual(${k}, '${year}-${month}-${day} 00:00:00')`;
|
|
358
|
+
}
|
|
359
|
+
case 'blank':
|
|
360
|
+
return `${k} == null`;
|
|
361
|
+
case 'notBlank':
|
|
362
|
+
return `${k} != null`;
|
|
363
|
+
default:
|
|
364
|
+
return null;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
312
367
|
getFiltersByType(filterType) {
|
|
313
368
|
var _a;
|
|
314
369
|
return Object.keys((_a = this.currentFilterModel) !== null && _a !== void 0 ? _a : {})
|
|
@@ -336,19 +391,22 @@ export class BaseServerSideDatasource {
|
|
|
336
391
|
}
|
|
337
392
|
return rowCount;
|
|
338
393
|
}
|
|
339
|
-
|
|
340
|
-
|
|
394
|
+
// Infinite scroll: getRows() only resolves a block once the cumulative row cache covers
|
|
395
|
+
// its full extent or the stream reported no more data, so blocks are either full or final.
|
|
396
|
+
if (!this.moreRows) {
|
|
397
|
+
// Dataset ends here: rowData.size is the deduplicated loaded count. Deliberately not
|
|
398
|
+
// serverRowsCount (GSF's ROWS_COUNT ignores CRITERIA_MATCH) nor clientRowsCount
|
|
399
|
+
// (non-deduplicated running sum, overcounts on live streams).
|
|
400
|
+
rowCount = Math.min(this.rowData.size, this.maxView);
|
|
341
401
|
}
|
|
342
|
-
else if (
|
|
343
|
-
|
|
402
|
+
else if (this.rowData.size >= this.maxView) {
|
|
403
|
+
// Hard cap - the view can't grow past maxView.
|
|
404
|
+
rowCount = this.maxView;
|
|
344
405
|
}
|
|
345
|
-
else
|
|
346
|
-
//
|
|
347
|
-
//
|
|
348
|
-
rowCount =
|
|
349
|
-
}
|
|
350
|
-
else if (!this.moreRows && this.serverRowsCount > this.calculatedRowsCount) {
|
|
351
|
-
rowCount = this.calculatedRowsCount;
|
|
406
|
+
else {
|
|
407
|
+
// Full block, more may follow: leave undefined so AG Grid keeps requesting blocks
|
|
408
|
+
// and shows an open-ended "100+"-style count.
|
|
409
|
+
rowCount = undefined;
|
|
352
410
|
}
|
|
353
411
|
return rowCount;
|
|
354
412
|
}
|