cnhis-design-vue 3.1.40-beta.10 → 3.1.40-beta.11

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.
@@ -2,7 +2,7 @@ import { defineComponent, inject, computed, createVNode, mergeProps } from 'vue'
2
2
  import { arrayed, widthAppend } from '../../../../../shared/utils/index.js';
3
3
  import { isVoidField } from '@formily/core';
4
4
  import { connect, mapProps } from '@formily/vue';
5
- import { isString } from 'lodash-es';
5
+ import { isString, isArray } from 'lodash-es';
6
6
  import { NFormItem } from 'naive-ui';
7
7
  import Annotation from '../../../../annotation-edit/index.js';
8
8
  import '../../../index.js';
@@ -104,10 +104,11 @@ const FORM_ITEM = connect(script, mapProps({
104
104
  title: "label"
105
105
  }, (props, field) => {
106
106
  const feedback = !isVoidField(field) ? arrayed(field.selfErrors).length ? parseFeedback(arrayed(field.selfErrors), props.fieldItem) : void 0 : void 0;
107
+ const required = isVoidField(field) ? isSuffixRequired(props.fieldItem) : field.required;
107
108
  return {
108
109
  ...props,
109
110
  fieldItem: void 0,
110
- required: isVoidField(field) ? void 0 : field.required,
111
+ required,
111
112
  feedback,
112
113
  "validation-status": feedback ? "error" : void 0
113
114
  };
@@ -118,5 +119,10 @@ function parseFeedback(selfErrors, fieldItem) {
118
119
  }
119
120
  return validateMessageParser(fieldItem.defined_error_msg, fieldItem);
120
121
  }
122
+ function isSuffixRequired(field) {
123
+ if (!field || !isArray(field.suffixConfig) || !field.suffixConfig.length)
124
+ return false;
125
+ return `${field.is_null}` === "0";
126
+ }
121
127
 
122
128
  export { FORM_ITEM };
@@ -4,8 +4,8 @@ import '../../index.js';
4
4
  import { parseNumberFromMaybeString, formRenderLog } from '../utils/index.js';
5
5
  import { useFieldNormalize } from './useFieldNormalize.js';
6
6
  import { fieldKeyEscape, createLinebarId } from '../utils/schema.js';
7
- import { transformDateFormat } from '../utils/business.js';
8
7
  import { useFormValidator } from './useFormValidator.js';
8
+ import { transformDateFormat } from '../utils/business.js';
9
9
 
10
10
  function bindAutoGraphProps(schema, item) {
11
11
  Object.assign(schema["x-component-props"], {
@@ -234,23 +234,25 @@ function useFieldListAdaptor(collector) {
234
234
  if (!item.suffixConfig)
235
235
  return createWidgetSchema(item);
236
236
  const suffixList = arrayed(item.suffixConfig);
237
- const fieldList = [{ ...item, suffixConfig: void 0 }].concat(
237
+ const fieldList = [{ ...item, hide_title: "1", suffixConfig: void 0 }].concat(
238
238
  suffixList.map((suffix) => {
239
239
  return {
240
240
  ...suffix,
241
- is_show: item.is_show,
242
- alias: ""
241
+ hide_title: "1",
242
+ is_show: item.is_show
243
243
  };
244
244
  })
245
245
  );
246
- return {
246
+ const schema = createStandardSchema(item);
247
+ Object.assign(schema, {
247
248
  type: "void",
248
249
  name: fieldKeyEscape(fieldList),
249
250
  title: item.alias || item.name,
250
251
  "x-component": "INPUT_GROUP",
251
252
  "x-component-props": { span: (item.elem_width || 3) * 2 },
252
253
  properties: schemaAdaptor(fieldList)
253
- };
254
+ });
255
+ return schema;
254
256
  };
255
257
  const { FieldNormalizeWaterfallHook } = useFieldNormalize();
256
258
  function schemaAdaptor(fieldList) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.1.40-beta.10",
3
+ "version": "3.1.40-beta.11",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -61,5 +61,5 @@
61
61
  "iOS 7",
62
62
  "last 3 iOS versions"
63
63
  ],
64
- "gitHead": "e91f488ae42382741e5c2b9601d4204e951a2a37"
64
+ "gitHead": "5e2ed2cc2e0159dabb41893227bcf53c4d3f8f5c"
65
65
  }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};