cnhis-design-vue 3.1.23-beta.6 → 3.1.23-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/fabric-chart/src/components/PopupMenu.js +1 -1
- package/es/components/fabric-chart/src/hooks/useCenter2.js +9 -4
- package/es/components/form-config/index.d.ts +6 -0
- package/es/components/form-config/src/FormConfig.vue.d.ts +6 -0
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +6 -0
- package/es/components/form-render/index2.js +2 -1
- package/es/components/form-render/src/components/renderer/index.d.ts +2 -1
- package/es/components/form-render/src/components/renderer/index.js +2 -1
- package/es/components/form-render/src/components/renderer/index2.js +2 -1
- package/es/components/form-render/src/components/renderer/levelSearchCascade.d.ts +86 -0
- package/es/components/form-render/src/components/renderer/levelSearchCascade.js +227 -0
- package/es/components/form-render/src/components/renderer/search.d.ts +13 -1
- package/es/components/form-render/src/components/renderer/search.js +2 -1
- package/es/components/form-render/src/components/renderer/{cascader.d.ts → searchCascade.d.ts} +0 -0
- package/es/components/form-render/src/components/renderer/{cascader.js → searchCascade.js} +1 -0
- package/es/components/form-render/src/components/renderer/select.js +2 -1
- package/es/components/form-render/src/hooks/useAsyncQueue2.js +5 -4
- package/es/components/form-render/src/hooks/useFieldListAdaptor2.js +11 -4
- package/es/components/form-render/src/hooks/useFormRequest.d.ts +2 -0
- package/es/components/form-render/src/hooks/useFormRequest2.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +6 -0
- package/es/components/iho-table/index.d.ts +0 -1
- package/es/components/iho-table/src/IhoTable.vue.d.ts +0 -1
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index2.js +11 -8
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/edit-separate.js +18 -20
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/edit-separate.vue.d.ts +1 -17
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +9 -5
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/separate-utils2.js +2 -2
- package/es/components/iho-table/src/types/index.d.ts +0 -3
- package/es/components/index.css +1 -1
- package/es/components/search-cascader/index.d.ts +79 -6
- package/es/components/search-cascader/src/SearchCascader.js +29 -43
- package/es/components/search-cascader/src/SearchCascader.vue.d.ts +83 -9
- package/es/components/search-cascader/src/components/SearchMenu.d.ts +9 -0
- package/es/components/search-cascader/src/components/SearchMenu.js +11 -2
- package/es/components/search-cascader/style/index.css +1 -1
- package/es/components/shortcut-provider/src/ShortcutProvider.js +2 -1
- package/es/components/shortcut-setter/index.d.ts +6 -0
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +6 -0
- package/es/shared/components/no-data/NoData.js +74 -0
- package/es/shared/components/no-data/NoData.vue.d.ts +51 -0
- package/es/shared/components/no-data/index.d.ts +2 -0
- package/es/shared/components/no-data/index.js +1 -0
- package/es/shared/components/no-data/index2.js +2 -0
- package/package.json +2 -2
- package/es/components/form-render/src/components/renderer/searchCascader.d.ts +0 -51
|
@@ -15,9 +15,28 @@ declare const SearchCascader: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
15
15
|
type: StringConstructor;
|
|
16
16
|
default: string;
|
|
17
17
|
};
|
|
18
|
-
|
|
18
|
+
editPlaceholder: {
|
|
19
|
+
type: StringConstructor;
|
|
20
|
+
default: string;
|
|
21
|
+
};
|
|
22
|
+
options: {
|
|
23
|
+
type: import("vue").PropType<import("../../../es/shared/types").AnyObject[]>;
|
|
24
|
+
default: () => never[];
|
|
25
|
+
};
|
|
26
|
+
search: {
|
|
19
27
|
type: import("vue").PropType<import("../../../es/shared/types").Func<any[], any>>;
|
|
20
28
|
};
|
|
29
|
+
labelKey: {
|
|
30
|
+
type: StringConstructor;
|
|
31
|
+
default: string;
|
|
32
|
+
};
|
|
33
|
+
valueKey: {
|
|
34
|
+
type: StringConstructor;
|
|
35
|
+
default: string;
|
|
36
|
+
};
|
|
37
|
+
beforeSetValue: {
|
|
38
|
+
type: import("vue").PropType<(value: string | import("../../../es/shared/types").AnyObject[]) => void | (string | import("../../../es/shared/types").AnyObject[]) | Promise<string | import("../../../es/shared/types").AnyObject[]>>;
|
|
39
|
+
};
|
|
21
40
|
}, {
|
|
22
41
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
23
42
|
value: {
|
|
@@ -35,22 +54,43 @@ declare const SearchCascader: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
35
54
|
type: StringConstructor;
|
|
36
55
|
default: string;
|
|
37
56
|
};
|
|
38
|
-
|
|
57
|
+
editPlaceholder: {
|
|
58
|
+
type: StringConstructor;
|
|
59
|
+
default: string;
|
|
60
|
+
};
|
|
61
|
+
options: {
|
|
62
|
+
type: import("vue").PropType<import("../../../es/shared/types").AnyObject[]>;
|
|
63
|
+
default: () => never[];
|
|
64
|
+
};
|
|
65
|
+
search: {
|
|
39
66
|
type: import("vue").PropType<import("../../../es/shared/types").Func<any[], any>>;
|
|
40
67
|
};
|
|
68
|
+
labelKey: {
|
|
69
|
+
type: StringConstructor;
|
|
70
|
+
default: string;
|
|
71
|
+
};
|
|
72
|
+
valueKey: {
|
|
73
|
+
type: StringConstructor;
|
|
74
|
+
default: string;
|
|
75
|
+
};
|
|
76
|
+
beforeSetValue: {
|
|
77
|
+
type: import("vue").PropType<(value: string | import("../../../es/shared/types").AnyObject[]) => void | (string | import("../../../es/shared/types").AnyObject[]) | Promise<string | import("../../../es/shared/types").AnyObject[]>>;
|
|
78
|
+
};
|
|
41
79
|
}>> & {
|
|
80
|
+
onFocus?: ((...args: any[]) => any) | undefined;
|
|
42
81
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
43
82
|
}>>;
|
|
44
|
-
emits: (event: "update:value", ...args: any[]) => void;
|
|
83
|
+
emits: (event: "update:value" | "focus", ...args: any[]) => void;
|
|
84
|
+
emitValue: (value: string | import("../../../es/shared/types").AnyObject[]) => void;
|
|
45
85
|
onClear: () => void;
|
|
46
86
|
cssVariable: {
|
|
47
87
|
'--menu-width': number;
|
|
48
88
|
};
|
|
49
|
-
optionsRef: import("vue").Ref<import("../../../es/shared/types").AnyObject[]>;
|
|
50
89
|
uuid: string;
|
|
51
90
|
show: import("vue").Ref<boolean>;
|
|
52
91
|
patternContent: import("vue").Ref<string>;
|
|
53
92
|
displayValue: import("vue").WritableComputedRef<string>;
|
|
93
|
+
onFocus: (focusEvt: Event) => void;
|
|
54
94
|
openMenu: () => void;
|
|
55
95
|
closeMenu: () => Promise<void>;
|
|
56
96
|
inputRef: import("vue").Ref<any>;
|
|
@@ -72,6 +112,10 @@ declare const SearchCascader: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
72
112
|
onNodeClick: {
|
|
73
113
|
type: import("vue").PropType<import("../../../es/shared/types").Func<any[], any>>;
|
|
74
114
|
};
|
|
115
|
+
labelKey: {
|
|
116
|
+
type: StringConstructor;
|
|
117
|
+
default: string;
|
|
118
|
+
};
|
|
75
119
|
currentNode: {
|
|
76
120
|
type: import("vue").PropType<import("../../../es/shared/types").AnyObject>;
|
|
77
121
|
};
|
|
@@ -87,14 +131,19 @@ declare const SearchCascader: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
87
131
|
onNodeClick: {
|
|
88
132
|
type: import("vue").PropType<import("../../../es/shared/types").Func<any[], any>>;
|
|
89
133
|
};
|
|
134
|
+
labelKey: {
|
|
135
|
+
type: StringConstructor;
|
|
136
|
+
default: string;
|
|
137
|
+
};
|
|
90
138
|
currentNode: {
|
|
91
139
|
type: import("vue").PropType<import("../../../es/shared/types").AnyObject>;
|
|
92
140
|
};
|
|
93
141
|
}>>, {
|
|
94
142
|
options: import("../../../es/shared/types").AnyObject[];
|
|
95
143
|
childKey: string;
|
|
144
|
+
labelKey: string;
|
|
96
145
|
}>;
|
|
97
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
146
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:value" | "focus")[], "focus" | "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
98
147
|
value: {
|
|
99
148
|
type: import("vue").PropType<string | import("../../../es/shared/types").AnyObject[]>;
|
|
100
149
|
};
|
|
@@ -110,14 +159,38 @@ declare const SearchCascader: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
110
159
|
type: StringConstructor;
|
|
111
160
|
default: string;
|
|
112
161
|
};
|
|
113
|
-
|
|
162
|
+
editPlaceholder: {
|
|
163
|
+
type: StringConstructor;
|
|
164
|
+
default: string;
|
|
165
|
+
};
|
|
166
|
+
options: {
|
|
167
|
+
type: import("vue").PropType<import("../../../es/shared/types").AnyObject[]>;
|
|
168
|
+
default: () => never[];
|
|
169
|
+
};
|
|
170
|
+
search: {
|
|
114
171
|
type: import("vue").PropType<import("../../../es/shared/types").Func<any[], any>>;
|
|
115
172
|
};
|
|
173
|
+
labelKey: {
|
|
174
|
+
type: StringConstructor;
|
|
175
|
+
default: string;
|
|
176
|
+
};
|
|
177
|
+
valueKey: {
|
|
178
|
+
type: StringConstructor;
|
|
179
|
+
default: string;
|
|
180
|
+
};
|
|
181
|
+
beforeSetValue: {
|
|
182
|
+
type: import("vue").PropType<(value: string | import("../../../es/shared/types").AnyObject[]) => void | (string | import("../../../es/shared/types").AnyObject[]) | Promise<string | import("../../../es/shared/types").AnyObject[]>>;
|
|
183
|
+
};
|
|
116
184
|
}>> & {
|
|
185
|
+
onFocus?: ((...args: any[]) => any) | undefined;
|
|
117
186
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
118
187
|
}, {
|
|
188
|
+
options: import("../../../es/shared/types").AnyObject[];
|
|
119
189
|
placeholder: string;
|
|
190
|
+
valueKey: string;
|
|
120
191
|
clearable: boolean;
|
|
121
192
|
childKey: string;
|
|
193
|
+
editPlaceholder: string;
|
|
194
|
+
labelKey: string;
|
|
122
195
|
}>>;
|
|
123
196
|
export default SearchCascader;
|
|
@@ -5,7 +5,6 @@ import { isString, isArray, isFunction } from 'lodash-es';
|
|
|
5
5
|
import { NPopover, NInput } from 'naive-ui';
|
|
6
6
|
import { InjectionSearchCascaderLoadingNode } from './constants/index2.js';
|
|
7
7
|
import { useCssVariable } from './hooks/useCssVariable2.js';
|
|
8
|
-
import { getParentNodeList } from './utils/index2.js';
|
|
9
8
|
import { SearchMenu } from './components/SearchMenu.js';
|
|
10
9
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.js';
|
|
11
10
|
|
|
@@ -17,16 +16,26 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
17
16
|
clearable: { type: Boolean, default: false },
|
|
18
17
|
childKey: { type: String, default: "children" },
|
|
19
18
|
placeholder: { type: String, default: "\u8BF7\u9009\u62E9" },
|
|
20
|
-
|
|
19
|
+
editPlaceholder: { type: String, default: "\u8BF7\u8F93\u5165\u5173\u952E\u5B57\u8FDB\u884C\u641C\u7D22" },
|
|
20
|
+
options: { type: Array, default: () => [] },
|
|
21
|
+
search: { type: Function },
|
|
22
|
+
labelKey: { type: String, default: "label" },
|
|
23
|
+
valueKey: { type: String, default: "value" },
|
|
24
|
+
beforeSetValue: { type: Function }
|
|
21
25
|
},
|
|
22
|
-
emits: ["update:value"],
|
|
23
|
-
setup(__props, {
|
|
26
|
+
emits: ["update:value", "focus"],
|
|
27
|
+
setup(__props, { emit: emits }) {
|
|
24
28
|
const props = __props;
|
|
29
|
+
function emitValue(value) {
|
|
30
|
+
Promise.resolve(isFunction(props.beforeSetValue) ? props.beforeSetValue(value) : value).then((result) => {
|
|
31
|
+
emits("update:value", result);
|
|
32
|
+
}, () => {
|
|
33
|
+
});
|
|
34
|
+
}
|
|
25
35
|
function onClear() {
|
|
26
|
-
|
|
36
|
+
emitValue([]);
|
|
27
37
|
}
|
|
28
38
|
const cssVariable = useCssVariable();
|
|
29
|
-
const optionsRef = ref([{}]);
|
|
30
39
|
const uuid = uuidGenerator();
|
|
31
40
|
const show = ref(false);
|
|
32
41
|
const patternContent = ref("");
|
|
@@ -42,8 +51,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
42
51
|
function arrayOptionsToString(optionList) {
|
|
43
52
|
return optionList.reduce((res, item, idx) => {
|
|
44
53
|
if (idx === 0)
|
|
45
|
-
return item.
|
|
46
|
-
return res + " / " + item.
|
|
54
|
+
return item[props.labelKey];
|
|
55
|
+
return res + " / " + item[props.labelKey];
|
|
47
56
|
}, "");
|
|
48
57
|
}
|
|
49
58
|
},
|
|
@@ -52,10 +61,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
52
61
|
search(void 0, value);
|
|
53
62
|
}
|
|
54
63
|
});
|
|
64
|
+
function onFocus(focusEvt) {
|
|
65
|
+
emits("focus", focusEvt);
|
|
66
|
+
openMenu();
|
|
67
|
+
}
|
|
55
68
|
function openMenu() {
|
|
56
69
|
if (show.value)
|
|
57
70
|
return;
|
|
58
|
-
optionsRef.value = [];
|
|
59
71
|
show.value = true;
|
|
60
72
|
patternContent.value = "";
|
|
61
73
|
search();
|
|
@@ -96,43 +108,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
96
108
|
provide(InjectionSearchCascaderLoadingNode, loadingNode);
|
|
97
109
|
const search = useDebounceFn(async (node, keyword) => {
|
|
98
110
|
var _a;
|
|
99
|
-
if (!isFunction(props.fetchOptions)) {
|
|
100
|
-
emits("update:value", node ? [node] : []);
|
|
101
|
-
return closeMenu();
|
|
102
|
-
}
|
|
103
|
-
loadingNode.value = node;
|
|
104
111
|
try {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
if (!node)
|
|
108
|
-
return;
|
|
109
|
-
node.isLeaf = true;
|
|
110
|
-
emits("update:value", getParentNodeList(node));
|
|
111
|
-
return closeMenu();
|
|
112
|
-
}
|
|
113
|
-
if (node) {
|
|
114
|
-
node[props.childKey] = options.map((option) => enrichOption(option, node));
|
|
115
|
-
} else {
|
|
116
|
-
optionsRef.value = options;
|
|
117
|
-
}
|
|
112
|
+
loadingNode.value = node;
|
|
113
|
+
await (isFunction(props.search) && props.search(node, keyword));
|
|
118
114
|
currentNode.value = node;
|
|
119
115
|
} finally {
|
|
120
116
|
loadingNode.value = null;
|
|
121
117
|
await nextTick();
|
|
122
118
|
(_a = popoverRef.value) == null ? void 0 : _a.syncPosition();
|
|
123
119
|
}
|
|
124
|
-
function enrichOption(option, parent) {
|
|
125
|
-
return { ...option, parent };
|
|
126
|
-
}
|
|
127
|
-
function isValidOption(options) {
|
|
128
|
-
return isArray(options) && !!options.length;
|
|
129
|
-
}
|
|
130
120
|
}, 400);
|
|
131
|
-
expose({
|
|
132
|
-
setOptions(options) {
|
|
133
|
-
optionsRef.value = options;
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
121
|
return (_ctx, _cache) => {
|
|
137
122
|
return openBlock(), createBlock(unref(NPopover), {
|
|
138
123
|
class: "search-cascader",
|
|
@@ -142,26 +127,27 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
142
127
|
"show-arrow": false,
|
|
143
128
|
placement: "bottom-start",
|
|
144
129
|
style: normalizeStyle(unref(cssVariable)),
|
|
145
|
-
width:
|
|
130
|
+
width: __props.options.length ? void 0 : "trigger",
|
|
146
131
|
ref_key: "popoverRef",
|
|
147
132
|
ref: popoverRef
|
|
148
133
|
}, {
|
|
149
134
|
trigger: withCtx(() => [
|
|
150
135
|
createVNode(unref(NInput), {
|
|
151
|
-
placeholder: __props.placeholder,
|
|
136
|
+
placeholder: show.value ? __props.editPlaceholder : __props.placeholder,
|
|
152
137
|
clearable: __props.clearable,
|
|
153
138
|
onClear,
|
|
154
139
|
value: unref(displayValue),
|
|
155
140
|
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => isRef(displayValue) ? displayValue.value = $event : null),
|
|
156
141
|
ref_key: "inputRef",
|
|
157
142
|
ref: inputRef,
|
|
158
|
-
onFocus
|
|
143
|
+
onFocus
|
|
159
144
|
}, null, 8, ["placeholder", "clearable", "value"])
|
|
160
145
|
]),
|
|
161
146
|
default: withCtx(() => [
|
|
162
147
|
createElementVNode("section", { id: unref(uuid) }, [
|
|
163
148
|
createVNode(unref(SearchMenu), {
|
|
164
|
-
|
|
149
|
+
"label-key": __props.labelKey,
|
|
150
|
+
options: __props.options,
|
|
165
151
|
onNodeClick: unref(search),
|
|
166
152
|
"current-node": currentNode.value
|
|
167
153
|
}, {
|
|
@@ -169,7 +155,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
169
155
|
renderSlot(_ctx.$slots, "empty")
|
|
170
156
|
]),
|
|
171
157
|
_: 3
|
|
172
|
-
}, 8, ["options", "onNodeClick", "current-node"])
|
|
158
|
+
}, 8, ["label-key", "options", "onNodeClick", "current-node"])
|
|
173
159
|
], 8, _hoisted_1)
|
|
174
160
|
]),
|
|
175
161
|
_: 3
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { AnyObject, Func, Nullable } from '../../../../es/shared/types';
|
|
2
2
|
import { PropType } from 'vue';
|
|
3
|
+
declare type ValueType = string | AnyObject[];
|
|
3
4
|
declare const _default: import("vue").DefineComponent<{
|
|
4
5
|
value: {
|
|
5
|
-
type: PropType<
|
|
6
|
+
type: PropType<ValueType>;
|
|
6
7
|
};
|
|
7
8
|
clearable: {
|
|
8
9
|
type: BooleanConstructor;
|
|
@@ -16,13 +17,32 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
16
17
|
type: StringConstructor;
|
|
17
18
|
default: string;
|
|
18
19
|
};
|
|
19
|
-
|
|
20
|
+
editPlaceholder: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
options: {
|
|
25
|
+
type: PropType<AnyObject[]>;
|
|
26
|
+
default: () => never[];
|
|
27
|
+
};
|
|
28
|
+
search: {
|
|
20
29
|
type: PropType<Func<any[], any>>;
|
|
21
30
|
};
|
|
31
|
+
labelKey: {
|
|
32
|
+
type: StringConstructor;
|
|
33
|
+
default: string;
|
|
34
|
+
};
|
|
35
|
+
valueKey: {
|
|
36
|
+
type: StringConstructor;
|
|
37
|
+
default: string;
|
|
38
|
+
};
|
|
39
|
+
beforeSetValue: {
|
|
40
|
+
type: PropType<(value: ValueType) => void | ValueType | Promise<ValueType>>;
|
|
41
|
+
};
|
|
22
42
|
}, {
|
|
23
43
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
24
44
|
value: {
|
|
25
|
-
type: PropType<
|
|
45
|
+
type: PropType<ValueType>;
|
|
26
46
|
};
|
|
27
47
|
clearable: {
|
|
28
48
|
type: BooleanConstructor;
|
|
@@ -36,22 +56,43 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
36
56
|
type: StringConstructor;
|
|
37
57
|
default: string;
|
|
38
58
|
};
|
|
39
|
-
|
|
59
|
+
editPlaceholder: {
|
|
60
|
+
type: StringConstructor;
|
|
61
|
+
default: string;
|
|
62
|
+
};
|
|
63
|
+
options: {
|
|
64
|
+
type: PropType<AnyObject[]>;
|
|
65
|
+
default: () => never[];
|
|
66
|
+
};
|
|
67
|
+
search: {
|
|
40
68
|
type: PropType<Func<any[], any>>;
|
|
41
69
|
};
|
|
70
|
+
labelKey: {
|
|
71
|
+
type: StringConstructor;
|
|
72
|
+
default: string;
|
|
73
|
+
};
|
|
74
|
+
valueKey: {
|
|
75
|
+
type: StringConstructor;
|
|
76
|
+
default: string;
|
|
77
|
+
};
|
|
78
|
+
beforeSetValue: {
|
|
79
|
+
type: PropType<(value: ValueType) => void | ValueType | Promise<ValueType>>;
|
|
80
|
+
};
|
|
42
81
|
}>> & {
|
|
82
|
+
onFocus?: ((...args: any[]) => any) | undefined;
|
|
43
83
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
44
84
|
}>>;
|
|
45
|
-
emits: (event: "update:value", ...args: any[]) => void;
|
|
85
|
+
emits: (event: "update:value" | "focus", ...args: any[]) => void;
|
|
86
|
+
emitValue: (value: ValueType) => void;
|
|
46
87
|
onClear: () => void;
|
|
47
88
|
cssVariable: {
|
|
48
89
|
'--menu-width': number;
|
|
49
90
|
};
|
|
50
|
-
optionsRef: import("vue").Ref<AnyObject[]>;
|
|
51
91
|
uuid: string;
|
|
52
92
|
show: import("vue").Ref<boolean>;
|
|
53
93
|
patternContent: import("vue").Ref<string>;
|
|
54
94
|
displayValue: import("vue").WritableComputedRef<string>;
|
|
95
|
+
onFocus: (focusEvt: Event) => void;
|
|
55
96
|
openMenu: () => void;
|
|
56
97
|
closeMenu: () => Promise<void>;
|
|
57
98
|
inputRef: import("vue").Ref<any>;
|
|
@@ -73,6 +114,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
73
114
|
onNodeClick: {
|
|
74
115
|
type: PropType<Func<any[], any>>;
|
|
75
116
|
};
|
|
117
|
+
labelKey: {
|
|
118
|
+
type: StringConstructor;
|
|
119
|
+
default: string;
|
|
120
|
+
};
|
|
76
121
|
currentNode: {
|
|
77
122
|
type: PropType<AnyObject>;
|
|
78
123
|
};
|
|
@@ -88,16 +133,21 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
88
133
|
onNodeClick: {
|
|
89
134
|
type: PropType<Func<any[], any>>;
|
|
90
135
|
};
|
|
136
|
+
labelKey: {
|
|
137
|
+
type: StringConstructor;
|
|
138
|
+
default: string;
|
|
139
|
+
};
|
|
91
140
|
currentNode: {
|
|
92
141
|
type: PropType<AnyObject>;
|
|
93
142
|
};
|
|
94
143
|
}>>, {
|
|
95
144
|
options: AnyObject[];
|
|
96
145
|
childKey: string;
|
|
146
|
+
labelKey: string;
|
|
97
147
|
}>;
|
|
98
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
148
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:value" | "focus")[], "focus" | "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
99
149
|
value: {
|
|
100
|
-
type: PropType<
|
|
150
|
+
type: PropType<ValueType>;
|
|
101
151
|
};
|
|
102
152
|
clearable: {
|
|
103
153
|
type: BooleanConstructor;
|
|
@@ -111,14 +161,38 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
111
161
|
type: StringConstructor;
|
|
112
162
|
default: string;
|
|
113
163
|
};
|
|
114
|
-
|
|
164
|
+
editPlaceholder: {
|
|
165
|
+
type: StringConstructor;
|
|
166
|
+
default: string;
|
|
167
|
+
};
|
|
168
|
+
options: {
|
|
169
|
+
type: PropType<AnyObject[]>;
|
|
170
|
+
default: () => never[];
|
|
171
|
+
};
|
|
172
|
+
search: {
|
|
115
173
|
type: PropType<Func<any[], any>>;
|
|
116
174
|
};
|
|
175
|
+
labelKey: {
|
|
176
|
+
type: StringConstructor;
|
|
177
|
+
default: string;
|
|
178
|
+
};
|
|
179
|
+
valueKey: {
|
|
180
|
+
type: StringConstructor;
|
|
181
|
+
default: string;
|
|
182
|
+
};
|
|
183
|
+
beforeSetValue: {
|
|
184
|
+
type: PropType<(value: ValueType) => void | ValueType | Promise<ValueType>>;
|
|
185
|
+
};
|
|
117
186
|
}>> & {
|
|
187
|
+
onFocus?: ((...args: any[]) => any) | undefined;
|
|
118
188
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
119
189
|
}, {
|
|
190
|
+
options: AnyObject[];
|
|
120
191
|
placeholder: string;
|
|
192
|
+
valueKey: string;
|
|
121
193
|
clearable: boolean;
|
|
122
194
|
childKey: string;
|
|
195
|
+
editPlaceholder: string;
|
|
196
|
+
labelKey: string;
|
|
123
197
|
}>;
|
|
124
198
|
export default _default;
|
|
@@ -12,6 +12,10 @@ export declare const SearchMenu: import("vue").DefineComponent<{
|
|
|
12
12
|
onNodeClick: {
|
|
13
13
|
type: PropType<Func<any[], any>>;
|
|
14
14
|
};
|
|
15
|
+
labelKey: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
15
19
|
currentNode: {
|
|
16
20
|
type: PropType<AnyObject>;
|
|
17
21
|
};
|
|
@@ -27,10 +31,15 @@ export declare const SearchMenu: import("vue").DefineComponent<{
|
|
|
27
31
|
onNodeClick: {
|
|
28
32
|
type: PropType<Func<any[], any>>;
|
|
29
33
|
};
|
|
34
|
+
labelKey: {
|
|
35
|
+
type: StringConstructor;
|
|
36
|
+
default: string;
|
|
37
|
+
};
|
|
30
38
|
currentNode: {
|
|
31
39
|
type: PropType<AnyObject>;
|
|
32
40
|
};
|
|
33
41
|
}>>, {
|
|
34
42
|
options: AnyObject[];
|
|
35
43
|
childKey: string;
|
|
44
|
+
labelKey: string;
|
|
36
45
|
}>;
|
|
@@ -14,6 +14,10 @@ const SearchMenuList = defineComponent({
|
|
|
14
14
|
activeNodes: {
|
|
15
15
|
type: Array,
|
|
16
16
|
default: () => []
|
|
17
|
+
},
|
|
18
|
+
labelKey: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: "label"
|
|
17
21
|
}
|
|
18
22
|
},
|
|
19
23
|
emits: ["nodeClick"],
|
|
@@ -45,10 +49,10 @@ const SearchMenuList = defineComponent({
|
|
|
45
49
|
"search-cascader__option--active": (_a = props.activeNodes) == null ? void 0 : _a.includes(item.data)
|
|
46
50
|
}],
|
|
47
51
|
"onClick": () => emit("nodeClick", item.data),
|
|
48
|
-
"title": item.data.
|
|
52
|
+
"title": item.data[props.labelKey]
|
|
49
53
|
}, [createVNode("div", {
|
|
50
54
|
"class": "search-cascader__optionText"
|
|
51
|
-
}, [item.data.
|
|
55
|
+
}, [item.data[props.labelKey]]), loadingNode.value === item.data ? createVNode(Reload, {
|
|
52
56
|
"class": "rotate"
|
|
53
57
|
}, null) : item.data.isLeaf ? null : createVNode(ChevronForward, null, null)]);
|
|
54
58
|
})])]);
|
|
@@ -68,6 +72,10 @@ const SearchMenu = defineComponent({
|
|
|
68
72
|
onNodeClick: {
|
|
69
73
|
type: Function
|
|
70
74
|
},
|
|
75
|
+
labelKey: {
|
|
76
|
+
type: String,
|
|
77
|
+
default: "label"
|
|
78
|
+
},
|
|
71
79
|
currentNode: {
|
|
72
80
|
type: Object
|
|
73
81
|
}
|
|
@@ -78,6 +86,7 @@ const SearchMenu = defineComponent({
|
|
|
78
86
|
const activeNodes = ref([]);
|
|
79
87
|
function renderList(options) {
|
|
80
88
|
return createVNode(SearchMenuList, {
|
|
89
|
+
"labelKey": props.labelKey,
|
|
81
90
|
"activeNodes": activeNodes.value,
|
|
82
91
|
"onNodeClick": props.onNodeClick,
|
|
83
92
|
"options": options
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.search-cascader__menuWrapper{display:flex;flex-wrap:nowrap;margin:-8px -14px}.search-cascader__option{align-items:center;border-radius:4px;box-sizing:border-box;display:flex;height:32px;justify-content:space-between;padding:0 8px 0 16px;width:100%}.search-cascader__option--active{background:#f8f8f8}.search-cascader__option:hover{background:#f5f5f5;cursor:pointer}.search-cascader__optionWrapper{background:#fff;height:256px;overflow-x:auto;width:calc(var(--menu-width)*1px)}.search-cascader__optionWrapper:not(:last-of-type){border:solid #e5e5e5;border-width:0 1px 0 0}.search-cascader__optionText{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:calc(100% - 20px)}.search-cascader__option svg{color:#bfbfbf;flex-shrink:0;font-size:12px;width:20px}.search-cascader__option svg.rotate{animation:rotate 1s linear infinite}.search-cascader__emptyWrapper{align-items:center;background:#fff;box-sizing:border-box;display:flex;height:
|
|
1
|
+
.search-cascader__menuWrapper{display:flex;flex-wrap:nowrap;margin:-8px -14px}.search-cascader__option{align-items:center;border-radius:4px;box-sizing:border-box;display:flex;height:32px;justify-content:space-between;padding:0 8px 0 16px;width:100%}.search-cascader__option--active{background:#f8f8f8}.search-cascader__option:hover{background:#f5f5f5;cursor:pointer}.search-cascader__optionWrapper{background:#fff;height:256px;overflow-x:auto;width:calc(var(--menu-width)*1px)}.search-cascader__optionWrapper:not(:last-of-type){border:solid #e5e5e5;border-width:0 1px 0 0}.search-cascader__optionText{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:calc(100% - 20px)}.search-cascader__option svg{color:#bfbfbf;flex-shrink:0;font-size:12px;width:20px}.search-cascader__option svg.rotate{animation:rotate 1s linear infinite}.search-cascader__emptyWrapper{align-items:center;background:#fff;box-sizing:border-box;display:flex;height:300px;justify-content:center;padding:16px;width:100%}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(1turn)}}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { defineComponent, ref, provide, onBeforeUnmount, openBlock, createElementBlock, renderSlot } from 'vue';
|
|
2
|
+
import { uuidGenerator } from '../../../shared/utils/index2.js';
|
|
2
3
|
import { InjectionShortcutManager } from './constants/index2.js';
|
|
3
4
|
import '../index2.js';
|
|
4
5
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.js';
|
|
@@ -12,7 +13,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
12
13
|
setup(__props) {
|
|
13
14
|
const props = __props;
|
|
14
15
|
const shortcutWrapperRef = ref();
|
|
15
|
-
const manager = new ShortcutManager(shortcutWrapperRef, props.scope ||
|
|
16
|
+
const manager = new ShortcutManager(shortcutWrapperRef, props.scope || uuidGenerator()).start();
|
|
16
17
|
provide(InjectionShortcutManager, manager);
|
|
17
18
|
onBeforeUnmount(() => {
|
|
18
19
|
manager.destroy();
|
|
@@ -100,6 +100,12 @@ declare const ShortcutSetter: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
100
100
|
search_key?: string[] | undefined;
|
|
101
101
|
type?: string | undefined;
|
|
102
102
|
value_key?: string | undefined;
|
|
103
|
+
level_key?: string | undefined;
|
|
104
|
+
link_key?: string | undefined;
|
|
105
|
+
link_key_split?: string | undefined;
|
|
106
|
+
show_key?: string[] | undefined;
|
|
107
|
+
conObj?: import("../../../es/shared/types").AnyObject[] | undefined;
|
|
108
|
+
conObjFirstLevel?: import("../../../es/shared/types").AnyObject[] | undefined;
|
|
103
109
|
} | undefined;
|
|
104
110
|
open?: {
|
|
105
111
|
value?: any;
|
|
@@ -102,6 +102,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
102
102
|
search_key?: string[] | undefined;
|
|
103
103
|
type?: string | undefined;
|
|
104
104
|
value_key?: string | undefined;
|
|
105
|
+
level_key?: string | undefined;
|
|
106
|
+
link_key?: string | undefined;
|
|
107
|
+
link_key_split?: string | undefined;
|
|
108
|
+
show_key?: string[] | undefined;
|
|
109
|
+
conObj?: import("../../../../es/shared/types").AnyObject[] | undefined;
|
|
110
|
+
conObjFirstLevel?: import("../../../../es/shared/types").AnyObject[] | undefined;
|
|
105
111
|
} | undefined;
|
|
106
112
|
open?: {
|
|
107
113
|
value?: any;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { defineComponent, computed, openBlock, createElementBlock, unref, createCommentVNode, createElementVNode, toDisplayString } from 'vue';
|
|
2
|
+
import img$1 from '../../assets/img/nodata.js';
|
|
3
|
+
import img$3 from '../../assets/img/no-permission.js';
|
|
4
|
+
import img$2 from '../../assets/img/failure.js';
|
|
5
|
+
import img from '../../assets/img/notfound.js';
|
|
6
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.js';
|
|
7
|
+
|
|
8
|
+
const _hoisted_1 = { class: "no-data-tip NoData-page" };
|
|
9
|
+
const _hoisted_2 = ["src"];
|
|
10
|
+
const _hoisted_3 = { key: 1 };
|
|
11
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
|
+
__name: "NoData",
|
|
13
|
+
props: {
|
|
14
|
+
noDataTip: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: "\u6682\u65E0\u6570\u636E"
|
|
17
|
+
},
|
|
18
|
+
noDataImg: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: "nodata"
|
|
21
|
+
},
|
|
22
|
+
showImg: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: true
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
setup(__props) {
|
|
28
|
+
const props = __props;
|
|
29
|
+
const imgStr = computed(() => {
|
|
30
|
+
let str = null;
|
|
31
|
+
switch (props.noDataImg) {
|
|
32
|
+
case "no-permission":
|
|
33
|
+
str = img$3;
|
|
34
|
+
break;
|
|
35
|
+
case "failure":
|
|
36
|
+
str = img$2;
|
|
37
|
+
break;
|
|
38
|
+
case "nodata":
|
|
39
|
+
str = img$1;
|
|
40
|
+
break;
|
|
41
|
+
default:
|
|
42
|
+
str = img;
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
return str;
|
|
46
|
+
});
|
|
47
|
+
const handleDesc = computed(() => {
|
|
48
|
+
let res = "";
|
|
49
|
+
switch (props.noDataImg) {
|
|
50
|
+
case "no-permission":
|
|
51
|
+
res = "\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458";
|
|
52
|
+
break;
|
|
53
|
+
case "failure":
|
|
54
|
+
res = "\u8BF7\u7A0D\u540E\u518D\u8BD5";
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
return res;
|
|
58
|
+
});
|
|
59
|
+
return (_ctx, _cache) => {
|
|
60
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
61
|
+
__props.showImg ? (openBlock(), createElementBlock("img", {
|
|
62
|
+
key: 0,
|
|
63
|
+
src: unref(imgStr),
|
|
64
|
+
alt: ""
|
|
65
|
+
}, null, 8, _hoisted_2)) : createCommentVNode("v-if", true),
|
|
66
|
+
createElementVNode("p", null, toDisplayString(__props.noDataTip), 1),
|
|
67
|
+
unref(handleDesc) ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(unref(handleDesc)), 1)) : createCommentVNode("v-if", true)
|
|
68
|
+
]);
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
var script = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "NoData.vue"]]);
|
|
73
|
+
|
|
74
|
+
export { script as default };
|