bk-magic-vue 2.5.4-beta.2 → 2.5.4-beta.4

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.
@@ -7740,6 +7740,19 @@
7740
7740
  if (e && pickerPanel && pickerPanel.contains(e.target)) {
7741
7741
  return;
7742
7742
  }
7743
+ var _this$$slots = this.$slots,
7744
+ headerSlots = _this$$slots.header,
7745
+ footerSlots = _this$$slots.footer;
7746
+ for (var i = 0; i < headerSlots.length; i++) {
7747
+ if (headerSlots[i].elm.contains(e.target)) {
7748
+ return;
7749
+ }
7750
+ }
7751
+ for (var _i = 0; _i < footerSlots.length; _i++) {
7752
+ if (footerSlots[_i].elm.contains(e.target)) {
7753
+ return;
7754
+ }
7755
+ }
7743
7756
  this.visible = false;
7744
7757
  e && e.preventDefault();
7745
7758
  e && e.stopPropagation();
@@ -52663,6 +52676,7 @@
52663
52676
  checked: false,
52664
52677
  expanded: tree.defaultExpandAll,
52665
52678
  disabled: false,
52679
+ disableCheck: false,
52666
52680
  visible: true,
52667
52681
  matched: true,
52668
52682
  loading: false,
@@ -52734,6 +52748,14 @@
52734
52748
  }
52735
52749
  return showCheckbox;
52736
52750
  }
52751
+ }, {
52752
+ key: "disableCheck",
52753
+ get: function get() {
52754
+ return this.state.disableCheck;
52755
+ },
52756
+ set: function set(disableCheck) {
52757
+ this.setState('disableCheck', disableCheck);
52758
+ }
52737
52759
  }, {
52738
52760
  key: "collapseIcon",
52739
52761
  get: function get() {
@@ -52787,7 +52809,7 @@
52787
52809
  }, {
52788
52810
  key: "checkable",
52789
52811
  get: function get() {
52790
- if (this.disabled) {
52812
+ if (this.disabled || this.disableCheck) {
52791
52813
  return false;
52792
52814
  }
52793
52815
  if (this.tree.inSearch && this.tree.checkOnlyAvailableStrictly) {
@@ -53040,7 +53062,7 @@
53040
53062
  }) : _vm._e(), _vm.props.node.hasCheckbox ? _c('span', {
53041
53063
  staticClass: "node-checkbox",
53042
53064
  class: {
53043
- 'is-disabled': _vm.props.node.disabled,
53065
+ 'is-disabled': _vm.props.node.disabled || _vm.props.node.disableCheck,
53044
53066
  'is-checked': _vm.props.node.checked,
53045
53067
  'is-indeterminate': _vm.props.node.indeterminate
53046
53068
  },
@@ -53643,15 +53665,39 @@
53643
53665
  console.warn(e.message);
53644
53666
  }
53645
53667
  },
53646
- handleCalculateLine: function handleCalculateLine() {
53668
+ setDisableCheck: function setDisableCheck(nodeId) {
53647
53669
  var _this11 = this;
53670
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
53671
+ try {
53672
+ var mergeOptions = _objectSpread({
53673
+ disabled: true,
53674
+ emitEvent: false
53675
+ }, options);
53676
+ var ids = convertToArray(nodeId);
53677
+ var nodes = ids.map(function (id) {
53678
+ return _this11.getNodeById(id);
53679
+ }).filter(function (node) {
53680
+ return !!node;
53681
+ });
53682
+ nodes.forEach(function (node) {
53683
+ node.disableCheck = mergeOptions.disabled;
53684
+ });
53685
+ if (mergeOptions.emitEvent) {
53686
+ this.$emit('disable-check-change', nodes.length > 1 ? nodes : nodes[0]);
53687
+ }
53688
+ } catch (e) {
53689
+ console.warn(e.message);
53690
+ }
53691
+ },
53692
+ handleCalculateLine: function handleCalculateLine() {
53693
+ var _this12 = this;
53648
53694
  this.calculateTimer && clearTimeout(this.calculateTimer);
53649
53695
  if (this.needsCalculateNodes.length) {
53650
53696
  this.calculateTimer = setTimeout(function () {
53651
- _this11.needsCalculateNodes.forEach(function (node) {
53652
- _this11.calculateNodeLine(node);
53697
+ _this12.needsCalculateNodes.forEach(function (node) {
53698
+ _this12.calculateNodeLine(node);
53653
53699
  });
53654
- _this11.needsCalculateNodes.splice(0);
53700
+ _this12.needsCalculateNodes.splice(0);
53655
53701
  }, 0);
53656
53702
  } else {
53657
53703
  this.calculateTimer = null;
@@ -53682,7 +53728,7 @@
53682
53728
  return String(node.name).toLowerCase().indexOf(keyword) > -1;
53683
53729
  },
53684
53730
  filter: function filter() {
53685
- var _this12 = this;
53731
+ var _this13 = this;
53686
53732
  var keyword = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
53687
53733
  var matchedNodes = [];
53688
53734
  var filterMethod = this.filterMethod || this.defaultFilterMethod;
@@ -53691,7 +53737,7 @@
53691
53737
  this.nodes.forEach(function (node) {
53692
53738
  node.setState('matched', true);
53693
53739
  node.recalculateLinkLine();
53694
- if (_this12.checkOnlyAvailableStrictly) {
53740
+ if (_this13.checkOnlyAvailableStrictly) {
53695
53741
  node.setState('checked', false);
53696
53742
  }
53697
53743
  matchedNodes.push(node);
@@ -53702,7 +53748,7 @@
53702
53748
  this.nodes.forEach(function (node) {
53703
53749
  var matched = filterMethod(convertKeyword, node);
53704
53750
  node.setState('matched', matched);
53705
- if (_this12.checkOnlyAvailableStrictly) {
53751
+ if (_this13.checkOnlyAvailableStrictly) {
53706
53752
  node.setState('checked', false);
53707
53753
  }
53708
53754
  if (matched) {
@@ -53746,7 +53792,7 @@
53746
53792
  });
53747
53793
  },
53748
53794
  handleNodeCheck: function handleNodeCheck(node) {
53749
- if (node.disabled) {
53795
+ if (node.disabled || node.disableCheck) {
53750
53796
  return false;
53751
53797
  }
53752
53798
  this.setChecked(node.id, {
@@ -53756,14 +53802,14 @@
53756
53802
  });
53757
53803
  },
53758
53804
  setVirtualScrollList: function setVirtualScrollList() {
53759
- var _this13 = this;
53805
+ var _this14 = this;
53760
53806
  if (!this.height) return;
53761
53807
  if (!this.$refs.virtualScroll) {
53762
53808
  console.warn('virtual dom is not ready');
53763
53809
  return;
53764
53810
  }
53765
53811
  this.$nextTick(function () {
53766
- _this13.$refs.virtualScroll.setListData(_this13.visibleNodes);
53812
+ _this14.$refs.virtualScroll.setListData(_this14.visibleNodes);
53767
53813
  });
53768
53814
  },
53769
53815
  resize: function resize() {