UNPKG

@iqmo/browser

Version:
5 lines (4 loc) 21.8 kB
import{r as b,cq as G,cr as J,cs as Q,ct as Z,cV as u,cX as P,c2 as T,cY as be,cm as ee,cW as D,c3 as w,cA as re,cB as te}from"./index-0xtYjrTa.js";var ye=["title","size","color","overrides"];function A(){return A=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},A.apply(this,arguments)}function ge(e,r){if(e==null)return{};var t=he(e,r),o,n;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)o=i[n],!(r.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(t[o]=e[o])}return t}function he(e,r){if(e==null)return{};var t={},o=Object.keys(e),n,i;for(i=0;i<o.length;i++)n=o[i],!(r.indexOf(n)>=0)&&(t[n]=e[n]);return t}function me(e,r){return we(e)||Oe(e,r)||Ce(e,r)||ve()}function ve(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ce(e,r){if(e){if(typeof e=="string")return oe(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return oe(e,r)}}function oe(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,o=new Array(r);t<r;t++)o[t]=e[t];return o}function Oe(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var o=[],n=!0,i=!1,a,l;try{for(t=t.call(e);!(n=(a=t.next()).done)&&(o.push(a.value),!(r&&o.length===r));n=!0);}catch(s){i=!0,l=s}finally{try{!n&&t.return!=null&&t.return()}finally{if(i)throw l}}return o}}function we(e){if(Array.isArray(e))return e}function Fe(e,r){var t=G(),o=me(t,2),n=o[1],i=e.title,a=i===void 0?"Hide":i,l=e.size,s=e.color,c=e.overrides,p=c===void 0?{}:c,y=ge(e,ye),h=J({component:n.icons&&n.icons.Hide?n.icons.Hide:null},p&&p.Svg?Q(p.Svg):{});return b.createElement(Z,A({viewBox:"0 0 20 20",ref:r,title:a,size:l,color:s,overrides:{Svg:h}},y),b.createElement("path",{d:"M12.81 4.36l-1.77 1.78a4 4 0 00-4.9 4.9l-2.76 2.75C2.06 12.79.96 11.49.2 10a11 11 0 0112.6-5.64zm3.8 1.85c1.33 1 2.43 2.3 3.2 3.79a11 11 0 01-12.62 5.64l1.77-1.78a4 4 0 004.9-4.9l2.76-2.75zm-.25-3.99l1.42 1.42L3.64 17.78l-1.42-1.42L16.36 2.22z"}))}const Se=b.forwardRef(Fe);var ke=["title","size","color","overrides"];function V(){return V=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},V.apply(this,arguments)}function xe(e,r){if(e==null)return{};var t=Pe(e,r),o,n;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)o=i[n],!(r.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(t[o]=e[o])}return t}function Pe(e,r){if(e==null)return{};var t={},o=Object.keys(e),n,i;for(i=0;i<o.length;i++)n=o[i],!(r.indexOf(n)>=0)&&(t[n]=e[n]);return t}function Te(e,r){return $e(e)||Re(e,r)||Be(e,r)||je()}function je(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Be(e,r){if(e){if(typeof e=="string")return ne(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ne(e,r)}}function ne(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,o=new Array(r);t<r;t++)o[t]=e[t];return o}function Re(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var o=[],n=!0,i=!1,a,l;try{for(t=t.call(e);!(n=(a=t.next()).done)&&(o.push(a.value),!(r&&o.length===r));n=!0);}catch(s){i=!0,l=s}finally{try{!n&&t.return!=null&&t.return()}finally{if(i)throw l}}return o}}function $e(e){if(Array.isArray(e))return e}function Ee(e,r){var t=G(),o=Te(t,2),n=o[1],i=e.title,a=i===void 0?"Show":i,l=e.size,s=e.color,c=e.overrides,p=c===void 0?{}:c,y=xe(e,ke),h=J({component:n.icons&&n.icons.Show?n.icons.Show:null},p&&p.Svg?Q(p.Svg):{});return b.createElement(Z,V({viewBox:"0 0 20 20",ref:r,title:a,size:l,color:s,overrides:{Svg:h}},y),b.createElement("path",{d:"M.2 10a11 11 0 0119.6 0A11 11 0 01.2 10zm9.8 4a4 4 0 100-8 4 4 0 000 8zm0-2a2 2 0 110-4 2 2 0 010 4z"}))}const Ie=b.forwardRef(Ee);function N(e,r){var t=e.disabled,o=e.error,n=e.positive,i=e.adjoined,a=e.size,l=e.required,s=e.resize,c=e.readOnly,p=r.isFocused;return{$isFocused:p,$disabled:t,$error:o,$positive:n,$adjoined:i,$size:a,$required:l,$resize:s,$isReadOnly:c}}function ie(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function g(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?ie(Object(t),!0).forEach(function(o){d(e,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ie(Object(t)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(t,o))})}return e}function d(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var K=T("button",function(e){var r,t=e.$theme,o=e.$size,n=e.$isFocusVisible,i=(r={},d(r,u.mini,t.sizing.scale400),d(r,u.compact,t.sizing.scale400),d(r,u.default,t.sizing.scale300),d(r,u.large,t.sizing.scale200),r)[o];return{display:"flex",alignItems:"center",borderTopStyle:"none",borderBottomStyle:"none",borderLeftStyle:"none",borderRightStyle:"none",background:"none",paddingLeft:i,paddingRight:i,outline:n?"solid 3px ".concat(t.colors.accent):"none",color:t.colors.contentPrimary}});K.displayName="StyledMaskToggleButton",K.displayName="StyledMaskToggleButton";var W=T("div",function(e){var r,t=e.$alignTop,o=t===void 0?!1:t,n=e.$size,i=e.$theme,a=(r={},d(r,u.mini,i.sizing.scale200),d(r,u.compact,i.sizing.scale200),d(r,u.default,i.sizing.scale100),d(r,u.large,i.sizing.scale0),r)[n];return{display:"flex",alignItems:o?"flex-start":"center",paddingLeft:a,paddingRight:a,paddingTop:o?i.sizing.scale500:"0px",color:i.colors.contentPrimary}});W.displayName="StyledClearIconContainer",W.displayName="StyledClearIconContainer";var _=T(be,function(e){var r=e.$theme,t=e.$isFocusVisible;return{cursor:"pointer",outline:t?"solid 3px ".concat(r.colors.accent):"none"}});_.displayName="StyledClearIcon",_.displayName="StyledClearIcon";function ze(e,r){var t;return(t={},d(t,u.mini,{paddingTop:r.scale100,paddingBottom:r.scale100,paddingLeft:r.scale550,paddingRight:r.scale550}),d(t,u.compact,{paddingTop:r.scale200,paddingBottom:r.scale200,paddingLeft:r.scale550,paddingRight:r.scale550}),d(t,u.default,{paddingTop:r.scale400,paddingBottom:r.scale400,paddingLeft:r.scale550,paddingRight:r.scale550}),d(t,u.large,{paddingTop:r.scale550,paddingBottom:r.scale550,paddingLeft:r.scale550,paddingRight:r.scale550}),t)[e]}function Me(e,r,t,o,n){var i=e===P.both||e===P.left&&o!=="rtl"||e===P.right&&o==="rtl"||n&&o==="rtl",a=e===P.both||e===P.right&&o!=="rtl"||e===P.left&&o==="rtl"||n&&o!=="rtl";return{paddingLeft:i?t.scale550:"0px",paddingRight:a?t.scale550:"0px"}}function I(e,r){var t;return(t={},d(t,u.mini,r.font100),d(t,u.compact,r.font200),d(t,u.default,r.font300),d(t,u.large,r.font400),t)[e]}function Le(e,r,t){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,n=arguments.length>4?arguments[4]:void 0;return e?{borderLeftColor:n.inputFillDisabled,borderRightColor:n.inputFillDisabled,borderTopColor:n.inputFillDisabled,borderBottomColor:n.inputFillDisabled,backgroundColor:n.inputFillDisabled}:r?{borderLeftColor:n.borderSelected,borderRightColor:n.borderSelected,borderTopColor:n.borderSelected,borderBottomColor:n.borderSelected,backgroundColor:n.inputFillActive}:t?{borderLeftColor:n.inputBorderError,borderRightColor:n.inputBorderError,borderTopColor:n.inputBorderError,borderBottomColor:n.inputBorderError,backgroundColor:n.inputFillError}:o?{borderLeftColor:n.inputBorderPositive,borderRightColor:n.inputBorderPositive,borderTopColor:n.inputBorderPositive,borderBottomColor:n.inputBorderPositive,backgroundColor:n.inputFillPositive}:{borderLeftColor:n.inputBorder,borderRightColor:n.inputBorder,borderTopColor:n.inputBorder,borderBottomColor:n.inputBorder,backgroundColor:n.inputFill}}function De(e,r){var t=r.inputBorderRadius;return e===u.mini&&(t=r.inputBorderRadiusMini),{borderTopLeftRadius:t,borderBottomLeftRadius:t,borderTopRightRadius:t,borderBottomRightRadius:t}}var ae=function(e){var r=e.$isFocused,t=e.$adjoined,o=e.$error,n=e.$disabled,i=e.$positive,a=e.$size,l=e.$theme,s=e.$theme,c=s.borders,p=s.colors,y=s.sizing,h=s.typography,C=s.animation,S=e.$hasIconTrailing;return g(g(g(g({boxSizing:"border-box",display:"flex",overflow:"hidden",width:"100%",borderLeftWidth:"2px",borderRightWidth:"2px",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",transitionProperty:"border",transitionDuration:C.timing200,transitionTimingFunction:C.easeOutCurve},De(a,c)),I(a,h)),Le(n,r,o,i,p)),Me(t,a,y,l.direction,S))},q=T("div",ae);q.displayName="Root",q.displayName="Root";function Ae(e,r){var t;return(t={},d(t,u.mini,{paddingRight:r.scale400,paddingLeft:r.scale400}),d(t,u.compact,{paddingRight:r.scale400,paddingLeft:r.scale400}),d(t,u.default,{paddingRight:r.scale300,paddingLeft:r.scale300}),d(t,u.large,{paddingRight:r.scale200,paddingLeft:r.scale200}),t)[e]}function Ve(e,r,t,o,n){return e?{color:n.inputEnhancerTextDisabled,backgroundColor:n.inputFillDisabled}:r?{color:n.contentPrimary,backgroundColor:n.inputFillActive}:t?{color:n.contentPrimary,backgroundColor:n.inputFillError}:o?{color:n.contentPrimary,backgroundColor:n.inputFillPositive}:{color:n.contentPrimary,backgroundColor:n.inputFill}}var H=T("div",function(e){var r=e.$size,t=e.$disabled,o=e.$isFocused,n=e.$error,i=e.$positive,a=e.$theme,l=a.colors,s=a.sizing,c=a.typography,p=a.animation;return g(g(g({display:"flex",alignItems:"center",justifyContent:"center",transitionProperty:"color, background-color",transitionDuration:p.timing200,transitionTimingFunction:p.easeOutCurve},I(r,c)),Ae(r,s)),Ve(t,o,n,i,l))});H.displayName="InputEnhancer",H.displayName="InputEnhancer";function Ne(e,r,t,o,n){return e?{color:n.inputTextDisabled,backgroundColor:n.inputFillDisabled}:r?{color:n.contentPrimary,backgroundColor:n.inputFillActive}:t?{color:n.contentPrimary,backgroundColor:n.inputFillError}:o?{color:n.contentPrimary,backgroundColor:n.inputFillPositive}:{color:n.contentPrimary,backgroundColor:n.inputFill}}var le=function(e){var r=e.$isFocused,t=e.$error,o=e.$disabled,n=e.$positive,i=e.$size,a=e.$theme,l=a.colors,s=a.typography,c=a.animation;return g(g({display:"flex",width:"100%",transitionProperty:"background-color",transitionDuration:c.timing200,transitionTimingFunction:c.easeOutCurve},I(i,s)),Ne(o,r,t,n,l))},U=T("div",le);U.displayName="InputContainer",U.displayName="InputContainer";function Ke(e,r,t,o){return e?{color:o.inputTextDisabled,"-webkit-text-fill-color":o.inputTextDisabled,caretColor:o.contentPrimary,"::placeholder":{color:o.inputPlaceholderDisabled}}:{color:o.contentPrimary,caretColor:o.contentPrimary,"::placeholder":{color:o.inputPlaceholder}}}var se=function(e){var r=e.$disabled,t=e.$isFocused,o=e.$error,n=e.$size,i=e.$theme,a=i.colors,l=i.sizing,s=i.typography;return g(g(g({boxSizing:"border-box",backgroundColor:"transparent",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,borderLeftStyle:"none",borderRightStyle:"none",borderTopStyle:"none",borderBottomStyle:"none",outline:"none",width:"100%",minWidth:0,maxWidth:"100%",cursor:r?"not-allowed":"text",margin:"0",paddingTop:"0",paddingBottom:"0",paddingLeft:"0",paddingRight:"0"},I(n,s)),ze(n,l)),Ke(r,t,o,a))},z=T("input",se);z.displayName="Input",z.displayName="Input";function We(e){var r;return typeof window.Event=="function"?r=new window.Event(e,{bubbles:!0,cancelable:!0}):(r=document.createEvent("Event"),r.initEvent(e,!0,!0)),r}function X(e){"@babel/helpers - typeof";return X=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},X(e)}function m(){return m=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},m.apply(this,arguments)}function F(e,r){return Ue(e)||He(e,r)||qe(e,r)||_e()}function _e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qe(e,r){if(e){if(typeof e=="string")return ue(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ue(e,r)}}function ue(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,o=new Array(r);t<r;t++)o[t]=e[t];return o}function He(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var o=[],n=!0,i=!1,a,l;try{for(t=t.call(e);!(n=(a=t.next()).done)&&(o.push(a.value),!(r&&o.length===r));n=!0);}catch(s){i=!0,l=s}finally{try{!n&&t.return!=null&&t.return()}finally{if(i)throw l}}return o}}function Ue(e){if(Array.isArray(e))return e}function Xe(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function Ye(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Ge(e,r,t){return r&&Ye(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Je(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&Y(e,r)}function Y(e,r){return Y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,o){return t.__proto__=o,t},Y(e,r)}function Qe(e){var r=er();return function(){var t=M(e),o;if(r){var n=M(this).constructor;o=Reflect.construct(t,arguments,n)}else o=t.apply(this,arguments);return Ze(this,o)}}function Ze(e,r){if(r&&(X(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return v(e)}function v(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function er(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function M(e){return M=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},M(e)}function f(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var ce=function(){return null},pe=function(e){Je(t,e);var r=Qe(t);function t(){var o;Xe(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return o=r.call.apply(r,[this].concat(i)),f(v(o),"inputRef",o.props.inputRef||b.createRef()),f(v(o),"state",{isFocused:o.props.autoFocus||!1,isMasked:o.props.type==="password",initialType:o.props.type,isFocusVisibleForClear:!1,isFocusVisibleForMaskToggle:!1}),f(v(o),"onInputKeyDown",function(l){o.props.clearOnEscape&&l.key==="Escape"&&o.inputRef.current&&!o.props.readOnly&&(o.clearValue(),l.stopPropagation())}),f(v(o),"onClearIconClick",function(){o.inputRef.current&&o.clearValue(),o.inputRef.current&&o.inputRef.current.focus()}),f(v(o),"onFocus",function(l){o.setState({isFocused:!0}),o.props.onFocus(l)}),f(v(o),"onBlur",function(l){o.setState({isFocused:!1}),o.props.onBlur(l)}),f(v(o),"handleFocusForMaskToggle",function(l){ee(l)&&o.setState({isFocusVisibleForMaskToggle:!0})}),f(v(o),"handleBlurForMaskToggle",function(l){o.state.isFocusVisibleForMaskToggle!==!1&&o.setState({isFocusVisibleForMaskToggle:!1})}),f(v(o),"handleFocusForClear",function(l){ee(l)&&o.setState({isFocusVisibleForClear:!0})}),f(v(o),"handleBlurForClear",function(l){o.state.isFocusVisibleForClear!==!1&&o.setState({isFocusVisibleForClear:!1})}),o}return Ge(t,[{key:"componentDidMount",value:function(){var o=this.props,n=o.autoFocus,i=o.clearable;this.inputRef.current&&(n&&this.inputRef.current.focus(),i&&this.inputRef.current.addEventListener("keydown",this.onInputKeyDown))}},{key:"componentWillUnmount",value:function(){var o=this.props.clearable;o&&this.inputRef.current&&this.inputRef.current.removeEventListener("keydown",this.onInputKeyDown)}},{key:"clearValue",value:function(){var o=this.inputRef.current;if(o){var n=Object.getOwnPropertyDescriptor(this.props.type===D.textarea?HTMLTextAreaElement.prototype:HTMLInputElement.prototype,"value");if(n){var i=n.set;if(i){i.call(o,"");var a=We("input");o.dispatchEvent(a)}}}}},{key:"getInputType",value:function(){return this.props.type==="password"?this.state.isMasked?"password":"text":this.props.type}},{key:"renderMaskToggle",value:function(){var o,n=this;if(this.props.type!=="password")return null;var i=w(this.props.overrides.MaskToggleButton,K),a=F(i,2),l=a[0],s=a[1],c=w(this.props.overrides.MaskToggleShowIcon,Ie),p=F(c,2),y=p[0],h=p[1],C=w(this.props.overrides.MaskToggleHideIcon,Se),S=F(C,2),j=S[0],R=S[1],O=this.state.isMasked?"Show password text":"Hide password text",B=(o={},f(o,u.mini,"12px"),f(o,u.compact,"16px"),f(o,u.default,"20px"),f(o,u.large,"24px"),o)[this.props.size];return b.createElement(l,m({$size:this.props.size,$isFocusVisible:this.state.isFocusVisibleForMaskToggle,"aria-label":O,onClick:function(){return n.setState(function(k){return{isMasked:!k.isMasked}})},title:O,type:"button"},s,{onFocus:te(s,this.handleFocusForMaskToggle),onBlur:re(s,this.handleBlurForMaskToggle)}),this.state.isMasked?b.createElement(y,m({size:B,title:O},h)):b.createElement(j,m({size:B,title:O},R)))}},{key:"renderClear",value:function(){var o,n=this,i=this.props,a=i.clearable,l=i.value,s=i.disabled,c=i.readOnly,p=i.overrides,y=p===void 0?{}:p;if(s||c||!a||l==null||typeof l=="string"&&l.length===0)return null;var h=w(y.ClearIconContainer,W),C=F(h,2),S=C[0],j=C[1],R=w(y.ClearIcon,_),O=F(R,2),B=O[0],k=O[1],$="Clear value",E=N(this.props,this.state),L=(o={},f(o,u.mini,"14px"),f(o,u.compact,"14px"),f(o,u.default,"16px"),f(o,u.large,"22px"),o)[this.props.size];return b.createElement(S,m({$alignTop:this.props.type===D.textarea},E,j),b.createElement(B,m({size:L,tabIndex:0,title:$,"aria-label":$,onClick:this.onClearIconClick,onKeyDown:function(x){x.key&&(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),n.onClearIconClick())},role:"button",$isFocusVisible:this.state.isFocusVisibleForClear},E,k,{onFocus:te(k,this.handleFocusForClear),onBlur:re(k,this.handleBlurForClear)})))}},{key:"render",value:function(){var o=this.props.overrides,n=o.InputContainer,i=o.Input,a=o.Before,l=o.After,s=this.state.initialType==="password"&&this.props.autoComplete===t.defaultProps.autoComplete?"new-password":this.props.autoComplete,c=N(this.props,this.state),p=w(n,U),y=F(p,2),h=y[0],C=y[1],S=w(i,z),j=F(S,2),R=j[0],O=j[1],B=w(a,ce),k=F(B,2),$=k[0],E=k[1],L=w(l,ce),x=F(L,2),de=x[0],fe=x[1];return b.createElement(h,m({"data-baseweb":this.props["data-baseweb"]||"base-input"},c,C),b.createElement($,m({},c,E)),b.createElement(R,m({ref:this.inputRef,"aria-activedescendant":this.props["aria-activedescendant"],"aria-autocomplete":this.props["aria-autocomplete"],"aria-controls":this.props["aria-controls"],"aria-errormessage":this.props["aria-errormessage"],"aria-haspopup":this.props["aria-haspopup"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-describedby":this.props["aria-describedby"],"aria-invalid":this.props.error,"aria-required":this.props.required,autoComplete:s,disabled:this.props.disabled,readOnly:this.props.readOnly,id:this.props.id,inputMode:this.props.inputMode,maxLength:this.props.maxLength,name:this.props.name,onBlur:this.onBlur,onChange:this.props.onChange,onFocus:this.onFocus,onKeyDown:this.props.onKeyDown,onKeyPress:this.props.onKeyPress,onKeyUp:this.props.onKeyUp,pattern:this.props.pattern,placeholder:this.props.placeholder,type:this.getInputType(),required:this.props.required,role:this.props.role,value:this.props.value,min:this.props.min,max:this.props.max,step:this.props.step,rows:this.props.type===D.textarea?this.props.rows:null},c,O)),this.renderClear(),this.renderMaskToggle(),b.createElement(de,m({},c,fe)))}}]),t}(b.Component);f(pe,"defaultProps",{"aria-activedescendant":null,"aria-autocomplete":null,"aria-controls":null,"aria-errormessage":null,"aria-haspopup":null,"aria-label":null,"aria-labelledby":null,"aria-describedby":null,adjoined:P.none,autoComplete:"on",autoFocus:!1,disabled:!1,error:!1,positive:!1,name:"",inputMode:"text",onBlur:function(){},onChange:function(){},onKeyDown:function(){},onKeyPress:function(){},onKeyUp:function(){},onFocus:function(){},onClear:function(){},clearable:!1,clearOnEscape:!0,overrides:{},pattern:null,placeholder:"",required:!1,role:null,size:u.default,type:"text",readOnly:!1});export{pe as B,z as I,q as R,le as a,se as b,H as c,N as d,ae as g};