refine-mantine 1.1.0 → 1.2.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.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ActionIconProps, AppShellFooterProps, AppShellHeaderProps, AppShellMainProps, AppShellNavbarConfiguration, AppShellNavbarProps, AppShellProps, AppShellSectionProps, BadgeProps, BoxProps, BreadcrumbsProps, ButtonProps, CardProps, GroupProps, LoadingOverlayProps, MenuItemProps, NotificationProps, PinInputProps, PopoverProps, ScrollAreaProps, StackProps, TextInputProps } from "@mantine/core";
1
+ import { ActionIconProps, AppShellFooterProps, AppShellHeaderProps, AppShellMainProps, AppShellNavbarConfiguration, AppShellNavbarProps, AppShellProps, AppShellSectionProps, BadgeProps, BoxProps, BreadcrumbsProps, ButtonProps, CardProps, GroupProps, LoadingOverlayProps, MenuItemProps, NotificationProps, PinInputProps, PopoverProps, ScrollAreaProps, StackProps, TableProps, TextInputProps } from "@mantine/core";
2
2
  import { AuthProvider, AutoSaveIndicatorProps as AutoSaveIndicatorProps$1, BaseRecord, HttpError, LoginFormTypes, NotificationProvider, OAuthProvider, RegisterFormTypes, UseFormProps as UseFormProps$1, UseFormReturnType as UseFormReturnType$1, useMenu, useTranslate } from "@refinedev/core";
3
3
  import { IconProps } from "@tabler/icons-react";
4
4
  import * as react_jsx_runtime0 from "react/jsx-runtime";
@@ -153,9 +153,11 @@ declare const ColumnSorter: <T extends object>(p: {
153
153
  //#endregion
154
154
  //#region src/components/table/Table.d.ts
155
155
  declare const Table: <TData extends BaseRecord = BaseRecord, TError extends HttpError = HttpError>({
156
- props
156
+ props,
157
+ tableProps
157
158
  }: {
158
159
  props: UseTableReturnType<TData, TError>;
160
+ tableProps?: TableProps;
159
161
  }) => react_jsx_runtime0.JSX.Element;
160
162
  //#endregion
161
163
  //#region src/components/notification/AutoSaveIndicator.d.ts
package/dist/index.js CHANGED
@@ -1077,19 +1077,25 @@ const ColumnSorter = (p) => {
1077
1077
 
1078
1078
  //#endregion
1079
1079
  //#region src/components/table/Table.tsx
1080
- const Table = ({ props }) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Table$1.ScrollContainer, {
1080
+ const Table = ({ props, tableProps }) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Table$1.ScrollContainer, {
1081
1081
  minWidth: 500,
1082
1082
  children: /* @__PURE__ */ jsxs(Table$1, {
1083
1083
  highlightOnHover: true,
1084
- children: [/* @__PURE__ */ jsx(Table$1.Thead, { children: props.reactTable.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx(Table$1.Tr, { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx(Table$1.Th, { children: !header.isPlaceholder && /* @__PURE__ */ jsxs(Group, {
1085
- gap: "xs",
1086
- wrap: "nowrap",
1087
- children: [/* @__PURE__ */ jsx(Box, { children: flexRender(header.column.columnDef.header, header.getContext()) }), /* @__PURE__ */ jsxs(Group, {
1084
+ ...tableProps,
1085
+ children: [/* @__PURE__ */ jsx(Table$1.Thead, { children: props.reactTable.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx(Table$1.Tr, { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx(Table$1.Th, {
1086
+ colSpan: header.colSpan,
1087
+ rowSpan: header.rowSpan,
1088
+ style: { width: header.getSize() },
1089
+ children: !header.isPlaceholder && /* @__PURE__ */ jsxs(Group, {
1088
1090
  gap: "xs",
1089
1091
  wrap: "nowrap",
1090
- children: [/* @__PURE__ */ jsx(ColumnSorter, { column: header.column }), /* @__PURE__ */ jsx(ColumnFilter, { column: header.column })]
1091
- })]
1092
- }) }, header.id)) }, headerGroup.id)) }), /* @__PURE__ */ jsx(Table$1.Tbody, { children: props.reactTable.getRowModel().rows.map((row) => /* @__PURE__ */ jsx(Table$1.Tr, { children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx(Table$1.Td, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) })]
1092
+ children: [/* @__PURE__ */ jsx(Box, { children: flexRender(header.column.columnDef.header, header.getContext()) }), /* @__PURE__ */ jsxs(Group, {
1093
+ gap: "xs",
1094
+ wrap: "nowrap",
1095
+ children: [/* @__PURE__ */ jsx(ColumnSorter, { column: header.column }), /* @__PURE__ */ jsx(ColumnFilter, { column: header.column })]
1096
+ })]
1097
+ })
1098
+ }, header.id)) }, headerGroup.id)) }), /* @__PURE__ */ jsx(Table$1.Tbody, { children: props.reactTable.getRowModel().rows.map((row) => /* @__PURE__ */ jsx(Table$1.Tr, { children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx(Table$1.Td, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) })]
1093
1099
  })
1094
1100
  }), /* @__PURE__ */ jsx(Group, {
1095
1101
  justify: "flex-end",
package/package.json CHANGED
@@ -87,5 +87,5 @@
87
87
  "dependencies": {
88
88
  "@refinedev/ui-types": "^2.0.1"
89
89
  },
90
- "version": "1.1.0"
90
+ "version": "1.2.0"
91
91
  }
@@ -49,7 +49,6 @@ export const Default = () => {
49
49
  onChange: (value: string | null) => void;
50
50
  }) => (
51
51
  <Select
52
- label="Category"
53
52
  data={categories.options}
54
53
  value={p.value ?? null}
55
54
  onChange={p.onChange}
@@ -1,4 +1,4 @@
1
- import { Box, Group, Table as MantineTable, Pagination } from "@mantine/core";
1
+ import { Box, Group, Table as MantineTable, Pagination, TableProps } from "@mantine/core";
2
2
  import type { BaseRecord, HttpError } from "@refinedev/core";
3
3
  import type { UseTableReturnType } from "@refinedev/react-table";
4
4
  import { flexRender } from "@tanstack/react-table";
@@ -10,17 +10,24 @@ export const Table = <
10
10
  TError extends HttpError = HttpError,
11
11
  >({
12
12
  props,
13
+ tableProps,
13
14
  }: {
14
15
  props: UseTableReturnType<TData, TError>;
16
+ tableProps?: TableProps;
15
17
  }) => (
16
18
  <>
17
19
  <MantineTable.ScrollContainer minWidth={500}>
18
- <MantineTable highlightOnHover>
20
+ <MantineTable highlightOnHover {...tableProps}>
19
21
  <MantineTable.Thead>
20
22
  {props.reactTable.getHeaderGroups().map((headerGroup) => (
21
23
  <MantineTable.Tr key={headerGroup.id}>
22
24
  {headerGroup.headers.map((header) => (
23
- <MantineTable.Th key={header.id}>
25
+ <MantineTable.Th
26
+ key={header.id}
27
+ colSpan={header.colSpan}
28
+ rowSpan={header.rowSpan}
29
+ style={{width: header.getSize()}}
30
+ >
24
31
  {!header.isPlaceholder && (
25
32
  <Group gap="xs" wrap="nowrap">
26
33
  <Box>