fastapi-rtk 0.2.62 → 1.0.0

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.
@@ -2745,7 +2745,6 @@ const MRT_BottomToolbar = (_a) => {
2745
2745
  }
2746
2746
  }, children: [jsxRuntime.jsx(MRT_ProgressBar, { isTopToolbar: false, table }), positionToolbarAlertBanner === "bottom" && jsxRuntime.jsx(MRT_ToolbarAlertBanner, { stackAlertBanner, table }), ["both", "bottom"].includes(positionToolbarDropZone !== null && positionToolbarDropZone !== void 0 ? positionToolbarDropZone : "") && jsxRuntime.jsx(MRT_ToolbarDropZone, { table }), jsxRuntime.jsxs(core.Box, { className: classes$5["custom-toolbar-container"], children: [renderBottomToolbarCustomActions ? renderBottomToolbarCustomActions({ table }) : jsxRuntime.jsx("span", {}), jsxRuntime.jsx(core.Box, { className: clsx.clsx(classes$5["paginator-container"], stackAlertBanner && classes$5["paginator-container-alert-banner"]), children: enablePagination && ["both", "bottom"].includes(positionPagination !== null && positionPagination !== void 0 ? positionPagination : "") && jsxRuntime.jsx(MRT_TablePagination, { position: "bottom", table }) })] })] }));
2747
2747
  };
2748
- var classes$1 = { "root": "MRT_TopToolbar-module_root__r4-V9", "root-fullscreen": "MRT_TopToolbar-module_root-fullscreen__3itT8", "actions-container": "MRT_TopToolbar-module_actions-container__-uL0u", "actions-container-stack-alert": "MRT_TopToolbar-module_actions-container-stack-alert__OYDL6" };
2749
2748
  var classes = { "root": "MRT_ToolbarInternalButtons-module_root__NKoUG" };
2750
2749
  const MRT_ToolbarInternalButtons = (_a) => {
2751
2750
  var _b;
@@ -2753,30 +2752,6 @@ const MRT_ToolbarInternalButtons = (_a) => {
2753
2752
  const { options: { columnFilterDisplayMode, enableColumnFilters, enableColumnOrdering, enableColumnPinning, enableDensityToggle, enableFilters, enableFullScreenToggle, enableGlobalFilter, enableHiding, initialState, renderToolbarInternalActions } } = table;
2754
2753
  return jsxRuntime.jsx(core.Flex, Object.assign({}, rest, { className: clsx.clsx("mrt-toolbar-internal-buttons", classes.root, rest === null || rest === void 0 ? void 0 : rest.className), children: (_b = renderToolbarInternalActions === null || renderToolbarInternalActions === void 0 ? void 0 : renderToolbarInternalActions({ table })) !== null && _b !== void 0 ? _b : jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [enableFilters && enableGlobalFilter && !(initialState === null || initialState === void 0 ? void 0 : initialState.showGlobalFilter) && jsxRuntime.jsx(MRT_ToggleGlobalFilterButton, { table }), enableFilters && enableColumnFilters && columnFilterDisplayMode !== "popover" && jsxRuntime.jsx(MRT_ToggleFiltersButton, { table }), (enableHiding || enableColumnOrdering || enableColumnPinning) && jsxRuntime.jsx(MRT_ShowHideColumnsButton, { table }), enableDensityToggle && jsxRuntime.jsx(MRT_ToggleDensePaddingButton, { table }), enableFullScreenToggle && jsxRuntime.jsx(MRT_ToggleFullScreenButton, { table })] }) }));
2755
2754
  };
2756
- const MRT_TopToolbar = (_a) => {
2757
- var _b;
2758
- var { table } = _a, rest = __rest(_a, ["table"]);
2759
- const { getState, options: { enableGlobalFilter, enablePagination, enableToolbarInternalActions, mantineTopToolbarProps, positionGlobalFilter, positionPagination, positionToolbarAlertBanner, positionToolbarDropZone, renderTopToolbarCustomActions }, refs: { topToolbarRef } } = table;
2760
- const { isFullScreen, showGlobalFilter } = getState();
2761
- const isMobile = hooks.useMediaQuery("(max-width:720px)");
2762
- const isTablet = hooks.useMediaQuery("(max-width:1024px)");
2763
- const toolbarProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(mantineTopToolbarProps, { table })), rest);
2764
- const stackAlertBanner = isMobile || !!renderTopToolbarCustomActions || showGlobalFilter && isTablet;
2765
- const globalFilterProps = {
2766
- style: !isTablet ? {
2767
- zIndex: 3
2768
- } : void 0,
2769
- table
2770
- };
2771
- return jsxRuntime.jsxs(core.Box, Object.assign({}, toolbarProps, { className: clsx.clsx(commonClasses["common-toolbar-styles"], classes$1["root"], isFullScreen && classes$1["root-fullscreen"], toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.className), ref: (node) => {
2772
- if (node) {
2773
- topToolbarRef.current = node;
2774
- if (toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.ref) {
2775
- toolbarProps.ref.current = node;
2776
- }
2777
- }
2778
- }, children: [positionToolbarAlertBanner === "top" && jsxRuntime.jsx(MRT_ToolbarAlertBanner, { stackAlertBanner, table }), ["both", "top"].includes(positionToolbarDropZone !== null && positionToolbarDropZone !== void 0 ? positionToolbarDropZone : "") && jsxRuntime.jsx(MRT_ToolbarDropZone, { table }), jsxRuntime.jsxs(core.Flex, { className: clsx.clsx(classes$1["actions-container"], stackAlertBanner && classes$1["actions-container-stack-alert"]), children: [enableGlobalFilter && positionGlobalFilter === "left" && jsxRuntime.jsx(MRT_GlobalFilterTextInput, Object.assign({}, globalFilterProps)), (_b = renderTopToolbarCustomActions === null || renderTopToolbarCustomActions === void 0 ? void 0 : renderTopToolbarCustomActions({ table })) !== null && _b !== void 0 ? _b : jsxRuntime.jsx("span", {}), enableToolbarInternalActions ? jsxRuntime.jsxs(core.Flex, { justify: "end", wrap: "wrap-reverse", children: [enableGlobalFilter && positionGlobalFilter === "right" && jsxRuntime.jsx(MRT_GlobalFilterTextInput, Object.assign({}, globalFilterProps)), jsxRuntime.jsx(MRT_ToolbarInternalButtons, { table })] }) : enableGlobalFilter && positionGlobalFilter === "right" && jsxRuntime.jsx(MRT_GlobalFilterTextInput, Object.assign({}, globalFilterProps))] }), enablePagination && ["both", "top"].includes(positionPagination !== null && positionPagination !== void 0 ? positionPagination : "") && jsxRuntime.jsx(core.Flex, { justify: "end", children: jsxRuntime.jsx(MRT_TablePagination, { position: "top", table }) }), jsxRuntime.jsx(MRT_ProgressBar, { isTopToolbar: true, table })] }));
2779
- };
2780
2755
  exports.MRT_AggregationFns = MRT_AggregationFns;
2781
2756
  exports.MRT_BottomToolbar = MRT_BottomToolbar;
2782
2757
  exports.MRT_ColumnActionMenu = MRT_ColumnActionMenu;
@@ -2834,7 +2809,6 @@ exports.MRT_ToggleRowActionMenuButton = MRT_ToggleRowActionMenuButton;
2834
2809
  exports.MRT_ToolbarAlertBanner = MRT_ToolbarAlertBanner;
2835
2810
  exports.MRT_ToolbarDropZone = MRT_ToolbarDropZone;
2836
2811
  exports.MRT_ToolbarInternalButtons = MRT_ToolbarInternalButtons;
2837
- exports.MRT_TopToolbar = MRT_TopToolbar;
2838
2812
  exports.Memo_MRT_TableBody = Memo_MRT_TableBody;
2839
2813
  exports.Memo_MRT_TableBodyCell = Memo_MRT_TableBodyCell;
2840
2814
  exports.Memo_MRT_TableBodyRow = Memo_MRT_TableBodyRow;
@@ -2743,7 +2743,6 @@ const MRT_BottomToolbar = (_a) => {
2743
2743
  }
2744
2744
  }, children: [jsx(MRT_ProgressBar, { isTopToolbar: false, table }), positionToolbarAlertBanner === "bottom" && jsx(MRT_ToolbarAlertBanner, { stackAlertBanner, table }), ["both", "bottom"].includes(positionToolbarDropZone !== null && positionToolbarDropZone !== void 0 ? positionToolbarDropZone : "") && jsx(MRT_ToolbarDropZone, { table }), jsxs(Box, { className: classes$5["custom-toolbar-container"], children: [renderBottomToolbarCustomActions ? renderBottomToolbarCustomActions({ table }) : jsx("span", {}), jsx(Box, { className: clsx(classes$5["paginator-container"], stackAlertBanner && classes$5["paginator-container-alert-banner"]), children: enablePagination && ["both", "bottom"].includes(positionPagination !== null && positionPagination !== void 0 ? positionPagination : "") && jsx(MRT_TablePagination, { position: "bottom", table }) })] })] }));
2745
2745
  };
2746
- var classes$1 = { "root": "MRT_TopToolbar-module_root__r4-V9", "root-fullscreen": "MRT_TopToolbar-module_root-fullscreen__3itT8", "actions-container": "MRT_TopToolbar-module_actions-container__-uL0u", "actions-container-stack-alert": "MRT_TopToolbar-module_actions-container-stack-alert__OYDL6" };
2747
2746
  var classes = { "root": "MRT_ToolbarInternalButtons-module_root__NKoUG" };
2748
2747
  const MRT_ToolbarInternalButtons = (_a) => {
2749
2748
  var _b;
@@ -2751,30 +2750,6 @@ const MRT_ToolbarInternalButtons = (_a) => {
2751
2750
  const { options: { columnFilterDisplayMode, enableColumnFilters, enableColumnOrdering, enableColumnPinning, enableDensityToggle, enableFilters, enableFullScreenToggle, enableGlobalFilter, enableHiding, initialState, renderToolbarInternalActions } } = table;
2752
2751
  return jsx(Flex, Object.assign({}, rest, { className: clsx("mrt-toolbar-internal-buttons", classes.root, rest === null || rest === void 0 ? void 0 : rest.className), children: (_b = renderToolbarInternalActions === null || renderToolbarInternalActions === void 0 ? void 0 : renderToolbarInternalActions({ table })) !== null && _b !== void 0 ? _b : jsxs(Fragment, { children: [enableFilters && enableGlobalFilter && !(initialState === null || initialState === void 0 ? void 0 : initialState.showGlobalFilter) && jsx(MRT_ToggleGlobalFilterButton, { table }), enableFilters && enableColumnFilters && columnFilterDisplayMode !== "popover" && jsx(MRT_ToggleFiltersButton, { table }), (enableHiding || enableColumnOrdering || enableColumnPinning) && jsx(MRT_ShowHideColumnsButton, { table }), enableDensityToggle && jsx(MRT_ToggleDensePaddingButton, { table }), enableFullScreenToggle && jsx(MRT_ToggleFullScreenButton, { table })] }) }));
2753
2752
  };
2754
- const MRT_TopToolbar = (_a) => {
2755
- var _b;
2756
- var { table } = _a, rest = __rest(_a, ["table"]);
2757
- const { getState, options: { enableGlobalFilter, enablePagination, enableToolbarInternalActions, mantineTopToolbarProps, positionGlobalFilter, positionPagination, positionToolbarAlertBanner, positionToolbarDropZone, renderTopToolbarCustomActions }, refs: { topToolbarRef } } = table;
2758
- const { isFullScreen, showGlobalFilter } = getState();
2759
- const isMobile = useMediaQuery("(max-width:720px)");
2760
- const isTablet = useMediaQuery("(max-width:1024px)");
2761
- const toolbarProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(mantineTopToolbarProps, { table })), rest);
2762
- const stackAlertBanner = isMobile || !!renderTopToolbarCustomActions || showGlobalFilter && isTablet;
2763
- const globalFilterProps = {
2764
- style: !isTablet ? {
2765
- zIndex: 3
2766
- } : void 0,
2767
- table
2768
- };
2769
- return jsxs(Box, Object.assign({}, toolbarProps, { className: clsx(commonClasses["common-toolbar-styles"], classes$1["root"], isFullScreen && classes$1["root-fullscreen"], toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.className), ref: (node) => {
2770
- if (node) {
2771
- topToolbarRef.current = node;
2772
- if (toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.ref) {
2773
- toolbarProps.ref.current = node;
2774
- }
2775
- }
2776
- }, children: [positionToolbarAlertBanner === "top" && jsx(MRT_ToolbarAlertBanner, { stackAlertBanner, table }), ["both", "top"].includes(positionToolbarDropZone !== null && positionToolbarDropZone !== void 0 ? positionToolbarDropZone : "") && jsx(MRT_ToolbarDropZone, { table }), jsxs(Flex, { className: clsx(classes$1["actions-container"], stackAlertBanner && classes$1["actions-container-stack-alert"]), children: [enableGlobalFilter && positionGlobalFilter === "left" && jsx(MRT_GlobalFilterTextInput, Object.assign({}, globalFilterProps)), (_b = renderTopToolbarCustomActions === null || renderTopToolbarCustomActions === void 0 ? void 0 : renderTopToolbarCustomActions({ table })) !== null && _b !== void 0 ? _b : jsx("span", {}), enableToolbarInternalActions ? jsxs(Flex, { justify: "end", wrap: "wrap-reverse", children: [enableGlobalFilter && positionGlobalFilter === "right" && jsx(MRT_GlobalFilterTextInput, Object.assign({}, globalFilterProps)), jsx(MRT_ToolbarInternalButtons, { table })] }) : enableGlobalFilter && positionGlobalFilter === "right" && jsx(MRT_GlobalFilterTextInput, Object.assign({}, globalFilterProps))] }), enablePagination && ["both", "top"].includes(positionPagination !== null && positionPagination !== void 0 ? positionPagination : "") && jsx(Flex, { justify: "end", children: jsx(MRT_TablePagination, { position: "top", table }) }), jsx(MRT_ProgressBar, { isTopToolbar: true, table })] }));
2777
- };
2778
2753
  export {
2779
2754
  MRT_AggregationFns,
2780
2755
  MRT_BottomToolbar,
@@ -2833,7 +2808,6 @@ export {
2833
2808
  MRT_ToolbarAlertBanner,
2834
2809
  MRT_ToolbarDropZone,
2835
2810
  MRT_ToolbarInternalButtons,
2836
- MRT_TopToolbar,
2837
2811
  Memo_MRT_TableBody,
2838
2812
  Memo_MRT_TableBodyCell,
2839
2813
  Memo_MRT_TableBodyRow,
@@ -29,7 +29,7 @@ function useToolbar(toolbar = {}, quickFilters, hideToolbar, enableAdvancedFilte
29
29
  const { info, queryParams, setQueryParams } = useApi.useApi();
30
30
  const api = useApi.useApi();
31
31
  const auth = useAuth.useAuth();
32
- const { customizer, custom, leftToolbar } = toolbar;
32
+ const { customizer, custom, leftToolbar, centerToolbar } = toolbar;
33
33
  const data = React.useMemo(() => {
34
34
  if (!quickFilters) {
35
35
  return [];
@@ -72,6 +72,7 @@ function useToolbar(toolbar = {}, quickFilters, hideToolbar, enableAdvancedFilte
72
72
  );
73
73
  return {
74
74
  renderToolbarInternalActions,
75
+ renderTopToolbarCenterActions: centerToolbar,
75
76
  enableTopToolbar: !hideToolbar,
76
77
  enableFilters: (customizer == null ? void 0 : customizer.filter) !== null,
77
78
  ...React.useMemo(() => {
@@ -7,6 +7,7 @@ const clsx = require("../../../../../.external/cjs/clsx@2.1.1/clsx/dist/clsx.cjs
7
7
  const index_esm = require("../../../../../.external/cjs/mantine-react-table@2.0.0-beta.9_@mantine_core@7.17.8_@mantine_dates@7.17.8_@mantine_hooks@7._v6brefjjgmgbqbolvm3v6bkbsa/mantine-react-table/dist/index.esm.cjs");
8
8
  const MRT_TableContainer = require("./MRT_TableContainer.cjs");
9
9
  const MRT_TablePaper_module = require("./MRT_TablePaper.module.css.cjs");
10
+ const MRT_TopToolbar = require("./MRT_TopToolbar.cjs");
10
11
  const MRT_TablePaper = ({ table, ...rest }) => {
11
12
  const {
12
13
  getState,
@@ -56,7 +57,7 @@ const MRT_TablePaper = ({ table, ...rest }) => {
56
57
  } : null
57
58
  }),
58
59
  children: [
59
- enableTopToolbar && (utils.parseFromValuesOrFunc(renderTopToolbar, { table }) ?? /* @__PURE__ */ jsxRuntime.jsx(index_esm.MRT_TopToolbar, { table })),
60
+ enableTopToolbar && (utils.parseFromValuesOrFunc(renderTopToolbar, { table }) ?? /* @__PURE__ */ jsxRuntime.jsx(MRT_TopToolbar.MRT_TopToolbar, { table })),
60
61
  /* @__PURE__ */ jsxRuntime.jsx(MRT_TableContainer.MRT_TableContainer, { table }),
61
62
  enableBottomToolbar && (utils.parseFromValuesOrFunc(renderBottomToolbar, { table }) ?? /* @__PURE__ */ jsxRuntime.jsx(index_esm.MRT_BottomToolbar, { table }))
62
63
  ]
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const utils = require("fastapi-rtk/utils");
5
+ const core = require("@mantine/core");
6
+ const hooks = require("@mantine/hooks");
7
+ const clsx = require("../../../../../.external/cjs/clsx@2.1.1/clsx/dist/clsx.cjs");
8
+ const index_esm = require("../../../../../.external/cjs/mantine-react-table@2.0.0-beta.9_@mantine_core@7.17.8_@mantine_dates@7.17.8_@mantine_hooks@7._v6brefjjgmgbqbolvm3v6bkbsa/mantine-react-table/dist/index.esm.cjs");
9
+ const common_styles_module = require("./common.styles.module.css.cjs");
10
+ const MRT_TopToolbar_module = require("./MRT_TopToolbar.module.css.cjs");
11
+ const MRT_TopToolbar = ({ table, ...rest }) => {
12
+ const {
13
+ getState,
14
+ options: {
15
+ enableGlobalFilter,
16
+ enablePagination,
17
+ enableToolbarInternalActions,
18
+ mantineTopToolbarProps,
19
+ positionGlobalFilter,
20
+ positionPagination,
21
+ positionToolbarAlertBanner,
22
+ positionToolbarDropZone,
23
+ renderTopToolbarCustomActions,
24
+ renderTopToolbarCenterActions
25
+ },
26
+ refs: { topToolbarRef }
27
+ } = table;
28
+ const { isFullScreen, showGlobalFilter } = getState();
29
+ const isMobile = hooks.useMediaQuery("(max-width:720px)");
30
+ const isTablet = hooks.useMediaQuery("(max-width:1024px)");
31
+ const toolbarProps = {
32
+ ...utils.parseFromValuesOrFunc(mantineTopToolbarProps, { table }),
33
+ ...rest
34
+ };
35
+ const stackAlertBanner = isMobile || !!renderTopToolbarCustomActions || showGlobalFilter && isTablet;
36
+ const globalFilterProps = {
37
+ style: !isTablet ? {
38
+ zIndex: 3
39
+ } : void 0,
40
+ table
41
+ };
42
+ const ActionsContainerComponent = renderTopToolbarCenterActions ? core.Group : core.Flex;
43
+ const ActionsContainerProps = renderTopToolbarCenterActions ? { grow: true } : {};
44
+ return /* @__PURE__ */ jsxRuntime.jsxs(
45
+ core.Box,
46
+ {
47
+ ...toolbarProps,
48
+ className: clsx.clsx(
49
+ common_styles_module["common-toolbar-styles"],
50
+ MRT_TopToolbar_module.default["root"],
51
+ isFullScreen && MRT_TopToolbar_module.default["root-fullscreen"],
52
+ toolbarProps == null ? void 0 : toolbarProps.className
53
+ ),
54
+ ref: (node) => {
55
+ if (node) {
56
+ topToolbarRef.current = node;
57
+ if (toolbarProps == null ? void 0 : toolbarProps.ref) {
58
+ toolbarProps.ref.current = node;
59
+ }
60
+ }
61
+ },
62
+ children: [
63
+ positionToolbarAlertBanner === "top" && /* @__PURE__ */ jsxRuntime.jsx(index_esm.MRT_ToolbarAlertBanner, { stackAlertBanner, table }),
64
+ ["both", "top"].includes(positionToolbarDropZone ?? "") && /* @__PURE__ */ jsxRuntime.jsx(index_esm.MRT_ToolbarDropZone, { table }),
65
+ /* @__PURE__ */ jsxRuntime.jsxs(
66
+ ActionsContainerComponent,
67
+ {
68
+ className: clsx.clsx(MRT_TopToolbar_module.default["actions-container"], stackAlertBanner && MRT_TopToolbar_module.default["actions-container-stack-alert"]),
69
+ ...ActionsContainerProps,
70
+ children: [
71
+ enableGlobalFilter && positionGlobalFilter === "left" && /* @__PURE__ */ jsxRuntime.jsx(index_esm.MRT_GlobalFilterTextInput, { ...globalFilterProps }),
72
+ (renderTopToolbarCustomActions == null ? void 0 : renderTopToolbarCustomActions({ table })) ?? /* @__PURE__ */ jsxRuntime.jsx("span", {}),
73
+ utils.parseFromValuesOrFunc(renderTopToolbarCenterActions, { table }),
74
+ enableToolbarInternalActions ? /* @__PURE__ */ jsxRuntime.jsxs(core.Flex, { justify: "end", wrap: "wrap-reverse", children: [
75
+ enableGlobalFilter && positionGlobalFilter === "right" && /* @__PURE__ */ jsxRuntime.jsx(index_esm.MRT_GlobalFilterTextInput, { ...globalFilterProps }),
76
+ /* @__PURE__ */ jsxRuntime.jsx(index_esm.MRT_ToolbarInternalButtons, { table })
77
+ ] }) : enableGlobalFilter && positionGlobalFilter === "right" && /* @__PURE__ */ jsxRuntime.jsx(index_esm.MRT_GlobalFilterTextInput, { ...globalFilterProps })
78
+ ]
79
+ }
80
+ ),
81
+ enablePagination && ["both", "top"].includes(positionPagination ?? "") && /* @__PURE__ */ jsxRuntime.jsx(core.Flex, { justify: "end", children: /* @__PURE__ */ jsxRuntime.jsx(index_esm.MRT_TablePagination, { position: "top", table }) }),
82
+ /* @__PURE__ */ jsxRuntime.jsx(index_esm.MRT_ProgressBar, { isTopToolbar: true, table })
83
+ ]
84
+ }
85
+ );
86
+ };
87
+ exports.MRT_TopToolbar = MRT_TopToolbar;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const root = "_root_4odg9_1";
4
+ const classes = {
5
+ root,
6
+ "root-fullscreen": "_root-fullscreen_4odg9_6",
7
+ "actions-container": "_actions-container_4odg9_11",
8
+ "actions-container-stack-alert": "_actions-container-stack-alert_4odg9_22"
9
+ };
10
+ exports.default = classes;
11
+ exports.root = root;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ const commonClasses = {
3
+ "common-toolbar-styles": "_common-toolbar-styles_1c9lk_1"
4
+ };
5
+ module.exports = commonClasses;
@@ -27,7 +27,7 @@ function useToolbar(toolbar = {}, quickFilters, hideToolbar, enableAdvancedFilte
27
27
  const { info, queryParams, setQueryParams } = useApi();
28
28
  const api = useApi();
29
29
  const auth = useAuth();
30
- const { customizer, custom, leftToolbar } = toolbar;
30
+ const { customizer, custom, leftToolbar, centerToolbar } = toolbar;
31
31
  const data = useMemo(() => {
32
32
  if (!quickFilters) {
33
33
  return [];
@@ -70,6 +70,7 @@ function useToolbar(toolbar = {}, quickFilters, hideToolbar, enableAdvancedFilte
70
70
  );
71
71
  return {
72
72
  renderToolbarInternalActions,
73
+ renderTopToolbarCenterActions: centerToolbar,
73
74
  enableTopToolbar: !hideToolbar,
74
75
  enableFilters: (customizer == null ? void 0 : customizer.filter) !== null,
75
76
  ...useMemo(() => {
@@ -2,9 +2,10 @@ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { parseFromValuesOrFunc } from "fastapi-rtk/utils";
3
3
  import { Paper } from "@mantine/core";
4
4
  import { clsx } from "../../../../../.external/esm/clsx@2.1.1/clsx/dist/clsx.mjs";
5
- import { MRT_TopToolbar, MRT_BottomToolbar } from "../../../../../.external/esm/mantine-react-table@2.0.0-beta.9_@mantine_core@7.17.8_@mantine_dates@7.17.8_@mantine_hooks@7._v6brefjjgmgbqbolvm3v6bkbsa/mantine-react-table/dist/index.esm.mjs";
5
+ import { MRT_BottomToolbar } from "../../../../../.external/esm/mantine-react-table@2.0.0-beta.9_@mantine_core@7.17.8_@mantine_dates@7.17.8_@mantine_hooks@7._v6brefjjgmgbqbolvm3v6bkbsa/mantine-react-table/dist/index.esm.mjs";
6
6
  import { MRT_TableContainer } from "./MRT_TableContainer.mjs";
7
7
  import classes from "./MRT_TablePaper.module.css.mjs";
8
+ import { MRT_TopToolbar } from "./MRT_TopToolbar.mjs";
8
9
  const MRT_TablePaper = ({ table, ...rest }) => {
9
10
  const {
10
11
  getState,
@@ -0,0 +1,87 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { parseFromValuesOrFunc } from "fastapi-rtk/utils";
3
+ import { Box, Group, Flex } from "@mantine/core";
4
+ import { useMediaQuery } from "@mantine/hooks";
5
+ import { clsx } from "../../../../../.external/esm/clsx@2.1.1/clsx/dist/clsx.mjs";
6
+ import { MRT_ToolbarAlertBanner, MRT_ToolbarDropZone, MRT_GlobalFilterTextInput, MRT_ToolbarInternalButtons, MRT_TablePagination, MRT_ProgressBar } from "../../../../../.external/esm/mantine-react-table@2.0.0-beta.9_@mantine_core@7.17.8_@mantine_dates@7.17.8_@mantine_hooks@7._v6brefjjgmgbqbolvm3v6bkbsa/mantine-react-table/dist/index.esm.mjs";
7
+ import commonClasses from "./common.styles.module.css.mjs";
8
+ import classes from "./MRT_TopToolbar.module.css.mjs";
9
+ const MRT_TopToolbar = ({ table, ...rest }) => {
10
+ const {
11
+ getState,
12
+ options: {
13
+ enableGlobalFilter,
14
+ enablePagination,
15
+ enableToolbarInternalActions,
16
+ mantineTopToolbarProps,
17
+ positionGlobalFilter,
18
+ positionPagination,
19
+ positionToolbarAlertBanner,
20
+ positionToolbarDropZone,
21
+ renderTopToolbarCustomActions,
22
+ renderTopToolbarCenterActions
23
+ },
24
+ refs: { topToolbarRef }
25
+ } = table;
26
+ const { isFullScreen, showGlobalFilter } = getState();
27
+ const isMobile = useMediaQuery("(max-width:720px)");
28
+ const isTablet = useMediaQuery("(max-width:1024px)");
29
+ const toolbarProps = {
30
+ ...parseFromValuesOrFunc(mantineTopToolbarProps, { table }),
31
+ ...rest
32
+ };
33
+ const stackAlertBanner = isMobile || !!renderTopToolbarCustomActions || showGlobalFilter && isTablet;
34
+ const globalFilterProps = {
35
+ style: !isTablet ? {
36
+ zIndex: 3
37
+ } : void 0,
38
+ table
39
+ };
40
+ const ActionsContainerComponent = renderTopToolbarCenterActions ? Group : Flex;
41
+ const ActionsContainerProps = renderTopToolbarCenterActions ? { grow: true } : {};
42
+ return /* @__PURE__ */ jsxs(
43
+ Box,
44
+ {
45
+ ...toolbarProps,
46
+ className: clsx(
47
+ commonClasses["common-toolbar-styles"],
48
+ classes["root"],
49
+ isFullScreen && classes["root-fullscreen"],
50
+ toolbarProps == null ? void 0 : toolbarProps.className
51
+ ),
52
+ ref: (node) => {
53
+ if (node) {
54
+ topToolbarRef.current = node;
55
+ if (toolbarProps == null ? void 0 : toolbarProps.ref) {
56
+ toolbarProps.ref.current = node;
57
+ }
58
+ }
59
+ },
60
+ children: [
61
+ positionToolbarAlertBanner === "top" && /* @__PURE__ */ jsx(MRT_ToolbarAlertBanner, { stackAlertBanner, table }),
62
+ ["both", "top"].includes(positionToolbarDropZone ?? "") && /* @__PURE__ */ jsx(MRT_ToolbarDropZone, { table }),
63
+ /* @__PURE__ */ jsxs(
64
+ ActionsContainerComponent,
65
+ {
66
+ className: clsx(classes["actions-container"], stackAlertBanner && classes["actions-container-stack-alert"]),
67
+ ...ActionsContainerProps,
68
+ children: [
69
+ enableGlobalFilter && positionGlobalFilter === "left" && /* @__PURE__ */ jsx(MRT_GlobalFilterTextInput, { ...globalFilterProps }),
70
+ (renderTopToolbarCustomActions == null ? void 0 : renderTopToolbarCustomActions({ table })) ?? /* @__PURE__ */ jsx("span", {}),
71
+ parseFromValuesOrFunc(renderTopToolbarCenterActions, { table }),
72
+ enableToolbarInternalActions ? /* @__PURE__ */ jsxs(Flex, { justify: "end", wrap: "wrap-reverse", children: [
73
+ enableGlobalFilter && positionGlobalFilter === "right" && /* @__PURE__ */ jsx(MRT_GlobalFilterTextInput, { ...globalFilterProps }),
74
+ /* @__PURE__ */ jsx(MRT_ToolbarInternalButtons, { table })
75
+ ] }) : enableGlobalFilter && positionGlobalFilter === "right" && /* @__PURE__ */ jsx(MRT_GlobalFilterTextInput, { ...globalFilterProps })
76
+ ]
77
+ }
78
+ ),
79
+ enablePagination && ["both", "top"].includes(positionPagination ?? "") && /* @__PURE__ */ jsx(Flex, { justify: "end", children: /* @__PURE__ */ jsx(MRT_TablePagination, { position: "top", table }) }),
80
+ /* @__PURE__ */ jsx(MRT_ProgressBar, { isTopToolbar: true, table })
81
+ ]
82
+ }
83
+ );
84
+ };
85
+ export {
86
+ MRT_TopToolbar
87
+ };
@@ -0,0 +1,11 @@
1
+ const root = "_root_4odg9_1";
2
+ const classes = {
3
+ root,
4
+ "root-fullscreen": "_root-fullscreen_4odg9_6",
5
+ "actions-container": "_actions-container_4odg9_11",
6
+ "actions-container-stack-alert": "_actions-container-stack-alert_4odg9_22"
7
+ };
8
+ export {
9
+ classes as default,
10
+ root
11
+ };
@@ -0,0 +1,6 @@
1
+ const commonClasses = {
2
+ "common-toolbar-styles": "_common-toolbar-styles_1c9lk_1"
3
+ };
4
+ export {
5
+ commonClasses as default
6
+ };
@@ -4,6 +4,7 @@ export function useToolbar(toolbar: {}, quickFilters: any, hideToolbar: any, ena
4
4
  renderToolbarInternalActions: ({ table }: {
5
5
  table: any;
6
6
  }) => import("react").JSX.Element;
7
+ renderTopToolbarCenterActions: any;
7
8
  enableTopToolbar: boolean;
8
9
  enableFilters: boolean;
9
10
  };
@@ -0,0 +1,4 @@
1
+ export function MRT_TopToolbar({ table, ...rest }: {
2
+ [x: string]: any;
3
+ table: any;
4
+ }): import("react").JSX.Element;
@@ -1600,3 +1600,37 @@
1600
1600
  overflow: hidden;
1601
1601
  transition: all 150ms ease-in-out;
1602
1602
  }
1603
+ ._common-toolbar-styles_1c9lk_1 {
1604
+ align-items: flex-start;
1605
+ display: grid;
1606
+ flex-wrap: wrap-reverse;
1607
+ min-height: calc(3.5rem * var(--mantine-scale));
1608
+ overflow: visible;
1609
+ padding: 0;
1610
+ transition: all 150ms ease-in-out;
1611
+ z-index: 3;
1612
+ }
1613
+ ._root_4odg9_1 {
1614
+ background-color: var(--mrt-base-background-color);
1615
+ position: relative;
1616
+ }
1617
+
1618
+ ._root-fullscreen_4odg9_6 {
1619
+ position: sticky !important;
1620
+ top: 0;
1621
+ }
1622
+
1623
+ ._actions-container_4odg9_11 {
1624
+ align-items: flex-start;
1625
+ box-sizing: border-box;
1626
+ justify-content: space-between;
1627
+ padding: calc(0.5rem * var(--mantine-scale));
1628
+ right: 0;
1629
+ top: 0;
1630
+ width: 100%;
1631
+ position: absolute;
1632
+ }
1633
+
1634
+ ._actions-container-stack-alert_4odg9_22 {
1635
+ position: relative !important;
1636
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fastapi-rtk",
3
- "version": "0.2.62",
3
+ "version": "1.0.0",
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",