@genesislcap/grid-pro 14.419.0 → 14.419.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 +126 -0
- package/dist/dts/grid-pro-beta.d.ts +15 -1
- package/dist/dts/grid-pro-beta.d.ts.map +1 -1
- package/dist/dts/grid-pro.d.ts +12 -3
- package/dist/dts/grid-pro.d.ts.map +1 -1
- package/dist/esm/grid-pro-beta.js +137 -46
- package/dist/esm/grid-pro.js +84 -23
- package/dist/grid-pro.d.ts +27 -4
- package/package.json +14 -14
|
@@ -59,6 +59,27 @@
|
|
|
59
59
|
"text": "StatePersistence"
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
|
+
{
|
|
63
|
+
"kind": "field",
|
|
64
|
+
"name": "disposed",
|
|
65
|
+
"type": {
|
|
66
|
+
"text": "boolean"
|
|
67
|
+
},
|
|
68
|
+
"privacy": "private",
|
|
69
|
+
"default": "false"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"kind": "field",
|
|
73
|
+
"name": "debouncedSaveColumnState",
|
|
74
|
+
"privacy": "private",
|
|
75
|
+
"readonly": true
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"kind": "field",
|
|
79
|
+
"name": "debouncedSaveFilterModel",
|
|
80
|
+
"privacy": "private",
|
|
81
|
+
"readonly": true
|
|
82
|
+
},
|
|
62
83
|
{
|
|
63
84
|
"kind": "field",
|
|
64
85
|
"name": "autoCellRendererByType",
|
|
@@ -315,6 +336,15 @@
|
|
|
315
336
|
"privacy": "private",
|
|
316
337
|
"default": "[]"
|
|
317
338
|
},
|
|
339
|
+
{
|
|
340
|
+
"kind": "field",
|
|
341
|
+
"name": "datasourceEventHandlers",
|
|
342
|
+
"type": {
|
|
343
|
+
"text": "Array<[string, EventListener]>"
|
|
344
|
+
},
|
|
345
|
+
"privacy": "private",
|
|
346
|
+
"default": "[\n [datasourceEventNames.initialize, this.handleInitialize.bind(this) as EventListener],\n [datasourceEventNames.dataLoaded, this.handleDataLoaded.bind(this) as EventListener],\n [datasourceEventNames.dataChanged, this.handleDataChanged.bind(this) as EventListener],\n [datasourceEventNames.schemaUpdated, this.handleSchemaUpdated.bind(this) as EventListener],\n [datasourceEventNames.dataCleared, this.handleDataCleared.bind(this) as EventListener],\n [datasourceEventNames.loadingStarted, this.handleLoadingStarted.bind(this) as EventListener],\n [\n datasourceEventNames.loadingFinished,\n this.handleLoadingFinished.bind(this) as EventListener,\n ],\n [\n datasourceEventNames.noDataAvailable,\n this.handleNoDataAvailable.bind(this) as EventListener,\n ],\n [\n datasourceEventNames.filtersRestored,\n this.handleFiltersRestored.bind(this) as EventListener,\n ],\n [\n datasourceEventNames.moreDataAvailable,\n this.handleMoreDataAvailable.bind(this) as EventListener,\n ],\n [datasourceEventNames.error, this.handleDatasourceError.bind(this) as EventListener],\n [datasourceEventNames.destroy, this.handleDatasourceDestroy.bind(this) as EventListener],\n [datasourceEventNames.cacheFilterConfig, this.cacheFilterConfig.bind(this) as EventListener],\n [\n datasourceEventNames.refreshServerSide,\n this.handleRefreshServerSide.bind(this) as EventListener,\n ],\n [\n datasourceEventNames.setServerSideDatasource,\n this.handleSetServerSideDatasource.bind(this) as EventListener,\n ],\n [\n datasourceEventNames.addGridCssClass,\n this.handleAddGridCssClass.bind(this) as EventListener,\n ],\n [\n datasourceEventNames.removeGridCssClass,\n this.handleRemoveGridCssClass.bind(this) as EventListener,\n ],\n [\n datasourceEventNames.applyServerSideTransaction,\n this.handleApplyServerSideTransaction.bind(this) as EventListener,\n ],\n ]"
|
|
347
|
+
},
|
|
318
348
|
{
|
|
319
349
|
"kind": "field",
|
|
320
350
|
"name": "gridEventsQueue",
|
|
@@ -333,6 +363,12 @@
|
|
|
333
363
|
"privacy": "private",
|
|
334
364
|
"default": "new Set()"
|
|
335
365
|
},
|
|
366
|
+
{
|
|
367
|
+
"kind": "field",
|
|
368
|
+
"name": "gridEventListeners",
|
|
369
|
+
"privacy": "private",
|
|
370
|
+
"default": "new Map<string, (event: unknown) => void>()"
|
|
371
|
+
},
|
|
336
372
|
{
|
|
337
373
|
"kind": "field",
|
|
338
374
|
"name": "luminanceSubscription",
|
|
@@ -349,6 +385,12 @@
|
|
|
349
385
|
},
|
|
350
386
|
"privacy": "private"
|
|
351
387
|
},
|
|
388
|
+
{
|
|
389
|
+
"kind": "field",
|
|
390
|
+
"name": "boundGlobalEventListener",
|
|
391
|
+
"privacy": "private",
|
|
392
|
+
"readonly": true
|
|
393
|
+
},
|
|
352
394
|
{
|
|
353
395
|
"kind": "field",
|
|
354
396
|
"name": "_filterConfig",
|
|
@@ -479,6 +521,36 @@
|
|
|
479
521
|
"name": "handleLuminanceChange",
|
|
480
522
|
"privacy": "private"
|
|
481
523
|
},
|
|
524
|
+
{
|
|
525
|
+
"kind": "field",
|
|
526
|
+
"name": "luminanceObserver",
|
|
527
|
+
"type": {
|
|
528
|
+
"text": "object"
|
|
529
|
+
},
|
|
530
|
+
"privacy": "private",
|
|
531
|
+
"readonly": true,
|
|
532
|
+
"default": "{\n handleChange: (record: any) => this.handleLuminanceChange(record),\n }"
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
"kind": "method",
|
|
536
|
+
"name": "performDisconnectCleanup",
|
|
537
|
+
"privacy": "private",
|
|
538
|
+
"return": {
|
|
539
|
+
"type": {
|
|
540
|
+
"text": "void"
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
"kind": "method",
|
|
546
|
+
"name": "destroyGridInstance",
|
|
547
|
+
"privacy": "private",
|
|
548
|
+
"return": {
|
|
549
|
+
"type": {
|
|
550
|
+
"text": "void"
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
},
|
|
482
554
|
{
|
|
483
555
|
"kind": "method",
|
|
484
556
|
"name": "flashAddedCells",
|
|
@@ -1528,6 +1600,27 @@
|
|
|
1528
1600
|
"text": "StatePersistence"
|
|
1529
1601
|
}
|
|
1530
1602
|
},
|
|
1603
|
+
{
|
|
1604
|
+
"kind": "field",
|
|
1605
|
+
"name": "disposed",
|
|
1606
|
+
"type": {
|
|
1607
|
+
"text": "boolean"
|
|
1608
|
+
},
|
|
1609
|
+
"privacy": "private",
|
|
1610
|
+
"default": "false"
|
|
1611
|
+
},
|
|
1612
|
+
{
|
|
1613
|
+
"kind": "field",
|
|
1614
|
+
"name": "debouncedSaveColumnState",
|
|
1615
|
+
"privacy": "private",
|
|
1616
|
+
"readonly": true
|
|
1617
|
+
},
|
|
1618
|
+
{
|
|
1619
|
+
"kind": "field",
|
|
1620
|
+
"name": "debouncedSaveFilterModel",
|
|
1621
|
+
"privacy": "private",
|
|
1622
|
+
"readonly": true
|
|
1623
|
+
},
|
|
1531
1624
|
{
|
|
1532
1625
|
"kind": "field",
|
|
1533
1626
|
"name": "autoCellRendererByType",
|
|
@@ -1906,6 +1999,12 @@
|
|
|
1906
1999
|
"privacy": "private",
|
|
1907
2000
|
"default": "new Set()"
|
|
1908
2001
|
},
|
|
2002
|
+
{
|
|
2003
|
+
"kind": "field",
|
|
2004
|
+
"name": "gridEventListeners",
|
|
2005
|
+
"privacy": "private",
|
|
2006
|
+
"default": "new Map<string, (event: unknown) => void>()"
|
|
2007
|
+
},
|
|
1909
2008
|
{
|
|
1910
2009
|
"kind": "field",
|
|
1911
2010
|
"name": "visibilityObserverCleanup",
|
|
@@ -1914,6 +2013,12 @@
|
|
|
1914
2013
|
},
|
|
1915
2014
|
"privacy": "private"
|
|
1916
2015
|
},
|
|
2016
|
+
{
|
|
2017
|
+
"kind": "field",
|
|
2018
|
+
"name": "boundGlobalEventListener",
|
|
2019
|
+
"privacy": "private",
|
|
2020
|
+
"readonly": true
|
|
2021
|
+
},
|
|
1917
2022
|
{
|
|
1918
2023
|
"kind": "field",
|
|
1919
2024
|
"name": "_filterConfig",
|
|
@@ -2032,6 +2137,27 @@
|
|
|
2032
2137
|
"kind": "method",
|
|
2033
2138
|
"name": "hideDatasourceError"
|
|
2034
2139
|
},
|
|
2140
|
+
{
|
|
2141
|
+
"kind": "method",
|
|
2142
|
+
"name": "performDisconnectCleanup",
|
|
2143
|
+
"privacy": "private",
|
|
2144
|
+
"return": {
|
|
2145
|
+
"type": {
|
|
2146
|
+
"text": "void"
|
|
2147
|
+
}
|
|
2148
|
+
}
|
|
2149
|
+
},
|
|
2150
|
+
{
|
|
2151
|
+
"kind": "method",
|
|
2152
|
+
"name": "destroyGridInstance",
|
|
2153
|
+
"privacy": "private",
|
|
2154
|
+
"return": {
|
|
2155
|
+
"type": {
|
|
2156
|
+
"text": "void"
|
|
2157
|
+
}
|
|
2158
|
+
},
|
|
2159
|
+
"description": "Tear down the AG Grid instance. Prefer GridApi#destroy; if `gridApi` is not set yet\n(e.g. disconnect before `grid-ready`), fall back to Grid#destroy on the vanilla wrapper."
|
|
2160
|
+
},
|
|
2035
2161
|
{
|
|
2036
2162
|
"kind": "method",
|
|
2037
2163
|
"name": "flashAddedCells",
|
|
@@ -370,7 +370,12 @@ declare const GridProBeta_base: (new (...args: any[]) => {
|
|
|
370
370
|
nonce?: string;
|
|
371
371
|
tabIndex: number;
|
|
372
372
|
blur(): void;
|
|
373
|
-
focus(options
|
|
373
|
+
focus(options
|
|
374
|
+
/**
|
|
375
|
+
* Handles removing CSS class from grid element
|
|
376
|
+
* @internal
|
|
377
|
+
*/
|
|
378
|
+
?: FocusOptions): void;
|
|
374
379
|
}) & typeof FoundationElement;
|
|
375
380
|
/**
|
|
376
381
|
* The Grid Pro element (AG Grid v35 compatible).
|
|
@@ -392,6 +397,9 @@ export declare class GridProBeta extends GridProBeta_base {
|
|
|
392
397
|
* @internal
|
|
393
398
|
*/
|
|
394
399
|
private debounced;
|
|
400
|
+
private disposed;
|
|
401
|
+
private readonly debouncedSaveColumnState;
|
|
402
|
+
private readonly debouncedSaveFilterModel;
|
|
395
403
|
autoCellRendererByType: boolean;
|
|
396
404
|
onlyTemplateColDefs: boolean;
|
|
397
405
|
/**
|
|
@@ -493,10 +501,13 @@ export declare class GridProBeta extends GridProBeta_base {
|
|
|
493
501
|
protected initialised: boolean;
|
|
494
502
|
private rehydrationAttempted;
|
|
495
503
|
private rootEventsListeners;
|
|
504
|
+
private datasourceEventHandlers;
|
|
496
505
|
private gridEventsQueue;
|
|
497
506
|
private registeredGridEvents;
|
|
507
|
+
private gridEventListeners;
|
|
498
508
|
private luminanceSubscription?;
|
|
499
509
|
private visibilityObserverCleanup?;
|
|
510
|
+
private readonly boundGlobalEventListener;
|
|
500
511
|
private _filterConfig;
|
|
501
512
|
getfilterModel(): Promise<{
|
|
502
513
|
[key: string]: any;
|
|
@@ -535,8 +546,11 @@ export declare class GridProBeta extends GridProBeta_base {
|
|
|
535
546
|
private handleBaseDatasourceError;
|
|
536
547
|
hideDatasourceError(): void;
|
|
537
548
|
private handleLuminanceChange;
|
|
549
|
+
private readonly luminanceObserver;
|
|
538
550
|
connectedCallback(): void;
|
|
539
551
|
disconnectedCallback(): void;
|
|
552
|
+
private performDisconnectCleanup;
|
|
553
|
+
private destroyGridInstance;
|
|
540
554
|
/**
|
|
541
555
|
* Helper method to add or remove datasource event listeners
|
|
542
556
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid-pro-beta.d.ts","sourceRoot":"","sources":["../../src/grid-pro-beta.ts"],"names":[],"mappings":"AAOA,OAAO,EAAyB,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EACV,MAAM,EAEN,OAAO,EACP,WAAW,EACX,UAAU,EAEX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAML,WAAW,EAeZ,MAAM,mBAAmB,CAAC;AAuB3B,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAsBrE,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAEhB,yBAAyB,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IACG,2BAA2B,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,yBAAyB,UAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA+GzF,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,gBAAgB;IA2BxB,OAAO,CAAC,eAAe;IAgBvB,OAAO,CAAC,mBAAmB;IAW3B,OAAO,CAAC,mBAAmB;IAe3B,OAAO,CAAC,kBAAkB;IAW1B,SAAS,CAAC,2BAA2B,CAAC,WAAW,EAAE,WAAW;IAuC9D,IAAI,kBAAkB,aAWrB;IAED,0BAA0B,CAAC,OAAO,KAAA,EAAE,QAAQ,KAAA,EAAE,QAAQ,KAAA;IAkBtD,mBAAmB,CAAC,SAAS,KAAA,EAAE,KAAK,KAAA;CAgBrC"}
|
package/dist/dts/grid-pro.d.ts
CHANGED
|
@@ -83,9 +83,7 @@ declare const GridPro_base: (new (...args: any[]) => {
|
|
|
83
83
|
slot: string;
|
|
84
84
|
readonly tagName: string;
|
|
85
85
|
attachShadow(init: ShadowRootInit): ShadowRoot;
|
|
86
|
-
checkVisibility(options
|
|
87
|
-
* If true, will enable row flashing for all rows for `add` async transactions
|
|
88
|
-
*/: CheckVisibilityOptions): boolean;
|
|
86
|
+
checkVisibility(options?: CheckVisibilityOptions): boolean;
|
|
89
87
|
closest<K extends keyof HTMLElementTagNameMap>(selector: K): HTMLElementTagNameMap[K];
|
|
90
88
|
closest<K extends keyof SVGElementTagNameMap>(selector: K): SVGElementTagNameMap[K];
|
|
91
89
|
closest<K extends keyof MathMLElementTagNameMap>(selector: K): MathMLElementTagNameMap[K];
|
|
@@ -399,6 +397,9 @@ export declare class GridPro extends GridPro_base {
|
|
|
399
397
|
* @internal
|
|
400
398
|
*/
|
|
401
399
|
private debounced;
|
|
400
|
+
private disposed;
|
|
401
|
+
private readonly debouncedSaveColumnState;
|
|
402
|
+
private readonly debouncedSaveFilterModel;
|
|
402
403
|
autoCellRendererByType: boolean;
|
|
403
404
|
onlyTemplateColDefs: boolean;
|
|
404
405
|
/**
|
|
@@ -544,7 +545,9 @@ export declare class GridPro extends GridPro_base {
|
|
|
544
545
|
private eventHandlers;
|
|
545
546
|
private gridEventsQueue;
|
|
546
547
|
private registeredGridEvents;
|
|
548
|
+
private gridEventListeners;
|
|
547
549
|
private visibilityObserverCleanup?;
|
|
550
|
+
private readonly boundGlobalEventListener;
|
|
548
551
|
private _filterConfig;
|
|
549
552
|
getfilterModel(): Promise<{
|
|
550
553
|
[key: string]: any;
|
|
@@ -583,6 +586,12 @@ export declare class GridPro extends GridPro_base {
|
|
|
583
586
|
hideDatasourceError(): void;
|
|
584
587
|
connectedCallback(): void;
|
|
585
588
|
disconnectedCallback(): void;
|
|
589
|
+
private performDisconnectCleanup;
|
|
590
|
+
/**
|
|
591
|
+
* Tear down the AG Grid instance. Prefer {@link GridApi#destroy}; if `gridApi` is not set yet
|
|
592
|
+
* (e.g. disconnect before `grid-ready`), fall back to {@link Grid#destroy} on the vanilla wrapper.
|
|
593
|
+
*/
|
|
594
|
+
private destroyGridInstance;
|
|
586
595
|
/**
|
|
587
596
|
* Handles datasource initialization
|
|
588
597
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid-pro.d.ts","sourceRoot":"","sources":["../../src/grid-pro.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,MAAM,EACN,SAAS,EAGT,OAAO,EACP,WAAW,EACX,UAAU,EAEX,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAyB,IAAI,EAAkB,MAAM,yBAAyB,CAAC;AASnG,OAAO,EAAyB,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAA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GG;IACH,OAAO,CAAC,yBAAyB;IAsBjC;;;;;OAKG;IACH,OAAO,CAAC,0BAA0B;IAKlC;;;OAGG;IACH,OAAO,CAAC,YAAY;IAepB,IAAI,kBAAkB,aAWrB;IAED,0BAA0B,CAAC,OAAO,KAAA,EAAE,QAAQ,KAAA,EAAE,QAAQ,KAAA;IAqBtD,mBAAmB,CAAC,SAAS,KAAA,EAAE,KAAK,KAAA;IAiBpC,OAAO,CAAC,eAAe,CAAa;IAEpC,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,eAAe;CAMxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B,EAAE,cAA0B,CAAC;AAExE;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;CAEhC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;kBAM5B,CAAC"}
|
|
@@ -84,6 +84,9 @@ export class GridProBeta extends LifecycleMixin(FoundationElement) {
|
|
|
84
84
|
constructor() {
|
|
85
85
|
super();
|
|
86
86
|
this.gridErrorItems = [];
|
|
87
|
+
this.disposed = false;
|
|
88
|
+
this.debouncedSaveColumnState = debounce(this.saveColumnState.bind(this), DEBOUNCE_TIME);
|
|
89
|
+
this.debouncedSaveFilterModel = debounce(this.cacheFilterConfig.bind(this), DEBOUNCE_TIME);
|
|
87
90
|
// Genesis-specific attrs
|
|
88
91
|
this.autoCellRendererByType = false;
|
|
89
92
|
this.onlyTemplateColDefs = false;
|
|
@@ -133,13 +136,19 @@ export class GridProBeta extends LifecycleMixin(FoundationElement) {
|
|
|
133
136
|
this.withStatusBar = false;
|
|
134
137
|
this.rehydrationAttempted = false;
|
|
135
138
|
this.rootEventsListeners = [];
|
|
139
|
+
this.datasourceEventHandlers = [];
|
|
136
140
|
this.gridEventsQueue = [];
|
|
137
141
|
this.registeredGridEvents = new Set();
|
|
142
|
+
this.gridEventListeners = new Map();
|
|
143
|
+
this.boundGlobalEventListener = this.globalEventListener.bind(this);
|
|
138
144
|
this._filterConfig = undefined;
|
|
139
145
|
this.handleLuminanceChange = (record) => {
|
|
140
146
|
const luminance = baseLayerLuminance.getValueFor(record.target);
|
|
141
147
|
this.themeMode = luminance === StandardLuminance.DarkMode ? 'dark' : 'light';
|
|
142
148
|
};
|
|
149
|
+
this.luminanceObserver = {
|
|
150
|
+
handleChange: (record) => this.handleLuminanceChange(record),
|
|
151
|
+
};
|
|
143
152
|
this.agAttributes = {};
|
|
144
153
|
this.agPropertiesMap = AG_PROPERTIES.reduce((map, property) => {
|
|
145
154
|
map[property.toLowerCase()] = property;
|
|
@@ -150,6 +159,53 @@ export class GridProBeta extends LifecycleMixin(FoundationElement) {
|
|
|
150
159
|
this.rootEventsListeners.push([gridProGenesisDatasourceEventNames.dataInit, hideDataSourceError], [gridProEventNames.datasourceErrorClose, hideDataSourceError],
|
|
151
160
|
// Base datasource error handling for resource validation and initialization errors
|
|
152
161
|
[baseDatasourceEventNames.error, this.handleBaseDatasourceError.bind(this)], [baseDatasourceEventNames.connected, hideDataSourceError]);
|
|
162
|
+
this.datasourceEventHandlers = [
|
|
163
|
+
[datasourceEventNames.initialize, this.handleInitialize.bind(this)],
|
|
164
|
+
[datasourceEventNames.dataLoaded, this.handleDataLoaded.bind(this)],
|
|
165
|
+
[datasourceEventNames.dataChanged, this.handleDataChanged.bind(this)],
|
|
166
|
+
[datasourceEventNames.schemaUpdated, this.handleSchemaUpdated.bind(this)],
|
|
167
|
+
[datasourceEventNames.dataCleared, this.handleDataCleared.bind(this)],
|
|
168
|
+
[datasourceEventNames.loadingStarted, this.handleLoadingStarted.bind(this)],
|
|
169
|
+
[
|
|
170
|
+
datasourceEventNames.loadingFinished,
|
|
171
|
+
this.handleLoadingFinished.bind(this),
|
|
172
|
+
],
|
|
173
|
+
[
|
|
174
|
+
datasourceEventNames.noDataAvailable,
|
|
175
|
+
this.handleNoDataAvailable.bind(this),
|
|
176
|
+
],
|
|
177
|
+
[
|
|
178
|
+
datasourceEventNames.filtersRestored,
|
|
179
|
+
this.handleFiltersRestored.bind(this),
|
|
180
|
+
],
|
|
181
|
+
[
|
|
182
|
+
datasourceEventNames.moreDataAvailable,
|
|
183
|
+
this.handleMoreDataAvailable.bind(this),
|
|
184
|
+
],
|
|
185
|
+
[datasourceEventNames.error, this.handleDatasourceError.bind(this)],
|
|
186
|
+
[datasourceEventNames.destroy, this.handleDatasourceDestroy.bind(this)],
|
|
187
|
+
[datasourceEventNames.cacheFilterConfig, this.cacheFilterConfig.bind(this)],
|
|
188
|
+
[
|
|
189
|
+
datasourceEventNames.refreshServerSide,
|
|
190
|
+
this.handleRefreshServerSide.bind(this),
|
|
191
|
+
],
|
|
192
|
+
[
|
|
193
|
+
datasourceEventNames.setServerSideDatasource,
|
|
194
|
+
this.handleSetServerSideDatasource.bind(this),
|
|
195
|
+
],
|
|
196
|
+
[
|
|
197
|
+
datasourceEventNames.addGridCssClass,
|
|
198
|
+
this.handleAddGridCssClass.bind(this),
|
|
199
|
+
],
|
|
200
|
+
[
|
|
201
|
+
datasourceEventNames.removeGridCssClass,
|
|
202
|
+
this.handleRemoveGridCssClass.bind(this),
|
|
203
|
+
],
|
|
204
|
+
[
|
|
205
|
+
datasourceEventNames.applyServerSideTransaction,
|
|
206
|
+
this.handleApplyServerSideTransaction.bind(this),
|
|
207
|
+
],
|
|
208
|
+
];
|
|
153
209
|
}
|
|
154
210
|
/**
|
|
155
211
|
* Adds an event listener to the grid element.
|
|
@@ -175,9 +231,11 @@ export class GridProBeta extends LifecycleMixin(FoundationElement) {
|
|
|
175
231
|
return;
|
|
176
232
|
}
|
|
177
233
|
this.registeredGridEvents.add(eventType);
|
|
178
|
-
|
|
234
|
+
const listener = (e) => {
|
|
179
235
|
this.$emit(eventType, e);
|
|
180
|
-
}
|
|
236
|
+
};
|
|
237
|
+
this.gridEventListeners.set(eventType, listener);
|
|
238
|
+
this.gridApi.addEventListener(eventType, listener);
|
|
181
239
|
}
|
|
182
240
|
handleError(type, event) {
|
|
183
241
|
this.gridErrorItems = [...this.gridErrorItems, { detail: event.detail, type }];
|
|
@@ -198,12 +256,15 @@ export class GridProBeta extends LifecycleMixin(FoundationElement) {
|
|
|
198
256
|
this.removeAttribute('ds-disconnected');
|
|
199
257
|
}
|
|
200
258
|
connectedCallback() {
|
|
259
|
+
var _a;
|
|
201
260
|
super.connectedCallback();
|
|
202
|
-
this.
|
|
261
|
+
this.disposed = false;
|
|
262
|
+
const luminanceTarget = (_a = this.provider) !== null && _a !== void 0 ? _a : this;
|
|
263
|
+
this.luminanceSubscription = baseLayerLuminance.subscribe(this.luminanceObserver, luminanceTarget);
|
|
203
264
|
if (this.gridAutosizingEnabled) {
|
|
204
265
|
this.visibilityObserverCleanup = respondToVisibility(this, (gridVisible) => {
|
|
205
266
|
if (gridVisible) {
|
|
206
|
-
this.debouncedColumnAutosize
|
|
267
|
+
this.debouncedColumnAutosize();
|
|
207
268
|
}
|
|
208
269
|
});
|
|
209
270
|
}
|
|
@@ -230,6 +291,12 @@ export class GridProBeta extends LifecycleMixin(FoundationElement) {
|
|
|
230
291
|
: DatasourceDefaults.DEFAULT_PAGINATION_PAGE_SIZE;
|
|
231
292
|
}
|
|
232
293
|
disconnectedCallback() {
|
|
294
|
+
var _a;
|
|
295
|
+
this.disposed = true;
|
|
296
|
+
this.debouncedSaveColumnState.cancel();
|
|
297
|
+
this.debouncedSaveFilterModel.cancel();
|
|
298
|
+
const luminanceTarget = (_a = this.provider) !== null && _a !== void 0 ? _a : this;
|
|
299
|
+
baseLayerLuminance.unsubscribe(this.luminanceObserver, luminanceTarget);
|
|
233
300
|
if (this.luminanceSubscription) {
|
|
234
301
|
this.luminanceSubscription.unsubscribe();
|
|
235
302
|
this.luminanceSubscription = undefined;
|
|
@@ -246,46 +313,62 @@ export class GridProBeta extends LifecycleMixin(FoundationElement) {
|
|
|
246
313
|
});
|
|
247
314
|
// Remove datasource event listeners
|
|
248
315
|
this.toggleDatasourceEventListeners(false);
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
316
|
+
if (!shouldRunDisconnect) {
|
|
317
|
+
queueMicrotask(() => {
|
|
318
|
+
if (!this.isConnected) {
|
|
319
|
+
this.performDisconnectCleanup();
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
this.performDisconnectCleanup();
|
|
325
|
+
}
|
|
326
|
+
performDisconnectCleanup() {
|
|
327
|
+
if (this.debounced) {
|
|
328
|
+
clearTimeout(this.debounced);
|
|
329
|
+
this.debounced = null;
|
|
330
|
+
}
|
|
331
|
+
this.initialised = false;
|
|
332
|
+
this.clearLocalGridOptions();
|
|
333
|
+
this.destroyGridInstance();
|
|
334
|
+
// Destroy can synchronously emit final grid events; cancel again to avoid
|
|
335
|
+
// retaining this element through trailing debounce timers.
|
|
336
|
+
this.debouncedSaveColumnState.cancel();
|
|
337
|
+
this.debouncedSaveFilterModel.cancel();
|
|
338
|
+
// Clear registered events when grid is destroyed
|
|
339
|
+
this.registeredGridEvents.clear();
|
|
340
|
+
this.gridEventsQueue = [];
|
|
341
|
+
}
|
|
342
|
+
destroyGridInstance() {
|
|
343
|
+
if (this.gridApi) {
|
|
344
|
+
this.gridEventListeners.forEach((listener, eventType) => {
|
|
345
|
+
this.gridApi.removeEventListener(eventType, listener);
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
this.gridEventListeners.clear();
|
|
349
|
+
if (this.gridApi) {
|
|
255
350
|
this.gridApi.destroy();
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
351
|
+
}
|
|
352
|
+
else if (this.agGrid) {
|
|
353
|
+
this.agGrid.destroy();
|
|
354
|
+
}
|
|
355
|
+
if (this.gridSlot) {
|
|
356
|
+
// Ensure AG Grid internal measurement/theme nodes are removed immediately.
|
|
357
|
+
this.gridSlot.replaceChildren();
|
|
358
|
+
}
|
|
359
|
+
this.gridApi = undefined;
|
|
360
|
+
this.agGrid = undefined;
|
|
259
361
|
}
|
|
260
362
|
/**
|
|
261
363
|
* Helper method to add or remove datasource event listeners
|
|
262
364
|
* @internal
|
|
263
365
|
*/
|
|
264
366
|
toggleDatasourceEventListeners(add) {
|
|
265
|
-
const eventHandlers = [
|
|
266
|
-
[datasourceEventNames.initialize, this.handleInitialize],
|
|
267
|
-
[datasourceEventNames.dataLoaded, this.handleDataLoaded],
|
|
268
|
-
[datasourceEventNames.dataChanged, this.handleDataChanged],
|
|
269
|
-
[datasourceEventNames.schemaUpdated, this.handleSchemaUpdated],
|
|
270
|
-
[datasourceEventNames.dataCleared, this.handleDataCleared],
|
|
271
|
-
[datasourceEventNames.loadingStarted, this.handleLoadingStarted],
|
|
272
|
-
[datasourceEventNames.loadingFinished, this.handleLoadingFinished],
|
|
273
|
-
[datasourceEventNames.noDataAvailable, this.handleNoDataAvailable],
|
|
274
|
-
[datasourceEventNames.filtersRestored, this.handleFiltersRestored],
|
|
275
|
-
[datasourceEventNames.moreDataAvailable, this.handleMoreDataAvailable],
|
|
276
|
-
[datasourceEventNames.error, this.handleDatasourceError],
|
|
277
|
-
[datasourceEventNames.destroy, this.handleDatasourceDestroy],
|
|
278
|
-
// Server-side specific events
|
|
279
|
-
[datasourceEventNames.cacheFilterConfig, this.cacheFilterConfig],
|
|
280
|
-
[datasourceEventNames.refreshServerSide, this.handleRefreshServerSide],
|
|
281
|
-
[datasourceEventNames.setServerSideDatasource, this.handleSetServerSideDatasource],
|
|
282
|
-
[datasourceEventNames.addGridCssClass, this.handleAddGridCssClass],
|
|
283
|
-
[datasourceEventNames.removeGridCssClass, this.handleRemoveGridCssClass],
|
|
284
|
-
[datasourceEventNames.applyServerSideTransaction, this.handleApplyServerSideTransaction],
|
|
285
|
-
];
|
|
286
367
|
const method = add ? 'addEventListener' : 'removeEventListener';
|
|
287
|
-
|
|
288
|
-
|
|
368
|
+
this.datasourceEventHandlers.forEach(([eventName, handler]) => {
|
|
369
|
+
// Bypass GridProBeta.addEventListener override: datasource events should not be
|
|
370
|
+
// mirrored/queued as AG Grid API events.
|
|
371
|
+
super[method](eventName, handler);
|
|
289
372
|
});
|
|
290
373
|
}
|
|
291
374
|
/**
|
|
@@ -727,7 +810,7 @@ export class GridProBeta extends LifecycleMixin(FoundationElement) {
|
|
|
727
810
|
*/
|
|
728
811
|
get gridParams() {
|
|
729
812
|
return {
|
|
730
|
-
globalListener: this.
|
|
813
|
+
globalListener: this.boundGlobalEventListener,
|
|
731
814
|
};
|
|
732
815
|
}
|
|
733
816
|
/**
|
|
@@ -741,11 +824,11 @@ export class GridProBeta extends LifecycleMixin(FoundationElement) {
|
|
|
741
824
|
this.querySelector('grid-pro-server-side-datasource'));
|
|
742
825
|
}
|
|
743
826
|
set gridOptions(options) {
|
|
744
|
-
const debounceSaveColumnState = debounce(this.saveColumnState.bind(this), DEBOUNCE_TIME);
|
|
745
|
-
const debouceSaveFiltermodel = debounce(this.cacheFilterConfig.bind(this), DEBOUNCE_TIME);
|
|
746
827
|
const gridOnChangeCallback = () => {
|
|
747
|
-
|
|
748
|
-
|
|
828
|
+
if (this.disposed || !this.isConnected)
|
|
829
|
+
return;
|
|
830
|
+
this.debouncedSaveColumnState();
|
|
831
|
+
this.debouncedColumnAutosize();
|
|
749
832
|
};
|
|
750
833
|
// Collect attributes and map them to AG Grid properties
|
|
751
834
|
Array.from(this.attributes).forEach((attribute) => {
|
|
@@ -787,11 +870,13 @@ export class GridProBeta extends LifecycleMixin(FoundationElement) {
|
|
|
787
870
|
// TODO: prevent rendering datasource slot until grid is ready
|
|
788
871
|
// so there is no need for this even and handling it in datasources
|
|
789
872
|
(_c = this.gridProDatasource) === null || _c === void 0 ? void 0 : _c.$emit(datasourceEventNames.ready, { pagination: this.pagination });
|
|
790
|
-
this.restoreColumnState
|
|
791
|
-
this.restoreCachedFilterConfig
|
|
792
|
-
this.debouncedColumnAutosize
|
|
873
|
+
this.restoreColumnState();
|
|
874
|
+
this.restoreCachedFilterConfig();
|
|
875
|
+
this.debouncedColumnAutosize();
|
|
793
876
|
}, onColumnPinned: gridOnChangeCallback, onColumnResized: gridOnChangeCallback, onColumnMoved: gridOnChangeCallback, onDisplayedColumnsChanged: gridOnChangeCallback, onFilterChanged: (filterChangedEvent) => {
|
|
794
|
-
|
|
877
|
+
if (this.disposed || !this.isConnected)
|
|
878
|
+
return;
|
|
879
|
+
this.debouncedSaveFilterModel();
|
|
795
880
|
if (onFilterChanged) {
|
|
796
881
|
onFilterChanged(filterChangedEvent);
|
|
797
882
|
}
|
|
@@ -804,6 +889,9 @@ export class GridProBeta extends LifecycleMixin(FoundationElement) {
|
|
|
804
889
|
}
|
|
805
890
|
else {
|
|
806
891
|
this.mergeAllColumnDefsAndStates(columnDefs).then((value) => {
|
|
892
|
+
if (this.disposed || !this.isConnected) {
|
|
893
|
+
return;
|
|
894
|
+
}
|
|
807
895
|
derivedOptions.columnDefs = value;
|
|
808
896
|
derivedOptions.getRowId = getRowId;
|
|
809
897
|
this.setupPaginationAndStatusBar(derivedOptions);
|
|
@@ -825,14 +913,17 @@ export class GridProBeta extends LifecycleMixin(FoundationElement) {
|
|
|
825
913
|
}
|
|
826
914
|
initGrid() {
|
|
827
915
|
DOM.queueUpdate(() => {
|
|
916
|
+
if (this.disposed || !this.isConnected) {
|
|
917
|
+
return;
|
|
918
|
+
}
|
|
828
919
|
if (this.initialised) {
|
|
920
|
+
this.destroyGridInstance();
|
|
829
921
|
// Needed due gridSlot children cleanup
|
|
830
922
|
if (this.gridSlot.firstChild) {
|
|
831
923
|
// prevent re-instantiating the grid using the same slot content
|
|
832
924
|
this.gridSlot.removeChild(this.gridSlot.firstChild);
|
|
833
925
|
}
|
|
834
926
|
}
|
|
835
|
-
console.log('initGrid agGridOptions', this.agGridOptions);
|
|
836
927
|
this.agGrid = createGrid(this.gridSlot, this.agGridOptions, this.gridParams);
|
|
837
928
|
this.initialised = true;
|
|
838
929
|
});
|
package/dist/esm/grid-pro.js
CHANGED
|
@@ -3,7 +3,7 @@ import { ClientSideRowModelModule } from '@ag-grid-community/client-side-row-mod
|
|
|
3
3
|
import { ComponentUtil, Events, Grid, ModuleRegistry } from '@ag-grid-community/core';
|
|
4
4
|
import { CsvExportModule } from '@ag-grid-community/csv-export';
|
|
5
5
|
import { DatasourceDefaults } from '@genesislcap/foundation-comms';
|
|
6
|
-
import { insertDocumentCSSRule, LifecycleMixin,
|
|
6
|
+
import { avoidTreeShaking, insertDocumentCSSRule, LifecycleMixin, respondToVisibility, } from '@genesislcap/foundation-utils';
|
|
7
7
|
import { attr, DOM, observable } from '@microsoft/fast-element';
|
|
8
8
|
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
9
9
|
import { classNames } from '@microsoft/fast-web-utilities';
|
|
@@ -81,6 +81,9 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
|
|
|
81
81
|
this.cachedTotalColumnWidth = null;
|
|
82
82
|
this.columnCount = 0;
|
|
83
83
|
this.gridErrorItems = [];
|
|
84
|
+
this.disposed = false;
|
|
85
|
+
this.debouncedSaveColumnState = debounce(this.saveColumnState.bind(this), DEBOUNCE_TIME);
|
|
86
|
+
this.debouncedSaveFilterModel = debounce(this.cacheFilterConfig.bind(this), DEBOUNCE_TIME);
|
|
84
87
|
// Genesis-specific attrs
|
|
85
88
|
this.autoCellRendererByType = false;
|
|
86
89
|
this.onlyTemplateColDefs = false;
|
|
@@ -174,6 +177,8 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
|
|
|
174
177
|
this.eventHandlers = [];
|
|
175
178
|
this.gridEventsQueue = [];
|
|
176
179
|
this.registeredGridEvents = new Set();
|
|
180
|
+
this.gridEventListeners = new Map();
|
|
181
|
+
this.boundGlobalEventListener = this.globalEventListener.bind(this);
|
|
177
182
|
this._filterConfig = undefined;
|
|
178
183
|
this.agAttributes = {};
|
|
179
184
|
this.agPropertiesMap = AG_PROPERTIES.reduce((map, property) => {
|
|
@@ -220,9 +225,11 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
|
|
|
220
225
|
return;
|
|
221
226
|
}
|
|
222
227
|
this.registeredGridEvents.add(eventType);
|
|
223
|
-
|
|
228
|
+
const listener = (e) => {
|
|
224
229
|
this.$emit(eventType, e);
|
|
225
|
-
}
|
|
230
|
+
};
|
|
231
|
+
this.gridEventListeners.set(eventType, listener);
|
|
232
|
+
this.gridApi.addEventListener(eventType, listener);
|
|
226
233
|
}
|
|
227
234
|
handleError(type, event) {
|
|
228
235
|
this.gridErrorItems = [...this.gridErrorItems, { detail: event.detail, type }];
|
|
@@ -244,10 +251,11 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
|
|
|
244
251
|
}
|
|
245
252
|
connectedCallback() {
|
|
246
253
|
super.connectedCallback();
|
|
254
|
+
this.disposed = false;
|
|
247
255
|
if (this.gridAutosizingEnabled) {
|
|
248
256
|
this.visibilityObserverCleanup = respondToVisibility(this, (gridVisible) => {
|
|
249
257
|
if (gridVisible) {
|
|
250
|
-
this.debouncedColumnAutosize
|
|
258
|
+
this.debouncedColumnAutosize();
|
|
251
259
|
}
|
|
252
260
|
});
|
|
253
261
|
}
|
|
@@ -271,6 +279,9 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
|
|
|
271
279
|
: DatasourceDefaults.DEFAULT_PAGINATION_PAGE_SIZE;
|
|
272
280
|
}
|
|
273
281
|
disconnectedCallback() {
|
|
282
|
+
this.disposed = true;
|
|
283
|
+
this.debouncedSaveColumnState.cancel();
|
|
284
|
+
this.debouncedSaveFilterModel.cancel();
|
|
274
285
|
if (this.visibilityObserverCleanup) {
|
|
275
286
|
this.visibilityObserverCleanup();
|
|
276
287
|
this.visibilityObserverCleanup = undefined;
|
|
@@ -281,17 +292,58 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
|
|
|
281
292
|
this.eventHandlers.forEach(([eventName, handler]) => {
|
|
282
293
|
this.removeEventListener(eventName, handler);
|
|
283
294
|
});
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
295
|
+
if (!shouldRunDisconnect) {
|
|
296
|
+
// If lifecycle is temporarily blocked (e.g. layout drag/reconnect path),
|
|
297
|
+
// still tear down once the element remains detached on the next tick.
|
|
298
|
+
queueMicrotask(() => {
|
|
299
|
+
if (!this.isConnected) {
|
|
300
|
+
this.performDisconnectCleanup();
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
this.performDisconnectCleanup();
|
|
306
|
+
}
|
|
307
|
+
performDisconnectCleanup() {
|
|
308
|
+
if (this.debounced) {
|
|
309
|
+
clearTimeout(this.debounced);
|
|
310
|
+
this.debounced = null;
|
|
311
|
+
}
|
|
312
|
+
this.initialised = false;
|
|
313
|
+
this.clearLocalGridOptions();
|
|
314
|
+
this.destroyGridInstance();
|
|
315
|
+
// Destroy can synchronously emit final grid events; cancel again to avoid
|
|
316
|
+
// retaining this element through trailing debounce timers.
|
|
317
|
+
this.debouncedSaveColumnState.cancel();
|
|
318
|
+
this.debouncedSaveFilterModel.cancel();
|
|
319
|
+
this.invalidateColumnWidthCache();
|
|
320
|
+
// Clear registered events when grid is destroyed
|
|
321
|
+
this.registeredGridEvents.clear();
|
|
322
|
+
this.gridEventsQueue = [];
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Tear down the AG Grid instance. Prefer {@link GridApi#destroy}; if `gridApi` is not set yet
|
|
326
|
+
* (e.g. disconnect before `grid-ready`), fall back to {@link Grid#destroy} on the vanilla wrapper.
|
|
327
|
+
*/
|
|
328
|
+
destroyGridInstance() {
|
|
329
|
+
if (this.gridApi) {
|
|
330
|
+
this.gridEventListeners.forEach((listener, eventType) => {
|
|
331
|
+
this.gridApi.removeEventListener(eventType, listener);
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
this.gridEventListeners.clear();
|
|
335
|
+
if (this.gridApi) {
|
|
290
336
|
this.gridApi.destroy();
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
this.
|
|
294
|
-
}
|
|
337
|
+
}
|
|
338
|
+
else if (this.agGrid) {
|
|
339
|
+
this.agGrid.destroy();
|
|
340
|
+
}
|
|
341
|
+
if (this.gridSlot) {
|
|
342
|
+
this.gridSlot.replaceChildren();
|
|
343
|
+
}
|
|
344
|
+
this.gridApi = undefined;
|
|
345
|
+
this.columnApi = undefined;
|
|
346
|
+
this.agGrid = undefined;
|
|
295
347
|
}
|
|
296
348
|
/**
|
|
297
349
|
* Handles datasource initialization
|
|
@@ -818,7 +870,7 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
|
|
|
818
870
|
*/
|
|
819
871
|
get gridParams() {
|
|
820
872
|
return {
|
|
821
|
-
globalEventListener: this.
|
|
873
|
+
globalEventListener: this.boundGlobalEventListener,
|
|
822
874
|
};
|
|
823
875
|
}
|
|
824
876
|
/**
|
|
@@ -832,11 +884,11 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
|
|
|
832
884
|
this.querySelector('grid-pro-server-side-datasource'));
|
|
833
885
|
}
|
|
834
886
|
set gridOptions(options) {
|
|
835
|
-
const debounceSaveColumnState = debounce(this.saveColumnState.bind(this), DEBOUNCE_TIME);
|
|
836
|
-
const debouceSaveFiltermodel = debounce(this.cacheFilterConfig.bind(this), DEBOUNCE_TIME);
|
|
837
887
|
const gridOnChangeCallback = () => {
|
|
838
|
-
|
|
839
|
-
|
|
888
|
+
if (this.disposed || !this.isConnected)
|
|
889
|
+
return;
|
|
890
|
+
this.debouncedSaveColumnState();
|
|
891
|
+
this.debouncedColumnAutosize();
|
|
840
892
|
this.invalidateColumnWidthCache();
|
|
841
893
|
};
|
|
842
894
|
Array.from(this.attributes).forEach((attribute) => {
|
|
@@ -880,9 +932,9 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
|
|
|
880
932
|
// TODO: prevent rendering datasource slot until grid is ready
|
|
881
933
|
// so there is no need for this even and handling it in datasources
|
|
882
934
|
(_b = this.gridProDatasource) === null || _b === void 0 ? void 0 : _b.$emit(datasourceEventNames.ready, { pagination: this.pagination });
|
|
883
|
-
this.restoreColumnState
|
|
884
|
-
this.restoreCachedFilterConfig
|
|
885
|
-
this.debouncedColumnAutosize
|
|
935
|
+
this.restoreColumnState();
|
|
936
|
+
this.restoreCachedFilterConfig();
|
|
937
|
+
this.debouncedColumnAutosize();
|
|
886
938
|
}, onFirstDataRendered: (event) => {
|
|
887
939
|
// Handle column sizing
|
|
888
940
|
this.handleColumnSizing();
|
|
@@ -891,7 +943,9 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
|
|
|
891
943
|
onFirstDataRendered(event);
|
|
892
944
|
}
|
|
893
945
|
}, onColumnPinned: gridOnChangeCallback, onColumnResized: gridOnChangeCallback, onColumnMoved: gridOnChangeCallback, onDisplayedColumnsChanged: gridOnChangeCallback, onFilterChanged: (filterChangedEvent) => {
|
|
894
|
-
|
|
946
|
+
if (this.disposed || !this.isConnected)
|
|
947
|
+
return;
|
|
948
|
+
this.debouncedSaveFilterModel();
|
|
895
949
|
if (onFilterChanged) {
|
|
896
950
|
onFilterChanged(filterChangedEvent);
|
|
897
951
|
}
|
|
@@ -907,6 +961,9 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
|
|
|
907
961
|
}
|
|
908
962
|
else {
|
|
909
963
|
this.mergeAllColumnDefsAndStates(columnDefs).then((value) => {
|
|
964
|
+
if (this.disposed || !this.isConnected) {
|
|
965
|
+
return;
|
|
966
|
+
}
|
|
910
967
|
derivedOptions.columnDefs = value;
|
|
911
968
|
if (hasGetRowId) {
|
|
912
969
|
derivedOptions.getRowId = getRowId;
|
|
@@ -929,7 +986,11 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
|
|
|
929
986
|
}
|
|
930
987
|
initGrid() {
|
|
931
988
|
DOM.queueUpdate(() => {
|
|
989
|
+
if (this.disposed || !this.isConnected) {
|
|
990
|
+
return;
|
|
991
|
+
}
|
|
932
992
|
if (this.initialised) {
|
|
993
|
+
this.destroyGridInstance();
|
|
933
994
|
// Needed due gridSlot children cleanup
|
|
934
995
|
if (this.gridSlot.firstChild) {
|
|
935
996
|
// prevent re-instantiating the grid using the same slot content
|
package/dist/grid-pro.d.ts
CHANGED
|
@@ -2093,6 +2093,9 @@ export declare class GridPro extends GridPro_base {
|
|
|
2093
2093
|
* @internal
|
|
2094
2094
|
*/
|
|
2095
2095
|
private debounced;
|
|
2096
|
+
private disposed;
|
|
2097
|
+
private readonly debouncedSaveColumnState;
|
|
2098
|
+
private readonly debouncedSaveFilterModel;
|
|
2096
2099
|
autoCellRendererByType: boolean;
|
|
2097
2100
|
onlyTemplateColDefs: boolean;
|
|
2098
2101
|
/**
|
|
@@ -2238,7 +2241,9 @@ export declare class GridPro extends GridPro_base {
|
|
|
2238
2241
|
private eventHandlers;
|
|
2239
2242
|
private gridEventsQueue;
|
|
2240
2243
|
private registeredGridEvents;
|
|
2244
|
+
private gridEventListeners;
|
|
2241
2245
|
private visibilityObserverCleanup?;
|
|
2246
|
+
private readonly boundGlobalEventListener;
|
|
2242
2247
|
private _filterConfig;
|
|
2243
2248
|
getfilterModel(): Promise<{
|
|
2244
2249
|
[key: string]: any;
|
|
@@ -2277,6 +2282,12 @@ export declare class GridPro extends GridPro_base {
|
|
|
2277
2282
|
hideDatasourceError(): void;
|
|
2278
2283
|
connectedCallback(): void;
|
|
2279
2284
|
disconnectedCallback(): void;
|
|
2285
|
+
private performDisconnectCleanup;
|
|
2286
|
+
/**
|
|
2287
|
+
* Tear down the AG Grid instance. Prefer {@link GridApi#destroy}; if `gridApi` is not set yet
|
|
2288
|
+
* (e.g. disconnect before `grid-ready`), fall back to {@link Grid#destroy} on the vanilla wrapper.
|
|
2289
|
+
*/
|
|
2290
|
+
private destroyGridInstance;
|
|
2280
2291
|
/**
|
|
2281
2292
|
* Handles datasource initialization
|
|
2282
2293
|
* @internal
|
|
@@ -2592,9 +2603,7 @@ declare const GridPro_base: (new (...args: any[]) => {
|
|
|
2592
2603
|
slot: string;
|
|
2593
2604
|
readonly tagName: string;
|
|
2594
2605
|
attachShadow(init: ShadowRootInit): ShadowRoot;
|
|
2595
|
-
checkVisibility(options
|
|
2596
|
-
* If true, will enable row flashing for all rows for `add` async transactions
|
|
2597
|
-
*/: CheckVisibilityOptions): boolean;
|
|
2606
|
+
checkVisibility(options?: CheckVisibilityOptions): boolean;
|
|
2598
2607
|
closest<K extends keyof HTMLElementTagNameMap>(selector: K): HTMLElementTagNameMap[K];
|
|
2599
2608
|
closest<K extends keyof SVGElementTagNameMap>(selector: K): SVGElementTagNameMap[K];
|
|
2600
2609
|
closest<K extends keyof MathMLElementTagNameMap>(selector: K): MathMLElementTagNameMap[K];
|
|
@@ -2959,6 +2968,9 @@ export declare class GridProBeta extends GridProBeta_base {
|
|
|
2959
2968
|
* @internal
|
|
2960
2969
|
*/
|
|
2961
2970
|
private debounced;
|
|
2971
|
+
private disposed;
|
|
2972
|
+
private readonly debouncedSaveColumnState;
|
|
2973
|
+
private readonly debouncedSaveFilterModel;
|
|
2962
2974
|
autoCellRendererByType: boolean;
|
|
2963
2975
|
onlyTemplateColDefs: boolean;
|
|
2964
2976
|
/**
|
|
@@ -3060,10 +3072,13 @@ export declare class GridProBeta extends GridProBeta_base {
|
|
|
3060
3072
|
protected initialised: boolean;
|
|
3061
3073
|
private rehydrationAttempted;
|
|
3062
3074
|
private rootEventsListeners;
|
|
3075
|
+
private datasourceEventHandlers;
|
|
3063
3076
|
private gridEventsQueue;
|
|
3064
3077
|
private registeredGridEvents;
|
|
3078
|
+
private gridEventListeners;
|
|
3065
3079
|
private luminanceSubscription?;
|
|
3066
3080
|
private visibilityObserverCleanup?;
|
|
3081
|
+
private readonly boundGlobalEventListener;
|
|
3067
3082
|
private _filterConfig;
|
|
3068
3083
|
getfilterModel(): Promise<{
|
|
3069
3084
|
[key: string]: any;
|
|
@@ -3102,8 +3117,11 @@ export declare class GridProBeta extends GridProBeta_base {
|
|
|
3102
3117
|
private handleBaseDatasourceError;
|
|
3103
3118
|
hideDatasourceError(): void;
|
|
3104
3119
|
private handleLuminanceChange;
|
|
3120
|
+
private readonly luminanceObserver;
|
|
3105
3121
|
connectedCallback(): void;
|
|
3106
3122
|
disconnectedCallback(): void;
|
|
3123
|
+
private performDisconnectCleanup;
|
|
3124
|
+
private destroyGridInstance;
|
|
3107
3125
|
/**
|
|
3108
3126
|
* Helper method to add or remove datasource event listeners
|
|
3109
3127
|
* @internal
|
|
@@ -3821,7 +3839,12 @@ declare const GridProBeta_base: (new (...args: any[]) => {
|
|
|
3821
3839
|
nonce?: string;
|
|
3822
3840
|
tabIndex: number;
|
|
3823
3841
|
blur(): void;
|
|
3824
|
-
focus(options
|
|
3842
|
+
focus(options
|
|
3843
|
+
/**
|
|
3844
|
+
* Handles removing CSS class from grid element
|
|
3845
|
+
* @internal
|
|
3846
|
+
*/
|
|
3847
|
+
?: FocusOptions): void;
|
|
3825
3848
|
}) & typeof FoundationElement;
|
|
3826
3849
|
|
|
3827
3850
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/grid-pro",
|
|
3
3
|
"description": "Genesis Foundation AG Grid",
|
|
4
|
-
"version": "14.419.
|
|
4
|
+
"version": "14.419.1",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
@@ -40,20 +40,20 @@
|
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@genesislcap/foundation-testing": "14.419.
|
|
44
|
-
"@genesislcap/genx": "14.419.
|
|
45
|
-
"@genesislcap/rollup-builder": "14.419.
|
|
46
|
-
"@genesislcap/ts-builder": "14.419.
|
|
47
|
-
"@genesislcap/uvu-playwright-builder": "14.419.
|
|
48
|
-
"@genesislcap/vite-builder": "14.419.
|
|
49
|
-
"@genesislcap/webpack-builder": "14.419.
|
|
43
|
+
"@genesislcap/foundation-testing": "14.419.1",
|
|
44
|
+
"@genesislcap/genx": "14.419.1",
|
|
45
|
+
"@genesislcap/rollup-builder": "14.419.1",
|
|
46
|
+
"@genesislcap/ts-builder": "14.419.1",
|
|
47
|
+
"@genesislcap/uvu-playwright-builder": "14.419.1",
|
|
48
|
+
"@genesislcap/vite-builder": "14.419.1",
|
|
49
|
+
"@genesislcap/webpack-builder": "14.419.1"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@genesislcap/foundation-comms": "14.419.
|
|
53
|
-
"@genesislcap/foundation-criteria": "14.419.
|
|
54
|
-
"@genesislcap/foundation-logger": "14.419.
|
|
55
|
-
"@genesislcap/foundation-ui": "14.419.
|
|
56
|
-
"@genesislcap/foundation-utils": "14.419.
|
|
52
|
+
"@genesislcap/foundation-comms": "14.419.1",
|
|
53
|
+
"@genesislcap/foundation-criteria": "14.419.1",
|
|
54
|
+
"@genesislcap/foundation-logger": "14.419.1",
|
|
55
|
+
"@genesislcap/foundation-ui": "14.419.1",
|
|
56
|
+
"@genesislcap/foundation-utils": "14.419.1",
|
|
57
57
|
"@microsoft/fast-colors": "5.3.1",
|
|
58
58
|
"@microsoft/fast-components": "2.30.6",
|
|
59
59
|
"@microsoft/fast-element": "1.14.0",
|
|
@@ -92,5 +92,5 @@
|
|
|
92
92
|
"require": "./dist/react.cjs"
|
|
93
93
|
}
|
|
94
94
|
},
|
|
95
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "e4880f9a62bd7ebb0a0e4798c8dfdd98de5c6e14"
|
|
96
96
|
}
|