Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hsy-vue-dialog

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hsy-vue-dialog - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

73

lib/index.js

@@ -589,4 +589,4 @@ module.exports =

height: '',
bodyOverflowX: '',
bodyOverflowY: '',
parentOverflowX: '',
parentOverflowY: '',
isHidden: true

@@ -609,2 +609,6 @@ };

},
wholeWindow: {
type: Boolean,
default: true
},
value: {

@@ -618,2 +622,32 @@ type: Boolean,

return this.$el.querySelector('.main');
},
parentEl: function parentEl() {
var parent = this.$el.parentNode;
while (parent) {
if (parent === document.body) {
break;
}
var style = window.getComputedStyle(parent);
var position = style.getPropertyValue('position');
if (position === 'relative' || position === 'absolute') {
break;
}
parent = parent.parentNode;
}
return parent;
},
parentSize: {
cache: false,
get: function get() {
if (this.wholeWindow) {
var width = document.documentElement.clientWidth;
var height = document.documentElement.clientHeight;
return {
width: width,
height: height
};
}
return this.parentEl.getBoundingClientRect();
}
}

@@ -654,4 +688,5 @@ },

updateContainerSize: function updateContainerSize() {
this.$el.style.width = document.documentElement.clientWidth + 'px';
this.$el.style.height = document.documentElement.clientHeight + 'px';
var size = this.parentSize;
this.$el.style.width = size.width + 'px';
this.$el.style.height = size.height + 'px';
},

@@ -665,13 +700,13 @@ updateMainSize: function updateMainSize() {

},
captureBodyOverflow: function captureBodyOverflow() {
var style = window.getComputedStyle(document.body);
this.bodyOverflowX = style.getPropertyValue('overflowX');
this.bodyOverflowY = style.getPropertyValue('overflowY');
captureParentOverflow: function captureParentOverflow() {
var style = window.getComputedStyle(this.parentEl);
this.parentOverflowX = style.getPropertyValue('overflowX');
this.parentOverflowY = style.getPropertyValue('overflowY');
},
forceBodyOverflow: function forceBodyOverflow() {
document.body.style.overflow = 'hidden';
forceParentOverflow: function forceParentOverflow() {
this.parentEl.overflow = 'hidden';
},
resumeBodyOverflow: function resumeBodyOverflow() {
document.body.style.overflowX = this.bodyOverflowX;
document.body.style.overflowY = this.bodyOverflowY;
resumeParentOverflow: function resumeParentOverflow() {
this.parentEl.style.overflowX = this.bodyOverflowX;
this.parentEl.style.overflowY = this.bodyOverflowY;
},

@@ -710,4 +745,4 @@ addCssClass: function addCssClass(el, cls) {

this.$el.style.display = 'block';
this.captureBodyOverflow();
this.forceBodyOverflow();
this.captureParentOverflow();
this.forceParentOverflow();
this.updateContainerSize();

@@ -725,3 +760,3 @@ this.updateMainSize();

_this2.$el.style.display = 'none';
_this2.resumeBodyOverflow();
_this2.resumeParentOverflow();
_this2.$emit('input', false);

@@ -735,2 +770,8 @@ _this2.isHidden = true;

}
},
mounted: function mounted() {
if (this.wholeWindow) {
this.$el.parentNode.removeChild(this.$el);
document.body.appendChild(this.$el);
}
}

@@ -737,0 +778,0 @@ };

{
"name": "hsy-vue-dialog",
"version": "0.0.4",
"version": "0.0.5",
"description": "vue dialog component",

@@ -5,0 +5,0 @@ "author": "hsiaosiyuan0 <hsiaosiyuan0@outlook.com>",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc