@94ai/nf-variable-select 8.3.23 → 9.0.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/lib/index.d.ts +593 -593
- package/lib/nf-variable-select.cjs.js +21 -8
- package/lib/nf-variable-select.esm-bundler.js +22 -9
- package/lib/nf-variable-select.vue.d.ts +149 -149
- package/lib/style/css.d.ts +0 -1
- package/lib/style/index.d.ts +0 -1
- package/lib/types.d.ts +10 -10
- package/package/nf-variable-select.vue +14 -5
- package/package.json +5 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
-
const vueDemi = require("vue-demi");
|
|
4
3
|
const commonUtils = require("@94ai/common-utils");
|
|
4
|
+
const vueDemi = require("vue-demi");
|
|
5
5
|
const vue2RuntimeHelpers = require("@94ai/vue2-runtime-helpers");
|
|
6
6
|
const __sfc_main = vueDemi.defineComponent({
|
|
7
7
|
name: "nf-variable-select"
|
|
@@ -11,13 +11,13 @@ __sfc_main.props = {
|
|
|
11
11
|
key: "noMatchDesc",
|
|
12
12
|
required: false,
|
|
13
13
|
type: String,
|
|
14
|
-
default:
|
|
14
|
+
default: void 0
|
|
15
15
|
},
|
|
16
16
|
placeholder: {
|
|
17
17
|
key: "placeholder",
|
|
18
18
|
required: false,
|
|
19
19
|
type: String,
|
|
20
|
-
default:
|
|
20
|
+
default: void 0
|
|
21
21
|
},
|
|
22
22
|
keyAlias: {
|
|
23
23
|
key: "keyAlias",
|
|
@@ -139,6 +139,16 @@ __sfc_main.props = {
|
|
|
139
139
|
};
|
|
140
140
|
__sfc_main.setup = (__props, __ctx) => {
|
|
141
141
|
const props = __props;
|
|
142
|
+
const {
|
|
143
|
+
t
|
|
144
|
+
} = commonUtils.useLocale();
|
|
145
|
+
const localeText = vueDemi.computed(() => {
|
|
146
|
+
var _a, _b;
|
|
147
|
+
return {
|
|
148
|
+
noMatchDesc: (_a = props.noMatchDesc) != null ? _a : t("nf.common.noMatch"),
|
|
149
|
+
placeholder: (_b = props.placeholder) != null ? _b : t("nf.variableSelect.placeholder")
|
|
150
|
+
};
|
|
151
|
+
});
|
|
142
152
|
const emit = __ctx.emit;
|
|
143
153
|
const keyword = vueDemi.ref();
|
|
144
154
|
const allList = vueDemi.ref([]);
|
|
@@ -172,15 +182,17 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
172
182
|
});
|
|
173
183
|
const groupMap = /* @__PURE__ */ new Map();
|
|
174
184
|
items.forEach((item) => {
|
|
175
|
-
|
|
185
|
+
var _a;
|
|
186
|
+
const groupValue = String((_a = item[props.groupKey]) != null ? _a : "default");
|
|
176
187
|
const list2 = groupMap.get(groupValue);
|
|
177
188
|
list2 ? list2.push(item) : groupMap.set(groupValue, [item]);
|
|
178
189
|
});
|
|
179
190
|
const result = [];
|
|
180
191
|
groupMap.forEach((groupItems, groupValue) => {
|
|
192
|
+
var _a;
|
|
181
193
|
result.push({
|
|
182
194
|
type: groupValue,
|
|
183
|
-
label: props.groupLabels[groupValue]
|
|
195
|
+
label: (_a = props.groupLabels[groupValue]) != null ? _a : groupValue,
|
|
184
196
|
list: groupItems
|
|
185
197
|
});
|
|
186
198
|
});
|
|
@@ -209,6 +221,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
209
221
|
emit("hidden");
|
|
210
222
|
};
|
|
211
223
|
return {
|
|
224
|
+
localeText,
|
|
212
225
|
keyword,
|
|
213
226
|
list,
|
|
214
227
|
groupedList,
|
|
@@ -261,7 +274,7 @@ var _sfc_render = function render() {
|
|
|
261
274
|
}, [_c("el-input", {
|
|
262
275
|
attrs: {
|
|
263
276
|
"prefix-icon": "el-icon-search",
|
|
264
|
-
"placeholder": _vm.placeholder,
|
|
277
|
+
"placeholder": _vm.localeText.placeholder,
|
|
265
278
|
"size": _vm.size
|
|
266
279
|
},
|
|
267
280
|
model: {
|
|
@@ -298,7 +311,7 @@ var _sfc_render = function render() {
|
|
|
298
311
|
}), 0)]);
|
|
299
312
|
}) : _c("div", {
|
|
300
313
|
staticClass: "nf-variable-select-nothing"
|
|
301
|
-
}, [_vm._v(_vm._s(_vm.noMatchDesc))])], 2) : _c("div", {
|
|
314
|
+
}, [_vm._v(_vm._s(_vm.localeText.noMatchDesc))])], 2) : _c("div", {
|
|
302
315
|
staticClass: "nf-variable-select-variate"
|
|
303
316
|
}, [_vm._l(_vm.list, function(item) {
|
|
304
317
|
return _c("div", {
|
|
@@ -312,7 +325,7 @@ var _sfc_render = function render() {
|
|
|
312
325
|
}, [_vm._v(_vm._s(item[_vm.valueAlias]))]);
|
|
313
326
|
}), !_vm.list || !_vm.list.length ? _c("div", {
|
|
314
327
|
staticClass: "nf-variable-select-nothing"
|
|
315
|
-
}, [_vm._v(_vm._s(_vm.noMatchDesc))]) : _vm._e()], 2)])])], 1);
|
|
328
|
+
}, [_vm._v(_vm._s(_vm.localeText.noMatchDesc))]) : _vm._e()], 2)])])], 1);
|
|
316
329
|
};
|
|
317
330
|
var _sfc_staticRenderFns = [];
|
|
318
331
|
var __component__ = /* @__PURE__ */ vue2RuntimeHelpers.normalizeComponent(__sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, null, null, null);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { useLocale, generateUUID } from "@94ai/common-utils";
|
|
2
|
+
import { defineComponent, computed, ref, watch } from "vue-demi";
|
|
3
3
|
import { normalizeComponent } from "@94ai/vue2-runtime-helpers";
|
|
4
4
|
const __sfc_main = defineComponent({
|
|
5
5
|
name: "nf-variable-select"
|
|
@@ -9,13 +9,13 @@ __sfc_main.props = {
|
|
|
9
9
|
key: "noMatchDesc",
|
|
10
10
|
required: false,
|
|
11
11
|
type: String,
|
|
12
|
-
default:
|
|
12
|
+
default: void 0
|
|
13
13
|
},
|
|
14
14
|
placeholder: {
|
|
15
15
|
key: "placeholder",
|
|
16
16
|
required: false,
|
|
17
17
|
type: String,
|
|
18
|
-
default:
|
|
18
|
+
default: void 0
|
|
19
19
|
},
|
|
20
20
|
keyAlias: {
|
|
21
21
|
key: "keyAlias",
|
|
@@ -137,6 +137,16 @@ __sfc_main.props = {
|
|
|
137
137
|
};
|
|
138
138
|
__sfc_main.setup = (__props, __ctx) => {
|
|
139
139
|
const props = __props;
|
|
140
|
+
const {
|
|
141
|
+
t
|
|
142
|
+
} = useLocale();
|
|
143
|
+
const localeText = computed(() => {
|
|
144
|
+
var _a, _b;
|
|
145
|
+
return {
|
|
146
|
+
noMatchDesc: (_a = props.noMatchDesc) != null ? _a : t("nf.common.noMatch"),
|
|
147
|
+
placeholder: (_b = props.placeholder) != null ? _b : t("nf.variableSelect.placeholder")
|
|
148
|
+
};
|
|
149
|
+
});
|
|
140
150
|
const emit = __ctx.emit;
|
|
141
151
|
const keyword = ref();
|
|
142
152
|
const allList = ref([]);
|
|
@@ -170,15 +180,17 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
170
180
|
});
|
|
171
181
|
const groupMap = /* @__PURE__ */ new Map();
|
|
172
182
|
items.forEach((item) => {
|
|
173
|
-
|
|
183
|
+
var _a;
|
|
184
|
+
const groupValue = String((_a = item[props.groupKey]) != null ? _a : "default");
|
|
174
185
|
const list2 = groupMap.get(groupValue);
|
|
175
186
|
list2 ? list2.push(item) : groupMap.set(groupValue, [item]);
|
|
176
187
|
});
|
|
177
188
|
const result = [];
|
|
178
189
|
groupMap.forEach((groupItems, groupValue) => {
|
|
190
|
+
var _a;
|
|
179
191
|
result.push({
|
|
180
192
|
type: groupValue,
|
|
181
|
-
label: props.groupLabels[groupValue]
|
|
193
|
+
label: (_a = props.groupLabels[groupValue]) != null ? _a : groupValue,
|
|
182
194
|
list: groupItems
|
|
183
195
|
});
|
|
184
196
|
});
|
|
@@ -207,6 +219,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
207
219
|
emit("hidden");
|
|
208
220
|
};
|
|
209
221
|
return {
|
|
222
|
+
localeText,
|
|
210
223
|
keyword,
|
|
211
224
|
list,
|
|
212
225
|
groupedList,
|
|
@@ -259,7 +272,7 @@ var _sfc_render = function render() {
|
|
|
259
272
|
}, [_c("el-input", {
|
|
260
273
|
attrs: {
|
|
261
274
|
"prefix-icon": "el-icon-search",
|
|
262
|
-
"placeholder": _vm.placeholder,
|
|
275
|
+
"placeholder": _vm.localeText.placeholder,
|
|
263
276
|
"size": _vm.size
|
|
264
277
|
},
|
|
265
278
|
model: {
|
|
@@ -296,7 +309,7 @@ var _sfc_render = function render() {
|
|
|
296
309
|
}), 0)]);
|
|
297
310
|
}) : _c("div", {
|
|
298
311
|
staticClass: "nf-variable-select-nothing"
|
|
299
|
-
}, [_vm._v(_vm._s(_vm.noMatchDesc))])], 2) : _c("div", {
|
|
312
|
+
}, [_vm._v(_vm._s(_vm.localeText.noMatchDesc))])], 2) : _c("div", {
|
|
300
313
|
staticClass: "nf-variable-select-variate"
|
|
301
314
|
}, [_vm._l(_vm.list, function(item) {
|
|
302
315
|
return _c("div", {
|
|
@@ -310,7 +323,7 @@ var _sfc_render = function render() {
|
|
|
310
323
|
}, [_vm._v(_vm._s(item[_vm.valueAlias]))]);
|
|
311
324
|
}), !_vm.list || !_vm.list.length ? _c("div", {
|
|
312
325
|
staticClass: "nf-variable-select-nothing"
|
|
313
|
-
}, [_vm._v(_vm._s(_vm.noMatchDesc))]) : _vm._e()], 2)])])], 1);
|
|
326
|
+
}, [_vm._v(_vm._s(_vm.localeText.noMatchDesc))]) : _vm._e()], 2)])])], 1);
|
|
314
327
|
};
|
|
315
328
|
var _sfc_staticRenderFns = [];
|
|
316
329
|
var __component__ = /* @__PURE__ */ normalizeComponent(__sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, null, null, null);
|
|
@@ -1,149 +1,149 @@
|
|
|
1
|
-
import { VariableItem } from './types';
|
|
2
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
-
noMatchDesc?: string | undefined;
|
|
4
|
-
placeholder?: string | undefined;
|
|
5
|
-
keyAlias?: string | undefined;
|
|
6
|
-
valueAlias?: string | undefined;
|
|
7
|
-
data?: VariableItem[] | undefined;
|
|
8
|
-
placement?: string | undefined;
|
|
9
|
-
width?: string | number | undefined;
|
|
10
|
-
trigger?: "click" | "focus" | "hover" | "manual" | undefined;
|
|
11
|
-
popperClass?: string | undefined;
|
|
12
|
-
disabled?: boolean | undefined;
|
|
13
|
-
offset?: number | undefined;
|
|
14
|
-
transition?: string | undefined;
|
|
15
|
-
visibleArrow?: boolean | undefined;
|
|
16
|
-
popperOptions?: Record<string, any> | undefined;
|
|
17
|
-
openDelay?: number | undefined;
|
|
18
|
-
closeDelay?: number | undefined;
|
|
19
|
-
tabindex?: number | undefined;
|
|
20
|
-
size?: "small" | "mini" | "medium" | undefined;
|
|
21
|
-
groupable?: boolean | undefined;
|
|
22
|
-
groupKey?: string | undefined;
|
|
23
|
-
groupLabels?: Record<string, string> | undefined;
|
|
24
|
-
}>, {
|
|
25
|
-
noMatchDesc:
|
|
26
|
-
placeholder:
|
|
27
|
-
keyAlias: string;
|
|
28
|
-
placement: string;
|
|
29
|
-
valueAlias: string;
|
|
30
|
-
width: string;
|
|
31
|
-
trigger: string;
|
|
32
|
-
popperClass: string;
|
|
33
|
-
disabled: boolean;
|
|
34
|
-
offset: number;
|
|
35
|
-
transition: string;
|
|
36
|
-
visibleArrow: boolean;
|
|
37
|
-
popperOptions: () => {
|
|
38
|
-
boundariesElement: string;
|
|
39
|
-
gpuAcceleration: boolean;
|
|
40
|
-
};
|
|
41
|
-
data: () => never[];
|
|
42
|
-
openDelay: undefined;
|
|
43
|
-
closeDelay: number;
|
|
44
|
-
tabindex: number;
|
|
45
|
-
size: string;
|
|
46
|
-
groupable: boolean;
|
|
47
|
-
groupKey: string;
|
|
48
|
-
groupLabels: () => {};
|
|
49
|
-
}>, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {
|
|
50
|
-
"variate-click": (event: VariableItem) => void;
|
|
51
|
-
hidden: () => void;
|
|
52
|
-
show: () => void;
|
|
53
|
-
"after-enter": () => void;
|
|
54
|
-
"after-leave": () => void;
|
|
55
|
-
}, string, Readonly<import("vue-demi").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
56
|
-
noMatchDesc?: string | undefined;
|
|
57
|
-
placeholder?: string | undefined;
|
|
58
|
-
keyAlias?: string | undefined;
|
|
59
|
-
valueAlias?: string | undefined;
|
|
60
|
-
data?: VariableItem[] | undefined;
|
|
61
|
-
placement?: string | undefined;
|
|
62
|
-
width?: string | number | undefined;
|
|
63
|
-
trigger?: "click" | "focus" | "hover" | "manual" | undefined;
|
|
64
|
-
popperClass?: string | undefined;
|
|
65
|
-
disabled?: boolean | undefined;
|
|
66
|
-
offset?: number | undefined;
|
|
67
|
-
transition?: string | undefined;
|
|
68
|
-
visibleArrow?: boolean | undefined;
|
|
69
|
-
popperOptions?: Record<string, any> | undefined;
|
|
70
|
-
openDelay?: number | undefined;
|
|
71
|
-
closeDelay?: number | undefined;
|
|
72
|
-
tabindex?: number | undefined;
|
|
73
|
-
size?: "small" | "mini" | "medium" | undefined;
|
|
74
|
-
groupable?: boolean | undefined;
|
|
75
|
-
groupKey?: string | undefined;
|
|
76
|
-
groupLabels?: Record<string, string> | undefined;
|
|
77
|
-
}>, {
|
|
78
|
-
noMatchDesc:
|
|
79
|
-
placeholder:
|
|
80
|
-
keyAlias: string;
|
|
81
|
-
placement: string;
|
|
82
|
-
valueAlias: string;
|
|
83
|
-
width: string;
|
|
84
|
-
trigger: string;
|
|
85
|
-
popperClass: string;
|
|
86
|
-
disabled: boolean;
|
|
87
|
-
offset: number;
|
|
88
|
-
transition: string;
|
|
89
|
-
visibleArrow: boolean;
|
|
90
|
-
popperOptions: () => {
|
|
91
|
-
boundariesElement: string;
|
|
92
|
-
gpuAcceleration: boolean;
|
|
93
|
-
};
|
|
94
|
-
data: () => never[];
|
|
95
|
-
openDelay: undefined;
|
|
96
|
-
closeDelay: number;
|
|
97
|
-
tabindex: number;
|
|
98
|
-
size: string;
|
|
99
|
-
groupable: boolean;
|
|
100
|
-
groupKey: string;
|
|
101
|
-
groupLabels: () => {};
|
|
102
|
-
}>>>, {
|
|
103
|
-
offset: number;
|
|
104
|
-
transition: string;
|
|
105
|
-
width: string | number;
|
|
106
|
-
noMatchDesc: string;
|
|
107
|
-
placeholder: string;
|
|
108
|
-
keyAlias: string;
|
|
109
|
-
valueAlias: string;
|
|
110
|
-
data: VariableItem[];
|
|
111
|
-
placement: string;
|
|
112
|
-
trigger: 'click' | 'focus' | 'hover' | 'manual';
|
|
113
|
-
popperClass: string;
|
|
114
|
-
disabled: boolean;
|
|
115
|
-
visibleArrow: boolean;
|
|
116
|
-
popperOptions: Record<string, any>;
|
|
117
|
-
openDelay: number;
|
|
118
|
-
closeDelay: number;
|
|
119
|
-
tabindex: number;
|
|
120
|
-
size: "mini" | "medium" | "small";
|
|
121
|
-
groupable: boolean;
|
|
122
|
-
groupKey: string;
|
|
123
|
-
groupLabels: Record<string, string>;
|
|
124
|
-
}>, {
|
|
125
|
-
default?(_: {}): any;
|
|
126
|
-
}>;
|
|
127
|
-
export default _default;
|
|
128
|
-
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
129
|
-
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
130
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
131
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
132
|
-
} : {
|
|
133
|
-
type: import('vue').PropType<T[K]>;
|
|
134
|
-
required: true;
|
|
135
|
-
};
|
|
136
|
-
};
|
|
137
|
-
declare type __VLS_WithDefaults<P, D> = {
|
|
138
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
139
|
-
default: D[K];
|
|
140
|
-
}> : P[K];
|
|
141
|
-
};
|
|
142
|
-
declare type __VLS_Prettify<T> = {
|
|
143
|
-
[K in keyof T]: T[K];
|
|
144
|
-
} & {};
|
|
145
|
-
declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
146
|
-
new (): {
|
|
147
|
-
$scopedSlots: S;
|
|
148
|
-
};
|
|
149
|
-
};
|
|
1
|
+
import { VariableItem } from './types';
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
noMatchDesc?: string | undefined;
|
|
4
|
+
placeholder?: string | undefined;
|
|
5
|
+
keyAlias?: string | undefined;
|
|
6
|
+
valueAlias?: string | undefined;
|
|
7
|
+
data?: VariableItem[] | undefined;
|
|
8
|
+
placement?: string | undefined;
|
|
9
|
+
width?: string | number | undefined;
|
|
10
|
+
trigger?: "click" | "focus" | "hover" | "manual" | undefined;
|
|
11
|
+
popperClass?: string | undefined;
|
|
12
|
+
disabled?: boolean | undefined;
|
|
13
|
+
offset?: number | undefined;
|
|
14
|
+
transition?: string | undefined;
|
|
15
|
+
visibleArrow?: boolean | undefined;
|
|
16
|
+
popperOptions?: Record<string, any> | undefined;
|
|
17
|
+
openDelay?: number | undefined;
|
|
18
|
+
closeDelay?: number | undefined;
|
|
19
|
+
tabindex?: number | undefined;
|
|
20
|
+
size?: "small" | "mini" | "medium" | undefined;
|
|
21
|
+
groupable?: boolean | undefined;
|
|
22
|
+
groupKey?: string | undefined;
|
|
23
|
+
groupLabels?: Record<string, string> | undefined;
|
|
24
|
+
}>, {
|
|
25
|
+
noMatchDesc: undefined;
|
|
26
|
+
placeholder: undefined;
|
|
27
|
+
keyAlias: string;
|
|
28
|
+
placement: string;
|
|
29
|
+
valueAlias: string;
|
|
30
|
+
width: string;
|
|
31
|
+
trigger: string;
|
|
32
|
+
popperClass: string;
|
|
33
|
+
disabled: boolean;
|
|
34
|
+
offset: number;
|
|
35
|
+
transition: string;
|
|
36
|
+
visibleArrow: boolean;
|
|
37
|
+
popperOptions: () => {
|
|
38
|
+
boundariesElement: string;
|
|
39
|
+
gpuAcceleration: boolean;
|
|
40
|
+
};
|
|
41
|
+
data: () => never[];
|
|
42
|
+
openDelay: undefined;
|
|
43
|
+
closeDelay: number;
|
|
44
|
+
tabindex: number;
|
|
45
|
+
size: string;
|
|
46
|
+
groupable: boolean;
|
|
47
|
+
groupKey: string;
|
|
48
|
+
groupLabels: () => {};
|
|
49
|
+
}>, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {
|
|
50
|
+
"variate-click": (event: VariableItem) => void;
|
|
51
|
+
hidden: () => void;
|
|
52
|
+
show: () => void;
|
|
53
|
+
"after-enter": () => void;
|
|
54
|
+
"after-leave": () => void;
|
|
55
|
+
}, string, Readonly<import("vue-demi").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
56
|
+
noMatchDesc?: string | undefined;
|
|
57
|
+
placeholder?: string | undefined;
|
|
58
|
+
keyAlias?: string | undefined;
|
|
59
|
+
valueAlias?: string | undefined;
|
|
60
|
+
data?: VariableItem[] | undefined;
|
|
61
|
+
placement?: string | undefined;
|
|
62
|
+
width?: string | number | undefined;
|
|
63
|
+
trigger?: "click" | "focus" | "hover" | "manual" | undefined;
|
|
64
|
+
popperClass?: string | undefined;
|
|
65
|
+
disabled?: boolean | undefined;
|
|
66
|
+
offset?: number | undefined;
|
|
67
|
+
transition?: string | undefined;
|
|
68
|
+
visibleArrow?: boolean | undefined;
|
|
69
|
+
popperOptions?: Record<string, any> | undefined;
|
|
70
|
+
openDelay?: number | undefined;
|
|
71
|
+
closeDelay?: number | undefined;
|
|
72
|
+
tabindex?: number | undefined;
|
|
73
|
+
size?: "small" | "mini" | "medium" | undefined;
|
|
74
|
+
groupable?: boolean | undefined;
|
|
75
|
+
groupKey?: string | undefined;
|
|
76
|
+
groupLabels?: Record<string, string> | undefined;
|
|
77
|
+
}>, {
|
|
78
|
+
noMatchDesc: undefined;
|
|
79
|
+
placeholder: undefined;
|
|
80
|
+
keyAlias: string;
|
|
81
|
+
placement: string;
|
|
82
|
+
valueAlias: string;
|
|
83
|
+
width: string;
|
|
84
|
+
trigger: string;
|
|
85
|
+
popperClass: string;
|
|
86
|
+
disabled: boolean;
|
|
87
|
+
offset: number;
|
|
88
|
+
transition: string;
|
|
89
|
+
visibleArrow: boolean;
|
|
90
|
+
popperOptions: () => {
|
|
91
|
+
boundariesElement: string;
|
|
92
|
+
gpuAcceleration: boolean;
|
|
93
|
+
};
|
|
94
|
+
data: () => never[];
|
|
95
|
+
openDelay: undefined;
|
|
96
|
+
closeDelay: number;
|
|
97
|
+
tabindex: number;
|
|
98
|
+
size: string;
|
|
99
|
+
groupable: boolean;
|
|
100
|
+
groupKey: string;
|
|
101
|
+
groupLabels: () => {};
|
|
102
|
+
}>>>, {
|
|
103
|
+
offset: number;
|
|
104
|
+
transition: string;
|
|
105
|
+
width: string | number;
|
|
106
|
+
noMatchDesc: string;
|
|
107
|
+
placeholder: string;
|
|
108
|
+
keyAlias: string;
|
|
109
|
+
valueAlias: string;
|
|
110
|
+
data: VariableItem[];
|
|
111
|
+
placement: string;
|
|
112
|
+
trigger: 'click' | 'focus' | 'hover' | 'manual';
|
|
113
|
+
popperClass: string;
|
|
114
|
+
disabled: boolean;
|
|
115
|
+
visibleArrow: boolean;
|
|
116
|
+
popperOptions: Record<string, any>;
|
|
117
|
+
openDelay: number;
|
|
118
|
+
closeDelay: number;
|
|
119
|
+
tabindex: number;
|
|
120
|
+
size: "mini" | "medium" | "small";
|
|
121
|
+
groupable: boolean;
|
|
122
|
+
groupKey: string;
|
|
123
|
+
groupLabels: Record<string, string>;
|
|
124
|
+
}>, {
|
|
125
|
+
default?(_: {}): any;
|
|
126
|
+
}>;
|
|
127
|
+
export default _default;
|
|
128
|
+
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
129
|
+
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
130
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
131
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
132
|
+
} : {
|
|
133
|
+
type: import('vue').PropType<T[K]>;
|
|
134
|
+
required: true;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
declare type __VLS_WithDefaults<P, D> = {
|
|
138
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
139
|
+
default: D[K];
|
|
140
|
+
}> : P[K];
|
|
141
|
+
};
|
|
142
|
+
declare type __VLS_Prettify<T> = {
|
|
143
|
+
[K in keyof T]: T[K];
|
|
144
|
+
} & {};
|
|
145
|
+
declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
146
|
+
new (): {
|
|
147
|
+
$scopedSlots: S;
|
|
148
|
+
};
|
|
149
|
+
};
|
package/lib/style/css.d.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
package/lib/style/index.d.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
package/lib/types.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export declare type VariableItem = {
|
|
2
|
-
name?: string;
|
|
3
|
-
paramId?: string;
|
|
4
|
-
[index: string]: any;
|
|
5
|
-
};
|
|
6
|
-
export declare type GroupItem = {
|
|
7
|
-
type: string;
|
|
8
|
-
label: string;
|
|
9
|
-
list: VariableItem[];
|
|
10
|
-
};
|
|
1
|
+
export declare type VariableItem = {
|
|
2
|
+
name?: string;
|
|
3
|
+
paramId?: string;
|
|
4
|
+
[index: string]: any;
|
|
5
|
+
};
|
|
6
|
+
export declare type GroupItem = {
|
|
7
|
+
type: string;
|
|
8
|
+
label: string;
|
|
9
|
+
list: VariableItem[];
|
|
10
|
+
};
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
</div>
|
|
24
24
|
<div class="nf-variable-select-box">
|
|
25
25
|
<div class="nf-variable-select-search">
|
|
26
|
-
<el-input v-model="keyword" prefix-icon="el-icon-search" :placeholder="placeholder" :size="size"/>
|
|
26
|
+
<el-input v-model="keyword" prefix-icon="el-icon-search" :placeholder="localeText.placeholder" :size="size"/>
|
|
27
27
|
</div>
|
|
28
28
|
<div v-if="groupable" class="nf-variable-select-variate">
|
|
29
29
|
<template v-if="hasGroupData">
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
</div>
|
|
47
47
|
</div>
|
|
48
48
|
</template>
|
|
49
|
-
<div v-else class="nf-variable-select-nothing">{{ noMatchDesc }}</div>
|
|
49
|
+
<div v-else class="nf-variable-select-nothing">{{ localeText.noMatchDesc }}</div>
|
|
50
50
|
</div>
|
|
51
51
|
<div v-else class="nf-variable-select-variate">
|
|
52
52
|
<div v-for="item in list" :key="item[keyAlias]" class="nf-variable-select-variate-item" @click="handleItem(item)">{{ item[valueAlias] }}</div>
|
|
53
|
-
<div v-if="!list || !list.length" class="nf-variable-select-nothing">{{ noMatchDesc }}</div>
|
|
53
|
+
<div v-if="!list || !list.length" class="nf-variable-select-nothing">{{ localeText.noMatchDesc }}</div>
|
|
54
54
|
</div>
|
|
55
55
|
</div>
|
|
56
56
|
</el-popover>
|
|
@@ -66,6 +66,8 @@ export default defineComponent({
|
|
|
66
66
|
</script>
|
|
67
67
|
|
|
68
68
|
<script lang="ts" setup>
|
|
69
|
+
import { useLocale } from '@94ai/common-utils'
|
|
70
|
+
|
|
69
71
|
import {
|
|
70
72
|
computed,
|
|
71
73
|
ref,
|
|
@@ -99,8 +101,8 @@ const props = withDefaults(defineProps<{
|
|
|
99
101
|
groupKey?: string
|
|
100
102
|
groupLabels?: Record<string, string>
|
|
101
103
|
}>(), {
|
|
102
|
-
noMatchDesc:
|
|
103
|
-
placeholder:
|
|
104
|
+
noMatchDesc: undefined,
|
|
105
|
+
placeholder: undefined,
|
|
104
106
|
keyAlias: 'paramId',
|
|
105
107
|
placement: 'bottom',
|
|
106
108
|
valueAlias: 'name',
|
|
@@ -121,6 +123,13 @@ const props = withDefaults(defineProps<{
|
|
|
121
123
|
groupKey: '',
|
|
122
124
|
groupLabels: () => ({})
|
|
123
125
|
})
|
|
126
|
+
|
|
127
|
+
const { t } = useLocale()
|
|
128
|
+
const localeText = computed(() => ({
|
|
129
|
+
noMatchDesc: props.noMatchDesc ?? t('nf.common.noMatch'),
|
|
130
|
+
placeholder: props.placeholder ?? t('nf.variableSelect.placeholder'),
|
|
131
|
+
}))
|
|
132
|
+
|
|
124
133
|
const emit = defineEmits<{
|
|
125
134
|
(e: 'variate-click', event: VariableItem): void
|
|
126
135
|
(e: 'hidden'): void
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@94ai/nf-variable-select",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "zoujiahe <zoujiahe@94ai.com>",
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
},
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
14
|
-
"url": "http://94ai.
|
|
14
|
+
"url": "http://gitlab.94ai.pro/ui/common-ui.git"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@94ai/common-utils": "^
|
|
18
|
-
"@94ai/nf-theme-chalk": "^
|
|
17
|
+
"@94ai/common-utils": "^9.0.0",
|
|
18
|
+
"@94ai/nf-theme-chalk": "^9.0.0",
|
|
19
19
|
"vue-demi": "^0.14.5"
|
|
20
20
|
},
|
|
21
21
|
"peerDependenciesMeta": {
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"types": "lib/index.d.ts",
|
|
32
32
|
"main": "lib/nf-variable-select.cjs.js",
|
|
33
33
|
"module": "lib/nf-variable-select.esm-bundler.js",
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "afe3016f0e42dfb7fedf6cbbe400ec08bf4b8662"
|
|
35
35
|
}
|