bk-magic-vue 2.4.8-beta.6 → 2.4.8

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.
@@ -6694,6 +6694,7 @@
6694
6694
  var nodeList = [];
6695
6695
  var clickctx = '$clickoutsideCtx';
6696
6696
  var beginClick;
6697
+ var seed = 0;
6697
6698
  document.addEventListener('mousedown', function (event) {
6698
6699
  return beginClick = event;
6699
6700
  });
@@ -6704,7 +6705,8 @@
6704
6705
  });
6705
6706
  var bkClickoutside = {
6706
6707
  bind: function bind(el, binding, vnode) {
6707
- var id = nodeList.push(el) - 1;
6708
+ nodeList.push(el);
6709
+ var id = seed++;
6708
6710
  var clickoutsideHandler = function clickoutsideHandler() {
6709
6711
  var mouseup = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6710
6712
  var mousedown = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -8511,7 +8513,7 @@
8511
8513
  expression: "handleClose"
8512
8514
  }],
8513
8515
  staticClass: "bk-date-picker",
8514
- class: [_vm.type === 'datetimerange' ? 'long' : '', _vm.longWidthCls, _vm.extCls]
8516
+ class: [_vm.type === 'datetimerange' ? 'long' : '', _vm.longWidthCls, _vm.extCls, _vm.type === 'time' ? 'time-picker' : '']
8515
8517
  }, [_c('div', {
8516
8518
  ref: "reference",
8517
8519
  staticClass: "bk-date-picker-rel"
@@ -12204,7 +12206,8 @@
12204
12206
  "disabled-date": _vm.disabledDate,
12205
12207
  "range-state": _vm.rangeState,
12206
12208
  "value": _vm.preSelecting.left ? [_vm.dates[0]] : _vm.dates,
12207
- "focused-date": _vm.focusedDate
12209
+ "focused-date": _vm.focusedDate,
12210
+ "cell-class": _vm.cellClass
12208
12211
  },
12209
12212
  on: {
12210
12213
  "change-range": _vm.handleChangeRange,
@@ -29409,10 +29412,10 @@
29409
29412
 
29410
29413
  var InfoBoxConstructor = Vue.extend(__vue_component__$v);
29411
29414
  var instancesList = [];
29412
- var seed = 0;
29415
+ var seed$1 = 0;
29413
29416
  var Info = function Info() {
29414
29417
  var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
29415
- var id = 'bkInfoBox' + seed++;
29418
+ var id = 'bkInfoBox' + seed$1++;
29416
29419
  if (typeof opts === 'string') {
29417
29420
  opts = {
29418
29421
  title: opts
@@ -29431,8 +29434,8 @@
29431
29434
  instance.type = opts.type || '';
29432
29435
  instance.showFooter = opts.showFooter !== false;
29433
29436
  instance.closeIcon = opts.closeIcon !== false;
29434
- instance.maskClose = opts.maskClose;
29435
- instance.escClose = opts.escClose;
29437
+ instance.maskClose = opts.maskClose === undefined ? true : opts.maskClose;
29438
+ instance.escClose = opts.escClose === undefined ? true : opts.escClose;
29436
29439
  instance.theme = opts.theme || 'primary';
29437
29440
  instance.icon = opts.icon;
29438
29441
  instance.extCls = opts.extCls;
@@ -30797,7 +30800,7 @@
30797
30800
 
30798
30801
  var MessageComponent = Vue.extend(__vue_component__$D);
30799
30802
  var messageList = [];
30800
- var seed$1 = 0;
30803
+ var seed$2 = 0;
30801
30804
  var BkMessage = function BkMessage(config) {
30802
30805
  if (config.limit === 0) {
30803
30806
  BkMessage.batchClose();
@@ -30806,7 +30809,7 @@
30806
30809
  if (config.limit > 0) {
30807
30810
  BkMessage.batchClose(config.limit);
30808
30811
  }
30809
- var instanceId = "messageInstance_".concat(now$1(), "_").concat(seed$1++);
30812
+ var instanceId = "messageInstance_".concat(now$1(), "_").concat(seed$2++);
30810
30813
  var offsetY = _parseInt$2(config.offsetY) || 30;
30811
30814
  var spacing = _parseInt$2(config.spacing) || 10;
30812
30815
  if (config.ellipsisLine === null || config.ellipsisLine === undefined || config.ellipsisLine === '' || isNaN(config.ellipsisLine)) {
@@ -31055,7 +31058,7 @@
31055
31058
 
31056
31059
  var NotifyComponent = Vue.extend(__vue_component__$E);
31057
31060
  var notifyList = [];
31058
- var seed$2 = 0;
31061
+ var seed$3 = 0;
31059
31062
  var BkNotify = function BkNotify(config) {
31060
31063
  if (config.limit === 0) {
31061
31064
  BkNotify.batchClose();
@@ -31064,7 +31067,7 @@
31064
31067
  if (config.limit > 0) {
31065
31068
  BkNotify.batchClose(config.limit);
31066
31069
  }
31067
- var instanceId = "notifyInstance_".concat(now$1(), "_").concat(seed$2++);
31070
+ var instanceId = "notifyInstance_".concat(now$1(), "_").concat(seed$3++);
31068
31071
  var offsetY = config.offsetY || 30;
31069
31072
  var offsetX = config.offsetX || 10;
31070
31073
  var spacing = config.spacing || 10;
@@ -48323,6 +48326,21 @@
48323
48326
 
48324
48327
  setInstaller(__vue_component__$1e);
48325
48328
 
48329
+ var getElementSize = function getElementSize(node) {
48330
+ if (node === undefined) {
48331
+ return {
48332
+ height: 0,
48333
+ width: 0
48334
+ };
48335
+ }
48336
+ var computedStyle = getComputedStyle(node);
48337
+ var width = node.clientWidth - _parseFloat$2(computedStyle.paddingTop) - _parseFloat$2(computedStyle.paddingBottom);
48338
+ var height = node.clientHeight - _parseFloat$2(computedStyle.paddingLeft) - _parseFloat$2(computedStyle.paddingRight);
48339
+ return {
48340
+ height: height,
48341
+ width: width
48342
+ };
48343
+ };
48326
48344
  var script$1e = {
48327
48345
  name: 'bk-swiper',
48328
48346
  props: {
@@ -48361,7 +48379,6 @@
48361
48379
  },
48362
48380
  data: function data() {
48363
48381
  return {
48364
- swiperMainWith: 0,
48365
48382
  currentIndex: 1,
48366
48383
  isStartMove: false,
48367
48384
  isTransition: false,
@@ -48369,7 +48386,9 @@
48369
48386
  mouseDistance: 0,
48370
48387
  loopId: '',
48371
48388
  isClick: false,
48372
- realWidth: 0
48389
+ realWidth: 0,
48390
+ realHeight: 0,
48391
+ resizeObserver: {}
48373
48392
  };
48374
48393
  },
48375
48394
  computed: {
@@ -48381,6 +48400,9 @@
48381
48400
  var last = this.sourceList.slice(-1);
48382
48401
  return [].concat(_toConsumableArray(last), _toConsumableArray(this.sourceList), [first]);
48383
48402
  },
48403
+ swiperMainWith: function swiperMainWith() {
48404
+ return this.realWidth * this.dataList.length;
48405
+ },
48384
48406
  imageTransfer: function imageTransfer() {
48385
48407
  var indexMove = this.realWidth * this.currentIndex;
48386
48408
  var imageMove = indexMove - this.mouseDistance;
@@ -48395,38 +48417,11 @@
48395
48417
  },
48396
48418
  immediate: true
48397
48419
  },
48398
- height: function height(val) {
48399
- var ele = this.$refs.swiper || {
48400
- style: {
48401
- width: 0,
48402
- height: 0
48403
- },
48404
- offsetWidth: 0
48405
- };
48406
- if (+val > 0) ele.style.height = val + 'px';
48407
- },
48408
- width: function width(val) {
48409
- var ele = this.$refs.swiper || {
48410
- style: {
48411
- width: 0,
48412
- height: 0
48413
- },
48414
- offsetWidth: 0
48415
- };
48416
- this.realWidth = +val > 0 ? +val : ele.offsetWidth;
48417
- ele.style.width = this.realWidth + 'px';
48418
- },
48419
- list: function list() {
48420
- var _this = this;
48421
- this.$nextTick(function () {
48422
- _this.calcSize();
48423
- });
48420
+ height: function height() {
48421
+ this.calcSize();
48424
48422
  },
48425
- pics: function pics() {
48426
- var _this2 = this;
48427
- this.$nextTick(function () {
48428
- _this2.calcSize();
48429
- });
48423
+ width: function width() {
48424
+ this.calcSize();
48430
48425
  }
48431
48426
  },
48432
48427
  mounted: function mounted() {
@@ -48437,27 +48432,37 @@
48437
48432
  },
48438
48433
  methods: {
48439
48434
  calcSize: function calcSize() {
48440
- var ele = this.$refs.swiper || {
48441
- style: {
48442
- width: 0,
48443
- height: 0
48444
- },
48445
- offsetWidth: 0
48446
- };
48447
- if (+this.height > 0) ele.style.height = this.height + 'px';
48448
- this.realWidth = +this.width > 0 ? +this.width : ele.offsetWidth;
48449
- ele.style.width = this.realWidth + 'px';
48450
- this.swiperMainWith = this.realWidth * this.dataList.length;
48435
+ var swiperParentSize = getElementSize(this.$refs.swiper && this.$refs.swiper.parentElement);
48436
+ this.realWidth = +this.width > 0 ? this.width : swiperParentSize.width || 600;
48437
+ this.realHeight = +this.height > 0 ? this.height : swiperParentSize.height || 300;
48451
48438
  },
48452
48439
  initStatus: function initStatus() {
48453
48440
  this.calcSize();
48454
48441
  this.startLoop();
48442
+ this.watchParentSizeChange();
48455
48443
  document.addEventListener('visibilitychange', this.visChange);
48456
48444
  },
48457
48445
  destoryStatus: function destoryStatus() {
48458
48446
  this.endLoop();
48447
+ this.endWatchParentSizeChange();
48459
48448
  document.removeEventListener('visibilitychange', this.visChange);
48460
48449
  },
48450
+ watchParentSizeChange: function watchParentSizeChange() {
48451
+ var _this = this;
48452
+ var parentEle = this.$refs.swiper && this.$refs.swiper.parentElement;
48453
+ if (!parentEle || !window.ResizeObserver) {
48454
+ return;
48455
+ }
48456
+ this.resizeObserver = new ResizeObserver(function () {
48457
+ _this.calcSize();
48458
+ });
48459
+ this.resizeObserver.observe(parentEle);
48460
+ },
48461
+ endWatchParentSizeChange: function endWatchParentSizeChange() {
48462
+ if (this.resizeObserver && this.resizeObserver.disconnect) {
48463
+ this.resizeObserver.disconnect();
48464
+ }
48465
+ },
48461
48466
  goToLink: function goToLink(link) {
48462
48467
  if (this.isClick && link) window.open(link, '_blank');
48463
48468
  },
@@ -48516,13 +48521,13 @@
48516
48521
  }
48517
48522
  },
48518
48523
  startLoop: function startLoop() {
48519
- var _this3 = this;
48524
+ var _this2 = this;
48520
48525
  if (!this.isLoop) return;
48521
48526
  this.endLoop();
48522
48527
  this.loopId = window.setTimeout(function () {
48523
- _this3.isTransition = true;
48524
- _this3.changeCurrentIndex(_this3.currentIndex + 1);
48525
- _this3.startLoop();
48528
+ _this2.isTransition = true;
48529
+ _this2.changeCurrentIndex(_this2.currentIndex + 1);
48530
+ _this2.startLoop();
48526
48531
  }, this.loopTime);
48527
48532
  },
48528
48533
  endLoop: function endLoop() {
@@ -48544,8 +48549,11 @@
48544
48549
 
48545
48550
  return _vm.sourceList.length ? _c('section', {
48546
48551
  ref: "swiper",
48547
- staticClass: "bk-swiper-home",
48548
- class: _vm.extCls
48552
+ class: ['bk-swiper-home', _vm.extCls],
48553
+ style: {
48554
+ width: _vm.realWidth + "px",
48555
+ height: _vm.realHeight + "px"
48556
+ }
48549
48557
  }, [_c('hgroup', {
48550
48558
  class: [{
48551
48559
  'bk-transition': _vm.isTransition