iov-design 2.15.45 → 2.15.46

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/lib/dialog.js CHANGED
@@ -291,6 +291,7 @@ var render = function() {
291
291
  ? _c(
292
292
  "div",
293
293
  {
294
+ ref: "body",
294
295
  staticClass: "el-dialog__body",
295
296
  class:
296
297
  _vm.type === "form"
@@ -304,7 +305,7 @@ var render = function() {
304
305
  _vm.$slots.footer
305
306
  ? _c(
306
307
  "div",
307
- { staticClass: "el-dialog__footer" },
308
+ { ref: "footer", staticClass: "el-dialog__footer" },
308
309
  [_vm._t("footer")],
309
310
  2
310
311
  )
@@ -440,7 +441,7 @@ var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
440
441
 
441
442
  top: {
442
443
  type: String,
443
- default: '15vh'
444
+ default: '50%'
444
445
  },
445
446
  beforeClose: Function,
446
447
  center: {
@@ -489,7 +490,7 @@ var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
489
490
  style: function style() {
490
491
  var style = {};
491
492
  if (!this.fullscreen) {
492
- style.marginTop = this.top;
493
+ style.top = this.top;
493
494
  if (this.width) {
494
495
  style.width = this.width;
495
496
  }
@@ -529,10 +530,52 @@ var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
529
530
  this.broadcast('ElDropdownMenu', 'updatePopper');
530
531
  },
531
532
  afterEnter: function afterEnter() {
533
+ this.onDialogOpened();
532
534
  this.$emit('opened');
533
535
  },
534
536
  afterLeave: function afterLeave() {
535
537
  this.$emit('closed');
538
+ },
539
+ onDialogOpened: function onDialogOpened() {
540
+ var _this2 = this;
541
+
542
+ this.$nextTick(function () {
543
+ _this2.checkOverflow();
544
+ _this2.observeContentChanges();
545
+ });
546
+ },
547
+
548
+
549
+ // 检查内容是否超过body高度
550
+ checkOverflow: function checkOverflow() {
551
+ var body = this.$refs.body;
552
+ var footer = this.$refs.footer;
553
+ if (!body || !footer) return;
554
+ if (body.scrollHeight > body.clientHeight) {
555
+ footer.classList.add('el-dialog__footer--shadow');
556
+ } else {
557
+ footer.classList.remove('el-dialog__footer--shadow');
558
+ }
559
+ },
560
+
561
+ // 监听节点变化
562
+ observeContentChanges: function observeContentChanges() {
563
+ var _this3 = this;
564
+
565
+ var body = this.$refs.body;
566
+ if (!body) return;
567
+ if (this._mutationObserver) {
568
+ this._mutationObserver.disconnect();
569
+ }
570
+ this._mutationObserver = new MutationObserver(function () {
571
+ _this3.checkOverflow();
572
+ });
573
+ // 监听子节点及文本节点的内容变化
574
+ this._mutationObserver.observe(body, {
575
+ childList: true,
576
+ subtree: true,
577
+ characterData: true
578
+ });
536
579
  }
537
580
  },
538
581
 
@@ -550,6 +593,9 @@ var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
550
593
  if (this.appendToBody && this.$el && this.$el.parentNode) {
551
594
  this.$el.parentNode.removeChild(this.$el);
552
595
  }
596
+ if (this._mutationObserver) {
597
+ this._mutationObserver.disconnect();
598
+ }
553
599
  }
554
600
  });
555
601
  // CONCATENATED MODULE: ./packages/dialog/src/component.vue?vue&type=script&lang=js&
package/lib/empty.js CHANGED
@@ -296,7 +296,10 @@ var IMG = {
296
296
  type: Number,
297
297
  default: 1
298
298
  },
299
- imageSize: Number,
299
+ imageSize: {
300
+ type: Number,
301
+ default: 140
302
+ },
300
303
  description: {
301
304
  type: String,
302
305
  default: ''