@94ai/nf-virtual-select 3.2.4 → 3.2.20
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.
|
@@ -15,6 +15,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
15
15
|
type: StringConstructor;
|
|
16
16
|
required: true;
|
|
17
17
|
};
|
|
18
|
+
showTip: {
|
|
19
|
+
type: BooleanConstructor;
|
|
20
|
+
default: boolean;
|
|
21
|
+
};
|
|
18
22
|
}, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{
|
|
19
23
|
index: {
|
|
20
24
|
type: NumberConstructor;
|
|
@@ -32,7 +36,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
32
36
|
type: StringConstructor;
|
|
33
37
|
required: true;
|
|
34
38
|
};
|
|
39
|
+
showTip: {
|
|
40
|
+
type: BooleanConstructor;
|
|
41
|
+
default: boolean;
|
|
42
|
+
};
|
|
35
43
|
}>>, {
|
|
36
44
|
source: Record<string, any>;
|
|
45
|
+
showTip: boolean;
|
|
37
46
|
}>;
|
|
38
47
|
export default _default;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const virtualList = require("vue-virtual-scroll-list");
|
|
4
4
|
const vue2RuntimeHelpers = require("@94ai/vue2-runtime-helpers");
|
|
5
|
-
const
|
|
5
|
+
const lodashEs = require("lodash-es");
|
|
6
6
|
const _sfc_main$1 = {
|
|
7
7
|
name: "ItemComponent",
|
|
8
8
|
props: {
|
|
@@ -27,6 +27,11 @@ const _sfc_main$1 = {
|
|
|
27
27
|
// 绑定的值
|
|
28
28
|
type: String,
|
|
29
29
|
required: true
|
|
30
|
+
},
|
|
31
|
+
showTip: {
|
|
32
|
+
// 提示
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: true
|
|
30
35
|
}
|
|
31
36
|
}
|
|
32
37
|
};
|
|
@@ -38,7 +43,6 @@ var _sfc_render$1 = function render() {
|
|
|
38
43
|
attrs: {
|
|
39
44
|
"label": _vm.source[_vm.label],
|
|
40
45
|
"value": _vm.source[_vm.value],
|
|
41
|
-
"title": _vm.source[_vm.label],
|
|
42
46
|
"disabled": _vm.source["disabled"]
|
|
43
47
|
}
|
|
44
48
|
}, [((_b = (_a = _vm.source) == null ? void 0 : _a.slotContent) == null ? void 0 : _b.firstCall) || ((_d = (_c2 = _vm.source) == null ? void 0 : _c2.slotContent) == null ? void 0 : _d.recall) ? _c("el-tooltip", {
|
|
@@ -54,7 +58,14 @@ var _sfc_render$1 = function render() {
|
|
|
54
58
|
"slot": "content"
|
|
55
59
|
},
|
|
56
60
|
slot: "content"
|
|
57
|
-
}, [_vm._v(" " + _vm._s((_f = (_e = _vm.source) == null ? void 0 : _e.slotContent) == null ? void 0 : _f.firstCall) + " "), _c("br"), _vm._v(" "), _c("br"), _vm._v(" " + _vm._s((_h = (_g = _vm.source) == null ? void 0 : _g.slotContent) == null ? void 0 : _h.recall) + " ")]), _c("span", [_vm._v(_vm._s(_vm.source[_vm.label]))])]) : _vm._e()
|
|
61
|
+
}, [_vm._v(" " + _vm._s((_f = (_e = _vm.source) == null ? void 0 : _e.slotContent) == null ? void 0 : _f.firstCall) + " "), _c("br"), _vm._v(" "), _c("br"), _vm._v(" " + _vm._s((_h = (_g = _vm.source) == null ? void 0 : _g.slotContent) == null ? void 0 : _h.recall) + " ")]), _c("span", [_vm._v(_vm._s(_vm.source[_vm.label]))])]) : _vm._e(), _vm.showTip ? _c("el-tooltip", {
|
|
62
|
+
attrs: {
|
|
63
|
+
"content": _vm.source[_vm.label],
|
|
64
|
+
"open-delay": 1e3,
|
|
65
|
+
"effect": "dark",
|
|
66
|
+
"placement": "left"
|
|
67
|
+
}
|
|
68
|
+
}, [_c("span", [_vm._v(_vm._s(_vm.source[_vm.label]))])]) : _vm._e()], 1);
|
|
58
69
|
};
|
|
59
70
|
var _sfc_staticRenderFns$1 = [];
|
|
60
71
|
var __component__$1 = /* @__PURE__ */ vue2RuntimeHelpers.normalizeComponent(_sfc_main$1, _sfc_render$1, _sfc_staticRenderFns$1, false, null, null, null, null);
|
|
@@ -316,7 +327,7 @@ const _sfc_main = {
|
|
|
316
327
|
},
|
|
317
328
|
watch: {
|
|
318
329
|
options(newVal, value) {
|
|
319
|
-
if (!
|
|
330
|
+
if (!lodashEs.isEqual(newVal, value)) {
|
|
320
331
|
this.init();
|
|
321
332
|
}
|
|
322
333
|
},
|
|
@@ -407,7 +418,7 @@ const _sfc_main = {
|
|
|
407
418
|
disabled: it["disabled"] ?? false
|
|
408
419
|
}))) ?? [];
|
|
409
420
|
} else {
|
|
410
|
-
this.selectArr = this.optionsList ?
|
|
421
|
+
this.selectArr = this.optionsList ? lodashEs.cloneDeep(this.optionsList) : [];
|
|
411
422
|
if ((this.itemOptions.multiple || this.multiple) && Array.isArray(this.currentVal)) {
|
|
412
423
|
const multiple_elements = this.selectArr.filter((item) => this.currentVal.includes(item.value));
|
|
413
424
|
this.selectArr = [...multiple_elements, ...this.selectArr.filter((item) => !multiple_elements.includes(item))];
|
|
@@ -544,6 +555,9 @@ var _sfc_render = function render2() {
|
|
|
544
555
|
}
|
|
545
556
|
})], 1)] : _vm.isSelect ? _c("el-select", _vm._g(_vm._b({
|
|
546
557
|
style: `width: ${_vm.width};`,
|
|
558
|
+
attrs: {
|
|
559
|
+
"popper-class": "select-popper"
|
|
560
|
+
},
|
|
547
561
|
on: {
|
|
548
562
|
"change": _vm.handleChange
|
|
549
563
|
},
|
|
@@ -562,7 +576,14 @@ var _sfc_render = function render2() {
|
|
|
562
576
|
"value": item.value,
|
|
563
577
|
"disabled": item.disabled
|
|
564
578
|
}
|
|
565
|
-
}
|
|
579
|
+
}, [_c("el-tooltip", {
|
|
580
|
+
attrs: {
|
|
581
|
+
"content": item.label,
|
|
582
|
+
"open-delay": 1e3,
|
|
583
|
+
"effect": "dark",
|
|
584
|
+
"placement": "left"
|
|
585
|
+
}
|
|
586
|
+
}, [_c("span", [_vm._v(_vm._s(item.label))])])], 1);
|
|
566
587
|
}), 1) : _vm._e()], 2);
|
|
567
588
|
};
|
|
568
589
|
var _sfc_staticRenderFns = [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import virtualList from "vue-virtual-scroll-list";
|
|
2
2
|
import { normalizeComponent } from "@94ai/vue2-runtime-helpers";
|
|
3
|
-
import { isEqual, cloneDeep } from "lodash";
|
|
3
|
+
import { isEqual, cloneDeep } from "lodash-es";
|
|
4
4
|
const _sfc_main$1 = {
|
|
5
5
|
name: "ItemComponent",
|
|
6
6
|
props: {
|
|
@@ -25,6 +25,11 @@ const _sfc_main$1 = {
|
|
|
25
25
|
// 绑定的值
|
|
26
26
|
type: String,
|
|
27
27
|
required: true
|
|
28
|
+
},
|
|
29
|
+
showTip: {
|
|
30
|
+
// 提示
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: true
|
|
28
33
|
}
|
|
29
34
|
}
|
|
30
35
|
};
|
|
@@ -36,7 +41,6 @@ var _sfc_render$1 = function render() {
|
|
|
36
41
|
attrs: {
|
|
37
42
|
"label": _vm.source[_vm.label],
|
|
38
43
|
"value": _vm.source[_vm.value],
|
|
39
|
-
"title": _vm.source[_vm.label],
|
|
40
44
|
"disabled": _vm.source["disabled"]
|
|
41
45
|
}
|
|
42
46
|
}, [((_b = (_a = _vm.source) == null ? void 0 : _a.slotContent) == null ? void 0 : _b.firstCall) || ((_d = (_c2 = _vm.source) == null ? void 0 : _c2.slotContent) == null ? void 0 : _d.recall) ? _c("el-tooltip", {
|
|
@@ -52,7 +56,14 @@ var _sfc_render$1 = function render() {
|
|
|
52
56
|
"slot": "content"
|
|
53
57
|
},
|
|
54
58
|
slot: "content"
|
|
55
|
-
}, [_vm._v(" " + _vm._s((_f = (_e = _vm.source) == null ? void 0 : _e.slotContent) == null ? void 0 : _f.firstCall) + " "), _c("br"), _vm._v(" "), _c("br"), _vm._v(" " + _vm._s((_h = (_g = _vm.source) == null ? void 0 : _g.slotContent) == null ? void 0 : _h.recall) + " ")]), _c("span", [_vm._v(_vm._s(_vm.source[_vm.label]))])]) : _vm._e()
|
|
59
|
+
}, [_vm._v(" " + _vm._s((_f = (_e = _vm.source) == null ? void 0 : _e.slotContent) == null ? void 0 : _f.firstCall) + " "), _c("br"), _vm._v(" "), _c("br"), _vm._v(" " + _vm._s((_h = (_g = _vm.source) == null ? void 0 : _g.slotContent) == null ? void 0 : _h.recall) + " ")]), _c("span", [_vm._v(_vm._s(_vm.source[_vm.label]))])]) : _vm._e(), _vm.showTip ? _c("el-tooltip", {
|
|
60
|
+
attrs: {
|
|
61
|
+
"content": _vm.source[_vm.label],
|
|
62
|
+
"open-delay": 1e3,
|
|
63
|
+
"effect": "dark",
|
|
64
|
+
"placement": "left"
|
|
65
|
+
}
|
|
66
|
+
}, [_c("span", [_vm._v(_vm._s(_vm.source[_vm.label]))])]) : _vm._e()], 1);
|
|
56
67
|
};
|
|
57
68
|
var _sfc_staticRenderFns$1 = [];
|
|
58
69
|
var __component__$1 = /* @__PURE__ */ normalizeComponent(_sfc_main$1, _sfc_render$1, _sfc_staticRenderFns$1, false, null, null, null, null);
|
|
@@ -542,6 +553,9 @@ var _sfc_render = function render2() {
|
|
|
542
553
|
}
|
|
543
554
|
})], 1)] : _vm.isSelect ? _c("el-select", _vm._g(_vm._b({
|
|
544
555
|
style: `width: ${_vm.width};`,
|
|
556
|
+
attrs: {
|
|
557
|
+
"popper-class": "select-popper"
|
|
558
|
+
},
|
|
545
559
|
on: {
|
|
546
560
|
"change": _vm.handleChange
|
|
547
561
|
},
|
|
@@ -560,7 +574,14 @@ var _sfc_render = function render2() {
|
|
|
560
574
|
"value": item.value,
|
|
561
575
|
"disabled": item.disabled
|
|
562
576
|
}
|
|
563
|
-
}
|
|
577
|
+
}, [_c("el-tooltip", {
|
|
578
|
+
attrs: {
|
|
579
|
+
"content": item.label,
|
|
580
|
+
"open-delay": 1e3,
|
|
581
|
+
"effect": "dark",
|
|
582
|
+
"placement": "left"
|
|
583
|
+
}
|
|
584
|
+
}, [_c("span", [_vm._v(_vm._s(item.label))])])], 1);
|
|
564
585
|
}), 1) : _vm._e()], 2);
|
|
565
586
|
};
|
|
566
587
|
var _sfc_staticRenderFns = [];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<el-option :key="index" :label="source[label]" :value="source[value]" :
|
|
2
|
+
<el-option :key="index" :label="source[label]" :value="source[value]" :disabled="source['disabled']">
|
|
3
3
|
<el-tooltip v-if="source?.slotContent?.firstCall || source?.slotContent?.recall" effect="dark" placement="right">
|
|
4
4
|
<div slot="content" style="max-width: 350px;">
|
|
5
5
|
{{ source?.slotContent?.firstCall }} <br> <br>
|
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
</div>
|
|
8
8
|
<span>{{ source[label] }}</span>
|
|
9
9
|
</el-tooltip>
|
|
10
|
+
<el-tooltip v-if="showTip" :content="source[label]" :open-delay="1000" effect="dark" placement="left">
|
|
11
|
+
<span>{{ source[label] }}</span>
|
|
12
|
+
</el-tooltip>
|
|
10
13
|
</el-option>
|
|
11
14
|
</template>
|
|
12
15
|
|
|
@@ -31,6 +34,10 @@ export default {
|
|
|
31
34
|
value: { // 绑定的值
|
|
32
35
|
type: String,
|
|
33
36
|
required: true
|
|
37
|
+
},
|
|
38
|
+
showTip: { // 提示
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: true
|
|
34
41
|
}
|
|
35
42
|
}
|
|
36
43
|
}
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
v-model="currentVal"
|
|
56
56
|
v-bind="bindProps"
|
|
57
57
|
:style="`width: ${width};`"
|
|
58
|
+
popper-class="select-popper"
|
|
58
59
|
@change="handleChange"
|
|
59
60
|
v-on="bindEvents"
|
|
60
61
|
>
|
|
@@ -64,7 +65,11 @@
|
|
|
64
65
|
:label="item.label"
|
|
65
66
|
:value="item.value"
|
|
66
67
|
:disabled="item.disabled"
|
|
67
|
-
|
|
68
|
+
>
|
|
69
|
+
<el-tooltip :content="item.label" :open-delay="1000" effect="dark" placement="left">
|
|
70
|
+
<span>{{ item.label }}</span>
|
|
71
|
+
</el-tooltip>
|
|
72
|
+
</el-option>
|
|
68
73
|
</el-select>
|
|
69
74
|
</div>
|
|
70
75
|
</template>
|
|
@@ -72,7 +77,7 @@
|
|
|
72
77
|
<script>
|
|
73
78
|
import virtualList from 'vue-virtual-scroll-list'
|
|
74
79
|
import ElOptionNode from './el-option-node.vue'
|
|
75
|
-
import { isEqual, cloneDeep } from 'lodash'
|
|
80
|
+
import { isEqual, cloneDeep } from 'lodash-es'
|
|
76
81
|
export default {
|
|
77
82
|
name: 'nf-virtual-select',
|
|
78
83
|
components: { 'virtual-list': virtualList },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@94ai/nf-virtual-select",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.20",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "DESKTOP-1EDDQ79\\dev026 <liuxiangxiang@94ai.com>",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"url": "http://94ai.gitlab.com/zoujiahe/common-ui.git"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@94ai/nf-theme-chalk": "^3.2.
|
|
17
|
+
"@94ai/nf-theme-chalk": "^3.2.20",
|
|
18
|
+
"lodash-es": "^4.17.21",
|
|
18
19
|
"vue-demi": "^0.14.5",
|
|
19
20
|
"vue-virtual-scroll-list": "^2.3.5"
|
|
20
21
|
},
|
|
@@ -31,5 +32,5 @@
|
|
|
31
32
|
"types": "lib/index.d.ts",
|
|
32
33
|
"main": "lib/nf-virtual-select.cjs.js",
|
|
33
34
|
"module": "lib/nf-virtual-select.esm-bundler.js",
|
|
34
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "60e08cb237f842c3fc38168cbd911ec3a4c9d440"
|
|
35
36
|
}
|