diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 23c81fa3..97a4d22a 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,14 +1,14 @@ { - "recommendations": [ - "nuxtr.nuxt-vscode-extentions", - "esbenp.prettier-vscode", - "naumovs.color-highlight", - "usernamehw.errorlens", - "mhutchie.git-graph", - "donjayamanne.githistory", - "huizhou.githd", - "wix.vscode-import-cost", - "netcorext.uuid-generator", - "bradlc.vscode-tailwindcss" - ] + "recommendations": [ + "nuxtr.nuxt-vscode-extentions", + "esbenp.prettier-vscode", + "naumovs.color-highlight", + "usernamehw.errorlens", + "mhutchie.git-graph", + "donjayamanne.githistory", + "huizhou.githd", + "wix.vscode-import-cost", + "netcorext.uuid-generator", + "bradlc.vscode-tailwindcss" + ] } diff --git a/assets/styles/fontePadrao.css b/assets/styles/fontePadrao.css index 70cd57e1..7dcc4058 100644 --- a/assets/styles/fontePadrao.css +++ b/assets/styles/fontePadrao.css @@ -1,4 +1,4 @@ * { - font-family: "Poppins", sans-serif !important; + font-family: 'Poppins', sans-serif !important; text-decoration: none; } diff --git a/assets/styles/main.css b/assets/styles/main.css index a0f2bb69..9eee0116 100644 --- a/assets/styles/main.css +++ b/assets/styles/main.css @@ -1,22 +1,22 @@ .-icon-black { - filter: invert(0%); + filter: invert(0%); } .-icon-white { - filter: invert(100%); + filter: invert(100%); } /* Scrollbar style */ .-scrollbar::-webkit-scrollbar { - width: 6px; + width: 6px; } .-scrollbar::-webkit-scrollbar-track { - background: #9ab69e; - border-radius: 50px; - cursor: pointer; + background: #9ab69e; + border-radius: 50px; + cursor: pointer; } .-scrollbar::-webkit-scrollbar-thumb { - background: rgb(22 163 74); - border-radius: 50px; - cursor: pointer; + background: rgb(22 163 74); + border-radius: 50px; + cursor: pointer; } diff --git a/assets/styles/themes/theme.css b/assets/styles/themes/theme.css index 4fc7cdd9..2fb006ea 100644 --- a/assets/styles/themes/theme.css +++ b/assets/styles/themes/theme.css @@ -1,44 +1,44 @@ :root, .app-color-mode-light { - --sisgha-theme-text: 0, 0, 0; + --sisgha-theme-text: 0, 0, 0; - --sisgha-theme-surface: 255, 255, 255; - --sisgha-theme-background: 255, 255, 255; + --sisgha-theme-surface: 255, 255, 255; + --sisgha-theme-background: 255, 255, 255; - --sisgha-theme-primary: 57, 160, 72; - --sisgha-theme-primary-text: 255, 255, 255; + --sisgha-theme-primary: 57, 160, 72; + --sisgha-theme-primary-text: 255, 255, 255; - --sisgha-theme-primary-half: 156, 207, 163; + --sisgha-theme-primary-half: 156, 207, 163; - --sisgha-theme-divider: 0, 0, 0; + --sisgha-theme-divider: 0, 0, 0; } .app-color-mode-dark { - --sisgha-theme-text: 255, 255, 255; + --sisgha-theme-text: 255, 255, 255; - --sisgha-theme-background: 18, 18, 18; - --sisgha-theme-surface: 33, 33, 33; + --sisgha-theme-background: 18, 18, 18; + --sisgha-theme-surface: 33, 33, 33; - --sisgha-theme-primary: 56, 161, 72; - --sisgha-theme-primary-text: 255, 255, 255; + --sisgha-theme-primary: 56, 161, 72; + --sisgha-theme-primary-text: 255, 255, 255; - --sisgha-theme-primary-half: 37, 90, 45; + --sisgha-theme-primary-half: 37, 90, 45; - --sisgha-theme-divider: 255, 255, 255; + --sisgha-theme-divider: 255, 255, 255; } .app { - background-color: rgb(var(--sisgha-theme-background)); - color: rgb(var(--sisgha-theme-text)); + background-color: rgb(var(--sisgha-theme-background)); + color: rgb(var(--sisgha-theme-text)); - display: flex; - flex-direction: column; + display: flex; + flex-direction: column; - height: 100vh; /* fallback para caso o dispositivo não suporte dvh */ + height: 100vh; /* fallback para caso o dispositivo não suporte dvh */ - height: 100dvh; + height: 100dvh; } input { - color: inherit; + color: inherit; } diff --git a/components/Dashboard/Profile/Availability/Availability.vue b/components/Dashboard/Profile/Availability/Availability.vue index 44073fb1..cfbdb2ef 100644 --- a/components/Dashboard/Profile/Availability/Availability.vue +++ b/components/Dashboard/Profile/Availability/Availability.vue @@ -2,13 +2,13 @@ const selectedOptions = ref(); const options = [ - { value: 'Domingo' }, - { value: 'Segunda' }, - { value: 'Terça' }, - { value: 'Quarta' }, - { value: 'Quinta' }, - { value: 'Sexta' }, - { value: 'Sábado' }, + { value: 'Domingo' }, + { value: 'Segunda' }, + { value: 'Terça' }, + { value: 'Quarta' }, + { value: 'Quinta' }, + { value: 'Sexta' }, + { value: 'Sábado' }, ]; selectedOptions.value = options[1]; @@ -16,121 +16,119 @@ selectedOptions.value = options[1]; let currentDayIndex = ref(1); const changeDay = (delta) => { - currentDayIndex.value = - (currentDayIndex.value + delta + options.length) % options.length; + currentDayIndex.value = + (currentDayIndex.value + delta + options.length) % options.length; - selectedOptions.value = options[currentDayIndex.value]; + selectedOptions.value = options[currentDayIndex.value]; }; diff --git a/components/Dashboard/Profile/Profile.vue b/components/Dashboard/Profile/Profile.vue index cef2c254..071b8669 100644 --- a/components/Dashboard/Profile/Profile.vue +++ b/components/Dashboard/Profile/Profile.vue @@ -7,121 +7,117 @@ import ModalImage from '~/components/Modais/ModalImage.vue'; const show = ref(false); const openConfirm = () => { - show.value = true; - console.log('clicou no iconeadd'); + show.value = true; + console.log('clicou no iconeadd'); }; const closeConfirm = () => { - show.value = false; + show.value = false; }; diff --git a/components/Dashboard/Profile/Teaching/Teaching.vue b/components/Dashboard/Profile/Teaching/Teaching.vue index 0dfa980b..90d62f2a 100644 --- a/components/Dashboard/Profile/Teaching/Teaching.vue +++ b/components/Dashboard/Profile/Teaching/Teaching.vue @@ -3,114 +3,104 @@ import 'vue3-carousel/dist/carousel.css'; diff --git a/components/Icons/Arrow/IconArrowAlt.vue b/components/Icons/Arrow/IconArrowAlt.vue index 0314580c..ff608d52 100644 --- a/components/Icons/Arrow/IconArrowAlt.vue +++ b/components/Icons/Arrow/IconArrowAlt.vue @@ -1,16 +1,16 @@ diff --git a/components/Icons/Eyes/EyeOff.vue b/components/Icons/Eyes/EyeOff.vue index 9c3d31fc..c9fe2367 100644 --- a/components/Icons/Eyes/EyeOff.vue +++ b/components/Icons/Eyes/EyeOff.vue @@ -1,15 +1,15 @@ diff --git a/components/Icons/Eyes/EyeOn.vue b/components/Icons/Eyes/EyeOn.vue index 7a4721f4..1e66c36c 100644 --- a/components/Icons/Eyes/EyeOn.vue +++ b/components/Icons/Eyes/EyeOn.vue @@ -1,18 +1,18 @@ diff --git a/components/Icons/IconAdd.vue b/components/Icons/IconAdd.vue index 052bebb7..e530d306 100644 --- a/components/Icons/IconAdd.vue +++ b/components/Icons/IconAdd.vue @@ -1,15 +1,15 @@ diff --git a/components/Icons/IconCalendar.vue b/components/Icons/IconCalendar.vue index e92d34fc..3ccd28a7 100644 --- a/components/Icons/IconCalendar.vue +++ b/components/Icons/IconCalendar.vue @@ -1,15 +1,15 @@ diff --git a/components/Icons/IconClass.vue b/components/Icons/IconClass.vue index 3a6b8574..bf95a99d 100644 --- a/components/Icons/IconClass.vue +++ b/components/Icons/IconClass.vue @@ -1,13 +1,13 @@ diff --git a/components/Icons/IconClock.vue b/components/Icons/IconClock.vue index c41815b7..bf68e1bd 100644 --- a/components/Icons/IconClock.vue +++ b/components/Icons/IconClock.vue @@ -1,14 +1,14 @@ diff --git a/components/Icons/IconClose.vue b/components/Icons/IconClose.vue index 434a1b3d..22e4f519 100644 --- a/components/Icons/IconClose.vue +++ b/components/Icons/IconClose.vue @@ -1,19 +1,15 @@ diff --git a/components/Icons/IconConfirm.vue b/components/Icons/IconConfirm.vue index 8b7df3aa..d2dc8c9c 100644 --- a/components/Icons/IconConfirm.vue +++ b/components/Icons/IconConfirm.vue @@ -1,16 +1,16 @@ diff --git a/components/Icons/IconCourse.vue b/components/Icons/IconCourse.vue index 020c670b..5741cf5f 100644 --- a/components/Icons/IconCourse.vue +++ b/components/Icons/IconCourse.vue @@ -1,14 +1,14 @@ diff --git a/components/Icons/IconDiary.vue b/components/Icons/IconDiary.vue index 70006602..98dff5cd 100644 --- a/components/Icons/IconDiary.vue +++ b/components/Icons/IconDiary.vue @@ -1,13 +1,13 @@ diff --git a/components/Icons/IconDiscipline.vue b/components/Icons/IconDiscipline.vue index 6ba442bb..395f9e55 100644 --- a/components/Icons/IconDiscipline.vue +++ b/components/Icons/IconDiscipline.vue @@ -1,14 +1,14 @@ diff --git a/components/Icons/IconEdit.vue b/components/Icons/IconEdit.vue index 43c3e530..68395c19 100644 --- a/components/Icons/IconEdit.vue +++ b/components/Icons/IconEdit.vue @@ -1,15 +1,15 @@ diff --git a/components/Icons/IconEducator.vue b/components/Icons/IconEducator.vue index 04337fed..199cbca8 100644 --- a/components/Icons/IconEducator.vue +++ b/components/Icons/IconEducator.vue @@ -1,14 +1,14 @@ diff --git a/components/Icons/IconEvent.vue b/components/Icons/IconEvent.vue index 3d6605b8..01cd2de5 100644 --- a/components/Icons/IconEvent.vue +++ b/components/Icons/IconEvent.vue @@ -1,15 +1,15 @@ diff --git a/components/Icons/IconExclude.vue b/components/Icons/IconExclude.vue index ff79c2d6..27f90186 100644 --- a/components/Icons/IconExclude.vue +++ b/components/Icons/IconExclude.vue @@ -1,13 +1,13 @@ diff --git a/components/Icons/IconExit.vue b/components/Icons/IconExit.vue index 9e01fd16..cc0dbfc0 100644 --- a/components/Icons/IconExit.vue +++ b/components/Icons/IconExit.vue @@ -1,16 +1,16 @@ diff --git a/components/Icons/IconFilePicker.vue b/components/Icons/IconFilePicker.vue index 5fd1980e..2d772886 100644 --- a/components/Icons/IconFilePicker.vue +++ b/components/Icons/IconFilePicker.vue @@ -1,35 +1,35 @@ diff --git a/components/Icons/IconGenerate.vue b/components/Icons/IconGenerate.vue index 2e473a40..42fa0e2c 100644 --- a/components/Icons/IconGenerate.vue +++ b/components/Icons/IconGenerate.vue @@ -1,16 +1,16 @@ diff --git a/components/Icons/IconHome.vue b/components/Icons/IconHome.vue index 5be45401..76bfa519 100644 --- a/components/Icons/IconHome.vue +++ b/components/Icons/IconHome.vue @@ -1,14 +1,14 @@ diff --git a/components/Icons/IconLink.vue b/components/Icons/IconLink.vue index 2bf0dbb5..11638261 100644 --- a/components/Icons/IconLink.vue +++ b/components/Icons/IconLink.vue @@ -1,14 +1,14 @@ diff --git a/components/Icons/IconMoreItems.vue b/components/Icons/IconMoreItems.vue index 9c8b600c..f526d823 100644 --- a/components/Icons/IconMoreItems.vue +++ b/components/Icons/IconMoreItems.vue @@ -1,26 +1,26 @@ diff --git a/components/Icons/IconNotifications.vue b/components/Icons/IconNotifications.vue index 5d7a34b7..7230ac93 100644 --- a/components/Icons/IconNotifications.vue +++ b/components/Icons/IconNotifications.vue @@ -1,16 +1,16 @@ diff --git a/components/Icons/IconSearch.vue b/components/Icons/IconSearch.vue index 64b88fe3..d843db3d 100644 --- a/components/Icons/IconSearch.vue +++ b/components/Icons/IconSearch.vue @@ -1,15 +1,15 @@ diff --git a/components/Icons/IconSecurity.vue b/components/Icons/IconSecurity.vue index c756e25c..0720f06d 100644 --- a/components/Icons/IconSecurity.vue +++ b/components/Icons/IconSecurity.vue @@ -1,14 +1,14 @@ diff --git a/components/Icons/IconSettings.vue b/components/Icons/IconSettings.vue index df988489..f9c65ed1 100644 --- a/components/Icons/IconSettings.vue +++ b/components/Icons/IconSettings.vue @@ -1,15 +1,15 @@ diff --git a/components/Icons/IconUser.vue b/components/Icons/IconUser.vue index 417eef6c..44c968c3 100644 --- a/components/Icons/IconUser.vue +++ b/components/Icons/IconUser.vue @@ -1,18 +1,18 @@ diff --git a/components/Icons/IconUsers.vue b/components/Icons/IconUsers.vue index 6dec6b72..24099c80 100644 --- a/components/Icons/IconUsers.vue +++ b/components/Icons/IconUsers.vue @@ -1,14 +1,14 @@ diff --git a/components/Icons/Menu/IconHamburgerOff.vue b/components/Icons/Menu/IconHamburgerOff.vue index 65f1df88..18af506f 100644 --- a/components/Icons/Menu/IconHamburgerOff.vue +++ b/components/Icons/Menu/IconHamburgerOff.vue @@ -1,15 +1,15 @@ diff --git a/components/Icons/Menu/IconHamburgerOn.vue b/components/Icons/Menu/IconHamburgerOn.vue index 9dc1c485..4b65873e 100644 --- a/components/Icons/Menu/IconHamburgerOn.vue +++ b/components/Icons/Menu/IconHamburgerOn.vue @@ -1,13 +1,13 @@ diff --git a/components/Logo/Sisgha/Logo.vue b/components/Logo/Sisgha/Logo.vue index 3570ff1e..af39f4d6 100644 --- a/components/Logo/Sisgha/Logo.vue +++ b/components/Logo/Sisgha/Logo.vue @@ -1,16 +1,16 @@ diff --git a/components/Logo/Sisgha/Logomarca.vue b/components/Logo/Sisgha/Logomarca.vue index 921c53b8..750d7538 100644 --- a/components/Logo/Sisgha/Logomarca.vue +++ b/components/Logo/Sisgha/Logomarca.vue @@ -1,19 +1,19 @@ diff --git a/components/Modais/ModalImage.vue b/components/Modais/ModalImage.vue index d6078f80..912c9387 100644 --- a/components/Modais/ModalImage.vue +++ b/components/Modais/ModalImage.vue @@ -1,152 +1,152 @@ diff --git a/components/Pages/DashboardCalendar/Calendar.vue b/components/Pages/DashboardCalendar/Calendar.vue index c3627dbd..5eceeba6 100644 --- a/components/Pages/DashboardCalendar/Calendar.vue +++ b/components/Pages/DashboardCalendar/Calendar.vue @@ -3,20 +3,20 @@ // Interface and types type EventData = { - id: string; - type: string; - startDate: string; - endDate: string; - color: string; + id: string; + type: string; + startDate: string; + endDate: string; + color: string; }; type Step = EventData & { - number: number; + number: number; }; type Event = EventData & { - name: string; - locale: string; + name: string; + locale: string; }; // Props @@ -26,77 +26,77 @@ const props = defineProps({}); // Years const years = [2024, 2023, 2022, 2021, 2020, 2019]; const calendars = [ - 'Informática 2024', - 'Informática 2023', - 'Informática 2022', - 'Informática 2021', - 'Informática 2020', - 'Informática 2019', + 'Informática 2024', + 'Informática 2023', + 'Informática 2022', + 'Informática 2021', + 'Informática 2020', + 'Informática 2019', ]; // Event and steps (For example. Remove in other moment) const stepItems: Array = [ - { - id: '123452', - number: 1, - startDate: '2024-02-08', - endDate: '2024-03-23', - color: '#0092E4', - type: 'step', - }, - { - id: '24522', - number: 2, - startDate: '2024-03-24', - endDate: '2024-05-14', - color: '#2DAC0D', - type: 'step', - }, - { - id: '3456', - number: 3, - startDate: '2024-05-15', - endDate: '2024-07-09', - color: '#D1A300', - type: 'step', - }, - { - id: '544', - number: 4, - startDate: '2024-08-10', - endDate: '2024-11-28', - color: '#D7004D', - type: 'step', - }, + { + id: '123452', + number: 1, + startDate: '2024-02-08', + endDate: '2024-03-23', + color: '#0092E4', + type: 'step', + }, + { + id: '24522', + number: 2, + startDate: '2024-03-24', + endDate: '2024-05-14', + color: '#2DAC0D', + type: 'step', + }, + { + id: '3456', + number: 3, + startDate: '2024-05-15', + endDate: '2024-07-09', + color: '#D1A300', + type: 'step', + }, + { + id: '544', + number: 4, + startDate: '2024-08-10', + endDate: '2024-11-28', + color: '#D7004D', + type: 'step', + }, ]; const eventItems: Array = [ - { - id: '121312', - name: 'IFRO Party', - startDate: '2024-05-15', - endDate: '2024-05-22', - locale: 'Refeitório', - color: '#B51B2A', - type: 'event', - }, - { - id: '1242', - name: 'IFRO Party 2', - startDate: '2024-05-15', - endDate: '2024-05-22', - locale: 'Refeitório', - color: '#211F1B', - type: 'event', - }, - { - id: '12345', - name: 'IFRO Party 3', - startDate: '2024-05-31', - endDate: '2024-06-05', - locale: 'Refeitório', - color: '#0092E4', - type: 'event', - }, + { + id: '121312', + name: 'IFRO Party', + startDate: '2024-05-15', + endDate: '2024-05-22', + locale: 'Refeitório', + color: '#B51B2A', + type: 'event', + }, + { + id: '1242', + name: 'IFRO Party 2', + startDate: '2024-05-15', + endDate: '2024-05-22', + locale: 'Refeitório', + color: '#211F1B', + type: 'event', + }, + { + id: '12345', + name: 'IFRO Party 3', + startDate: '2024-05-31', + endDate: '2024-06-05', + locale: 'Refeitório', + color: '#0092E4', + type: 'event', + }, ]; // Functions @@ -105,114 +105,114 @@ const eventItems: Array = [ let monthNumReceived = ref(0); const handleUpdate = (v: number) => { - monthNumReceived.value = v; + monthNumReceived.value = v; }; // Watch month for toggle value watch(monthNumReceived, (newValue: number) => { - if (newValue !== null) { - monthNumReceived.value = newValue; - } + if (newValue !== null) { + monthNumReceived.value = newValue; + } }); diff --git a/components/Pages/DashboardCalendar/Event.vue b/components/Pages/DashboardCalendar/Event.vue index 3d4d55a3..f69567e9 100644 --- a/components/Pages/DashboardCalendar/Event.vue +++ b/components/Pages/DashboardCalendar/Event.vue @@ -3,43 +3,37 @@ // Props const props = defineProps({ - id: String, - name: String, - details: String, - locale: String, - color: String, + id: String, + name: String, + details: String, + locale: String, + color: String, }); // Event diff --git a/components/Pages/DashboardCalendar/EventList.vue b/components/Pages/DashboardCalendar/EventList.vue index 63de2874..f1da64b9 100644 --- a/components/Pages/DashboardCalendar/EventList.vue +++ b/components/Pages/DashboardCalendar/EventList.vue @@ -10,174 +10,170 @@ dayjs.extend(isBetween); // Interface and types type EventData = { - id: string; - type: string; - startDate: string; - endDate: string; - color: string; + id: string; + type: string; + startDate: string; + endDate: string; + color: string; }; type Step = EventData & { - number: number; + number: number; }; type Event = EventData & { - name: string; - locale: string; + name: string; + locale: string; }; type EventItem = Omit & { - details: string; - locale?: string; + details: string; + locale?: string; }; // Props const props = defineProps({ - year: Number, - steps: Array, - events: Array, - monthNum: Number, + year: Number, + steps: Array, + events: Array, + monthNum: Number, }); // Set event data let allEventItems = ref([ - { - id: '', - name: '', - details: '', - color: '', - startDate: '', - endDate: '', - }, + { + id: '', + name: '', + details: '', + color: '', + startDate: '', + endDate: '', + }, ]); async function setEvents(): Promise { - try { - // Push in 'EventItems' array - async function pushItemInList( - Id: string, - Name: string, - StartDate: string, - EndDate: string, - Color: string, - Locale?: string - ): Promise { - try { - allEventItems.value.push({ - id: Id, - name: Name, - details: `Este evento começa dia ${dayjs( - dayjs(StartDate).toDate() - ).format('DD/MM')} e termina em ${dayjs( - dayjs(EndDate).toDate() - ).format('DD/MM')}.`, - color: Color, - locale: Locale, - startDate: StartDate, - endDate: EndDate, - }); - } catch (error) {} - } - - // Set all events - async function setAllItems(): Promise { - try { - allEventItems.value = []; - - // Set steps - for (let i = 0; i < props.steps!.length; i++) { - await pushItemInList( - props.steps![i].id, - `${props.steps![i].number}° Etapa`, - props.steps![i].startDate, - props.steps![i].endDate, - props.steps![i].color - ); - } - - // Set events - for (let i = 0; i < props.events!.length; i++) { - await pushItemInList( - props.events![i].id, - props.events![i].name, - props.events![i].startDate, - props.events![i].endDate, - props.events![i].color, - props.events![i].locale - ); - } - - return true; - } catch (error) { - return false; - } - } - - // Order list by date - async function OrderList(): Promise { - try { - // Order - allEventItems.value = allEventItems.value - .slice() - .sort((a, b) => { - // Save diff dates - const date1 = dayjs(a.endDate).diff(dayjs().toDate()); - const date2 = dayjs(b.endDate).diff(dayjs().toDate()); - // Remove before events - return date1 - date2; - }); - - // Order events by month - const firstDayOfMonth = dayjs( - `${props.year!}-${props.monthNum! + 1}-01` - ); - - allEventItems.value = allEventItems.value.filter( - (event) => - (dayjs(event.startDate) >= - firstDayOfMonth.startOf('month') || - dayjs(event.endDate) >= - firstDayOfMonth.startOf('month')) && - dayjs(event.startDate) <= firstDayOfMonth.endOf('month') - ); - } catch (error) {} - } - - // Calling internal functions - await setAllItems(); - await OrderList(); - } catch (error) {} + try { + // Push in 'EventItems' array + async function pushItemInList( + Id: string, + Name: string, + StartDate: string, + EndDate: string, + Color: string, + Locale?: string + ): Promise { + try { + allEventItems.value.push({ + id: Id, + name: Name, + details: `Este evento começa dia ${dayjs( + dayjs(StartDate).toDate() + ).format('DD/MM')} e termina em ${dayjs( + dayjs(EndDate).toDate() + ).format('DD/MM')}.`, + color: Color, + locale: Locale, + startDate: StartDate, + endDate: EndDate, + }); + } catch (error) {} + } + + // Set all events + async function setAllItems(): Promise { + try { + allEventItems.value = []; + + // Set steps + for (let i = 0; i < props.steps!.length; i++) { + await pushItemInList( + props.steps![i].id, + `${props.steps![i].number}° Etapa`, + props.steps![i].startDate, + props.steps![i].endDate, + props.steps![i].color + ); + } + + // Set events + for (let i = 0; i < props.events!.length; i++) { + await pushItemInList( + props.events![i].id, + props.events![i].name, + props.events![i].startDate, + props.events![i].endDate, + props.events![i].color, + props.events![i].locale + ); + } + + return true; + } catch (error) { + return false; + } + } + + // Order list by date + async function OrderList(): Promise { + try { + // Order + allEventItems.value = allEventItems.value.slice().sort((a, b) => { + // Save diff dates + const date1 = dayjs(a.endDate).diff(dayjs().toDate()); + const date2 = dayjs(b.endDate).diff(dayjs().toDate()); + // Remove before events + return date1 - date2; + }); + + // Order events by month + const firstDayOfMonth = dayjs( + `${props.year!}-${props.monthNum! + 1}-01` + ); + + allEventItems.value = allEventItems.value.filter( + (event) => + (dayjs(event.startDate) >= firstDayOfMonth.startOf('month') || + dayjs(event.endDate) >= firstDayOfMonth.startOf('month')) && + dayjs(event.startDate) <= firstDayOfMonth.endOf('month') + ); + } catch (error) {} + } + + // Calling internal functions + await setAllItems(); + await OrderList(); + } catch (error) {} } onMounted(async () => { - await setEvents(); - - // Watch month for toggle events - watch( - () => props.monthNum!, - async (newValue: number) => { - if (newValue !== null) { - await setEvents(); - } - } - ); + await setEvents(); + + // Watch month for toggle events + watch( + () => props.monthNum!, + async (newValue: number) => { + if (newValue !== null) { + await setEvents(); + } + } + ); }); diff --git a/components/Pages/DashboardCalendar/Month.vue b/components/Pages/DashboardCalendar/Month.vue index 96a07c35..5e8275e5 100644 --- a/components/Pages/DashboardCalendar/Month.vue +++ b/components/Pages/DashboardCalendar/Month.vue @@ -10,34 +10,34 @@ dayjs.extend(isBetween); // Interface and types type Day = { - num: number; - day: string; - date: string; - color: string; + num: number; + day: string; + date: string; + color: string; }; type Step = { - id: string; - number: number; - startDate: string; - endDate: string; - color: string; + id: string; + number: number; + startDate: string; + endDate: string; + color: string; }; type Event = { - id: string; - name: string; - startDate: string; - endDate: string; - color: string; + id: string; + name: string; + startDate: string; + endDate: string; + color: string; }; // Props const props = defineProps({ - year: Number, - toggleMonth: Boolean, - steps: Array, - events: Array, + year: Number, + toggleMonth: Boolean, + steps: Array, + events: Array, }); // Month @@ -47,299 +47,283 @@ let monthNum = ref(dayjs().month()); let monthColor = ref('#9ab69e'); let calendarDays = { - daysInMonth: ref([]), - emptyDays: { - before: ref(0), - after: ref(0), - }, + daysInMonth: ref([]), + emptyDays: { + before: ref(0), + after: ref(0), + }, }; // Functions // Month num (emit value) const emit = defineEmits<{ - (e: 'custom:monthNum', v: number): void; + (e: 'custom:monthNum', v: number): void; }>(); const handleCalling = (v: number) => { - if (v !== null) emit('custom:monthNum', v); + if (v !== null) emit('custom:monthNum', v); }; // Set days from this month async function setMonth(): Promise { - try { - // Set empty days - async function setEmptyDays(): Promise { - try { - // Calc before days - calendarDays.emptyDays.before.value = dayjs( - `${props.year!}-${monthNum.value + 1}-01` - ).day(); - calendarDays.emptyDays.after.value = - 7 * 6 - - (calendarDays.emptyDays.before.value + - calendarDays.daysInMonth.value.length); - return true; - } catch (error) { - return false; - } - } - - // Set days - async function setDays(): Promise { - try { - calendarDays.daysInMonth.value = []; - - // Set days - async function setDaysData(): Promise { - try { - // Repeat loop - for ( - let i = 0; - i < - dayjs( - dayjs(`${props.year!}-${monthNum.value + 1}-01`) - ).daysInMonth(); - i++ - ) { - calendarDays.daysInMonth.value.push({ - num: i, - day: dayjs( - `${props.year!}-${monthNum.value + 1}-${i + 1}` - ).format('dddd'), - date: `${props.year!}-${monthNum.value + 1}-${i + 1}`, - color: '#9ab69e', - }); - } - - return true; - } catch (error) { - return false; - } - } - - // Set steps - async function setDatesColor(): Promise { - try { - // Set steps - for (let i = 0; i < props.steps!.length; i++) { - // Check if date is between the start or end of the month - for ( - let j = 0; - j < calendarDays.daysInMonth.value.length; - j++ - ) { - // Set start and end day color - if ( - // Check if the date is between - dayjs( - calendarDays.daysInMonth.value[j].date - ).isBetween( - props.steps![i].startDate, - props.steps![i].endDate, - 'date', - '[]' - ) === true - ) { - // Set color - calendarDays.daysInMonth.value[j].color = - props.steps![i].color; - } else { - } - } - } - - // Set events - for (let i = 0; i < props.events!.length; i++) { - // Check if date is between the start or end of the month - for ( - let j = 0; - j < calendarDays.daysInMonth.value.length; - j++ - ) { - // Set start and end day color - if ( - // Check if the date is between - dayjs( - calendarDays.daysInMonth.value[j].date - ).isBetween( - props.events![i].startDate, - props.events![i].endDate, - 'date', - '[]' - ) - ) { - // Set color - calendarDays.daysInMonth.value[j].color = - props.events![i].color; - } else { - } - } - } - - return true; - } catch (error) { - return false; - } - } - - // Calling internal functions - await setDaysData(); - await setDatesColor(); - await setEmptyDays(); - - // Set month color - for (let i = 0; i < props.steps!.length; i++) { - if ( - // Check if month is between the start or end of the step - dayjs( - `${props.year!}-${monthNum.value + 1}-${dayjs(props.steps![i].startDate).date()}` - ).isBetween( - props.steps![i].startDate, - props.steps![i].endDate, - 'date', - '[]' - ) === true || - dayjs( - `${props.year!}-${monthNum.value + 1}-${dayjs(props.steps![i].endDate).date()}` - ).isBetween( - props.steps![i].startDate, - props.steps![i].endDate, - 'date', - '[]' - ) === true - ) { - monthColor.value = props.steps![i].color; - break; - } else { - monthColor.value = '#9ab69e'; - } - } - - return true; - } catch (error) { - return false; - } - } - - // Calling internal functions - await setDays(); - handleCalling(monthNum.value); - } catch (error) {} + try { + // Set empty days + async function setEmptyDays(): Promise { + try { + // Calc before days + calendarDays.emptyDays.before.value = dayjs( + `${props.year!}-${monthNum.value + 1}-01` + ).day(); + calendarDays.emptyDays.after.value = + 7 * 6 - + (calendarDays.emptyDays.before.value + + calendarDays.daysInMonth.value.length); + return true; + } catch (error) { + return false; + } + } + + // Set days + async function setDays(): Promise { + try { + calendarDays.daysInMonth.value = []; + + // Set days + async function setDaysData(): Promise { + try { + // Repeat loop + for ( + let i = 0; + i < + dayjs( + dayjs(`${props.year!}-${monthNum.value + 1}-01`) + ).daysInMonth(); + i++ + ) { + calendarDays.daysInMonth.value.push({ + num: i, + day: dayjs( + `${props.year!}-${monthNum.value + 1}-${i + 1}` + ).format('dddd'), + date: `${props.year!}-${monthNum.value + 1}-${i + 1}`, + color: '#9ab69e', + }); + } + + return true; + } catch (error) { + return false; + } + } + + // Set steps + async function setDatesColor(): Promise { + try { + // Set steps + for (let i = 0; i < props.steps!.length; i++) { + // Check if date is between the start or end of the month + for (let j = 0; j < calendarDays.daysInMonth.value.length; j++) { + // Set start and end day color + if ( + // Check if the date is between + dayjs(calendarDays.daysInMonth.value[j].date).isBetween( + props.steps![i].startDate, + props.steps![i].endDate, + 'date', + '[]' + ) === true + ) { + // Set color + calendarDays.daysInMonth.value[j].color = + props.steps![i].color; + } else { + } + } + } + + // Set events + for (let i = 0; i < props.events!.length; i++) { + // Check if date is between the start or end of the month + for (let j = 0; j < calendarDays.daysInMonth.value.length; j++) { + // Set start and end day color + if ( + // Check if the date is between + dayjs(calendarDays.daysInMonth.value[j].date).isBetween( + props.events![i].startDate, + props.events![i].endDate, + 'date', + '[]' + ) + ) { + // Set color + calendarDays.daysInMonth.value[j].color = + props.events![i].color; + } else { + } + } + } + + return true; + } catch (error) { + return false; + } + } + + // Calling internal functions + await setDaysData(); + await setDatesColor(); + await setEmptyDays(); + + // Set month color + for (let i = 0; i < props.steps!.length; i++) { + if ( + // Check if month is between the start or end of the step + dayjs( + `${props.year!}-${monthNum.value + 1}-${dayjs(props.steps![i].startDate).date()}` + ).isBetween( + props.steps![i].startDate, + props.steps![i].endDate, + 'date', + '[]' + ) === true || + dayjs( + `${props.year!}-${monthNum.value + 1}-${dayjs(props.steps![i].endDate).date()}` + ).isBetween( + props.steps![i].startDate, + props.steps![i].endDate, + 'date', + '[]' + ) === true + ) { + monthColor.value = props.steps![i].color; + break; + } else { + monthColor.value = '#9ab69e'; + } + } + + return true; + } catch (error) { + return false; + } + } + + // Calling internal functions + await setDays(); + handleCalling(monthNum.value); + } catch (error) {} } // Toggle month async function toggleMonth(num: number): Promise { - try { - // Toggle - monthNum.value += num; + try { + // Toggle + monthNum.value += num; - if (monthNum.value > 11) monthNum.value = 0; - else if (monthNum.value < 0) monthNum.value = 11; + if (monthNum.value > 11) monthNum.value = 0; + else if (monthNum.value < 0) monthNum.value = 11; - // Calling functions - await setMonth(); - handleCalling(monthNum.value); - } catch (error) {} + // Calling functions + await setMonth(); + handleCalling(monthNum.value); + } catch (error) {} } // Testes onMounted(async () => { - // Calling functions - await setMonth(); + // Calling functions + await setMonth(); }); diff --git a/components/SearchBar.vue b/components/SearchBar.vue index 241212a5..46d56b1b 100644 --- a/components/SearchBar.vue +++ b/components/SearchBar.vue @@ -17,9 +17,9 @@ diff --git a/components/Section/Ambientes/Grid/Grid.vue b/components/Section/Ambientes/Grid/Grid.vue index f2164f00..0bf050b8 100644 --- a/components/Section/Ambientes/Grid/Grid.vue +++ b/components/Section/Ambientes/Grid/Grid.vue @@ -1,6 +1,6 @@ diff --git a/components/Section/Ambientes/Modal/Modal.vue b/components/Section/Ambientes/Modal/Modal.vue index b8093be1..ad7869f7 100644 --- a/components/Section/Ambientes/Modal/Modal.vue +++ b/components/Section/Ambientes/Modal/Modal.vue @@ -2,11 +2,11 @@ import { ref } from 'vue'; const props = defineProps({ - editId: { - type: String, - default: null, - required: false, - }, + editId: { + type: String, + default: null, + required: false, + }, }); const editId = toRef(props, 'editId'); @@ -15,33 +15,33 @@ const isActive = ref(false); diff --git a/components/Section/Blocos/Blocos.vue b/components/Section/Blocos/Blocos.vue index 97fa0417..a6dd4ad9 100644 --- a/components/Section/Blocos/Blocos.vue +++ b/components/Section/Blocos/Blocos.vue @@ -5,29 +5,29 @@ const searchBarText = ref(''); diff --git a/components/Section/Blocos/Grid/Grid.vue b/components/Section/Blocos/Grid/Grid.vue index 96e668af..c753ac41 100644 --- a/components/Section/Blocos/Grid/Grid.vue +++ b/components/Section/Blocos/Grid/Grid.vue @@ -1,6 +1,6 @@ diff --git a/components/Section/Blocos/Modal/Modal.vue b/components/Section/Blocos/Modal/Modal.vue index 05ee5135..7af7635e 100644 --- a/components/Section/Blocos/Modal/Modal.vue +++ b/components/Section/Blocos/Modal/Modal.vue @@ -2,11 +2,11 @@ import { ref } from 'vue'; const props = defineProps({ - editId: { - type: String, - default: null, - required: false, - }, + editId: { + type: String, + default: null, + required: false, + }, }); const editId = toRef(props, 'editId'); @@ -15,33 +15,30 @@ const isActive = ref(false); diff --git a/components/Section/Cursos/Cursos.vue b/components/Section/Cursos/Cursos.vue index 94a75713..0d30412b 100644 --- a/components/Section/Cursos/Cursos.vue +++ b/components/Section/Cursos/Cursos.vue @@ -5,29 +5,29 @@ const searchBarText = ref(''); diff --git a/components/Section/Cursos/Grid/Grid.vue b/components/Section/Cursos/Grid/Grid.vue index 58b2a284..c5bbcf4a 100644 --- a/components/Section/Cursos/Grid/Grid.vue +++ b/components/Section/Cursos/Grid/Grid.vue @@ -1,6 +1,6 @@ diff --git a/components/Section/Cursos/Modal/Modal.vue b/components/Section/Cursos/Modal/Modal.vue index d45d79f7..91acec93 100644 --- a/components/Section/Cursos/Modal/Modal.vue +++ b/components/Section/Cursos/Modal/Modal.vue @@ -2,11 +2,11 @@ import { ref } from 'vue'; const props = defineProps({ - editId: { - type: String, - default: null, - required: false, - }, + editId: { + type: String, + default: null, + required: false, + }, }); const editId = toRef(props, 'editId'); @@ -15,33 +15,30 @@ const isActive = ref(false); diff --git a/components/Section/Diarios/Diarios.vue b/components/Section/Diarios/Diarios.vue index 322612d7..3b8db9b3 100644 --- a/components/Section/Diarios/Diarios.vue +++ b/components/Section/Diarios/Diarios.vue @@ -5,29 +5,29 @@ const searchBarText = ref(''); diff --git a/components/Section/Diarios/Form/Form.vue b/components/Section/Diarios/Form/Form.vue index 8edea00b..40fccf27 100644 --- a/components/Section/Diarios/Form/Form.vue +++ b/components/Section/Diarios/Form/Form.vue @@ -33,12 +33,14 @@ const { disciplinas } = await useApiDisciplinasFindAll(searchBarText); {{ disciplina.nome }} - diff --git a/components/Section/Diarios/Grid/Grid.vue b/components/Section/Diarios/Grid/Grid.vue index 2cf295a5..37f0b687 100644 --- a/components/Section/Diarios/Grid/Grid.vue +++ b/components/Section/Diarios/Grid/Grid.vue @@ -1,7 +1,6 @@ \ No newline at end of file + + + + diff --git a/components/Section/Diarios/Grid/Item/Item.vue b/components/Section/Diarios/Grid/Item/Item.vue index 5ef3f6e5..5f083c51 100644 --- a/components/Section/Diarios/Grid/Item/Item.vue +++ b/components/Section/Diarios/Grid/Item/Item.vue @@ -3,13 +3,15 @@ import { defineProps, toRefs, computed } from 'vue'; // Definição das props ajustadas const props = defineProps({ - diario: Object + diario: Object, }); const { diario } = toRefs(props); // Realizei a chamada da ROTA useApiDiariosProfessorFindAllByDiarioId -const { diarioProfessorList } = await useApiDiariosProfessorFindAllByDiarioId({ diario: diario.value }); +const { diarioProfessorList } = await useApiDiariosProfessorFindAllByDiarioId({ + diario: diario.value, +}); diff --git a/components/Section/Horario/IGradeHorario.ts b/components/Section/Horario/IGradeHorario.ts index f40ac862..c2713b8c 100644 --- a/components/Section/Horario/IGradeHorario.ts +++ b/components/Section/Horario/IGradeHorario.ts @@ -1,20 +1,19 @@ export type IDiaDaSemana = { - nome: string; -} + nome: string; +}; export type IDiasDaSemana = Array; export type ITurnoHorario = { - hora: string; - tipo: 'intervalo' | 'aula';//////// + hora: string; + tipo: 'intervalo' | 'aula'; //////// }; export type ITurnoHorarios = ITurnoHorario[]; export type ITurno = { - nome: string; - horarios: ITurnoHorarios; + nome: string; + horarios: ITurnoHorarios; }; - -export type ITurnos = ITurno[] \ No newline at end of file +export type ITurnos = ITurno[]; diff --git a/components/Section/Horario/Modal/Modal.vue b/components/Section/Horario/Modal/Modal.vue index e2304dd7..65a3d659 100644 --- a/components/Section/Horario/Modal/Modal.vue +++ b/components/Section/Horario/Modal/Modal.vue @@ -1,19 +1,17 @@ diff --git a/components/Section/Horario/Shift/ShiftTag.vue b/components/Section/Horario/Shift/ShiftTag.vue index 28218a0e..8c168a5a 100644 --- a/components/Section/Horario/Shift/ShiftTag.vue +++ b/components/Section/Horario/Shift/ShiftTag.vue @@ -2,16 +2,16 @@ import type { ITurno } from '../IGradeHorario'; type Props = { - turno: ITurno; + turno: ITurno; }; defineProps(); diff --git a/components/Section/Horario/Shifts/Shifts.vue b/components/Section/Horario/Shifts/Shifts.vue index 89aa882f..43ffb266 100644 --- a/components/Section/Horario/Shifts/Shifts.vue +++ b/components/Section/Horario/Shifts/Shifts.vue @@ -2,22 +2,22 @@ import type { IDiasDaSemana, ITurnos } from '../IGradeHorario'; type Props = { - turnos: ITurnos; - diasDaSemana: IDiasDaSemana; + turnos: ITurnos; + diasDaSemana: IDiasDaSemana; }; defineProps(); diff --git a/components/Section/Horario/ViewMode.ts b/components/Section/Horario/ViewMode.ts index e398bab4..866f3090 100644 --- a/components/Section/Horario/ViewMode.ts +++ b/components/Section/Horario/ViewMode.ts @@ -1,4 +1,4 @@ export enum ViewMode { - GENERAL_SCHEDULE = "horario-geral", - DAILY_SCHEDULE = "horario-do-dia" -} \ No newline at end of file + GENERAL_SCHEDULE = 'horario-geral', + DAILY_SCHEDULE = 'horario-do-dia', +} diff --git a/components/Section/Horario/Week/HeaderDay.vue b/components/Section/Horario/Week/HeaderDay.vue index 96b44fb9..9be7b917 100644 --- a/components/Section/Horario/Week/HeaderDay.vue +++ b/components/Section/Horario/Week/HeaderDay.vue @@ -2,18 +2,18 @@ import type { IDiaDaSemana } from '../IGradeHorario'; type Props = { - diaDaSemana: IDiaDaSemana; + diaDaSemana: IDiaDaSemana; }; defineProps(); diff --git a/components/Section/Horario/Week/HeaderDays.vue b/components/Section/Horario/Week/HeaderDays.vue index e391de55..04dffee0 100644 --- a/components/Section/Horario/Week/HeaderDays.vue +++ b/components/Section/Horario/Week/HeaderDays.vue @@ -2,16 +2,16 @@ import type { IDiasDaSemana } from '../IGradeHorario'; type Props = { - diasDaSemana: IDiasDaSemana; + diasDaSemana: IDiasDaSemana; }; defineProps(); diff --git a/components/Section/Loading/Loading.vue b/components/Section/Loading/Loading.vue index 0fc6cad8..3b238fa6 100644 --- a/components/Section/Loading/Loading.vue +++ b/components/Section/Loading/Loading.vue @@ -1,3 +1,3 @@ \ No newline at end of file + diff --git a/components/Section/Login/Login.vue b/components/Section/Login/Login.vue index b0b767e7..f6df2257 100644 --- a/components/Section/Login/Login.vue +++ b/components/Section/Login/Login.vue @@ -1,249 +1,247 @@ diff --git a/components/Section/Login/ResetPassword/Form/Form.vue b/components/Section/Login/ResetPassword/Form/Form.vue index 4ce4a1f5..06df6246 100644 --- a/components/Section/Login/ResetPassword/Form/Form.vue +++ b/components/Section/Login/ResetPassword/Form/Form.vue @@ -5,139 +5,139 @@ import * as yup from 'yup'; const $emit = defineEmits(['close']); const schema = yup.object().shape({ - email: yup - .string() - .email('Por favor, digite um e-mail válido!') - .required('Email é obrigatório.'), + email: yup + .string() + .email('Por favor, digite um e-mail válido!') + .required('Email é obrigatório.'), }); const formInput = reactive({ - email: '', + email: '', }); const { handleSubmit } = useForm({ - validationSchema: schema, - initialValues: formInput, + validationSchema: schema, + initialValues: formInput, }); const showAlert = ref(false); const onSubmit = handleSubmit( - (formData) => { - console.log('Formulário válido, pronto para enviar!', { formData }); - showAlert.value = true; - }, - (errors) => { - console.error('Erro de validação:', errors); - } + (formData) => { + console.log('Formulário válido, pronto para enviar!', { formData }); + showAlert.value = true; + }, + (errors) => { + console.error('Erro de validação:', errors); + } ); diff --git a/components/Section/Login/ResetPassword/Modal/Modal.vue b/components/Section/Login/ResetPassword/Modal/Modal.vue index 1444f732..a6bc7915 100644 --- a/components/Section/Login/ResetPassword/Modal/Modal.vue +++ b/components/Section/Login/ResetPassword/Modal/Modal.vue @@ -1,19 +1,17 @@ diff --git a/components/Section/Turmas/Grid/Grid.vue b/components/Section/Turmas/Grid/Grid.vue index dbc01618..80bcfd4f 100644 --- a/components/Section/Turmas/Grid/Grid.vue +++ b/components/Section/Turmas/Grid/Grid.vue @@ -7,27 +7,27 @@ const { turmas } = await useApiTurmasFindAll(searchBarText); diff --git a/components/Section/Turmas/Modal/Modal.vue b/components/Section/Turmas/Modal/Modal.vue index b6460780..4128841e 100644 --- a/components/Section/Turmas/Modal/Modal.vue +++ b/components/Section/Turmas/Modal/Modal.vue @@ -2,11 +2,11 @@ import { ref } from 'vue'; const props = defineProps({ - editId: { - type: String, - default: null, - required: false, - }, + editId: { + type: String, + default: null, + required: false, + }, }); const editId = toRef(props, 'editId'); @@ -15,33 +15,30 @@ const isActive = ref(false); diff --git a/components/Section/Turmas/Turmas.vue b/components/Section/Turmas/Turmas.vue index 2bab109c..879b236e 100644 --- a/components/Section/Turmas/Turmas.vue +++ b/components/Section/Turmas/Turmas.vue @@ -5,29 +5,29 @@ const searchBarText = ref(''); diff --git a/components/Section/Usuarios/Form/FormUserUtils.ts b/components/Section/Usuarios/Form/FormUserUtils.ts index db9fab87..b70999ae 100644 --- a/components/Section/Usuarios/Form/FormUserUtils.ts +++ b/components/Section/Usuarios/Form/FormUserUtils.ts @@ -1,39 +1,39 @@ import type { FormContext } from 'vee-validate'; export type FormUserValues = { - imagem: Blob | null | undefined; + imagem: Blob | null | undefined; - nome: string; - email: string; + nome: string; + email: string; - vinculos: Array; + vinculos: Array; }; export type FormUserOutput = { - imagem: Blob | null | undefined; - nome: string; - codigo: string; + imagem: Blob | null | undefined; + nome: string; + codigo: string; }; export type Vinculo = { - campus: { id: string }; - cargos: Array<'dape' | 'professor'>; + campus: { id: string }; + cargos: Array<'dape' | 'professor'>; }; export const useFormUser = () => { - return inject>('FORM_USER')!; + return inject>('FORM_USER')!; }; export const checkActiveTeacherRole = (vinculo: Vinculo) => { - return vinculo.campus.id !== null && vinculo.cargos.includes('professor'); + return vinculo.campus.id !== null && vinculo.cargos.includes('professor'); }; export const checkHasAtLeastOneActiveTeacherRole = ( - vinculos: Array + vinculos: Array ) => { - return vinculos.some(checkActiveTeacherRole); + return vinculos.some(checkActiveTeacherRole); }; export const getActivesTeacherRole = (vinculos: Array) => { - return vinculos.filter(checkActiveTeacherRole); + return vinculos.filter(checkActiveTeacherRole); }; diff --git a/components/Section/Usuarios/FormRepeater.vue b/components/Section/Usuarios/FormRepeater.vue index 0973acf9..1de99a48 100644 --- a/components/Section/Usuarios/FormRepeater.vue +++ b/components/Section/Usuarios/FormRepeater.vue @@ -4,48 +4,48 @@ import { useField } from 'vee-validate'; const { value: vinculos } = useField('vinculos'); const addField = () => { - // spread operator - // rest operator - vinculos.value = [...vinculos.value, { campus: { id: null }, cargos: [] }]; + // spread operator + // rest operator + vinculos.value = [...vinculos.value, { campus: { id: null }, cargos: [] }]; }; const removeField = (targetIndex: number) => { - if (targetIndex > 0) { - vinculos.value = vinculos.value.filter((_, idx) => idx !== targetIndex); - } + if (targetIndex > 0) { + vinculos.value = vinculos.value.filter((_, idx) => idx !== targetIndex); + } };