Skip to content

Commit

Permalink
package and lint upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinVandy committed Jul 17, 2024
1 parent 5e036c2 commit 0e635f8
Show file tree
Hide file tree
Showing 22 changed files with 1,839 additions and 3,098 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const localeStringOptions = {
currency: 'USD',
minimumFractionDigits: 0,
maximumFractionDigits: 0,
};
} as const;

const Example = () => {
const columns = useMemo<MRT_ColumnDef<Person>[]>(
Expand Down
40 changes: 20 additions & 20 deletions apps/mantine-react-table-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,46 +13,46 @@
"sitemap": "pnpm docs:sitemap"
},
"dependencies": {
"@docsearch/js": "3.6.0",
"@docsearch/js": "3.6.1",
"@faker-js/faker": "^8.4.1",
"@fortawesome/fontawesome-svg-core": "^6.5.2",
"@fortawesome/free-solid-svg-icons": "^6.5.2",
"@fortawesome/fontawesome-svg-core": "^6.6.0",
"@fortawesome/free-solid-svg-icons": "^6.6.0",
"@fortawesome/react-fontawesome": "^0.2.2",
"@mantine/code-highlight": "7.10.1",
"@mantine/core": "7.10.1",
"@mantine/dates": "7.10.1",
"@mantine/hooks": "7.10.1",
"@mantine/modals": "7.10.1",
"@mantine/code-highlight": "7.11.2",
"@mantine/core": "7.11.2",
"@mantine/dates": "7.11.2",
"@mantine/hooks": "7.11.2",
"@mantine/modals": "7.11.2",
"@mdx-js/loader": "^3.0.1",
"@mdx-js/react": "^3.0.1",
"@next/mdx": "^14.2.4",
"@tabler/icons-react": "3.5.0",
"@tanstack/react-query": "^5.45.0",
"@next/mdx": "^14.2.5",
"@tabler/icons-react": "3.11.0",
"@tanstack/react-query": "^5.51.5",
"@types/mdx": "^2.0.13",
"clsx": "^2.1.1",
"dayjs": "^1.11.11",
"export-to-csv": "^1.3.0",
"jspdf": "^2.5.1",
"jspdf-autotable": "^3.8.2",
"mantine-react-table": "workspace:*",
"next": "14.2.4",
"next": "14.2.5",
"next-sitemap": "^4.2.3",
"react": "18.3.1",
"react-dom": "18.3.1"
},
"devDependencies": {
"@types/node": "^20.14.2",
"@types/node": "^20.14.11",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^7.13.0",
"@typescript-eslint/parser": "^7.13.0",
"eslint": "9.4.0",
"eslint-config-next": "14.2.4",
"@typescript-eslint/eslint-plugin": "^7.16.1",
"@typescript-eslint/parser": "^7.16.1",
"eslint": "9.7.0",
"eslint-config-next": "14.2.5",
"next-plausible": "^3.12.0",
"postcss": "^8.4.38",
"postcss-preset-mantine": "^1.15.0",
"postcss": "^8.4.39",
"postcss-preset-mantine": "^1.16.0",
"postcss-simple-vars": "^7.0.1",
"raw-loader": "^4.0.2",
"typescript": "5.4.5"
"typescript": "5.5.3"
}
}
200 changes: 100 additions & 100 deletions apps/mantine-react-table-docs/public/sitemap-0.xml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"storybook:dev": "turbo run storybook"
},
"devDependencies": {
"prettier": "^3.3.2",
"turbo": "^2.0.3"
"prettier": "^3.3.3",
"turbo": "^2.0.7"
},
"engines": {
"node": ">=16.0.0"
Expand Down
56 changes: 28 additions & 28 deletions packages/mantine-react-table/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,63 +79,63 @@
"storybook:dev": "storybook dev -p 6007"
},
"devDependencies": {
"@babel/core": "^7.24.7",
"@babel/core": "^7.24.9",
"@babel/preset-react": "^7.24.7",
"@faker-js/faker": "^8.4.1",
"@mantine/core": "7.10.1",
"@mantine/dates": "7.10.1",
"@mantine/hooks": "7.10.1",
"@mantine/core": "7.11.2",
"@mantine/dates": "7.11.2",
"@mantine/hooks": "7.11.2",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-typescript": "^11.1.6",
"@size-limit/preset-small-lib": "^11.1.4",
"@storybook/addon-a11y": "^8.1.7",
"@storybook/addon-essentials": "^8.1.7",
"@storybook/addon-interactions": "^8.1.7",
"@storybook/addon-links": "^8.1.7",
"@storybook/addon-storysource": "^8.1.7",
"@storybook/blocks": "^8.1.7",
"@storybook/preview-api": "^8.1.7",
"@storybook/react": "^8.1.7",
"@storybook/react-vite": "^8.1.7",
"@storybook/addon-a11y": "^8.2.4",
"@storybook/addon-essentials": "^8.2.4",
"@storybook/addon-interactions": "^8.2.4",
"@storybook/addon-links": "^8.2.4",
"@storybook/addon-storysource": "^8.2.4",
"@storybook/blocks": "^8.2.4",
"@storybook/preview-api": "^8.2.4",
"@storybook/react": "^8.2.4",
"@storybook/react-vite": "^8.2.4",
"@storybook/testing-library": "^0.2.2",
"@tabler/icons-react": "3.5.0",
"@types/node": "^20.14.2",
"@tabler/icons-react": "3.11.0",
"@types/node": "^20.14.11",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^7.13.0",
"@typescript-eslint/parser": "^7.13.0",
"@typescript-eslint/eslint-plugin": "^7.16.1",
"@typescript-eslint/parser": "^7.16.1",
"@vitejs/plugin-react": "^4.3.1",
"clsx": "^2.1.1",
"dayjs": "^1.11.11",
"eslint": "^9.4.0",
"eslint": "^9.7.0",
"eslint-plugin-perfectionist": "^2.11.0",
"mantine-contextmenu": "^7.10.1",
"postcss": "^8.4.38",
"postcss-preset-mantine": "^1.15.0",
"mantine-contextmenu": "^7.11.2",
"postcss": "^8.4.39",
"postcss-preset-mantine": "^1.16.0",
"postcss-simple-vars": "^7.0.1",
"prop-types": "^15.8.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-is": "^18.3.1",
"rollup": "^4.18.0",
"rollup": "^4.18.1",
"rollup-plugin-copy": "^3.5.0",
"rollup-plugin-delete": "^2.0.0",
"rollup-plugin-dts": "^6.1.1",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-postcss": "^4.0.2",
"size-limit": "^11.1.4",
"storybook": "^8.1.7",
"storybook-dark-mode": "^4.0.1",
"storybook": "^8.2.4",
"storybook-dark-mode": "^4.0.2",
"tslib": "^2.6.3",
"typescript": "^5.4.5",
"typescript": "^5.5.3",
"typescript-plugin-css-modules": "^5.1.0",
"vite": "^5.2.13"
"vite": "^5.3.4"
},
"dependencies": {
"@tanstack/match-sorter-utils": "8.15.1",
"@tanstack/react-table": "8.17.3",
"@tanstack/react-virtual": "3.5.1"
"@tanstack/react-table": "8.19.3",
"@tanstack/react-virtual": "3.8.3"
},
"peerDependencies": {
"@mantine/core": "^7.9",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export const MRT_TableBodyCell = <TData extends MRT_RowData>({
{tableCellProps.children ?? (
<>
{cell.getIsPlaceholder() ? (
columnDef.PlaceholderCell?.({ cell, column, row, table }) ?? null
(columnDef.PlaceholderCell?.({ cell, column, row, table }) ?? null)
) : showSkeletons !== false && (isLoading || showSkeletons) ? (
<Skeleton height={20} width={skeletonWidth} {...skeletonProps} />
) : columnDefType === 'display' &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const MRT_ExpandAllButton = <TData extends MRT_RowData>({
return (
<Tooltip
label={
actionIconProps?.title ?? isAllRowsExpanded
(actionIconProps?.title ?? isAllRowsExpanded)
? localization.collapseAll
: localization.expandAll
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const MRT_ExpandButton = <TData extends MRT_RowData>({
<Tooltip
disabled={!canExpand && !DetailPanel}
label={
actionIconProps?.title ?? isExpanded
(actionIconProps?.title ?? isExpanded)
? localization.collapse
: localization.expand
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ export const MRT_TableFooterCell = <TData extends MRT_RowData>({
{tableCellProps.children ??
(footer.isPlaceholder
? null
: parseFromValuesOrFunc(columnDef.Footer, {
: (parseFromValuesOrFunc(columnDef.Footer, {
column,
footer,
table,
}) ??
columnDef.footer ??
null)}
null))}
</TableTh>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export const MRT_TableHeadCell = <TData extends MRT_RowData>({
header,
table,
})
: columnDef?.Header ?? (columnDef.header as ReactNode);
: (columnDef?.Header ?? (columnDef.header as ReactNode));

return (
<TableTh
Expand Down Expand Up @@ -215,7 +215,7 @@ export const MRT_TableHeadCell = <TData extends MRT_RowData>({
>
{header.isPlaceholder
? null
: tableCellProps.children ?? (
: (tableCellProps.children ?? (
<Flex
className={clsx(
'mrt-table-head-cell-content',
Expand Down Expand Up @@ -299,7 +299,7 @@ export const MRT_TableHeadCell = <TData extends MRT_RowData>({
<MRT_TableHeadCellResizeHandle header={header} table={table} />
)}
</Flex>
)}
))}
{columnFilterDisplayMode === 'subheader' && column.getCanFilter() && (
<MRT_TableHeadCellFilterContainer header={header} table={table} />
)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { type FocusEvent, type KeyboardEvent, useState } from 'react';
import {
import {
MultiSelect,
Select,
TextInput,
type TextInputProps,
type SelectProps,
type MultiSelectProps
type MultiSelectProps,
} from '@mantine/core';
import {
type HTMLPropsRef,
Expand All @@ -16,7 +16,6 @@ import {
} from '../../types';
import { parseFromValuesOrFunc } from '../../utils/utils';


interface PropsTextInput<TData extends MRT_RowData, TValue = MRT_CellValue>
extends TextInputProps {
cell: MRT_Cell<TData, TValue>;
Expand All @@ -35,9 +34,9 @@ interface PropsMultiSelect<TData extends MRT_RowData, TValue = MRT_CellValue>
table: MRT_TableInstance<TData>;
}

type MRT_TextInputProps = TextInputProps & HTMLPropsRef<HTMLInputElement>
type MRT_SelectProps = SelectProps & HTMLPropsRef<HTMLInputElement>
type MRT_MultiSelectProps = MultiSelectProps & HTMLPropsRef<HTMLInputElement>
type MRT_TextInputProps = TextInputProps & HTMLPropsRef<HTMLInputElement>;
type MRT_SelectProps = SelectProps & HTMLPropsRef<HTMLInputElement>;
type MRT_MultiSelectProps = MultiSelectProps & HTMLPropsRef<HTMLInputElement>;

export const MRT_EditCellTextInput = <TData extends MRT_RowData>({
cell,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const MRT_FilterRangeSlider = <TData extends MRT_RowData>({
let [min, max] =
rangeSliderProps.min !== undefined && rangeSliderProps.max !== undefined
? [rangeSliderProps.min, rangeSliderProps.max]
: column.getFacetedMinMaxValues() ?? [0, 1];
: (column.getFacetedMinMaxValues() ?? [0, 1]);

//fix potential TanStack Table bugs where min or max is an array
if (Array.isArray(min)) min = min[0];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,11 @@ export const MRT_FilterTextInput = <TData extends MRT_RowData>({
? localizedFilterOption(localization, currentFilterOption)
: '';
const filterPlaceholder = !isRangeFilter
? textInputProps?.placeholder ??
localization.filterByColumn?.replace('{column}', String(columnDef.header))
? (textInputProps?.placeholder ??
localization.filterByColumn?.replace(
'{column}',
String(columnDef.header),
))
: rangeFilterIndex === 0
? localization.min
: rangeFilterIndex === 1
Expand Down Expand Up @@ -144,7 +147,7 @@ export const MRT_FilterTextInput = <TData extends MRT_RowData>({
? (column.getFilterValue() as [string, string])?.[
rangeFilterIndex as number
] || ''
: (column.getFilterValue() as string) ?? '',
: ((column.getFilterValue() as string) ?? ''),
);

const [debouncedFilterValue] = useDebouncedValue(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export const MRT_FilterOptionMenu = <TData extends MRT_RowData>({
return (
<Menu.Dropdown>
{(header && column && columnDef
? columnDef.renderColumnFilterModeMenuItems?.({
? (columnDef.renderColumnFilterModeMenuItems?.({
column: column as any,
internalFilterOptions,
onSelectFilterMode: handleSelectFilterMode,
Expand All @@ -239,7 +239,7 @@ export const MRT_FilterOptionMenu = <TData extends MRT_RowData>({
internalFilterOptions,
onSelectFilterMode: handleSelectFilterMode,
table,
})
}))
: renderGlobalFilterModeMenuItems?.({
internalFilterOptions,
onSelectFilterMode: handleSelectFilterMode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ export const MRT_TableContainer = <TData extends MRT_RowData>({
useIsomorphicLayoutEffect(() => {
const topToolbarHeight =
typeof document !== 'undefined'
? topToolbarRef.current?.offsetHeight ?? 0
? (topToolbarRef.current?.offsetHeight ?? 0)
: 0;

const bottomToolbarHeight =
typeof document !== 'undefined'
? bottomToolbarRef?.current?.offsetHeight ?? 0
? (bottomToolbarRef?.current?.offsetHeight ?? 0)
: 0;

setTotalToolbarHeight(topToolbarHeight + bottomToolbarHeight);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const getMRT_RowExpandColumnDef = <TData extends MRT_RowData>(
id: 'mrt-row-expand',
size:
groupedColumnMode === 'remove'
? defaultColumn?.size ?? 180
? (defaultColumn?.size ?? 180)
: renderDetailPanel
? enableExpandAll
? 60
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const useMRT_ColumnVirtualizer = <
}) as unknown as MRT_ColumnVirtualizer<TScrollElement, TItemElement>;

const virtualColumns = columnVirtualizer.getVirtualItems();
columnVirtualizer.virtualColumns = virtualColumns;
columnVirtualizer.virtualColumns = virtualColumns as any;
const numColumns = virtualColumns.length;

if (numColumns) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const useMRT_RowVirtualizer = <
...rowVirtualizerProps,
}) as unknown as MRT_RowVirtualizer<TScrollElement, TItemElement>;

rowVirtualizer.virtualRows = rowVirtualizer.getVirtualItems();
rowVirtualizer.virtualRows = rowVirtualizer.getVirtualItems() as any;

if (rowVirtualizerInstanceRef) {
//@ts-ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ export const useMRT_TableInstance = <TData extends MRT_RowData>(
).map((col) => ({
[getColumnId(col)]:
col.filterFn instanceof Function
? col.filterFn.name ?? 'custom'
: col.filterFn ??
? (col.filterFn.name ?? 'custom')
: (col.filterFn ??
initialState?.columnFilterFns?.[getColumnId(col)] ??
getDefaultColumnFilterFn(col),
getDefaultColumnFilterFn(col)),
})),
),
);
Expand Down
3 changes: 2 additions & 1 deletion packages/mantine-react-table/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ export type MRT_PaginationState = PaginationState;
export type MRT_RowSelectionState = RowSelectionState;
export type MRT_SortingState = SortingState;
export type MRT_Updater<T> = Updater<T>;
export type MRT_VirtualItem = VirtualItem;
export type MRT_VirtualItem<T extends Element = HTMLTableRowElement> =
VirtualItem<T>;
export type MRT_VisibilityState = VisibilityState;

export type MRT_VirtualizerOptions<
Expand Down
Loading

0 comments on commit 0e635f8

Please sign in to comment.