@mcwv/chips
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.chips=e():(t.mcwv=t.mcwv||{},t.mcwv.chips=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=36)}({36:function(t,e,i){i(95),t.exports=i(37)},37:function(t,e,i){},95:function(t,e,i){"use strict";i.r(e);var n={name:"mcw-chip-checkmark",data:()=>({width:0}),render:t=>t("div",{class:{"mdc-chip__checkmark":1}},[t("svg",{class:{"mdc-chip__checkmark-svg":1},attrs:{viewBox:"-2 -3 30 30"}},[t("path",{class:{"mdc-chip__checkmark-path":1},attrs:{fill:"none",stroke:"black",d:"M1.73,12.91 8.1,19.28 22.79,4.59"}})])]),mounted(){this.width=this.$el.getBoundingClientRect().height}},a=function(t,e){return(a=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(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.chips=e():(t.mcwv=t.mcwv||{},t.mcwv.chips=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=24)}({1:function(t,e,i){"use strict";function n(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. | ||
***************************************************************************** */function r(t,e){function i(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var o=function(){return(o=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)}; | ||
***************************************************************************** */i.r(e);var a=function(t,e){return(a=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 r=function(){return(r=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)}; | ||
/** | ||
@@ -39,27 +39,5 @@ * @license | ||
*/ | ||
var s=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}(),c={CHIP_SELECTOR:".mdc-chip"},d={CHOICE:"mdc-chip-set--choice",FILTER:"mdc-chip-set--filter"},l=function(t){function e(i){var n=t.call(this,o({},e.defaultAdapter,i))||this;return n.selectedChipIds_=[],n}return r(e,t),Object.defineProperty(e,"strings",{get:function(){return c},enumerable:!0,configurable:!0}),Object.defineProperty(e,"cssClasses",{get:function(){return d},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{hasClass:function(){return!1},removeChip:function(){},setSelected:function(){}}},enumerable:!0,configurable:!0}),e.prototype.getSelectedChipIds=function(){return this.selectedChipIds_.slice()},e.prototype.select=function(t){if(!(this.selectedChipIds_.indexOf(t)>=0)){if(this.adapter_.hasClass(d.CHOICE)&&this.selectedChipIds_.length>0){var e=this.selectedChipIds_[0];this.selectedChipIds_.length=0,this.adapter_.setSelected(e,!1)}this.selectedChipIds_.push(t),this.adapter_.setSelected(t,!0)}},e.prototype.handleChipInteraction=function(t){(this.adapter_.hasClass(d.CHOICE)||this.adapter_.hasClass(d.FILTER))&&this.toggleSelect_(t)},e.prototype.handleChipSelection=function(t,e){var i=this.selectedChipIds_.indexOf(t)>=0;e&&!i?this.select(t):!e&&i&&this.deselect_(t)},e.prototype.handleChipRemoval=function(t){this.deselect_(t),this.adapter_.removeChip(t)},e.prototype.deselect_=function(t){var e=this.selectedChipIds_.indexOf(t);e>=0&&(this.selectedChipIds_.splice(e,1),this.adapter_.setSelected(t,!1))},e.prototype.toggleSelect_=function(t){this.selectedChipIds_.indexOf(t)>=0?this.deselect_(t):this.select(t)},e}(s),u={CHECKMARK_SELECTOR:".mdc-chip__checkmark",ENTRY_ANIMATION_NAME:"mdc-chip-entry",INTERACTION_EVENT:"MDCChip:interaction",LEADING_ICON_SELECTOR:".mdc-chip__icon--leading",REMOVAL_EVENT:"MDCChip:removal",SELECTION_EVENT:"MDCChip:selection",TRAILING_ICON_INTERACTION_EVENT:"MDCChip:trailingIconInteraction",TRAILING_ICON_SELECTOR:".mdc-chip__icon--trailing"},h={CHECKMARK:"mdc-chip__checkmark",CHIP_EXIT:"mdc-chip--exit",HIDDEN_LEADING_ICON:"mdc-chip__icon--leading-hidden",LEADING_ICON:"mdc-chip__icon--leading",SELECTED:"mdc-chip--selected",TRAILING_ICON:"mdc-chip__icon--trailing"},p={bottom:0,height:0,left:0,right:0,top:0,width:0},f=function(t){function e(i){var n=t.call(this,o({},e.defaultAdapter,i))||this;return n.shouldRemoveOnTrailingIconClick_=!0,n}return r(e,t),Object.defineProperty(e,"strings",{get:function(){return u},enumerable:!0,configurable:!0}),Object.defineProperty(e,"cssClasses",{get:function(){return h},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},addClassToLeadingIcon:function(){},eventTargetHasClass:function(){return!1},getCheckmarkBoundingClientRect:function(){return p},getComputedStyleValue:function(){return""},getRootBoundingClientRect:function(){return p},hasClass:function(){return!1},hasLeadingIcon:function(){return!1},notifyInteraction:function(){},notifyRemoval:function(){},notifySelection:function(){},notifyTrailingIconInteraction:function(){},removeClass:function(){},removeClassFromLeadingIcon:function(){},setStyleProperty:function(){}}},enumerable:!0,configurable:!0}),e.prototype.isSelected=function(){return this.adapter_.hasClass(h.SELECTED)},e.prototype.setSelected=function(t){t?this.adapter_.addClass(h.SELECTED):this.adapter_.removeClass(h.SELECTED),this.adapter_.notifySelection(t)},e.prototype.getShouldRemoveOnTrailingIconClick=function(){return this.shouldRemoveOnTrailingIconClick_},e.prototype.setShouldRemoveOnTrailingIconClick=function(t){this.shouldRemoveOnTrailingIconClick_=t},e.prototype.getDimensions=function(){var t=this,e=function(){return t.adapter_.getRootBoundingClientRect()};if(!this.adapter_.hasLeadingIcon()){var i=t.adapter_.getCheckmarkBoundingClientRect();if(i){var n=e();return{bottom:n.bottom,height:n.height,left:n.left,right:n.right,top:n.top,width:n.width+i.height}}}return e()},e.prototype.beginExit=function(){this.adapter_.addClass(h.CHIP_EXIT)},e.prototype.handleInteraction=function(t){var e="Enter"===t.key||13===t.keyCode;("click"===t.type||e)&&this.adapter_.notifyInteraction()},e.prototype.handleTransitionEnd=function(t){var e=this;if(this.adapter_.eventTargetHasClass(t.target,h.CHIP_EXIT)){if("width"===t.propertyName)this.adapter_.notifyRemoval();else if("opacity"===t.propertyName){var i=this.adapter_.getComputedStyleValue("width");requestAnimationFrame(function(){e.adapter_.setStyleProperty("width",i),e.adapter_.setStyleProperty("padding","0"),e.adapter_.setStyleProperty("margin","0"),requestAnimationFrame(function(){e.adapter_.setStyleProperty("width","0")})})}}else"opacity"===t.propertyName&&(this.adapter_.eventTargetHasClass(t.target,h.LEADING_ICON)&&this.adapter_.hasClass(h.SELECTED)?this.adapter_.addClassToLeadingIcon(h.HIDDEN_LEADING_ICON):this.adapter_.eventTargetHasClass(t.target,h.CHECKMARK)&&!this.adapter_.hasClass(h.SELECTED)&&this.adapter_.removeClassFromLeadingIcon(h.HIDDEN_LEADING_ICON))},e.prototype.handleTrailingIconInteraction=function(t){var e="Enter"===t.key||13===t.keyCode;t.stopPropagation(),("click"===t.type||e)&&(this.adapter_.notifyTrailingIconInteraction(),this.shouldRemoveOnTrailingIconClick_&&this.beginExit())},e}(s);const{INTERACTION_EVENT:_,SELECTION_EVENT:m,REMOVAL_EVENT:v}=f.strings;var g={name:"mcw-chip-set",props:{choice:[Boolean],filter:[Boolean],input:[Boolean]},provide(){return{mcwChipSet:this}},data(){return{classes:{"mdc-chip-set":!0,"mdc-chip-set--choice":this.choice,"mdc-chip-set--filter":this.filter,"mdc-chip-set--input":this.input}}},mounted(){this.foundation=new l({hasClass:t=>this.$el.classList.contains(t),removeChip:t=>{const e=C(this.$slots.default,t);e>=0&&this.$nextTick(()=>{this.$slots.default.splice(e,1)})},setSelected:(t,e)=>{const i=C(this.$slots.default,t);i>=0&&(this.$slots.default[i].componentInstance.selected=e)}}),this.foundation.init()},beforeDestroy(){this.foundation.destroy()},render(t){const{$scopedSlots:e}=this;return t("div",{class:this.classes,on:{[_]:({detail:{chipId:t}})=>this.foundation.handleChipInteraction(t),[m]:({detail:{chipId:t,selected:e}})=>this.foundation.handleChipSelection(t,e),[v]:({detail:{chipId:t}})=>this.foundation.handleChipRemoval(t)}},e.default&&e.default())}};function C(t,e){return t.findIndex(({componentInstance:t})=>t&&(t.id==e||t._uid==e))}const I={name:"custom-link",functional:!0,props:{tag:{type:String,default:"a"},link:Object},render(t,{data:e,children:i,props:{link:n,tag:a},parent:{$router:r,$root:o}}){let s;return n&&r?(s=o.$options.components.RouterLink,e.props={tag:a,...n},e.on.click&&(e.nativeOn={click:e.on.click})):s=a,t(s,e,i)}},y={props:{to:[String,Object],exact:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String},computed:{link(){return this.to&&{to:this.to,exact:this.exact,append:this.append,replace:this.replace,activeClass:this.activeClass,exactActiveClass:this.exactActiveClass}}},components:{CustomLink:I}};function E(t,e,i,n=!1){let a;"function"==typeof CustomEvent?a=new CustomEvent(e,{detail:i,bubbles:n}):(a=document.createEvent("CustomEvent")).initCustomEvent(e,n,!1,i),t.dispatchEvent(a)} | ||
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"},l={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"},u={DEACTIVATION_TIMEOUT_MS:225,FG_DEACTIVATION_MS:150,INITIAL_ORIGIN_SCALE:.6,PADDING:10,TAP_DELAY_MS:300};function p(t,e){if(void 0===t&&(t=window),void 0===e&&(e=!1),void 0===s||e){var i=!1;try{t.document.addEventListener("test",function(){},{get passive(){return i=!0}})}catch(t){}s=i}return!!s&&{passive:!0}} | ||
/** | ||
* @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 T(t,e){return(t.matches||t.webkitMatchesSelector||t.msMatchesSelector).call(t,e)} | ||
/** | ||
* @license | ||
* Copyright 2016 Google Inc. | ||
@@ -84,3 +62,4 @@ * | ||
* THE SOFTWARE. | ||
*/var A,S,b={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"},O={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"},R={DEACTIVATION_TIMEOUT_MS:225,FG_DEACTIVATION_MS:150,INITIAL_ORIGIN_SCALE:.6,PADDING:10,TAP_DELAY_MS:300};function w(t,e){if(void 0===t&&(t=window),void 0===e&&(e=!1),void 0===S||e){var i=!1;try{t.document.addEventListener("test",function(){},{get passive(){return i=!0}})}catch(t){}S=i}return!!S&&{passive:!0}} | ||
*/ | ||
var h=["touchstart","pointerdown","mousedown","keydown"],f=["touchend","pointerup","mouseup","contextmenu"],_=[],m=function(t){function e(i){var n=t.call(this,r({},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 function(t,e){function i(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return d},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return l},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return u},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&&(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,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&&_.length>0&&_.some(function(t){return e.adapter_.containsEventTarget(t)})?this.resetActivationState_():(void 0!==t&&(_.push(t.target),this.registerDeactivationHandlers_(t)),i.wasElementMadeActive=this.checkElementMadeActive_(t),i.wasElementMadeActive&&this.animateActivation_(),requestAnimationFrame(function(){_=[],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="",l="";if(!this.adapter_.isUnbounded()){var u=this.getFgTranslationCoordinates_(),p=u.startPoint,h=u.endPoint;d=p.x+"px, "+p.y+"px",l=h.x+"px, "+h.y+"px"}this.adapter_.updateCssVariable(n,d),this.adapter_.updateCssVariable(a,l),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 l=t;n=l.pageX-s,a=l.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)},u.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=r({},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}(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 i=t.CSS,n=o;if("boolean"==typeof o&&!e)return o;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.parentNode&&i.parentNode.removeChild(i),a}(t)),e||(o=n),n})(window),computeBoundingRect:()=>t.$el.getBoundingClientRect(),containsEventTarget:e=>t.$el.contains(e),deregisterDocumentInteractionHandler:(t,e)=>document.documentElement.removeEventListener(t,e,p()),deregisterInteractionHandler:(e,i)=>{t.$el.removeEventListener(e,i,p())},deregisterResizeHandler:t=>window.removeEventListener("resize",t),getWindowPageOffset:()=>({x:window.pageXOffset,y:window.pageYOffset}),isSurfaceActive:()=>n(t.$el,":active"),isSurfaceDisabled:()=>t.disabled,isUnbounded:()=>!1,registerDocumentInteractionHandler:(t,e)=>document.documentElement.addEventListener(t,e,p()),registerInteractionHandler:(e,i)=>{t.$el.addEventListener(e,i,p())},registerResizeHandler:t=>window.addEventListener("resize",t),removeClass(e){t.$delete(t.classes,e)},updateCssVariable:(e,i)=>{t.$set(t.styles,e,i)},...e})}}const g={data:()=>({classes:{},styles:{}}),mounted(){this.ripple=new v(this),this.ripple.init()},beforeDestroy(){this.ripple.destroy()}};i.d(e,"RippleBase",function(){return v}),i.d(e,"RippleMixin",function(){return g})},2:function(t,e,i){"use strict";function n(t){return{version:"__VERSION__",install:e=>{Object.entries(t).forEach(([t,i])=>{const n=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),[a,...r]=n.split("-"),o=["mdc",...r].join("-"),s=["mcw",...r].join("-"),c=e.extend(i);e.component(s,c),e.component(o,c)})},components:t}}i.d(e,"a",function(){return n})},24:function(t,e,i){i(84),t.exports=i(25)},25:function(t,e,i){},7:function(t,e,i){"use strict";function n(t,e,i,n=!1){let a;"function"==typeof CustomEvent?a=new CustomEvent(e,{detail:i,bubbles:n}):(a=document.createEvent("CustomEvent")).initCustomEvent(e,n,!1,i),t.dispatchEvent(a)}i.d(e,"a",function(){return n})},8:function(t,e,i){"use strict";i.d(e,"a",function(){return n}),i.d(e,"b",function(){return a});const n={name:"custom-link",functional:!0,props:{tag:{type:String,default:"a"},link:Object},render(t,{data:e,children:i,props:{link:n,tag:a},parent:{$router:r,$root:o}}){let s;return n&&r?(s=o.$options.components.RouterLink,e.props={tag:a,...n},e.on.click&&(e.nativeOn={click:e.on.click})):s=a,t(s,e,i)}},a={props:{to:[String,Object],exact:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String},computed:{link(){return this.to&&{to:this.to,exact:this.exact,append:this.append,replace:this.replace,activeClass:this.activeClass,exactActiveClass:this.exactActiveClass}}},components:{CustomLink:n}}},84:function(t,e,i){"use strict";i.r(e);var n=i(2),a={name:"mcw-chip-checkmark",data:()=>({width:0}),render:t=>t("div",{class:{"mdc-chip__checkmark":1}},[t("svg",{class:{"mdc-chip__checkmark-svg":1},attrs:{viewBox:"-2 -3 30 30"}},[t("path",{class:{"mdc-chip__checkmark-path":1},attrs:{fill:"none",stroke:"black",d:"M1.73,12.91 8.1,19.28 22.79,4.59"}})])]),mounted(){this.width=this.$el.getBoundingClientRect().height}},r=function(t,e){return(r=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 o(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var s=function(){return(s=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)}; | ||
/** | ||
@@ -108,3 +87,3 @@ * @license | ||
*/ | ||
var N=["touchstart","pointerdown","mousedown","keydown"],D=["touchend","pointerup","mouseup","contextmenu"],k=[],L=function(t){function e(i){var n=t.call(this,o({},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 r(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return b},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return O},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return R},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&&(N.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_):D.forEach(function(t){e.adapter_.registerDocumentInteractionHandler(t,e.deactivateHandler_)})},e.prototype.deregisterRootHandlers_=function(){var t=this;N.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_),D.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&&k.length>0&&k.some(function(t){return e.adapter_.containsEventTarget(t)})?this.resetActivationState_():(void 0!==t&&(k.push(t.target),this.registerDeactivationHandlers_(t)),i.wasElementMadeActive=this.checkElementMadeActive_(t),i.wasElementMadeActive&&this.animateActivation_(),requestAnimationFrame(function(){k=[],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="",l="";if(!this.adapter_.isUnbounded()){var u=this.getFgTranslationCoordinates_(),h=u.startPoint,p=u.endPoint;d=h.x+"px, "+h.y+"px",l=p.x+"px, "+p.y+"px"}this.adapter_.updateCssVariable(n,d),this.adapter_.updateCssVariable(a,l),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 l=t;n=l.pageX-s,a=l.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)},R.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=o({},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}(s);class H extends L{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=A;if("boolean"==typeof A&&!e)return A;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||(A=n),n})(window),computeBoundingRect:()=>t.$el.getBoundingClientRect(),containsEventTarget:e=>t.$el.contains(e),deregisterDocumentInteractionHandler:(t,e)=>document.documentElement.removeEventListener(t,e,w()),deregisterInteractionHandler:(e,i)=>{t.$el.removeEventListener(e,i,w())},deregisterResizeHandler:t=>window.removeEventListener("resize",t),getWindowPageOffset:()=>({x:window.pageXOffset,y:window.pageYOffset}),isSurfaceActive:()=>T(t.$el,":active"),isSurfaceDisabled:()=>t.disabled,isUnbounded:()=>!1,registerDocumentInteractionHandler:(t,e)=>document.documentElement.addEventListener(t,e,w()),registerInteractionHandler:(e,i)=>{t.$el.addEventListener(e,i,w())},registerResizeHandler:t=>window.addEventListener("resize",t),removeClass(e){t.$delete(t.classes,e)},updateCssVariable:(e,i)=>{t.$set(t.styles,e,i)},...e})}}var V={name:"mcw-chip",mixins:[y],props:{leadingIcon:[String],trailingIcon:[String],shouldRemoveOnTrailingIconClick:{type:Boolean,default:()=>!0},id:{}},inject:["mcwChipSet"],data:()=>({classes:{"mdc-chip":!0},styles:{}}),computed:{myId(){return this.id||this._uid},selected:{get(){return this.foundation.isSelected()},set(t){this.foundation.setSelected(t)}},isFilter(){return this.mcwChipSet&&this.mcwChipSet.filter},haveleadingIcon(){const t=this.$slots["leading-icon"];return t&&t[0]||!!this.leadingIcon},havetrailingIcon(){const t=this.$slots["trailing-icon"];return t&&t[0]||!!this.trailingIcon}},mounted(){const{INTERACTION_EVENT:t,SELECTION_EVENT:e,REMOVAL_EVENT:i,TRAILING_ICON_INTERACTION_EVENT:n}=f.strings;this.foundation=new f({addClass:t=>this.$set(this.classes,t,!0),removeClass:t=>this.$delete(this.classes,t),hasClass:t=>this.$el.classList.contains(t),addClassToLeadingIcon:t=>{if(this.haveleadingIcon){const e=this.$refs["leading-icon"]||this.$slots["leading-icon"][0];(e.elm||e).classList.add(t)}},removeClassFromLeadingIcon:t=>{if(this.haveleadingIcon){const e=this.$refs["leading-icon"]||this.$slots["leading-icon"][0];(e.elm||e).classList.remove(t)}},eventTargetHasClass:(t,e)=>t.classList.contains(e),notifyInteraction:()=>{E(this.$el,t,{chipId:this.myId},!0)},notifySelection:t=>E(this.$el,e,{chipId:this.myId,selected:t},!0),notifyTrailingIconInteraction:()=>{E(this.$el,n,{chipId:this.myId},!0)},notifyRemoval:()=>{E(this.$el,i,{chipId:this.myId,root:this.$el},!0)},getComputedStyleValue:t=>window.getComputedStyle(this.$el).getPropertyValue(t),setStyleProperty:(t,e)=>this.$set(this.styles,t,e),hasLeadingIcon:()=>!!this.haveleadingIcon,getRootBoundingClientRect:()=>this.$el.getBoundingClientRect(),getCheckmarkBoundingClientRect:()=>this.$refs.checkmarkEl?this.$refs.checkmarkEl.width:null}),this.foundation.init(),this.shouldRemoveOnTrailingIconClick!==this.foundation.getShouldRemoveOnTrailingIconClick()&&this.foundation.setShouldRemoveOnTrailingIconClick(this.shouldRemoveOnTrailingIconClick),this.ripple=new H(this,{computeBoundingRect:()=>this.foundation.getDimensions()}),this.ripple.init()},beforeDestroy(){this.ripple.destroy(),this.foundation.destroy()},methods:{toggleSelected(){this.foundation.toggleSelected()},isSelected(){return this.foundation.isSelected()},renderLeadingIcon(t){const{$slots:{"leading-icon":e}}=this,i=e&&e[0];if(i){const{staticClass:t=""}=i.data;return t&&t.indexOf("mdc-chip__icon")>-1||(i.data.staticClass=`mdc-chip__icon mdc-chip__icon--leading ${t}`),e}return t("i",{class:{"mdc-chip__icon":1,"mdc-chip__icon--leading":1,"material-icons":1},ref:"leading-icon"},this.leadingIcon)},renderTrailingIcon(t){const{$slots:{"trailing-icon":e}}=this,i=e&&e[0];if(i){const{staticClass:t=""}=i.data;return t&&t.indexOf("mdc-chip__icon")>-1||(i.data.staticClass=`mdc-chip__icon mdc-chip__icon--trailing ${t}`,i.data.on={...i.data.on,click:t=>{this.foundation.handleTrailingIconInteraction(t)},keydown:t=>this.foundation.handleTrailingIconInteraction(t)}),e}return t("i",{class:{"mdc-chip__icon":1,"mdc-chip__icon--trailing":1,"material-icons":1},ref:"trailing-icon",on:{click:t=>this.foundation.handleTrailingIconInteraction(t),keydown:t=>this.foundation.handleTrailingIconInteraction(t)}},this.trailingIcon)}},render(t){const{$scopedSlots:e}=this;return t("div",{class:this.classes,style:this.styles,attrs:{tabindex:"0"},on:{click:t=>this.foundation.handleInteraction(t),keydown:t=>this.foundation.handleInteraction(t),transitionend:t=>this.foundation.handleTransitionEnd(t)}},[this.haveleadingIcon&&this.renderLeadingIcon(t),this.isFilter&&t(n,{ref:"checkmarkEl"}),t("div",{class:{"mdc-chip__text":1}},e.default&&e.default()),this.havetrailingIcon&&this.renderTrailingIcon(t)])}};i.d(e,"mcwChip",function(){return V}),i.d(e,"mcwChipSet",function(){return g}),i.d(e,"mcwChipCheckmark",function(){return n});var P;e.default={version:"__VERSION__",install:t=>{Object.entries(P).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:P={mcwChip:V,mcwChipSet:g,mcwChipCheckmark:n}}}})}); | ||
var 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={CHIP_SELECTOR:".mdc-chip"},l={CHOICE:"mdc-chip-set--choice",FILTER:"mdc-chip-set--filter"},u=function(t){function e(i){var n=t.call(this,s({},e.defaultAdapter,i))||this;return n.selectedChipIds_=[],n}return o(e,t),Object.defineProperty(e,"strings",{get:function(){return d},enumerable:!0,configurable:!0}),Object.defineProperty(e,"cssClasses",{get:function(){return l},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{hasClass:function(){return!1},removeChip:function(){},setSelected:function(){}}},enumerable:!0,configurable:!0}),e.prototype.getSelectedChipIds=function(){return this.selectedChipIds_.slice()},e.prototype.select=function(t){if(!(this.selectedChipIds_.indexOf(t)>=0)){if(this.adapter_.hasClass(l.CHOICE)&&this.selectedChipIds_.length>0){var e=this.selectedChipIds_[0];this.selectedChipIds_.length=0,this.adapter_.setSelected(e,!1)}this.selectedChipIds_.push(t),this.adapter_.setSelected(t,!0)}},e.prototype.handleChipInteraction=function(t){(this.adapter_.hasClass(l.CHOICE)||this.adapter_.hasClass(l.FILTER))&&this.toggleSelect_(t)},e.prototype.handleChipSelection=function(t,e){var i=this.selectedChipIds_.indexOf(t)>=0;e&&!i?this.select(t):!e&&i&&this.deselect_(t)},e.prototype.handleChipRemoval=function(t){this.deselect_(t),this.adapter_.removeChip(t)},e.prototype.deselect_=function(t){var e=this.selectedChipIds_.indexOf(t);e>=0&&(this.selectedChipIds_.splice(e,1),this.adapter_.setSelected(t,!1))},e.prototype.toggleSelect_=function(t){this.selectedChipIds_.indexOf(t)>=0?this.deselect_(t):this.select(t)},e}(c),p={CHECKMARK_SELECTOR:".mdc-chip__checkmark",ENTRY_ANIMATION_NAME:"mdc-chip-entry",INTERACTION_EVENT:"MDCChip:interaction",LEADING_ICON_SELECTOR:".mdc-chip__icon--leading",REMOVAL_EVENT:"MDCChip:removal",SELECTION_EVENT:"MDCChip:selection",TRAILING_ICON_INTERACTION_EVENT:"MDCChip:trailingIconInteraction",TRAILING_ICON_SELECTOR:".mdc-chip__icon--trailing"},h={CHECKMARK:"mdc-chip__checkmark",CHIP_EXIT:"mdc-chip--exit",HIDDEN_LEADING_ICON:"mdc-chip__icon--leading-hidden",LEADING_ICON:"mdc-chip__icon--leading",SELECTED:"mdc-chip--selected",TRAILING_ICON:"mdc-chip__icon--trailing"},f={bottom:0,height:0,left:0,right:0,top:0,width:0},_=function(t){function e(i){var n=t.call(this,s({},e.defaultAdapter,i))||this;return n.shouldRemoveOnTrailingIconClick_=!0,n}return o(e,t),Object.defineProperty(e,"strings",{get:function(){return p},enumerable:!0,configurable:!0}),Object.defineProperty(e,"cssClasses",{get:function(){return h},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},addClassToLeadingIcon:function(){},eventTargetHasClass:function(){return!1},getCheckmarkBoundingClientRect:function(){return f},getComputedStyleValue:function(){return""},getRootBoundingClientRect:function(){return f},hasClass:function(){return!1},hasLeadingIcon:function(){return!1},notifyInteraction:function(){},notifyRemoval:function(){},notifySelection:function(){},notifyTrailingIconInteraction:function(){},removeClass:function(){},removeClassFromLeadingIcon:function(){},setStyleProperty:function(){}}},enumerable:!0,configurable:!0}),e.prototype.isSelected=function(){return this.adapter_.hasClass(h.SELECTED)},e.prototype.setSelected=function(t){t?this.adapter_.addClass(h.SELECTED):this.adapter_.removeClass(h.SELECTED),this.adapter_.notifySelection(t)},e.prototype.getShouldRemoveOnTrailingIconClick=function(){return this.shouldRemoveOnTrailingIconClick_},e.prototype.setShouldRemoveOnTrailingIconClick=function(t){this.shouldRemoveOnTrailingIconClick_=t},e.prototype.getDimensions=function(){var t=this,e=function(){return t.adapter_.getRootBoundingClientRect()};if(!this.adapter_.hasLeadingIcon()){var i=t.adapter_.getCheckmarkBoundingClientRect();if(i){var n=e();return{bottom:n.bottom,height:n.height,left:n.left,right:n.right,top:n.top,width:n.width+i.height}}}return e()},e.prototype.beginExit=function(){this.adapter_.addClass(h.CHIP_EXIT)},e.prototype.handleInteraction=function(t){var e="Enter"===t.key||13===t.keyCode;("click"===t.type||e)&&this.adapter_.notifyInteraction()},e.prototype.handleTransitionEnd=function(t){var e=this;if(this.adapter_.eventTargetHasClass(t.target,h.CHIP_EXIT)){if("width"===t.propertyName)this.adapter_.notifyRemoval();else if("opacity"===t.propertyName){var i=this.adapter_.getComputedStyleValue("width");requestAnimationFrame(function(){e.adapter_.setStyleProperty("width",i),e.adapter_.setStyleProperty("padding","0"),e.adapter_.setStyleProperty("margin","0"),requestAnimationFrame(function(){e.adapter_.setStyleProperty("width","0")})})}}else"opacity"===t.propertyName&&(this.adapter_.eventTargetHasClass(t.target,h.LEADING_ICON)&&this.adapter_.hasClass(h.SELECTED)?this.adapter_.addClassToLeadingIcon(h.HIDDEN_LEADING_ICON):this.adapter_.eventTargetHasClass(t.target,h.CHECKMARK)&&!this.adapter_.hasClass(h.SELECTED)&&this.adapter_.removeClassFromLeadingIcon(h.HIDDEN_LEADING_ICON))},e.prototype.handleTrailingIconInteraction=function(t){var e="Enter"===t.key||13===t.keyCode;t.stopPropagation(),("click"===t.type||e)&&(this.adapter_.notifyTrailingIconInteraction(),this.shouldRemoveOnTrailingIconClick_&&this.beginExit())},e}(c);const{INTERACTION_EVENT:m,SELECTION_EVENT:v,REMOVAL_EVENT:g}=_.strings;var C={name:"mcw-chip-set",props:{choice:[Boolean],filter:[Boolean],input:[Boolean]},provide(){return{mcwChipSet:this}},data(){return{classes:{"mdc-chip-set":!0,"mdc-chip-set--choice":this.choice,"mdc-chip-set--filter":this.filter,"mdc-chip-set--input":this.input}}},mounted(){this.foundation=new u({hasClass:t=>this.$el.classList.contains(t),removeChip:t=>{const e=y(this.$slots.default,t);e>=0&&this.$nextTick(()=>{this.$slots.default.splice(e,1)})},setSelected:(t,e)=>{const i=y(this.$slots.default,t);i>=0&&(this.$slots.default[i].componentInstance.selected=e)}}),this.foundation.init()},beforeDestroy(){this.foundation.destroy()},render(t){const{$scopedSlots:e}=this;return t("div",{class:this.classes,on:{[m]:({detail:{chipId:t}})=>this.foundation.handleChipInteraction(t),[v]:({detail:{chipId:t,selected:e}})=>this.foundation.handleChipSelection(t,e),[g]:({detail:{chipId:t}})=>this.foundation.handleChipRemoval(t)}},e.default&&e.default())}};function y(t,e){return t.findIndex(({componentInstance:t})=>t&&(t.id==e||t._uid==e))}var I=i(8),E=i(7),T=i(1),b={name:"mcw-chip",mixins:[I.b],props:{leadingIcon:[String],trailingIcon:[String],shouldRemoveOnTrailingIconClick:{type:Boolean,default:()=>!0},id:{}},inject:["mcwChipSet"],data:()=>({classes:{"mdc-chip":!0},styles:{}}),computed:{myId(){return this.id||this._uid},selected:{get(){return this.foundation.isSelected()},set(t){this.foundation.setSelected(t)}},isFilter(){return this.mcwChipSet&&this.mcwChipSet.filter},haveleadingIcon(){const t=this.$slots["leading-icon"];return t&&t[0]||!!this.leadingIcon},havetrailingIcon(){const t=this.$slots["trailing-icon"];return t&&t[0]||!!this.trailingIcon}},mounted(){const{INTERACTION_EVENT:t,SELECTION_EVENT:e,REMOVAL_EVENT:i,TRAILING_ICON_INTERACTION_EVENT:n}=_.strings;this.foundation=new _({addClass:t=>this.$set(this.classes,t,!0),removeClass:t=>this.$delete(this.classes,t),hasClass:t=>this.$el.classList.contains(t),addClassToLeadingIcon:t=>{if(this.haveleadingIcon){const e=this.$refs["leading-icon"]||this.$slots["leading-icon"][0];(e.elm||e).classList.add(t)}},removeClassFromLeadingIcon:t=>{if(this.haveleadingIcon){const e=this.$refs["leading-icon"]||this.$slots["leading-icon"][0];(e.elm||e).classList.remove(t)}},eventTargetHasClass:(t,e)=>t.classList.contains(e),notifyInteraction:()=>{Object(E.a)(this.$el,t,{chipId:this.myId},!0)},notifySelection:t=>Object(E.a)(this.$el,e,{chipId:this.myId,selected:t},!0),notifyTrailingIconInteraction:()=>{Object(E.a)(this.$el,n,{chipId:this.myId},!0)},notifyRemoval:()=>{Object(E.a)(this.$el,i,{chipId:this.myId,root:this.$el},!0)},getComputedStyleValue:t=>window.getComputedStyle(this.$el).getPropertyValue(t),setStyleProperty:(t,e)=>this.$set(this.styles,t,e),hasLeadingIcon:()=>!!this.haveleadingIcon,getRootBoundingClientRect:()=>this.$el.getBoundingClientRect(),getCheckmarkBoundingClientRect:()=>this.$refs.checkmarkEl?this.$refs.checkmarkEl.width:null}),this.foundation.init(),this.shouldRemoveOnTrailingIconClick!==this.foundation.getShouldRemoveOnTrailingIconClick()&&this.foundation.setShouldRemoveOnTrailingIconClick(this.shouldRemoveOnTrailingIconClick),this.ripple=new T.RippleBase(this,{computeBoundingRect:()=>this.foundation.getDimensions()}),this.ripple.init()},beforeDestroy(){this.ripple.destroy(),this.foundation.destroy()},methods:{toggleSelected(){this.foundation.toggleSelected()},isSelected(){return this.foundation.isSelected()},renderLeadingIcon(t){const{$slots:{"leading-icon":e}}=this,i=e&&e[0];if(i){const{staticClass:t=""}=i.data;return t&&t.indexOf("mdc-chip__icon")>-1||(i.data.staticClass=`mdc-chip__icon mdc-chip__icon--leading ${t}`),e}return t("i",{class:{"mdc-chip__icon":1,"mdc-chip__icon--leading":1,"material-icons":1},ref:"leading-icon"},this.leadingIcon)},renderTrailingIcon(t){const{$slots:{"trailing-icon":e}}=this,i=e&&e[0];if(i){const{staticClass:t=""}=i.data;return t&&t.indexOf("mdc-chip__icon")>-1||(i.data.staticClass=`mdc-chip__icon mdc-chip__icon--trailing ${t}`,i.data.on={...i.data.on,click:t=>{this.foundation.handleTrailingIconInteraction(t)},keydown:t=>this.foundation.handleTrailingIconInteraction(t)}),e}return t("i",{class:{"mdc-chip__icon":1,"mdc-chip__icon--trailing":1,"material-icons":1},ref:"trailing-icon",on:{click:t=>this.foundation.handleTrailingIconInteraction(t),keydown:t=>this.foundation.handleTrailingIconInteraction(t)}},this.trailingIcon)}},render(t){const{$scopedSlots:e}=this;return t("div",{class:this.classes,style:this.styles,attrs:{tabindex:"0"},on:{click:t=>this.foundation.handleInteraction(t),keydown:t=>this.foundation.handleInteraction(t),transitionend:t=>this.foundation.handleTransitionEnd(t)}},[this.haveleadingIcon&&this.renderLeadingIcon(t),this.isFilter&&t(a,{ref:"checkmarkEl"}),t("div",{class:{"mdc-chip__text":1}},e.default&&e.default()),this.havetrailingIcon&&this.renderTrailingIcon(t)])}};i.d(e,"mcwChip",function(){return b}),i.d(e,"mcwChipSet",function(){return C}),i.d(e,"mcwChipCheckmark",function(){return a});e.default=Object(n.a)({mcwChip:b,mcwChipSet:C,mcwChipCheckmark:a})}})}); | ||
//# sourceMappingURL=mcwv.chips.min.js.map |
{ | ||
"name": "@mcwv/chips", | ||
"description": "The Vue Material Adapter for the web chips component", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"license": "MIT", | ||
@@ -19,7 +19,7 @@ "main": "dist/mcwv.chips.min.js", | ||
"dependencies": { | ||
"@material/chips": "^2.0.0", | ||
"@mcwv/base": "^0.6.0", | ||
"@mcwv/ripple": "^0.6.0" | ||
"@material/chips": "^2.2.0", | ||
"@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
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
187052
579
+ 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/chips@^2.2.0
Updated@mcwv/base@^0.7.0
Updated@mcwv/ripple@^0.7.0