cnhis-design-vue 3.1.16-beta.1 → 3.1.16-beta.12
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/index.d.ts +652 -430
- package/es/packages/big-table/src/BigTable.vue.d.ts +655 -457
- package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +106 -112
- package/es/packages/big-table/src/bigTableProps.d.ts +4 -0
- package/es/packages/big-table/src/bigTableProps.js +2 -1
- package/es/packages/big-table/src/bigTableState.d.ts +2 -0
- package/es/packages/big-table/src/bigTableState.js +3 -1
- package/es/packages/big-table/src/components/edit-form/edit-time.js +1 -1
- package/es/packages/big-table/src/hooks/index.d.ts +9 -0
- package/es/packages/big-table/src/hooks/index.js +9 -0
- package/es/packages/big-table/src/hooks/useAnchor.d.ts +7 -0
- package/es/packages/big-table/src/hooks/useAnchor.js +49 -0
- package/es/packages/big-table/src/hooks/useColumnConfigAdaptor.js +24 -8
- package/es/packages/big-table/src/hooks/useEdit.js +1 -1
- package/es/packages/big-table/src/hooks/useEvent.d.ts +1 -1
- package/es/packages/big-table/src/hooks/useEvent.js +3 -2
- package/es/packages/big-table/style/index.css +1 -2
- package/es/packages/button-print/index.d.ts +7 -4
- package/es/packages/button-print/src/ButtonPrint.vue.d.ts +7 -4
- package/es/packages/button-print/src/ButtonPrint.vue_vue_type_script_setup_true_lang.js +5 -16
- package/es/packages/button-print/src/components/IdentityVerification.js +5 -7
- package/es/packages/button-print/src/components/IdentityVerification.vue.d.ts +6 -3
- package/es/packages/drag-layout/index.d.ts +2 -2
- package/es/packages/drag-layout/src/DragLayout.vue.d.ts +2 -2
- package/es/packages/fabric-chart/src/FabricChart.js +3 -2
- package/es/packages/fabric-chart/src/hooks/constant.js +5 -5
- package/es/packages/fabric-chart/src/hooks/useCenter.js +20 -23
- package/es/packages/fabric-chart/src/hooks/useDraw.js +11 -4
- package/es/packages/fabric-chart/src/hooks/useEvent.js +11 -3
- package/es/packages/fabric-chart/src/hooks/useLeft.js +8 -4
- package/es/packages/fabric-chart/src/hooks/useOther.js +63 -13
- package/es/packages/fabric-chart/src/hooks/useTop.js +5 -8
- package/es/packages/field-set/index.d.ts +1 -1
- package/es/packages/field-set/src/FieldSet.vue.d.ts +1 -1
- package/es/packages/form-config/index.d.ts +110 -3367
- package/es/packages/form-config/src/FormConfig.js +42 -34
- package/es/packages/form-config/src/FormConfig.vue.d.ts +147 -3404
- package/es/packages/form-config/src/components/FormConfigCreator.js +13 -11
- package/es/packages/form-config/src/components/FormConfigCreator.vue.d.ts +23 -22
- package/es/packages/form-config/src/components/FormConfigEdit.js +2 -2
- package/es/packages/form-config/src/components/FormConfigEdit.vue.d.ts +75 -49
- package/es/packages/form-config/src/constants/index.d.ts +58 -24
- package/es/packages/form-config/src/constants/index.js +52 -23
- package/es/packages/form-config/src/hooks/index.d.ts +1 -0
- package/es/packages/form-config/src/hooks/index.js +1 -0
- package/es/packages/form-config/src/hooks/useConfigurationField.d.ts +2 -1
- package/es/packages/form-config/src/hooks/useConfigurationField.js +29 -80
- package/es/packages/form-config/src/hooks/usePresetRenderer.d.ts +2 -3
- package/es/packages/form-config/src/hooks/usePresetRenderer.js +16 -19
- package/es/packages/form-config/src/hooks/useSortable.js +1 -1
- package/es/packages/form-config/src/types/index.d.ts +22 -4
- package/es/packages/form-config/src/utils/index.d.ts +2 -0
- package/es/packages/form-config/src/utils/index.js +15 -0
- package/es/packages/form-config/style/index.css +27 -3
- package/es/packages/form-render/index.d.ts +13 -15
- package/es/packages/form-render/src/FormRender.js +11 -8
- package/es/packages/form-render/src/FormRender.vue.d.ts +14 -16
- package/es/packages/form-render/src/components/renderer/cascader.d.ts +2 -14
- package/es/packages/form-render/src/components/renderer/cascader.js +3 -3
- package/es/packages/form-render/src/components/renderer/checkbox.js +1 -1
- package/es/packages/form-render/src/components/renderer/combination/index.js +2 -1
- package/es/packages/form-render/src/components/renderer/complex.js +1 -1
- package/es/packages/form-render/src/components/renderer/date.d.ts +20 -4
- package/es/packages/form-render/src/components/renderer/date.js +36 -20
- package/es/packages/form-render/src/components/renderer/input.js +2 -1
- package/es/packages/form-render/src/components/renderer/inputNumber.js +2 -1
- package/es/packages/form-render/src/components/renderer/linebar.js +1 -4
- package/es/packages/form-render/src/components/renderer/radio.js +1 -1
- package/es/packages/form-render/src/components/renderer/select.d.ts +1 -10
- package/es/packages/form-render/src/components/renderer/select.js +26 -17
- package/es/packages/form-render/src/components/renderer/slider.d.ts +8 -344
- package/es/packages/form-render/src/components/renderer/slider.js +24 -2
- package/es/packages/form-render/src/components/renderer/switch.js +1 -1
- package/es/packages/form-render/src/components/renderer/textarea.js +1 -1
- package/es/packages/form-render/src/hooks/useAnchor.js +7 -4
- package/es/packages/form-render/src/hooks/useBusinessBinding.d.ts +15 -9
- package/es/packages/form-render/src/hooks/useBusinessBinding.js +62 -58
- package/es/packages/form-render/src/hooks/useChangeContext.d.ts +4 -2
- package/es/packages/form-render/src/hooks/useChangeContext.js +4 -7
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +17 -7
- package/es/packages/form-render/src/hooks/useFormContext.d.ts +2 -1
- package/es/packages/form-render/src/hooks/useFormContext.js +2 -2
- package/es/packages/form-render/src/hooks/useFormValidator.js +13 -3
- package/es/packages/form-render/src/hooks/useInitialData.d.ts +1 -1
- package/es/packages/form-render/src/hooks/useInitialData.js +9 -4
- package/es/packages/form-render/src/hooks/useTypeNormalize.js +3 -2
- package/es/packages/form-render/src/types/fieldItem.d.ts +11 -12
- package/es/packages/form-render/src/types/index.d.ts +7 -8
- package/es/packages/form-render/src/utils/business.d.ts +12 -0
- package/es/packages/form-render/src/utils/business.js +78 -0
- package/es/packages/form-render/src/utils/dom.d.ts +6 -0
- package/es/packages/form-render/src/utils/dom.js +14 -0
- package/es/packages/form-render/src/utils/index.d.ts +6 -26
- package/es/packages/form-render/src/utils/index.js +9 -138
- package/es/packages/form-render/src/utils/schema.d.ts +16 -0
- package/es/packages/form-render/src/utils/schema.js +94 -0
- package/es/packages/index.css +28 -5
- package/es/packages/scale-view/src/hooks/use-component.d.ts +7 -7
- package/es/packages/select-label/index.d.ts +10 -10
- package/es/packages/select-label/src/LabelFormContent.vue.d.ts +3 -3
- package/es/packages/select-label/src/SelectLabel.vue.d.ts +7 -7
- package/es/packages/shortcut-setter/index.d.ts +18 -20
- package/es/packages/shortcut-setter/src/ShortcutSetter.vue.d.ts +18 -20
- package/es/packages/time-line/index.d.ts +2 -2
- package/es/packages/time-line/src/TimeLine.vue.d.ts +2 -2
- package/global.d.ts +8 -8
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="lodash" />
|
|
2
2
|
import { AnyObject } from '../../../../es/src/types';
|
|
3
3
|
import { Component, FunctionalComponent, nextTick, PropType } from 'vue';
|
|
4
|
-
import { FieldItem, FieldVisitor,
|
|
4
|
+
import { FieldItem, FieldVisitor, FormBusinessFormatter } from './types';
|
|
5
5
|
declare const _default: import("vue").DefineComponent<{
|
|
6
6
|
fieldList: {
|
|
7
7
|
type: PropType<FieldItem[]>;
|
|
@@ -29,6 +29,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
29
29
|
type: NumberConstructor;
|
|
30
30
|
default: number;
|
|
31
31
|
};
|
|
32
|
+
businessFormatter: {
|
|
33
|
+
type: PropType<FormBusinessFormatter>;
|
|
34
|
+
};
|
|
32
35
|
schema: {
|
|
33
36
|
type: PropType<import("@formily/vue").Stringify<{
|
|
34
37
|
[key: symbol]: any;
|
|
@@ -92,9 +95,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
92
95
|
type: PropType<Record<string, Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | FunctionalComponent<{}, {}>>>;
|
|
93
96
|
default: () => {};
|
|
94
97
|
};
|
|
95
|
-
businessFilter: {
|
|
96
|
-
type: PropType<FormBusinessFilter>;
|
|
97
|
-
};
|
|
98
98
|
scope: {
|
|
99
99
|
type: PropType<AnyObject>;
|
|
100
100
|
default: () => {};
|
|
@@ -144,6 +144,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
144
144
|
type: NumberConstructor;
|
|
145
145
|
default: number;
|
|
146
146
|
};
|
|
147
|
+
businessFormatter: {
|
|
148
|
+
type: PropType<FormBusinessFormatter>;
|
|
149
|
+
};
|
|
147
150
|
schema: {
|
|
148
151
|
type: PropType<import("@formily/vue").Stringify<{
|
|
149
152
|
[key: symbol]: any;
|
|
@@ -207,9 +210,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
207
210
|
type: PropType<Record<string, Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | FunctionalComponent<{}, {}>>>;
|
|
208
211
|
default: () => {};
|
|
209
212
|
};
|
|
210
|
-
businessFilter: {
|
|
211
|
-
type: PropType<FormBusinessFilter>;
|
|
212
|
-
};
|
|
213
213
|
scope: {
|
|
214
214
|
type: PropType<AnyObject>;
|
|
215
215
|
default: () => {};
|
|
@@ -236,14 +236,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
236
236
|
}>>;
|
|
237
237
|
emit: (event: "formChange", ...args: any[]) => void;
|
|
238
238
|
nuiThemeOverrides: import("naive-ui").GlobalThemeOverrides;
|
|
239
|
+
formModel: import("@formily/core").Form<any>;
|
|
239
240
|
SchemaField: Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>;
|
|
240
241
|
businessCollector: import("./hooks").BusinessCollector;
|
|
241
242
|
formItemDepsCollector: import("./hooks").FormItemDepsCollector;
|
|
242
243
|
changeContextCollector: import("./hooks").ContextCollector;
|
|
243
244
|
formUUID: string;
|
|
244
|
-
formModel: import("@formily/core").Form<{
|
|
245
|
-
[x: string]: any;
|
|
246
|
-
}>;
|
|
247
245
|
scrollbarRef: import("vue").Ref<HTMLElement | undefined>;
|
|
248
246
|
schemaAdaptor: (fieldList: FieldItem[]) => Record<string, import("@formily/vue").Stringify<{
|
|
249
247
|
[key: symbol]: any;
|
|
@@ -759,7 +757,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
759
757
|
readonly default: "bar";
|
|
760
758
|
};
|
|
761
759
|
readonly closable: BooleanConstructor;
|
|
762
|
-
readonly justifyContent: PropType<"
|
|
760
|
+
readonly justifyContent: PropType<"start" | "end" | "space-around" | "space-between" | "space-evenly" | "center">;
|
|
763
761
|
readonly size: {
|
|
764
762
|
readonly type: PropType<"small" | "medium" | "large">;
|
|
765
763
|
readonly default: "medium";
|
|
@@ -1035,7 +1033,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1035
1033
|
addTabFixed: import("vue").Ref<boolean>;
|
|
1036
1034
|
tabWrapperStyle: import("vue").ComputedRef<{
|
|
1037
1035
|
display: string;
|
|
1038
|
-
justifyContent: "
|
|
1036
|
+
justifyContent: "start" | "end" | "space-around" | "space-between" | "space-evenly" | "center";
|
|
1039
1037
|
} | undefined>;
|
|
1040
1038
|
handleNavResize: import("lodash").DebouncedFunc<(entry: ResizeObserverEntry) => void>;
|
|
1041
1039
|
mergedSize: import("vue").ComputedRef<"small" | "medium" | "large">;
|
|
@@ -1091,7 +1089,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1091
1089
|
readonly default: "bar";
|
|
1092
1090
|
};
|
|
1093
1091
|
readonly closable: BooleanConstructor;
|
|
1094
|
-
readonly justifyContent: PropType<"
|
|
1092
|
+
readonly justifyContent: PropType<"start" | "end" | "space-around" | "space-between" | "space-evenly" | "center">;
|
|
1095
1093
|
readonly size: {
|
|
1096
1094
|
readonly type: PropType<"small" | "medium" | "large">;
|
|
1097
1095
|
readonly default: "medium";
|
|
@@ -1646,6 +1644,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1646
1644
|
type: NumberConstructor;
|
|
1647
1645
|
default: number;
|
|
1648
1646
|
};
|
|
1647
|
+
businessFormatter: {
|
|
1648
|
+
type: PropType<FormBusinessFormatter>;
|
|
1649
|
+
};
|
|
1649
1650
|
schema: {
|
|
1650
1651
|
type: PropType<import("@formily/vue").Stringify<{
|
|
1651
1652
|
[key: symbol]: any;
|
|
@@ -1709,9 +1710,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1709
1710
|
type: PropType<Record<string, Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | FunctionalComponent<{}, {}>>>;
|
|
1710
1711
|
default: () => {};
|
|
1711
1712
|
};
|
|
1712
|
-
businessFilter: {
|
|
1713
|
-
type: PropType<FormBusinessFilter>;
|
|
1714
|
-
};
|
|
1715
1713
|
scope: {
|
|
1716
1714
|
type: PropType<AnyObject>;
|
|
1717
1715
|
default: () => {};
|
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
import { AnyObject,
|
|
2
|
-
import {
|
|
1
|
+
import { AnyObject, Func } from '../../../../../../es/src/types';
|
|
2
|
+
import { UrlConfig } from '../../../../../../es/packages/form-render';
|
|
3
3
|
import { PropType } from 'vue';
|
|
4
|
-
declare type DependKeyObj = {
|
|
5
|
-
paramName: string;
|
|
6
|
-
paramValue: string;
|
|
7
|
-
};
|
|
8
|
-
declare type UrlConfig = {
|
|
9
|
-
method?: FormRequestType;
|
|
10
|
-
nameKey?: string;
|
|
11
|
-
valueKey?: string;
|
|
12
|
-
dependKey?: ArrayAble<string> | Record<string, string> | ArrayAble<DependKeyObj>;
|
|
13
|
-
url: string;
|
|
14
|
-
};
|
|
15
4
|
export declare const SEARCH_CASCADE: import("vue").DefineComponent<{
|
|
16
5
|
options: {
|
|
17
6
|
type: PropType<AnyObject[]>;
|
|
@@ -51,4 +40,3 @@ export declare const SEARCH_CASCADE: import("vue").DefineComponent<{
|
|
|
51
40
|
}, {
|
|
52
41
|
options: AnyObject[];
|
|
53
42
|
}>;
|
|
54
|
-
export {};
|
|
@@ -3,10 +3,10 @@ import { isField } from '@formily/core';
|
|
|
3
3
|
import { isEqual } from 'lodash-es';
|
|
4
4
|
import { useCommonInjection } from '../../../../../packages/form-render/src/hooks/useCommonInjection';
|
|
5
5
|
import { InjectAsyncQueue } from '../../constants/index.js';
|
|
6
|
-
import { assignUpdateValue, traverseDependKey } from '../../utils/index.js';
|
|
7
6
|
import { connect, mapProps } from '@formily/vue';
|
|
8
7
|
import { NCascader } from 'naive-ui';
|
|
9
8
|
import { useFormField } from '../../hooks/useFormField.js';
|
|
9
|
+
import { assignUpdateValue, traverseDependKey } from '../../utils/schema.js';
|
|
10
10
|
|
|
11
11
|
const script = defineComponent({
|
|
12
12
|
name: "FormCascader",
|
|
@@ -46,7 +46,7 @@ const script = defineComponent({
|
|
|
46
46
|
var _a, _b;
|
|
47
47
|
return (_b = (_a = props.urlConfig) == null ? void 0 : _a.valueKey) != null ? _b : "value";
|
|
48
48
|
});
|
|
49
|
-
const
|
|
49
|
+
const valueRef = computed(() => {
|
|
50
50
|
try {
|
|
51
51
|
const parsed = Array.isArray(props.value) ? props.value : JSON.parse(props.value || "");
|
|
52
52
|
if (!Array.isArray(parsed) || !parsed.length)
|
|
@@ -158,7 +158,7 @@ const script = defineComponent({
|
|
|
158
158
|
"checkStrategy": "child",
|
|
159
159
|
"show": !!show.value,
|
|
160
160
|
"onUpdate:show": updateShow,
|
|
161
|
-
"value":
|
|
161
|
+
"value": valueRef.value,
|
|
162
162
|
"onUpdate:value": updateValue,
|
|
163
163
|
"labelField": labelKey.value,
|
|
164
164
|
"valueField": valueKey.value,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, createVNode } from 'vue';
|
|
2
|
-
import { assignUpdateValue } from '../../utils/index.js';
|
|
3
2
|
import { connect, mapProps } from '@formily/vue';
|
|
4
3
|
import { NCheckboxGroup, NSpace, NCheckbox } from 'naive-ui';
|
|
4
|
+
import { assignUpdateValue } from '../../utils/schema.js';
|
|
5
5
|
|
|
6
6
|
const script = defineComponent({
|
|
7
7
|
name: "FormCheckbox",
|
|
@@ -3,11 +3,12 @@ import { isField } from '@formily/core';
|
|
|
3
3
|
import { Path } from '@formily/path';
|
|
4
4
|
import { isNumber, isEqual } from 'lodash-es';
|
|
5
5
|
import { useDeepValidate } from '../../../../../../packages/form-render/src/components/renderer/combination/hooks/useDeepValidate';
|
|
6
|
-
import {
|
|
6
|
+
import { mergeDeepProperties, formRenderLog } from '../../../utils/index.js';
|
|
7
7
|
import { connect, mapProps } from '@formily/vue';
|
|
8
8
|
import { useDebounceFn, isObject } from '@vueuse/core';
|
|
9
9
|
import { NButton } from 'naive-ui';
|
|
10
10
|
import FormRender from '../../../FormRender.js';
|
|
11
|
+
import { assignUpdateValue } from '../../../utils/schema.js';
|
|
11
12
|
|
|
12
13
|
const script = defineComponent({
|
|
13
14
|
name: "FormCombination",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, createVNode } from 'vue';
|
|
2
2
|
import { connect, mapProps } from '@formily/vue';
|
|
3
|
-
import { assignUpdateValue } from '../../utils/
|
|
3
|
+
import { assignUpdateValue } from '../../utils/schema.js';
|
|
4
4
|
|
|
5
5
|
const script = defineComponent({
|
|
6
6
|
props: {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
2
|
export declare const DATE: import("vue").DefineComponent<{
|
|
3
3
|
onChange: {};
|
|
4
|
-
value: {
|
|
4
|
+
value: {
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
};
|
|
5
7
|
validate: {
|
|
6
8
|
type: PropType<Partial<{
|
|
7
9
|
[key: string]: any;
|
|
@@ -16,9 +18,15 @@ export declare const DATE: import("vue").DefineComponent<{
|
|
|
16
18
|
regular_error_tip: string;
|
|
17
19
|
}>>;
|
|
18
20
|
};
|
|
19
|
-
|
|
21
|
+
valueFormat: {
|
|
22
|
+
type: StringConstructor;
|
|
23
|
+
default: string;
|
|
24
|
+
};
|
|
25
|
+
}, () => 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<{
|
|
20
26
|
onChange: {};
|
|
21
|
-
value: {
|
|
27
|
+
value: {
|
|
28
|
+
type: StringConstructor;
|
|
29
|
+
};
|
|
22
30
|
validate: {
|
|
23
31
|
type: PropType<Partial<{
|
|
24
32
|
[key: string]: any;
|
|
@@ -33,4 +41,12 @@ export declare const DATE: import("vue").DefineComponent<{
|
|
|
33
41
|
regular_error_tip: string;
|
|
34
42
|
}>>;
|
|
35
43
|
};
|
|
36
|
-
|
|
44
|
+
valueFormat: {
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
default: string;
|
|
47
|
+
};
|
|
48
|
+
}>> & {
|
|
49
|
+
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
50
|
+
}, {
|
|
51
|
+
valueFormat: string;
|
|
52
|
+
}>;
|
|
@@ -1,19 +1,29 @@
|
|
|
1
|
-
import { defineComponent, computed, createVNode } from 'vue';
|
|
2
|
-
import { isField } from '@formily/core';
|
|
1
|
+
import { defineComponent, computed, watch, createVNode, mergeProps } from 'vue';
|
|
3
2
|
import { connect, mapProps } from '@formily/vue';
|
|
4
3
|
import { isObject } from '@vueuse/core';
|
|
4
|
+
import { format } from 'date-fns';
|
|
5
5
|
import { NDatePicker } from 'naive-ui';
|
|
6
6
|
import { useCommonInjection } from '../../../../../packages/form-render/src/hooks/useCommonInjection';
|
|
7
|
+
import { assignUpdateValue } from '../../../../../packages/form-render/src/utils';
|
|
7
8
|
|
|
8
9
|
const script = defineComponent({
|
|
9
10
|
props: {
|
|
10
11
|
onChange: {},
|
|
11
|
-
value: {
|
|
12
|
+
value: {
|
|
13
|
+
type: String
|
|
14
|
+
},
|
|
12
15
|
validate: {
|
|
13
16
|
type: Object
|
|
17
|
+
},
|
|
18
|
+
valueFormat: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: "yyyy-MM-dd"
|
|
14
21
|
}
|
|
15
22
|
},
|
|
16
|
-
|
|
23
|
+
emits: ["update:value"],
|
|
24
|
+
setup(props, {
|
|
25
|
+
emit
|
|
26
|
+
}) {
|
|
17
27
|
useCommonInjection().injectValueValidate(() => props.value);
|
|
18
28
|
function minCurrentDate() {
|
|
19
29
|
var _a;
|
|
@@ -56,7 +66,9 @@ const script = defineComponent({
|
|
|
56
66
|
}
|
|
57
67
|
}
|
|
58
68
|
const validateConfig = computed(() => {
|
|
59
|
-
const result = {
|
|
69
|
+
const result = {
|
|
70
|
+
valueFormat: props.valueFormat
|
|
71
|
+
};
|
|
60
72
|
if (isObject(props.validate)) {
|
|
61
73
|
const {
|
|
62
74
|
min_date,
|
|
@@ -69,22 +81,26 @@ const script = defineComponent({
|
|
|
69
81
|
}
|
|
70
82
|
return result;
|
|
71
83
|
});
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
function formatDate(value) {
|
|
85
|
+
if (!value)
|
|
86
|
+
return value;
|
|
87
|
+
return format(new Date(value), props.valueFormat);
|
|
88
|
+
}
|
|
89
|
+
watch(() => props.value, (value) => {
|
|
90
|
+
if (!value || formatDate(value) === value)
|
|
91
|
+
return;
|
|
92
|
+
emit("update:value", formatDate(value));
|
|
93
|
+
});
|
|
94
|
+
const valueRef = computed({
|
|
95
|
+
get: () => formatDate(props.value),
|
|
96
|
+
set: (value) => emit("update:value", value)
|
|
85
97
|
});
|
|
98
|
+
return () => createVNode(NDatePicker, mergeProps(validateConfig.value, {
|
|
99
|
+
"formatted-value": valueRef.value,
|
|
100
|
+
"onUpdate:formatted-value": ($event) => valueRef.value = $event
|
|
101
|
+
}), null);
|
|
86
102
|
}
|
|
87
|
-
|
|
88
|
-
|
|
103
|
+
});
|
|
104
|
+
const DATE = connect(script, mapProps(assignUpdateValue));
|
|
89
105
|
|
|
90
106
|
export { DATE };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { defineComponent, createVNode } from 'vue';
|
|
2
|
-
import { createInputSlot
|
|
2
|
+
import { createInputSlot } from '../../utils/index.js';
|
|
3
3
|
import { connect, mapProps } from '@formily/vue';
|
|
4
4
|
import { NInput } from 'naive-ui';
|
|
5
|
+
import { assignUpdateValue } from '../../utils/schema.js';
|
|
5
6
|
|
|
6
7
|
const script = defineComponent({
|
|
7
8
|
name: "FormInput",
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { defineComponent, createVNode } from 'vue';
|
|
2
|
-
import { createInputSlot
|
|
2
|
+
import { createInputSlot } from '../../utils/index.js';
|
|
3
3
|
import { connect, mapProps } from '@formily/vue';
|
|
4
4
|
import { NInputNumber } from 'naive-ui';
|
|
5
|
+
import { assignUpdateValue } from '../../utils/schema.js';
|
|
5
6
|
|
|
6
7
|
const script = defineComponent({
|
|
7
8
|
props: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref,
|
|
1
|
+
import { defineComponent, ref, inject, createVNode } from 'vue';
|
|
2
2
|
import { connect, mapProps } from '@formily/vue';
|
|
3
3
|
import { NDivider, NCollapseTransition } from 'naive-ui';
|
|
4
4
|
import { useFormField } from '../../../../../packages/form-render';
|
|
@@ -28,9 +28,6 @@ const script = defineComponent({
|
|
|
28
28
|
slots
|
|
29
29
|
}) {
|
|
30
30
|
const _show = ref(props.show);
|
|
31
|
-
onMounted(() => {
|
|
32
|
-
_show.value = props.show;
|
|
33
|
-
});
|
|
34
31
|
function toggleShow() {
|
|
35
32
|
if (props.disabled)
|
|
36
33
|
return;
|
|
@@ -2,7 +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 { assignUpdateValue } from '../../utils/
|
|
5
|
+
import { assignUpdateValue } from '../../utils/schema.js';
|
|
6
6
|
|
|
7
7
|
const script = defineComponent({
|
|
8
8
|
props: {
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import { AnyObject, Func } from '../../../../../../es/src/types';
|
|
2
|
-
import {
|
|
2
|
+
import { UrlConfig } from '../../types';
|
|
3
3
|
import { PropType } from 'vue';
|
|
4
|
-
declare type UrlConfig = {
|
|
5
|
-
method: FormRequestType;
|
|
6
|
-
dependKey?: string | string[];
|
|
7
|
-
nameKey: string;
|
|
8
|
-
url: string;
|
|
9
|
-
params?: AnyObject;
|
|
10
|
-
valueKey: string;
|
|
11
|
-
};
|
|
12
4
|
export declare const SELECT: import("vue").DefineComponent<{
|
|
13
5
|
value: {
|
|
14
6
|
type: StringConstructor;
|
|
@@ -53,4 +45,3 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
53
45
|
options: AnyObject[];
|
|
54
46
|
lazyRequest: boolean;
|
|
55
47
|
}>;
|
|
56
|
-
export {};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, computed, ref, inject, nextTick, watch, createVNode } from 'vue';
|
|
2
2
|
import { isField } from '@formily/core';
|
|
3
|
-
import { isEqual,
|
|
3
|
+
import { cloneDeep, isEqual, isString } from 'lodash-es';
|
|
4
4
|
import { useCommonInjection } from '../../../../../packages/form-render/src/hooks/useCommonInjection';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { InjectAsyncQueue, InjectionChangeContextCollector, InjectionFormItemDepsCollector } from '../../constants/index.js';
|
|
6
|
+
import { formRenderLog } from '../../utils/index.js';
|
|
7
7
|
import { connect, mapProps } from '@formily/vue';
|
|
8
8
|
import { NSelect } from 'naive-ui';
|
|
9
9
|
import { useFormField } from '../../hooks/useFormField.js';
|
|
10
|
+
import { assignUpdateValue, traverseDependKey } from '../../utils/schema.js';
|
|
10
11
|
|
|
11
12
|
const script = defineComponent({
|
|
12
13
|
name: "FormSelect",
|
|
@@ -35,6 +36,10 @@ const script = defineComponent({
|
|
|
35
36
|
slots,
|
|
36
37
|
emit
|
|
37
38
|
}) {
|
|
39
|
+
const valueRef = computed({
|
|
40
|
+
get: () => props.value,
|
|
41
|
+
set: (v) => emit("update:value", v)
|
|
42
|
+
});
|
|
38
43
|
const remoteOptions = ref(null);
|
|
39
44
|
const lastSearch = ref("");
|
|
40
45
|
const labelKey = computed(() => {
|
|
@@ -45,11 +50,6 @@ const script = defineComponent({
|
|
|
45
50
|
var _a, _b;
|
|
46
51
|
return (_b = (_a = props.urlConfig) == null ? void 0 : _a.valueKey) != null ? _b : "value";
|
|
47
52
|
});
|
|
48
|
-
const changeContextCollector = inject(InjectionChangeContextCollector);
|
|
49
|
-
function update(v, option) {
|
|
50
|
-
changeContextCollector == null ? void 0 : changeContextCollector.setContext(fieldKey.value, "currentOption", cloneDeep(option));
|
|
51
|
-
emit("update:value", v);
|
|
52
|
-
}
|
|
53
53
|
const {
|
|
54
54
|
field,
|
|
55
55
|
fieldKey
|
|
@@ -62,9 +62,11 @@ const script = defineComponent({
|
|
|
62
62
|
}
|
|
63
63
|
if (remoteOptions.value)
|
|
64
64
|
return;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
})
|
|
65
|
+
try {
|
|
66
|
+
remoteOptions.value = await asyncQueue.addAsync(await createParams(configFor(props), field.value, fieldKey.value));
|
|
67
|
+
} catch (e) {
|
|
68
|
+
isString(e) && formRenderLog(e, "warn");
|
|
69
|
+
}
|
|
68
70
|
async function createParams(config, field2, key) {
|
|
69
71
|
const _params = {};
|
|
70
72
|
try {
|
|
@@ -102,6 +104,13 @@ const script = defineComponent({
|
|
|
102
104
|
});
|
|
103
105
|
}
|
|
104
106
|
});
|
|
107
|
+
const changeContextCollector = inject(InjectionChangeContextCollector);
|
|
108
|
+
changeContextCollector == null ? void 0 : changeContextCollector.setContext(fieldKey.value, async () => {
|
|
109
|
+
await nextTick();
|
|
110
|
+
return {
|
|
111
|
+
currentOption: cloneDeep(parsedOptions.value.find((option) => option[valueKey.value] === valueRef.value))
|
|
112
|
+
};
|
|
113
|
+
});
|
|
105
114
|
const formItemDepsCollector = inject(InjectionFormItemDepsCollector);
|
|
106
115
|
watch(() => props.urlConfig, (config, oldConfig) => {
|
|
107
116
|
if (isEqual(config, oldConfig))
|
|
@@ -114,7 +123,7 @@ const script = defineComponent({
|
|
|
114
123
|
emit("update:value", null);
|
|
115
124
|
!props.lazyRequest && await fetchData();
|
|
116
125
|
});
|
|
117
|
-
(
|
|
126
|
+
(valueRef.value || !props.lazyRequest) && fetchData();
|
|
118
127
|
}, {
|
|
119
128
|
immediate: true
|
|
120
129
|
});
|
|
@@ -122,8 +131,8 @@ const script = defineComponent({
|
|
|
122
131
|
injectValueValidate,
|
|
123
132
|
injectValueWatchFromEmpty
|
|
124
133
|
} = useCommonInjection();
|
|
125
|
-
injectValueWatchFromEmpty(
|
|
126
|
-
injectValueValidate(
|
|
134
|
+
injectValueWatchFromEmpty(valueRef, fetchData);
|
|
135
|
+
injectValueValidate(valueRef);
|
|
127
136
|
function focusDecorator(onFocus) {
|
|
128
137
|
return (...args) => {
|
|
129
138
|
if (isField(field.value)) {
|
|
@@ -135,8 +144,8 @@ const script = defineComponent({
|
|
|
135
144
|
return () => createVNode(NSelect, {
|
|
136
145
|
"remote": true,
|
|
137
146
|
"filterable": true,
|
|
138
|
-
"value":
|
|
139
|
-
"onUpdate:value":
|
|
147
|
+
"value": valueRef.value,
|
|
148
|
+
"onUpdate:value": ($event) => valueRef.value = $event,
|
|
140
149
|
"labelField": labelKey.value,
|
|
141
150
|
"valueField": valueKey.value,
|
|
142
151
|
"options": parsedOptions.value,
|