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.
- package/bkui-vue2-helper/attributes.json +1 -0
- package/bkui-vue2-helper/tags.json +1 -0
- package/dist/bk-magic-vue.css +81 -10
- package/dist/bk-magic-vue.js +245 -115
- package/dist/bk-magic-vue.min.css +1 -1
- package/dist/bk-magic-vue.min.css.gz +0 -0
- package/dist/bk-magic-vue.min.css.map +1 -1
- package/dist/bk-magic-vue.min.js +1 -1
- package/dist/bk-magic-vue.min.js.gz +0 -0
- package/dist/bk-magic-vue.min.js.map +1 -1
- package/lib/button.js +1 -1
- package/lib/date-picker.js +1 -22
- package/lib/dialog.js +30 -8
- package/lib/image-viewer.js +84 -8
- package/lib/image.js +94 -13
- package/lib/info-box.js +31 -8
- package/lib/loading.js +6 -2
- package/lib/pagination.js +871 -51
- package/lib/resize-layout.js +24 -22
- package/lib/select.js +7 -3
- package/lib/spin.js +1 -1
- package/lib/tab.js +241 -210
- package/lib/table-setting-content.js +1 -1
- package/lib/table.js +782 -66
- package/lib/tag-input.js +6 -2
- package/lib/time-picker.js +1 -22
- package/lib/ui/bk-magic-vue.css +81 -10
- package/lib/ui/bk-magic-vue.min.css +1 -1
- package/lib/ui/bk-magic-vue.min.css.gz +0 -0
- package/lib/ui/bk-magic-vue.min.css.map +1 -1
- package/lib/ui/pagination.css +14 -0
- package/lib/ui/pagination.min.css +1 -1
- package/lib/ui/pagination.min.css.map +1 -1
- package/lib/ui/select.css +4 -0
- package/lib/ui/select.min.css +1 -1
- package/lib/ui/select.min.css.map +1 -1
- package/lib/ui/spin.css +38 -5
- package/lib/ui/spin.min.css +1 -1
- package/lib/ui/spin.min.css.map +1 -1
- package/lib/ui/tab.css +41 -5
- package/lib/ui/tab.min.css +1 -1
- package/lib/ui/tab.min.css.map +1 -1
- package/lib/version-detail.js +36 -10
- package/lib/zoom-image.js +372 -176
- package/package.json +2 -2
package/lib/button.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/date-picker.js
CHANGED
|
@@ -3060,23 +3060,6 @@
|
|
|
3060
3060
|
},
|
|
3061
3061
|
handleKeydown: function handleKeydown(e) {
|
|
3062
3062
|
var keyCode = e.keyCode;
|
|
3063
|
-
if (keyCode === 9) {
|
|
3064
|
-
if (this.visible) {
|
|
3065
|
-
e.stopPropagation();
|
|
3066
|
-
e.preventDefault();
|
|
3067
|
-
if (this.isConfirm) {
|
|
3068
|
-
var selector = '.bk-picker-confirm > *';
|
|
3069
|
-
var tabbable = this.$refs.drop.$el.querySelectorAll(selector);
|
|
3070
|
-
this.internalFocus = true;
|
|
3071
|
-
var element = _toConsumableArray(tabbable)[e.shiftKey ? 'pop' : 'shift']();
|
|
3072
|
-
element.focus();
|
|
3073
|
-
} else {
|
|
3074
|
-
this.handleClose();
|
|
3075
|
-
}
|
|
3076
|
-
} else {
|
|
3077
|
-
this.focused = false;
|
|
3078
|
-
}
|
|
3079
|
-
}
|
|
3080
3063
|
var arrows = [37, 38, 39, 40];
|
|
3081
3064
|
if (!this.visible && arrows.includes(keyCode)) {
|
|
3082
3065
|
this.visible = true;
|
|
@@ -3088,7 +3071,7 @@
|
|
|
3088
3071
|
this.handleClose();
|
|
3089
3072
|
}
|
|
3090
3073
|
}
|
|
3091
|
-
if (keyCode === 13 && this.timeEnterMode) {
|
|
3074
|
+
if ((keyCode === 9 || keyCode === 13) && this.timeEnterMode) {
|
|
3092
3075
|
var _timePickers = findChildComponents(this, 'TimeSpinner');
|
|
3093
3076
|
if (_timePickers.length > 0) {
|
|
3094
3077
|
var columnsPerPicker = _timePickers[0].showSeconds ? 3 : 2;
|
|
@@ -3239,10 +3222,6 @@
|
|
|
3239
3222
|
}
|
|
3240
3223
|
},
|
|
3241
3224
|
handleInputMouseleave: function handleInputMouseleave(e) {
|
|
3242
|
-
if (e.toElement && e.toElement.classList.contains('clear-action')) {
|
|
3243
|
-
return;
|
|
3244
|
-
}
|
|
3245
|
-
this.showClose = false;
|
|
3246
3225
|
},
|
|
3247
3226
|
handleClear: function handleClear(e) {
|
|
3248
3227
|
var _this3 = this;
|
package/lib/dialog.js
CHANGED
|
@@ -815,7 +815,7 @@
|
|
|
815
815
|
type: String,
|
|
816
816
|
default: 'primary',
|
|
817
817
|
validator: function validator(value) {
|
|
818
|
-
if (!['primary', 'warning', 'success', 'danger', 'info'].includes(value)) {
|
|
818
|
+
if (!['default', 'primary', 'warning', 'success', 'danger', 'info'].includes(value)) {
|
|
819
819
|
console.error("theme property is not valid: '".concat(value, "'"));
|
|
820
820
|
return false;
|
|
821
821
|
}
|
|
@@ -2260,6 +2260,10 @@
|
|
|
2260
2260
|
type: Function,
|
|
2261
2261
|
default: null
|
|
2262
2262
|
},
|
|
2263
|
+
closeFn: {
|
|
2264
|
+
type: Function,
|
|
2265
|
+
default: null
|
|
2266
|
+
},
|
|
2263
2267
|
onClose: {
|
|
2264
2268
|
type: Function,
|
|
2265
2269
|
default: function _default() {}
|
|
@@ -2606,6 +2610,7 @@
|
|
|
2606
2610
|
},
|
|
2607
2611
|
close: function close() {
|
|
2608
2612
|
var _this2 = this;
|
|
2613
|
+
var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'cancel';
|
|
2609
2614
|
return _asyncToGenerator( regenerator.mark(function _callee() {
|
|
2610
2615
|
var shouldClose;
|
|
2611
2616
|
return regenerator.wrap(function _callee$(_context) {
|
|
@@ -2622,14 +2627,28 @@
|
|
|
2622
2627
|
case 4:
|
|
2623
2628
|
shouldClose = _context.sent;
|
|
2624
2629
|
case 5:
|
|
2625
|
-
if (shouldClose) {
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
+
if (!shouldClose) {
|
|
2631
|
+
_context.next = 17;
|
|
2632
|
+
break;
|
|
2633
|
+
}
|
|
2634
|
+
_this2.visible = false;
|
|
2635
|
+
typeof _this2.onClose === 'function' && _this2.onClose();
|
|
2636
|
+
_this2.$emit('input', false);
|
|
2637
|
+
_this2.$emit('cancel');
|
|
2638
|
+
_context.t0 = type;
|
|
2639
|
+
_context.next = _context.t0 === 'cancel' ? 13 : _context.t0 === 'close' ? 15 : 17;
|
|
2640
|
+
break;
|
|
2641
|
+
case 13:
|
|
2642
|
+
typeof _this2.cancelFn === 'function' && _this2.cancelFn(_this2);
|
|
2643
|
+
return _context.abrupt("break", 17);
|
|
2644
|
+
case 15:
|
|
2645
|
+
if (_this2.closeFn) {
|
|
2646
|
+
typeof _this2.closeFn === 'function' && _this2.closeFn(_this2);
|
|
2647
|
+
} else {
|
|
2630
2648
|
typeof _this2.cancelFn === 'function' && _this2.cancelFn(_this2);
|
|
2631
2649
|
}
|
|
2632
|
-
|
|
2650
|
+
return _context.abrupt("break", 17);
|
|
2651
|
+
case 17:
|
|
2633
2652
|
case "end":
|
|
2634
2653
|
return _context.stop();
|
|
2635
2654
|
}
|
|
@@ -2641,6 +2660,9 @@
|
|
|
2641
2660
|
this.$emit('after-leave');
|
|
2642
2661
|
typeof this.afterLeaveFn === 'function' && this.afterLeaveFn(this);
|
|
2643
2662
|
},
|
|
2663
|
+
closeHandler: function closeHandler() {
|
|
2664
|
+
this.close('close');
|
|
2665
|
+
},
|
|
2644
2666
|
cancelHandler: function cancelHandler(e) {
|
|
2645
2667
|
this.close();
|
|
2646
2668
|
},
|
|
@@ -2872,7 +2894,7 @@
|
|
|
2872
2894
|
on: {
|
|
2873
2895
|
"click": function click($event) {
|
|
2874
2896
|
$event.stopPropagation();
|
|
2875
|
-
return _vm.
|
|
2897
|
+
return _vm.closeHandler($event);
|
|
2876
2898
|
}
|
|
2877
2899
|
}
|
|
2878
2900
|
}) : _vm._e()], 2)])] : [_vm.shouldRender || _vm.visible ? _c('div', {
|
package/lib/image-viewer.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('bk-magic-vue/lib/locale')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'bk-magic-vue/lib/locale'], factory) :
|
|
4
|
-
(global = global || self, factory(global.library = {}, global.locale));
|
|
5
|
-
}(this, function (exports, locale) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('bk-magic-vue/lib/locale'), require('vue')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'bk-magic-vue/lib/locale', 'vue'], factory) :
|
|
4
|
+
(global = global || self, factory(global.library = {}, global.locale, global.Vue));
|
|
5
|
+
}(this, function (exports, locale, Vue) { 'use strict';
|
|
6
6
|
|
|
7
7
|
locale = locale && locale.hasOwnProperty('default') ? locale['default'] : locale;
|
|
8
|
+
Vue = Vue && Vue.hasOwnProperty('default') ? Vue['default'] : Vue;
|
|
8
9
|
|
|
9
10
|
function createCommonjsModule(fn, module) {
|
|
10
11
|
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
@@ -320,6 +321,66 @@
|
|
|
320
321
|
}
|
|
321
322
|
};
|
|
322
323
|
|
|
324
|
+
_export(_export.S + _export.F * !_descriptors, 'Object', { defineProperty: _objectDp.f });
|
|
325
|
+
|
|
326
|
+
var $Object = _core.Object;
|
|
327
|
+
var defineProperty = function defineProperty(it, key, desc) {
|
|
328
|
+
return $Object.defineProperty(it, key, desc);
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
var defineProperty$1 = defineProperty;
|
|
332
|
+
|
|
333
|
+
var hasInitZIndex = false;
|
|
334
|
+
var zIndex;
|
|
335
|
+
(function () {
|
|
336
|
+
if (!window['__bk_zIndex_manager']) {
|
|
337
|
+
var zIndexManager = {
|
|
338
|
+
nextZIndex: function nextZIndex() {
|
|
339
|
+
var zIndex = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
|
|
340
|
+
return zIndex === 'default' ? zIndexManager.zIndex++ : zIndex;
|
|
341
|
+
},
|
|
342
|
+
nextTickIndex: function nextTickIndex() {
|
|
343
|
+
var tick = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
344
|
+
var zIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
|
|
345
|
+
if (zIndex === 'default') {
|
|
346
|
+
zIndexManager.zIndex += tick;
|
|
347
|
+
return zIndexManager.zIndex;
|
|
348
|
+
}
|
|
349
|
+
return zIndex;
|
|
350
|
+
}
|
|
351
|
+
};
|
|
352
|
+
defineProperty$1(zIndexManager, 'zIndex', {
|
|
353
|
+
configurable: true,
|
|
354
|
+
get: function get() {
|
|
355
|
+
if (!hasInitZIndex) {
|
|
356
|
+
zIndex = zIndex || (Vue.prototype.$BK_EL || {}).zIndex || 2000;
|
|
357
|
+
hasInitZIndex = true;
|
|
358
|
+
}
|
|
359
|
+
return zIndex;
|
|
360
|
+
},
|
|
361
|
+
set: function set(value) {
|
|
362
|
+
zIndex = value;
|
|
363
|
+
}
|
|
364
|
+
});
|
|
365
|
+
window['__bk_zIndex_manager'] = zIndexManager;
|
|
366
|
+
}
|
|
367
|
+
})();
|
|
368
|
+
var zIndexManager = window['__bk_zIndex_manager'];
|
|
369
|
+
|
|
370
|
+
var zIndex$1 = {
|
|
371
|
+
props: {
|
|
372
|
+
zIndex: {
|
|
373
|
+
type: [Number, String],
|
|
374
|
+
default: 'default'
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
methods: {
|
|
378
|
+
getLocalZIndex: function getLocalZIndex(zIndex) {
|
|
379
|
+
return zIndexManager.nextTickIndex(2, zIndex);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
|
|
323
384
|
function rafThrottle(fn) {
|
|
324
385
|
var locked = false;
|
|
325
386
|
return function () {
|
|
@@ -337,7 +398,7 @@
|
|
|
337
398
|
}
|
|
338
399
|
var script = {
|
|
339
400
|
name: 'bk-image-viewer',
|
|
340
|
-
mixins: [locale.mixin],
|
|
401
|
+
mixins: [locale.mixin, zIndex$1],
|
|
341
402
|
props: {
|
|
342
403
|
urlList: {
|
|
343
404
|
type: Array,
|
|
@@ -368,6 +429,10 @@
|
|
|
368
429
|
maskClose: {
|
|
369
430
|
type: Boolean,
|
|
370
431
|
default: true
|
|
432
|
+
},
|
|
433
|
+
transfer: {
|
|
434
|
+
type: Boolean,
|
|
435
|
+
default: true
|
|
371
436
|
}
|
|
372
437
|
},
|
|
373
438
|
data: function data() {
|
|
@@ -405,6 +470,11 @@
|
|
|
405
470
|
var arr = this.currentImg.split('/');
|
|
406
471
|
return arr[arr.length - 1];
|
|
407
472
|
},
|
|
473
|
+
wrapStyles: function wrapStyles() {
|
|
474
|
+
return {
|
|
475
|
+
zIndex: this.transfer ? this.getLocalZIndex() : this.zIndex
|
|
476
|
+
};
|
|
477
|
+
},
|
|
408
478
|
imgStyle: function imgStyle() {
|
|
409
479
|
var _this$transform = this.transform,
|
|
410
480
|
scale = _this$transform.scale,
|
|
@@ -443,9 +513,17 @@
|
|
|
443
513
|
}
|
|
444
514
|
},
|
|
445
515
|
mounted: function mounted() {
|
|
516
|
+
if (this.transfer) {
|
|
517
|
+
document.body.appendChild(this.$el);
|
|
518
|
+
}
|
|
446
519
|
this.deviceSupportInstall();
|
|
447
520
|
this.$refs['bk-image-viewer-wrapper'].focus();
|
|
448
521
|
},
|
|
522
|
+
destroyed: function destroyed() {
|
|
523
|
+
if (this.transfer && this.$el && this.$el.parentNode) {
|
|
524
|
+
this.$el.parentNode.removeChild(this.$el);
|
|
525
|
+
}
|
|
526
|
+
},
|
|
449
527
|
methods: {
|
|
450
528
|
hide: function hide() {
|
|
451
529
|
this.deviceSupportUninstall();
|
|
@@ -661,9 +739,7 @@
|
|
|
661
739
|
}, [_c('div', {
|
|
662
740
|
ref: "bk-image-viewer-wrapper",
|
|
663
741
|
staticClass: "bk-image-viewer-wrapper",
|
|
664
|
-
style:
|
|
665
|
-
'z-index': _vm.zIndex
|
|
666
|
-
},
|
|
742
|
+
style: _vm.wrapStyles,
|
|
667
743
|
attrs: {
|
|
668
744
|
"tabindex": "-1"
|
|
669
745
|
}
|
package/lib/image.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('bk-magic-vue/lib/locale')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'bk-magic-vue/lib/locale'], factory) :
|
|
4
|
-
(global = global || self, factory(global.library = {}, global.locale));
|
|
5
|
-
}(this, function (exports, locale) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('bk-magic-vue/lib/locale'), require('vue')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'bk-magic-vue/lib/locale', 'vue'], factory) :
|
|
4
|
+
(global = global || self, factory(global.library = {}, global.locale, global.Vue));
|
|
5
|
+
}(this, function (exports, locale, Vue) { 'use strict';
|
|
6
6
|
|
|
7
7
|
locale = locale && locale.hasOwnProperty('default') ? locale['default'] : locale;
|
|
8
|
+
Vue = Vue && Vue.hasOwnProperty('default') ? Vue['default'] : Vue;
|
|
8
9
|
|
|
9
10
|
var _defined = function (it) {
|
|
10
11
|
if (it == undefined) throw TypeError("Can't call method on " + it);
|
|
@@ -468,6 +469,66 @@
|
|
|
468
469
|
return elRect.top < containerRect.bottom && elRect.bottom > containerRect.top && elRect.right > containerRect.left && elRect.left < containerRect.right;
|
|
469
470
|
};
|
|
470
471
|
|
|
472
|
+
_export(_export.S + _export.F * !_descriptors, 'Object', { defineProperty: _objectDp.f });
|
|
473
|
+
|
|
474
|
+
var $Object = _core.Object;
|
|
475
|
+
var defineProperty = function defineProperty(it, key, desc) {
|
|
476
|
+
return $Object.defineProperty(it, key, desc);
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
var defineProperty$1 = defineProperty;
|
|
480
|
+
|
|
481
|
+
var hasInitZIndex = false;
|
|
482
|
+
var zIndex;
|
|
483
|
+
(function () {
|
|
484
|
+
if (!window['__bk_zIndex_manager']) {
|
|
485
|
+
var zIndexManager = {
|
|
486
|
+
nextZIndex: function nextZIndex() {
|
|
487
|
+
var zIndex = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
|
|
488
|
+
return zIndex === 'default' ? zIndexManager.zIndex++ : zIndex;
|
|
489
|
+
},
|
|
490
|
+
nextTickIndex: function nextTickIndex() {
|
|
491
|
+
var tick = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
492
|
+
var zIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
|
|
493
|
+
if (zIndex === 'default') {
|
|
494
|
+
zIndexManager.zIndex += tick;
|
|
495
|
+
return zIndexManager.zIndex;
|
|
496
|
+
}
|
|
497
|
+
return zIndex;
|
|
498
|
+
}
|
|
499
|
+
};
|
|
500
|
+
defineProperty$1(zIndexManager, 'zIndex', {
|
|
501
|
+
configurable: true,
|
|
502
|
+
get: function get() {
|
|
503
|
+
if (!hasInitZIndex) {
|
|
504
|
+
zIndex = zIndex || (Vue.prototype.$BK_EL || {}).zIndex || 2000;
|
|
505
|
+
hasInitZIndex = true;
|
|
506
|
+
}
|
|
507
|
+
return zIndex;
|
|
508
|
+
},
|
|
509
|
+
set: function set(value) {
|
|
510
|
+
zIndex = value;
|
|
511
|
+
}
|
|
512
|
+
});
|
|
513
|
+
window['__bk_zIndex_manager'] = zIndexManager;
|
|
514
|
+
}
|
|
515
|
+
})();
|
|
516
|
+
var zIndexManager = window['__bk_zIndex_manager'];
|
|
517
|
+
|
|
518
|
+
var zIndex$1 = {
|
|
519
|
+
props: {
|
|
520
|
+
zIndex: {
|
|
521
|
+
type: [Number, String],
|
|
522
|
+
default: 'default'
|
|
523
|
+
}
|
|
524
|
+
},
|
|
525
|
+
methods: {
|
|
526
|
+
getLocalZIndex: function getLocalZIndex(zIndex) {
|
|
527
|
+
return zIndexManager.nextTickIndex(2, zIndex);
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
};
|
|
531
|
+
|
|
471
532
|
function rafThrottle(fn) {
|
|
472
533
|
var locked = false;
|
|
473
534
|
return function () {
|
|
@@ -485,7 +546,7 @@
|
|
|
485
546
|
}
|
|
486
547
|
var script = {
|
|
487
548
|
name: 'bk-image-viewer',
|
|
488
|
-
mixins: [locale.mixin],
|
|
549
|
+
mixins: [locale.mixin, zIndex$1],
|
|
489
550
|
props: {
|
|
490
551
|
urlList: {
|
|
491
552
|
type: Array,
|
|
@@ -516,6 +577,10 @@
|
|
|
516
577
|
maskClose: {
|
|
517
578
|
type: Boolean,
|
|
518
579
|
default: true
|
|
580
|
+
},
|
|
581
|
+
transfer: {
|
|
582
|
+
type: Boolean,
|
|
583
|
+
default: true
|
|
519
584
|
}
|
|
520
585
|
},
|
|
521
586
|
data: function data() {
|
|
@@ -553,6 +618,11 @@
|
|
|
553
618
|
var arr = this.currentImg.split('/');
|
|
554
619
|
return arr[arr.length - 1];
|
|
555
620
|
},
|
|
621
|
+
wrapStyles: function wrapStyles() {
|
|
622
|
+
return {
|
|
623
|
+
zIndex: this.transfer ? this.getLocalZIndex() : this.zIndex
|
|
624
|
+
};
|
|
625
|
+
},
|
|
556
626
|
imgStyle: function imgStyle() {
|
|
557
627
|
var _this$transform = this.transform,
|
|
558
628
|
scale = _this$transform.scale,
|
|
@@ -591,9 +661,17 @@
|
|
|
591
661
|
}
|
|
592
662
|
},
|
|
593
663
|
mounted: function mounted() {
|
|
664
|
+
if (this.transfer) {
|
|
665
|
+
document.body.appendChild(this.$el);
|
|
666
|
+
}
|
|
594
667
|
this.deviceSupportInstall();
|
|
595
668
|
this.$refs['bk-image-viewer-wrapper'].focus();
|
|
596
669
|
},
|
|
670
|
+
destroyed: function destroyed() {
|
|
671
|
+
if (this.transfer && this.$el && this.$el.parentNode) {
|
|
672
|
+
this.$el.parentNode.removeChild(this.$el);
|
|
673
|
+
}
|
|
674
|
+
},
|
|
597
675
|
methods: {
|
|
598
676
|
hide: function hide() {
|
|
599
677
|
this.deviceSupportUninstall();
|
|
@@ -809,9 +887,7 @@
|
|
|
809
887
|
}, [_c('div', {
|
|
810
888
|
ref: "bk-image-viewer-wrapper",
|
|
811
889
|
staticClass: "bk-image-viewer-wrapper",
|
|
812
|
-
style:
|
|
813
|
-
'z-index': _vm.zIndex
|
|
814
|
-
},
|
|
890
|
+
style: _vm.wrapStyles,
|
|
815
891
|
attrs: {
|
|
816
892
|
"tabindex": "-1"
|
|
817
893
|
}
|
|
@@ -1127,7 +1203,6 @@
|
|
|
1127
1203
|
FILL: 'fill',
|
|
1128
1204
|
SCALE_DOWN: 'scale-down'
|
|
1129
1205
|
};
|
|
1130
|
-
var prevOverflow = '';
|
|
1131
1206
|
var script$1 = {
|
|
1132
1207
|
name: 'bk-image',
|
|
1133
1208
|
components: {
|
|
@@ -1155,11 +1230,15 @@
|
|
|
1155
1230
|
type: Boolean,
|
|
1156
1231
|
default: true
|
|
1157
1232
|
},
|
|
1233
|
+
maskClose: {
|
|
1234
|
+
type: Boolean,
|
|
1235
|
+
default: true
|
|
1236
|
+
},
|
|
1158
1237
|
zIndex: {
|
|
1159
1238
|
type: Number,
|
|
1160
1239
|
default: 2000
|
|
1161
1240
|
},
|
|
1162
|
-
|
|
1241
|
+
transfer: {
|
|
1163
1242
|
type: Boolean,
|
|
1164
1243
|
default: true
|
|
1165
1244
|
}
|
|
@@ -1171,7 +1250,8 @@
|
|
|
1171
1250
|
show: !this.lazy,
|
|
1172
1251
|
imageWidth: 0,
|
|
1173
1252
|
imageHeight: 0,
|
|
1174
|
-
showViewer: false
|
|
1253
|
+
showViewer: false,
|
|
1254
|
+
prevOverflow: ''
|
|
1175
1255
|
};
|
|
1176
1256
|
},
|
|
1177
1257
|
computed: {
|
|
@@ -1320,12 +1400,12 @@
|
|
|
1320
1400
|
if (!this.preview) {
|
|
1321
1401
|
return;
|
|
1322
1402
|
}
|
|
1323
|
-
prevOverflow = document.body.style.overflow;
|
|
1403
|
+
this.prevOverflow = document.body.style.overflow;
|
|
1324
1404
|
document.body.style.overflow = 'hidden';
|
|
1325
1405
|
this.showViewer = true;
|
|
1326
1406
|
},
|
|
1327
1407
|
closeViewer: function closeViewer() {
|
|
1328
|
-
document.body.style.overflow = prevOverflow;
|
|
1408
|
+
document.body.style.overflow = this.prevOverflow;
|
|
1329
1409
|
this.showViewer = false;
|
|
1330
1410
|
}
|
|
1331
1411
|
}
|
|
@@ -1372,6 +1452,7 @@
|
|
|
1372
1452
|
"initial-index": _vm.imageIndex,
|
|
1373
1453
|
"url-list": _vm.previewSrcList,
|
|
1374
1454
|
"on-close": _vm.closeViewer,
|
|
1455
|
+
"transfer": _vm.transfer,
|
|
1375
1456
|
"mask-close": _vm.maskClose
|
|
1376
1457
|
}
|
|
1377
1458
|
}) : _vm._e()] : _vm._e()], 2);
|
package/lib/info-box.js
CHANGED
|
@@ -937,7 +937,7 @@
|
|
|
937
937
|
type: String,
|
|
938
938
|
default: 'primary',
|
|
939
939
|
validator: function validator(value) {
|
|
940
|
-
if (!['primary', 'warning', 'success', 'danger', 'info'].includes(value)) {
|
|
940
|
+
if (!['default', 'primary', 'warning', 'success', 'danger', 'info'].includes(value)) {
|
|
941
941
|
console.error("theme property is not valid: '".concat(value, "'"));
|
|
942
942
|
return false;
|
|
943
943
|
}
|
|
@@ -2273,6 +2273,10 @@
|
|
|
2273
2273
|
type: Function,
|
|
2274
2274
|
default: null
|
|
2275
2275
|
},
|
|
2276
|
+
closeFn: {
|
|
2277
|
+
type: Function,
|
|
2278
|
+
default: null
|
|
2279
|
+
},
|
|
2276
2280
|
onClose: {
|
|
2277
2281
|
type: Function,
|
|
2278
2282
|
default: function _default() {}
|
|
@@ -2619,6 +2623,7 @@
|
|
|
2619
2623
|
},
|
|
2620
2624
|
close: function close() {
|
|
2621
2625
|
var _this2 = this;
|
|
2626
|
+
var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'cancel';
|
|
2622
2627
|
return _asyncToGenerator( regenerator.mark(function _callee() {
|
|
2623
2628
|
var shouldClose;
|
|
2624
2629
|
return regenerator.wrap(function _callee$(_context) {
|
|
@@ -2635,14 +2640,28 @@
|
|
|
2635
2640
|
case 4:
|
|
2636
2641
|
shouldClose = _context.sent;
|
|
2637
2642
|
case 5:
|
|
2638
|
-
if (shouldClose) {
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
+
if (!shouldClose) {
|
|
2644
|
+
_context.next = 17;
|
|
2645
|
+
break;
|
|
2646
|
+
}
|
|
2647
|
+
_this2.visible = false;
|
|
2648
|
+
typeof _this2.onClose === 'function' && _this2.onClose();
|
|
2649
|
+
_this2.$emit('input', false);
|
|
2650
|
+
_this2.$emit('cancel');
|
|
2651
|
+
_context.t0 = type;
|
|
2652
|
+
_context.next = _context.t0 === 'cancel' ? 13 : _context.t0 === 'close' ? 15 : 17;
|
|
2653
|
+
break;
|
|
2654
|
+
case 13:
|
|
2655
|
+
typeof _this2.cancelFn === 'function' && _this2.cancelFn(_this2);
|
|
2656
|
+
return _context.abrupt("break", 17);
|
|
2657
|
+
case 15:
|
|
2658
|
+
if (_this2.closeFn) {
|
|
2659
|
+
typeof _this2.closeFn === 'function' && _this2.closeFn(_this2);
|
|
2660
|
+
} else {
|
|
2643
2661
|
typeof _this2.cancelFn === 'function' && _this2.cancelFn(_this2);
|
|
2644
2662
|
}
|
|
2645
|
-
|
|
2663
|
+
return _context.abrupt("break", 17);
|
|
2664
|
+
case 17:
|
|
2646
2665
|
case "end":
|
|
2647
2666
|
return _context.stop();
|
|
2648
2667
|
}
|
|
@@ -2654,6 +2673,9 @@
|
|
|
2654
2673
|
this.$emit('after-leave');
|
|
2655
2674
|
typeof this.afterLeaveFn === 'function' && this.afterLeaveFn(this);
|
|
2656
2675
|
},
|
|
2676
|
+
closeHandler: function closeHandler() {
|
|
2677
|
+
this.close('close');
|
|
2678
|
+
},
|
|
2657
2679
|
cancelHandler: function cancelHandler(e) {
|
|
2658
2680
|
this.close();
|
|
2659
2681
|
},
|
|
@@ -2885,7 +2907,7 @@
|
|
|
2885
2907
|
on: {
|
|
2886
2908
|
"click": function click($event) {
|
|
2887
2909
|
$event.stopPropagation();
|
|
2888
|
-
return _vm.
|
|
2910
|
+
return _vm.closeHandler($event);
|
|
2889
2911
|
}
|
|
2890
2912
|
}
|
|
2891
2913
|
}) : _vm._e()], 2)])] : [_vm.shouldRender || _vm.visible ? _c('div', {
|
|
@@ -3066,6 +3088,7 @@
|
|
|
3066
3088
|
Info.close(id);
|
|
3067
3089
|
};
|
|
3068
3090
|
instance.cancelFn = opts.cancelFn && typeof opts.cancelFn === 'function' ? opts.cancelFn : function () {};
|
|
3091
|
+
instance.closeFn = opts.closeFn && typeof opts.closeFn === 'function' ? opts.closeFn : null;
|
|
3069
3092
|
instance.afterLeaveFn = opts.afterLeaveFn && typeof opts.afterLeaveFn === 'function' ? opts.afterLeaveFn : function () {};
|
|
3070
3093
|
instance.stateChangeFn = opts.stateChangeFn && typeof opts.stateChangeFn === 'function' ? opts.stateChangeFn : function () {};
|
|
3071
3094
|
instance.onClose = function () {
|
package/lib/loading.js
CHANGED
|
@@ -842,7 +842,9 @@
|
|
|
842
842
|
el.$vm.isShow = false;
|
|
843
843
|
}, delay);
|
|
844
844
|
} else {
|
|
845
|
-
|
|
845
|
+
Vue.nextTick(function () {
|
|
846
|
+
el.$vm.isShow = false;
|
|
847
|
+
});
|
|
846
848
|
}
|
|
847
849
|
}
|
|
848
850
|
if (options.title) {
|
|
@@ -876,7 +878,9 @@
|
|
|
876
878
|
}
|
|
877
879
|
},
|
|
878
880
|
update: function update(el, binding) {
|
|
879
|
-
|
|
881
|
+
if (el.viewmodel) {
|
|
882
|
+
toggle(el, binding.value);
|
|
883
|
+
}
|
|
880
884
|
}
|
|
881
885
|
};
|
|
882
886
|
|