@trackunit/react-table 1.17.4 → 1.17.5

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
@@ -403,7 +403,7 @@ const ItemTypes = {
403
403
  * @param {boolean} [props.isSortDisabled] - Optional flag to disable sorting.
404
404
  * @returns {Element} A React component rendering the column filter item.
405
405
  */
406
- const ColumnFilterItem = ({ name, onToggle, toggled, disabled, index, moveColumn, onDrop, onCancelDrop, id, isSortDisabled, }) => {
406
+ const ColumnFilterItem = ({ name, onToggle, toggled, disabled, index, moveColumn, onDrop, onCancelDrop, id, isSortDisabled = false, }) => {
407
407
  const ref = react.useRef(null);
408
408
  const [, drop] = reactDnd.useDrop({
409
409
  accept: ItemTypes.COLUMN,
@@ -1122,7 +1122,7 @@ const ColumnSorting = ({ canSort, sortingState = false }) => {
1122
1122
  *
1123
1123
  * ```
1124
1124
  */
1125
- const Table = ({ rowHeight = 50, ...props }) => {
1125
+ const Table = ({ rowHeight = 50, loading = false, hideFooter = false, ...props }) => {
1126
1126
  //we need a reference to the scrolling element for logic down below
1127
1127
  const tableScrollElementRef = react.useRef(null);
1128
1128
  const [t] = useTranslation();
@@ -1295,8 +1295,8 @@ const Table = ({ rowHeight = 50, ...props }) => {
1295
1295
  }) }, `${row.id}-${index}`));
1296
1296
  }
1297
1297
  }) })) : (jsxRuntime.jsx("tbody", { className: cvaTBody({
1298
- emptyState: !props.loading && (props.noDataMessage === undefined || props.noDataMessage === ""),
1299
- }), children: jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { className: "b-0", children: props.loading ? (jsxRuntime.jsx(reactComponents.Spinner, { centering: "centered", containerClassName: "absolute inset-0", "data-testid": "table-loading-spinner" })) : props.noDataMessage !== undefined && props.noDataMessage !== "" ? (props.noDataMessage) : (jsxRuntime.jsx(reactComponents.EmptyState, { className: "absolute inset-0", description: t("table.noResults"), image: "SEARCH_DOCUMENT", ...props.emptyState })) }) }) }))] }) }), props.hideFooter ? null : (jsxRuntime.jsxs("div", { className: "flex items-center p-2", "data-testid": "table-footer", children: [jsxRuntime.jsx("div", { className: "whitespace-nowrap text-xs font-medium text-neutral-600", children: props.pagination?.pageInfo?.count !== undefined
1298
+ emptyState: !loading && (props.noDataMessage === undefined || props.noDataMessage === ""),
1299
+ }), children: jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { className: "b-0", children: loading ? (jsxRuntime.jsx(reactComponents.Spinner, { centering: "centered", containerClassName: "absolute inset-0", "data-testid": "table-loading-spinner" })) : props.noDataMessage !== undefined && props.noDataMessage !== "" ? (props.noDataMessage) : (jsxRuntime.jsx(reactComponents.EmptyState, { className: "absolute inset-0", description: t("table.noResults"), image: "SEARCH_DOCUMENT", ...props.emptyState })) }) }) }))] }) }), hideFooter ? null : (jsxRuntime.jsxs("div", { className: "flex items-center p-2", "data-testid": "table-footer", children: [jsxRuntime.jsx("div", { className: "whitespace-nowrap text-xs font-medium text-neutral-600", children: props.pagination?.pageInfo?.count !== undefined
1300
1300
  ? t(props.pagination.pageInfo.isCountCapped ? "table.pagination.full.capped" : "table.pagination.full", {
1301
1301
  count: props.getRowModel().rows.length,
1302
1302
  total: props.pagination.pageInfo.count,
package/index.esm.js CHANGED
@@ -402,7 +402,7 @@ const ItemTypes = {
402
402
  * @param {boolean} [props.isSortDisabled] - Optional flag to disable sorting.
403
403
  * @returns {Element} A React component rendering the column filter item.
404
404
  */
405
- const ColumnFilterItem = ({ name, onToggle, toggled, disabled, index, moveColumn, onDrop, onCancelDrop, id, isSortDisabled, }) => {
405
+ const ColumnFilterItem = ({ name, onToggle, toggled, disabled, index, moveColumn, onDrop, onCancelDrop, id, isSortDisabled = false, }) => {
406
406
  const ref = useRef(null);
407
407
  const [, drop] = useDrop({
408
408
  accept: ItemTypes.COLUMN,
@@ -1121,7 +1121,7 @@ const ColumnSorting = ({ canSort, sortingState = false }) => {
1121
1121
  *
1122
1122
  * ```
1123
1123
  */
1124
- const Table = ({ rowHeight = 50, ...props }) => {
1124
+ const Table = ({ rowHeight = 50, loading = false, hideFooter = false, ...props }) => {
1125
1125
  //we need a reference to the scrolling element for logic down below
1126
1126
  const tableScrollElementRef = useRef(null);
1127
1127
  const [t] = useTranslation();
@@ -1294,8 +1294,8 @@ const Table = ({ rowHeight = 50, ...props }) => {
1294
1294
  }) }, `${row.id}-${index}`));
1295
1295
  }
1296
1296
  }) })) : (jsx("tbody", { className: cvaTBody({
1297
- emptyState: !props.loading && (props.noDataMessage === undefined || props.noDataMessage === ""),
1298
- }), children: jsx("tr", { children: jsx("td", { className: "b-0", children: props.loading ? (jsx(Spinner, { centering: "centered", containerClassName: "absolute inset-0", "data-testid": "table-loading-spinner" })) : props.noDataMessage !== undefined && props.noDataMessage !== "" ? (props.noDataMessage) : (jsx(EmptyState, { className: "absolute inset-0", description: t("table.noResults"), image: "SEARCH_DOCUMENT", ...props.emptyState })) }) }) }))] }) }), props.hideFooter ? null : (jsxs("div", { className: "flex items-center p-2", "data-testid": "table-footer", children: [jsx("div", { className: "whitespace-nowrap text-xs font-medium text-neutral-600", children: props.pagination?.pageInfo?.count !== undefined
1297
+ emptyState: !loading && (props.noDataMessage === undefined || props.noDataMessage === ""),
1298
+ }), children: jsx("tr", { children: jsx("td", { className: "b-0", children: loading ? (jsx(Spinner, { centering: "centered", containerClassName: "absolute inset-0", "data-testid": "table-loading-spinner" })) : props.noDataMessage !== undefined && props.noDataMessage !== "" ? (props.noDataMessage) : (jsx(EmptyState, { className: "absolute inset-0", description: t("table.noResults"), image: "SEARCH_DOCUMENT", ...props.emptyState })) }) }) }))] }) }), hideFooter ? null : (jsxs("div", { className: "flex items-center p-2", "data-testid": "table-footer", children: [jsx("div", { className: "whitespace-nowrap text-xs font-medium text-neutral-600", children: props.pagination?.pageInfo?.count !== undefined
1299
1299
  ? t(props.pagination.pageInfo.isCountCapped ? "table.pagination.full.capped" : "table.pagination.full", {
1300
1300
  count: props.getRowModel().rows.length,
1301
1301
  total: props.pagination.pageInfo.count,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-table",
3
- "version": "1.17.4",
3
+ "version": "1.17.5",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -11,13 +11,13 @@
11
11
  "react-dnd": "16.0.1",
12
12
  "react-dnd-html5-backend": "16.0.1",
13
13
  "tailwind-merge": "^2.0.0",
14
- "@trackunit/react-components": "1.20.3",
14
+ "@trackunit/react-components": "1.20.4",
15
15
  "@trackunit/shared-utils": "1.13.77",
16
16
  "@trackunit/css-class-variance-utilities": "1.11.77",
17
17
  "@trackunit/ui-icons": "1.11.73",
18
- "@trackunit/react-table-base-components": "1.17.3",
19
- "@trackunit/react-form-components": "1.18.3",
20
- "@trackunit/i18n-library-translation": "1.15.3",
18
+ "@trackunit/react-table-base-components": "1.17.4",
19
+ "@trackunit/react-form-components": "1.18.4",
20
+ "@trackunit/i18n-library-translation": "1.15.4",
21
21
  "@trackunit/iris-app-runtime-core-api": "1.13.2"
22
22
  },
23
23
  "peerDependencies": {
package/src/Table.d.ts CHANGED
@@ -177,4 +177,4 @@ export interface TableProps<TData extends object> extends ReactTable<TData>, Com
177
177
  *
178
178
  * ```
179
179
  */
180
- export declare const Table: <TData extends object>({ rowHeight, ...props }: TableProps<TData>) => ReactElement;
180
+ export declare const Table: <TData extends object>({ rowHeight, loading, hideFooter, ...props }: TableProps<TData>) => ReactElement;