bk-magic-vue 2.5.9-beta.24 → 2.5.9-beta.26

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.
@@ -40353,20 +40353,27 @@
40353
40353
  }
40354
40354
  },
40355
40355
  rowSelectedChanged: function rowSelectedChanged(states, row, index) {
40356
- var _this5 = this;
40357
40356
  var changed = _toggleRowSelection(states, row);
40358
40357
  var selection = states.selection;
40358
+ if (!this.table.shiftMulti.isShift()) {
40359
+ if (selection.includes(row)) {
40360
+ this.table.shiftMulti.setStartStore(row, index);
40361
+ } else {
40362
+ this.table.shiftMulti.setStartStore(null, null);
40363
+ }
40364
+ }
40359
40365
  if (this.table.shiftMulti.setStore(row, index)) {
40360
40366
  var _this$table$shiftMult = this.table.shiftMulti.getStore(),
40361
40367
  start = _this$table$shiftMult.start,
40362
40368
  end = _this$table$shiftMult.end;
40363
40369
  (this.table.data.slice(start.index, end.index + 1) || []).forEach(function (child) {
40364
- if (!states.selection.includes(child)) {
40365
- states.selection.push(child);
40370
+ if (states.selection.includes(child)) {
40371
+ var childIndex = states.selection.findIndex(function (col) {
40372
+ return col === child;
40373
+ });
40374
+ states.selection.splice(childIndex, 1);
40366
40375
  }
40367
- });
40368
- setTimeout(function () {
40369
- _this5.table.$el.style.setProperty('user-select', 'inherit');
40376
+ states.selection.push(child);
40370
40377
  });
40371
40378
  }
40372
40379
  if (changed) {
@@ -40438,13 +40445,13 @@
40438
40445
  }, {
40439
40446
  key: "isAllSelectionDisabled",
40440
40447
  get: function get() {
40441
- var _this6 = this;
40448
+ var _this5 = this;
40442
40449
  if (!this.states.selectable) {
40443
40450
  return false;
40444
40451
  }
40445
40452
  var isEmpty = this.states.data && this.states.data.length === 0;
40446
40453
  var isDisabled = this.states.data.every(function (row, index) {
40447
- return !_this6.states.selectable(row, index);
40454
+ return !_this5.states.selectable(row, index);
40448
40455
  });
40449
40456
  return isEmpty || isDisabled;
40450
40457
  }
@@ -42813,14 +42820,22 @@
42813
42820
  var handleKeyDown = function handleKeyDown(e) {
42814
42821
  if (e.key === 'Shift') {
42815
42822
  isShiftKeyDown = true;
42823
+ document.body.style.userSelect = 'none';
42816
42824
  }
42817
42825
  };
42818
42826
  var handleKeyUp = function handleKeyUp(e) {
42819
42827
  if (e.key === 'Shift') {
42820
42828
  isShiftKeyDown = false;
42829
+ document.body.style.userSelect = '';
42821
42830
  clearStore();
42822
42831
  }
42823
42832
  };
42833
+ var setStartStore = function setStartStore(row, index) {
42834
+ store.start = {
42835
+ index: index,
42836
+ row: row
42837
+ };
42838
+ };
42824
42839
  var setStore = function setStore(row, index) {
42825
42840
  if (!isShiftKeyDown) {
42826
42841
  return false;
@@ -42870,6 +42885,7 @@
42870
42885
  };
42871
42886
  return {
42872
42887
  isShiftKeyDown: isShiftKeyDown,
42888
+ setStartStore: setStartStore,
42873
42889
  isShift: isShift,
42874
42890
  onUnmounted: onUnmounted,
42875
42891
  setStore: setStore,
@@ -43870,7 +43886,7 @@
43870
43886
  "nativeOn": {
43871
43887
  "click": function () {
43872
43888
  var _click2 = _asyncToGenerator( _regeneratorRuntime().mark(function _callee2(event) {
43873
- var isShift, result;
43889
+ var result;
43874
43890
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
43875
43891
  while (1) switch (_context2.prev = _context2.next) {
43876
43892
  case 0:
@@ -43883,16 +43899,12 @@
43883
43899
  }
43884
43900
  return _context2.abrupt("return");
43885
43901
  case 5:
43886
- isShift = store.table.shiftMulti.isShift();
43887
- if (isShift) {
43888
- store.table.$el.style.setProperty('user-select', 'none');
43889
- }
43890
- _context2.next = 9;
43902
+ _context2.next = 7;
43891
43903
  return beforeChange();
43892
- case 9:
43904
+ case 7:
43893
43905
  result = _context2.sent;
43894
43906
  result !== false && store.commit('rowSelectedChanged', row, $index);
43895
- case 11:
43907
+ case 9:
43896
43908
  case "end":
43897
43909
  return _context2.stop();
43898
43910
  }