qidian-vue-ui 2.7.2 → 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.
@@ -1,31 +1,31 @@
1
- .qd-columns-controller__title[data-v-ec921dfa] {
1
+ .qd-columns-controller__title[data-v-579d4a20] {
2
2
  display: flex;
3
3
  align-items: center;
4
4
  }
5
- .qd-columns-controller__drag[data-v-ec921dfa] {
5
+ .qd-columns-controller__drag[data-v-579d4a20] {
6
6
  cursor: move;
7
7
  margin-right: var(--td-comp-margin-m);
8
8
  }
9
- .qd-columns-controller__ghost[data-v-ec921dfa] {
9
+ .qd-columns-controller__ghost[data-v-579d4a20] {
10
10
  opacity: 0.5;
11
11
  background: var(--td-brand-color-light);
12
12
  }
13
- .qd-columns-controller__chosen[data-v-ec921dfa] {
13
+ .qd-columns-controller__chosen[data-v-579d4a20] {
14
14
  background: var(--td-brand-color-light-hover);
15
15
  }
16
- .qd-columns-controller__width-input[data-v-ec921dfa] {
16
+ .qd-columns-controller__width-input[data-v-579d4a20] {
17
17
  width: 100%;
18
18
  }
19
- .qd-columns-controller__help[data-v-ec921dfa] {
19
+ .qd-columns-controller__help[data-v-579d4a20] {
20
20
  font-size: var(--td-font-size-title-large);
21
21
  }
22
- .qd-columns-controller__footer[data-v-ec921dfa] {
22
+ .qd-columns-controller__footer[data-v-579d4a20] {
23
23
  width: 100%;
24
24
  display: flex;
25
25
  justify-content: space-between;
26
26
  align-items: center;
27
27
  }
28
- .qd-columns-controller__footer-actions[data-v-ec921dfa] {
28
+ .qd-columns-controller__footer-actions[data-v-579d4a20] {
29
29
  flex: 1 1 0;
30
30
  overflow: hidden;
31
31
  }
@@ -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 QdColumnsController = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ec921dfa"]]);
5
+ const QdColumnsController = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-579d4a20"]]);
6
6
  export {
7
7
  QdColumnsController as default
8
8
  };
@@ -4,13 +4,14 @@ import { useVModels } from "../../node_modules/.pnpm/@vueuse_core@14.2.0_vue@3.5
4
4
  import { createExposeProxy, isEmpty } from "qidian-shared";
5
5
  import Sortable from "../../node_modules/.pnpm/sortablejs@1.15.6/node_modules/sortablejs/modular/sortable.esm.mjs";
6
6
  import { MoveIcon, HelpCircleIcon } from "tdesign-icons-vue-next";
7
- import { Space, Link, Divider, InputNumber, Button, Tooltip } from "tdesign-vue-next";
7
+ import { Space, Link, Divider, Button, Tooltip } from "tdesign-vue-next";
8
8
  import { useConfig } from "../config-provider/useConfig.mjs";
9
9
  import { COMPONENT_FONT_MAP, compensateWidth, calcOperationLinksWidth } from "../service/table/columnsCompensation.mjs";
10
10
  import { qdColumnsControllerProps } from "./props.mjs";
11
11
  import _sfc_main$1 from "../dialog/index.vue.mjs";
12
12
  /* empty css */
13
13
  import QdServiceTable from "../service/table/index.vue.mjs";
14
+ import _sfc_main$2 from "../input-number/index.vue.mjs";
14
15
  import cloneDeep from "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/cloneDeep.mjs";
15
16
  const _hoisted_1 = {
16
17
  class: "qd-columns-controller__title"
@@ -249,12 +250,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
249
250
  }, 8, ["data-col-key"]), createElementVNode("span", _hoisted_2, toDisplayString(row.title), 1)])]),
250
251
  width: withCtx(({
251
252
  row
252
- }) => [createVNode(unref(InputNumber), {
253
+ }) => [createVNode(unref(_sfc_main$2), {
253
254
  class: "qd-columns-controller__width-input",
254
255
  modelValue: row.width,
255
256
  "onUpdate:modelValue": ($event) => row.width = $event,
256
- min: 50,
257
+ min: 0,
257
258
  step: 10,
259
+ theme: "row",
258
260
  suffix: "px",
259
261
  placeholder: "auto"
260
262
  }, null, 8, ["modelValue", "onUpdate:modelValue"])]),
@@ -1,40 +1,40 @@
1
- .qd-crud-table[data-v-5b6139bb] {
1
+ .qd-crud-table[data-v-d112be81] {
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-5b6139bb] {
6
+ .qd-crud-table > .qd-crud-search:not(.qd-crud-search--hide) + .qd-crud-table__body[data-v-d112be81] {
7
7
  margin-top: var(--td-comp-margin-l);
8
8
  }
9
- .qd-crud-table__body[data-v-5b6139bb] > .t-loading__parent > .t-card__body {
9
+ .qd-crud-table__body[data-v-d112be81] > .t-loading__parent > .t-card__body {
10
10
  display: flex;
11
11
  flex-direction: column;
12
12
  }
13
- .qd-crud-table__body[data-v-5b6139bb] > .t-loading__parent > .t-card__body > .qd-service-table .t-table__pagination {
13
+ .qd-crud-table__body[data-v-d112be81] > .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-5b6139bb] {
16
+ .qd-crud-table--fit-parent-height[data-v-d112be81] {
17
17
  height: 100%;
18
18
  }
19
- .qd-crud-table--fit-parent-height > .qd-crud-table__body[data-v-5b6139bb] {
19
+ .qd-crud-table--fit-parent-height > .qd-crud-table__body[data-v-d112be81] {
20
20
  flex: auto;
21
21
  }
22
- .qd-crud-table--fit-parent-height > .qd-crud-table__body[data-v-5b6139bb] > .t-loading__parent > .t-card__body {
22
+ .qd-crud-table--fit-parent-height > .qd-crud-table__body[data-v-d112be81] > .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-5b6139bb] > .t-loading__parent > .t-card__body > .qd-service-table {
26
+ .qd-crud-table--fit-parent-height > .qd-crud-table__body[data-v-d112be81] > .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-5b6139bb] {
30
+ .qd-crud-table__toolbar[data-v-d112be81] {
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-5b6139bb] {
34
+ .qd-crud-table__toolbar--has-space-item + .qd-service-table[data-v-d112be81] {
35
35
  margin-top: var(--td-comp-margin-l);
36
36
  }
37
- .qd-crud-table__toolbar-separator[data-v-5b6139bb] {
37
+ .qd-crud-table__toolbar-separator[data-v-d112be81] {
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-5b6139bb"]]);
5
+ const QdCrudTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d112be81"]]);
6
6
  export {
7
7
  QdCrudTable as default
8
8
  };
@@ -535,12 +535,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
535
535
  const operationSize = serviceTableOptions.size ?? tableGlobalConfig.value?.size ?? "small";
536
536
  const operationFontSize = COMPONENT_FONT_MAP[globalComponentSize.value ?? "medium"] ?? COMPONENT_FONT_MAP.medium;
537
537
  const operationIdx = reColumns.findIndex((item) => item.colKey === "operation");
538
+ const operationWidth = calcOperationWidth(reRowActions, data.value, operationSize, operationFontSize);
538
539
  const defaultOperation = {
539
540
  title: t("operationText"),
540
541
  colKey: "operation",
541
542
  align: "center",
542
543
  fixed: "right",
543
- width: calcOperationWidth(reRowActions, data.value, operationSize, operationFontSize)
544
+ // 无可见操作时给表头保底宽度
545
+ width: operationWidth === 0 ? 50 : operationWidth
546
+ // hidden: operationWidth === 0
544
547
  };
545
548
  if (operationIdx > -1) {
546
549
  reColumns[operationIdx] = {
@@ -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?.();
@@ -156,7 +156,7 @@ async function useDictBatch(data, fieldDictMap, options) {
156
156
  for (const [field, dictType] of Object.entries(fieldDictMap)) {
157
157
  const opts = optionsMap[dictType];
158
158
  if (!opts || isEmpty(data[field])) continue;
159
- data[field] = findEnum(opts, data[field], find)?.[valueKey];
159
+ data[field] = findEnum(opts, data[field], { key: find })?.[valueKey];
160
160
  }
161
161
  return data;
162
162
  }
@@ -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';
@@ -213,6 +213,10 @@ p {
213
213
  position: initial;
214
214
  bottom: auto;
215
215
  }
216
+ .t-table__body > tr > td > .t-form__item .t-form__controls > .t-input__extra {
217
+ text-overflow: clip;
218
+ white-space: normal;
219
+ }
216
220
  .t-table__content tbody > tr:last-child:not(.t-table__empty-row) > td,
217
221
  .t-table__content tfoot > tr:last-child > td {
218
222
  border-bottom: 1px solid var(--td-component-border);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qidian-vue-ui",
3
- "version": "2.7.2",
3
+ "version": "2.7.5",
4
4
  "description": "基于 TDesign 的 QiDian Vue UI 组件库",
5
5
  "author": "qidian",
6
6
  "license": "MIT",
@@ -137,7 +137,7 @@
137
137
  "vue-codemirror": "^6.1.1",
138
138
  "vue-echarts": "^8.0.1",
139
139
  "vue-stream-markdown": "1.0.1-beta.1",
140
- "qidian-shared": "1.2.7"
140
+ "qidian-shared": "1.3.0"
141
141
  },
142
142
  "scripts": {
143
143
  "clean": "rm -rf dist",