@genesislcap/grid-pro 13.0.1 → 13.2.0-pa-659.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/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
|
+
columnAutosizing: 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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OAAO,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;IAYjC,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.columnAutosizing = 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.columnAutosizing) {
|
|
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,26 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
|
|
|
85
94
|
}
|
|
86
95
|
return true;
|
|
87
96
|
}
|
|
97
|
+
debouncedColumnAutosize() {
|
|
98
|
+
if (!this.columnAutosizing)
|
|
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.columnAutosizing ? this.removeConfigWidthsToAutosize(colState) : colState;
|
|
92
117
|
existingOptions[this.persistColumnStateKey] = JSON.stringify(colState);
|
|
93
118
|
this.session.setLocalStorageItem('gridOptions', JSON.stringify(existingOptions));
|
|
94
119
|
}
|
|
@@ -107,7 +132,10 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
|
|
|
107
132
|
}
|
|
108
133
|
set gridOptions(options) {
|
|
109
134
|
const globalEventListener = this.globalEventListener.bind(this);
|
|
110
|
-
const
|
|
135
|
+
const gridOnChangeCallback = () => {
|
|
136
|
+
this.serialiseStoreTableConfig.bind(this)();
|
|
137
|
+
this.debouncedColumnAutosize.bind(this)();
|
|
138
|
+
};
|
|
111
139
|
const rehydrateTableConfig = this.rehydrateTableConfig.bind(this);
|
|
112
140
|
Array.from(this.attributes).forEach((attribute) => {
|
|
113
141
|
const attrName = this.agPropertiesMap[attribute.name];
|
|
@@ -132,9 +160,10 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
|
|
|
132
160
|
gridId: this.id,
|
|
133
161
|
});
|
|
134
162
|
rehydrateTableConfig();
|
|
163
|
+
this.debouncedColumnAutosize.bind(this)();
|
|
135
164
|
}, onFirstDataRendered: () => {
|
|
136
165
|
this.enableFlashingRows.bind(this);
|
|
137
|
-
}, onColumnPinned:
|
|
166
|
+
}, onColumnPinned: gridOnChangeCallback, onColumnResized: gridOnChangeCallback, onColumnMoved: gridOnChangeCallback, onDisplayedColumnsChanged: gridOnChangeCallback, onFilterChanged: gridOnChangeCallback, onGridSizeChanged: gridOnChangeCallback, onSortChanged: gridOnChangeCallback }), rest);
|
|
138
167
|
this.agGridOptions = Object.assign(Object.assign({}, this.agGridOptions), ComponentUtil.copyAttributesToGridOptions(derivedOptions, this.agAttributes));
|
|
139
168
|
const gridParams = {
|
|
140
169
|
globalEventListener: globalEventListener,
|
|
@@ -255,6 +284,9 @@ __decorate([
|
|
|
255
284
|
__decorate([
|
|
256
285
|
attr({ attribute: 'persist-column-state-key' })
|
|
257
286
|
], GridPro.prototype, "persistColumnStateKey", void 0);
|
|
287
|
+
__decorate([
|
|
288
|
+
attr({ mode: 'boolean', attribute: 'column-autosizing' })
|
|
289
|
+
], GridPro.prototype, "columnAutosizing", void 0);
|
|
258
290
|
__decorate([
|
|
259
291
|
observable
|
|
260
292
|
], 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.0.1",
|
|
4
|
+
"version": "13.2.0-pa-659.1",
|
|
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": "
|
|
29
|
+
"@genesislcap/foundation-testing": "13.2.0-pa-659.1",
|
|
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": "
|
|
82
|
-
"@genesislcap/foundation-ui": "
|
|
83
|
-
"@genesislcap/foundation-utils": "
|
|
81
|
+
"@genesislcap/foundation-comms": "13.2.0-pa-659.1",
|
|
82
|
+
"@genesislcap/foundation-ui": "13.2.0-pa-659.1",
|
|
83
|
+
"@genesislcap/foundation-utils": "13.2.0-pa-659.1",
|
|
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": "5f7cfea7d5fc30205cb5f930d6f69c0b72a12ccf"
|
|
105
105
|
}
|