@trackunit/react-table 0.0.74 → 0.0.75

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
@@ -43,6 +43,7 @@ var defaultTranslations = {
43
43
  "table.sorting.toolip": "Adjust sorting and direction",
44
44
  "table.columnFilters.columns": "Columns",
45
45
  "table.columnFilters.hiddenColumnCount": "{{count}} column hidden",
46
+ "table.columnFilters.hiddenColumnsCount": "{{count}} columns hidden",
46
47
  "table.columnFilters.title": "Visible values",
47
48
  "table.columnFilters.tooltip": "Customize visible values",
48
49
  "table.exportFileName": "exported-data",
@@ -9213,9 +9214,16 @@ const ColumnFilter = ({ columns, setColumnOrder, defaultColumnOrder, columnOrder
9213
9214
  if (!columns) {
9214
9215
  return null;
9215
9216
  }
9216
- return (jsxRuntime.jsx(DndProvider, { backend: HTML5Backend, children: jsxRuntime.jsx(reactComponents.Tooltip, { label: t("table.columnFilters.tooltip"), placement: "bottom-start", children: jsxRuntime.jsxs(reactComponents.Popover, { placement: "bottom-start", children: [jsxRuntime.jsx(reactComponents.PopoverTrigger, { children: jsxRuntime.jsx(reactComponents.Button, { prefix: jsxRuntime.jsx(reactComponents.Icon, { name: "ViewColumns", size: "small" }), color: "secondary", variant: "transparent", size: "small", children: jsxRuntime.jsx("span", { className: "hidden sm:block", children: numberOfHiddenColumns > 0
9217
- ? t("table.columnFilters.hiddenColumnCount", { count: numberOfHiddenColumns })
9218
- : t("table.columnFilters.columns") }) }) }), jsxRuntime.jsx(reactComponents.PopoverContent, { children: () => (jsxRuntime.jsxs(reactComponents.MenuList, { className: "relative max-h-[55vh] w-72 overflow-y-auto pr-4", children: [jsxRuntime.jsxs("div", { className: "mb-2 flex items-center justify-between", children: [jsxRuntime.jsx(reactComponents.Text, { subtle: true, size: "small", children: t("table.columnFilters.title") }), jsxRuntime.jsx(reactComponents.Button, { className: "p-0", color: "secondary", variant: "transparent", size: "small", onClick: () => resetHiddenColumns(), children: t("layout.actions.reset") })] }), jsxRuntime.jsx(ColumnFiltersDragAndDrop, { columns: sortedColumns, setColumnOrder: setColumnOrder, onUserEvent: onUserEvent })] })) })] }) }) }));
9217
+ const getColumnButtonText = () => {
9218
+ if (numberOfHiddenColumns > 1) {
9219
+ return t("table.columnFilters.hiddenColumnsCount", { count: numberOfHiddenColumns });
9220
+ }
9221
+ if (numberOfHiddenColumns === 1) {
9222
+ return t("table.columnFilters.hiddenColumnCount", { count: numberOfHiddenColumns });
9223
+ }
9224
+ return t("table.columnFilters.columns");
9225
+ };
9226
+ return (jsxRuntime.jsx(DndProvider, { backend: HTML5Backend, children: jsxRuntime.jsx(reactComponents.Tooltip, { label: t("table.columnFilters.tooltip"), placement: "bottom-start", children: jsxRuntime.jsxs(reactComponents.Popover, { placement: "bottom-start", children: [jsxRuntime.jsx(reactComponents.PopoverTrigger, { children: jsxRuntime.jsx(reactComponents.Button, { prefix: jsxRuntime.jsx(reactComponents.Icon, { name: "ViewColumns", size: "small" }), color: "secondary", variant: "transparent", size: "small", children: jsxRuntime.jsx("span", { className: "hidden sm:block", children: getColumnButtonText() }) }) }), jsxRuntime.jsx(reactComponents.PopoverContent, { children: () => (jsxRuntime.jsxs(reactComponents.MenuList, { className: "relative max-h-[55vh] w-72 overflow-y-auto pr-4", children: [jsxRuntime.jsxs("div", { className: "mb-2 flex items-center justify-between", children: [jsxRuntime.jsx(reactComponents.Text, { subtle: true, size: "small", children: t("table.columnFilters.title") }), jsxRuntime.jsx(reactComponents.Button, { className: "p-0", color: "secondary", variant: "transparent", size: "small", onClick: () => resetHiddenColumns(), children: t("layout.actions.reset") })] }), jsxRuntime.jsx(ColumnFiltersDragAndDrop, { columns: sortedColumns, setColumnOrder: setColumnOrder, onUserEvent: onUserEvent })] })) })] }) }) }));
9219
9227
  };
9220
9228
  const ColumnFiltersDragAndDrop = ({ columns, setColumnOrder, onUserEvent, }) => {
9221
9229
  const [localColumns, setLocalColumns] = React__namespace.useState(columns);
package/index.esm.js CHANGED
@@ -20,6 +20,7 @@ var defaultTranslations = {
20
20
  "table.sorting.toolip": "Adjust sorting and direction",
21
21
  "table.columnFilters.columns": "Columns",
22
22
  "table.columnFilters.hiddenColumnCount": "{{count}} column hidden",
23
+ "table.columnFilters.hiddenColumnsCount": "{{count}} columns hidden",
23
24
  "table.columnFilters.title": "Visible values",
24
25
  "table.columnFilters.tooltip": "Customize visible values",
25
26
  "table.exportFileName": "exported-data",
@@ -9190,9 +9191,16 @@ const ColumnFilter = ({ columns, setColumnOrder, defaultColumnOrder, columnOrder
9190
9191
  if (!columns) {
9191
9192
  return null;
9192
9193
  }
9193
- return (jsx(DndProvider, { backend: HTML5Backend, children: jsx(Tooltip, { label: t("table.columnFilters.tooltip"), placement: "bottom-start", children: jsxs(Popover, { placement: "bottom-start", children: [jsx(PopoverTrigger, { children: jsx(Button, { prefix: jsx(Icon, { name: "ViewColumns", size: "small" }), color: "secondary", variant: "transparent", size: "small", children: jsx("span", { className: "hidden sm:block", children: numberOfHiddenColumns > 0
9194
- ? t("table.columnFilters.hiddenColumnCount", { count: numberOfHiddenColumns })
9195
- : t("table.columnFilters.columns") }) }) }), jsx(PopoverContent, { children: () => (jsxs(MenuList, { className: "relative max-h-[55vh] w-72 overflow-y-auto pr-4", children: [jsxs("div", { className: "mb-2 flex items-center justify-between", children: [jsx(Text, { subtle: true, size: "small", children: t("table.columnFilters.title") }), jsx(Button, { className: "p-0", color: "secondary", variant: "transparent", size: "small", onClick: () => resetHiddenColumns(), children: t("layout.actions.reset") })] }), jsx(ColumnFiltersDragAndDrop, { columns: sortedColumns, setColumnOrder: setColumnOrder, onUserEvent: onUserEvent })] })) })] }) }) }));
9194
+ const getColumnButtonText = () => {
9195
+ if (numberOfHiddenColumns > 1) {
9196
+ return t("table.columnFilters.hiddenColumnsCount", { count: numberOfHiddenColumns });
9197
+ }
9198
+ if (numberOfHiddenColumns === 1) {
9199
+ return t("table.columnFilters.hiddenColumnCount", { count: numberOfHiddenColumns });
9200
+ }
9201
+ return t("table.columnFilters.columns");
9202
+ };
9203
+ return (jsx(DndProvider, { backend: HTML5Backend, children: jsx(Tooltip, { label: t("table.columnFilters.tooltip"), placement: "bottom-start", children: jsxs(Popover, { placement: "bottom-start", children: [jsx(PopoverTrigger, { children: jsx(Button, { prefix: jsx(Icon, { name: "ViewColumns", size: "small" }), color: "secondary", variant: "transparent", size: "small", children: jsx("span", { className: "hidden sm:block", children: getColumnButtonText() }) }) }), jsx(PopoverContent, { children: () => (jsxs(MenuList, { className: "relative max-h-[55vh] w-72 overflow-y-auto pr-4", children: [jsxs("div", { className: "mb-2 flex items-center justify-between", children: [jsx(Text, { subtle: true, size: "small", children: t("table.columnFilters.title") }), jsx(Button, { className: "p-0", color: "secondary", variant: "transparent", size: "small", onClick: () => resetHiddenColumns(), children: t("layout.actions.reset") })] }), jsx(ColumnFiltersDragAndDrop, { columns: sortedColumns, setColumnOrder: setColumnOrder, onUserEvent: onUserEvent })] })) })] }) }) }));
9196
9204
  };
9197
9205
  const ColumnFiltersDragAndDrop = ({ columns, setColumnOrder, onUserEvent, }) => {
9198
9206
  const [localColumns, setLocalColumns] = React.useState(columns);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-table",
3
- "version": "0.0.74",
3
+ "version": "0.0.75",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -13,11 +13,11 @@
13
13
  "@trackunit/css-core": "0.0.99",
14
14
  "@trackunit/i18n-library-translation": "0.0.88",
15
15
  "@trackunit/iris-app-api": "0.0.125",
16
- "@trackunit/react-components": "0.1.184",
16
+ "@trackunit/react-components": "0.1.185",
17
17
  "@trackunit/react-core-contexts-api": "0.2.65",
18
18
  "@trackunit/react-core-contexts-test": "0.1.122",
19
- "@trackunit/react-form-components": "0.0.183",
20
- "@trackunit/react-table-base-components": "0.0.59",
19
+ "@trackunit/react-form-components": "0.0.184",
20
+ "@trackunit/react-table-base-components": "0.0.60",
21
21
  "@trackunit/shared-utils": "0.0.13",
22
22
  "@trackunit/ui-icons": "0.0.78",
23
23
  "immutability-helper": "3.1.1",
@@ -15,8 +15,8 @@ export declare const translations: TranslationResource<TranslationKeys>;
15
15
  /**
16
16
  * Local useTranslation for this specific library
17
17
  */
18
- export declare const useTranslation: () => [TransForLibs<"table.actionsheet.selected" | "layout.actions.reset" | "table.pagination.of" | "table.pagination.full" | "table.pagination.page" | "table.results.plural" | "table.sorting.toolip" | "table.columnFilters.columns" | "table.columnFilters.hiddenColumnCount" | "table.columnFilters.title" | "table.columnFilters.tooltip" | "table.exportFileName" | "table.format" | "table.results.plural.capped" | "table.noResults" | "table.error" | "table.result" | "table.rowDensity.compact" | "table.rowDensity.spacious" | "table.search.placeholder" | "table.searchPlaceholder" | "table.sorting.ascending" | "table.sorting.descending" | "table.sorting.label" | "table.sorting.order" | "table.spacing" | "table.spacing.toolip">, import("i18next").i18n, boolean] & {
19
- t: TransForLibs<"table.actionsheet.selected" | "layout.actions.reset" | "table.pagination.of" | "table.pagination.full" | "table.pagination.page" | "table.results.plural" | "table.sorting.toolip" | "table.columnFilters.columns" | "table.columnFilters.hiddenColumnCount" | "table.columnFilters.title" | "table.columnFilters.tooltip" | "table.exportFileName" | "table.format" | "table.results.plural.capped" | "table.noResults" | "table.error" | "table.result" | "table.rowDensity.compact" | "table.rowDensity.spacious" | "table.search.placeholder" | "table.searchPlaceholder" | "table.sorting.ascending" | "table.sorting.descending" | "table.sorting.label" | "table.sorting.order" | "table.spacing" | "table.spacing.toolip">;
18
+ export declare const useTranslation: () => [TransForLibs<"table.actionsheet.selected" | "layout.actions.reset" | "table.pagination.of" | "table.pagination.full" | "table.pagination.page" | "table.results.plural" | "table.sorting.toolip" | "table.columnFilters.columns" | "table.columnFilters.hiddenColumnCount" | "table.columnFilters.hiddenColumnsCount" | "table.columnFilters.title" | "table.columnFilters.tooltip" | "table.exportFileName" | "table.format" | "table.results.plural.capped" | "table.noResults" | "table.error" | "table.result" | "table.rowDensity.compact" | "table.rowDensity.spacious" | "table.search.placeholder" | "table.searchPlaceholder" | "table.sorting.ascending" | "table.sorting.descending" | "table.sorting.label" | "table.sorting.order" | "table.spacing" | "table.spacing.toolip">, import("i18next").i18n, boolean] & {
19
+ t: TransForLibs<"table.actionsheet.selected" | "layout.actions.reset" | "table.pagination.of" | "table.pagination.full" | "table.pagination.page" | "table.results.plural" | "table.sorting.toolip" | "table.columnFilters.columns" | "table.columnFilters.hiddenColumnCount" | "table.columnFilters.hiddenColumnsCount" | "table.columnFilters.title" | "table.columnFilters.tooltip" | "table.exportFileName" | "table.format" | "table.results.plural.capped" | "table.noResults" | "table.error" | "table.result" | "table.rowDensity.compact" | "table.rowDensity.spacious" | "table.search.placeholder" | "table.searchPlaceholder" | "table.sorting.ascending" | "table.sorting.descending" | "table.sorting.label" | "table.sorting.order" | "table.spacing" | "table.spacing.toolip">;
20
20
  i18n: import("i18next").i18n;
21
21
  ready: boolean;
22
22
  };