bk-magic-vue 2.5.9-beta.2 → 2.5.9-beta.21

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.
Files changed (113) hide show
  1. package/dist/bk-magic-vue.css +893 -959
  2. package/dist/bk-magic-vue.js +860 -625
  3. package/dist/bk-magic-vue.min.css +1 -1
  4. package/dist/bk-magic-vue.min.css.gz +0 -0
  5. package/dist/bk-magic-vue.min.css.map +1 -1
  6. package/dist/bk-magic-vue.min.js +1 -1
  7. package/dist/bk-magic-vue.min.js.gz +0 -0
  8. package/dist/bk-magic-vue.min.js.map +1 -1
  9. package/lib/card.js +2981 -203
  10. package/lib/cascade.js +6447 -6411
  11. package/lib/date-picker.js +1 -1
  12. package/lib/dialog.js +484 -9
  13. package/lib/info-box.js +484 -9
  14. package/lib/input.js +2942 -164
  15. package/lib/loading.js +7 -4
  16. package/lib/pagination.js +214 -17
  17. package/lib/rate.js +14 -3
  18. package/lib/resize-layout.js +3 -1
  19. package/lib/select.js +40 -9
  20. package/lib/sideslider.js +802 -336
  21. package/lib/slider.js +3270 -3202
  22. package/lib/star.js +13 -2
  23. package/lib/table.js +214 -17
  24. package/lib/tag-input.js +122 -102
  25. package/lib/time-picker.js +1 -1
  26. package/lib/timeline.js +26 -17
  27. package/lib/transfer.js +1886 -1710
  28. package/lib/ui/badge.css +127 -119
  29. package/lib/ui/badge.min.css +1 -1
  30. package/lib/ui/badge.min.css.map +1 -1
  31. package/lib/ui/bk-magic-vue.css +893 -959
  32. package/lib/ui/bk-magic-vue.min.css +1 -1
  33. package/lib/ui/bk-magic-vue.min.css.gz +0 -0
  34. package/lib/ui/bk-magic-vue.min.css.map +1 -1
  35. package/lib/ui/button.css +4 -4
  36. package/lib/ui/button.min.css +1 -1
  37. package/lib/ui/button.min.css.map +1 -1
  38. package/lib/ui/card.css +2 -2
  39. package/lib/ui/card.min.css +1 -1
  40. package/lib/ui/card.min.css.map +1 -1
  41. package/lib/ui/cascade.css +19 -1
  42. package/lib/ui/cascade.min.css +1 -1
  43. package/lib/ui/cascade.min.css.map +1 -1
  44. package/lib/ui/checkbox.css +67 -67
  45. package/lib/ui/checkbox.min.css.map +1 -1
  46. package/lib/ui/dialog.css +4 -4
  47. package/lib/ui/dialog.min.css +1 -1
  48. package/lib/ui/dialog.min.css.map +1 -1
  49. package/lib/ui/exception.css +1 -0
  50. package/lib/ui/exception.min.css +1 -1
  51. package/lib/ui/exception.min.css.map +1 -1
  52. package/lib/ui/form.css +2 -2
  53. package/lib/ui/form.min.css +1 -1
  54. package/lib/ui/form.min.css.map +1 -1
  55. package/lib/ui/info-box.css +4 -4
  56. package/lib/ui/info-box.min.css +1 -1
  57. package/lib/ui/info-box.min.css.map +1 -1
  58. package/lib/ui/input.css +1 -1
  59. package/lib/ui/input.min.css +1 -1
  60. package/lib/ui/input.min.css.map +1 -1
  61. package/lib/ui/link.css +27 -3
  62. package/lib/ui/link.min.css +1 -1
  63. package/lib/ui/link.min.css.map +1 -1
  64. package/lib/ui/loading.css +43 -280
  65. package/lib/ui/loading.min.css +1 -1
  66. package/lib/ui/loading.min.css.map +1 -1
  67. package/lib/ui/notify.css +5 -5
  68. package/lib/ui/notify.min.css +1 -1
  69. package/lib/ui/notify.min.css.map +1 -1
  70. package/lib/ui/overflow-tips.css +3 -2
  71. package/lib/ui/overflow-tips.min.css +1 -1
  72. package/lib/ui/overflow-tips.min.css.map +1 -1
  73. package/lib/ui/pagination.css +1 -1
  74. package/lib/ui/pagination.min.css +1 -1
  75. package/lib/ui/pagination.min.css.map +1 -1
  76. package/lib/ui/popconfirm.css +2 -2
  77. package/lib/ui/popconfirm.min.css +1 -1
  78. package/lib/ui/popconfirm.min.css.map +1 -1
  79. package/lib/ui/popover.css +3 -2
  80. package/lib/ui/popover.min.css +1 -1
  81. package/lib/ui/popover.min.css.map +1 -1
  82. package/lib/ui/process.css +51 -282
  83. package/lib/ui/process.min.css +1 -1
  84. package/lib/ui/process.min.css.map +1 -1
  85. package/lib/ui/progress.css +2 -2
  86. package/lib/ui/progress.min.css +1 -1
  87. package/lib/ui/progress.min.css.map +1 -1
  88. package/lib/ui/radio.css +64 -64
  89. package/lib/ui/radio.min.css +1 -1
  90. package/lib/ui/radio.min.css.map +1 -1
  91. package/lib/ui/resize-layout.css +13 -5
  92. package/lib/ui/resize-layout.min.css +1 -1
  93. package/lib/ui/resize-layout.min.css.map +1 -1
  94. package/lib/ui/sideslider.css +8 -7
  95. package/lib/ui/sideslider.min.css +1 -1
  96. package/lib/ui/sideslider.min.css.map +1 -1
  97. package/lib/ui/star.css +22 -17
  98. package/lib/ui/star.min.css +1 -1
  99. package/lib/ui/star.min.css.map +1 -1
  100. package/lib/ui/steps.css +372 -274
  101. package/lib/ui/steps.min.css +1 -1
  102. package/lib/ui/steps.min.css.map +1 -1
  103. package/lib/ui/tooltips.css +3 -2
  104. package/lib/ui/tooltips.min.css +1 -1
  105. package/lib/ui/tooltips.min.css.map +1 -1
  106. package/lib/ui/transfer.css +122 -121
  107. package/lib/ui/transfer.min.css +1 -1
  108. package/lib/ui/transfer.min.css.map +1 -1
  109. package/lib/ui/tree.css +45 -282
  110. package/lib/ui/tree.min.css +1 -1
  111. package/lib/ui/tree.min.css.map +1 -1
  112. package/lib/version-detail.js +453 -13
  113. package/package.json +3 -4
package/lib/tag-input.js CHANGED
@@ -1921,11 +1921,11 @@
1921
1921
  staticClass: "point point3"
1922
1922
  }), _c('div', {
1923
1923
  staticClass: "point point4"
1924
- })]], 2), _c('div', {
1924
+ })]], 2), _vm.title ? _c('div', {
1925
1925
  staticClass: "bk-loading-title"
1926
1926
  }, [_vm._t("title", function () {
1927
1927
  return [_vm._v(_vm._s(_vm.title))];
1928
- })], 2)])])], 1) : _c('transition', {
1928
+ })], 2) : _vm._e()])])], 1) : _c('transition', {
1929
1929
  attrs: {
1930
1930
  "name": "fade",
1931
1931
  "duration": {
@@ -1977,11 +1977,11 @@
1977
1977
  staticClass: "point point3"
1978
1978
  }), _c('div', {
1979
1979
  staticClass: "point point4"
1980
- })]], 2), _c('div', {
1980
+ })]], 2), _vm.title ? _c('div', {
1981
1981
  staticClass: "bk-loading-title"
1982
1982
  }, [_vm._t("title", function () {
1983
1983
  return [_vm._v(_vm._s(_vm.title))];
1984
- })], 2)])])]);
1984
+ })], 2) : _vm._e()])])]);
1985
1985
  };
1986
1986
  var __vue_staticRenderFns__ = [];
1987
1987
 
@@ -2040,6 +2040,9 @@
2040
2040
  if (options.title) {
2041
2041
  el.$vm.title = options.title;
2042
2042
  }
2043
+ if (options.size) {
2044
+ el.$vm.size = options.size;
2045
+ }
2043
2046
  }
2044
2047
  var bkLoading = {
2045
2048
  inserted: function inserted(el, binding) {
@@ -5499,24 +5502,33 @@
5499
5502
  enableCollapseTags: function enableCollapseTags() {
5500
5503
  var isPopoverShown = this.popoverInstance && this.popoverInstance.instance && this.popoverInstance.instance.state.isShown;
5501
5504
  return !this.isEdit && this.collapseTags && this.overflowTagIndex && !isPopoverShown;
5505
+ },
5506
+ collapseTooltip: function collapseTooltip() {
5507
+ var _this = this;
5508
+ return this.localTagList.reduce(function (acc, cur, curIndex) {
5509
+ if (_this.overflowTagIndex !== null && curIndex >= _this.overflowTagIndex) {
5510
+ acc.push(cur[_this.displayKey]);
5511
+ }
5512
+ return acc;
5513
+ }, []);
5502
5514
  }
5503
5515
  },
5504
5516
  watch: {
5505
5517
  curInputValue: function curInputValue(newVal, oldVal) {
5506
- var _this = this;
5518
+ var _this2 = this;
5507
5519
  if (newVal !== '' && this.renderList.length) {
5508
5520
  this.showList = true;
5509
5521
  } else if (this.trigger !== 'focus') {
5510
5522
  setTimeout(function () {
5511
- _this.showList = false;
5523
+ _this2.showList = false;
5512
5524
  }, 100);
5513
5525
  }
5514
5526
  },
5515
5527
  showList: function showList(val) {
5516
- var _this2 = this;
5528
+ var _this3 = this;
5517
5529
  if (val) {
5518
5530
  this.$nextTick(function () {
5519
- _this2.showPopover();
5531
+ _this3.showPopover();
5520
5532
  });
5521
5533
  }
5522
5534
  },
@@ -5543,7 +5555,7 @@
5543
5555
  }
5544
5556
  },
5545
5557
  created: function created() {
5546
- var _this3 = this;
5558
+ var _this4 = this;
5547
5559
  this.isSingleSelect = this.maxData === 1;
5548
5560
  this.pageSize = this.maxResult;
5549
5561
  this.getData();
@@ -5551,11 +5563,11 @@
5551
5563
  return _regeneratorRuntime().wrap(function _callee$(_context) {
5552
5564
  while (1) switch (_context.prev = _context.next) {
5553
5565
  case 0:
5554
- _this3.resizing = true;
5566
+ _this4.resizing = true;
5555
5567
  _context.next = 3;
5556
- return _this3.$nextTick(_this3.calcOverflowTagIndex);
5568
+ return _this4.$nextTick(_this4.calcOverflowTagIndex);
5557
5569
  case 3:
5558
- _this3.resizing = false;
5570
+ _this4.resizing = false;
5559
5571
  case 4:
5560
5572
  case "end":
5561
5573
  return _context.stop();
@@ -5564,7 +5576,7 @@
5564
5576
  }));
5565
5577
  },
5566
5578
  mounted: function mounted() {
5567
- var _this4 = this;
5579
+ var _this5 = this;
5568
5580
  this.bkTagSelector = this.$refs.bkTagSelector;
5569
5581
  this.popoverInstance = this.$refs['tagInputDropdown'];
5570
5582
  this.containerResizeObserver = new ResizeObserver(function (entries) {
@@ -5573,8 +5585,8 @@
5573
5585
  try {
5574
5586
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
5575
5587
  var entry = _step.value;
5576
- if (entry.target === _this4.bkTagSelector) {
5577
- _this4.execResizeHandler();
5588
+ if (entry.target === _this5.bkTagSelector) {
5589
+ _this5.execResizeHandler();
5578
5590
  }
5579
5591
  }
5580
5592
  } catch (err) {
@@ -5629,7 +5641,7 @@
5629
5641
  return bitLen;
5630
5642
  },
5631
5643
  filterData: function filterData() {
5632
- var _this5 = this;
5644
+ var _this6 = this;
5633
5645
  var val = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
5634
5646
  val = val.toLowerCase();
5635
5647
  var filterData;
@@ -5638,14 +5650,14 @@
5638
5650
  } else {
5639
5651
  if (isArray$1(this.searchKey)) {
5640
5652
  var filterDataList = this.searchKey.map(function (searchKey) {
5641
- return _this5.initData.filter(function (item) {
5653
+ return _this6.initData.filter(function (item) {
5642
5654
  return item[searchKey].toLowerCase().indexOf(val) !== -1;
5643
5655
  });
5644
5656
  });
5645
5657
  filterData = from_1$1(new set$1(filterDataList.flat()));
5646
5658
  } else {
5647
5659
  filterData = this.initData.filter(function (item) {
5648
- return item[_this5.searchKey].toLowerCase().indexOf(val) !== -1;
5660
+ return item[_this6.searchKey].toLowerCase().indexOf(val) !== -1;
5649
5661
  });
5650
5662
  }
5651
5663
  }
@@ -5672,7 +5684,7 @@
5672
5684
  this.showScrollLoading = false;
5673
5685
  },
5674
5686
  scrollHandler: function scrollHandler(e) {
5675
- var _this6 = this;
5687
+ var _this7 = this;
5676
5688
  if (this.showScrollLoading || this.isBeforeDestroy) {
5677
5689
  return;
5678
5690
  }
@@ -5689,7 +5701,7 @@
5689
5701
  while (1) switch (_context2.prev = _context2.next) {
5690
5702
  case 0:
5691
5703
  _context2.next = 2;
5692
- return _this6.pageChange(curPage);
5704
+ return _this7.pageChange(curPage);
5693
5705
  case 2:
5694
5706
  case "end":
5695
5707
  return _context2.stop();
@@ -5750,15 +5762,15 @@
5750
5762
  return index;
5751
5763
  },
5752
5764
  formatGroupList: function formatGroupList() {
5753
- var _this7 = this;
5765
+ var _this8 = this;
5754
5766
  var allList = [];
5755
5767
  this.list.forEach(function (item) {
5756
5768
  if (item.children) {
5757
5769
  item.children.forEach(function (child) {
5758
5770
  var params = _objectSpread({}, child);
5759
5771
  params.group = {
5760
- groupId: item[_this7.saveKey],
5761
- groupName: item[_this7.displayKey]
5772
+ groupId: item[_this8.saveKey],
5773
+ groupName: item[_this8.displayKey]
5762
5774
  };
5763
5775
  allList.push(params);
5764
5776
  });
@@ -5767,38 +5779,38 @@
5767
5779
  return allList;
5768
5780
  },
5769
5781
  getData: function getData() {
5770
- var _this8 = this;
5782
+ var _this9 = this;
5771
5783
  this.tagList = [];
5772
5784
  this.localTagList = [];
5773
5785
  this.initData = [];
5774
5786
  if (this.useGroup) {
5775
5787
  this.allList = this.formatGroupList();
5776
5788
  this.allList.forEach(function (item) {
5777
- _this8.initData.push(item);
5789
+ _this9.initData.push(item);
5778
5790
  });
5779
5791
  } else {
5780
5792
  this.list.forEach(function (item) {
5781
- _this8.initData.push(item);
5793
+ _this9.initData.push(item);
5782
5794
  });
5783
5795
  }
5784
5796
  if (this.value.length) {
5785
5797
  this.value.forEach(function (tag) {
5786
- var val = _this8.initData.find(function (val) {
5787
- return tag === val[_this8.saveKey];
5798
+ var val = _this9.initData.find(function (val) {
5799
+ return tag === val[_this9.saveKey];
5788
5800
  });
5789
5801
  if (val !== undefined) {
5790
- _this8.localTagList.push(val);
5791
- _this8.tagList.push(val[_this8.saveKey]);
5792
- } else if (_this8.allowCreate && !_this8.tagList.includes(tag)) {
5802
+ _this9.localTagList.push(val);
5803
+ _this9.tagList.push(val[_this9.saveKey]);
5804
+ } else if (_this9.allowCreate && !_this9.tagList.includes(tag)) {
5793
5805
  var _temp;
5794
- var temp = (_temp = {}, _defineProperty(_temp, _this8.saveKey, tag), _defineProperty(_temp, _this8.displayKey, tag), _temp);
5795
- _this8.localTagList.splice(_this8.localTagList.length, 0, temp);
5796
- _this8.tagList.splice(_this8.tagList.length, 0, tag);
5806
+ var temp = (_temp = {}, _defineProperty(_temp, _this9.saveKey, tag), _defineProperty(_temp, _this9.displayKey, tag), _temp);
5807
+ _this9.localTagList.splice(_this9.localTagList.length, 0, temp);
5808
+ _this9.tagList.splice(_this9.tagList.length, 0, tag);
5797
5809
  }
5798
5810
  });
5799
5811
  if (!this.isSingleSelect) {
5800
5812
  this.initData = this.initData.filter(function (val) {
5801
- return !_this8.value.includes(val[_this8.saveKey]);
5813
+ return !_this9.value.includes(val[_this9.saveKey]);
5802
5814
  });
5803
5815
  }
5804
5816
  }
@@ -5814,30 +5826,30 @@
5814
5826
  this.$refs.input.style.width = this.INPUT_MIN_WIDTH + 'px';
5815
5827
  },
5816
5828
  handleInput: function handleInput(event) {
5817
- var _this9 = this;
5829
+ var _this10 = this;
5818
5830
  var value = event.target.value;
5819
5831
  this.$emit('inputchange', value);
5820
5832
  this.$nextTick(function () {
5821
- if (_this9.maxData === -1 || _this9.maxData > _this9.tagList.length) {
5822
- var charLen = _this9.getCharLength(value);
5823
- _this9.cacheVal = value;
5833
+ if (_this10.maxData === -1 || _this10.maxData > _this10.tagList.length) {
5834
+ var charLen = _this10.getCharLength(value);
5835
+ _this10.cacheVal = value;
5824
5836
  if (charLen) {
5825
- _this9.isCanRemoveTag = false;
5826
- _this9.filterData(value);
5827
- _this9.$refs.input.style.width = charLen * _this9.INPUT_MIN_WIDTH + 'px';
5837
+ _this10.isCanRemoveTag = false;
5838
+ _this10.filterData(value);
5839
+ _this10.$refs.input.style.width = charLen * _this10.INPUT_MIN_WIDTH + 'px';
5828
5840
  } else {
5829
- _this9.isCanRemoveTag = true;
5830
- if (_this9.trigger === 'focus') {
5831
- _this9.filterData();
5841
+ _this10.isCanRemoveTag = true;
5842
+ if (_this10.trigger === 'focus') {
5843
+ _this10.filterData();
5832
5844
  }
5833
5845
  }
5834
5846
  } else {
5835
- _this9.handleBlur();
5836
- _this9.curInputValue = '';
5837
- _this9.showList = false;
5847
+ _this10.handleBlur();
5848
+ _this10.curInputValue = '';
5849
+ _this10.showList = false;
5838
5850
  }
5839
- _this9.isEdit = true;
5840
- _this9.focusItemIndex = _this9.allowCreate ? -1 : 0;
5851
+ _this10.isEdit = true;
5852
+ _this10.focusItemIndex = _this10.allowCreate ? -1 : 0;
5841
5853
  });
5842
5854
  },
5843
5855
  handleFocus: function handleFocus(event) {
@@ -5848,7 +5860,7 @@
5848
5860
  this.$emit('focus', this.tagList);
5849
5861
  },
5850
5862
  handlePaste: function handlePaste(event) {
5851
- var _this10 = this;
5863
+ var _this11 = this;
5852
5864
  if (this.isSingleSelect) {
5853
5865
  return false;
5854
5866
  }
@@ -5863,7 +5875,7 @@
5863
5875
  var valArr = this.pasteFn ? this.pasteFn(value) : this.defaultPasteFn(value);
5864
5876
  var tags = [];
5865
5877
  valArr.map(function (val) {
5866
- return tags.push(val[_this10.saveKey]);
5878
+ return tags.push(val[_this11.saveKey]);
5867
5879
  });
5868
5880
  if (tags.length) {
5869
5881
  var nodes = this.$refs.tagList.childNodes;
@@ -5871,10 +5883,10 @@
5871
5883
  var localTags = [];
5872
5884
  var localInitDara = [];
5873
5885
  this.initData.map(function (data) {
5874
- localInitDara.push(data[_this10.saveKey]);
5886
+ localInitDara.push(data[_this11.saveKey]);
5875
5887
  });
5876
5888
  tags = tags.filter(function (tag) {
5877
- return tag && tag.trim() && !_this10.tagList.includes(tag) && localInitDara.includes(tag);
5889
+ return tag && tag.trim() && !_this11.tagList.includes(tag) && localInitDara.includes(tag);
5878
5890
  });
5879
5891
  if (this.maxData !== -1) {
5880
5892
  if (this.tagList.length < this.maxData) {
@@ -5888,8 +5900,8 @@
5888
5900
  }
5889
5901
  tags.map(function (tag) {
5890
5902
  var temp = {};
5891
- temp[_this10.saveKey] = tag;
5892
- temp[_this10.displayKey] = tag;
5903
+ temp[_this11.saveKey] = tag;
5904
+ temp[_this11.displayKey] = tag;
5893
5905
  localTags.push(temp);
5894
5906
  });
5895
5907
  if (tags.length) {
@@ -5901,36 +5913,36 @@
5901
5913
  this.focusInputer();
5902
5914
  this.$refs.input.style.width = this.INPUT_MIN_WIDTH + 'px';
5903
5915
  this.initData = this.initData.filter(function (val) {
5904
- return !tags.includes(val[_this10.saveKey]);
5916
+ return !tags.includes(val[_this11.saveKey]);
5905
5917
  });
5906
5918
  this.handlerChange('select');
5907
5919
  }
5908
5920
  }
5909
5921
  },
5910
5922
  defaultPasteFn: function defaultPasteFn(val) {
5911
- var _this11 = this;
5923
+ var _this12 = this;
5912
5924
  var target = [];
5913
5925
  var textArr = val.split(';');
5914
5926
  textArr.map(function (item) {
5915
5927
  if (item.match(/^[a-zA-Z][a-zA-Z_]+/g)) {
5916
5928
  var finalItem = item.match(/^[a-zA-Z][a-zA-Z_]+/g).join('');
5917
5929
  var temp = {};
5918
- temp[_this11.saveKey] = finalItem;
5919
- temp[_this11.displayKey] = finalItem;
5930
+ temp[_this12.saveKey] = finalItem;
5931
+ temp[_this12.displayKey] = finalItem;
5920
5932
  target.push(temp);
5921
5933
  }
5922
5934
  });
5923
5935
  return target;
5924
5936
  },
5925
5937
  updateScrollTop: function updateScrollTop() {
5926
- var _this12 = this;
5938
+ var _this13 = this;
5927
5939
  var panelObj = this.$refs.selectorList;
5928
5940
  var panelInfo = {
5929
5941
  height: panelObj.clientHeight,
5930
5942
  yAxis: panelObj.getBoundingClientRect().y
5931
5943
  };
5932
5944
  this.$nextTick(function () {
5933
- var activeObj = _this12.$refs.selectorList.querySelector('.bk-selector-actived');
5945
+ var activeObj = _this13.$refs.selectorList.querySelector('.bk-selector-actived');
5934
5946
  if (!activeObj) {
5935
5947
  return;
5936
5948
  }
@@ -6042,7 +6054,7 @@
6042
6054
  this.showList = false;
6043
6055
  },
6044
6056
  backspaceHandler: function backspaceHandler(index, target) {
6045
- var _this13 = this;
6057
+ var _this14 = this;
6046
6058
  if (!this.curInputValue) {
6047
6059
  if (this.isCanRemoveTag) {
6048
6060
  this.tagList.splice(index - 1, 1);
@@ -6055,7 +6067,7 @@
6055
6067
  this.focusInputer();
6056
6068
  var localList = this.useGroup ? this.allList : this.list;
6057
6069
  var isExistInit = localList.some(function (item) {
6058
- return item === target[_this13.saveKey];
6070
+ return item === target[_this14.saveKey];
6059
6071
  });
6060
6072
  if ((this.allowCreate && isExistInit || !this.allowCreate) && !this.isSingleSelect) {
6061
6073
  this.initData.push(target);
@@ -6073,19 +6085,19 @@
6073
6085
  this.handlerChange('remove');
6074
6086
  },
6075
6087
  removeTag: function removeTag(data, index) {
6076
- var _this14 = this;
6088
+ var _this15 = this;
6077
6089
  this.tagList.splice(index, 1);
6078
6090
  this.localTagList.splice(index, 1);
6079
6091
  var localList = this.useGroup ? this.allList : this.list;
6080
6092
  var isExistInit = localList.some(function (item) {
6081
- return item === data[_this14.saveKey];
6093
+ return item === data[_this15.saveKey];
6082
6094
  });
6083
6095
  if ((this.allowCreate && isExistInit || !this.allowCreate) && !this.isSingleSelect) {
6084
6096
  this.initData.push(data);
6085
6097
  }
6086
6098
  },
6087
6099
  addTag: function addTag(item, type) {
6088
- var _this15 = this;
6100
+ var _this16 = this;
6089
6101
  var nodes = this.$refs.tagList.childNodes;
6090
6102
  var result = this.getSiteInfo();
6091
6103
  var isSelected = false;
@@ -6096,13 +6108,13 @@
6096
6108
  var localTags = [];
6097
6109
  tags = item.split(this.separator);
6098
6110
  tags = tags.filter(function (tag) {
6099
- var validate = typeof _this15.createTagValidator === 'function' ? _this15.createTagValidator(tag) : true;
6100
- return tag && tag.trim() && !_this15.tagList.includes(tag) && validate;
6111
+ var validate = typeof _this16.createTagValidator === 'function' ? _this16.createTagValidator(tag) : true;
6112
+ return tag && tag.trim() && !_this16.tagList.includes(tag) && validate;
6101
6113
  });
6102
6114
  tags.forEach(function (tag) {
6103
6115
  var temp = {};
6104
- temp[_this15.saveKey] = tag;
6105
- temp[_this15.displayKey] = tag;
6116
+ temp[_this16.saveKey] = tag;
6117
+ temp[_this16.displayKey] = tag;
6106
6118
  localTags.push(temp);
6107
6119
  });
6108
6120
  if (tags.length) {
@@ -6147,14 +6159,14 @@
6147
6159
  if (isSelected) {
6148
6160
  this.$nextTick(function () {
6149
6161
  var site = nodes[_parseInt$2(result.index, 10) + 1];
6150
- _this15.insertAfter(_this15.$refs.staffInput, site);
6151
- _this15.$refs.input.style.width = _this15.INPUT_MIN_WIDTH + 'px';
6152
- if (!_this15.isSingleSelect && _this15.allowNextFocus) {
6153
- _this15.focusInputer();
6162
+ _this16.insertAfter(_this16.$refs.staffInput, site);
6163
+ _this16.$refs.input.style.width = _this16.INPUT_MIN_WIDTH + 'px';
6164
+ if (!_this16.isSingleSelect && _this16.allowNextFocus) {
6165
+ _this16.focusInputer();
6154
6166
  }
6155
- if (!_this15.isSingleSelect) {
6156
- _this15.initData = _this15.initData.filter(function (val) {
6157
- return !_this15.tagList.includes(val[_this15.saveKey]);
6167
+ if (!_this16.isSingleSelect) {
6168
+ _this16.initData = _this16.initData.filter(function (val) {
6169
+ return !_this16.tagList.includes(val[_this16.saveKey]);
6158
6170
  });
6159
6171
  }
6160
6172
  });
@@ -6172,35 +6184,35 @@
6172
6184
  this.cacheVal = '';
6173
6185
  },
6174
6186
  handleBlur: function handleBlur(inputValue) {
6175
- var _this16 = this;
6187
+ var _this17 = this;
6176
6188
  this.timer = setTimeout(function () {
6177
- var inputValue = _this16.curInputValue;
6178
- _this16.clearInput();
6179
- _this16.dispatch('bk-form-item', 'form-blur');
6180
- _this16.isEdit = false;
6181
- if (_this16.isSingleSelect) {
6182
- var _this16$tagListCache = _slicedToArray(_this16.tagListCache, 1),
6183
- oldVal = _this16$tagListCache[0];
6184
- if (inputValue && inputValue === oldVal && _this16.localTagListCache.length) {
6185
- _this16.addTag(_this16.localTagListCache[0], 'select');
6189
+ var inputValue = _this17.curInputValue;
6190
+ _this17.clearInput();
6191
+ _this17.dispatch('bk-form-item', 'form-blur');
6192
+ _this17.isEdit = false;
6193
+ if (_this17.isSingleSelect) {
6194
+ var _this17$tagListCache = _slicedToArray(_this17.tagListCache, 1),
6195
+ oldVal = _this17$tagListCache[0];
6196
+ if (inputValue && inputValue === oldVal && _this17.localTagListCache.length) {
6197
+ _this17.addTag(_this17.localTagListCache[0], 'select');
6186
6198
  } else {
6187
- _this16.handlerChange('remove');
6199
+ _this17.handlerChange('remove');
6188
6200
  }
6189
- } else if (_this16.allowAutoMatch && inputValue) {
6190
- var matchItem = _this16.renderList.find(function (item) {
6191
- return item[_this16.searchKey] === inputValue;
6201
+ } else if (_this17.allowAutoMatch && inputValue) {
6202
+ var matchItem = _this17.renderList.find(function (item) {
6203
+ return item[_this17.searchKey] === inputValue;
6192
6204
  });
6193
6205
  if (matchItem) {
6194
- _this16.handlerResultSelect(matchItem, 'select');
6195
- } else if (_this16.allowCreate) {
6196
- _this16.handlerResultSelect(inputValue, 'custom');
6206
+ _this17.handlerResultSelect(matchItem, 'select');
6207
+ } else if (_this17.allowCreate) {
6208
+ _this17.handlerResultSelect(inputValue, 'custom');
6197
6209
  }
6198
6210
  }
6199
- _this16.$emit('blur', inputValue, _this16.tagList);
6211
+ _this17.$emit('blur', inputValue, _this17.tagList);
6200
6212
  }, 200);
6201
6213
  },
6202
6214
  focusInputer: function focusInputer(event) {
6203
- var _this17 = this;
6215
+ var _this18 = this;
6204
6216
  if (this.disabled) {
6205
6217
  return;
6206
6218
  }
@@ -6225,11 +6237,11 @@
6225
6237
  }
6226
6238
  this.isEdit = true;
6227
6239
  this.$nextTick(function () {
6228
- _this17.$refs.input.focus();
6229
- if (_this17.trigger === 'focus') {
6230
- _this17.showList = true;
6231
- _this17.filterData();
6232
- _this17.showPopover();
6240
+ _this18.$refs.input.focus();
6241
+ if (_this18.trigger === 'focus') {
6242
+ _this18.showList = true;
6243
+ _this18.filterData();
6244
+ _this18.showPopover();
6233
6245
  }
6234
6246
  });
6235
6247
  },
@@ -6347,6 +6359,14 @@
6347
6359
  }
6348
6360
  }) : _vm._e()], 1);
6349
6361
  }), _vm.enableCollapseTags && _vm.localTagList.length > _vm.overflowTagIndex ? _c('li', {
6362
+ directives: [{
6363
+ name: "bk-tooltips",
6364
+ rawName: "v-bk-tooltips",
6365
+ value: {
6366
+ content: _vm.collapseTooltip.join(', ')
6367
+ },
6368
+ expression: "{ content: collapseTooltip.join(', ') }"
6369
+ }],
6350
6370
  staticClass: "key-node"
6351
6371
  }, [_c('div', {
6352
6372
  staticClass: "tag"
@@ -2738,7 +2738,7 @@
2738
2738
  if (this.shortcutSelectedIndex !== -1) {
2739
2739
  shortcut = this.shortcuts[this.shortcutSelectedIndex] || null;
2740
2740
  if (shortcut) {
2741
- initialValue = shortcut.value();
2741
+ initialValue = [shortcut.value()];
2742
2742
  }
2743
2743
  }
2744
2744
  var focusedTime = initialValue.map(extractTime);
package/lib/timeline.js CHANGED
@@ -97,8 +97,16 @@
97
97
  components: {
98
98
  vnodeIcon: {
99
99
  functional: true,
100
- render: function render(h, ctx) {
101
- return ctx.props.icon;
100
+ render: function render(_, _ref) {
101
+ var props = _ref.props;
102
+ return props.icon;
103
+ }
104
+ },
105
+ ContentVnode: {
106
+ functional: true,
107
+ render: function render(_, _ref2) {
108
+ var props = _ref2.props;
109
+ return props.content;
102
110
  }
103
111
  }
104
112
  },
@@ -126,9 +134,9 @@
126
134
  this.$emit('select', item);
127
135
  },
128
136
  makeClass: function makeClass(item) {
129
- var _ref;
137
+ var _ref3;
130
138
  var classPrefix = 'bk-timeline-item-';
131
- var classNames = [(_ref = {}, _defineProperty(_ref, "".concat(classPrefix, "filled"), item.filled), _defineProperty(_ref, "".concat(classPrefix, "custom-icon"), this.isCustomIcon(item.icon)), _ref)];
139
+ var classNames = [(_ref3 = {}, _defineProperty(_ref3, "".concat(classPrefix, "filled"), item.filled), _defineProperty(_ref3, "".concat(classPrefix, "custom-icon"), this.isCustomIcon(item.icon)), _ref3)];
132
140
  var dotColors = ['blue', 'red', 'green', 'yellow', 'gray'];
133
141
  if (item.size) {
134
142
  classNames.push("".concat(classPrefix).concat(item.size));
@@ -148,9 +156,6 @@
148
156
  return false;
149
157
  }
150
158
  },
151
- nodeContent: function nodeContent(data, index) {
152
- this.$slots["nodeContent".concat(index)] = [data.content];
153
- },
154
159
  isBuiltinIcon: function isBuiltinIcon(icon) {
155
160
  return typeof icon === 'string';
156
161
  },
@@ -268,16 +273,20 @@
268
273
  }) : _vm._e()];
269
274
  }, null, item), item.content ? _c('div', {
270
275
  staticClass: "bk-timeline-content"
271
- }, [_vm.isNode(item) ? [_vm._t('nodeContent' + index, function () {
272
- return [_vm._v(_vm._s(_vm.nodeContent(item, index)))];
273
- })] : [_c('div', {
274
- attrs: {
275
- "title": _vm.computedTitle(item.content)
276
- },
277
- domProps: {
278
- "innerHTML": _vm._s(item.content)
279
- }
280
- })]], 2) : _vm._e()], 2)]);
276
+ }, [_vm._t("nodeContent" + index, function () {
277
+ return [_vm.isNode(item) ? [_c('content-vnode', {
278
+ attrs: {
279
+ "content": item.content
280
+ }
281
+ })] : [_c('div', {
282
+ attrs: {
283
+ "title": _vm.computedTitle(item.content)
284
+ },
285
+ domProps: {
286
+ "innerHTML": _vm._s(item.content)
287
+ }
288
+ })]];
289
+ }, null, item)], 2) : _vm._e()], 2)]);
281
290
  }), 0);
282
291
  };
283
292
  var __vue_staticRenderFns__ = [];