@paris-ias/list 1.0.18 → 1.0.19

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.
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@paris-ias/list",
3
3
  "configKey": "list",
4
- "version": "1.0.18",
4
+ "version": "1.0.19",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.0",
7
7
  "unbuild": "3.5.0"
@@ -13,7 +13,7 @@
13
13
  />
14
14
 
15
15
  <div v-else-if="registrationStatus === 2" class="my-2 text-overline">
16
- <v-icon class="text-grey" size="x-large"> mdi-circle-medium</v-icon>
16
+ <v-icon class="text-grey" size="x-large"> mdi-circle-medium </v-icon>
17
17
  {{
18
18
  $t("applications-closed-since-0", [
19
19
  getLocalizedDate(item.applicationStop),
@@ -23,6 +23,7 @@
23
23
  </template>
24
24
 
25
25
  <script setup>
26
+ import { computed } from "vue";
26
27
  const props = defineProps({
27
28
  item: { type: Object, required: true },
28
29
  view: { type: Boolean, required: false, default: false }
@@ -66,6 +66,7 @@
66
66
 
67
67
  <script setup>
68
68
  import { useDebounceFn } from "@vueuse/core";
69
+ import { computed } from "vue";
69
70
  import { useRootStore } from "../../../stores/root";
70
71
  import { useNuxtApp, useI18n } from "#imports";
71
72
  const { locale, t } = useI18n();
@@ -43,7 +43,7 @@
43
43
  </template>
44
44
 
45
45
  <script setup>
46
- import { mergeProps } from "vue";
46
+ import { mergeProps, computed } from "vue";
47
47
  import { useDisplay } from "vuetify";
48
48
  import { useRootStore } from "../../../stores/root";
49
49
  import { useNuxtApp } from "#imports";
@@ -35,6 +35,7 @@
35
35
 
36
36
  <script setup>
37
37
  import { useDisplay } from "vuetify";
38
+ import { resolveComponent } from "vue";
38
39
  import { useRootStore } from "../../../stores/root";
39
40
  import { useNuxtApp, useI18n } from "#imports";
40
41
  const { smAndDown } = useDisplay();
@@ -78,10 +78,9 @@
78
78
 
79
79
  <script setup>
80
80
  import { computed } from "vue";
81
- import { useRoute, useRouter } from "vue-router";
81
+ import { useRoute } from "vue-router";
82
82
  import { useRootStore } from "../../../stores/root";
83
83
  const route = useRoute();
84
- const router = useRouter();
85
84
  const rootStore = useRootStore();
86
85
  const props = defineProps({
87
86
  totalPages: {
@@ -189,7 +188,7 @@ watch(
189
188
  () => route.query.page,
190
189
  (newPage) => {
191
190
  if (newPage) {
192
- props.currentPage = parseInt(newPage, 10);
191
+ props.currentPage = Number.parseInt(newPage, 10);
193
192
  }
194
193
  },
195
194
  { immediate: true }
@@ -25,6 +25,7 @@
25
25
  </template>
26
26
 
27
27
  <script setup>
28
+ import { resolveComponent, computed } from "vue";
28
29
  import { useRootStore } from "../../../stores/root";
29
30
  import { capitalize } from "../../../composables/useUtils";
30
31
  import { useNuxtApp, useI18n } from "#imports";
@@ -41,10 +41,12 @@
41
41
 
42
42
  <script setup>
43
43
  import { useDisplay } from "vuetify";
44
+ import { computed } from "vue";
44
45
  import {
45
46
  getDetailedFormatedDate,
46
47
  formatDateValue
47
48
  } from "../../../composables/useUtils";
49
+ import { useI18n } from "#imports";
48
50
  const { smAndDown, mdAndUp, name } = useDisplay();
49
51
  const { locale } = useI18n();
50
52
  const props = defineProps({
@@ -1,10 +1,10 @@
1
1
  <template>
2
2
  <div>
3
- <!-- TODO
4
- - add skeleton UI
3
+ <!-- TODO
4
+ - add skeleton UI
5
5
  - test lazy-src
6
- - validate requested quality
7
- - Add conditional overlays slots (top left/right, bottom left/right/center for date, caption, copyright)-->
6
+ - validate requested quality
7
+ - Add conditional overlays slots (top left/right, bottom left/right/center for date, caption, copyright) -->
8
8
 
9
9
  <v-skeleton-loader v-if="loading" height="100%" type="image" />
10
10
 
@@ -50,6 +50,7 @@
50
50
  </template>
51
51
 
52
52
  <script setup>
53
+ import { computed } from "vue";
53
54
  const localePath = useLocalePath();
54
55
  const img = useImage();
55
56
  const computedSrc = computed(() => {
@@ -15,6 +15,7 @@
15
15
  </template>
16
16
 
17
17
  <script setup>
18
+ import { computed } from "vue";
18
19
  const props = defineProps({
19
20
  related: {
20
21
  type: Object,
@@ -66,6 +66,7 @@
66
66
 
67
67
  <script setup>
68
68
  import { useDisplay } from "vuetify";
69
+ import { computed } from "vue";
69
70
  const { name, mdAndUp } = useDisplay();
70
71
  const localePath = useLocalePath();
71
72
  const props = defineProps({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "license": "AGPL-3.0-only",
3
3
  "main": "./dist/module.mjs",
4
- "version": "1.0.18",
4
+ "version": "1.0.19",
5
5
  "name": "@paris-ias/list",
6
6
  "repository": "IEA-Paris/list",
7
7
  "dependencies": {
@@ -1,143 +0,0 @@
1
- <template>
2
- <span> {{ displayedAmount }}</span>
3
- </template>
4
-
5
- <script setup>
6
- const props = defineProps({
7
- startAmount: {
8
- type: Number,
9
- default: 0
10
- },
11
- endAmount: {
12
- type: Number,
13
- default: 0,
14
- required: true
15
- },
16
- duration: {
17
- type: Number,
18
- default: 3,
19
- validator(duration) {
20
- return duration > 0;
21
- }
22
- },
23
- autoinit: {
24
- type: Boolean,
25
- default: true
26
- },
27
- prefix: {
28
- type: String,
29
- default: ""
30
- },
31
- suffix: {
32
- type: String,
33
- default: ""
34
- },
35
- separator: {
36
- type: String,
37
- default: ","
38
- },
39
- decimalSeparator: {
40
- type: String,
41
- default: "."
42
- },
43
- decimals: {
44
- type: Number,
45
- default: 0,
46
- validator(decimals) {
47
- return decimals >= 0;
48
- }
49
- }
50
- });
51
- const state = reactive({
52
- timestamp: 0,
53
- startTimestamp: null,
54
- currentAmount: props.startAmount,
55
- currentStartAmount: props.startAmount,
56
- currentDuration: props.duration * 1e3,
57
- paused: false,
58
- remaining: props.duration * 1e3,
59
- animationFrame: 0
60
- });
61
- const isCountingUp = computed(() => props.endAmount > props.startAmount);
62
- const formatedAmount = computed(() => {
63
- const regex = /(\d+)(\d{3})/;
64
- const numberString = state.currentAmount.toFixed(props.decimals);
65
- const numberArray = numberString.split(".");
66
- let numbers = numberArray[0];
67
- const decimals = numberArray.length > 1 ? props.decimalSeparator + numberArray[1] : "";
68
- const isNumber = !isNaN(parseFloat(props.separator));
69
- if (props.separator && !isNumber) {
70
- while (regex.test(numbers)) {
71
- numbers = numbers.replace(regex, "$1" + props.separator + "$2");
72
- }
73
- }
74
- return numbers + decimals;
75
- });
76
- const displayedAmount = computed(
77
- () => `${props.prefix}${formatedAmount.value}${props.suffix}`
78
- );
79
- const start = () => {
80
- cancelAnimation();
81
- state.currentStartAmount = props.startAmount;
82
- state.startTimestamp = null;
83
- state.currentDuration = props.duration * 1e3;
84
- state.paused = false;
85
- state.animationFrame = window.requestAnimationFrame(counting);
86
- };
87
- const pause = () => {
88
- if (state.paused) return;
89
- cancelAnimation();
90
- state.paused = true;
91
- };
92
- const resume = () => {
93
- if (!state.paused) return;
94
- state.startTimestamp = null;
95
- state.currentDuration = +state.remaining;
96
- state.currentStartAmount = +state.currentAmount;
97
- state.animationFrame = window.requestAnimationFrame(counting);
98
- state.paused = false;
99
- };
100
- const reset = () => {
101
- state.paused = false;
102
- state.startTimestamp = null;
103
- cancelAnimation();
104
- state.currentAmount = props.startAmount;
105
- if (props.autoinit) start();
106
- else state.paused = true;
107
- };
108
- const counting = (timestamp) => {
109
- state.timestamp = timestamp;
110
- if (!state.startTimestamp) state.startTimestamp = timestamp;
111
- const progress = timestamp - state.startTimestamp;
112
- state.remaining = state.currentDuration - progress;
113
- if (!isCountingUp.value) {
114
- state.currentAmount = state.currentStartAmount - (state.currentStartAmount - props.endAmount) * (progress / state.currentDuration);
115
- state.currentAmount = state.currentAmount < props.endAmount ? props.endAmount : state.currentAmount;
116
- } else {
117
- state.currentAmount = state.currentStartAmount + (props.endAmount - state.currentStartAmount) * (progress / state.currentDuration);
118
- state.currentAmount = state.currentAmount > props.endAmount ? props.endAmount : state.currentAmount;
119
- }
120
- if (progress < state.currentDuration) {
121
- state.animationFrame = window.requestAnimationFrame(counting);
122
- } else {
123
- console.log("finished");
124
- }
125
- };
126
- const cancelAnimation = () => {
127
- if (state.animationFrame) window.cancelAnimationFrame(state.animationFrame);
128
- };
129
- watch(() => props.startAmount, reset);
130
- watch(() => props.endAmount, reset);
131
- watch(() => props.duration, reset);
132
- onMounted(() => {
133
- state.currentAmount = props.startAmount;
134
- state.currentStartAmount = props.startAmount;
135
- state.currentDuration = props.duration * 1e3;
136
- state.remaining = props.duration * 1e3;
137
- if (props.autoinit) start();
138
- else state.paused = true;
139
- });
140
- onUnmounted(() => {
141
- cancelAnimation();
142
- });
143
- </script>