@bsol-oss/react-datatable5 1.0.10 → 1.0.11
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 +2 -2
- package/dist/index.js +1 -1
- package/dist/index.mjs +2 -2
- package/dist/types/components/DataTable.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
import { ReactNode } from 'react';
|
|
4
3
|
import { ColumnDef } from '@tanstack/react-table';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
5
|
import * as _tanstack_table_core from '@tanstack/table-core';
|
|
6
6
|
|
|
7
7
|
interface DataTableProps<T> {
|
|
8
|
-
children:
|
|
8
|
+
children: JSX.Element | JSX.Element[];
|
|
9
9
|
url: string;
|
|
10
10
|
columns: ColumnDef<T, unknown>[];
|
|
11
11
|
enableRowSelection?: boolean;
|
package/dist/index.js
CHANGED
|
@@ -171,7 +171,7 @@ const EditSortingButton = () => {
|
|
|
171
171
|
|
|
172
172
|
const PageSizeControl = ({ pageSizes = [10, 20, 30, 40, 50], }) => {
|
|
173
173
|
const { table } = react.useContext(TableContext);
|
|
174
|
-
return (jsxRuntime.jsx(
|
|
174
|
+
return (jsxRuntime.jsx(react$1.Select, { value: table.getState().pagination.pageSize, onChange: (e) => {
|
|
175
175
|
table.setPageSize(Number(e.target.value));
|
|
176
176
|
}, children: pageSizes.map((pageSize) => (jsxRuntime.jsx("option", { value: pageSize, children: pageSize }, pageSize))) }));
|
|
177
177
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
2
2
|
import { createContext, useState, useEffect, useContext } from 'react';
|
|
3
3
|
import { useReactTable, getCoreRowModel, flexRender } from '@tanstack/react-table';
|
|
4
4
|
import axios from 'axios';
|
|
5
|
-
import { Popover, PopoverTrigger, IconButton, PopoverContent, PopoverArrow, PopoverBody, Flex, FormControl, Checkbox, Button, Box, Text, Input, Tooltip, Container, Table as Table$1, Grid, Card, CardBody, Tfoot, Tr as Tr$1, Th, Thead, ButtonGroup } from '@chakra-ui/react';
|
|
5
|
+
import { Popover, PopoverTrigger, IconButton, PopoverContent, PopoverArrow, PopoverBody, Flex, FormControl, Checkbox, Button, Box, Text, Input, Tooltip, Select, Container, Table as Table$1, Grid, Card, CardBody, Tfoot, Tr as Tr$1, Th, Thead, ButtonGroup } from '@chakra-ui/react';
|
|
6
6
|
import { IoMdEye } from 'react-icons/io';
|
|
7
7
|
import { MdFilterAlt, MdOutlineSort, MdFilterListAlt, MdFirstPage, MdArrowBack, MdArrowForward, MdLastPage } from 'react-icons/md';
|
|
8
8
|
import { ChevronUpIcon, UpDownIcon, ChevronDownIcon, CloseIcon } from '@chakra-ui/icons';
|
|
@@ -169,7 +169,7 @@ const EditSortingButton = () => {
|
|
|
169
169
|
|
|
170
170
|
const PageSizeControl = ({ pageSizes = [10, 20, 30, 40, 50], }) => {
|
|
171
171
|
const { table } = useContext(TableContext);
|
|
172
|
-
return (jsx(
|
|
172
|
+
return (jsx(Select, { value: table.getState().pagination.pageSize, onChange: (e) => {
|
|
173
173
|
table.setPageSize(Number(e.target.value));
|
|
174
174
|
}, children: pageSizes.map((pageSize) => (jsx("option", { value: pageSize, children: pageSize }, pageSize))) }));
|
|
175
175
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { ColumnDef } from "@tanstack/react-table";
|
|
3
3
|
export interface DataTableProps<T> {
|
|
4
|
-
children:
|
|
4
|
+
children: JSX.Element | JSX.Element[];
|
|
5
5
|
url: string;
|
|
6
6
|
columns: ColumnDef<T, unknown>[];
|
|
7
7
|
enableRowSelection?: boolean;
|