bk-magic-vue 2.4.13-beta.1 → 2.4.13
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 +5 -0
- package/dist/bk-magic-vue.js +21 -10
- 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/option-group.js +3 -0
- package/lib/transfer.js +18 -10
- package/lib/ui/bk-magic-vue.css +5 -0
- 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/transfer.css +6 -0
- package/lib/ui/transfer.min.css +1 -1
- package/lib/ui/transfer.min.css.map +1 -1
- package/package.json +1 -2
package/lib/option-group.js
CHANGED
|
@@ -1247,6 +1247,9 @@
|
|
|
1247
1247
|
return !this.isSelectAllItems && !this.isEmpty;
|
|
1248
1248
|
},
|
|
1249
1249
|
isSelectAllItems: function isSelectAllItems() {
|
|
1250
|
+
if (this.options.length < 1) {
|
|
1251
|
+
return false;
|
|
1252
|
+
}
|
|
1250
1253
|
return Array.prototype.every.call(this.options, function (option) {
|
|
1251
1254
|
return option.isSelected;
|
|
1252
1255
|
});
|
package/lib/transfer.js
CHANGED
|
@@ -4323,7 +4323,7 @@
|
|
|
4323
4323
|
sortDataList: function sortDataList(list, key, sortList) {
|
|
4324
4324
|
var arr = sortList;
|
|
4325
4325
|
return list.sort(function (a, b) {
|
|
4326
|
-
return arr.indexOf(a[key]) - arr.indexOf(b[key])
|
|
4326
|
+
return arr.indexOf(a[key]) - arr.indexOf(b[key]);
|
|
4327
4327
|
});
|
|
4328
4328
|
},
|
|
4329
4329
|
removeFromDataList: function removeFromDataList(removeItem) {
|
|
@@ -4338,6 +4338,7 @@
|
|
|
4338
4338
|
var displayDataList = this.displayDataList;
|
|
4339
4339
|
var hasSelectedList = this.hasSelectedList;
|
|
4340
4340
|
displayDataList.forEach(function (transferItem) {
|
|
4341
|
+
if (transferItem.disabled) return;
|
|
4341
4342
|
hasSelectedList.push(transferItem);
|
|
4342
4343
|
_this6.removeFromDataList(transferItem);
|
|
4343
4344
|
});
|
|
@@ -4355,10 +4356,13 @@
|
|
|
4355
4356
|
},
|
|
4356
4357
|
allToLeft: function allToLeft() {
|
|
4357
4358
|
this.rightHoverIndex = -1;
|
|
4358
|
-
var hasSelectedList = this.hasSelectedList
|
|
4359
|
+
var hasSelectedList = this.hasSelectedList.filter(function (i) {
|
|
4360
|
+
return !i.disabled;
|
|
4361
|
+
});
|
|
4359
4362
|
var dataList = this.dataList;
|
|
4360
4363
|
while (hasSelectedList.length) {
|
|
4361
4364
|
var transferItem = hasSelectedList.shift();
|
|
4365
|
+
this.hasSelectedList.splice(this.hasSelectedList.indexOf(transferItem), 1);
|
|
4362
4366
|
dataList.push(transferItem);
|
|
4363
4367
|
if (this.sortList.length === this.sourceList.length) {
|
|
4364
4368
|
this.dataList = _toConsumableArray(this.sortDataList(dataList, this.sortCode, this.sortList));
|
|
@@ -4373,7 +4377,8 @@
|
|
|
4373
4377
|
this.$emit('change', this.dataList, this.hasSelectedList, list);
|
|
4374
4378
|
}
|
|
4375
4379
|
},
|
|
4376
|
-
leftClick: function leftClick(index) {
|
|
4380
|
+
leftClick: function leftClick(index, item) {
|
|
4381
|
+
if (item.disabled) return;
|
|
4377
4382
|
this.leftHoverIndex = -1;
|
|
4378
4383
|
var transferItem = this.displayDataList[index];
|
|
4379
4384
|
var hasSelectedList = this.hasSelectedList;
|
|
@@ -4391,7 +4396,8 @@
|
|
|
4391
4396
|
this.$emit('change', this.dataList, this.hasSelectedList, list);
|
|
4392
4397
|
}
|
|
4393
4398
|
},
|
|
4394
|
-
rightClick: function rightClick(index) {
|
|
4399
|
+
rightClick: function rightClick(index, item) {
|
|
4400
|
+
if (item.disabled) return;
|
|
4395
4401
|
this.rightHoverIndex = -1;
|
|
4396
4402
|
var transferItem = this.hasSelectedList.splice(index, 1)[0];
|
|
4397
4403
|
var dataList = this.dataList;
|
|
@@ -4473,12 +4479,13 @@
|
|
|
4473
4479
|
}, _vm._l(_vm.displayDataList, function (item, index) {
|
|
4474
4480
|
return _c('li', {
|
|
4475
4481
|
key: index,
|
|
4482
|
+
class: [item.disabled ? 'is-disabled' : ''],
|
|
4476
4483
|
on: {
|
|
4477
4484
|
"click": function click($event) {
|
|
4478
4485
|
$event.stopPropagation();
|
|
4479
4486
|
$event.preventDefault();
|
|
4480
4487
|
|
|
4481
|
-
_vm.leftClick(index);
|
|
4488
|
+
_vm.leftClick(index, item);
|
|
4482
4489
|
},
|
|
4483
4490
|
"mouseover": function mouseover($event) {
|
|
4484
4491
|
$event.stopPropagation();
|
|
@@ -4504,12 +4511,12 @@
|
|
|
4504
4511
|
attrs: {
|
|
4505
4512
|
"title": item[_vm.displayCode]
|
|
4506
4513
|
}
|
|
4507
|
-
}, [_vm._v(_vm._s(item[_vm.displayCode]))]), _c('span', {
|
|
4514
|
+
}, [_vm._v(_vm._s(item[_vm.displayCode]))]), !item.disabled ? _c('span', {
|
|
4508
4515
|
staticClass: "icon-wrapper",
|
|
4509
4516
|
class: [index === _vm.leftHoverIndex ? 'hover' : '']
|
|
4510
4517
|
}, [_c('i', {
|
|
4511
4518
|
staticClass: "bk-icon icon-arrows-right"
|
|
4512
|
-
})])], null, item)], 2);
|
|
4519
|
+
})]) : _vm._e()], null, item)], 2);
|
|
4513
4520
|
}), 0)] : [_vm.slot['left-empty-content'] ? _c('div', [_vm._t("left-empty-content")], 2) : _c('div', {
|
|
4514
4521
|
staticClass: "empty"
|
|
4515
4522
|
}, [_vm._v("\n " + _vm._s(_vm.emptyContent[0] ? _vm.emptyContent[0] : _vm.t('bk.transfer.emptyContent')) + "\n ")])]], 2), _c('div', {
|
|
@@ -4535,12 +4542,13 @@
|
|
|
4535
4542
|
}, _vm._l(_vm.hasSelectedList, function (item, index) {
|
|
4536
4543
|
return _c('li', {
|
|
4537
4544
|
key: index,
|
|
4545
|
+
class: [item.disabled ? 'is-disabled' : ''],
|
|
4538
4546
|
on: {
|
|
4539
4547
|
"click": function click($event) {
|
|
4540
4548
|
$event.stopPropagation();
|
|
4541
4549
|
$event.preventDefault();
|
|
4542
4550
|
|
|
4543
|
-
_vm.rightClick(index);
|
|
4551
|
+
_vm.rightClick(index, item);
|
|
4544
4552
|
},
|
|
4545
4553
|
"mouseover": function mouseover($event) {
|
|
4546
4554
|
$event.stopPropagation();
|
|
@@ -4566,12 +4574,12 @@
|
|
|
4566
4574
|
attrs: {
|
|
4567
4575
|
"title": item[_vm.displayCode]
|
|
4568
4576
|
}
|
|
4569
|
-
}, [_vm._v(_vm._s(item[_vm.displayCode]))]), _c('span', {
|
|
4577
|
+
}, [_vm._v(_vm._s(item[_vm.displayCode]))]), !item.disabled ? _c('span', {
|
|
4570
4578
|
staticClass: "icon-wrapper",
|
|
4571
4579
|
class: [index === _vm.rightHoverIndex ? 'hover' : '']
|
|
4572
4580
|
}, [_c('i', {
|
|
4573
4581
|
staticClass: "bk-icon icon-close"
|
|
4574
|
-
})])], null, item)], 2);
|
|
4582
|
+
})]) : _vm._e()], null, item)], 2);
|
|
4575
4583
|
}), 0)] : [_vm.slot['right-empty-content'] ? _c('div', [_vm._t("right-empty-content")], 2) : _c('div', {
|
|
4576
4584
|
staticClass: "empty"
|
|
4577
4585
|
}, [_vm._v("\n " + _vm._s(_vm.emptyContent[1] ? _vm.emptyContent[1] : _vm.t('bk.transfer.emptySelected')) + "\n ")])]], 2)]);
|
package/lib/ui/bk-magic-vue.css
CHANGED
|
@@ -11895,6 +11895,11 @@ th.bk-table-column-selection .cell, th.bk-table-column-expand .cell, td.bk-table
|
|
|
11895
11895
|
background-color:#eef6fe;
|
|
11896
11896
|
color:#3a84ff;
|
|
11897
11897
|
}
|
|
11898
|
+
.bk-transfer .source-list .content li.is-disabled, .bk-transfer .target-list .content li.is-disabled{
|
|
11899
|
+
cursor:not-allowed;
|
|
11900
|
+
color:#c4c6cc;
|
|
11901
|
+
background-color:#fff;
|
|
11902
|
+
}
|
|
11898
11903
|
.bk-transfer .source-list .content li .content-text, .bk-transfer .target-list .content li .content-text{
|
|
11899
11904
|
-webkit-box-flex:1;
|
|
11900
11905
|
-ms-flex:1;
|