@v-c/select 0.0.4 → 1.0.0

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.
@@ -109,7 +109,10 @@ const BaseSelect = /* @__PURE__ */ (0, vue.defineComponent)((props, { expose, at
109
109
  const val = displayValues.value?.[0]?.value;
110
110
  return typeof val === "string" || typeof val === "number" ? String(val) : "";
111
111
  });
112
- const emptyListContent = (0, vue.computed)(() => !props.notFoundContent && props.emptyOptions);
112
+ const mergedNotFoundContent = (0, vue.computed)(() => {
113
+ return props.notFoundContent ?? "Not Found";
114
+ });
115
+ const emptyListContent = (0, vue.computed)(() => !mergedNotFoundContent.value && props.emptyOptions);
113
116
  const [mergedOpen, triggerOpen] = require_useOpen.default(open, (openVal) => {
114
117
  props.onPopupVisibleChange?.(openVal);
115
118
  }, (nextOpen) => {
@@ -228,6 +231,7 @@ const BaseSelect = /* @__PURE__ */ (0, vue.defineComponent)((props, { expose, at
228
231
  require_useBaseProps.useBaseSelectProvider((0, vue.computed)(() => {
229
232
  return {
230
233
  ...props,
234
+ notFoundContent: mergedNotFoundContent.value,
231
235
  open: mergedOpen.value,
232
236
  triggerOpen: mergedOpen.value,
233
237
  toggleOpen: triggerOpen,
@@ -102,7 +102,10 @@ const BaseSelect = /* @__PURE__ */ defineComponent((props, { expose, attrs }) =>
102
102
  const val = displayValues.value?.[0]?.value;
103
103
  return typeof val === "string" || typeof val === "number" ? String(val) : "";
104
104
  });
105
- const emptyListContent = computed(() => !props.notFoundContent && props.emptyOptions);
105
+ const mergedNotFoundContent = computed(() => {
106
+ return props.notFoundContent ?? "Not Found";
107
+ });
108
+ const emptyListContent = computed(() => !mergedNotFoundContent.value && props.emptyOptions);
106
109
  const [mergedOpen, triggerOpen] = useOpen(open, (openVal) => {
107
110
  props.onPopupVisibleChange?.(openVal);
108
111
  }, (nextOpen) => {
@@ -221,6 +224,7 @@ const BaseSelect = /* @__PURE__ */ defineComponent((props, { expose, attrs }) =>
221
224
  useBaseSelectProvider(computed(() => {
222
225
  return {
223
226
  ...props,
227
+ notFoundContent: mergedNotFoundContent.value,
224
228
  open: mergedOpen.value,
225
229
  triggerOpen: mergedOpen.value,
226
230
  toggleOpen: triggerOpen,
package/dist/Select.cjs CHANGED
@@ -613,12 +613,12 @@ var Select = /* @__PURE__ */ (0, vue.defineComponent)({
613
613
  };
614
614
  });
615
615
  };
616
- const internalValue = (0, vue.shallowRef)(props.defaultValue);
616
+ const internalValue = (0, vue.shallowRef)(props?.value ?? props.defaultValue);
617
617
  (0, vue.watch)(() => props.value, (val) => {
618
- if (val !== void 0) internalValue.value = val;
619
- }, { immediate: true });
618
+ if (val !== internalValue.value) internalValue.value = val;
619
+ });
620
620
  const setInternalValue = (val) => {
621
- if (props.value === void 0) internalValue.value = val;
621
+ internalValue.value = val;
622
622
  };
623
623
  const [mergedValues, getMixedOption] = require_useCache.default((0, vue.computed)(() => {
624
624
  const values = convert2LabelValues(multiple.value && internalValue.value === null ? [] : internalValue.value);
package/dist/Select.js CHANGED
@@ -609,12 +609,12 @@ var Select_default = /* @__PURE__ */ defineComponent({
609
609
  };
610
610
  });
611
611
  };
612
- const internalValue = shallowRef(props.defaultValue);
612
+ const internalValue = shallowRef(props?.value ?? props.defaultValue);
613
613
  watch(() => props.value, (val) => {
614
- if (val !== void 0) internalValue.value = val;
615
- }, { immediate: true });
614
+ if (val !== internalValue.value) internalValue.value = val;
615
+ });
616
616
  const setInternalValue = (val) => {
617
- if (props.value === void 0) internalValue.value = val;
617
+ internalValue.value = val;
618
618
  };
619
619
  const [mergedValues, getMixedOption] = useCache(computed(() => {
620
620
  const values = convert2LabelValues(multiple.value && internalValue.value === null ? [] : internalValue.value);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@v-c/select",
3
3
  "type": "module",
4
- "version": "0.0.4",
4
+ "version": "1.0.0",
5
5
  "description": "",
6
6
  "author": "",
7
7
  "license": "MIT",
@@ -30,14 +30,15 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@v-c/overflow": "^1.0.0",
33
+ "@v-c/util": "^1.0.2",
33
34
  "@v-c/trigger": "^1.0.1",
34
- "@v-c/virtual-list": "^1.0.3",
35
- "@v-c/util": "^1.0.2"
35
+ "@v-c/virtual-list": "^1.0.3"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "vite build",
39
39
  "test": "vitest run",
40
40
  "prepublish": "pnpm build",
41
- "bump": "bumpp --release patch"
41
+ "patch": "bumpp --release patch",
42
+ "bump": "bumpp"
42
43
  }
43
44
  }