@equinor/apollo-components 1.5.2 → 1.6.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/index.d.ts CHANGED
@@ -25,8 +25,9 @@ declare const ChipsCell: (props: {
25
25
  declare type TableCellProps<T> = {
26
26
  cell: Cell<T, unknown>;
27
27
  highlight?: boolean;
28
+ getStickyCellColor?: (cell: Cell<T, unknown>) => string;
28
29
  };
29
- declare function DynamicCell<T>({ cell, highlight }: TableCellProps<T>): JSX.Element;
30
+ declare function DynamicCell<T>({ cell, highlight, getStickyCellColor }: TableCellProps<T>): JSX.Element;
30
31
 
31
32
  declare type HierarchyCellOptions = {
32
33
  getRowDepth?: () => number;
@@ -42,6 +43,7 @@ interface HeaderConfig {
42
43
  interface FilterConfig {
43
44
  globalFilter?: boolean;
44
45
  globalFilterPlaceholder?: string;
46
+ filterFromLeafRows?: boolean;
45
47
  }
46
48
  declare type RowSelectionMode = 'single' | 'multiple';
47
49
  declare type DataTableConfig<T> = {
package/dist/index.js CHANGED
@@ -224,13 +224,14 @@ var StyledStickyCell = (0, import_styled_components6.default)(StickyCell)`
224
224
  ${leftCellShadow}
225
225
  `;
226
226
  var StyledCell = (0, import_styled_components6.default)(import_eds_core_react4.Table.Cell)`
227
- background-color: ${(props) => props.backgroundColor ? props.backgroundColor + " !important" : void 0};
227
+ ${(props) => props.backgroundColor ? `background-color: ${props.backgroundColor} !important;` : ``}
228
228
  `;
229
- function DynamicCell({ cell, highlight }) {
229
+ function DynamicCell({ cell, highlight, getStickyCellColor }) {
230
230
  var _a;
231
231
  const cellContent = (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext());
232
232
  if ((_a = cell.column.columnDef.meta) == null ? void 0 : _a.sticky) {
233
233
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(StyledStickyCell, {
234
+ backgroundColor: getStickyCellColor == null ? void 0 : getStickyCellColor(cell),
234
235
  "data-column": cell.column.id,
235
236
  children: cellContent
236
237
  });
@@ -910,6 +911,7 @@ function DataTable({
910
911
  enableExpanding: !(config == null ? void 0 : config.hideExpandControls),
911
912
  enableMultiRowSelection: (config == null ? void 0 : config.rowSelectionMode) === "multiple",
912
913
  enableSubRowSelection: (config == null ? void 0 : config.rowSelectionMode) !== "single",
914
+ filterFromLeafRows: filters == null ? void 0 : filters.filterFromLeafRows,
913
915
  getFilteredRowModel: enableGlobalFilter((0, import_react_table5.getFilteredRowModel)()),
914
916
  getCoreRowModel: (0, import_react_table5.getCoreRowModel)(),
915
917
  getExpandedRowModel: (0, import_react_table5.getExpandedRowModel)(),
package/dist/index.mjs CHANGED
@@ -178,13 +178,14 @@ var StyledStickyCell = styled5(StickyCell)`
178
178
  ${leftCellShadow}
179
179
  `;
180
180
  var StyledCell = styled5(Table2.Cell)`
181
- background-color: ${(props) => props.backgroundColor ? props.backgroundColor + " !important" : void 0};
181
+ ${(props) => props.backgroundColor ? `background-color: ${props.backgroundColor} !important;` : ``}
182
182
  `;
183
- function DynamicCell({ cell, highlight }) {
183
+ function DynamicCell({ cell, highlight, getStickyCellColor }) {
184
184
  var _a;
185
185
  const cellContent = flexRender(cell.column.columnDef.cell, cell.getContext());
186
186
  if ((_a = cell.column.columnDef.meta) == null ? void 0 : _a.sticky) {
187
187
  return /* @__PURE__ */ jsx4(StyledStickyCell, {
188
+ backgroundColor: getStickyCellColor == null ? void 0 : getStickyCellColor(cell),
188
189
  "data-column": cell.column.id,
189
190
  children: cellContent
190
191
  });
@@ -872,6 +873,7 @@ function DataTable({
872
873
  enableExpanding: !(config == null ? void 0 : config.hideExpandControls),
873
874
  enableMultiRowSelection: (config == null ? void 0 : config.rowSelectionMode) === "multiple",
874
875
  enableSubRowSelection: (config == null ? void 0 : config.rowSelectionMode) !== "single",
876
+ filterFromLeafRows: filters == null ? void 0 : filters.filterFromLeafRows,
875
877
  getFilteredRowModel: enableGlobalFilter(getFilteredRowModel()),
876
878
  getCoreRowModel: getCoreRowModel(),
877
879
  getExpandedRowModel: getExpandedRowModel(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/apollo-components",
3
- "version": "1.5.2",
3
+ "version": "1.6.0",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -20,8 +20,8 @@
20
20
  "@equinor/eds-core-react": "^0.27.0",
21
21
  "@equinor/eds-icons": "^0.15.0",
22
22
  "@equinor/eds-tokens": "^0.9.0",
23
- "@tanstack/match-sorter-utils": "^8.5.14",
24
- "@tanstack/react-table": "^8.5.15",
23
+ "@tanstack/match-sorter-utils": "^8.7.6",
24
+ "@tanstack/react-table": "^8.7.6",
25
25
  "@tanstack/react-virtual": "^3.0.0-beta.23",
26
26
  "jotai": "^1.10.0",
27
27
  "styled-components": "^5.3.6",