qidian-vue-ui 2.7.3 → 2.7.5

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.
@@ -239,8 +239,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
239
239
  }
240
240
  function setDefaultSelectFirst(data) {
241
241
  if (!hasAutoSelected && reProps.value.defaultSelectFirst && isEmpty(reModelValue.value) && data.length) {
242
- const firstOption = data[0];
243
- const { multiple, valueType } = reProps.value.selectOptions;
242
+ const { keys, multiple, valueType } = reProps.value.selectOptions;
243
+ const firstOption = data.find(
244
+ (option) => !option[keys?.disabled || "disabled"]
245
+ );
246
+ if (!firstOption) return;
244
247
  const firstValue = valueType === "object" ? firstOption : firstOption.value;
245
248
  const value = multiple ? [firstValue] : firstValue;
246
249
  reModelValue.value = value;
@@ -1,4 +1,4 @@
1
- .qd-service-select__load[data-v-5d80d43f] {
1
+ .qd-service-select__load[data-v-676b5752] {
2
2
  width: 100%;
3
3
  border-top: 1px solid var(--td-component-stroke);
4
4
  padding: 6px;
@@ -4,7 +4,7 @@ import _sfc_main from "./index.vue2.mjs";
4
4
  /* empty css */
5
5
  /* empty css */
6
6
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
7
- const QdServiceSelect = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5d80d43f"]]);
7
+ const QdServiceSelect = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-676b5752"]]);
8
8
  export {
9
9
  QdServiceSelect as default
10
10
  };
@@ -404,8 +404,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
404
404
  }
405
405
  function setDefaultSelectFirst(data2) {
406
406
  if (!hasAutoSelected && reProps.value.defaultSelectFirst && isEmpty(reModelValue.value) && data2.length) {
407
- const firstOption = data2[0];
408
407
  const { keys, multiple, valueType } = reProps.value.selectOptions;
408
+ const firstOption = data2.find(
409
+ (option) => !option[keys?.disabled || qdServiceSelectKeys.disabled]
410
+ );
411
+ if (!firstOption) return;
409
412
  const firstValue = valueType === "object" ? firstOption : firstOption[keys?.value || qdServiceSelectKeys.value];
410
413
  reModelValue.value = multiple ? [firstValue] : firstValue;
411
414
  unWatchAutoSelected?.();
@@ -1,6 +1,7 @@
1
1
  export interface QdDictItem {
2
2
  label: string;
3
3
  value: string | number | boolean;
4
+ disabled?: boolean;
4
5
  remark?: string;
5
6
  class?: string;
6
7
  theme?: 'default' | 'warning' | 'danger' | 'success' | 'primary' | 'text';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qidian-vue-ui",
3
- "version": "2.7.3",
3
+ "version": "2.7.5",
4
4
  "description": "基于 TDesign 的 QiDian Vue UI 组件库",
5
5
  "author": "qidian",
6
6
  "license": "MIT",