react-bootstrap-floating-label
Version:
React form element with floating label text
2 lines • 23.9 kB
JavaScript
/*! For license information please see index.js.LICENSE.txt */
(()=>{var t={839:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=n(645),o=n.n(r)()((function(t){return t[1]}));o.push([t.id,"/* Brennan Wilkes */\n\n.floating-label {\n\tdisplay: flex;\n\tflex-direction: column;\n\tposition: relative;\n\tjustify-content: center;\n\talign-items: flex-start;\n\ttext-align: left;\n}\n\n.floating-label > label {\n\tfont-size: 1rem;\n\tcolor: #495057;\n\tpointer-events: none;\n\tposition: absolute;\n\ttransform-origin: top left;\n\ttransition: all 0.2s ease-out;\n\tpadding-left: 1rem;\n\tline-height: 1;\n\tmargin-bottom: 0;\n}\n\n.floating-label:focus-within > label,\n.floating-label > .floating-label-active {\n\ttransform: translate(0, -50%) scale(0.6);\n}\n\n.floating-label > input:focus {\n\tcolor: #212529;\n\tbackground-color: #fff;\n\tborder-color: #86b7fe;\n\toutline: 0;\n\tbox-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);\n}\n\n.floating-label > input {\n\tdisplay: block;\n\twidth: 100%;\n\tpadding: 1rem 0.75rem 0.25rem 0.75rem;\n\tfont-size: 1rem;\n\tfont-weight: 400;\n\tline-height: 1.5;\n\tcolor: #212529;\n\tbackground-color: #fff;\n\tbackground-clip: padding-box;\n\tborder: 1px solid #ced4da;\n\t-webkit-appearance: none;\n\t-moz-appearance: none;\n\tappearance: none;\n\tborder-radius: 0.25rem;\n\ttransition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n}\n",""]);const i=o},101:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=n(645),o=n.n(r)()((function(t){return t[1]}));o.push([t.id,"/* Brennan Wilkes */\n\n.loadingCog {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twill-change: transform;\n\tposition: absolute;\n\tright: 0;\n\ttop: 10%;\n\tbottom: 10%;\n\tmargin-right: 1.25%;\n}\n\n.loadingCog:active,\n.loadingCog,\n.loadingCog:focus {\n\toutline: none;\n\tbox-shadow: none;\n}\n\n.loadingCog:hover {\n\tcursor: default !important;\n}\n",""]);const i=o},645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=t(e);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,r){"string"==typeof t&&(t=[[null,t,""]]);var o={};if(r)for(var i=0;i<this.length;i++){var a=this[i][0];null!=a&&(o[a]=!0)}for(var l=0;l<t.length;l++){var u=[].concat(t[l]);r&&o[u[0]]||(n&&(u[2]?u[2]="".concat(n," and ").concat(u[2]):u[2]=n),e.push(u))}},e}},418:t=>{"use strict";var e=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function o(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(t){r[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,i){for(var a,l,u=o(t),c=1;c<arguments.length;c++){for(var s in a=Object(arguments[c]))n.call(a,s)&&(u[s]=a[s]);if(e){l=e(a);for(var f=0;f<l.length;f++)r.call(a,l[f])&&(u[l[f]]=a[l[f]])}}return u}},703:(t,e,n)=>{"use strict";var r=n(414);function o(){}function i(){}i.resetWarningCache=o,t.exports=function(){function t(t,e,n,o,i,a){if(a!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},697:(t,e,n)=>{t.exports=n(703)()},414:t=>{"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},408:(t,e,n)=>{"use strict";var r=n(418),o=60103,i=60106;e.Fragment=60107,e.StrictMode=60108,e.Profiler=60114;var a=60109,l=60110,u=60112;e.Suspense=60113;var c=60115,s=60116;if("function"==typeof Symbol&&Symbol.for){var f=Symbol.for;o=f("react.element"),i=f("react.portal"),e.Fragment=f("react.fragment"),e.StrictMode=f("react.strict_mode"),e.Profiler=f("react.profiler"),a=f("react.provider"),l=f("react.context"),u=f("react.forward_ref"),e.Suspense=f("react.suspense"),c=f("react.memo"),s=f("react.lazy")}var p="function"==typeof Symbol&&Symbol.iterator;function d(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h={};function v(t,e,n){this.props=t,this.context=e,this.refs=h,this.updater=n||y}function g(){}function b(t,e,n){this.props=t,this.context=e,this.refs=h,this.updater=n||y}v.prototype.isReactComponent={},v.prototype.setState=function(t,e){if("object"!=typeof t&&"function"!=typeof t&&null!=t)throw Error(d(85));this.updater.enqueueSetState(this,t,e,"setState")},v.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")},g.prototype=v.prototype;var m=b.prototype=new g;m.constructor=b,r(m,v.prototype),m.isPureReactComponent=!0;var O={current:null},w=Object.prototype.hasOwnProperty,C={key:!0,ref:!0,__self:!0,__source:!0};function S(t,e,n){var r,i={},a=null,l=null;if(null!=e)for(r in void 0!==e.ref&&(l=e.ref),void 0!==e.key&&(a=""+e.key),e)w.call(e,r)&&!C.hasOwnProperty(r)&&(i[r]=e[r]);var u=arguments.length-2;if(1===u)i.children=n;else if(1<u){for(var c=Array(u),s=0;s<u;s++)c[s]=arguments[s+2];i.children=c}if(t&&t.defaultProps)for(r in u=t.defaultProps)void 0===i[r]&&(i[r]=u[r]);return{$$typeof:o,type:t,key:a,ref:l,props:i,_owner:O.current}}function j(t){return"object"==typeof t&&null!==t&&t.$$typeof===o}var _=/\/+/g;function E(t,e){return"object"==typeof t&&null!==t&&null!=t.key?function(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,(function(t){return e[t]}))}(""+t.key):e.toString(36)}function x(t,e,n,r,a){var l=typeof t;"undefined"!==l&&"boolean"!==l||(t=null);var u=!1;if(null===t)u=!0;else switch(l){case"string":case"number":u=!0;break;case"object":switch(t.$$typeof){case o:case i:u=!0}}if(u)return a=a(u=t),t=""===r?"."+E(u,0):r,Array.isArray(a)?(n="",null!=t&&(n=t.replace(_,"$&/")+"/"),x(a,e,n,"",(function(t){return t}))):null!=a&&(j(a)&&(a=function(t,e){return{$$typeof:o,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}(a,n+(!a.key||u&&u.key===a.key?"":(""+a.key).replace(_,"$&/")+"/")+t)),e.push(a)),1;if(u=0,r=""===r?".":r+":",Array.isArray(t))for(var c=0;c<t.length;c++){var s=r+E(l=t[c],c);u+=x(l,e,n,s,a)}else if("function"==typeof(s=function(t){return null===t||"object"!=typeof t?null:"function"==typeof(t=p&&t[p]||t["@@iterator"])?t:null}(t)))for(t=s.call(t),c=0;!(l=t.next()).done;)u+=x(l=l.value,e,n,s=r+E(l,c++),a);else if("object"===l)throw e=""+t,Error(d(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e));return u}function P(t,e,n){if(null==t)return t;var r=[],o=0;return x(t,r,"","",(function(t){return e.call(n,t,o++)})),r}function k(t){if(-1===t._status){var e=t._result;e=e(),t._status=0,t._result=e,e.then((function(e){0===t._status&&(e=e.default,t._status=1,t._result=e)}),(function(e){0===t._status&&(t._status=2,t._result=e)}))}if(1===t._status)return t._result;throw t._result}var R={current:null};function T(){var t=R.current;if(null===t)throw Error(d(321));return t}var I={ReactCurrentDispatcher:R,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:O,IsSomeRendererActing:{current:!1},assign:r};e.Children={map:P,forEach:function(t,e,n){P(t,(function(){e.apply(this,arguments)}),n)},count:function(t){var e=0;return P(t,(function(){e++})),e},toArray:function(t){return P(t,(function(t){return t}))||[]},only:function(t){if(!j(t))throw Error(d(143));return t}},e.Component=v,e.PureComponent=b,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I,e.cloneElement=function(t,e,n){if(null==t)throw Error(d(267,t));var i=r({},t.props),a=t.key,l=t.ref,u=t._owner;if(null!=e){if(void 0!==e.ref&&(l=e.ref,u=O.current),void 0!==e.key&&(a=""+e.key),t.type&&t.type.defaultProps)var c=t.type.defaultProps;for(s in e)w.call(e,s)&&!C.hasOwnProperty(s)&&(i[s]=void 0===e[s]&&void 0!==c?c[s]:e[s])}var s=arguments.length-2;if(1===s)i.children=n;else if(1<s){c=Array(s);for(var f=0;f<s;f++)c[f]=arguments[f+2];i.children=c}return{$$typeof:o,type:t.type,key:a,ref:l,props:i,_owner:u}},e.createContext=function(t,e){return void 0===e&&(e=null),(t={$$typeof:l,_calculateChangedBits:e,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:a,_context:t},t.Consumer=t},e.createElement=S,e.createFactory=function(t){var e=S.bind(null,t);return e.type=t,e},e.createRef=function(){return{current:null}},e.forwardRef=function(t){return{$$typeof:u,render:t}},e.isValidElement=j,e.lazy=function(t){return{$$typeof:s,_payload:{_status:-1,_result:t},_init:k}},e.memo=function(t,e){return{$$typeof:c,type:t,compare:void 0===e?null:e}},e.useCallback=function(t,e){return T().useCallback(t,e)},e.useContext=function(t,e){return T().useContext(t,e)},e.useDebugValue=function(){},e.useEffect=function(t,e){return T().useEffect(t,e)},e.useImperativeHandle=function(t,e,n){return T().useImperativeHandle(t,e,n)},e.useLayoutEffect=function(t,e){return T().useLayoutEffect(t,e)},e.useMemo=function(t,e){return T().useMemo(t,e)},e.useReducer=function(t,e,n){return T().useReducer(t,e,n)},e.useRef=function(t){return T().useRef(t)},e.useState=function(t){return T().useState(t)},e.version="17.0.1"},294:(t,e,n)=>{"use strict";t.exports=n(408)},379:(t,e,n)=>{"use strict";var r,o=function(){var t={};return function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[e]=n}return t[e]}}(),i=[];function a(t){for(var e=-1,n=0;n<i.length;n++)if(i[n].identifier===t){e=n;break}return e}function l(t,e){for(var n={},r=[],o=0;o<t.length;o++){var l=t[o],u=e.base?l[0]+e.base:l[0],c=n[u]||0,s="".concat(u," ").concat(c);n[u]=c+1;var f=a(s),p={css:l[1],media:l[2],sourceMap:l[3]};-1!==f?(i[f].references++,i[f].updater(p)):i.push({identifier:s,updater:h(p,e),references:1}),r.push(s)}return r}function u(t){var e=document.createElement("style"),r=t.attributes||{};if(void 0===r.nonce){var i=n.nc;i&&(r.nonce=i)}if(Object.keys(r).forEach((function(t){e.setAttribute(t,r[t])})),"function"==typeof t.insert)t.insert(e);else{var a=o(t.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(e)}return e}var c,s=(c=[],function(t,e){return c[t]=e,c.filter(Boolean).join("\n")});function f(t,e,n,r){var o=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(t.styleSheet)t.styleSheet.cssText=s(e,o);else{var i=document.createTextNode(o),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(i,a[e]):t.appendChild(i)}}function p(t,e,n){var r=n.css,o=n.media,i=n.sourceMap;if(o?t.setAttribute("media",o):t.removeAttribute("media"),i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleSheet)t.styleSheet.cssText=r;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(r))}}var d=null,y=0;function h(t,e){var n,r,o;if(e.singleton){var i=y++;n=d||(d=u(e)),r=f.bind(null,n,i,!1),o=f.bind(null,n,i,!0)}else n=u(e),r=p.bind(null,n,e),o=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(n)};return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else o()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=(void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r));var n=l(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var r=0;r<n.length;r++){var o=a(n[r]);i[o].references--}for(var u=l(t,e),c=0;c<n.length;c++){var s=a(n[c]);0===i[s].references&&(i[s].updater(),i.splice(s,1))}n=u}}}}},e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={id:r,exports:{}};return t[r](o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{default:()=>N});var t=n(294),e=n(697),o=n.n(e),i=n(379),a=n.n(i),l=n(839);a()(l.Z,{insert:"head",singleton:!1}),l.Z.locals;var u={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},c=t.createContext&&t.createContext(u),s=function(){return(s=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function f(e){return e&&e.map((function(e,n){return t.createElement(e.tag,s({key:n},e.attr),f(e.child))}))}function p(e){return function(n){return t.createElement(d,s({attr:s({},e.attr)},n),f(e.child))}}function d(e){var n=function(n){var r,o=e.attr,i=e.size,a=e.title,l=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(e,["attr","size","title"]),u=i||n.size||"1em";return n.className&&(r=n.className),e.className&&(r=(r?r+" ":"")+e.className),t.createElement("svg",s({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,o,l,{className:r,style:s(s({color:e.color||n.color},n.style),e.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),a&&t.createElement("title",null,a),e.children)};return void 0!==c?t.createElement(c.Consumer,null,(function(t){return n(t)})):n(u)}function y(t){return p({tag:"svg",attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14.59 9.535c-0.839-1.454-0.335-3.317 1.127-4.164l-1.572-2.723c-0.449 0.263-0.972 0.414-1.529 0.414-1.68 0-3.042-1.371-3.042-3.062h-3.145c0.004 0.522-0.126 1.051-0.406 1.535-0.839 1.454-2.706 1.948-4.17 1.106l-1.572 2.723c0.453 0.257 0.845 0.634 1.123 1.117 0.838 1.452 0.336 3.311-1.12 4.16l1.572 2.723c0.448-0.261 0.967-0.41 1.522-0.41 1.675 0 3.033 1.362 3.042 3.046h3.145c-0.001-0.517 0.129-1.040 0.406-1.519 0.838-1.452 2.7-1.947 4.163-1.11l1.572-2.723c-0.45-0.257-0.839-0.633-1.116-1.113zM8 11.24c-1.789 0-3.24-1.45-3.24-3.24s1.45-3.24 3.24-3.24c1.789 0 3.24 1.45 3.24 3.24s-1.45 3.24-3.24 3.24z"}}]})(t)}var h=n(101);function v(t){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function g(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function b(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function m(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function O(t,e){return(O=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function w(t,e){return!e||"object"!==v(e)&&"function"!=typeof e?C(t):e}function C(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function S(t){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}a()(h.Z,{insert:"head",singleton:!1}),h.Z.locals;var j=function(e){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&O(t,e)}(l,e);var n,r,o,i,a=(o=l,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=S(o);if(i){var n=S(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return w(this,t)});function l(t){var e,n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),(n=a.call(this,t)).triggerRotate=n.triggerRotate.bind(C(n)),n.state={id:null!==(e=n.props.id)&&void 0!==e?e:"LoadingCog-".concat(parseInt(1e3*Math.random())),rotateInterval:void 0,rot:0},n.props.rotating&&n.triggerRotate(),n}return n=l,(r=[{key:"componentWillUnmount",value:function(){this.endRotate(!1)}},{key:"endRotate",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.state.rotateInterval&&(window.clearInterval(this.state.rotateInterval),t&&this.setState({rotateInterval:void 0}))}},{key:"triggerRotate",value:function(){var t=this;this.state.rotateInterval&&this.endRotate(!1);var e=window.setInterval((function(){t.setState({rot:t.state.rot+1})}),10);this.setState({rotateInterval:e})}},{key:"componentDidUpdate",value:function(t){!t.rotating&&this.props.rotating?this.triggerRotate():t.rotating&&!this.props.rotating&&this.endRotate()}},{key:"render",value:function(){var e,n=this.props.style?function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?g(Object(n),!0).forEach((function(e){b(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},this.props.style):{};return n.transform="rotate(".concat(this.state.rot,"deg)"),t.createElement(t.Fragment,null,t.createElement("div",{style:n,className:"loadingCog",id:this.state.id},t.createElement(y,{size:null!==(e=this.props.size)&&void 0!==e?e:30})))}}])&&m(n.prototype,r),l}(t.Component);j.propTypes={style:o().object,size:o().number,rotating:o().bool,id:o().string};const _=j;function E(t){return(E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function x(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function P(t,e){return(P=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function k(t,e){return!e||"object"!==E(e)&&"function"!=typeof e?R(t):e}function R(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function T(t){return(T=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var I=function(e){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&P(t,e)}(l,e);var n,r,o,i,a=(o=l,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=T(o);if(i){var n=T(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return k(this,t)});function l(t){var e,n,r,o,i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),(i=a.call(this,t)).handleTextChange=i.handleTextChange.bind(R(i));var u=null!==(e=i.props.id)&&void 0!==e?e:"floating-label".concat(parseInt(1e3*Math.random()));return i.state={isActive:!!i.props.initialValue,text:null!==(n=i.props.initialValue)&&void 0!==n?n:"",id:u,labelId:null!==(r=i.props.labelId)&&void 0!==r?r:"".concat(u,"-label"),inputId:null!==(o=i.props.inputId)&&void 0!==o?o:"".concat(u,"-input"),queuedChangeTimeout:void 0,cogId:"".concat(u,"-cog")},i}return n=l,(r=[{key:"componentDidUpdate",value:function(t){this.props.initialValue!==t.initialValue&&this.setState({text:this.props.initialValue,isActive:!!this.props.initialValue})}},{key:"handleTextChange",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.setState({isActive:""!==t.target.value,text:t.target.value}),this.props.onChange)if(this.props.onChangeDelay)if(this.state.queuedChangeTimeout&&clearTimeout(this.state.queuedChangeTimeout),n)this.props.onChange(t);else{var r=setTimeout((function(){e.props.onChange(t),e.setState({queuedChangeTimeout:void 0})}),this.props.onChangeDelay);this.setState({queuedChangeTimeout:r})}else this.props.onChange(t)}},{key:"render",value:function(){var e,n,r,o,i,a,l,u,c,s,f,p=this,d={className:null!==(e=this.props.className)&&void 0!==e?e:"",labelClassName:null!==(n=this.props.labelClassName)&&void 0!==n?n:"",inputClassName:null!==(r=this.props.inputClassName)&&void 0!==r?r:"",type:null!==(o=this.props.type)&&void 0!==o?o:"text",label:null!==(i=this.props.label)&&void 0!==i?i:"Floating Label",style:null!==(a=this.props.style)&&void 0!==a?a:{},labelStyle:null!==(l=this.props.labelStyle)&&void 0!==l?l:{},inputStyle:null!==(u=this.props.inputStyle)&&void 0!==u?u:{}};return t.createElement(t.Fragment,null,t.createElement("div",{className:"floating-label ".concat(d.className),id:this.state.id,style:d.style},t.createElement("input",{className:d.inputClassName,id:this.state.inputId,type:d.type,value:this.state.text,onChange:this.handleTextChange,onBlur:function(t){p.props.onBlur&&p.props.onBlur(t)},onFocus:function(t){p.props.onFocus&&p.props.onFocus(t)},onKeyDown:function(t){"Enter"===t.key&&p.handleTextChange(t,!0)},style:d.inputStyle}),t.createElement("label",{id:this.state.labelId,className:"".concat(d.labelClassName).concat(this.state.isActive?" floating-label-active":""),style:d.labelStyle},d.label),this.props.loadingCog?t.createElement(_,{id:this.state.cogId,rotating:null!==(c=this.props.loadingCogSpinning)&&void 0!==c&&c,size:null!==(s=this.props.loadingCogSize)&&void 0!==s?s:30,style:null!==(f=this.props.loadingCogStyle)&&void 0!==f?f:{}}):t.createElement(t.Fragment,null)))}}])&&x(n.prototype,r),l}(t.Component);I.propTypes={id:o().string,labelId:o().string,inputId:o().string,className:o().string,labelClassName:o().string,inputClassName:o().string,type:o().string,onChange:o().func,onBlur:o().func,onFocus:o().func,onChangeDelay:o().number,label:o().string,style:o().object,labelStyle:o().object,inputStyle:o().object,loadingCog:o().bool,loadingCogSpinning:o().bool,loadingCogSize:o().number,loadingCogStyle:o().object,initialValue:o().string};const N=I})(),module.exports=r})();