@trackunit/react-table-helpers 1.8.25 → 1.8.26
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 +7 -2
- package/index.esm.js +8 -3
- package/package.json +3 -3
- package/src/translation.d.ts +2 -2
package/index.cjs.js
CHANGED
|
@@ -13,7 +13,7 @@ var filtersGraphqlHook = require('@trackunit/filters-graphql-hook');
|
|
|
13
13
|
var reactTable = require('@trackunit/react-table');
|
|
14
14
|
|
|
15
15
|
var defaultTranslations = {
|
|
16
|
-
|
|
16
|
+
"export.table.button": "Export"
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
/** The translation namespace for this library */
|
|
@@ -47,6 +47,10 @@ const translations = {
|
|
|
47
47
|
th: () => Promise.resolve().then(function () { return require('./translation.cjs17.js'); }),
|
|
48
48
|
},
|
|
49
49
|
};
|
|
50
|
+
/**
|
|
51
|
+
* Local useTranslation for this specific library
|
|
52
|
+
*/
|
|
53
|
+
const useTranslation = () => i18nLibraryTranslation.useNamespaceTranslation(namespace);
|
|
50
54
|
/**
|
|
51
55
|
* Registers the translations for this library
|
|
52
56
|
*/
|
|
@@ -58,6 +62,7 @@ const setupLibraryTranslations = () => {
|
|
|
58
62
|
* This component is used to export the table data to an Excel file.
|
|
59
63
|
*/
|
|
60
64
|
const ExportTableButton = ({ columnVisibility, rowCount, allTableColumns, variables, document, name, headers, }) => {
|
|
65
|
+
const [t] = useTranslation();
|
|
61
66
|
const { exportData } = reactCoreHooks.useExportDataContext();
|
|
62
67
|
const exportColumns = react.useMemo(() => {
|
|
63
68
|
return allTableColumns
|
|
@@ -101,7 +106,7 @@ const ExportTableButton = ({ columnVisibility, rowCount, allTableColumns, variab
|
|
|
101
106
|
name,
|
|
102
107
|
headers: headers ?? {},
|
|
103
108
|
});
|
|
104
|
-
}, variant: "secondary", children: "
|
|
109
|
+
}, variant: "secondary", children: t("export.table.button") }));
|
|
105
110
|
};
|
|
106
111
|
|
|
107
112
|
/**
|
package/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { registerTranslations } from '@trackunit/i18n-library-translation';
|
|
2
|
+
import { registerTranslations, useNamespaceTranslation } from '@trackunit/i18n-library-translation';
|
|
3
3
|
import { Button } from '@trackunit/react-components';
|
|
4
4
|
import { useExportDataContext } from '@trackunit/react-core-hooks';
|
|
5
5
|
import { useMemo } from 'react';
|
|
@@ -11,7 +11,7 @@ import { CustomFieldPrefix } from '@trackunit/filters-graphql-hook';
|
|
|
11
11
|
import { createColumnHelper } from '@trackunit/react-table';
|
|
12
12
|
|
|
13
13
|
var defaultTranslations = {
|
|
14
|
-
|
|
14
|
+
"export.table.button": "Export"
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
/** The translation namespace for this library */
|
|
@@ -45,6 +45,10 @@ const translations = {
|
|
|
45
45
|
th: () => import('./translation.esm17.js'),
|
|
46
46
|
},
|
|
47
47
|
};
|
|
48
|
+
/**
|
|
49
|
+
* Local useTranslation for this specific library
|
|
50
|
+
*/
|
|
51
|
+
const useTranslation = () => useNamespaceTranslation(namespace);
|
|
48
52
|
/**
|
|
49
53
|
* Registers the translations for this library
|
|
50
54
|
*/
|
|
@@ -56,6 +60,7 @@ const setupLibraryTranslations = () => {
|
|
|
56
60
|
* This component is used to export the table data to an Excel file.
|
|
57
61
|
*/
|
|
58
62
|
const ExportTableButton = ({ columnVisibility, rowCount, allTableColumns, variables, document, name, headers, }) => {
|
|
63
|
+
const [t] = useTranslation();
|
|
59
64
|
const { exportData } = useExportDataContext();
|
|
60
65
|
const exportColumns = useMemo(() => {
|
|
61
66
|
return allTableColumns
|
|
@@ -99,7 +104,7 @@ const ExportTableButton = ({ columnVisibility, rowCount, allTableColumns, variab
|
|
|
99
104
|
name,
|
|
100
105
|
headers: headers ?? {},
|
|
101
106
|
});
|
|
102
|
-
}, variant: "secondary", children: "
|
|
107
|
+
}, variant: "secondary", children: t("export.table.button") }));
|
|
103
108
|
};
|
|
104
109
|
|
|
105
110
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-table-helpers",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.26",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"react": "19.0.0",
|
|
11
|
-
"@trackunit/filters-filter-bar": "1.8.
|
|
12
|
-
"@trackunit/filters-graphql-hook": "1.11.
|
|
11
|
+
"@trackunit/filters-filter-bar": "1.8.118",
|
|
12
|
+
"@trackunit/filters-graphql-hook": "1.11.61",
|
|
13
13
|
"@trackunit/i18n-library-translation": "1.7.88",
|
|
14
14
|
"@trackunit/custom-field-components": "1.7.112",
|
|
15
15
|
"@trackunit/iris-app-runtime-core": "1.8.80",
|
package/src/translation.d.ts
CHANGED
|
@@ -14,8 +14,8 @@ export declare const translations: TranslationResource<TranslationKeys>;
|
|
|
14
14
|
/**
|
|
15
15
|
* Local useTranslation for this specific library
|
|
16
16
|
*/
|
|
17
|
-
export declare const useTranslation: () => [TransForLibs<
|
|
18
|
-
t: TransForLibs<
|
|
17
|
+
export declare const useTranslation: () => [TransForLibs<"export.table.button">, import("i18next").i18n, boolean] & {
|
|
18
|
+
t: TransForLibs<"export.table.button">;
|
|
19
19
|
i18n: import("i18next").i18n;
|
|
20
20
|
ready: boolean;
|
|
21
21
|
};
|