@mcwv/checkbox
Advanced tools
Comparing version 0.6.0 to 0.7.0
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.checkbox=e():(t.mcwv=t.mcwv||{},t.mcwv.checkbox=e())}(window,function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var a=e[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,i),a.l=!0,a.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)i.d(n,a,function(e){return t[e]}.bind(null,a));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=34)}({1:function(t,e,i){"use strict"; | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.checkbox=e():(t.mcwv=t.mcwv||{},t.mcwv.checkbox=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=22)}({1:function(t,e,n){"use strict";function i(t,e){return(t.matches||t.webkitMatchesSelector||t.msMatchesSelector).call(t,e)} | ||
/*! ***************************************************************************** | ||
@@ -15,3 +15,3 @@ Copyright (c) Microsoft Corporation. All rights reserved. | ||
and limitations under the License. | ||
***************************************************************************** */var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};var a=function(){return(a=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var a in e=arguments[i])Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t}).apply(this,arguments)}; | ||
***************************************************************************** */n.r(e);var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var a=function(){return(a=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)}; | ||
/** | ||
@@ -39,3 +39,3 @@ * @license | ||
*/ | ||
var r=function(){function t(t){void 0===t&&(t={}),this.adapter_=t}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!0,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}(),o={ROOT:"mdc-form-field"},s={LABEL_SELECTOR:".mdc-form-field > label"},c=function(t){function e(i){var n=t.call(this,a({},e.defaultAdapter,i))||this;return n.clickHandler_=function(){return n.handleClick_()},n}return function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return o},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return s},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{activateInputRipple:function(){},deactivateInputRipple:function(){},deregisterInteractionHandler:function(){},registerInteractionHandler:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){this.adapter_.registerInteractionHandler("click",this.clickHandler_)},e.prototype.destroy=function(){this.adapter_.deregisterInteractionHandler("click",this.clickHandler_)},e.prototype.handleClick_=function(){var t=this;this.adapter_.activateInputRipple(),requestAnimationFrame(function(){return t.adapter_.deactivateInputRipple()})},e}(r);e.a=c},34:function(t,e,i){i(97),t.exports=i(35)},35:function(t,e,i){},97:function(t,e,i){"use strict";i.r(e); | ||
var o,s,c=function(){function t(t){void 0===t&&(t={}),this.adapter_=t}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!0,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}(),d={BG_FOCUSED:"mdc-ripple-upgraded--background-focused",FG_ACTIVATION:"mdc-ripple-upgraded--foreground-activation",FG_DEACTIVATION:"mdc-ripple-upgraded--foreground-deactivation",ROOT:"mdc-ripple-upgraded",UNBOUNDED:"mdc-ripple-upgraded--unbounded"},u={VAR_FG_SCALE:"--mdc-ripple-fg-scale",VAR_FG_SIZE:"--mdc-ripple-fg-size",VAR_FG_TRANSLATE_END:"--mdc-ripple-fg-translate-end",VAR_FG_TRANSLATE_START:"--mdc-ripple-fg-translate-start",VAR_LEFT:"--mdc-ripple-left",VAR_TOP:"--mdc-ripple-top"},l={DEACTIVATION_TIMEOUT_MS:225,FG_DEACTIVATION_MS:150,INITIAL_ORIGIN_SCALE:.6,PADDING:10,TAP_DELAY_MS:300};function h(t,e){if(void 0===t&&(t=window),void 0===e&&(e=!1),void 0===s||e){var n=!1;try{t.document.addEventListener("test",function(){},{get passive(){return n=!0}})}catch(t){}s=n}return!!s&&{passive:!0}} | ||
/** | ||
@@ -63,3 +63,3 @@ * @license | ||
*/ | ||
var n={animationend:{cssProperty:"animation",prefixed:"webkitAnimationEnd",standard:"animationend"},animationiteration:{cssProperty:"animation",prefixed:"webkitAnimationIteration",standard:"animationiteration"},animationstart:{cssProperty:"animation",prefixed:"webkitAnimationStart",standard:"animationstart"},transitionend:{cssProperty:"transition",prefixed:"webkitTransitionEnd",standard:"transitionend"}};function a(t){return Boolean(t.document)&&"function"==typeof t.document.createElement}function r(t,e){if(a(t)&&e in n){var i=t.document.createElement("div"),r=n[e],o=r.standard,s=r.prefixed;return r.cssProperty in i.style?o:s}return e} | ||
var p=["touchstart","pointerdown","mousedown","keydown"],f=["touchend","pointerup","mouseup","contextmenu"],_=[],m=function(t){function e(n){var i=t.call(this,a({},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}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return d},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return u},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return l},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&&(p.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;p.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,o=a.FG_DEACTIVATION,s=a.FG_ACTIVATION,c=e.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal_();var d="",u="";if(!this.adapter_.isUnbounded()){var l=this.getFgTranslationCoordinates_(),h=l.startPoint,p=l.endPoint;d=h.x+"px, "+h.y+"px",u=p.x+"px, "+p.y+"px"}this.adapter_.updateCssVariable(i,d),this.adapter_.updateCssVariable(r,u),clearTimeout(this.activationTimer_),clearTimeout(this.fgDeactivationRemovalTimer_),this.rmBoundedActivationClasses_(),this.adapter_.removeClass(o),this.adapter_.computeBoundingRect(),this.adapter_.addClass(s),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,o=e.y,s=a+n.left,c=o+n.top;if("touchstart"===t.type){var d=t;i=d.changedTouches[0].pageX-s,r=d.changedTouches[0].pageY-c}else{var u=t;i=u.pageX-s,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)},l.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=a({},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,this.initialSize_=Math.floor(n*e.numbers.INITIAL_ORIGIN_SCALE),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}(c);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=o;if("boolean"==typeof o&&!e)return o;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.body.appendChild(n);var i=t.getComputedStyle(n),r=null!==i&&"solid"===i.borderTopStyle;return n.parentNode&&n.parentNode.removeChild(n),r}(t)),e||(o=i),i})(window),computeBoundingRect:()=>t.$el.getBoundingClientRect(),containsEventTarget:e=>t.$el.contains(e),deregisterDocumentInteractionHandler:(t,e)=>document.documentElement.removeEventListener(t,e,h()),deregisterInteractionHandler:(e,n)=>{t.$el.removeEventListener(e,n,h())},deregisterResizeHandler:t=>window.removeEventListener("resize",t),getWindowPageOffset:()=>({x:window.pageXOffset,y:window.pageYOffset}),isSurfaceActive:()=>i(t.$el,":active"),isSurfaceDisabled:()=>t.disabled,isUnbounded:()=>!1,registerDocumentInteractionHandler:(t,e)=>document.documentElement.addEventListener(t,e,h()),registerInteractionHandler:(e,n)=>{t.$el.addEventListener(e,n,h())},registerResizeHandler:t=>window.addEventListener("resize",t),removeClass(e){t.$delete(t.classes,e)},updateCssVariable:(e,n)=>{t.$set(t.styles,e,n)},...e})}}const E={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 E})},12:function(t,e,n){"use strict";let i;function r(t=window,e=!1){if(void 0===i||e){let e=!1;try{t.document.addEventListener("test",null,{get passive(){return e={passive:!0}}})}catch(t){}i=e}return i}n.d(e,"a",function(){return r})},14:function(t,e,n){"use strict"; | ||
/*! ***************************************************************************** | ||
@@ -78,3 +78,3 @@ Copyright (c) Microsoft Corporation. All rights reserved. | ||
and limitations under the License. | ||
***************************************************************************** */var o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function s(t,e){function i(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var c=function(){return(c=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var a in e=arguments[i])Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t}).apply(this,arguments)}; | ||
***************************************************************************** */var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var r=function(){return(r=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)}; | ||
/** | ||
@@ -102,27 +102,5 @@ * @license | ||
*/ | ||
var d=function(){function t(t){void 0===t&&(t={}),this.adapter_=t}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!0,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}(),u={ANIM_CHECKED_INDETERMINATE:"mdc-checkbox--anim-checked-indeterminate",ANIM_CHECKED_UNCHECKED:"mdc-checkbox--anim-checked-unchecked",ANIM_INDETERMINATE_CHECKED:"mdc-checkbox--anim-indeterminate-checked",ANIM_INDETERMINATE_UNCHECKED:"mdc-checkbox--anim-indeterminate-unchecked",ANIM_UNCHECKED_CHECKED:"mdc-checkbox--anim-unchecked-checked",ANIM_UNCHECKED_INDETERMINATE:"mdc-checkbox--anim-unchecked-indeterminate",CHECKED:"mdc-checkbox--checked",DISABLED:"mdc-checkbox--disabled",INDETERMINATE:"mdc-checkbox--indeterminate",SELECTED:"mdc-checkbox--selected",UPGRADED:"mdc-checkbox--upgraded"},l={ARIA_CHECKED_ATTR:"aria-checked",ARIA_CHECKED_INDETERMINATE_VALUE:"mixed",NATIVE_CONTROL_SELECTOR:".mdc-checkbox__native-control",TRANSITION_STATE_CHECKED:"checked",TRANSITION_STATE_INDETERMINATE:"indeterminate",TRANSITION_STATE_INIT:"init",TRANSITION_STATE_UNCHECKED:"unchecked"},h={ANIM_END_LATCH_MS:250},p=function(t){function e(i){var n=t.call(this,c({},e.defaultAdapter,i))||this;return n.currentCheckState_=l.TRANSITION_STATE_INIT,n.currentAnimationClass_="",n.animEndLatchTimer_=0,n.enableAnimationEndHandler_=!1,n}return s(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 h},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},forceLayout:function(){},hasNativeControl:function(){return!1},isAttachedToDOM:function(){return!1},isChecked:function(){return!1},isIndeterminate:function(){return!1},removeClass:function(){},removeNativeControlAttr:function(){},setNativeControlAttr:function(){},setNativeControlDisabled:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){this.currentCheckState_=this.determineCheckState_(),this.updateAriaChecked_(),this.adapter_.addClass(u.UPGRADED)},e.prototype.destroy=function(){clearTimeout(this.animEndLatchTimer_)},e.prototype.setDisabled=function(t){this.adapter_.setNativeControlDisabled(t),t?this.adapter_.addClass(u.DISABLED):this.adapter_.removeClass(u.DISABLED)},e.prototype.handleAnimationEnd=function(){var t=this;this.enableAnimationEndHandler_&&(clearTimeout(this.animEndLatchTimer_),this.animEndLatchTimer_=setTimeout(function(){t.adapter_.removeClass(t.currentAnimationClass_),t.enableAnimationEndHandler_=!1},h.ANIM_END_LATCH_MS))},e.prototype.handleChange=function(){this.transitionCheckState_()},e.prototype.transitionCheckState_=function(){if(this.adapter_.hasNativeControl()){var t=this.currentCheckState_,e=this.determineCheckState_();if(t!==e){this.updateAriaChecked_();var i=l.TRANSITION_STATE_UNCHECKED,n=u.SELECTED;e===i?this.adapter_.removeClass(n):this.adapter_.addClass(n),this.currentAnimationClass_.length>0&&(clearTimeout(this.animEndLatchTimer_),this.adapter_.forceLayout(),this.adapter_.removeClass(this.currentAnimationClass_)),this.currentAnimationClass_=this.getTransitionAnimationClass_(t,e),this.currentCheckState_=e,this.adapter_.isAttachedToDOM()&&this.currentAnimationClass_.length>0&&(this.adapter_.addClass(this.currentAnimationClass_),this.enableAnimationEndHandler_=!0)}}},e.prototype.determineCheckState_=function(){var t=l.TRANSITION_STATE_INDETERMINATE,e=l.TRANSITION_STATE_CHECKED,i=l.TRANSITION_STATE_UNCHECKED;return this.adapter_.isIndeterminate()?t:this.adapter_.isChecked()?e:i},e.prototype.getTransitionAnimationClass_=function(t,i){var n=l.TRANSITION_STATE_INIT,a=l.TRANSITION_STATE_CHECKED,r=l.TRANSITION_STATE_UNCHECKED,o=e.cssClasses,s=o.ANIM_UNCHECKED_CHECKED,c=o.ANIM_UNCHECKED_INDETERMINATE,d=o.ANIM_CHECKED_UNCHECKED,u=o.ANIM_CHECKED_INDETERMINATE,h=o.ANIM_INDETERMINATE_CHECKED,p=o.ANIM_INDETERMINATE_UNCHECKED;switch(t){case n:return i===r?"":i===a?h:p;case r:return i===a?s:c;case a:return i===r?d:u;default:return i===a?h:p}},e.prototype.updateAriaChecked_=function(){this.adapter_.isIndeterminate()?this.adapter_.setNativeControlAttr(l.ARIA_CHECKED_ATTR,l.ARIA_CHECKED_INDETERMINATE_VALUE):this.adapter_.removeNativeControlAttr(l.ARIA_CHECKED_ATTR)},e}(d),f=i(1);const _={data:()=>({hasFocus:!1}),methods:{onMouseDown(){this._active=!0},onMouseUp(){this._active=!1},onFocusEvent(){setTimeout(()=>this.dispatchFocusEvent(),0)},onBlurEvent(){this._active||setTimeout(()=>this.dispatchFocusEvent(),0)},dispatchFocusEvent(){const t=this.$el===document.activeElement||this.$el.contains(document.activeElement);t!=this.hasFocus&&(this.$emit(t?"focus":"blur"),this.hasFocus=t)}},mounted(){this.$el.addEventListener("focusin",this.onFocusEvent),this.$el.addEventListener("focusout",this.onBlurEvent),this.$el.addEventListener("mousedown",this.onMouseDown),this.$el.addEventListener("mouseup",this.onMouseUp)},beforeDestroy(){this.$el.removeEventListener("focusin",this.onFocusEvent),this.$el.removeEventListener("focusout",this.onBlurEvent),this.$el.removeEventListener("mousedown",this.onMouseDown),this.$el.removeEventListener("mouseup",this.onMouseUp)}},m=Math.floor(Math.random()*Math.floor(268435456)).toString()+"-",v={beforeCreate(){this.vma_uid_=m+this._uid}};let E;function A(t=window,e=!1){if(void 0===E||e){let e=!1;try{t.document.addEventListener("test",null,{get passive(){return e={passive:!0}}})}catch(t){}E=e}return E} | ||
var a=function(){function t(t){void 0===t&&(t={}),this.adapter_=t}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!0,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}(),o={ROOT:"mdc-form-field"},s={LABEL_SELECTOR:".mdc-form-field > label"},c=function(t){function e(n){var i=t.call(this,r({},e.defaultAdapter,n))||this;return i.clickHandler_=function(){return i.handleClick_()},i}return function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return o},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return s},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{activateInputRipple:function(){},deactivateInputRipple:function(){},deregisterInteractionHandler:function(){},registerInteractionHandler:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){this.adapter_.registerInteractionHandler("click",this.clickHandler_)},e.prototype.destroy=function(){this.adapter_.deregisterInteractionHandler("click",this.clickHandler_)},e.prototype.handleClick_=function(){var t=this;this.adapter_.activateInputRipple(),requestAnimationFrame(function(){return t.adapter_.deactivateInputRipple()})},e}(a);e.a=c},2:function(t,e,n){"use strict";function i(t){return{version:"__VERSION__",install:e=>{Object.entries(t).forEach(([t,n])=>{const i=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),[r,...a]=i.split("-"),o=["mdc",...a].join("-"),s=["mcw",...a].join("-"),c=e.extend(n);e.component(s,c),e.component(o,c)})},components:t}}n.d(e,"a",function(){return i})},22:function(t,e,n){n(87),t.exports=n(23)},23:function(t,e,n){},6:function(t,e,n){"use strict";n.d(e,"a",function(){return r});const i=Math.floor(Math.random()*Math.floor(268435456)).toString()+"-",r={beforeCreate(){this.vma_uid_=i+this._uid}}},87:function(t,e,n){"use strict";n.r(e);var i=n(2),r={animationend:{cssProperty:"animation",prefixed:"webkitAnimationEnd",standard:"animationend"},animationiteration:{cssProperty:"animation",prefixed:"webkitAnimationIteration",standard:"animationiteration"},animationstart:{cssProperty:"animation",prefixed:"webkitAnimationStart",standard:"animationstart"},transitionend:{cssProperty:"transition",prefixed:"webkitTransitionEnd",standard:"transitionend"}}; | ||
/** | ||
* @license | ||
* Copyright 2018 Google Inc. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/function C(t,e){return(t.matches||t.webkitMatchesSelector||t.msMatchesSelector).call(t,e)} | ||
/** | ||
* @license | ||
* Copyright 2016 Google Inc. | ||
@@ -147,3 +125,17 @@ * | ||
* THE SOFTWARE. | ||
*/var b,g,y={BG_FOCUSED:"mdc-ripple-upgraded--background-focused",FG_ACTIVATION:"mdc-ripple-upgraded--foreground-activation",FG_DEACTIVATION:"mdc-ripple-upgraded--foreground-deactivation",ROOT:"mdc-ripple-upgraded",UNBOUNDED:"mdc-ripple-upgraded--unbounded"},T={VAR_FG_SCALE:"--mdc-ripple-fg-scale",VAR_FG_SIZE:"--mdc-ripple-fg-size",VAR_FG_TRANSLATE_END:"--mdc-ripple-fg-translate-end",VAR_FG_TRANSLATE_START:"--mdc-ripple-fg-translate-start",VAR_LEFT:"--mdc-ripple-left",VAR_TOP:"--mdc-ripple-top"},I={DEACTIVATION_TIMEOUT_MS:225,FG_DEACTIVATION_MS:150,INITIAL_ORIGIN_SCALE:.6,PADDING:10,TAP_DELAY_MS:300};function N(t,e){if(void 0===t&&(t=window),void 0===e&&(e=!1),void 0===g||e){var i=!1;try{t.document.addEventListener("test",function(){},{get passive(){return i=!0}})}catch(t){}g=i}return!!g&&{passive:!0}} | ||
*/function a(t){return Boolean(t.document)&&"function"==typeof t.document.createElement}function o(t,e){if(a(t)&&e in r){var n=t.document.createElement("div"),i=r[e],o=i.standard,s=i.prefixed;return i.cssProperty in n.style?o:s}return e} | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use | ||
this file except in compliance with the License. You may obtain a copy of the | ||
License at http://www.apache.org/licenses/LICENSE-2.0 | ||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED | ||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, | ||
MERCHANTABLITY OR NON-INFRINGEMENT. | ||
See the Apache Version 2.0 License for specific language governing permissions | ||
and limitations under the License. | ||
***************************************************************************** */var s=function(t,e){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var c=function(){return(c=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)}; | ||
/** | ||
@@ -171,3 +163,3 @@ * @license | ||
*/ | ||
var D=["touchstart","pointerdown","mousedown","keydown"],S=["touchend","pointerup","mouseup","contextmenu"],O=[],R=function(t){function e(i){var n=t.call(this,c({},e.defaultAdapter,i))||this;return n.activationAnimationHasEnded_=!1,n.activationTimer_=0,n.fgDeactivationRemovalTimer_=0,n.fgScale_="0",n.frame_={width:0,height:0},n.initialSize_=0,n.layoutFrame_=0,n.maxRadius_=0,n.unboundedCoords_={left:0,top:0},n.activationState_=n.defaultActivationState_(),n.activationTimerCallback_=function(){n.activationAnimationHasEnded_=!0,n.runDeactivationUXLogicIfReady_()},n.activateHandler_=function(t){return n.activate_(t)},n.deactivateHandler_=function(){return n.deactivate_()},n.focusHandler_=function(){return n.handleFocus()},n.blurHandler_=function(){return n.handleBlur()},n.resizeHandler_=function(){return n.layout()},n}return s(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return y},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return T},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return I},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,i=this.supportsPressRipple_();if(this.registerRootHandlers_(i),i){var n=e.cssClasses,a=n.ROOT,r=n.UNBOUNDED;requestAnimationFrame(function(){t.adapter_.addClass(a),t.adapter_.isUnbounded()&&(t.adapter_.addClass(r),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 i=e.cssClasses,n=i.ROOT,a=i.UNBOUNDED;requestAnimationFrame(function(){t.adapter_.removeClass(n),t.adapter_.removeClass(a),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 i=e.cssClasses.UNBOUNDED;t?this.adapter_.addClass(i):this.adapter_.removeClass(i)},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&&(D.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_):S.forEach(function(t){e.adapter_.registerDocumentInteractionHandler(t,e.deactivateHandler_)})},e.prototype.deregisterRootHandlers_=function(){var t=this;D.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_),S.forEach(function(e){t.adapter_.deregisterDocumentInteractionHandler(e,t.deactivateHandler_)})},e.prototype.removeCssVars_=function(){var t=this,i=e.strings;Object.keys(i).forEach(function(e){0===e.indexOf("VAR_")&&t.adapter_.updateCssVariable(i[e],null)})},e.prototype.activate_=function(t){var e=this;if(!this.adapter_.isSurfaceDisabled()){var i=this.activationState_;if(!i.isActivated){var n=this.previousActivationEvent_;if(!(n&&void 0!==t&&n.type!==t.type))i.isActivated=!0,i.isProgrammatic=void 0===t,i.activationEvent=t,i.wasActivatedByPointer=!i.isProgrammatic&&(void 0!==t&&("mousedown"===t.type||"touchstart"===t.type||"pointerdown"===t.type)),void 0!==t&&O.length>0&&O.some(function(t){return e.adapter_.containsEventTarget(t)})?this.resetActivationState_():(void 0!==t&&(O.push(t.target),this.registerDeactivationHandlers_(t)),i.wasElementMadeActive=this.checkElementMadeActive_(t),i.wasElementMadeActive&&this.animateActivation_(),requestAnimationFrame(function(){O=[],i.wasElementMadeActive||void 0===t||" "!==t.key&&32!==t.keyCode||(i.wasElementMadeActive=e.checkElementMadeActive_(t),i.wasElementMadeActive&&e.animateActivation_()),i.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,i=e.strings,n=i.VAR_FG_TRANSLATE_START,a=i.VAR_FG_TRANSLATE_END,r=e.cssClasses,o=r.FG_DEACTIVATION,s=r.FG_ACTIVATION,c=e.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal_();var d="",u="";if(!this.adapter_.isUnbounded()){var l=this.getFgTranslationCoordinates_(),h=l.startPoint,p=l.endPoint;d=h.x+"px, "+h.y+"px",u=p.x+"px, "+p.y+"px"}this.adapter_.updateCssVariable(n,d),this.adapter_.updateCssVariable(a,u),clearTimeout(this.activationTimer_),clearTimeout(this.fgDeactivationRemovalTimer_),this.rmBoundedActivationClasses_(),this.adapter_.removeClass(o),this.adapter_.computeBoundingRect(),this.adapter_.addClass(s),this.activationTimer_=setTimeout(function(){return t.activationTimerCallback_()},c)},e.prototype.getFgTranslationCoordinates_=function(){var t,e=this.activationState_,i=e.activationEvent;return{startPoint:t={x:(t=e.wasActivatedByPointer?function(t,e,i){if(!t)return{x:0,y:0};var n,a,r=e.x,o=e.y,s=r+i.left,c=o+i.top;if("touchstart"===t.type){var d=t;n=d.changedTouches[0].pageX-s,a=d.changedTouches[0].pageY-c}else{var u=t;n=u.pageX-s,a=u.pageY-c}return{x:n,y:a}}(i,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,i=e.cssClasses.FG_DEACTIVATION,n=this.activationState_,a=n.hasDeactivationUXRun,r=n.isActivated;(a||!r)&&this.activationAnimationHasEnded_&&(this.rmBoundedActivationClasses_(),this.adapter_.addClass(i),this.fgDeactivationRemovalTimer_=setTimeout(function(){t.adapter_.removeClass(i)},I.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 i=c({},e);e.isProgrammatic?(requestAnimationFrame(function(){return t.animateDeactivation_(i)}),this.resetActivationState_()):(this.deregisterDeactivationHandlers_(),requestAnimationFrame(function(){t.activationState_.hasDeactivationUXRun=!0,t.animateDeactivation_(i),t.resetActivationState_()}))}},e.prototype.animateDeactivation_=function(t){var e=t.wasActivatedByPointer,i=t.wasElementMadeActive;(e||i)&&this.runDeactivationUXLogicIfReady_()},e.prototype.layoutInternal_=function(){var t=this;this.frame_=this.adapter_.computeBoundingRect();var i=Math.max(this.frame_.height,this.frame_.width);this.maxRadius_=this.adapter_.isUnbounded()?i:Math.sqrt(Math.pow(t.frame_.width,2)+Math.pow(t.frame_.height,2))+e.numbers.PADDING,this.initialSize_=Math.floor(i*e.numbers.INITIAL_ORIGIN_SCALE),this.fgScale_=""+this.maxRadius_/this.initialSize_,this.updateLayoutCssVars_()},e.prototype.updateLayoutCssVars_=function(){var t=e.strings,i=t.VAR_FG_SIZE,n=t.VAR_LEFT,a=t.VAR_TOP,r=t.VAR_FG_SCALE;this.adapter_.updateCssVariable(i,this.initialSize_+"px"),this.adapter_.updateCssVariable(r,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(n,this.unboundedCoords_.left+"px"),this.adapter_.updateCssVariable(a,this.unboundedCoords_.top+"px"))},e}(d);class k extends R{constructor(t,e){super({addClass(e){t.$set(t.classes,e,!0)},browserSupportsCssVars:()=>(function(t,e){void 0===e&&(e=!1);var i=t.CSS,n=b;if("boolean"==typeof b&&!e)return b;if(!i||"function"!=typeof i.supports)return!1;var a=i.supports("--css-vars","yes"),r=i.supports("(--css-vars: yes)")&&i.supports("color","#00000000");return n=!(!a&&!r||function(t){var e=t.document,i=e.createElement("div");i.className="mdc-ripple-surface--test-edge-var-bug",e.body.appendChild(i);var n=t.getComputedStyle(i),a=null!==n&&"solid"===n.borderTopStyle;return i.remove(),a}(t)),e||(b=n),n})(window),computeBoundingRect:()=>t.$el.getBoundingClientRect(),containsEventTarget:e=>t.$el.contains(e),deregisterDocumentInteractionHandler:(t,e)=>document.documentElement.removeEventListener(t,e,N()),deregisterInteractionHandler:(e,i)=>{t.$el.removeEventListener(e,i,N())},deregisterResizeHandler:t=>window.removeEventListener("resize",t),getWindowPageOffset:()=>({x:window.pageXOffset,y:window.pageYOffset}),isSurfaceActive:()=>C(t.$el,":active"),isSurfaceDisabled:()=>t.disabled,isUnbounded:()=>!1,registerDocumentInteractionHandler:(t,e)=>document.documentElement.addEventListener(t,e,N()),registerInteractionHandler:(e,i)=>{t.$el.addEventListener(e,i,N())},registerResizeHandler:t=>window.addEventListener("resize",t),removeClass(e){t.$delete(t.classes,e)},updateCssVariable:(e,i)=>{t.$set(t.styles,e,i)},...e})}}const H=["checked","indeterminate"];var w={name:"mcw-checkbox",mixins:[_,v],model:{prop:"checked",event:"change"},props:{checked:[Boolean,Array],indeterminate:Boolean,disabled:Boolean,label:String,"align-end":Boolean,value:{type:[String,Number],default:()=>"on"},name:String},data:()=>({styles:{},classes:{"mdc-checkbox":1}}),computed:{hasLabel(){return this.label||this.$slots.default},formFieldClasses(){return{"mdc-form-field":this.hasLabel,"mdc-form-field--align-end":this.hasLabel&&this.alignEnd}}},watch:{checked:"setChecked",disabled(t){this.foundation.setDisabled(t)},indeterminate:"setIndeterminate"},mounted(){const t={addClass:t=>this.$set(this.classes,t,!0),removeClass:t=>this.$delete(this.classes,t),setNativeControlAttr:(t,e)=>{this.$refs.control.setAttribute(t,e)},removeNativeControlAttr:t=>{this.$refs.control.removeAttribute(t)},isIndeterminate:()=>this.$refs.control.indeterminate,isChecked:()=>this.$refs.control.checked,hasNativeControl:()=>!0,setNativeControlDisabled:t=>this.$refs.control.disabled=t,forceLayout:()=>this.$refs.root.offsetWidth,isAttachedToDOM:()=>!0};this.foundation=new p(t),this.handleAnimationEnd_=(()=>this.foundation.handleAnimationEnd()),this.$el.addEventListener(r(window,"animationend"),this.handleAnimationEnd_),this.installPropertyChangeHooks_(),this.ripple=new k(this,{isUnbounded:()=>!0,isSurfaceActive:()=>k.isSurfaceActive(this.$refs.control),registerInteractionHandler:(t,e)=>{this.$refs.control.addEventListener(t,e,A())},deregisterInteractionHandler:(t,e)=>{this.$refs.control.removeEventListener(t,e,A())},computeBoundingRect:()=>this.$refs.root.getBoundingClientRect()}),this.formField=new f.a({registerInteractionHandler:(t,e)=>{this.$refs.label.addEventListener(t,e)},deregisterInteractionHandler:(t,e)=>{this.$refs.label.removeEventListener(t,e)},activateInputRipple:()=>{this.ripple&&this.ripple.activate()},deactivateInputRipple:()=>{this.ripple&&this.ripple.deactivate()}}),this.foundation.init(),this.ripple.init(),this.formField.init(),this.setChecked(this.checked),this.foundation.setDisabled(this.disabled),this.setIndeterminate(this.indeterminate)},beforeDestroy(){this.$el.removeEventListener(r(window,"animationend"),this.handleAnimationEnd_),this.formField.destroy(),this.ripple.destroy(),this.uninstallPropertyChangeHooks_(),this.foundation.destroy()},methods:{setChecked(t){this.$refs.control.checked=Array.isArray(t)?t.indexOf(this.value)>-1:t},setIndeterminate(t){this.$refs.control.indeterminate=t},onChange(t,e){if(this.$emit("update:indeterminate",e),Array.isArray(this.checked)){const e=this.checked.indexOf(this.value);t?e<0&&this.$emit("change",this.checked.concat(this.value)):e>-1&&this.$emit("change",this.checked.slice(0,e).concat(this.checked.slice(e+1)))}else this.$emit("change",t)},installPropertyChangeHooks_(){const t=this.$refs.control,e=Object.getPrototypeOf(t);H.forEach(i=>{const n=Object.getOwnPropertyDescriptor(e,i);if(M(n)){const e={get:n.get,set:e=>{n.set.call(t,e),this.foundation.handleChange()},configurable:n.configurable,enumerable:n.enumerable};Object.defineProperty(t,i,e)}})},uninstallPropertyChangeHooks_(){const t=this.$refs.control,e=Object.getPrototypeOf(t);H.forEach(i=>{const n=Object.getOwnPropertyDescriptor(e,i);M(n)&&Object.defineProperty(t,i,n)})}},render(t){const{$scopedSlots:e}=this,i=t("input",{attrs:{name:this.name,value:this.value,type:"checkbox",id:this.vma_uid_,disabled:this.disabled},class:{"mdc-checkbox__native-control":1},on:{change:({target:{indeterminate:t,checked:e}})=>this.onChange(e,t)},ref:"control"}),n=t("div",{class:{"mdc-checkbox__background":1}},[t("svg",{class:{"mdc-checkbox__checkmark":1},attrs:{viewBox:"0 0 24 24"}},[t("path",{class:{"mdc-checkbox__checkmark-path":1},attrs:{fill:"none",stroke:"white",d:"M1.73,12.91 8.1,19.28 22.79,4.59"}})]),t("div",{class:{"mdc-checkbox__mixedmark":1}})]),a=t("div",{class:this.classes,style:this.styles,ref:"root"},[i,n]),r=t("label",{attrs:{for:this.vma_uid_},ref:"label"},e.default&&e.default()||this.label);return t("div",{class:this.formFieldClasses},[a,r])}};function M(t){return!!t&&"function"==typeof t.set}i.d(e,"mcwCheckbox",function(){return w});var x;e.default={version:"__VERSION__",install:t=>{Object.entries(x).forEach(([e,i])=>{const n=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),[a,...r]=n.split("-"),o=["mdc",...r].join("-"),s=["mcw",...r].join("-"),c=t.extend(i);t.component(s,c),t.component(o,c)})},components:x={mcwCheckbox:w}}}})}); | ||
var d=function(){function t(t){void 0===t&&(t={}),this.adapter_=t}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!0,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}(),u={ANIM_CHECKED_INDETERMINATE:"mdc-checkbox--anim-checked-indeterminate",ANIM_CHECKED_UNCHECKED:"mdc-checkbox--anim-checked-unchecked",ANIM_INDETERMINATE_CHECKED:"mdc-checkbox--anim-indeterminate-checked",ANIM_INDETERMINATE_UNCHECKED:"mdc-checkbox--anim-indeterminate-unchecked",ANIM_UNCHECKED_CHECKED:"mdc-checkbox--anim-unchecked-checked",ANIM_UNCHECKED_INDETERMINATE:"mdc-checkbox--anim-unchecked-indeterminate",BACKGROUND:"mdc-checkbox__background",CHECKED:"mdc-checkbox--checked",CHECKMARK:"mdc-checkbox__checkmark",CHECKMARK_PATH:"mdc-checkbox__checkmark-path",DISABLED:"mdc-checkbox--disabled",INDETERMINATE:"mdc-checkbox--indeterminate",MIXEDMARK:"mdc-checkbox__mixedmark",NATIVE_CONTROL:"mdc-checkbox__native-control",ROOT:"mdc-checkbox",SELECTED:"mdc-checkbox--selected",UPGRADED:"mdc-checkbox--upgraded"},l={ARIA_CHECKED_ATTR:"aria-checked",ARIA_CHECKED_INDETERMINATE_VALUE:"mixed",NATIVE_CONTROL_SELECTOR:".mdc-checkbox__native-control",TRANSITION_STATE_CHECKED:"checked",TRANSITION_STATE_INDETERMINATE:"indeterminate",TRANSITION_STATE_INIT:"init",TRANSITION_STATE_UNCHECKED:"unchecked"},h={ANIM_END_LATCH_MS:250},p=function(t){function e(n){var i=t.call(this,c({},e.defaultAdapter,n))||this;return i.currentCheckState_=l.TRANSITION_STATE_INIT,i.currentAnimationClass_="",i.animEndLatchTimer_=0,i.enableAnimationEndHandler_=!1,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 h},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},forceLayout:function(){},hasNativeControl:function(){return!1},isAttachedToDOM:function(){return!1},isChecked:function(){return!1},isIndeterminate:function(){return!1},removeClass:function(){},removeNativeControlAttr:function(){},setNativeControlAttr:function(){},setNativeControlDisabled:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){this.currentCheckState_=this.determineCheckState_(),this.updateAriaChecked_(),this.adapter_.addClass(u.UPGRADED)},e.prototype.destroy=function(){clearTimeout(this.animEndLatchTimer_)},e.prototype.setDisabled=function(t){this.adapter_.setNativeControlDisabled(t),t?this.adapter_.addClass(u.DISABLED):this.adapter_.removeClass(u.DISABLED)},e.prototype.handleAnimationEnd=function(){var t=this;this.enableAnimationEndHandler_&&(clearTimeout(this.animEndLatchTimer_),this.animEndLatchTimer_=setTimeout(function(){t.adapter_.removeClass(t.currentAnimationClass_),t.enableAnimationEndHandler_=!1},h.ANIM_END_LATCH_MS))},e.prototype.handleChange=function(){this.transitionCheckState_()},e.prototype.transitionCheckState_=function(){if(this.adapter_.hasNativeControl()){var t=this.currentCheckState_,e=this.determineCheckState_();if(t!==e){this.updateAriaChecked_();var n=l.TRANSITION_STATE_UNCHECKED,i=u.SELECTED;e===n?this.adapter_.removeClass(i):this.adapter_.addClass(i),this.currentAnimationClass_.length>0&&(clearTimeout(this.animEndLatchTimer_),this.adapter_.forceLayout(),this.adapter_.removeClass(this.currentAnimationClass_)),this.currentAnimationClass_=this.getTransitionAnimationClass_(t,e),this.currentCheckState_=e,this.adapter_.isAttachedToDOM()&&this.currentAnimationClass_.length>0&&(this.adapter_.addClass(this.currentAnimationClass_),this.enableAnimationEndHandler_=!0)}}},e.prototype.determineCheckState_=function(){var t=l.TRANSITION_STATE_INDETERMINATE,e=l.TRANSITION_STATE_CHECKED,n=l.TRANSITION_STATE_UNCHECKED;return this.adapter_.isIndeterminate()?t:this.adapter_.isChecked()?e:n},e.prototype.getTransitionAnimationClass_=function(t,n){var i=l.TRANSITION_STATE_INIT,r=l.TRANSITION_STATE_CHECKED,a=l.TRANSITION_STATE_UNCHECKED,o=e.cssClasses,s=o.ANIM_UNCHECKED_CHECKED,c=o.ANIM_UNCHECKED_INDETERMINATE,d=o.ANIM_CHECKED_UNCHECKED,u=o.ANIM_CHECKED_INDETERMINATE,h=o.ANIM_INDETERMINATE_CHECKED,p=o.ANIM_INDETERMINATE_UNCHECKED;switch(t){case i:return n===a?"":n===r?h:p;case a:return n===r?s:c;case r:return n===a?d:u;default:return n===r?h:p}},e.prototype.updateAriaChecked_=function(){this.adapter_.isIndeterminate()?this.adapter_.setNativeControlAttr(l.ARIA_CHECKED_ATTR,l.ARIA_CHECKED_INDETERMINATE_VALUE):this.adapter_.removeNativeControlAttr(l.ARIA_CHECKED_ATTR)},e}(d),f=n(14),_=n(9),m=n(6),v=n(12),E=n(1);const A=["checked","indeterminate"];var b={name:"mcw-checkbox",mixins:[_.a,m.a],model:{prop:"checked",event:"change"},props:{checked:[Boolean,Array],indeterminate:Boolean,disabled:Boolean,label:String,"align-end":Boolean,value:{type:[String,Number],default:()=>"on"},name:String},data:()=>({styles:{},classes:{"mdc-checkbox":1}}),computed:{hasLabel(){return this.label||this.$slots.default},formFieldClasses(){return{"mdc-form-field":this.hasLabel,"mdc-form-field--align-end":this.hasLabel&&this.alignEnd}}},watch:{checked:"setChecked",disabled(t){this.foundation.setDisabled(t)},indeterminate:"setIndeterminate"},mounted(){const t={addClass:t=>this.$set(this.classes,t,!0),removeClass:t=>this.$delete(this.classes,t),setNativeControlAttr:(t,e)=>{this.$refs.control.setAttribute(t,e)},removeNativeControlAttr:t=>{this.$refs.control.removeAttribute(t)},isIndeterminate:()=>this.$refs.control.indeterminate,isChecked:()=>this.$refs.control.checked,hasNativeControl:()=>!0,setNativeControlDisabled:t=>this.$refs.control.disabled=t,forceLayout:()=>this.$refs.root.offsetWidth,isAttachedToDOM:()=>!0};this.foundation=new p(t),this.handleAnimationEnd_=(()=>this.foundation.handleAnimationEnd()),this.$el.addEventListener(o(window,"animationend"),this.handleAnimationEnd_),this.installPropertyChangeHooks_(),this.ripple=new E.RippleBase(this,{isUnbounded:()=>!0,isSurfaceActive:()=>E.RippleBase.isSurfaceActive(this.$refs.control),registerInteractionHandler:(t,e)=>{this.$refs.control.addEventListener(t,e,Object(v.a)())},deregisterInteractionHandler:(t,e)=>{this.$refs.control.removeEventListener(t,e,Object(v.a)())},computeBoundingRect:()=>this.$refs.root.getBoundingClientRect()}),this.formField=new f.a({registerInteractionHandler:(t,e)=>{this.$refs.label.addEventListener(t,e)},deregisterInteractionHandler:(t,e)=>{this.$refs.label.removeEventListener(t,e)},activateInputRipple:()=>{this.ripple&&this.ripple.activate()},deactivateInputRipple:()=>{this.ripple&&this.ripple.deactivate()}}),this.foundation.init(),this.ripple.init(),this.formField.init(),this.setChecked(this.checked),this.foundation.setDisabled(this.disabled),this.setIndeterminate(this.indeterminate)},beforeDestroy(){this.$el.removeEventListener(o(window,"animationend"),this.handleAnimationEnd_),this.formField.destroy(),this.ripple.destroy(),this.uninstallPropertyChangeHooks_(),this.foundation.destroy()},methods:{setChecked(t){this.$refs.control.checked=Array.isArray(t)?t.indexOf(this.value)>-1:t},setIndeterminate(t){this.$refs.control.indeterminate=t},onChange(t,e){if(this.$emit("update:indeterminate",e),Array.isArray(this.checked)){const e=this.checked.indexOf(this.value);t?e<0&&this.$emit("change",this.checked.concat(this.value)):e>-1&&this.$emit("change",this.checked.slice(0,e).concat(this.checked.slice(e+1)))}else this.$emit("change",t)},installPropertyChangeHooks_(){const t=this.$refs.control,e=Object.getPrototypeOf(t);A.forEach(n=>{const i=Object.getOwnPropertyDescriptor(e,n);if(C(i)){const e={get:i.get,set:e=>{i.set.call(t,e),this.foundation.handleChange()},configurable:i.configurable,enumerable:i.enumerable};Object.defineProperty(t,n,e)}})},uninstallPropertyChangeHooks_(){const t=this.$refs.control,e=Object.getPrototypeOf(t);A.forEach(n=>{const i=Object.getOwnPropertyDescriptor(e,n);C(i)&&Object.defineProperty(t,n,i)})}},render(t){const{$scopedSlots:e}=this,n=t("input",{attrs:{name:this.name,value:this.value,type:"checkbox",id:this.vma_uid_,disabled:this.disabled},class:{"mdc-checkbox__native-control":1},on:{change:({target:{indeterminate:t,checked:e}})=>this.onChange(e,t)},ref:"control"}),i=t("div",{class:{"mdc-checkbox__background":1}},[t("svg",{class:{"mdc-checkbox__checkmark":1},attrs:{viewBox:"0 0 24 24"}},[t("path",{class:{"mdc-checkbox__checkmark-path":1},attrs:{fill:"none",stroke:"white",d:"M1.73,12.91 8.1,19.28 22.79,4.59"}})]),t("div",{class:{"mdc-checkbox__mixedmark":1}})]),r=t("div",{class:this.classes,style:this.styles,ref:"root"},[n,i]),a=t("label",{attrs:{for:this.vma_uid_},ref:"label"},e.default&&e.default()||this.label);return t("div",{class:this.formFieldClasses},[r,a])}};function C(t){return!!t&&"function"==typeof t.set}n.d(e,"mcwCheckbox",function(){return b});e.default=Object(i.a)({mcwCheckbox:b})},9:function(t,e,n){"use strict";n.d(e,"a",function(){return i});const i={data:()=>({hasFocus:!1}),methods:{onMouseDown(){this._active=!0},onMouseUp(){this._active=!1},onFocusEvent(){setTimeout(()=>this.dispatchFocusEvent(),0)},onBlurEvent(){this._active||setTimeout(()=>this.dispatchFocusEvent(),0)},dispatchFocusEvent(){const t=this.$el===document.activeElement||this.$el.contains(document.activeElement);t!=this.hasFocus&&(this.$emit(t?"focus":"blur"),this.hasFocus=t)}},mounted(){this.$el.addEventListener("focusin",this.onFocusEvent),this.$el.addEventListener("focusout",this.onBlurEvent),this.$el.addEventListener("mousedown",this.onMouseDown),this.$el.addEventListener("mouseup",this.onMouseUp)},beforeDestroy(){this.$el.removeEventListener("focusin",this.onFocusEvent),this.$el.removeEventListener("focusout",this.onBlurEvent),this.$el.removeEventListener("mousedown",this.onMouseDown),this.$el.removeEventListener("mouseup",this.onMouseUp)}}}})}); | ||
//# sourceMappingURL=mcwv.checkbox.min.js.map |
{ | ||
"name": "@mcwv/checkbox", | ||
"description": "The Vue Material Adapter for the web checkbox component", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"license": "MIT", | ||
@@ -19,7 +19,7 @@ "main": "dist/mcwv.checkbox.min.js", | ||
"dependencies": { | ||
"@material/checkbox": "^2.0.0", | ||
"@mcwv/base": "^0.6.0", | ||
"@mcwv/ripple": "^0.6.0" | ||
"@material/checkbox": "^2.1.1", | ||
"@mcwv/base": "^0.7.0", | ||
"@mcwv/ripple": "^0.7.0" | ||
}, | ||
"gitHead": "b4b5320b2cf791973fd7f1a8e10f13bc8ee2fbda" | ||
"gitHead": "fe1cab8fef95d889a6cffd4b573f85f865386e96" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
212693
555
+ Added@mcwv/base@0.7.0(transitive)
+ Added@mcwv/ripple@0.7.0(transitive)
- Removed@mcwv/base@0.6.0(transitive)
- Removed@mcwv/ripple@0.6.0(transitive)
Updated@material/checkbox@^2.1.1
Updated@mcwv/base@^0.7.0
Updated@mcwv/ripple@^0.7.0