@tidbcloud/uikit 2.0.0-beta.113 → 2.0.0-beta.114

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @tidbcloud/uikit
2
2
 
3
+ ## 2.0.0-beta.114
4
+
5
+ ### Patch Changes
6
+
7
+ - feat(protable): hide pagination when rowCount is 0 ([#409](https://github.com/tidbcloud/tidbcloud-uikit/pull/409))
8
+
3
9
  ## 2.0.0-beta.113
4
10
 
5
11
  ### Patch Changes
@@ -62,6 +62,7 @@ function mergeProTableProps(props) {
62
62
  data,
63
63
  localization,
64
64
  state,
65
+ rowCount,
65
66
  ...rest
66
67
  } = props;
67
68
  const theme = MantineThemeProvider.useMantineTheme();
@@ -232,13 +233,14 @@ function mergeProTableProps(props) {
232
233
  },
233
234
  mantineTableFooterProps
234
235
  );
235
- const withPagination = !!pagination;
236
+ const withPagination = (!!pagination || enablePagination) && ((rowCount ?? 0) || ((pagination == null ? void 0 : pagination.total) ?? 0)) > 0;
236
237
  return {
237
238
  enableColumnActions: false,
238
239
  enableColumnFilters: false,
239
240
  enableTopToolbar: false,
240
241
  enableSorting: false,
241
- enablePagination: withPagination || enablePagination,
242
+ rowCount,
243
+ enablePagination: withPagination,
242
244
  enableBottomToolbar: withPagination || enableBottomToolbar,
243
245
  renderBottomToolbar: () => {
244
246
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
@@ -60,6 +60,7 @@ function mergeProTableProps(props) {
60
60
  data,
61
61
  localization,
62
62
  state,
63
+ rowCount,
63
64
  ...rest
64
65
  } = props;
65
66
  const theme = useMantineTheme();
@@ -230,13 +231,14 @@ function mergeProTableProps(props) {
230
231
  },
231
232
  mantineTableFooterProps
232
233
  );
233
- const withPagination = !!pagination;
234
+ const withPagination = (!!pagination || enablePagination) && ((rowCount ?? 0) || ((pagination == null ? void 0 : pagination.total) ?? 0)) > 0;
234
235
  return {
235
236
  enableColumnActions: false,
236
237
  enableColumnFilters: false,
237
238
  enableTopToolbar: false,
238
239
  enableSorting: false,
239
- enablePagination: withPagination || enablePagination,
240
+ rowCount,
241
+ enablePagination: withPagination,
240
242
  enableBottomToolbar: withPagination || enableBottomToolbar,
241
243
  renderBottomToolbar: () => {
242
244
  return /* @__PURE__ */ jsx(Fragment, {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tidbcloud/uikit",
3
- "version": "2.0.0-beta.113",
3
+ "version": "2.0.0-beta.114",
4
4
  "description": "tidbcloud uikit",
5
5
  "type": "module",
6
6
  "main": "dist/primitive/index.cjs",