@material/chips
Advanced tools
Comparing version 0.40.0 to 0.40.1
@@ -27,3 +27,3 @@ /** | ||
// eslint-disable-next-line no-unused-vars | ||
import {MDCChipInteractionEventType, MDCChipRemovalEventType} from '../chip/foundation'; | ||
import {MDCChipInteractionEventType, MDCChipSelectionEventType, MDCChipRemovalEventType} from '../chip/foundation'; | ||
import {strings, cssClasses} from './constants'; | ||
@@ -102,7 +102,8 @@ | ||
if (this.adapter_.hasClass(cssClasses.CHOICE) && this.selectedChipIds_.length > 0) { | ||
this.adapter_.setSelected(this.selectedChipIds_[0], false); | ||
const previouslySelectedChip = this.selectedChipIds_[0]; | ||
this.selectedChipIds_.length = 0; | ||
this.adapter_.setSelected(previouslySelectedChip, false); | ||
} | ||
this.selectedChipIds_.push(chipId); | ||
this.adapter_.setSelected(chipId, true); | ||
this.selectedChipIds_.push(chipId); | ||
} | ||
@@ -134,2 +135,16 @@ | ||
/** | ||
* Handles a chip selection event, used to handle discrepancy when selection state is set directly on the Chip. | ||
* @param {!MDCChipSelectionEventType} evt | ||
*/ | ||
handleChipSelection(evt) { | ||
const {chipId, selected} = evt.detail; | ||
const chipIsSelected = this.selectedChipIds_.indexOf(chipId) >= 0; | ||
if (selected && !chipIsSelected) { | ||
this.select(chipId); | ||
} else if (!selected && chipIsSelected) { | ||
this.deselect(chipId); | ||
} | ||
} | ||
/** | ||
* Handles the event when a chip is removed. | ||
@@ -136,0 +151,0 @@ * @param {!MDCChipRemovalEventType} evt |
@@ -51,2 +51,4 @@ /** | ||
/** @private {?function(?Event): undefined} */ | ||
this.handleChipSelection_; | ||
/** @private {?function(?Event): undefined} */ | ||
this.handleChipRemoval_; | ||
@@ -80,2 +82,3 @@ } | ||
this.handleChipInteraction_ = (evt) => this.foundation_.handleChipInteraction(evt); | ||
this.handleChipSelection_ = (evt) => this.foundation_.handleChipSelection(evt); | ||
this.handleChipRemoval_ = (evt) => this.foundation_.handleChipRemoval(evt); | ||
@@ -85,2 +88,4 @@ this.root_.addEventListener( | ||
this.root_.addEventListener( | ||
MDCChipFoundation.strings.SELECTION_EVENT, this.handleChipSelection_); | ||
this.root_.addEventListener( | ||
MDCChipFoundation.strings.REMOVAL_EVENT, this.handleChipRemoval_); | ||
@@ -97,2 +102,4 @@ } | ||
this.root_.removeEventListener( | ||
MDCChipFoundation.strings.SELECTION_EVENT, this.handleChipSelection_); | ||
this.root_.removeEventListener( | ||
MDCChipFoundation.strings.REMOVAL_EVENT, this.handleChipRemoval_); | ||
@@ -99,0 +106,0 @@ |
@@ -83,2 +83,8 @@ /** | ||
/** | ||
* Emits a custom "MDCChip:selection" event denoting the chip has been selected or deselected. | ||
* @param {boolean} selected | ||
*/ | ||
notifySelection(selected) {} | ||
/** | ||
* Emits a custom "MDCChip:trailingIconInteraction" event denoting the trailing icon has been | ||
@@ -85,0 +91,0 @@ * interacted with (typically on click or keydown). |
@@ -28,2 +28,3 @@ /** | ||
INTERACTION_EVENT: 'MDCChip:interaction', | ||
SELECTION_EVENT: 'MDCChip:selection', | ||
TRAILING_ICON_INTERACTION_EVENT: 'MDCChip:trailingIconInteraction', | ||
@@ -30,0 +31,0 @@ REMOVAL_EVENT: 'MDCChip:removal', |
@@ -58,2 +58,3 @@ /** | ||
notifyInteraction: () => {}, | ||
notifySelection: () => {}, | ||
notifyTrailingIconInteraction: () => {}, | ||
@@ -95,2 +96,3 @@ notifyRemoval: () => {}, | ||
} | ||
this.adapter_.notifySelection(selected); | ||
} | ||
@@ -203,2 +205,13 @@ | ||
* chipId: string, | ||
* selected: boolean, | ||
* }, | ||
* bubbles: boolean, | ||
* }} | ||
*/ | ||
let MDCChipSelectionEventType; | ||
/** | ||
* @typedef {{ | ||
* detail: { | ||
* chipId: string, | ||
* root: Element, | ||
@@ -211,2 +224,2 @@ * }, | ||
export {MDCChipFoundation, MDCChipInteractionEventType, MDCChipRemovalEventType}; | ||
export {MDCChipFoundation, MDCChipInteractionEventType, MDCChipSelectionEventType, MDCChipRemovalEventType}; |
@@ -187,2 +187,4 @@ /** | ||
notifyInteraction: () => this.emit(strings.INTERACTION_EVENT, {chipId: this.id}, true /* shouldBubble */), | ||
notifySelection: (selected) => this.emit( | ||
strings.SELECTION_EVENT, {chipId: this.id, selected: selected}, true /* shouldBubble */), | ||
notifyTrailingIconInteraction: () => this.emit( | ||
@@ -189,0 +191,0 @@ strings.TRAILING_ICON_INTERACTION_EVENT, {chipId: this.id}, true /* shouldBubble */), |
@@ -28,3 +28,3 @@ /*! | ||
*/ | ||
var u=void 0,c=void 0},3:function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();!function(){function t(){i(this,t)}r(t,[{key:"browserSupportsCssVars",value:function(){}},{key:"isUnbounded",value:function(){}},{key:"isSurfaceActive",value:function(){}},{key:"isSurfaceDisabled",value:function(){}},{key:"addClass",value:function(t){}},{key:"removeClass",value:function(t){}},{key:"containsEventTarget",value:function(t){}},{key:"registerInteractionHandler",value:function(t,e){}},{key:"deregisterInteractionHandler",value:function(t,e){}},{key:"registerDocumentInteractionHandler",value:function(t,e){}},{key:"deregisterDocumentInteractionHandler",value:function(t,e){}},{key:"registerResizeHandler",value:function(t){}},{key:"deregisterResizeHandler",value:function(t){}},{key:"updateCssVariable",value:function(t,e){}},{key:"computeBoundingRect",value:function(){}},{key:"getWindowPageOffset",value:function(){}}])}()},4:function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),n.d(e,"MDCRipple",function(){return l}),n.d(e,"RippleCapableSurface",function(){return d});var o=n(1),s=(n(3),n(5)),u=n(2);n.d(e,"MDCRippleFoundation",function(){return s.a}),n.d(e,"util",function(){return u});var c=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),l=function(t){function e(){var t;i(this,e);for(var n=arguments.length,a=Array(n),o=0;o<n;o++)a[o]=arguments[o];var s=r(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(a)));return s.disabled=!1,s.unbounded_,s}return a(e,t),c(e,[{key:"setUnbounded_",value:function(){this.foundation_.setUnbounded(this.unbounded_)}},{key:"activate",value:function(){this.foundation_.activate()}},{key:"deactivate",value:function(){this.foundation_.deactivate()}},{key:"layout",value:function(){this.foundation_.layout()}},{key:"getDefaultFoundation",value:function(){return new s.a(e.createAdapter(this))}},{key:"initialSyncWithDOM",value:function(){this.unbounded="mdcRippleIsUnbounded"in this.root_.dataset}},{key:"unbounded",get:function(){return this.unbounded_},set:function(t){this.unbounded_=Boolean(t),this.setUnbounded_()}}],[{key:"attachTo",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.isUnbounded,r=void 0===i?void 0:i,a=new e(t);return void 0!==r&&(a.unbounded=r),a}},{key:"createAdapter",value:function(t){var e=u.getMatchesProperty(HTMLElement.prototype);return{browserSupportsCssVars:function(){return u.supportsCssVariables(window)},isUnbounded:function(){return t.unbounded},isSurfaceActive:function(){return t.root_[e](":active")},isSurfaceDisabled:function(){return t.disabled},addClass:function(e){return t.root_.classList.add(e)},removeClass:function(e){return t.root_.classList.remove(e)},containsEventTarget:function(e){return t.root_.contains(e)},registerInteractionHandler:function(e,n){return t.root_.addEventListener(e,n,u.applyPassive())},deregisterInteractionHandler:function(e,n){return t.root_.removeEventListener(e,n,u.applyPassive())},registerDocumentInteractionHandler:function(t,e){return document.documentElement.addEventListener(t,e,u.applyPassive())},deregisterDocumentInteractionHandler:function(t,e){return document.documentElement.removeEventListener(t,e,u.applyPassive())},registerResizeHandler:function(t){return window.addEventListener("resize",t)},deregisterResizeHandler:function(t){return window.removeEventListener("resize",t)},updateCssVariable:function(e,n){return t.root_.style.setProperty(e,n)},computeBoundingRect:function(){return t.root_.getBoundingClientRect()},getWindowPageOffset:function(){return{x:window.pageXOffset,y:window.pageYOffset}}}}}]),e}(o.a),d=function t(){i(this,t)};d.prototype.root_,d.prototype.unbounded,d.prototype.disabled},5:function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var o=n(0),s=(n(3),n(6)),u=n(2),c=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},l=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),d=["touchstart","pointerdown","mousedown","keydown"],f=["touchend","pointerup","mouseup"],p=[],h=function(t){function e(t){i(this,e);var n=r(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,c(e.defaultAdapter,t)));return n.layoutFrame_=0,n.frame_={width:0,height:0},n.activationState_=n.defaultActivationState_(),n.initialSize_=0,n.maxRadius_=0,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.unboundedCoords_={left:0,top:0},n.fgScale_=0,n.activationTimer_=0,n.fgDeactivationRemovalTimer_=0,n.activationAnimationHasEnded_=!1,n.activationTimerCallback_=function(){n.activationAnimationHasEnded_=!0,n.runDeactivationUXLogicIfReady_()},n.previousActivationEvent_,n}return a(e,t),l(e,null,[{key:"cssClasses",get:function(){return s.a}},{key:"strings",get:function(){return s.c}},{key:"numbers",get:function(){return s.b}},{key:"defaultAdapter",get:function(){return{browserSupportsCssVars:function(){},isUnbounded:function(){},isSurfaceActive:function(){},isSurfaceDisabled:function(){},addClass:function(){},removeClass:function(){},containsEventTarget:function(){},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){},registerDocumentInteractionHandler:function(){},deregisterDocumentInteractionHandler:function(){},registerResizeHandler:function(){},deregisterResizeHandler:function(){},updateCssVariable:function(){},computeBoundingRect:function(){},getWindowPageOffset:function(){}}}}]),l(e,[{key:"supportsPressRipple_",value:function(){return this.adapter_.browserSupportsCssVars()}},{key:"defaultActivationState_",value:function(){return{isActivated:!1,hasDeactivationUXRun:!1,wasActivatedByPointer:!1,wasElementMadeActive:!1,activationEvent:void 0,isProgrammatic:!1}}},{key:"init",value: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_())})}}},{key:"destroy",value: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_()}},{key:"registerRootHandlers_",value: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_)}},{key:"registerDeactivationHandlers_",value:function(t){var e=this;"keydown"===t.type?this.adapter_.registerInteractionHandler("keyup",this.deactivateHandler_):f.forEach(function(t){e.adapter_.registerDocumentInteractionHandler(t,e.deactivateHandler_)})}},{key:"deregisterRootHandlers_",value: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_)}},{key:"deregisterDeactivationHandlers_",value:function(){var t=this;this.adapter_.deregisterInteractionHandler("keyup",this.deactivateHandler_),f.forEach(function(e){t.adapter_.deregisterDocumentInteractionHandler(e,t.deactivateHandler_)})}},{key:"removeCssVars_",value:function(){var t=this,n=e.strings;Object.keys(n).forEach(function(e){0===e.indexOf("VAR_")&&t.adapter_.updateCssVariable(n[e],null)})}},{key:"activate_",value: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));if(void 0!==t&&p.length>0&&p.some(function(t){return e.adapter_.containsEventTarget(t)}))return void this.resetActivationState_();void 0!==t&&(p.push(t.target),this.registerDeactivationHandlers_(t)),n.wasElementMadeActive=this.checkElementMadeActive_(t),n.wasElementMadeActive&&this.animateActivation_(),requestAnimationFrame(function(){p=[],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_())})}}}}},{key:"checkElementMadeActive_",value:function(t){return void 0===t||"keydown"!==t.type||this.adapter_.isSurfaceActive()}},{key:"activate",value:function(t){this.activate_(t)}},{key:"animateActivation_",value: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,u=e.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal_();var c="",l="";if(!this.adapter_.isUnbounded()){var d=this.getFgTranslationCoordinates_(),f=d.startPoint,p=d.endPoint;c=f.x+"px, "+f.y+"px",l=p.x+"px, "+p.y+"px"}this.adapter_.updateCssVariable(i,c),this.adapter_.updateCssVariable(r,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_()},u)}},{key:"getFgTranslationCoordinates_",value:function(){var t=this.activationState_,e=t.activationEvent,n=t.wasActivatedByPointer,i=void 0;return i=n?Object(u.getNormalizedEventCoords)(e,this.adapter_.getWindowPageOffset(),this.adapter_.computeBoundingRect()):{x:this.frame_.width/2,y:this.frame_.height/2},i={x:i.x-this.initialSize_/2,y:i.y-this.initialSize_/2},{startPoint:i,endPoint:{x:this.frame_.width/2-this.initialSize_/2,y:this.frame_.height/2-this.initialSize_/2}}}},{key:"runDeactivationUXLogicIfReady_",value: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)},s.b.FG_DEACTIVATION_MS))}},{key:"rmBoundedActivationClasses_",value:function(){var t=e.cssClasses.FG_ACTIVATION;this.adapter_.removeClass(t),this.activationAnimationHasEnded_=!1,this.adapter_.computeBoundingRect()}},{key:"resetActivationState_",value: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)}},{key:"deactivate_",value:function(){var t=this,e=this.activationState_;if(e.isActivated){var n=c({},e);e.isProgrammatic?(requestAnimationFrame(function(){return t.animateDeactivation_(n)}),this.resetActivationState_()):(this.deregisterDeactivationHandlers_(),requestAnimationFrame(function(){t.activationState_.hasDeactivationUXRun=!0,t.animateDeactivation_(n),t.resetActivationState_()}))}}},{key:"deactivate",value:function(){this.deactivate_()}},{key:"animateDeactivation_",value:function(t){var e=t.wasActivatedByPointer,n=t.wasElementMadeActive;(e||n)&&this.runDeactivationUXLogicIfReady_()}},{key:"layout",value:function(){var t=this;this.layoutFrame_&&cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=requestAnimationFrame(function(){t.layoutInternal_(),t.layoutFrame_=0})}},{key:"layoutInternal_",value: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:function(){return 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_()}},{key:"updateLayoutCssVars_",value: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"))}},{key:"setUnbounded",value:function(t){var n=e.cssClasses.UNBOUNDED;t?this.adapter_.addClass(n):this.adapter_.removeClass(n)}},{key:"handleFocus",value:function(){var t=this;requestAnimationFrame(function(){return t.adapter_.addClass(e.cssClasses.BG_FOCUSED)})}},{key:"handleBlur",value:function(){var t=this;requestAnimationFrame(function(){return t.adapter_.removeClass(e.cssClasses.BG_FOCUSED)})}}]),e}(o.a);e.a=h},57:function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}n.d(e,"a",function(){return h});var o=n(1),s=n(4),u=(n(58),n(59)),c=n(60);n.d(e,"b",function(){return u.a});var l=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},d=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),f=function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,n,i)}if("value"in r)return r.value;var o=r.get;if(void 0!==o)return o.call(i)},p=["click","keydown"],h=function(t){function e(){var t;i(this,e);for(var n=arguments.length,a=Array(n),o=0;o<n;o++)a[o]=arguments[o];var s=r(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(a)));return s.id,s.leadingIcon_,s.trailingIcon_,s.ripple_,s.handleInteraction_,s.handleTransitionEnd_,s.handleTrailingIconInteraction_,s}return a(e,t),d(e,[{key:"initialize",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(t,e){return new s.MDCRipple(t,e)};this.id=this.root_.id,this.leadingIcon_=this.root_.querySelector(c.b.LEADING_ICON_SELECTOR),this.trailingIcon_=this.root_.querySelector(c.b.TRAILING_ICON_SELECTOR);var n=this.root_.querySelector(c.b.CHECKMARK_SELECTOR);if(n&&!this.leadingIcon_){var i=l(s.MDCRipple.createAdapter(this),{computeBoundingRect:function(){return{height:t.root_.getBoundingClientRect().height,width:t.root_.getBoundingClientRect().width+n.getBoundingClientRect().height}}});this.ripple_=e(this.root_,new s.MDCRippleFoundation(i))}else this.ripple_=e(this.root_)}},{key:"initialSyncWithDOM",value:function(){var t=this;this.handleInteraction_=function(e){return t.foundation_.handleInteraction(e)},this.handleTransitionEnd_=function(e){return t.foundation_.handleTransitionEnd(e)},this.handleTrailingIconInteraction_=function(e){return t.foundation_.handleTrailingIconInteraction(e)},p.forEach(function(e){t.root_.addEventListener(e,t.handleInteraction_)}),this.root_.addEventListener("transitionend",this.handleTransitionEnd_),this.trailingIcon_&&p.forEach(function(e){t.trailingIcon_.addEventListener(e,t.handleTrailingIconInteraction_)})}},{key:"destroy",value:function(){var t=this;this.ripple_.destroy(),p.forEach(function(e){t.root_.removeEventListener(e,t.handleInteraction_)}),this.root_.removeEventListener("transitionend",this.handleTransitionEnd_),this.trailingIcon_&&p.forEach(function(e){t.trailingIcon_.removeEventListener(e,t.handleTrailingIconInteraction_)}),f(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"destroy",this).call(this)}},{key:"beginExit",value:function(){this.foundation_.beginExit()}},{key:"getDefaultFoundation",value:function(){var t=this;return new u.a(l({addClass:function(e){return t.root_.classList.add(e)},removeClass:function(e){return t.root_.classList.remove(e)},hasClass:function(e){return t.root_.classList.contains(e)},addClassToLeadingIcon:function(e){t.leadingIcon_&&t.leadingIcon_.classList.add(e)},removeClassFromLeadingIcon:function(e){t.leadingIcon_&&t.leadingIcon_.classList.remove(e)},eventTargetHasClass:function(t,e){return t.classList.contains(e)},notifyInteraction:function(){return t.emit(c.b.INTERACTION_EVENT,{chipId:t.id},!0)},notifyTrailingIconInteraction:function(){return t.emit(c.b.TRAILING_ICON_INTERACTION_EVENT,{chipId:t.id},!0)},notifyRemoval:function(){return t.emit(c.b.REMOVAL_EVENT,{chipId:t.id,root:t.root_},!0)},getComputedStyleValue:function(e){return window.getComputedStyle(t.root_).getPropertyValue(e)},setStyleProperty:function(e,n){return t.root_.style.setProperty(e,n)}}))}},{key:"selected",get:function(){return this.foundation_.isSelected()},set:function(t){this.foundation_.setSelected(t)}},{key:"shouldRemoveOnTrailingIconClick",get:function(){return this.foundation_.getShouldRemoveOnTrailingIconClick()},set:function(t){this.foundation_.setShouldRemoveOnTrailingIconClick(t)}},{key:"ripple",get:function(){return this.ripple_}}],[{key:"attachTo",value:function(t){return new e(t)}}]),e}(o.a)},58:function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();!function(){function t(){i(this,t)}r(t,[{key:"addClass",value:function(t){}},{key:"removeClass",value:function(t){}},{key:"hasClass",value:function(t){}},{key:"addClassToLeadingIcon",value:function(t){}},{key:"removeClassFromLeadingIcon",value:function(t){}},{key:"eventTargetHasClass",value:function(t,e){}},{key:"notifyInteraction",value:function(){}},{key:"notifyTrailingIconInteraction",value:function(){}},{key:"notifyRemoval",value:function(){}},{key:"getComputedStyleValue",value:function(t){}},{key:"setStyleProperty",value:function(t,e){}}])}()},59:function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}n.d(e,"a",function(){return l});var o=n(0),s=(n(58),n(60)),u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},c=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),l=function(t){function e(t){i(this,e);var n=r(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,u(e.defaultAdapter,t)));return n.shouldRemoveOnTrailingIconClick_=!0,n}return a(e,t),c(e,null,[{key:"strings",get:function(){return s.b}},{key:"cssClasses",get:function(){return s.a}},{key:"defaultAdapter",get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){},addClassToLeadingIcon:function(){},removeClassFromLeadingIcon:function(){},eventTargetHasClass:function(){},notifyInteraction:function(){},notifyTrailingIconInteraction:function(){},notifyRemoval:function(){},getComputedStyleValue:function(){},setStyleProperty:function(){}}}}]),c(e,[{key:"isSelected",value:function(){return this.adapter_.hasClass(s.a.SELECTED)}},{key:"setSelected",value:function(t){t?this.adapter_.addClass(s.a.SELECTED):this.adapter_.removeClass(s.a.SELECTED)}},{key:"getShouldRemoveOnTrailingIconClick",value:function(){return this.shouldRemoveOnTrailingIconClick_}},{key:"setShouldRemoveOnTrailingIconClick",value:function(t){this.shouldRemoveOnTrailingIconClick_=t}},{key:"beginExit",value:function(){this.adapter_.addClass(s.a.CHIP_EXIT)}},{key:"handleInteraction",value:function(t){"click"!==t.type&&"Enter"!==t.key&&13!==t.keyCode||this.adapter_.notifyInteraction()}},{key:"handleTransitionEnd",value:function(t){var e=this;if(this.adapter_.eventTargetHasClass(t.target,s.a.CHIP_EXIT)){if("width"===t.propertyName)this.adapter_.notifyRemoval();else if("opacity"===t.propertyName){var n=this.adapter_.getComputedStyleValue("width");requestAnimationFrame(function(){e.adapter_.setStyleProperty("width",n),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,s.a.LEADING_ICON)&&this.adapter_.hasClass(s.a.SELECTED)?this.adapter_.addClassToLeadingIcon(s.a.HIDDEN_LEADING_ICON):this.adapter_.eventTargetHasClass(t.target,s.a.CHECKMARK)&&!this.adapter_.hasClass(s.a.SELECTED)&&this.adapter_.removeClassFromLeadingIcon(s.a.HIDDEN_LEADING_ICON))}},{key:"handleTrailingIconInteraction",value:function(t){t.stopPropagation(),"click"!==t.type&&"Enter"!==t.key&&13!==t.keyCode||(this.adapter_.notifyTrailingIconInteraction(),this.shouldRemoveOnTrailingIconClick_&&this.beginExit())}}]),e}(o.a)},6:function(t,e,n){"use strict";n.d(e,"a",function(){return i}),n.d(e,"c",function(){return r}),n.d(e,"b",function(){return a});/** | ||
var u=void 0,c=void 0},3:function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();!function(){function t(){i(this,t)}r(t,[{key:"browserSupportsCssVars",value:function(){}},{key:"isUnbounded",value:function(){}},{key:"isSurfaceActive",value:function(){}},{key:"isSurfaceDisabled",value:function(){}},{key:"addClass",value:function(t){}},{key:"removeClass",value:function(t){}},{key:"containsEventTarget",value:function(t){}},{key:"registerInteractionHandler",value:function(t,e){}},{key:"deregisterInteractionHandler",value:function(t,e){}},{key:"registerDocumentInteractionHandler",value:function(t,e){}},{key:"deregisterDocumentInteractionHandler",value:function(t,e){}},{key:"registerResizeHandler",value:function(t){}},{key:"deregisterResizeHandler",value:function(t){}},{key:"updateCssVariable",value:function(t,e){}},{key:"computeBoundingRect",value:function(){}},{key:"getWindowPageOffset",value:function(){}}])}()},4:function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),n.d(e,"MDCRipple",function(){return l}),n.d(e,"RippleCapableSurface",function(){return d});var o=n(1),s=(n(3),n(5)),u=n(2);n.d(e,"MDCRippleFoundation",function(){return s.a}),n.d(e,"util",function(){return u});var c=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),l=function(t){function e(){var t;i(this,e);for(var n=arguments.length,a=Array(n),o=0;o<n;o++)a[o]=arguments[o];var s=r(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(a)));return s.disabled=!1,s.unbounded_,s}return a(e,t),c(e,[{key:"setUnbounded_",value:function(){this.foundation_.setUnbounded(this.unbounded_)}},{key:"activate",value:function(){this.foundation_.activate()}},{key:"deactivate",value:function(){this.foundation_.deactivate()}},{key:"layout",value:function(){this.foundation_.layout()}},{key:"getDefaultFoundation",value:function(){return new s.a(e.createAdapter(this))}},{key:"initialSyncWithDOM",value:function(){this.unbounded="mdcRippleIsUnbounded"in this.root_.dataset}},{key:"unbounded",get:function(){return this.unbounded_},set:function(t){this.unbounded_=Boolean(t),this.setUnbounded_()}}],[{key:"attachTo",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.isUnbounded,r=void 0===i?void 0:i,a=new e(t);return void 0!==r&&(a.unbounded=r),a}},{key:"createAdapter",value:function(t){var e=u.getMatchesProperty(HTMLElement.prototype);return{browserSupportsCssVars:function(){return u.supportsCssVariables(window)},isUnbounded:function(){return t.unbounded},isSurfaceActive:function(){return t.root_[e](":active")},isSurfaceDisabled:function(){return t.disabled},addClass:function(e){return t.root_.classList.add(e)},removeClass:function(e){return t.root_.classList.remove(e)},containsEventTarget:function(e){return t.root_.contains(e)},registerInteractionHandler:function(e,n){return t.root_.addEventListener(e,n,u.applyPassive())},deregisterInteractionHandler:function(e,n){return t.root_.removeEventListener(e,n,u.applyPassive())},registerDocumentInteractionHandler:function(t,e){return document.documentElement.addEventListener(t,e,u.applyPassive())},deregisterDocumentInteractionHandler:function(t,e){return document.documentElement.removeEventListener(t,e,u.applyPassive())},registerResizeHandler:function(t){return window.addEventListener("resize",t)},deregisterResizeHandler:function(t){return window.removeEventListener("resize",t)},updateCssVariable:function(e,n){return t.root_.style.setProperty(e,n)},computeBoundingRect:function(){return t.root_.getBoundingClientRect()},getWindowPageOffset:function(){return{x:window.pageXOffset,y:window.pageYOffset}}}}}]),e}(o.a),d=function t(){i(this,t)};d.prototype.root_,d.prototype.unbounded,d.prototype.disabled},5:function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var o=n(0),s=(n(3),n(6)),u=n(2),c=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},l=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),d=["touchstart","pointerdown","mousedown","keydown"],f=["touchend","pointerup","mouseup"],h=[],p=function(t){function e(t){i(this,e);var n=r(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,c(e.defaultAdapter,t)));return n.layoutFrame_=0,n.frame_={width:0,height:0},n.activationState_=n.defaultActivationState_(),n.initialSize_=0,n.maxRadius_=0,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.unboundedCoords_={left:0,top:0},n.fgScale_=0,n.activationTimer_=0,n.fgDeactivationRemovalTimer_=0,n.activationAnimationHasEnded_=!1,n.activationTimerCallback_=function(){n.activationAnimationHasEnded_=!0,n.runDeactivationUXLogicIfReady_()},n.previousActivationEvent_,n}return a(e,t),l(e,null,[{key:"cssClasses",get:function(){return s.a}},{key:"strings",get:function(){return s.c}},{key:"numbers",get:function(){return s.b}},{key:"defaultAdapter",get:function(){return{browserSupportsCssVars:function(){},isUnbounded:function(){},isSurfaceActive:function(){},isSurfaceDisabled:function(){},addClass:function(){},removeClass:function(){},containsEventTarget:function(){},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){},registerDocumentInteractionHandler:function(){},deregisterDocumentInteractionHandler:function(){},registerResizeHandler:function(){},deregisterResizeHandler:function(){},updateCssVariable:function(){},computeBoundingRect:function(){},getWindowPageOffset:function(){}}}}]),l(e,[{key:"supportsPressRipple_",value:function(){return this.adapter_.browserSupportsCssVars()}},{key:"defaultActivationState_",value:function(){return{isActivated:!1,hasDeactivationUXRun:!1,wasActivatedByPointer:!1,wasElementMadeActive:!1,activationEvent:void 0,isProgrammatic:!1}}},{key:"init",value: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_())})}}},{key:"destroy",value: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_()}},{key:"registerRootHandlers_",value: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_)}},{key:"registerDeactivationHandlers_",value:function(t){var e=this;"keydown"===t.type?this.adapter_.registerInteractionHandler("keyup",this.deactivateHandler_):f.forEach(function(t){e.adapter_.registerDocumentInteractionHandler(t,e.deactivateHandler_)})}},{key:"deregisterRootHandlers_",value: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_)}},{key:"deregisterDeactivationHandlers_",value:function(){var t=this;this.adapter_.deregisterInteractionHandler("keyup",this.deactivateHandler_),f.forEach(function(e){t.adapter_.deregisterDocumentInteractionHandler(e,t.deactivateHandler_)})}},{key:"removeCssVars_",value:function(){var t=this,n=e.strings;Object.keys(n).forEach(function(e){0===e.indexOf("VAR_")&&t.adapter_.updateCssVariable(n[e],null)})}},{key:"activate_",value: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));if(void 0!==t&&h.length>0&&h.some(function(t){return e.adapter_.containsEventTarget(t)}))return void this.resetActivationState_();void 0!==t&&(h.push(t.target),this.registerDeactivationHandlers_(t)),n.wasElementMadeActive=this.checkElementMadeActive_(t),n.wasElementMadeActive&&this.animateActivation_(),requestAnimationFrame(function(){h=[],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_())})}}}}},{key:"checkElementMadeActive_",value:function(t){return void 0===t||"keydown"!==t.type||this.adapter_.isSurfaceActive()}},{key:"activate",value:function(t){this.activate_(t)}},{key:"animateActivation_",value: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,u=e.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal_();var c="",l="";if(!this.adapter_.isUnbounded()){var d=this.getFgTranslationCoordinates_(),f=d.startPoint,h=d.endPoint;c=f.x+"px, "+f.y+"px",l=h.x+"px, "+h.y+"px"}this.adapter_.updateCssVariable(i,c),this.adapter_.updateCssVariable(r,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_()},u)}},{key:"getFgTranslationCoordinates_",value:function(){var t=this.activationState_,e=t.activationEvent,n=t.wasActivatedByPointer,i=void 0;return i=n?Object(u.getNormalizedEventCoords)(e,this.adapter_.getWindowPageOffset(),this.adapter_.computeBoundingRect()):{x:this.frame_.width/2,y:this.frame_.height/2},i={x:i.x-this.initialSize_/2,y:i.y-this.initialSize_/2},{startPoint:i,endPoint:{x:this.frame_.width/2-this.initialSize_/2,y:this.frame_.height/2-this.initialSize_/2}}}},{key:"runDeactivationUXLogicIfReady_",value: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)},s.b.FG_DEACTIVATION_MS))}},{key:"rmBoundedActivationClasses_",value:function(){var t=e.cssClasses.FG_ACTIVATION;this.adapter_.removeClass(t),this.activationAnimationHasEnded_=!1,this.adapter_.computeBoundingRect()}},{key:"resetActivationState_",value: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)}},{key:"deactivate_",value:function(){var t=this,e=this.activationState_;if(e.isActivated){var n=c({},e);e.isProgrammatic?(requestAnimationFrame(function(){return t.animateDeactivation_(n)}),this.resetActivationState_()):(this.deregisterDeactivationHandlers_(),requestAnimationFrame(function(){t.activationState_.hasDeactivationUXRun=!0,t.animateDeactivation_(n),t.resetActivationState_()}))}}},{key:"deactivate",value:function(){this.deactivate_()}},{key:"animateDeactivation_",value:function(t){var e=t.wasActivatedByPointer,n=t.wasElementMadeActive;(e||n)&&this.runDeactivationUXLogicIfReady_()}},{key:"layout",value:function(){var t=this;this.layoutFrame_&&cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=requestAnimationFrame(function(){t.layoutInternal_(),t.layoutFrame_=0})}},{key:"layoutInternal_",value: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:function(){return 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_()}},{key:"updateLayoutCssVars_",value: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"))}},{key:"setUnbounded",value:function(t){var n=e.cssClasses.UNBOUNDED;t?this.adapter_.addClass(n):this.adapter_.removeClass(n)}},{key:"handleFocus",value:function(){var t=this;requestAnimationFrame(function(){return t.adapter_.addClass(e.cssClasses.BG_FOCUSED)})}},{key:"handleBlur",value:function(){var t=this;requestAnimationFrame(function(){return t.adapter_.removeClass(e.cssClasses.BG_FOCUSED)})}}]),e}(o.a);e.a=p},57:function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}n.d(e,"a",function(){return p});var o=n(1),s=n(4),u=(n(58),n(59)),c=n(60);n.d(e,"b",function(){return u.a});var l=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},d=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),f=function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,n,i)}if("value"in r)return r.value;var o=r.get;if(void 0!==o)return o.call(i)},h=["click","keydown"],p=function(t){function e(){var t;i(this,e);for(var n=arguments.length,a=Array(n),o=0;o<n;o++)a[o]=arguments[o];var s=r(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(a)));return s.id,s.leadingIcon_,s.trailingIcon_,s.ripple_,s.handleInteraction_,s.handleTransitionEnd_,s.handleTrailingIconInteraction_,s}return a(e,t),d(e,[{key:"initialize",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(t,e){return new s.MDCRipple(t,e)};this.id=this.root_.id,this.leadingIcon_=this.root_.querySelector(c.b.LEADING_ICON_SELECTOR),this.trailingIcon_=this.root_.querySelector(c.b.TRAILING_ICON_SELECTOR);var n=this.root_.querySelector(c.b.CHECKMARK_SELECTOR);if(n&&!this.leadingIcon_){var i=l(s.MDCRipple.createAdapter(this),{computeBoundingRect:function(){return{height:t.root_.getBoundingClientRect().height,width:t.root_.getBoundingClientRect().width+n.getBoundingClientRect().height}}});this.ripple_=e(this.root_,new s.MDCRippleFoundation(i))}else this.ripple_=e(this.root_)}},{key:"initialSyncWithDOM",value:function(){var t=this;this.handleInteraction_=function(e){return t.foundation_.handleInteraction(e)},this.handleTransitionEnd_=function(e){return t.foundation_.handleTransitionEnd(e)},this.handleTrailingIconInteraction_=function(e){return t.foundation_.handleTrailingIconInteraction(e)},h.forEach(function(e){t.root_.addEventListener(e,t.handleInteraction_)}),this.root_.addEventListener("transitionend",this.handleTransitionEnd_),this.trailingIcon_&&h.forEach(function(e){t.trailingIcon_.addEventListener(e,t.handleTrailingIconInteraction_)})}},{key:"destroy",value:function(){var t=this;this.ripple_.destroy(),h.forEach(function(e){t.root_.removeEventListener(e,t.handleInteraction_)}),this.root_.removeEventListener("transitionend",this.handleTransitionEnd_),this.trailingIcon_&&h.forEach(function(e){t.trailingIcon_.removeEventListener(e,t.handleTrailingIconInteraction_)}),f(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"destroy",this).call(this)}},{key:"beginExit",value:function(){this.foundation_.beginExit()}},{key:"getDefaultFoundation",value:function(){var t=this;return new u.a(l({addClass:function(e){return t.root_.classList.add(e)},removeClass:function(e){return t.root_.classList.remove(e)},hasClass:function(e){return t.root_.classList.contains(e)},addClassToLeadingIcon:function(e){t.leadingIcon_&&t.leadingIcon_.classList.add(e)},removeClassFromLeadingIcon:function(e){t.leadingIcon_&&t.leadingIcon_.classList.remove(e)},eventTargetHasClass:function(t,e){return t.classList.contains(e)},notifyInteraction:function(){return t.emit(c.b.INTERACTION_EVENT,{chipId:t.id},!0)},notifySelection:function(e){return t.emit(c.b.SELECTION_EVENT,{chipId:t.id,selected:e},!0)},notifyTrailingIconInteraction:function(){return t.emit(c.b.TRAILING_ICON_INTERACTION_EVENT,{chipId:t.id},!0)},notifyRemoval:function(){return t.emit(c.b.REMOVAL_EVENT,{chipId:t.id,root:t.root_},!0)},getComputedStyleValue:function(e){return window.getComputedStyle(t.root_).getPropertyValue(e)},setStyleProperty:function(e,n){return t.root_.style.setProperty(e,n)}}))}},{key:"selected",get:function(){return this.foundation_.isSelected()},set:function(t){this.foundation_.setSelected(t)}},{key:"shouldRemoveOnTrailingIconClick",get:function(){return this.foundation_.getShouldRemoveOnTrailingIconClick()},set:function(t){this.foundation_.setShouldRemoveOnTrailingIconClick(t)}},{key:"ripple",get:function(){return this.ripple_}}],[{key:"attachTo",value:function(t){return new e(t)}}]),e}(o.a)},58:function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();!function(){function t(){i(this,t)}r(t,[{key:"addClass",value:function(t){}},{key:"removeClass",value:function(t){}},{key:"hasClass",value:function(t){}},{key:"addClassToLeadingIcon",value:function(t){}},{key:"removeClassFromLeadingIcon",value:function(t){}},{key:"eventTargetHasClass",value:function(t,e){}},{key:"notifyInteraction",value:function(){}},{key:"notifySelection",value:function(t){}},{key:"notifyTrailingIconInteraction",value:function(){}},{key:"notifyRemoval",value:function(){}},{key:"getComputedStyleValue",value:function(t){}},{key:"setStyleProperty",value:function(t,e){}}])}()},59:function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}n.d(e,"a",function(){return l});var o=n(0),s=(n(58),n(60)),u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},c=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),l=function(t){function e(t){i(this,e);var n=r(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,u(e.defaultAdapter,t)));return n.shouldRemoveOnTrailingIconClick_=!0,n}return a(e,t),c(e,null,[{key:"strings",get:function(){return s.b}},{key:"cssClasses",get:function(){return s.a}},{key:"defaultAdapter",get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){},addClassToLeadingIcon:function(){},removeClassFromLeadingIcon:function(){},eventTargetHasClass:function(){},notifyInteraction:function(){},notifySelection:function(){},notifyTrailingIconInteraction:function(){},notifyRemoval:function(){},getComputedStyleValue:function(){},setStyleProperty:function(){}}}}]),c(e,[{key:"isSelected",value:function(){return this.adapter_.hasClass(s.a.SELECTED)}},{key:"setSelected",value:function(t){t?this.adapter_.addClass(s.a.SELECTED):this.adapter_.removeClass(s.a.SELECTED),this.adapter_.notifySelection(t)}},{key:"getShouldRemoveOnTrailingIconClick",value:function(){return this.shouldRemoveOnTrailingIconClick_}},{key:"setShouldRemoveOnTrailingIconClick",value:function(t){this.shouldRemoveOnTrailingIconClick_=t}},{key:"beginExit",value:function(){this.adapter_.addClass(s.a.CHIP_EXIT)}},{key:"handleInteraction",value:function(t){"click"!==t.type&&"Enter"!==t.key&&13!==t.keyCode||this.adapter_.notifyInteraction()}},{key:"handleTransitionEnd",value:function(t){var e=this;if(this.adapter_.eventTargetHasClass(t.target,s.a.CHIP_EXIT)){if("width"===t.propertyName)this.adapter_.notifyRemoval();else if("opacity"===t.propertyName){var n=this.adapter_.getComputedStyleValue("width");requestAnimationFrame(function(){e.adapter_.setStyleProperty("width",n),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,s.a.LEADING_ICON)&&this.adapter_.hasClass(s.a.SELECTED)?this.adapter_.addClassToLeadingIcon(s.a.HIDDEN_LEADING_ICON):this.adapter_.eventTargetHasClass(t.target,s.a.CHECKMARK)&&!this.adapter_.hasClass(s.a.SELECTED)&&this.adapter_.removeClassFromLeadingIcon(s.a.HIDDEN_LEADING_ICON))}},{key:"handleTrailingIconInteraction",value:function(t){t.stopPropagation(),"click"!==t.type&&"Enter"!==t.key&&13!==t.keyCode||(this.adapter_.notifyTrailingIconInteraction(),this.shouldRemoveOnTrailingIconClick_&&this.beginExit())}}]),e}(o.a)},6:function(t,e,n){"use strict";n.d(e,"a",function(){return i}),n.d(e,"c",function(){return r}),n.d(e,"b",function(){return a});/** | ||
* @license | ||
@@ -73,3 +73,3 @@ * Copyright 2016 Google Inc. | ||
*/ | ||
var i={ENTRY_ANIMATION_NAME:"mdc-chip-entry",INTERACTION_EVENT:"MDCChip:interaction",TRAILING_ICON_INTERACTION_EVENT:"MDCChip:trailingIconInteraction",REMOVAL_EVENT:"MDCChip:removal",CHECKMARK_SELECTOR:".mdc-chip__checkmark",LEADING_ICON_SELECTOR:".mdc-chip__icon--leading",TRAILING_ICON_SELECTOR:".mdc-chip__icon--trailing"},r={CHECKMARK:"mdc-chip__checkmark",CHIP_EXIT:"mdc-chip--exit",HIDDEN_LEADING_ICON:"mdc-chip__icon--leading-hidden",LEADING_ICON:"mdc-chip__icon--leading",TRAILING_ICON:"mdc-chip__icon--trailing",SELECTED:"mdc-chip--selected"}},61:function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();!function(){function t(){i(this,t)}r(t,[{key:"hasClass",value:function(t){}},{key:"removeChip",value:function(t){}},{key:"setSelected",value:function(t,e){}}])}()},84:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(57),r=n(85);n.d(e,"MDCChipFoundation",function(){return i.b}),n.d(e,"MDCChip",function(){return i.a}),n.d(e,"MDCChipSetFoundation",function(){return r.b}),n.d(e,"MDCChipSet",function(){return r.a})},85:function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}n.d(e,"a",function(){return p});var o=n(1),s=(n(61),n(86)),u=n(57);n.d(e,"b",function(){return s.a});var c=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},l=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),d=function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,n,i)}if("value"in r)return r.value;var o=r.get;if(void 0!==o)return o.call(i)},f=0,p=function(t){function e(){var t;i(this,e);for(var n=arguments.length,a=Array(n),o=0;o<n;o++)a[o]=arguments[o];var s=r(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(a)));return s.chips,s.chipFactory_,s.handleChipInteraction_,s.handleChipRemoval_,s}return a(e,t),l(e,[{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(t){return new u.a(t)};this.chipFactory_=t,this.chips=this.instantiateChips_(this.chipFactory_)}},{key:"initialSyncWithDOM",value:function(){var t=this;this.chips.forEach(function(e){e.selected&&t.foundation_.select(e.id)}),this.handleChipInteraction_=function(e){return t.foundation_.handleChipInteraction(e)},this.handleChipRemoval_=function(e){return t.foundation_.handleChipRemoval(e)},this.root_.addEventListener(u.b.strings.INTERACTION_EVENT,this.handleChipInteraction_),this.root_.addEventListener(u.b.strings.REMOVAL_EVENT,this.handleChipRemoval_)}},{key:"destroy",value:function(){this.chips.forEach(function(t){t.destroy()}),this.root_.removeEventListener(u.b.strings.INTERACTION_EVENT,this.handleChipInteraction_),this.root_.removeEventListener(u.b.strings.REMOVAL_EVENT,this.handleChipRemoval_),d(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"destroy",this).call(this)}},{key:"addChip",value:function(t){t.id=t.id||"mdc-chip-"+ ++f,this.chips.push(this.chipFactory_(t))}},{key:"getDefaultFoundation",value:function(){var t=this;return new s.a(c({hasClass:function(e){return t.root_.classList.contains(e)},removeChip:function(e){var n=t.findChipIndex_(e);n>=0&&(t.chips[n].destroy(),t.chips.splice(n,1))},setSelected:function(e,n){var i=t.findChipIndex_(e);i>=0&&(t.chips[i].selected=n)}}))}},{key:"instantiateChips_",value:function(t){return[].slice.call(this.root_.querySelectorAll(s.a.strings.CHIP_SELECTOR)).map(function(e){return e.id=e.id||"mdc-chip-"+ ++f,t(e)})}},{key:"findChipIndex_",value:function(t){for(var e=0;e<this.chips.length;e++)if(this.chips[e].id===t)return e;return-1}},{key:"selectedChipIds",get:function(){return this.foundation_.getSelectedChipIds()}}],[{key:"attachTo",value:function(t){return new e(t)}}]),e}(o.a)},86:function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var o=n(0),s=(n(61),n(59),n(87)),u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},c=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),l=function(t){function e(t){i(this,e);var n=r(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,u(e.defaultAdapter,t)));return n.selectedChipIds_=[],n}return a(e,t),c(e,null,[{key:"strings",get:function(){return s.b}},{key:"cssClasses",get:function(){return s.a}},{key:"defaultAdapter",get:function(){return{hasClass:function(){},removeChip:function(){},setSelected:function(){}}}}]),c(e,[{key:"getSelectedChipIds",value:function(){return this.selectedChipIds_}},{key:"toggleSelect",value:function(t){this.selectedChipIds_.indexOf(t)>=0?this.deselect(t):this.select(t)}},{key:"select",value:function(t){this.selectedChipIds_.indexOf(t)>=0||(this.adapter_.hasClass(s.a.CHOICE)&&this.selectedChipIds_.length>0&&(this.adapter_.setSelected(this.selectedChipIds_[0],!1),this.selectedChipIds_.length=0),this.adapter_.setSelected(t,!0),this.selectedChipIds_.push(t))}},{key:"deselect",value:function(t){var e=this.selectedChipIds_.indexOf(t);e>=0&&(this.selectedChipIds_.splice(e,1),this.adapter_.setSelected(t,!1))}},{key:"handleChipInteraction",value:function(t){var e=t.detail.chipId;(this.adapter_.hasClass(s.a.CHOICE)||this.adapter_.hasClass(s.a.FILTER))&&this.toggleSelect(e)}},{key:"handleChipRemoval",value:function(t){var e=t.detail.chipId;this.deselect(e),this.adapter_.removeChip(e)}}]),e}(o.a);e.a=l},87:function(t,e,n){"use strict";n.d(e,"b",function(){return i}),n.d(e,"a",function(){return r});/** | ||
var i={ENTRY_ANIMATION_NAME:"mdc-chip-entry",INTERACTION_EVENT:"MDCChip:interaction",SELECTION_EVENT:"MDCChip:selection",TRAILING_ICON_INTERACTION_EVENT:"MDCChip:trailingIconInteraction",REMOVAL_EVENT:"MDCChip:removal",CHECKMARK_SELECTOR:".mdc-chip__checkmark",LEADING_ICON_SELECTOR:".mdc-chip__icon--leading",TRAILING_ICON_SELECTOR:".mdc-chip__icon--trailing"},r={CHECKMARK:"mdc-chip__checkmark",CHIP_EXIT:"mdc-chip--exit",HIDDEN_LEADING_ICON:"mdc-chip__icon--leading-hidden",LEADING_ICON:"mdc-chip__icon--leading",TRAILING_ICON:"mdc-chip__icon--trailing",SELECTED:"mdc-chip--selected"}},61:function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();!function(){function t(){i(this,t)}r(t,[{key:"hasClass",value:function(t){}},{key:"removeChip",value:function(t){}},{key:"setSelected",value:function(t,e){}}])}()},84:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(57),r=n(85);n.d(e,"MDCChipFoundation",function(){return i.b}),n.d(e,"MDCChip",function(){return i.a}),n.d(e,"MDCChipSetFoundation",function(){return r.b}),n.d(e,"MDCChipSet",function(){return r.a})},85:function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}n.d(e,"a",function(){return h});var o=n(1),s=(n(61),n(86)),u=n(57);n.d(e,"b",function(){return s.a});var c=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},l=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),d=function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,n,i)}if("value"in r)return r.value;var o=r.get;if(void 0!==o)return o.call(i)},f=0,h=function(t){function e(){var t;i(this,e);for(var n=arguments.length,a=Array(n),o=0;o<n;o++)a[o]=arguments[o];var s=r(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(a)));return s.chips,s.chipFactory_,s.handleChipInteraction_,s.handleChipSelection_,s.handleChipRemoval_,s}return a(e,t),l(e,[{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(t){return new u.a(t)};this.chipFactory_=t,this.chips=this.instantiateChips_(this.chipFactory_)}},{key:"initialSyncWithDOM",value:function(){var t=this;this.chips.forEach(function(e){e.selected&&t.foundation_.select(e.id)}),this.handleChipInteraction_=function(e){return t.foundation_.handleChipInteraction(e)},this.handleChipSelection_=function(e){return t.foundation_.handleChipSelection(e)},this.handleChipRemoval_=function(e){return t.foundation_.handleChipRemoval(e)},this.root_.addEventListener(u.b.strings.INTERACTION_EVENT,this.handleChipInteraction_),this.root_.addEventListener(u.b.strings.SELECTION_EVENT,this.handleChipSelection_),this.root_.addEventListener(u.b.strings.REMOVAL_EVENT,this.handleChipRemoval_)}},{key:"destroy",value:function(){this.chips.forEach(function(t){t.destroy()}),this.root_.removeEventListener(u.b.strings.INTERACTION_EVENT,this.handleChipInteraction_),this.root_.removeEventListener(u.b.strings.SELECTION_EVENT,this.handleChipSelection_),this.root_.removeEventListener(u.b.strings.REMOVAL_EVENT,this.handleChipRemoval_),d(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"destroy",this).call(this)}},{key:"addChip",value:function(t){t.id=t.id||"mdc-chip-"+ ++f,this.chips.push(this.chipFactory_(t))}},{key:"getDefaultFoundation",value:function(){var t=this;return new s.a(c({hasClass:function(e){return t.root_.classList.contains(e)},removeChip:function(e){var n=t.findChipIndex_(e);n>=0&&(t.chips[n].destroy(),t.chips.splice(n,1))},setSelected:function(e,n){var i=t.findChipIndex_(e);i>=0&&(t.chips[i].selected=n)}}))}},{key:"instantiateChips_",value:function(t){return[].slice.call(this.root_.querySelectorAll(s.a.strings.CHIP_SELECTOR)).map(function(e){return e.id=e.id||"mdc-chip-"+ ++f,t(e)})}},{key:"findChipIndex_",value:function(t){for(var e=0;e<this.chips.length;e++)if(this.chips[e].id===t)return e;return-1}},{key:"selectedChipIds",get:function(){return this.foundation_.getSelectedChipIds()}}],[{key:"attachTo",value:function(t){return new e(t)}}]),e}(o.a)},86:function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var o=n(0),s=(n(61),n(59),n(87)),u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},c=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),l=function(t){function e(t){i(this,e);var n=r(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,u(e.defaultAdapter,t)));return n.selectedChipIds_=[],n}return a(e,t),c(e,null,[{key:"strings",get:function(){return s.b}},{key:"cssClasses",get:function(){return s.a}},{key:"defaultAdapter",get:function(){return{hasClass:function(){},removeChip:function(){},setSelected:function(){}}}}]),c(e,[{key:"getSelectedChipIds",value:function(){return this.selectedChipIds_}},{key:"toggleSelect",value:function(t){this.selectedChipIds_.indexOf(t)>=0?this.deselect(t):this.select(t)}},{key:"select",value:function(t){if(!(this.selectedChipIds_.indexOf(t)>=0)){if(this.adapter_.hasClass(s.a.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)}}},{key:"deselect",value:function(t){var e=this.selectedChipIds_.indexOf(t);e>=0&&(this.selectedChipIds_.splice(e,1),this.adapter_.setSelected(t,!1))}},{key:"handleChipInteraction",value:function(t){var e=t.detail.chipId;(this.adapter_.hasClass(s.a.CHOICE)||this.adapter_.hasClass(s.a.FILTER))&&this.toggleSelect(e)}},{key:"handleChipSelection",value:function(t){var e=t.detail,n=e.chipId,i=e.selected,r=this.selectedChipIds_.indexOf(n)>=0;i&&!r?this.select(n):!i&&r&&this.deselect(n)}},{key:"handleChipRemoval",value:function(t){var e=t.detail.chipId;this.deselect(e),this.adapter_.removeChip(e)}}]),e}(o.a);e.a=l},87:function(t,e,n){"use strict";n.d(e,"b",function(){return i}),n.d(e,"a",function(){return r});/** | ||
* @license | ||
@@ -76,0 +76,0 @@ * Copyright 2016 Google Inc. |
{ | ||
"name": "@material/chips", | ||
"description": "The Material Components for the Web chips component", | ||
"version": "0.40.0", | ||
"version": "0.40.1", | ||
"license": "MIT", | ||
@@ -19,11 +19,11 @@ "keywords": [ | ||
"dependencies": { | ||
"@material/animation": "^0.39.0", | ||
"@material/base": "^0.39.0", | ||
"@material/checkbox": "^0.40.0", | ||
"@material/elevation": "^0.40.0", | ||
"@material/ripple": "^0.40.0", | ||
"@material/shape": "^0.40.0", | ||
"@material/theme": "^0.40.0", | ||
"@material/typography": "^0.39.0" | ||
"@material/animation": "^0.40.1", | ||
"@material/base": "^0.40.1", | ||
"@material/checkbox": "^0.40.1", | ||
"@material/elevation": "^0.40.1", | ||
"@material/ripple": "^0.40.1", | ||
"@material/shape": "^0.40.1", | ||
"@material/theme": "^0.40.1", | ||
"@material/typography": "^0.40.1" | ||
} | ||
} |
@@ -61,4 +61,4 @@ <!--docs: | ||
import {MDCChipSet} from '@material/chips'; | ||
const chipSet = new MDCChipSet(document.querySelector('.mdc-chip-set')); | ||
const chipSetEl = document.querySelector('.mdc-chip-set'); | ||
const chipSet = new MDCChipSet(chipSetEl); | ||
``` | ||
@@ -74,2 +74,12 @@ | ||
We recommend using [Material Icons](https://material.io/tools/icons/) from Google Fonts: | ||
```html | ||
<head> | ||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> | ||
</head> | ||
``` | ||
However, you can also use SVG, [Font Awesome](https://fontawesome.com/), or any other icon library you wish. | ||
#### Leading icon | ||
@@ -152,4 +162,34 @@ | ||
You'd also want to add an event listener that calls `addChip` on the `MDCChipSet` to convert text to a chip. More information can be found in the "`MDCChip` Properties and Methods" section below. | ||
#### Adding Chips to the DOM | ||
The MDC Chips package does not handle the process of converting text into chips, in order to remain framework-agnostic. The `MDCChipSet` component exposes an `addChip` method, which accepts an element which is expected to already be inserted within the Chip Set element after any existing chips. The `MDCChipSet` component will then handle creating and tracking a `MDCChip` component instance. | ||
For example: | ||
```js | ||
input.addEventListener('keydown', function(event) { | ||
if (event.key === 'Enter' || event.keyCode === 13) { | ||
const chipEl = document.createElement('div'); | ||
// ... perform operations to properly populate/decorate chip element ... | ||
chipSetEl.appendChild(chipEl); | ||
chipSet.addChip(chipEl); | ||
} | ||
}); | ||
``` | ||
> _NOTE_: `MDCChipSet` will generate a unique ID to apply to each added chip's element if it does not already have an ID | ||
> when it is passed to `addChip`. This is used to distinguish chips during user interactions. | ||
#### Removing Chips from the DOM | ||
By default, input chips are removed in response to clicking the trailing remove icon in the chip. Removal can also be triggered by calling `MDCChip`'s `beginExit()` method. | ||
Individual `MDCChip` instances will emit a `MDCChip:removal` event once the exit transition ends. `MDCChipSet` will handle destroying the `MDCChip` instance in response to `MDCChip:removal`, but it must be removed from the DOM manually. You can listen for `MDCChip:removal` from the parent Chip Set or any ancestor, since the event bubbles: | ||
```js | ||
chipSet.listen('MDCChip:removal', function(event) { | ||
chipSetEl.removeChild(event.root); | ||
}); | ||
``` | ||
### Pre-selected | ||
@@ -193,3 +233,3 @@ | ||
`mdc-chip__text` | Mandatory. Indicates the text content of the chip. | ||
`mdc-chip__icon` | Optional. Indicates an icon in the chip. | ||
`mdc-chip__icon` | Optional. Indicates an icon in the chip. We recommend using [Material Icons](https://material.io/tools/icons/) from Google Fonts. | ||
`mdc-chip__icon--leading` | Optional. Indicates a leading icon in the chip. | ||
@@ -255,2 +295,13 @@ `mdc-chip__icon--leading-hidden` | Optional. Hides the leading icon in a filter chip when the chip is selected. | ||
##### Events | ||
Event Name | `event.detail` | Description | ||
--- | --- | --- | ||
`MDCChip:interaction` | `{chipId: string}` | Indicates the chip was interacted with (via click/tap or Enter key) | ||
`MDCChip:selection` | `{chipId: string, selected: boolean}` | Indicates the chip's selection state has changed (for choice/filter chips) | ||
`MDCChip:removal` | `{chipId: string, root: Element}` | Indicates the chip is ready to be removed from the DOM | ||
`MDCChip:trailingIconInteraction` | `{chipId: string}` | Indicates the chip's trailing icon was interacted with (via click/tap or Enter key) | ||
> _NOTE_: All of `MDCChip`'s emitted events bubble up through the DOM. | ||
#### `MDCChipSet` | ||
@@ -273,2 +324,4 @@ | ||
See [`chip/index.js`](chip/index.js) and [`chip-set/index.js`](chip-set/index.js) for vanilla DOM implementations of these adapter APIs for reference. | ||
#### `MDCChipAdapter` | ||
@@ -284,12 +337,15 @@ | ||
`eventTargetHasClass(target: EventTarget, className: string) => boolean` | Returns true if target has className, false otherwise | ||
`notifyInteraction() => void` | Emits a custom event `MDCChip:interaction` denoting the chip has been interacted with\* | ||
`notifyTrailingIconInteraction() => void` | Emits a custom event `MDCChip:trailingIconInteraction` denoting the chip's trailing icon has been interacted with\* | ||
`notifyRemoval() => void` | Emits a custom event `MDCChip:removal` denoting the chip will be removed\*\* | ||
`notifyInteraction() => void` | Notifies the Chip Set that the chip has been interacted with\* | ||
`notifySelection(selected) => void` | Notifies the Chip Set that the chip has been selected or deselected\*\* | ||
`notifyTrailingIconInteraction() => void` | Notifies the Chip Set that the chip's trailing icon has been interacted with\* | ||
`notifyRemoval() => void` | Notifies the Chip Set that the chip will be removed\*\*\* | ||
`getComputedStyleValue(propertyName: string) => string` | Returns the computed property value of the given style property on the root element | ||
`setStyleProperty(propertyName: string, value: string) => void` | Sets the property value of the given style property on the root element | ||
> \*_NOTE_: The custom events emitted by `notifyInteraction` and `notifyTrailingIconInteraction` must pass along the target chip's ID via `event.detail.chipId`, as well as bubble to the parent `mdc-chip-set` element. | ||
> \*_NOTE_: `notifyInteraction` and `notifyTrailingIconInteraction` must pass along the target chip's ID, and must be observable by the parent `mdc-chip-set` element (e.g. via DOM event bubbling). | ||
> \*\*_NOTE_: The custom event emitted by `notifyRemoval` must pass along the target chip's ID via `event.detail.chipId` and its root element via `event.detail.root`, as well as bubble to the parent `mdc-chip-set` element. | ||
> \*\*_NOTE_: `notifySelection` must pass along the target chip's ID and selected state, and must be observable by the parent `mdc-chip-set` element (e.g. via DOM event bubbling). | ||
> \*\*\*_NOTE_: `notifyRemoval` must pass along the target chip's ID and its root element, and must be observable by the parent `mdc-chip-set` element (e.g. via DOM event bubbling). | ||
#### `MDCChipSetAdapter` | ||
@@ -318,2 +374,12 @@ | ||
#### `MDCChipFoundation` Event Handlers | ||
When wrapping the Chip foundation, the following events must be bound to the indicated foundation methods: | ||
Events | Element Selector | Foundation Handler | ||
--- | --- | --- | ||
`click`, `keydown` | `.mdc-chip` (root) | `handleInteraction()` | ||
`click`, `keydown` | `.mdc-chip__icon--trailing` (if present) | `handleTrailingIconInteraction()` | ||
`transitionend` | `.mdc-chip` (root) | `handleTransitionEnd()` | ||
#### `MDCChipSetFoundation` | ||
@@ -328,2 +394,13 @@ | ||
`handleChipInteraction(evt: Event) => void` | Handles a custom `MDCChip:interaction` event on the root element | ||
`handleChipSelection(evt: Event) => void` | Handles a custom `MDCChip:selection` event on the root element | ||
`handleChipRemoval(evt: Event) => void` | Handles a custom `MDCChip:removal` event on the root element | ||
#### `MDCChipSetFoundation` Event Handlers | ||
When wrapping the Chip Set foundation, the following events must be bound to the indicated foundation methods: | ||
Events | Element Selector | Foundation Handler | ||
--- | --- | --- | ||
`MDCChip:interaction` | `.mdc-chip-set` (root) | `handleChipInteraction` | ||
`MDCChip:selection` | `.mdc-chip-set` (root) | `handleChipSelection` | ||
`MDCChip:removal` | `.mdc-chip-set` (root) | `handleChipRemoval` |
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
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 too big to display
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
255741
4214
398
+ Added@material/typography@0.40.1(transitive)
- Removed@material/animation@0.39.0(transitive)
- Removed@material/base@0.39.0(transitive)
- Removed@material/typography@0.39.0(transitive)
Updated@material/animation@^0.40.1
Updated@material/base@^0.40.1
Updated@material/checkbox@^0.40.1
Updated@material/elevation@^0.40.1
Updated@material/ripple@^0.40.1
Updated@material/shape@^0.40.1
Updated@material/theme@^0.40.1
Updated@material/typography@^0.40.1