@paris-ias/list 1.0.64 → 1.0.66

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.64",
4
+ "version": "1.0.66",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.0",
7
7
  "unbuild": "3.5.0"
@@ -9,7 +9,12 @@
9
9
  icon
10
10
  class="ml-auto"
11
11
  v-bind="tooltip"
12
- @click="rootStore.resetState(type)"
12
+ @click="
13
+ () => {
14
+ rootStore.resetState(type);
15
+ rootStore.update(type);
16
+ }
17
+ "
13
18
  >
14
19
  <v-icon>mdi-restore</v-icon>
15
20
  </v-btn>
@@ -113,7 +113,16 @@ export const useRootStore = defineStore("rootStore", {
113
113
  resetState(type) {
114
114
  const { $stores, $models } = useNuxtApp();
115
115
  console.log("$models[type]: ", $models[type]);
116
- $stores[type] = $models[type];
116
+ const store = $stores[type];
117
+ if (store.filters) {
118
+ for (const key in store.filters) {
119
+ if (store.filters[key].multiple) {
120
+ store.filters[key].value = [];
121
+ } else {
122
+ store.filters[key].value = "";
123
+ }
124
+ }
125
+ }
117
126
  console.log("resetState");
118
127
  this.search = "";
119
128
  this.page = 1;
@@ -122,6 +131,8 @@ export const useRootStore = defineStore("rootStore", {
122
131
  this.total = 0;
123
132
  this.skip = 0;
124
133
  this.numberOfPages = 0;
134
+ this.setFiltersCount(type);
135
+ this.updateRouteQuery(type);
125
136
  },
126
137
  updateSort({ value, type }) {
127
138
  const { $stores } = useNuxtApp();
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.64",
4
+ "version": "1.0.66",
5
5
  "name": "@paris-ias/list",
6
6
  "repository": {
7
7
  "url": "git+https://github.com/IEA-Paris/list.git",