????

Your IP : 216.73.216.152


Current Path : C:/inetpub/vhost/xaydung.gdtsolutions.vn/build/static/js/
Upload File :
Current File : C:/inetpub/vhost/xaydung.gdtsolutions.vn/build/static/js/639.35165e56.chunk.js.map

{"version":3,"file":"static/js/639.35165e56.chunk.js","mappings":"6KAAO,SAASA,IAAS,CAGlB,SAASC,EAAaC,GACzB,SAAUA,GAAQ,IAAIC,MAAM,KAChC,CAEO,SAASC,EAAaC,GACzB,OAAOA,EAAIC,QAAQ,wBAAyB,OAChD,CAsBO,SAASC,EAAaC,GAA+B,IAAvBC,IAAaC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,KAAAA,UAAA,GAC9C,MAAMG,EAA4B,MAAdL,EAAO,GACrBM,EAAcD,GAAeJ,EAG7BM,GAFNP,EAASA,EAAOF,QAAQ,IAAK,KAERU,MAAM,KAI3B,MAAO,CACHC,cAJkBF,EAAM,GAKxBG,aAJiBH,EAAM,IAAM,GAK7BF,cACAC,cAER,CAiBO,SAASK,EAAaX,EAAQY,EAAOC,GACxC,IAAIhB,EAAM,GACV,MAAMiB,EAASD,EAAoB,IAAM,GACzC,IAAK,IAAIE,EAAI,EAAGA,GAAKH,EAAQ,EAAGG,IAC5BlB,GAAOG,EAAOe,IAAMD,EAExB,OAAOjB,CACX,CAoCO,SAASmB,EAAiBC,EAAIC,GAIjC,GAAW,OAAPD,EAAa,CACb,GAAIA,EAAGE,gBAAiB,CACpB,MAAMC,EAAQH,EAAGE,kBAGjB,OAFAC,EAAMC,KAAK,YAAaH,GACxBE,EAAME,UACC,CACX,CAEA,OAAIL,EAAGM,gBAAwC,IAAtBN,EAAGM,gBACxBN,EAAGO,QACHP,EAAGQ,kBAAkBP,EAAUA,IACxB,IAIXD,EAAGO,SACI,EACX,CACJ,CA6BO,SAASE,EAAMC,EAAKC,EAAKC,GAC5B,OAAOC,KAAKF,IAAIE,KAAKD,IAAIF,EAAKC,GAAMC,EACxC,CAEO,SAASE,EAAwBd,GAEpC,OAAOa,KAAKD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IAE3CY,CACX,CCquB2BI,CAAKnI,KAAKF,MAAOhC,GAE9BsK,EAAaJ,OAAOK,OAAO,CAAC,EAAGT,EAAY,CAC7CtI,OACAZ,QACAS,SAAUa,KAAKb,SACfF,UAAWe,KAAKf,UAChBC,UAAWc,KAAKd,UAChBE,QAASY,KAAKZ,QACdC,OAAQW,KAAKX,SAGjB,GAAoB,SAAhBjB,EACA,OAAOoB,EAAcA,EAAWd,IAAU,MAAQ4J,EAAAA,EAAAA,KAAA,WAAUV,EAAYW,IAAK9I,EAAY+I,SAAE9J,IAG1F,GAAIG,EAAa,CAClB,MAAM4J,EAAc5J,EACpB,OACIyJ,EAAAA,EAAAA,KAACG,EAAW,IAAKL,EAAYG,IAAK9I,GAE1C,CAEA,OACI6I,EAAAA,EAAAA,KAAA,YACQF,EACJG,IAAK9I,GAGjB,EAIJE,EAAaD,aAAeA,EAE5B,UCz2BA,MAAMC,UAAqBC,EAAAA,UACvB+H,MAAAA,GACI,MAAM,KAAEe,EAAI,MAAEhK,EAAK,cAAEM,EAAa,kBAAEjB,EAAiB,iBAAEE,EAAgB,QAAE0K,EAAO,aAAExK,KAAiB2B,GAAUE,KAAKF,MAClH,OACIwI,EAAAA,EAAAA,KAAClD,EAAM,IACCtF,EACJ8I,MAAO,CAAEC,UAAW,SACpBnK,MAAOA,EACPX,kBAAmBA,GAAqB,IACxCE,iBAAkBA,GAAoB,IACtCE,aAAcA,GAAgB,EAC9Ba,cAAe8J,GAAU9J,EAAc,CAAE8J,SAAQJ,SACjDC,QAASA,EACT9J,YAAakK,EAAAA,GAIzB,EAGJpJ,EAAaD,aAAe,CACxBsJ,YAAa,cASjB,S","sources":["components/numberformat/utils.js","components/numberformat/number-format.js","components/numberformat/NumberFormat.js"],"sourcesContent":["export function noop() { }\nexport function returnTrue() { return true; }\n\nexport function charIsNumber(char) {\n    return !!(char || '').match(/\\d/);\n}\n\nexport function escapeRegExp(str) {\n    return str.replace(/[-[\\]/{}()*+?.\\\\^$|]/g, \"\\\\$&\");\n}\n\nexport function getThousandsGroupRegex(thousandsGroupStyle) {\n    switch (thousandsGroupStyle) {\n        case 'lakh':\n            return /(\\d+?)(?=(\\d\\d)+(\\d)(?!\\d))(\\.\\d+)?/g;\n        case 'wan':\n            return /(\\d)(?=(\\d{4})+(?!\\d))/g;\n        case 'thousand':\n        default:\n            return /(\\d)(?=(\\d{3})+(?!\\d))/g;\n    }\n}\n\nexport function applyThousandSeparator(str, thousandSeparator, thousandsGroupStyle) {\n    const thousandsGroupRegex = getThousandsGroupRegex(thousandsGroupStyle);\n    let index = str.search(/[1-9]/);\n    index = index === -1 ? str.length : index;\n    return str.substring(0, index) + str.substring(index, str.length).replace(thousandsGroupRegex, '$1' + thousandSeparator);\n}\n\n//spilt a float number into different parts beforeDecimal, afterDecimal, and negation\nexport function splitDecimal(numStr, allowNegative = true) {\n    const hasNagation = numStr[0] === '-';\n    const addNegation = hasNagation && allowNegative;\n    numStr = numStr.replace('-', '');\n\n    const parts = numStr.split('.');\n    const beforeDecimal = parts[0];\n    const afterDecimal = parts[1] || '';\n\n    return {\n        beforeDecimal,\n        afterDecimal,\n        hasNagation,\n        addNegation\n    }\n}\n\nexport function fixLeadingZero(numStr) {\n    if (!numStr) return numStr;\n    const isNegative = numStr[0] === '-';\n    if (isNegative) numStr = numStr.substring(1, numStr.length);\n    const parts = numStr.split('.');\n    const beforeDecimal = parts[0].replace(/^0+/, '') || '0';\n    const afterDecimal = parts[1] || '';\n\n    return `${isNegative ? '-' : ''}${beforeDecimal}${afterDecimal ? `.${afterDecimal}` : ''}`;\n}\n\n/**\n * limit decimal numbers to given scale\n * Not used .fixedTo because that will break with big numbers\n */\nexport function limitToScale(numStr, scale, fixedDecimalScale) {\n    let str = ''\n    const filler = fixedDecimalScale ? '0' : '';\n    for (let i = 0; i <= scale - 1; i++) {\n        str += numStr[i] || filler;\n    }\n    return str;\n}\n\n/**\n * This method is required to round prop value to given scale.\n * Not used .round or .fixedTo because that will break with big numbers\n */\nexport function roundToPrecision(numStr, scale, fixedDecimalScale) {\n    //if number is empty don't do anything return empty string\n    if (['', '-'].indexOf(numStr) !== -1) return numStr;\n\n    const shoudHaveDecimalSeparator = numStr.indexOf('.') !== -1 && scale;\n    const { beforeDecimal, afterDecimal, hasNagation } = splitDecimal(numStr);\n    const roundedDecimalParts = parseFloat(`0.${afterDecimal || '0'}`).toFixed(scale).split('.');\n    const intPart = beforeDecimal.split('').reverse().reduce((roundedStr, current, idx) => {\n        if (roundedStr.length > idx) {\n            return (Number(roundedStr[0]) + Number(current)).toString() + roundedStr.substring(1, roundedStr.length);\n        }\n        return current + roundedStr;\n    }, roundedDecimalParts[0]);\n\n    const decimalPart = limitToScale(roundedDecimalParts[1] || '', Math.min(scale, afterDecimal.length), fixedDecimalScale);\n    const negation = hasNagation ? '-' : '';\n    const decimalSeparator = shoudHaveDecimalSeparator ? '.' : '';\n    return `${negation}${intPart}${decimalSeparator}${decimalPart}`;\n}\n\n\nexport function omit(obj, keyMaps) {\n    const filteredObj = {};\n    Object.keys(obj).forEach((key) => {\n        if (!keyMaps[key]) filteredObj[key] = obj[key]\n    });\n    return filteredObj;\n}\n\n/** set the caret positon in an input field **/\nexport function setCaretPosition(el, caretPos) {\n    // ^ this is used to not only get \"focus\", but\n    // to make sure we don't have it everything -selected-\n    // (it causes an issue in chrome, and having it doesn't hurt any other browser)\n    if (el !== null) {\n        if (el.createTextRange) {\n            const range = el.createTextRange();\n            range.move('character', caretPos);\n            range.select();\n            return true;\n        }\n        // (el.selectionStart === 0 added for Firefox bug)\n        if (el.selectionStart || el.selectionStart === 0) {\n            el.focus();\n            el.setSelectionRange(caretPos, caretPos);\n            return true;\n        }\n\n        // fail city, fortunately this never happens (as far as I've tested) :)\n        el.focus();\n        return false;\n    }\n}\n\n/**\n  Given previous value and newValue it returns the index\n  start - end to which values have changed.\n  This function makes assumption about only consecutive\n  characters are changed which is correct assumption for caret input.\n*/\nexport function findChangedIndex(prevValue, newValue) {\n    let i = 0, j = 0;\n    const prevLength = prevValue.length;\n    const newLength = newValue.length;\n    while (prevValue[i] === newValue[i] && i < prevLength) i++;\n\n    //check what has been changed from last\n    while (\n        prevValue[prevLength - 1 - j] === newValue[newLength - 1 - j]\n        && newLength - j > i\n        && prevLength - j > i\n    ) {\n        j++;\n    }\n\n    return { start: i, end: prevLength - j };\n}\n\n/*\n  Returns a number whose value is limited to the given range\n*/\nexport function clamp(num, min, max) {\n    return Math.min(Math.max(num, min), max);\n}\n\nexport function getCurrentCaretPosition(el) {\n    /*Max of selectionStart and selectionEnd is taken for the patch of pixel and other mobile device caret bug*/\n    return Math.max(el.selectionStart, el.selectionEnd);\n}","import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport {\n    noop,\n    returnTrue,\n    charIsNumber,\n    escapeRegExp,\n    fixLeadingZero,\n    limitToScale,\n    roundToPrecision,\n    omit,\n    setCaretPosition,\n    splitDecimal,\n    findChangedIndex,\n    clamp,\n    applyThousandSeparator,\n    getCurrentCaretPosition,\n} from './utils';\n\nconst propTypes = {\n    thousandSeparator: PropTypes.oneOfType([PropTypes.string, PropTypes.oneOf([true])]),\n    decimalSeparator: PropTypes.string,\n    thousandsGroupStyle: PropTypes.oneOf(['thousand', 'lakh', 'wan']),\n    decimalScale: PropTypes.number,\n    fixedDecimalScale: PropTypes.bool,\n    displayType: PropTypes.oneOf(['input', 'text']),\n    prefix: PropTypes.string,\n    suffix: PropTypes.string,\n    format: PropTypes.oneOfType([\n        PropTypes.string,\n        PropTypes.func\n    ]),\n    removeFormatting: PropTypes.func,\n    mask: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),\n    value: PropTypes.oneOfType([\n        PropTypes.number,\n        PropTypes.string\n    ]),\n    defaultValue: PropTypes.oneOfType([\n        PropTypes.number,\n        PropTypes.string\n    ]),\n    isNumericString: PropTypes.bool,\n    customInput: PropTypes.elementType,\n    allowNegative: PropTypes.bool,\n    allowEmptyFormatting: PropTypes.bool,\n    allowLeadingZeros: PropTypes.bool,\n    onValueChange: PropTypes.func,\n    onKeyDown: PropTypes.func,\n    onMouseUp: PropTypes.func,\n    onChange: PropTypes.func,\n    onFocus: PropTypes.func,\n    onBlur: PropTypes.func,\n    type: PropTypes.oneOf(['text', 'tel', 'password']),\n    isAllowed: PropTypes.func,\n    renderText: PropTypes.func,\n    getInputRef: PropTypes.func\n};\n\nconst defaultProps = {\n    displayType: 'input',\n    decimalSeparator: '.',\n    thousandsGroupStyle: 'thousand',\n    fixedDecimalScale: false,\n    prefix: '',\n    suffix: '',\n    allowNegative: true,\n    allowEmptyFormatting: false,\n    allowLeadingZeros: false,\n    isNumericString: false,\n    type: 'text',\n    onValueChange: noop,\n    onChange: noop,\n    onKeyDown: noop,\n    onMouseUp: noop,\n    onFocus: noop,\n    onBlur: noop,\n    isAllowed: returnTrue,\n    getInputRef: noop,\n};\n\nclass NumberFormat extends React.Component {\n    constructor(props) {\n        super(props);\n\n        const { defaultValue } = props;\n\n        //validate props\n        this.validateProps();\n\n        const formattedValue = this.formatValueProp(defaultValue);\n\n        this.state = {\n            value: formattedValue,\n            numAsString: this.removeFormatting(formattedValue)\n        }\n\n        this.selectionBeforeInput = {\n            selectionStart: 0,\n            selectionEnd: 0\n        };\n\n        this.onChange = this.onChange.bind(this);\n        this.onKeyDown = this.onKeyDown.bind(this);\n        this.onMouseUp = this.onMouseUp.bind(this);\n        this.onFocus = this.onFocus.bind(this);\n        this.onBlur = this.onBlur.bind(this);\n    }\n\n    componentDidUpdate(prevProps) {\n        this.updateValueIfRequired(prevProps);\n    }\n\n    updateValueIfRequired(prevProps) {\n        const { props, state, focusedElm } = this;\n        const { value: stateValue, numAsString: lastNumStr = '' } = state;\n\n        if (prevProps !== props) {\n            //validate props\n            this.validateProps();\n\n            const lastValueWithNewFormat = this.formatNumString(lastNumStr);\n\n            const formattedValue = props.value === undefined ? lastValueWithNewFormat : this.formatValueProp();\n            const numAsString = this.removeFormatting(formattedValue);\n\n            const floatValue = parseFloat(numAsString);\n            const lastFloatValue = parseFloat(lastNumStr);\n\n            if (\n                //while typing set state only when float value changes\n                ((!isNaN(floatValue) || !isNaN(lastFloatValue)) && floatValue !== lastFloatValue) ||\n                //can also set state when float value is same and the format props changes\n                lastValueWithNewFormat !== stateValue ||\n                //set state always when not in focus and formatted value is changed\n                (focusedElm === null && formattedValue !== stateValue)\n            ) {\n                this.updateValue({ formattedValue, numAsString, input: focusedElm });\n            }\n        }\n    }\n\n    /** Misc methods **/\n    getFloatString(num = '') {\n        const { decimalScale } = this.props;\n        const { decimalSeparator } = this.getSeparators();\n        const numRegex = this.getNumberRegex(true);\n\n        //remove negation for regex check\n        const hasNegation = num[0] === '-';\n        if (hasNegation) num = num.replace('-', '');\n\n        //if decimal scale is zero remove decimal and number after decimalSeparator\n        if (decimalSeparator && decimalScale === 0) {\n            num = num.split(decimalSeparator)[0];\n        }\n\n        num = (num.match(numRegex) || []).join('').replace(decimalSeparator, '.');\n\n        //remove extra decimals\n        const firstDecimalIndex = num.indexOf('.');\n\n        if (firstDecimalIndex !== -1) {\n            num = `${num.substring(0, firstDecimalIndex)}.${num.substring(firstDecimalIndex + 1, num.length).replace(new RegExp(escapeRegExp(decimalSeparator), 'g'), '')}`\n        }\n\n        //add negation back\n        if (hasNegation) num = '-' + num;\n\n        return num;\n    }\n\n    //returned regex assumes decimalSeparator is as per prop\n    getNumberRegex(g, ignoreDecimalSeparator) {\n        const { format, decimalScale } = this.props;\n        const { decimalSeparator } = this.getSeparators();\n        return new RegExp('\\\\d' + (decimalSeparator && decimalScale !== 0 && !ignoreDecimalSeparator && !format ? '|' + escapeRegExp(decimalSeparator) : ''), g ? 'g' : undefined);\n    }\n\n    getSeparators() {\n        const { decimalSeparator } = this.props;\n        let { thousandSeparator } = this.props;\n\n        if (thousandSeparator === true) {\n            thousandSeparator = ','\n        }\n\n        return {\n            decimalSeparator,\n            thousandSeparator\n        }\n    }\n\n    getMaskAtIndex(index) {\n        const { mask = ' ' } = this.props;\n        if (typeof mask === 'string') {\n            return mask;\n        }\n\n        return mask[index] || ' ';\n    }\n\n    getValueObject(formattedValue, numAsString) {\n        const floatValue = parseFloat(numAsString);\n        return {\n            formattedValue,\n            value: numAsString,\n            floatValue: isNaN(floatValue) ? undefined : floatValue\n        };\n\n    }\n\n    validateProps() {\n        const { mask } = this.props;\n\n        //validate decimalSeparator and thousandSeparator\n        const { decimalSeparator, thousandSeparator } = this.getSeparators();\n\n        if (decimalSeparator === thousandSeparator) {\n            throw new Error(`\n          Decimal separator can't be same as thousand separator.\n          thousandSeparator: ${thousandSeparator} (thousandSeparator = {true} is same as thousandSeparator = \",\")\n          decimalSeparator: ${decimalSeparator} (default value for decimalSeparator is .)\n       `);\n        }\n\n        //validate mask\n        if (mask) {\n            const maskAsStr = mask === 'string' ? mask : mask.toString();\n            if (maskAsStr.match(/\\d/g)) {\n                throw new Error(`\n          Mask ${mask} should not contain numeric character;\n        `)\n            }\n        }\n\n    }\n    /** Misc methods end **/\n\n    /** caret specific methods **/\n    setPatchedCaretPosition(el, caretPos, currentValue) {\n        /* setting caret position within timeout of 0ms is required for mobile chrome,\n        otherwise browser resets the caret position after we set it\n        We are also setting it without timeout so that in normal browser we don't see the flickering */\n        setCaretPosition(el, caretPos);\n        setTimeout(() => {\n            if (el.value === currentValue) setCaretPosition(el, caretPos);\n        }, 0);\n    }\n\n    /* This keeps the caret within typing area so people can't type in between prefix or suffix */\n    correctCaretPosition(value, caretPos, direction) {\n        const { prefix, suffix, format } = this.props;\n\n        //if value is empty return 0\n        if (value === '') return 0;\n\n        //caret position should be between 0 and value length\n        caretPos = clamp(caretPos, 0, value.length);\n\n        //in case of format as number limit between prefix and suffix\n        if (!format) {\n            const hasNegation = value[0] === '-';\n            return clamp(caretPos, prefix.length + (hasNegation ? 1 : 0), value.length - suffix.length);\n        }\n\n        //in case if custom format method don't do anything\n        if (typeof format === 'function') return caretPos;\n\n        /* in case format is string find the closest # position from the caret position */\n\n        //in case the caretPos have input value on it don't do anything\n        if (format[caretPos] === '#' && charIsNumber(value[caretPos])) return caretPos;\n\n        //if caretPos is just after input value don't do anything\n        if (format[caretPos - 1] === '#' && charIsNumber(value[caretPos - 1])) return caretPos;\n\n        //find the nearest caret position\n        const firstHashPosition = format.indexOf('#');\n        const lastHashPosition = format.lastIndexOf('#');\n\n        //limit the cursor between the first # position and the last # position\n        caretPos = clamp(caretPos, firstHashPosition, lastHashPosition + 1);\n\n        const nextPos = format.substring(caretPos, format.length).indexOf('#');\n        let caretLeftBound = caretPos;\n        const caretRightBound = caretPos + (nextPos === -1 ? 0 : nextPos)\n\n        //get the position where the last number is present\n        while (caretLeftBound > firstHashPosition && (format[caretLeftBound] !== '#' || !charIsNumber(value[caretLeftBound]))) {\n            caretLeftBound -= 1;\n        }\n\n        const goToLeft = !charIsNumber(value[caretRightBound])\n            || (direction === 'left' && caretPos !== firstHashPosition)\n            || (caretPos - caretLeftBound < caretRightBound - caretPos);\n\n        if (goToLeft) {\n            //check if number should be taken after the bound or after it\n            //if number preceding a valid number keep it after\n            return charIsNumber(value[caretLeftBound]) ? caretLeftBound + 1 : caretLeftBound;\n        }\n\n        return caretRightBound;\n    }\n\n    getCaretPosition(inputValue, formattedValue, caretPos) {\n        const { format } = this.props;\n        const stateValue = this.state.value;\n        const numRegex = this.getNumberRegex(true);\n        const inputNumber = (inputValue.match(numRegex) || []).join('');\n        const formattedNumber = (formattedValue.match(numRegex) || []).join('');\n        let j, i;\n\n        j = 0;\n\n        for (i = 0; i < caretPos; i++) {\n            const currentInputChar = inputValue[i] || '';\n            const currentFormatChar = formattedValue[j] || '';\n            //no need to increase new cursor position if formatted value does not have those characters\n            //case inputValue = 1a23 and formattedValue =  123\n            if (!currentInputChar.match(numRegex) && currentInputChar !== currentFormatChar) continue;\n\n            //When we are striping out leading zeros maintain the new cursor position\n            //Case inputValue = 00023 and formattedValue = 23;\n            if (currentInputChar === '0' && currentFormatChar.match(numRegex) && currentFormatChar !== '0' && inputNumber.length !== formattedNumber.length) continue;\n\n            //we are not using currentFormatChar because j can change here\n            while (currentInputChar !== formattedValue[j] && j < formattedValue.length) j++;\n            j++;\n        }\n\n        if ((typeof format === 'string' && !stateValue)) {\n            //set it to the maximum value so it goes after the last number\n            j = formattedValue.length;\n        }\n\n        //correct caret position if its outside of editable area\n        j = this.correctCaretPosition(formattedValue, j);\n\n        return j;\n    }\n    /** caret specific methods ends **/\n\n\n    /** methods to remove formattting **/\n    removePrefixAndSuffix(val) {\n        const { format, prefix, suffix } = this.props;\n\n        //remove prefix and suffix\n        if (!format && val) {\n            const isNegative = val[0] === '-';\n\n            //remove negation sign\n            if (isNegative) val = val.substring(1, val.length);\n\n            //remove prefix\n            val = prefix && val.indexOf(prefix) === 0 ? val.substring(prefix.length, val.length) : val;\n\n            //remove suffix\n            const suffixLastIndex = val.lastIndexOf(suffix);\n            val = suffix && suffixLastIndex !== -1 && suffixLastIndex === val.length - suffix.length ? val.substring(0, suffixLastIndex) : val;\n\n            //add negation sign back\n            if (isNegative) val = '-' + val;\n        }\n\n        return val;\n    }\n\n    removePatternFormatting(val) {\n        const { format } = this.props;\n        const formatArray = format.split('#').filter(str => str !== '');\n        let start = 0;\n        let numStr = '';\n\n        for (let i = 0, ln = formatArray.length; i <= ln; i++) {\n            const part = formatArray[i] || '';\n\n            //if i is the last fragment take the index of end of the value\n            //For case like +1 (911) 911 91 91 having pattern +1 (###) ### ## ##\n            const index = i === ln ? val.length : val.indexOf(part, start);\n\n            /* in any case if we don't find the pattern part in the value assume the val as numeric string\n            This will be also in case if user has started typing, in any other case it will not be -1\n            unless wrong prop value is provided */\n            if (index === -1) {\n                numStr = val;\n                break;\n            } else {\n                numStr += val.substring(start, index);\n                start = index + part.length;\n            }\n        }\n\n        return (numStr.match(/\\d/g) || []).join('');\n    }\n\n    removeFormatting(val) {\n        const { format, removeFormatting } = this.props;\n        if (!val) return val;\n\n        if (!format) {\n            val = this.removePrefixAndSuffix(val);\n            val = this.getFloatString(val);\n        } else if (typeof format === 'string') {\n            val = this.removePatternFormatting(val);\n        } else if (typeof removeFormatting === 'function') { //condition need to be handled if format method is provide,\n            val = removeFormatting(val);\n        } else {\n            val = (val.match(/\\d/g) || []).join('')\n        }\n        return val;\n    }\n    /** methods to remove formattting end **/\n\n\n    /*** format specific methods start ***/\n    /**\n     * Format when # based string is provided\n     * @param  {string} numStr Numeric String\n     * @return {string}        formatted Value\n     */\n    formatWithPattern(numStr) {\n        const { format } = this.props;\n        let hashCount = 0;\n        const formattedNumberAry = format.split('');\n        for (let i = 0, ln = format.length; i < ln; i++) {\n            if (format[i] === '#') {\n                formattedNumberAry[i] = numStr[hashCount] || this.getMaskAtIndex(hashCount);\n                hashCount += 1;\n            }\n        }\n        return formattedNumberAry.join('');\n    }\n    /**\n     * @param  {string} numStr Numeric string/floatString] It always have decimalSeparator as .\n     * @return {string} formatted Value\n     */\n    formatAsNumber(numStr) {\n        const { decimalScale, fixedDecimalScale, prefix, suffix, allowNegative, thousandsGroupStyle } = this.props;\n        const { thousandSeparator, decimalSeparator } = this.getSeparators();\n        const hasDecimalSeparator = numStr.indexOf('.') !== -1 || (decimalScale && fixedDecimalScale);\n        let { beforeDecimal, afterDecimal, addNegation } = splitDecimal(numStr, allowNegative);\n        //apply decimal precision if its defined\n        if (decimalScale !== undefined) afterDecimal = limitToScale(afterDecimal, decimalScale, fixedDecimalScale);\n        if (thousandSeparator) {\n            beforeDecimal = applyThousandSeparator(beforeDecimal, thousandSeparator, thousandsGroupStyle);\n        }\n        //add prefix and suffix\n        if (prefix) beforeDecimal = prefix + beforeDecimal;\n        if (suffix) afterDecimal = afterDecimal + suffix;\n        //restore negation sign\n        if (addNegation) beforeDecimal = '-' + beforeDecimal;\n        numStr = beforeDecimal + ((hasDecimalSeparator && decimalSeparator) || '') + afterDecimal;\n        return numStr;\n    }\n\n    formatNumString(numStr = '') {\n        const { format, allowEmptyFormatting } = this.props;\n        let formattedValue = numStr;\n        if (numStr === '' && !allowEmptyFormatting) {\n            formattedValue = ''\n        } else if (numStr === '-' && !format) {\n            formattedValue = '-';\n        } else if (typeof format === 'string') {\n            formattedValue = this.formatWithPattern(formattedValue);\n        } else if (typeof format === 'function') {\n            formattedValue = format(formattedValue);\n        } else {\n            formattedValue = this.formatAsNumber(formattedValue)\n        }\n        return formattedValue;\n    }\n\n    formatValueProp(defaultValue) {\n        const { format, decimalScale, fixedDecimalScale, allowEmptyFormatting } = this.props;\n        let { value = defaultValue, isNumericString } = this.props;\n\n        const isNonNumericFalsy = !value && value !== 0;\n\n        if (isNonNumericFalsy && allowEmptyFormatting) {\n            value = '';\n        }\n\n        // if value is not defined return empty string\n        if (isNonNumericFalsy && !allowEmptyFormatting) return '';\n\n        if (typeof value === 'number') {\n            value = value.toString();\n            isNumericString = true;\n        }\n\n        //change infinity value to empty string\n        if (value === 'Infinity' && isNumericString) {\n            value = '';\n        }\n\n        //round the number based on decimalScale\n        //format only if non formatted value is provided\n        if (isNumericString && !format && typeof decimalScale === 'number') {\n            value = roundToPrecision(value, decimalScale, fixedDecimalScale)\n        }\n\n        const formattedValue = isNumericString ? this.formatNumString(value) : this.formatInput(value);\n\n        return formattedValue;\n    }\n\n    formatNegation(value = '') {\n        const { allowNegative } = this.props;\n        const negationRegex = new RegExp('(-)');\n        const doubleNegationRegex = new RegExp('(-)(.)*(-)');\n\n        // Check number has '-' value\n        const hasNegation = negationRegex.test(value);\n\n        // Check number has 2 or more '-' values\n        const removeNegation = doubleNegationRegex.test(value);\n\n        //remove negation\n        value = value.replace(/-/g, '');\n\n        if (hasNegation && !removeNegation && allowNegative) {\n            value = '-' + value;\n        }\n\n        return value;\n    }\n\n    formatInput(value = '') {\n        const { format } = this.props;\n\n        //format negation only if we are formatting as number\n        if (!format) {\n            value = this.removePrefixAndSuffix(value);\n            value = this.formatNegation(value);\n        }\n\n        //remove formatting from number\n        value = this.removeFormatting(value);\n\n        return this.formatNumString(value);\n    }\n\n    /*** format specific methods end ***/\n    isCharacterAFormat(caretPos, value) {\n        const { format, prefix, suffix, decimalScale, fixedDecimalScale } = this.props;\n        const { decimalSeparator } = this.getSeparators();\n\n        //check within format pattern\n        if (typeof format === 'string' && format[caretPos] !== '#') return true;\n\n        //check in number format\n        if (!format && (caretPos < prefix.length\n            || caretPos >= value.length - suffix.length\n            || (decimalScale && fixedDecimalScale && value[caretPos] === decimalSeparator))\n        ) {\n            return true;\n        }\n\n        return false;\n    }\n\n    checkIfFormatGotDeleted(start, end, value) {\n        for (let i = start; i < end; i++) {\n            if (this.isCharacterAFormat(i, value)) return true;\n        }\n        return false;\n    }\n\n    /**\n     * This will check if any formatting got removed by the delete or backspace and reset the value\n     * It will also work as fallback if android chome keyDown handler does not work\n     **/\n    correctInputValue(caretPos, lastValue, value) {\n        const { format, allowNegative, prefix, suffix } = this.props;\n        const { decimalSeparator } = this.getSeparators();\n        const lastNumStr = this.state.numAsString || '';\n        const { selectionStart, selectionEnd } = this.selectionBeforeInput;\n        const { start, end } = findChangedIndex(lastValue, value);\n\n        /** Check if only . is added in the numeric format and replace it with decimal separator */\n        if (!format && decimalSeparator !== '.' && start === end && value[selectionStart] === '.') {\n            return value.substr(0, selectionStart) + decimalSeparator + value.substr(selectionStart + 1, value.length);\n        }\n\n        /* don't do anyhting if something got added,\n         or if value is empty string (when whole input is cleared)\n         or whole input is replace with a number\n        */\n        const leftBound = !!format ? 0 : prefix.length;\n        const rightBound = lastValue.length - (!!format ? 0 : suffix.length);\n        if (\n            value.length > lastValue.length\n            || !value.length ||\n            start === end ||\n            (selectionStart === 0 && selectionEnd === lastValue.length) ||\n            (selectionStart === leftBound && selectionEnd === rightBound)\n        ) {\n            return value;\n        }\n\n        //if format got deleted reset the value to last value\n        if (this.checkIfFormatGotDeleted(start, end, lastValue)) {\n            value = lastValue;\n        }\n\n        //for numbers check if beforeDecimal got deleted and there is nothing after decimal,\n        //clear all numbers in such case while keeping the - sign\n        if (!format) {\n            const numericString = this.removeFormatting(value);\n            let { beforeDecimal, afterDecimal, addNegation } = splitDecimal(numericString, allowNegative);\n\n            //clear only if something got deleted\n            const isBeforeDecimalPoint = caretPos < value.indexOf(decimalSeparator) + 1;\n            if (numericString.length < lastNumStr.length && isBeforeDecimalPoint && beforeDecimal === '' && !parseFloat(afterDecimal)) {\n                return addNegation ? '-' : '';\n            }\n        }\n\n        return value;\n    }\n\n    /** Update value and caret position */\n    updateValue(params, onUpdate) {\n        const { formattedValue, input } = params;\n        let { numAsString, caretPos } = params;\n        const { onValueChange } = this.props;\n        const { value: lastValue } = this.state;\n\n        //set caret position, and value imperatively when element is provided\n        if (input) {\n\n            //calculate caret position if not defined\n            if (!caretPos) {\n                const inputValue = params.inputValue || input.value;\n\n                const currentCaretPosition = getCurrentCaretPosition(input);\n\n                //get the caret position\n                caretPos = this.getCaretPosition(inputValue, formattedValue, currentCaretPosition);\n            }\n\n            //set the value imperatively, this is required for IE fix\n            input.value = formattedValue;\n\n            //set caret position\n            this.setPatchedCaretPosition(input, caretPos, formattedValue);\n        }\n\n        //calculate numeric string if not passed\n        if (numAsString === undefined) {\n            numAsString = this.removeFormatting(formattedValue);\n        }\n\n        //update state if value is changed\n        if (formattedValue !== lastValue) {\n            this.setState({ value: formattedValue, numAsString }, () => {\n                onValueChange(this.getValueObject(formattedValue, numAsString));\n                // onUpdate();\n            });\n        } else {\n            // onUpdate();\n        }\n    }\n\n    onChange(e) {\n        e.persist();\n        const el = e.target;\n        let inputValue = el.value;\n        const { state, props } = this;\n        const { isAllowed } = props;\n        const lastValue = state.value || '';\n\n        const currentCaretPosition = getCurrentCaretPosition(el);\n\n        inputValue = this.correctInputValue(currentCaretPosition, lastValue, inputValue);\n\n        let formattedValue = this.formatInput(inputValue) || '';\n        const numAsString = this.removeFormatting(formattedValue);\n\n        const valueObj = this.getValueObject(formattedValue, numAsString);\n\n        if (!isAllowed(valueObj)) {\n            formattedValue = lastValue;\n        }\n\n        this.updateValue({ formattedValue, numAsString, inputValue, input: el }, () => {\n            props.onChange(e);\n        });\n\n    }\n\n    onBlur(e) {\n        const { props, state } = this;\n        const { format, onBlur, allowLeadingZeros } = props;\n        let { numAsString } = state;\n        const lastValue = state.value;\n\n        this.focusedElm = null;\n\n        if (!format) {\n            if (!allowLeadingZeros) {\n                numAsString = fixLeadingZero(numAsString);\n            }\n\n            const formattedValue = this.formatNumString(numAsString);\n\n            //change the state\n            if (formattedValue !== lastValue) {\n                // the event needs to be persisted because its properties can be accessed in an asynchronous way\n                e.persist();\n                this.updateValue({ formattedValue, numAsString }, () => {\n                    onBlur(e);\n                });\n                return;\n            }\n        }\n        onBlur(e);\n    }\n\n    onKeyDown(e) {\n        const el = e.target;\n        const { key } = e;\n        const { selectionStart, selectionEnd, value = '' } = el;\n        let expectedCaretPosition;\n        const { decimalScale, fixedDecimalScale, prefix, suffix, format, onKeyDown } = this.props;\n        const ignoreDecimalSeparator = decimalScale !== undefined && fixedDecimalScale;\n        const numRegex = this.getNumberRegex(false, ignoreDecimalSeparator);\n        const negativeRegex = new RegExp('-');\n        const isPatternFormat = typeof format === 'string';\n\n        this.selectionBeforeInput = {\n            selectionStart,\n            selectionEnd\n        }\n\n        //Handle backspace and delete against non numerical/decimal characters or arrow keys\n        if (key === 'ArrowLeft' || key === 'Backspace') {\n            expectedCaretPosition = selectionStart - 1;\n        } else if (key === 'ArrowRight') {\n            expectedCaretPosition = selectionStart + 1;\n        } else if (key === 'Delete') {\n            expectedCaretPosition = selectionStart;\n        }\n\n        //if expectedCaretPosition is not set it means we don't want to Handle keyDown\n        //also if multiple characters are selected don't handle\n        if (expectedCaretPosition === undefined || selectionStart !== selectionEnd) {\n            onKeyDown(e);\n            return;\n        }\n\n        let newCaretPosition = expectedCaretPosition;\n        const leftBound = isPatternFormat ? format.indexOf('#') : prefix.length;\n        const rightBound = isPatternFormat ? format.lastIndexOf('#') + 1 : value.length - suffix.length;\n\n        if (key === 'ArrowLeft' || key === 'ArrowRight') {\n            const direction = key === 'ArrowLeft' ? 'left' : 'right';\n            newCaretPosition = this.correctCaretPosition(value, expectedCaretPosition, direction);\n        } else if (key === 'Delete' && !numRegex.test(value[expectedCaretPosition]) && !negativeRegex.test(value[expectedCaretPosition])) {\n            while (!numRegex.test(value[newCaretPosition]) && newCaretPosition < rightBound) newCaretPosition++;\n        } else if (key === 'Backspace' && !numRegex.test(value[expectedCaretPosition])) {\n            /* NOTE: This is special case when backspace is pressed on a\n            negative value while the cursor position is after prefix. We can't handle it on onChange because\n            we will not have any information of keyPress\n            */\n            if (selectionStart <= leftBound + 1 && value[0] === '-' && typeof format === 'undefined') {\n                const newValue = value.substring(1);\n                //persist event before performing async task\n                e.persist();\n\n                this.updateValue({ formattedValue: newValue, caretPos: newCaretPosition, input: el });\n            } else if (!negativeRegex.test(value[expectedCaretPosition])) {\n                while (!numRegex.test(value[newCaretPosition - 1]) && newCaretPosition > leftBound) { newCaretPosition--; }\n                newCaretPosition = this.correctCaretPosition(value, newCaretPosition, 'left');\n            }\n        }\n\n\n        if (newCaretPosition !== expectedCaretPosition || expectedCaretPosition < leftBound || expectedCaretPosition > rightBound) {\n            e.preventDefault();\n            this.setPatchedCaretPosition(el, newCaretPosition, value);\n        }\n\n        /* NOTE: this is just required for unit test as we need to get the newCaretPosition,\n                Remove this when you find different solution */\n        if (e.isUnitTestRun) {\n            this.setPatchedCaretPosition(el, newCaretPosition, value);\n        }\n\n\n        this.props.onKeyDown(e);\n\n    }\n\n    /** required to handle the caret position when click anywhere within the input **/\n    onMouseUp(e) {\n        const el = e.target;\n\n        /**\n         * NOTE: we have to give default value for value as in case when custom input is provided\n         * value can come as undefined when nothing is provided on value prop.\n        */\n        const { selectionStart, selectionEnd, value = '' } = el;\n\n        if (selectionStart === selectionEnd) {\n            const caretPosition = this.correctCaretPosition(value, selectionStart);\n            if (caretPosition !== selectionStart) {\n                this.setPatchedCaretPosition(el, caretPosition, value);\n            }\n        }\n\n        this.props.onMouseUp(e);\n    }\n\n    onFocus(e) {\n        // Workaround Chrome and Safari bug https://bugs.chromium.org/p/chromium/issues/detail?id=779328\n        // (onFocus event target selectionStart is always 0 before setTimeout)\n        e.persist();\n\n        this.focusedElm = e.target;\n\n        setTimeout(() => {\n            const el = e.target;\n            const { selectionStart, selectionEnd, value = '' } = el;\n\n            const caretPosition = this.correctCaretPosition(value, selectionStart);\n\n            //setPatchedCaretPosition only when everything is not selected on focus (while tabbing into the field)\n            if (caretPosition !== selectionStart && !(selectionStart === 0 && selectionEnd === value.length)) {\n                this.setPatchedCaretPosition(el, caretPosition, value);\n            }\n\n            this.props.onFocus(e);\n        }, 0);\n    }\n\n    render() {\n        const { type, displayType, customInput, renderText, getInputRef } = this.props;\n        const { value } = this.state;\n\n        const otherProps = omit(this.props, propTypes);\n\n        const inputProps = Object.assign({}, otherProps, {\n            type,\n            value,\n            onChange: this.onChange,\n            onKeyDown: this.onKeyDown,\n            onMouseUp: this.onMouseUp,\n            onFocus: this.onFocus,\n            onBlur: this.onBlur\n        })\n\n        if (displayType === 'text') {\n            return renderText ? (renderText(value) || null) : <span {...otherProps} ref={getInputRef}>{value}</span>;\n        }\n\n        else if (customInput) {\n            const CustomInput = customInput;\n            return (\n                <CustomInput {...inputProps} ref={getInputRef} />\n            )\n        }\n\n        return (\n            <input\n                {...inputProps}\n                ref={getInputRef}\n            />\n        )\n    }\n}\n\nNumberFormat.propTypes = propTypes;\nNumberFormat.defaultProps = defaultProps;\n\nexport default NumberFormat;","import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { Input } from \"reactstrap\";\n// import Input from '../base/Input/Input';\nimport Number from './number-format';\n\nclass NumberFormat extends React.Component {\n    render() {\n        const { name, value, onValueChange, thousandSeparator, decimalSeparator, invalid, decimalScale, ...props } = this.props;\n        return (\n            <Number\n                {...props}\n                style={{ textAlign: 'right' }}\n                value={value}\n                thousandSeparator={thousandSeparator || \",\"}\n                decimalSeparator={decimalSeparator || \".\"}\n                decimalScale={decimalScale || 2}\n                onValueChange={values => onValueChange({ values, name })}\n                invalid={invalid}\n                customInput={Input}\n            //suffix=\" đ\"\n            />\n        );\n    }\n}\n\nNumberFormat.defaultProps = {\n    placeholder: 'Nhâp...'\n};\n\nNumberFormat.propTypes = {\n    // size: PropTypes.string\n    placeholder: PropTypes.string,\n    className: PropTypes.string,\n};\n\nexport default NumberFormat;"],"names":["noop","charIsNumber","char","match","escapeRegExp","str","replace","splitDecimal","numStr","allowNegative","arguments","length","undefined","hasNagation","addNegation","parts","split","beforeDecimal","afterDecimal","limitToScale","scale","fixedDecimalScale","filler","i","setCaretPosition","el","caretPos","createTextRange","range","move","select","selectionStart","focus","setSelectionRange","clamp","num","min","max","Math","getCurrentCaretPosition","selectionEnd","propTypes","thousandSeparator","PropTypes","decimalSeparator","thousandsGroupStyle","decimalScale","displayType","prefix","suffix","format","removeFormatting","mask","value","defaultValue","isNumericString","customInput","allowEmptyFormatting","allowLeadingZeros","onValueChange","onKeyDown","onMouseUp","onChange","onFocus","onBlur","type","isAllowed","renderText","getInputRef","defaultProps","NumberFormat","React","constructor","props","super","this","validateProps","formattedValue","formatValueProp","state","numAsString","selectionBeforeInput","bind","componentDidUpdate","prevProps","updateValueIfRequired","focusedElm","stateValue","lastNumStr","lastValueWithNewFormat","formatNumString","floatValue","parseFloat","lastFloatValue","isNaN","updateValue","input","getFloatString","getSeparators","numRegex","getNumberRegex","hasNegation","join","firstDecimalIndex","indexOf","substring","RegExp","g","ignoreDecimalSeparator","getMaskAtIndex","index","getValueObject","Error","toString","setPatchedCaretPosition","currentValue","setTimeout","correctCaretPosition","direction","firstHashPosition","lastIndexOf","nextPos","caretLeftBound","caretRightBound","getCaretPosition","inputValue","inputNumber","formattedNumber","j","currentInputChar","currentFormatChar","removePrefixAndSuffix","val","isNegative","suffixLastIndex","removePatternFormatting","formatArray","filter","start","ln","part","formatWithPattern","hashCount","formattedNumberAry","formatAsNumber","hasDecimalSeparator","thousandsGroupRegex","getThousandsGroupRegex","search","applyThousandSeparator","isNonNumericFalsy","shoudHaveDecimalSeparator","roundedDecimalParts","toFixed","reverse","reduce","roundedStr","current","idx","Number","roundToPrecision","formatInput","formatNegation","negationRegex","doubleNegationRegex","test","removeNegation","isCharacterAFormat","checkIfFormatGotDeleted","end","correctInputValue","lastValue","prevValue","newValue","prevLength","newLength","findChangedIndex","substr","leftBound","rightBound","numericString","isBeforeDecimalPoint","params","onUpdate","currentCaretPosition","setState","e","persist","target","fixLeadingZero","key","expectedCaretPosition","negativeRegex","isPatternFormat","newCaretPosition","preventDefault","isUnitTestRun","caretPosition","render","otherProps","obj","keyMaps","filteredObj","Object","keys","forEach","omit","inputProps","assign","_jsx","ref","children","CustomInput","name","invalid","style","textAlign","values","Input","placeholder"],"sourceRoot":""}