qidian-vue-ui 2.0.46 → 2.0.48

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.
Files changed (30) hide show
  1. package/dist/components/config-provider/index.d.ts +3 -0
  2. package/dist/components/config-provider/types.d.ts +1 -0
  3. package/dist/components/config-provider/useConfig.d.ts +4 -0
  4. package/dist/components/crud/table/index.css +11 -11
  5. package/dist/components/crud/table/index.vue.mjs +1 -1
  6. package/dist/components/crud/table/index.vue2.mjs +4 -0
  7. package/dist/components/crud/table/props.d.ts +1 -0
  8. package/dist/components/crud/tabs-table/index.vue.d.ts +1 -0
  9. package/dist/components/crud/tabs-table/index.vue2.mjs +1 -0
  10. package/dist/components/crud/tabs-table/props.d.ts +1 -0
  11. package/dist/components/service/table/filter-item.mjs +114 -60
  12. package/dist/components/service/table/index.css +54 -52
  13. package/dist/components/service/table/index.vue.mjs +1 -1
  14. package/dist/components/service/table/index.vue2.mjs +25 -6
  15. package/dist/components/service/table/props.d.ts +1 -0
  16. package/dist/components/service/table/props.mjs +1 -0
  17. package/dist/components/service/table/types.d.ts +1 -0
  18. package/dist/components/service-dialog-table-select/index.vue2.mjs +3 -0
  19. package/dist/components/service-dialog-table-select/props.d.ts +1 -0
  20. package/dist/components/service-dialog-tabs-table-select/index.vue2.mjs +3 -0
  21. package/dist/components/service-dialog-tabs-table-select/props.d.ts +1 -0
  22. package/dist/components/service-popup-table-select/index.vue2.mjs +3 -0
  23. package/dist/components/service-popup-table-select/props.d.ts +1 -0
  24. package/dist/locales/en-US.d.ts +1 -0
  25. package/dist/locales/en-US.mjs +2 -1
  26. package/dist/locales/zh-CN.d.ts +1 -0
  27. package/dist/locales/zh-CN.mjs +2 -1
  28. package/dist/locales/zh-TW.d.ts +1 -0
  29. package/dist/locales/zh-TW.mjs +2 -1
  30. package/package.json +1 -1
@@ -110,6 +110,7 @@ export declare const QdConfigProvider: import("vue").DefineComponent<{
110
110
  filterItemInputPlaceholder?: string;
111
111
  filterItemSearchPlaceholder?: string;
112
112
  filterItemAllText?: string;
113
+ filterItemInvertText?: string;
113
114
  };
114
115
  wrapper?: {
115
116
  attach?: import("..").QdDialogProps["attach"];
@@ -259,6 +260,7 @@ export declare const QdConfigProvider: import("vue").DefineComponent<{
259
260
  filterItemInputPlaceholder?: string;
260
261
  filterItemSearchPlaceholder?: string;
261
262
  filterItemAllText?: string;
263
+ filterItemInvertText?: string;
262
264
  };
263
265
  wrapper?: {
264
266
  attach?: import("..").QdDialogProps["attach"];
@@ -393,6 +395,7 @@ export declare const QdConfigProvider: import("vue").DefineComponent<{
393
395
  filterItemInputPlaceholder?: string;
394
396
  filterItemSearchPlaceholder?: string;
395
397
  filterItemAllText?: string;
398
+ filterItemInvertText?: string;
396
399
  };
397
400
  wrapper?: {
398
401
  attach?: import("..").QdDialogProps["attach"];
@@ -127,6 +127,7 @@ export interface QdConfigProviderProps {
127
127
  filterItemInputPlaceholder?: string;
128
128
  filterItemSearchPlaceholder?: string;
129
129
  filterItemAllText?: string;
130
+ filterItemInvertText?: string;
130
131
  };
131
132
  wrapper?: {
132
133
  attach?: QdDialogProps['attach'];
@@ -98,6 +98,7 @@ export declare function useConfig<T extends keyof NonNullable<QdConfigProviderPr
98
98
  filterItemInputPlaceholder?: string;
99
99
  filterItemSearchPlaceholder?: string;
100
100
  filterItemAllText?: string;
101
+ filterItemInvertText?: string;
101
102
  };
102
103
  wrapper?: {
103
104
  attach?: import("..").QdDialogProps["attach"];
@@ -230,6 +231,7 @@ export declare function useConfig<T extends keyof NonNullable<QdConfigProviderPr
230
231
  filterItemInputPlaceholder?: string;
231
232
  filterItemSearchPlaceholder?: string;
232
233
  filterItemAllText?: string;
234
+ filterItemInvertText?: string;
233
235
  };
234
236
  wrapper?: {
235
237
  attach?: import("..").QdDialogProps["attach"];
@@ -362,6 +364,7 @@ export declare function useConfig<T extends keyof NonNullable<QdConfigProviderPr
362
364
  filterItemInputPlaceholder?: string;
363
365
  filterItemSearchPlaceholder?: string;
364
366
  filterItemAllText?: string;
367
+ filterItemInvertText?: string;
365
368
  };
366
369
  wrapper?: {
367
370
  attach?: import("..").QdDialogProps["attach"];
@@ -495,6 +498,7 @@ export declare function useConfig<T extends keyof NonNullable<QdConfigProviderPr
495
498
  filterItemInputPlaceholder?: string;
496
499
  filterItemSearchPlaceholder?: string;
497
500
  filterItemAllText?: string;
501
+ filterItemInvertText?: string;
498
502
  };
499
503
  wrapper?: {
500
504
  attach?: import("..").QdDialogProps["attach"];
@@ -1,40 +1,40 @@
1
- .qd-crud-table[data-v-caa57b85] {
1
+ .qd-crud-table[data-v-cf0c0269] {
2
2
  width: 100%;
3
3
  display: flex;
4
4
  flex-direction: column;
5
5
  }
6
- .qd-crud-table > .qd-crud-search:not(.qd-crud-search--hide) + .qd-crud-table__body[data-v-caa57b85] {
6
+ .qd-crud-table > .qd-crud-search:not(.qd-crud-search--hide) + .qd-crud-table__body[data-v-cf0c0269] {
7
7
  margin-top: var(--td-comp-margin-l);
8
8
  }
9
- .qd-crud-table__body[data-v-caa57b85] > .t-loading__parent > .t-card__body {
9
+ .qd-crud-table__body[data-v-cf0c0269] > .t-loading__parent > .t-card__body {
10
10
  display: flex;
11
11
  flex-direction: column;
12
12
  }
13
- .qd-crud-table__body[data-v-caa57b85] > .t-loading__parent > .t-card__body > .qd-service-table .t-table__pagination {
13
+ .qd-crud-table__body[data-v-cf0c0269] > .t-loading__parent > .t-card__body > .qd-service-table .t-table__pagination {
14
14
  padding-bottom: 0;
15
15
  }
16
- .qd-crud-table--fit-parent-height[data-v-caa57b85] {
16
+ .qd-crud-table--fit-parent-height[data-v-cf0c0269] {
17
17
  height: 100%;
18
18
  }
19
- .qd-crud-table--fit-parent-height > .qd-crud-table__body[data-v-caa57b85] {
19
+ .qd-crud-table--fit-parent-height > .qd-crud-table__body[data-v-cf0c0269] {
20
20
  flex: auto;
21
21
  }
22
- .qd-crud-table--fit-parent-height > .qd-crud-table__body[data-v-caa57b85] > .t-loading__parent > .t-card__body {
22
+ .qd-crud-table--fit-parent-height > .qd-crud-table__body[data-v-cf0c0269] > .t-loading__parent > .t-card__body {
23
23
  height: 100%;
24
24
  min-height: 443px;
25
25
  }
26
- .qd-crud-table--fit-parent-height > .qd-crud-table__body[data-v-caa57b85] > .t-loading__parent > .t-card__body > .qd-service-table {
26
+ .qd-crud-table--fit-parent-height > .qd-crud-table__body[data-v-cf0c0269] > .t-loading__parent > .t-card__body > .qd-service-table {
27
27
  flex: 1 1 0;
28
28
  overflow: hidden;
29
29
  }
30
- .qd-crud-table__toolbar[data-v-caa57b85] {
30
+ .qd-crud-table__toolbar[data-v-cf0c0269] {
31
31
  display: flex;
32
32
  justify-content: space-between;
33
33
  }
34
- .qd-crud-table__toolbar--has-space-item + .qd-service-table[data-v-caa57b85] {
34
+ .qd-crud-table__toolbar--has-space-item + .qd-service-table[data-v-cf0c0269] {
35
35
  margin-top: var(--td-comp-margin-l);
36
36
  }
37
- .qd-crud-table__toolbar-separator[data-v-caa57b85] {
37
+ .qd-crud-table__toolbar-separator[data-v-cf0c0269] {
38
38
  display: inline-block;
39
39
  padding-left: var(--td-comp-paddingLR-s);
40
40
  }
@@ -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 QdCrudTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-caa57b85"]]);
5
+ const QdCrudTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-cf0c0269"]]);
6
6
  export {
7
7
  QdCrudTable as default
8
8
  };
@@ -81,6 +81,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
81
81
  headerBg: {
82
82
  type: Boolean
83
83
  },
84
+ showFilterResult: {
85
+ type: Boolean
86
+ },
84
87
  emptyText: {},
85
88
  emptyImage: {
86
89
  type: [Boolean, String]
@@ -490,6 +493,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
490
493
  colKey: "row-select",
491
494
  type: reSelectType,
492
495
  align: "center",
496
+ fixed: "left",
493
497
  width: 50
494
498
  };
495
499
  if (selectIdx > -1) {
@@ -43,6 +43,7 @@ export declare const qdCrudTableProps: {
43
43
  readonly paginationAffixedBottom: undefined;
44
44
  readonly pagination: undefined;
45
45
  readonly headerBg: true;
46
+ readonly showFilterResult: false;
46
47
  readonly loadingWithData: true;
47
48
  readonly headerAffixedTop: true;
48
49
  readonly activeRowType: "single";
@@ -193,6 +193,7 @@ declare const _default: <D extends TableRowData = TableRowData, R = unknown, P =
193
193
  manual?: boolean | undefined;
194
194
  selectType?: "single" | "multiple" | undefined;
195
195
  headerBg?: boolean | undefined;
196
+ showFilterResult?: boolean | undefined;
196
197
  emptyImage?: string | boolean | ((h: typeof import("vue").h) => import("tdesign-vue-next").TNodeReturnValue) | import("tdesign-vue-next").TdImageProps | undefined;
197
198
  lazyForm?: boolean | undefined;
198
199
  editCellValidationBlock?: import("../../service/table/types").QdServiceTableEditCellValidationBlock | undefined;
@@ -45,6 +45,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
45
45
  size: {},
46
46
  selectType: {},
47
47
  headerBg: { type: Boolean },
48
+ showFilterResult: { type: Boolean },
48
49
  emptyText: {},
49
50
  emptyImage: { type: [Boolean, String] },
50
51
  readonly: { type: Boolean },
@@ -37,6 +37,7 @@ export declare const qdCrudTabsTableProps: {
37
37
  readonly paginationAffixedBottom: undefined;
38
38
  readonly pagination: undefined;
39
39
  readonly headerBg: true;
40
+ readonly showFilterResult: false;
40
41
  readonly loadingWithData: true;
41
42
  readonly headerAffixedTop: true;
42
43
  readonly activeRowType: "single";
@@ -1,7 +1,10 @@
1
- import { defineComponent, ref, computed, createVNode, onMounted, onBeforeUnmount } from "vue";
1
+ import { defineComponent, ref, computed, watch, createVNode, Fragment, isVNode, onMounted, onBeforeUnmount } from "vue";
2
2
  import { SearchIcon } from "tdesign-icons-vue-next";
3
- import { Input, Checkbox, Radio } from "tdesign-vue-next";
3
+ import { Input, Checkbox, Divider, Link, Radio } from "tdesign-vue-next";
4
4
  import { useConfig } from "../../config-provider/useConfig.mjs";
5
+ function _isSlot(s) {
6
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
7
+ }
5
8
  const FilterOptionContent = /* @__PURE__ */ defineComponent({
6
9
  props: {
7
10
  render: {
@@ -64,11 +67,15 @@ const QdServiceTableFilterItem = /* @__PURE__ */ defineComponent({
64
67
  } = useConfig("table");
65
68
  const keyword = ref("");
66
69
  const renderedTexts = ref(/* @__PURE__ */ new Map());
70
+ const hasKeyword = computed(() => Boolean(keyword.value.trim()));
67
71
  const selectedValues = computed(() => {
68
- if (props.type === "multiple") return Array.isArray(props.value) ? props.value : [];
69
- return props.value === "" || props.value === void 0 ? [] : [props.value];
72
+ if (props.value === null) return [];
73
+ if (Array.isArray(props.value)) {
74
+ return props.value.length ? props.value : props.options.map((option) => option.value);
75
+ }
76
+ if (props.value !== "" && props.value !== void 0) return [props.value];
77
+ return props.options.map((option) => option.value);
70
78
  });
71
- const allSelected = computed(() => props.type === "multiple" && props.value !== null && (!selectedValues.value.length || props.options.every((option) => selectedValues.value.includes(option.value))));
72
79
  const filteredOptions = computed(() => {
73
80
  const keywords = keyword.value.trim().toLowerCase().split(/\s+/).filter(Boolean);
74
81
  if (!keywords.length) return props.options;
@@ -77,33 +84,68 @@ const QdServiceTableFilterItem = /* @__PURE__ */ defineComponent({
77
84
  return keywords.some((item) => label.includes(item));
78
85
  });
79
86
  });
87
+ const allSelected = computed(() => {
88
+ if (props.value === null) return false;
89
+ if (!hasKeyword.value) {
90
+ if (props.type === "single") return props.value === "" || props.value === void 0;
91
+ return props.options.every((option) => selectedValues.value.includes(option.value));
92
+ }
93
+ const filteredValues = filteredOptions.value.map((option) => option.value);
94
+ return filteredValues.length > 0 && filteredValues.length === selectedValues.value.length && filteredValues.every((value) => selectedValues.value.includes(value));
95
+ });
80
96
  const totalCount = computed(() => props.options.reduce((total, option) => total + (option.count ?? 0), 0));
81
97
  const selectedCount = computed(() => {
82
98
  if (props.value === null) return 0;
83
- if (allSelected.value || !selectedValues.value.length) return totalCount.value;
84
99
  return props.options.reduce((total, option) => selectedValues.value.includes(option.value) ? total + (option.count ?? 0) : total, 0);
85
100
  });
101
+ const invertedValues = computed(() => {
102
+ const current = selectedValues.value;
103
+ return filteredOptions.value.flatMap((option) => {
104
+ if (option.disabled) return current.includes(option.value) ? [option.value] : [];
105
+ return current.includes(option.value) ? [] : [option.value];
106
+ });
107
+ });
108
+ const invertDisabled = computed(() => !filteredOptions.value.some((option) => !option.disabled) || !props.showConfirmAndReset && !invertedValues.value.length);
109
+ function normalizeMultipleValue(values) {
110
+ if (!values.length) return null;
111
+ if (props.options.every((option) => values.includes(option.value))) return [];
112
+ return values;
113
+ }
114
+ function normalizeAllValue(values) {
115
+ if (!values.length) return null;
116
+ if (values.length === props.options.length) return props.type === "single" ? "" : [];
117
+ return values;
118
+ }
119
+ function selectFilteredOptions() {
120
+ if (!props.showConfirmAndReset) return;
121
+ const values = filteredOptions.value.map((option) => option.value);
122
+ props.onChange?.(normalizeAllValue(values));
123
+ }
86
124
  function selectAll(checked) {
125
+ const values = filteredOptions.value.map((option) => option.value);
87
126
  if (props.type === "single") {
88
- props.onChange?.("");
127
+ props.onChange?.(normalizeAllValue(values));
89
128
  return;
90
129
  }
91
- props.onChange?.(checked || !props.showConfirmAndReset ? [] : null);
130
+ props.onChange?.(checked ? normalizeMultipleValue(values) : null);
92
131
  }
93
132
  function selectOption(value, checked) {
94
133
  if (props.type === "single") {
95
134
  props.onChange?.(value);
96
135
  return;
97
136
  }
98
- const current = allSelected.value ? props.options.map((option) => option.value) : selectedValues.value;
137
+ const current = selectedValues.value;
99
138
  const next = checked ? [.../* @__PURE__ */ new Set([...current, value])] : current.filter((item) => item !== value);
100
139
  if (!next.length) {
101
140
  if (!props.showConfirmAndReset) return;
102
141
  props.onChange?.(null);
103
142
  return;
104
143
  }
105
- const valueAllSelected = props.options.every((option) => next.includes(option.value));
106
- props.onChange?.(valueAllSelected ? [] : next);
144
+ props.onChange?.(normalizeMultipleValue(next));
145
+ }
146
+ function invertSelection() {
147
+ if (invertDisabled.value) return;
148
+ props.onChange?.(normalizeMultipleValue(invertedValues.value));
107
149
  }
108
150
  function renderOption(option) {
109
151
  if (!option.render) return option.label;
@@ -117,57 +159,69 @@ const QdServiceTableFilterItem = /* @__PURE__ */ defineComponent({
117
159
  }
118
160
  function isOptionDisabled(option) {
119
161
  if (option.disabled) return true;
120
- if (props.showConfirmAndReset || allSelected.value) return false;
162
+ if (props.showConfirmAndReset) return false;
121
163
  return selectedValues.value.length === 1 && selectedValues.value.includes(option.value);
122
164
  }
123
- return () => createVNode("div", {
124
- "class": "qd-service-table-filter-item"
125
- }, [createVNode("div", {
126
- "class": "qd-service-table-filter-item__search"
127
- }, [createVNode(Input, {
128
- "modelValue": keyword.value,
129
- "onUpdate:modelValue": ($event) => keyword.value = $event,
130
- "clearable": true,
131
- "placeholder": t("filterItemSearchPlaceholder"),
132
- "prefixIcon": () => createVNode(SearchIcon, null, null)
133
- }, null)]), createVNode("div", {
134
- "class": "qd-service-table-filter-item__all"
135
- }, [props.type === "multiple" ? createVNode(Checkbox, {
136
- "checked": allSelected.value,
137
- "disabled": !props.showConfirmAndReset && allSelected.value,
138
- "onChange": selectAll
139
- }, {
140
- default: () => [t("filterItemAllText"), createVNode("span", {
141
- "class": "qd-service-table-filter-item__count"
142
- }, [`(${selectedCount.value}/${totalCount.value})`])]
143
- }) : createVNode(Radio, {
144
- "checked": !selectedValues.value.length,
145
- "onChange": selectAll
146
- }, {
147
- default: () => [t("filterItemAllText"), createVNode("span", {
148
- "class": "qd-service-table-filter-item__count"
149
- }, [`(${selectedCount.value}/${totalCount.value})`])]
150
- })]), createVNode("div", {
151
- "class": "qd-service-table-filter-item__options"
152
- }, [filteredOptions.value.map((option) => props.type === "multiple" ? createVNode(Checkbox, {
153
- "key": option.value,
154
- "checked": allSelected.value || selectedValues.value.includes(option.value),
155
- "disabled": isOptionDisabled(option),
156
- "onChange": (checked) => selectOption(option.value, checked)
157
- }, {
158
- default: () => [renderOption(option), createVNode("span", {
159
- "class": "qd-service-table-filter-item__count"
160
- }, [`(${option.count ?? 0})`])]
161
- }) : createVNode(Radio, {
162
- "key": option.value,
163
- "checked": selectedValues.value.includes(option.value),
164
- "disabled": option.disabled,
165
- "onChange": () => selectOption(option.value, true)
166
- }, {
167
- default: () => [renderOption(option), createVNode("span", {
168
- "class": "qd-service-table-filter-item__count"
169
- }, [`(${option.count ?? 0})`])]
170
- }))])]);
165
+ watch(keyword, selectFilteredOptions);
166
+ return () => {
167
+ let _slot;
168
+ return createVNode("div", {
169
+ "class": "qd-service-table-filter-item"
170
+ }, [createVNode("div", {
171
+ "class": "qd-service-table-filter-item__search"
172
+ }, [createVNode(Input, {
173
+ "modelValue": keyword.value,
174
+ "onUpdate:modelValue": ($event) => keyword.value = $event,
175
+ "clearable": true,
176
+ "placeholder": t("filterItemSearchPlaceholder"),
177
+ "prefixIcon": () => createVNode(SearchIcon, null, null)
178
+ }, null)]), createVNode("div", {
179
+ "class": "qd-service-table-filter-item__all"
180
+ }, [props.type === "multiple" ? createVNode(Fragment, null, [createVNode(Checkbox, {
181
+ "checked": allSelected.value,
182
+ "disabled": !props.showConfirmAndReset && allSelected.value,
183
+ "onChange": selectAll
184
+ }, {
185
+ default: () => [t("filterItemAllText"), createVNode("span", {
186
+ "class": "qd-service-table-filter-item__count"
187
+ }, [`(${selectedCount.value}/${totalCount.value})`])]
188
+ }), createVNode(Divider, {
189
+ "layout": "vertical"
190
+ }, null), createVNode(Link, {
191
+ "hover": "color",
192
+ "disabled": invertDisabled.value,
193
+ "onClick": invertSelection
194
+ }, _isSlot(_slot = t("filterItemInvertText")) ? _slot : {
195
+ default: () => [_slot]
196
+ })]) : createVNode(Radio, {
197
+ "checked": allSelected.value,
198
+ "onChange": selectAll
199
+ }, {
200
+ default: () => [t("filterItemAllText"), createVNode("span", {
201
+ "class": "qd-service-table-filter-item__count"
202
+ }, [`(${selectedCount.value}/${totalCount.value})`])]
203
+ })]), createVNode("div", {
204
+ "class": "qd-service-table-filter-item__options"
205
+ }, [filteredOptions.value.map((option) => props.type === "multiple" ? createVNode(Checkbox, {
206
+ "key": option.value,
207
+ "checked": allSelected.value || selectedValues.value.includes(option.value),
208
+ "disabled": isOptionDisabled(option),
209
+ "onChange": (checked) => selectOption(option.value, checked)
210
+ }, {
211
+ default: () => [renderOption(option), createVNode("span", {
212
+ "class": "qd-service-table-filter-item__count"
213
+ }, [`(${option.count ?? 0})`])]
214
+ }) : createVNode(Radio, {
215
+ "key": option.value,
216
+ "checked": !allSelected.value && selectedValues.value.includes(option.value),
217
+ "disabled": option.disabled,
218
+ "onChange": () => selectOption(option.value, true)
219
+ }, {
220
+ default: () => [renderOption(option), createVNode("span", {
221
+ "class": "qd-service-table-filter-item__count"
222
+ }, [`(${option.count ?? 0})`])]
223
+ }))])]);
224
+ };
171
225
  }
172
226
  });
173
227
  export {
@@ -1,165 +1,167 @@
1
- .qd-service-table[data-v-a601e747] {
1
+ .qd-service-table[data-v-7e9f8a0c] {
2
2
  height: 100%;
3
3
  display: flex;
4
4
  flex-direction: column;
5
5
  }
6
- .qd-service-table[data-v-a601e747] > .t-table__content {
6
+ .qd-service-table[data-v-7e9f8a0c] > .t-table__content {
7
7
  flex: 1;
8
8
  }
9
- .qd-service-table--mini[data-v-a601e747] {
9
+ .qd-service-table--mini[data-v-7e9f8a0c] {
10
10
  font: var(--td-font-body-small);
11
11
  }
12
- .qd-service-table--mini[data-v-a601e747] th,
13
- .qd-service-table--mini[data-v-a601e747] tr:not(.t-table__expanded-row) > td {
12
+ .qd-service-table--mini[data-v-7e9f8a0c] th,
13
+ .qd-service-table--mini[data-v-7e9f8a0c] tr:not(.t-table__expanded-row) > td {
14
14
  padding: var(--td-comp-paddingTB-xxs) var(--td-comp-paddingLR-xxs);
15
15
  line-height: var(--td-line-height-body-small);
16
16
  }
17
- .qd-service-table--mini[data-v-a601e747] .t-table__row-full-element {
17
+ .qd-service-table--mini[data-v-7e9f8a0c] .t-table__row-full-element {
18
18
  padding: var(--td-comp-paddingTB-xs) var(--td-comp-paddingLR-s);
19
19
  }
20
- .qd-service-table--hide-empty-image[data-v-a601e747] .t-table__empty {
20
+ .qd-service-table--hide-empty-image[data-v-7e9f8a0c] .t-table__empty {
21
21
  min-height: auto;
22
22
  }
23
- .qd-service-table--hide-empty-image[data-v-a601e747] .t-table__empty .t-empty {
23
+ .qd-service-table--hide-empty-image[data-v-7e9f8a0c] .t-table__empty .t-empty {
24
24
  padding: 0 !important;
25
25
  }
26
- .qd-service-table--hide-empty-image[data-v-a601e747] .t-table__empty .t-empty__image {
26
+ .qd-service-table--hide-empty-image[data-v-7e9f8a0c] .t-table__empty .t-empty__image {
27
27
  display: none;
28
28
  }
29
- .qd-service-table--hide-empty-image[data-v-a601e747] .t-table__empty .t-empty__title {
29
+ .qd-service-table--hide-empty-image[data-v-7e9f8a0c] .t-table__empty .t-empty__title {
30
30
  margin-top: 0;
31
31
  }
32
- .qd-service-table[data-v-a601e747] .t-table__tree-col:not(:has(.t-table__tree-op-icon)) {
32
+ .qd-service-table[data-v-7e9f8a0c] .t-table__tree-col:not(:has(.t-table__tree-op-icon)) {
33
33
  margin-left: calc(var(--td-font-size-body-large) + var(--td-comp-margin-s));
34
34
  }
35
- .qd-service-table[data-v-a601e747] .t-table__tree-leaf-node .t-table__tree-op-icon:empty {
35
+ .qd-service-table[data-v-7e9f8a0c] .t-table__tree-leaf-node .t-table__tree-op-icon:empty {
36
36
  width: calc(var(--td-font-size-body-large) + var(--td-comp-margin-s));
37
37
  }
38
- .qd-service-table[data-v-a601e747] .t-affix > .t-table__affixed-header-elm-wrap,
39
- .qd-service-table[data-v-a601e747] .t-affix > .t-table__scrollbar--obvious {
40
- transform: var(--v393be75e);
38
+ .qd-service-table[data-v-7e9f8a0c] .t-affix > .t-table__affixed-header-elm-wrap,
39
+ .qd-service-table[data-v-7e9f8a0c] .t-affix > .t-table__scrollbar--obvious {
40
+ transform: var(--v41d898c6);
41
41
  }
42
- .qd-service-table--horizontal-bar-static[data-v-a601e747] .t-table__scrollbar--obvious {
42
+ .qd-service-table--horizontal-bar-static[data-v-7e9f8a0c] .t-table__scrollbar--obvious {
43
43
  visibility: hidden;
44
44
  pointer-events: none;
45
45
  }
46
- .qd-service-table[data-v-a601e747] .t-table__expanded-row .qd-service-table--horizontal-bar-static > div:has(> div > .t-table__scrollbar--obvious) {
46
+ .qd-service-table[data-v-7e9f8a0c] .t-table__expanded-row .qd-service-table--horizontal-bar-static > div:has(> div > .t-table__scrollbar--obvious) {
47
47
  display: none;
48
48
  }
49
- .qd-service-table[data-v-a601e747] .t-table__expanded-row > td {
49
+ .qd-service-table[data-v-7e9f8a0c] .t-table__expanded-row > td {
50
50
  height: 0;
51
51
  }
52
- .qd-service-table[data-v-a601e747] .t-table__affixed-header-elm-wrap {
52
+ .qd-service-table[data-v-7e9f8a0c] .t-table__affixed-header-elm-wrap {
53
53
  height: auto !important;
54
54
  }
55
- .qd-service-table[data-v-a601e747] .t-table__affixed-header-elm {
55
+ .qd-service-table[data-v-7e9f8a0c] .t-table__affixed-header-elm {
56
56
  position: relative;
57
57
  scrollbar-width: none;
58
58
  }
59
- .qd-service-table[data-v-a601e747] .t-table__affixed-header-elm::-webkit-scrollbar {
59
+ .qd-service-table[data-v-7e9f8a0c] .t-table__affixed-header-elm::-webkit-scrollbar {
60
60
  display: none;
61
61
  width: 0;
62
62
  height: 0;
63
63
  }
64
- .qd-service-table[data-v-a601e747] .t-table__virtual-scroll-cursor + table {
64
+ .qd-service-table[data-v-7e9f8a0c] .t-table__virtual-scroll-cursor + table {
65
65
  border-collapse: separate;
66
66
  }
67
- .qd-service-table[data-v-a601e747] .t-table__expanded-row-inner,
68
- .qd-service-table[data-v-a601e747] .t-table__row-filter-inner {
67
+ .qd-service-table[data-v-7e9f8a0c] .t-table__expanded-row-inner,
68
+ .qd-service-table[data-v-7e9f8a0c] .t-table__row-filter-inner {
69
69
  display: block;
70
70
  position: sticky;
71
71
  left: 0;
72
- width: var(--c95fd7f4) !important;
72
+ width: var(--v09f42452) !important;
73
73
  }
74
- .qd-service-table[data-v-a601e747] .t-table__cell-wrap > .t-form__controls > .t-form__controls-content > *:not(.t-switch):not(.t-tag):not(.t-icon):not(.qd-file-icon) {
74
+ .qd-service-table[data-v-7e9f8a0c] .t-table__cell-wrap > .t-form__controls > .t-form__controls-content > *:not(.t-switch):not(.t-tag):not(.t-icon):not(.qd-file-icon) {
75
75
  width: 100%;
76
76
  }
77
- .qd-service-table[data-v-a601e747] .qd-service-table__non-editable-col {
77
+ .qd-service-table[data-v-7e9f8a0c] .qd-service-table__non-editable-col {
78
78
  background-color: color-mix(in srgb, var(--td-bg-color-component) 50%, transparent);
79
79
  }
80
- .qd-service-table[data-v-a601e747] .qd-service-table__non-editable-col:is(
80
+ .qd-service-table[data-v-7e9f8a0c] .qd-service-table__non-editable-col:is(
81
81
  .t-table__cell--fixed-left,
82
82
  .t-table__cell--fixed-right
83
83
  ) {
84
84
  background-color: inherit;
85
85
  background-image: linear-gradient(color-mix(in srgb, var(--td-bg-color-secondarycontainer) 50%, transparent), color-mix(in srgb, var(--td-bg-color-secondarycontainer) 50%, transparent));
86
86
  }
87
- .qd-service-table--disable-horizontal-scroll[data-v-a601e747] colgroup > col {
87
+ .qd-service-table--disable-horizontal-scroll[data-v-7e9f8a0c] colgroup > col {
88
88
  width: auto !important;
89
89
  }
90
- .qd-service-table[data-v-a601e747] .t-table__filter-pop-content-inner {
90
+ .qd-service-table[data-v-7e9f8a0c] .t-table__filter-pop-content-inner {
91
91
  padding: var(--td-comp-paddingTB-s) var(--td-comp-paddingLR-s) 0;
92
92
  }
93
- .qd-service-table[data-v-a601e747] .t-table__filter-pop-content-inner:has(.qd-service-table-filter-item) {
93
+ .qd-service-table[data-v-7e9f8a0c] .t-table__filter-pop-content-inner:has(.qd-service-table-filter-item) {
94
94
  padding: 0;
95
95
  }
96
- .qd-service-table[data-v-a601e747] .t-table__filter-pop-content-inner:has(
96
+ .qd-service-table[data-v-7e9f8a0c] .t-table__filter-pop-content-inner:has(
97
97
  .qd-service-table-filter-input,
98
98
  .qd-service-table-filter-custom
99
99
  ) {
100
100
  padding-bottom: var(--td-comp-paddingTB-s);
101
101
  }
102
- .qd-service-table[data-v-a601e747] .t-table__filter--bottom-buttons {
102
+ .qd-service-table[data-v-7e9f8a0c] .t-table__filter--bottom-buttons {
103
103
  padding: var(--td-comp-paddingTB-s) var(--td-comp-paddingLR-s);
104
104
  }
105
- .qd-service-table--mini[data-v-a601e747] .t-table__filter-pop-content-inner {
105
+ .qd-service-table--mini[data-v-7e9f8a0c] .t-table__filter-pop-content-inner {
106
106
  padding: var(--td-comp-paddingTB-xs) var(--td-comp-paddingLR-xs) 0;
107
107
  }
108
- .qd-service-table--mini[data-v-a601e747] .t-table__filter--bottom-buttons {
108
+ .qd-service-table--mini[data-v-7e9f8a0c] .t-table__filter--bottom-buttons {
109
109
  padding: var(--td-comp-paddingTB-xs) var(--td-comp-paddingLR-xs);
110
110
  }
111
- .qd-service-table--mini[data-v-a601e747] .t-table__filter-pop-content-inner:has(.qd-service-table-filter-item) {
111
+ .qd-service-table--mini[data-v-7e9f8a0c] .t-table__filter-pop-content-inner:has(.qd-service-table-filter-item) {
112
112
  padding: 0;
113
113
  }
114
- .qd-service-table--mini[data-v-a601e747] .t-table__filter-pop-content-inner:has(
114
+ .qd-service-table--mini[data-v-7e9f8a0c] .t-table__filter-pop-content-inner:has(
115
115
  .qd-service-table-filter-input,
116
116
  .qd-service-table-filter-custom
117
117
  ) {
118
118
  padding-bottom: var(--td-comp-paddingTB-xs);
119
119
  }
120
- .qd-service-table[data-v-a601e747] .qd-service-table-filter-item {
120
+ .qd-service-table[data-v-7e9f8a0c] .qd-service-table-filter-item {
121
121
  width: 266px;
122
122
  }
123
- .qd-service-table[data-v-a601e747] .qd-service-table-filter-item__search,
124
- .qd-service-table[data-v-a601e747] .qd-service-table-filter-item__all,
125
- .qd-service-table[data-v-a601e747] .qd-service-table-filter-item__options {
123
+ .qd-service-table[data-v-7e9f8a0c] .qd-service-table-filter-item__search,
124
+ .qd-service-table[data-v-7e9f8a0c] .qd-service-table-filter-item__all,
125
+ .qd-service-table[data-v-7e9f8a0c] .qd-service-table-filter-item__options {
126
126
  padding: var(--td-comp-paddingTB-s) var(--td-comp-paddingLR-s) 0;
127
127
  }
128
- .qd-service-table[data-v-a601e747] .qd-service-table-filter-item__all {
128
+ .qd-service-table[data-v-7e9f8a0c] .qd-service-table-filter-item__all {
129
+ display: flex;
130
+ align-items: center;
129
131
  padding: 0 var(--td-comp-paddingLR-s);
130
132
  border-bottom: 1px solid var(--td-component-stroke);
131
133
  }
132
- .qd-service-table[data-v-a601e747] .qd-service-table-filter-item__options {
134
+ .qd-service-table[data-v-7e9f8a0c] .qd-service-table-filter-item__options {
133
135
  display: flex;
134
136
  flex-direction: column;
135
137
  height: 206px;
136
138
  padding: 0 var(--td-comp-paddingLR-s);
137
139
  overflow-y: auto;
138
140
  }
139
- .qd-service-table[data-v-a601e747] .qd-service-table-filter-item__count {
141
+ .qd-service-table[data-v-7e9f8a0c] .qd-service-table-filter-item__count {
140
142
  margin-left: var(--td-comp-margin-xs);
141
143
  color: var(--td-text-color-placeholder);
142
144
  }
143
- .qd-service-table[data-v-a601e747] .qd-service-table-filter-item__cell {
145
+ .qd-service-table[data-v-7e9f8a0c] .qd-service-table-filter-item__cell {
144
146
  pointer-events: none;
145
147
  }
146
- .qd-service-table[data-v-a601e747] .qd-service-table-filter-item .t-checkbox,
147
- .qd-service-table[data-v-a601e747] .qd-service-table-filter-item .t-radio {
148
+ .qd-service-table[data-v-7e9f8a0c] .qd-service-table-filter-item .t-checkbox,
149
+ .qd-service-table[data-v-7e9f8a0c] .qd-service-table-filter-item .t-radio {
148
150
  display: flex;
149
151
  align-items: center;
150
152
  }
151
- .qd-service-table[data-v-a601e747] .qd-service-table-filter-item .t-checkbox__label,
152
- .qd-service-table[data-v-a601e747] .qd-service-table-filter-item .t-radio__label {
153
+ .qd-service-table[data-v-7e9f8a0c] .qd-service-table-filter-item .t-checkbox__label,
154
+ .qd-service-table[data-v-7e9f8a0c] .qd-service-table-filter-item .t-radio__label {
153
155
  display: inline-flex;
154
156
  flex: 1 1 0;
155
157
  align-items: center;
156
158
  min-width: 0;
157
159
  overflow: hidden;
158
160
  }
159
- .qd-service-table--mini[data-v-a601e747] .qd-service-table-filter-item__search {
161
+ .qd-service-table--mini[data-v-7e9f8a0c] .qd-service-table-filter-item__search {
160
162
  padding: var(--td-comp-paddingTB-xs) var(--td-comp-paddingLR-xs) 0;
161
163
  }
162
- .qd-service-table--mini[data-v-a601e747] .qd-service-table-filter-item__all,
163
- .qd-service-table--mini[data-v-a601e747] .qd-service-table-filter-item__options {
164
+ .qd-service-table--mini[data-v-7e9f8a0c] .qd-service-table-filter-item__all,
165
+ .qd-service-table--mini[data-v-7e9f8a0c] .qd-service-table-filter-item__options {
164
166
  padding: 0 var(--td-comp-paddingLR-xs);
165
167
  }
@@ -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 QdServiceTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-a601e747"]]);
5
+ const QdServiceTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-7e9f8a0c"]]);
6
6
  export {
7
7
  QdServiceTable as default
8
8
  };
@@ -38,6 +38,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
38
38
  headerBg: {
39
39
  type: Boolean
40
40
  },
41
+ showFilterResult: {
42
+ type: Boolean
43
+ },
41
44
  searchData: {},
42
45
  emptyText: {},
43
46
  emptyImage: {
@@ -333,8 +336,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
333
336
  emit: __emit
334
337
  }) {
335
338
  useCssVars((_ctx) => ({
336
- "v393be75e": affixedHeaderTransform.value,
337
- "c95fd7f4": expandedRowWidth.value
339
+ "v41d898c6": affixedHeaderTransform.value,
340
+ "v09f42452": expandedRowWidth.value
338
341
  }));
339
342
  const props = __props;
340
343
  const emit = __emit;
@@ -420,6 +423,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
420
423
  data.value = [...data.value];
421
424
  });
422
425
  }
426
+ function concealVirtualScrollIndex(rows) {
427
+ if (props.scroll?.type !== "virtual") return rows;
428
+ rows.forEach((row) => {
429
+ const descriptor = Object.getOwnPropertyDescriptor(row, "VIRTUAL_SCROLL_INDEX");
430
+ if (descriptor && !descriptor.enumerable) return;
431
+ Object.defineProperty(row, "VIRTUAL_SCROLL_INDEX", {
432
+ configurable: true,
433
+ enumerable: false,
434
+ value: descriptor?.value,
435
+ writable: true
436
+ });
437
+ });
438
+ return rows;
439
+ }
423
440
  function isExpandedRowProxyable(value) {
424
441
  if (!value || typeof value !== "object") return false;
425
442
  if (Array.isArray(value)) return true;
@@ -518,6 +535,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
518
535
  colKey: "row-select",
519
536
  type: selectType,
520
537
  align: "center",
538
+ fixed: "left",
521
539
  width: 50
522
540
  };
523
541
  if (selectIdx > -1) {
@@ -548,6 +566,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
548
566
  return rowValue === value;
549
567
  }));
550
568
  });
569
+ const tdesignData = computed(() => concealVirtualScrollIndex(displayData.value));
551
570
  const {
552
571
  stop: tableContentStop,
553
572
  pause: tableContentPause,
@@ -601,6 +620,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
601
620
  size,
602
621
  bordered,
603
622
  headerAffixedTop,
623
+ showFilterResult,
604
624
  horizontalScrollAffixedBottom,
605
625
  ...tableOptions
606
626
  } = props;
@@ -859,6 +879,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
859
879
  size: reSize,
860
880
  tableOptions: {
861
881
  ...reTableOptions,
882
+ filterRow: showFilterResult ? reTableOptions.filterRow : null,
862
883
  selectOnRowClick: reSelectOnRowClick,
863
884
  expandOnRowClick,
864
885
  tree: reTree,
@@ -1872,9 +1893,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1872
1893
  type
1873
1894
  },
1874
1895
  component: QdServiceTableFilterItem,
1875
- ...type === "multiple" ? {
1876
- confirmDisabled: (value) => value === null
1877
- } : {},
1896
+ confirmDisabled: (value) => value === null,
1878
1897
  ...!options && reuseCell ? {
1879
1898
  renderFilterValue: (_h, {
1880
1899
  value
@@ -2406,7 +2425,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2406
2425
  "on-sort-change": reOnSortChange,
2407
2426
  columns: autoWidthColumns.value,
2408
2427
  loading: tableLoad.value,
2409
- data: displayData.value,
2428
+ data: tdesignData.value,
2410
2429
  pagination: rePagination.value
2411
2430
  }), createSlots({
2412
2431
  empty: withCtx(() => [createVNode(unref(Empty), mergeProps({
@@ -32,6 +32,7 @@ export declare const qdServiceTableProps: {
32
32
  readonly paginationAffixedBottom: undefined;
33
33
  readonly pagination: undefined;
34
34
  readonly headerBg: true;
35
+ readonly showFilterResult: false;
35
36
  readonly loadingWithData: true;
36
37
  readonly headerAffixedTop: true;
37
38
  readonly activeRowType: "single";
@@ -31,6 +31,7 @@ const qdServiceTableProps = {
31
31
  paginationAffixedBottom: void 0,
32
32
  pagination: void 0,
33
33
  headerBg: true,
34
+ showFilterResult: false,
34
35
  loadingWithData: true,
35
36
  headerAffixedTop: true,
36
37
  activeRowType: "single"
@@ -77,6 +77,7 @@ export interface QdServiceTableProps<D extends TableRowData = TableRowData, R =
77
77
  size?: TdEnhancedTableProps<D>['size'] | 'mini';
78
78
  selectType?: 'single' | 'multiple';
79
79
  headerBg?: boolean;
80
+ showFilterResult?: boolean;
80
81
  searchData?: Record<string, unknown>;
81
82
  emptyText?: string;
82
83
  emptyImage?: boolean | TdEmptyProps['image'];
@@ -69,6 +69,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
69
69
  headerBg: {
70
70
  type: Boolean
71
71
  },
72
+ showFilterResult: {
73
+ type: Boolean
74
+ },
72
75
  emptyText: {},
73
76
  emptyImage: {
74
77
  type: [Boolean, String]
@@ -58,6 +58,7 @@ export declare const qdServiceDialogTableSelectProps: {
58
58
  readonly paginationAffixedBottom: undefined;
59
59
  readonly pagination: undefined;
60
60
  readonly headerBg: true;
61
+ readonly showFilterResult: false;
61
62
  readonly loadingWithData: true;
62
63
  readonly headerAffixedTop: true;
63
64
  };
@@ -83,6 +83,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
83
83
  headerBg: {
84
84
  type: Boolean
85
85
  },
86
+ showFilterResult: {
87
+ type: Boolean
88
+ },
86
89
  emptyText: {},
87
90
  emptyImage: {
88
91
  type: [Boolean, String]
@@ -33,6 +33,7 @@ export declare const qdServiceDialogTabsTableSelectProps: {
33
33
  readonly paginationAffixedBottom: undefined;
34
34
  readonly pagination: undefined;
35
35
  readonly headerBg: true;
36
+ readonly showFilterResult: false;
36
37
  readonly loadingWithData: true;
37
38
  readonly headerAffixedTop: true;
38
39
  };
@@ -59,6 +59,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
59
59
  headerBg: {
60
60
  type: Boolean
61
61
  },
62
+ showFilterResult: {
63
+ type: Boolean
64
+ },
62
65
  emptyText: {},
63
66
  emptyImage: {
64
67
  type: [Boolean, String]
@@ -32,6 +32,7 @@ export declare const qdServicePopupTableSelectProps: {
32
32
  readonly paginationAffixedBottom: undefined;
33
33
  readonly pagination: undefined;
34
34
  readonly headerBg: true;
35
+ readonly showFilterResult: false;
35
36
  readonly loadingWithData: true;
36
37
  readonly headerAffixedTop: true;
37
38
  };
@@ -355,6 +355,7 @@ declare const _default: {
355
355
  filterItemInputPlaceholder: string;
356
356
  filterItemSearchPlaceholder: string;
357
357
  filterItemAllText: string;
358
+ filterItemInvertText: string;
358
359
  };
359
360
  columnsController: {
360
361
  titleText: string;
@@ -96,7 +96,8 @@ const enUS = merge(enUS$1, {
96
96
  table: {
97
97
  filterItemInputPlaceholder: "Enter keywords to filter",
98
98
  filterItemSearchPlaceholder: "Search; separate keywords with spaces",
99
- filterItemAllText: "All"
99
+ filterItemAllText: "All",
100
+ filterItemInvertText: "Invert"
100
101
  },
101
102
  columnsController: {
102
103
  titleText: "Column Configuration",
@@ -355,6 +355,7 @@ declare const _default: {
355
355
  filterItemInputPlaceholder: string;
356
356
  filterItemSearchPlaceholder: string;
357
357
  filterItemAllText: string;
358
+ filterItemInvertText: string;
358
359
  };
359
360
  columnsController: {
360
361
  titleText: string;
@@ -93,7 +93,8 @@ const zhCN = merge(zhCN$1, {
93
93
  table: {
94
94
  filterItemInputPlaceholder: "输入关键词过滤",
95
95
  filterItemSearchPlaceholder: "搜索,支持用空格分隔多个关键词",
96
- filterItemAllText: "全部"
96
+ filterItemAllText: "全部",
97
+ filterItemInvertText: "反选"
97
98
  },
98
99
  columnsController: {
99
100
  titleText: "列配置",
@@ -355,6 +355,7 @@ declare const _default: {
355
355
  filterItemInputPlaceholder: string;
356
356
  filterItemSearchPlaceholder: string;
357
357
  filterItemAllText: string;
358
+ filterItemInvertText: string;
358
359
  };
359
360
  columnsController: {
360
361
  titleText: string;
@@ -93,7 +93,8 @@ const zhTW = merge(zhTW$1, {
93
93
  table: {
94
94
  filterItemInputPlaceholder: "輸入關鍵詞過濾",
95
95
  filterItemSearchPlaceholder: "搜尋,支援用空格分隔多個關鍵詞",
96
- filterItemAllText: "全部"
96
+ filterItemAllText: "全部",
97
+ filterItemInvertText: "反選"
97
98
  },
98
99
  columnsController: {
99
100
  titleText: "列配置",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qidian-vue-ui",
3
- "version": "2.0.46",
3
+ "version": "2.0.48",
4
4
  "description": "基于 TDesign 的 QiDian Vue UI 组件库",
5
5
  "author": "qidian",
6
6
  "license": "MIT",