@xcelsior/ui-spreadsheets 1.1.16 → 1.1.18

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.mts CHANGED
@@ -293,6 +293,8 @@ interface SpreadsheetProps<T = any> {
293
293
  onSortChange?: (sortConfig: SpreadsheetSortConfig | null) => void;
294
294
  /** Callback when filters change */
295
295
  onFilterChange?: (filters: Record<string, SpreadsheetColumnFilter>) => void;
296
+ /** Callback with filtered data after filters are applied */
297
+ afterFiltered?: (filteredData: T[]) => void;
296
298
  /** Callback for row click */
297
299
  onRowClick?: (row: T, rowIndex: number) => void;
298
300
  /** Callback for row double click */
@@ -671,7 +673,7 @@ interface SpreadsheetColumnGroupHeaderProps {
671
673
  * />
672
674
  * ```
673
675
  */
674
- declare function Spreadsheet<T extends Record<string, any>>({ data, columns, columnGroups, getRowId, onCellsEdit, onSelectionChange, onSortChange, onFilterChange, onRowClick, onRowDoubleClick, onAddCellComment, onToggleCommentResolved, onRowHighlight, onColumnHighlight, onCellHighlight, showToolbar, showPagination, enableRowSelection, enableCellEditing, enableComments, enableHighlighting, enableUndoRedo, pageSizeOptions, onSave, settings: initialSettings, onSettingsChange, isLoading, className, emptyMessage, rowHighlights: externalRowHighlights, columnHighlights: externalColumnHighlights, cellHighlights: externalCellHighlights, cellComments: externalCellComments, rowActions, rowContextMenuItems, toolbarMenuItems, serverSide, totalItems, currentPage: controlledCurrentPage, pageSize: controlledPageSize, sortConfig: controlledSortConfig, onPageChange, filters: controlledFilters, }: SpreadsheetProps<T>): react_jsx_runtime.JSX.Element;
676
+ declare function Spreadsheet<T extends Record<string, any>>({ data, columns, columnGroups, getRowId, onCellsEdit, onSelectionChange, onSortChange, onFilterChange, afterFiltered, onRowClick, onRowDoubleClick, onAddCellComment, onToggleCommentResolved, onRowHighlight, onColumnHighlight, onCellHighlight, showToolbar, showPagination, enableRowSelection, enableCellEditing, enableComments, enableHighlighting, enableUndoRedo, pageSizeOptions, onSave, settings: initialSettings, onSettingsChange, isLoading, className, emptyMessage, rowHighlights: externalRowHighlights, columnHighlights: externalColumnHighlights, cellHighlights: externalCellHighlights, cellComments: externalCellComments, rowActions, rowContextMenuItems, toolbarMenuItems, serverSide, totalItems, currentPage: controlledCurrentPage, pageSize: controlledPageSize, sortConfig: controlledSortConfig, onPageChange, filters: controlledFilters, }: SpreadsheetProps<T>): react_jsx_runtime.JSX.Element;
675
677
  declare namespace Spreadsheet {
676
678
  var displayName: string;
677
679
  }
package/dist/index.d.ts CHANGED
@@ -293,6 +293,8 @@ interface SpreadsheetProps<T = any> {
293
293
  onSortChange?: (sortConfig: SpreadsheetSortConfig | null) => void;
294
294
  /** Callback when filters change */
295
295
  onFilterChange?: (filters: Record<string, SpreadsheetColumnFilter>) => void;
296
+ /** Callback with filtered data after filters are applied */
297
+ afterFiltered?: (filteredData: T[]) => void;
296
298
  /** Callback for row click */
297
299
  onRowClick?: (row: T, rowIndex: number) => void;
298
300
  /** Callback for row double click */
@@ -671,7 +673,7 @@ interface SpreadsheetColumnGroupHeaderProps {
671
673
  * />
672
674
  * ```
673
675
  */
674
- declare function Spreadsheet<T extends Record<string, any>>({ data, columns, columnGroups, getRowId, onCellsEdit, onSelectionChange, onSortChange, onFilterChange, onRowClick, onRowDoubleClick, onAddCellComment, onToggleCommentResolved, onRowHighlight, onColumnHighlight, onCellHighlight, showToolbar, showPagination, enableRowSelection, enableCellEditing, enableComments, enableHighlighting, enableUndoRedo, pageSizeOptions, onSave, settings: initialSettings, onSettingsChange, isLoading, className, emptyMessage, rowHighlights: externalRowHighlights, columnHighlights: externalColumnHighlights, cellHighlights: externalCellHighlights, cellComments: externalCellComments, rowActions, rowContextMenuItems, toolbarMenuItems, serverSide, totalItems, currentPage: controlledCurrentPage, pageSize: controlledPageSize, sortConfig: controlledSortConfig, onPageChange, filters: controlledFilters, }: SpreadsheetProps<T>): react_jsx_runtime.JSX.Element;
676
+ declare function Spreadsheet<T extends Record<string, any>>({ data, columns, columnGroups, getRowId, onCellsEdit, onSelectionChange, onSortChange, onFilterChange, afterFiltered, onRowClick, onRowDoubleClick, onAddCellComment, onToggleCommentResolved, onRowHighlight, onColumnHighlight, onCellHighlight, showToolbar, showPagination, enableRowSelection, enableCellEditing, enableComments, enableHighlighting, enableUndoRedo, pageSizeOptions, onSave, settings: initialSettings, onSettingsChange, isLoading, className, emptyMessage, rowHighlights: externalRowHighlights, columnHighlights: externalColumnHighlights, cellHighlights: externalCellHighlights, cellComments: externalCellComments, rowActions, rowContextMenuItems, toolbarMenuItems, serverSide, totalItems, currentPage: controlledCurrentPage, pageSize: controlledPageSize, sortConfig: controlledSortConfig, onPageChange, filters: controlledFilters, }: SpreadsheetProps<T>): react_jsx_runtime.JSX.Element;
675
677
  declare namespace Spreadsheet {
676
678
  var displayName: string;
677
679
  }
package/dist/index.js CHANGED
@@ -3668,6 +3668,7 @@ function Spreadsheet({
3668
3668
  onSelectionChange,
3669
3669
  onSortChange,
3670
3670
  onFilterChange,
3671
+ afterFiltered,
3671
3672
  onRowClick,
3672
3673
  onRowDoubleClick,
3673
3674
  onAddCellComment,
@@ -4047,6 +4048,11 @@ function Spreadsheet({
4047
4048
  setInternalCurrentPage(1);
4048
4049
  }
4049
4050
  }, [totalPages, currentPage, serverSide]);
4051
+ const afterFilteredRef = (0, import_react17.useRef)(afterFiltered);
4052
+ afterFilteredRef.current = afterFiltered;
4053
+ (0, import_react17.useEffect)(() => {
4054
+ afterFilteredRef.current?.(filteredData.toArray());
4055
+ }, [filteredData]);
4050
4056
  const handleRowSelect = (0, import_react17.useCallback)(
4051
4057
  (rowId, event) => {
4052
4058
  if (!enableRowSelection) return;
@@ -4410,7 +4416,10 @@ function Spreadsheet({
4410
4416
  {
4411
4417
  column,
4412
4418
  filter: filters[column.id],
4413
- onFilterChange: (filter) => handleFilterChangeWithReset(column.id, filter),
4419
+ onFilterChange: (filter) => handleFilterChangeWithReset(
4420
+ column.id,
4421
+ filter
4422
+ ),
4414
4423
  onClose: () => setActiveFilterColumn(null)
4415
4424
  }
4416
4425
  )
@@ -4476,7 +4485,7 @@ function Spreadsheet({
4476
4485
  },
4477
4486
  children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "relative flex items-center justify-center w-full h-full", children: [
4478
4487
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: displayIndex }),
4479
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "absolute inset-0 flex items-center justify-evenly", children: [
4488
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "absolute inset-0 flex items-center justify-between", children: [
4480
4489
  rowContextMenuItems && rowContextMenuItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
4481
4490
  RowContextMenu,
4482
4491
  {