Skip to content

Commit

Permalink
chore: remove deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
l1xnan committed Jul 1, 2024
1 parent d34aa64 commit 51ffb83
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 364 deletions.
179 changes: 0 additions & 179 deletions src/components/tables/AgTable.tsx

This file was deleted.

20 changes: 17 additions & 3 deletions src/components/tables/CanvasTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,29 @@ import React, { useEffect, useMemo, useRef, useState } from 'react';

import dayjs from 'dayjs';
import type { ComponentProps } from 'react';
import { CSSProperties } from 'react';

import { OrderByType, SchemaType } from '@/stores/dataset';

import { TableProps } from '@/components/tables/AgTable';
import { useTheme } from '@/hooks/theme-provider';
import { tableFontFamilyAtom } from '@/stores/setting';
import { isDarkTheme, isNumberType, uniqueArray } from '@/utils';
import { assign } from 'radash';

type ITableThemeDefine = ComponentProps<typeof ListTable>['theme'];

export interface TableProps<T = unknown> {
data: T[];
schema: SchemaType[];
beautify?: boolean;
precision?: number;
style?: CSSProperties;
orderBy?: OrderByType;
transpose?: boolean;
cross?: boolean;
onSelectedCell?: (value: unknown) => void;
}

const LIGHT_THEME: ITableThemeDefine = {
defaultStyle: {
borderColor: '#f2f2f2',
Expand Down Expand Up @@ -145,7 +159,7 @@ function useTableTheme(transpose?: boolean) {
const [baseTheme, colorTheme] = isDarkTheme(appTheme)
? [themes.DARK, DARK_THEME]
: [themes.ARCO, LIGHT_THEME];
return baseTheme.extends(assign(common, colorTheme as Object));
return baseTheme.extends(assign(common, colorTheme as object));
}, [appTheme, transpose]);

return theme;
Expand Down Expand Up @@ -401,7 +415,7 @@ export const CanvasTable = React.memo(function CanvasTable({
cross,
],
);
console.log("cross:", cross);
console.log('cross:', cross);
return (
<div
className="h-full select-text"
Expand Down
141 changes: 0 additions & 141 deletions src/components/tables/HeaderCell.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/tables/index.tsx
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { CanvasTable } from './CanvasTable';
export { AgTable } from './AgTable';

Loading

0 comments on commit 51ffb83

Please sign in to comment.