bk-magic-vue 2.4.0 → 2.4.1

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 (84) hide show
  1. package/dist/bk-magic-vue.css +113 -24
  2. package/dist/bk-magic-vue.js +1091 -839
  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/alert.js +472 -472
  10. package/lib/back-top.js +1 -1
  11. package/lib/big-tree.js +3 -3
  12. package/lib/breadcrumb-item.js +426 -426
  13. package/lib/breadcrumb.js +438 -438
  14. package/lib/button.js +509 -509
  15. package/lib/cascade.js +36 -2
  16. package/lib/checkbox-group.js +16 -9
  17. package/lib/checkbox.js +9 -1
  18. package/lib/container.js +454 -454
  19. package/lib/date-picker.js +5 -8
  20. package/lib/dialog.js +8 -9
  21. package/lib/directives/clickoutside.js +61 -61
  22. package/lib/directives/copy.js +51 -51
  23. package/lib/divider.js +446 -446
  24. package/lib/dropdown-menu.js +1747 -1747
  25. package/lib/form-item.js +1 -1
  26. package/lib/image-viewer.js +67 -2
  27. package/lib/image.js +73 -3
  28. package/lib/info-box.js +8 -9
  29. package/lib/link.js +430 -430
  30. package/lib/locale/lang/en-US.js +153 -143
  31. package/lib/locale/lang/zh-CN.js +151 -143
  32. package/lib/message.js +1 -1
  33. package/lib/mixins/emitter.js +18 -18
  34. package/lib/navigation-menu-group.js +412 -412
  35. package/lib/navigation-menu-item.js +722 -722
  36. package/lib/navigation.js +668 -668
  37. package/lib/notify.js +1 -1
  38. package/lib/option-group.js +9 -1
  39. package/lib/option.js +1 -1
  40. package/lib/pagination.js +13 -13
  41. package/lib/process.js +233 -51
  42. package/lib/progress.js +499 -499
  43. package/lib/radio-button.js +541 -541
  44. package/lib/radio.js +555 -555
  45. package/lib/rate.js +607 -607
  46. package/lib/round-progress.js +502 -502
  47. package/lib/search-select.js +5 -5
  48. package/lib/select.js +6 -6
  49. package/lib/sideslider.js +1 -1
  50. package/lib/slider.js +5 -5
  51. package/lib/spin.js +500 -500
  52. package/lib/star.js +496 -496
  53. package/lib/steps.js +3 -3
  54. package/lib/switcher.js +538 -538
  55. package/lib/tab-panel.js +456 -456
  56. package/lib/table-setting-content.js +35 -20
  57. package/lib/table.js +764 -575
  58. package/lib/tag.js +459 -459
  59. package/lib/time-picker.js +2 -2
  60. package/lib/transfer.js +6 -6
  61. package/lib/ui/bk-magic-vue.css +113 -24
  62. package/lib/ui/bk-magic-vue.min.css +1 -1
  63. package/lib/ui/bk-magic-vue.min.css.gz +0 -0
  64. package/lib/ui/bk-magic-vue.min.css.map +1 -1
  65. package/lib/ui/image-viewer.css +38 -17
  66. package/lib/ui/image-viewer.min.css +1 -1
  67. package/lib/ui/image-viewer.min.css.map +1 -1
  68. package/lib/ui/process.css +76 -0
  69. package/lib/ui/process.min.css +1 -1
  70. package/lib/ui/process.min.css.map +1 -1
  71. package/lib/ui/slider.css +4 -2
  72. package/lib/ui/slider.min.css +1 -1
  73. package/lib/ui/slider.min.css.map +1 -1
  74. package/lib/ui/spin.css +5 -1
  75. package/lib/ui/spin.min.css +1 -1
  76. package/lib/ui/spin.min.css.map +1 -1
  77. package/lib/ui/table.css +16 -5
  78. package/lib/ui/table.min.css +1 -1
  79. package/lib/ui/table.min.css.map +1 -1
  80. package/lib/upload.js +2 -2
  81. package/lib/version-detail.js +9 -10
  82. package/lib/virtual-scroll.js +805 -805
  83. package/lib/zoom-image.js +502 -502
  84. package/package.json +1 -1
@@ -1,856 +1,856 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
- typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
- (global = global || self, factory(global.library = {}));
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
+ typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
+ (global = global || self, factory(global.library = {}));
5
5
  }(this, function (exports) { 'use strict';
6
6
 
7
- var script = {
8
- name: 'bk-virtual-scroll',
9
- props: {
10
- itemHeight: {
11
- type: Number,
12
- default: 16
13
- },
14
- showIndex: {
15
- type: Boolean,
16
- default: false
17
- },
18
- list: {
19
- type: Array,
20
- default: function _default() {
21
- return [];
22
- }
7
+ var script = {
8
+ name: 'bk-virtual-scroll',
9
+ props: {
10
+ itemHeight: {
11
+ type: Number,
12
+ default: 16
13
+ },
14
+ showIndex: {
15
+ type: Boolean,
16
+ default: false
17
+ },
18
+ list: {
19
+ type: Array,
20
+ default: function _default() {
21
+ return [];
22
+ }
23
+ },
24
+ extCls: {
25
+ type: String,
26
+ default: ''
27
+ }
28
+ },
29
+ data: function data() {
30
+ return {
31
+ ulHeight: 0,
32
+ allListData: [],
33
+ offscreenCanvas: '',
34
+ indexList: [],
35
+ listData: [],
36
+ worker: {},
37
+ mainWidth: 0,
38
+ mainLeft: 0,
39
+ totalHeight: 0,
40
+ itemNumber: 0,
41
+ totalNumber: 0,
42
+ visHeight: 0,
43
+ visWidth: 0,
44
+ totalScrollHeight: 0,
45
+ startMinMapMove: false,
46
+ tempVal: 0,
47
+ minMapTop: 0,
48
+ minNavTop: 0,
49
+ navHeight: 0,
50
+ mapHeight: 0,
51
+ moveRate: 0,
52
+ bottomScrollWidth: Infinity,
53
+ bottomScrollDis: 0,
54
+ itemWidth: 0,
55
+ isScrolling: false,
56
+ isBottomMove: false,
57
+ downPreDefault: false,
58
+ upPreDefault: false,
59
+ indexWidth: 0,
60
+ observer: {}
61
+ };
62
+ },
63
+ watch: {
64
+ list: {
65
+ handler: function handler(list) {
66
+ this.setListData(list);
23
67
  },
24
- extCls: {
25
- type: String,
26
- default: ''
68
+ deep: true
69
+ }
70
+ },
71
+ mounted: function mounted() {
72
+ this.initStatus();
73
+ this.initEvent();
74
+ if (this.list.length > 0) this.setListData(this.list);
75
+ },
76
+ beforeDestroy: function beforeDestroy() {
77
+ document.removeEventListener('mousemove', this.minNavMove);
78
+ document.removeEventListener('mouseup', this.moveEnd);
79
+ window.removeEventListener('resize', this.resize);
80
+ if (MutationObserver) this.observer.disconnect();
81
+ this.observer = {};
82
+ },
83
+ methods: {
84
+ initStatus: function initStatus() {
85
+ var mainEle = this.$refs.scrollHome;
86
+ var scrollEle = this.$refs.scrollMain;
87
+ this.visHeight = mainEle.offsetHeight || 300;
88
+ this.visWidth = mainEle.offsetWidth || 300;
89
+ var scrollWidth = scrollEle.scrollWidth || 0;
90
+ this.itemWidth = scrollWidth;
91
+ this.bottomScrollWidth = this.visWidth * this.visWidth / scrollWidth < 20 ? 20 : this.visWidth * this.visWidth / scrollWidth;
92
+ var dpr = window.devicePixelRatio || 1;
93
+ this.$refs.minNav.width = 8 * dpr;
94
+ this.$refs.minNav.height = this.visHeight * dpr;
95
+ this.$refs.minNav.getContext('2d').setTransform(dpr, 0, 0, dpr, 0, 0);
96
+ },
97
+ initEvent: function initEvent() {
98
+ document.addEventListener('mousemove', this.minNavMove);
99
+ document.addEventListener('mouseup', this.moveEnd);
100
+ window.addEventListener('resize', this.resize);
101
+ if (MutationObserver) {
102
+ this.observer = new MutationObserver(this.resize);
103
+ this.observer.observe(this.$el, {
104
+ attributes: true,
105
+ attributeFilter: ['style']
106
+ });
27
107
  }
28
108
  },
29
- data: function data() {
30
- return {
31
- ulHeight: 0,
32
- allListData: [],
33
- offscreenCanvas: '',
34
- indexList: [],
35
- listData: [],
36
- worker: {},
37
- mainWidth: 0,
38
- mainLeft: 0,
39
- totalHeight: 0,
40
- itemNumber: 0,
41
- totalNumber: 0,
42
- visHeight: 0,
43
- visWidth: 0,
44
- totalScrollHeight: 0,
45
- startMinMapMove: false,
46
- tempVal: 0,
47
- minMapTop: 0,
48
- minNavTop: 0,
49
- navHeight: 0,
50
- mapHeight: 0,
51
- moveRate: 0,
52
- bottomScrollWidth: Infinity,
53
- bottomScrollDis: 0,
54
- itemWidth: 0,
55
- isScrolling: false,
56
- isBottomMove: false,
57
- downPreDefault: false,
58
- upPreDefault: false,
59
- indexWidth: 0,
60
- observer: {}
61
- };
109
+ resize: function resize(event) {
110
+ var _this = this;
111
+ this.slowExec(function () {
112
+ var lastHeight = _this.visHeight;
113
+ _this.initStatus();
114
+ _this.setStatus();
115
+ _this.minMapTop = _this.visHeight / lastHeight * _this.minMapTop;
116
+ _this.minNavTop = _this.minMapTop * (_this.visHeight - _this.navHeight) / (_this.mapHeight - _this.visHeight / 8);
117
+ _this.totalScrollHeight = _this.mapHeight === _this.canvasHeight / 8 ? 0 : _this.minMapTop / (_this.mapHeight - _this.visHeight / 8) * (_this.totalHeight - _this.visHeight);
118
+ _this.getListData(_this.totalScrollHeight, true);
119
+ });
120
+ },
121
+ handleWheel: function handleWheel(event) {
122
+ var isVerticalScroll = event.wheelDeltaX !== undefined ? Math.abs(event.wheelDeltaY) > Math.abs(event.wheelDeltaX) : event.axis === 2;
123
+ if (isVerticalScroll) this.handleVerticalScroll(event);else this.handleHorizontalScroll(event);
62
124
  },
63
- watch: {
64
- list: {
65
- handler: function handler(list) {
66
- this.setListData(list);
67
- },
68
- deep: true
125
+ handleHorizontalScroll: function handleHorizontalScroll(event) {
126
+ event.preventDefault();
127
+ if (this.bottomScrollWidth >= this.mainWidth) return;
128
+ var deltaX = -Math.max(-1, Math.min(1, event.wheelDeltaX || -event.detail));
129
+ var bottomScrollLeft = this.bottomScrollDis + deltaX * 4;
130
+ if (bottomScrollLeft <= 0) bottomScrollLeft = 0;
131
+ if (bottomScrollLeft + this.bottomScrollWidth >= this.mainWidth) bottomScrollLeft = this.mainWidth - this.bottomScrollWidth;
132
+ this.bottomScrollDis = bottomScrollLeft;
133
+ this.$emit('horizontal-scroll', this.indexWidth + bottomScrollLeft);
134
+ },
135
+ handleVerticalScroll: function handleVerticalScroll(event) {
136
+ var deltaY = Math.max(-1, Math.min(1, event.wheelDeltaY || -event.detail));
137
+ var shouldPreDefault = deltaY < 0 ? this.downPreDefault : this.upPreDefault;
138
+ if (shouldPreDefault) event.preventDefault();
139
+ if (this.isScrolling || this.itemHeight * this.totalNumber <= this.visHeight) return;
140
+ var dis = 0;
141
+ if (event.wheelDelta) dis = -1 / 5 * event.wheelDelta;
142
+ if (event.detail) dis = event.detail;
143
+ var tickGap = deltaY * -2;
144
+ if (deltaY === 0) {
145
+ dis = 0;
146
+ tickGap = 0;
147
+ }
148
+ var scrollHeight = this.minMapTop + (dis + tickGap) * (this.mapHeight - this.visHeight / 8) / (this.totalHeight - this.itemHeight * this.itemNumber);
149
+ var totalScrollHeight = 0;
150
+ var minMapTop = 0;
151
+ var minNavTop = 0;
152
+ if (scrollHeight < 0) {
153
+ totalScrollHeight = 0;
154
+ minMapTop = 0;
155
+ minNavTop = 0;
156
+ } else if (scrollHeight >= 0 && scrollHeight <= this.mapHeight - this.visHeight / 8) {
157
+ minMapTop = scrollHeight;
158
+ minNavTop = this.minNavTop + (dis + tickGap) * (this.visHeight - this.navHeight) / (this.totalHeight - this.itemHeight * this.itemNumber);
159
+ totalScrollHeight = scrollHeight * (this.totalHeight - this.itemHeight * this.itemNumber) / (this.mapHeight - this.visHeight / 8);
160
+ } else {
161
+ totalScrollHeight = this.totalHeight - this.visHeight;
162
+ minMapTop = this.mapHeight - this.visHeight / 8;
163
+ minNavTop = this.visHeight - this.navHeight;
69
164
  }
165
+ this.minMapTop = minMapTop;
166
+ this.minNavTop = minNavTop;
167
+ this.isScrolling = true;
168
+ this.getListData(totalScrollHeight);
70
169
  },
71
- mounted: function mounted() {
72
- this.initStatus();
73
- this.initEvent();
74
- if (this.list.length > 0) this.setListData(this.list);
170
+ scrollPageByIndex: function scrollPageByIndex(index) {
171
+ var height = this.itemHeight * index;
172
+ if (height <= 0) height = 0;else if (height >= this.totalHeight - this.visHeight) height = this.totalHeight - this.visHeight;
173
+ if (this.totalHeight <= this.visHeight) height = 0;
174
+ var heightDiff = this.totalHeight - this.visHeight || 1;
175
+ this.minMapTop = height / heightDiff * (this.mapHeight - this.visHeight / 8);
176
+ this.minNavTop = height / heightDiff * (this.visHeight - this.navHeight);
177
+ this.getListData(height);
75
178
  },
76
- beforeDestroy: function beforeDestroy() {
77
- document.removeEventListener('mousemove', this.minNavMove);
78
- document.removeEventListener('mouseup', this.moveEnd);
79
- window.removeEventListener('resize', this.resize);
80
- if (MutationObserver) this.observer.disconnect();
81
- this.observer = {};
179
+ getListData: function getListData() {
180
+ var totalScrollHeight = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
181
+ var isResize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
182
+ var postData = {
183
+ type: 'wheelGetData',
184
+ totalScrollHeight: totalScrollHeight,
185
+ isResize: isResize,
186
+ totalHeight: this.totalHeight,
187
+ itemHeight: this.itemHeight,
188
+ itemNumber: this.itemNumber,
189
+ canvasHeight: this.visHeight,
190
+ minMapTop: this.minMapTop,
191
+ mapHeight: this.mapHeight
192
+ };
193
+ this.calcList(postData);
82
194
  },
83
- methods: {
84
- initStatus: function initStatus() {
85
- var mainEle = this.$refs.scrollHome;
86
- var scrollEle = this.$refs.scrollMain;
87
- this.visHeight = mainEle.offsetHeight || 300;
88
- this.visWidth = mainEle.offsetWidth || 300;
89
- var scrollWidth = scrollEle.scrollWidth || 0;
90
- this.itemWidth = scrollWidth;
91
- this.bottomScrollWidth = this.visWidth * this.visWidth / scrollWidth < 20 ? 20 : this.visWidth * this.visWidth / scrollWidth;
92
- var dpr = window.devicePixelRatio || 1;
93
- this.$refs.minNav.width = 8 * dpr;
94
- this.$refs.minNav.height = this.visHeight * dpr;
95
- this.$refs.minNav.getContext('2d').setTransform(dpr, 0, 0, dpr, 0, 0);
96
- },
97
- initEvent: function initEvent() {
98
- document.addEventListener('mousemove', this.minNavMove);
99
- document.addEventListener('mouseup', this.moveEnd);
100
- window.addEventListener('resize', this.resize);
101
- if (MutationObserver) {
102
- this.observer = new MutationObserver(this.resize);
103
- this.observer.observe(this.$el, {
104
- attributes: true,
105
- attributeFilter: ['style']
195
+ calcList: function calcList(_ref) {
196
+ var totalScrollHeight = _ref.totalScrollHeight,
197
+ itemHeight = _ref.itemHeight,
198
+ itemNumber = _ref.itemNumber,
199
+ canvasHeight = _ref.canvasHeight,
200
+ minMapTop = _ref.minMapTop,
201
+ totalHeight = _ref.totalHeight,
202
+ mapHeight = _ref.mapHeight,
203
+ isResize = _ref.isResize;
204
+ var realHeight = mapHeight === canvasHeight / 8 ? 0 : minMapTop / (mapHeight - canvasHeight / 8) * (totalHeight - canvasHeight);
205
+ var startIndex = Math.floor(realHeight / itemHeight);
206
+ var endIndex = startIndex + itemNumber;
207
+ startIndex = startIndex > 0 ? startIndex - 1 : 0;
208
+ var listData = [];
209
+ var indexList = [];
210
+ var nums = Math.floor(startIndex * itemHeight / 500000);
211
+ for (var i = startIndex; i <= endIndex; i++) {
212
+ var top = i * itemHeight - nums * 500000;
213
+ var value = this.allListData[i];
214
+ if (value) {
215
+ indexList.push({
216
+ top: top,
217
+ value: i + 1
218
+ });
219
+ listData.push({
220
+ top: top,
221
+ value: value
106
222
  });
107
223
  }
108
- },
109
- resize: function resize(event) {
110
- var _this = this;
111
- this.slowExec(function () {
112
- var lastHeight = _this.visHeight;
113
- _this.initStatus();
114
- _this.setStatus();
115
- _this.minMapTop = _this.visHeight / lastHeight * _this.minMapTop;
116
- _this.minNavTop = _this.minMapTop * (_this.visHeight - _this.navHeight) / (_this.mapHeight - _this.visHeight / 8);
117
- _this.totalScrollHeight = _this.mapHeight === _this.canvasHeight / 8 ? 0 : _this.minMapTop / (_this.mapHeight - _this.visHeight / 8) * (_this.totalHeight - _this.visHeight);
118
- _this.getListData(_this.totalScrollHeight, true);
119
- });
120
- },
121
- handleWheel: function handleWheel(event) {
122
- var isVerticalScroll = event.wheelDeltaX !== undefined ? Math.abs(event.wheelDeltaY) > Math.abs(event.wheelDeltaX) : event.axis === 2;
123
- if (isVerticalScroll) this.handleVerticalScroll(event);else this.handleHorizontalScroll(event);
124
- },
125
- handleHorizontalScroll: function handleHorizontalScroll(event) {
126
- event.preventDefault();
127
- if (this.bottomScrollWidth >= this.mainWidth) return;
128
- var deltaX = -Math.max(-1, Math.min(1, event.wheelDeltaX || -event.detail));
129
- var bottomScrollLeft = this.bottomScrollDis + deltaX * 4;
224
+ }
225
+ totalScrollHeight = totalScrollHeight - nums * 500000;
226
+ this.indexList = indexList;
227
+ this.listData = listData;
228
+ this.totalScrollHeight = totalScrollHeight;
229
+ var firstIndexObj = this.indexList[0] || {};
230
+ var lastIndexObj = this.indexList[this.indexList.length - 1] || {};
231
+ this.downPreDefault = lastIndexObj.value + 1 < this.totalNumber;
232
+ this.upPreDefault = firstIndexObj.value > 1;
233
+ this.isScrolling = false;
234
+ this.$emit('change', listData.map(function (x) {
235
+ return x.value;
236
+ }));
237
+ },
238
+ addListData: function addListData(list) {
239
+ this.allListData = this.allListData.concat(list);
240
+ var number = this.totalNumber + list.length;
241
+ var lastIndexData = this.indexList[this.indexList.length - 1] || {
242
+ value: 0
243
+ };
244
+ if (this.totalNumber - lastIndexData.value <= 3) {
245
+ this.freshDataScrollBottom(number);
246
+ } else {
247
+ this.freshDataNoScroll(number);
248
+ }
249
+ this.resize();
250
+ },
251
+ setListData: function setListData(list) {
252
+ this.allListData = list;
253
+ this.freshDataNoScroll(list.length);
254
+ this.resize();
255
+ },
256
+ freshDataScrollBottom: function freshDataScrollBottom(number) {
257
+ this.totalNumber = number;
258
+ this.indexWidth = this.showIndex ? (Math.log10(this.totalNumber) + 1) * 7 : 0;
259
+ this.setStatus();
260
+ this.scrollPageByIndex(this.totalNumber - this.itemNumber + 1);
261
+ },
262
+ freshDataNoScroll: function freshDataNoScroll(number) {
263
+ var oldNumber = this.totalNumber;
264
+ var oldItemNumber = this.itemNumber;
265
+ var oldMapHeight = this.mapHeight;
266
+ var oldVisHeight = this.visHeight;
267
+ this.totalNumber = number;
268
+ this.indexWidth = this.showIndex ? (Math.log10(this.totalNumber) + 1) * 7 : 0;
269
+ this.setStatus();
270
+ this.getNumberChangeList({
271
+ oldNumber: oldNumber,
272
+ oldItemNumber: oldItemNumber,
273
+ oldMapHeight: oldMapHeight,
274
+ oldVisHeight: oldVisHeight
275
+ });
276
+ },
277
+ getNumberChangeList: function getNumberChangeList(_ref2) {
278
+ var oldNumber = _ref2.oldNumber,
279
+ oldItemNumber = _ref2.oldItemNumber,
280
+ oldMapHeight = _ref2.oldMapHeight,
281
+ oldVisHeight = _ref2.oldVisHeight;
282
+ var minMapTop = this.minMapTop * (oldNumber - oldItemNumber) / (this.totalNumber - this.itemNumber || 1) * ((this.mapHeight - this.visHeight / 8) / (oldMapHeight - oldVisHeight / 8 || 1));
283
+ var totalScrollHeight = minMapTop / (this.mapHeight - this.visHeight / 8 || 1) * (this.totalHeight - this.visHeight);
284
+ if (minMapTop <= 0 || this.navHeight >= this.visHeight) {
285
+ minMapTop = 0;
286
+ totalScrollHeight = 0;
287
+ } else if (minMapTop > this.mapHeight - this.visHeight / 8) {
288
+ minMapTop = this.mapHeight - this.visHeight / 8;
289
+ totalScrollHeight = this.totalHeight - this.visHeight;
290
+ }
291
+ this.minMapTop = minMapTop;
292
+ this.minNavTop = this.minMapTop / (this.mapHeight - this.visHeight / 8 || 1) * (this.visHeight - this.navHeight);
293
+ this.getListData(totalScrollHeight);
294
+ },
295
+ setStatus: function setStatus() {
296
+ this.totalHeight = this.totalNumber * this.itemHeight;
297
+ this.itemNumber = this.totalHeight > this.visHeight ? Math.ceil(this.visHeight / this.itemHeight) : this.totalNumber;
298
+ this.ulHeight = this.totalHeight > 400000 ? 1000000 : this.totalHeight;
299
+ var heightRate = this.visHeight / this.totalHeight;
300
+ var minNavHeight = heightRate * this.visHeight;
301
+ this.navHeight = heightRate > 1 ? this.visHeight : minNavHeight < 20 ? 20 : minNavHeight;
302
+ var moveMaxHeight = this.totalNumber * this.itemHeight / 8;
303
+ this.mapHeight = moveMaxHeight < this.visHeight ? moveMaxHeight : this.visHeight;
304
+ this.mainWidth = this.visWidth;
305
+ if (this.$refs.scrollNav) this.mainWidth -= this.$refs.scrollNav.offsetWidth;
306
+ if (this.showIndex) {
307
+ this.mainWidth -= (Math.log10(this.totalNumber) + 1) * 7;
308
+ this.mainLeft = (Math.log10(this.totalNumber) + 1) * 7;
309
+ }
310
+ },
311
+ startBottomMove: function startBottomMove(event) {
312
+ this.tempVal = event.screenX;
313
+ this.startMinMapMove = true;
314
+ this.isBottomMove = true;
315
+ },
316
+ startNavMove: function startNavMove(rate) {
317
+ this.moveRate = rate;
318
+ this.tempVal = event.screenY;
319
+ this.startMinMapMove = true;
320
+ this.$emit('virtual-scroll-scroll-bar-mouse', 'down');
321
+ document.addEventListener('click', this.docClickHandler);
322
+ },
323
+ docClickHandler: function docClickHandler() {
324
+ var _this2 = this;
325
+ document.removeEventListener('click', this.docClickHandler);
326
+ setTimeout(function () {
327
+ _this2.$emit('virtual-scroll-scroll-bar-mouse', 'up');
328
+ }, 0);
329
+ },
330
+ minNavMove: function minNavMove() {
331
+ var _this3 = this;
332
+ if (!this.startMinMapMove) return;
333
+ if (this.isBottomMove) {
334
+ var moveDis = event.screenX - this.tempVal;
335
+ var bottomScrollLeft = this.bottomScrollDis + moveDis;
130
336
  if (bottomScrollLeft <= 0) bottomScrollLeft = 0;
131
337
  if (bottomScrollLeft + this.bottomScrollWidth >= this.mainWidth) bottomScrollLeft = this.mainWidth - this.bottomScrollWidth;
132
338
  this.bottomScrollDis = bottomScrollLeft;
339
+ this.tempVal = event.screenX;
133
340
  this.$emit('horizontal-scroll', this.indexWidth + bottomScrollLeft);
134
- },
135
- handleVerticalScroll: function handleVerticalScroll(event) {
136
- var deltaY = Math.max(-1, Math.min(1, event.wheelDeltaY || -event.detail));
137
- var shouldPreDefault = deltaY < 0 ? this.downPreDefault : this.upPreDefault;
138
- if (shouldPreDefault) event.preventDefault();
139
- if (this.isScrolling || this.itemHeight * this.totalNumber <= this.visHeight) return;
140
- var dis = 0;
141
- if (event.wheelDelta) dis = -1 / 5 * event.wheelDelta;
142
- if (event.detail) dis = event.detail;
143
- var tickGap = deltaY * -2;
144
- if (deltaY === 0) {
145
- dis = 0;
146
- tickGap = 0;
147
- }
148
- var scrollHeight = this.minMapTop + (dis + tickGap) * (this.mapHeight - this.visHeight / 8) / (this.totalHeight - this.itemHeight * this.itemNumber);
149
- var totalScrollHeight = 0;
150
- var minMapTop = 0;
151
- var minNavTop = 0;
152
- if (scrollHeight < 0) {
153
- totalScrollHeight = 0;
154
- minMapTop = 0;
155
- minNavTop = 0;
156
- } else if (scrollHeight >= 0 && scrollHeight <= this.mapHeight - this.visHeight / 8) {
157
- minMapTop = scrollHeight;
158
- minNavTop = this.minNavTop + (dis + tickGap) * (this.visHeight - this.navHeight) / (this.totalHeight - this.itemHeight * this.itemNumber);
159
- totalScrollHeight = scrollHeight * (this.totalHeight - this.itemHeight * this.itemNumber) / (this.mapHeight - this.visHeight / 8);
160
- } else {
161
- totalScrollHeight = this.totalHeight - this.visHeight;
162
- minMapTop = this.mapHeight - this.visHeight / 8;
163
- minNavTop = this.visHeight - this.navHeight;
164
- }
341
+ } else {
342
+ var _moveDis = event.screenY - this.tempVal;
343
+ var minMapTop = this.minMapTop + _moveDis / this.moveRate * (this.mapHeight - this.visHeight / 8);
344
+ if (minMapTop <= 0) minMapTop = 0;
345
+ if (minMapTop >= this.mapHeight - this.visHeight / 8) minMapTop = this.mapHeight - this.visHeight / 8;
346
+ var totalScrollHeight = minMapTop / (this.mapHeight - this.visHeight / 8) * (this.totalHeight - this.visHeight);
347
+ this.tempVal = event.screenY;
165
348
  this.minMapTop = minMapTop;
166
- this.minNavTop = minNavTop;
167
- this.isScrolling = true;
168
- this.getListData(totalScrollHeight);
169
- },
170
- scrollPageByIndex: function scrollPageByIndex(index) {
171
- var height = this.itemHeight * index;
172
- if (height <= 0) height = 0;else if (height >= this.totalHeight - this.visHeight) height = this.totalHeight - this.visHeight;
173
- if (this.totalHeight <= this.visHeight) height = 0;
174
- var heightDiff = this.totalHeight - this.visHeight || 1;
175
- this.minMapTop = height / heightDiff * (this.mapHeight - this.visHeight / 8);
176
- this.minNavTop = height / heightDiff * (this.visHeight - this.navHeight);
177
- this.getListData(height);
178
- },
179
- getListData: function getListData() {
180
- var totalScrollHeight = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
181
- var isResize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
182
- var postData = {
183
- type: 'wheelGetData',
184
- totalScrollHeight: totalScrollHeight,
185
- isResize: isResize,
186
- totalHeight: this.totalHeight,
187
- itemHeight: this.itemHeight,
188
- itemNumber: this.itemNumber,
189
- canvasHeight: this.visHeight,
190
- minMapTop: this.minMapTop,
191
- mapHeight: this.mapHeight
192
- };
193
- this.calcList(postData);
194
- },
195
- calcList: function calcList(_ref) {
196
- var totalScrollHeight = _ref.totalScrollHeight,
197
- itemHeight = _ref.itemHeight,
198
- itemNumber = _ref.itemNumber,
199
- canvasHeight = _ref.canvasHeight,
200
- minMapTop = _ref.minMapTop,
201
- totalHeight = _ref.totalHeight,
202
- mapHeight = _ref.mapHeight,
203
- isResize = _ref.isResize;
204
- var realHeight = mapHeight === canvasHeight / 8 ? 0 : minMapTop / (mapHeight - canvasHeight / 8) * (totalHeight - canvasHeight);
205
- var startIndex = Math.floor(realHeight / itemHeight);
206
- var endIndex = startIndex + itemNumber;
207
- startIndex = startIndex > 0 ? startIndex - 1 : 0;
208
- var listData = [];
209
- var indexList = [];
210
- var nums = Math.floor(startIndex * itemHeight / 500000);
211
- for (var i = startIndex; i <= endIndex; i++) {
212
- var top = i * itemHeight - nums * 500000;
213
- var value = this.allListData[i];
214
- if (value) {
215
- indexList.push({
216
- top: top,
217
- value: i + 1
218
- });
219
- listData.push({
220
- top: top,
221
- value: value
222
- });
223
- }
224
- }
225
- totalScrollHeight = totalScrollHeight - nums * 500000;
226
- this.indexList = indexList;
227
- this.listData = listData;
228
- this.totalScrollHeight = totalScrollHeight;
229
- var firstIndexObj = this.indexList[0] || {};
230
- var lastIndexObj = this.indexList[this.indexList.length - 1] || {};
231
- this.downPreDefault = lastIndexObj.value + 1 < this.totalNumber;
232
- this.upPreDefault = firstIndexObj.value > 1;
233
- this.isScrolling = false;
234
- this.$emit('change', listData.map(function (x) {
235
- return x.value;
236
- }));
237
- },
238
- addListData: function addListData(list) {
239
- this.allListData = this.allListData.concat(list);
240
- var number = this.totalNumber + list.length;
241
- var lastIndexData = this.indexList[this.indexList.length - 1] || {
242
- value: 0
243
- };
244
- if (this.totalNumber - lastIndexData.value <= 3) {
245
- this.freshDataScrollBottom(number);
246
- } else {
247
- this.freshDataNoScroll(number);
248
- }
249
- this.resize();
250
- },
251
- setListData: function setListData(list) {
252
- this.allListData = list;
253
- this.freshDataNoScroll(list.length);
254
- this.resize();
255
- },
256
- freshDataScrollBottom: function freshDataScrollBottom(number) {
257
- this.totalNumber = number;
258
- this.indexWidth = this.showIndex ? (Math.log10(this.totalNumber) + 1) * 7 : 0;
259
- this.setStatus();
260
- this.scrollPageByIndex(this.totalNumber - this.itemNumber + 1);
261
- },
262
- freshDataNoScroll: function freshDataNoScroll(number) {
263
- var oldNumber = this.totalNumber;
264
- var oldItemNumber = this.itemNumber;
265
- var oldMapHeight = this.mapHeight;
266
- var oldVisHeight = this.visHeight;
267
- this.totalNumber = number;
268
- this.indexWidth = this.showIndex ? (Math.log10(this.totalNumber) + 1) * 7 : 0;
269
- this.setStatus();
270
- this.getNumberChangeList({
271
- oldNumber: oldNumber,
272
- oldItemNumber: oldItemNumber,
273
- oldMapHeight: oldMapHeight,
274
- oldVisHeight: oldVisHeight
349
+ this.minNavTop = minMapTop * (this.visHeight - this.navHeight) / (this.mapHeight - this.visHeight / 8);
350
+ this.slowExec(function () {
351
+ _this3.getListData(totalScrollHeight);
275
352
  });
276
- },
277
- getNumberChangeList: function getNumberChangeList(_ref2) {
278
- var oldNumber = _ref2.oldNumber,
279
- oldItemNumber = _ref2.oldItemNumber,
280
- oldMapHeight = _ref2.oldMapHeight,
281
- oldVisHeight = _ref2.oldVisHeight;
282
- var minMapTop = this.minMapTop * (oldNumber - oldItemNumber) / (this.totalNumber - this.itemNumber || 1) * ((this.mapHeight - this.visHeight / 8) / (oldMapHeight - oldVisHeight / 8 || 1));
283
- var totalScrollHeight = minMapTop / (this.mapHeight - this.visHeight / 8 || 1) * (this.totalHeight - this.visHeight);
284
- if (minMapTop <= 0 || this.navHeight >= this.visHeight) {
285
- minMapTop = 0;
286
- totalScrollHeight = 0;
287
- } else if (minMapTop > this.mapHeight - this.visHeight / 8) {
288
- minMapTop = this.mapHeight - this.visHeight / 8;
289
- totalScrollHeight = this.totalHeight - this.visHeight;
290
- }
291
- this.minMapTop = minMapTop;
292
- this.minNavTop = this.minMapTop / (this.mapHeight - this.visHeight / 8 || 1) * (this.visHeight - this.navHeight);
293
- this.getListData(totalScrollHeight);
294
- },
295
- setStatus: function setStatus() {
296
- this.totalHeight = this.totalNumber * this.itemHeight;
297
- this.itemNumber = this.totalHeight > this.visHeight ? Math.ceil(this.visHeight / this.itemHeight) : this.totalNumber;
298
- this.ulHeight = this.totalHeight > 400000 ? 1000000 : this.totalHeight;
299
- var heightRate = this.visHeight / this.totalHeight;
300
- var minNavHeight = heightRate * this.visHeight;
301
- this.navHeight = heightRate > 1 ? this.visHeight : minNavHeight < 20 ? 20 : minNavHeight;
302
- var moveMaxHeight = this.totalNumber * this.itemHeight / 8;
303
- this.mapHeight = moveMaxHeight < this.visHeight ? moveMaxHeight : this.visHeight;
304
- this.mainWidth = this.visWidth;
305
- if (this.$refs.scrollNav) this.mainWidth -= this.$refs.scrollNav.offsetWidth;
306
- if (this.showIndex) {
307
- this.mainWidth -= (Math.log10(this.totalNumber) + 1) * 7;
308
- this.mainLeft = (Math.log10(this.totalNumber) + 1) * 7;
309
- }
310
- },
311
- startBottomMove: function startBottomMove(event) {
312
- this.tempVal = event.screenX;
313
- this.startMinMapMove = true;
314
- this.isBottomMove = true;
315
- },
316
- startNavMove: function startNavMove(rate) {
317
- this.moveRate = rate;
318
- this.tempVal = event.screenY;
319
- this.startMinMapMove = true;
320
- this.$emit('virtual-scroll-scroll-bar-mouse', 'down');
321
- document.addEventListener('click', this.docClickHandler);
322
- },
323
- docClickHandler: function docClickHandler() {
324
- var _this2 = this;
325
- document.removeEventListener('click', this.docClickHandler);
326
- setTimeout(function () {
327
- _this2.$emit('virtual-scroll-scroll-bar-mouse', 'up');
328
- }, 0);
329
- },
330
- minNavMove: function minNavMove() {
331
- var _this3 = this;
332
- if (!this.startMinMapMove) return;
333
- if (this.isBottomMove) {
334
- var moveDis = event.screenX - this.tempVal;
335
- var bottomScrollLeft = this.bottomScrollDis + moveDis;
336
- if (bottomScrollLeft <= 0) bottomScrollLeft = 0;
337
- if (bottomScrollLeft + this.bottomScrollWidth >= this.mainWidth) bottomScrollLeft = this.mainWidth - this.bottomScrollWidth;
338
- this.bottomScrollDis = bottomScrollLeft;
339
- this.tempVal = event.screenX;
340
- this.$emit('horizontal-scroll', this.indexWidth + bottomScrollLeft);
341
- } else {
342
- var _moveDis = event.screenY - this.tempVal;
343
- var minMapTop = this.minMapTop + _moveDis / this.moveRate * (this.mapHeight - this.visHeight / 8);
344
- if (minMapTop <= 0) minMapTop = 0;
345
- if (minMapTop >= this.mapHeight - this.visHeight / 8) minMapTop = this.mapHeight - this.visHeight / 8;
346
- var totalScrollHeight = minMapTop / (this.mapHeight - this.visHeight / 8) * (this.totalHeight - this.visHeight);
347
- this.tempVal = event.screenY;
348
- this.minMapTop = minMapTop;
349
- this.minNavTop = minMapTop * (this.visHeight - this.navHeight) / (this.mapHeight - this.visHeight / 8);
350
- this.slowExec(function () {
351
- _this3.getListData(totalScrollHeight);
352
- });
353
- }
354
- },
355
- slowExec: function slowExec(callBack) {
356
- var now = +new Date();
357
- if (now - (this.slowExec.lastTime || 0) >= 100) {
358
- this.slowExec.lastTime = now;
359
- callBack();
360
- }
361
- window.clearTimeout(this.slowExec.timeId);
362
- this.slowExec.timeId = window.setTimeout(function () {
363
- callBack();
364
- }, 50);
365
- },
366
- moveEnd: function moveEnd(event) {
367
- event.preventDefault();
368
- this.startMinMapMove = false;
369
- this.isBottomMove = false;
370
353
  }
371
- }
372
- };
373
-
374
- function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier
375
- , shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
376
- if (typeof shadowMode !== 'boolean') {
377
- createInjectorSSR = createInjector;
378
- createInjector = shadowMode;
379
- shadowMode = false;
380
- }
381
- var options = typeof script === 'function' ? script.options : script;
382
- if (template && template.render) {
383
- options.render = template.render;
384
- options.staticRenderFns = template.staticRenderFns;
385
- options._compiled = true;
386
- if (isFunctionalTemplate) {
387
- options.functional = true;
354
+ },
355
+ slowExec: function slowExec(callBack) {
356
+ var now = +new Date();
357
+ if (now - (this.slowExec.lastTime || 0) >= 100) {
358
+ this.slowExec.lastTime = now;
359
+ callBack();
388
360
  }
361
+ window.clearTimeout(this.slowExec.timeId);
362
+ this.slowExec.timeId = window.setTimeout(function () {
363
+ callBack();
364
+ }, 50);
365
+ },
366
+ moveEnd: function moveEnd(event) {
367
+ event.preventDefault();
368
+ this.startMinMapMove = false;
369
+ this.isBottomMove = false;
389
370
  }
390
- if (scopeId) {
391
- options._scopeId = scopeId;
392
- }
393
- var hook;
394
- if (moduleIdentifier) {
395
- hook = function hook(context) {
396
- context = context ||
397
- this.$vnode && this.$vnode.ssrContext ||
398
- this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;
399
- if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
400
- context = __VUE_SSR_CONTEXT__;
401
- }
402
- if (style) {
403
- style.call(this, createInjectorSSR(context));
404
- }
405
- if (context && context._registeredComponents) {
406
- context._registeredComponents.add(moduleIdentifier);
407
- }
408
- };
409
- options._ssrRegister = hook;
410
- } else if (style) {
411
- hook = shadowMode ? function () {
412
- style.call(this, createInjectorShadow(this.$root.$options.shadowRoot));
413
- } : function (context) {
414
- style.call(this, createInjector(context));
415
- };
371
+ }
372
+ };
373
+
374
+ function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier
375
+ , shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
376
+ if (typeof shadowMode !== 'boolean') {
377
+ createInjectorSSR = createInjector;
378
+ createInjector = shadowMode;
379
+ shadowMode = false;
380
+ }
381
+ var options = typeof script === 'function' ? script.options : script;
382
+ if (template && template.render) {
383
+ options.render = template.render;
384
+ options.staticRenderFns = template.staticRenderFns;
385
+ options._compiled = true;
386
+ if (isFunctionalTemplate) {
387
+ options.functional = true;
416
388
  }
417
- if (hook) {
418
- if (options.functional) {
419
- var originalRender = options.render;
420
- options.render = function renderWithStyleInjection(h, context) {
421
- hook.call(context);
422
- return originalRender(h, context);
423
- };
424
- } else {
425
- var existing = options.beforeCreate;
426
- options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
389
+ }
390
+ if (scopeId) {
391
+ options._scopeId = scopeId;
392
+ }
393
+ var hook;
394
+ if (moduleIdentifier) {
395
+ hook = function hook(context) {
396
+ context = context ||
397
+ this.$vnode && this.$vnode.ssrContext ||
398
+ this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;
399
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
400
+ context = __VUE_SSR_CONTEXT__;
427
401
  }
402
+ if (style) {
403
+ style.call(this, createInjectorSSR(context));
404
+ }
405
+ if (context && context._registeredComponents) {
406
+ context._registeredComponents.add(moduleIdentifier);
407
+ }
408
+ };
409
+ options._ssrRegister = hook;
410
+ } else if (style) {
411
+ hook = shadowMode ? function () {
412
+ style.call(this, createInjectorShadow(this.$root.$options.shadowRoot));
413
+ } : function (context) {
414
+ style.call(this, createInjector(context));
415
+ };
416
+ }
417
+ if (hook) {
418
+ if (options.functional) {
419
+ var originalRender = options.render;
420
+ options.render = function renderWithStyleInjection(h, context) {
421
+ hook.call(context);
422
+ return originalRender(h, context);
423
+ };
424
+ } else {
425
+ var existing = options.beforeCreate;
426
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
428
427
  }
429
- return script;
430
428
  }
431
- var normalizeComponent_1 = normalizeComponent;
429
+ return script;
430
+ }
431
+ var normalizeComponent_1 = normalizeComponent;
432
432
 
433
- /* script */
434
- var __vue_script__ = script;
435
- /* template */
433
+ /* script */
434
+ var __vue_script__ = script;
435
+ /* template */
436
436
 
437
- var __vue_render__ = function __vue_render__() {
438
- var _vm = this;
437
+ var __vue_render__ = function __vue_render__() {
438
+ var _vm = this;
439
439
 
440
- var _h = _vm.$createElement;
440
+ var _h = _vm.$createElement;
441
441
 
442
- var _c = _vm._self._c || _h;
442
+ var _c = _vm._self._c || _h;
443
443
 
444
- return _c('section', {
445
- ref: "scrollHome",
446
- staticClass: "bk-scroll-home",
447
- class: _vm.extCls,
448
- on: {
449
- "mousewheel": _vm.handleWheel,
450
- "DOMMouseScroll": _vm.handleWheel
451
- }
452
- }, [_c('main', {
453
- staticClass: "bk-scroll-main"
454
- }, [_vm.showIndex ? _c('ul', {
455
- staticClass: "bk-scroll-index bk-scroll",
456
- style: {
457
- height: _vm.ulHeight + "px",
458
- top: -_vm.totalScrollHeight + "px",
459
- width: _vm.indexWidth + "px"
460
- }
461
- }, _vm._l(_vm.indexList, function (item, index) {
462
- return _c('li', {
463
- key: index,
464
- staticClass: "bk-scroll-item",
465
- style: {
466
- height: _vm.itemHeight + "px",
467
- top: item.top + "px"
468
- }
469
- }, [_vm._t("index", [_vm._v("\n " + _vm._s(item.value) + "\n ")], {
470
- data: item.value
471
- })], 2);
472
- }), 0) : _vm._e(), _c('ul', {
473
- ref: "scrollMain",
474
- staticClass: "bk-scroll",
444
+ return _c('section', {
445
+ ref: "scrollHome",
446
+ staticClass: "bk-scroll-home",
447
+ class: _vm.extCls,
448
+ on: {
449
+ "mousewheel": _vm.handleWheel,
450
+ "DOMMouseScroll": _vm.handleWheel
451
+ }
452
+ }, [_c('main', {
453
+ staticClass: "bk-scroll-main"
454
+ }, [_vm.showIndex ? _c('ul', {
455
+ staticClass: "bk-scroll-index bk-scroll",
456
+ style: {
457
+ height: _vm.ulHeight + "px",
458
+ top: -_vm.totalScrollHeight + "px",
459
+ width: _vm.indexWidth + "px"
460
+ }
461
+ }, _vm._l(_vm.indexList, function (item, index) {
462
+ return _c('li', {
463
+ key: index,
464
+ staticClass: "bk-scroll-item",
475
465
  style: {
476
- height: _vm.ulHeight + "px",
477
- top: -_vm.totalScrollHeight + "px",
478
- width: _vm.mainWidth + "px",
479
- left: _vm.mainLeft + "px"
466
+ height: _vm.itemHeight + "px",
467
+ top: item.top + "px"
480
468
  }
481
- }, _vm._l(_vm.listData, function (item) {
482
- return _c('li', {
483
- key: item.top,
484
- staticClass: "bk-scroll-item",
485
- style: {
486
- height: _vm.itemHeight + "px",
487
- top: item.top + "px",
488
- left: -_vm.bottomScrollDis * (_vm.itemWidth - _vm.mainWidth) / (_vm.mainWidth - _vm.bottomScrollWidth) + "px"
489
- }
490
- }, [_vm._t("default", null, {
491
- data: item.value
492
- })], 2);
493
- }), 0)]), _c('canvas', {
494
- ref: "minNav",
495
- staticClass: "bk-min-nav",
496
- style: "height: " + _vm.visHeight + "px;"
497
- }), _vm.navHeight < _vm.visHeight ? _c('span', {
498
- ref: "scrollNav",
499
- staticClass: "bk-min-nav-slide bk-nav-show",
469
+ }, [_vm._t("index", [_vm._v("\n " + _vm._s(item.value) + "\n ")], {
470
+ data: item.value
471
+ })], 2);
472
+ }), 0) : _vm._e(), _c('ul', {
473
+ ref: "scrollMain",
474
+ staticClass: "bk-scroll",
475
+ style: {
476
+ height: _vm.ulHeight + "px",
477
+ top: -_vm.totalScrollHeight + "px",
478
+ width: _vm.mainWidth + "px",
479
+ left: _vm.mainLeft + "px"
480
+ }
481
+ }, _vm._l(_vm.listData, function (item) {
482
+ return _c('li', {
483
+ key: item.top,
484
+ staticClass: "bk-scroll-item",
500
485
  style: {
501
- height: _vm.navHeight + "px",
502
- top: _vm.minNavTop + "px"
503
- },
504
- on: {
505
- "mousedown": function mousedown($event) {
506
- _vm.startNavMove(_vm.visHeight - _vm.navHeight);
507
- }
486
+ height: _vm.itemHeight + "px",
487
+ top: item.top + "px",
488
+ left: -_vm.bottomScrollDis * (_vm.itemWidth - _vm.mainWidth) / (_vm.mainWidth - _vm.bottomScrollWidth) + "px"
508
489
  }
509
- }) : _vm._e(), _vm.bottomScrollWidth < _vm.mainWidth ? _c('span', {
510
- staticClass: "bk-min-nav-slide bk-bottom-scroll",
511
- style: {
512
- left: _vm.indexWidth + _vm.bottomScrollDis + "px",
513
- width: _vm.bottomScrollWidth + "px"
514
- },
515
- on: {
516
- "mousedown": _vm.startBottomMove
490
+ }, [_vm._t("default", null, {
491
+ data: item.value
492
+ })], 2);
493
+ }), 0)]), _c('canvas', {
494
+ ref: "minNav",
495
+ staticClass: "bk-min-nav",
496
+ style: "height: " + _vm.visHeight + "px;"
497
+ }), _vm.navHeight < _vm.visHeight ? _c('span', {
498
+ ref: "scrollNav",
499
+ staticClass: "bk-min-nav-slide bk-nav-show",
500
+ style: {
501
+ height: _vm.navHeight + "px",
502
+ top: _vm.minNavTop + "px"
503
+ },
504
+ on: {
505
+ "mousedown": function mousedown($event) {
506
+ _vm.startNavMove(_vm.visHeight - _vm.navHeight);
517
507
  }
518
- }) : _vm._e()]);
519
- };
520
-
521
- var __vue_staticRenderFns__ = [];
522
- /* style */
523
-
524
- var __vue_inject_styles__ = undefined;
525
- /* scoped */
526
-
527
- var __vue_scope_id__ = undefined;
528
- /* module identifier */
529
-
530
- var __vue_module_identifier__ = undefined;
531
- /* functional template */
532
-
533
- var __vue_is_functional_template__ = false;
534
- /* style inject */
535
-
536
- /* style inject SSR */
537
-
538
- /* style inject shadow dom */
539
-
540
- var __vue_component__ = /*#__PURE__*/normalizeComponent_1({
541
- render: __vue_render__,
542
- staticRenderFns: __vue_staticRenderFns__
543
- }, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
544
-
545
- var _defined = function (it) {
546
- if (it == undefined) throw TypeError("Can't call method on " + it);
547
- return it;
548
- };
549
-
550
- var _toObject = function (it) {
551
- return Object(_defined(it));
552
- };
553
-
554
- var hasOwnProperty = {}.hasOwnProperty;
555
- var _has = function (it, key) {
556
- return hasOwnProperty.call(it, key);
557
- };
558
-
559
- var toString = {}.toString;
560
- var _cof = function (it) {
561
- return toString.call(it).slice(8, -1);
562
- };
563
-
564
- var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
565
- return _cof(it) == 'String' ? it.split('') : Object(it);
566
- };
567
-
568
- var _toIobject = function (it) {
569
- return _iobject(_defined(it));
570
- };
571
-
572
- var ceil = Math.ceil;
573
- var floor = Math.floor;
574
- var _toInteger = function (it) {
575
- return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
576
- };
577
-
578
- var min = Math.min;
579
- var _toLength = function (it) {
580
- return it > 0 ? min(_toInteger(it), 0x1fffffffffffff) : 0;
581
- };
582
-
583
- var max = Math.max;
584
- var min$1 = Math.min;
585
- var _toAbsoluteIndex = function (index, length) {
586
- index = _toInteger(index);
587
- return index < 0 ? max(index + length, 0) : min$1(index, length);
508
+ }
509
+ }) : _vm._e(), _vm.bottomScrollWidth < _vm.mainWidth ? _c('span', {
510
+ staticClass: "bk-min-nav-slide bk-bottom-scroll",
511
+ style: {
512
+ left: _vm.indexWidth + _vm.bottomScrollDis + "px",
513
+ width: _vm.bottomScrollWidth + "px"
514
+ },
515
+ on: {
516
+ "mousedown": _vm.startBottomMove
517
+ }
518
+ }) : _vm._e()]);
519
+ };
520
+
521
+ var __vue_staticRenderFns__ = [];
522
+ /* style */
523
+
524
+ var __vue_inject_styles__ = undefined;
525
+ /* scoped */
526
+
527
+ var __vue_scope_id__ = undefined;
528
+ /* module identifier */
529
+
530
+ var __vue_module_identifier__ = undefined;
531
+ /* functional template */
532
+
533
+ var __vue_is_functional_template__ = false;
534
+ /* style inject */
535
+
536
+ /* style inject SSR */
537
+
538
+ /* style inject shadow dom */
539
+
540
+ var __vue_component__ = /*#__PURE__*/normalizeComponent_1({
541
+ render: __vue_render__,
542
+ staticRenderFns: __vue_staticRenderFns__
543
+ }, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
544
+
545
+ var _defined = function (it) {
546
+ if (it == undefined) throw TypeError("Can't call method on " + it);
547
+ return it;
548
+ };
549
+
550
+ var _toObject = function (it) {
551
+ return Object(_defined(it));
552
+ };
553
+
554
+ var hasOwnProperty = {}.hasOwnProperty;
555
+ var _has = function (it, key) {
556
+ return hasOwnProperty.call(it, key);
557
+ };
558
+
559
+ var toString = {}.toString;
560
+ var _cof = function (it) {
561
+ return toString.call(it).slice(8, -1);
562
+ };
563
+
564
+ var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
565
+ return _cof(it) == 'String' ? it.split('') : Object(it);
566
+ };
567
+
568
+ var _toIobject = function (it) {
569
+ return _iobject(_defined(it));
570
+ };
571
+
572
+ var ceil = Math.ceil;
573
+ var floor = Math.floor;
574
+ var _toInteger = function (it) {
575
+ return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
576
+ };
577
+
578
+ var min = Math.min;
579
+ var _toLength = function (it) {
580
+ return it > 0 ? min(_toInteger(it), 0x1fffffffffffff) : 0;
581
+ };
582
+
583
+ var max = Math.max;
584
+ var min$1 = Math.min;
585
+ var _toAbsoluteIndex = function (index, length) {
586
+ index = _toInteger(index);
587
+ return index < 0 ? max(index + length, 0) : min$1(index, length);
588
+ };
589
+
590
+ var _arrayIncludes = function (IS_INCLUDES) {
591
+ return function ($this, el, fromIndex) {
592
+ var O = _toIobject($this);
593
+ var length = _toLength(O.length);
594
+ var index = _toAbsoluteIndex(fromIndex, length);
595
+ var value;
596
+ if (IS_INCLUDES && el != el) while (length > index) {
597
+ value = O[index++];
598
+ if (value != value) return true;
599
+ } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
600
+ if (O[index] === el) return IS_INCLUDES || index || 0;
601
+ } return !IS_INCLUDES && -1;
588
602
  };
589
-
590
- var _arrayIncludes = function (IS_INCLUDES) {
591
- return function ($this, el, fromIndex) {
592
- var O = _toIobject($this);
593
- var length = _toLength(O.length);
594
- var index = _toAbsoluteIndex(fromIndex, length);
595
- var value;
596
- if (IS_INCLUDES && el != el) while (length > index) {
597
- value = O[index++];
598
- if (value != value) return true;
599
- } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
600
- if (O[index] === el) return IS_INCLUDES || index || 0;
601
- } return !IS_INCLUDES && -1;
603
+ };
604
+
605
+ function createCommonjsModule(fn, module) {
606
+ return module = { exports: {} }, fn(module, module.exports), module.exports;
607
+ }
608
+
609
+ var _core = createCommonjsModule(function (module) {
610
+ var core = module.exports = { version: '2.6.12' };
611
+ if (typeof __e == 'number') __e = core;
612
+ });
613
+ var _core_1 = _core.version;
614
+
615
+ var _global = createCommonjsModule(function (module) {
616
+ var global = module.exports = typeof window != 'undefined' && window.Math == Math
617
+ ? window : typeof self != 'undefined' && self.Math == Math ? self
618
+ : Function('return this')();
619
+ if (typeof __g == 'number') __g = global;
620
+ });
621
+
622
+ var _shared = createCommonjsModule(function (module) {
623
+ var SHARED = '__core-js_shared__';
624
+ var store = _global[SHARED] || (_global[SHARED] = {});
625
+ (module.exports = function (key, value) {
626
+ return store[key] || (store[key] = value !== undefined ? value : {});
627
+ })('versions', []).push({
628
+ version: _core.version,
629
+ mode: 'pure' ,
630
+ copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
631
+ });
632
+ });
633
+
634
+ var id = 0;
635
+ var px = Math.random();
636
+ var _uid = function (key) {
637
+ return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
638
+ };
639
+
640
+ var shared = _shared('keys');
641
+ var _sharedKey = function (key) {
642
+ return shared[key] || (shared[key] = _uid(key));
643
+ };
644
+
645
+ var arrayIndexOf = _arrayIncludes(false);
646
+ var IE_PROTO = _sharedKey('IE_PROTO');
647
+ var _objectKeysInternal = function (object, names) {
648
+ var O = _toIobject(object);
649
+ var i = 0;
650
+ var result = [];
651
+ var key;
652
+ for (key in O) if (key != IE_PROTO) _has(O, key) && result.push(key);
653
+ while (names.length > i) if (_has(O, key = names[i++])) {
654
+ ~arrayIndexOf(result, key) || result.push(key);
655
+ }
656
+ return result;
657
+ };
658
+
659
+ var _enumBugKeys = (
660
+ 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
661
+ ).split(',');
662
+
663
+ var _objectKeys = Object.keys || function keys(O) {
664
+ return _objectKeysInternal(O, _enumBugKeys);
665
+ };
666
+
667
+ var _aFunction = function (it) {
668
+ if (typeof it != 'function') throw TypeError(it + ' is not a function!');
669
+ return it;
670
+ };
671
+
672
+ var _ctx = function (fn, that, length) {
673
+ _aFunction(fn);
674
+ if (that === undefined) return fn;
675
+ switch (length) {
676
+ case 1: return function (a) {
677
+ return fn.call(that, a);
678
+ };
679
+ case 2: return function (a, b) {
680
+ return fn.call(that, a, b);
681
+ };
682
+ case 3: return function (a, b, c) {
683
+ return fn.call(that, a, b, c);
602
684
  };
603
- };
604
-
605
- function createCommonjsModule(fn, module) {
606
- return module = { exports: {} }, fn(module, module.exports), module.exports;
607
685
  }
608
-
609
- var _core = createCommonjsModule(function (module) {
610
- var core = module.exports = { version: '2.6.12' };
611
- if (typeof __e == 'number') __e = core;
612
- });
613
- var _core_1 = _core.version;
614
-
615
- var _global = createCommonjsModule(function (module) {
616
- var global = module.exports = typeof window != 'undefined' && window.Math == Math
617
- ? window : typeof self != 'undefined' && self.Math == Math ? self
618
- : Function('return this')();
619
- if (typeof __g == 'number') __g = global;
620
- });
621
-
622
- var _shared = createCommonjsModule(function (module) {
623
- var SHARED = '__core-js_shared__';
624
- var store = _global[SHARED] || (_global[SHARED] = {});
625
- (module.exports = function (key, value) {
626
- return store[key] || (store[key] = value !== undefined ? value : {});
627
- })('versions', []).push({
628
- version: _core.version,
629
- mode: 'pure' ,
630
- copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
631
- });
632
- });
633
-
634
- var id = 0;
635
- var px = Math.random();
636
- var _uid = function (key) {
637
- return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
638
- };
639
-
640
- var shared = _shared('keys');
641
- var _sharedKey = function (key) {
642
- return shared[key] || (shared[key] = _uid(key));
643
- };
644
-
645
- var arrayIndexOf = _arrayIncludes(false);
646
- var IE_PROTO = _sharedKey('IE_PROTO');
647
- var _objectKeysInternal = function (object, names) {
648
- var O = _toIobject(object);
649
- var i = 0;
650
- var result = [];
651
- var key;
652
- for (key in O) if (key != IE_PROTO) _has(O, key) && result.push(key);
653
- while (names.length > i) if (_has(O, key = names[i++])) {
654
- ~arrayIndexOf(result, key) || result.push(key);
655
- }
656
- return result;
686
+ return function () {
687
+ return fn.apply(that, arguments);
657
688
  };
658
-
659
- var _enumBugKeys = (
660
- 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
661
- ).split(',');
662
-
663
- var _objectKeys = Object.keys || function keys(O) {
664
- return _objectKeysInternal(O, _enumBugKeys);
665
- };
666
-
667
- var _aFunction = function (it) {
668
- if (typeof it != 'function') throw TypeError(it + ' is not a function!');
669
- return it;
689
+ };
690
+
691
+ var _isObject = function (it) {
692
+ return typeof it === 'object' ? it !== null : typeof it === 'function';
693
+ };
694
+
695
+ var _anObject = function (it) {
696
+ if (!_isObject(it)) throw TypeError(it + ' is not an object!');
697
+ return it;
698
+ };
699
+
700
+ var _fails = function (exec) {
701
+ try {
702
+ return !!exec();
703
+ } catch (e) {
704
+ return true;
705
+ }
706
+ };
707
+
708
+ var _descriptors = !_fails(function () {
709
+ return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
710
+ });
711
+
712
+ var document$1 = _global.document;
713
+ var is = _isObject(document$1) && _isObject(document$1.createElement);
714
+ var _domCreate = function (it) {
715
+ return is ? document$1.createElement(it) : {};
716
+ };
717
+
718
+ var _ie8DomDefine = !_descriptors && !_fails(function () {
719
+ return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7;
720
+ });
721
+
722
+ var _toPrimitive = function (it, S) {
723
+ if (!_isObject(it)) return it;
724
+ var fn, val;
725
+ if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
726
+ if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) return val;
727
+ if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
728
+ throw TypeError("Can't convert object to primitive value");
729
+ };
730
+
731
+ var dP = Object.defineProperty;
732
+ var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) {
733
+ _anObject(O);
734
+ P = _toPrimitive(P, true);
735
+ _anObject(Attributes);
736
+ if (_ie8DomDefine) try {
737
+ return dP(O, P, Attributes);
738
+ } catch (e) { }
739
+ if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
740
+ if ('value' in Attributes) O[P] = Attributes.value;
741
+ return O;
742
+ };
743
+ var _objectDp = {
744
+ f: f
745
+ };
746
+
747
+ var _propertyDesc = function (bitmap, value) {
748
+ return {
749
+ enumerable: !(bitmap & 1),
750
+ configurable: !(bitmap & 2),
751
+ writable: !(bitmap & 4),
752
+ value: value
670
753
  };
671
-
672
- var _ctx = function (fn, that, length) {
673
- _aFunction(fn);
674
- if (that === undefined) return fn;
675
- switch (length) {
676
- case 1: return function (a) {
677
- return fn.call(that, a);
754
+ };
755
+
756
+ var _hide = _descriptors ? function (object, key, value) {
757
+ return _objectDp.f(object, key, _propertyDesc(1, value));
758
+ } : function (object, key, value) {
759
+ object[key] = value;
760
+ return object;
761
+ };
762
+
763
+ var PROTOTYPE = 'prototype';
764
+ var $export = function (type, name, source) {
765
+ var IS_FORCED = type & $export.F;
766
+ var IS_GLOBAL = type & $export.G;
767
+ var IS_STATIC = type & $export.S;
768
+ var IS_PROTO = type & $export.P;
769
+ var IS_BIND = type & $export.B;
770
+ var IS_WRAP = type & $export.W;
771
+ var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {});
772
+ var expProto = exports[PROTOTYPE];
773
+ var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] : (_global[name] || {})[PROTOTYPE];
774
+ var key, own, out;
775
+ if (IS_GLOBAL) source = name;
776
+ for (key in source) {
777
+ own = !IS_FORCED && target && target[key] !== undefined;
778
+ if (own && _has(exports, key)) continue;
779
+ out = own ? target[key] : source[key];
780
+ exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
781
+ : IS_BIND && own ? _ctx(out, _global)
782
+ : IS_WRAP && target[key] == out ? (function (C) {
783
+ var F = function (a, b, c) {
784
+ if (this instanceof C) {
785
+ switch (arguments.length) {
786
+ case 0: return new C();
787
+ case 1: return new C(a);
788
+ case 2: return new C(a, b);
789
+ } return new C(a, b, c);
790
+ } return C.apply(this, arguments);
678
791
  };
679
- case 2: return function (a, b) {
680
- return fn.call(that, a, b);
681
- };
682
- case 3: return function (a, b, c) {
683
- return fn.call(that, a, b, c);
684
- };
685
- }
686
- return function () {
687
- return fn.apply(that, arguments);
688
- };
689
- };
690
-
691
- var _isObject = function (it) {
692
- return typeof it === 'object' ? it !== null : typeof it === 'function';
693
- };
694
-
695
- var _anObject = function (it) {
696
- if (!_isObject(it)) throw TypeError(it + ' is not an object!');
697
- return it;
698
- };
699
-
700
- var _fails = function (exec) {
701
- try {
702
- return !!exec();
703
- } catch (e) {
704
- return true;
792
+ F[PROTOTYPE] = C[PROTOTYPE];
793
+ return F;
794
+ })(out) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out;
795
+ if (IS_PROTO) {
796
+ (exports.virtual || (exports.virtual = {}))[key] = out;
797
+ if (type & $export.R && expProto && !expProto[key]) _hide(expProto, key, out);
705
798
  }
799
+ }
800
+ };
801
+ $export.F = 1;
802
+ $export.G = 2;
803
+ $export.S = 4;
804
+ $export.P = 8;
805
+ $export.B = 16;
806
+ $export.W = 32;
807
+ $export.U = 64;
808
+ $export.R = 128;
809
+ var _export = $export;
810
+
811
+ var _objectSap = function (KEY, exec) {
812
+ var fn = (_core.Object || {})[KEY] || Object[KEY];
813
+ var exp = {};
814
+ exp[KEY] = exec(fn);
815
+ _export(_export.S + _export.F * _fails(function () { fn(1); }), 'Object', exp);
816
+ };
817
+
818
+ _objectSap('keys', function () {
819
+ return function keys(it) {
820
+ return _objectKeys(_toObject(it));
706
821
  };
707
-
708
- var _descriptors = !_fails(function () {
709
- return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
710
- });
711
-
712
- var document$1 = _global.document;
713
- var is = _isObject(document$1) && _isObject(document$1.createElement);
714
- var _domCreate = function (it) {
715
- return is ? document$1.createElement(it) : {};
716
- };
717
-
718
- var _ie8DomDefine = !_descriptors && !_fails(function () {
719
- return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7;
720
- });
721
-
722
- var _toPrimitive = function (it, S) {
723
- if (!_isObject(it)) return it;
724
- var fn, val;
725
- if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
726
- if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) return val;
727
- if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
728
- throw TypeError("Can't convert object to primitive value");
729
- };
730
-
731
- var dP = Object.defineProperty;
732
- var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) {
733
- _anObject(O);
734
- P = _toPrimitive(P, true);
735
- _anObject(Attributes);
736
- if (_ie8DomDefine) try {
737
- return dP(O, P, Attributes);
738
- } catch (e) { }
739
- if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
740
- if ('value' in Attributes) O[P] = Attributes.value;
741
- return O;
742
- };
743
- var _objectDp = {
744
- f: f
745
- };
746
-
747
- var _propertyDesc = function (bitmap, value) {
748
- return {
749
- enumerable: !(bitmap & 1),
750
- configurable: !(bitmap & 2),
751
- writable: !(bitmap & 4),
752
- value: value
753
- };
754
- };
755
-
756
- var _hide = _descriptors ? function (object, key, value) {
757
- return _objectDp.f(object, key, _propertyDesc(1, value));
758
- } : function (object, key, value) {
759
- object[key] = value;
760
- return object;
761
- };
762
-
763
- var PROTOTYPE = 'prototype';
764
- var $export = function (type, name, source) {
765
- var IS_FORCED = type & $export.F;
766
- var IS_GLOBAL = type & $export.G;
767
- var IS_STATIC = type & $export.S;
768
- var IS_PROTO = type & $export.P;
769
- var IS_BIND = type & $export.B;
770
- var IS_WRAP = type & $export.W;
771
- var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {});
772
- var expProto = exports[PROTOTYPE];
773
- var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] : (_global[name] || {})[PROTOTYPE];
774
- var key, own, out;
775
- if (IS_GLOBAL) source = name;
776
- for (key in source) {
777
- own = !IS_FORCED && target && target[key] !== undefined;
778
- if (own && _has(exports, key)) continue;
779
- out = own ? target[key] : source[key];
780
- exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
781
- : IS_BIND && own ? _ctx(out, _global)
782
- : IS_WRAP && target[key] == out ? (function (C) {
783
- var F = function (a, b, c) {
784
- if (this instanceof C) {
785
- switch (arguments.length) {
786
- case 0: return new C();
787
- case 1: return new C(a);
788
- case 2: return new C(a, b);
789
- } return new C(a, b, c);
790
- } return C.apply(this, arguments);
791
- };
792
- F[PROTOTYPE] = C[PROTOTYPE];
793
- return F;
794
- })(out) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out;
795
- if (IS_PROTO) {
796
- (exports.virtual || (exports.virtual = {}))[key] = out;
797
- if (type & $export.R && expProto && !expProto[key]) _hide(expProto, key, out);
822
+ });
823
+
824
+ var keys = _core.Object.keys;
825
+
826
+ var keys$1 = keys;
827
+
828
+ function setInstaller (component, afterInstall) {
829
+ component.install = function (Vue) {
830
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
831
+ var props = component.props || {};
832
+ keys$1(options).forEach(function (key) {
833
+ if (props.hasOwnProperty(key)) {
834
+ if (typeof props[key] === 'function' || props[key] instanceof Array) {
835
+ props[key] = {
836
+ type: props[key],
837
+ default: options[key]
838
+ };
839
+ } else {
840
+ props[key].default = options[key];
841
+ }
798
842
  }
799
- }
800
- };
801
- $export.F = 1;
802
- $export.G = 2;
803
- $export.S = 4;
804
- $export.P = 8;
805
- $export.B = 16;
806
- $export.W = 32;
807
- $export.U = 64;
808
- $export.R = 128;
809
- var _export = $export;
810
-
811
- var _objectSap = function (KEY, exec) {
812
- var fn = (_core.Object || {})[KEY] || Object[KEY];
813
- var exp = {};
814
- exp[KEY] = exec(fn);
815
- _export(_export.S + _export.F * _fails(function () { fn(1); }), 'Object', exp);
843
+ });
844
+ component.name = options.namespace ? component.name.replace('bk', options.namespace) : component.name;
845
+ Vue.component(component.name, component);
846
+ typeof afterInstall === 'function' && afterInstall(Vue, options);
816
847
  };
848
+ }
817
849
 
818
- _objectSap('keys', function () {
819
- return function keys(it) {
820
- return _objectKeys(_toObject(it));
821
- };
822
- });
823
-
824
- var keys = _core.Object.keys;
825
-
826
- var keys$1 = keys;
827
-
828
- function setInstaller (component, afterInstall) {
829
- component.install = function (Vue) {
830
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
831
- var props = component.props || {};
832
- keys$1(options).forEach(function (key) {
833
- if (props.hasOwnProperty(key)) {
834
- if (typeof props[key] === 'function' || props[key] instanceof Array) {
835
- props[key] = {
836
- type: props[key],
837
- default: options[key]
838
- };
839
- } else {
840
- props[key].default = options[key];
841
- }
842
- }
843
- });
844
- component.name = options.namespace ? component.name.replace('bk', options.namespace) : component.name;
845
- Vue.component(component.name, component);
846
- typeof afterInstall === 'function' && afterInstall(Vue, options);
847
- };
848
- }
849
-
850
- setInstaller(__vue_component__);
850
+ setInstaller(__vue_component__);
851
851
 
852
- exports.default = __vue_component__;
852
+ exports.default = __vue_component__;
853
853
 
854
- Object.defineProperty(exports, '__esModule', { value: true });
854
+ Object.defineProperty(exports, '__esModule', { value: true });
855
855
 
856
856
  }));