cnhis-design-vue 3.1.21-beta.7 → 3.1.21-beta.8
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/components/form-config/index.d.ts +1 -0
- package/es/components/form-config/src/FormConfig.vue.d.ts +1 -0
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +1 -0
- package/es/components/form-render/index2.js +4 -6
- package/es/components/form-render/src/components/renderer/cascader.js +3 -5
- package/es/components/form-render/src/components/renderer/checkbox.js +2 -6
- package/es/components/form-render/src/components/renderer/combination.js +2 -5
- package/es/components/form-render/src/components/renderer/complex.js +1 -5
- package/es/components/form-render/src/components/renderer/date.js +1 -4
- package/es/components/form-render/src/components/renderer/formItem.js +1 -5
- package/es/components/form-render/src/components/renderer/radio.js +1 -4
- package/es/components/form-render/src/components/renderer/search.d.ts +0 -9
- package/es/components/form-render/src/components/renderer/search.js +6 -17
- package/es/components/form-render/src/components/renderer/select.d.ts +0 -9
- package/es/components/form-render/src/components/renderer/select.js +8 -19
- package/es/components/form-render/src/components/renderer/switch.js +2 -6
- package/es/components/form-render/src/components/renderer/textarea.js +2 -6
- package/es/components/form-render/src/hooks/useAnchor2.js +1 -4
- package/es/components/form-render/src/hooks/useBusinessBinding2.js +1 -4
- package/es/components/form-render/src/hooks/useFormItemDeps2.js +1 -5
- package/es/components/form-render/src/hooks/usePresetScope2.js +1 -5
- package/es/components/form-render/src/types/fieldItem.d.ts +1 -0
- package/es/components/form-render/src/utils/index.d.ts +4 -4
- package/es/components/form-render/src/utils/index.js +26 -8
- package/es/components/shortcut-setter/index.d.ts +1 -0
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -0
- package/package.json +2 -3
|
@@ -927,6 +927,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
927
927
|
option?: {
|
|
928
928
|
text: string;
|
|
929
929
|
value: any;
|
|
930
|
+
keyword?: string | undefined;
|
|
930
931
|
children?: any[] | undefined;
|
|
931
932
|
}[] | undefined;
|
|
932
933
|
multi_select?: import("..").FormCommonState | undefined;
|
|
@@ -929,6 +929,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
929
929
|
option?: {
|
|
930
930
|
text: string;
|
|
931
931
|
value: any;
|
|
932
|
+
keyword?: string | undefined;
|
|
932
933
|
children?: any[] | undefined;
|
|
933
934
|
}[] | undefined;
|
|
934
935
|
multi_select?: import("../..").FormCommonState | undefined;
|
|
@@ -56,6 +56,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
56
56
|
option?: {
|
|
57
57
|
text: string;
|
|
58
58
|
value: any;
|
|
59
|
+
keyword?: string | undefined;
|
|
59
60
|
children?: any[] | undefined;
|
|
60
61
|
}[] | undefined;
|
|
61
62
|
multi_select?: import("../../../../../es/components/form-render").FormCommonState | undefined;
|
|
@@ -3,13 +3,9 @@ import { safeComponentRegister } from '../../shared/utils/index2.js';
|
|
|
3
3
|
import script from './src/FormRender.js';
|
|
4
4
|
import '@vueuse/core';
|
|
5
5
|
import 'lodash-es';
|
|
6
|
-
import '
|
|
7
|
-
import '@formily/path';
|
|
8
|
-
import '@vue/shared';
|
|
9
|
-
import 'pinyin-match';
|
|
10
|
-
import 'date-fns';
|
|
11
|
-
export * from '@formily/core';
|
|
6
|
+
import './src/utils/index.js';
|
|
12
7
|
import '@formily/vue';
|
|
8
|
+
import 'vue';
|
|
13
9
|
import '../../shared/utils/tapable/SyncHook.js';
|
|
14
10
|
import '../../shared/utils/tapable/SyncBailHook.js';
|
|
15
11
|
import '../../shared/utils/tapable/SyncWaterfallHook.js';
|
|
@@ -20,6 +16,8 @@ import '../../shared/utils/tapable/AsyncSeriesHook.js';
|
|
|
20
16
|
import '../../shared/utils/tapable/AsyncSeriesBailHook.js';
|
|
21
17
|
import '../../shared/utils/tapable/AsyncSeriesLoopHook.js';
|
|
22
18
|
import '../../shared/utils/tapable/AsyncSeriesWaterfallHook.js';
|
|
19
|
+
export * from '@formily/core';
|
|
20
|
+
import '@vue/shared';
|
|
23
21
|
import './src/components/renderer/input.js';
|
|
24
22
|
import './src/components/renderer/select.js';
|
|
25
23
|
import './src/components/renderer/formItem.js';
|
|
@@ -5,11 +5,7 @@ import { useCommonInjection } from '../../hooks/useCommonInjection2.js';
|
|
|
5
5
|
import { InjectAsyncQueue } from '../../constants/index2.js';
|
|
6
6
|
import '@vueuse/core';
|
|
7
7
|
import '../../../index2.js';
|
|
8
|
-
import '
|
|
9
|
-
import '@vue/shared';
|
|
10
|
-
import 'pinyin-match';
|
|
11
|
-
import 'date-fns';
|
|
12
|
-
import { assignUpdateValue, assignValueBindKey, traverseDependKey } from '../../utils/schema2.js';
|
|
8
|
+
import '../../utils/index.js';
|
|
13
9
|
import { useFormField } from '../../hooks/useFormField2.js';
|
|
14
10
|
import '../../../../../shared/utils/tapable/SyncHook.js';
|
|
15
11
|
import '../../../../../shared/utils/tapable/SyncBailHook.js';
|
|
@@ -21,6 +17,7 @@ import '../../../../../shared/utils/tapable/AsyncSeriesHook.js';
|
|
|
21
17
|
import '../../../../../shared/utils/tapable/AsyncSeriesBailHook.js';
|
|
22
18
|
import '../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js';
|
|
23
19
|
import '../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js';
|
|
20
|
+
import '@vue/shared';
|
|
24
21
|
import { connect, mapProps } from '@formily/vue';
|
|
25
22
|
import './input.js';
|
|
26
23
|
import './select.js';
|
|
@@ -41,6 +38,7 @@ import './complex.js';
|
|
|
41
38
|
import './simpleComponent.js';
|
|
42
39
|
import './search.js';
|
|
43
40
|
import { NCascader } from 'naive-ui';
|
|
41
|
+
import { assignUpdateValue, assignValueBindKey, traverseDependKey } from '../../utils/schema2.js';
|
|
44
42
|
|
|
45
43
|
const script = defineComponent({
|
|
46
44
|
name: "FormCascader",
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { defineComponent, createVNode } from 'vue';
|
|
2
|
-
import '
|
|
3
|
-
import '@vue/shared';
|
|
4
|
-
import 'lodash-es';
|
|
5
|
-
import 'pinyin-match';
|
|
6
|
-
import 'date-fns';
|
|
7
|
-
import { assignUpdateValue, assignValueBindKey } from '../../utils/schema2.js';
|
|
2
|
+
import '../../utils/index.js';
|
|
8
3
|
import { connect, mapProps } from '@formily/vue';
|
|
9
4
|
import { NCheckboxGroup, NSpace, NCheckbox } from 'naive-ui';
|
|
5
|
+
import { assignUpdateValue, assignValueBindKey } from '../../utils/schema2.js';
|
|
10
6
|
|
|
11
7
|
const script = defineComponent({
|
|
12
8
|
name: "FormCheckbox",
|
|
@@ -4,13 +4,10 @@ import '../../../index2.js';
|
|
|
4
4
|
import { useField, RecursionField, connect } from '@formily/vue';
|
|
5
5
|
import { NButton, NIcon } from 'naive-ui';
|
|
6
6
|
import { InjectionBusinessCollector } from '../../constants/index2.js';
|
|
7
|
-
import '
|
|
8
|
-
import '@vue/shared';
|
|
9
|
-
import 'pinyin-match';
|
|
10
|
-
import 'date-fns';
|
|
11
|
-
import { createObjSchema } from '../../utils/schema2.js';
|
|
7
|
+
import '../../utils/index.js';
|
|
12
8
|
import { AddCircleOutline, RemoveCircle } from '@vicons/ionicons5';
|
|
13
9
|
import { useFieldListAdaptor } from '../../hooks/useFieldListAdaptor2.js';
|
|
10
|
+
import { createObjSchema } from '../../utils/schema2.js';
|
|
14
11
|
|
|
15
12
|
const script = defineComponent({
|
|
16
13
|
name: "FormCombination",
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { defineComponent, createVNode } from 'vue';
|
|
2
2
|
import { connect, mapProps } from '@formily/vue';
|
|
3
|
-
import '
|
|
4
|
-
import '@vue/shared';
|
|
5
|
-
import 'lodash-es';
|
|
6
|
-
import 'pinyin-match';
|
|
7
|
-
import 'date-fns';
|
|
3
|
+
import '../../utils/index.js';
|
|
8
4
|
import { assignUpdateValue } from '../../utils/schema2.js';
|
|
9
5
|
|
|
10
6
|
const script = defineComponent({
|
|
@@ -5,10 +5,7 @@ import { isObject } from '@vueuse/core';
|
|
|
5
5
|
import { format } from 'date-fns';
|
|
6
6
|
import { NDatePicker } from 'naive-ui';
|
|
7
7
|
import { useCommonInjection } from '../../hooks/useCommonInjection2.js';
|
|
8
|
-
import '
|
|
9
|
-
import '@vue/shared';
|
|
10
|
-
import 'lodash-es';
|
|
11
|
-
import 'pinyin-match';
|
|
8
|
+
import '../../utils/index.js';
|
|
12
9
|
import { assignUpdateValue, assignValueBindKey } from '../../utils/schema2.js';
|
|
13
10
|
|
|
14
11
|
const script = defineComponent({
|
|
@@ -4,11 +4,7 @@ import { useField, connect, mapProps } from '@formily/vue';
|
|
|
4
4
|
import { NFormItem } from 'naive-ui';
|
|
5
5
|
import Annotation from '../../../../annotation-edit/index2.js';
|
|
6
6
|
import { InjectionAnnotation, InjectionFormUUID } from '../../constants/index2.js';
|
|
7
|
-
import '
|
|
8
|
-
import '@vue/shared';
|
|
9
|
-
import 'lodash-es';
|
|
10
|
-
import 'pinyin-match';
|
|
11
|
-
import 'date-fns';
|
|
7
|
+
import '../../utils/index.js';
|
|
12
8
|
import { dotEscape } from '../../utils/schema2.js';
|
|
13
9
|
|
|
14
10
|
const script = defineComponent({
|
|
@@ -2,10 +2,7 @@ import { defineComponent, computed, createVNode } from 'vue';
|
|
|
2
2
|
import { connect, mapProps } from '@formily/vue';
|
|
3
3
|
import { isNumber } from 'lodash-es';
|
|
4
4
|
import { NRadioGroup, NSpace, NRadio } from 'naive-ui';
|
|
5
|
-
import '
|
|
6
|
-
import '@vue/shared';
|
|
7
|
-
import 'pinyin-match';
|
|
8
|
-
import 'date-fns';
|
|
5
|
+
import '../../utils/index.js';
|
|
9
6
|
import { assignUpdateValue, assignValueBindKey } from '../../utils/schema2.js';
|
|
10
7
|
|
|
11
8
|
const script = defineComponent({
|
|
@@ -27,10 +27,6 @@ export declare const SEARCH: import("vue").DefineComponent<{
|
|
|
27
27
|
onFocus: {
|
|
28
28
|
type: PropType<Func<any[], any>>;
|
|
29
29
|
};
|
|
30
|
-
pinyin: {
|
|
31
|
-
type: BooleanConstructor;
|
|
32
|
-
default: boolean;
|
|
33
|
-
};
|
|
34
30
|
onChange: {};
|
|
35
31
|
}, () => 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<{
|
|
36
32
|
value: {
|
|
@@ -59,14 +55,9 @@ export declare const SEARCH: import("vue").DefineComponent<{
|
|
|
59
55
|
onFocus: {
|
|
60
56
|
type: PropType<Func<any[], any>>;
|
|
61
57
|
};
|
|
62
|
-
pinyin: {
|
|
63
|
-
type: BooleanConstructor;
|
|
64
|
-
default: boolean;
|
|
65
|
-
};
|
|
66
58
|
onChange: {};
|
|
67
59
|
}>> & {
|
|
68
60
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
69
61
|
}, {
|
|
70
62
|
lazyRequest: boolean;
|
|
71
|
-
pinyin: boolean;
|
|
72
63
|
}>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defineComponent, computed, ref, inject, watch, createVNode } from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import { useDebounceFn } from '@vueuse/core';
|
|
3
|
+
import { isString, cloneDeep, isEqual } from 'lodash-es';
|
|
3
4
|
import { useCommonInjection } from '../../hooks/useCommonInjection2.js';
|
|
4
5
|
import { InjectAsyncQueue, InjectionChangeContextCollector } from '../../constants/index2.js';
|
|
5
|
-
import '@vueuse/core';
|
|
6
6
|
import '../../../index2.js';
|
|
7
|
-
import {
|
|
7
|
+
import { formRenderLog, optionMatcher } from '../../utils/index.js';
|
|
8
8
|
import { useFormRequest } from '../../hooks/useFormRequest2.js';
|
|
9
9
|
import { useFormField } from '../../hooks/useFormField2.js';
|
|
10
10
|
import '../../../../../shared/utils/tapable/SyncHook.js';
|
|
@@ -62,10 +62,6 @@ const script = defineComponent({
|
|
|
62
62
|
onFocus: {
|
|
63
63
|
type: Function
|
|
64
64
|
},
|
|
65
|
-
pinyin: {
|
|
66
|
-
type: Boolean,
|
|
67
|
-
default: true
|
|
68
|
-
},
|
|
69
65
|
onChange: {}
|
|
70
66
|
},
|
|
71
67
|
emits: ["update:value"],
|
|
@@ -95,7 +91,7 @@ const script = defineComponent({
|
|
|
95
91
|
const {
|
|
96
92
|
getSearchRequestInfo
|
|
97
93
|
} = useFormRequest();
|
|
98
|
-
async function
|
|
94
|
+
const fetchData = useDebounceFn(async function(content) {
|
|
99
95
|
lastSearch.value = content || "";
|
|
100
96
|
if (remoteOptions.value)
|
|
101
97
|
return;
|
|
@@ -119,16 +115,9 @@ const script = defineComponent({
|
|
|
119
115
|
key: key2
|
|
120
116
|
};
|
|
121
117
|
}
|
|
122
|
-
}
|
|
118
|
+
}, 300);
|
|
123
119
|
const parsedOptions = computed(() => {
|
|
124
|
-
return remoteOptions.value ?
|
|
125
|
-
function filterOption(options, searchContent) {
|
|
126
|
-
return options.filter((option) => {
|
|
127
|
-
return !searchContent || stringMatcher(searchContent, option[labelKey.value], {
|
|
128
|
-
pinyin: props.pinyin
|
|
129
|
-
});
|
|
130
|
-
});
|
|
131
|
-
}
|
|
120
|
+
return remoteOptions.value ? optionMatcher(remoteOptions.value, lastSearch.value, labelKey.value) : [];
|
|
132
121
|
});
|
|
133
122
|
const changeContextCollector = inject(InjectionChangeContextCollector);
|
|
134
123
|
changeContextCollector.setContext(fieldKey.value, (v) => {
|
|
@@ -19,10 +19,6 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
19
19
|
onFocus: {
|
|
20
20
|
type: PropType<Func<any[], any>>;
|
|
21
21
|
};
|
|
22
|
-
pinyin: {
|
|
23
|
-
type: BooleanConstructor;
|
|
24
|
-
default: boolean;
|
|
25
|
-
};
|
|
26
22
|
onChange: {};
|
|
27
23
|
}, () => 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<{
|
|
28
24
|
value: {
|
|
@@ -42,15 +38,10 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
42
38
|
onFocus: {
|
|
43
39
|
type: PropType<Func<any[], any>>;
|
|
44
40
|
};
|
|
45
|
-
pinyin: {
|
|
46
|
-
type: BooleanConstructor;
|
|
47
|
-
default: boolean;
|
|
48
|
-
};
|
|
49
41
|
onChange: {};
|
|
50
42
|
}>> & {
|
|
51
43
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
52
44
|
}, {
|
|
53
45
|
options: AnyObject[];
|
|
54
46
|
lazyRequest: boolean;
|
|
55
|
-
pinyin: boolean;
|
|
56
47
|
}>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { defineComponent, computed, ref, inject, watch, createVNode } from 'vue';
|
|
2
2
|
import { isField } from '@formily/core';
|
|
3
|
-
import {
|
|
3
|
+
import { useDebounceFn } from '@vueuse/core';
|
|
4
|
+
import { isString, cloneDeep, isEqual } from 'lodash-es';
|
|
4
5
|
import { useCommonInjection } from '../../hooks/useCommonInjection2.js';
|
|
5
6
|
import { InjectAsyncQueue, InjectionChangeContextCollector, InjectionFormItemDepsCollector } from '../../constants/index2.js';
|
|
6
|
-
import '@vueuse/core';
|
|
7
7
|
import '../../../index2.js';
|
|
8
|
-
import {
|
|
8
|
+
import { formRenderLog, optionMatcher } from '../../utils/index.js';
|
|
9
9
|
import { useFormField } from '../../hooks/useFormField2.js';
|
|
10
10
|
import '../../../../../shared/utils/tapable/SyncHook.js';
|
|
11
11
|
import '../../../../../shared/utils/tapable/SyncBailHook.js';
|
|
@@ -38,7 +38,7 @@ import './complex.js';
|
|
|
38
38
|
import './simpleComponent.js';
|
|
39
39
|
import './search.js';
|
|
40
40
|
import { NSelect } from 'naive-ui';
|
|
41
|
-
import { focusDecorator, assignUpdateValue
|
|
41
|
+
import { traverseDependKey, focusDecorator, assignUpdateValue } from '../../utils/schema2.js';
|
|
42
42
|
|
|
43
43
|
const script = defineComponent({
|
|
44
44
|
name: "FormSelect",
|
|
@@ -60,10 +60,6 @@ const script = defineComponent({
|
|
|
60
60
|
onFocus: {
|
|
61
61
|
type: Function
|
|
62
62
|
},
|
|
63
|
-
pinyin: {
|
|
64
|
-
type: Boolean,
|
|
65
|
-
default: true
|
|
66
|
-
},
|
|
67
63
|
onChange: {}
|
|
68
64
|
},
|
|
69
65
|
emits: ["update:value"],
|
|
@@ -90,7 +86,7 @@ const script = defineComponent({
|
|
|
90
86
|
fieldKey
|
|
91
87
|
} = useFormField();
|
|
92
88
|
const asyncQueue = inject(InjectAsyncQueue);
|
|
93
|
-
async function
|
|
89
|
+
const fetchData = useDebounceFn(async function(content) {
|
|
94
90
|
lastSearch.value = content || "";
|
|
95
91
|
if (!configFor(props)) {
|
|
96
92
|
return remoteOptions.value = null;
|
|
@@ -126,20 +122,13 @@ const script = defineComponent({
|
|
|
126
122
|
function configFor(target) {
|
|
127
123
|
return target.urlConfig;
|
|
128
124
|
}
|
|
129
|
-
}
|
|
125
|
+
}, 300);
|
|
130
126
|
const parsedOptions = computed(() => {
|
|
131
127
|
if (remoteOptions.value)
|
|
132
|
-
return
|
|
128
|
+
return optionMatcher(remoteOptions.value, lastSearch.value, labelKey.value);
|
|
133
129
|
if (!Array.isArray(props.options))
|
|
134
130
|
return [];
|
|
135
|
-
return
|
|
136
|
-
function filterOption(options, searchContent) {
|
|
137
|
-
return options.filter((option) => {
|
|
138
|
-
return !searchContent || stringMatcher(searchContent, option[labelKey.value], {
|
|
139
|
-
pinyin: props.pinyin
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
}
|
|
131
|
+
return optionMatcher(props.options, lastSearch.value, labelKey.value);
|
|
143
132
|
});
|
|
144
133
|
const changeContextCollector = inject(InjectionChangeContextCollector);
|
|
145
134
|
changeContextCollector.setContext(fieldKey.value, (v) => {
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { defineComponent, computed, createVNode, createTextVNode } from 'vue';
|
|
2
2
|
import { NSwitch } from 'naive-ui';
|
|
3
|
-
import '
|
|
4
|
-
import '@vue/shared';
|
|
5
|
-
import 'lodash-es';
|
|
6
|
-
import 'pinyin-match';
|
|
7
|
-
import 'date-fns';
|
|
8
|
-
import { assignUpdateValue, assignValueBindKey } from '../../utils/schema2.js';
|
|
3
|
+
import '../../utils/index.js';
|
|
9
4
|
import { connect, mapProps } from '@formily/vue';
|
|
5
|
+
import { assignUpdateValue, assignValueBindKey } from '../../utils/schema2.js';
|
|
10
6
|
|
|
11
7
|
const script = defineComponent({
|
|
12
8
|
name: "FormSwitch",
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { defineComponent, computed, createVNode } from 'vue';
|
|
2
2
|
import { useCommonInjection } from '../../hooks/useCommonInjection2.js';
|
|
3
|
-
import '
|
|
4
|
-
import '@vue/shared';
|
|
5
|
-
import 'lodash-es';
|
|
6
|
-
import 'pinyin-match';
|
|
7
|
-
import 'date-fns';
|
|
8
|
-
import { assignUpdateValue } from '../../utils/schema2.js';
|
|
3
|
+
import '../../utils/index.js';
|
|
9
4
|
import { connect, mapProps } from '@formily/vue';
|
|
10
5
|
import { NInput } from 'naive-ui';
|
|
6
|
+
import { assignUpdateValue } from '../../utils/schema2.js';
|
|
11
7
|
|
|
12
8
|
const script = defineComponent({
|
|
13
9
|
name: "FormTextarea",
|
|
@@ -3,10 +3,7 @@ import { useDebounceFn } from '@vueuse/core';
|
|
|
3
3
|
import { isNumber } from 'lodash-es';
|
|
4
4
|
import { ref, computed, watch, nextTick } from 'vue';
|
|
5
5
|
import { FormItemLineBarDepKeyPrepend } from '../constants/index2.js';
|
|
6
|
-
import '
|
|
7
|
-
import '@vue/shared';
|
|
8
|
-
import 'pinyin-match';
|
|
9
|
-
import 'date-fns';
|
|
6
|
+
import '../utils/index.js';
|
|
10
7
|
import { createLinebarId, traverseSchema } from '../utils/schema2.js';
|
|
11
8
|
|
|
12
9
|
function useAnchor(props, scrollbarRef, collector) {
|
|
@@ -2,10 +2,7 @@ import { isField } from '@formily/core';
|
|
|
2
2
|
import { isString } from '@vueuse/core';
|
|
3
3
|
import { isFunction, isNumber } from 'lodash-es';
|
|
4
4
|
import { FIELD_BUSINESS_TYPE } from '../constants/index2.js';
|
|
5
|
-
import '
|
|
6
|
-
import '@formily/path';
|
|
7
|
-
import '@vue/shared';
|
|
8
|
-
import 'pinyin-match';
|
|
5
|
+
import '../utils/index.js';
|
|
9
6
|
import { isIdCard, parseIdCard, parseAge2FromContext, parseBirthday, parseAge2Birthday } from '../utils/business2.js';
|
|
10
7
|
|
|
11
8
|
class BusinessCollector {
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { isFunction } from 'lodash-es';
|
|
2
|
-
import '
|
|
3
|
-
import '@formily/path';
|
|
4
|
-
import '@vue/shared';
|
|
5
|
-
import 'pinyin-match';
|
|
6
|
-
import 'date-fns';
|
|
2
|
+
import '../utils/index.js';
|
|
7
3
|
import { traverseDependKey } from '../utils/schema2.js';
|
|
8
4
|
|
|
9
5
|
class FormItemDepsCollector {
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { isString } from 'lodash-es';
|
|
2
|
-
import '
|
|
3
|
-
import '@formily/path';
|
|
4
|
-
import '@vue/shared';
|
|
5
|
-
import 'pinyin-match';
|
|
2
|
+
import '../utils/index.js';
|
|
6
3
|
import { isIdCard, isMobile } from '../utils/business2.js';
|
|
7
|
-
import '@formily/core';
|
|
8
4
|
|
|
9
5
|
function usePresetScope() {
|
|
10
6
|
return {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyObject, ArrayAble } from '../../../../../es/shared/types';
|
|
1
|
+
import { AnyObject, ArrayAble, Nullable } from '../../../../../es/shared/types';
|
|
2
2
|
import { FunctionalComponent, InjectionKey, VNode } from 'vue';
|
|
3
3
|
import { FieldItem } from '../types';
|
|
4
4
|
export * from './business';
|
|
@@ -15,6 +15,6 @@ export declare function createSlot(renderer: unknown, props: AnyObject): Record<
|
|
|
15
15
|
};
|
|
16
16
|
export declare function createInputSlot(props: AnyObject): import("vue").ComputedRef<Record<string, FunctionalComponent<{}, {}>>>;
|
|
17
17
|
export declare function presetRequestHandler(res: unknown): any;
|
|
18
|
-
export declare function
|
|
19
|
-
|
|
20
|
-
}):
|
|
18
|
+
export declare function optionMatcher(options: AnyObject[], input: Nullable<string>, key: string, matcherOption?: {
|
|
19
|
+
keyword?: string;
|
|
20
|
+
}): AnyObject[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { computed, createVNode, Fragment, inject, provide } from 'vue';
|
|
2
2
|
import { Path } from '@formily/path';
|
|
3
3
|
import { isObject } from '@vue/shared';
|
|
4
|
+
import { useMemoize } from '@vueuse/core';
|
|
4
5
|
import { isString, isFunction } from 'lodash-es';
|
|
5
|
-
import PinyinMatch from 'pinyin-match';
|
|
6
6
|
import 'date-fns';
|
|
7
7
|
import '@formily/core';
|
|
8
8
|
|
|
@@ -112,12 +112,30 @@ function presetRequestHandler(res) {
|
|
|
112
112
|
return map.rows;
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
|
|
116
|
-
if (!isString(
|
|
117
|
-
return
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
115
|
+
const keywordMatcher = useMemoize(function(text, keyword) {
|
|
116
|
+
if (!isString(keyword) || !isString(text))
|
|
117
|
+
return false;
|
|
118
|
+
return keyword.split(",").some((k) => k.trim().includes(text));
|
|
119
|
+
}, {
|
|
120
|
+
getKey(...args) {
|
|
121
|
+
return args.reduce((res, arg) => {
|
|
122
|
+
return String(res) + "_" + String(arg);
|
|
123
|
+
}, "");
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
function optionMatcher(options, input, key, matcherOption = {
|
|
127
|
+
keyword: "keyword"
|
|
128
|
+
}) {
|
|
129
|
+
if (!input)
|
|
130
|
+
return options;
|
|
131
|
+
return options.filter((option) => {
|
|
132
|
+
if (!isString(keyFor(option)))
|
|
133
|
+
return;
|
|
134
|
+
return keyFor(option).includes(input) || matcherOption.keyword && keywordMatcher(input, option[matcherOption.keyword]);
|
|
135
|
+
});
|
|
136
|
+
function keyFor(option) {
|
|
137
|
+
return option[key];
|
|
138
|
+
}
|
|
121
139
|
}
|
|
122
140
|
|
|
123
|
-
export { arrayed, createInputSlot, createSlot, formRenderLog, injectOrProvide, mergeDeepProperties, parseNumberFromMaybeString, presetRequestHandler,
|
|
141
|
+
export { arrayed, createInputSlot, createSlot, formRenderLog, injectOrProvide, mergeDeepProperties, optionMatcher, parseNumberFromMaybeString, presetRequestHandler, uuidGenerator };
|
|
@@ -87,6 +87,7 @@ declare const ShortcutSetter: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
87
87
|
option?: {
|
|
88
88
|
text: string;
|
|
89
89
|
value: any;
|
|
90
|
+
keyword?: string | undefined;
|
|
90
91
|
children?: any[] | undefined;
|
|
91
92
|
}[] | undefined;
|
|
92
93
|
multi_select?: import("..").FormCommonState | undefined;
|
|
@@ -89,6 +89,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
89
89
|
option?: {
|
|
90
90
|
text: string;
|
|
91
91
|
value: any;
|
|
92
|
+
keyword?: string | undefined;
|
|
92
93
|
children?: any[] | undefined;
|
|
93
94
|
}[] | undefined;
|
|
94
95
|
multi_select?: import("../../../../es/components/form-render").FormCommonState | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cnhis-design-vue",
|
|
3
|
-
"version": "3.1.21-beta.
|
|
3
|
+
"version": "3.1.21-beta.8",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"module": "./es/components/index.js",
|
|
6
6
|
"main": "./es/components/index.js",
|
|
@@ -44,7 +44,6 @@
|
|
|
44
44
|
"min-dom": "^3.2.1",
|
|
45
45
|
"moment": "^2.29.1",
|
|
46
46
|
"naive-ui": "^2.30.0",
|
|
47
|
-
"pinyin-match": "^1.2.2",
|
|
48
47
|
"rimraf": "^3.0.2",
|
|
49
48
|
"spark-md5": "^3.0.2",
|
|
50
49
|
"tiny-svg": "^2.2.4",
|
|
@@ -67,5 +66,5 @@
|
|
|
67
66
|
"iOS 7",
|
|
68
67
|
"last 3 iOS versions"
|
|
69
68
|
],
|
|
70
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "693beb4f15ef0b49a98376bb468940be246540ff"
|
|
71
70
|
}
|