cnhis-design-vue 3.1.15-beta.9 → 3.1.16-beta.1
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 +1749 -0
- package/es/packages/form-config/src/FormConfig.vue.d.ts +1749 -0
- package/es/packages/form-config/src/components/FormConfigEdit.js +3 -3
- package/es/packages/form-config/src/components/FormConfigEdit.vue.d.ts +1747 -0
- package/es/packages/form-config/style/index.css +1 -1
- package/es/packages/form-render/src/components/renderer/combination/index.js +3 -3
- package/es/packages/form-render/src/components/renderer/formItem.js +1 -2
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +2 -2
- package/es/packages/form-render/src/types/fieldItem.d.ts +8 -0
- package/es/packages/form-render/src/utils/index.d.ts +1 -0
- package/es/packages/form-render/src/utils/index.js +9 -2
- package/es/packages/form-table/src/hooks/useNuiThemeOverrides.js +1 -1
- package/es/packages/index.css +1 -1
- package/es/packages/index.d.ts +1 -0
- package/es/packages/index.js +1 -1
- 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 +1698 -4283
- 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/package.json +1 -1
- package/es/packages/shortcut-setter/constant/index.d.ts +0 -4
- package/es/packages/shortcut-setter/constant/index.js +0 -7
|
@@ -1,46 +1,26 @@
|
|
|
1
|
-
import { defineComponent,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { useShortcuts } from '../../../packages/shortcut-provider';
|
|
5
|
-
import { transformKey2DisplaySignature, getDisplaySignature } from '../../../packages/shortcut-provider/src/utils';
|
|
6
|
-
import { ShortcutInputState } from '../../../packages/shortcut-setter/constant';
|
|
1
|
+
import { defineComponent, ref, computed, openBlock, createElementBlock, createVNode, unref, withModifiers } from 'vue';
|
|
2
|
+
import { NInput } from 'naive-ui';
|
|
3
|
+
import { getDisplaySignature } from '../../../packages/shortcut-provider/src/utils';
|
|
7
4
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.js';
|
|
8
5
|
|
|
9
6
|
const _hoisted_1 = { class: "shortcut-setter-item__wrapper" };
|
|
10
|
-
const _hoisted_2 = { class: "shortcut-setter-item__operation" };
|
|
11
|
-
const _hoisted_3 = /* @__PURE__ */ createTextVNode("\u91CD\u7F6E");
|
|
12
|
-
const _hoisted_4 = /* @__PURE__ */ createTextVNode(" \u786E\u8BA4\u91CD\u7F6E\u5FEB\u6377\u952E\u5417 ");
|
|
13
7
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
14
8
|
__name: "ShortcutSetterItem",
|
|
15
9
|
props: {
|
|
16
|
-
|
|
10
|
+
shortcutKey: null,
|
|
11
|
+
shortcutSignature: null,
|
|
17
12
|
value: null,
|
|
18
13
|
onChange: null,
|
|
19
14
|
onFocus: null,
|
|
20
|
-
fieldItem: null,
|
|
21
15
|
placeholder: { default: "\u70B9\u51FB\u8BBE\u7F6E\u5FEB\u6377\u952E" },
|
|
22
|
-
editPlaceholder: { default: "\u952E\u76D8\u6309\u4E0B\u8981\u8BBE\u7F6E\u7684\u5FEB\u6377\u952E\u7EC4\u5408" }
|
|
23
|
-
operation: { default: () => [] }
|
|
16
|
+
editPlaceholder: { default: "\u952E\u76D8\u6309\u4E0B\u8981\u8BBE\u7F6E\u7684\u5FEB\u6377\u952E\u7EC4\u5408" }
|
|
24
17
|
},
|
|
25
|
-
|
|
18
|
+
emits: ["shortcutChange"],
|
|
19
|
+
setup(__props, { emit }) {
|
|
26
20
|
const props = __props;
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
});
|
|
31
|
-
const disabledState = computed(() => {
|
|
32
|
-
var _a;
|
|
33
|
-
return !!((_a = shortcutItem.value) == null ? void 0 : _a.disabled);
|
|
34
|
-
});
|
|
35
|
-
const currentSetShortcut = computed(() => {
|
|
36
|
-
var _a, _b;
|
|
37
|
-
return transformKey2DisplaySignature((_b = (_a = shortcutItem.value) == null ? void 0 : _a.currentKeySignature) != null ? _b : "");
|
|
38
|
-
});
|
|
39
|
-
const state = ref(ShortcutInputState.STATIC);
|
|
40
|
-
const isEditState = computed(() => state.value === ShortcutInputState.STATIC);
|
|
41
|
-
function hasOperation(operation) {
|
|
42
|
-
return props.operation.includes(operation);
|
|
43
|
-
}
|
|
21
|
+
const currentSetShortcut = ref(getDisplaySignature(props.shortcutSignature));
|
|
22
|
+
const state = ref(0);
|
|
23
|
+
const isEditState = computed(() => state.value === 0);
|
|
44
24
|
const currentEditShortcut = ref("");
|
|
45
25
|
const showContent = computed(() => {
|
|
46
26
|
return isEditState.value ? currentSetShortcut.value : currentEditShortcut.value;
|
|
@@ -49,90 +29,41 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
49
29
|
return isEditState.value ? props.placeholder : props.editPlaceholder;
|
|
50
30
|
});
|
|
51
31
|
function onInputFocus() {
|
|
52
|
-
|
|
53
|
-
state.value = ShortcutInputState.EDIT;
|
|
32
|
+
state.value = 1;
|
|
54
33
|
}
|
|
55
34
|
const inputRef = ref();
|
|
56
35
|
function onInputBlur() {
|
|
57
36
|
var _a;
|
|
58
|
-
|
|
59
|
-
state.value = ShortcutInputState.STATIC;
|
|
37
|
+
state.value = 0;
|
|
60
38
|
currentEditShortcut.value = "";
|
|
61
39
|
(_a = inputRef.value) == null ? void 0 : _a.blur();
|
|
62
40
|
}
|
|
63
|
-
const onInputKeyDown =
|
|
41
|
+
const onInputKeyDown = (event) => {
|
|
64
42
|
currentEditShortcut.value = getDisplaySignature(event);
|
|
65
|
-
}
|
|
66
|
-
const
|
|
67
|
-
function updateDecorator(fn, afterUpdate) {
|
|
43
|
+
};
|
|
44
|
+
const onInputKeyUp = async (event) => {
|
|
68
45
|
try {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
46
|
+
await new Promise((resolve, reject) => {
|
|
47
|
+
emit("shortcutChange", { key: props.shortcutKey, info: event, resolve, reject });
|
|
48
|
+
});
|
|
49
|
+
currentSetShortcut.value = getDisplaySignature(event);
|
|
73
50
|
} finally {
|
|
74
|
-
|
|
51
|
+
onInputBlur();
|
|
52
|
+
currentEditShortcut.value = "";
|
|
75
53
|
}
|
|
76
|
-
}
|
|
77
|
-
const onInputKeyUp = debounce((event) => updateDecorator(() => update(props.fieldItem.val_key, event), () => event.target.blur()), 200, { leading: true, trailing: false });
|
|
78
|
-
function onStop() {
|
|
79
|
-
if (!shortcutItem.value)
|
|
80
|
-
return;
|
|
81
|
-
updateDecorator(() => updateDisabled(props.fieldItem.val_key, !disabledState.value), onInputBlur);
|
|
82
|
-
}
|
|
83
|
-
function onSignatureReset() {
|
|
84
|
-
if (!shortcutItem.value)
|
|
85
|
-
return;
|
|
86
|
-
updateDecorator(() => onReset(props.fieldItem.val_key), onInputBlur);
|
|
87
|
-
}
|
|
54
|
+
};
|
|
88
55
|
return (_ctx, _cache) => {
|
|
89
56
|
return openBlock(), createElementBlock("section", _hoisted_1, [
|
|
90
57
|
createVNode(unref(NInput), {
|
|
91
58
|
ref_key: "inputRef",
|
|
92
59
|
ref: inputRef,
|
|
93
|
-
disabled: unref(disabledState),
|
|
94
60
|
value: unref(showContent),
|
|
95
61
|
placeholder: unref(placeholder),
|
|
96
62
|
onFocus: onInputFocus,
|
|
97
63
|
onBlur: onInputBlur,
|
|
98
|
-
onKeydown: withModifiers(
|
|
99
|
-
onKeyup: withModifiers(
|
|
100
|
-
}, null, 8, ["
|
|
101
|
-
createElementVNode("section", _hoisted_2, [
|
|
102
|
-
hasOperation("state") ? (openBlock(), createBlock(unref(NButton), {
|
|
103
|
-
key: 0,
|
|
104
|
-
text: "",
|
|
105
|
-
onClick: onStop,
|
|
106
|
-
type: unref(disabledState) ? "info" : "warning"
|
|
107
|
-
}, {
|
|
108
|
-
default: withCtx(() => [
|
|
109
|
-
createTextVNode(toDisplayString(unref(disabledState) ? "\u542F\u7528" : "\u7981\u7528"), 1)
|
|
110
|
-
]),
|
|
111
|
-
_: 1
|
|
112
|
-
}, 8, ["type"])) : createCommentVNode("v-if", true),
|
|
113
|
-
hasOperation("reset") ? (openBlock(), createBlock(unref(NPopconfirm), {
|
|
114
|
-
key: 1,
|
|
115
|
-
onPositiveClick: onSignatureReset
|
|
116
|
-
}, {
|
|
117
|
-
trigger: withCtx(() => [
|
|
118
|
-
createVNode(unref(NButton), {
|
|
119
|
-
disabled: unref(disabledState),
|
|
120
|
-
text: "",
|
|
121
|
-
onClick: onInputBlur,
|
|
122
|
-
type: "info"
|
|
123
|
-
}, {
|
|
124
|
-
default: withCtx(() => [
|
|
125
|
-
_hoisted_3
|
|
126
|
-
]),
|
|
127
|
-
_: 1
|
|
128
|
-
}, 8, ["disabled"])
|
|
129
|
-
]),
|
|
130
|
-
default: withCtx(() => [
|
|
131
|
-
_hoisted_4
|
|
132
|
-
]),
|
|
133
|
-
_: 1
|
|
134
|
-
})) : createCommentVNode("v-if", true)
|
|
135
|
-
])
|
|
64
|
+
onKeydown: withModifiers(onInputKeyDown, ["prevent", "stop"]),
|
|
65
|
+
onKeyup: withModifiers(onInputKeyUp, ["prevent", "stop"])
|
|
66
|
+
}, null, 8, ["value", "placeholder", "onKeydown", "onKeyup"])
|
|
136
67
|
]);
|
|
137
68
|
};
|
|
138
69
|
}
|