@genesislcap/grid-pro 13.3.0 → 13.4.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/dts/grid-pro.d.ts
CHANGED
|
@@ -334,6 +334,8 @@ export declare class GridPro extends GridPro_base {
|
|
|
334
334
|
enabledRowFlashing: boolean;
|
|
335
335
|
enableCellFlashing: boolean;
|
|
336
336
|
persistColumnStateKey: string;
|
|
337
|
+
gridAutosizingEnabled: boolean;
|
|
338
|
+
private debounced;
|
|
337
339
|
gridFontFace: string;
|
|
338
340
|
columnComponentName: string;
|
|
339
341
|
eventsAndCallbacks: any;
|
|
@@ -357,6 +359,8 @@ export declare class GridPro extends GridPro_base {
|
|
|
357
359
|
disconnectedCallback(): void;
|
|
358
360
|
combineAllGridComponents(gridOptionsComponents: GridComponents): GridComponents;
|
|
359
361
|
statePersistanceEnabled(): boolean;
|
|
362
|
+
private debouncedColumnAutosize;
|
|
363
|
+
private removeConfigWidthsToAutosize;
|
|
360
364
|
private serialiseStoreTableConfig;
|
|
361
365
|
private rehydrateTableConfig;
|
|
362
366
|
set gridOptions(options: GridOptions);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid-pro.d.ts","sourceRoot":"","sources":["../../src/grid-pro.ts"],"names":[],"mappings":"AACA,OAAO,EACL,IAAI,EACJ,SAAS,EACT,OAAO,EAEP,WAAW,EACX,MAAM,
|
|
1
|
+
{"version":3,"file":"grid-pro.d.ts","sourceRoot":"","sources":["../../src/grid-pro.ts"],"names":[],"mappings":"AACA,OAAO,EACL,IAAI,EACJ,SAAS,EACT,OAAO,EAEP,WAAW,EACX,MAAM,EAKP,MAAM,yBAAyB,CAAC;AASjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAc/D,OAAO,EAKL,cAAc,EACf,MAAM,kBAAkB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAO,CAAC,oBAAoB,CAAS;;IAarC,iBAAiB,IAAI,IAAI;IAwBzB,oBAAoB,IAAI,IAAI;IAQ5B,wBAAwB,CAAC,qBAAqB,EAAE,cAAc,GAAG,cAAc;IAc/E,uBAAuB,IAAI,OAAO;IAYlC,OAAO,CAAC,uBAAuB;IAe/B,OAAO,CAAC,4BAA4B;IAIpC,OAAO,CAAC,yBAAyB;IAcjC,OAAO,CAAC,oBAAoB;IAa5B,IAAI,WAAW,CAAC,OAAO,EAAE,WAAW,EA2EnC;IAED,OAAO,CAAC,kBAAkB;IAiB1B,wBAAwB,CAAC,UAAU,GAAE,MAAM,EAAO;IAgClD,IAAI,kBAAkB,aAerB;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;AAGD,eAAO,MAAM,8BAA8B,EAAE,cAA0B,CAAC;AAExE,eAAO,MAAM,oBAAoB;;CAEhC,CAAC;AASF,eAAO,MAAM,iBAAiB;;;;;;;;;;kBAM5B,CAAC"}
|
|
@@ -5,4 +5,5 @@ export declare function getFilterParamsByFieldType(type: string): any;
|
|
|
5
5
|
export declare function dateValueFormatter({ value }: ValueFormatterParams): any;
|
|
6
6
|
export declare function dateTimeValueFormatter({ value }: ValueFormatterParams): any;
|
|
7
7
|
export declare function formatDateExtra(epoch: number): string;
|
|
8
|
+
export declare const DEBOUNCED_RESIZE_TIME = 5;
|
|
8
9
|
//# sourceMappingURL=grid-pro.definitions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid-pro.definitions.d.ts","sourceRoot":"","sources":["../../src/grid-pro.definitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAG/D,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CActD;AAED,wBAAgB,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,GAAG,CASvD;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAwC5D;AAED,wBAAgB,kBAAkB,CAAC,EAAE,KAAK,EAAE,EAAE,oBAAoB,GAAG,GAAG,CAEvE;AAED,wBAAgB,sBAAsB,CAAC,EAAE,KAAK,EAAE,EAAE,oBAAoB,GAAG,GAAG,CAE3E;AAID,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMrD"}
|
|
1
|
+
{"version":3,"file":"grid-pro.definitions.d.ts","sourceRoot":"","sources":["../../src/grid-pro.definitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAG/D,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CActD;AAED,wBAAgB,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,GAAG,CASvD;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAwC5D;AAED,wBAAgB,kBAAkB,CAAC,EAAE,KAAK,EAAE,EAAE,oBAAoB,GAAG,GAAG,CAEvE;AAED,wBAAgB,sBAAsB,CAAC,EAAE,KAAK,EAAE,EAAE,oBAAoB,GAAG,GAAG,CAE3E;AAID,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMrD;AAMD,eAAO,MAAM,qBAAqB,IAAI,CAAC"}
|
package/dist/esm/grid-pro.js
CHANGED
|
@@ -3,7 +3,7 @@ import { ClientSideRowModelModule } from '@ag-grid-community/client-side-row-mod
|
|
|
3
3
|
import { Grid, ComponentUtil, Events, ModuleRegistry, } from '@ag-grid-community/core';
|
|
4
4
|
import { CsvExportModule } from '@ag-grid-community/csv-export';
|
|
5
5
|
import { Session } from '@genesislcap/foundation-comms';
|
|
6
|
-
import { insertDocumentCSSRule, LifecycleMixin } from '@genesislcap/foundation-utils';
|
|
6
|
+
import { 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';
|
|
@@ -12,6 +12,7 @@ import { ActionRenderer, ActionsMenuRenderer, BooleanRenderer } from './cell-ren
|
|
|
12
12
|
import { GridColumn } from './column';
|
|
13
13
|
import { agThemeFontFaceMap, defaultAgGridFontFace } from './external';
|
|
14
14
|
import { GridProGenesisDatasource, GridProGenesisDatasourceNext, } from './grid-pro-genesis-datasource';
|
|
15
|
+
import { DEBOUNCED_RESIZE_TIME } from './grid-pro.definitions';
|
|
15
16
|
import { foundationGridProStyles as styles } from './grid-pro.styles';
|
|
16
17
|
import { gridProTemplate as template } from './grid-pro.template';
|
|
17
18
|
import { AgGridTheme, GridProRendererTypes, agThemeFontsId, agThemeTokenMapClassname, } from './grid-pro.types';
|
|
@@ -37,6 +38,7 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
|
|
|
37
38
|
this.onlyTemplateColDefs = false;
|
|
38
39
|
this.enabledRowFlashing = false;
|
|
39
40
|
this.enableCellFlashing = false;
|
|
41
|
+
this.gridAutosizingEnabled = false;
|
|
40
42
|
this.gridFontFace = defaultAgGridFontFace;
|
|
41
43
|
this.columnComponentName = 'grid-pro-column';
|
|
42
44
|
this.theme = AgGridTheme.alpine;
|
|
@@ -51,6 +53,13 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
|
|
|
51
53
|
connectedCallback() {
|
|
52
54
|
super.connectedCallback();
|
|
53
55
|
this.rehydrationAttempted = false;
|
|
56
|
+
if (this.gridAutosizingEnabled) {
|
|
57
|
+
respondToVisibility(this, (gridVisible) => {
|
|
58
|
+
if (gridVisible) {
|
|
59
|
+
this.debouncedColumnAutosize.bind(this)();
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
54
63
|
if (!this.shouldRunConnect)
|
|
55
64
|
return;
|
|
56
65
|
ComponentUtil.ALL_PROPERTIES.forEach((key) => {
|
|
@@ -85,10 +94,28 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
|
|
|
85
94
|
}
|
|
86
95
|
return true;
|
|
87
96
|
}
|
|
97
|
+
debouncedColumnAutosize() {
|
|
98
|
+
if (!this.gridAutosizingEnabled)
|
|
99
|
+
return;
|
|
100
|
+
if (this.debounced) {
|
|
101
|
+
clearTimeout(this.debounced);
|
|
102
|
+
this.debounced = null;
|
|
103
|
+
}
|
|
104
|
+
this.debounced = setTimeout(() => {
|
|
105
|
+
var _a;
|
|
106
|
+
(_a = this.gridApi) === null || _a === void 0 ? void 0 : _a.sizeColumnsToFit();
|
|
107
|
+
}, DEBOUNCED_RESIZE_TIME);
|
|
108
|
+
}
|
|
109
|
+
removeConfigWidthsToAutosize(colState) {
|
|
110
|
+
return colState.map((col) => (Object.assign(Object.assign({}, col), { width: null })));
|
|
111
|
+
}
|
|
88
112
|
serialiseStoreTableConfig() {
|
|
89
113
|
if (this.rehydrationAttempted && this.statePersistanceEnabled()) {
|
|
90
114
|
const existingOptions = JSON.parse(this.session.getLocalStorageItem('gridOptions') || '{}');
|
|
91
|
-
|
|
115
|
+
let colState = this.agGridOptions.columnApi.getColumnState();
|
|
116
|
+
colState = this.gridAutosizingEnabled
|
|
117
|
+
? this.removeConfigWidthsToAutosize(colState)
|
|
118
|
+
: colState;
|
|
92
119
|
existingOptions[this.persistColumnStateKey] = JSON.stringify(colState);
|
|
93
120
|
this.session.setLocalStorageItem('gridOptions', JSON.stringify(existingOptions));
|
|
94
121
|
}
|
|
@@ -107,7 +134,10 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
|
|
|
107
134
|
}
|
|
108
135
|
set gridOptions(options) {
|
|
109
136
|
const globalEventListener = this.globalEventListener.bind(this);
|
|
110
|
-
const
|
|
137
|
+
const gridOnChangeCallback = () => {
|
|
138
|
+
this.serialiseStoreTableConfig.bind(this)();
|
|
139
|
+
this.debouncedColumnAutosize.bind(this)();
|
|
140
|
+
};
|
|
111
141
|
const rehydrateTableConfig = this.rehydrateTableConfig.bind(this);
|
|
112
142
|
Array.from(this.attributes).forEach((attribute) => {
|
|
113
143
|
const attrName = this.agPropertiesMap[attribute.name];
|
|
@@ -132,9 +162,10 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
|
|
|
132
162
|
gridId: this.id,
|
|
133
163
|
});
|
|
134
164
|
rehydrateTableConfig();
|
|
165
|
+
this.debouncedColumnAutosize.bind(this)();
|
|
135
166
|
}, onFirstDataRendered: () => {
|
|
136
167
|
this.enableFlashingRows.bind(this);
|
|
137
|
-
}, onColumnPinned:
|
|
168
|
+
}, onColumnPinned: gridOnChangeCallback, onColumnResized: gridOnChangeCallback, onColumnMoved: gridOnChangeCallback, onDisplayedColumnsChanged: gridOnChangeCallback, onFilterChanged: gridOnChangeCallback, onGridSizeChanged: gridOnChangeCallback, onSortChanged: gridOnChangeCallback }), rest);
|
|
138
169
|
this.agGridOptions = Object.assign(Object.assign({}, this.agGridOptions), ComponentUtil.copyAttributesToGridOptions(derivedOptions, this.agAttributes));
|
|
139
170
|
const gridParams = {
|
|
140
171
|
globalEventListener: globalEventListener,
|
|
@@ -255,6 +286,9 @@ __decorate([
|
|
|
255
286
|
__decorate([
|
|
256
287
|
attr({ attribute: 'persist-column-state-key' })
|
|
257
288
|
], GridPro.prototype, "persistColumnStateKey", void 0);
|
|
289
|
+
__decorate([
|
|
290
|
+
attr({ mode: 'boolean', attribute: 'grid-autosizing' })
|
|
291
|
+
], GridPro.prototype, "gridAutosizingEnabled", void 0);
|
|
258
292
|
__decorate([
|
|
259
293
|
observable
|
|
260
294
|
], GridPro.prototype, "gridFontFace", void 0);
|
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": "13.
|
|
4
|
+
"version": "13.4.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"test": "echo \"Error: no test specified\""
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@genesislcap/foundation-testing": "^13.
|
|
29
|
+
"@genesislcap/foundation-testing": "^13.4.0",
|
|
30
30
|
"@playwright/test": "^1.18.1",
|
|
31
31
|
"@rollup/plugin-commonjs": "^21.0.1",
|
|
32
32
|
"@rollup/plugin-node-resolve": "^13.1.3",
|
|
@@ -78,9 +78,9 @@
|
|
|
78
78
|
"webpack-merge": "^5.7.3"
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
|
-
"@genesislcap/foundation-comms": "^13.
|
|
82
|
-
"@genesislcap/foundation-ui": "^13.
|
|
83
|
-
"@genesislcap/foundation-utils": "^13.
|
|
81
|
+
"@genesislcap/foundation-comms": "^13.4.0",
|
|
82
|
+
"@genesislcap/foundation-ui": "^13.4.0",
|
|
83
|
+
"@genesislcap/foundation-utils": "^13.4.0",
|
|
84
84
|
"@microsoft/fast-colors": "^5.1.4",
|
|
85
85
|
"@microsoft/fast-components": "^2.21.3",
|
|
86
86
|
"@microsoft/fast-element": "^1.7.0",
|
|
@@ -101,5 +101,5 @@
|
|
|
101
101
|
"publishConfig": {
|
|
102
102
|
"access": "public"
|
|
103
103
|
},
|
|
104
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "09a56e5f2666a2ee29571d0974484439734329ff"
|
|
105
105
|
}
|