@v-c/select 1.0.19-beta.3 → 1.0.20

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.
@@ -1,11 +1,11 @@
1
- import { computed, shallowRef } from "vue";
1
+ import { computed } from "vue";
2
2
  function useCache(labeledValues, valueOptions) {
3
- const cacheRef = shallowRef({
3
+ const cache = {
4
4
  values: /* @__PURE__ */ new Map(),
5
5
  options: /* @__PURE__ */ new Map()
6
- });
6
+ };
7
7
  const filledLabeledValues = computed(() => {
8
- const { values: prevValueCache, options: prevOptionCache } = cacheRef.value;
8
+ const { values: prevValueCache, options: prevOptionCache } = cache;
9
9
  const patchedValues = labeledValues.value.map((item) => {
10
10
  if (item.label === void 0) return {
11
11
  ...item,
@@ -20,14 +20,12 @@ function useCache(labeledValues, valueOptions) {
20
20
  const option = valueOptions.value.get(item.value) || prevOptionCache.get(item.value);
21
21
  if (option) optionCache.set(item.value, option);
22
22
  });
23
- cacheRef.value = {
24
- values: valueCache,
25
- options: optionCache
26
- };
23
+ cache.values = valueCache;
24
+ cache.options = optionCache;
27
25
  return patchedValues;
28
26
  });
29
27
  const getOption = (val) => {
30
- return valueOptions.value.get(val) || cacheRef.value.options.get(val);
28
+ return valueOptions.value.get(val) || cache.options.get(val);
31
29
  };
32
30
  return [filledLabeledValues, getOption];
33
31
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@v-c/select",
3
3
  "type": "module",
4
- "version": "1.0.19-beta.3",
4
+ "version": "1.0.20",
5
5
  "description": "",
6
6
  "author": "",
7
7
  "license": "MIT",
@@ -29,10 +29,10 @@
29
29
  "vue": "^3.0.0"
30
30
  },
31
31
  "dependencies": {
32
- "@v-c/overflow": "^1.0.4-beta.1",
33
- "@v-c/util": "^1.0.17",
34
- "@v-c/virtual-list": "^1.0.6",
35
- "@v-c/trigger": "^1.0.12-beta.2"
32
+ "@v-c/overflow": "^1.0.4",
33
+ "@v-c/trigger": "^1.0.13",
34
+ "@v-c/util": "^1.0.18",
35
+ "@v-c/virtual-list": "^1.0.6"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "vite build",