@lanaco/lnc-react-ui 4.0.12 → 4.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,23 +1,23 @@
1
- "use strict";const B=require("react/jsx-runtime"),y=require("./index-BIlhCoy2.cjs"),F=require("react"),ae=require("./index-DaiUAQVF.cjs"),z=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),x=require("./utils-DTAPpJXU.cjs"),ie=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs");function A(){}function oe(){return!0}function I(a){return!!(a||"").match(/\d/)}function W(a){return a==null}function q(a){return a.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function ne(a){switch(a){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function se(a,l,f){var e=ne(f),t=a.search(/[1-9]/);return t=t===-1?a.length:t,a.substring(0,t)+a.substring(t,a.length).replace(e,"$1"+l)}function L(a,l){l===void 0&&(l=!0);var f=a[0]==="-",e=f&&l;a=a.replace("-","");var t=a.split("."),r=t[0],o=t[1]||"";return{beforeDecimal:r,afterDecimal:o,hasNagation:f,addNegation:e}}function le(a){if(!a)return a;var l=a[0]==="-";l&&(a=a.substring(1,a.length));var f=a.split("."),e=f[0].replace(/^0+/,"")||"0",t=f[1]||"";return(l?"-":"")+e+(t?"."+t:"")}function H(a,l,f){for(var e="",t=f?"0":"",r=0;r<=l-1;r++)e+=a[r]||t;return e}function _(a,l){return Array(l+1).join(a)}function ue(a){a+="";var l=a[0]==="-"?"-":"";l&&(a=a.substring(1));var f=a.split(/[eE]/g),e=f[0],t=f[1];if(t=Number(t),!t)return l+e;e=e.replace(".","");var r=1+t,o=e.length;return r<0?e="0."+_("0",Math.abs(r))+e:r>=o?e=e+_("0",r-o):e=(e.substring(0,r)||"0")+"."+e.substring(r),l+e}function fe(a,l,f){if(["","-"].indexOf(a)!==-1)return a;var e=a.indexOf(".")!==-1&&l,t=L(a),r=t.beforeDecimal,o=t.afterDecimal,s=t.hasNagation,i=parseFloat("0."+(o||"0")),n=o.length<=l?"0."+o:i.toFixed(l),u=n.split("."),p=r.split("").reverse().reduce(function(d,v,S){return d.length>S?(Number(d[0])+Number(v)).toString()+d.substring(1,d.length):v+d},u[0]),c=H(u[1]||"",Math.min(l,o.length),f),h=s?"-":"",m=e?".":"";return""+h+p+m+c}function G(a,l){if(a.value=a.value,a!==null){if(a.createTextRange){var f=a.createTextRange();return f.move("character",l),f.select(),!0}return a.selectionStart||a.selectionStart===0?(a.focus(),a.setSelectionRange(l,l),!0):(a.focus(),!1)}}function ce(a,l){for(var f=0,e=0,t=a.length,r=l.length;a[f]===l[f]&&f<t;)f++;for(;a[t-1-e]===l[r-1-e]&&r-e>f&&t-e>f;)e++;return{start:f,end:t-e}}function K(a,l,f){return Math.min(Math.max(a,l),f)}function Z(a){return Math.max(a.selectionStart,a.selectionEnd)}function pe(a){return a||typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function de(a,l){var f={};for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&l.indexOf(e)===-1&&(f[e]=a[e]);return f}var me={displayType:"input",decimalSeparator:".",thousandsGroupStyle:"thousand",fixedDecimalScale:!1,prefix:"",suffix:"",allowNegative:!0,allowEmptyFormatting:!1,allowLeadingZeros:!1,isNumericString:!1,type:"text",onValueChange:A,onChange:A,onKeyDown:A,onMouseUp:A,onFocus:A,onBlur:A,isAllowed:oe},J=function(a){function l(f){a.call(this,f);var e=f.defaultValue;this.validateProps();var t=this.formatValueProp(e);this.state={value:t,numAsString:this.removeFormatting(t),mounted:!1},this.selectionBeforeInput={selectionStart:0,selectionEnd:0},this.onChange=this.onChange.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this)}return a&&(l.__proto__=a),l.prototype=Object.create(a&&a.prototype),l.prototype.constructor=l,l.prototype.componentDidMount=function(){this.setState({mounted:!0})},l.prototype.componentDidUpdate=function(e){this.updateValueIfRequired(e)},l.prototype.componentWillUnmount=function(){clearTimeout(this.focusTimeout),clearTimeout(this.caretPositionTimeout)},l.prototype.updateValueIfRequired=function(e){var t=this,r=t.props,o=t.state,s=t.focusedElm,i=o.value,n=o.numAsString;if(n===void 0&&(n=""),e!==r){this.validateProps();var u=this.formatNumString(n),p=W(r.value)?u:this.formatValueProp(),c=this.removeFormatting(p),h=parseFloat(c),m=parseFloat(n);((!isNaN(h)||!isNaN(m))&&h!==m||u!==i||s===null&&p!==i)&&this.updateValue({formattedValue:p,numAsString:c,input:s,source:"prop",event:null})}},l.prototype.getFloatString=function(e){e===void 0&&(e="");var t=this.props,r=t.decimalScale,o=this.getSeparators(),s=o.decimalSeparator,i=this.getNumberRegex(!0),n=e[0]==="-";n&&(e=e.replace("-","")),s&&r===0&&(e=e.split(s)[0]),e=(e.match(i)||[]).join("").replace(s,".");var u=e.indexOf(".");return u!==-1&&(e=e.substring(0,u)+"."+e.substring(u+1,e.length).replace(new RegExp(q(s),"g"),"")),n&&(e="-"+e),e},l.prototype.getNumberRegex=function(e,t){var r=this.props,o=r.format,s=r.decimalScale,i=r.customNumerals,n=this.getSeparators(),u=n.decimalSeparator;return new RegExp("[0-9"+(i?i.join(""):"")+"]"+(u&&s!==0&&!t&&!o?"|"+q(u):""),e?"g":void 0)},l.prototype.getSeparators=function(){var e=this.props,t=e.decimalSeparator,r=this.props,o=r.thousandSeparator,s=r.allowedDecimalSeparators;return o===!0&&(o=","),s||(s=[t,"."]),{decimalSeparator:t,thousandSeparator:o,allowedDecimalSeparators:s}},l.prototype.getMaskAtIndex=function(e){var t=this.props,r=t.mask;return r===void 0&&(r=" "),typeof r=="string"?r:r[e]||" "},l.prototype.getValueObject=function(e,t){var r=parseFloat(t);return{formattedValue:e,value:t,floatValue:isNaN(r)?void 0:r}},l.prototype.validateProps=function(){var e=this.props,t=e.mask,r=this.getSeparators(),o=r.decimalSeparator,s=r.thousandSeparator;if(o===s)throw new Error(`
1
+ "use strict";const B=require("react/jsx-runtime"),y=require("./index-BIlhCoy2.cjs"),F=require("react"),ae=require("./index-DaiUAQVF.cjs"),z=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),b=require("./utils-DTAPpJXU.cjs"),ie=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs");function A(){}function oe(){return!0}function O(a){return!!(a||"").match(/\d/)}function W(a){return a==null}function q(a){return a.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function ne(a){switch(a){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function se(a,l,u){var e=ne(u),t=a.search(/[1-9]/);return t=t===-1?a.length:t,a.substring(0,t)+a.substring(t,a.length).replace(e,"$1"+l)}function L(a,l){l===void 0&&(l=!0);var u=a[0]==="-",e=u&&l;a=a.replace("-","");var t=a.split("."),r=t[0],o=t[1]||"";return{beforeDecimal:r,afterDecimal:o,hasNagation:u,addNegation:e}}function le(a){if(!a)return a;var l=a[0]==="-";l&&(a=a.substring(1,a.length));var u=a.split("."),e=u[0].replace(/^0+/,"")||"0",t=u[1]||"";return(l?"-":"")+e+(t?"."+t:"")}function H(a,l,u){for(var e="",t=u?"0":"",r=0;r<=l-1;r++)e+=a[r]||t;return e}function G(a,l){return Array(l+1).join(a)}function fe(a){a+="";var l=a[0]==="-"?"-":"";l&&(a=a.substring(1));var u=a.split(/[eE]/g),e=u[0],t=u[1];if(t=Number(t),!t)return l+e;e=e.replace(".","");var r=1+t,o=e.length;return r<0?e="0."+G("0",Math.abs(r))+e:r>=o?e=e+G("0",r-o):e=(e.substring(0,r)||"0")+"."+e.substring(r),l+e}function ue(a,l,u){if(["","-"].indexOf(a)!==-1)return a;var e=a.indexOf(".")!==-1&&l,t=L(a),r=t.beforeDecimal,o=t.afterDecimal,s=t.hasNagation,i=parseFloat("0."+(o||"0")),n=o.length<=l?"0."+o:i.toFixed(l),f=n.split("."),p=r.split("").reverse().reduce(function(d,v,x){return d.length>x?(Number(d[0])+Number(v)).toString()+d.substring(1,d.length):v+d},f[0]),c=H(f[1]||"",Math.min(l,o.length),u),h=s?"-":"",m=e?".":"";return""+h+p+m+c}function _(a,l){if(a.value=a.value,a!==null){if(a.createTextRange){var u=a.createTextRange();return u.move("character",l),u.select(),!0}return a.selectionStart||a.selectionStart===0?(a.focus(),a.setSelectionRange(l,l),!0):(a.focus(),!1)}}function ce(a,l){for(var u=0,e=0,t=a.length,r=l.length;a[u]===l[u]&&u<t;)u++;for(;a[t-1-e]===l[r-1-e]&&r-e>u&&t-e>u;)e++;return{start:u,end:t-e}}function K(a,l,u){return Math.min(Math.max(a,l),u)}function Z(a){return Math.max(a.selectionStart,a.selectionEnd)}function pe(a){return a||typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function de(a,l){var u={};for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&l.indexOf(e)===-1&&(u[e]=a[e]);return u}var me={displayType:"input",decimalSeparator:".",thousandsGroupStyle:"thousand",fixedDecimalScale:!1,prefix:"",suffix:"",allowNegative:!0,allowEmptyFormatting:!1,allowLeadingZeros:!1,isNumericString:!1,type:"text",onValueChange:A,onChange:A,onKeyDown:A,onMouseUp:A,onFocus:A,onBlur:A,isAllowed:oe},J=function(a){function l(u){a.call(this,u);var e=u.defaultValue;this.validateProps();var t=this.formatValueProp(e);this.state={value:t,numAsString:this.removeFormatting(t),mounted:!1},this.selectionBeforeInput={selectionStart:0,selectionEnd:0},this.onChange=this.onChange.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this)}return a&&(l.__proto__=a),l.prototype=Object.create(a&&a.prototype),l.prototype.constructor=l,l.prototype.componentDidMount=function(){this.setState({mounted:!0})},l.prototype.componentDidUpdate=function(e){this.updateValueIfRequired(e)},l.prototype.componentWillUnmount=function(){clearTimeout(this.focusTimeout),clearTimeout(this.caretPositionTimeout)},l.prototype.updateValueIfRequired=function(e){var t=this,r=t.props,o=t.state,s=t.focusedElm,i=o.value,n=o.numAsString;if(n===void 0&&(n=""),e!==r){this.validateProps();var f=this.formatNumString(n),p=W(r.value)?f:this.formatValueProp(),c=this.removeFormatting(p),h=parseFloat(c),m=parseFloat(n);((!isNaN(h)||!isNaN(m))&&h!==m||f!==i||s===null&&p!==i)&&this.updateValue({formattedValue:p,numAsString:c,input:s,source:"prop",event:null})}},l.prototype.getFloatString=function(e){e===void 0&&(e="");var t=this.props,r=t.decimalScale,o=this.getSeparators(),s=o.decimalSeparator,i=this.getNumberRegex(!0),n=e[0]==="-";n&&(e=e.replace("-","")),s&&r===0&&(e=e.split(s)[0]),e=(e.match(i)||[]).join("").replace(s,".");var f=e.indexOf(".");return f!==-1&&(e=e.substring(0,f)+"."+e.substring(f+1,e.length).replace(new RegExp(q(s),"g"),"")),n&&(e="-"+e),e},l.prototype.getNumberRegex=function(e,t){var r=this.props,o=r.format,s=r.decimalScale,i=r.customNumerals,n=this.getSeparators(),f=n.decimalSeparator;return new RegExp("[0-9"+(i?i.join(""):"")+"]"+(f&&s!==0&&!t&&!o?"|"+q(f):""),e?"g":void 0)},l.prototype.getSeparators=function(){var e=this.props,t=e.decimalSeparator,r=this.props,o=r.thousandSeparator,s=r.allowedDecimalSeparators;return o===!0&&(o=","),s||(s=[t,"."]),{decimalSeparator:t,thousandSeparator:o,allowedDecimalSeparators:s}},l.prototype.getMaskAtIndex=function(e){var t=this.props,r=t.mask;return r===void 0&&(r=" "),typeof r=="string"?r:r[e]||" "},l.prototype.getValueObject=function(e,t){var r=parseFloat(t);return{formattedValue:e,value:t,floatValue:isNaN(r)?void 0:r}},l.prototype.validateProps=function(){var e=this.props,t=e.mask,r=this.getSeparators(),o=r.decimalSeparator,s=r.thousandSeparator;if(o===s)throw new Error(`
2
2
  Decimal separator can't be same as thousand separator.
3
3
  thousandSeparator: `+s+` (thousandSeparator = {true} is same as thousandSeparator = ",")
4
4
  decimalSeparator: `+o+` (default value for decimalSeparator is .)
5
5
  `);if(t){var i=t==="string"?t:t.toString();if(i.match(/\d/g))throw new Error(`
6
6
  Mask `+t+` should not contain numeric character;
7
- `)}},l.prototype.setPatchedCaretPosition=function(e,t,r){G(e,t),this.caretPositionTimeout=setTimeout(function(){e.value===r&&G(e,t)},0)},l.prototype.correctCaretPosition=function(e,t,r){var o=this.props,s=o.prefix,i=o.suffix,n=o.format;if(e==="")return 0;if(t=K(t,0,e.length),!n){var u=e[0]==="-";return K(t,s.length+(u?1:0),e.length-i.length)}if(typeof n=="function"||n[t]==="#"&&I(e[t])||n[t-1]==="#"&&I(e[t-1]))return t;var p=n.indexOf("#"),c=n.lastIndexOf("#");t=K(t,p,c+1);for(var h=n.substring(t,n.length).indexOf("#"),m=t,d=t+(h===-1?0:h);m>p&&(n[m]!=="#"||!I(e[m]));)m-=1;var v=!I(e[d])||r==="left"&&t!==p||t-m<d-t;return v?I(e[m])?m+1:m:d},l.prototype.getCaretPosition=function(e,t,r){var o=this.props,s=o.format,i=this.state.value,n=this.getNumberRegex(!0),u=(e.match(n)||[]).join(""),p=(t.match(n)||[]).join(""),c,h;for(c=0,h=0;h<r;h++){var m=e[h]||"",d=t[c]||"";if(!(!m.match(n)&&m!==d)&&!(m==="0"&&d.match(n)&&d!=="0"&&u.length!==p.length)){for(;m!==t[c]&&c<t.length;)c++;c++}}return typeof s=="string"&&!i&&(c=t.length),c=this.correctCaretPosition(t,c),c},l.prototype.removePrefixAndSuffix=function(e){var t=this.props,r=t.format,o=t.prefix,s=t.suffix;if(!r&&e){var i=e[0]==="-";i&&(e=e.substring(1,e.length)),e=o&&e.indexOf(o)===0?e.substring(o.length,e.length):e;var n=e.lastIndexOf(s);e=s&&n!==-1&&n===e.length-s.length?e.substring(0,n):e,i&&(e="-"+e)}return e},l.prototype.removePatternFormatting=function(e){for(var t=this.props,r=t.format,o=r.split("#").filter(function(h){return h!==""}),s=0,i="",n=0,u=o.length;n<=u;n++){var p=o[n]||"",c=n===u?e.length:e.indexOf(p,s);if(c===-1){i=e;break}else i+=e.substring(s,c),s=c+p.length}return(i.match(this.getNumberRegex(!0))||[]).join("")},l.prototype.removeFormatting=function(e){var t=this.props,r=t.format,o=t.removeFormatting;return e&&(r?typeof r=="string"?e=this.removePatternFormatting(e):typeof o=="function"?e=o(e):e=(e.match(this.getNumberRegex(!0))||[]).join(""):(e=this.removePrefixAndSuffix(e),e=this.getFloatString(e)),e)},l.prototype.formatWithPattern=function(e){for(var t=this.props,r=t.format,o=0,s=r.split(""),i=0,n=r.length;i<n;i++)r[i]==="#"&&(s[i]=e[o]||this.getMaskAtIndex(o),o+=1);return s.join("")},l.prototype.formatAsNumber=function(e){var t=this.props,r=t.decimalScale,o=t.fixedDecimalScale,s=t.prefix,i=t.suffix,n=t.allowNegative,u=t.thousandsGroupStyle,p=this.getSeparators(),c=p.thousandSeparator,h=p.decimalSeparator,m=e.indexOf(".")!==-1||r&&o,d=L(e,n),v=d.beforeDecimal,S=d.afterDecimal,b=d.addNegation;return r!==void 0&&(S=H(S,r,o)),c&&(v=se(v,c,u)),s&&(v=s+v),i&&(S=S+i),b&&(v="-"+v),e=v+(m&&h||"")+S,e},l.prototype.formatNumString=function(e){e===void 0&&(e="");var t=this.props,r=t.format,o=t.allowEmptyFormatting,s=t.customNumerals,i=e;if(s&&s.length===10){var n=new RegExp("["+s.join("")+"]","g");i=e.replace(n,function(u){return s.indexOf(u).toString()})}return e===""&&!o?i="":e==="-"&&!r?i="-":typeof r=="string"?i=this.formatWithPattern(i):typeof r=="function"?i=r(i):i=this.formatAsNumber(i),i},l.prototype.formatValueProp=function(e){var t=this.props,r=t.format,o=t.decimalScale,s=t.fixedDecimalScale,i=t.allowEmptyFormatting,n=this.props,u=n.value,p=n.isNumericString;u=W(u)?e:u;var c=!u&&u!==0;if(c&&i&&(u=""),c&&!i)return"";typeof u=="number"&&(u=ue(u),p=!0),u==="Infinity"&&p&&(u=""),p&&!r&&typeof o=="number"&&(u=fe(u,o,s));var h=p?this.formatNumString(u):this.formatInput(u);return h},l.prototype.formatNegation=function(e){e===void 0&&(e="");var t=this.props,r=t.allowNegative,o=new RegExp("(-)"),s=new RegExp("(-)(.)*(-)"),i=o.test(e),n=s.test(e);return e=e.replace(/-/g,""),i&&!n&&r&&(e="-"+e),e},l.prototype.formatInput=function(e){e===void 0&&(e="");var t=this.props,r=t.format;return r||(e=this.removePrefixAndSuffix(e),e=this.formatNegation(e)),e=this.removeFormatting(e),this.formatNumString(e)},l.prototype.isCharacterAFormat=function(e,t){var r=this.props,o=r.format,s=r.prefix,i=r.suffix,n=r.decimalScale,u=r.fixedDecimalScale,p=this.getSeparators(),c=p.decimalSeparator;return!!(typeof o=="string"&&o[e]!=="#"||!o&&(e<s.length||e>=t.length-i.length||n&&u&&t[e]===c))},l.prototype.correctInputValue=function(e,t,r){var o=this,s=this.props,i=s.format,n=s.allowNegative,u=s.prefix,p=s.suffix,c=s.decimalScale,h=this.getSeparators(),m=h.allowedDecimalSeparators,d=h.decimalSeparator,v=this.state.numAsString||"",S=this.selectionBeforeInput,b=S.selectionStart,D=S.selectionEnd,C=ce(t,r),g=C.start,w=C.end;if(!i&&g===w&&m.indexOf(r[b])!==-1){var R=c===0?"":d;return r.substr(0,b)+R+r.substr(b+1,r.length)}var E=i?0:u.length,O=t.length-(i?0:p.length);if(r.length>t.length||!r.length||g===w||b===0&&D===t.length||g===0&&w===t.length||b===E&&D===O)return r;var j=t.substr(g,w-g),M=!![].concat(j).find(function(T,$){return o.isCharacterAFormat($+g,t)});if(M){var U=t.substr(g),V={},N=[];[].concat(U).forEach(function(T,$){o.isCharacterAFormat($+g,t)?V[$]=T:$>j.length-1&&N.push(T)}),Object.keys(V).forEach(function(T){N.length>T?N.splice(T,0,V[T]):N.push(V[T])}),r=t.substr(0,g)+N.join("")}if(!i){var P=this.removeFormatting(r),k=L(P,n),Y=k.beforeDecimal,ee=k.afterDecimal,te=k.addNegation,re=e<r.indexOf(d)+1;if(P.length<v.length&&re&&Y===""&&!parseFloat(ee))return te?"-":""}return r},l.prototype.updateValue=function(e){var t=e.formattedValue,r=e.input,o=e.setCaretPosition;o===void 0&&(o=!0);var s=e.source,i=e.event,n=e.numAsString,u=e.caretPos,p=this.props,c=p.onValueChange,h=this.state,m=h.value;if(r){if(u===void 0&&o){var d=e.inputValue||r.value,v=Z(r);r.value=t,u=this.getCaretPosition(d,t,v)}r.value=t,o&&this.setPatchedCaretPosition(r,u,t)}n===void 0&&(n=this.removeFormatting(t)),t!==m&&(this.setState({value:t,numAsString:n}),c(this.getValueObject(t,n),{event:i,source:s}))},l.prototype.onChange=function(e){var t=e.target,r=t.value,o=this,s=o.state,i=o.props,n=i.isAllowed,u=s.value||"",p=Z(t);r=this.correctInputValue(p,u,r);var c=this.formatInput(r)||"",h=this.removeFormatting(c),m=this.getValueObject(c,h),d=n(m);d||(c=u),this.updateValue({formattedValue:c,numAsString:h,inputValue:r,input:t,event:e,source:"event"}),d&&i.onChange(e)},l.prototype.onBlur=function(e){var t=this,r=t.props,o=t.state,s=r.format,i=r.onBlur,n=r.allowLeadingZeros,u=o.numAsString,p=o.value;if(this.focusedElm=null,clearTimeout(this.focusTimeout),clearTimeout(this.caretPositionTimeout),!s){isNaN(parseFloat(u))&&(u=""),n||(u=le(u));var c=this.formatNumString(u);if(c!==p){this.updateValue({formattedValue:c,numAsString:u,input:e.target,setCaretPosition:!1,event:e,source:"event"}),i(e);return}}i(e)},l.prototype.onKeyDown=function(e){var t=e.target,r=e.key,o=t.selectionStart,s=t.selectionEnd,i=t.value;i===void 0&&(i="");var n,u=this.props,p=u.decimalScale,c=u.fixedDecimalScale,h=u.prefix,m=u.suffix,d=u.format,v=u.onKeyDown,S=p!==void 0&&c,b=this.getNumberRegex(!1,S),D=new RegExp("-"),C=typeof d=="string";if(this.selectionBeforeInput={selectionStart:o,selectionEnd:s},r==="ArrowLeft"||r==="Backspace"?n=o-1:r==="ArrowRight"?n=o+1:r==="Delete"&&(n=o),n===void 0||o!==s){v(e);return}var g=n,w=C?d.indexOf("#"):h.length,R=C?d.lastIndexOf("#")+1:i.length-m.length;if(r==="ArrowLeft"||r==="ArrowRight"){var E=r==="ArrowLeft"?"left":"right";g=this.correctCaretPosition(i,n,E)}else if(r==="Delete"&&!b.test(i[n])&&!D.test(i[n]))for(;!b.test(i[g])&&g<R;)g++;else if(r==="Backspace"&&!b.test(i[n])){if(o<=w+1&&i[0]==="-"&&typeof d>"u"){var O=i.substring(1);this.updateValue({formattedValue:O,caretPos:g,input:t,event:e,source:"event"})}else if(!D.test(i[n])){for(;!b.test(i[g-1])&&g>w;)g--;g=this.correctCaretPosition(i,g,"left")}}(g!==n||n<w||n>R)&&(e.preventDefault(),this.setPatchedCaretPosition(t,g,i)),e.isUnitTestRun&&this.setPatchedCaretPosition(t,g,i),v(e)},l.prototype.onMouseUp=function(e){var t=e.target,r=t.selectionStart,o=t.selectionEnd,s=t.value;if(s===void 0&&(s=""),r===o){var i=this.correctCaretPosition(s,r);i!==r&&this.setPatchedCaretPosition(t,i,s)}this.props.onMouseUp(e)},l.prototype.onFocus=function(e){var t=this;e.persist(),this.focusedElm=e.target,this.focusTimeout=setTimeout(function(){var r=e.target,o=r.selectionStart,s=r.selectionEnd,i=r.value;i===void 0&&(i="");var n=t.correctCaretPosition(i,o);n!==o&&!(o===0&&s===i.length)&&t.setPatchedCaretPosition(r,n,i),t.props.onFocus(e)},0)},l.prototype.render=function(){var e=this.props,t=e.type,r=e.displayType,o=e.customInput,s=e.renderText,i=e.getInputRef,n=e.format;e.thousandSeparator,e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle,e.decimalScale,e.fixedDecimalScale,e.prefix,e.suffix,e.removeFormatting,e.mask,e.defaultValue,e.isNumericString,e.allowNegative,e.allowEmptyFormatting,e.allowLeadingZeros,e.onValueChange,e.isAllowed,e.customNumerals,e.onChange,e.onKeyDown,e.onMouseUp,e.onFocus,e.onBlur,e.value;var u=de(e,["type","displayType","customInput","renderText","getInputRef","format","thousandSeparator","decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","decimalScale","fixedDecimalScale","prefix","suffix","removeFormatting","mask","defaultValue","isNumericString","allowNegative","allowEmptyFormatting","allowLeadingZeros","onValueChange","isAllowed","customNumerals","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value"]),p=u,c=this.state,h=c.value,m=c.mounted,d=m&&pe(n)?"numeric":void 0,v=Object.assign({inputMode:d},p,{type:t,value:h,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if(r==="text")return s?s(h,p)||null:F.createElement("span",Object.assign({},p,{ref:i}),h);if(o){var S=o;return F.createElement(S,Object.assign({},v,{ref:i}))}return F.createElement("input",Object.assign({},v,{ref:i}))},l}(F.Component);J.defaultProps=me;const he=z.newStyled.div`
7
+ `)}},l.prototype.setPatchedCaretPosition=function(e,t,r){_(e,t),this.caretPositionTimeout=setTimeout(function(){e.value===r&&_(e,t)},0)},l.prototype.correctCaretPosition=function(e,t,r){var o=this.props,s=o.prefix,i=o.suffix,n=o.format;if(e==="")return 0;if(t=K(t,0,e.length),!n){var f=e[0]==="-";return K(t,s.length+(f?1:0),e.length-i.length)}if(typeof n=="function"||n[t]==="#"&&O(e[t])||n[t-1]==="#"&&O(e[t-1]))return t;var p=n.indexOf("#"),c=n.lastIndexOf("#");t=K(t,p,c+1);for(var h=n.substring(t,n.length).indexOf("#"),m=t,d=t+(h===-1?0:h);m>p&&(n[m]!=="#"||!O(e[m]));)m-=1;var v=!O(e[d])||r==="left"&&t!==p||t-m<d-t;return v?O(e[m])?m+1:m:d},l.prototype.getCaretPosition=function(e,t,r){var o=this.props,s=o.format,i=this.state.value,n=this.getNumberRegex(!0),f=(e.match(n)||[]).join(""),p=(t.match(n)||[]).join(""),c,h;for(c=0,h=0;h<r;h++){var m=e[h]||"",d=t[c]||"";if(!(!m.match(n)&&m!==d)&&!(m==="0"&&d.match(n)&&d!=="0"&&f.length!==p.length)){for(;m!==t[c]&&c<t.length;)c++;c++}}return typeof s=="string"&&!i&&(c=t.length),c=this.correctCaretPosition(t,c),c},l.prototype.removePrefixAndSuffix=function(e){var t=this.props,r=t.format,o=t.prefix,s=t.suffix;if(!r&&e){var i=e[0]==="-";i&&(e=e.substring(1,e.length)),e=o&&e.indexOf(o)===0?e.substring(o.length,e.length):e;var n=e.lastIndexOf(s);e=s&&n!==-1&&n===e.length-s.length?e.substring(0,n):e,i&&(e="-"+e)}return e},l.prototype.removePatternFormatting=function(e){for(var t=this.props,r=t.format,o=r.split("#").filter(function(h){return h!==""}),s=0,i="",n=0,f=o.length;n<=f;n++){var p=o[n]||"",c=n===f?e.length:e.indexOf(p,s);if(c===-1){i=e;break}else i+=e.substring(s,c),s=c+p.length}return(i.match(this.getNumberRegex(!0))||[]).join("")},l.prototype.removeFormatting=function(e){var t=this.props,r=t.format,o=t.removeFormatting;return e&&(r?typeof r=="string"?e=this.removePatternFormatting(e):typeof o=="function"?e=o(e):e=(e.match(this.getNumberRegex(!0))||[]).join(""):(e=this.removePrefixAndSuffix(e),e=this.getFloatString(e)),e)},l.prototype.formatWithPattern=function(e){for(var t=this.props,r=t.format,o=0,s=r.split(""),i=0,n=r.length;i<n;i++)r[i]==="#"&&(s[i]=e[o]||this.getMaskAtIndex(o),o+=1);return s.join("")},l.prototype.formatAsNumber=function(e){var t=this.props,r=t.decimalScale,o=t.fixedDecimalScale,s=t.prefix,i=t.suffix,n=t.allowNegative,f=t.thousandsGroupStyle,p=this.getSeparators(),c=p.thousandSeparator,h=p.decimalSeparator,m=e.indexOf(".")!==-1||r&&o,d=L(e,n),v=d.beforeDecimal,x=d.afterDecimal,N=d.addNegation;return r!==void 0&&(x=H(x,r,o)),c&&(v=se(v,c,f)),s&&(v=s+v),i&&(x=x+i),N&&(v="-"+v),e=v+(m&&h||"")+x,e},l.prototype.formatNumString=function(e){e===void 0&&(e="");var t=this.props,r=t.format,o=t.allowEmptyFormatting,s=t.customNumerals,i=e;if(s&&s.length===10){var n=new RegExp("["+s.join("")+"]","g");i=e.replace(n,function(f){return s.indexOf(f).toString()})}return e===""&&!o?i="":e==="-"&&!r?i="-":typeof r=="string"?i=this.formatWithPattern(i):typeof r=="function"?i=r(i):i=this.formatAsNumber(i),i},l.prototype.formatValueProp=function(e){var t=this.props,r=t.format,o=t.decimalScale,s=t.fixedDecimalScale,i=t.allowEmptyFormatting,n=this.props,f=n.value,p=n.isNumericString;f=W(f)?e:f;var c=!f&&f!==0;if(c&&i&&(f=""),c&&!i)return"";typeof f=="number"&&(f=fe(f),p=!0),f==="Infinity"&&p&&(f=""),p&&!r&&typeof o=="number"&&(f=ue(f,o,s));var h=p?this.formatNumString(f):this.formatInput(f);return h},l.prototype.formatNegation=function(e){e===void 0&&(e="");var t=this.props,r=t.allowNegative,o=new RegExp("(-)"),s=new RegExp("(-)(.)*(-)"),i=o.test(e),n=s.test(e);return e=e.replace(/-/g,""),i&&!n&&r&&(e="-"+e),e},l.prototype.formatInput=function(e){e===void 0&&(e="");var t=this.props,r=t.format;return r||(e=this.removePrefixAndSuffix(e),e=this.formatNegation(e)),e=this.removeFormatting(e),this.formatNumString(e)},l.prototype.isCharacterAFormat=function(e,t){var r=this.props,o=r.format,s=r.prefix,i=r.suffix,n=r.decimalScale,f=r.fixedDecimalScale,p=this.getSeparators(),c=p.decimalSeparator;return!!(typeof o=="string"&&o[e]!=="#"||!o&&(e<s.length||e>=t.length-i.length||n&&f&&t[e]===c))},l.prototype.correctInputValue=function(e,t,r){var o=this,s=this.props,i=s.format,n=s.allowNegative,f=s.prefix,p=s.suffix,c=s.decimalScale,h=this.getSeparators(),m=h.allowedDecimalSeparators,d=h.decimalSeparator,v=this.state.numAsString||"",x=this.selectionBeforeInput,N=x.selectionStart,D=x.selectionEnd,C=ce(t,r),g=C.start,w=C.end;if(!i&&g===w&&m.indexOf(r[N])!==-1){var R=c===0?"":d;return r.substr(0,N)+R+r.substr(N+1,r.length)}var E=i?0:f.length,$=t.length-(i?0:p.length);if(r.length>t.length||!r.length||g===w||N===0&&D===t.length||g===0&&w===t.length||N===E&&D===$)return r;var j=t.substr(g,w-g),M=!![].concat(j).find(function(T,I){return o.isCharacterAFormat(I+g,t)});if(M){var U=t.substr(g),V={},S=[];[].concat(U).forEach(function(T,I){o.isCharacterAFormat(I+g,t)?V[I]=T:I>j.length-1&&S.push(T)}),Object.keys(V).forEach(function(T){S.length>T?S.splice(T,0,V[T]):S.push(V[T])}),r=t.substr(0,g)+S.join("")}if(!i){var P=this.removeFormatting(r),k=L(P,n),Y=k.beforeDecimal,ee=k.afterDecimal,te=k.addNegation,re=e<r.indexOf(d)+1;if(P.length<v.length&&re&&Y===""&&!parseFloat(ee))return te?"-":""}return r},l.prototype.updateValue=function(e){var t=e.formattedValue,r=e.input,o=e.setCaretPosition;o===void 0&&(o=!0);var s=e.source,i=e.event,n=e.numAsString,f=e.caretPos,p=this.props,c=p.onValueChange,h=this.state,m=h.value;if(r){if(f===void 0&&o){var d=e.inputValue||r.value,v=Z(r);r.value=t,f=this.getCaretPosition(d,t,v)}r.value=t,o&&this.setPatchedCaretPosition(r,f,t)}n===void 0&&(n=this.removeFormatting(t)),t!==m&&(this.setState({value:t,numAsString:n}),c(this.getValueObject(t,n),{event:i,source:s}))},l.prototype.onChange=function(e){var t=e.target,r=t.value,o=this,s=o.state,i=o.props,n=i.isAllowed,f=s.value||"",p=Z(t);r=this.correctInputValue(p,f,r);var c=this.formatInput(r)||"",h=this.removeFormatting(c),m=this.getValueObject(c,h),d=n(m);d||(c=f),this.updateValue({formattedValue:c,numAsString:h,inputValue:r,input:t,event:e,source:"event"}),d&&i.onChange(e)},l.prototype.onBlur=function(e){var t=this,r=t.props,o=t.state,s=r.format,i=r.onBlur,n=r.allowLeadingZeros,f=o.numAsString,p=o.value;if(this.focusedElm=null,clearTimeout(this.focusTimeout),clearTimeout(this.caretPositionTimeout),!s){isNaN(parseFloat(f))&&(f=""),n||(f=le(f));var c=this.formatNumString(f);if(c!==p){this.updateValue({formattedValue:c,numAsString:f,input:e.target,setCaretPosition:!1,event:e,source:"event"}),i(e);return}}i(e)},l.prototype.onKeyDown=function(e){var t=e.target,r=e.key,o=t.selectionStart,s=t.selectionEnd,i=t.value;i===void 0&&(i="");var n,f=this.props,p=f.decimalScale,c=f.fixedDecimalScale,h=f.prefix,m=f.suffix,d=f.format,v=f.onKeyDown,x=p!==void 0&&c,N=this.getNumberRegex(!1,x),D=new RegExp("-"),C=typeof d=="string";if(this.selectionBeforeInput={selectionStart:o,selectionEnd:s},r==="ArrowLeft"||r==="Backspace"?n=o-1:r==="ArrowRight"?n=o+1:r==="Delete"&&(n=o),n===void 0||o!==s){v(e);return}var g=n,w=C?d.indexOf("#"):h.length,R=C?d.lastIndexOf("#")+1:i.length-m.length;if(r==="ArrowLeft"||r==="ArrowRight"){var E=r==="ArrowLeft"?"left":"right";g=this.correctCaretPosition(i,n,E)}else if(r==="Delete"&&!N.test(i[n])&&!D.test(i[n]))for(;!N.test(i[g])&&g<R;)g++;else if(r==="Backspace"&&!N.test(i[n])){if(o<=w+1&&i[0]==="-"&&typeof d>"u"){var $=i.substring(1);this.updateValue({formattedValue:$,caretPos:g,input:t,event:e,source:"event"})}else if(!D.test(i[n])){for(;!N.test(i[g-1])&&g>w;)g--;g=this.correctCaretPosition(i,g,"left")}}(g!==n||n<w||n>R)&&(e.preventDefault(),this.setPatchedCaretPosition(t,g,i)),e.isUnitTestRun&&this.setPatchedCaretPosition(t,g,i),v(e)},l.prototype.onMouseUp=function(e){var t=e.target,r=t.selectionStart,o=t.selectionEnd,s=t.value;if(s===void 0&&(s=""),r===o){var i=this.correctCaretPosition(s,r);i!==r&&this.setPatchedCaretPosition(t,i,s)}this.props.onMouseUp(e)},l.prototype.onFocus=function(e){var t=this;e.persist(),this.focusedElm=e.target,this.focusTimeout=setTimeout(function(){var r=e.target,o=r.selectionStart,s=r.selectionEnd,i=r.value;i===void 0&&(i="");var n=t.correctCaretPosition(i,o);n!==o&&!(o===0&&s===i.length)&&t.setPatchedCaretPosition(r,n,i),t.props.onFocus(e)},0)},l.prototype.render=function(){var e=this.props,t=e.type,r=e.displayType,o=e.customInput,s=e.renderText,i=e.getInputRef,n=e.format;e.thousandSeparator,e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle,e.decimalScale,e.fixedDecimalScale,e.prefix,e.suffix,e.removeFormatting,e.mask,e.defaultValue,e.isNumericString,e.allowNegative,e.allowEmptyFormatting,e.allowLeadingZeros,e.onValueChange,e.isAllowed,e.customNumerals,e.onChange,e.onKeyDown,e.onMouseUp,e.onFocus,e.onBlur,e.value;var f=de(e,["type","displayType","customInput","renderText","getInputRef","format","thousandSeparator","decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","decimalScale","fixedDecimalScale","prefix","suffix","removeFormatting","mask","defaultValue","isNumericString","allowNegative","allowEmptyFormatting","allowLeadingZeros","onValueChange","isAllowed","customNumerals","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value"]),p=f,c=this.state,h=c.value,m=c.mounted,d=m&&pe(n)?"numeric":void 0,v=Object.assign({inputMode:d},p,{type:t,value:h,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if(r==="text")return s?s(h,p)||null:F.createElement("span",Object.assign({},p,{ref:i}),h);if(o){var x=o;return F.createElement(x,Object.assign({},v,{ref:i}))}return F.createElement("input",Object.assign({},v,{ref:i}))},l}(F.Component);J.defaultProps=me;const he=z.newStyled.div`
8
8
  display: flex;
9
9
  align-items: center;
10
10
 
11
- min-height: ${a=>x.getSizeValueWithUnits(a.theme,a.size)};
12
- max-height: ${a=>x.getSizeValueWithUnits(a.theme,a.size)};
13
- background-color: ${a=>x.getColorRgbaValue(a.theme,"Input",a.color,"enabled","background")};
11
+ min-height: ${a=>b.getSizeValueWithUnits(a.theme,a.size)};
12
+ max-height: ${a=>b.getSizeValueWithUnits(a.theme,a.size)};
13
+ background-color: ${a=>b.getColorRgbaValue(a.theme,"Input",a.color,"enabled","background")};
14
14
  border: 1px solid
15
- ${a=>x.getColorRgbaValue(a.theme,"Input",a.focused===!0?"primary":a.color,"enabled","border")};
16
- border-radius: ${a=>x.getBorderRadiusValueWithUnits(a.theme,"regular")};
15
+ ${a=>b.getColorRgbaValue(a.theme,"Input",a.focused===!0?"primary":a.color,"enabled","border")};
16
+ border-radius: ${a=>b.getBorderRadiusValueWithUnits(a.theme,"regular")};
17
17
 
18
- ${a=>a.focused===!0&&a.readOnly!==!0?x.getOutlineCss(a.theme):""}
19
- ${a=>a.isDisabled===!0?x.getDisabledStateCss(a.theme):""}
20
- ${a=>a.isDisabled===!0?"border: 1px solid "+x.getColorRgbaValue(a.theme,"Input",a.color,"disabled","border"):""}
18
+ ${a=>a.focused===!0&&a.readOnly!==!0?b.getOutlineCss(a.theme):""}
19
+ ${a=>a.isDisabled===!0?b.getDisabledStateCss(a.theme):""}
20
+ ${a=>a.isDisabled===!0?"border: 1px solid "+b.getColorRgbaValue(a.theme,"Input",a.color,"disabled","border"):""}
21
21
 
22
22
  & input {
23
23
  background: none;
@@ -27,17 +27,17 @@
27
27
  padding-bottom: 0.625rem;
28
28
  width: 100%;
29
29
 
30
- ${a=>x.getComponentTypographyCss(a.theme,"Input",a.size,"enabled")}
31
- min-height: ${a=>x.getSizeValueWithUnits(a.theme,a.size)};
32
- max-height: ${a=>x.getSizeValueWithUnits(a.theme,a.size)};
33
- color: ${a=>x.getColorRgbaValue(a.theme,"Input",a.focused===!0?"primary":a.color,"enabled","text")};
34
- caret-color: ${a=>x.getColorRgbaValue(a.theme,"Input",a.color,"enabled","caret")};
30
+ ${a=>b.getComponentTypographyCss(a.theme,"Input",a.size,"enabled")}
31
+ min-height: ${a=>b.getSizeValueWithUnits(a.theme,a.size)};
32
+ max-height: ${a=>b.getSizeValueWithUnits(a.theme,a.size)};
33
+ color: ${a=>b.getColorRgbaValue(a.theme,"Input",a.focused===!0?"primary":a.color,"enabled","text")};
34
+ caret-color: ${a=>b.getColorRgbaValue(a.theme,"Input",a.color,"enabled","caret")};
35
35
  padding-right: ${a=>a.suffix?"0":"0.75rem"};
36
36
  padding-left: ${a=>a.prefix?"0":"0.75rem"};
37
37
  }
38
38
 
39
39
  & input:disabled {
40
- ${a=>x.getDisabledStateCss(a.theme)}
40
+ ${a=>b.getDisabledStateCss(a.theme)}
41
41
  background: none;
42
42
  }
43
43
 
@@ -46,9 +46,9 @@
46
46
  }
47
47
 
48
48
  & input::placeholder {
49
- color: ${a=>x.getColorRgbaValue(a.theme,"Input",a.color,"enabled","placeholder")};
49
+ color: ${a=>b.getColorRgbaValue(a.theme,"Input",a.color,"enabled","placeholder")};
50
50
  }
51
51
  `,Q=z.newStyled.span`
52
52
  padding: 0 12px;
53
- color: ${a=>x.getColorRgbaValue(a.theme,"Input",a.focused===!0?"primary":a.color,"enabled","prefix")};
54
- `,ge=z.newStyled(Q)``,X=F.forwardRef((a,l)=>{const{disabled:f,readOnly:e,debounceTime:t=180,prefix:r,suffix:o,thousandSeparator:s=".",decimalSeparator:i=",",decimalScale:n=2,fixedDecimalScale:u=!0,allowNegative:p=!0,onChange:c,onKeyDown:h,onBlur:m,onFocus:d,className:v="",style:S={},size:b="small",color:D="primary",...C}=a,g=ie.useTheme(),[w,R]=F.useState(!1),E=F.useCallback(ae.debounce((N,P)=>O(N,P),t),[c]),O=(N,P)=>{c&&(c==null||c(N,P))},j=(N,P)=>{E(P.event,_value)},M=()=>n<0?0:n>17?17:n,U=N=>{R(!0),d==null||d(N)},V=N=>{R(!1),m==null||m(N)};return B.jsxs(he,{style:S,className:v,theme:g,color:D,size:b,prefix:r,suffix:o,focused:w,disabled:f,readOnly:e,children:[r&&B.jsx(Q,{theme:g,color:D,focused:w,className:"lnc-input-prefix",children:r}),B.jsx(J,{getInputRef:l,className:"lnc-decimal-input",disabled:f,readOnly:e,thousandSeparator:s,decimalSeparator:i,decimalScale:M(),fixedDecimalScale:u,allowNegative:p,onFocus:U,onBlur:V,onValueChange:j,...C}),o&&B.jsx(ge,{theme:g,color:D,focused:w,className:"lnc-input-suffix",children:o})]})});X.propTypes={id:y.PropTypes.string,value:y.PropTypes.any,defaultValue:y.PropTypes.any,disabled:y.PropTypes.bool,readOnly:y.PropTypes.bool,debounceTime:y.PropTypes.number,prefix:y.PropTypes.oneOfType([y.PropTypes.string,y.PropTypes.element]),suffix:y.PropTypes.oneOfType([y.PropTypes.string,y.PropTypes.element]),thousandSeparator:y.PropTypes.oneOf([".",","," "]),decimalSeparator:y.PropTypes.oneOf([".",","]),decimalScale:y.PropTypes.number,fixedDecimalScale:y.PropTypes.bool,allowNegative:y.PropTypes.bool,onChange:y.PropTypes.func,onBlur:y.PropTypes.func,onFocus:y.PropTypes.func,className:y.PropTypes.string,style:y.PropTypes.object,size:y.PropTypes.oneOf(["small","medium","large"]),color:y.PropTypes.oneOf(["primary","secondary","success","danger","warning","information","neutral","gray"])};module.exports=X;
53
+ color: ${a=>b.getColorRgbaValue(a.theme,"Input",a.focused===!0?"primary":a.color,"enabled","prefix")};
54
+ `,ge=z.newStyled(Q)``,X=F.forwardRef((a,l)=>{const{disabled:u,readOnly:e,debounceTime:t=180,prefix:r,suffix:o,thousandSeparator:s=".",decimalSeparator:i=",",decimalScale:n=2,fixedDecimalScale:f=!0,allowNegative:p=!0,onChange:c,onKeyDown:h,onBlur:m,onFocus:d,className:v="",style:x={},size:N="small",color:D="primary",...C}=a,g=ie.useTheme(),[w,R]=F.useState(!1),E=F.useCallback(ae.debounce((S,P)=>$(S,P),t),[c]),$=(S,P)=>{c&&(c==null||c(S,P))},j=(S,P)=>{E(P.event,S==null?void 0:S.floatValue)},M=()=>n<0?0:n>17?17:n,U=S=>{R(!0),d==null||d(S)},V=S=>{R(!1),m==null||m(S)};return B.jsxs(he,{style:x,className:v,theme:g,color:D,size:N,prefix:r,suffix:o,focused:w,disabled:u,readOnly:e,children:[r&&B.jsx(Q,{theme:g,color:D,focused:w,className:"lnc-input-prefix",children:r}),B.jsx(J,{getInputRef:l,className:"lnc-decimal-input",disabled:u,readOnly:e,thousandSeparator:s,decimalSeparator:i,decimalScale:M(),fixedDecimalScale:f,allowNegative:p,onFocus:U,onBlur:V,onValueChange:j,...C}),o&&B.jsx(ge,{theme:g,color:D,focused:w,className:"lnc-input-suffix",children:o})]})});X.propTypes={id:y.PropTypes.string,value:y.PropTypes.any,defaultValue:y.PropTypes.any,disabled:y.PropTypes.bool,readOnly:y.PropTypes.bool,debounceTime:y.PropTypes.number,prefix:y.PropTypes.oneOfType([y.PropTypes.string,y.PropTypes.element]),suffix:y.PropTypes.oneOfType([y.PropTypes.string,y.PropTypes.element]),thousandSeparator:y.PropTypes.oneOf([".",","," "]),decimalSeparator:y.PropTypes.oneOf([".",","]),decimalScale:y.PropTypes.number,fixedDecimalScale:y.PropTypes.bool,allowNegative:y.PropTypes.bool,onChange:y.PropTypes.func,onBlur:y.PropTypes.func,onFocus:y.PropTypes.func,className:y.PropTypes.string,style:y.PropTypes.object,size:y.PropTypes.oneOf(["small","medium","large"]),color:y.PropTypes.oneOf(["primary","secondary","success","danger","warning","information","neutral","gray"])};module.exports=X;
@@ -1,22 +1,22 @@
1
1
  import { jsxs as ie, jsx as K } from "react/jsx-runtime";
2
2
  import { P as S } from "./index-BYnWp42a.js";
3
- import j, { forwardRef as oe, useState as ne, useCallback as se } from "react";
3
+ import B, { forwardRef as oe, useState as ne, useCallback as se } from "react";
4
4
  import { d as fe } from "./index-CNBqQrtK.js";
5
5
  import { n as G } from "./emotion-styled.browser.esm-BiK8DcgW.js";
6
- import { d as B, a as R, b as le, e as ue, h as W, g as ce } from "./utils-C52T57HO.js";
6
+ import { d as M, a as R, b as le, e as ue, h as W, g as ce } from "./utils-C52T57HO.js";
7
7
  import { u as pe } from "./emotion-element-5486c51c.browser.esm-Bb4VkP8U.js";
8
- function O() {
8
+ function E() {
9
9
  }
10
10
  function de() {
11
11
  return !0;
12
12
  }
13
- function V(a) {
13
+ function I(a) {
14
14
  return !!(a || "").match(/\d/);
15
15
  }
16
- function _(a) {
16
+ function Z(a) {
17
17
  return a == null;
18
18
  }
19
- function Z(a) {
19
+ function _(a) {
20
20
  return a.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&");
21
21
  }
22
22
  function me(a) {
@@ -46,7 +46,7 @@ function z(a, f) {
46
46
  addNegation: e
47
47
  };
48
48
  }
49
- function ve(a) {
49
+ function ge(a) {
50
50
  if (!a)
51
51
  return a;
52
52
  var f = a[0] === "-";
@@ -62,7 +62,7 @@ function Q(a, f, u) {
62
62
  function q(a, f) {
63
63
  return Array(f + 1).join(a);
64
64
  }
65
- function ge(a) {
65
+ function ve(a) {
66
66
  a += "";
67
67
  var f = a[0] === "-" ? "-" : "";
68
68
  f && (a = a.substring(1));
@@ -76,8 +76,8 @@ function ge(a) {
76
76
  function Se(a, f, u) {
77
77
  if (["", "-"].indexOf(a) !== -1)
78
78
  return a;
79
- var e = a.indexOf(".") !== -1 && f, t = z(a), r = t.beforeDecimal, o = t.afterDecimal, s = t.hasNagation, i = parseFloat("0." + (o || "0")), n = o.length <= f ? "0." + o : i.toFixed(f), l = n.split("."), p = r.split("").reverse().reduce(function(d, g, y) {
80
- return d.length > y ? (Number(d[0]) + Number(g)).toString() + d.substring(1, d.length) : g + d;
79
+ var e = a.indexOf(".") !== -1 && f, t = z(a), r = t.beforeDecimal, o = t.afterDecimal, s = t.hasNagation, i = parseFloat("0." + (o || "0")), n = o.length <= f ? "0." + o : i.toFixed(f), l = n.split("."), p = r.split("").reverse().reduce(function(d, v, x) {
80
+ return d.length > x ? (Number(d[0]) + Number(v)).toString() + d.substring(1, d.length) : v + d;
81
81
  }, l[0]), c = Q(
82
82
  l[1] || "",
83
83
  Math.min(f, o.length),
@@ -127,12 +127,12 @@ var Ne = {
127
127
  allowLeadingZeros: !1,
128
128
  isNumericString: !1,
129
129
  type: "text",
130
- onValueChange: O,
131
- onChange: O,
132
- onKeyDown: O,
133
- onMouseUp: O,
134
- onFocus: O,
135
- onBlur: O,
130
+ onValueChange: E,
131
+ onChange: E,
132
+ onKeyDown: E,
133
+ onMouseUp: E,
134
+ onFocus: E,
135
+ onBlur: E,
136
136
  isAllowed: de
137
137
  }, X = /* @__PURE__ */ function(a) {
138
138
  function f(u) {
@@ -161,7 +161,7 @@ var Ne = {
161
161
  var t = this, r = t.props, o = t.state, s = t.focusedElm, i = o.value, n = o.numAsString;
162
162
  if (n === void 0 && (n = ""), e !== r) {
163
163
  this.validateProps();
164
- var l = this.formatNumString(n), p = _(r.value) ? l : this.formatValueProp(), c = this.removeFormatting(p), h = parseFloat(c), m = parseFloat(n);
164
+ var l = this.formatNumString(n), p = Z(r.value) ? l : this.formatValueProp(), c = this.removeFormatting(p), h = parseFloat(c), m = parseFloat(n);
165
165
  //while typing set state only when float value changes
166
166
  ((!isNaN(h) || !isNaN(m)) && h !== m || //can also set state when float value is same and the format props changes
167
167
  l !== i || //set state always when not in focus and formatted value is changed
@@ -178,11 +178,11 @@ var Ne = {
178
178
  var t = this.props, r = t.decimalScale, o = this.getSeparators(), s = o.decimalSeparator, i = this.getNumberRegex(!0), n = e[0] === "-";
179
179
  n && (e = e.replace("-", "")), s && r === 0 && (e = e.split(s)[0]), e = (e.match(i) || []).join("").replace(s, ".");
180
180
  var l = e.indexOf(".");
181
- return l !== -1 && (e = e.substring(0, l) + "." + e.substring(l + 1, e.length).replace(new RegExp(Z(s), "g"), "")), n && (e = "-" + e), e;
181
+ return l !== -1 && (e = e.substring(0, l) + "." + e.substring(l + 1, e.length).replace(new RegExp(_(s), "g"), "")), n && (e = "-" + e), e;
182
182
  }, f.prototype.getNumberRegex = function(e, t) {
183
183
  var r = this.props, o = r.format, s = r.decimalScale, i = r.customNumerals, n = this.getSeparators(), l = n.decimalSeparator;
184
184
  return new RegExp(
185
- "[0-9" + (i ? i.join("") : "") + "]" + (l && s !== 0 && !t && !o ? "|" + Z(l) : ""),
185
+ "[0-9" + (i ? i.join("") : "") + "]" + (l && s !== 0 && !t && !o ? "|" + _(l) : ""),
186
186
  e ? "g" : void 0
187
187
  );
188
188
  }, f.prototype.getSeparators = function() {
@@ -229,14 +229,14 @@ var Ne = {
229
229
  var l = e[0] === "-";
230
230
  return L(t, s.length + (l ? 1 : 0), e.length - i.length);
231
231
  }
232
- if (typeof n == "function" || n[t] === "#" && V(e[t]) || n[t - 1] === "#" && V(e[t - 1]))
232
+ if (typeof n == "function" || n[t] === "#" && I(e[t]) || n[t - 1] === "#" && I(e[t - 1]))
233
233
  return t;
234
234
  var p = n.indexOf("#"), c = n.lastIndexOf("#");
235
235
  t = L(t, p, c + 1);
236
- for (var h = n.substring(t, n.length).indexOf("#"), m = t, d = t + (h === -1 ? 0 : h); m > p && (n[m] !== "#" || !V(e[m])); )
236
+ for (var h = n.substring(t, n.length).indexOf("#"), m = t, d = t + (h === -1 ? 0 : h); m > p && (n[m] !== "#" || !I(e[m])); )
237
237
  m -= 1;
238
- var g = !V(e[d]) || r === "left" && t !== p || t - m < d - t;
239
- return g ? V(e[m]) ? m + 1 : m : d;
238
+ var v = !I(e[d]) || r === "left" && t !== p || t - m < d - t;
239
+ return v ? I(e[m]) ? m + 1 : m : d;
240
240
  }, f.prototype.getCaretPosition = function(e, t, r) {
241
241
  var o = this.props, s = o.format, i = this.state.value, n = this.getNumberRegex(!0), l = (e.match(n) || []).join(""), p = (t.match(n) || []).join(""), c, h;
242
242
  for (c = 0, h = 0; h < r; h++) {
@@ -277,8 +277,8 @@ var Ne = {
277
277
  r[i] === "#" && (s[i] = e[o] || this.getMaskAtIndex(o), o += 1);
278
278
  return s.join("");
279
279
  }, f.prototype.formatAsNumber = function(e) {
280
- var t = this.props, r = t.decimalScale, o = t.fixedDecimalScale, s = t.prefix, i = t.suffix, n = t.allowNegative, l = t.thousandsGroupStyle, p = this.getSeparators(), c = p.thousandSeparator, h = p.decimalSeparator, m = e.indexOf(".") !== -1 || r && o, d = z(e, n), g = d.beforeDecimal, y = d.afterDecimal, x = d.addNegation;
281
- return r !== void 0 && (y = Q(y, r, o)), c && (g = he(g, c, l)), s && (g = s + g), i && (y = y + i), x && (g = "-" + g), e = g + (m && h || "") + y, e;
280
+ var t = this.props, r = t.decimalScale, o = t.fixedDecimalScale, s = t.prefix, i = t.suffix, n = t.allowNegative, l = t.thousandsGroupStyle, p = this.getSeparators(), c = p.thousandSeparator, h = p.decimalSeparator, m = e.indexOf(".") !== -1 || r && o, d = z(e, n), v = d.beforeDecimal, x = d.afterDecimal, b = d.addNegation;
281
+ return r !== void 0 && (x = Q(x, r, o)), c && (v = he(v, c, l)), s && (v = s + v), i && (x = x + i), b && (v = "-" + v), e = v + (m && h || "") + x, e;
282
282
  }, f.prototype.formatNumString = function(e) {
283
283
  e === void 0 && (e = "");
284
284
  var t = this.props, r = t.format, o = t.allowEmptyFormatting, s = t.customNumerals, i = e;
@@ -294,11 +294,11 @@ var Ne = {
294
294
  return e === "" && !o ? i = "" : e === "-" && !r ? i = "-" : typeof r == "string" ? i = this.formatWithPattern(i) : typeof r == "function" ? i = r(i) : i = this.formatAsNumber(i), i;
295
295
  }, f.prototype.formatValueProp = function(e) {
296
296
  var t = this.props, r = t.format, o = t.decimalScale, s = t.fixedDecimalScale, i = t.allowEmptyFormatting, n = this.props, l = n.value, p = n.isNumericString;
297
- l = _(l) ? e : l;
297
+ l = Z(l) ? e : l;
298
298
  var c = !l && l !== 0;
299
299
  if (c && i && (l = ""), c && !i)
300
300
  return "";
301
- typeof l == "number" && (l = ge(l), p = !0), l === "Infinity" && p && (l = ""), p && !r && typeof o == "number" && (l = Se(l, o, s));
301
+ typeof l == "number" && (l = ve(l), p = !0), l === "Infinity" && p && (l = ""), p && !r && typeof o == "number" && (l = Se(l, o, s));
302
302
  var h = p ? this.formatNumString(l) : this.formatInput(l);
303
303
  return h;
304
304
  }, f.prototype.formatNegation = function(e) {
@@ -313,42 +313,42 @@ var Ne = {
313
313
  var r = this.props, o = r.format, s = r.prefix, i = r.suffix, n = r.decimalScale, l = r.fixedDecimalScale, p = this.getSeparators(), c = p.decimalSeparator;
314
314
  return !!(typeof o == "string" && o[e] !== "#" || !o && (e < s.length || e >= t.length - i.length || n && l && t[e] === c));
315
315
  }, f.prototype.correctInputValue = function(e, t, r) {
316
- var o = this, s = this.props, i = s.format, n = s.allowNegative, l = s.prefix, p = s.suffix, c = s.decimalScale, h = this.getSeparators(), m = h.allowedDecimalSeparators, d = h.decimalSeparator, g = this.state.numAsString || "", y = this.selectionBeforeInput, x = y.selectionStart, w = y.selectionEnd, P = ye(t, r), v = P.start, N = P.end;
317
- if (!i && v === N && m.indexOf(r[x]) !== -1) {
316
+ var o = this, s = this.props, i = s.format, n = s.allowNegative, l = s.prefix, p = s.suffix, c = s.decimalScale, h = this.getSeparators(), m = h.allowedDecimalSeparators, d = h.decimalSeparator, v = this.state.numAsString || "", x = this.selectionBeforeInput, b = x.selectionStart, w = x.selectionEnd, P = ye(t, r), g = P.start, N = P.end;
317
+ if (!i && g === N && m.indexOf(r[b]) !== -1) {
318
318
  var F = c === 0 ? "" : d;
319
- return r.substr(0, x) + F + r.substr(x + 1, r.length);
319
+ return r.substr(0, b) + F + r.substr(b + 1, r.length);
320
320
  }
321
- var E = i ? 0 : l.length, T = t.length - (i ? 0 : p.length);
321
+ var T = i ? 0 : l.length, $ = t.length - (i ? 0 : p.length);
322
322
  if (
323
323
  // don't do anything if something got added
324
324
  r.length > t.length || // or if the new value is an empty string
325
325
  !r.length || // or if nothing has changed, in which case start will be same as end
326
- v === N || // or in case if whole input is selected and new value is typed
327
- x === 0 && w === t.length || // or in case if the whole content is replaced by browser, example (autocomplete)
328
- v === 0 && N === t.length || // or if charcters between prefix and suffix is selected.
326
+ g === N || // or in case if whole input is selected and new value is typed
327
+ b === 0 && w === t.length || // or in case if the whole content is replaced by browser, example (autocomplete)
328
+ g === 0 && N === t.length || // or if charcters between prefix and suffix is selected.
329
329
  // For numeric inputs we apply the format so, prefix and suffix can be ignored
330
- x === E && w === T
330
+ b === T && w === $
331
331
  )
332
332
  return r;
333
- var I = t.substr(v, N - v), M = !![].concat(I).find(
334
- function(C, $) {
335
- return o.isCharacterAFormat($ + v, t);
333
+ var O = t.substr(g, N - g), j = !![].concat(O).find(
334
+ function(C, V) {
335
+ return o.isCharacterAFormat(V + g, t);
336
336
  }
337
337
  );
338
- if (M) {
339
- var k = t.substr(v), A = {}, b = [];
340
- [].concat(k).forEach(function(C, $) {
341
- o.isCharacterAFormat($ + v, t) ? A[$] = C : $ > I.length - 1 && b.push(C);
338
+ if (j) {
339
+ var k = t.substr(g), A = {}, y = [];
340
+ [].concat(k).forEach(function(C, V) {
341
+ o.isCharacterAFormat(V + g, t) ? A[V] = C : V > O.length - 1 && y.push(C);
342
342
  }), Object.keys(A).forEach(function(C) {
343
- b.length > C ? b.splice(C, 0, A[C]) : b.push(A[C]);
344
- }), r = t.substr(0, v) + b.join("");
343
+ y.length > C ? y.splice(C, 0, A[C]) : y.push(A[C]);
344
+ }), r = t.substr(0, g) + y.join("");
345
345
  }
346
346
  if (!i) {
347
347
  var D = this.removeFormatting(r), U = z(
348
348
  D,
349
349
  n
350
350
  ), ee = U.beforeDecimal, te = U.afterDecimal, re = U.addNegation, ae = e < r.indexOf(d) + 1;
351
- if (D.length < g.length && ae && ee === "" && !parseFloat(te))
351
+ if (D.length < v.length && ae && ee === "" && !parseFloat(te))
352
352
  return re ? "-" : "";
353
353
  }
354
354
  return r;
@@ -358,8 +358,8 @@ var Ne = {
358
358
  var s = e.source, i = e.event, n = e.numAsString, l = e.caretPos, p = this.props, c = p.onValueChange, h = this.state, m = h.value;
359
359
  if (r) {
360
360
  if (l === void 0 && o) {
361
- var d = e.inputValue || r.value, g = J(r);
362
- r.value = t, l = this.getCaretPosition(d, t, g);
361
+ var d = e.inputValue || r.value, v = J(r);
362
+ r.value = t, l = this.getCaretPosition(d, t, v);
363
363
  }
364
364
  r.value = t, o && this.setPatchedCaretPosition(r, l, t);
365
365
  }
@@ -379,7 +379,7 @@ var Ne = {
379
379
  }, f.prototype.onBlur = function(e) {
380
380
  var t = this, r = t.props, o = t.state, s = r.format, i = r.onBlur, n = r.allowLeadingZeros, l = o.numAsString, p = o.value;
381
381
  if (this.focusedElm = null, clearTimeout(this.focusTimeout), clearTimeout(this.caretPositionTimeout), !s) {
382
- isNaN(parseFloat(l)) && (l = ""), n || (l = ve(l));
382
+ isNaN(parseFloat(l)) && (l = ""), n || (l = ge(l));
383
383
  var c = this.formatNumString(l);
384
384
  if (c !== p) {
385
385
  this.updateValue({
@@ -397,38 +397,38 @@ var Ne = {
397
397
  }, f.prototype.onKeyDown = function(e) {
398
398
  var t = e.target, r = e.key, o = t.selectionStart, s = t.selectionEnd, i = t.value;
399
399
  i === void 0 && (i = "");
400
- var n, l = this.props, p = l.decimalScale, c = l.fixedDecimalScale, h = l.prefix, m = l.suffix, d = l.format, g = l.onKeyDown, y = p !== void 0 && c, x = this.getNumberRegex(!1, y), w = new RegExp("-"), P = typeof d == "string";
400
+ var n, l = this.props, p = l.decimalScale, c = l.fixedDecimalScale, h = l.prefix, m = l.suffix, d = l.format, v = l.onKeyDown, x = p !== void 0 && c, b = this.getNumberRegex(!1, x), w = new RegExp("-"), P = typeof d == "string";
401
401
  if (this.selectionBeforeInput = {
402
402
  selectionStart: o,
403
403
  selectionEnd: s
404
404
  }, r === "ArrowLeft" || r === "Backspace" ? n = o - 1 : r === "ArrowRight" ? n = o + 1 : r === "Delete" && (n = o), n === void 0 || o !== s) {
405
- g(e);
405
+ v(e);
406
406
  return;
407
407
  }
408
- var v = n, N = P ? d.indexOf("#") : h.length, F = P ? d.lastIndexOf("#") + 1 : i.length - m.length;
408
+ var g = n, N = P ? d.indexOf("#") : h.length, F = P ? d.lastIndexOf("#") + 1 : i.length - m.length;
409
409
  if (r === "ArrowLeft" || r === "ArrowRight") {
410
- var E = r === "ArrowLeft" ? "left" : "right";
411
- v = this.correctCaretPosition(i, n, E);
412
- } else if (r === "Delete" && !x.test(i[n]) && !w.test(i[n]))
413
- for (; !x.test(i[v]) && v < F; )
414
- v++;
415
- else if (r === "Backspace" && !x.test(i[n])) {
410
+ var T = r === "ArrowLeft" ? "left" : "right";
411
+ g = this.correctCaretPosition(i, n, T);
412
+ } else if (r === "Delete" && !b.test(i[n]) && !w.test(i[n]))
413
+ for (; !b.test(i[g]) && g < F; )
414
+ g++;
415
+ else if (r === "Backspace" && !b.test(i[n])) {
416
416
  if (o <= N + 1 && i[0] === "-" && typeof d > "u") {
417
- var T = i.substring(1);
417
+ var $ = i.substring(1);
418
418
  this.updateValue({
419
- formattedValue: T,
420
- caretPos: v,
419
+ formattedValue: $,
420
+ caretPos: g,
421
421
  input: t,
422
422
  event: e,
423
423
  source: "event"
424
424
  });
425
425
  } else if (!w.test(i[n])) {
426
- for (; !x.test(i[v - 1]) && v > N; )
427
- v--;
428
- v = this.correctCaretPosition(i, v, "left");
426
+ for (; !b.test(i[g - 1]) && g > N; )
427
+ g--;
428
+ g = this.correctCaretPosition(i, g, "left");
429
429
  }
430
430
  }
431
- (v !== n || n < N || n > F) && (e.preventDefault(), this.setPatchedCaretPosition(t, v, i)), e.isUnitTestRun && this.setPatchedCaretPosition(t, v, i), g(e);
431
+ (g !== n || n < N || n > F) && (e.preventDefault(), this.setPatchedCaretPosition(t, g, i)), e.isUnitTestRun && this.setPatchedCaretPosition(t, g, i), v(e);
432
432
  }, f.prototype.onMouseUp = function(e) {
433
433
  var t = e.target, r = t.selectionStart, o = t.selectionEnd, s = t.value;
434
434
  if (s === void 0 && (s = ""), r === o) {
@@ -447,7 +447,7 @@ var Ne = {
447
447
  }, f.prototype.render = function() {
448
448
  var e = this.props, t = e.type, r = e.displayType, o = e.customInput, s = e.renderText, i = e.getInputRef, n = e.format;
449
449
  e.thousandSeparator, e.decimalSeparator, e.allowedDecimalSeparators, e.thousandsGroupStyle, e.decimalScale, e.fixedDecimalScale, e.prefix, e.suffix, e.removeFormatting, e.mask, e.defaultValue, e.isNumericString, e.allowNegative, e.allowEmptyFormatting, e.allowLeadingZeros, e.onValueChange, e.isAllowed, e.customNumerals, e.onChange, e.onKeyDown, e.onMouseUp, e.onFocus, e.onBlur, e.value;
450
- var l = be(e, ["type", "displayType", "customInput", "renderText", "getInputRef", "format", "thousandSeparator", "decimalSeparator", "allowedDecimalSeparators", "thousandsGroupStyle", "decimalScale", "fixedDecimalScale", "prefix", "suffix", "removeFormatting", "mask", "defaultValue", "isNumericString", "allowNegative", "allowEmptyFormatting", "allowLeadingZeros", "onValueChange", "isAllowed", "customNumerals", "onChange", "onKeyDown", "onMouseUp", "onFocus", "onBlur", "value"]), p = l, c = this.state, h = c.value, m = c.mounted, d = m && xe(n) ? "numeric" : void 0, g = Object.assign({ inputMode: d }, p, {
450
+ var l = be(e, ["type", "displayType", "customInput", "renderText", "getInputRef", "format", "thousandSeparator", "decimalSeparator", "allowedDecimalSeparators", "thousandsGroupStyle", "decimalScale", "fixedDecimalScale", "prefix", "suffix", "removeFormatting", "mask", "defaultValue", "isNumericString", "allowNegative", "allowEmptyFormatting", "allowLeadingZeros", "onValueChange", "isAllowed", "customNumerals", "onChange", "onKeyDown", "onMouseUp", "onFocus", "onBlur", "value"]), p = l, c = this.state, h = c.value, m = c.mounted, d = m && xe(n) ? "numeric" : void 0, v = Object.assign({ inputMode: d }, p, {
451
451
  type: t,
452
452
  value: h,
453
453
  onChange: this.onChange,
@@ -457,25 +457,25 @@ var Ne = {
457
457
  onBlur: this.onBlur
458
458
  });
459
459
  if (r === "text")
460
- return s ? s(h, p) || null : j.createElement(
460
+ return s ? s(h, p) || null : B.createElement(
461
461
  "span",
462
462
  Object.assign({}, p, { ref: i }),
463
463
  h
464
464
  );
465
465
  if (o) {
466
- var y = o;
467
- return j.createElement(y, Object.assign({}, g, { ref: i }));
466
+ var x = o;
467
+ return B.createElement(x, Object.assign({}, v, { ref: i }));
468
468
  }
469
- return j.createElement("input", Object.assign({}, g, { ref: i }));
469
+ return B.createElement("input", Object.assign({}, v, { ref: i }));
470
470
  }, f;
471
- }(j.Component);
471
+ }(B.Component);
472
472
  X.defaultProps = Ne;
473
473
  const we = G.div`
474
474
  display: flex;
475
475
  align-items: center;
476
476
 
477
- min-height: ${(a) => B(a.theme, a.size)};
478
- max-height: ${(a) => B(a.theme, a.size)};
477
+ min-height: ${(a) => M(a.theme, a.size)};
478
+ max-height: ${(a) => M(a.theme, a.size)};
479
479
  background-color: ${(a) => R(
480
480
  a.theme,
481
481
  "Input",
@@ -512,8 +512,8 @@ const we = G.div`
512
512
  width: 100%;
513
513
 
514
514
  ${(a) => ce(a.theme, "Input", a.size, "enabled")}
515
- min-height: ${(a) => B(a.theme, a.size)};
516
- max-height: ${(a) => B(a.theme, a.size)};
515
+ min-height: ${(a) => M(a.theme, a.size)};
516
+ max-height: ${(a) => M(a.theme, a.size)};
517
517
  color: ${(a) => R(
518
518
  a.theme,
519
519
  "Input",
@@ -571,31 +571,31 @@ const we = G.div`
571
571
  onBlur: m,
572
572
  onFocus: d,
573
573
  //----------------
574
- className: g = "",
575
- style: y = {},
576
- size: x = "small",
574
+ className: v = "",
575
+ style: x = {},
576
+ size: b = "small",
577
577
  color: w = "primary",
578
578
  ...P
579
- } = a, v = pe(), [N, F] = ne(!1), E = se(
580
- fe((b, D) => T(b, D), t),
579
+ } = a, g = pe(), [N, F] = ne(!1), T = se(
580
+ fe((y, D) => $(y, D), t),
581
581
  [c]
582
- ), T = (b, D) => {
583
- c && (c == null || c(b, D));
584
- }, I = (b, D) => {
585
- E(D.event, _value);
586
- }, M = () => n < 0 ? 0 : n > 17 ? 17 : n, k = (b) => {
587
- F(!0), d == null || d(b);
588
- }, A = (b) => {
589
- F(!1), m == null || m(b);
582
+ ), $ = (y, D) => {
583
+ c && (c == null || c(y, D));
584
+ }, O = (y, D) => {
585
+ T(D.event, y == null ? void 0 : y.floatValue);
586
+ }, j = () => n < 0 ? 0 : n > 17 ? 17 : n, k = (y) => {
587
+ F(!0), d == null || d(y);
588
+ }, A = (y) => {
589
+ F(!1), m == null || m(y);
590
590
  };
591
591
  return /* @__PURE__ */ ie(
592
592
  we,
593
593
  {
594
- style: y,
595
- className: g,
596
- theme: v,
594
+ style: x,
595
+ className: v,
596
+ theme: g,
597
597
  color: w,
598
- size: x,
598
+ size: b,
599
599
  prefix: r,
600
600
  suffix: o,
601
601
  focused: N,
@@ -605,7 +605,7 @@ const we = G.div`
605
605
  r && /* @__PURE__ */ K(
606
606
  Y,
607
607
  {
608
- theme: v,
608
+ theme: g,
609
609
  color: w,
610
610
  focused: N,
611
611
  className: "lnc-input-prefix",
@@ -621,19 +621,19 @@ const we = G.div`
621
621
  readOnly: e,
622
622
  thousandSeparator: s,
623
623
  decimalSeparator: i,
624
- decimalScale: M(),
624
+ decimalScale: j(),
625
625
  fixedDecimalScale: l,
626
626
  allowNegative: p,
627
627
  onFocus: k,
628
628
  onBlur: A,
629
- onValueChange: I,
629
+ onValueChange: O,
630
630
  ...P
631
631
  }
632
632
  ),
633
633
  o && /* @__PURE__ */ K(
634
634
  De,
635
635
  {
636
- theme: v,
636
+ theme: g,
637
637
  color: w,
638
638
  focused: N,
639
639
  className: "lnc-input-suffix",
package/dist/Modal.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";const t=require("react/jsx-runtime"),y=require("react"),o=require("./index-BIlhCoy2.cjs"),j=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),_=require("./Icon.cjs"),w=require("./utils-DTAPpJXU.cjs"),D=require("./index-Ct1N7fF4.cjs"),L=require("./motion-Oud-wpUz.cjs"),V=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs"),E=require("./index-BP5r5zGN.cjs"),x="5rem",h="3.8rem",l="1.5rem",G=(e,r,n)=>r&&n?e=="FULL"?`calc(100dvh - ${h} - ${x})`:`calc(100dvh - ${h} - ${x} - ${l})`:r?e=="FULL"?`calc(100dvh - ${h})`:`calc(100dvh - ${h} - ${l})`:n?e=="FULL"?`calc(100dvh - ${x})`:`calc(100dvh - ${x} - ${l})`:e=="FULL"?"100dvh":`calc(100dvh - ${l})`,W=e=>e=="FULL"?"100vw":`calc(100vw - ${l})`,X=(e,r,n)=>e=="FULL"?"0":`${r?"0":"16px"} 0 ${n?"0":"16px"} 0`,J=j.newStyled(L.motion.div)`
1
+ "use strict";const t=require("react/jsx-runtime"),y=require("react"),o=require("./index-BIlhCoy2.cjs"),C=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),D=require("./Icon.cjs"),j=require("./utils-DTAPpJXU.cjs"),V=require("./index-Ct1N7fF4.cjs"),L=require("./motion-Oud-wpUz.cjs"),G=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs"),I=require("./index-BP5r5zGN.cjs"),x="5rem",h="3.8rem",i="1.5rem",W=(e,r,n)=>r&&n?e=="FULL"?`calc(100dvh - ${h} - ${x})`:`calc(100dvh - ${h} - ${x} - ${i})`:r?e=="FULL"?`calc(100dvh - ${h})`:`calc(100dvh - ${h} - ${i})`:n?e=="FULL"?`calc(100dvh - ${x})`:`calc(100dvh - ${x} - ${i})`:e=="FULL"?"100dvh":`calc(100dvh - ${i})`,X=e=>e=="FULL"?"100vw":`calc(100vw - ${i})`,J=(e,r,n)=>e=="FULL"?"0":`${r?"0":"16px"} 0 ${n?"0":"16px"} 0`,K=C.newStyled(L.motion.div)`
2
2
  position: ${e=>e.scrollOverlay==!0?"absolute":"fixed"};
3
3
  top: 0;
4
4
  left: 0;
@@ -7,15 +7,15 @@
7
7
  background: ${e=>e.scrollOverlay===!0?"transparent":e.overlayColor};
8
8
  z-index: ${e=>e.zIndex};
9
9
  display: flex;
10
- `,K=j.newStyled(L.motion.div)`
10
+ `,Q=C.newStyled(L.motion.div)`
11
11
  position: relative;
12
12
  width: 50%;
13
13
  background-color: white;
14
14
  ${e=>e.scrollOverlay==!1?"position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);":"height: fit-content; margin-right: auto; margin-left: auto;"}
15
- background-color: ${e=>w.getColorRgbaValue(e.theme,"Modal","default","enabled","bg")};
15
+ background-color: ${e=>j.getColorRgbaValue(e.theme,"Modal","default","enabled","bg")};
16
16
  z-index: ${e=>e.zIndex};
17
- width: ${e=>Z[e.size.toUpperCase()]};
18
- max-width: ${e=>W(e.size.toUpperCase())};
17
+ width: ${e=>ee[e.size.toUpperCase()]};
18
+ max-width: ${e=>X(e.size.toUpperCase())};
19
19
  box-shadow: 0px 20px 25px -5px rgba(0, 0, 0, 0.1),
20
20
  0px 10px 10px -5px rgba(0, 0, 0, 0.04);
21
21
  border-radius: ${e=>e.size.toUpperCase()!="FULL"?"16px":"0"};
@@ -26,7 +26,7 @@
26
26
  & .lnc-modal-header {
27
27
  max-height: ${h};
28
28
  overflow: hidden;
29
- padding: ${l} ${l} 0 ${l};
29
+ padding: ${i} ${i} 0 ${i};
30
30
  }
31
31
  & .lnc-modal-header > h1,
32
32
  h2,
@@ -45,17 +45,17 @@
45
45
  flex-direction: column;
46
46
  justify-content: space-between;
47
47
  scrollbar-width: thin;
48
- ${e=>e.scrollOverlay==!1&&`max-height: ${G(e.size.toUpperCase(),e.header,e.footer)};`}
48
+ ${e=>e.scrollOverlay==!1&&`max-height: ${W(e.size.toUpperCase(),e.header,e.footer)};`}
49
49
  overflow: auto;
50
- margin: ${e=>X(e.size,e.header,e.footer)};
51
- padding: 0 ${l} 0 ${l};
50
+ margin: ${e=>J(e.size,e.header,e.footer)};
51
+ padding: 0 ${i} 0 ${i};
52
52
  }
53
- `,Q=j.newStyled.div`
53
+ `,Y=C.newStyled.div`
54
54
  position: absolute;
55
55
  cursor: pointer;
56
56
  top: 1.375rem;
57
57
  right: 1.375rem;
58
- color: ${e=>w.getColorRgbaValue(e.theme,"Modal","primary","enabled","cancelButton")};
58
+ color: ${e=>j.getColorRgbaValue(e.theme,"Modal","primary","enabled","cancelButton")};
59
59
  height: 1.5rem;
60
60
  width: 1.5rem;
61
61
  display: flex;
@@ -67,12 +67,12 @@
67
67
  }
68
68
 
69
69
  &:hover {
70
- background-color: ${e=>w.getColorRgbaValue(e.theme,"Modal","primary","hover","cancelBtnBg","cancelBtnBgOpacity")};
70
+ background-color: ${e=>j.getColorRgbaValue(e.theme,"Modal","primary","hover","cancelBtnBg","cancelBtnBgOpacity")};
71
71
  }
72
72
  &:focus {
73
- background-color: ${e=>w.getColorRgbaValue(e.theme,"Modal","primary","focus","cancelBtnBg","cancelBtnBgOpacity")};
73
+ background-color: ${e=>j.getColorRgbaValue(e.theme,"Modal","primary","focus","cancelBtnBg","cancelBtnBgOpacity")};
74
74
  }
75
- `,Y=j.newStyled(L.motion.div)`
75
+ `,Z=C.newStyled(L.motion.div)`
76
76
  display: ${e=>e.scrollOverlay===!0?"block":"none"};
77
77
  position: fixed;
78
78
  top: 0;
@@ -81,4 +81,4 @@
81
81
  width: 100%;
82
82
  background-color: ${e=>e.overlayColor};
83
83
  z-index: 3;
84
- `,N=y.forwardRef((e,r)=>{const{portalElement:n=document.body,isOpen:s=!1,header:d,footer:a,scrollOverlay:i=!1,overlay:c=!0,overlayColor:p="rgba(0, 0, 0, 0.3)",showCloseButton:u=!0,onOpen:f=()=>{},onClose:g=()=>{},zIndex:C=1e3,size:$="fluid",clickOutsideToClose:v=!0,className:b="",style:A={},overlayProps:O,overlayAnimation:P={animate:{opacity:1},exit:{opacity:0},initial:{opacity:0},transition:{type:"spring",duration:.6}},modalAnimation:F={animate:{opacity:1},exit:{opacity:0},initial:{opacity:0},transition:{type:"spring",duration:.6}},children:U,rest:z}=e,M=y.useRef(),[R,k]=y.useState(s);let B={theme:V.useTheme(),size:$,zIndex:C,className:b,style:A};const S=m=>{m.target===m.currentTarget&&v&&T(m)};y.useImperativeHandle(r,()=>({open(){H()},close(){T()},isOpen(){return R}}));const H=m=>{k(!0),f(m)},T=m=>{k(!1),g(m)};return t.jsx(t.Fragment,{children:R&&t.jsx(t.Fragment,{children:n?t.jsx(t.Fragment,{children:D.reactDomExports.createPortal(t.jsx(q,{ref:M,overlay:c,scrollOverlay:i,onClickOutsideModal:S,overlayColor:p,overlayProps:O,overlayAnimation:P,modalAnimation:F,themeProps:B,showCloseButton:u,close:T,header:d,footer:a,isOpen:s,...z,children:U}),n)}):t.jsx(q,{ref:M,overlay:c,scrollOverlay:i,onClickOutsideModal:S,overlayColor:p,overlayProps:O,overlayAnimation:P,modalAnimation:F,themeProps:B,showCloseButton:u,close:T,header:d,footer:a,isOpen:s,...z,children:U})})})}),q=y.forwardRef(({overlay:e,scrollOverlay:r,onClickOutsideModal:n,overlayColor:s,overlayProps:d,overlayAnimation:a,modalAnimation:i,themeProps:c,showCloseButton:p,header:u,footer:f,close:g,isOpen:C,children:$,...v},b)=>t.jsx(E.AnimatePresence,{children:e?t.jsxs(t.Fragment,{children:[t.jsx(Y,{scrollOverlay:r,onClick:n,overlayColor:s,...d,...a}),t.jsx(J,{...c,onClick:n,scrollOverlay:r,overlayColor:s,isOpen:C,...d,...a,children:t.jsx(I,{ref:b,themeProps:c,scrollOverlay:r,modalAnimation:i,showCloseButton:p,close:g,header:u,footer:f,...v,children:$})})]}):t.jsx(I,{ref:b,themeProps:c,modalAnimation:i,showCloseButton:p,close:g,header:u,footer:f,...v,children:$})})),I=y.forwardRef(({themeProps:e,scrollOverlay:r,modalAnimation:n,showCloseButton:s,close:d,header:a,footer:i,children:c,...p},u)=>t.jsx(E.AnimatePresence,{children:t.jsxs(K,{ref:u,...e,...n,header:a,footer:i,scrollOverlay:r,...p,className:`modal-lnc-container ${e==null?void 0:e.className}`,children:[s&&t.jsx(Q,{...e,className:"modal-lnc-times",onClick:d,children:t.jsx(_,{icon:"times"})}),a&&t.jsx("div",{className:"lnc-modal-header",children:a}),t.jsx("div",{className:"lnc-modal-content",children:c}),i&&t.jsx("div",{className:"lnc-modal-footer",children:i})]})}));N.propTypes={portalElement:o.PropTypes.any,isOpen:o.PropTypes.bool,header:o.PropTypes.oneOfType([o.PropTypes.string,o.PropTypes.element]),footer:o.PropTypes.oneOfType([o.PropTypes.string,o.PropTypes.element]),showCloseButton:o.PropTypes.bool,overlay:o.PropTypes.bool,scrollOverlay:o.PropTypes.bool,onOpen:o.PropTypes.func,onClose:o.PropTypes.func,zIndex:o.PropTypes.number,clickOutsideToClose:o.PropTypes.bool,overlayColor:o.PropTypes.string,overlayAnimation:o.PropTypes.object,modalAnimation:o.PropTypes.object,className:o.PropTypes.string,style:o.PropTypes.object,size:o.PropTypes.oneOf(["fluid","xs","s","m","l","xl","full"]),overlayProps:o.PropTypes.any};const Z={FLUID:"max-content",XS:"320px",S:"412px",M:"672px",L:"1112px",XL:"1376px",FULL:"100vw"};module.exports=N;
84
+ `,N=y.forwardRef((e,r)=>{const{portalElement:n=document.body,isOpen:s=!1,header:d,footer:l,scrollOverlay:a=!1,overlay:c=!0,overlayColor:p="rgba(0, 0, 0, 0.3)",showCloseButton:u=!0,onOpen:f=()=>{},onClose:g=()=>{},zIndex:O=1e3,size:$="fluid",clickOutsideToClose:v=!0,className:b="",style:A={},overlayProps:P,overlayAnimation:F={animate:{opacity:1},exit:{opacity:0},initial:{opacity:0},transition:{type:"spring",duration:.6}},modalAnimation:U={animate:{opacity:1},exit:{opacity:0},initial:{opacity:0},transition:{type:"spring",duration:.6}},onFinishOpen:H=()=>{},children:z,rest:M}=e,R=y.useRef(),[T,k]=y.useState(s);let B={theme:G.useTheme(),size:$,zIndex:O,className:b,style:A};const S=m=>{m.target===m.currentTarget&&v&&w(m)};y.useImperativeHandle(r,()=>({open(){_()},close(){w()},isOpen(){return T}}));const _=m=>{k(!0),f(m)},w=m=>{k(!1),g(m)};return y.useEffect(()=>{T===!0&&H()},[T]),t.jsx(t.Fragment,{children:T&&t.jsx(t.Fragment,{children:n?t.jsx(t.Fragment,{children:V.reactDomExports.createPortal(t.jsx(q,{ref:R,overlay:c,scrollOverlay:a,onClickOutsideModal:S,overlayColor:p,overlayProps:P,overlayAnimation:F,modalAnimation:U,themeProps:B,showCloseButton:u,close:w,header:d,footer:l,isOpen:s,...M,children:z}),n)}):t.jsx(q,{ref:R,overlay:c,scrollOverlay:a,onClickOutsideModal:S,overlayColor:p,overlayProps:P,overlayAnimation:F,modalAnimation:U,themeProps:B,showCloseButton:u,close:w,header:d,footer:l,isOpen:s,...M,children:z})})})}),q=y.forwardRef(({overlay:e,scrollOverlay:r,onClickOutsideModal:n,overlayColor:s,overlayProps:d,overlayAnimation:l,modalAnimation:a,themeProps:c,showCloseButton:p,header:u,footer:f,close:g,isOpen:O,children:$,...v},b)=>t.jsx(I.AnimatePresence,{children:e?t.jsxs(t.Fragment,{children:[t.jsx(Z,{scrollOverlay:r,onClick:n,overlayColor:s,...d,...l}),t.jsx(K,{...c,onClick:n,scrollOverlay:r,overlayColor:s,isOpen:O,...d,...l,children:t.jsx(E,{ref:b,themeProps:c,scrollOverlay:r,modalAnimation:a,showCloseButton:p,close:g,header:u,footer:f,...v,children:$})})]}):t.jsx(E,{ref:b,themeProps:c,modalAnimation:a,showCloseButton:p,close:g,header:u,footer:f,...v,children:$})})),E=y.forwardRef(({themeProps:e,scrollOverlay:r,modalAnimation:n,showCloseButton:s,close:d,header:l,footer:a,children:c,...p},u)=>t.jsx(I.AnimatePresence,{children:t.jsxs(Q,{ref:u,...e,...n,header:l,footer:a,scrollOverlay:r,...p,className:`modal-lnc-container ${e==null?void 0:e.className}`,children:[s&&t.jsx(Y,{...e,className:"modal-lnc-times",onClick:d,children:t.jsx(D,{icon:"times"})}),l&&t.jsx("div",{className:"lnc-modal-header",children:l}),t.jsx("div",{className:"lnc-modal-content",children:c}),a&&t.jsx("div",{className:"lnc-modal-footer",children:a})]})}));N.propTypes={portalElement:o.PropTypes.any,isOpen:o.PropTypes.bool,header:o.PropTypes.oneOfType([o.PropTypes.string,o.PropTypes.element]),footer:o.PropTypes.oneOfType([o.PropTypes.string,o.PropTypes.element]),showCloseButton:o.PropTypes.bool,overlay:o.PropTypes.bool,scrollOverlay:o.PropTypes.bool,onOpen:o.PropTypes.func,onClose:o.PropTypes.func,zIndex:o.PropTypes.number,clickOutsideToClose:o.PropTypes.bool,overlayColor:o.PropTypes.string,overlayAnimation:o.PropTypes.object,modalAnimation:o.PropTypes.object,className:o.PropTypes.string,style:o.PropTypes.object,size:o.PropTypes.oneOf(["fluid","xs","s","m","l","xl","full"]),overlayProps:o.PropTypes.any};const ee={FLUID:"max-content",XS:"320px",S:"412px",M:"672px",L:"1112px",XL:"1376px",FULL:"100vw"};module.exports=N;
package/dist/Modal.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import { jsx as t, Fragment as L, jsxs as D } from "react/jsx-runtime";
2
- import { forwardRef as U, useRef as W, useState as X, useImperativeHandle as V } from "react";
2
+ import { forwardRef as z, useRef as X, useState as V, useImperativeHandle as q, useEffect as J } from "react";
3
3
  import { P as o } from "./index-BYnWp42a.js";
4
- import { n as w } from "./emotion-styled.browser.esm-BiK8DcgW.js";
5
- import q from "./Icon.js";
6
- import { a as O } from "./utils-C52T57HO.js";
7
- import { r as J } from "./index--Kmch3aI.js";
8
- import { m as z } from "./motion-ecIGZGwI.js";
9
- import { u as K } from "./emotion-element-5486c51c.browser.esm-Bb4VkP8U.js";
4
+ import { n as C } from "./emotion-styled.browser.esm-BiK8DcgW.js";
5
+ import K from "./Icon.js";
6
+ import { a as w } from "./utils-C52T57HO.js";
7
+ import { r as Q } from "./index--Kmch3aI.js";
8
+ import { m as M } from "./motion-ecIGZGwI.js";
9
+ import { u as Y } from "./emotion-element-5486c51c.browser.esm-Bb4VkP8U.js";
10
10
  import { A as R } from "./index-BUChtubz.js";
11
- const f = "5rem", h = "3.8rem", a = "1.5rem", Q = (e, r, n) => r && n ? e == "FULL" ? `calc(100dvh - ${h} - ${f})` : `calc(100dvh - ${h} - ${f} - ${a})` : r ? e == "FULL" ? `calc(100dvh - ${h})` : `calc(100dvh - ${h} - ${a})` : n ? e == "FULL" ? `calc(100dvh - ${f})` : `calc(100dvh - ${f} - ${a})` : e == "FULL" ? "100dvh" : `calc(100dvh - ${a})`, Y = (e) => e == "FULL" ? "100vw" : `calc(100vw - ${a})`, Z = (e, r, n) => e == "FULL" ? "0" : `${r ? "0" : "16px"} 0 ${n ? "0" : "16px"} 0`, P = w(z.div)`
11
+ const f = "5rem", h = "3.8rem", a = "1.5rem", Z = (e, n, r) => n && r ? e == "FULL" ? `calc(100dvh - ${h} - ${f})` : `calc(100dvh - ${h} - ${f} - ${a})` : n ? e == "FULL" ? `calc(100dvh - ${h})` : `calc(100dvh - ${h} - ${a})` : r ? e == "FULL" ? `calc(100dvh - ${f})` : `calc(100dvh - ${f} - ${a})` : e == "FULL" ? "100dvh" : `calc(100dvh - ${a})`, P = (e) => e == "FULL" ? "100vw" : `calc(100vw - ${a})`, ee = (e, n, r) => e == "FULL" ? "0" : `${n ? "0" : "16px"} 0 ${r ? "0" : "16px"} 0`, oe = C(M.div)`
12
12
  position: ${(e) => e.scrollOverlay == !0 ? "absolute" : "fixed"};
13
13
  top: 0;
14
14
  left: 0;
@@ -17,15 +17,15 @@ const f = "5rem", h = "3.8rem", a = "1.5rem", Q = (e, r, n) => r && n ? e == "FU
17
17
  background: ${(e) => e.scrollOverlay === !0 ? "transparent" : e.overlayColor};
18
18
  z-index: ${(e) => e.zIndex};
19
19
  display: flex;
20
- `, ee = w(z.div)`
20
+ `, te = C(M.div)`
21
21
  position: relative;
22
22
  width: 50%;
23
23
  background-color: white;
24
24
  ${(e) => e.scrollOverlay == !1 ? "position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);" : "height: fit-content; margin-right: auto; margin-left: auto;"}
25
- background-color: ${(e) => O(e.theme, "Modal", "default", "enabled", "bg")};
25
+ background-color: ${(e) => w(e.theme, "Modal", "default", "enabled", "bg")};
26
26
  z-index: ${(e) => e.zIndex};
27
- width: ${(e) => ne[e.size.toUpperCase()]};
28
- max-width: ${(e) => Y(e.size.toUpperCase())};
27
+ width: ${(e) => le[e.size.toUpperCase()]};
28
+ max-width: ${(e) => P(e.size.toUpperCase())};
29
29
  box-shadow: 0px 20px 25px -5px rgba(0, 0, 0, 0.1),
30
30
  0px 10px 10px -5px rgba(0, 0, 0, 0.04);
31
31
  border-radius: ${(e) => e.size.toUpperCase() != "FULL" ? "16px" : "0"};
@@ -55,21 +55,21 @@ const f = "5rem", h = "3.8rem", a = "1.5rem", Q = (e, r, n) => r && n ? e == "FU
55
55
  flex-direction: column;
56
56
  justify-content: space-between;
57
57
  scrollbar-width: thin;
58
- ${(e) => e.scrollOverlay == !1 && `max-height: ${Q(
58
+ ${(e) => e.scrollOverlay == !1 && `max-height: ${Z(
59
59
  e.size.toUpperCase(),
60
60
  e.header,
61
61
  e.footer
62
62
  )};`}
63
63
  overflow: auto;
64
- margin: ${(e) => Z(e.size, e.header, e.footer)};
64
+ margin: ${(e) => ee(e.size, e.header, e.footer)};
65
65
  padding: 0 ${a} 0 ${a};
66
66
  }
67
- `, oe = w.div`
67
+ `, ne = C.div`
68
68
  position: absolute;
69
69
  cursor: pointer;
70
70
  top: 1.375rem;
71
71
  right: 1.375rem;
72
- color: ${(e) => O(
72
+ color: ${(e) => w(
73
73
  e.theme,
74
74
  "Modal",
75
75
  "primary",
@@ -87,7 +87,7 @@ const f = "5rem", h = "3.8rem", a = "1.5rem", Q = (e, r, n) => r && n ? e == "FU
87
87
  }
88
88
 
89
89
  &:hover {
90
- background-color: ${(e) => O(
90
+ background-color: ${(e) => w(
91
91
  e.theme,
92
92
  "Modal",
93
93
  "primary",
@@ -97,7 +97,7 @@ const f = "5rem", h = "3.8rem", a = "1.5rem", Q = (e, r, n) => r && n ? e == "FU
97
97
  )};
98
98
  }
99
99
  &:focus {
100
- background-color: ${(e) => O(
100
+ background-color: ${(e) => w(
101
101
  e.theme,
102
102
  "Modal",
103
103
  "primary",
@@ -106,7 +106,7 @@ const f = "5rem", h = "3.8rem", a = "1.5rem", Q = (e, r, n) => r && n ? e == "FU
106
106
  "cancelBtnBgOpacity"
107
107
  )};
108
108
  }
109
- `, te = w(z.div)`
109
+ `, re = C(M.div)`
110
110
  display: ${(e) => e.scrollOverlay === !0 ? "block" : "none"};
111
111
  position: fixed;
112
112
  top: 0;
@@ -115,9 +115,9 @@ const f = "5rem", h = "3.8rem", a = "1.5rem", Q = (e, r, n) => r && n ? e == "FU
115
115
  width: 100%;
116
116
  background-color: ${(e) => e.overlayColor};
117
117
  z-index: 3;
118
- `, re = U((e, r) => {
118
+ `, ae = z((e, n) => {
119
119
  const {
120
- portalElement: n = document.body,
120
+ portalElement: r = document.body,
121
121
  isOpen: c = !1,
122
122
  header: d,
123
123
  footer: l,
@@ -129,12 +129,12 @@ const f = "5rem", h = "3.8rem", a = "1.5rem", Q = (e, r, n) => r && n ? e == "FU
129
129
  },
130
130
  onClose: x = () => {
131
131
  },
132
- zIndex: C = 1e3,
132
+ zIndex: U = 1e3,
133
133
  size: y = "fluid",
134
134
  clickOutsideToClose: $ = !0,
135
135
  className: v = "",
136
136
  style: G = {},
137
- overlayProps: M,
137
+ overlayProps: F,
138
138
  overlayAnimation: k = {
139
139
  animate: { opacity: 1 },
140
140
  exit: { opacity: 0 },
@@ -143,7 +143,7 @@ const f = "5rem", h = "3.8rem", a = "1.5rem", Q = (e, r, n) => r && n ? e == "FU
143
143
  },
144
144
  transition: { type: "spring", duration: 0.6 }
145
145
  },
146
- modalAnimation: F = {
146
+ modalAnimation: B = {
147
147
  animate: { opacity: 1 },
148
148
  exit: { opacity: 0 },
149
149
  initial: {
@@ -151,78 +151,82 @@ const f = "5rem", h = "3.8rem", a = "1.5rem", Q = (e, r, n) => r && n ? e == "FU
151
151
  },
152
152
  transition: { type: "spring", duration: 0.6 }
153
153
  },
154
- children: B,
155
- rest: T
156
- } = e, I = W(), [N, E] = X(c);
157
- let j = { theme: K(), size: y, zIndex: C, className: v, style: G };
154
+ onFinishOpen: _ = () => {
155
+ },
156
+ children: T,
157
+ rest: I
158
+ } = e, E = X(), [b, N] = V(c);
159
+ let j = { theme: Y(), size: y, zIndex: U, className: v, style: G };
158
160
  const A = (u) => {
159
- u.target === u.currentTarget && $ && b(u);
161
+ u.target === u.currentTarget && $ && O(u);
160
162
  };
161
- V(r, () => ({
163
+ q(n, () => ({
162
164
  open() {
163
- _();
165
+ W();
164
166
  },
165
167
  close() {
166
- b();
168
+ O();
167
169
  },
168
170
  isOpen() {
169
- return N;
171
+ return b;
170
172
  }
171
173
  }));
172
- const _ = (u) => {
173
- E(!0), g(u);
174
- }, b = (u) => {
175
- E(!1), x(u);
174
+ const W = (u) => {
175
+ N(!0), g(u);
176
+ }, O = (u) => {
177
+ N(!1), x(u);
176
178
  };
177
- return /* @__PURE__ */ t(L, { children: N && /* @__PURE__ */ t(L, { children: n ? /* @__PURE__ */ t(L, { children: J.createPortal(
179
+ return J(() => {
180
+ b === !0 && _();
181
+ }, [b]), /* @__PURE__ */ t(L, { children: b && /* @__PURE__ */ t(L, { children: r ? /* @__PURE__ */ t(L, { children: Q.createPortal(
178
182
  /* @__PURE__ */ t(
179
183
  H,
180
184
  {
181
- ref: I,
185
+ ref: E,
182
186
  overlay: s,
183
187
  scrollOverlay: i,
184
188
  onClickOutsideModal: A,
185
189
  overlayColor: m,
186
- overlayProps: M,
190
+ overlayProps: F,
187
191
  overlayAnimation: k,
188
- modalAnimation: F,
192
+ modalAnimation: B,
189
193
  themeProps: j,
190
194
  showCloseButton: p,
191
- close: b,
195
+ close: O,
192
196
  header: d,
193
197
  footer: l,
194
198
  isOpen: c,
195
- ...T,
196
- children: B
199
+ ...I,
200
+ children: T
197
201
  }
198
202
  ),
199
- n
203
+ r
200
204
  ) }) : /* @__PURE__ */ t(
201
205
  H,
202
206
  {
203
- ref: I,
207
+ ref: E,
204
208
  overlay: s,
205
209
  scrollOverlay: i,
206
210
  onClickOutsideModal: A,
207
211
  overlayColor: m,
208
- overlayProps: M,
212
+ overlayProps: F,
209
213
  overlayAnimation: k,
210
- modalAnimation: F,
214
+ modalAnimation: B,
211
215
  themeProps: j,
212
216
  showCloseButton: p,
213
- close: b,
217
+ close: O,
214
218
  header: d,
215
219
  footer: l,
216
220
  isOpen: c,
217
- ...T,
218
- children: B
221
+ ...I,
222
+ children: T
219
223
  }
220
224
  ) }) });
221
- }), H = U(
225
+ }), H = z(
222
226
  ({
223
227
  overlay: e,
224
- scrollOverlay: r,
225
- onClickOutsideModal: n,
228
+ scrollOverlay: n,
229
+ onClickOutsideModal: r,
226
230
  overlayColor: c,
227
231
  overlayProps: d,
228
232
  overlayAnimation: l,
@@ -232,28 +236,28 @@ const f = "5rem", h = "3.8rem", a = "1.5rem", Q = (e, r, n) => r && n ? e == "FU
232
236
  header: p,
233
237
  footer: g,
234
238
  close: x,
235
- isOpen: C,
239
+ isOpen: U,
236
240
  children: y,
237
241
  ...$
238
242
  }, v) => /* @__PURE__ */ t(R, { children: e ? /* @__PURE__ */ D(L, { children: [
239
243
  /* @__PURE__ */ t(
240
- te,
244
+ re,
241
245
  {
242
- scrollOverlay: r,
243
- onClick: n,
246
+ scrollOverlay: n,
247
+ onClick: r,
244
248
  overlayColor: c,
245
249
  ...d,
246
250
  ...l
247
251
  }
248
252
  ),
249
253
  /* @__PURE__ */ t(
250
- P,
254
+ oe,
251
255
  {
252
256
  ...s,
253
- onClick: n,
254
- scrollOverlay: r,
257
+ onClick: r,
258
+ scrollOverlay: n,
255
259
  overlayColor: c,
256
- isOpen: C,
260
+ isOpen: U,
257
261
  ...d,
258
262
  ...l,
259
263
  children: /* @__PURE__ */ t(
@@ -261,7 +265,7 @@ const f = "5rem", h = "3.8rem", a = "1.5rem", Q = (e, r, n) => r && n ? e == "FU
261
265
  {
262
266
  ref: v,
263
267
  themeProps: s,
264
- scrollOverlay: r,
268
+ scrollOverlay: n,
265
269
  modalAnimation: i,
266
270
  showCloseButton: m,
267
271
  close: x,
@@ -287,11 +291,11 @@ const f = "5rem", h = "3.8rem", a = "1.5rem", Q = (e, r, n) => r && n ? e == "FU
287
291
  children: y
288
292
  }
289
293
  ) })
290
- ), S = U(
294
+ ), S = z(
291
295
  ({
292
296
  themeProps: e,
293
- scrollOverlay: r,
294
- modalAnimation: n,
297
+ scrollOverlay: n,
298
+ modalAnimation: r,
295
299
  showCloseButton: c,
296
300
  close: d,
297
301
  header: l,
@@ -299,24 +303,24 @@ const f = "5rem", h = "3.8rem", a = "1.5rem", Q = (e, r, n) => r && n ? e == "FU
299
303
  children: s,
300
304
  ...m
301
305
  }, p) => /* @__PURE__ */ t(R, { children: /* @__PURE__ */ D(
302
- ee,
306
+ te,
303
307
  {
304
308
  ref: p,
305
309
  ...e,
306
- ...n,
310
+ ...r,
307
311
  header: l,
308
312
  footer: i,
309
- scrollOverlay: r,
313
+ scrollOverlay: n,
310
314
  ...m,
311
315
  className: `modal-lnc-container ${e == null ? void 0 : e.className}`,
312
316
  children: [
313
317
  c && /* @__PURE__ */ t(
314
- oe,
318
+ ne,
315
319
  {
316
320
  ...e,
317
321
  className: "modal-lnc-times",
318
322
  onClick: d,
319
- children: /* @__PURE__ */ t(q, { icon: "times" })
323
+ children: /* @__PURE__ */ t(K, { icon: "times" })
320
324
  }
321
325
  ),
322
326
  l && /* @__PURE__ */ t("div", { className: "lnc-modal-header", children: l }),
@@ -326,7 +330,7 @@ const f = "5rem", h = "3.8rem", a = "1.5rem", Q = (e, r, n) => r && n ? e == "FU
326
330
  }
327
331
  ) })
328
332
  );
329
- re.propTypes = {
333
+ ae.propTypes = {
330
334
  /**
331
335
  * If the value is given modal will use createPortal to be rendered in portalElement
332
336
  */
@@ -358,7 +362,7 @@ re.propTypes = {
358
362
  size: o.oneOf(["fluid", "xs", "s", "m", "l", "xl", "full"]),
359
363
  overlayProps: o.any
360
364
  };
361
- const ne = {
365
+ const le = {
362
366
  FLUID: "max-content",
363
367
  XS: "320px",
364
368
  S: "412px",
@@ -368,5 +372,5 @@ const ne = {
368
372
  FULL: "100vw"
369
373
  };
370
374
  export {
371
- re as default
375
+ ae as default
372
376
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lanaco/lnc-react-ui",
3
- "version": "4.0.12",
3
+ "version": "4.0.14",
4
4
  "description": "React component library",
5
5
  "type": "module",
6
6
  "keywords": [