diff --git a/src/webapp/components/custom-table/CustomTable.tsx b/src/webapp/components/custom-table/CustomTable.tsx new file mode 100644 index 00000000..ee5faca5 --- /dev/null +++ b/src/webapp/components/custom-table/CustomTable.tsx @@ -0,0 +1,675 @@ +import React from "react"; +import styled from "styled-components"; +import { ObjectsTable } from "@eyeseetea/d2-ui-components"; + +// TODO: allow no pagination, delete column of actions when no actions, allow custom styles, allow sticky column +interface CustomTableProps { + height?: string; +} + +export const CustomTable: React.FC = React.memo(({ height = "100%" }) => { + return ( + + + + ); +}); + +const Container = styled.div<{ height: string }>` + height: ${props => props.height}; + overflow-y: auto; + overflow-x: auto; + border-collapse: collapse; + table { + border-block-start: 1px solid #bebebe; + border-inline-start: 1px solid #bebebe; + } + .MuiTable-root th, + .MuiTable-root td { + padding-block: 10px; + padding-inline: 12px; + } + + .MuiTable-root th { + background-color: #d9d8d8; + border-inline-end: 1px solid #bebebe; + border-block-end: 1px solid #bebebe; + &:last-child { + border-inline-end: none; + } + } + + .MuiTable-root td { + background-color: #fff; + border-inline-end: 1px solid #bebebe; + border-block-end: 1px solid #bebebe; + &:last-child { + border-inline-end: none; + } + } + + .MuiPaper-elevation1 { + box-shadow: none; + } + + .MuiTable-root tr { + td:last-child { + display: none; + } + th:last-child { + display: none; + } + } +`; + +const data = [ + { + id: "1", + name: "Object 1", + description: "Description 1", + prop1: "Prop1 Value 1", + prop2: "Prop2 Value 1", + prop3: "Prop3 Value 1", + prop4: "Prop4 Value 1", + prop5: "Prop5 Value 1", + prop6: "Prop6 Value 1", + }, + { + id: "2", + name: "Object 2", + description: "Description 2", + prop1: "Prop1 Value 2", + prop2: "Prop2 Value 2", + prop3: "Prop3 Value 2", + prop4: "Prop4 Value 2", + prop5: "Prop5 Value 2", + prop6: "Prop6 Value 2", + }, + { + id: "3", + name: "Object 3", + description: "Description 3", + prop1: "Prop1 Value 3", + prop2: "Prop2 Value 3", + prop3: "Prop3 Value 3", + prop4: "Prop4 Value 3", + prop5: "Prop5 Value 3", + prop6: "Prop6 Value 3", + }, + { + id: "4", + name: "Object 4", + description: "Description 4", + prop1: "Prop1 Value 4", + prop2: "Prop2 Value 4", + prop3: "Prop3 Value 4", + prop4: "Prop4 Value 4", + prop5: "Prop5 Value 4", + prop6: "Prop6 Value 4", + }, + { + id: "5", + name: "Object 5", + description: "Description 5", + prop1: "Prop1 Value 5", + prop2: "Prop2 Value 5", + prop3: "Prop3 Value 5", + prop4: "Prop4 Value 5", + prop5: "Prop5 Value 5", + prop6: "Prop6 Value 5", + }, + { + id: "6", + name: "Object 6", + description: "Description 6", + prop1: "Prop1 Value 6", + prop2: "Prop2 Value 6", + prop3: "Prop3 Value 6", + prop4: "Prop4 Value 6", + prop5: "Prop5 Value 6", + prop6: "Prop6 Value 6", + }, + { + id: "7", + name: "Object 7", + description: "Description 7", + prop1: "Prop1 Value 7", + prop2: "Prop2 Value 7", + prop3: "Prop3 Value 7", + prop4: "Prop4 Value 7", + prop5: "Prop5 Value 7", + prop6: "Prop6 Value 7", + }, + { + id: "8", + name: "Object 8", + description: "Description 8", + prop1: "Prop1 Value 8", + prop2: "Prop2 Value 8", + prop3: "Prop3 Value 8", + prop4: "Prop4 Value 8", + prop5: "Prop5 Value 8", + prop6: "Prop6 Value 8", + }, + { + id: "9", + name: "Object 9", + description: "Description 9", + prop1: "Prop1 Value 9", + prop2: "Prop2 Value 9", + prop3: "Prop3 Value 9", + prop4: "Prop4 Value 9", + prop5: "Prop5 Value 9", + prop6: "Prop6 Value 9", + }, + { + id: "10", + name: "Object 10", + description: "Description 10", + prop1: "Prop1 Value 10", + prop2: "Prop2 Value 10", + prop3: "Prop3 Value 10", + prop4: "Prop4 Value 10", + prop5: "Prop5 Value 10", + prop6: "Prop6 Value 10", + }, + { + id: "11", + name: "Object 11", + description: "Description 11", + prop1: "Prop1 Value 11", + prop2: "Prop2 Value 11", + prop3: "Prop3 Value 11", + prop4: "Prop4 Value 11", + prop5: "Prop5 Value 11", + prop6: "Prop6 Value 11", + }, + { + id: "12", + name: "Object 12", + description: "Description 12", + prop1: "Prop1 Value 12", + prop2: "Prop2 Value 12", + prop3: "Prop3 Value 12", + prop4: "Prop4 Value 12", + prop5: "Prop5 Value 12", + prop6: "Prop6 Value 12", + }, + { + id: "13", + name: "Object 13", + description: "Description 13", + prop1: "Prop1 Value 13", + prop2: "Prop2 Value 13", + prop3: "Prop3 Value 13", + prop4: "Prop4 Value 13", + prop5: "Prop5 Value 13", + prop6: "Prop6 Value 13", + }, + { + id: "14", + name: "Object 14", + description: "Description 14", + prop1: "Prop1 Value 14", + prop2: "Prop2 Value 14", + prop3: "Prop3 Value 14", + prop4: "Prop4 Value 14", + prop5: "Prop5 Value 14", + prop6: "Prop6 Value 14", + }, + { + id: "15", + name: "Object 15", + description: "Description 15", + prop1: "Prop1 Value 15", + prop2: "Prop2 Value 15", + prop3: "Prop3 Value 15", + prop4: "Prop4 Value 15", + prop5: "Prop5 Value 15", + prop6: "Prop6 Value 15", + }, + { + id: "16", + name: "Object 16", + description: "Description 16", + prop1: "Prop1 Value 16", + prop2: "Prop2 Value 16", + prop3: "Prop3 Value 16", + prop4: "Prop4 Value 16", + prop5: "Prop5 Value 16", + prop6: "Prop6 Value 16", + }, + { + id: "17", + name: "Object 17", + description: "Description 17", + prop1: "Prop1 Value 17", + prop2: "Prop2 Value 17", + prop3: "Prop3 Value 17", + prop4: "Prop4 Value 17", + prop5: "Prop5 Value 17", + prop6: "Prop6 Value 17", + }, + { + id: "18", + name: "Object 18", + description: "Description 18", + prop1: "Prop1 Value 18", + prop2: "Prop2 Value 18", + prop3: "Prop3 Value 18", + prop4: "Prop4 Value 18", + prop5: "Prop5 Value 18", + prop6: "Prop6 Value 18", + }, + { + id: "19", + name: "Object 19", + description: "Description 19", + prop1: "Prop1 Value 19", + prop2: "Prop2 Value 19", + prop3: "Prop3 Value 19", + prop4: "Prop4 Value 19", + prop5: "Prop5 Value 19", + prop6: "Prop6 Value 19", + }, + { + id: "20", + name: "Object 20", + description: "Description 20", + prop1: "Prop1 Value 20", + prop2: "Prop2 Value 20", + prop3: "Prop3 Value 20", + prop4: "Prop4 Value 20", + prop5: "Prop5 Value 20", + prop6: "Prop6 Value 20", + }, + { + id: "21", + name: "Object 21", + description: "Description 21", + prop1: "Prop1 Value 21", + prop2: "Prop2 Value 21", + prop3: "Prop3 Value 21", + prop4: "Prop4 Value 21", + prop5: "Prop5 Value 21", + prop6: "Prop6 Value 21", + }, + { + id: "22", + name: "Object 22", + description: "Description 22", + prop1: "Prop1 Value 22", + prop2: "Prop2 Value 22", + prop3: "Prop3 Value 22", + prop4: "Prop4 Value 22", + prop5: "Prop5 Value 22", + prop6: "Prop6 Value 22", + }, + { + id: "23", + name: "Object 23", + description: "Description 23", + prop1: "Prop1 Value 23", + prop2: "Prop2 Value 23", + prop3: "Prop3 Value 23", + prop4: "Prop4 Value 23", + prop5: "Prop5 Value 23", + prop6: "Prop6 Value 23", + }, + { + id: "24", + name: "Object 24", + description: "Description 24", + prop1: "Prop1 Value 24", + prop2: "Prop2 Value 24", + prop3: "Prop3 Value 24", + prop4: "Prop4 Value 24", + prop5: "Prop5 Value 24", + prop6: "Prop6 Value 24", + }, + { + id: "25", + name: "Object 25", + description: "Description 25", + prop1: "Prop1 Value 25", + prop2: "Prop2 Value 25", + prop3: "Prop3 Value 25", + prop4: "Prop4 Value 25", + prop5: "Prop5 Value 25", + prop6: "Prop6 Value 25", + }, + { + id: "26", + name: "Object 26", + description: "Description 26", + prop1: "Prop1 Value 26", + prop2: "Prop2 Value 26", + prop3: "Prop3 Value 26", + prop4: "Prop4 Value 26", + prop5: "Prop5 Value 26", + prop6: "Prop6 Value 26", + }, + { + id: "27", + name: "Object 27", + description: "Description 27", + prop1: "Prop1 Value 27", + prop2: "Prop2 Value 27", + prop3: "Prop3 Value 27", + prop4: "Prop4 Value 27", + prop5: "Prop5 Value 27", + prop6: "Prop6 Value 27", + }, + { + id: "28", + name: "Object 28", + description: "Description 28", + prop1: "Prop1 Value 28", + prop2: "Prop2 Value 28", + prop3: "Prop3 Value 28", + prop4: "Prop4 Value 28", + prop5: "Prop5 Value 28", + prop6: "Prop6 Value 28", + }, + { + id: "29", + name: "Object 29", + description: "Description 29", + prop1: "Prop1 Value 29", + prop2: "Prop2 Value 29", + prop3: "Prop3 Value 29", + prop4: "Prop4 Value 29", + prop5: "Prop5 Value 29", + prop6: "Prop6 Value 29", + }, + { + id: "30", + name: "Object 30", + description: "Description 30", + prop1: "Prop1 Value 30", + prop2: "Prop2 Value 30", + prop3: "Prop3 Value 30", + prop4: "Prop4 Value 30", + prop5: "Prop5 Value 30", + prop6: "Prop6 Value 30", + }, + { + id: "31", + name: "Object 31", + description: "Description 31", + prop1: "Prop1 Value 31", + prop2: "Prop2 Value 31", + prop3: "Prop3 Value 31", + prop4: "Prop4 Value 31", + prop5: "Prop5 Value 31", + prop6: "Prop6 Value 31", + }, + { + id: "32", + name: "Object 32", + description: "Description 32", + prop1: "Prop1 Value 32", + prop2: "Prop2 Value 32", + prop3: "Prop3 Value 32", + prop4: "Prop4 Value 32", + prop5: "Prop5 Value 32", + prop6: "Prop6 Value 32", + }, + { + id: "33", + name: "Object 33", + description: "Description 33", + prop1: "Prop1 Value 33", + prop2: "Prop2 Value 33", + prop3: "Prop3 Value 33", + prop4: "Prop4 Value 33", + prop5: "Prop5 Value 33", + prop6: "Prop6 Value 33", + }, + { + id: "34", + name: "Object 34", + description: "Description 34", + prop1: "Prop1 Value 34", + prop2: "Prop2 Value 34", + prop3: "Prop3 Value 34", + prop4: "Prop4 Value 34", + prop5: "Prop5 Value 34", + prop6: "Prop6 Value 34", + }, + { + id: "35", + name: "Object 35", + description: "Description 35", + prop1: "Prop1 Value 35", + prop2: "Prop2 Value 35", + prop3: "Prop3 Value 35", + prop4: "Prop4 Value 35", + prop5: "Prop5 Value 35", + prop6: "Prop6 Value 35", + }, + { + id: "36", + name: "Object 36", + description: "Description 36", + prop1: "Prop1 Value 36", + prop2: "Prop2 Value 36", + prop3: "Prop3 Value 36", + prop4: "Prop4 Value 36", + prop5: "Prop5 Value 36", + prop6: "Prop6 Value 36", + }, + { + id: "37", + name: "Object 37", + description: "Description 37", + prop1: "Prop1 Value 37", + prop2: "Prop2 Value 37", + prop3: "Prop3 Value 37", + prop4: "Prop4 Value 37", + prop5: "Prop5 Value 37", + prop6: "Prop6 Value 37", + }, + { + id: "38", + name: "Object 38", + description: "Description 38", + prop1: "Prop1 Value 38", + prop2: "Prop2 Value 38", + prop3: "Prop3 Value 38", + prop4: "Prop4 Value 38", + prop5: "Prop5 Value 38", + prop6: "Prop6 Value 38", + }, + { + id: "39", + name: "Object 39", + description: "Description 39", + prop1: "Prop1 Value 39", + prop2: "Prop2 Value 39", + prop3: "Prop3 Value 39", + prop4: "Prop4 Value 39", + prop5: "Prop5 Value 39", + prop6: "Prop6 Value 39", + }, + { + id: "40", + name: "Object 40", + description: "Description 40", + prop1: "Prop1 Value 40", + prop2: "Prop2 Value 40", + prop3: "Prop3 Value 40", + prop4: "Prop4 Value 40", + prop5: "Prop5 Value 40", + prop6: "Prop6 Value 40", + }, + { + id: "41", + name: "Object 41", + description: "Description 41", + prop1: "Prop1 Value 41", + prop2: "Prop2 Value 41", + prop3: "Prop3 Value 41", + prop4: "Prop4 Value 41", + prop5: "Prop5 Value 41", + prop6: "Prop6 Value 41", + }, + { + id: "42", + name: "Object 42", + description: "Description 42", + prop1: "Prop1 Value 42", + prop2: "Prop2 Value 42", + prop3: "Prop3 Value 42", + prop4: "Prop4 Value 42", + prop5: "Prop5 Value 42", + prop6: "Prop6 Value 42", + }, + { + id: "43", + name: "Object 43", + description: "Description 43", + prop1: "Prop1 Value 43", + prop2: "Prop2 Value 43", + prop3: "Prop3 Value 43", + prop4: "Prop4 Value 43", + prop5: "Prop5 Value 43", + prop6: "Prop6 Value 43", + }, + { + id: "44", + name: "Object 44", + description: "Description 44", + prop1: "Prop1 Value 44", + prop2: "Prop2 Value 44", + prop3: "Prop3 Value 44", + prop4: "Prop4 Value 44", + prop5: "Prop5 Value 44", + prop6: "Prop6 Value 44", + }, + { + id: "45", + name: "Object 45", + description: "Description 45", + prop1: "Prop1 Value 45", + prop2: "Prop2 Value 45", + prop3: "Prop3 Value 45", + prop4: "Prop4 Value 45", + prop5: "Prop5 Value 45", + prop6: "Prop6 Value 45", + }, + { + id: "46", + name: "Object 46", + description: "Description 46", + prop1: "Prop1 Value 46", + prop2: "Prop2 Value 46", + prop3: "Prop3 Value 46", + prop4: "Prop4 Value 46", + prop5: "Prop5 Value 46", + prop6: "Prop6 Value 46", + }, + { + id: "47", + name: "Object 47", + description: "Description 47", + prop1: "Prop1 Value 47", + prop2: "Prop2 Value 47", + prop3: "Prop3 Value 47", + prop4: "Prop4 Value 47", + prop5: "Prop5 Value 47", + prop6: "Prop6 Value 47", + }, + { + id: "48", + name: "Object 48", + description: "Description 48", + prop1: "Prop1 Value 48", + prop2: "Prop2 Value 48", + prop3: "Prop3 Value 48", + prop4: "Prop4 Value 48", + prop5: "Prop5 Value 48", + prop6: "Prop6 Value 48", + }, + { + id: "49", + name: "Object 49", + description: "Description 49", + prop1: "Prop1 Value 49", + prop2: "Prop2 Value 49", + prop3: "Prop3 Value 49", + prop4: "Prop4 Value 49", + prop5: "Prop5 Value 49", + prop6: "Prop6 Value 49", + }, + { + id: "50", + name: "Object 50", + description: "Description 50", + prop1: "Prop1 Value 50", + prop2: "Prop2 Value 50", + prop3: "Prop3 Value 50", + prop4: "Prop4 Value 50", + prop5: "Prop5 Value 50", + prop6: "Prop6 Value 50", + }, + { + id: "51", + name: "Object 51", + description: "Description 51", + prop1: "Prop1 Value 51", + prop2: "Prop2 Value 51", + prop3: "Prop3 Value 51", + prop4: "Prop4 Value 51", + prop5: "Prop5 Value 51", + prop6: "Prop6 Value 51", + }, + { + id: "52", + name: "Object 52", + description: "Description 52", + prop1: "Prop1 Value 52", + prop2: "Prop2 Value 52", + prop3: "Prop3 Value 52", + prop4: "Prop4 Value 52", + prop5: "Prop5 Value 52", + prop6: "Prop6 Value 52", + }, + { + id: "53", + name: "Object 53", + description: "Description 53", + prop1: "Prop1 Value 53", + prop2: "Prop2 Value 53", + prop3: "Prop3 Value 53", + prop4: "Prop4 Value 53", + prop5: "Prop5 Value 53", + prop6: "Prop6 Value 53", + }, +]; diff --git a/src/webapp/pages/dashboard/Components.tsx b/src/webapp/pages/dashboard/Components.tsx deleted file mode 100644 index 84afcdf7..00000000 --- a/src/webapp/pages/dashboard/Components.tsx +++ /dev/null @@ -1,201 +0,0 @@ -import React, { useState } from "react"; -import styled from "styled-components"; - -import { Button } from "../../components/button/Button"; -import { AddNewOption } from "../../components/add-new-option/AddNewOption"; -import { AvatarCard } from "../../components/avatar-card/AvatarCard"; -import { DatePicker } from "../../components/date-picker/DatePicker"; -import { InputField } from "../../components/input-field/InputField"; -import { MultipleSelector } from "../../components/multiple-selector/MultipleSelector"; -import { NACheckbox } from "../../components/not-applicable-checkbox/NACheckbox"; -import { RadioButtonsGroup } from "../../components/radio-buttons-group/RadioButtonsGroup"; -import { Selector } from "../../components/selector/Selector"; -import { TextArea } from "../../components/text-area/TextArea"; -import { StatsCard } from "../../components/stats-card/StatsCard"; -import { SearchInput } from "../../components/search-input/SearchInput"; -import { NoticeBox } from "../../components/notice-box/NoticeBox"; -import { ProfileModal } from "../../components/profile-modal/ProfileModal"; - -export const Components: React.FC = React.memo(() => { - const [date, setDate] = useState(null); - const [select, setSelect] = useState(""); - const [multi, setMulti] = useState([]); - const [radio, setRadio] = useState(""); - const [naCheck, setNACheck] = useState(false); - const [area, setArea] = useState(""); - const [input, setInput] = useState(""); - const [searchTerm, setSearchTerm] = useState(""); - const [openProfileModal, setOpenProfileModal] = useState(false); - - return ( - <> - - - - - - - - - - - - Text - - - - - - setInput(event.target.value)} - /> - - - - - - - - - setRadio(event.target.value)} - options={[ - { value: "1", label: "value 1" }, - { value: "2", label: "value 2" }, - ]} - /> - - - - - -