cnhis-design-vue 3.1.23-beta.11 → 3.1.23-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.
Files changed (41) hide show
  1. package/README.md +123 -123
  2. package/es/components/big-table/src/components/edit-form/useCommon.d.ts +4 -0
  3. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  4. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
  5. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
  6. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
  7. package/es/components/fabric-chart/src/utils/index.d.ts +6823 -0
  8. package/es/components/form-config/index.d.ts +1 -0
  9. package/es/components/form-config/src/FormConfig.vue.d.ts +1 -0
  10. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +1 -0
  11. package/es/components/form-render/src/components/renderer/levelSearchCascade.d.ts +2 -0
  12. package/es/components/form-render/src/components/renderer/levelSearchCascade.js +23 -15
  13. package/es/components/form-render/src/components/renderer/search.d.ts +2 -0
  14. package/es/components/form-render/src/components/renderer/search.js +1 -0
  15. package/es/components/form-render/src/components/renderer/searchCascade.js +1 -0
  16. package/es/components/form-render/src/components/renderer/select.js +1 -0
  17. package/es/components/form-render/src/types/fieldItem.d.ts +1 -0
  18. package/es/components/iho-table/index.d.ts +100 -270
  19. package/es/components/iho-table/src/IhoTable.vue.d.ts +100 -270
  20. package/es/components/iho-table/src/components/IhoTableColumn.js +1 -1
  21. package/es/components/iho-table/src/plugins/defaultConfigPlugin/index2.js +1 -1
  22. package/es/components/iho-table/src/plugins/index.d.ts +1 -0
  23. package/es/components/iho-table/src/plugins/index.js +1 -0
  24. package/es/components/iho-table/src/plugins/index2.js +1 -0
  25. package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index2.js +1 -1
  26. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useCommon.d.ts +4 -0
  27. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/checkRendererPlugin.js +2 -0
  28. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/labelRendererPlugin.js +2 -0
  29. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/pictureRendererPlugin.js +3 -1
  30. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/seqRendererPlugin.js +16 -26
  31. package/es/components/iho-table/src/plugins/virtualTreePlugin/index.d.ts +1 -0
  32. package/es/components/iho-table/src/plugins/virtualTreePlugin/index.js +1 -0
  33. package/es/components/iho-table/src/plugins/virtualTreePlugin/index2.js +84 -0
  34. package/es/components/iho-table/src/types/index.d.ts +1 -0
  35. package/es/components/shortcut-setter/index.d.ts +1 -0
  36. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -0
  37. package/es/shared/utils/index.d.ts +2 -1
  38. package/es/shared/utils/index.js +1 -1
  39. package/es/shared/utils/index2.js +5 -4
  40. package/es/shared/utils/tapable/index.d.ts +139 -0
  41. package/package.json +2 -2
@@ -2,34 +2,13 @@ import { inject, createVNode } from 'vue';
2
2
  import { SettingsSharp } from '@vicons/ionicons5';
3
3
  import { NIcon } from 'naive-ui';
4
4
  import '../../../../index2.js';
5
- import { WIDGET_TYPE, InjectionIhoTableEmits } from '../../../constants/index2.js';
5
+ import { InjectionIhoTableEmits } from '../../../constants/index2.js';
6
6
  import { defineTablePlugin } from '../../../hooks/useTablePlugin2.js';
7
7
 
8
8
  function seqRendererPlugin() {
9
9
  const pluginName = "seqRendererPlugin";
10
10
  return defineTablePlugin({
11
11
  name: pluginName,
12
- vxe(instance) {
13
- instance.renderer.add(WIDGET_TYPE.SEQUENCE, {
14
- renderCell(renderOpts, {
15
- $rowIndex
16
- }) {
17
- return [`${$rowIndex}`];
18
- },
19
- renderHeader() {
20
- const emits = inject(InjectionIhoTableEmits);
21
- function onClick() {
22
- emits && emits("settingClick");
23
- }
24
- return [createVNode(NIcon, {
25
- "size": "14",
26
- "color": "#777",
27
- "component": SettingsSharp,
28
- "onClick": onClick
29
- }, null)];
30
- }
31
- });
32
- },
33
12
  apply(hooks) {
34
13
  hooks.fieldHooks.field.tap(pluginName, (field, {
35
14
  index,
@@ -39,10 +18,21 @@ function seqRendererPlugin() {
39
18
  insertBefore({
40
19
  align: "center",
41
20
  fixed: "left",
42
- width: 34,
43
- field: pluginName,
44
- editRender: {
45
- name: WIDGET_TYPE.SEQUENCE
21
+ width: 50,
22
+ type: "seq",
23
+ slots: {
24
+ header() {
25
+ const emits = inject(InjectionIhoTableEmits);
26
+ function onClick() {
27
+ emits && emits("settingClick");
28
+ }
29
+ return [createVNode(NIcon, {
30
+ "size": "14",
31
+ "color": "#777",
32
+ "component": SettingsSharp,
33
+ "onClick": onClick
34
+ }, null)];
35
+ }
46
36
  }
47
37
  });
48
38
  }
@@ -0,0 +1 @@
1
+ export declare function virtualTreePlugin(): import("../../../../../../es/components/iho-table").TablePlugin;
@@ -0,0 +1 @@
1
+ export { virtualTreePlugin } from './index2.js';
@@ -0,0 +1,84 @@
1
+ import { DMZ, traverse, uuidGenerator } from '../../../../../shared/utils/index2.js';
2
+ import { isArray, isFunction } from 'lodash-es';
3
+ import { onBeforeUnmount } from 'vue';
4
+ import '../../../index2.js';
5
+ import { defineTablePlugin } from '../../hooks/useTablePlugin2.js';
6
+
7
+ function virtualTreePlugin() {
8
+ const pluginName = "virtualTreePlugin";
9
+ const treeNodeColumnIndexMap = /* @__PURE__ */ new Map();
10
+ return defineTablePlugin({
11
+ name: pluginName,
12
+ apply(hooks) {
13
+ hooks.dataHooks.data.tap(pluginName, (rowData, context, config) => {
14
+ const {
15
+ transform,
16
+ rowField = "__parentId",
17
+ parentField = "parentId",
18
+ children = "childrenList"
19
+ } = config.treeConfig || DMZ;
20
+ if (!transform)
21
+ return;
22
+ enrichRowData(rowData);
23
+ if (!isArray(rowData[children]))
24
+ return;
25
+ traverse(rowData[children], (item, _, parent) => {
26
+ parent && (item[parentField] = parent[rowField]);
27
+ context.insertAfter(item);
28
+ enrichRowData(item);
29
+ }, children, rowData);
30
+ function enrichRowData(rowData2) {
31
+ rowData2[rowField] = rowData2[rowField] || rowData2.theUniqueKey || uuidGenerator();
32
+ }
33
+ });
34
+ hooks.fieldHooks.fieldList.tap(pluginName, (fieldList, config) => {
35
+ const { transform } = config.treeConfig || DMZ;
36
+ if (transform && config.uuid) {
37
+ const treeNodeColumnIndex = fieldList.findIndex((field) => field.treeNode);
38
+ treeNodeColumnIndexMap.set(config.uuid, {
39
+ index: ~treeNodeColumnIndex ? treeNodeColumnIndex : 0,
40
+ length: fieldList.length
41
+ });
42
+ !~treeNodeColumnIndex && Reflect.set(fieldList[0], "treeNode", true);
43
+ }
44
+ return fieldList;
45
+ });
46
+ hooks.configHooks.config.tap(pluginName, (config) => {
47
+ const { transform, parentField = "parentId", rowField = "__parentId" } = config.treeConfig || DMZ;
48
+ if (!transform)
49
+ return config;
50
+ Object.assign(config.treeConfig, { parentField, rowField });
51
+ if (transform && !isFunction(config.spanMethod)) {
52
+ config.spanMethod = (...args) => {
53
+ const { row, column, columnIndex } = args[0];
54
+ const treeNodeColumnInfo = treeNodeColumnIndexMap.get(config.uuid);
55
+ if (!treeNodeColumnInfo)
56
+ return;
57
+ if (column.treeNode) {
58
+ if (row[parentField])
59
+ return { rowspan: 1, colspan: 1 };
60
+ return { rowspan: 1, colspan: 99999 };
61
+ } else {
62
+ if (row[parentField])
63
+ return { rowspan: 1, colspan: 1 };
64
+ if (columnIndex < treeNodeColumnInfo.index)
65
+ return { rowspan: 1, colspan: 1 };
66
+ return { rowspan: 0, colspan: 0 };
67
+ }
68
+ };
69
+ }
70
+ return config;
71
+ });
72
+ hooks.setupHooks.setup.tap(pluginName, (configRef) => {
73
+ onBeforeUnmount(() => {
74
+ var _a;
75
+ if (!((_a = configRef.value) == null ? void 0 : _a.uuid))
76
+ return;
77
+ treeNodeColumnIndexMap.delete(configRef.value.uuid);
78
+ });
79
+ });
80
+ }
81
+ });
82
+ }
83
+
84
+ export { virtualTreePlugin };
@@ -37,6 +37,7 @@ export declare type LowCodeTableFieldItem = {
37
37
  title: string;
38
38
  colWidth: string | number;
39
39
  settingObj: LowCodeTableSettingObj;
40
+ treeNode: boolean;
40
41
  }>;
41
42
  export declare type IhoFormChangePayload = {
42
43
  column: VxeTableDefines.ColumnInfo;
@@ -98,6 +98,7 @@ declare const ShortcutSetter: SFCWithInstall<import("vue").DefineComponent<{
98
98
  name?: string | undefined;
99
99
  render_key?: string[] | undefined;
100
100
  search_key?: string[] | undefined;
101
+ primary_key?: string | undefined;
101
102
  type?: string | undefined;
102
103
  value_key?: string | undefined;
103
104
  level_key?: string | undefined;
@@ -100,6 +100,7 @@ declare const _default: import("vue").DefineComponent<{
100
100
  name?: string | undefined;
101
101
  render_key?: string[] | undefined;
102
102
  search_key?: string[] | undefined;
103
+ primary_key?: string | undefined;
103
104
  type?: string | undefined;
104
105
  value_key?: string | undefined;
105
106
  level_key?: string | undefined;
@@ -1,8 +1,9 @@
1
1
  import { AnyObject, ArrayAble } from '../../../es/shared/types';
2
2
  import { App, Component } from 'vue';
3
- export declare function traverse<T extends ArrayAble<AnyObject>>(target: T, handler: (item: T extends Array<infer P> ? P : T, stop: () => void) => void, keys?: ArrayAble<string>): void;
3
+ export declare function traverse<T extends ArrayAble<AnyObject>>(target: T, handler: (item: T extends Array<infer P> ? P : T, stop: () => void, parent?: typeof item) => void, keys?: ArrayAble<string>, parent?: T): void;
4
4
  export declare function safeComponentRegister(app: App, component: Component, cName?: string | undefined, scheduler?: () => void): void;
5
5
  export declare function generateTimeFormat(format: string): string | undefined;
6
6
  export declare function arrayed<T>(maybeArray: T): T extends Array<any> ? T : [T];
7
7
  export declare function uuidGenerator(): string;
8
8
  export declare const getStringWidth: import("@vueuse/core").UseMemoizedFn<number, [str: string]>;
9
+ export declare const DMZ: AnyObject;
@@ -1 +1 @@
1
- export { arrayed, generateTimeFormat, getStringWidth, safeComponentRegister, traverse, uuidGenerator } from './index2.js';
1
+ export { DMZ, arrayed, generateTimeFormat, getStringWidth, safeComponentRegister, traverse, uuidGenerator } from './index2.js';
@@ -1,15 +1,15 @@
1
1
  import { useMemoize } from '@vueuse/core';
2
2
  import { isArray, isString } from 'lodash-es';
3
3
 
4
- function traverse(target, handler, keys = "children") {
4
+ function traverse(target, handler, keys = "children", parent) {
5
5
  function stop() {
6
6
  throw "silence break traverse";
7
7
  }
8
8
  try {
9
9
  arrayed(target).forEach((item) => {
10
- handler(item, stop);
10
+ handler(item, stop, parent);
11
11
  arrayed(keys).forEach((key) => {
12
- isArray(item[key]) && traverse(item[key], handler);
12
+ isArray(item[key]) && traverse(item[key], handler, keys, item);
13
13
  });
14
14
  });
15
15
  } catch (err) {
@@ -93,5 +93,6 @@ const getStringWidth = /* @__PURE__ */ useMemoize(function(str) {
93
93
  return width + 6;
94
94
  }, 0);
95
95
  });
96
+ const DMZ = Object.seal(/* @__PURE__ */ Object.create(null));
96
97
 
97
- export { arrayed, generateTimeFormat, getStringWidth, safeComponentRegister, traverse, uuidGenerator };
98
+ export { DMZ, arrayed, generateTimeFormat, getStringWidth, safeComponentRegister, traverse, uuidGenerator };
@@ -0,0 +1,139 @@
1
+ type FixedSizeArray<T extends number, U> = T extends 0
2
+ ? void[]
3
+ : ReadonlyArray<U> & {
4
+ 0: U;
5
+ length: T;
6
+ };
7
+ type Measure<T extends number> = T extends 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 ? T : never;
8
+ type Append<T extends any[], U> = {
9
+ 0: [U];
10
+ 1: [T[0], U];
11
+ 2: [T[0], T[1], U];
12
+ 3: [T[0], T[1], T[2], U];
13
+ 4: [T[0], T[1], T[2], T[3], U];
14
+ 5: [T[0], T[1], T[2], T[3], T[4], U];
15
+ 6: [T[0], T[1], T[2], T[3], T[4], T[5], U];
16
+ 7: [T[0], T[1], T[2], T[3], T[4], T[5], T[6], U];
17
+ 8: [T[0], T[1], T[2], T[3], T[4], T[5], T[6], T[7], U];
18
+ }[Measure<T['length']>];
19
+ type AsArray<T> = T extends any[] ? T : [T];
20
+
21
+ declare class UnsetAdditionalOptions {
22
+ _UnsetAdditionalOptions: true;
23
+ }
24
+ type IfSet<X> = X extends UnsetAdditionalOptions ? {} : X;
25
+
26
+ type Callback<E, T> = (error: E | null, result?: T) => void;
27
+ type InnerCallback<E, T> = (error?: E | null | false, result?: T) => void;
28
+
29
+ type FullTap = Tap & {
30
+ type: 'sync' | 'async' | 'promise';
31
+ fn: Function;
32
+ };
33
+
34
+ type Tap = TapOptions & {
35
+ name: string;
36
+ };
37
+
38
+ type TapOptions = {
39
+ before?: string;
40
+ stage?: number;
41
+ };
42
+
43
+ interface HookInterceptor<T, R, AdditionalOptions = UnsetAdditionalOptions> {
44
+ name?: string;
45
+ tap?: (tap: FullTap & IfSet<AdditionalOptions>) => void;
46
+ call?: (...args: any[]) => void;
47
+ loop?: (...args: any[]) => void;
48
+ error?: (err: Error) => void;
49
+ result?: (result: R) => void;
50
+ done?: () => void;
51
+ register?: (tap: FullTap & IfSet<AdditionalOptions>) => FullTap & IfSet<AdditionalOptions>;
52
+ }
53
+
54
+ type ArgumentNames<T extends any[]> = FixedSizeArray<T['length'], string>;
55
+
56
+ declare class Hook<T, R, AdditionalOptions = UnsetAdditionalOptions> {
57
+ constructor(args?: ArgumentNames<AsArray<T>>, name?: string);
58
+ name: string | undefined;
59
+ taps: FullTap[];
60
+ intercept(interceptor: HookInterceptor<T, R, AdditionalOptions>): void;
61
+ isUsed(): boolean;
62
+ callAsync(...args: Append<AsArray<T>, Callback<Error, R>>): void;
63
+ promise(...args: AsArray<T>): Promise<R>;
64
+ tap(options: string | (Tap & IfSet<AdditionalOptions>), fn: (...args: AsArray<T>) => R): void;
65
+ withOptions(options: TapOptions & IfSet<AdditionalOptions>): Omit<this, 'call' | 'callAsync' | 'promise'>;
66
+ }
67
+
68
+ export class SyncHook<T, R = void, AdditionalOptions = UnsetAdditionalOptions> extends Hook<T, R, AdditionalOptions> {
69
+ call(...args: AsArray<T>): R;
70
+ }
71
+
72
+ export class SyncBailHook<T, R, AdditionalOptions = UnsetAdditionalOptions> extends SyncHook<T, R, AdditionalOptions> {}
73
+ export class SyncLoopHook<T, AdditionalOptions = UnsetAdditionalOptions> extends SyncHook<T, void, AdditionalOptions> {}
74
+ export class SyncWaterfallHook<T, AdditionalOptions = UnsetAdditionalOptions> extends SyncHook<
75
+ T,
76
+ AsArray<T>[0],
77
+ AdditionalOptions
78
+ > {}
79
+
80
+ declare class AsyncHook<T, R, AdditionalOptions = UnsetAdditionalOptions> extends Hook<T, R, AdditionalOptions> {
81
+ tapAsync(
82
+ options: string | (Tap & IfSet<AdditionalOptions>),
83
+ fn: (...args: Append<AsArray<T>, InnerCallback<Error, R>>) => void
84
+ ): void;
85
+ tapPromise(options: string | (Tap & IfSet<AdditionalOptions>), fn: (...args: AsArray<T>) => Promise<R>): void;
86
+ }
87
+
88
+ export class AsyncParallelHook<T, AdditionalOptions = UnsetAdditionalOptions> extends AsyncHook<
89
+ T,
90
+ void,
91
+ AdditionalOptions
92
+ > {}
93
+ export class AsyncParallelBailHook<T, R, AdditionalOptions = UnsetAdditionalOptions> extends AsyncHook<
94
+ T,
95
+ R,
96
+ AdditionalOptions
97
+ > {}
98
+ export class AsyncSeriesHook<T, AdditionalOptions = UnsetAdditionalOptions> extends AsyncHook<
99
+ T,
100
+ void,
101
+ AdditionalOptions
102
+ > {}
103
+ export class AsyncSeriesBailHook<T, R, AdditionalOptions = UnsetAdditionalOptions> extends AsyncHook<
104
+ T,
105
+ R,
106
+ AdditionalOptions
107
+ > {}
108
+ export class AsyncSeriesLoopHook<T, AdditionalOptions = UnsetAdditionalOptions> extends AsyncHook<
109
+ T,
110
+ void,
111
+ AdditionalOptions
112
+ > {}
113
+ export class AsyncSeriesWaterfallHook<T, AdditionalOptions = UnsetAdditionalOptions> extends AsyncHook<
114
+ T,
115
+ AsArray<T>[0],
116
+ AdditionalOptions
117
+ > {}
118
+
119
+ type HookFactory<H> = (key: any, hook?: H) => H;
120
+
121
+ interface HookMapInterceptor<H> {
122
+ factory?: HookFactory<H>;
123
+ }
124
+
125
+ export class HookMap<H> {
126
+ constructor(factory: HookFactory<H>, name?: string);
127
+ name: string | undefined;
128
+ get(key: any): H | undefined;
129
+ for(key: any): H;
130
+ intercept(interceptor: HookMapInterceptor<H>): void;
131
+ }
132
+
133
+ export class MultiHook<H> {
134
+ constructor(hooks: H[], name?: string);
135
+ name: string | undefined;
136
+ tap(options: string | Tap, fn?: Function): void;
137
+ tapAsync(options: string | Tap, fn?: Function): void;
138
+ tapPromise(options: string | Tap, fn?: Function): void;
139
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.1.23-beta.11",
3
+ "version": "3.1.23-beta.12",
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": "5582c78f5b4a4e969ee1e6089307d2142107816c"
69
+ "gitHead": "f819538beb54e1a0cac4986b22568eadb3331662"
70
70
  }