vue-click 2.1.6 → 2.1.7

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.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +14 -14
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.VueClick=t():e.VueClick=t()}(self,(function(){return(()=>{"use strict";var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{ClickDirective:()=>c,default:()=>l});var n,o,u=/^(\d+)?(m|s|ms)?$/i,i=function(e){var t;void 0===e&&(e="");var n=u.exec(e);if(null!==n&&n.length>=3){var o=parseFloat(n[1]);switch((null!==(t=n[2])&&void 0!==t?t:"ms").toLowerCase()){case"m":return 6e4*o;case"s":return 1e3*o;case"ms":return o}}return null};!function(e){e.Single="single",e.Double="double",e.Hold="hold",e.Press="press",e.Release="release"}(n||(n={})),function(e){e.Once="once",e.Throttle="throttle",e.Debounce="debounce"}(o||(o={}));var r=function(e,t){return Object.keys(e).filter((function(n){return Object(e)[n]===t})).length>0},d=300,s={capture:!0,passive:!1},a=function(e){if(void 0!==e.dataset.vcBindClick||void 0!==e.dataset.vcBindDouble||void 0!==e.dataset.vcBindHold||void 0!==e.dataset.vcBindPress||void 0!==e.dataset.vcBindRelease)return function(){};var t=function(t){"mousedown"===t.type||"touchstart"===t.type?e.dataset.vcStateActive="":delete e.dataset.vcStateActive};return e.addEventListener("touchstart",t,s),e.addEventListener("touchend",t,s),e.addEventListener("mousedown",t,s),e.addEventListener("mouseup",t,s),function(){e.removeEventListener("touchstart",t,s),e.removeEventListener("touchend",t,s),e.removeEventListener("mousedown",t,s),e.removeEventListener("mouseup",t,s),e.dataset.vcStateDeactivated=""}},c={mounted:function(e,t){var c=function(e){var t,d={behavior:n.Single,modifier:null,time:null,argument:null,once:!1,dispatch:function(){}};for(var s in e.modifiers){var a=s.split(":");void 0!==a[1]&&(d.argument=a[1]),void 0===(t=a[0])&&(t=""),u.test(t)?d.time=i(a[0]):r(n,a[0])?d.behavior=a[0]:r(o,a[0])&&(d.modifier=a[0])}return void 0!==e.arg&&(d.argument=e.arg),"function"==typeof e.value&&(d.dispatch=function(){return e.value(d.argument)}),d}(t),l=function(){return c.dispatch()};switch(c.modifier){case o.Once:l=function(e){return function(t){t(),e.dispatch()}}(c);break;case o.Throttle:l=function(e){var t,n=null!==(t=e.time)&&void 0!==t?t:d,o=null;return function(){null===o?e.dispatch():clearTimeout(o),o=window.setTimeout((function(){o=null}),n)}}(c);break;case o.Debounce:l=function(e){var t,n=null!==(t=e.time)&&void 0!==t?t:d,o=null;return function(){null!==o&&clearTimeout(o),o=window.setTimeout((function(){o=null,e.dispatch()}),n)}}(c)}var v=function(t){!0!==e.disabled&&l(t)};switch(c.behavior){case n.Single:!function(e,t,n){var o,u=null,i=function(t){t.isTrusted&&(t.cancelable&&t.preventDefault(),"mousedown"===t.type||"touchstart"===t.type?(null!==u&&clearTimeout(u),u=window.setTimeout((function(){null!==u&&(clearTimeout(u),u=null)}),300)):"mouseup"!==t.type&&"touchend"!==t.type||null===u||(clearTimeout(u),u=null,n((function(){r(),e.removeEventListener("touchstart",i,s),e.removeEventListener("touchend",i,s),e.removeEventListener("mousedown",i,s),e.removeEventListener("mouseup",i,s),delete e.dataset.vcBindClick}))))},r=a(e);e.addEventListener("touchstart",i,s),e.addEventListener("touchend",i,s),e.addEventListener("mousedown",i,s),e.addEventListener("mouseup",i,s),e.dataset.vcBindClick=null!==(o=t.modifier)&&void 0!==o?o:""}(e,c,v);break;case n.Double:!function(e,t,n){var o,u,i=null!==(o=t.time)&&void 0!==o?o:d,r=null,c=0,l=function(t){t.isTrusted&&(t.cancelable&&t.preventDefault(),"mousedown"===t.type||"touchstart"===t.type?(null!==r&&clearTimeout(r),r=window.setTimeout((function(){null!==r&&(clearTimeout(r),r=null,c=0)}),300)):"mouseup"!==t.type&&"touchend"!==t.type||null===r||(clearTimeout(r),r=null,0===c?(c++,r=window.setTimeout((function(){null!==r&&(clearTimeout(r),r=null,c=0)}),i)):(c=0,n((function(){v(),e.removeEventListener("touchstart",l,s),e.removeEventListener("touchend",l,s),e.removeEventListener("mousedown",l,s),e.removeEventListener("mouseup",l,s),delete e.dataset.vcBindDouble})))))},v=a(e);e.addEventListener("touchstart",l,s),e.addEventListener("touchend",l,s),e.addEventListener("mousedown",l,s),e.addEventListener("mouseup",l,s),e.dataset.vcBindDouble=null!==(u=t.modifier)&&void 0!==u?u:""}(e,c,v);break;case n.Hold:!function(e,t,n){var o,u,i=null!==(o=t.time)&&void 0!==o?o:d,r=null,c=function(t){t.isTrusted&&(t.cancelable&&t.preventDefault(),"mousedown"===t.type||"touchstart"===t.type?r=window.setTimeout((function(){n((function(){l(),e.removeEventListener("touchstart",c,s),e.removeEventListener("touchend",c,s),e.removeEventListener("mousedown",c,s),e.removeEventListener("mouseup",c,s),delete e.dataset.vcBindHold}))}),i):"mouseup"!==t.type&&"touchend"!==t.type||null===r||(clearTimeout(r),r=null))},l=a(e);e.addEventListener("touchstart",c,s),e.addEventListener("touchend",c,s),e.addEventListener("mousedown",c,s),e.addEventListener("mouseup",c,s),e.dataset.vcBindHold=null!==(u=t.modifier)&&void 0!==u?u:""}(e,c,v);break;case n.Press:!function(e,t,n){var o,u=function(t){t.isTrusted&&(t.cancelable&&t.preventDefault(),n((function(){i(),e.removeEventListener("touchend",u,s),e.removeEventListener("mousedown",u,s),delete e.dataset.vcBindPress})))},i=a(e);e.addEventListener("touchstart",u,s),e.addEventListener("mousedown",u,s),e.dataset.vcBindPress=null!==(o=t.modifier)&&void 0!==o?o:""}(e,c,v);break;case n.Release:!function(e,t,n){var o,u="vcBindRelease",i=function(t){t.isTrusted&&(t.cancelable&&t.preventDefault(),n((function(){r(),e.removeEventListener("touchend",i,s),e.removeEventListener("mouseup",i,s),delete e.dataset[u]})))},r=a(e);e.addEventListener("touchend",i,s),e.addEventListener("mouseup",i,s),e.dataset[u]=null!==(o=t.modifier)&&void 0!==o?o:""}(e,c,v)}}};const l={install:function(e){e.directive("click",c)}};return t})()}));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.VueClick=t():e.VueClick=t()}(self,(()=>(()=>{"use strict";var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{ClickDirective:()=>c,default:()=>l});var n,o,u=/^(\d+)?(m|s|ms)?$/i,i=function(e){var t;void 0===e&&(e="");var n=u.exec(e);if(null!==n&&n.length>=3){var o=parseFloat(n[1]);switch((null!==(t=n[2])&&void 0!==t?t:"ms").toLowerCase()){case"m":return 6e4*o;case"s":return 1e3*o;case"ms":return o}}return null};!function(e){e.Single="single",e.Double="double",e.Hold="hold",e.Press="press",e.Release="release"}(n||(n={})),function(e){e.Once="once",e.Throttle="throttle",e.Debounce="debounce"}(o||(o={}));var r=function(e,t){return Object.keys(e).filter((function(n){return Object(e)[n]===t})).length>0},d=300,s={capture:!0,passive:!1},a=function(e){if(void 0!==e.dataset.vcBindClick||void 0!==e.dataset.vcBindDouble||void 0!==e.dataset.vcBindHold||void 0!==e.dataset.vcBindPress||void 0!==e.dataset.vcBindRelease)return function(){};var t=function(t){"mousedown"===t.type||"touchstart"===t.type?e.dataset.vcStateActive="":delete e.dataset.vcStateActive};return e.addEventListener("touchstart",t,s),e.addEventListener("touchend",t,s),e.addEventListener("mousedown",t,s),e.addEventListener("mouseup",t,s),function(){e.removeEventListener("touchstart",t,s),e.removeEventListener("touchend",t,s),e.removeEventListener("mousedown",t,s),e.removeEventListener("mouseup",t,s),e.dataset.vcStateDeactivated=""}},c={mounted:function(e,t){var c=function(e){var t,d={behavior:n.Single,modifier:null,time:null,argument:null,once:!1,dispatch:function(){}};for(var s in e.modifiers){var a=s.split(":");void 0!==a[1]&&(d.argument=a[1]),void 0===(t=a[0])&&(t=""),u.test(t)?d.time=i(a[0]):r(n,a[0])?d.behavior=a[0]:r(o,a[0])&&(d.modifier=a[0])}return void 0!==e.arg&&(d.argument=e.arg),"function"==typeof e.value&&(d.dispatch=function(){return e.value(d.argument)}),d}(t),l=function(){return c.dispatch()};switch(c.modifier){case o.Once:l=function(e){return function(t){t(),e.dispatch()}}(c);break;case o.Throttle:l=function(e){var t,n=null!==(t=e.time)&&void 0!==t?t:d,o=null;return function(){null===o?e.dispatch():clearTimeout(o),o=window.setTimeout((function(){o=null}),n)}}(c);break;case o.Debounce:l=function(e){var t,n=null!==(t=e.time)&&void 0!==t?t:d,o=null;return function(){null!==o&&clearTimeout(o),o=window.setTimeout((function(){o=null,e.dispatch()}),n)}}(c)}var v=function(t){!0!==e.disabled&&l(t)};switch(c.behavior){case n.Single:!function(e,t,n){var o,u=null,i=function(t){t.isTrusted&&(t.cancelable&&t.preventDefault(),"mousedown"===t.type||"touchstart"===t.type?(null!==u&&clearTimeout(u),u=window.setTimeout((function(){null!==u&&(clearTimeout(u),u=null)}),300)):"mouseup"!==t.type&&"touchend"!==t.type||null===u||(clearTimeout(u),u=null,n((function(){r(),e.removeEventListener("touchstart",i,s),e.removeEventListener("touchend",i,s),e.removeEventListener("mousedown",i,s),e.removeEventListener("mouseup",i,s),delete e.dataset.vcBindClick}))))},r=a(e);e.addEventListener("touchstart",i,s),e.addEventListener("touchend",i,s),e.addEventListener("mousedown",i,s),e.addEventListener("mouseup",i,s),e.dataset.vcBindClick=null!==(o=t.modifier)&&void 0!==o?o:""}(e,c,v);break;case n.Double:!function(e,t,n){var o,u,i=null!==(o=t.time)&&void 0!==o?o:d,r=null,c=0,l=function(t){t.isTrusted&&(t.cancelable&&t.preventDefault(),"mousedown"===t.type||"touchstart"===t.type?(null!==r&&clearTimeout(r),r=window.setTimeout((function(){null!==r&&(clearTimeout(r),r=null,c=0)}),300)):"mouseup"!==t.type&&"touchend"!==t.type||null===r||(clearTimeout(r),r=null,0===c?(c++,r=window.setTimeout((function(){null!==r&&(clearTimeout(r),r=null,c=0)}),i)):(c=0,n((function(){v(),e.removeEventListener("touchstart",l,s),e.removeEventListener("touchend",l,s),e.removeEventListener("mousedown",l,s),e.removeEventListener("mouseup",l,s),delete e.dataset.vcBindDouble})))))},v=a(e);e.addEventListener("touchstart",l,s),e.addEventListener("touchend",l,s),e.addEventListener("mousedown",l,s),e.addEventListener("mouseup",l,s),e.dataset.vcBindDouble=null!==(u=t.modifier)&&void 0!==u?u:""}(e,c,v);break;case n.Hold:!function(e,t,n){var o,u,i=null!==(o=t.time)&&void 0!==o?o:d,r=null,c=function(t){t.isTrusted&&(t.cancelable&&t.preventDefault(),"mousedown"===t.type||"touchstart"===t.type?r=window.setTimeout((function(){n((function(){l(),e.removeEventListener("touchstart",c,s),e.removeEventListener("touchend",c,s),e.removeEventListener("mousedown",c,s),e.removeEventListener("mouseup",c,s),delete e.dataset.vcBindHold}))}),i):"mouseup"!==t.type&&"touchend"!==t.type||null===r||(clearTimeout(r),r=null))},l=a(e);e.addEventListener("touchstart",c,s),e.addEventListener("touchend",c,s),e.addEventListener("mousedown",c,s),e.addEventListener("mouseup",c,s),e.dataset.vcBindHold=null!==(u=t.modifier)&&void 0!==u?u:""}(e,c,v);break;case n.Press:!function(e,t,n){var o,u=function(t){t.isTrusted&&(t.cancelable&&t.preventDefault(),n((function(){i(),e.removeEventListener("touchend",u,s),e.removeEventListener("mousedown",u,s),delete e.dataset.vcBindPress})))},i=a(e);e.addEventListener("touchstart",u,s),e.addEventListener("mousedown",u,s),e.dataset.vcBindPress=null!==(o=t.modifier)&&void 0!==o?o:""}(e,c,v);break;case n.Release:!function(e,t,n){var o,u="vcBindRelease",i=function(t){t.isTrusted&&(t.cancelable&&t.preventDefault(),n((function(){r(),e.removeEventListener("touchend",i,s),e.removeEventListener("mouseup",i,s),delete e.dataset[u]})))},r=a(e);e.addEventListener("touchend",i,s),e.addEventListener("mouseup",i,s),e.dataset[u]=null!==(o=t.modifier)&&void 0!==o?o:""}(e,c,v)}}};const l={install:function(e){e.directive("click",c)}};return t})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-click",
3
- "version": "2.1.6",
3
+ "version": "2.1.7",
4
4
  "private": false,
5
5
  "description": "Vue plugin for advanced click directive.",
6
6
  "author": "Zachary Cardoza",
@@ -37,23 +37,23 @@
37
37
  },
38
38
  "dependencies": {},
39
39
  "devDependencies": {
40
- "@typescript-eslint/eslint-plugin": "^4.17.0",
41
- "@typescript-eslint/parser": "^4.17.0",
40
+ "@typescript-eslint/eslint-plugin": "^5.43.0",
41
+ "@typescript-eslint/parser": "^5.43.0",
42
42
  "clean-webpack-plugin": "^3.0.0",
43
43
  "copy-webpack-plugin": "^8.0.0",
44
44
  "dts-bundle": "^0.7.3",
45
- "eslint": "^7.21.0",
46
- "eslint-config-standard-with-typescript": "^20.0.0",
47
- "eslint-plugin-import": "^2.22.1",
45
+ "eslint": "^8.28.0",
46
+ "eslint-config-standard-with-typescript": "^23.0.0",
47
+ "eslint-plugin-import": "^2.26.0",
48
48
  "eslint-plugin-node": "^11.1.0",
49
- "eslint-plugin-promise": "^4.3.1",
49
+ "eslint-plugin-promise": "^6.1.1",
50
50
  "eslint-plugin-standard": "^5.0.0",
51
- "html-webpack-plugin": "^5.3.1",
52
- "ts-loader": "^8.0.17",
53
- "typescript": "^4.2.3",
54
- "vue": "^3.0.7",
55
- "webpack": "^5.24.4",
56
- "webpack-cli": "^4.5.0",
57
- "webpack-dev-server": "^3.11.2"
51
+ "html-webpack-plugin": "^5.5.0",
52
+ "ts-loader": "^9.4.1",
53
+ "typescript": "^4.9.3",
54
+ "vue": "^3.2.45",
55
+ "webpack": "^5.75.0",
56
+ "webpack-cli": "^5.0.0",
57
+ "webpack-dev-server": "^4.11.1"
58
58
  }
59
59
  }