cnhis-design-vue 3.1.13-beta.0 → 3.1.13-beta.11
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/BigTable.vue.d.ts +3 -16
- package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +40 -21
- package/es/packages/big-table/src/bigTableEmits.js +2 -1
- package/es/packages/big-table/src/utils.js +2 -1
- package/es/packages/big-table/style/index.css +5 -0
- package/es/packages/bpmn-workflow/src/BpmnWorkflow.d.ts +5 -0
- package/es/packages/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
- package/es/packages/bpmn-workflow/types/ModelingModule.d.ts +1 -0
- package/es/packages/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
- package/es/packages/button-print/index.d.ts +15 -1
- package/es/packages/button-print/src/ButtonPrint.vue.d.ts +199 -185
- package/es/packages/button-print/src/ButtonPrint.vue_vue_type_script_setup_true_lang.js +39 -4
- package/es/packages/button-print/src/utils/print.d.ts +41 -0
- package/es/packages/button-print/src/utils/print.js +325 -0
- package/es/packages/fabric-chart/index.d.ts +3 -4
- package/es/packages/fabric-chart/src/FabricChart.vue.d.ts +3 -4
- package/es/packages/fabric-chart/src/FabricChart.vue_vue_type_script_setup_true_lang.js +24 -18
- package/es/packages/fabric-chart/src/hooks/useBottom.js +1 -2
- package/es/packages/fabric-chart/src/hooks/useCenter.js +89 -19
- package/es/packages/fabric-chart/src/hooks/useCumputedPoint.d.ts +2 -2
- package/es/packages/fabric-chart/src/hooks/useCumputedPoint.js +27 -13
- package/es/packages/fabric-chart/src/hooks/useDraw.d.ts +1 -1
- package/es/packages/fabric-chart/src/hooks/useDraw.js +64 -7
- package/es/packages/fabric-chart/src/hooks/useLeft.js +83 -22
- package/es/packages/fabric-chart/src/hooks/useOther.js +3 -2
- package/es/packages/fabric-chart/src/hooks/useShadow.js +1 -1
- package/es/packages/fabric-chart/src/hooks/useTop.js +6 -4
- package/es/packages/fabric-chart/src/interface.d.ts +2 -2
- package/es/packages/fabric-chart/src/utils/index.d.ts +6823 -2
- package/es/packages/form-render/index.d.ts +311 -0
- package/es/packages/form-render/src/FormRender.vue.d.ts +313 -2
- package/es/packages/form-render/src/FormRender.vue_vue_type_script_setup_true_lang.js +58 -27
- package/es/packages/form-render/src/components/renderer/cascader.d.ts +7 -1
- package/es/packages/form-render/src/components/renderer/cascader.js +65 -53
- package/es/packages/form-render/src/components/renderer/formItem.d.ts +8 -293
- package/es/packages/form-render/src/components/renderer/formItem.js +137 -2
- package/es/packages/form-render/src/components/renderer/input.js +3 -3
- package/es/packages/form-render/src/components/renderer/select.d.ts +7 -5
- package/es/packages/form-render/src/components/renderer/select.js +35 -40
- package/es/packages/form-render/src/components/renderer/simpleComponent.js +2 -15
- package/es/packages/form-render/src/constants/index.d.ts +2 -1
- package/es/packages/form-render/src/constants/index.js +2 -1
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +4 -2
- package/es/packages/form-render/src/hooks/useFormContext.d.ts +2 -1
- package/es/packages/form-render/src/hooks/useFormContext.js +13 -2
- package/es/packages/form-render/src/types/fieldItem.d.ts +58 -7
- package/es/packages/form-render/src/types/index.d.ts +5 -0
- package/es/packages/form-render/src/utils/index.d.ts +13 -4
- package/es/packages/form-render/src/utils/index.js +44 -3
- package/es/packages/form-render/style/index.css +44 -6
- package/es/packages/form-table/src/hooks/useNuiThemeOverrides.d.ts +4 -0
- package/es/packages/form-table/src/hooks/useNuiThemeOverrides.js +18 -0
- package/es/packages/index.css +228 -8
- package/es/packages/index.d.ts +5 -1
- package/es/packages/index.js +12 -1
- package/es/packages/scale-view/src/hooks/scaleview-init.js +1 -5
- package/es/packages/scale-view/src/hooks/scaleview-submit.js +1 -6
- package/es/packages/scale-view/src/hooks/scaleview-validate.js +0 -3
- package/es/packages/shortcut-provider/index.d.ts +17 -0
- package/es/packages/shortcut-provider/index.js +13 -0
- package/es/packages/shortcut-provider/src/ShortcutProvider.js +4 -0
- package/es/packages/shortcut-provider/src/ShortcutProvider.vue.d.ts +15 -0
- package/es/packages/shortcut-provider/src/ShortcutProvider.vue_vue_type_script_setup_true_lang.js +32 -0
- package/es/packages/shortcut-provider/src/constants/index.d.ts +7 -0
- package/es/packages/shortcut-provider/src/constants/index.js +8 -0
- package/es/packages/shortcut-provider/src/hooks/index.d.ts +2 -0
- package/es/packages/shortcut-provider/src/hooks/index.js +2 -0
- package/es/packages/shortcut-provider/src/hooks/useShortcutSignature.d.ts +4 -0
- package/es/packages/shortcut-provider/src/hooks/useShortcutSignature.js +12 -0
- package/es/packages/shortcut-provider/src/hooks/useShortcuts.d.ts +30 -0
- package/es/packages/shortcut-provider/src/hooks/useShortcuts.js +157 -0
- package/es/packages/shortcut-provider/src/types/index.d.ts +30 -0
- package/es/packages/shortcut-provider/src/types/index.js +1 -0
- package/es/packages/shortcut-provider/src/utils/index.d.ts +7 -0
- package/es/packages/shortcut-provider/src/utils/index.js +49 -0
- package/es/packages/shortcut-provider/style/index.css +3 -0
- package/es/packages/shortcut-setter/constant/index.d.ts +4 -0
- package/es/packages/shortcut-setter/constant/index.js +7 -0
- package/es/packages/shortcut-setter/index.d.ts +4258 -0
- package/es/packages/shortcut-setter/index.js +11 -0
- package/es/packages/shortcut-setter/src/ShortcutSetter.js +4 -0
- package/es/packages/shortcut-setter/src/ShortcutSetter.vue.d.ts +4258 -0
- package/es/packages/shortcut-setter/src/ShortcutSetter.vue_vue_type_script_setup_true_lang.js +38 -0
- package/es/packages/shortcut-setter/src/ShortcutSetterItem.js +4 -0
- package/es/packages/shortcut-setter/src/ShortcutSetterItem.vue.d.ts +4238 -0
- package/es/packages/shortcut-setter/src/ShortcutSetterItem.vue_vue_type_script_setup_true_lang.js +125 -0
- package/es/packages/shortcut-setter/style/index.css +8 -0
- package/es/packages/steps-wheel/index.d.ts +548 -0
- package/es/packages/steps-wheel/index.js +11 -0
- package/es/packages/steps-wheel/src/StepsWheel.js +4 -0
- package/es/packages/steps-wheel/src/StepsWheel.vue.d.ts +547 -0
- package/es/packages/steps-wheel/src/StepsWheel.vue_vue_type_script_setup_true_lang.js +252 -0
- package/es/packages/steps-wheel/style/index.css +161 -0
- package/es/packages/time-line/index.d.ts +1 -0
- package/es/packages/time-line/src/TimeLine.vue.d.ts +1 -0
- package/es/packages/time-line/src/TimeLine.vue_vue_type_script_setup_true_lang.js +6 -1
- package/es/packages/time-line/style/index.css +7 -2
- package/es/src/types/index.d.ts +1 -0
- package/package.json +153 -153
- package/es/packages/button-print/src/utils/print.es.min.d.ts +0 -2
- package/es/packages/button-print/src/utils/print.es.min.js +0 -2532
- package/test.ts +0 -326
|
@@ -21,6 +21,9 @@ const script = defineComponent({
|
|
|
21
21
|
urlConfig: {
|
|
22
22
|
type: Object
|
|
23
23
|
},
|
|
24
|
+
onFocus: {
|
|
25
|
+
type: Function
|
|
26
|
+
},
|
|
24
27
|
onChange: {},
|
|
25
28
|
value: {}
|
|
26
29
|
},
|
|
@@ -30,15 +33,12 @@ const script = defineComponent({
|
|
|
30
33
|
emit
|
|
31
34
|
}) {
|
|
32
35
|
const _options = ref(null);
|
|
33
|
-
const {
|
|
34
|
-
title
|
|
35
|
-
} = useFormField();
|
|
36
36
|
const asyncQueue = inject(InjectAsyncQueue);
|
|
37
37
|
const {
|
|
38
|
-
field
|
|
38
|
+
field,
|
|
39
|
+
title
|
|
39
40
|
} = useFormField();
|
|
40
41
|
async function fetchData(option) {
|
|
41
|
-
var _a;
|
|
42
42
|
if (!option && _options.value)
|
|
43
43
|
return;
|
|
44
44
|
const config = props.urlConfig;
|
|
@@ -48,56 +48,63 @@ const script = defineComponent({
|
|
|
48
48
|
formRenderLog(`invalid urlConfig (${config}) in CASCADER => ${title.value}`, "warn");
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
if ((option
|
|
51
|
+
if (deepFor(option) + 1 >= props.deep)
|
|
52
52
|
return;
|
|
53
|
-
const parentDepth = (_a = option == null ? void 0 : option.depth) != null ? _a : -1;
|
|
54
|
-
const params = {
|
|
55
|
-
lvlnr: parentDepth + 1 + ""
|
|
56
|
-
};
|
|
57
|
-
if (option) {
|
|
58
|
-
if (!config.dependKey) {
|
|
59
|
-
formRenderLog(`invalid urlConfig.dependKey ${config.dependKey} in CASCADER => ${title.value}`, "warn");
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
arrayed(config.dependKey).forEach((key) => {
|
|
63
|
-
if (isString(key)) {
|
|
64
|
-
params[key] = option[valueKey.value];
|
|
65
|
-
} else if (isObject(key)) {
|
|
66
|
-
params[key.paramName] = option[key.paramValue];
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
53
|
let data = await asyncQueue.addAsync({
|
|
71
|
-
...config,
|
|
72
|
-
key: title.value
|
|
73
|
-
params
|
|
54
|
+
...createRequestParams(deepFor(option), config, option),
|
|
55
|
+
key: title.value
|
|
74
56
|
});
|
|
75
57
|
if (!Array.isArray(data)) {
|
|
76
58
|
data = [];
|
|
77
59
|
}
|
|
78
60
|
if (!data.length && isObject(option)) {
|
|
79
61
|
option.isLeaf = true;
|
|
80
|
-
|
|
81
|
-
|
|
62
|
+
updateValue(null, null, getOptionChain(option));
|
|
63
|
+
show.value = false;
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const result = data.map((item) => optionNormalize(item, deepFor(option)));
|
|
67
|
+
option ? option.children = result : _options.value = result;
|
|
68
|
+
function deepFor(option2) {
|
|
69
|
+
var _a;
|
|
70
|
+
return (_a = option2 == null ? void 0 : option2.depth) != null ? _a : -1;
|
|
71
|
+
}
|
|
72
|
+
function createRequestParams(deep, config2, option2) {
|
|
73
|
+
const params = {
|
|
74
|
+
lvlnr: deep + 1 + ""
|
|
75
|
+
};
|
|
76
|
+
if (option2 && config2.dependKey) {
|
|
77
|
+
arrayed(config2.dependKey).forEach((key) => {
|
|
78
|
+
if (isString(key)) {
|
|
79
|
+
params[key] = option2[valueKey.value];
|
|
80
|
+
} else if (isObject(key)) {
|
|
81
|
+
params[key.paramName] = option2[key.paramValue];
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
return {
|
|
86
|
+
params,
|
|
87
|
+
...config2
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function getOptionChain(option2) {
|
|
91
|
+
let currentOption = option2;
|
|
92
|
+
const result2 = [option2];
|
|
82
93
|
while (currentOption.parent) {
|
|
83
94
|
result2.unshift(currentOption.parent);
|
|
84
95
|
currentOption = currentOption.parent;
|
|
85
96
|
}
|
|
86
|
-
|
|
87
|
-
show.value = false;
|
|
88
|
-
return;
|
|
97
|
+
return result2;
|
|
89
98
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
[labelKey.value]:
|
|
93
|
-
[valueKey.value]:
|
|
94
|
-
depth:
|
|
99
|
+
function optionNormalize(data2, deep) {
|
|
100
|
+
return {
|
|
101
|
+
[labelKey.value]: data2[labelKey.value],
|
|
102
|
+
[valueKey.value]: data2[valueKey.value],
|
|
103
|
+
depth: deep + 1,
|
|
95
104
|
parent: option,
|
|
96
|
-
isLeaf:
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
}, []);
|
|
100
|
-
option ? option.children = result : _options.value = result;
|
|
105
|
+
isLeaf: deep + 2 >= props.deep
|
|
106
|
+
};
|
|
107
|
+
}
|
|
101
108
|
}
|
|
102
109
|
const renderOptions = computed(() => {
|
|
103
110
|
return _options.value || props.options || [];
|
|
@@ -134,23 +141,28 @@ const script = defineComponent({
|
|
|
134
141
|
}
|
|
135
142
|
});
|
|
136
143
|
function updateValue(_, __, options) {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
+
emit("update:value", options.map(optionSimplify));
|
|
145
|
+
function optionSimplify(option) {
|
|
146
|
+
return {
|
|
147
|
+
...option,
|
|
148
|
+
label: option[labelKey.value],
|
|
149
|
+
children: void 0,
|
|
150
|
+
parent: void 0
|
|
151
|
+
};
|
|
152
|
+
}
|
|
144
153
|
}
|
|
145
154
|
const show = ref(false);
|
|
146
155
|
function updateShow(v) {
|
|
147
156
|
show.value = !!v;
|
|
148
157
|
v && fetchData();
|
|
149
158
|
}
|
|
150
|
-
function onFocus
|
|
151
|
-
|
|
152
|
-
field.value
|
|
153
|
-
|
|
159
|
+
function focusDecorator(onFocus) {
|
|
160
|
+
return (...args) => {
|
|
161
|
+
if (isField(field.value)) {
|
|
162
|
+
field.value.visited = true;
|
|
163
|
+
}
|
|
164
|
+
onFocus == null ? void 0 : onFocus(...args);
|
|
165
|
+
};
|
|
154
166
|
}
|
|
155
167
|
return () => {
|
|
156
168
|
return createVNode(NCascader, {
|
|
@@ -163,7 +175,7 @@ const script = defineComponent({
|
|
|
163
175
|
"options": renderOptions.value,
|
|
164
176
|
"checkStrategy": "child",
|
|
165
177
|
"onLoad": fetchData,
|
|
166
|
-
"onFocus": onFocus,
|
|
178
|
+
"onFocus": focusDecorator(props.onFocus),
|
|
167
179
|
"onUpdate:show": updateShow
|
|
168
180
|
}, slots);
|
|
169
181
|
};
|
|
@@ -1,294 +1,9 @@
|
|
|
1
1
|
export declare const FORM_ITEM: import("vue").DefineComponent<{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
readonly required: BooleanConstructor;
|
|
11
|
-
readonly showRequireMark: {
|
|
12
|
-
readonly type: import("vue").PropType<boolean | undefined>;
|
|
13
|
-
readonly default: undefined;
|
|
14
|
-
};
|
|
15
|
-
readonly requireMarkPlacement: import("vue").PropType<"left" | "right" | "right-hanging">;
|
|
16
|
-
readonly showFeedback: {
|
|
17
|
-
readonly type: import("vue").PropType<boolean | undefined>;
|
|
18
|
-
readonly default: undefined;
|
|
19
|
-
};
|
|
20
|
-
readonly rule: import("vue").PropType<import("naive-ui").FormItemRule | import("naive-ui").FormItemRule[]>;
|
|
21
|
-
readonly size: import("vue").PropType<"small" | "medium" | "large">;
|
|
22
|
-
readonly ignorePathChange: BooleanConstructor;
|
|
23
|
-
readonly validationStatus: import("vue").PropType<"success" | "warning" | "error">;
|
|
24
|
-
readonly feedback: StringConstructor;
|
|
25
|
-
readonly showLabel: {
|
|
26
|
-
readonly type: import("vue").PropType<boolean | undefined>;
|
|
27
|
-
readonly default: undefined;
|
|
28
|
-
};
|
|
29
|
-
readonly labelProps: import("vue").PropType<import("vue").LabelHTMLAttributes>;
|
|
30
|
-
readonly theme: import("vue").PropType<import("naive-ui/es/_mixins").Theme<"Form", {
|
|
31
|
-
blankHeightSmall: string;
|
|
32
|
-
blankHeightMedium: string;
|
|
33
|
-
blankHeightLarge: string;
|
|
34
|
-
lineHeight: string;
|
|
35
|
-
labelTextColor: string;
|
|
36
|
-
asteriskColor: string;
|
|
37
|
-
feedbackTextColorError: string;
|
|
38
|
-
feedbackTextColorWarning: string;
|
|
39
|
-
feedbackTextColor: string;
|
|
40
|
-
feedbackPadding: string;
|
|
41
|
-
feedbackHeightSmall: string;
|
|
42
|
-
feedbackHeightMedium: string;
|
|
43
|
-
feedbackHeightLarge: string;
|
|
44
|
-
feedbackFontSizeSmall: string;
|
|
45
|
-
feedbackFontSizeMedium: string;
|
|
46
|
-
feedbackFontSizeLarge: string;
|
|
47
|
-
labelFontSizeLeftSmall: string;
|
|
48
|
-
labelFontSizeLeftMedium: string;
|
|
49
|
-
labelFontSizeLeftLarge: string;
|
|
50
|
-
labelFontSizeTopSmall: string;
|
|
51
|
-
labelFontSizeTopMedium: string;
|
|
52
|
-
labelFontSizeTopLarge: string;
|
|
53
|
-
labelHeightSmall: string;
|
|
54
|
-
labelHeightMedium: string;
|
|
55
|
-
labelHeightLarge: string;
|
|
56
|
-
labelPaddingVertical: string;
|
|
57
|
-
labelPaddingHorizontal: string;
|
|
58
|
-
labelTextAlignVertical: string;
|
|
59
|
-
labelTextAlignHorizontal: string;
|
|
60
|
-
}, any>>;
|
|
61
|
-
readonly themeOverrides: import("vue").PropType<import("naive-ui/es/_mixins/use-theme").ExtractThemeOverrides<import("naive-ui/es/_mixins").Theme<"Form", {
|
|
62
|
-
blankHeightSmall: string;
|
|
63
|
-
blankHeightMedium: string;
|
|
64
|
-
blankHeightLarge: string;
|
|
65
|
-
lineHeight: string;
|
|
66
|
-
labelTextColor: string;
|
|
67
|
-
asteriskColor: string;
|
|
68
|
-
feedbackTextColorError: string;
|
|
69
|
-
feedbackTextColorWarning: string;
|
|
70
|
-
feedbackTextColor: string;
|
|
71
|
-
feedbackPadding: string;
|
|
72
|
-
feedbackHeightSmall: string;
|
|
73
|
-
feedbackHeightMedium: string;
|
|
74
|
-
feedbackHeightLarge: string;
|
|
75
|
-
feedbackFontSizeSmall: string;
|
|
76
|
-
feedbackFontSizeMedium: string;
|
|
77
|
-
feedbackFontSizeLarge: string;
|
|
78
|
-
labelFontSizeLeftSmall: string;
|
|
79
|
-
labelFontSizeLeftMedium: string;
|
|
80
|
-
labelFontSizeLeftLarge: string;
|
|
81
|
-
labelFontSizeTopSmall: string;
|
|
82
|
-
labelFontSizeTopMedium: string;
|
|
83
|
-
labelFontSizeTopLarge: string;
|
|
84
|
-
labelHeightSmall: string;
|
|
85
|
-
labelHeightMedium: string;
|
|
86
|
-
labelHeightLarge: string;
|
|
87
|
-
labelPaddingVertical: string;
|
|
88
|
-
labelPaddingHorizontal: string;
|
|
89
|
-
labelTextAlignVertical: string;
|
|
90
|
-
labelTextAlignHorizontal: string;
|
|
91
|
-
}, any>>>;
|
|
92
|
-
readonly builtinThemeOverrides: import("vue").PropType<import("naive-ui/es/_mixins/use-theme").ExtractThemeOverrides<import("naive-ui/es/_mixins").Theme<"Form", {
|
|
93
|
-
blankHeightSmall: string;
|
|
94
|
-
blankHeightMedium: string;
|
|
95
|
-
blankHeightLarge: string;
|
|
96
|
-
lineHeight: string;
|
|
97
|
-
labelTextColor: string;
|
|
98
|
-
asteriskColor: string;
|
|
99
|
-
feedbackTextColorError: string;
|
|
100
|
-
feedbackTextColorWarning: string;
|
|
101
|
-
feedbackTextColor: string;
|
|
102
|
-
feedbackPadding: string;
|
|
103
|
-
feedbackHeightSmall: string;
|
|
104
|
-
feedbackHeightMedium: string;
|
|
105
|
-
feedbackHeightLarge: string;
|
|
106
|
-
feedbackFontSizeSmall: string;
|
|
107
|
-
feedbackFontSizeMedium: string;
|
|
108
|
-
feedbackFontSizeLarge: string;
|
|
109
|
-
labelFontSizeLeftSmall: string;
|
|
110
|
-
labelFontSizeLeftMedium: string;
|
|
111
|
-
labelFontSizeLeftLarge: string;
|
|
112
|
-
labelFontSizeTopSmall: string;
|
|
113
|
-
labelFontSizeTopMedium: string;
|
|
114
|
-
labelFontSizeTopLarge: string;
|
|
115
|
-
labelHeightSmall: string;
|
|
116
|
-
labelHeightMedium: string;
|
|
117
|
-
labelHeightLarge: string;
|
|
118
|
-
labelPaddingVertical: string;
|
|
119
|
-
labelPaddingHorizontal: string;
|
|
120
|
-
labelTextAlignVertical: string;
|
|
121
|
-
labelTextAlignHorizontal: string;
|
|
122
|
-
}, any>>>;
|
|
123
|
-
}, {
|
|
124
|
-
cssVars: import("vue").ComputedRef<{
|
|
125
|
-
'--n-bezier': string;
|
|
126
|
-
'--n-line-height': string;
|
|
127
|
-
'--n-blank-height': string;
|
|
128
|
-
'--n-label-font-size': string;
|
|
129
|
-
'--n-label-text-align': string;
|
|
130
|
-
'--n-label-height': string;
|
|
131
|
-
'--n-label-padding': string;
|
|
132
|
-
'--n-asterisk-color': string;
|
|
133
|
-
'--n-label-text-color': string;
|
|
134
|
-
'--n-feedback-padding': string;
|
|
135
|
-
'--n-feedback-font-size': string;
|
|
136
|
-
'--n-feedback-height': string;
|
|
137
|
-
'--n-feedback-text-color': string;
|
|
138
|
-
'--n-feedback-text-color-warning': string;
|
|
139
|
-
'--n-feedback-text-color-error': string;
|
|
140
|
-
}> | undefined;
|
|
141
|
-
themeClass: import("vue").Ref<string>;
|
|
142
|
-
onRender: () => void;
|
|
143
|
-
validate: import("naive-ui/es/form/src/interface").FormItemValidate;
|
|
144
|
-
restoreValidation: () => void;
|
|
145
|
-
path?: string | undefined;
|
|
146
|
-
internalValidate: import("naive-ui/es/form/src/interface").FormItemInternalValidate;
|
|
147
|
-
mergedSize: import("vue").ComputedRef<import("naive-ui/es/form/src/interface").Size>;
|
|
148
|
-
validationErrored: import("vue").Ref<boolean>;
|
|
149
|
-
mergedLabelStyle: import("vue").ComputedRef<(import("vue").StyleValue | undefined)[]>;
|
|
150
|
-
mergedLabelPlacement: import("vue").ComputedRef<import("naive-ui/es/form/src/interface").LabelPlacement>;
|
|
151
|
-
mergedLabelAlign: import("vue").ComputedRef<import("naive-ui/es/form/src/interface").LabelAlign | undefined>;
|
|
152
|
-
mergedShowRequireMark: import("vue").ComputedRef<boolean | undefined>;
|
|
153
|
-
mergedRequireMarkPlacement: import("vue").ComputedRef<"left" | "right" | "right-hanging">;
|
|
154
|
-
mergedValidationStatus: import("vue").ComputedRef<"success" | "warning" | "error" | undefined>;
|
|
155
|
-
mergedShowFeedback: import("vue").ComputedRef<boolean>;
|
|
156
|
-
mergedShowLabel: import("vue").ComputedRef<boolean>;
|
|
157
|
-
labelElementRef: import("vue").Ref<HTMLLabelElement | null>;
|
|
158
|
-
mergedClsPrefix: import("vue").ComputedRef<string>;
|
|
159
|
-
mergedRequired: import("vue").ComputedRef<boolean>;
|
|
160
|
-
feedbackId: import("vue").Ref<string>;
|
|
161
|
-
renderExplains: import("vue").Ref<{
|
|
162
|
-
key: string;
|
|
163
|
-
render: () => import("vue").VNodeChild;
|
|
164
|
-
}[]>;
|
|
165
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
166
|
-
readonly label: StringConstructor;
|
|
167
|
-
readonly labelWidth: import("vue").PropType<string | number>;
|
|
168
|
-
readonly labelStyle: import("vue").PropType<string | import("vue").CSSProperties>;
|
|
169
|
-
readonly labelAlign: import("vue").PropType<import("naive-ui/es/form/src/interface").LabelAlign>;
|
|
170
|
-
readonly labelPlacement: import("vue").PropType<import("naive-ui/es/form/src/interface").LabelPlacement>;
|
|
171
|
-
readonly path: StringConstructor;
|
|
172
|
-
readonly first: BooleanConstructor;
|
|
173
|
-
readonly rulePath: StringConstructor;
|
|
174
|
-
readonly required: BooleanConstructor;
|
|
175
|
-
readonly showRequireMark: {
|
|
176
|
-
readonly type: import("vue").PropType<boolean | undefined>;
|
|
177
|
-
readonly default: undefined;
|
|
178
|
-
};
|
|
179
|
-
readonly requireMarkPlacement: import("vue").PropType<"left" | "right" | "right-hanging">;
|
|
180
|
-
readonly showFeedback: {
|
|
181
|
-
readonly type: import("vue").PropType<boolean | undefined>;
|
|
182
|
-
readonly default: undefined;
|
|
183
|
-
};
|
|
184
|
-
readonly rule: import("vue").PropType<import("naive-ui").FormItemRule | import("naive-ui").FormItemRule[]>;
|
|
185
|
-
readonly size: import("vue").PropType<"small" | "medium" | "large">;
|
|
186
|
-
readonly ignorePathChange: BooleanConstructor;
|
|
187
|
-
readonly validationStatus: import("vue").PropType<"success" | "warning" | "error">;
|
|
188
|
-
readonly feedback: StringConstructor;
|
|
189
|
-
readonly showLabel: {
|
|
190
|
-
readonly type: import("vue").PropType<boolean | undefined>;
|
|
191
|
-
readonly default: undefined;
|
|
192
|
-
};
|
|
193
|
-
readonly labelProps: import("vue").PropType<import("vue").LabelHTMLAttributes>;
|
|
194
|
-
readonly theme: import("vue").PropType<import("naive-ui/es/_mixins").Theme<"Form", {
|
|
195
|
-
blankHeightSmall: string;
|
|
196
|
-
blankHeightMedium: string;
|
|
197
|
-
blankHeightLarge: string;
|
|
198
|
-
lineHeight: string;
|
|
199
|
-
labelTextColor: string;
|
|
200
|
-
asteriskColor: string;
|
|
201
|
-
feedbackTextColorError: string;
|
|
202
|
-
feedbackTextColorWarning: string;
|
|
203
|
-
feedbackTextColor: string;
|
|
204
|
-
feedbackPadding: string;
|
|
205
|
-
feedbackHeightSmall: string;
|
|
206
|
-
feedbackHeightMedium: string;
|
|
207
|
-
feedbackHeightLarge: string;
|
|
208
|
-
feedbackFontSizeSmall: string;
|
|
209
|
-
feedbackFontSizeMedium: string;
|
|
210
|
-
feedbackFontSizeLarge: string;
|
|
211
|
-
labelFontSizeLeftSmall: string;
|
|
212
|
-
labelFontSizeLeftMedium: string;
|
|
213
|
-
labelFontSizeLeftLarge: string;
|
|
214
|
-
labelFontSizeTopSmall: string;
|
|
215
|
-
labelFontSizeTopMedium: string;
|
|
216
|
-
labelFontSizeTopLarge: string;
|
|
217
|
-
labelHeightSmall: string;
|
|
218
|
-
labelHeightMedium: string;
|
|
219
|
-
labelHeightLarge: string;
|
|
220
|
-
labelPaddingVertical: string;
|
|
221
|
-
labelPaddingHorizontal: string;
|
|
222
|
-
labelTextAlignVertical: string;
|
|
223
|
-
labelTextAlignHorizontal: string;
|
|
224
|
-
}, any>>;
|
|
225
|
-
readonly themeOverrides: import("vue").PropType<import("naive-ui/es/_mixins/use-theme").ExtractThemeOverrides<import("naive-ui/es/_mixins").Theme<"Form", {
|
|
226
|
-
blankHeightSmall: string;
|
|
227
|
-
blankHeightMedium: string;
|
|
228
|
-
blankHeightLarge: string;
|
|
229
|
-
lineHeight: string;
|
|
230
|
-
labelTextColor: string;
|
|
231
|
-
asteriskColor: string;
|
|
232
|
-
feedbackTextColorError: string;
|
|
233
|
-
feedbackTextColorWarning: string;
|
|
234
|
-
feedbackTextColor: string;
|
|
235
|
-
feedbackPadding: string;
|
|
236
|
-
feedbackHeightSmall: string;
|
|
237
|
-
feedbackHeightMedium: string;
|
|
238
|
-
feedbackHeightLarge: string;
|
|
239
|
-
feedbackFontSizeSmall: string;
|
|
240
|
-
feedbackFontSizeMedium: string;
|
|
241
|
-
feedbackFontSizeLarge: string;
|
|
242
|
-
labelFontSizeLeftSmall: string;
|
|
243
|
-
labelFontSizeLeftMedium: string;
|
|
244
|
-
labelFontSizeLeftLarge: string;
|
|
245
|
-
labelFontSizeTopSmall: string;
|
|
246
|
-
labelFontSizeTopMedium: string;
|
|
247
|
-
labelFontSizeTopLarge: string;
|
|
248
|
-
labelHeightSmall: string;
|
|
249
|
-
labelHeightMedium: string;
|
|
250
|
-
labelHeightLarge: string;
|
|
251
|
-
labelPaddingVertical: string;
|
|
252
|
-
labelPaddingHorizontal: string;
|
|
253
|
-
labelTextAlignVertical: string;
|
|
254
|
-
labelTextAlignHorizontal: string;
|
|
255
|
-
}, any>>>;
|
|
256
|
-
readonly builtinThemeOverrides: import("vue").PropType<import("naive-ui/es/_mixins/use-theme").ExtractThemeOverrides<import("naive-ui/es/_mixins").Theme<"Form", {
|
|
257
|
-
blankHeightSmall: string;
|
|
258
|
-
blankHeightMedium: string;
|
|
259
|
-
blankHeightLarge: string;
|
|
260
|
-
lineHeight: string;
|
|
261
|
-
labelTextColor: string;
|
|
262
|
-
asteriskColor: string;
|
|
263
|
-
feedbackTextColorError: string;
|
|
264
|
-
feedbackTextColorWarning: string;
|
|
265
|
-
feedbackTextColor: string;
|
|
266
|
-
feedbackPadding: string;
|
|
267
|
-
feedbackHeightSmall: string;
|
|
268
|
-
feedbackHeightMedium: string;
|
|
269
|
-
feedbackHeightLarge: string;
|
|
270
|
-
feedbackFontSizeSmall: string;
|
|
271
|
-
feedbackFontSizeMedium: string;
|
|
272
|
-
feedbackFontSizeLarge: string;
|
|
273
|
-
labelFontSizeLeftSmall: string;
|
|
274
|
-
labelFontSizeLeftMedium: string;
|
|
275
|
-
labelFontSizeLeftLarge: string;
|
|
276
|
-
labelFontSizeTopSmall: string;
|
|
277
|
-
labelFontSizeTopMedium: string;
|
|
278
|
-
labelFontSizeTopLarge: string;
|
|
279
|
-
labelHeightSmall: string;
|
|
280
|
-
labelHeightMedium: string;
|
|
281
|
-
labelHeightLarge: string;
|
|
282
|
-
labelPaddingVertical: string;
|
|
283
|
-
labelPaddingHorizontal: string;
|
|
284
|
-
labelTextAlignVertical: string;
|
|
285
|
-
labelTextAlignHorizontal: string;
|
|
286
|
-
}, any>>>;
|
|
287
|
-
}>>, {
|
|
288
|
-
readonly required: boolean;
|
|
289
|
-
readonly first: boolean;
|
|
290
|
-
readonly showRequireMark: boolean | undefined;
|
|
291
|
-
readonly showFeedback: boolean | undefined;
|
|
292
|
-
readonly showLabel: boolean | undefined;
|
|
293
|
-
readonly ignorePathChange: boolean;
|
|
294
|
-
}>;
|
|
2
|
+
label: StringConstructor;
|
|
3
|
+
propertyKey: StringConstructor;
|
|
4
|
+
annotation: {};
|
|
5
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
6
|
+
label: StringConstructor;
|
|
7
|
+
propertyKey: StringConstructor;
|
|
8
|
+
annotation: {};
|
|
9
|
+
}>>, {}>;
|
|
@@ -1,8 +1,143 @@
|
|
|
1
|
+
import { defineComponent, inject, computed, ref, createVNode } from 'vue';
|
|
1
2
|
import { isVoidField } from '@formily/core';
|
|
2
3
|
import { connect, mapProps } from '@formily/vue';
|
|
3
|
-
import {
|
|
4
|
+
import { FileTrayFull, FileTray } from '@vicons/ionicons5';
|
|
5
|
+
import { isBoolean } from 'lodash-es';
|
|
6
|
+
import { NFormItem, NPopover, NIcon, NInput } from 'naive-ui';
|
|
7
|
+
import { InjectionAnnotation } from '../../../../../packages/form-render/src/constants';
|
|
4
8
|
|
|
5
|
-
const
|
|
9
|
+
const script = defineComponent({
|
|
10
|
+
props: {
|
|
11
|
+
label: String,
|
|
12
|
+
propertyKey: String,
|
|
13
|
+
annotation: {}
|
|
14
|
+
},
|
|
15
|
+
setup(props, {
|
|
16
|
+
slots
|
|
17
|
+
}) {
|
|
18
|
+
const annotation = inject(InjectionAnnotation);
|
|
19
|
+
const annotationContent = computed({
|
|
20
|
+
get() {
|
|
21
|
+
return annotation.value[props.propertyKey];
|
|
22
|
+
},
|
|
23
|
+
set(value) {
|
|
24
|
+
annotation.value = {
|
|
25
|
+
property: props.propertyKey,
|
|
26
|
+
value
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
function renderTextarea() {
|
|
31
|
+
return createVNode(NInput, {
|
|
32
|
+
"type": "textarea",
|
|
33
|
+
"value": annotationContent.value,
|
|
34
|
+
"onUpdate:value": ($event) => annotationContent.value = $event
|
|
35
|
+
}, null);
|
|
36
|
+
}
|
|
37
|
+
const __showPopper = ref(false);
|
|
38
|
+
const showPopper = computed({
|
|
39
|
+
get() {
|
|
40
|
+
return __showPopper.value;
|
|
41
|
+
},
|
|
42
|
+
async set(value) {
|
|
43
|
+
__showPopper.value = value;
|
|
44
|
+
if (!value && isEdit.value) {
|
|
45
|
+
await new Promise((resolve) => setTimeout(resolve, 200));
|
|
46
|
+
isEdit.value = false;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
const isEdit = ref(false);
|
|
51
|
+
let clickTimer;
|
|
52
|
+
function iconClick() {
|
|
53
|
+
clearTimeout(clickTimer);
|
|
54
|
+
if (showPopper.value && isEdit.value) {
|
|
55
|
+
showPopper.value = false;
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
clickTimer = setTimeout(() => {
|
|
59
|
+
if (!annotationContent.value) {
|
|
60
|
+
isEdit.value = showPopper.value = true;
|
|
61
|
+
}
|
|
62
|
+
}, 200);
|
|
63
|
+
}
|
|
64
|
+
function iconDbClick() {
|
|
65
|
+
clearTimeout(clickTimer);
|
|
66
|
+
if (!annotationContent.value)
|
|
67
|
+
return;
|
|
68
|
+
showPopper.value = true;
|
|
69
|
+
isEdit.value = true;
|
|
70
|
+
}
|
|
71
|
+
function iconMouseenter() {
|
|
72
|
+
if (!annotationContent.value)
|
|
73
|
+
return;
|
|
74
|
+
showPopper.value = true;
|
|
75
|
+
}
|
|
76
|
+
function iconMouseleave() {
|
|
77
|
+
if (!annotationContent.value || isEdit.value)
|
|
78
|
+
return;
|
|
79
|
+
showPopper.value = false;
|
|
80
|
+
}
|
|
81
|
+
function renderAnnotation() {
|
|
82
|
+
return createVNode("section", {
|
|
83
|
+
"class": ["form-render__formItemLabel--annotation", {
|
|
84
|
+
"is-active": !!annotationContent.value
|
|
85
|
+
}],
|
|
86
|
+
"style": {
|
|
87
|
+
"--icon-right": "-5"
|
|
88
|
+
},
|
|
89
|
+
"form-item-hover-show": !annotationContent.value && !isEdit.value
|
|
90
|
+
}, [createVNode(NPopover, {
|
|
91
|
+
"style": {
|
|
92
|
+
maxWidth: "200px",
|
|
93
|
+
wordBreak: "break-all"
|
|
94
|
+
},
|
|
95
|
+
"show": showPopper.value,
|
|
96
|
+
"onUpdate:show": ($event) => showPopper.value = $event,
|
|
97
|
+
"trigger": "manual",
|
|
98
|
+
"duration": 100
|
|
99
|
+
}, {
|
|
100
|
+
default: renderDefault,
|
|
101
|
+
trigger: renderTrigger
|
|
102
|
+
})]);
|
|
103
|
+
function renderText() {
|
|
104
|
+
return createVNode("span", null, [annotationContent.value]);
|
|
105
|
+
}
|
|
106
|
+
function renderDefault() {
|
|
107
|
+
return createVNode("div", null, [isEdit.value ? renderTextarea() : renderText()]);
|
|
108
|
+
}
|
|
109
|
+
function renderTrigger() {
|
|
110
|
+
return createVNode("div", {
|
|
111
|
+
"class": "form-render__formItemLabel--icon",
|
|
112
|
+
"onMouseleave": iconMouseleave,
|
|
113
|
+
"onMouseenter": iconMouseenter,
|
|
114
|
+
"onDblclick": iconDbClick,
|
|
115
|
+
"onClick": iconClick
|
|
116
|
+
}, [createVNode(NIcon, {
|
|
117
|
+
"component": annotationContent.value ? FileTrayFull : FileTray
|
|
118
|
+
}, null)]);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
const showAnnotation = computed(() => {
|
|
122
|
+
return annotation.value && (!isBoolean(props.annotation) || props.annotation);
|
|
123
|
+
});
|
|
124
|
+
const showLabel = computed(() => props.label && props.label !== " ");
|
|
125
|
+
function renderLabel() {
|
|
126
|
+
return showLabel.value ? createVNode("section", {
|
|
127
|
+
"class": "form-render__formItemLabel"
|
|
128
|
+
}, [createVNode("span", {
|
|
129
|
+
"class": ["form-render__formItemLabel--text", {
|
|
130
|
+
"has-annotation": showAnnotation.value
|
|
131
|
+
}]
|
|
132
|
+
}, [props.label]), showAnnotation.value ? renderAnnotation() : null]) : null;
|
|
133
|
+
}
|
|
134
|
+
return () => createVNode(NFormItem, null, {
|
|
135
|
+
...slots,
|
|
136
|
+
label: renderLabel
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
const FORM_ITEM = connect(script, mapProps({
|
|
6
141
|
title: "label"
|
|
7
142
|
}, (props, field) => {
|
|
8
143
|
var _a;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, computed, createVNode, Fragment } from 'vue';
|
|
2
|
-
import { assignUpdateValue } from '../../utils/index.js';
|
|
2
|
+
import { createSlot, assignUpdateValue } from '../../utils/index.js';
|
|
3
3
|
import { connect, mapProps } from '@formily/vue';
|
|
4
4
|
import { NInput } from 'naive-ui';
|
|
5
5
|
|
|
@@ -19,10 +19,10 @@ const script = defineComponent({
|
|
|
19
19
|
const _slots = computed(() => {
|
|
20
20
|
const res = {};
|
|
21
21
|
if (props.prefix) {
|
|
22
|
-
res.prefix = () => createVNode(Fragment, null, [props.prefix]);
|
|
22
|
+
res.prefix = () => createVNode(Fragment, null, [createSlot(props.prefix, props).default()]);
|
|
23
23
|
}
|
|
24
24
|
if (props.suffix) {
|
|
25
|
-
res.suffix = () => createVNode(Fragment, null, [props.suffix]);
|
|
25
|
+
res.suffix = () => createVNode(Fragment, null, [createSlot(props.suffix, props).default()]);
|
|
26
26
|
}
|
|
27
27
|
return res;
|
|
28
28
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyObject } from '../../../../../../es/src/types';
|
|
1
|
+
import { AnyObject, Func } from '../../../../../../es/src/types';
|
|
2
2
|
import { FormRequestType } from '../../types';
|
|
3
3
|
import { PropType } from 'vue';
|
|
4
4
|
declare type UrlConfig = {
|
|
@@ -20,9 +20,10 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
20
20
|
urlConfig: {
|
|
21
21
|
type: PropType<UrlConfig>;
|
|
22
22
|
};
|
|
23
|
-
|
|
24
|
-
type:
|
|
23
|
+
onFocus: {
|
|
24
|
+
type: PropType<Func<any[], any>>;
|
|
25
25
|
};
|
|
26
|
+
onChange: {};
|
|
26
27
|
}, () => 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<{
|
|
27
28
|
value: {
|
|
28
29
|
type: StringConstructor;
|
|
@@ -34,9 +35,10 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
34
35
|
urlConfig: {
|
|
35
36
|
type: PropType<UrlConfig>;
|
|
36
37
|
};
|
|
37
|
-
|
|
38
|
-
type:
|
|
38
|
+
onFocus: {
|
|
39
|
+
type: PropType<Func<any[], any>>;
|
|
39
40
|
};
|
|
41
|
+
onChange: {};
|
|
40
42
|
}>> & {
|
|
41
43
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
42
44
|
}, {
|