UNPKG

@material/react-text-field

Version:
131 lines (129 loc) 45.4 kB
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("react"),require("classnames"),require("@material/react-floating-label/dist/index.js"),require("@material/react-line-ripple/dist/index.js"),require("@material/react-notched-outline/dist/index.js"));else if("function"==typeof define&&define.amd)define(["react","classnames","@material/react-floating-label/dist/index.js","@material/react-line-ripple/dist/index.js","@material/react-notched-outline/dist/index.js"],e);else{var n="object"==typeof exports?e(require("react"),require("classnames"),require("@material/react-floating-label/dist/index.js"),require("@material/react-line-ripple/dist/index.js"),require("@material/react-notched-outline/dist/index.js")):e(t.react,t.classnames,t["@material/react-floating-label/dist/index.js"],t["@material/react-line-ripple/dist/index.js"],t["@material/react-notched-outline/dist/index.js"]);for(var i in n)("object"==typeof exports?exports:t)[i]=n[i]}}("undefined"!=typeof self?self:this,function(t,e,n,i,r){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=132)}({0:function(e,n){e.exports=t},1:function(t,n){t.exports=e},10:function(t,e,n){"use strict";n.d(e,"b",function(){return r}),n.d(e,"a",function(){return a});"function"==typeof Symbol&&Symbol.iterator; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function r(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var a=function(){return(a=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)}},132:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=this&&this.__assign||function(){return(a=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},o=this&&this.__rest||function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var l=s(n(0)),u=s(n(1)),d=n(164),c=s(n(133));e.Input=c.default;var p=s(n(134));e.Icon=p.default;var f=s(n(135));e.HelperText=f.default;var h=s(n(136));e.CharacterCounter=h.default;var b=s(n(33)),_=s(n(34)),g=s(n(35)),y=d.MDCTextFieldFoundation.cssClasses,m=function(t){function e(e){var n,i=t.call(this,e)||this;return i.textFieldElement=l.default.createRef(),i.floatingLabelElement=l.default.createRef(),i.inputComponent_=null,e.children&&l.default.Children.only(e.children)&&(n=e.children.props.id),i.state={classList:new Set,inputId:n,isFocused:!1,dir:"ltr",disabled:!1,labelIsFloated:!1,initialLabelWidth:0,notchedLabelWidth:0,activeLineRipple:!1,lineRippleCenter:0,outlineIsNotched:!1,isValid:!0,foundation:void 0},i}return r(e,t),e.prototype.componentDidMount=function(){var t=new d.MDCTextFieldFoundation(this.adapter);this.setState({foundation:t}),t.init()},e.prototype.componentWillUnmount=function(){this.state.foundation&&this.state.foundation.destroy()},Object.defineProperty(e.prototype,"classes",{get:function(){var t,e=this.state,n=e.classList,i=e.disabled,r=e.isFocused,a=e.isValid,o=this.props,s=o.className,l=o.dense,d=o.fullWidth,c=o.textarea,p=o.trailingIcon,f=o.leadingIcon,h=o.noLabel;return u.default(y.ROOT,Array.from(n),s,((t={})[y.DENSE]=l,t[y.DISABLED]=i,t[y.FOCUSED]=r,t[y.INVALID]=!a,t[y.OUTLINED]=this.notchedOutlineAdapter.hasOutline()&&!d,t[y.TEXTAREA]=c,t[y.WITH_LEADING_ICON]=f,t["mdc-text-field--fullwidth"]=d,t["mdc-text-field--with-trailing-icon"]=p,t["mdc-text-field--no-label"]=!this.labelAdapter.hasLabel()||h,t))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"otherProps",{get:function(){var t=this.props;t.children,t.className,t.dense,t.floatingLabelClassName,t.fullWidth,t.helperText,t.characterCounter,t.label,t.leadingIcon,t.lineRippleClassName,t.notchedOutlineClassName,t.onLeadingIconSelect,t.onTrailingIconSelect,t.outlined,t.textarea,t.trailingIcon,t.noLabel;return o(t,["children","className","dense","floatingLabelClassName","fullWidth","helperText","characterCounter","label","leadingIcon","lineRippleClassName","notchedOutlineClassName","onLeadingIconSelect","onTrailingIconSelect","outlined","textarea","trailingIcon","noLabel"])},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"adapter",{get:function(){var t=this,e={addClass:function(e){return t.setState({classList:t.state.classList.add(e)})},removeClass:function(e){var n=t.state.classList;n.delete(e),t.setState({classList:n})},hasClass:function(e){return t.classes.split(" ").includes(e)},registerTextFieldInteractionHandler:function(){},deregisterTextFieldInteractionHandler:function(){},registerValidationAttributeChangeHandler:function(){},deregisterValidationAttributeChangeHandler:function(){}};return Object.assign({},e,this.inputAdapter,this.labelAdapter,this.lineRippleAdapter,this.notchedOutlineAdapter)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputAdapter",{get:function(){var t=this;return{isFocused:function(){return t.state.isFocused},getNativeInput:function(){var e=t.inputComponent_;if(e)return{disabled:e.isDisabled(),value:e.getValue(),maxLength:e.getMaxLength(),type:e.getInputType(),validity:{badInput:!!e.isBadInput(),valid:!!e.isValid()}};throw Error("MDCReactTextField: The input did not render properly")},registerInputInteractionHandler:function(){},deregisterInputInteractionHandler:function(){}}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"labelAdapter",{get:function(){var t=this;return{shakeLabel:function(e){var n=t.floatingLabelElement;e&&n&&n.current&&n.current.shake()},floatLabel:function(e){return t.setState({labelIsFloated:e})},hasLabel:function(){return!!t.props.label&&!t.props.fullWidth},getLabelWidth:function(){return t.state.initialLabelWidth}}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineRippleAdapter",{get:function(){var t=this;return{activateLineRipple:function(){return t.setState({activeLineRipple:!0})},deactivateLineRipple:function(){return t.setState({activeLineRipple:!1})},setLineRippleTransformOrigin:function(e){return t.setState({lineRippleCenter:e})}}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"notchedOutlineAdapter",{get:function(){var t=this;return{notchOutline:function(e){return t.setState({outlineIsNotched:!0,notchedLabelWidth:e})},closeOutline:function(){return t.setState({outlineIsNotched:!1})},hasOutline:function(){return!!t.props.outlined||!!t.props.textarea}}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputProps",{get:function(){var t=this,e=l.default.Children.only(this.props.children).props;return Object.assign({},e,{foundation:this.state.foundation,handleFocusChange:function(e){t.setState({isFocused:e}),t.state.foundation&&(e?t.state.foundation.activateFocus():t.state.foundation.deactivateFocus())},setDisabled:function(e){return t.setState({disabled:e})},setInputId:function(e){return t.setState({inputId:e})},syncInput:function(e){return t.inputComponent_=e},inputType:this.props.textarea?"textarea":"input",placeholder:this.props.noLabel?this.props.label:null})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"characterCounterProps",{get:function(){var t=this.inputProps,e=t.value,n=t.maxLength;return{count:e?e.length:0,maxLength:n?parseInt(n):0}},enumerable:!0,configurable:!0}),e.prototype.render=function(){var t=this.props,e=t.fullWidth,n=t.helperText,i=t.characterCounter,r=t.onLeadingIconSelect,o=t.onTrailingIconSelect,s=t.leadingIcon,u=t.trailingIcon,d=t.textarea,c=t.noLabel,p=this.state.foundation;return l.default.createElement(l.default.Fragment,null,l.default.createElement("div",a({},this.otherProps,{className:this.classes,onClick:function(){return p.handleTextFieldInteraction()},onKeyDown:function(){return p.handleTextFieldInteraction()},ref:this.textFieldElement,key:"text-field-container"}),s?this.renderIcon(s,r):null,d&&i&&this.renderCharacterCounter(i),this.renderInput(),this.notchedOutlineAdapter.hasOutline()?this.renderNotchedOutline():l.default.createElement(l.default.Fragment,null,this.labelAdapter.hasLabel()&&!c?this.renderLabel():null,d||e?null:this.renderLineRipple()),u?this.renderIcon(u,o):null),n||i?this.renderHelperLine(n,i):null)},e.prototype.renderInput=function(){var t=l.default.Children.only(this.props.children);return l.default.cloneElement(t,this.inputProps)},e.prototype.renderLabel=function(){var t=this,e=this.props,n=e.label,i=e.floatingLabelClassName,r=this.state.inputId;return l.default.createElement(b.default,{className:i,float:this.state.labelIsFloated,handleWidthChange:function(e){return t.setState({initialLabelWidth:e})},ref:this.floatingLabelElement,htmlFor:r},n)},e.prototype.renderLineRipple=function(){var t=this.props.lineRippleClassName,e=this.state,n=e.activeLineRipple,i=e.lineRippleCenter;return l.default.createElement(_.default,{rippleCenter:i,className:t,active:n})},e.prototype.renderNotchedOutline=function(){var t=this.props.notchedOutlineClassName,e=this.state,n=e.notchedLabelWidth,i=e.outlineIsNotched;return l.default.createElement(g.default,{className:t,notchWidth:n,notch:i},this.labelAdapter.hasLabel()?this.renderLabel():null)},e.prototype.renderHelperLine=function(t,e){return l.default.createElement("div",{className:y.HELPER_LINE},t&&this.renderHelperText(t),e&&!this.props.textarea&&this.renderCharacterCounter(e))},e.prototype.renderHelperText=function(t){var e=this.state.isValid,n=Object.assign({isValid:e,key:"text-field-helper-text"},t.props);return l.default.cloneElement(t,n)},e.prototype.renderIcon=function(t,e){var n=this.state.disabled;return l.default.createElement(p.default,{disabled:n,onSelect:e},t)},e.prototype.renderCharacterCounter=function(t){return l.default.cloneElement(t,Object.assign(this.characterCounterProps,t.props))},e.defaultProps={className:"",dense:!1,floatingLabelClassName:"",fullWidth:!1,lineRippleClassName:"",notchedOutlineClassName:"",outlined:!1,textarea:!1,noLabel:!1},e}(l.default.Component);e.default=m},133:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=this&&this.__assign||function(){return(a=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},o=this&&this.__rest||function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var l=s(n(0)),u=s(n(1)),d=["pattern","min","max","required","step","minlength","maxlength"],c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.inputElement_=l.default.createRef(),e.state={wasUserTriggeredChange:!1,isMounted:!1},e.initializeComponentWithFoundation=function(){var t=e.props,n=t.handleFocusChange,i=t.foundation,r=t.autoFocus,a=t.isValid;r&&n&&n(!0),i&&void 0!==a&&(i.setUseNativeValidation(!1),i.setValid(a))},e.handleFocus=function(t){var n=e.props,i=n.handleFocusChange,r=n.onFocus,a=void 0===r?function(){}:r;i&&i(!0),a(t)},e.handleBlur=function(t){var n=e.props,i=n.handleFocusChange,r=n.onBlur,a=void 0===r?function(){}:r;i&&i(!1),a(t)},e.handleMouseDown=function(t){var n=e.props,i=n.foundation,r=n.onMouseDown,a=void 0===r?function(){}:r;i&&i.setTransformOrigin(t.nativeEvent),a(t)},e.handleTouchStart=function(t){var n=e.props,i=n.foundation,r=n.onTouchStart,a=void 0===r?function(){}:r;i&&i.setTransformOrigin(t.nativeEvent),a(t)},e.handleChange=function(t){var n=e.props,i=n.foundation,r=n.onChange,a=void 0===r?function(){}:r;i&&i.autoCompleteFocus(),e.setState({wasUserTriggeredChange:!0}),a(t)},e.handleValidationAttributeUpdate=function(t){var n=t.foundation;d.some(function(i){var r;return r="minlength"===i?"minLength":"maxlength"===i?"maxLength":i,e.props[r]!==t[r]&&(n.handleValidationAttributeChange([i]),!0)})},e.isBadInput=function(){var t=e.inputElement;return t&&t.validity.badInput},e.isValid=function(){return e.inputElement&&void 0===e.props.isValid?e.inputElement.validity.valid:e.props.isValid},e.isDisabled=function(){return!!e.props.disabled},e.getMaxLength=function(){return"number"==typeof e.props.maxLength?e.props.maxLength:-1},e.getInputType=function(){return String(e.props.inputType)},e.getValue=function(){return e.valueToString(e.props.value)},e}return r(e,t),e.prototype.componentDidMount=function(){var t=this.props,e=t.id,n=t.syncInput,i=t.disabled,r=t.value,a=t.setInputId,o=t.setDisabled,s=t.foundation;n&&n(this),a&&e&&a(e),o&&i&&o(!0),r&&s&&s.setValue(this.valueToString(r)),this.setState({isMounted:!0})},e.prototype.componentDidUpdate=function(t,e){var n=this.props,i=n.id,r=n.foundation,a=n.value,o=n.disabled,s=n.isValid,l=n.setInputId,u=n.setDisabled;if((!e.isMounted&&this.state.isMounted&&this.props.foundation||this.state.isMounted&&!t.foundation&&this.props.foundation)&&this.initializeComponentWithFoundation(),this.handleValidationAttributeUpdate(t),o!==t.disabled&&(u&&u(o),r&&r.setDisabled(!!o)),i!==t.id&&l&&l(i),a!==t.value){var d=this.valueToString(a);!this.state.wasUserTriggeredChange&&r&&r.setValue(d),this.setState({wasUserTriggeredChange:!1})}s!==t.isValid&&r&&(void 0===s?r.setUseNativeValidation(!0):(r.setUseNativeValidation(!1),r.setValid(!!s)))},e.prototype.valueToString=function(t){return"object"==typeof t?t.join(""):"number"==typeof t?t.toString():t||""},Object.defineProperty(e.prototype,"classes",{get:function(){return u.default("mdc-text-field__input",this.props.className)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputElement",{get:function(){return this.inputElement_.current},enumerable:!0,configurable:!0}),e.prototype.render=function(){var t=this.props,e=t.inputType,n=t.disabled,i=(t.className,t.foundation,t.syncInput,t.isValid,t.value),r=(t.handleFocusChange,t.setDisabled,t.setInputId,t.onFocus,t.onBlur,t.onMouseDown,t.onTouchStart,t.onChange,o(t,["inputType","disabled","className","foundation","syncInput","isValid","value","handleFocusChange","setDisabled","setInputId","onFocus","onBlur","onMouseDown","onTouchStart","onChange"])),s=Object.assign({},{onFocus:this.handleFocus,onBlur:this.handleBlur,onMouseDown:this.handleMouseDown,onTouchStart:this.handleTouchStart,onChange:this.handleChange,disabled:n,value:i,ref:this.inputElement_,className:this.classes},r);return"input"===e?l.default.createElement("input",a({},s)):l.default.createElement("textarea",a({},s))},e.defaultProps={className:"",inputType:"input",disabled:!1,id:"",setDisabled:function(){},setInputId:function(){},handleFocusChange:function(){},value:""},e}(l.default.Component);e.default=c},134:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=this&&this.__assign||function(){return(a=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=o(n(0)),l=o(n(1)),u=n(170),d=function(t){function e(e){var n=t.call(this,e)||this;n.handleClick=function(t){return n.foundation.handleInteraction(t.nativeEvent)},n.handleKeyDown=function(t){return n.foundation.handleInteraction(t.nativeEvent)},n.addIconAttrsToChildren=function(){var t=n.state,e=t.tabindex,i=t.role,r=s.default.Children.only(n.props.children),a=l.default("mdc-text-field__icon",r.props.className),o=Object.assign({},r.props,{className:a,onClick:n.handleClick,onKeyDown:n.handleKeyDown,tabIndex:e,role:i});return s.default.cloneElement(r,o)};var i=e.children.props.role;return n.state={tabindex:n.tabindex,role:i},n}return r(e,t),e.prototype.componentDidMount=function(){this.foundation=new u.MDCTextFieldIconFoundation(this.adapter),this.foundation.init(),this.props.disabled&&this.foundation.setDisabled(!0)},e.prototype.componentDidUpdate=function(t){this.props.disabled!==t.disabled&&this.foundation.setDisabled(!!this.props.disabled),this.props.onSelect!==t.onSelect&&this.setState({tabindex:this.tabindex})},e.prototype.componentWillUnmount=function(){this.foundation.destroy()},Object.defineProperty(e.prototype,"tabindex",{get:function(){return"number"==typeof this.props.children.props.tabIndex?this.props.children.props.tabIndex:this.props.onSelect?0:-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"adapter",{get:function(){var t=this;return{getAttr:function(e){var n=t.state[e];return n||"number"==typeof n&&!isNaN(n)?n.toString():""},setAttr:function(e,n){return t.setState(function(t){var i;return a({},t,((i={})[e]="tabindex"===e?Number(n):n,i))})},removeAttr:function(e){return t.setState(function(t){var n;return a({},t,((n={})[e]=null,n))})},notifyIconAction:function(){return t.props.onSelect&&t.props.onSelect()},setContent:function(){},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){}}},enumerable:!0,configurable:!0}),e.prototype.render=function(){return this.addIconAttrsToChildren()},e.defaultProps={disabled:!1},e}(s.default.Component);e.default=d},135:function(t,e,n){"use strict";var i,r,a=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var l=s(n(0)),u=s(n(1)),d=n(169),c=d.MDCTextFieldHelperTextFoundation.cssClasses,p=function(t){function e(e){var n,i=t.call(this,e)||this;return i.state=((n={})["aria-hidden"]=e["aria-hidden"],n.role=e.role,n.classList=new Set,n),i}return a(e,t),e.prototype.componentDidMount=function(){this.foundation=new d.MDCTextFieldHelperTextFoundation(this.adapter),this.foundation.init(),this.props.showToScreenReader&&this.foundation.showToScreenReader(),this.props.isValid||this.foundation.setValidity(!1),this.props.isValidationMessage&&this.foundation.setValidation(!0)},e.prototype.componentDidUpdate=function(t){this.props.showToScreenReader!==t.showToScreenReader&&this.props.showToScreenReader&&this.foundation.showToScreenReader(),this.props.isValid!==t.isValid&&this.foundation.setValidity(!!this.props.isValid),this.props.isValidationMessage!==t.isValidationMessage&&this.props.isValidationMessage&&this.foundation.setValidation(this.props.isValidationMessage)},e.prototype.componentWillUnmount=function(){this.foundation.destroy()},Object.defineProperty(e.prototype,"classes",{get:function(){var t,e=this.props,n=e.className,i=e.persistent,r=e.validation;return u.default(c.ROOT,n,((t={})[c.HELPER_TEXT_PERSISTENT]=i,t[c.HELPER_TEXT_VALIDATION_MSG]=r,t))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"adapter",{get:function(){var t=this;return{addClass:function(e){return t.setState({classList:t.state.classList.add(e)})},removeClass:function(e){var n=t.state.classList;n.delete(e),t.setState({classList:n})},hasClass:function(e){return t.classes.split(" ").includes(e)},setAttr:function(e,n){return t.setState(function(t){var i;return o({},t,((i={})[e]=n,i))})},removeAttr:function(e){return t.setState(function(t){var n;return o({},t,((n={})[e]=null,n))})},setContent:function(){}}},enumerable:!0,configurable:!0}),e.prototype.render=function(){return l.default.createElement("p",{className:this.classes,role:this.state.role,"aria-hidden":this.state["aria-hidden"]},this.props.children)},e.defaultProps=((r={})["aria-hidden"]=!1,r.className="",r.isValid=!0,r.isValidationMessage=!1,r.persistent=!1,r.showToScreenReader=!1,r.validation=!1,r),e}(l.default.Component);e.default=p},136:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=this&&this.__assign||function(){return(a=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},o=this&&this.__rest||function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var l=s(n(0)),u=s(n(1)),d=n(163),c=d.MDCTextFieldCharacterCounterFoundation.cssClasses,p="${count}",f="${maxLength}",h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.foundation=new d.MDCTextFieldCharacterCounterFoundation(e.adapter),e}return r(e,t),e.prototype.componentWillUnmount=function(){this.foundation.destroy()},Object.defineProperty(e.prototype,"adapter",{get:function(){return{setContent:function(){}}},enumerable:!0,configurable:!0}),e.prototype.renderTemplate=function(t){var e=this.props,n=e.count,i=void 0===n?0:n,r=e.maxLength,a=void 0===r?0:r;return t.replace(p,i.toString()).replace(f,a.toString())},Object.defineProperty(e.prototype,"classes",{get:function(){return u.default(c.ROOT,this.props.className)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"otherProps",{get:function(){var t=this.props;t.className,t.count,t.maxLength,t.template;return o(t,["className","count","maxLength","template"])},enumerable:!0,configurable:!0}),e.prototype.render=function(){var t=this.props.template;return l.default.createElement("div",a({className:this.classes},this.otherProps),this.renderTemplate(t||p+" / "+f))},e}(l.default.Component);e.default=h},14:function(t,e,n){"use strict";n.d(e,"a",function(){return i}); /** * @license * Copyright 2016 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. */ var i=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}()},163:function(t,e,n){"use strict";n.r(e);var i=n(10),r=n(14),a={ROOT:"mdc-text-field-character-counter"},o={ROOT_SELECTOR:"."+a.ROOT};n.d(e,"MDCTextFieldCharacterCounterFoundation",function(){return s}); /** * @license * Copyright 2019 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. */ var s=function(t){function e(n){return t.call(this,i.a({},e.defaultAdapter,n))||this}return i.b(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return a},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return o},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{setContent:function(){}}},enumerable:!0,configurable:!0}),e.prototype.setCounterValue=function(t,e){t=Math.min(t,e),this.adapter_.setContent(t+" / "+e)},e}(r.a);e.default=s},164:function(t,e,n){"use strict";n.r(e);var i=n(10),r=n(14),a={ARIA_CONTROLS:"aria-controls",ICON_SELECTOR:".mdc-text-field__icon",INPUT_SELECTOR:".mdc-text-field__input",LABEL_SELECTOR:".mdc-floating-label",LINE_RIPPLE_SELECTOR:".mdc-line-ripple",OUTLINE_SELECTOR:".mdc-notched-outline"},o={DENSE:"mdc-text-field--dense",DISABLED:"mdc-text-field--disabled",FOCUSED:"mdc-text-field--focused",FULLWIDTH:"mdc-text-field--fullwidth",HELPER_LINE:"mdc-text-field-helper-line",INVALID:"mdc-text-field--invalid",NO_LABEL:"mdc-text-field--no-label",OUTLINED:"mdc-text-field--outlined",ROOT:"mdc-text-field",TEXTAREA:"mdc-text-field--textarea",WITH_LEADING_ICON:"mdc-text-field--with-leading-icon",WITH_TRAILING_ICON:"mdc-text-field--with-trailing-icon"},s={DENSE_LABEL_SCALE:.923,LABEL_SCALE:.75},l=["pattern","min","max","required","step","minlength","maxlength"],u=["color","date","datetime-local","month","range","time","week"];n.d(e,"MDCTextFieldFoundation",function(){return p}); /** * @license * Copyright 2016 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. */ var d=["mousedown","touchstart"],c=["click","keydown"],p=function(t){function e(n,r){void 0===r&&(r={});var a=t.call(this,i.a({},e.defaultAdapter,n))||this;return a.isFocused_=!1,a.receivedUserInput_=!1,a.isValid_=!0,a.useNativeValidation_=!0,a.helperText_=r.helperText,a.characterCounter_=r.characterCounter,a.leadingIcon_=r.leadingIcon,a.trailingIcon_=r.trailingIcon,a.inputFocusHandler_=function(){return a.activateFocus()},a.inputBlurHandler_=function(){return a.deactivateFocus()},a.inputInputHandler_=function(){return a.handleInput()},a.setPointerXOffset_=function(t){return a.setTransformOrigin(t)},a.textFieldInteractionHandler_=function(){return a.handleTextFieldInteraction()},a.validationAttributeChangeHandler_=function(t){return a.handleValidationAttributeChange(t)},a}return i.b(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return o},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return a},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return s},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shouldAlwaysFloat_",{get:function(){var t=this.getNativeInput_().type;return u.indexOf(t)>=0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shouldFloat",{get:function(){return this.shouldAlwaysFloat_||this.isFocused_||Boolean(this.getValue())||this.isBadInput_()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shouldShake",{get:function(){return!this.isFocused_&&!this.isValid()&&Boolean(this.getValue())},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!0},registerTextFieldInteractionHandler:function(){},deregisterTextFieldInteractionHandler:function(){},registerInputInteractionHandler:function(){},deregisterInputInteractionHandler:function(){},registerValidationAttributeChangeHandler:function(){return new MutationObserver(function(){})},deregisterValidationAttributeChangeHandler:function(){},getNativeInput:function(){return null},isFocused:function(){return!1},activateLineRipple:function(){},deactivateLineRipple:function(){},setLineRippleTransformOrigin:function(){},shakeLabel:function(){},floatLabel:function(){},hasLabel:function(){return!1},getLabelWidth:function(){return 0},hasOutline:function(){return!1},notchOutline:function(){},closeOutline:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){var t=this;this.adapter_.isFocused()?this.inputFocusHandler_():this.adapter_.hasLabel()&&this.shouldFloat&&(this.notchOutline(!0),this.adapter_.floatLabel(!0)),this.adapter_.registerInputInteractionHandler("focus",this.inputFocusHandler_),this.adapter_.registerInputInteractionHandler("blur",this.inputBlurHandler_),this.adapter_.registerInputInteractionHandler("input",this.inputInputHandler_),d.forEach(function(e){t.adapter_.registerInputInteractionHandler(e,t.setPointerXOffset_)}),c.forEach(function(e){t.adapter_.registerTextFieldInteractionHandler(e,t.textFieldInteractionHandler_)}),this.validationObserver_=this.adapter_.registerValidationAttributeChangeHandler(this.validationAttributeChangeHandler_),this.setCharacterCounter_(this.getValue().length)},e.prototype.destroy=function(){var t=this;this.adapter_.deregisterInputInteractionHandler("focus",this.inputFocusHandler_),this.adapter_.deregisterInputInteractionHandler("blur",this.inputBlurHandler_),this.adapter_.deregisterInputInteractionHandler("input",this.inputInputHandler_),d.forEach(function(e){t.adapter_.deregisterInputInteractionHandler(e,t.setPointerXOffset_)}),c.forEach(function(e){t.adapter_.deregisterTextFieldInteractionHandler(e,t.textFieldInteractionHandler_)}),this.adapter_.deregisterValidationAttributeChangeHandler(this.validationObserver_)},e.prototype.handleTextFieldInteraction=function(){var t=this.adapter_.getNativeInput();t&&t.disabled||(this.receivedUserInput_=!0)},e.prototype.handleValidationAttributeChange=function(t){var e=this;t.some(function(t){return l.indexOf(t)>-1&&(e.styleValidity_(!0),!0)}),t.indexOf("maxlength")>-1&&this.setCharacterCounter_(this.getValue().length)},e.prototype.notchOutline=function(t){if(this.adapter_.hasOutline())if(t){var e=this.adapter_.hasClass(o.DENSE)?s.DENSE_LABEL_SCALE:s.LABEL_SCALE,n=this.adapter_.getLabelWidth()*e;this.adapter_.notchOutline(n)}else this.adapter_.closeOutline()},e.prototype.activateFocus=function(){this.isFocused_=!0,this.styleFocused_(this.isFocused_),this.adapter_.activateLineRipple(),this.adapter_.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter_.floatLabel(this.shouldFloat),this.adapter_.shakeLabel(this.shouldShake)),this.helperText_&&this.helperText_.showToScreenReader()},e.prototype.setTransformOrigin=function(t){var e=t.touches,n=e?e[0]:t,i=n.target.getBoundingClientRect(),r=n.clientX-i.left;this.adapter_.setLineRippleTransformOrigin(r)},e.prototype.handleInput=function(){this.autoCompleteFocus(),this.setCharacterCounter_(this.getValue().length)},e.prototype.autoCompleteFocus=function(){this.receivedUserInput_||this.activateFocus()},e.prototype.deactivateFocus=function(){this.isFocused_=!1,this.adapter_.deactivateLineRipple();var t=this.isValid();this.styleValidity_(t),this.styleFocused_(this.isFocused_),this.adapter_.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter_.floatLabel(this.shouldFloat),this.adapter_.shakeLabel(this.shouldShake)),this.shouldFloat||(this.receivedUserInput_=!1)},e.prototype.getValue=function(){return this.getNativeInput_().value},e.prototype.setValue=function(t){this.getValue()!==t&&(this.getNativeInput_().value=t),this.setCharacterCounter_(t.length);var e=this.isValid();this.styleValidity_(e),this.adapter_.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter_.floatLabel(this.shouldFloat),this.adapter_.shakeLabel(this.shouldShake))},e.prototype.isValid=function(){return this.useNativeValidation_?this.isNativeInputValid_():this.isValid_},e.prototype.setValid=function(t){this.isValid_=t,this.styleValidity_(t);var e=!t&&!this.isFocused_;this.adapter_.hasLabel()&&this.adapter_.shakeLabel(e)},e.prototype.setUseNativeValidation=function(t){this.useNativeValidation_=t},e.prototype.isDisabled=function(){return this.getNativeInput_().disabled},e.prototype.setDisabled=function(t){this.getNativeInput_().disabled=t,this.styleDisabled_(t)},e.prototype.setHelperTextContent=function(t){this.helperText_&&this.helperText_.setContent(t)},e.prototype.setLeadingIconAriaLabel=function(t){this.leadingIcon_&&this.leadingIcon_.setAriaLabel(t)},e.prototype.setLeadingIconContent=function(t){this.leadingIcon_&&this.leadingIcon_.setContent(t)},e.prototype.setTrailingIconAriaLabel=function(t){this.trailingIcon_&&this.trailingIcon_.setAriaLabel(t)},e.prototype.setTrailingIconContent=function(t){this.trailingIcon_&&this.trailingIcon_.setContent(t)},e.prototype.setCharacterCounter_=function(t){if(this.characterCounter_){var e=this.getNativeInput_().maxLength;if(-1===e)throw new Error("MDCTextFieldFoundation: Expected maxlength html property on text input or textarea.");this.characterCounter_.setCounterValue(t,e)}},e.prototype.isBadInput_=function(){return this.getNativeInput_().validity.badInput||!1},e.prototype.isNativeInputValid_=function(){return this.getNativeInput_().validity.valid},e.prototype.styleValidity_=function(t){var n=e.cssClasses.INVALID;t?this.adapter_.removeClass(n):this.adapter_.addClass(n),this.helperText_&&this.helperText_.setValidity(t)},e.prototype.styleFocused_=function(t){var n=e.cssClasses.FOCUSED;t?this.adapter_.addClass(n):this.adapter_.removeClass(n)},e.prototype.styleDisabled_=function(t){var n=e.cssClasses,i=n.DISABLED,r=n.INVALID;t?(this.adapter_.addClass(i),this.adapter_.removeClass(r)):this.adapter_.removeClass(i),this.leadingIcon_&&this.leadingIcon_.setDisabled(t),this.trailingIcon_&&this.trailingIcon_.setDisabled(t)},e.prototype.getNativeInput_=function(){return(this.adapter_?this.adapter_.getNativeInput():null)||{disabled:!1,maxLength:-1,type:"input",validity:{badInput:!1,valid:!0},value:""}},e}(r.a);e.default=p},169:function(t,e,n){"use strict";n.r(e);var i=n(10),r=n(14),a={HELPER_TEXT_PERSISTENT:"mdc-text-field-helper-text--persistent",HELPER_TEXT_VALIDATION_MSG:"mdc-text-field-helper-text--validation-msg",ROOT:"mdc-text-field-helper-text"},o={ARIA_HIDDEN:"aria-hidden",ROLE:"role",ROOT_SELECTOR:"."+a.ROOT};n.d(e,"MDCTextFieldHelperTextFoundation",function(){return s}); /** * @license * Copyright 2017 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. */ var s=function(t){function e(n){return t.call(this,i.a({},e.defaultAdapter,n))||this}return i.b(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return a},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return o},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},setAttr:function(){},removeAttr:function(){},setContent:function(){}}},enumerable:!0,configurable:!0}),e.prototype.setContent=function(t){this.adapter_.setContent(t)},e.prototype.setPersistent=function(t){t?this.adapter_.addClass(a.HELPER_TEXT_PERSISTENT):this.adapter_.removeClass(a.HELPER_TEXT_PERSISTENT)},e.prototype.setValidation=function(t){t?this.adapter_.addClass(a.HELPER_TEXT_VALIDATION_MSG):this.adapter_.removeClass(a.HELPER_TEXT_VALIDATION_MSG)},e.prototype.showToScreenReader=function(){this.adapter_.removeAttr(o.ARIA_HIDDEN)},e.prototype.setValidity=function(t){var e=this.adapter_.hasClass(a.HELPER_TEXT_PERSISTENT),n=this.adapter_.hasClass(a.HELPER_TEXT_VALIDATION_MSG)&&!t;n?this.adapter_.setAttr(o.ROLE,"alert"):this.adapter_.removeAttr(o.ROLE),e||n||this.hide_()},e.prototype.hide_=function(){this.adapter_.setAttr(o.ARIA_HIDDEN,"true")},e}(r.a);e.default=s},170:function(t,e,n){"use strict";n.r(e);var i=n(10),r=n(14),a={ICON_EVENT:"MDCTextField:icon",ICON_ROLE:"button"},o={ROOT:"mdc-text-field__icon"};n.d(e,"MDCTextFieldIconFoundation",function(){return l}); /** * @license * Copyright 2017 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. */ var s=["click","keydown"],l=function(t){function e(n){var r=t.call(this,i.a({},e.defaultAdapter,n))||this;return r.savedTabIndex_=null,r.interactionHandler_=function(t){return r.handleInteraction(t)},r}return i.b(e,t),Object.defineProperty(e,"strings",{get:function(){return a},enumerable:!0,configurable:!0}),Object.defineProperty(e,"cssClasses",{get:function(){return o},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{getAttr:function(){return null},setAttr:function(){},removeAttr:function(){},setContent:function(){},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){},notifyIconAction:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){var t=this;this.savedTabIndex_=this.adapter_.getAttr("tabindex"),s.forEach(function(e){t.adapter_.registerInteractionHandler(e,t.interactionHandler_)})},e.prototype.destroy=function(){var t=this;s.forEach(function(e){t.adapter_.deregisterInteractionHandler(e,t.interactionHandler_)})},e.prototype.setDisabled=function(t){this.savedTabIndex_&&(t?(this.adapter_.setAttr("tabindex","-1"),this.adapter_.removeAttr("role")):(this.adapter_.setAttr("tabindex",this.savedTabIndex_),this.adapter_.setAttr("role",a.ICON_ROLE)))},e.prototype.setAriaLabel=function(t){this.adapter_.setAttr("aria-label",t)},e.prototype.setContent=function(t){this.adapter_.setContent(t)},e.prototype.handleInteraction=function(t){var e="Enter"===t.key||13===t.keyCode;("click"===t.type||e)&&this.adapter_.notifyIconAction()},e}(r.a);e.default=l},33:function(t,e){t.exports=n},34:function(t,e){t.exports=i},35:function(t,e){t.exports=r}})}); //# sourceMappingURL=text-field.js.map