cnhis-design-vue 3.1.15-beta.7 → 3.1.15
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/src/hooks/useAnnotation.js +1 -2
- package/es/packages/big-table/src/hooks/useColumnConfigAdaptor.js +7 -2
- package/es/packages/big-table/src/hooks/useEdit.js +16 -8
- package/es/packages/fabric-chart/src/hooks/useDraw.js +1 -0
- package/es/packages/fabric-chart/src/hooks/useLeft.js +1 -2
- package/es/packages/form-config/index.d.ts +13854 -0
- package/es/packages/form-config/index.js +10 -0
- package/es/packages/form-config/src/FormConfig.js +113 -0
- package/es/packages/form-config/src/FormConfig.vue.d.ts +13856 -0
- package/es/packages/form-config/src/components/FormConfigCreator.js +97 -0
- package/es/packages/form-config/src/components/FormConfigCreator.vue.d.ts +5094 -0
- package/es/packages/form-config/src/components/FormConfigEdit.js +81 -0
- package/es/packages/form-config/src/components/FormConfigEdit.vue.d.ts +5336 -0
- package/es/packages/form-config/src/constants/index.d.ts +28 -0
- package/es/packages/form-config/src/constants/index.js +28 -0
- package/es/packages/form-config/src/hooks/index.d.ts +2 -0
- package/es/packages/form-config/src/hooks/index.js +2 -0
- package/es/packages/form-config/src/hooks/useConfigurationField.d.ts +6 -0
- package/es/packages/form-config/src/hooks/useConfigurationField.js +103 -0
- package/es/packages/form-config/src/hooks/usePresetRenderer.d.ts +5 -0
- package/es/packages/form-config/src/hooks/usePresetRenderer.js +117 -0
- package/es/packages/form-config/src/hooks/useSortable.d.ts +11 -0
- package/es/packages/form-config/src/hooks/useSortable.js +31 -0
- package/es/packages/form-config/src/types/index.d.ts +18 -0
- package/es/packages/form-config/src/types/index.js +1 -0
- package/es/packages/form-config/style/index.css +108 -0
- package/es/packages/form-render/index.d.ts +3 -3
- package/es/packages/form-render/src/FormRender.vue.d.ts +3 -3
- package/es/packages/form-render/src/components/renderer/combination/index.js +3 -3
- package/es/packages/form-render/src/components/renderer/date.d.ts +2 -2
- package/es/packages/form-render/src/components/renderer/formItem.js +3 -3
- package/es/packages/form-render/src/components/renderer/select.js +16 -9
- package/es/packages/form-render/src/hooks/useAsyncQueue.d.ts +2 -2
- package/es/packages/form-render/src/hooks/useAsyncQueue.js +4 -8
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +4 -3
- package/es/packages/form-render/src/hooks/useFormContext.js +10 -4
- package/es/packages/form-render/src/hooks/useFormRenderLifeCycle.d.ts +2 -2
- package/es/packages/form-render/src/types/fieldItem.d.ts +8 -0
- package/es/packages/form-render/src/types/index.d.ts +7 -3
- package/es/packages/form-render/src/utils/index.d.ts +3 -2
- package/es/packages/form-render/src/utils/index.js +30 -7
- package/es/packages/form-table/src/hooks/useNuiThemeOverrides.js +1 -1
- package/es/packages/index.css +108 -0
- package/es/packages/index.d.ts +4 -1
- package/es/packages/index.js +5 -2
- package/es/packages/scale-view/src/hooks/scaleview-init.js +35 -35
- package/es/packages/shortcut-provider/index.d.ts +17 -2
- package/es/packages/shortcut-provider/index.js +1 -1
- package/es/packages/shortcut-provider/src/ShortcutProvider.js +5 -1
- package/es/packages/shortcut-provider/src/ShortcutProvider.vue.d.ts +17 -2
- package/es/packages/shortcut-provider/src/hooks/index.js +1 -1
- package/es/packages/shortcut-provider/src/hooks/useShortcuts.d.ts +10 -10
- package/es/packages/shortcut-provider/src/hooks/useShortcuts.js +45 -38
- package/es/packages/shortcut-provider/src/types/index.d.ts +2 -19
- package/es/packages/shortcut-setter/index.d.ts +1701 -4286
- package/es/packages/shortcut-setter/src/ShortcutSetter.js +63 -10
- package/es/packages/shortcut-setter/src/ShortcutSetter.vue.d.ts +1723 -4306
- package/es/packages/shortcut-setter/src/ShortcutSetterItem.js +26 -95
- package/es/packages/shortcut-setter/src/ShortcutSetterItem.vue.d.ts +30 -3363
- package/es/packages/shortcut-setter/src/types/index.d.ts +6 -0
- package/es/packages/shortcut-setter/src/types/index.js +1 -0
- package/es/src/utils/state.d.ts +29 -0
- package/es/src/utils/state.js +44 -0
- package/package.json +2 -1
- package/es/packages/shortcut-setter/constant/index.d.ts +0 -4
- package/es/packages/shortcut-setter/constant/index.js +0 -7
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import { ShortcutManager } from '../../../../es/packages/shortcut-provider';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{
|
|
3
|
+
scope: {
|
|
4
|
+
type: (SymbolConstructor | StringConstructor)[];
|
|
5
|
+
};
|
|
6
|
+
}, {
|
|
7
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
8
|
+
scope: {
|
|
9
|
+
type: (SymbolConstructor | StringConstructor)[];
|
|
10
|
+
};
|
|
11
|
+
}>> & {
|
|
12
|
+
[x: `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
|
|
13
|
+
}>>;
|
|
3
14
|
shortcutWrapperRef: import("vue").Ref<HTMLElement | undefined>;
|
|
4
15
|
manager: ShortcutManager;
|
|
5
|
-
},
|
|
16
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
17
|
+
scope: {
|
|
18
|
+
type: (SymbolConstructor | StringConstructor)[];
|
|
19
|
+
};
|
|
20
|
+
}>>, {}>;
|
|
6
21
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ShortcutManager, useShortcuts } from './useShortcuts.js';
|
|
1
|
+
export { GlobalShortcutProvider, ShortcutManager, useShortcuts } from './useShortcuts.js';
|
|
2
2
|
export { useShortcutSignature } from './useShortcutSignature.js';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ShortcutItem, ShortcutOption, ShortcutSignatureInfo } from '../../../../../es/packages/shortcut-provider/src/types';
|
|
2
1
|
import { MaybeRef } from '@vueuse/core';
|
|
2
|
+
import { ShortcutItem, ShortcutOption, ShortcutSignatureInfo } from '../../../../../es/packages/shortcut-provider/src/types';
|
|
3
|
+
export declare const GlobalShortcutProvider: unique symbol;
|
|
3
4
|
export declare class ShortcutManager {
|
|
4
5
|
private readonly shortcutCallbackMap;
|
|
5
6
|
private readonly shortcutCache;
|
|
@@ -7,27 +8,26 @@ export declare class ShortcutManager {
|
|
|
7
8
|
private handle?;
|
|
8
9
|
disabled: boolean;
|
|
9
10
|
static log(message: string, dryRun?: boolean): string;
|
|
10
|
-
constructor(environmentEle?: MaybeRef<HTMLElement | undefined
|
|
11
|
+
constructor(environmentEle?: MaybeRef<HTMLElement | undefined>, scope?: string | Symbol);
|
|
11
12
|
get traverse(): Omit<ShortcutItem, "callback">[];
|
|
12
|
-
query
|
|
13
|
-
|
|
14
|
-
update(key: string, info?: KeyboardEvent | Partial<ShortcutSignatureInfo>): Promise<void>;
|
|
13
|
+
private query;
|
|
14
|
+
update(key: string, info: KeyboardEvent | Partial<ShortcutSignatureInfo>): Promise<void>;
|
|
15
15
|
register(shortcutItem: ShortcutItem): {
|
|
16
16
|
stop: () => void;
|
|
17
|
+
start: () => void;
|
|
17
18
|
signature: () => string;
|
|
18
19
|
};
|
|
19
20
|
start(): this;
|
|
20
21
|
destroy(): void;
|
|
22
|
+
clear(): void;
|
|
21
23
|
}
|
|
22
|
-
export declare function useShortcuts(
|
|
24
|
+
export declare function useShortcuts(scope?: MaybeRef<string | Symbol | undefined>): {
|
|
23
25
|
register: (shortcut: ShortcutOption) => {
|
|
24
26
|
stop: () => void;
|
|
25
27
|
signature: () => string;
|
|
26
28
|
};
|
|
27
29
|
traverse: () => Omit<ShortcutItem, "callback">[];
|
|
28
|
-
|
|
29
|
-
update: (key: string, info: KeyboardEvent | Partial<ShortcutSignatureInfo>) => void
|
|
30
|
-
onReset: (key: string) => void;
|
|
31
|
-
updateDisabled: (key: string, state?: boolean) => void;
|
|
30
|
+
clear: () => void;
|
|
31
|
+
update: (key: string, info: KeyboardEvent | Partial<ShortcutSignatureInfo>) => Promise<void>;
|
|
32
32
|
updateManagerDisabled: (disabled?: boolean) => void;
|
|
33
33
|
};
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import { ShortcutStatus, InjectionShortcutManager } from '../../../../packages/shortcut-provider/src/constants';
|
|
2
|
-
import { normalizeSignatureInfo, getKeySignature, getDisplaySignature, isInvalidSignature, isKeyboardEvent, findAncestor, isShortcutProvider } from '../../../../packages/shortcut-provider/src/utils';
|
|
3
|
-
import { reactive, ref, unref, getCurrentInstance, inject, onBeforeUnmount } from 'vue';
|
|
4
1
|
import { useEventListener, useDebounceFn } from '@vueuse/core';
|
|
5
2
|
import { pick, omit, isFunction, isString } from 'lodash-es';
|
|
3
|
+
import { reactive, ref, unref, computed, getCurrentInstance, inject, onBeforeUnmount, onDeactivated, onActivated } from 'vue';
|
|
4
|
+
import { ShortcutStatus, InjectionShortcutManager } from '../../../../packages/shortcut-provider/src/constants';
|
|
5
|
+
import { normalizeSignatureInfo, getKeySignature, getDisplaySignature, isInvalidSignature, isKeyboardEvent, findAncestor, isShortcutProvider } from '../../../../packages/shortcut-provider/src/utils';
|
|
6
6
|
|
|
7
|
+
const GlobalShortcutProvider = Symbol("Glob");
|
|
8
|
+
const ShortcutManagerCacheMap = /* @__PURE__ */ new Map();
|
|
7
9
|
class ShortcutManager {
|
|
8
|
-
constructor(environmentEle) {
|
|
10
|
+
constructor(environmentEle, scope = GlobalShortcutProvider) {
|
|
9
11
|
this.shortcutCallbackMap = reactive(/* @__PURE__ */ new Map());
|
|
10
12
|
this.shortcutCache = ref({});
|
|
11
13
|
this.disabled = false;
|
|
12
14
|
this.environmentEle = environmentEle || window;
|
|
15
|
+
ShortcutManagerCacheMap.set(scope, this);
|
|
13
16
|
}
|
|
14
17
|
static log(message, dryRun = false) {
|
|
15
18
|
const _message = `[ShortcutManager] ${message}`;
|
|
@@ -22,12 +25,6 @@ class ShortcutManager {
|
|
|
22
25
|
query(key) {
|
|
23
26
|
return this.shortcutCache.value[key];
|
|
24
27
|
}
|
|
25
|
-
async updateDisabled(key, state) {
|
|
26
|
-
var _a;
|
|
27
|
-
const item = this.query(key);
|
|
28
|
-
await ((_a = item.onUpdateDisabled) == null ? void 0 : _a.call(item, key, state));
|
|
29
|
-
item.disabled = !!state;
|
|
30
|
-
}
|
|
31
28
|
async update(key, info) {
|
|
32
29
|
var _a, _b;
|
|
33
30
|
const oldKeySignature = (_a = this.query(key)) == null ? void 0 : _a.currentKeySignature;
|
|
@@ -35,11 +32,10 @@ class ShortcutManager {
|
|
|
35
32
|
const item = this.query(key);
|
|
36
33
|
if (!item)
|
|
37
34
|
return;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
item.currentKeySignature = getKeySignature(newInfo);
|
|
35
|
+
await ((_b = item.onUpdate) == null ? void 0 : _b.call(item, key, info ? normalizeSignatureInfo(info) : void 0));
|
|
36
|
+
checkSignature(this.shortcutCache, info);
|
|
37
|
+
item.currentKeySignature = getKeySignature(info);
|
|
38
|
+
item.shortcutSignature = normalizeSignatureInfo(info);
|
|
43
39
|
this.shortcutCallbackMap.set(item.currentKeySignature, this.shortcutCallbackMap.get(oldKeySignature));
|
|
44
40
|
this.shortcutCallbackMap.delete(oldKeySignature);
|
|
45
41
|
function checkSignature(shortcutCache, info2) {
|
|
@@ -69,6 +65,9 @@ class ShortcutManager {
|
|
|
69
65
|
stop: () => {
|
|
70
66
|
shortcut.status = ShortcutStatus.INACTIVE;
|
|
71
67
|
},
|
|
68
|
+
start: () => {
|
|
69
|
+
shortcut.status = ShortcutStatus.ACTIVE;
|
|
70
|
+
},
|
|
72
71
|
signature: () => shortcut.currentKeySignature
|
|
73
72
|
};
|
|
74
73
|
}
|
|
@@ -101,23 +100,35 @@ class ShortcutManager {
|
|
|
101
100
|
var _a;
|
|
102
101
|
this.handle && ((_a = unref(this.environmentEle)) == null ? void 0 : _a.removeEventListener("keyup", this.handle, { capture: true }));
|
|
103
102
|
this.handle = void 0;
|
|
103
|
+
this.clear();
|
|
104
|
+
}
|
|
105
|
+
clear() {
|
|
104
106
|
this.shortcutCallbackMap.clear();
|
|
107
|
+
this.shortcutCache.value = {};
|
|
105
108
|
}
|
|
106
109
|
}
|
|
107
110
|
const globManager = new ShortcutManager().start();
|
|
108
|
-
function useShortcuts(
|
|
111
|
+
function useShortcuts(scope) {
|
|
109
112
|
function useManager() {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
return computed(() => {
|
|
114
|
+
if (unref(scope)) {
|
|
115
|
+
const result = ShortcutManagerCacheMap.get(unref(scope));
|
|
116
|
+
if (!result)
|
|
117
|
+
ShortcutManager.log(`\u4E0D\u5B58\u5728\u7684scope=>${scope}, \u5C06\u4F7F\u7528\u5168\u5C40\u5FEB\u6377\u952E`);
|
|
118
|
+
return result || globManager;
|
|
119
|
+
} else if (getCurrentInstance()) {
|
|
120
|
+
return inject(InjectionShortcutManager, globManager);
|
|
121
|
+
} else {
|
|
122
|
+
ShortcutManager.log("\u975Esetup\u8BED\u5883\u4E0B\u7684shortcut\u5C06\u5F71\u54CD\u5168\u5C40");
|
|
123
|
+
return globManager;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
116
126
|
}
|
|
117
127
|
const manager = useManager();
|
|
118
128
|
function createShortcutItem(shortcut) {
|
|
119
129
|
return {
|
|
120
130
|
...shortcut,
|
|
131
|
+
shortcutSignature: normalizeSignatureInfo(shortcut.shortcutSignature),
|
|
121
132
|
currentKeySignature: getKeySignature(shortcut.shortcutSignature),
|
|
122
133
|
key: keyFor(shortcut),
|
|
123
134
|
status: ShortcutStatus.ACTIVE,
|
|
@@ -141,33 +152,29 @@ function useShortcuts(glob = false) {
|
|
|
141
152
|
}
|
|
142
153
|
}
|
|
143
154
|
function register(shortcut) {
|
|
144
|
-
const { stop, signature } = manager.register(createShortcutItem(shortcut));
|
|
145
|
-
if (getCurrentInstance()
|
|
155
|
+
const { stop, signature, start } = unref(manager).register(createShortcutItem(shortcut));
|
|
156
|
+
if (getCurrentInstance()) {
|
|
146
157
|
onBeforeUnmount(stop);
|
|
158
|
+
onDeactivated(stop);
|
|
159
|
+
onActivated(start);
|
|
147
160
|
} else {
|
|
148
161
|
ShortcutManager.log("\u5728\u975Esetup\u8BED\u5883\u4E0B\u4F7F\u7528register\u51FD\u6570,\u7EC4\u4EF6\u9500\u6BC1\u65F6\u53EF\u80FD\u9700\u8981\u624B\u52A8\u8C03\u7528stop\u51FD\u6570\u4F7F\u5FEB\u6377\u952E\u5931\u6D3B");
|
|
149
162
|
}
|
|
150
163
|
return { stop, signature };
|
|
151
164
|
}
|
|
152
165
|
function traverse() {
|
|
153
|
-
return
|
|
154
|
-
}
|
|
155
|
-
function query(key) {
|
|
156
|
-
return manager.query(key);
|
|
166
|
+
return unref(manager).traverse;
|
|
157
167
|
}
|
|
158
168
|
function update(key, info) {
|
|
159
|
-
manager.update(key, info);
|
|
160
|
-
}
|
|
161
|
-
function onReset(key) {
|
|
162
|
-
manager.update(key);
|
|
163
|
-
}
|
|
164
|
-
function updateDisabled(key, state) {
|
|
165
|
-
manager.updateDisabled(key, state);
|
|
169
|
+
return unref(manager).update(key, info);
|
|
166
170
|
}
|
|
167
171
|
function updateManagerDisabled(disabled) {
|
|
168
|
-
manager.disabled = !!disabled;
|
|
172
|
+
unref(manager).disabled = !!disabled;
|
|
173
|
+
}
|
|
174
|
+
function clear() {
|
|
175
|
+
unref(manager).clear();
|
|
169
176
|
}
|
|
170
|
-
return { register, traverse,
|
|
177
|
+
return { register, traverse, clear, update, updateManagerDisabled };
|
|
171
178
|
}
|
|
172
179
|
|
|
173
|
-
export { ShortcutManager, useShortcuts };
|
|
180
|
+
export { GlobalShortcutProvider, ShortcutManager, useShortcuts };
|
|
@@ -1,37 +1,21 @@
|
|
|
1
|
-
import { ArrayAble, WithUndefined } from '../../../../../es/src/types';
|
|
2
|
-
import { VNode } from 'vue';
|
|
3
1
|
import { ShortcutStatus } from '../../../../../es/packages/shortcut-provider/src/constants';
|
|
4
|
-
declare type Render = () => ArrayAble<VNode>;
|
|
5
2
|
export interface ShortcutSignatureInfo {
|
|
6
3
|
ctrl?: boolean;
|
|
7
4
|
shift?: boolean;
|
|
8
5
|
alt?: boolean;
|
|
9
6
|
key: string;
|
|
10
7
|
}
|
|
11
|
-
declare type UpdateResult = Promise<WithUndefined<ShortcutSignatureInfo> | void>;
|
|
12
8
|
export declare type ShortcutOption = {
|
|
13
|
-
label: string
|
|
9
|
+
label: string;
|
|
14
10
|
shortcutSignature: ShortcutSignatureInfo;
|
|
15
11
|
callback(): void;
|
|
16
12
|
} & Partial<{
|
|
17
|
-
/**
|
|
18
|
-
* @description 重置时回调
|
|
19
|
-
* @param key
|
|
20
|
-
*/
|
|
21
|
-
onReset(key: string): Promise<any>;
|
|
22
13
|
/**
|
|
23
14
|
* @description 更新快捷键回调
|
|
24
15
|
* @param key
|
|
25
16
|
* @param newSignature 用户输入的快捷键签名
|
|
26
|
-
* @return
|
|
27
|
-
*/
|
|
28
|
-
onUpdate(key: string, newSignature?: ShortcutSignatureInfo): UpdateResult;
|
|
29
|
-
/**
|
|
30
|
-
* @description 更新快捷键disabled状态回调
|
|
31
|
-
* @param key
|
|
32
|
-
* @param newState
|
|
33
17
|
*/
|
|
34
|
-
|
|
18
|
+
onUpdate(key: string, newSignature?: ShortcutSignatureInfo): Promise<void>;
|
|
35
19
|
/**
|
|
36
20
|
* 快捷键输入框展位文本
|
|
37
21
|
*/
|
|
@@ -57,4 +41,3 @@ export interface ShortcutItem extends ShortcutOption {
|
|
|
57
41
|
currentKeySignature: string;
|
|
58
42
|
key: string;
|
|
59
43
|
}
|
|
60
|
-
export {};
|