qidian-vue-ui 2.0.31 → 2.0.32

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,31 +1,31 @@
1
- .qd-dialog-table-select[data-v-49177435] {
1
+ .qd-dialog-table-select[data-v-30e6f548] {
2
2
  width: 100%;
3
3
  }
4
- .qd-dialog-table-select__trigger[data-v-49177435] {
4
+ .qd-dialog-table-select__trigger[data-v-30e6f548] {
5
5
  width: 100%;
6
6
  }
7
- .qd-dialog-table-select__trigger[data-v-49177435]:not(.qd-dialog-table-select__trigger--readonly):not(.qd-dialog-table-select__trigger--disabled) {
7
+ .qd-dialog-table-select__trigger[data-v-30e6f548]:not(.qd-dialog-table-select__trigger--readonly):not(.qd-dialog-table-select__trigger--disabled) {
8
8
  cursor: pointer;
9
9
  }
10
- .qd-dialog-table-select__input-trigger[data-v-49177435] {
10
+ .qd-dialog-table-select__input-trigger[data-v-30e6f548] {
11
11
  border-top-left-radius: 0;
12
12
  border-bottom-left-radius: 0;
13
13
  }
14
- .qd-dialog-table-select__table[data-v-49177435] .qd-crud-search > .t-loading__parent > .t-card__body,
15
- .qd-dialog-table-select__table[data-v-49177435] .qd-crud-table__body > .t-loading__parent > .t-card__body {
14
+ .qd-dialog-table-select__table[data-v-30e6f548] .qd-crud-search > .t-loading__parent > .t-card__body,
15
+ .qd-dialog-table-select__table[data-v-30e6f548] .qd-crud-table__body > .t-loading__parent > .t-card__body {
16
16
  padding: 0 !important;
17
17
  }
18
- .qd-dialog-table-select__table[data-v-49177435] .qd-crud-table__toolbar {
18
+ .qd-dialog-table-select__table[data-v-30e6f548] .qd-crud-table__toolbar {
19
19
  display: none;
20
20
  }
21
- .qd-dialog-table-select__table[data-v-49177435] .qd-service-table {
21
+ .qd-dialog-table-select__table[data-v-30e6f548] .qd-service-table {
22
22
  margin-top: 0;
23
23
  }
24
- .qd-dialog-table-select__table-add[data-v-49177435] {
24
+ .qd-dialog-table-select__table-add[data-v-30e6f548] {
25
25
  margin-top: var(--td-comp-margin-m);
26
26
  display: flex;
27
27
  }
28
- .qd-dialog-table-select__table-add .t-input__wrap[data-v-49177435] {
28
+ .qd-dialog-table-select__table-add .t-input__wrap[data-v-30e6f548] {
29
29
  flex: 1 1 0;
30
30
  overflow: hidden;
31
31
  margin-right: var(--td-comp-margin-m);
@@ -27,6 +27,7 @@ declare const _default: <D extends TableRowData = TableRowData, R = unknown, P =
27
27
  'dialog-footer'?: (props: {
28
28
  cancel: (event: MouseEvent) => void;
29
29
  confirm: () => Promise<boolean | void>;
30
+ confirmDisabled: boolean;
30
31
  confirmLoading: boolean;
31
32
  selectedOptions: import("@vue/reactivity").UnwrapRefSimple<D>[];
32
33
  }) => any;
@@ -2,7 +2,7 @@ import './index.css'
2
2
  import _sfc_main from "./index.vue2.mjs";
3
3
  /* empty css */
4
4
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
5
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-49177435"]]);
5
+ const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-30e6f548"]]);
6
6
  export {
7
7
  index as default
8
8
  };
@@ -1,5 +1,5 @@
1
1
  import './index.css'
2
- import { defineComponent, mergeDefaults, useTemplateRef, ref, reactive, computed, createVNode, watch, createElementBlock, openBlock, Fragment, createElementVNode, mergeProps, renderSlot, createBlock, unref, withCtx, renderList, createTextVNode, toDisplayString, isRef, createSlots, normalizeProps, guardReactiveProps } from "vue";
2
+ import { defineComponent, mergeDefaults, useTemplateRef, ref, computed, reactive, createVNode, watch, createElementBlock, openBlock, Fragment, createElementVNode, mergeProps, renderSlot, createBlock, unref, withCtx, renderList, createTextVNode, toDisplayString, isRef, createSlots, normalizeProps, guardReactiveProps } from "vue";
3
3
  import { useVModels } from "../../node_modules/.pnpm/@vueuse_core@14.2.0_vue@3.5.26_typescript@5.9.3_/node_modules/@vueuse/core/dist/index.mjs";
4
4
  import { isEmpty, identifyType, useDoubleClick, suspectedWrapperPromise, createExposeProxy, extractSlotsWithPrefix, hasOwn } from "qidian-shared";
5
5
  import { AddIcon, SearchIcon } from "tdesign-icons-vue-next";
@@ -358,6 +358,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
358
358
  const selectedRowKeys = ref([]);
359
359
  const selectedRows = ref([]);
360
360
  const latestSelectedRows = ref([]);
361
+ const confirmDisabled = computed(() => isEmpty(data.value));
361
362
  let lastRowKey;
362
363
  const addCustom = reactive({
363
364
  visible: false,
@@ -440,6 +441,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
440
441
  header: placeholder,
441
442
  onCancel
442
443
  }, wrapper);
444
+ if (confirmDisabled.value && dialogOptions.confirmBtn !== null) {
445
+ dialogOptions.confirmBtn = typeof dialogOptions.confirmBtn === "string" ? {
446
+ content: dialogOptions.confirmBtn,
447
+ disabled: true
448
+ } : typeof dialogOptions.confirmBtn === "object" ? {
449
+ ...dialogOptions.confirmBtn,
450
+ disabled: true
451
+ } : {
452
+ disabled: true
453
+ };
454
+ }
443
455
  const onBeforeOpen = dialogOptions.onBeforeOpen;
444
456
  dialogOptions.onBeforeOpen = () => {
445
457
  onBeforeOpen?.();
@@ -844,6 +856,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
844
856
  fn: withCtx(() => [renderSlot(_ctx.$slots, "dialog-footer", {
845
857
  cancel: handleFooterCancel,
846
858
  confirm: () => handleConfirm(),
859
+ confirmDisabled: confirmDisabled.value,
847
860
  confirmLoading: confirmLoad.value,
848
861
  selectedOptions: latestSelectedRows.value
849
862
  }, void 0, true)]),
@@ -1,37 +1,37 @@
1
- .qd-dialog-tabs-table-select[data-v-1461ff61] {
1
+ .qd-dialog-tabs-table-select[data-v-158a6f3b] {
2
2
  width: 100%;
3
3
  }
4
- .qd-dialog-tabs-table-select__trigger[data-v-1461ff61] {
4
+ .qd-dialog-tabs-table-select__trigger[data-v-158a6f3b] {
5
5
  width: 100%;
6
6
  }
7
- .qd-dialog-tabs-table-select__trigger[data-v-1461ff61]:not(.qd-dialog-tabs-table-select__trigger--readonly):not(.qd-dialog-tabs-table-select__trigger--disabled) {
7
+ .qd-dialog-tabs-table-select__trigger[data-v-158a6f3b]:not(.qd-dialog-tabs-table-select__trigger--readonly):not(.qd-dialog-tabs-table-select__trigger--disabled) {
8
8
  cursor: pointer;
9
9
  }
10
- .qd-dialog-tabs-table-select__input-trigger[data-v-1461ff61] {
10
+ .qd-dialog-tabs-table-select__input-trigger[data-v-158a6f3b] {
11
11
  border-top-left-radius: 0;
12
12
  border-bottom-left-radius: 0;
13
13
  }
14
- .qd-dialog-tabs-table-select__table[data-v-1461ff61] .qd-crud-search > .t-loading__parent > .t-card__body {
14
+ .qd-dialog-tabs-table-select__table[data-v-158a6f3b] .qd-crud-search > .t-loading__parent > .t-card__body {
15
15
  padding-left: 0 !important;
16
16
  padding-right: 0 !important;
17
17
  padding-bottom: 0 !important;
18
18
  }
19
- .qd-dialog-tabs-table-select__table[data-v-1461ff61] .qd-crud-table__body > .t-loading__parent > .t-card__body {
19
+ .qd-dialog-tabs-table-select__table[data-v-158a6f3b] .qd-crud-table__body > .t-loading__parent > .t-card__body {
20
20
  padding-left: 0 !important;
21
21
  padding-right: 0 !important;
22
22
  padding-bottom: 0 !important;
23
23
  }
24
- .qd-dialog-tabs-table-select__table[data-v-1461ff61] .qd-crud-table__toolbar {
24
+ .qd-dialog-tabs-table-select__table[data-v-158a6f3b] .qd-crud-table__toolbar {
25
25
  display: none;
26
26
  }
27
- .qd-dialog-tabs-table-select__table[data-v-1461ff61] .qd-service-table {
27
+ .qd-dialog-tabs-table-select__table[data-v-158a6f3b] .qd-service-table {
28
28
  margin-top: 0;
29
29
  }
30
- .qd-dialog-tabs-table-select__table-add[data-v-1461ff61] {
30
+ .qd-dialog-tabs-table-select__table-add[data-v-158a6f3b] {
31
31
  margin-top: var(--td-comp-margin-m);
32
32
  display: flex;
33
33
  }
34
- .qd-dialog-tabs-table-select__table-add .t-input__wrap[data-v-1461ff61] {
34
+ .qd-dialog-tabs-table-select__table-add .t-input__wrap[data-v-158a6f3b] {
35
35
  flex: 1 1 0;
36
36
  overflow: hidden;
37
37
  margin-right: var(--td-comp-margin-m);
@@ -22,6 +22,7 @@ declare const _default: <D extends TableRowData = TableRowData, R = unknown, P =
22
22
  'dialog-footer'?: (props: {
23
23
  cancel: (event: MouseEvent) => void;
24
24
  confirm: () => Promise<boolean | void>;
25
+ confirmDisabled: boolean;
25
26
  confirmLoading: boolean;
26
27
  selectedOptions: import("@vue/reactivity").UnwrapRefSimple<D>[];
27
28
  activeTab: import("tdesign-vue-next").TabValue | undefined;
@@ -2,7 +2,7 @@ import './index.css'
2
2
  import _sfc_main from "./index.vue2.mjs";
3
3
  /* empty css */
4
4
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
5
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-1461ff61"]]);
5
+ const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-158a6f3b"]]);
6
6
  export {
7
7
  index as default
8
8
  };
@@ -1,7 +1,7 @@
1
1
  import './index.css'
2
2
  import { defineComponent, mergeDefaults, ref, useTemplateRef, computed, reactive, h, watch, createElementBlock, openBlock, Fragment, createElementVNode, createVNode, mergeProps, unref, renderSlot, createBlock, withCtx, renderList, createTextVNode, toDisplayString, isRef, createSlots, normalizeProps, guardReactiveProps, nextTick } from "vue";
3
3
  import { useVModels } from "../../node_modules/.pnpm/@vueuse_core@14.2.0_vue@3.5.26_typescript@5.9.3_/node_modules/@vueuse/core/dist/index.mjs";
4
- import { useDoubleClick, isEmpty, identifyType, suspectedWrapperPromise, createExposeProxy, extractSlotsWithPrefix, hasOwn } from "qidian-shared";
4
+ import { isEmpty, useDoubleClick, identifyType, suspectedWrapperPromise, createExposeProxy, extractSlotsWithPrefix, hasOwn } from "qidian-shared";
5
5
  import { AddIcon, SearchIcon } from "tdesign-icons-vue-next";
6
6
  import { Select, Option, InputAdornment, Input, Button, Space } from "tdesign-vue-next";
7
7
  import { useConfig } from "../config-provider/useConfig.mjs";
@@ -355,6 +355,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
355
355
  const latestSelectedTab = ref(props.activeTab);
356
356
  const dialogRef = useTemplateRef("dialog");
357
357
  const tabsTableRef = useTemplateRef("tabsTable");
358
+ const confirmDisabled = computed(() => !props.tabs.length || isEmpty(tabsTableRef.value?.data));
358
359
  const sel = useServiceDialogTableSelect(props, {
359
360
  modelValue,
360
361
  visible,
@@ -386,6 +387,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
386
387
  const dialogOptions = {
387
388
  ...selectState.dialogOptions
388
389
  };
390
+ if (confirmDisabled.value && dialogOptions.confirmBtn !== null) {
391
+ dialogOptions.confirmBtn = typeof dialogOptions.confirmBtn === "string" ? {
392
+ content: dialogOptions.confirmBtn,
393
+ disabled: true
394
+ } : typeof dialogOptions.confirmBtn === "object" ? {
395
+ ...dialogOptions.confirmBtn,
396
+ disabled: true
397
+ } : {
398
+ disabled: true
399
+ };
400
+ }
389
401
  const onBeforeOpen = dialogOptions.onBeforeOpen;
390
402
  dialogOptions.onBeforeOpen = () => {
391
403
  currentActiveTab.value = activeTab.value ?? props.tabs[0]?.value;
@@ -1022,6 +1034,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1022
1034
  fn: withCtx(() => [renderSlot(_ctx.$slots, "dialog-footer", {
1023
1035
  cancel: handleFooterCancel,
1024
1036
  confirm: () => handleConfirm(),
1037
+ confirmDisabled: confirmDisabled.value,
1025
1038
  confirmLoading: unref(confirmLoad),
1026
1039
  selectedOptions: unref(latestSelectedRows),
1027
1040
  activeTab: currentActiveTab.value
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qidian-vue-ui",
3
- "version": "2.0.31",
3
+ "version": "2.0.32",
4
4
  "description": "基于 TDesign 的 QiDian Vue UI 组件库",
5
5
  "author": "qidian",
6
6
  "license": "MIT",