@genesislcap/grid-pro 15.96.3 → 15.98.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 +1492 -14
- package/dist/dts/datasource/cube.block-loads.d.ts +29 -0
- package/dist/dts/datasource/cube.block-loads.d.ts.map +1 -0
- package/dist/dts/datasource/cube.client.d.ts +50 -0
- package/dist/dts/datasource/cube.client.d.ts.map +1 -0
- package/dist/dts/datasource/cube.request.d.ts +99 -0
- package/dist/dts/datasource/cube.request.d.ts.map +1 -0
- package/dist/dts/datasource/cube.source.d.ts +43 -0
- package/dist/dts/datasource/cube.source.d.ts.map +1 -0
- package/dist/dts/datasource/infinite.datasource.d.ts +39 -3
- package/dist/dts/datasource/infinite.datasource.d.ts.map +1 -1
- package/dist/dts/datasource/infinite.resource-cube.d.ts +22 -0
- package/dist/dts/datasource/infinite.resource-cube.d.ts.map +1 -0
- package/dist/dts/datasource/server-side.datasource.d.ts +49 -1
- package/dist/dts/datasource/server-side.datasource.d.ts.map +1 -1
- package/dist/dts/datasource/server-side.resource-cube.d.ts +21 -0
- package/dist/dts/datasource/server-side.resource-cube.d.ts.map +1 -0
- package/dist/dts/grid-pro-genesis-datasource/datasource-events.types.d.ts +2 -1
- package/dist/dts/grid-pro-genesis-datasource/datasource-events.types.d.ts.map +1 -1
- package/dist/esm/datasource/cube.block-loads.js +48 -0
- package/dist/esm/datasource/cube.client.js +144 -0
- package/dist/esm/datasource/cube.request.js +165 -0
- package/dist/esm/datasource/cube.source.js +73 -0
- package/dist/esm/datasource/infinite.datasource.js +157 -24
- package/dist/esm/datasource/infinite.resource-cube.js +56 -0
- package/dist/esm/datasource/server-side.datasource.js +197 -23
- package/dist/esm/datasource/server-side.resource-cube.js +58 -0
- package/dist/grid-pro.api.json +510 -3
- package/dist/grid-pro.d.ts +139 -3
- package/package.json +12 -12
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type CubeRowReports = {
|
|
2
|
+
/** The column that identifies a row. Without one, rows cannot be told apart and are not reported. */
|
|
3
|
+
rowId?: string;
|
|
4
|
+
onRowsDelivered?: (rows: any[]) => void;
|
|
5
|
+
onRowsWithdrawn?: (rowIds: string[]) => void;
|
|
6
|
+
onRowCacheReset?: () => void;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* What both cube row-model datasources track about their block loads: which replies the grid
|
|
10
|
+
* still wants, and what the delivered ones changed about the rows the host holds.
|
|
11
|
+
*/
|
|
12
|
+
export declare class CubeBlockLoads {
|
|
13
|
+
private readonly reports;
|
|
14
|
+
private readonly ledger?;
|
|
15
|
+
private generation;
|
|
16
|
+
private cacheKey?;
|
|
17
|
+
constructor(reports: CubeRowReports);
|
|
18
|
+
/**
|
|
19
|
+
* Starts a load read under `cacheKey`. A new key means AG Grid purged the blocks read under
|
|
20
|
+
* the previous one, so the rows reported so far are gone.
|
|
21
|
+
* @returns whether the grid still wants the load's reply, to ask once it arrives.
|
|
22
|
+
*/
|
|
23
|
+
begin(cacheKey: string): () => boolean;
|
|
24
|
+
/** Replies still in flight were read for a cache the grid is dropping, so they are discarded. */
|
|
25
|
+
invalidate(): void;
|
|
26
|
+
forgetRows(): void;
|
|
27
|
+
deliver(startRow: number, rows: any[]): void;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=cube.block-loads.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cube.block-loads.d.ts","sourceRoot":"","sources":["../../../src/datasource/cube.block-loads.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,cAAc,GAAG;IAC3B,qGAAqG;IACrG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;IACxC,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC7C,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;CAC9B,CAAC;AAEF;;;GAGG;AACH,qBAAa,cAAc;IAKb,OAAO,CAAC,QAAQ,CAAC,OAAO;IAJpC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAuB;IAC/C,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,QAAQ,CAAC,CAAS;gBAEG,OAAO,EAAE,cAAc;IAIpD;;;;OAIG;IACH,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,OAAO;IAUtC,iGAAiG;IACjG,UAAU,IAAI,IAAI;IAKlB,UAAU,IAAI,IAAI;IAIlB,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;CAU7C"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { ColDef, IServerSideGetRowsRequest } from '@ag-grid-community/core';
|
|
2
|
+
import { type FieldMetadata, type Http } from '@genesislcap/foundation-comms';
|
|
3
|
+
import { type CubeBlockRequest, type CubeEnvelope, type CubeFlatRequestOptions, type CubeRequestOptions } from './cube.request';
|
|
4
|
+
export type CubeResource = {
|
|
5
|
+
baseUrl: string;
|
|
6
|
+
resourceName: string;
|
|
7
|
+
operation?: string;
|
|
8
|
+
};
|
|
9
|
+
/** The resource's capability document, served at `GET {cube-url}/{resource}`. */
|
|
10
|
+
export type CubeCapabilities = {
|
|
11
|
+
identity: string[];
|
|
12
|
+
maxPageSize: number;
|
|
13
|
+
/** `false` when the resource's rows carry no `ROW_REF`. */
|
|
14
|
+
addressable?: boolean;
|
|
15
|
+
};
|
|
16
|
+
/** The grid's block size: `max-rows`, capped at the largest page the cube serves. */
|
|
17
|
+
export declare const cubePageSize: (maxRows: unknown, maxPageSize?: number) => number;
|
|
18
|
+
export declare const cubeFilterParams: (field: FieldMetadata) => any;
|
|
19
|
+
export declare const describeCubeError: (error: unknown) => string;
|
|
20
|
+
/** A named operation's schema does not say which of its columns it lets callers filter, so none offer a filter. */
|
|
21
|
+
export declare const withoutColumnFilters: (colDefs: ColDef[]) => ColDef[];
|
|
22
|
+
/** Cube columns other than dates become groupable, and number columns aggregatable, on the `query` endpoint. */
|
|
23
|
+
export declare const toCubeColumnDefs: (colDefs: ColDef[], fieldMetadata: FieldMetadata[], operation?: string) => ColDef[];
|
|
24
|
+
export declare class CubeClient {
|
|
25
|
+
private readonly http;
|
|
26
|
+
private readonly resource;
|
|
27
|
+
private capabilities?;
|
|
28
|
+
private schema?;
|
|
29
|
+
constructor(http: Http, resource: CubeResource);
|
|
30
|
+
private get resourceUrl();
|
|
31
|
+
fetchCapabilities(): Promise<CubeCapabilities>;
|
|
32
|
+
/**
|
|
33
|
+
* The capability document speaks for the resource's own rows. A named operation reshapes them,
|
|
34
|
+
* so its rows carry a `ROW_REF` only when its row schema lists one.
|
|
35
|
+
*/
|
|
36
|
+
rowsCarryRowRef(): Promise<boolean>;
|
|
37
|
+
/**
|
|
38
|
+
* A named operation's columns come from the resource's schema document. The `query` endpoint's
|
|
39
|
+
* schema does not list columns, so they come from a one-row page and enum values from a group-by.
|
|
40
|
+
*/
|
|
41
|
+
fetchFieldMetadata(criteria?: string): Promise<FieldMetadata[]>;
|
|
42
|
+
fetchRows(request: IServerSideGetRowsRequest, options: Omit<CubeRequestOptions, 'countField'>): Promise<CubeEnvelope>;
|
|
43
|
+
fetchFlatRows(request: CubeBlockRequest, options: CubeFlatRequestOptions): Promise<CubeEnvelope>;
|
|
44
|
+
private fetchSchemaDocument;
|
|
45
|
+
private fetchOperationFieldMetadata;
|
|
46
|
+
/** Read without the grid's criteria: that can widen later, and the values are read only once. */
|
|
47
|
+
private fetchDistinctValues;
|
|
48
|
+
private fetchEnvelope;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=cube.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cube.client.d.ts","sourceRoot":"","sources":["../../../src/datasource/cube.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,E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,WAAW,GAGtB;IAED,iBAAiB,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAK9C;;;OAGG;IACG,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC;IAUzC;;;OAGG;IACG,kBAAkB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAc/D,SAAS,CACb,OAAO,EAAE,yBAAyB,EAClC,OAAO,EAAE,IAAI,CAAC,kBAAkB,EAAE,YAAY,CAAC,GAC9C,OAAO,CAAC,YAAY,CAAC;IAiBxB,aAAa,CAAC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,YAAY,CAAC;IAIhG,OAAO,CAAC,mBAAmB;YAKb,2BAA2B;IAWzC,iGAAiG;YACnF,mBAAmB;IAYjC,OAAO,CAAC,aAAa;CAUtB"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import type { IServerSideGetRowsRequest, LoadSuccessParams, SortModelItem } from '@ag-grid-community/core';
|
|
2
|
+
import { type FieldMetadata, FieldTypeEnum } from '@genesislcap/foundation-comms';
|
|
3
|
+
export declare const CUBE_ROW_REF = "ROW_REF";
|
|
4
|
+
export declare const CUBE_CHILD_COUNT = "cubeChildCount";
|
|
5
|
+
declare const CUBE_AGG_FUNCTIONS: {
|
|
6
|
+
readonly sum: "SUM";
|
|
7
|
+
readonly min: "MIN";
|
|
8
|
+
readonly max: "MAX";
|
|
9
|
+
readonly count: "COUNT";
|
|
10
|
+
readonly avg: "AVG";
|
|
11
|
+
};
|
|
12
|
+
export declare const CUBE_ALLOWED_AGG_FUNCS: string[];
|
|
13
|
+
type CubeAggregateFunction = (typeof CUBE_AGG_FUNCTIONS)[keyof typeof CUBE_AGG_FUNCTIONS];
|
|
14
|
+
export type CubeColumn = {
|
|
15
|
+
name: string;
|
|
16
|
+
role: string;
|
|
17
|
+
type: string;
|
|
18
|
+
numberAsString?: boolean;
|
|
19
|
+
};
|
|
20
|
+
export type CubeEnvelope = {
|
|
21
|
+
rows: Record<string, unknown>[];
|
|
22
|
+
hasMore: boolean;
|
|
23
|
+
rowKind: string;
|
|
24
|
+
columns: CubeColumn[];
|
|
25
|
+
generation?: string;
|
|
26
|
+
};
|
|
27
|
+
type CubeFieldExpr = {
|
|
28
|
+
type: 'field';
|
|
29
|
+
attribute: string;
|
|
30
|
+
};
|
|
31
|
+
export type CubeQueryBody = {
|
|
32
|
+
filter?: string;
|
|
33
|
+
sort?: string;
|
|
34
|
+
page: number;
|
|
35
|
+
size: number;
|
|
36
|
+
groupKeys?: {
|
|
37
|
+
expr: CubeFieldExpr;
|
|
38
|
+
alias: string;
|
|
39
|
+
}[];
|
|
40
|
+
aggregates?: {
|
|
41
|
+
function: CubeAggregateFunction;
|
|
42
|
+
input: CubeFieldExpr;
|
|
43
|
+
alias: string;
|
|
44
|
+
}[];
|
|
45
|
+
};
|
|
46
|
+
export type CubeFlatRequestOptions = {
|
|
47
|
+
baseCriteria?: string;
|
|
48
|
+
fieldTypes: ReadonlyMap<string, FieldTypeEnum>;
|
|
49
|
+
/** A cube sort, such as `-price,name`, applied while the grid itself is unsorted. */
|
|
50
|
+
defaultSort?: string;
|
|
51
|
+
};
|
|
52
|
+
export type CubeRequestOptions = Omit<CubeFlatRequestOptions, 'defaultSort'> & {
|
|
53
|
+
/** A column that is never null, such as the cube's identity; group children are counted on it. */
|
|
54
|
+
countField?: string;
|
|
55
|
+
};
|
|
56
|
+
export type CubeBlockRequest = {
|
|
57
|
+
startRow: number;
|
|
58
|
+
endRow: number;
|
|
59
|
+
sortModel?: SortModelItem[];
|
|
60
|
+
filterModel?: unknown;
|
|
61
|
+
};
|
|
62
|
+
export type CubeColumnSchema = {
|
|
63
|
+
genesisType?: string;
|
|
64
|
+
enum?: unknown[];
|
|
65
|
+
oneOf?: {
|
|
66
|
+
enum?: unknown[];
|
|
67
|
+
}[];
|
|
68
|
+
};
|
|
69
|
+
export type CubeRowSchema = {
|
|
70
|
+
properties?: Record<string, CubeColumnSchema>;
|
|
71
|
+
};
|
|
72
|
+
export declare const toFieldMetadata: (columns: CubeColumn[]) => FieldMetadata[];
|
|
73
|
+
export declare const toOperationFieldMetadata: ({ properties }: CubeRowSchema) => FieldMetadata[];
|
|
74
|
+
/**
|
|
75
|
+
* A group's key becomes the equality criteria its children are read with. How the cube serialises
|
|
76
|
+
* dates, and which date literals its filter accepts, is not documented, so dates are not grouped.
|
|
77
|
+
*/
|
|
78
|
+
export declare const isCubeGroupable: (type: FieldTypeEnum | undefined) => boolean;
|
|
79
|
+
/** Joins criteria with `&&`, parenthesising each so an `||` inside one cannot leak. */
|
|
80
|
+
export declare const joinCriteria: (parts: Array<string | null | undefined>) => string | undefined;
|
|
81
|
+
/** Sorts on columns outside `allowed` are dropped: the cube rejects sorting by a column it does not return. */
|
|
82
|
+
export declare const toCubeSort: (sortModel: SortModelItem[] | undefined, allowed?: Pick<ReadonlySet<string>, "has">) => string | undefined;
|
|
83
|
+
export declare const toCubeFlatQueryBody: (request: CubeBlockRequest, { baseCriteria, fieldTypes, defaultSort }: CubeFlatRequestOptions) => CubeQueryBody;
|
|
84
|
+
/**
|
|
85
|
+
* A level with a row-group column below it is read as a group-by of that column, aggregating the
|
|
86
|
+
* value columns; the keys of the expanded parent groups become equality criteria.
|
|
87
|
+
*/
|
|
88
|
+
export declare const toCubeQueryBody: (request: IServerSideGetRowsRequest, { baseCriteria, fieldTypes, countField }: CubeRequestOptions) => CubeQueryBody;
|
|
89
|
+
export declare const toOperationSearchParams: ({ filter, sort, page, size }: CubeQueryBody) => string;
|
|
90
|
+
/** The cube reports no total, so the row count stays open until the last page. */
|
|
91
|
+
export declare const cubeRowCount: (envelope: CubeEnvelope, startRow: number) => number | undefined;
|
|
92
|
+
export declare const toLoadSuccess: (envelope: CubeEnvelope, startRow: number) => LoadSuccessParams;
|
|
93
|
+
/**
|
|
94
|
+
* Unique across group levels, which the Server-Side Row Model requires of row ids. `key` is a
|
|
95
|
+
* group row's group value, or a leaf's row id.
|
|
96
|
+
*/
|
|
97
|
+
export declare const toCubeRowId: (parentKeys: string[] | undefined, key: unknown) => string;
|
|
98
|
+
export {};
|
|
99
|
+
//# sourceMappingURL=cube.request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cube.request.d.ts","sourceRoot":"","sources":["../../../src/datasource/cube.request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,KAAK,aAAa,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAIlF,eAAO,MAAM,YAAY,YAAY,CAAC;AAEtC,eAAO,MAAM,gBAAgB,mBAAmB,CAAC;AAEjD,QAAA,MAAM,kBAAkB;;;;;;CAMd,CAAC;AAEX,eAAO,MAAM,sBAAsB,UAAkC,CAAC;AAEtE,KAAK,qBAAqB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAC;AAE1F,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,aAAa,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1D,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,CAAC,EAAE,MAAM,CA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E,KAAG,aAAa,EAGQ,CAAC;AAE9E,eAAO,MAAM,wBAAwB,GAAI,gBAAqB,aAAa,KAAG,aAAa,EASrF,CAAC;AAIP;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM,aAAa,GAAG,SAAS,KAAG,OACF,CAAC;AAkCjE,uFAAuF;AACvF,eAAO,MAAM,YAAY,GAAI,OAAO,KAAK,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,KAAG,MAAM,GAAG,SAI/E,CAAC;AAEF,+GAA+G;AAC/G,eAAO,MAAM,UAAU,GACrB,WAAW,aAAa,EAAE,GAAG,SAAS,EACtC,UAAU,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,KACzC,MAAM,GAAG,SAKX,CAAC;AA0BF,eAAO,MAAM,mBAAmB,GAC9B,SAAS,gBAAgB,EACzB,2CAA2C,sBAAsB,KAChE,aAID,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,eAAe,GAC1B,SAAS,yBAAyB,EAClC,0CAA0C,kBAAkB,KAC3D,aAiCF,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,8BAA8B,aAAa,KAAG,MAOrF,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,YAAY,GAAI,UAAU,YAAY,EAAE,UAAU,MAAM,KAAG,MAAM,GAAG,SACT,CAAC;AAEzE,eAAO,MAAM,aAAa,GAAI,UAAU,YAAY,EAAE,UAAU,MAAM,KAAG,iBAIxE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,YAAY,MAAM,EAAE,GAAG,SAAS,EAAE,KAAK,OAAO,KAAG,MACvB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { FieldMetadata, FieldTypeEnum, Http } from '@genesislcap/foundation-comms';
|
|
2
|
+
import { CubeClient } from './cube.client';
|
|
3
|
+
/** What the cube plumbing reads off the datasource element that owns it. */
|
|
4
|
+
export type CubeSourceHost = {
|
|
5
|
+
readonly http: Http;
|
|
6
|
+
readonly cubeUrl: string;
|
|
7
|
+
readonly cubeOperation: string;
|
|
8
|
+
readonly resourceName: string;
|
|
9
|
+
readonly rowIdAttr?: string;
|
|
10
|
+
readonly maxRows: number;
|
|
11
|
+
};
|
|
12
|
+
export type CubeGridSettings = {
|
|
13
|
+
cacheBlockSize: number;
|
|
14
|
+
/** `false` when the cube's rows carry no `ROW_REF` and `row-id` names no column. */
|
|
15
|
+
rowsCarryId: boolean;
|
|
16
|
+
};
|
|
17
|
+
export type CubeSchema = Pick<CubeGridSettings, 'rowsCarryId'> & {
|
|
18
|
+
client: CubeClient;
|
|
19
|
+
fieldMetadata: FieldMetadata[];
|
|
20
|
+
fieldTypes: Map<string, FieldTypeEnum>;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* The cube state the infinite and server-side datasource elements share: the client for the
|
|
24
|
+
* element's current cube attributes, and whether a read still belongs to the grid it started for.
|
|
25
|
+
*/
|
|
26
|
+
export declare class CubeSource {
|
|
27
|
+
private readonly host;
|
|
28
|
+
private cubeClient?;
|
|
29
|
+
private epoch;
|
|
30
|
+
constructor(host: CubeSourceHost);
|
|
31
|
+
/** The element is tearing down or restarting: reads in flight are stale and the client is rebuilt. */
|
|
32
|
+
reset(): void;
|
|
33
|
+
/** Resolves `undefined` when the element was reset while the cube was being read. */
|
|
34
|
+
readGridSettings(): Promise<CubeGridSettings | undefined>;
|
|
35
|
+
/**
|
|
36
|
+
* Resolves `undefined` when the element was reset while the cube was being read, and rejects
|
|
37
|
+
* when the cube cannot be read.
|
|
38
|
+
*/
|
|
39
|
+
readSchema(criteria?: string): Promise<CubeSchema | undefined>;
|
|
40
|
+
private rowsCarryId;
|
|
41
|
+
private get client();
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=cube.source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cube.source.d.ts","sourceRoot":"","sources":["../../../src/datasource/cube.source.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AOjB;CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Connect, ConnectEvents, Datasource } from '@genesislcap/foundation-comms';
|
|
1
|
+
import { Connect, ConnectEvents, Datasource, Http } from '@genesislcap/foundation-comms';
|
|
2
2
|
import { GridProBaseDatasource } from './base.datasource';
|
|
3
3
|
declare const GridProInfiniteDatasource_base: (new (...args: any[]) => {
|
|
4
4
|
#_container: import("@genesislcap/foundation-utils").FoundationLayoutContainer | import("@genesislcap/foundation-utils").LayoutCacheContainer | import("@genesislcap/foundation-utils").DOMContainer;
|
|
@@ -389,6 +389,16 @@ declare const GridProInfiniteDatasource_base: (new (...args: any[]) => {
|
|
|
389
389
|
* Use this instead of Server-Side Row Model when you don't need Enterprise features
|
|
390
390
|
* like row grouping, aggregation, or pivoting.
|
|
391
391
|
*
|
|
392
|
+
* **Genesis Spring data cubes**: with `cube-url` set, `resource-name` names a cube resource read
|
|
393
|
+
* over HTTP from that URL: its `query` endpoint as flat rows, or the named `cube-operation`.
|
|
394
|
+
* Filtering, sorting (on several columns) and paging run on the cube; `criteria` restricts every
|
|
395
|
+
* request and `order-by` takes a cube sort such as `-price,name` for a grid that is not sorted.
|
|
396
|
+
* Rows are read on demand, and re-read on a commit ACK for an event in `pollTriggerEvents`. The
|
|
397
|
+
* Genesis stream attributes (`is-snapshot`, `max-view`, `reverse`, `request`) do not apply.
|
|
398
|
+
* Rows that carry no id - a resource that is not `addressable`, or a named operation whose rows
|
|
399
|
+
* have no `ROW_REF`, with no `row-id` set - are identified by position and raise no
|
|
400
|
+
* `datasource-data-changed`.
|
|
401
|
+
*
|
|
392
402
|
* @see https://www.ag-grid.com/javascript-data-grid/infinite-scrolling/
|
|
393
403
|
* @beta
|
|
394
404
|
*
|
|
@@ -413,12 +423,33 @@ export declare class GridProInfiniteDatasource extends GridProInfiniteDatasource
|
|
|
413
423
|
connect: Connect;
|
|
414
424
|
connectEvents: ConnectEvents;
|
|
415
425
|
datasource: Datasource;
|
|
426
|
+
http: Http;
|
|
427
|
+
/**
|
|
428
|
+
* The base URL of a Genesis Spring data cube API, such as `/gwf/my-spring-app/api/v1/cubes`.
|
|
429
|
+
* @remarks When set, `resource-name` names a cube resource on it rather than a Genesis resource.
|
|
430
|
+
*/
|
|
431
|
+
cubeUrl: string;
|
|
432
|
+
/**
|
|
433
|
+
* A named cube operation to read instead of the cube resource's `query` endpoint.
|
|
434
|
+
* @remarks Only applies with `cube-url`. Its columns offer no filters, because its schema does
|
|
435
|
+
* not say which columns it accepts filters on; `criteria` still applies.
|
|
436
|
+
*/
|
|
437
|
+
cubeOperation: string;
|
|
416
438
|
request: any;
|
|
417
439
|
private indexes;
|
|
418
440
|
private infiniteDatasource;
|
|
441
|
+
private readonly cube;
|
|
442
|
+
private initialised;
|
|
419
443
|
/** Unsubscribes the commit-response listener behind `pollTriggerEvents`. @internal */
|
|
420
444
|
private commitResponseUnsubscribe?;
|
|
445
|
+
protected get rowId(): string;
|
|
446
|
+
private get isCube();
|
|
421
447
|
resourceNameChanged(oldValue: string, newValue: string): void;
|
|
448
|
+
cubeUrlChanged(oldValue: string, newValue: string): void;
|
|
449
|
+
cubeOperationChanged(oldValue: string, newValue: string): void;
|
|
450
|
+
private restartOnCubeSourceChange;
|
|
451
|
+
/** Cube reads go over HTTP, so a socket drop says nothing about them. */
|
|
452
|
+
private syncConnectionSubscription;
|
|
422
453
|
criteriaChanged(oldCriteria: string, newCriteria: string): void;
|
|
423
454
|
connectedCallback(): void;
|
|
424
455
|
disconnectedCallback(): void;
|
|
@@ -459,6 +490,11 @@ export declare class GridProInfiniteDatasource extends GridProInfiniteDatasource
|
|
|
459
490
|
private isInfiniteSupportedForResource;
|
|
460
491
|
/** @internal */
|
|
461
492
|
private onDatasourceReady;
|
|
493
|
+
/** @internal */
|
|
494
|
+
private attachInfiniteDatasource;
|
|
495
|
+
private cubeGridOptions;
|
|
496
|
+
private onCubeReady;
|
|
497
|
+
private reloadCubeData;
|
|
462
498
|
/**
|
|
463
499
|
* A pushed INSERT/DELETE changes which rows exist or their order, so the change is reported
|
|
464
500
|
* and then the rows are re-read (purge).
|
|
@@ -502,8 +538,8 @@ export declare class GridProInfiniteDatasource extends GridProInfiniteDatasource
|
|
|
502
538
|
* Honours `pollTriggerEvents` without polling: a commit ACK for one of the listed events
|
|
503
539
|
* means a write went through this session, so the loaded blocks are re-read in place - the
|
|
504
540
|
* same action as `applyTransaction`, which keeps the grid's row count and scroll position.
|
|
505
|
-
* @remarks REQUEST_SERVER only. DATASERVER already receives every change on
|
|
506
|
-
* subscription, so a commit-triggered re-read there would just duplicate the live push.
|
|
541
|
+
* @remarks REQUEST_SERVER and cube resources only. DATASERVER already receives every change on
|
|
542
|
+
* the paging subscription, so a commit-triggered re-read there would just duplicate the live push.
|
|
507
543
|
* @internal
|
|
508
544
|
*/
|
|
509
545
|
private setupCommitTriggeredRefresh;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"infinite.datasource.d.ts","sourceRoot":"","sources":["../../../src/datasource/infinite.datasource.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EACP,aAAa,EACb,UAAU,
|
|
1
|
+
{"version":3,"file":"infinite.datasource.d.ts","sourceRoot":"","sources":["../../../src/datasource/infinite.datasource.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EACP,aAAa,EACb,UAAU,EAGV,IAAI,EAKL,MAAM,+BAA+B,CAAC;AAgBvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;;;;;;;;kBA6CgC,CAAC;;;;;;;;8BAiBzD,CAAA,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAiBwB,CAAC;4IAGrC,CAAC;wFAIR,CAAC;+IAGW,CAAC;2FAKL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAsChC,CAAC;;;;;;;;;;;;;;;;;;;;;;;mBA2DM,CAAC;;;;;;;;;;;;;6BAwBb,CAAD;8BAEK,CAAF;kBAII,C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
+
import { type CubeRowReports } from './cube.block-loads';
|
|
3
|
+
import { type CubeBlockRequest, type CubeEnvelope } from './cube.request';
|
|
4
|
+
export type CubeInfiniteDatasourceOptions = CubeRowReports & {
|
|
5
|
+
fetchRows: (request: CubeBlockRequest) => Promise<CubeEnvelope>;
|
|
6
|
+
onNoDataAvailable?: () => void;
|
|
7
|
+
onDataAvailable?: () => void;
|
|
8
|
+
onError?: (error: unknown) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare class CubeInfiniteDatasource implements IDatasource {
|
|
11
|
+
private readonly options;
|
|
12
|
+
private readonly loads;
|
|
13
|
+
private detached;
|
|
14
|
+
constructor(options: CubeInfiniteDatasourceOptions);
|
|
15
|
+
getRows(params: IGetRowsParams): void;
|
|
16
|
+
invalidatePendingLoads(): void;
|
|
17
|
+
/** AG Grid calls this on a datasource it then keeps using, so replies in flight stay valid. */
|
|
18
|
+
destroy(): void;
|
|
19
|
+
/** The host is replacing this instance; AG Grid keeps asking it for blocks until the swap. */
|
|
20
|
+
detach(): void;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=infinite.resource-cube.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"infinite.resource-cube.d.ts","sourceRoot":"","sources":["../../../src/datasource/infinite.resource-cube.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,YAAY,EAAgB,MAAM,gBAAgB,CAAC;AAExF,MAAM,MAAM,6BAA6B,GAAG,cAAc,GAAG;IAC3D,SAAS,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IAChE,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACpC,CAAC;AAIF,qBAAa,sBAAuB,YAAW,WAAW;IAI5C,OAAO,CAAC,QAAQ,CAAC,OAAO;IAHpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAiB;IACvC,OAAO,CAAC,QAAQ,CAAS;gBAEI,OAAO,EAAE,6BAA6B;IAInE,OAAO,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI;IAoCrC,sBAAsB,IAAI,IAAI;IAI9B,+FAA+F;IAC/F,OAAO,IAAI,IAAI;IAIf,8FAA8F;IAC9F,MAAM,IAAI,IAAI;CAIf"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Datasource, DatasourceOptions } from '@genesislcap/foundation-comms';
|
|
1
|
+
import { Datasource, DatasourceOptions, Http } from '@genesislcap/foundation-comms';
|
|
2
2
|
import { GridProBaseDatasource } from './base.datasource';
|
|
3
3
|
declare const GridProServerSideDatasource_base: (new (...args: any[]) => {
|
|
4
4
|
#_container: import("@genesislcap/foundation-utils").FoundationLayoutContainer | import("@genesislcap/foundation-utils").LayoutCacheContainer | import("@genesislcap/foundation-utils").DOMContainer;
|
|
@@ -375,6 +375,16 @@ declare const GridProServerSideDatasource_base: (new (...args: any[]) => {
|
|
|
375
375
|
* `criteriaOnlyRequest`. A req/rep resource without it reports a `resource-type` error and no
|
|
376
376
|
* datasource is attached to the grid.
|
|
377
377
|
*
|
|
378
|
+
* **Genesis Spring data cubes**: with `cube-url` set, `resource-name` names a cube resource read
|
|
379
|
+
* over HTTP from that URL: its `query` endpoint, or the named `cube-operation`. Filtering, sorting
|
|
380
|
+
* and paging run on the cube, and on the `query` endpoint row grouping and value aggregation do
|
|
381
|
+
* too; `criteria` restricts every request. The Genesis stream attributes (`live-updates`, polling,
|
|
382
|
+
* `is-snapshot`, `order-by`, `request`) do not apply. Row grouping also requires the AG Grid
|
|
383
|
+
* Enterprise `RowGroupingModule`, and is not offered on date and datetime columns: a request that
|
|
384
|
+
* groups by one is refused and reported as a datasource error. Rows that carry no id - a resource
|
|
385
|
+
* that is not `addressable`, or a named operation whose rows have no `ROW_REF`, with no `row-id`
|
|
386
|
+
* set - get AG Grid's own row ids and raise no `datasource-data-changed`.
|
|
387
|
+
*
|
|
378
388
|
* **Custom Sort Indicators**: This datasource automatically applies custom sort indicators that are always visible (instead of only on hover).
|
|
379
389
|
* Sortable columns will show a subtle sort icon even when not sorted, and active sort indicators will be more prominent.
|
|
380
390
|
* The custom styling uses AG Grid's native icon font for consistency with the grid theme.
|
|
@@ -403,19 +413,49 @@ declare const GridProServerSideDatasource_base: (new (...args: any[]) => {
|
|
|
403
413
|
*/
|
|
404
414
|
export declare class GridProServerSideDatasource extends GridProServerSideDatasource_base {
|
|
405
415
|
pollingDatasource: Datasource;
|
|
416
|
+
http: Http;
|
|
406
417
|
/**
|
|
407
418
|
* Enable live updates for the grid.
|
|
408
419
|
* @remarks Only works with DATASERVER resources (StreamDatasource) right now.
|
|
409
420
|
*/
|
|
410
421
|
liveUpdates: boolean;
|
|
422
|
+
/**
|
|
423
|
+
* The base URL of a Genesis Spring data cube API, such as `/gwf/my-spring-app/api/v1/cubes`.
|
|
424
|
+
* @remarks When set, `resource-name` names a cube resource on it rather than a Genesis resource.
|
|
425
|
+
*/
|
|
426
|
+
cubeUrl: string;
|
|
427
|
+
/**
|
|
428
|
+
* A named cube operation to read instead of the cube resource's `query` endpoint.
|
|
429
|
+
* @remarks Only applies with `cube-url`. A named operation returns rows it has already
|
|
430
|
+
* aggregated, so row grouping is not available on it. Its columns offer no filters, because its
|
|
431
|
+
* schema does not say which columns it accepts filters on; `criteria` still applies.
|
|
432
|
+
*/
|
|
433
|
+
cubeOperation: string;
|
|
411
434
|
request: any;
|
|
412
435
|
private indexes;
|
|
413
436
|
private ssrmDatasource;
|
|
437
|
+
private readonly cube;
|
|
438
|
+
private cubeSsrmDatasource;
|
|
439
|
+
private initialised;
|
|
414
440
|
private liveUpdatesStream;
|
|
441
|
+
private filterSub;
|
|
442
|
+
protected get rowId(): string;
|
|
443
|
+
private get isCube();
|
|
415
444
|
resourceNameChanged(oldValue: string, newValue: string): void;
|
|
445
|
+
cubeUrlChanged(oldValue: string, newValue: string): void;
|
|
446
|
+
cubeOperationChanged(oldValue: string, newValue: string): void;
|
|
416
447
|
criteriaChanged(oldCriteria: string, newCriteria: string): void;
|
|
417
448
|
connectedCallback(): void;
|
|
418
449
|
disconnectedCallback(): void;
|
|
450
|
+
/** Cube reads go over HTTP, so a socket drop says nothing about them. */
|
|
451
|
+
private syncConnectionSubscription;
|
|
452
|
+
/**
|
|
453
|
+
* Re-reads an attached cube once a burst of `setFilter()` / `removeFilter()` calls settles.
|
|
454
|
+
* @remarks Genesis resources are left as they were: their criteria is fixed when the stream or
|
|
455
|
+
* request is created.
|
|
456
|
+
*/
|
|
457
|
+
private subscribeToFilterChanges;
|
|
458
|
+
private unsubscribeFromFilterChanges;
|
|
419
459
|
deepClone(): Node;
|
|
420
460
|
/**
|
|
421
461
|
* Resets the grid data while keeping columnDefs and reloads data.
|
|
@@ -434,6 +474,7 @@ export declare class GridProServerSideDatasource extends GridProServerSideDataso
|
|
|
434
474
|
*/
|
|
435
475
|
private removeServerSideSortIndicatorStyling;
|
|
436
476
|
init(): Promise<void>;
|
|
477
|
+
private genesisGridOptions;
|
|
437
478
|
private clearReadyListener;
|
|
438
479
|
private onDatasourceReady;
|
|
439
480
|
destroy(): Promise<void>;
|
|
@@ -527,6 +568,13 @@ export declare class GridProServerSideDatasource extends GridProServerSideDataso
|
|
|
527
568
|
private createDataserverStream;
|
|
528
569
|
private getAgColumnDefs;
|
|
529
570
|
loadMore(): void;
|
|
571
|
+
private restartOnCubeSourceChange;
|
|
572
|
+
private cubeGridOptions;
|
|
573
|
+
/** A group row is identified by its group value: only some cubes give group rows a `ROW_REF`. */
|
|
574
|
+
private cubeRowId;
|
|
575
|
+
private onCubeReady;
|
|
576
|
+
private reloadCubeData;
|
|
577
|
+
private purgeCubeRows;
|
|
530
578
|
}
|
|
531
579
|
export {};
|
|
532
580
|
//# sourceMappingURL=server-side.datasource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-side.datasource.d.ts","sourceRoot":"","sources":["../../../src/datasource/server-side.datasource.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,iBAAiB,
|
|
1
|
+
{"version":3,"file":"server-side.datasource.d.ts","sourceRoot":"","sources":["../../../src/datasource/server-side.datasource.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,iBAAiB,EAGjB,IAAI,EASL,MAAM,+BAA+B,CAAC;AAgBvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;;;;;;;;kBAuCjC,CAAC;;;;;;;;8BAgB6C,CAAA,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAarE,CAAC;4IAKoD,CAAC;wFAKnC,CAAC;+IAGX,CAAC;2FAIR,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BA+BU,CAAC;;;;;;;;;;;;;;;;;;;;;;;mBAkE8C,CAAC;;;;;;;;;;;;;6BAwBxE,CAAA;8BAIe,CAAC;kBAC8B,CAAA;;oBAEhD,CAAD;;sBAGC,CAAC;oBAEyB,CAAC;;;;;;;;gDAYuC,CAAC;;;;;;;;;;;;;;;;;;uBAcjB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4EAkH5C,CAAC;yBACD,CAAC;UAEN,GAAC;WAG2B,GAAG;;gBAK/B,GAAG;;;;;;;WAQsC,GAAG;YAEpB,GAAG;;;;;;;;;;;oBAuBzB,GAAH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAO,CAAC,IAAI,CAAC;IAgEnE;;;OAGG;IACH,OAAO,CAAC,mCAAmC;IAU3C;;;OAGG;IACH,OAAO,CAAC,oCAAoC;IAMtC,IAAI;IAwBV,OAAO,CAAC,kBAAkB;IA8B1B,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,iBAAiB,CA0FvB;IAEa,OAAO;IAyBP,OAAO;IAKtB;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IAcpB;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,0BAA0B;IAYlC;;;;;;OAMG;IACH,OAAO,CAAC,0BAA0B;YAKpB,mBAAmB;IAKjC;;;;;;;;;;;;OAYG;YACW,kBAAkB;IA+BhC;;;;;;OAMG;IACH,OAAO,CAAC,kBAAkB,CAA+B;IAEzD;;;;;;;;;OASG;IACH,OAAO,CAAC,0BAA0B,CAAS;IAE3C;;;;;;OAMG;IACI,uBAAuB;IAM9B;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,wBAAwB;IAiGhC,OAAO,CAAC,yBAAyB;YA4DnB,sBAAsB;YAqEtB,eAAe;IAuBpB,QAAQ;IAIjB,OAAO,CAAC,yBAAyB;YAQnB,eAAe;IAmB7B,iGAAiG;IACjG,OAAO,CAAC,SAAS,CAIf;YAEY,WAAW;YA2CX,cAAc;IAQ5B,OAAO,CAAC,aAAa;CAStB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { IServerSideDatasource, IServerSideGetRowsParams, IServerSideGetRowsRequest } from '@ag-grid-community/core';
|
|
2
|
+
import { type CubeRowReports } from './cube.block-loads';
|
|
3
|
+
import { type CubeEnvelope } from './cube.request';
|
|
4
|
+
export type CubeServerSideDatasourceOptions = CubeRowReports & {
|
|
5
|
+
fetchRows: (request: IServerSideGetRowsRequest) => Promise<CubeEnvelope>;
|
|
6
|
+
onNoDataAvailable?: () => void;
|
|
7
|
+
onDataAvailable?: () => void;
|
|
8
|
+
onError?: (error: unknown) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare class CubeServerSideDatasource implements IServerSideDatasource {
|
|
11
|
+
private readonly options;
|
|
12
|
+
private readonly loads;
|
|
13
|
+
private rowGroupFields;
|
|
14
|
+
constructor(options: CubeServerSideDatasourceOptions);
|
|
15
|
+
getRows(params: IServerSideGetRowsParams): void;
|
|
16
|
+
invalidatePendingLoads(): void;
|
|
17
|
+
destroy(): void;
|
|
18
|
+
/** The column the latest request groups the rows at `level` by; none when they are leaves. */
|
|
19
|
+
groupFieldAt(level: number): string | undefined;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=server-side.resource-cube.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-side.resource-cube.d.ts","sourceRoot":"","sources":["../../../src/datasource/server-side.resource-cube.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,KAAK,YAAY,EAAiB,MAAM,gBAAgB,CAAC;AAElE,MAAM,MAAM,+BAA+B,GAAG,cAAc,GAAG;IAC7D,SAAS,EAAE,CAAC,OAAO,EAAE,yBAAyB,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IACzE,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACpC,CAAC;AAWF,qBAAa,wBAAyB,YAAW,qBAAqB;IAIxD,OAAO,CAAC,QAAQ,CAAC,OAAO;IAHpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAiB;IACvC,OAAO,CAAC,cAAc,CAAgB;gBAET,OAAO,EAAE,+BAA+B;IAIrE,OAAO,CAAC,MAAM,EAAE,wBAAwB,GAAG,IAAI;IAmC/C,sBAAsB,IAAI,IAAI;IAI9B,OAAO,IAAI,IAAI;IAIf,8FAA8F;IAC9F,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CAGhD"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ColDef } from '@ag-grid-community/core';
|
|
2
2
|
import type { FieldMetadata } from '@genesislcap/foundation-comms';
|
|
3
3
|
import type { GenesisInfiniteDatasource } from '../datasource/infinite.resource';
|
|
4
|
+
import type { CubeInfiniteDatasource } from '../datasource/infinite.resource-cube';
|
|
4
5
|
/**
|
|
5
6
|
* Event names for datasource-grid communication
|
|
6
7
|
* These represent datasource operations, not grid-specific actions
|
|
@@ -113,7 +114,7 @@ export interface GridCssClassEventDetail {
|
|
|
113
114
|
* @remarks `null` clears the datasource from the grid on teardown.
|
|
114
115
|
*/
|
|
115
116
|
export interface SetInfiniteDatasourceEventDetail {
|
|
116
|
-
datasource: GenesisInfiniteDatasource | null;
|
|
117
|
+
datasource: GenesisInfiniteDatasource | CubeInfiniteDatasource | null;
|
|
117
118
|
}
|
|
118
119
|
/**
|
|
119
120
|
* Event detail for requesting an infinite row model refresh.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datasource-events.types.d.ts","sourceRoot":"","sources":["../../../src/grid-pro-genesis-datasource/datasource-events.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"datasource-events.types.d.ts","sourceRoot":"","sources":["../../../src/grid-pro-genesis-datasource/datasource-events.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MA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C;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,QAAQ,GAAG,UAAU,GAAG,YAAY,GAAG,SAAS,CAAC;CACxD;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,gCAAgC;IAC/C,UAAU,EAAE,yBAAyB,GAAG,sBAAsB,GAAG,IAAI,CAAC;CACvE;AAED;;;;;GAKG;AACH,MAAM,WAAW,+BAA+B;IAC9C,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAC7B,qBAAqB,GACrB,qBAAqB,GACrB,sBAAsB,GACtB,wBAAwB,GACxB,4BAA4B,GAC5B,sBAAsB,GACtB,sBAAsB,GACtB,0BAA0B,GAC1B,4BAA4B,GAC5B,uBAAuB,GACvB,gCAAgC,GAChC,+BAA+B,CAAC;AAEpC;;GAEG;AACH,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,qBAAqB,CAAE,SAAQ,WAAW,CAAC,CAAC,CAAC;IAChF,IAAI,EAAE,MAAM,OAAO,oBAAoB,CAAC;CACzC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { DeliveredBlockLedger } from './delivered-block.ledger';
|
|
2
|
+
/**
|
|
3
|
+
* What both cube row-model datasources track about their block loads: which replies the grid
|
|
4
|
+
* still wants, and what the delivered ones changed about the rows the host holds.
|
|
5
|
+
*/
|
|
6
|
+
export class CubeBlockLoads {
|
|
7
|
+
constructor(reports) {
|
|
8
|
+
this.reports = reports;
|
|
9
|
+
this.generation = 0;
|
|
10
|
+
this.ledger = reports.rowId ? new DeliveredBlockLedger(reports.rowId) : undefined;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Starts a load read under `cacheKey`. A new key means AG Grid purged the blocks read under
|
|
14
|
+
* the previous one, so the rows reported so far are gone.
|
|
15
|
+
* @returns whether the grid still wants the load's reply, to ask once it arrives.
|
|
16
|
+
*/
|
|
17
|
+
begin(cacheKey) {
|
|
18
|
+
var _a, _b;
|
|
19
|
+
if (this.cacheKey !== undefined && this.cacheKey !== cacheKey) {
|
|
20
|
+
this.invalidate();
|
|
21
|
+
(_b = (_a = this.reports).onRowCacheReset) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
22
|
+
}
|
|
23
|
+
this.cacheKey = cacheKey;
|
|
24
|
+
const generation = this.generation;
|
|
25
|
+
return () => generation === this.generation;
|
|
26
|
+
}
|
|
27
|
+
/** Replies still in flight were read for a cache the grid is dropping, so they are discarded. */
|
|
28
|
+
invalidate() {
|
|
29
|
+
this.generation += 1;
|
|
30
|
+
this.forgetRows();
|
|
31
|
+
}
|
|
32
|
+
forgetRows() {
|
|
33
|
+
var _a;
|
|
34
|
+
(_a = this.ledger) === null || _a === void 0 ? void 0 : _a.clear();
|
|
35
|
+
}
|
|
36
|
+
deliver(startRow, rows) {
|
|
37
|
+
var _a, _b, _c, _d;
|
|
38
|
+
if (!this.ledger)
|
|
39
|
+
return;
|
|
40
|
+
const { withdrawnRowIds } = this.ledger.record(startRow, rows);
|
|
41
|
+
if (rows.length) {
|
|
42
|
+
(_b = (_a = this.reports).onRowsDelivered) === null || _b === void 0 ? void 0 : _b.call(_a, rows);
|
|
43
|
+
}
|
|
44
|
+
if (withdrawnRowIds.length) {
|
|
45
|
+
(_d = (_c = this.reports).onRowsWithdrawn) === null || _d === void 0 ? void 0 : _d.call(_c, withdrawnRowIds);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|