cnhis-design-vue 3.1.29-beta.4 → 3.1.29-beta.6
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/README.md +123 -123
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
- package/es/components/fabric-chart/src/utils/index.d.ts +6823 -0
- package/es/components/form-render/src/hooks/useBusinessBinding.js +1 -1
- package/es/components/form-render/src/types/index.d.ts +1 -1
- package/es/components/form-render/src/utils/business.js +3 -2
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +2 -1
- package/es/components/index.js +4 -1
- package/es/components/keyboard/index.d.ts +103 -0
- package/es/components/keyboard/index.js +10 -0
- package/es/components/keyboard/src/Keyboard.js +256 -0
- package/es/components/keyboard/src/Keyboard.vue.d.ts +103 -0
- package/es/components/keyboard/src/components/InputNumber.js +64 -0
- package/es/components/keyboard/src/components/InputNumber.vue.d.ts +43 -0
- package/es/components/keyboard/style/index.css +1 -0
- package/es/components/shortcut-provider/src/hooks/useShortcuts.js +5 -3
- package/es/components/shortcut-provider/src/utils/index.d.ts +4 -2
- package/es/components/shortcut-provider/src/utils/index.js +28 -7
- package/es/shared/assets/img/failure.js +1 -1
- package/es/shared/assets/img/icon-asc.js +1 -1
- package/es/shared/assets/img/icon-desc.js +1 -1
- package/es/shared/assets/img/no-permission.js +1 -1
- package/es/shared/assets/img/nodata.js +1 -1
- package/es/shared/assets/img/notfound.js +1 -1
- package/es/shared/assets/img/qr.js +1 -1
- package/es/shared/assets/img/success.js +1 -1
- package/es/shared/assets/img/video.js +1 -1
- package/es/shared/assets/img/video_default_cover.js +1 -1
- package/es/shared/assets/img/video_hover.js +1 -1
- package/es/shared/assets/img/video_play_hover.js +1 -1
- package/es/shared/assets/img/xb_big.js +1 -1
- package/es/shared/assets/img/xb_small.js +1 -1
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
- package/es/shared/utils/tapable/index.d.ts +139 -0
- package/package.json +2 -2
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, unref, openBlock, createBlock, withCtx, createVNode, createElementVNode, createElementBlock, Fragment, renderList, normalizeClass, toDisplayString, createCommentVNode, createTextVNode } from 'vue';
|
|
2
|
+
import { NPopover, NInputNumber, NSpace, NIcon } from 'naive-ui';
|
|
3
|
+
import { ArrowUndoSharp, Close, GitCompareOutline } from '@vicons/ionicons5';
|
|
4
|
+
import InputNumber from './components/InputNumber.js';
|
|
5
|
+
import { useRefHistory } from '@vueuse/core';
|
|
6
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.js';
|
|
7
|
+
|
|
8
|
+
const _hoisted_1 = { class: "c-keyboard" };
|
|
9
|
+
const _hoisted_2 = { class: "left" };
|
|
10
|
+
const _hoisted_3 = { class: "keys" };
|
|
11
|
+
const _hoisted_4 = ["onClick"];
|
|
12
|
+
const _hoisted_5 = ["onClick"];
|
|
13
|
+
const _hoisted_6 = { class: "btns" };
|
|
14
|
+
const _hoisted_7 = ["onClick"];
|
|
15
|
+
const _hoisted_8 = { class: "inputs" };
|
|
16
|
+
const _hoisted_9 = { class: "inputs-right" };
|
|
17
|
+
const _hoisted_10 = /* @__PURE__ */ createElementVNode("hr", null, null, -1);
|
|
18
|
+
const _hoisted_11 = {
|
|
19
|
+
key: 1,
|
|
20
|
+
class: "c-keyboard-english"
|
|
21
|
+
};
|
|
22
|
+
const _hoisted_12 = /* @__PURE__ */ createElementVNode("span", null, "\u952E\u76D8", -1);
|
|
23
|
+
const _hoisted_13 = { class: "keys" };
|
|
24
|
+
const _hoisted_14 = ["onClick"];
|
|
25
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
26
|
+
__name: "Keyboard",
|
|
27
|
+
props: {
|
|
28
|
+
mode: { type: String, default: "default" }
|
|
29
|
+
},
|
|
30
|
+
emits: ["change", "keydown"],
|
|
31
|
+
setup(__props, { emit }) {
|
|
32
|
+
const props = __props;
|
|
33
|
+
const NUMBERKEYS = "1234567890.";
|
|
34
|
+
const DAYS = [3, 7, 14, 30];
|
|
35
|
+
const ENGLISHKEY = "QWERTYUIOPASDFGHJKLZXCVBNM.";
|
|
36
|
+
const ENGLISHOTHERKEY = ["switch", " ", "undo", "Enter"];
|
|
37
|
+
const ENGLISHKEYS = ENGLISHKEY.split("").concat(ENGLISHOTHERKEY);
|
|
38
|
+
const ENGLISHKEYS_ = ENGLISHKEY.split(".")[0].split("").sort().concat(["."], ENGLISHOTHERKEY);
|
|
39
|
+
const popoverRef = ref(null);
|
|
40
|
+
const numberKeys = ref(NUMBERKEYS.split(""));
|
|
41
|
+
const days = ref(DAYS);
|
|
42
|
+
const doses = ref([2, 3, 4, 5, 6, 7, 8]);
|
|
43
|
+
const englishKeys = ref(ENGLISHKEYS.slice());
|
|
44
|
+
const value = ref();
|
|
45
|
+
const inputValue = ref("");
|
|
46
|
+
const { history, undo, redo } = useRefHistory(inputValue);
|
|
47
|
+
const integerValue = ref();
|
|
48
|
+
const numeratorValue = ref();
|
|
49
|
+
const denominatorValue = ref();
|
|
50
|
+
const isDefault = computed(() => props.mode === "default");
|
|
51
|
+
const isDay = computed(() => props.mode === "day");
|
|
52
|
+
const isDose = computed(() => props.mode === "dose");
|
|
53
|
+
function keydown(key) {
|
|
54
|
+
var _a, _b, _c;
|
|
55
|
+
if (props.mode === "default") {
|
|
56
|
+
if (key !== "switch") {
|
|
57
|
+
emit("keydown", key);
|
|
58
|
+
} else {
|
|
59
|
+
englishKeys.value = englishKeys.value[0] === "Q" ? ENGLISHKEYS_.slice() : ENGLISHKEYS.slice();
|
|
60
|
+
}
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
switch (key) {
|
|
64
|
+
case "undo": {
|
|
65
|
+
undo();
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
case "enter":
|
|
69
|
+
value.value = +inputValue.value;
|
|
70
|
+
(_a = popoverRef.value) == null ? void 0 : _a.setShow(false);
|
|
71
|
+
emit("change", value.value);
|
|
72
|
+
break;
|
|
73
|
+
default:
|
|
74
|
+
if (typeof key === "number") {
|
|
75
|
+
inputValue.value = key.toString();
|
|
76
|
+
} else {
|
|
77
|
+
inputValue.value = (((_c = (_b = inputValue.value) == null ? void 0 : _b.toString) == null ? void 0 : _c.call(_b)) || "") + key;
|
|
78
|
+
}
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function updateFraction(value2) {
|
|
83
|
+
numeratorValue.value = "1";
|
|
84
|
+
denominatorValue.value = value2.toString();
|
|
85
|
+
}
|
|
86
|
+
function calculateFraction() {
|
|
87
|
+
var _a;
|
|
88
|
+
inputValue.value = (+((_a = integerValue.value) != null ? _a : 0) + +numeratorValue.value / +denominatorValue.value).toString();
|
|
89
|
+
}
|
|
90
|
+
return (_ctx, _cache) => {
|
|
91
|
+
return !unref(isDefault) ? (openBlock(), createBlock(unref(NPopover), {
|
|
92
|
+
key: 0,
|
|
93
|
+
ref_key: "popoverRef",
|
|
94
|
+
ref: popoverRef,
|
|
95
|
+
trigger: "click",
|
|
96
|
+
"show-arrow": false,
|
|
97
|
+
placement: "bottom-start",
|
|
98
|
+
style: { "padding": "0" },
|
|
99
|
+
"display-directive": "show"
|
|
100
|
+
}, {
|
|
101
|
+
trigger: withCtx(() => [
|
|
102
|
+
createVNode(unref(NInputNumber), {
|
|
103
|
+
value: value.value,
|
|
104
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => value.value = $event),
|
|
105
|
+
style: { "width": "200px" },
|
|
106
|
+
"show-button": false
|
|
107
|
+
}, null, 8, ["value"])
|
|
108
|
+
]),
|
|
109
|
+
default: withCtx(() => [
|
|
110
|
+
createElementVNode("div", _hoisted_1, [
|
|
111
|
+
createElementVNode("div", _hoisted_2, [
|
|
112
|
+
createVNode(InputNumber, {
|
|
113
|
+
modelValue: inputValue.value,
|
|
114
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => inputValue.value = $event)
|
|
115
|
+
}, null, 8, ["modelValue"]),
|
|
116
|
+
createElementVNode("div", _hoisted_3, [
|
|
117
|
+
createVNode(unref(NSpace), null, {
|
|
118
|
+
default: withCtx(() => [
|
|
119
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(numberKeys.value, (key) => {
|
|
120
|
+
return openBlock(), createElementBlock("span", {
|
|
121
|
+
key,
|
|
122
|
+
class: normalizeClass(key === "0" ? "is-0" : ""),
|
|
123
|
+
onClick: ($event) => keydown(key)
|
|
124
|
+
}, toDisplayString(key), 11, _hoisted_4);
|
|
125
|
+
}), 128))
|
|
126
|
+
]),
|
|
127
|
+
_: 1
|
|
128
|
+
}),
|
|
129
|
+
createVNode(unref(NSpace), null, {
|
|
130
|
+
default: withCtx(() => [
|
|
131
|
+
createElementVNode("span", {
|
|
132
|
+
class: "opt",
|
|
133
|
+
onClick: _cache[2] || (_cache[2] = ($event) => keydown("undo"))
|
|
134
|
+
}, [
|
|
135
|
+
createVNode(unref(NIcon), { component: unref(ArrowUndoSharp) }, null, 8, ["component"])
|
|
136
|
+
]),
|
|
137
|
+
createElementVNode("span", {
|
|
138
|
+
class: "opt",
|
|
139
|
+
onClick: _cache[3] || (_cache[3] = ($event) => keydown("enter"))
|
|
140
|
+
}, "\u786E\u5B9A")
|
|
141
|
+
]),
|
|
142
|
+
_: 1
|
|
143
|
+
})
|
|
144
|
+
])
|
|
145
|
+
]),
|
|
146
|
+
unref(isDay) ? (openBlock(), createBlock(unref(NSpace), {
|
|
147
|
+
key: 0,
|
|
148
|
+
class: "right-days",
|
|
149
|
+
justify: "center",
|
|
150
|
+
vertical: ""
|
|
151
|
+
}, {
|
|
152
|
+
default: withCtx(() => [
|
|
153
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(days.value, (day) => {
|
|
154
|
+
return openBlock(), createElementBlock("span", {
|
|
155
|
+
class: "btn",
|
|
156
|
+
key: day,
|
|
157
|
+
onClick: ($event) => keydown(day)
|
|
158
|
+
}, toDisplayString(day) + "\u5929", 9, _hoisted_5);
|
|
159
|
+
}), 128))
|
|
160
|
+
]),
|
|
161
|
+
_: 1
|
|
162
|
+
})) : createCommentVNode("v-if", true),
|
|
163
|
+
unref(isDose) ? (openBlock(), createBlock(unref(NSpace), {
|
|
164
|
+
key: 1,
|
|
165
|
+
class: "right-dose",
|
|
166
|
+
"wrap-item": false
|
|
167
|
+
}, {
|
|
168
|
+
default: withCtx(() => [
|
|
169
|
+
createElementVNode("div", _hoisted_6, [
|
|
170
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(doses.value, (dose) => {
|
|
171
|
+
return openBlock(), createElementBlock("span", {
|
|
172
|
+
class: "btn",
|
|
173
|
+
key: dose,
|
|
174
|
+
onClick: ($event) => updateFraction(dose)
|
|
175
|
+
}, "1/" + toDisplayString(dose), 9, _hoisted_7);
|
|
176
|
+
}), 128))
|
|
177
|
+
]),
|
|
178
|
+
createVNode(unref(NSpace), {
|
|
179
|
+
justify: "center",
|
|
180
|
+
vertical: ""
|
|
181
|
+
}, {
|
|
182
|
+
default: withCtx(() => [
|
|
183
|
+
createElementVNode("div", _hoisted_8, [
|
|
184
|
+
createVNode(InputNumber, {
|
|
185
|
+
integer: "",
|
|
186
|
+
modelValue: integerValue.value,
|
|
187
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => integerValue.value = $event)
|
|
188
|
+
}, null, 8, ["modelValue"]),
|
|
189
|
+
createElementVNode("div", _hoisted_9, [
|
|
190
|
+
createVNode(InputNumber, {
|
|
191
|
+
integer: "",
|
|
192
|
+
modelValue: numeratorValue.value,
|
|
193
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => numeratorValue.value = $event)
|
|
194
|
+
}, null, 8, ["modelValue"]),
|
|
195
|
+
_hoisted_10,
|
|
196
|
+
createVNode(InputNumber, {
|
|
197
|
+
integer: "",
|
|
198
|
+
modelValue: denominatorValue.value,
|
|
199
|
+
"onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => denominatorValue.value = $event)
|
|
200
|
+
}, null, 8, ["modelValue"])
|
|
201
|
+
])
|
|
202
|
+
]),
|
|
203
|
+
createElementVNode("span", {
|
|
204
|
+
class: "btn",
|
|
205
|
+
onClick: calculateFraction
|
|
206
|
+
}, "\u5206\u5B50\u5F0F\u5242\u91CF")
|
|
207
|
+
]),
|
|
208
|
+
_: 1
|
|
209
|
+
})
|
|
210
|
+
]),
|
|
211
|
+
_: 1
|
|
212
|
+
})) : createCommentVNode("v-if", true)
|
|
213
|
+
])
|
|
214
|
+
]),
|
|
215
|
+
_: 1
|
|
216
|
+
}, 512)) : (openBlock(), createElementBlock("div", _hoisted_11, [
|
|
217
|
+
createVNode(unref(NSpace), {
|
|
218
|
+
"wrap-item": false,
|
|
219
|
+
align: "center",
|
|
220
|
+
justify: "space-between"
|
|
221
|
+
}, {
|
|
222
|
+
default: withCtx(() => [
|
|
223
|
+
_hoisted_12,
|
|
224
|
+
createVNode(unref(NIcon), {
|
|
225
|
+
onClick: _cache[7] || (_cache[7] = ($event) => keydown("close")),
|
|
226
|
+
component: unref(Close)
|
|
227
|
+
}, null, 8, ["component"])
|
|
228
|
+
]),
|
|
229
|
+
_: 1
|
|
230
|
+
}),
|
|
231
|
+
createElementVNode("div", _hoisted_13, [
|
|
232
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(englishKeys.value, (key, index) => {
|
|
233
|
+
return openBlock(), createElementBlock("span", {
|
|
234
|
+
key,
|
|
235
|
+
class: normalizeClass(["key" + index]),
|
|
236
|
+
onClick: ($event) => keydown(key)
|
|
237
|
+
}, [
|
|
238
|
+
key === "switch" ? (openBlock(), createBlock(unref(NIcon), {
|
|
239
|
+
key: 0,
|
|
240
|
+
component: unref(GitCompareOutline)
|
|
241
|
+
}, null, 8, ["component"])) : createCommentVNode("v-if", true),
|
|
242
|
+
key === "undo" ? (openBlock(), createBlock(unref(NIcon), {
|
|
243
|
+
key: 1,
|
|
244
|
+
component: unref(ArrowUndoSharp)
|
|
245
|
+
}, null, 8, ["component"])) : createCommentVNode("v-if", true),
|
|
246
|
+
createTextVNode(" " + toDisplayString(!ENGLISHOTHERKEY.includes(key) || key === "Enter" ? key : key === "" ? "\u7A7A\u683C" : ""), 1)
|
|
247
|
+
], 10, _hoisted_14);
|
|
248
|
+
}), 128))
|
|
249
|
+
])
|
|
250
|
+
]));
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
var script = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "Keyboard.vue"]]);
|
|
255
|
+
|
|
256
|
+
export { script as default };
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{
|
|
3
|
+
mode: {
|
|
4
|
+
type: PropType<"default" | "day" | "dose">;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
7
|
+
}, {
|
|
8
|
+
NUMBERKEYS: string;
|
|
9
|
+
DAYS: number[];
|
|
10
|
+
ENGLISHKEY: string;
|
|
11
|
+
ENGLISHOTHERKEY: string[];
|
|
12
|
+
ENGLISHKEYS: string[];
|
|
13
|
+
ENGLISHKEYS_: string[];
|
|
14
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
15
|
+
mode: {
|
|
16
|
+
type: PropType<"default" | "day" | "dose">;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
}>> & {
|
|
20
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
21
|
+
onKeydown?: ((...args: any[]) => any) | undefined;
|
|
22
|
+
}>>;
|
|
23
|
+
emit: (event: "change" | "keydown", ...args: any[]) => void;
|
|
24
|
+
popoverRef: import("vue").Ref<null>;
|
|
25
|
+
numberKeys: import("vue").Ref<string[]>;
|
|
26
|
+
days: import("vue").Ref<number[]>;
|
|
27
|
+
doses: import("vue").Ref<number[]>;
|
|
28
|
+
englishKeys: import("vue").Ref<string[]>;
|
|
29
|
+
value: import("vue").Ref<any>;
|
|
30
|
+
inputValue: import("vue").Ref<string>;
|
|
31
|
+
history: import("vue").Ref<import("@vueuse/core").UseRefHistoryRecord<string>[]>;
|
|
32
|
+
undo: () => void;
|
|
33
|
+
redo: () => void;
|
|
34
|
+
integerValue: import("vue").Ref<any>;
|
|
35
|
+
numeratorValue: import("vue").Ref<any>;
|
|
36
|
+
denominatorValue: import("vue").Ref<any>;
|
|
37
|
+
isDefault: import("vue").ComputedRef<boolean>;
|
|
38
|
+
isDay: import("vue").ComputedRef<boolean>;
|
|
39
|
+
isDose: import("vue").ComputedRef<boolean>;
|
|
40
|
+
keydown: (key: string | number) => void;
|
|
41
|
+
updateFraction: (value: number) => void;
|
|
42
|
+
calculateFraction: () => void;
|
|
43
|
+
NPopover: any;
|
|
44
|
+
NInputNumber: any;
|
|
45
|
+
NIcon: any;
|
|
46
|
+
NSpace: any;
|
|
47
|
+
ArrowUndoSharp: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
48
|
+
Close: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
49
|
+
GitCompareOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
50
|
+
InputNumber: import("vue").DefineComponent<{
|
|
51
|
+
modelValue: {
|
|
52
|
+
type: StringConstructor;
|
|
53
|
+
};
|
|
54
|
+
integer: {
|
|
55
|
+
type: BooleanConstructor;
|
|
56
|
+
default: boolean;
|
|
57
|
+
};
|
|
58
|
+
}, {
|
|
59
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
60
|
+
modelValue: {
|
|
61
|
+
type: StringConstructor;
|
|
62
|
+
};
|
|
63
|
+
integer: {
|
|
64
|
+
type: BooleanConstructor;
|
|
65
|
+
default: boolean;
|
|
66
|
+
};
|
|
67
|
+
}>> & {
|
|
68
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
69
|
+
}>>;
|
|
70
|
+
emit: (event: "update:modelValue", ...args: any[]) => void;
|
|
71
|
+
update: (value: string | [string, string]) => void;
|
|
72
|
+
validator: (value: string) => boolean;
|
|
73
|
+
calculate: (type: string) => void;
|
|
74
|
+
NInput: any;
|
|
75
|
+
NIcon: any;
|
|
76
|
+
NSpace: any;
|
|
77
|
+
CaretDown: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
78
|
+
CaretUp: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
79
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
80
|
+
modelValue: {
|
|
81
|
+
type: StringConstructor;
|
|
82
|
+
};
|
|
83
|
+
integer: {
|
|
84
|
+
type: BooleanConstructor;
|
|
85
|
+
default: boolean;
|
|
86
|
+
};
|
|
87
|
+
}>> & {
|
|
88
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
89
|
+
}, {
|
|
90
|
+
integer: boolean;
|
|
91
|
+
}>;
|
|
92
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "keydown")[], "change" | "keydown", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
93
|
+
mode: {
|
|
94
|
+
type: PropType<"default" | "day" | "dose">;
|
|
95
|
+
default: string;
|
|
96
|
+
};
|
|
97
|
+
}>> & {
|
|
98
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
99
|
+
onKeydown?: ((...args: any[]) => any) | undefined;
|
|
100
|
+
}, {
|
|
101
|
+
mode: "default" | "day" | "dose";
|
|
102
|
+
}>;
|
|
103
|
+
export default _default;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createBlock, unref, withCtx, createVNode } from 'vue';
|
|
2
|
+
import { NInput, NSpace, NIcon } from 'naive-ui';
|
|
3
|
+
import { CaretUp, CaretDown } from '@vicons/ionicons5';
|
|
4
|
+
import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.js';
|
|
5
|
+
|
|
6
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
+
__name: "InputNumber",
|
|
8
|
+
props: {
|
|
9
|
+
modelValue: { type: String },
|
|
10
|
+
integer: { type: Boolean, default: false }
|
|
11
|
+
},
|
|
12
|
+
emits: ["update:modelValue"],
|
|
13
|
+
setup(__props, { emit }) {
|
|
14
|
+
const props = __props;
|
|
15
|
+
function update(value) {
|
|
16
|
+
const val = typeof value === "string" ? value : value.join("");
|
|
17
|
+
emit("update:modelValue", val);
|
|
18
|
+
}
|
|
19
|
+
function validator(value) {
|
|
20
|
+
if (props.integer) {
|
|
21
|
+
return /(^[1-9]\d*$)/.test(value) || !value;
|
|
22
|
+
}
|
|
23
|
+
return /^\d+\.?\d*$/.test(value);
|
|
24
|
+
}
|
|
25
|
+
function calculate(type) {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
const newValue = type === "+" ? +((_a = props.modelValue) != null ? _a : 0) + 1 : +((_b = props.modelValue) != null ? _b : 0) - 1;
|
|
28
|
+
emit("update:modelValue", newValue.toString());
|
|
29
|
+
}
|
|
30
|
+
return (_ctx, _cache) => {
|
|
31
|
+
return openBlock(), createBlock(unref(NInput), {
|
|
32
|
+
value: __props.modelValue,
|
|
33
|
+
"onUpdate:value": update,
|
|
34
|
+
"allow-input": validator,
|
|
35
|
+
placeholder: ""
|
|
36
|
+
}, {
|
|
37
|
+
suffix: withCtx(() => [
|
|
38
|
+
createVNode(unref(NSpace), {
|
|
39
|
+
justify: "center",
|
|
40
|
+
vertical: ""
|
|
41
|
+
}, {
|
|
42
|
+
default: withCtx(() => [
|
|
43
|
+
createVNode(unref(NIcon), {
|
|
44
|
+
size: "13",
|
|
45
|
+
component: unref(CaretUp),
|
|
46
|
+
onClick: _cache[0] || (_cache[0] = ($event) => calculate("+"))
|
|
47
|
+
}, null, 8, ["component"]),
|
|
48
|
+
createVNode(unref(NIcon), {
|
|
49
|
+
size: "13",
|
|
50
|
+
component: unref(CaretDown),
|
|
51
|
+
onClick: _cache[1] || (_cache[1] = ($event) => calculate("-"))
|
|
52
|
+
}, null, 8, ["component"])
|
|
53
|
+
]),
|
|
54
|
+
_: 1
|
|
55
|
+
})
|
|
56
|
+
]),
|
|
57
|
+
_: 1
|
|
58
|
+
}, 8, ["value"]);
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
var InputNumber = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "InputNumber.vue"]]);
|
|
63
|
+
|
|
64
|
+
export { InputNumber as default };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
modelValue: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
};
|
|
5
|
+
integer: {
|
|
6
|
+
type: BooleanConstructor;
|
|
7
|
+
default: boolean;
|
|
8
|
+
};
|
|
9
|
+
}, {
|
|
10
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
11
|
+
modelValue: {
|
|
12
|
+
type: StringConstructor;
|
|
13
|
+
};
|
|
14
|
+
integer: {
|
|
15
|
+
type: BooleanConstructor;
|
|
16
|
+
default: boolean;
|
|
17
|
+
};
|
|
18
|
+
}>> & {
|
|
19
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
20
|
+
}>>;
|
|
21
|
+
emit: (event: "update:modelValue", ...args: any[]) => void;
|
|
22
|
+
update: (value: string | [string, string]) => void;
|
|
23
|
+
validator: (value: string) => boolean;
|
|
24
|
+
calculate: (type: string) => void;
|
|
25
|
+
NInput: any;
|
|
26
|
+
NIcon: any;
|
|
27
|
+
NSpace: any;
|
|
28
|
+
CaretDown: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
29
|
+
CaretUp: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
30
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
31
|
+
modelValue: {
|
|
32
|
+
type: StringConstructor;
|
|
33
|
+
};
|
|
34
|
+
integer: {
|
|
35
|
+
type: BooleanConstructor;
|
|
36
|
+
default: boolean;
|
|
37
|
+
};
|
|
38
|
+
}>> & {
|
|
39
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
40
|
+
}, {
|
|
41
|
+
integer: boolean;
|
|
42
|
+
}>;
|
|
43
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.c-keyboard span,.c-keyboard-english .keys span{cursor:pointer}.c-keyboard{display:flex;height:160px}.c-keyboard .btn{align-items:center;background:linear-gradient(180deg,#fff,#f2f2f2);border-radius:2px;box-shadow:0 2px 2px #00000036;box-sizing:border-box;display:inline-flex;font-size:14px;justify-content:center;text-align:center}.c-keyboard .btn:hover{background:#2474ff33;border:1px solid #2474ff}.c-keyboard .btn:active{background:#2474ff;color:#fff}.c-keyboard .btn:hover{box-shadow:none}.c-keyboard .left{border-right:1px solid #d5d5d5;box-sizing:border-box;padding:6px;width:130px}.c-keyboard .left .n-input{height:28px;width:100%}.c-keyboard .left .n-input .n-input__input-el{height:28px}.c-keyboard .left .keys{display:flex;margin-top:5px}.c-keyboard .left .keys .n-space{gap:4px 4px!important}.c-keyboard .left .keys span{align-items:center;background-color:#e8e8e8;border-radius:2px;box-sizing:border-box;display:inline-flex;font-size:14px;height:26px;justify-content:center;text-align:center;width:26px}.c-keyboard .left .keys span:hover{background:#2474ff33;border:1px solid #2474ff}.c-keyboard .left .keys span:active{background:#2474ff;color:#fff}.c-keyboard .left .keys span.opt{height:56px}.c-keyboard .left .keys span.is-0{width:56px}.c-keyboard .right-days{padding:0 12px}.c-keyboard .right-days .btn{height:26px;width:56px}.c-keyboard .right-dose{gap:8px 8px!important;padding:5px 12px 5px 5px}.c-keyboard .right-dose .btn{height:32px;width:100px}.c-keyboard .right-dose .btns{display:flex;flex-flow:column nowrap;height:100%;overflow-y:scroll;padding-right:6px}.c-keyboard .right-dose .btns .btn{height:20px;margin-top:4px;width:40px}.c-keyboard .right-dose .btns::-webkit-scrollbar{height:1px;width:2px}.c-keyboard .right-dose .btns::-webkit-scrollbar-track{background:#d8d8d8;border-radius:2px;box-shadow:inset 0 0 5px #fff}.c-keyboard .right-dose .btns::-webkit-scrollbar-thumb{background:#535353;border-radius:2px;box-shadow:inset 0 0 5px #fff}.c-keyboard .right-dose .inputs{align-items:center;display:flex;gap:8px}.c-keyboard .right-dose .inputs .n-input{height:32px;width:46px}.c-keyboard .right-dose .inputs .n-input .n-input__input-el{height:32px}.c-keyboard .n-input .n-input-wrapper{padding-right:5px}.c-keyboard .n-input .n-input-wrapper .n-input__suffix{line-height:0}.c-keyboard .n-input .n-input-wrapper .n-input__suffix .n-space{gap:0 0!important}.c-keyboard .n-input .n-input-wrapper .n-input__suffix .n-space .n-icon{cursor:pointer}.c-keyboard-english{box-sizing:border-box;padding:10px 6px;width:308px}.c-keyboard-english .n-space span{font-size:12px}.c-keyboard-english .n-space .n-icon{cursor:pointer}.c-keyboard-english .keys{display:flex;flex-flow:row wrap;gap:4px 4px;margin-top:5px}.c-keyboard-english .keys span{align-items:center;background-color:#e8e8e8;border-radius:2px;box-sizing:border-box;display:inline-flex;font-size:14px;height:26px;justify-content:center;text-align:center;width:26px}.c-keyboard-english .keys span:hover{background:#2474ff33;border:1px solid #2474ff}.c-keyboard-english .keys span:active{background:#2474ff;color:#fff}.c-keyboard-english .keys span.key10,.c-keyboard-english .keys span.key27{margin-left:16px}.c-keyboard-english .keys span.key26{margin-right:25px}.c-keyboard-english .keys span.key19{margin-left:31px}.c-keyboard-english .keys span.key28{width:146px}.c-keyboard-english .keys span.key30{width:56px}
|
|
@@ -3,7 +3,7 @@ import { useEventListener, useDebounceFn } from '@vueuse/core';
|
|
|
3
3
|
import { once, pick, omit, isFunction, isString } from 'lodash-es';
|
|
4
4
|
import { reactive, ref, unref, computed, getCurrentInstance, inject, onBeforeUnmount, onDeactivated, onActivated } from 'vue';
|
|
5
5
|
import { ShortcutStatus, InjectionShortcutManager } from '../constants/index.js';
|
|
6
|
-
import { normalizeSignatureInfo, getKeySignature, getDisplaySignature, isInvalidSignature, isKeyboardEvent, isShortcutProvider } from '../utils/index.js';
|
|
6
|
+
import { normalizeSignatureInfo, getKeySignature, getDisplaySignature, isInvalidSignature, isKeyboardEvent, isShortcutProvider, isInvalidKeyboardEvent } from '../utils/index.js';
|
|
7
7
|
|
|
8
8
|
const GlobalShortcutProvider = Symbol("Glob");
|
|
9
9
|
const ShortcutManagerCacheMap = /* @__PURE__ */ new Map();
|
|
@@ -82,7 +82,7 @@ class ShortcutManager {
|
|
|
82
82
|
if (!isKeyboardEvent(event) || this.disabled)
|
|
83
83
|
return;
|
|
84
84
|
const providerWrapper = findAncestor(event.target, isShortcutProvider);
|
|
85
|
-
if (providerWrapper && providerWrapper !== unref(this.environmentEle)) {
|
|
85
|
+
if (providerWrapper && providerWrapper !== unref(this.environmentEle) || isInvalidKeyboardEvent(event)) {
|
|
86
86
|
return;
|
|
87
87
|
}
|
|
88
88
|
const keySignature = getKeySignature(event);
|
|
@@ -113,7 +113,9 @@ class ShortcutManager {
|
|
|
113
113
|
}
|
|
114
114
|
const globManager = new ShortcutManager().start();
|
|
115
115
|
const onceSetupWarn = once(() => ShortcutManager.log("\u975Esetup\u8BED\u5883\u4E0B\u7684shortcut\u5C06\u5F71\u54CD\u5168\u5C40"));
|
|
116
|
-
const onceRegisterWarn = once(
|
|
116
|
+
const onceRegisterWarn = once(
|
|
117
|
+
() => 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")
|
|
118
|
+
);
|
|
117
119
|
function useShortcuts(scope) {
|
|
118
120
|
function useManager() {
|
|
119
121
|
return computed(() => {
|
|
@@ -2,8 +2,10 @@ import { ShortcutSignatureInfo } from '../../../../../es/components/shortcut-pro
|
|
|
2
2
|
export declare function isKeyboardEvent(event: any): event is KeyboardEvent;
|
|
3
3
|
export declare function normalizeSignatureInfo(info: KeyboardEvent | Partial<ShortcutSignatureInfo>): Required<ShortcutSignatureInfo>;
|
|
4
4
|
export declare function getKeySignature(info: KeyboardEvent | Partial<ShortcutSignatureInfo>): string;
|
|
5
|
-
export declare function inKeyBlackList(key: string): boolean
|
|
6
|
-
export declare function
|
|
5
|
+
export declare function inKeyBlackList(key: string): boolean;
|
|
6
|
+
export declare function isInvalidKeyboardEvent(event: KeyboardEvent): boolean;
|
|
7
|
+
export declare function isInvalidSignatureAtInput(info: KeyboardEvent | Partial<ShortcutSignatureInfo>): boolean;
|
|
8
|
+
export declare function isInvalidSignature(info: KeyboardEvent | Partial<ShortcutSignatureInfo>): boolean;
|
|
7
9
|
export declare function getDisplaySignature(info: KeyboardEvent | Partial<ShortcutSignatureInfo>): string;
|
|
8
10
|
export declare function transformKey2DisplaySignature(keySignature: string): string;
|
|
9
11
|
export declare function isShortcutProvider(ele: HTMLElement): boolean;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { isString } from 'lodash-es';
|
|
2
2
|
|
|
3
|
+
function isAlphanumeric(key) {
|
|
4
|
+
return /^[\dA-Za-z]$/.test(key);
|
|
5
|
+
}
|
|
6
|
+
function isPunctuation(key) {
|
|
7
|
+
return /^[,。;‘【】、\-=|+,.\/;’\[\]\\ ]$/.test(key);
|
|
8
|
+
}
|
|
9
|
+
function isFnNumberChar(key) {
|
|
10
|
+
return /^[!@#$%^&*()_+|~!¥…()—|~]$/.test(key);
|
|
11
|
+
}
|
|
3
12
|
function isKeyboardEvent(event) {
|
|
4
13
|
return Reflect.get(event, "view") === window && Reflect.get(event, "shiftKey") != void 0;
|
|
5
14
|
}
|
|
@@ -25,24 +34,36 @@ function getKeySignature(info) {
|
|
|
25
34
|
const keyBlackList = ["CONTROL", "ALT", "SHIFT"];
|
|
26
35
|
function inKeyBlackList(key) {
|
|
27
36
|
if (!isString(key))
|
|
28
|
-
return;
|
|
37
|
+
return false;
|
|
29
38
|
return keyBlackList.includes(key.toUpperCase());
|
|
30
39
|
}
|
|
31
|
-
function
|
|
40
|
+
function isInvalidKeyboardEvent(event) {
|
|
41
|
+
const target = event.target;
|
|
42
|
+
if (target.tagName !== "INPUT")
|
|
43
|
+
return false;
|
|
44
|
+
return isInvalidSignatureAtInput(event);
|
|
45
|
+
}
|
|
46
|
+
function isInvalidSignatureAtInput(info) {
|
|
32
47
|
const { ctrl, shift, alt, key } = normalizeSignatureInfo(info);
|
|
33
|
-
if (
|
|
34
|
-
return
|
|
48
|
+
if (ctrl || alt)
|
|
49
|
+
return false;
|
|
50
|
+
if (shift)
|
|
51
|
+
return isFnNumberChar(key);
|
|
52
|
+
return isAlphanumeric(key) || isPunctuation(key);
|
|
53
|
+
}
|
|
54
|
+
function isInvalidSignature(info) {
|
|
55
|
+
const { key } = normalizeSignatureInfo(info);
|
|
35
56
|
return inKeyBlackList(key);
|
|
36
57
|
}
|
|
37
58
|
function getDisplaySignature(info) {
|
|
38
59
|
const { ctrl, shift, alt, key } = normalizeSignatureInfo(info);
|
|
39
|
-
return `${ctrl ? "Ctrl+ " : ""}${alt ? "Alt + " : ""}${shift ? "Shift + " : ""}${inKeyBlackList(key) ? "" : key}`;
|
|
60
|
+
return `${ctrl ? "Ctrl + " : ""}${alt ? "Alt + " : ""}${shift ? "Shift + " : ""}${inKeyBlackList(key) ? "" : key.replace(" ", "SPACE")}`;
|
|
40
61
|
}
|
|
41
62
|
function transformKey2DisplaySignature(keySignature) {
|
|
42
|
-
return keySignature.replace(/_/g, " + ");
|
|
63
|
+
return keySignature.replace(" ", "SPACE").replace(/_/g, " + ");
|
|
43
64
|
}
|
|
44
65
|
function isShortcutProvider(ele) {
|
|
45
66
|
return ele && ele.getAttribute("is-shortcut-capture") != void 0;
|
|
46
67
|
}
|
|
47
68
|
|
|
48
|
-
export { getDisplaySignature, getKeySignature, inKeyBlackList, isInvalidSignature, isKeyboardEvent, isShortcutProvider, normalizeSignatureInfo, transformKey2DisplaySignature };
|
|
69
|
+
export { getDisplaySignature, getKeySignature, inKeyBlackList, isInvalidKeyboardEvent, isInvalidSignature, isInvalidSignatureAtInput, isKeyboardEvent, isShortcutProvider, normalizeSignatureInfo, transformKey2DisplaySignature };
|