cnhis-design-vue 3.1.21-beta.1 → 3.1.21-beta.3
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/big-table/index.d.ts +1 -1
- package/es/components/big-table/src/BigTable.vue.d.ts +1 -1
- package/es/components/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +3 -1
- package/es/components/form-render/src/FormRender.js +2 -2
- package/es/components/form-render/src/components/renderer/search.js +5 -6
- package/es/components/form-render/src/components/renderer/select.js +5 -6
- package/es/components/form-render/src/hooks/useChangeContext.d.ts +3 -5
- package/es/components/form-render/src/hooks/useChangeContext2.js +2 -2
- package/package.json +2 -2
|
@@ -713,7 +713,7 @@ declare const BigTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
713
713
|
setGroupTreeExpand: () => void;
|
|
714
714
|
resetTableInlineEditStatus: () => false | undefined;
|
|
715
715
|
renderAnnotation: (columnConfig: import("../../../es/shared/types").AnyObject) => JSX.Element | null;
|
|
716
|
-
toolTipTitle: (item: any, type: any) => any[] | (() => any
|
|
716
|
+
toolTipTitle: (item: any, type: any) => any[] | (() => any);
|
|
717
717
|
triggerExpand: (e: any, isExpand: any) => void;
|
|
718
718
|
getOtherConfigInit: () => any;
|
|
719
719
|
refreshTable: () => void;
|
|
@@ -711,7 +711,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
711
711
|
setGroupTreeExpand: () => void;
|
|
712
712
|
resetTableInlineEditStatus: () => false | undefined;
|
|
713
713
|
renderAnnotation: (columnConfig: import("../../../shared/types").AnyObject) => JSX.Element | null;
|
|
714
|
-
toolTipTitle: (item: any, type: any) => any[] | (() => any
|
|
714
|
+
toolTipTitle: (item: any, type: any) => any[] | (() => any);
|
|
715
715
|
triggerExpand: (e: any, isExpand: any) => void;
|
|
716
716
|
getOtherConfigInit: () => any;
|
|
717
717
|
refreshTable: () => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, ref, reactive, useAttrs, computed, onMounted, onUnmounted, onActivated, nextTick, createVNode, h, resolveComponent, Teleport, createTextVNode, watch, openBlock, createElementBlock, Fragment, createBlock, unref, withCtx, renderList, createCommentVNode, createElementVNode, normalizeClass, normalizeStyle, mergeProps, renderSlot, toDisplayString, withDirectives, vShow, isVNode } from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import { isFunction, isArray } from 'lodash-es';
|
|
3
3
|
import bigTableState from './bigTableState2.js';
|
|
4
4
|
import bigTableProps from './bigTableProps2.js';
|
|
5
5
|
import bigTableEmits from './bigTableEmits2.js';
|
|
@@ -970,6 +970,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
970
970
|
if (name && tooltipTitle && name !== tooltipTitle) {
|
|
971
971
|
isAlias = !!tooltipTitle;
|
|
972
972
|
}
|
|
973
|
+
if (isFunction(item.headerSlotFn))
|
|
974
|
+
return () => item.headerSlotFn(item);
|
|
973
975
|
if (type === "format")
|
|
974
976
|
return [createVNode(script, {
|
|
975
977
|
"tooltipTitle": tooltipTitle,
|
|
@@ -65,7 +65,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
65
65
|
const formModel = createForm({
|
|
66
66
|
initialValues: props.initialData,
|
|
67
67
|
effects() {
|
|
68
|
-
onFieldValueChange("*",
|
|
68
|
+
onFieldValueChange("*", (field) => {
|
|
69
69
|
const fieldKey = field.props.name.toString();
|
|
70
70
|
businessCollector.trigger(fieldKey);
|
|
71
71
|
formItemDepsCollector.trigger(fieldKey);
|
|
@@ -74,7 +74,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
74
74
|
fieldKey,
|
|
75
75
|
fieldName: field.title,
|
|
76
76
|
value: field.value,
|
|
77
|
-
context:
|
|
77
|
+
context: changeContextCollector.getContext(fieldKey, field.value)
|
|
78
78
|
});
|
|
79
79
|
});
|
|
80
80
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, computed, ref, inject,
|
|
1
|
+
import { defineComponent, computed, ref, inject, watch, createVNode } from 'vue';
|
|
2
2
|
import { cloneDeep, isEqual, isString } from 'lodash-es';
|
|
3
3
|
import { useCommonInjection } from '../../hooks/useCommonInjection2.js';
|
|
4
4
|
import { InjectAsyncQueue, InjectionChangeContextCollector } from '../../constants/index2.js';
|
|
@@ -125,13 +125,12 @@ const script = defineComponent({
|
|
|
125
125
|
}
|
|
126
126
|
});
|
|
127
127
|
const changeContextCollector = inject(InjectionChangeContextCollector);
|
|
128
|
-
changeContextCollector.setContext(fieldKey.value,
|
|
129
|
-
await nextTick();
|
|
128
|
+
changeContextCollector.setContext(fieldKey.value, (v) => {
|
|
130
129
|
return {
|
|
131
|
-
currentOption: cloneDeep(getCurrentOption())
|
|
130
|
+
currentOption: cloneDeep(getCurrentOption(v))
|
|
132
131
|
};
|
|
133
|
-
function getCurrentOption() {
|
|
134
|
-
return parsedOptions.value.find((option) => option[valueKey.value] ===
|
|
132
|
+
function getCurrentOption(v2) {
|
|
133
|
+
return parsedOptions.value.find((option) => option[valueKey.value] === v2);
|
|
135
134
|
}
|
|
136
135
|
});
|
|
137
136
|
watch(() => props.wordbook, (wordbook, oldWordbook) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, computed, ref, inject,
|
|
1
|
+
import { defineComponent, computed, ref, inject, watch, createVNode } from 'vue';
|
|
2
2
|
import { isField } from '@formily/core';
|
|
3
3
|
import { cloneDeep, isEqual, isString } from 'lodash-es';
|
|
4
4
|
import { useCommonInjection } from '../../hooks/useCommonInjection2.js';
|
|
@@ -136,13 +136,12 @@ const script = defineComponent({
|
|
|
136
136
|
}
|
|
137
137
|
});
|
|
138
138
|
const changeContextCollector = inject(InjectionChangeContextCollector);
|
|
139
|
-
changeContextCollector.setContext(fieldKey.value,
|
|
140
|
-
await nextTick();
|
|
139
|
+
changeContextCollector.setContext(fieldKey.value, (v) => {
|
|
141
140
|
return {
|
|
142
|
-
currentOption: cloneDeep(getCurrentOption())
|
|
141
|
+
currentOption: cloneDeep(getCurrentOption(v))
|
|
143
142
|
};
|
|
144
|
-
function getCurrentOption() {
|
|
145
|
-
return parsedOptions.value.find((option) => option[valueKey.value] ===
|
|
143
|
+
function getCurrentOption(v2) {
|
|
144
|
+
return parsedOptions.value.find((option) => option[valueKey.value] === v2);
|
|
146
145
|
}
|
|
147
146
|
});
|
|
148
147
|
const formItemDepsCollector = inject(InjectionFormItemDepsCollector);
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { FormChangeContext } from '../types';
|
|
2
2
|
export declare class ContextCollector {
|
|
3
3
|
private readonly contextMap;
|
|
4
|
-
setContext(key: string, value: () =>
|
|
5
|
-
getContext(key: string): Partial<{
|
|
4
|
+
setContext(key: string, value: (value: unknown) => FormChangeContext): void;
|
|
5
|
+
getContext(key: string, value: unknown): Partial<{
|
|
6
6
|
currentOption: import("../../../../shared/types").AnyObject;
|
|
7
|
-
}> |
|
|
8
|
-
currentOption: import("../../../../shared/types").AnyObject;
|
|
9
|
-
}>> | undefined;
|
|
7
|
+
}> | undefined;
|
|
10
8
|
}
|
|
11
9
|
export declare function useChangeContext(): {
|
|
12
10
|
create: () => ContextCollector;
|
|
@@ -5,9 +5,9 @@ class ContextCollector {
|
|
|
5
5
|
setContext(key, value) {
|
|
6
6
|
this.contextMap.set(key, value);
|
|
7
7
|
}
|
|
8
|
-
getContext(key) {
|
|
8
|
+
getContext(key, value) {
|
|
9
9
|
var _a;
|
|
10
|
-
return (_a = this.contextMap.get(key)) == null ? void 0 : _a();
|
|
10
|
+
return (_a = this.contextMap.get(key)) == null ? void 0 : _a(value);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
function useChangeContext() {
|
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.3",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"module": "./es/components/index.js",
|
|
6
6
|
"main": "./es/components/index.js",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"iOS 7",
|
|
67
67
|
"last 3 iOS versions"
|
|
68
68
|
],
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "8459dc01db0ff41a58e6881bef165cb792af32fb"
|
|
70
70
|
}
|