qidian-vue-ui 2.0.51 → 2.0.52

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.
@@ -78,6 +78,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
78
78
  rowKey: {},
79
79
  size: {},
80
80
  selectType: {},
81
+ reserveSelectedRowOnFilter: {
82
+ type: Boolean
83
+ },
81
84
  headerBg: {
82
85
  type: Boolean
83
86
  },
@@ -34,6 +34,7 @@ export declare const qdCrudTableProps: {
34
34
  readonly maxHeight: "100%";
35
35
  readonly hover: true;
36
36
  readonly reserveSelectedRowOnPaginate: false;
37
+ readonly reserveSelectedRowOnFilter: false;
37
38
  readonly expandOnRowClick: undefined;
38
39
  readonly hideSortTips: undefined;
39
40
  readonly multipleSort: true;
@@ -192,6 +192,7 @@ declare const _default: <D extends TableRowData = TableRowData, R = unknown, P =
192
192
  onSuccess?: ((data: import("qidian-shared").ServicePageDataType<D>) => void) | undefined;
193
193
  manual?: boolean | undefined;
194
194
  selectType?: "single" | "multiple" | undefined;
195
+ reserveSelectedRowOnFilter?: boolean | undefined;
195
196
  headerBg?: boolean | undefined;
196
197
  showFilterResult?: boolean | undefined;
197
198
  emptyImage?: string | boolean | ((h: typeof import("vue").h) => import("tdesign-vue-next").TNodeReturnValue) | import("tdesign-vue-next").TdImageProps | undefined;
@@ -44,6 +44,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
44
44
  rowKey: {},
45
45
  size: {},
46
46
  selectType: {},
47
+ reserveSelectedRowOnFilter: { type: Boolean },
47
48
  headerBg: { type: Boolean },
48
49
  showFilterResult: { type: Boolean },
49
50
  emptyText: {},
@@ -28,6 +28,7 @@ export declare const qdCrudTabsTableProps: {
28
28
  readonly maxHeight: "100%";
29
29
  readonly hover: true;
30
30
  readonly reserveSelectedRowOnPaginate: false;
31
+ readonly reserveSelectedRowOnFilter: false;
31
32
  readonly expandOnRowClick: undefined;
32
33
  readonly hideSortTips: undefined;
33
34
  readonly multipleSort: true;
@@ -1,167 +1,167 @@
1
- .qd-service-table[data-v-c908b998] {
1
+ .qd-service-table[data-v-d8bf5443] {
2
2
  height: 100%;
3
3
  display: flex;
4
4
  flex-direction: column;
5
5
  }
6
- .qd-service-table[data-v-c908b998] > .t-table__content {
6
+ .qd-service-table[data-v-d8bf5443] > .t-table__content {
7
7
  flex: 1;
8
8
  }
9
- .qd-service-table--mini[data-v-c908b998] {
9
+ .qd-service-table--mini[data-v-d8bf5443] {
10
10
  font: var(--td-font-body-small);
11
11
  }
12
- .qd-service-table--mini[data-v-c908b998] th,
13
- .qd-service-table--mini[data-v-c908b998] tr:not(.t-table__expanded-row) > td {
12
+ .qd-service-table--mini[data-v-d8bf5443] th,
13
+ .qd-service-table--mini[data-v-d8bf5443] 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-c908b998] .t-table__row-full-element {
17
+ .qd-service-table--mini[data-v-d8bf5443] .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-c908b998] .t-table__empty {
20
+ .qd-service-table--hide-empty-image[data-v-d8bf5443] .t-table__empty {
21
21
  min-height: auto;
22
22
  }
23
- .qd-service-table--hide-empty-image[data-v-c908b998] .t-table__empty .t-empty {
23
+ .qd-service-table--hide-empty-image[data-v-d8bf5443] .t-table__empty .t-empty {
24
24
  padding: 0 !important;
25
25
  }
26
- .qd-service-table--hide-empty-image[data-v-c908b998] .t-table__empty .t-empty__image {
26
+ .qd-service-table--hide-empty-image[data-v-d8bf5443] .t-table__empty .t-empty__image {
27
27
  display: none;
28
28
  }
29
- .qd-service-table--hide-empty-image[data-v-c908b998] .t-table__empty .t-empty__title {
29
+ .qd-service-table--hide-empty-image[data-v-d8bf5443] .t-table__empty .t-empty__title {
30
30
  margin-top: 0;
31
31
  }
32
- .qd-service-table[data-v-c908b998] .t-table__tree-col:not(:has(.t-table__tree-op-icon)) {
32
+ .qd-service-table[data-v-d8bf5443] .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-c908b998] .t-table__tree-leaf-node .t-table__tree-op-icon:empty {
35
+ .qd-service-table[data-v-d8bf5443] .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-c908b998] .t-affix > .t-table__affixed-header-elm-wrap,
39
- .qd-service-table[data-v-c908b998] .t-affix > .t-table__scrollbar--obvious {
40
- transform: var(--v2af08a9a);
38
+ .qd-service-table[data-v-d8bf5443] .t-affix > .t-table__affixed-header-elm-wrap,
39
+ .qd-service-table[data-v-d8bf5443] .t-affix > .t-table__scrollbar--obvious {
40
+ transform: var(--v108cdedc);
41
41
  }
42
- .qd-service-table--horizontal-bar-static[data-v-c908b998] .t-table__scrollbar--obvious {
42
+ .qd-service-table--horizontal-bar-static[data-v-d8bf5443] .t-table__scrollbar--obvious {
43
43
  visibility: hidden;
44
44
  pointer-events: none;
45
45
  }
46
- .qd-service-table[data-v-c908b998] .t-table__expanded-row .qd-service-table--horizontal-bar-static > div:has(> div > .t-table__scrollbar--obvious) {
46
+ .qd-service-table[data-v-d8bf5443] .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-c908b998] .t-table__expanded-row > td {
49
+ .qd-service-table[data-v-d8bf5443] .t-table__expanded-row > td {
50
50
  height: 0;
51
51
  }
52
- .qd-service-table[data-v-c908b998] .t-table__affixed-header-elm-wrap {
52
+ .qd-service-table[data-v-d8bf5443] .t-table__affixed-header-elm-wrap {
53
53
  height: auto !important;
54
54
  }
55
- .qd-service-table[data-v-c908b998] .t-table__affixed-header-elm {
55
+ .qd-service-table[data-v-d8bf5443] .t-table__affixed-header-elm {
56
56
  position: relative;
57
57
  scrollbar-width: none;
58
58
  }
59
- .qd-service-table[data-v-c908b998] .t-table__affixed-header-elm::-webkit-scrollbar {
59
+ .qd-service-table[data-v-d8bf5443] .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-c908b998] .t-table__virtual-scroll-cursor + table {
64
+ .qd-service-table[data-v-d8bf5443] .t-table__virtual-scroll-cursor + table {
65
65
  border-collapse: separate;
66
66
  }
67
- .qd-service-table[data-v-c908b998] .t-table__expanded-row-inner,
68
- .qd-service-table[data-v-c908b998] .t-table__row-filter-inner {
67
+ .qd-service-table[data-v-d8bf5443] .t-table__expanded-row-inner,
68
+ .qd-service-table[data-v-d8bf5443] .t-table__row-filter-inner {
69
69
  display: block;
70
70
  position: sticky;
71
71
  left: 0;
72
- width: var(--v53ed85e2) !important;
72
+ width: var(--v28fb2a5e) !important;
73
73
  }
74
- .qd-service-table[data-v-c908b998] .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-d8bf5443] .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-c908b998] .qd-service-table__non-editable-col {
77
+ .qd-service-table[data-v-d8bf5443] .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-c908b998] .qd-service-table__non-editable-col:is(
80
+ .qd-service-table[data-v-d8bf5443] .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-c908b998] colgroup > col {
87
+ .qd-service-table--disable-horizontal-scroll[data-v-d8bf5443] colgroup > col {
88
88
  width: auto !important;
89
89
  }
90
- .qd-service-table[data-v-c908b998] .t-table__filter-pop-content-inner {
90
+ .qd-service-table[data-v-d8bf5443] .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-c908b998] .t-table__filter-pop-content-inner:has(.qd-service-table-filter-item) {
93
+ .qd-service-table[data-v-d8bf5443] .t-table__filter-pop-content-inner:has(.qd-service-table-filter-item) {
94
94
  padding: 0;
95
95
  }
96
- .qd-service-table[data-v-c908b998] .t-table__filter-pop-content-inner:has(
96
+ .qd-service-table[data-v-d8bf5443] .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-c908b998] .t-table__filter--bottom-buttons {
102
+ .qd-service-table[data-v-d8bf5443] .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-c908b998] .t-table__filter-pop-content-inner {
105
+ .qd-service-table--mini[data-v-d8bf5443] .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-c908b998] .t-table__filter--bottom-buttons {
108
+ .qd-service-table--mini[data-v-d8bf5443] .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-c908b998] .t-table__filter-pop-content-inner:has(.qd-service-table-filter-item) {
111
+ .qd-service-table--mini[data-v-d8bf5443] .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-c908b998] .t-table__filter-pop-content-inner:has(
114
+ .qd-service-table--mini[data-v-d8bf5443] .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-c908b998] .qd-service-table-filter-item {
120
+ .qd-service-table[data-v-d8bf5443] .qd-service-table-filter-item {
121
121
  width: 266px;
122
122
  }
123
- .qd-service-table[data-v-c908b998] .qd-service-table-filter-item__search,
124
- .qd-service-table[data-v-c908b998] .qd-service-table-filter-item__all,
125
- .qd-service-table[data-v-c908b998] .qd-service-table-filter-item__options {
123
+ .qd-service-table[data-v-d8bf5443] .qd-service-table-filter-item__search,
124
+ .qd-service-table[data-v-d8bf5443] .qd-service-table-filter-item__all,
125
+ .qd-service-table[data-v-d8bf5443] .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-c908b998] .qd-service-table-filter-item__all {
128
+ .qd-service-table[data-v-d8bf5443] .qd-service-table-filter-item__all {
129
129
  display: flex;
130
130
  align-items: center;
131
131
  padding: 0 var(--td-comp-paddingLR-s);
132
132
  border-bottom: 1px solid var(--td-component-stroke);
133
133
  }
134
- .qd-service-table[data-v-c908b998] .qd-service-table-filter-item__options {
134
+ .qd-service-table[data-v-d8bf5443] .qd-service-table-filter-item__options {
135
135
  display: flex;
136
136
  flex-direction: column;
137
137
  height: 206px;
138
138
  padding: 0 var(--td-comp-paddingLR-s);
139
139
  overflow-y: auto;
140
140
  }
141
- .qd-service-table[data-v-c908b998] .qd-service-table-filter-item__count {
141
+ .qd-service-table[data-v-d8bf5443] .qd-service-table-filter-item__count {
142
142
  margin-left: var(--td-comp-margin-xs);
143
143
  color: var(--td-text-color-placeholder);
144
144
  }
145
- .qd-service-table[data-v-c908b998] .qd-service-table-filter-item__cell {
145
+ .qd-service-table[data-v-d8bf5443] .qd-service-table-filter-item__cell {
146
146
  pointer-events: none;
147
147
  }
148
- .qd-service-table[data-v-c908b998] .qd-service-table-filter-item .t-checkbox,
149
- .qd-service-table[data-v-c908b998] .qd-service-table-filter-item .t-radio {
148
+ .qd-service-table[data-v-d8bf5443] .qd-service-table-filter-item .t-checkbox,
149
+ .qd-service-table[data-v-d8bf5443] .qd-service-table-filter-item .t-radio {
150
150
  display: flex;
151
151
  align-items: center;
152
152
  }
153
- .qd-service-table[data-v-c908b998] .qd-service-table-filter-item .t-checkbox__label,
154
- .qd-service-table[data-v-c908b998] .qd-service-table-filter-item .t-radio__label {
153
+ .qd-service-table[data-v-d8bf5443] .qd-service-table-filter-item .t-checkbox__label,
154
+ .qd-service-table[data-v-d8bf5443] .qd-service-table-filter-item .t-radio__label {
155
155
  display: inline-flex;
156
156
  flex: 1 1 0;
157
157
  align-items: center;
158
158
  min-width: 0;
159
159
  overflow: hidden;
160
160
  }
161
- .qd-service-table--mini[data-v-c908b998] .qd-service-table-filter-item__search {
161
+ .qd-service-table--mini[data-v-d8bf5443] .qd-service-table-filter-item__search {
162
162
  padding: var(--td-comp-paddingTB-xs) var(--td-comp-paddingLR-xs) 0;
163
163
  }
164
- .qd-service-table--mini[data-v-c908b998] .qd-service-table-filter-item__all,
165
- .qd-service-table--mini[data-v-c908b998] .qd-service-table-filter-item__options {
164
+ .qd-service-table--mini[data-v-d8bf5443] .qd-service-table-filter-item__all,
165
+ .qd-service-table--mini[data-v-d8bf5443] .qd-service-table-filter-item__options {
166
166
  padding: 0 var(--td-comp-paddingLR-xs);
167
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-c908b998"]]);
5
+ const QdServiceTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d8bf5443"]]);
6
6
  export {
7
7
  QdServiceTable as default
8
8
  };
@@ -35,6 +35,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
35
35
  rowKey: {},
36
36
  size: {},
37
37
  selectType: {},
38
+ reserveSelectedRowOnFilter: {
39
+ type: Boolean
40
+ },
38
41
  headerBg: {
39
42
  type: Boolean
40
43
  },
@@ -336,8 +339,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
336
339
  emit: __emit
337
340
  }) {
338
341
  useCssVars((_ctx) => ({
339
- "v2af08a9a": affixedHeaderTransform.value,
340
- "v53ed85e2": expandedRowWidth.value
342
+ "v108cdedc": affixedHeaderTransform.value,
343
+ "v28fb2a5e": expandedRowWidth.value
341
344
  }));
342
345
  const props = __props;
343
346
  const emit = __emit;
@@ -612,6 +615,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
612
615
  lazyForm: _lazyForm,
613
616
  scroll,
614
617
  selectOnRowClick,
618
+ reserveSelectedRowOnFilter: _reserveSelectedRowOnFilter,
615
619
  expandOnRowClick,
616
620
  tree,
617
621
  onScroll,
@@ -651,8 +655,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
651
655
  reTableOptions.onFilterChange = (value, context) => {
652
656
  if (filterValue) filterValue.value = value;
653
657
  onFilterChange?.(value, context);
654
- if (onFilterChange) return;
655
- if (!service || pagination === false) return;
658
+ if (onFilterChange) {
659
+ syncSelectedRowsAfterFilter([]);
660
+ return;
661
+ }
662
+ if (!service || pagination === false) {
663
+ syncSelectedRowsAfterFilter(displayData.value);
664
+ return;
665
+ }
666
+ syncSelectedRowsAfterFilter([]);
656
667
  changeCurrent(1);
657
668
  };
658
669
  const expandedRow = reTableOptions.expandedRow;
@@ -1136,6 +1147,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1136
1147
  function getRowValue(row) {
1137
1148
  return get(row, props.rowKey || qdServiceTableProps.rowKey);
1138
1149
  }
1150
+ function syncSelectedRowsAfterFilter(rows) {
1151
+ if (props.reserveSelectedRowOnFilter || !selectedRowKeys.value.length) return;
1152
+ const rowValues = new Set(rows.map(getRowValue));
1153
+ const nextSelectedRowKeys = selectedRowKeys.value.filter((value) => rowValues.has(value));
1154
+ if (nextSelectedRowKeys.length === selectedRowKeys.value.length) return;
1155
+ selectedRowKeys.value = nextSelectedRowKeys;
1156
+ }
1139
1157
  function getCellKey(row, colKey) {
1140
1158
  return `${String(getRowValue(row))}__${String(colKey)}`;
1141
1159
  }
@@ -23,6 +23,7 @@ export declare const qdServiceTableProps: {
23
23
  readonly maxHeight: "100%";
24
24
  readonly hover: true;
25
25
  readonly reserveSelectedRowOnPaginate: false;
26
+ readonly reserveSelectedRowOnFilter: false;
26
27
  readonly expandOnRowClick: undefined;
27
28
  readonly hideSortTips: undefined;
28
29
  readonly multipleSort: true;
@@ -22,6 +22,7 @@ const qdServiceTableProps = {
22
22
  maxHeight: "100%",
23
23
  hover: true,
24
24
  reserveSelectedRowOnPaginate: false,
25
+ reserveSelectedRowOnFilter: false,
25
26
  expandOnRowClick: void 0,
26
27
  hideSortTips: void 0,
27
28
  multipleSort: true,
@@ -76,6 +76,7 @@ export interface QdServiceTableProps<D extends TableRowData = TableRowData, R =
76
76
  rowKey?: string;
77
77
  size?: TdEnhancedTableProps<D>['size'] | 'mini';
78
78
  selectType?: 'single' | 'multiple';
79
+ reserveSelectedRowOnFilter?: boolean;
79
80
  headerBg?: boolean;
80
81
  showFilterResult?: boolean;
81
82
  searchData?: Record<string, unknown>;
@@ -66,6 +66,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
66
66
  },
67
67
  cacheColumnsKey: {},
68
68
  columns: {},
69
+ reserveSelectedRowOnFilter: {
70
+ type: Boolean
71
+ },
69
72
  headerBg: {
70
73
  type: Boolean
71
74
  },
@@ -49,6 +49,7 @@ export declare const qdServiceDialogTableSelectProps: {
49
49
  readonly showHeader: true;
50
50
  readonly maxHeight: "100%";
51
51
  readonly hover: true;
52
+ readonly reserveSelectedRowOnFilter: false;
52
53
  readonly expandOnRowClick: undefined;
53
54
  readonly hideSortTips: undefined;
54
55
  readonly multipleSort: true;
@@ -80,6 +80,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
80
80
  },
81
81
  cacheColumnsKey: {},
82
82
  columns: {},
83
+ reserveSelectedRowOnFilter: {
84
+ type: Boolean
85
+ },
83
86
  headerBg: {
84
87
  type: Boolean
85
88
  },
@@ -24,6 +24,7 @@ export declare const qdServiceDialogTabsTableSelectProps: {
24
24
  readonly showHeader: true;
25
25
  readonly maxHeight: "100%";
26
26
  readonly hover: true;
27
+ readonly reserveSelectedRowOnFilter: false;
27
28
  readonly expandOnRowClick: undefined;
28
29
  readonly hideSortTips: undefined;
29
30
  readonly multipleSort: true;
@@ -56,6 +56,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
56
56
  },
57
57
  cacheColumnsKey: {},
58
58
  columns: {},
59
+ reserveSelectedRowOnFilter: {
60
+ type: Boolean
61
+ },
59
62
  headerBg: {
60
63
  type: Boolean
61
64
  },
@@ -23,6 +23,7 @@ export declare const qdServicePopupTableSelectProps: {
23
23
  readonly showHeader: true;
24
24
  readonly maxHeight: "100%";
25
25
  readonly hover: true;
26
+ readonly reserveSelectedRowOnFilter: false;
26
27
  readonly expandOnRowClick: undefined;
27
28
  readonly hideSortTips: undefined;
28
29
  readonly multipleSort: true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qidian-vue-ui",
3
- "version": "2.0.51",
3
+ "version": "2.0.52",
4
4
  "description": "基于 TDesign 的 QiDian Vue UI 组件库",
5
5
  "author": "qidian",
6
6
  "license": "MIT",