@lanaco/lnc-react-ui 4.0.104 → 4.0.106

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 (236) hide show
  1. package/dist/Accordion.cjs +1 -1
  2. package/dist/Accordion.js +1 -1
  3. package/dist/AccordionSummary.cjs +1 -1
  4. package/dist/AccordionSummary.js +1 -1
  5. package/dist/ActionsToolbar.cjs +1 -1
  6. package/dist/ActionsToolbar.js +1 -1
  7. package/dist/Alert.cjs +1 -1
  8. package/dist/Alert.js +1 -1
  9. package/dist/Avatar.cjs +1 -1
  10. package/dist/Avatar.js +1 -1
  11. package/dist/Badge.cjs +1 -1
  12. package/dist/Badge.js +1 -1
  13. package/dist/BannerSectionCarousel.cjs +1 -1
  14. package/dist/BannerSectionCarousel.js +1 -1
  15. package/dist/BannerSectionWithList.cjs +1 -1
  16. package/dist/BannerSectionWithList.js +1 -1
  17. package/dist/BlogCardsSponsoredSection.cjs +1 -1
  18. package/dist/BlogCardsSponsoredSection.js +3 -3
  19. package/dist/BlogCategoryCardsSection.cjs +1 -1
  20. package/dist/BlogCategoryCardsSection.js +1 -1
  21. package/dist/BlogListSection.cjs +1 -1
  22. package/dist/BlogListSection.js +3 -3
  23. package/dist/BlogProductCardsSection.cjs +1 -1
  24. package/dist/BlogProductCardsSection.js +2 -2
  25. package/dist/BlogShopCardsSection.cjs +1 -1
  26. package/dist/BlogShopCardsSection.js +1 -1
  27. package/dist/BlogSingleSection.cjs +1 -1
  28. package/dist/BlogSingleSection.js +2 -2
  29. package/dist/BlogsSectionDetailed.cjs +1 -1
  30. package/dist/BlogsSectionDetailed.js +3 -3
  31. package/dist/BlogsSectionLarge.cjs +1 -1
  32. package/dist/BlogsSectionLarge.js +2 -2
  33. package/dist/BlogsSectionSimple.cjs +1 -1
  34. package/dist/BlogsSectionSimple.js +3 -3
  35. package/dist/BlogsSectionSimpleCentered.cjs +1 -1
  36. package/dist/BlogsSectionSimpleCentered.js +2 -2
  37. package/dist/BlogsSectionWithFilters.cjs +1 -1
  38. package/dist/BlogsSectionWithFilters.js +4 -4
  39. package/dist/BrandHitsSection.cjs +1 -1
  40. package/dist/BrandHitsSection.js +1 -1
  41. package/dist/Breadcrumbs.cjs +1 -1
  42. package/dist/Breadcrumbs.js +1 -1
  43. package/dist/Button.cjs +17 -15
  44. package/dist/Button.js +149 -136
  45. package/dist/ButtonGroup.cjs +1 -1
  46. package/dist/ButtonGroup.js +1 -1
  47. package/dist/CalorieCalculatorSection.cjs +1 -1
  48. package/dist/CalorieCalculatorSection.js +1 -1
  49. package/dist/CheckBoxInput.cjs +1 -1
  50. package/dist/CheckBoxInput.js +1 -1
  51. package/dist/Chip.cjs +1 -1
  52. package/dist/Chip.js +1 -1
  53. package/dist/ColorInput.cjs +10 -6
  54. package/dist/ColorInput.js +117 -87
  55. package/dist/ConfirmationForm.cjs +1 -1
  56. package/dist/ConfirmationForm.js +1 -1
  57. package/dist/CustomLoanMapSection.cjs +1 -1
  58. package/dist/CustomLoanMapSection.js +1 -1
  59. package/dist/{CustomStyles-DYULk9y7.js → CustomStyles-Dd8IsVV6.js} +1 -1
  60. package/dist/{CustomStyles-Uqkz9jDo.cjs → CustomStyles-DtKDPOdk.cjs} +1 -1
  61. package/dist/DateInput.cjs +1 -1
  62. package/dist/DateInput.js +1 -1
  63. package/dist/DecimalInput.cjs +28 -24
  64. package/dist/DecimalInput.js +315 -285
  65. package/dist/DecimalInputV2.cjs +23 -19
  66. package/dist/DecimalInputV2.js +124 -94
  67. package/dist/DetailedProductsSection.cjs +1 -1
  68. package/dist/DetailedProductsSection.js +4 -4
  69. package/dist/DetailsView.cjs +1 -1
  70. package/dist/DetailsView.js +1 -1
  71. package/dist/DoubleRangeSlider.cjs +1 -1
  72. package/dist/DoubleRangeSlider.js +1 -1
  73. package/dist/DragAndDropFile.cjs +1 -1
  74. package/dist/DragAndDropFile.js +1 -1
  75. package/dist/DragDropFiles.cjs +1 -1
  76. package/dist/DragDropFiles.js +1 -1
  77. package/dist/Drawer.cjs +1 -1
  78. package/dist/Drawer.js +1 -1
  79. package/dist/Dropdown.cjs +1 -1
  80. package/dist/Dropdown.js +2 -2
  81. package/dist/DropdownItem.cjs +1 -1
  82. package/dist/DropdownItem.js +1 -1
  83. package/dist/DropdownLookup.cjs +1 -1
  84. package/dist/DropdownLookup.js +1 -1
  85. package/dist/DropdownMenu.cjs +1 -1
  86. package/dist/DropdownMenu.js +1 -1
  87. package/dist/EditableTable.cjs +1 -1
  88. package/dist/EditableTable.js +1 -1
  89. package/dist/FeedbackSection.cjs +1 -1
  90. package/dist/FeedbackSection.js +1 -1
  91. package/dist/FieldOfInterestsMasonrySection.cjs +1 -1
  92. package/dist/FieldOfInterestsMasonrySection.js +1 -1
  93. package/dist/FieldOfInterestsWithAvatarsCardsSection.cjs +1 -1
  94. package/dist/FieldOfInterestsWithAvatarsCardsSection.js +2 -2
  95. package/dist/FieldOfInterestsWithTagsCardsSection.cjs +1 -1
  96. package/dist/FieldOfInterestsWithTagsCardsSection.js +1 -1
  97. package/dist/FileInput.cjs +25 -20
  98. package/dist/FileInput.js +86 -55
  99. package/dist/FlexGridItem.cjs +1 -1
  100. package/dist/FlexGridItem.js +1 -1
  101. package/dist/FormField.cjs +1 -1
  102. package/dist/FormField.js +1 -1
  103. package/dist/FormView.cjs +1 -1
  104. package/dist/FormView.js +1 -1
  105. package/dist/GeneralWithTagsCardsSection.cjs +1 -1
  106. package/dist/GeneralWithTagsCardsSection.js +1 -1
  107. package/dist/GiftCardsSection.cjs +1 -1
  108. package/dist/GiftCardsSection.js +2 -2
  109. package/dist/Icon.cjs +1 -1
  110. package/dist/Icon.js +1 -1
  111. package/dist/IconButton.cjs +10 -10
  112. package/dist/IconButton.js +125 -121
  113. package/dist/Kanban.cjs +1 -1
  114. package/dist/Kanban.js +1 -1
  115. package/dist/KanbanActionsToolbar.cjs +1 -1
  116. package/dist/KanbanActionsToolbar.js +1 -1
  117. package/dist/KanbanView.cjs +1 -1
  118. package/dist/KanbanView.js +1 -1
  119. package/dist/Link.cjs +1 -1
  120. package/dist/Link.js +1 -1
  121. package/dist/LoanCalculatorSection.cjs +1 -1
  122. package/dist/LoanCalculatorSection.js +1 -1
  123. package/dist/LocationFinderSection.cjs +1 -1
  124. package/dist/LocationFinderSection.js +1 -1
  125. package/dist/LocationSearchSection.cjs +1 -1
  126. package/dist/LocationSearchSection.js +1 -1
  127. package/dist/MasonryGeneralCardsSection.cjs +1 -1
  128. package/dist/MasonryGeneralCardsSection.js +1 -1
  129. package/dist/MenuItem.cjs +1 -1
  130. package/dist/MenuItem.js +1 -1
  131. package/dist/Modal.cjs +1 -1
  132. package/dist/Modal.js +1 -1
  133. package/dist/MultiSelectDropdown.cjs +1 -1
  134. package/dist/MultiSelectDropdown.js +1 -1
  135. package/dist/MultiSelectDropdownLookup.cjs +1 -1
  136. package/dist/MultiSelectDropdownLookup.js +1 -1
  137. package/dist/NestedDropdownItem.cjs +1 -1
  138. package/dist/NestedDropdownItem.js +1 -1
  139. package/dist/NestedMenuItem.cjs +1 -1
  140. package/dist/NestedMenuItem.js +1 -1
  141. package/dist/NotificationContainer.cjs +1 -1
  142. package/dist/NotificationContainer.js +1 -1
  143. package/dist/NotificationMessage.cjs +1 -1
  144. package/dist/NotificationMessage.js +1 -1
  145. package/dist/NumberInput.cjs +23 -19
  146. package/dist/NumberInput.js +116 -86
  147. package/dist/OverlayGeneralCardsSection.cjs +1 -1
  148. package/dist/OverlayGeneralCardsSection.js +2 -2
  149. package/dist/PasswordInput.cjs +23 -19
  150. package/dist/PasswordInput.js +94 -64
  151. package/dist/PopoverContent.cjs +1 -1
  152. package/dist/PopoverContent.js +1 -1
  153. package/dist/ProductsWithBannerSection.cjs +1 -1
  154. package/dist/ProductsWithBannerSection.js +3 -3
  155. package/dist/ProgressBar.cjs +1 -1
  156. package/dist/ProgressBar.js +1 -1
  157. package/dist/QuattroCardsSection.cjs +1 -1
  158. package/dist/QuattroCardsSection.js +1 -1
  159. package/dist/QuizSection.cjs +1 -1
  160. package/dist/QuizSection.js +1 -1
  161. package/dist/RadioInput.cjs +1 -1
  162. package/dist/RadioInput.js +1 -1
  163. package/dist/RangeSlider.cjs +8 -8
  164. package/dist/RangeSlider.js +19 -17
  165. package/dist/ReviewsSection.cjs +1 -1
  166. package/dist/ReviewsSection.js +2 -2
  167. package/dist/SalesCampaignsSection.cjs +1 -1
  168. package/dist/SalesCampaignsSection.js +1 -1
  169. package/dist/Separator.cjs +1 -1
  170. package/dist/Separator.js +1 -1
  171. package/dist/ShopCardsSection.cjs +1 -1
  172. package/dist/ShopCardsSection.js +2 -2
  173. package/dist/Sidebar.cjs +1 -1
  174. package/dist/Sidebar.js +1 -1
  175. package/dist/SimpleCategoriesSection.cjs +1 -1
  176. package/dist/SimpleCategoriesSection.js +3 -3
  177. package/dist/SimpleProductsSection.cjs +1 -1
  178. package/dist/SimpleProductsSection.js +2 -2
  179. package/dist/Spinner.cjs +1 -1
  180. package/dist/Spinner.js +1 -1
  181. package/dist/Surface.cjs +1 -1
  182. package/dist/Surface.js +1 -1
  183. package/dist/SwipeableDrawer.cjs +1 -1
  184. package/dist/SwipeableDrawer.js +1 -1
  185. package/dist/TabItem.cjs +1 -1
  186. package/dist/TabItem.js +1 -1
  187. package/dist/Table.cjs +1 -1
  188. package/dist/Table.js +1 -1
  189. package/dist/TableView.cjs +1 -1
  190. package/dist/TableView.js +1 -1
  191. package/dist/TextAreaInput.cjs +15 -12
  192. package/dist/TextAreaInput.js +70 -54
  193. package/dist/TextInput.cjs +23 -19
  194. package/dist/TextInput.js +90 -60
  195. package/dist/ThemeProvider.cjs +1 -1
  196. package/dist/ThemeProvider.js +1 -1
  197. package/dist/TimeInput.cjs +7 -5
  198. package/dist/TimeInput.js +47 -32
  199. package/dist/Toggle.cjs +1 -1
  200. package/dist/Toggle.js +1 -1
  201. package/dist/TreeMenuSeparator.cjs +1 -1
  202. package/dist/TreeMenuSeparator.js +1 -1
  203. package/dist/UploadedFile.cjs +1 -1
  204. package/dist/UploadedFile.js +1 -1
  205. package/dist/UrgentSaleProductsSection.cjs +1 -1
  206. package/dist/UrgentSaleProductsSection.js +1 -1
  207. package/dist/{index-C4gGt12B.cjs → index-B30K8mkW.cjs} +1 -1
  208. package/dist/{index-Kx8irvHH.js → index-BBMleFo5.js} +1 -1
  209. package/dist/{index-BRgZcjpI.cjs → index-BvSNRLNa.cjs} +1 -1
  210. package/dist/{index-C_T-BQ5p.cjs → index-C1DkD2ug.cjs} +1 -1
  211. package/dist/{index-DMysapsB.cjs → index-C9GK00PM.cjs} +1 -1
  212. package/dist/{index-Dcw6ecHw.js → index-CEI_JOki.js} +2 -2
  213. package/dist/{index-BPgWhA1t.js → index-CQLF61YV.js} +1 -1
  214. package/dist/{index-Cru8Sd2q.js → index-CTJpJFtr.js} +2 -2
  215. package/dist/{index-DZDz9qZP.cjs → index-Cg4t3q_p.cjs} +1 -1
  216. package/dist/{index-D86vS9UF.js → index-YGcWbzeb.js} +1 -1
  217. package/dist/index.cjs +1 -1
  218. package/dist/index.js +1 -1
  219. package/dist/{skeleton-BrUEdt6Z.js → skeleton-CkTNgaA3.js} +2 -2
  220. package/dist/{skeleton-BcaMeKFQ.cjs → skeleton-CoErfoMc.cjs} +1 -1
  221. package/dist/{skeleton-TrselJrj.js → skeleton-DWZNwK33.js} +1 -1
  222. package/dist/{skeleton-DwZzdFei.cjs → skeleton-DdlE-y3C.cjs} +1 -1
  223. package/dist/{style-LEmcTrN9.js → style-08foMKSd.js} +1 -1
  224. package/dist/{style-Bjk6yHcP.cjs → style-JqDQj4jh.cjs} +1 -1
  225. package/dist/{suspense-categories-card-simple-B2swGa6t.cjs → suspense-categories-card-simple-B5zd-nnm.cjs} +1 -1
  226. package/dist/{suspense-categories-card-simple-BCn3U1cz.js → suspense-categories-card-simple-Ds6hXZKt.js} +1 -1
  227. package/dist/{suspense-large-DgzTM-qh.js → suspense-large-BM9s_kZP.js} +1 -1
  228. package/dist/{suspense-large-DMhn-lIG.cjs → suspense-large-CtcwWswP.cjs} +1 -1
  229. package/dist/{suspense-product-card-detailed-BNOhu3Z4.cjs → suspense-product-card-detailed-DXwya4fQ.cjs} +1 -1
  230. package/dist/{suspense-product-card-detailed-BDkww9pS.js → suspense-product-card-detailed-bYBpLiXc.js} +2 -2
  231. package/dist/{suspense-product-card-simple-BxDjW7gR.cjs → suspense-product-card-simple-Ba1UPqgy.cjs} +1 -1
  232. package/dist/{suspense-product-card-simple-CQ1qPZOa.js → suspense-product-card-simple-ib6FLerL.js} +1 -1
  233. package/dist/{utils-BXCGNjIy.js → utils-BbgAIA9N.js} +51 -13
  234. package/dist/utils-CZynEOC_.cjs +51 -0
  235. package/package.json +1 -1
  236. package/dist/utils-BWzf4vLl.cjs +0 -51
@@ -1,23 +1,25 @@
1
- "use strict";const B=require("react/jsx-runtime"),v=require("./index-BPVoEhTF.cjs"),R=require("react"),ae=require("./index-DaiUAQVF.cjs"),K=require("./emotion-styled.browser.esm-BtEseadx.cjs"),b=require("./utils-BWzf4vLl.cjs"),ie=require("./emotion-element-f0de968e.browser.esm-B7k6i6lC.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,f,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"+f)}function z(a,f){f===void 0&&(f=!0);var u=a[0]==="-",e=u&&f;a=a.replace("-","");var t=a.split("."),r=t[0],o=t[1]||"";return{beforeDecimal:r,afterDecimal:o,hasNagation:u,addNegation:e}}function fe(a){if(!a)return a;var f=a[0]==="-";f&&(a=a.substring(1,a.length));var u=a.split("."),e=u[0].replace(/^0+/,"")||"0",t=u[1]||"";return(f?"-":"")+e+(t?"."+t:"")}function H(a,f,u){for(var e="",t=u?"0":"",r=0;r<=f-1;r++)e+=a[r]||t;return e}function G(a,f){return Array(f+1).join(a)}function le(a){a+="";var f=a[0]==="-"?"-":"";f&&(a=a.substring(1));var u=a.split(/[eE]/g),e=u[0],t=u[1];if(t=Number(t),!t)return f+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),f+e}function ue(a,f,u){if(["","-"].indexOf(a)!==-1)return a;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("."),c=r.split("").reverse().reduce(function(m,y,x){return m.length>x?(Number(m[0])+Number(y)).toString()+m.substring(1,m.length):y+m},l[0]),p=H(l[1]||"",Math.min(f,o.length),u),d=s?"-":"",h=e?".":"";return""+d+c+h+p}function _(a,f){if(a.value=a.value,a!==null){if(a.createTextRange){var u=a.createTextRange();return u.move("character",f),u.select(),!0}return a.selectionStart||a.selectionStart===0?(a.focus(),a.setSelectionRange(f,f),!0):(a.focus(),!1)}}function pe(a,f){for(var u=0,e=0,t=a.length,r=f.length;a[u]===f[u]&&u<t;)u++;for(;a[t-1-e]===f[r-1-e]&&r-e>u&&t-e>u;)e++;return{start:u,end:t-e}}function L(a,f,u){return Math.min(Math.max(a,f),u)}function Z(a){return Math.max(a.selectionStart,a.selectionEnd)}function ce(a){return a||typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function de(a,f){var u={};for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&f.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 f(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&&(f.__proto__=a),f.prototype=Object.create(a&&a.prototype),f.prototype.constructor=f,f.prototype.componentDidMount=function(){this.setState({mounted:!0})},f.prototype.componentDidUpdate=function(e){this.updateValueIfRequired(e)},f.prototype.componentWillUnmount=function(){clearTimeout(this.focusTimeout),clearTimeout(this.caretPositionTimeout)},f.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 l=this.formatNumString(n),c=W(r.value)?l:this.formatValueProp(),p=this.removeFormatting(c),d=parseFloat(p),h=parseFloat(n);((!isNaN(d)||!isNaN(h))&&d!==h||l!==i||s===null&&c!==i)&&this.updateValue({formattedValue:c,numAsString:p,input:s,source:"prop",event:null})}},f.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 l=e.indexOf(".");return l!==-1&&(e=e.substring(0,l)+"."+e.substring(l+1,e.length).replace(new RegExp(q(s),"g"),"")),n&&(e="-"+e),e},f.prototype.getNumberRegex=function(e,t){var r=this.props,o=r.format,s=r.decimalScale,i=r.customNumerals,n=this.getSeparators(),l=n.decimalSeparator;return new RegExp("[0-9"+(i?i.join(""):"")+"]"+(l&&s!==0&&!t&&!o?"|"+q(l):""),e?"g":void 0)},f.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}},f.prototype.getMaskAtIndex=function(e){var t=this.props,r=t.mask;return r===void 0&&(r=" "),typeof r=="string"?r:r[e]||" "},f.prototype.getValueObject=function(e,t){var r=parseFloat(t);return{formattedValue:e,value:t,floatValue:isNaN(r)?void 0:r}},f.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 k=require("react/jsx-runtime"),v=require("./index-BPVoEhTF.cjs"),V=require("react"),ae=require("./index-DaiUAQVF.cjs"),K=require("./emotion-styled.browser.esm-BtEseadx.cjs"),S=require("./utils-CZynEOC_.cjs"),oe=require("./emotion-element-f0de968e.browser.esm-B7k6i6lC.cjs");function $(){}function ie(){return!0}function O(r){return!!(r||"").match(/\d/)}function W(r){return r==null}function q(r){return r.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function ne(r){switch(r){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(r,s,f){var e=ne(f),t=r.search(/[1-9]/);return t=t===-1?r.length:t,r.substring(0,t)+r.substring(t,r.length).replace(e,"$1"+s)}function z(r,s){s===void 0&&(s=!0);var f=r[0]==="-",e=f&&s;r=r.replace("-","");var t=r.split("."),a=t[0],i=t[1]||"";return{beforeDecimal:a,afterDecimal:i,hasNagation:f,addNegation:e}}function le(r){if(!r)return r;var s=r[0]==="-";s&&(r=r.substring(1,r.length));var f=r.split("."),e=f[0].replace(/^0+/,"")||"0",t=f[1]||"";return(s?"-":"")+e+(t?"."+t:"")}function H(r,s,f){for(var e="",t=f?"0":"",a=0;a<=s-1;a++)e+=r[a]||t;return e}function G(r,s){return Array(s+1).join(r)}function ue(r){r+="";var s=r[0]==="-"?"-":"";s&&(r=r.substring(1));var f=r.split(/[eE]/g),e=f[0],t=f[1];if(t=Number(t),!t)return s+e;e=e.replace(".","");var a=1+t,i=e.length;return a<0?e="0."+G("0",Math.abs(a))+e:a>=i?e=e+G("0",a-i):e=(e.substring(0,a)||"0")+"."+e.substring(a),s+e}function fe(r,s,f){if(["","-"].indexOf(r)!==-1)return r;var e=r.indexOf(".")!==-1&&s,t=z(r),a=t.beforeDecimal,i=t.afterDecimal,l=t.hasNagation,o=parseFloat("0."+(i||"0")),n=i.length<=s?"0."+i:o.toFixed(s),u=n.split("."),p=a.split("").reverse().reduce(function(m,y,x){return m.length>x?(Number(m[0])+Number(y)).toString()+m.substring(1,m.length):y+m},u[0]),c=H(u[1]||"",Math.min(s,i.length),f),d=l?"-":"",g=e?".":"";return""+d+p+g+c}function _(r,s){if(r.value=r.value,r!==null){if(r.createTextRange){var f=r.createTextRange();return f.move("character",s),f.select(),!0}return r.selectionStart||r.selectionStart===0?(r.focus(),r.setSelectionRange(s,s),!0):(r.focus(),!1)}}function ce(r,s){for(var f=0,e=0,t=r.length,a=s.length;r[f]===s[f]&&f<t;)f++;for(;r[t-1-e]===s[a-1-e]&&a-e>f&&t-e>f;)e++;return{start:f,end:t-e}}function L(r,s,f){return Math.min(Math.max(r,s),f)}function Z(r){return Math.max(r.selectionStart,r.selectionEnd)}function pe(r){return r||typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function de(r,s){var f={};for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&s.indexOf(e)===-1&&(f[e]=r[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:$,onChange:$,onKeyDown:$,onMouseUp:$,onFocus:$,onBlur:$,isAllowed:ie},J=function(r){function s(f){r.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 r&&(s.__proto__=r),s.prototype=Object.create(r&&r.prototype),s.prototype.constructor=s,s.prototype.componentDidMount=function(){this.setState({mounted:!0})},s.prototype.componentDidUpdate=function(e){this.updateValueIfRequired(e)},s.prototype.componentWillUnmount=function(){clearTimeout(this.focusTimeout),clearTimeout(this.caretPositionTimeout)},s.prototype.updateValueIfRequired=function(e){var t=this,a=t.props,i=t.state,l=t.focusedElm,o=i.value,n=i.numAsString;if(n===void 0&&(n=""),e!==a){this.validateProps();var u=this.formatNumString(n),p=W(a.value)?u:this.formatValueProp(),c=this.removeFormatting(p),d=parseFloat(c),g=parseFloat(n);((!isNaN(d)||!isNaN(g))&&d!==g||u!==o||l===null&&p!==o)&&this.updateValue({formattedValue:p,numAsString:c,input:l,source:"prop",event:null})}},s.prototype.getFloatString=function(e){e===void 0&&(e="");var t=this.props,a=t.decimalScale,i=this.getSeparators(),l=i.decimalSeparator,o=this.getNumberRegex(!0),n=e[0]==="-";n&&(e=e.replace("-","")),l&&a===0&&(e=e.split(l)[0]),e=(e.match(o)||[]).join("").replace(l,".");var u=e.indexOf(".");return u!==-1&&(e=e.substring(0,u)+"."+e.substring(u+1,e.length).replace(new RegExp(q(l),"g"),"")),n&&(e="-"+e),e},s.prototype.getNumberRegex=function(e,t){var a=this.props,i=a.format,l=a.decimalScale,o=a.customNumerals,n=this.getSeparators(),u=n.decimalSeparator;return new RegExp("[0-9"+(o?o.join(""):"")+"]"+(u&&l!==0&&!t&&!i?"|"+q(u):""),e?"g":void 0)},s.prototype.getSeparators=function(){var e=this.props,t=e.decimalSeparator,a=this.props,i=a.thousandSeparator,l=a.allowedDecimalSeparators;return i===!0&&(i=","),l||(l=[t,"."]),{decimalSeparator:t,thousandSeparator:i,allowedDecimalSeparators:l}},s.prototype.getMaskAtIndex=function(e){var t=this.props,a=t.mask;return a===void 0&&(a=" "),typeof a=="string"?a:a[e]||" "},s.prototype.getValueObject=function(e,t){var a=parseFloat(t);return{formattedValue:e,value:t,floatValue:isNaN(a)?void 0:a}},s.prototype.validateProps=function(){var e=this.props,t=e.mask,a=this.getSeparators(),i=a.decimalSeparator,l=a.thousandSeparator;if(i===l)throw new Error(`
2
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(`
3
+ thousandSeparator: `+l+` (thousandSeparator = {true} is same as thousandSeparator = ",")
4
+ decimalSeparator: `+i+` (default value for decimalSeparator is .)
5
+ `);if(t){var o=t==="string"?t:t.toString();if(o.match(/\d/g))throw new Error(`
6
6
  Mask `+t+` should not contain numeric character;
7
- `)}},f.prototype.setPatchedCaretPosition=function(e,t,r){_(e,t),this.caretPositionTimeout=setTimeout(function(){e.value===r&&_(e,t)},0)},f.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=L(t,0,e.length),!n){var l=e[0]==="-";return L(t,s.length+(l?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 c=n.indexOf("#"),p=n.lastIndexOf("#");t=L(t,c,p+1);for(var d=n.substring(t,n.length).indexOf("#"),h=t,m=t+(d===-1?0:d);h>c&&(n[h]!=="#"||!O(e[h]));)h-=1;var y=!O(e[m])||r==="left"&&t!==c||t-h<m-t;return y?O(e[h])?h+1:h:m},f.prototype.getCaretPosition=function(e,t,r){var o=this.props,s=o.format,i=this.state.value,n=this.getNumberRegex(!0),l=(e.match(n)||[]).join(""),c=(t.match(n)||[]).join(""),p,d;for(p=0,d=0;d<r;d++){var h=e[d]||"",m=t[p]||"";if(!(!h.match(n)&&h!==m)&&!(h==="0"&&m.match(n)&&m!=="0"&&l.length!==c.length)){for(;h!==t[p]&&p<t.length;)p++;p++}}return typeof s=="string"&&!i&&(p=t.length),p=this.correctCaretPosition(t,p),p},f.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},f.prototype.removePatternFormatting=function(e){for(var t=this.props,r=t.format,o=r.split("#").filter(function(d){return d!==""}),s=0,i="",n=0,l=o.length;n<=l;n++){var c=o[n]||"",p=n===l?e.length:e.indexOf(c,s);if(p===-1){i=e;break}else i+=e.substring(s,p),s=p+c.length}return(i.match(this.getNumberRegex(!0))||[]).join("")},f.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)},f.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("")},f.prototype.formatAsNumber=function(e){var t=this.props,r=t.decimalScale,o=t.fixedDecimalScale,s=t.prefix,i=t.suffix,n=t.allowNegative,l=t.thousandsGroupStyle,c=this.getSeparators(),p=c.thousandSeparator,d=c.decimalSeparator,h=e.indexOf(".")!==-1||r&&o,m=z(e,n),y=m.beforeDecimal,x=m.afterDecimal,N=m.addNegation;return r!==void 0&&(x=H(x,r,o)),p&&(y=se(y,p,l)),s&&(y=s+y),i&&(x=x+i),N&&(y="-"+y),e=y+(h&&d||"")+x,e},f.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(l){return s.indexOf(l).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},f.prototype.formatValueProp=function(e){var t=this.props,r=t.format,o=t.decimalScale,s=t.fixedDecimalScale,i=t.allowEmptyFormatting,n=this.props,l=n.value,c=n.isNumericString;l=W(l)?e:l;var p=!l&&l!==0;if(p&&i&&(l=""),p&&!i)return"";typeof l=="number"&&(l=le(l),c=!0),l==="Infinity"&&c&&(l=""),c&&!r&&typeof o=="number"&&(l=ue(l,o,s));var d=c?this.formatNumString(l):this.formatInput(l);return d},f.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},f.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)},f.prototype.isCharacterAFormat=function(e,t){var r=this.props,o=r.format,s=r.prefix,i=r.suffix,n=r.decimalScale,l=r.fixedDecimalScale,c=this.getSeparators(),p=c.decimalSeparator;return!!(typeof o=="string"&&o[e]!=="#"||!o&&(e<s.length||e>=t.length-i.length||n&&l&&t[e]===p))},f.prototype.correctInputValue=function(e,t,r){var o=this,s=this.props,i=s.format,n=s.allowNegative,l=s.prefix,c=s.suffix,p=s.decimalScale,d=this.getSeparators(),h=d.allowedDecimalSeparators,m=d.decimalSeparator,y=this.state.numAsString||"",x=this.selectionBeforeInput,N=x.selectionStart,P=x.selectionEnd,C=pe(t,r),g=C.start,w=C.end;if(!i&&g===w&&h.indexOf(r[N])!==-1){var F=p===0?"":m;return r.substr(0,N)+F+r.substr(N+1,r.length)}var E=i?0:l.length,$=t.length-(i?0:c.length);if(r.length>t.length||!r.length||g===w||N===0&&P===t.length||g===0&&w===t.length||N===E&&P===$)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 D=this.removeFormatting(r),k=z(D,n),Y=k.beforeDecimal,ee=k.afterDecimal,te=k.addNegation,re=e<r.indexOf(m)+1;if(D.length<y.length&&re&&Y===""&&!parseFloat(ee))return te?"-":""}return r},f.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,l=e.caretPos,c=this.props,p=c.onValueChange,d=this.state,h=d.value;if(r){if(l===void 0&&o){var m=e.inputValue||r.value,y=Z(r);r.value=t,l=this.getCaretPosition(m,t,y)}r.value=t,o&&this.setPatchedCaretPosition(r,l,t)}n===void 0&&(n=this.removeFormatting(t)),t!==h&&(this.setState({value:t,numAsString:n}),p(this.getValueObject(t,n),{event:i,source:s}))},f.prototype.onChange=function(e){var t=e.target,r=t.value,o=this,s=o.state,i=o.props,n=i.isAllowed,l=s.value||"",c=Z(t);r=this.correctInputValue(c,l,r);var p=this.formatInput(r)||"",d=this.removeFormatting(p),h=this.getValueObject(p,d),m=n(h);m||(p=l),this.updateValue({formattedValue:p,numAsString:d,inputValue:r,input:t,event:e,source:"event"}),m&&i.onChange(e)},f.prototype.onBlur=function(e){var t=this,r=t.props,o=t.state,s=r.format,i=r.onBlur,n=r.allowLeadingZeros,l=o.numAsString,c=o.value;if(this.focusedElm=null,clearTimeout(this.focusTimeout),clearTimeout(this.caretPositionTimeout),!s){isNaN(parseFloat(l))&&(l=""),n||(l=fe(l));var p=this.formatNumString(l);if(p!==c){this.updateValue({formattedValue:p,numAsString:l,input:e.target,setCaretPosition:!1,event:e,source:"event"}),i(e);return}}i(e)},f.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,l=this.props,c=l.decimalScale,p=l.fixedDecimalScale,d=l.prefix,h=l.suffix,m=l.format,y=l.onKeyDown,x=c!==void 0&&p,N=this.getNumberRegex(!1,x),P=new RegExp("-"),C=typeof m=="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){y(e);return}var g=n,w=C?m.indexOf("#"):d.length,F=C?m.lastIndexOf("#")+1:i.length-h.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])&&!P.test(i[n]))for(;!N.test(i[g])&&g<F;)g++;else if(r==="Backspace"&&!N.test(i[n])){if(o<=w+1&&i[0]==="-"&&typeof m>"u"){var $=i.substring(1);this.updateValue({formattedValue:$,caretPos:g,input:t,event:e,source:"event"})}else if(!P.test(i[n])){for(;!N.test(i[g-1])&&g>w;)g--;g=this.correctCaretPosition(i,g,"left")}}(g!==n||n<w||n>F)&&(e.preventDefault(),this.setPatchedCaretPosition(t,g,i)),e.isUnitTestRun&&this.setPatchedCaretPosition(t,g,i),y(e)},f.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)},f.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)},f.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 l=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"]),c=l,p=this.state,d=p.value,h=p.mounted,m=h&&ce(n)?"numeric":void 0,y=Object.assign({inputMode:m},c,{type:t,value:d,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if(r==="text")return s?s(d,c)||null:R.createElement("span",Object.assign({},c,{ref:i}),d);if(o){var x=o;return R.createElement(x,Object.assign({},y,{ref:i}))}return R.createElement("input",Object.assign({},y,{ref:i}))},f}(R.Component);J.defaultProps=me;const he=K.styled.div`
7
+ `)}},s.prototype.setPatchedCaretPosition=function(e,t,a){_(e,t),this.caretPositionTimeout=setTimeout(function(){e.value===a&&_(e,t)},0)},s.prototype.correctCaretPosition=function(e,t,a){var i=this.props,l=i.prefix,o=i.suffix,n=i.format;if(e==="")return 0;if(t=L(t,0,e.length),!n){var u=e[0]==="-";return L(t,l.length+(u?1:0),e.length-o.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=L(t,p,c+1);for(var d=n.substring(t,n.length).indexOf("#"),g=t,m=t+(d===-1?0:d);g>p&&(n[g]!=="#"||!O(e[g]));)g-=1;var y=!O(e[m])||a==="left"&&t!==p||t-g<m-t;return y?O(e[g])?g+1:g:m},s.prototype.getCaretPosition=function(e,t,a){var i=this.props,l=i.format,o=this.state.value,n=this.getNumberRegex(!0),u=(e.match(n)||[]).join(""),p=(t.match(n)||[]).join(""),c,d;for(c=0,d=0;d<a;d++){var g=e[d]||"",m=t[c]||"";if(!(!g.match(n)&&g!==m)&&!(g==="0"&&m.match(n)&&m!=="0"&&u.length!==p.length)){for(;g!==t[c]&&c<t.length;)c++;c++}}return typeof l=="string"&&!o&&(c=t.length),c=this.correctCaretPosition(t,c),c},s.prototype.removePrefixAndSuffix=function(e){var t=this.props,a=t.format,i=t.prefix,l=t.suffix;if(!a&&e){var o=e[0]==="-";o&&(e=e.substring(1,e.length)),e=i&&e.indexOf(i)===0?e.substring(i.length,e.length):e;var n=e.lastIndexOf(l);e=l&&n!==-1&&n===e.length-l.length?e.substring(0,n):e,o&&(e="-"+e)}return e},s.prototype.removePatternFormatting=function(e){for(var t=this.props,a=t.format,i=a.split("#").filter(function(d){return d!==""}),l=0,o="",n=0,u=i.length;n<=u;n++){var p=i[n]||"",c=n===u?e.length:e.indexOf(p,l);if(c===-1){o=e;break}else o+=e.substring(l,c),l=c+p.length}return(o.match(this.getNumberRegex(!0))||[]).join("")},s.prototype.removeFormatting=function(e){var t=this.props,a=t.format,i=t.removeFormatting;return e&&(a?typeof a=="string"?e=this.removePatternFormatting(e):typeof i=="function"?e=i(e):e=(e.match(this.getNumberRegex(!0))||[]).join(""):(e=this.removePrefixAndSuffix(e),e=this.getFloatString(e)),e)},s.prototype.formatWithPattern=function(e){for(var t=this.props,a=t.format,i=0,l=a.split(""),o=0,n=a.length;o<n;o++)a[o]==="#"&&(l[o]=e[i]||this.getMaskAtIndex(i),i+=1);return l.join("")},s.prototype.formatAsNumber=function(e){var t=this.props,a=t.decimalScale,i=t.fixedDecimalScale,l=t.prefix,o=t.suffix,n=t.allowNegative,u=t.thousandsGroupStyle,p=this.getSeparators(),c=p.thousandSeparator,d=p.decimalSeparator,g=e.indexOf(".")!==-1||a&&i,m=z(e,n),y=m.beforeDecimal,x=m.afterDecimal,N=m.addNegation;return a!==void 0&&(x=H(x,a,i)),c&&(y=se(y,c,u)),l&&(y=l+y),o&&(x=x+o),N&&(y="-"+y),e=y+(g&&d||"")+x,e},s.prototype.formatNumString=function(e){e===void 0&&(e="");var t=this.props,a=t.format,i=t.allowEmptyFormatting,l=t.customNumerals,o=e;if(l&&l.length===10){var n=new RegExp("["+l.join("")+"]","g");o=e.replace(n,function(u){return l.indexOf(u).toString()})}return e===""&&!i?o="":e==="-"&&!a?o="-":typeof a=="string"?o=this.formatWithPattern(o):typeof a=="function"?o=a(o):o=this.formatAsNumber(o),o},s.prototype.formatValueProp=function(e){var t=this.props,a=t.format,i=t.decimalScale,l=t.fixedDecimalScale,o=t.allowEmptyFormatting,n=this.props,u=n.value,p=n.isNumericString;u=W(u)?e:u;var c=!u&&u!==0;if(c&&o&&(u=""),c&&!o)return"";typeof u=="number"&&(u=ue(u),p=!0),u==="Infinity"&&p&&(u=""),p&&!a&&typeof i=="number"&&(u=fe(u,i,l));var d=p?this.formatNumString(u):this.formatInput(u);return d},s.prototype.formatNegation=function(e){e===void 0&&(e="");var t=this.props,a=t.allowNegative,i=new RegExp("(-)"),l=new RegExp("(-)(.)*(-)"),o=i.test(e),n=l.test(e);return e=e.replace(/-/g,""),o&&!n&&a&&(e="-"+e),e},s.prototype.formatInput=function(e){e===void 0&&(e="");var t=this.props,a=t.format;return a||(e=this.removePrefixAndSuffix(e),e=this.formatNegation(e)),e=this.removeFormatting(e),this.formatNumString(e)},s.prototype.isCharacterAFormat=function(e,t){var a=this.props,i=a.format,l=a.prefix,o=a.suffix,n=a.decimalScale,u=a.fixedDecimalScale,p=this.getSeparators(),c=p.decimalSeparator;return!!(typeof i=="string"&&i[e]!=="#"||!i&&(e<l.length||e>=t.length-o.length||n&&u&&t[e]===c))},s.prototype.correctInputValue=function(e,t,a){var i=this,l=this.props,o=l.format,n=l.allowNegative,u=l.prefix,p=l.suffix,c=l.decimalScale,d=this.getSeparators(),g=d.allowedDecimalSeparators,m=d.decimalSeparator,y=this.state.numAsString||"",x=this.selectionBeforeInput,N=x.selectionStart,P=x.selectionEnd,T=ce(t,a),h=T.start,w=T.end;if(!o&&h===w&&g.indexOf(a[N])!==-1){var R=c===0?"":m;return a.substr(0,N)+R+a.substr(N+1,a.length)}var A=o?0:u.length,E=t.length-(o?0:p.length);if(a.length>t.length||!a.length||h===w||N===0&&P===t.length||h===0&&w===t.length||N===A&&P===E)return a;var j=t.substr(h,w-h),B=!![].concat(j).find(function(C,I){return i.isCharacterAFormat(I+h,t)});if(B){var M=t.substr(h),F={},b=[];[].concat(M).forEach(function(C,I){i.isCharacterAFormat(I+h,t)?F[I]=C:I>j.length-1&&b.push(C)}),Object.keys(F).forEach(function(C){b.length>C?b.splice(C,0,F[C]):b.push(F[C])}),a=t.substr(0,h)+b.join("")}if(!o){var D=this.removeFormatting(a),U=z(D,n),Y=U.beforeDecimal,ee=U.afterDecimal,te=U.addNegation,re=e<a.indexOf(m)+1;if(D.length<y.length&&re&&Y===""&&!parseFloat(ee))return te?"-":""}return a},s.prototype.updateValue=function(e){var t=e.formattedValue,a=e.input,i=e.setCaretPosition;i===void 0&&(i=!0);var l=e.source,o=e.event,n=e.numAsString,u=e.caretPos,p=this.props,c=p.onValueChange,d=this.state,g=d.value;if(a){if(u===void 0&&i){var m=e.inputValue||a.value,y=Z(a);a.value=t,u=this.getCaretPosition(m,t,y)}a.value=t,i&&this.setPatchedCaretPosition(a,u,t)}n===void 0&&(n=this.removeFormatting(t)),t!==g&&(this.setState({value:t,numAsString:n}),c(this.getValueObject(t,n),{event:o,source:l}))},s.prototype.onChange=function(e){var t=e.target,a=t.value,i=this,l=i.state,o=i.props,n=o.isAllowed,u=l.value||"",p=Z(t);a=this.correctInputValue(p,u,a);var c=this.formatInput(a)||"",d=this.removeFormatting(c),g=this.getValueObject(c,d),m=n(g);m||(c=u),this.updateValue({formattedValue:c,numAsString:d,inputValue:a,input:t,event:e,source:"event"}),m&&o.onChange(e)},s.prototype.onBlur=function(e){var t=this,a=t.props,i=t.state,l=a.format,o=a.onBlur,n=a.allowLeadingZeros,u=i.numAsString,p=i.value;if(this.focusedElm=null,clearTimeout(this.focusTimeout),clearTimeout(this.caretPositionTimeout),!l){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"}),o(e);return}}o(e)},s.prototype.onKeyDown=function(e){var t=e.target,a=e.key,i=t.selectionStart,l=t.selectionEnd,o=t.value;o===void 0&&(o="");var n,u=this.props,p=u.decimalScale,c=u.fixedDecimalScale,d=u.prefix,g=u.suffix,m=u.format,y=u.onKeyDown,x=p!==void 0&&c,N=this.getNumberRegex(!1,x),P=new RegExp("-"),T=typeof m=="string";if(this.selectionBeforeInput={selectionStart:i,selectionEnd:l},a==="ArrowLeft"||a==="Backspace"?n=i-1:a==="ArrowRight"?n=i+1:a==="Delete"&&(n=i),n===void 0||i!==l){y(e);return}var h=n,w=T?m.indexOf("#"):d.length,R=T?m.lastIndexOf("#")+1:o.length-g.length;if(a==="ArrowLeft"||a==="ArrowRight"){var A=a==="ArrowLeft"?"left":"right";h=this.correctCaretPosition(o,n,A)}else if(a==="Delete"&&!N.test(o[n])&&!P.test(o[n]))for(;!N.test(o[h])&&h<R;)h++;else if(a==="Backspace"&&!N.test(o[n])){if(i<=w+1&&o[0]==="-"&&typeof m>"u"){var E=o.substring(1);this.updateValue({formattedValue:E,caretPos:h,input:t,event:e,source:"event"})}else if(!P.test(o[n])){for(;!N.test(o[h-1])&&h>w;)h--;h=this.correctCaretPosition(o,h,"left")}}(h!==n||n<w||n>R)&&(e.preventDefault(),this.setPatchedCaretPosition(t,h,o)),e.isUnitTestRun&&this.setPatchedCaretPosition(t,h,o),y(e)},s.prototype.onMouseUp=function(e){var t=e.target,a=t.selectionStart,i=t.selectionEnd,l=t.value;if(l===void 0&&(l=""),a===i){var o=this.correctCaretPosition(l,a);o!==a&&this.setPatchedCaretPosition(t,o,l)}this.props.onMouseUp(e)},s.prototype.onFocus=function(e){var t=this;e.persist(),this.focusedElm=e.target,this.focusTimeout=setTimeout(function(){var a=e.target,i=a.selectionStart,l=a.selectionEnd,o=a.value;o===void 0&&(o="");var n=t.correctCaretPosition(o,i);n!==i&&!(i===0&&l===o.length)&&t.setPatchedCaretPosition(a,n,o),t.props.onFocus(e)},0)},s.prototype.render=function(){var e=this.props,t=e.type,a=e.displayType,i=e.customInput,l=e.renderText,o=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,d=c.value,g=c.mounted,m=g&&pe(n)?"numeric":void 0,y=Object.assign({inputMode:m},p,{type:t,value:d,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if(a==="text")return l?l(d,p)||null:V.createElement("span",Object.assign({},p,{ref:o}),d);if(i){var x=i;return V.createElement(x,Object.assign({},y,{ref:o}))}return V.createElement("input",Object.assign({},y,{ref:o}))},s}(V.Component);J.defaultProps=me;const ge=K.styled.div`
8
8
  display: flex;
9
9
  align-items: center;
10
10
 
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")};
11
+ min-height: ${r=>S.getSizeValueWithUnits(r.theme,r.size)};
12
+ max-height: ${r=>S.getSizeValueWithUnits(r.theme,r.size)};
13
+ background-color: ${r=>S.getColorRgbaValue(r.theme,"Input",r.color,"enabled","background")};
14
14
  border: 1px solid
15
- ${a=>b.getColorRgbaValue(a.theme,"Input",a.focused===!0?"primary":a.color,"enabled","border")};
16
- border-radius: ${a=>b.getBorderRadiusValueWithUnits(a.theme,"regular")};
15
+ ${r=>S.getColorRgbaValue(r.theme,"Input",r.focused===!0?"primary":r.color,"enabled","border")};
16
+ border-radius: ${r=>S.getBorderRadiusValueWithUnits(r.theme,"regular")};
17
17
 
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"):""}
18
+ ${r=>r.focused===!0&&r.readOnly!==!0?S.getOutlineCss(r.theme):""}
19
+ /* ${r=>r.isDisabled===!0?S.getDisabledStateCss(r.theme):""} */
20
+ ${r=>r.isDisabled===!0&&`background-color: ${S.getColorRgbaValue(r.theme,"Input",r.color,"disabled","background","backgroundOpacity")};
21
+ color: ${s=>S.getColorRgbaValue(s.theme,"Input",s.color,"disabled","text")};`}
22
+ ${r=>r.isDisabled===!0?"border: 1px solid "+S.getColorRgbaValue(r.theme,"Input",r.color,"disabled","border"):""}
21
23
 
22
24
  & input {
23
25
  background: none;
@@ -27,17 +29,19 @@
27
29
  padding-bottom: 0.625rem;
28
30
  width: 100%;
29
31
 
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
- padding-right: ${a=>a.suffix?"0":"0.75rem"};
36
- padding-left: ${a=>a.prefix?"0":"0.75rem"};
32
+ ${r=>S.getComponentTypographyCss(r.theme,"Input",r.size,"enabled")}
33
+ min-height: ${r=>S.getSizeValueWithUnits(r.theme,r.size)};
34
+ max-height: ${r=>S.getSizeValueWithUnits(r.theme,r.size)};
35
+ color: ${r=>S.getColorRgbaValue(r.theme,"Input",r.focused===!0?"primary":r.color,"enabled","text")};
36
+ caret-color: ${r=>S.getColorRgbaValue(r.theme,"Input",r.color,"enabled","caret")};
37
+ padding-right: ${r=>r.suffix?"0":"0.75rem"};
38
+ padding-left: ${r=>r.prefix?"0":"0.75rem"};
37
39
  }
38
40
 
39
41
  & input:disabled {
40
- ${a=>b.getDisabledStateCss(a.theme)}
42
+ /* ${r=>S.getDisabledStateCss(r.theme)} */
43
+ ${r=>`background-color: ${S.getColorRgbaValue(r.theme,"Input",r.color,"disabled","background","backgroundOpacity")};
44
+ color: ${s=>S.getColorRgbaValue(s.theme,"Input",s.color,"disabled","text")};`}
41
45
  background: none;
42
46
  }
43
47
 
@@ -46,9 +50,9 @@
46
50
  }
47
51
 
48
52
  & input::placeholder {
49
- color: ${a=>b.getColorRgbaValue(a.theme,"Input",a.color,"enabled","placeholder")};
53
+ color: ${r=>S.getColorRgbaValue(r.theme,"Input",r.color,"enabled","placeholder")};
50
54
  }
51
55
  `,Q=K.styled.span`
52
56
  padding: 0 12px;
53
- color: ${a=>b.getColorRgbaValue(a.theme,"Input",a.focused===!0?"primary":a.color,"enabled","prefix")};
54
- `,ge=K.styled(Q)``,X=R.forwardRef((a,f)=>{const{disabled:u,readOnly:e,debounceTime:t=0,prefix:r,suffix:o,thousandSeparator:s=".",decimalSeparator:i=",",decimalScale:n=2,fixedDecimalScale:l=!0,allowNegative:c=!0,onChange:p,onBlur:d,onFocus:h,onInputChange:m,className:y="",style:x={},size:N="small",color:P="primary",...C}=a,g=ie.useTheme(),[w,F]=R.useState(!1),E=R.useCallback(ae.debounce((S,D)=>$(S,D),t),[p]),$=(S,D)=>{p&&(p==null||p(S,D)),m==null||m(S,D)},j=(S,D)=>{E(D.event,S==null?void 0:S.floatValue)},M=()=>n<0?0:n>17?17:n,U=S=>{F(!0),h==null||h(S)},V=S=>{F(!1),d==null||d(S)};return B.jsxs(he,{style:x,className:y,theme:g,color:P,size:N,prefix:r,suffix:o,focused:w,disabled:u,readOnly:e,children:[r&&B.jsx(Q,{theme:g,color:P,focused:w,className:"lnc-input-prefix",children:r}),B.jsx(J,{getInputRef:f,className:"lnc-decimal-input",disabled:u,readOnly:e,thousandSeparator:s,decimalSeparator:i,decimalScale:M(),fixedDecimalScale:l,allowNegative:c,onFocus:U,onBlur:V,onValueChange:j,...C}),o&&B.jsx(ge,{theme:g,color:P,focused:w,className:"lnc-input-suffix",children:o})]})});X.propTypes={id:v.PropTypes.any,value:v.PropTypes.any,defaultValue:v.PropTypes.any,disabled:v.PropTypes.bool,readOnly:v.PropTypes.bool,debounceTime:v.PropTypes.number,prefix:v.PropTypes.oneOfType([v.PropTypes.string,v.PropTypes.element]),suffix:v.PropTypes.oneOfType([v.PropTypes.string,v.PropTypes.element]),thousandSeparator:v.PropTypes.oneOf([".",","," "]),decimalSeparator:v.PropTypes.oneOf([".",","]),decimalScale:v.PropTypes.number,fixedDecimalScale:v.PropTypes.bool,allowNegative:v.PropTypes.bool,onChange:v.PropTypes.func,onInputChange:v.PropTypes.func,onBlur:v.PropTypes.func,onFocus:v.PropTypes.func,className:v.PropTypes.string,style:v.PropTypes.object,size:v.PropTypes.oneOf(["small","medium","large"]),color:v.PropTypes.oneOf(["primary","secondary","success","danger","warning","information","neutral","gray"])};module.exports=X;
57
+ color: ${r=>S.getColorRgbaValue(r.theme,"Input",r.focused===!0?"primary":r.color,"enabled","prefix")};
58
+ `,he=K.styled(Q)``,X=V.forwardRef((r,s)=>{const{disabled:f,readOnly:e,debounceTime:t=0,prefix:a,suffix:i,thousandSeparator:l=".",decimalSeparator:o=",",decimalScale:n=2,fixedDecimalScale:u=!0,allowNegative:p=!0,onChange:c,onBlur:d,onFocus:g,onInputChange:m,className:y="",style:x={},size:N="small",color:P="primary",...T}=r,h=oe.useTheme(),[w,R]=V.useState(!1),A=V.useCallback(ae.debounce((b,D)=>E(b,D),t),[c]),E=(b,D)=>{c&&(c==null||c(b,D)),m==null||m(b,D)},j=(b,D)=>{A(D.event,b==null?void 0:b.floatValue)},B=()=>n<0?0:n>17?17:n,M=b=>{R(!0),g==null||g(b)},F=b=>{R(!1),d==null||d(b)};return k.jsxs(ge,{style:x,className:y,theme:h,color:P,size:N,prefix:a,suffix:i,focused:w,disabled:f,readOnly:e,children:[a&&k.jsx(Q,{theme:h,color:P,focused:w,className:"lnc-input-prefix",children:a}),k.jsx(J,{getInputRef:s,className:"lnc-decimal-input",disabled:f,readOnly:e,thousandSeparator:l,decimalSeparator:o,decimalScale:B(),fixedDecimalScale:u,allowNegative:p,onFocus:M,onBlur:F,onValueChange:j,...T}),i&&k.jsx(he,{theme:h,color:P,focused:w,className:"lnc-input-suffix",children:i})]})});X.propTypes={id:v.PropTypes.any,value:v.PropTypes.any,defaultValue:v.PropTypes.any,disabled:v.PropTypes.bool,readOnly:v.PropTypes.bool,debounceTime:v.PropTypes.number,prefix:v.PropTypes.oneOfType([v.PropTypes.string,v.PropTypes.element]),suffix:v.PropTypes.oneOfType([v.PropTypes.string,v.PropTypes.element]),thousandSeparator:v.PropTypes.oneOf([".",","," "]),decimalSeparator:v.PropTypes.oneOf([".",","]),decimalScale:v.PropTypes.number,fixedDecimalScale:v.PropTypes.bool,allowNegative:v.PropTypes.bool,onChange:v.PropTypes.func,onInputChange:v.PropTypes.func,onBlur:v.PropTypes.func,onFocus:v.PropTypes.func,className:v.PropTypes.string,style:v.PropTypes.object,size:v.PropTypes.oneOf(["small","medium","large"]),color:v.PropTypes.oneOf(["primary","secondary","success","danger","warning","information","neutral","gray"])};module.exports=X;