bk-magic-vue 2.5.4-beta.3 → 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.
@@ -52676,6 +52676,7 @@
52676
52676
  checked: false,
52677
52677
  expanded: tree.defaultExpandAll,
52678
52678
  disabled: false,
52679
+ disableCheck: false,
52679
52680
  visible: true,
52680
52681
  matched: true,
52681
52682
  loading: false,
@@ -52747,6 +52748,14 @@
52747
52748
  }
52748
52749
  return showCheckbox;
52749
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
+ }
52750
52759
  }, {
52751
52760
  key: "collapseIcon",
52752
52761
  get: function get() {
@@ -52800,7 +52809,7 @@
52800
52809
  }, {
52801
52810
  key: "checkable",
52802
52811
  get: function get() {
52803
- if (this.disabled) {
52812
+ if (this.disabled || this.disableCheck) {
52804
52813
  return false;
52805
52814
  }
52806
52815
  if (this.tree.inSearch && this.tree.checkOnlyAvailableStrictly) {
@@ -53053,7 +53062,7 @@
53053
53062
  }) : _vm._e(), _vm.props.node.hasCheckbox ? _c('span', {
53054
53063
  staticClass: "node-checkbox",
53055
53064
  class: {
53056
- 'is-disabled': _vm.props.node.disabled,
53065
+ 'is-disabled': _vm.props.node.disabled || _vm.props.node.disableCheck,
53057
53066
  'is-checked': _vm.props.node.checked,
53058
53067
  'is-indeterminate': _vm.props.node.indeterminate
53059
53068
  },
@@ -53656,15 +53665,39 @@
53656
53665
  console.warn(e.message);
53657
53666
  }
53658
53667
  },
53659
- handleCalculateLine: function handleCalculateLine() {
53668
+ setDisableCheck: function setDisableCheck(nodeId) {
53660
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;
53661
53694
  this.calculateTimer && clearTimeout(this.calculateTimer);
53662
53695
  if (this.needsCalculateNodes.length) {
53663
53696
  this.calculateTimer = setTimeout(function () {
53664
- _this11.needsCalculateNodes.forEach(function (node) {
53665
- _this11.calculateNodeLine(node);
53697
+ _this12.needsCalculateNodes.forEach(function (node) {
53698
+ _this12.calculateNodeLine(node);
53666
53699
  });
53667
- _this11.needsCalculateNodes.splice(0);
53700
+ _this12.needsCalculateNodes.splice(0);
53668
53701
  }, 0);
53669
53702
  } else {
53670
53703
  this.calculateTimer = null;
@@ -53695,7 +53728,7 @@
53695
53728
  return String(node.name).toLowerCase().indexOf(keyword) > -1;
53696
53729
  },
53697
53730
  filter: function filter() {
53698
- var _this12 = this;
53731
+ var _this13 = this;
53699
53732
  var keyword = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
53700
53733
  var matchedNodes = [];
53701
53734
  var filterMethod = this.filterMethod || this.defaultFilterMethod;
@@ -53704,7 +53737,7 @@
53704
53737
  this.nodes.forEach(function (node) {
53705
53738
  node.setState('matched', true);
53706
53739
  node.recalculateLinkLine();
53707
- if (_this12.checkOnlyAvailableStrictly) {
53740
+ if (_this13.checkOnlyAvailableStrictly) {
53708
53741
  node.setState('checked', false);
53709
53742
  }
53710
53743
  matchedNodes.push(node);
@@ -53715,7 +53748,7 @@
53715
53748
  this.nodes.forEach(function (node) {
53716
53749
  var matched = filterMethod(convertKeyword, node);
53717
53750
  node.setState('matched', matched);
53718
- if (_this12.checkOnlyAvailableStrictly) {
53751
+ if (_this13.checkOnlyAvailableStrictly) {
53719
53752
  node.setState('checked', false);
53720
53753
  }
53721
53754
  if (matched) {
@@ -53759,7 +53792,7 @@
53759
53792
  });
53760
53793
  },
53761
53794
  handleNodeCheck: function handleNodeCheck(node) {
53762
- if (node.disabled) {
53795
+ if (node.disabled || node.disableCheck) {
53763
53796
  return false;
53764
53797
  }
53765
53798
  this.setChecked(node.id, {
@@ -53769,14 +53802,14 @@
53769
53802
  });
53770
53803
  },
53771
53804
  setVirtualScrollList: function setVirtualScrollList() {
53772
- var _this13 = this;
53805
+ var _this14 = this;
53773
53806
  if (!this.height) return;
53774
53807
  if (!this.$refs.virtualScroll) {
53775
53808
  console.warn('virtual dom is not ready');
53776
53809
  return;
53777
53810
  }
53778
53811
  this.$nextTick(function () {
53779
- _this13.$refs.virtualScroll.setListData(_this13.visibleNodes);
53812
+ _this14.$refs.virtualScroll.setListData(_this14.visibleNodes);
53780
53813
  });
53781
53814
  },
53782
53815
  resize: function resize() {