Skip to content
Snippets Groups Projects
Select Git revision
  • cd90f1daa09ef26d2fb07b45bf084ca96d1aff94
  • master default protected
  • ajout_ppa_rsa_budgetaire
  • 365-ouvrir-l-onglet-employeur-ou-taxes-carburant-quand-c-est-le-cas-pour-un-dispositif
  • 381-pb-affichage-labels-des-parametres-sur-plus-de-3-lignes
  • ajoute-duplicate-aide-logement
  • poc_castype_ia
  • parametres-editables-budget
  • ui-parametres
  • 366-signe-a-cote-du-droit-en-vigueur-sur-l-ui-pour-indiquer-que-la-reforme-a-eu-lieu-mais-qu-elle-n
  • 355-les-dispositifs-prestations-sociales-du-graphique-se-cachent-montrent-en-meme-temps-2
  • 358-les-variables-dont-le-montant-est-nul-apparaissent-en-bleu-et-non-cliquables
  • 356-ajuster-la-largeur-sur-les-graphiques-budgetaires
  • incoherence_cas_type_0
  • fix-ui-suppression-tranches-baremes
  • ajout-agregat-cehr-version-plf
  • impact_carbone
  • xlsx
  • header_revamp
  • 270-concevoir-la-page-d-accueil-leximpact
  • 219-conversion-des-montants-min-et-max-de-l-axe-des-x-en-smic
  • 0.0.1123
  • 0.0.1122
  • 0.0.1121
  • 0.0.1120
  • 0.0.1119
  • 0.0.1118
  • 0.0.1117
  • 0.0.1116
  • 0.0.1115
  • 0.0.1114
  • 0.0.1113
  • 0.0.1112
  • 0.0.1111
  • 0.0.1110
  • 0.0.1109
  • 0.0.1108
  • 0.0.1107
  • 0.0.1106
  • 0.0.1105
  • 0.0.1104
41 results

VariableReferredInputs.svelte

Blame
  • VariableReferredInputs.svelte 3.47 KiB
    <script lang="ts">
      import type { Variable } from "@openfisca/ast"
      import {
        getVariableFormula,
        getVariableLatestFormulaDate,
        newVariableRepositoryUrl,
      } from "@openfisca/ast"
    
      import { session } from "$app/stores"
    
      import VariableReferredInput from "./VariableReferredInput.svelte"
    
      export let date: string
      export let inputs: Variable[]
      export let variable: Variable
    
      let openDirectInputs = true
    
      $: directVariablesName = new Set(
        getVariableFormula(variable, date)?.variables ?? [],
      )
    
      $: directInputs = inputs.filter((input) =>
        directVariablesName.has(input.name),
      )
    
      $: latestFormulaDate = getVariableLatestFormulaDate(variable)
    
      $: metadata = $session.metadata
    
      $: openAllInputs = directInputs.length === 0
    </script>
    
    <h2 class="font-bold text-xl pt-3 pb-2">
      Définir d'autres caractéristiques <br />
      influentes sur :
    </h2>
    <h1
      class="bg-le-gris-dispositif-light font-serif text-center mb-3 p-2 sm:p-1 md:p-2 rounded-md  "
    >
      <p class="font-medium">{variable.label ?? variable.name}</p>
    </h1>
    
    {#if directInputs.length > 0}
      <section>
        <h2
          class="bg-gray-100 flex font-medium justify-between p-2 sm:p-1 md:p-2 text-gray-800 text-lg"
        >
          <span>Paramètres référents directs</span>
          <button on:click={() => (openDirectInputs = !openDirectInputs)}>
            {#if openDirectInputs}
              <!-- Material Icons name: Expand Less -->
              <svg
                aria-hidden="true"
                class="block h-6 stroke-current w-6"
                fill="black"
                viewBox="0 0 24 24"
                xmlns="http://www.w3.org/2000/svg"
                ><path d="M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z" /></svg
              >
            {:else}
              <!-- Material Icons name: Expand More -->
              <svg
                aria-hidden="true"
                class="block h-6 stroke-current w-6"
                fill="black"
                viewBox="0 0 24 24"
                xmlns="http://www.w3.org/2000/svg"
                ><path d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z" /></svg
              >