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.3 to 0.0.4

87

lib/index.js

@@ -579,3 +579,3 @@ module.exports =

const ANIME_EVENTS = ['webkitAnimationEnd', 'mozAnimationEnd', 'MSAnimationEnd', 'oanimationend', 'animationend'];
var ANIME_EVENTS = ['webkitAnimationEnd', 'mozAnimationEnd', 'MSAnimationEnd', 'oanimationend', 'animationend'];

@@ -585,3 +585,3 @@ exports.default = {

data() {
data: function data() {
return {

@@ -596,2 +596,3 @@ msg: 'hello vue-component!',

},
props: {

@@ -616,3 +617,3 @@ maskColor: {

computed: {
mainEl() {
mainEl: function mainEl() {
return this.$el.querySelector('.main');

@@ -622,3 +623,3 @@ }

watch: {
value(val) {
value: function value(val) {
if (val) {

@@ -632,4 +633,4 @@ this.show();

methods: {
rect(el) {
let rect = el.getBoundingClientRect();
rect: function rect(el) {
var rect = el.getBoundingClientRect();
if (rect.width !== 0 || rect.height !== 0) {

@@ -639,6 +640,6 @@ return rect;

let style = window.getComputedStyle(el);
let display = style.getPropertyValue('display');
let top = style.getPropertyValue('top');
let left = style.getPropertyValue('left');
var style = window.getComputedStyle(el);
var display = style.getPropertyValue('display');
var top = style.getPropertyValue('top');
var left = style.getPropertyValue('left');

@@ -656,9 +657,9 @@ el.style.top = '-1000px';

},
updateContainerSize() {
updateContainerSize: function updateContainerSize() {
this.$el.style.width = document.documentElement.clientWidth + 'px';
this.$el.style.height = document.documentElement.clientHeight + 'px';
},
updateMainSize() {
let mainEl = this.$el.querySelector('.main');
let mainElRect = this.rect(mainEl);
updateMainSize: function updateMainSize() {
var mainEl = this.$el.querySelector('.main');
var mainElRect = this.rect(mainEl);
mainEl.style.width = mainElRect.width + 'px';

@@ -668,16 +669,16 @@ mainEl.style.left = '0px';

},
captureBodyOverflow() {
let style = window.getComputedStyle(document.body);
captureBodyOverflow: function captureBodyOverflow() {
var style = window.getComputedStyle(document.body);
this.bodyOverflowX = style.getPropertyValue('overflowX');
this.bodyOverflowY = style.getPropertyValue('overflowY');
},
forceBodyOverflow() {
forceBodyOverflow: function forceBodyOverflow() {
document.body.style.overflow = 'hidden';
},
resumeBodyOverflow() {
resumeBodyOverflow: function resumeBodyOverflow() {
document.body.style.overflowX = this.bodyOverflowX;
document.body.style.overflowY = this.bodyOverflowY;
},
addCssClass(el, cls) {
let clsList = el.className.split(' ');
addCssClass: function addCssClass(el, cls) {
var clsList = el.className.split(' ');
if (clsList.indexOf(cls) === -1) {

@@ -688,6 +689,6 @@ clsList.push(cls);

},
removeCssClass(el, cls) {
let clsList = el.className.split(' ');
removeCssClass: function removeCssClass(el, cls) {
var clsList = el.className.split(' ');
if (clsList.indexOf(cls) !== -1) {
el.className = clsList.filter(c => {
el.className = clsList.filter(function (c) {
return c !== cls;

@@ -697,16 +698,18 @@ }).join(' ');

},
anime(el, cls) {
return new Promise(resolve => {
ANIME_EVENTS.forEach(e => {
el.addEventListener(e, () => {
this.removeCssClass(el, 'animated');
this.removeCssClass(el, cls);
anime: function anime(el, cls) {
var _this = this;
return new Promise(function (resolve) {
ANIME_EVENTS.forEach(function (e) {
el.addEventListener(e, function () {
_this.removeCssClass(el, 'animated');
_this.removeCssClass(el, cls);
resolve();
});
this.addCssClass(el, 'animated');
this.addCssClass(el, cls);
_this.addCssClass(el, 'animated');
_this.addCssClass(el, cls);
});
});
},
show() {
show: function show() {
this.$el.style.display = 'block';

@@ -721,12 +724,14 @@ this.captureBodyOverflow();

},
hide() {
hide: function hide() {
var _this2 = this;
if (this.isHidden) return;
this.anime(this.$el, 'fadeOut').then(() => {
this.$el.style.display = 'none';
this.resumeBodyOverflow();
this.$emit('input', false);
this.isHidden = true;
this.anime(this.$el, 'fadeOut').then(function () {
_this2.$el.style.display = 'none';
_this2.resumeBodyOverflow();
_this2.$emit('input', false);
_this2.isHidden = true;
});
},
maskClicked() {
maskClicked: function maskClicked() {
if (!this.clickMask2Close) return;

@@ -755,3 +760,3 @@ this.hide();

const install = Vue => {
var install = function install(Vue) {
Vue.component(_Dialog2.default.name, _Dialog2.default);

@@ -762,3 +767,3 @@ };

version: '0.0.1',
install
install: install
};

@@ -765,0 +770,0 @@

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

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

},
"dependencies": {
"vue": "^2.1.10"
},
"devDependencies": {

@@ -21,2 +18,3 @@ "babel-core": "^6.21.0",

"babel-plugin-transform-es2015-modules-commonjs": "^6.18.0",
"babel-preset-es2015": "^6.22.0",
"babel-preset-es2017": "^6.16.0",

@@ -32,2 +30,3 @@ "cross-env": "^3.1.4",

"url-loader": "^0.5.7",
"vue": "^2.1.10",
"vue-loader": "^10.3.0",

@@ -34,0 +33,0 @@ "vue-style-loader": "^2.0.0",

@@ -54,3 +54,2 @@ # vue-dialog

## Props

@@ -64,2 +63,6 @@

## Demo
[demo](http://vue-demo.hsiaosiyuan.com/#/dialog)
## Screenshot

@@ -66,0 +69,0 @@

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