bk-magic-vue 2.5.6-beta.1 → 2.5.6-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.
@@ -12359,6 +12359,13 @@
12359
12359
  instance.ins.remove();
12360
12360
  }
12361
12361
  }
12362
+ },
12363
+ isMaskShown: function isMaskShown() {
12364
+ var mask = document.querySelector('[data-bkpop-mask]');
12365
+ if (mask) {
12366
+ return mask.classList.contains('show-active');
12367
+ }
12368
+ return false;
12362
12369
  }
12363
12370
  };
12364
12371
  defineProperty$1(popManager, 'container', {
@@ -43712,27 +43719,31 @@
43712
43719
  this.$refs.input.style.width = this.INPUT_MIN_WIDTH + 'px';
43713
43720
  },
43714
43721
  handleInput: function handleInput(event) {
43715
- if (this.maxData === -1 || this.maxData > this.tagList.length) {
43716
- var value = event.target.value;
43717
- var charLen = this.getCharLength(value);
43718
- this.cacheVal = value;
43719
- if (charLen) {
43720
- this.isCanRemoveTag = false;
43721
- this.filterData(value);
43722
- this.$refs.input.style.width = charLen * this.INPUT_MIN_WIDTH + 'px';
43723
- } else {
43724
- this.isCanRemoveTag = true;
43725
- if (this.trigger === 'focus') {
43726
- this.filterData();
43722
+ var _this7 = this;
43723
+ var value = event.target.value;
43724
+ this.$emit('inputchange', value);
43725
+ this.$nextTick(function () {
43726
+ if (_this7.maxData === -1 || _this7.maxData > _this7.tagList.length) {
43727
+ var charLen = _this7.getCharLength(value);
43728
+ _this7.cacheVal = value;
43729
+ if (charLen) {
43730
+ _this7.isCanRemoveTag = false;
43731
+ _this7.filterData(value);
43732
+ _this7.$refs.input.style.width = charLen * _this7.INPUT_MIN_WIDTH + 'px';
43733
+ } else {
43734
+ _this7.isCanRemoveTag = true;
43735
+ if (_this7.trigger === 'focus') {
43736
+ _this7.filterData();
43737
+ }
43727
43738
  }
43739
+ } else {
43740
+ _this7.handleBlur();
43741
+ _this7.curInputValue = '';
43742
+ _this7.showList = false;
43728
43743
  }
43729
- } else {
43730
- this.handleBlur();
43731
- this.curInputValue = '';
43732
- this.showList = false;
43733
- }
43734
- this.isEdit = true;
43735
- this.focusItemIndex = this.allowCreate ? -1 : 0;
43744
+ _this7.isEdit = true;
43745
+ _this7.focusItemIndex = _this7.allowCreate ? -1 : 0;
43746
+ });
43736
43747
  },
43737
43748
  handleFocus: function handleFocus(event) {
43738
43749
  this.isCanRemoveTag = true;
@@ -43741,7 +43752,7 @@
43741
43752
  event.currentTarget.select();
43742
43753
  },
43743
43754
  handlePaste: function handlePaste(event) {
43744
- var _this7 = this;
43755
+ var _this8 = this;
43745
43756
  if (this.isSingleSelect) {
43746
43757
  return false;
43747
43758
  }
@@ -43756,7 +43767,7 @@
43756
43767
  var valArr = this.pasteFn ? this.pasteFn(value) : this.defaultPasteFn(value);
43757
43768
  var tags = [];
43758
43769
  valArr.map(function (val) {
43759
- return tags.push(val[_this7.saveKey]);
43770
+ return tags.push(val[_this8.saveKey]);
43760
43771
  });
43761
43772
  if (tags.length) {
43762
43773
  var nodes = this.$refs.tagList.childNodes;
@@ -43764,10 +43775,10 @@
43764
43775
  var localTags = [];
43765
43776
  var localInitDara = [];
43766
43777
  this.initData.map(function (data) {
43767
- localInitDara.push(data[_this7.saveKey]);
43778
+ localInitDara.push(data[_this8.saveKey]);
43768
43779
  });
43769
43780
  tags = tags.filter(function (tag) {
43770
- return tag && tag.trim() && !_this7.tagList.includes(tag) && localInitDara.includes(tag);
43781
+ return tag && tag.trim() && !_this8.tagList.includes(tag) && localInitDara.includes(tag);
43771
43782
  });
43772
43783
  if (this.maxData !== -1) {
43773
43784
  if (this.tagList.length < this.maxData) {
@@ -43781,8 +43792,8 @@
43781
43792
  }
43782
43793
  tags.map(function (tag) {
43783
43794
  var temp = {};
43784
- temp[_this7.saveKey] = tag;
43785
- temp[_this7.displayKey] = tag;
43795
+ temp[_this8.saveKey] = tag;
43796
+ temp[_this8.displayKey] = tag;
43786
43797
  localTags.push(temp);
43787
43798
  });
43788
43799
  if (tags.length) {
@@ -43794,36 +43805,36 @@
43794
43805
  this.focusInputer();
43795
43806
  this.$refs.input.style.width = this.INPUT_MIN_WIDTH + 'px';
43796
43807
  this.initData = this.initData.filter(function (val) {
43797
- return !tags.includes(val[_this7.saveKey]);
43808
+ return !tags.includes(val[_this8.saveKey]);
43798
43809
  });
43799
43810
  this.handlerChange('select');
43800
43811
  }
43801
43812
  }
43802
43813
  },
43803
43814
  defaultPasteFn: function defaultPasteFn(val) {
43804
- var _this8 = this;
43815
+ var _this9 = this;
43805
43816
  var target = [];
43806
43817
  var textArr = val.split(';');
43807
43818
  textArr.map(function (item) {
43808
43819
  if (item.match(/^[a-zA-Z][a-zA-Z_]+/g)) {
43809
43820
  var finalItem = item.match(/^[a-zA-Z][a-zA-Z_]+/g).join('');
43810
43821
  var temp = {};
43811
- temp[_this8.saveKey] = finalItem;
43812
- temp[_this8.displayKey] = finalItem;
43822
+ temp[_this9.saveKey] = finalItem;
43823
+ temp[_this9.displayKey] = finalItem;
43813
43824
  target.push(temp);
43814
43825
  }
43815
43826
  });
43816
43827
  return target;
43817
43828
  },
43818
43829
  updateScrollTop: function updateScrollTop() {
43819
- var _this9 = this;
43830
+ var _this10 = this;
43820
43831
  var panelObj = this.$refs.selectorList;
43821
43832
  var panelInfo = {
43822
43833
  height: panelObj.clientHeight,
43823
43834
  yAxis: panelObj.getBoundingClientRect().y
43824
43835
  };
43825
43836
  this.$nextTick(function () {
43826
- var activeObj = _this9.$refs.selectorList.querySelector('.bk-selector-actived');
43837
+ var activeObj = _this10.$refs.selectorList.querySelector('.bk-selector-actived');
43827
43838
  if (!activeObj) {
43828
43839
  return;
43829
43840
  }
@@ -43935,7 +43946,7 @@
43935
43946
  this.showList = false;
43936
43947
  },
43937
43948
  backspaceHandler: function backspaceHandler(index, target) {
43938
- var _this10 = this;
43949
+ var _this11 = this;
43939
43950
  if (!this.curInputValue) {
43940
43951
  if (this.isCanRemoveTag) {
43941
43952
  this.tagList.splice(index - 1, 1);
@@ -43948,7 +43959,7 @@
43948
43959
  this.focusInputer();
43949
43960
  var localList = this.useGroup ? this.allList : this.list;
43950
43961
  var isExistInit = localList.some(function (item) {
43951
- return item === target[_this10.saveKey];
43962
+ return item === target[_this11.saveKey];
43952
43963
  });
43953
43964
  if ((this.allowCreate && isExistInit || !this.allowCreate) && !this.isSingleSelect) {
43954
43965
  this.initData.push(target);
@@ -43966,19 +43977,19 @@
43966
43977
  this.handlerChange('remove');
43967
43978
  },
43968
43979
  removeTag: function removeTag(data, index) {
43969
- var _this11 = this;
43980
+ var _this12 = this;
43970
43981
  this.tagList.splice(index, 1);
43971
43982
  this.localTagList.splice(index, 1);
43972
43983
  var localList = this.useGroup ? this.allList : this.list;
43973
43984
  var isExistInit = localList.some(function (item) {
43974
- return item === data[_this11.saveKey];
43985
+ return item === data[_this12.saveKey];
43975
43986
  });
43976
43987
  if ((this.allowCreate && isExistInit || !this.allowCreate) && !this.isSingleSelect) {
43977
43988
  this.initData.push(data);
43978
43989
  }
43979
43990
  },
43980
43991
  addTag: function addTag(item, type) {
43981
- var _this12 = this;
43992
+ var _this13 = this;
43982
43993
  var nodes = this.$refs.tagList.childNodes;
43983
43994
  var result = this.getSiteInfo();
43984
43995
  var isSelected = false;
@@ -43989,13 +44000,13 @@
43989
44000
  var localTags = [];
43990
44001
  tags = item.split(this.separator);
43991
44002
  tags = tags.filter(function (tag) {
43992
- var validate = typeof _this12.createTagValidator === 'function' ? _this12.createTagValidator(tag) : true;
43993
- return tag && tag.trim() && !_this12.tagList.includes(tag) && validate;
44003
+ var validate = typeof _this13.createTagValidator === 'function' ? _this13.createTagValidator(tag) : true;
44004
+ return tag && tag.trim() && !_this13.tagList.includes(tag) && validate;
43994
44005
  });
43995
44006
  tags.forEach(function (tag) {
43996
44007
  var temp = {};
43997
- temp[_this12.saveKey] = tag;
43998
- temp[_this12.displayKey] = tag;
44008
+ temp[_this13.saveKey] = tag;
44009
+ temp[_this13.displayKey] = tag;
43999
44010
  localTags.push(temp);
44000
44011
  });
44001
44012
  if (tags.length) {
@@ -44040,14 +44051,14 @@
44040
44051
  if (isSelected) {
44041
44052
  this.$nextTick(function () {
44042
44053
  var site = nodes[_parseInt$2(result.index, 10) + 1];
44043
- _this12.insertAfter(_this12.$refs.staffInput, site);
44044
- _this12.$refs.input.style.width = _this12.INPUT_MIN_WIDTH + 'px';
44045
- if (!_this12.isSingleSelect && _this12.allowNextFocus) {
44046
- _this12.focusInputer();
44047
- }
44048
- if (!_this12.isSingleSelect) {
44049
- _this12.initData = _this12.initData.filter(function (val) {
44050
- return !_this12.tagList.includes(val[_this12.saveKey]);
44054
+ _this13.insertAfter(_this13.$refs.staffInput, site);
44055
+ _this13.$refs.input.style.width = _this13.INPUT_MIN_WIDTH + 'px';
44056
+ if (!_this13.isSingleSelect && _this13.allowNextFocus) {
44057
+ _this13.focusInputer();
44058
+ }
44059
+ if (!_this13.isSingleSelect) {
44060
+ _this13.initData = _this13.initData.filter(function (val) {
44061
+ return !_this13.tagList.includes(val[_this13.saveKey]);
44051
44062
  });
44052
44063
  }
44053
44064
  });
@@ -44065,35 +44076,35 @@
44065
44076
  this.cacheVal = '';
44066
44077
  },
44067
44078
  handleBlur: function handleBlur(inputValue) {
44068
- var _this13 = this;
44079
+ var _this14 = this;
44069
44080
  this.timer = setTimeout(function () {
44070
- var inputValue = _this13.curInputValue;
44071
- _this13.clearInput();
44072
- _this13.dispatch('bk-form-item', 'form-blur');
44073
- _this13.isEdit = false;
44074
- if (_this13.isSingleSelect) {
44075
- var _this13$tagListCache = _slicedToArray(_this13.tagListCache, 1),
44076
- oldVal = _this13$tagListCache[0];
44077
- if (inputValue && inputValue === oldVal && _this13.localTagListCache.length) {
44078
- _this13.addTag(_this13.localTagListCache[0], 'select');
44081
+ var inputValue = _this14.curInputValue;
44082
+ _this14.clearInput();
44083
+ _this14.dispatch('bk-form-item', 'form-blur');
44084
+ _this14.isEdit = false;
44085
+ if (_this14.isSingleSelect) {
44086
+ var _this14$tagListCache = _slicedToArray(_this14.tagListCache, 1),
44087
+ oldVal = _this14$tagListCache[0];
44088
+ if (inputValue && inputValue === oldVal && _this14.localTagListCache.length) {
44089
+ _this14.addTag(_this14.localTagListCache[0], 'select');
44079
44090
  } else {
44080
- _this13.handlerChange('remove');
44091
+ _this14.handlerChange('remove');
44081
44092
  }
44082
- } else if (_this13.allowAutoMatch && inputValue) {
44083
- var matchItem = _this13.renderList.find(function (item) {
44084
- return item[_this13.searchKey] === inputValue;
44093
+ } else if (_this14.allowAutoMatch && inputValue) {
44094
+ var matchItem = _this14.renderList.find(function (item) {
44095
+ return item[_this14.searchKey] === inputValue;
44085
44096
  });
44086
44097
  if (matchItem) {
44087
- _this13.handlerResultSelect(matchItem, 'select');
44088
- } else if (_this13.allowCreate) {
44089
- _this13.handlerResultSelect(inputValue, 'custom');
44098
+ _this14.handlerResultSelect(matchItem, 'select');
44099
+ } else if (_this14.allowCreate) {
44100
+ _this14.handlerResultSelect(inputValue, 'custom');
44090
44101
  }
44091
44102
  }
44092
- _this13.$emit('blur', inputValue, _this13.tagList);
44103
+ _this14.$emit('blur', inputValue, _this14.tagList);
44093
44104
  }, 200);
44094
44105
  },
44095
44106
  focusInputer: function focusInputer(event) {
44096
- var _this14 = this;
44107
+ var _this15 = this;
44097
44108
  if (this.disabled) {
44098
44109
  return;
44099
44110
  }
@@ -44118,11 +44129,11 @@
44118
44129
  }
44119
44130
  this.isEdit = true;
44120
44131
  this.$nextTick(function () {
44121
- _this14.$refs.input.focus();
44122
- if (_this14.trigger === 'focus') {
44123
- _this14.showList = true;
44124
- _this14.filterData();
44125
- _this14.showPopover();
44132
+ _this15.$refs.input.focus();
44133
+ if (_this15.trigger === 'focus') {
44134
+ _this15.showList = true;
44135
+ _this15.filterData();
44136
+ _this15.showPopover();
44126
44137
  }
44127
44138
  });
44128
44139
  },
@@ -52233,7 +52244,7 @@
52233
52244
  _this11.handleEnter(_this11.input.value, (_this11$handleEnter2 = {}, _defineProperty(_this11$handleEnter2, _this11.primaryKey, _this11.input.value), _defineProperty(_this11$handleEnter2, _this11.displayKey, _this11.input.value), _this11$handleEnter2), false, needShowPopover);
52234
52245
  }
52235
52246
  resolve();
52236
- }, 0);
52247
+ }, 10);
52237
52248
  }
52238
52249
  });
52239
52250
  case 2: