@v-c/select 1.1.2 → 1.1.3

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/Select.js CHANGED
@@ -663,6 +663,7 @@ var Select = /* @__PURE__ */ defineComponent({
663
663
  const filledSearchOptions = computed(() => {
664
664
  if (props.mode !== "tags" || !mergedSearchValue.value || filteredOptions.value.some((item) => item[props.optionFilterProp || "value"] === mergedSearchValue.value)) return filteredOptions.value;
665
665
  if (filteredOptions.value.some((item) => item[mergedFieldNames.value.value] === mergedSearchValue.value)) return filteredOptions.value;
666
+ if (valueOptions.value.get(mergedSearchValue.value)?.disabled) return filteredOptions.value;
666
667
  return [createTagOption(mergedSearchValue.value), ...filteredOptions.value];
667
668
  });
668
669
  const sorter = (inputOptions) => {
@@ -746,6 +747,10 @@ var Select = /* @__PURE__ */ defineComponent({
746
747
  if (info.source === "submit") {
747
748
  const formatted = (searchText || "").trim();
748
749
  if (formatted) {
750
+ if (valueOptions.value.get(formatted)?.disabled) {
751
+ setSearchValue("");
752
+ return;
753
+ }
749
754
  triggerChange(Array.from(new Set([...rawValues.value, formatted])));
750
755
  triggerSelect(formatted, true);
751
756
  setSearchValue("");
@@ -762,6 +767,7 @@ var Select = /* @__PURE__ */ defineComponent({
762
767
  if (props.mode !== "tags") patchValues = words.map((word) => {
763
768
  return labelOptions.value.get(word)?.[mergedFieldNames.value.value];
764
769
  }).filter((val) => val !== void 0);
770
+ if (props.mode === "tags") patchValues = patchValues.filter((val) => !valueOptions.value.get(val)?.disabled);
765
771
  const newRawValues = Array.from(new Set([...rawValues.value, ...patchValues]));
766
772
  triggerChange(newRawValues);
767
773
  newRawValues.forEach((newRawValue) => {
@@ -49,8 +49,7 @@ var SelectTrigger = /* @__PURE__ */ defineComponent((props, { slots, attrs, expo
49
49
  });
50
50
  const isNumberPopupWidth = computed(() => typeof props.popupMatchSelectWidth === "number");
51
51
  const stretch = computed(() => {
52
- if (isNumberPopupWidth.value) return null;
53
- return props.popupMatchSelectWidth === false ? "minWidth" : "width";
52
+ return props.popupMatchSelectWidth === false || isNumberPopupWidth.value ? "minWidth" : "width";
54
53
  });
55
54
  const triggerPopupRef = shallowRef();
56
55
  expose({ getPopupElement: () => triggerPopupRef.value?.popupElement });
package/package.json CHANGED
@@ -1,10 +1,15 @@
1
1
  {
2
2
  "name": "@v-c/select",
3
3
  "type": "module",
4
- "version": "1.1.2",
4
+ "version": "1.1.3",
5
5
  "description": "",
6
6
  "author": "",
7
7
  "license": "MIT",
8
+ "homepage": "https://github.com/antdv-next/vue-components/tree/next/packages/select",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/antdv-next/vue-components.git"
12
+ },
8
13
  "publishConfig": {
9
14
  "access": "public"
10
15
  },