diff --git a/src/components/ReactTable4/BasicTable.js b/src/components/ReactTable4/BasicTable.js index 23beebf..083af94 100644 --- a/src/components/ReactTable4/BasicTable.js +++ b/src/components/ReactTable4/BasicTable.js @@ -2,7 +2,7 @@ import React, { useMemo, useState } from "react"; import "./index.scss"; -import { Tabbar } from "./index"; +import Tabbar from "./Tabbar"; import MOCK_DATA from "./MOCK_DATA.json"; import { ColumnSearch } from "./ColumnSearch"; @@ -35,12 +35,15 @@ const BasicTable = ({ activeTab, }) => { const data = useMemo(() => MOCK_DATA, []); + const [filtering, setFiltering] = useState(false); + const columns = React.useMemo( () => COLUMNS({ filtering, setFiltering, addTab }), [] ); + // یعنی فیلتر دیفالت هدر های ما سرچ خواهد بود مگه اینکه خودمون تغییرش بدیم const defaultColumn = useMemo(() => { return { Filter: ColumnSearch, @@ -176,7 +179,7 @@ const BasicTable = ({ {column.render("Header")} @@ -194,7 +197,7 @@ const BasicTable = ({ {/* filter row */} {filtering && ( - + {headerGroups.map((headerGroup, index) => ( {headerGroup.headers.map((column) => ( diff --git a/src/components/ReactTable4/ColumnSearch.js b/src/components/ReactTable4/ColumnSearch.js index 8633716..be57157 100644 --- a/src/components/ReactTable4/ColumnSearch.js +++ b/src/components/ReactTable4/ColumnSearch.js @@ -1,36 +1,16 @@ import React, { useState } from "react"; -import search from "./search-normal.svg"; -import cancleIcon from "./zarbedar-icon.svg"; - export const ColumnSearch = ({ column }) => { const { filterValue, setFilter } = column; - const [activeSearchBox, setActiveSearchBox] = useState(false); return (
-
- {activeSearchBox && ( - setActiveSearchBox(false)} - /> - )} - - setFilter(e.target.value)} - onFocus={() => setActiveSearchBox(true)} - className={`w-9/12 text-xs text-blue-400 rounded focus:outline-none border p-1 focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20`} - style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }} - /> -
+ setFilter(e.target.value)} + className={`text-xs text-blue-400 rounded focus:outline-none border p-1 focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20`} + style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }} + />
); }; diff --git a/src/components/ReactTable4/EditButtons.js b/src/components/ReactTable4/EditButtons.js index 8febe51..93ffa4d 100644 --- a/src/components/ReactTable4/EditButtons.js +++ b/src/components/ReactTable4/EditButtons.js @@ -8,7 +8,6 @@ import plus from "./plus.svg"; export function EditButtons({ setFiltering, filtering, addTab }) { const [selectedFilterRow, setSelectedFilterRow] = useState(filtering); - // setFiltering(selectedFilterRow); return (
@@ -27,7 +26,6 @@ export function EditButtons({ setFiltering, filtering, addTab }) { {/* filter */} setSelectedFilterRow(!selectedFilterRow)} alt="" className={`mx-1 p-2 rounded border border-blue-300 cursor-pointer w-8 ${selectedFilterRow ? "border" : "border-0"}`} diff --git a/src/components/ReactTable4/Tabbar.js b/src/components/ReactTable4/Tabbar.js new file mode 100644 index 0000000..353ad1b --- /dev/null +++ b/src/components/ReactTable4/Tabbar.js @@ -0,0 +1,66 @@ +import React from "react"; +import "./index.scss"; + +import cancleIcon from "./zarbedar-icon.svg"; + +const Tabbar = ({ tabs, delTab, setActivateTab, activeTab }) => { + return ( + + ); +}; + +window.isDown = false; + +export default Tabbar; diff --git a/src/components/ReactTable4/index.js b/src/components/ReactTable4/index.js index a54a139..457ac1e 100644 --- a/src/components/ReactTable4/index.js +++ b/src/components/ReactTable4/index.js @@ -2,8 +2,6 @@ import React, { useRef, useState } from "react"; import BasicTable from "./BasicTable"; -import cancleIcon from "./zarbedar-icon.svg"; - const ReactTable4 = ({ breadCrumbs, subTitle, title }) => { const [tabs, setTabs] = useState([ { name: "جدول " + breadCrumbs[breadCrumbs.length - 1].name, id: 0 }, @@ -65,7 +63,6 @@ const ReactTable4 = ({ breadCrumbs, subTitle, title }) => {

{subTitle}

- {/* */} { ); }; -window.isDown = false; - export default ReactTable4; -export function Tabbar({ tabs, delTab, setActivateTab, activeTab }) { - // const { onMouseDown } = useDraggableScroll(ref); +// export function Tabbar({ tabs, delTab, setActivateTab, activeTab }) { +// // const { onMouseDown } = useDraggableScroll(ref); - return ( - - ); -} +// return ( +// +// ); +// } ReactTable4.defaultProps = { breadCrumbs: [ diff --git a/src/components/ReactTable4/index.scss b/src/components/ReactTable4/index.scss index a7764b2..99ead7d 100644 --- a/src/components/ReactTable4/index.scss +++ b/src/components/ReactTable4/index.scss @@ -5,12 +5,13 @@ display: none !important; } .no-scrollbar { - -ms-overflow-style: none; /* IE and Edge */ - scrollbar-width: none; /* Firefox */ + -ms-overflow-style: none; /* IE and Edge */ + scrollbar-width: none; /* Firefox */ } -.tabbar{ +.tabbar { cursor: pointer; } -.active2 ,.active2 li a{ +.active2, +.active2 li a { cursor: move !important; -} \ No newline at end of file +}