cnhis-design-vue 3.1.40-beta.6 → 3.1.40-beta.8
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/form-config/index.d.ts +38 -142
- package/es/components/form-config/src/FormConfig.vue.d.ts +38 -142
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +19 -71
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +19 -71
- package/es/components/form-render/index.d.ts +19 -71
- package/es/components/form-render/src/FormRender.vue.d.ts +19 -71
- package/es/components/form-render/src/FormRender.vue.js +31 -22
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +19 -71
- package/es/components/form-render/src/components/renderer/searchCascade.js +1 -0
- package/es/components/form-render/src/components/renderer/select.js +1 -0
- package/es/components/form-render/src/hooks/useAnchor.d.ts +6 -3
- package/es/components/form-render/src/hooks/useAnchor.js +26 -26
- package/es/components/form-render/src/hooks/useBusinessBinding.d.ts +7 -10
- package/es/components/form-render/src/hooks/useBusinessBinding.js +38 -36
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +2 -6
- package/es/components/form-render/src/hooks/useFormContext.d.ts +1 -2
- package/es/components/form-render/src/hooks/useFormContext.js +2 -2
- package/es/components/keyboard/index.d.ts +20 -2
- package/es/components/keyboard/src/Keyboard.vue.d.ts +20 -2
- package/es/components/keyboard/src/components/InputNumber.vue.d.ts +19 -2
- package/es/components/keyboard/src/components/InputNumber.vue.js +15 -5
- package/es/components/keyboard/src/components/NumberPanel.vue.d.ts +20 -2
- package/es/components/keyboard/src/components/NumberPanel.vue.js +14 -10
- package/es/components/shortcut-setter/index.d.ts +19 -71
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +19 -71
- package/package.json +2 -2
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
import { doAnimation } from '../../../../shared/utils/anime.js';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { ref,
|
|
2
|
+
import { untracked } from '@formily/reactive';
|
|
3
|
+
import { useDebounceFn, watchOnce } from '@vueuse/core';
|
|
4
|
+
import { ref, nextTick, computed } from 'vue';
|
|
5
5
|
import { FormItemLineBarDepKeyPrepend } from '../constants/index.js';
|
|
6
6
|
import '../utils/index.js';
|
|
7
|
-
import { createLinebarId
|
|
7
|
+
import { createLinebarId } from '../utils/schema.js';
|
|
8
8
|
|
|
9
9
|
function useAnchor(props, emit, scrollbarRef, collector) {
|
|
10
|
+
const anchorBarRef = ref();
|
|
10
11
|
const __currentAnchor = ref("");
|
|
11
|
-
const formHeight = computed(() => {
|
|
12
|
-
if (isNumber(props.maxHeight))
|
|
13
|
-
return props.maxHeight + "px";
|
|
14
|
-
return props.maxHeight;
|
|
15
|
-
});
|
|
16
12
|
const anchorIdList = ref([]);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
anchorIdList.value.push({ title: _schema.title, name: ((_a = _schema.name) == null ? void 0 : _a.toString()) || "" });
|
|
13
|
+
const generateAnchorList = useDebounceFn(async function(formModel) {
|
|
14
|
+
var _a;
|
|
15
|
+
anchorIdList.value = Object.values(formModel.fields).reduce((res, field) => {
|
|
16
|
+
if (field.componentType === "LINEBAR" && field.selfDisplay === "visible") {
|
|
17
|
+
res.push({ title: field.title, name: field.address.toString() });
|
|
23
18
|
}
|
|
24
|
-
|
|
19
|
+
return res;
|
|
20
|
+
}, []);
|
|
21
|
+
await nextTick();
|
|
22
|
+
(_a = anchorBarRef.value) == null ? void 0 : _a.syncBarPosition();
|
|
23
|
+
}, 100);
|
|
24
|
+
function updateAnchorList(field) {
|
|
25
|
+
if (field.componentType !== "LINEBAR" || !field.selfDisplay)
|
|
26
|
+
return;
|
|
27
|
+
untracked(() => generateAnchorList(field.form));
|
|
25
28
|
}
|
|
26
29
|
let scrollLock = false;
|
|
27
30
|
async function scrollTo(id) {
|
|
@@ -68,14 +71,10 @@ function useAnchor(props, emit, scrollbarRef, collector) {
|
|
|
68
71
|
__currentAnchor.value = (_a = result == null ? void 0 : result.name) != null ? _a : "";
|
|
69
72
|
emit("scroll", scrollEvent);
|
|
70
73
|
}, 300);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
(_anchorIdList)
|
|
74
|
-
|
|
75
|
-
__currentAnchor.value = (_b = (_a = _anchorIdList[0]) == null ? void 0 : _a.name) != null ? _b : "";
|
|
76
|
-
},
|
|
77
|
-
{ deep: true, immediate: true }
|
|
78
|
-
);
|
|
74
|
+
watchOnce(anchorIdList, (_anchorIdList) => {
|
|
75
|
+
var _a, _b;
|
|
76
|
+
__currentAnchor.value = (_b = (_a = _anchorIdList[0]) == null ? void 0 : _a.name) != null ? _b : "";
|
|
77
|
+
});
|
|
79
78
|
const currentAnchor = computed({
|
|
80
79
|
get() {
|
|
81
80
|
return __currentAnchor.value;
|
|
@@ -89,10 +88,11 @@ function useAnchor(props, emit, scrollbarRef, collector) {
|
|
|
89
88
|
return {
|
|
90
89
|
currentAnchor,
|
|
91
90
|
onScroll,
|
|
92
|
-
formHeight,
|
|
93
91
|
anchorIdList,
|
|
94
92
|
generateAnchorList,
|
|
95
|
-
|
|
93
|
+
updateAnchorList,
|
|
94
|
+
scrollTo,
|
|
95
|
+
anchorBarRef
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
98
|
|
|
@@ -2,26 +2,23 @@ import { Form } from '@formily/core';
|
|
|
2
2
|
import { FieldItem, FormBusinessFormatter } from '../../../../../es/components/form-render';
|
|
3
3
|
import { FIELD_BUSINESS_TYPE } from '../constants';
|
|
4
4
|
export declare class BusinessCollector {
|
|
5
|
-
private formModel;
|
|
6
5
|
private businessFormatter?;
|
|
7
6
|
private readonly typeLockMap;
|
|
8
7
|
private readonly typeCollector;
|
|
9
8
|
private readonly fieldNameCollector;
|
|
10
|
-
constructor(
|
|
9
|
+
constructor(businessFormatter?: FormBusinessFormatter | undefined);
|
|
11
10
|
private formatter;
|
|
12
11
|
collect(type: FIELD_BUSINESS_TYPE, fieldItem: FieldItem): void;
|
|
13
12
|
getField(type: FIELD_BUSINESS_TYPE): FieldItem | undefined;
|
|
14
|
-
getFieldInstanceByType(type: FIELD_BUSINESS_TYPE): import("@formily/core").GeneralField | null;
|
|
13
|
+
getFieldInstanceByType(formModel: Form, type: FIELD_BUSINESS_TYPE): import("@formily/core").GeneralField | null;
|
|
15
14
|
private getType;
|
|
16
15
|
private getValueByField;
|
|
17
|
-
getValueByType(type: FIELD_BUSINESS_TYPE): unknown;
|
|
18
|
-
setValueByType(type: FIELD_BUSINESS_TYPE, value: unknown): void;
|
|
19
|
-
registerChangeBusiness(type: FIELD_BUSINESS_TYPE, handler: () => void): this;
|
|
20
|
-
registerBlurBusiness(type: FIELD_BUSINESS_TYPE, handler: () => void): this;
|
|
16
|
+
getValueByType(formModel: Form, type: FIELD_BUSINESS_TYPE): unknown;
|
|
17
|
+
setValueByType(formModel: Form, type: FIELD_BUSINESS_TYPE, value: unknown): void;
|
|
18
|
+
registerChangeBusiness(type: FIELD_BUSINESS_TYPE, handler: (formModel: Form) => void): this;
|
|
21
19
|
private changeHandlerMap;
|
|
22
|
-
|
|
23
|
-
trigger(fieldName: string, triggerType?: 'change' | 'blur'): Map<FIELD_BUSINESS_TYPE, number> | undefined;
|
|
20
|
+
trigger(formModel: Form, fieldName: string, triggerType?: 'change' | 'blur'): Map<FIELD_BUSINESS_TYPE, number> | undefined;
|
|
24
21
|
}
|
|
25
22
|
export declare function useBusinessBinding(): {
|
|
26
|
-
create: (
|
|
23
|
+
create: (formatter?: FormBusinessFormatter) => BusinessCollector;
|
|
27
24
|
};
|
|
@@ -7,14 +7,12 @@ import '../utils/index.js';
|
|
|
7
7
|
import { isIdCard, parseIdCard, parseAgeFromContext, parseBirthday, parseAge2Birthday } from '../utils/business.js';
|
|
8
8
|
|
|
9
9
|
class BusinessCollector {
|
|
10
|
-
constructor(
|
|
11
|
-
this.formModel = formModel;
|
|
10
|
+
constructor(businessFormatter) {
|
|
12
11
|
this.businessFormatter = businessFormatter;
|
|
13
12
|
this.typeLockMap = /* @__PURE__ */ new Map();
|
|
14
13
|
this.typeCollector = /* @__PURE__ */ new Map();
|
|
15
14
|
this.fieldNameCollector = /* @__PURE__ */ new Map();
|
|
16
15
|
this.changeHandlerMap = /* @__PURE__ */ new Map([]);
|
|
17
|
-
this.blurHandlerMap = /* @__PURE__ */ new Map([]);
|
|
18
16
|
}
|
|
19
17
|
formatter(...args) {
|
|
20
18
|
return isFunction(this.businessFormatter) ? this.businessFormatter(...args) : args[0].value;
|
|
@@ -26,24 +24,24 @@ class BusinessCollector {
|
|
|
26
24
|
getField(type) {
|
|
27
25
|
return this.typeCollector.get(type);
|
|
28
26
|
}
|
|
29
|
-
getFieldInstanceByType(type) {
|
|
27
|
+
getFieldInstanceByType(formModel, type) {
|
|
30
28
|
const field = this.getField(type);
|
|
31
|
-
return field ?
|
|
29
|
+
return field ? formModel.query(field.val_key).take() : null;
|
|
32
30
|
}
|
|
33
31
|
getType(fieldName) {
|
|
34
32
|
return this.fieldNameCollector.get(fieldName);
|
|
35
33
|
}
|
|
36
|
-
getValueByField(fieldName) {
|
|
37
|
-
const _field =
|
|
34
|
+
getValueByField(formModel, fieldName) {
|
|
35
|
+
const _field = formModel.query(fieldName).take();
|
|
38
36
|
return isField(_field) ? _field.value : null;
|
|
39
37
|
}
|
|
40
|
-
getValueByType(type) {
|
|
38
|
+
getValueByType(formModel, type) {
|
|
41
39
|
const field = this.getField(type);
|
|
42
|
-
return field ? this.getValueByField(field.val_key) : null;
|
|
40
|
+
return field ? this.getValueByField(formModel, field.val_key) : null;
|
|
43
41
|
}
|
|
44
|
-
setValueByType(type, value) {
|
|
42
|
+
setValueByType(formModel, type, value) {
|
|
45
43
|
const field = this.getField(type);
|
|
46
|
-
field &&
|
|
44
|
+
field && formModel.setFieldState(field.val_key, (state) => {
|
|
47
45
|
if (state.value === value)
|
|
48
46
|
return;
|
|
49
47
|
const lock = this.typeLockMap.get(type);
|
|
@@ -55,11 +53,7 @@ class BusinessCollector {
|
|
|
55
53
|
this.changeHandlerMap.set(type, handler);
|
|
56
54
|
return this;
|
|
57
55
|
}
|
|
58
|
-
|
|
59
|
-
this.blurHandlerMap.set(type, handler);
|
|
60
|
-
return this;
|
|
61
|
-
}
|
|
62
|
-
trigger(fieldName, triggerType = "change") {
|
|
56
|
+
trigger(formModel, fieldName, triggerType = "change") {
|
|
63
57
|
var _a;
|
|
64
58
|
const type = this.getType(fieldName);
|
|
65
59
|
if (!type)
|
|
@@ -67,10 +61,10 @@ class BusinessCollector {
|
|
|
67
61
|
if (triggerType === "change" && this.typeLockMap.get(type) > 0) {
|
|
68
62
|
return this.typeLockMap.set(type, this.typeLockMap.get(type) - 1);
|
|
69
63
|
}
|
|
70
|
-
const handler = triggerType === "change" ? this.changeHandlerMap :
|
|
64
|
+
const handler = triggerType === "change" ? this.changeHandlerMap : null;
|
|
71
65
|
if (!handler)
|
|
72
66
|
return;
|
|
73
|
-
(_a = handler.get(type)) == null ? void 0 : _a.call(this);
|
|
67
|
+
(_a = handler.get(type)) == null ? void 0 : _a.call(this, formModel);
|
|
74
68
|
}
|
|
75
69
|
}
|
|
76
70
|
function useBusinessBinding() {
|
|
@@ -79,37 +73,45 @@ function useBusinessBinding() {
|
|
|
79
73
|
const birthdayField = this.getField(FIELD_BUSINESS_TYPE.BIRTHDAY);
|
|
80
74
|
return (_a = birthdayField == null ? void 0 : birthdayField.date_format) != null ? _a : "yyyy-MM-dd HH:mm";
|
|
81
75
|
}
|
|
82
|
-
function handlerIdCardType() {
|
|
83
|
-
const idCard = this.getValueByType(FIELD_BUSINESS_TYPE.ID_CARD);
|
|
76
|
+
function handlerIdCardType(formModel) {
|
|
77
|
+
const idCard = this.getValueByType(formModel, FIELD_BUSINESS_TYPE.ID_CARD);
|
|
84
78
|
if (!idCard || !isString(idCard) || !isIdCard(idCard)) {
|
|
85
79
|
return;
|
|
86
80
|
}
|
|
87
81
|
const info = parseIdCard(idCard);
|
|
88
82
|
const { age, ageUnit } = parseAgeFromContext(info);
|
|
89
|
-
this.setValueByType(FIELD_BUSINESS_TYPE.AGE_UNIT, ageUnit);
|
|
90
|
-
this.setValueByType(FIELD_BUSINESS_TYPE.AGE, age);
|
|
91
|
-
this.setValueByType(FIELD_BUSINESS_TYPE.SEX, info.sex);
|
|
92
|
-
this.setValueByType(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
83
|
+
this.setValueByType(formModel, FIELD_BUSINESS_TYPE.AGE_UNIT, ageUnit);
|
|
84
|
+
this.setValueByType(formModel, FIELD_BUSINESS_TYPE.AGE, age);
|
|
85
|
+
this.setValueByType(formModel, FIELD_BUSINESS_TYPE.SEX, info.sex);
|
|
86
|
+
this.setValueByType(
|
|
87
|
+
formModel,
|
|
88
|
+
FIELD_BUSINESS_TYPE.BIRTHDAY,
|
|
89
|
+
format(new Date(info.birthday), getBirthdayFormat.call(this))
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
function handlerBirthdayType(formModel) {
|
|
93
|
+
const birthday = this.getValueByType(formModel, FIELD_BUSINESS_TYPE.BIRTHDAY);
|
|
96
94
|
if (!isString(birthday))
|
|
97
95
|
return;
|
|
98
96
|
const { age, ageUnit } = parseAgeFromContext(parseBirthday(birthday));
|
|
99
|
-
this.setValueByType(FIELD_BUSINESS_TYPE.AGE_UNIT, ageUnit);
|
|
100
|
-
this.setValueByType(FIELD_BUSINESS_TYPE.AGE, age);
|
|
97
|
+
this.setValueByType(formModel, FIELD_BUSINESS_TYPE.AGE_UNIT, ageUnit);
|
|
98
|
+
this.setValueByType(formModel, FIELD_BUSINESS_TYPE.AGE, age);
|
|
101
99
|
}
|
|
102
|
-
function handlerAgeType() {
|
|
103
|
-
const age = this.getValueByType(FIELD_BUSINESS_TYPE.AGE);
|
|
104
|
-
const ageUnit = this.getValueByType(FIELD_BUSINESS_TYPE.AGE_UNIT);
|
|
100
|
+
function handlerAgeType(formModel) {
|
|
101
|
+
const age = this.getValueByType(formModel, FIELD_BUSINESS_TYPE.AGE);
|
|
102
|
+
const ageUnit = this.getValueByType(formModel, FIELD_BUSINESS_TYPE.AGE_UNIT);
|
|
105
103
|
if (!isString(age) && !isNumber(age) || age === "")
|
|
106
104
|
return;
|
|
107
105
|
if (!isString(ageUnit) || ageUnit === "")
|
|
108
106
|
return;
|
|
109
|
-
this.setValueByType(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
107
|
+
this.setValueByType(
|
|
108
|
+
formModel,
|
|
109
|
+
FIELD_BUSINESS_TYPE.BIRTHDAY,
|
|
110
|
+
parseAge2Birthday(+age, ageUnit, getBirthdayFormat.call(this))
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
function create(formatter) {
|
|
114
|
+
return new BusinessCollector(formatter).registerChangeBusiness(FIELD_BUSINESS_TYPE.ID_CARD, handlerIdCardType).registerChangeBusiness(FIELD_BUSINESS_TYPE.AGE_UNIT, handlerAgeType).registerChangeBusiness(FIELD_BUSINESS_TYPE.AGE, handlerAgeType).registerChangeBusiness(FIELD_BUSINESS_TYPE.BIRTHDAY, handlerBirthdayType);
|
|
113
115
|
}
|
|
114
116
|
return { create };
|
|
115
117
|
}
|
|
@@ -30,12 +30,7 @@ function useFieldListAdaptor(collector) {
|
|
|
30
30
|
"x-component-props": {
|
|
31
31
|
placeholder: item.placeholder,
|
|
32
32
|
clearable: item.is_empty === "0",
|
|
33
|
-
...item.componentProps || {}
|
|
34
|
-
onBlur(...args) {
|
|
35
|
-
var _a2, _b;
|
|
36
|
-
collector.trigger(item.val_key, "blur");
|
|
37
|
-
(_b = (_a2 = item.componentProps) == null ? void 0 : _a2.onBlur) == null ? void 0 : _b.call(_a2, ...args);
|
|
38
|
-
}
|
|
33
|
+
...item.componentProps || {}
|
|
39
34
|
},
|
|
40
35
|
"x-content": item.slots,
|
|
41
36
|
"x-display": item.is_show === "0" ? "hidden" : "visible",
|
|
@@ -180,6 +175,7 @@ function useFieldListAdaptor(collector) {
|
|
|
180
175
|
type: "void",
|
|
181
176
|
title: item.alias || item.name,
|
|
182
177
|
"x-component": "LINEBAR",
|
|
178
|
+
"x-display": "visible",
|
|
183
179
|
"x-component-props": {
|
|
184
180
|
disabled: item.is_not_fold === "1",
|
|
185
181
|
id: createLinebarId(item.val_key),
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Func } from '../../../../../es/shared/types';
|
|
2
|
-
import { Form } from '@formily/core';
|
|
3
2
|
import { ShallowReactive } from 'vue';
|
|
4
3
|
import { FormRenderProps } from '../../../../../es/components/form-render';
|
|
5
|
-
export declare function useFormContext(props: ShallowReactive<FormRenderProps>,
|
|
4
|
+
export declare function useFormContext(props: ShallowReactive<FormRenderProps>, emit: Func): {
|
|
6
5
|
asyncQueue: import("../../../../../es/components/form-render").FormAsyncQueue;
|
|
7
6
|
SchemaField: import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>;
|
|
8
7
|
businessCollector: import("../../../../../es/components/form-render").BusinessCollector;
|
|
@@ -14,7 +14,7 @@ import { useBusinessBinding } from './useBusinessBinding.js';
|
|
|
14
14
|
import { useChangeContext } from './useChangeContext.js';
|
|
15
15
|
import { useFormItemDeps } from './useFormItemDeps.js';
|
|
16
16
|
|
|
17
|
-
function useFormContext(props,
|
|
17
|
+
function useFormContext(props, emit) {
|
|
18
18
|
const { callLifeCycle } = useFormRenderLifeCycle(props);
|
|
19
19
|
const asyncQueue = injectOrProvide(
|
|
20
20
|
InjectionAsyncQueue,
|
|
@@ -34,7 +34,7 @@ function useFormContext(props, formModel, emit) {
|
|
|
34
34
|
scope: Object.assign({}, usePresetScope(), props.scope)
|
|
35
35
|
}).SchemaField
|
|
36
36
|
);
|
|
37
|
-
const businessCollector = useBusinessBinding().create(
|
|
37
|
+
const businessCollector = useBusinessBinding().create(props.businessFormatter);
|
|
38
38
|
provide(InjectionBusinessCollector, businessCollector);
|
|
39
39
|
const changeContextCollector = useChangeContext().create();
|
|
40
40
|
provide(InjectionChangeContextCollector, changeContextCollector);
|
|
@@ -181,6 +181,7 @@ declare const Keyboard: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
181
181
|
inputValueStatus: import("vue").Ref<import("naive-ui/es/form/src/interface").FormValidationStatus>;
|
|
182
182
|
numeratorValueStatus: import("vue").Ref<import("naive-ui/es/form/src/interface").FormValidationStatus>;
|
|
183
183
|
denominatorValueStatus: import("vue").Ref<import("naive-ui/es/form/src/interface").FormValidationStatus>;
|
|
184
|
+
inputSelect: import("vue").Ref<boolean>;
|
|
184
185
|
keyboardRef: import("vue").Ref<HTMLElement | null>;
|
|
185
186
|
style: import("vue").ComputedRef<string> | undefined;
|
|
186
187
|
init: () => import("vue").ComputedRef<string> | undefined;
|
|
@@ -207,6 +208,10 @@ declare const Keyboard: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
207
208
|
type: import("vue").PropType<import("naive-ui/es/form/src/interface").FormValidationStatus>;
|
|
208
209
|
default: string;
|
|
209
210
|
};
|
|
211
|
+
select: {
|
|
212
|
+
type: BooleanConstructor;
|
|
213
|
+
default: boolean;
|
|
214
|
+
};
|
|
210
215
|
}, {
|
|
211
216
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
212
217
|
modelValue: {
|
|
@@ -221,22 +226,29 @@ declare const Keyboard: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
221
226
|
type: import("vue").PropType<import("naive-ui/es/form/src/interface").FormValidationStatus>;
|
|
222
227
|
default: string;
|
|
223
228
|
};
|
|
229
|
+
select: {
|
|
230
|
+
type: BooleanConstructor;
|
|
231
|
+
default: boolean;
|
|
232
|
+
};
|
|
224
233
|
}>> & {
|
|
225
234
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
226
235
|
"onUpdate:status"?: ((...args: any[]) => any) | undefined;
|
|
236
|
+
"onUpdate:select"?: ((...args: any[]) => any) | undefined;
|
|
227
237
|
}>>;
|
|
228
|
-
emit: (event: "update:modelValue" | "update:status", ...args: any[]) => void;
|
|
238
|
+
emit: (event: "update:modelValue" | "update:status" | "update:select", ...args: any[]) => void;
|
|
229
239
|
inputRef: any;
|
|
230
240
|
toSelectInputContent: import("vue").Ref<number>;
|
|
231
241
|
update: (value: string | [string, string]) => void;
|
|
232
242
|
validator: (value: string) => boolean;
|
|
233
243
|
calculate: (type: string) => void;
|
|
244
|
+
unSelect: () => void;
|
|
245
|
+
onSelect: () => void;
|
|
234
246
|
NInput: any;
|
|
235
247
|
NIcon: any;
|
|
236
248
|
NSpace: any;
|
|
237
249
|
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<{}>>, {}>;
|
|
238
250
|
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<{}>>, {}>;
|
|
239
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:status")[], "update:modelValue" | "update:status", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
251
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:status" | "update:select")[], "update:modelValue" | "update:status" | "update:select", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
240
252
|
modelValue: {
|
|
241
253
|
type: StringConstructor;
|
|
242
254
|
default: string;
|
|
@@ -249,13 +261,19 @@ declare const Keyboard: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
249
261
|
type: import("vue").PropType<import("naive-ui/es/form/src/interface").FormValidationStatus>;
|
|
250
262
|
default: string;
|
|
251
263
|
};
|
|
264
|
+
select: {
|
|
265
|
+
type: BooleanConstructor;
|
|
266
|
+
default: boolean;
|
|
267
|
+
};
|
|
252
268
|
}>> & {
|
|
253
269
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
254
270
|
"onUpdate:status"?: ((...args: any[]) => any) | undefined;
|
|
271
|
+
"onUpdate:select"?: ((...args: any[]) => any) | undefined;
|
|
255
272
|
}, {
|
|
256
273
|
modelValue: string;
|
|
257
274
|
status: import("naive-ui/es/form/src/interface").FormValidationStatus;
|
|
258
275
|
integer: boolean;
|
|
276
|
+
select: boolean;
|
|
259
277
|
}>;
|
|
260
278
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
261
279
|
defaultValue: {
|
|
@@ -182,6 +182,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
182
182
|
inputValueStatus: import("vue").Ref<import("naive-ui/es/form/src/interface").FormValidationStatus>;
|
|
183
183
|
numeratorValueStatus: import("vue").Ref<import("naive-ui/es/form/src/interface").FormValidationStatus>;
|
|
184
184
|
denominatorValueStatus: import("vue").Ref<import("naive-ui/es/form/src/interface").FormValidationStatus>;
|
|
185
|
+
inputSelect: import("vue").Ref<boolean>;
|
|
185
186
|
keyboardRef: import("vue").Ref<HTMLElement | null>;
|
|
186
187
|
style: import("vue").ComputedRef<string> | undefined;
|
|
187
188
|
init: () => import("vue").ComputedRef<string> | undefined;
|
|
@@ -208,6 +209,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
208
209
|
type: PropType<import("naive-ui/es/form/src/interface").FormValidationStatus>;
|
|
209
210
|
default: string;
|
|
210
211
|
};
|
|
212
|
+
select: {
|
|
213
|
+
type: BooleanConstructor;
|
|
214
|
+
default: boolean;
|
|
215
|
+
};
|
|
211
216
|
}, {
|
|
212
217
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
213
218
|
modelValue: {
|
|
@@ -222,22 +227,29 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
222
227
|
type: PropType<import("naive-ui/es/form/src/interface").FormValidationStatus>;
|
|
223
228
|
default: string;
|
|
224
229
|
};
|
|
230
|
+
select: {
|
|
231
|
+
type: BooleanConstructor;
|
|
232
|
+
default: boolean;
|
|
233
|
+
};
|
|
225
234
|
}>> & {
|
|
226
235
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
227
236
|
"onUpdate:status"?: ((...args: any[]) => any) | undefined;
|
|
237
|
+
"onUpdate:select"?: ((...args: any[]) => any) | undefined;
|
|
228
238
|
}>>;
|
|
229
|
-
emit: (event: "update:modelValue" | "update:status", ...args: any[]) => void;
|
|
239
|
+
emit: (event: "update:modelValue" | "update:status" | "update:select", ...args: any[]) => void;
|
|
230
240
|
inputRef: any;
|
|
231
241
|
toSelectInputContent: import("vue").Ref<number>;
|
|
232
242
|
update: (value: string | [string, string]) => void;
|
|
233
243
|
validator: (value: string) => boolean;
|
|
234
244
|
calculate: (type: string) => void;
|
|
245
|
+
unSelect: () => void;
|
|
246
|
+
onSelect: () => void;
|
|
235
247
|
NInput: any;
|
|
236
248
|
NIcon: any;
|
|
237
249
|
NSpace: any;
|
|
238
250
|
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<{}>>, {}>;
|
|
239
251
|
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<{}>>, {}>;
|
|
240
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:status")[], "update:modelValue" | "update:status", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
252
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:status" | "update:select")[], "update:modelValue" | "update:status" | "update:select", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
241
253
|
modelValue: {
|
|
242
254
|
type: StringConstructor;
|
|
243
255
|
default: string;
|
|
@@ -250,13 +262,19 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
250
262
|
type: PropType<import("naive-ui/es/form/src/interface").FormValidationStatus>;
|
|
251
263
|
default: string;
|
|
252
264
|
};
|
|
265
|
+
select: {
|
|
266
|
+
type: BooleanConstructor;
|
|
267
|
+
default: boolean;
|
|
268
|
+
};
|
|
253
269
|
}>> & {
|
|
254
270
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
255
271
|
"onUpdate:status"?: ((...args: any[]) => any) | undefined;
|
|
272
|
+
"onUpdate:select"?: ((...args: any[]) => any) | undefined;
|
|
256
273
|
}, {
|
|
257
274
|
modelValue: string;
|
|
258
275
|
status: import("naive-ui/es/form/src/interface").FormValidationStatus;
|
|
259
276
|
integer: boolean;
|
|
277
|
+
select: boolean;
|
|
260
278
|
}>;
|
|
261
279
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
262
280
|
defaultValue: {
|
|
@@ -13,6 +13,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
13
13
|
type: PropType<FormValidationStatus>;
|
|
14
14
|
default: string;
|
|
15
15
|
};
|
|
16
|
+
select: {
|
|
17
|
+
type: BooleanConstructor;
|
|
18
|
+
default: boolean;
|
|
19
|
+
};
|
|
16
20
|
}, {
|
|
17
21
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
18
22
|
modelValue: {
|
|
@@ -27,22 +31,29 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
27
31
|
type: PropType<FormValidationStatus>;
|
|
28
32
|
default: string;
|
|
29
33
|
};
|
|
34
|
+
select: {
|
|
35
|
+
type: BooleanConstructor;
|
|
36
|
+
default: boolean;
|
|
37
|
+
};
|
|
30
38
|
}>> & {
|
|
31
39
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
32
40
|
"onUpdate:status"?: ((...args: any[]) => any) | undefined;
|
|
41
|
+
"onUpdate:select"?: ((...args: any[]) => any) | undefined;
|
|
33
42
|
}>>;
|
|
34
|
-
emit: (event: "update:modelValue" | "update:status", ...args: any[]) => void;
|
|
43
|
+
emit: (event: "update:modelValue" | "update:status" | "update:select", ...args: any[]) => void;
|
|
35
44
|
inputRef: any;
|
|
36
45
|
toSelectInputContent: Ref<number>;
|
|
37
46
|
update: (value: string | [string, string]) => void;
|
|
38
47
|
validator: (value: string) => boolean;
|
|
39
48
|
calculate: (type: string) => void;
|
|
49
|
+
unSelect: () => void;
|
|
50
|
+
onSelect: () => void;
|
|
40
51
|
NInput: any;
|
|
41
52
|
NIcon: any;
|
|
42
53
|
NSpace: any;
|
|
43
54
|
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<{}>>, {}>;
|
|
44
55
|
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<{}>>, {}>;
|
|
45
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:status")[], "update:modelValue" | "update:status", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
56
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:status" | "update:select")[], "update:modelValue" | "update:status" | "update:select", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
46
57
|
modelValue: {
|
|
47
58
|
type: StringConstructor;
|
|
48
59
|
default: string;
|
|
@@ -55,12 +66,18 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
55
66
|
type: PropType<FormValidationStatus>;
|
|
56
67
|
default: string;
|
|
57
68
|
};
|
|
69
|
+
select: {
|
|
70
|
+
type: BooleanConstructor;
|
|
71
|
+
default: boolean;
|
|
72
|
+
};
|
|
58
73
|
}>> & {
|
|
59
74
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
60
75
|
"onUpdate:status"?: ((...args: any[]) => any) | undefined;
|
|
76
|
+
"onUpdate:select"?: ((...args: any[]) => any) | undefined;
|
|
61
77
|
}, {
|
|
62
78
|
modelValue: string;
|
|
63
79
|
status: FormValidationStatus;
|
|
64
80
|
integer: boolean;
|
|
81
|
+
select: boolean;
|
|
65
82
|
}>;
|
|
66
83
|
export default _default;
|
|
@@ -9,9 +9,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
9
9
|
props: {
|
|
10
10
|
modelValue: { type: String, default: "" },
|
|
11
11
|
integer: { type: Boolean, default: false },
|
|
12
|
-
status: { type: String, default: "success" }
|
|
12
|
+
status: { type: String, default: "success" },
|
|
13
|
+
select: { type: Boolean, default: false }
|
|
13
14
|
},
|
|
14
|
-
emits: ["update:modelValue", "update:status"],
|
|
15
|
+
emits: ["update:modelValue", "update:status", "update:select"],
|
|
15
16
|
setup(__props, { emit }) {
|
|
16
17
|
const props = __props;
|
|
17
18
|
const inputRef = ref(null);
|
|
@@ -35,16 +36,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
35
36
|
emit("update:modelValue", newValue.toString());
|
|
36
37
|
emit("update:status", "success");
|
|
37
38
|
}
|
|
39
|
+
function unSelect() {
|
|
40
|
+
setTimeout(() => {
|
|
41
|
+
emit("update:select", false);
|
|
42
|
+
}, 1e3);
|
|
43
|
+
}
|
|
44
|
+
function onSelect() {
|
|
45
|
+
emit("update:select", true);
|
|
46
|
+
}
|
|
38
47
|
watch(
|
|
39
48
|
() => toSelectInputContent.value,
|
|
40
49
|
(value) => {
|
|
41
50
|
var _a, _b;
|
|
42
|
-
(_b = (_a = inputRef.value) == null ? void 0 : _a.select) == null ? void 0 : _b.call(_a);
|
|
51
|
+
!props.integer && ((_b = (_a = inputRef.value) == null ? void 0 : _a.select) == null ? void 0 : _b.call(_a));
|
|
43
52
|
}
|
|
44
53
|
);
|
|
45
54
|
return (_ctx, _cache) => {
|
|
46
55
|
return openBlock(), createBlock(unref(NInput), {
|
|
47
|
-
autofocus: "",
|
|
48
56
|
ref_key: "inputRef",
|
|
49
57
|
ref: inputRef,
|
|
50
58
|
value: __props.modelValue,
|
|
@@ -52,7 +60,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
52
60
|
"allow-input": validator,
|
|
53
61
|
placeholder: "",
|
|
54
62
|
status: __props.status,
|
|
55
|
-
clearable: !__props.integer
|
|
63
|
+
clearable: !__props.integer,
|
|
64
|
+
onBlur: unSelect,
|
|
65
|
+
onSelect
|
|
56
66
|
}, {
|
|
57
67
|
suffix: withCtx(() => [
|
|
58
68
|
createVNode(unref(NSpace), {
|
|
@@ -79,6 +79,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
79
79
|
inputValueStatus: Ref<FormValidationStatus>;
|
|
80
80
|
numeratorValueStatus: Ref<FormValidationStatus>;
|
|
81
81
|
denominatorValueStatus: Ref<FormValidationStatus>;
|
|
82
|
+
inputSelect: Ref<boolean>;
|
|
82
83
|
keyboardRef: Ref<HTMLElement | null>;
|
|
83
84
|
style: import("vue").ComputedRef<string> | undefined;
|
|
84
85
|
init: () => import("vue").ComputedRef<string> | undefined;
|
|
@@ -105,6 +106,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
105
106
|
type: PropType<FormValidationStatus>;
|
|
106
107
|
default: string;
|
|
107
108
|
};
|
|
109
|
+
select: {
|
|
110
|
+
type: BooleanConstructor;
|
|
111
|
+
default: boolean;
|
|
112
|
+
};
|
|
108
113
|
}, {
|
|
109
114
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
110
115
|
modelValue: {
|
|
@@ -119,22 +124,29 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
119
124
|
type: PropType<FormValidationStatus>;
|
|
120
125
|
default: string;
|
|
121
126
|
};
|
|
127
|
+
select: {
|
|
128
|
+
type: BooleanConstructor;
|
|
129
|
+
default: boolean;
|
|
130
|
+
};
|
|
122
131
|
}>> & {
|
|
123
132
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
124
133
|
"onUpdate:status"?: ((...args: any[]) => any) | undefined;
|
|
134
|
+
"onUpdate:select"?: ((...args: any[]) => any) | undefined;
|
|
125
135
|
}>>;
|
|
126
|
-
emit: (event: "update:modelValue" | "update:status", ...args: any[]) => void;
|
|
136
|
+
emit: (event: "update:modelValue" | "update:status" | "update:select", ...args: any[]) => void;
|
|
127
137
|
inputRef: any;
|
|
128
138
|
toSelectInputContent: Ref<number>;
|
|
129
139
|
update: (value: string | [string, string]) => void;
|
|
130
140
|
validator: (value: string) => boolean;
|
|
131
141
|
calculate: (type: string) => void;
|
|
142
|
+
unSelect: () => void;
|
|
143
|
+
onSelect: () => void;
|
|
132
144
|
NInput: any;
|
|
133
145
|
NIcon: any;
|
|
134
146
|
NSpace: any;
|
|
135
147
|
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<{}>>, {}>;
|
|
136
148
|
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<{}>>, {}>;
|
|
137
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:status")[], "update:modelValue" | "update:status", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
149
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:status" | "update:select")[], "update:modelValue" | "update:status" | "update:select", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
138
150
|
modelValue: {
|
|
139
151
|
type: StringConstructor;
|
|
140
152
|
default: string;
|
|
@@ -147,13 +159,19 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
147
159
|
type: PropType<FormValidationStatus>;
|
|
148
160
|
default: string;
|
|
149
161
|
};
|
|
162
|
+
select: {
|
|
163
|
+
type: BooleanConstructor;
|
|
164
|
+
default: boolean;
|
|
165
|
+
};
|
|
150
166
|
}>> & {
|
|
151
167
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
152
168
|
"onUpdate:status"?: ((...args: any[]) => any) | undefined;
|
|
169
|
+
"onUpdate:select"?: ((...args: any[]) => any) | undefined;
|
|
153
170
|
}, {
|
|
154
171
|
modelValue: string;
|
|
155
172
|
status: FormValidationStatus;
|
|
156
173
|
integer: boolean;
|
|
174
|
+
select: boolean;
|
|
157
175
|
}>;
|
|
158
176
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
159
177
|
defaultValue: {
|