bk-magic-vue 2.4.10-beta.1 → 2.4.11
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.css +20 -6
- package/dist/bk-magic-vue.js +159 -35
- package/dist/bk-magic-vue.min.css +1 -1
- package/dist/bk-magic-vue.min.css.gz +0 -0
- package/dist/bk-magic-vue.min.css.map +1 -1
- 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/card.js +61 -3
- package/lib/divider.js +1 -10
- package/lib/dropdown-menu.js +1902 -1938
- package/lib/input.js +61 -3
- package/lib/pagination.js +125 -4
- package/lib/radio-group.js +567 -504
- package/lib/select.js +64 -1
- package/lib/slider.js +61 -3
- package/lib/swiper.js +25 -13
- package/lib/table.js +125 -4
- package/lib/transfer.js +61 -3
- package/lib/ui/bk-magic-vue.css +20 -6
- package/lib/ui/bk-magic-vue.min.css +1 -1
- package/lib/ui/bk-magic-vue.min.css.gz +0 -0
- package/lib/ui/bk-magic-vue.min.css.map +1 -1
- package/lib/ui/divider.css +22 -6
- package/lib/ui/divider.min.css +1 -1
- package/lib/ui/divider.min.css.map +1 -1
- package/package.json +1 -1
package/dist/bk-magic-vue.css
CHANGED
|
@@ -15362,9 +15362,23 @@ th.bk-table-column-selection .cell, th.bk-table-column-expand .cell, td.bk-table
|
|
|
15362
15362
|
font-size:26px;
|
|
15363
15363
|
}
|
|
15364
15364
|
.bk-divider{
|
|
15365
|
-
|
|
15365
|
+
position:relative
|
|
15366
15366
|
}
|
|
15367
|
-
.bk-divider-
|
|
15367
|
+
.bk-divider.bk-divider__vertical{
|
|
15368
|
+
display:inline-block;
|
|
15369
|
+
width:0;
|
|
15370
|
+
height:1em;
|
|
15371
|
+
margin:0 8px;
|
|
15372
|
+
verticalAlign:middle;
|
|
15373
|
+
}
|
|
15374
|
+
.bk-divider.bk-divider__horizontal{
|
|
15375
|
+
display:block;
|
|
15376
|
+
width:100%;
|
|
15377
|
+
height:0;
|
|
15378
|
+
margin:1em 0;
|
|
15379
|
+
verticalAlign:middle;
|
|
15380
|
+
}
|
|
15381
|
+
.bk-divider .bk-divider-info{
|
|
15368
15382
|
position:absolute;
|
|
15369
15383
|
padding:0 1.4em;
|
|
15370
15384
|
color:#313238;
|
|
@@ -15372,16 +15386,16 @@ th.bk-table-column-selection .cell, th.bk-table-column-expand .cell, td.bk-table
|
|
|
15372
15386
|
-webkit-transform:translateY(-50%);
|
|
15373
15387
|
transform:translateY(-50%);
|
|
15374
15388
|
background-color:#fff;
|
|
15375
|
-
}
|
|
15376
|
-
.bk-divider-info-left{
|
|
15389
|
+
}
|
|
15390
|
+
.bk-divider .bk-divider-info-left{
|
|
15377
15391
|
left:2em;
|
|
15378
15392
|
}
|
|
15379
|
-
.bk-divider-info-center{
|
|
15393
|
+
.bk-divider .bk-divider-info-center{
|
|
15380
15394
|
left:50%;
|
|
15381
15395
|
-webkit-transform:translateX(-50%) translateY(-50%);
|
|
15382
15396
|
transform:translateX(-50%) translateY(-50%)
|
|
15383
15397
|
}
|
|
15384
|
-
.bk-divider-info-right{
|
|
15398
|
+
.bk-divider .bk-divider-info-right{
|
|
15385
15399
|
right:2em;
|
|
15386
15400
|
}
|
|
15387
15401
|
.bk-compose-form-item{
|
package/dist/bk-magic-vue.js
CHANGED
|
@@ -25272,7 +25272,7 @@
|
|
|
25272
25272
|
timer: 0,
|
|
25273
25273
|
isShow: false,
|
|
25274
25274
|
popInstance: null,
|
|
25275
|
-
|
|
25275
|
+
holderHeight: variable_1
|
|
25276
25276
|
};
|
|
25277
25277
|
},
|
|
25278
25278
|
computed: {
|
|
@@ -25287,7 +25287,6 @@
|
|
|
25287
25287
|
}
|
|
25288
25288
|
},
|
|
25289
25289
|
mounted: function mounted() {
|
|
25290
|
-
this.containerHeight = this.containerHeight + _parseInt$2(variable_1, 10);
|
|
25291
25290
|
var placement = "bottom".concat(this.getPlacementFix());
|
|
25292
25291
|
this.popInstance = new Popper(this.$refs.refDropTrigger, this.$refs.refDropContent, {
|
|
25293
25292
|
placement: placement,
|
|
@@ -25383,9 +25382,6 @@
|
|
|
25383
25382
|
}],
|
|
25384
25383
|
staticClass: "bk-dropdown-menu",
|
|
25385
25384
|
class: [_vm.disabled ? 'disabled' : '', _vm.positionFixed ? '' : 'bk-dropdown-full-width', _vm.fontSizeCls, _vm.extCls],
|
|
25386
|
-
style: {
|
|
25387
|
-
height: _vm.containerHeight + 'px'
|
|
25388
|
-
},
|
|
25389
25385
|
attrs: {
|
|
25390
25386
|
"tabindex": "0"
|
|
25391
25387
|
},
|
|
@@ -25414,6 +25410,12 @@
|
|
|
25414
25410
|
ref: "refDropTrigger",
|
|
25415
25411
|
staticClass: "bk-dropdown-trigger"
|
|
25416
25412
|
}, [_vm._t("dropdown-trigger")], 2), _c('div', {
|
|
25413
|
+
style: {
|
|
25414
|
+
height: _vm.holderHeight,
|
|
25415
|
+
width: '100%',
|
|
25416
|
+
position: 'absolute'
|
|
25417
|
+
}
|
|
25418
|
+
}), _c('div', {
|
|
25417
25419
|
ref: "refDropContent",
|
|
25418
25420
|
class: ['bk-dropdown-content', {
|
|
25419
25421
|
'is-show': _vm.isShow,
|
|
@@ -29617,7 +29619,10 @@
|
|
|
29617
29619
|
type: String,
|
|
29618
29620
|
default: 'normal'
|
|
29619
29621
|
},
|
|
29620
|
-
precision:
|
|
29622
|
+
precision: {
|
|
29623
|
+
type: Number,
|
|
29624
|
+
default: 0
|
|
29625
|
+
},
|
|
29621
29626
|
passwordIcon: {
|
|
29622
29627
|
type: Array,
|
|
29623
29628
|
default: function _default() {
|
|
@@ -29670,7 +29675,15 @@
|
|
|
29670
29675
|
inputSize: this.size,
|
|
29671
29676
|
inputPasswordIcon: this.passwordIcon,
|
|
29672
29677
|
inputRightPadding: '10px',
|
|
29673
|
-
iconAreaSizeObserver: null
|
|
29678
|
+
iconAreaSizeObserver: null,
|
|
29679
|
+
validKeyCodeList: [48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
|
|
29680
|
+
8,
|
|
29681
|
+
189,
|
|
29682
|
+
190,
|
|
29683
|
+
38, 40, 37, 39,
|
|
29684
|
+
46,
|
|
29685
|
+
9
|
|
29686
|
+
]
|
|
29674
29687
|
};
|
|
29675
29688
|
},
|
|
29676
29689
|
computed: {
|
|
@@ -29822,6 +29835,7 @@
|
|
|
29822
29835
|
max: this.max
|
|
29823
29836
|
};
|
|
29824
29837
|
_extends(outputAttr, defaultAttr, numberAttr);
|
|
29838
|
+
outputAttr.type = 'text';
|
|
29825
29839
|
break;
|
|
29826
29840
|
case 'textarea':
|
|
29827
29841
|
var txtAttr = {
|
|
@@ -29926,7 +29940,53 @@
|
|
|
29926
29940
|
this.$emit('keypress', value, event);
|
|
29927
29941
|
},
|
|
29928
29942
|
handlerKeydown: function handlerKeydown(event) {
|
|
29929
|
-
var
|
|
29943
|
+
var keyCode = event.keyCode;
|
|
29944
|
+
var target = event.currentTarget;
|
|
29945
|
+
var value = target.value;
|
|
29946
|
+
if (this.inputType === 'number') {
|
|
29947
|
+
if (this.validKeyCodeList.indexOf(keyCode) < 0) {
|
|
29948
|
+
event.stopPropagation();
|
|
29949
|
+
event.preventDefault();
|
|
29950
|
+
return false;
|
|
29951
|
+
}
|
|
29952
|
+
if (keyCode === 190) {
|
|
29953
|
+
if (this.precision === 0) {
|
|
29954
|
+
event.stopPropagation();
|
|
29955
|
+
event.preventDefault();
|
|
29956
|
+
return false;
|
|
29957
|
+
}
|
|
29958
|
+
if (String(value).trim()) {
|
|
29959
|
+
if (value.indexOf('.') >= 0) {
|
|
29960
|
+
event.stopPropagation();
|
|
29961
|
+
event.preventDefault();
|
|
29962
|
+
return false;
|
|
29963
|
+
}
|
|
29964
|
+
}
|
|
29965
|
+
}
|
|
29966
|
+
if (event.keyCode === 189) {
|
|
29967
|
+
if (String(value).trim()) {
|
|
29968
|
+
if (value.indexOf('-') >= 0) {
|
|
29969
|
+
event.stopPropagation();
|
|
29970
|
+
event.preventDefault();
|
|
29971
|
+
return false;
|
|
29972
|
+
}
|
|
29973
|
+
if (document.getSelection().type !== 'Range') {
|
|
29974
|
+
if (target.selectionEnd !== 0) {
|
|
29975
|
+
event.stopPropagation();
|
|
29976
|
+
event.preventDefault();
|
|
29977
|
+
return false;
|
|
29978
|
+
}
|
|
29979
|
+
}
|
|
29980
|
+
}
|
|
29981
|
+
}
|
|
29982
|
+
if (keyCode === 38) {
|
|
29983
|
+
event.preventDefault();
|
|
29984
|
+
this.handleNumberAdd(event);
|
|
29985
|
+
} else if (keyCode === 40) {
|
|
29986
|
+
event.preventDefault();
|
|
29987
|
+
this.handleNumberDelete(event);
|
|
29988
|
+
}
|
|
29989
|
+
}
|
|
29930
29990
|
this.$emit('keydown', value, event);
|
|
29931
29991
|
},
|
|
29932
29992
|
handlerFocus: function handlerFocus(event) {
|
|
@@ -32759,6 +32819,10 @@
|
|
|
32759
32819
|
default: true
|
|
32760
32820
|
},
|
|
32761
32821
|
allowCreate: Boolean,
|
|
32822
|
+
allowEnter: {
|
|
32823
|
+
type: Boolean,
|
|
32824
|
+
default: true
|
|
32825
|
+
},
|
|
32762
32826
|
disabled: Boolean,
|
|
32763
32827
|
readonly: Boolean,
|
|
32764
32828
|
loading: Boolean,
|
|
@@ -33137,7 +33201,7 @@
|
|
|
33137
33201
|
var popover = this.getPopoverInstance();
|
|
33138
33202
|
popover.set({
|
|
33139
33203
|
onShown: function onShown() {
|
|
33140
|
-
if (_this6.searchable
|
|
33204
|
+
if (_this6.searchable) {
|
|
33141
33205
|
_this6.$refs.searchInput.focus();
|
|
33142
33206
|
}
|
|
33143
33207
|
}
|
|
@@ -33305,6 +33369,58 @@
|
|
|
33305
33369
|
this.close();
|
|
33306
33370
|
this.$refs.bkSelect && this.$refs.bkSelect.focus();
|
|
33307
33371
|
},
|
|
33372
|
+
ensureSearch: function ensureSearch() {
|
|
33373
|
+
var _this12 = this;
|
|
33374
|
+
if (!this.allowEnter) {
|
|
33375
|
+
return false;
|
|
33376
|
+
}
|
|
33377
|
+
var option = {};
|
|
33378
|
+
this.options.some(function (item) {
|
|
33379
|
+
var searchValue = _this12.searchValue;
|
|
33380
|
+
var data = item;
|
|
33381
|
+
if (item.$options) {
|
|
33382
|
+
data = item.$options.propsData;
|
|
33383
|
+
}
|
|
33384
|
+
var name = data.name;
|
|
33385
|
+
if (typeof name === 'string' && _this12.searchWithPinyin) {
|
|
33386
|
+
var pinyinList = pinyin.parse(name).map(function (v) {
|
|
33387
|
+
if (v.type === 2) {
|
|
33388
|
+
return v.target.toLowerCase();
|
|
33389
|
+
}
|
|
33390
|
+
return v.target;
|
|
33391
|
+
});
|
|
33392
|
+
var pinyinStr = pinyinList.reduce(function (res, cur) {
|
|
33393
|
+
return res + cur[0];
|
|
33394
|
+
}, '');
|
|
33395
|
+
if (pinyinList.join('').indexOf(searchValue) !== -1 || pinyinStr.indexOf(searchValue) !== -1) {
|
|
33396
|
+
option = data;
|
|
33397
|
+
return true;
|
|
33398
|
+
}
|
|
33399
|
+
return pinyinList.join('').indexOf(searchValue) !== -1 || pinyinStr.indexOf(searchValue) !== -1;
|
|
33400
|
+
} else {
|
|
33401
|
+
if ("".concat(name).includes(_this12.searchValue)) {
|
|
33402
|
+
option = data;
|
|
33403
|
+
return true;
|
|
33404
|
+
}
|
|
33405
|
+
}
|
|
33406
|
+
return false;
|
|
33407
|
+
});
|
|
33408
|
+
if (option) {
|
|
33409
|
+
if (this.multiple && this.selected.includes(option.id)) {
|
|
33410
|
+
return false;
|
|
33411
|
+
}
|
|
33412
|
+
this.selectOption(option);
|
|
33413
|
+
} else {
|
|
33414
|
+
if (this.allowCreate) {
|
|
33415
|
+
this.$refs.createInput.value = this.searchValue;
|
|
33416
|
+
this.handleInputChange({
|
|
33417
|
+
target: {
|
|
33418
|
+
value: this.searchValue
|
|
33419
|
+
}
|
|
33420
|
+
});
|
|
33421
|
+
}
|
|
33422
|
+
}
|
|
33423
|
+
},
|
|
33308
33424
|
handleTabRemove: function handleTabRemove(options) {
|
|
33309
33425
|
this.$emit('tab-remove', options);
|
|
33310
33426
|
},
|
|
@@ -33429,6 +33545,7 @@
|
|
|
33429
33545
|
"create-tag": _vm.handleCreateTag
|
|
33430
33546
|
}
|
|
33431
33547
|
}) : [_vm.allowCreate && !_vm.multiple ? _c('input', {
|
|
33548
|
+
ref: "createInput",
|
|
33432
33549
|
staticClass: "bk-select-name",
|
|
33433
33550
|
class: _vm.fontSizeCls,
|
|
33434
33551
|
attrs: {
|
|
@@ -33477,6 +33594,12 @@
|
|
|
33477
33594
|
},
|
|
33478
33595
|
on: {
|
|
33479
33596
|
"keydown": [function ($event) {
|
|
33597
|
+
if (!('button' in $event) && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) {
|
|
33598
|
+
return null;
|
|
33599
|
+
}
|
|
33600
|
+
|
|
33601
|
+
return _vm.ensureSearch($event);
|
|
33602
|
+
}, function ($event) {
|
|
33480
33603
|
if (!('button' in $event) && _vm._k($event.keyCode, "tab", 9, $event.key, "Tab")) {
|
|
33481
33604
|
return null;
|
|
33482
33605
|
}
|
|
@@ -35466,9 +35589,7 @@
|
|
|
35466
35589
|
name: {
|
|
35467
35590
|
type: [String, Number],
|
|
35468
35591
|
default: function _default() {
|
|
35469
|
-
|
|
35470
|
-
var now = now$1();
|
|
35471
|
-
return "bk_radio_".concat(now, "_").concat(seed++);
|
|
35592
|
+
return "bk_radio_".concat(uuid());
|
|
35472
35593
|
}
|
|
35473
35594
|
}
|
|
35474
35595
|
},
|
|
@@ -48565,6 +48686,16 @@
|
|
|
48565
48686
|
var indexMove = this.realWidth * this.currentIndex;
|
|
48566
48687
|
var imageMove = indexMove - this.mouseDistance;
|
|
48567
48688
|
return -imageMove;
|
|
48689
|
+
},
|
|
48690
|
+
swiperStyle: function swiperStyle() {
|
|
48691
|
+
var swiperStyle = {};
|
|
48692
|
+
if (this.realWidth > 0) {
|
|
48693
|
+
swiperStyle.width = "".concat(this.realWidth, "px");
|
|
48694
|
+
}
|
|
48695
|
+
if (this.realHeight > 0) {
|
|
48696
|
+
swiperStyle.height = "".concat(this.realHeight, "px");
|
|
48697
|
+
}
|
|
48698
|
+
return swiperStyle;
|
|
48568
48699
|
}
|
|
48569
48700
|
},
|
|
48570
48701
|
watch: {
|
|
@@ -48583,16 +48714,21 @@
|
|
|
48583
48714
|
}
|
|
48584
48715
|
},
|
|
48585
48716
|
mounted: function mounted() {
|
|
48586
|
-
this
|
|
48717
|
+
var _this = this;
|
|
48718
|
+
setTimeout(function () {
|
|
48719
|
+
_this.initStatus();
|
|
48720
|
+
});
|
|
48587
48721
|
},
|
|
48588
48722
|
beforeDestroy: function beforeDestroy() {
|
|
48589
48723
|
this.destoryStatus();
|
|
48590
48724
|
},
|
|
48591
48725
|
methods: {
|
|
48592
48726
|
calcSize: function calcSize() {
|
|
48727
|
+
console.log(this);
|
|
48728
|
+
var swiperSize = getElementSize(this.$refs.swiper);
|
|
48593
48729
|
var swiperParentSize = getElementSize(this.$refs.swiper && this.$refs.swiper.parentElement);
|
|
48594
|
-
this.realWidth = +this.width > 0 ? this.width :
|
|
48595
|
-
this.realHeight = +this.height > 0 ? this.height :
|
|
48730
|
+
this.realWidth = +this.width > 0 ? this.width : swiperSize.width > 0 ? swiperSize.width : swiperParentSize.width;
|
|
48731
|
+
this.realHeight = +this.height > 0 ? this.height : swiperSize.height > 25 ? swiperSize.height : swiperParentSize.height;
|
|
48596
48732
|
},
|
|
48597
48733
|
initStatus: function initStatus() {
|
|
48598
48734
|
this.calcSize();
|
|
@@ -48606,13 +48742,13 @@
|
|
|
48606
48742
|
document.removeEventListener('visibilitychange', this.visChange);
|
|
48607
48743
|
},
|
|
48608
48744
|
watchParentSizeChange: function watchParentSizeChange() {
|
|
48609
|
-
var
|
|
48745
|
+
var _this2 = this;
|
|
48610
48746
|
var parentEle = this.$refs.swiper && this.$refs.swiper.parentElement;
|
|
48611
48747
|
if (!parentEle || !window.ResizeObserver) {
|
|
48612
48748
|
return;
|
|
48613
48749
|
}
|
|
48614
48750
|
this.resizeObserver = new ResizeObserver(function () {
|
|
48615
|
-
|
|
48751
|
+
_this2.calcSize();
|
|
48616
48752
|
});
|
|
48617
48753
|
this.resizeObserver.observe(parentEle);
|
|
48618
48754
|
},
|
|
@@ -48679,13 +48815,13 @@
|
|
|
48679
48815
|
}
|
|
48680
48816
|
},
|
|
48681
48817
|
startLoop: function startLoop() {
|
|
48682
|
-
var
|
|
48818
|
+
var _this3 = this;
|
|
48683
48819
|
if (!this.isLoop) return;
|
|
48684
48820
|
this.endLoop();
|
|
48685
48821
|
this.loopId = window.setTimeout(function () {
|
|
48686
|
-
|
|
48687
|
-
|
|
48688
|
-
|
|
48822
|
+
_this3.isTransition = true;
|
|
48823
|
+
_this3.changeCurrentIndex(_this3.currentIndex + 1);
|
|
48824
|
+
_this3.startLoop();
|
|
48689
48825
|
}, this.loopTime);
|
|
48690
48826
|
},
|
|
48691
48827
|
endLoop: function endLoop() {
|
|
@@ -48708,10 +48844,7 @@
|
|
|
48708
48844
|
return _vm.sourceList.length ? _c('section', {
|
|
48709
48845
|
ref: "swiper",
|
|
48710
48846
|
class: ['bk-swiper-home', _vm.extCls],
|
|
48711
|
-
style:
|
|
48712
|
-
width: _vm.realWidth + "px",
|
|
48713
|
-
height: _vm.realHeight + "px"
|
|
48714
|
-
}
|
|
48847
|
+
style: _vm.swiperStyle
|
|
48715
48848
|
}, [_c('hgroup', {
|
|
48716
48849
|
class: [{
|
|
48717
48850
|
'bk-transition': _vm.isTransition
|
|
@@ -56009,20 +56142,10 @@
|
|
|
56009
56142
|
style: function style() {
|
|
56010
56143
|
if (this.direction === 'vertical') {
|
|
56011
56144
|
return {
|
|
56012
|
-
display: 'inline-block',
|
|
56013
|
-
width: 0,
|
|
56014
|
-
height: '1em',
|
|
56015
|
-
margin: '0 8px',
|
|
56016
|
-
verticalAlign: 'middle',
|
|
56017
56145
|
borderRight: "".concat(this.width, "px ").concat(this.type, " ").concat(this.color)
|
|
56018
56146
|
};
|
|
56019
56147
|
}
|
|
56020
56148
|
return {
|
|
56021
|
-
display: 'block',
|
|
56022
|
-
width: '100%',
|
|
56023
|
-
height: 0,
|
|
56024
|
-
margin: '1em 0',
|
|
56025
|
-
verticalAlign: 'middle',
|
|
56026
56149
|
borderBottom: "".concat(this.width, "px ").concat(this.type, " ").concat(this.color)
|
|
56027
56150
|
};
|
|
56028
56151
|
}
|
|
@@ -56042,6 +56165,7 @@
|
|
|
56042
56165
|
|
|
56043
56166
|
return _c('div', {
|
|
56044
56167
|
staticClass: "bk-divider",
|
|
56168
|
+
class: _vm.direction === 'horizontal' ? 'bk-divider__horizontal' : 'bk-divider__vertical',
|
|
56045
56169
|
style: _vm.style
|
|
56046
56170
|
}, [_vm.direction === 'horizontal' ? _c('div', {
|
|
56047
56171
|
class: ['bk-divider-info', "bk-divider-info-" + _vm.align]
|