@94ai/nf-virtual-select 100.1.32 → 100.1.35

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.
@@ -490,15 +490,17 @@ const _sfc_main = {
490
490
  if (query !== "") {
491
491
  this.$refs.virtualSelectList.scrollToIndex(0);
492
492
  let timer = setTimeout(() => {
493
- const selectArr = this.itemOptions.options.filter((item) => {
493
+ var _a, _b, _c;
494
+ const arr = ((_b = (_a = this.itemOptions) == null ? void 0 : _a.options) == null ? void 0 : _b.length) ? this.itemOptions.options : ((_c = this.options) == null ? void 0 : _c.length) ? this.options : [];
495
+ const selectArr = arr.filter((item) => {
494
496
  if (item[this.keyValue[0]]) {
495
497
  return item[this.keyValue[0]].toLowerCase().indexOf(query.toLowerCase()) > -1;
496
498
  }
497
499
  });
498
500
  this.selectArr = (selectArr || []).map((it) => {
499
501
  return {
500
- label: it[this.keyValue[0]],
501
- value: it[this.keyValue[1]],
502
+ [this.keyValue[0]]: it[this.keyValue[0]],
503
+ [this.keyValue[1]]: it[this.keyValue[1]],
502
504
  [this.dataKey]: it[this.keyValue[1]],
503
505
  disabled: it["disabled"] ? it["disabled"] : false,
504
506
  slotContent: (it == null ? void 0 : it.slotContent) || {}
@@ -617,20 +619,20 @@ var _sfc_render = function render2() {
617
619
  }
618
620
  }, "el-select", _vm.bindProps, false), _vm.bindEvents), _vm._l(_vm.selectArr, function(item, index) {
619
621
  return _c("el-option", {
620
- key: item.label + "_" + index,
622
+ key: item[_vm.keyValue[0]] + "_" + index,
621
623
  attrs: {
622
- "label": item.label,
623
- "value": item.value,
624
+ "label": item[_vm.keyValue[0]],
625
+ "value": item[_vm.keyValue[1]],
624
626
  "disabled": item.disabled
625
627
  }
626
628
  }, [_c("el-tooltip", {
627
629
  attrs: {
628
- "content": item.label,
630
+ "content": item[_vm.keyValue[0]],
629
631
  "open-delay": 1e3,
630
632
  "effect": "dark",
631
633
  "placement": "left"
632
634
  }
633
- }, [_c("span", [_vm._v(_vm._s(item.label))])])], 1);
635
+ }, [_c("span", [_vm._v(_vm._s(item[_vm.keyValue[0]]))])])], 1);
634
636
  }), 1) : _vm._e()], 2);
635
637
  };
636
638
  var _sfc_staticRenderFns = [];
@@ -488,15 +488,17 @@ const _sfc_main = {
488
488
  if (query !== "") {
489
489
  this.$refs.virtualSelectList.scrollToIndex(0);
490
490
  let timer = setTimeout(() => {
491
- const selectArr = this.itemOptions.options.filter((item) => {
491
+ var _a, _b, _c;
492
+ const arr = ((_b = (_a = this.itemOptions) == null ? void 0 : _a.options) == null ? void 0 : _b.length) ? this.itemOptions.options : ((_c = this.options) == null ? void 0 : _c.length) ? this.options : [];
493
+ const selectArr = arr.filter((item) => {
492
494
  if (item[this.keyValue[0]]) {
493
495
  return item[this.keyValue[0]].toLowerCase().indexOf(query.toLowerCase()) > -1;
494
496
  }
495
497
  });
496
498
  this.selectArr = (selectArr || []).map((it) => {
497
499
  return {
498
- label: it[this.keyValue[0]],
499
- value: it[this.keyValue[1]],
500
+ [this.keyValue[0]]: it[this.keyValue[0]],
501
+ [this.keyValue[1]]: it[this.keyValue[1]],
500
502
  [this.dataKey]: it[this.keyValue[1]],
501
503
  disabled: it["disabled"] ? it["disabled"] : false,
502
504
  slotContent: (it == null ? void 0 : it.slotContent) || {}
@@ -615,20 +617,20 @@ var _sfc_render = function render2() {
615
617
  }
616
618
  }, "el-select", _vm.bindProps, false), _vm.bindEvents), _vm._l(_vm.selectArr, function(item, index) {
617
619
  return _c("el-option", {
618
- key: item.label + "_" + index,
620
+ key: item[_vm.keyValue[0]] + "_" + index,
619
621
  attrs: {
620
- "label": item.label,
621
- "value": item.value,
622
+ "label": item[_vm.keyValue[0]],
623
+ "value": item[_vm.keyValue[1]],
622
624
  "disabled": item.disabled
623
625
  }
624
626
  }, [_c("el-tooltip", {
625
627
  attrs: {
626
- "content": item.label,
628
+ "content": item[_vm.keyValue[0]],
627
629
  "open-delay": 1e3,
628
630
  "effect": "dark",
629
631
  "placement": "left"
630
632
  }
631
- }, [_c("span", [_vm._v(_vm._s(item.label))])])], 1);
633
+ }, [_c("span", [_vm._v(_vm._s(item[_vm.keyValue[0]]))])])], 1);
632
634
  }), 1) : _vm._e()], 2);
633
635
  };
634
636
  var _sfc_staticRenderFns = [];
@@ -62,13 +62,13 @@
62
62
  >
63
63
  <el-option
64
64
  v-for="(item, index) in selectArr"
65
- :key="item.label + '_' + index"
66
- :label="item.label"
67
- :value="item.value"
65
+ :key="item[keyValue[0]] + '_' + index"
66
+ :label="item[keyValue[0]]"
67
+ :value="item[keyValue[1]]"
68
68
  :disabled="item.disabled"
69
69
  >
70
- <el-tooltip :content="item.label" :open-delay="1000" effect="dark" placement="left">
71
- <span>{{ item.label }}</span>
70
+ <el-tooltip :content="item[keyValue[0]]" :open-delay="1000" effect="dark" placement="left">
71
+ <span>{{ item[keyValue[0]] }}</span>
72
72
  </el-tooltip>
73
73
  </el-option>
74
74
  </el-select>
@@ -487,15 +487,16 @@ export default {
487
487
  if (query !== '') {
488
488
  this.$refs.virtualSelectList.scrollToIndex(0)// 滚动到顶部
489
489
  let timer = setTimeout(() => {
490
- const selectArr = this.itemOptions.options.filter(item => {
490
+ const arr = this.itemOptions?.options?.length ? this.itemOptions.options : this.options?.length ? this.options : []
491
+ const selectArr = arr.filter(item => {
491
492
  if (item[this.keyValue[0]]) {
492
493
  return item[this.keyValue[0]].toLowerCase().indexOf(query.toLowerCase()) > -1
493
494
  }
494
495
  })
495
496
  this.selectArr = (selectArr || []).map(it => {
496
497
  return {
497
- label: it[this.keyValue[0]],
498
- value: it[this.keyValue[1]],
498
+ [this.keyValue[0]]: it[this.keyValue[0]],
499
+ [this.keyValue[1]]: it[this.keyValue[1]],
499
500
  [this.dataKey]: it[this.keyValue[1]],
500
501
  disabled: it['disabled'] ? it['disabled'] : false,
501
502
  slotContent: it?.slotContent || {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@94ai/nf-virtual-select",
3
- "version": "100.1.32",
3
+ "version": "100.1.35",
4
4
  "description": "> TODO: description",
5
5
  "keywords": [],
6
6
  "author": "DESKTOP-1EDDQ79\\dev026 <liuxiangxiang@94ai.com>",
@@ -14,7 +14,7 @@
14
14
  "url": "http://94ai.gitlab.com/zoujiahe/common-ui.git"
15
15
  },
16
16
  "dependencies": {
17
- "@94ai/nf-theme-chalk": "^100.1.32",
17
+ "@94ai/nf-theme-chalk": "^100.1.35",
18
18
  "lodash-es": "^4.17.21",
19
19
  "vue-demi": "^0.14.5",
20
20
  "vue-virtual-scroll-list": "^2.3.5"
@@ -32,5 +32,5 @@
32
32
  "types": "lib/index.d.ts",
33
33
  "main": "lib/nf-virtual-select.cjs.js",
34
34
  "module": "lib/nf-virtual-select.esm-bundler.js",
35
- "gitHead": "790349805e1e9cc30983feedbb3ca69cb7dccfaf"
35
+ "gitHead": "2957186979c1694b9c450c9f20db48e2aa22bb81"
36
36
  }