{"version":3,"sources":["webpack://react-inputs-validation/webpack/universalModuleDefinition","webpack://react-inputs-validation/webpack/bootstrap","webpack://react-inputs-validation/external \"react\"","webpack://react-inputs-validation/./src/js/Inputs/const.ts","webpack://react-inputs-validation/./src/js/Inputs/message.ts","webpack://react-inputs-validation/./src/js/Inputs/react-inputs-validation.css?df4a","webpack://react-inputs-validation/./src/js/Inputs/validator.ts","webpack://react-inputs-validation/./src/js/Inputs/utils.ts","webpack://react-inputs-validation/./src/js/Inputs/index.global.ts","webpack://react-inputs-validation/./src/js/Inputs/Textbox.tsx","webpack://react-inputs-validation/./src/js/Inputs/Textarea.tsx","webpack://react-inputs-validation/./src/js/Inputs/Select.tsx","webpack://react-inputs-validation/./src/js/Inputs/Checkbox.tsx","webpack://react-inputs-validation/./src/js/Inputs/Radiobox.tsx"],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE__0__","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","useEffect","useRef","LOCALE_OPTION_LIST","REACT_INPUTS_VALIDATION_CUSTOM_ERROR_MESSAGE_EXAMPLE","DEFAULT_LOCALE","WRAPPER_CLASS_IDENTITIFIER","CONTAINER_CLASS_IDENTITIFIER","OPTION_LIST_ITEM_IDENTITIFIER","MSG_CLASS_IDENTITIFIER","usePrevious","ref","current","getEnglishName","res","message","textbox","empty","invalid","invalidFormat","inBetween","min","max","lessThan","greaterThan","lengthEqual","length","twoInputsNotEqual","radiobox","checkbox","unchecked","select","textarea","getCustomErrorMessage","constructor","keys","map","j","k","console","error","handleCustomErrorMessage","w","REACT_INPUTS_VALIDATION","window","isNumeric","v","isNaN","parseFloat","isFinite","validator","reg","err","test","replace","number","camelize","str","match","index","toLowerCase","toUpperCase","utils","toCamelCase","capitalLize","substr","getRandomId","Math","random","toString","slice","getAlphanumeric","String","split","forEach","charCode","charCodeAt","getAlpha","getNumeric","Textbox","Textarea","Select","Checkbox","Radiobox","useState","useCallback","memo","TYPE","VALIDATE_OPTION_TYPE_LIST","VALIDATE_NUMBER_TYPE_LIST","obj","showOnError","showOnSuccess","attributesWrapper","attributesInput","disabled","validate","classNameInput","classNameWrapper","classNameContainer","customStyleInput","customStyleWrapper","customStyleContainer","validationOption","asyncMsgObj","onChange","onBlur","onFocus","onClick","onKeyUp","validationCallback","setErr","msg","setMsg","successMsg","setSuccessMsg","internalValue","setInternalValue","prevInternalValue","option","type","numberType","mantissa","check","regMsg","compare","required","showMsg","locale","msgOnError","msgOnSuccess","customFunc","undefined","getDefaultValidationOption","asyncObj","$input","$el","handleOnBlur","e","handleOnFocus","handleOnClick","handleOnKeyUp","keyCode","handleOnChange","maxLength","Number","hasDot","splitStr","shift","resArr","join","autoFormatNumber","indexOf","nameText","handleCheckEnd","customFuncResult","fromCustomFunc","msgHtml","wrapperClass","containerClass","inputClass","errMsgClass","successMsgClass","className","style","useMemo","selectKeyList","startsWith","searchString","position","isValidValue","list","id","getItem","getIndex","globalVariableIsFocusing","globalVariableIsCorrected","globalVariableCurrentFocus","globalVariableTypingTimeout","Option","item","customStyleOptionListItem","onMouseOver","onMouseMove","onMouseOut","handleOnMouseOver","handleOnMouseMove","handleOnMouseOut","showSearch","keyword","optionList","classNameSelect","classNameOptionListItem","classNameOptionListContainer","classNameDropdownIconOptionListItem","customStyleSelect","customStyleOptionListContainer","customStyleDropdownIcon","stateKeyword","prevOptionList","show","setShow","prevShow","isTyping","setIsTyping","keycodeList","setKeycodeList","$button","$wrapper","$itemsWrapper","$searchInputWrapper","$searchInput","$elButton","$elWrapper","$elItemsWrapper","$itemsRef","filteredOptionList","filter","includes","handleOnSearch","target","handleOnSearchKeyDown","direction","getDirection","preventDefault","handleOnKeyDown","scroll","addActive","addEventListener","pageClick","removeEventListener","onKeyDown","contains","resetCurrentFocus","setTimeoutTyping","clearTimeout","setTimeout","children","$children","containerHeight","offsetHeight","containerScrollTop","scrollTop","itemHeight","heightItems","heightContainer","offset","abs","handleOnItemClick","handleOnItemMouseOver","handleOnItemMouseMove","handleOnItemMouseOut","removeActive","click","newkeyCodeList","fromCharCode","document","focus","optionListHtml","selectClass","selectOptionListContainerClass","selectOptionListItemClass","dropdownIconClass","background","textAlign","padding","xmlns","width","height","viewBox","fill","selectorHtml","checked","labelHtml","classNameInputBox","customStyleInputBox","internalChecked","setInternalChecked","prevInternalChecked","boxClass","labelClass","defaultChecked","optionListItemClass","htmlFor","attributesInputs","val","optionHtml"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,UACR,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,CAAC,SAAUJ,GACQ,iBAAZC,QACdA,QAAQ,2BAA6BD,EAAQG,QAAQ,UAErDJ,EAAK,2BAA6BC,EAAQD,EAAY,OARxD,CASGO,MAAM,SAASC,GAClB,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUT,QAGnC,IAAIC,EAASM,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHX,QAAS,IAUV,OANAY,EAAQH,GAAUI,KAAKZ,EAAOD,QAASC,EAAQA,EAAOD,QAASQ,GAG/DP,EAAOU,GAAI,EAGJV,EAAOD,QA0Df,OArDAQ,EAAoBM,EAAIF,EAGxBJ,EAAoBO,EAAIR,EAGxBC,EAAoBQ,EAAI,SAAShB,EAASiB,EAAMC,GAC3CV,EAAoBW,EAAEnB,EAASiB,IAClCG,OAAOC,eAAerB,EAASiB,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEV,EAAoBgB,EAAI,SAASxB,GACX,oBAAXyB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAerB,EAASyB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAO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,GAClDQ,KAAMnN,EACN+L,WAAYA,GACZ9K,MAAOkI,GACPrB,SAAUA,EACV2L,oBAAqBA,GACrBrG,0BAA2BA,EAC3BjF,iBAAkBA,EAClBoL,WAAYA,GACZ/K,SAAUsC,GACVjD,gBAAiB8L,EAAiBtP,GAAKsP,EAAiBtP,GAAK,SAMnE,yBAAK3B,IAAK4H,GAAQ4B,UAAWL,GAAcM,MAAO/D,EAAoBO,QAASgC,GAAelC,OAAQ+B,GAAc9B,QAASgC,IAAmB9C,GAC9I,uBAAKsE,UAAWJ,GAAgBK,MAAO9D,GACpCwL,IAEFjI","file":"react-inputs-validation.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"react-inputs-validation\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"react-inputs-validation\"] = factory(root[\"react\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE__0__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 6);\n","module.exports = __WEBPACK_EXTERNAL_MODULE__0__;","import * as React from 'react';\nconst { useEffect, useRef } = React;\nexport const LOCALE_OPTION_LIST = ['en-US', 'zh-CN'];\nexport const REACT_INPUTS_VALIDATION_CUSTOM_ERROR_MESSAGE_EXAMPLE =\n \"Invalid window.REACT_INPUTS_VALIDATION['customErrorMessage']. EXAMPLE: window.REACT_INPUTS_VALIDATION={customErrorMessage:{'en-US':{textbox:{empty:function empty(name){return getEnglishName(name)+'cannot be empty'},invalid:function invalid(name){return getEnglishName(name)+'invalid format'},invalidFormat:function invalidFormat(name){return getEnglishName(name)+'is not a number'},inBetween:function inBetween(name){return function(min){return function(max){return getEnglishName(name)+'must be '+min+'-'+max}}},lessThan:function lessThan(name){return function(min){return getEnglishName(name)+'cannot less than '+min}},greaterThan:function greaterThan(name){return function(max){return getEnglishName(name)+'cannot greater than '+max}},lengthEqual:function lengthEqual(name){return function(length){return getEnglishName(name)+'length must be '+length}},twoInputsNotEqual:function twoInputsNotEqual(){return'two inputs are not equal'}},radiobox:{empty:function empty(name){return'Please choose one '+getEnglishName(name)}},checkbox:{unchecked:function unchecked(name){return getEnglishName(name)+'must be checked'}},select:{empty:function empty(name){return'Please select a '+getEnglishName(name)}},textarea:{empty:function empty(name){return getEnglishName(name)+'cannot be empty'},invalid:function invalid(name){return getEnglishName(name)+'invalid format'},invalidFormat:function invalidFormat(name){return getEnglishName(name)+'is not a number'},inBetween:function inBetween(name){return function(min){return function(max){return getEnglishName(name)+'must be '+min+'-'+max}}},lessThan:function lessThan(name){return function(min){return getEnglishName(name)+'cannot less than '+min}},greaterThan:function greaterThan(name){return function(max){return getEnglishName(name)+'cannot greater than '+max}},lengthEqual:function lengthEqual(name){return function(length){return getEnglishName(name)+'length must be '+length}},twoInputsNotEqual:function twoInputsNotEqual(){return'two inputs are not equal'}}}}};\";\nexport const DEFAULT_LOCALE = 'en-US';\nexport const WRAPPER_CLASS_IDENTITIFIER = 'react-inputs-validation__wrapper_identifier';\nexport const CONTAINER_CLASS_IDENTITIFIER = 'react-inputs-validation__container_identifier';\nexport const OPTION_LIST_ITEM_IDENTITIFIER = 'react-inputs-validation__option-list-item_identifier';\nexport const MSG_CLASS_IDENTITIFIER = 'react-inputs-validation__msg_identifier';\nexport const usePrevious = (value: any) => {\n const ref = useRef();\n useEffect(() => {\n ref.current = value;\n });\n return ref.current;\n};\n","import { REACT_INPUTS_VALIDATION_CUSTOM_ERROR_MESSAGE_EXAMPLE } from './const';\n\nconst getEnglishName = (name: string) => {\n let res = '';\n if (name) {\n res = `${name} `;\n }\n return res;\n};\n\nconst TEXT_BOX_VALIDATION_ZH_CN = {\n empty: (name: string) => `${name}不能为空`,\n invalid: (name: string) => `${name}格式有误`,\n invalidFormat: (name: string) => `${name}不是数字`,\n inBetween: (name: string) => (min: number) => (max: number) => `${name}必须在${min}-${max}之间`,\n lessThan: (name: string) => (min: number) => `${name}不可少于${min}`,\n greaterThan: (name: string) => (max: number) => `${name}不可大于${max}`,\n lengthEqual: (name: string) => (length: number) => `${name}长度必须为${length}`,\n twoInputsNotEqual: () => `两次输入不一致`,\n};\n\nconst TEXT_BOX_VALIDATION_EN_US = {\n empty: (name: string) => `${getEnglishName(name)}cannot be empty`,\n invalid: (name: string) => `${getEnglishName(name)}invalid format`,\n invalidFormat: (name: string) => `${getEnglishName(name)}is not a number`,\n inBetween: (name: string) => (min: number) => (max: number) => `${getEnglishName(name)}must be ${min}-${max}`,\n lessThan: (name: string) => (min: number) => `${getEnglishName(name)}cannot less than ${min}`,\n greaterThan: (name: string) => (max: number) => `${getEnglishName(name)}cannot greater than ${max}`,\n lengthEqual: (name: string) => (length: number) => `${getEnglishName(name)}length must be ${length}`,\n twoInputsNotEqual: () => `two inputs are not equal`,\n};\n\nconst TEXT_AREA_VALIDATION_ZH_CN = {\n empty: (name: string) => `${name}不能为空`,\n invalid: (name: string) => `${name}格式有误`,\n invalidFormat: (name: string) => `${name}不是数字`,\n inBetween: (name: string) => (min: number) => (max: number) => `${name}必须在${min}-${max}之间`,\n lessThan: (name: string) => (min: number) => `${name}不可少于${min}`,\n greaterThan: (name: string) => (max: number) => `${name}不可大于${max}`,\n lengthEqual: (name: string) => (length: number) => `${name}长度必须为${length}`,\n twoInputsNotEqual: () => `两次输入不一致`,\n};\n\nconst TEXT_AREA_VALIDATION_EN_US = {\n empty: (name: string) => `${getEnglishName(name)}cannot be empty`,\n invalid: (name: string) => `${getEnglishName(name)}invalid format`,\n invalidFormat: (name: string) => `${getEnglishName(name)}is not a number`,\n inBetween: (name: string) => (min: number) => (max: number) => `${getEnglishName(name)}must be ${min}-${max}`,\n lessThan: (name: string) => (min: number) => `${getEnglishName(name)}cannot less than ${min}`,\n greaterThan: (name: string) => (max: number) => `${getEnglishName(name)}cannot greater than ${max}`,\n lengthEqual: (name: string) => (length: number) => `${getEnglishName(name)}length must be ${length}`,\n twoInputsNotEqual: () => `two inputs are not equal`,\n};\n\nconst SELECT_VALIDATION_ZH_CN = {\n empty: (name: string) => `请选择一个${name}`,\n};\n\nconst SELECT_VALIDATION_EN_US = {\n empty: (name: string) => `Please select a ${getEnglishName(name)}`,\n};\n\nconst CHECK_BOX_VALIDATION_ZH_CN = {\n unchecked: (name: string) => `${name}必须勾选`,\n};\n\nconst CHECK_BOX_VALIDATION_EN_US = {\n unchecked: (name: string) => `${getEnglishName(name)}must be checked`,\n};\n\nconst RADIO_BOX_VALIDATION_ZH_CN = {\n empty: (name: string) => `必须勾选一个${name}`,\n};\n\nconst RADIO_BOX_VALIDATION_EN_US = {\n empty: (name: string) => `Please choose one ${getEnglishName(name)}`,\n};\n\ninterface Message {\n [key: string]: Key;\n}\n\ninterface Key {\n [key: string]: Func;\n}\n\ninterface Func {\n [key: string]: Function;\n}\n\nlet message: Message = {\n 'zh-CN': {\n textbox: TEXT_BOX_VALIDATION_ZH_CN,\n radiobox: RADIO_BOX_VALIDATION_ZH_CN,\n checkbox: CHECK_BOX_VALIDATION_ZH_CN,\n select: SELECT_VALIDATION_ZH_CN,\n textarea: TEXT_AREA_VALIDATION_ZH_CN,\n },\n 'en-US': {\n textbox: TEXT_BOX_VALIDATION_EN_US,\n radiobox: RADIO_BOX_VALIDATION_EN_US,\n checkbox: CHECK_BOX_VALIDATION_EN_US,\n select: SELECT_VALIDATION_EN_US,\n textarea: TEXT_AREA_VALIDATION_EN_US,\n },\n};\n\n// TODO: find a rewire way to handle non-export function\nexport const getCustomErrorMessage = (o: any, m: any) => {\n if (!o || typeof o !== 'object' || o.constructor !== Object || !Object.keys(o).length) {\n console.error(REACT_INPUTS_VALIDATION_CUSTOM_ERROR_MESSAGE_EXAMPLE);\n return false;\n }\n Object.keys(o).map(i => {\n if (!m[i]) {\n m[i] = o[i];\n } else {\n if (Object.keys(o[i]).length) {\n Object.keys(o[i]).map(j => {\n if (Object.keys(o[i][j]).length) {\n Object.keys(o[i][j]).map(k => {\n m[i][j][k] = o[i][j][k];\n });\n }\n });\n }\n }\n });\n return m;\n};\n\ndeclare global {\n interface Window {\n REACT_INPUTS_VALIDATION: any;\n }\n}\n\n// TODO: find a rewire way to handle non-export function\nexport const handleCustomErrorMessage = (message: any, w: Window) => {\n let res;\n if (typeof w !== 'undefined') {\n if (w.REACT_INPUTS_VALIDATION && w.REACT_INPUTS_VALIDATION['customErrorMessage']) {\n res = getCustomErrorMessage(w.REACT_INPUTS_VALIDATION['customErrorMessage'], message);\n }\n }\n if (typeof res === 'undefined' || res === false) {\n return message;\n }\n return res;\n};\n\n/* istanbul ignore else */\nif (typeof window !== 'undefined') {\n window.REACT_INPUTS_VALIDATION = window.REACT_INPUTS_VALIDATION || {};\n message = handleCustomErrorMessage(message, window);\n}\n\nexport default message;\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"ellipsis\":\"react-inputs-validation__ellipsis___3-Api\",\"textbox__wrapper\":\"react-inputs-validation__textbox__wrapper___3tnXv\",\"textbox__input\":\"react-inputs-validation__textbox__input___20hDL\",\"error\":\"react-inputs-validation__error___2aXSp\",\"success\":\"react-inputs-validation__success___3TpwE\",\"disabled\":\"react-inputs-validation__disabled___1-57g\",\"msg\":\"react-inputs-validation__msg___pxv8o\",\"textarea__wrapper\":\"react-inputs-validation__textarea__wrapper___35GhF\",\"textarea__input\":\"react-inputs-validation__textarea__input___1CFm_\",\"radiobox__container\":\"react-inputs-validation__radiobox__container___FD4vb\",\"radiobox__input\":\"react-inputs-validation__radiobox__input___2uX2-\",\"radiobox__label\":\"react-inputs-validation__radiobox__label___2tQsB\",\"radiobox__wrapper\":\"react-inputs-validation__radiobox__wrapper___1zZ30\",\"checked\":\"react-inputs-validation__checked___2O0Ju\",\"button\":\"react-inputs-validation__button___9JBRL\",\"radiobox__item\":\"react-inputs-validation__radiobox__item___ejuz1\",\"checkbox__input\":\"react-inputs-validation__checkbox__input___1yF4X\",\"checkbox__container\":\"react-inputs-validation__checkbox__container___3I1rX\",\"checkbox__box\":\"react-inputs-validation__checkbox__box___1uj8A\",\"checkbox__wrapper\":\"react-inputs-validation__checkbox__wrapper___1c1rD\",\"box\":\"react-inputs-validation__box___3E9nu\",\"select__wrapper\":\"react-inputs-validation__select__wrapper___1B4OH\",\"select__input\":\"react-inputs-validation__select__input___3h-P7\",\"select__container\":\"react-inputs-validation__select__container___3jgUR\",\"select__button\":\"react-inputs-validation__select__button___vEDoq\",\"select__options-item\":\"react-inputs-validation__select__options-item___30yY4\",\"select__options-item-show-cursor\":\"react-inputs-validation__select__options-item-show-cursor___1ZT3b\",\"select__searchInputWrapper\":\"react-inputs-validation__select__searchInputWrapper___3R5P_\",\"select__searchInputSearchIcon\":\"react-inputs-validation__select__searchInputSearchIcon___1Q8xX\",\"select__searchInputRemoveIcon\":\"react-inputs-validation__select__searchInputRemoveIcon___1A1tR\",\"select__searchInput\":\"react-inputs-validation__select__searchInput___1lN24\",\"select__no-mouse\":\"react-inputs-validation__select__no-mouse___2uRg6\",\"select__hover-active\":\"react-inputs-validation__select__hover-active___2z1MQ\",\"active\":\"react-inputs-validation__active___3eZBB\",\"select__options-container-animate\":\"react-inputs-validation__select__options-container-animate___2Rm--\",\"show\":\"react-inputs-validation__show___2NI3u\",\"select__options-container\":\"react-inputs-validation__select__options-container___d54qE\",\"select__dropdown\":\"react-inputs-validation__select__dropdown___11yDr\",\"select__dropdown-icon\":\"react-inputs-validation__select__dropdown-icon___1T5r2\",\"select__dropdown-name\":\"react-inputs-validation__select__dropdown-name___3hghL\",\"select__dropdown-icon-container\":\"react-inputs-validation__select__dropdown-icon-container___2ild-\"};","const empty = (v: string) => (v.replace(/\\s/g, '').length ? false : true);\nconst number = (v: number, min: any, max: any) => {\n if (min === null && max === null){\n return true\n }\n if (!isNumeric(v)) {\n return false;\n }\n return v < min || v > max ? false : true;\n};\n// TODO: find a better type for regex\nconst reg = (reg: any, v: string) => {\n let err = true;\n if (reg.test(v)) {\n err = false;\n }\n return err;\n};\nconst isNumeric = (v: any) => {\n return !isNaN(parseFloat(v)) && isFinite(v);\n};\n\ninterface Validator {\n [key: string]: Function;\n}\n\nconst validator: Validator = {\n reg,\n empty,\n number,\n};\nexport default validator;\n","const camelize = (str: string) => {\n return str.replace(/(?:^\\w|[A-Z]|\\b\\w|\\s+)/g, (match, index) => {\n if (+match === 0) return '';\n return index === 0 ? match.toLowerCase() : match.toUpperCase();\n });\n};\n\nconst toCamelCase = (str: string) => (capitalLize: boolean = false) => {\n const res = camelize(str);\n return capitalLize ? res.substr(0, 1).toUpperCase() + res.substr(1, res.length) : res;\n};\n\ninterface Utils {\n [key: string]: Function;\n}\n\nconst getRandomId = () => {\n return Math.random()\n .toString(36)\n .slice(-8);\n};\n\nconst getAlphanumeric = (v: string) => {\n let res = '';\n String(v)\n .split('')\n .forEach(i => {\n const charCode = i.toLowerCase().charCodeAt(0);\n if ((charCode >= 48 && charCode <= 57) || (charCode >= 97 && charCode <= 122)) {\n res += i;\n }\n });\n return res;\n};\n\nconst getAlpha = (v: string) => {\n let res = '';\n String(v)\n .split('')\n .forEach(i => {\n const charCode = i.toLowerCase().charCodeAt(0);\n if (charCode >= 97 && charCode <= 122) {\n res += i;\n }\n });\n return res;\n};\n\nconst getNumeric = (v: string) => {\n let res = '';\n String(v)\n .split('')\n .forEach(i => {\n const charCode = i.toLowerCase().charCodeAt(0);\n if (charCode >= 48 && charCode <= 57) {\n res += i;\n }\n });\n return res;\n};\n\nconst utils: Utils = {\n camelize,\n toCamelCase,\n getRandomId,\n getAlphanumeric,\n getAlpha,\n getNumeric,\n};\nexport default utils;\n","import Textbox from './Textbox';\nimport Textarea from './Textarea';\nimport Select from './Select';\nimport Checkbox from './Checkbox';\nimport Radiobox from './Radiobox';\n\nif (typeof window !== 'undefined') {\n (window).Textbox = Textbox;\n (window).Textarea = Textarea;\n (window).Radiobox = Radiobox;\n (window).Checkbox = Checkbox;\n (window).Select = Select;\n}\n\nexport { Textbox, Textarea, Select, Checkbox, Radiobox };\n","import * as React from 'react';\nconst { useState, useEffect, useCallback, useRef, memo } = React;\nimport message from './message';\nimport validator from './validator';\nimport utils from './utils';\nimport { REACT_INPUTS_VALIDATION_CUSTOM_ERROR_MESSAGE_EXAMPLE, DEFAULT_LOCALE, MSG_CLASS_IDENTITIFIER, usePrevious } from './const';\nimport reactInputsValidationCss from './react-inputs-validation.css';\nconst TYPE = 'textbox';\nconst VALIDATE_OPTION_TYPE_LIST = ['string', 'number', 'alphanumeric', 'alpha'];\nconst VALIDATE_NUMBER_TYPE_LIST = ['decimal', 'int', 'price'];\ninterface DefaultValidationOption {\n locale?: string;\n reg?: string;\n min?: number;\n max?: number;\n type?: string;\n numberType?: string;\n mantissa?: number;\n name?: string;\n check?: boolean;\n showMsg?: boolean;\n length?: number;\n regMsg?: string;\n compare?: string;\n required?: boolean;\n msgOnError?: string;\n msgOnSuccess?: string;\n customFunc?: Function | undefined;\n}\nconst getDefaultValidationOption = (obj: DefaultValidationOption) => {\n let { reg, min, max, type, numberType, mantissa, name, check, length, regMsg, compare, required, showMsg, locale, msgOnError, msgOnSuccess, customFunc } = obj;\n locale = typeof locale !== 'undefined' ? locale : DEFAULT_LOCALE;\n reg = typeof reg !== 'undefined' ? reg : '';\n min = typeof min !== 'undefined' ? min : 0;\n max = typeof max !== 'undefined' ? max : 0;\n type = typeof type !== 'undefined' ? type : 'string';\n numberType = typeof numberType !== 'undefined' ? numberType : 'string';\n mantissa = typeof mantissa !== 'undefined' ? mantissa : -1;\n name = typeof name !== 'undefined' ? name : '';\n check = typeof check !== 'undefined' ? check : true;\n showMsg = typeof showMsg !== 'undefined' ? showMsg : true;\n length = typeof length !== 'undefined' ? length : 0;\n regMsg = typeof regMsg !== 'undefined' ? regMsg : '';\n compare = typeof compare !== 'undefined' ? compare : '';\n required = typeof required !== 'undefined' ? required : true;\n msgOnError = typeof msgOnError !== 'undefined' ? msgOnError : '';\n msgOnSuccess = typeof msgOnSuccess !== 'undefined' ? msgOnSuccess : '';\n customFunc = typeof customFunc !== 'undefined' ? customFunc : undefined;\n return {\n reg,\n min,\n max,\n type,\n numberType,\n mantissa,\n name,\n check,\n length,\n regMsg,\n locale,\n compare,\n required,\n showMsg,\n msgOnError,\n msgOnSuccess,\n customFunc,\n };\n};\ninterface DefaultAsyncMsgObj {\n error?: boolean;\n message?: string;\n showOnError?: boolean;\n showOnSuccess?: boolean;\n}\nconst getDefaultAsyncObj = (obj: DefaultAsyncMsgObj) => {\n let { error, message, showOnError, showOnSuccess } = obj;\n error = typeof error !== 'undefined' ? error : false;\n message = typeof message !== 'undefined' ? message : '';\n showOnError = typeof showOnError !== 'undefined' ? showOnError : true;\n showOnSuccess = typeof showOnSuccess !== 'undefined' ? showOnSuccess : false;\n return {\n error,\n message,\n showOnError,\n showOnSuccess,\n };\n};\ninterface AttributesInputObj {\n maxLength?: number;\n}\ninterface Props {\n attributesWrapper?: object;\n attributesInput?: AttributesInputObj;\n value?: string;\n disabled?: boolean;\n validate?: boolean;\n classNameInput?: string;\n classNameWrapper?: string;\n classNameContainer?: string;\n customStyleInput?: object;\n customStyleWrapper?: object;\n customStyleContainer?: object;\n validationOption?: object;\n asyncMsgObj?: object;\n onChange: (res: string, e: React.ChangeEvent) => void;\n onBlur?: (e: React.FocusEvent) => void;\n onFocus?: (e: React.FocusEvent) => void;\n onClick?: (e: React.MouseEvent) => void;\n onKeyUp?: (e: React.KeyboardEvent) => void;\n validationCallback?: (res: boolean) => void;\n}\nconst autoFormatNumber = (v: number | string, numberType: string, mantissa: number) => {\n const DOT = '.';\n const ZERO = '0';\n let res = '';\n let hasDot = false;\n const splitStr = String(v).split('');\n const startedWithZero = splitStr[0] === '0';\n if (numberType === VALIDATE_NUMBER_TYPE_LIST[2] && splitStr[0] === ZERO && splitStr[1] === ZERO) {\n splitStr.shift();\n }\n splitStr.forEach(i => {\n const charCode = i.toLowerCase().charCodeAt(0);\n if ((charCode >= 48 && charCode <= 57) || (charCode === 46 && !hasDot)) {\n if (charCode === 46) {\n if (numberType === VALIDATE_NUMBER_TYPE_LIST[1]) {\n return;\n }\n hasDot = true;\n }\n res += i;\n }\n });\n if (hasDot && mantissa >= 0) {\n const resArr = res.split(DOT);\n if (mantissa === 0) {\n res = resArr[0];\n } else {\n resArr[1] = resArr[1].slice(0, mantissa);\n res = resArr.join('.');\n }\n }\n if (numberType === VALIDATE_NUMBER_TYPE_LIST[0] || numberType === VALIDATE_NUMBER_TYPE_LIST[2]) {\n if (res.length && res[0] === DOT) {\n res = `0${res}`;\n }\n }\n // if (numberType === VALIDATE_NUMBER_TYPE_LIST[2]) {\n // if (startedWithZero) {\n // if (hasDot) {\n // const resArr = res.split(DOT);\n // res = `${Number(resArr[0])}${DOT}${resArr[1]}`;\n // }\n // }\n // }\n return res;\n};\nconst component: React.FC = ({\n attributesWrapper = {},\n attributesInput = {},\n value = '',\n disabled = false,\n validate = false,\n classNameInput = '',\n classNameWrapper = '',\n classNameContainer = '',\n customStyleInput = {},\n customStyleWrapper = {},\n customStyleContainer = {},\n validationOption = {},\n asyncMsgObj = {},\n onChange = (v: string, e: React.ChangeEvent) => {},\n onBlur = null,\n onFocus = null,\n onClick = null,\n onKeyUp = null,\n validationCallback = null,\n}) => {\n const [err, setErr] = useState(false);\n const [msg, setMsg] = useState('');\n const [successMsg, setSuccessMsg] = useState('');\n const [internalValue, setInternalValue] = useState(String(value));\n const prevInternalValue = usePrevious(internalValue);\n const option = getDefaultValidationOption(validationOption);\n const asyncObj = getDefaultAsyncObj(asyncMsgObj);\n const $input = useRef(null);\n const $el: { [key: string]: any } | null = $input;\n const handleOnBlur = useCallback(\n (e: React.FocusEvent) => {\n if (onBlur) {\n check();\n onBlur(e);\n }\n },\n [internalValue, option],\n );\n const handleOnFocus = useCallback((e: React.FocusEvent) => {\n if (onFocus) {\n onFocus(e);\n }\n }, []);\n const handleOnClick = useCallback((e: React.MouseEvent) => {\n if (onClick) {\n onClick(e);\n }\n }, []);\n const handleOnKeyUp = useCallback(\n (e: React.KeyboardEvent) => {\n if (onKeyUp) {\n const { keyCode } = e;\n const keyCodeTab = 9;\n if (keyCode !== keyCodeTab) {\n check();\n }\n onKeyUp(e);\n }\n },\n [internalValue, option],\n );\n const handleOnChange = useCallback(\n (e: React.ChangeEvent) => {\n if (disabled || $el === null) {\n return;\n }\n let v = $el.current.value;\n if (typeof attributesInput.maxLength !== 'undefined') {\n if ((typeof attributesInput.maxLength === 'string' && attributesInput.maxLength !== '') || (typeof attributesInput.maxLength === 'number' && attributesInput.maxLength !== 0)) {\n if (v.length > Number(attributesInput.maxLength)) {\n return;\n }\n }\n }\n const { type, numberType, mantissa } = option;\n if (type === VALIDATE_OPTION_TYPE_LIST[1]) {\n v = String(autoFormatNumber(v, VALIDATE_NUMBER_TYPE_LIST.indexOf(numberType) >= 0 ? numberType : VALIDATE_NUMBER_TYPE_LIST[0], mantissa));\n }\n if (type === VALIDATE_OPTION_TYPE_LIST[2]) {\n v = utils.getAlphanumeric(v);\n }\n if (type === VALIDATE_OPTION_TYPE_LIST[3]) {\n v = utils.getAlpha(v);\n }\n setInternalValue(v);\n onChange && onChange(v, e);\n if (err) {\n setErr(false);\n } else {\n setSuccessMsg('');\n }\n },\n [err, attributesInput, option],\n );\n const check = useCallback(\n async () => {\n const { reg, min, max, type, name, check, length, regMsg, locale, compare, required, msgOnSuccess, customFunc } = option;\n if (!check) {\n return;\n }\n if (type) {\n if (VALIDATE_OPTION_TYPE_LIST.indexOf(type) !== -1) {\n if (!message[locale] || !message[locale][TYPE]) {\n console.error(REACT_INPUTS_VALIDATION_CUSTOM_ERROR_MESSAGE_EXAMPLE);\n return;\n }\n const msg = message[locale][TYPE];\n const nameText = name ? name : '';\n if (required) {\n if (validator.empty(internalValue)) {\n handleCheckEnd(true, msg.empty(nameText));\n return;\n }\n }\n if (String(internalValue) !== '') {\n if (reg) {\n if (validator['reg'](reg, internalValue)) {\n handleCheckEnd(true, regMsg !== '' ? regMsg : msg.invalid(nameText));\n return;\n }\n }\n if (type === VALIDATE_OPTION_TYPE_LIST[0]) {\n if (min || max) {\n if (min && max) {\n if (String(internalValue).length < min || String(internalValue).length > max) {\n handleCheckEnd(true, msg.inBetween(nameText)(min)(max));\n return;\n }\n } else {\n if (min) {\n if (String(internalValue).length < min) {\n handleCheckEnd(true, msg.lessThan(nameText)(min));\n return;\n }\n }\n if (max) {\n if (String(internalValue).length > max) {\n handleCheckEnd(true, msg.greaterThan(nameText)(max));\n return;\n }\n }\n }\n }\n if (length) {\n if (String(internalValue).length !== length) {\n handleCheckEnd(true, msg.lengthEqual(nameText)(length));\n return;\n }\n }\n }\n if (type === VALIDATE_OPTION_TYPE_LIST[1]) {\n if (!validator[type](internalValue, null, null)) {\n handleCheckEnd(true, msg.invalid(nameText));\n return;\n }\n if (min || max) {\n if (min && max) {\n if (!validator[type](internalValue, min, max)) {\n handleCheckEnd(true, msg.inBetween(nameText)(min)(max));\n return;\n }\n } else {\n if (min) {\n if (!validator[type](internalValue, min)) {\n handleCheckEnd(true, msg.lessThan(nameText)(min));\n return;\n }\n }\n if (max) {\n if (!validator[type](internalValue, 0, max)) {\n handleCheckEnd(true, msg.greaterThan(nameText)(max));\n return;\n }\n }\n }\n }\n if (length) {\n if (String(internalValue).length !== length) {\n handleCheckEnd(true, msg.lengthEqual(nameText)(length));\n return;\n }\n }\n }\n if (compare && compare !== '') {\n if (internalValue !== compare) {\n handleCheckEnd(true, msg.twoInputsNotEqual());\n return;\n }\n }\n }\n if (customFunc && typeof customFunc === 'function') {\n const customFuncResult = await customFunc(internalValue);\n /* istanbul ignore next because of async problem */\n if (typeof customFuncResult === 'object') {\n if (typeof customFuncResult.error === 'boolean' && typeof customFuncResult.message === 'string') {\n if (customFuncResult.error === false && customFuncResult.showOnSuccess === true) {\n setSuccessMsg(customFuncResult.message);\n }\n handleCheckEnd(customFuncResult.error, customFuncResult.message, true);\n }\n return;\n }\n /* istanbul ignore next because of async problem */\n if (customFuncResult !== true) {\n handleCheckEnd(true, customFuncResult, true);\n return;\n }\n }\n if (msgOnSuccess) {\n setSuccessMsg(msgOnSuccess);\n }\n handleCheckEnd(false, msgOnSuccess);\n } else {\n console.error(`The valid ${utils.toCamelCase(TYPE)(true)} \"type\" options in validationOption are [${VALIDATE_OPTION_TYPE_LIST.map(i => i)}]`);\n }\n } else {\n console.error('Please provide \"type\" in validationOption');\n }\n },\n [internalValue, option],\n );\n const handleCheckEnd = useCallback((err: boolean, message: string, fromCustomFunc: boolean = false) => {\n let msg = message;\n const { msgOnError } = option;\n if (err && msgOnError && !fromCustomFunc) {\n msg = msgOnError;\n }\n setErr(err);\n setMsg(msg);\n validationCallback && validationCallback(err);\n }, []);\n useEffect(\n () => {\n if (validate) {\n check();\n }\n },\n [validate],\n );\n useEffect(\n () => {\n setInternalValue(String(value));\n },\n [value],\n );\n useEffect(\n () => {\n /* istanbul ignore next because of https://github.com/airbnb/enzyme/issues/441 && https://github.com/airbnb/enzyme/blob/master/docs/future.md */\n if (typeof prevInternalValue !== 'undefined' && prevInternalValue !== internalValue) {\n if (option.customFunc && onKeyUp) {\n check();\n }\n }\n },\n [internalValue],\n );\n useEffect(\n () => {\n if (asyncObj) {\n if (asyncObj.message) {\n if (asyncObj.showOnError) {\n handleCheckEnd(asyncObj.error, asyncObj.message);\n }\n if (!asyncObj.error && asyncObj.showOnSuccess) {\n setSuccessMsg(asyncObj.message);\n }\n }\n }\n },\n [asyncMsgObj],\n );\n const wrapperClass = `${classNameWrapper} ${reactInputsValidationCss[`${TYPE}__wrapper`]} ${err && reactInputsValidationCss['error']} ${successMsg !== '' &&\n !err &&\n reactInputsValidationCss['success']} ${disabled && reactInputsValidationCss['disabled']}`;\n const containerClass = `${classNameContainer} ${reactInputsValidationCss[`${TYPE}__container`]} ${err && reactInputsValidationCss['error']} ${successMsg !== '' &&\n !err &&\n reactInputsValidationCss['success']} ${disabled && reactInputsValidationCss['disabled']}`;\n const inputClass = `${classNameInput} ${reactInputsValidationCss[`${TYPE}__input`]} ${err && reactInputsValidationCss['error']} ${successMsg !== '' &&\n !err &&\n reactInputsValidationCss['success']} ${disabled && reactInputsValidationCss['disabled']}`;\n const errMsgClass = `${MSG_CLASS_IDENTITIFIER} ${reactInputsValidationCss['msg']} ${err && reactInputsValidationCss['error']}`;\n const successMsgClass = `${MSG_CLASS_IDENTITIFIER} ${reactInputsValidationCss['msg']} ${!err && reactInputsValidationCss['success']}`;\n let msgHtml;\n const { showMsg } = option;\n if (showMsg && err && msg) {\n msgHtml =
{msg}
;\n }\n if (showMsg && !err && successMsg !== '') {\n msgHtml =
{successMsg}
;\n }\n return (\n
\n
\n \n
\n {msgHtml}\n
\n );\n};\nexport default memo(component);\n","import * as React from 'react';\nconst { useState, useEffect, useCallback, useRef, memo } = React;\nimport message from './message';\nimport validator from './validator';\nimport utils from './utils';\nimport { REACT_INPUTS_VALIDATION_CUSTOM_ERROR_MESSAGE_EXAMPLE, DEFAULT_LOCALE, MSG_CLASS_IDENTITIFIER, usePrevious } from './const';\nimport reactInputsValidationCss from './react-inputs-validation.css';\nconst TYPE = 'textarea';\nconst VALIDATE_OPTION_TYPE_LIST = ['string'];\ninterface DefaultValidationOption {\n locale?: string;\n reg?: string;\n min?: number;\n max?: number;\n type?: string;\n name?: string;\n check?: boolean;\n showMsg?: boolean;\n length?: number;\n regMsg?: string;\n required?: boolean;\n msgOnError?: string;\n msgOnSuccess?: string;\n customFunc?: Function | undefined;\n}\nconst getDefaultValidationOption = (obj: DefaultValidationOption) => {\n let { reg, min, max, type, name, check, length, regMsg, required, showMsg, locale, msgOnError, msgOnSuccess, customFunc } = obj;\n locale = typeof locale !== 'undefined' ? locale : DEFAULT_LOCALE;\n reg = typeof reg !== 'undefined' ? reg : '';\n min = typeof min !== 'undefined' ? min : 0;\n max = typeof max !== 'undefined' ? max : 0;\n type = typeof type !== 'undefined' ? type : 'string';\n name = typeof name !== 'undefined' ? name : '';\n check = typeof check !== 'undefined' ? check : true;\n showMsg = typeof showMsg !== 'undefined' ? showMsg : true;\n length = typeof length !== 'undefined' ? length : 0;\n regMsg = typeof regMsg !== 'undefined' ? regMsg : '';\n required = typeof required !== 'undefined' ? required : true;\n msgOnError = typeof msgOnError !== 'undefined' ? msgOnError : '';\n msgOnSuccess = typeof msgOnSuccess !== 'undefined' ? msgOnSuccess : '';\n customFunc = typeof customFunc !== 'undefined' ? customFunc : undefined;\n return {\n reg,\n min,\n max,\n type,\n name,\n check,\n length,\n regMsg,\n locale,\n required,\n showMsg,\n msgOnError,\n msgOnSuccess,\n customFunc,\n };\n};\ninterface DefaultAsyncMsgObj {\n error?: boolean;\n message?: string;\n showOnError?: boolean;\n showOnSuccess?: boolean;\n}\nconst getDefaultAsyncObj = (obj: DefaultAsyncMsgObj) => {\n let { error, message, showOnError, showOnSuccess } = obj;\n error = typeof error !== 'undefined' ? error : false;\n message = typeof message !== 'undefined' ? message : '';\n showOnError = typeof showOnError !== 'undefined' ? showOnError : true;\n showOnSuccess = typeof showOnSuccess !== 'undefined' ? showOnSuccess : false;\n return {\n error,\n message,\n showOnError,\n showOnSuccess,\n };\n};\ninterface AttributesInputObj {\n maxLength?: number;\n}\ninterface Props {\n attributesWrapper?: object;\n attributesInput?: AttributesInputObj;\n value?: string;\n disabled?: boolean;\n validate?: boolean;\n classNameInput?: string;\n classNameWrapper?: string;\n classNameContainer?: string;\n customStyleInput?: object;\n customStyleWrapper?: object;\n customStyleContainer?: object;\n validationOption?: object;\n asyncMsgObj?: object;\n onChange: (res: string, e: React.ChangeEvent) => void;\n onBlur?: (e: React.FocusEvent) => void;\n onFocus?: (e: React.FocusEvent) => void;\n onClick?: (e: React.MouseEvent) => void;\n onKeyUp?: (e: React.KeyboardEvent) => void;\n validationCallback?: (res: boolean) => void;\n}\n\nconst component: React.FC = ({\n attributesWrapper = {},\n attributesInput = {},\n value = '',\n disabled = false,\n validate = false,\n classNameInput = '',\n classNameWrapper = '',\n classNameContainer = '',\n customStyleInput = {},\n customStyleWrapper = {},\n customStyleContainer = {},\n validationOption = {},\n asyncMsgObj = {},\n onChange = () => {},\n onBlur = null,\n onFocus = null,\n onClick = null,\n onKeyUp = null,\n validationCallback = null,\n}) => {\n const [err, setErr] = useState(false);\n const [msg, setMsg] = useState('');\n const [successMsg, setSuccessMsg] = useState('');\n const [internalValue, setInternalValue] = useState(String(value));\n const prevInternalValue = usePrevious(internalValue);\n const option = getDefaultValidationOption(validationOption);\n const asyncObj = getDefaultAsyncObj(asyncMsgObj);\n const $input = useRef(null);\n const $el: { [key: string]: any } | null = $input;\n const handleOnBlur = useCallback(\n (e: React.FocusEvent) => {\n if (onBlur) {\n check();\n onBlur(e);\n }\n },\n [internalValue, option],\n );\n const handleOnFocus = useCallback((e: React.FocusEvent) => {\n if (onFocus) {\n onFocus(e);\n }\n }, []);\n const handleOnClick = useCallback((e: React.MouseEvent) => {\n if (onClick) {\n onClick(e);\n }\n }, []);\n const handleOnKeyUp = useCallback(\n (e: React.KeyboardEvent) => {\n if (onKeyUp) {\n const { keyCode } = e;\n const keyCodeTab = 9;\n if (keyCode !== keyCodeTab) {\n check();\n }\n onKeyUp(e);\n }\n },\n [internalValue, option],\n );\n const handleOnChange = useCallback(\n (e: React.ChangeEvent) => {\n if (disabled || $el === null) {\n return;\n }\n const v = $el.current.value;\n if (typeof attributesInput.maxLength !== 'undefined') {\n if ((typeof attributesInput.maxLength === 'string' && attributesInput.maxLength !== '') || (typeof attributesInput.maxLength === 'number' && attributesInput.maxLength !== 0)) {\n if (v.length > Number(attributesInput.maxLength)) {\n return;\n }\n }\n }\n setInternalValue(v);\n onChange && onChange(v, e);\n if (err) {\n setErr(false);\n } else {\n setSuccessMsg('');\n }\n },\n [err],\n );\n const check = useCallback(\n async () => {\n const { reg, min, max, type, name, check, length, regMsg, locale, required, msgOnSuccess, customFunc } = option;\n if (!check) {\n return;\n }\n if (type) {\n if (VALIDATE_OPTION_TYPE_LIST.indexOf(type) !== -1) {\n if (!message[locale] || !message[locale][TYPE]) {\n console.error(REACT_INPUTS_VALIDATION_CUSTOM_ERROR_MESSAGE_EXAMPLE);\n return;\n }\n const msg = message[locale][TYPE];\n const nameText = name ? name : '';\n if (required) {\n if (validator.empty(internalValue)) {\n handleCheckEnd(true, msg.empty(nameText));\n return;\n }\n }\n if (String(internalValue) !== '') {\n if (reg) {\n if (validator['reg'](reg, internalValue)) {\n handleCheckEnd(true, regMsg !== '' ? regMsg : msg.invalid(nameText));\n return;\n }\n }\n if (min || max) {\n if (min && max) {\n if (String(internalValue).length < min || String(internalValue).length > max) {\n handleCheckEnd(true, msg.inBetween(nameText)(min)(max));\n return;\n }\n } else {\n if (min) {\n if (String(internalValue).length < min) {\n handleCheckEnd(true, msg.lessThan(nameText)(min));\n return;\n }\n }\n if (max) {\n if (String(internalValue).length > max) {\n handleCheckEnd(true, msg.greaterThan(nameText)(max));\n return;\n }\n }\n }\n }\n if (length) {\n if (String(internalValue).length !== length) {\n handleCheckEnd(true, msg.lengthEqual(nameText)(length));\n return;\n }\n }\n }\n if (customFunc && typeof customFunc === 'function') {\n const customFuncResult = await customFunc(internalValue);\n /* istanbul ignore next because of async problem */\n if (typeof customFuncResult === 'object') {\n if (typeof customFuncResult.error === 'boolean' && typeof customFuncResult.message === 'string') {\n if (customFuncResult.error === false && customFuncResult.showOnSuccess === true) {\n setSuccessMsg(customFuncResult.message);\n }\n handleCheckEnd(customFuncResult.error, customFuncResult.message, true);\n }\n return;\n }\n /* istanbul ignore next because of async problem */\n if (customFuncResult !== true) {\n handleCheckEnd(true, customFuncResult, true);\n return;\n }\n }\n if (msgOnSuccess) {\n setSuccessMsg(msgOnSuccess);\n }\n handleCheckEnd(false, msgOnSuccess);\n } else {\n console.error(`The valid ${utils.toCamelCase(TYPE)(true)} \"type\" options in validationOption are [${VALIDATE_OPTION_TYPE_LIST.map(i => i)}]`);\n }\n } else {\n console.error('Please provide \"type\" in validationOption');\n }\n },\n [internalValue, option],\n );\n const handleCheckEnd = useCallback((err: boolean, message: string, fromCustomFunc: boolean = false) => {\n let msg = message;\n const { msgOnError } = option;\n if (err && msgOnError && !fromCustomFunc) {\n msg = msgOnError;\n }\n setErr(err);\n setMsg(msg);\n validationCallback && validationCallback(err);\n }, []);\n useEffect(\n () => {\n if (validate) {\n check();\n }\n },\n [validate],\n );\n useEffect(\n () => {\n setInternalValue(String(value));\n },\n [value],\n );\n useEffect(\n () => {\n /* istanbul ignore next because of https://github.com/airbnb/enzyme/issues/441 && https://github.com/airbnb/enzyme/blob/master/docs/future.md */\n if (typeof prevInternalValue !== 'undefined' && prevInternalValue !== internalValue) {\n if (option.customFunc && onKeyUp) {\n check();\n }\n }\n },\n [internalValue],\n );\n useEffect(\n () => {\n if (asyncObj) {\n if (asyncObj.message) {\n if (asyncObj.showOnError) {\n handleCheckEnd(asyncObj.error, asyncObj.message);\n }\n if (!asyncObj.error && asyncObj.showOnSuccess) {\n setSuccessMsg(asyncObj.message);\n }\n }\n }\n },\n [asyncMsgObj],\n );\n const wrapperClass = `${classNameWrapper} ${reactInputsValidationCss[`${TYPE}__wrapper`]} ${err && reactInputsValidationCss['error']} ${successMsg !== '' &&\n !err &&\n reactInputsValidationCss['success']} ${disabled && reactInputsValidationCss['disabled']}`;\n const containerClass = `${classNameContainer} ${reactInputsValidationCss[`${TYPE}__container`]} ${err && reactInputsValidationCss['error']} ${successMsg !== '' &&\n !err &&\n reactInputsValidationCss['success']} ${disabled && reactInputsValidationCss['disabled']}`;\n const inputClass = `${classNameInput} ${reactInputsValidationCss[`${TYPE}__input`]} ${err && reactInputsValidationCss['error']} ${successMsg !== '' &&\n !err &&\n reactInputsValidationCss['success']} ${disabled && reactInputsValidationCss['disabled']}`;\n const errMsgClass = `${MSG_CLASS_IDENTITIFIER} ${reactInputsValidationCss['msg']} ${err && reactInputsValidationCss['error']}`;\n const successMsgClass = `${MSG_CLASS_IDENTITIFIER} ${reactInputsValidationCss['msg']} ${!err && reactInputsValidationCss['success']}`;\n let msgHtml;\n const { showMsg } = option;\n if (showMsg && err && msg) {\n msgHtml =
{msg}
;\n }\n if (showMsg && !err && successMsg !== '') {\n msgHtml =
{successMsg}
;\n }\n return (\n
\n
\n \n
\n {msgHtml}\n
\n );\n};\nexport default memo(component);\n","import * as React from 'react';\nconst { useState, useEffect, useCallback, useRef, useMemo, memo } = React;\nimport message from './message';\nimport { REACT_INPUTS_VALIDATION_CUSTOM_ERROR_MESSAGE_EXAMPLE, DEFAULT_LOCALE, WRAPPER_CLASS_IDENTITIFIER, CONTAINER_CLASS_IDENTITIFIER, MSG_CLASS_IDENTITIFIER, usePrevious } from './const';\nimport utils from './utils';\nimport reactInputsValidationCss from './react-inputs-validation.css';\nconst TYPE = 'select';\nconst keyCodeEsc = 27;\nconst keyCodeDown = 40;\nconst keyCodeUp = 38;\nconst keyCodeEnter = 13;\nconst selectKeyList = [keyCodeEsc, keyCodeDown, keyCodeUp, keyCodeEnter];\n/* istanbul ignore next */\nif (!String.prototype.startsWith) {\n String.prototype.startsWith = function(searchString, position) {\n const p = position || 0;\n return this.indexOf(searchString, p) === p;\n };\n}\ninterface DefaultValidationOption {\n name?: string;\n check?: boolean;\n showMsg?: boolean;\n required?: boolean;\n locale?: string;\n msgOnError?: string;\n msgOnSuccess?: string;\n}\nconst getDefaultValidationOption = (obj: DefaultValidationOption) => {\n let { name, check, required, showMsg, locale, msgOnError, msgOnSuccess } = obj;\n locale = typeof locale !== 'undefined' ? locale : DEFAULT_LOCALE;\n name = typeof name !== 'undefined' ? name : '';\n check = typeof check !== 'undefined' ? check : true;\n showMsg = typeof showMsg !== 'undefined' ? showMsg : true;\n required = typeof required !== 'undefined' ? required : true;\n msgOnSuccess = typeof msgOnSuccess !== 'undefined' ? msgOnSuccess : '';\n msgOnError = typeof msgOnError !== 'undefined' ? msgOnError : '';\n return {\n name,\n check,\n showMsg,\n required,\n locale,\n msgOnError,\n msgOnSuccess,\n };\n};\ninterface DefaultAsyncMsgObj {\n error?: boolean;\n message?: string;\n showOnError?: boolean;\n showOnSuccess?: boolean;\n}\nconst getDefaultAsyncObj = (obj: DefaultAsyncMsgObj) => {\n let { error, message, showOnError, showOnSuccess } = obj;\n error = typeof error !== 'undefined' ? error : false;\n message = typeof message !== 'undefined' ? message : '';\n showOnError = typeof showOnError !== 'undefined' ? showOnError : true;\n showOnSuccess = typeof showOnSuccess !== 'undefined' ? showOnSuccess : false;\n return {\n error,\n message,\n showOnError,\n showOnSuccess,\n };\n};\nexport const isValidValue = (list: OptionListItem[], value: any) => {\n let res = false;\n if (list.length) {\n for (let i = 0; i < list.length; i += 1) {\n if (list[i].id === value) {\n res = true;\n break;\n }\n }\n }\n return res;\n};\nexport const getItem = (list: OptionListItem[], value: any) => {\n let res = null;\n if (list.length) {\n for (let i = 0; i < list.length; i += 1) {\n if (list[i].id === value) {\n res = list[i];\n break;\n }\n }\n }\n return res;\n};\nexport const getIndex = (list: OptionListItem[], value: string) => {\n let key = -1;\n for (let i = 0; i < list.length; i += 1) {\n if (list[i].id === value) {\n key = i;\n break;\n }\n }\n return key;\n};\ninterface OptionListItem {\n id: string;\n name: string;\n}\ninterface Props {\n attributesWrapper?: object;\n attributesInput?: object;\n value?: string | number;\n disabled?: boolean;\n validate?: boolean;\n showSearch?: boolean;\n keyword?: string;\n optionList: OptionListItem[];\n onChange: (res: object, e: React.MouseEvent) => void;\n onBlur?: (e: React.FocusEvent | Event) => void;\n onFocus?: (e: React.FocusEvent) => void;\n onClick?: (e: React.MouseEvent) => void;\n validationOption?: object;\n asyncMsgObj?: object;\n classNameWrapper?: string;\n classNameContainer?: string;\n classNameSelect?: string;\n classNameOptionListContainer?: string;\n classNameDropdownIconOptionListItem?: string;\n classNameOptionListItem?: string;\n customStyleWrapper?: object;\n customStyleContainer?: object;\n customStyleSelect?: object;\n customStyleOptionListContainer?: object;\n customStyleDropdownIcon?: object;\n customStyleOptionListItem?: object;\n validationCallback?: (res: boolean) => void;\n}\ninterface Node {\n [key: string]: any;\n}\nlet globalVariableIsFocusing: boolean = false;\nlet globalVariableIsCorrected: boolean = false;\nlet globalVariableCurrentFocus: any | null = null;\nlet globalVariableTypingTimeout: any | null = null;\nconst component: React.FC = ({\n attributesWrapper = {},\n attributesInput = {},\n value = '',\n disabled = false,\n validate = false,\n showSearch = false,\n keyword = '',\n optionList = [],\n classNameWrapper = '',\n classNameContainer = '',\n classNameSelect = '',\n classNameOptionListItem = '',\n classNameOptionListContainer = '',\n classNameDropdownIconOptionListItem = '',\n customStyleWrapper = {},\n customStyleContainer = {},\n customStyleSelect = {},\n customStyleOptionListItem = {},\n customStyleOptionListContainer = {},\n customStyleDropdownIcon = {},\n validationOption = {},\n asyncMsgObj = {},\n onChange = () => {},\n onBlur = null,\n onFocus = null,\n onClick = null,\n validationCallback = null,\n}) => {\n const [err, setErr] = useState(false);\n const [msg, setMsg] = useState('');\n const [successMsg, setSuccessMsg] = useState('');\n const [internalValue, setInternalValue] = useState(String(value));\n const stateKeyword = useState(keyword);\n const prevKeyword = usePrevious(stateKeyword[0]);\n const prevInternalValue = usePrevious(internalValue);\n const prevOptionList = usePrevious(optionList);\n const [show, setShow] = useState(false);\n const prevShow = usePrevious(show);\n const [isTyping, setIsTyping] = useState(false);\n const initKeycodeList: number[] = [];\n const [keycodeList, setKeycodeList] = useState(initKeycodeList);\n const option = getDefaultValidationOption(validationOption);\n const asyncObj = getDefaultAsyncObj(asyncMsgObj);\n const $button = useRef(null);\n const $wrapper = useRef(null);\n const $itemsWrapper = useRef(null);\n const $searchInputWrapper = useRef(null);\n const $searchInput = useRef(null);\n const $elButton: { [key: string]: any } | null = $button;\n const $elWrapper: { [key: string]: any } | null = $wrapper;\n const $elItemsWrapper: { [key: string]: any } | null = $itemsWrapper;\n const $itemsRef: { [key: string]: any } = [];\n const filteredOptionList = useMemo(() => {\n let res = optionList;\n if (res.length) {\n if (stateKeyword[0]) {\n res = optionList.filter(i => i.name.toLowerCase().includes(stateKeyword[0].toLowerCase()));\n }\n }\n return res;\n }, [stateKeyword[0], optionList]);\n const handleOnSearch = useCallback((e: any) => {\n stateKeyword[1](e.target.value);\n }, []);\n const handleOnSearchKeyDown = useCallback(\n (e: any) => {\n const { keyCode } = e;\n const direction = getDirection(keyCode);\n if (selectKeyList.indexOf(keyCode) !== -1) {\n e.preventDefault();\n handleOnKeyDown(keyCode);\n } else if (keyCode === 32) {\n // space\n stateKeyword[1](`${stateKeyword[0]} `);\n e.preventDefault();\n }\n scroll(direction);\n },\n [filteredOptionList],\n );\n useEffect(() => {\n if (show && showSearch) {\n globalVariableCurrentFocus = 0;\n scroll('up');\n addActive();\n }\n }, [stateKeyword[0]]);\n const handleOnBlur = useCallback(\n (e: React.FocusEvent | Event) => {\n if (onBlur) {\n check();\n onBlur(e);\n }\n },\n [internalValue, option],\n );\n const handleOnFocus = useCallback((e: React.FocusEvent) => {\n if (onFocus) {\n onFocus(e);\n }\n }, []);\n const handleOnClick = useCallback((e: React.MouseEvent) => {\n if (onClick) {\n onClick(e);\n }\n }, []);\n const handleOnChange = useCallback((item: object, e: React.MouseEvent) => {\n if (disabled) {\n return;\n }\n onChange && onChange(item, e);\n }, []);\n const check = useCallback(() => {\n const { name, check, locale, required, msgOnSuccess } = option;\n if (!check) {\n return;\n }\n if (!message[locale] || !message[locale][TYPE]) {\n console.error(REACT_INPUTS_VALIDATION_CUSTOM_ERROR_MESSAGE_EXAMPLE);\n return;\n }\n if (required) {\n const msg = message[locale][TYPE];\n const nameText = name ? name : '';\n if (!isValidValue(optionList, internalValue) || internalValue === '' || internalValue === 'null' || internalValue === 'undefined') {\n handleCheckEnd(true, msg.empty(nameText));\n return;\n }\n }\n if (msgOnSuccess) {\n setSuccessMsg(msgOnSuccess);\n }\n handleCheckEnd(false, msgOnSuccess);\n }, [internalValue, option]);\n const handleCheckEnd = useCallback((err: boolean, message: string) => {\n let msg = message;\n const { msgOnError } = option;\n if (err && msgOnError) {\n msg = msgOnError;\n }\n setErr(err);\n setMsg(msg);\n validationCallback && validationCallback(err);\n }, []);\n /* istanbul ignore next because of https://github.com/airbnb/enzyme/issues/441 && https://github.com/airbnb/enzyme/blob/master/docs/future.md */\n useEffect(() => {\n if (typeof window !== 'undefined') {\n window.addEventListener('mousedown', pageClick);\n window.addEventListener('touchstart', pageClick);\n return () => {\n window.removeEventListener('mousedown', pageClick);\n window.removeEventListener('touchstart', pageClick);\n $elWrapper.current.removeEventListener('keydown', onKeyDown);\n };\n }\n }, []);\n /* istanbul ignore next because of https://github.com/airbnb/enzyme/issues/441 && https://github.com/airbnb/enzyme/blob/master/docs/future.md */\n const pageClick = useCallback((e: Event) => {\n if ($elWrapper.current.contains(e.target)) {\n return;\n }\n if (globalVariableIsFocusing) {\n handleOnBlur(e);\n globalVariableIsFocusing = false;\n }\n setShow(false);\n }, []);\n /* istanbul ignore next because of https://github.com/airbnb/enzyme/issues/441 && https://github.com/airbnb/enzyme/blob/master/docs/future.md */\n const resetCurrentFocus = useCallback(() => {\n globalVariableCurrentFocus = getIndex(filteredOptionList, internalValue);\n scroll();\n }, [internalValue]);\n /* istanbul ignore next because of https://github.com/airbnb/enzyme/issues/441 && https://github.com/airbnb/enzyme/blob/master/docs/future.md */\n const setTimeoutTyping = useCallback(() => {\n if (globalVariableTypingTimeout) {\n clearTimeout(globalVariableTypingTimeout);\n }\n globalVariableTypingTimeout = setTimeout(() => {\n setKeycodeList([]);\n }, 250);\n }, []);\n /* istanbul ignore next because of https://github.com/airbnb/enzyme/issues/441 && https://github.com/airbnb/enzyme/blob/master/docs/future.md */\n const scroll = useCallback((direction: undefined | string = undefined) => {\n if ($itemsWrapper && $itemsWrapper.current && $itemsWrapper.current.children) {\n const $children = $itemsWrapper.current.children;\n const containerHeight = $elItemsWrapper.current.offsetHeight;\n const containerScrollTop = $elItemsWrapper.current.scrollTop;\n if (!$children[globalVariableCurrentFocus]) {\n return;\n }\n const itemHeight = $children[globalVariableCurrentFocus].offsetHeight;\n if (direction) {\n if (direction === 'loop') {\n $elItemsWrapper.current.scrollTop = $children.length * itemHeight;\n return;\n }\n if (direction === 'down') {\n const bound = containerScrollTop + containerHeight;\n const heightItems = globalVariableCurrentFocus * itemHeight;\n const heightContainer = bound - itemHeight;\n if (heightItems >= heightContainer) {\n const offset = Math.abs(heightItems - heightContainer - itemHeight);\n if (offset >= 0 && !globalVariableIsCorrected) {\n $elItemsWrapper.current.scrollTop = containerScrollTop + itemHeight - offset;\n globalVariableIsCorrected = true;\n } else {\n $elItemsWrapper.current.scrollTop = containerScrollTop + itemHeight;\n }\n }\n }\n if (direction === 'up') {\n globalVariableIsCorrected = false;\n if (globalVariableCurrentFocus * itemHeight <= containerScrollTop) {\n $elItemsWrapper.current.scrollTop = globalVariableCurrentFocus * itemHeight;\n }\n }\n } else {\n globalVariableIsCorrected = false;\n $elItemsWrapper.current.scrollTop = globalVariableCurrentFocus * itemHeight;\n }\n }\n }, []);\n const handleOnItemClick = useCallback((item: object, e: React.MouseEvent) => {\n handleOnChange(item, e);\n stateKeyword[1]('');\n }, []);\n const handleOnItemMouseOver = useCallback((index: number) => {\n globalVariableCurrentFocus = index;\n addActive();\n }, []);\n const handleOnItemMouseMove = useCallback(() => {\n setIsTyping(false);\n }, []);\n const handleOnItemMouseOut = useCallback(() => {\n removeActive();\n }, []);\n const addActive = useCallback(() => {\n if ($itemsWrapper && $itemsWrapper.current && $itemsWrapper.current.children) {\n const $children = $itemsWrapper.current.children;\n removeActive();\n if (globalVariableCurrentFocus === null) return;\n if (globalVariableCurrentFocus >= $children.length) globalVariableCurrentFocus = 0;\n if (globalVariableCurrentFocus < 0) globalVariableCurrentFocus = $children.length - 1;\n if ($children[globalVariableCurrentFocus]) $children[globalVariableCurrentFocus].className += ` ${reactInputsValidationCss[`${TYPE}__hover-active`]}`;\n }\n }, []);\n const removeActive = useCallback(() => {\n if ($itemsWrapper && $itemsWrapper.current && $itemsWrapper.current.children) {\n const $children = $itemsWrapper.current.children;\n for (let i = 0; i < $children.length; i += 1) {\n $children[i].className = $children[i].className.replace(reactInputsValidationCss[`${TYPE}__hover-active`], '');\n }\n }\n }, []);\n const getDirection = useCallback(keyCode => {\n switch (keyCode) {\n case keyCodeUp:\n return 'up';\n case keyCodeDown:\n return 'down';\n default:\n return undefined;\n }\n }, []);\n const handleOnKeyDown = useCallback(\n keyCode => {\n if (keyCode === keyCodeEsc) {\n setShow(false);\n resetCurrentFocus();\n return;\n }\n if (keyCode === keyCodeDown) {\n globalVariableCurrentFocus += 1;\n if (globalVariableCurrentFocus > filteredOptionList.length - 1) {\n globalVariableCurrentFocus = 0;\n scroll('up');\n }\n addActive();\n } else if (keyCode === keyCodeUp) {\n globalVariableCurrentFocus -= 1;\n if (globalVariableCurrentFocus < 0) {\n globalVariableCurrentFocus = filteredOptionList.length - 1;\n scroll('loop');\n }\n addActive();\n } else if (keyCode === keyCodeEnter) {\n if (globalVariableCurrentFocus > -1) {\n if ($itemsWrapper && $itemsWrapper.current && $itemsWrapper.current.children) {\n const $children = $itemsWrapper.current.children;\n if ($children[globalVariableCurrentFocus]) {\n $children[globalVariableCurrentFocus].click();\n } else {\n return;\n }\n }\n }\n }\n },\n [filteredOptionList],\n );\n /* istanbul ignore next because of https://github.com/airbnb/enzyme/issues/441 && https://github.com/airbnb/enzyme/blob/master/docs/future.md */\n const onKeyDown = useCallback(\n (e: any) => {\n if (showSearch) {\n return;\n }\n setIsTyping(true);\n if (e.preventDefault) {\n e.preventDefault();\n }\n if (!show) {\n return;\n }\n globalVariableCurrentFocus = globalVariableCurrentFocus === null ? getIndex(filteredOptionList, String(value)) : globalVariableCurrentFocus;\n const { keyCode } = e;\n const direction = getDirection(keyCode);\n if (selectKeyList.indexOf(keyCode) !== -1) {\n handleOnKeyDown(keyCode);\n } else {\n setTimeoutTyping();\n const newkeyCodeList = [...keycodeList, keyCode];\n const str = String.fromCharCode(...newkeyCodeList).toLowerCase();\n let index = -1;\n filteredOptionList.forEach((i, k) => {\n const { name } = i;\n if (name.toLowerCase().startsWith(str)) {\n if (index === -1) {\n index = k;\n }\n }\n });\n if (index !== -1) {\n globalVariableCurrentFocus = index;\n addActive();\n }\n setKeycodeList(newkeyCodeList);\n }\n scroll(direction);\n return globalVariableCurrentFocus;\n },\n [show, value, keycodeList],\n );\n useEffect(() => {\n if (show && $elWrapper) {\n document.addEventListener('keydown', onKeyDown);\n }\n return () => {\n document.removeEventListener('keydown', onKeyDown);\n };\n }, [show, value, keycodeList]);\n useEffect(() => {\n if (validate) {\n check();\n }\n }, [validate]);\n useEffect(() => {\n if (!(!isValidValue(filteredOptionList, internalValue) || internalValue === '' || internalValue === 'null' || internalValue === 'undefined')) {\n setErr(false);\n } else {\n setSuccessMsg('');\n }\n }, [internalValue]);\n useEffect(() => {\n setInternalValue(String(value));\n }, [value]);\n useEffect(() => {\n if (prevOptionList && prevOptionList !== optionList) {\n setInternalValue(String(optionList[0].id));\n }\n }, [optionList]);\n useEffect(() => {\n if (typeof prevInternalValue !== 'undefined' && prevInternalValue !== internalValue) {\n check();\n }\n }, [prevInternalValue, internalValue]);\n useEffect(() => {\n if (asyncObj) {\n if (asyncObj.message) {\n if (asyncObj.showOnError) {\n handleCheckEnd(asyncObj.error, asyncObj.message);\n }\n if (!asyncObj.error && asyncObj.showOnSuccess) {\n setSuccessMsg(asyncObj.message);\n }\n }\n }\n }, [asyncMsgObj]);\n useEffect(() => {\n if (show) {\n if (showSearch) {\n $searchInput.current.focus();\n }\n globalVariableCurrentFocus = globalVariableCurrentFocus === null ? getIndex(filteredOptionList, String(value)) : globalVariableCurrentFocus;\n $itemsRef[globalVariableCurrentFocus] && $itemsRef[globalVariableCurrentFocus].current.focus();\n }\n if (prevShow === true && show === false) {\n $elButton.current.focus();\n }\n resetCurrentFocus();\n }, [show]);\n const wrapperClass = `${WRAPPER_CLASS_IDENTITIFIER} ${classNameWrapper} ${reactInputsValidationCss[`${TYPE}__wrapper`]} ${err && reactInputsValidationCss['error']} ${successMsg !== '' &&\n !err &&\n reactInputsValidationCss['success']} ${disabled && reactInputsValidationCss['disabled']}`;\n const containerClass = `${CONTAINER_CLASS_IDENTITIFIER} ${classNameContainer} ${reactInputsValidationCss[`${TYPE}__container`]} ${err && reactInputsValidationCss['error']} ${show &&\n reactInputsValidationCss['show']} ${successMsg !== '' && !err && reactInputsValidationCss['success']} ${disabled && reactInputsValidationCss['disabled']}`;\n const inputClass = `${reactInputsValidationCss[`${TYPE}__input`]} ${err && reactInputsValidationCss['error']} ${successMsg !== '' && !err && reactInputsValidationCss['success']} ${disabled &&\n reactInputsValidationCss['disabled']}`;\n const selectClass = `${classNameSelect} ${reactInputsValidationCss['ellipsis']} ${err && reactInputsValidationCss['error']} ${successMsg !== '' &&\n !err &&\n reactInputsValidationCss['success']} ${disabled && reactInputsValidationCss['disabled']}`;\n const selectOptionListContainerClass = `${classNameOptionListContainer} ${reactInputsValidationCss[`${TYPE}__options-container`]} ${err && reactInputsValidationCss['error']} ${show &&\n reactInputsValidationCss['show']} ${successMsg !== '' && !err && reactInputsValidationCss['success']} ${disabled && reactInputsValidationCss['disabled']}`;\n const selectOptionListItemClass = `${reactInputsValidationCss[`button`]} ${!isTyping && reactInputsValidationCss[`${TYPE}__options-item-show-cursor`]} ${classNameOptionListItem} ${\n reactInputsValidationCss[`${TYPE}__options-item`]\n } ${err && reactInputsValidationCss['error']} ${successMsg !== '' && !err && reactInputsValidationCss['success']} ${disabled && reactInputsValidationCss['disabled']}`;\n const dropdownIconClass = `${classNameDropdownIconOptionListItem} ${reactInputsValidationCss[`${TYPE}__dropdown-icon`]}`;\n const errMsgClass = `${MSG_CLASS_IDENTITIFIER} ${reactInputsValidationCss['msg']} ${err && reactInputsValidationCss['error']}`;\n const successMsgClass = `${MSG_CLASS_IDENTITIFIER} ${reactInputsValidationCss['msg']} ${!err && reactInputsValidationCss['success']}`;\n let msgHtml;\n const { showMsg } = option;\n if (showMsg && err && msg) {\n msgHtml =
{msg}
;\n }\n if (showMsg && !err && successMsg !== '') {\n msgHtml =
{successMsg}
;\n }\n let optionListHtml;\n const item = getItem(optionList, String(value));\n if (filteredOptionList.length) {\n optionListHtml = filteredOptionList.map((i, k) => (\n \n ));\n } else {\n if (showSearch) {\n optionListHtml = (\n
\n \n \n \n \n
\n );\n }\n }\n const selectorHtml = (\n
\n
{item ? item.name : ''}
\n
\n
\n );\n return (\n {\n handleOnClick(e);\n if (!disabled) {\n if ($searchInputWrapper.current) {\n if ($searchInputWrapper.current.contains(e.target)) {\n setShow(true);\n return;\n }\n }\n setShow(!show);\n }\n }}\n onFocus={handleOnFocus}\n onBlur={handleOnBlur}\n {...attributesWrapper}\n >\n
\n
\n {}} {...attributesInput} />\n
\n {selectorHtml}\n
\n
\n {showSearch && (\n
\n
\n \n \n \n \n \n {stateKeyword[0] && (\n {\n stateKeyword[1]('');\n $searchInput.current.focus();\n }}\n >\n \n \n \n )}\n
\n
\n )}\n
\n {optionListHtml}\n
\n
\n
\n {msgHtml}\n
\n \n );\n};\ninterface OptionProps {\n index?: number;\n id?: string;\n className?: string;\n item?: OptionListItem;\n customStyleOptionListItem?: object;\n onClick?: (res: object, e: React.MouseEvent) => void;\n onMouseOver?: (res: number) => void;\n onMouseMove?: () => void;\n onMouseOut?: () => void;\n}\nexport const Option: React.FC = memo(\n ({ index = -1, id = '', className = '', item = { id: '', name: '' }, customStyleOptionListItem = {}, onClick = () => {}, onMouseOver = () => {}, onMouseMove = () => {}, onMouseOut = () => {} }) => {\n const handleOnClick = useCallback(\n (e: React.MouseEvent) => {\n onClick(item, e);\n },\n [item],\n );\n const handleOnMouseOver = useCallback(() => {\n onMouseOver(index);\n }, []);\n const handleOnMouseMove = useCallback(() => {\n onMouseMove();\n }, []);\n const handleOnMouseOut = useCallback(() => {\n onMouseOut();\n }, []);\n return (\n \n {item.name}\n \n );\n },\n);\nexport default memo(component);\n","import * as React from 'react';\nconst { useState, useEffect, useCallback, useRef, memo } = React;\nimport message from './message';\nimport { REACT_INPUTS_VALIDATION_CUSTOM_ERROR_MESSAGE_EXAMPLE, DEFAULT_LOCALE, WRAPPER_CLASS_IDENTITIFIER, MSG_CLASS_IDENTITIFIER, usePrevious } from './const';\nimport utils from './utils';\nimport reactInputsValidationCss from './react-inputs-validation.css';\nconst TYPE = 'checkbox';\ninterface DefaultValidationOption {\n name?: string;\n check?: boolean;\n showMsg?: boolean;\n required?: boolean;\n locale?: string;\n msgOnError?: string;\n msgOnSuccess?: string;\n}\nconst getDefaultValidationOption = (obj: DefaultValidationOption) => {\n let { name, check, required, showMsg, locale, msgOnError, msgOnSuccess } = obj;\n locale = typeof locale !== 'undefined' ? locale : DEFAULT_LOCALE;\n name = typeof name !== 'undefined' ? name : '';\n check = typeof check !== 'undefined' ? check : true;\n showMsg = typeof showMsg !== 'undefined' ? showMsg : true;\n required = typeof required !== 'undefined' ? required : true;\n msgOnSuccess = typeof msgOnSuccess !== 'undefined' ? msgOnSuccess : '';\n msgOnError = typeof msgOnError !== 'undefined' ? msgOnError : '';\n return {\n name,\n check,\n showMsg,\n required,\n locale,\n msgOnError,\n msgOnSuccess,\n };\n};\ninterface DefaultAsyncMsgObj {\n error?: boolean;\n message?: string;\n showOnError?: boolean;\n showOnSuccess?: boolean;\n}\nconst getDefaultAsyncObj = (obj: DefaultAsyncMsgObj) => {\n let { error, message, showOnError, showOnSuccess } = obj;\n error = typeof error !== 'undefined' ? error : false;\n message = typeof message !== 'undefined' ? message : '';\n showOnError = typeof showOnError !== 'undefined' ? showOnError : true;\n showOnSuccess = typeof showOnSuccess !== 'undefined' ? showOnSuccess : false;\n return {\n error,\n message,\n showOnError,\n showOnSuccess,\n };\n};\ninterface Props {\n attributesWrapper?: object;\n attributesInput?: object;\n value?: string | boolean;\n checked?: boolean;\n disabled?: boolean;\n labelHtml?: React.ReactNode;\n validate?: boolean;\n onChange: (res: boolean, e: React.ChangeEvent | React.MouseEvent) => void;\n onBlur?: (e: React.FocusEvent) => void;\n onFocus?: (e: React.FocusEvent) => void;\n onClick?: (e: React.MouseEvent) => void;\n validationOption?: object;\n asyncMsgObj?: object;\n classNameInput?: string;\n classNameWrapper?: string;\n classNameInputBox?: string;\n classNameContainer?: string;\n customStyleInput?: object;\n customStyleWrapper?: object;\n customStyleContainer?: object;\n customStyleInputBox?: object;\n validationCallback?: (res: boolean) => void;\n}\nconst component: React.FC = ({\n attributesWrapper = {},\n attributesInput = {},\n value = '',\n checked = false,\n disabled = false,\n validate = false,\n labelHtml = null,\n classNameInput = '',\n classNameWrapper = '',\n classNameInputBox = '',\n classNameContainer = '',\n customStyleInput = {},\n customStyleWrapper = {},\n customStyleInputBox = {},\n customStyleContainer = {},\n validationOption = {},\n asyncMsgObj = {},\n onChange = () => {},\n onBlur = null,\n onFocus = null,\n onClick = null,\n validationCallback = null,\n}) => {\n const [err, setErr] = useState(false);\n const [msg, setMsg] = useState('');\n const [successMsg, setSuccessMsg] = useState('');\n const [internalChecked, setInternalChecked] = useState(checked);\n const prevInternalChecked = usePrevious(internalChecked);\n const option = getDefaultValidationOption(validationOption);\n const asyncObj = getDefaultAsyncObj(asyncMsgObj);\n const $input = useRef(null);\n const $el: { [key: string]: any } | null = $input;\n const handleOnBlur = useCallback(\n (e: React.FocusEvent) => {\n if (onBlur) {\n check();\n onBlur(e);\n }\n },\n [internalChecked, option],\n );\n const handleOnFocus = useCallback(\n (e: React.FocusEvent) => {\n if (onFocus) {\n onFocus(e);\n }\n },\n [internalChecked],\n );\n const handleOnClick = useCallback(\n (e: React.MouseEvent) => {\n handleOnChange(e);\n if (onClick) {\n onClick(e);\n }\n },\n [err, internalChecked],\n );\n const handleOnChange = useCallback(\n (e: React.ChangeEvent | React.MouseEvent) => {\n if (disabled || $el === null) {\n return;\n }\n setInternalChecked(!internalChecked);\n onChange && onChange(!internalChecked, e);\n if (err) {\n setErr(false);\n } else {\n setSuccessMsg('');\n }\n },\n [err, internalChecked],\n );\n const check = useCallback(\n () => {\n const { name, check, locale, required, msgOnSuccess } = option;\n if (!check) {\n return;\n }\n if (!message[locale] || !message[locale][TYPE]) {\n console.error(REACT_INPUTS_VALIDATION_CUSTOM_ERROR_MESSAGE_EXAMPLE);\n return;\n }\n if (required) {\n const msg = message[locale][TYPE];\n const nameText = name ? name : '';\n if (!internalChecked) {\n handleCheckEnd(true, msg.unchecked(nameText));\n return;\n }\n }\n if (msgOnSuccess) {\n setSuccessMsg(msgOnSuccess);\n }\n handleCheckEnd(false, msgOnSuccess);\n },\n [internalChecked, option],\n );\n const handleCheckEnd = useCallback((err: boolean, message: string) => {\n let msg = message;\n const { msgOnError } = option;\n if (err && msgOnError) {\n msg = msgOnError;\n }\n setErr(err);\n setMsg(msg);\n validationCallback && validationCallback(err);\n }, []);\n useEffect(\n () => {\n if (validate) {\n check();\n }\n },\n [validate, internalChecked],\n );\n useEffect(\n () => {\n setInternalChecked(checked);\n },\n [checked],\n );\n useEffect(\n () => {\n if (typeof prevInternalChecked !== 'undefined' && prevInternalChecked !== internalChecked) {\n check();\n }\n },\n [prevInternalChecked, internalChecked],\n );\n useEffect(\n () => {\n if (asyncObj) {\n if (asyncObj.message) {\n if (asyncObj.showOnError) {\n handleCheckEnd(asyncObj.error, asyncObj.message);\n }\n if (!asyncObj.error && asyncObj.showOnSuccess) {\n setSuccessMsg(asyncObj.message);\n }\n }\n }\n },\n [asyncMsgObj],\n );\n const wrapperClass = `${reactInputsValidationCss['button']} ${WRAPPER_CLASS_IDENTITIFIER} ${classNameWrapper} ${reactInputsValidationCss[`${TYPE}__wrapper`]} ${internalChecked && reactInputsValidationCss['checked']} ${err &&\n reactInputsValidationCss['error']} ${successMsg !== '' && !err && reactInputsValidationCss['success']} ${disabled && reactInputsValidationCss['disabled']}`;\n const containerClass = `${classNameContainer} ${reactInputsValidationCss[`${TYPE}__container`]} ${internalChecked && reactInputsValidationCss['checked']} ${err &&\n reactInputsValidationCss['error']} ${successMsg !== '' && !err && reactInputsValidationCss['success']} ${disabled && reactInputsValidationCss['disabled']}`;\n const boxClass = `${classNameInputBox} ${reactInputsValidationCss[`${TYPE}__box`]} ${err && reactInputsValidationCss['error']} ${internalChecked &&\n reactInputsValidationCss['checked']} ${successMsg !== '' && !err && reactInputsValidationCss['success']} ${disabled && reactInputsValidationCss['disabled']}`;\n const labelClass = `${internalChecked && reactInputsValidationCss['checked']} ${err && reactInputsValidationCss['error']} ${successMsg !== '' &&\n !err &&\n reactInputsValidationCss['success']} ${disabled && reactInputsValidationCss['disabled']}`;\n const errMsgClass = `${MSG_CLASS_IDENTITIFIER} ${reactInputsValidationCss['msg']} ${err && reactInputsValidationCss['error']}`;\n const successMsgClass = `${MSG_CLASS_IDENTITIFIER} ${reactInputsValidationCss['msg']} ${!err && reactInputsValidationCss['success']}`;\n let msgHtml;\n const { showMsg } = option;\n if (showMsg && err && msg) {\n msgHtml =
{msg}
;\n }\n if (showMsg && !err && successMsg !== '') {\n msgHtml =
{successMsg}
;\n }\n return (\n \n );\n};\nexport default memo(component);\n","import * as React from 'react';\nconst { useState, useEffect, useCallback, useRef, memo } = React;\nimport message from './message';\nimport { REACT_INPUTS_VALIDATION_CUSTOM_ERROR_MESSAGE_EXAMPLE, DEFAULT_LOCALE, WRAPPER_CLASS_IDENTITIFIER, OPTION_LIST_ITEM_IDENTITIFIER, MSG_CLASS_IDENTITIFIER, usePrevious } from './const';\nimport utils from './utils';\nimport reactInputsValidationCss from './react-inputs-validation.css';\nconst TYPE = 'radiobox';\ninterface DefaultValidationOption {\n name?: string;\n check?: boolean;\n showMsg?: boolean;\n required?: boolean;\n locale?: string;\n msgOnError?: string;\n msgOnSuccess?: string;\n}\nconst getDefaultValidationOption = (obj: DefaultValidationOption) => {\n let { name, check, required, showMsg, locale, msgOnError, msgOnSuccess } = obj;\n locale = typeof locale !== 'undefined' ? locale : DEFAULT_LOCALE;\n name = typeof name !== 'undefined' ? name : '';\n check = typeof check !== 'undefined' ? check : true;\n showMsg = typeof showMsg !== 'undefined' ? showMsg : true;\n required = typeof required !== 'undefined' ? required : true;\n msgOnSuccess = typeof msgOnSuccess !== 'undefined' ? msgOnSuccess : '';\n msgOnError = typeof msgOnError !== 'undefined' ? msgOnError : '';\n return {\n name,\n check,\n showMsg,\n required,\n locale,\n msgOnError,\n msgOnSuccess,\n };\n};\ninterface DefaultAsyncMsgObj {\n error?: boolean;\n message?: string;\n showOnError?: boolean;\n showOnSuccess?: boolean;\n}\nconst getDefaultAsyncObj = (obj: DefaultAsyncMsgObj) => {\n let { error, message, showOnError, showOnSuccess } = obj;\n error = typeof error !== 'undefined' ? error : false;\n message = typeof message !== 'undefined' ? message : '';\n showOnError = typeof showOnError !== 'undefined' ? showOnError : true;\n showOnSuccess = typeof showOnSuccess !== 'undefined' ? showOnSuccess : false;\n return {\n error,\n message,\n showOnError,\n showOnSuccess,\n };\n};\nexport const isValidValue = (list: OptionListItem[], value: any) => {\n let res = false;\n if (list.length) {\n for (let i = 0; i < list.length; i += 1) {\n if (list[i].id === value) {\n res = true;\n break;\n }\n }\n }\n return res;\n};\ninterface OptionListItem {\n id: string;\n name: string;\n}\ninterface AttributesInput {}\ninterface Props {\n attributesWrapper: object;\n attributesInputs: AttributesInput[];\n value?: string | number;\n disabled?: boolean;\n validate?: boolean;\n optionList?: OptionListItem[];\n onChange: (res: string, e: React.ChangeEvent) => void;\n onBlur?: (e: React.FocusEvent) => void;\n onFocus?: (e: React.FocusEvent) => void;\n onClick?: (e: React.MouseEvent) => void;\n validationOption?: object;\n asyncMsgObj?: object;\n classNameWrapper?: string;\n classNameInput?: string;\n classNameContainer?: string;\n classNameOptionListItem?: string;\n customStyleWrapper?: object;\n customStyleContainer?: object;\n customStyleInput?: object;\n customStyleOptionListItem?: object;\n validationCallback?: (res: boolean) => void;\n}\nconst component: React.FC = ({\n attributesWrapper = {},\n attributesInputs = [],\n value = '',\n disabled = false,\n validate = false,\n optionList = [],\n classNameWrapper = '',\n classNameInput = '',\n classNameContainer = '',\n classNameOptionListItem = '',\n customStyleWrapper = {},\n customStyleContainer = {},\n customStyleInput = {},\n customStyleOptionListItem = {},\n validationOption = {},\n asyncMsgObj = {},\n onChange = () => {},\n onBlur = null,\n onFocus = null,\n onClick = null,\n validationCallback = null,\n}) => {\n const [err, setErr] = useState(false);\n const [msg, setMsg] = useState('');\n const [successMsg, setSuccessMsg] = useState('');\n const [internalValue, setInternalValue] = useState(String(value));\n const prevInternalValue = usePrevious(internalValue);\n const option = getDefaultValidationOption(validationOption);\n const asyncObj = getDefaultAsyncObj(asyncMsgObj);\n const $input = useRef(null);\n const $el: { [key: string]: any } | null = $input;\n const handleOnBlur = useCallback(\n (e: React.FocusEvent) => {\n if (onBlur) {\n check();\n onBlur(e);\n }\n },\n [internalValue, option],\n );\n const handleOnFocus = useCallback((e: React.FocusEvent) => {\n if (onFocus) {\n onFocus(e);\n }\n }, []);\n const handleOnClick = useCallback((e: React.MouseEvent) => {\n if (onClick) {\n onClick(e);\n }\n }, []);\n const handleOnChange = useCallback((val: string, e: React.ChangeEvent) => {\n if (disabled || $el === null) {\n return;\n }\n setInternalValue(val);\n onChange && onChange(val, e);\n }, []);\n const check = useCallback(\n () => {\n const { name, check, locale, required, msgOnSuccess } = option;\n if (!check) {\n return;\n }\n if (!message[locale] || !message[locale][TYPE]) {\n console.error(REACT_INPUTS_VALIDATION_CUSTOM_ERROR_MESSAGE_EXAMPLE);\n return;\n }\n if (required) {\n const msg = message[locale][TYPE];\n const nameText = name ? name : '';\n if (!isValidValue(optionList, internalValue)) {\n handleCheckEnd(true, msg.empty(nameText));\n return;\n }\n }\n if (msgOnSuccess) {\n setSuccessMsg(msgOnSuccess);\n }\n handleCheckEnd(false, msgOnSuccess);\n },\n [internalValue, option],\n );\n const handleCheckEnd = useCallback((err: boolean, message: string) => {\n let msg = message;\n const { msgOnError } = option;\n if (err && msgOnError) {\n msg = msgOnError;\n }\n setErr(err);\n setMsg(msg);\n validationCallback && validationCallback(err);\n }, []);\n useEffect(\n () => {\n if (validate) {\n check();\n }\n },\n [validate],\n );\n useEffect(\n () => {\n if (internalValue && isValidValue(optionList, internalValue)) {\n setErr(false);\n } else {\n setSuccessMsg('');\n }\n },\n [internalValue],\n );\n useEffect(\n () => {\n setInternalValue(String(value));\n },\n [value],\n );\n useEffect(\n () => {\n if (typeof prevInternalValue !== 'undefined' && prevInternalValue !== internalValue) {\n check();\n }\n },\n [prevInternalValue, internalValue],\n );\n useEffect(\n () => {\n if (asyncObj) {\n if (asyncObj.message) {\n if (asyncObj.showOnError) {\n handleCheckEnd(asyncObj.error, asyncObj.message);\n }\n if (!asyncObj.error && asyncObj.showOnSuccess) {\n setSuccessMsg(asyncObj.message);\n }\n }\n }\n },\n [asyncMsgObj],\n );\n const wrapperClass = `${WRAPPER_CLASS_IDENTITIFIER} ${classNameWrapper} ${err && reactInputsValidationCss['error']} ${successMsg !== '' && !err && reactInputsValidationCss['success']} ${\n reactInputsValidationCss[`${TYPE}__wrapper`]\n } ${disabled && reactInputsValidationCss['disabled']}`;\n const containerClass = `${classNameContainer} ${err && reactInputsValidationCss['error']} ${successMsg !== '' && !err && reactInputsValidationCss['success']} ${\n reactInputsValidationCss[`${TYPE}__container`]\n } ${disabled && reactInputsValidationCss['disabled']}`;\n const inputClass = `${classNameInput} ${err && reactInputsValidationCss['error']} ${successMsg !== '' && !err && reactInputsValidationCss['success']} ${\n reactInputsValidationCss[`${TYPE}__input`]\n } ${disabled && reactInputsValidationCss['disabled']}`;\n const labelClass = `${err && reactInputsValidationCss['error']} ${successMsg !== '' && !err && reactInputsValidationCss['success']} ${reactInputsValidationCss[`${TYPE}__label`]} ${disabled &&\n reactInputsValidationCss['disabled']}`;\n const optionListItemClass = `${reactInputsValidationCss['button']} ${OPTION_LIST_ITEM_IDENTITIFIER} ${classNameOptionListItem} ${err && reactInputsValidationCss['error']} ${successMsg !== '' &&\n !err &&\n reactInputsValidationCss['success']} ${reactInputsValidationCss[`${TYPE}__item`]} ${disabled && reactInputsValidationCss['disabled']}`;\n const errMsgClass = `${MSG_CLASS_IDENTITIFIER} ${reactInputsValidationCss['msg']} ${err && reactInputsValidationCss['error']}`;\n const successMsgClass = `${MSG_CLASS_IDENTITIFIER} ${reactInputsValidationCss['msg']} ${!err && reactInputsValidationCss['success']}`;\n let msgHtml;\n const { showMsg } = option;\n if (showMsg && err && msg) {\n msgHtml =
{msg}
;\n }\n if (showMsg && !err && successMsg !== '') {\n msgHtml =
{successMsg}
;\n }\n let optionHtml;\n if (optionList.length) {\n optionHtml = optionList.map((i, k) => {\n const checked = String(i.id) === String(internalValue) ? true : false;\n return (\n \n );\n });\n }\n return (\n
\n
\n {optionHtml}\n
\n {msgHtml}\n
\n );\n};\ninterface AttributesInput {\n id?: string;\n}\ninterface OptionProps {\n checked?: boolean;\n id?: string;\n optionListItemClass?: string;\n labelClass?: string;\n inputClass?: string;\n value?: string | number;\n disabled?: boolean;\n item?: OptionListItem;\n customStyleOptionListItem?: object;\n customStyleInput?: object;\n attributesInput: AttributesInput;\n onChange?: (res: string, e: React.ChangeEvent) => void;\n}\nexport const Option: React.FC = memo(\n ({\n checked = false,\n id = '',\n optionListItemClass = '',\n labelClass = '',\n inputClass = '',\n value = '',\n disabled = false,\n item = { id: '', name: '' },\n customStyleOptionListItem = {},\n customStyleInput = {},\n attributesInput = {},\n onChange = () => {},\n }) => {\n const handleOnChange = useCallback(e => {\n onChange(item.id, e);\n }, [item]);\n return (\n \n );\n },\n);\nexport default memo(component);\n"],"sourceRoot":""}