cnhis-design-vue 3.1.15-beta.7 → 3.1.16-beta.0
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/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 +2 -6040
- package/es/packages/shortcut-setter/src/ShortcutSetter.js +60 -10
- package/es/packages/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -6041
- 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,5 +1,7 @@
|
|
|
1
|
-
import { defineComponent, computed, openBlock, createBlock, unref } from 'vue';
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent, ref, computed, watch, openBlock, createBlock, unref } from 'vue';
|
|
2
|
+
import { isEqual, cloneDeep } from 'lodash-es';
|
|
3
|
+
import { GlobalShortcutProvider, useShortcuts } from '../../../packages/shortcut-provider';
|
|
4
|
+
import { normalizeSignatureInfo, isInvalidSignature, getDisplaySignature } from '../../../packages/shortcut-provider/src/utils';
|
|
3
5
|
import ShortcutSetterItem from './ShortcutSetterItem.js';
|
|
4
6
|
import FormRender from '../../form-render/index.js';
|
|
5
7
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.js';
|
|
@@ -7,18 +9,34 @@ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.js';
|
|
|
7
9
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
10
|
__name: "ShortcutSetter",
|
|
9
11
|
props: {
|
|
10
|
-
glob: { type: Boolean, default: false }
|
|
12
|
+
glob: { type: Boolean, default: false },
|
|
13
|
+
scope: null
|
|
11
14
|
},
|
|
12
|
-
|
|
15
|
+
emits: ["error", "update"],
|
|
16
|
+
setup(__props, { expose, emit }) {
|
|
13
17
|
const props = __props;
|
|
14
|
-
const
|
|
15
|
-
|
|
18
|
+
const components = { SHORTCUT: ShortcutSetterItem };
|
|
19
|
+
const key = ref(0);
|
|
20
|
+
const scope = computed(() => {
|
|
21
|
+
return props.glob ? GlobalShortcutProvider : props.scope;
|
|
22
|
+
});
|
|
23
|
+
const manager = useShortcuts(scope);
|
|
24
|
+
const fieldList = ref([]);
|
|
25
|
+
let shortcutCache = {};
|
|
26
|
+
watch([scope, () => manager.traverse()], loadSignature, { immediate: true, deep: true });
|
|
27
|
+
function loadSignature() {
|
|
28
|
+
shortcutCache = {};
|
|
29
|
+
fieldList.value = manager.traverse().map((shortcut) => {
|
|
30
|
+
shortcutCache[shortcut.key] = normalizeSignatureInfo(shortcut.shortcutSignature);
|
|
16
31
|
return {
|
|
17
32
|
val_key: shortcut.key,
|
|
18
33
|
alias: shortcut.label,
|
|
19
34
|
html_type: "SHORTCUT",
|
|
20
35
|
componentProps: {
|
|
21
|
-
|
|
36
|
+
scope: scope.value,
|
|
37
|
+
onShortcutChange,
|
|
38
|
+
shortcutKey: shortcut.key,
|
|
39
|
+
shortcutSignature: shortcut.shortcutSignature,
|
|
22
40
|
editPlaceholder: shortcut.editPlaceholder,
|
|
23
41
|
placeholder: shortcut.placeholder,
|
|
24
42
|
operation: shortcut.operation
|
|
@@ -26,13 +44,45 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
26
44
|
elem_width: 12
|
|
27
45
|
};
|
|
28
46
|
});
|
|
47
|
+
key.value++;
|
|
48
|
+
}
|
|
49
|
+
function onShortcutChange({
|
|
50
|
+
key: key2,
|
|
51
|
+
info,
|
|
52
|
+
resolve,
|
|
53
|
+
reject
|
|
54
|
+
}) {
|
|
55
|
+
const _info = normalizeSignatureInfo(info);
|
|
56
|
+
if (isInvalidSignature(_info)) {
|
|
57
|
+
emit("error", `\u975E\u6CD5\u7684\u5FEB\u6377\u952E\u7EC4\u5408=> ${getDisplaySignature(_info)}`);
|
|
58
|
+
return reject();
|
|
59
|
+
}
|
|
60
|
+
if (Object.values(shortcutCache).some((v) => isEqual(v, _info))) {
|
|
61
|
+
emit("error", `\u91CD\u590D\u7684\u5FEB\u6377\u952E=> ${getDisplaySignature(_info)}`);
|
|
62
|
+
return reject();
|
|
63
|
+
}
|
|
64
|
+
emit("update", { key: key2, info: _info });
|
|
65
|
+
shortcutCache[key2] = _info;
|
|
66
|
+
resolve();
|
|
67
|
+
}
|
|
68
|
+
expose({
|
|
69
|
+
loadSignature() {
|
|
70
|
+
loadSignature();
|
|
71
|
+
},
|
|
72
|
+
getSignature() {
|
|
73
|
+
return cloneDeep(shortcutCache);
|
|
74
|
+
},
|
|
75
|
+
setSignature() {
|
|
76
|
+
Object.entries(shortcutCache).forEach(([key2, info]) => {
|
|
77
|
+
manager.update(key2, info);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
29
80
|
});
|
|
30
|
-
const components = { SHORTCUT: ShortcutSetterItem };
|
|
31
81
|
return (_ctx, _cache) => {
|
|
32
82
|
return openBlock(), createBlock(unref(FormRender), {
|
|
33
|
-
key:
|
|
83
|
+
key: key.value,
|
|
34
84
|
"label-placement": "left",
|
|
35
|
-
"field-list":
|
|
85
|
+
"field-list": fieldList.value,
|
|
36
86
|
components
|
|
37
87
|
}, null, 8, ["field-list"]);
|
|
38
88
|
};
|