qidian-vue-ui 2.8.0 → 2.8.1

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,6 +1,6 @@
1
- .qd-form-item[data-v-e77adabb] > .t-form__item > .t-form__controls > .t-form__controls-content > *:not(.t-switch):not(.t-tag):not(.t-icon):not(.qd-file-icon) {
1
+ .qd-form-item[data-v-c50cabe3] > .t-form__item > .t-form__controls > .t-form__controls-content > *:not(.t-switch):not(.t-tag):not(.t-icon):not(.qd-file-icon) {
2
2
  width: 100%;
3
3
  }
4
- .qd-form-item__component[data-v-e77adabb]:not(.t-switch):not(.t-tag):not(.t-icon):not(.qd-file-icon) {
4
+ .qd-form-item__component[data-v-c50cabe3]:not(.t-switch):not(.t-tag):not(.t-icon):not(.qd-file-icon) {
5
5
  width: 100%;
6
6
  }
@@ -2,7 +2,7 @@ import './item.css'
2
2
  import _sfc_main from "./item.vue2.mjs";
3
3
  /* empty css */
4
4
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
5
- const QdFormItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e77adabb"]]);
5
+ const QdFormItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c50cabe3"]]);
6
6
  export {
7
7
  QdFormItem as default
8
8
  };
@@ -19,6 +19,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
19
19
  props: /* @__PURE__ */ mergeDefaults({
20
20
  context: {},
21
21
  component: {},
22
+ label: { type: [Function, Object] },
22
23
  required: { type: [Boolean, String] },
23
24
  ifRender: { type: [Boolean, Function, Object] },
24
25
  help: { type: [String, Function, Object] },
@@ -27,7 +28,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
27
28
  trimOnBlur: { type: Boolean },
28
29
  gridIndex: {},
29
30
  for: {},
30
- label: {},
31
31
  labelAlign: {},
32
32
  labelWidth: {},
33
33
  name: {},
@@ -61,6 +61,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
61
61
  }
62
62
  return ifRender;
63
63
  });
64
+ const reLabel = computed(() => {
65
+ const label = props.label;
66
+ if (label?.__qdCompute || label?.__qdAsyncCompute) {
67
+ const { result } = qdUseComputeValue(
68
+ label,
69
+ currentContext,
70
+ props.crudMode
71
+ );
72
+ return result.value;
73
+ }
74
+ return label;
75
+ });
64
76
  const gridDefaultProps = inject(PROVIDE_GRID_ITEM_PROPS_KEY, void 0);
65
77
  const gridWidth = inject(PROVIDE_GRID_WIDTH_KEY, ref(DEFAULT_GRID_WIDTH));
66
78
  const gridIndex = computed(() => props.gridIndex);
@@ -95,12 +107,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
95
107
  const { component: reComponent, rules: wrappedRules } = resolveQdFormItemOptions({
96
108
  formItem: props,
97
109
  context: currentContext.value,
98
- label: formItemOptions.label,
110
+ label: reLabel.value,
99
111
  t
100
112
  });
101
113
  return {
102
114
  formItemOptions: {
103
115
  ...formItemOptions,
116
+ label: reLabel.value,
104
117
  rules: wrappedRules
105
118
  },
106
119
  gridItemOptions: { col, row },
@@ -10,9 +10,10 @@ export type QdFormBeforeSubmitQueueResult = boolean | {
10
10
  message?: string;
11
11
  };
12
12
  export type QdFormBeforeSubmitQueueItem = () => Promise<QdFormBeforeSubmitQueueResult> | QdFormBeforeSubmitQueueResult;
13
- export interface QdFormItemProps extends Omit<TdFormItemProps, 'rules' | 'help'>, AllowedComponentProps, QdGridItemProps, Pick<QdFormProps, 'crudMode' | 'defaultClearable'> {
13
+ export interface QdFormItemProps extends Omit<TdFormItemProps, 'label' | 'rules' | 'help'>, AllowedComponentProps, QdGridItemProps, Pick<QdFormProps, 'crudMode' | 'defaultClearable'> {
14
14
  context?: QdConfigRendererProps['context'];
15
15
  component?: QdConfigRendererProps['config'];
16
+ label?: QdConfigValue<TdFormItemProps['label']>;
16
17
  required?: boolean | string;
17
18
  ifRender?: QdConfigValue<boolean>;
18
19
  help?: TdFormItemProps['help'] | QdComputeFunction<TNodeReturnValue>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qidian-vue-ui",
3
- "version": "2.8.0",
3
+ "version": "2.8.1",
4
4
  "description": "基于 TDesign 的 QiDian Vue UI 组件库",
5
5
  "author": "qidian",
6
6
  "license": "MIT",