bk-magic-vue 2.4.8 → 2.4.9

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.
Files changed (45) hide show
  1. package/bkui-vue2-helper/attributes.json +1 -0
  2. package/bkui-vue2-helper/tags.json +1 -0
  3. package/dist/bk-magic-vue.css +81 -10
  4. package/dist/bk-magic-vue.js +245 -115
  5. package/dist/bk-magic-vue.min.css +1 -1
  6. package/dist/bk-magic-vue.min.css.gz +0 -0
  7. package/dist/bk-magic-vue.min.css.map +1 -1
  8. package/dist/bk-magic-vue.min.js +1 -1
  9. package/dist/bk-magic-vue.min.js.gz +0 -0
  10. package/dist/bk-magic-vue.min.js.map +1 -1
  11. package/lib/button.js +1 -1
  12. package/lib/date-picker.js +1 -22
  13. package/lib/dialog.js +30 -8
  14. package/lib/image-viewer.js +84 -8
  15. package/lib/image.js +94 -13
  16. package/lib/info-box.js +31 -8
  17. package/lib/loading.js +6 -2
  18. package/lib/pagination.js +871 -51
  19. package/lib/resize-layout.js +24 -22
  20. package/lib/select.js +7 -3
  21. package/lib/spin.js +1 -1
  22. package/lib/tab.js +241 -210
  23. package/lib/table-setting-content.js +1 -1
  24. package/lib/table.js +782 -66
  25. package/lib/tag-input.js +6 -2
  26. package/lib/time-picker.js +1 -22
  27. package/lib/ui/bk-magic-vue.css +81 -10
  28. package/lib/ui/bk-magic-vue.min.css +1 -1
  29. package/lib/ui/bk-magic-vue.min.css.gz +0 -0
  30. package/lib/ui/bk-magic-vue.min.css.map +1 -1
  31. package/lib/ui/pagination.css +14 -0
  32. package/lib/ui/pagination.min.css +1 -1
  33. package/lib/ui/pagination.min.css.map +1 -1
  34. package/lib/ui/select.css +4 -0
  35. package/lib/ui/select.min.css +1 -1
  36. package/lib/ui/select.min.css.map +1 -1
  37. package/lib/ui/spin.css +38 -5
  38. package/lib/ui/spin.min.css +1 -1
  39. package/lib/ui/spin.min.css.map +1 -1
  40. package/lib/ui/tab.css +41 -5
  41. package/lib/ui/tab.min.css +1 -1
  42. package/lib/ui/tab.min.css.map +1 -1
  43. package/lib/version-detail.js +36 -10
  44. package/lib/zoom-image.js +372 -176
  45. package/package.json +2 -2
@@ -628,29 +628,31 @@
628
628
  return _this.$emit('resizing', value);
629
629
  });
630
630
  var handleMouseMove = function handleMouseMove(event) {
631
- var delta;
632
- switch (placement) {
633
- case 'top':
634
- delta = event.clientY - _this.state.mouse.clientY;
635
- break;
636
- case 'right':
637
- delta = _this.state.mouse.clientX - event.clientX;
638
- break;
639
- case 'bottom':
640
- delta = _this.state.mouse.clientY - event.clientY;
641
- break;
642
- case 'left':
643
- delta = event.clientX - _this.state.mouse.clientX;
644
- }
645
- var current = _this.state.aside[_this.computedStyleKey] + delta;
646
- var realValue = _this.getRealValue(current) + _this.triggerOffset;
647
- var pixel = "".concat(realValue, "px");
648
- if (_this.immediate) {
649
- aside.style[_this.computedStyleKey] = pixel;
650
- } else {
651
- resizeProxy.style[placement] = pixel;
631
+ if (!_this.disabled) {
632
+ var delta;
633
+ switch (placement) {
634
+ case 'top':
635
+ delta = event.clientY - _this.state.mouse.clientY;
636
+ break;
637
+ case 'right':
638
+ delta = _this.state.mouse.clientX - event.clientX;
639
+ break;
640
+ case 'bottom':
641
+ delta = _this.state.mouse.clientY - event.clientY;
642
+ break;
643
+ case 'left':
644
+ delta = event.clientX - _this.state.mouse.clientX;
645
+ }
646
+ var current = _this.state.aside[_this.computedStyleKey] + delta;
647
+ var realValue = _this.getRealValue(current) + _this.triggerOffset;
648
+ var pixel = "".concat(realValue, "px");
649
+ if (_this.immediate) {
650
+ aside.style[_this.computedStyleKey] = pixel;
651
+ } else {
652
+ resizeProxy.style[placement] = pixel;
653
+ }
654
+ resizingCallback(realValue);
652
655
  }
653
- resizingCallback(realValue);
654
656
  };
655
657
  var handleMouseUp = function handleMouseUp(event) {
656
658
  resizingCallback.cancel();
package/lib/select.js CHANGED
@@ -4612,7 +4612,9 @@
4612
4612
  el.$vm.isShow = false;
4613
4613
  }, delay);
4614
4614
  } else {
4615
- el.$vm.isShow = false;
4615
+ Vue.nextTick(function () {
4616
+ el.$vm.isShow = false;
4617
+ });
4616
4618
  }
4617
4619
  }
4618
4620
  if (options.title) {
@@ -4646,7 +4648,9 @@
4646
4648
  }
4647
4649
  },
4648
4650
  update: function update(el, binding) {
4649
- toggle(el, binding.value);
4651
+ if (el.viewmodel) {
4652
+ toggle(el, binding.value);
4653
+ }
4650
4654
  }
4651
4655
  };
4652
4656
 
@@ -5671,7 +5675,7 @@
5671
5675
  type: String,
5672
5676
  default: 'primary',
5673
5677
  validator: function validator(value) {
5674
- if (!['primary', 'warning', 'success', 'danger', 'info'].includes(value)) {
5678
+ if (!['default', 'primary', 'warning', 'success', 'danger', 'info'].includes(value)) {
5675
5679
  console.error("theme property is not valid: '".concat(value, "'"));
5676
5680
  return false;
5677
5681
  }
package/lib/spin.js CHANGED
@@ -11,7 +11,7 @@
11
11
  type: String,
12
12
  default: 'primary',
13
13
  validator: function validator(value) {
14
- if (!['primary', 'warning', 'success', 'danger', 'info'].includes(value)) {
14
+ if (!['default', 'primary', 'warning', 'success', 'danger', 'info'].includes(value)) {
15
15
  console.error("theme property is not valid: '".concat(value, "'"));
16
16
  return false;
17
17
  }
package/lib/tab.js CHANGED
@@ -8,6 +8,183 @@
8
8
  return module = { exports: {} }, fn(module, module.exports), module.exports;
9
9
  }
10
10
 
11
+ var _global = createCommonjsModule(function (module) {
12
+ var global = module.exports = typeof window != 'undefined' && window.Math == Math
13
+ ? window : typeof self != 'undefined' && self.Math == Math ? self
14
+ : Function('return this')();
15
+ if (typeof __g == 'number') __g = global;
16
+ });
17
+
18
+ var _core = createCommonjsModule(function (module) {
19
+ var core = module.exports = { version: '2.6.12' };
20
+ if (typeof __e == 'number') __e = core;
21
+ });
22
+ var _core_1 = _core.version;
23
+
24
+ var _aFunction = function (it) {
25
+ if (typeof it != 'function') throw TypeError(it + ' is not a function!');
26
+ return it;
27
+ };
28
+
29
+ var _ctx = function (fn, that, length) {
30
+ _aFunction(fn);
31
+ if (that === undefined) return fn;
32
+ switch (length) {
33
+ case 1: return function (a) {
34
+ return fn.call(that, a);
35
+ };
36
+ case 2: return function (a, b) {
37
+ return fn.call(that, a, b);
38
+ };
39
+ case 3: return function (a, b, c) {
40
+ return fn.call(that, a, b, c);
41
+ };
42
+ }
43
+ return function () {
44
+ return fn.apply(that, arguments);
45
+ };
46
+ };
47
+
48
+ var _isObject = function (it) {
49
+ return typeof it === 'object' ? it !== null : typeof it === 'function';
50
+ };
51
+
52
+ var _anObject = function (it) {
53
+ if (!_isObject(it)) throw TypeError(it + ' is not an object!');
54
+ return it;
55
+ };
56
+
57
+ var _fails = function (exec) {
58
+ try {
59
+ return !!exec();
60
+ } catch (e) {
61
+ return true;
62
+ }
63
+ };
64
+
65
+ var _descriptors = !_fails(function () {
66
+ return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
67
+ });
68
+
69
+ var document$1 = _global.document;
70
+ var is = _isObject(document$1) && _isObject(document$1.createElement);
71
+ var _domCreate = function (it) {
72
+ return is ? document$1.createElement(it) : {};
73
+ };
74
+
75
+ var _ie8DomDefine = !_descriptors && !_fails(function () {
76
+ return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7;
77
+ });
78
+
79
+ var _toPrimitive = function (it, S) {
80
+ if (!_isObject(it)) return it;
81
+ var fn, val;
82
+ if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
83
+ if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) return val;
84
+ if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
85
+ throw TypeError("Can't convert object to primitive value");
86
+ };
87
+
88
+ var dP = Object.defineProperty;
89
+ var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) {
90
+ _anObject(O);
91
+ P = _toPrimitive(P, true);
92
+ _anObject(Attributes);
93
+ if (_ie8DomDefine) try {
94
+ return dP(O, P, Attributes);
95
+ } catch (e) { }
96
+ if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
97
+ if ('value' in Attributes) O[P] = Attributes.value;
98
+ return O;
99
+ };
100
+ var _objectDp = {
101
+ f: f
102
+ };
103
+
104
+ var _propertyDesc = function (bitmap, value) {
105
+ return {
106
+ enumerable: !(bitmap & 1),
107
+ configurable: !(bitmap & 2),
108
+ writable: !(bitmap & 4),
109
+ value: value
110
+ };
111
+ };
112
+
113
+ var _hide = _descriptors ? function (object, key, value) {
114
+ return _objectDp.f(object, key, _propertyDesc(1, value));
115
+ } : function (object, key, value) {
116
+ object[key] = value;
117
+ return object;
118
+ };
119
+
120
+ var hasOwnProperty = {}.hasOwnProperty;
121
+ var _has = function (it, key) {
122
+ return hasOwnProperty.call(it, key);
123
+ };
124
+
125
+ var PROTOTYPE = 'prototype';
126
+ var $export = function (type, name, source) {
127
+ var IS_FORCED = type & $export.F;
128
+ var IS_GLOBAL = type & $export.G;
129
+ var IS_STATIC = type & $export.S;
130
+ var IS_PROTO = type & $export.P;
131
+ var IS_BIND = type & $export.B;
132
+ var IS_WRAP = type & $export.W;
133
+ var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {});
134
+ var expProto = exports[PROTOTYPE];
135
+ var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] : (_global[name] || {})[PROTOTYPE];
136
+ var key, own, out;
137
+ if (IS_GLOBAL) source = name;
138
+ for (key in source) {
139
+ own = !IS_FORCED && target && target[key] !== undefined;
140
+ if (own && _has(exports, key)) continue;
141
+ out = own ? target[key] : source[key];
142
+ exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
143
+ : IS_BIND && own ? _ctx(out, _global)
144
+ : IS_WRAP && target[key] == out ? (function (C) {
145
+ var F = function (a, b, c) {
146
+ if (this instanceof C) {
147
+ switch (arguments.length) {
148
+ case 0: return new C();
149
+ case 1: return new C(a);
150
+ case 2: return new C(a, b);
151
+ } return new C(a, b, c);
152
+ } return C.apply(this, arguments);
153
+ };
154
+ F[PROTOTYPE] = C[PROTOTYPE];
155
+ return F;
156
+ })(out) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out;
157
+ if (IS_PROTO) {
158
+ (exports.virtual || (exports.virtual = {}))[key] = out;
159
+ if (type & $export.R && expProto && !expProto[key]) _hide(expProto, key, out);
160
+ }
161
+ }
162
+ };
163
+ $export.F = 1;
164
+ $export.G = 2;
165
+ $export.S = 4;
166
+ $export.P = 8;
167
+ $export.B = 16;
168
+ $export.W = 32;
169
+ $export.U = 64;
170
+ $export.R = 128;
171
+ var _export = $export;
172
+
173
+ var toString = {}.toString;
174
+ var _cof = function (it) {
175
+ return toString.call(it).slice(8, -1);
176
+ };
177
+
178
+ var _isArray = Array.isArray || function isArray(arg) {
179
+ return _cof(arg) == 'Array';
180
+ };
181
+
182
+ _export(_export.S, 'Array', { isArray: _isArray });
183
+
184
+ var isArray = _core.Array.isArray;
185
+
186
+ var isArray$1 = isArray;
187
+
11
188
  var runtime_1 = createCommonjsModule(function (module) {
12
189
  var runtime = (function (exports) {
13
190
  var Op = Object.prototype;
@@ -539,177 +716,10 @@
539
716
 
540
717
  var _library = true;
541
718
 
542
- var _global = createCommonjsModule(function (module) {
543
- var global = module.exports = typeof window != 'undefined' && window.Math == Math
544
- ? window : typeof self != 'undefined' && self.Math == Math ? self
545
- : Function('return this')();
546
- if (typeof __g == 'number') __g = global;
547
- });
548
-
549
- var _core = createCommonjsModule(function (module) {
550
- var core = module.exports = { version: '2.6.12' };
551
- if (typeof __e == 'number') __e = core;
552
- });
553
- var _core_1 = _core.version;
554
-
555
- var _aFunction = function (it) {
556
- if (typeof it != 'function') throw TypeError(it + ' is not a function!');
557
- return it;
558
- };
559
-
560
- var _ctx = function (fn, that, length) {
561
- _aFunction(fn);
562
- if (that === undefined) return fn;
563
- switch (length) {
564
- case 1: return function (a) {
565
- return fn.call(that, a);
566
- };
567
- case 2: return function (a, b) {
568
- return fn.call(that, a, b);
569
- };
570
- case 3: return function (a, b, c) {
571
- return fn.call(that, a, b, c);
572
- };
573
- }
574
- return function () {
575
- return fn.apply(that, arguments);
576
- };
577
- };
578
-
579
- var _isObject = function (it) {
580
- return typeof it === 'object' ? it !== null : typeof it === 'function';
581
- };
582
-
583
- var _anObject = function (it) {
584
- if (!_isObject(it)) throw TypeError(it + ' is not an object!');
585
- return it;
586
- };
587
-
588
- var _fails = function (exec) {
589
- try {
590
- return !!exec();
591
- } catch (e) {
592
- return true;
593
- }
594
- };
595
-
596
- var _descriptors = !_fails(function () {
597
- return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
598
- });
599
-
600
- var document$1 = _global.document;
601
- var is = _isObject(document$1) && _isObject(document$1.createElement);
602
- var _domCreate = function (it) {
603
- return is ? document$1.createElement(it) : {};
604
- };
605
-
606
- var _ie8DomDefine = !_descriptors && !_fails(function () {
607
- return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7;
608
- });
609
-
610
- var _toPrimitive = function (it, S) {
611
- if (!_isObject(it)) return it;
612
- var fn, val;
613
- if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
614
- if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) return val;
615
- if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
616
- throw TypeError("Can't convert object to primitive value");
617
- };
618
-
619
- var dP = Object.defineProperty;
620
- var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) {
621
- _anObject(O);
622
- P = _toPrimitive(P, true);
623
- _anObject(Attributes);
624
- if (_ie8DomDefine) try {
625
- return dP(O, P, Attributes);
626
- } catch (e) { }
627
- if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
628
- if ('value' in Attributes) O[P] = Attributes.value;
629
- return O;
630
- };
631
- var _objectDp = {
632
- f: f
633
- };
634
-
635
- var _propertyDesc = function (bitmap, value) {
636
- return {
637
- enumerable: !(bitmap & 1),
638
- configurable: !(bitmap & 2),
639
- writable: !(bitmap & 4),
640
- value: value
641
- };
642
- };
643
-
644
- var _hide = _descriptors ? function (object, key, value) {
645
- return _objectDp.f(object, key, _propertyDesc(1, value));
646
- } : function (object, key, value) {
647
- object[key] = value;
648
- return object;
649
- };
650
-
651
- var hasOwnProperty = {}.hasOwnProperty;
652
- var _has = function (it, key) {
653
- return hasOwnProperty.call(it, key);
654
- };
655
-
656
- var PROTOTYPE = 'prototype';
657
- var $export = function (type, name, source) {
658
- var IS_FORCED = type & $export.F;
659
- var IS_GLOBAL = type & $export.G;
660
- var IS_STATIC = type & $export.S;
661
- var IS_PROTO = type & $export.P;
662
- var IS_BIND = type & $export.B;
663
- var IS_WRAP = type & $export.W;
664
- var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {});
665
- var expProto = exports[PROTOTYPE];
666
- var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] : (_global[name] || {})[PROTOTYPE];
667
- var key, own, out;
668
- if (IS_GLOBAL) source = name;
669
- for (key in source) {
670
- own = !IS_FORCED && target && target[key] !== undefined;
671
- if (own && _has(exports, key)) continue;
672
- out = own ? target[key] : source[key];
673
- exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
674
- : IS_BIND && own ? _ctx(out, _global)
675
- : IS_WRAP && target[key] == out ? (function (C) {
676
- var F = function (a, b, c) {
677
- if (this instanceof C) {
678
- switch (arguments.length) {
679
- case 0: return new C();
680
- case 1: return new C(a);
681
- case 2: return new C(a, b);
682
- } return new C(a, b, c);
683
- } return C.apply(this, arguments);
684
- };
685
- F[PROTOTYPE] = C[PROTOTYPE];
686
- return F;
687
- })(out) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out;
688
- if (IS_PROTO) {
689
- (exports.virtual || (exports.virtual = {}))[key] = out;
690
- if (type & $export.R && expProto && !expProto[key]) _hide(expProto, key, out);
691
- }
692
- }
693
- };
694
- $export.F = 1;
695
- $export.G = 2;
696
- $export.S = 4;
697
- $export.P = 8;
698
- $export.B = 16;
699
- $export.W = 32;
700
- $export.U = 64;
701
- $export.R = 128;
702
- var _export = $export;
703
-
704
719
  var _redefine = _hide;
705
720
 
706
721
  var _iterators = {};
707
722
 
708
- var toString = {}.toString;
709
- var _cof = function (it) {
710
- return toString.call(it).slice(8, -1);
711
- };
712
-
713
723
  var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
714
724
  return _cof(it) == 'String' ? it.split('') : Object(it);
715
725
  };
@@ -1980,6 +1990,9 @@
1980
1990
  },
1981
1991
  hasAddBtnSlot: function hasAddBtnSlot() {
1982
1992
  return !!this.$slots && !!this.$slots.add;
1993
+ },
1994
+ hasExtensionSlot: function hasExtensionSlot() {
1995
+ return !!this.$slots && !!this.$slots.extension;
1983
1996
  }
1984
1997
  },
1985
1998
  watch: {
@@ -2163,16 +2176,20 @@
2163
2176
  var _this4$$refs = _this4.$refs,
2164
2177
  labelWrapper = _this4$$refs.labelWrapper,
2165
2178
  labelList = _this4$$refs.labelList,
2166
- addController = _this4$$refs.addController;
2179
+ addController = _this4$$refs.addController,
2180
+ extensionController = _this4$$refs.extensionController;
2167
2181
  var labelWrapperRect = labelWrapper.getBoundingClientRect();
2168
2182
  var labelListRect = labelList.getBoundingClientRect();
2169
2183
  var addControllerRect = addController ? addController.getBoundingClientRect() : {
2170
2184
  width: 0
2171
2185
  };
2186
+ var extensionControllerReact = extensionController ? extensionController.getBoundingClientRect() : {
2187
+ width: 0
2188
+ };
2172
2189
  _this4.addCustomRect = _this4.hasAddBtnSlot ? _this4.$refs.addCustom.getBoundingClientRect() : {
2173
2190
  width: 0
2174
2191
  };
2175
- _this4.scrollState.show = labelListRect.width + addControllerRect.width + _this4.addCustomRect.width > labelWrapperRect.width;
2192
+ _this4.scrollState.show = labelListRect.width + addControllerRect.width + _this4.addCustomRect.width + extensionControllerReact.width > labelWrapperRect.width;
2176
2193
  if (!_this4.scrollState.show) {
2177
2194
  _this4.scrollState.offset = 0;
2178
2195
  _this4.scrollState.position = 'left';
@@ -2212,8 +2229,9 @@
2212
2229
  getRightControllerWidth: function getRightControllerWidth() {
2213
2230
  var _this$$refs = this.$refs,
2214
2231
  nextController = _this$$refs.nextController,
2215
- addController = _this$$refs.addController;
2216
- var controllers = [nextController, addController];
2232
+ addController = _this$$refs.addController,
2233
+ extensionController = _this$$refs.extensionController;
2234
+ var controllers = [nextController, addController, extensionController];
2217
2235
  var width = 0;
2218
2236
  controllers.forEach(function (controller) {
2219
2237
  width += controller ? controller.offsetWidth : 0;
@@ -2232,45 +2250,47 @@
2232
2250
  return false;
2233
2251
  }
2234
2252
  this.$nextTick(function () {
2235
- var panel = _this5.$refs.tabLabel.find(function (item) {
2236
- if (item && item.$el) {
2237
- var newActive = Object.prototype.toString.call(active) === '[object Number]' ? active + '' : active;
2238
- return item.$el.dataset.name === newActive;
2239
- }
2240
- });
2241
- if (panel) {
2242
- var tabLabel = panel.$el;
2243
- var tabLabelRect = tabLabel.getBoundingClientRect();
2244
- if (!_this5.isSidePosition) {
2245
- if (tabLabelRect.width === 0 && tabLabelRect.height === 0) {
2246
- tabLabel.classList.add('simulate-border-bottom');
2247
- } else {
2248
- tabLabel.classList.remove('simulate-border-bottom');
2249
- }
2250
- _this5.activeBarStyle.width = "".concat(tabLabelRect.width - 24, "px");
2251
- _this5.activeBarStyle.height = _this5.activeBar.height;
2252
- _this5.activeBarStyle.transform = "translateX(".concat(tabLabel.offsetLeft + 12, "px)");
2253
- _this5.activeBarStyle.left = 0;
2254
- if (_this5.activeBar.position === 'top') {
2255
- _this5.activeBarStyle.top = '0px';
2256
- _this5.activeBarStyle.bottom = 'auto';
2257
- } else {
2258
- _this5.activeBarStyle.top = 'auto';
2259
- _this5.activeBarStyle.bottom = '0px';
2260
- }
2261
- } else {
2262
- if (tabLabelRect.width === 0 && tabLabelRect.height === 0) {
2263
- tabLabel.classList.add('simulate-border-right');
2264
- } else {
2265
- tabLabel.classList.remove('simulate-border-right');
2253
+ if (isArray$1(_this5.$refs.tabLabel)) {
2254
+ var panel = _this5.$refs.tabLabel.find(function (item) {
2255
+ if (item && item.$el) {
2256
+ var newActive = Object.prototype.toString.call(active) === '[object Number]' ? active + '' : active;
2257
+ return item.$el.dataset.name === newActive;
2266
2258
  }
2267
- _this5.activeBarStyle.width = _this5.activeBar.height;
2268
- _this5.activeBarStyle.height = "".concat(tabLabelRect.height || 50, "px");
2269
- _this5.activeBarStyle.transform = "translateY(".concat(tabLabel.offsetTop, "px)");
2270
- if (_this5.tabPosition === 'right') {
2259
+ });
2260
+ if (panel) {
2261
+ var tabLabel = panel.$el;
2262
+ var tabLabelRect = tabLabel.getBoundingClientRect();
2263
+ if (!_this5.isSidePosition) {
2264
+ if (tabLabelRect.width === 0 && tabLabelRect.height === 0) {
2265
+ tabLabel.classList.add('simulate-border-bottom');
2266
+ } else {
2267
+ tabLabel.classList.remove('simulate-border-bottom');
2268
+ }
2269
+ _this5.activeBarStyle.width = "".concat(tabLabelRect.width - 24, "px");
2270
+ _this5.activeBarStyle.height = _this5.activeBar.height;
2271
+ _this5.activeBarStyle.transform = "translateX(".concat(tabLabel.offsetLeft + 12, "px)");
2271
2272
  _this5.activeBarStyle.left = 0;
2273
+ if (_this5.activeBar.position === 'top') {
2274
+ _this5.activeBarStyle.top = '0px';
2275
+ _this5.activeBarStyle.bottom = 'auto';
2276
+ } else {
2277
+ _this5.activeBarStyle.top = 'auto';
2278
+ _this5.activeBarStyle.bottom = '0px';
2279
+ }
2272
2280
  } else {
2273
- _this5.activeBarStyle.left = "".concat(tabLabelRect.width - 2, "px");
2281
+ if (tabLabelRect.width === 0 && tabLabelRect.height === 0) {
2282
+ tabLabel.classList.add('simulate-border-right');
2283
+ } else {
2284
+ tabLabel.classList.remove('simulate-border-right');
2285
+ }
2286
+ _this5.activeBarStyle.width = _this5.activeBar.height;
2287
+ _this5.activeBarStyle.height = "".concat(tabLabelRect.height || 50, "px");
2288
+ _this5.activeBarStyle.transform = "translateY(".concat(tabLabel.offsetTop, "px)");
2289
+ if (_this5.tabPosition === 'right') {
2290
+ _this5.activeBarStyle.left = 0;
2291
+ } else {
2292
+ _this5.activeBarStyle.left = "".concat(tabLabelRect.width - 2, "px");
2293
+ }
2274
2294
  }
2275
2295
  }
2276
2296
  }
@@ -2513,7 +2533,8 @@
2513
2533
  staticClass: "bk-tab-label-wrapper",
2514
2534
  class: {
2515
2535
  'has-scroller': _vm.scrollState.show && !_vm.isSidePosition,
2516
- 'has-add': (_vm.addable || _vm.hasAddBtnSlot) && !_vm.isSidePosition
2536
+ 'has-add': (_vm.addable || _vm.hasAddBtnSlot) && !_vm.isSidePosition,
2537
+ 'has-extension': _vm.hasExtensionSlot
2517
2538
  },
2518
2539
  style: {
2519
2540
  padding: _vm.scrollState.show && !_vm.isSidePosition ? "0 " + (_vm.addCustomRect.width + 24) + "px 0 24px" : undefined
@@ -2584,11 +2605,21 @@
2584
2605
  }
2585
2606
  }
2586
2607
  });
2587
- }), 1), _vm.addable && !_vm.isSidePosition && !_vm.hasAddBtnSlot ? _c('i', {
2608
+ }), 1), _vm.hasExtensionSlot ? _c('div', {
2609
+ ref: "extensionController",
2610
+ class: {
2611
+ 'bk-tab-extension-controller': true,
2612
+ 'has-setting': _vm.$slots.extension
2613
+ },
2614
+ style: {
2615
+ height: _vm.labelHeight + "px",
2616
+ lineHeight: _vm.labelHeight + "px"
2617
+ }
2618
+ }, [_vm._t("extension")], 2) : _vm._e(), _vm.addable && !_vm.isSidePosition && !_vm.hasAddBtnSlot ? _c('i', {
2588
2619
  ref: "addController",
2589
2620
  staticClass: "bk-tab-add-controller bk-icon icon-plus",
2590
2621
  class: {
2591
- 'left-border': !_vm.visiblePanels.length,
2622
+ 'left-border': !_vm.visiblePanels.length && !_vm.hasExtensionSlot,
2592
2623
  'next-right': _vm.addShowNextRight
2593
2624
  },
2594
2625
  style: {
@@ -1350,7 +1350,7 @@
1350
1350
  type: String,
1351
1351
  default: 'primary',
1352
1352
  validator: function validator(value) {
1353
- if (!['primary', 'warning', 'success', 'danger', 'info'].includes(value)) {
1353
+ if (!['default', 'primary', 'warning', 'success', 'danger', 'info'].includes(value)) {
1354
1354
  console.error("theme property is not valid: '".concat(value, "'"));
1355
1355
  return false;
1356
1356
  }