@v-c/select 1.0.13 → 1.0.15

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.
@@ -169,11 +169,14 @@ var OptionList_default = /* @__PURE__ */ defineComponent({
169
169
  const item = memoFlattenOptions.value[index];
170
170
  if (!item) return null;
171
171
  const itemData = item.data || {};
172
- const { value } = itemData;
172
+ const { value, disabled } = itemData;
173
173
  const { group } = item;
174
174
  const attrs = pickAttrs(itemData, true);
175
175
  const mergedLabel = getLabel(item);
176
- return item ? createVNode("div", mergeProps({ "aria-label": typeof mergedLabel === "string" && !group ? mergedLabel : void 0 }, attrs, { "key": index }, getItemAriaProps(item, index), { "aria-selected": isAriaSelected(value) }), [value]) : null;
176
+ return item ? createVNode("div", mergeProps({ "aria-label": typeof mergedLabel === "string" && !group ? mergedLabel : void 0 }, attrs, { "key": index }, getItemAriaProps(item, index), {
177
+ "aria-selected": isAriaSelected(value),
178
+ "aria-disabled": disabled
179
+ }), [value]) : null;
177
180
  };
178
181
  const a11yProps = {
179
182
  role: "listbox",
@@ -234,6 +237,7 @@ var OptionList_default = /* @__PURE__ */ defineComponent({
234
237
  if (title !== void 0) optionTitle = title;
235
238
  return createVNode("div", mergeProps(pickAttrs(passedProps), !virtual ? getItemAriaProps(item, itemIndex) : {}, {
236
239
  "aria-selected": virtual ? void 0 : isAriaSelected(value),
240
+ "aria-disabled": mergedDisabled,
237
241
  "class": optionClassName,
238
242
  "title": optionTitle,
239
243
  "onMousemove": () => {
package/dist/Select.js CHANGED
@@ -565,6 +565,9 @@ var Select_default = /* @__PURE__ */ defineComponent({
565
565
  onSearch: toRef(props, "onSearch"),
566
566
  autoClearSearchValue: toRef(props, "autoClearSearchValue")
567
567
  }, toRef(props, "mode"));
568
+ const normalizedOptionFilterProps = computed(() => {
569
+ return searchConfig.value?.optionFilterProp;
570
+ });
568
571
  const mergedFilterOption = computed(() => {
569
572
  if (searchConfig.value.filterOption === void 0 && props.mode === "combobox") return false;
570
573
  return searchConfig.value.filterOption;
@@ -579,7 +582,7 @@ var Select_default = /* @__PURE__ */ defineComponent({
579
582
  };
580
583
  const mergedSearchValue = computed(() => internalSearchValue.value || "");
581
584
  const childrenOptionsRef = shallowRef([]);
582
- const parsedOptions = useOptions(toRef(props, "options"), childrenOptionsRef, mergedFieldNames, toRef(props, "optionFilterProp"), toRef(props, "optionLabelProp"));
585
+ const parsedOptions = useOptions(toRef(props, "options"), childrenOptionsRef, mergedFieldNames, normalizedOptionFilterProps, toRef(props, "optionLabelProp"));
583
586
  const valueOptions = computed(() => parsedOptions.value.valueOptions);
584
587
  const labelOptions = computed(() => parsedOptions.value.labelOptions);
585
588
  const mergedOptions = computed(() => parsedOptions.value.options);
@@ -654,7 +657,7 @@ var Select_default = /* @__PURE__ */ defineComponent({
654
657
  if (!existOptions(val)) cloneOptions.push(createTagOption(val, item.label));
655
658
  });
656
659
  return cloneOptions;
657
- }), mergedFieldNames, mergedSearchValue, mergedFilterOption, toRef(props, "optionFilterProp"));
660
+ }), mergedFieldNames, mergedSearchValue, mergedFilterOption, normalizedOptionFilterProps);
658
661
  const filledSearchOptions = computed(() => {
659
662
  if (props.mode !== "tags" || !mergedSearchValue.value || filteredOptions.value.some((item) => item[props.optionFilterProp || "value"] === mergedSearchValue.value)) return filteredOptions.value;
660
663
  if (filteredOptions.value.some((item) => item[mergedFieldNames.value.value] === mergedSearchValue.value)) return filteredOptions.value;
@@ -46,17 +46,17 @@ var SingleContent_default = /* @__PURE__ */ defineComponent((props, { expose })
46
46
  const inputRef = shallowRef();
47
47
  expose({ input: computed(() => inputRef.value?.input) });
48
48
  return () => {
49
- const { prefixCls, mode, maxLength } = selectInputContext.value ?? {};
49
+ const { prefixCls, mode, maxLength, components } = selectInputContext.value ?? {};
50
50
  const { classNames, styles } = baseProps.value ?? {};
51
51
  const { inputProps } = props;
52
- const renderValue = displayValue.value ? hasOptionStyle.value ? createVNode("div", {
52
+ const renderValue = !(combobox && components?.input) ? displayValue.value ? hasOptionStyle.value ? createVNode("div", {
53
53
  "class": clsx(`${prefixCls}-content-value`, optionClassName.value),
54
54
  "style": {
55
55
  ...mergedSearchValue.value ? { visibility: "hidden" } : {},
56
56
  ...optionStyle.value
57
57
  },
58
58
  "title": optionTitle.value
59
- }, [displayValue.value.label]) : displayValue.value.label : createVNode(Placeholder_default, { "show": !mergedSearchValue.value }, null);
59
+ }, [displayValue.value?.label]) : displayValue.value?.label : createVNode(Placeholder_default, { "show": !mergedSearchValue.value }, null) : null;
60
60
  return createVNode("div", {
61
61
  "class": clsx(`${prefixCls}-content`, displayValue.value && `${prefixCls}-content-has-value`, mergedSearchValue.value && `${prefixCls}-content-has-search-value`, hasOptionStyle.value && `${prefixCls}-content-has-option-style`, classNames?.content),
62
62
  "style": styles?.content,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@v-c/select",
3
3
  "type": "module",
4
- "version": "1.0.13",
4
+ "version": "1.0.15",
5
5
  "description": "",
6
6
  "author": "",
7
7
  "license": "MIT",
@@ -25,20 +25,20 @@
25
25
  "dist",
26
26
  "package.json"
27
27
  ],
28
- "peerDependencies": {
29
- "vue": "^3.0.0"
30
- },
31
- "dependencies": {
32
- "@v-c/overflow": "^1.0.3",
33
- "@v-c/trigger": "^1.0.11",
34
- "@v-c/virtual-list": "^1.0.6",
35
- "@v-c/util": "^1.0.14"
36
- },
37
28
  "scripts": {
38
29
  "build": "vite build",
39
30
  "test": "vitest run",
40
31
  "prepublish": "pnpm build",
41
32
  "patch": "bumpp --release patch",
42
33
  "bump": "bumpp"
34
+ },
35
+ "peerDependencies": {
36
+ "vue": "^3.0.0"
37
+ },
38
+ "dependencies": {
39
+ "@v-c/overflow": "workspace:^",
40
+ "@v-c/trigger": "workspace:^",
41
+ "@v-c/util": "workspace:^",
42
+ "@v-c/virtual-list": "workspace:^"
43
43
  }
44
- }
44
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2023 antdv-community
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.