@erpsquad/common 1.11.16 → 1.11.17

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 (393) hide show
  1. package/dist/chunks/{DonutChart-Clmcka3j.esm.js → DonutChart-CHkg2-Cf.esm.js} +2 -2
  2. package/dist/chunks/DonutChart-CHkg2-Cf.esm.js.map +1 -0
  3. package/dist/chunks/{DonutChart-C2Ery9_3.js → DonutChart-DuGeMCfp.js} +2 -2
  4. package/dist/chunks/DonutChart-DuGeMCfp.js.map +1 -0
  5. package/dist/chunks/{DynamicDependentField-7j5lYjYS.esm.js → DynamicDependentField-Ce-tAozi.esm.js} +2 -2
  6. package/dist/chunks/{DynamicDependentField-7j5lYjYS.esm.js.map → DynamicDependentField-Ce-tAozi.esm.js.map} +1 -1
  7. package/dist/chunks/{DynamicDependentField-9tfGvafJ.js → DynamicDependentField-GxrZyitN.js} +2 -2
  8. package/dist/chunks/{DynamicDependentField-9tfGvafJ.js.map → DynamicDependentField-GxrZyitN.js.map} +1 -1
  9. package/dist/chunks/{FORMS-BeMUVgtO.esm.js → FORMS-DIIdCyMC.esm.js} +4 -4
  10. package/dist/chunks/{FORMS-BeMUVgtO.esm.js.map → FORMS-DIIdCyMC.esm.js.map} +1 -1
  11. package/dist/chunks/{FORMS-CYZK-5U9.js → FORMS-TZ1wVVqW.js} +4 -4
  12. package/dist/chunks/{FORMS-CYZK-5U9.js.map → FORMS-TZ1wVVqW.js.map} +1 -1
  13. package/dist/chunks/{FlexibleReduxExample-CTua_rNa.esm.js → FlexibleReduxExample-Ddtd9APA.esm.js} +2 -2
  14. package/dist/chunks/{FlexibleReduxExample-CTua_rNa.esm.js.map → FlexibleReduxExample-Ddtd9APA.esm.js.map} +1 -1
  15. package/dist/chunks/{FlexibleReduxExample-n0KdDqdq.js → FlexibleReduxExample-DxKowu6j.js} +2 -2
  16. package/dist/chunks/{FlexibleReduxExample-n0KdDqdq.js.map → FlexibleReduxExample-DxKowu6j.js.map} +1 -1
  17. package/dist/chunks/{SectionFlowEditor-RCxuKsJo.esm.js → SectionFlowEditor-C5r-vlgM.esm.js} +2 -2
  18. package/dist/chunks/{SectionFlowEditor-RCxuKsJo.esm.js.map → SectionFlowEditor-C5r-vlgM.esm.js.map} +1 -1
  19. package/dist/chunks/{SectionFlowEditor-o0p5yhb0.js → SectionFlowEditor-a_CuPldq.js} +2 -2
  20. package/dist/chunks/{SectionFlowEditor-o0p5yhb0.js.map → SectionFlowEditor-a_CuPldq.js.map} +1 -1
  21. package/dist/chunks/{action-bar-CrLZCE20.js → action-bar-CVCsL_Wi.js} +2 -2
  22. package/dist/chunks/{action-bar-CrLZCE20.js.map → action-bar-CVCsL_Wi.js.map} +1 -1
  23. package/dist/chunks/{action-bar-aLoXgWIu.esm.js → action-bar-DWWV-bmH.esm.js} +2 -2
  24. package/dist/chunks/{action-bar-aLoXgWIu.esm.js.map → action-bar-DWWV-bmH.esm.js.map} +1 -1
  25. package/dist/chunks/{add-template-CbpyJG9n.esm.js → add-template-COet2MkE.esm.js} +2 -2
  26. package/dist/chunks/{add-template-CbpyJG9n.esm.js.map → add-template-COet2MkE.esm.js.map} +1 -1
  27. package/dist/chunks/{add-template-DCP8fhmm.js → add-template-vWz44K_U.js} +2 -2
  28. package/dist/chunks/{add-template-DCP8fhmm.js.map → add-template-vWz44K_U.js.map} +1 -1
  29. package/dist/chunks/{address-modal-D06eu6_D.esm.js → address-modal-CtXfz5zW.esm.js} +2 -2
  30. package/dist/chunks/{address-modal-D06eu6_D.esm.js.map → address-modal-CtXfz5zW.esm.js.map} +1 -1
  31. package/dist/chunks/{address-modal-CVGxqSI1.js → address-modal-ktRvgOII.js} +2 -2
  32. package/dist/chunks/{address-modal-CVGxqSI1.js.map → address-modal-ktRvgOII.js.map} +1 -1
  33. package/dist/chunks/{calculation-summary-Df2Yofs9.esm.js → calculation-summary-BhWssEJP.esm.js} +23 -15
  34. package/dist/chunks/calculation-summary-BhWssEJP.esm.js.map +1 -0
  35. package/dist/chunks/{calculation-summary-h8yqJbXT.js → calculation-summary-DdAaSwoG.js} +22 -14
  36. package/dist/chunks/calculation-summary-DdAaSwoG.js.map +1 -0
  37. package/dist/chunks/{common-utility-DsLPDj_x.esm.js → common-utility-CysFHPFF.esm.js} +3 -3
  38. package/dist/chunks/{common-utility-DsLPDj_x.esm.js.map → common-utility-CysFHPFF.esm.js.map} +1 -1
  39. package/dist/chunks/{common-utility-CB2GeM7s.js → common-utility-halGH0bB.js} +3 -3
  40. package/dist/chunks/{common-utility-CB2GeM7s.js.map → common-utility-halGH0bB.js.map} +1 -1
  41. package/dist/chunks/{custom-form-DLauBlOi.esm.js → custom-form-Ckf-Uxt0.esm.js} +3 -3
  42. package/dist/chunks/{custom-form-DLauBlOi.esm.js.map → custom-form-Ckf-Uxt0.esm.js.map} +1 -1
  43. package/dist/chunks/{custom-form-BsFuKa_i.js → custom-form-Cww9Lf-K.js} +3 -3
  44. package/dist/chunks/{custom-form-BsFuKa_i.js.map → custom-form-Cww9Lf-K.js.map} +1 -1
  45. package/dist/chunks/{document-preview-CeP63tE-.esm.js → document-preview-CVd96q6J.esm.js} +2 -2
  46. package/dist/chunks/{document-preview-CeP63tE-.esm.js.map → document-preview-CVd96q6J.esm.js.map} +1 -1
  47. package/dist/chunks/{document-preview-L4uj-kbX.js → document-preview-DZmlu28z.js} +2 -2
  48. package/dist/chunks/{document-preview-L4uj-kbX.js.map → document-preview-DZmlu28z.js.map} +1 -1
  49. package/dist/chunks/{dynamic-report-0U6-W0yq.esm.js → dynamic-report-BdAzlPCv.esm.js} +3 -3
  50. package/dist/chunks/{dynamic-report-0U6-W0yq.esm.js.map → dynamic-report-BdAzlPCv.esm.js.map} +1 -1
  51. package/dist/chunks/{dynamic-report-CGjXv1Yt.js → dynamic-report-BkeyWzPl.js} +3 -3
  52. package/dist/chunks/{dynamic-report-CGjXv1Yt.js.map → dynamic-report-BkeyWzPl.js.map} +1 -1
  53. package/dist/chunks/{dynamic-rows-QHSiECC3.js → dynamic-rows-BnpKGjfs.js} +2 -2
  54. package/dist/chunks/{dynamic-rows-QHSiECC3.js.map → dynamic-rows-BnpKGjfs.js.map} +1 -1
  55. package/dist/chunks/{dynamic-rows-DAVePe1K.esm.js → dynamic-rows-CizgZUSq.esm.js} +2 -2
  56. package/dist/chunks/{dynamic-rows-DAVePe1K.esm.js.map → dynamic-rows-CizgZUSq.esm.js.map} +1 -1
  57. package/dist/chunks/{filter-DFBU8pOw.js → filter-EI4YDeHb.js} +2 -2
  58. package/dist/chunks/{filter-DFBU8pOw.js.map → filter-EI4YDeHb.js.map} +1 -1
  59. package/dist/chunks/{filter-v5anQqdt.esm.js → filter-YrnAj1Sd.esm.js} +2 -2
  60. package/dist/chunks/{filter-v5anQqdt.esm.js.map → filter-YrnAj1Sd.esm.js.map} +1 -1
  61. package/dist/chunks/{footer-B5xhsCTA.js → footer-BOTb5Pdt.js} +2 -2
  62. package/dist/chunks/{footer-B5xhsCTA.js.map → footer-BOTb5Pdt.js.map} +1 -1
  63. package/dist/chunks/{footer-4CWFuV7L.esm.js → footer-xVA6bWdK.esm.js} +2 -2
  64. package/dist/chunks/{footer-4CWFuV7L.esm.js.map → footer-xVA6bWdK.esm.js.map} +1 -1
  65. package/dist/chunks/{form-fields-B7uOVxte.esm.js → form-fields-BZ4e0SWE.esm.js} +3 -3
  66. package/dist/chunks/{form-fields-B7uOVxte.esm.js.map → form-fields-BZ4e0SWE.esm.js.map} +1 -1
  67. package/dist/chunks/{form-fields-DLy8RmW8.js → form-fields-CThlEoKG.js} +3 -3
  68. package/dist/chunks/{form-fields-DLy8RmW8.js.map → form-fields-CThlEoKG.js.map} +1 -1
  69. package/dist/chunks/{form-parser-CN8iTuiy.esm.js → form-parser-BXrJJarh.esm.js} +2 -2
  70. package/dist/chunks/{form-parser-CN8iTuiy.esm.js.map → form-parser-BXrJJarh.esm.js.map} +1 -1
  71. package/dist/chunks/{form-parser-rEOkVkGf.js → form-parser-qkmrpjcS.js} +2 -2
  72. package/dist/chunks/{form-parser-rEOkVkGf.js.map → form-parser-qkmrpjcS.js.map} +1 -1
  73. package/dist/chunks/{form-section-DUap8zt0.esm.js → form-section-B99Eyti4.esm.js} +6 -6
  74. package/dist/chunks/{form-section-DUap8zt0.esm.js.map → form-section-B99Eyti4.esm.js.map} +1 -1
  75. package/dist/chunks/{form-section-D0dezEYJ.js → form-section-D0XR4X1M.js} +6 -6
  76. package/dist/chunks/{form-section-D0dezEYJ.js.map → form-section-D0XR4X1M.js.map} +1 -1
  77. package/dist/chunks/{inline-edit-fields-BKY-Ydnz.esm.js → inline-edit-fields-ApzKssmB.esm.js} +3 -3
  78. package/dist/chunks/{inline-edit-fields-BKY-Ydnz.esm.js.map → inline-edit-fields-ApzKssmB.esm.js.map} +1 -1
  79. package/dist/chunks/{inline-edit-fields-B8wvbE8F.js → inline-edit-fields-DPDi7qw9.js} +3 -3
  80. package/dist/chunks/{inline-edit-fields-B8wvbE8F.js.map → inline-edit-fields-DPDi7qw9.js.map} +1 -1
  81. package/dist/chunks/{inventory-reports-title-bar-GIJ2Gnhy.esm.js → inventory-reports-title-bar-DXV2qmaX.esm.js} +2 -2
  82. package/dist/chunks/{inventory-reports-title-bar-GIJ2Gnhy.esm.js.map → inventory-reports-title-bar-DXV2qmaX.esm.js.map} +1 -1
  83. package/dist/chunks/{inventory-reports-title-bar-BFBCwbDQ.js → inventory-reports-title-bar-Dx64_rth.js} +2 -2
  84. package/dist/chunks/{inventory-reports-title-bar-BFBCwbDQ.js.map → inventory-reports-title-bar-Dx64_rth.js.map} +1 -1
  85. package/dist/chunks/{item-response-details-ydnNXYiu.js → item-response-details-9Z-5mQjo.js} +3 -3
  86. package/dist/chunks/{item-response-details-ydnNXYiu.js.map → item-response-details-9Z-5mQjo.js.map} +1 -1
  87. package/dist/chunks/{item-response-details-CeJJmkPE.esm.js → item-response-details-ndQUEzoJ.esm.js} +3 -3
  88. package/dist/chunks/{item-response-details-CeJJmkPE.esm.js.map → item-response-details-ndQUEzoJ.esm.js.map} +1 -1
  89. package/dist/chunks/{listing-BXnAfgrz.js → listing-CwEZ3lwA.js} +4 -4
  90. package/dist/chunks/{listing-BXnAfgrz.js.map → listing-CwEZ3lwA.js.map} +1 -1
  91. package/dist/chunks/{listing-DWEuyGoa.esm.js → listing-gUMIDc0g.esm.js} +4 -4
  92. package/dist/chunks/{listing-DWEuyGoa.esm.js.map → listing-gUMIDc0g.esm.js.map} +1 -1
  93. package/dist/chunks/{location-select-69R1vU2l.js → location-select-B7eqyJIA.js} +2 -2
  94. package/dist/chunks/{location-select-69R1vU2l.js.map → location-select-B7eqyJIA.js.map} +1 -1
  95. package/dist/chunks/{location-select-CU1ZnpZV.esm.js → location-select-C1QJTCjJ.esm.js} +2 -2
  96. package/dist/chunks/{location-select-CU1ZnpZV.esm.js.map → location-select-C1QJTCjJ.esm.js.map} +1 -1
  97. package/dist/chunks/{material-editable-table-CFNPlmms.js → material-editable-table-CeEvqXDR.js} +2 -2
  98. package/dist/chunks/{material-editable-table-CFNPlmms.js.map → material-editable-table-CeEvqXDR.js.map} +1 -1
  99. package/dist/chunks/{material-editable-table-DYt2CbyW.esm.js → material-editable-table-DhnSjDIg.esm.js} +2 -2
  100. package/dist/chunks/{material-editable-table-DYt2CbyW.esm.js.map → material-editable-table-DhnSjDIg.esm.js.map} +1 -1
  101. package/dist/chunks/{media-D-ytT_Dz.js → media-BYslCf-G.js} +2 -2
  102. package/dist/chunks/{media-D-ytT_Dz.js.map → media-BYslCf-G.js.map} +1 -1
  103. package/dist/chunks/{media-Bba1HXPh.esm.js → media-DaNPnyN6.esm.js} +2 -2
  104. package/dist/chunks/{media-Bba1HXPh.esm.js.map → media-DaNPnyN6.esm.js.map} +1 -1
  105. package/dist/chunks/{page-action-CLNehJNq.js → page-action-D67uQos2.js} +2 -2
  106. package/dist/chunks/{page-action-CLNehJNq.js.map → page-action-D67uQos2.js.map} +1 -1
  107. package/dist/chunks/{page-action-DUBerP2H.esm.js → page-action-DeMlK7_Z.esm.js} +2 -2
  108. package/dist/chunks/{page-action-DUBerP2H.esm.js.map → page-action-DeMlK7_Z.esm.js.map} +1 -1
  109. package/dist/chunks/{page-navigator-waxCJJmN.esm.js → page-navigator-C1qeuTog.esm.js} +2 -2
  110. package/dist/chunks/{page-navigator-waxCJJmN.esm.js.map → page-navigator-C1qeuTog.esm.js.map} +1 -1
  111. package/dist/chunks/{page-navigator-Bi_JaWgl.js → page-navigator-GrvwmXFK.js} +2 -2
  112. package/dist/chunks/{page-navigator-Bi_JaWgl.js.map → page-navigator-GrvwmXFK.js.map} +1 -1
  113. package/dist/chunks/{page-view-CjiFgqLO.esm.js → page-view--2l4UyP3.esm.js} +3 -3
  114. package/dist/chunks/{page-view-CjiFgqLO.esm.js.map → page-view--2l4UyP3.esm.js.map} +1 -1
  115. package/dist/chunks/{page-view-BbWefmnS.js → page-view-BIVX9MW-.js} +3 -3
  116. package/dist/chunks/{page-view-BbWefmnS.js.map → page-view-BIVX9MW-.js.map} +1 -1
  117. package/dist/chunks/{reports-title-bar-BNp8lafg.js → reports-title-bar-QcRrO034.js} +2 -2
  118. package/dist/chunks/{reports-title-bar-BNp8lafg.js.map → reports-title-bar-QcRrO034.js.map} +1 -1
  119. package/dist/chunks/{reports-title-bar-DkQ7PL2f.esm.js → reports-title-bar-bjxQMPf0.esm.js} +2 -2
  120. package/dist/chunks/{reports-title-bar-DkQ7PL2f.esm.js.map → reports-title-bar-bjxQMPf0.esm.js.map} +1 -1
  121. package/dist/chunks/{routes-BvISTF8K.esm.js → routes-CHNGwv8o.esm.js} +3 -3
  122. package/dist/chunks/{routes-BvISTF8K.esm.js.map → routes-CHNGwv8o.esm.js.map} +1 -1
  123. package/dist/chunks/{routes-6gnAlgr1.js → routes-DchFzWUK.js} +3 -3
  124. package/dist/chunks/{routes-6gnAlgr1.js.map → routes-DchFzWUK.js.map} +1 -1
  125. package/dist/chunks/{schedule-report-kvsrUlaM.esm.js → schedule-report-BRq7YE4S.esm.js} +5 -5
  126. package/dist/chunks/{schedule-report-kvsrUlaM.esm.js.map → schedule-report-BRq7YE4S.esm.js.map} +1 -1
  127. package/dist/chunks/{schedule-report-CasHNN5c.js → schedule-report-DjPOCvGV.js} +5 -5
  128. package/dist/chunks/{schedule-report-CasHNN5c.js.map → schedule-report-DjPOCvGV.js.map} +1 -1
  129. package/dist/chunks/{schedule-report-modal-CSZ1elPT.esm.js → schedule-report-modal-DIwG6Q5L.esm.js} +2 -2
  130. package/dist/chunks/{schedule-report-modal-CSZ1elPT.esm.js.map → schedule-report-modal-DIwG6Q5L.esm.js.map} +1 -1
  131. package/dist/chunks/{schedule-report-modal-DkS0FiSP.js → schedule-report-modal-DuDutCZ2.js} +2 -2
  132. package/dist/chunks/{schedule-report-modal-DkS0FiSP.js.map → schedule-report-modal-DuDutCZ2.js.map} +1 -1
  133. package/dist/chunks/{searchable-select-DGHm_BXN.esm.js → searchable-select-BE6x02Y2.esm.js} +3 -3
  134. package/dist/chunks/{searchable-select-DGHm_BXN.esm.js.map → searchable-select-BE6x02Y2.esm.js.map} +1 -1
  135. package/dist/chunks/{searchable-select-DpITVC6k.js → searchable-select-BNcuRtBI.js} +3 -3
  136. package/dist/chunks/{searchable-select-DpITVC6k.js.map → searchable-select-BNcuRtBI.js.map} +1 -1
  137. package/dist/chunks/{share-modal-CNyMQLC9.esm.js → share-modal-BjnPzAJE.esm.js} +2 -2
  138. package/dist/chunks/{share-modal-CNyMQLC9.esm.js.map → share-modal-BjnPzAJE.esm.js.map} +1 -1
  139. package/dist/chunks/{share-modal-DbSLdKy0.js → share-modal-Cos6pJ52.js} +2 -2
  140. package/dist/chunks/{share-modal-DbSLdKy0.js.map → share-modal-Cos6pJ52.js.map} +1 -1
  141. package/dist/chunks/{share-modal-enhanced-B13Cp0XQ.js → share-modal-enhanced-Da-Muxia.js} +2 -2
  142. package/dist/chunks/{share-modal-enhanced-B13Cp0XQ.js.map → share-modal-enhanced-Da-Muxia.js.map} +1 -1
  143. package/dist/chunks/{share-modal-enhanced-DwFj55rH.esm.js → share-modal-enhanced-Dk0UTj_L.esm.js} +2 -2
  144. package/dist/chunks/{share-modal-enhanced-DwFj55rH.esm.js.map → share-modal-enhanced-Dk0UTj_L.esm.js.map} +1 -1
  145. package/dist/chunks/{table-3oBHOueQ.js → table-BkUON-J8.js} +2 -2
  146. package/dist/chunks/{table-3oBHOueQ.js.map → table-BkUON-J8.js.map} +1 -1
  147. package/dist/chunks/{table-DMAtPFDn.esm.js → table-VcnlwNfx.esm.js} +2 -2
  148. package/dist/chunks/{table-DMAtPFDn.esm.js.map → table-VcnlwNfx.esm.js.map} +1 -1
  149. package/dist/chunks/{template-editor-router-D_6pDntM.esm.js → template-editor-router-Ds5zDdiq.esm.js} +2 -2
  150. package/dist/chunks/{template-editor-router-D_6pDntM.esm.js.map → template-editor-router-Ds5zDdiq.esm.js.map} +1 -1
  151. package/dist/chunks/{template-editor-router-CJ_sWNaj.js → template-editor-router-c4QH4hW2.js} +2 -2
  152. package/dist/chunks/{template-editor-router-CJ_sWNaj.js.map → template-editor-router-c4QH4hW2.js.map} +1 -1
  153. package/dist/chunks/{templates-cJNFvwtW.esm.js → templates-BSbulMLk.esm.js} +5 -5
  154. package/dist/chunks/{templates-cJNFvwtW.esm.js.map → templates-BSbulMLk.esm.js.map} +1 -1
  155. package/dist/chunks/{templates-2MhT1ZBz.js → templates-nCEKh4V8.js} +5 -5
  156. package/dist/chunks/{templates-2MhT1ZBz.js.map → templates-nCEKh4V8.js.map} +1 -1
  157. package/dist/chunks/{total-summary-DPwXK8LV.esm.js → total-summary-BCNJd8iL.esm.js} +2 -2
  158. package/dist/chunks/total-summary-BCNJd8iL.esm.js.map +1 -0
  159. package/dist/chunks/{total-summary-BSFpn_1I.js → total-summary-BhLK6YOW.js} +2 -2
  160. package/dist/chunks/total-summary-BhLK6YOW.js.map +1 -0
  161. package/dist/chunks/{uom-field-wrapper-DNI7KtMP.js → uom-field-wrapper-CF54ETpT.js} +2 -2
  162. package/dist/chunks/{uom-field-wrapper-DNI7KtMP.js.map → uom-field-wrapper-CF54ETpT.js.map} +1 -1
  163. package/dist/chunks/{uom-field-wrapper-DZDgpxL-.esm.js → uom-field-wrapper-Cwz0sOU3.esm.js} +2 -2
  164. package/dist/chunks/{uom-field-wrapper-DZDgpxL-.esm.js.map → uom-field-wrapper-Cwz0sOU3.esm.js.map} +1 -1
  165. package/dist/chunks/{upload-media-_L_CsSat.js → upload-media-BGLbYZW7.js} +2 -2
  166. package/dist/chunks/{upload-media-_L_CsSat.js.map → upload-media-BGLbYZW7.js.map} +1 -1
  167. package/dist/chunks/{upload-media-COLbbU-V.esm.js → upload-media-CtRn1ES6.esm.js} +2 -2
  168. package/dist/chunks/{upload-media-COLbbU-V.esm.js.map → upload-media-CtRn1ES6.esm.js.map} +1 -1
  169. package/dist/chunks/{use-material-calculations-CqYB_JaZ.esm.js → use-material-calculations-B5K1gB4M.esm.js} +4 -2
  170. package/dist/chunks/use-material-calculations-B5K1gB4M.esm.js.map +1 -0
  171. package/dist/chunks/{use-material-calculations-CWflfqhd.js → use-material-calculations-DKgA8HPj.js} +4 -2
  172. package/dist/chunks/use-material-calculations-DKgA8HPj.js.map +1 -0
  173. package/dist/chunks/{useAdditionalDiscountAutoCalc-CgTlmKfL.esm.js → useAdditionalDiscountAutoCalc-CYG36AFm.esm.js} +29 -9
  174. package/dist/chunks/useAdditionalDiscountAutoCalc-CYG36AFm.esm.js.map +1 -0
  175. package/dist/chunks/{useAdditionalDiscountAutoCalc-BCek0vno.js → useAdditionalDiscountAutoCalc-DgzVMSln.js} +28 -8
  176. package/dist/chunks/useAdditionalDiscountAutoCalc-DgzVMSln.js.map +1 -0
  177. package/dist/chunks/{value-editor-CklAFZvY.esm.js → value-editor-DuyEKmpN.esm.js} +2 -2
  178. package/dist/chunks/{value-editor-CklAFZvY.esm.js.map → value-editor-DuyEKmpN.esm.js.map} +1 -1
  179. package/dist/chunks/{value-editor-B8ezmWrk.js → value-editor-_I-xDmYy.js} +2 -2
  180. package/dist/chunks/{value-editor-B8ezmWrk.js.map → value-editor-_I-xDmYy.js.map} +1 -1
  181. package/dist/chunks/{vendor-ai-summary-ZObIqpEf.js → vendor-ai-summary-CO8qMRWq.js} +2 -2
  182. package/dist/chunks/{vendor-ai-summary-ZObIqpEf.js.map → vendor-ai-summary-CO8qMRWq.js.map} +1 -1
  183. package/dist/chunks/{vendor-ai-summary-B4EjhxYp.esm.js → vendor-ai-summary-DeQg7jG1.esm.js} +2 -2
  184. package/dist/chunks/{vendor-ai-summary-B4EjhxYp.esm.js.map → vendor-ai-summary-DeQg7jG1.esm.js.map} +1 -1
  185. package/dist/components/action-bar/action-bar/index.esm.js +1 -1
  186. package/dist/components/action-bar/action-bar/index.js +1 -1
  187. package/dist/components/action-bar/index.esm.js +1 -1
  188. package/dist/components/action-bar/index.js +1 -1
  189. package/dist/components/address-modal/index.esm.js +1 -1
  190. package/dist/components/address-modal/index.js +1 -1
  191. package/dist/components/calculation-summary/calculation-summary/index.esm.js +1 -1
  192. package/dist/components/calculation-summary/calculation-summary/index.js +1 -1
  193. package/dist/components/calculation-summary/components/index.esm.js +1 -1
  194. package/dist/components/calculation-summary/components/index.js +1 -1
  195. package/dist/components/calculation-summary/components/total-summary/index.esm.js +1 -1
  196. package/dist/components/calculation-summary/components/total-summary/index.js +1 -1
  197. package/dist/components/calculation-summary/index.esm.js +2 -2
  198. package/dist/components/calculation-summary/index.js +2 -2
  199. package/dist/components/charts/donutChart/DonutChart/index.esm.js +1 -1
  200. package/dist/components/charts/donutChart/DonutChart/index.js +1 -1
  201. package/dist/components/charts/donutChart/index.esm.js +1 -1
  202. package/dist/components/charts/donutChart/index.js +1 -1
  203. package/dist/components/charts/index.esm.js +1 -1
  204. package/dist/components/charts/index.js +1 -1
  205. package/dist/components/custom-forms/FORMS/index.esm.js +1 -1
  206. package/dist/components/custom-forms/FORMS/index.js +1 -1
  207. package/dist/components/custom-forms/index.esm.js +1 -1
  208. package/dist/components/custom-forms/index.js +1 -1
  209. package/dist/components/department-add-modal/index.esm.js +1 -1
  210. package/dist/components/department-add-modal/index.js +1 -1
  211. package/dist/components/designation-add-modal/index.esm.js +1 -1
  212. package/dist/components/designation-add-modal/index.js +1 -1
  213. package/dist/components/document-preview/index.esm.js +1 -1
  214. package/dist/components/document-preview/index.js +1 -1
  215. package/dist/components/examples/FlexibleReduxExample/index.esm.js +1 -1
  216. package/dist/components/examples/FlexibleReduxExample/index.js +1 -1
  217. package/dist/components/examples/index.esm.js +1 -1
  218. package/dist/components/examples/index.js +1 -1
  219. package/dist/components/filter/components/index.esm.js +1 -1
  220. package/dist/components/filter/components/index.js +1 -1
  221. package/dist/components/filter/components/value-editor/index.esm.js +1 -1
  222. package/dist/components/filter/components/value-editor/index.js +1 -1
  223. package/dist/components/filter/filter/index.esm.js +1 -1
  224. package/dist/components/filter/filter/index.js +1 -1
  225. package/dist/components/filter/index.esm.js +2 -2
  226. package/dist/components/filter/index.js +2 -2
  227. package/dist/components/footer/footer/index.esm.js +1 -1
  228. package/dist/components/footer/footer/index.js +1 -1
  229. package/dist/components/footer/index.esm.js +1 -1
  230. package/dist/components/footer/index.js +1 -1
  231. package/dist/components/form-control/form-builder/form-builder-element/dynamic-dependent-field/index.esm.js +1 -1
  232. package/dist/components/form-control/form-builder/form-builder-element/dynamic-dependent-field/index.js +1 -1
  233. package/dist/components/form-control/form-builder/form-builder-element/dynamic-select/index.esm.js +1 -1
  234. package/dist/components/form-control/form-builder/form-builder-element/dynamic-select/index.js +1 -1
  235. package/dist/components/form-control/form-builder/form-builder-element/fixed-asset-item-add-modal/index.esm.js +1 -1
  236. package/dist/components/form-control/form-builder/form-builder-element/fixed-asset-item-add-modal/index.js +1 -1
  237. package/dist/components/form-control/form-builder/form-builder-element/index.esm.js +4 -4
  238. package/dist/components/form-control/form-builder/form-builder-element/index.js +4 -4
  239. package/dist/components/form-control/form-builder/form-builder-element/location-add-modal/index.esm.js +1 -1
  240. package/dist/components/form-control/form-builder/form-builder-element/location-add-modal/index.js +1 -1
  241. package/dist/components/form-control/form-builder/form-builder-element/media/index.esm.js +1 -1
  242. package/dist/components/form-control/form-builder/form-builder-element/media/index.js +1 -1
  243. package/dist/components/form-control/form-builder/form-builder-element/select-configuration/index.esm.js +1 -1
  244. package/dist/components/form-control/form-builder/form-builder-element/select-configuration/index.js +1 -1
  245. package/dist/components/form-control/form-builder/form-builder-element/table/index.esm.js +1 -1
  246. package/dist/components/form-control/form-builder/form-builder-element/table/index.js +1 -1
  247. package/dist/components/form-control/form-builder/index.esm.js +4 -4
  248. package/dist/components/form-control/form-builder/index.js +4 -4
  249. package/dist/components/form-control/form-parser/form-parser/index.esm.js +1 -1
  250. package/dist/components/form-control/form-parser/form-parser/index.js +1 -1
  251. package/dist/components/form-control/form-parser/form-section/index.esm.js +1 -1
  252. package/dist/components/form-control/form-parser/form-section/index.js +1 -1
  253. package/dist/components/form-control/form-parser/index.esm.js +2 -2
  254. package/dist/components/form-control/form-parser/index.js +2 -2
  255. package/dist/components/form-control/index.esm.js +6 -6
  256. package/dist/components/form-control/index.js +6 -6
  257. package/dist/components/index.esm.js +30 -30
  258. package/dist/components/index.js +30 -30
  259. package/dist/components/inventory-reports-title-bar/index.esm.js +1 -1
  260. package/dist/components/inventory-reports-title-bar/index.js +1 -1
  261. package/dist/components/inventory-reports-title-bar/inventory-reports-title-bar/index.esm.js +1 -1
  262. package/dist/components/inventory-reports-title-bar/inventory-reports-title-bar/index.js +1 -1
  263. package/dist/components/listing/index.esm.js +1 -1
  264. package/dist/components/listing/index.js +1 -1
  265. package/dist/components/listing/listing/index.esm.js +1 -1
  266. package/dist/components/listing/listing/index.js +1 -1
  267. package/dist/components/location-select/index.esm.js +1 -1
  268. package/dist/components/location-select/index.js +1 -1
  269. package/dist/components/material-editable-table/components/index.esm.js +1 -1
  270. package/dist/components/material-editable-table/components/index.js +1 -1
  271. package/dist/components/material-editable-table/components/inline-edit-fields/index.esm.js +1 -1
  272. package/dist/components/material-editable-table/components/inline-edit-fields/index.js +1 -1
  273. package/dist/components/material-editable-table/index.esm.js +2 -2
  274. package/dist/components/material-editable-table/index.js +2 -2
  275. package/dist/components/material-editable-table/material-editable-table/index.esm.js +1 -1
  276. package/dist/components/material-editable-table/material-editable-table/index.js +1 -1
  277. package/dist/components/material-table/components/index.esm.js +1 -1
  278. package/dist/components/material-table/components/index.js +1 -1
  279. package/dist/components/material-table/components/inline-edit-fields/index.esm.js +1 -1
  280. package/dist/components/material-table/components/inline-edit-fields/index.js +1 -1
  281. package/dist/components/material-table/index.esm.js +1 -1
  282. package/dist/components/material-table/index.js +1 -1
  283. package/dist/components/material-table/material-table/index.esm.js +1 -1
  284. package/dist/components/material-table/material-table/index.js +1 -1
  285. package/dist/components/page-navigator/components/index.esm.js +1 -1
  286. package/dist/components/page-navigator/components/index.js +1 -1
  287. package/dist/components/page-navigator/components/page-action/index.esm.js +1 -1
  288. package/dist/components/page-navigator/components/page-action/index.js +1 -1
  289. package/dist/components/page-navigator/index.esm.js +2 -2
  290. package/dist/components/page-navigator/index.js +2 -2
  291. package/dist/components/page-navigator/page-navigator/index.esm.js +1 -1
  292. package/dist/components/page-navigator/page-navigator/index.js +1 -1
  293. package/dist/components/parties-modal/index.esm.js +1 -1
  294. package/dist/components/parties-modal/index.js +1 -1
  295. package/dist/components/parties-modal/parties-modal/index.esm.js +1 -1
  296. package/dist/components/parties-modal/parties-modal/index.js +1 -1
  297. package/dist/components/reports/dynamic-report/dynamic-report/index.esm.js +1 -1
  298. package/dist/components/reports/dynamic-report/dynamic-report/index.js +1 -1
  299. package/dist/components/reports/dynamic-report/dynamic-rows/index.esm.js +1 -1
  300. package/dist/components/reports/dynamic-report/dynamic-rows/index.js +1 -1
  301. package/dist/components/reports/dynamic-report/index.esm.js +2 -2
  302. package/dist/components/reports/dynamic-report/index.js +2 -2
  303. package/dist/components/reports/index.esm.js +2 -2
  304. package/dist/components/reports/index.js +2 -2
  305. package/dist/components/reports-title-bar/index.esm.js +1 -1
  306. package/dist/components/reports-title-bar/index.js +1 -1
  307. package/dist/components/reports-title-bar/reports-title-bar/index.esm.js +1 -1
  308. package/dist/components/reports-title-bar/reports-title-bar/index.js +1 -1
  309. package/dist/components/rfq-response/index.esm.js +1 -1
  310. package/dist/components/rfq-response/index.js +1 -1
  311. package/dist/components/rfq-response/item-response-details/index.esm.js +1 -1
  312. package/dist/components/rfq-response/item-response-details/index.js +1 -1
  313. package/dist/components/schedule-report/index.esm.js +2 -2
  314. package/dist/components/schedule-report/index.js +2 -2
  315. package/dist/components/schedule-report/schedule-report/index.esm.js +1 -1
  316. package/dist/components/schedule-report/schedule-report/index.js +1 -1
  317. package/dist/components/schedule-report/schedule-report-modal/index.esm.js +1 -1
  318. package/dist/components/schedule-report/schedule-report-modal/index.js +1 -1
  319. package/dist/components/searchable-select/index.esm.js +1 -1
  320. package/dist/components/searchable-select/index.js +1 -1
  321. package/dist/components/share-modal/index.esm.js +2 -2
  322. package/dist/components/share-modal/index.js +2 -2
  323. package/dist/components/share-modal/share-modal/index.esm.js +1 -1
  324. package/dist/components/share-modal/share-modal/index.js +1 -1
  325. package/dist/components/share-modal/share-modal-enhanced/index.esm.js +1 -1
  326. package/dist/components/share-modal/share-modal-enhanced/index.js +1 -1
  327. package/dist/components/team-add-modal/index.esm.js +1 -1
  328. package/dist/components/team-add-modal/index.js +1 -1
  329. package/dist/components/uom-field-wrapper/index.esm.js +1 -1
  330. package/dist/components/uom-field-wrapper/index.js +1 -1
  331. package/dist/components/uom-field-wrapper/uom-field-wrapper/index.esm.js +1 -1
  332. package/dist/components/uom-field-wrapper/uom-field-wrapper/index.js +1 -1
  333. package/dist/components/upload-media/index.esm.js +1 -1
  334. package/dist/components/upload-media/index.js +1 -1
  335. package/dist/components/upload-media/upload-media/index.esm.js +1 -1
  336. package/dist/components/upload-media/upload-media/index.js +1 -1
  337. package/dist/components/vendor-ai-summary/index.esm.js +1 -1
  338. package/dist/components/vendor-ai-summary/index.js +1 -1
  339. package/dist/hooks/index.esm.js +2 -2
  340. package/dist/hooks/index.js +2 -2
  341. package/dist/hooks/use-material-calculations/index.esm.js +1 -1
  342. package/dist/hooks/use-material-calculations/index.js +1 -1
  343. package/dist/hooks/useAdditionalDiscountAutoCalc/index.esm.js +1 -1
  344. package/dist/hooks/useAdditionalDiscountAutoCalc/index.js +1 -1
  345. package/dist/index.esm.js +43 -42
  346. package/dist/index.js +42 -41
  347. package/dist/index.js.map +1 -1
  348. package/dist/src/components/calculation-summary/calculation-summary.d.ts +1 -0
  349. package/dist/src/hooks/use-material-calculations.d.ts +2 -2
  350. package/dist/src/hooks/useAdditionalDiscountAutoCalc.d.ts +3 -0
  351. package/dist/src/utils/calculation.d.ts +10 -1
  352. package/dist/utils/calculation/index.esm.js +24 -11
  353. package/dist/utils/calculation/index.esm.js.map +1 -1
  354. package/dist/utils/calculation/index.js +24 -11
  355. package/dist/utils/calculation/index.js.map +1 -1
  356. package/dist/utils/common-utility/index.esm.js +1 -1
  357. package/dist/utils/common-utility/index.js +1 -1
  358. package/dist/utils/index.esm.js +3 -2
  359. package/dist/utils/index.js +2 -1
  360. package/dist/utils/index.js.map +1 -1
  361. package/dist/views/afterAuth/index.esm.js +1 -1
  362. package/dist/views/afterAuth/index.js +1 -1
  363. package/dist/views/afterAuth/page-view/index.esm.js +1 -1
  364. package/dist/views/afterAuth/page-view/index.js +1 -1
  365. package/dist/views/form-builder/custom-form/index.esm.js +1 -1
  366. package/dist/views/form-builder/custom-form/index.js +1 -1
  367. package/dist/views/form-builder/form-fields/index.esm.js +1 -1
  368. package/dist/views/form-builder/form-fields/index.js +1 -1
  369. package/dist/views/form-builder/index.esm.js +2 -2
  370. package/dist/views/form-builder/index.js +2 -2
  371. package/dist/views/index.esm.js +8 -8
  372. package/dist/views/index.js +8 -8
  373. package/dist/views/template-editor/add-template/index.esm.js +1 -1
  374. package/dist/views/template-editor/add-template/index.js +1 -1
  375. package/dist/views/template-editor/components/index.esm.js +1 -1
  376. package/dist/views/template-editor/components/index.js +1 -1
  377. package/dist/views/template-editor/index.esm.js +5 -5
  378. package/dist/views/template-editor/index.js +5 -5
  379. package/dist/views/template-editor/routes/index.esm.js +1 -1
  380. package/dist/views/template-editor/routes/index.js +1 -1
  381. package/dist/views/template-editor/templates/index.esm.js +1 -1
  382. package/dist/views/template-editor/templates/index.js +1 -1
  383. package/package.json +1 -1
  384. package/dist/chunks/DonutChart-C2Ery9_3.js.map +0 -1
  385. package/dist/chunks/DonutChart-Clmcka3j.esm.js.map +0 -1
  386. package/dist/chunks/calculation-summary-Df2Yofs9.esm.js.map +0 -1
  387. package/dist/chunks/calculation-summary-h8yqJbXT.js.map +0 -1
  388. package/dist/chunks/total-summary-BSFpn_1I.js.map +0 -1
  389. package/dist/chunks/total-summary-DPwXK8LV.esm.js.map +0 -1
  390. package/dist/chunks/use-material-calculations-CWflfqhd.js.map +0 -1
  391. package/dist/chunks/use-material-calculations-CqYB_JaZ.esm.js.map +0 -1
  392. package/dist/chunks/useAdditionalDiscountAutoCalc-BCek0vno.js.map +0 -1
  393. package/dist/chunks/useAdditionalDiscountAutoCalc-CgTlmKfL.esm.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const dashboard = require("../../chunks/dashboard-CMMpzQfb.js");
4
- const pageView = require("../../chunks/page-view-BbWefmnS.js");
4
+ const pageView = require("../../chunks/page-view-BIVX9MW-.js");
5
5
  const reducer = require("../../chunks/reducer-D55uDKxv.js");
6
6
  const defaultData = require("../../chunks/default-data-bPISa600.js");
7
7
  exports.Dashboard = dashboard.Dashboard;
@@ -1,4 +1,4 @@
1
- import { P, P as P2, f, l, p, r, s, a, b, c, d } from "../../../chunks/page-view-CjiFgqLO.esm.js";
1
+ import { P, P as P2, f, l, p, r, s, a, b, c, d } from "../../../chunks/page-view--2l4UyP3.esm.js";
2
2
  import { d as d2 } from "../../../chunks/default-data-DliAObF-.esm.js";
3
3
  export {
4
4
  P as PageView,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const pageView = require("../../../chunks/page-view-BbWefmnS.js");
3
+ const pageView = require("../../../chunks/page-view-BIVX9MW-.js");
4
4
  const defaultData = require("../../../chunks/default-data-bPISa600.js");
5
5
  exports.PageView = pageView.PageView;
6
6
  exports.default = pageView.PageView;
@@ -1,4 +1,4 @@
1
- import { C, C as C2 } from "../../../chunks/custom-form-DLauBlOi.esm.js";
1
+ import { C, C as C2 } from "../../../chunks/custom-form-Ckf-Uxt0.esm.js";
2
2
  export {
3
3
  C as CustomForm,
4
4
  C2 as default
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const customForm = require("../../../chunks/custom-form-BsFuKa_i.js");
3
+ const customForm = require("../../../chunks/custom-form-Cww9Lf-K.js");
4
4
  exports.CustomForm = customForm.CustomForm;
5
5
  exports.default = customForm.CustomForm;
6
6
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import { F, a, a as a2 } from "../../../chunks/form-fields-B7uOVxte.esm.js";
1
+ import { F, a, a as a2 } from "../../../chunks/form-fields-BZ4e0SWE.esm.js";
2
2
  export {
3
3
  F as FormField,
4
4
  a as FormFields,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const formFields = require("../../../chunks/form-fields-DLy8RmW8.js");
3
+ const formFields = require("../../../chunks/form-fields-CThlEoKG.js");
4
4
  exports.FormField = formFields.FormField;
5
5
  exports.FormFields = formFields.FormFields;
6
6
  exports.default = formFields.FormFields;
@@ -1,6 +1,6 @@
1
- import { C, C as C2 } from "../../chunks/custom-form-DLauBlOi.esm.js";
1
+ import { C, C as C2 } from "../../chunks/custom-form-Ckf-Uxt0.esm.js";
2
2
  import { element } from "./field_properties/index.esm.js";
3
- import { F, a } from "../../chunks/form-fields-B7uOVxte.esm.js";
3
+ import { F, a } from "../../chunks/form-fields-BZ4e0SWE.esm.js";
4
4
  import { C as C3, F as F2, S, a as a2, T, b } from "../../chunks/table-form-CUKXlzGW.esm.js";
5
5
  import { C as C4 } from "../../chunks/column-width-yleuuXlA.esm.js";
6
6
  import { r, g, a as a3, p, c, s, d, b as b2 } from "../../chunks/reducer-DfQtshgN.esm.js";
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const customForm = require("../../chunks/custom-form-BsFuKa_i.js");
3
+ const customForm = require("../../chunks/custom-form-Cww9Lf-K.js");
4
4
  const views_formBuilder_field_properties = require("./field_properties/index.js");
5
- const formFields = require("../../chunks/form-fields-DLy8RmW8.js");
5
+ const formFields = require("../../chunks/form-fields-CThlEoKG.js");
6
6
  const tableForm = require("../../chunks/table-form-NMui-WuD.js");
7
7
  const columnWidth = require("../../chunks/column-width-DUiFD1ia.js");
8
8
  const reducer = require("../../chunks/reducer-DOug0smg.js");
@@ -1,24 +1,24 @@
1
1
  import { N } from "../chunks/404-Bk248JAI.esm.js";
2
2
  import { P } from "../chunks/privateRoute-GCpHHiYj.esm.js";
3
3
  import { D } from "../chunks/dashboard-D1x9pZ64.esm.js";
4
- import { P as P2, f, l, p, r, s, a, b, c } from "../chunks/page-view-CjiFgqLO.esm.js";
4
+ import { P as P2, f, l, p, r, s, a, b, c } from "../chunks/page-view--2l4UyP3.esm.js";
5
5
  import { C } from "../chunks/change-password-DA8sA6nv.esm.js";
6
6
  import { F } from "../chunks/forgot-password-BCZZCGPP.esm.js";
7
7
  import { L } from "../chunks/landing-CXgEaZ_L.esm.js";
8
8
  import { R } from "../chunks/reset-password-sEYSk2pm.esm.js";
9
- import { C as C2 } from "../chunks/custom-form-DLauBlOi.esm.js";
9
+ import { C as C2 } from "../chunks/custom-form-Ckf-Uxt0.esm.js";
10
10
  import { element } from "./form-builder/field_properties/index.esm.js";
11
- import { F as F2, a as a2 } from "../chunks/form-fields-B7uOVxte.esm.js";
11
+ import { F as F2, a as a2 } from "../chunks/form-fields-BZ4e0SWE.esm.js";
12
12
  import { C as C3, F as F3, S, a as a3, T, b as b2 } from "../chunks/table-form-CUKXlzGW.esm.js";
13
13
  import { C as C4 } from "../chunks/column-width-yleuuXlA.esm.js";
14
14
  import { r as r2, g, a as a4, p as p2, c as c2, s as s2, b as b3 } from "../chunks/reducer-DfQtshgN.esm.js";
15
15
  import { c as c3, e, f as f2, g as g2, a as a5, p as p3, b as b4, u, d } from "../chunks/common-yORBIVv-.esm.js";
16
- import { t } from "../chunks/routes-BvISTF8K.esm.js";
17
- import { T as T2 } from "../chunks/template-editor-router-D_6pDntM.esm.js";
18
- import { T as T3 } from "../chunks/templates-cJNFvwtW.esm.js";
19
- import { A } from "../chunks/add-template-CbpyJG9n.esm.js";
16
+ import { t } from "../chunks/routes-CHNGwv8o.esm.js";
17
+ import { T as T2 } from "../chunks/template-editor-router-Ds5zDdiq.esm.js";
18
+ import { T as T3 } from "../chunks/templates-BSbulMLk.esm.js";
19
+ import { A } from "../chunks/add-template-COet2MkE.esm.js";
20
20
  import { C as C5 } from "../chunks/company-selection-modal-Dn2L_skh.esm.js";
21
- import { A as A2, B, a as a6, C as C6, D as D2, E, b as b5, M, c as c4, I, T as T4, S as S2, d as d2, e as e2, f as f3 } from "../chunks/SectionFlowEditor-RCxuKsJo.esm.js";
21
+ import { A as A2, B, a as a6, C as C6, D as D2, E, b as b5, M, c as c4, I, T as T4, S as S2, d as d2, e as e2, f as f3 } from "../chunks/SectionFlowEditor-C5r-vlgM.esm.js";
22
22
  import { E as E2 } from "../chunks/edit-section-modal-s8bmuxWT.esm.js";
23
23
  import { H, T as T5 } from "../chunks/template-modal-CroPvCvf.esm.js";
24
24
  import { T as T6 } from "../chunks/template-name-modal-CLROXhxo.esm.js";
@@ -3,24 +3,24 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const _404 = require("../chunks/404-BGcgG3L-.js");
4
4
  const privateRoute = require("../chunks/privateRoute-BCJ6P0lE.js");
5
5
  const dashboard = require("../chunks/dashboard-CMMpzQfb.js");
6
- const pageView = require("../chunks/page-view-BbWefmnS.js");
6
+ const pageView = require("../chunks/page-view-BIVX9MW-.js");
7
7
  const changePassword = require("../chunks/change-password-CyUVIeLH.js");
8
8
  const forgotPassword = require("../chunks/forgot-password-DuQSW9RF.js");
9
9
  const landing = require("../chunks/landing-Z1wmXBSU.js");
10
10
  const resetPassword = require("../chunks/reset-password-PegS8YU7.js");
11
- const customForm = require("../chunks/custom-form-BsFuKa_i.js");
11
+ const customForm = require("../chunks/custom-form-Cww9Lf-K.js");
12
12
  const views_formBuilder_field_properties = require("./form-builder/field_properties/index.js");
13
- const formFields = require("../chunks/form-fields-DLy8RmW8.js");
13
+ const formFields = require("../chunks/form-fields-CThlEoKG.js");
14
14
  const tableForm = require("../chunks/table-form-NMui-WuD.js");
15
15
  const columnWidth = require("../chunks/column-width-DUiFD1ia.js");
16
16
  const reducer$1 = require("../chunks/reducer-DOug0smg.js");
17
17
  const common = require("../chunks/common-CS5L0Ld_.js");
18
- const routes = require("../chunks/routes-6gnAlgr1.js");
19
- const templateEditorRouter = require("../chunks/template-editor-router-CJ_sWNaj.js");
20
- const templates = require("../chunks/templates-2MhT1ZBz.js");
21
- const addTemplate = require("../chunks/add-template-DCP8fhmm.js");
18
+ const routes = require("../chunks/routes-DchFzWUK.js");
19
+ const templateEditorRouter = require("../chunks/template-editor-router-c4QH4hW2.js");
20
+ const templates = require("../chunks/templates-nCEKh4V8.js");
21
+ const addTemplate = require("../chunks/add-template-vWz44K_U.js");
22
22
  const companySelectionModal = require("../chunks/company-selection-modal-B7jFVWWs.js");
23
- const SectionFlowEditor = require("../chunks/SectionFlowEditor-o0p5yhb0.js");
23
+ const SectionFlowEditor = require("../chunks/SectionFlowEditor-a_CuPldq.js");
24
24
  const editSectionModal = require("../chunks/edit-section-modal-BKUNY9LU.js");
25
25
  const templateModal = require("../chunks/template-modal-D8R8r2XF.js");
26
26
  const templateNameModal = require("../chunks/template-name-modal-CeqxIE2r.js");
@@ -1,4 +1,4 @@
1
- import { A, A as A2 } from "../../../chunks/add-template-CbpyJG9n.esm.js";
1
+ import { A, A as A2 } from "../../../chunks/add-template-COet2MkE.esm.js";
2
2
  export {
3
3
  A as AddTemplate,
4
4
  A2 as default
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const addTemplate = require("../../../chunks/add-template-DCP8fhmm.js");
3
+ const addTemplate = require("../../../chunks/add-template-vWz44K_U.js");
4
4
  exports.AddTemplate = addTemplate.AddTemplate;
5
5
  exports.default = addTemplate.AddTemplate;
6
6
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import { A, B, a, C, D, E, b, M, c, I, T, S, d, e, f, E as E2 } from "../../../chunks/SectionFlowEditor-RCxuKsJo.esm.js";
1
+ import { A, B, a, C, D, E, b, M, c, I, T, S, d, e, f, E as E2 } from "../../../chunks/SectionFlowEditor-C5r-vlgM.esm.js";
2
2
  export {
3
3
  A as AlignmentControl,
4
4
  B as BorderControl,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const SectionFlowEditor = require("../../../chunks/SectionFlowEditor-o0p5yhb0.js");
3
+ const SectionFlowEditor = require("../../../chunks/SectionFlowEditor-a_CuPldq.js");
4
4
  exports.AlignmentControl = SectionFlowEditor.AlignmentControl;
5
5
  exports.BorderControl = SectionFlowEditor.BorderControl;
6
6
  exports.ButtonControls = SectionFlowEditor.ButtonControls;
@@ -1,9 +1,9 @@
1
- import { t } from "../../chunks/routes-BvISTF8K.esm.js";
2
- import { T } from "../../chunks/template-editor-router-D_6pDntM.esm.js";
3
- import { T as T2, T as T3 } from "../../chunks/templates-cJNFvwtW.esm.js";
4
- import { A } from "../../chunks/add-template-CbpyJG9n.esm.js";
1
+ import { t } from "../../chunks/routes-CHNGwv8o.esm.js";
2
+ import { T } from "../../chunks/template-editor-router-Ds5zDdiq.esm.js";
3
+ import { T as T2, T as T3 } from "../../chunks/templates-BSbulMLk.esm.js";
4
+ import { A } from "../../chunks/add-template-COet2MkE.esm.js";
5
5
  import { C } from "../../chunks/company-selection-modal-Dn2L_skh.esm.js";
6
- import { A as A2, B, a, C as C2, D, E, b, M, c, I, T as T4, S, d, e, f } from "../../chunks/SectionFlowEditor-RCxuKsJo.esm.js";
6
+ import { A as A2, B, a, C as C2, D, E, b, M, c, I, T as T4, S, d, e, f } from "../../chunks/SectionFlowEditor-C5r-vlgM.esm.js";
7
7
  import { E as E2 } from "../../chunks/edit-section-modal-s8bmuxWT.esm.js";
8
8
  import { H, T as T5 } from "../../chunks/template-modal-CroPvCvf.esm.js";
9
9
  import { T as T6 } from "../../chunks/template-name-modal-CLROXhxo.esm.js";
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const routes = require("../../chunks/routes-6gnAlgr1.js");
4
- const templateEditorRouter = require("../../chunks/template-editor-router-CJ_sWNaj.js");
5
- const templates = require("../../chunks/templates-2MhT1ZBz.js");
6
- const addTemplate = require("../../chunks/add-template-DCP8fhmm.js");
3
+ const routes = require("../../chunks/routes-DchFzWUK.js");
4
+ const templateEditorRouter = require("../../chunks/template-editor-router-c4QH4hW2.js");
5
+ const templates = require("../../chunks/templates-nCEKh4V8.js");
6
+ const addTemplate = require("../../chunks/add-template-vWz44K_U.js");
7
7
  const companySelectionModal = require("../../chunks/company-selection-modal-B7jFVWWs.js");
8
- const SectionFlowEditor = require("../../chunks/SectionFlowEditor-o0p5yhb0.js");
8
+ const SectionFlowEditor = require("../../chunks/SectionFlowEditor-a_CuPldq.js");
9
9
  const editSectionModal = require("../../chunks/edit-section-modal-BKUNY9LU.js");
10
10
  const templateModal = require("../../chunks/template-modal-D8R8r2XF.js");
11
11
  const templateNameModal = require("../../chunks/template-name-modal-CeqxIE2r.js");
@@ -1,4 +1,4 @@
1
- import { t } from "../../../chunks/routes-BvISTF8K.esm.js";
1
+ import { t } from "../../../chunks/routes-CHNGwv8o.esm.js";
2
2
  export {
3
3
  t as templateEditorRoutes
4
4
  };
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const routes = require("../../../chunks/routes-6gnAlgr1.js");
3
+ const routes = require("../../../chunks/routes-DchFzWUK.js");
4
4
  exports.templateEditorRoutes = routes.templateEditorRoutes;
5
5
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import { T, T as T2 } from "../../../chunks/templates-cJNFvwtW.esm.js";
1
+ import { T, T as T2 } from "../../../chunks/templates-BSbulMLk.esm.js";
2
2
  export {
3
3
  T as Templates,
4
4
  T2 as default
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const templates = require("../../../chunks/templates-2MhT1ZBz.js");
3
+ const templates = require("../../../chunks/templates-nCEKh4V8.js");
4
4
  exports.Templates = templates.Templates;
5
5
  exports.default = templates.Templates;
6
6
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erpsquad/common",
3
- "version": "1.11.16",
3
+ "version": "1.11.17",
4
4
  "description": "Shared UI component library for ERP modules",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.esm.js",
@@ -1 +0,0 @@
1
- {"version":3,"file":"DonutChart-C2Ery9_3.js","sources":["../../src/components/charts/donutChart/DonutChart.tsx"],"sourcesContent":["import React, { useRef, useEffect } from \"react\";\r\nimport * as d3 from \"d3\";\r\nimport \"./donut-chart.scss\";\r\nimport Typography from \"../../typography/typography\";\r\nimport { useAuth } from '@erpsquad/common/runtime';\r\n\r\ninterface DataPoint {\r\n label: string;\r\n value: number;\r\n\r\n}\r\n\r\ninterface DonutChartProps {\r\n data: DataPoint[];\r\n width?: number;\r\n height?: number;\r\n legend?: boolean;\r\n direction?: \"vertical\" | \"horizontal\";\r\n total?: string;\r\n donutThickerValue?: number\r\n CustomLegends?: React.FC<{ data: DataPoint[] }>;\r\n title: string\r\n}\r\n\r\nconst formatNumber = (num: number, defaultCurrencySymbol: string = ''): string => {\r\n if(!num || Number.isNaN(num)) num = 0;\r\n\r\n if (num >= 1_000_000) {\r\n return `${defaultCurrencySymbol} ${(num / 1_000_000).toFixed(1)} M`;\r\n } else if (num >= 100_000) {\r\n return `${defaultCurrencySymbol} ${(num / 100_000).toFixed(1)} L`; // L for Lakhs\r\n } else if (num >= 1_000) {\r\n return `${(num / 1_000).toFixed(1)} K`;\r\n } else {\r\n return `${defaultCurrencySymbol} ${num.toFixed(2)}`;\r\n }\r\n};\r\nconst getSingleNumberFromString = (str) => {\r\n if (typeof str === \"number\") {\r\n return str;\r\n }\r\n const match = str?.match(/\\d.+/) || null;\r\n return match ? Number(match[0]) : 0;\r\n};\r\n\r\nconst DonutChart: React.FC<DonutChartProps> = ({\r\n data,\r\n height = 140,\r\n width = 140,\r\n legend = true,\r\n direction = \"vertical\",\r\n total = \"300\",\r\n donutThickerValue,\r\n CustomLegends,\r\n title = ''\r\n}) => {\r\n const svgRef = useRef<SVGSVGElement>(null);\r\n const { user } = useAuth();\r\n const defaultCurrencySymbol = user?.currency_data?.symbol || '';\r\n useEffect(() => {\r\n if (!svgRef.current) return;\r\n\r\n const svg = d3.select(svgRef.current);\r\n\r\n svg.selectAll(\"*\").remove();\r\n\r\n const margin = 6;\r\n\r\n const outerRadius = Math.min(width, height) / 2 - margin;\r\n let innerRadius = Math.min(width, height) / 2 - margin * 2;\r\n if (donutThickerValue) {\r\n innerRadius = outerRadius - donutThickerValue;\r\n }\r\n\r\n\r\n\r\n\r\n const g = svg\r\n .append(\"g\")\r\n .attr(\"transform\", `translate(${width / 2}, ${height / 2})`);\r\n const pie = d3\r\n .pie()\r\n .value((d: DataPoint) => getSingleNumberFromString(d.value)).padAngle(0);\r\n\r\n const path = d3.arc().outerRadius(outerRadius).innerRadius(innerRadius)\r\n\r\n const pies = g\r\n .selectAll(\".arc\")\r\n .data(pie(data))\r\n .enter()\r\n .append(\"g\")\r\n .attr(\"class\", \"arc\");\r\n\r\n\r\n pies\r\n .append(\"path\")\r\n .attr(\"d\", path)\r\n .attr(\"fill\", (d: DataPoint) => d?.data?.color).attr(\"stroke\", \"none\");\r\n g.append(\"text\")\r\n .attr(\"text-anchor\", \"middle\")\r\n .attr(\"font-size\", \"18px\")\r\n .attr(\"font-weight\", \"600\")\r\n .attr(\"alignment-baseline\", `central`)\r\n .html(total);\r\n g.append(\"text\")\r\n .attr(\"text-anchor\", \"middle\")\r\n .attr('maring-top', \"20px\")\r\n .attr(\"font-size\", \"13px\")\r\n .attr(\"font-weight\", \"600\")\r\n .attr(\"dy\", \"2em\")\r\n .attr(\"color\", \"#7B7C7F\")\r\n .html(title);\r\n\r\n }, [data, height, total, width, defaultCurrencySymbol, donutThickerValue, CustomLegends, title]);\r\n\r\n if (!legend) {\r\n return <svg ref={svgRef} width={width} height={height}></svg>;\r\n }\r\n\r\n return (\r\n <>\r\n <div className={`donut-chart-container ${direction}`}>\r\n <div>\r\n <svg ref={svgRef} width={width} height={height}></svg>\r\n </div>\r\n\r\n\r\n {CustomLegends ? (\r\n <CustomLegends data={data} /> // Render the custom component\r\n ) : (\r\n <div className='donut-legend'>\r\n <div className={`donut-chart-legend ${direction}`}>\r\n {data.map((d: DataPoint) => (\r\n <div\r\n className=\"legend\"\r\n key={d.label}\r\n style={{ borderLeft: `0.188rem solid ${d.color}` }}\r\n >\r\n <div className=\"legend-title\" style={{ color: `${d.labelColor}` }}>{d.label}</div>\r\n <div className=\"legend-value\">\r\n <Typography\r\n type=\"s5\"\r\n weight=\"medium\"\r\n color={d.valueColor}\r\n style={{\r\n whiteSpace: 'nowrap'\r\n }}\r\n >\r\n {formatNumber(d.value, defaultCurrencySymbol)}\r\n </Typography>\r\n </div>\r\n </div>\r\n ))\r\n }\r\n </div>\r\n </div>\r\n )}\r\n </div>\r\n </>\r\n );\r\n};\r\n\r\nexport { DonutChart };\r\nexport default DonutChart;\r\n"],"names":["useRef","useAuth","useEffect","d3","_a","jsx","jsxs","Typography"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAwBA,MAAM,eAAe,CAAC,KAAa,wBAAgC,OAAe;AAChF,MAAG,CAAC,OAAO,OAAO,MAAM,GAAG,EAAG,OAAM;AAEpC,MAAI,OAAO,KAAW;AACpB,WAAO,GAAG,qBAAqB,KAAK,MAAM,KAAW,QAAQ,CAAC,CAAC;AAAA,EACjE,WAAW,OAAO,KAAS;AACzB,WAAO,GAAG,qBAAqB,KAAK,MAAM,KAAS,QAAQ,CAAC,CAAC;AAAA,EAC/D,WAAW,OAAO,KAAO;AACvB,WAAO,IAAI,MAAM,KAAO,QAAQ,CAAC,CAAC;AAAA,EACpC,OAAO;AACL,WAAO,GAAG,qBAAqB,IAAI,IAAI,QAAQ,CAAC,CAAC;AAAA,EACnD;AACF;AACA,MAAM,4BAA4B,CAAC,QAAQ;AACzC,MAAI,OAAO,QAAQ,UAAU;AAC3B,WAAO;AAAA,EACT;AACA,QAAM,SAAQ,2BAAK,MAAM,YAAW;AACpC,SAAO,QAAQ,OAAO,MAAM,CAAC,CAAC,IAAI;AACpC;AAEA,MAAM,aAAwC,CAAC;AAAA,EAC7C;AAAA,EACA,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,QAAQ;AACV,MAAM;;AACJ,QAAM,SAASA,MAAAA,OAAsB,IAAI;AACzC,QAAM,EAAE,KAAA,IAASC,gB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
- {"version":3,"file":"DonutChart-Clmcka3j.esm.js","sources":["../../src/components/charts/donutChart/DonutChart.tsx"],"sourcesContent":["import React, { useRef, useEffect } from \"react\";\r\nimport * as d3 from \"d3\";\r\nimport \"./donut-chart.scss\";\r\nimport Typography from \"../../typography/typography\";\r\nimport { useAuth } from '@erpsquad/common/runtime';\r\n\r\ninterface DataPoint {\r\n label: string;\r\n value: number;\r\n\r\n}\r\n\r\ninterface DonutChartProps {\r\n data: DataPoint[];\r\n width?: number;\r\n height?: number;\r\n legend?: boolean;\r\n direction?: \"vertical\" | \"horizontal\";\r\n total?: string;\r\n donutThickerValue?: number\r\n CustomLegends?: React.FC<{ data: DataPoint[] }>;\r\n title: string\r\n}\r\n\r\nconst formatNumber = (num: number, defaultCurrencySymbol: string = ''): string => {\r\n if(!num || Number.isNaN(num)) num = 0;\r\n\r\n if (num >= 1_000_000) {\r\n return `${defaultCurrencySymbol} ${(num / 1_000_000).toFixed(1)} M`;\r\n } else if (num >= 100_000) {\r\n return `${defaultCurrencySymbol} ${(num / 100_000).toFixed(1)} L`; // L for Lakhs\r\n } else if (num >= 1_000) {\r\n return `${(num / 1_000).toFixed(1)} K`;\r\n } else {\r\n return `${defaultCurrencySymbol} ${num.toFixed(2)}`;\r\n }\r\n};\r\nconst getSingleNumberFromString = (str) => {\r\n if (typeof str === \"number\") {\r\n return str;\r\n }\r\n const match = str?.match(/\\d.+/) || null;\r\n return match ? Number(match[0]) : 0;\r\n};\r\n\r\nconst DonutChart: React.FC<DonutChartProps> = ({\r\n data,\r\n height = 140,\r\n width = 140,\r\n legend = true,\r\n direction = \"vertical\",\r\n total = \"300\",\r\n donutThickerValue,\r\n CustomLegends,\r\n title = ''\r\n}) => {\r\n const svgRef = useRef<SVGSVGElement>(null);\r\n const { user } = useAuth();\r\n const defaultCurrencySymbol = user?.currency_data?.symbol || '';\r\n useEffect(() => {\r\n if (!svgRef.current) return;\r\n\r\n const svg = d3.select(svgRef.current);\r\n\r\n svg.selectAll(\"*\").remove();\r\n\r\n const margin = 6;\r\n\r\n const outerRadius = Math.min(width, height) / 2 - margin;\r\n let innerRadius = Math.min(width, height) / 2 - margin * 2;\r\n if (donutThickerValue) {\r\n innerRadius = outerRadius - donutThickerValue;\r\n }\r\n\r\n\r\n\r\n\r\n const g = svg\r\n .append(\"g\")\r\n .attr(\"transform\", `translate(${width / 2}, ${height / 2})`);\r\n const pie = d3\r\n .pie()\r\n .value((d: DataPoint) => getSingleNumberFromString(d.value)).padAngle(0);\r\n\r\n const path = d3.arc().outerRadius(outerRadius).innerRadius(innerRadius)\r\n\r\n const pies = g\r\n .selectAll(\".arc\")\r\n .data(pie(data))\r\n .enter()\r\n .append(\"g\")\r\n .attr(\"class\", \"arc\");\r\n\r\n\r\n pies\r\n .append(\"path\")\r\n .attr(\"d\", path)\r\n .attr(\"fill\", (d: DataPoint) => d?.data?.color).attr(\"stroke\", \"none\");\r\n g.append(\"text\")\r\n .attr(\"text-anchor\", \"middle\")\r\n .attr(\"font-size\", \"18px\")\r\n .attr(\"font-weight\", \"600\")\r\n .attr(\"alignment-baseline\", `central`)\r\n .html(total);\r\n g.append(\"text\")\r\n .attr(\"text-anchor\", \"middle\")\r\n .attr('maring-top', \"20px\")\r\n .attr(\"font-size\", \"13px\")\r\n .attr(\"font-weight\", \"600\")\r\n .attr(\"dy\", \"2em\")\r\n .attr(\"color\", \"#7B7C7F\")\r\n .html(title);\r\n\r\n }, [data, height, total, width, defaultCurrencySymbol, donutThickerValue, CustomLegends, title]);\r\n\r\n if (!legend) {\r\n return <svg ref={svgRef} width={width} height={height}></svg>;\r\n }\r\n\r\n return (\r\n <>\r\n <div className={`donut-chart-container ${direction}`}>\r\n <div>\r\n <svg ref={svgRef} width={width} height={height}></svg>\r\n </div>\r\n\r\n\r\n {CustomLegends ? (\r\n <CustomLegends data={data} /> // Render the custom component\r\n ) : (\r\n <div className='donut-legend'>\r\n <div className={`donut-chart-legend ${direction}`}>\r\n {data.map((d: DataPoint) => (\r\n <div\r\n className=\"legend\"\r\n key={d.label}\r\n style={{ borderLeft: `0.188rem solid ${d.color}` }}\r\n >\r\n <div className=\"legend-title\" style={{ color: `${d.labelColor}` }}>{d.label}</div>\r\n <div className=\"legend-value\">\r\n <Typography\r\n type=\"s5\"\r\n weight=\"medium\"\r\n color={d.valueColor}\r\n style={{\r\n whiteSpace: 'nowrap'\r\n }}\r\n >\r\n {formatNumber(d.value, defaultCurrencySymbol)}\r\n </Typography>\r\n </div>\r\n </div>\r\n ))\r\n }\r\n </div>\r\n </div>\r\n )}\r\n </div>\r\n </>\r\n );\r\n};\r\n\r\nexport { DonutChart };\r\nexport default DonutChart;\r\n"],"names":["_a"],"mappings":";;;;;;AAwBA,MAAM,eAAe,CAAC,KAAa,wBAAgC,OAAe;AAChF,MAAG,CAAC,OAAO,OAAO,MAAM,GAAG,EAAG,OAAM;AAEpC,MAAI,OAAO,KAAW;AACpB,WAAO,GAAG,qBAAqB,KAAK,MAAM,KAAW,QAAQ,CAAC,CAAC;AAAA,EACjE,WAAW,OAAO,KAAS;AACzB,WAAO,GAAG,qBAAqB,KAAK,MAAM,KAAS,QAAQ,CAAC,CAAC;AAAA,EAC/D,WAAW,OAAO,KAAO;AACvB,WAAO,IAAI,MAAM,KAAO,QAAQ,CAAC,CAAC;AAAA,EACpC,OAAO;AACL,WAAO,GAAG,qBAAqB,IAAI,IAAI,QAAQ,CAAC,CAAC;AAAA,EACnD;AACF;AACA,MAAM,4BAA4B,CAAC,QAAQ;AACzC,MAAI,OAAO,QAAQ,UAAU;AAC3B,WAAO;AAAA,EACT;AACA,QAAM,SAAQ,2BAAK,MAAM,YAAW;AACpC,SAAO,QAAQ,OAAO,MAAM,CAAC,CAAC,IAAI;AACpC;AAEA,MAAM,aAAwC,CAAC;AAAA,EAC7C;AAAA,EACA,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,QAAQ;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js","sources":["../../src/components/calculation-summary/calculation-summary.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport { Box } from '@mui/material';\r\n\r\nimport ItemsSummary, { IItemsSummary } from './components/items-summary';\r\nimport DiscountSummary, {\r\n\tIDiscountSummary\r\n} from './components/discount-summary';\r\nimport SubtotalSummary, {\r\n\tISubtotalSummary\r\n} from './components/subtotal-summary';\r\nimport TaxesAndChargesSummary, {\r\n\tITaxesAndChargesSummary\r\n} from './components/taxes-and-charges-summary';\r\n\r\nimport { useEffect, useState } from 'react';\r\nimport { useAuth } from '@erpsquad/common/runtime';\r\nimport TotalSummary, { ITotalSummary } from './components/total-summary';\r\nimport { calculateEntries, truncateDecimals } from '../../utils/calculation';\r\nimport { getApiConfigSafe } from '../../utils/api-config';\r\n\r\nimport './calculation-summary.scss';\r\n\r\ninterface ICalculationSummary {\r\n\titems: any;\r\n\texpenses?: any;\r\n\tformValues: any;\r\n\tenableShippings?: boolean;\r\n\tenablePromotions?: boolean;\r\n\tcurrencySymbol: string;\r\n\tdecimals?: number;\r\n\tuseTruncation?: boolean;\r\n\t// calculationFunc: any\r\n}\r\n\r\nconst CalculationSummary: React.FC<ICalculationSummary> = ({\r\n\titems,\r\n\texpenses,\r\n\tformValues,\r\n\tenablePromotions,\r\n\tenableShippings,\r\n\tcurrencySymbol,\r\n\tdecimals = 2,\r\n\tuseTruncation = false\r\n}) => {\r\n\tconst { user } = useAuth();\r\n\tconst defaultCurrencySymbol =\r\n\t\tcurrencySymbol || user?.currency_data?.symbol || '';\r\n\r\n\tconst isArabia = getApiConfigSafe()?.countryEnv === 'ksa';\r\n\tconst finalDecimals = isArabia ? 4 : decimals;\r\n\tconst finalUseTruncation = isArabia ? true : useTruncation;\r\n\r\n\tconst [itemsData, setItemsData] = useState<IItemsSummary>({\r\n\t\ttotalQuantity: 0,\r\n\t\ttotal: 0,\r\n\t\tcurrencySymbol: defaultCurrencySymbol\r\n\t});\r\n\tconst [discountData, setDiscountData] = useState<IDiscountSummary>({\r\n\t\titemDiscount: 0,\r\n\t\tadditionalDiscount: 0,\r\n\t\ttotalDiscount: 0,\r\n\t\tcurrencySymbol: defaultCurrencySymbol\r\n\t});\r\n\tconst [subtotalData, setSubtotalData] = useState<ISubtotalSummary>({\r\n\t\tsubtotalExTax: 0,\r\n\t\tsubtotalExDiscount: 0,\r\n\t\tcurrencySymbol: defaultCurrencySymbol\r\n\t});\r\n\tconst [taxesData, setTaxesData] = useState<ITaxesAndChargesSummary>({\r\n\t\ttaxes: 0,\r\n\t\tdeductedTax: 0.0,\r\n\t\ttotal: 0,\r\n\t\tshippingAmount: 0,\r\n\t\thandlingAmount: 0,\r\n\t\tcurrencySymbol: defaultCurrencySymbol\r\n\t});\r\n\tconst [totalData, setTotalData] = useState<ITotalSummary>({\r\n\t\ttotal: 0,\r\n\t\troundOffDifferenceAmount: 0,\r\n\t\tcurrencySymbol: defaultCurrencySymbol\r\n\t});\r\n\r\n\tuseEffect(() => {\r\n\t\t// debugger;\r\n\t\tconst eRate = Number(formValues?.exchange_rate) || 1;\r\n\r\n\t\tlet {\r\n\t\t\t// eslint-disable-next-line prefer-const\r\n\t\t\ttotalQuantity,\r\n\t\t\ttotalDiscount,\r\n\t\t\ttotalItemsExpenseDiscount,\r\n\t\t\ttotalTaxAmount,\r\n\t\t\tadditinoalDiscountAmount,\r\n\t\t\tfinalAmount,\r\n\t\t\troundOffDifference,\r\n\t\t\t\r\n\t\t} = calculateEntries(\r\n\t\t\titems,\r\n\t\t\texpenses,\r\n\t\t\tformValues?.additional_discount_on,\r\n\t\t\tformValues?.additional_discount_percentage,\r\n\t\t\tformValues?.additional_discount_amount,\r\n\t\t\tformValues?.round_off,\r\n\t\t\tformValues?.round_off_option,\r\n\t\t\tformValues?.promotion_amount,\r\n\t\t\tfinalDecimals,\r\n\t\t\tfinalUseTruncation\r\n\t\t);\r\n\r\n\t\ttotalDiscount /= eRate;\r\n\t\tadditinoalDiscountAmount /= eRate;\r\n\t\ttotalItemsExpenseDiscount /= eRate;\r\n\t\ttotalTaxAmount /= eRate;\r\n\t\tfinalAmount /= eRate;\r\n\t\troundOffDifference /= eRate;\r\n\t\t\r\n\t\tconst shippingAmount =\r\n\t\t\t(Number(formValues?.shipping_cost) || 0) +\r\n\t\t\t(Number(formValues?.shipping_tax_amount) || 0);\r\n\t\tconst handlingAmount =\r\n\t\t\t(Number(formValues?.handling_cost) || 0) +\r\n\t\t\t(Number(formValues?.handling_tax_amount) || 0);\r\n\r\n\t\tconst shippingAmountWithERate = shippingAmount / eRate;\r\n\t\tconst handlingAmountWithERate = handlingAmount / eRate;\r\n\t\tconst promotionAmountWithERate = Number(formValues?.promotion_amount || 0) / eRate;\r\n\t\tfinalAmount = (finalAmount) - promotionAmountWithERate\r\n\t\tconst grandTotal = (finalAmount + shippingAmountWithERate + handlingAmountWithERate) - promotionAmountWithERate\r\n\r\n\t\tconst formatValue = (val: any) => {\r\n\t\t\tconst num = Number(val) || 0;\r\n\t\t\treturn finalUseTruncation ? truncateDecimals(num, finalDecimals).toFixed(finalDecimals) : num.toFixed(finalDecimals);\r\n\t\t};\r\n\r\n\t\tsetItemsData({\r\n\t\t\t...itemsData,\r\n\t\t\ttotalQuantity,\r\n\t\t\ttotal: formatValue(finalAmount),\r\n\t\t\tcurrencySymbol\r\n\t\t});\r\n\t\tsetDiscountData({\r\n\t\t\t...discountData,\r\n\t\t\titemDiscount: formatValue(totalItemsExpenseDiscount),\r\n\t\t\tadditionalDiscount: formatValue(additinoalDiscountAmount),\r\n\t\t\ttotalDiscount: formatValue(totalDiscount + promotionAmountWithERate),\r\n\t\t\tpromotionAmount: formatValue(promotionAmountWithERate),\r\n\t\t\tcurrencySymbol\r\n\t\t});\r\n\t\tsetSubtotalData({\r\n\t\t\t...subtotalData,\r\n\t\t\tsubtotalExTax: formatValue(finalAmount - totalTaxAmount),\r\n\t\t\tsubtotalExDiscount: formatValue(finalAmount + Number(totalDiscount)),\r\n\t\t\tcurrencySymbol\r\n\t\t});\r\n\r\n\t\tsetTaxesData({\r\n\t\t\t...taxesData,\r\n\t\t\ttaxes: formatValue(totalTaxAmount),\r\n\t\t\ttotal: formatValue(totalTaxAmount),\r\n\t\t\tshippingAmount: formatValue(shippingAmountWithERate),\r\n\t\t\thandlingAmount: formatValue(handlingAmountWithERate),\r\n\t\t\tcurrencySymbol\r\n\t\t});\r\n\t\tsetTotalData({\r\n\t\t\t...totalData,\r\n\t\t\ttotal: formatValue(grandTotal),\r\n\t\t\troundOffDifferenceAmount: formatValue(roundOffDifference),\r\n\t\t\tcurrencySymbol,\r\n\t\t});\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [\r\n\t\titems,\r\n\t\tformValues?.additional_discount_amount,\r\n\t\tformValues?.additional_discount_on,\r\n\t\tformValues?.additional_discount_percentage,\r\n\t\tformValues?.currency_id,\r\n\t\tformValues?.round_off,\r\n\t\tformValues?.round_off_option,\r\n\t\tformValues?.shipping_cost,\r\n\t\tformValues?.shipping_tax_amount,\r\n\t\tformValues?.handling_cost,\r\n\t\tformValues?.handling_tax_amount,\r\n\t\tformValues?.promotion_amount,\r\n\t\tformValues?.exchange_rate,\r\n\t\tformValues?.currency_data,\r\n\t\tdefaultCurrencySymbol,\r\n\t\tfinalDecimals,\r\n\t\tfinalUseTruncation\r\n\t]);\r\n\r\n\treturn (\r\n\t\t<Box className='addPurchaseInvoice--RightContainer'>\r\n\t\t\t<ItemsSummary data={itemsData} />\r\n\t\t\t<DiscountSummary\r\n\t\t\t\tdata={discountData}\r\n\t\t\t\tenablePromotions={enablePromotions}\r\n\t\t\t/>\r\n\t\t\t<SubtotalSummary data={subtotalData} />\r\n\t\t\t<TaxesAndChargesSummary\r\n\t\t\t\tdata={taxesData}\r\n\t\t\t\tenableShippings={enableShippings}\r\n\t\t\t/>\r\n\t\t\t<TotalSummary data={totalData} />\r\n\t\t</Box>\r\n\t);\r\n};\r\n\r\nexport default CalculationSummary;\r\n"],"names":[],"mappings":";;;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AAO,YAAY,cAAc;AAAA,MACjC,gBAAgB,YAAY,uBAAuB;AAAA,MACnD,gBAAgB,YAAY,uBAAuB;AAAA,MACnD;AAAA,IAAA,CACA;AACD,iBAAa;AAAA,MACZ,GAAG;AAAA,MACH,OAAO,YAAY,UAAU;AAAA,MAC7B,0BAA0B,YAAY,kBAAkB;AAAA,MACxD;AAAA,IAAA,CACA;AAAA,EAEF,GAAG;AAAA,IACF;AAAA,IACA,yCAAY;AAAA,IACZ,yCAAY;AAAA,IACZ,yCAAY;AAAA,IACZ,yCAAY;AAAA,IACZ,yCAAY;AAAA,IACZ,yCAAY;AAAA,IACZ,yCAAY;AAAA,IACZ,yCAAY;AAAA,IACZ,yCAAY;AAAA,IACZ,yCAAY;AAAA,IACZ,yCAAY;AAAA,IACZ,yCAAY;AAAA,IACZ,yCAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,EAAA,CACA;AAED,SACC,qBAAC,KAAA,EAAI,WAAU,sCACd,UAAA;AAAA,IAAA,oBAAC,cAAA,EAAa,MAAM,UAAA,CAAW;AAAA,IAC/B;AAAA,MAAC;AAAA,MAAA;AAAA,QACA,MAAM;AAAA,QACN;AAAA,MAAA;AAAA,IAAA;AAAA,IAED,oBAAC,iBAAA,EAAgB,MAAM,aAAA,CAAc;AAAA,IACrC;AAAA,MAAC;AAAA,MAAA;AAAA,QACA,MAAM;AAAA,QACN;AAAA,MAAA;AAAA,IAAA;AAAA,IAED,oBAAC,cAAA,EAAa,MAAM,UAAA,CAAW;AAAA,EAAA,GAChC;AAEF;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"calculation-summary-h8yqJbXT.js","sources":["../../src/components/calculation-summary/calculation-summary.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport { Box } from '@mui/material';\r\n\r\nimport ItemsSummary, { IItemsSummary } from './components/items-summary';\r\nimport DiscountSummary, {\r\n\tIDiscountSummary\r\n} from './components/discount-summary';\r\nimport SubtotalSummary, {\r\n\tISubtotalSummary\r\n} from './components/subtotal-summary';\r\nimport TaxesAndChargesSummary, {\r\n\tITaxesAndChargesSummary\r\n} from './components/taxes-and-charges-summary';\r\n\r\nimport { useEffect, useState } from 'react';\r\nimport { useAuth } from '@erpsquad/common/runtime';\r\nimport TotalSummary, { ITotalSummary } from './components/total-summary';\r\nimport { calculateEntries, truncateDecimals } from '../../utils/calculation';\r\nimport { getApiConfigSafe } from '../../utils/api-config';\r\n\r\nimport './calculation-summary.scss';\r\n\r\ninterface ICalculationSummary {\r\n\titems: any;\r\n\texpenses?: any;\r\n\tformValues: any;\r\n\tenableShippings?: boolean;\r\n\tenablePromotions?: boolean;\r\n\tcurrencySymbol: string;\r\n\tdecimals?: number;\r\n\tuseTruncation?: boolean;\r\n\t// calculationFunc: any\r\n}\r\n\r\nconst CalculationSummary: React.FC<ICalculationSummary> = ({\r\n\titems,\r\n\texpenses,\r\n\tformValues,\r\n\tenablePromotions,\r\n\tenableShippings,\r\n\tcurrencySymbol,\r\n\tdecimals = 2,\r\n\tuseTruncation = false\r\n}) => {\r\n\tconst { user } = useAuth();\r\n\tconst defaultCurrencySymbol =\r\n\t\tcurrencySymbol || user?.currency_data?.symbol || '';\r\n\r\n\tconst isArabia = getApiConfigSafe()?.countryEnv === 'ksa';\r\n\tconst finalDecimals = isArabia ? 4 : decimals;\r\n\tconst finalUseTruncation = isArabia ? true : useTruncation;\r\n\r\n\tconst [itemsData, setItemsData] = useState<IItemsSummary>({\r\n\t\ttotalQuantity: 0,\r\n\t\ttotal: 0,\r\n\t\tcurrencySymbol: defaultCurrencySymbol\r\n\t});\r\n\tconst [discountData, setDiscountData] = useState<IDiscountSummary>({\r\n\t\titemDiscount: 0,\r\n\t\tadditionalDiscount: 0,\r\n\t\ttotalDiscount: 0,\r\n\t\tcurrencySymbol: defaultCurrencySymbol\r\n\t});\r\n\tconst [subtotalData, setSubtotalData] = useState<ISubtotalSummary>({\r\n\t\tsubtotalExTax: 0,\r\n\t\tsubtotalExDiscount: 0,\r\n\t\tcurrencySymbol: defaultCurrencySymbol\r\n\t});\r\n\tconst [taxesData, setTaxesData] = useState<ITaxesAndChargesSummary>({\r\n\t\ttaxes: 0,\r\n\t\tdeductedTax: 0.0,\r\n\t\ttotal: 0,\r\n\t\tshippingAmount: 0,\r\n\t\thandlingAmount: 0,\r\n\t\tcurrencySymbol: defaultCurrencySymbol\r\n\t});\r\n\tconst [totalData, setTotalData] = useState<ITotalSummary>({\r\n\t\ttotal: 0,\r\n\t\troundOffDifferenceAmount: 0,\r\n\t\tcurrencySymbol: defaultCurrencySymbol\r\n\t});\r\n\r\n\tuseEffect(() => {\r\n\t\t// debugger;\r\n\t\tconst eRate = Number(formValues?.exchange_rate) || 1;\r\n\r\n\t\tlet {\r\n\t\t\t// eslint-disable-next-line prefer-const\r\n\t\t\ttotalQuantity,\r\n\t\t\ttotalDiscount,\r\n\t\t\ttotalItemsExpenseDiscount,\r\n\t\t\ttotalTaxAmount,\r\n\t\t\tadditinoalDiscountAmount,\r\n\t\t\tfinalAmount,\r\n\t\t\troundOffDifference,\r\n\t\t\t\r\n\t\t} = calculateEntries(\r\n\t\t\titems,\r\n\t\t\texpenses,\r\n\t\t\tformValues?.additional_discount_on,\r\n\t\t\tformValues?.additional_discount_percentage,\r\n\t\t\tformValues?.additional_discount_amount,\r\n\t\t\tformValues?.round_off,\r\n\t\t\tformValues?.round_off_option,\r\n\t\t\tformValues?.promotion_amount,\r\n\t\t\tfinalDecimals,\r\n\t\t\tfinalUseTruncation\r\n\t\t);\r\n\r\n\t\ttotalDiscount /= eRate;\r\n\t\tadditinoalDiscountAmount /= eRate;\r\n\t\ttotalItemsExpenseDiscount /= eRate;\r\n\t\ttotalTaxAmount /= eRate;\r\n\t\tfinalAmount /= eRate;\r\n\t\troundOffDifference /= eRate;\r\n\t\t\r\n\t\tconst shippingAmount =\r\n\t\t\t(Number(formValues?.shipping_cost) || 0) +\r\n\t\t\t(Number(formValues?.shipping_tax_amount) || 0);\r\n\t\tconst handlingAmount =\r\n\t\t\t(Number(formValues?.handling_cost) || 0) +\r\n\t\t\t(Number(formValues?.handling_tax_amount) || 0);\r\n\r\n\t\tconst shippingAmountWithERate = shippingAmount / eRate;\r\n\t\tconst handlingAmountWithERate = handlingAmount / eRate;\r\n\t\tconst promotionAmountWithERate = Number(formValues?.promotion_amount || 0) / eRate;\r\n\t\tfinalAmount = (finalAmount) - promotionAmountWithERate\r\n\t\tconst grandTotal = (finalAmount + shippingAmountWithERate + handlingAmountWithERate) - promotionAmountWithERate\r\n\r\n\t\tconst formatValue = (val: any) => {\r\n\t\t\tconst num = Number(val) || 0;\r\n\t\t\treturn finalUseTruncation ? truncateDecimals(num, finalDecimals).toFixed(finalDecimals) : num.toFixed(finalDecimals);\r\n\t\t};\r\n\r\n\t\tsetItemsData({\r\n\t\t\t...itemsData,\r\n\t\t\ttotalQuantity,\r\n\t\t\ttotal: formatValue(finalAmount),\r\n\t\t\tcurrencySymbol\r\n\t\t});\r\n\t\tsetDiscountData({\r\n\t\t\t...discountData,\r\n\t\t\titemDiscount: formatValue(totalItemsExpenseDiscount),\r\n\t\t\tadditionalDiscount: formatValue(additinoalDiscountAmount),\r\n\t\t\ttotalDiscount: formatValue(totalDiscount + promotionAmountWithERate),\r\n\t\t\tpromotionAmount: formatValue(promotionAmountWithERate),\r\n\t\t\tcurrencySymbol\r\n\t\t});\r\n\t\tsetSubtotalData({\r\n\t\t\t...subtotalData,\r\n\t\t\tsubtotalExTax: formatValue(finalAmount - totalTaxAmount),\r\n\t\t\tsubtotalExDiscount: formatValue(finalAmount + Number(totalDiscount)),\r\n\t\t\tcurrencySymbol\r\n\t\t});\r\n\r\n\t\tsetTaxesData({\r\n\t\t\t...taxesData,\r\n\t\t\ttaxes: formatValue(totalTaxAmount),\r\n\t\t\ttotal: formatValue(totalTaxAmount),\r\n\t\t\tshippingAmount: formatValue(shippingAmountWithERate),\r\n\t\t\thandlingAmount: formatValue(handlingAmountWithERate),\r\n\t\t\tcurrencySymbol\r\n\t\t});\r\n\t\tsetTotalData({\r\n\t\t\t...totalData,\r\n\t\t\ttotal: formatValue(grandTotal),\r\n\t\t\troundOffDifferenceAmount: formatValue(roundOffDifference),\r\n\t\t\tcurrencySymbol,\r\n\t\t});\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [\r\n\t\titems,\r\n\t\tformValues?.additional_discount_amount,\r\n\t\tformValues?.additional_discount_on,\r\n\t\tformValues?.additional_discount_percentage,\r\n\t\tformValues?.currency_id,\r\n\t\tformValues?.round_off,\r\n\t\tformValues?.round_off_option,\r\n\t\tformValues?.shipping_cost,\r\n\t\tformValues?.shipping_tax_amount,\r\n\t\tformValues?.handling_cost,\r\n\t\tformValues?.handling_tax_amount,\r\n\t\tformValues?.promotion_amount,\r\n\t\tformValues?.exchange_rate,\r\n\t\tformValues?.currency_data,\r\n\t\tdefaultCurrencySymbol,\r\n\t\tfinalDecimals,\r\n\t\tfinalUseTruncation\r\n\t]);\r\n\r\n\treturn (\r\n\t\t<Box className='addPurchaseInvoice--RightContainer'>\r\n\t\t\t<ItemsSummary data={itemsData} />\r\n\t\t\t<DiscountSummary\r\n\t\t\t\tdata={discountData}\r\n\t\t\t\tenablePromotions={enablePromotions}\r\n\t\t\t/>\r\n\t\t\t<SubtotalSummary data={subtotalData} />\r\n\t\t\t<TaxesAndChargesSummary\r\n\t\t\t\tdata={taxesData}\r\n\t\t\t\tenableShippings={enableShippings}\r\n\t\t\t/>\r\n\t\t\t<TotalSummary data={totalData} />\r\n\t\t</Box>\r\n\t);\r\n};\r\n\r\nexport default CalculationSummary;\r\n"],"names":["useAuth","getApiConfigSafe","useState","useEffect","calculateEntries","truncateDecimals","jsxs","Box","jsx","ItemsSummary","DiscountSummary","SubtotalSummary","TaxesAndChargesSummary","TotalSummary"],"mappings":";;;;;;;;;;;;;AAkCA,MAAM,qBAAoD,CAAC;AAAA,EAC1D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AA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B;AAAA,MACnD,gBAAgB,YAAY,uBAAuB;AAAA,MACnD;AAAA,IAAA,CACA;AACD,iBAAa;AAAA,MACZ,GAAG;AAAA,MACH,OAAO,YAAY,UAAU;AAAA,MAC7B,0BAA0B,YAAY,kBAAkB;AAAA,MACxD;AAAA,IAAA,CACA;AAAA,EAEF,GAAG;AAAA,IACF;AAAA,IACA,yCAAY;AAAA,IACZ,yCAAY;AAAA,IACZ,yCAAY;AAAA,IACZ,yCAAY;AAAA,IACZ,yCAAY;AAAA,IACZ,yCAAY;AAAA,IACZ,yCAAY;AAAA,IACZ,yCAAY;AAAA,IACZ,yCAAY;AAAA,IACZ,yCAAY;AAAA,IACZ,yCAAY;AAAA,IACZ,yCAAY;AAAA,IACZ,yCAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,EAAA,CACA;AAED,SACCC,2BAAAA,KAACC,SAAAA,KAAA,EAAI,WAAU,sCACd,UAAA;AAAA,IAAAC,2BAAAA,IAACC,aAAAA,cAAA,EAAa,MAAM,UAAA,CAAW;AAAA,IAC/BD,2BAAAA;AAAAA,MAACE,gBAAAA;AAAAA,MAAA;AAAA,QACA,MAAM;AAAA,QACN;AAAA,MAAA;AAAA,IAAA;AAAA,IAEDF,2BAAAA,IAACG,gBAAAA,iBAAA,EAAgB,MAAM,aAAA,CAAc;AAAA,IACrCH,2BAAAA;AAAAA,MAACI,uBAAAA;AAAAA,MAAA;AAAA,QACA,MAAM;AAAA,QACN;AAAA,MAAA;AAAA,IAAA;AAAA,IAEDJ,2BAAAA,IAACK,aAAAA,cAAA,EAAa,MAAM,UAAA,CAAW;AAAA,EAAA,GAChC;AAEF;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"total-summary-BSFpn_1I.js","sources":["../../src/components/calculation-summary/components/total-summary.tsx"],"sourcesContent":["import { Box } from '@mui/material';\r\n\r\nimport Accordion from '../../accordion/accordion';\r\nimport Typography from '../../typography/typography';\r\n\r\nexport interface ITotalSummary {\r\n\ttotal: string | number;\r\n\troundOffDifferenceAmount: number | string;\r\n\tcurrencySymbol: string;\r\n}\r\ninterface ITotalSummaryProps {\r\n\tdata: ITotalSummary;\r\n}\r\n\r\nconst TotalSummary: React.FC<ITotalSummaryProps> = ({ data }) => {\r\n\treturn (\r\n\t\t<Accordion\r\n\t\t\ttitle={\r\n\t\t\t\t<Typography type='s3' weight='medium' color='theme.secondary.1000'>\r\n\t\t\t\t\tTotal\r\n\t\t\t\t</Typography>\r\n\t\t\t}\r\n\t\t\taccordionProps={{\r\n\t\t\t\tdefaultExpanded: true,\r\n\t\t\t\tsx: {\r\n\t\t\t\t\tborderBottomWidth: 1,\r\n\t\t\t\t\t'& .MuiAccordionSummary-root': { borderBottomWidth: 1 }\r\n\t\t\t\t}\r\n\t\t\t}}>\r\n\t\t\t<Box className='calculationSummary--SummaryContainer'>\r\n\t\t\t\t<Box className='calculationSummary--SummaryItem'>\r\n\t\t\t\t\t<Typography type='s5' weight='medium' color='theme.secondary.800'>\r\n\t\t\t\t\t\tGrand Total\r\n\t\t\t\t\t</Typography>\r\n\t\t\t\t\t<Typography type='s3' weight='medium' color='theme.secondary.1000'>\r\n\t\t\t\t\t\t{data.currencySymbol} {data.total}\r\n\t\t\t\t\t</Typography>\r\n\t\t\t\t</Box>\r\n\t\t\t\t{Number(data.roundOffDifferenceAmount) > 0 && \r\n\t\t\t\t\t<Box className='calculationSummary--SummaryItem'>\r\n\t\t\t\t\t\t<Typography type='s5' weight='medium' color='theme.secondary.800'>\r\n\t\t\t\t\t\t\tRound Off Difference\r\n\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t<Typography type='s3' weight='medium' color='theme.secondary.1000'>\r\n\t\t\t\t\t\t\t{data.currencySymbol} {data.roundOffDifferenceAmount}\r\n\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t</Box>\r\n\t\t\t\t}\r\n\t\t\t</Box>\r\n\t\t</Accordion>\r\n\t);\r\n};\r\n\r\nexport default TotalSummary;\r\n"],"names":["jsx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","sources":["../../src/components/calculation-summary/components/total-summary.tsx"],"sourcesContent":["import { Box } from '@mui/material';\r\n\r\nimport Accordion from '../../accordion/accordion';\r\nimport Typography from '../../typography/typography';\r\n\r\nexport interface ITotalSummary {\r\n\ttotal: string | number;\r\n\troundOffDifferenceAmount: number | string;\r\n\tcurrencySymbol: string;\r\n}\r\ninterface ITotalSummaryProps {\r\n\tdata: ITotalSummary;\r\n}\r\n\r\nconst TotalSummary: React.FC<ITotalSummaryProps> = ({ data }) => {\r\n\treturn (\r\n\t\t<Accordion\r\n\t\t\ttitle={\r\n\t\t\t\t<Typography type='s3' weight='medium' color='theme.secondary.1000'>\r\n\t\t\t\t\tTotal\r\n\t\t\t\t</Typography>\r\n\t\t\t}\r\n\t\t\taccordionProps={{\r\n\t\t\t\tdefaultExpanded: true,\r\n\t\t\t\tsx: {\r\n\t\t\t\t\tborderBottomWidth: 1,\r\n\t\t\t\t\t'& .MuiAccordionSummary-root': { borderBottomWidth: 1 }\r\n\t\t\t\t}\r\n\t\t\t}}>\r\n\t\t\t<Box className='calculationSummary--SummaryContainer'>\r\n\t\t\t\t<Box className='calculationSummary--SummaryItem'>\r\n\t\t\t\t\t<Typography type='s5' weight='medium' color='theme.secondary.800'>\r\n\t\t\t\t\t\tGrand Total\r\n\t\t\t\t\t</Typography>\r\n\t\t\t\t\t<Typography type='s3' weight='medium' color='theme.secondary.1000'>\r\n\t\t\t\t\t\t{data.currencySymbol} {data.total}\r\n\t\t\t\t\t</Typography>\r\n\t\t\t\t</Box>\r\n\t\t\t\t{Number(data.roundOffDifferenceAmount) > 0 && \r\n\t\t\t\t\t<Box className='calculationSummary--SummaryItem'>\r\n\t\t\t\t\t\t<Typography type='s5' weight='medium' color='theme.secondary.800'>\r\n\t\t\t\t\t\t\tRound Off Difference\r\n\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t<Typography type='s3' weight='medium' color='theme.secondary.1000'>\r\n\t\t\t\t\t\t\t{data.currencySymbol} {data.roundOffDifferenceAmount}\r\n\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t</Box>\r\n\t\t\t\t}\r\n\t\t\t</Box>\r\n\t\t</Accordion>\r\n\t);\r\n};\r\n\r\nexport default TotalSummary;\r\n"],"names":[],"mappings":";;;;AAcA,MAAM,eAA6C,CAAC,EAAE,WAAW;AAChE,SACC;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,2BACE,YAAA,EAAW,MAAK,MAAK,QAAO,UAAS,OAAM,wBAAuB,UAAA,QAAA,CAEnE;AAAA,MAED,gBAAgB;AAAA,QACf,iBAAiB;AAAA,QACjB,IAAI;AAAA,UACH,mBAAmB;AAAA,UACnB,+BAA+B,EAAE,mBAAmB,EAAA;AAAA,QAAE;AAAA,MACvD;AAAA,MAED,UAAA,qBAAC,KAAA,EAAI,WAAU,wCACd,UAAA;AAAA,QAAA,qBAAC,KAAA,EAAI,WAAU,mCACd,UAAA;AAAA,UAAA,oBAAC,cAAW,MAAK,MAAK,QAAO,UAAS,OAAM,uBAAsB,UAAA,cAAA,CAElE;AAAA,+BACC,YAAA,EAAW,MAAK,MAAK,QAAO,UAAS,OAAM,wBAC1C,UAAA;AAAA,YAAA,KAAK;AAAA,YAAe;AAAA,YAAE,KAAK;AAAA,UAAA,EAAA,CAC7B;AAAA,QAAA,GACD;AAAA,QACC,OAAO,KAAK,wBAAwB,IAAI,KACxC,qBAAC,KAAA,EAAI,WAAU,mCACd,UAAA;AAAA,UAAA,oBAAC,cAAW,MAAK,MAAK,QAAO,UAAS,OAAM,uBAAsB,UAAA,uBAAA,CAElE;AAAA,+BACC,YAAA,EAAW,MAAK,MAAK,QAAO,UAAS,OAAM,wBAC1C,UAAA;AAAA,YAAA,KAAK;AAAA,YAAe;AAAA,YAAE,KAAK;AAAA,UAAA,EAAA,CAC7B;AAAA,QAAA,EAAA,CACD;AAAA,MAAA,EAAA,CAEF;AAAA,IAAA;AAAA,EAAA;AAGH;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-material-calculations-CWflfqhd.js","sources":["../../src/hooks/use-material-calculations.ts"],"sourcesContent":["/* eslint-disable react-hooks/exhaustive-deps */\r\nimport { useMemo } from 'react';\r\n\r\n// ==================== CONSTANTS ====================\r\nconst MATERIAL_CONSTANTS = {\r\n STEEL_DENSITY: 7.85,\r\n LENGTH_CONVERSION_FACTOR: 1000,\r\n TUBE_CALCULATION_FACTOR: 0.024662,\r\n COIL_WEIGHTS: {\r\n GI: 2879.95,\r\n HR: 2356.59,\r\n },\r\n} as const;\r\n\r\n// ==================== TYPES ====================\r\ntype SteelType = keyof typeof MATERIAL_CONSTANTS.COIL_WEIGHTS;\r\ntype TubeType = 'Round' | 'Square' | 'Rectangle';\r\n\r\ninterface BaseFormValues {\r\n // Board calculation fields\r\n face_width?: string | number;\r\n bending?: string | number;\r\n height?: string | number;\r\n total_width?: string | number;\r\n boards_thickness?: string | number;\r\n boards_length?: string | number;\r\n \r\n // Steel calculation fields\r\n steel_length?: string | number;\r\n steel_width?: string | number;\r\n steel_thickness?: string | number;\r\n steel_type?: SteelType;\r\n \r\n // Tube calculation fields\r\n tube_type?: TubeType;\r\n tube_od?: string | number;\r\n shape_width?: string | number;\r\n shape_height?: string | number;\r\n material_thickness?: string | number;\r\n material_length?: string | number;\r\n}\r\n\r\ninterface MaterialCalculations {\r\n totalWidth: number;\r\n materialUnit: number;\r\n boardsWeight: number;\r\n steelWeight: number;\r\n materialWeight: number;\r\n}\r\n\r\ninterface CalculationResult<T = number> {\r\n value: T;\r\n isValid: boolean;\r\n error?: string;\r\n}\r\n\r\n// ==================== UTILITY FUNCTIONS ====================\r\n/**\r\n * Safely parses a value to number with comprehensive validation\r\n */\r\nconst safeParseNumber = (value: string | number | undefined | null): CalculationResult<number> => {\r\n if (value === undefined || value === null || value === '') {\r\n return { value: 0, isValid: false, error: 'Empty value' };\r\n }\r\n \r\n const parsed = typeof value === 'string' ? parseFloat(value.trim()) : Number(value);\r\n \r\n if (isNaN(parsed)) {\r\n return { value: 0, isValid: false, error: 'Invalid number format' };\r\n }\r\n \r\n if (!isFinite(parsed)) {\r\n return { value: 0, isValid: false, error: 'Number is not finite' };\r\n }\r\n \r\n return { value: parsed, isValid: true };\r\n};\r\n\r\n/**\r\n * Validates that all provided values are positive numbers\r\n */\r\nconst validatePositiveNumbers = (...values: (string | number | undefined)[]): boolean => {\r\n return values.every(value => {\r\n const result = safeParseNumber(value);\r\n return result.isValid && result.value > 0;\r\n });\r\n};\r\n\r\n/**\r\n * Creates a memoization key from form values to optimize re-calculations\r\n */\r\nconst createMemoKey = (formValues: BaseFormValues | undefined): string => {\r\n if (!formValues) return 'empty';\r\n \r\n // Only include relevant fields to avoid unnecessary recalculations\r\n const relevantFields = [\r\n 'face_width', 'bending', 'height', 'total_width', 'boards_thickness', 'boards_length',\r\n 'steel_length', 'steel_width', 'steel_thickness', 'steel_type',\r\n 'tube_type', 'tube_od', 'shape_width', 'shape_height', 'material_thickness', 'material_length'\r\n ];\r\n \r\n return relevantFields\r\n .map(field => `${field}:${formValues[field as keyof BaseFormValues] ?? ''}`)\r\n .join('|');\r\n};\r\n\r\n// ==================== CALCULATION FUNCTIONS ====================\r\n/**\r\n * Calculates the total width for boards costing\r\n * Formula: ((height + bending) * 2) + face_width\r\n */\r\nconst calculateBoardsTotalWidth = (formValues: BaseFormValues): CalculationResult<number> => {\r\n const { face_width, bending, height } = formValues;\r\n \r\n if (!validatePositiveNumbers(face_width, bending, height)) {\r\n return { value: 0, isValid: false, error: 'Invalid input values for boards total width calculation' };\r\n }\r\n \r\n const faceWidthResult = safeParseNumber(face_width);\r\n const bendingResult = safeParseNumber(bending);\r\n const heightResult = safeParseNumber(height);\r\n \r\n if (![faceWidthResult, bendingResult, heightResult].every(r => r.isValid)) {\r\n return { value: 0, isValid: false, error: 'Failed to parse input values' };\r\n }\r\n \r\n const totalWidth = ((heightResult.value + bendingResult.value) * 2) + faceWidthResult.value;\r\n \r\n return { value: totalWidth, isValid: true };\r\n};\r\n\r\n/**\r\n * Calculates the weight of boards\r\n * Formula: (total_width * thickness * (length / 1000)) * 7.85\r\n */\r\nconst calculateBoardsWeight = (formValues: BaseFormValues): CalculationResult<number> => {\r\n const { total_width, boards_thickness, boards_length } = formValues;\r\n \r\n if (!validatePositiveNumbers(total_width, boards_thickness, boards_length)) {\r\n return { value: 0, isValid: false, error: 'Invalid input values for boards weight calculation' };\r\n }\r\n \r\n const totalWidthResult = safeParseNumber(total_width);\r\n const thicknessResult = safeParseNumber(boards_thickness);\r\n const lengthResult = safeParseNumber(boards_length);\r\n \r\n if (![totalWidthResult, thicknessResult, lengthResult].every(r => r.isValid)) {\r\n return { value: 0, isValid: false, error: 'Failed to parse input values' };\r\n }\r\n \r\n const weight = (totalWidthResult.value * thicknessResult.value * \r\n (lengthResult.value / MATERIAL_CONSTANTS.LENGTH_CONVERSION_FACTOR)) * \r\n MATERIAL_CONSTANTS.STEEL_DENSITY;\r\n \r\n return { value: weight, isValid: true };\r\n};\r\n\r\n/**\r\n * Calculates the weight of steel\r\n * Formula: (length * width * thickness * 7.85) / 1000\r\n */\r\nconst calculateSteelWeight = (formValues: BaseFormValues): CalculationResult<number> => {\r\n const { steel_length, steel_width, steel_thickness } = formValues;\r\n \r\n if (!validatePositiveNumbers(steel_length, steel_width, steel_thickness)) {\r\n return { value: 0, isValid: false, error: 'Invalid input values for steel weight calculation' };\r\n }\r\n \r\n const lengthResult = safeParseNumber(steel_length);\r\n const widthResult = safeParseNumber(steel_width);\r\n const thicknessResult = safeParseNumber(steel_thickness);\r\n \r\n if (![lengthResult, widthResult, thicknessResult].every(r => r.isValid)) {\r\n return { value: 0, isValid: false, error: 'Failed to parse input values' };\r\n }\r\n \r\n const weight = (lengthResult.value * widthResult.value * thicknessResult.value * \r\n MATERIAL_CONSTANTS.STEEL_DENSITY) / MATERIAL_CONSTANTS.LENGTH_CONVERSION_FACTOR;\r\n \r\n return { value: weight, isValid: true };\r\n};\r\n\r\n/**\r\n * Gets the material unit weight based on steel type\r\n */\r\nconst calculateMaterialUnit = (formValues: BaseFormValues): CalculationResult<number> => {\r\n const { steel_type } = formValues;\r\n \r\n if (!steel_type) {\r\n return { value: 0, isValid: false, error: 'Steel type not specified' };\r\n }\r\n \r\n if (!(steel_type in MATERIAL_CONSTANTS.COIL_WEIGHTS)) {\r\n return { value: 0, isValid: false, error: `Unsupported steel type: ${steel_type}` };\r\n }\r\n \r\n const weight = MATERIAL_CONSTANTS.COIL_WEIGHTS[steel_type];\r\n return { value: weight, isValid: true };\r\n};\r\n\r\n/**\r\n * Calculates material weight based on tube type and dimensions\r\n * Supports Round, Square, and Rectangle tube types\r\n */\r\nconst calculateTubeMaterialWeight = (formValues: BaseFormValues): CalculationResult<number> => {\r\n const { tube_type, tube_od, shape_width, shape_height, material_thickness, material_length } = formValues;\r\n \r\n if (!tube_type) {\r\n return { value: 0, isValid: false, error: 'Tube type not specified' };\r\n }\r\n \r\n const thicknessResult = safeParseNumber(material_thickness);\r\n const lengthResult = safeParseNumber(material_length);\r\n \r\n if (!thicknessResult.isValid || !lengthResult.isValid) {\r\n return { value: 0, isValid: false, error: 'Invalid thickness or length values' };\r\n }\r\n \r\n let weight = 0;\r\n \r\n switch (tube_type) {\r\n case 'Round': {\r\n const odResult = safeParseNumber(tube_od);\r\n if (!odResult.isValid || odResult.value <= thicknessResult.value) {\r\n return { value: 0, isValid: false, error: 'Invalid outer diameter for round tube' };\r\n }\r\n \r\n weight = (odResult.value - thicknessResult.value) * thicknessResult.value * \r\n MATERIAL_CONSTANTS.TUBE_CALCULATION_FACTOR * lengthResult.value;\r\n break;\r\n }\r\n \r\n case 'Square':\r\n case 'Rectangle': {\r\n const widthResult = safeParseNumber(shape_width);\r\n const heightResult = safeParseNumber(shape_height);\r\n \r\n if (!widthResult.isValid || !heightResult.isValid) {\r\n return { value: 0, isValid: false, error: 'Invalid width or height for rectangular tube' };\r\n }\r\n \r\n const perimeter = 2 * (widthResult.value + heightResult.value);\r\n weight = (((perimeter / 3.14) - thicknessResult.value) * thicknessResult.value * \r\n MATERIAL_CONSTANTS.TUBE_CALCULATION_FACTOR) * lengthResult.value;\r\n break;\r\n }\r\n \r\n default:\r\n return { value: 0, isValid: false, error: `Unsupported tube type: ${tube_type}` };\r\n }\r\n \r\n return { value: Math.max(0, weight), isValid: true };\r\n};\r\n\r\n// ==================== MAIN HOOK ====================\r\n/**\r\n * Custom hook for optimized material calculations with comprehensive error handling\r\n * and performance optimization through memoization\r\n */\r\nexport const useMaterialCalculations = (formValues?: BaseFormValues): MaterialCalculations => {\r\n const calculations = useMemo(() => {\r\n if (!formValues) {\r\n return {\r\n totalWidth: 0,\r\n materialUnit: 0,\r\n boardsWeight: 0,\r\n steelWeight: 0,\r\n materialWeight: 0,\r\n };\r\n }\r\n \r\n // Calculate all values with error handling\r\n const totalWidthResult = calculateBoardsTotalWidth(formValues);\r\n const materialUnitResult = calculateMaterialUnit(formValues);\r\n const boardsWeightResult = calculateBoardsWeight(formValues);\r\n const steelWeightResult = calculateSteelWeight(formValues);\r\n const materialWeightResult = calculateTubeMaterialWeight(formValues);\r\n \r\n // Optional: Log errors in development\r\n if (process.env.NODE_ENV === 'development') {\r\n [totalWidthResult, materialUnitResult, boardsWeightResult, steelWeightResult, materialWeightResult]\r\n .filter(result => !result.isValid && result.error)\r\n .forEach(result => console.warn('Calculation warning:', result.error));\r\n }\r\n \r\n return {\r\n totalWidth: totalWidthResult.value,\r\n materialUnit: materialUnitResult.value,\r\n boardsWeight: boardsWeightResult.value,\r\n steelWeight: steelWeightResult.value,\r\n materialWeight: materialWeightResult.value,\r\n };\r\n }, [createMemoKey(formValues)]); // Optimized dependency to prevent unnecessary recalculations\r\n \r\n return calculations;\r\n};\r\n\r\n// ==================== ADDITIONAL UTILITIES ====================\r\n/**\r\n * Utility function to validate form values before calculations\r\n */\r\nexport const validateFormValues = (formValues: BaseFormValues): { isValid: boolean; errors: string[] } => {\r\n const errors: string[] = [];\r\n const { tube_type, steel_type } = formValues;\r\n \r\n // Validate steel type if provided\r\n if (steel_type && !(steel_type in MATERIAL_CONSTANTS.COIL_WEIGHTS)) {\r\n errors.push(`Invalid steel type: ${steel_type}`);\r\n }\r\n \r\n // Validate tube type if provided\r\n if (tube_type && !['Round', 'Square', 'Rectangle'].includes(tube_type)) {\r\n errors.push(`Invalid tube type: ${tube_type}`);\r\n }\r\n \r\n return { isValid: errors.length === 0, errors };\r\n};\r\n\r\n/**\r\n * Get available steel types for form validation\r\n */\r\nexport const getAvailableSteelTypes = (): SteelType[] => {\r\n return Object.keys(MATERIAL_CONSTANTS.COIL_WEIGHTS) as SteelType[];\r\n};\r\n\r\n/**\r\n * Get available tube types for form validation\r\n */\r\nexport const getAvailableTubeTypes = (): TubeType[] => {\r\n return ['Round', 'Square', 'Rectangle'];\r\n};\r\n\r\nexport default {\r\n useMaterialCalculations,\r\n validateFormValues,\r\n getAvailableSteelTypes,\r\n getAvailableTubeTypes,\r\n MATERIAL_CONSTANTS,\r\n};\r\nexport type {\r\n BaseFormValues,\r\n MaterialCalculations,\r\n SteelType,\r\n TubeType,\r\n CalculationResult,\r\n};"],"names":["useMemo"],"mappings":";;AAIA,MAAM,qBAAqB;AAAA,EACzB,eAAe;AAAA,EACf,0BAA0B;AAAA,EAC1B,yBAAyB;AAAA,EACzB,cAAc;AAAA,IACZ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA;AAER;AAgDA,MAAM,kBAAkB,CAAC,UAAyE;AAChG,MAAI,UAAU,UAAa,UAAU,QAAQ,UAAU,IAAI;AACzD,WAAO,EAAE,OAAO,GAAG,SAAS,OAAO,OAAO,cAAA;AAAA,EAC5C;AAEA,QAAM,SAAS,OAAO,UAAU,WAAW,WAAW,MAAM,KAAA,CAAM,IAAI,OAAO,KAAK;AAElF,MAAI,MAAM,MAAM,GAAG;AACjB,WAAO,EAAE,OAAO,GAAG,SAAS,OAAO,OAAO,wBAAA;AAAA,EAC5C;AAEA,MAAI,CAAC,SAAS,MAAM,GAAG;AACrB,WAAO,EAAE,OAAO,GAAG,SAAS,OAA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lC,MAAI,cAAc,EAAE,cAAc,mBAAmB,eAAe;AAClE,WAAO,KAAK,uBAAuB,UAAU,EAAE;AAAA,EACjD;AAGA,MAAI,aAAa,CAAC,CAAC,SAAS,UAAU,WAAW,EAAE,SAAS,SAAS,GAAG;AACtE,WAAO,KAAK,sBAAsB,SAAS,EAAE;AAAA,EAC/C;AAEA,SAAO,EAAE,SAAS,OAAO,WAAW,GAAG,OAAA;AACzC;AAKO,MAAM,yBAAyB,MAAmB;AACvD,SAAO,OAAO,KAAK,mBAAmB,YAAY;AACpD;AAKO,MAAM,wBAAwB,MAAkB;AACrD,SAAO,CAAC,SAAS,UAAU,WAAW;AACxC;AAEA,MAAA,kCAAe;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-material-calculations-CqYB_JaZ.esm.js","sources":["../../src/hooks/use-material-calculations.ts"],"sourcesContent":["/* eslint-disable react-hooks/exhaustive-deps */\r\nimport { useMemo } from 'react';\r\n\r\n// ==================== CONSTANTS ====================\r\nconst MATERIAL_CONSTANTS = {\r\n STEEL_DENSITY: 7.85,\r\n LENGTH_CONVERSION_FACTOR: 1000,\r\n TUBE_CALCULATION_FACTOR: 0.024662,\r\n COIL_WEIGHTS: {\r\n GI: 2879.95,\r\n HR: 2356.59,\r\n },\r\n} as const;\r\n\r\n// ==================== TYPES ====================\r\ntype SteelType = keyof typeof MATERIAL_CONSTANTS.COIL_WEIGHTS;\r\ntype TubeType = 'Round' | 'Square' | 'Rectangle';\r\n\r\ninterface BaseFormValues {\r\n // Board calculation fields\r\n face_width?: string | number;\r\n bending?: string | number;\r\n height?: string | number;\r\n total_width?: string | number;\r\n boards_thickness?: string | number;\r\n boards_length?: string | number;\r\n \r\n // Steel calculation fields\r\n steel_length?: string | number;\r\n steel_width?: string | number;\r\n steel_thickness?: string | number;\r\n steel_type?: SteelType;\r\n \r\n // Tube calculation fields\r\n tube_type?: TubeType;\r\n tube_od?: string | number;\r\n shape_width?: string | number;\r\n shape_height?: string | number;\r\n material_thickness?: string | number;\r\n material_length?: string | number;\r\n}\r\n\r\ninterface MaterialCalculations {\r\n totalWidth: number;\r\n materialUnit: number;\r\n boardsWeight: number;\r\n steelWeight: number;\r\n materialWeight: number;\r\n}\r\n\r\ninterface CalculationResult<T = number> {\r\n value: T;\r\n isValid: boolean;\r\n error?: string;\r\n}\r\n\r\n// ==================== UTILITY FUNCTIONS ====================\r\n/**\r\n * Safely parses a value to number with comprehensive validation\r\n */\r\nconst safeParseNumber = (value: string | number | undefined | null): CalculationResult<number> => {\r\n if (value === undefined || value === null || value === '') {\r\n return { value: 0, isValid: false, error: 'Empty value' };\r\n }\r\n \r\n const parsed = typeof value === 'string' ? parseFloat(value.trim()) : Number(value);\r\n \r\n if (isNaN(parsed)) {\r\n return { value: 0, isValid: false, error: 'Invalid number format' };\r\n }\r\n \r\n if (!isFinite(parsed)) {\r\n return { value: 0, isValid: false, error: 'Number is not finite' };\r\n }\r\n \r\n return { value: parsed, isValid: true };\r\n};\r\n\r\n/**\r\n * Validates that all provided values are positive numbers\r\n */\r\nconst validatePositiveNumbers = (...values: (string | number | undefined)[]): boolean => {\r\n return values.every(value => {\r\n const result = safeParseNumber(value);\r\n return result.isValid && result.value > 0;\r\n });\r\n};\r\n\r\n/**\r\n * Creates a memoization key from form values to optimize re-calculations\r\n */\r\nconst createMemoKey = (formValues: BaseFormValues | undefined): string => {\r\n if (!formValues) return 'empty';\r\n \r\n // Only include relevant fields to avoid unnecessary recalculations\r\n const relevantFields = [\r\n 'face_width', 'bending', 'height', 'total_width', 'boards_thickness', 'boards_length',\r\n 'steel_length', 'steel_width', 'steel_thickness', 'steel_type',\r\n 'tube_type', 'tube_od', 'shape_width', 'shape_height', 'material_thickness', 'material_length'\r\n ];\r\n \r\n return relevantFields\r\n .map(field => `${field}:${formValues[field as keyof BaseFormValues] ?? ''}`)\r\n .join('|');\r\n};\r\n\r\n// ==================== CALCULATION FUNCTIONS ====================\r\n/**\r\n * Calculates the total width for boards costing\r\n * Formula: ((height + bending) * 2) + face_width\r\n */\r\nconst calculateBoardsTotalWidth = (formValues: BaseFormValues): CalculationResult<number> => {\r\n const { face_width, bending, height } = formValues;\r\n \r\n if (!validatePositiveNumbers(face_width, bending, height)) {\r\n return { value: 0, isValid: false, error: 'Invalid input values for boards total width calculation' };\r\n }\r\n \r\n const faceWidthResult = safeParseNumber(face_width);\r\n const bendingResult = safeParseNumber(bending);\r\n const heightResult = safeParseNumber(height);\r\n \r\n if (![faceWidthResult, bendingResult, heightResult].every(r => r.isValid)) {\r\n return { value: 0, isValid: false, error: 'Failed to parse input values' };\r\n }\r\n \r\n const totalWidth = ((heightResult.value + bendingResult.value) * 2) + faceWidthResult.value;\r\n \r\n return { value: totalWidth, isValid: true };\r\n};\r\n\r\n/**\r\n * Calculates the weight of boards\r\n * Formula: (total_width * thickness * (length / 1000)) * 7.85\r\n */\r\nconst calculateBoardsWeight = (formValues: BaseFormValues): CalculationResult<number> => {\r\n const { total_width, boards_thickness, boards_length } = formValues;\r\n \r\n if (!validatePositiveNumbers(total_width, boards_thickness, boards_length)) {\r\n return { value: 0, isValid: false, error: 'Invalid input values for boards weight calculation' };\r\n }\r\n \r\n const totalWidthResult = safeParseNumber(total_width);\r\n const thicknessResult = safeParseNumber(boards_thickness);\r\n const lengthResult = safeParseNumber(boards_length);\r\n \r\n if (![totalWidthResult, thicknessResult, lengthResult].every(r => r.isValid)) {\r\n return { value: 0, isValid: false, error: 'Failed to parse input values' };\r\n }\r\n \r\n const weight = (totalWidthResult.value * thicknessResult.value * \r\n (lengthResult.value / MATERIAL_CONSTANTS.LENGTH_CONVERSION_FACTOR)) * \r\n MATERIAL_CONSTANTS.STEEL_DENSITY;\r\n \r\n return { value: weight, isValid: true };\r\n};\r\n\r\n/**\r\n * Calculates the weight of steel\r\n * Formula: (length * width * thickness * 7.85) / 1000\r\n */\r\nconst calculateSteelWeight = (formValues: BaseFormValues): CalculationResult<number> => {\r\n const { steel_length, steel_width, steel_thickness } = formValues;\r\n \r\n if (!validatePositiveNumbers(steel_length, steel_width, steel_thickness)) {\r\n return { value: 0, isValid: false, error: 'Invalid input values for steel weight calculation' };\r\n }\r\n \r\n const lengthResult = safeParseNumber(steel_length);\r\n const widthResult = safeParseNumber(steel_width);\r\n const thicknessResult = safeParseNumber(steel_thickness);\r\n \r\n if (![lengthResult, widthResult, thicknessResult].every(r => r.isValid)) {\r\n return { value: 0, isValid: false, error: 'Failed to parse input values' };\r\n }\r\n \r\n const weight = (lengthResult.value * widthResult.value * thicknessResult.value * \r\n MATERIAL_CONSTANTS.STEEL_DENSITY) / MATERIAL_CONSTANTS.LENGTH_CONVERSION_FACTOR;\r\n \r\n return { value: weight, isValid: true };\r\n};\r\n\r\n/**\r\n * Gets the material unit weight based on steel type\r\n */\r\nconst calculateMaterialUnit = (formValues: BaseFormValues): CalculationResult<number> => {\r\n const { steel_type } = formValues;\r\n \r\n if (!steel_type) {\r\n return { value: 0, isValid: false, error: 'Steel type not specified' };\r\n }\r\n \r\n if (!(steel_type in MATERIAL_CONSTANTS.COIL_WEIGHTS)) {\r\n return { value: 0, isValid: false, error: `Unsupported steel type: ${steel_type}` };\r\n }\r\n \r\n const weight = MATERIAL_CONSTANTS.COIL_WEIGHTS[steel_type];\r\n return { value: weight, isValid: true };\r\n};\r\n\r\n/**\r\n * Calculates material weight based on tube type and dimensions\r\n * Supports Round, Square, and Rectangle tube types\r\n */\r\nconst calculateTubeMaterialWeight = (formValues: BaseFormValues): CalculationResult<number> => {\r\n const { tube_type, tube_od, shape_width, shape_height, material_thickness, material_length } = formValues;\r\n \r\n if (!tube_type) {\r\n return { value: 0, isValid: false, error: 'Tube type not specified' };\r\n }\r\n \r\n const thicknessResult = safeParseNumber(material_thickness);\r\n const lengthResult = safeParseNumber(material_length);\r\n \r\n if (!thicknessResult.isValid || !lengthResult.isValid) {\r\n return { value: 0, isValid: false, error: 'Invalid thickness or length values' };\r\n }\r\n \r\n let weight = 0;\r\n \r\n switch (tube_type) {\r\n case 'Round': {\r\n const odResult = safeParseNumber(tube_od);\r\n if (!odResult.isValid || odResult.value <= thicknessResult.value) {\r\n return { value: 0, isValid: false, error: 'Invalid outer diameter for round tube' };\r\n }\r\n \r\n weight = (odResult.value - thicknessResult.value) * thicknessResult.value * \r\n MATERIAL_CONSTANTS.TUBE_CALCULATION_FACTOR * lengthResult.value;\r\n break;\r\n }\r\n \r\n case 'Square':\r\n case 'Rectangle': {\r\n const widthResult = safeParseNumber(shape_width);\r\n const heightResult = safeParseNumber(shape_height);\r\n \r\n if (!widthResult.isValid || !heightResult.isValid) {\r\n return { value: 0, isValid: false, error: 'Invalid width or height for rectangular tube' };\r\n }\r\n \r\n const perimeter = 2 * (widthResult.value + heightResult.value);\r\n weight = (((perimeter / 3.14) - thicknessResult.value) * thicknessResult.value * \r\n MATERIAL_CONSTANTS.TUBE_CALCULATION_FACTOR) * lengthResult.value;\r\n break;\r\n }\r\n \r\n default:\r\n return { value: 0, isValid: false, error: `Unsupported tube type: ${tube_type}` };\r\n }\r\n \r\n return { value: Math.max(0, weight), isValid: true };\r\n};\r\n\r\n// ==================== MAIN HOOK ====================\r\n/**\r\n * Custom hook for optimized material calculations with comprehensive error handling\r\n * and performance optimization through memoization\r\n */\r\nexport const useMaterialCalculations = (formValues?: BaseFormValues): MaterialCalculations => {\r\n const calculations = useMemo(() => {\r\n if (!formValues) {\r\n return {\r\n totalWidth: 0,\r\n materialUnit: 0,\r\n boardsWeight: 0,\r\n steelWeight: 0,\r\n materialWeight: 0,\r\n };\r\n }\r\n \r\n // Calculate all values with error handling\r\n const totalWidthResult = calculateBoardsTotalWidth(formValues);\r\n const materialUnitResult = calculateMaterialUnit(formValues);\r\n const boardsWeightResult = calculateBoardsWeight(formValues);\r\n const steelWeightResult = calculateSteelWeight(formValues);\r\n const materialWeightResult = calculateTubeMaterialWeight(formValues);\r\n \r\n // Optional: Log errors in development\r\n if (process.env.NODE_ENV === 'development') {\r\n [totalWidthResult, materialUnitResult, boardsWeightResult, steelWeightResult, materialWeightResult]\r\n .filter(result => !result.isValid && result.error)\r\n .forEach(result => console.warn('Calculation warning:', result.error));\r\n }\r\n \r\n return {\r\n totalWidth: totalWidthResult.value,\r\n materialUnit: materialUnitResult.value,\r\n boardsWeight: boardsWeightResult.value,\r\n steelWeight: steelWeightResult.value,\r\n materialWeight: materialWeightResult.value,\r\n };\r\n }, [createMemoKey(formValues)]); // Optimized dependency to prevent unnecessary recalculations\r\n \r\n return calculations;\r\n};\r\n\r\n// ==================== ADDITIONAL UTILITIES ====================\r\n/**\r\n * Utility function to validate form values before calculations\r\n */\r\nexport const validateFormValues = (formValues: BaseFormValues): { isValid: boolean; errors: string[] } => {\r\n const errors: string[] = [];\r\n const { tube_type, steel_type } = formValues;\r\n \r\n // Validate steel type if provided\r\n if (steel_type && !(steel_type in MATERIAL_CONSTANTS.COIL_WEIGHTS)) {\r\n errors.push(`Invalid steel type: ${steel_type}`);\r\n }\r\n \r\n // Validate tube type if provided\r\n if (tube_type && !['Round', 'Square', 'Rectangle'].includes(tube_type)) {\r\n errors.push(`Invalid tube type: ${tube_type}`);\r\n }\r\n \r\n return { isValid: errors.length === 0, errors };\r\n};\r\n\r\n/**\r\n * Get available steel types for form validation\r\n */\r\nexport const getAvailableSteelTypes = (): SteelType[] => {\r\n return Object.keys(MATERIAL_CONSTANTS.COIL_WEIGHTS) as SteelType[];\r\n};\r\n\r\n/**\r\n * Get available tube types for form validation\r\n */\r\nexport const getAvailableTubeTypes = (): TubeType[] => {\r\n return ['Round', 'Square', 'Rectangle'];\r\n};\r\n\r\nexport default {\r\n useMaterialCalculations,\r\n validateFormValues,\r\n getAvailableSteelTypes,\r\n getAvailableTubeTypes,\r\n MATERIAL_CONSTANTS,\r\n};\r\nexport type {\r\n BaseFormValues,\r\n MaterialCalculations,\r\n SteelType,\r\n TubeType,\r\n CalculationResult,\r\n};"],"names":[],"mappings":";AAIA,MAAM,qBA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AQ,IAAI,aAAa,eAAe;AAC1C,OAAC,kBAAkB,oBAAoB,oBAAoB,mBAAmB,oBAAoB,EAC/F,OAAO,YAAU,CAAC,OAAO,WAAW,OAAO,KAAK,EAChD,QAAQ,CAAA,WAAU,QAAQ,KAAK,wBAAwB,OAAO,KAAK,CAAC;AAAA,IACzE;AAEA,WAAO;AAAA,MACL,YAAY,iBAAiB;AAAA,MAC7B,cAAc,mBAAmB;AAAA,MACjC,cAAc,mBAAmB;AAAA,MACjC,aAAa,kBAAkB;AAAA,MAC/B,gBAAgB,qBAAqB;AAAA,IAAA;AAAA,EAEzC,GAAG,CAAC,cAAc,UAAU,CAAC,CAAC;AAE9B,SAAO;AACT;AAMO,MAAM,qBAAqB,CAAC,eAAuE;AACxG,QAAM,SAAmB,CAAA;AACzB,QAAM,EAAE,WAAW,WAAA,IAAe;AAGlC,MAAI,cAAc,EAAE,cAAc,mBAAmB,eAAe;AAClE,WAAO,KAAK,uBAAuB,UAAU,EAAE;AAAA,EACjD;AAGA,MAAI,aAAa,CAAC,CAAC,SAAS,UAAU,WAAW,EAAE,SAAS,SAAS,GAAG;AACtE,WAAO,KAAK,sBAAsB,SAAS,EAAE;AAAA,EAC/C;AAEA,SAAO,EAAE,SAAS,OAAO,WAAW,GAAG,OAAA;AACzC;AAKO,MAAM,yBAAyB,MAAmB;AACvD,SAAO,OAAO,KAAK,mBAAmB,YAAY;AACpD;AAKO,MAAM,wBAAwB,MAAkB;AACrD,SAAO,CAAC,SAAS,UAAU,WAAW;AACxC;AAEA,MAAA,kCAAe;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAdditionalDiscountAutoCalc-BCek0vno.js","sources":["../../src/hooks/useAdditionalDiscountAutoCalc.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\r\n\r\nimport { calculateAdditionalDiscountCrossValue } from '../utils/calculation';\r\n\r\nfunction computeTotal(\r\n items: any[],\r\n discountOn: string | null | undefined,\r\n netAmountField = 'net_amount',\r\n grossAmountField = 'gross_amount'\r\n): number {\r\n const field = discountOn === 'Gross Amount' ? grossAmountField : netAmountField;\r\n return items.reduce((sum: number, item: any) => sum + Number(item[field] || 0), 0);\r\n}\r\n\r\nexport interface AdditionalDiscountAutoCalcConfig {\r\n items: any[];\r\n discountOn: string | null | undefined;\r\n percentage: number | string;\r\n amount: number | string;\r\n setValue: (name: string, value: any) => void;\r\n fieldConfig: {\r\n percentageField: string;\r\n amountField: string;\r\n };\r\n netAmountField?: string;\r\n grossAmountField?: string;\r\n\r\n /**\r\n * When true, auto-disabled logic is bypassed.\r\n * Caller explicitly controls field disabled states\r\n * via disablePercentageField / disableAmountField.\r\n * Auto sync (value calculation) still works regardless.\r\n */\r\n manualDisabled?: boolean;\r\n disablePercentageField?: boolean;\r\n disableAmountField?: boolean;\r\n}\r\n\r\nexport function useAdditionalDiscountAutoCalc(config: AdditionalDiscountAutoCalcConfig) {\r\n const lastChangedBy = useRef<'user' | 'auto'>('user');\r\n const lastUserEdited = useRef<'percentage' | 'amount' | null>(null);\r\n\r\n // Percentage → Amount\r\n useEffect(() => {\r\n if (lastChangedBy.current === 'auto') {\r\n lastChangedBy.current = 'user';\r\n return;\r\n }\r\n if (!config.discountOn) return;\r\n const pct = Number(config.percentage);\r\n const amt = Number(config.amount);\r\n const total = computeTotal(config.items, config.discountOn, config.netAmountField, config.grossAmountField);\r\n\r\n if (!pct && amt && lastUserEdited.current === 'percentage') {\r\n config.setValue(config.fieldConfig.amountField, 0);\r\n lastUserEdited.current = null;\r\n return;\r\n }\r\n if (!pct || !total) return;\r\n\r\n lastUserEdited.current = 'percentage';\r\n lastChangedBy.current = 'auto';\r\n config.setValue(config.fieldConfig.amountField,\r\n calculateAdditionalDiscountCrossValue(pct, 'percentage', total));\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [config.percentage, config.discountOn]);\r\n\r\n // Amount → Percentage\r\n useEffect(() => {\r\n if (lastChangedBy.current === 'auto') {\r\n lastChangedBy.current = 'user';\r\n return;\r\n }\r\n if (!config.discountOn) return;\r\n const pct = Number(config.percentage);\r\n const amt = Number(config.amount);\r\n const total = computeTotal(config.items, config.discountOn, config.netAmountField, config.grossAmountField);\r\n\r\n if (!amt && pct && lastUserEdited.current === 'amount') {\r\n config.setValue(config.fieldConfig.percentageField, 0);\r\n lastUserEdited.current = null;\r\n return;\r\n }\r\n if (!amt || !total) return;\r\n\r\n lastUserEdited.current = 'amount';\r\n lastChangedBy.current = 'auto';\r\n config.setValue(config.fieldConfig.percentageField,\r\n calculateAdditionalDiscountCrossValue(amt, 'amount', total));\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [config.amount, config.discountOn]);\r\n\r\n const autoPercentageDisabled = !config.discountOn || (\r\n Boolean(Number(config.amount)) && lastUserEdited.current !== 'percentage'\r\n );\r\n const autoAmountDisabled = !config.discountOn || (\r\n Boolean(Number(config.percentage)) && lastUserEdited.current !== 'amount'\r\n );\r\n\r\n const isPercentageDisabled = config.manualDisabled\r\n ? (config.disablePercentageField ?? false)\r\n : autoPercentageDisabled;\r\n const isAmountDisabled = config.manualDisabled\r\n ? (config.disableAmountField ?? false)\r\n : autoAmountDisabled;\r\n\r\n const totalAmount = config.discountOn\r\n ? computeTotal(config.items, config.discountOn, config.netAmountField, config.grossAmountField)\r\n : 0;\r\n const isAmountExceeded = !!(config.discountOn && totalAmount > 0 && Number(config.amount) > totalAmount);\r\n const isPercentageExceeded = Number(config.percentage) > 100;\r\n\r\n return { isPercentageDisabled, isAmountDisabled, isAmountExceeded, isPercentageExceeded };\r\n}\r\n"],"names":["useRef","useEffect","calculateAdditionalDiscountCrossValue"],"mappings":";;;AAIA,SAAS,aACP,OACA,YACA,iBAAiB,cACjB,mBAAmB,gBACX;AACR,QAAM,QAAQ,eAAe,iBAAiB,mBAAmB;AACjE,SAAO,MAAM,OAAO,CAAC,KAAa,SAAc,MAAM,OAAO,KAAK,KA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AAc,UAAU;AACxB,WAAO;AAAA,MAAS,OAAO,YAAY;AAAA,MACjCC,wDAAsC,KAAK,UAAU,KAAK;AAAA,IAAA;AAAA,EAE9D,GAAG,CAAC,OAAO,QAAQ,OAAO,UAAU,CAAC;AAErC,QAAM,yBAAyB,CAAC,OAAO,cACrC,QAAQ,OAAO,OAAO,MAAM,CAAC,KAAK,eAAe,YAAY;AAE/D,QAAM,qBAAqB,CAAC,OAAO,cACjC,QAAQ,OAAO,OAAO,UAAU,CAAC,KAAK,eAAe,YAAY;AAGnE,QAAM,uBAAuB,OAAO,iBAC/B,OAAO,0BAA0B,QAClC;AACJ,QAAM,mBAAmB,OAAO,iBAC3B,OAAO,sBAAsB,QAC9B;AAEJ,QAAM,cAAc,OAAO,aACvB,aAAa,OAAO,OAAO,OAAO,YAAY,OAAO,gBAAgB,OAAO,gBAAgB,IAC5F;AACJ,QAAM,mBAAmB,CAAC,EAAE,OAAO,cAAc,cAAc,KAAK,OAAO,OAAO,MAAM,IAAI;AAC5F,QAAM,uBAAuB,OAAO,OAAO,UAAU,IAAI;AAEzD,SAAO,EAAE,sBAAsB,kBAAkB,kBAAkB,qBAAA;AACrE;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAdditionalDiscountAutoCalc-CgTlmKfL.esm.js","sources":["../../src/hooks/useAdditionalDiscountAutoCalc.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\r\n\r\nimport { calculateAdditionalDiscountCrossValue } from '../utils/calculation';\r\n\r\nfunction computeTotal(\r\n items: any[],\r\n discountOn: string | null | undefined,\r\n netAmountField = 'net_amount',\r\n grossAmountField = 'gross_amount'\r\n): number {\r\n const field = discountOn === 'Gross Amount' ? grossAmountField : netAmountField;\r\n return items.reduce((sum: number, item: any) => sum + Number(item[field] || 0), 0);\r\n}\r\n\r\nexport interface AdditionalDiscountAutoCalcConfig {\r\n items: any[];\r\n discountOn: string | null | undefined;\r\n percentage: number | string;\r\n amount: number | string;\r\n setValue: (name: string, value: any) => void;\r\n fieldConfig: {\r\n percentageField: string;\r\n amountField: string;\r\n };\r\n netAmountField?: string;\r\n grossAmountField?: string;\r\n\r\n /**\r\n * When true, auto-disabled logic is bypassed.\r\n * Caller explicitly controls field disabled states\r\n * via disablePercentageField / disableAmountField.\r\n * Auto sync (value calculation) still works regardless.\r\n */\r\n manualDisabled?: boolean;\r\n disablePercentageField?: boolean;\r\n disableAmountField?: boolean;\r\n}\r\n\r\nexport function useAdditionalDiscountAutoCalc(config: AdditionalDiscountAutoCalcConfig) {\r\n const lastChangedBy = useRef<'user' | 'auto'>('user');\r\n const lastUserEdited = useRef<'percentage' | 'amount' | null>(null);\r\n\r\n // Percentage → Amount\r\n useEffect(() => {\r\n if (lastChangedBy.current === 'auto') {\r\n lastChangedBy.current = 'user';\r\n return;\r\n }\r\n if (!config.discountOn) return;\r\n const pct = Number(config.percentage);\r\n const amt = Number(config.amount);\r\n const total = computeTotal(config.items, config.discountOn, config.netAmountField, config.grossAmountField);\r\n\r\n if (!pct && amt && lastUserEdited.current === 'percentage') {\r\n config.setValue(config.fieldConfig.amountField, 0);\r\n lastUserEdited.current = null;\r\n return;\r\n }\r\n if (!pct || !total) return;\r\n\r\n lastUserEdited.current = 'percentage';\r\n lastChangedBy.current = 'auto';\r\n config.setValue(config.fieldConfig.amountField,\r\n calculateAdditionalDiscountCrossValue(pct, 'percentage', total));\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [config.percentage, config.discountOn]);\r\n\r\n // Amount → Percentage\r\n useEffect(() => {\r\n if (lastChangedBy.current === 'auto') {\r\n lastChangedBy.current = 'user';\r\n return;\r\n }\r\n if (!config.discountOn) return;\r\n const pct = Number(config.percentage);\r\n const amt = Number(config.amount);\r\n const total = computeTotal(config.items, config.discountOn, config.netAmountField, config.grossAmountField);\r\n\r\n if (!amt && pct && lastUserEdited.current === 'amount') {\r\n config.setValue(config.fieldConfig.percentageField, 0);\r\n lastUserEdited.current = null;\r\n return;\r\n }\r\n if (!amt || !total) return;\r\n\r\n lastUserEdited.current = 'amount';\r\n lastChangedBy.current = 'auto';\r\n config.setValue(config.fieldConfig.percentageField,\r\n calculateAdditionalDiscountCrossValue(amt, 'amount', total));\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [config.amount, config.discountOn]);\r\n\r\n const autoPercentageDisabled = !config.discountOn || (\r\n Boolean(Number(config.amount)) && lastUserEdited.current !== 'percentage'\r\n );\r\n const autoAmountDisabled = !config.discountOn || (\r\n Boolean(Number(config.percentage)) && lastUserEdited.current !== 'amount'\r\n );\r\n\r\n const isPercentageDisabled = config.manualDisabled\r\n ? (config.disablePercentageField ?? false)\r\n : autoPercentageDisabled;\r\n const isAmountDisabled = config.manualDisabled\r\n ? (config.disableAmountField ?? false)\r\n : autoAmountDisabled;\r\n\r\n const totalAmount = config.discountOn\r\n ? computeTotal(config.items, config.discountOn, config.netAmountField, config.grossAmountField)\r\n : 0;\r\n const isAmountExceeded = !!(config.discountOn && totalAmount > 0 && Number(config.amount) > totalAmount);\r\n const isPercentageExceeded = Number(config.percentage) > 100;\r\n\r\n return { isPercentageDisabled, isAmountDisabled, isAmountExceeded, isPercentageExceeded };\r\n}\r\n"],"names":[],"mappings":";;AAIA,SAAS,aACP,OACA,YACA,iBAAiB,cACjB,mBAAmB,gBACX;AACR,QAAM,QAAQ,eAAe,iBAAiB,mBAAmB;AACjE,SAAO,MAAM,OAAO,CAAC,KAAa,SAAc,MAAM,OAAO,KAAK,KAAK,KAAK,CAAC,GAAG,CAAC;AACnF;AA0BO,SAAS,8BAA8B,QAA0C;AACtF,QAAM,gBAAgB,OAAwB,MAAM;AACpD,QAAM,iBAAiB,OAAuC,IAAI;AAGlE,YAAU,MAAM;AACd,QAAI,cAAc,YAAY,QAAQ;AACpC,oBAAc,UAAU;AACxB;AAAA,IACF;AACA,QAAI,CAAC,OAAO,WAAY;AACxB,UAAM,MAAM,OAAO,OAAO,UAAU;AACpC,UAAM,MAAM,OAAO,OAAO,MAAM;AAChC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