@paris-ias/list 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/example/.env.example +3 -0
  2. package/example/nuxt.config.ts +19 -0
  3. package/example/pages/index.vue +27 -0
  4. package/package.json +3 -3
  5. package/src/module.ts +119 -0
  6. package/src/runtime/components/events/Badges.vue +73 -0
  7. package/src/runtime/components/events/DateTimePlace.vue +77 -0
  8. package/src/runtime/components/events/DenseItem.vue +40 -0
  9. package/src/runtime/components/events/ExpandedItem.vue +11 -0
  10. package/src/runtime/components/events/ListContainer.vue +41 -0
  11. package/src/runtime/components/events/RegisterModal.vue +51 -0
  12. package/src/runtime/components/events/RelatedItem.vue +44 -0
  13. package/src/runtime/components/events/RowsItem.vue +114 -0
  14. package/src/runtime/components/events/View.vue +333 -0
  15. package/src/runtime/components/fellowships/Badges.vue +48 -0
  16. package/src/runtime/components/fellowships/DenseItem.vue +39 -0
  17. package/src/runtime/components/fellowships/ExpandedItem.vue +7 -0
  18. package/src/runtime/components/fellowships/RegisterModal.vue +41 -0
  19. package/src/runtime/components/fellowships/RowsItem.vue +61 -0
  20. package/src/runtime/components/fellowships/View.vue +210 -0
  21. package/src/runtime/components/list/atoms/FiltersMenu.vue +46 -0
  22. package/src/runtime/components/list/atoms/SearchInput.vue +129 -0
  23. package/src/runtime/components/list/atoms/SearchItem.vue +59 -0
  24. package/src/runtime/components/list/atoms/SearchString.vue +161 -0
  25. package/src/runtime/components/list/atoms/SortMenu.vue +97 -0
  26. package/src/runtime/components/list/atoms/ViewMenu.vue +71 -0
  27. package/src/runtime/components/list/inputs/AutoComplete.vue +22 -0
  28. package/src/runtime/components/list/inputs/BooleanSwitch.vue +18 -0
  29. package/src/runtime/components/list/inputs/Checkbox.vue +21 -0
  30. package/src/runtime/components/list/inputs/Select.vue +25 -0
  31. package/src/runtime/components/list/molecules/Filters.vue +97 -0
  32. package/src/runtime/components/list/molecules/Header.vue +47 -0
  33. package/src/runtime/components/list/molecules/Pagination.vue +243 -0
  34. package/src/runtime/components/list/organisms/List.vue +92 -0
  35. package/src/runtime/components/list/views/Dense.vue +25 -0
  36. package/src/runtime/components/list/views/Expanded.vue +10 -0
  37. package/src/runtime/components/list/views/Grid.vue +13 -0
  38. package/src/runtime/components/list/views/Rows.vue +13 -0
  39. package/src/runtime/components/list/views/Table.vue +13 -0
  40. package/src/runtime/components/misc/atoms/CountUp.vue +198 -0
  41. package/src/runtime/components/misc/atoms/DateStamp.vue +104 -0
  42. package/src/runtime/components/misc/atoms/ImageContainer.vue +105 -0
  43. package/src/runtime/components/misc/atoms/ShareMenu.vue +60 -0
  44. package/src/runtime/components/misc/atoms/Socials.vue +127 -0
  45. package/src/runtime/components/misc/molecules/ChipContainer.vue +35 -0
  46. package/src/runtime/components/misc/molecules/Related.vue +41 -0
  47. package/src/runtime/components/misc/molecules/RelatedItems.vue +29 -0
  48. package/src/runtime/components/misc/molecules/SearchItem.vue +26 -0
  49. package/src/runtime/components/news/DenseItem.vue +62 -0
  50. package/src/runtime/components/news/ExpandedItem.vue +153 -0
  51. package/src/runtime/components/news/Header.vue +9 -0
  52. package/src/runtime/components/news/RelatedItem.vue +44 -0
  53. package/src/runtime/components/news/RowsItem.vue +160 -0
  54. package/src/runtime/components/news/View.vue +190 -0
  55. package/src/runtime/components/people/DenseItem.vue +37 -0
  56. package/src/runtime/components/people/ExpandedItem.vue +16 -0
  57. package/src/runtime/components/people/GroupBadges.vue +56 -0
  58. package/src/runtime/components/people/RelatedItem.vue +41 -0
  59. package/src/runtime/components/people/RowsItem.vue +95 -0
  60. package/src/runtime/components/people/View.vue +162 -0
  61. package/src/runtime/components/projects/ExpandedItem.vue +14 -0
  62. package/src/runtime/components/projects/RelatedItem.vue +44 -0
  63. package/src/runtime/components/projects/RowsItem.vue +106 -0
  64. package/src/runtime/components/projects/View.vue +131 -0
  65. package/src/runtime/components/publications/RelatedItem.vue +44 -0
  66. package/src/runtime/components/publications/RowsItem.vue +105 -0
  67. package/src/runtime/components/publications/View.vue +139 -0
  68. package/src/runtime/composables/useFetchItem.ts +64 -0
  69. package/src/runtime/composables/useIcons.ts +30 -0
  70. package/src/runtime/composables/useUtils.ts +75 -0
  71. package/src/runtime/graphql/queries/buildFiltersValues.gql +35 -0
  72. package/src/runtime/graphql/queries/item/action.gql +0 -0
  73. package/src/runtime/graphql/queries/item/apps.gql +0 -0
  74. package/src/runtime/graphql/queries/item/events.gql +120 -0
  75. package/src/runtime/graphql/queries/item/fellowships.gql +164 -0
  76. package/src/runtime/graphql/queries/item/news.gql +129 -0
  77. package/src/runtime/graphql/queries/item/people.gql +174 -0
  78. package/src/runtime/graphql/queries/item/projects.gql +171 -0
  79. package/src/runtime/graphql/queries/item/publications.gql +169 -0
  80. package/src/runtime/graphql/queries/item/users.gql +0 -0
  81. package/src/runtime/graphql/queries/list/action.gql +0 -0
  82. package/src/runtime/graphql/queries/list/apps.gql +32 -0
  83. package/src/runtime/graphql/queries/list/events.gql +44 -0
  84. package/src/runtime/graphql/queries/list/fellowships.gql +53 -0
  85. package/src/runtime/graphql/queries/list/news.gql +39 -0
  86. package/src/runtime/graphql/queries/list/people.gql +49 -0
  87. package/src/runtime/graphql/queries/list/projects.gql +37 -0
  88. package/src/runtime/graphql/queries/list/publications.gql +37 -0
  89. package/src/runtime/graphql/queries/list/search.gql +148 -0
  90. package/src/runtime/graphql/queries/list/users.gql +32 -0
  91. package/src/runtime/graphql/queries/login.gql +0 -0
  92. package/src/runtime/plugins/pinia.ts +88 -0
  93. package/src/runtime/plugins/vuetify.js +21 -0
  94. package/src/runtime/stores/factory.ts +18 -0
  95. package/src/runtime/stores/root.ts +353 -0
  96. package/src/runtime/translations/en.json +436 -0
  97. package/src/runtime/translations/fr.json +429 -0
  98. package/src/runtime/types/imports.d.ts +13 -0
  99. package/src/runtime/types/stores.d.ts +11 -0
@@ -0,0 +1,210 @@
1
+ <template>
2
+ <!-- {{ name }} -->
3
+ <v-row justify="center">
4
+ <v-col cols="12" sm="11" md="10" lg="9" xl="8">
5
+ <v-row
6
+ v-if="item && item.image && item.image.length"
7
+ class="justify-center"
8
+ >
9
+ <v-col cols="12" sm="10" md="6" lg="4" xl="3" class="text-center">
10
+ <!-- FELLOWSHIP IMAGE -->
11
+ <MiscAtomsImageContainer
12
+ contain
13
+ :loading
14
+ :src="item.image"
15
+ :ratio="1 / 1"
16
+ />
17
+ </v-col>
18
+ </v-row>
19
+ <v-row justify="center">
20
+ <v-col cols="12">
21
+ <v-skeleton-loader
22
+ v-if="loading"
23
+ :type="
24
+ [
25
+ 'avatar, paragraph',
26
+ 'avatar, paragraph',
27
+ 'heading, ossein, avatar, text, ossein, chip@3',
28
+ 'heading, ossein, avatar, text, ossein, chip@3',
29
+ 'heading, ossein, avatar, text, ossein, chip@3',
30
+ 'heading',
31
+ ][['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].indexOf(name || 'md')]
32
+ "
33
+ />
34
+
35
+ <div v-else class="d-flex align-center flex-column mt-12">
36
+ <div class="d-flex text-center text-wrap text-h3 text-black">
37
+ {{ item.name }}
38
+ </div>
39
+ <v-divider width="154px" class="mb-1 mt-6" />
40
+ <v-divider width="154px" />
41
+ <div class="d-flex text-center text-wrap text-h5 text-black mt-6">
42
+ <MDC v-if="item.subtitle" :value="item.subtitle" />
43
+ </div>
44
+ <MiscMoleculesChipContainer
45
+ :items="[
46
+ $t(
47
+ 'list.filters.fellowships.fellowshipType.' +
48
+ item.fellowshipType
49
+ ),
50
+ ...(props.item && props.item.disciplines
51
+ ? props.item.disciplines.map((discipline) => discipline.name)
52
+ : []),
53
+ ]"
54
+ class="mt-2"
55
+ />
56
+ <div class="mt-5">
57
+ <FellowshipsBadges :item="item" :view="view" />
58
+ </div>
59
+ </div>
60
+ <div class="mx-6">
61
+ <!-- DIVIDERS -->
62
+ <v-responsive class="mx-auto my-9" width="120">
63
+ <v-divider class="mb-1" />
64
+ <v-divider />
65
+ </v-responsive>
66
+
67
+ <!-- FELLOWSHIP DESCRIPTION -->
68
+ <v-skeleton-loader
69
+ v-if="loading"
70
+ :type="
71
+ [
72
+ 'text@50',
73
+ 'text@50',
74
+ 'text@50',
75
+ 'text@50',
76
+ 'text@50',
77
+ 'text@50',
78
+ ][['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].indexOf(name || 'md')]
79
+ "
80
+ />
81
+ <MDC v-if="item.description" :value="item.description" />
82
+
83
+ <v-responsive class="mx-auto my-9" width="120">
84
+ <v-divider class="mb-1" />
85
+ <v-divider />
86
+ </v-responsive>
87
+ <v-skeleton-loader v-if="loading" />
88
+ <v-expansion-panels
89
+ v-else
90
+ v-model="accordeon"
91
+ flat
92
+ ripple
93
+ variant="accordion"
94
+ class="py-8"
95
+ >
96
+ <v-expansion-panel
97
+ v-for="(value, key) in Object.keys(renderedDetails)"
98
+ :key="key + value"
99
+ class="border-thin text-black"
100
+ :color="key === accordeon ? 'light-grey' : 'white'"
101
+ >
102
+ <v-expansion-panel-title
103
+ collapse-icon="mdi-minus"
104
+ expand-icon="mdi-plus"
105
+ class="text-h6"
106
+ :class="{ 'font-weight-black': key === accordeon }"
107
+ >
108
+ {{ $t(value) }}
109
+ </v-expansion-panel-title>
110
+ <v-expansion-panel-text
111
+ class="py-2"
112
+ style="white-space: pre; text-wrap: auto"
113
+ >
114
+ <MDC
115
+ v-if="renderedDetails[value]"
116
+ :value="renderedDetails[value]"
117
+ />
118
+ </v-expansion-panel-text>
119
+ </v-expansion-panel>
120
+ </v-expansion-panels>
121
+
122
+ <v-responsive class="mx-auto my-9" width="120">
123
+ <v-divider class="mb-1" />
124
+ <v-divider />
125
+ </v-responsive>
126
+
127
+ <!-- <MiscAtomsSlidingCarousel
128
+ v-if="item && item.fellows && item.fellows.length"
129
+ key="people"
130
+ ref="fellows"
131
+ :items="item.fellows || []"
132
+ type="people"
133
+ lazy
134
+ :loading
135
+ >
136
+ <div :class="mdAndUp ? 'text-h5' : 'text-h6'">
137
+ {{ $t("this-fellowship-alumni") }}
138
+ </div>
139
+ </MiscAtomsSlidingCarousel> -->
140
+ </div>
141
+ </v-col>
142
+ <MiscMoleculesRelated
143
+ v-if="!loading && item && item.related"
144
+ :related="item.related"
145
+ />
146
+ </v-row>
147
+ </v-col>
148
+ </v-row>
149
+ </template>
150
+
151
+ <script setup>
152
+ import { useDisplay } from "vuetify"
153
+
154
+ const { name } = useDisplay()
155
+ const accordeon = ref(-1)
156
+ const props = defineProps({
157
+ item: {
158
+ type: Object,
159
+ required: true,
160
+ },
161
+ loading: {
162
+ type: Boolean,
163
+ default: false,
164
+ required: true,
165
+ },
166
+ })
167
+
168
+ const view = ref(true)
169
+ onMounted(() => {
170
+ /* console.log("fellowship item", props.item.value) */
171
+ })
172
+
173
+ const renderedDetails = {
174
+ ...(props.item?.fellowshipDetails?.type && {
175
+ type: props.item?.fellowshipDetails?.type,
176
+ }),
177
+ ...(props.item?.fellowshipDetails?.fundingPeriod && {
178
+ fundingPeriod: props.item?.fellowshipDetails?.fundingPeriod,
179
+ }),
180
+ ...(props.item?.fellowshipDetails?.profile && {
181
+ profile: props.item?.fellowshipDetails?.profile,
182
+ }),
183
+ ...(props.item?.fellowshipDetails?.tasks && {
184
+ tasks: props.item?.fellowshipDetails?.tasks,
185
+ }),
186
+ ...(props.item?.fellowshipDetails?.location && {
187
+ location: props.item?.fellowshipDetails?.location,
188
+ }),
189
+ ...(props.item?.fellowshipDetails?.funding && {
190
+ funding: props.item?.fellowshipDetails?.funding,
191
+ }),
192
+ ...(props.item?.fellowshipDetails?.housing && {
193
+ housing: props.item?.fellowshipDetails?.housing,
194
+ }),
195
+ ...(props.item?.fellowshipDetails?.meals && {
196
+ meals: props.item?.fellowshipDetails?.meals,
197
+ }),
198
+ ...(props.item?.fellowshipDetails?.applicationMaterials && {
199
+ applicationMaterials: props.item?.fellowshipDetails?.applicationMaterials,
200
+ }),
201
+ ...(props.item?.fellowshipDetails?.selectionProcess && {
202
+ selectionProcess: props.item?.fellowshipDetails?.selectionProcess,
203
+ }),
204
+ ...(props.item?.fellowshipDetails?.researchProcess && {
205
+ researchProcess: props.item?.fellowshipDetails?.researchProcess,
206
+ }),
207
+ }
208
+ </script>
209
+
210
+ <style lang="scss" scoped></style>
@@ -0,0 +1,46 @@
1
+ <template>
2
+ <v-tooltip location="top">
3
+ <template v-slot:activator="{ props: tooltip }">
4
+ <v-btn
5
+ x-large
6
+ outlined
7
+ tile
8
+ flat
9
+ :class="{
10
+ 'mt-3': isXsDisplay,
11
+ }"
12
+ v-bind="tooltip"
13
+ prepend-icon="mdi-tune-variant"
14
+ :append-icon="open ? 'mdi-chevron-down' : 'mdi-chevron-up'"
15
+ @click="$emit('open', !open)"
16
+ >
17
+ <!-- <v-icon>mdi-tune-variant</v-icon> -->
18
+ {{ $t("filters") }}
19
+ </v-btn>
20
+ </template>
21
+ <div
22
+ v-html="open ? $t('close-the-filter-panel') : $t('open-the-filter-panel')"
23
+ ></div>
24
+ </v-tooltip>
25
+ </template>
26
+
27
+ <script setup>
28
+ import { useDisplay } from "vuetify"
29
+ const {
30
+ name: nameDisplay,
31
+ xs: isXsDisplay,
32
+ mobile: isMobileDisplay,
33
+ smAndUp,
34
+ lgAndUp,
35
+ smAndDown,
36
+ } = useDisplay()
37
+ const props = defineProps({
38
+ open: {
39
+ type: Boolean,
40
+ required: false,
41
+ default: false,
42
+ },
43
+ })
44
+ </script>
45
+
46
+ <style lang="scss" scoped></style>
@@ -0,0 +1,129 @@
1
+ <template>
2
+ <div class="d-flex flex-grow-1 flex-column">
3
+ <v-text-field
4
+ v-model.trim="search"
5
+ :placeholder="$t('list.search-type', [$t(type)])"
6
+ prepend-inner-icon="mdi-magnify"
7
+ single-line
8
+ class="transition-swing"
9
+ variant="outlined"
10
+ hide-details
11
+ clearable
12
+ tile
13
+ type="search"
14
+ :loading="rootStore.loading"
15
+ >
16
+ <!-- :loading="$nuxt.loading || $store.state.loading" :class="{ 'mt-3':
17
+ $store.state.scrolled }" -->
18
+ <template v-if="!search" #label>
19
+ <div class="searchLabel">
20
+ {{ $t("list.search-type", [$t(type)]) }}
21
+ </div>
22
+ </template></v-text-field
23
+ >
24
+ <v-expand-transition v-if="type === 'all'">
25
+ <v-list
26
+ v-show="search.length"
27
+ lines="three"
28
+ item-props
29
+ style="max-height: 300px"
30
+ class="overflow-y-auto"
31
+ >
32
+ <div v-if="rootStore.loading" class="d-flex justify-center py-6">
33
+ <v-progress-circular color="black" size="64" indeterminate />
34
+ </div>
35
+ <template v-for="(item, index) in results">
36
+ <v-list-subheader
37
+ v-if="item.type && item.type === 'subheader'"
38
+ :key="'subheader-' + index"
39
+ >{{ item.name }}</v-list-subheader
40
+ >
41
+ <div
42
+ v-else-if="item.type && item.type === 'no-result'"
43
+ :key="'no-result-' + index"
44
+ class="mx-6"
45
+ >
46
+ {{ $t("no-result") }}
47
+ </div>
48
+ <v-divider
49
+ v-else-if="item.type && item.type === 'divider'"
50
+ :key="'divider-' + index"
51
+ inset
52
+ />
53
+ <ListAtomsSearchItem
54
+ v-else
55
+ :key="'item- ' + index"
56
+ :index
57
+ :item
58
+ :type="item.type"
59
+ />
60
+ </template> </v-list
61
+ ></v-expand-transition>
62
+ </div>
63
+ </template>
64
+
65
+ <script setup>
66
+ import { useDebounceFn } from "@vueuse/core"
67
+ import { useRootStore } from "../../../stores/root"
68
+ const { locale, t } = useI18n()
69
+ const rootStore = useRootStore()
70
+ const { $stores } = useNuxtApp()
71
+ const props = defineProps({
72
+ type: {
73
+ type: String,
74
+ required: true,
75
+ },
76
+ loading: {
77
+ type: Boolean,
78
+ default: false,
79
+ },
80
+ })
81
+ const results = computed(() => {
82
+ const storeRst = rootStore.results
83
+ const rst =
84
+ (Object.keys(storeRst).length &&
85
+ Object.keys(storeRst)
86
+ .sort((a, b) => {
87
+ return storeRst[b]?.items?.length - storeRst[a]?.items?.length
88
+ })
89
+ .reduce((acc, key, index) => {
90
+ const items = storeRst[key]?.items
91
+ const total = storeRst[key]?.total
92
+ if (total === 0 && index === 0) {
93
+ acc.push({ type: "no-result" })
94
+ return acc
95
+ }
96
+ if (items?.length) {
97
+ acc.push({ type: "subheader", name: t("items." + key, 2) })
98
+ acc.push(
99
+ ...items.map((item) => ({
100
+ prependAvatar: item?.image?.url || "mdi-square",
101
+ title: item.name || item.firstname + " " + item.lastname,
102
+ subtitle: item.summary || item.biography,
103
+ id: item.id,
104
+ type: key,
105
+ }))
106
+ )
107
+ }
108
+ acc.push({ type: "divider" })
109
+ return acc
110
+ }, [])) ||
111
+ {}
112
+
113
+ return rst
114
+ })
115
+ const search = computed({
116
+ get() {
117
+ return props.type === "all" ? rootStore.search : $stores[props.type].search
118
+ },
119
+ set: await useDebounceFn(async function (v) {
120
+ await rootStore.updateSearch({
121
+ type: props.type,
122
+ search: v || "",
123
+ lang: locale.value,
124
+ })
125
+ }, 300),
126
+ })
127
+ </script>
128
+
129
+ <style lang="scss" scoped></style>
@@ -0,0 +1,59 @@
1
+ <template>
2
+ <v-list-item :to="localePath(getPath(item.id))" class="search-item py-2">
3
+ <template v-slot:item :key="index.toString() + item.id"></template>
4
+ <template v-slot:prepend v-if="item.prependAvatar">
5
+ <v-avatar rounded="0" :image="item.prependAvatar"> </v-avatar>
6
+ </template>
7
+ <template v-slot:title>
8
+ <div v-html="item.title" class="text-black black-text"></div>
9
+ </template>
10
+ <template v-slot:subtitle>
11
+ <div v-html="item.subtitle" class="text-black black-text"></div>
12
+ </template>
13
+ <template v-slot:append>
14
+ <v-btn
15
+ icon="mdi-open-in-new"
16
+ variant="text"
17
+ :to="localePath(getPath(item.id))"
18
+ target="_blank"
19
+ ></v-btn>
20
+ </template>
21
+ </v-list-item>
22
+ </template>
23
+ <script setup>
24
+ // import { useDisplay } from "vuetify"
25
+ // const { smAndUp } = useDisplay()
26
+ const localePath = useLocalePath()
27
+ const props = defineProps({
28
+ item: {
29
+ type: Object,
30
+ required: true,
31
+ },
32
+ type: {
33
+ type: String,
34
+ required: true,
35
+ },
36
+ index: {
37
+ type: Number,
38
+ required: true,
39
+ },
40
+ })
41
+ const getPath = (id) => {
42
+ switch (props.item.type) {
43
+ case "projects":
44
+ return "/activities/projects/" + id
45
+ case "publications":
46
+ return "/activities/publications/" + id
47
+ case "fellowship":
48
+ return "/activities/fellowships/" + id
49
+ default:
50
+ return `/${props.type}/${id}`
51
+ }
52
+ }
53
+ </script>
54
+ <style lang="scss">
55
+ .search-item {
56
+ align-items: center;
57
+ height: 100%;
58
+ }
59
+ </style>
@@ -0,0 +1,161 @@
1
+ <template>
2
+ <div class="mt-4 font-weight-light">
3
+ <template
4
+ v-if="
5
+ (!$stores[type].search || $stores[type].search.length === 0) &&
6
+ $stores[type].filtersCount === 0
7
+ "
8
+ >
9
+ {{
10
+ feminine
11
+ ? $t(
12
+ "list.0-items-found-f",
13
+ [
14
+ $stores[type].total,
15
+ $t("items." + props.type, $stores[type].total),
16
+ ],
17
+ $stores[type].total
18
+ )
19
+ : $t(
20
+ "list.0-items-found",
21
+ [
22
+ $stores[type].total,
23
+ $t("items." + props.type, $stores[type].total),
24
+ ],
25
+ $stores[type].total
26
+ )
27
+ }}
28
+ </template>
29
+ <!-- searching for "XXX" -->
30
+ <template
31
+ v-else-if="
32
+ !(!$stores[type].search || $stores[type].search.length === 0) &&
33
+ $stores[type].filtersCount === 0
34
+ "
35
+ >{{
36
+ feminine
37
+ ? $t(
38
+ "list.0-items-found-searching-for-f",
39
+ [
40
+ $stores[type].total,
41
+ $t(
42
+ "items." + props.type,
43
+ $stores[type].total,
44
+ $stores[type].total
45
+ ),
46
+ $stores[type].search,
47
+ ],
48
+ $stores[type].total
49
+ )
50
+ : $t(
51
+ "list.0-items-found-searching-for",
52
+ [
53
+ $stores[type].total,
54
+ $t(
55
+ "items." + props.type,
56
+ $stores[type].total,
57
+ $stores[type].total
58
+ ),
59
+ $stores[type].search,
60
+ ],
61
+ $stores[type].total
62
+ )
63
+ }}</template
64
+ >
65
+ <!-- with X filters -->
66
+ <template
67
+ v-else-if="
68
+ (!$stores[type].search || $stores[type].search.length === 0) &&
69
+ $stores[type][props.type].filtersCount > 0
70
+ "
71
+ >{{
72
+ feminine
73
+ ? $t(
74
+ "list.0-items-found-with-1-filter-f",
75
+ [
76
+ $stores[type].total,
77
+ $t(
78
+ "items." + props.type,
79
+ $stores[type].total,
80
+ $stores[type].total
81
+ ),
82
+ $stores[type].filtersCount,
83
+ $t("filters", $stores[type].filtersCount),
84
+ ],
85
+ $stores[type].total
86
+ )
87
+ : $t(
88
+ "list.0-items-found-with-1-filter",
89
+ [
90
+ $stores[type].total,
91
+ $t(
92
+ "items." + props.type,
93
+ $stores[type].total,
94
+ $stores[type].total
95
+ ),
96
+ $stores[type].filtersCount,
97
+ $t("filters", $stores[type].filtersCount),
98
+ ],
99
+ $stores[type].total
100
+ )
101
+ }}</template
102
+ >
103
+ <!-- searching for "XXX" with Y filters -->
104
+ <template
105
+ v-else-if="
106
+ $stores[type].search &&
107
+ $stores[type].search.length &&
108
+ $stores[type].filtersCount > 0
109
+ "
110
+ >{{
111
+ feminine
112
+ ? $t(
113
+ "list.0-items-found-searching-for-with-1-filter-f",
114
+ [
115
+ $stores[type].total,
116
+ $t("items." + props.type, $stores[type].total),
117
+ $stores[type].search,
118
+ $stores[type].filtersCount,
119
+ $t("filters", $stores[type].filtersCount),
120
+ ],
121
+ $stores[type].total
122
+ )
123
+ : $t(
124
+ "list.0-items-found-searching-for-with-1-filter",
125
+ [
126
+ $stores[type].total,
127
+ $t("items." + props.type, $stores[type].total),
128
+ $stores[type].search,
129
+ $stores[type].filtersCount,
130
+ $t("filters", $stores[type].filtersCount),
131
+ ],
132
+ $stores[type].total
133
+ )
134
+ }}</template
135
+ >
136
+ <template v-if="$stores[type].numberOfPages > 1">
137
+ <!-- // Page X of Y -->
138
+ {{
139
+ $t("list.page-0-of-1", [
140
+ $stores[type].page || 1,
141
+ $stores[type].numberOfPages || 1,
142
+ ])
143
+ }}</template
144
+ >
145
+ <!-- X items per page -->
146
+ <!-- displayed by X -->
147
+ <!-- and sorted by X -->
148
+ </div>
149
+ </template>
150
+ <script setup>
151
+ const { $stores } = useNuxtApp()
152
+ const props = defineProps({
153
+ type: {
154
+ type: String,
155
+ required: true,
156
+ },
157
+ })
158
+ const feminine = ref(["news", "publications", "people"].includes(props.type))
159
+ </script>
160
+
161
+ <style lang="scss" scoped></style>
@@ -0,0 +1,97 @@
1
+ <template>
2
+ <v-menu>
3
+ <template #activator="{ props: menu }">
4
+ <v-tooltip location="top">
5
+ <template #activator="{ props: tooltip }">
6
+ <v-btn
7
+ x-large
8
+ outlined
9
+ tile
10
+ flat
11
+ icon
12
+ :class="{
13
+ 'mt-3': isXsDisplay,
14
+ }"
15
+ v-bind="mergeProps(menu, tooltip)"
16
+ >
17
+ <v-icon>mdi-{{ current?.icon || defaultSort?.icon }}</v-icon>
18
+ </v-btn>
19
+ </template>
20
+ <div
21
+ v-html="
22
+ $t('list.sort-mode') +
23
+ $t('list.' + current.text || defaultSort.text)
24
+ "
25
+ />
26
+ </v-tooltip>
27
+ </template>
28
+ <v-list density="compact">
29
+ <template v-for="(item, index) in items">
30
+ <v-list-item
31
+ v-if="item.text !== current.text"
32
+ :key="index"
33
+ @click="updateSort(item.value)"
34
+ >
35
+ <template #prepend>
36
+ <v-icon>mdi-{{ item.icon }}</v-icon>
37
+ </template>
38
+ <v-list-item-title>{{ $t("list." + item.text) }}</v-list-item-title>
39
+ </v-list-item></template
40
+ >
41
+ </v-list>
42
+ </v-menu>
43
+ </template>
44
+
45
+ <script setup>
46
+ import { useRootStore } from "../../../stores/root"
47
+ import { mergeProps } from "vue"
48
+ import { useDisplay } from "vuetify"
49
+ const { $stores } = useNuxtApp()
50
+ const { xs: isXsDisplay } = useDisplay()
51
+
52
+ const rootStore = useRootStore()
53
+
54
+ const props = defineProps({
55
+ type: {
56
+ type: String,
57
+ default: "articles",
58
+ required: true,
59
+ },
60
+ })
61
+ const items = ref($stores[props.type].sort)
62
+ const defaultSort = ref(
63
+ $stores[props.type].sort[
64
+ Object.keys($stores[props.type].sort).find(
65
+ (item) => $stores[props.type].sort[item].default === true
66
+ )
67
+ ]
68
+ )
69
+
70
+ const current = computed(() => {
71
+ try {
72
+ return $stores[props.type].sort[
73
+ Object.keys($stores[props.type].sort).find((item) => {
74
+ return (
75
+ $stores[props.type].sort[item].value[0] ===
76
+ $stores[props.type].sortBy[0] &&
77
+ $stores[props.type].sort[item].value[1] ===
78
+ $stores[props.type].sortDesc[0]
79
+ )
80
+ })
81
+ ]
82
+ } catch (error) {
83
+ console.log("error: ", error)
84
+ return items[Object.keys(items).find((item) => item.default)]
85
+ }
86
+ })
87
+
88
+ const updateSort = async (value) => {
89
+ await rootStore.updateSort({ value, type: props.type })
90
+ }
91
+
92
+ onMounted(() => {
93
+ // Add any logic needed on component mount
94
+ })
95
+ </script>
96
+
97
+ <style lang="scss"></style>