fastapi-rtk 2.0.5 → 2.0.6

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.
@@ -30,6 +30,7 @@ const MRT_BottomToolbar = ({ table, ...rest }) => {
30
30
  }),
31
31
  ...rest
32
32
  };
33
+ const mergedRef = hooks.useMergedRef(bottomToolbarRef, toolbarProps == null ? void 0 : toolbarProps.ref);
33
34
  const stackAlertBanner = isMobile || !!renderBottomToolbarCustomActions;
34
35
  return /* @__PURE__ */ jsxRuntime.jsxs(
35
36
  core.Box,
@@ -42,14 +43,7 @@ const MRT_BottomToolbar = ({ table, ...rest }) => {
42
43
  isFullScreen && MRT_BottomToolbar_module.default["root-fullscreen"],
43
44
  toolbarProps == null ? void 0 : toolbarProps.className
44
45
  ),
45
- ref: (node) => {
46
- if (node) {
47
- bottomToolbarRef.current = node;
48
- if (toolbarProps == null ? void 0 : toolbarProps.ref) {
49
- toolbarProps.ref.current = node;
50
- }
51
- }
52
- },
46
+ ref: mergedRef,
53
47
  children: [
54
48
  /* @__PURE__ */ jsxRuntime.jsx(index_esm.MRT_ProgressBar, { isTopToolbar: false, table }),
55
49
  positionToolbarAlertBanner === "bottom" && /* @__PURE__ */ jsxRuntime.jsx(MRT_ToolbarAlertBanner.MRT_ToolbarAlertBanner, { stackAlertBanner, table }),
@@ -33,6 +33,7 @@ const MRT_TopToolbar = ({ table, ...rest }) => {
33
33
  ...utils.parseFromValuesOrFunc(mantineTopToolbarProps, { table }),
34
34
  ...rest
35
35
  };
36
+ const mergedRef = hooks.useMergedRef(topToolbarRef, toolbarProps == null ? void 0 : toolbarProps.ref);
36
37
  const stackAlertBanner = isMobile || !!renderTopToolbarCustomActions || showGlobalFilter && isTablet;
37
38
  const globalFilterProps = {
38
39
  style: !isTablet ? {
@@ -52,14 +53,7 @@ const MRT_TopToolbar = ({ table, ...rest }) => {
52
53
  isFullScreen && MRT_TopToolbar_module.default["root-fullscreen"],
53
54
  toolbarProps == null ? void 0 : toolbarProps.className
54
55
  ),
55
- ref: (node) => {
56
- if (node) {
57
- topToolbarRef.current = node;
58
- if (toolbarProps == null ? void 0 : toolbarProps.ref) {
59
- toolbarProps.ref.current = node;
60
- }
61
- }
62
- },
56
+ ref: mergedRef,
63
57
  children: [
64
58
  positionToolbarAlertBanner === "top" && /* @__PURE__ */ jsxRuntime.jsx(MRT_ToolbarAlertBanner.MRT_ToolbarAlertBanner, { stackAlertBanner, table }),
65
59
  ["both", "top"].includes(positionToolbarDropZone ?? "") && /* @__PURE__ */ jsxRuntime.jsx(index_esm.MRT_ToolbarDropZone, { table }),
@@ -4,7 +4,7 @@ import commonClasses from "./common.styles.module.css.mjs";
4
4
  import classes from "./MRT_BottomToolbar.module.css.mjs";
5
5
  import { parseFromValuesOrFunc } from "fastapi-rtk/utils";
6
6
  import { Box } from "@mantine/core";
7
- import { useMediaQuery } from "@mantine/hooks";
7
+ import { useMediaQuery, useMergedRef } from "@mantine/hooks";
8
8
  import { MRT_ProgressBar, MRT_ToolbarDropZone, MRT_TablePagination } from "../../../../../../.external/esm/mantine-react-table@2.0.0-beta.9_patch_hash_046f1b0f764b8dc88804170e4ca8f096de0796df0be_2e8cfd91765713166f4d486da3b54b13/mantine-react-table/dist/index.esm.mjs";
9
9
  import { MRT_ToolbarAlertBanner } from "./MRT_ToolbarAlertBanner.mjs";
10
10
  const MRT_BottomToolbar = ({ table, ...rest }) => {
@@ -28,6 +28,7 @@ const MRT_BottomToolbar = ({ table, ...rest }) => {
28
28
  }),
29
29
  ...rest
30
30
  };
31
+ const mergedRef = useMergedRef(bottomToolbarRef, toolbarProps == null ? void 0 : toolbarProps.ref);
31
32
  const stackAlertBanner = isMobile || !!renderBottomToolbarCustomActions;
32
33
  return /* @__PURE__ */ jsxs(
33
34
  Box,
@@ -40,14 +41,7 @@ const MRT_BottomToolbar = ({ table, ...rest }) => {
40
41
  isFullScreen && classes["root-fullscreen"],
41
42
  toolbarProps == null ? void 0 : toolbarProps.className
42
43
  ),
43
- ref: (node) => {
44
- if (node) {
45
- bottomToolbarRef.current = node;
46
- if (toolbarProps == null ? void 0 : toolbarProps.ref) {
47
- toolbarProps.ref.current = node;
48
- }
49
- }
50
- },
44
+ ref: mergedRef,
51
45
  children: [
52
46
  /* @__PURE__ */ jsx(MRT_ProgressBar, { isTopToolbar: false, table }),
53
47
  positionToolbarAlertBanner === "bottom" && /* @__PURE__ */ jsx(MRT_ToolbarAlertBanner, { stackAlertBanner, table }),
@@ -1,7 +1,7 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { parseFromValuesOrFunc } from "fastapi-rtk/utils";
3
3
  import { Box, Group, Flex, Center } from "@mantine/core";
4
- import { useMediaQuery } from "@mantine/hooks";
4
+ import { useMediaQuery, useMergedRef } from "@mantine/hooks";
5
5
  import { clsx } from "../../../../../../.external/esm/clsx@2.1.1/clsx/dist/clsx.mjs";
6
6
  import { MRT_ToolbarDropZone, MRT_GlobalFilterTextInput, MRT_ToolbarInternalButtons, MRT_TablePagination, MRT_ProgressBar } from "../../../../../../.external/esm/mantine-react-table@2.0.0-beta.9_patch_hash_046f1b0f764b8dc88804170e4ca8f096de0796df0be_2e8cfd91765713166f4d486da3b54b13/mantine-react-table/dist/index.esm.mjs";
7
7
  import commonClasses from "./common.styles.module.css.mjs";
@@ -31,6 +31,7 @@ const MRT_TopToolbar = ({ table, ...rest }) => {
31
31
  ...parseFromValuesOrFunc(mantineTopToolbarProps, { table }),
32
32
  ...rest
33
33
  };
34
+ const mergedRef = useMergedRef(topToolbarRef, toolbarProps == null ? void 0 : toolbarProps.ref);
34
35
  const stackAlertBanner = isMobile || !!renderTopToolbarCustomActions || showGlobalFilter && isTablet;
35
36
  const globalFilterProps = {
36
37
  style: !isTablet ? {
@@ -50,14 +51,7 @@ const MRT_TopToolbar = ({ table, ...rest }) => {
50
51
  isFullScreen && classes["root-fullscreen"],
51
52
  toolbarProps == null ? void 0 : toolbarProps.className
52
53
  ),
53
- ref: (node) => {
54
- if (node) {
55
- topToolbarRef.current = node;
56
- if (toolbarProps == null ? void 0 : toolbarProps.ref) {
57
- toolbarProps.ref.current = node;
58
- }
59
- }
60
- },
54
+ ref: mergedRef,
61
55
  children: [
62
56
  positionToolbarAlertBanner === "top" && /* @__PURE__ */ jsx(MRT_ToolbarAlertBanner, { stackAlertBanner, table }),
63
57
  ["both", "top"].includes(positionToolbarDropZone ?? "") && /* @__PURE__ */ jsx(MRT_ToolbarDropZone, { table }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fastapi-rtk",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "private": false,
5
5
  "description": "A React component library for FastAPI in combination with FastAPI React Toolkit backend, built with Mantine, JsonForms, and Zustand.",
6
6
  "license": "MIT",