@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platforma-sdk/ui-vue",
3
- "version": "1.11.0",
3
+ "version": "1.11.2",
4
4
  "type": "module",
5
5
  "main": "dist/lib.umd.cjs",
6
6
  "module": "dist/lib.js",
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
- export const AgGridTheme: Theme = themeQuartz.withParams({
42
- headerColumnResizeHandleColor: 'transparent',
43
- accentColor: '#110529',
44
- borderColor: '#E1E3EB',
45
- cellHorizontalPaddingScale: 1,
46
- checkboxBorderRadius: '3px',
47
- checkboxUncheckedBorderColor: '#CFD1DB',
48
- columnBorder: true,
49
- columnHoverColor: '#9BABCC16',
50
- fontFamily: 'inherit',
51
- foregroundColor: '#110529',
52
- headerBackgroundColor: '#F7F8FA',
53
- headerColumnBorder: true,
54
- headerFontWeight: 600,
55
- headerRowBorder: true,
56
- headerVerticalPaddingScale: 0.8,
57
- iconButtonHoverColor: '#9BABCC32',
58
- iconSize: '16px',
59
- menuBackgroundColor: '#FFFFFF',
60
- menuBorder: true,
61
- menuTextColor: '#110529',
62
- rowHoverColor: '#9BABCC16',
63
- rowVerticalPaddingScale: 1,
64
- selectedRowBackgroundColor: '#63E02424',
65
- sidePanelBorder: false,
66
- spacing: '8px',
67
- tooltipBackgroundColor: '#110529',
68
- tooltipTextColor: '#FFFFFF',
69
- wrapperBorderRadius: '6px',
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, oldState) => {
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
- const platforma = window.platforma;
396
- if (!platforma) throw Error('platforma not set');
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({
@@ -0,0 +1,3 @@
1
+ .ag-header {
2
+ border-bottom: 1px solid var(--border-color-default);
3
+ }