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.
- package/dist/bk-magic-vue.js +84 -73
- package/dist/bk-magic-vue.min.js +1 -1
- package/dist/bk-magic-vue.min.js.gz +0 -0
- package/dist/bk-magic-vue.min.js.map +1 -1
- package/lib/cascade.js +7 -0
- package/lib/dialog.js +7 -0
- package/lib/info-box.js +7 -0
- package/lib/pagination.js +7 -0
- package/lib/popconfirm.js +7 -0
- package/lib/popover.js +7 -0
- package/lib/search-select.js +1 -1
- package/lib/select.js +7 -0
- package/lib/sideslider.js +7 -0
- package/lib/table.js +7 -0
- package/lib/tag-input.js +82 -71
- package/lib/utils/pop-manager.js +7 -0
- package/lib/version-detail.js +7 -0
- package/package.json +2 -2
package/dist/bk-magic-vue.js
CHANGED
|
@@ -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
|
-
|
|
43716
|
-
|
|
43717
|
-
|
|
43718
|
-
|
|
43719
|
-
if (
|
|
43720
|
-
|
|
43721
|
-
|
|
43722
|
-
|
|
43723
|
-
|
|
43724
|
-
|
|
43725
|
-
|
|
43726
|
-
|
|
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
|
-
|
|
43730
|
-
|
|
43731
|
-
|
|
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
|
|
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[
|
|
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[
|
|
43778
|
+
localInitDara.push(data[_this8.saveKey]);
|
|
43768
43779
|
});
|
|
43769
43780
|
tags = tags.filter(function (tag) {
|
|
43770
|
-
return tag && tag.trim() && !
|
|
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[
|
|
43785
|
-
temp[
|
|
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[
|
|
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
|
|
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[
|
|
43812
|
-
temp[
|
|
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
|
|
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 =
|
|
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
|
|
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[
|
|
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
|
|
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[
|
|
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
|
|
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
|
|
43993
|
-
return tag && tag.trim() && !
|
|
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[
|
|
43998
|
-
temp[
|
|
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
|
-
|
|
44044
|
-
|
|
44045
|
-
if (!
|
|
44046
|
-
|
|
44047
|
-
}
|
|
44048
|
-
if (!
|
|
44049
|
-
|
|
44050
|
-
return !
|
|
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
|
|
44079
|
+
var _this14 = this;
|
|
44069
44080
|
this.timer = setTimeout(function () {
|
|
44070
|
-
var inputValue =
|
|
44071
|
-
|
|
44072
|
-
|
|
44073
|
-
|
|
44074
|
-
if (
|
|
44075
|
-
var
|
|
44076
|
-
oldVal =
|
|
44077
|
-
if (inputValue && inputValue === oldVal &&
|
|
44078
|
-
|
|
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
|
-
|
|
44091
|
+
_this14.handlerChange('remove');
|
|
44081
44092
|
}
|
|
44082
|
-
} else if (
|
|
44083
|
-
var matchItem =
|
|
44084
|
-
return item[
|
|
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
|
-
|
|
44088
|
-
} else if (
|
|
44089
|
-
|
|
44098
|
+
_this14.handlerResultSelect(matchItem, 'select');
|
|
44099
|
+
} else if (_this14.allowCreate) {
|
|
44100
|
+
_this14.handlerResultSelect(inputValue, 'custom');
|
|
44090
44101
|
}
|
|
44091
44102
|
}
|
|
44092
|
-
|
|
44103
|
+
_this14.$emit('blur', inputValue, _this14.tagList);
|
|
44093
44104
|
}, 200);
|
|
44094
44105
|
},
|
|
44095
44106
|
focusInputer: function focusInputer(event) {
|
|
44096
|
-
var
|
|
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
|
-
|
|
44122
|
-
if (
|
|
44123
|
-
|
|
44124
|
-
|
|
44125
|
-
|
|
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
|
-
},
|
|
52247
|
+
}, 10);
|
|
52237
52248
|
}
|
|
52238
52249
|
});
|
|
52239
52250
|
case 2:
|