cnhis-design-vue 3.1.15-beta.7 → 3.1.16-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/packages/big-table/src/hooks/useAnnotation.js +1 -2
- package/es/packages/big-table/src/hooks/useColumnConfigAdaptor.js +7 -2
- package/es/packages/big-table/src/hooks/useEdit.js +16 -8
- package/es/packages/fabric-chart/src/hooks/useDraw.js +1 -0
- package/es/packages/fabric-chart/src/hooks/useLeft.js +1 -2
- package/es/packages/form-config/index.d.ts +13854 -0
- package/es/packages/form-config/index.js +10 -0
- package/es/packages/form-config/src/FormConfig.js +113 -0
- package/es/packages/form-config/src/FormConfig.vue.d.ts +13856 -0
- package/es/packages/form-config/src/components/FormConfigCreator.js +97 -0
- package/es/packages/form-config/src/components/FormConfigCreator.vue.d.ts +5094 -0
- package/es/packages/form-config/src/components/FormConfigEdit.js +81 -0
- package/es/packages/form-config/src/components/FormConfigEdit.vue.d.ts +5336 -0
- package/es/packages/form-config/src/constants/index.d.ts +28 -0
- package/es/packages/form-config/src/constants/index.js +28 -0
- package/es/packages/form-config/src/hooks/index.d.ts +2 -0
- package/es/packages/form-config/src/hooks/index.js +2 -0
- package/es/packages/form-config/src/hooks/useConfigurationField.d.ts +6 -0
- package/es/packages/form-config/src/hooks/useConfigurationField.js +103 -0
- package/es/packages/form-config/src/hooks/usePresetRenderer.d.ts +5 -0
- package/es/packages/form-config/src/hooks/usePresetRenderer.js +117 -0
- package/es/packages/form-config/src/hooks/useSortable.d.ts +11 -0
- package/es/packages/form-config/src/hooks/useSortable.js +31 -0
- package/es/packages/form-config/src/types/index.d.ts +18 -0
- package/es/packages/form-config/src/types/index.js +1 -0
- package/es/packages/form-config/style/index.css +108 -0
- package/es/packages/form-render/index.d.ts +3 -3
- package/es/packages/form-render/src/FormRender.vue.d.ts +3 -3
- package/es/packages/form-render/src/components/renderer/combination/index.js +3 -3
- package/es/packages/form-render/src/components/renderer/date.d.ts +2 -2
- package/es/packages/form-render/src/components/renderer/formItem.js +3 -3
- package/es/packages/form-render/src/components/renderer/select.js +16 -9
- package/es/packages/form-render/src/hooks/useAsyncQueue.d.ts +2 -2
- package/es/packages/form-render/src/hooks/useAsyncQueue.js +4 -8
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +4 -3
- package/es/packages/form-render/src/hooks/useFormContext.js +10 -4
- package/es/packages/form-render/src/hooks/useFormRenderLifeCycle.d.ts +2 -2
- package/es/packages/form-render/src/types/fieldItem.d.ts +8 -0
- package/es/packages/form-render/src/types/index.d.ts +7 -3
- package/es/packages/form-render/src/utils/index.d.ts +3 -2
- package/es/packages/form-render/src/utils/index.js +30 -7
- package/es/packages/form-table/src/hooks/useNuiThemeOverrides.js +1 -1
- package/es/packages/index.css +108 -0
- package/es/packages/index.d.ts +4 -1
- package/es/packages/index.js +5 -2
- package/es/packages/shortcut-provider/index.d.ts +17 -2
- package/es/packages/shortcut-provider/index.js +1 -1
- package/es/packages/shortcut-provider/src/ShortcutProvider.js +5 -1
- package/es/packages/shortcut-provider/src/ShortcutProvider.vue.d.ts +17 -2
- package/es/packages/shortcut-provider/src/hooks/index.js +1 -1
- package/es/packages/shortcut-provider/src/hooks/useShortcuts.d.ts +10 -10
- package/es/packages/shortcut-provider/src/hooks/useShortcuts.js +45 -38
- package/es/packages/shortcut-provider/src/types/index.d.ts +2 -19
- package/es/packages/shortcut-setter/index.d.ts +2 -6040
- package/es/packages/shortcut-setter/src/ShortcutSetter.js +60 -10
- package/es/packages/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -6041
- package/es/packages/shortcut-setter/src/ShortcutSetterItem.js +26 -95
- package/es/packages/shortcut-setter/src/ShortcutSetterItem.vue.d.ts +30 -3363
- package/es/packages/shortcut-setter/src/types/index.d.ts +6 -0
- package/es/packages/shortcut-setter/src/types/index.js +1 -0
- package/es/src/utils/state.d.ts +29 -0
- package/es/src/utils/state.js +44 -0
- package/package.json +2 -1
- package/es/packages/shortcut-setter/constant/index.d.ts +0 -4
- package/es/packages/shortcut-setter/constant/index.js +0 -7
|
@@ -109,7 +109,7 @@ function useAsyncQueue() {
|
|
|
109
109
|
name: "FormRenderAsyncQueue",
|
|
110
110
|
parallelism,
|
|
111
111
|
async processor({ key, method = "post", params, url }, cb, removeCache) {
|
|
112
|
-
var _a
|
|
112
|
+
var _a;
|
|
113
113
|
const http = getHttpInstance();
|
|
114
114
|
if (!http) {
|
|
115
115
|
useCommonLog().invalidHttpInstanceLog();
|
|
@@ -121,15 +121,11 @@ function useAsyncQueue() {
|
|
|
121
121
|
if (option && isFunction(option.beforeRequest)) {
|
|
122
122
|
params = (_a = option.beforeRequest(key, params)) != null ? _a : {};
|
|
123
123
|
}
|
|
124
|
-
|
|
125
|
-
const { data, success } = res;
|
|
126
|
-
if (!success)
|
|
127
|
-
throw res;
|
|
128
|
-
let payload = Array.isArray(data) ? data : [];
|
|
124
|
+
let res = await http[method](url, params);
|
|
129
125
|
if (option && isFunction(option.afterRequest)) {
|
|
130
|
-
|
|
126
|
+
res = option.afterRequest(key, res);
|
|
131
127
|
}
|
|
132
|
-
cb(void 0,
|
|
128
|
+
cb(void 0, Array.isArray(res) ? res : []);
|
|
133
129
|
} catch (e) {
|
|
134
130
|
cb(new Error(`Request error => ${e}`));
|
|
135
131
|
removeCache();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isObject } from '@vueuse/core';
|
|
2
2
|
import { pick } from 'lodash-es';
|
|
3
3
|
import { useFormValidator, useTypeNormalize } from '../../../../packages/form-render';
|
|
4
|
-
import { fieldKeyEscape, arrayed, createLinebarId, elementIdEscape, transformDateFormat } from '../utils/index.js';
|
|
4
|
+
import { fieldKeyEscape, arrayed, createLinebarId, elementIdEscape, parseNumberFromMaybeString, transformDateFormat } from '../utils/index.js';
|
|
5
5
|
|
|
6
6
|
function useFieldListAdaptor(collector, uuid) {
|
|
7
7
|
const { createValidatorSchema } = useFormValidator();
|
|
@@ -51,9 +51,10 @@ function useFieldListAdaptor(collector, uuid) {
|
|
|
51
51
|
const createSelectSchema = (item) => {
|
|
52
52
|
const schema = createStandardSchema(item);
|
|
53
53
|
Object.assign(schema["x-component-props"], {
|
|
54
|
-
...pick(item, ["lazyRequest", "urlConfig"
|
|
54
|
+
...pick(item, ["lazyRequest", "urlConfig"]),
|
|
55
|
+
options: item.option,
|
|
55
56
|
multiple: item.multi_select === "0",
|
|
56
|
-
maxTagCount:
|
|
57
|
+
maxTagCount: parseNumberFromMaybeString(item.multi_select_value)
|
|
57
58
|
});
|
|
58
59
|
return schema;
|
|
59
60
|
};
|
|
@@ -13,12 +13,18 @@ function useFormContext(props) {
|
|
|
13
13
|
const { callLifeCycle } = useFormRenderLifeCycle(props);
|
|
14
14
|
const asyncQueue = injectOrProvide(InjectAsyncQueue, () => useAsyncQueue().create(props.parallelism, {
|
|
15
15
|
beforeRequest(...args) {
|
|
16
|
-
|
|
17
|
-
return (_a = callLifeCycle("beforeRequest", cloneDeep(args))) != null ? _a : args[1];
|
|
16
|
+
return callLifeCycle("beforeRequest", cloneDeep(args)) || args[1];
|
|
18
17
|
},
|
|
19
18
|
afterRequest(...args) {
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
return callLifeCycle("afterRequest", cloneDeep(args)) || presetHandler(args[1]);
|
|
20
|
+
function presetHandler(res) {
|
|
21
|
+
if (!isObject(res))
|
|
22
|
+
throw res;
|
|
23
|
+
const { data, success } = res;
|
|
24
|
+
if (!success)
|
|
25
|
+
throw res;
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
22
28
|
}
|
|
23
29
|
}));
|
|
24
30
|
const SchemaField = injectOrProvide(InjectionSchemaField, () => createSchemaField({
|
|
@@ -4,10 +4,10 @@ export declare function useFormRenderLifeCycle(props: FormRenderProps): {
|
|
|
4
4
|
callLifeCycle: <T extends "onSetup" | "beforeRequest" | "afterRequest">(lifeCycleName: T, payload?: Parameters<Required<Partial<{
|
|
5
5
|
onSetup(): void;
|
|
6
6
|
beforeRequest(fieldKey: string, params?: import("../../../../../es/src/types").AnyObject | undefined): void | WithUndefined<import("../../../../../es/src/types").AnyObject>;
|
|
7
|
-
afterRequest(fieldKey: string, payload?:
|
|
7
|
+
afterRequest(fieldKey: string, payload?: any): import("../../../../../es/src/types").AnyObject[];
|
|
8
8
|
}>>[T]> | undefined) => WithUndefined<ReturnType<Required<Partial<{
|
|
9
9
|
onSetup(): void;
|
|
10
10
|
beforeRequest(fieldKey: string, params?: import("../../../../../es/src/types").AnyObject | undefined): void | WithUndefined<import("../../../../../es/src/types").AnyObject>;
|
|
11
|
-
afterRequest(fieldKey: string, payload?:
|
|
11
|
+
afterRequest(fieldKey: string, payload?: any): import("../../../../../es/src/types").AnyObject[];
|
|
12
12
|
}>>[T]>>;
|
|
13
13
|
};
|
|
@@ -111,6 +111,14 @@ export declare type FieldItem = {
|
|
|
111
111
|
placeholder: string;
|
|
112
112
|
validate: ValidateItem;
|
|
113
113
|
option: OptionItem[];
|
|
114
|
+
/**
|
|
115
|
+
* 是否开启多选('0'表示开启, 值是反的)
|
|
116
|
+
*/
|
|
117
|
+
multi_select: FormCommonState;
|
|
118
|
+
/**
|
|
119
|
+
* 多选时最大选择数量
|
|
120
|
+
*/
|
|
121
|
+
multi_select_value: number | string;
|
|
114
122
|
/**
|
|
115
123
|
* 用于cascader控件提供层级参数
|
|
116
124
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyObject,
|
|
1
|
+
import { AnyObject, WithUndefined } from '../../../../../es/src/types';
|
|
2
2
|
import { DataField, Field } from '@formily/core';
|
|
3
3
|
import { ISchema } from '@formily/json-schema/esm/types';
|
|
4
4
|
import { Component, FunctionalComponent } from 'vue';
|
|
@@ -51,11 +51,15 @@ export declare type FormBusinessFilter = (payload: {
|
|
|
51
51
|
type: FIELD_BUSINESS_TYPE;
|
|
52
52
|
context?: any;
|
|
53
53
|
}) => unknown;
|
|
54
|
-
export declare type DependKeyType =
|
|
54
|
+
export declare type DependKeyType = string | Record<string, string> | Array<{
|
|
55
|
+
paramName: string;
|
|
56
|
+
paramValue?: string;
|
|
57
|
+
required?: boolean;
|
|
58
|
+
} | string>;
|
|
55
59
|
export declare type FormRenderLifeCycle = Partial<{
|
|
56
60
|
onSetup(): void;
|
|
57
61
|
beforeRequest(fieldKey: string, params?: AnyObject): WithUndefined<AnyObject> | void;
|
|
58
|
-
afterRequest(fieldKey: string, payload?:
|
|
62
|
+
afterRequest(fieldKey: string, payload?: any): AnyObject[];
|
|
59
63
|
}>;
|
|
60
64
|
export declare type FormRenderProps = Partial<{
|
|
61
65
|
fieldList: FieldItem[];
|
|
@@ -8,15 +8,16 @@ export declare function arrayed<T>(maybeArray: T): T extends Array<any> ? T : [T
|
|
|
8
8
|
export declare function assignUpdateValue(props: AnyObject, field: GeneralField): {
|
|
9
9
|
[x: string]: any;
|
|
10
10
|
};
|
|
11
|
-
export declare function transformDateFormat(format?: string): "date" | "datetime";
|
|
11
|
+
export declare function transformDateFormat(format?: string): "date" | "datetime" | "month";
|
|
12
12
|
export declare function isIdCard(idCardNo: string): boolean;
|
|
13
13
|
export declare function isMobile(mobile: string): boolean;
|
|
14
14
|
export declare function parseBirthday(birthday: string): AgeContext;
|
|
15
15
|
export declare function mergeDeepProperties(target: AnyObject, fieldList: FieldItem[], traverseProperties?: string[], property?: string, targetProperty?: string): AnyObject;
|
|
16
16
|
export declare function parseIdCard(idCardNo: string): IdCardParseInfo;
|
|
17
17
|
export declare function injectOrProvide<T>(key: InjectionKey<T>, creator: () => T): T;
|
|
18
|
+
export declare function parseNumberFromMaybeString(value: unknown): unknown;
|
|
18
19
|
export declare function traverseDependKey(dependKeys: DependKeyType, handler: {
|
|
19
|
-
(dependKey: string, valueKey: string): void;
|
|
20
|
+
(dependKey: string, valueKey: string, required?: boolean): void;
|
|
20
21
|
}): void;
|
|
21
22
|
export declare function traverseSchema(schema: ISchema, handler: (_s: ISchema) => void): void;
|
|
22
23
|
export declare function uuidGenerator(): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { inject, provide, computed, createVNode, Fragment } from 'vue';
|
|
2
2
|
import { isObject } from '@vue/shared';
|
|
3
|
-
import {
|
|
3
|
+
import { isNumber, isString, isArray, isFunction } from 'lodash-es';
|
|
4
4
|
import { FIELD_SEX_VALUE } from '../constants/index.js';
|
|
5
5
|
import { isField } from '@formily/core';
|
|
6
6
|
import { differenceInDays, differenceInMonths, differenceInYears } from 'date-fns';
|
|
@@ -26,7 +26,12 @@ function assignUpdateValue(props, field) {
|
|
|
26
26
|
}
|
|
27
27
|
return _props;
|
|
28
28
|
}
|
|
29
|
+
function isMonthType(format) {
|
|
30
|
+
return format && format.replace(/yyyy-MM/gi, "YYYY-MM") === "YYYY-MM";
|
|
31
|
+
}
|
|
29
32
|
function transformDateFormat(format = "") {
|
|
33
|
+
if (isMonthType(format))
|
|
34
|
+
return "month";
|
|
30
35
|
return format.includes("HH") ? "datetime" : "date";
|
|
31
36
|
}
|
|
32
37
|
function isIdCard(idCardNo) {
|
|
@@ -96,26 +101,44 @@ function injectOrProvide(key, creator) {
|
|
|
96
101
|
}
|
|
97
102
|
return injected;
|
|
98
103
|
}
|
|
104
|
+
function parseNumberFromMaybeString(value) {
|
|
105
|
+
if (isNumber(value))
|
|
106
|
+
return value;
|
|
107
|
+
if (isString(value))
|
|
108
|
+
return +value;
|
|
109
|
+
return value;
|
|
110
|
+
}
|
|
99
111
|
function traverseDependKey(dependKeys, handler) {
|
|
100
112
|
if (!dependKeys)
|
|
101
113
|
return;
|
|
114
|
+
createDependKeyMap().forEach((valueKey, dependKey) => {
|
|
115
|
+
if (isString(valueKey))
|
|
116
|
+
return handler(dependKey, valueKey);
|
|
117
|
+
handler(dependKey, valueKey.key, valueKey.required);
|
|
118
|
+
});
|
|
102
119
|
Object.entries(createDependKeyMap()).forEach(([dependKey, valueKey]) => {
|
|
103
120
|
handler(dependKey, valueKey);
|
|
104
121
|
});
|
|
105
122
|
function createDependKeyMap() {
|
|
106
|
-
|
|
123
|
+
const result = /* @__PURE__ */ new Map();
|
|
107
124
|
if (isArray(dependKeys)) {
|
|
108
125
|
dependKeys.forEach((k) => {
|
|
126
|
+
var _a;
|
|
109
127
|
if (isObject(k)) {
|
|
110
|
-
result
|
|
128
|
+
result.set(k.paramName, {
|
|
129
|
+
key: (_a = k.paramName) != null ? _a : k.paramValue,
|
|
130
|
+
required: k.required
|
|
131
|
+
});
|
|
111
132
|
} else {
|
|
112
|
-
result
|
|
133
|
+
result.set(k, k);
|
|
113
134
|
}
|
|
114
135
|
});
|
|
115
136
|
} else if (isObject(dependKeys)) {
|
|
116
|
-
|
|
137
|
+
Object.entries(dependKeys).forEach(([k, v]) => {
|
|
138
|
+
result.set(k, v);
|
|
139
|
+
});
|
|
117
140
|
} else if (isString(dependKeys)) {
|
|
118
|
-
result
|
|
141
|
+
result.set(dependKeys, dependKeys);
|
|
119
142
|
}
|
|
120
143
|
return result;
|
|
121
144
|
}
|
|
@@ -197,4 +220,4 @@ function createInputSlot(props) {
|
|
|
197
220
|
});
|
|
198
221
|
}
|
|
199
222
|
|
|
200
|
-
export { arrayed, assignUpdateValue, createInputSlot, createLinebarId, createSlot, elementIdEscape, fieldKeyEscape, formRenderLog, getParentLinebar, injectOrProvide, isIdCard, isMobile, mergeDeepProperties, parseBirthday, parseIdCard, queryDecorator, queryInput, transformDateFormat, traverseDependKey, traverseSchema, uuidGenerator };
|
|
223
|
+
export { arrayed, assignUpdateValue, createInputSlot, createLinebarId, createSlot, elementIdEscape, fieldKeyEscape, formRenderLog, getParentLinebar, injectOrProvide, isIdCard, isMobile, mergeDeepProperties, parseBirthday, parseIdCard, parseNumberFromMaybeString, queryDecorator, queryInput, transformDateFormat, traverseDependKey, traverseSchema, uuidGenerator };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function useNuiThemeOverrides() {
|
|
2
2
|
const nuiThemeOverrides = {
|
|
3
3
|
Input: { paddingMedium: "8px", paddingSmall: "8px", paddingLarge: "8px", paddingTiny: "8px" },
|
|
4
|
-
InternalSelection: { paddingSingle: "8px", paddingMultiple: "
|
|
4
|
+
InternalSelection: { paddingSingle: "8px", paddingMultiple: "2px" },
|
|
5
5
|
Form: {
|
|
6
6
|
feedbackHeightMedium: "16px",
|
|
7
7
|
feedbackHeightLarge: "16px",
|
package/es/packages/index.css
CHANGED
|
@@ -3178,3 +3178,111 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
3178
3178
|
.nodeTipContent li p {
|
|
3179
3179
|
margin: 0;
|
|
3180
3180
|
}
|
|
3181
|
+
.form-config {
|
|
3182
|
+
display: flex;
|
|
3183
|
+
justify-content: space-between;
|
|
3184
|
+
}
|
|
3185
|
+
.form-config__material {
|
|
3186
|
+
padding: 16px;
|
|
3187
|
+
box-sizing: border-box;
|
|
3188
|
+
width: 200px;
|
|
3189
|
+
background: white;
|
|
3190
|
+
}
|
|
3191
|
+
.form-config__materialHeader {
|
|
3192
|
+
display: flex;
|
|
3193
|
+
align-items: center;
|
|
3194
|
+
justify-content: space-between;
|
|
3195
|
+
height: 40px;
|
|
3196
|
+
}
|
|
3197
|
+
.form-config__materialContent {
|
|
3198
|
+
padding: 8px;
|
|
3199
|
+
min-height: 400px;
|
|
3200
|
+
display: flex;
|
|
3201
|
+
flex-direction: column;
|
|
3202
|
+
gap: 8px;
|
|
3203
|
+
}
|
|
3204
|
+
.form-config__materialContentItem {
|
|
3205
|
+
display: flex;
|
|
3206
|
+
align-items: center;
|
|
3207
|
+
padding: 8px;
|
|
3208
|
+
border: 1px dashed #d9d9d9;
|
|
3209
|
+
box-sizing: border-box;
|
|
3210
|
+
background-color: #fafafa;
|
|
3211
|
+
grid-column: span var(--item-column) / span var(--item-column);
|
|
3212
|
+
}
|
|
3213
|
+
.form-config__displayWrapper {
|
|
3214
|
+
padding: 16px;
|
|
3215
|
+
box-sizing: border-box;
|
|
3216
|
+
flex: 1;
|
|
3217
|
+
padding: 16px 0;
|
|
3218
|
+
}
|
|
3219
|
+
.form-config__displayHeader {
|
|
3220
|
+
display: flex;
|
|
3221
|
+
align-items: center;
|
|
3222
|
+
justify-content: space-between;
|
|
3223
|
+
height: 40px;
|
|
3224
|
+
}
|
|
3225
|
+
.form-config__displayContent {
|
|
3226
|
+
padding: 16px;
|
|
3227
|
+
box-sizing: border-box;
|
|
3228
|
+
height: fit-content;
|
|
3229
|
+
background: #eeeeee;
|
|
3230
|
+
display: grid !important;
|
|
3231
|
+
grid-template-columns: repeat(12, minmax(0px, 1fr));
|
|
3232
|
+
gap: 8px 16px;
|
|
3233
|
+
}
|
|
3234
|
+
.form-config__displayContentItem {
|
|
3235
|
+
grid-column: span var(--item-column) / span var(--item-column);
|
|
3236
|
+
position: relative;
|
|
3237
|
+
}
|
|
3238
|
+
.form-config__config {
|
|
3239
|
+
padding: 16px;
|
|
3240
|
+
box-sizing: border-box;
|
|
3241
|
+
width: 220px;
|
|
3242
|
+
background: white;
|
|
3243
|
+
}
|
|
3244
|
+
.form-config__renderer--default {
|
|
3245
|
+
display: flex;
|
|
3246
|
+
align-items: center;
|
|
3247
|
+
padding: 8px;
|
|
3248
|
+
border: 1px dashed #d9d9d9;
|
|
3249
|
+
box-sizing: border-box;
|
|
3250
|
+
background-color: #fafafa;
|
|
3251
|
+
user-select: none;
|
|
3252
|
+
position: relative;
|
|
3253
|
+
width: 100%;
|
|
3254
|
+
}
|
|
3255
|
+
.form-config__renderer--complex {
|
|
3256
|
+
border: 1px dashed lightblue;
|
|
3257
|
+
padding: 8px;
|
|
3258
|
+
}
|
|
3259
|
+
.form-config__renderer--complex--grid {
|
|
3260
|
+
display: grid !important;
|
|
3261
|
+
grid-template-columns: repeat(12, minmax(0px, 1fr));
|
|
3262
|
+
gap: 8px 16px;
|
|
3263
|
+
grid-column: span var(--item-column) / span var(--item-column);
|
|
3264
|
+
}
|
|
3265
|
+
.form-config__renderer--complex--flex {
|
|
3266
|
+
display: flex;
|
|
3267
|
+
}
|
|
3268
|
+
.form-config .is-disabled {
|
|
3269
|
+
background: #e5e5e5;
|
|
3270
|
+
}
|
|
3271
|
+
.form-config .is-required {
|
|
3272
|
+
padding-left: 16px !important;
|
|
3273
|
+
}
|
|
3274
|
+
.form-config .is-required::before {
|
|
3275
|
+
position: absolute;
|
|
3276
|
+
content: '*';
|
|
3277
|
+
left: 8px;
|
|
3278
|
+
color: red;
|
|
3279
|
+
}
|
|
3280
|
+
.form-config .is-active {
|
|
3281
|
+
color: #5585f5;
|
|
3282
|
+
}
|
|
3283
|
+
.form-config .is-choosing {
|
|
3284
|
+
box-shadow: #5585f5 0 0 0 2px !important;
|
|
3285
|
+
}
|
|
3286
|
+
.form-config .is-choosing-area {
|
|
3287
|
+
background: #f0f7ff;
|
|
3288
|
+
}
|
package/es/packages/index.d.ts
CHANGED
|
@@ -19,12 +19,15 @@ import CFormRender from './form-render';
|
|
|
19
19
|
import CFabricChart from './fabric-chart';
|
|
20
20
|
import CShortcutProvider from './shortcut-provider';
|
|
21
21
|
import CShortcutSetter from './shortcut-setter';
|
|
22
|
+
import CFormConfig from './form-config';
|
|
22
23
|
export * from './form-render';
|
|
23
24
|
export * from './shortcut-provider';
|
|
25
|
+
export * from './shortcut-setter';
|
|
24
26
|
export * from './big-table';
|
|
25
27
|
export * from './button-print';
|
|
28
|
+
export * from './form-config';
|
|
26
29
|
declare function install(app: App): void;
|
|
27
|
-
export { CGrid, CBigTable, CFieldSet, CDragLayout, CButtonPrint, CSelectPerson, CSelectLabel, CLabelFormContent, CScaleView, CMap, CVodChunkUpload, CRadio, CCheckbox, CSelect, CDatetime, CFormTable, CInfoHeader, CTimeLine, CBpmnWorkflow, CStepsWheel, Editor, CFormRender, CFabricChart, CShortcutProvider, CShortcutSetter };
|
|
30
|
+
export { CGrid, CBigTable, CFieldSet, CDragLayout, CButtonPrint, CSelectPerson, CSelectLabel, CLabelFormContent, CScaleView, CMap, CVodChunkUpload, CRadio, CCheckbox, CSelect, CDatetime, CFormTable, CInfoHeader, CTimeLine, CBpmnWorkflow, CStepsWheel, Editor, CFormRender, CFabricChart, CShortcutProvider, CShortcutSetter, CFormConfig };
|
|
28
31
|
declare const _default: {
|
|
29
32
|
install: typeof install;
|
|
30
33
|
};
|
package/es/packages/index.js
CHANGED
|
@@ -38,6 +38,8 @@ import ShortcutProvider from './shortcut-provider/index.js';
|
|
|
38
38
|
export { default as CShortcutProvider } from './shortcut-provider/index.js';
|
|
39
39
|
import ShortcutSetter from './shortcut-setter/index.js';
|
|
40
40
|
export { default as CShortcutSetter } from './shortcut-setter/index.js';
|
|
41
|
+
import FormConfig from './form-config/index.js';
|
|
42
|
+
export { default as CFormConfig } from './form-config/index.js';
|
|
41
43
|
export { useFieldListAdaptor } from './form-render/src/hooks/useFieldListAdaptor.js';
|
|
42
44
|
export { useFormRequest } from './form-render/src/hooks/useFormRequest.js';
|
|
43
45
|
export { useCommonLog } from './form-render/src/hooks/useCommonLog.js';
|
|
@@ -52,7 +54,7 @@ export { FormItemDepsCollector, useFormItemDeps } from './form-render/src/hooks/
|
|
|
52
54
|
export { useInitialData } from './form-render/src/hooks/useInitialData.js';
|
|
53
55
|
export { useAnchor } from './form-render/src/hooks/useAnchor.js';
|
|
54
56
|
export { useFormContext } from './form-render/src/hooks/useFormContext.js';
|
|
55
|
-
export { ShortcutManager, useShortcuts } from './shortcut-provider/src/hooks/useShortcuts.js';
|
|
57
|
+
export { GlobalShortcutProvider, ShortcutManager, useShortcuts } from './shortcut-provider/src/hooks/useShortcuts.js';
|
|
56
58
|
export { useShortcutSignature } from './shortcut-provider/src/hooks/useShortcutSignature.js';
|
|
57
59
|
export { useColumnConfigAdaptor } from './big-table/src/hooks/useColumnConfigAdaptor.js';
|
|
58
60
|
export { Print } from './button-print/src/utils/print.js';
|
|
@@ -82,7 +84,8 @@ const components = {
|
|
|
82
84
|
CFormRender: FormRender,
|
|
83
85
|
CFabricChart: FabricChart,
|
|
84
86
|
CShortcutProvider: ShortcutProvider,
|
|
85
|
-
CShortcutSetter: ShortcutSetter
|
|
87
|
+
CShortcutSetter: ShortcutSetter,
|
|
88
|
+
CFormConfig: FormConfig
|
|
86
89
|
};
|
|
87
90
|
function install(app) {
|
|
88
91
|
Object.values(components).forEach((component) => {
|
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
import { SFCWithInstall } from '../../../es/src/types';
|
|
2
2
|
export * from './src/hooks';
|
|
3
3
|
export * from './src/types';
|
|
4
|
-
declare const ShortcutProvider: SFCWithInstall<import("vue").DefineComponent<{
|
|
4
|
+
declare const ShortcutProvider: SFCWithInstall<import("vue").DefineComponent<{
|
|
5
|
+
scope: {
|
|
6
|
+
type: (SymbolConstructor | StringConstructor)[];
|
|
7
|
+
};
|
|
8
|
+
}, {
|
|
9
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
10
|
+
scope: {
|
|
11
|
+
type: (SymbolConstructor | StringConstructor)[];
|
|
12
|
+
};
|
|
13
|
+
}>> & {
|
|
14
|
+
[x: `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
|
|
15
|
+
}>>;
|
|
5
16
|
shortcutWrapperRef: import("vue").Ref<HTMLElement | undefined>;
|
|
6
17
|
manager: import("./src/hooks").ShortcutManager;
|
|
7
|
-
},
|
|
18
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
19
|
+
scope: {
|
|
20
|
+
type: (SymbolConstructor | StringConstructor)[];
|
|
21
|
+
};
|
|
22
|
+
}>>, {}>>;
|
|
8
23
|
export default ShortcutProvider;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { COMPONENT_NAMESPACE } from '../../src/global/variable';
|
|
2
2
|
import { safeComponentRegister } from '../../src/utils';
|
|
3
3
|
import script from './src/ShortcutProvider.js';
|
|
4
|
-
export { ShortcutManager, useShortcuts } from './src/hooks/useShortcuts.js';
|
|
4
|
+
export { GlobalShortcutProvider, ShortcutManager, useShortcuts } from './src/hooks/useShortcuts.js';
|
|
5
5
|
export { useShortcutSignature } from './src/hooks/useShortcutSignature.js';
|
|
6
6
|
|
|
7
7
|
const ShortcutProvider = script;
|
|
@@ -5,9 +5,13 @@ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.js';
|
|
|
5
5
|
|
|
6
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
7
|
__name: "ShortcutProvider",
|
|
8
|
+
props: {
|
|
9
|
+
scope: { type: [String, Symbol] }
|
|
10
|
+
},
|
|
8
11
|
setup(__props) {
|
|
12
|
+
const props = __props;
|
|
9
13
|
const shortcutWrapperRef = ref();
|
|
10
|
-
const manager = new ShortcutManager(shortcutWrapperRef).start();
|
|
14
|
+
const manager = new ShortcutManager(shortcutWrapperRef, props.scope || String(Date.now())).start();
|
|
11
15
|
provide(InjectionShortcutManager, manager);
|
|
12
16
|
onBeforeUnmount(() => {
|
|
13
17
|
manager.destroy();
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import { ShortcutManager } from '../../../../es/packages/shortcut-provider';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{
|
|
3
|
+
scope: {
|
|
4
|
+
type: (SymbolConstructor | StringConstructor)[];
|
|
5
|
+
};
|
|
6
|
+
}, {
|
|
7
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
8
|
+
scope: {
|
|
9
|
+
type: (SymbolConstructor | StringConstructor)[];
|
|
10
|
+
};
|
|
11
|
+
}>> & {
|
|
12
|
+
[x: `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
|
|
13
|
+
}>>;
|
|
3
14
|
shortcutWrapperRef: import("vue").Ref<HTMLElement | undefined>;
|
|
4
15
|
manager: ShortcutManager;
|
|
5
|
-
},
|
|
16
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
17
|
+
scope: {
|
|
18
|
+
type: (SymbolConstructor | StringConstructor)[];
|
|
19
|
+
};
|
|
20
|
+
}>>, {}>;
|
|
6
21
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ShortcutManager, useShortcuts } from './useShortcuts.js';
|
|
1
|
+
export { GlobalShortcutProvider, ShortcutManager, useShortcuts } from './useShortcuts.js';
|
|
2
2
|
export { useShortcutSignature } from './useShortcutSignature.js';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ShortcutItem, ShortcutOption, ShortcutSignatureInfo } from '../../../../../es/packages/shortcut-provider/src/types';
|
|
2
1
|
import { MaybeRef } from '@vueuse/core';
|
|
2
|
+
import { ShortcutItem, ShortcutOption, ShortcutSignatureInfo } from '../../../../../es/packages/shortcut-provider/src/types';
|
|
3
|
+
export declare const GlobalShortcutProvider: unique symbol;
|
|
3
4
|
export declare class ShortcutManager {
|
|
4
5
|
private readonly shortcutCallbackMap;
|
|
5
6
|
private readonly shortcutCache;
|
|
@@ -7,27 +8,26 @@ export declare class ShortcutManager {
|
|
|
7
8
|
private handle?;
|
|
8
9
|
disabled: boolean;
|
|
9
10
|
static log(message: string, dryRun?: boolean): string;
|
|
10
|
-
constructor(environmentEle?: MaybeRef<HTMLElement | undefined
|
|
11
|
+
constructor(environmentEle?: MaybeRef<HTMLElement | undefined>, scope?: string | Symbol);
|
|
11
12
|
get traverse(): Omit<ShortcutItem, "callback">[];
|
|
12
|
-
query
|
|
13
|
-
|
|
14
|
-
update(key: string, info?: KeyboardEvent | Partial<ShortcutSignatureInfo>): Promise<void>;
|
|
13
|
+
private query;
|
|
14
|
+
update(key: string, info: KeyboardEvent | Partial<ShortcutSignatureInfo>): Promise<void>;
|
|
15
15
|
register(shortcutItem: ShortcutItem): {
|
|
16
16
|
stop: () => void;
|
|
17
|
+
start: () => void;
|
|
17
18
|
signature: () => string;
|
|
18
19
|
};
|
|
19
20
|
start(): this;
|
|
20
21
|
destroy(): void;
|
|
22
|
+
clear(): void;
|
|
21
23
|
}
|
|
22
|
-
export declare function useShortcuts(
|
|
24
|
+
export declare function useShortcuts(scope?: MaybeRef<string | Symbol | undefined>): {
|
|
23
25
|
register: (shortcut: ShortcutOption) => {
|
|
24
26
|
stop: () => void;
|
|
25
27
|
signature: () => string;
|
|
26
28
|
};
|
|
27
29
|
traverse: () => Omit<ShortcutItem, "callback">[];
|
|
28
|
-
|
|
29
|
-
update: (key: string, info: KeyboardEvent | Partial<ShortcutSignatureInfo>) => void
|
|
30
|
-
onReset: (key: string) => void;
|
|
31
|
-
updateDisabled: (key: string, state?: boolean) => void;
|
|
30
|
+
clear: () => void;
|
|
31
|
+
update: (key: string, info: KeyboardEvent | Partial<ShortcutSignatureInfo>) => Promise<void>;
|
|
32
32
|
updateManagerDisabled: (disabled?: boolean) => void;
|
|
33
33
|
};
|