Skip to content

Commit

Permalink
feat: add more export module which easy to fork ListTable
Browse files Browse the repository at this point in the history
  • Loading branch information
moonrailgun committed Sep 9, 2023
1 parent 76e1c24 commit 1d27070
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/tushan-laf-json-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"prepare": "tsc",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"keywords": ["tushan", "laf", "json", "server"],
"author": "moonrailgun <[email protected]>",
"license": "MIT",
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/tushan/client/components/list/ListTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
import { ListExportAction } from './actions/ExportAction';
import { useTranslation } from 'react-i18next';
import { useListTableDrawer } from './useListTableDrawer';
import { useColumns } from './useColumns';
import { useListTableColumns } from './useColumns';
import { ListRefreshAction } from './actions/RefreshAction';
import { ListBatchDeleteAction } from './actions/BatchDeleteAction';
import { useUrlState } from '../../hooks/useUrlState';
Expand Down Expand Up @@ -126,7 +126,7 @@ export const ListTable: React.FC<ListTableProps> = React.memo((props) => {
const filterFields = props.filter ?? [];
const [selectedRowKeys, setSelectedRowKeys] = useState<Identifier[]>([]);

const columns = useColumns(props, showTableDrawer);
const columns = useListTableColumns(props, showTableDrawer);

const hasHeader =
filterFields.length > 0 ||
Expand Down
5 changes: 4 additions & 1 deletion packages/tushan/client/components/list/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
export * from './ListTable';
export * from './context';
export * from './ListTable';
export * from './ListFilter';
export * from './ListTableDrawer';
export * from './useColumns';
4 changes: 2 additions & 2 deletions packages/tushan/client/components/list/useColumns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { useTranslation } from '../../i18n';
import { ListDeleteAction } from './actions/DeleteAction';
import type { ListTableCustomAction, ListTableProps } from './ListTable';

export function useColumns(
export function useListTableColumns(
props: ListTableProps,
showTableDrawer: (viewType: ViewType, record: BasicRecord) => void
) {
Expand Down Expand Up @@ -68,7 +68,7 @@ export function useColumns(
return columns;
}

export const CustomActions: React.FC<{
const CustomActions: React.FC<{
actions: ListTableCustomAction;
record: BasicRecord;
}> = React.memo((props) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/tushan/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tushan",
"version": "0.3.5",
"version": "0.3.6",
"description": "",
"main": "./index.ts",
"scripts": {
Expand All @@ -18,7 +18,7 @@
"tsconfig.json",
"README.md"
],
"keywords": ["react-admin", "react", "admin", "adminjs", "admin.js"],
"keywords": ["tushan", "react-admin", "react", "admin", "adminjs", "admin.js"],
"author": "moonrailgun <[email protected]>",
"license": "MIT",
"devDependencies": {
Expand Down

0 comments on commit 1d27070

Please sign in to comment.