diff --git a/src/app.html b/src/app.html index fdedb90a11d8df4ff7f274876200e8692f85fbbe..4d2beaf7fb3af6161ce6dec9fda30ce9a77c4924 100644 --- a/src/app.html +++ b/src/app.html @@ -3,7 +3,10 @@ <head> <meta charset="utf-8" /> <link rel="icon" href="%sveltekit.assets%/favicon.ico" /> - <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /> + <meta + name="viewport" + content="width=device-width, initial-scale=1, maximum-scale=1" + /> %sveltekit.head% </head> <body data-sveltekit-preload-data="hover"> diff --git a/src/app.postcss b/src/app.postcss index d738acd849657488ea6b453b71d185f441452b58..a1263526fe619eed22681bcc32a83bf3d075cb98 100644 --- a/src/app.postcss +++ b/src/app.postcss @@ -22,7 +22,7 @@ @apply underline hover:text-gray-800; } .opacity-0-unclickable { - @apply opacity-0 pointer-events-none; + @apply pointer-events-none opacity-0; } } diff --git a/src/lib/components/CsgGagnantsPerdantsView.svelte b/src/lib/components/CsgGagnantsPerdantsView.svelte index 2afd5530567446cb85c3e2305a7ac0f882e8fb44..57bc57f7355ae4884d64a79d1c5c740f8d3ed5b8 100644 --- a/src/lib/components/CsgGagnantsPerdantsView.svelte +++ b/src/lib/components/CsgGagnantsPerdantsView.svelte @@ -117,7 +117,7 @@ </Popover> </div> {#if amendmentStateBudget !== undefined || billStateBudget !== undefined} - <div class="mt-8 border-t pt-4"> + <div class="mt-8 border-t pt-4"> <h4 class="mt-2 flex items-center"> <iconify-icon class="mr-1 text-2xl text-orange-500" diff --git a/src/lib/components/IrGagnantsPerdantsView.svelte b/src/lib/components/IrGagnantsPerdantsView.svelte index e5f9948b683e033c7b6cc76dcb015f681bb9d112..179ab92efdab32a19f7c9400777c9adef1f5c743 100644 --- a/src/lib/components/IrGagnantsPerdantsView.svelte +++ b/src/lib/components/IrGagnantsPerdantsView.svelte @@ -115,7 +115,7 @@ </Popover> </div> {#if amendmentStateBudget !== undefined || billStateBudget !== undefined} - <div class="mt-8 border-t pt-4"> + <div class="mt-8 border-t pt-4"> <h4 class="mt-2 flex items-center"> <iconify-icon class="mr-1 text-2xl text-orange-500" diff --git a/src/lib/components/NavBar.svelte b/src/lib/components/NavBar.svelte index ce2b912eea535393c9209512e6349b2b4bab1006..1dbe65888369901a7e8ba289b42bfcc8548148f6 100644 --- a/src/lib/components/NavBar.svelte +++ b/src/lib/components/NavBar.svelte @@ -33,7 +33,7 @@ <!-- logo assemblee nationale --> <a href={portalUrl}> <img - class="w-16 items-start object-scale-down pr-2 pt-0 pb-2" + class="w-16 items-start object-scale-down pb-2 pr-2 pt-0" src="/logo-assemblee-nationale-blanc-blanc.png" alt="Logo de l'Assemblée nationale" /> @@ -65,7 +65,7 @@ To: "opacity-0 scale-95" --> <div - class="absolute left-16 top-0 z-50 mt-14 mr-6 w-64 rounded bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none" + class="absolute left-16 top-0 z-50 mr-6 mt-14 w-64 rounded bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none" role="menu" aria-orientation="vertical" aria-labelledby="user-menu" @@ -188,7 +188,7 @@ icon="ri-account-circle-fill" /> - <span class="sr-only ">Open user menu</span> + <span class="sr-only">Open user menu</span> <span class="hidden lg:flex"> {user.preferred_username.split("@")[0]} </span> @@ -238,7 +238,7 @@ <!-- logo assemblee nationale --> <a class="w-16" href={portalUrl}> <img - class=" items-start object-scale-down pr-2 pl-2 pb-4 pt-0" + class=" items-start object-scale-down pb-4 pl-2 pr-2 pt-0" src="/logo-assemblee-nationale-blanc-blanc.png" alt="Logo de l'Assemblée nationale" /> diff --git a/src/lib/components/ReformsChanges.svelte b/src/lib/components/ReformsChanges.svelte index 9125228a20e194d39d3fdca0e4c47cc870a315c4..1428bb254f8255a4dc2cfe22c55832f3002ab49c 100644 --- a/src/lib/components/ReformsChanges.svelte +++ b/src/lib/components/ReformsChanges.svelte @@ -193,7 +193,7 @@ {/if} <div class="m-2 lg:m-4"> - <h4 class="text-xs font-bold lg:text-sm "> + <h4 class="text-xs font-bold lg:text-sm"> Votre <span class="bg-le-jaune">réforme :</span> </h4> @@ -214,7 +214,7 @@ {#if displayMode.budget && !budgetEditableParametersName.has(parameterName)} <li id={tooltipId} - class="my-1 bg-gray-200 text-xs leading-relaxed text-gray-400 underline decoration-dotted " + class="my-1 bg-gray-200 text-xs leading-relaxed text-gray-400 underline decoration-dotted" > <a id="modification-reforme-1-{parameter?.name}" diff --git a/src/lib/components/ShareLinkModal.svelte b/src/lib/components/ShareLinkModal.svelte index 8cf6f0d40face23a50263793455b4f31ea17e35f..4301a42b6e79032441d541041785acfeb71e7499 100644 --- a/src/lib/components/ShareLinkModal.svelte +++ b/src/lib/components/ShareLinkModal.svelte @@ -55,13 +55,13 @@ Pour sauvegarder votre simulation à tout moment, copiez l'URL suivante : </p> - <div class="mt-1 mb-5 rounded bg-gray-200 p-1 "> + <div class="mb-5 mt-1 rounded bg-gray-200 p-1"> <code class="pl-2 text-xs">{url}</code> </div> <div bind:this={clipboardElement} /> <div class="mb-3 text-center"> <button - class="rounded-lg bg-le-bleu py-2 px-4 text-center text-base uppercase text-white drop-shadow-md hover:bg-blue-900" + class="rounded-lg bg-le-bleu px-4 py-2 text-center text-base uppercase text-white drop-shadow-md hover:bg-blue-900" on:click={copyLink} >Copier le lien <iconify-icon class="ml-1 align-[-0.2rem] text-lg" diff --git a/src/lib/components/WaterfallCompareView.svelte b/src/lib/components/WaterfallCompareView.svelte index 3843a20880dbdfd326ec98763637ccee09685308..cebbe912f3969c67bb91688e8a303fb2deeeb6d8 100644 --- a/src/lib/components/WaterfallCompareView.svelte +++ b/src/lib/components/WaterfallCompareView.svelte @@ -217,7 +217,7 @@ {:else} <!-- Non-trunk, non-leaf variablev--> {#if decomposition.open} - <button class="p-0 text-black " on:click={() => zoomOut(index)}> + <button class="p-0 text-black" on:click={() => zoomOut(index)}> <iconify-icon class="align-[-0.2rem] text-lg" icon="ri-arrow-up-s-line" @@ -281,7 +281,7 @@ {#each rows as { calculationName, deltaAtVectorIndexArray }} <!-- Decomposition compared amounts --> {#if !decomposition.open || trunk || index === 0} - <div class="relative flex items-center whitespace-nowrap "> + <div class="relative flex items-center whitespace-nowrap"> {#if !decomposition.open && !trunk} <div class="absolute"> {#each [...iterToDepth(depth)] as _level} @@ -299,7 +299,7 @@ ? '' : ' border-none'} {calculationName === 'law' ? '' - : 'mb-1 -mt-1'} flex w-full text-sm" + : '-mt-1 mb-1'} flex w-full text-sm" > {#if decomposition.open || index === 0} {#if trunk || index === 0} @@ -330,7 +330,7 @@ > {:else} <div class="flex w-full justify-center"> - <div class="mx-4 w-1/2 "> + <div class="mx-4 w-1/2"> {#if decomposition.open && trunk} <span class="mx-2 text-gray-500">=</span> {/if} diff --git a/src/lib/components/WaterfallView.svelte b/src/lib/components/WaterfallView.svelte index 284378a8d727119efded6f88f117de75504dfa22..854a1d74c4dab2064755b5e9f3ef90a31f0bcc25 100644 --- a/src/lib/components/WaterfallView.svelte +++ b/src/lib/components/WaterfallView.svelte @@ -112,7 +112,7 @@ <div id="situation_{situationIndex}_waterfall"> <!-- partie gauche dispositifs et ticket de caisse--> - <div class="flex justify-between "> + <div class="flex justify-between"> <!-- Navigation dispositifs--> <div class="w-3/5 flex-auto"> {#each visibleDecompositions as { decomposition, depth, rows, trunk, visibleChildren }, index} @@ -306,14 +306,14 @@ <Spinner /> </div> {/if} - <div class="flex-col "> + <div class="flex-col"> {#each visibleDecompositions as { decomposition, rows, trunk, visibleChildren }, index} {#each rows as { calculationName, deltaAtVectorIndex }} {#if !decomposition.open || trunk || calculationName === "law"} <div class="h-7 border-t {calculationName === 'law' ? 'my-1' - : 'mb-1 -mt-1'} px-1 text-sm {decomposition.open && + : '-mt-1 mb-1'} px-1 text-sm {decomposition.open && trunk && visibleChildren.length > 1 && calculationName === 'law' @@ -345,7 +345,7 @@ : 'border-transparent'} h-7 border-t {calculationName === 'law' ? 'my-1' - : 'mb-1 -mt-1'} text-right text-sm" + : '-mt-1 mb-1'} text-right text-sm" > {#if decomposition.open || index === 0} {#if trunk || index === 0} diff --git a/src/lib/components/parameters/ArticleModal.svelte b/src/lib/components/parameters/ArticleModal.svelte index fc928cc43ff23acf31d9b99f940ed3ec7766fe52..2c4f9abfb2aea6f9bc3c4bc06f8534544ac3197e 100644 --- a/src/lib/components/parameters/ArticleModal.svelte +++ b/src/lib/components/parameters/ArticleModal.svelte @@ -103,14 +103,14 @@ class="mb-4 font-serif text-xl italic text-gray-700 md:text-2xl" > <iconify-icon - class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" + class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" icon="ri-map-pin-2-fill" /> <span class="font-bold">Article 197, I.1. </span> - Code général des impôts </h4> - <div class=" bg-gray-50 font-serif"> + <div class=" bg-gray-50 font-serif"> <p> I. – En ce qui concerne les contribuables visés à l'article 4 B, il est fait application des règles suivantes pour le calcul @@ -165,7 +165,7 @@ class="mb-4 font-serif text-xl italic text-gray-700 md:text-2xl" > <iconify-icon - class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" + class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" icon="ri-map-pin-2-fill" /> <span class="font-bold">Article 197, I.2. </span> - Code général @@ -202,7 +202,7 @@ class="mb-4 font-serif text-xl italic text-gray-700 md:text-2xl" > <iconify-icon - class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" + class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" icon="ri-map-pin-2-fill" /> <span class="font-bold">Article 197, I.2. </span> - Code général @@ -237,7 +237,7 @@ class="mb-4 font-serif text-xl italic text-gray-700 md:text-2xl" > <iconify-icon - class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" + class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" icon="ri-map-pin-2-fill" /> <span class="font-bold">Article 197, I.2. </span> - Code général @@ -277,7 +277,7 @@ class="mb-4 font-serif text-xl italic text-gray-700 md:text-2xl" > <iconify-icon - class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" + class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" icon="ri-map-pin-2-fill" /> <span class="font-bold">Article 197, I.2. </span> - Code général @@ -316,7 +316,7 @@ class="mb-4 font-serif text-xl italic text-gray-700 md:text-2xl" > <iconify-icon - class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" + class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" icon="ri-map-pin-2-fill" /> <span class="font-bold">Article 197, I.2. </span> - Code général @@ -354,7 +354,7 @@ class="mb-4 font-serif text-xl italic text-gray-700 md:text-2xl" > <iconify-icon - class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" + class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" icon="ri-map-pin-2-fill" /> <span class="font-bold">Article 197, I.3. </span> - Code général @@ -391,7 +391,7 @@ class="mb-4 font-serif text-xl italic text-gray-700 md:text-2xl" > <iconify-icon - class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" + class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" icon="ri-map-pin-2-fill" /> <span class="font-bold">Article 197, I.3. </span> - Code général @@ -428,7 +428,7 @@ class="mb-4 font-serif text-xl italic text-gray-700 md:text-2xl" > <iconify-icon - class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" + class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" icon="ri-map-pin-2-fill" /> <span class="font-bold">Article 197, I.3. </span> - Code général @@ -465,7 +465,7 @@ class="mb-4 font-serif text-xl italic text-gray-700 md:text-2xl" > <iconify-icon - class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" + class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" icon="ri-map-pin-2-fill" /> <span class="font-bold">Article 197, I.3. </span> - Code général @@ -502,7 +502,7 @@ class="mb-4 font-serif text-xl italic text-gray-700 md:text-2xl" > <iconify-icon - class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" + class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" icon="ri-map-pin-2-fill" /> <span class="font-bold">Article 197, I.4. </span> - Code général @@ -540,7 +540,7 @@ class="mb-4 font-serif text-xl italic text-gray-700 md:text-2xl" > <iconify-icon - class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" + class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" icon="ri-map-pin-2-fill" /> <span class="font-bold">Article 197, I.4. </span> - Code général @@ -577,7 +577,7 @@ class="mb-4 font-serif text-xl italic text-gray-700 md:text-2xl" > <iconify-icon - class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" + class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" icon="ri-map-pin-2-fill" /> <span class="font-bold">Article 197, I.4. </span> - Code général @@ -613,7 +613,7 @@ class="mb-4 font-serif text-xl italic text-gray-700 md:text-2xl" > <iconify-icon - class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" + class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" icon="ri-map-pin-2-fill" /> <span class="font-bold">Article 196 A bis</span> - Code général des @@ -646,7 +646,7 @@ class="mb-4 font-serif text-xl italic text-gray-700 md:text-2xl" > <iconify-icon - class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" + class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" icon="ri-map-pin-2-fill" /> <span class="font-bold">Article 195, 2.</span> - Code général des @@ -718,7 +718,7 @@ class="mb-4 font-serif text-xl italic text-gray-700 md:text-2xl" > <iconify-icon - class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" + class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" icon="ri-map-pin-2-fill" /> <span class="font-bold">Article 194, II.</span> - Code général des @@ -758,7 +758,7 @@ class="mb-4 font-serif text-xl italic text-gray-700 md:text-2xl" > <iconify-icon - class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" + class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" icon="ri-map-pin-2-fill" /> <span class="font-bold">Article 196 B, §2</span> - Code général des @@ -800,7 +800,7 @@ class="mb-4 font-serif text-xl italic text-gray-700 md:text-2xl" > <iconify-icon - class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" + class="mr-1 inline-flex h-7 w-7 place-self-center text-le-gris-dispositif-light" icon="ri-map-pin-2-fill" /> <span class="font-bold">Article 194, I.§1</span> - Code général des diff --git a/src/lib/components/parameters/NodeEdit.svelte b/src/lib/components/parameters/NodeEdit.svelte index 3dae483bf086113a81122bfecb6a0060a9177232..d923acc9056d1de38f2441e9f54eccc100eca1a8 100644 --- a/src/lib/components/parameters/NodeEdit.svelte +++ b/src/lib/components/parameters/NodeEdit.svelte @@ -134,7 +134,7 @@ <div class="my-auto mb-4 flex"> <!--Colonne 1 présentant les valeurs--> <div class="mr-2 w-2/3 flex-col items-center"> - <div class="mb-2 flex-col "> + <div class="mb-2 flex-col"> {#each [...iterArrayWithErrors(instantReferencesArray, errors)] as [{ instant, references }, error], index} <div class="flex items-start"> <button @@ -155,7 +155,7 @@ /></svg > </button> - <div class="mb-4 w-full rounded border bg-gray-100 "> + <div class="mb-4 w-full rounded border bg-gray-100"> <div class="flex-col"> <div class="p-2"> <label class="mt-1 text-base text-gray-600"> @@ -174,7 +174,7 @@ </label> </div> - <div class="text-xs text-gray-500 "> + <div class="text-xs text-gray-500"> <ReferencesEdit errors={errorAsKeyValueDictionary(error?.[1])} on:change={(event) => changeReferences(index, event)} @@ -214,10 +214,10 @@ </div> </div> - <h2 class="pt-7 pb-3 text-xl font-bold"> + <h2 class="pb-3 pt-7 text-xl font-bold"> Modifications avancées du noeud : </h2> - <div class="mt-4 mb-2 flex-col"> + <div class="mb-2 mt-4 flex-col"> <label class="flex text-base"> Unité de valeur : <select diff --git a/src/lib/components/parameters/ParameterView.svelte b/src/lib/components/parameters/ParameterView.svelte index 5eb8a4924816ed3b47eef7b293036bb0e1c77f91..36d484213aee2ebf01f0897f1fda7ab78a8edc02 100644 --- a/src/lib/components/parameters/ParameterView.svelte +++ b/src/lib/components/parameters/ParameterView.svelte @@ -38,26 +38,23 @@ <main class="fond flex items-center justify-center"> <div class="max-w-screen-md bg-white"> <a - class="mt-5 ml-10 inline-flex items-center rounded bg-gray-200 p-2 pr-3 text-sm text-black shadow-md hover:bg-gray-300 active:bg-gray-400 cursor-pointer" - href="/" + class="ml-10 mt-5 inline-flex cursor-pointer items-center rounded bg-gray-200 p-2 pr-3 text-sm text-black shadow-md hover:bg-gray-300 active:bg-gray-400" + href="/" > - <iconify-icon - class="text-2xl" - icon="ri-arrow-left-line" - /> + <iconify-icon class="text-2xl" icon="ri-arrow-left-line" /> <span class="ml-3">Retour au simulateur</span> </a> <div class="flex-col items-start pb-4"> <div class="p-10"> <p class="mb-2 uppercase">Détail du paramètre :</p> - <div class="mb-4 border-l-2 border-black pl-4 "> + <div class="mb-4 border-l-2 border-black pl-4"> <p class="font-serif text-3xl font-bold"> {parameter.title} </p> <span class="font-serif text-sm italic">{parameter.description}</span> - <div class="mt-7 w-3/5 rounded border p-2 "> - <h2 class="text-base ">Parents du paramètre :</h2> + <div class="mt-7 w-3/5 rounded border p-2"> + <h2 class="text-base">Parents du paramètre :</h2> {#each [...iterParameterAncestors(parameter.parent)] as ancestor} <p class="inline font-serif text-sm"> <!-- svelte-ignore a11y-missing-attribute --> @@ -151,8 +148,8 @@ <ScaleView {parameter} /> {:else if parameter.class === ParameterClass.Value} <!--Tableau des valeurs--> - <div class="pb-5 "> - <h2 class="pt-7 pb-3 text-xl font-bold"> + <div class="pb-5"> + <h2 class="pb-3 pt-7 text-xl font-bold"> Historique des valeurs : </h2> <table @@ -243,7 +240,7 @@ <div class=""> {#if parameter.class === ParameterClass.Node} {#if parameter.unit !== undefined} - <div class="font-base my-1 flex border-b py-1 "> + <div class="font-base my-1 flex border-b py-1"> <p class="mr-1"> Unité du paramètre :: <span class="font-bold"> {getUnitShortLabel(parameter.unit, date)}</span @@ -339,7 +336,7 @@ {#if parameter.referring_variables !== undefined} <!--Informations connexes--> <section class="mt-7"> - <h2 class="pt-7 pb-3 text-xl font-bold"> + <h2 class="pb-3 pt-7 text-xl font-bold"> Formules de calcul où le paramètre apparaît : </h2> <ul class="list-inside list-disc"> diff --git a/src/lib/components/parameters/ReferenceEdit.svelte b/src/lib/components/parameters/ReferenceEdit.svelte index 3cd172aa8f5f1f45d07afedfdafa393509931931..a4c57090e4bee117c252574b911cf7bc7f9527e7 100644 --- a/src/lib/components/parameters/ReferenceEdit.svelte +++ b/src/lib/components/parameters/ReferenceEdit.svelte @@ -57,7 +57,7 @@ } </script> -<label class="flex-col "> +<label class="flex-col"> <p class="mt-1">Description</p> {#if reference.title !== oldReference.title} <s class="bg-le-gris-dispositif-light font-serif text-sm text-black" @@ -75,7 +75,7 @@ {/if} </label> <label class="flex-col"> - <p class="mt-1 ">Lien URL</p> + <p class="mt-1">Lien URL</p> {#if reference.href !== oldReference.href} <s class="bg-le-gris-dispositif-light font-serif text-sm text-black" >{oldReference.href ?? "absent"}</s diff --git a/src/lib/components/parameters/ScaleAtInstantEdit.svelte b/src/lib/components/parameters/ScaleAtInstantEdit.svelte index 8bc9b6945c8403654c82583d9dfc5bc56214021a..98412cb892bc4b5de0549296b577c0fbbadb553d 100644 --- a/src/lib/components/parameters/ScaleAtInstantEdit.svelte +++ b/src/lib/components/parameters/ScaleAtInstantEdit.svelte @@ -125,7 +125,7 @@ <div class="mx-4 flex-col rounded-sm bg-white p-2 shadow-inner"> <div> - <table class="table-auto border-collapse "> + <table class="table-auto border-collapse"> <thead> <tr> <th /> @@ -229,7 +229,7 @@ </td> {:else} {#if usesBase} - <td class="ml-2 border-l-2 p-3 "> + <td class="ml-2 border-l-2 p-3"> <div class="flex items-center"> <input class="w-24 rounded-t border-b border-l-0 border-r-0 border-t-0 border-gray-400 bg-gray-100 p-1 py-0 font-serif text-lg text-black" diff --git a/src/lib/components/parameters/ScaleEdit.svelte b/src/lib/components/parameters/ScaleEdit.svelte index b7c39d6ab9e4fbe372f9ce0a94f32df31a20c181..e0a8f7cfb89ba749fb7ae5803ae05b3549c4edb4 100644 --- a/src/lib/components/parameters/ScaleEdit.svelte +++ b/src/lib/components/parameters/ScaleEdit.svelte @@ -151,11 +151,11 @@ <div class="my-auto mb-4 flex"> <!--Colonne 1 présentant les valeurs--> <div class="mr-2 w-2/3 flex-col items-center"> - <div class="mb-2 flex-col "> + <div class="mb-2 flex-col"> {#each [...iterToLimit(iterArrayWithErrors(instantReferencesAndScaleArray, errors), showAll ? null : 3)] as [{ instant, references, scaleAtInstant }, error], index} <div class="flex items-start"> <button - class="mt-2 mr-2 rounded p-1" + class="mr-2 mt-2 rounded p-1" on:click={() => deleteScaleAtInstant(index)} title="Supprimer la date et sa valeur" type="button" @@ -173,7 +173,7 @@ > </button> - <div class="mb-4 w-full rounded border bg-gray-100 "> + <div class="mb-4 w-full rounded border bg-gray-100"> <div class="flex-col"> <div class="p-2"> <label class="mt-1 text-base text-gray-600"> @@ -203,7 +203,7 @@ /> {/if} </div> - <div class="text-xs text-gray-500 "> + <div class="text-xs text-gray-500"> <ReferencesEdit errors={errorAsKeyValueDictionary(error?.[1])} on:change={(event) => changeReferences(index, event)} @@ -218,7 +218,7 @@ </div> {#if instantReferencesAndScaleArray.length > 3} <button - class="ml-8 mb-4 flex items-center rounded bg-gray-100 px-5 py-2 text-sm uppercase text-black shadow-md hover:bg-gray-300" + class="mb-4 ml-8 flex items-center rounded bg-gray-100 px-5 py-2 text-sm uppercase text-black shadow-md hover:bg-gray-300" on:click={() => (showAll = !showAll)} type="button" > @@ -287,9 +287,9 @@ </div> </div> -<h2 class="pt-7 pb-3 text-xl font-bold">Modifications avancées du barème :</h2> +<h2 class="pb-3 pt-7 text-xl font-bold">Modifications avancées du barème :</h2> -<div class="mt-4 mb-2 flex-col"> +<div class="mb-2 mt-4 flex-col"> {#if isAmountScaleParameter(parameter)} {#if asAmountScaleParameter(parameter).amount_unit !== undefined} <label class="flex text-base"> diff --git a/src/lib/components/parameters/ScaleView.svelte b/src/lib/components/parameters/ScaleView.svelte index dabb0e3e4594fe569d595feb9d79a20e3899de57..2e8a171db15655eff6e6f12870f32aa92743632f 100644 --- a/src/lib/components/parameters/ScaleView.svelte +++ b/src/lib/components/parameters/ScaleView.svelte @@ -40,8 +40,8 @@ } </script> -<div class="pb-5 "> - <h2 class="pt-7 pb-3 text-xl font-bold">Historique des barèmes :</h2> +<div class="pb-5"> + <h2 class="pb-3 pt-7 text-xl font-bold">Historique des barèmes :</h2> <table class="w-full table-auto border-collapse bg-gray-100 text-sm"> <thead> <tr> diff --git a/src/lib/components/parameters/ValueAtInstantEdit.svelte b/src/lib/components/parameters/ValueAtInstantEdit.svelte index e3a341ce2edd4556c9f0f87f7b0eb1a60b5bb774..c39d3cc54766340d547a60c4f54f8f2c1a5be3c5 100644 --- a/src/lib/components/parameters/ValueAtInstantEdit.svelte +++ b/src/lib/components/parameters/ValueAtInstantEdit.svelte @@ -128,7 +128,7 @@ {/if} {/if} <input - class="mt-1 w-24 rounded-t border-b border-t-0 border-l-0 border-r-0 border-gray-400 px-2 py-0 font-serif text-lg text-black {valueHasChanged( + class="mt-1 w-24 rounded-t border-b border-l-0 border-r-0 border-t-0 border-gray-400 px-2 py-0 font-serif text-lg text-black {valueHasChanged( parameter, oldValueAtInstant, valueAtInstant, @@ -151,7 +151,7 @@ {/if} <label class="mb-2"> <select - class="mt-1 w-24 rounded px-2 py-0 font-serif text-base text-black " + class="mt-1 w-24 rounded px-2 py-0 font-serif text-base text-black" on:blur={changeUnit} on:change={changeUnit} value={asMaybeNumberValue(valueAtInstant).unit} diff --git a/src/lib/components/parameters/ValueEdit.svelte b/src/lib/components/parameters/ValueEdit.svelte index bbe0fbc079b190670dba034e8175141313eeef25..c162a04d8d725ac32e5a263e1f04dfd905fc815c 100644 --- a/src/lib/components/parameters/ValueEdit.svelte +++ b/src/lib/components/parameters/ValueEdit.svelte @@ -131,11 +131,11 @@ <div class="my-auto mb-4 flex"> <!--Colonne 1 présentant les valeurs--> <div class="mr-2 w-2/3 flex-col items-center"> - <div class="mb-2 flex-col "> + <div class="mb-2 flex-col"> {#each [...iterToLimit(iterArrayWithErrors(instantReferencesAndValueArray, errors), showAll ? null : 3)] as [{ instant, references, valueAtInstant }, error], index} <div class="mb-4 flex items-start"> <button - class="mt-4 mr-2 rounded p-1" + class="mr-2 mt-4 rounded p-1" on:click={() => deleteValueAtInstant(index)} title="Supprimer la date et sa valeur" type="button" @@ -152,7 +152,7 @@ /></svg > </button> - <div class="w-full rounded border bg-gray-100 "> + <div class="w-full rounded border bg-gray-100"> <div class="p-2"> <label class="mt-1 text-base text-gray-600"> Valeur en vigueur depuis @@ -182,7 +182,7 @@ /> {/if} </div> - <div class="text-xs text-gray-500 "> + <div class="text-xs text-gray-500"> <ReferencesEdit errors={errorAsKeyValueDictionary(error?.[1])} on:change={(event) => changeReferences(index, event)} @@ -196,7 +196,7 @@ </div> {#if instantReferencesAndValueArray.length > 3} <button - class="ml-8 mb-4 flex items-center rounded bg-gray-100 px-5 py-2 text-sm uppercase text-black shadow-md hover:bg-gray-300" + class="mb-4 ml-8 flex items-center rounded bg-gray-100 px-5 py-2 text-sm uppercase text-black shadow-md hover:bg-gray-300" on:click={() => (showAll = !showAll)} type="button" > @@ -265,10 +265,10 @@ </div> </div> - <h2 class="pt-7 pb-3 text-xl font-bold"> + <h2 class="pb-3 pt-7 text-xl font-bold"> Modifications avancées du paramètre : </h2> - <div class="mt-4 mb-2 flex-col"> + <div class="mb-2 mt-4 flex-col"> <label class="flex text-base"> Type de valeur : <select diff --git a/src/lib/components/search/Search.svelte b/src/lib/components/search/Search.svelte index 04ccd560f3ed54badf39961e8262634a2b2e18a4..70d80943a618b339d3ae5d40ef567b9d82caf03b 100644 --- a/src/lib/components/search/Search.svelte +++ b/src/lib/components/search/Search.svelte @@ -1,223 +1,226 @@ <script lang="ts"> - import {browser} from "$app/environment" - import type {DisplayMode} from "$lib/displays" - import {newSimulationUrl} from "$lib/urls" - import AllVariablesSearchWorker from "$lib/search/search_worker_variables_all?worker" - import WaterfallVariablesSearchWorker from "$lib/search/search_worker_variables_waterfall?worker" - import ParametersSearchWorker from "$lib/search/search_worker_parameters?worker" - import type {SearchResult} from "minisearch" - import {SearchMode} from "$lib/search/search_mode"; - import {iterParameterAncestors} from "@openfisca/json-model" - import {createEventDispatcher} from "svelte" - import type {Parameter} from "@openfisca/json-model" - - const resultHeight = 56 - - export let displayMode: DisplayMode - export let searchMode: SearchMode - export let resultsCountInDropdown = 5 - - // # Variables - export let showOnlyWaterfallVariables: boolean = false - // ! Variables - - // # Parameters - export let dispatchItemClick: boolean = false - // ! Parameters - - let isSearchInProgress = false - let pendingQuery: string | null = null - - let searchResults: SearchResult[] = [] - let searchWorker = undefined - if (browser) { - switch (searchMode) { - case SearchMode.variables: - searchWorker = showOnlyWaterfallVariables ? new WaterfallVariablesSearchWorker() : new AllVariablesSearchWorker() - break - case SearchMode.parameters: - searchWorker = new ParametersSearchWorker() - break - } + import { browser } from "$app/environment" + import type { DisplayMode } from "$lib/displays" + import { newSimulationUrl } from "$lib/urls" + import AllVariablesSearchWorker from "$lib/search/search_worker_variables_all?worker" + import WaterfallVariablesSearchWorker from "$lib/search/search_worker_variables_waterfall?worker" + import ParametersSearchWorker from "$lib/search/search_worker_parameters?worker" + import type { SearchResult } from "minisearch" + import { SearchMode } from "$lib/search/search_mode" + import { iterParameterAncestors } from "@openfisca/json-model" + import { createEventDispatcher } from "svelte" + import type { Parameter } from "@openfisca/json-model" + + const resultHeight = 56 + + export let displayMode: DisplayMode + export let searchMode: SearchMode + export let resultsCountInDropdown = 5 + + // # Variables + export let showOnlyWaterfallVariables: boolean = false + // ! Variables + + // # Parameters + export let dispatchItemClick: boolean = false + // ! Parameters + + let isSearchInProgress = false + let pendingQuery: string | null = null + + let searchResults: SearchResult[] = [] + let searchWorker = undefined + if (browser) { + switch (searchMode) { + case SearchMode.variables: + searchWorker = showOnlyWaterfallVariables + ? new WaterfallVariablesSearchWorker() + : new AllVariablesSearchWorker() + break + case SearchMode.parameters: + searchWorker = new ParametersSearchWorker() + break } - if (searchWorker !== undefined) { - searchWorker.onmessage = function (event) { - searchResults = event.data - - // If there's no pending query, we're done! - if (pendingQuery === null) { - isSearchInProgress = false - } else { // If we were waiting for results before searching again, run search - searchWorker.postMessage(pendingQuery) - pendingQuery = null - } - } + } + if (searchWorker !== undefined) { + searchWorker.onmessage = function (event) { + searchResults = event.data + + // If there's no pending query, we're done! + if (pendingQuery === null) { + isSearchInProgress = false + } else { + // If we were waiting for results before searching again, run search + searchWorker.postMessage(pendingQuery) + pendingQuery = null + } } + } - function search(query: string) { - if (searchWorker === undefined) return + function search(query: string) { + if (searchWorker === undefined) return - // If search is already running, save the query inside the - // pending query variable, awaiting results before searching again - if (isSearchInProgress) { - pendingQuery = query - return - } - - isSearchInProgress = true - searchWorker.postMessage(query) + // If search is already running, save the query inside the + // pending query variable, awaiting results before searching again + if (isSearchInProgress) { + pendingQuery = query + return } - let searchInputValue = "" - $: isSearchActive = searchInputValue != undefined && searchInputValue.length > 0 - $: (isSearchActive) ? search(searchInputValue) : searchResults = [] + isSearchInProgress = true + searchWorker.postMessage(query) + } + + let searchInputValue = "" + $: isSearchActive = + searchInputValue != undefined && searchInputValue.length > 0 + $: isSearchActive ? search(searchInputValue) : (searchResults = []) - const dispatch = createEventDispatcher() + const dispatch = createEventDispatcher() - function parameterClicked(event: Event, parameter: Parameter) { - if (dispatchItemClick) { - event.preventDefault() - dispatch("itemClick", parameter) - } + function parameterClicked(event: Event, parameter: Parameter) { + if (dispatchItemClick) { + event.preventDefault() + dispatch("itemClick", parameter) } + } - $: dropdownMaxHeight = 8 + (resultsCountInDropdown + 0.5) * resultHeight + $: dropdownMaxHeight = 8 + (resultsCountInDropdown + 0.5) * resultHeight </script> <label class="uppercase" for="search"> - {#if searchMode === SearchMode.variables} - Choisir un dispositif : - {:else if searchMode === SearchMode.parameters} - Choisir un paramètre : - {/if} + {#if searchMode === SearchMode.variables} + Choisir un dispositif : + {:else if searchMode === SearchMode.parameters} + Choisir un paramètre : + {/if} </label> <div - class="shadow-inner-md mt-2 flex w-full items-center justify-between rounded-t-md border-b bg-gray-100 p-1 text-gray-400 focus-within:text-gray-900 hover:border-black" - style:box-shadow={isSearchActive ? "0 1px 6px rgba(32,33,36,.28)" : "none"} + class="shadow-inner-md mt-2 flex w-full items-center justify-between rounded-t-md border-b bg-gray-100 p-1 text-gray-400 focus-within:text-gray-900 hover:border-black" + style:box-shadow={isSearchActive ? "0 1px 6px rgba(32,33,36,.28)" : "none"} > + <iconify-icon + class="mx-1 text-black" + icon="ri-search-line" + flip="horizontal" + width="22" + height="22" + /> + <input + autocomplete="off" + class="w-full border-none bg-gray-100 text-base text-gray-900 placeholder-gray-400 !ring-transparent focus:outline-none" + id="search" + bind:value={searchInputValue} + placeholder="impôt sur le revenu, CSG, ..." + type="search" + /> + {#if isSearchActive} <iconify-icon - class="mx-1 text-black" - icon="ri-search-line" - flip="horizontal" - width="22" - height="22" - /> - <input - autocomplete="off" - class="w-full border-none bg-gray-100 text-base text-gray-900 placeholder-gray-400 focus:outline-none !ring-transparent" - id="search" - bind:value={searchInputValue} - placeholder="impôt sur le revenu, CSG, ..." - type="search" + class="mx-1 cursor-pointer p-1 text-black" + icon="ic-baseline-clear" + flip="horizontal" + width="22" + height="22" + on:click={() => (searchInputValue = "")} /> - {#if isSearchActive} - <iconify-icon - class="mx-1 text-black p-1 cursor-pointer" - icon="ic-baseline-clear" - flip="horizontal" - width="22" - height="22" - on:click={() => searchInputValue = ""} - /> - {/if} + {/if} </div> {#if searchMode === SearchMode.variables} - {#if isSearchActive} - <ul - class="py-2 overflow-y-auto list-none bg-gray-100 rounded-b-lg shadow-[0_4px_6px_rgba(32,33,36,0.28)] text-le-gris-dispositif" - style:max-height={dropdownMaxHeight + "px"} - > - {#if searchResults.length > 0} - {#each searchResults as variable, index (`found_variable_$${index}`)} - <a - class="text-le-gris-dispositif-dark" - href={newSimulationUrl({ - ...displayMode, - parameterName: undefined, - parametersVariableName: variable.name, - })} - > - <li class="px-8 py-4 hover:bg-gray-200">{variable.label ?? variable.name}</li> - </a> - {/each} - {:else} - <li class="px-8 py-4">Aucun résultat trouvé</li> - {/if} - </ul> - {:else} - <div class="mt-6 flex flex-wrap text-black"> - <a - class="rounded-full border-4 border-white bg-le-gris-dispositif-light px-3 py-1 hover:bg-le-gris-dispositif hover:bg-opacity-60" - href={newSimulationUrl({ - ...displayMode, - parametersVariableName: "irpp_economique", - })} - > - <span>Impôt sur le revenu</span> - </a> - - <a - class="rounded-full border-4 border-white bg-le-gris-dispositif-light px-3 py-1 hover:bg-le-gris-dispositif hover:bg-opacity-60" - href={newSimulationUrl({ - ...displayMode, - parametersVariableName: "csg_deductible_salaire", - })} - > - <span>CSG salaires déductible</span> - </a> - <a - class="rounded-full border-4 border-white bg-le-gris-dispositif-light px-3 py-1 hover:bg-le-gris-dispositif hover:bg-opacity-60" - href={newSimulationUrl({ - ...displayMode, - parametersVariableName: "csg_imposable_salaire", - })} - > - <span>CSG salaires imposable</span> - </a> - - <a - class="rounded-full border-4 border-white bg-le-gris-dispositif-light px-3 py-1 hover:bg-le-gris-dispositif hover:bg-opacity-60" - href={newSimulationUrl({ + {#if isSearchActive} + <ul + class="list-none overflow-y-auto rounded-b-lg bg-gray-100 py-2 text-le-gris-dispositif shadow-[0_4px_6px_rgba(32,33,36,0.28)]" + style:max-height={dropdownMaxHeight + "px"} + > + {#if searchResults.length > 0} + {#each searchResults as variable, index (`found_variable_$${index}`)} + <a + class="text-le-gris-dispositif-dark" + href={newSimulationUrl({ ...displayMode, - parametersVariableName: "taxes_tous_carburants", + parameterName: undefined, + parametersVariableName: variable.name, })} - > - <span>Taxes sur les carburants</span> - </a> - <span class="mt-2 flex items-center text-sm text-gray-700"> - ... Plus de dispositifs depuis la feuille de paie à droite - <iconify-icon - class="ml-1 h-4 w-4" - icon="twemoji-down-right-arrow" - /> - </span> - </div> - {/if} + > + <li class="px-8 py-4 hover:bg-gray-200"> + {variable.label ?? variable.name} + </li> + </a> + {/each} + {:else} + <li class="px-8 py-4">Aucun résultat trouvé</li> + {/if} + </ul> + {:else} + <div class="mt-6 flex flex-wrap text-black"> + <a + class="rounded-full border-4 border-white bg-le-gris-dispositif-light px-3 py-1 hover:bg-le-gris-dispositif hover:bg-opacity-60" + href={newSimulationUrl({ + ...displayMode, + parametersVariableName: "irpp_economique", + })} + > + <span>Impôt sur le revenu</span> + </a> + + <a + class="rounded-full border-4 border-white bg-le-gris-dispositif-light px-3 py-1 hover:bg-le-gris-dispositif hover:bg-opacity-60" + href={newSimulationUrl({ + ...displayMode, + parametersVariableName: "csg_deductible_salaire", + })} + > + <span>CSG salaires déductible</span> + </a> + <a + class="rounded-full border-4 border-white bg-le-gris-dispositif-light px-3 py-1 hover:bg-le-gris-dispositif hover:bg-opacity-60" + href={newSimulationUrl({ + ...displayMode, + parametersVariableName: "csg_imposable_salaire", + })} + > + <span>CSG salaires imposable</span> + </a> + + <a + class="rounded-full border-4 border-white bg-le-gris-dispositif-light px-3 py-1 hover:bg-le-gris-dispositif hover:bg-opacity-60" + href={newSimulationUrl({ + ...displayMode, + parametersVariableName: "taxes_tous_carburants", + })} + > + <span>Taxes sur les carburants</span> + </a> + <span class="mt-2 flex items-center text-sm text-gray-700"> + ... Plus de dispositifs depuis la feuille de paie à droite + <iconify-icon class="ml-1 h-4 w-4" icon="twemoji-down-right-arrow" /> + </span> + </div> + {/if} {:else if searchMode === SearchMode.parameters} - {#if isSearchActive} - <ul - class="py-2 overflow-y-auto list-none bg-gray-100 rounded-b-lg shadow-[0_4px_6px_rgba(32,33,36,0.28)] text-le-gris-dispositif" - style:max-height={dropdownMaxHeight + "px"} - > - {#if searchResults.length > 0} - {#each searchResults as parameter, index (`found_parameter_$${index}`)} - <a - class="text-le-gris-dispositif-dark" - on:click={(event) => parameterClicked(event, parameter)} - href="/parameters/{parameter.name}" - > - <li class="px-8 py-4 hover:bg-gray-200"> - {#each [...iterParameterAncestors(parameter)] as ancestor, index} - {#if index > 0}>{/if} - <span class="mx-2 first:ml-0">{ancestor.title}</span> - {/each} - </li> - </a> - {/each} - {:else} - <li class="px-8 py-4">Aucun résultat trouvé</li> - {/if} - </ul> - {/if} -{/if} \ No newline at end of file + {#if isSearchActive} + <ul + class="list-none overflow-y-auto rounded-b-lg bg-gray-100 py-2 text-le-gris-dispositif shadow-[0_4px_6px_rgba(32,33,36,0.28)]" + style:max-height={dropdownMaxHeight + "px"} + > + {#if searchResults.length > 0} + {#each searchResults as parameter, index (`found_parameter_$${index}`)} + <a + class="text-le-gris-dispositif-dark" + on:click={(event) => parameterClicked(event, parameter)} + href="/parameters/{parameter.name}" + > + <li class="px-8 py-4 hover:bg-gray-200"> + {#each [...iterParameterAncestors(parameter)] as ancestor, index} + {#if index > 0}>{/if} + <span class="mx-2 first:ml-0">{ancestor.title}</span> + {/each} + </li> + </a> + {/each} + {:else} + <li class="px-8 py-4">Aucun résultat trouvé</li> + {/if} + </ul> + {/if} +{/if} diff --git a/src/lib/components/test_cases/OilSpendingBill.svelte b/src/lib/components/test_cases/OilSpendingBill.svelte index 982be3e4f37472c196a77a1098fc359e40fb63e4..db43a2890ff8688713de732b470336311478750f 100644 --- a/src/lib/components/test_cases/OilSpendingBill.svelte +++ b/src/lib/components/test_cases/OilSpendingBill.svelte @@ -124,7 +124,7 @@ {#if nombreLitres > 0} <div class=" bg-slate-100 p-2 pb-4 shadow-md"> <h3 - class="mb-2 border-b border-black pb-2 text-center font-black uppercase" + class="mb-2 border-b border-black pb-2 text-center font-black uppercase" > {depenseTtcVariable.label ?? depenseTtcVariable.name} </h3> @@ -170,7 +170,7 @@ <tbody> <tr> <td class="text-base">TOTAL TTC /an</td> - <td class="text-right text-lg font-bold "> + <td class="text-right text-lg font-bold"> <div class="flex flex-col items-end"> <ValueChange unitName="currency-EUR" diff --git a/src/lib/components/test_cases/RolePersonsEdit.svelte b/src/lib/components/test_cases/RolePersonsEdit.svelte index cd53391c57850ab5e5b1c906e0be4060022e7718..cb978e88c50a090204eb9d341d5c8e4e93c2ce14 100644 --- a/src/lib/components/test_cases/RolePersonsEdit.svelte +++ b/src/lib/components/test_cases/RolePersonsEdit.svelte @@ -95,7 +95,7 @@ <!--Material Icon reorder--> <div class="inline-flex text-white group-hover:text-gray-500"> <svg - class="fill-current " + class="fill-current" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" diff --git a/src/lib/components/test_cases/TestCaseCompareModal.svelte b/src/lib/components/test_cases/TestCaseCompareModal.svelte index ef440373afbf93fcf1a304d03cb993efecc4bdc7..7b8fe2227a376ec8d0a4d87a4dfe87fade40a05a 100644 --- a/src/lib/components/test_cases/TestCaseCompareModal.svelte +++ b/src/lib/components/test_cases/TestCaseCompareModal.svelte @@ -135,11 +135,11 @@ <ul class="list-disc"> <li class="mt-4"> <span class="text-lg" - ><span class="font-semibold ">ce même cas type</span>, que - vous pourrez ensuite modifier :</span + ><span class="font-semibold">ce même cas type</span>, que vous + pourrez ensuite modifier :</span ><br /> <button - class="mt-2 mb-5 inline-flex items-center rounded bg-gray-300 px-2 py-1 text-base uppercase text-black shadow-lg hover:bg-gray-400" + class="mb-5 mt-2 inline-flex items-center rounded bg-gray-300 px-2 py-1 text-base uppercase text-black shadow-lg hover:bg-gray-400" on:click={duplicateTestCaseAndCloseModal} type="button" >Dupliquer et comparer <iconify-icon @@ -152,7 +152,7 @@ <span class="text-lg font-semibold">un cas type existant :</span > <select - class="my-2 w-full rounded-t-md border-b border-t-0 border-r-0 border-l-0 border-black bg-gray-100 py-1 text-base" + class="my-2 w-full rounded-t-md border-b border-l-0 border-r-0 border-t-0 border-black bg-gray-100 py-1 text-base" bind:value={selectedTestCaseIndex} > <option @@ -171,7 +171,7 @@ {/each} </select> <button - class="mt-2 mb-5 inline-flex items-center rounded bg-gray-300 px-2 py-1 text-base uppercase text-black shadow-lg" + class="mb-5 mt-2 inline-flex items-center rounded bg-gray-300 px-2 py-1 text-base uppercase text-black shadow-lg" class:hover:bg-gray-400={selectedTestCaseIndex !== undefined && selectedTestCaseIndex !== $testCasesIndex[0]} disabled={selectedTestCaseIndex === undefined || diff --git a/src/lib/components/test_cases/TestCaseCompareView.svelte b/src/lib/components/test_cases/TestCaseCompareView.svelte index 14f3024362ac9b86a9fdb1b22c36559d290670e3..c3ee37254e47cf02bd9acfae888e79a03092501a 100644 --- a/src/lib/components/test_cases/TestCaseCompareView.svelte +++ b/src/lib/components/test_cases/TestCaseCompareView.svelte @@ -81,7 +81,7 @@ class="relative w-full rounded-t-sm bg-white shadow-md md:mb-5" id="situation_{situationsToCompareIndex.join('_')}" > - <div class="flex justify-end rounded-t-md bg-gray-100 py-1 px-6"> + <div class="flex justify-end rounded-t-md bg-gray-100 px-6 py-1"> {#if displayMode.edit === undefined} <button class="text-sm uppercase text-gray-600 hover:text-black" diff --git a/src/lib/components/test_cases/TestCaseEdit.svelte b/src/lib/components/test_cases/TestCaseEdit.svelte index 3d99ddc6c7fd80968188d1dd63f34e2d7ac99ded..fc5a8e6dbd4dcb2167e09ead2d91abdd0b35e798 100644 --- a/src/lib/components/test_cases/TestCaseEdit.svelte +++ b/src/lib/components/test_cases/TestCaseEdit.svelte @@ -702,9 +702,9 @@ </div> </section> -<section class="mt-4 ml-4 mr-4 md:mr-0"> +<section class="ml-4 mr-4 mt-4 md:mr-0"> <h1 class="mt-3 text-xl">Caractéristiques par an :</h1> - <p class="my-2 text-sm text-gray-700 "> + <p class="my-2 text-sm text-gray-700"> 📌 Par défaut, la situation du cas type est considérée comme stable depuis 3 ans. </p> diff --git a/src/lib/components/test_cases/TestCaseSelectModal.svelte b/src/lib/components/test_cases/TestCaseSelectModal.svelte index 78234c44fa60522ece61ca37a029c55799c64d9d..6a40805b5003f71350a0123cd0c1f9660f13608c 100644 --- a/src/lib/components/test_cases/TestCaseSelectModal.svelte +++ b/src/lib/components/test_cases/TestCaseSelectModal.svelte @@ -97,7 +97,7 @@ </div> <DialogDescription as="div" class="mt-2"> <div class="mb-10 text-lg"> - <span class="font-semibold ">Sélectionnez un cas type</span>, que + <span class="font-semibold">Sélectionnez un cas type</span>, que vous pourrez ensuite modifier : </div> @@ -128,7 +128,7 @@ /> </div> <div> - <span class="group-hover:text-le-bleu " + <span class="group-hover:text-le-bleu" >{situation.title} </span> </div> diff --git a/src/lib/components/test_cases/TestCaseSummary.svelte b/src/lib/components/test_cases/TestCaseSummary.svelte index 715330d673bdeb93bb7ab88070eb5f62aee191d0..23c63ad972a299a77488e2043a479705e587bf39 100644 --- a/src/lib/components/test_cases/TestCaseSummary.svelte +++ b/src/lib/components/test_cases/TestCaseSummary.svelte @@ -333,7 +333,7 @@ </div> {/if} {#if garde_alternee} - <div class="absolute -right-[2px] -bottom-[6px]"> + <div class="absolute -bottom-[6px] -right-[2px]"> <PictoGardeAlternee /> </div> {/if} @@ -368,7 +368,7 @@ <!--Affiche le RSA--> {#if rsa !== 0} <abbr - class="m-1 rounded-2xl bg-violet-200 py-1 px-2 text-sm text-gray-800 shadow-sm" + class="m-1 rounded-2xl bg-violet-200 px-2 py-1 text-sm text-gray-800 shadow-sm" title="Ce cas type touche le revenu de solidarité active">RSA</abbr > {/if} @@ -376,7 +376,7 @@ <!--Mode de garde--> {#if ass_mat || gar_dom} <abbr - class="m-1 rounded-2xl bg-yellow-200 py-1 px-2 text-sm text-gray-800 shadow-sm" + class="m-1 rounded-2xl bg-yellow-200 px-2 py-1 text-sm text-gray-800 shadow-sm" title="Cette famille embauche une personne pour faire garder ses enfants" >Emploi {#if empl_dir}direct{:else}via un organisme{/if} {#if ass_mat}d'une assistante maternelle agrée{:else if gar_dom}d'une @@ -391,34 +391,34 @@ <div class="flex items-end gap-8"> {#if mode === "view"} <button - class="flex text-sm uppercase text-gray-600 hover:text-black transition-opacity ease duration-500" - class:opacity-0-unclickable={displayMode.edit !== undefined} - on:click={() => (isTestCaseCompareModalOpen = true)} - title="Comparer ce cas type avec un autre" - id="situation_{situationIndex}_compare" - ><span> - <iconify-icon - icon="ri-user-shared-2-fill" - class="align-[-0.2rem] text-lg" - /> - <iconify-icon - icon="ri-user-line" - class="-ml-1 mr-1 align-[-0.2rem] text-lg" - /> - </span> + class="ease flex text-sm uppercase text-gray-600 transition-opacity duration-500 hover:text-black" + class:opacity-0-unclickable={displayMode.edit !== undefined} + on:click={() => (isTestCaseCompareModalOpen = true)} + title="Comparer ce cas type avec un autre" + id="situation_{situationIndex}_compare" + ><span> + <iconify-icon + icon="ri-user-shared-2-fill" + class="align-[-0.2rem] text-lg" + /> + <iconify-icon + icon="ri-user-line" + class="-ml-1 mr-1 align-[-0.2rem] text-lg" + /> + </span> comparer </button> {/if} <button - class="flex text-sm uppercase text-gray-600 hover:text-black transition-opacity ease duration-500" - class:opacity-0-unclickable={displayMode.edit !== undefined} - on:click={() => dispatch("changeTestCaseToEditIndex", situationIndex)} - title="Éditer ce cas type" - id="situation_{situationIndex}_edit" + class="ease flex text-sm uppercase text-gray-600 transition-opacity duration-500 hover:text-black" + class:opacity-0-unclickable={displayMode.edit !== undefined} + on:click={() => dispatch("changeTestCaseToEditIndex", situationIndex)} + title="Éditer ce cas type" + id="situation_{situationIndex}_edit" > <iconify-icon - icon="ri-pencil-fill" - class="mr-1 align-[-0.2rem] text-lg" + icon="ri-pencil-fill" + class="mr-1 align-[-0.2rem] text-lg" /> <span class="hidden sm:flex">éditer</span> </button> @@ -513,7 +513,7 @@ )} {#if !childrenId.includes(populationId) || (childrenId.includes(populationId) && activite !== "inactif")} - <div class="my-2 lg:basis-1/2 lg:grow-0 flex-1"> + <div class="my-2 flex-1 lg:grow-0 lg:basis-1/2"> <div> {#if personsCount > 1} <div class="text-xs text-gray-400"> @@ -530,7 +530,7 @@ <span> {#if contrat_de_travail_type === "cdd"} <abbr - class="my-1 rounded-2xl bg-blue-200 py-1 px-2 text-xs text-gray-800 shadow-sm inline-block" + class="my-1 inline-block rounded-2xl bg-blue-200 px-2 py-1 text-xs text-gray-800 shadow-sm" title="Contrat à durée déterminée" >{#if contrat_duree_determinee_type === "contrat_usage"} CDD d'usage @@ -548,31 +548,31 @@ </abbr> {:else if contrat_de_travail_type === "cdi"} <abbr - class="my-1 rounded-2xl bg-blue-200 py-1 px-2 text-xs text-gray-800 shadow-sm inline-block" + class="my-1 inline-block rounded-2xl bg-blue-200 px-2 py-1 text-xs text-gray-800 shadow-sm" title="Contrat à durée indéterminée">CDI</abbr > {:else if contrat_de_travail_type === "ctt"} <abbr - class="my-1 rounded-2xl bg-blue-200 py-1 px-2 text-xs text-gray-800 shadow-sm inline-block" + class="my-1 inline-block rounded-2xl bg-blue-200 px-2 py-1 text-xs text-gray-800 shadow-sm" title="Contrat de travail temporaire">CTT</abbr > {/if} {#if salarie_regime_alsace_moselle} <span - class="my-1 rounded-2xl bg-emerald-300 py-1 px-2 text-xs text-gray-800 shadow-sm inline-block" + class="my-1 inline-block rounded-2xl bg-emerald-300 px-2 py-1 text-xs text-gray-800 shadow-sm" >Régime Alsace‑Moselle</span > {/if} {#if apprenti} <span - class="my-1 rounded-2xl bg-blue-200 py-1 px-2 text-xs text-gray-800 shadow-sm inline-block" + class="my-1 inline-block rounded-2xl bg-blue-200 px-2 py-1 text-xs text-gray-800 shadow-sm" >Apprenti</span > {/if} {#if choix_exoneration_cotisations_employeur_agricole} <abbr - class="m-1 rounded-2xl bg-violet-200 py-1 px-2 text-sm text-gray-800 shadow-sm inline-block" + class="m-1 inline-block rounded-2xl bg-violet-200 px-2 py-1 text-sm text-gray-800 shadow-sm" title="Travailleur saisonnier exonéré de cotisations patronales de sécurité sociale" >TO-DE</abbr > @@ -677,7 +677,7 @@ <!--Projet de loi n°19 : Prime de partage de la valeur (PPV) version pérenne --> <span> <span - class="my-1 rounded-2xl bg-le-rouge-bill py-0.5 px-2 text-xs text-white shadow-sm" + class="my-1 rounded-2xl bg-le-rouge-bill px-2 py-0.5 text-xs text-white shadow-sm" > <abbr class="text-xs" @@ -696,7 +696,7 @@ <!--Projet de loi n°19 : Prime de partage de la valeur (PPV) version exceptionnelle --> <span> <span - class="my-1 rounded-2xl bg-le-rouge-bill py-0.5 px-2 text-xs text-white shadow-sm" + class="my-1 rounded-2xl bg-le-rouge-bill px-2 py-0.5 text-xs text-white shadow-sm" > <abbr class="text-xs" @@ -713,7 +713,7 @@ )} </span> <abbr - class="text-xs " + class="text-xs" title="Montant annuel de primes du secteur privé par an" >primes</abbr > @@ -727,7 +727,7 @@ {#if categorie_salarie === "prive_non_cadre" || categorie_salarie === "prive_cadre"} <div class="flex"> <div - class="mt-2 mb-1 flex items-center gap-2 rounded-md border-b border-gray-300 bg-white px-2 py-1" + class="mb-1 mt-2 flex items-center gap-2 rounded-md border-b border-gray-300 bg-white px-2 py-1" > {#if secteur_activite_employeur === "agricole"} <iconify-icon @@ -749,7 +749,9 @@ <div class="flex"> <div class="my-1 flex items-end gap-2 rounded-md bg-white p-1"> <PictoBigHopital /> - <abbr class="text-xs text-blue-700" title="Effectif de l'hôpital" + <abbr + class="text-xs text-blue-700" + title="Effectif de l'hôpital" >Effectif de l'hôpital :<br /></abbr > </div> diff --git a/src/lib/components/variables/FormulaView.svelte b/src/lib/components/variables/FormulaView.svelte index ac89b0109397e2f2fda7c95e1900054ba7e9574b..b39bf744c5e11bea51cf26b9ab5a108b6c4ad8a2 100644 --- a/src/lib/components/variables/FormulaView.svelte +++ b/src/lib/components/variables/FormulaView.svelte @@ -184,7 +184,7 @@ <ul class=""> {#each openFiscaVariables as variable} <li - class="my-2 mb-4 flex-col items-baseline overflow-x-auto break-all rounded-b border-t-2 bg-gray-100 py-1 px-2 text-base text-black" + class="my-2 mb-4 flex-col items-baseline overflow-x-auto break-all rounded-b border-t-2 bg-gray-100 px-2 py-1 text-base text-black" > <VariableInput {date} diff --git a/src/lib/components/variables/VariableHeader.svelte b/src/lib/components/variables/VariableHeader.svelte index c88291b5035161b692d1bee7efa1387eb4cce2c5..b821739f6acd981caa205548c6ff5d40197bc61a 100644 --- a/src/lib/components/variables/VariableHeader.svelte +++ b/src/lib/components/variables/VariableHeader.svelte @@ -34,7 +34,7 @@ </script> <!-- For a variable, the header of the reform area. --> -<div class="sticky top-0 rounded-r bg-white pr-5 pb-2 "> +<div class="sticky top-0 rounded-r bg-white pb-2 pr-5"> <h1 class="flex font-serif text-xl font-light md:text-2xl"> <span class="hidden md:block" >{decomposition?.label ?? variable?.label ?? variableName}</span @@ -117,7 +117,7 @@ class="my-2 flex-col rounded-sm bg-white bg-opacity-40 p-2 text-base sm:p-1 md:p-2" > <div - class="mt-4 mb-2 flex justify-center rounded bg-gray-200 p-2 text-sm uppercase text-gray-900 shadow-md hover:bg-gray-400" + class="mb-2 mt-4 flex justify-center rounded bg-gray-200 p-2 text-sm uppercase text-gray-900 shadow-md hover:bg-gray-400" > <a class="text-center" diff --git a/src/lib/components/variables/VariableInput.svelte b/src/lib/components/variables/VariableInput.svelte index 6cb184c99b27fa12dada2972ae09036bf090247e..14e979532f53688f9d7605ae4940f55f3bcfecbb 100644 --- a/src/lib/components/variables/VariableInput.svelte +++ b/src/lib/components/variables/VariableInput.svelte @@ -350,7 +350,7 @@ <section> <div> - <div class="flex items-start justify-between "> + <div class="flex items-start justify-between"> <h1 class="flex w-4/5 items-center text-base font-bold"> <span> {variable.label ?? variable.name} @@ -569,7 +569,7 @@ )} {#if value === "chomeur" && isFirstEncounter("chomeur", populationId)} - <div class="rounded-md bg-le-gris-dispositif-light p-3 "> + <div class="rounded-md bg-le-gris-dispositif-light p-3"> <p class="font-serif text-base"> Au sens de Pôle emploi et de la DARES, il y a en moyenne <span class="font-bold" @@ -580,7 +580,7 @@ total de 6 398 300. </p> <p - class="mt-2 ml-10 justify-self-end text-right font-serif text-sm text-gray-700" + class="ml-10 mt-2 justify-self-end text-right font-serif text-sm text-gray-700" > <a class="link" @@ -603,7 +603,7 @@ en France hors Mayotte au 4ème trimestre 2021. </p> <p - class="mt-2 ml-10 justify-self-end text-right font-serif text-sm text-gray-700" + class="ml-10 mt-2 justify-self-end text-right font-serif text-sm text-gray-700" > <a class="link" @@ -673,7 +673,7 @@ </p> <p - class="mt-2 ml-10 justify-self-end text-right font-serif text-sm text-gray-700" + class="ml-10 mt-2 justify-self-end text-right font-serif text-sm text-gray-700" > LexImpact, <span class="italic" >agrégats extraits de la <a diff --git a/src/lib/components/variables/VariableReferredInputs.svelte b/src/lib/components/variables/VariableReferredInputs.svelte index 01fe76271e9df819119e764348786778b84058e0..e70e23de6416b1560da639dcec47882e0acfedbb 100644 --- a/src/lib/components/variables/VariableReferredInputs.svelte +++ b/src/lib/components/variables/VariableReferredInputs.svelte @@ -31,7 +31,7 @@ $: openAllInputs = directInputs.length === 0 </script> -<h2 class="ml-4 mr-4 mb-2 pt-3 text-xl md:mr-0"> +<h2 class="mb-2 ml-4 mr-4 pt-3 text-xl md:mr-0"> Ajouter des caractéristiques <br />ayant une influence sur : </h2> @@ -41,7 +41,7 @@ <span class="font-serif text-lg font-bold" >{variable.short_label ?? variable.label ?? variable.name}</span > - <a class="link2 mr-3 text-gray-500 " href="/variables/{variable.name}"> + <a class="link2 mr-3 text-gray-500" href="/variables/{variable.name}"> <!--RemixIcon More-2-fill --> <svg class="fill-current" @@ -59,7 +59,7 @@ {#if directInputs.length > 0} <section class="mb-3 mr-5 pb-3"> <h2 - class="my-4 ml-4 flex justify-between rounded-l bg-gray-400 py-1 px-3 text-white shadow-inner" + class="my-4 ml-4 flex justify-between rounded-l bg-gray-400 px-3 py-1 text-white shadow-inner" > <span>Caractéristiques écrites dans la formule du dispositif</span> <button on:click={() => (openDirectInputs = !openDirectInputs)}> @@ -110,9 +110,9 @@ {/if} {#if inputs.length > 0} - <section class="mb-3 pb-3 "> + <section class="mb-3 pb-3"> <h2 - class="my-4 ml-4 flex justify-between rounded-l bg-gray-400 py-1 px-3 text-white shadow-inner" + class="my-4 ml-4 flex justify-between rounded-l bg-gray-400 px-3 py-1 text-white shadow-inner" > <span>Caractéristiques directement influentes</span> <button on:click={() => (openAllInputs = !openAllInputs)}> diff --git a/src/lib/components/variables/VariableReferredParameters.svelte b/src/lib/components/variables/VariableReferredParameters.svelte index d07255353200d965b6a5808ad68be2b35e04df22..b30b62de02c77bea175391e65aff0cef21bc0e6f 100644 --- a/src/lib/components/variables/VariableReferredParameters.svelte +++ b/src/lib/components/variables/VariableReferredParameters.svelte @@ -143,12 +143,16 @@ {#if billDecomposition?.children === undefined} {#if Object.keys(bothRootDirectParameterById).length > 0} <button - class="mb-3 w-full border-b border-gray-300 py-1 pr-4 " - on:click={() => (openDirectParameters = !openDirectParameters)}> + class="mb-3 w-full border-b border-gray-300 py-1 pr-4" + on:click={() => (openDirectParameters = !openDirectParameters)} + > <div class="flex items-center text-gray-600"> <iconify-icon - class="mr-1 align-[-0.2rem] text-xl" - icon={openDirectParameters ? "ri-arrow-down-s-line" : "ri-arrow-right-s-line"}/> + class="mr-1 align-[-0.2rem] text-xl" + icon={openDirectParameters + ? "ri-arrow-down-s-line" + : "ri-arrow-right-s-line"} + /> <span class="tracking-wider">Principaux paramètres de la loi</span> </div> </button> @@ -200,13 +204,19 @@ {#if Object.keys(bothRootParameterById).length > 0} <button - class="mb-3 w-full border-b border-gray-300 py-1 pr-4 text-gray-600" - on:click={() => (openAllParameters = !openAllParameters)}> + class="mb-3 w-full border-b border-gray-300 py-1 pr-4 text-gray-600" + on:click={() => (openAllParameters = !openAllParameters)} + > <div class="flex items-center"> <iconify-icon - class="mr-1 align-[-0.2rem] text-xl" - icon={openAllParameters ? "ri-arrow-down-s-line" : "ri-arrow-right-s-line"}/> - <span class="tracking-wider">Autres paramètres affectant le dispositif</span> + class="mr-1 align-[-0.2rem] text-xl" + icon={openAllParameters + ? "ri-arrow-down-s-line" + : "ri-arrow-right-s-line"} + /> + <span class="tracking-wider" + >Autres paramètres affectant le dispositif</span + > </div> </button> diff --git a/src/lib/components/variables/VariableReferredScaleAtInstant.svelte b/src/lib/components/variables/VariableReferredScaleAtInstant.svelte index d433a6a14bf58e71f5432314328427f083edfc08..5a9dfdf757c12c5d9e420fbd6c3cbcfcaabf0b08 100644 --- a/src/lib/components/variables/VariableReferredScaleAtInstant.svelte +++ b/src/lib/components/variables/VariableReferredScaleAtInstant.svelte @@ -122,7 +122,7 @@ <div class="flex-col overflow-x-auto"> <div class=""> - <table class="table-auto border-collapse "> + <table class="table-auto border-collapse"> <thead> <tr> <th /> @@ -352,7 +352,7 @@ on:click={appendBracket} type="button" > - <div class="mt-2 flex items-center pl-1 pb-4 text-sm"> + <div class="mt-2 flex items-center pb-4 pl-1 text-sm"> <svg class="mr-1 inline fill-current" xmlns="http://www.w3.org/2000/svg" diff --git a/src/lib/components/variables/VariableReferredScaleParameter.svelte b/src/lib/components/variables/VariableReferredScaleParameter.svelte index 57d132ce4065b70f5df1275c07a7d6ce9f8223f0..96ace8a8deea25381a08632bde23e448f9480d3b 100644 --- a/src/lib/components/variables/VariableReferredScaleParameter.svelte +++ b/src/lib/components/variables/VariableReferredScaleParameter.svelte @@ -141,10 +141,10 @@ } </script> -<section class="ml-5 border-l-2 border-le-gris-dispositif-light pl-4 pb-4"> +<section class="ml-5 border-l-2 border-le-gris-dispositif-light pb-4 pl-4"> <VariableReferredParameterHeader {depth} parameter={billParameter} /> - <div class="mt-1 flex rounded-t bg-gray-100 pl-1 pt-2 "> + <div class="mt-1 flex rounded-t bg-gray-100 pl-1 pt-2"> <VariableReferredScaleAtInstant {billParameter} {billScaleAtInstant} @@ -171,7 +171,7 @@ </a> </div> - <div class="rounded-b bg-le-gris-dispositif-ultralight py-2 px-2"> + <div class="rounded-b bg-le-gris-dispositif-ultralight px-2 py-2"> <div class="flex items-center justify-between"> {#if billLatestInstant !== "0001-01-01"} <!--Date du paramètre--> diff --git a/src/lib/components/variables/VariableReferredValueParameter.svelte b/src/lib/components/variables/VariableReferredValueParameter.svelte index 74760bf9abc94c5c56f5d76484604a956ee6cd91..791dd7fc45eeb42bc6549beec196df1fdfc983ce 100644 --- a/src/lib/components/variables/VariableReferredValueParameter.svelte +++ b/src/lib/components/variables/VariableReferredValueParameter.svelte @@ -149,7 +149,7 @@ </script> {#if !hideNull || value !== null} - <section class="ml-5 border-l-2 border-le-gris-dispositif-light pl-4 pb-6"> + <section class="ml-5 border-l-2 border-le-gris-dispositif-light pb-6 pl-4"> <VariableReferredParameterHeader {depth} parameter={billParameter} /> <div @@ -193,7 +193,7 @@ > </div> </div> - <div class="rounded-b bg-le-gris-dispositif-ultralight py-2 px-2"> + <div class="rounded-b bg-le-gris-dispositif-ultralight px-2 py-2"> <div class="flex items-center justify-between"> {#if billLatestInstant !== "0001-01-01"} <!--Date du paramètre--> diff --git a/src/lib/components/variables/VariableView.svelte b/src/lib/components/variables/VariableView.svelte index 2efea023fe62c0f69f4b764a1a86957a13854701..e395266abe18ff13fbb9be82e9b87a2d6794288f 100644 --- a/src/lib/components/variables/VariableView.svelte +++ b/src/lib/components/variables/VariableView.svelte @@ -31,12 +31,12 @@ <div class="flex-col items-start pb-4"> <div class="flex-col items-start pb-4"> - <div class="pt-10 px-10"> + <div class="px-10 pt-10"> <!--Titre de la formule--> <p class="mb-2 uppercase">Formule de calcul</p> - <div class="mb-4 border-l-2 border-black pl-4 "> + <div class="mb-4 border-l-2 border-black pl-4"> <!-- <var>{variable.name}</var> --> {#if variable.label !== undefined} <p class="font-serif text-3xl font-bold">{variable.label}</p> @@ -67,7 +67,7 @@ {/each} {#if editable} <div class="mt-7 rounded border-2 border-gray-200 p-2"> - <h2 class="mb-2 pb-3 text-sm font-bold text-gray-500 "> + <h2 class="mb-2 pb-3 text-sm font-bold text-gray-500"> Valeur du dispositif pour le cas type : </h2> @@ -221,7 +221,7 @@ {#if variable.referring_variables !== undefined} <div> - <h2 class="pt-7 pb-3 text-xl font-bold"> + <h2 class="pb-3 pt-7 text-xl font-bold"> Variables et dispositifs influencés par la formule : </h2> <p> @@ -244,7 +244,7 @@ <!-- Caractéristiques avancées--> <div class="my-4"> - <h2 class="pt-7 pb-3 text-xl font-bold"> + <h2 class="pb-3 pt-7 text-xl font-bold"> Caractéristiques avancées : </h2> diff --git a/src/lib/search/search_common_variables.ts b/src/lib/search/search_common_variables.ts index 468dd0eca9827fb63421bb1e59d1c99246fd25a4..7303a96dfc793ce20066da66469e3bb33f293e6c 100644 --- a/src/lib/search/search_common_variables.ts +++ b/src/lib/search/search_common_variables.ts @@ -1,40 +1,40 @@ -import type {Variable} from "@openfisca/json-model" -import {variableSummaryByName} from "$lib/variables" +import type { Variable } from "@openfisca/json-model" +import { variableSummaryByName } from "$lib/variables" import decompositionCoreByName from "@leximpact/socio-fiscal-openfisca-json/decompositions.json" -import MiniSearch from "minisearch"; +import MiniSearch from "minisearch" const idField = "name" export const miniSearch = new MiniSearch({ - fields: ["short_label", "label", "name"], - idField: idField, - searchOptions: { - fuzzy: 0.3, - prefix: true, - weights: { - fuzzy: 0.5, - prefix: 0.75, - }, + fields: ["short_label", "label", "name"], + idField: idField, + searchOptions: { + fuzzy: 0.3, + prefix: true, + weights: { + fuzzy: 0.5, + prefix: 0.75, }, + }, }) export const allVariables: Variable[] = Object.values(variableSummaryByName) -const variablesById = - allVariables - .reduce((byId: { [id: string]: Variable }, variable: Variable) => { - byId[variable[idField]] = variable - return byId - }, {}) +const variablesById = allVariables.reduce( + (byId: { [id: string]: Variable }, variable: Variable) => { + byId[variable[idField]] = variable + return byId + }, + {}, +) -export const waterfallVariables = - Object.keys(decompositionCoreByName) - .map((item: string) => variablesById[item]) - .filter(item => item) +export const waterfallVariables = Object.keys(decompositionCoreByName) + .map((item: string) => variablesById[item]) + .filter((item) => item) export const onMessage = function (event: MessageEvent) { - // The search string (aka the term) is in event.data. - const result = miniSearch.search(event.data).slice(0, 50) - const variableObjects = result.map((item) => variablesById[item.id]) - postMessage(variableObjects) -} \ No newline at end of file + // The search string (aka the term) is in event.data. + const result = miniSearch.search(event.data).slice(0, 50) + const variableObjects = result.map((item) => variablesById[item.id]) + postMessage(variableObjects) +} diff --git a/src/lib/search/search_mode.ts b/src/lib/search/search_mode.ts index 5aa2fee25e8acccbddae5fef45d6a427d8284e4c..33dafcc19d099a0a5fc1001bf2e0759b2f4f72ad 100644 --- a/src/lib/search/search_mode.ts +++ b/src/lib/search/search_mode.ts @@ -1,3 +1,4 @@ export enum SearchMode { - variables, parameters -} \ No newline at end of file + variables, + parameters, +} diff --git a/src/lib/search/search_worker_parameters.ts b/src/lib/search/search_worker_parameters.ts index ca1375a189732667ebc2353197a3b3f9e1f50d15..4945a222821a5ac6d3a8bf5113a1e67b43a94f84 100644 --- a/src/lib/search/search_worker_parameters.ts +++ b/src/lib/search/search_worker_parameters.ts @@ -1,38 +1,38 @@ -import {type Parameter, walkParameters} from "@openfisca/json-model" +import { type Parameter, walkParameters } from "@openfisca/json-model" -import {rootParameter} from "$lib/parameters" -import MiniSearch from "minisearch"; +import { rootParameter } from "$lib/parameters" +import MiniSearch from "minisearch" const miniSearch = new MiniSearch({ - fields: ["id", "short_label", "description", "titles"], - searchOptions: { - fuzzy: 0.3, - prefix: true, - weights: { - fuzzy: 0.5, - prefix: 0.75, - }, + fields: ["id", "short_label", "description", "titles"], + searchOptions: { + fuzzy: 0.3, + prefix: true, + weights: { + fuzzy: 0.5, + prefix: 0.75, }, + }, }) -const parameters: Parameter[] = - [...walkParameters(rootParameter)] - .reverse() - .filter((value, index, self) => - index === self.findIndex((t) => ( - t.id === value.id - )) - ) +const parameters: Parameter[] = [...walkParameters(rootParameter)] + .reverse() + .filter( + (value, index, self) => index === self.findIndex((t) => t.id === value.id), + ) miniSearch.addAll(parameters) -const parametersById = parameters.reduce((byId: { [id: string]: Parameter }, parameter: Parameter) => { +const parametersById = parameters.reduce( + (byId: { [id: string]: Parameter }, parameter: Parameter) => { if (parameter.id !== undefined) byId[parameter.id] = parameter return byId -}, {}) + }, + {}, +) onmessage = function (event: MessageEvent) { - // The search string (aka the term) is in event.data. - const result = miniSearch.search(event.data).slice(0, 50) - const parameterObjects = result.map((item) => parametersById[item.id]) - postMessage(parameterObjects) + // The search string (aka the term) is in event.data. + const result = miniSearch.search(event.data).slice(0, 50) + const parameterObjects = result.map((item) => parametersById[item.id]) + postMessage(parameterObjects) } diff --git a/src/lib/search/search_worker_variables_all.ts b/src/lib/search/search_worker_variables_all.ts index 82c24fd5043aeccdda63f2021c60856c8541050e..92487580816260b1f29a4363849232bbf091665b 100644 --- a/src/lib/search/search_worker_variables_all.ts +++ b/src/lib/search/search_worker_variables_all.ts @@ -1,5 +1,9 @@ -import { miniSearch, allVariables, onMessage } from "$lib/search/search_common_variables" +import { + miniSearch, + allVariables, + onMessage, +} from "$lib/search/search_common_variables" miniSearch.addAll(allVariables) -onmessage = onMessage \ No newline at end of file +onmessage = onMessage diff --git a/src/lib/search/search_worker_variables_waterfall.ts b/src/lib/search/search_worker_variables_waterfall.ts index c08ef3e92c1be506e46f7791c637cbf5b0b37818..ea1bd419fac3d2f8a2fe42f9e4b975e3eca37f90 100644 --- a/src/lib/search/search_worker_variables_waterfall.ts +++ b/src/lib/search/search_worker_variables_waterfall.ts @@ -1,5 +1,9 @@ -import { miniSearch, waterfallVariables, onMessage } from "$lib/search/search_common_variables" +import { + miniSearch, + waterfallVariables, + onMessage, +} from "$lib/search/search_common_variables" miniSearch.addAll(waterfallVariables) -onmessage = onMessage \ No newline at end of file +onmessage = onMessage diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 058d24ff93096d3fd0a63989280e5588e75f2a06..05c917b22026825354077c00346419098cc96079 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -69,48 +69,48 @@ } from "$lib/variables" import type { PageData } from "./$types" - import {SearchMode} from "$lib/search/search_mode"; + import { SearchMode } from "$lib/search/search_mode" export let data: PageData const billName = getContext("billName") as Writable<string | undefined> const budgetSimulation = getContext("budgetSimulation") as Writable< - BudgetSimulation | undefined - > + BudgetSimulation | undefined + > const date = getContext("date") as Writable<string> const decompositionByName = getContext( - "decompositionByName", + "decompositionByName", ) as Writable<DecompositionByName> let displayMode: DisplayMode = { testCasesIndex: [0], waterfallName: waterfalls[0].name, } const evaluationByNameArray = getContext("evaluationByNameArray") as Writable< - EvaluationByName[] - > + EvaluationByName[] + > const inputInstantsByVariableNameArray = getContext( - "inputInstantsByVariableNameArray", + "inputInstantsByVariableNameArray", ) as Writable< - Array<{ - [name: string]: Set<string> - }> - > + Array<{ + [name: string]: Set<string> + }> + > let isTestCaseSelectModalOpen = false let modificationsOpen = false const waterfall = getContext("waterfall") as Writable<Waterfall> setContext("newSelfTargetAProps", newSelfTargetAProps) const parametricReform = getContext( - "parametricReform", + "parametricReform", ) as Writable<ParametricReform> const requestedCalculations = getContext( - "requestedCalculations", + "requestedCalculations", ) as Writable<RequestedCalculations> const showTutorial = getContext("showTutorial") as Writable<boolean> const testCases = getContext("testCases") as Writable<Situation[]> const testCasesIndex = getContext("testCasesIndex") as Writable<number[]> const valuesByCalculationNameByVariableNameArray = getContext( - "valuesByCalculationNameByVariableNameArray", + "valuesByCalculationNameByVariableNameArray", ) as Writable<ValuesByCalculationNameByVariableName[]> let windowInnerWidth: number | undefined = undefined const year = getContext("year") as Writable<number> @@ -120,119 +120,119 @@ $: ensureValidDisplayMode($page.url.searchParams) $: if ( - browser && - windowInnerWidth !== undefined && - windowInnerWidth >= 768 && - $showTutorial + browser && + windowInnerWidth !== undefined && + windowInnerWidth >= 768 && + $showTutorial ) { $showTutorial = false localStorage.setItem("hideTutorial", "true") introJs() - .setOptions({ - disableInteraction: true, - doneLabel: "Fermer", - nextLabel: "Suivant", - prevLabel: "Précédent", - scrollToElement: false, - steps: [ - { - title: "Bienvenue 👋", - intro: - "Ceci est un court tutoriel 🪄 présentant les différentes fonctionnalités de l'interface.", - }, - { - title: "Un simulateur transverse 🔮", - intro: - "Ce simulateur vous permet d'<b>estimer les effets d'une modification</b> : <ul><li>• des cotisations sociales ;</li><li>• des impôts ;</li><li>• des prestations sociales ;</li></ul> sur un <b>cas type</b>.", - }, - - { - title: "À gauche, la loi 📜", - element: document.querySelector("#situation_left_part_law"), - intro: - "Cet espace vous permet de: <ul><li>• <b>🔎 vous renseigner</b> sur un dispositif ;</li><li>• <b>📖 consulter les paramètres</b> de la loi ;</li><li>• 🚀<b>modifier</b> les paramètres et <b>lancer une estimation</b>.</li></ul>", - }, - { - title: "À droite, les impacts 📊", - element: document.querySelector("#situation_right_part_impacts"), - intro: - "Cet espace vous permet de visualiser les impacts de la loi ou de votre amendement :<br><br><ul><li>• sur <b>👩👦👦 des cas types de salariés du secteur privé</b> non agricole;</li><br><li>• 👩👦👦 des cas types avec d'autres revenus tels que la <b>retraite</b>, le <b>chômage</b>, le <b>RSA</b> ou les <b>rentes</b>.</li><br><li>• 🏛 sur le <b>budget de l'État et de la Sécurité sociale</b> (pour l'impôt sur le revenu et la CSG des revenus d'activité).</li></ul>", - }, - { - title: "Un code couleur 🎨 :", - intro: - "<ul><li>• noir ⚫️ pour la <b>loi en vigueur</b> ;</li><br><li>• rouge 🔴 pour les projets de loi de finances (<b>PLF</b>) et financement de la Sécurité sociale (<b>PLFSS</b>) ;</li><br><li>• sur fond jaune 🟡 lorsque vous effectuez un <b>amendement</b>.</li></ul>", - }, - { - element: document.querySelector( - "#situation_0_color_code_impactsside", - ), - intro: - "…Ce code couleur se retrouve autant du côté des impacts 📊…", - }, - { - element: document.querySelector("#situation_left_part_law"), - intro: "…que du côté de la loi 📜 quand un dispositif est modifié…", - }, - { - title: "Le cas type 👩👦👦", - element: document.querySelector("#situation_0"), - intro: "Retournons plus en détails sur le cas type…", - }, - { - title: "Synthèse des caractéristiques du cas type 👩👦👦", - element: document.querySelector("#situation_0_case_summary"), - intro: - "La vignette en haut du cas type vous résume les caractéristiques principales du cas type.", - }, - { - title: "Configuration du cas type 🖌", - element: document.querySelector("#situation_0_edit"), - intro: - "Toutes les caractéristiques sont visibles et éditables en cliquant sur le stylo en haut à droite.", - }, - { - title: "Montants totaux 🧮", - element: document.querySelector("#situation_0_totalimpact"), - intro: - "Le montant total du <b>revenu disponible</b> ou du <b>coût salarial</b> côté employeur, ainsi que le montant du dispositif une fois choisi, est affiché ici.", - }, - { - title: "Décomposition d'une situation 🧾", - element: document.querySelector("#situation_0_waterfall"), - intro: - "Pour chaque situation, nous partons des <b>revenus bruts</b> (salaire brut pour un cas type de salarié) et détaillons l'ensemble des prélèvements obligatoires et compléments de ressources affectant le cas type, jusqu'au <b>revenu finalement disponible</b>.", - }, - { - title: "La décomposition du côté de l'employeur 🧾", - element: document.querySelector("#situation_0_Employeur"), - intro: - "Utilisez les onglets à gauche du cas type pour vous rendre sur la décomposition du côté de l'employeur.<br><br><b>Le principe est identique</b>, les dispositifs affectant le cas type sont détaillés du <b>salaire brut jusqu'au coût salarial</b>.", - }, - - { - title: "Comparaison de deux cas types 👭", - element: document.querySelector("#situation_0_compare"), - intro: - "Vous pouvez ici comparer un cas type par rapport à un autre, ainsi que les impacts des modifications de la loi.", - }, - { - title: "Enregistrer sa copie de travail", - element: document.querySelector("#situation_savebutton"), - intro: - 'Pour terminer, <b>sauvegardez et partagez votre copie de travail</b> (cas types et réforme).<br><br>💡 Si vous avez une question sur votre estimation, écrivez-nous à <a class="link" href="mailto:leximpact@an.fr">leximpact@an.fr</a> en utilisant cette fonctionnalité pour nous transmettre votre réforme et vos cas types.', - }, - ], - }) - // .onbeforeexit(function () { - // return confirm("Voulez-vous vraiment quitter le tutoriel ?") - // }) - .start() + .setOptions({ + disableInteraction: true, + doneLabel: "Fermer", + nextLabel: "Suivant", + prevLabel: "Précédent", + scrollToElement: false, + steps: [ + { + title: "Bienvenue 👋", + intro: + "Ceci est un court tutoriel 🪄 présentant les différentes fonctionnalités de l'interface.", + }, + { + title: "Un simulateur transverse 🔮", + intro: + "Ce simulateur vous permet d'<b>estimer les effets d'une modification</b> : <ul><li>• des cotisations sociales ;</li><li>• des impôts ;</li><li>• des prestations sociales ;</li></ul> sur un <b>cas type</b>.", + }, + + { + title: "À gauche, la loi 📜", + element: document.querySelector("#situation_left_part_law"), + intro: + "Cet espace vous permet de: <ul><li>• <b>🔎 vous renseigner</b> sur un dispositif ;</li><li>• <b>📖 consulter les paramètres</b> de la loi ;</li><li>• 🚀<b>modifier</b> les paramètres et <b>lancer une estimation</b>.</li></ul>", + }, + { + title: "À droite, les impacts 📊", + element: document.querySelector("#situation_right_part_impacts"), + intro: + "Cet espace vous permet de visualiser les impacts de la loi ou de votre amendement :<br><br><ul><li>• sur <b>👩👦👦 des cas types de salariés du secteur privé</b> non agricole;</li><br><li>• 👩👦👦 des cas types avec d'autres revenus tels que la <b>retraite</b>, le <b>chômage</b>, le <b>RSA</b> ou les <b>rentes</b>.</li><br><li>• 🏛 sur le <b>budget de l'État et de la Sécurité sociale</b> (pour l'impôt sur le revenu et la CSG des revenus d'activité).</li></ul>", + }, + { + title: "Un code couleur 🎨 :", + intro: + "<ul><li>• noir ⚫️ pour la <b>loi en vigueur</b> ;</li><br><li>• rouge 🔴 pour les projets de loi de finances (<b>PLF</b>) et financement de la Sécurité sociale (<b>PLFSS</b>) ;</li><br><li>• sur fond jaune 🟡 lorsque vous effectuez un <b>amendement</b>.</li></ul>", + }, + { + element: document.querySelector( + "#situation_0_color_code_impactsside", + ), + intro: + "…Ce code couleur se retrouve autant du côté des impacts 📊…", + }, + { + element: document.querySelector("#situation_left_part_law"), + intro: "…que du côté de la loi 📜 quand un dispositif est modifié…", + }, + { + title: "Le cas type 👩👦👦", + element: document.querySelector("#situation_0"), + intro: "Retournons plus en détails sur le cas type…", + }, + { + title: "Synthèse des caractéristiques du cas type 👩👦👦", + element: document.querySelector("#situation_0_case_summary"), + intro: + "La vignette en haut du cas type vous résume les caractéristiques principales du cas type.", + }, + { + title: "Configuration du cas type 🖌", + element: document.querySelector("#situation_0_edit"), + intro: + "Toutes les caractéristiques sont visibles et éditables en cliquant sur le stylo en haut à droite.", + }, + { + title: "Montants totaux 🧮", + element: document.querySelector("#situation_0_totalimpact"), + intro: + "Le montant total du <b>revenu disponible</b> ou du <b>coût salarial</b> côté employeur, ainsi que le montant du dispositif une fois choisi, est affiché ici.", + }, + { + title: "Décomposition d'une situation 🧾", + element: document.querySelector("#situation_0_waterfall"), + intro: + "Pour chaque situation, nous partons des <b>revenus bruts</b> (salaire brut pour un cas type de salarié) et détaillons l'ensemble des prélèvements obligatoires et compléments de ressources affectant le cas type, jusqu'au <b>revenu finalement disponible</b>.", + }, + { + title: "La décomposition du côté de l'employeur 🧾", + element: document.querySelector("#situation_0_Employeur"), + intro: + "Utilisez les onglets à gauche du cas type pour vous rendre sur la décomposition du côté de l'employeur.<br><br><b>Le principe est identique</b>, les dispositifs affectant le cas type sont détaillés du <b>salaire brut jusqu'au coût salarial</b>.", + }, + + { + title: "Comparaison de deux cas types 👭", + element: document.querySelector("#situation_0_compare"), + intro: + "Vous pouvez ici comparer un cas type par rapport à un autre, ainsi que les impacts des modifications de la loi.", + }, + { + title: "Enregistrer sa copie de travail", + element: document.querySelector("#situation_savebutton"), + intro: + 'Pour terminer, <b>sauvegardez et partagez votre copie de travail</b> (cas types et réforme).<br><br>💡 Si vous avez une question sur votre estimation, écrivez-nous à <a class="link" href="mailto:leximpact@an.fr">leximpact@an.fr</a> en utilisant cette fonctionnalité pour nous transmettre votre réforme et vos cas types.', + }, + ], + }) + // .onbeforeexit(function () { + // return confirm("Voulez-vous vraiment quitter le tutoriel ?") + // }) + .start() } function auditSimulationQuery( - audit: Audit, - query: URLSearchParams, + audit: Audit, + query: URLSearchParams, ): [unknown, unknown] { if (query == null) { return [query, null] @@ -253,126 +253,126 @@ const remainingKeys = new Set(Object.keys(data)) audit.attribute( - data, - "budget", - true, - errors, - remainingKeys, - auditQuerySingleton(auditTrimString, auditStringToBoolean), + data, + "budget", + true, + errors, + remainingKeys, + auditQuerySingleton(auditTrimString, auditStringToBoolean), ) audit.attribute( - data, - "compact", - true, - errors, - remainingKeys, - auditQuerySingleton(auditTrimString, auditStringToBoolean), + data, + "compact", + true, + errors, + remainingKeys, + auditQuerySingleton(auditTrimString, auditStringToBoolean), ) audit.attribute( - data, - "edit", - true, - errors, - remainingKeys, - auditQuerySingleton( - auditTrimString, - auditStringToNumber, - auditInteger, - auditTest( - (index) => index >= 0 && index < $testCases.length, - "Ce numéro ne correspond à aucun cas type", - ), - ), + data, + "edit", + true, + errors, + remainingKeys, + auditQuerySingleton( + auditTrimString, + auditStringToNumber, + auditInteger, + auditTest( + (index) => index >= 0 && index < $testCases.length, + "Ce numéro ne correspond à aucun cas type", + ), + ), ) audit.attribute( - data, - "law", - true, - errors, - remainingKeys, - auditQuerySingleton(auditTrimString, auditStringToBoolean), + data, + "law", + true, + errors, + remainingKeys, + auditQuerySingleton(auditTrimString, auditStringToBoolean), ) audit.attribute( - data, - "parameter", - true, - errors, - remainingKeys, - auditQuerySingleton(auditTrimString), + data, + "parameter", + true, + errors, + remainingKeys, + auditQuerySingleton(auditTrimString), ) audit.attribute( - data, - "parameters", - true, - errors, - remainingKeys, - auditQuerySingleton(auditTrimString), + data, + "parameters", + true, + errors, + remainingKeys, + auditQuerySingleton(auditTrimString), ) audit.attribute( - data, - "test_case", - true, - errors, - remainingKeys, - auditQueryArray( - auditTrimString, - auditStringToNumber, - auditInteger, - auditTest( - (index) => index >= 0 && index < $testCases.length, - "Ce numéro ne correspond à aucun cas type", - ), - ), - auditFunction((testCasesIndex) => { - const deduplicatedTestCasesIndex = [] as number[] - for (const index of testCasesIndex) { - if (!deduplicatedTestCasesIndex.includes(index)) { - deduplicatedTestCasesIndex.push(index) - } - } - return deduplicatedTestCasesIndex - }), - auditFunction((testCasesIndex) => - testCasesIndex.length === 0 ? [0] : testCasesIndex, - ), - auditSetNullish([0]), + data, + "test_case", + true, + errors, + remainingKeys, + auditQueryArray( + auditTrimString, + auditStringToNumber, + auditInteger, + auditTest( + (index) => index >= 0 && index < $testCases.length, + "Ce numéro ne correspond à aucun cas type", + ), + ), + auditFunction((testCasesIndex) => { + const deduplicatedTestCasesIndex = [] as number[] + for (const index of testCasesIndex) { + if (!deduplicatedTestCasesIndex.includes(index)) { + deduplicatedTestCasesIndex.push(index) + } + } + return deduplicatedTestCasesIndex + }), + auditFunction((testCasesIndex) => + testCasesIndex.length === 0 ? [0] : testCasesIndex, + ), + auditSetNullish([0]), ) audit.attribute( - data, - "variable", - true, - errors, - remainingKeys, - auditQuerySingleton(auditTrimString), + data, + "variable", + true, + errors, + remainingKeys, + auditQuerySingleton(auditTrimString), ) audit.attribute( - data, - "waterfall", - true, - errors, - remainingKeys, - auditQuerySingleton( - auditTrimString, - auditOptions(waterfalls.map(({ name }) => name)), - auditSetNullish(waterfalls[0].name), - ), + data, + "waterfall", + true, + errors, + remainingKeys, + auditQuerySingleton( + auditTrimString, + auditOptions(waterfalls.map(({ name }) => name)), + auditSetNullish(waterfalls[0].name), + ), ) if ( - data.edit !== undefined && - errors.edit === undefined && - data.test_case !== undefined && - errors.test_case === undefined && - !(data.test_case as number[]).includes(data.edit as number) + data.edit !== undefined && + errors.edit === undefined && + data.test_case !== undefined && + errors.test_case === undefined && + !(data.test_case as number[]).includes(data.edit as number) ) { errors.edit === "Test case must be (one of) the currently selected one(s)" } if ( - data.parameter !== undefined && - errors.parameter === undefined && - data.parameters !== undefined && - errors.parameters === undefined + data.parameter !== undefined && + errors.parameter === undefined && + data.parameters !== undefined && + errors.parameters === undefined ) { errors.parameter = 'Value is exclusive to "parameters"' errors.parameters = 'Value is exclusive to "parameter"' @@ -411,10 +411,10 @@ } return audit.reduceRemaining( - data, - errors, - remainingKeys, - auditSetNullish({}), + data, + errors, + remainingKeys, + auditSetNullish({}), ) } @@ -434,8 +434,8 @@ // } function changeCompareSituation({ - detail, - }: { + detail, + }: { detail: { situationIndex: number situation: Situation @@ -446,23 +446,23 @@ } function changeDecompositionByName( - situationIndex: number, - newDecompositionByName: DecompositionByName, + situationIndex: number, + newDecompositionByName: DecompositionByName, ): void { $decompositionByName = newDecompositionByName } function changeInputInstantsByVariableName( - situationIndex: number, - inputInstantsByVariableName: { - [name: string]: Set<string> - }, + situationIndex: number, + inputInstantsByVariableName: { + [name: string]: Set<string> + }, ): void { const newInputInstantsByVariableNameArray = [ ...$inputInstantsByVariableNameArray, ] newInputInstantsByVariableNameArray[situationIndex] = - inputInstantsByVariableName + inputInstantsByVariableName $inputInstantsByVariableNameArray = newInputInstantsByVariableNameArray } @@ -474,47 +474,47 @@ function changeTestCasesIndex(testCasesIndex: number[]): void { goto( - newSimulationUrl({ - ...displayMode, - testCasesIndex, - }), - { noScroll: true }, + newSimulationUrl({ + ...displayMode, + testCasesIndex, + }), + { noScroll: true }, ) } function changeTestCaseToEditIndex(edit: number | undefined): void { goto( - newSimulationUrl({ - ...displayMode, - edit, - }), - { noScroll: true }, + newSimulationUrl({ + ...displayMode, + edit, + }), + { noScroll: true }, ) } function closeParametersEditionPane() { goto( - newSimulationUrl({ - ...displayMode, - parameterName: undefined, - parametersVariableName: undefined, - }), - { noScroll: true }, + newSimulationUrl({ + ...displayMode, + parameterName: undefined, + parametersVariableName: undefined, + }), + { noScroll: true }, ) } function ensureValidDisplayMode(query: URLSearchParams): void { let [validDisplayMode, queryError] = auditSimulationQuery( - cleanAudit, - query, + cleanAudit, + query, ) as [DisplayMode, unknown] if (queryError !== null) { console.warn( - `Query error at ${$page.url.pathname}: ${JSON.stringify( - queryError, - null, - 2, - )}\n\n${JSON.stringify(validDisplayMode, null, 2)}`, + `Query error at ${$page.url.pathname}: ${JSON.stringify( + queryError, + null, + 2, + )}\n\n${JSON.stringify(validDisplayMode, null, 2)}`, ) validDisplayMode = { testCasesIndex: [0], @@ -524,32 +524,32 @@ displayMode = validDisplayMode $testCasesIndex = displayMode.testCasesIndex $waterfall = waterfalls.find( - ({ name }) => name === displayMode.waterfallName, + ({ name }) => name === displayMode.waterfallName, ) if ( - displayMode.budget && - displayMode.parametersVariableName !== undefined && - budgetVariablesName.has(displayMode.parametersVariableName) + displayMode.budget && + displayMode.parametersVariableName !== undefined && + budgetVariablesName.has(displayMode.parametersVariableName) ) { // Only called once, when the page has been loaded from the server // with a budget=true query parameter $requestedCalculations = requestAllBudgetCalculations( - $requestedCalculations, - displayMode.parametersVariableName, + $requestedCalculations, + displayMode.parametersVariableName, ) } } export function* iterTestCasesVariablesName( - testCases: Situation[], + testCases: Situation[], ): Generator<string, void, unknown> { const variablesName = new Set<string>() for (const situation of testCases) { for (const entity of Object.values(entityByKey)) { const reservedKeys = getPopulationReservedKeys(entity) for (const population of Object.values( - situation[entity.key_plural] ?? {}, + situation[entity.key_plural] ?? {}, ) as PopulationWithoutId[]) { for (const variableName of Object.keys(population)) { if (reservedKeys.has(variableName)) { @@ -596,33 +596,33 @@ function reset(): void { $testCases = testCasesCore $decompositionByName = buildDecompositionByNameFromCore( - $billName === undefined - ? decompositionCoreByName - : decompositionCoreByNameByReformName[$billName] ?? - decompositionCoreByName, + $billName === undefined + ? decompositionCoreByName + : decompositionCoreByNameByReformName[$billName] ?? + decompositionCoreByName, ) as DecompositionByName $evaluationByNameArray = new Array($testCases.length).fill({}) $inputInstantsByVariableNameArray = - extractInputInstantsFromTestCases($testCases) + extractInputInstantsFromTestCases($testCases) $parametricReform = {} $valuesByCalculationNameByVariableNameArray = new Array( - $testCases.length, + $testCases.length, ).fill({}) if ( - displayMode.budget && - displayMode.parametersVariableName !== undefined && - budgetVariablesName.has(displayMode.parametersVariableName) + displayMode.budget && + displayMode.parametersVariableName !== undefined && + budgetVariablesName.has(displayMode.parametersVariableName) ) { $requestedCalculations = requestAllBudgetCalculations( - $requestedCalculations, - displayMode.parametersVariableName, + $requestedCalculations, + displayMode.parametersVariableName, ) } $requestedCalculations = requestAllTestCasesCalculations( - $requestedCalculations, - null, + $requestedCalculations, + null, ) // goto(newSimulationUrl(displayMode)) } @@ -633,15 +633,15 @@ body: JSON.stringify({ displayMode, inputInstantsByVariableNameArray: $inputInstantsByVariableNameArray.map( - (inputInstantsByVariableName) => - Object.fromEntries( - Object.entries(inputInstantsByVariableName).map( - ([variableName, inputInstants]) => [ - variableName, - [...inputInstants], - ], - ), - ), + (inputInstantsByVariableName) => + Object.fromEntries( + Object.entries(inputInstantsByVariableName).map( + ([variableName, inputInstants]) => [ + variableName, + [...inputInstants], + ], + ), + ), ), parametricReform: $parametricReform, testCases: $testCases, @@ -654,9 +654,9 @@ }) if (!res.ok) { console.error( - `Error ${ - res.status - } while creating a share link at ${urlString}\n\n${await res.text()}`, + `Error ${ + res.status + } while creating a share link at ${urlString}\n\n${await res.text()}`, ) return } @@ -666,7 +666,7 @@ }) } - let validateBtnHeight = 0; + let validateBtnHeight = 0 function onKeyDown(e) { switch (e.keyCode) { @@ -681,62 +681,66 @@ <title>Calculs | {data.title}</title> </svelte:head> -<main class="fond flex-1 flex h-full overflow-x-clip md:overflow-hidden"> - <div class="flex-[1_0_100%] flex flex-col overflow-x-clip md:overflow-hidden transition-transform ease-in-out-quart duration-500" - class:!translate-x-[-50%]={displayMode.edit !== undefined}> +<main class="fond flex h-full flex-1 overflow-x-clip md:overflow-hidden"> + <div + class="flex flex-[1_0_100%] flex-col overflow-x-clip transition-transform duration-500 ease-in-out-quart md:overflow-hidden" + class:!translate-x-[-50%]={displayMode.edit !== undefined} + > <div - class="sticky top-0 z-50 flex h-10 min-h-10 w-full justify-between shadow-md md:hidden" + class="min-h-10 sticky top-0 z-50 flex h-10 w-full justify-between shadow-md md:hidden" > <!--Onglets - MOBILE--> <a - class="flex w-1/2 items-center justify-center text-base uppercase tracking-wider" - class:font-bold={displayMode.mobileLaw} - class:text-white={displayMode.mobileLaw} - class:bg-le-jaune-dark={displayMode.mobileLaw} - class:shadow-inner={displayMode.mobileLaw} - class:bg-le-jaune-light={!displayMode.mobileLaw} - class:text-le-jaune-dark={!displayMode.mobileLaw} - href={newSimulationUrl({ - ...displayMode, - mobileLaw: true, - })} - data-sveltekit-noscroll + class="flex w-1/2 items-center justify-center text-base uppercase tracking-wider" + class:font-bold={displayMode.mobileLaw} + class:text-white={displayMode.mobileLaw} + class:bg-le-jaune-dark={displayMode.mobileLaw} + class:shadow-inner={displayMode.mobileLaw} + class:bg-le-jaune-light={!displayMode.mobileLaw} + class:text-le-jaune-dark={!displayMode.mobileLaw} + href={newSimulationUrl({ + ...displayMode, + mobileLaw: true, + })} + data-sveltekit-noscroll > <div - class:border-b-2={displayMode.mobileLaw} - class:border-white={displayMode.mobileLaw} + class:border-b-2={displayMode.mobileLaw} + class:border-white={displayMode.mobileLaw} > Loi </div> </a> <a - class="flex w-1/2 items-center justify-center text-base uppercase tracking-wider" - class:font-bold={!displayMode.mobileLaw} - class:text-white={!displayMode.mobileLaw} - class:bg-le-jaune-dark={!displayMode.mobileLaw} - class:shadow-inner-={!displayMode.mobileLaw} - class:bg-le-jaune-light={displayMode.mobileLaw} - class:text-le-jaune-very-dark={displayMode.mobileLaw} - href={newSimulationUrl({ - ...displayMode, - mobileLaw: undefined, - })} - data-sveltekit-noscroll + class="flex w-1/2 items-center justify-center text-base uppercase tracking-wider" + class:font-bold={!displayMode.mobileLaw} + class:text-white={!displayMode.mobileLaw} + class:bg-le-jaune-dark={!displayMode.mobileLaw} + class:shadow-inner-={!displayMode.mobileLaw} + class:bg-le-jaune-light={displayMode.mobileLaw} + class:text-le-jaune-very-dark={displayMode.mobileLaw} + href={newSimulationUrl({ + ...displayMode, + mobileLaw: undefined, + })} + data-sveltekit-noscroll > <div - class:border-b-2={!displayMode.mobileLaw} - class:border-white={!displayMode.mobileLaw} + class:border-b-2={!displayMode.mobileLaw} + class:border-white={!displayMode.mobileLaw} > Impacts </div> {#if Object.keys($parametricReform).length !== 0 && displayMode.mobileLaw} - <span class="flex h-3 w-3"> - <span - class="absolute inline-flex h-3 w-3 animate-ping rounded-full bg-le-jaune-dark bg-opacity-90" - /> - <span class="relative inline-flex h-3 w-3 rounded-full bg-le-jaune" /> - </span> + <span class="flex h-3 w-3"> + <span + class="absolute inline-flex h-3 w-3 animate-ping rounded-full bg-le-jaune-dark bg-opacity-90" + /> + <span + class="relative inline-flex h-3 w-3 rounded-full bg-le-jaune" + /> + </span> {/if} </a> </div> @@ -744,16 +748,16 @@ <div class="flex flex-1 overflow-x-hidden"> <!-- Panneau de gauche les zones éditables par l'utilisateur (amendement)--> <div - class="flex md:!h-full bg-white overflow-y-scroll md:overflow-visible md:z-10 flex-[1_0_100%] md:flex-[1_0_50%] md:translate-x-0 transition-transform ease-in-out-quart duration-500" - class:translate-x-[-100%]={!displayMode.mobileLaw} - class:!h-[calc(100vh-96px)]={!displayMode.mobileLaw} - id="situation_left_part_law" + class="flex flex-[1_0_100%] overflow-y-scroll bg-white transition-transform duration-500 ease-in-out-quart md:z-10 md:!h-full md:flex-[1_0_50%] md:translate-x-0 md:overflow-visible" + class:translate-x-[-100%]={!displayMode.mobileLaw} + class:!h-[calc(100vh-96px)]={!displayMode.mobileLaw} + id="situation_left_part_law" > - <div class="flex w-full min-h-full"> + <div class="flex min-h-full w-full"> <!--Partie I Paramètres de la loi--> - <div class="w-full flex flex-col bg-white md:w-2/3 overflow-y-scroll"> + <div class="flex w-full flex-col overflow-y-scroll bg-white md:w-2/3"> <h1 - class="mb-5 ml-5 hidden border-b border-black pb-3 text-3xl font-bold text-black md:flex md:pt-12 md:text-2xl lg:pt-11 lg:text-3xl" + class="mb-5 ml-5 hidden border-b border-black pb-3 text-3xl font-bold text-black md:flex md:pt-12 md:text-2xl lg:pt-11 lg:text-3xl" > Modifier le droit en vigueur </h1> @@ -762,85 +766,85 @@ <!-- Bouton de fermeture du dispositif en cours - DESKTOP --> <div class="mx-5 mb-2 hidden justify-end md:flex"> <button - class="text-sm uppercase text-gray-600 hover:text-black" - on:click={closeParametersEditionPane} - >Changer de dispositif<iconify-icon - class="ml-1 align-[-0.2rem] text-lg" - icon="ri-arrow-up-line" - /></button + class="text-sm uppercase text-gray-600 hover:text-black" + on:click={closeParametersEditionPane} + >Changer de dispositif<iconify-icon + class="ml-1 align-[-0.2rem] text-lg" + icon="ri-arrow-up-line" + /></button > </div> <div class="md:[calc(100vh-13rem)] overflow-y-auto"> <!-- Bouton de fermeture du dispositif en cours - MOBILE --> <div class="mx-5 mb-2 flex justify-end md:hidden"> <button - class="text-sm uppercase text-gray-600 hover:text-black" - on:click={closeParametersEditionPane} - >Changer de dispositif<iconify-icon - class="ml-1 align-[-0.2rem] text-lg" - icon="ri-arrow-up-line" - /></button + class="text-sm uppercase text-gray-600 hover:text-black" + on:click={closeParametersEditionPane} + >Changer de dispositif<iconify-icon + class="ml-1 align-[-0.2rem] text-lg" + icon="ri-arrow-up-line" + /></button > </div> <h1 - class="mb-5 ml-5 flex border-b border-black pt-1 pb-3 text-xl font-bold text-black md:hidden" + class="mb-5 ml-5 flex border-b border-black pb-3 pt-1 text-xl font-bold text-black md:hidden" > Modifier le droit en vigueur </h1> <div class="ml-5 bg-white"> <NonVariableReferredParameter - budget={displayMode.budget} - date={$date} - name={displayMode.parameterName} + budget={displayMode.budget} + date={$date} + name={displayMode.parameterName} /> </div> </div> {:else if displayMode.parametersVariableName !== undefined} <div class="mx-5 mb-2 hidden justify-end md:flex"> <button - class="text-sm uppercase text-gray-600 hover:text-black" - on:click={closeParametersEditionPane} - >Changer de dispositif<iconify-icon - class="ml-1 align-[-0.23rem] text-lg" - icon="ri-arrow-up-line" - /> + class="text-sm uppercase text-gray-600 hover:text-black" + on:click={closeParametersEditionPane} + >Changer de dispositif<iconify-icon + class="ml-1 align-[-0.23rem] text-lg" + icon="ri-arrow-up-line" + /> </button> </div> {#if displayMode.parametersVariableName === "csg_deductible_salaire"} <div class="mx-5 mb-2 hidden justify-end md:flex"> <a - class="text-sm uppercase text-gray-600 hover:text-black" - href={newSimulationUrl({ - ...displayMode, - parametersVariableName: "csg_imposable_salaire", - })} + class="text-sm uppercase text-gray-600 hover:text-black" + href={newSimulationUrl({ + ...displayMode, + parametersVariableName: "csg_imposable_salaire", + })} > CSG - part imposable<iconify-icon - class="ml-1 align-[-0.23rem] text-lg" - icon="ri-arrow-right-line" - /> + class="ml-1 align-[-0.23rem] text-lg" + icon="ri-arrow-right-line" + /> </a> </div> {:else if displayMode.parametersVariableName === "csg_imposable_salaire"} <div class="mx-5 mb-2 hidden justify-end md:flex"> <a - class="flex items-center text-sm uppercase text-gray-600 hover:text-black" - href={newSimulationUrl({ - ...displayMode, - parametersVariableName: "csg_deductible_salaire", - })} + class="flex items-center text-sm uppercase text-gray-600 hover:text-black" + href={newSimulationUrl({ + ...displayMode, + parametersVariableName: "csg_deductible_salaire", + })} > CSG - part déductible<iconify-icon - class="ml-1 align-[-0.2rem] text-lg" - icon="ri-arrow-right-line" - /> + class="ml-1 align-[-0.2rem] text-lg" + icon="ri-arrow-right-line" + /> </a> </div> {/if} <div class="flex-1 overflow-y-auto"> <h1 - class="ml-3 flex border-b border-black pt-3 pb-3 text-2xl font-bold text-black md:hidden" + class="ml-3 flex border-b border-black pb-3 pt-3 text-2xl font-bold text-black md:hidden" > Modifier le droit en vigueur </h1> @@ -848,37 +852,37 @@ <div class="flex flex-col md:hidden"> {#if billName !== undefined} <div - class="mx-3 mb-3 flex flex-col rounded-b border bg-gray-200 px-2 py-1 shadow-md " + class="mx-3 mb-3 flex flex-col rounded-b border bg-gray-200 px-2 py-1 shadow-md" > <button - class="place-self-start text-lg font-light" - on:click={() => { - modificationsOpen = !modificationsOpen - }} + class="place-self-start text-lg font-light" + on:click={() => { + modificationsOpen = !modificationsOpen + }} > {#if !modificationsOpen} <iconify-icon - class="mr-1 align-[-0.2rem] text-lg" - icon="ri:arrow-down-s-line" + class="mr-1 align-[-0.2rem] text-lg" + icon="ri:arrow-down-s-line" /> {:else} <iconify-icon - class="mr-1 align-[-0.2rem] text-lg" - icon="ri:arrow-up-s-line" + class="mr-1 align-[-0.2rem] text-lg" + icon="ri:arrow-up-s-line" /> {/if} Modifications en cours {#if Object.keys($parametricReform).length !== 0 && displayMode.mobileLaw} <iconify-icon - class="align-[0.1rem] text-sm text-le-jaune" - icon="ri-checkbox-blank-circle-fill" + class="align-[0.1rem] text-sm text-le-jaune" + icon="ri-checkbox-blank-circle-fill" /> {/if} {#if $billName !== undefined && Object.keys($billName).length !== 0 && displayMode.mobileLaw} <iconify-icon - class="align-[0.1rem] text-sm text-le-rouge-bill" - icon="ri-checkbox-blank-circle-fill" + class="align-[0.1rem] text-sm text-le-rouge-bill" + icon="ri-checkbox-blank-circle-fill" /> {/if} </button> @@ -886,13 +890,13 @@ {#if modificationsOpen} <ReformsChanges {displayMode} /> <button - class="place-self-end text-sm uppercase text-gray-600 hover:text-black" - on:click={reset} - title="Retirer les modifications de votre réforme" + class="place-self-end text-sm uppercase text-gray-600 hover:text-black" + on:click={reset} + title="Retirer les modifications de votre réforme" > <iconify-icon - class="mr-1 align-[-0.2rem] text-lg" - icon="ri:refresh-line" + class="mr-1 align-[-0.2rem] text-lg" + icon="ri:refresh-line" /> Réinitialiser </button> @@ -901,96 +905,96 @@ {/if} <button - class="mx-3 mb-2 mt-5 place-self-end text-sm uppercase text-gray-600 hover:text-black " - on:click={closeParametersEditionPane} - >Changer de dispositif<iconify-icon - class="ml-1 align-[-0.2rem] text-lg" - icon="ri-arrow-up-line" - /></button + class="mx-3 mb-2 mt-5 place-self-end text-sm uppercase text-gray-600 hover:text-black" + on:click={closeParametersEditionPane} + >Changer de dispositif<iconify-icon + class="ml-1 align-[-0.2rem] text-lg" + icon="ri-arrow-up-line" + /></button > </div> {#if displayMode.parametersVariableName === "csg_deductible_salaire"} <div class="mx-3 mb-2 flex justify-end md:hidden"> <a - class="text-sm uppercase text-gray-600 hover:text-black" - href={newSimulationUrl({ - ...displayMode, - parametersVariableName: "csg_imposable_salaire", - })} + class="text-sm uppercase text-gray-600 hover:text-black" + href={newSimulationUrl({ + ...displayMode, + parametersVariableName: "csg_imposable_salaire", + })} > CSG - part imposable<iconify-icon - class="ml-1 align-[-0.23rem] text-lg" - icon="ri-arrow-right-line" - /> + class="ml-1 align-[-0.23rem] text-lg" + icon="ri-arrow-right-line" + /> </a> </div> {:else if displayMode.parametersVariableName === "csg_imposable_salaire"} <div class="mx-3 mb-2 flex justify-end md:hidden"> <a - class="text-sm uppercase text-gray-600 hover:text-black" - href={newSimulationUrl({ - ...displayMode, - parametersVariableName: "csg_deductible_salaire", - })} + class="text-sm uppercase text-gray-600 hover:text-black" + href={newSimulationUrl({ + ...displayMode, + parametersVariableName: "csg_deductible_salaire", + })} > CSG - part déductible<iconify-icon - class="ml-1 align-[-0.23rem] text-lg" - icon="ri-arrow-right-line" - /> + class="ml-1 align-[-0.23rem] text-lg" + icon="ri-arrow-right-line" + /> </a> </div> {/if} - <div class="ml-5 bg-white "> + <div class="ml-5 bg-white"> <VariableReferredParameters - date={$date} - {displayMode} - name={displayMode.parametersVariableName} + date={$date} + {displayMode} + name={displayMode.parametersVariableName} /> </div> </div> {:else} <div class="flex-1"> <h1 - class="ml-3 flex border-b border-black pt-3 pb-3 text-2xl font-bold text-black md:hidden" + class="ml-3 flex border-b border-black pb-3 pt-3 text-2xl font-bold text-black md:hidden" > Modifier le droit en vigueur </h1> <!--Partie II modification de la loi - MOBILE - vue choisir un dispositif --> {#if billName !== undefined} <div - class="mx-3 mb-3 flex flex-col rounded-b border bg-gray-200 px-2 py-1 shadow-md md:hidden" + class="mx-3 mb-3 flex flex-col rounded-b border bg-gray-200 px-2 py-1 shadow-md md:hidden" > <button - class="place-self-start text-lg font-light" - on:click={() => { - modificationsOpen = !modificationsOpen - }} + class="place-self-start text-lg font-light" + on:click={() => { + modificationsOpen = !modificationsOpen + }} > {#if !modificationsOpen} <iconify-icon - class="mr-1 align-[-0.2rem] text-lg" - icon="ri:arrow-down-s-line" + class="mr-1 align-[-0.2rem] text-lg" + icon="ri:arrow-down-s-line" /> {:else} <iconify-icon - class="mr-1 align-[-0.2rem] text-lg" - icon="ri:arrow-up-s-line" + class="mr-1 align-[-0.2rem] text-lg" + icon="ri:arrow-up-s-line" /> {/if} Modifications en cours {#if Object.keys($parametricReform).length !== 0 && displayMode.mobileLaw} <iconify-icon - class="align-[0.1rem] text-sm text-le-jaune" - icon="ri-checkbox-blank-circle-fill" + class="align-[0.1rem] text-sm text-le-jaune" + icon="ri-checkbox-blank-circle-fill" /> {/if} {#if $billName !== undefined && Object.keys($billName).length !== 0 && displayMode.mobileLaw} <iconify-icon - class="align-[0.1rem] text-sm text-le-rouge-bill" - icon="ri-checkbox-blank-circle-fill" + class="align-[0.1rem] text-sm text-le-rouge-bill" + icon="ri-checkbox-blank-circle-fill" /> {/if} </button> @@ -1000,13 +1004,13 @@ <ReformsChanges {displayMode} /> </div> <button - class="place-self-end text-sm uppercase text-gray-600 hover:text-black" - on:click={reset} - title="Retirer les modifications de votre réforme" + class="place-self-end text-sm uppercase text-gray-600 hover:text-black" + on:click={reset} + title="Retirer les modifications de votre réforme" > <iconify-icon - class="mr-1 align-[-0.2rem] text-lg" - icon="ri:refresh-line" + class="mr-1 align-[-0.2rem] text-lg" + icon="ri:refresh-line" /> Réinitialiser </button> @@ -1015,9 +1019,9 @@ {/if} <div class="mx-3 md:mx-5"> <Search - {displayMode} - searchMode={SearchMode.variables} - showOnlyWaterfallVariables={true} + {displayMode} + searchMode={SearchMode.variables} + showOnlyWaterfallVariables={true} /> </div> </div> @@ -1027,26 +1031,26 @@ <!--Partie II modification de la loi - DESKTOP--> <div class="hidden w-1/3 flex-col bg-gray-200 shadow-lg md:flex"> <button - class="ml-4 h-10 place-self-start text-sm uppercase text-gray-600 hover:text-black" - on:click={reset} - title="Retirer les modifications de votre réforme" + class="ml-4 h-10 place-self-start text-sm uppercase text-gray-600 hover:text-black" + on:click={reset} + title="Retirer les modifications de votre réforme" > <iconify-icon - class="mr-1 align-[-0.2rem] text-lg" - icon="ri:refresh-line" + class="mr-1 align-[-0.2rem] text-lg" + icon="ri:refresh-line" /> Réinitialiser </button> <h3 - class="mt-3 mr-2 border-b border-black pb-3 text-xl font-light text-black lg:mt-2 lg:text-2xl" + class="mr-2 mt-3 border-b border-black pb-3 text-xl font-light text-black lg:mt-2 lg:text-2xl" > <span class="ml-2 lg:ml-4"> Modifications </span> </h3> <div - class="h-[calc(100vh-10rem)] overflow-y-auto" - id="situation_color_code" + class="h-[calc(100vh-10rem)] overflow-y-auto" + id="situation_color_code" > <ReformsChanges {displayMode} /> </div> @@ -1061,14 +1065,14 @@ the height of the div enclosing the test cases below. --> <div - class="h-fit md:!h-full md:block overflow-y-scroll flex-[1_0_100%] md:flex-[1_0_50%] md:translate-x-0 transition-transform ease-in-out-quart duration-500" - class:translate-x-[-100%]={!displayMode.mobileLaw} - class:!h-[calc(100vh-96px)]={displayMode.mobileLaw} - id="situation_right_part_impacts" + class="h-fit flex-[1_0_100%] overflow-y-scroll transition-transform duration-500 ease-in-out-quart md:block md:!h-full md:flex-[1_0_50%] md:translate-x-0" + class:translate-x-[-100%]={!displayMode.mobileLaw} + class:!h-[calc(100vh-96px)]={displayMode.mobileLaw} + id="situation_right_part_impacts" > <!--en-tête--> <div - class="sticky top-0 z-25 mb-4 flex flex-col border-b bg-yellow-50 md:pl-3 md:pr-6 lg:pl-5 lg:pr-8" + class="sticky top-0 z-25 mb-4 flex flex-col border-b bg-yellow-50 md:pl-3 md:pr-6 lg:pl-5 lg:pr-8" > <!-- <select @@ -1086,14 +1090,14 @@ <!--Bouton sauvegarder partager--> <button - class="h-9 place-self-end px-4 pt-1 text-sm uppercase text-gray-500 hover:text-black md:px-0" - on:click={shareLink} - id="situation_savebutton" - title="Sauvegarder/partager votre écran de travail tel qu'il est visible actuellement" + class="h-9 place-self-end px-4 pt-1 text-sm uppercase text-gray-500 hover:text-black md:px-0" + on:click={shareLink} + id="situation_savebutton" + title="Sauvegarder/partager votre écran de travail tel qu'il est visible actuellement" > <iconify-icon - class="mr-1 align-[-0.2rem] text-base" - icon="ri-share-fill" + class="mr-1 align-[-0.2rem] text-base" + icon="ri-share-fill" /> Sauvegarder / partager </button> @@ -1103,130 +1107,130 @@ {#if displayMode.parametersVariableName !== undefined && budgetVariablesName.has(displayMode.parametersVariableName)} <div class="flex items-center justify-center md:justify-start"> <a - data-sveltekit-noscroll - href={newSimulationUrl({ - ...displayMode, - budget: undefined, - })} + data-sveltekit-noscroll + href={newSimulationUrl({ + ...displayMode, + budget: undefined, + })} > <div - class="flex h-14 items-center px-3 pb-1 text-2xl text-black sm:text-3xl md:px-1 md:text-xl lg:px-2 lg:text-2xl xl:px-3 xl:text-3xl" - class:border-b-4={!displayMode.budget} - class:border-black={!displayMode.budget} + class="flex h-14 items-center px-3 pb-1 text-2xl text-black sm:text-3xl md:px-1 md:text-xl lg:px-2 lg:text-2xl xl:px-3 xl:text-3xl" + class:border-b-4={!displayMode.budget} + class:border-black={!displayMode.budget} > - <span - class="hidden tracking-wide sm:flex" - class:text-black={!displayMode.budget} - class:font-bold={!displayMode.budget} - class:hover:text-le-bleu={displayMode.budget} - > - Impact cas type - </span> <span - class="flex tracking-wide sm:hidden" - class:text-black={!displayMode.budget} - class:font-bold={!displayMode.budget} - class:hover:text-le-bleu={displayMode.budget} + class="hidden tracking-wide sm:flex" + class:text-black={!displayMode.budget} + class:font-bold={!displayMode.budget} + class:hover:text-le-bleu={displayMode.budget} > - Cas type - </span> + Impact cas type + </span> + <span + class="flex tracking-wide sm:hidden" + class:text-black={!displayMode.budget} + class:font-bold={!displayMode.budget} + class:hover:text-le-bleu={displayMode.budget} + > + Cas type + </span> </div> </a> <a - data-sveltekit-noscroll - href={newSimulationUrl({ - ...displayMode, - budget: true, - })} + data-sveltekit-noscroll + href={newSimulationUrl({ + ...displayMode, + budget: true, + })} > <div - class="flex h-14 items-center px-3 text-2xl text-black sm:text-3xl md:px-1 md:text-xl lg:px-2 lg:text-2xl xl:px-3 xl:text-3xl" - class:border-b-4={displayMode.budget} - class:border-black={displayMode.budget} - > - <span - class="hidden tracking-wide sm:flex" - class:text-black={displayMode.budget} - class:font-bold={displayMode.budget} - class:hover:text-le-bleu={!displayMode.budget} - class:pb-2={!displayMode.budget} + class="flex h-14 items-center px-3 text-2xl text-black sm:text-3xl md:px-1 md:text-xl lg:px-2 lg:text-2xl xl:px-3 xl:text-3xl" + class:border-b-4={displayMode.budget} + class:border-black={displayMode.budget} > - Impact budgétaire - </span> <span - class="flex tracking-wide sm:hidden" - class:text-black={displayMode.budget} - class:font-bold={displayMode.budget} - class:hover:text-le-bleu={!displayMode.budget} - class:pb-2={!displayMode.budget} + class="hidden tracking-wide sm:flex" + class:text-black={displayMode.budget} + class:font-bold={displayMode.budget} + class:hover:text-le-bleu={!displayMode.budget} + class:pb-2={!displayMode.budget} > - Budget - </span> + Impact budgétaire + </span> + <span + class="flex tracking-wide sm:hidden" + class:text-black={displayMode.budget} + class:font-bold={displayMode.budget} + class:hover:text-le-bleu={!displayMode.budget} + class:pb-2={!displayMode.budget} + > + Budget + </span> </div> </a> </div> {:else if displayMode.parametersVariableName === undefined} <div class="flex items-center justify-center md:justify-start"> <a - data-sveltekit-noscroll - href={newSimulationUrl({ - ...displayMode, - budget: undefined, - })} + data-sveltekit-noscroll + href={newSimulationUrl({ + ...displayMode, + budget: undefined, + })} > <div - class="flex h-14 items-center px-3 pb-1 text-2xl text-black sm:text-3xl md:px-1 md:text-xl lg:px-2 lg:text-2xl xl:px-3 xl:text-3xl" - class:border-b-4={!displayMode.budget} - class:border-black={!displayMode.budget} - > - <span - class="hidden tracking-wide sm:flex" - class:text-black={!displayMode.budget} - class:font-bold={!displayMode.budget} - class:hover:text-le-bleu={displayMode.budget} + class="flex h-14 items-center px-3 pb-1 text-2xl text-black sm:text-3xl md:px-1 md:text-xl lg:px-2 lg:text-2xl xl:px-3 xl:text-3xl" + class:border-b-4={!displayMode.budget} + class:border-black={!displayMode.budget} > - Impact cas type - </span> <span - class="flex tracking-wide sm:hidden" - class:text-black={!displayMode.budget} - class:font-bold={!displayMode.budget} - class:hover:text-le-bleu={displayMode.budget} + class="hidden tracking-wide sm:flex" + class:text-black={!displayMode.budget} + class:font-bold={!displayMode.budget} + class:hover:text-le-bleu={displayMode.budget} + > + Impact cas type + </span> + <span + class="flex tracking-wide sm:hidden" + class:text-black={!displayMode.budget} + class:font-bold={!displayMode.budget} + class:hover:text-le-bleu={displayMode.budget} > - Cas type - </span> + Cas type + </span> </div> </a> <a - data-sveltekit-noscroll - href={newSimulationUrl({ - ...displayMode, - budget: true, - })} + data-sveltekit-noscroll + href={newSimulationUrl({ + ...displayMode, + budget: true, + })} > <div - class="flex h-14 items-center px-3 text-2xl text-black sm:text-3xl md:px-1 md:text-xl lg:px-2 lg:text-2xl xl:px-3 xl:text-3xl" - class:border-b-4={displayMode.budget} - class:border-black={displayMode.budget} - > - <span - class="hidden tracking-wide sm:flex" - class:text-black={displayMode.budget} - class:font-bold={displayMode.budget} - class:hover:text-le-bleu={!displayMode.budget} - class:pb-2={!displayMode.budget} + class="flex h-14 items-center px-3 text-2xl text-black sm:text-3xl md:px-1 md:text-xl lg:px-2 lg:text-2xl xl:px-3 xl:text-3xl" + class:border-b-4={displayMode.budget} + class:border-black={displayMode.budget} > - Impact budgétaire - </span> <span - class="flex tracking-wide sm:hidden" - class:text-black={displayMode.budget} - class:font-bold={displayMode.budget} - class:hover:text-le-bleu={!displayMode.budget} - class:pb-2={!displayMode.budget} + class="hidden tracking-wide sm:flex" + class:text-black={displayMode.budget} + class:font-bold={displayMode.budget} + class:hover:text-le-bleu={!displayMode.budget} + class:pb-2={!displayMode.budget} + > + Impact budgétaire + </span> + <span + class="flex tracking-wide sm:hidden" + class:text-black={displayMode.budget} + class:font-bold={displayMode.budget} + class:hover:text-le-bleu={!displayMode.budget} + class:pb-2={!displayMode.budget} > - Budget - </span> + Budget + </span> </div> </a> </div> @@ -1234,43 +1238,43 @@ <div> <h2 class="flex"> <div - class="flex h-14 items-center border-b-4 border-black px-3 text-2xl text-black sm:text-3xl md:px-1 md:text-xl lg:px-2 lg:text-2xl xl:px-3 xl:text-3xl" + class="flex h-14 items-center border-b-4 border-black px-3 text-2xl text-black sm:text-3xl md:px-1 md:text-xl lg:px-2 lg:text-2xl xl:px-3 xl:text-3xl" > - <span class="pb-2 font-bold tracking-wide text-black"> - Impact cas type - </span> + <span class="pb-2 font-bold tracking-wide text-black"> + Impact cas type + </span> </div> <div - id="onglet-impact-budgetaire" - class="flex h-14 items-center px-3 text-2xl text-black sm:text-3xl md:px-1 md:text-xl lg:px-2 lg:text-2xl xl:px-3 xl:text-3xl" + id="onglet-impact-budgetaire" + class="flex h-14 items-center px-3 text-2xl text-black sm:text-3xl md:px-1 md:text-xl lg:px-2 lg:text-2xl xl:px-3 xl:text-3xl" > - <span class="pb-2 tracking-wide text-gray-300"> - Impact budgétaire - </span> + <span class="pb-2 tracking-wide text-gray-300"> + Impact budgétaire + </span> </div> {#if displayMode.parametersVariableName !== undefined} {@const variable = - variableSummaryByName[displayMode.parametersVariableName]} + variableSummaryByName[displayMode.parametersVariableName]} <Popover - class="m-10 w-80 text-sm font-light shadow-2xl" - placement="bottom" - title="Impact budgétaire indisponible" - triggeredBy="#onglet-impact-budgetaire" + class="m-10 w-80 text-sm font-light shadow-2xl" + placement="bottom" + title="Impact budgétaire indisponible" + triggeredBy="#onglet-impact-budgetaire" > - <span class="text-black"> - Le calcul des impacts budgétaires du dispositif « {variable.short_label ?? - variable.label ?? - variable.name} » n'est pas encore disponible. - <span class="font-normal" - >Ce sujet vous intéresse ? Écrivez-nous à - <a - class="link" - href="mailto:leximpact@assemblee-nationale.fr" - >leximpact@assemblee-nationale.fr</a - ></span - > - </span> + <span class="text-black"> + Le calcul des impacts budgétaires du dispositif « {variable.short_label ?? + variable.label ?? + variable.name} » n'est pas encore disponible. + <span class="font-normal" + >Ce sujet vous intéresse ? Écrivez-nous à + <a + class="link" + href="mailto:leximpact@assemblee-nationale.fr" + >leximpact@assemblee-nationale.fr</a + ></span + > + </span> </Popover> {/if} </h2> @@ -1278,27 +1282,27 @@ {/if} </div> <!--Impacts--> - <div class="px-0 md:px-6 lg:px-8 md:mb-4"> + <div class="px-0 md:mb-4 md:px-6 lg:px-8"> {#if displayMode.budget && displayMode.parametersVariableName !== undefined && budgetVariablesName.has(displayMode.parametersVariableName)} {#if user === undefined} - <div class="my-10 mx-5 flex flex-col justify-center md:mx-10"> - <h3 class="text-center text-xl text-black "> + <div class="mx-5 my-10 flex flex-col justify-center md:mx-10"> + <h3 class="text-center text-xl text-black"> Vous êtes parlementaire* ? <br /><span class="font-bold" - >Identifiez-vous pour accéder aux impacts budgétaires :</span - > + >Identifiez-vous pour accéder aux impacts budgétaires :</span + > </h3> - <div class="mt-5 mb-10 grow-0 place-self-center"> + <div class="mb-10 mt-5 grow-0 place-self-center"> <a - class="rounded-lg bg-le-bleu py-2 px-4 text-center text-lg uppercase text-white drop-shadow-md hover:bg-blue-900" - data-sveltekit-reload - href={`/auth/login?redirect=${encodeURIComponent( - $page.url.toString(), - )}`} - title="Vers le simulateur budgétaire de l'impôt sur le revenu" + class="rounded-lg bg-le-bleu px-4 py-2 text-center text-lg uppercase text-white drop-shadow-md hover:bg-blue-900" + data-sveltekit-reload + href={`/auth/login?redirect=${encodeURIComponent( + $page.url.toString(), + )}`} + title="Vers le simulateur budgétaire de l'impôt sur le revenu" > <iconify-icon - class="mr-1 align-[-0.4rem] text-2xl" - icon="ri-key-fill" + class="mr-1 align-[-0.4rem] text-2xl" + icon="ri-key-fill" /> Se connecter </a> @@ -1306,15 +1310,15 @@ <p class="text-sm text-black"> *Les simulations budgétaires LexImpact s’appuient sur des - données représentatives de la population française et protégées. - Seules les personnes habilitées peuvent avoir accès à cette - partie du simulateur. Pour plus d’informations, veuillez - consulter <a - class="link" - href="https://leximpact.an.fr/cgu" - title="Conditions générales d'utilisation de la partie en accès restreint du simulateur" - >nos conditions générales d’utilisation</a - >. + données représentatives de la population française et + protégées. Seules les personnes habilitées peuvent avoir accès + à cette partie du simulateur. Pour plus d’informations, + veuillez consulter <a + class="link" + href="https://leximpact.an.fr/cgu" + title="Conditions générales d'utilisation de la partie en accès restreint du simulateur" + >nos conditions générales d’utilisation</a + >. </p> </div> {/if} @@ -1330,17 +1334,17 @@ {/if} {:else if displayMode.parametersVariableName === "irpp_economique"} <a - class="mr-4 place-self-end text-sm uppercase text-gray-600 hover:text-black md:mr-0" - data-sveltekit-noscroll - href={newSimulationUrl({ - ...displayMode, - budget: true, - parametersVariableName: undefined, - })} - >Changer de dispositif<iconify-icon - class="ml-1 align-[-0.2rem] text-lg" - icon="ri-arrow-up-line" - /></a + class="mr-4 place-self-end text-sm uppercase text-gray-600 hover:text-black md:mr-0" + data-sveltekit-noscroll + href={newSimulationUrl({ + ...displayMode, + budget: true, + parametersVariableName: undefined, + })} + >Changer de dispositif<iconify-icon + class="ml-1 align-[-0.2rem] text-lg" + icon="ri-arrow-up-line" + /></a > <h3 class="mx-4 mb-2 text-2xl font-bold md:mx-0"> Impôt sur le revenu @@ -1349,23 +1353,23 @@ <IrGagnantsPerdantsView budgetSimulation={$budgetSimulation} /> {:else if displayMode.parametersVariableName === "csg_deductible_salaire" || displayMode.parametersVariableName === "csg_imposable_salaire"} <a - class="mr-4 place-self-end text-sm uppercase text-gray-600 hover:text-black md:mr-0" - data-sveltekit-noscroll - href={newSimulationUrl({ - ...displayMode, - budget: true, - parametersVariableName: undefined, - })} - >Changer de dispositif<iconify-icon - class="ml-1 align-[-0.2rem] text-lg" - icon="ri-arrow-up-line" - /></a + class="mr-4 place-self-end text-sm uppercase text-gray-600 hover:text-black md:mr-0" + data-sveltekit-noscroll + href={newSimulationUrl({ + ...displayMode, + budget: true, + parametersVariableName: undefined, + })} + >Changer de dispositif<iconify-icon + class="ml-1 align-[-0.2rem] text-lg" + icon="ri-arrow-up-line" + /></a > <h3 class="mx-4 mb-2 text-2xl font-bold md:mx-0"> CSG des revenus d'activité <br /><span class="text-xl font-normal" - >Imposable et déductible</span - > + >Imposable et déductible</span + > </h3> <CsgBudgetView budgetSimulation={$budgetSimulation} /> <CsgGagnantsPerdantsView budgetSimulation={$budgetSimulation} /> @@ -1383,33 +1387,33 @@ <div class="my-3 flex flex-col justify-center gap-4"> <div> <a - class="rounded-full bg-le-gris-dispositif-light px-3 py-1.5 hover:bg-le-gris-dispositif hover:bg-opacity-60" - href={newSimulationUrl({ - ...displayMode, - parametersVariableName: "irpp_economique", - })} + class="rounded-full bg-le-gris-dispositif-light px-3 py-1.5 hover:bg-le-gris-dispositif hover:bg-opacity-60" + href={newSimulationUrl({ + ...displayMode, + parametersVariableName: "irpp_economique", + })} > Impôt sur le revenu </a> </div> <div> <a - class="rounded-full bg-le-gris-dispositif-light px-3 py-1.5 hover:bg-le-gris-dispositif hover:bg-opacity-60" - href={newSimulationUrl({ - ...displayMode, - parametersVariableName: "csg_deductible_salaire", - })} + class="rounded-full bg-le-gris-dispositif-light px-3 py-1.5 hover:bg-le-gris-dispositif hover:bg-opacity-60" + href={newSimulationUrl({ + ...displayMode, + parametersVariableName: "csg_deductible_salaire", + })} > CSG des revenus d'activité (déductible) </a> </div> <div> <a - class="rounded-full bg-le-gris-dispositif-light px-3 py-1.5 hover:bg-le-gris-dispositif hover:bg-opacity-60" - href={newSimulationUrl({ - ...displayMode, - parametersVariableName: "csg_imposable_salaire", - })} + class="rounded-full bg-le-gris-dispositif-light px-3 py-1.5 hover:bg-le-gris-dispositif hover:bg-opacity-60" + href={newSimulationUrl({ + ...displayMode, + parametersVariableName: "csg_imposable_salaire", + })} > CSG des revenus d'activité (imposable) </a> @@ -1420,13 +1424,13 @@ {:else} {#if $testCasesIndex.length === 1} <button - class="mx-4 mb-3 flex h-8 grow-0 items-center rounded-md bg-gray-300 px-2 py-1 text-sm uppercase text-black shadow-md hover:bg-le-bleu hover:text-white focus:outline-none md:mx-0" - on:click={() => (isTestCaseSelectModalOpen = true)} - title="Choisir un cas type" - ><iconify-icon - class="mr-1 align-[-0.2rem] text-lg" - icon="ri-user-search-fill" - />Autres cas types</button + class="mx-4 mb-3 flex h-8 grow-0 items-center rounded-md bg-gray-300 px-2 py-1 text-sm uppercase text-black shadow-md hover:bg-le-bleu hover:text-white focus:outline-none md:mx-0" + on:click={() => (isTestCaseSelectModalOpen = true)} + title="Choisir un cas type" + ><iconify-icon + class="mr-1 align-[-0.2rem] text-lg" + icon="ri-user-search-fill" + />Autres cas types</button > {/if} @@ -1439,44 +1443,44 @@ </div> {/if} <TestCaseSelectModal - {displayMode} - bind:isOpen={isTestCaseSelectModalOpen} - on:changeTestCasesIndex - year={$year} + {displayMode} + bind:isOpen={isTestCaseSelectModalOpen} + on:changeTestCasesIndex + year={$year} /> <!-- Cas types avec leur waterfall --> {#if $testCasesIndex.length === 1} <TestCaseView - decompositionByName={$decompositionByName} - {displayMode} - on:changeDecompositionByName={({ detail }) => - changeDecompositionByName($testCasesIndex[0], detail)} - on:changeSituation={({ detail }) => - changeSituation($testCasesIndex[0], detail)} - on:changeTestCasesIndex={({ detail }) => - changeTestCasesIndex(detail)} - on:changeTestCaseToEditIndex={({ detail }) => - changeTestCaseToEditIndex(detail)} - situation={$testCases[$testCasesIndex[0]]} - situationIndex={$testCasesIndex[0]} - valuesByCalculationNameByVariableName={$valuesByCalculationNameByVariableNameArray[ - $testCasesIndex[0] - ]} - year={$year} + decompositionByName={$decompositionByName} + {displayMode} + on:changeDecompositionByName={({ detail }) => + changeDecompositionByName($testCasesIndex[0], detail)} + on:changeSituation={({ detail }) => + changeSituation($testCasesIndex[0], detail)} + on:changeTestCasesIndex={({ detail }) => + changeTestCasesIndex(detail)} + on:changeTestCaseToEditIndex={({ detail }) => + changeTestCaseToEditIndex(detail)} + situation={$testCases[$testCasesIndex[0]]} + situationIndex={$testCasesIndex[0]} + valuesByCalculationNameByVariableName={$valuesByCalculationNameByVariableNameArray[ + $testCasesIndex[0] + ]} + year={$year} /> {:else} <TestCaseCompareView - decompositionByName={$decompositionByName} - {displayMode} - on:changeDecompositionByName={({ detail }) => - changeDecompositionByName($testCasesIndex[0], detail)} - on:changeSituation={changeCompareSituation} - on:changeTestCasesIndex={({ detail }) => - changeTestCasesIndex(detail)} - on:changeTestCaseToEditIndex={({ detail }) => - changeTestCaseToEditIndex(detail)} - situationsToCompareIndex={$testCasesIndex} - year={$year} + decompositionByName={$decompositionByName} + {displayMode} + on:changeDecompositionByName={({ detail }) => + changeDecompositionByName($testCasesIndex[0], detail)} + on:changeSituation={changeCompareSituation} + on:changeTestCasesIndex={({ detail }) => + changeTestCasesIndex(detail)} + on:changeTestCaseToEditIndex={({ detail }) => + changeTestCaseToEditIndex(detail)} + situationsToCompareIndex={$testCasesIndex} + year={$year} /> {/if} {/if} @@ -1486,44 +1490,44 @@ </div> <!-- Panneau de droite pour l'édition de cas types --> - <div class="flex md:!h-full flex-col relative z-40 w-full bg-gray-300 shadow-lg md:w-1/2 md:overflow-y-scroll flex-[1_0_100%] md:flex-[1_0_50%] transition-transform ease-in-out-quart duration-500" - class:translate-x-[-100%]={displayMode.edit !== undefined} - class:!h-[calc(100vh-96px)]={displayMode.edit === undefined} + <div + class="relative z-40 flex w-full flex-[1_0_100%] flex-col bg-gray-300 shadow-lg transition-transform duration-500 ease-in-out-quart md:!h-full md:w-1/2 md:flex-[1_0_50%] md:overflow-y-scroll" + class:translate-x-[-100%]={displayMode.edit !== undefined} + class:!h-[calc(100vh-96px)]={displayMode.edit === undefined} > - <h2 class="mx-5 mt-6 mr-2 text-2xl font-bold text-black lg:text-3xl"> + <h2 class="mx-5 mr-2 mt-6 text-2xl font-bold text-black lg:text-3xl"> Éditer le cas type </h2> <div class="overflow-y-scroll" style:padding-bottom="{validateBtnHeight}px"> <TestCaseEdit - date={$date} - inputInstantsByVariableName={$inputInstantsByVariableNameArray[ + date={$date} + inputInstantsByVariableName={$inputInstantsByVariableNameArray[ displayMode.edit ]} - on:changeInputInstantsByVariableName={({ detail }) => + on:changeInputInstantsByVariableName={({ detail }) => changeInputInstantsByVariableName(displayMode.edit, detail)} - on:changeSituation={({ detail }) => + on:changeSituation={({ detail }) => changeSituation(displayMode.edit, detail)} - situation={$testCases[displayMode.edit]} - situationIndex={displayMode.edit} - valuesByCalculationNameByVariableName={$valuesByCalculationNameByVariableNameArray[ + situation={$testCases[displayMode.edit]} + situationIndex={displayMode.edit} + valuesByCalculationNameByVariableName={$valuesByCalculationNameByVariableNameArray[ displayMode.edit ]} - year={$year} + year={$year} /> <div class="m-4 rounded bg-le-bleu-light p-2 text-gray-700 shadow-md"> <p class="px-2 pb-1"> <span class="font-bold" - >Vous avez besoin de configurer plus précisemment votre cas type - ?</span + >Vous avez besoin de configurer plus précisemment votre cas type ?</span > Contactez-nous sur <a class="link" href="mailto:leximpact@an.fr">leximpact@an.fr</a>. </p> <div class="m-1 rounded bg-white p-2 text-gray-700"> <p> - ⚠️ Le mode d'édition avancée est fonctionnel mais encore - difficile d'accès. Si vous avez besoin d'utiliser votre cas type - dans un amendement, nous vous proposons une relecture. + ⚠️ Le mode d'édition avancée est fonctionnel mais encore difficile + d'accès. Si vous avez besoin d'utiliser votre cas type dans un + amendement, nous vous proposons une relecture. </p> <p class="mt-2"> Pour cela, utilisez la fonctionnalité "Sauvegarder/Partager" et @@ -1534,7 +1538,7 @@ </div> {#if displayMode.variableName === undefined} - <h2 class="ml-4 mb-2 pt-3 text-xl font-bold"> + <h2 class="mb-2 ml-4 pt-3 text-xl font-bold"> Ajouter des caractéristiques : </h2> <p class="font-sm mx-4 mb-10 hidden text-gray-700 md:block"> @@ -1542,47 +1546,47 @@ éditer les variables entrant dans le calcul de ce dispositif. </p> <p class="font-sm mx-4 mb-10 block text-gray-700 md:hidden"> - Utilisez votre ordinateur ou élargissez l'écran pour obtenir plus - de fonctionnalités. + Utilisez votre ordinateur ou élargissez l'écran pour obtenir plus de + fonctionnalités. </p> {:else} <VariableReferredInputsPane - date={$date} - inputInstantsByVariableName={$inputInstantsByVariableNameArray[ + date={$date} + inputInstantsByVariableName={$inputInstantsByVariableNameArray[ displayMode.testCasesIndex[0] ]} - name={displayMode.variableName} - on:changeInputInstantsByVariableName={({ detail }) => + name={displayMode.variableName} + on:changeInputInstantsByVariableName={({ detail }) => changeInputInstantsByVariableName( displayMode.testCasesIndex[0], detail, )} - on:changeSituation={({ detail }) => + on:changeSituation={({ detail }) => changeSituation(displayMode.testCasesIndex[0], detail)} - situation={$testCases[displayMode.testCasesIndex[0]]} - situationIndex={displayMode.testCasesIndex[0]} - valuesByCalculationNameByVariableName={$valuesByCalculationNameByVariableNameArray[ + situation={$testCases[displayMode.testCasesIndex[0]]} + situationIndex={displayMode.testCasesIndex[0]} + valuesByCalculationNameByVariableName={$valuesByCalculationNameByVariableNameArray[ displayMode.testCasesIndex[0] ]} - year={$year} + year={$year} /> {/if} </div> </div> <!--Bouton flottant mobile pour fermer volet édition du cas type--> <button - bind:clientHeight={validateBtnHeight} - on:click={() => changeTestCaseToEditIndex(undefined)} - class="fixed bottom-8 right-8 z-40 flex rounded-full bg-le-bleu px-4 py-3 text-xl uppercase text-white shadow-lg hover:bg-blue-900 transition-transform ease-in-out-quart duration-500 translate-y-[calc(100%+4rem)]" - class:!translate-y-0={displayMode.edit !== undefined} - title="Valider le cas type et fermer l'édition" - > - <span class="hidden md:flex">Valider</span> - <iconify-icon - class="md:ml-2 align-[-0.2rem] text-2xl" - icon="ri-check-fill" - /> - </button> + bind:clientHeight={validateBtnHeight} + on:click={() => changeTestCaseToEditIndex(undefined)} + class="fixed bottom-8 right-8 z-40 flex translate-y-[calc(100%+4rem)] rounded-full bg-le-bleu px-4 py-3 text-xl uppercase text-white shadow-lg transition-transform duration-500 ease-in-out-quart hover:bg-blue-900" + class:!translate-y-0={displayMode.edit !== undefined} + title="Valider le cas type et fermer l'édition" + > + <span class="hidden md:flex">Valider</span> + <iconify-icon + class="align-[-0.2rem] text-2xl md:ml-2" + icon="ri-check-fill" + /> + </button> </main> <style> diff --git a/src/routes/contribuer/+page.svelte b/src/routes/contribuer/+page.svelte index 19d4edc871738f2898eb420c829bacffdbf54dfd..3fe1cef9fd086cf3de04614d64d22e0706e93ceb 100644 --- a/src/routes/contribuer/+page.svelte +++ b/src/routes/contribuer/+page.svelte @@ -10,8 +10,8 @@ <main class="fond flex items-center justify-center"> <div class="bg-white p-10"> - <div class="mb-16 max-w-screen-md"> - <h1 class="pt-7 pb-3 font-serif text-3xl font-bold text-gray-700"> + <div class="mb-16 max-w-screen-md"> + <h1 class="pb-3 pt-7 font-serif text-3xl font-bold text-gray-700"> Comment contribuer ? </h1> <!-- Partie depuis l'interface--> @@ -53,7 +53,7 @@ mobile). </p> <p - class="border-b-0 border-t border-r-0 border-l-0 pb-3 pl-5 pt-5 text-justify text-base font-semibold leading-normal" + class="border-b-0 border-l-0 border-r-0 border-t pb-3 pl-5 pt-5 text-justify text-base font-semibold leading-normal" > Pour accéder à l'espace de contribution du paramètre : </p> @@ -98,7 +98,7 @@ permettant de consulter, entre autres, l'historique des valeurs du paramètre. </p> - <p class="pb-3 pl-5 text-justify text-base leading-normal "> + <p class="pb-3 pl-5 text-justify text-base leading-normal"> Pour contribuer, cliquez sur le bouton bleu <span class="rounded bg-le-bleu p-1 px-2 text-xs uppercase text-white" >Proposer une modification</span @@ -112,7 +112,7 @@ </div> <div - class="grid grid-cols-2 items-start gap-4 border-b-0 border-t border-r-0 border-l-0 pt-5" + class="grid grid-cols-2 items-start gap-4 border-b-0 border-l-0 border-r-0 border-t pt-5" > <div> <p @@ -191,7 +191,7 @@ </div> <p - class="border-b-0 border-t border-r-0 border-l-0 pb-3 pl-5 pt-5 text-justify text-base font-semibold leading-normal" + class="border-b-0 border-l-0 border-r-0 border-t pb-3 pl-5 pt-5 text-justify text-base font-semibold leading-normal" > Pour transmettre votre contribution au service LexImpact : </p> diff --git a/src/routes/parameters/+page.svelte b/src/routes/parameters/+page.svelte index 9690b3d6b4da5f88aebd77d86801e5d6821e7ecb..dc9b58bb66539b9024e707d7af8887300e607d40 100644 --- a/src/routes/parameters/+page.svelte +++ b/src/routes/parameters/+page.svelte @@ -4,7 +4,7 @@ import { goto } from "$app/navigation" import { page } from "$app/stores" import Search from "$lib/components/search/Search.svelte" - import {SearchMode} from "$lib/search/search_mode"; + import { SearchMode } from "$lib/search/search_mode" import type { PageData } from "./$types" @@ -24,7 +24,9 @@ history.replaceState( null, "", - `${url.pathname}${searchInputValue ? `?q=${encodeURIComponent(searchInputValue)}` : ""}`, + `${url.pathname}${ + searchInputValue ? `?q=${encodeURIComponent(searchInputValue)}` : "" + }`, ) } @@ -43,7 +45,9 @@ ) // Push the current term. await goto( - `${url.pathname}${searchInputValue ? `?q=${encodeURIComponent(searchInputValue)}` : ""}`, + `${url.pathname}${ + searchInputValue ? `?q=${encodeURIComponent(searchInputValue)}` : "" + }`, ) } // Go to parameter page. @@ -52,7 +56,9 @@ </script> <svelte:head> - <title>Paramètres{searchInputValue ? ` « ${searchInputValue} »` : " "} | {data.title}</title> + <title + >Paramètres{searchInputValue ? ` « ${searchInputValue} »` : " "} | {data.title}</title + > </svelte:head> <main> diff --git a/src/routes/parameters/[parameter]/edit/+page.svelte b/src/routes/parameters/[parameter]/edit/+page.svelte index a2a7107422d2770804ccb4e29761afbc2f30e20f..e57bf81417916cd8d533a8db82bac01f92a18933 100644 --- a/src/routes/parameters/[parameter]/edit/+page.svelte +++ b/src/routes/parameters/[parameter]/edit/+page.svelte @@ -128,32 +128,29 @@ {/if} <main class="fond flex items-center justify-center"> - <div class="max-w-screen-md bg-white "> + <div class="max-w-screen-md bg-white"> <form class="flex-col items-start pb-4" on:submit|preventDefault={save}> <a - class="mt-5 ml-10 inline-flex items-center rounded bg-gray-200 p-2 pr-3 text-sm text-black shadow-md hover:bg-gray-300 active:bg-gray-400 cursor-pointer" - href="/parameters/{processedParameter.name}" + class="ml-10 mt-5 inline-flex cursor-pointer items-center rounded bg-gray-200 p-2 pr-3 text-sm text-black shadow-md hover:bg-gray-300 active:bg-gray-400" + href="/parameters/{processedParameter.name}" > - <iconify-icon - class="text-2xl" - icon="ri-arrow-left-line" - /> + <iconify-icon class="text-2xl" icon="ri-arrow-left-line" /> <span class="ml-3">Retour au détail du paramètre</span> </a> <div class="p-10"> <!-- Partie modification de l'intitulé--> <p class="mb-2 uppercase">Modification du paramètre :</p> <div> - <div class="mb-4 border-l-2 border-black pl-4 "> - <p class="font-serif text-3xl "> + <div class="mb-4 border-l-2 border-black pl-4"> + <p class="font-serif text-3xl"> <span class="font-bold">{processedParameter.title}</span> <br /> </p> <span class="font-serif text-sm italic" >{processedParameter.description}</span > - <div class="mt-7 w-3/5 rounded border p-2 "> - <h2 class="text-base ">Parents du paramètre :</h2> + <div class="mt-7 w-3/5 rounded border p-2"> + <h2 class="text-base">Parents du paramètre :</h2> <div class="flex-col"> {#each [...iterParameterAncestors(processedParameter.parent)] as ancestor} <!-- svelte-ignore a11y-missing-attribute --> @@ -170,7 +167,7 @@ </div> </div> - <h2 class="pt-7 pb-3 text-xl font-bold"> + <h2 class="pb-3 pt-7 text-xl font-bold"> Modifier les intitulés : </h2> <div class="flex-col"> @@ -205,7 +202,7 @@ </label> </div> <div class="flex"> - <label class="my-2 text-xs "> + <label class="my-2 text-xs"> Description <textarea class="mt-1 flex rounded-t border-b border-gray-400 bg-gray-100 p-2 font-serif text-sm italic focus:ring-2" @@ -222,7 +219,7 @@ </div> <!-- Partie modification de la valeur--> - <h2 class="pt-7 pb-3 text-xl font-bold"> + <h2 class="pb-3 pt-7 text-xl font-bold"> Modifier les valeurs : {#each [...iterParameterAncestors(parameter.parent)] as ancestor} {ancestor.title} diff --git a/src/routes/variables/[variable]/+page.svelte b/src/routes/variables/[variable]/+page.svelte index 33b7cc8c6202683f173aadf51c35766cb2a74bd2..fe72b43bc12d97c46ae65c3e96e14d486e2a19f5 100644 --- a/src/routes/variables/[variable]/+page.svelte +++ b/src/routes/variables/[variable]/+page.svelte @@ -100,13 +100,10 @@ <main class="fond flex items-center justify-center"> <div class="max-w-screen-md bg-white"> <a - class="mt-5 ml-10 inline-flex items-center rounded bg-gray-200 p-2 pr-3 text-sm text-black shadow-md hover:bg-gray-300 active:bg-gray-400 cursor-pointer" - href="/" + class="ml-10 mt-5 inline-flex cursor-pointer items-center rounded bg-gray-200 p-2 pr-3 text-sm text-black shadow-md hover:bg-gray-300 active:bg-gray-400" + href="/" > - <iconify-icon - class="text-2xl" - icon="ri-arrow-left-line" - /> + <iconify-icon class="text-2xl" icon="ri-arrow-left-line" /> <span class="ml-3">Retour au simulateur</span> </a> <VariableView diff --git a/tailwind.config.cjs b/tailwind.config.cjs index 0c7986075e9b5bc29f983151fe9bc1dc9c723f76..483b409a65c076704bdd6329d31c92d8c0bb66b8 100644 --- a/tailwind.config.cjs +++ b/tailwind.config.cjs @@ -49,30 +49,30 @@ const config = { "le-vert-validation-dark": "#377330", }, zIndex: { - '25': '25', + 25: "25", }, transitionTimingFunction: { - 'in-quad': 'cubic-bezier(.55, .085, .68, .53)', - 'in-cubic': 'cubic-bezier(.550, .055, .675, .19)', - 'in-quart': 'cubic-bezier(.895, .03, .685, .22)', - 'in-quint': 'cubic-bezier(.755, .05, .855, .06)', - 'in-expo': 'cubic-bezier(.95, .05, .795, .035)', - 'in-circ': 'cubic-bezier(.6, .04, .98, .335)', + "in-quad": "cubic-bezier(.55, .085, .68, .53)", + "in-cubic": "cubic-bezier(.550, .055, .675, .19)", + "in-quart": "cubic-bezier(.895, .03, .685, .22)", + "in-quint": "cubic-bezier(.755, .05, .855, .06)", + "in-expo": "cubic-bezier(.95, .05, .795, .035)", + "in-circ": "cubic-bezier(.6, .04, .98, .335)", - 'out-quad': 'cubic-bezier(.25, .46, .45, .94)', - 'out-cubic': 'cubic-bezier(.215, .61, .355, 1)', - 'out-quart': 'cubic-bezier(.165, .84, .44, 1)', - 'out-quint': 'cubic-bezier(.23, 1, .32, 1)', - 'out-expo': 'cubic-bezier(.19, 1, .22, 1)', - 'out-circ': 'cubic-bezier(.075, .82, .165, 1)', + "out-quad": "cubic-bezier(.25, .46, .45, .94)", + "out-cubic": "cubic-bezier(.215, .61, .355, 1)", + "out-quart": "cubic-bezier(.165, .84, .44, 1)", + "out-quint": "cubic-bezier(.23, 1, .32, 1)", + "out-expo": "cubic-bezier(.19, 1, .22, 1)", + "out-circ": "cubic-bezier(.075, .82, .165, 1)", - 'in-out-quad': 'cubic-bezier(.455, .03, .515, .955)', - 'in-out-cubic': 'cubic-bezier(.645, .045, .355, 1)', - 'in-out-quart': 'cubic-bezier(.77, 0, .175, 1)', - 'in-out-quint': 'cubic-bezier(.86, 0, .07, 1)', - 'in-out-expo': 'cubic-bezier(1, 0, 0, 1)', - 'in-out-circ': 'cubic-bezier(.785, .135, .15, .86)' - } + "in-out-quad": "cubic-bezier(.455, .03, .515, .955)", + "in-out-cubic": "cubic-bezier(.645, .045, .355, 1)", + "in-out-quart": "cubic-bezier(.77, 0, .175, 1)", + "in-out-quint": "cubic-bezier(.86, 0, .07, 1)", + "in-out-expo": "cubic-bezier(1, 0, 0, 1)", + "in-out-circ": "cubic-bezier(.785, .135, .15, .86)", + }, }, fontFamily: { sans: ["Lato", "sans-serif"],