@apia/table 4.0.25 → 4.0.27

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
@@ -255,6 +255,7 @@ type TResponsiveTableStoreProps = {
255
255
  * definida de estados con este parámetro.
256
256
  */
257
257
  reserveColumnsForStates?: number;
258
+ statesColumns?: TResponsiveTableRowState[];
258
259
  };
259
260
  type TResponsiveTableRowsSelectionEvent = {
260
261
  index: number;
@@ -519,7 +520,7 @@ interface ISelectableState<ColumnType extends IBasicColumn = IBasicColumn, Filte
519
520
  * automáticamente por el keyHandler.
520
521
  */
521
522
  selectedRows: number[];
522
- statesColumns: number;
523
+ statesColumns: TResponsiveTableContextProps['statesColumns'];
523
524
  }
524
525
  type TKeyHandlerProps = BoxProps & {
525
526
  /**
@@ -588,9 +589,14 @@ interface IPagination {
588
589
  }
589
590
  declare const Pagination: React__default.MemoExoticComponent<({ appliedFilters, areAllFiltersApplied, className, currentPage, disabled, disableReduced, hasMore, hideInfo, hideMaximizeButton, hideRefreshButton, isLoading, isPerforming, listId: outerListId, onDeleteFilters, onPageChange, onRefresh, pageCount, recordsCount: outerRecordsCount, reachedMax, showMaximizeOnSmallBreakpoints, variant, }: IPagination) => React__default.JSX.Element>;
590
591
 
592
+ declare const Grouped: React__default.MemoExoticComponent<({ group, tableName, }: {
593
+ group: string;
594
+ tableName?: string;
595
+ }) => React__default.JSX.Element>;
596
+
591
597
  declare function getResponsiveTableContext(tableName: string): TResponsiveTableContext;
592
598
  declare function useResponsiveTableContext(tableName?: string): TResponsiveTableContext;
593
- declare const ResponsiveTableContext: React__default.MemoExoticComponent<({ allowEdition, allowRowsKeyboardSorting, avoidAutoEllipsis, allowSelection, allowSorting, avoidReparseSelectionOnRowChange, children, className, currentBreakPoint, customLabels, columns, filters, FiltersRenderer, rows, label, isMultiple, name, onChangeSelection, onFilterBlur, onFilterChange, onFilterPressEnter, onRowClick, onSelectRows, onSortChange, reserveColumnsForStates, SelectionHandler, variant, }: TResponsiveTableContextProps) => React__default.JSX.Element>;
599
+ declare const ResponsiveTableContext: React__default.MemoExoticComponent<({ allowEdition, allowRowsKeyboardSorting, avoidAutoEllipsis, allowSelection, allowSorting, avoidReparseSelectionOnRowChange, children, className, currentBreakPoint, customLabels, columns, filters, FiltersRenderer, rows, label, isMultiple, isLoading, name, statesColumns, onChangeSelection, onFilterBlur, onFilterChange, onFilterPressEnter, onRowClick, onSelectRows, onSortChange, reserveColumnsForStates, SelectionHandler, variant, }: TResponsiveTableContextProps) => React__default.JSX.Element>;
594
600
 
595
601
  type TPayloadWithId$1<P = Record<string, unknown>, T extends string = string, M = never, E = never> = PayloadAction$1<P & {
596
602
  id: string;
@@ -671,6 +677,7 @@ declare class Controller2 {
671
677
  allowSorting?: boolean | undefined;
672
678
  isMultiple?: boolean;
673
679
  reserveColumnsForStates?: number | undefined;
680
+ statesColumns: TResponsiveTableContextProps["statesColumns"];
674
681
  allowEdition?: boolean;
675
682
  allowRowsKeyboardSorting?: boolean;
676
683
  allowSelection?: boolean;
@@ -687,7 +694,6 @@ declare class Controller2 {
687
694
  rows: TResponsiveTableRow<any>[];
688
695
  scrollIntoViewRow?: number;
689
696
  selectedRows: number[];
690
- statesColumns: number;
691
697
  accordionIndexColumns: TResponsiveTableIndexColumns;
692
698
  isLoading: boolean;
693
699
  };
@@ -798,5 +804,5 @@ declare const TableRenderer: React__default.MemoExoticComponent<({ variant }: {
798
804
  variant?: string;
799
805
  }) => React__default.JSX.Element>;
800
806
 
801
- export { AccordionCell, AccordionDocNameCellRenderer, AccordionElement, AccordionHTMLCellRenderer, AccordionRenderer, Additional, AdditionalColumnDefaultRenderer, Controller2, DefaultCellRenderer, DefaultRowRenderer, DocNameCellRenderer, HTMLCellRenderer, type IAccordionElement, IsLoadingRenderer, NoEllipsisCellRenderer, NoRegistersRenderer, Pagination, PriorityAccordionRenderer, PriorityRenderer, RangeFilter, Responsive, ResponsiveTable, ResponsiveTableContext, RowStatesRenderer, Sort, StatusAccordionRenderer, StatusRenderer, type TAccordionCellRenderer, type TAccordionCellRendererProps, type TColoredElement, type TDocNameCellRenderer, type TDocNameCellRendererProps, type TResponsiveTableCell, type TResponsiveTableCellRenderer, type TResponsiveTableCellRendererProps, type TResponsiveTableColumn, type TResponsiveTableContext, type TResponsiveTableContextProps, type TResponsiveTableRow, type TResponsiveTableRowRenderer, type TResponsiveTableRowRendererProps, type TResponsiveTableRowState, type TResponsiveTableRowsSelectionEvent, type TResponsiveTableSortChangeEvent, type TResponsiveTableSortValue, type TResponsiveTableStoreProps, type TResponsiveTableWithRendererElement, TableContextReproducer, TableLoadingContext, TableRenderer, defaultLabels, getPriorityHandler, getResponsiveTableContext, getStatusRendererClassName, makeAccordionAsyncRenderer, makeAsyncRenderer, makeController2, responsiveTableActions, responsiveTableStore, useResponsiveTable, useResponsiveTableContext };
807
+ export { AccordionCell, AccordionDocNameCellRenderer, AccordionElement, AccordionHTMLCellRenderer, AccordionRenderer, Additional, AdditionalColumnDefaultRenderer, Controller2, DefaultCellRenderer, DefaultRowRenderer, DocNameCellRenderer, Grouped, HTMLCellRenderer, type IAccordionElement, IsLoadingRenderer, NoEllipsisCellRenderer, NoRegistersRenderer, Pagination, PriorityAccordionRenderer, PriorityRenderer, RangeFilter, Responsive, ResponsiveTable, ResponsiveTableContext, RowStatesRenderer, Sort, StatusAccordionRenderer, StatusRenderer, type TAccordionCellRenderer, type TAccordionCellRendererProps, type TColoredElement, type TDocNameCellRenderer, type TDocNameCellRendererProps, type TResponsiveTableCell, type TResponsiveTableCellRenderer, type TResponsiveTableCellRendererProps, type TResponsiveTableColumn, type TResponsiveTableContext, type TResponsiveTableContextProps, type TResponsiveTableRow, type TResponsiveTableRowRenderer, type TResponsiveTableRowRendererProps, type TResponsiveTableRowState, type TResponsiveTableRowsSelectionEvent, type TResponsiveTableSortChangeEvent, type TResponsiveTableSortValue, type TResponsiveTableStoreProps, type TResponsiveTableWithRendererElement, TableContextReproducer, TableLoadingContext, TableRenderer, defaultLabels, getPriorityHandler, getResponsiveTableContext, getStatusRendererClassName, makeAccordionAsyncRenderer, makeAsyncRenderer, makeController2, responsiveTableActions, responsiveTableStore, useResponsiveTable, useResponsiveTableContext };
802
808
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -32,8 +32,8 @@ function getInitialState$1() {
32
32
  isMultiple: true,
33
33
  nonAdditionalColumnsCount: 0,
34
34
  rows: [],
35
- selectedRows: [],
36
- statesColumns: 0
35
+ statesColumns: [],
36
+ selectedRows: []
37
37
  };
38
38
  }
39
39
 
@@ -353,14 +353,6 @@ const responsiveTableSlice = createSlice({
353
353
  (current) => !current.showAsAdditional
354
354
  ).length;
355
355
  }
356
- if (rest.rows) {
357
- state[tableName].statesColumns = Math.max(
358
- state[tableName]?.reserveColumnsForStates ?? 0,
359
- ...state[tableName]?.rows?.map(
360
- (current) => current.states?.length ?? 0
361
- ) ?? [0]
362
- );
363
- }
364
356
  if (rest.filters) {
365
357
  state[tableName].hasNonAdditionalFilters = rest.filters.filter(
366
358
  (current) => !current.asAdditional && (rest.columns ?? state[tableName].columns)?.find(
@@ -470,7 +462,9 @@ const NoMemoResponsiveTableContext = ({
470
462
  rows,
471
463
  label,
472
464
  isMultiple,
465
+ isLoading,
473
466
  name,
467
+ statesColumns,
474
468
  onChangeSelection,
475
469
  onFilterBlur,
476
470
  onFilterChange,
@@ -505,7 +499,9 @@ const NoMemoResponsiveTableContext = ({
505
499
  onRowClick,
506
500
  onSelectRows,
507
501
  onSortChange,
508
- SelectionHandler
502
+ SelectionHandler,
503
+ statesColumns,
504
+ isLoading
509
505
  }),
510
506
  [
511
507
  currentBreakPoint,
@@ -521,7 +517,9 @@ const NoMemoResponsiveTableContext = ({
521
517
  onRowClick,
522
518
  onSelectRows,
523
519
  onSortChange,
524
- SelectionHandler
520
+ SelectionHandler,
521
+ statesColumns,
522
+ isLoading
525
523
  ]
526
524
  );
527
525
  tableContexts[actualName] = contextValue;
@@ -538,7 +536,9 @@ const NoMemoResponsiveTableContext = ({
538
536
  isMultiple,
539
537
  tableName: actualName,
540
538
  reserveColumnsForStates,
541
- handleFocus: !SelectionHandler
539
+ handleFocus: !SelectionHandler,
540
+ statesColumns,
541
+ isLoading
542
542
  })
543
543
  );
544
544
  });
@@ -578,6 +578,22 @@ const NoMemoResponsiveTableContext = ({
578
578
  })
579
579
  );
580
580
  }, [filters]);
581
+ useUpdateEffect(() => {
582
+ responsiveTableStore.dispatch(
583
+ responsiveTableActions.update({
584
+ tableName: actualName,
585
+ statesColumns
586
+ })
587
+ );
588
+ }, [statesColumns]);
589
+ useUpdateEffect(() => {
590
+ responsiveTableStore.dispatch(
591
+ responsiveTableActions.update({
592
+ tableName: actualName,
593
+ isLoading
594
+ })
595
+ );
596
+ }, [isLoading]);
581
597
  useUnmount(() => {
582
598
  responsiveTableStore.dispatch(
583
599
  responsiveTableActions.destroy({ tableName: actualName })
@@ -949,7 +965,7 @@ function getDomStoreProps(element, elementProps, stateSelector) {
949
965
  const tableState = stateSelector(globalState);
950
966
  const hasNonAdditionalFilters = tableState?.hasNonAdditionalFilters;
951
967
  const startDataRowIndex = hasNonAdditionalFilters ? 2 : 1;
952
- const statesColumns = tableState?.statesColumns ?? 0;
968
+ const statesColumns = tableState?.statesColumns?.length ?? 0;
953
969
  let expandedBeforeThisRow = 0;
954
970
  if (element === "tr")
955
971
  expandedBeforeThisRow = tableState?.expandedRows.filter(
@@ -1023,7 +1039,7 @@ function getDomProps(state, element, elementProps) {
1023
1039
  case "filterTd": {
1024
1040
  const castedProps = elementProps;
1025
1041
  returnObject = {
1026
- "aria-colindex": castedProps.columnIndex + 1 + state.statesColumns + (state.hasNonAdditionalFilters ? 1 : 0),
1042
+ "aria-colindex": castedProps.columnIndex + 1 + (state.statesColumns?.length || 0) + (state.hasNonAdditionalFilters ? 1 : 0),
1027
1043
  "data-editionmode": state.isEditionMode && state.isFocused,
1028
1044
  "data-focused": state.isFocused,
1029
1045
  tabIndex: state.isFocused ? 0 : -1,
@@ -1077,7 +1093,7 @@ function getDomProps(state, element, elementProps) {
1077
1093
  case "td": {
1078
1094
  const castedProps = elementProps;
1079
1095
  returnObject = {
1080
- "aria-colindex": castedProps.columnIndex + 1 + state.statesColumns + (state.hasNonAdditionalFilters ? 1 : 0),
1096
+ "aria-colindex": castedProps.columnIndex + 1 + (state.statesColumns?.length ?? 0) + (state.hasNonAdditionalFilters ? 1 : 0),
1081
1097
  "data-editionmode": state.isEditionMode && state.isFocused,
1082
1098
  "data-focused": state.isFocused,
1083
1099
  tabIndex: state.isFocused ? 0 : -1,
@@ -1121,7 +1137,7 @@ function getDomProps(state, element, elementProps) {
1121
1137
  case "th": {
1122
1138
  const castedProps = elementProps;
1123
1139
  returnObject = {
1124
- "aria-colindex": castedProps.columnIndex + 1 + state.statesColumns + (state.hasNonAdditionalFilters ? 1 : 0),
1140
+ "aria-colindex": castedProps.columnIndex + 1 + (state.statesColumns?.length ?? 0) + (state.hasNonAdditionalFilters ? 1 : 0),
1125
1141
  "aria-sort": ["ascending", "descending", void 0][["Asc", "Desc", null].findIndex(
1126
1142
  (current) => current === state.columns[castedProps.columnIndex].currentSorting
1127
1143
  )],
@@ -1190,7 +1206,7 @@ const NoMemoHeaderCell = ({
1190
1206
  const column = columns[columnIndex];
1191
1207
  const additionalInfoColumns = columns.filter((c) => c.showAsAdditional);
1192
1208
  const storedWidth = persistentStorage[widthStorageName]?.[actualName]?.[column.name];
1193
- const [width, setWidth] = React.useState(storedWidth ?? 200);
1209
+ const [width, setWidth] = React.useState(storedWidth ?? column.width ?? 200);
1194
1210
  const [isResize, setIsResize] = React.useState(storedWidth !== void 0);
1195
1211
  React.useEffect(() => {
1196
1212
  return void thWidthEmitter.on("resize", (ev) => {
@@ -1211,6 +1227,10 @@ const NoMemoHeaderCell = ({
1211
1227
  const tableState = global.responsiveTableSlice[name];
1212
1228
  return tableState?.allowSorting;
1213
1229
  });
1230
+ const isLoading = useResponsiveTable((global) => {
1231
+ const tableState = global.responsiveTableSlice[name];
1232
+ return tableState?.isLoading;
1233
+ });
1214
1234
  const domProps = useDomProps(
1215
1235
  "th",
1216
1236
  {
@@ -1220,22 +1240,33 @@ const NoMemoHeaderCell = ({
1220
1240
  );
1221
1241
  const sx = React.useMemo(
1222
1242
  () => !isResize ? {
1223
- minWidth: getColumnWidth(column.minWidth ?? column.width),
1243
+ minWidth: columnIndex === columns.length - 1 ? "100%" : getColumnWidth(column.minWidth ?? column.width),
1224
1244
  maxWidth: column.maxWidth !== void 0 ? getColumnWidth(column.maxWidth) : void 0,
1225
- width: getColumnWidth(column.width),
1245
+ width: columnIndex === columns.length - 1 ? "100%" : getColumnWidth(column.width),
1226
1246
  position: "relative"
1227
1247
  } : {
1228
1248
  width: `${width}px`,
1229
- minWidth: `${width}px`,
1249
+ minWidth: columnIndex === columns.length - 1 ? "100%" : `${width}px`,
1230
1250
  position: "relative"
1231
1251
  },
1232
- [column.maxWidth, column.minWidth, column.width, isResize, width]
1252
+ [
1253
+ column.maxWidth,
1254
+ column.minWidth,
1255
+ column.width,
1256
+ columnIndex,
1257
+ columns.length,
1258
+ isResize,
1259
+ width
1260
+ ]
1233
1261
  );
1262
+ const lastIsLoading = useLatest(isLoading);
1234
1263
  const buttonProps = useOtherTagButton(
1235
1264
  React.useMemo(
1236
1265
  () => ({
1237
1266
  className: "headButton",
1238
1267
  onClick: (ev) => {
1268
+ if (lastIsLoading.current)
1269
+ return;
1239
1270
  if (isChild(
1240
1271
  ev.target,
1241
1272
  (current) => current.classList.contains("headButton__resizer")
@@ -1250,14 +1281,14 @@ const NoMemoHeaderCell = ({
1250
1281
  });
1251
1282
  }
1252
1283
  }),
1253
- [apiaColumnIndex, column, isSortingAllowed, onSortChange]
1284
+ [apiaColumnIndex, column, isSortingAllowed, lastIsLoading, onSortChange]
1254
1285
  )
1255
1286
  );
1256
1287
  return /* @__PURE__ */ jsx(
1257
1288
  Box,
1258
1289
  {
1259
1290
  as: "th",
1260
- style: sx,
1291
+ ...{ sx },
1261
1292
  "data-columnname": column.name,
1262
1293
  title: column.title ?? column.label ?? column.name,
1263
1294
  ...buttonProps,
@@ -1424,7 +1455,7 @@ const StateCell = ({ index, rowIndex, state, isHeader }) => {
1424
1455
  { columnIndex: index, rowIndex },
1425
1456
  domPropsSelector(name)
1426
1457
  );
1427
- return /* @__PURE__ */ jsx(Box, { as: "td", className: "stateCell", ...domProps, children: state ? /* @__PURE__ */ jsx(RowStatesRenderer, { state }) : "" });
1458
+ return /* @__PURE__ */ jsx(Box, { as: "td", className: "stateCell", ...domProps, children: state?.Icon ? /* @__PURE__ */ jsx(RowStatesRenderer, { state }) : "" });
1428
1459
  };
1429
1460
 
1430
1461
  const units = ["B", "KB", "MB", "GB"];
@@ -1629,6 +1660,25 @@ const NoMemoHeader = () => {
1629
1660
  const focusedRow = useResponsiveTable(
1630
1661
  (global) => global.responsiveTableSlice[name]?.focusedRow
1631
1662
  );
1663
+ const statesColumns = useResponsiveTable((global) => {
1664
+ const state = global.responsiveTableSlice[name];
1665
+ return Array(
1666
+ Math.max(
1667
+ 0,
1668
+ state?.reserveColumnsForStates || 0,
1669
+ state?.statesColumns?.length || 0
1670
+ )
1671
+ ).fill(1).map((_, index) => {
1672
+ const r = {
1673
+ Icon: "",
1674
+ iconColor: "transparent",
1675
+ id: String(index),
1676
+ tooltip: "",
1677
+ ...state.statesColumns?.[index]
1678
+ };
1679
+ return r;
1680
+ });
1681
+ });
1632
1682
  const filters = useResponsiveTable(
1633
1683
  (global) => {
1634
1684
  const tableState = global.responsiveTableSlice[name];
@@ -1646,10 +1696,6 @@ const NoMemoHeader = () => {
1646
1696
  }, true);
1647
1697
  }
1648
1698
  );
1649
- const statesCount = useResponsiveTable((globalState) => {
1650
- const state = globalState.responsiveTableSlice[name];
1651
- return state?.statesColumns ?? 0;
1652
- }, shallowEqual$1);
1653
1699
  const additionalColumns = React.useMemo(
1654
1700
  () => columns?.reduce(
1655
1701
  (count, column) => count + (column.showAsAdditional ? 1 : 0),
@@ -1657,9 +1703,6 @@ const NoMemoHeader = () => {
1657
1703
  ),
1658
1704
  [columns]
1659
1705
  );
1660
- const statesIds = React.useMemo(() => {
1661
- return Array(statesCount).fill("").map(() => uniqueId());
1662
- }, [statesCount]);
1663
1706
  const [isFiltersRowVisible, setIsFiltersRowVisible] = React.useState(
1664
1707
  /* (persistentStorage.showResponsiveTableFilters as boolean) ?? */
1665
1708
  false
@@ -1714,7 +1757,7 @@ const NoMemoHeader = () => {
1714
1757
  ] })
1715
1758
  }
1716
1759
  ),
1717
- statesIds.map((id, i) => /* @__PURE__ */ jsx(StateCell, { isHeader: true, index: i, rowIndex: 1 }, id)),
1760
+ statesColumns.map(({ id, ...state }, i) => /* @__PURE__ */ jsx(StateCell, { isHeader: true, index: i, rowIndex: 1, state }, id)),
1718
1761
  columns?.map((current, actualColumnIndex) => ({
1719
1762
  ...current,
1720
1763
  actualTableColumnIndex: actualColumnIndex
@@ -1752,7 +1795,7 @@ const NoMemoHeader = () => {
1752
1795
  children: "\xA0"
1753
1796
  }
1754
1797
  ),
1755
- statesIds.map((id, i) => /* @__PURE__ */ jsx(StateCell, { isHeader: true, index: i, rowIndex: 2 }, id)),
1798
+ statesColumns.map(({ id }, i) => /* @__PURE__ */ jsx(StateCell, { isHeader: true, index: i, rowIndex: 2 }, id)),
1756
1799
  columns?.filter((current) => !current.showAsAdditional && !current.hidden).map((current, columnIndex) => {
1757
1800
  const filter = filters.find(
1758
1801
  (search) => search.definition.column === current.name
@@ -2024,7 +2067,11 @@ const NoMemoRow = ({ rowIndex }) => {
2024
2067
  );
2025
2068
  const statesCount = useResponsiveTable((globalState) => {
2026
2069
  const state = globalState.responsiveTableSlice[name];
2027
- return state?.statesColumns ?? 0;
2070
+ return Math.max(
2071
+ state?.reserveColumnsForStates || 0,
2072
+ state?.statesColumns?.length ?? 0,
2073
+ 0
2074
+ );
2028
2075
  }, shallowEqual);
2029
2076
  const states = React.useMemo(
2030
2077
  () => (row.states ?? []).map((current) => ({ ...current, id: uniqueId() })),
@@ -2173,7 +2220,7 @@ const NoMemoTableRenderer = ({ variant }) => {
2173
2220
  return tableState?.rows?.map((current) => current.id);
2174
2221
  }, shallowEqual);
2175
2222
  const columnsCount = useResponsiveTable(
2176
- (global) => (global.responsiveTableSlice[name]?.nonAdditionalColumnsCount ?? 0) + (global.responsiveTableSlice[name]?.hasNonAdditionalFilters ? 1 : 0) + (global.responsiveTableSlice[name]?.statesColumns ?? 0) + (global.responsiveTableSlice[name]?.columns.find(
2223
+ (global) => (global.responsiveTableSlice[name]?.nonAdditionalColumnsCount ?? 0) + (global.responsiveTableSlice[name]?.hasNonAdditionalFilters ? 1 : 0) + (global.responsiveTableSlice[name]?.statesColumns?.length ?? 0) + (global.responsiveTableSlice[name]?.columns.find(
2177
2224
  (current) => current.showAsAdditional
2178
2225
  ) ? 1 : 0)
2179
2226
  );
@@ -2487,7 +2534,7 @@ const NoMemoInnerRender = React.forwardRef(
2487
2534
  title: isDate ? window.LBL_DATE_FILTER_FROM_TOOLTIP : filterTitle,
2488
2535
  children: [
2489
2536
  window.SHOW_REQUIRED_POSITION !== "0" && /* @__PURE__ */ jsx(RequiredMark, { isRequired: filter.required }),
2490
- /* @__PURE__ */ jsx(Box, { as: "span", children: isDate && !filter.hideToFilter ? formatMessage(window.LBL_DATE_FILTER_FROM_TXT, {
2537
+ !filter?.avoidLabel && /* @__PURE__ */ jsx(Box, { as: "span", children: isDate && !filter.hideToFilter ? formatMessage(window.LBL_DATE_FILTER_FROM_TXT, {
2491
2538
  TOK1: filterTitle
2492
2539
  }) : filterTitle }),
2493
2540
  Renderer ? /* @__PURE__ */ jsx(Renderer, { filter }) : filter.isRange ? /* @__PURE__ */ jsx(RangeFilter, { filter }) : /* @__PURE__ */ jsx(
@@ -2531,7 +2578,7 @@ const NoMemoInnerRender = React.forwardRef(
2531
2578
  {
2532
2579
  className: filter.type === "D" || filter.type === "date" ? "twoColumns" : "",
2533
2580
  children: /* @__PURE__ */ jsxs(Label, { title: window.LBL_DATE_FILTER_TO_TOOLTIP, children: [
2534
- /* @__PURE__ */ jsx(Box, { as: "span", children: formatMessage(window.LBL_DATE_FILTER_TO_TXT, {
2581
+ !filter?.avoidLabel && /* @__PURE__ */ jsx(Box, { as: "span", children: formatMessage(window.LBL_DATE_FILTER_TO_TXT, {
2535
2582
  TOK1: filterTitle
2536
2583
  }) }),
2537
2584
  /* @__PURE__ */ jsx(
@@ -3007,62 +3054,18 @@ const NoMemoPagination = ({
3007
3054
  };
3008
3055
  const Pagination = React.memo(NoMemoPagination);
3009
3056
 
3010
- function applyFocusAttributes(table, _previousState, state, focus = state.isFocused, target) {
3011
- table.querySelectorAll(getFocusSelector()).forEach((e) => {
3012
- e.tabIndex = -1;
3013
- });
3014
- if (state.focusedColumn === 0) {
3015
- const focusedRow = table.querySelector(
3016
- `tr[data-rowindex="${state.focusedRow}"]`
3017
- );
3018
- if (focusedRow) {
3019
- focusedRow.tabIndex = 0;
3020
- window.requestAnimationFrame(() => {
3021
- if (focus) {
3022
- focusedRow.focus();
3023
- }
3024
- });
3025
- }
3026
- } else {
3027
- const focusedCell = table.querySelector(
3028
- `tr[data-rowindex="${state.focusedRow}"] td[aria-colindex="${state.focusedColumn}"], tr[data-rowindex="${state.focusedRow}"] th[aria-colindex="${state.focusedColumn}"]`
3029
- );
3030
- if (target) {
3031
- target.focus();
3032
- }
3033
- if (focusedCell instanceof HTMLElement) {
3034
- const widgets = [];
3035
- if (state.isEditionMode) {
3036
- widgets.push(
3037
- ...focusedCell.querySelectorAll(getFocusSelector())
3038
- );
3039
- } else {
3040
- const widget = focusedCell.querySelector(getFocusSelector());
3041
- if (widget) {
3042
- widgets.push(widget);
3043
- }
3044
- }
3045
- if (widgets.length) {
3046
- widgets.forEach((widget, i) => {
3047
- widget.tabIndex = 0;
3048
- if (i === 0)
3049
- window.requestAnimationFrame(() => {
3050
- if (!target && focus) {
3051
- widget.focus();
3052
- }
3053
- });
3054
- });
3055
- } else {
3056
- focusedCell.tabIndex = 0;
3057
- window.requestAnimationFrame(() => {
3058
- if (!target && focus) {
3059
- focusedCell.focus();
3060
- }
3061
- });
3062
- }
3063
- }
3064
- }
3065
- }
3057
+ const NoMemoGrouped = ({
3058
+ group,
3059
+ tableName
3060
+ }) => {
3061
+ const { name } = useResponsiveTableContext(tableName);
3062
+ const groupedFilters = useResponsiveTable((global) => {
3063
+ const state = global.responsiveTableSlice[name];
3064
+ return state?.filters.filter((current) => current.group === group);
3065
+ }, shallowEqual);
3066
+ return /* @__PURE__ */ jsx(InnerRender, { tableName, filters: groupedFilters });
3067
+ };
3068
+ const Grouped = React.memo(NoMemoGrouped);
3066
3069
 
3067
3070
  function setAriaAttributes(element, attribute, value) {
3068
3071
  element.setAttribute(attribute, value);
@@ -3150,18 +3153,11 @@ function handleMouseDownEvent(ev) {
3150
3153
  state.focusedRow = rowIndex;
3151
3154
  state.isFocused = true;
3152
3155
  applySelectionAttributes(table, this.getState(), state);
3153
- applyFocusAttributes(
3154
- table,
3155
- this.getState(),
3156
- state,
3157
- state.isFocused,
3158
- target
3159
- );
3160
3156
  this.setState(state);
3161
- this.events.onRowClick?.(
3157
+ this.events.emit("onRowClick", [
3162
3158
  { row: state.rows[state.focusedRow], index: state.focusedRow },
3163
3159
  state.focusedRow
3164
- );
3160
+ ]);
3165
3161
  } else {
3166
3162
  console.warn("Cannot parse rowIndex or colIndex");
3167
3163
  }
@@ -3171,6 +3167,61 @@ function handleMouseDownEvent(ev) {
3171
3167
  }
3172
3168
  }
3173
3169
 
3170
+ function applyFocusAttributes(table, _previousState, state, focus = state.isFocused, target) {
3171
+ focus = focus && table.contains(document.activeElement);
3172
+ table.querySelectorAll(getFocusSelector()).forEach((e) => {
3173
+ e.tabIndex = -1;
3174
+ });
3175
+ if (state.focusedColumn === 0) {
3176
+ const focusedRow = table.querySelector(
3177
+ `tr[data-rowindex="${state.focusedRow}"]`
3178
+ );
3179
+ if (focusedRow) {
3180
+ focusedRow.tabIndex = 0;
3181
+ window.requestAnimationFrame(() => {
3182
+ if (focus) {
3183
+ focusedRow.focus();
3184
+ }
3185
+ });
3186
+ }
3187
+ } else {
3188
+ const focusedCell = table.querySelector(
3189
+ `tr[data-rowindex="${state.focusedRow}"] td[aria-colindex="${state.focusedColumn}"], tr[data-rowindex="${state.focusedRow}"] th[aria-colindex="${state.focusedColumn}"]`
3190
+ );
3191
+ if (focusedCell instanceof HTMLElement) {
3192
+ const widgets = [];
3193
+ if (state.isEditionMode) {
3194
+ widgets.push(
3195
+ ...focusedCell.querySelectorAll(getFocusSelector())
3196
+ );
3197
+ } else {
3198
+ const widget = focusedCell.querySelector(getFocusSelector());
3199
+ if (widget) {
3200
+ widgets.push(widget);
3201
+ }
3202
+ }
3203
+ if (widgets.length) {
3204
+ widgets.forEach((widget, i) => {
3205
+ widget.tabIndex = 0;
3206
+ if (i === 0)
3207
+ window.requestAnimationFrame(() => {
3208
+ if (focus) {
3209
+ widget.focus();
3210
+ }
3211
+ });
3212
+ });
3213
+ } else {
3214
+ focusedCell.tabIndex = 0;
3215
+ window.requestAnimationFrame(() => {
3216
+ if (focus) {
3217
+ focusedCell.focus();
3218
+ }
3219
+ });
3220
+ }
3221
+ }
3222
+ }
3223
+ }
3224
+
3174
3225
  function handleKeyDownEvent(ev) {
3175
3226
  const target = ev.target;
3176
3227
  const state = this.getState();
@@ -3201,6 +3252,11 @@ function handleKeyDownEvent(ev) {
3201
3252
  "PageDown"
3202
3253
  ].includes(ev.code) || ev.code === "Space" && ev.ctrlKey) {
3203
3254
  ev.preventDefault();
3255
+ let mustFocus = false;
3256
+ const maxColumnIndex = state.columns.length + Math.max(
3257
+ state.reserveColumnsForStates ?? 0,
3258
+ state.statesColumns?.length ?? 0
3259
+ ) + (state.hasNonAdditionalFilters ? 1 : 0);
3204
3260
  switch (ev.code) {
3205
3261
  case "Space":
3206
3262
  if (state.selectedRows.includes(rowIndex)) {
@@ -3217,6 +3273,7 @@ function handleKeyDownEvent(ev) {
3217
3273
  state.hasNonAdditionalFilters ? -2 : -1,
3218
3274
  state.rows.length - 1
3219
3275
  );
3276
+ mustFocus = true;
3220
3277
  if (ev.ctrlKey) ; else if (ev.shiftKey && state.isMultiple !== false) {
3221
3278
  state.selectedRows = [
3222
3279
  ...state.selectedRows,
@@ -3232,6 +3289,7 @@ function handleKeyDownEvent(ev) {
3232
3289
  state.hasNonAdditionalFilters ? -2 : -1,
3233
3290
  state.rows.length - 1
3234
3291
  );
3292
+ mustFocus = true;
3235
3293
  if (ev.ctrlKey) ; else if (ev.shiftKey && state.isMultiple !== false) {
3236
3294
  state.selectedRows = [
3237
3295
  ...state.selectedRows,
@@ -3245,17 +3303,20 @@ function handleKeyDownEvent(ev) {
3245
3303
  state.focusedColumn = addBoundary(
3246
3304
  state.focusedColumn - 1,
3247
3305
  0,
3248
- state.columns.length
3306
+ maxColumnIndex
3249
3307
  );
3308
+ mustFocus = true;
3250
3309
  break;
3251
3310
  case "ArrowRight":
3252
3311
  state.focusedColumn = addBoundary(
3253
3312
  state.focusedColumn + 1,
3254
3313
  0,
3255
- state.columns.length + (state.hasNonAdditionalFilters ? 1 : 0)
3314
+ maxColumnIndex
3256
3315
  );
3316
+ mustFocus = true;
3257
3317
  break;
3258
3318
  case "Home":
3319
+ mustFocus = true;
3259
3320
  if (state.focusedColumn === 0) {
3260
3321
  state.focusedRow = state.hasNonAdditionalFilters ? -2 : -1;
3261
3322
  if (ev.ctrlKey) ; else if (ev.shiftKey && state.isMultiple !== false) {
@@ -3278,6 +3339,7 @@ function handleKeyDownEvent(ev) {
3278
3339
  }
3279
3340
  break;
3280
3341
  case "End":
3342
+ mustFocus = true;
3281
3343
  if (state.focusedColumn === 0) {
3282
3344
  state.focusedRow = state.rows.length - 1;
3283
3345
  if (ev.ctrlKey) ; else if (ev.shiftKey && state.isMultiple !== false) {
@@ -3296,10 +3358,11 @@ function handleKeyDownEvent(ev) {
3296
3358
  state.selectedRows = [state.focusedRow];
3297
3359
  }
3298
3360
  } else {
3299
- state.focusedColumn = state.columns.length;
3361
+ state.focusedColumn = maxColumnIndex;
3300
3362
  }
3301
3363
  break;
3302
3364
  case "PageUp":
3365
+ mustFocus = true;
3303
3366
  state.focusedRow = addBoundary(
3304
3367
  state.focusedRow - 6,
3305
3368
  state.hasNonAdditionalFilters ? -2 : -1,
@@ -3318,6 +3381,7 @@ function handleKeyDownEvent(ev) {
3318
3381
  }
3319
3382
  break;
3320
3383
  case "PageDown":
3384
+ mustFocus = true;
3321
3385
  state.focusedRow = addBoundary(
3322
3386
  state.focusedRow + 6,
3323
3387
  state.hasNonAdditionalFilters ? -2 : -1,
@@ -3336,24 +3400,24 @@ function handleKeyDownEvent(ev) {
3336
3400
  }
3337
3401
  break;
3338
3402
  case "Enter": {
3403
+ mustFocus = true;
3339
3404
  state.isEditionMode = true;
3340
3405
  this.setState(state);
3341
- applyFocusAttributes(table, this.getState(), state);
3342
3406
  if (state.focusedRow >= 0) {
3343
- this.events.onSelectRows?.(
3407
+ this.events.emit("onSelectRows", [
3344
3408
  this.getSelection().map((index) => ({
3345
3409
  index,
3346
3410
  row: this.getState().rows[index]
3347
3411
  })),
3348
3412
  state.focusedRow
3349
- );
3413
+ ]);
3350
3414
  }
3351
3415
  return;
3352
3416
  }
3353
3417
  }
3354
3418
  state.isFocused = true;
3355
3419
  applySelectionAttributes(table, this.getState(), state);
3356
- applyFocusAttributes(table, this.getState(), state);
3420
+ applyFocusAttributes(table, this.getState(), state, mustFocus);
3357
3421
  this.setState(state);
3358
3422
  }
3359
3423
  }
@@ -3911,5 +3975,5 @@ const NoMemoStatusAccordionRenderer = React.forwardRef(({ cell, column }, curren
3911
3975
  NoMemoStatusAccordionRenderer.displayName = "StatusAccordionRenderer";
3912
3976
  const StatusAccordionRenderer = NoMemoStatusAccordionRenderer;
3913
3977
 
3914
- export { AccordionCell, AccordionDocNameCellRenderer, AccordionElement, AccordionHTMLCellRenderer, AccordionRenderer, Additional, AdditionalColumnDefaultRenderer, Controller2, DefaultCellRenderer, DefaultRowRenderer, DocNameCellRenderer, HTMLCellRenderer, IsLoadingRenderer, NoEllipsisCellRenderer, NoRegistersRenderer, Pagination, PriorityAccordionRenderer, PriorityRenderer, RangeFilter, Responsive, ResponsiveTable, ResponsiveTableContext, RowStatesRenderer, Sort, StatusAccordionRenderer, StatusRenderer, TableContextReproducer, TableLoadingContext, TableRenderer, defaultLabels, getPriorityHandler, getResponsiveTableContext, getStatusRendererClassName, makeAccordionAsyncRenderer, makeAsyncRenderer, makeController2, responsiveTableActions, responsiveTableStore, useResponsiveTable, useResponsiveTableContext };
3978
+ export { AccordionCell, AccordionDocNameCellRenderer, AccordionElement, AccordionHTMLCellRenderer, AccordionRenderer, Additional, AdditionalColumnDefaultRenderer, Controller2, DefaultCellRenderer, DefaultRowRenderer, DocNameCellRenderer, Grouped, HTMLCellRenderer, IsLoadingRenderer, NoEllipsisCellRenderer, NoRegistersRenderer, Pagination, PriorityAccordionRenderer, PriorityRenderer, RangeFilter, Responsive, ResponsiveTable, ResponsiveTableContext, RowStatesRenderer, Sort, StatusAccordionRenderer, StatusRenderer, TableContextReproducer, TableLoadingContext, TableRenderer, defaultLabels, getPriorityHandler, getResponsiveTableContext, getStatusRendererClassName, makeAccordionAsyncRenderer, makeAsyncRenderer, makeController2, responsiveTableActions, responsiveTableStore, useResponsiveTable, useResponsiveTableContext };
3915
3979
  //# sourceMappingURL=index.js.map