@paris-ias/list 1.0.11 → 1.0.14

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 (89) hide show
  1. package/README.md +71 -51
  2. package/dist/module.d.mts +8 -0
  3. package/dist/module.json +9 -0
  4. package/dist/module.mjs +64 -0
  5. package/dist/runtime/components/events/Badges.vue +5 -7
  6. package/dist/runtime/components/events/DateTimePlace.vue +11 -13
  7. package/dist/runtime/components/events/DenseItem.vue +7 -6
  8. package/dist/runtime/components/events/ExpandedItem.vue +3 -5
  9. package/dist/runtime/components/events/ListContainer.vue +6 -6
  10. package/dist/runtime/components/events/RegisterModal.vue +4 -5
  11. package/dist/runtime/components/events/RelatedItem.vue +6 -7
  12. package/dist/runtime/components/events/RowsItem.vue +12 -11
  13. package/dist/runtime/components/events/View.vue +10 -13
  14. package/dist/runtime/components/fellowships/Badges.vue +12 -15
  15. package/dist/runtime/components/fellowships/DenseItem.vue +7 -7
  16. package/dist/runtime/components/fellowships/RegisterModal.vue +3 -2
  17. package/dist/runtime/components/fellowships/RowsItem.vue +19 -21
  18. package/dist/runtime/components/fellowships/View.vue +43 -49
  19. package/dist/runtime/components/list/atoms/FiltersMenu.vue +6 -8
  20. package/dist/runtime/components/list/atoms/SearchInput.vue +42 -50
  21. package/dist/runtime/components/list/atoms/SearchItem.vue +14 -14
  22. package/dist/runtime/components/list/atoms/SearchString.vue +6 -7
  23. package/dist/runtime/components/list/atoms/SortMenu.vue +23 -40
  24. package/dist/runtime/components/list/atoms/ViewMenu.vue +14 -22
  25. package/dist/runtime/components/list/inputs/AutoComplete.vue +9 -9
  26. package/dist/runtime/components/list/inputs/BooleanSwitch.vue +9 -9
  27. package/dist/runtime/components/list/inputs/Checkbox.vue +11 -11
  28. package/dist/runtime/components/list/inputs/Select.vue +11 -11
  29. package/dist/runtime/components/list/molecules/Filters.vue +27 -42
  30. package/dist/runtime/components/list/molecules/Header.vue +5 -7
  31. package/dist/runtime/components/list/molecules/Pagination.vue +60 -102
  32. package/dist/runtime/components/list/organisms/List.vue +28 -36
  33. package/dist/runtime/components/list/views/Dense.vue +1 -14
  34. package/dist/runtime/components/list/views/Grid.vue +3 -3
  35. package/dist/runtime/components/list/views/Rows.vue +3 -3
  36. package/dist/runtime/components/list/views/Table.vue +3 -3
  37. package/dist/runtime/components/misc/atoms/CountUp.vue +89 -144
  38. package/dist/runtime/components/misc/atoms/DateStamp.vue +42 -46
  39. package/dist/runtime/components/misc/atoms/ImageContainer.vue +14 -22
  40. package/dist/runtime/components/misc/atoms/ShareMenu.vue +9 -11
  41. package/dist/runtime/components/misc/atoms/Socials.vue +46 -52
  42. package/dist/runtime/components/misc/molecules/ChipContainer.vue +7 -11
  43. package/dist/runtime/components/misc/molecules/Related.vue +9 -11
  44. package/dist/runtime/components/misc/molecules/RelatedItems.vue +7 -9
  45. package/dist/runtime/components/misc/molecules/SearchItem.vue +2 -2
  46. package/dist/runtime/components/news/DenseItem.vue +15 -15
  47. package/dist/runtime/components/news/ExpandedItem.vue +40 -50
  48. package/dist/runtime/components/news/Header.vue +3 -5
  49. package/dist/runtime/components/news/RelatedItem.vue +6 -7
  50. package/dist/runtime/components/news/RowsItem.vue +14 -16
  51. package/dist/runtime/components/news/View.vue +9 -20
  52. package/dist/runtime/components/people/DenseItem.vue +9 -8
  53. package/dist/runtime/components/people/ExpandedItem.vue +4 -6
  54. package/dist/runtime/components/people/GroupBadges.vue +6 -8
  55. package/dist/runtime/components/people/RelatedItem.vue +6 -7
  56. package/dist/runtime/components/people/RowsItem.vue +12 -19
  57. package/dist/runtime/components/people/View.vue +7 -7
  58. package/dist/runtime/components/projects/ExpandedItem.vue +4 -6
  59. package/dist/runtime/components/projects/RelatedItem.vue +6 -7
  60. package/dist/runtime/components/projects/RowsItem.vue +21 -26
  61. package/dist/runtime/components/projects/View.vue +8 -8
  62. package/dist/runtime/components/publications/RelatedItem.vue +6 -7
  63. package/dist/runtime/components/publications/RowsItem.vue +20 -22
  64. package/dist/runtime/components/publications/View.vue +9 -15
  65. package/dist/runtime/composables/useFetchItem.d.ts +6 -0
  66. package/dist/runtime/composables/useFetchItem.js +49 -0
  67. package/dist/runtime/composables/useIcons.d.ts +1 -0
  68. package/dist/runtime/composables/useIcons.js +30 -0
  69. package/dist/runtime/composables/useUtils.d.ts +12 -0
  70. package/dist/runtime/composables/useUtils.js +47 -0
  71. package/dist/runtime/plugins/pinia.d.ts +2 -0
  72. package/dist/runtime/plugins/{pinia.ts → pinia.js} +30 -48
  73. package/dist/runtime/plugins/vuetify.d.ts +2 -0
  74. package/dist/runtime/plugins/vuetify.js +7 -7
  75. package/dist/runtime/server/tsconfig.json +3 -0
  76. package/dist/runtime/stores/factory.d.ts +1 -0
  77. package/dist/runtime/stores/{factory.ts → factory.js} +9 -9
  78. package/dist/runtime/stores/root.d.ts +34 -0
  79. package/dist/runtime/stores/root.js +227 -0
  80. package/dist/types.d.mts +3 -0
  81. package/package.json +55 -26
  82. package/dist/runtime/composables/useFetchItem.ts +0 -64
  83. package/dist/runtime/composables/useIcons.ts +0 -30
  84. package/dist/runtime/composables/useUtils.ts +0 -75
  85. package/dist/runtime/stores/root.ts +0 -353
  86. package/example/.env.example +0 -3
  87. package/example/nuxt.config.ts +0 -19
  88. package/example/pages/index.vue +0 -27
  89. package/index.ts +0 -119
package/README.md CHANGED
@@ -1,64 +1,84 @@
1
- # @paris-ias/list
1
+ <!--
2
+ Get your module up and running quickly.
2
3
 
3
- A Nuxt module for managing list components with GraphQL integration.
4
+ Find and replace all on all files (CMD+SHIFT+F):
5
+ - Name: My Module
6
+ - Package name: my-module
7
+ - Description: My new Nuxt module
8
+ -->
4
9
 
5
- ## Installation
10
+ # My Module
6
11
 
7
- ```bash
8
- # Using npm
9
- npm install @paris-ias/list
10
-
11
- # Using yarn
12
- yarn add @paris-ias/list
13
-
14
- # Using pnpm
15
- pnpm add @paris-ias/list
16
- ```
12
+ [![npm version][npm-version-src]][npm-version-href]
13
+ [![npm downloads][npm-downloads-src]][npm-downloads-href]
14
+ [![License][license-src]][license-href]
15
+ [![Nuxt][nuxt-src]][nuxt-href]
17
16
 
18
- ## Usage
19
-
20
- Add the module to your `nuxt.config.ts`:
21
-
22
- ```ts
23
- export default defineNuxtConfig({
24
- modules: ['@paris-ias/list'],
25
- list: {
26
- modules: ['events', 'news', 'people', 'projects', 'fellowships', 'publications']
27
- }
28
- })
29
- ```
17
+ My new Nuxt module for doing amazing things.
30
18
 
31
- Set up your environment variables:
32
-
33
- ```env
34
- GRAPHQL_ENDPOINT=your_graphql_endpoint
35
- GRAPHQL_API_KEY=your_graphql_api_key
36
- ```
19
+ - [✨ &nbsp;Release Notes](/CHANGELOG.md)
20
+ <!-- - [🏀 Online playground](https://stackblitz.com/github/your-org/my-module?file=playground%2Fapp.vue) -->
21
+ <!-- - [📖 &nbsp;Documentation](https://example.com) -->
37
22
 
38
23
  ## Features
39
24
 
40
- - List components for different content types
41
- - GraphQL integration
42
- - i18n support
43
- - Vuetify integration
44
- - TypeScript support
45
-
46
- ## Components
25
+ <!-- Highlight some of the features your module provide here -->
26
+ - &nbsp;Foo
27
+ - 🚠 &nbsp;Bar
28
+ - 🌲 &nbsp;Baz
47
29
 
48
- The module provides the following components:
30
+ ## Quick Setup
49
31
 
50
- - `ListOrganismsList`: A reusable list component that can be used with different content types
32
+ Install the module to your Nuxt application with one command:
51
33
 
52
- Example usage:
53
-
54
- ```vue
55
- <template>
56
- <ListOrganismsList type="events" />
57
- <ListOrganismsList type="news" />
58
- <ListOrganismsList type="people" />
59
- </template>
34
+ ```bash
35
+ npx nuxi module add my-module
60
36
  ```
61
37
 
62
- ## License
63
-
64
- MIT
38
+ That's it! You can now use My Module in your Nuxt app ✨
39
+
40
+
41
+ ## Contribution
42
+
43
+ <details>
44
+ <summary>Local development</summary>
45
+
46
+ ```bash
47
+ # Install dependencies
48
+ npm install
49
+
50
+ # Generate type stubs
51
+ npm run dev:prepare
52
+
53
+ # Develop with the playground
54
+ npm run dev
55
+
56
+ # Build the playground
57
+ npm run dev:build
58
+
59
+ # Run ESLint
60
+ npm run lint
61
+
62
+ # Run Vitest
63
+ npm run test
64
+ npm run test:watch
65
+
66
+ # Release new version
67
+ npm run release
68
+ ```
69
+
70
+ </details>
71
+
72
+
73
+ <!-- Badges -->
74
+ [npm-version-src]: https://img.shields.io/npm/v/my-module/latest.svg?style=flat&colorA=020420&colorB=00DC82
75
+ [npm-version-href]: https://npmjs.com/package/my-module
76
+
77
+ [npm-downloads-src]: https://img.shields.io/npm/dm/my-module.svg?style=flat&colorA=020420&colorB=00DC82
78
+ [npm-downloads-href]: https://npm.chart.dev/my-module
79
+
80
+ [license-src]: https://img.shields.io/npm/l/my-module.svg?style=flat&colorA=020420&colorB=00DC82
81
+ [license-href]: https://npmjs.com/package/my-module
82
+
83
+ [nuxt-src]: https://img.shields.io/badge/Nuxt-020420?logo=nuxt.js
84
+ [nuxt-href]: https://nuxt.com
@@ -0,0 +1,8 @@
1
+ import * as _nuxt_schema from '@nuxt/schema';
2
+
3
+ interface ModuleOptions {
4
+ }
5
+ declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
6
+
7
+ export { _default as default };
8
+ export type { ModuleOptions };
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "@paris-ias/list",
3
+ "configKey": "list",
4
+ "version": "1.0.14",
5
+ "builder": {
6
+ "@nuxt/module-builder": "1.0.0",
7
+ "unbuild": "3.5.0"
8
+ }
9
+ }
@@ -0,0 +1,64 @@
1
+ import { defineNuxtModule, createResolver, addComponentsDir, addImportsDir, addPlugin } from '@nuxt/kit';
2
+
3
+ const module = defineNuxtModule({
4
+ meta: {
5
+ name: "@paris-ias/list",
6
+ configKey: "list"
7
+ },
8
+ // Default configuration options of the Nuxt module
9
+ defaults: {
10
+ modules: []
11
+ },
12
+ setup(options, nuxt) {
13
+ const resolver = createResolver(import.meta.url);
14
+ addComponentsDir({
15
+ path: resolver.resolve("./runtime/components"),
16
+ global: true
17
+ });
18
+ addImportsDir(resolver.resolve("./runtime/composables"));
19
+ addImportsDir(resolver.resolve("./runtime/graphql"));
20
+ addPlugin(resolver.resolve("./runtime/plugins/pinia"));
21
+ addPlugin(resolver.resolve("./runtime/plugins/vuetify"));
22
+ nuxt.hook("i18n:registerModule", (register) => {
23
+ register({
24
+ // langDir path needs to be resolved
25
+ langDir: resolver.resolve("./runtime/translations"),
26
+ locales: [
27
+ {
28
+ code: "en",
29
+ file: "en.json"
30
+ },
31
+ {
32
+ code: "fr",
33
+ file: "fr.json"
34
+ }
35
+ ]
36
+ });
37
+ });
38
+ nuxt.options.runtimeConfig.public.list = options;
39
+ nuxt.options.i18n = {
40
+ ...nuxt.options.i18n,
41
+ langDir: resolver.resolve("./runtime/translations"),
42
+ lazy: true
43
+ };
44
+ nuxt.options.vite = {
45
+ ...nuxt.options.vite,
46
+ define: {
47
+ ...nuxt.options.vite?.define,
48
+ "process.env.DEBUG": false
49
+ },
50
+ css: {
51
+ preprocessorOptions: {
52
+ scss: {
53
+ api: "modern-compiler"
54
+ }
55
+ }
56
+ },
57
+ build: {
58
+ target: "esnext"
59
+ }
60
+ };
61
+ }
62
+ });
63
+
64
+ export { module as default };
@@ -62,12 +62,10 @@
62
62
  </template>
63
63
 
64
64
  <script setup>
65
- import { useDisplay } from "vuetify"
66
- const { smAndUp } = useDisplay()
67
- const { locale } = useI18n()
65
+ import { useDisplay } from "vuetify";
66
+ const { smAndUp } = useDisplay();
67
+ const { locale } = useI18n();
68
68
  const props = defineProps({
69
- item: { type: Object, required: true },
70
- })
69
+ item: { type: Object, required: true }
70
+ });
71
71
  </script>
72
-
73
- <style lang="scss" scoped></style>
@@ -56,22 +56,20 @@
56
56
  </template>
57
57
 
58
58
  <script setup>
59
- import { getDetailedFormatedDate } from "../../composables/useUtils"
60
- const { locale } = useI18n()
59
+ import { getDetailedFormatedDate } from "../../composables/useUtils";
60
+ const { locale } = useI18n();
61
61
  const props = defineProps({
62
62
  item: {
63
63
  type: Object,
64
- required: true,
65
- },
66
- })
67
- const open = ref(false)
68
- const detailedStart = getDetailedFormatedDate(props.item.start, locale.value)
64
+ required: true
65
+ }
66
+ });
67
+ const open = ref(false);
68
+ const detailedStart = getDetailedFormatedDate(props.item.start, locale.value);
69
69
  const startDay = ref(
70
70
  `${detailedStart.day} ${detailedStart.month} ${detailedStart.year}`
71
- )
72
- const startTime = ref(detailedStart.hours)
73
- const detailedStop = getDetailedFormatedDate(props.item.stop, locale.value)
74
- const stopTime = ref(detailedStop.hours)
71
+ );
72
+ const startTime = ref(detailedStart.hours);
73
+ const detailedStop = getDetailedFormatedDate(props.item.stop, locale.value);
74
+ const stopTime = ref(detailedStop.hours);
75
75
  </script>
76
-
77
- <style lang="scss" scoped></style>
@@ -24,17 +24,18 @@
24
24
  </v-col>
25
25
  </v-row>
26
26
  </template>
27
+
27
28
  <script setup>
28
- const { locale } = useI18n()
29
- const localePath = useLocalePath()
29
+ const { locale } = useI18n();
30
+ const localePath = useLocalePath();
30
31
  const props = defineProps({
31
32
  item: {
32
33
  type: Object,
33
- required: true,
34
+ required: true
34
35
  },
35
36
  index: {
36
37
  type: Number,
37
- required: true,
38
- },
39
- })
38
+ required: true
39
+ }
40
+ });
40
41
  </script>
@@ -2,10 +2,8 @@
2
2
  <div class="text-h4">{{ item.name }}</div>
3
3
  </template>
4
4
 
5
- <script lang="ts" setup>
5
+ <script setup>
6
6
  const props = defineProps({
7
- item: { type: Object, required: true },
8
- })
7
+ item: { type: Object, required: true }
8
+ });
9
9
  </script>
10
-
11
- <style></style>
@@ -28,14 +28,14 @@
28
28
  </v-row>
29
29
  </v-sheet>
30
30
  </template>
31
+
31
32
  <script setup>
32
- import { useRootStore } from "../../stores/root"
33
- const rootStore = useRootStore()
33
+ import { useRootStore } from "../../stores/root";
34
+ const rootStore = useRootStore();
34
35
  const props = defineProps({
35
36
  events: {
36
37
  type: Array,
37
- required: true,
38
- },
39
- })
38
+ required: true
39
+ }
40
+ });
40
41
  </script>
41
- <style lang="scss"></style>
@@ -41,11 +41,10 @@
41
41
 
42
42
  <script setup>
43
43
  const props = defineProps({
44
- item: { type: Object, required: true },
45
- })
44
+ item: { type: Object, required: true }
45
+ });
46
46
  </script>
47
+
47
48
  <style>
48
- .register-text {
49
- font-size: 0.8rem;
50
- }
49
+ .register-text{font-size:.8rem}
51
50
  </style>
@@ -34,11 +34,10 @@
34
34
  </template>
35
35
 
36
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 } })
37
+ import { useDisplay } from "vuetify";
38
+ import { useRootStore } from "../../stores/root";
39
+ const localePath = useLocalePath();
40
+ const rootStore = useRootStore();
41
+ const { lgAndUp } = useDisplay();
42
+ const props = defineProps({ item: { type: Object, required: true } });
44
43
  </script>
@@ -93,22 +93,23 @@
93
93
  </v-col>
94
94
  </v-row>
95
95
  </template>
96
+
96
97
  <script setup>
97
- import { useDisplay } from "vuetify"
98
- import { useRootStore } from "../../stores/root"
99
- const { locale } = useI18n()
100
- const { name, mdAndDown, lgAndUp } = useDisplay()
101
- const localePath = useLocalePath()
102
- const rootStore = useRootStore()
103
- const { $stores } = useNuxtApp()
98
+ import { useDisplay } from "vuetify";
99
+ import { useRootStore } from "../../stores/root";
100
+ const { locale } = useI18n();
101
+ const { name, mdAndDown, lgAndUp } = useDisplay();
102
+ const localePath = useLocalePath();
103
+ const rootStore = useRootStore();
104
+ const { $stores } = useNuxtApp();
104
105
  const props = defineProps({
105
106
  item: {
106
107
  type: Object,
107
- required: true,
108
+ required: true
108
109
  },
109
110
  index: {
110
111
  type: Number,
111
- required: true,
112
- },
113
- })
112
+ required: true
113
+ }
114
+ });
114
115
  </script>
@@ -306,28 +306,25 @@
306
306
  </template>
307
307
 
308
308
  <script setup>
309
- import { useDisplay } from "vuetify"
310
- import getFileIcon from "../../composables/useIcons"
311
- const { name, mdAndUp, sm, xs } = useDisplay()
312
- const router = useRouter()
309
+ import { useDisplay } from "vuetify";
310
+ import getFileIcon from "../../composables/useIcons";
311
+ const { name, mdAndUp, sm, xs } = useDisplay();
312
+ const router = useRouter();
313
313
  const props = defineProps({
314
314
  item: {
315
315
  type: Object,
316
- required: true,
316
+ required: true
317
317
  },
318
318
  loading: {
319
319
  type: Boolean,
320
320
  required: false,
321
- default: false,
322
- },
323
- })
324
-
325
- // UI components models
326
- const panel = ref(["presentation"])
327
-
321
+ default: false
322
+ }
323
+ });
324
+ const panel = ref(["presentation"]);
328
325
  function redirectToMap(long, lat) {
329
326
  router.push(
330
327
  `https://www.openstreetmap.org/?mlat=${lat}&amp;mlon=${long}#map=19/${lat}/${long}`
331
- )
328
+ );
332
329
  }
333
330
  </script>
@@ -25,24 +25,21 @@
25
25
  <script setup>
26
26
  const props = defineProps({
27
27
  item: { type: Object, required: true },
28
- view: { type: Boolean, required: false, default: false },
29
- })
30
-
28
+ view: { type: Boolean, required: false, default: false }
29
+ });
31
30
  const registrationStatus = computed(() => {
32
- const currentDate = new Date()
33
- const startDate = new Date(props.item.applicationStart)
34
- const endDate = new Date(props.item.applicationStop)
31
+ const currentDate = /* @__PURE__ */ new Date();
32
+ const startDate = new Date(props.item.applicationStart);
33
+ const endDate = new Date(props.item.applicationStop);
35
34
  switch (true) {
36
35
  case currentDate < startDate:
37
- return 0
38
- case currentDate > startDate && currentDate < endDate:
39
- return 1
40
- case currentDate > startDate && currentDate > endDate:
41
- return 2
36
+ return 0;
37
+ case (currentDate > startDate && currentDate < endDate):
38
+ return 1;
39
+ case (currentDate > startDate && currentDate > endDate):
40
+ return 2;
42
41
  default:
43
- return false
42
+ return false;
44
43
  }
45
- })
44
+ });
46
45
  </script>
47
-
48
- <style lang="scss" scoped></style>
@@ -22,18 +22,18 @@
22
22
  /></v-col>
23
23
  </v-row>
24
24
  </template>
25
- <script setup>
26
- const { locale } = useI18n()
27
25
 
28
- const localePath = useLocalePath()
26
+ <script setup>
27
+ const { locale } = useI18n();
28
+ const localePath = useLocalePath();
29
29
  const props = defineProps({
30
30
  item: {
31
31
  type: Object,
32
- required: true,
32
+ required: true
33
33
  },
34
34
  index: {
35
35
  type: Number,
36
- required: true,
37
- },
38
- })
36
+ required: true
37
+ }
38
+ });
39
39
  </script>
@@ -33,9 +33,10 @@
33
33
  </template>
34
34
  </v-dialog>
35
35
  </template>
36
+
36
37
  <script setup>
37
38
  const props = defineProps({
38
39
  item: { type: Object, required: true },
39
- view: { type: Boolean, required: false, default: false },
40
- })
40
+ view: { type: Boolean, required: false, default: false }
41
+ });
41
42
  </script>
@@ -1,4 +1,4 @@
1
- <template>
1
+ <template>
2
2
  <v-col cols="12" md="6" class="highlight-on-hover">
3
3
  <div v-ripple class="border-thin pa-6">
4
4
  <FellowshipsBadges :item="item" />
@@ -39,23 +39,21 @@
39
39
  />
40
40
  </div>
41
41
  </v-col>
42
- </template>
43
-
44
- <script setup>
45
- import { useDisplay } from "vuetify"
46
- const { name } = useDisplay()
47
- const localePath = useLocalePath()
48
- const { locale } = useI18n()
49
-
50
- const props = defineProps({
51
- item: {
52
- type: Object,
53
- required: true,
54
- },
55
- index: {
56
- type: Number,
57
- required: true,
58
- },
59
- })
60
- </script>
61
- <style lang="scss"></style>
42
+ </template>
43
+
44
+ <script setup>
45
+ import { useDisplay } from "vuetify";
46
+ const { name } = useDisplay();
47
+ const localePath = useLocalePath();
48
+ const { locale } = useI18n();
49
+ const props = defineProps({
50
+ item: {
51
+ type: Object,
52
+ required: true
53
+ },
54
+ index: {
55
+ type: Number,
56
+ required: true
57
+ }
58
+ });
59
+ </script>