update BasicTable.js, EditButtons.js and EditRow.js

master
mahdi 3 years ago
parent 909efc7154
commit a89c1dda05
  1. 4
      src/components/Tabels/ReactTable4/BasicTable.js
  2. 3
      src/components/Tabels/ReactTable4/EditButtons.js
  3. 216
      src/components/Tabels/ReactTable4/EditRow.js

@ -146,14 +146,14 @@ const BasicTable = ({
<> <>
<div className="flex flex-row items-center justify-between"> <div className="flex flex-row items-center justify-between">
{/* right box */} {/* right box */}
<di className="bg-red-400"> <div className="bg-red-400">
<Tabbar <Tabbar
tabs={tabs} tabs={tabs}
delTab={delTab} delTab={delTab}
setActivateTab={setActivateTab} setActivateTab={setActivateTab}
activeTab={activeTab} activeTab={activeTab}
/> />
</di> </div>
{/* <div className=""> {/* <div className="">
<Tabbar <Tabbar
tabs={tabs} tabs={tabs}

@ -10,8 +10,7 @@ export function EditButtons({ setFiltering, filtering, addTab }) {
<div className="flex flex-row items-center justify-end"> <div className="flex flex-row items-center justify-end">
{/* add new row */} {/* add new row */}
<button <button
className="mx-1 flex flex-row items-center p-2 text-xs text-white rounded border-b-2 border-blue-600" className="mx-1 flex flex-row items-center bg-[#65A9FF] p-2 text-xs text-white rounded border-b-2 border-blue-600"
style={{ backgroundColor: "#65A9FF" }}
onClick={() => { onClick={() => {
console.log("new!!!"); console.log("new!!!");
addTab({ id: "new", name: "ردیف جدید" }); addTab({ id: "new", name: "ردیف جدید" });

@ -27,314 +27,174 @@ const EditRow = ({ row, columns }) => {
</div> </div>
{/* 2 */} {/* 2 */}
<div className="flex flex-col my-2 mx-2"> <div className="flex flex-col my-2 mx-2">
<p <p className="text-xs text-blue-400 mb-2 border-[#65A9FF]">
className="text-xs text-blue-400 mb-2 border-[#65A9FF]"
>
تاریخ سفارش: تاریخ سفارش:
</p> </p>
<span <span
role="textbox" role="textbox"
style={{ className="min-w-[96px] text-xs text-[#00253A] border-[#C8DEF9] bg-[#F8FBFF] rounded-sm border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
backgroundColor: "#F8FBFF",
borderColor: "#C8DEF9",
color: "#00253A",
minWidth: "96px",
}}
className="text-xs rounded-sm border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
> >
{row.order_date} {row.order_date}
</span> </span>
</div> </div>
{/* 3 */} {/* 3 */}
<div className="flex flex-col my-2 mx-2"> <div className="flex flex-col my-2 mx-2">
<p <p className="text-xs text-blue-400 mb-2 border-[#65A9FF]">
className="text-xs text-blue-400 mb-2"
style={{ borderColor: "#65A9FF" }}
>
مبلغ سفارش: مبلغ سفارش:
</p> </p>
<span <span
role="textbox" role="textbox"
style={{ className="min-w-[96px] text-xs text-[#00253A] border-[#C8DEF9] bg-[#F8FBFF] rounded-sm border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
backgroundColor: "#F8FBFF",
borderColor: "#C8DEF9",
color: "#00253A",
minWidth: "96px",
}}
className="text-xs rounded-sm border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
> >
{row.order_price} {row.order_price}
</span> </span>
</div> </div>
{/* 4 */} {/* 4 */}
<div className="flex flex-col my-2 mx-2"> <div className="flex flex-col my-2 mx-2">
<p <p className="text-xs text-blue-400 mb-2 border-[#65A9FF]">
className="text-xs text-blue-400 mb-2"
style={{ borderColor: "#65A9FF" }}
>
شماره سفارش: شماره سفارش:
</p> </p>
<span <span
role="textbox" role="textbox"
style={{ className="min-w-[96px] text-xs text-[#00253A] border-[#C8DEF9] bg-[#F8FBFF] rounded-sm border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
backgroundColor: "#F8FBFF",
borderColor: "#C8DEF9",
color: "#00253A",
minWidth: "96px",
}}
className="text-xs rounded-sm border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
> >
{row.order_number} {row.order_number}
</span> </span>
</div> </div>
{/* 5 */} {/* 5 */}
<div className="flex flex-col my-2 mx-2"> <div className="flex flex-col my-2 mx-2">
<p <p className="text-xs text-blue-400 mb-2 border-[#65A9FF]">
className="text-xs text-blue-400 mb-2"
style={{ borderColor: "#65A9FF" }}
>
شغل کاربر: شغل کاربر:
</p> </p>
<span <span
role="textbox" role="textbox"
style={{ className="min-w-[96px] text-xs text-[#00253A] border-[#C8DEF9] bg-[#F8FBFF] rounded-sm border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
backgroundColor: "#F8FBFF",
borderColor: "#C8DEF9",
color: "#00253A",
minWidth: "96px",
}}
className="text-xs rounded-sm border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
> >
{row.user_job} {row.user_job}
</span> </span>
</div> </div>
{/* 6 */} {/* 6 */}
<div className="flex flex-col my-2 mx-2"> <div className="flex flex-col my-2 mx-2">
<p <p className="text-xs text-blue-400 mb-2 border-[#65A9FF]">
className="text-xs text-blue-400 mb-2"
style={{ borderColor: "#65A9FF" }}
>
وضعیت سفارش: وضعیت سفارش:
</p> </p>
<span <span
role="textbox" role="textbox"
style={{ className="min-w-[96px] text-xs text-[#00253A] border-[#C8DEF9] bg-[#F8FBFF] rounded-sm border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
backgroundColor: "#F8FBFF",
borderColor: "#C8DEF9",
color: "#00253A",
minWidth: "96px",
}}
className="text-xs rounded-sm border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
> >
{row.order_status} {row.order_status}
</span> </span>
</div> </div>
{/* 7 */} {/* 7 */}
<div className="flex flex-col my-2 mx-2"> <div className="flex flex-col my-2 mx-2">
<p <p className="text-xs text-blue-400 mb-2 border-[#65A9FF]">
className="text-xs text-blue-400 mb-2"
style={{ borderColor: "#65A9FF" }}
>
سطح اهمیت: سطح اهمیت:
</p> </p>
<span <span
role="textbox" role="textbox"
style={{ className="min-w-[96px] text-xs text-[#00253A] border-[#C8DEF9] bg-[#F8FBFF] rounded-sm border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
backgroundColor: "#F8FBFF",
borderColor: "#C8DEF9",
color: "#00253A",
minWidth: "96px",
}}
className="text-xs rounded-sm border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
> >
{row.order_level} {row.order_level}
</span> </span>
</div> </div>
{/* 8 */} {/* 8 */}
<div className="flex flex-col my-2 mx-2"> <div className="flex flex-col my-2 mx-2">
<p <p className="text-xs text-blue-400 mb-2 border-[#65A9FF]">
className="text-xs text-blue-400 mb-2"
style={{ borderColor: "#65A9FF" }}
>
محل تولد: محل تولد:
</p> </p>
<span <span
role="textbox" role="textbox"
style={{ className="min-w-[96px] text-xs text-[#00253A] border-[#C8DEF9] bg-[#F8FBFF] rounded-sm border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
backgroundColor: "#F8FBFF",
borderColor: "#C8DEF9",
color: "#00253A",
minWidth: "96px",
}}
className="text-xs rounded-sm border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
> >
{row.birth_place} {row.birth_place}
</span> </span>
</div> </div>
{/* 9 */} {/* 9 */}
<div className="flex flex-col my-2 mx-2"> <div className="flex flex-col my-2 mx-2">
<p <p className="text-xs text-blue-400 mb-2 border-[#65A9FF]">
className="text-xs text-blue-400 mb-2"
style={{ borderColor: "#65A9FF" }}
>
تلفن محل کار: تلفن محل کار:
</p> </p>
<span <span
role="textbox" role="textbox"
style={{ className="min-w-[96px] text-xs text-[#00253A] border-[#C8DEF9] bg-[#F8FBFF] rounded-sm border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
backgroundColor: "#F8FBFF",
borderColor: "#C8DEF9",
color: "#00253A",
minWidth: "96px",
}}
className="text-xs rounded-sm border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
> >
{row.office_phone} {row.office_phone}
</span> </span>
</div> </div>
{/* 10 */} {/* 10 */}
<div className="flex flex-col my-2 mx-2"> <div className="flex flex-col my-2 mx-2">
<p <p className="text-xs text-blue-400 mb-2 border-[#65A9FF]">
className="text-xs text-blue-400 mb-2"
style={{ borderColor: "#65A9FF" }}
>
تحصیلات: تحصیلات:
</p> </p>
<span <span
role="textbox" role="textbox"
style={{ className="min-w-[96px] text-xs text-[#00253A] border-[#C8DEF9] bg-[#F8FBFF] rounded-sm border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
backgroundColor: "#F8FBFF",
borderColor: "#C8DEF9",
color: "#00253A",
minWidth: "96px",
}}
className="text-xs rounded-sm border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
> >
{row.education} {row.education}
</span> </span>
</div> </div>
{/* 11 */} {/* 11 */}
<div className="flex flex-col my-2 mx-2"> <div className="flex flex-col my-2 mx-2">
<p <p className="text-xs text-blue-400 mb-2 border-[#65A9FF]">
className="text-xs text-blue-400 mb-2"
style={{ borderColor: "#65A9FF" }}
>
تاریخ تولد: تاریخ تولد:
</p> </p>
<span <span
role="textbox" role="textbox"
style={{ className="min-w-[96px] text-xs text-[#00253A] border-[#C8DEF9] bg-[#F8FBFF] rounded-sm border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
backgroundColor: "#F8FBFF",
borderColor: "#C8DEF9",
color: "#00253A",
minWidth: "96px",
}}
className="text-xs rounded-sm border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
> >
{row.birth_day} {row.birth_day}
</span> </span>
</div> </div>
{/* 12 */} {/* 12 */}
<div className="flex flex-col my-2 mx-2"> <div className="flex flex-col my-2 mx-2">
<p <p className="text-xs text-blue-400 mb-2 border-[#65A9FF]">شغل:</p>
className="text-xs text-blue-400 mb-2"
style={{ borderColor: "#65A9FF" }}
>
شغل:
</p>
<span <span
role="textbox" role="textbox"
style={{ className="min-w-[96px] text-xs text-[#00253A] border-[#C8DEF9] bg-[#F8FBFF] rounded-sm border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
backgroundColor: "#F8FBFF",
borderColor: "#C8DEF9",
color: "#00253A",
minWidth: "96px",
}}
className="text-xs rounded-sm border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
> >
{row.job} {row.job}
</span> </span>
</div> </div>
{/* 13 */} {/* 13 */}
<div className="flex flex-col my-2 mx-2"> <div className="flex flex-col my-2 mx-2">
<p <p className="text-xs text-blue-400 mb-2 border-[#65A9FF]">
className="text-xs text-blue-400 mb-2"
style={{ borderColor: "#65A9FF" }}
>
دانشگاه: دانشگاه:
</p> </p>
<span <span
role="textbox" role="textbox"
style={{ className="min-w-[96px] text-xs text-[#00253A] border-[#C8DEF9] bg-[#F8FBFF] rounded-sm border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
backgroundColor: "#F8FBFF",
borderColor: "#C8DEF9",
color: "#00253A",
minWidth: "96px",
}}
className="text-xs rounded-sm border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
> >
{row.uni} {row.uni}
</span> </span>
</div> </div>
{/* 14 */} {/* 14 */}
<div className="flex flex-col my-2 mx-2"> <div className="flex flex-col my-2 mx-2">
<p <p className="text-xs text-blue-400 mb-2 border-[#65A9FF]">
className="text-xs text-blue-400 mb-2"
style={{ borderColor: "#65A9FF" }}
>
رشته تحصیلی: رشته تحصیلی:
</p> </p>
<span <span
role="textbox" role="textbox"
style={{ className="min-w-[96px] text-xs text-[#00253A] border-[#C8DEF9] bg-[#F8FBFF] rounded-sm border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
backgroundColor: "#F8FBFF",
borderColor: "#C8DEF9",
color: "#00253A",
minWidth: "96px",
}}
className="text-xs rounded-sm border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
> >
{row.field_study} {row.field_study}
</span> </span>
</div> </div>
{/* 15 */} {/* 15 */}
<div className="flex flex-col my-2 mx-2"> <div className="flex flex-col my-2 mx-2">
<p <p className="text-xs text-blue-400 mb-2 border-[#65A9FF]">اخلاق:</p>
className="text-xs text-blue-400 mb-2"
style={{ borderColor: "#65A9FF" }}
>
اخلاق:
</p>
<span <span
role="textbox" role="textbox"
style={{ className="min-w-[96px] text-xs text-[#00253A] border-[#C8DEF9] bg-[#F8FBFF] rounded-sm border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
backgroundColor: "#F8FBFF",
borderColor: "#C8DEF9",
color: "#00253A",
minWidth: "96px",
}}
className="text-xs rounded-sm border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
> >
{row.behaviour} {row.behaviour}
</span> </span>
</div> </div>
{/* 16 */} {/* 16 */}
<div className="flex flex-col my-2 mx-2"> <div className="flex flex-col my-2 mx-2">
<p <p className="text-xs text-blue-400 mb-2 border-[#65A9FF]">نشانی:</p>
className="text-xs text-blue-400 mb-2"
style={{ borderColor: "#65A9FF" }}
>
نشانی:
</p>
<span <span
role="textbox" role="textbox"
style={{ className="min-w-[96px] text-xs text-[#00253A] border-[#C8DEF9] bg-[#F8FBFF] rounded-sm border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
backgroundColor: "#F8FBFF",
borderColor: "#C8DEF9",
color: "#00253A",
minWidth: "96px",
}}
className="text-xs rounded-sm border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
> >
{row.address} {row.address}
</span> </span>
@ -342,13 +202,8 @@ const EditRow = ({ row, columns }) => {
</div> </div>
{/* title bottom */} {/* title bottom */}
<div className="flex flex-row items-center mr-2 mt-2 mb-4"> <div className="flex flex-row items-center mr-2 mt-2 mb-4">
<div <div className="w-1 h-4 ml-1 rounded bg-[#65A9FF]"></div>
className="w-1 h-4 ml-1 rounded" <p className="text-sm font-sansbold text-[#00253A]">اطلاعات شخصی</p>
style={{ backgroundColor: "#65A9FF" }}
></div>
<p className="text-sm font-sansbold" style={{ color: "#00253A" }}>
اطلاعات شخصی
</p>
</div> </div>
{/* bottom */} {/* bottom */}
<div className="flex flex-row items-center"> <div className="flex flex-row items-center">
@ -363,11 +218,8 @@ const EditRow = ({ row, columns }) => {
</div> </div>
{/* left */} {/* left */}
<div className="w-2/12 flex justify-end"> <div className="w-2/12 flex justify-end">
<button <button className="border rounded text-sm lg:ml-3 py-2 px-4 text-white bg-[#65A9FF]">
className="border rounded text-sm lg:ml-3 py-2 px-4 text-white" ذخیره اطلاعات
style={{ backgroundColor: "#65A9FF" }}
>
ذخیره اطلاعات{" "}
</button> </button>
</div> </div>
</div> </div>

Loading…
Cancel
Save