@economic/taco 2.58.2-EC-64961.4 → 2.58.2-EC-64961.6

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/taco.d.ts CHANGED
@@ -3220,7 +3220,7 @@ export declare type TableColumnProps<TType = unknown> = TableColumnIdentifierPro
3220
3220
 
3221
3221
  export declare type TableColumnRenderer<TType, TValue = unknown> = (args: TableColumnRendererArgs<TType, TValue>) => JSX.Element | string | number | unknown | null;
3222
3222
 
3223
- export declare type TableColumnRendererAggregate<TType, TValue> = (value: TValue, row: TType) => JSX.Element | string | number | null;
3223
+ export declare type TableColumnRendererAggregate<TType, TValue = unknown> = (args: TableColumnRendererArgs<TType, TValue>) => JSX.Element | string | number | unknown | null;
3224
3224
 
3225
3225
  export declare type TableColumnRendererArgs<TType, TValue> = {
3226
3226
  formattedValue: string;
@@ -3228,7 +3228,7 @@ export declare type TableColumnRendererArgs<TType, TValue> = {
3228
3228
  value: TValue;
3229
3229
  };
3230
3230
 
3231
- export declare type TableColumnRendererControl<TType = unknown> = ((props: TableColumnRendererControlProps, row?: TType, filterState?: TableFilter[]) => JSX.Element) | 'datepicker' | 'input' | 'switch' | 'checkbox' | 'textarea';
3231
+ export declare type TableColumnRendererControl<TType = unknown> = ((props: TableColumnRendererControlProps, row?: TType, filterState?: TableFilter[]) => JSX.Element | null) | 'datepicker' | 'input' | 'switch' | 'checkbox' | 'textarea';
3232
3232
 
3233
3233
  export declare type TableColumnRendererControlProps = {
3234
3234
  className?: string;
package/dist/taco.js CHANGED
@@ -33315,6 +33315,7 @@ function resetHighlightedColumnIndexes(searchQuery, table, localization) {
33315
33315
  columns.forEach((column, columnIndex) => {
33316
33316
  var _a, _b;
33317
33317
  try {
33318
+ const key = column.columnDef.accessorKey;
33318
33319
  let allowSearch = true;
33319
33320
  if (rowGrouping == null ? void 0 : rowGrouping.length) {
33320
33321
  if (row.getIsGrouped()) {
@@ -33324,7 +33325,7 @@ function resetHighlightedColumnIndexes(searchQuery, table, localization) {
33324
33325
  }
33325
33326
  }
33326
33327
  if (column.getIsVisible() && column.columnDef.enableGlobalFilter && allowSearch) {
33327
- const cellValue = get(row.original, column.id);
33328
+ const cellValue = get(row.original, key);
33328
33329
  const dataType = (_a = column.columnDef.meta) == null ? void 0 : _a.dataType;
33329
33330
  const dataTypeOptions = (_b = column.columnDef.meta) == null ? void 0 : _b.dataTypeOptions;
33330
33331
  if (isMatched(searchQuery, cellValue, row.original, dataType, dataTypeOptions, localization)) {
@@ -33494,8 +33495,8 @@ function processChildren(child, columns, defaultSizing, defaultSorting, defaultV
33494
33495
  );
33495
33496
  } else if (React__default.isValidElement(child) && (child.props.accessor || child.props.id)) {
33496
33497
  const {
33497
- id: untypedId,
33498
- accessor: accessorKey = untypedId,
33498
+ accessor,
33499
+ id: id2 = accessor,
33499
33500
  // renderers
33500
33501
  renderer: renderer2,
33501
33502
  aggregate,
@@ -33520,7 +33521,6 @@ function processChildren(child, columns, defaultSizing, defaultSorting, defaultV
33520
33521
  sortFn,
33521
33522
  ...meta
33522
33523
  } = child.props;
33523
- const id2 = untypedId ?? accessorKey;
33524
33524
  const dataTypeProperties = getDataTypeProperties(child.props.dataType);
33525
33525
  if (defaultHidden && enableHiding) {
33526
33526
  defaultVisibility[id2] = false;
@@ -33537,10 +33537,10 @@ function processChildren(child, columns, defaultSizing, defaultSorting, defaultV
33537
33537
  }
33538
33538
  const column = {
33539
33539
  id: id2,
33540
- accessorKey,
33540
+ accessorKey: accessor,
33541
33541
  // To avoid errors caused by undefined row data values, we pass accessorFn as a preventive measure
33542
- // accessorKey can be dot notated strings, so we use lodash.get to access deeply nested children
33543
- accessorFn: (row) => get(row, accessorKey),
33542
+ // accessor can be dot notated strings, so we use lodash.get to access deeply nested children
33543
+ accessorFn: accessor ? (row) => get(row, accessor) : void 0,
33544
33544
  // The header can be either a string or a JSX.Element, but react-table expects it to be a string or a
33545
33545
  // renderer function, so `() => header` ensures compatibility when header is a JSX.Element.
33546
33546
  // If we just pass `() => header`, then we will loose truncation for string headers.
@@ -33597,7 +33597,7 @@ function processChildren(child, columns, defaultSizing, defaultSorting, defaultV
33597
33597
  if (enableGrouping) {
33598
33598
  column.aggregationFn = aggregationFn;
33599
33599
  if (typeof aggregate === "function") {
33600
- column.aggregatedCell = (info) => aggregate(info.getValue(), info.row.original);
33600
+ column.aggregatedCell = (info) => aggregate(rendererArgs(info));
33601
33601
  }
33602
33602
  }
33603
33603
  if (enableSorting) {