cnhis-design-vue 3.1.34-beta.16 → 3.1.34-beta.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { createVNode, mergeProps } from 'vue';
|
|
2
|
+
import { findAncestor } from '../../../../../../../shared/utils/index.js';
|
|
3
|
+
import { isObject } from 'lodash-es';
|
|
2
4
|
import '../../../../../index.js';
|
|
3
5
|
import { EDITABLE_WIDGET_TYPE } from '../../../../constants/index.js';
|
|
4
6
|
import { IhoTableRenderHelper } from '../../../../utils/index.js';
|
|
@@ -8,9 +10,24 @@ import { defineTablePlugin } from '../../../../hooks/useTablePlugin.js';
|
|
|
8
10
|
|
|
9
11
|
function selectRendererPlugin() {
|
|
10
12
|
const pluginName = "selectRendererPlugin";
|
|
13
|
+
function isHTMLElement(target) {
|
|
14
|
+
return isObject(target);
|
|
15
|
+
}
|
|
11
16
|
return defineTablePlugin({
|
|
12
17
|
name: pluginName,
|
|
13
18
|
vxe(instance) {
|
|
19
|
+
instance.interceptor.add("event.clearActived", ({
|
|
20
|
+
$event,
|
|
21
|
+
column
|
|
22
|
+
}) => {
|
|
23
|
+
var _a;
|
|
24
|
+
if (((_a = column.editRender) == null ? void 0 : _a.name) !== EDITABLE_WIDGET_TYPE.SELECT)
|
|
25
|
+
return true;
|
|
26
|
+
const target = $event == null ? void 0 : $event.target;
|
|
27
|
+
if (!isHTMLElement(target))
|
|
28
|
+
return true;
|
|
29
|
+
return !findAncestor(target, (ele) => ele.classList.contains("n-base-select-menu-option-wrapper"));
|
|
30
|
+
});
|
|
14
31
|
instance.renderer.add(EDITABLE_WIDGET_TYPE.SELECT, {
|
|
15
32
|
renderCell({
|
|
16
33
|
props
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
function getDefaultValue(row, item) {
|
|
2
|
-
var _a;
|
|
3
2
|
const value = row[item.columnName];
|
|
4
3
|
if (Array.isArray(value))
|
|
5
|
-
return
|
|
4
|
+
return value.map((v) => getValue(v)).join(",");
|
|
6
5
|
return getValue(value);
|
|
7
6
|
function getValue(value2) {
|
|
8
|
-
var
|
|
7
|
+
var _a;
|
|
9
8
|
const findValue = (options) => {
|
|
10
|
-
var
|
|
11
|
-
return ((
|
|
9
|
+
var _a2;
|
|
10
|
+
return ((_a2 = options == null ? void 0 : options.find((v) => v.value == value2)) == null ? void 0 : _a2.label) || value2 || "";
|
|
12
11
|
};
|
|
13
|
-
|
|
14
|
-
return row[(_a2 = item.formatMap) == null ? void 0 : _a2.label];
|
|
15
|
-
}
|
|
16
|
-
return findValue(((_b = item.componentProps) == null ? void 0 : _b.options) || []);
|
|
12
|
+
return findValue(((_a = item.componentProps) == null ? void 0 : _a.options) || []);
|
|
17
13
|
}
|
|
18
14
|
}
|
|
19
15
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cnhis-design-vue",
|
|
3
|
-
"version": "3.1.34-beta.
|
|
3
|
+
"version": "3.1.34-beta.17",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"module": "./es/components/index.js",
|
|
6
6
|
"main": "./es/components/index.js",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"iOS 7",
|
|
62
62
|
"last 3 iOS versions"
|
|
63
63
|
],
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "3b32b13528a46cdf1c8be448433a689a1ed7d789"
|
|
65
65
|
}
|