cnhis-design-vue 3.1.14-beta.14 → 3.1.14-beta.17
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/node_modules/@formily/path/esm/contexts.js +22 -0
- package/es/node_modules/@formily/path/esm/destructor.js +124 -0
- package/es/node_modules/@formily/path/esm/index.js +579 -0
- package/es/node_modules/@formily/path/esm/matcher.js +199 -0
- package/es/node_modules/@formily/path/esm/parser.js +402 -0
- package/es/node_modules/@formily/path/esm/shared.js +73 -0
- package/es/node_modules/@formily/path/esm/tokenizer.js +287 -0
- package/es/node_modules/@formily/path/esm/tokens.js +240 -0
- package/es/node_modules/@formily/path/esm/types.js +17 -0
- package/es/packages/big-table/index.d.ts +13 -0
- package/es/packages/big-table/src/BigTable.vue.d.ts +18 -12
- package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +7 -4
- package/es/packages/big-table/src/bigTableProps.d.ts +4 -0
- package/es/packages/big-table/src/bigTableProps.js +1 -0
- package/es/packages/big-table/src/components/edit-form/edit-date.js +11 -3
- package/es/packages/big-table/src/components/edit-form/edit-input.js +15 -4
- package/es/packages/big-table/src/components/edit-form/edit-time.d.ts +43 -0
- package/es/packages/big-table/src/components/edit-form/edit-time.js +52 -0
- package/es/packages/big-table/src/hooks/useColumnConfigAdaptor.js +51 -12
- package/es/packages/big-table/src/hooks/useEdit.d.ts +42 -0
- package/es/packages/big-table/src/hooks/useEdit.js +2 -0
- package/es/packages/big-table/src/hooks/useFormat.js +8 -1
- package/es/packages/big-table/src/utils.js +1 -0
- package/es/packages/big-table/style/index.css +11 -0
- package/es/packages/button-print/src/utils/print.d.ts +1 -1
- package/es/packages/button-print/src/utils/print.js +4 -4
- package/es/packages/form-render/index.d.ts +0 -1
- package/es/packages/form-render/src/FormRender.js +2 -2
- package/es/packages/form-render/src/FormRender.vue.d.ts +0 -1
- package/es/packages/form-render/src/components/renderer/cascader.d.ts +4 -4
- package/es/packages/form-render/src/components/renderer/cascader.js +44 -45
- package/es/packages/form-render/src/components/renderer/combination.d.ts +6 -0
- package/es/packages/form-render/src/components/renderer/combination.js +53 -16
- package/es/packages/form-render/src/components/renderer/formItem.js +1 -1
- package/es/packages/form-render/src/components/renderer/radio.d.ts +12 -4
- package/es/packages/form-render/src/components/renderer/radio.js +23 -5
- package/es/packages/form-render/src/components/renderer/select.js +46 -52
- package/es/packages/form-render/src/components/renderer/simpleComponent.d.ts +4 -2
- package/es/packages/form-render/src/components/renderer/simpleComponent.js +4 -3
- package/es/packages/form-render/src/hooks/useAsyncQueue.d.ts +1 -1
- package/es/packages/form-render/src/hooks/useChangeContext.d.ts +1 -1
- package/es/packages/form-render/src/hooks/useChangeContext.js +1 -1
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +3 -2
- package/es/packages/form-render/src/hooks/useFormItemDeps.d.ts +4 -3
- package/es/packages/form-render/src/hooks/useFormRequest.d.ts +2 -2
- package/es/packages/form-render/src/types/fieldItem.d.ts +123 -35
- package/es/packages/form-render/src/types/index.d.ts +4 -2
- package/es/packages/form-render/src/utils/index.d.ts +3 -6
- package/es/packages/index.css +14 -0
- package/es/packages/info-header/style/index.css +3 -0
- package/es/packages/shortcut-provider/src/types/index.d.ts +11 -9
- package/es/packages/shortcut-provider/src/utils/index.js +5 -5
- package/es/packages/shortcut-setter/index.d.ts +3247 -1486
- package/es/packages/shortcut-setter/src/ShortcutSetter.js +9 -5
- package/es/packages/shortcut-setter/src/ShortcutSetter.vue.d.ts +3247 -1486
- package/es/packages/shortcut-setter/src/ShortcutSetterItem.js +24 -11
- package/es/packages/shortcut-setter/src/ShortcutSetterItem.vue.d.ts +1700 -1661
- package/es/src/utils/anime.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { defineComponent, ref, createVNode, createTextVNode
|
|
1
|
+
import { defineComponent, ref, computed, watch, onMounted, createVNode, createTextVNode } from 'vue';
|
|
2
|
+
import { isField } from '@formily/core';
|
|
3
|
+
import { Path } from '../../../../../node_modules/@formily/path/esm/index.js';
|
|
4
|
+
import { isNumber } from 'lodash-es';
|
|
2
5
|
import { assignUpdateValue, formRenderLog } from '../../utils/index.js';
|
|
3
6
|
import { connect, mapProps } from '@formily/vue';
|
|
4
7
|
import { useDebounceFn, isObject } from '@vueuse/core';
|
|
@@ -15,6 +18,9 @@ const script = defineComponent({
|
|
|
15
18
|
value: {
|
|
16
19
|
type: String
|
|
17
20
|
},
|
|
21
|
+
maxGroupNum: {
|
|
22
|
+
type: Number
|
|
23
|
+
},
|
|
18
24
|
getProperties: {
|
|
19
25
|
type: Function,
|
|
20
26
|
default: () => []
|
|
@@ -27,17 +33,34 @@ const script = defineComponent({
|
|
|
27
33
|
const emitChange = useDebounceFn(function emitChange2() {
|
|
28
34
|
emit("update:value", JSON.stringify(_values.value));
|
|
29
35
|
}, 300);
|
|
30
|
-
const
|
|
36
|
+
const formRenderRefs = ref([]);
|
|
37
|
+
const groupNum = ref(1);
|
|
38
|
+
const maxGroupNum = computed(() => {
|
|
39
|
+
if (!isNumber(props.maxGroupNum))
|
|
40
|
+
return Infinity;
|
|
41
|
+
if (props.maxGroupNum < 1)
|
|
42
|
+
return 0;
|
|
43
|
+
return ~~props.maxGroupNum;
|
|
44
|
+
});
|
|
31
45
|
function add() {
|
|
32
|
-
|
|
46
|
+
groupNum.value++;
|
|
33
47
|
_values.value.push({});
|
|
34
48
|
emitChange();
|
|
35
49
|
}
|
|
36
50
|
function remove(idx) {
|
|
37
|
-
|
|
51
|
+
groupNum.value--;
|
|
38
52
|
_values.value.splice(idx, 1);
|
|
39
53
|
emitChange();
|
|
40
54
|
}
|
|
55
|
+
watch(maxGroupNum, (value) => {
|
|
56
|
+
if (groupNum.value <= value)
|
|
57
|
+
return;
|
|
58
|
+
groupNum.value = value;
|
|
59
|
+
_values.value.splice(groupNum.value);
|
|
60
|
+
emitChange();
|
|
61
|
+
}, {
|
|
62
|
+
immediate: true
|
|
63
|
+
});
|
|
41
64
|
const _values = ref([{}]);
|
|
42
65
|
function initValues(data) {
|
|
43
66
|
if (!data)
|
|
@@ -47,19 +70,32 @@ const script = defineComponent({
|
|
|
47
70
|
if (!Array.isArray(parsed))
|
|
48
71
|
throw new Error();
|
|
49
72
|
parsed.forEach((v, idx) => {
|
|
50
|
-
if (
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
_values.value[idx] =
|
|
54
|
-
|
|
55
|
-
}
|
|
73
|
+
if (idx > maxGroupNum.value - 1)
|
|
74
|
+
return;
|
|
75
|
+
if (isObject(v))
|
|
76
|
+
return _values.value[idx] = v;
|
|
77
|
+
_values.value[idx] = {};
|
|
78
|
+
formRenderLog(`invalid Object value ${v} in COMBINATION => ${props.title}[${idx}]`, "warn");
|
|
56
79
|
});
|
|
57
|
-
|
|
80
|
+
groupNum.value = Math.min(_values.value.length, maxGroupNum.value);
|
|
58
81
|
} catch (e) {
|
|
59
82
|
formRenderLog(`invalid JSON value ${data} in COMBINATION => ${props.title}`, "warn");
|
|
83
|
+
} finally {
|
|
84
|
+
setFormValueByInitValue();
|
|
85
|
+
}
|
|
86
|
+
function setFormValueByInitValue() {
|
|
87
|
+
_values.value.forEach((item, idx) => {
|
|
88
|
+
var _a;
|
|
89
|
+
(_a = formRenderRefs.value[idx]) == null ? void 0 : _a.setFieldState("*", (state) => {
|
|
90
|
+
if (!isField(state))
|
|
91
|
+
return;
|
|
92
|
+
state.value = Path.getIn(item, state.path);
|
|
93
|
+
});
|
|
94
|
+
});
|
|
60
95
|
}
|
|
61
96
|
}
|
|
62
|
-
|
|
97
|
+
watch(() => props.value, (value) => initValues(value));
|
|
98
|
+
onMounted(() => initValues(props.value));
|
|
63
99
|
function stop(event) {
|
|
64
100
|
event.stopPropagation();
|
|
65
101
|
}
|
|
@@ -68,7 +104,7 @@ const script = defineComponent({
|
|
|
68
104
|
value
|
|
69
105
|
}) {
|
|
70
106
|
!_values.value[idx] && (_values.value[idx] = {});
|
|
71
|
-
_values.value[idx]
|
|
107
|
+
Path.setIn(_values.value[idx], fieldKey, value);
|
|
72
108
|
emitChange();
|
|
73
109
|
}
|
|
74
110
|
const FormRenderComponent = FormRender;
|
|
@@ -82,16 +118,17 @@ const script = defineComponent({
|
|
|
82
118
|
}, [props.title]), createVNode(NButton, {
|
|
83
119
|
"onClick": add,
|
|
84
120
|
"type": "info",
|
|
85
|
-
"text": true
|
|
121
|
+
"text": true,
|
|
122
|
+
"disabled": groupNum.value >= maxGroupNum.value
|
|
86
123
|
}, {
|
|
87
124
|
default: () => [createTextVNode("\u65B0\u589E")]
|
|
88
125
|
})]), Array.from({
|
|
89
|
-
length:
|
|
126
|
+
length: groupNum.value
|
|
90
127
|
}).map((_, idx) => {
|
|
91
128
|
return createVNode("section", {
|
|
92
129
|
"class": "form-render__combinationContent"
|
|
93
130
|
}, [createVNode(FormRenderComponent, {
|
|
94
|
-
"
|
|
131
|
+
"ref": (_ref) => formRenderRefs.value[idx] = _ref,
|
|
95
132
|
"fieldList": props.getProperties(),
|
|
96
133
|
"onUpdateValue": () => false,
|
|
97
134
|
"onInput": stop,
|
|
@@ -60,7 +60,7 @@ const FORM_ITEM = connect(script, mapProps({
|
|
|
60
60
|
const feedback = !isVoidField(field) ? field.selfErrors.length ? field.selfErrors.join(",") : void 0 : void 0;
|
|
61
61
|
return {
|
|
62
62
|
...props,
|
|
63
|
-
required: field.required,
|
|
63
|
+
required: isVoidField(field) ? void 0 : field.required,
|
|
64
64
|
class: "form-render__formItem",
|
|
65
65
|
style: {
|
|
66
66
|
"--form-item-column": (_a = props.span) != null ? _a : 3
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { AnyObject } from '../../../../../../es/src/types';
|
|
2
2
|
import { PropType } from 'vue';
|
|
3
3
|
export declare const RADIO: import("vue").DefineComponent<{
|
|
4
|
-
value: {
|
|
4
|
+
value: {
|
|
5
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
6
|
+
};
|
|
5
7
|
options: {
|
|
6
8
|
type: PropType<AnyObject[]>;
|
|
7
9
|
default: () => never[];
|
|
@@ -10,8 +12,11 @@ export declare const RADIO: import("vue").DefineComponent<{
|
|
|
10
12
|
type: BooleanConstructor;
|
|
11
13
|
default: boolean;
|
|
12
14
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
onChange: {};
|
|
16
|
+
}, () => 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<{
|
|
17
|
+
value: {
|
|
18
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
19
|
+
};
|
|
15
20
|
options: {
|
|
16
21
|
type: PropType<AnyObject[]>;
|
|
17
22
|
default: () => never[];
|
|
@@ -20,7 +25,10 @@ export declare const RADIO: import("vue").DefineComponent<{
|
|
|
20
25
|
type: BooleanConstructor;
|
|
21
26
|
default: boolean;
|
|
22
27
|
};
|
|
23
|
-
|
|
28
|
+
onChange: {};
|
|
29
|
+
}>> & {
|
|
30
|
+
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
31
|
+
}, {
|
|
24
32
|
options: AnyObject[];
|
|
25
33
|
vertical: boolean;
|
|
26
34
|
}>;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { defineComponent, createVNode } from 'vue';
|
|
1
|
+
import { defineComponent, computed, createVNode } from 'vue';
|
|
2
2
|
import { connect, mapProps } from '@formily/vue';
|
|
3
3
|
import { NRadioGroup, NSpace, NRadio } from 'naive-ui';
|
|
4
4
|
import { assignUpdateValue } from '../../utils/index.js';
|
|
5
5
|
|
|
6
6
|
const script = defineComponent({
|
|
7
7
|
props: {
|
|
8
|
-
value: {
|
|
8
|
+
value: {
|
|
9
|
+
type: [String, Number]
|
|
10
|
+
},
|
|
9
11
|
options: {
|
|
10
12
|
type: Array,
|
|
11
13
|
default: () => []
|
|
@@ -13,12 +15,28 @@ const script = defineComponent({
|
|
|
13
15
|
vertical: {
|
|
14
16
|
type: Boolean,
|
|
15
17
|
default: false
|
|
16
|
-
}
|
|
18
|
+
},
|
|
19
|
+
onChange: {}
|
|
17
20
|
},
|
|
18
|
-
|
|
21
|
+
emits: ["update:value"],
|
|
22
|
+
setup(props, {
|
|
23
|
+
emit
|
|
24
|
+
}) {
|
|
25
|
+
function dangerousTypeTransform(value) {
|
|
26
|
+
return value + "";
|
|
27
|
+
}
|
|
28
|
+
const valueRef = computed({
|
|
29
|
+
get() {
|
|
30
|
+
return dangerousTypeTransform(props.value);
|
|
31
|
+
},
|
|
32
|
+
set(v) {
|
|
33
|
+
emit("update:value", v);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
19
36
|
return () => {
|
|
20
37
|
return createVNode(NRadioGroup, {
|
|
21
|
-
"value":
|
|
38
|
+
"value": valueRef.value,
|
|
39
|
+
"onUpdate:value": ($event) => valueRef.value = $event
|
|
22
40
|
}, {
|
|
23
41
|
default: () => [createVNode(NSpace, {
|
|
24
42
|
"vertical": props.vertical
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent, ref,
|
|
1
|
+
import { defineComponent, ref, computed, inject, watch, createVNode } from 'vue';
|
|
2
2
|
import { isField } from '@formily/core';
|
|
3
3
|
import { isEqual, cloneDeep } from 'lodash-es';
|
|
4
|
-
import { InjectAsyncQueue, InjectionFormItemDepsCollector
|
|
4
|
+
import { InjectionChangeContextCollector, InjectAsyncQueue, InjectionFormItemDepsCollector } from '../../constants/index.js';
|
|
5
5
|
import { assignUpdateValue, traverseDependKey } from '../../utils/index.js';
|
|
6
6
|
import { connect, mapProps } from '@formily/vue';
|
|
7
7
|
import { NSelect } from 'naive-ui';
|
|
@@ -31,48 +31,53 @@ const script = defineComponent({
|
|
|
31
31
|
emit
|
|
32
32
|
}) {
|
|
33
33
|
const remoteOptions = ref(null);
|
|
34
|
-
watch(remoteOptions, (o) => console.log("remoteOption", o));
|
|
35
34
|
const lastSearch = ref("");
|
|
36
|
-
const
|
|
35
|
+
const labelKey = computed(() => {
|
|
36
|
+
var _a, _b;
|
|
37
|
+
return (_b = (_a = props.urlConfig) == null ? void 0 : _a.nameKey) != null ? _b : "text";
|
|
38
|
+
});
|
|
39
|
+
const valueKey = computed(() => {
|
|
40
|
+
var _a, _b;
|
|
41
|
+
return (_b = (_a = props.urlConfig) == null ? void 0 : _a.valueKey) != null ? _b : "value";
|
|
42
|
+
});
|
|
43
|
+
const changeContextCollector = inject(InjectionChangeContextCollector);
|
|
44
|
+
function update(v, option) {
|
|
45
|
+
changeContextCollector == null ? void 0 : changeContextCollector.setContext(fieldKey.value, "currentOption", cloneDeep(option));
|
|
46
|
+
emit("update:value", v);
|
|
47
|
+
}
|
|
37
48
|
const {
|
|
38
49
|
title,
|
|
39
50
|
field,
|
|
40
51
|
fieldKey
|
|
41
52
|
} = useFormField();
|
|
42
|
-
|
|
43
|
-
return options.filter((option) => {
|
|
44
|
-
return !searchContent || String(option[labelKey.value]).includes(searchContent);
|
|
45
|
-
});
|
|
46
|
-
}
|
|
53
|
+
const asyncQueue = inject(InjectAsyncQueue);
|
|
47
54
|
async function fetchData(content) {
|
|
48
55
|
lastSearch.value = content || "";
|
|
49
|
-
if (
|
|
50
|
-
return;
|
|
51
|
-
const config = props.urlConfig;
|
|
52
|
-
if (!config) {
|
|
56
|
+
if (!configFor(props)) {
|
|
53
57
|
return remoteOptions.value = null;
|
|
54
58
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
remoteOptions.value = null;
|
|
62
|
-
}
|
|
63
|
-
function createParams(config2, field2) {
|
|
59
|
+
if (remoteOptions.value)
|
|
60
|
+
return;
|
|
61
|
+
remoteOptions.value = await asyncQueue.addAsync({
|
|
62
|
+
...createParams(configFor(props), field.value, title.value)
|
|
63
|
+
});
|
|
64
|
+
function createParams(config, field2, key) {
|
|
64
65
|
const _params = {};
|
|
65
|
-
traverseDependKey(
|
|
66
|
+
traverseDependKey(config.dependKey, (dependKey, valueKey2) => {
|
|
66
67
|
const _field = field2.query(dependKey).take();
|
|
67
68
|
if (isField(_field)) {
|
|
68
69
|
_params[valueKey2] = _field.value;
|
|
69
70
|
}
|
|
70
71
|
});
|
|
71
72
|
return {
|
|
72
|
-
...
|
|
73
|
-
params: Object.assign({},
|
|
73
|
+
...config,
|
|
74
|
+
params: Object.assign({}, config.params, _params),
|
|
75
|
+
key
|
|
74
76
|
};
|
|
75
77
|
}
|
|
78
|
+
function configFor(target) {
|
|
79
|
+
return target.urlConfig;
|
|
80
|
+
}
|
|
76
81
|
}
|
|
77
82
|
const parsedOptions = computed(() => {
|
|
78
83
|
if (remoteOptions.value)
|
|
@@ -80,45 +85,34 @@ const script = defineComponent({
|
|
|
80
85
|
if (!Array.isArray(props.options))
|
|
81
86
|
return [];
|
|
82
87
|
return filterOption(props.options, lastSearch.value);
|
|
88
|
+
function filterOption(options, searchContent) {
|
|
89
|
+
return options.filter((option) => {
|
|
90
|
+
return !searchContent || String(option[labelKey.value]).includes(searchContent);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
83
93
|
});
|
|
84
94
|
const formItemDepsCollector = inject(InjectionFormItemDepsCollector);
|
|
85
95
|
watch(() => props.urlConfig, (config, oldConfig) => {
|
|
86
96
|
if (isEqual(config, oldConfig))
|
|
87
97
|
return;
|
|
88
98
|
remoteOptions.value = null;
|
|
89
|
-
|
|
99
|
+
if (!config)
|
|
100
|
+
return;
|
|
101
|
+
formItemDepsCollector.setDeps(fieldKey.value, config.dependKey || [], async () => {
|
|
90
102
|
remoteOptions.value = null;
|
|
91
|
-
|
|
92
|
-
props.value != null && await fetchData();
|
|
103
|
+
emit("update:value", null);
|
|
93
104
|
});
|
|
94
|
-
|
|
105
|
+
props.value && fetchData();
|
|
95
106
|
}, {
|
|
96
107
|
immediate: true
|
|
97
108
|
});
|
|
98
109
|
watch(() => props.value, (n, o) => {
|
|
99
110
|
var _a, _b;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
if (isField(field.value) && field.value.visited) {
|
|
104
|
-
(_b = (_a = field.value).validate) == null ? void 0 : _b.call(_a);
|
|
105
|
-
}
|
|
111
|
+
o == null && n != null && fetchData();
|
|
112
|
+
isField(field.value) && field.value.visited && ((_b = (_a = field.value).validate) == null ? void 0 : _b.call(_a));
|
|
106
113
|
}, {
|
|
107
114
|
immediate: true
|
|
108
115
|
});
|
|
109
|
-
const changeContextCollector = inject(InjectionChangeContextCollector);
|
|
110
|
-
function update(v, option) {
|
|
111
|
-
changeContextCollector == null ? void 0 : changeContextCollector.setContext(fieldKey.value, "currentOption", cloneDeep(option));
|
|
112
|
-
emit("update:value", v);
|
|
113
|
-
}
|
|
114
|
-
const labelKey = computed(() => {
|
|
115
|
-
var _a, _b;
|
|
116
|
-
return (_b = (_a = props.urlConfig) == null ? void 0 : _a.nameKey) != null ? _b : "text";
|
|
117
|
-
});
|
|
118
|
-
const valueKey = computed(() => {
|
|
119
|
-
var _a, _b;
|
|
120
|
-
return (_b = (_a = props.urlConfig) == null ? void 0 : _a.valueKey) != null ? _b : "value";
|
|
121
|
-
});
|
|
122
116
|
function focusDecorator(onFocus) {
|
|
123
117
|
return (...args) => {
|
|
124
118
|
if (isField(field.value)) {
|
|
@@ -128,16 +122,16 @@ const script = defineComponent({
|
|
|
128
122
|
};
|
|
129
123
|
}
|
|
130
124
|
return () => createVNode(NSelect, {
|
|
131
|
-
"value": props.value,
|
|
132
|
-
"onUpdate:value": update,
|
|
133
125
|
"remote": true,
|
|
134
126
|
"filterable": true,
|
|
127
|
+
"value": props.value,
|
|
128
|
+
"onUpdate:value": update,
|
|
135
129
|
"labelField": labelKey.value,
|
|
136
130
|
"valueField": valueKey.value,
|
|
131
|
+
"options": parsedOptions.value,
|
|
137
132
|
"onSearch": fetchData,
|
|
138
133
|
"onUpdate:show": (show) => show && fetchData(),
|
|
139
|
-
"onFocus": focusDecorator(props.onFocus)
|
|
140
|
-
"options": parsedOptions.value
|
|
134
|
+
"onFocus": focusDecorator(props.onFocus)
|
|
141
135
|
}, slots);
|
|
142
136
|
}
|
|
143
137
|
});
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import { AnyObject } from '../../../../../../es/src/types';
|
|
1
2
|
export declare const TEXT: {
|
|
2
|
-
(props:
|
|
3
|
+
(props: AnyObject): JSX.Element;
|
|
3
4
|
props: {
|
|
4
5
|
content: {};
|
|
5
6
|
fieldItem: {};
|
|
7
|
+
value: {};
|
|
6
8
|
};
|
|
7
9
|
};
|
|
8
10
|
export declare const BUTTON: {
|
|
9
|
-
(props:
|
|
11
|
+
(props: AnyObject): JSX.Element;
|
|
10
12
|
props: {
|
|
11
13
|
onClick: {};
|
|
12
14
|
fieldItem: {};
|
|
@@ -11,12 +11,13 @@ function createPropFor(props) {
|
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
const textScript = (props) => {
|
|
14
|
-
var _a, _b;
|
|
15
|
-
return createVNode("div", null, [(_b = (_a =
|
|
14
|
+
var _a, _b, _c;
|
|
15
|
+
return createVNode("div", null, [(_c = (_b = createSlot((_a = props.content) != null ? _a : props.value, props)).default) == null ? void 0 : _c.call(_b)]);
|
|
16
16
|
};
|
|
17
17
|
textScript.props = {
|
|
18
18
|
content: {},
|
|
19
|
-
fieldItem: {}
|
|
19
|
+
fieldItem: {},
|
|
20
|
+
value: {}
|
|
20
21
|
};
|
|
21
22
|
const TEXT = connect(textScript, mapProps((props) => {
|
|
22
23
|
var _a;
|
|
@@ -34,7 +34,7 @@ export declare class AsyncQueue<T = any, K = any, R = any> {
|
|
|
34
34
|
export declare function useAsyncQueue(): {
|
|
35
35
|
create: (parallelism?: number) => AsyncQueue<FormAsyncQueueItem, any, {
|
|
36
36
|
label: string;
|
|
37
|
-
value:
|
|
37
|
+
value: unknown;
|
|
38
38
|
}[]>;
|
|
39
39
|
};
|
|
40
40
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FormChangeContext } from '../types';
|
|
2
2
|
export declare class ContextCollector {
|
|
3
3
|
private readonly contextMap;
|
|
4
|
-
setContext(key: string, prop:
|
|
4
|
+
setContext<T extends keyof FormChangeContext>(key: string, prop: T, value: FormChangeContext[T]): void;
|
|
5
5
|
getContext(key: string): Partial<{
|
|
6
6
|
currentOption: import("../../../../src/types").AnyObject;
|
|
7
7
|
}>;
|
|
@@ -6,9 +6,10 @@ import { fieldKeyEscape, arrayed, createLinebarId, transformDateFormat } from '.
|
|
|
6
6
|
function useFieldListAdaptor(collector, uuid) {
|
|
7
7
|
const { createValidatorSchema } = useFormValidator();
|
|
8
8
|
const createStandardSchema = (item) => {
|
|
9
|
+
var _a;
|
|
9
10
|
const result = {
|
|
10
11
|
name: item.val_key,
|
|
11
|
-
type: "string",
|
|
12
|
+
type: (_a = item.fieldType) != null ? _a : "string",
|
|
12
13
|
title: item.alias || item.name,
|
|
13
14
|
"x-component": item.html_type,
|
|
14
15
|
"x-component-props": {
|
|
@@ -98,6 +99,7 @@ function useFieldListAdaptor(collector, uuid) {
|
|
|
98
99
|
schema["x-decorator-props"].showLabel = false;
|
|
99
100
|
Object.assign(schema["x-component-props"], {
|
|
100
101
|
title: item.alias || item.name,
|
|
102
|
+
maxGroupNum: item.maxGroupNum,
|
|
101
103
|
getProperties: () => item.children || []
|
|
102
104
|
});
|
|
103
105
|
return schema;
|
|
@@ -126,7 +128,6 @@ function useFieldListAdaptor(collector, uuid) {
|
|
|
126
128
|
};
|
|
127
129
|
const createCustomSchema = (item) => {
|
|
128
130
|
const schema = createStandardSchema(item);
|
|
129
|
-
item.fieldType && (schema.type = item.fieldType);
|
|
130
131
|
Object.assign(schema["x-component-props"], {
|
|
131
132
|
fieldItem: item
|
|
132
133
|
});
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Func } from '../../../../../es/src/types';
|
|
2
|
+
import { DependKeyType } from '../../../../../es/packages/form-render';
|
|
2
3
|
export declare class FormItemDepsCollector {
|
|
3
4
|
private readonly collector;
|
|
4
|
-
setDeps(key: string, dependKeys:
|
|
5
|
-
trigger(dependKey: string, payload?:
|
|
5
|
+
setDeps(key: string, dependKeys: DependKeyType, callback: Func): void;
|
|
6
|
+
trigger(dependKey: string, payload?: unknown): void;
|
|
6
7
|
}
|
|
7
8
|
export declare function useFormItemDeps(): {
|
|
8
9
|
create: () => FormItemDepsCollector;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Func } from '../../../../../es/src/types';
|
|
1
|
+
import { Func, WithNull } from '../../../../../es/src/types';
|
|
2
2
|
declare type RequestInstance = Record<string, Func>;
|
|
3
3
|
export declare function useFormRequest(): {
|
|
4
|
-
getHttpInstance: () => RequestInstance
|
|
4
|
+
getHttpInstance: () => WithNull<RequestInstance>;
|
|
5
5
|
registGlobHttpInstance: (instance: RequestInstance) => void;
|
|
6
6
|
};
|
|
7
7
|
export {};
|