qidian-vue-ui 2.0.39 → 2.0.41

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,37 @@
1
- .qd-crud-search[data-v-5603ed69] {
2
- height: var(--db8b5e88);
1
+ .qd-crud-search[data-v-bf70986d] {
2
+ height: var(--v18df9f58);
3
3
  }
4
- .qd-crud-search[data-v-5603ed69] > .t-loading__parent {
4
+ .qd-crud-search[data-v-bf70986d] > .t-loading__parent {
5
5
  height: 100%;
6
6
  }
7
- .qd-crud-search[data-v-5603ed69] > .t-loading__parent > .t-card__body {
7
+ .qd-crud-search[data-v-bf70986d] > .t-loading__parent > .t-card__body {
8
8
  height: 100%;
9
9
  padding-bottom: 0 !important;
10
10
  }
11
- .qd-crud-search[data-v-5603ed69] > .t-loading__parent > .t-card__body > .qd-form {
11
+ .qd-crud-search[data-v-bf70986d] > .t-loading__parent > .t-card__body > .qd-form {
12
12
  display: flex;
13
13
  align-items: flex-end;
14
14
  flex-flow: row wrap;
15
15
  height: 100%;
16
16
  }
17
- .qd-crud-search[data-v-5603ed69] > .t-loading__parent > .t-card__body > .qd-form > .qd-grid {
17
+ .qd-crud-search[data-v-bf70986d] > .t-loading__parent > .t-card__body > .qd-form > .qd-grid {
18
18
  height: 100%;
19
19
  flex: 1 1 0;
20
20
  overflow: hidden;
21
21
  margin-right: var(--td-comp-margin-l);
22
22
  }
23
- .qd-crud-search__actions[data-v-5603ed69] {
23
+ .qd-crud-search__actions[data-v-bf70986d] {
24
24
  margin-bottom: var(--td-comp-margin-xl);
25
25
  }
26
- .qd-crud-search__more[data-v-5603ed69] .t-icon {
26
+ .qd-crud-search__more[data-v-bf70986d] {
27
+ overflow: visible;
28
+ }
29
+ .qd-crud-search__more[data-v-bf70986d] .t-icon {
27
30
  transition: transform cubic-bezier(0.38, 0, 0.24, 1) 0.2s;
28
31
  }
29
- .qd-crud-search__more--expand[data-v-5603ed69] .t-icon {
32
+ .qd-crud-search__more[data-v-bf70986d] .t-badge {
33
+ font-size: inherit;
34
+ }
35
+ .qd-crud-search__more--expand[data-v-bf70986d] .t-icon {
30
36
  transform: rotate(-180deg);
31
37
  }
@@ -1,9 +1,9 @@
1
1
  import type { QdCrudSearchProps } from './types';
2
- declare var __VLS_8: string, __VLS_9: any, __VLS_50: string, __VLS_51: any;
2
+ declare var __VLS_8: string, __VLS_9: any, __VLS_58: string, __VLS_59: any;
3
3
  type __VLS_Slots = {} & {
4
4
  [K in NonNullable<typeof __VLS_8>]?: (props: typeof __VLS_9) => any;
5
5
  } & {
6
- [K in NonNullable<typeof __VLS_50>]?: (props: typeof __VLS_51) => any;
6
+ [K in NonNullable<typeof __VLS_58>]?: (props: typeof __VLS_59) => any;
7
7
  };
8
8
  declare const __VLS_component: import("vue").DefineComponent<QdCrudSearchProps, {
9
9
  submit: (params?: {
@@ -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 QdCrudSearch = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5603ed69"]]);
5
+ const QdCrudSearch = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-bf70986d"]]);
6
6
  export {
7
7
  QdCrudSearch as default
8
8
  };
@@ -1,9 +1,9 @@
1
1
  import './index.css'
2
- import { defineComponent, mergeDefaults, useCssVars, computed, useTemplateRef, ref, onMounted, withDirectives, createBlock, openBlock, unref, createSlots, withCtx, createVNode, mergeProps, isRef, createCommentVNode, normalizeClass, createTextVNode, toDisplayString, renderList, renderSlot, normalizeProps, guardReactiveProps } from "vue";
2
+ import { defineComponent, mergeDefaults, useCssVars, computed, useTemplateRef, ref, watch, nextTick, onMounted, withDirectives, createBlock, openBlock, unref, createSlots, withCtx, createVNode, mergeProps, isRef, createCommentVNode, normalizeClass, createTextVNode, toDisplayString, createElementBlock, Fragment, renderList, renderSlot, normalizeProps, guardReactiveProps } from "vue";
3
3
  import { useVModel } 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 { extractSlotsWithPrefix, resizeDirective } from "qidian-shared";
4
+ import { isEmpty, extractSlotsWithPrefix, resizeDirective } from "qidian-shared";
5
5
  import { ChevronDownIcon } from "tdesign-icons-vue-next";
6
- import { Space, Button } from "tdesign-vue-next";
6
+ import { Space, Tooltip, Button, Badge } from "tdesign-vue-next";
7
7
  import { useConfig } from "../../config-provider/useConfig.mjs";
8
8
  import { qdSearchGrid, qdCrudSearchProps } from "./props.mjs";
9
9
  import merge from "../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge.mjs";
@@ -51,13 +51,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
51
51
  emits: ["update:data"],
52
52
  setup(__props, { expose: __expose, emit: __emit }) {
53
53
  useCssVars((_ctx) => ({
54
- "db8b5e88": cardH.value
54
+ "v18df9f58": cardH.value
55
55
  }));
56
56
  const props = __props;
57
57
  const emit = __emit;
58
58
  const data = useVModel(props, "data", emit, { passive: true });
59
59
  const vResize = resizeDirective;
60
- const { t } = useConfig("crud");
60
+ const { t, size: globalSize } = useConfig("crud");
61
61
  const reProps = computed(() => {
62
62
  const { data: data2, btnDisabled, onSearch, onReset, grid, ...formOptions } = props;
63
63
  return {
@@ -77,6 +77,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
77
77
  const oneLineH = ref("auto");
78
78
  const cardH = computed(() => expand.value ? "auto" : oneLineH.value);
79
79
  const formRef = useTemplateRef("form");
80
+ const hiddenItems = ref([]);
81
+ const filledHiddenItems = computed(
82
+ () => hiddenItems.value.filter((item) => !isEmpty(data.value[item.name]))
83
+ );
80
84
  function getPadding(element, top, bottom) {
81
85
  const styles = getComputedStyle(element);
82
86
  const pt = parseInt(styles.paddingTop) || 0;
@@ -94,12 +98,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
94
98
  resetExpand();
95
99
  return;
96
100
  }
97
- const gridItems = el.querySelectorAll(".qd-grid-item");
101
+ const gridItems = Array.from(grid.children).filter(
102
+ (item) => item instanceof HTMLElement && item.classList.contains("qd-grid-item") && !!item.offsetHeight
103
+ );
98
104
  if (!gridItems.length) {
99
105
  resetExpand();
100
106
  return;
101
107
  }
102
- const heights = Array.from(gridItems, (item) => item.offsetHeight);
108
+ const heights = gridItems.map((item) => item.offsetHeight);
103
109
  const minItemHeight = Math.min(...heights);
104
110
  if (grid.scrollHeight - 1 < minItemHeight) {
105
111
  resetExpand();
@@ -109,13 +115,31 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
109
115
  const totalHeight = minItemHeight + (cardBody ? getPadding(cardBody) : 0) + getPadding(el);
110
116
  showExpand.value = true;
111
117
  oneLineH.value = `${totalHeight}px`;
118
+ syncHiddenItems(gridItems);
112
119
  }
113
120
  function resetExpand() {
114
121
  showExpand.value = false;
115
122
  oneLineH.value = "auto";
116
123
  expand.value = false;
124
+ hiddenItems.value = [];
125
+ }
126
+ function syncHiddenItems(gridItems) {
127
+ const firstRowTop = Math.min(...gridItems.map((item) => item.offsetTop));
128
+ hiddenItems.value = gridItems.flatMap((element) => {
129
+ if (element.offsetTop - firstRowTop <= 1) return [];
130
+ const formItem = props.items?.find(
131
+ (item) => item.name && element.classList.contains(`qd-form-item__${item.name}`)
132
+ );
133
+ if (!formItem?.name) return [];
134
+ const label = element.querySelector(".t-form__label")?.textContent?.trim() || formItem.name;
135
+ return [{ name: formItem.name, label }];
136
+ });
117
137
  }
118
138
  const expose = {};
139
+ watch(globalSize, async () => {
140
+ await nextTick();
141
+ onResize();
142
+ });
119
143
  onMounted(() => {
120
144
  Object.assign(expose, formRef.value);
121
145
  });
@@ -138,20 +162,44 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
138
162
  size: "small"
139
163
  }, {
140
164
  default: withCtx(() => [
141
- showExpand.value ? (openBlock(), createBlock(unref(Button), {
142
- class: normalizeClass(["qd-crud-search__more", expand.value ? "qd-crud-search__more--expand" : ""]),
143
- key: "expand",
144
- variant: "text",
145
- onClick: _cache[0] || (_cache[0] = ($event) => expand.value = !expand.value)
165
+ showExpand.value ? (openBlock(), createBlock(unref(Tooltip), {
166
+ key: 0,
167
+ disabled: expand.value || !filledHiddenItems.value.length,
168
+ placement: "top"
146
169
  }, {
147
- suffix: withCtx(() => [
148
- createVNode(unref(ChevronDownIcon))
170
+ content: withCtx(() => [
171
+ (openBlock(true), createElementBlock(Fragment, null, renderList(filledHiddenItems.value, (item) => {
172
+ return openBlock(), createElementBlock("div", {
173
+ key: item.name
174
+ }, toDisplayString(item.label), 1);
175
+ }), 128))
149
176
  ]),
150
177
  default: withCtx(() => [
151
- createTextVNode(toDisplayString(expand.value ? unref(t)("collapseSearchText") : unref(t)("expandSearchText")) + " ", 1)
178
+ createVNode(unref(Button), {
179
+ class: normalizeClass(["qd-crud-search__more", expand.value ? "qd-crud-search__more--expand" : ""]),
180
+ key: "expand",
181
+ variant: "text",
182
+ onClick: _cache[0] || (_cache[0] = ($event) => expand.value = !expand.value)
183
+ }, {
184
+ suffix: withCtx(() => [
185
+ createVNode(unref(ChevronDownIcon))
186
+ ]),
187
+ default: withCtx(() => [
188
+ createVNode(unref(Badge), {
189
+ count: expand.value ? 0 : filledHiddenItems.value.length,
190
+ size: "small"
191
+ }, {
192
+ default: withCtx(() => [
193
+ createTextVNode(toDisplayString(expand.value ? unref(t)("collapseSearchText") : unref(t)("expandSearchText")), 1)
194
+ ]),
195
+ _: 1
196
+ }, 8, ["count"])
197
+ ]),
198
+ _: 1
199
+ }, 8, ["class"])
152
200
  ]),
153
201
  _: 1
154
- }, 8, ["class"])) : createCommentVNode("", true),
202
+ }, 8, ["disabled"])) : createCommentVNode("", true),
155
203
  createVNode(unref(Button), {
156
204
  key: "submit",
157
205
  type: "submit",
@@ -1,31 +1,34 @@
1
- .qd-dialog-table-select[data-v-f977aab9] {
1
+ .qd-dialog-table-select[data-v-ef4f0dd9] {
2
2
  width: 100%;
3
3
  }
4
- .qd-dialog-table-select__trigger[data-v-f977aab9] {
4
+ .qd-dialog-table-select__trigger[data-v-ef4f0dd9] {
5
5
  width: 100%;
6
6
  }
7
- .qd-dialog-table-select__trigger[data-v-f977aab9]:not(.qd-dialog-table-select__trigger--readonly):not(.qd-dialog-table-select__trigger--disabled) {
7
+ .qd-dialog-table-select__trigger[data-v-ef4f0dd9]: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-f977aab9] {
10
+ .qd-dialog-table-select__input-trigger[data-v-ef4f0dd9] {
11
11
  border-top-left-radius: 0;
12
12
  border-bottom-left-radius: 0;
13
13
  }
14
- .qd-dialog-table-select__table[data-v-f977aab9] .qd-crud-search > .t-loading__parent > .t-card__body,
15
- .qd-dialog-table-select__table[data-v-f977aab9] .qd-crud-table__body > .t-loading__parent > .t-card__body {
14
+ .qd-dialog-table-select__table[data-v-ef4f0dd9] .qd-crud-search > .t-loading__parent > .t-card__body,
15
+ .qd-dialog-table-select__table[data-v-ef4f0dd9] .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-f977aab9] .qd-crud-table__toolbar {
18
+ .qd-dialog-table-select__table[data-v-ef4f0dd9] .qd-crud-table__toolbar {
19
19
  display: none;
20
20
  }
21
- .qd-dialog-table-select__table[data-v-f977aab9] .qd-service-table {
21
+ .qd-dialog-table-select__table[data-v-ef4f0dd9] .qd-crud-table__body {
22
+ margin-top: 0 !important;
23
+ }
24
+ .qd-dialog-table-select__table[data-v-ef4f0dd9] .qd-service-table {
22
25
  margin-top: 0;
23
26
  }
24
- .qd-dialog-table-select__table-add[data-v-f977aab9] {
27
+ .qd-dialog-table-select__table-add[data-v-ef4f0dd9] {
25
28
  margin-top: var(--td-comp-margin-m);
26
29
  display: flex;
27
30
  }
28
- .qd-dialog-table-select__table-add .t-input__wrap[data-v-f977aab9] {
31
+ .qd-dialog-table-select__table-add .t-input__wrap[data-v-ef4f0dd9] {
29
32
  flex: 1 1 0;
30
33
  overflow: hidden;
31
34
  margin-right: var(--td-comp-margin-m);
@@ -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-f977aab9"]]);
5
+ const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ef4f0dd9"]]);
6
6
  export {
7
7
  index as default
8
8
  };
@@ -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 index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b01d19a7"]]);
7
+ const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4dacb1c1"]]);
8
8
  export {
9
9
  index as default
10
10
  };
@@ -1,23 +1,26 @@
1
- .qd-popup-table-select__table[data-v-b01d19a7] .qd-crud-search > .t-loading__parent > .t-card__body,
2
- .qd-popup-table-select__table[data-v-b01d19a7] .qd-crud-table__body > .t-loading__parent > .t-card__body {
1
+ .qd-popup-table-select__table[data-v-4dacb1c1] .qd-crud-search > .t-loading__parent > .t-card__body,
2
+ .qd-popup-table-select__table[data-v-4dacb1c1] .qd-crud-table__body > .t-loading__parent > .t-card__body {
3
3
  padding: 0 !important;
4
4
  }
5
- .qd-popup-table-select__table[data-v-b01d19a7] .qd-crud-table__toolbar {
5
+ .qd-popup-table-select__table[data-v-4dacb1c1] .qd-crud-table__toolbar {
6
6
  display: none;
7
7
  }
8
- .qd-popup-table-select__table[data-v-b01d19a7] .qd-service-table {
8
+ .qd-popup-table-select__table[data-v-4dacb1c1] .qd-crud-table__body {
9
+ margin-top: 0 !important;
10
+ }
11
+ .qd-popup-table-select__table[data-v-4dacb1c1] .qd-service-table {
9
12
  margin-top: 0;
10
13
  }
11
- .qd-popup-table-select__table-add[data-v-b01d19a7] {
14
+ .qd-popup-table-select__table-add[data-v-4dacb1c1] {
12
15
  margin-top: var(--td-comp-margin-m);
13
16
  display: flex;
14
17
  }
15
- .qd-popup-table-select__table-add .t-input__wrap[data-v-b01d19a7] {
18
+ .qd-popup-table-select__table-add .t-input__wrap[data-v-4dacb1c1] {
16
19
  flex: 1 1 0;
17
20
  overflow: hidden;
18
21
  margin-right: var(--td-comp-margin-m);
19
22
  }
20
- .qd-popup-table-select__input-trigger[data-v-b01d19a7] {
23
+ .qd-popup-table-select__input-trigger[data-v-4dacb1c1] {
21
24
  border-top-left-radius: 0;
22
25
  border-bottom-left-radius: 0;
23
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qidian-vue-ui",
3
- "version": "2.0.39",
3
+ "version": "2.0.41",
4
4
  "description": "基于 TDesign 的 QiDian Vue UI 组件库",
5
5
  "author": "qidian",
6
6
  "license": "MIT",
@@ -130,7 +130,7 @@
130
130
  "vue-codemirror": "^6.1.1",
131
131
  "vue-echarts": "^8.0.1",
132
132
  "vue-stream-markdown": "1.0.1-beta.1",
133
- "qidian-shared": "1.2.5"
133
+ "qidian-shared": "1.2.6"
134
134
  },
135
135
  "scripts": {
136
136
  "clean": "rm -rf dist",