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

@mcwv/drawer

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mcwv/drawer - npm Package Compare versions

Comparing version 0.14.0-alpha.1 to 0.14.0-alpha.2

2

dist/mcwv.drawer.min.js

@@ -106,3 +106,3 @@ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.drawer=e():(t.mcwv=t.mcwv||{},t.mcwv.drawer=e())}(window,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=42)}({0:function(t,e,n){"use strict";

*/
var h=["touchstart","pointerdown","mousedown","keydown"],f=["touchend","pointerup","mouseup","contextmenu"],_=[],m=function(t){function e(n){var i=t.call(this,o({},e.defaultAdapter,n))||this;return i.activationAnimationHasEnded_=!1,i.activationTimer_=0,i.fgDeactivationRemovalTimer_=0,i.fgScale_="0",i.frame_={width:0,height:0},i.initialSize_=0,i.layoutFrame_=0,i.maxRadius_=0,i.unboundedCoords_={left:0,top:0},i.activationState_=i.defaultActivationState_(),i.activationTimerCallback_=function(){i.activationAnimationHasEnded_=!0,i.runDeactivationUXLogicIfReady_()},i.activateHandler_=function(t){return i.activate_(t)},i.deactivateHandler_=function(){return i.deactivate_()},i.focusHandler_=function(){return i.handleFocus()},i.blurHandler_=function(){return i.handleBlur()},i.resizeHandler_=function(){return i.layout()},i}return function(t,e){function n(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return u},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return l},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return p},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},browserSupportsCssVars:function(){return!0},computeBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},containsEventTarget:function(){return!0},deregisterDocumentInteractionHandler:function(){},deregisterInteractionHandler:function(){},deregisterResizeHandler:function(){},getWindowPageOffset:function(){return{x:0,y:0}},isSurfaceActive:function(){return!0},isSurfaceDisabled:function(){return!0},isUnbounded:function(){return!0},registerDocumentInteractionHandler:function(){},registerInteractionHandler:function(){},registerResizeHandler:function(){},removeClass:function(){},updateCssVariable:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){var t=this,n=this.supportsPressRipple_();if(this.registerRootHandlers_(n),n){var i=e.cssClasses,r=i.ROOT,a=i.UNBOUNDED;requestAnimationFrame((function(){t.adapter_.addClass(r),t.adapter_.isUnbounded()&&(t.adapter_.addClass(a),t.layoutInternal_())}))}},e.prototype.destroy=function(){var t=this;if(this.supportsPressRipple_()){this.activationTimer_&&(clearTimeout(this.activationTimer_),this.activationTimer_=0,this.adapter_.removeClass(e.cssClasses.FG_ACTIVATION)),this.fgDeactivationRemovalTimer_&&(clearTimeout(this.fgDeactivationRemovalTimer_),this.fgDeactivationRemovalTimer_=0,this.adapter_.removeClass(e.cssClasses.FG_DEACTIVATION));var n=e.cssClasses,i=n.ROOT,r=n.UNBOUNDED;requestAnimationFrame((function(){t.adapter_.removeClass(i),t.adapter_.removeClass(r),t.removeCssVars_()}))}this.deregisterRootHandlers_(),this.deregisterDeactivationHandlers_()},e.prototype.activate=function(t){this.activate_(t)},e.prototype.deactivate=function(){this.deactivate_()},e.prototype.layout=function(){var t=this;this.layoutFrame_&&cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=requestAnimationFrame((function(){t.layoutInternal_(),t.layoutFrame_=0}))},e.prototype.setUnbounded=function(t){var n=e.cssClasses.UNBOUNDED;t?this.adapter_.addClass(n):this.adapter_.removeClass(n)},e.prototype.handleFocus=function(){var t=this;requestAnimationFrame((function(){return t.adapter_.addClass(e.cssClasses.BG_FOCUSED)}))},e.prototype.handleBlur=function(){var t=this;requestAnimationFrame((function(){return t.adapter_.removeClass(e.cssClasses.BG_FOCUSED)}))},e.prototype.supportsPressRipple_=function(){return this.adapter_.browserSupportsCssVars()},e.prototype.defaultActivationState_=function(){return{activationEvent:void 0,hasDeactivationUXRun:!1,isActivated:!1,isProgrammatic:!1,wasActivatedByPointer:!1,wasElementMadeActive:!1}},e.prototype.registerRootHandlers_=function(t){var e=this;t&&(h.forEach((function(t){e.adapter_.registerInteractionHandler(t,e.activateHandler_)})),this.adapter_.isUnbounded()&&this.adapter_.registerResizeHandler(this.resizeHandler_)),this.adapter_.registerInteractionHandler("focus",this.focusHandler_),this.adapter_.registerInteractionHandler("blur",this.blurHandler_)},e.prototype.registerDeactivationHandlers_=function(t){var e=this;"keydown"===t.type?this.adapter_.registerInteractionHandler("keyup",this.deactivateHandler_):f.forEach((function(t){e.adapter_.registerDocumentInteractionHandler(t,e.deactivateHandler_)}))},e.prototype.deregisterRootHandlers_=function(){var t=this;h.forEach((function(e){t.adapter_.deregisterInteractionHandler(e,t.activateHandler_)})),this.adapter_.deregisterInteractionHandler("focus",this.focusHandler_),this.adapter_.deregisterInteractionHandler("blur",this.blurHandler_),this.adapter_.isUnbounded()&&this.adapter_.deregisterResizeHandler(this.resizeHandler_)},e.prototype.deregisterDeactivationHandlers_=function(){var t=this;this.adapter_.deregisterInteractionHandler("keyup",this.deactivateHandler_),f.forEach((function(e){t.adapter_.deregisterDocumentInteractionHandler(e,t.deactivateHandler_)}))},e.prototype.removeCssVars_=function(){var t=this,n=e.strings;Object.keys(n).forEach((function(e){0===e.indexOf("VAR_")&&t.adapter_.updateCssVariable(n[e],null)}))},e.prototype.activate_=function(t){var e=this;if(!this.adapter_.isSurfaceDisabled()){var n=this.activationState_;if(!n.isActivated){var i=this.previousActivationEvent_;if(!(i&&void 0!==t&&i.type!==t.type))n.isActivated=!0,n.isProgrammatic=void 0===t,n.activationEvent=t,n.wasActivatedByPointer=!n.isProgrammatic&&(void 0!==t&&("mousedown"===t.type||"touchstart"===t.type||"pointerdown"===t.type)),void 0!==t&&_.length>0&&_.some((function(t){return e.adapter_.containsEventTarget(t)}))?this.resetActivationState_():(void 0!==t&&(_.push(t.target),this.registerDeactivationHandlers_(t)),n.wasElementMadeActive=this.checkElementMadeActive_(t),n.wasElementMadeActive&&this.animateActivation_(),requestAnimationFrame((function(){_=[],n.wasElementMadeActive||void 0===t||" "!==t.key&&32!==t.keyCode||(n.wasElementMadeActive=e.checkElementMadeActive_(t),n.wasElementMadeActive&&e.animateActivation_()),n.wasElementMadeActive||(e.activationState_=e.defaultActivationState_())})))}}},e.prototype.checkElementMadeActive_=function(t){return void 0===t||"keydown"!==t.type||this.adapter_.isSurfaceActive()},e.prototype.animateActivation_=function(){var t=this,n=e.strings,i=n.VAR_FG_TRANSLATE_START,r=n.VAR_FG_TRANSLATE_END,a=e.cssClasses,s=a.FG_DEACTIVATION,o=a.FG_ACTIVATION,c=e.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal_();var d="",u="";if(!this.adapter_.isUnbounded()){var l=this.getFgTranslationCoordinates_(),p=l.startPoint,h=l.endPoint;d=p.x+"px, "+p.y+"px",u=h.x+"px, "+h.y+"px"}this.adapter_.updateCssVariable(i,d),this.adapter_.updateCssVariable(r,u),clearTimeout(this.activationTimer_),clearTimeout(this.fgDeactivationRemovalTimer_),this.rmBoundedActivationClasses_(),this.adapter_.removeClass(s),this.adapter_.computeBoundingRect(),this.adapter_.addClass(o),this.activationTimer_=setTimeout((function(){return t.activationTimerCallback_()}),c)},e.prototype.getFgTranslationCoordinates_=function(){var t,e=this.activationState_,n=e.activationEvent;return{startPoint:t={x:(t=e.wasActivatedByPointer?function(t,e,n){if(!t)return{x:0,y:0};var i,r,a=e.x,s=e.y,o=a+n.left,c=s+n.top;if("touchstart"===t.type){var d=t;i=d.changedTouches[0].pageX-o,r=d.changedTouches[0].pageY-c}else{var u=t;i=u.pageX-o,r=u.pageY-c}return{x:i,y:r}}(n,this.adapter_.getWindowPageOffset(),this.adapter_.computeBoundingRect()):{x:this.frame_.width/2,y:this.frame_.height/2}).x-this.initialSize_/2,y:t.y-this.initialSize_/2},endPoint:{x:this.frame_.width/2-this.initialSize_/2,y:this.frame_.height/2-this.initialSize_/2}}},e.prototype.runDeactivationUXLogicIfReady_=function(){var t=this,n=e.cssClasses.FG_DEACTIVATION,i=this.activationState_,r=i.hasDeactivationUXRun,a=i.isActivated;(r||!a)&&this.activationAnimationHasEnded_&&(this.rmBoundedActivationClasses_(),this.adapter_.addClass(n),this.fgDeactivationRemovalTimer_=setTimeout((function(){t.adapter_.removeClass(n)}),p.FG_DEACTIVATION_MS))},e.prototype.rmBoundedActivationClasses_=function(){var t=e.cssClasses.FG_ACTIVATION;this.adapter_.removeClass(t),this.activationAnimationHasEnded_=!1,this.adapter_.computeBoundingRect()},e.prototype.resetActivationState_=function(){var t=this;this.previousActivationEvent_=this.activationState_.activationEvent,this.activationState_=this.defaultActivationState_(),setTimeout((function(){return t.previousActivationEvent_=void 0}),e.numbers.TAP_DELAY_MS)},e.prototype.deactivate_=function(){var t=this,e=this.activationState_;if(e.isActivated){var n=o({},e);e.isProgrammatic?(requestAnimationFrame((function(){return t.animateDeactivation_(n)})),this.resetActivationState_()):(this.deregisterDeactivationHandlers_(),requestAnimationFrame((function(){t.activationState_.hasDeactivationUXRun=!0,t.animateDeactivation_(n),t.resetActivationState_()})))}},e.prototype.animateDeactivation_=function(t){var e=t.wasActivatedByPointer,n=t.wasElementMadeActive;(e||n)&&this.runDeactivationUXLogicIfReady_()},e.prototype.layoutInternal_=function(){var t=this;this.frame_=this.adapter_.computeBoundingRect();var n=Math.max(this.frame_.height,this.frame_.width);this.maxRadius_=this.adapter_.isUnbounded()?n:Math.sqrt(Math.pow(t.frame_.width,2)+Math.pow(t.frame_.height,2))+e.numbers.PADDING;var i=Math.floor(n*e.numbers.INITIAL_ORIGIN_SCALE);this.adapter_.isUnbounded()&&i%2!=0?this.initialSize_=i-1:this.initialSize_=i,this.fgScale_=""+this.maxRadius_/this.initialSize_,this.updateLayoutCssVars_()},e.prototype.updateLayoutCssVars_=function(){var t=e.strings,n=t.VAR_FG_SIZE,i=t.VAR_LEFT,r=t.VAR_TOP,a=t.VAR_FG_SCALE;this.adapter_.updateCssVariable(n,this.initialSize_+"px"),this.adapter_.updateCssVariable(a,this.fgScale_),this.adapter_.isUnbounded()&&(this.unboundedCoords_={left:Math.round(this.frame_.width/2-this.initialSize_/2),top:Math.round(this.frame_.height/2-this.initialSize_/2)},this.adapter_.updateCssVariable(i,this.unboundedCoords_.left+"px"),this.adapter_.updateCssVariable(r,this.unboundedCoords_.top+"px"))},e}(d);class v extends m{constructor(t,e){super({addClass(e){t.$set(t.classes,e,!0)},browserSupportsCssVars:()=>(function(t,e){void 0===e&&(e=!1);var n=t.CSS,i=c;if("boolean"==typeof c&&!e)return c;if(!(n&&"function"==typeof n.supports))return!1;var r=n.supports("--css-vars","yes"),a=n.supports("(--css-vars: yes)")&&n.supports("color","#00000000");return i=!(!r&&!a)&&!function(t){var e=t.document,n=e.createElement("div");n.className="mdc-ripple-surface--test-edge-var-bug",e.head.appendChild(n);var i=t.getComputedStyle(n),r=null!==i&&"solid"===i.borderTopStyle;return n.parentNode&&n.parentNode.removeChild(n),r}(t),e||(c=i),i})(window),computeBoundingRect:()=>t.$el.getBoundingClientRect(),containsEventTarget:e=>t.$el.contains(e),deregisterDocumentInteractionHandler:(t,e)=>document.documentElement.removeEventListener(t,e,r()),deregisterInteractionHandler:(e,n)=>{t.$el.removeEventListener(e,n,r())},deregisterResizeHandler:t=>window.removeEventListener("resize",t),getWindowPageOffset:()=>({x:window.pageXOffset,y:window.pageYOffset}),isSurfaceActive:()=>a(t.$el,":active"),isSurfaceDisabled:()=>t.disabled,isUnbounded:()=>!1,registerDocumentInteractionHandler:(t,e)=>document.documentElement.addEventListener(t,e,r()),registerInteractionHandler:(e,n)=>{t.$el.addEventListener(e,n,r())},registerResizeHandler:t=>window.addEventListener("resize",t),removeClass(e){t.$delete(t.classes,e)},updateCssVariable:(e,n)=>{t.$set(t.styles,e,n)},...e})}}const I={data:()=>({classes:{},styles:{}}),mounted(){this.ripple=new v(this),this.ripple.init()},beforeDestroy(){this.ripple.destroy()}};n.d(e,"RippleBase",(function(){return v})),n.d(e,"RippleMixin",(function(){return I}))},16:function(t,e,n){var i,r,a=n(43),s=n(44),o=(r=[],{activateTrap:function(t){if(r.length>0){var e=r[r.length-1];e!==t&&e.pause()}var n=r.indexOf(t);-1===n?r.push(t):(r.splice(n,1),r.push(t))},deactivateTrap:function(t){var e=r.indexOf(t);-1!==e&&r.splice(e,1),r.length>0&&r[r.length-1].unpause()}});function c(t){return setTimeout(t,0)}t.exports=function(t,e){var n=document,r="string"==typeof t?n.querySelector(t):t,d=s({returnFocusOnDeactivate:!0,escapeDeactivates:!0},e),u={firstTabbableNode:null,lastTabbableNode:null,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1},l={activate:function(t){if(u.active)return;y(),u.active=!0,u.paused=!1,u.nodeFocusedBeforeActivation=n.activeElement;var e=t&&t.onActivate?t.onActivate:d.onActivate;e&&e();return h(),l},deactivate:p,pause:function(){if(u.paused||!u.active)return;u.paused=!0,f()},unpause:function(){if(!u.paused||!u.active)return;u.paused=!1,y(),h()}};return l;function p(t){if(u.active){clearTimeout(i),f(),u.active=!1,u.paused=!1,o.deactivateTrap(l);var e=t&&void 0!==t.onDeactivate?t.onDeactivate:d.onDeactivate;return e&&e(),(t&&void 0!==t.returnFocus?t.returnFocus:d.returnFocusOnDeactivate)&&c((function(){var t;g((t=u.nodeFocusedBeforeActivation,_("setReturnFocus")||t))})),l}}function h(){if(u.active)return o.activateTrap(l),i=c((function(){g(m())})),n.addEventListener("focusin",I,!0),n.addEventListener("mousedown",v,{capture:!0,passive:!1}),n.addEventListener("touchstart",v,{capture:!0,passive:!1}),n.addEventListener("click",A,{capture:!0,passive:!1}),n.addEventListener("keydown",E,{capture:!0,passive:!1}),l}function f(){if(u.active)return n.removeEventListener("focusin",I,!0),n.removeEventListener("mousedown",v,!0),n.removeEventListener("touchstart",v,!0),n.removeEventListener("click",A,!0),n.removeEventListener("keydown",E,!0),l}function _(t){var e=d[t],i=e;if(!e)return null;if("string"==typeof e&&!(i=n.querySelector(e)))throw new Error("`"+t+"` refers to no known node");if("function"==typeof e&&!(i=e()))throw new Error("`"+t+"` did not return a node");return i}function m(){var t;if(!(t=null!==_("initialFocus")?_("initialFocus"):r.contains(n.activeElement)?n.activeElement:u.firstTabbableNode||_("fallbackFocus")))throw new Error("Your focus-trap needs to have at least one focusable element");return t}function v(t){r.contains(t.target)||(d.clickOutsideDeactivates?p({returnFocus:!a.isFocusable(t.target)}):d.allowOutsideClick&&d.allowOutsideClick(t)||t.preventDefault())}function I(t){r.contains(t.target)||t.target instanceof Document||(t.stopImmediatePropagation(),g(u.mostRecentlyFocusedNode||m()))}function E(t){if(!1!==d.escapeDeactivates&&function(t){return"Escape"===t.key||"Esc"===t.key||27===t.keyCode}(t))return t.preventDefault(),void p();(function(t){return"Tab"===t.key||9===t.keyCode})(t)&&function(t){if(y(),t.shiftKey&&t.target===u.firstTabbableNode)return t.preventDefault(),void g(u.lastTabbableNode);if(!t.shiftKey&&t.target===u.lastTabbableNode)t.preventDefault(),g(u.firstTabbableNode)}(t)}function A(t){d.clickOutsideDeactivates||r.contains(t.target)||d.allowOutsideClick&&d.allowOutsideClick(t)||(t.preventDefault(),t.stopImmediatePropagation())}function y(){var t=a(r);u.firstTabbableNode=t[0]||m(),u.lastTabbableNode=t[t.length-1]||m()}function g(t){t!==n.activeElement&&(t&&t.focus?(t.focus(),u.mostRecentlyFocusedNode=t,function(t){return t.tagName&&"input"===t.tagName.toLowerCase()&&"function"==typeof t.select}(t)&&t.select()):g(m()))}}},42:function(t,e,n){n(92),t.exports=n(45)},43:function(t,e){var n=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'],i=n.join(","),r="undefined"==typeof Element?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;function a(t,e){e=e||{};var n,a,o,c=[],l=[],p=t.querySelectorAll(i);for(e.includeContainer&&r.call(t,i)&&(p=Array.prototype.slice.apply(p)).unshift(t),n=0;n<p.length;n++)s(a=p[n])&&(0===(o=d(a))?c.push(a):l.push({documentOrder:n,tabIndex:o,node:a}));return l.sort(u).map((function(t){return t.node})).concat(c)}function s(t){return!(!o(t)||function(t){return function(t){return l(t)&&"radio"===t.type}(t)&&!function(t){if(!t.name)return!0;var e=function(t){for(var e=0;e<t.length;e++)if(t[e].checked)return t[e]}(t.ownerDocument.querySelectorAll('input[type="radio"][name="'+t.name+'"]'));return!e||e===t}(t)}(t)||d(t)<0)}function o(t){return!(t.disabled||function(t){return l(t)&&"hidden"===t.type}(t)||function(t){return null===t.offsetParent||"hidden"===getComputedStyle(t).visibility}(t))}a.isTabbable=function(t){if(!t)throw new Error("No node provided");return!1!==r.call(t,i)&&s(t)},a.isFocusable=function(t){if(!t)throw new Error("No node provided");return!1!==r.call(t,c)&&o(t)};var c=n.concat("iframe").join(",");function d(t){var e=parseInt(t.getAttribute("tabindex"),10);return isNaN(e)?function(t){return"true"===t.contentEditable}(t)?0:t.tabIndex:e}function u(t,e){return t.tabIndex===e.tabIndex?t.documentOrder-e.documentOrder:t.tabIndex-e.tabIndex}function l(t){return"INPUT"===t.tagName}t.exports=a},44:function(t,e){t.exports=function(){for(var t={},e=0;e<arguments.length;e++){var i=arguments[e];for(var r in i)n.call(i,r)&&(t[r]=i[r])}return t};var n=Object.prototype.hasOwnProperty},45:function(t,e,n){},92:function(t,e,n){"use strict";n.r(e);var i=n(16),r=n.n(i);
var h=["touchstart","pointerdown","mousedown","keydown"],f=["touchend","pointerup","mouseup","contextmenu"],_=[],m=function(t){function e(n){var i=t.call(this,o({},e.defaultAdapter,n))||this;return i.activationAnimationHasEnded_=!1,i.activationTimer_=0,i.fgDeactivationRemovalTimer_=0,i.fgScale_="0",i.frame_={width:0,height:0},i.initialSize_=0,i.layoutFrame_=0,i.maxRadius_=0,i.unboundedCoords_={left:0,top:0},i.activationState_=i.defaultActivationState_(),i.activationTimerCallback_=function(){i.activationAnimationHasEnded_=!0,i.runDeactivationUXLogicIfReady_()},i.activateHandler_=function(t){return i.activate_(t)},i.deactivateHandler_=function(){return i.deactivate_()},i.focusHandler_=function(){return i.handleFocus()},i.blurHandler_=function(){return i.handleBlur()},i.resizeHandler_=function(){return i.layout()},i}return function(t,e){function n(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return u},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return l},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return p},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},browserSupportsCssVars:function(){return!0},computeBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},containsEventTarget:function(){return!0},deregisterDocumentInteractionHandler:function(){},deregisterInteractionHandler:function(){},deregisterResizeHandler:function(){},getWindowPageOffset:function(){return{x:0,y:0}},isSurfaceActive:function(){return!0},isSurfaceDisabled:function(){return!0},isUnbounded:function(){return!0},registerDocumentInteractionHandler:function(){},registerInteractionHandler:function(){},registerResizeHandler:function(){},removeClass:function(){},updateCssVariable:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){var t=this,n=this.supportsPressRipple_();if(this.registerRootHandlers_(n),n){var i=e.cssClasses,r=i.ROOT,a=i.UNBOUNDED;requestAnimationFrame((function(){t.adapter_.addClass(r),t.adapter_.isUnbounded()&&(t.adapter_.addClass(a),t.layoutInternal_())}))}},e.prototype.destroy=function(){var t=this;if(this.supportsPressRipple_()){this.activationTimer_&&(clearTimeout(this.activationTimer_),this.activationTimer_=0,this.adapter_.removeClass(e.cssClasses.FG_ACTIVATION)),this.fgDeactivationRemovalTimer_&&(clearTimeout(this.fgDeactivationRemovalTimer_),this.fgDeactivationRemovalTimer_=0,this.adapter_.removeClass(e.cssClasses.FG_DEACTIVATION));var n=e.cssClasses,i=n.ROOT,r=n.UNBOUNDED;requestAnimationFrame((function(){t.adapter_.removeClass(i),t.adapter_.removeClass(r),t.removeCssVars_()}))}this.deregisterRootHandlers_(),this.deregisterDeactivationHandlers_()},e.prototype.activate=function(t){this.activate_(t)},e.prototype.deactivate=function(){this.deactivate_()},e.prototype.layout=function(){var t=this;this.layoutFrame_&&cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=requestAnimationFrame((function(){t.layoutInternal_(),t.layoutFrame_=0}))},e.prototype.setUnbounded=function(t){var n=e.cssClasses.UNBOUNDED;t?this.adapter_.addClass(n):this.adapter_.removeClass(n)},e.prototype.handleFocus=function(){var t=this;requestAnimationFrame((function(){return t.adapter_.addClass(e.cssClasses.BG_FOCUSED)}))},e.prototype.handleBlur=function(){var t=this;requestAnimationFrame((function(){return t.adapter_.removeClass(e.cssClasses.BG_FOCUSED)}))},e.prototype.supportsPressRipple_=function(){return this.adapter_.browserSupportsCssVars()},e.prototype.defaultActivationState_=function(){return{activationEvent:void 0,hasDeactivationUXRun:!1,isActivated:!1,isProgrammatic:!1,wasActivatedByPointer:!1,wasElementMadeActive:!1}},e.prototype.registerRootHandlers_=function(t){var e=this;t&&(h.forEach((function(t){e.adapter_.registerInteractionHandler(t,e.activateHandler_)})),this.adapter_.isUnbounded()&&this.adapter_.registerResizeHandler(this.resizeHandler_)),this.adapter_.registerInteractionHandler("focus",this.focusHandler_),this.adapter_.registerInteractionHandler("blur",this.blurHandler_)},e.prototype.registerDeactivationHandlers_=function(t){var e=this;"keydown"===t.type?this.adapter_.registerInteractionHandler("keyup",this.deactivateHandler_):f.forEach((function(t){e.adapter_.registerDocumentInteractionHandler(t,e.deactivateHandler_)}))},e.prototype.deregisterRootHandlers_=function(){var t=this;h.forEach((function(e){t.adapter_.deregisterInteractionHandler(e,t.activateHandler_)})),this.adapter_.deregisterInteractionHandler("focus",this.focusHandler_),this.adapter_.deregisterInteractionHandler("blur",this.blurHandler_),this.adapter_.isUnbounded()&&this.adapter_.deregisterResizeHandler(this.resizeHandler_)},e.prototype.deregisterDeactivationHandlers_=function(){var t=this;this.adapter_.deregisterInteractionHandler("keyup",this.deactivateHandler_),f.forEach((function(e){t.adapter_.deregisterDocumentInteractionHandler(e,t.deactivateHandler_)}))},e.prototype.removeCssVars_=function(){var t=this,n=e.strings;Object.keys(n).forEach((function(e){0===e.indexOf("VAR_")&&t.adapter_.updateCssVariable(n[e],null)}))},e.prototype.activate_=function(t){var e=this;if(!this.adapter_.isSurfaceDisabled()){var n=this.activationState_;if(!n.isActivated){var i=this.previousActivationEvent_;if(!(i&&void 0!==t&&i.type!==t.type))n.isActivated=!0,n.isProgrammatic=void 0===t,n.activationEvent=t,n.wasActivatedByPointer=!n.isProgrammatic&&(void 0!==t&&("mousedown"===t.type||"touchstart"===t.type||"pointerdown"===t.type)),void 0!==t&&_.length>0&&_.some((function(t){return e.adapter_.containsEventTarget(t)}))?this.resetActivationState_():(void 0!==t&&(_.push(t.target),this.registerDeactivationHandlers_(t)),n.wasElementMadeActive=this.checkElementMadeActive_(t),n.wasElementMadeActive&&this.animateActivation_(),requestAnimationFrame((function(){_=[],n.wasElementMadeActive||void 0===t||" "!==t.key&&32!==t.keyCode||(n.wasElementMadeActive=e.checkElementMadeActive_(t),n.wasElementMadeActive&&e.animateActivation_()),n.wasElementMadeActive||(e.activationState_=e.defaultActivationState_())})))}}},e.prototype.checkElementMadeActive_=function(t){return void 0===t||"keydown"!==t.type||this.adapter_.isSurfaceActive()},e.prototype.animateActivation_=function(){var t=this,n=e.strings,i=n.VAR_FG_TRANSLATE_START,r=n.VAR_FG_TRANSLATE_END,a=e.cssClasses,s=a.FG_DEACTIVATION,o=a.FG_ACTIVATION,c=e.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal_();var d="",u="";if(!this.adapter_.isUnbounded()){var l=this.getFgTranslationCoordinates_(),p=l.startPoint,h=l.endPoint;d=p.x+"px, "+p.y+"px",u=h.x+"px, "+h.y+"px"}this.adapter_.updateCssVariable(i,d),this.adapter_.updateCssVariable(r,u),clearTimeout(this.activationTimer_),clearTimeout(this.fgDeactivationRemovalTimer_),this.rmBoundedActivationClasses_(),this.adapter_.removeClass(s),this.adapter_.computeBoundingRect(),this.adapter_.addClass(o),this.activationTimer_=setTimeout((function(){return t.activationTimerCallback_()}),c)},e.prototype.getFgTranslationCoordinates_=function(){var t,e=this.activationState_,n=e.activationEvent;return{startPoint:t={x:(t=e.wasActivatedByPointer?function(t,e,n){if(!t)return{x:0,y:0};var i,r,a=e.x,s=e.y,o=a+n.left,c=s+n.top;if("touchstart"===t.type){var d=t;i=d.changedTouches[0].pageX-o,r=d.changedTouches[0].pageY-c}else{var u=t;i=u.pageX-o,r=u.pageY-c}return{x:i,y:r}}(n,this.adapter_.getWindowPageOffset(),this.adapter_.computeBoundingRect()):{x:this.frame_.width/2,y:this.frame_.height/2}).x-this.initialSize_/2,y:t.y-this.initialSize_/2},endPoint:{x:this.frame_.width/2-this.initialSize_/2,y:this.frame_.height/2-this.initialSize_/2}}},e.prototype.runDeactivationUXLogicIfReady_=function(){var t=this,n=e.cssClasses.FG_DEACTIVATION,i=this.activationState_,r=i.hasDeactivationUXRun,a=i.isActivated;(r||!a)&&this.activationAnimationHasEnded_&&(this.rmBoundedActivationClasses_(),this.adapter_.addClass(n),this.fgDeactivationRemovalTimer_=setTimeout((function(){t.adapter_.removeClass(n)}),p.FG_DEACTIVATION_MS))},e.prototype.rmBoundedActivationClasses_=function(){var t=e.cssClasses.FG_ACTIVATION;this.adapter_.removeClass(t),this.activationAnimationHasEnded_=!1,this.adapter_.computeBoundingRect()},e.prototype.resetActivationState_=function(){var t=this;this.previousActivationEvent_=this.activationState_.activationEvent,this.activationState_=this.defaultActivationState_(),setTimeout((function(){return t.previousActivationEvent_=void 0}),e.numbers.TAP_DELAY_MS)},e.prototype.deactivate_=function(){var t=this,e=this.activationState_;if(e.isActivated){var n=o({},e);e.isProgrammatic?(requestAnimationFrame((function(){return t.animateDeactivation_(n)})),this.resetActivationState_()):(this.deregisterDeactivationHandlers_(),requestAnimationFrame((function(){t.activationState_.hasDeactivationUXRun=!0,t.animateDeactivation_(n),t.resetActivationState_()})))}},e.prototype.animateDeactivation_=function(t){var e=t.wasActivatedByPointer,n=t.wasElementMadeActive;(e||n)&&this.runDeactivationUXLogicIfReady_()},e.prototype.layoutInternal_=function(){var t=this;this.frame_=this.adapter_.computeBoundingRect();var n=Math.max(this.frame_.height,this.frame_.width);this.maxRadius_=this.adapter_.isUnbounded()?n:Math.sqrt(Math.pow(t.frame_.width,2)+Math.pow(t.frame_.height,2))+e.numbers.PADDING;var i=Math.floor(n*e.numbers.INITIAL_ORIGIN_SCALE);this.adapter_.isUnbounded()&&i%2!=0?this.initialSize_=i-1:this.initialSize_=i,this.fgScale_=""+this.maxRadius_/this.initialSize_,this.updateLayoutCssVars_()},e.prototype.updateLayoutCssVars_=function(){var t=e.strings,n=t.VAR_FG_SIZE,i=t.VAR_LEFT,r=t.VAR_TOP,a=t.VAR_FG_SCALE;this.adapter_.updateCssVariable(n,this.initialSize_+"px"),this.adapter_.updateCssVariable(a,this.fgScale_),this.adapter_.isUnbounded()&&(this.unboundedCoords_={left:Math.round(this.frame_.width/2-this.initialSize_/2),top:Math.round(this.frame_.height/2-this.initialSize_/2)},this.adapter_.updateCssVariable(i,this.unboundedCoords_.left+"px"),this.adapter_.updateCssVariable(r,this.unboundedCoords_.top+"px"))},e}(d);class v extends m{constructor(t,e){super({addClass(e){t.$set(t.classes,e,!0)},browserSupportsCssVars:()=>(function(t,e){void 0===e&&(e=!1);var n=t.CSS,i=c;if("boolean"==typeof c&&!e)return c;if(!(n&&"function"==typeof n.supports))return!1;var r=n.supports("--css-vars","yes"),a=n.supports("(--css-vars: yes)")&&n.supports("color","#00000000");return i=!(!r&&!a)&&!function(t){var e=t.document,n=e.createElement("div");n.className="mdc-ripple-surface--test-edge-var-bug",e.head.appendChild(n);var i=t.getComputedStyle(n),r=null!==i&&"solid"===i.borderTopStyle;return n.parentNode&&n.parentNode.removeChild(n),r}(t),e||(c=i),i})(window),computeBoundingRect:()=>t.$el.getBoundingClientRect(),containsEventTarget:e=>t.$el.contains(e),deregisterDocumentInteractionHandler:(t,e)=>document.documentElement.removeEventListener(t,e,r()),deregisterInteractionHandler:(e,n)=>{t.$el.removeEventListener(e,n,r())},deregisterResizeHandler:t=>window.removeEventListener("resize",t),getWindowPageOffset:()=>({x:window.pageXOffset,y:window.pageYOffset}),isSurfaceActive:()=>a(t.$el,":active"),isSurfaceDisabled:()=>t.disabled,isUnbounded:()=>!1,registerDocumentInteractionHandler:(t,e)=>document.documentElement.addEventListener(t,e,r()),registerInteractionHandler:(e,n)=>{t.$el.addEventListener(e,n,r())},registerResizeHandler:t=>window.addEventListener("resize",t),removeClass(e){t.$delete(t.classes,e)},updateCssVariable:(e,n)=>{t.$set(t.styles,e,n)},...e})}}const I={data:()=>({classes:{},styles:{}}),mounted(){this.ripple=new v(this),this.ripple.init()},beforeDestroy(){this.ripple.destroy()}};n.d(e,"RippleBase",(function(){return v})),n.d(e,"RippleMixin",(function(){return I}))},16:function(t,e,n){var i,r,a=n(44),s=n(45),o=(r=[],{activateTrap:function(t){if(r.length>0){var e=r[r.length-1];e!==t&&e.pause()}var n=r.indexOf(t);-1===n?r.push(t):(r.splice(n,1),r.push(t))},deactivateTrap:function(t){var e=r.indexOf(t);-1!==e&&r.splice(e,1),r.length>0&&r[r.length-1].unpause()}});function c(t){return setTimeout(t,0)}t.exports=function(t,e){var n=document,r="string"==typeof t?n.querySelector(t):t,d=s({returnFocusOnDeactivate:!0,escapeDeactivates:!0},e),u={firstTabbableNode:null,lastTabbableNode:null,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1},l={activate:function(t){if(u.active)return;y(),u.active=!0,u.paused=!1,u.nodeFocusedBeforeActivation=n.activeElement;var e=t&&t.onActivate?t.onActivate:d.onActivate;e&&e();return h(),l},deactivate:p,pause:function(){if(u.paused||!u.active)return;u.paused=!0,f()},unpause:function(){if(!u.paused||!u.active)return;u.paused=!1,y(),h()}};return l;function p(t){if(u.active){clearTimeout(i),f(),u.active=!1,u.paused=!1,o.deactivateTrap(l);var e=t&&void 0!==t.onDeactivate?t.onDeactivate:d.onDeactivate;return e&&e(),(t&&void 0!==t.returnFocus?t.returnFocus:d.returnFocusOnDeactivate)&&c((function(){var t;g((t=u.nodeFocusedBeforeActivation,_("setReturnFocus")||t))})),l}}function h(){if(u.active)return o.activateTrap(l),i=c((function(){g(m())})),n.addEventListener("focusin",I,!0),n.addEventListener("mousedown",v,{capture:!0,passive:!1}),n.addEventListener("touchstart",v,{capture:!0,passive:!1}),n.addEventListener("click",A,{capture:!0,passive:!1}),n.addEventListener("keydown",E,{capture:!0,passive:!1}),l}function f(){if(u.active)return n.removeEventListener("focusin",I,!0),n.removeEventListener("mousedown",v,!0),n.removeEventListener("touchstart",v,!0),n.removeEventListener("click",A,!0),n.removeEventListener("keydown",E,!0),l}function _(t){var e=d[t],i=e;if(!e)return null;if("string"==typeof e&&!(i=n.querySelector(e)))throw new Error("`"+t+"` refers to no known node");if("function"==typeof e&&!(i=e()))throw new Error("`"+t+"` did not return a node");return i}function m(){var t;if(!(t=null!==_("initialFocus")?_("initialFocus"):r.contains(n.activeElement)?n.activeElement:u.firstTabbableNode||_("fallbackFocus")))throw new Error("Your focus-trap needs to have at least one focusable element");return t}function v(t){r.contains(t.target)||(d.clickOutsideDeactivates?p({returnFocus:!a.isFocusable(t.target)}):d.allowOutsideClick&&d.allowOutsideClick(t)||t.preventDefault())}function I(t){r.contains(t.target)||t.target instanceof Document||(t.stopImmediatePropagation(),g(u.mostRecentlyFocusedNode||m()))}function E(t){if(!1!==d.escapeDeactivates&&function(t){return"Escape"===t.key||"Esc"===t.key||27===t.keyCode}(t))return t.preventDefault(),void p();(function(t){return"Tab"===t.key||9===t.keyCode})(t)&&function(t){if(y(),t.shiftKey&&t.target===u.firstTabbableNode)return t.preventDefault(),void g(u.lastTabbableNode);if(!t.shiftKey&&t.target===u.lastTabbableNode)t.preventDefault(),g(u.firstTabbableNode)}(t)}function A(t){d.clickOutsideDeactivates||r.contains(t.target)||d.allowOutsideClick&&d.allowOutsideClick(t)||(t.preventDefault(),t.stopImmediatePropagation())}function y(){var t=a(r);u.firstTabbableNode=t[0]||m(),u.lastTabbableNode=t[t.length-1]||m()}function g(t){t!==n.activeElement&&(t&&t.focus?(t.focus(),u.mostRecentlyFocusedNode=t,function(t){return t.tagName&&"input"===t.tagName.toLowerCase()&&"function"==typeof t.select}(t)&&t.select()):g(m()))}}},42:function(t,e,n){n(43),t.exports=n(92)},43:function(t,e,n){},44:function(t,e){var n=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'],i=n.join(","),r="undefined"==typeof Element?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;function a(t,e){e=e||{};var n,a,o,c=[],l=[],p=t.querySelectorAll(i);for(e.includeContainer&&r.call(t,i)&&(p=Array.prototype.slice.apply(p)).unshift(t),n=0;n<p.length;n++)s(a=p[n])&&(0===(o=d(a))?c.push(a):l.push({documentOrder:n,tabIndex:o,node:a}));return l.sort(u).map((function(t){return t.node})).concat(c)}function s(t){return!(!o(t)||function(t){return function(t){return l(t)&&"radio"===t.type}(t)&&!function(t){if(!t.name)return!0;var e=function(t){for(var e=0;e<t.length;e++)if(t[e].checked)return t[e]}(t.ownerDocument.querySelectorAll('input[type="radio"][name="'+t.name+'"]'));return!e||e===t}(t)}(t)||d(t)<0)}function o(t){return!(t.disabled||function(t){return l(t)&&"hidden"===t.type}(t)||function(t){return null===t.offsetParent||"hidden"===getComputedStyle(t).visibility}(t))}a.isTabbable=function(t){if(!t)throw new Error("No node provided");return!1!==r.call(t,i)&&s(t)},a.isFocusable=function(t){if(!t)throw new Error("No node provided");return!1!==r.call(t,c)&&o(t)};var c=n.concat("iframe").join(",");function d(t){var e=parseInt(t.getAttribute("tabindex"),10);return isNaN(e)?function(t){return"true"===t.contentEditable}(t)?0:t.tabIndex:e}function u(t,e){return t.tabIndex===e.tabIndex?t.documentOrder-e.documentOrder:t.tabIndex-e.tabIndex}function l(t){return"INPUT"===t.tagName}t.exports=a},45:function(t,e){t.exports=function(){for(var t={},e=0;e<arguments.length;e++){var i=arguments[e];for(var r in i)n.call(i,r)&&(t[r]=i[r])}return t};var n=Object.prototype.hasOwnProperty},92:function(t,e,n){"use strict";n.r(e);var i=n(16),r=n.n(i);
/*! *****************************************************************************

@@ -109,0 +109,0 @@ Copyright (c) Microsoft Corporation. All rights reserved.

{
"name": "@mcwv/drawer",
"description": "The Vue Material Adapter for the web drawer component",
"version": "0.14.0-alpha.1",
"version": "0.14.0-alpha.2",
"license": "MIT",

@@ -20,6 +20,6 @@ "main": "dist/mcwv.drawer.min.js",

"@material/drawer": "^4.0.0",
"@mcwv/base": "^0.14.0-alpha.1",
"@mcwv/ripple": "^0.14.0-alpha.1"
"@mcwv/base": "^0.14.0-alpha.2",
"@mcwv/ripple": "^0.14.0-alpha.2"
},
"gitHead": "c9caef4b2854d34ded429a1ec4210d955e9732d3"
"gitHead": "b7aac5aaadf2e4e090710ea12c502e20bff8b1f1"
}

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