@paris-ias/list 1.0.137 → 1.0.139

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 (49) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/actions/DenseItem.vue +64 -0
  3. package/dist/runtime/components/actions/ExpandedItem.vue +17 -14
  4. package/dist/runtime/components/actions/RowsItem.vue +56 -10
  5. package/dist/runtime/components/actions/View.vue +5 -17
  6. package/dist/runtime/components/affiliation/DenseItem.vue +26 -10
  7. package/dist/runtime/components/affiliation/RowsItem.vue +26 -10
  8. package/dist/runtime/components/apps/DenseItem.vue +26 -10
  9. package/dist/runtime/components/apps/RowsItem.vue +26 -10
  10. package/dist/runtime/components/disciplines/DenseItem.vue +26 -10
  11. package/dist/runtime/components/disciplines/RowsItem.vue +26 -10
  12. package/dist/runtime/components/events/DenseItem.vue +12 -3
  13. package/dist/runtime/components/events/RowsItem.vue +12 -5
  14. package/dist/runtime/components/fellowships/DenseItem.vue +14 -0
  15. package/dist/runtime/components/fellowships/RowsItem.vue +16 -2
  16. package/dist/runtime/components/fellowships/View.vue +2 -2
  17. package/dist/runtime/components/files/DenseItem.vue +25 -10
  18. package/dist/runtime/components/files/RowsItem.vue +26 -10
  19. package/dist/runtime/components/list/atoms/FiltersMenu.vue +9 -0
  20. package/dist/runtime/components/list/atoms/PerPage.vue +3 -2
  21. package/dist/runtime/components/list/atoms/ResetButton.vue +5 -1
  22. package/dist/runtime/components/list/atoms/SearchInput.vue +15 -2
  23. package/dist/runtime/components/list/atoms/SearchString.vue +169 -133
  24. package/dist/runtime/components/list/atoms/SortMenu.vue +22 -18
  25. package/dist/runtime/components/list/atoms/ViewMenu.vue +26 -14
  26. package/dist/runtime/components/list/molecules/Filters.vue +4 -4
  27. package/dist/runtime/components/list/molecules/GlobalSearchInput.vue +12 -14
  28. package/dist/runtime/components/list/molecules/Header.vue +11 -20
  29. package/dist/runtime/components/list/molecules/Pagination.vue +51 -48
  30. package/dist/runtime/components/list/molecules/ResultsContainer.vue +5 -2
  31. package/dist/runtime/components/list/organisms/List.vue +105 -74
  32. package/dist/runtime/components/list/organisms/Results.vue +31 -17
  33. package/dist/runtime/components/mailing/RowsItem.vue +26 -10
  34. package/dist/runtime/components/news/DenseItem.vue +59 -45
  35. package/dist/runtime/components/news/RowsItem.vue +11 -7
  36. package/dist/runtime/components/people/DenseItem.vue +10 -8
  37. package/dist/runtime/components/people/RowsItem.vue +11 -2
  38. package/dist/runtime/components/projects/DenseItem.vue +11 -4
  39. package/dist/runtime/components/projects/RowsItem.vue +10 -3
  40. package/dist/runtime/components/publications/DenseItem.vue +12 -8
  41. package/dist/runtime/components/publications/RowsItem.vue +12 -4
  42. package/dist/runtime/components/tags/RowsItem.vue +23 -10
  43. package/dist/runtime/components/users/DenseItem.vue +24 -10
  44. package/dist/runtime/components/users/RowsItem.vue +24 -10
  45. package/dist/runtime/composables/useUtils.js +1 -1
  46. package/dist/runtime/plugins/pinia.js +5 -2
  47. package/dist/runtime/stores/root.d.ts +10 -9
  48. package/dist/runtime/stores/root.js +82 -117
  49. package/package.json +1 -1
@@ -3,7 +3,8 @@
3
3
  <div v-ripple class="border-thin pa-6">
4
4
  <FellowshipsBadges :item :pathPrefix />
5
5
  <div class="d-flex">
6
- <div class="text-h4 text-black text-wrap mt-4 pb-4">
6
+ <v-skeleton-loader v-if="isLoading" type="heading" />
7
+ <div v-else class="text-h4 text-black text-wrap mt-4 pb-4">
7
8
  {{ item.name }}
8
9
  </div>
9
10
  </div>
@@ -16,9 +17,12 @@
16
17
  ]
17
18
  "
18
19
  >
19
- <MDC v-if="item.description" :value="item.description" />
20
+ <v-skeleton-loader v-if="isLoading" type="text@4" />
21
+ <MDC v-else-if="item.description" :value="item.description" />
20
22
  </div>
23
+ <v-skeleton-loader v-if="isLoading" type="chip@3" class="mt-2" />
21
24
  <MiscMoleculesChipContainer
25
+ v-else
22
26
  :items="[
23
27
  $t('list.filters.fellowships.fellowshipType.' + item.fellowshipType),
24
28
  ...(props.item && props.item.disciplines
@@ -33,6 +37,8 @@
33
37
 
34
38
  <script setup>
35
39
  import { useDisplay } from "vuetify"
40
+ import { computed } from "#imports"
41
+ import { useRootStore } from "../../stores/root"
36
42
 
37
43
  const { name } = useDisplay()
38
44
 
@@ -49,7 +55,15 @@ const props = defineProps({
49
55
  type: String,
50
56
  required: true,
51
57
  },
58
+ loading: {
59
+ type: Boolean,
60
+ required: false,
61
+ default: false,
62
+ },
52
63
  })
64
+
65
+ const rootStore = useRootStore()
66
+ const isLoading = computed(() => rootStore.loading || props.loading)
53
67
  </script>
54
68
 
55
69
  <style lang="scss"></style>
@@ -10,7 +10,7 @@
10
10
  <!-- FELLOWSHIP IMAGE -->
11
11
  <MiscAtomsImageContainer
12
12
  contain
13
- :loading
13
+ :loading="loading"
14
14
  :src="item.image"
15
15
  :ratio="1 / 1"
16
16
  />
@@ -131,7 +131,7 @@
131
131
  :items="item.fellows || []"
132
132
  type="people"
133
133
  lazy
134
- :loading
134
+ :loading="loading"
135
135
  >
136
136
  <div :class="mdAndUp ? 'text-h5' : 'text-h6'">
137
137
  {{ $t("this-fellowship-alumni") }}
@@ -1,19 +1,34 @@
1
1
  <template>
2
- {{ item }}
2
+ <v-row
3
+ class="my-2 highlight-on-hover"
4
+ no-gutters
5
+ @click="$router.push(pathPrefix)"
6
+ >
7
+ <v-col cols="12" class="px-4">
8
+ <v-skeleton-loader v-if="isLoading" type="avatar, text@6" />
9
+ <template v-else>
10
+ <div class="text-h6">{{ item.name || item.filename }}</div>
11
+ <div v-if="item.description" class="text-body-2 mt-1">
12
+ <MDC :value="item.description" />
13
+ </div>
14
+ </template>
15
+ </v-col>
16
+ </v-row>
17
+ <v-divider />
3
18
  </template>
4
19
 
5
20
  <script setup>
6
- defineProps({
7
- item: {
8
- type: Object,
9
- required: true,
10
- },
21
+ import { computed } from "#imports"
22
+ import { useRootStore } from "../../stores/root"
11
23
 
12
- pathPrefix: {
13
- type: String,
14
- required: true,
15
- },
24
+ const rootStore = useRootStore()
25
+ const props = defineProps({
26
+ item: { type: Object, required: true },
27
+ pathPrefix: { type: String, required: true },
28
+ loading: { type: Boolean, default: false },
16
29
  })
30
+
31
+ const isLoading = computed(() => rootStore.loading || props.loading)
17
32
  </script>
18
33
 
19
34
  <style></style>
@@ -1,18 +1,34 @@
1
1
  <template>
2
- {{ item }}
2
+ <v-row
3
+ class="highlight-on-hover pa-3"
4
+ no-gutters
5
+ @click="$router.push(pathPrefix)"
6
+ >
7
+ <v-col cols="12" class="px-6">
8
+ <v-skeleton-loader v-if="isLoading" type="avatar, text@8, button" />
9
+ <template v-else>
10
+ <div class="text-h6">{{ item.name || item.filename }}</div>
11
+ <div v-if="item.description" class="mt-2">
12
+ <MDC :value="item.description" />
13
+ </div>
14
+ </template>
15
+ </v-col>
16
+ </v-row>
17
+ <v-divider />
3
18
  </template>
4
19
 
5
20
  <script setup>
6
- defineProps({
7
- item: {
8
- type: Object,
9
- required: true,
10
- },
11
- pathPrefix: {
12
- type: String,
13
- required: true,
14
- },
21
+ import { computed } from "#imports"
22
+ import { useRootStore } from "../../stores/root"
23
+
24
+ const rootStore = useRootStore()
25
+ const props = defineProps({
26
+ item: { type: Object, required: true },
27
+ pathPrefix: { type: String, required: true },
28
+ loading: { type: Boolean, default: false },
15
29
  })
30
+
31
+ const isLoading = computed(() => rootStore.loading || props.loading)
16
32
  </script>
17
33
 
18
34
  <style></style>
@@ -12,6 +12,8 @@
12
12
  v-bind="tooltip"
13
13
  prepend-icon="mdi-tune-variant"
14
14
  :append-icon="open ? 'mdi-chevron-down' : 'mdi-chevron-up'"
15
+ :loading="$stores[type] && $stores[type].loading"
16
+ :disabled="$stores[type] && $stores[type].loading"
15
17
  @click="$emit('open', !open)"
16
18
  >
17
19
  <!-- <v-icon>mdi-tune-variant</v-icon> -->
@@ -26,6 +28,8 @@
26
28
 
27
29
  <script setup>
28
30
  import { useDisplay } from "vuetify"
31
+ import { useNuxtApp } from "#imports"
32
+ const { $stores } = useNuxtApp()
29
33
  const {
30
34
  name: nameDisplay,
31
35
  xs: isXsDisplay,
@@ -40,6 +44,11 @@ const props = defineProps({
40
44
  required: false,
41
45
  default: false,
42
46
  },
47
+ type: {
48
+ type: String,
49
+ required: false,
50
+ default: "",
51
+ },
43
52
  })
44
53
  </script>
45
54
 
@@ -1,12 +1,13 @@
1
1
  <template>
2
2
  <v-select
3
+ :id="'per-page-select' + type"
3
4
  v-model="itemsPerPage"
4
5
  class="perPageSelect"
5
- density="compact"
6
6
  variant="outlined"
7
7
  :items="itemsPerPageArray"
8
8
  hide-details
9
- :loading="$rootStore.loading"
9
+ density="compact"
10
+ :loading="$stores[type] && $stores[type].loading"
10
11
  @update:model-value="
11
12
  $rootStore.updateItemsPerPage({
12
13
  value: $event,
@@ -9,7 +9,7 @@
9
9
  icon
10
10
  class="ml-auto"
11
11
  v-bind="tooltip"
12
- @click="rootStore.resetState(props.type, locale)"
12
+ @click="resetState(props.type)"
13
13
  >
14
14
  <v-icon>mdi-restore</v-icon>
15
15
  </v-btn>
@@ -30,5 +30,9 @@ const props = defineProps({
30
30
  required: true,
31
31
  },
32
32
  })
33
+ const resetState = (type) => {
34
+ rootStore.resetState(type, locale.value)
35
+ rootStore.updateRouteQuery(type)
36
+ }
33
37
  </script>
34
38
  <style lang="scss"></style>
@@ -2,6 +2,7 @@
2
2
  <div class="d-flex flex-grow-1 flex-column">
3
3
  <v-text-field
4
4
  v-model.trim="search"
5
+ :id="inputId"
5
6
  :placeholder="$t('list.search-type', [$t('items.' + type, 2)])"
6
7
  :append-icon="type === 'all' ? 'mdi-magnify' : ''"
7
8
  prepend-inner-icon="mdi-magnify"
@@ -12,7 +13,7 @@
12
13
  clearable
13
14
  tile
14
15
  type="search"
15
- :loading="rootStore.loading"
16
+ :loading="isLoading"
16
17
  >
17
18
  <!-- :loading="$nuxt.loading || $store.state.loading" :class="{ 'mt-3':
18
19
  $store.state.scrolled }" -->
@@ -46,14 +47,20 @@ const props = defineProps({
46
47
  type: Boolean,
47
48
  default: false,
48
49
  },
50
+ id: {
51
+ type: String,
52
+ required: false,
53
+ default: "",
54
+ },
49
55
  })
56
+ const inputId = computed(() => props.id || `search-input-${props.type}`)
50
57
  const search = computed({
51
58
  get() {
52
59
  return props.type === "all"
53
60
  ? rootStore.search
54
61
  : $stores[props.type]?.search || ""
55
62
  },
56
- set: await useDebounceFn(async function (v) {
63
+ set: useDebounceFn(async (v) => {
57
64
  await rootStore.updateSearch({
58
65
  type: props.type,
59
66
  search: v || "",
@@ -61,6 +68,12 @@ const search = computed({
61
68
  })
62
69
  }, 300),
63
70
  })
71
+
72
+ const isLoading = computed(() =>
73
+ props.type === "all"
74
+ ? rootStore.loading
75
+ : Boolean($stores[props.type]?.loading),
76
+ )
64
77
  </script>
65
78
 
66
79
  <style lang="scss" scoped></style>
@@ -1,154 +1,161 @@
1
1
  <template>
2
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
- {{
37
- feminine
38
- ? $t(
39
- "list.0-items-found-searching-for-f",
40
- [
41
- $stores[type].total,
42
- $t(
43
- "items." + props.type,
3
+ <ClientOnly v-if="showSkeleton">
4
+ <v-skeleton-loader :type="isSmAndDown ? 'text@2' : 'text'" />
5
+ </ClientOnly>
6
+ <template v-else>
7
+ <template
8
+ v-if="
9
+ (!$stores[type].search || $stores[type].search.length === 0) &&
10
+ $stores[type].filtersCount === 0
11
+ "
12
+ >
13
+ {{
14
+ feminine
15
+ ? $t(
16
+ "list.0-items-found-f",
17
+ [
44
18
  $stores[type].total,
19
+ $t("items." + props.type, $stores[type].total),
20
+ ],
21
+ $stores[type].total,
22
+ )
23
+ : $t(
24
+ "list.0-items-found",
25
+ [
45
26
  $stores[type].total,
46
- ),
47
- $stores[type].search,
48
- ],
49
- $stores[type].total,
50
- )
51
- : $t(
52
- "list.0-items-found-searching-for",
53
- [
27
+ $t("items." + props.type, $stores[type].total),
28
+ ],
54
29
  $stores[type].total,
55
- $t(
56
- "items." + props.type,
30
+ )
31
+ }}
32
+ </template>
33
+ <!-- searching for "XXX" -->
34
+ <template
35
+ v-else-if="
36
+ !(!$stores[type].search || $stores[type].search.length === 0) &&
37
+ $stores[type].filtersCount === 0
38
+ "
39
+ >
40
+ {{
41
+ feminine
42
+ ? $t(
43
+ "list.0-items-found-searching-for-f",
44
+ [
57
45
  $stores[type].total,
46
+ $t(
47
+ "items." + props.type,
48
+ $stores[type].total,
49
+ $stores[type].total,
50
+ ),
51
+ $stores[type].search,
52
+ ],
53
+ $stores[type].total,
54
+ )
55
+ : $t(
56
+ "list.0-items-found-searching-for",
57
+ [
58
58
  $stores[type].total,
59
- ),
60
- $stores[type].search,
61
- ],
62
- $stores[type].total,
63
- )
64
- }}
65
- </template>
66
- <!-- with X filters -->
67
- <template
68
- v-else-if="
69
- (!$stores[type].search || $stores[type].search.length === 0) &&
70
- $stores[type].filtersCount > 0
71
- "
72
- >
73
- {{
74
- feminine
75
- ? $t(
76
- "list.0-items-found-with-1-filter-f",
77
- [
59
+ $t(
60
+ "items." + props.type,
61
+ $stores[type].total,
62
+ $stores[type].total,
63
+ ),
64
+ $stores[type].search,
65
+ ],
78
66
  $stores[type].total,
79
- $t(
80
- "items." + props.type,
67
+ )
68
+ }}
69
+ </template>
70
+ <!-- with X filters -->
71
+ <template
72
+ v-else-if="
73
+ (!$stores[type].search || $stores[type].search.length === 0) &&
74
+ $stores[type].filtersCount > 0
75
+ "
76
+ >
77
+ {{
78
+ feminine
79
+ ? $t(
80
+ "list.0-items-found-with-1-filter-f",
81
+ [
81
82
  $stores[type].total,
83
+ $t(
84
+ "items." + props.type,
85
+ $stores[type].total,
86
+ $stores[type].total,
87
+ ),
88
+ $stores[type].filtersCount,
89
+ $t("filters", $stores[type].filtersCount),
90
+ ],
91
+ $stores[type].total,
92
+ )
93
+ : $t(
94
+ "list.0-items-found-with-1-filter",
95
+ [
82
96
  $stores[type].total,
83
- ),
84
- $stores[type].filtersCount,
85
- $t("filters", $stores[type].filtersCount),
86
- ],
87
- $stores[type].total,
88
- )
89
- : $t(
90
- "list.0-items-found-with-1-filter",
91
- [
97
+ $t("items." + type, $stores[type].total, $stores[type].total),
98
+ $stores[type].filtersCount,
99
+ $t("filters", $stores[type].filtersCount),
100
+ ],
92
101
  $stores[type].total,
93
- $t("items." + type, $stores[type].total, $stores[type].total),
94
- $stores[type].filtersCount,
95
- $t("filters", $stores[type].filtersCount),
96
- ],
97
- $stores[type].total,
98
- )
99
- }}
100
- </template>
101
- <!-- searching for "XXX" with Y filters -->
102
- <template
103
- v-else-if="
104
- $stores[type].search &&
105
- $stores[type].search.length &&
106
- $stores[type].filtersCount > 0
107
- "
108
- >
109
- {{
110
- feminine
111
- ? $t(
112
- "list.0-items-found-searching-for-with-1-filter-f",
113
- [
102
+ )
103
+ }}
104
+ </template>
105
+ <!-- searching for "XXX" with Y filters -->
106
+ <template
107
+ v-else-if="
108
+ $stores[type].search &&
109
+ $stores[type].search.length &&
110
+ $stores[type].filtersCount > 0
111
+ "
112
+ >
113
+ {{
114
+ feminine
115
+ ? $t(
116
+ "list.0-items-found-searching-for-with-1-filter-f",
117
+ [
118
+ $stores[type].total,
119
+ $t("items." + type, $stores[type].total),
120
+ $stores[type].search,
121
+ $stores[type].filtersCount,
122
+ $t("filters", $stores[type].filtersCount),
123
+ ],
114
124
  $stores[type].total,
115
- $t("items." + type, $stores[type].total),
116
- $stores[type].search,
117
- $stores[type].filtersCount,
118
- $t("filters", $stores[type].filtersCount),
119
- ],
120
- $stores[type].total,
121
- )
122
- : $t(
123
- "list.0-items-found-searching-for-with-1-filter",
124
- [
125
+ )
126
+ : $t(
127
+ "list.0-items-found-searching-for-with-1-filter",
128
+ [
129
+ $stores[type].total,
130
+ $t("items." + type, $stores[type].total),
131
+ $stores[type].search,
132
+ $stores[type].filtersCount,
133
+ $t("filters", $stores[type].filtersCount),
134
+ ],
125
135
  $stores[type].total,
126
- $t("items." + type, $stores[type].total),
127
- $stores[type].search,
128
- $stores[type].filtersCount,
129
- $t("filters", $stores[type].filtersCount),
130
- ],
131
- $stores[type].total,
132
- )
133
- }}
136
+ )
137
+ }}
138
+ </template>
139
+ <template v-if="$stores[type].numberOfPages > 1">
140
+ <!-- // Page X of Y -->
141
+ {{
142
+ $t("list.page-0-of-1", [
143
+ $stores[type].page || 1,
144
+ $stores[type].numberOfPages || 1,
145
+ ])
146
+ }}
147
+ </template>
148
+ <!-- X items per page -->
149
+ <!-- displayed by X -->
150
+ <!-- and sorted by X -->
134
151
  </template>
135
- <template v-if="$stores[type].numberOfPages > 1">
136
- <!-- // Page X of Y -->
137
- {{
138
- $t("list.page-0-of-1", [
139
- $stores[type].page || 1,
140
- $stores[type].numberOfPages || 1,
141
- ])
142
- }}
143
- </template>
144
- <!-- X items per page -->
145
- <!-- displayed by X -->
146
- <!-- and sorted by X -->
147
152
  </div>
148
153
  </template>
149
154
 
150
155
  <script setup>
151
- import { useNuxtApp, ref } from "#imports"
156
+ import { useNuxtApp, ref, computed } from "#imports"
157
+ import { useDisplay } from "vuetify"
158
+ import { useRootStore } from "../../../stores/root"
152
159
 
153
160
  const { $stores } = useNuxtApp()
154
161
  const props = defineProps({
@@ -158,6 +165,35 @@ const props = defineProps({
158
165
  },
159
166
  })
160
167
  const feminine = ref(["news", "publications", "people"].includes(props.type))
168
+ const { smAndDown: isSmAndDown } = useDisplay()
169
+ const rootStore = useRootStore()
170
+
171
+ const isLoading = computed(() =>
172
+ Boolean($stores[props.type] && $stores[props.type].loading),
173
+ )
174
+ const isTypeSearchActive = computed(() => {
175
+ const s = $stores[props.type]?.search
176
+ return Boolean(s && s.length)
177
+ })
178
+ const isGlobalSearchActive = computed(
179
+ () => typeof rootStore.search === "string" && rootStore.search.length > 0,
180
+ )
181
+ const isAnySearchActive = computed(
182
+ () => isTypeSearchActive.value || isGlobalSearchActive.value,
183
+ )
184
+ const isZeroTotal = computed(
185
+ () => Number($stores[props.type]?.total || 0) === 0,
186
+ )
187
+ const itemsCount = computed(() =>
188
+ Array.isArray($stores[props.type]?.items)
189
+ ? $stores[props.type]?.items?.length || 0
190
+ : 0,
191
+ )
192
+ const showSkeleton = computed(
193
+ () =>
194
+ isLoading.value ||
195
+ (isZeroTotal.value && (isAnySearchActive.value || itemsCount.value > 0)),
196
+ )
161
197
  </script>
162
198
 
163
199
  <style lang="scss" scoped></style>
@@ -1,35 +1,39 @@
1
1
  <template>
2
- <v-menu>
2
+ <v-menu :disabled="$stores[type].loading">
3
3
  <template #activator="{ props: menu }">
4
4
  <v-tooltip location="top">
5
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>
6
+ <template v-if="$stores[type].loading">
7
+ <v-skeleton-loader type="button" :class="{ 'mt-3': isXsDisplay }" />
8
+ </template>
9
+ <template v-else>
10
+ <v-btn
11
+ x-large
12
+ outlined
13
+ tile
14
+ flat
15
+ icon
16
+ :class="{ 'mt-3': isXsDisplay }"
17
+ v-bind="mergeProps(menu, tooltip)"
18
+ >
19
+ <v-icon>mdi-{{ current?.icon || defaultSort?.icon }}</v-icon>
20
+ </v-btn>
21
+ </template>
19
22
  </template>
20
23
  <div
21
24
  v-html="
22
25
  $t('list.sort-mode') +
23
- $t('list.' + current.text || defaultSort.text)
26
+ $t('list.' + (current?.text || defaultSort?.text))
24
27
  "
25
28
  />
26
29
  </v-tooltip>
27
30
  </template>
28
31
  <v-list density="compact">
29
- <template v-for="(item, index) in items">
32
+ <template v-for="(item, index) in $stores[props.type].sort">
30
33
  <v-list-item
31
34
  v-if="item.text !== current.text"
32
35
  :key="index"
36
+ :disabled="$stores[type].loading"
33
37
  @click="updateSort(item.value)"
34
38
  >
35
39
  <template #prepend>
@@ -59,7 +63,7 @@ const props = defineProps({
59
63
  required: true,
60
64
  },
61
65
  })
62
- const items = ref($stores[props.type].sort)
66
+ const items = ref()
63
67
  const defaultSort = ref(
64
68
  $stores[props.type].sort[
65
69
  Object.keys($stores[props.type].sort).find(
@@ -87,7 +91,7 @@ const current = computed(() => {
87
91
  })
88
92
 
89
93
  const updateSort = async (value) => {
90
- await rootStore.updateSort({ value, type: props.type, lang: locale.value })
94
+ rootStore.updateSort({ value, type: props.type, lang: locale.value })
91
95
  }
92
96
  </script>
93
97