diff --git a/.talismanrc b/.talismanrc index 666ce2975..50b1fcbf6 100644 --- a/.talismanrc +++ b/.talismanrc @@ -250,7 +250,7 @@ fileignoreconfig: - filename: packages/shared/src/components/Chat.vue checksum: f2dbbf72bf098c7abd2c3aee230d220f5a5a106952883c0e116eb49f4f9d4db7 - filename: packages/shared/src/components/DsfrMultiSelect.vue - checksum: e635a591f2e2247088bab3a7d25548f251da65330fecaed9ce886fd3dd24fb3e + checksum: 90a7d72295ca0fb55d312f9608cbbe5475183936d21286952357b3961d1bd6fb - filename: packages/shared/src/components/DsfrTabsV2.vue checksum: 960c18a7ad76a91c74e5535240ae6ac4f87bb8aff10155096cd35afe5609cff8 - filename: packages/shared/src/components/PasswordInput.vue diff --git a/packages/frontend-bo/src/components/demandes-sejour/liste.vue b/packages/frontend-bo/src/components/demandes-sejour/liste.vue index 807c5a101..5ce5696d4 100644 --- a/packages/frontend-bo/src/components/demandes-sejour/liste.vue +++ b/packages/frontend-bo/src/components/demandes-sejour/liste.vue @@ -96,26 +96,14 @@ v-if="props.display === displayType.Organisme" class="fr-fieldset__element fr-fieldset__element--inline fr-col-12 fr-col-md-3 fr-col-lg-2" > -
- - - - -
+
import { CardsNumber, - MultiSelectOption, + DsfrMultiSelect, TableWithBackendPagination, ValidationModal, MessageHover, @@ -190,7 +178,6 @@ import { import dayjs from "dayjs"; import DemandeStatusBadge from "~/components/demandes-sejour/DemandeStatusBadge.vue"; import Declaration from "~/components/demandes-sejour/Declaration.vue"; -import Multiselect from "@vueform/multiselect"; import "@vueform/multiselect/themes/default.css"; import { defineProps } from "vue"; @@ -250,7 +237,7 @@ const searchState = reactive({ ? route.query.statuts .split(",") .filter((statut) => Object.values(status.value).includes(statut)) - : null, + : [], action: parseBoolean(route.query.action), message: props.display === displayType.Messagerie, }); @@ -349,14 +336,6 @@ watch( { immediate: true }, ); -const onStatutSelect = (value) => { - if (value.length) { - searchState.statuts = value; - } else { - searchState.statuts = null; - } -}; - const headersOrganisme = [ { column: "idFonctionnelle", diff --git a/packages/frontend-usagers/src/components/demande-sejour/liste.vue b/packages/frontend-usagers/src/components/demande-sejour/liste.vue index 2aba69a0d..dc2356279 100644 --- a/packages/frontend-usagers/src/components/demande-sejour/liste.vue +++ b/packages/frontend-usagers/src/components/demande-sejour/liste.vue @@ -22,150 +22,77 @@ defaultSort
-
- - - - - -
+
-
- - - - - -
+
-
- - - - - -
+
-
- - - - - -
+
-
- - - - - -
+
-
- - - - - -
+
@@ -218,12 +145,11 @@ defaultSort import { MessageEtat, MessageHover, - MultiSelectOption, TableFull, ValidationModal, + DsfrMultiSelect, } from "@vao/shared"; import dayjs from "dayjs"; -import Multiselect from "@vueform/multiselect"; import "@vueform/multiselect/themes/default.css"; import { useDepartementStore } from "~/stores/referentiels"; import { useDemandeSejourStore } from "~/stores/demande-sejour"; @@ -305,24 +231,24 @@ const search = reactive({ declarationId: route.query.declarationId ?.split(",") - ?.flatMap((id) => (isNaN(id) ? [] : [parseInt(id, 10)])) ?? null, - idFonctionnelle: route.query.idFonctionnelle?.split(",") ?? null, - siret: route.query.siret?.split(",") ?? null, + ?.flatMap((id) => (isNaN(id) ? [] : [parseInt(id, 10)])) ?? [], + idFonctionnelle: route.query.idFonctionnelle?.split(",") ?? [], + siret: route.query.siret?.split(",") ?? [], statut: route.query.statut ? route.query.statut .split(",") .filter((statut) => Object.values(DeclarationSejour.statuts).includes(statut), ) - : null, + : [], departementSuivi: route.query.departementSuivi ? route.query.departementSuivi.split(",") - : null, + : [], periode: route.query.periode ? route.query.periode .split(",") .filter((periode) => saisons.includes(periode)) - : null, + : [], }); const demandeSejourStore = useDemandeSejourStore(); @@ -760,7 +686,7 @@ async function copyDS(dsId) { log.d(`demande de séjour ${response.declarationId} dupliquée`); } catch (error) { log.w("Copie de la declaration de sejour : ", { error }); - return toaster.error({ + toaster.error({ titleTag: "h2", description: `Une erreur est survenue lors de la copie de la déclaration de séjour`, }); @@ -784,12 +710,13 @@ async function deleteDS(dsId) { }); } else { log.w("Erreur durant la suppression de la declaration de sejour"); - return toaster.error({ + toaster.error({ titleTag: "h2", description: `Une erreur est survenue lors de la suppression de la déclaration de séjour`, }); } } catch (error) { + log.w("Erreur durant la suppression de la declaration de sejour : "); toaster.error({ titleTag: "h2", description: `Une erreur est survenue lors de la suppression de la déclaration de séjour`, @@ -815,7 +742,7 @@ async function cancelDS(dsId) { }); } else { log.w("Erreur durant l'annulation de la declaration de sejour"); - return toaster.error({ + toaster.error({ titleTag: "h2", description: `Une erreur est survenue lors de l'annulation' de la déclaration de séjour`, }); diff --git a/packages/shared/src/components/DsfrMultiSelect.vue b/packages/shared/src/components/DsfrMultiSelect.vue index 04fdd9405..def111d7b 100644 --- a/packages/shared/src/components/DsfrMultiSelect.vue +++ b/packages/shared/src/components/DsfrMultiSelect.vue @@ -1,6 +1,8 @@ @@ -290,18 +329,22 @@ onUnmounted(() => { - +
-
    +

    + Utilisez la tabulation (ou les touches flèches) pour naviguer dans + la liste des suggestions +

    +
+
+ Pas de résultat +
-
+
@@ -445,6 +491,10 @@ onUnmounted(() => { transform: rotate(-180deg); } +.fr-multi-select__search__icon { + margin-right: 1rem; +} + .fr-multi-select__popover { z-index: 20000; position: absolute; @@ -454,50 +504,12 @@ onUnmounted(() => { top: var(--top-position); padding: 1rem; margin-top: 4px; - background-image: conic-gradient( - from -33.69deg at 50% 100%, - transparent 0deg, - var(--background-overlap-grey) 0deg, - var(--background-overlap-grey) 67.38deg, - transparent 67.38deg - ), - conic-gradient( - from -33.69deg at 50% 100%, - transparent 0deg, - var(--border-default-grey) 0deg, - var(--border-default-grey) 67.38deg, - transparent 67.38deg - ), - linear-gradient( - 90deg, - var(--border-default-grey), - var(--border-default-grey) - ), - linear-gradient( - 90deg, - var(--background-overlap-grey), - var(--background-overlap-grey) - ); - background-position: - 50% calc(100% - 0.5rem), - 50% calc(100% - 0.375rem), - 50% calc(100% - 0.75rem), - 50% calc(100% - 0.75rem); - background-repeat: no-repeat; - background-size: - 0.5rem 0.375rem, - 0.5rem 0.375rem, - 100% 1px, - 100% calc(100% - 0.75rem); -} - -.fade-enter-active, -.fade-leave-active { - transition: opacity 0.5s ease; + background-color: var(--background-overlap-grey); + filter: drop-shadow(var(--overlap-shadow)); } -.fade-enter-from, -.fade-leave-to { - opacity: 0; +.fr-multi-select__popover__fieldset { + max-height: var(--maxOverflowHeight); + overflow: auto; } diff --git a/packages/shared/src/components/index.js b/packages/shared/src/components/index.js index 91ac55dbe..8bd536dc7 100644 --- a/packages/shared/src/components/index.js +++ b/packages/shared/src/components/index.js @@ -1,6 +1,7 @@ import FileUpload from "./FileUpload.vue"; import Chat from "./Chat.vue"; import DsfrDataTableV2 from "./Table/DsfrDataTableV2.vue"; +import DsfrMultiSelect from "./DsfrMultiSelect.vue"; import TableWithBackendPagination from "./Table/TableWithBackendPagination.vue"; import ValidationModal from "./ValidationModal.vue"; import EigStatusBadge from "./eig/EigStatusBadge.vue"; @@ -18,6 +19,7 @@ export { FileUpload, Chat, DsfrDataTableV2, + DsfrMultiSelect, TableWithBackendPagination, ValidationModal, EigStatusBadge, diff --git a/packages/shared/src/composables/usePopper.ts b/packages/shared/src/composables/usePopper.ts index 675ed9a2e..d47419a0d 100644 --- a/packages/shared/src/composables/usePopper.ts +++ b/packages/shared/src/composables/usePopper.ts @@ -1,8 +1,12 @@ -import { onUnmounted, ref, watch, computed, Ref } from "vue"; +import { onUnmounted, ref, watch, computed } from "vue"; +import type { Ref } from "vue"; -function debounce(func: Function, wait: number) { +function debounce) => void>( + func: T, + wait: number, +) { let timeout: ReturnType; - return (...args: any[]) => { + return (...args: Parameters): void => { clearTimeout(timeout); timeout = setTimeout(() => func(...args), wait); }; @@ -10,7 +14,7 @@ function debounce(func: Function, wait: number) { function observeElementSize( element: HTMLElement, - callback: (elememt: HTMLElement, entry: ResizeObserverEntry) => void, + callback: (element: HTMLElement, entry: ResizeObserverEntry) => void, ) { const resizeObserver = new ResizeObserver((entries) => { for (const entry of entries) { @@ -27,11 +31,11 @@ function observeElementSize( } function trackElementMovement( - elememt: HTMLElement, - callback: (elememt: HTMLElement) => void, + element: HTMLElement, + callback: (element: HTMLElement) => void, ) { const updatePosition = () => { - callback(elememt); + callback(element); }; window.addEventListener("resize", updatePosition); @@ -48,7 +52,7 @@ function trackElementMovement( function observeDomChanges( trackedElement: HTMLElement, element: HTMLElement, - callback: (elememt: HTMLElement) => void, + callback: (element: HTMLElement) => void, ) { const mutationObserver = new MutationObserver((mutations) => { for (const mutation of mutations) { @@ -89,8 +93,8 @@ export function usePopper(host: Ref) { } }; - const setSize = (elememt: HTMLElement) => { - const rect = elememt.getBoundingClientRect(); + const setSize = (element: HTMLElement) => { + const rect = element.getBoundingClientRect(); if ( rect.width !== hostSize.value.width || rect.height !== hostSize.value.height diff --git a/packages/shared/src/index.js b/packages/shared/src/index.js index d77802db8..e777cc041 100644 --- a/packages/shared/src/index.js +++ b/packages/shared/src/index.js @@ -1,4 +1,5 @@ export * from "./components/"; +export * from "./transitions"; export * as eigModel from "./models"; export * as eigSchema from "./schema"; export * from "./utils"; diff --git a/packages/shared/src/transitions/CollapseTransition.vue b/packages/shared/src/transitions/CollapseTransition.vue new file mode 100644 index 000000000..4b672e6f4 --- /dev/null +++ b/packages/shared/src/transitions/CollapseTransition.vue @@ -0,0 +1,65 @@ + + + + + diff --git a/packages/shared/src/transitions/index.js b/packages/shared/src/transitions/index.js new file mode 100644 index 000000000..57b9972ae --- /dev/null +++ b/packages/shared/src/transitions/index.js @@ -0,0 +1,3 @@ +import CollapseTransition from "./CollapseTransition.vue"; + +export { CollapseTransition };