{"version":3,"file":"ParticipantInlineList-DsMLDVei.mjs","names":[],"sources":["../src/components/display/participant/ParticipantInlineList.vue","../src/components/display/participant/ParticipantInlineList.vue"],"sourcesContent":["<template>\n  <div class=\"d-flex flex-column p-3 list-participants\">\n    <h2 class=\"mb-3\">{{ title }}</h2>\n    <ClassicLoading\n      :loading-text=\"loading ? t('Loading participants ...') : undefined\"\n    />\n    <SwiperList\n      v-if=\"!loading && allParticipants.length\"\n      :size-item-overload=\"itemSize\"\n      :list-object=\"allParticipants\"\n    >\n      <template #octopusSlide=\"{ option }\">\n        <ParticipantItem\n          v-if=\"0 !== option.participantId\" \n          :participant=\"option\"\n        />\n      </template>\n    </SwiperList>\n\n    <router-link\n      v-if=\"buttonText\"\n      :to=\"href ?? { name: 'participants' }\"\n      class=\"btn btn-primary align-self-center w-fit-content m-4\"\n    >\n      {{ buttonText }}\n    </router-link>\n  </div>\n</template>\n\n<script setup lang=\"ts\">\nimport ParticipantItem from \"./ParticipantItem.vue\";\nimport SwiperList from \"../list/SwiperList.vue\";\nimport classicApi from \"../../../api/classicApi\";\nimport {useErrorHandler} from \"../../composable/useErrorHandler\";\nimport ClassicLoading from \"../../form/ClassicLoading.vue\";\nimport { onMounted, Ref, ref } from \"vue\";\nimport { AxiosError } from \"axios\";\nimport { ListClassicReturn } from \"@/stores/class/general/listReturn\";\nimport { Participant } from \"@/stores/class/general/participant\";\nimport { useI18n } from \"vue-i18n\";\n\n\n//Props \nconst props = defineProps({\n  organisationId: { default: undefined, type: String },\n  href: { default: undefined, type: String },\n  buttonText: { default: undefined, type: String },\n  itemSize: { default: undefined, type: Number },\n  title: { default: \"\", type: String },\n})\n\n//Data \nconst loading = ref(true);\nconst allParticipants: Ref<Array<Participant>> = ref([]);\n  \n//Composables\nconst { t } = useI18n();\nconst { handle403 } = useErrorHandler();\n\nonMounted(()=>fetchNext())\n\n//Methods\nasync function fetchNext(): Promise<void> {\n  try {\n    const data = await classicApi.fetchData<ListClassicReturn<Participant>>({\n      api: 0,\n      path: \"participant/search\",\n      parameters: {\n        first: 0,\n        size: 12,\n        organisationId: props.organisationId,\n        order: \"LAST_PODCAST_DESC\",\n      },\n      specialTreatement: true,\n    });\n    allParticipants.value = allParticipants.value.concat(\n      data.result.filter((part: Participant | null) => null !== part),\n    );\n    loading.value = false;\n  } catch (error) {\n    handle403(error as AxiosError);\n  }\n}\n</script>\n\n<style scoped lang=\"scss\">\n.list-participants{\n  .element-list-inline{\n      @media (width <= 960px) {\n      > div{\n        margin: 0 0.5rem 0 0;\n      }\n    }\n  }\n\n  .participant-item-container{\n    margin:0;\n  }\n}\n</style>\n","<template>\n  <div class=\"d-flex flex-column p-3 list-participants\">\n    <h2 class=\"mb-3\">{{ title }}</h2>\n    <ClassicLoading\n      :loading-text=\"loading ? t('Loading participants ...') : undefined\"\n    />\n    <SwiperList\n      v-if=\"!loading && allParticipants.length\"\n      :size-item-overload=\"itemSize\"\n      :list-object=\"allParticipants\"\n    >\n      <template #octopusSlide=\"{ option }\">\n        <ParticipantItem\n          v-if=\"0 !== option.participantId\" \n          :participant=\"option\"\n        />\n      </template>\n    </SwiperList>\n\n    <router-link\n      v-if=\"buttonText\"\n      :to=\"href ?? { name: 'participants' }\"\n      class=\"btn btn-primary align-self-center w-fit-content m-4\"\n    >\n      {{ buttonText }}\n    </router-link>\n  </div>\n</template>\n\n<script setup lang=\"ts\">\nimport ParticipantItem from \"./ParticipantItem.vue\";\nimport SwiperList from \"../list/SwiperList.vue\";\nimport classicApi from \"../../../api/classicApi\";\nimport {useErrorHandler} from \"../../composable/useErrorHandler\";\nimport ClassicLoading from \"../../form/ClassicLoading.vue\";\nimport { onMounted, Ref, ref } from \"vue\";\nimport { AxiosError } from \"axios\";\nimport { ListClassicReturn } from \"@/stores/class/general/listReturn\";\nimport { Participant } from \"@/stores/class/general/participant\";\nimport { useI18n } from \"vue-i18n\";\n\n\n//Props \nconst props = defineProps({\n  organisationId: { default: undefined, type: String },\n  href: { default: undefined, type: String },\n  buttonText: { default: undefined, type: String },\n  itemSize: { default: undefined, type: Number },\n  title: { default: \"\", type: String },\n})\n\n//Data \nconst loading = ref(true);\nconst allParticipants: Ref<Array<Participant>> = ref([]);\n  \n//Composables\nconst { t } = useI18n();\nconst { handle403 } = useErrorHandler();\n\nonMounted(()=>fetchNext())\n\n//Methods\nasync function fetchNext(): Promise<void> {\n  try {\n    const data = await classicApi.fetchData<ListClassicReturn<Participant>>({\n      api: 0,\n      path: \"participant/search\",\n      parameters: {\n        first: 0,\n        size: 12,\n        organisationId: props.organisationId,\n        order: \"LAST_PODCAST_DESC\",\n      },\n      specialTreatement: true,\n    });\n    allParticipants.value = allParticipants.value.concat(\n      data.result.filter((part: Participant | null) => null !== part),\n    );\n    loading.value = false;\n  } catch (error) {\n    handle403(error as AxiosError);\n  }\n}\n</script>\n\n<style scoped lang=\"scss\">\n.list-participants{\n  .element-list-inline{\n      @media (width <= 960px) {\n      > div{\n        margin: 0 0.5rem 0 0;\n      }\n    }\n  }\n\n  .participant-item-container{\n    margin:0;\n  }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CA,MAAM,QAAQ;EASd,MAAM,UAAU,IAAI,IAAI;EACxB,MAAM,kBAA2C,IAAI,CAAC,CAAC;EAGvD,MAAM,EAAE,MAAM,QAAQ;EACtB,MAAM,EAAE,cAAc,gBAAgB;EAEtC,gBAAc,UAAU,CAAC;EAGzB,eAAe,YAA2B;GACxC,IAAI;IACF,MAAM,OAAO,MAAM,mBAAW,UAA0C;KACtE,KAAK;KACL,MAAM;KACN,YAAY;MACV,OAAO;MACP,MAAM;MACN,gBAAgB,MAAM;MACtB,OAAO;KACT;KACA,mBAAmB;IACrB,CAAC;IACD,gBAAgB,QAAQ,gBAAgB,MAAM,OAC5C,KAAK,OAAO,QAAQ,SAA6B,SAAS,IAAI,CAChE;IACA,QAAQ,QAAQ;GAClB,SAAS,OAAO;IACd,UAAU,KAAmB;GAC/B;EACF;;;;;;;;;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