cnhis-design-vue 3.1.29-beta.5 → 3.1.29-beta.7
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/components/field-set/src/FieldSet.js +59 -37
- package/es/components/form-config/index.d.ts +19 -2
- package/es/components/form-config/src/FormConfig.js +24 -19
- package/es/components/form-config/src/FormConfig.vue.d.ts +19 -2
- package/es/components/form-config/src/components/FormConfigEdit.js +5 -1
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +18 -2
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.d.ts +14 -2
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +7 -2
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +3 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/colorRendererPlugin.js +2 -0
- package/es/components/keyboard/index.d.ts +5 -0
- package/es/components/keyboard/src/Keyboard.js +14 -7
- package/es/components/keyboard/src/Keyboard.vue.d.ts +5 -0
- package/es/components/keyboard/src/components/InputNumber.js +4 -3
- package/es/components/keyboard/src/components/InputNumber.vue.d.ts +4 -0
- package/es/components/keyboard/src/utils/index.d.ts +1 -0
- package/es/components/keyboard/src/utils/index.js +5 -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/package.json +2 -2
|
@@ -20,35 +20,37 @@ const _hoisted_7 = {
|
|
|
20
20
|
class: "width-show"
|
|
21
21
|
};
|
|
22
22
|
const _hoisted_8 = { class: "width-show" };
|
|
23
|
-
const _hoisted_9 =
|
|
24
|
-
const _hoisted_10 = /* @__PURE__ */ createElementVNode("span", { class: "width-
|
|
25
|
-
const _hoisted_11 = /* @__PURE__ */ createElementVNode("span", { class: "width-
|
|
26
|
-
const _hoisted_12 =
|
|
27
|
-
const _hoisted_13 =
|
|
28
|
-
const _hoisted_14 =
|
|
23
|
+
const _hoisted_9 = { class: "width-show" };
|
|
24
|
+
const _hoisted_10 = /* @__PURE__ */ createElementVNode("span", { class: "width-showed" }, "\u56FA\u5B9A", -1);
|
|
25
|
+
const _hoisted_11 = /* @__PURE__ */ createElementVNode("span", { class: "width-word" }, "\u81EA\u5B9A\u4E49\u6807\u9898", -1);
|
|
26
|
+
const _hoisted_12 = /* @__PURE__ */ createElementVNode("span", { class: "width-showed" }, "\u5217\u5BBD", -1);
|
|
27
|
+
const _hoisted_13 = ["onClick"];
|
|
28
|
+
const _hoisted_14 = { class: "width-show drag-icon-wrap" };
|
|
29
|
+
const _hoisted_15 = /* @__PURE__ */ createElementVNode("span", {
|
|
29
30
|
class: "iconfont icon-a-menzhenyishengzhanxitongtubiaotuozhuai",
|
|
30
31
|
style: { "color": "#000" }
|
|
31
32
|
}, null, -1);
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
const
|
|
33
|
+
const _hoisted_16 = /* @__PURE__ */ createElementVNode("span", null, "\u62D6\u62FD\u8C03\u6574\u987A\u5E8F", -1);
|
|
34
|
+
const _hoisted_17 = /* @__PURE__ */ createElementVNode("span", { style: { "width": "14px", "margin-right": "6px" } }, null, -1);
|
|
35
|
+
const _hoisted_18 = { class: "width-show" };
|
|
36
|
+
const _hoisted_19 = {
|
|
36
37
|
key: 0,
|
|
37
38
|
class: "width-show"
|
|
38
39
|
};
|
|
39
|
-
const
|
|
40
|
+
const _hoisted_20 = {
|
|
40
41
|
key: 1,
|
|
41
42
|
class: "width-show"
|
|
42
43
|
};
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
const _hoisted_22 = { class: "width-word" };
|
|
44
|
+
const _hoisted_21 = { class: "width-show" };
|
|
45
|
+
const _hoisted_22 = { class: "width-show" };
|
|
46
46
|
const _hoisted_23 = { class: "width-showed" };
|
|
47
|
-
const _hoisted_24 = {
|
|
47
|
+
const _hoisted_24 = { class: "width-word" };
|
|
48
|
+
const _hoisted_25 = { class: "width-showed" };
|
|
49
|
+
const _hoisted_26 = {
|
|
48
50
|
key: 0,
|
|
49
51
|
class: "check-options"
|
|
50
52
|
};
|
|
51
|
-
const
|
|
53
|
+
const _hoisted_27 = { class: "btn-operate" };
|
|
52
54
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
53
55
|
__name: "FieldSet",
|
|
54
56
|
props: {
|
|
@@ -117,6 +119,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
117
119
|
if (!Reflect.has(item, "alias")) {
|
|
118
120
|
item.alias = "";
|
|
119
121
|
}
|
|
122
|
+
if (!Reflect.has(item, "bold")) {
|
|
123
|
+
item.bold = false;
|
|
124
|
+
}
|
|
120
125
|
});
|
|
121
126
|
});
|
|
122
127
|
return result;
|
|
@@ -126,8 +131,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
126
131
|
isCustomSearch: true,
|
|
127
132
|
clickItem: {},
|
|
128
133
|
fields: [],
|
|
129
|
-
widthShow: "
|
|
130
|
-
widthLarge: "
|
|
134
|
+
widthShow: "9%",
|
|
135
|
+
widthLarge: "19%"
|
|
131
136
|
});
|
|
132
137
|
const leftStyle = (ele) => {
|
|
133
138
|
return {
|
|
@@ -155,6 +160,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
155
160
|
title: item.alias,
|
|
156
161
|
fixed: item.fixedWay,
|
|
157
162
|
minWidth: item.columnWidth,
|
|
163
|
+
bold: item.bold,
|
|
158
164
|
...props.isEdit ? {
|
|
159
165
|
required: item.required,
|
|
160
166
|
editable: item.editable
|
|
@@ -204,8 +210,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
204
210
|
}
|
|
205
211
|
function setWidth() {
|
|
206
212
|
if (props.isEdit) {
|
|
207
|
-
state.widthShow = "
|
|
208
|
-
state.widthLarge = "
|
|
213
|
+
state.widthShow = "8%";
|
|
214
|
+
state.widthLarge = "13%";
|
|
209
215
|
}
|
|
210
216
|
}
|
|
211
217
|
watch(
|
|
@@ -281,12 +287,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
281
287
|
}, null, 8, ["checked"])) : createCommentVNode("v-if", true),
|
|
282
288
|
createTextVNode(" \u6392\u5E8F ")
|
|
283
289
|
]),
|
|
290
|
+
createElementVNode("span", _hoisted_9, [
|
|
291
|
+
createVNode(unref(NCheckbox), {
|
|
292
|
+
checked: calculateCheck("bold"),
|
|
293
|
+
"onUpdate:checked": _cache[4] || (_cache[4] = ($event) => handleAllCheck($event, "bold"))
|
|
294
|
+
}, null, 8, ["checked"]),
|
|
295
|
+
createTextVNode(" \u52A0\u7C97 ")
|
|
296
|
+
]),
|
|
284
297
|
createCommentVNode(" \u56FA\u5B9A "),
|
|
285
|
-
_hoisted_9,
|
|
286
|
-
createCommentVNode(" \u81EA\u5B9A\u4E49\u6807\u9898 "),
|
|
287
298
|
_hoisted_10,
|
|
299
|
+
createCommentVNode(" \u81EA\u5B9A\u4E49\u6807\u9898 "),
|
|
300
|
+
_hoisted_11,
|
|
288
301
|
createCommentVNode(" \u5217\u5BBD "),
|
|
289
|
-
|
|
302
|
+
_hoisted_12
|
|
290
303
|
], 2),
|
|
291
304
|
createElementVNode("div", {
|
|
292
305
|
ref: "setShow",
|
|
@@ -305,13 +318,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
305
318
|
style: normalizeStyle(leftStyle(element)),
|
|
306
319
|
onClick: ($event) => handleFieldClick(element)
|
|
307
320
|
}, [
|
|
308
|
-
createElementVNode("span",
|
|
321
|
+
createElementVNode("span", _hoisted_14, [
|
|
309
322
|
createVNode(unref(NTooltip), { trigger: "hover" }, {
|
|
310
323
|
trigger: withCtx(() => [
|
|
311
|
-
|
|
324
|
+
_hoisted_15
|
|
312
325
|
]),
|
|
313
326
|
default: withCtx(() => [
|
|
314
|
-
|
|
327
|
+
_hoisted_16
|
|
315
328
|
]),
|
|
316
329
|
_: 1
|
|
317
330
|
})
|
|
@@ -320,11 +333,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
320
333
|
createElementVNode("span", {
|
|
321
334
|
class: normalizeClass(["width-large title-item", { blue: element.extraField }])
|
|
322
335
|
}, [
|
|
323
|
-
|
|
336
|
+
_hoisted_17,
|
|
324
337
|
createElementVNode("span", null, toDisplayString(element.title), 1)
|
|
325
338
|
], 2),
|
|
326
339
|
createCommentVNode(" \u663E\u793A "),
|
|
327
|
-
createElementVNode("span",
|
|
340
|
+
createElementVNode("span", _hoisted_18, [
|
|
328
341
|
withDirectives(createVNode(unref(NCheckbox), {
|
|
329
342
|
checked: element.show,
|
|
330
343
|
"onUpdate:checked": ($event) => element.show = $event
|
|
@@ -333,7 +346,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
333
346
|
])
|
|
334
347
|
]),
|
|
335
348
|
createCommentVNode(" \u662F\u5426\u53EF\u7F16\u8F91 "),
|
|
336
|
-
__props.isEdit ? (openBlock(), createElementBlock("span",
|
|
349
|
+
__props.isEdit ? (openBlock(), createElementBlock("span", _hoisted_19, [
|
|
337
350
|
withDirectives(createVNode(unref(NCheckbox), {
|
|
338
351
|
disabled: element.editableDisable,
|
|
339
352
|
checked: element.editable,
|
|
@@ -343,7 +356,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
343
356
|
])
|
|
344
357
|
])) : createCommentVNode("v-if", true),
|
|
345
358
|
createCommentVNode(" \u662F\u5426\u5FC5\u586B "),
|
|
346
|
-
__props.isEdit ? (openBlock(), createElementBlock("span",
|
|
359
|
+
__props.isEdit ? (openBlock(), createElementBlock("span", _hoisted_20, [
|
|
347
360
|
withDirectives(createVNode(unref(NCheckbox), {
|
|
348
361
|
disabled: element.requiredDisable,
|
|
349
362
|
checked: element.required,
|
|
@@ -353,7 +366,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
353
366
|
])
|
|
354
367
|
])) : createCommentVNode("v-if", true),
|
|
355
368
|
createCommentVNode(" \u6392\u5E8F "),
|
|
356
|
-
createElementVNode("span",
|
|
369
|
+
createElementVNode("span", _hoisted_21, [
|
|
357
370
|
withDirectives(createVNode(unref(NCheckbox), {
|
|
358
371
|
checked: element.sort,
|
|
359
372
|
"onUpdate:checked": ($event) => element.sort = $event,
|
|
@@ -362,8 +375,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
362
375
|
[vShow, element.id != "0001"]
|
|
363
376
|
])
|
|
364
377
|
]),
|
|
378
|
+
createCommentVNode(" \u52A0\u7C97 "),
|
|
379
|
+
createElementVNode("span", _hoisted_22, [
|
|
380
|
+
withDirectives(createVNode(unref(NCheckbox), {
|
|
381
|
+
checked: element.bold,
|
|
382
|
+
"onUpdate:checked": ($event) => element.bold = $event
|
|
383
|
+
}, null, 8, ["checked", "onUpdate:checked"]), [
|
|
384
|
+
[vShow, element.id != "0001"]
|
|
385
|
+
])
|
|
386
|
+
]),
|
|
365
387
|
createCommentVNode(" \u56FA\u5B9A "),
|
|
366
|
-
createElementVNode("span",
|
|
388
|
+
createElementVNode("span", _hoisted_23, [
|
|
367
389
|
createVNode(unref(NSelect), {
|
|
368
390
|
value: element.fixedWay,
|
|
369
391
|
"onUpdate:value": ($event) => element.fixedWay = $event,
|
|
@@ -372,7 +394,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
372
394
|
}, null, 8, ["value", "onUpdate:value"])
|
|
373
395
|
]),
|
|
374
396
|
createCommentVNode(" \u81EA\u5B9A\u4E49\u6807\u9898 "),
|
|
375
|
-
createElementVNode("span",
|
|
397
|
+
createElementVNode("span", _hoisted_24, [
|
|
376
398
|
withDirectives(createVNode(unref(NInput), {
|
|
377
399
|
value: element.alias,
|
|
378
400
|
"onUpdate:value": ($event) => element.alias = $event,
|
|
@@ -382,21 +404,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
382
404
|
])
|
|
383
405
|
]),
|
|
384
406
|
createCommentVNode(" \u5217\u5BBD "),
|
|
385
|
-
createElementVNode("span",
|
|
407
|
+
createElementVNode("span", _hoisted_25, [
|
|
386
408
|
createVNode(unref(NInputNumber), {
|
|
387
409
|
value: element.columnWidth,
|
|
388
410
|
"onUpdate:value": ($event) => element.columnWidth = $event,
|
|
389
411
|
style: { width: "120px" }
|
|
390
412
|
}, null, 8, ["value", "onUpdate:value"])
|
|
391
413
|
])
|
|
392
|
-
], 12,
|
|
414
|
+
], 12, _hoisted_13)) : createCommentVNode("v-if", true)
|
|
393
415
|
]),
|
|
394
416
|
_: 1
|
|
395
417
|
}, 8, ["list"])
|
|
396
418
|
], 2)
|
|
397
419
|
]),
|
|
398
|
-
props.footerFlag ? (openBlock(), createElementBlock("div",
|
|
399
|
-
createElementVNode("div",
|
|
420
|
+
props.footerFlag ? (openBlock(), createElementBlock("div", _hoisted_26, [
|
|
421
|
+
createElementVNode("div", _hoisted_27, [
|
|
400
422
|
renderSlot(_ctx.$slots, "footer", {}, () => [
|
|
401
423
|
createVNode(unref(NPopconfirm), { onPositiveClick: reset }, {
|
|
402
424
|
trigger: withCtx(() => [
|
|
@@ -17,6 +17,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
17
17
|
type: import("vue").PropType<import("./src/types").FormConfigTextFormatter>;
|
|
18
18
|
};
|
|
19
19
|
}>> & {}>>;
|
|
20
|
+
uuid: string;
|
|
20
21
|
getCommonConfig: () => {
|
|
21
22
|
move: ({ to, from, dragged }: import("sortablejs").MoveEvent) => false | undefined;
|
|
22
23
|
onChoose: ({ target, item }: import("sortablejs").SortableEvent) => void;
|
|
@@ -907,7 +908,18 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
907
908
|
required: true;
|
|
908
909
|
};
|
|
909
910
|
}>>, {}>;
|
|
910
|
-
FormConfigEdit: import("vue").DefineComponent<{
|
|
911
|
+
FormConfigEdit: import("vue").DefineComponent<{
|
|
912
|
+
uuid: {
|
|
913
|
+
type: StringConstructor;
|
|
914
|
+
required: true;
|
|
915
|
+
};
|
|
916
|
+
}, {
|
|
917
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
918
|
+
uuid: {
|
|
919
|
+
type: StringConstructor;
|
|
920
|
+
required: true;
|
|
921
|
+
};
|
|
922
|
+
}>> & {}>>;
|
|
911
923
|
key: import("vue").Ref<number>;
|
|
912
924
|
formRenderRef: import("vue").Ref<import("..").FormRenderExpose | undefined>;
|
|
913
925
|
currentActiveField: import("vue").Ref<import("../../../es/shared/types").UndefinedAble<import("./src/types").FormConfigItem>>;
|
|
@@ -3259,7 +3271,12 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
3259
3271
|
enterToNextWidget: boolean;
|
|
3260
3272
|
}>;
|
|
3261
3273
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
|
|
3262
|
-
},
|
|
3274
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
3275
|
+
uuid: {
|
|
3276
|
+
type: StringConstructor;
|
|
3277
|
+
required: true;
|
|
3278
|
+
};
|
|
3279
|
+
}>>, {}>;
|
|
3263
3280
|
FormConfigMaterialItem: import("vue").DefineComponent<{
|
|
3264
3281
|
fieldItem: {
|
|
3265
3282
|
type: import("vue").PropType<import("./src/types").FormConfigItem>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { defineComponent, ref, provide, toRaw, openBlock, createElementBlock, normalizeStyle, createElementVNode, createVNode,
|
|
1
|
+
import { defineComponent, ref, provide, toRaw, openBlock, createElementBlock, normalizeStyle, unref, createElementVNode, createVNode, mergeProps, withCtx, createTextVNode } from 'vue';
|
|
2
|
+
import { uuidGenerator } from '../../../shared/utils/index.js';
|
|
2
3
|
import { cloneDeep, isFunction } from 'lodash-es';
|
|
3
4
|
import draggableComponent from '../../../shared/components/VueDraggable/src/vuedraggable.js';
|
|
4
5
|
import FormConfigCreator from './components/FormConfigCreator.js';
|
|
@@ -13,13 +14,14 @@ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.js';
|
|
|
13
14
|
import './utils/index.js';
|
|
14
15
|
import { useSortableConfig } from './hooks/useSortalbeConfig.js';
|
|
15
16
|
|
|
16
|
-
const _hoisted_1 =
|
|
17
|
-
const _hoisted_2 =
|
|
18
|
-
const _hoisted_3 = { class: "form-
|
|
19
|
-
const _hoisted_4 = { class: "form-
|
|
20
|
-
const _hoisted_5 = { class: "form-
|
|
21
|
-
const _hoisted_6 =
|
|
22
|
-
const _hoisted_7 = { class: "form-
|
|
17
|
+
const _hoisted_1 = ["id"];
|
|
18
|
+
const _hoisted_2 = { class: "form-config__material" };
|
|
19
|
+
const _hoisted_3 = /* @__PURE__ */ createElementVNode("header", { class: "form-config__materialHeader" }, "\u7269\u6599\u533A", -1);
|
|
20
|
+
const _hoisted_4 = { class: "form-config__displayWrapper" };
|
|
21
|
+
const _hoisted_5 = { class: "form-config__displayHeader" };
|
|
22
|
+
const _hoisted_6 = { class: "form-config__config" };
|
|
23
|
+
const _hoisted_7 = /* @__PURE__ */ createElementVNode("header", { class: "form-config__configHeader" }, "\u914D\u7F6E\u533A", -1);
|
|
24
|
+
const _hoisted_8 = { class: "form-config__configContent" };
|
|
23
25
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
24
26
|
__name: "FormConfig",
|
|
25
27
|
props: {
|
|
@@ -28,6 +30,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
28
30
|
},
|
|
29
31
|
setup(__props, { expose }) {
|
|
30
32
|
const props = __props;
|
|
33
|
+
const uuid = uuidGenerator();
|
|
31
34
|
const { getCommonConfig } = useSortableConfig();
|
|
32
35
|
const fieldListRef = ref([]);
|
|
33
36
|
provide(InjectionFieldList, fieldListRef);
|
|
@@ -73,10 +76,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
73
76
|
return (_ctx, _cache) => {
|
|
74
77
|
return openBlock(), createElementBlock("section", {
|
|
75
78
|
class: "form-config",
|
|
76
|
-
style: normalizeStyle({ "--max-height": __props.maxHeight })
|
|
79
|
+
style: normalizeStyle({ "--max-height": __props.maxHeight }),
|
|
80
|
+
id: unref(uuid)
|
|
77
81
|
}, [
|
|
78
|
-
createElementVNode("section",
|
|
79
|
-
|
|
82
|
+
createElementVNode("section", _hoisted_2, [
|
|
83
|
+
_hoisted_3,
|
|
80
84
|
createVNode(unref(draggableComponent), mergeProps(unref(getCommonConfig)(), {
|
|
81
85
|
class: "form-config__materialContent",
|
|
82
86
|
modelValue: materialListRef.value,
|
|
@@ -88,8 +92,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
88
92
|
_: 1
|
|
89
93
|
}, 16, ["modelValue"])
|
|
90
94
|
]),
|
|
91
|
-
createElementVNode("section",
|
|
92
|
-
createElementVNode("header",
|
|
95
|
+
createElementVNode("section", _hoisted_4, [
|
|
96
|
+
createElementVNode("header", _hoisted_5, [
|
|
93
97
|
createTextVNode(" \u5E03\u5C40\u533A "),
|
|
94
98
|
createVNode(FormConfigCreator, { onSubmit: addItem })
|
|
95
99
|
]),
|
|
@@ -101,16 +105,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
101
105
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => fieldListRef.value = $event)
|
|
102
106
|
}, null, 8, ["group", "modelValue"])
|
|
103
107
|
]),
|
|
104
|
-
createElementVNode("section",
|
|
105
|
-
|
|
106
|
-
createElementVNode("section",
|
|
108
|
+
createElementVNode("section", _hoisted_6, [
|
|
109
|
+
_hoisted_7,
|
|
110
|
+
createElementVNode("section", _hoisted_8, [
|
|
107
111
|
createVNode(FormConfigEdit, {
|
|
108
112
|
ref_key: "formConfigEditRef",
|
|
109
|
-
ref: formConfigEditRef
|
|
110
|
-
|
|
113
|
+
ref: formConfigEditRef,
|
|
114
|
+
uuid: unref(uuid)
|
|
115
|
+
}, null, 8, ["uuid"])
|
|
111
116
|
])
|
|
112
117
|
])
|
|
113
|
-
],
|
|
118
|
+
], 12, _hoisted_1);
|
|
114
119
|
};
|
|
115
120
|
}
|
|
116
121
|
});
|
|
@@ -18,6 +18,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
18
18
|
type: PropType<FormConfigTextFormatter>;
|
|
19
19
|
};
|
|
20
20
|
}>> & {}>>;
|
|
21
|
+
uuid: string;
|
|
21
22
|
getCommonConfig: () => {
|
|
22
23
|
move: ({ to, from, dragged }: import("sortablejs").MoveEvent) => false | undefined;
|
|
23
24
|
onChoose: ({ target, item }: import("sortablejs").SortableEvent) => void;
|
|
@@ -908,7 +909,18 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
908
909
|
required: true;
|
|
909
910
|
};
|
|
910
911
|
}>>, {}>;
|
|
911
|
-
FormConfigEdit: import("vue").DefineComponent<{
|
|
912
|
+
FormConfigEdit: import("vue").DefineComponent<{
|
|
913
|
+
uuid: {
|
|
914
|
+
type: StringConstructor;
|
|
915
|
+
required: true;
|
|
916
|
+
};
|
|
917
|
+
}, {
|
|
918
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
919
|
+
uuid: {
|
|
920
|
+
type: StringConstructor;
|
|
921
|
+
required: true;
|
|
922
|
+
};
|
|
923
|
+
}>> & {}>>;
|
|
912
924
|
key: import("vue").Ref<number>;
|
|
913
925
|
formRenderRef: import("vue").Ref<import("../..").FormRenderExpose | undefined>;
|
|
914
926
|
currentActiveField: import("vue").Ref<import("../../../../es/shared/types").UndefinedAble<FormConfigItem>>;
|
|
@@ -3260,7 +3272,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3260
3272
|
enterToNextWidget: boolean;
|
|
3261
3273
|
}>;
|
|
3262
3274
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
|
|
3263
|
-
},
|
|
3275
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
3276
|
+
uuid: {
|
|
3277
|
+
type: StringConstructor;
|
|
3278
|
+
required: true;
|
|
3279
|
+
};
|
|
3280
|
+
}>>, {}>;
|
|
3264
3281
|
FormConfigMaterialItem: import("vue").DefineComponent<{
|
|
3265
3282
|
fieldItem: {
|
|
3266
3283
|
type: PropType<FormConfigItem>;
|
|
@@ -13,7 +13,9 @@ import FormRender from '../../../form-render/index.js';
|
|
|
13
13
|
|
|
14
14
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
15
15
|
__name: "FormConfigEdit",
|
|
16
|
+
props: { uuid: { type: String, required: true } },
|
|
16
17
|
setup(__props, { expose }) {
|
|
18
|
+
const props = __props;
|
|
17
19
|
const key = ref(0);
|
|
18
20
|
const formRenderRef = ref();
|
|
19
21
|
const currentActiveField = inject(InjectionActiveFieldItem);
|
|
@@ -43,7 +45,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
43
45
|
}
|
|
44
46
|
prevOldField = field;
|
|
45
47
|
initialData.value = { editable: true, ...cloneDeep(toRaw(field)) };
|
|
46
|
-
fieldList.value = generateFieldListByFieldItem(field)
|
|
48
|
+
fieldList.value = generateFieldListByFieldItem(field).map((fieldItem) => {
|
|
49
|
+
return { ...fieldItem, componentProps: { to: `#${props.uuid} .form-config__config` } };
|
|
50
|
+
});
|
|
47
51
|
key.value++;
|
|
48
52
|
},
|
|
49
53
|
{ immediate: true }
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { FieldItem, FormChangePayload, FormRenderExpose } from '../../../../../es/components/form-render';
|
|
2
2
|
import { FormConfigItem } from '../../../../../es/components/index';
|
|
3
|
-
declare const _default: import("vue").DefineComponent<{
|
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
|
4
|
+
uuid: {
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
}, {
|
|
9
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
10
|
+
uuid: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
}>> & {}>>;
|
|
4
15
|
key: import("vue").Ref<number>;
|
|
5
16
|
formRenderRef: import("vue").Ref<FormRenderExpose | undefined>;
|
|
6
17
|
currentActiveField: import("vue").Ref<import("../../../../../es/shared/types").UndefinedAble<FormConfigItem>>;
|
|
@@ -2352,5 +2363,10 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
2352
2363
|
enterToNextWidget: boolean;
|
|
2353
2364
|
}>;
|
|
2354
2365
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
|
|
2355
|
-
},
|
|
2366
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
2367
|
+
uuid: {
|
|
2368
|
+
type: StringConstructor;
|
|
2369
|
+
required: true;
|
|
2370
|
+
};
|
|
2371
|
+
}>>, {}>;
|
|
2356
2372
|
export default _default;
|
|
@@ -2,6 +2,10 @@ import { PropType } from 'vue';
|
|
|
2
2
|
import { IhoTableFieldItem } from '../../../../../../../../es/components/iho-table';
|
|
3
3
|
import { AnyObject } from '../../../../../../../../es/shared/types';
|
|
4
4
|
declare const _default: import("vue").DefineComponent<{
|
|
5
|
+
value: {
|
|
6
|
+
type: PropType<string | number | (string | number)[]>;
|
|
7
|
+
default: undefined;
|
|
8
|
+
};
|
|
5
9
|
column: {
|
|
6
10
|
type: PropType<IhoTableFieldItem>;
|
|
7
11
|
required: true;
|
|
@@ -14,7 +18,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
14
18
|
type: NumberConstructor;
|
|
15
19
|
required: true;
|
|
16
20
|
};
|
|
17
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
21
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
22
|
+
value: {
|
|
23
|
+
type: PropType<string | number | (string | number)[]>;
|
|
24
|
+
default: undefined;
|
|
25
|
+
};
|
|
18
26
|
column: {
|
|
19
27
|
type: PropType<IhoTableFieldItem>;
|
|
20
28
|
required: true;
|
|
@@ -27,5 +35,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
27
35
|
type: NumberConstructor;
|
|
28
36
|
required: true;
|
|
29
37
|
};
|
|
30
|
-
}
|
|
38
|
+
}>> & {
|
|
39
|
+
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
40
|
+
}, {
|
|
41
|
+
value: string | number | (string | number)[];
|
|
42
|
+
}>;
|
|
31
43
|
export default _default;
|
|
@@ -10,6 +10,10 @@ var EditSelect = defineComponent({
|
|
|
10
10
|
NSelect
|
|
11
11
|
},
|
|
12
12
|
props: {
|
|
13
|
+
value: {
|
|
14
|
+
type: [Array, String, Number],
|
|
15
|
+
default: void 0
|
|
16
|
+
},
|
|
13
17
|
column: {
|
|
14
18
|
type: Object,
|
|
15
19
|
required: true
|
|
@@ -23,6 +27,7 @@ var EditSelect = defineComponent({
|
|
|
23
27
|
required: true
|
|
24
28
|
}
|
|
25
29
|
},
|
|
30
|
+
emits: ["update:value"],
|
|
26
31
|
setup(props, {
|
|
27
32
|
attrs,
|
|
28
33
|
slots,
|
|
@@ -34,6 +39,7 @@ var EditSelect = defineComponent({
|
|
|
34
39
|
isShow
|
|
35
40
|
} = useCommon();
|
|
36
41
|
function onUpdateValue(value) {
|
|
42
|
+
emit("update:value", value);
|
|
37
43
|
globEmit("formChange", {
|
|
38
44
|
value,
|
|
39
45
|
row: props.row,
|
|
@@ -46,8 +52,7 @@ var EditSelect = defineComponent({
|
|
|
46
52
|
"show": isShow.value,
|
|
47
53
|
"onUpdate:show": ($event) => isShow.value = $event
|
|
48
54
|
}, attrs, {
|
|
49
|
-
"value": props.
|
|
50
|
-
"onUpdate:value": ($event) => props.row[props.column.field] = $event,
|
|
55
|
+
"value": props.value,
|
|
51
56
|
"consistentMenuWidth": false,
|
|
52
57
|
"clearable": true,
|
|
53
58
|
"filterable": true,
|
|
@@ -29,7 +29,9 @@ function selectRendererPlugin() {
|
|
|
29
29
|
return [createVNode(EditSelect, mergeProps((props == null ? void 0 : props.componentProps) || {}, {
|
|
30
30
|
"column": column,
|
|
31
31
|
"row": row,
|
|
32
|
-
"index": $rowIndex
|
|
32
|
+
"index": $rowIndex,
|
|
33
|
+
"value": row[column.field],
|
|
34
|
+
"onUpdate:value": ($event) => row[column.field] = $event
|
|
33
35
|
}), null)];
|
|
34
36
|
}
|
|
35
37
|
});
|
|
@@ -21,6 +21,7 @@ declare const Keyboard: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
21
21
|
onKeydown?: ((...args: any[]) => any) | undefined;
|
|
22
22
|
}>>;
|
|
23
23
|
emit: (event: "change" | "keydown", ...args: any[]) => void;
|
|
24
|
+
popoverRef: import("vue").Ref<null>;
|
|
24
25
|
numberKeys: import("vue").Ref<string[]>;
|
|
25
26
|
days: import("vue").Ref<number[]>;
|
|
26
27
|
doses: import("vue").Ref<number[]>;
|
|
@@ -49,6 +50,7 @@ declare const Keyboard: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
49
50
|
InputNumber: import("vue").DefineComponent<{
|
|
50
51
|
modelValue: {
|
|
51
52
|
type: StringConstructor;
|
|
53
|
+
default: string;
|
|
52
54
|
};
|
|
53
55
|
integer: {
|
|
54
56
|
type: BooleanConstructor;
|
|
@@ -58,6 +60,7 @@ declare const Keyboard: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
58
60
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
59
61
|
modelValue: {
|
|
60
62
|
type: StringConstructor;
|
|
63
|
+
default: string;
|
|
61
64
|
};
|
|
62
65
|
integer: {
|
|
63
66
|
type: BooleanConstructor;
|
|
@@ -78,6 +81,7 @@ declare const Keyboard: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
78
81
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
79
82
|
modelValue: {
|
|
80
83
|
type: StringConstructor;
|
|
84
|
+
default: string;
|
|
81
85
|
};
|
|
82
86
|
integer: {
|
|
83
87
|
type: BooleanConstructor;
|
|
@@ -86,6 +90,7 @@ declare const Keyboard: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
86
90
|
}>> & {
|
|
87
91
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
88
92
|
}, {
|
|
93
|
+
modelValue: string;
|
|
89
94
|
integer: boolean;
|
|
90
95
|
}>;
|
|
91
96
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "keydown")[], "change" | "keydown", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -3,6 +3,7 @@ import { NPopover, NInputNumber, NSpace, NIcon } from 'naive-ui';
|
|
|
3
3
|
import { ArrowUndoSharp, Close, GitCompareOutline } from '@vicons/ionicons5';
|
|
4
4
|
import InputNumber from './components/InputNumber.js';
|
|
5
5
|
import { useRefHistory } from '@vueuse/core';
|
|
6
|
+
import { getNumber } from './utils/index.js';
|
|
6
7
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.js';
|
|
7
8
|
|
|
8
9
|
const _hoisted_1 = { class: "c-keyboard" };
|
|
@@ -36,6 +37,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
36
37
|
const ENGLISHOTHERKEY = ["switch", " ", "undo", "Enter"];
|
|
37
38
|
const ENGLISHKEYS = ENGLISHKEY.split("").concat(ENGLISHOTHERKEY);
|
|
38
39
|
const ENGLISHKEYS_ = ENGLISHKEY.split(".")[0].split("").sort().concat(["."], ENGLISHOTHERKEY);
|
|
40
|
+
const popoverRef = ref(null);
|
|
39
41
|
const numberKeys = ref(NUMBERKEYS.split(""));
|
|
40
42
|
const days = ref(DAYS);
|
|
41
43
|
const doses = ref([2, 3, 4, 5, 6, 7, 8]);
|
|
@@ -50,7 +52,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
50
52
|
const isDay = computed(() => props.mode === "day");
|
|
51
53
|
const isDose = computed(() => props.mode === "dose");
|
|
52
54
|
function keydown(key) {
|
|
53
|
-
var _a, _b;
|
|
55
|
+
var _a, _b, _c;
|
|
54
56
|
if (props.mode === "default") {
|
|
55
57
|
if (key !== "switch") {
|
|
56
58
|
emit("keydown", key);
|
|
@@ -66,13 +68,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
66
68
|
}
|
|
67
69
|
case "enter":
|
|
68
70
|
value.value = +inputValue.value;
|
|
71
|
+
(_a = popoverRef.value) == null ? void 0 : _a.setShow(false);
|
|
69
72
|
emit("change", value.value);
|
|
70
73
|
break;
|
|
71
74
|
default:
|
|
72
75
|
if (typeof key === "number") {
|
|
73
76
|
inputValue.value = key.toString();
|
|
74
77
|
} else {
|
|
75
|
-
inputValue.value = (((
|
|
78
|
+
inputValue.value = (((_c = (_b = inputValue.value) == null ? void 0 : _b.toString) == null ? void 0 : _c.call(_b)) || "") + key;
|
|
76
79
|
}
|
|
77
80
|
break;
|
|
78
81
|
}
|
|
@@ -82,22 +85,26 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
82
85
|
denominatorValue.value = value2.toString();
|
|
83
86
|
}
|
|
84
87
|
function calculateFraction() {
|
|
85
|
-
|
|
86
|
-
inputValue.value = (
|
|
88
|
+
const value2 = getNumber(integerValue.value) + getNumber(numeratorValue.value) / getNumber(denominatorValue.value);
|
|
89
|
+
inputValue.value = (isNaN(value2) || Object.is(Infinity, value2) ? "" : value2).toString();
|
|
87
90
|
}
|
|
88
91
|
return (_ctx, _cache) => {
|
|
89
92
|
return !unref(isDefault) ? (openBlock(), createBlock(unref(NPopover), {
|
|
90
93
|
key: 0,
|
|
94
|
+
ref_key: "popoverRef",
|
|
95
|
+
ref: popoverRef,
|
|
91
96
|
trigger: "click",
|
|
92
97
|
"show-arrow": false,
|
|
93
98
|
placement: "bottom-start",
|
|
94
|
-
style: { "padding": "0" }
|
|
99
|
+
style: { "padding": "0" },
|
|
100
|
+
"display-directive": "show"
|
|
95
101
|
}, {
|
|
96
102
|
trigger: withCtx(() => [
|
|
97
103
|
createVNode(unref(NInputNumber), {
|
|
98
104
|
value: value.value,
|
|
99
105
|
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => value.value = $event),
|
|
100
|
-
style: { "width": "200px" }
|
|
106
|
+
style: { "width": "200px" },
|
|
107
|
+
"show-button": false
|
|
101
108
|
}, null, 8, ["value"])
|
|
102
109
|
]),
|
|
103
110
|
default: withCtx(() => [
|
|
@@ -207,7 +214,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
207
214
|
])
|
|
208
215
|
]),
|
|
209
216
|
_: 1
|
|
210
|
-
})) : (openBlock(), createElementBlock("div", _hoisted_11, [
|
|
217
|
+
}, 512)) : (openBlock(), createElementBlock("div", _hoisted_11, [
|
|
211
218
|
createVNode(unref(NSpace), {
|
|
212
219
|
"wrap-item": false,
|
|
213
220
|
align: "center",
|
|
@@ -21,6 +21,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
21
21
|
onKeydown?: ((...args: any[]) => any) | undefined;
|
|
22
22
|
}>>;
|
|
23
23
|
emit: (event: "change" | "keydown", ...args: any[]) => void;
|
|
24
|
+
popoverRef: import("vue").Ref<null>;
|
|
24
25
|
numberKeys: import("vue").Ref<string[]>;
|
|
25
26
|
days: import("vue").Ref<number[]>;
|
|
26
27
|
doses: import("vue").Ref<number[]>;
|
|
@@ -49,6 +50,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
49
50
|
InputNumber: import("vue").DefineComponent<{
|
|
50
51
|
modelValue: {
|
|
51
52
|
type: StringConstructor;
|
|
53
|
+
default: string;
|
|
52
54
|
};
|
|
53
55
|
integer: {
|
|
54
56
|
type: BooleanConstructor;
|
|
@@ -58,6 +60,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
58
60
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
59
61
|
modelValue: {
|
|
60
62
|
type: StringConstructor;
|
|
63
|
+
default: string;
|
|
61
64
|
};
|
|
62
65
|
integer: {
|
|
63
66
|
type: BooleanConstructor;
|
|
@@ -78,6 +81,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
78
81
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
79
82
|
modelValue: {
|
|
80
83
|
type: StringConstructor;
|
|
84
|
+
default: string;
|
|
81
85
|
};
|
|
82
86
|
integer: {
|
|
83
87
|
type: BooleanConstructor;
|
|
@@ -86,6 +90,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
86
90
|
}>> & {
|
|
87
91
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
88
92
|
}, {
|
|
93
|
+
modelValue: string;
|
|
89
94
|
integer: boolean;
|
|
90
95
|
}>;
|
|
91
96
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "keydown")[], "change" | "keydown", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createBlock, unref, withCtx, createVNode } from 'vue';
|
|
2
2
|
import { NInput, NSpace, NIcon } from 'naive-ui';
|
|
3
3
|
import { CaretUp, CaretDown } from '@vicons/ionicons5';
|
|
4
|
+
import { getNumber } from '../utils/index.js';
|
|
4
5
|
import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.js';
|
|
5
6
|
|
|
6
7
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
8
|
__name: "InputNumber",
|
|
8
9
|
props: {
|
|
9
|
-
modelValue: { type: String },
|
|
10
|
+
modelValue: { type: String, default: "" },
|
|
10
11
|
integer: { type: Boolean, default: false }
|
|
11
12
|
},
|
|
12
13
|
emits: ["update:modelValue"],
|
|
@@ -23,8 +24,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
23
24
|
return /^\d+\.?\d*$/.test(value);
|
|
24
25
|
}
|
|
25
26
|
function calculate(type) {
|
|
26
|
-
|
|
27
|
-
const newValue = type === "+" ?
|
|
27
|
+
const value = getNumber(props.modelValue);
|
|
28
|
+
const newValue = type === "+" ? value + 1 : value - 1;
|
|
28
29
|
emit("update:modelValue", newValue.toString());
|
|
29
30
|
}
|
|
30
31
|
return (_ctx, _cache) => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{
|
|
2
2
|
modelValue: {
|
|
3
3
|
type: StringConstructor;
|
|
4
|
+
default: string;
|
|
4
5
|
};
|
|
5
6
|
integer: {
|
|
6
7
|
type: BooleanConstructor;
|
|
@@ -10,6 +11,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
10
11
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
11
12
|
modelValue: {
|
|
12
13
|
type: StringConstructor;
|
|
14
|
+
default: string;
|
|
13
15
|
};
|
|
14
16
|
integer: {
|
|
15
17
|
type: BooleanConstructor;
|
|
@@ -30,6 +32,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
30
32
|
}, 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
33
|
modelValue: {
|
|
32
34
|
type: StringConstructor;
|
|
35
|
+
default: string;
|
|
33
36
|
};
|
|
34
37
|
integer: {
|
|
35
38
|
type: BooleanConstructor;
|
|
@@ -38,6 +41,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
38
41
|
}>> & {
|
|
39
42
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
40
43
|
}, {
|
|
44
|
+
modelValue: string;
|
|
41
45
|
integer: boolean;
|
|
42
46
|
}>;
|
|
43
47
|
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getNumber(value: string): number;
|
|
@@ -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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cnhis-design-vue",
|
|
3
|
-
"version": "3.1.29-beta.
|
|
3
|
+
"version": "3.1.29-beta.7",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"module": "./es/components/index.js",
|
|
6
6
|
"main": "./es/components/index.js",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"iOS 7",
|
|
62
62
|
"last 3 iOS versions"
|
|
63
63
|
],
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "ebc8e3abcbc940cd42a9b65b0c307e8a6bd58138"
|
|
65
65
|
}
|