From 6db20403022cb43ca79a2f0bab7b368ca8986bc8 Mon Sep 17 00:00:00 2001 From: vozmitelvlas Date: Tue, 17 Dec 2024 14:46:55 +0300 Subject: [PATCH] welcome to the new age --- .../forms/controllers/FormController.java | 6 +- .../src/main/resources/application.properties | 4 +- backend/uploads/tables/form1.xlsx | Bin 7992 -> 8378 bytes backend/uploads/tables/form2.xlsx | Bin 9253 -> 9565 bytes backend/uploads/tables/form3.xlsx | Bin 9257 -> 9565 bytes frontend/public/blackArrow.svg | 1 + frontend/src/components/SignIn/SignIn.jsx | 1 - frontend/src/components/Tables/Tables.jsx | 88 ++++++----- frontend/src/components/XLSX/TablesXlsx.jsx | 138 ++++++++++++------ frontend/src/components/XLSX/select.css | 10 +- 10 files changed, 152 insertions(+), 96 deletions(-) create mode 100644 frontend/public/blackArrow.svg diff --git a/backend/src/main/java/ru/yandex/forms/controllers/FormController.java b/backend/src/main/java/ru/yandex/forms/controllers/FormController.java index 7592405..c4e64c3 100644 --- a/backend/src/main/java/ru/yandex/forms/controllers/FormController.java +++ b/backend/src/main/java/ru/yandex/forms/controllers/FormController.java @@ -77,7 +77,7 @@ public ResponseEntity createForm(@RequestBody FormRequest formRequest){ return new ResponseEntity<>("Название таблицы не может быть пустым", HttpStatus.BAD_REQUEST); } if (formService.isContain(formRequest.getOwnerMail(), formRequest.getFormName())){ - return new ResponseEntity<>("Название таблицы не уникальное", HttpStatus.BAD_REQUEST); + return new ResponseEntity<>("Название формы не уникальное", HttpStatus.BAD_REQUEST); } Form form = new Form(); @@ -89,7 +89,7 @@ public ResponseEntity createForm(@RequestBody FormRequest formRequest){ if (!formService.isTableExist(formRequest.getTableName())){ formService.createXlsxFile(formRequest.getTableName()); } - form.setPath("./backend/uploads/tables/" + formRequest.getTableName() + ".xlsx"); + form.setPath("./uploads/tables/" + formRequest.getTableName() + ".xlsx"); form.setTableName(formRequest.getTableName()); formRepository.save(form); @@ -157,7 +157,7 @@ public ResponseEntity updateForm( return new ResponseEntity<>(HttpStatus.NOT_FOUND); } if (formService.isContain(form.get().getOwnerEmail(), patchFormRequest.getFormName())){ - return new ResponseEntity<>("Название таблицы не уникальное", HttpStatus.BAD_REQUEST); + return new ResponseEntity<>("Название формы не уникальное", HttpStatus.BAD_REQUEST); } return formService.updateForm(patchFormRequest.getFormId(), patchFormRequest.getFormName(), patchFormRequest.getTableName()); diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index 6b84d0f..c5afba5 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -1,8 +1,8 @@ spring.application.name=forms -#spring.data.mongodb.uri=${DB_URL} -spring.data.mongodb.uri=mongodb://localhost:27017/test +spring.data.mongodb.uri=${DB_URL} +#spring.data.mongodb.uri=mongodb://localhost:27017/test spring.jpa.hibernate.ddl-auto=update diff --git a/backend/uploads/tables/form1.xlsx b/backend/uploads/tables/form1.xlsx index d510088be62f2965ea279e3464055b7d0c7c2119..6aa108e356bba72d2d9a215a1f2d2200787787db 100644 GIT binary patch delta 3500 zcmY*cbyyQ_*B<2tb1-R<(J3`TDQPxJKtf`Gv`9?ghXP7WM}y?(R0I?xWpp_}LJ=ux z1f`_~M-0Y?-}_zf_rA{`&-Fa_Ie(n%KG%JsQMFm4`qL#E6(=2>hfooEQ`DX*e{r z0DtaqtYXN?Q*5I3@#VLqdfEz45@V@M0xxS!-jor=-7^M~J4sI&sA=$IeOjc(Px0t< zZZ04ov_=wq@S*OCzEEZ^HM?)WxzG|HLB6B1RTbG|nl-Gcm%jj!KXTeV9zE7yU%p)` zNC|Lf%(b!k*zRpLXy9RFj`=7UxT2pihAm}lFO_?f)vws#`XfpMdMwDo=zYcMjP>%3 z0&q`n>^H#-e{kUw4T&N7rnk4_EZ#SKNHdq(_~cwx4sa5pbCidOAO+)u!KHF}EKp+h z!4RqoM$n?P>Ld#Iz+iXjO43aHf+&Z`=?5mK0=u+|x`Y!2ptsg9%t^Ky$g)dC4AzFb zi|>uiC+O}v%2AGZ;2E`ke~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Mck`SgwRQGm%lcG94*(Ygr&xg_t>r;Z z0fRWXU?8dGd}$CkFGdf^pBGN|Bf)r(^~sYEY3_7;QJO(p%=k;IzF#bqKECF-ZS*W3e8;d?{98uEy6 zz`Afeo>*@@yxc1Z@4wX|zJ|Rmmkg+wa@@UjDXDe}!+W(Q(tp>tpKcY=(D-}hxW36CequgY2MT*6~Ph8N)`3H4tE z2-Td9=F{=vx^%v1yyKgPc9Se>PAwZOGm(jBY-UJ5vMD@#&$6RU4Wxtf_NuJu5<$8U z#@c)731^SjgR6Rv?&nz2np*EiFl3qfKJu1MxK91r{2HltRT=XZ9hdmx``BEUrLC&M z-HWooqW5{OWYA8X{N(X`RpmL2ac??1-=Ar2qe~n=R&sauC9IHM1Uysu7`eh5R-BXd z%7qZy*=fqxB4pa^SCn1DRZ|9S2jVGD5DDXxjt4E(a@#z2rffD1qi zpg*N_QNUkM0|4-yR{lmW(G+$CG|oy)fk{gJe=Yd?Y=YxI%0P4z<`VpSGl0`U|BbKQ oM5qW{@Lvp^9#!zExIq8g2UzeDEk!gzlrzL65i#1Af`6L-1O9lb#{d8T diff --git a/backend/uploads/tables/form2.xlsx b/backend/uploads/tables/form2.xlsx index df787f7a10fc556d5e83aacfdd01a6522a0daa29..d639621ee02ed4cc294d82d4af503df77322e09b 100644 GIT binary patch delta 3556 zcmY+HX*?8O7stoGn;{HiCq!gtD9IXAF~(N*HL`?kWt(P_HO0)>%93S-?8C&6J%h58 ztivEmWi9>f%v1jtPtS8++&8~_&iQ=qz2|<IRvS;A;e$HUj{_!U6yQ0RX_= z0OiP_JN_O)LH_6N1_qScQf^bApjg-EG>I+ejPhrJlCZ^oEv-wftQZ#;M!rVl%klCE znTqSC?~zlM6w8?+KAmgF7$W*w3RtutS4X`qhN3-tuN0;(uNJQyvkbQyOi51Uj6JFg zS?PbDkc3PLmiJ9~Y*X^eKInvW!K`T>))EQ0^p$hGud!m~TSFPwdvF7u-Yx>6+1m-% zyGydg*^tUUYRq!P=>LFpGeU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Mt>toUiAX9(0N>#{I%C`P)*+ zKP=lln@807)O0@wRv(>yrV<+OmlSW#iv$Qg-CTZpSoLE;nmZq>S%fUH6+?{%bp%m{ z4ri>UNd^et=!vYexbs7k0$P*Wzl+#&P3%}E zl^3q3P`wt+spZAEgy=d*+LDO77*9*$$NXD`tH*1!`fpu%?y}#_cbs;?-0hMA%JlU3 zNu~L-r#YE!|2Z;v9fSI1_*=i{8F5dcP{6w1tV>^Ln)9>^aU7P}U^<%q{tExpDqDPn zKVvV+r;Mn527E@vtYJWN>QLs|>J_o%{)dCD`>?@XO24wPNW+}z;3NOA zuoQXdQb~Mj)T0L>BrQlV|10aPrIe$CW<&FvomXt`GnEH$bpY zC=@T^2p_wZ!ciooF1DF#lTq3|7XHG^nt~8pvX#rKO&!jXUABF&!I_KPh!lvFM(XY) zvFmJI4&ZCanXr0irjp(k!#Xp6#_X2id67w*E>WZlIq)8NGNt0hYWtV7=L>@OP$Id_S02cOR-e?C{t}Gq9|y`u3LPyE-REIc2~%{k6h&H z!#+bukX1Kp#)oQgIwuyM`Q#6dvJQ{dKfGo*Mvhbc@1o58%xvI#195c*AfQpo*?cT= zr27suRWsh#_?{!FJk!YP!Bs^E4v%8?$L|3){EeoKwl^f42qyl60yN{iglCNy*aJ21ir1jF%kE8bi>J^uJEfsDsO2nN}KQ+iCp#gDxG#N$6*xR&1u6GY8Hyh z&s2k^LbReV77{zn24PPgEYjS1q|YrXh+nuOD!!(GVXM<0&)Mr{oWpk;O@gEV1Kj(0tx*;K&%)p4JwT5gY*6O9=I8} ZFylTHw+Fw>*m@RsNmiOQP3nIM{{uwX>mL9B diff --git a/backend/uploads/tables/form3.xlsx b/backend/uploads/tables/form3.xlsx index d95f42ee52c22b524958bc58230eef9f688a01c0..89cfc2fb009353224a8a63c2410acfa76e4a7acf 100644 GIT binary patch delta 3527 zcmY*cc{tR4_a4R;V=P(6J{mFBP>9H62w6gQBI^)CWY5=(UDg?ES)!0Nn(X_QJ%p@N zS+bR_dJG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$3IQwdqWwQ(r zve|dH&f0fHs~fZ~wd;3&$NeF7sg(SDBe~z}n^ix#h?sD%PB?W@2rJ6n@^CcY>G|s6 z`Wj`SCkHG0-D=Bu8^+Zk$)|jh7C)=>Rs1;Xna4lh7#88#NU>r9fi8fF(Fg?abkw59 zkhgy$cB5{sgNFZ9>Sxx>YO?tk5AQ@1mquPTO|YZVh8HH-8%MXC^1N_;)+ak!=A|MV zd*A%Wfw9!b7mvj@Gqlb1*lQoyv1tUdu+ztSv$T>}nb>*#jhomrcU33n*K0LNa zAzbxq_G|STuA~fVoIvcqkT>s6^vWC0yAaOV z&|a0RfPt^%ee=-MoQZPOrrrF=h@Y)0{drYZ`mc2yR!ZfvI1%+~De)c_eH9c^hoR8t4wpCLIPg zao}6_=p0?zQduqFQQ2KFt=P&H_&CNk2{TcH7lD*^*<6Nv(#_vii=s!=WgJqZq|w6` z`?c)q>ucivmgBLfBj@eWt}i}xgcy8cJ68XF8`y=Ttuq1|`0hJNLAD38x?oYL1fokv zN8Bc%wT;EliB4^)*TBkYLEKh#_j{+xK-{ zoiR7U1oa&#!I@~&FfN|HY-e3b;&~JS_eo~-C~tO!r9OWlPGe{Se_qxoBIwei-)44XaSuKmY&$ diff --git a/frontend/public/blackArrow.svg b/frontend/public/blackArrow.svg new file mode 100644 index 0000000..2ffa34b --- /dev/null +++ b/frontend/public/blackArrow.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/components/SignIn/SignIn.jsx b/frontend/src/components/SignIn/SignIn.jsx index 149abb7..afdf932 100644 --- a/frontend/src/components/SignIn/SignIn.jsx +++ b/frontend/src/components/SignIn/SignIn.jsx @@ -25,7 +25,6 @@ export default function SignIn() { }) await axios.get(`http://localhost:8080/forms/available/redactors/${foundItem.id}`).then((res) => { - console.log("res - ", res.data); dispatch(setUsers(res.data)) }) diff --git a/frontend/src/components/Tables/Tables.jsx b/frontend/src/components/Tables/Tables.jsx index 4d8d0dc..526f688 100644 --- a/frontend/src/components/Tables/Tables.jsx +++ b/frontend/src/components/Tables/Tables.jsx @@ -27,11 +27,10 @@ export default function Tables() { let allUsers = useSelector((state) => state.user.users); const initialValuesForNewLink = { - table_name: "", - form_name: "", - redactors: "", - creation_date: getCurrentDate("-"), - owner_mail: `${mail}`, + tableName: "", + formName: "", + redactors: [], + ownerMail: `${mail}`, }; const [newValues, setNewValues] = useState(initialValuesForNewLink); @@ -64,25 +63,31 @@ export default function Tables() { setNewValues({ ...newValues, [name]: value }); }; const sendNewLink = async (event) => { - let modalWindow = document.querySelector(".add-modal-overlay"); event.preventDefault(); - console.log("new - ", newValues); + let modalWindow = document.querySelector(".add-modal-overlay"); + let errorSpan = modalWindow.querySelector(".add-error-msg") + + console.log("newValues --- ", newValues); try { - await axios.post("http://localhost:8080/forms/create-form", { - ownerMail: mail, - name: newValues.table_name, - }); - + await axios.post("http://localhost:8080/forms/create-form", newValues); const res = await axios.get(`http://localhost:8080/forms/${mail}`); dispatch(setBrokers(res.data)); + modalWindow.classList.add("add-modal-overlay_hidden"); + errorSpan.innerText = "" } catch (error) { - console.error("Ошибка при обработке форм: ", error); + console.log(error); + errorSpan.innerText = `${error.response.data}` + // console.error("Ошибка при обработке форм: ", error); } - modalWindow.classList.add("add-modal-overlay_hidden"); + }; const handleSubmit = () => { let modalWindow = document.querySelector(".add-modal-overlay"); modalWindow.classList.remove("add-modal-overlay_hidden"); + let addErrorSpan = modalWindow.querySelector(".add-error-msg") + addErrorSpan.innerText = "" + + setNewValues({ ...newValues, "redactors": [] }); }; const exportData = () => { @@ -99,10 +104,10 @@ export default function Tables() { }; const fileInputRef = useRef(null); const importData = () => { + fileInputRef.current.value = ""; fileInputRef.current.click(); }; const handleFileChange = async (event) => { - console.log("asdasd"); const selectedFile = event.target.files[0]; if (selectedFile) { const formData = new FormData(); @@ -115,6 +120,7 @@ export default function Tables() { }); const res = await axios.get(`http://localhost:8080/forms/${mail}`); + console.log("res data - ", res.data); dispatch(setBrokers(res.data)); } catch (error) { console.error("Ошибка при обработке форм: ", error); @@ -125,8 +131,6 @@ export default function Tables() { let activeForm = null; const deleteForm = async () => { if (activeForm) { - console.log("удаляем activeForm и загружаем оставшиеся", activeForm); - console.log("activeForm.id", activeForm.id); await axios.delete(`http://localhost:8080/forms/${activeForm.id}`); const res = await axios.get(`http://localhost:8080/forms/${mail}`); dispatch(setBrokers(res.data)); @@ -144,6 +148,8 @@ export default function Tables() { let currentForm = event.target.closest("tr") activeForm = JSON.parse(currentForm.dataset.form); + let editErrorSpan = document.querySelector(".edit-error-msg") + if (showbut) { let saveBut = document.querySelector('[name="saveBut"]') console.log("saveBut in tbody - ", saveBut); @@ -191,6 +197,7 @@ export default function Tables() { } } if (editImg) { + editErrorSpan.innerText = "" let editModalWindow = document.querySelector(".edit-modal-overlay"); editModalWindow.classList.remove("edit-modal-overlay_hidden"); } @@ -213,28 +220,34 @@ export default function Tables() { redactorsModalWindow.classList.remove("redactors-modal-overlay_hidden"); let saveBut = redactorsModalWindow.querySelector('[name="saveBut"]') saveBut.setAttribute("data-create", "true") - console.log("saveBut", saveBut); } const editForm = async (event) => { event.preventDefault() if (activeForm) { - let editInfo = event.target.querySelectorAll(".text-field__input") + let editModalWindow = document.querySelector(".edit-modal-overlay"); + let errorSpan = editModalWindow.querySelector(".edit-error-msg") + + let editInfo = editModalWindow.querySelectorAll(".text-field__input") + console.log(editInfo); const values = Array.from(editInfo).map(input => input.value); const formData = Object.fromEntries(values.map((value, index) => [`${index === 0 ? 'formName' : 'tableName'}`, value])); formData["formId"] = activeForm.id - await axios.patch(`http://localhost:8080/forms/update`, formData); - const res = await axios.get(`http://localhost:8080/forms/${mail}`); - dispatch(setBrokers(res.data)); - console.log("new ---", res.data); - editInfo.forEach((input) => { - input.value = '' - }) - - let editModalWindow = document.querySelector(".edit-modal-overlay"); - editModalWindow.classList.add("edit-modal-overlay_hidden"); + try { + + await axios.patch(`http://localhost:8080/forms/update`, formData); + const res = await axios.get(`http://localhost:8080/forms/${mail}`); + dispatch(setBrokers(res.data)); + editInfo.forEach((input) => { + input.value = '' + }) + editModalWindow.classList.add("edit-modal-overlay_hidden"); + } + catch (error) { + errorSpan.innerText = `${error.response.data}` + } } } @@ -245,11 +258,9 @@ export default function Tables() { let allCheckBoxes = redactorsModalWindow.querySelectorAll('[type="checkbox"]') const filteredCheckBoxes = Array.from(allCheckBoxes).filter(input => input.checked); const namesNewRedactors = filteredCheckBoxes.map(input => input.name); - + console.log("namesNewRedactors", namesNewRedactors); if (saveBut.dataset.create) { - console.log("[В кнопке создания] newRedactors - ", namesNewRedactors); - console.log("[В кнопке создания] ждем остальных данных и отправялем"); setNewValues({ ...newValues, "redactors": namesNewRedactors }); } else { @@ -258,9 +269,6 @@ export default function Tables() { const res = await axios.get(`http://localhost:8080/forms/${mail}`); dispatch(setBrokers(res.data)); } - - console.log("[В таблице] newRedactors - ", namesNewRedactors); - console.log("[В таблице] отправляем косте запрос и получаем новый forms"); } redactorsModalWindow.classList.add("redactors-modal-overlay_hidden"); @@ -375,16 +383,16 @@ export default function Tables() {
@@ -399,6 +407,7 @@ export default function Tables() {
+ @@ -430,6 +439,7 @@ export default function Tables() { + diff --git a/frontend/src/components/XLSX/TablesXlsx.jsx b/frontend/src/components/XLSX/TablesXlsx.jsx index 150454d..b55199f 100644 --- a/frontend/src/components/XLSX/TablesXlsx.jsx +++ b/frontend/src/components/XLSX/TablesXlsx.jsx @@ -9,29 +9,32 @@ import searchIcon from "/search.svg"; export function TablesXlsx() { let xlsx = useSelector((state) => state.xlsx.bytes); let name = useSelector((state) => state.xlsx.name); - + let initialDates = { + "before": "", + "after": "" + } + const [selectedDate, setSelectedDate] = useState(initialDates); const [table, setTable] = useState(''); - const [selectedOption, setSelectedOption] = useState('default'); // Начальное состояние + const [ID, setID] = useState(''); + const [selectedOption, setSelectedOption] = useState('default'); + + const handleIdChange = (event) => { + setID(event.target.value) + } + const handleDateChange = (event) => { + setSelectedDate({ ...selectedDate, [event.target.name]: event.target.value }); + }; const handleChange = (event) => { setSelectedOption(event.target.value); switch (event.target.value) { case 'new': - console.log('Сначала новые ответы'); displayData(sortByCreationTimeDescending(table)) break; case 'old': displayData(sortByCreationTimeAscending(table)) - console.log('Сначала старые ответы'); - break; - case 'all': - sortByCreationTimeDescending(table) - sortByCreationTimeAscending(table) - displayData(filterByDateRange(table, new Date("2024-11-11"), new Date("2024-11-25"))) - break; default: - console.log('Выберите тип'); break; } }; @@ -41,41 +44,82 @@ export function TablesXlsx() { } // Фильтрация строк таблицы по диапазону дат function filterByDateRange(table, startDate, endDate) { - let headerRow = table.shift(); // Убираем заголовок таблицы - let filteredRows = table.filter(row => { - let rowDate = parseDate(row[1]); - return rowDate >= startDate && rowDate <= endDate; - }); - filteredRows.unshift(headerRow); // Возвращаем заголовок обратно - return filteredRows; + startDate = new Date(startDate !== "" ? startDate + " 00:00:00" : "2000-01-01") + endDate = new Date(endDate !== "" ? endDate + " 23:59:59": "3000-01-01") + + if (table.length > 1) { + let headerRow = table.shift(); // Убираем заголовок таблицы + let filteredRows = table.filter(row => { + let rowDate = parseDate(row[1]); + return rowDate >= startDate && rowDate <= endDate; + }); + filteredRows.unshift(headerRow); // Возвращаем заголовок обратно + table.unshift(headerRow); // Возвращаем заголовок обратно + + return filteredRows; + } + + console.log("Filter_table = ", table); + return table + } // Сортировка строк таблицы по времени создания (по возрастанию) function sortByCreationTimeAscending(table) { - let headerRow = table.shift(); // Убираем заголовок таблицы - let sortedRows = table.sort((a, b) => { - let dateA = parseDate(a[1]); - let dateB = parseDate(b[1]); - if (dateA > dateB) return 1; - else if (dateA < dateB) return -1; - else return 0; - }); - table.unshift(headerRow); // Возвращаем заголовок обратно - return table; + if (table.length > 1) { + let headerRow = table.shift(); // Убираем заголовок таблицы + let sortedRows = table.sort((a, b) => { + let dateA = parseDate(a[1]); + let dateB = parseDate(b[1]); + if (dateA > dateB) return 1; + else if (dateA < dateB) return -1; + else return 0; + }); + table.unshift(headerRow); // Возвращаем заголовок обратно + // sortedRows.unshift(headerRow); + // return sortedRows; + } + return table + } // Сортировка строк таблицы по времени создания (по убыванию) function sortByCreationTimeDescending(table) { - let headerRow = table.shift(); // Убираем заголовок таблицы - let sortedRows = table.sort((a, b) => { - let dateA = parseDate(a[1]); - let dateB = parseDate(b[1]); - if (dateA > dateB) return -1; - else if (dateA < dateB) return 1; - else return 0; - }); - table.unshift(headerRow); // Возвращаем заголовок обратно + if (table.length > 1) { + let headerRow = table.shift(); // Убираем заголовок таблицы + let sortedRows = table.sort((a, b) => { + let dateA = parseDate(a[1]); + let dateB = parseDate(b[1]); + if (dateA > dateB) return -1; + else if (dateA < dateB) return 1; + else return 0; + }); + //sortedRows.unshift(headerRow); + table.unshift(headerRow); // Возвращаем заголовок обратно + // return sortedRows; + } return table; } + const IDBut = (event) => { + console.log("table", table); + if(ID !== ""){ + let headerRow = table.shift(); + let answer = table.filter(row => { + return ID === row[0]; + }); + answer.unshift(headerRow); + table.unshift(headerRow); + displayData(answer); + } + else{ + displayData(table) + } + } + + const seacrhBut = () => { + let newT = sortByCreationTimeAscending(table) + displayData(filterByDateRange(newT, selectedDate.before, selectedDate.after)) + } + useEffect(() => { if (xlsx) { const workbook = XLSX.read(xlsx, { type: 'array' }); @@ -112,22 +156,24 @@ export function TablesXlsx() {

{name}

-
+
- - - - - - + + - + +
diff --git a/frontend/src/components/XLSX/select.css b/frontend/src/components/XLSX/select.css index 5f0b5b0..83be1ac 100644 --- a/frontend/src/components/XLSX/select.css +++ b/frontend/src/components/XLSX/select.css @@ -11,12 +11,13 @@ select { outline: 0; font: inherit; /* Personalize */ - width: 15rem; - padding: 1rem 4rem 1rem 1rem; - background: var(--arrow-icon) no-repeat right 0.8em center / 1.4em, + width: 16.2rem; + padding-left: 1rem; + height: 3rem; + background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E%3C!--!Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--%3E%3Cpath d='M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z'/%3E%3C/svg%3E") no-repeat right 0.8em center / 0.8em, linear-gradient(to left, var(--arrow-bg) 3em, var(--select-bg) 3em); color: rgba(0, 0, 0, 0.71); - background-color: rgb(187, 187, 187); + background-color: #f1f2f5fd; border-radius: 0.25em; box-shadow: 0 0 1em 0 rgba(0, 0, 0, 0.2); cursor: pointer; @@ -45,5 +46,4 @@ select { .center{ display: flex; align-items: center; - } \ No newline at end of file