@lanaco/lnc-react-ui 3.11.35 → 4.0.2

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.
Files changed (218) hide show
  1. package/README.md +0 -3
  2. package/dist/Accordion.cjs +6 -0
  3. package/dist/Accordion.js +65 -0
  4. package/dist/AccordionDetails.cjs +7 -0
  5. package/dist/AccordionDetails.js +32 -0
  6. package/dist/AccordionSummary.cjs +12 -0
  7. package/dist/AccordionSummary.js +78 -0
  8. package/dist/ActionsToolbar.cjs +19 -0
  9. package/dist/ActionsToolbar.js +225 -0
  10. package/dist/Alert.cjs +40 -0
  11. package/dist/Alert.js +138 -0
  12. package/dist/Avatar.cjs +16 -0
  13. package/dist/Avatar.js +114 -0
  14. package/dist/Badge.cjs +17 -0
  15. package/dist/Badge.js +70 -0
  16. package/dist/Breadcrumbs.cjs +8 -0
  17. package/dist/Breadcrumbs.js +131 -0
  18. package/dist/Button.cjs +127 -0
  19. package/dist/Button.js +542 -0
  20. package/dist/ButtonGroup.cjs +44 -0
  21. package/dist/ButtonGroup.js +112 -0
  22. package/dist/CheckBoxInput.cjs +118 -0
  23. package/dist/CheckBoxInput.js +348 -0
  24. package/dist/Chip.cjs +27 -0
  25. package/dist/Chip.js +189 -0
  26. package/dist/ColorInput.cjs +60 -0
  27. package/dist/ColorInput.js +256 -0
  28. package/dist/ConfirmationForm.cjs +22 -0
  29. package/dist/ConfirmationForm.js +169 -0
  30. package/dist/Content.cjs +1 -0
  31. package/dist/Content.js +18 -0
  32. package/dist/CustomStyles-CqlCjTgU.cjs +8 -0
  33. package/dist/CustomStyles-nfD3J1mi.js +2881 -0
  34. package/dist/DataView.cjs +1 -0
  35. package/dist/DataView.js +62 -0
  36. package/dist/DateInput.cjs +296 -0
  37. package/dist/DateInput.js +7042 -0
  38. package/dist/DecimalInput.cjs +54 -0
  39. package/dist/DecimalInput.js +697 -0
  40. package/dist/DetailsView.cjs +18 -0
  41. package/dist/DetailsView.js +243 -0
  42. package/dist/DoubleRangeSlider.cjs +114 -0
  43. package/dist/DoubleRangeSlider.js +289 -0
  44. package/dist/DragAndDropFile.cjs +31 -0
  45. package/dist/DragAndDropFile.js +2331 -0
  46. package/dist/DragDropFiles.cjs +14 -0
  47. package/dist/DragDropFiles.js +175 -0
  48. package/dist/Drawer.cjs +6 -0
  49. package/dist/Drawer.js +206 -0
  50. package/dist/Dropdown.cjs +1 -0
  51. package/dist/Dropdown.js +266 -0
  52. package/dist/DropdownItem.cjs +36 -0
  53. package/dist/DropdownItem.js +241 -0
  54. package/dist/DropdownLookup.cjs +1 -0
  55. package/dist/DropdownLookup.js +325 -0
  56. package/dist/DropdownMenu-B6qr13ik.cjs +19 -0
  57. package/dist/DropdownMenu-DZi3TJ8Q.js +1547 -0
  58. package/dist/DropdownMenu.cjs +1 -0
  59. package/dist/DropdownMenu.js +12 -0
  60. package/dist/EditableTable.cjs +21 -0
  61. package/dist/EditableTable.js +462 -0
  62. package/dist/FileInput.cjs +47 -0
  63. package/dist/FileInput.js +206 -0
  64. package/dist/FlexBox.cjs +9 -0
  65. package/dist/FlexBox.js +97 -0
  66. package/dist/FlexGrid.cjs +1 -0
  67. package/dist/FlexGrid.js +78 -0
  68. package/dist/FlexGridItem.cjs +7 -0
  69. package/dist/FlexGridItem.js +97 -0
  70. package/dist/Footer.cjs +1 -0
  71. package/dist/Footer.js +18 -0
  72. package/dist/FormField.cjs +11 -0
  73. package/dist/FormField.js +65 -0
  74. package/dist/FormView.cjs +13 -0
  75. package/dist/FormView.js +354 -0
  76. package/dist/Grid.cjs +13 -0
  77. package/dist/Grid.js +62 -0
  78. package/dist/GridItem.cjs +15 -0
  79. package/dist/GridItem.js +72 -0
  80. package/dist/Header.cjs +1 -0
  81. package/dist/Header.js +18 -0
  82. package/dist/Icon.cjs +8 -0
  83. package/dist/Icon.js +59 -0
  84. package/dist/IconButton.cjs +122 -0
  85. package/dist/IconButton.js +481 -0
  86. package/dist/Kanban.cjs +85 -0
  87. package/dist/Kanban.js +4793 -0
  88. package/dist/KanbanActionsToolbar.cjs +19 -0
  89. package/dist/KanbanActionsToolbar.js +152 -0
  90. package/dist/KanbanCard-ConTmu3w.cjs +30 -0
  91. package/dist/KanbanCard-D9OhU8C6.js +175 -0
  92. package/dist/KanbanCard.cjs +1 -0
  93. package/dist/KanbanCard.js +12 -0
  94. package/dist/KanbanFooter.cjs +5 -0
  95. package/dist/KanbanFooter.js +84 -0
  96. package/dist/KanbanHeader.cjs +15 -0
  97. package/dist/KanbanHeader.js +127 -0
  98. package/dist/KanbanView.cjs +8 -0
  99. package/dist/KanbanView.js +255 -0
  100. package/dist/Link.cjs +15 -0
  101. package/dist/Link.js +62 -0
  102. package/dist/MenuItem.cjs +36 -0
  103. package/dist/MenuItem.js +230 -0
  104. package/dist/Modal.cjs +84 -0
  105. package/dist/Modal.js +372 -0
  106. package/dist/MultiSelectDropdown.cjs +1 -0
  107. package/dist/MultiSelectDropdown.js +261 -0
  108. package/dist/MultiSelectDropdownLookup.cjs +1 -0
  109. package/dist/MultiSelectDropdownLookup.js +274 -0
  110. package/dist/NestedDropdownItem.cjs +6 -0
  111. package/dist/NestedDropdownItem.js +102 -0
  112. package/dist/NestedMenuItem.cjs +6 -0
  113. package/dist/NestedMenuItem.js +115 -0
  114. package/dist/Notification.cjs +83 -0
  115. package/dist/Notification.js +1079 -0
  116. package/dist/NumberInput.cjs +45 -0
  117. package/dist/NumberInput.js +241 -0
  118. package/dist/PageLayout.cjs +26 -0
  119. package/dist/PageLayout.js +92 -0
  120. package/dist/PasswordInput.cjs +47 -0
  121. package/dist/PasswordInput.js +230 -0
  122. package/dist/ProgressBar.cjs +22 -0
  123. package/dist/ProgressBar.js +92 -0
  124. package/dist/RadioGroup.cjs +7 -0
  125. package/dist/RadioGroup.js +104 -0
  126. package/dist/RadioInput.cjs +117 -0
  127. package/dist/RadioInput.js +362 -0
  128. package/dist/RangeSlider.cjs +72 -0
  129. package/dist/RangeSlider.js +253 -0
  130. package/dist/SearchBar.cjs +100 -0
  131. package/dist/SearchBar.js +994 -0
  132. package/dist/Separator.cjs +6 -0
  133. package/dist/Separator.js +37 -0
  134. package/dist/Sidebar.cjs +39 -0
  135. package/dist/Sidebar.js +123 -0
  136. package/dist/Spinner.cjs +38 -0
  137. package/dist/Spinner.js +114 -0
  138. package/dist/Surface.cjs +7 -0
  139. package/dist/Surface.js +60 -0
  140. package/dist/SwipeableDrawer.cjs +33 -0
  141. package/dist/SwipeableDrawer.js +213 -0
  142. package/dist/Table.cjs +170 -0
  143. package/dist/Table.js +1408 -0
  144. package/dist/TableView-Cj5_fbSR.js +481 -0
  145. package/dist/TableView-D8ex512p.cjs +19 -0
  146. package/dist/TableView.cjs +1 -0
  147. package/dist/TableView.js +11 -0
  148. package/dist/Tabs.cjs +7 -0
  149. package/dist/Tabs.js +72 -0
  150. package/dist/TextAreaInput.cjs +33 -0
  151. package/dist/TextAreaInput.js +320 -0
  152. package/dist/TextInput.cjs +45 -0
  153. package/dist/TextInput.js +227 -0
  154. package/dist/ThemeProvider.cjs +113 -0
  155. package/dist/ThemeProvider.js +1340 -0
  156. package/dist/TimeInput.cjs +31 -0
  157. package/dist/TimeInput.js +133 -0
  158. package/dist/Toggle.cjs +151 -0
  159. package/dist/Toggle.js +421 -0
  160. package/dist/TreeMenu.cjs +15 -0
  161. package/dist/TreeMenu.js +108 -0
  162. package/dist/TreeMenuSeparator.cjs +6 -0
  163. package/dist/TreeMenuSeparator.js +40 -0
  164. package/dist/UploadedFile.cjs +39 -0
  165. package/dist/UploadedFile.js +192 -0
  166. package/dist/defineProperty-BHpTtkhC.js +110 -0
  167. package/dist/defineProperty-DHvxLH8G.cjs +1 -0
  168. package/dist/emotion-element-5486c51c.browser.esm-CSejtOeT.js +886 -0
  169. package/dist/emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs +1 -0
  170. package/dist/emotion-is-prop-valid.esm-BzFBwmJz.js +10 -0
  171. package/dist/emotion-is-prop-valid.esm-CMrshNb7.cjs +1 -0
  172. package/dist/emotion-react.browser.esm-DQBL7Wls.cjs +1 -0
  173. package/dist/emotion-react.browser.esm-OWM-uG8Q.js +94 -0
  174. package/dist/emotion-styled.browser.esm-BZSYYThs.js +210 -0
  175. package/dist/emotion-styled.browser.esm-Cbp_XsK4.cjs +1 -0
  176. package/dist/floating-ui.dom-1F2mTXOe.cjs +1 -0
  177. package/dist/floating-ui.dom-BdUovkEr.js +938 -0
  178. package/dist/hoist-non-react-statics.cjs-B8r9S_ak.cjs +15 -0
  179. package/dist/hoist-non-react-statics.cjs-Drf1aBlk.js +235 -0
  180. package/dist/index-BLQWNy78.js +109 -0
  181. package/dist/index-BP5r5zGN.cjs +1 -0
  182. package/dist/index-B_da1uvD.js +451 -0
  183. package/dist/index-BjdOz5Ok.cjs +1 -0
  184. package/dist/index-BklgDeu4.js +42 -0
  185. package/dist/index-C29T0m2a.cjs +174 -0
  186. package/dist/index-CZJEA84h.js +19069 -0
  187. package/dist/index-Cdkz-XH-.js +127 -0
  188. package/dist/index-D5vEbKUT.js +81 -0
  189. package/dist/index-DXnSjbfJ.cjs +20 -0
  190. package/dist/index-Ds9PUTwb.js +667 -0
  191. package/dist/index-Dzkd2i4n.cjs +1 -0
  192. package/dist/index-IO9v6o0I.cjs +5 -0
  193. package/dist/index-P-naJISQ.cjs +1 -0
  194. package/dist/index.cjs +26 -0
  195. package/dist/index.js +378 -0
  196. package/dist/motion-CtkUpWEn.js +3785 -0
  197. package/dist/motion-Oud-wpUz.cjs +1 -0
  198. package/dist/objectWithoutPropertiesLoose-Bz3hwpmU.cjs +1 -0
  199. package/dist/objectWithoutPropertiesLoose-DwEN6RBQ.js +12 -0
  200. package/dist/setPrototypeOf-4aSEnBDm.cjs +1 -0
  201. package/dist/setPrototypeOf-a891FLQJ.js +13 -0
  202. package/dist/style.css +5 -0
  203. package/dist/tslib.es6-ZNVz5r_T.js +90 -0
  204. package/dist/tslib.es6-fPwcSa2V.cjs +1 -0
  205. package/dist/use-isomorphic-layout-effect.browser.esm-CkGv31zs.cjs +1 -0
  206. package/dist/use-isomorphic-layout-effect.browser.esm-DERp5kr6.js +5 -0
  207. package/dist/useUpdateEffect-BtMgpgIV.cjs +1 -0
  208. package/dist/useUpdateEffect-CuYWz7EA.js +15 -0
  209. package/dist/utils-DEke8iwo.js +10196 -0
  210. package/dist/utils-hdRGTsQ7.cjs +13 -0
  211. package/eslint.config.js +38 -0
  212. package/package.json +137 -58
  213. package/vite.config.js +135 -0
  214. package/jest.config.js +0 -7
  215. package/lib/index.esm.js +0 -84028
  216. package/lib/index.js +0 -84165
  217. package/rc1 +0 -0
  218. package/test/jest/__mocks__/styleMock.js +0 -1
@@ -0,0 +1,54 @@
1
+ "use strict";const B=require("react/jsx-runtime"),y=require("./index-DXnSjbfJ.cjs"),F=require("react"),ae=require("./index-BjdOz5Ok.cjs"),z=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),x=require("./utils-hdRGTsQ7.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(`
2
+ Decimal separator can't be same as thousand separator.
3
+ thousandSeparator: `+s+` (thousandSeparator = {true} is same as thousandSeparator = ",")
4
+ decimalSeparator: `+o+` (default value for decimalSeparator is .)
5
+ `);if(t){var i=t==="string"?t:t.toString();if(i.match(/\d/g))throw new Error(`
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`
8
+ display: flex;
9
+ align-items: center;
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")};
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")};
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"):""}
21
+
22
+ & input {
23
+ background: none;
24
+ border: none;
25
+ outline: none;
26
+ padding-top: 0.625rem;
27
+ padding-bottom: 0.625rem;
28
+ width: 100%;
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")};
35
+ padding-right: ${a=>a.suffix?"0":"0.75rem"};
36
+ padding-left: ${a=>a.prefix?"0":"0.75rem"};
37
+ }
38
+
39
+ & input:disabled {
40
+ ${a=>x.getDisabledStateCss(a.theme)}
41
+ background: none;
42
+ }
43
+
44
+ & input:read-only {
45
+ cursor: default;
46
+ }
47
+
48
+ & input::placeholder {
49
+ color: ${a=>x.getColorRgbaValue(a.theme,"Input",a.color,"enabled","placeholder")};
50
+ }
51
+ `,Q=z.newStyled.span`
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;