cnhis-design-vue 3.1.16-beta.9 → 3.1.16
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.
- package/es/packages/big-table/src/BigTable.vue.d.ts +6 -1
- package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +2 -2
- package/es/packages/big-table/src/components/edit-form/edit-date.js +13 -3
- package/es/packages/big-table/src/components/edit-form/edit-time.js +1 -0
- package/es/packages/big-table/src/hooks/useSeparateRow.js +5 -2
- package/es/packages/button-print/index.d.ts +4 -1
- package/es/packages/button-print/src/ButtonPrint.vue.d.ts +4 -1
- package/es/packages/button-print/src/components/IdentityVerification.js +5 -7
- package/es/packages/button-print/src/components/IdentityVerification.vue.d.ts +4 -1
- package/es/packages/fabric-chart/src/FabricChart.js +1 -1
- package/es/packages/fabric-chart/src/components/PopupTip.js +2 -2
- package/es/packages/fabric-chart/src/hooks/constant.js +1 -1
- package/es/packages/fabric-chart/src/hooks/useCenter.js +11 -2
- package/es/packages/fabric-chart/src/hooks/useOther.js +63 -13
- package/es/packages/form-config/index.d.ts +7 -2
- package/es/packages/form-config/src/FormConfig.vue.d.ts +7 -2
- package/es/packages/form-config/src/components/FormConfigCreator.vue.d.ts +3 -1
- package/es/packages/form-config/src/components/FormConfigEdit.vue.d.ts +4 -1
- package/es/packages/form-config/src/types/index.d.ts +1 -0
- package/es/packages/form-config/style/index.css +1 -1
- package/es/packages/form-render/index.d.ts +3 -1
- package/es/packages/form-render/index.js +0 -1
- package/es/packages/form-render/src/FormRender.js +7 -8
- package/es/packages/form-render/src/FormRender.vue.d.ts +3 -1
- package/es/packages/form-render/src/components/renderer/{combination/index.d.ts → combination.d.ts} +3 -3
- package/es/packages/form-render/src/components/renderer/combination.js +92 -0
- package/es/packages/form-render/src/components/renderer/date.js +12 -4
- package/es/packages/form-render/src/components/renderer/formItem.js +11 -3
- package/es/packages/form-render/src/components/renderer/index.d.ts +1 -0
- package/es/packages/form-render/src/components/renderer/index.js +2 -1
- package/es/packages/form-render/src/components/renderer/{combination → jsonCombination}/hooks/useDeepValidate.d.ts +0 -0
- package/es/packages/form-render/src/components/renderer/{combination → jsonCombination}/hooks/useDeepValidate.js +0 -0
- package/es/packages/form-render/src/components/renderer/jsonCombination/index.d.ts +44 -0
- package/es/packages/form-render/src/components/renderer/{combination → jsonCombination}/index.js +29 -14
- package/es/packages/form-render/src/hooks/index.d.ts +0 -1
- package/es/packages/form-render/src/hooks/index.js +0 -1
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.d.ts +1 -1
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +7 -3
- package/es/packages/form-render/src/hooks/useTypeNormalize.js +2 -1
- package/es/packages/form-render/src/types/fieldItem.d.ts +4 -0
- package/es/packages/form-render/src/types/index.d.ts +2 -2
- package/es/packages/form-render/src/utils/index.js +3 -2
- package/es/packages/form-render/src/utils/schema.d.ts +60 -0
- package/es/packages/form-render/src/utils/schema.js +5 -2
- package/es/packages/form-render/style/index.css +11 -8
- package/es/packages/index.css +12 -9
- package/es/packages/index.js +0 -1
- package/es/packages/shortcut-provider/src/hooks/useShortcuts.js +1 -0
- package/es/packages/shortcut-setter/index.d.ts +4 -1
- package/es/packages/shortcut-setter/src/ShortcutSetter.vue.d.ts +4 -1
- package/es/src/utils/index.d.ts +1 -0
- package/es/src/utils/index.js +11 -1
- package/package.json +4 -4
- package/es/packages/form-render/src/hooks/useInitialData.d.ts +0 -5
- package/es/packages/form-render/src/hooks/useInitialData.js +0 -16
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { defineComponent, computed, watch, createVNode, mergeProps } from 'vue';
|
|
2
|
+
import { generateTimeFormat } from '../../../../../src/utils';
|
|
2
3
|
import { connect, mapProps } from '@formily/vue';
|
|
3
4
|
import { isObject } from '@vueuse/core';
|
|
4
5
|
import { format } from 'date-fns';
|
|
@@ -66,9 +67,7 @@ const script = defineComponent({
|
|
|
66
67
|
}
|
|
67
68
|
}
|
|
68
69
|
const validateConfig = computed(() => {
|
|
69
|
-
const result = {
|
|
70
|
-
valueFormat: props.valueFormat
|
|
71
|
-
};
|
|
70
|
+
const result = {};
|
|
72
71
|
if (isObject(props.validate)) {
|
|
73
72
|
const {
|
|
74
73
|
min_date,
|
|
@@ -81,6 +80,15 @@ const script = defineComponent({
|
|
|
81
80
|
}
|
|
82
81
|
return result;
|
|
83
82
|
});
|
|
83
|
+
const formatConfig = computed(() => {
|
|
84
|
+
return {
|
|
85
|
+
valueFormat: props.valueFormat,
|
|
86
|
+
format: props.valueFormat,
|
|
87
|
+
timePickerProps: {
|
|
88
|
+
format: generateTimeFormat(props.valueFormat)
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
});
|
|
84
92
|
function formatDate(value) {
|
|
85
93
|
if (!value)
|
|
86
94
|
return value;
|
|
@@ -95,7 +103,7 @@ const script = defineComponent({
|
|
|
95
103
|
get: () => formatDate(props.value),
|
|
96
104
|
set: (value) => emit("update:value", value)
|
|
97
105
|
});
|
|
98
|
-
return () => createVNode(NDatePicker, mergeProps(validateConfig.value, {
|
|
106
|
+
return () => createVNode(NDatePicker, mergeProps(validateConfig.value, formatConfig.value, {
|
|
99
107
|
"formatted-value": valueRef.value,
|
|
100
108
|
"onUpdate:formatted-value": ($event) => valueRef.value = $event
|
|
101
109
|
}), null);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { defineComponent, inject, computed, createVNode } from 'vue';
|
|
2
2
|
import { isVoidField } from '@formily/core';
|
|
3
|
-
import { connect, mapProps } from '@formily/vue';
|
|
3
|
+
import { useField, connect, mapProps } from '@formily/vue';
|
|
4
4
|
import { NFormItem } from 'naive-ui';
|
|
5
5
|
import AnnotationEdit from '../../../../../packages/annotation-edit';
|
|
6
|
-
import { InjectionAnnotation } from '../../../../../packages/form-render/src/constants';
|
|
6
|
+
import { InjectionAnnotation, InjectionFormUUID } from '../../../../../packages/form-render/src/constants';
|
|
7
|
+
import { elementIdEscape } from '../../../../../packages/form-render/src/utils';
|
|
7
8
|
|
|
8
9
|
const script = defineComponent({
|
|
9
10
|
props: {
|
|
@@ -38,6 +39,11 @@ const script = defineComponent({
|
|
|
38
39
|
return annotation.value && props.annotation !== false;
|
|
39
40
|
});
|
|
40
41
|
const showLabel = computed(() => props.label && props.label !== " ");
|
|
42
|
+
const field = useField();
|
|
43
|
+
const uuid = inject(InjectionFormUUID);
|
|
44
|
+
const id = computed(() => {
|
|
45
|
+
return elementIdEscape(`${uuid}-${field.value.path.toString()}`);
|
|
46
|
+
});
|
|
41
47
|
function renderLabel() {
|
|
42
48
|
return showLabel.value ? createVNode("section", {
|
|
43
49
|
"class": "form-render__formItemLabel"
|
|
@@ -47,7 +53,9 @@ const script = defineComponent({
|
|
|
47
53
|
}]
|
|
48
54
|
}, [props.label]), showAnnotation.value ? renderAnnotation() : null]) : null;
|
|
49
55
|
}
|
|
50
|
-
return () => createVNode(NFormItem,
|
|
56
|
+
return () => createVNode(NFormItem, {
|
|
57
|
+
id: id.value
|
|
58
|
+
}, {
|
|
51
59
|
...slots,
|
|
52
60
|
label: renderLabel
|
|
53
61
|
});
|
|
@@ -7,7 +7,8 @@ export { LINEBAR } from './linebar.js';
|
|
|
7
7
|
export { INPUT_GROUP } from './inputGroup.js';
|
|
8
8
|
export { DATE } from './date.js';
|
|
9
9
|
export { SEARCH_CASCADE } from './cascader.js';
|
|
10
|
-
export {
|
|
10
|
+
export { JSON_COMBINATION } from './jsonCombination/index.js';
|
|
11
|
+
export { COMBINATION } from './combination.js';
|
|
11
12
|
export { CHECKBOX } from './checkbox.js';
|
|
12
13
|
export { SWITCH } from './switch.js';
|
|
13
14
|
export { RADIO } from './radio.js';
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { FieldItem } from '../../../../../../../es/packages/form-render';
|
|
2
|
+
import { PropType } from 'vue';
|
|
3
|
+
export declare const JSON_COMBINATION: import("vue").DefineComponent<{
|
|
4
|
+
title: {
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
value: {
|
|
9
|
+
type: (ArrayConstructor | StringConstructor)[];
|
|
10
|
+
};
|
|
11
|
+
maxGroupNum: {
|
|
12
|
+
type: NumberConstructor;
|
|
13
|
+
};
|
|
14
|
+
getProperties: {
|
|
15
|
+
type: PropType<() => FieldItem[]>;
|
|
16
|
+
default: () => never[];
|
|
17
|
+
};
|
|
18
|
+
onInput: {};
|
|
19
|
+
onBlur: {};
|
|
20
|
+
onChange: {};
|
|
21
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
22
|
+
title: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
26
|
+
value: {
|
|
27
|
+
type: (ArrayConstructor | StringConstructor)[];
|
|
28
|
+
};
|
|
29
|
+
maxGroupNum: {
|
|
30
|
+
type: NumberConstructor;
|
|
31
|
+
};
|
|
32
|
+
getProperties: {
|
|
33
|
+
type: PropType<() => FieldItem[]>;
|
|
34
|
+
default: () => never[];
|
|
35
|
+
};
|
|
36
|
+
onInput: {};
|
|
37
|
+
onBlur: {};
|
|
38
|
+
onChange: {};
|
|
39
|
+
}>> & {
|
|
40
|
+
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
41
|
+
}, {
|
|
42
|
+
title: string;
|
|
43
|
+
getProperties: () => FieldItem[];
|
|
44
|
+
}>;
|
package/es/packages/form-render/src/components/renderer/{combination → jsonCombination}/index.js
RENAMED
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, watch, onMounted, createVNode
|
|
1
|
+
import { defineComponent, ref, computed, watch, onMounted, createVNode } from 'vue';
|
|
2
2
|
import { isField } from '@formily/core';
|
|
3
3
|
import { Path } from '@formily/path';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { AddCircleOutline, RemoveCircle } from '@vicons/ionicons5';
|
|
5
|
+
import { isNumber, isArray, isEqual } from 'lodash-es';
|
|
6
|
+
import { useDeepValidate } from '../../../../../../packages/form-render/src/components/renderer/jsonCombination/hooks/useDeepValidate';
|
|
7
|
+
import { formRenderLog, mergeDeepProperties } from '../../../utils/index.js';
|
|
7
8
|
import { connect, mapProps } from '@formily/vue';
|
|
8
9
|
import { useDebounceFn, isObject } from '@vueuse/core';
|
|
9
|
-
import { NButton } from 'naive-ui';
|
|
10
|
+
import { NButton, NIcon } from 'naive-ui';
|
|
10
11
|
import FormRender from '../../../FormRender.js';
|
|
11
12
|
import { assignUpdateValue } from '../../../utils/schema.js';
|
|
12
13
|
|
|
13
14
|
const script = defineComponent({
|
|
14
|
-
name: "
|
|
15
|
+
name: "FormJsonCombination",
|
|
15
16
|
props: {
|
|
16
17
|
title: {
|
|
17
18
|
type: String,
|
|
18
19
|
default: ""
|
|
19
20
|
},
|
|
20
21
|
value: {
|
|
21
|
-
type: String
|
|
22
|
+
type: [String, Array]
|
|
22
23
|
},
|
|
23
24
|
maxGroupNum: {
|
|
24
25
|
type: Number
|
|
@@ -35,12 +36,18 @@ const script = defineComponent({
|
|
|
35
36
|
setup(props, {
|
|
36
37
|
emit
|
|
37
38
|
}) {
|
|
39
|
+
formRenderLog("\u5F53\u524DCOMBINATION\u63A7\u4EF6\u4E3Ajson\u6A21\u5F0F,\u63A8\u8350\u4F7F\u7528\u975Ejson\u6A21\u5F0F,FieldItem.jsonCombination=false", "warn");
|
|
38
40
|
const emitChange = useDebounceFn(function emitChange2() {
|
|
39
41
|
emit("update:value", JSON.stringify(combinationData.value));
|
|
40
42
|
}, 300);
|
|
41
43
|
const combinationData = ref([]);
|
|
42
44
|
const currentGroupNum = computed(() => combinationData.value.length);
|
|
43
45
|
function setCombinationData(data, withInitialData = false) {
|
|
46
|
+
if (isArray(data)) {
|
|
47
|
+
if (!data.length)
|
|
48
|
+
data.push({});
|
|
49
|
+
data = JSON.stringify(data);
|
|
50
|
+
}
|
|
44
51
|
const parsedData = getParsedData(data);
|
|
45
52
|
if (!needLoad(parsedData))
|
|
46
53
|
return;
|
|
@@ -66,7 +73,6 @@ const script = defineComponent({
|
|
|
66
73
|
return null;
|
|
67
74
|
return result;
|
|
68
75
|
} catch (e) {
|
|
69
|
-
formRenderLog(`invalid JSON value ${data2} in COMBINATION => ${props.title}`, "warn");
|
|
70
76
|
return null;
|
|
71
77
|
}
|
|
72
78
|
}
|
|
@@ -137,22 +143,31 @@ const script = defineComponent({
|
|
|
137
143
|
"text": true,
|
|
138
144
|
"disabled": currentGroupNum.value >= maxGroupNum.value
|
|
139
145
|
}, {
|
|
140
|
-
|
|
146
|
+
icon: () => createVNode(NIcon, {
|
|
147
|
+
"component": AddCircleOutline
|
|
148
|
+
}, null),
|
|
149
|
+
default: () => "\u65B0\u589E"
|
|
141
150
|
})]), Array.from({
|
|
142
151
|
length: currentGroupNum.value
|
|
143
152
|
}).map((_, idx) => createVNode("section", {
|
|
144
|
-
"class": "form-
|
|
153
|
+
"class": "form-render__combinationContentJson"
|
|
145
154
|
}, [createVNode(FormRenderComponent, {
|
|
146
155
|
"ref": (_ref) => setFormRenderRef(idx, _ref),
|
|
147
156
|
"fieldList": props.getProperties(),
|
|
148
157
|
"onFormChange": (payload) => onChange(idx, payload)
|
|
149
|
-
}, null), idx === 0 ? null : createVNode(
|
|
158
|
+
}, null), idx === 0 ? null : createVNode(NButton, {
|
|
159
|
+
"text": true,
|
|
150
160
|
"class": "form-render__combinationClose",
|
|
161
|
+
"type": "error",
|
|
151
162
|
"onClick": () => removeGroup(idx)
|
|
152
|
-
},
|
|
163
|
+
}, {
|
|
164
|
+
icon: () => createVNode(NIcon, {
|
|
165
|
+
"component": RemoveCircle
|
|
166
|
+
}, null)
|
|
167
|
+
})]))]);
|
|
153
168
|
};
|
|
154
169
|
}
|
|
155
170
|
});
|
|
156
|
-
const
|
|
171
|
+
const JSON_COMBINATION = connect(script, mapProps(assignUpdateValue));
|
|
157
172
|
|
|
158
|
-
export {
|
|
173
|
+
export { JSON_COMBINATION };
|
|
@@ -9,6 +9,5 @@ export { useFormValidator } from './useFormValidator.js';
|
|
|
9
9
|
export { BusinessCollector, useBusinessBinding } from './useBusinessBinding.js';
|
|
10
10
|
export { ContextCollector, useChangeContext } from './useChangeContext.js';
|
|
11
11
|
export { FormItemDepsCollector, useFormItemDeps } from './useFormItemDeps.js';
|
|
12
|
-
export { useInitialData } from './useInitialData.js';
|
|
13
12
|
export { useAnchor } from './useAnchor.js';
|
|
14
13
|
export { useFormContext } from './useFormContext.js';
|
|
@@ -3,7 +3,7 @@ import { FieldItem } from '../types';
|
|
|
3
3
|
/**
|
|
4
4
|
* @description 胶水层, 将低代码平台中的fieldList转换为JSONSchema
|
|
5
5
|
*/
|
|
6
|
-
export declare function useFieldListAdaptor(collector: BusinessCollector
|
|
6
|
+
export declare function useFieldListAdaptor(collector: BusinessCollector): {
|
|
7
7
|
schemaAdaptor: (fieldList: FieldItem[]) => Record<string, import("@formily/json-schema/esm/types").Stringify<{
|
|
8
8
|
[key: symbol]: any;
|
|
9
9
|
[key: `x-${string}`]: any;
|
|
@@ -2,10 +2,10 @@ import { isObject } from '@vueuse/core';
|
|
|
2
2
|
import { pick } from 'lodash-es';
|
|
3
3
|
import { useFormValidator, useTypeNormalize } from '../../../../packages/form-render';
|
|
4
4
|
import { arrayed, parseNumberFromMaybeString, formRenderLog } from '../utils/index.js';
|
|
5
|
-
import { fieldKeyEscape, createLinebarId
|
|
5
|
+
import { fieldKeyEscape, createLinebarId } from '../utils/schema.js';
|
|
6
6
|
import { transformDateFormat } from '../utils/business.js';
|
|
7
7
|
|
|
8
|
-
function useFieldListAdaptor(collector
|
|
8
|
+
function useFieldListAdaptor(collector) {
|
|
9
9
|
const { createValidatorSchema } = useFormValidator();
|
|
10
10
|
const createStandardSchema = (item) => {
|
|
11
11
|
var _a;
|
|
@@ -14,6 +14,7 @@ function useFieldListAdaptor(collector, uuid) {
|
|
|
14
14
|
type: (_a = item.fieldType) != null ? _a : "string",
|
|
15
15
|
title: item.alias || item.name,
|
|
16
16
|
"x-component": item.html_type,
|
|
17
|
+
default: item.default_val,
|
|
17
18
|
"x-component-props": {
|
|
18
19
|
placeholder: item.placeholder,
|
|
19
20
|
clearable: item.is_empty === "0",
|
|
@@ -38,7 +39,6 @@ function useFieldListAdaptor(collector, uuid) {
|
|
|
38
39
|
showLabel: item.hide_title !== "1",
|
|
39
40
|
propertyKey: item.val_key,
|
|
40
41
|
annotation: item.annotation,
|
|
41
|
-
id: elementIdEscape(`${uuid}-${item.val_key}`),
|
|
42
42
|
...item.decoratorProps || {}
|
|
43
43
|
}
|
|
44
44
|
});
|
|
@@ -102,6 +102,10 @@ function useFieldListAdaptor(collector, uuid) {
|
|
|
102
102
|
};
|
|
103
103
|
const createCombinationSchema = (item) => {
|
|
104
104
|
const schema = createStandardSchema(item);
|
|
105
|
+
schema.type = "array";
|
|
106
|
+
if (item.jsonCombination !== false) {
|
|
107
|
+
schema["x-component"] = "JSON_COMBINATION";
|
|
108
|
+
}
|
|
105
109
|
Object.assign(schema["x-decorator-props"], {
|
|
106
110
|
showLabel: false,
|
|
107
111
|
showFeedback: false
|
|
@@ -25,7 +25,7 @@ export declare type FormAsyncQueue = AsyncQueue<FormAsyncQueueItem, any, AnyObje
|
|
|
25
25
|
export declare type AgeContext = Record<'age' | 'day' | 'month' | 'year', number>;
|
|
26
26
|
export declare type IdCardParseInfo = Record<'sex' | 'birthday', string> & AgeContext;
|
|
27
27
|
export declare type FormRenderExpose = {
|
|
28
|
-
validate(path?: string): Promise<
|
|
28
|
+
validate(path?: string): Promise<unknown>;
|
|
29
29
|
getFormValues(): AnyObject;
|
|
30
30
|
setFieldState(path: string, setter: (field: Field) => void): void;
|
|
31
31
|
resetFields(path?: string): void;
|
|
@@ -43,7 +43,7 @@ export declare type FormChangePayload = {
|
|
|
43
43
|
fieldKey: string;
|
|
44
44
|
fieldName: string;
|
|
45
45
|
fieldInstance: DataField;
|
|
46
|
-
context
|
|
46
|
+
context?: FormChangeContext;
|
|
47
47
|
};
|
|
48
48
|
export declare type DependKeyType = string | Record<string, string> | Array<{
|
|
49
49
|
paramName: string;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { inject, provide, computed, createVNode, Fragment } from 'vue';
|
|
2
|
+
import { Path } from '@formily/path';
|
|
2
3
|
import { isObject } from '@vue/shared';
|
|
3
4
|
import { isNumber, isString, isFunction } from 'lodash-es';
|
|
4
5
|
export { isIdCard, isMobile, parseAge2Birthday, parseAge2FromContext, parseBirthday, parseIdCard, transformDateFormat } from './business.js';
|
|
5
6
|
export { queryDecorator, queryInput } from './dom.js';
|
|
6
|
-
export { assignUpdateValue, createLinebarId, elementIdEscape, fieldKeyEscape, getParentLinebar, traverseDependKey, traverseFieldList, traverseSchema } from './schema.js';
|
|
7
|
+
export { assignUpdateValue, createLinebarId, createObjSchema, elementIdEscape, fieldKeyEscape, getParentLinebar, traverseDependKey, traverseFieldList, traverseSchema } from './schema.js';
|
|
7
8
|
|
|
8
9
|
function formRenderLog(message, type = "log") {
|
|
9
10
|
console[type](`[FormRender]: ${message}`);
|
|
@@ -19,7 +20,7 @@ function mergeDeepProperties(target, fieldList, traverseProperties = ["children"
|
|
|
19
20
|
if (!isObject(field))
|
|
20
21
|
return;
|
|
21
22
|
if (targetPropertyFor(field) != null && _target[propertyFor(field)] == null) {
|
|
22
|
-
_target
|
|
23
|
+
Path.setIn(_target, propertyFor(field), targetPropertyFor(field));
|
|
23
24
|
}
|
|
24
25
|
traverseProperties.forEach((p) => {
|
|
25
26
|
if (!field[p])
|
|
@@ -14,3 +14,63 @@ export declare function assignUpdateValue(props: AnyObject, field: GeneralField)
|
|
|
14
14
|
[x: string]: any;
|
|
15
15
|
};
|
|
16
16
|
export declare function traverseFieldList(fieldList: FieldItem[], handler: (field: FieldItem) => void): void;
|
|
17
|
+
export declare function createObjSchema(properties: Record<string, ISchema>): {
|
|
18
|
+
type: string;
|
|
19
|
+
properties: Record<string, import("@formily/json-schema/esm/types").Stringify<{
|
|
20
|
+
[key: symbol]: any;
|
|
21
|
+
[key: `x-${string}`]: any;
|
|
22
|
+
[key: `x-${number}`]: any;
|
|
23
|
+
version?: string | undefined;
|
|
24
|
+
name?: import("@formily/json-schema/esm/types").SchemaKey | undefined;
|
|
25
|
+
title?: any;
|
|
26
|
+
description?: any;
|
|
27
|
+
default?: any;
|
|
28
|
+
readOnly?: boolean | undefined;
|
|
29
|
+
writeOnly?: boolean | undefined;
|
|
30
|
+
type?: import("@formily/json-schema/esm/types").SchemaTypes | undefined;
|
|
31
|
+
enum?: import("@formily/json-schema/esm/types").SchemaEnum<any> | undefined;
|
|
32
|
+
const?: any;
|
|
33
|
+
multipleOf?: number | undefined;
|
|
34
|
+
maximum?: number | undefined;
|
|
35
|
+
exclusiveMaximum?: number | undefined;
|
|
36
|
+
minimum?: number | undefined;
|
|
37
|
+
exclusiveMinimum?: number | undefined;
|
|
38
|
+
maxLength?: number | undefined;
|
|
39
|
+
minLength?: number | undefined;
|
|
40
|
+
pattern?: string | RegExp | undefined;
|
|
41
|
+
maxItems?: number | undefined;
|
|
42
|
+
minItems?: number | undefined;
|
|
43
|
+
uniqueItems?: boolean | undefined;
|
|
44
|
+
maxProperties?: number | undefined;
|
|
45
|
+
minProperties?: number | undefined;
|
|
46
|
+
required?: string | boolean | string[] | undefined;
|
|
47
|
+
format?: string | undefined;
|
|
48
|
+
$ref?: string | undefined;
|
|
49
|
+
$namespace?: string | undefined;
|
|
50
|
+
definitions?: import("@formily/json-schema/esm/types").SchemaProperties<any, any, any, any, any, any, any, any> | undefined;
|
|
51
|
+
properties?: import("@formily/json-schema/esm/types").SchemaProperties<any, any, any, any, any, any, any, any> | undefined;
|
|
52
|
+
items?: import("@formily/json-schema/esm/types").SchemaItems<any, any, any, any, any, any, any, any> | undefined;
|
|
53
|
+
additionalItems?: import("@formily/json-schema/esm/types").Stringify<any> | undefined;
|
|
54
|
+
patternProperties?: import("@formily/json-schema/esm/types").SchemaProperties<any, any, any, any, any, any, any, any> | undefined;
|
|
55
|
+
additionalProperties?: import("@formily/json-schema/esm/types").Stringify<any> | undefined;
|
|
56
|
+
"x-value"?: any;
|
|
57
|
+
"x-index"?: number | undefined;
|
|
58
|
+
"x-pattern"?: any;
|
|
59
|
+
"x-display"?: any;
|
|
60
|
+
"x-validator"?: any;
|
|
61
|
+
"x-decorator"?: any;
|
|
62
|
+
"x-decorator-props"?: any;
|
|
63
|
+
"x-component"?: any;
|
|
64
|
+
"x-component-props"?: any;
|
|
65
|
+
"x-reactions"?: import("@formily/json-schema/esm/types").SchemaReactions<any> | undefined;
|
|
66
|
+
"x-content"?: any;
|
|
67
|
+
"x-data"?: any;
|
|
68
|
+
"x-visible"?: boolean | undefined;
|
|
69
|
+
"x-hidden"?: boolean | undefined;
|
|
70
|
+
"x-disabled"?: boolean | undefined;
|
|
71
|
+
"x-editable"?: boolean | undefined;
|
|
72
|
+
"x-read-only"?: boolean | undefined;
|
|
73
|
+
"x-read-pretty"?: boolean | undefined;
|
|
74
|
+
"x-compile-omitted"?: string[] | undefined;
|
|
75
|
+
}>>;
|
|
76
|
+
};
|
|
@@ -14,7 +14,7 @@ function fieldKeyEscape(fieldList) {
|
|
|
14
14
|
return fieldList.map((f) => f.val_key).join("-").replace(/[.]/g, "_");
|
|
15
15
|
}
|
|
16
16
|
function elementIdEscape(id) {
|
|
17
|
-
return id.replace(
|
|
17
|
+
return id.replace(/[.]/g, "-");
|
|
18
18
|
}
|
|
19
19
|
function createLinebarId(id) {
|
|
20
20
|
return elementIdEscape(`id-${id}`);
|
|
@@ -90,5 +90,8 @@ function traverseFieldList(fieldList, handler) {
|
|
|
90
90
|
}
|
|
91
91
|
traverse(fieldList);
|
|
92
92
|
}
|
|
93
|
+
function createObjSchema(properties) {
|
|
94
|
+
return { type: "object", properties };
|
|
95
|
+
}
|
|
93
96
|
|
|
94
|
-
export { assignUpdateValue, createLinebarId, elementIdEscape, fieldKeyEscape, getParentLinebar, traverseDependKey, traverseFieldList, traverseSchema };
|
|
97
|
+
export { assignUpdateValue, createLinebarId, createObjSchema, elementIdEscape, fieldKeyEscape, getParentLinebar, traverseDependKey, traverseFieldList, traverseSchema };
|
|
@@ -105,6 +105,10 @@
|
|
|
105
105
|
padding: 0;
|
|
106
106
|
margin: 0;
|
|
107
107
|
}
|
|
108
|
+
.form-render__combinationHeader .n-button__icon {
|
|
109
|
+
font-size: 14px;
|
|
110
|
+
margin: 0 2px 0 0;
|
|
111
|
+
}
|
|
108
112
|
.form-render__combinationHeaderText {
|
|
109
113
|
font-size: 16px;
|
|
110
114
|
font-weight: 500;
|
|
@@ -115,18 +119,17 @@
|
|
|
115
119
|
top: 5px;
|
|
116
120
|
width: 14px;
|
|
117
121
|
height: 14px;
|
|
118
|
-
border-radius: 50%;
|
|
119
|
-
background: red;
|
|
120
|
-
cursor: pointer;
|
|
121
|
-
display: inline-flex;
|
|
122
|
-
align-items: center;
|
|
123
|
-
justify-content: center;
|
|
124
|
-
color: white;
|
|
125
|
-
vertical-align: middle;
|
|
126
122
|
font-size: 16px;
|
|
127
123
|
}
|
|
124
|
+
.form-render__combinationContentJson {
|
|
125
|
+
position: relative;
|
|
126
|
+
}
|
|
128
127
|
.form-render__combinationContent {
|
|
129
128
|
position: relative;
|
|
129
|
+
display: grid !important;
|
|
130
|
+
grid-template-columns: repeat(var(--column), minmax(0px, 1fr));
|
|
131
|
+
align-items: start;
|
|
132
|
+
gap: 0 16px;
|
|
130
133
|
}
|
|
131
134
|
.form-render__complex {
|
|
132
135
|
width: 100%;
|
package/es/packages/index.css
CHANGED
|
@@ -2926,6 +2926,10 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
2926
2926
|
padding: 0;
|
|
2927
2927
|
margin: 0;
|
|
2928
2928
|
}
|
|
2929
|
+
.form-render__combinationHeader .n-button__icon {
|
|
2930
|
+
font-size: 14px;
|
|
2931
|
+
margin: 0 2px 0 0;
|
|
2932
|
+
}
|
|
2929
2933
|
.form-render__combinationHeaderText {
|
|
2930
2934
|
font-size: 16px;
|
|
2931
2935
|
font-weight: 500;
|
|
@@ -2936,18 +2940,17 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
2936
2940
|
top: 5px;
|
|
2937
2941
|
width: 14px;
|
|
2938
2942
|
height: 14px;
|
|
2939
|
-
border-radius: 50%;
|
|
2940
|
-
background: red;
|
|
2941
|
-
cursor: pointer;
|
|
2942
|
-
display: inline-flex;
|
|
2943
|
-
align-items: center;
|
|
2944
|
-
justify-content: center;
|
|
2945
|
-
color: white;
|
|
2946
|
-
vertical-align: middle;
|
|
2947
2943
|
font-size: 16px;
|
|
2948
2944
|
}
|
|
2945
|
+
.form-render__combinationContentJson {
|
|
2946
|
+
position: relative;
|
|
2947
|
+
}
|
|
2949
2948
|
.form-render__combinationContent {
|
|
2950
2949
|
position: relative;
|
|
2950
|
+
display: grid !important;
|
|
2951
|
+
grid-template-columns: repeat(var(--column), minmax(0px, 1fr));
|
|
2952
|
+
align-items: start;
|
|
2953
|
+
gap: 0 16px;
|
|
2951
2954
|
}
|
|
2952
2955
|
.form-render__complex {
|
|
2953
2956
|
width: 100%;
|
|
@@ -3248,7 +3251,7 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
3248
3251
|
padding: 16px;
|
|
3249
3252
|
box-sizing: border-box;
|
|
3250
3253
|
flex-shrink: 0;
|
|
3251
|
-
width:
|
|
3254
|
+
width: 240px;
|
|
3252
3255
|
background: white;
|
|
3253
3256
|
}
|
|
3254
3257
|
.form-config__configHeader {
|
package/es/packages/index.js
CHANGED
|
@@ -51,7 +51,6 @@ export { useFormValidator } from './form-render/src/hooks/useFormValidator.js';
|
|
|
51
51
|
export { BusinessCollector, useBusinessBinding } from './form-render/src/hooks/useBusinessBinding.js';
|
|
52
52
|
export { ContextCollector, useChangeContext } from './form-render/src/hooks/useChangeContext.js';
|
|
53
53
|
export { FormItemDepsCollector, useFormItemDeps } from './form-render/src/hooks/useFormItemDeps.js';
|
|
54
|
-
export { useInitialData } from './form-render/src/hooks/useInitialData.js';
|
|
55
54
|
export { useAnchor } from './form-render/src/hooks/useAnchor.js';
|
|
56
55
|
export { useFormContext } from './form-render/src/hooks/useFormContext.js';
|
|
57
56
|
export { GlobalShortcutProvider, ShortcutManager, useShortcuts } from './shortcut-provider/src/hooks/useShortcuts.js';
|
|
@@ -88,6 +88,7 @@ class ShortcutManager {
|
|
|
88
88
|
const callback = this.shortcutCallbackMap.get(keySignature);
|
|
89
89
|
if (!callback)
|
|
90
90
|
return;
|
|
91
|
+
event.preventDefault();
|
|
91
92
|
const shortcutItem = Object.values(this.shortcutCache.value).find((item) => item.currentKeySignature === keySignature);
|
|
92
93
|
if (!shortcutItem || shortcutItem.status !== ShortcutStatus.ACTIVE || shortcutItem.disabled)
|
|
93
94
|
return;
|
|
@@ -122,6 +122,7 @@ declare const ShortcutSetter: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
122
122
|
content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
|
|
123
123
|
lazyRequest?: boolean | undefined;
|
|
124
124
|
maxGroupNum?: number | undefined;
|
|
125
|
+
jsonCombination?: boolean | undefined;
|
|
125
126
|
children?: any[] | undefined;
|
|
126
127
|
properties?: any[] | undefined;
|
|
127
128
|
componentProps?: import("../../../es/src/types").AnyObject | undefined;
|
|
@@ -1931,7 +1932,9 @@ declare const ShortcutSetter: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1931
1932
|
}>>;
|
|
1932
1933
|
emit: (event: "formChange", ...args: any[]) => void;
|
|
1933
1934
|
nuiThemeOverrides: import("naive-ui").GlobalThemeOverrides;
|
|
1934
|
-
formModel: import("@formily/core").Form<
|
|
1935
|
+
formModel: import("@formily/core").Form<{
|
|
1936
|
+
[x: string]: any;
|
|
1937
|
+
}>;
|
|
1935
1938
|
SchemaField: import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>;
|
|
1936
1939
|
businessCollector: import("..").BusinessCollector;
|
|
1937
1940
|
formItemDepsCollector: import("..").FormItemDepsCollector;
|
|
@@ -124,6 +124,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
124
124
|
content?: string | import("../../../../es/packages/form-render").FormRenderer | Record<string, import("../../../../es/packages/form-render").FormRenderer> | undefined;
|
|
125
125
|
lazyRequest?: boolean | undefined;
|
|
126
126
|
maxGroupNum?: number | undefined;
|
|
127
|
+
jsonCombination?: boolean | undefined;
|
|
127
128
|
children?: any[] | undefined;
|
|
128
129
|
properties?: any[] | undefined;
|
|
129
130
|
componentProps?: import("../../../../es/src/types").AnyObject | undefined;
|
|
@@ -1933,7 +1934,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1933
1934
|
}>>;
|
|
1934
1935
|
emit: (event: "formChange", ...args: any[]) => void;
|
|
1935
1936
|
nuiThemeOverrides: import("naive-ui").GlobalThemeOverrides;
|
|
1936
|
-
formModel: import("@formily/core").Form<
|
|
1937
|
+
formModel: import("@formily/core").Form<{
|
|
1938
|
+
[x: string]: any;
|
|
1939
|
+
}>;
|
|
1937
1940
|
SchemaField: Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>;
|
|
1938
1941
|
businessCollector: import("../../../../es/packages/form-render").BusinessCollector;
|
|
1939
1942
|
formItemDepsCollector: import("../../../../es/packages/form-render").FormItemDepsCollector;
|
package/es/src/utils/index.d.ts
CHANGED
package/es/src/utils/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { isString } from 'lodash-es';
|
|
2
|
+
|
|
1
3
|
function safeComponentRegister(app, component, cName = component.name, scheduler) {
|
|
2
4
|
if (!cName)
|
|
3
5
|
throw new Error(`[CUI]: invalid component name for ${component}`);
|
|
@@ -11,5 +13,13 @@ function safeComponentRegister(app, component, cName = component.name, scheduler
|
|
|
11
13
|
app.component(cName, component);
|
|
12
14
|
}
|
|
13
15
|
}
|
|
16
|
+
function generateTimeFormat(format) {
|
|
17
|
+
if (!isString(format))
|
|
18
|
+
return;
|
|
19
|
+
const matched = format.match(/[Hms:]+/);
|
|
20
|
+
if (!matched)
|
|
21
|
+
return;
|
|
22
|
+
return matched[0];
|
|
23
|
+
}
|
|
14
24
|
|
|
15
|
-
export { safeComponentRegister };
|
|
25
|
+
export { generateTimeFormat, safeComponentRegister };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cnhis-design-vue",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "3.1.16
|
|
4
|
+
"version": "3.1.16",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"module": "es/packages/index.js",
|
|
7
7
|
"main": "es/packages/index.js",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"vue": "^3.2.0"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@formily/core": "
|
|
35
|
-
"@formily/path": "
|
|
36
|
-
"@formily/vue": "
|
|
34
|
+
"@formily/core": "2.1.9",
|
|
35
|
+
"@formily/path": "2.1.9",
|
|
36
|
+
"@formily/vue": "2.1.9",
|
|
37
37
|
"@highlightjs/vue-plugin": "^2.1.0",
|
|
38
38
|
"@vicons/ionicons5": "^0.12.0",
|
|
39
39
|
"@vueuse/core": "^8.6.0",
|