bk-magic-vue 2.5.3 → 2.5.4-beta.2

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.
@@ -9870,16 +9870,80 @@ span.bk-date-picker-cells-cell-disabled.bk-date-picker-cells-cell-selected em{
9870
9870
  .bk-tab{
9871
9871
  border-radius:2px;
9872
9872
  }
9873
- .bk-tab.bk-tab-border-card >.bk-tab-header{
9873
+ .bk-tab.bk-tab-border-card > .bk-tab-header{
9874
9874
  height:43px;
9875
9875
  border:1px solid #dcdee5;
9876
9876
  border-bottom:none;
9877
9877
  background-color:#fafbfd;
9878
9878
  border-radius:2px 2px 0 0;
9879
9879
  }
9880
- .bk-tab.bk-tab-border-card >.bk-tab-header>.bk-tab-label-wrapper>.bk-tab-label-list >.bk-tab-label-item.active{
9880
+ .bk-tab.bk-tab-border-card > .bk-tab-header > .bk-tab-label-wrapper > .bk-tab-label-list > .bk-tab-label-item.active{
9881
9881
  background-color:#fff;
9882
9882
  }
9883
+ .bk-tab.bk-tab-card-tab{
9884
+ border-radius:4px;
9885
+ }
9886
+ .bk-tab.bk-tab-card-tab > .bk-tab-header{
9887
+ border:0;
9888
+ background:#f0f1f5;
9889
+ border-radius:4px 4px 0 0;
9890
+ overflow:hidden;
9891
+ }
9892
+ .bk-tab.bk-tab-card-tab .bk-tab-label-wrapper.has-scroller.has-add .bk-tab-add-controller{
9893
+ border-left:none;
9894
+ }
9895
+ .bk-tab.bk-tab-card-tab .bk-tab-label-wrapper.has-scroller.has-add .bk-tab-extension-controller{
9896
+ border-left:none;
9897
+ }
9898
+ .bk-tab.bk-tab-card-tab .bk-tab-label-wrapper .bk-tab-extension-controller,
9899
+ .bk-tab.bk-tab-card-tab .bk-tab-label-wrapper .bk-tab-add-controller,
9900
+ .bk-tab.bk-tab-card-tab .bk-tab-label-wrapper .bk-tab-scroll-controller{
9901
+ border:none;
9902
+ background:#f0f1f5;
9903
+ }
9904
+ .bk-tab.bk-tab-card-tab .bk-tab-label-wrapper .bk-tab-label-list .bk-tab-label-item{
9905
+ border:0 !important;
9906
+ position:relative
9907
+ }
9908
+ .bk-tab.bk-tab-card-tab .bk-tab-label-wrapper .bk-tab-label-list .bk-tab-label-item:before{
9909
+ content:'';
9910
+ display:block;
9911
+ position:absolute;
9912
+ left:0;
9913
+ top:50%;
9914
+ margin-top:-8px;
9915
+ width:1px;
9916
+ height:16px;
9917
+ background:#c4c6cc;
9918
+ }
9919
+ .bk-tab.bk-tab-card-tab .bk-tab-label-wrapper .bk-tab-label-list .is-first:before{
9920
+ display:none;
9921
+ }
9922
+ .bk-tab.bk-tab-card-tab .bk-tab-label-wrapper .bk-tab-label-list .is-last:not(.active):after{
9923
+ content:'';
9924
+ display:block;
9925
+ position:absolute;
9926
+ right:0;
9927
+ top:50%;
9928
+ margin-top:-8px;
9929
+ width:1px;
9930
+ height:16px;
9931
+ background:#c4c6cc;
9932
+ }
9933
+ .bk-tab.bk-tab-card-tab .bk-tab-label-wrapper .bk-tab-label-list .active{
9934
+ background:#fff;
9935
+ border-radius:4px 4px 0 0;
9936
+ overflow:hidden
9937
+ }
9938
+ .bk-tab.bk-tab-card-tab .bk-tab-label-wrapper .bk-tab-label-list .active:before{
9939
+ display:none;
9940
+ }
9941
+ .bk-tab.bk-tab-card-tab .bk-tab-label-wrapper .bk-tab-label-list .active:before, .bk-tab.bk-tab-card-tab .bk-tab-label-wrapper .bk-tab-label-list .active + li:before{
9942
+ display:none;
9943
+ }
9944
+ .bk-tab.bk-tab-card-tab .bk-tab-section{
9945
+ border:none;
9946
+ }
9883
9947
  .bk-tab.bk-tab-card .bk-tab-label-wrapper.has-add .bk-tab-label-list{
9884
9948
  border-radius:2px 0 0 0;
9885
9949
  }
@@ -9906,7 +9970,7 @@ span.bk-date-picker-cells-cell-disabled.bk-date-picker-cells-cell-selected em{
9906
9970
  border-top:1px solid #dcdee5;
9907
9971
  background-color:#fff;
9908
9972
  }
9909
- .bk-tab.bk-tab-card >.bk-tab-header>.bk-tab-label-wrapper>.bk-tab-label-list >.bk-tab-label-item.active{
9973
+ .bk-tab.bk-tab-card > .bk-tab-header > .bk-tab-label-wrapper > .bk-tab-label-list > .bk-tab-label-item.active{
9910
9974
  background-color:#fff;
9911
9975
  }
9912
9976
  .bk-tab-label-list-has-bar::after{
@@ -9942,12 +10006,12 @@ span.bk-date-picker-cells-cell-disabled.bk-date-picker-cells-cell-selected em{
9942
10006
  background-color:#fff;
9943
10007
  }
9944
10008
  .bk-tab.bk-tab-unborder-card .bk-tab-label-wrapper .bk-tab-label-list .bk-tab-label-item{
9945
- border:none!important;
10009
+ border:none !important;
9946
10010
  }
9947
10011
  .bk-tab.bk-tab-unborder-card .bk-tab-section{
9948
10012
  border:none;
9949
10013
  }
9950
- .position-left,.position-right{
10014
+ .position-left, .position-right{
9951
10015
  display:-webkit-box;
9952
10016
  display:-ms-flexbox;
9953
10017
  display:flex;
@@ -10048,6 +10112,19 @@ span.bk-date-picker-cells-cell-disabled.bk-date-picker-cells-cell-selected em{
10048
10112
  .position-left .bk-tab-section .bk-tab-content, .position-right .bk-tab-section .bk-tab-content{
10049
10113
  word-break:break-all;
10050
10114
  }
10115
+ .position-left.bk-tab-vertical-tab .bk-tab-header,.position-right.bk-tab-vertical-tab .bk-tab-header{
10116
+ padding:0;
10117
+ background:#f0f1f5;
10118
+ }
10119
+ .position-left.bk-tab-vertical-tab .bk-tab-label-wrapper .active,.position-right.bk-tab-vertical-tab .bk-tab-label-wrapper .active{
10120
+ background:#fff;
10121
+ }
10122
+ .position-left.bk-tab-vertical-tab .bk-tab-label-wrapper:after, .position-right.bk-tab-vertical-tab .bk-tab-label-wrapper:after{
10123
+ display:none;
10124
+ }
10125
+ .position-left.bk-tab-vertical-tab .bk-tab-label-wrapper .bk-tab-label-list .bk-tab-label-item, .position-right.bk-tab-vertical-tab .bk-tab-label-wrapper .bk-tab-label-list .bk-tab-label-item{
10126
+ border:0;
10127
+ }
10051
10128
  .bk-tab-header{
10052
10129
  position:relative;
10053
10130
  height:42px;
@@ -10061,15 +10138,15 @@ span.bk-date-picker-cells-cell-disabled.bk-date-picker-cells-cell-selected em{
10061
10138
  overflow:hidden
10062
10139
  }
10063
10140
  .bk-tab-label-wrapper.has-add .bk-tab-label-list .bk-tab-label-item.has-close{
10064
- -webkit-transition:color .3s cubic-bezier(.645,.045,.355,1),padding .3s cubic-bezier(.645,.045,.355,1);
10065
- transition:color .3s cubic-bezier(.645,.045,.355,1),padding .3s cubic-bezier(.645,.045,.355,1)
10141
+ -webkit-transition:color .3s cubic-bezier(.645, .045, .355, 1), padding .3s cubic-bezier(.645, .045, .355, 1);
10142
+ transition:color .3s cubic-bezier(.645, .045, .355, 1), padding .3s cubic-bezier(.645, .045, .355, 1)
10066
10143
  }
10067
10144
  .bk-tab-label-wrapper.has-add .bk-tab-label-list .bk-tab-label-item.has-close:hover{
10068
10145
  padding:0 11px;
10069
10146
  }
10070
10147
  .bk-tab-label-wrapper.has-add .bk-tab-label-list .bk-tab-label-item.has-close .bk-tab-close-controller{
10071
- -webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);
10072
- transition:all .3s cubic-bezier(.645,.045,.355,1);
10148
+ -webkit-transition:all .3s cubic-bezier(.645, .045, .355, 1);
10149
+ transition:all .3s cubic-bezier(.645, .045, .355, 1);
10073
10150
  }
10074
10151
  .bk-tab-label-wrapper.has-scroller{
10075
10152
  padding:0 24px;
@@ -37120,6 +37120,18 @@
37120
37120
  return panel.visible;
37121
37121
  });
37122
37122
  },
37123
+ tabClass: function tabClass() {
37124
+ var arr = ['bk-tab', this.extCls];
37125
+ if (this.tabPosition === 'top') {
37126
+ arr.push("bk-tab-".concat(this.type));
37127
+ } else {
37128
+ arr.push("position-".concat(this.tabPosition));
37129
+ if (this.type === 'card-tab') {
37130
+ arr.push("bk-tab-vertical-tab");
37131
+ }
37132
+ }
37133
+ return arr;
37134
+ },
37123
37135
  tabStyle: function tabStyle() {
37124
37136
  if (this.isSidePosition) {
37125
37137
  var paddingValue = 21;
@@ -37131,6 +37143,11 @@
37131
37143
  },
37132
37144
  headerStyle: function headerStyle() {
37133
37145
  if (this.tabPosition === 'top') {
37146
+ if (this.type === 'card-tab') {
37147
+ return {
37148
+ height: "".concat(this.labelHeight, "px")
37149
+ };
37150
+ }
37134
37151
  var diffValue = this.type === 'border-card' ? 2 : 1;
37135
37152
  return {
37136
37153
  height: "".concat(this.labelHeight, "px"),
@@ -37146,6 +37163,9 @@
37146
37163
  return this.panelInstance.length < 1;
37147
37164
  },
37148
37165
  hasActiveBar: function hasActiveBar() {
37166
+ if (this.type === 'card-tab') {
37167
+ return false;
37168
+ }
37149
37169
  return (this.type === 'unborder-card' || this.isSidePosition) && !this.isEmpty;
37150
37170
  },
37151
37171
  tabLabelListStyle: function tabLabelListStyle() {
@@ -37625,7 +37645,7 @@
37625
37645
  var _h = _vm.$createElement;
37626
37646
  var _c = _vm._self._c || _h;
37627
37647
  return _c('div', {
37628
- class: ['bk-tab', _vm.tabPosition === 'top' ? "bk-tab-" + _vm.type : "position-" + _vm.tabPosition, _vm.extCls],
37648
+ class: _vm.tabClass,
37629
37649
  style: _vm.tabStyle
37630
37650
  }, [_c('div', {
37631
37651
  directives: [{
@@ -50628,6 +50648,7 @@
50628
50648
  bkOverflowTips: overflowTips,
50629
50649
  bkloading: bkLoading
50630
50650
  },
50651
+ mixins: [locale.mixin],
50631
50652
  props: {
50632
50653
  show: Boolean,
50633
50654
  versionList: {
@@ -50679,6 +50700,14 @@
50679
50700
  versionSubTitleName: {
50680
50701
  type: String,
50681
50702
  default: 'date'
50703
+ },
50704
+ defaultActive: {
50705
+ type: String,
50706
+ default: ''
50707
+ },
50708
+ currentTagText: {
50709
+ type: String,
50710
+ default: ''
50682
50711
  }
50683
50712
  },
50684
50713
  data: function data() {
@@ -50699,6 +50728,14 @@
50699
50728
  };
50700
50729
  },
50701
50730
  computed: {
50731
+ defaultActiveIndex: function defaultActiveIndex() {
50732
+ var _this = this;
50733
+ var activeVersion = this.defaultActive || this.currentVersion;
50734
+ var index = this.versionList.findIndex(function (item) {
50735
+ return item[_this.versionTitleName] === activeVersion;
50736
+ });
50737
+ return index === -1 ? 0 : index;
50738
+ },
50702
50739
  logContent: function logContent() {
50703
50740
  if (this.mdMode) {
50704
50741
  return marked.parse(this.versionDetail);
@@ -50725,7 +50762,7 @@
50725
50762
  },
50726
50763
  methods: {
50727
50764
  handleMouseDown: function handleMouseDown(e) {
50728
- var _this = this;
50765
+ var _this2 = this;
50729
50766
  var target = event.target;
50730
50767
  while (target && target.dataset['tag'] !== 'resizeTarget') {
50731
50768
  target = target.parentNode;
@@ -50738,7 +50775,7 @@
50738
50775
  return false;
50739
50776
  };
50740
50777
  var handleMouseMove = function handleMouseMove(event) {
50741
- _this.left.width = Math.min(Math.max(_this.minLeftWidth, event.clientX - rect.left), _this.maxLeftWidth);
50778
+ _this2.left.width = Math.min(Math.max(_this2.minLeftWidth, event.clientX - rect.left), _this2.maxLeftWidth);
50742
50779
  };
50743
50780
  var handleMouseUp = function handleMouseUp() {
50744
50781
  document.body.style.cursor = '';
@@ -50766,52 +50803,52 @@
50766
50803
  this.$emit('change', v);
50767
50804
  },
50768
50805
  handleOnShowChange: function handleOnShowChange(v) {
50769
- var _this2 = this;
50806
+ var _this3 = this;
50770
50807
  return _asyncToGenerator( _regeneratorRuntime().mark(function _callee() {
50771
50808
  return _regeneratorRuntime().wrap(function _callee$(_context) {
50772
50809
  while (1) {
50773
50810
  switch (_context.prev = _context.next) {
50774
50811
  case 0:
50775
- _this2.dialog.show = v;
50812
+ _this3.dialog.show = v;
50776
50813
  if (!v) {
50777
50814
  _context.next = 20;
50778
50815
  break;
50779
50816
  }
50780
- _this2.dialog.width = window.innerWidth >= 1920 ? 1110 : 850;
50781
- _this2.dialog.height = window.innerWidth >= 1920 ? 640 : 520;
50782
- _this2.loading = true;
50783
- _context.t0 = !_this2.versionList.length && typeof _this2.getVersionList === 'function';
50817
+ _this3.dialog.width = window.innerWidth >= 1920 ? 1110 : 850;
50818
+ _this3.dialog.height = window.innerWidth >= 1920 ? 640 : 520;
50819
+ _this3.loading = true;
50820
+ _context.t0 = !_this3.versionList.length && typeof _this3.getVersionList === 'function';
50784
50821
  if (!_context.t0) {
50785
50822
  _context.next = 9;
50786
50823
  break;
50787
50824
  }
50788
50825
  _context.next = 9;
50789
- return _this2.getVersionList();
50826
+ return _this3.getVersionList();
50790
50827
  case 9:
50791
- if (!_this2.versionList.length) {
50828
+ if (!_this3.versionList.length) {
50792
50829
  _context.next = 19;
50793
50830
  break;
50794
50831
  }
50795
50832
  case 10:
50796
- if (!(!_this2.finished && _this2.dialog.height - 40 > _this2.versionList.length * 55)) {
50833
+ if (!(!_this3.finished && _this3.dialog.height - 40 > _this3.versionList.length * 55)) {
50797
50834
  _context.next = 17;
50798
50835
  break;
50799
50836
  }
50800
- _context.t1 = typeof _this2.getVersionList === 'function';
50837
+ _context.t1 = typeof _this3.getVersionList === 'function';
50801
50838
  if (!_context.t1) {
50802
50839
  _context.next = 15;
50803
50840
  break;
50804
50841
  }
50805
50842
  _context.next = 15;
50806
- return _this2.getVersionList();
50843
+ return _this3.getVersionList();
50807
50844
  case 15:
50808
50845
  _context.next = 10;
50809
50846
  break;
50810
50847
  case 17:
50811
50848
  _context.next = 19;
50812
- return _this2.handleItemClick();
50849
+ return _this3.handleItemClick(_this3.defaultActiveIndex);
50813
50850
  case 19:
50814
- _this2.loading = false;
50851
+ _this3.loading = false;
50815
50852
  case 20:
50816
50853
  case "end":
50817
50854
  return _context.stop();
@@ -50821,39 +50858,39 @@
50821
50858
  }))();
50822
50859
  },
50823
50860
  handleLeftScroll: function handleLeftScroll(e) {
50824
- var _this3 = this;
50861
+ var _this4 = this;
50825
50862
  return _asyncToGenerator( _regeneratorRuntime().mark(function _callee2() {
50826
50863
  var el, scrollHeight, scrollTop, clientHeight;
50827
50864
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
50828
50865
  while (1) {
50829
50866
  switch (_context2.prev = _context2.next) {
50830
50867
  case 0:
50831
- el = _this3.$refs.leftList;
50868
+ el = _this4.$refs.leftList;
50832
50869
  scrollHeight = el.scrollHeight;
50833
50870
  scrollTop = el.scrollTop;
50834
50871
  clientHeight = el.clientHeight;
50835
- if (!(!_this3.finished && clientHeight + scrollTop >= scrollHeight && !_this3.scroll)) {
50872
+ if (!(!_this4.finished && clientHeight + scrollTop >= scrollHeight && !_this4.scroll)) {
50836
50873
  _context2.next = 16;
50837
50874
  break;
50838
50875
  }
50839
- _this3.left.scroll = true;
50840
- _this3.left.loading = true;
50841
- _context2.t0 = typeof _this3.getVersionList === 'function';
50876
+ _this4.left.scroll = true;
50877
+ _this4.left.loading = true;
50878
+ _context2.t0 = typeof _this4.getVersionList === 'function';
50842
50879
  if (!_context2.t0) {
50843
50880
  _context2.next = 11;
50844
50881
  break;
50845
50882
  }
50846
50883
  _context2.next = 11;
50847
- return _this3.getVersionList().catch(function (_) {
50884
+ return _this4.getVersionList().catch(function (_) {
50848
50885
  return false;
50849
50886
  });
50850
50887
  case 11:
50851
50888
  _context2.next = 13;
50852
- return _this3.$nextTick();
50889
+ return _this4.$nextTick();
50853
50890
  case 13:
50854
50891
  el.scrollTo(0, scrollTop - 100);
50855
- _this3.left.loading = false;
50856
- _this3.left.scroll = false;
50892
+ _this4.left.loading = false;
50893
+ _this4.left.scroll = false;
50857
50894
  case 16:
50858
50895
  case "end":
50859
50896
  return _context2.stop();
@@ -50863,27 +50900,28 @@
50863
50900
  }))();
50864
50901
  },
50865
50902
  handleItemClick: function handleItemClick() {
50866
- var _this4 = this;
50903
+ var _this5 = this;
50867
50904
  var v = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
50868
50905
  return _asyncToGenerator( _regeneratorRuntime().mark(function _callee3() {
50869
50906
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
50870
50907
  while (1) {
50871
50908
  switch (_context3.prev = _context3.next) {
50872
50909
  case 0:
50873
- _this4.active = v;
50874
- _this4.loading = true;
50875
- _context3.t0 = typeof _this4.getVersionDetail === 'function';
50910
+ _this5.active = v;
50911
+ _this5.loading = true;
50912
+ _context3.t0 = typeof _this5.getVersionDetail === 'function';
50876
50913
  if (!_context3.t0) {
50877
50914
  _context3.next = 6;
50878
50915
  break;
50879
50916
  }
50880
50917
  _context3.next = 6;
50881
- return _this4.getVersionDetail(_this4.versionList[v]).catch(function (_) {
50918
+ return _this5.getVersionDetail(_this5.versionList[v]).catch(function (_) {
50882
50919
  return false;
50883
50920
  });
50884
50921
  case 6:
50885
- _this4.loading = false;
50886
- case 7:
50922
+ _this5.loading = false;
50923
+ _this5.$emit('selected', v, _this5.versionList[v]);
50924
+ case 8:
50887
50925
  case "end":
50888
50926
  return _context3.stop();
50889
50927
  }
@@ -50966,7 +51004,7 @@
50966
51004
  staticClass: "item-date"
50967
51005
  }, [_vm._v(_vm._s(item[_vm.versionSubTitleName]))]), item[_vm.versionTitleName] === _vm.currentVersion ? _c('span', {
50968
51006
  staticClass: "item-current"
50969
- }, [_vm._v(" " + _vm._s('当前版本') + " ")]) : _vm._e()];
51007
+ }, [_vm._v(" " + _vm._s(_vm.currentTagText || _vm.t('bk.versionDetail.currentTagText')) + " ")]) : _vm._e()];
50970
51008
  }, {
50971
51009
  "version": {
50972
51010
  item: item,