@trackunit/react-table-helpers 1.14.47 → 1.15.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/index.cjs.js CHANGED
@@ -61,7 +61,7 @@ const setupLibraryTranslations = () => {
61
61
  /**
62
62
  * This component is used to export the table data to an Excel file.
63
63
  */
64
- const ExportTableButton = ({ columnVisibility, rowCount, allTableColumns, variables, document, name, headers, }) => {
64
+ const ExportTableButton = ({ columnVisibility, rowCount, allTableColumns, variables, document, name, headers, onExport, }) => {
65
65
  const [t] = useTranslation();
66
66
  const { exportData } = reactCoreHooks.useExportDataContext();
67
67
  const exportColumns = react.useMemo(() => {
@@ -99,6 +99,7 @@ const ExportTableButton = ({ columnVisibility, rowCount, allTableColumns, variab
99
99
  return null;
100
100
  }
101
101
  return (jsxRuntime.jsx(reactComponents.Button, { "data-testid": "export-table-button", disabled: rowCount === 0, onClick: () => {
102
+ onExport?.();
102
103
  void exportData({
103
104
  document,
104
105
  variables: variables,
package/index.esm.js CHANGED
@@ -59,7 +59,7 @@ const setupLibraryTranslations = () => {
59
59
  /**
60
60
  * This component is used to export the table data to an Excel file.
61
61
  */
62
- const ExportTableButton = ({ columnVisibility, rowCount, allTableColumns, variables, document, name, headers, }) => {
62
+ const ExportTableButton = ({ columnVisibility, rowCount, allTableColumns, variables, document, name, headers, onExport, }) => {
63
63
  const [t] = useTranslation();
64
64
  const { exportData } = useExportDataContext();
65
65
  const exportColumns = useMemo(() => {
@@ -97,6 +97,7 @@ const ExportTableButton = ({ columnVisibility, rowCount, allTableColumns, variab
97
97
  return null;
98
98
  }
99
99
  return (jsx(Button, { "data-testid": "export-table-button", disabled: rowCount === 0, onClick: () => {
100
+ onExport?.();
100
101
  void exportData({
101
102
  document,
102
103
  variables: variables,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-table-helpers",
3
- "version": "1.14.47",
3
+ "version": "1.15.0",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -9,9 +9,10 @@ interface ExportTableButtonProps<TData, TVariables> {
9
9
  rowCount: number;
10
10
  name: string;
11
11
  headers?: Record<string, string>;
12
+ onExport?: () => void;
12
13
  }
13
14
  /**
14
15
  * This component is used to export the table data to an Excel file.
15
16
  */
16
- export declare const ExportTableButton: <TData, TVariables>({ columnVisibility, rowCount, allTableColumns, variables, document, name, headers, }: ExportTableButtonProps<TData, TVariables>) => ReactElement | null;
17
+ export declare const ExportTableButton: <TData, TVariables>({ columnVisibility, rowCount, allTableColumns, variables, document, name, headers, onExport, }: ExportTableButtonProps<TData, TVariables>) => ReactElement | null;
17
18
  export {};