@genesislcap/grid-pro 14.481.1-alpha-69af5f8.0 → 14.481.1
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 +521 -841
- package/dist/dts/datasource/server-side.datasource.d.ts.map +1 -1
- package/dist/dts/datasource/server-side.resource-base.d.ts +2 -26
- package/dist/dts/datasource/server-side.resource-base.d.ts.map +1 -1
- package/dist/dts/datasource/server-side.resource-dataserver.d.ts +1 -7
- 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 +2 -13
- package/dist/esm/datasource/server-side.resource-base.js +135 -204
- package/dist/esm/datasource/server-side.resource-dataserver.js +23 -205
- package/dist/esm/datasource/server-side.resource-reqrep.js +2 -3
- 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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G;IAIvC,QAAQ;CAGlB"}
|
|
@@ -45,12 +45,6 @@ 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 already resolved for the current
|
|
50
|
-
* CRITERIA_MATCH. Reset in destroy() so it re-resolves whenever the filter/sort changes.
|
|
51
|
-
* @internal
|
|
52
|
-
*/
|
|
53
|
-
protected criteriaRowCountResolved: boolean;
|
|
54
48
|
protected currentFilterModel: SetFilterModel;
|
|
55
49
|
protected originalCriteriaMatch: string | string[];
|
|
56
50
|
protected currentSortModel: SortModelItem[];
|
|
@@ -73,22 +67,15 @@ export declare abstract class BaseServerSideDatasource implements IServerSideDat
|
|
|
73
67
|
/**
|
|
74
68
|
* Handles filtering setup for server-side datasources.
|
|
75
69
|
* Common logic used by both dataserver and req-rep implementations.
|
|
76
|
-
*
|
|
77
|
-
* @returns `true` when a filter change triggered {@link refreshDatasource} - in that case
|
|
78
|
-
* the current getRows() request is superseded and the caller MUST stop processing it
|
|
79
|
-
* (see the corresponding handling in the dataserver implementation's getRows()).
|
|
80
70
|
*/
|
|
81
|
-
protected setupFiltering(params: IServerSideGetRowsParams): Promise<
|
|
71
|
+
protected setupFiltering(params: IServerSideGetRowsParams): Promise<void>;
|
|
82
72
|
/**
|
|
83
73
|
* Handles sorting setup. Must be implemented by each datasource type.
|
|
84
74
|
* Different datasource types have different sorting requirements:
|
|
85
75
|
* - Dataserver: Requires indexed columns
|
|
86
76
|
* - Req-rep: Can sort by any column
|
|
87
|
-
*
|
|
88
|
-
* @returns `true` when a sort change triggered a datasource refresh and the current
|
|
89
|
-
* getRows() request is superseded (same contract as {@link setupFiltering}).
|
|
90
77
|
*/
|
|
91
|
-
protected abstract setupSorting(params: IServerSideGetRowsParams): Promise<
|
|
78
|
+
protected abstract setupSorting(params: IServerSideGetRowsParams): Promise<void>;
|
|
92
79
|
/**
|
|
93
80
|
* Legacy method that combines filtering and sorting.
|
|
94
81
|
* Kept for backward compatibility. New implementations should use setupFiltering and setupSorting directly.
|
|
@@ -104,17 +91,6 @@ export declare abstract class BaseServerSideDatasource implements IServerSideDat
|
|
|
104
91
|
};
|
|
105
92
|
protected buildCriteriaMatchFromFilters(): string;
|
|
106
93
|
protected criteriaFromFilters(): string[];
|
|
107
|
-
/**
|
|
108
|
-
* Builds a single criteria fragment for one filter model. Used both for flat per-column
|
|
109
|
-
* filter models and to unwrap the sub-filters inside an ag-multi-column-filter's
|
|
110
|
-
* `filterModels` array.
|
|
111
|
-
* @internal
|
|
112
|
-
*/
|
|
113
|
-
protected criteriaForSingleModel(k: string, model: any): string | null;
|
|
114
|
-
protected criteriaForTextModel(k: string, model: any): string | null;
|
|
115
|
-
protected criteriaForSetModel(k: string, model: any): string | null;
|
|
116
|
-
protected criteriaForNumberModel(k: string, model: any): string | null;
|
|
117
|
-
protected criteriaForDateModel(k: string, model: any): string | null;
|
|
118
94
|
protected getFiltersByType(filterType: string): string[];
|
|
119
95
|
protected getPageNumber(start: number, recordsPerPage: number, totalRecords?: number, zeroBasedViewNumber?: boolean): number;
|
|
120
96
|
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,OA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pB,SAAS,CAAC,QAAQ,UAAS;IAC3B,SAAS,CAAC,mBAAmB,SAAK;IAClC,SAAS,CAAC,iBAAiB,MAAQ;IAEnC
|
|
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,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1D,SAAS,CAAC,qBAAqB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7C,SAAS,CAAC,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IAE3C,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;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,IAAI,CAAC;IAEhF;;;;OAIG;cACa,wBAAwB,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC;IAKzF,OAAO,CAAC,IAAI,IAAI;IAWV,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAWjE,OAAO,CAAC,oBAAoB;IAa5B,SAAS,CAAC,6BAA6B,CAAC,GAAG,KAAA,EAAE,WAAW,KAAA;;;;IAWxD,SAAS,CAAC,6BAA6B,IAAI,MAAM;IAkBjD,SAAS,CAAC,mBAAmB,IAAI,MAAM,EAAE;IAmKzC,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;IAkCvE,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,12 +7,6 @@ import { BaseServerSideDatasource } from './server-side.resource-base';
|
|
|
7
7
|
* @beta
|
|
8
8
|
*/
|
|
9
9
|
export declare class DataserverServerSideDatasource extends BaseServerSideDatasource implements IServerSideDatasource {
|
|
10
|
-
/**
|
|
11
|
-
* How long a non-paginated SSRM block may stay pending before it is force-resolved with
|
|
12
|
-
* whatever rows have accumulated so far. See the safety valve in getRows().
|
|
13
|
-
* @internal
|
|
14
|
-
*/
|
|
15
|
-
private static readonly BLOCK_RESOLVE_TIMEOUT_MS;
|
|
16
10
|
dataserverStream: SocketObservable<FilteredDataServerResult>;
|
|
17
11
|
dataserverStreamSubscription: SocketSubscription;
|
|
18
12
|
createDataserverStreamFunc: (existingParams?: any) => Promise<SocketObservable<FilteredDataServerResult>>;
|
|
@@ -24,7 +18,7 @@ export declare class DataserverServerSideDatasource extends BaseServerSideDataso
|
|
|
24
18
|
* Dataserver-specific sorting setup that validates columns are part of an index.
|
|
25
19
|
* This is required because dataserver needs indexed columns for efficient sorting.
|
|
26
20
|
*/
|
|
27
|
-
protected setupSorting(params: IServerSideGetRowsParams): Promise<
|
|
21
|
+
protected setupSorting(params: IServerSideGetRowsParams): Promise<void>;
|
|
28
22
|
destroy(): Promise<void>;
|
|
29
23
|
private handleCurrentStreamLoad;
|
|
30
24
|
}
|
|
@@ -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;AAEvE;;;GAGG;AACH,qBAAa,8BACX,SAAQ,wBACR,YAAW,qBAAqB;IAEhC
|
|
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;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;IAK1C,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ3D,OAAO,CAAC,MAAM,EAAE,wBAAwB;IA+E9C,OAAO,CAAC,mBAAmB;IAiE3B;;;OAGG;cACa,YAAY,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC;IAqDvE,OAAO;IAOb,OAAO,CAAC,uBAAuB;CAYhC"}
|
|
@@ -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<void>;
|
|
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.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AC,uBAAuB;IAoB/B;;;OAGG;cACa,YAAY,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,
|
|
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;IAmC9C;;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,IAAI,CAAC;IA+BvE,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,6 +178,8 @@ 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 });
|
|
181
183
|
if (params) {
|
|
182
184
|
const options = Object.assign(Object.assign({}, this.datasourceOptions()), params);
|
|
183
185
|
const initOK = yield this.initializeDatasource(options, true, false);
|
|
@@ -185,22 +187,9 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
|
|
|
185
187
|
// Emit event to set server side datasource to null
|
|
186
188
|
this.$emit(datasourceEventNames.setServerSideDatasource, { datasource: null });
|
|
187
189
|
logger.error('Genesis Datasource re-init failed on filtering/sorting.');
|
|
188
|
-
return;
|
|
189
190
|
}
|
|
190
|
-
// Purge AG Grid's SSRM cache only AFTER the datasource re-init completed. The purge
|
|
191
|
-
// makes AG Grid immediately re-invoke getRows(), and getRows() builds its stream from
|
|
192
|
-
// this datasource via createDataserverStreamFunc - with the previous ordering (purge
|
|
193
|
-
// emitted before initializeDatasource), that re-invoked getRows() raced the re-init
|
|
194
|
-
// and called startStream() on the destroyed/half-initialized datasource. Observed
|
|
195
|
-
// symptoms of that race: rows from the PREVIOUS criteria leaking into the new
|
|
196
|
-
// filter's result set, and first loads breaking entirely (block stuck/failed) when a
|
|
197
|
-
// restored sort triggered a refresh during the initial getRows().
|
|
198
|
-
this.$emit(datasourceEventNames.refreshServerSide, { purge: true });
|
|
199
191
|
}
|
|
200
192
|
else {
|
|
201
|
-
// No params = full re-init path below; purge up-front as before (init() re-creates
|
|
202
|
-
// and re-attaches the whole ssrmDatasource, so there is no equivalent race here).
|
|
203
|
-
this.$emit(datasourceEventNames.refreshServerSide, { purge: true });
|
|
204
193
|
if (this.ssrmDatasource) {
|
|
205
194
|
yield this.ssrmDatasource.destroy();
|
|
206
195
|
this.ssrmDatasource = undefined;
|
|
@@ -24,12 +24,6 @@ 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 already resolved for the current
|
|
29
|
-
* CRITERIA_MATCH. Reset in destroy() so it re-resolves whenever the filter/sort changes.
|
|
30
|
-
* @internal
|
|
31
|
-
*/
|
|
32
|
-
this.criteriaRowCountResolved = false;
|
|
33
27
|
this.reloadResourceDataFunc = options.reloadResourceDataFunc;
|
|
34
28
|
this.errorHandlerFunc = options.errorHandlerFunc;
|
|
35
29
|
this.onNoDataAvailableFunc = options.onNoDataAvailableFunc;
|
|
@@ -85,10 +79,6 @@ export class BaseServerSideDatasource {
|
|
|
85
79
|
/**
|
|
86
80
|
* Handles filtering setup for server-side datasources.
|
|
87
81
|
* Common logic used by both dataserver and req-rep implementations.
|
|
88
|
-
*
|
|
89
|
-
* @returns `true` when a filter change triggered {@link refreshDatasource} - in that case
|
|
90
|
-
* the current getRows() request is superseded and the caller MUST stop processing it
|
|
91
|
-
* (see the corresponding handling in the dataserver implementation's getRows()).
|
|
92
82
|
*/
|
|
93
83
|
setupFiltering(params) {
|
|
94
84
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -101,21 +91,15 @@ export class BaseServerSideDatasource {
|
|
|
101
91
|
this.currentFilterModel = null;
|
|
102
92
|
this.setResourceParam('CRITERIA_MATCH', this.originalCriteriaMatch);
|
|
103
93
|
yield this.refreshDatasource(params);
|
|
104
|
-
|
|
105
|
-
// reloadResourceDataFunc has already re-initialized the underlying datasource and
|
|
106
|
-
// purged AG Grid's SSRM cache, so AG Grid re-invokes getRows() with fresh params
|
|
107
|
-
// on its own. Continuing with THIS invocation's stale params would attach a
|
|
108
|
-
// duplicate subscription to the freshly-created stream.
|
|
109
|
-
return true;
|
|
94
|
+
return;
|
|
110
95
|
}
|
|
111
96
|
else if (filterModelBeingAppliedDiffersFromCurrent && filtersAreBeingApplied) {
|
|
112
97
|
this.currentFilterModel = filterModelBeingApplied;
|
|
113
98
|
this.setResourceParam('CRITERIA_MATCH', this.buildCriteriaMatchFromFilters());
|
|
114
99
|
yield this.refreshDatasource(params);
|
|
115
|
-
return
|
|
100
|
+
return;
|
|
116
101
|
}
|
|
117
102
|
}
|
|
118
|
-
return false;
|
|
119
103
|
});
|
|
120
104
|
}
|
|
121
105
|
/**
|
|
@@ -138,7 +122,6 @@ export class BaseServerSideDatasource {
|
|
|
138
122
|
this.moreRows = false;
|
|
139
123
|
this.sourceRef = undefined;
|
|
140
124
|
this.lastSuccessRowData = undefined;
|
|
141
|
-
this.criteriaRowCountResolved = false;
|
|
142
125
|
}
|
|
143
126
|
refreshDatasource(params) {
|
|
144
127
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -190,184 +173,142 @@ export class BaseServerSideDatasource {
|
|
|
190
173
|
criteriaFromFilters() {
|
|
191
174
|
const filters = [];
|
|
192
175
|
this.getFiltersByType('text').forEach((k) => {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
filters.push(
|
|
176
|
+
if (!this.currentFilterModel[k].filter &&
|
|
177
|
+
(this.currentFilterModel[k].type === 'false' || this.currentFilterModel[k].type === 'true')) {
|
|
178
|
+
filters.push(`${k} == ${this.currentFilterModel[k].type}`);
|
|
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
|
+
}
|
|
196
201
|
}
|
|
197
202
|
});
|
|
203
|
+
// TODO: Handle multi filters if we decide we want to use them in SSRM
|
|
198
204
|
// Handle set filters (typically used for enum fields with ag-set-column-filter)
|
|
199
205
|
this.getFiltersByType('set').forEach((k) => {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
206
|
+
var _a, _b, _c;
|
|
207
|
+
const model = (_a = this.currentFilterModel) === null || _a === void 0 ? void 0 : _a[k];
|
|
208
|
+
const selectedValues = ((_b = model === null || model === void 0 ? void 0 : model.values) !== null && _b !== void 0 ? _b : []);
|
|
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(' || ')})`);
|
|
203
240
|
}
|
|
204
241
|
});
|
|
205
242
|
this.getFiltersByType('number').forEach((k) => {
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
|
|
243
|
+
const value = this.currentFilterModel[k].filter;
|
|
244
|
+
const valueTwo = this.currentFilterModel[k].filterTo;
|
|
245
|
+
switch (this.currentFilterModel[k].type) {
|
|
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;
|
|
209
275
|
}
|
|
210
276
|
});
|
|
211
277
|
this.getFiltersByType('date').forEach((k) => {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
278
|
+
var _a, _b;
|
|
279
|
+
const dateFrom = (_a = this.currentFilterModel[k].dateFrom) === null || _a === void 0 ? void 0 : _a.replace(/-/g, '').replace('T', '-').split(' ')[0];
|
|
280
|
+
const dateTo = (_b = this.currentFilterModel[k].dateTo) === null || _b === void 0 ? void 0 : _b.replace(/-/g, '').replace('T', '-').split(' ')[0];
|
|
281
|
+
switch (this.currentFilterModel[k].type) {
|
|
282
|
+
case 'equals':
|
|
283
|
+
filters.push(`Expr.dateIsEqual(${k}, '${dateFrom}')`);
|
|
284
|
+
break;
|
|
285
|
+
case 'lessThan':
|
|
286
|
+
filters.push(`Expr.dateIsBefore(${k}, '${dateFrom}')`);
|
|
287
|
+
break;
|
|
288
|
+
case 'greaterThan':
|
|
289
|
+
filters.push(`Expr.dateIsAfter(${k}, '${dateFrom}')`);
|
|
290
|
+
break;
|
|
291
|
+
case 'inRange':
|
|
292
|
+
filters.push(`Expr.dateIsAfter(${k}, '${dateFrom}') && Expr.dateIsBefore(${k}, '${dateTo}')`);
|
|
293
|
+
break;
|
|
294
|
+
case 'isToday':
|
|
295
|
+
const now = new Date();
|
|
296
|
+
const year = now.getFullYear();
|
|
297
|
+
const month = (now.getMonth() + 1).toString().padStart(2, '0');
|
|
298
|
+
const day = now.getDate().toString().padStart(2, '0');
|
|
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;
|
|
234
308
|
}
|
|
235
309
|
});
|
|
236
310
|
return filters;
|
|
237
311
|
}
|
|
238
|
-
/**
|
|
239
|
-
* Builds a single criteria fragment for one filter model. Used both for flat per-column
|
|
240
|
-
* filter models and to unwrap the sub-filters inside an ag-multi-column-filter's
|
|
241
|
-
* `filterModels` array.
|
|
242
|
-
* @internal
|
|
243
|
-
*/
|
|
244
|
-
criteriaForSingleModel(k, model) {
|
|
245
|
-
if (!model)
|
|
246
|
-
return null;
|
|
247
|
-
switch (model.filterType) {
|
|
248
|
-
case 'text':
|
|
249
|
-
return this.criteriaForTextModel(k, model);
|
|
250
|
-
case 'set':
|
|
251
|
-
return this.criteriaForSetModel(k, model);
|
|
252
|
-
case 'number':
|
|
253
|
-
return this.criteriaForNumberModel(k, model);
|
|
254
|
-
case 'date':
|
|
255
|
-
return this.criteriaForDateModel(k, model);
|
|
256
|
-
default:
|
|
257
|
-
return null;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
criteriaForTextModel(k, model) {
|
|
261
|
-
const type = model.type;
|
|
262
|
-
const val = model.filter;
|
|
263
|
-
if (!val && (type === 'false' || type === 'true')) {
|
|
264
|
-
return `${k} == ${type}`;
|
|
265
|
-
}
|
|
266
|
-
switch (type) {
|
|
267
|
-
case 'blank':
|
|
268
|
-
return `(${k} == '' || ${k} == null)`;
|
|
269
|
-
case 'contains':
|
|
270
|
-
return `Expr.containsIgnoreCase(${k}, '${val}')`;
|
|
271
|
-
case 'equals':
|
|
272
|
-
return `${k} == '${val}'`;
|
|
273
|
-
case 'notBlank':
|
|
274
|
-
return `(${k} != '' && ${k} != null)`;
|
|
275
|
-
case 'notEqual':
|
|
276
|
-
return `${k} != '${val}'`;
|
|
277
|
-
case 'wordStartsWith':
|
|
278
|
-
return `Expr.containsWordsStartingWithIgnoreCase(${k}, '${val}')`;
|
|
279
|
-
default:
|
|
280
|
-
return null;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
criteriaForSetModel(k, model) {
|
|
284
|
-
var _a, _b;
|
|
285
|
-
const selectedValues = ((_a = model.values) !== null && _a !== void 0 ? _a : []);
|
|
286
|
-
if (!selectedValues.length) {
|
|
287
|
-
// Nothing selected means no additional criteria
|
|
288
|
-
return null;
|
|
289
|
-
}
|
|
290
|
-
// Try to detect "all values selected" using VALID_VALUES from metadata.
|
|
291
|
-
// In that case we don't want to send any criteria, as it would be equivalent
|
|
292
|
-
// to no filter at all.
|
|
293
|
-
const colMeta = (_b = this.resourceColDefs) === null || _b === void 0 ? void 0 : _b.find((o) => o.NAME === k);
|
|
294
|
-
let allValues;
|
|
295
|
-
if (colMeta === null || colMeta === void 0 ? void 0 : colMeta.VALID_VALUES) {
|
|
296
|
-
try {
|
|
297
|
-
allValues = Array.isArray(colMeta.VALID_VALUES)
|
|
298
|
-
? colMeta.VALID_VALUES
|
|
299
|
-
: colMeta.VALID_VALUES.split('|');
|
|
300
|
-
}
|
|
301
|
-
catch (_c) {
|
|
302
|
-
allValues = undefined;
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
if (allValues &&
|
|
306
|
-
allValues.length === selectedValues.length &&
|
|
307
|
-
allValues.every((v) => selectedValues.includes(v))) {
|
|
308
|
-
// All enum options are selected – skip adding criteria for this column
|
|
309
|
-
return null;
|
|
310
|
-
}
|
|
311
|
-
const orConditions = selectedValues.map((val) => {
|
|
312
|
-
const safeVal = String(val).replace(/'/g, "\\'");
|
|
313
|
-
return `${k} == '${safeVal}'`;
|
|
314
|
-
});
|
|
315
|
-
return orConditions.length ? `(${orConditions.join(' || ')})` : null;
|
|
316
|
-
}
|
|
317
|
-
criteriaForNumberModel(k, model) {
|
|
318
|
-
const value = model.filter;
|
|
319
|
-
const valueTwo = model.filterTo;
|
|
320
|
-
switch (model.type) {
|
|
321
|
-
case 'equals':
|
|
322
|
-
return !isNaN(value) ? `${k} == ${value}` : null;
|
|
323
|
-
case 'notEqual':
|
|
324
|
-
return !isNaN(value) ? `${k} != ${value}` : null;
|
|
325
|
-
case 'greaterThan':
|
|
326
|
-
return !isNaN(value) ? `${k} > ${value}` : null;
|
|
327
|
-
case 'greaterThanOrEqual':
|
|
328
|
-
return !isNaN(value) ? `${k} >= ${value}` : null;
|
|
329
|
-
case 'lessThan':
|
|
330
|
-
return !isNaN(value) ? `${k} < ${value}` : null;
|
|
331
|
-
case 'lessThanOrEqual':
|
|
332
|
-
return !isNaN(value) ? `${k} <= ${value}` : null;
|
|
333
|
-
case 'inRange':
|
|
334
|
-
return !isNaN(value) && !isNaN(valueTwo) ? `${k} >= ${value} && ${k} <= ${valueTwo}` : null;
|
|
335
|
-
case 'blank':
|
|
336
|
-
return `${k} == 0`;
|
|
337
|
-
case 'notBlank':
|
|
338
|
-
return `${k} != 0`;
|
|
339
|
-
default:
|
|
340
|
-
return null;
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
criteriaForDateModel(k, model) {
|
|
344
|
-
var _a, _b;
|
|
345
|
-
const dateFrom = (_a = model.dateFrom) === null || _a === void 0 ? void 0 : _a.replace(/-/g, '').replace('T', '-').split(' ')[0];
|
|
346
|
-
const dateTo = (_b = model.dateTo) === null || _b === void 0 ? void 0 : _b.replace(/-/g, '').replace('T', '-').split(' ')[0];
|
|
347
|
-
switch (model.type) {
|
|
348
|
-
case 'equals':
|
|
349
|
-
return `Expr.dateIsEqual(${k}, '${dateFrom}')`;
|
|
350
|
-
case 'lessThan':
|
|
351
|
-
return `Expr.dateIsBefore(${k}, '${dateFrom}')`;
|
|
352
|
-
case 'greaterThan':
|
|
353
|
-
return `Expr.dateIsAfter(${k}, '${dateFrom}')`;
|
|
354
|
-
case 'inRange':
|
|
355
|
-
return `Expr.dateIsAfter(${k}, '${dateFrom}') && Expr.dateIsBefore(${k}, '${dateTo}')`;
|
|
356
|
-
case 'isToday': {
|
|
357
|
-
const now = new Date();
|
|
358
|
-
const year = now.getFullYear();
|
|
359
|
-
const month = (now.getMonth() + 1).toString().padStart(2, '0');
|
|
360
|
-
const day = now.getDate().toString().padStart(2, '0');
|
|
361
|
-
return `Expr.dateIsEqual(${k}, '${year}-${month}-${day} 00:00:00')`;
|
|
362
|
-
}
|
|
363
|
-
case 'blank':
|
|
364
|
-
return `${k} == null`;
|
|
365
|
-
case 'notBlank':
|
|
366
|
-
return `${k} != null`;
|
|
367
|
-
default:
|
|
368
|
-
return null;
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
312
|
getFiltersByType(filterType) {
|
|
372
313
|
var _a;
|
|
373
314
|
return Object.keys((_a = this.currentFilterModel) !== null && _a !== void 0 ? _a : {})
|
|
@@ -395,29 +336,19 @@ export class BaseServerSideDatasource {
|
|
|
395
336
|
}
|
|
396
337
|
return rowCount;
|
|
397
338
|
}
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
// logic in server-side.resource-dataserver.ts getRows()). So by construction, blocks handed
|
|
401
|
-
// to AG Grid are either FULL (more may follow) or FINAL (dataset ended) - which lets the
|
|
402
|
-
// count logic stay simple and honest:
|
|
403
|
-
if (!this.moreRows) {
|
|
404
|
-
// Dataset genuinely ends here. rowData is a Map keyed by rowId, so .size is the true
|
|
405
|
-
// unique-row count. Deliberately NOT serverRowsCount - GSF's ROWS_COUNT ignores
|
|
406
|
-
// CRITERIA_MATCH entirely (confirmed: it returns the full unfiltered total regardless of
|
|
407
|
-
// any filter). Deliberately NOT clientRowsCount either - it's a non-deduplicated running
|
|
408
|
-
// sum of inserts across stream messages and overcounts on live/reactive streams.
|
|
409
|
-
rowCount = Math.min(this.rowData.size, this.maxView);
|
|
339
|
+
if (currentLastRowNumber === this.serverRowsCount && !this.moreRows) {
|
|
340
|
+
rowCount = this.serverRowsCount;
|
|
410
341
|
}
|
|
411
|
-
else if (
|
|
412
|
-
|
|
413
|
-
rowCount = this.maxView;
|
|
342
|
+
else if (currentLastRowNumber > this.maxView) {
|
|
343
|
+
rowCount = Math.min(defaultCount, this.calculatedRowsCount);
|
|
414
344
|
}
|
|
415
|
-
else {
|
|
416
|
-
//
|
|
417
|
-
//
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
345
|
+
else if (!this.moreRows && currentLastRowNumber > this.calculatedRowsCount) {
|
|
346
|
+
// No more data from server and request is beyond what has been counted.
|
|
347
|
+
// Return the actual loaded count so AG Grid knows the dataset ends here.
|
|
348
|
+
rowCount = this.clientRowsCount || this.calculatedRowsCount;
|
|
349
|
+
}
|
|
350
|
+
else if (!this.moreRows && this.serverRowsCount > this.calculatedRowsCount) {
|
|
351
|
+
rowCount = this.calculatedRowsCount;
|
|
421
352
|
}
|
|
422
353
|
return rowCount;
|
|
423
354
|
}
|