cnhis-design-vue 3.1.22-beta.0 → 3.1.22-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/components/big-table/index2.js +0 -2
- package/es/components/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +7 -6
- package/es/components/field-set/index.d.ts +4 -3
- package/es/components/field-set/src/FieldSet.js +9 -4
- package/es/components/field-set/src/FieldSet.vue.d.ts +4 -3
- package/es/components/form-render/src/components/renderer/combination.d.ts +7 -0
- package/es/components/form-render/src/components/renderer/combination.js +4 -1
- package/es/components/grid/index2.js +0 -2
- package/es/components/iho-table/index.d.ts +4011 -11
- package/es/components/iho-table/index2.js +1 -0
- package/es/components/iho-table/src/IhoTable.js +13 -5
- package/es/components/iho-table/src/IhoTable.vue.d.ts +4011 -11
- package/es/components/iho-table/src/constants/index.d.ts +5 -0
- package/es/components/iho-table/src/constants/index.js +1 -1
- package/es/components/iho-table/src/constants/index2.js +66 -1
- package/es/components/iho-table/src/hooks/index.js +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +2 -0
- package/es/components/iho-table/src/hooks/tapHooks/index.js +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/index2.js +34 -3
- package/es/components/iho-table/src/hooks/tapHooks/useConfigHooks.d.ts +14 -0
- package/es/components/iho-table/src/hooks/tapHooks/useConfigHooks2.js +39 -1
- package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.d.ts +61 -60
- package/es/components/iho-table/src/hooks/tapHooks/useEventHooks2.js +3 -1
- package/es/components/iho-table/src/plugins/defaultConfigPlugin/index2.js +1 -1
- package/es/components/iho-table/src/plugins/index.js +7 -5
- package/es/components/iho-table/src/plugins/index2.js +7 -5
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index2.js +2 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/index.d.ts +2 -5
- package/es/components/iho-table/src/plugins/rendererPlugins/index.js +7 -5
- package/es/components/iho-table/src/plugins/rendererPlugins/inputs/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/inputs/index.js +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/inputs/inputRendererPlugins.d.ts +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/inputs/inputRendererPlugins.js +44 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/{checkRendererPlugin.d.ts → widgets/checkRendererPlugin.d.ts} +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/{checkRendererPlugin.js → widgets/checkRendererPlugin.js} +2 -2
- package/es/components/iho-table/src/plugins/rendererPlugins/{colorRendererPlugin.d.ts → widgets/colorRendererPlugin.d.ts} +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/{colorRendererPlugin.js → widgets/colorRendererPlugin.js} +6 -8
- package/es/components/iho-table/src/plugins/rendererPlugins/{defaultRendererPlugin.d.ts → widgets/defaultRendererPlugin.d.ts} +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/{defaultRendererPlugin.js → widgets/defaultRendererPlugin.js} +4 -4
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/index.d.ts +6 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/index.js +6 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/{labelRendererPlugin.d.ts → widgets/labelRendererPlugin.d.ts} +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/{labelRendererPlugin.js → widgets/labelRendererPlugin.js} +3 -3
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/pictureRendererPlugin.d.ts +2 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/pictureRendererPlugin.js +89 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/{seqRendererPlugin.d.ts → widgets/seqRendererPlugin.d.ts} +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/{seqRendererPlugin.js → widgets/seqRendererPlugin.js} +3 -3
- package/es/components/iho-table/src/types/index.d.ts +7 -0
- package/es/components/iho-table/src/types/pluginType.d.ts +14 -0
- package/es/components/iho-table/src/utils/index.d.ts +1 -0
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/iho-table/src/utils/index2.js +12 -1
- package/package.json +3 -3
- package/es/shared/utils/loadVxe.d.ts +0 -2
- package/es/shared/utils/loadVxe.js +0 -1
- package/es/shared/utils/loadVxe2.js +0 -12
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '
|
|
3
|
-
import { WIDGET_TYPE
|
|
4
|
-
import {
|
|
1
|
+
import { createVNode } from 'vue';
|
|
2
|
+
import '../../../../index2.js';
|
|
3
|
+
import { WIDGET_TYPE } from '../../../constants/index2.js';
|
|
4
|
+
import { getRowHeight } from '../../../utils/index2.js';
|
|
5
|
+
import { defineTablePlugin } from '../../../hooks/useTablePlugin2.js';
|
|
5
6
|
|
|
6
7
|
function colorRendererPlugin() {
|
|
7
8
|
const pluginName = "checkRendererPlugin";
|
|
@@ -28,15 +29,12 @@ function colorRendererPlugin() {
|
|
|
28
29
|
row,
|
|
29
30
|
column
|
|
30
31
|
}) {
|
|
31
|
-
var _a, _b, _c;
|
|
32
32
|
const value = row[column.field];
|
|
33
33
|
const [color, alias] = value.split("-");
|
|
34
|
-
const config = inject(InjectionIhoTableConfig);
|
|
35
|
-
const height = (_c = (_b = (_a = config == null ? void 0 : config.value) == null ? void 0 : _a.rowConfig) == null ? void 0 : _b.height) != null ? _c : 32;
|
|
36
34
|
return [createVNode("div", {
|
|
37
35
|
"style": {
|
|
38
36
|
background: colorMap[alias] || color,
|
|
39
|
-
height:
|
|
37
|
+
height: getRowHeight() - 8 + "px"
|
|
40
38
|
}
|
|
41
39
|
}, null)];
|
|
42
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function defaultRendererPlugin(): import("
|
|
1
|
+
export declare function defaultRendererPlugin(): import("../../../../../../../es/components/iho-table").TablePlugin;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createVNode } from 'vue';
|
|
2
2
|
import { isString } from 'lodash-es';
|
|
3
|
-
import '
|
|
4
|
-
import { WIDGET_TYPE } from '
|
|
5
|
-
import { IhoTableWarn } from '
|
|
6
|
-
import { defineTablePlugin } from '
|
|
3
|
+
import '../../../../index2.js';
|
|
4
|
+
import { WIDGET_TYPE } from '../../../constants/index2.js';
|
|
5
|
+
import { IhoTableWarn } from '../../../utils/index2.js';
|
|
6
|
+
import { defineTablePlugin } from '../../../hooks/useTablePlugin2.js';
|
|
7
7
|
|
|
8
8
|
function defaultRendererPlugin() {
|
|
9
9
|
const pluginName = "defaultRendererPlugin";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { labelRendererPlugin } from './labelRendererPlugin.js';
|
|
2
|
+
export { defaultRendererPlugin } from './defaultRendererPlugin.js';
|
|
3
|
+
export { colorRendererPlugin } from './colorRendererPlugin.js';
|
|
4
|
+
export { seqRendererPlugin } from './seqRendererPlugin.js';
|
|
5
|
+
export { checkRendererPlugin } from './checkRendererPlugin.js';
|
|
6
|
+
export { pictureRendererPlugin } from './pictureRendererPlugin.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function labelRendererPlugin(): import("
|
|
1
|
+
export declare function labelRendererPlugin(): import("../../../../../../../es/components/iho-table").TablePlugin;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createVNode } from 'vue';
|
|
2
2
|
import { isArray, isString } from 'lodash-es';
|
|
3
|
-
import '
|
|
4
|
-
import { WIDGET_TYPE } from '
|
|
5
|
-
import { defineTablePlugin } from '
|
|
3
|
+
import '../../../../index2.js';
|
|
4
|
+
import { WIDGET_TYPE } from '../../../constants/index2.js';
|
|
5
|
+
import { defineTablePlugin } from '../../../hooks/useTablePlugin2.js';
|
|
6
6
|
|
|
7
7
|
function labelRendererPlugin() {
|
|
8
8
|
const pluginName = "labelRendererPlugin";
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { defineComponent, watch, createVNode } from 'vue';
|
|
2
|
+
import { arrayed } from '../../../../../../shared/utils/index2.js';
|
|
3
|
+
import '../../../../index2.js';
|
|
4
|
+
import { WIDGET_TYPE } from '../../../constants/index2.js';
|
|
5
|
+
import { getRowHeight, IhoTableWarn } from '../../../utils/index2.js';
|
|
6
|
+
import Viewer from 'viewerjs';
|
|
7
|
+
import 'viewerjs/dist/viewer.css';
|
|
8
|
+
import { defineTablePlugin } from '../../../hooks/useTablePlugin2.js';
|
|
9
|
+
|
|
10
|
+
function pictureRendererPlugin() {
|
|
11
|
+
const pluginName = "pictureRendererPlugin";
|
|
12
|
+
return defineTablePlugin({
|
|
13
|
+
name: pluginName,
|
|
14
|
+
vxe(instance) {
|
|
15
|
+
function createRenderOptions(style) {
|
|
16
|
+
return {
|
|
17
|
+
renderCell(renderOpts, {
|
|
18
|
+
row,
|
|
19
|
+
column
|
|
20
|
+
}) {
|
|
21
|
+
try {
|
|
22
|
+
const value = JSON.parse(row[column.field]);
|
|
23
|
+
const height = getRowHeight();
|
|
24
|
+
return [createVNode("section", {
|
|
25
|
+
"style": "display:flex;justify-content:center"
|
|
26
|
+
}, [createVNode(ViewerImage, {
|
|
27
|
+
"style": {
|
|
28
|
+
width: height + "px",
|
|
29
|
+
height: height + "px",
|
|
30
|
+
...style
|
|
31
|
+
},
|
|
32
|
+
"images": arrayed(value).map((v) => v.url)
|
|
33
|
+
}, null)])];
|
|
34
|
+
} catch (e) {
|
|
35
|
+
IhoTableWarn(`invalid ${renderOpts.name} value of field(${column.field}): ${row[column.field]}`);
|
|
36
|
+
return [];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
instance.renderer.add(WIDGET_TYPE.PICTURE, createRenderOptions({}));
|
|
42
|
+
instance.renderer.add(WIDGET_TYPE.HEADPORTRAIT, createRenderOptions({
|
|
43
|
+
"border-radius": "50%"
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
const ViewerImage = defineComponent({
|
|
49
|
+
name: "ViewerImage",
|
|
50
|
+
props: {
|
|
51
|
+
images: {
|
|
52
|
+
type: Array,
|
|
53
|
+
default: () => []
|
|
54
|
+
},
|
|
55
|
+
options: {
|
|
56
|
+
type: Object,
|
|
57
|
+
default: () => ({})
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
setup(props) {
|
|
61
|
+
let $viewer = null;
|
|
62
|
+
function show() {
|
|
63
|
+
if ($viewer)
|
|
64
|
+
return $viewer.show();
|
|
65
|
+
const wrapper = document.createElement("section");
|
|
66
|
+
props.images.map((image) => wrapper.appendChild(createImage(image)));
|
|
67
|
+
$viewer = new Viewer(wrapper, props.options).show();
|
|
68
|
+
}
|
|
69
|
+
function createImage(image) {
|
|
70
|
+
const imageEle = new Image();
|
|
71
|
+
imageEle.src = image;
|
|
72
|
+
return imageEle;
|
|
73
|
+
}
|
|
74
|
+
watch([() => props.images, () => props.options], () => {
|
|
75
|
+
$viewer == null ? void 0 : $viewer.destroy();
|
|
76
|
+
$viewer = null;
|
|
77
|
+
}, {
|
|
78
|
+
deep: true
|
|
79
|
+
});
|
|
80
|
+
return () => createVNode("img", {
|
|
81
|
+
"style": "cursor:pointer",
|
|
82
|
+
"alt": "",
|
|
83
|
+
"src": props.images[0],
|
|
84
|
+
"onClick": show
|
|
85
|
+
}, null);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
export { pictureRendererPlugin };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function seqRendererPlugin(): import("
|
|
1
|
+
export declare function seqRendererPlugin(): import("../../../../../../../es/components/iho-table").TablePlugin;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { inject, createVNode } from 'vue';
|
|
2
2
|
import { SettingsSharp } from '@vicons/ionicons5';
|
|
3
3
|
import { NIcon } from 'naive-ui';
|
|
4
|
-
import '
|
|
5
|
-
import { WIDGET_TYPE, InjectionIhoTableEmits } from '
|
|
6
|
-
import { defineTablePlugin } from '
|
|
4
|
+
import '../../../../index2.js';
|
|
5
|
+
import { WIDGET_TYPE, InjectionIhoTableEmits } from '../../../constants/index2.js';
|
|
6
|
+
import { defineTablePlugin } from '../../../hooks/useTablePlugin2.js';
|
|
7
7
|
|
|
8
8
|
function seqRendererPlugin() {
|
|
9
9
|
const pluginName = "seqRendererPlugin";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AnyObject } from '../../../../../es/shared/types';
|
|
1
2
|
import { VxeTableProps, VxeTableDefines } from 'vxe-table';
|
|
2
3
|
export * from './pluginType';
|
|
3
4
|
export interface IhoTableConfig extends VxeTableProps {
|
|
@@ -21,3 +22,9 @@ export declare type LowCodeTableFieldItem = {
|
|
|
21
22
|
colWidth?: string | number;
|
|
22
23
|
settingObj: LowCodeTableSettingObj;
|
|
23
24
|
}>;
|
|
25
|
+
export declare type IhoFormChangePayload = {
|
|
26
|
+
column: VxeTableDefines.ColumnInfo;
|
|
27
|
+
row: AnyObject;
|
|
28
|
+
value: unknown;
|
|
29
|
+
index: number;
|
|
30
|
+
};
|
|
@@ -19,6 +19,20 @@ export declare abstract class AbstractConfigHooks {
|
|
|
19
19
|
abstract readonly rowConfig: SyncWaterfallHook<WithTableConfig<IhoTableConfig['rowConfig']>>;
|
|
20
20
|
abstract readonly editConfig: SyncWaterfallHook<WithTableConfig<IhoTableConfig['editConfig']>>;
|
|
21
21
|
abstract readonly columnConfig: SyncWaterfallHook<WithTableConfig<IhoTableConfig['columnConfig']>>;
|
|
22
|
+
abstract readonly resizableConfig: SyncWaterfallHook<WithTableConfig<IhoTableConfig['resizableConfig']>>;
|
|
23
|
+
abstract readonly seqConfig: SyncWaterfallHook<WithTableConfig<IhoTableConfig['seqConfig']>>;
|
|
24
|
+
abstract readonly sortConfig: SyncWaterfallHook<WithTableConfig<IhoTableConfig['sortConfig']>>;
|
|
25
|
+
abstract readonly filterConfig: SyncWaterfallHook<WithTableConfig<IhoTableConfig['filterConfig']>>;
|
|
26
|
+
abstract readonly radioConfig: SyncWaterfallHook<WithTableConfig<IhoTableConfig['radioConfig']>>;
|
|
27
|
+
abstract readonly checkboxConfig: SyncWaterfallHook<WithTableConfig<IhoTableConfig['checkboxConfig']>>;
|
|
28
|
+
abstract readonly expandConfig: SyncWaterfallHook<WithTableConfig<IhoTableConfig['expandConfig']>>;
|
|
29
|
+
abstract readonly treeConfig: SyncWaterfallHook<WithTableConfig<IhoTableConfig['treeConfig']>>;
|
|
30
|
+
abstract readonly mouseConfig: SyncWaterfallHook<WithTableConfig<IhoTableConfig['mouseConfig']>>;
|
|
31
|
+
abstract readonly menuConfig: SyncWaterfallHook<WithTableConfig<IhoTableConfig['menuConfig']>>;
|
|
32
|
+
abstract readonly keyboardConfig: SyncWaterfallHook<WithTableConfig<IhoTableConfig['keyboardConfig']>>;
|
|
33
|
+
abstract readonly scrollY: SyncWaterfallHook<WithTableConfig<IhoTableConfig['scrollY']>>;
|
|
34
|
+
abstract readonly scrollX: SyncWaterfallHook<WithTableConfig<IhoTableConfig['scrollX']>>;
|
|
35
|
+
abstract readonly editRules: SyncWaterfallHook<WithTableConfig<IhoTableConfig['editRules']>>;
|
|
22
36
|
}
|
|
23
37
|
export interface FieldHookContext {
|
|
24
38
|
index: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { IhoTableLog, IhoTableWarn } from './index2.js';
|
|
1
|
+
export { IhoTableLog, IhoTableWarn, getRowHeight } from './index2.js';
|
|
@@ -1,8 +1,19 @@
|
|
|
1
|
+
import { inject } from 'vue';
|
|
2
|
+
import { InjectionIhoTableConfig } from '../constants/index2.js';
|
|
3
|
+
|
|
1
4
|
function IhoTableLog(message) {
|
|
2
5
|
return console.log(`[IhoTable]: ${message}`);
|
|
3
6
|
}
|
|
4
7
|
function IhoTableWarn(message) {
|
|
5
8
|
return console.warn(`[IhoTable]: ${message}`);
|
|
6
9
|
}
|
|
10
|
+
function getRowHeight() {
|
|
11
|
+
var _a, _b, _c;
|
|
12
|
+
const config = inject(InjectionIhoTableConfig);
|
|
13
|
+
if (!config) {
|
|
14
|
+
IhoTableWarn("please use this function(getRowHeight) in setup environment");
|
|
15
|
+
}
|
|
16
|
+
return (_c = (_b = (_a = config == null ? void 0 : config.value) == null ? void 0 : _a.rowConfig) == null ? void 0 : _b.height) != null ? _c : 32;
|
|
17
|
+
}
|
|
7
18
|
|
|
8
|
-
export { IhoTableLog, IhoTableWarn };
|
|
19
|
+
export { IhoTableLog, IhoTableWarn, getRowHeight };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cnhis-design-vue",
|
|
3
|
-
"version": "3.1.22-beta.
|
|
3
|
+
"version": "3.1.22-beta.2",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"module": "./es/components/index.js",
|
|
6
6
|
"main": "./es/components/index.js",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"vue": "^3.2.0",
|
|
56
56
|
"vue-simple-uploader": "^1.0.0-beta.5",
|
|
57
57
|
"vuedraggable": "4.1.0",
|
|
58
|
-
"vxe-table": "4.2.
|
|
58
|
+
"vxe-table": "^4.2.5",
|
|
59
59
|
"xe-utils": "^3.5.4"
|
|
60
60
|
},
|
|
61
61
|
"browserslist": [
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"iOS 7",
|
|
67
67
|
"last 3 iOS versions"
|
|
68
68
|
],
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "ae86e2867a9682d3798d7a9ed84185c2a78dc960"
|
|
70
70
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { loadVxeTable } from './loadVxe2.js';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { safeComponentRegister } from './index2.js';
|
|
2
|
-
import VXETable from 'vxe-table';
|
|
3
|
-
|
|
4
|
-
function loadVxeTable(app) {
|
|
5
|
-
safeComponentRegister(app, VXETable, "VxeTable", () => {
|
|
6
|
-
app.use(VXETable);
|
|
7
|
-
import('vxe-table/lib/style.css');
|
|
8
|
-
import('xe-utils');
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export { loadVxeTable };
|