@paris-ias/list 1.0.4 → 1.0.7

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/dist/module.ts +119 -0
  2. package/dist/runtime/components/events/Badges.vue +73 -0
  3. package/dist/runtime/components/events/DateTimePlace.vue +77 -0
  4. package/dist/runtime/components/events/DenseItem.vue +40 -0
  5. package/dist/runtime/components/events/ExpandedItem.vue +11 -0
  6. package/dist/runtime/components/events/ListContainer.vue +41 -0
  7. package/dist/runtime/components/events/RegisterModal.vue +51 -0
  8. package/dist/runtime/components/events/RelatedItem.vue +44 -0
  9. package/dist/runtime/components/events/RowsItem.vue +114 -0
  10. package/dist/runtime/components/events/View.vue +333 -0
  11. package/dist/runtime/components/fellowships/Badges.vue +48 -0
  12. package/dist/runtime/components/fellowships/DenseItem.vue +39 -0
  13. package/dist/runtime/components/fellowships/ExpandedItem.vue +7 -0
  14. package/dist/runtime/components/fellowships/RegisterModal.vue +41 -0
  15. package/dist/runtime/components/fellowships/RowsItem.vue +61 -0
  16. package/dist/runtime/components/fellowships/View.vue +210 -0
  17. package/dist/runtime/components/list/atoms/FiltersMenu.vue +46 -0
  18. package/dist/runtime/components/list/atoms/SearchInput.vue +129 -0
  19. package/dist/runtime/components/list/atoms/SearchItem.vue +59 -0
  20. package/dist/runtime/components/list/atoms/SearchString.vue +161 -0
  21. package/dist/runtime/components/list/atoms/SortMenu.vue +97 -0
  22. package/dist/runtime/components/list/atoms/ViewMenu.vue +71 -0
  23. package/dist/runtime/components/list/inputs/AutoComplete.vue +22 -0
  24. package/dist/runtime/components/list/inputs/BooleanSwitch.vue +18 -0
  25. package/dist/runtime/components/list/inputs/Checkbox.vue +21 -0
  26. package/dist/runtime/components/list/inputs/Select.vue +25 -0
  27. package/dist/runtime/components/list/molecules/Filters.vue +97 -0
  28. package/dist/runtime/components/list/molecules/Header.vue +47 -0
  29. package/dist/runtime/components/list/molecules/Pagination.vue +243 -0
  30. package/dist/runtime/components/list/organisms/List.vue +92 -0
  31. package/dist/runtime/components/list/views/Dense.vue +25 -0
  32. package/dist/runtime/components/list/views/Expanded.vue +10 -0
  33. package/dist/runtime/components/list/views/Grid.vue +13 -0
  34. package/dist/runtime/components/list/views/Rows.vue +13 -0
  35. package/dist/runtime/components/list/views/Table.vue +13 -0
  36. package/dist/runtime/components/misc/atoms/CountUp.vue +198 -0
  37. package/dist/runtime/components/misc/atoms/DateStamp.vue +104 -0
  38. package/dist/runtime/components/misc/atoms/ImageContainer.vue +105 -0
  39. package/dist/runtime/components/misc/atoms/ShareMenu.vue +60 -0
  40. package/dist/runtime/components/misc/atoms/Socials.vue +127 -0
  41. package/dist/runtime/components/misc/molecules/ChipContainer.vue +35 -0
  42. package/dist/runtime/components/misc/molecules/Related.vue +41 -0
  43. package/dist/runtime/components/misc/molecules/RelatedItems.vue +29 -0
  44. package/dist/runtime/components/misc/molecules/SearchItem.vue +26 -0
  45. package/dist/runtime/components/news/DenseItem.vue +62 -0
  46. package/dist/runtime/components/news/ExpandedItem.vue +153 -0
  47. package/dist/runtime/components/news/Header.vue +9 -0
  48. package/dist/runtime/components/news/RelatedItem.vue +44 -0
  49. package/dist/runtime/components/news/RowsItem.vue +160 -0
  50. package/dist/runtime/components/news/View.vue +190 -0
  51. package/dist/runtime/components/people/DenseItem.vue +37 -0
  52. package/dist/runtime/components/people/ExpandedItem.vue +16 -0
  53. package/dist/runtime/components/people/GroupBadges.vue +56 -0
  54. package/dist/runtime/components/people/RelatedItem.vue +41 -0
  55. package/dist/runtime/components/people/RowsItem.vue +95 -0
  56. package/dist/runtime/components/people/View.vue +162 -0
  57. package/dist/runtime/components/projects/ExpandedItem.vue +14 -0
  58. package/dist/runtime/components/projects/RelatedItem.vue +44 -0
  59. package/dist/runtime/components/projects/RowsItem.vue +106 -0
  60. package/dist/runtime/components/projects/View.vue +131 -0
  61. package/dist/runtime/components/publications/RelatedItem.vue +44 -0
  62. package/dist/runtime/components/publications/RowsItem.vue +105 -0
  63. package/dist/runtime/components/publications/View.vue +139 -0
  64. package/dist/runtime/composables/useFetchItem.ts +64 -0
  65. package/dist/runtime/composables/useIcons.ts +30 -0
  66. package/dist/runtime/composables/useUtils.ts +75 -0
  67. package/dist/runtime/graphql/queries/buildFiltersValues.gql +35 -0
  68. package/dist/runtime/graphql/queries/item/action.gql +0 -0
  69. package/dist/runtime/graphql/queries/item/apps.gql +0 -0
  70. package/dist/runtime/graphql/queries/item/events.gql +120 -0
  71. package/dist/runtime/graphql/queries/item/fellowships.gql +164 -0
  72. package/dist/runtime/graphql/queries/item/news.gql +129 -0
  73. package/dist/runtime/graphql/queries/item/people.gql +174 -0
  74. package/dist/runtime/graphql/queries/item/projects.gql +171 -0
  75. package/dist/runtime/graphql/queries/item/publications.gql +169 -0
  76. package/dist/runtime/graphql/queries/item/users.gql +0 -0
  77. package/dist/runtime/graphql/queries/list/action.gql +0 -0
  78. package/dist/runtime/graphql/queries/list/apps.gql +32 -0
  79. package/dist/runtime/graphql/queries/list/events.gql +44 -0
  80. package/dist/runtime/graphql/queries/list/fellowships.gql +53 -0
  81. package/dist/runtime/graphql/queries/list/news.gql +39 -0
  82. package/dist/runtime/graphql/queries/list/people.gql +49 -0
  83. package/dist/runtime/graphql/queries/list/projects.gql +37 -0
  84. package/dist/runtime/graphql/queries/list/publications.gql +37 -0
  85. package/dist/runtime/graphql/queries/list/search.gql +148 -0
  86. package/dist/runtime/graphql/queries/list/users.gql +32 -0
  87. package/dist/runtime/graphql/queries/login.gql +0 -0
  88. package/dist/runtime/plugins/pinia.ts +88 -0
  89. package/dist/runtime/plugins/vuetify.js +21 -0
  90. package/dist/runtime/stores/factory.ts +18 -0
  91. package/dist/runtime/stores/root.ts +353 -0
  92. package/dist/runtime/translations/en.json +436 -0
  93. package/dist/runtime/translations/fr.json +429 -0
  94. package/dist/runtime/types/imports.d.ts +13 -0
  95. package/dist/runtime/types/stores.d.ts +11 -0
  96. package/example/.env.example +3 -0
  97. package/example/nuxt.config.ts +19 -0
  98. package/example/pages/index.vue +27 -0
  99. package/package.json +8 -17
@@ -0,0 +1,131 @@
1
+ <template>
2
+ <!-- {{ name }} -->
3
+ <v-row justify="center">
4
+ <v-col cols="12" sm="11" md="8" lg="8" xl="6">
5
+ <v-row class="justify-center">
6
+ <v-col cols="12" sm="10" md="6" lg="4" xl="3" class="text-center">
7
+ <!-- PROJECT IMAGE -->
8
+ <v-skeleton-loader v-if="loading" height="100%" type="image" />
9
+
10
+ <MiscAtomsImageContainer
11
+ v-else
12
+ contain
13
+ :loading="loading"
14
+ :src="item.image.url ? item.image : '/default.png'"
15
+ :ratio="1 / 1"
16
+ />
17
+ </v-col>
18
+ </v-row>
19
+ <v-skeleton-loader
20
+ v-if="loading"
21
+ :type="
22
+ [
23
+ 'avatar, paragraph',
24
+ 'avatar, paragraph',
25
+ 'heading, ossein, avatar, text, ossein, chip@3',
26
+ 'heading, ossein, avatar, text, ossein, chip@3',
27
+ 'heading, ossein, avatar, text, ossein, chip@3',
28
+ 'heading',
29
+ ][['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].indexOf(name || 'md')]
30
+ "
31
+ />
32
+
33
+ <div v-else class="d-flex align-center flex-column mt-12">
34
+ <div class="d-flex text-center text-wrap text-h3 text-black">
35
+ {{ item.name }}
36
+ </div>
37
+ <v-divider width="154px" class="mb-1 mt-6" />
38
+ <v-divider width="154px" />
39
+ <div
40
+ v-if="!loading"
41
+ class="d-flex text-center text-wrap text-h5 text-black mt-6"
42
+ >
43
+ <MDC v-if="item.subtitle" :value="item.subtitle" />
44
+ </div>
45
+ <MiscMoleculesChipContainer
46
+ v-if="item && item.tags"
47
+ :items="item.tags"
48
+ class="py-6 mt-4 align-self-center"
49
+ />
50
+ <v-btn-toggle variant="outlined">
51
+ <MiscAtomsShareMenu :item class="mt-6" />
52
+ </v-btn-toggle>
53
+ <v-btn
54
+ v-if="item.url"
55
+ class="my-6 d-flex"
56
+ variant="outlined"
57
+ :href="item.url"
58
+ target="_blank"
59
+ prepend-icon="mdi-link"
60
+ >
61
+ {{ $t("visit-this-project-website") }}
62
+ </v-btn>
63
+ </div>
64
+
65
+ <!-- DIVIDERS -->
66
+ <v-responsive class="mx-auto my-9" width="120">
67
+ <v-divider class="mb-1" />
68
+ <v-divider />
69
+ </v-responsive>
70
+
71
+ <!-- PROJECT DESCRIPTION -->
72
+ <v-skeleton-loader
73
+ v-if="loading"
74
+ :type="
75
+ ['text@50', 'text@50', 'text@50', 'text@50', 'text@50', 'text@50'][
76
+ ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].indexOf(name || 'md')
77
+ ]
78
+ "
79
+ />
80
+ <MDC
81
+ v-if="item.description"
82
+ :value="item.description"
83
+ class="mt-md-n2 mx-10 mx-md-0"
84
+ />
85
+ </v-col>
86
+ </v-row>
87
+
88
+ <!-- DIVIDERS -->
89
+ <v-responsive class="mx-auto my-9" width="120">
90
+ <v-divider class="mb-1" />
91
+ <v-divider />
92
+ </v-responsive>
93
+ <!-- <MiscAtomsSlidingCarousel
94
+ v-if="item && item.gallery && item.gallery.length"
95
+ ref="MiscAtomsImage"
96
+ key="MiscAtomsImage"
97
+ :items="item.gallery"
98
+ type="MiscAtomsImage"
99
+ :loading="false"
100
+ :more="false"
101
+ >
102
+ <div :class="mdAndUp ? 'text-h5' : 'text-h6'">
103
+ {{ $t("gallery") }}
104
+ </div>
105
+ </MiscAtomsSlidingCarousel> -->
106
+ <!-- DIVIDERS -->
107
+ <v-responsive class="mx-auto my-9" width="120">
108
+ <v-divider class="mb-1" />
109
+ <v-divider />
110
+ </v-responsive>
111
+
112
+ <MiscMoleculesRelated v-if="item && item.related" :related="item.related" />
113
+ </template>
114
+
115
+ <script setup>
116
+ import { useDisplay } from "vuetify"
117
+ const { $stores } = useNuxtApp()
118
+ const { name } = useDisplay()
119
+ const props = defineProps({
120
+ item: {
121
+ type: Object,
122
+ required: true,
123
+ },
124
+ loading: {
125
+ type: Boolean,
126
+ required: false,
127
+ default: false,
128
+ },
129
+ })
130
+ $stores.projects.loading = false
131
+ </script>
@@ -0,0 +1,44 @@
1
+ <template>
2
+ <v-sheet
3
+ :to="
4
+ localePath({
5
+ name: 'activities-publicationss-slug',
6
+ params: { slug: item.name },
7
+ })
8
+ "
9
+ >
10
+ <v-row>
11
+ <v-col v-if="lgAndUp" cols="3">
12
+ <MiscAtomsImageContainer
13
+ contain
14
+ :src="item.image"
15
+ :loading="rootStore.loading"
16
+ :ratio="1 / 1"
17
+ :link="item.name"
18
+ name="activities-publicationss-slug"
19
+ />
20
+ </v-col>
21
+ <v-col cols="12" lg="9">
22
+ <v-skeleton-loader v-if="rootStore.loading" type="heading, text@3" />
23
+ <template v-else>
24
+ <div class="text-h6">
25
+ {{ item.name }}
26
+ </div>
27
+ <div class="text-body-1">
28
+ {{ item.shortDescription }}
29
+ </div>
30
+ </template>
31
+ </v-col>
32
+ </v-row>
33
+ </v-sheet>
34
+ </template>
35
+
36
+ <script setup>
37
+ import { useDisplay } from "vuetify"
38
+ import { useRootStore } from "../../stores/root"
39
+ const localePath = useLocalePath()
40
+ const rootStore = useRootStore()
41
+ const { lgAndUp } = useDisplay()
42
+
43
+ const props = defineProps({ item: { type: Object, required: true } })
44
+ </script>
@@ -0,0 +1,105 @@
1
+ <template>
2
+ <v-col v-ripple cols="12" sm="6" md="4" lg="3" xl="2">
3
+ <MiscAtomsImageContainer
4
+ contain
5
+ :src="item.image.url ? item.image : '/default.png'"
6
+ :loading="$stores.publications.loading"
7
+ :ratio="1 / 1"
8
+ :title="item.name"
9
+ link="activities-publications-slug"
10
+ :slug="item.slug[locale]"
11
+ />
12
+ </v-col>
13
+ <v-col
14
+ v-ripple
15
+ cols="12"
16
+ sm="6"
17
+ md="8"
18
+ lg="9"
19
+ xl="10"
20
+ class="px-6 cursor-pointer"
21
+ @click="
22
+ router.push(localePath('/activities/publications/' + item.slug[locale]))
23
+ "
24
+ >
25
+ <div>
26
+ <v-skeleton-loader
27
+ v-if="$stores.publications.loading"
28
+ type="heading,ossein,text@8,ossein,button,button"
29
+ />
30
+
31
+ <template v-else>
32
+ <div class="text-h5 text-sm-h3 text-md-h4 text-md-h4 my-6">
33
+ {{ item.name }}
34
+ </div>
35
+
36
+ <MDC
37
+ v-if="item.summary"
38
+ :value="item.summary"
39
+ class="text-wrap clamped-text"
40
+ :style="
41
+ '-webkit-line-clamp:' +
42
+ [5, 5, 5, 10, 12, 14][
43
+ ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].indexOf(name || 'md')
44
+ ]
45
+ "
46
+ />
47
+ <v-btn
48
+ class="mt-4"
49
+ variant="outlined"
50
+ tile
51
+ :to="
52
+ localePath({
53
+ name: 'publications-slug',
54
+ params: { slug: item.slug[locale] },
55
+ })
56
+ "
57
+ :size="
58
+ ['small', 'small', 'small', 'default', 'default', 'large'][
59
+ ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].indexOf(name || 'md')
60
+ ]
61
+ "
62
+ >
63
+ {{ $t("read-more") }}
64
+ </v-btn>
65
+ <v-btn
66
+ v-if="item.url"
67
+ variant="outlined"
68
+ tile
69
+ target="_blank"
70
+ :href="item.url"
71
+ class="mt-4 ml-4"
72
+ prepend-icon="mdi-web"
73
+ :size="
74
+ ['small', 'small', 'small', 'default', 'default', 'large'][
75
+ ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].indexOf(name || 'md')
76
+ ]
77
+ "
78
+ >{{ $t("visit-the-publications-website") }}</v-btn
79
+ >
80
+ ></template
81
+ >
82
+ </div>
83
+ </v-col>
84
+ <v-divider />
85
+ </template>
86
+
87
+ <script setup>
88
+ import { useDisplay } from "vuetify"
89
+ const { name } = useDisplay()
90
+ const { locale } = useI18n()
91
+ const { $stores } = useNuxtApp()
92
+ const router = useRouter()
93
+ const localePath = useLocalePath()
94
+ const props = defineProps({
95
+ item: {
96
+ type: Object,
97
+ default: () => {
98
+ return {}
99
+ },
100
+ required: true,
101
+ },
102
+ })
103
+ </script>
104
+
105
+ <style lang="scss"></style>
@@ -0,0 +1,139 @@
1
+ <template>
2
+ <!-- {{ name }} -->
3
+ <v-row justify="center">
4
+ <v-col cols="12" sm="11" md="8" lg="8" xl="6">
5
+ <v-row class="justify-center">
6
+ <v-col cols="12" sm="10" md="6" lg="4" xl="3" class="text-center">
7
+ <!-- PUBLICATIONS IMAGE -->
8
+
9
+ <v-skeleton-loader v-if="loading" height="100%" type="image" />
10
+
11
+ <MiscAtomsImageContainer
12
+ v-else
13
+ contain
14
+ :loading="$stores.publications.loading"
15
+ :src="item.image.url ? item.image : '/default.png'"
16
+ :ratio="1 / 1"
17
+ />
18
+ </v-col>
19
+ </v-row>
20
+ <v-skeleton-loader
21
+ v-if="loading"
22
+ :type="
23
+ [
24
+ 'avatar, paragraph',
25
+ 'avatar, paragraph',
26
+ 'heading, ossein, avatar, text, ossein, chip@3',
27
+ 'heading, ossein, avatar, text, ossein, chip@3',
28
+ 'heading, ossein, avatar, text, ossein, chip@3',
29
+ 'heading',
30
+ ][['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].indexOf(name || 'md')]
31
+ "
32
+ />
33
+
34
+ <div v-else class="d-flex align-center flex-column mt-12">
35
+ <div class="d-flex text-center text-wrap text-h3 text-black">
36
+ {{ item.name }}
37
+ </div>
38
+ <v-divider width="154px" class="mb-1 mt-6" />
39
+ <v-divider width="154px" />
40
+ <div class="overline my-2">
41
+ {{ formatDateValue(item.date, locale) }}
42
+ </div>
43
+ <MiscMoleculesChipContainer
44
+ v-if="item.tags && item.tags.length"
45
+ :items="item.tags"
46
+ class="py-6 mt-4 align-self-center"
47
+ />
48
+ <v-btn-toggle variant="outlined">
49
+ <MiscAtomsShareMenu :item class="mt-6" />
50
+ <v-btn
51
+ v-if="item.url"
52
+ class="my-6 d-flex"
53
+ variant="outlined"
54
+ :href="item.url"
55
+ target="_blank"
56
+ prepend-icon="mdi-link"
57
+ >
58
+ {{ $t("visit-this-publications-website") }}
59
+ </v-btn>
60
+ </v-btn-toggle>
61
+ </div>
62
+
63
+ <!-- DIVIDERS -->
64
+ <v-responsive class="mx-auto my-9" width="120">
65
+ <v-divider class="mb-1" />
66
+ <v-divider />
67
+ </v-responsive>
68
+
69
+ <!-- PUBLICATIONS DESCRIPTION -->
70
+ <v-skeleton-loader
71
+ v-if="loading"
72
+ :type="
73
+ ['text@50', 'text@50', 'text@50', 'text@50', 'text@50', 'text@50'][
74
+ ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].indexOf(name || 'md')
75
+ ]
76
+ "
77
+ />
78
+ <MDC
79
+ v-if="item.description"
80
+ :value="item.description"
81
+ class="mt-md-n2 mx-10 mx-md-0"
82
+ />
83
+ </v-col>
84
+ </v-row>
85
+
86
+ <!-- DIVIDERS -->
87
+ <v-responsive class="mx-auto my-9" width="120">
88
+ <v-divider class="mb-1" />
89
+ <v-divider />
90
+ </v-responsive>
91
+ <!-- <MiscAtomsSlidingCarousel
92
+ v-if="item && item.gallery && item.gallery.length"
93
+ ref="MiscAtomsImage"
94
+ key="MiscAtomsImage"
95
+ :items="item.gallery"
96
+ type="MiscAtomsImage"
97
+ :loading="false"
98
+ :more="false"
99
+ >
100
+ <div :class="mdAndUp ? 'text-h5' : 'text-h6'">
101
+ {{ $t("gallery") }}
102
+ </div>
103
+ </MiscAtomsSlidingCarousel> -->
104
+ <!-- DIVIDERS -->
105
+ <v-responsive class="mx-auto my-9" width="120">
106
+ <v-divider class="mb-1" />
107
+ <v-divider />
108
+ </v-responsive>
109
+
110
+ <MiscMoleculesRelated
111
+ v-if="!loading && item && item.related"
112
+ :related="item.related"
113
+ />
114
+ </template>
115
+
116
+ <script setup>
117
+ import { useDisplay } from "vuetify"
118
+ const { $stores } = useNuxtApp()
119
+ const { name } = useDisplay()
120
+ const { locale } = useI18n()
121
+ const props = defineProps({
122
+ item: {
123
+ type: Object,
124
+ required: true,
125
+ },
126
+ loading: {
127
+ type: Boolean,
128
+ required: false,
129
+ default: false,
130
+ },
131
+ })
132
+
133
+ /* const { data: action } = await useAsyncData("actions", () =>
134
+ queryContent("/actions/" + locale.value)
135
+ .limit(1)
136
+ .find()
137
+ ) */
138
+ $stores.publications.loading = false
139
+ </script>
@@ -0,0 +1,64 @@
1
+ import { useRoute } from "vue-router"
2
+ export const useFetchItem = () => {
3
+ const fetchItem = async <T>(payload: {
4
+ query: string
5
+ key: string
6
+ }): Promise<T> => {
7
+ try {
8
+ const { locale } = useI18n()
9
+ const route = useRoute()
10
+
11
+ const variables = {
12
+ itemId: route.params.slug?.toString().trim(),
13
+ appId: "iea",
14
+ lang: locale.value,
15
+ }
16
+ const { data, error } = await useAsyncQuery(payload.query, variables)
17
+ /* console.log("variables: ", variables) */
18
+
19
+ if (error.value) {
20
+ console.error("GraphQL error:", error.value)
21
+ throw error.value
22
+ }
23
+
24
+ const item = data?.value[payload.key]
25
+ /* console.log("item: ", item) */
26
+
27
+ if (!item) {
28
+ throw createError({
29
+ statusCode: 404,
30
+ message: "Item not found in response",
31
+ })
32
+ }
33
+ // Update the slug in the i18n params
34
+ // for people, the slug is the same in both languages
35
+ // for other items, the slug is different in each language
36
+ const setI18nParams = useSetI18nParams()
37
+ if (!route.name.includes("people")) {
38
+ /* console.log("update params") */
39
+ setI18nParams({
40
+ en: { slug: item.slug.en },
41
+ fr: { slug: item.slug.fr },
42
+ })
43
+ } else {
44
+ // for people, the slug is the same in both languages
45
+ setI18nParams({
46
+ en: { slug: item.slug },
47
+ fr: { slug: item.slug },
48
+ })
49
+ }
50
+ return item as T
51
+ } catch (error) {
52
+ console.error("Error fetching item:", error)
53
+ throw createError({
54
+ statusCode: 404,
55
+ message: "Item not found",
56
+ cause: error,
57
+ })
58
+ }
59
+ }
60
+
61
+ return {
62
+ fetchItem,
63
+ }
64
+ }
@@ -0,0 +1,30 @@
1
+ export default function getFileIcon(fileName: string): string {
2
+ console.log("fileName: ", fileName)
3
+ const fileExtension = fileName.split(".").pop()
4
+ console.log("fileExtension: ", fileExtension)
5
+ switch (fileExtension) {
6
+ case "pdf":
7
+ return "mdi-file-pdf-box"
8
+ case "doc":
9
+ case "docx":
10
+ return "mdi-file-word"
11
+ case "xls":
12
+ case "xlsx":
13
+ return "mdi-file-excel"
14
+ case "ppt":
15
+ case "pptx":
16
+ return "mdi-file-powerpoint"
17
+ case "jpg":
18
+ case "jpeg":
19
+ case "png":
20
+ case "gif":
21
+ return "mdi-file-image"
22
+ case "zip":
23
+ case "rar":
24
+ return "mdi-folder-zip"
25
+ case "txt":
26
+ return "mdi-file-document"
27
+ default:
28
+ return "mdi-file"
29
+ }
30
+ }
@@ -0,0 +1,75 @@
1
+ export const formatDate = (dateStr: string, locale: string): string => {
2
+ const date = new Date(dateStr)
3
+ return date.toLocaleDateString(locale, {
4
+ weekday: "long",
5
+ year: "numeric",
6
+ month: "long",
7
+ day: "numeric",
8
+ })
9
+ }
10
+
11
+ export const getLocalizedDate = (dateIso: string): string => {
12
+ const { $i18n } = useNuxtApp()
13
+ return new Date(dateIso).toLocaleDateString(
14
+ $i18n.localeProperties.value.language,
15
+ {
16
+ weekday: "long",
17
+ year: "numeric",
18
+ month: "long",
19
+ day: "numeric",
20
+ }
21
+ )
22
+ }
23
+
24
+ export const getDetailedFormatedDate = (
25
+ dateStr: string,
26
+ locale: string
27
+ ): {
28
+ day: number
29
+ month: string
30
+ year: number
31
+ hours: number
32
+ minutes: number
33
+ } => {
34
+ const date = new Date(dateStr)
35
+
36
+ return {
37
+ day: date.getDate(),
38
+ month: date.toLocaleString(locale, { month: "long" }),
39
+ year: date.getFullYear(),
40
+ hours: date.getUTCHours(),
41
+ minutes: date.getMinutes(),
42
+ }
43
+ }
44
+
45
+ export const capitalize = (value: string, multiple?: boolean) =>
46
+ multiple
47
+ ? value.replace(/(?:^|[\s'-])\S/g, (a) => a.toUpperCase())
48
+ : value && value.charAt(0).toUpperCase() + value.slice(1)
49
+
50
+ export const slugify = (str: string) => {
51
+ str = str.replace(/^\s+|\s+$/g, "").trim() // trim
52
+ str = str.toLowerCase()
53
+
54
+ // remove accents, swap ñ for n, etc
55
+ const from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;"
56
+ const to = "aaaaeeeeiiiioooouuuunc------"
57
+ for (let i = 0, l = from.length; i < l; i++) {
58
+ str = str.replace(new RegExp(from.charAt(i), "g"), to.charAt(i))
59
+ }
60
+
61
+ str = str
62
+ .replace(/[^a-z0-9 -]/g, "") // remove invalid chars
63
+ .replace(/\s+/g, "-") // collapse whitespace and replace by -
64
+ .replace(/-+/g, "-") // collapse dashes
65
+
66
+ return str
67
+ }
68
+
69
+ export const formatDateValue = (
70
+ date: string | Date,
71
+ locale: string
72
+ ): string => {
73
+ const formattedDate = new Date(date)
74
+ return formattedDate.toLocaleDateString(locale)
75
+ }
@@ -0,0 +1,35 @@
1
+ query buildFiltersValues {
2
+ buildFiltersValues {
3
+ events {
4
+ disciplines
5
+ fellowships
6
+ tags
7
+ category
8
+ }
9
+ fellowships {
10
+ affiliations
11
+ disciplines
12
+ tags
13
+ }
14
+ news {
15
+ category
16
+ tags
17
+ }
18
+ people {
19
+ disciplines
20
+ fellowships
21
+ members
22
+ vintage
23
+ }
24
+ projects {
25
+ tags
26
+ }
27
+ publications {
28
+ affiliations
29
+ disciplines
30
+ eventCategory
31
+ tags
32
+ type
33
+ }
34
+ }
35
+ }
File without changes
File without changes