@paris-ias/list 1.0.45 → 1.0.46

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.45",
4
+ "version": "1.0.46",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.1",
7
7
  "unbuild": "3.5.0"
@@ -11,7 +11,7 @@
11
11
  clearable
12
12
  tile
13
13
  type="search"
14
- :loading="$rootStore.loading"
14
+ :loading="rootStore.loading"
15
15
  >
16
16
  <!-- :loading="$nuxt.loading || $store.state.loading" :class="{ 'mt-3':
17
17
  $store.state.scrolled }" -->
@@ -29,7 +29,7 @@
29
29
  style="max-height: 300px"
30
30
  class="overflow-y-auto"
31
31
  >
32
- <div v-if="$rootStore.loading" class="d-flex justify-center py-6">
32
+ <div v-if="rootStore.loading" class="d-flex justify-center py-6">
33
33
  <v-progress-circular color="black" size="64" indeterminate />
34
34
  </div>
35
35
  <template v-for="(item, index) in results">
@@ -66,9 +66,11 @@
66
66
 
67
67
  <script setup>
68
68
  import { useDebounceFn } from "@vueuse/core";
69
+ import { useRootStore } from "../../../stores/root";
69
70
  import { useNuxtApp, useI18n, computed } from "#imports";
70
71
  const { locale, t } = useI18n();
71
- const { $stores, $rootStore } = useNuxtApp();
72
+ const rootStore = useRootStore();
73
+ const { $stores } = useNuxtApp();
72
74
  const props = defineProps({
73
75
  type: {
74
76
  type: String,
@@ -80,7 +82,7 @@ const props = defineProps({
80
82
  }
81
83
  });
82
84
  const results = computed(() => {
83
- const storeRst = $rootStore.results;
85
+ const storeRst = rootStore.results;
84
86
  const rst = Object.keys(storeRst).length && Object.keys(storeRst).sort((a, b) => {
85
87
  return storeRst[b]?.items?.length - storeRst[a]?.items?.length;
86
88
  }).reduce((acc, key, index) => {
@@ -109,10 +111,10 @@ const results = computed(() => {
109
111
  });
110
112
  const search = computed({
111
113
  get() {
112
- return props.type === "all" ? $rootStore.search : $stores[props.type].search;
114
+ return props.type === "all" ? rootStore.search : $stores[props.type].search;
113
115
  },
114
116
  set: await useDebounceFn(async function(v) {
115
- await $rootStore.updateSearch({
117
+ await rootStore.updateSearch({
116
118
  type: props.type,
117
119
  search: v || "",
118
120
  lang: locale.value
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.45",
4
+ "version": "1.0.46",
5
5
  "name": "@paris-ias/list",
6
6
  "repository": {
7
7
  "type": "git",