@platforma-sdk/ui-vue 1.11.0 → 1.11.2
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/CHANGELOG.md +12 -0
- package/dist/lib.js +3680 -3677
- package/dist/lib.umd.cjs +32 -30
- package/dist/src/aggrid.d.ts.map +1 -1
- package/dist/src/components/PlAgDataTable/PlAgDataTable.vue.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/aggrid.ts +36 -31
- package/src/components/PlAgDataTable/PlAgDataTable.vue +13 -10
- package/src/components/PlAgDataTable/ag-override.css +3 -0
package/package.json
CHANGED
package/src/aggrid.ts
CHANGED
|
@@ -13,7 +13,8 @@ import { MenuModule } from '@ag-grid-enterprise/menu';
|
|
|
13
13
|
import { ExcelExportModule } from '@ag-grid-enterprise/excel-export';
|
|
14
14
|
import { SideBarModule } from '@ag-grid-enterprise/side-bar';
|
|
15
15
|
import { ColumnsToolPanelModule } from '@ag-grid-enterprise/column-tool-panel';
|
|
16
|
-
import { type Theme, themeQuartz } from '@ag-grid-community/theming';
|
|
16
|
+
import { type Theme, themeQuartz, createPart } from '@ag-grid-community/theming';
|
|
17
|
+
import OverrideCss from './components/PlAgDataTable/ag-override.css?raw';
|
|
17
18
|
|
|
18
19
|
export function activateAgGrid() {
|
|
19
20
|
ModuleRegistry.registerModules([
|
|
@@ -38,33 +39,37 @@ export function activateAgGrid() {
|
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
42
|
+
const agGridOverrideStyles = createPart('headerBottomBorder').withCSS(OverrideCss);
|
|
43
|
+
|
|
44
|
+
export const AgGridTheme: Theme = themeQuartz
|
|
45
|
+
.withParams({
|
|
46
|
+
headerColumnResizeHandleColor: 'transparent',
|
|
47
|
+
accentColor: '#110529',
|
|
48
|
+
borderColor: '#E1E3EB',
|
|
49
|
+
cellHorizontalPaddingScale: 1,
|
|
50
|
+
checkboxBorderRadius: '3px',
|
|
51
|
+
checkboxUncheckedBorderColor: '#CFD1DB',
|
|
52
|
+
columnBorder: true,
|
|
53
|
+
columnHoverColor: '#9BABCC16',
|
|
54
|
+
fontFamily: 'inherit',
|
|
55
|
+
foregroundColor: '#110529',
|
|
56
|
+
headerBackgroundColor: '#F7F8FA',
|
|
57
|
+
headerColumnBorder: true,
|
|
58
|
+
headerFontWeight: 600,
|
|
59
|
+
headerRowBorder: true,
|
|
60
|
+
headerVerticalPaddingScale: 0.8,
|
|
61
|
+
iconButtonHoverColor: '#9BABCC32',
|
|
62
|
+
iconSize: '16px',
|
|
63
|
+
menuBackgroundColor: '#FFFFFF',
|
|
64
|
+
menuBorder: true,
|
|
65
|
+
menuTextColor: '#110529',
|
|
66
|
+
rowHoverColor: '#9BABCC16',
|
|
67
|
+
rowVerticalPaddingScale: 1,
|
|
68
|
+
selectedRowBackgroundColor: '#63E02424',
|
|
69
|
+
sidePanelBorder: false,
|
|
70
|
+
spacing: '8px',
|
|
71
|
+
tooltipBackgroundColor: '#110529',
|
|
72
|
+
tooltipTextColor: '#FFFFFF',
|
|
73
|
+
wrapperBorderRadius: '6px',
|
|
74
|
+
})
|
|
75
|
+
.withPart(agGridOverrideStyles);
|
|
@@ -384,23 +384,27 @@ const onSheetChanged = (sheetId: string, newValue: string | number) => {
|
|
|
384
384
|
});
|
|
385
385
|
};
|
|
386
386
|
|
|
387
|
+
const platforma = window.platforma;
|
|
388
|
+
if (!platforma) throw Error('platforma not set');
|
|
389
|
+
const pfDriver = platforma.pFrameDriver;
|
|
390
|
+
if (!pfDriver) throw Error('platforma.pFrameDriver not set');
|
|
391
|
+
const blobDriver = platforma.blobDriver;
|
|
392
|
+
if (!blobDriver) throw Error('platforma.blobDriver not set');
|
|
393
|
+
|
|
394
|
+
let oldSettings: PlDataTableSettings | undefined = undefined;
|
|
387
395
|
watch(
|
|
388
396
|
() => [gridApi.value, settings.value, sheets.value] as const,
|
|
389
|
-
async (state
|
|
390
|
-
if (lodash.isEqual(state, oldState)) return;
|
|
391
|
-
|
|
397
|
+
async (state) => {
|
|
392
398
|
const [gridApi, settings, sheets] = state;
|
|
393
399
|
if (!gridApi) return;
|
|
394
400
|
|
|
395
|
-
|
|
396
|
-
|
|
401
|
+
if (lodash.isEqual(settings, oldSettings)) return;
|
|
402
|
+
oldSettings = settings;
|
|
397
403
|
|
|
398
404
|
const sourceType = settings.sourceType;
|
|
399
405
|
switch (sourceType) {
|
|
400
406
|
case 'pframe':
|
|
401
407
|
case 'ptable': {
|
|
402
|
-
const pfDriver = platforma.pFrameDriver;
|
|
403
|
-
if (!pfDriver) throw Error('platforma.pFrameDriver not set');
|
|
404
408
|
const pTable = settings.pTable;
|
|
405
409
|
if (!pTable || !sheets) {
|
|
406
410
|
return gridApi.updateGridOptions({
|
|
@@ -409,8 +413,10 @@ watch(
|
|
|
409
413
|
columnDefs: [],
|
|
410
414
|
});
|
|
411
415
|
}
|
|
416
|
+
|
|
412
417
|
const hiddenColIds = gridState.value?.columnVisibility?.hiddenColIds;
|
|
413
418
|
const options = await updatePFrameGridOptions(pfDriver, pTable, sheets, hiddenColIds);
|
|
419
|
+
|
|
414
420
|
return gridApi.updateGridOptions({
|
|
415
421
|
loading: options.rowModelType !== 'clientSide',
|
|
416
422
|
loadingOverlayComponentParams: { notReady: false },
|
|
@@ -419,9 +425,6 @@ watch(
|
|
|
419
425
|
}
|
|
420
426
|
|
|
421
427
|
case 'xsv': {
|
|
422
|
-
const blobDriver = platforma.blobDriver;
|
|
423
|
-
if (!blobDriver) throw Error('platforma.blobDriver not set');
|
|
424
|
-
|
|
425
428
|
const xsvFile = settings.xsvFile;
|
|
426
429
|
if (!xsvFile?.ok || !xsvFile.value) {
|
|
427
430
|
return gridApi.updateGridOptions({
|