bk-magic-vue 2.4.4 → 2.4.7

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 (56) hide show
  1. package/dist/bk-magic-vue.css +132 -113
  2. package/dist/bk-magic-vue.js +1810 -1052
  3. package/dist/bk-magic-vue.min.css +1 -1
  4. package/dist/bk-magic-vue.min.css.gz +0 -0
  5. package/dist/bk-magic-vue.min.css.map +1 -1
  6. package/dist/bk-magic-vue.min.js +1 -1
  7. package/dist/bk-magic-vue.min.js.gz +0 -0
  8. package/dist/bk-magic-vue.min.js.map +1 -1
  9. package/lib/affix.js +5 -2
  10. package/lib/big-tree.js +9 -1
  11. package/lib/button.js +263 -94
  12. package/lib/card.js +2 -0
  13. package/lib/cascade.js +7 -0
  14. package/lib/dialog.js +278 -109
  15. package/lib/dropdown-menu.js +1936 -1891
  16. package/lib/image-viewer.js +2 -2
  17. package/lib/image.js +2 -2
  18. package/lib/info-box.js +277 -108
  19. package/lib/input.js +2 -0
  20. package/lib/pagination.js +303 -68
  21. package/lib/select.js +255 -20
  22. package/lib/slider.js +2 -0
  23. package/lib/table-setting-content.js +202 -33
  24. package/lib/table.js +88 -8
  25. package/lib/transfer.js +2 -0
  26. package/lib/ui/bk-magic-vue.css +132 -113
  27. package/lib/ui/bk-magic-vue.min.css +1 -1
  28. package/lib/ui/bk-magic-vue.min.css.gz +0 -0
  29. package/lib/ui/bk-magic-vue.min.css.map +1 -1
  30. package/lib/ui/button.css +11 -2
  31. package/lib/ui/button.min.css +1 -1
  32. package/lib/ui/button.min.css.map +1 -1
  33. package/lib/ui/divider.css +0 -17
  34. package/lib/ui/divider.min.css +1 -1
  35. package/lib/ui/divider.min.css.map +1 -1
  36. package/lib/ui/dropdown-menu.css +87 -88
  37. package/lib/ui/dropdown-menu.min.css +1 -1
  38. package/lib/ui/dropdown-menu.min.css.map +1 -1
  39. package/lib/ui/image-viewer.css +14 -8
  40. package/lib/ui/image-viewer.min.css +1 -1
  41. package/lib/ui/image-viewer.min.css.map +1 -1
  42. package/lib/ui/pagination.css +1 -0
  43. package/lib/ui/pagination.min.css +1 -1
  44. package/lib/ui/pagination.min.css.map +1 -1
  45. package/lib/ui/select.css +19 -0
  46. package/lib/ui/select.min.css +1 -1
  47. package/lib/ui/select.min.css.map +1 -1
  48. package/lib/ui/table.css +6 -0
  49. package/lib/ui/table.min.css +1 -1
  50. package/lib/ui/table.min.css.map +1 -1
  51. package/lib/ui/zoom-image.css +1 -0
  52. package/lib/ui/zoom-image.min.css +1 -1
  53. package/lib/ui/zoom-image.min.css.map +1 -1
  54. package/lib/upload.js +1308 -20
  55. package/lib/version-detail.js +238 -69
  56. package/package.json +5 -4
package/lib/affix.js CHANGED
@@ -118,13 +118,16 @@
118
118
  },
119
119
  methods: {
120
120
  setTargetLoop: function setTargetLoop() {
121
+ var rect = this.targetEl.getBoundingClientRect();
121
122
  if (this.offsetType === 'top') {
122
123
  this.styles = {
123
- top: "".concat(this.targetEl.getBoundingClientRect().top + this.offsetTop, "px")
124
+ top: "".concat(rect.top + this.offsetTop, "px"),
125
+ width: "".concat(rect.width, "px")
124
126
  };
125
127
  } else {
126
128
  this.styles = {
127
- bottom: "".concat(window.innerHeight - this.targetEl.getBoundingClientRect().bottom + this.offsetBottom, "px")
129
+ bottom: "".concat(window.innerHeight - rect.bottom + this.offsetBottom, "px"),
130
+ width: "".concat(rect.width, "px")
128
131
  };
129
132
  }
130
133
  },
package/lib/big-tree.js CHANGED
@@ -2029,7 +2029,10 @@
2029
2029
  }) : _vm._e(), _vm.props.node.nodeIcon ? _c('i', {
2030
2030
  class: ['node-icon', _vm.props.node.nodeIcon]
2031
2031
  }) : _vm._e()]), _c('div', {
2032
- staticClass: "node-content"
2032
+ staticClass: "node-content",
2033
+ attrs: {
2034
+ "title": _vm.props.enableTitleTip ? _vm.props.node.name : false
2035
+ }
2033
2036
  }, [_vm._t("default", [_vm._v("\n " + _vm._s(_vm.props.node.name) + "\n ")], {
2034
2037
  node: _vm.props.node,
2035
2038
  data: _vm.props.node.data
@@ -2166,6 +2169,10 @@
2166
2169
  size: {
2167
2170
  type: String,
2168
2171
  default: 'normal'
2172
+ },
2173
+ enableTitleTip: {
2174
+ type: Boolean,
2175
+ default: false
2169
2176
  }
2170
2177
  },
2171
2178
  data: function data() {
@@ -2789,6 +2796,7 @@
2789
2796
  ref: node.id,
2790
2797
  refInFor: true,
2791
2798
  attrs: {
2799
+ "enable-title-tip": _vm.enableTitleTip,
2792
2800
  "node": node
2793
2801
  }
2794
2802
  }, [_vm._t("default", null, {
package/lib/button.js CHANGED
@@ -5,105 +5,80 @@
5
5
  }(this, function (exports) { 'use strict';
6
6
 
7
7
  var script = {
8
- name: 'bk-button',
8
+ name: 'bk-spin',
9
9
  props: {
10
10
  theme: {
11
11
  type: String,
12
- default: 'default',
12
+ default: 'primary',
13
13
  validator: function validator(value) {
14
- if (['default', 'primary', 'warning', 'success', 'danger'].indexOf(value) < 0) {
14
+ if (!['primary', 'warning', 'success', 'danger', 'info'].includes(value)) {
15
15
  console.error("theme property is not valid: '".concat(value, "'"));
16
16
  return false;
17
17
  }
18
18
  return true;
19
19
  }
20
20
  },
21
- hoverTheme: {
22
- type: String,
23
- default: '',
24
- validator: function validator(value) {
25
- if (['', 'primary', 'warning', 'success', 'danger'].indexOf(value) < 0) {
26
- console.error("hoverTheme property is not valid: '".concat(value, "'"));
27
- return false;
28
- }
29
- return true;
30
- }
31
- },
32
21
  size: {
33
22
  type: String,
34
- default: 'normal',
23
+ default: 'small',
35
24
  validator: function validator(value) {
36
- if (['small', 'normal', 'large'].indexOf(value) < 0) {
25
+ if (!['large', 'normal', 'small', 'mini'].includes(value)) {
37
26
  console.error("size property is not valid: '".concat(value, "'"));
38
27
  return false;
39
28
  }
40
29
  return true;
41
30
  }
42
31
  },
43
- title: {
32
+ icon: {
44
33
  type: String,
45
34
  default: ''
46
35
  },
47
- icon: String,
48
- iconRight: String,
49
- disabled: Boolean,
50
- loading: Boolean,
51
- outline: Boolean,
52
- text: Boolean,
53
- nativeType: {
54
- type: String,
55
- default: 'button'
56
- },
57
36
  extCls: {
58
37
  type: String,
59
38
  default: ''
39
+ },
40
+ placement: {
41
+ type: String,
42
+ default: 'bottom',
43
+ validator: function validator(value) {
44
+ if (!['bottom', 'right'].includes(value)) {
45
+ console.error("placement property is not valid: '".concat(value, "'"));
46
+ return false;
47
+ }
48
+ return true;
49
+ }
50
+ },
51
+ spinning: {
52
+ type: Boolean,
53
+ default: true
60
54
  }
61
55
  },
62
56
  data: function data() {
63
- return {
64
- showSlot: true
65
- };
57
+ return {};
66
58
  },
67
59
  computed: {
68
- iconType: function iconType() {
69
- var icon = this.icon || '';
70
- if (icon) {
71
- if (icon.indexOf('icon') === 0) {
72
- icon = icon.replace(/^(icon-)/, '');
73
- }
74
- }
75
- return icon;
60
+ dotClass: function dotClass() {
61
+ var dotClass = ["bk-spin-rotation", "bk-spin-rotation-".concat(this.size), "bk-spin-rotation-".concat(this.theme)];
62
+ !this.spinning && dotClass.push("bk-spin-rotation-".concat(this.theme, "-wait"));
63
+ this.placement === 'right' && dotClass.push("bk-spin-rotation-flex");
64
+ this.placement === 'bottom' && dotClass.push("bk-spin-rotation-margin");
65
+ return dotClass;
76
66
  },
77
- iconRightType: function iconRightType() {
78
- var iconRight = this.iconRight || '';
79
- if (iconRight) {
80
- if (iconRight.indexOf('icon') === 0) {
81
- iconRight = iconRight.replace(/^(icon-)/, '');
82
- }
83
- }
84
- return iconRight;
67
+ slotTypeClass: function slotTypeClass() {
68
+ var slotType = ["rotate"];
69
+ this.$slots.default && this.placement === 'right' && slotType.push("slots-".concat(this.placement, "-rotate"));
70
+ return slotType;
85
71
  },
86
- themeType: function themeType() {
87
- if (this.text) {
88
- if (this.theme === 'default') {
89
- return 'primary';
90
- }
91
- }
92
- return this.theme;
72
+ iconClass: function iconClass() {
73
+ var iconClass = ["bk-spin-icon", "bk-spin-icon-".concat(this.size), "bk-spin-icon-".concat(this.theme)];
74
+ !this.spinning && iconClass.push("bk-spin-icon-wait");
75
+ this.placement === 'right' && iconClass.push("bk-display-flex");
76
+ return iconClass;
93
77
  },
94
- buttonCls: function buttonCls() {
95
- return ["bk-".concat(this.themeType), "bk-button-".concat(this.size), this.hoverTheme ? "bk-button-hover bk-".concat(this.hoverTheme) : this.text ? 'bk-button-text' : 'bk-button', this.disabled ? 'is-disabled' : '', this.loading ? 'is-loading' : '', this.outline ? 'is-outline' : '', !this.showSlot ? 'no-slot' : ''];
96
- }
97
- },
98
- mounted: function mounted() {
99
- this.showSlot = this.$slots.default !== undefined;
100
- },
101
- methods: {
102
- handleClick: function handleClick(e) {
103
- if (!this.disabled && !this.loading) {
104
- this.$emit('click', e);
105
- this.$el.blur();
106
- }
78
+ slotClass: function slotClass() {
79
+ var slotClass = ["bk-spin-title", "bk-spin-title-".concat(this.placement)];
80
+ this.placement === 'right' && slotClass.push("bk-spin-title-".concat(this.size), "bk-display-flex");
81
+ return slotClass;
107
82
  }
108
83
  }
109
84
  };
@@ -178,39 +153,49 @@
178
153
 
179
154
  var _c = _vm._self._c || _h;
180
155
 
181
- return _c('button', _vm._b({
182
- class: [_vm.buttonCls, _vm.extCls],
156
+ return _c('transition', {
183
157
  attrs: {
184
- "title": _vm.title,
185
- "disabled": _vm.disabled,
186
- "type": _vm.nativeType
187
- },
188
- on: {
189
- "click": _vm.handleClick
158
+ "name": "fade"
190
159
  }
191
- }, 'button', _vm.$attrs, false), [_vm.loading ? _c('div', {
192
- staticClass: "bk-button-loading"
193
160
  }, [_c('div', {
194
- staticClass: "bounce1"
161
+ class: ['bk-spin', _vm.extCls]
162
+ }, [_c('div', {
163
+ style: {
164
+ display: _vm.placement === 'right' ? 'flex' : ''
165
+ }
166
+ }, [!_vm.icon ? _c('div', {
167
+ class: [_vm.dotClass]
168
+ }, [_c('div', {
169
+ staticClass: "rotate1",
170
+ class: _vm.slotTypeClass
195
171
  }), _c('div', {
196
- staticClass: "bounce2"
172
+ staticClass: "rotate2",
173
+ class: _vm.slotTypeClass
197
174
  }), _c('div', {
198
- staticClass: "bounce3"
175
+ staticClass: "rotate3",
176
+ class: _vm.slotTypeClass
199
177
  }), _c('div', {
200
- staticClass: "bounce4"
201
- })]) : _vm._e(), _c('div', {
202
- class: _vm.loading ? 'bk-loading-wrapper' : ''
203
- }, [_vm.iconType ? _c('i', {
204
- staticClass: "bk-icon left-icon",
205
- class: ['icon-' + _vm.iconType, _vm.iconType === 'loading' ? 'bk-button-icon-loading' : '']
206
- }, [_vm.iconType === 'loading' ? [_c('span', {
207
- staticClass: "loading"
208
- })] : _vm._e()], 2) : _vm._e(), _c('span', [_vm._t("default")], 2), _vm.iconRightType ? _c('i', {
209
- staticClass: "bk-icon right-icon",
210
- class: ['icon-' + _vm.iconRightType, _vm.iconRightType === 'loading' ? 'bk-button-icon-loading' : '']
211
- }, [_vm.iconRightType === 'loading' ? [_c('span', {
212
- staticClass: "loading"
213
- })] : _vm._e()], 2) : _vm._e()])]);
178
+ staticClass: "rotate4",
179
+ class: _vm.slotTypeClass
180
+ }), _c('div', {
181
+ staticClass: "rotate5",
182
+ class: _vm.slotTypeClass
183
+ }), _c('div', {
184
+ staticClass: "rotate6",
185
+ class: _vm.slotTypeClass
186
+ }), _c('div', {
187
+ staticClass: "rotate7",
188
+ class: _vm.slotTypeClass
189
+ }), _c('div', {
190
+ staticClass: "rotate8",
191
+ class: _vm.slotTypeClass
192
+ })]) : _vm._e(), _vm.icon ? _c('div', {
193
+ class: [_vm.iconClass]
194
+ }, [_c('i', {
195
+ class: ['bk-icon', 'icon-' + _vm.icon]
196
+ })]) : _vm._e(), _vm.$slots.default ? _c('div', {
197
+ class: [_vm.slotClass]
198
+ }, [_vm._t("default")], 2) : _vm._e()])])]);
214
199
  };
215
200
 
216
201
  var __vue_staticRenderFns__ = [];
@@ -544,7 +529,191 @@
544
529
 
545
530
  setInstaller(__vue_component__);
546
531
 
547
- exports.default = __vue_component__;
532
+ var script$1 = {
533
+ name: 'bk-button',
534
+ components: {
535
+ BkSpin: __vue_component__
536
+ },
537
+ props: {
538
+ theme: {
539
+ type: String,
540
+ default: 'default',
541
+ validator: function validator(value) {
542
+ if (['default', 'primary', 'warning', 'success', 'danger'].indexOf(value) < 0) {
543
+ console.error("theme property is not valid: '".concat(value, "'"));
544
+ return false;
545
+ }
546
+ return true;
547
+ }
548
+ },
549
+ hoverTheme: {
550
+ type: String,
551
+ default: '',
552
+ validator: function validator(value) {
553
+ if (['', 'primary', 'warning', 'success', 'danger'].indexOf(value) < 0) {
554
+ console.error("hoverTheme property is not valid: '".concat(value, "'"));
555
+ return false;
556
+ }
557
+ return true;
558
+ }
559
+ },
560
+ size: {
561
+ type: String,
562
+ default: 'normal',
563
+ validator: function validator(value) {
564
+ if (['small', 'normal', 'large'].indexOf(value) < 0) {
565
+ console.error("size property is not valid: '".concat(value, "'"));
566
+ return false;
567
+ }
568
+ return true;
569
+ }
570
+ },
571
+ title: {
572
+ type: String,
573
+ default: ''
574
+ },
575
+ icon: String,
576
+ iconRight: String,
577
+ disabled: Boolean,
578
+ loading: Boolean,
579
+ outline: Boolean,
580
+ text: Boolean,
581
+ nativeType: {
582
+ type: String,
583
+ default: 'button'
584
+ },
585
+ extCls: {
586
+ type: String,
587
+ default: ''
588
+ }
589
+ },
590
+ data: function data() {
591
+ return {
592
+ showSlot: true
593
+ };
594
+ },
595
+ computed: {
596
+ iconType: function iconType() {
597
+ var icon = this.icon || '';
598
+ if (icon) {
599
+ if (icon.indexOf('icon') === 0) {
600
+ icon = icon.replace(/^(icon-)/, '');
601
+ }
602
+ }
603
+ return icon;
604
+ },
605
+ iconRightType: function iconRightType() {
606
+ var iconRight = this.iconRight || '';
607
+ if (iconRight) {
608
+ if (iconRight.indexOf('icon') === 0) {
609
+ iconRight = iconRight.replace(/^(icon-)/, '');
610
+ }
611
+ }
612
+ return iconRight;
613
+ },
614
+ themeType: function themeType() {
615
+ if (this.text) {
616
+ if (this.theme === 'default') {
617
+ return 'primary';
618
+ }
619
+ }
620
+ return this.theme;
621
+ },
622
+ buttonCls: function buttonCls() {
623
+ return ["bk-".concat(this.themeType), "bk-button-".concat(this.size), this.hoverTheme ? "bk-button-hover bk-".concat(this.hoverTheme) : this.text ? 'bk-button-text' : 'bk-button', this.disabled ? 'is-disabled' : '', this.loading ? 'is-loading' : '', this.outline ? 'is-outline' : '', !this.showSlot ? 'no-slot' : ''];
624
+ }
625
+ },
626
+ mounted: function mounted() {
627
+ this.showSlot = this.$slots.default !== undefined;
628
+ },
629
+ methods: {
630
+ handleClick: function handleClick(e) {
631
+ if (!this.disabled && !this.loading) {
632
+ this.$emit('click', e);
633
+ this.$el.blur();
634
+ }
635
+ }
636
+ }
637
+ };
638
+
639
+ /* script */
640
+ var __vue_script__$1 = script$1;
641
+ /* template */
642
+
643
+ var __vue_render__$1 = function __vue_render__() {
644
+ var _vm = this;
645
+
646
+ var _h = _vm.$createElement;
647
+
648
+ var _c = _vm._self._c || _h;
649
+
650
+ return _c('button', _vm._b({
651
+ class: [_vm.buttonCls, _vm.extCls],
652
+ attrs: {
653
+ "title": _vm.title,
654
+ "disabled": _vm.disabled,
655
+ "type": _vm.nativeType
656
+ },
657
+ on: {
658
+ "click": _vm.handleClick
659
+ }
660
+ }, 'button', _vm.$attrs, false), [_vm.loading ? _c('div', {
661
+ staticClass: "bk-button-loading"
662
+ }, [!_vm.text ? [_c('div', {
663
+ staticClass: "bounce bounce1"
664
+ }), _c('div', {
665
+ staticClass: "bounce bounce2"
666
+ }), _c('div', {
667
+ staticClass: "bounce bounce3"
668
+ }), _c('div', {
669
+ staticClass: "bounce bounce4"
670
+ })] : [_c('bk-spin', {
671
+ attrs: {
672
+ "size": "mini",
673
+ "theme": _vm.theme
674
+ }
675
+ })]], 2) : _vm._e(), _c('div', {
676
+ class: _vm.loading ? 'bk-loading-wrapper' : ''
677
+ }, [_vm.iconType ? _c('i', {
678
+ staticClass: "bk-icon left-icon",
679
+ class: ['icon-' + _vm.iconType, _vm.iconType === 'loading' ? 'bk-button-icon-loading' : '']
680
+ }, [_vm.iconType === 'loading' ? [_c('span', {
681
+ staticClass: "loading"
682
+ })] : _vm._e()], 2) : _vm._e(), _c('span', [_vm._t("default")], 2), _vm.iconRightType ? _c('i', {
683
+ staticClass: "bk-icon right-icon",
684
+ class: ['icon-' + _vm.iconRightType, _vm.iconRightType === 'loading' ? 'bk-button-icon-loading' : '']
685
+ }, [_vm.iconRightType === 'loading' ? [_c('span', {
686
+ staticClass: "loading"
687
+ })] : _vm._e()], 2) : _vm._e()])]);
688
+ };
689
+
690
+ var __vue_staticRenderFns__$1 = [];
691
+ /* style */
692
+
693
+ var __vue_inject_styles__$1 = undefined;
694
+ /* scoped */
695
+
696
+ var __vue_scope_id__$1 = undefined;
697
+ /* module identifier */
698
+
699
+ var __vue_module_identifier__$1 = undefined;
700
+ /* functional template */
701
+
702
+ var __vue_is_functional_template__$1 = false;
703
+ /* style inject */
704
+
705
+ /* style inject SSR */
706
+
707
+ /* style inject shadow dom */
708
+
709
+ var __vue_component__$1 = /*#__PURE__*/normalizeComponent_1({
710
+ render: __vue_render__$1,
711
+ staticRenderFns: __vue_staticRenderFns__$1
712
+ }, __vue_inject_styles__$1, __vue_script__$1, __vue_scope_id__$1, __vue_is_functional_template__$1, __vue_module_identifier__$1, false, undefined, undefined, undefined);
713
+
714
+ setInstaller(__vue_component__$1);
715
+
716
+ exports.default = __vue_component__$1;
548
717
 
549
718
  Object.defineProperty(exports, '__esModule', { value: true });
550
719
 
package/lib/card.js CHANGED
@@ -739,6 +739,7 @@
739
739
  }
740
740
  },
741
741
  handleNumberDelete: function handleNumberDelete(event) {
742
+ this.curValue === '' && (this.curValue = this.max);
742
743
  var curNumberValue = Number(this.curValue);
743
744
  if (curNumberValue - 1 >= this.min) {
744
745
  var curLenAfterDot = (String(curNumberValue) || '').split('.')[1] || '';
@@ -753,6 +754,7 @@
753
754
  }
754
755
  },
755
756
  handleNumberAdd: function handleNumberAdd(event) {
757
+ this.curValue === '' && (this.curValue = this.min);
756
758
  var curNumberValue = Number(this.curValue);
757
759
  if (curNumberValue <= this.max - 1) {
758
760
  var curLenAfterDot = (String(curNumberValue) || '').split('.')[1] || '';
package/lib/cascade.js CHANGED
@@ -5858,6 +5858,9 @@
5858
5858
  },
5859
5859
  watch: {
5860
5860
  showCascade: function showCascade(val) {
5861
+ if (!val) {
5862
+ this.dispatch('bk-form-item', 'form-blur');
5863
+ }
5861
5864
  this.$emit('toggle', val);
5862
5865
  this.filterableStatus = this.searchContent !== '';
5863
5866
  if (val) {
@@ -6096,6 +6099,7 @@
6096
6099
  var selectedList = this.multiple ? this.multipleSelectedList : this.selectedList;
6097
6100
  this.$emit('input', newId);
6098
6101
  this.$emit('change', newId, oldId, JSON.parse(stringify$1(selectedList)));
6102
+ this.dispatch('bk-form-item', 'form-change');
6099
6103
  }
6100
6104
  },
6101
6105
  exposeMultiple: function exposeMultiple(oldId) {
@@ -6291,6 +6295,9 @@
6291
6295
  }
6292
6296
  },
6293
6297
  removeTag: function removeTag(item, index) {
6298
+ if (this.disabled) {
6299
+ return;
6300
+ }
6294
6301
  var oldId = JSON.parse(stringify$1(this.multipleCurrentList));
6295
6302
  this.multipleCurrentList = this.multipleCurrentList.filter(function (itemInfo) {
6296
6303
  return itemInfo.join(',') !== item.id.join(',');