{"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/utils.ts","webpack://react-inputs-validation/./src/js/Inputs/validator.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","React","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","camelize","str","replace","match","index","toLowerCase","toUpperCase","utils","toCamelCase","capitalLize","substr","getRandomId","Math","random","toString","slice","getAlphanumeric","v","String","split","forEach","charCode","charCodeAt","getAlpha","getNumeric","arraysEqual","arr1","arr2","JSON","stringify","replaceSeparator","replacee","replacer","removeSeparatorRegEx","RegExp","isNumeric","isNaN","parseFloat","isFinite","validator","reg","err","test","number","Textbox","Textarea","Select","Checkbox","Radiobox","useState","useCallback","memo","TYPE","VALIDATE_OPTION_TYPE_LIST","VALIDATE_NUMBER_TYPE_LIST","obj","showOnError","showOnSuccess","attributesWrapper","attributesInput","label","disabled","validate","classNameInput","classNameWrapper","classNameContainer","customStyleInput","customStyleWrapper","customStyleContainer","validationOption","asyncMsgObj","onChange","e","onBlur","onFocus","onClick","onKeyUp","validationCallback","setErr","msg","setMsg","successMsg","setSuccessMsg","internalValue","setInternalValue","prevInternalValue","option","type","numberType","mantissa","decimalSeparator","check","regMsg","compare","required","showMsg","locale","msgOnError","msgOnSuccess","customFunc","shouldRenderMsgAsHtml","undefined","getDefaultValidationOption","asyncObj","$input","$el","handleOnBlur","handleOnFocus","handleOnClick","handleOnKeyUp","handleOnChange","maxLength","Number","hasDecimalSeparator","splitStr","shift","resArr","join","autoFormatNumber","indexOf","nameText","handleCheckEnd","customFuncResult","fromCustomFunc","msgHtml","wrapperClass","containerClass","inputClass","errMsgClass","successMsgClass","className","dangerouslySetInnerHTML","__html","style","id","htmlFor","useMemo","selectKeyList","startsWith","searchString","position","isValidValue","list","getItem","getIndex","globalVariableIsFocusing","globalVariableIsCorrected","globalVariableCurrentFocus","globalVariableTypingTimeout","Option","item","icon","customStyleOptionListItem","onMouseOver","onMouseMove","onMouseOut","handleOnMouseOver","handleOnMouseMove","handleOnMouseOut","src","showSearch","showArrow","keyword","optionList","classNameSelect","classNameOptionListItem","classNameOptionListWrapper","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","keyCode","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","selectOptionListWrapperClass","selectOptionListItemClass","dropdownIconClass","background","textAlign","padding","xmlns","width","height","viewBox","fill","selectorHtml","checked","labelHtml","classNameInputBox","customStyleInputBox","internalChecked","setInternalChecked","prevInternalChecked","boxClass","labelClass","defaultChecked","optionListItemClass","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,CAA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,GACZxL,SAAUuC,GACVnD,gBAAiBuM,EAAiBzQ,GAAKyQ,EAAiBzQ,GAAK,SAMnE,yBACE3B,IAAK0I,GACL0B,UAAWL,GACXQ,MAAOlE,EACPQ,QAASiC,GACTnC,OAAQiC,GACRhC,QAASiC,IACLjD,GAEJ,uBAAKwE,UAAWJ,GAAgBO,MAAOjE,GACpCgM,IAEFxI","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\",\"textbox__wrapper\":\"react-inputs-validation__textbox__wrapper\",\"disabled\":\"react-inputs-validation__disabled\",\"textbox__container\":\"react-inputs-validation__textbox__container\",\"textbox__input\":\"react-inputs-validation__textbox__input\",\"error\":\"react-inputs-validation__error\",\"success\":\"react-inputs-validation__success\",\"msg\":\"react-inputs-validation__msg\",\"textarea__wrapper\":\"react-inputs-validation__textarea__wrapper\",\"textarea__input\":\"react-inputs-validation__textarea__input\",\"radiobox__wrapper\":\"react-inputs-validation__radiobox__wrapper\",\"radiobox__container\":\"react-inputs-validation__radiobox__container\",\"radiobox__input\":\"react-inputs-validation__radiobox__input\",\"radiobox__label\":\"react-inputs-validation__radiobox__label\",\"checked\":\"react-inputs-validation__checked\",\"button\":\"react-inputs-validation__button\",\"radiobox__item\":\"react-inputs-validation__radiobox__item\",\"checkbox__wrapper\":\"react-inputs-validation__checkbox__wrapper\",\"checkbox__input\":\"react-inputs-validation__checkbox__input\",\"checkbox__container\":\"react-inputs-validation__checkbox__container\",\"checkbox__box\":\"react-inputs-validation__checkbox__box\",\"box\":\"react-inputs-validation__box\",\"select__wrapper\":\"react-inputs-validation__select__wrapper\",\"select__input\":\"react-inputs-validation__select__input\",\"select__container\":\"react-inputs-validation__select__container\",\"select__button\":\"react-inputs-validation__select__button\",\"select__options-item\":\"react-inputs-validation__select__options-item\",\"select__options-item-show-cursor\":\"react-inputs-validation__select__options-item-show-cursor\",\"select__searchInputWrapper\":\"react-inputs-validation__select__searchInputWrapper\",\"select__searchInputSearchIcon\":\"react-inputs-validation__select__searchInputSearchIcon\",\"select__searchInputRemoveIcon\":\"react-inputs-validation__select__searchInputRemoveIcon\",\"select__searchInput\":\"react-inputs-validation__select__searchInput\",\"select__no-mouse\":\"react-inputs-validation__select__no-mouse\",\"select__hover-active\":\"react-inputs-validation__select__hover-active\",\"active\":\"react-inputs-validation__active\",\"select__options-wrapper-animate\":\"react-inputs-validation__select__options-wrapper-animate\",\"show\":\"react-inputs-validation__show\",\"select__options-wrapper\":\"react-inputs-validation__select__options-wrapper\",\"select__optionItem_current_display_icon\":\"react-inputs-validation__select__optionItem_current_display_icon\",\"select__optionItem_current_display_name\":\"react-inputs-validation__select__optionItem_current_display_name\",\"select__optionItem_icon\":\"react-inputs-validation__select__optionItem_icon\",\"select__optionItem_name\":\"react-inputs-validation__select__optionItem_name\",\"select__dropdown\":\"react-inputs-validation__select__dropdown\",\"select__dropdown-icon\":\"react-inputs-validation__select__dropdown-icon\",\"select__dropdown-name\":\"react-inputs-validation__select__dropdown-name\",\"showArrow\":\"react-inputs-validation__showArrow\",\"select__dropdown-icon-container\":\"react-inputs-validation__select__dropdown-icon-container\"};","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 =\n (str: string) =>\n (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().toString(36).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 arraysEqual = (arr1: any, arr2: any) => {\n if (arr1.length !== arr2.length) return false;\n for (let i = arr1.length; (i -= 1); ) {\n if (JSON.stringify(arr1[i]) !== JSON.stringify(arr2[i])) return false;\n }\n return true;\n};\n\nconst replaceSeparator = (value: string, replacee: string, replacer: string) => {\n const expression = `\\\\${replacee}`;\n const removeSeparatorRegEx = new RegExp(expression, 'g');\n return value.replace(removeSeparatorRegEx, replacer);\n};\n\nconst utils: Utils = {\n camelize,\n toCamelCase,\n getRandomId,\n getAlphanumeric,\n getAlpha,\n getNumeric,\n arraysEqual,\n replaceSeparator,\n};\nexport default utils;\n","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","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 decimalSeparator?: string;\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 shouldRenderMsgAsHtml?: boolean;\n}\nconst getDefaultValidationOption = (obj: DefaultValidationOption) => {\n let { reg, min, max, type, numberType, mantissa, decimalSeparator, name, check, length, regMsg, compare, required, showMsg, locale, msgOnError, msgOnSuccess, customFunc, shouldRenderMsgAsHtml } =\n 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 decimalSeparator = typeof decimalSeparator !== 'undefined' ? decimalSeparator : '.';\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 shouldRenderMsgAsHtml = typeof shouldRenderMsgAsHtml !== 'undefined' ? shouldRenderMsgAsHtml : false;\n return {\n reg,\n min,\n max,\n type,\n numberType,\n mantissa,\n decimalSeparator,\n name,\n check,\n length,\n regMsg,\n locale,\n compare,\n required,\n showMsg,\n msgOnError,\n msgOnSuccess,\n customFunc,\n shouldRenderMsgAsHtml,\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 id?: string;\n name?: string;\n type?: string;\n placeholder?: string;\n maxLength?: number;\n}\ninterface Props {\n attributesWrapper?: React.HTMLAttributes;\n attributesInput?: AttributesInputObj;\n value?: string;\n label?: string;\n disabled?: boolean;\n validate?: boolean;\n classNameInput?: string;\n classNameWrapper?: string;\n classNameContainer?: string;\n customStyleInput?: React.CSSProperties;\n customStyleWrapper?: React.CSSProperties;\n customStyleContainer?: React.CSSProperties;\n validationOption?: DefaultValidationOption;\n asyncMsgObj?: {\n error?: boolean;\n message?: string;\n showOnError?: boolean;\n showOnSuccess?: boolean;\n };\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, decimalSeparator: string) => {\n const DEFAULT_DECIMAL = '.';\n const ZERO = '0';\n let res = '';\n let hasDecimalSeparator = false;\n const splitStr = utils.replaceSeparator(String(v), decimalSeparator, DEFAULT_DECIMAL).split('');\n // const startedWithZero = splitStr[0] === ZERO;\n if (numberType === VALIDATE_NUMBER_TYPE_LIST[2] && splitStr[0] === ZERO && splitStr[1] === ZERO) {\n splitStr.shift();\n }\n splitStr.forEach((i: string) => {\n const charCode = i.toLowerCase().charCodeAt(0);\n if ((charCode >= 48 && charCode <= 57) || (i === DEFAULT_DECIMAL && !hasDecimalSeparator)) {\n if (charCode === 46) {\n if (numberType === VALIDATE_NUMBER_TYPE_LIST[1]) {\n return;\n }\n hasDecimalSeparator = true;\n }\n res += i;\n }\n });\n if (hasDecimalSeparator && mantissa >= 0) {\n const resArr = res.split(DEFAULT_DECIMAL);\n if (mantissa === 0) {\n res = resArr[0];\n } else {\n resArr[1] = resArr[1].slice(0, mantissa);\n res = resArr.join(DEFAULT_DECIMAL);\n }\n }\n if (numberType === VALIDATE_NUMBER_TYPE_LIST[0] || numberType === VALIDATE_NUMBER_TYPE_LIST[2]) {\n if (res.length && res[0] === DEFAULT_DECIMAL) {\n res = `${ZERO}${res}`;\n }\n }\n // if (numberType === VALIDATE_NUMBER_TYPE_LIST[2]) {\n // if (startedWithZero) {\n // if (hasDecimalSeparator) {\n // const resArr = res.split(DECIMAL_SEPARATOR);\n // res = `${Number(resArr[0])}${DECIMAL_SEPARATOR}${resArr[1]}`;\n // }\n // }\n // }\n return utils.replaceSeparator(res, DEFAULT_DECIMAL, decimalSeparator);\n};\nconst component: React.FC = ({\n attributesWrapper = {},\n attributesInput = {},\n value = '',\n label = '',\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, decimalSeparator } = 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, decimalSeparator));\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(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 if (!($input && $input.current)) {\n return;\n }\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 }, [internalValue, option]);\n const handleCheckEnd = useCallback(\n (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 [option.msgOnError],\n );\n useEffect(() => {\n if (validate) {\n check();\n }\n }, [validate]);\n useEffect(() => {\n setInternalValue(String(value));\n }, [value]);\n useEffect(() => {\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 }, [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 const wrapperClass = `${classNameWrapper} ${reactInputsValidationCss[`${TYPE}__wrapper`]} ${err && reactInputsValidationCss['error']} ${\n successMsg !== '' && !err && reactInputsValidationCss['success']\n } ${disabled && reactInputsValidationCss['disabled']}`;\n const containerClass = `${classNameContainer} ${reactInputsValidationCss[`${TYPE}__container`]} ${err && reactInputsValidationCss['error']} ${\n successMsg !== '' && !err && reactInputsValidationCss['success']\n } ${disabled && reactInputsValidationCss['disabled']}`;\n const inputClass = `${classNameInput} ${reactInputsValidationCss[`${TYPE}__input`]} ${err && reactInputsValidationCss['error']} ${successMsg !== '' && !err && reactInputsValidationCss['success']} ${\n disabled && reactInputsValidationCss['disabled']\n }`;\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, shouldRenderMsgAsHtml } = option;\n if (showMsg && err && msg) {\n msgHtml = shouldRenderMsgAsHtml ?
:
{msg}
;\n }\n if (showMsg && !err && successMsg !== '') {\n msgHtml = shouldRenderMsgAsHtml ?
:
{successMsg}
;\n }\n return (\n
\n
\n \n {label && attributesInput.id && }\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 shouldRenderMsgAsHtml?: boolean;\n}\nconst getDefaultValidationOption = (obj: DefaultValidationOption) => {\n let { reg, min, max, type, name, check, length, regMsg, required, showMsg, locale, msgOnError, msgOnSuccess, customFunc, shouldRenderMsgAsHtml } = 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 shouldRenderMsgAsHtml = typeof shouldRenderMsgAsHtml !== 'undefined' ? shouldRenderMsgAsHtml : false;\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 shouldRenderMsgAsHtml,\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 id?: string;\n name?: string;\n type?: string;\n placeholder?: string;\n maxLength?: number;\n}\ninterface Props {\n attributesWrapper?: React.HTMLAttributes;\n attributesInput?: AttributesInputObj;\n value?: string;\n disabled?: boolean;\n validate?: boolean;\n classNameInput?: string;\n classNameWrapper?: string;\n classNameContainer?: string;\n customStyleInput?: React.CSSProperties;\n customStyleWrapper?: React.CSSProperties;\n customStyleContainer?: React.CSSProperties;\n validationOption?: DefaultValidationOption;\n asyncMsgObj?: DefaultAsyncMsgObj;\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(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 }, [internalValue, option]);\n const handleCheckEnd = useCallback(\n (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 [option.msgOnError],\n );\n useEffect(() => {\n if (validate) {\n check();\n }\n }, [validate]);\n useEffect(() => {\n setInternalValue(String(value));\n }, [value]);\n useEffect(() => {\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 }, [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 const wrapperClass = `${classNameWrapper} ${reactInputsValidationCss[`${TYPE}__wrapper`]} ${err && reactInputsValidationCss['error']} ${\n successMsg !== '' && !err && reactInputsValidationCss['success']\n } ${disabled && reactInputsValidationCss['disabled']}`;\n const containerClass = `${classNameContainer} ${reactInputsValidationCss[`${TYPE}__container`]} ${err && reactInputsValidationCss['error']} ${\n successMsg !== '' && !err && reactInputsValidationCss['success']\n } ${disabled && reactInputsValidationCss['disabled']}`;\n const inputClass = `${classNameInput} ${reactInputsValidationCss[`${TYPE}__input`]} ${err && reactInputsValidationCss['error']} ${successMsg !== '' && !err && reactInputsValidationCss['success']} ${\n disabled && reactInputsValidationCss['disabled']\n }`;\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, shouldRenderMsgAsHtml } = option;\n if (showMsg && err && msg) {\n msgHtml = shouldRenderMsgAsHtml ?
:
{msg}
;\n }\n if (showMsg && !err && successMsg !== '') {\n msgHtml = shouldRenderMsgAsHtml ?
:
{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 shouldRenderMsgAsHtml?: boolean;\n}\nconst getDefaultValidationOption = (obj: DefaultValidationOption) => {\n let { name, check, required, showMsg, locale, msgOnError, msgOnSuccess, shouldRenderMsgAsHtml } = 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 shouldRenderMsgAsHtml = typeof shouldRenderMsgAsHtml !== 'undefined' ? shouldRenderMsgAsHtml : false;\n return {\n name,\n check,\n showMsg,\n required,\n locale,\n msgOnError,\n msgOnSuccess,\n shouldRenderMsgAsHtml,\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 icon?: string;\n}\ninterface Props {\n attributesWrapper?: React.HTMLAttributes;\n attributesInput?: {\n id?: string;\n name?: string;\n type?: string;\n placeholder?: string;\n maxLength?: number;\n };\n value?: string | number;\n disabled?: boolean;\n validate?: boolean;\n showSearch?: boolean;\n showArrow?: boolean;\n keyword?: string;\n optionList: OptionListItem[];\n onChange: (res: { [key: string]: any }, 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?: DefaultValidationOption;\n asyncMsgObj?: {\n error?: boolean;\n message?: string;\n showOnError?: boolean;\n showOnSuccess?: boolean;\n };\n classNameWrapper?: string;\n classNameContainer?: string;\n classNameSelect?: string;\n classNameOptionListWrapper?: string;\n classNameOptionListContainer?: string;\n classNameDropdownIconOptionListItem?: string;\n classNameOptionListItem?: string;\n customStyleWrapper?: React.CSSProperties;\n customStyleContainer?: React.CSSProperties;\n customStyleSelect?: React.CSSProperties;\n customStyleOptionListContainer?: React.CSSProperties;\n customStyleDropdownIcon?: React.CSSProperties;\n customStyleOptionListItem?: React.CSSProperties;\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 showArrow = true,\n keyword = '',\n optionList = [],\n classNameWrapper = '',\n classNameContainer = '',\n classNameSelect = '',\n classNameOptionListItem = '',\n classNameOptionListWrapper = '',\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(\n (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 [option.msgOnError],\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 && $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 && !utils.arraysEqual(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']} ${\n successMsg !== '' && !err && reactInputsValidationCss['success']\n } ${disabled && reactInputsValidationCss['disabled']}`;\n const containerClass = `${CONTAINER_CLASS_IDENTITIFIER} ${classNameContainer} ${reactInputsValidationCss[`${TYPE}__container`]} ${err && reactInputsValidationCss['error']} ${\n show && reactInputsValidationCss['show']\n } ${successMsg !== '' && !err && reactInputsValidationCss['success']} ${disabled && reactInputsValidationCss['disabled']}`;\n const inputClass = `${reactInputsValidationCss[`${TYPE}__input`]} ${err && reactInputsValidationCss['error']} ${successMsg !== '' && !err && reactInputsValidationCss['success']} ${\n disabled && reactInputsValidationCss['disabled']\n }`;\n const selectClass = `${classNameSelect} ${reactInputsValidationCss['ellipsis']} ${err && reactInputsValidationCss['error']} ${successMsg !== '' && !err && reactInputsValidationCss['success']} ${\n disabled && reactInputsValidationCss['disabled']\n }`;\n const selectOptionListWrapperClass = `${classNameOptionListWrapper} ${reactInputsValidationCss[`${TYPE}__options-wrapper`]} ${err && reactInputsValidationCss['error']} ${\n show && reactInputsValidationCss['show']\n } ${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`]} ${showArrow && reactInputsValidationCss['showArrow']}`;\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, shouldRenderMsgAsHtml } = option;\n if (showMsg && err && msg) {\n msgHtml = shouldRenderMsgAsHtml ?
:
{msg}
;\n }\n if (showMsg && !err && successMsg !== '') {\n msgHtml = shouldRenderMsgAsHtml ?
:
{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
\n {item ? (\n \n {item.icon && }\n {item.name}\n \n ) : (\n ''\n )}\n
\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?: React.CSSProperties;\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 ({\n index = -1,\n id = '',\n className = '',\n item = { id: '', name: '', icon: '' },\n customStyleOptionListItem = {},\n onClick = () => {},\n onMouseOver = () => {},\n onMouseMove = () => {},\n onMouseOut = () => {},\n }) => {\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.icon && }\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 shouldRenderMsgAsHtml?: boolean;\n}\nconst getDefaultValidationOption = (obj: DefaultValidationOption) => {\n let { name, check, required, showMsg, locale, msgOnError, msgOnSuccess, shouldRenderMsgAsHtml } = 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 shouldRenderMsgAsHtml = typeof shouldRenderMsgAsHtml !== 'undefined' ? shouldRenderMsgAsHtml : false;\n return {\n name,\n check,\n showMsg,\n required,\n locale,\n msgOnError,\n msgOnSuccess,\n shouldRenderMsgAsHtml,\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?: React.HTMLAttributes;\n attributesInput?: {\n id?: string;\n name?: string;\n };\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?: DefaultValidationOption;\n asyncMsgObj?: DefaultAsyncMsgObj;\n classNameInput?: string;\n classNameWrapper?: string;\n classNameInputBox?: string;\n classNameContainer?: string;\n customStyleInput?: React.CSSProperties;\n customStyleWrapper?: React.CSSProperties;\n customStyleContainer?: React.CSSProperties;\n customStyleInputBox?: React.CSSProperties;\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, disabled],\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, disabled],\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 (!internalChecked) {\n handleCheckEnd(true, msg.unchecked(nameText));\n return;\n }\n }\n if (msgOnSuccess) {\n setSuccessMsg(msgOnSuccess);\n }\n handleCheckEnd(false, msgOnSuccess);\n }, [internalChecked, option]);\n const handleCheckEnd = useCallback(\n (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 [option.msgOnError],\n );\n useEffect(() => {\n if (validate) {\n check();\n }\n }, [validate, internalChecked]);\n useEffect(() => {\n setInternalChecked(checked);\n }, [checked]);\n useEffect(() => {\n if (typeof prevInternalChecked !== 'undefined' && prevInternalChecked !== internalChecked) {\n check();\n }\n }, [prevInternalChecked, internalChecked]);\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 const wrapperClass = `${reactInputsValidationCss['button']} ${WRAPPER_CLASS_IDENTITIFIER} ${classNameWrapper} ${reactInputsValidationCss[`${TYPE}__wrapper`]} ${\n internalChecked && reactInputsValidationCss['checked']\n } ${err && reactInputsValidationCss['error']} ${successMsg !== '' && !err && reactInputsValidationCss['success']} ${disabled && reactInputsValidationCss['disabled']}`;\n const containerClass = `${classNameContainer} ${reactInputsValidationCss[`${TYPE}__container`]} ${internalChecked && reactInputsValidationCss['checked']} ${\n err && reactInputsValidationCss['error']\n } ${successMsg !== '' && !err && reactInputsValidationCss['success']} ${disabled && reactInputsValidationCss['disabled']}`;\n const boxClass = `${classNameInputBox} ${reactInputsValidationCss[`${TYPE}__box`]} ${err && reactInputsValidationCss['error']} ${internalChecked && reactInputsValidationCss['checked']} ${\n successMsg !== '' && !err && reactInputsValidationCss['success']\n } ${disabled && reactInputsValidationCss['disabled']}`;\n const labelClass = `${internalChecked && reactInputsValidationCss['checked']} ${err && reactInputsValidationCss['error']} ${successMsg !== '' && !err && reactInputsValidationCss['success']} ${\n disabled && reactInputsValidationCss['disabled']\n }`;\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, shouldRenderMsgAsHtml } = option;\n if (showMsg && err && msg) {\n msgHtml = shouldRenderMsgAsHtml ?
:
{msg}
;\n }\n if (showMsg && !err && successMsg !== '') {\n msgHtml = shouldRenderMsgAsHtml ?
:
{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 {\n REACT_INPUTS_VALIDATION_CUSTOM_ERROR_MESSAGE_EXAMPLE,\n DEFAULT_LOCALE,\n WRAPPER_CLASS_IDENTITIFIER,\n OPTION_LIST_ITEM_IDENTITIFIER,\n MSG_CLASS_IDENTITIFIER,\n usePrevious,\n} 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 shouldRenderMsgAsHtml?: boolean;\n}\nconst getDefaultValidationOption = (obj: DefaultValidationOption) => {\n let {\n name,\n check,\n required,\n showMsg,\n locale,\n msgOnError,\n msgOnSuccess,\n shouldRenderMsgAsHtml,\n } = 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 shouldRenderMsgAsHtml = typeof shouldRenderMsgAsHtml !== 'undefined' ? shouldRenderMsgAsHtml : false;\n return {\n name,\n check,\n showMsg,\n required,\n locale,\n msgOnError,\n msgOnSuccess,\n shouldRenderMsgAsHtml,\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 {\n id?: string;\n name?: string;\n}\ninterface Props {\n attributesWrapper: React.HTMLAttributes;\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?: DefaultValidationOption;\n asyncMsgObj?: DefaultAsyncMsgObj;\n classNameWrapper?: string;\n classNameInput?: string;\n classNameContainer?: string;\n classNameOptionListItem?: string;\n customStyleWrapper?: React.CSSProperties;\n customStyleContainer?: React.CSSProperties;\n customStyleInput?: React.CSSProperties;\n customStyleOptionListItem?: React.CSSProperties;\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 && !disabled) {\n check();\n onBlur(e);\n }\n },\n [internalValue, option, disabled]\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(\n (val: string, e: React.ChangeEvent) => {\n if (disabled || $el === null) {\n return;\n }\n setInternalValue(val);\n onChange && onChange(val, e);\n },\n [disabled]\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)) {\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(\n (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 [option.msgOnError]\n );\n useEffect(() => {\n if (validate) {\n check();\n }\n }, [validate]);\n useEffect(() => {\n if (internalValue && isValidValue(optionList, internalValue)) {\n setErr(false);\n } else {\n setSuccessMsg(\"\");\n }\n }, [internalValue]);\n useEffect(() => {\n setInternalValue(String(value));\n }, [value]);\n useEffect(() => {\n if (\n typeof prevInternalValue !== \"undefined\" &&\n prevInternalValue !== internalValue\n ) {\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 const wrapperClass = `${WRAPPER_CLASS_IDENTITIFIER} ${classNameWrapper} ${\n err && reactInputsValidationCss[\"error\"]\n } ${successMsg !== \"\" && !err && reactInputsValidationCss[\"success\"]} ${\n reactInputsValidationCss[`${TYPE}__wrapper`]\n } ${disabled && reactInputsValidationCss[\"disabled\"]}`;\n const containerClass = `${classNameContainer} ${\n err && reactInputsValidationCss[\"error\"]\n } ${successMsg !== \"\" && !err && reactInputsValidationCss[\"success\"]} ${\n reactInputsValidationCss[`${TYPE}__container`]\n } ${disabled && reactInputsValidationCss[\"disabled\"]}`;\n const inputClass = `${classNameInput} ${\n err && reactInputsValidationCss[\"error\"]\n } ${successMsg !== \"\" && !err && reactInputsValidationCss[\"success\"]} ${\n reactInputsValidationCss[`${TYPE}__input`]\n } ${disabled && reactInputsValidationCss[\"disabled\"]}`;\n const labelClass = `${err && reactInputsValidationCss[\"error\"]} ${\n successMsg !== \"\" && !err && reactInputsValidationCss[\"success\"]\n } ${reactInputsValidationCss[`${TYPE}__label`]} ${\n disabled && reactInputsValidationCss[\"disabled\"]\n }`;\n const optionListItemClass = `${\n reactInputsValidationCss[\"button\"]\n } ${OPTION_LIST_ITEM_IDENTITIFIER} ${classNameOptionListItem} ${\n err && reactInputsValidationCss[\"error\"]\n } ${successMsg !== \"\" && !err && reactInputsValidationCss[\"success\"]} ${\n reactInputsValidationCss[`${TYPE}__item`]\n } ${disabled && reactInputsValidationCss[\"disabled\"]}`;\n const errMsgClass = `${MSG_CLASS_IDENTITIFIER} ${\n reactInputsValidationCss[\"msg\"]\n } ${err && reactInputsValidationCss[\"error\"]}`;\n const successMsgClass = `${MSG_CLASS_IDENTITIFIER} ${\n reactInputsValidationCss[\"msg\"]\n } ${!err && reactInputsValidationCss[\"success\"]}`;\n let msgHtml;\n const { showMsg, shouldRenderMsgAsHtml } = option;\n if (showMsg && err && msg) {\n msgHtml = shouldRenderMsgAsHtml ?
:
{msg}
;\n }\n if (showMsg && !err && successMsg !== '') {\n msgHtml = shouldRenderMsgAsHtml ?
:
{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 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(\n (e) => {\n onChange(item.id, e);\n },\n [item, disabled]\n );\n return (\n \n \n \n {item.name}\n \n \n );\n }\n);\nexport default memo(component);\n"],"sourceRoot":""}