cnhis-design-vue 3.1.16 → 3.1.17-beta.2
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/fabric-chart/index.d.ts +2 -0
- package/es/packages/fabric-chart/src/FabricChart.js +20 -5
- package/es/packages/fabric-chart/src/FabricChart.vue.d.ts +2 -0
- package/es/packages/fabric-chart/src/hooks/useCenter.js +19 -18
- package/es/packages/fabric-chart/src/hooks/useLeft.d.ts +3 -1
- package/es/packages/fabric-chart/src/hooks/useLeft.js +30 -12
- package/es/packages/fabric-chart/src/hooks/useRight.d.ts +1 -1
- package/es/packages/fabric-chart/src/hooks/useRight.js +11 -69
- package/es/packages/fabric-chart/src/interface.d.ts +3 -0
- package/es/packages/form-config/index.d.ts +7 -7
- package/es/packages/form-config/src/FormConfig.vue.d.ts +7 -7
- package/es/packages/form-config/src/components/FormConfigCreator.js +2 -0
- package/es/packages/form-config/src/components/FormConfigCreator.vue.d.ts +3 -3
- package/es/packages/form-config/src/components/FormConfigEdit.js +1 -0
- package/es/packages/form-config/src/components/FormConfigEdit.vue.d.ts +4 -4
- package/es/packages/form-config/src/constants/index.d.ts +2 -2
- package/es/packages/form-config/src/hooks/useConfigurationField.js +9 -9
- package/es/packages/form-render/index.d.ts +3 -3
- package/es/packages/form-render/index.js +1 -1
- package/es/packages/form-render/src/FormRender.js +1 -1
- package/es/packages/form-render/src/FormRender.vue.d.ts +3 -3
- package/es/packages/form-render/src/components/renderer/formItem.js +1 -2
- package/es/packages/form-render/src/components/renderer/inputGroup.js +1 -1
- package/es/packages/form-render/src/components/renderer/select.js +11 -8
- package/es/packages/form-render/src/constants/index.d.ts +2 -2
- package/es/packages/form-render/src/hooks/index.d.ts +1 -1
- package/es/packages/form-render/src/hooks/index.js +1 -1
- package/es/packages/form-render/src/hooks/useAnchor.d.ts +3 -3
- package/es/packages/form-render/src/hooks/useAsyncQueue.d.ts +2 -2
- package/es/packages/form-render/src/hooks/useBusinessBinding.d.ts +5 -6
- package/es/packages/form-render/src/hooks/useBusinessBinding.js +22 -20
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +4 -4
- package/es/packages/form-render/src/hooks/useFieldNormalize.d.ts +5 -0
- package/es/packages/form-render/src/hooks/useFieldNormalize.js +58 -0
- package/es/packages/form-render/src/hooks/useFieldVisitor.js +2 -5
- package/es/packages/form-render/src/hooks/useFormRenderLifeCycle.d.ts +4 -4
- package/es/packages/form-render/src/hooks/useFormRequest.d.ts +2 -2
- package/es/packages/form-render/src/types/index.d.ts +2 -2
- package/es/packages/form-render/src/utils/dom.d.ts +2 -2
- package/es/packages/form-render/src/utils/schema.d.ts +2 -2
- package/es/packages/index.js +1 -1
- package/es/packages/shortcut-setter/index.d.ts +3 -3
- package/es/packages/shortcut-setter/src/ShortcutSetter.vue.d.ts +3 -3
- package/es/src/types/index.d.ts +2 -2
- package/es/src/utils/tapable/AsyncParallelBailHook.d.ts +3 -0
- package/es/src/utils/tapable/AsyncParallelBailHook.js +78 -0
- package/es/src/utils/tapable/AsyncParallelHook.d.ts +3 -0
- package/es/src/utils/tapable/AsyncParallelHook.js +27 -0
- package/es/src/utils/tapable/AsyncSeriesBailHook.d.ts +3 -0
- package/es/src/utils/tapable/AsyncSeriesBailHook.js +33 -0
- package/es/src/utils/tapable/AsyncSeriesHook.d.ts +3 -0
- package/es/src/utils/tapable/AsyncSeriesHook.js +27 -0
- package/es/src/utils/tapable/AsyncSeriesLoopHook.d.ts +3 -0
- package/es/src/utils/tapable/AsyncSeriesLoopHook.js +27 -0
- package/es/src/utils/tapable/AsyncSeriesWaterfallHook.d.ts +3 -0
- package/es/src/utils/tapable/AsyncSeriesWaterfallHook.js +40 -0
- package/es/src/utils/tapable/Hook.d.ts +50 -0
- package/es/src/utils/tapable/Hook.js +140 -0
- package/es/src/utils/tapable/HookCodeFactory.d.ts +58 -0
- package/es/src/utils/tapable/HookCodeFactory.js +444 -0
- package/es/src/utils/tapable/HookMap.d.ts +11 -0
- package/es/src/utils/tapable/HookMap.js +32 -0
- package/es/src/utils/tapable/MultiHook.d.ts +12 -0
- package/es/src/utils/tapable/MultiHook.js +38 -0
- package/es/src/utils/tapable/SyncBailHook.d.ts +3 -0
- package/es/src/utils/tapable/SyncBailHook.js +40 -0
- package/es/src/utils/tapable/SyncHook.d.ts +3 -0
- package/es/src/utils/tapable/SyncHook.js +34 -0
- package/es/src/utils/tapable/SyncLoopHook.d.ts +3 -0
- package/es/src/utils/tapable/SyncLoopHook.js +34 -0
- package/es/src/utils/tapable/SyncWaterfallHook.d.ts +3 -0
- package/es/src/utils/tapable/SyncWaterfallHook.js +48 -0
- package/es/src/utils/tapable/index.d.ts +139 -0
- package/es/src/utils/tapable/index.js +12 -0
- package/global.d.ts +8 -8
- package/package.json +1 -1
- package/es/packages/form-render/src/hooks/useTypeNormalize.d.ts +0 -4
- package/es/packages/form-render/src/hooks/useTypeNormalize.js +0 -46
|
@@ -2,24 +2,24 @@ import { EditAbleField, widgetWidthOptionConfig, isShowOptionConfig, isNotFoldOp
|
|
|
2
2
|
|
|
3
3
|
function useConfigurationField() {
|
|
4
4
|
const fieldMap = /* @__PURE__ */ new Map([
|
|
5
|
-
[EditAbleField.NAME, { alias: "\u540D\u79F0", elem_width:
|
|
6
|
-
[EditAbleField.NOTES, { alias: "\u95EE\u53F7\u63D0\u793A", elem_width:
|
|
5
|
+
[EditAbleField.NAME, { alias: "\u540D\u79F0", elem_width: 6, is_null: "0", html_type: "INPUT" }],
|
|
6
|
+
[EditAbleField.NOTES, { alias: "\u95EE\u53F7\u63D0\u793A", elem_width: 6, html_type: "INPUT" }],
|
|
7
7
|
[
|
|
8
8
|
EditAbleField.DEFAULT_VALUE,
|
|
9
|
-
{ alias: "\u9ED8\u8BA4\u503C", elem_width:
|
|
9
|
+
{ alias: "\u9ED8\u8BA4\u503C", elem_width: 6, html_type: "INPUT", validate: { max_length: 20 } }
|
|
10
10
|
],
|
|
11
11
|
[
|
|
12
12
|
EditAbleField.LAYOUT_WIDTH_ENUM,
|
|
13
|
-
{ alias: "\u5BBD\u5EA6", fieldType: "number", html_type: "SELECT", elem_width:
|
|
13
|
+
{ alias: "\u5BBD\u5EA6", fieldType: "number", html_type: "SELECT", elem_width: 6, ...widgetWidthOptionConfig() }
|
|
14
14
|
],
|
|
15
|
-
[EditAbleField.DESC, { alias: "\u8BF4\u660E\u6587\u672C", elem_width:
|
|
15
|
+
[EditAbleField.DESC, { alias: "\u8BF4\u660E\u6587\u672C", elem_width: 6, html_type: "INPUT", validate: { max_length: 30 } }],
|
|
16
16
|
[
|
|
17
17
|
EditAbleField.DEFAULT_EXPAND,
|
|
18
|
-
{ alias: "\u662F\u5426\u9ED8\u8BA4\u5C55\u5F00", html_type: "SWITCH", elem_width:
|
|
18
|
+
{ alias: "\u662F\u5426\u9ED8\u8BA4\u5C55\u5F00", html_type: "SWITCH", elem_width: 6, ...isShowOptionConfig() }
|
|
19
19
|
],
|
|
20
|
-
[EditAbleField.FOLD, { alias: "\u662F\u5426\u53EF\u6298\u53E0", html_type: "SWITCH", elem_width:
|
|
21
|
-
[EditAbleField.EDITABLE, { alias: "\u662F\u5426\u53EF\u7F16\u8F91", html_type: "SWITCH", elem_width:
|
|
22
|
-
[EditAbleField.REQUIRED, { alias: "\u662F\u5426\u5FC5\u586B", html_type: "SWITCH", elem_width:
|
|
20
|
+
[EditAbleField.FOLD, { alias: "\u662F\u5426\u53EF\u6298\u53E0", html_type: "SWITCH", elem_width: 6, ...isNotFoldOptionConfig() }],
|
|
21
|
+
[EditAbleField.EDITABLE, { alias: "\u662F\u5426\u53EF\u7F16\u8F91", html_type: "SWITCH", elem_width: 6, ...isEditOptionConfig() }],
|
|
22
|
+
[EditAbleField.REQUIRED, { alias: "\u662F\u5426\u5FC5\u586B", html_type: "SWITCH", elem_width: 6, ...isNullOptionConfig() }]
|
|
23
23
|
]);
|
|
24
24
|
function generateFieldListByKeys(keyList) {
|
|
25
25
|
return keyList.map((key) => {
|
|
@@ -112,7 +112,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
112
112
|
lifeCycle: {
|
|
113
113
|
type: import("vue").PropType<Partial<{
|
|
114
114
|
onSetup(): void;
|
|
115
|
-
beforeRequest(fieldKey: string, params?: import("../../../es/src/types").AnyObject | undefined): void | import("../../../es/src/types").
|
|
115
|
+
beforeRequest(fieldKey: string, params?: import("../../../es/src/types").AnyObject | undefined): void | import("../../../es/src/types").UndefinedAble<import("../../../es/src/types").AnyObject>;
|
|
116
116
|
afterRequest(fieldKey: string, payload?: any): import("../../../es/src/types").AnyObject[];
|
|
117
117
|
}>>;
|
|
118
118
|
};
|
|
@@ -227,7 +227,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
227
227
|
lifeCycle: {
|
|
228
228
|
type: import("vue").PropType<Partial<{
|
|
229
229
|
onSetup(): void;
|
|
230
|
-
beforeRequest(fieldKey: string, params?: import("../../../es/src/types").AnyObject | undefined): void | import("../../../es/src/types").
|
|
230
|
+
beforeRequest(fieldKey: string, params?: import("../../../es/src/types").AnyObject | undefined): void | import("../../../es/src/types").UndefinedAble<import("../../../es/src/types").AnyObject>;
|
|
231
231
|
afterRequest(fieldKey: string, payload?: any): import("../../../es/src/types").AnyObject[];
|
|
232
232
|
}>>;
|
|
233
233
|
};
|
|
@@ -1729,7 +1729,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1729
1729
|
lifeCycle: {
|
|
1730
1730
|
type: import("vue").PropType<Partial<{
|
|
1731
1731
|
onSetup(): void;
|
|
1732
|
-
beforeRequest(fieldKey: string, params?: import("../../../es/src/types").AnyObject | undefined): void | import("../../../es/src/types").
|
|
1732
|
+
beforeRequest(fieldKey: string, params?: import("../../../es/src/types").AnyObject | undefined): void | import("../../../es/src/types").UndefinedAble<import("../../../es/src/types").AnyObject>;
|
|
1733
1733
|
afterRequest(fieldKey: string, payload?: any): import("../../../es/src/types").AnyObject[];
|
|
1734
1734
|
}>>;
|
|
1735
1735
|
};
|
|
@@ -7,7 +7,7 @@ export { useCommonLog } from './src/hooks/useCommonLog.js';
|
|
|
7
7
|
export { useFormField } from './src/hooks/useFormField.js';
|
|
8
8
|
export { AsyncQueue, useAsyncQueue } from './src/hooks/useAsyncQueue.js';
|
|
9
9
|
export { useFieldVisitor } from './src/hooks/useFieldVisitor.js';
|
|
10
|
-
export {
|
|
10
|
+
export { useFieldNormalize } from './src/hooks/useFieldNormalize.js';
|
|
11
11
|
export { useFormValidator } from './src/hooks/useFormValidator.js';
|
|
12
12
|
export { BusinessCollector, useBusinessBinding } from './src/hooks/useBusinessBinding.js';
|
|
13
13
|
export { ContextCollector, useChangeContext } from './src/hooks/useChangeContext.js';
|
|
@@ -25,7 +25,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
25
25
|
fieldList: { type: Array },
|
|
26
26
|
initialData: { type: Object, default: () => ({}) },
|
|
27
27
|
fieldVisitor: { type: Object },
|
|
28
|
-
column: { type: Number, default:
|
|
28
|
+
column: { type: Number, default: 24 },
|
|
29
29
|
maxHeight: { type: [Number, String], default: "" },
|
|
30
30
|
anchor: { type: Boolean, default: false },
|
|
31
31
|
parallelism: { type: Number, default: 3 },
|
|
@@ -112,7 +112,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
112
112
|
lifeCycle: {
|
|
113
113
|
type: PropType<Partial<{
|
|
114
114
|
onSetup(): void;
|
|
115
|
-
beforeRequest(fieldKey: string, params?: AnyObject | undefined): void | import("../../../../es/src/types").
|
|
115
|
+
beforeRequest(fieldKey: string, params?: AnyObject | undefined): void | import("../../../../es/src/types").UndefinedAble<AnyObject>;
|
|
116
116
|
afterRequest(fieldKey: string, payload?: any): AnyObject[];
|
|
117
117
|
}>>;
|
|
118
118
|
};
|
|
@@ -227,7 +227,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
227
227
|
lifeCycle: {
|
|
228
228
|
type: PropType<Partial<{
|
|
229
229
|
onSetup(): void;
|
|
230
|
-
beforeRequest(fieldKey: string, params?: AnyObject | undefined): void | import("../../../../es/src/types").
|
|
230
|
+
beforeRequest(fieldKey: string, params?: AnyObject | undefined): void | import("../../../../es/src/types").UndefinedAble<AnyObject>;
|
|
231
231
|
afterRequest(fieldKey: string, payload?: any): AnyObject[];
|
|
232
232
|
}>>;
|
|
233
233
|
};
|
|
@@ -1729,7 +1729,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1729
1729
|
lifeCycle: {
|
|
1730
1730
|
type: PropType<Partial<{
|
|
1731
1731
|
onSetup(): void;
|
|
1732
|
-
beforeRequest(fieldKey: string, params?: AnyObject | undefined): void | import("../../../../es/src/types").
|
|
1732
|
+
beforeRequest(fieldKey: string, params?: AnyObject | undefined): void | import("../../../../es/src/types").UndefinedAble<AnyObject>;
|
|
1733
1733
|
afterRequest(fieldKey: string, payload?: any): AnyObject[];
|
|
1734
1734
|
}>>;
|
|
1735
1735
|
};
|
|
@@ -64,14 +64,13 @@ const script = defineComponent({
|
|
|
64
64
|
const FORM_ITEM = connect(script, mapProps({
|
|
65
65
|
title: "label"
|
|
66
66
|
}, (props, field) => {
|
|
67
|
-
var _a;
|
|
68
67
|
const feedback = !isVoidField(field) ? field.selfErrors.length ? field.selfErrors.join(",") : void 0 : void 0;
|
|
69
68
|
return {
|
|
70
69
|
...props,
|
|
71
70
|
required: isVoidField(field) ? void 0 : field.required,
|
|
72
71
|
class: "form-render__formItem",
|
|
73
72
|
style: {
|
|
74
|
-
"--form-item-column":
|
|
73
|
+
"--form-item-column": props.span
|
|
75
74
|
},
|
|
76
75
|
feedback,
|
|
77
76
|
"validation-status": feedback ? "error" : void 0
|
|
@@ -2,7 +2,7 @@ import { connect, mapProps } from '@formily/vue';
|
|
|
2
2
|
import { NInputGroup } from 'naive-ui';
|
|
3
3
|
|
|
4
4
|
const INPUT_GROUP = connect(NInputGroup, mapProps((props) => {
|
|
5
|
-
return { style: { "--column": props.span
|
|
5
|
+
return { style: { "--column": props.span }, class: "form-render__inputGroup" };
|
|
6
6
|
}));
|
|
7
7
|
|
|
8
8
|
export { INPUT_GROUP };
|
|
@@ -72,12 +72,12 @@ const script = defineComponent({
|
|
|
72
72
|
try {
|
|
73
73
|
traverseDependKey(config.dependKey, (dependKey, valueKey2, required) => {
|
|
74
74
|
const _field = field2.query(dependKey).take();
|
|
75
|
-
if (isField(_field))
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
_params[valueKey2] = _field.value;
|
|
75
|
+
if (!isField(_field))
|
|
76
|
+
return;
|
|
77
|
+
if (required && _field.value == null) {
|
|
78
|
+
throw `\u7F3A\u5C11\u5FC5\u987B\u7684\u53C2\u6570=>${dependKey}`;
|
|
80
79
|
}
|
|
80
|
+
_params[valueKey2] = _field.value;
|
|
81
81
|
});
|
|
82
82
|
} catch (e) {
|
|
83
83
|
return Promise.reject(e);
|
|
@@ -105,11 +105,14 @@ const script = defineComponent({
|
|
|
105
105
|
}
|
|
106
106
|
});
|
|
107
107
|
const changeContextCollector = inject(InjectionChangeContextCollector);
|
|
108
|
-
changeContextCollector
|
|
108
|
+
changeContextCollector.setContext(fieldKey.value, async () => {
|
|
109
109
|
await nextTick();
|
|
110
110
|
return {
|
|
111
|
-
currentOption: cloneDeep(
|
|
111
|
+
currentOption: cloneDeep(getCurrentOption())
|
|
112
112
|
};
|
|
113
|
+
function getCurrentOption() {
|
|
114
|
+
return parsedOptions.value.find((option) => option[valueKey.value] === valueRef.value);
|
|
115
|
+
}
|
|
113
116
|
});
|
|
114
117
|
const formItemDepsCollector = inject(InjectionFormItemDepsCollector);
|
|
115
118
|
watch(() => props.urlConfig, (config, oldConfig) => {
|
|
@@ -120,7 +123,7 @@ const script = defineComponent({
|
|
|
120
123
|
return;
|
|
121
124
|
formItemDepsCollector.setDeps(fieldKey.value, config.dependKey || [], async () => {
|
|
122
125
|
remoteOptions.value = null;
|
|
123
|
-
|
|
126
|
+
valueRef.value = null;
|
|
124
127
|
!props.lazyRequest && await fetchData();
|
|
125
128
|
});
|
|
126
129
|
(valueRef.value || !props.lazyRequest) && fetchData();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Nullable } from '../../../../../es/src/types';
|
|
2
2
|
import { ContextCollector } from '../../../../../es/packages/form-render/src/hooks/useChangeContext';
|
|
3
3
|
import { BusinessCollector, FormItemDepsCollector } from '../hooks';
|
|
4
4
|
import { FormAsyncQueue } from '../types';
|
|
@@ -9,7 +9,7 @@ export declare const InjectionBusinessCollector: InjectionKey<BusinessCollector>
|
|
|
9
9
|
export declare const InjectionChangeContextCollector: InjectionKey<ContextCollector>;
|
|
10
10
|
export declare const InjectionFormItemDepsCollector: InjectionKey<FormItemDepsCollector>;
|
|
11
11
|
export declare const InjectionFormUUID: InjectionKey<string>;
|
|
12
|
-
export declare const InjectionAnnotation: InjectionKey<WritableComputedRef<
|
|
12
|
+
export declare const InjectionAnnotation: InjectionKey<WritableComputedRef<Nullable<Record<string, string>>>>;
|
|
13
13
|
export declare const FormItemLineBarDepKeyPrepend = "__dep_LINEBAR_";
|
|
14
14
|
export declare enum FIELD_BUSINESS_TYPE {
|
|
15
15
|
PASSWORD = "password",
|
|
@@ -4,7 +4,7 @@ export * from './useCommonLog';
|
|
|
4
4
|
export * from './useFormField';
|
|
5
5
|
export * from './useAsyncQueue';
|
|
6
6
|
export * from './useFieldVisitor';
|
|
7
|
-
export * from './
|
|
7
|
+
export * from './useFieldNormalize';
|
|
8
8
|
export * from './useFormValidator';
|
|
9
9
|
export * from './useBusinessBinding';
|
|
10
10
|
export * from './useChangeContext';
|
|
@@ -4,7 +4,7 @@ export { useCommonLog } from './useCommonLog.js';
|
|
|
4
4
|
export { useFormField } from './useFormField.js';
|
|
5
5
|
export { AsyncQueue, useAsyncQueue } from './useAsyncQueue.js';
|
|
6
6
|
export { useFieldVisitor } from './useFieldVisitor.js';
|
|
7
|
-
export {
|
|
7
|
+
export { useFieldNormalize } from './useFieldNormalize.js';
|
|
8
8
|
export { useFormValidator } from './useFormValidator.js';
|
|
9
9
|
export { BusinessCollector, useBusinessBinding } from './useBusinessBinding.js';
|
|
10
10
|
export { ContextCollector, useChangeContext } from './useChangeContext.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UndefinedAble } from '../../../../../es/src/types';
|
|
2
2
|
import { ISchema } from '@formily/json-schema/esm/types';
|
|
3
3
|
import { Ref } from 'vue';
|
|
4
4
|
import { FormItemDepsCollector, FormRenderProps } from '../../../../../es/packages/form-render';
|
|
5
|
-
export declare function useAnchor(props: Readonly<FormRenderProps>, scrollbarRef: Ref<
|
|
5
|
+
export declare function useAnchor(props: Readonly<FormRenderProps>, scrollbarRef: Ref<UndefinedAble<HTMLElement>>, collector: FormItemDepsCollector): {
|
|
6
6
|
currentAnchor: import("vue").WritableComputedRef<string>;
|
|
7
7
|
onScroll: () => void;
|
|
8
8
|
formHeight: import("vue").ComputedRef<string | undefined>;
|
|
@@ -11,6 +11,6 @@ export declare function useAnchor(props: Readonly<FormRenderProps>, scrollbarRef
|
|
|
11
11
|
title: string;
|
|
12
12
|
}[]>;
|
|
13
13
|
generateAnchorList: (schema: ISchema) => void;
|
|
14
|
-
scrollbarRef: Ref<
|
|
14
|
+
scrollbarRef: Ref<UndefinedAble<HTMLElement>>;
|
|
15
15
|
scrollTo: (id: string) => Promise<void>;
|
|
16
16
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AnyObject,
|
|
1
|
+
import { AnyObject, UndefinedAble } from '../../../../../es/src/types';
|
|
2
2
|
import { FormAsyncQueueItem } from '../types';
|
|
3
3
|
declare type ProcessorOption = Partial<{
|
|
4
4
|
afterRequest(key: string, payload?: unknown): AnyObject[];
|
|
5
|
-
beforeRequest(key: string, params?: unknown):
|
|
5
|
+
beforeRequest(key: string, params?: unknown): UndefinedAble<AnyObject> | void;
|
|
6
6
|
}>;
|
|
7
7
|
interface EntryCallback {
|
|
8
8
|
(err?: any, result?: any): void;
|
|
@@ -12,12 +12,11 @@ export declare class BusinessCollector {
|
|
|
12
12
|
private getField;
|
|
13
13
|
private getType;
|
|
14
14
|
private getValueByField;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
private
|
|
20
|
-
private handlerChangeMap;
|
|
15
|
+
getValueByType(type: FIELD_BUSINESS_TYPE): unknown;
|
|
16
|
+
setValueByType(type: FIELD_BUSINESS_TYPE, value: unknown, force?: boolean): void;
|
|
17
|
+
registerChangeBusiness(type: FIELD_BUSINESS_TYPE, handler: () => void): this;
|
|
18
|
+
registerBlurBusiness(type: FIELD_BUSINESS_TYPE, handler: () => void): this;
|
|
19
|
+
private changeHandlerMap;
|
|
21
20
|
private blurHandlerMap;
|
|
22
21
|
trigger(fieldName: string, triggerType?: 'change' | 'blur'): void;
|
|
23
22
|
}
|
|
@@ -10,14 +10,8 @@ class BusinessCollector {
|
|
|
10
10
|
this.businessFormatter = businessFormatter;
|
|
11
11
|
this.typeCollector = /* @__PURE__ */ new Map();
|
|
12
12
|
this.fieldNameCollector = /* @__PURE__ */ new Map();
|
|
13
|
-
this.
|
|
14
|
-
|
|
15
|
-
[FIELD_BUSINESS_TYPE.AGE_UNIT, this.handlerAgeType.bind(this)]
|
|
16
|
-
]);
|
|
17
|
-
this.blurHandlerMap = /* @__PURE__ */ new Map([
|
|
18
|
-
[FIELD_BUSINESS_TYPE.BIRTHDAY, this.handlerBirthdayType.bind(this)],
|
|
19
|
-
[FIELD_BUSINESS_TYPE.AGE, this.handlerAgeType.bind(this)]
|
|
20
|
-
]);
|
|
13
|
+
this.changeHandlerMap = /* @__PURE__ */ new Map([]);
|
|
14
|
+
this.blurHandlerMap = /* @__PURE__ */ new Map([]);
|
|
21
15
|
}
|
|
22
16
|
formatter(...args) {
|
|
23
17
|
return isFunction(this.businessFormatter) ? this.businessFormatter(...args) : args[0].value;
|
|
@@ -48,7 +42,23 @@ class BusinessCollector {
|
|
|
48
42
|
state.value = this.formatter({ value, type, fieldKey: field });
|
|
49
43
|
});
|
|
50
44
|
}
|
|
51
|
-
|
|
45
|
+
registerChangeBusiness(type, handler) {
|
|
46
|
+
this.changeHandlerMap.set(type, handler);
|
|
47
|
+
return this;
|
|
48
|
+
}
|
|
49
|
+
registerBlurBusiness(type, handler) {
|
|
50
|
+
this.blurHandlerMap.set(type, handler);
|
|
51
|
+
return this;
|
|
52
|
+
}
|
|
53
|
+
trigger(fieldName, triggerType = "change") {
|
|
54
|
+
var _a, _b;
|
|
55
|
+
const type = this.getType(fieldName);
|
|
56
|
+
const handlerMaps = { change: this.changeHandlerMap, blur: this.blurHandlerMap };
|
|
57
|
+
type && ((_b = (_a = handlerMaps[triggerType]) == null ? void 0 : _a.get(type)) == null ? void 0 : _b.call(this));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function useBusinessBinding() {
|
|
61
|
+
function handlerIdCardType() {
|
|
52
62
|
const idCard = this.getValueByType(FIELD_BUSINESS_TYPE.ID_CARD);
|
|
53
63
|
if (!idCard || !isString(idCard) || !isIdCard(idCard))
|
|
54
64
|
return;
|
|
@@ -59,7 +69,7 @@ class BusinessCollector {
|
|
|
59
69
|
this.setValueByType(FIELD_BUSINESS_TYPE.SEX, info.sex);
|
|
60
70
|
this.setValueByType(FIELD_BUSINESS_TYPE.BIRTHDAY, info.birthday);
|
|
61
71
|
}
|
|
62
|
-
handlerBirthdayType() {
|
|
72
|
+
function handlerBirthdayType() {
|
|
63
73
|
const birthday = this.getValueByType(FIELD_BUSINESS_TYPE.BIRTHDAY);
|
|
64
74
|
if (!isString(birthday))
|
|
65
75
|
return;
|
|
@@ -67,7 +77,7 @@ class BusinessCollector {
|
|
|
67
77
|
this.setValueByType(FIELD_BUSINESS_TYPE.AGE_UNIT, ageUnit);
|
|
68
78
|
this.setValueByType(FIELD_BUSINESS_TYPE.AGE, age);
|
|
69
79
|
}
|
|
70
|
-
handlerAgeType() {
|
|
80
|
+
function handlerAgeType() {
|
|
71
81
|
const age = this.getValueByType(FIELD_BUSINESS_TYPE.AGE);
|
|
72
82
|
const ageUnit = this.getValueByType(FIELD_BUSINESS_TYPE.AGE_UNIT);
|
|
73
83
|
if (!isString(age) && !isNumber(age) || age === "")
|
|
@@ -76,16 +86,8 @@ class BusinessCollector {
|
|
|
76
86
|
return;
|
|
77
87
|
this.setValueByType(FIELD_BUSINESS_TYPE.BIRTHDAY, parseAge2Birthday(+age, ageUnit), false);
|
|
78
88
|
}
|
|
79
|
-
trigger(fieldName, triggerType = "change") {
|
|
80
|
-
var _a;
|
|
81
|
-
const type = this.getType(fieldName);
|
|
82
|
-
const handler = triggerType === "change" ? this.handlerChangeMap : triggerType === "blur" ? this.blurHandlerMap : null;
|
|
83
|
-
type && ((_a = handler == null ? void 0 : handler.get(type)) == null ? void 0 : _a());
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
function useBusinessBinding() {
|
|
87
89
|
function create(formModel, formatter) {
|
|
88
|
-
return new BusinessCollector(formModel, formatter);
|
|
90
|
+
return new BusinessCollector(formModel, formatter).registerChangeBusiness(FIELD_BUSINESS_TYPE.ID_CARD, handlerIdCardType).registerChangeBusiness(FIELD_BUSINESS_TYPE.AGE_UNIT, handlerAgeType).registerBlurBusiness(FIELD_BUSINESS_TYPE.BIRTHDAY, handlerBirthdayType).registerBlurBusiness(FIELD_BUSINESS_TYPE.AGE, handlerAgeType);
|
|
89
91
|
}
|
|
90
92
|
return { create };
|
|
91
93
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isObject } from '@vueuse/core';
|
|
2
|
-
import { pick } from 'lodash-es';
|
|
3
|
-
import { useFormValidator,
|
|
2
|
+
import { cloneDeep, pick } from 'lodash-es';
|
|
3
|
+
import { useFormValidator, useFieldNormalize } from '../../../../packages/form-render';
|
|
4
4
|
import { arrayed, parseNumberFromMaybeString, formRenderLog } from '../utils/index.js';
|
|
5
5
|
import { fieldKeyEscape, createLinebarId } from '../utils/schema.js';
|
|
6
6
|
import { transformDateFormat } from '../utils/business.js';
|
|
@@ -208,12 +208,12 @@ function useFieldListAdaptor(collector) {
|
|
|
208
208
|
properties: schemaAdaptor(fieldList)
|
|
209
209
|
};
|
|
210
210
|
};
|
|
211
|
-
const {
|
|
211
|
+
const { FieldNormalizeWaterfallHook } = useFieldNormalize();
|
|
212
212
|
function schemaAdaptor(fieldList) {
|
|
213
213
|
let prevLinebar = null;
|
|
214
214
|
return fieldList.reduce((fin, cur, idx) => {
|
|
215
215
|
var _a;
|
|
216
|
-
|
|
216
|
+
cur = FieldNormalizeWaterfallHook.call(cloneDeep(cur));
|
|
217
217
|
const obj_type = (_a = cur.validate) == null ? void 0 : _a.obj_type;
|
|
218
218
|
obj_type && collector.collect(obj_type, cur.val_key);
|
|
219
219
|
if (cur.html_type === "LINEBAR") {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SyncWaterfallHook } from '../../../../../es/src/utils/tapable';
|
|
2
|
+
import { FieldItem } from '../types';
|
|
3
|
+
export declare function useFieldNormalize(): {
|
|
4
|
+
FieldNormalizeWaterfallHook: SyncWaterfallHook<FieldItem, import("../../../../../es/src/utils/tapable").UnsetAdditionalOptions>;
|
|
5
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { SyncWaterfallHook } from '../../../../src/utils/tapable';
|
|
2
|
+
import { FIELD_BUSINESS_TYPE } from '../../../../packages/form-render/src/constants';
|
|
3
|
+
|
|
4
|
+
function useFieldNormalize() {
|
|
5
|
+
const FieldNormalizeWaterfallHook = new SyncWaterfallHook(["fieldItem"]);
|
|
6
|
+
FieldNormalizeWaterfallHook.tap("__block", (fieldItem) => {
|
|
7
|
+
if (["CHECKBOX_BLOCK", "RADIO_BLOCK"].includes(fieldItem.html_type)) {
|
|
8
|
+
fieldItem.__vertical = true;
|
|
9
|
+
}
|
|
10
|
+
return fieldItem;
|
|
11
|
+
});
|
|
12
|
+
FieldNormalizeWaterfallHook.tap("__line", (fieldItem) => {
|
|
13
|
+
if (["LINE_BREAKS"].includes(fieldItem.html_type)) {
|
|
14
|
+
fieldItem.__line = true;
|
|
15
|
+
fieldItem.is_show = "1";
|
|
16
|
+
}
|
|
17
|
+
return fieldItem;
|
|
18
|
+
});
|
|
19
|
+
FieldNormalizeWaterfallHook.tap("__age", (fieldItem) => {
|
|
20
|
+
if (fieldItem.html_type === "AGE") {
|
|
21
|
+
fieldItem.html_type = "INPUT_NUMBER";
|
|
22
|
+
fieldItem.suffixConfig = [
|
|
23
|
+
{
|
|
24
|
+
validate: { obj_type: FIELD_BUSINESS_TYPE.AGE_UNIT },
|
|
25
|
+
val_key: fieldItem.val_key_unit,
|
|
26
|
+
html_type: "SELECT",
|
|
27
|
+
option: fieldItem.option,
|
|
28
|
+
urlConfig: fieldItem.urlConfig
|
|
29
|
+
}
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
return fieldItem;
|
|
33
|
+
});
|
|
34
|
+
const types = [
|
|
35
|
+
[["SEARCH", "PHONE_TYPE", "IDCARD_TYPE"], "SELECT"],
|
|
36
|
+
["DIGITAL", "INPUT_NUMBER"],
|
|
37
|
+
["CHECKBOX_BLOCK", "CHECKBOX"],
|
|
38
|
+
["RADIO_BLOCK", "RADIO"],
|
|
39
|
+
[["DATE-INPUT", "DATETIME-INPUT"], "DATE"],
|
|
40
|
+
["SWITCH_COMPONENT", "SWITCH"],
|
|
41
|
+
["SLIDER_COMPONENT", "SLIDER"],
|
|
42
|
+
["LINE_BREAKS", "LINEBAR"]
|
|
43
|
+
];
|
|
44
|
+
FieldNormalizeWaterfallHook.tap("__normalize", (fieldItem) => {
|
|
45
|
+
types.some(([rule, target]) => {
|
|
46
|
+
const match = Array.isArray(rule) ? rule.includes(fieldItem.html_type) : rule === fieldItem.html_type;
|
|
47
|
+
return match && (fieldItem.html_type = target);
|
|
48
|
+
});
|
|
49
|
+
return fieldItem;
|
|
50
|
+
});
|
|
51
|
+
FieldNormalizeWaterfallHook.tap("__elem_width", (fieldItem) => {
|
|
52
|
+
fieldItem.elem_width = ~~((fieldItem.elem_width || 3) * 2);
|
|
53
|
+
return fieldItem;
|
|
54
|
+
});
|
|
55
|
+
return { FieldNormalizeWaterfallHook };
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export { useFieldNormalize };
|
|
@@ -3,8 +3,6 @@ import { isFunction } from '@vueuse/core';
|
|
|
3
3
|
|
|
4
4
|
function useFieldVisitor() {
|
|
5
5
|
function traverse(fieldList, visitorMap, key = "val_key") {
|
|
6
|
-
if (!visitorMap)
|
|
7
|
-
return fieldList;
|
|
8
6
|
return fieldList.reduce((fin, field) => {
|
|
9
7
|
if (Array.isArray(field.children)) {
|
|
10
8
|
field.children = traverse(field.children, visitorMap, key);
|
|
@@ -15,7 +13,7 @@ function useFieldVisitor() {
|
|
|
15
13
|
if (field.suffixConfig) {
|
|
16
14
|
field.suffixConfig = traverse(arrayed(field.suffixConfig), visitorMap, key);
|
|
17
15
|
}
|
|
18
|
-
const visitor = visitorMap[field[key]];
|
|
16
|
+
const visitor = visitorMap == null ? void 0 : visitorMap[field[key]];
|
|
19
17
|
let current = field;
|
|
20
18
|
const before = [];
|
|
21
19
|
const after = [];
|
|
@@ -31,8 +29,7 @@ function useFieldVisitor() {
|
|
|
31
29
|
after.push(...arrayed(field2));
|
|
32
30
|
}
|
|
33
31
|
});
|
|
34
|
-
fin.
|
|
35
|
-
return fin;
|
|
32
|
+
return fin.concat([...before, current, ...after]);
|
|
36
33
|
}, []);
|
|
37
34
|
}
|
|
38
35
|
return { traverse };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UndefinedAble } from '../../../../../es/src/types';
|
|
2
2
|
import { FormRenderLifeCycle, FormRenderProps } from '../../../../../es/packages/form-render';
|
|
3
3
|
export declare function useFormRenderLifeCycle(props: FormRenderProps): {
|
|
4
4
|
callLifeCycle: <T extends "onSetup" | "beforeRequest" | "afterRequest">(lifeCycleName: T, payload?: Parameters<Required<Partial<{
|
|
5
5
|
onSetup(): void;
|
|
6
|
-
beforeRequest(fieldKey: string, params?: import("../../../../../es/src/types").AnyObject | undefined): void |
|
|
6
|
+
beforeRequest(fieldKey: string, params?: import("../../../../../es/src/types").AnyObject | undefined): void | UndefinedAble<import("../../../../../es/src/types").AnyObject>;
|
|
7
7
|
afterRequest(fieldKey: string, payload?: any): import("../../../../../es/src/types").AnyObject[];
|
|
8
|
-
}>>[T]> | undefined) =>
|
|
8
|
+
}>>[T]> | undefined) => UndefinedAble<ReturnType<Required<Partial<{
|
|
9
9
|
onSetup(): void;
|
|
10
|
-
beforeRequest(fieldKey: string, params?: import("../../../../../es/src/types").AnyObject | undefined): void |
|
|
10
|
+
beforeRequest(fieldKey: string, params?: import("../../../../../es/src/types").AnyObject | undefined): void | UndefinedAble<import("../../../../../es/src/types").AnyObject>;
|
|
11
11
|
afterRequest(fieldKey: string, payload?: any): import("../../../../../es/src/types").AnyObject[];
|
|
12
12
|
}>>[T]>>;
|
|
13
13
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Func,
|
|
1
|
+
import { Func, Nullable } from '../../../../../es/src/types';
|
|
2
2
|
declare type RequestInstance = Record<string, Func>;
|
|
3
3
|
export declare function useFormRequest(): {
|
|
4
|
-
getHttpInstance: () =>
|
|
4
|
+
getHttpInstance: () => Nullable<RequestInstance>;
|
|
5
5
|
registGlobHttpInstance: (instance: RequestInstance) => void;
|
|
6
6
|
};
|
|
7
7
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyObject,
|
|
1
|
+
import { AnyObject, UndefinedAble } from '../../../../../es/src/types';
|
|
2
2
|
import { DataField, Field } from '@formily/core';
|
|
3
3
|
import { ISchema } from '@formily/json-schema/esm/types';
|
|
4
4
|
import { Component, FunctionalComponent } from 'vue';
|
|
@@ -52,7 +52,7 @@ export declare type DependKeyType = string | Record<string, string> | Array<{
|
|
|
52
52
|
} | string>;
|
|
53
53
|
export declare type FormRenderLifeCycle = Partial<{
|
|
54
54
|
onSetup(): void;
|
|
55
|
-
beforeRequest(fieldKey: string, params?: AnyObject):
|
|
55
|
+
beforeRequest(fieldKey: string, params?: AnyObject): UndefinedAble<AnyObject> | void;
|
|
56
56
|
afterRequest(fieldKey: string, payload?: any): AnyObject[];
|
|
57
57
|
}>;
|
|
58
58
|
export declare type FormRenderProps = Partial<{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Nullable } from '../../../../../es/src/types';
|
|
2
2
|
export declare function queryDecorator(key: string, wrapperElement: HTMLElement, formUUID: string): HTMLElement | null;
|
|
3
|
-
export declare function queryInput(decoratorElement?:
|
|
3
|
+
export declare function queryInput(decoratorElement?: Nullable<HTMLElement>): {
|
|
4
4
|
widgetElement: HTMLInputElement | null | undefined;
|
|
5
5
|
widgetElementList: HTMLInputElement[];
|
|
6
6
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyObject
|
|
1
|
+
import { AnyObject } from '../../../../../es/src/types';
|
|
2
2
|
import { GeneralField } from '@formily/core';
|
|
3
3
|
import { ISchema } from '@formily/json-schema/esm/types';
|
|
4
4
|
import { DependKeyType, FieldItem } from '../../../../../es/packages/form-render';
|
|
@@ -9,7 +9,7 @@ export declare function createLinebarId(id: string): string;
|
|
|
9
9
|
export declare function traverseDependKey(dependKeys: DependKeyType, handler: {
|
|
10
10
|
(dependKey: string, valueKey: string, required?: boolean): void;
|
|
11
11
|
}): void;
|
|
12
|
-
export declare function getParentLinebar(key: string, fieldList: FieldItem[]):
|
|
12
|
+
export declare function getParentLinebar(key: string, fieldList: FieldItem[]): string | null;
|
|
13
13
|
export declare function assignUpdateValue(props: AnyObject, field: GeneralField): {
|
|
14
14
|
[x: string]: any;
|
|
15
15
|
};
|
package/es/packages/index.js
CHANGED
|
@@ -46,7 +46,7 @@ export { useCommonLog } from './form-render/src/hooks/useCommonLog.js';
|
|
|
46
46
|
export { useFormField } from './form-render/src/hooks/useFormField.js';
|
|
47
47
|
export { AsyncQueue, useAsyncQueue } from './form-render/src/hooks/useAsyncQueue.js';
|
|
48
48
|
export { useFieldVisitor } from './form-render/src/hooks/useFieldVisitor.js';
|
|
49
|
-
export {
|
|
49
|
+
export { useFieldNormalize } from './form-render/src/hooks/useFieldNormalize.js';
|
|
50
50
|
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';
|
|
@@ -1808,7 +1808,7 @@ declare const ShortcutSetter: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1808
1808
|
lifeCycle: {
|
|
1809
1809
|
type: import("vue").PropType<Partial<{
|
|
1810
1810
|
onSetup(): void;
|
|
1811
|
-
beforeRequest(fieldKey: string, params?: import("../../../es/src/types").AnyObject | undefined): void | import("../../../es/src/types").
|
|
1811
|
+
beforeRequest(fieldKey: string, params?: import("../../../es/src/types").AnyObject | undefined): void | import("../../../es/src/types").UndefinedAble<import("../../../es/src/types").AnyObject>;
|
|
1812
1812
|
afterRequest(fieldKey: string, payload?: any): import("../../../es/src/types").AnyObject[];
|
|
1813
1813
|
}>>;
|
|
1814
1814
|
};
|
|
@@ -1923,7 +1923,7 @@ declare const ShortcutSetter: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1923
1923
|
lifeCycle: {
|
|
1924
1924
|
type: import("vue").PropType<Partial<{
|
|
1925
1925
|
onSetup(): void;
|
|
1926
|
-
beforeRequest(fieldKey: string, params?: import("../../../es/src/types").AnyObject | undefined): void | import("../../../es/src/types").
|
|
1926
|
+
beforeRequest(fieldKey: string, params?: import("../../../es/src/types").AnyObject | undefined): void | import("../../../es/src/types").UndefinedAble<import("../../../es/src/types").AnyObject>;
|
|
1927
1927
|
afterRequest(fieldKey: string, payload?: any): import("../../../es/src/types").AnyObject[];
|
|
1928
1928
|
}>>;
|
|
1929
1929
|
};
|
|
@@ -3425,7 +3425,7 @@ declare const ShortcutSetter: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
3425
3425
|
lifeCycle: {
|
|
3426
3426
|
type: import("vue").PropType<Partial<{
|
|
3427
3427
|
onSetup(): void;
|
|
3428
|
-
beforeRequest(fieldKey: string, params?: import("../../../es/src/types").AnyObject | undefined): void | import("../../../es/src/types").
|
|
3428
|
+
beforeRequest(fieldKey: string, params?: import("../../../es/src/types").AnyObject | undefined): void | import("../../../es/src/types").UndefinedAble<import("../../../es/src/types").AnyObject>;
|
|
3429
3429
|
afterRequest(fieldKey: string, payload?: any): import("../../../es/src/types").AnyObject[];
|
|
3430
3430
|
}>>;
|
|
3431
3431
|
};
|
|
@@ -1810,7 +1810,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1810
1810
|
lifeCycle: {
|
|
1811
1811
|
type: import("vue").PropType<Partial<{
|
|
1812
1812
|
onSetup(): void;
|
|
1813
|
-
beforeRequest(fieldKey: string, params?: import("../../../../es/src/types").AnyObject | undefined): void | import("../../../../es/src/types").
|
|
1813
|
+
beforeRequest(fieldKey: string, params?: import("../../../../es/src/types").AnyObject | undefined): void | import("../../../../es/src/types").UndefinedAble<import("../../../../es/src/types").AnyObject>;
|
|
1814
1814
|
afterRequest(fieldKey: string, payload?: any): import("../../../../es/src/types").AnyObject[];
|
|
1815
1815
|
}>>;
|
|
1816
1816
|
};
|
|
@@ -1925,7 +1925,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1925
1925
|
lifeCycle: {
|
|
1926
1926
|
type: import("vue").PropType<Partial<{
|
|
1927
1927
|
onSetup(): void;
|
|
1928
|
-
beforeRequest(fieldKey: string, params?: import("../../../../es/src/types").AnyObject | undefined): void | import("../../../../es/src/types").
|
|
1928
|
+
beforeRequest(fieldKey: string, params?: import("../../../../es/src/types").AnyObject | undefined): void | import("../../../../es/src/types").UndefinedAble<import("../../../../es/src/types").AnyObject>;
|
|
1929
1929
|
afterRequest(fieldKey: string, payload?: any): import("../../../../es/src/types").AnyObject[];
|
|
1930
1930
|
}>>;
|
|
1931
1931
|
};
|
|
@@ -3427,7 +3427,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3427
3427
|
lifeCycle: {
|
|
3428
3428
|
type: import("vue").PropType<Partial<{
|
|
3429
3429
|
onSetup(): void;
|
|
3430
|
-
beforeRequest(fieldKey: string, params?: import("../../../../es/src/types").AnyObject | undefined): void | import("../../../../es/src/types").
|
|
3430
|
+
beforeRequest(fieldKey: string, params?: import("../../../../es/src/types").AnyObject | undefined): void | import("../../../../es/src/types").UndefinedAble<import("../../../../es/src/types").AnyObject>;
|
|
3431
3431
|
afterRequest(fieldKey: string, payload?: any): import("../../../../es/src/types").AnyObject[];
|
|
3432
3432
|
}>>;
|
|
3433
3433
|
};
|
package/es/src/types/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare type SFCWithInstall<T> = T & {
|
|
|
4
4
|
};
|
|
5
5
|
export declare type AnyObject = Record<string, any>;
|
|
6
6
|
export declare type Func<T extends Array<any> = any[], P = any> = (...args: T) => P;
|
|
7
|
-
export declare type
|
|
8
|
-
export declare type
|
|
7
|
+
export declare type Nullable<T> = T | null | undefined;
|
|
8
|
+
export declare type UndefinedAble<T> = T | undefined;
|
|
9
9
|
export declare type ArrayAble<T> = T | T[];
|
|
10
10
|
export declare type MapValue<T> = T extends Map<any, infer P> ? P : any;
|