@paris-ias/list 1.0.100 → 1.0.101
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 +1 -1
- package/dist/runtime/components/events/SlidingItem.vue +1 -12
- package/dist/runtime/components/list/molecules/Filters.vue +8 -1
- package/dist/runtime/plugins/pinia.js +15 -0
- package/dist/runtime/stores/root.d.ts +2 -2
- package/dist/runtime/stores/root.js +6 -3
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<v-sheet
|
|
3
|
-
v-motion
|
|
4
|
-
class="d-flex sliding-item flex-md-row flex-column px-6"
|
|
5
|
-
:initial="{
|
|
6
|
-
opacity: 0,
|
|
7
|
-
x: 100,
|
|
8
|
-
}"
|
|
9
|
-
:enter="{
|
|
10
|
-
opacity: 1,
|
|
11
|
-
x: 0,
|
|
12
|
-
}"
|
|
13
|
-
>
|
|
2
|
+
<v-sheet v-motion class="d-flex sliding-item flex-md-row flex-column px-6">
|
|
14
3
|
<MiscAtomsDateStamp
|
|
15
4
|
:date-start="item.start"
|
|
16
5
|
:date-stop="item.stop"
|
|
@@ -48,7 +48,7 @@ import { useI18n } from "vue-i18n";
|
|
|
48
48
|
const { smAndDown } = useDisplay();
|
|
49
49
|
const i18n = useI18n();
|
|
50
50
|
const { locale, messages } = useI18n();
|
|
51
|
-
const { $stores } = useNuxtApp();
|
|
51
|
+
const { $stores, $filters } = useNuxtApp();
|
|
52
52
|
const rootStore = useRootStore();
|
|
53
53
|
const props = defineProps(["type", "expanded"]);
|
|
54
54
|
const ComponentName = (name) => {
|
|
@@ -60,6 +60,13 @@ const getItems = (name) => {
|
|
|
60
60
|
if ($stores[props.type].filters[name].type === "Checkbox") {
|
|
61
61
|
return [];
|
|
62
62
|
}
|
|
63
|
+
if ($filters?.[props.type]?.[name]) {
|
|
64
|
+
console.log("filters found for ", name, $filters[props.type][name]);
|
|
65
|
+
return $filters[props.type][name].filter((key) => key !== "label").map((item) => ({
|
|
66
|
+
title: i18n.t(`list.filters.${props.type}.${name}.${item}`),
|
|
67
|
+
value: item
|
|
68
|
+
}));
|
|
69
|
+
}
|
|
63
70
|
if (messages.value[locale.value].list.filters[props.type][name] === void 0) {
|
|
64
71
|
console.log("name not found, no item for this filmter: ", name);
|
|
65
72
|
return [];
|
|
@@ -107,6 +107,20 @@ export default defineNuxtPlugin(async (nuxtApp) => {
|
|
|
107
107
|
const stores = {};
|
|
108
108
|
const queries = {};
|
|
109
109
|
const models = {};
|
|
110
|
+
let builtFilters = {};
|
|
111
|
+
try {
|
|
112
|
+
const filtersResponse = await fetch(
|
|
113
|
+
"https://cdn-yggdrasil-dev.s3.eu-west-2.amazonaws.com/iea/filters.json"
|
|
114
|
+
);
|
|
115
|
+
if (filtersResponse.ok) {
|
|
116
|
+
builtFilters = await filtersResponse.json();
|
|
117
|
+
console.log("Filters loaded successfully:", builtFilters);
|
|
118
|
+
} else {
|
|
119
|
+
console.warn("Failed to load filters, using empty object");
|
|
120
|
+
}
|
|
121
|
+
} catch (error) {
|
|
122
|
+
console.error("Error loading filters:", error);
|
|
123
|
+
}
|
|
110
124
|
console.log("INITIALIZING STORES");
|
|
111
125
|
await Promise.all(
|
|
112
126
|
appConfig.list.modules.map(async (type) => {
|
|
@@ -129,4 +143,5 @@ export default defineNuxtPlugin(async (nuxtApp) => {
|
|
|
129
143
|
nuxtApp.provide("rootStore", rootStore);
|
|
130
144
|
nuxtApp.provide("stores", stores);
|
|
131
145
|
nuxtApp.provide("queries", queries);
|
|
146
|
+
nuxtApp.provide("filters", builtFilters);
|
|
132
147
|
});
|
|
@@ -45,10 +45,10 @@ export declare const useRootStore: import("pinia").StoreDefinition<"rootStore",
|
|
|
45
45
|
value: number;
|
|
46
46
|
type: string;
|
|
47
47
|
}): void;
|
|
48
|
-
updatePage({ page, type }: {
|
|
48
|
+
updatePage({ page, type, }: {
|
|
49
49
|
page: number;
|
|
50
50
|
type: string;
|
|
51
|
-
}): void
|
|
51
|
+
}): Promise<void>;
|
|
52
52
|
initializePageFromRoute(): void;
|
|
53
53
|
updateSearch({ type, search, lang, }: {
|
|
54
54
|
type: string;
|
|
@@ -185,7 +185,10 @@ export const useRootStore = defineStore("rootStore", {
|
|
|
185
185
|
}
|
|
186
186
|
this.update(type);
|
|
187
187
|
},
|
|
188
|
-
updatePage({
|
|
188
|
+
async updatePage({
|
|
189
|
+
page,
|
|
190
|
+
type
|
|
191
|
+
}) {
|
|
189
192
|
const router = useRouter();
|
|
190
193
|
const currentQuery = router.currentRoute.value.query;
|
|
191
194
|
const newQuery = { ...currentQuery };
|
|
@@ -194,9 +197,9 @@ export const useRootStore = defineStore("rootStore", {
|
|
|
194
197
|
} else {
|
|
195
198
|
delete newQuery.page;
|
|
196
199
|
}
|
|
197
|
-
router.replace({ query: newQuery });
|
|
198
200
|
this.page = page;
|
|
199
|
-
|
|
201
|
+
await router.replace({ query: newQuery });
|
|
202
|
+
await this.update(type);
|
|
200
203
|
},
|
|
201
204
|
initializePageFromRoute() {
|
|
202
205
|
const { query } = useRouter().currentRoute.value;
|