qidian-vue-ui 2.0.4 → 2.0.7

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.
@@ -498,4 +498,5 @@ export declare function useConfig<T extends keyof NonNullable<QdConfigProviderPr
498
498
  indicatorSuffix?: string;
499
499
  };
500
500
  })[T]>>;
501
+ size: import("vue").ComputedRef<import("tdesign-vue-next").SizeEnum | undefined>;
501
502
  };
@@ -6,6 +6,9 @@ import get from "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-
6
6
  function useConfig(key, componentLocale) {
7
7
  const injectGlobalConfig = getCurrentInstance?.() ? inject(PROVIDE_GLOBAL_CONFIG, void 0) : computed(() => window.__QIDIAN_GLOBAL_CONFIG__);
8
8
  const mergedGlobalConfig = computed(() => injectGlobalConfig?.value || zhCN);
9
+ const size = computed(
10
+ () => mergedGlobalConfig.value.size
11
+ );
9
12
  const globalConfig = computed(
10
13
  () => merge(
11
14
  {},
@@ -18,7 +21,8 @@ function useConfig(key, componentLocale) {
18
21
  };
19
22
  return {
20
23
  t,
21
- global: globalConfig
24
+ global: globalConfig,
25
+ size
22
26
  };
23
27
  }
24
28
  export {
@@ -41,6 +41,7 @@ declare const _default: <D extends TableRowData = TableRowData, R = unknown, P =
41
41
  columns?: import("..").QdCrudTableCol<D>[] | undefined;
42
42
  data?: D[] | undefined;
43
43
  sort?: import("tdesign-vue-next").TableSort | undefined;
44
+ size?: import("tdesign-vue-next").SizeEnum | "mini" | undefined;
44
45
  empty?: (string | import("tdesign-vue-next").TNode) | undefined;
45
46
  loading?: (boolean | import("tdesign-vue-next").TNode) | undefined;
46
47
  pagination?: (Pag extends ServicePagination ? false | Pag : Pag) | undefined;
@@ -51,7 +52,6 @@ declare const _default: <D extends TableRowData = TableRowData, R = unknown, P =
51
52
  maxLevel?: number;
52
53
  delCheckChildren?: boolean | ((context: import("../../service/table/types").QdServiceTableDeleteCheckContext<D>) => import("../../service/table/types").QdServiceTableDeleteCheckResult | Promise<import("../../service/table/types").QdServiceTableDeleteCheckResult>) | undefined;
53
54
  }) | undefined;
54
- size?: import("tdesign-vue-next").SizeEnum | "mini" | undefined;
55
55
  expandIcon?: boolean | ((h: typeof import("vue").h, props: import("tdesign-vue-next").ExpandArrowRenderParams<D>) => import("tdesign-vue-next").TNodeReturnValue) | undefined;
56
56
  filterIcon?: ((h: typeof import("vue").h, props: {
57
57
  col: import("tdesign-vue-next").PrimaryTableCol<D>;
@@ -1,17 +1,28 @@
1
- .qd-form--descriptions[data-v-0b8e1c15] .qd-grid {
1
+ .qd-form--small[data-v-9a11ef32] {
2
+ font: var(--td-font-body-medium);
3
+ }
4
+ .qd-form--small[data-v-9a11ef32] .t-form__label--top {
5
+ min-height: var(--td-comp-margin-xxl);
6
+ line-height: var(--td-comp-margin-xxl);
7
+ }
8
+ .qd-form--small[data-v-9a11ef32] .t-form__controls,
9
+ .qd-form--small[data-v-9a11ef32] .t-form__controls-content {
10
+ min-height: var(--td-comp-margin-xxl);
11
+ }
12
+ .qd-form--descriptions[data-v-9a11ef32] .qd-grid {
2
13
  border-top: 1px solid var(--td-component-border);
3
14
  border-left: 1px solid var(--td-component-border);
4
15
  }
5
- .qd-form--descriptions[data-v-0b8e1c15] .qd-grid-item {
16
+ .qd-form--descriptions[data-v-9a11ef32] .qd-grid-item {
6
17
  border-right: 1px solid var(--td-component-border);
7
18
  border-bottom: 1px solid var(--td-component-border);
8
19
  }
9
- .qd-form--descriptions[data-v-0b8e1c15] .t-form__item {
20
+ .qd-form--descriptions[data-v-9a11ef32] .t-form__item {
10
21
  display: flex;
11
22
  align-items: stretch;
12
23
  height: 100%;
13
24
  }
14
- .qd-form--descriptions[data-v-0b8e1c15] .t-form__label {
25
+ .qd-form--descriptions[data-v-9a11ef32] .t-form__label {
15
26
  display: flex;
16
27
  flex-direction: column;
17
28
  justify-content: center;
@@ -19,17 +30,17 @@
19
30
  padding: var(--td-comp-paddingLR-m) var(--td-comp-paddingLR-l);
20
31
  height: 100%;
21
32
  }
22
- .qd-form--descriptions[data-v-0b8e1c15] .t-form__label--top {
33
+ .qd-form--descriptions[data-v-9a11ef32] .t-form__label--top {
23
34
  border-bottom: 1px solid var(--td-component-border);
24
35
  align-items: center;
25
36
  height: var(--qd-form-description-label-height, auto);
26
37
  white-space: normal;
27
38
  }
28
- .qd-form--descriptions[data-v-0b8e1c15] .t-form__label--top + .t-form__controls > .t-form__controls-content {
39
+ .qd-form--descriptions[data-v-9a11ef32] .t-form__label--top + .t-form__controls > .t-form__controls-content {
29
40
  justify-content: center;
30
41
  text-align: center;
31
42
  }
32
- .qd-form--descriptions[data-v-0b8e1c15] .t-form__controls {
43
+ .qd-form--descriptions[data-v-9a11ef32] .t-form__controls {
33
44
  flex: 1 1 0;
34
45
  overflow: hidden;
35
46
  display: flex;
@@ -39,28 +50,28 @@
39
50
  margin-left: 0 !important;
40
51
  height: 100%;
41
52
  }
42
- .qd-form--descriptions[data-v-0b8e1c15] .qd-form-item--label-top {
53
+ .qd-form--descriptions[data-v-9a11ef32] .qd-form-item--label-top {
43
54
  display: grid;
44
55
  grid-template-rows: auto minmax(min-content, auto);
45
56
  grid-row: span 2 !important;
46
57
  }
47
- .qd-form--descriptions[data-v-0b8e1c15] .qd-form-item--label-top > .t-form__item {
58
+ .qd-form--descriptions[data-v-9a11ef32] .qd-form-item--label-top > .t-form__item {
48
59
  display: contents;
49
60
  }
50
- .qd-form--descriptions[data-v-0b8e1c15] .qd-form-item--label-top .t-form__controls-content {
61
+ .qd-form--descriptions[data-v-9a11ef32] .qd-form-item--label-top .t-form__controls-content {
51
62
  white-space: normal;
52
63
  }
53
- .qd-form--descriptions[data-v-0b8e1c15] .qd-form-item--empty-content .t-form__controls {
64
+ .qd-form--descriptions[data-v-9a11ef32] .qd-form-item--empty-content .t-form__controls {
54
65
  padding: 0 !important;
55
66
  min-height: 0;
56
67
  height: 0;
57
68
  overflow: hidden;
58
69
  }
59
- .qd-form--descriptions[data-v-0b8e1c15] .qd-form-item:not(.qd-form-item--label-top):not(.qd-form-item--label-width-full) .t-form__label {
70
+ .qd-form--descriptions[data-v-9a11ef32] .qd-form-item:not(.qd-form-item--label-top):not(.qd-form-item--label-width-full) .t-form__label {
60
71
  border-right: 1px solid var(--td-component-border);
61
72
  }
62
- .qd-form--descriptions-mini[data-v-0b8e1c15] .t-form__label,
63
- .qd-form--descriptions-mini[data-v-0b8e1c15] .t-form__controls {
73
+ .qd-form--descriptions-mini[data-v-9a11ef32] .t-form__label,
74
+ .qd-form--descriptions-mini[data-v-9a11ef32] .t-form__controls {
64
75
  padding: var(--td-comp-paddingTB-xxs) var(--td-comp-paddingLR-xxs);
65
76
  font: var(--td-font-body-small);
66
77
  }
@@ -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 QdForm = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-0b8e1c15"]]);
5
+ const QdForm = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-9a11ef32"]]);
6
6
  export {
7
7
  QdForm as default
8
8
  };
@@ -54,7 +54,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
54
54
  const props = __props;
55
55
  const emit = __emit;
56
56
  const { data } = useVModels(props, emit, { passive: true });
57
- const { t, global: formConfig } = useConfig("form");
57
+ const { t, global: formConfig, size: globalSize } = useConfig("form");
58
58
  const { global: tableConfig } = useConfig("table");
59
59
  const { msgError } = useModal();
60
60
  const beforeSubmitQueue = [];
@@ -103,7 +103,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
103
103
  onReset,
104
104
  ...formOptions
105
105
  } = props;
106
- const reSize = size ?? formConfig.value.size ?? (descriptions ? tableConfig.value.size : void 0);
106
+ const reSize = size ?? formConfig.value.size ?? (descriptions ? tableConfig.value.size : void 0) ?? globalSize.value;
107
107
  const mini = reSize === "mini";
108
108
  const componentSize = mini ? "small" : reSize;
109
109
  const reOnReset = (context) => {
@@ -114,6 +114,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
114
114
  descriptions,
115
115
  externalLoad,
116
116
  mini,
117
+ small: componentSize === "small" && !(descriptions && mini),
117
118
  size: componentSize,
118
119
  formOptions: {
119
120
  ...formOptions,
@@ -301,7 +302,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
301
302
  reProps.value.formOptions.labelAlign ? `qd-form--label-${reProps.value.formOptions.labelAlign}` : "",
302
303
  _ctx.$slots.footer ? "qd-form--has-footer" : "",
303
304
  reProps.value.descriptions ? "qd-form--descriptions" : "",
304
- reProps.value.descriptions && reProps.value.mini ? "qd-form--descriptions-mini" : ""
305
+ reProps.value.descriptions && reProps.value.mini ? "qd-form--descriptions-mini" : "",
306
+ reProps.value.small ? "qd-form--small" : ""
305
307
  ]
306
308
  }, reProps.value.formOptions, {
307
309
  data: unref(data),
@@ -213,6 +213,7 @@ p {
213
213
  align-items: center;
214
214
  }
215
215
  .t-card {
216
+ --td-card-padding: var(--td-comp-paddingTB-l) var(--td-comp-paddingLR-l);
216
217
  display: flex;
217
218
  flex-direction: column;
218
219
  }
@@ -222,14 +223,17 @@ p {
222
223
  flex-direction: column;
223
224
  }
224
225
  .t-card__header {
225
- padding: var(--td-comp-paddingTB-l) var(--td-comp-paddingLR-l) !important;
226
+ padding: var(--td-card-padding) !important;
226
227
  }
227
228
  .t-card__body {
228
229
  flex: auto;
229
- padding: var(--td-comp-paddingTB-l) var(--td-comp-paddingLR-l) !important;
230
+ padding: var(--td-card-padding) !important;
230
231
  }
231
232
  .t-card__footer {
232
- padding: var(--td-comp-paddingTB-l) var(--td-comp-paddingLR-l) !important;
233
+ padding: var(--td-card-padding) !important;
234
+ }
235
+ .t-card.t-size-s {
236
+ --td-card-padding: var(--td-comp-paddingTB-s) var(--td-comp-paddingLR-s);
233
237
  }
234
238
  .t-upload__card-name {
235
239
  display: inline-flex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qidian-vue-ui",
3
- "version": "2.0.4",
3
+ "version": "2.0.7",
4
4
  "description": "基于 TDesign 的 QiDian Vue UI 组件库",
5
5
  "author": "qidian",
6
6
  "license": "MIT",