|
|
@ -2,6 +2,7 @@ import React, { useMemo, useState } from "react"; |
|
|
|
|
|
|
|
|
|
|
|
import "./index.scss"; |
|
|
|
import "./index.scss"; |
|
|
|
import { ColumnSearch } from "./ColumnSearch.js"; |
|
|
|
import { ColumnSearch } from "./ColumnSearch.js"; |
|
|
|
|
|
|
|
import { ToggleColumns } from "./ToggleColumns.js"; |
|
|
|
import { Tabbar } from "./index"; |
|
|
|
import { Tabbar } from "./index"; |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
import { |
|
|
@ -29,9 +30,6 @@ const BasicTable = ({ settingsIcon }) => { |
|
|
|
const columns = React.useMemo(() => COLUMNS, []); |
|
|
|
const columns = React.useMemo(() => COLUMNS, []); |
|
|
|
const data = useMemo(() => MOCK_DATA, []); |
|
|
|
const data = useMemo(() => MOCK_DATA, []); |
|
|
|
|
|
|
|
|
|
|
|
//selected row
|
|
|
|
|
|
|
|
// const [selectedFilterRow, setSelectedFilterRow] = useState(null);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const defaultColumn = useMemo(() => { |
|
|
|
const defaultColumn = useMemo(() => { |
|
|
|
return { |
|
|
|
return { |
|
|
|
Filter: ColumnSearch, |
|
|
|
Filter: ColumnSearch, |
|
|
@ -95,42 +93,14 @@ const BasicTable = ({ settingsIcon }) => { |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// const changeOrder = () => {
|
|
|
|
|
|
|
|
// setColumnOrder([
|
|
|
|
|
|
|
|
// "name",
|
|
|
|
|
|
|
|
// "order-number",
|
|
|
|
|
|
|
|
// "user-job",
|
|
|
|
|
|
|
|
// "order-level",
|
|
|
|
|
|
|
|
// "order-status",
|
|
|
|
|
|
|
|
// "order-price",
|
|
|
|
|
|
|
|
// ]);
|
|
|
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { globalFilter, pageIndex, pageSize } = state; |
|
|
|
const { globalFilter, pageIndex, pageSize } = state; |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<> |
|
|
|
<> |
|
|
|
{/* <button |
|
|
|
|
|
|
|
className="bg-orange-600" |
|
|
|
|
|
|
|
onClick={() => setSelectedFilterRow(!selectedFilterRow)} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
click me |
|
|
|
|
|
|
|
</button> */} |
|
|
|
|
|
|
|
{/* toggle columns */} |
|
|
|
{/* toggle columns */} |
|
|
|
{/* <div> |
|
|
|
<ToggleColumns |
|
|
|
<div> |
|
|
|
allColumns={allColumns} |
|
|
|
<Checkbox {...getToggleHideAllColumnsProps()} /> Toggle All |
|
|
|
getToggleHideAllColumnsProps={getToggleHideAllColumnsProps} |
|
|
|
</div> |
|
|
|
/> |
|
|
|
{allColumns.map((column) => ( |
|
|
|
|
|
|
|
<div key={column.id}> |
|
|
|
|
|
|
|
<label> |
|
|
|
|
|
|
|
<input type="checkbox" {...column.getToggleHiddenProps()} /> |
|
|
|
|
|
|
|
{column.Header} |
|
|
|
|
|
|
|
</label> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
))} |
|
|
|
|
|
|
|
</div> */} |
|
|
|
|
|
|
|
{/* Change Column Order */} |
|
|
|
|
|
|
|
{/* <button onClick={changeOrder}> Change Column Order </button> */} |
|
|
|
|
|
|
|
<div className="flex flex-row items-center justify-between"> |
|
|
|
<div className="flex flex-row items-center justify-between"> |
|
|
|
{/* right box */} |
|
|
|
{/* right box */} |
|
|
|
<div className="" style={{ width: "70%" }}> |
|
|
|
<div className="" style={{ width: "70%" }}> |
|
|
@ -280,13 +250,6 @@ const BasicTable = ({ settingsIcon }) => { |
|
|
|
</code> |
|
|
|
</code> |
|
|
|
</pre> |
|
|
|
</pre> |
|
|
|
<div className="mt-3 "> |
|
|
|
<div className="mt-3 "> |
|
|
|
{/* <span className="text-sm ml-4"> |
|
|
|
|
|
|
|
صفحه{" "} |
|
|
|
|
|
|
|
<strong className="text-indigo-500"> |
|
|
|
|
|
|
|
{pageIndex + 1} از {pageOptions.length} |
|
|
|
|
|
|
|
</strong> |
|
|
|
|
|
|
|
{""} |
|
|
|
|
|
|
|
</span> */} |
|
|
|
|
|
|
|
<span className="text-sm ml-4"> |
|
|
|
<span className="text-sm ml-4"> |
|
|
|
صفحه{" "} |
|
|
|
صفحه{" "} |
|
|
|
<strong className="text-indigo-500"> |
|
|
|
<strong className="text-indigo-500"> |
|
|
@ -306,7 +269,6 @@ const BasicTable = ({ settingsIcon }) => { |
|
|
|
</strong> |
|
|
|
</strong> |
|
|
|
{""} |
|
|
|
{""} |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
|
|
|
|
|
|
|
|
<select |
|
|
|
<select |
|
|
|
className="text-white text-sm rounded cursor-pointer" |
|
|
|
className="text-white text-sm rounded cursor-pointer" |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
@ -603,6 +565,7 @@ function renderRowSubComponent({ row }) { |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export default BasicTable; |
|
|
|
export default BasicTable; |
|
|
|
|
|
|
|
|
|
|
|
BasicTable.defaultProps = { |
|
|
|
BasicTable.defaultProps = { |
|
|
|