@genesislcap/pbc-reporting-ui 1.0.381 → 1.0.382

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.
@@ -10,7 +10,6 @@ export declare class GeneratedReports extends GenesisElement {
10
10
  getStatusRenderer: (value: any) => string;
11
11
  getColumnDefs(): ColDef<any>[];
12
12
  getGridOptions(): GridOptionsConfig;
13
- private actionsCellRenderer;
14
13
  private downloadReport;
15
14
  private deleteReport;
16
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"generated-reports.d.ts","sourceRoot":"","sources":["../../../../../src/new/main/generated-reports/generated-reports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA4C,MAAM,yBAAyB,CAAC;AAC3F,OAAO,EAAE,OAAO,EAAU,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC1F,OAAO,EAAiB,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAQtE,qBAKa,gBAAiB,SAAQ,cAAc;IACzC,OAAO,EAAE,OAAO,CAAC;IAC1B,0BAA0B,EAAE,wBAAwB,CAAC;IACrD,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAEjC,QAAQ,qGAYN;IAEF,iBAAiB,yBAEf;IAEF,aAAa;IAuDb,cAAc;IA6Bd,OAAO,CAAC,mBAAmB;YAab,cAAc;YAkCd,YAAY;CAmC3B"}
1
+ {"version":3,"file":"generated-reports.d.ts","sourceRoot":"","sources":["../../../../../src/new/main/generated-reports/generated-reports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA4C,MAAM,yBAAyB,CAAC;AAC3F,OAAO,EAAE,OAAO,EAAU,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC1F,OAAO,EAAiB,cAAc,EAAQ,MAAM,uBAAuB,CAAC;AAQ5E,qBAKa,gBAAiB,SAAQ,cAAc;IACzC,OAAO,EAAE,OAAO,CAAC;IAC1B,0BAA0B,EAAE,wBAAwB,CAAC;IACrD,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAEjC,QAAQ,qGAYN;IAEF,iBAAiB,yBAEf;IAEF,aAAa;IAkEb,cAAc;YA6BA,cAAc;YAkCd,YAAY;CAmC3B"}
@@ -1,3 +1,3 @@
1
- export declare const cellIconCreator: (icon: string, variant?: string, color?: string) => HTMLElement;
2
- export declare const actionsContainerCell: (justifyContent?: string) => HTMLDivElement;
1
+ import { ColDef } from '@ag-grid-community/core';
2
+ export declare const buttonCellRenderer: (title: any, clickHandler: any, contentTemplate: any) => ColDef;
3
3
  //# sourceMappingURL=renderer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../../../src/new/utils/renderer.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,SACpB,MAAM,kDAmBb,CAAC;AAEF,eAAO,MAAM,oBAAoB,oBAAoB,MAAM,mBAS1D,CAAC"}
1
+ {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../../../src/new/utils/renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD,eAAO,MAAM,kBAAkB,2DAA2C,MA2BxE,CAAC"}
@@ -1,11 +1,11 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { Connect, logger } from '@genesislcap/foundation-comms';
3
3
  import { showNotificationToast } from '@genesislcap/foundation-notifications';
4
- import { customElement, GenesisElement } from '@genesislcap/web-core';
4
+ import { customElement, GenesisElement, html } from '@genesislcap/web-core';
5
5
  import { getFilterParams } from '../../utils/date-filter-params';
6
6
  import { getEndpointUrl } from '../../utils/endpoint';
7
7
  import { getFormattedDateTime } from '../../utils/formatters';
8
- import { actionsContainerCell, cellIconCreator } from '../../utils/renderer';
8
+ import { buttonCellRenderer } from '../../utils/renderer';
9
9
  import { GeneratedReportsStyles as styles } from './generated-reports.styles';
10
10
  import { GeneratedReportsTemplate as template } from './generated-reports.template';
11
11
  let GeneratedReports = class GeneratedReports extends GenesisElement {
@@ -64,21 +64,24 @@ let GeneratedReports = class GeneratedReports extends GenesisElement {
64
64
  headerName: 'Created Date',
65
65
  minWidth: 150,
66
66
  flex: 1,
67
+ sortable: true,
68
+ sort: 'desc',
67
69
  cellStyle: { display: 'flex' },
68
70
  filter: 'agDateColumnFilter',
69
71
  filterParams: getFilterParams(),
70
72
  valueFormatter: (rowData) => getFormattedDateTime(rowData.data.LAST_UPDATED_AT),
71
73
  },
72
- {
73
- field: 'Actions',
74
- filter: false,
75
- pinned: 'right',
76
- minWidth: 110,
77
- maxWidth: 110,
78
- flex: 1,
79
- cellStyle: { display: 'flex', alignItems: 'center' },
80
- cellRenderer: (params) => this.actionsCellRenderer(params),
81
- },
74
+ buttonCellRenderer('Delete', (e) => this.deleteReport(e.GENERATED_REPORT_ID), html `
75
+ <rapid-icon
76
+ style="opacity: 0.5"
77
+ variant="regular"
78
+ name="trash-alt"
79
+ size="lg"
80
+ ></rapid-icon>
81
+ `),
82
+ buttonCellRenderer('Download', (e) => this.downloadReport(e.REPORT_FILE_STORAGE_ID), html `
83
+ <rapid-icon style="opacity: 0.5" variant="solid" name="download" size="lg"></rapid-icon>
84
+ `),
82
85
  ];
83
86
  return columnDefs;
84
87
  }
@@ -88,7 +91,6 @@ let GeneratedReports = class GeneratedReports extends GenesisElement {
88
91
  filter: true,
89
92
  floatingFilter: false,
90
93
  sortable: false,
91
- sort: 'asc',
92
94
  suppressMenu: false,
93
95
  resizable: false,
94
96
  },
@@ -110,15 +112,6 @@ let GeneratedReports = class GeneratedReports extends GenesisElement {
110
112
  };
111
113
  return gridOptions;
112
114
  }
113
- actionsCellRenderer(params) {
114
- const deleteIcon = cellIconCreator('trash-alt');
115
- const downloadIcon = cellIconCreator('download', 'solid');
116
- downloadIcon.addEventListener('click', () => this.downloadReport(params.data.REPORT_FILE_STORAGE_ID));
117
- deleteIcon.addEventListener('click', () => this.deleteReport(params.data.GENERATED_REPORT_ID));
118
- const container = actionsContainerCell();
119
- container.append(deleteIcon, downloadIcon);
120
- return container;
121
- }
122
115
  async downloadReport(fileStorageId) {
123
116
  const headers = new Headers();
124
117
  headers.append('SESSION_AUTH_TOKEN', sessionStorage.getItem('authToken') || '');
@@ -1,25 +1,26 @@
1
- export const cellIconCreator = (icon, variant = 'regular', color = `var(--neutral-foreground-hint)`) => {
2
- const cellIcon = document.createElement('rapid-icon');
3
- cellIcon.setAttribute('name', icon);
4
- cellIcon.setAttribute('size', '1x');
5
- cellIcon.setAttribute('variant', variant);
6
- cellIcon.style.display = 'flex';
7
- cellIcon.style.alignItems = 'center';
8
- cellIcon.style.justifyContent = 'center';
9
- cellIcon.style.background = `var(--neutral-layer-2)`;
10
- cellIcon.style.color = color;
11
- cellIcon.style.borderRadius = '2px';
12
- cellIcon.style.cursor = 'pointer';
13
- cellIcon.style.width = '24px';
14
- cellIcon.style.height = '24px';
15
- return cellIcon;
16
- };
17
- export const actionsContainerCell = (justifyContent = 'center') => {
18
- const container = document.createElement('div');
19
- container.style.display = 'flex';
20
- container.style.height = '100%';
21
- container.style.gap = '10px';
22
- container.style.justifyContent = justifyContent;
23
- container.style.alignItems = 'center';
24
- return container;
25
- };
1
+ export const buttonCellRenderer = (title, clickHandler, contentTemplate) => ({
2
+ colId: `action-${title}`,
3
+ width: 50,
4
+ pinned: 'right',
5
+ enableCellChangeFlash: false,
6
+ cellStyle: { padding: '0', lineHeight: '25px' },
7
+ filter: false,
8
+ suppressFiltersToolPanel: true,
9
+ suppressColumnsToolPanel: true,
10
+ headerName: '',
11
+ minWidth: 35,
12
+ maxWidth: 35,
13
+ resizable: false,
14
+ cellRendererSelector: (params) => params.node.group
15
+ ? undefined
16
+ : {
17
+ component: 'action',
18
+ params: {
19
+ actionClick: clickHandler,
20
+ actionName: title,
21
+ contentTemplate,
22
+ appearance: 'neutral',
23
+ actionButtonStyle: 'width: 24px; height: 24px; min-width: 24px; border: none; background: var(--neutral-layer-2);',
24
+ },
25
+ },
26
+ });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/pbc-reporting-ui",
3
3
  "description": "Genesis PBC Reporting UI",
4
- "version": "1.0.381",
4
+ "version": "1.0.382",
5
5
  "license": "SEE LICENSE IN license.txt",
6
6
  "main": "dist/esm/index.js",
7
7
  "types": "dist/dts/index.d.ts",