@erpsquad/common 1.8.119 → 1.8.122

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 (291) hide show
  1. package/dist/_virtual/index/index.esm.js +2 -4
  2. package/dist/_virtual/index/index.esm.js.map +1 -1
  3. package/dist/_virtual/index/index.esm10.js +3 -3
  4. package/dist/_virtual/index/index.esm2.js +3 -3
  5. package/dist/_virtual/index/index.esm3.js +3 -3
  6. package/dist/_virtual/index/index.esm4.js +3 -3
  7. package/dist/_virtual/index/index.esm5.js +3 -3
  8. package/dist/_virtual/index/index.esm6.js +3 -3
  9. package/dist/_virtual/index/index.esm7.js +4 -2
  10. package/dist/_virtual/index/index.esm7.js.map +1 -1
  11. package/dist/_virtual/index/index.esm8.js +3 -3
  12. package/dist/_virtual/index/index.esm9.js +3 -3
  13. package/dist/_virtual/index/index.js +1 -1
  14. package/dist/_virtual/index/index10.js +1 -1
  15. package/dist/_virtual/index/index2.js +1 -1
  16. package/dist/_virtual/index/index3.js +1 -1
  17. package/dist/_virtual/index/index4.js +1 -1
  18. package/dist/_virtual/index/index5.js +1 -1
  19. package/dist/_virtual/index/index6.js +1 -1
  20. package/dist/_virtual/index/index7.js +1 -1
  21. package/dist/_virtual/index/index8.js +1 -1
  22. package/dist/_virtual/index/index9.js +1 -1
  23. package/dist/components/accordion/accordion.d.ts +1 -1
  24. package/dist/components/action-bar/action-bar.d.ts +1 -1
  25. package/dist/components/checkbox/checkbox.d.ts +1 -1
  26. package/dist/components/date-picker/date-picker.d.ts +1 -1
  27. package/dist/components/footer/footer.d.ts +1 -1
  28. package/dist/components/form-control/form-builder/form-builder-element/media.d.ts +1 -1
  29. package/dist/components/form-control/form-builder/form-builder-element/phone.d.ts +1 -1
  30. package/dist/components/form-control/form-builder/form-builder-element/select.d.ts +1 -1
  31. package/dist/components/form-control/form-builder/form-builder-element/text.d.ts +1 -1
  32. package/dist/components/form-control/form-builder/form-builder-element/time.d.ts +1 -1
  33. package/dist/components/form-control/form-parser/form-parser/index.esm.js +11 -3
  34. package/dist/components/form-control/form-parser/form-parser/index.esm.js.map +1 -1
  35. package/dist/components/form-control/form-parser/form-parser/index.js +4 -4
  36. package/dist/components/form-control/form-parser/form-parser/index.js.map +1 -1
  37. package/dist/components/form-control/form-parser/form-parser.d.ts +0 -1
  38. package/dist/components/form-control/form-parser/form-switcher.d.ts +1 -1
  39. package/dist/components/icons/action-arrow.d.ts +3 -3
  40. package/dist/components/icons/add-circle.d.ts +3 -3
  41. package/dist/components/icons/arrow-bidirectional.d.ts +3 -3
  42. package/dist/components/icons/arrow-circle-down.d.ts +3 -3
  43. package/dist/components/icons/arrow-down-three.d.ts +3 -3
  44. package/dist/components/icons/arrow-down-two.d.ts +3 -3
  45. package/dist/components/icons/arrow-down.d.ts +3 -3
  46. package/dist/components/icons/arrow-up-down.d.ts +3 -3
  47. package/dist/components/icons/arrow-up-two.d.ts +3 -3
  48. package/dist/components/icons/assignments.d.ts +3 -3
  49. package/dist/components/icons/blank-circle.d.ts +3 -3
  50. package/dist/components/icons/block-filled.d.ts +3 -3
  51. package/dist/components/icons/calendar-add.d.ts +3 -3
  52. package/dist/components/icons/calendar.d.ts +3 -3
  53. package/dist/components/icons/checkbox-square.d.ts +3 -3
  54. package/dist/components/icons/circular-arrow-setting.d.ts +3 -3
  55. package/dist/components/icons/clock.d.ts +3 -3
  56. package/dist/components/icons/close.d.ts +3 -3
  57. package/dist/components/icons/coin-outline.d.ts +3 -3
  58. package/dist/components/icons/copy.d.ts +3 -3
  59. package/dist/components/icons/coupon.d.ts +3 -3
  60. package/dist/components/icons/cross-hire.d.ts +3 -3
  61. package/dist/components/icons/custom-styled-icon.d.ts +3 -3
  62. package/dist/components/icons/dashboard.d.ts +3 -3
  63. package/dist/components/icons/document-download.d.ts +3 -3
  64. package/dist/components/icons/document.d.ts +3 -3
  65. package/dist/components/icons/dollar-circle-filled.d.ts +3 -3
  66. package/dist/components/icons/dollar-circle.d.ts +3 -3
  67. package/dist/components/icons/edit.d.ts +3 -3
  68. package/dist/components/icons/email.d.ts +3 -3
  69. package/dist/components/icons/export.d.ts +3 -3
  70. package/dist/components/icons/eye-off.d.ts +3 -3
  71. package/dist/components/icons/eye-plus-circle.d.ts +3 -3
  72. package/dist/components/icons/eye.d.ts +3 -3
  73. package/dist/components/icons/filled-circle.d.ts +3 -3
  74. package/dist/components/icons/filter-remove.d.ts +3 -3
  75. package/dist/components/icons/filter.d.ts +3 -3
  76. package/dist/components/icons/folder-save.d.ts +3 -3
  77. package/dist/components/icons/grid.d.ts +3 -3
  78. package/dist/components/icons/hashtag.d.ts +3 -3
  79. package/dist/components/icons/image.d.ts +3 -3
  80. package/dist/components/icons/import.d.ts +3 -3
  81. package/dist/components/icons/info-circle.d.ts +3 -3
  82. package/dist/components/icons/info.d.ts +3 -3
  83. package/dist/components/icons/link-horizontal.d.ts +3 -3
  84. package/dist/components/icons/link.d.ts +3 -3
  85. package/dist/components/icons/location.d.ts +3 -3
  86. package/dist/components/icons/lowest-lead-time.d.ts +3 -3
  87. package/dist/components/icons/lowest-min-qty.d.ts +3 -3
  88. package/dist/components/icons/lowest-price.d.ts +3 -3
  89. package/dist/components/icons/more.d.ts +3 -3
  90. package/dist/components/icons/notification.d.ts +3 -3
  91. package/dist/components/icons/paper-clip.d.ts +3 -3
  92. package/dist/components/icons/paragraph.d.ts +3 -3
  93. package/dist/components/icons/payment-request.d.ts +3 -3
  94. package/dist/components/icons/phone.d.ts +3 -3
  95. package/dist/components/icons/printer.d.ts +3 -3
  96. package/dist/components/icons/process-calendar.d.ts +3 -3
  97. package/dist/components/icons/promotion.d.ts +3 -3
  98. package/dist/components/icons/radio-button.d.ts +3 -3
  99. package/dist/components/icons/receipt-filled.d.ts +3 -3
  100. package/dist/components/icons/receipt-outline.d.ts +3 -3
  101. package/dist/components/icons/receipt.d.ts +3 -3
  102. package/dist/components/icons/refresh-icon.d.ts +3 -3
  103. package/dist/components/icons/replace.d.ts +3 -3
  104. package/dist/components/icons/save.d.ts +3 -3
  105. package/dist/components/icons/search-status.d.ts +3 -3
  106. package/dist/components/icons/search.d.ts +3 -3
  107. package/dist/components/icons/settings-fallback.d.ts +3 -3
  108. package/dist/components/icons/sort-arrow-icon.d.ts +3 -3
  109. package/dist/components/icons/stacked-layer.d.ts +3 -3
  110. package/dist/components/icons/start-filled.d.ts +3 -3
  111. package/dist/components/icons/three-dot-icon.d.ts +3 -3
  112. package/dist/components/icons/tick-circle-filled.d.ts +3 -3
  113. package/dist/components/icons/tick-circle.d.ts +3 -3
  114. package/dist/components/icons/tick-octagon.d.ts +3 -3
  115. package/dist/components/icons/tick.d.ts +3 -3
  116. package/dist/components/icons/toggle-switch.d.ts +3 -3
  117. package/dist/components/icons/trash.d.ts +3 -3
  118. package/dist/components/icons/wave.d.ts +3 -3
  119. package/dist/components/icons/with-out-tick-octagon.d.ts +3 -3
  120. package/dist/components/icons/work-centre.d.ts +3 -3
  121. package/dist/components/index.esm.js +2 -2
  122. package/dist/components/index.js +1 -1
  123. package/dist/components/location-select.d.ts +1 -1
  124. package/dist/components/material-editable-table/material-editable-table.d.ts +1 -1
  125. package/dist/components/material-table/material-table.d.ts +1 -1
  126. package/dist/components/phone-input/phone-input.d.ts +1 -1
  127. package/dist/components/radio/radio.d.ts +1 -1
  128. package/dist/components/select/select.d.ts +1 -1
  129. package/dist/components/switches/android-12-switch.d.ts +3 -1
  130. package/dist/components/text-field/text-field.d.ts +1 -1
  131. package/dist/components/time-picker/time-picker.d.ts +1 -1
  132. package/dist/components/upload-media/upload-media.d.ts +1 -1
  133. package/dist/hooks/useUomFieldUpdater/index.esm.js +1 -1
  134. package/dist/hooks/useUomFieldUpdater/index.esm.js.map +1 -1
  135. package/dist/hooks/useUomFieldUpdater/index.js +1 -1
  136. package/dist/hooks/useUomFieldUpdater/index.js.map +1 -1
  137. package/dist/index.esm.js +75 -75
  138. package/dist/index.js +1 -1
  139. package/dist/node_modules/@mui/icons-material/utils/createSvgIcon/index.esm.js +1 -1
  140. package/dist/node_modules/@mui/icons-material/utils/createSvgIcon/index.js +1 -1
  141. package/dist/node_modules/@mui/icons-material/utils/createSvgIcon/index.js.map +1 -1
  142. package/dist/node_modules/@mui/system/colorManipulator/index.esm.js +2 -2
  143. package/dist/node_modules/@mui/system/colorManipulator/index.js +1 -1
  144. package/dist/node_modules/@mui/system/colorManipulator/index.js.map +1 -1
  145. package/dist/node_modules/@mui/system/createStyled/index.esm.js +6 -6
  146. package/dist/node_modules/@mui/system/createStyled/index.js +1 -1
  147. package/dist/node_modules/@mui/system/createStyled/index.js.map +1 -1
  148. package/dist/node_modules/@mui/system/useThemeWithoutDefault/index.esm.js +1 -1
  149. package/dist/node_modules/@mui/system/useThemeWithoutDefault/index.js +1 -1
  150. package/dist/node_modules/@mui/system/useThemeWithoutDefault/index.js.map +1 -1
  151. package/dist/node_modules/prop-types/checkPropTypes/index.esm.js +48 -55
  152. package/dist/node_modules/prop-types/checkPropTypes/index.esm.js.map +1 -1
  153. package/dist/node_modules/prop-types/checkPropTypes/index.js +1 -1
  154. package/dist/node_modules/prop-types/checkPropTypes/index.js.map +1 -1
  155. package/dist/node_modules/prop-types/factoryWithTypeCheckers/index.esm.js +2 -2
  156. package/dist/node_modules/prop-types/factoryWithTypeCheckers/index.esm.js.map +1 -1
  157. package/dist/node_modules/prop-types/factoryWithTypeCheckers/index.js +1 -1
  158. package/dist/node_modules/prop-types/factoryWithTypeCheckers/index.js.map +1 -1
  159. package/dist/node_modules/prop-types/index/index.esm.js +1 -1
  160. package/dist/node_modules/prop-types/index/index.js +1 -1
  161. package/dist/node_modules/prop-types/index/index.js.map +1 -1
  162. package/dist/src/components/accordion/accordion.d.ts +1 -1
  163. package/dist/src/components/action-bar/action-bar.d.ts +1 -1
  164. package/dist/src/components/checkbox/checkbox.d.ts +1 -1
  165. package/dist/src/components/date-picker/date-picker.d.ts +1 -1
  166. package/dist/src/components/footer/footer.d.ts +1 -1
  167. package/dist/src/components/form-control/form-builder/form-builder-element/media.d.ts +1 -1
  168. package/dist/src/components/form-control/form-builder/form-builder-element/phone.d.ts +1 -1
  169. package/dist/src/components/form-control/form-builder/form-builder-element/select.d.ts +1 -1
  170. package/dist/src/components/form-control/form-builder/form-builder-element/text.d.ts +1 -1
  171. package/dist/src/components/form-control/form-builder/form-builder-element/time.d.ts +1 -1
  172. package/dist/src/components/form-control/form-parser/form-parser.d.ts +0 -1
  173. package/dist/src/components/form-control/form-parser/form-switcher.d.ts +1 -1
  174. package/dist/src/components/icons/action-arrow.d.ts +3 -3
  175. package/dist/src/components/icons/add-circle.d.ts +3 -3
  176. package/dist/src/components/icons/arrow-bidirectional.d.ts +3 -3
  177. package/dist/src/components/icons/arrow-circle-down.d.ts +3 -3
  178. package/dist/src/components/icons/arrow-down-three.d.ts +3 -3
  179. package/dist/src/components/icons/arrow-down-two.d.ts +3 -3
  180. package/dist/src/components/icons/arrow-down.d.ts +3 -3
  181. package/dist/src/components/icons/arrow-up-down.d.ts +3 -3
  182. package/dist/src/components/icons/arrow-up-two.d.ts +3 -3
  183. package/dist/src/components/icons/assignments.d.ts +3 -3
  184. package/dist/src/components/icons/blank-circle.d.ts +3 -3
  185. package/dist/src/components/icons/block-filled.d.ts +3 -3
  186. package/dist/src/components/icons/calendar-add.d.ts +3 -3
  187. package/dist/src/components/icons/calendar.d.ts +3 -3
  188. package/dist/src/components/icons/checkbox-square.d.ts +3 -3
  189. package/dist/src/components/icons/circular-arrow-setting.d.ts +3 -3
  190. package/dist/src/components/icons/clock.d.ts +3 -3
  191. package/dist/src/components/icons/close.d.ts +3 -3
  192. package/dist/src/components/icons/coin-outline.d.ts +3 -3
  193. package/dist/src/components/icons/copy.d.ts +3 -3
  194. package/dist/src/components/icons/coupon.d.ts +3 -3
  195. package/dist/src/components/icons/cross-hire.d.ts +3 -3
  196. package/dist/src/components/icons/custom-styled-icon.d.ts +3 -3
  197. package/dist/src/components/icons/dashboard.d.ts +3 -3
  198. package/dist/src/components/icons/document-download.d.ts +3 -3
  199. package/dist/src/components/icons/document.d.ts +3 -3
  200. package/dist/src/components/icons/dollar-circle-filled.d.ts +3 -3
  201. package/dist/src/components/icons/dollar-circle.d.ts +3 -3
  202. package/dist/src/components/icons/edit.d.ts +3 -3
  203. package/dist/src/components/icons/email.d.ts +3 -3
  204. package/dist/src/components/icons/export.d.ts +3 -3
  205. package/dist/src/components/icons/eye-off.d.ts +3 -3
  206. package/dist/src/components/icons/eye-plus-circle.d.ts +3 -3
  207. package/dist/src/components/icons/eye.d.ts +3 -3
  208. package/dist/src/components/icons/filled-circle.d.ts +3 -3
  209. package/dist/src/components/icons/filter-remove.d.ts +3 -3
  210. package/dist/src/components/icons/filter.d.ts +3 -3
  211. package/dist/src/components/icons/folder-save.d.ts +3 -3
  212. package/dist/src/components/icons/grid.d.ts +3 -3
  213. package/dist/src/components/icons/hashtag.d.ts +3 -3
  214. package/dist/src/components/icons/image.d.ts +3 -3
  215. package/dist/src/components/icons/import.d.ts +3 -3
  216. package/dist/src/components/icons/info-circle.d.ts +3 -3
  217. package/dist/src/components/icons/info.d.ts +3 -3
  218. package/dist/src/components/icons/link-horizontal.d.ts +3 -3
  219. package/dist/src/components/icons/link.d.ts +3 -3
  220. package/dist/src/components/icons/location.d.ts +3 -3
  221. package/dist/src/components/icons/lowest-lead-time.d.ts +3 -3
  222. package/dist/src/components/icons/lowest-min-qty.d.ts +3 -3
  223. package/dist/src/components/icons/lowest-price.d.ts +3 -3
  224. package/dist/src/components/icons/more.d.ts +3 -3
  225. package/dist/src/components/icons/notification.d.ts +3 -3
  226. package/dist/src/components/icons/paper-clip.d.ts +3 -3
  227. package/dist/src/components/icons/paragraph.d.ts +3 -3
  228. package/dist/src/components/icons/payment-request.d.ts +3 -3
  229. package/dist/src/components/icons/phone.d.ts +3 -3
  230. package/dist/src/components/icons/printer.d.ts +3 -3
  231. package/dist/src/components/icons/process-calendar.d.ts +3 -3
  232. package/dist/src/components/icons/promotion.d.ts +3 -3
  233. package/dist/src/components/icons/radio-button.d.ts +3 -3
  234. package/dist/src/components/icons/receipt-filled.d.ts +3 -3
  235. package/dist/src/components/icons/receipt-outline.d.ts +3 -3
  236. package/dist/src/components/icons/receipt.d.ts +3 -3
  237. package/dist/src/components/icons/refresh-icon.d.ts +3 -3
  238. package/dist/src/components/icons/replace.d.ts +3 -3
  239. package/dist/src/components/icons/save.d.ts +3 -3
  240. package/dist/src/components/icons/search-status.d.ts +3 -3
  241. package/dist/src/components/icons/search.d.ts +3 -3
  242. package/dist/src/components/icons/settings-fallback.d.ts +3 -3
  243. package/dist/src/components/icons/sort-arrow-icon.d.ts +3 -3
  244. package/dist/src/components/icons/stacked-layer.d.ts +3 -3
  245. package/dist/src/components/icons/start-filled.d.ts +3 -3
  246. package/dist/src/components/icons/three-dot-icon.d.ts +3 -3
  247. package/dist/src/components/icons/tick-circle-filled.d.ts +3 -3
  248. package/dist/src/components/icons/tick-circle.d.ts +3 -3
  249. package/dist/src/components/icons/tick-octagon.d.ts +3 -3
  250. package/dist/src/components/icons/tick.d.ts +3 -3
  251. package/dist/src/components/icons/toggle-switch.d.ts +3 -3
  252. package/dist/src/components/icons/trash.d.ts +3 -3
  253. package/dist/src/components/icons/wave.d.ts +3 -3
  254. package/dist/src/components/icons/with-out-tick-octagon.d.ts +3 -3
  255. package/dist/src/components/icons/work-centre.d.ts +3 -3
  256. package/dist/src/components/location-select.d.ts +1 -1
  257. package/dist/src/components/material-editable-table/material-editable-table.d.ts +1 -1
  258. package/dist/src/components/material-table/material-table.d.ts +1 -1
  259. package/dist/src/components/phone-input/phone-input.d.ts +1 -1
  260. package/dist/src/components/radio/radio.d.ts +1 -1
  261. package/dist/src/components/select/select.d.ts +1 -1
  262. package/dist/src/components/switches/android-12-switch.d.ts +3 -1
  263. package/dist/src/components/text-field/text-field.d.ts +1 -1
  264. package/dist/src/components/time-picker/time-picker.d.ts +1 -1
  265. package/dist/src/components/upload-media/upload-media.d.ts +1 -1
  266. package/dist/src/utils/common-utility.d.ts +1 -1
  267. package/dist/src/utils/form-builder-deconversion.d.ts +0 -43
  268. package/dist/style.css +69 -69
  269. package/dist/utils/api/index.esm.js +20 -1
  270. package/dist/utils/api/index.esm.js.map +1 -1
  271. package/dist/utils/api/index.js +1 -1
  272. package/dist/utils/api/index.js.map +1 -1
  273. package/dist/utils/common-utility.d.ts +1 -1
  274. package/dist/utils/constant/index.esm.js +1 -1
  275. package/dist/utils/constant/index.esm.js.map +1 -1
  276. package/dist/utils/constant/index.js +1 -1
  277. package/dist/utils/constant/index.js.map +1 -1
  278. package/dist/utils/form-builder-deconversion/index.esm.js +5 -4
  279. package/dist/utils/form-builder-deconversion/index.esm.js.map +1 -1
  280. package/dist/utils/form-builder-deconversion/index.js +1 -1
  281. package/dist/utils/form-builder-deconversion/index.js.map +1 -1
  282. package/dist/utils/form-builder-deconversion.d.ts +0 -43
  283. package/dist/utils/index.esm.js +4 -4
  284. package/dist/utils/index.js +1 -1
  285. package/dist/views/form-builder/custom-form/index.esm.js +1 -1
  286. package/dist/views/form-builder/custom-form/index.js +17 -17
  287. package/dist/views/form-builder/custom-form/index.js.map +1 -1
  288. package/dist/views/form-builder/utils/common/index.esm.js +1 -1
  289. package/dist/views/form-builder/utils/common/index.js +1 -1
  290. package/dist/views/form-builder/utils/common/index.js.map +1 -1
  291. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/utils/api.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport {\n getV1Company,\n getV1LocationsCountries,\n getV1LocationsStates,\n getV1Role,\n getV1User,\n getV1UserDepartment,\n setBaseUrl,\n} from \"../../api-client/api.rbac/api\";\nimport _ from \"lodash\";\nimport {\n getV1AssemblyItems,\n getV1Bin,\n getV1Brand,\n getV1CategoryItems,\n getV1DiscountItems,\n getV1InventoryItems,\n getV1StockReason,\n getV1Uom,\n getV1UomTemplates,\n getV1WarehouseLocation,\n setBaseUrl as setInventoryBaseUrl,\n} from \"../api-client/api.inventory/api\";\nimport {\n getV1Assets,\n getV1AssetsAssetTypes,\n getV1AssetsJournalTypes,\n getV1BudgetBudgetMonths,\n getV1BudgetBudgetTypes,\n getV1ChartOfAccount,\n getV1CommissionPlans,\n getV1CommissionTargets,\n getV1ChartOfAccountAccountType,\n getV1Currency,\n getV1DebitNotesReasons,\n getV1ExpenseReimbursementEmployees,\n getV1ExpenseReimbursementExpenseCategories,\n getV1FiscalYear,\n getV1JournalEntries,\n getV1JournalEntriesReferenceType,\n getV1Parties,\n getV1PartiesIndustry,\n getV1PaymentTerms,\n getV1PurchaseInvoices,\n getV1PurchaseInvoicesIncoterms,\n getV1SalesInvoices,\n getV1TaxCategory,\n getV1TaxCode,\n getV1TaxTemplates,\n setBaseUrl as SetAccountingBaseUrl,\n getV1BankAccountsTypes,\n getV1Banks,\n getV1PaymentTermsDueDateTypes,\n} from \"../api-client/api.accounting/api\";\nimport { getPartyName, getToken, showSnackBar } from \"./common\";\nimport {\n setBaseUrl as setCrmBaseUrl,\n getV1CustomerSegment,\n getV1OpportunityContact,\n getV1ShippingRules,\n} from \"../api-client/api.sales/api\";\nimport {\n getV1PurchaseAgreements,\n getV1PurchaseOrdersReceipts,\n getV1Rfq,\n} from \"../api-client/api.purchase/api\";\nimport {\n getV1BillsOfMaterials,\n getV1BillsOfMaterialsListMaterials,\n getV1Equipments,\n getV1EquipmentsCategories,\n getV1Operations,\n getV1Routing,\n getV1WorkCentre,\n getV1WorkCentreCategories,\n getV1WorkOrder,\n getV1GateRegisterVehicleNumbers,\n getV1GateRegisterVehicleTypes\n} from \"../api-client/api.manufacturing/api\";\nimport { getV1WorkflowReferences } from \"../../api-client/api.workflow-automation/api\";\nimport { getV1CrossHireOrders, getV1RentalAgreements, getV1RentalBillingCycles, getV1RentalTermsConditions } from \"../api-client/api.rental/api\";\nimport { getV1Languages, getV1ReportsReportList, setBaseUrl as setSystemFeatureBaseUrl } from \"../api-client/api.system-feature/api\";\nimport { getV1Grades, setBaseUrl as setHrmsBaseUrl } from \"../../api-client/api.hrms/api\";\nimport { getV1UserModules, setBaseUrl as setRbacBaseUrl } from \"../../api-client/api.rbac/api\";\nimport { setBaseUrl as setDriveBaseUrl } from \"../api-client/api.drive/api\";\nimport { getApiConfig, isApiConfigInitialized, onApiConfigReady } from \"./api-config\";\n\n// Initialize API base URLs using runtime configuration\n// This function should be called after the API configuration has been initialized\nexport function initializeApiBaseUrls(): void {\n if (!isApiConfigInitialized()) {\n console.warn('API configuration not initialized yet. Base URLs will be set when configuration is available.');\n return;\n }\n\n const config = getApiConfig();\n const baseUrl = config.backendBaseUrl;\n\n setBaseUrl(`${baseUrl}/rbac`);\n setInventoryBaseUrl(`${baseUrl}/inventory`);\n SetAccountingBaseUrl(`${baseUrl}/accounting`);\n setCrmBaseUrl(`${baseUrl}/sales`);\n setRbacBaseUrl(`${baseUrl}/rbac`);\n setHrmsBaseUrl(`${baseUrl}/hrms`);\n setSystemFeatureBaseUrl(`${baseUrl}/system-feature`);\n setDriveBaseUrl(`${baseUrl}/document`);\n}\n\n// Use subscriber pattern to automatically initialize when config is ready\n// This eliminates race conditions with module-level initialization\nonApiConfigReady((config) => {\n const baseUrl = config.backendBaseUrl;\n setBaseUrl(`${baseUrl}/rbac`);\n setInventoryBaseUrl(`${baseUrl}/inventory`);\n SetAccountingBaseUrl(`${baseUrl}/accounting`);\n setCrmBaseUrl(`${baseUrl}/sales`);\n setRbacBaseUrl(`${baseUrl}/rbac`);\n setHrmsBaseUrl(`${baseUrl}/hrms`);\n setSystemFeatureBaseUrl(`${baseUrl}/system-feature`);\n setDriveBaseUrl(`${baseUrl}/document`);\n});\n\nconst createColumns = (defaultColumn: any[] = [], select: any[] = []) => {\n const columns = [...new Set([...defaultColumn, ...select])];\n if (columns.length == 0) return \"\";\n return `[${columns.join(\",\")}]`;\n};\nfunction combineFilters(\n defaultFilter: string,\n newFilter: Record<string, any> | null | undefined\n): string {\n let updatedQuery = \"\";\n\n const filters = { ...defaultFilter, ...newFilter };\n if (Object.keys(filters).length === 0) {\n return updatedQuery ? `(${updatedQuery})` : \"\";\n }\n Object.keys(filters).forEach(\n (key) => (updatedQuery = `${updatedQuery}${key}=${filters[key]}`)\n );\n return updatedQuery ? `(${updatedQuery})` : \"\";\n}\n\nexport const getOptions = async (\n apiFunc: (params: any) => Promise<any>,\n filters: Record<string, any>,\n dataKey: string,\n labelKey: string,\n defaultColumn: string[],\n defaultFilter: string = \"\",\n valueKey: string = \"id\"\n) => {\n const customeFilter = {\n ...filters,\n select: createColumns(defaultColumn, filters.select),\n filters: combineFilters(defaultFilter, filters.filters),\n order: filters?.order || `id:-1`,\n\n };\n const response = await apiFunc({\n ...customeFilter,\n ...getToken(),\n });\n\n if (!dataKey && Array.isArray(response?.data)) {\n return (\n {\n data: response?.data?.map((item: Record<string, any>) => ({\n ...item,\n label:\n labelKey instanceof Function ? labelKey(item) : _.get(item, labelKey),\n value: _.get(item, valueKey),\n })) || [],\n pagination: response?.pagination\n })\n } else {\n return (\n {\n data: response?.data?.[dataKey]?.map((item: Record<string, any>) => ({\n ...item,\n label:\n labelKey instanceof Function ? labelKey(item) : _.get(item, labelKey),\n value: _.get(item, valueKey),\n })) || [],\n pagination: response?.pagination\n }\n );\n }\n};\n\nexport const apiConfigurations = {\n company: {\n name: \"companies/fetch\",\n apiFunc: getV1Company,\n dataKey: \"company\",\n labelKey: \"company_name\",\n defaultColumn: [\"id\", \"company_name\"],\n defaultFilter: { \"is_active.eq\": 1 },\n },\n items: {\n name: \"items/fetch\",\n apiFunc: getV1InventoryItems,\n dataKey: \"inventoryItemsList\",\n labelKey: \"name\",\n defaultColumn: [\n \"id\",\n \"name\",\n \"unit_of_measurement\",\n \"default_tax_id\",\n \"sales_price\",\n \"sales_description\",\n \"total_available_quantity\",\n \"total_reserved_quantity\",\n \"purchase_price\",\n \"purchase_description\",\n \"cost\",\n \"total_on_hand_quantity\",\n 'purchase_unit',\n 'sales_unit',\n 'consumption_unit',\n 'stock_unit',\n ],\n defaultFilter: { \"status.eq\": 1, '&(is_variant.eq': 1, '|type.eq': 'package)' },\n },\n notPackageItems: {\n name: \"items/fetch\",\n apiFunc: getV1InventoryItems,\n dataKey: \"inventoryItemsList\",\n labelKey: \"name\",\n defaultColumn: [\n \"id\",\n \"name\",\n \"unit_of_measurement\",\n \"default_tax_id\",\n \"sales_price\",\n \"sales_description\",\n \"total_available_quantity\",\n \"total_reserved_quantity\",\n \"purchase_price\",\n \"purchase_description\",\n \"cost\",\n \"total_on_hand_quantity\"\n ],\n defaultFilter: { \"status.eq\": 1, '&(is_variant.eq': 1, '&type.ne': 'package)' },\n },\n rentalItems: {\n name: \"items/fetch\",\n apiFunc: getV1InventoryItems,\n dataKey: \"inventoryItemsList\",\n labelKey: \"name\",\n defaultColumn: [\n \"id\",\n \"name\",\n \"unit_of_measurement\",\n \"default_tax_id\",\n \"sales_price\",\n \"sales_description\",\n \"total_available_quantity\",\n \"total_reserved_quantity\",\n \"purchase_price\",\n \"purchase_description\",\n \"cost\",\n 'rental_description',\n \"total_on_hand_quantity\",\n 'purchase_unit',\n 'sales_unit',\n 'consumption_unit',\n 'stock_unit',\n ],\n defaultFilter: { \"status.eq\": 1, '&(is_variant.eq': 1, '|type.eq': 'package)', '&is_rental.eq': 1 },\n },\n salesItems: {\n name: \"items/fetch\",\n apiFunc: getV1InventoryItems,\n dataKey: \"inventoryItemsList\",\n labelKey: \"name\",\n defaultColumn: [\n \"id\",\n \"name\",\n \"unit_of_measurement\",\n \"default_tax_id\",\n \"sales_price\",\n \"sales_description\",\n \"total_available_quantity\",\n \"total_reserved_quantity\",\n \"purchase_price\",\n \"purchase_description\",\n \"cost\",\n \"total_on_hand_quantity\",\n 'purchase_unit',\n 'sales_unit',\n 'consumption_unit',\n 'stock_unit',\n ],\n defaultFilter: { \"status.eq\": 1, '&(is_variant.eq': 1, '|type.eq': 'package)', '&is_rental.eq': 0 },\n },\n reportItems: {\n name: \"items/fetch\",\n apiFunc: getV1InventoryItems,\n dataKey: \"inventoryItemsList\",\n labelKey: \"name\",\n defaultColumn: [\n \"id\",\n \"name\",\n ],\n defaultFilter: { '&is_variant.eq': 1 },\n },\n inventoryItems: {\n name: \"inventory-items/fetch\",\n apiFunc: getV1InventoryItems,\n dataKey: \"inventoryItemsList\",\n labelKey: \"name\",\n defaultColumn: [\n \"id\",\n \"name\",\n \"type\",\n \"unit_of_measurement\",\n \"default_tax_id\",\n \"sales_price\",\n \"sales_description\",\n \"total_available_quantity\",\n \"total_reserved_quantity\",\n \"purchase_price\",\n \"purchase_description\",\n \"cost\",\n \"is_landed_cost\",\n \"total_on_hand_quantity\",\n 'purchase_unit',\n 'sales_unit',\n 'consumption_unit',\n 'stock_unit',\n ],\n defaultFilter: { \"status.eq\": 1 },\n },\n currency: {\n name: \"currency/fetch\",\n apiFunc: getV1Currency,\n dataKey: \"currencies\",\n labelKey: \"currency_name\",\n defaultColumn: [\"id\", \"currency_name\", \"symbol\", 'number_format'],\n // defaultFilter: null,\n defaultFilter: { \"status.eq\": 1 },\n },\n salesperson: {\n name: \"salesperson/fetch\",\n apiFunc: getV1User,\n dataKey: \"users\",\n // labelKey: \"first_name\",\n defaultColumn: [\"id\", \"first_name\", \"last_name\"],\n defaultFilter: { \"is_active.eq\": 1 },\n labelKey: getPartyName,\n },\n party: {\n name: \"party/fetch\",\n apiFunc: getV1Parties,\n dataKey: \"parties_list\",\n // labelKey: getPartyName,\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\", \"company_name\", \"first_name\", \"last_name\", \"type\"],\n // defaultColumn:[]\n defaultFilter: { \"status.eq\": 1 }\n },\n department: {\n name: \"department/fetch\",\n apiFunc: getV1UserDepartment,\n dataKey: \"department\",\n labelKey: \"label\",\n defaultColumn: [\"id\", \"name\", \"label\"],\n defaultFilter: null,\n },\n location: {\n name: \"location/fetch\",\n apiFunc: getV1WarehouseLocation,\n dataKey: \"warehouseLocationList\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n defaultFilter: { \"status.eq\": 1, \"&inventory_available.eq\": 1 },\n },\n warehouselocation: {\n name: \"location/fetch\",\n apiFunc: getV1WarehouseLocation,\n dataKey: \"warehouseLocationList\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n defaultFilter: { \"status.eq\": 1 },\n },\n uom: {\n name: \"uom/fetch\",\n apiFunc: getV1Uom,\n dataKey: \"units\",\n labelKey: \"uom_name\",\n defaultColumn: [\"id\", \"uom_name\", 'is_base_unit', 'conversation_factor'],\n defaultFilter: { \"template_id.ne\": null },\n },\n discountedItems: {\n name: \"discountItems/fetch\",\n apiFunc: getV1DiscountItems,\n dataKey: \"discountItemsList\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\", \"discount_rate_amount\", \"discount_category\"],\n defaultFilter: { \"status.eq\": 1 },\n },\n taxTemplate: {\n name: \"taxTemplate/fetch\",\n apiFunc: getV1TaxTemplates,\n dataKey: \"templates\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\", \"tax_codes\"],\n defaultFilter: null,\n },\n paymentTerm: {\n name: \"paymentTerm/fetch\",\n apiFunc: getV1PaymentTerms,\n dataKey: \"payment_terms_list\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n defaultFilter: null,\n },\n incoTerms: {\n name: \"incoTerms/fetch\",\n apiFunc: getV1PurchaseInvoicesIncoterms,\n dataKey: \"incoterm\",\n labelKey: \"term\",\n defaultColumn: [\"id\", \"term\"],\n defaultFilter: null,\n },\n shippingRules: {\n name: \"shippingRules/fetch\",\n apiFunc: getV1ShippingRules,\n dataKey: \"shippingRules\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\", \"shipping_cost\", \"handling_cost\"],\n defaultFilter: { 'status.ne': 'Draft' },\n },\n bins: {\n name: \"bins/fetch\",\n apiFunc: getV1Bin,\n dataKey: \"binsList\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n defaultFilter: null,\n },\n agreement: {\n name: \"agreement/fetch\",\n apiFunc: getV1PurchaseAgreements,\n dataKey: \"purchase_agreements\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n defaultFilter: null,\n },\n invoices: {\n name: \"purchaseInvoices/fetch\",\n apiFunc: getV1PurchaseInvoices,\n dataKey: \"invoices\",\n labelKey: \"series_number\",\n defaultColumn: [\"id\", \"series_number\"],\n defaultFilter: null,\n },\n purchaseOrderReceipts: {\n name: \"purchaseGRNs/fetch\",\n apiFunc: getV1PurchaseOrdersReceipts,\n dataKey: \"grns\",\n labelKey: \"series_number\",\n defaultColumn: [\"id\", \"series_number\"],\n defaultFilter: null,\n },\n representatives: {\n name: \"representatives/fetch\",\n apiFunc: getV1ExpenseReimbursementEmployees,\n dataKey: \"employees_list\",\n // labelKey: \"first_name\",\n defaultFilter: { \"is_active.eq\": 1 },\n defaultColumn: [\"id\", \"first_name\", \"last_name\"],\n labelKey: getPartyName,\n },\n categoryItems: {\n name: \"categoryItems/fetch\",\n apiFunc: getV1CategoryItems,\n dataKey: \"categoryItemsList\",\n labelKey: \"category_name\",\n defaultColumn: [\"id\", \"category_name\"],\n defaultFilter: { 'status.eq': 1 },\n },\n customerSegment: {\n name: \"customerSegment/fetch\",\n apiFunc: getV1CustomerSegment,\n dataKey: \"customerSegments\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\", \"status\"],\n defaultFilter: { 'status.ne': 'Draft' },\n },\n accounts: {\n name: \"account/fetch\",\n apiFunc: getV1ChartOfAccount,\n dataKey: \"coa_list\",\n labelKey: \"account_name\",\n defaultColumn: [\"id\", \"account_name\", 'currency_id', 'currency_data', 'account_type_id'],\n defaultFilter: { \"is_active.eq\": 1 },\n },\n industry: {\n name: \"inductry/fetch\",\n apiFunc: getV1PartiesIndustry,\n dataKey: \"activity_list\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n defaultFilter: null,\n },\n bom: {\n name: \"bom/fetch\",\n apiFunc: getV1BillsOfMaterials,\n dataKey: \"bom_list\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n defaultFilter: { \"is_active.eq\": 1, \"&status.eq\": 'Approved' },\n },\n routing: {\n name: \"routing/fetch\",\n apiFunc: getV1Routing,\n dataKey: \"routings\",\n labelKey: \"route_name\",\n defaultColumn: [\"id\", \"route_name\"],\n defaultFilter: { \"is_active.eq\": 1 },\n },\n workCenter: {\n name: \"workCenter/fetch\",\n apiFunc: getV1WorkCentre,\n dataKey: \"workCentres\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n },\n workOrder: {\n name: \"workOrder/fetch\",\n apiFunc: getV1WorkOrder,\n dataKey: \"workOrders\",\n labelKey: \"series_number\",\n defaultColumn: [\"id\", \"series_number\"],\n defaultFilter: { \"is_active.eq\": 1, \"&status.ne\": \"Draft\" },\n },\n vehicleNumbers: {\n name: \"vehicleNumbers/fetch\",\n apiFunc: getV1GateRegisterVehicleNumbers,\n dataKey: \"vehicleNumbers\",\n labelKey: \"number\",\n defaultColumn: [\"id\", \"number\"],\n defaultFilter: null,\n },\n vehicleTypes: {\n name: \"vehicleTypes/fetch\",\n apiFunc: getV1GateRegisterVehicleTypes,\n dataKey: \"vehicleTypes\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n defaultFilter: null,\n },\n operations: {\n name: \"operations/fetch\",\n apiFunc: getV1Operations,\n dataKey: \"operations\",\n labelKey: \"operation_name\",\n defaultColumn: [\"id\", \"operation_name\"],\n defaultFilter: null,\n },\n assets: {\n name: \"assets/fetch\",\n apiFunc: getV1Assets,\n dataKey: \"assets_list\",\n labelKey: \"asset_name\",\n defaultColumn: [\"id\", \"asset_name\"],\n defaultFilter: { 'status.ne': 'cancelled' },\n },\n equipmentCategories: {\n name: \"equipmentCategories/fetch\",\n apiFunc: getV1EquipmentsCategories,\n dataKey: \"categories\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n defaultFilter: null,\n },\n equipment: {\n name: \"equipment/fetch\",\n apiFunc: getV1Equipments,\n dataKey: \"equipments\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\", \"equipment_category_data\"],\n defaultFilter: { 'status.ne': 'Draft' },\n },\n workCenterCategories: {\n name: \"workCenterCategories/fetch\",\n apiFunc: getV1WorkCentreCategories,\n dataKey: \"work_centre_categories_list\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n defaultFilter: null,\n },\n rawMaterials: {\n name: \"rawMaterials/fetch\",\n apiFunc: getV1BillsOfMaterialsListMaterials,\n dataKey: \"materials_list\",\n labelKey: \"item_data.name\",\n defaultColumn: [\"id\", \"item_data\"],\n defaultFilter: null,\n },\n countries: {\n name: \"countries/fetch\",\n apiFunc: getV1LocationsCountries,\n dataKey: \"countries\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n defaultFilter: { \"is_active.eq\": 1 },\n },\n rfqs: {\n name: \"rfqs/fetch\",\n apiFunc: getV1Rfq,\n dataKey: \"rfqs\",\n labelKey: \"series_number\",\n defaultColumn: [\"id\", \"series_number\"],\n defaultFilter: { 'status.ne': 'Draft' },\n },\n states: {\n name: \"states/fetch\",\n apiFunc: getV1LocationsStates,\n dataKey: \"states\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n defaultFilter: null,\n },\n assemblyItems: {\n name: \"assenmblyItems/fetch\",\n apiFunc: getV1AssemblyItems,\n dataKey: \"assemblyItemsList\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n defaultFilter: { \"status.eq\": 1, '&is_variant.eq': 1 },\n },\n journal_type: {\n name: \"journal/fetch\",\n apiFunc: getV1AssetsJournalTypes,\n dataKey: \"journal_types\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"series_number\", \"name\"],\n },\n journal_entries: {\n name: \"journal-entries/fetch\",\n apiFunc: getV1JournalEntries,\n dataKey: \"journal_entries\",\n labelKey: \"series_number\",\n defaultColumn: [\"id\", \"series_number\"],\n },\n reference_types: {\n name: \"referenceTypes/fetch\",\n apiFunc: getV1JournalEntriesReferenceType,\n dataKey: \"reference_types\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n },\n invoice: {\n name: \"invoice/fetch\",\n apiFunc: getV1SalesInvoices,\n dataKey: \"invoices\",\n labelKey: \"series_number\",\n defaultColumn: [\"id\", \"series_number\"],\n },\n bills: {\n name: \"bills/fetch\",\n apiFunc: getV1PurchaseInvoices,\n dataKey: \"invoices\",\n labelKey: \"series_number\",\n defaultColumn: [\"id\", \"series_number\"],\n },\n notesReasons: {\n name: \"notesReasons/fetch\",\n apiFunc: getV1DebitNotesReasons,\n dataKey: \"reasons\",\n labelKey: \"reason_name\",\n defaultColumn: [\"id\", \"reason_name\"],\n },\n expenseCategories: {\n name: \"expenseCategories/fetch\",\n apiFunc: getV1ExpenseReimbursementExpenseCategories,\n dataKey: \"expense_category_list\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n },\n commissionTarget: {\n name: \"commissionTargets/fetch\",\n apiFunc: getV1CommissionTargets,\n dataKey: \"commission_targets\",\n labelKey: \"series_number\",\n defaultColumn: [\"id\", \"series_number\"],\n defaultFilter: { \"is_draft.eq\": 0 },\n },\n commissionPlan: {\n name: \"commissionPlans/fetch\",\n apiFunc: getV1CommissionPlans,\n dataKey: \"commission_plans\",\n labelKey: \"title\",\n defaultColumn: [\"id\", \"title\", 'type'],\n defaultFilter: { \"status.eq\": 1 },\n },\n assetTypes: {\n name: \"assetTypes/fetch\",\n apiFunc: getV1AssetsAssetTypes,\n dataKey: \"asset_types\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n defaultFilter: null,\n },\n fiscalYear: {\n name: \"fiscalYear/fetch\",\n apiFunc: getV1FiscalYear,\n dataKey: \"fiscal\",\n labelKey: \"year_name\",\n defaultColumn: [\"id\", \"year_name\", 'year_start_date', 'year_end_date'],\n defaultFilter: null,\n },\n budgetMonth: {\n name: \"budgetMonth/fetch\",\n apiFunc: getV1BudgetBudgetMonths,\n dataKey: \"budget_months\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n defaultFilter: null,\n },\n budgetType: {\n name: \"budgetType/fetch\",\n apiFunc: getV1BudgetBudgetTypes,\n dataKey: \"budget_types\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n defaultFilter: null,\n },\n account_types: {\n name: \"accountTypes/fetch\",\n apiFunc: getV1ChartOfAccountAccountType,\n dataKey: \"activity_list\",\n labelKey: \"type_name\",\n defaultColumn: [\"id\", \"type_name\"],\n },\n taxCategories: {\n name: \"taxCategories/fetch\",\n apiFunc: getV1TaxCategory,\n dataKey: 'tax_category_list',\n labelKey: \"name\",\n defaultColumn: ['id', 'name']\n },\n taxCodes: {\n name: 'taxCodes/fetch',\n apiFunc: getV1TaxCode,\n dataKey: 'tax_code',\n labelKey: \"name\",\n defaultColumn: ['id', 'name']\n },\n bankAccountType: {\n name: 'bankAccountType/fetch',\n apiFunc: getV1BankAccountsTypes,\n dataKey: 'account_types',\n labelKey: \"name\",\n defaultColumn: ['id', 'name']\n },\n bank: {\n name: 'bank/fetch',\n apiFunc: getV1Banks,\n dataKey: 'banks_list',\n labelKey: \"name\",\n defaultColumn: ['id', 'name']\n },\n dueDateType: {\n name: 'dueDateType/fetch',\n apiFunc: getV1PaymentTermsDueDateTypes,\n dataKey: 'due_date_list',\n labelKey: \"value\",\n defaultColumn: ['id', 'value']\n },\n brand: {\n name: 'brand/fetch',\n apiFunc: getV1Brand,\n dataKey: '',\n labelKey: \"name\",\n defaultColumn: ['id', 'name']\n },\n stockReason: {\n name: 'stockReason/fetch',\n apiFunc: getV1StockReason,\n dataKey: '',\n labelKey: \"name\",\n defaultColumn: ['id', 'name']\n },\n contacts: {\n name: 'contacts/fetch',\n apiFunc: getV1OpportunityContact,\n dataKey: '',\n labelKey: \"name\",\n defaultColumn: ['id', 'name']\n },\n rnTermsConditions: {\n name: 'rnTermsConditions/fetch',\n apiFunc: getV1RentalTermsConditions,\n dataKey: 'terms_and_conditions',\n labelKey: \"name\",\n defaultColumn: ['id', 'name'],\n defaultFilter: { 'is_active.eq': 1 },\n },\n rnAgreements: {\n name: 'rnAgreements/fetch',\n apiFunc: getV1RentalAgreements,\n dataKey: 'purchase_agreements',\n labelKey: \"name\",\n defaultColumn: ['id', 'name'],\n defaultFilter: { 'status.eq': \"'In Progress'\", '&is_rental.eq': 1 },\n },\n rnBillingCycle: {\n name: 'rnTermsConditions/fetch',\n apiFunc: getV1RentalBillingCycles,\n dataKey: 'billing_cycles',\n labelKey: \"name\",\n defaultColumn: ['id', 'name'],\n defaultFilter: null,\n },\n // priceList:{\n // name:'priceList/fetch',\n // apiFunc: getV1PriceLis,\n // dataKey:'',\n // labelKey: \"name\",\n // defaultColumn:['id','name']\n // },\n rnChOrders: {\n name: 'rnChOrders/fetch',\n apiFunc: getV1CrossHireOrders,\n dataKey: 'purchase_orders',\n labelKey: \"series_number\",\n defaultColumn: ['id', 'series_number'],\n defaultFilter: { '&is_rental.eq': 1 },\n },\n labguages: {\n name: 'languages/fetch',\n apiFunc: getV1Languages,\n dataKey: 'languages',\n labelKey: \"name\",\n defaultColumn: ['id', 'name', 'code'],\n },\n roles: {\n name: 'roles/fetch',\n apiFunc: getV1Role,\n dataKey: 'roles',\n labelKey: \"name\",\n defaultColumn: ['id', 'name', 'code'],\n },\n reports: {\n name: 'reports/fetch',\n apiFunc: getV1ReportsReportList,\n dataKey: 'reports',\n labelKey: \"name\",\n defaultColumn: ['id', 'name'],\n },\n uom_templates: {\n name: 'uomTemplate/fetch',\n apiFunc: getV1UomTemplates,\n dataKey: 'templates',\n labelKey: \"name\",\n defaultColumn: ['id', 'name'],\n defaultFilter: { \"is_active.eq\": 1 },\n },\n workflow_reference: {\n name: 'workflow_reference/fetch',\n apiFunc: getV1WorkflowReferences,\n dataKey: 'workflow_reference',\n labelKey: \"name\",\n defaultColumn: ['id', 'name'],\n },\n grades: {\n name: 'grades/fetch',\n apiFunc: getV1Grades,\n dataKey: 'grades',\n labelKey: \"grade_name\",\n defaultColumn: ['id', 'grade_name'],\n },\n useModules: {\n name: 'useModules/fetch',\n apiFunc: getV1UserModules,\n dataKey: 'modules',\n labelKey: \"name\",\n defaultColumn: ['id', 'name'],\n },\n};\n\nexport const fetchApi = async ({\n apiKey,\n filters,\n labelKey,\n valueKey\n}: {\n apiKey: keyof typeof apiConfigurations;\n filters: any;\n labelKey?: string;\n valueKey?: string;\n}) => {\n try {\n const config = apiConfigurations[apiKey];\n if (!config) {\n throw `API configuration for key \"${apiKey}\" not found.`;\n }\n const res = await getOptions(\n config.apiFunc,\n filters,\n config.dataKey,\n labelKey || config.labelKey,\n config.defaultColumn,\n config.defaultFilter,\n valueKey\n );\n return res;\n } catch (error: any) {\n const newError = new Error(error);\n showSnackBar(newError);\n throw newError;\n }\n};\nexport const getCurrency = () => { };\n\nexport const getItems = () => { };\n"],"names":["onApiConfigReady","config","baseUrl","backendBaseUrl","setBaseUrl","setInventoryBaseUrl","SetAccountingBaseUrl","setCrmBaseUrl","setRbacBaseUrl","setHrmsBaseUrl","setSystemFeatureBaseUrl","setDriveBaseUrl","createColumns","defaultColumn","select","columns","Set","length","join","combineFilters","defaultFilter","newFilter","updatedQuery","filters","Object","keys","forEach","key","getOptions","async","apiFunc","dataKey","labelKey","valueKey","customeFilter","order","response","getToken","Array","isArray","data","_a","map","item","label","Function","_","get","value","pagination","_c","_b","apiConfigurations","company","name","getV1Company","items","getV1InventoryItems","notPackageItems","rentalItems","salesItems","reportItems","inventoryItems","currency","getV1Currency","salesperson","getV1User","getPartyName","party","getV1Parties","department","getV1UserDepartment","location","getV1WarehouseLocation","warehouselocation","uom","getV1Uom","discountedItems","getV1DiscountItems","taxTemplate","getV1TaxTemplates","paymentTerm","getV1PaymentTerms","incoTerms","getV1PurchaseInvoicesIncoterms","shippingRules","getV1ShippingRules","bins","getV1Bin","agreement","getV1PurchaseAgreements","invoices","getV1PurchaseInvoices","purchaseOrderReceipts","getV1PurchaseOrdersReceipts","representatives","getV1ExpenseReimbursementEmployees","categoryItems","getV1CategoryItems","customerSegment","getV1CustomerSegment","accounts","getV1ChartOfAccount","industry","getV1PartiesIndustry","bom","getV1BillsOfMaterials","routing","getV1Routing","workCenter","getV1WorkCentre","workOrder","getV1WorkOrder","vehicleNumbers","getV1GateRegisterVehicleNumbers","vehicleTypes","getV1GateRegisterVehicleTypes","operations","getV1Operations","assets","getV1Assets","equipmentCategories","getV1EquipmentsCategories","equipment","getV1Equipments","workCenterCategories","getV1WorkCentreCategories","rawMaterials","getV1BillsOfMaterialsListMaterials","countries","getV1LocationsCountries","rfqs","getV1Rfq","states","getV1LocationsStates","assemblyItems","getV1AssemblyItems","journal_type","getV1AssetsJournalTypes","journal_entries","getV1JournalEntries","reference_types","getV1JournalEntriesReferenceType","invoice","getV1SalesInvoices","bills","notesReasons","getV1DebitNotesReasons","expenseCategories","getV1ExpenseReimbursementExpenseCategories","commissionTarget","getV1CommissionTargets","commissionPlan","getV1CommissionPlans","assetTypes","getV1AssetsAssetTypes","fiscalYear","getV1FiscalYear","budgetMonth","getV1BudgetBudgetMonths","budgetType","getV1BudgetBudgetTypes","account_types","getV1ChartOfAccountAccountType","taxCategories","getV1TaxCategory","taxCodes","getV1TaxCode","bankAccountType","getV1BankAccountsTypes","bank","getV1Banks","dueDateType","getV1PaymentTermsDueDateTypes","brand","getV1Brand","stockReason","getV1StockReason","contacts","getV1OpportunityContact","rnTermsConditions","getV1RentalTermsConditions","rnAgreements","getV1RentalAgreements","rnBillingCycle","getV1RentalBillingCycles","rnChOrders","getV1CrossHireOrders","labguages","getV1Languages","roles","getV1Role","reports","getV1ReportsReportList","uom_templates","getV1UomTemplates","workflow_reference","getV1WorkflowReferences","grades","getV1Grades","useModules","getV1UserModules","apiKey","error","newError","Error","showSnackBar","isApiConfigInitialized","getApiConfig"],"mappings":"o3BA+GAA,EAAAA,iBAAkBC,IAChB,MAAMC,EAAUD,EAAOE,eACvBC,EAAAA,WAAW,GAAGF,UACdG,EAAAA,WAAoB,GAAGH,eACvBI,EAAAA,WAAqB,GAAGJ,g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E,eAAgB,IAEnCgL,mBAAoB,CAClB9I,KAAM,2BACNxB,QAASuK,EAAAA,wBACTtK,QAAS,qBACTC,SAAU,OACVnB,cAAe,CAAC,KAAM,SAExByL,OAAQ,CACNhJ,KAAM,eACNxB,QAASyK,EAAAA,YACTxK,QAAS,SACTC,SAAU,aACVnB,cAAe,CAAC,KAAM,eAExB2L,WAAY,CACVlJ,KAAM,mBACNxB,QAAS2K,EAAAA,iBACT1K,QAAS,UACTC,SAAU,OACVnB,cAAe,CAAC,KAAM,uDAIFgB,OACtB6K,SACAnL,UACAS,WACAC,eAOA,IACE,MAAMhC,EAASmD,EAAkBsJ,GACjC,IAAKzM,EACH,KAAM,8BAA8ByM,gBAWtC,aATkB9K,EAChB3B,EAAO6B,QACPP,EACAtB,EAAO8B,QACPC,GAAY/B,EAAO+B,SACnB/B,EAAOY,cACPZ,EAAOmB,cACPa,EAGJ,OAAS0K,GACP,MAAMC,EAAW,IAAIC,MAAMF,GAE3B,MADAG,EAAAA,aAAaF,GACPA,CACR,uBAEyB,wBAEH,0DA9zBjB,WACL,IAAKG,EAAAA,yBAEH,OAGF,MACM7M,EADS8M,EAAAA,eACQ7M,eAEvBC,EAAAA,WAAW,GAAGF,UACdG,EAAAA,WAAoB,GAAGH,eACvBI,EAAAA,WAAqB,GAAGJ,gBACxBK,EAAAA,WAAc,GAAGL,WACjBM,EAAAA,WAAe,GAAGN,UAClBO,EAAAA,WAAe,GAAGP,UAClBQ,EAAAA,WAAwB,GAAGR,oBAC3BS,EAAAA,WAAgB,GAAGT,aACrB"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/utils/api.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport {\n getV1Company,\n getV1LocationsCountries,\n getV1LocationsStates,\n getV1Role,\n getV1User,\n getV1UserDepartment,\n setBaseUrl,\n} from \"../../api-client/api.rbac/api\";\nimport _ from \"lodash\";\nimport {\n getV1AssemblyItems,\n getV1Bin,\n getV1Brand,\n getV1CategoryItems,\n getV1DiscountItems,\n getV1InventoryItems,\n getV1StockReason,\n getV1Uom,\n getV1UomTemplates,\n getV1WarehouseLocation,\n setBaseUrl as setInventoryBaseUrl,\n} from \"../api-client/api.inventory/api\";\nimport {\n getV1Assets,\n getV1AssetsAssetTypes,\n getV1AssetsJournalTypes,\n getV1BudgetBudgetMonths,\n getV1BudgetBudgetTypes,\n getV1ChartOfAccount,\n getV1CommissionPlans,\n getV1CommissionTargets,\n getV1ChartOfAccountAccountType,\n getV1Currency,\n getV1DebitNotesReasons,\n getV1ExpenseReimbursementEmployees,\n getV1ExpenseReimbursementExpenseCategories,\n getV1FiscalYear,\n getV1JournalEntries,\n getV1JournalEntriesReferenceType,\n getV1Parties,\n getV1PartiesIndustry,\n getV1PaymentTerms,\n getV1PurchaseInvoices,\n getV1PurchaseInvoicesIncoterms,\n getV1SalesInvoices,\n getV1TaxCategory,\n getV1TaxCode,\n getV1TaxTemplates,\n setBaseUrl as SetAccountingBaseUrl,\n getV1BankAccountsTypes,\n getV1Banks,\n getV1PaymentTermsDueDateTypes,\n} from \"../api-client/api.accounting/api\";\nimport { getPartyName, getToken, showSnackBar } from \"./common\";\nimport {\n setBaseUrl as setCrmBaseUrl,\n getV1CustomerSegment,\n getV1OpportunityContact,\n getV1ShippingRules,\n} from \"../api-client/api.sales/api\";\nimport {\n getV1PurchaseAgreements,\n getV1PurchaseOrdersReceipts,\n getV1Rfq,\n} from \"../api-client/api.purchase/api\";\nimport {\n getV1BillsOfMaterials,\n getV1BillsOfMaterialsListMaterials,\n getV1Equipments,\n getV1EquipmentsCategories,\n getV1Operations,\n getV1Routing,\n getV1WorkCentre,\n getV1WorkCentreCategories,\n getV1WorkOrder,\n getV1GateRegisterVehicleNumbers,\n getV1GateRegisterVehicleTypes\n} from \"../api-client/api.manufacturing/api\";\nimport { getV1WorkflowReferences } from \"../../api-client/api.workflow-automation/api\";\nimport { getV1CrossHireOrders, getV1RentalAgreements, getV1RentalBillingCycles, getV1RentalTermsConditions } from \"../api-client/api.rental/api\";\nimport { getV1Languages, getV1ReportsReportList, setBaseUrl as setSystemFeatureBaseUrl } from \"../api-client/api.system-feature/api\";\nimport { getV1Grades, setBaseUrl as setHrmsBaseUrl } from \"../../api-client/api.hrms/api\";\nimport { getV1UserModules, setBaseUrl as setRbacBaseUrl } from \"../../api-client/api.rbac/api\";\nimport { setBaseUrl as setDriveBaseUrl } from \"../api-client/api.drive/api\";\nimport { getApiConfig, isApiConfigInitialized, onApiConfigReady } from \"./api-config\";\n\n// Initialize API base URLs using runtime configuration\n// This function should be called after the API configuration has been initialized\nexport function initializeApiBaseUrls(): void {\n if (!isApiConfigInitialized()) {\n console.warn('API configuration not initialized yet. Base URLs will be set when configuration is available.');\n return;\n }\n\n const config = getApiConfig();\n const baseUrl = config.backendBaseUrl;\n\n setBaseUrl(`${baseUrl}/rbac`);\n setInventoryBaseUrl(`${baseUrl}/inventory`);\n SetAccountingBaseUrl(`${baseUrl}/accounting`);\n setCrmBaseUrl(`${baseUrl}/sales`);\n setRbacBaseUrl(`${baseUrl}/rbac`);\n setHrmsBaseUrl(`${baseUrl}/hrms`);\n setSystemFeatureBaseUrl(`${baseUrl}/system-feature`);\n setDriveBaseUrl(`${baseUrl}/document`);\n}\n\n// Use subscriber pattern to automatically initialize when config is ready\n// This eliminates race conditions with module-level initialization\nonApiConfigReady((config) => {\n const baseUrl = config.backendBaseUrl;\n setBaseUrl(`${baseUrl}/rbac`);\n setInventoryBaseUrl(`${baseUrl}/inventory`);\n SetAccountingBaseUrl(`${baseUrl}/accounting`);\n setCrmBaseUrl(`${baseUrl}/sales`);\n setRbacBaseUrl(`${baseUrl}/rbac`);\n setHrmsBaseUrl(`${baseUrl}/hrms`);\n setSystemFeatureBaseUrl(`${baseUrl}/system-feature`);\n setDriveBaseUrl(`${baseUrl}/document`);\n});\n\nconst createColumns = (defaultColumn: any[] = [], select: any[] = []) => {\n const columns = [...new Set([...defaultColumn, ...select])];\n if (columns.length == 0) return \"\";\n return `[${columns.join(\",\")}]`;\n};\nfunction combineFilters(\n defaultFilter: string,\n newFilter: Record<string, any> | null | undefined\n): string {\n let updatedQuery = \"\";\n\n const filters = { ...defaultFilter, ...newFilter };\n if (Object.keys(filters).length === 0) {\n return updatedQuery ? `(${updatedQuery})` : \"\";\n }\n Object.keys(filters).forEach(\n (key) => (updatedQuery = `${updatedQuery}${key}=${filters[key]}`)\n );\n return updatedQuery ? `(${updatedQuery})` : \"\";\n}\n\nexport const getOptions = async (\n apiFunc: (params: any) => Promise<any>,\n filters: Record<string, any>,\n dataKey: string,\n labelKey: string,\n defaultColumn: string[],\n defaultFilter: string = \"\",\n valueKey: string = \"id\"\n) => {\n const customeFilter = {\n ...filters,\n select: createColumns(defaultColumn, filters.select),\n filters: combineFilters(defaultFilter, filters.filters),\n order: filters?.order || `id:-1`,\n\n };\n const response = await apiFunc({\n ...customeFilter,\n ...getToken(),\n });\n\n if (!dataKey && Array.isArray(response?.data)) {\n return (\n {\n data: response?.data?.map((item: Record<string, any>) => ({\n ...item,\n label:\n labelKey instanceof Function ? labelKey(item) : _.get(item, labelKey),\n value: _.get(item, valueKey),\n })) || [],\n pagination: response?.pagination\n })\n } else {\n return (\n {\n data: response?.data?.[dataKey]?.map((item: Record<string, any>) => ({\n ...item,\n label:\n labelKey instanceof Function ? labelKey(item) : _.get(item, labelKey),\n value: _.get(item, valueKey),\n })) || [],\n pagination: response?.pagination\n }\n );\n }\n};\n\nexport const apiConfigurations = {\n company: {\n name: \"companies/fetch\",\n apiFunc: getV1Company,\n dataKey: \"company\",\n labelKey: \"company_name\",\n defaultColumn: [\"id\", \"company_name\"],\n defaultFilter: { \"is_active.eq\": 1 },\n },\n items: {\n name: \"items/fetch\",\n apiFunc: getV1InventoryItems,\n dataKey: \"inventoryItemsList\",\n labelKey: \"name\",\n defaultColumn: [\n \"id\",\n \"name\",\n \"unit_of_measurement\",\n \"default_tax_id\",\n \"sales_price\",\n \"sales_description\",\n \"total_available_quantity\",\n \"total_reserved_quantity\",\n \"purchase_price\",\n \"purchase_description\",\n \"cost\",\n \"total_on_hand_quantity\",\n 'purchase_unit',\n 'sales_unit',\n 'consumption_unit',\n 'stock_unit',\n ],\n defaultFilter: { \"status.eq\": 1, '&(is_variant.eq': 1, '|type.eq': 'package)' },\n },\n notPackageItems: {\n name: \"items/fetch\",\n apiFunc: getV1InventoryItems,\n dataKey: \"inventoryItemsList\",\n labelKey: \"name\",\n defaultColumn: [\n \"id\",\n \"name\",\n \"unit_of_measurement\",\n \"default_tax_id\",\n \"sales_price\",\n \"sales_description\",\n \"total_available_quantity\",\n \"total_reserved_quantity\",\n \"purchase_price\",\n \"purchase_description\",\n \"cost\",\n \"total_on_hand_quantity\"\n ],\n defaultFilter: { \"status.eq\": 1, '&(is_variant.eq': 1, '&type.ne': 'package)' },\n },\n rentalItems: {\n name: \"items/fetch\",\n apiFunc: getV1InventoryItems,\n dataKey: \"inventoryItemsList\",\n labelKey: \"name\",\n defaultColumn: [\n \"id\",\n \"name\",\n \"unit_of_measurement\",\n \"default_tax_id\",\n \"sales_price\",\n \"sales_description\",\n \"total_available_quantity\",\n \"total_reserved_quantity\",\n \"purchase_price\",\n \"purchase_description\",\n \"cost\",\n 'rental_description',\n \"total_on_hand_quantity\",\n 'purchase_unit',\n 'sales_unit',\n 'consumption_unit',\n 'stock_unit',\n ],\n defaultFilter: { \"status.eq\": 1, '&(is_variant.eq': 1, '|type.eq': 'package)', '&is_rental.eq': 1 },\n },\n salesItems: {\n name: \"items/fetch\",\n apiFunc: getV1InventoryItems,\n dataKey: \"inventoryItemsList\",\n labelKey: \"name\",\n defaultColumn: [\n \"id\",\n \"name\",\n \"unit_of_measurement\",\n \"default_tax_id\",\n \"sales_price\",\n \"sales_description\",\n \"total_available_quantity\",\n \"total_reserved_quantity\",\n \"purchase_price\",\n \"purchase_description\",\n \"cost\",\n \"total_on_hand_quantity\",\n 'purchase_unit',\n 'sales_unit',\n 'consumption_unit',\n 'stock_unit',\n ],\n defaultFilter: { \"status.eq\": 1, '&(is_variant.eq': 1, '|type.eq': 'package)', '&is_rental.eq': 0 },\n },\n reportItems: {\n name: \"items/fetch\",\n apiFunc: getV1InventoryItems,\n dataKey: \"inventoryItemsList\",\n labelKey: \"name\",\n defaultColumn: [\n \"id\",\n \"name\",\n ],\n defaultFilter: { '&is_variant.eq': 1 },\n },\n inventoryItems: {\n name: \"inventory-items/fetch\",\n apiFunc: getV1InventoryItems,\n dataKey: \"inventoryItemsList\",\n labelKey: \"name\",\n defaultColumn: [\n \"id\",\n \"name\",\n \"type\",\n \"unit_of_measurement\",\n \"default_tax_id\",\n \"sales_price\",\n \"sales_description\",\n \"total_available_quantity\",\n \"total_reserved_quantity\",\n \"purchase_price\",\n \"purchase_description\",\n \"cost\",\n \"is_landed_cost\",\n \"total_on_hand_quantity\",\n 'purchase_unit',\n 'sales_unit',\n 'consumption_unit',\n 'stock_unit',\n ],\n defaultFilter: { \"status.eq\": 1 },\n },\n currency: {\n name: \"currency/fetch\",\n apiFunc: getV1Currency,\n dataKey: \"currencies\",\n labelKey: \"currency_name\",\n defaultColumn: [\"id\", \"currency_name\", \"symbol\", 'number_format'],\n // defaultFilter: null,\n defaultFilter: { \"status.eq\": 1 },\n },\n salesperson: {\n name: \"salesperson/fetch\",\n apiFunc: getV1User,\n dataKey: \"users\",\n // labelKey: \"first_name\",\n defaultColumn: [\"id\", \"first_name\", \"last_name\"],\n defaultFilter: { \"is_active.eq\": 1 },\n labelKey: getPartyName,\n },\n party: {\n name: \"party/fetch\",\n apiFunc: getV1Parties,\n dataKey: \"parties_list\",\n // labelKey: getPartyName,\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\", \"company_name\", \"first_name\", \"last_name\", \"type\"],\n // defaultColumn:[]\n defaultFilter: { \"status.eq\": 1 }\n },\n department: {\n name: \"department/fetch\",\n apiFunc: getV1UserDepartment,\n dataKey: \"department\",\n labelKey: \"label\",\n defaultColumn: [\"id\", \"name\", \"label\"],\n defaultFilter: null,\n },\n location: {\n name: \"location/fetch\",\n apiFunc: getV1WarehouseLocation,\n dataKey: \"warehouseLocationList\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n defaultFilter: { \"status.eq\": 1, \"&inventory_available.eq\": 1 },\n },\n warehouselocation: {\n name: \"location/fetch\",\n apiFunc: getV1WarehouseLocation,\n dataKey: \"warehouseLocationList\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n defaultFilter: { \"status.eq\": 1 },\n },\n uom: {\n name: \"uom/fetch\",\n apiFunc: getV1Uom,\n dataKey: \"units\",\n labelKey: \"uom_name\",\n defaultColumn: [\"id\", \"uom_name\", 'is_base_unit', 'conversation_factor'],\n defaultFilter: { \"template_id.ne\": null },\n },\n discountedItems: {\n name: \"discountItems/fetch\",\n apiFunc: getV1DiscountItems,\n dataKey: \"discountItemsList\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\", \"discount_rate_amount\", \"discount_category\"],\n defaultFilter: { \"status.eq\": 1 },\n },\n taxTemplate: {\n name: \"taxTemplate/fetch\",\n apiFunc: getV1TaxTemplates,\n dataKey: \"templates\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\", \"tax_codes\"],\n defaultFilter: null,\n },\n paymentTerm: {\n name: \"paymentTerm/fetch\",\n apiFunc: getV1PaymentTerms,\n dataKey: \"payment_terms_list\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n defaultFilter: null,\n },\n incoTerms: {\n name: \"incoTerms/fetch\",\n apiFunc: getV1PurchaseInvoicesIncoterms,\n dataKey: \"incoterm\",\n labelKey: \"term\",\n defaultColumn: [\"id\", \"term\"],\n defaultFilter: null,\n },\n shippingRules: {\n name: \"shippingRules/fetch\",\n apiFunc: getV1ShippingRules,\n dataKey: \"shippingRules\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\", \"shipping_cost\", \"handling_cost\"],\n defaultFilter: { 'status.ne': 'Draft' },\n },\n bins: {\n name: \"bins/fetch\",\n apiFunc: getV1Bin,\n dataKey: \"binsList\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n defaultFilter: null,\n },\n agreement: {\n name: \"agreement/fetch\",\n apiFunc: getV1PurchaseAgreements,\n dataKey: \"purchase_agreements\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n defaultFilter: null,\n },\n invoices: {\n name: \"purchaseInvoices/fetch\",\n apiFunc: getV1PurchaseInvoices,\n dataKey: \"invoices\",\n labelKey: \"series_number\",\n defaultColumn: [\"id\", \"series_number\"],\n defaultFilter: null,\n },\n purchaseOrderReceipts: {\n name: \"purchaseGRNs/fetch\",\n apiFunc: getV1PurchaseOrdersReceipts,\n dataKey: \"grns\",\n labelKey: \"series_number\",\n defaultColumn: [\"id\", \"series_number\"],\n defaultFilter: null,\n },\n representatives: {\n name: \"representatives/fetch\",\n apiFunc: getV1ExpenseReimbursementEmployees,\n dataKey: \"employees_list\",\n // labelKey: \"first_name\",\n defaultFilter: { \"is_active.eq\": 1 },\n defaultColumn: [\"id\", \"first_name\", \"last_name\"],\n labelKey: getPartyName,\n },\n categoryItems: {\n name: \"categoryItems/fetch\",\n apiFunc: getV1CategoryItems,\n dataKey: \"categoryItemsList\",\n labelKey: \"category_name\",\n defaultColumn: [\"id\", \"category_name\"],\n defaultFilter: { 'status.eq': 1 },\n },\n customerSegment: {\n name: \"customerSegment/fetch\",\n apiFunc: getV1CustomerSegment,\n dataKey: \"customerSegments\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\", \"status\"],\n defaultFilter: { 'status.ne': 'Draft' },\n },\n accounts: {\n name: \"account/fetch\",\n apiFunc: getV1ChartOfAccount,\n dataKey: \"coa_list\",\n labelKey: \"account_name\",\n defaultColumn: [\"id\", \"account_name\", 'currency_id', 'currency_data', 'account_type_id'],\n defaultFilter: { \"is_active.eq\": 1 },\n },\n industry: {\n name: \"inductry/fetch\",\n apiFunc: getV1PartiesIndustry,\n dataKey: \"activity_list\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n defaultFilter: null,\n },\n bom: {\n name: \"bom/fetch\",\n apiFunc: getV1BillsOfMaterials,\n dataKey: \"bom_list\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n defaultFilter: { \"is_active.eq\": 1, \"&status.eq\": 'Approved' },\n },\n routing: {\n name: \"routing/fetch\",\n apiFunc: getV1Routing,\n dataKey: \"routings\",\n labelKey: \"route_name\",\n defaultColumn: [\"id\", \"route_name\"],\n defaultFilter: { \"is_active.eq\": 1 },\n },\n workCenter: {\n name: \"workCenter/fetch\",\n apiFunc: getV1WorkCentre,\n dataKey: \"workCentres\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n },\n workOrder: {\n name: \"workOrder/fetch\",\n apiFunc: getV1WorkOrder,\n dataKey: \"workOrders\",\n labelKey: \"series_number\",\n defaultColumn: [\"id\", \"series_number\"],\n defaultFilter: { \"is_active.eq\": 1, \"&status.ne\": \"Draft\" },\n },\n vehicleNumbers: {\n name: \"vehicleNumbers/fetch\",\n apiFunc: getV1GateRegisterVehicleNumbers,\n dataKey: \"vehicleNumbers\",\n labelKey: \"number\",\n defaultColumn: [\"id\", \"number\"],\n defaultFilter: null,\n },\n vehicleTypes: {\n name: \"vehicleTypes/fetch\",\n apiFunc: getV1GateRegisterVehicleTypes,\n dataKey: \"vehicleTypes\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n defaultFilter: null,\n },\n operations: {\n name: \"operations/fetch\",\n apiFunc: getV1Operations,\n dataKey: \"operations\",\n labelKey: \"operation_name\",\n defaultColumn: [\"id\", \"operation_name\"],\n defaultFilter: null,\n },\n assets: {\n name: \"assets/fetch\",\n apiFunc: getV1Assets,\n dataKey: \"assets_list\",\n labelKey: \"asset_name\",\n defaultColumn: [\"id\", \"asset_name\"],\n defaultFilter: { 'status.ne': 'cancelled' },\n },\n equipmentCategories: {\n name: \"equipmentCategories/fetch\",\n apiFunc: getV1EquipmentsCategories,\n dataKey: \"categories\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n defaultFilter: null,\n },\n equipment: {\n name: \"equipment/fetch\",\n apiFunc: getV1Equipments,\n dataKey: \"equipments\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\", \"equipment_category_data\"],\n defaultFilter: { 'status.ne': 'Draft' },\n },\n workCenterCategories: {\n name: \"workCenterCategories/fetch\",\n apiFunc: getV1WorkCentreCategories,\n dataKey: \"work_centre_categories_list\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n defaultFilter: null,\n },\n rawMaterials: {\n name: \"rawMaterials/fetch\",\n apiFunc: getV1BillsOfMaterialsListMaterials,\n dataKey: \"materials_list\",\n labelKey: \"item_data.name\",\n defaultColumn: [\"id\", \"item_data\"],\n defaultFilter: null,\n },\n countries: {\n name: \"countries/fetch\",\n apiFunc: getV1LocationsCountries,\n dataKey: \"countries\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n defaultFilter: { \"is_active.eq\": 1 },\n },\n rfqs: {\n name: \"rfqs/fetch\",\n apiFunc: getV1Rfq,\n dataKey: \"rfqs\",\n labelKey: \"series_number\",\n defaultColumn: [\"id\", \"series_number\"],\n defaultFilter: { 'status.ne': 'Draft' },\n },\n states: {\n name: \"states/fetch\",\n apiFunc: getV1LocationsStates,\n dataKey: \"states\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n defaultFilter: null,\n },\n assemblyItems: {\n name: \"assenmblyItems/fetch\",\n apiFunc: getV1AssemblyItems,\n dataKey: \"assemblyItemsList\",\n labelKey: \"name\",\n defaultColumn: [\n \"id\",\n \"name\",\n \"type\",\n \"unit_of_measurement\",\n \"default_tax_id\",\n \"sales_price\",\n \"sales_description\",\n \"total_available_quantity\",\n \"total_reserved_quantity\",\n \"purchase_price\",\n \"purchase_description\",\n \"cost\",\n \"is_landed_cost\",\n \"total_on_hand_quantity\",\n 'purchase_unit',\n 'sales_unit',\n 'consumption_unit',\n 'stock_unit',\n ],\n defaultFilter: { \"status.eq\": 1, '&is_variant.eq': 1 },\n },\n journal_type: {\n name: \"journal/fetch\",\n apiFunc: getV1AssetsJournalTypes,\n dataKey: \"journal_types\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"series_number\", \"name\"],\n },\n journal_entries: {\n name: \"journal-entries/fetch\",\n apiFunc: getV1JournalEntries,\n dataKey: \"journal_entries\",\n labelKey: \"series_number\",\n defaultColumn: [\"id\", \"series_number\"],\n },\n reference_types: {\n name: \"referenceTypes/fetch\",\n apiFunc: getV1JournalEntriesReferenceType,\n dataKey: \"reference_types\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n },\n invoice: {\n name: \"invoice/fetch\",\n apiFunc: getV1SalesInvoices,\n dataKey: \"invoices\",\n labelKey: \"series_number\",\n defaultColumn: [\"id\", \"series_number\"],\n },\n bills: {\n name: \"bills/fetch\",\n apiFunc: getV1PurchaseInvoices,\n dataKey: \"invoices\",\n labelKey: \"series_number\",\n defaultColumn: [\"id\", \"series_number\"],\n },\n notesReasons: {\n name: \"notesReasons/fetch\",\n apiFunc: getV1DebitNotesReasons,\n dataKey: \"reasons\",\n labelKey: \"reason_name\",\n defaultColumn: [\"id\", \"reason_name\"],\n },\n expenseCategories: {\n name: \"expenseCategories/fetch\",\n apiFunc: getV1ExpenseReimbursementExpenseCategories,\n dataKey: \"expense_category_list\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n },\n commissionTarget: {\n name: \"commissionTargets/fetch\",\n apiFunc: getV1CommissionTargets,\n dataKey: \"commission_targets\",\n labelKey: \"series_number\",\n defaultColumn: [\"id\", \"series_number\"],\n defaultFilter: { \"is_draft.eq\": 0 },\n },\n commissionPlan: {\n name: \"commissionPlans/fetch\",\n apiFunc: getV1CommissionPlans,\n dataKey: \"commission_plans\",\n labelKey: \"title\",\n defaultColumn: [\"id\", \"title\", 'type'],\n defaultFilter: { \"status.eq\": 1 },\n },\n assetTypes: {\n name: \"assetTypes/fetch\",\n apiFunc: getV1AssetsAssetTypes,\n dataKey: \"asset_types\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n defaultFilter: null,\n },\n fiscalYear: {\n name: \"fiscalYear/fetch\",\n apiFunc: getV1FiscalYear,\n dataKey: \"fiscal\",\n labelKey: \"year_name\",\n defaultColumn: [\"id\", \"year_name\", 'year_start_date', 'year_end_date'],\n defaultFilter: null,\n },\n budgetMonth: {\n name: \"budgetMonth/fetch\",\n apiFunc: getV1BudgetBudgetMonths,\n dataKey: \"budget_months\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n defaultFilter: null,\n },\n budgetType: {\n name: \"budgetType/fetch\",\n apiFunc: getV1BudgetBudgetTypes,\n dataKey: \"budget_types\",\n labelKey: \"name\",\n defaultColumn: [\"id\", \"name\"],\n defaultFilter: null,\n },\n account_types: {\n name: \"accountTypes/fetch\",\n apiFunc: getV1ChartOfAccountAccountType,\n dataKey: \"activity_list\",\n labelKey: \"type_name\",\n defaultColumn: [\"id\", \"type_name\"],\n },\n taxCategories: {\n name: \"taxCategories/fetch\",\n apiFunc: getV1TaxCategory,\n dataKey: 'tax_category_list',\n labelKey: \"name\",\n defaultColumn: ['id', 'name']\n },\n taxCodes: {\n name: 'taxCodes/fetch',\n apiFunc: getV1TaxCode,\n dataKey: 'tax_code',\n labelKey: \"name\",\n defaultColumn: ['id', 'name']\n },\n bankAccountType: {\n name: 'bankAccountType/fetch',\n apiFunc: getV1BankAccountsTypes,\n dataKey: 'account_types',\n labelKey: \"name\",\n defaultColumn: ['id', 'name']\n },\n bank: {\n name: 'bank/fetch',\n apiFunc: getV1Banks,\n dataKey: 'banks_list',\n labelKey: \"name\",\n defaultColumn: ['id', 'name']\n },\n dueDateType: {\n name: 'dueDateType/fetch',\n apiFunc: getV1PaymentTermsDueDateTypes,\n dataKey: 'due_date_list',\n labelKey: \"value\",\n defaultColumn: ['id', 'value']\n },\n brand: {\n name: 'brand/fetch',\n apiFunc: getV1Brand,\n dataKey: '',\n labelKey: \"name\",\n defaultColumn: ['id', 'name']\n },\n stockReason: {\n name: 'stockReason/fetch',\n apiFunc: getV1StockReason,\n dataKey: '',\n labelKey: \"name\",\n defaultColumn: ['id', 'name']\n },\n contacts: {\n name: 'contacts/fetch',\n apiFunc: getV1OpportunityContact,\n dataKey: '',\n labelKey: \"name\",\n defaultColumn: ['id', 'name']\n },\n rnTermsConditions: {\n name: 'rnTermsConditions/fetch',\n apiFunc: getV1RentalTermsConditions,\n dataKey: 'terms_and_conditions',\n labelKey: \"name\",\n defaultColumn: ['id', 'name'],\n defaultFilter: { 'is_active.eq': 1 },\n },\n rnAgreements: {\n name: 'rnAgreements/fetch',\n apiFunc: getV1RentalAgreements,\n dataKey: 'purchase_agreements',\n labelKey: \"name\",\n defaultColumn: ['id', 'name'],\n defaultFilter: { 'status.eq': \"'In Progress'\", '&is_rental.eq': 1 },\n },\n rnBillingCycle: {\n name: 'rnTermsConditions/fetch',\n apiFunc: getV1RentalBillingCycles,\n dataKey: 'billing_cycles',\n labelKey: \"name\",\n defaultColumn: ['id', 'name'],\n defaultFilter: null,\n },\n // priceList:{\n // name:'priceList/fetch',\n // apiFunc: getV1PriceLis,\n // dataKey:'',\n // labelKey: \"name\",\n // defaultColumn:['id','name']\n // },\n rnChOrders: {\n name: 'rnChOrders/fetch',\n apiFunc: getV1CrossHireOrders,\n dataKey: 'purchase_orders',\n labelKey: \"series_number\",\n defaultColumn: ['id', 'series_number'],\n defaultFilter: { '&is_rental.eq': 1 },\n },\n labguages: {\n name: 'languages/fetch',\n apiFunc: getV1Languages,\n dataKey: 'languages',\n labelKey: \"name\",\n defaultColumn: ['id', 'name', 'code'],\n },\n roles: {\n name: 'roles/fetch',\n apiFunc: getV1Role,\n dataKey: 'roles',\n labelKey: \"name\",\n defaultColumn: ['id', 'name', 'code'],\n },\n reports: {\n name: 'reports/fetch',\n apiFunc: getV1ReportsReportList,\n dataKey: 'reports',\n labelKey: \"name\",\n defaultColumn: ['id', 'name'],\n },\n uom_templates: {\n name: 'uomTemplate/fetch',\n apiFunc: getV1UomTemplates,\n dataKey: 'templates',\n labelKey: \"name\",\n defaultColumn: ['id', 'name'],\n defaultFilter: { \"is_active.eq\": 1 },\n },\n workflow_reference: {\n name: 'workflow_reference/fetch',\n apiFunc: getV1WorkflowReferences,\n dataKey: 'workflow_reference',\n labelKey: \"name\",\n defaultColumn: ['id', 'name'],\n },\n grades: {\n name: 'grades/fetch',\n apiFunc: getV1Grades,\n dataKey: 'grades',\n labelKey: \"grade_name\",\n defaultColumn: ['id', 'grade_name'],\n },\n useModules: {\n name: 'useModules/fetch',\n apiFunc: getV1UserModules,\n dataKey: 'modules',\n labelKey: \"name\",\n defaultColumn: ['id', 'name'],\n },\n};\n\nexport const fetchApi = async ({\n apiKey,\n filters,\n labelKey,\n valueKey\n}: {\n apiKey: keyof typeof apiConfigurations;\n filters: any;\n labelKey?: string;\n valueKey?: string;\n}) => {\n try {\n const config = apiConfigurations[apiKey];\n if (!config) {\n throw `API configuration for key \"${apiKey}\" not found.`;\n }\n const res = await getOptions(\n config.apiFunc,\n filters,\n config.dataKey,\n labelKey || config.labelKey,\n config.defaultColumn,\n config.defaultFilter,\n valueKey\n );\n return res;\n } catch (error: any) {\n const newError = new Error(error);\n showSnackBar(newError);\n throw newError;\n }\n};\nexport const getCurrency = () => { };\n\nexport const getItems = () => { };\n"],"names":["onApiConfigReady","config","baseUrl","backendBaseUrl","setBaseUrl","setInventoryBaseUrl","SetAccountingBaseUrl","setCrmBaseUrl","setRbacBaseUrl","setHrmsBaseUrl","setSystemFeatureBaseUrl","setDriveBaseUrl","createColumns","defaultColumn","select","columns","Set","length","join","combineFilters","defaultFilter","newFilter","updatedQuery","filters","Object","keys","forEach","key","getOptions","async","apiFunc","dataKey","labelKey","valueKey","customeFilter","order","response","getToken","Array","isArray","data","_a","map","item","label","Function","_","get","value","pagination","_c","_b","apiConfigurations","company","name","getV1Company","items","getV1InventoryItems","notPackageItems","rentalItems","salesItems","reportItems","inventoryItems","currency","getV1Currency","salesperson","getV1User","getPartyName","party","getV1Parties","department","getV1UserDepartment","location","getV1WarehouseLocation","warehouselocation","uom","getV1Uom","discountedItems","getV1DiscountItems","taxTemplate","getV1TaxTemplates","paymentTerm","getV1PaymentTerms","incoTerms","getV1PurchaseInvoicesIncoterms","shippingRules","getV1ShippingRules","bins","getV1Bin","agreement","getV1PurchaseAgreements","invoices","getV1PurchaseInvoices","purchaseOrderReceipts","getV1PurchaseOrdersReceipts","representatives","getV1ExpenseReimbursementEmployees","categoryItems","getV1CategoryItems","customerSegment","getV1CustomerSegment","accounts","getV1ChartOfAccount","industry","getV1PartiesIndustry","bom","getV1BillsOfMaterials","routing","getV1Routing","workCenter","getV1WorkCentre","workOrder","getV1WorkOrder","vehicleNumbers","getV1GateRegisterVehicleNumbers","vehicleTypes","getV1GateRegisterVehicleTypes","operations","getV1Operations","assets","getV1Assets","equipmentCategories","getV1EquipmentsCategories","equipment","getV1Equipments","workCenterCategories","getV1WorkCentreCategories","rawMaterials","getV1BillsOfMaterialsListMaterials","countries","getV1LocationsCountries","rfqs","getV1Rfq","states","getV1LocationsStates","assemblyItems","getV1AssemblyItems","journal_type","getV1AssetsJournalTypes","journal_entries","getV1JournalEntries","reference_types","getV1JournalEntriesReferenceType","invoice","getV1SalesInvoices","bills","notesReasons","getV1DebitNotesReasons","expenseCategories","getV1ExpenseReimbursementExpenseCategories","commissionTarget","getV1CommissionTargets","commissionPlan","getV1CommissionPlans","assetTypes","getV1AssetsAssetTypes","fiscalYear","getV1FiscalYear","budgetMonth","getV1BudgetBudgetMonths","budgetType","getV1BudgetBudgetTypes","account_types","getV1ChartOfAccountAccountType","taxCategories","getV1TaxCategory","taxCodes","getV1TaxCode","bankAccountType","getV1BankAccountsTypes","bank","getV1Banks","dueDateType","getV1PaymentTermsDueDateTypes","brand","getV1Brand","stockReason","getV1StockReason","contacts","getV1OpportunityContact","rnTermsConditions","getV1RentalTermsConditions","rnAgreements","getV1RentalAgreements","rnBillingCycle","getV1RentalBillingCycles","rnChOrders","getV1CrossHireOrders","labguages","getV1Languages","roles","getV1Role","reports","getV1ReportsReportList","uom_templates","getV1UomTemplates","workflow_reference","getV1WorkflowReferences","grades","getV1Grades","useModules","getV1UserModules","apiKey","error","newError","Error","showSnackBar","isApiConfigInitialized","getApiConfig"],"mappings":"o3BA+GAA,EAAAA,iBAAkBC,IAChB,MAAMC,EAAUD,EAAOE,eACvBC,EAAAA,WAAW,GAAGF,UACdG,EAAAA,WAAoB,GAAGH,eACvBI,EAAAA,WAAqB,GAAGJ,gBACxBK,EAAAA,WAAc,GAAGL,WACjBM,EAAAA,WAAe,GAAGN,UAClBO,EAAAA,WAAe,GAAGP,UAClBQ,EAAAA,WAAwB,GAAGR,oBAC3BS,EAAAA,WAAgB,GAAGT,gBAGrB,MAAMU,EAAgB,CAACC,EAAuB,GAAIC,EAAgB,MAChE,MAAMC,EAAU,mBAAI,IAAIC,IAAI,IAAIH,KAAkBC,KAClD,OAAsB,GAAlBC,EAAQE,OAAoB,GACzB,IAAIF,EAAQG,KAAK,SAE1B,SAASC,EACPC,EACAC,GAEA,IAAIC,EAAe,GAEnB,MAAMC,EAAU,IAAKH,KAAkBC,GACvC,OAAoC,IAAhCG,OAAOC,KAAKF,GAASN,QAGzBO,OAAOC,KAAKF,GAASG,QAClBC,GAASL,EAAe,GAAGA,IAAeK,KAAOJ,EAAQI,MAHnDL,EAAe,IAAIA,KAAkB,EAMhD,CAEO,MAAMM,EAAaC,MACxBC,EACAP,EACAQ,EACAC,EACAnB,EACAO,EAAwB,GACxBa,EAAmB,kBAEnB,MAAMC,EAAgB,IACjBX,EACHT,OAAQF,EAAcC,EAAeU,EAAQT,QAC7CS,QAASJ,EAAeC,EAAeG,EAAQA,SAC/CY,aAAOZ,WAASY,QAAS,SAGrBC,QAAiBN,EAAQ,IAC1BI,KACAG,EAAAA,aAGL,OAAKN,GAAWO,MAAMC,QAAQ,MAAAH,OAAA,EAAAA,E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AGH,eACvBI,EAAAA,WAAqB,GAAGJ,gBACxBK,EAAAA,WAAc,GAAGL,WACjBM,EAAAA,WAAe,GAAGN,UAClBO,EAAAA,WAAe,GAAGP,UAClBQ,EAAAA,WAAwB,GAAGR,oBAC3BS,EAAAA,WAAgB,GAAGT,aACrB"}
@@ -48,10 +48,10 @@ export declare const transformTableColumns: ({ columns, currencySymbol, translat
48
48
  };
49
49
  redirectionPathWithId?: string;
50
50
  idField?: string;
51
+ footer?: string;
51
52
  meta?: import('@tanstack/table-core').ColumnMeta<MRT_RowData, unknown>;
52
53
  columns?: import('material-react-table').MRT_ColumnDef<MRT_RowData, unknown>[];
53
54
  accessorKey?: string | (string & {});
54
- footer?: string;
55
55
  id?: import('material-react-table').LiteralUnion<string, string>;
56
56
  Edit?: (props: {
57
57
  cell: import('material-react-table').MRT_Cell<MRT_RowData, unknown>;
@@ -72,7 +72,7 @@ const INVENTORY_FIELDS_TO_BE_DISABLED = {
72
72
  NO_VALUE: ["rental_base_price", "rental_hour_fine", "rental_day_fine", "rental_security_time", "rental_prices", "rental_description"]
73
73
  }
74
74
  };
75
- const INVENTORY_ALWAYS_DISABLED_FIELDS = ["update_quantity", "moves_history", "variants", "bom", "location_wise_stock", "purchase_price"];
75
+ const INVENTORY_ALWAYS_DISABLED_FIELDS = ["update_quantity", "moves_history", "variants", "bom", "location_wise_stock", "purchase_price", "base_unit"];
76
76
  const INVENTORY_ADD_MODE_DISABLED_FIELDS = ["vendor_information", "update_quantity", "moves_history", "reordering_rules", "variants", "location_wise_stock", "bin_wise_stock", "serial_lot_wise_stock", "bom"];
77
77
  const INVENTORY_EDIT_MODE_DISABLED_FIELDS = ["price_rules", "variants", "category", "brand", "traceability", "bom", "location_wise_stock", "bin_wise_stock", "serial_lot_wise_stock"];
78
78
  const INVENTORY_VARIANT_DISABLED_FIELDS = [
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../../../src/utils/constant.ts"],"sourcesContent":["import { MaterialTableColumnProps } from \"../components/material-table/material-table\";\nimport { formatLabel } from \"./format-text\";\n\nexport const SECTION_TYPES = {\n DEFAULT: \"Default\",\n FORM_SWITCH_SECTION: \"Form switcher section\",\n}\n\nexport const responseItemDetailsColumns: MaterialTableColumnProps[] = [\n {\n header: \"rental.crossHireRfq.table.vendor_header\", \n accessorKey: \"item_data.vendor_info.vendor_name\",\n visible: true,\n type: \"custom_link\",\n },\n {\n header: \"rental.crossHireRfq.table.rate_header\", \n accessorKey: \"rate\",\n visible: true,\n type: \"currency\",\n },\n {\n header: \"rental.crossHireRfq.table.minimum_order_quantity\",\n accessorKey: \"min_order_quantity\",\n visible: true,\n type: \"number\",\n },\n {\n header: \"rental.crossHireRfq.table.vendor_uom_header\",\n accessorKey: \"vendor_uom_data.name\",\n visible: true,\n type: \"string\",\n },\n {\n header: \"rental.crossHireRfq.table.specification_header\", \n accessorKey: \"specification\",\n visible: false,\n type: \"string\",\n },\n {\n header: \"rental.crossHireRfq.table.condition_header\", \n accessorKey: \"conditions\",\n visible: false,\n type: \"string\",\n },\n // {\n // header: \"rental.crossHireRfq.table.notes_header\", \n // accessorKey: \"notes\",\n // visible: false,\n // type: \"string\",\n // },\n {\n header: \"rental.crossHireRfq.table.narration_header\",\n accessorKey: \"narration\",\n visible: false,\n type: \"string\",\n },\n];\n\n\nexport const INVENTORY_MATERIAL_COSTING_TYPE_ARR = ['pipe_costing', 'boards_costing', 'steel_sheets']\n\nexport const INVENTORY_MATERIAL_COSTING_TYPE_OPTIONS = INVENTORY_MATERIAL_COSTING_TYPE_ARR.map((value) => ({ label: formatLabel(value), value }))\n\n// Interface for form values\nexport type FieldDisableConfig = Record<string, any>;\n\nexport const INVENTORY_FIELDS_TO_BE_DISABLED: FieldDisableConfig = {\n pipe_costing: {\n tube_type: {\n Round: ['shape_width', 'shape_height'],\n Rectangular: ['tube_od',],\n Square: ['tube_od'],\n NO_VALUE: ['shape_width', 'shape_height', 'tube_od'],\n }\n },\n is_rental: {\n 1: [ 'sales_price', 'alternative_product_sell', 'sales_description', \"price_rules\" ],\n 0: [ 'rental_base_price', 'rental_hour_fine', 'rental_day_fine', 'rental_security_time', \"rental_prices\", 'rental_description',],\n true: [ 'sales_price', 'alternative_product_sell', 'sales_description', \"price_rules\" ],\n false: [ 'rental_base_price', 'rental_hour_fine', 'rental_day_fine', 'rental_security_time', \"rental_prices\", 'rental_description',],\n NO_VALUE: [ 'rental_base_price', 'rental_hour_fine', 'rental_day_fine', 'rental_security_time', \"rental_prices\", 'rental_description',],\n }\n}\n\nexport const INVENTORY_ALWAYS_DISABLED_FIELDS = ['update_quantity', 'moves_history', 'variants', 'bom', 'location_wise_stock', 'purchase_price'];\nexport const INVENTORY_ADD_MODE_DISABLED_FIELDS = ['vendor_information','update_quantity','moves_history','reordering_rules','variants','location_wise_stock','bin_wise_stock','serial_lot_wise_stock','bom'];\nexport const INVENTORY_EDIT_MODE_DISABLED_FIELDS = ['price_rules', 'variants', 'category', 'brand', 'traceability', 'bom', 'location_wise_stock', 'bin_wise_stock', 'serial_lot_wise_stock'];\nexport const INVENTORY_VARIANT_DISABLED_FIELDS = [\n 'category',\n 'parent_item',\n 'attributes',\n 'brand',\n 'alternative_product_sell',\n 'default_tax_id',\n 'income_account_id',\n 'asset_account_id',\n 'cogs_account_id',\n 'traceability',\n 'location_wise_stock',\n 'bin_wise_stock',\n 'serial_lot_wise_stock'\n];"],"names":[],"mappings":";AAGO,MAAM,gBAAgB;AAAA,EACzB,SAAS;AAAA,EACT,qBAAqB;AACzB;AAEO,MAAM,6BAAyD;AAAA,EACpE;AAAA,IACE,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,SAAS;AAAA,IACT,MAAM;AAAA,EAAA;AAAA,EAER;AAAA,IACE,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,SAAS;AAAA,IACT,MAAM;AAAA,EAAA;AAAA,EAER;AAAA,IACE,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,SAAS;AAAA,IACT,MAAM;AAAA,EAAA;AA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AAqB,mBAAkB,iBAAgB,oBAAmB,YAAW,uBAAsB,kBAAiB,yBAAwB,KAAK;AACrM,MAAM,sCAAsC,CAAC,eAAe,YAAY,YAAY,SAAS,gBAAgB,OAAO,uBAAuB,kBAAkB,uBAAuB;AACpL,MAAM,oCAAoC;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../../../src/utils/constant.ts"],"sourcesContent":["import { MaterialTableColumnProps } from \"../components/material-table/material-table\";\nimport { formatLabel } from \"./format-text\";\n\nexport const SECTION_TYPES = {\n DEFAULT: \"Default\",\n FORM_SWITCH_SECTION: \"Form switcher section\",\n}\n\nexport const responseItemDetailsColumns: MaterialTableColumnProps[] = [\n {\n header: \"rental.crossHireRfq.table.vendor_header\", \n accessorKey: \"item_data.vendor_info.vendor_name\",\n visible: true,\n type: \"custom_link\",\n },\n {\n header: \"rental.crossHireRfq.table.rate_header\", \n accessorKey: \"rate\",\n visible: true,\n type: \"currency\",\n },\n {\n header: \"rental.crossHireRfq.table.minimum_order_quantity\",\n accessorKey: \"min_order_quantity\",\n visible: true,\n type: \"number\",\n },\n {\n header: \"rental.crossHireRfq.table.vendor_uom_header\",\n accessorKey: \"vendor_uom_data.name\",\n visible: true,\n type: \"string\",\n },\n {\n header: \"rental.crossHireRfq.table.specification_header\", \n accessorKey: \"specification\",\n visible: false,\n type: \"string\",\n },\n {\n header: \"rental.crossHireRfq.table.condition_header\", \n accessorKey: \"conditions\",\n visible: false,\n type: \"string\",\n },\n // {\n // header: \"rental.crossHireRfq.table.notes_header\", \n // accessorKey: \"notes\",\n // visible: false,\n // type: \"string\",\n // },\n {\n header: \"rental.crossHireRfq.table.narration_header\",\n accessorKey: \"narration\",\n visible: false,\n type: \"string\",\n },\n];\n\n\nexport const INVENTORY_MATERIAL_COSTING_TYPE_ARR = ['pipe_costing', 'boards_costing', 'steel_sheets']\n\nexport const INVENTORY_MATERIAL_COSTING_TYPE_OPTIONS = INVENTORY_MATERIAL_COSTING_TYPE_ARR.map((value) => ({ label: formatLabel(value), value }))\n\n// Interface for form values\nexport type FieldDisableConfig = Record<string, any>;\n\nexport const INVENTORY_FIELDS_TO_BE_DISABLED: FieldDisableConfig = {\n pipe_costing: {\n tube_type: {\n Round: ['shape_width', 'shape_height'],\n Rectangular: ['tube_od',],\n Square: ['tube_od'],\n NO_VALUE: ['shape_width', 'shape_height', 'tube_od'],\n }\n },\n is_rental: {\n 1: [ 'sales_price', 'alternative_product_sell', 'sales_description', \"price_rules\" ],\n 0: [ 'rental_base_price', 'rental_hour_fine', 'rental_day_fine', 'rental_security_time', \"rental_prices\", 'rental_description',],\n true: [ 'sales_price', 'alternative_product_sell', 'sales_description', \"price_rules\" ],\n false: [ 'rental_base_price', 'rental_hour_fine', 'rental_day_fine', 'rental_security_time', \"rental_prices\", 'rental_description',],\n NO_VALUE: [ 'rental_base_price', 'rental_hour_fine', 'rental_day_fine', 'rental_security_time', \"rental_prices\", 'rental_description',],\n }\n}\n\nexport const INVENTORY_ALWAYS_DISABLED_FIELDS = ['update_quantity', 'moves_history', 'variants', 'bom', 'location_wise_stock', 'purchase_price','base_unit'];\nexport const INVENTORY_ADD_MODE_DISABLED_FIELDS = ['vendor_information','update_quantity','moves_history','reordering_rules','variants','location_wise_stock','bin_wise_stock','serial_lot_wise_stock','bom'];\nexport const INVENTORY_EDIT_MODE_DISABLED_FIELDS = ['price_rules', 'variants', 'category', 'brand', 'traceability', 'bom', 'location_wise_stock', 'bin_wise_stock', 'serial_lot_wise_stock'];\nexport const INVENTORY_VARIANT_DISABLED_FIELDS = [\n 'category',\n 'parent_item',\n 'attributes',\n 'brand',\n 'alternative_product_sell',\n 'default_tax_id',\n 'income_account_id',\n 'asset_account_id',\n 'cogs_account_id',\n 'traceability',\n 'location_wise_stock',\n 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qBAAqB,aAAc;AAAA,IACnF,GAAG,CAAE,qBAAqB,oBAAoB,mBAAmB,wBAAwB,iBAAiB,oBAAqB;AAAA,IAC/H,MAAM,CAAE,eAAe,4BAA4B,qBAAqB,aAAc;AAAA,IACtF,OAAO,CAAE,qBAAqB,oBAAoB,mBAAmB,wBAAwB,iBAAiB,oBAAqB;AAAA,IACnI,UAAU,CAAE,qBAAqB,oBAAoB,mBAAmB,wBAAwB,iBAAiB,oBAAqB;AAAA,EAAA;AAE1I;AAEO,MAAM,mCAAmC,CAAC,mBAAmB,iBAAiB,YAAY,OAAO,uBAAuB,kBAAiB,WAAW;AACpJ,MAAM,qCAAqC,CAAC,sBAAqB,mBAAkB,iBAAgB,oBAAmB,YAAW,uBAAsB,kBAAiB,yBAAwB,KAAK;AACrM,MAAM,sCAAsC,CAAC,eAAe,YAAY,YAAY,SAAS,gBAAgB,OAAO,uBAAuB,kBAAkB,uBAAuB;AACpL,MAAM,oCAAoC;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../format-text/index.js");const t=["pipe_costing","boards_costing","steel_sheets"],r=t.map(t=>({label:e.formatLabel(t),value:t}));exports.INVENTORY_ADD_MODE_DISABLED_FIELDS=["vendor_information","update_quantity","moves_history","reordering_rules","variants","location_wise_stock","bin_wise_stock","serial_lot_wise_stock","bom"],exports.INVENTORY_ALWAYS_DISABLED_FIELDS=["update_quantity","moves_history","variants","bom","location_wise_stock","purchase_price"],exports.INVENTORY_EDIT_MODE_DISABLED_FIELDS=["price_rules","variants","category","brand","traceability","bom","location_wise_stock","bin_wise_stock","serial_lot_wise_stock"],exports.INVENTORY_FIELDS_TO_BE_DISABLED={pipe_costing:{tube_type:{Round:["shape_width","shape_height"],Rectangular:["tube_od"],Square:["tube_od"],NO_VALUE:["shape_width","shape_height","tube_od"]}},is_rental:{1:["sales_price","alternative_product_sell","sales_description","price_rules"],0:["rental_base_price","rental_hour_fine","rental_day_fine","rental_security_time","rental_prices","rental_description"],true:["sales_price","alternative_product_sell","sales_description","price_rules"],false:["rental_base_price","rental_hour_fine","rental_day_fine","rental_security_time","rental_prices","rental_description"],NO_VALUE:["rental_base_price","rental_hour_fine","rental_day_fine","rental_security_time","rental_prices","rental_description"]}},exports.INVENTORY_MATERIAL_COSTING_TYPE_ARR=t,exports.INVENTORY_MATERIAL_COSTING_TYPE_OPTIONS=r,exports.INVENTORY_VARIANT_DISABLED_FIELDS=["category","parent_item","attributes","brand","alternative_product_sell","default_tax_id","income_account_id","asset_account_id","cogs_account_id","traceability","location_wise_stock","bin_wise_stock","serial_lot_wise_stock"],exports.SECTION_TYPES={DEFAULT:"Default",FORM_SWITCH_SECTION:"Form switcher section"},exports.responseItemDetailsColumns=[{header:"rental.crossHireRfq.table.vendor_header",accessorKey:"item_data.vendor_info.vendor_name",visible:!0,type:"custom_link"},{header:"rental.crossHireRfq.table.rate_header",accessorKey:"rate",visible:!0,type:"currency"},{header:"rental.crossHireRfq.table.minimum_order_quantity",accessorKey:"min_order_quantity",visible:!0,type:"number"},{header:"rental.crossHireRfq.table.vendor_uom_header",accessorKey:"vendor_uom_data.name",visible:!0,type:"string"},{header:"rental.crossHireRfq.table.specification_header",accessorKey:"specification",visible:!1,type:"string"},{header:"rental.crossHireRfq.table.condition_header",accessorKey:"conditions",visible:!1,type:"string"},{header:"rental.crossHireRfq.table.narration_header",accessorKey:"narration",visible:!1,type:"string"}];
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../format-text/index.js");const t=["pipe_costing","boards_costing","steel_sheets"],r=t.map(t=>({label:e.formatLabel(t),value:t}));exports.INVENTORY_ADD_MODE_DISABLED_FIELDS=["vendor_information","update_quantity","moves_history","reordering_rules","variants","location_wise_stock","bin_wise_stock","serial_lot_wise_stock","bom"],exports.INVENTORY_ALWAYS_DISABLED_FIELDS=["update_quantity","moves_history","variants","bom","location_wise_stock","purchase_price","base_unit"],exports.INVENTORY_EDIT_MODE_DISABLED_FIELDS=["price_rules","variants","category","brand","traceability","bom","location_wise_stock","bin_wise_stock","serial_lot_wise_stock"],exports.INVENTORY_FIELDS_TO_BE_DISABLED={pipe_costing:{tube_type:{Round:["shape_width","shape_height"],Rectangular:["tube_od"],Square:["tube_od"],NO_VALUE:["shape_width","shape_height","tube_od"]}},is_rental:{1:["sales_price","alternative_product_sell","sales_description","price_rules"],0:["rental_base_price","rental_hour_fine","rental_day_fine","rental_security_time","rental_prices","rental_description"],true:["sales_price","alternative_product_sell","sales_description","price_rules"],false:["rental_base_price","rental_hour_fine","rental_day_fine","rental_security_time","rental_prices","rental_description"],NO_VALUE:["rental_base_price","rental_hour_fine","rental_day_fine","rental_security_time","rental_prices","rental_description"]}},exports.INVENTORY_MATERIAL_COSTING_TYPE_ARR=t,exports.INVENTORY_MATERIAL_COSTING_TYPE_OPTIONS=r,exports.INVENTORY_VARIANT_DISABLED_FIELDS=["category","parent_item","attributes","brand","alternative_product_sell","default_tax_id","income_account_id","asset_account_id","cogs_account_id","traceability","location_wise_stock","bin_wise_stock","serial_lot_wise_stock"],exports.SECTION_TYPES={DEFAULT:"Default",FORM_SWITCH_SECTION:"Form switcher section"},exports.responseItemDetailsColumns=[{header:"rental.crossHireRfq.table.vendor_header",accessorKey:"item_data.vendor_info.vendor_name",visible:!0,type:"custom_link"},{header:"rental.crossHireRfq.table.rate_header",accessorKey:"rate",visible:!0,type:"currency"},{header:"rental.crossHireRfq.table.minimum_order_quantity",accessorKey:"min_order_quantity",visible:!0,type:"number"},{header:"rental.crossHireRfq.table.vendor_uom_header",accessorKey:"vendor_uom_data.name",visible:!0,type:"string"},{header:"rental.crossHireRfq.table.specification_header",accessorKey:"specification",visible:!1,type:"string"},{header:"rental.crossHireRfq.table.condition_header",accessorKey:"conditions",visible:!1,type:"string"},{header:"rental.crossHireRfq.table.narration_header",accessorKey:"narration",visible:!1,type:"string"}];
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/utils/constant.ts"],"sourcesContent":["import { MaterialTableColumnProps } from \"../components/material-table/material-table\";\nimport { formatLabel } from \"./format-text\";\n\nexport const SECTION_TYPES = {\n DEFAULT: \"Default\",\n FORM_SWITCH_SECTION: \"Form switcher section\",\n}\n\nexport const responseItemDetailsColumns: MaterialTableColumnProps[] = [\n {\n header: \"rental.crossHireRfq.table.vendor_header\", \n accessorKey: \"item_data.vendor_info.vendor_name\",\n visible: true,\n type: \"custom_link\",\n },\n {\n header: \"rental.crossHireRfq.table.rate_header\", \n accessorKey: \"rate\",\n visible: true,\n type: \"currency\",\n },\n {\n header: \"rental.crossHireRfq.table.minimum_order_quantity\",\n accessorKey: \"min_order_quantity\",\n visible: true,\n type: \"number\",\n },\n {\n header: \"rental.crossHireRfq.table.vendor_uom_header\",\n accessorKey: \"vendor_uom_data.name\",\n visible: true,\n type: \"string\",\n },\n {\n header: \"rental.crossHireRfq.table.specification_header\", \n accessorKey: \"specification\",\n visible: false,\n type: \"string\",\n },\n {\n header: \"rental.crossHireRfq.table.condition_header\", \n accessorKey: \"conditions\",\n visible: false,\n type: \"string\",\n },\n // {\n // header: \"rental.crossHireRfq.table.notes_header\", \n // accessorKey: \"notes\",\n // visible: false,\n // type: \"string\",\n // },\n {\n header: \"rental.crossHireRfq.table.narration_header\",\n accessorKey: \"narration\",\n visible: false,\n type: \"string\",\n },\n];\n\n\nexport const INVENTORY_MATERIAL_COSTING_TYPE_ARR = ['pipe_costing', 'boards_costing', 'steel_sheets']\n\nexport const INVENTORY_MATERIAL_COSTING_TYPE_OPTIONS = INVENTORY_MATERIAL_COSTING_TYPE_ARR.map((value) => ({ label: formatLabel(value), value }))\n\n// Interface for form values\nexport type FieldDisableConfig = Record<string, any>;\n\nexport const INVENTORY_FIELDS_TO_BE_DISABLED: FieldDisableConfig = {\n pipe_costing: {\n tube_type: {\n Round: ['shape_width', 'shape_height'],\n Rectangular: ['tube_od',],\n Square: ['tube_od'],\n NO_VALUE: ['shape_width', 'shape_height', 'tube_od'],\n }\n },\n is_rental: {\n 1: [ 'sales_price', 'alternative_product_sell', 'sales_description', \"price_rules\" ],\n 0: [ 'rental_base_price', 'rental_hour_fine', 'rental_day_fine', 'rental_security_time', \"rental_prices\", 'rental_description',],\n true: [ 'sales_price', 'alternative_product_sell', 'sales_description', \"price_rules\" ],\n false: [ 'rental_base_price', 'rental_hour_fine', 'rental_day_fine', 'rental_security_time', \"rental_prices\", 'rental_description',],\n NO_VALUE: [ 'rental_base_price', 'rental_hour_fine', 'rental_day_fine', 'rental_security_time', \"rental_prices\", 'rental_description',],\n }\n}\n\nexport const INVENTORY_ALWAYS_DISABLED_FIELDS = ['update_quantity', 'moves_history', 'variants', 'bom', 'location_wise_stock', 'purchase_price'];\nexport const INVENTORY_ADD_MODE_DISABLED_FIELDS = ['vendor_information','update_quantity','moves_history','reordering_rules','variants','location_wise_stock','bin_wise_stock','serial_lot_wise_stock','bom'];\nexport const INVENTORY_EDIT_MODE_DISABLED_FIELDS = ['price_rules', 'variants', 'category', 'brand', 'traceability', 'bom', 'location_wise_stock', 'bin_wise_stock', 'serial_lot_wise_stock'];\nexport const INVENTORY_VARIANT_DISABLED_FIELDS = [\n 'category',\n 'parent_item',\n 'attributes',\n 'brand',\n 'alternative_product_sell',\n 'default_tax_id',\n 'income_account_id',\n 'asset_account_id',\n 'cogs_account_id',\n 'traceability',\n 'location_wise_stock',\n 'bin_wise_stock',\n 'serial_lot_wise_stock'\n];"],"names":["INVENTORY_MATERIAL_COSTING_TYPE_ARR","INVENTORY_MATERIAL_COSTING_TYPE_OPTIONS","map","value","label","formatLabel","pipe_costing","tube_type","Round","Rectangular","Square","NO_VALUE","is_rental","true","false","DEFAULT","FORM_SWITCH_SECTION","header","accessorKey","visible","type"],"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ACbC,SAAS,EACTC,KAAM"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/utils/constant.ts"],"sourcesContent":["import { MaterialTableColumnProps } from \"../components/material-table/material-table\";\nimport { formatLabel } from \"./format-text\";\n\nexport const SECTION_TYPES = {\n DEFAULT: \"Default\",\n FORM_SWITCH_SECTION: \"Form switcher section\",\n}\n\nexport const responseItemDetailsColumns: MaterialTableColumnProps[] = [\n {\n header: \"rental.crossHireRfq.table.vendor_header\", \n accessorKey: \"item_data.vendor_info.vendor_name\",\n visible: true,\n type: \"custom_link\",\n },\n {\n header: \"rental.crossHireRfq.table.rate_header\", \n accessorKey: \"rate\",\n visible: true,\n type: \"currency\",\n },\n {\n header: \"rental.crossHireRfq.table.minimum_order_quantity\",\n accessorKey: \"min_order_quantity\",\n visible: true,\n type: \"number\",\n },\n {\n header: \"rental.crossHireRfq.table.vendor_uom_header\",\n accessorKey: \"vendor_uom_data.name\",\n visible: true,\n type: \"string\",\n },\n {\n header: \"rental.crossHireRfq.table.specification_header\", \n accessorKey: \"specification\",\n visible: false,\n type: \"string\",\n },\n {\n header: \"rental.crossHireRfq.table.condition_header\", \n accessorKey: \"conditions\",\n visible: false,\n type: \"string\",\n },\n // {\n // header: \"rental.crossHireRfq.table.notes_header\", \n // accessorKey: \"notes\",\n // visible: false,\n // type: \"string\",\n // },\n {\n header: \"rental.crossHireRfq.table.narration_header\",\n accessorKey: \"narration\",\n visible: false,\n type: \"string\",\n },\n];\n\n\nexport const INVENTORY_MATERIAL_COSTING_TYPE_ARR = ['pipe_costing', 'boards_costing', 'steel_sheets']\n\nexport const INVENTORY_MATERIAL_COSTING_TYPE_OPTIONS = INVENTORY_MATERIAL_COSTING_TYPE_ARR.map((value) => ({ label: formatLabel(value), value }))\n\n// Interface for form values\nexport type FieldDisableConfig = Record<string, any>;\n\nexport const INVENTORY_FIELDS_TO_BE_DISABLED: FieldDisableConfig = {\n pipe_costing: {\n tube_type: {\n Round: ['shape_width', 'shape_height'],\n Rectangular: ['tube_od',],\n Square: ['tube_od'],\n NO_VALUE: ['shape_width', 'shape_height', 'tube_od'],\n }\n },\n is_rental: {\n 1: [ 'sales_price', 'alternative_product_sell', 'sales_description', \"price_rules\" ],\n 0: [ 'rental_base_price', 'rental_hour_fine', 'rental_day_fine', 'rental_security_time', \"rental_prices\", 'rental_description',],\n true: [ 'sales_price', 'alternative_product_sell', 'sales_description', \"price_rules\" ],\n false: [ 'rental_base_price', 'rental_hour_fine', 'rental_day_fine', 'rental_security_time', \"rental_prices\", 'rental_description',],\n NO_VALUE: [ 'rental_base_price', 'rental_hour_fine', 'rental_day_fine', 'rental_security_time', \"rental_prices\", 'rental_description',],\n }\n}\n\nexport const INVENTORY_ALWAYS_DISABLED_FIELDS = ['update_quantity', 'moves_history', 'variants', 'bom', 'location_wise_stock', 'purchase_price','base_unit'];\nexport const INVENTORY_ADD_MODE_DISABLED_FIELDS = ['vendor_information','update_quantity','moves_history','reordering_rules','variants','location_wise_stock','bin_wise_stock','serial_lot_wise_stock','bom'];\nexport const INVENTORY_EDIT_MODE_DISABLED_FIELDS = ['price_rules', 'variants', 'category', 'brand', 'traceability', 'bom', 'location_wise_stock', 'bin_wise_stock', 'serial_lot_wise_stock'];\nexport const INVENTORY_VARIANT_DISABLED_FIELDS = [\n 'category',\n 'parent_item',\n 'attributes',\n 'brand',\n 'alternative_product_sell',\n 'default_tax_id',\n 'income_account_id',\n 'asset_account_id',\n 'cogs_account_id',\n 'traceability',\n 'location_wise_stock',\n 'bin_wise_stock',\n 'serial_lot_wise_stock'\n];"],"names":["INVENTORY_MATERIAL_COSTING_TYPE_ARR","INVENTORY_MATERIAL_COSTING_TYPE_OPTIONS","map","value","label","formatLabel","pipe_costing","tube_type","Round","Rectangular","Square","NO_VALUE","is_rental","true","false","DEFAULT","FORM_SWITCH_SECTION","header","accessorKey","visible","type"],"mappings":"6GAGO,MAyDMA,EAAsC,CAAC,eAAgB,iBAAkB,gBAEzEC,EAA0CD,EAAoCE,IAAKC,IAA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
  const checkIfSectionExist = currentTab.data.find((section) => section.label === (currentSection == null ? void 0 : currentSection.label));
57
57
  if (!checkIfSectionExist) {
58
- currentTab.data.push({ ...otherSectionDetails, ...currentSection });
58
+ currentSection = { ...otherSectionDetails, ...currentSection };
59
+ currentTab.data.push(currentSection);
59
60
  } else {
60
61
  currentSection = checkIfSectionExist;
61
62
  }
@@ -186,7 +187,8 @@ const formBuilderDeConversion = (formData) => {
186
187
  };
187
188
  const checkIfSectionExist = (_b = outputData == null ? void 0 : outputData.section) == null ? void 0 : _b.find((section) => section.label === (currentSection == null ? void 0 : currentSection.label));
188
189
  if (!checkIfSectionExist) {
189
- outputData.section.push({ ...otherSectionDetails, ...currentSection });
190
+ currentSection = { ...otherSectionDetails, ...currentSection };
191
+ outputData.section.push(currentSection);
190
192
  } else {
191
193
  currentSection = checkIfSectionExist;
192
194
  }
@@ -306,7 +308,6 @@ const convertTableColumns = (columns) => {
306
308
  };
307
309
  export {
308
310
  convertTableColumns,
309
- formBuilderDeConversion as default,
310
- formBuilderDeConversion
311
+ formBuilderDeConversion as default
311
312
  };
312
313
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../../../src/utils/form-builder-deconversion.ts"],"sourcesContent":["export type ItemType = {\n section_name: any;\n is_system_field: boolean;\n field_type: string;\n label: string;\n name?: string;\n placeholder: string;\n default_value: any;\n validation: any[];\n is_multiline: any;\n section_order: any;\n option?: any;\n time_format?: string;\n currency?: string;\n field_properties: {\n is_accordion?: boolean;\n float_step?: any;\n options: any;\n is_multiselect: any;\n title: string;\n title_position: \"start\" | \"end\";\n is_multiline: boolean\n is_checked: boolean\n table: string,\n table_columns: string[]\n table_rows?: any\n is_multiple: boolean\n enable_footer?: boolean\n footer_action?: 'add'\n other_buttons?:React.ReactNode[]\n };\n is_section_field?: true;\n section_type?: \"default\" | \"Form switcher section\";\n form_switcher_label?: string;\n form_switcher_name?: string;\n switcher_forms?: {\n value?: string;\n name?: string;\n id?: number;\n }[];\n is_accordion?: boolean;\n}\n\nconst getFirstNonSectionField = (formData: any[]) => {\n const firstField = formData?.find((field) => !field.is_section_field)\n return firstField\n}\n\nconst formBuilderDeConversion = (formData: any) => {\n const outputData: any = {};\n if (formData.length === 0) {\n return outputData;\n }\n\n const firstItem = getFirstNonSectionField(formData);\n\n if (firstItem?.tab_name) {\n outputData.tab = <any>[];\n let currentTab: {\n title: string;\n data: any;\n remove_tab?: any;\n tab_order?: any;\n } | null = null;\n let currentSection: {\n label: string;\n members: any;\n remove_section: any;\n field_type?: string;\n is_accordion?: boolean;\n } | null = null;\n let otherSectionDetails: any = {}\n let sectionOrder: any = null\n\n formData.forEach((item: any) => {\n if (item?.is_section_field) {\n otherSectionDetails = {\n field_type: item?.field_type,\n label: item?.label,\n is_accordion: item?.is_accordion,\n is_section_field: item?.is_section_field,\n section_type: item?.section_type,\n form_switcher_label: item?.form_switcher_label,\n form_switcher_name: item?.form_switcher_name,\n switcher_forms: item?.switcher_forms,\n disabled: Boolean(item?.disabled)\n }\n currentSection = null\n sectionOrder = sectionOrder++\n } else {\n if (!currentTab || currentTab.title !== item.tab_name) {\n\n currentTab = {\n tab_order: item.tab_order || 1,\n title: item.tab_name,\n data: [],\n };\n const checkIfTabExist = outputData.tab.find(tab => tab.title === currentTab?.title)\n\n if (!checkIfTabExist) {\n outputData.tab.push(currentTab);\n } else {\n currentTab = checkIfTabExist\n }\n currentSection = null;\n }\n\n if (!currentSection || currentSection.label !== item.section_name || sectionOrder !== item.section_order) {\n currentSection = {\n field_type: \"section\",\n label: item.section_name || \"\",\n is_accordion: item.field_properties?.is_accordion,\n members: [],\n remove_section: item.is_system_field === true ? true : false,\n };\n\n const checkIfSectionExist = currentTab.data.find(section => section.label === currentSection?.label)\n if (!checkIfSectionExist) {\n currentTab.data.push({ ...otherSectionDetails, ...currentSection });\n } else {\n currentSection = checkIfSectionExist\n }\n otherSectionDetails = null\n }\n sectionOrder = item.section_order\n\n const thenValidations = item?.validation?.find((v: { type: string }) => v.type === \"when\")?.thenValidations || []\n\n const member = {\n ...item,\n id: `${Date.now()}-${Math.random()}`,\n field_type:\n item.field_type === \"media\" ? \"file\" : item.field_type || \"text\",\n type: item.is_system_field ? \"system\" : \"custom\",\n label: item.label || \"\",\n placeholder: item.placeholder || \"\",\n default_value: item.default_value || \"\",\n ...(item?.time_format &&\n item?.field_type === \"time\" && { option: item?.time_format }),\n ...(item?.currency &&\n item?.field_type === \"currency\" && { option: item?.currency }),\n ...(item.field_type === \"text\" && {\n min_length:\n item.validation.find(\n (v: { type: string }) => v.type === \"min_length\",\n )?.value || null,\n }),\n ...(item.field_type === \"text\" && {\n max_length:\n item.validation.find(\n (v: { type: string }) => v.type === \"max_length\",\n )?.value || null,\n }),\n ...(item.field_type === \"number\" && {\n min_length:\n item.validation.find((v: { type: string }) => v.type === \"min_val\")\n ?.value || null,\n }),\n ...(item.field_type === \"number\" && {\n max_length:\n item.validation.find((v: { type: string }) => v.type === \"max_val\")\n ?.value || null,\n }),\n ...((item.is_multiline !== undefined || item.field_properties.is_multiline !== undefined) && {\n is_multiline: item.is_multiline || item.field_properties.is_multiline,\n }),\n is_required:\n item.validation.find((v: { type: string }) => v.type === \"required\")?.value ||\n thenValidations?.find((v: { type: string }) => v.type === \"required\")?.value ||\n false,\n is_unique:\n item.validation.find((v: { type: string }) => v.type === \"unique\")\n ?.value || false,\n section_order: item.section_order || 0,\n ...(item.field_properties.float_step && {\n float_step: item.field_properties.float_step.toString(),\n }),\n ...(item.field_properties.options && {\n options: item.field_properties.options,\n }),\n ...(item.field_properties.is_multiselect !== undefined && {\n is_multiselect: item.field_properties.is_multiselect,\n }),\n ...(item.field_properties?.enable_footer !== undefined && {\n enable_footer: Boolean(item.field_properties.enable_footer),\n }),\n ...(item.field_properties?.footer_action !== undefined && {\n footer_action: item.field_properties.footer_action || 'add',\n }),\n ...(item.field_type === \"date\" && {\n is_future_dates_allowed:\n item.validation.find(\n (v: { type: string }) => v.type === \"is_future_dates_allowed\",\n )?.value || null,\n }),\n ...(item.field_type === \"date\" && {\n is_past_dates_allowed:\n item.validation.find(\n (v: { type: string }) => v.type === \"is_past_dates_allowed\",\n )?.value || null,\n }),\n ...((item.field_type === \"image\" || item.field_type === \"media\" || item.field_type === \"file\") && {\n max_size:\n item.validation.find(\n (v: { type: string }) => v.type === \"max_file_size\",\n )?.value || undefined,\n is_multiple: item.field_properties?.is_multiple\n }),\n ...((item.field_type === \"toggleButton\" || item.field_type === \"checkbox\" || item.field_type === \"radioButton\") && {\n title: item.field_properties?.title ? item.field_properties?.title : '',\n title_position: item.field_properties?.title_position ?? \"end\",\n is_checked: item.field_properties?.is_checked\n }),\n ...((item.field_type === \"table\") && {\n table: item.field_properties?.table,\n table_columns: convertTableColumns(item.field_properties?.table_columns),\n table_rows: item.field_properties?.table_rows,\n otherButtons: item.field_properties?.other_buttons || []\n }),\n };\n if (currentSection) {\n currentSection.members.push(member);\n if (\n currentSection.members.some((member: any) => member.type === \"system\")\n ) {\n currentSection.remove_section = true;\n } else {\n currentSection.remove_section = false;\n }\n currentTab.remove_tab = currentTab.data.some(\n (section: { members: any[] }) =>\n section.members.some(\n (member: { type: string }) => member.type === \"system\",\n ),\n );\n }\n }\n });\n } else {\n // Convert to sections format\n outputData.section = [];\n let currentSection: {\n label: any;\n members: any;\n remove_section: any;\n field_type?: string;\n is_accordion?: boolean;\n } | null = null;\n let otherSectionDetails: any = {}\n let sectionOrder: any = null\n\n formData.forEach(\n (item: ItemType) => {\n if (item.is_section_field) {\n otherSectionDetails = {\n field_type: item?.field_type,\n label: item?.label,\n is_accordion: item?.is_accordion,\n is_section_field: item?.is_section_field,\n section_type: item?.section_type,\n form_switcher_label: item?.form_switcher_label,\n form_switcher_name: item?.form_switcher_name,\n switcher_forms: item?.switcher_forms,\n disabled: Boolean(item?.disabled)\n }\n sectionOrder = sectionOrder++\n currentSection = null\n } else {\n if (!currentSection || currentSection.label !== item.section_name || sectionOrder !== item.section_order) {\n currentSection = {\n field_type: \"section\",\n label: item.section_name || \"\",\n is_accordion: item.field_properties?.is_accordion,\n members: [],\n remove_section: item.is_system_field === true ? true : false,\n };\n\n const checkIfSectionExist = outputData?.section?.find(section => section.label === currentSection?.label)\n if (!checkIfSectionExist) {\n outputData.section.push({ ...otherSectionDetails, ...currentSection });\n } else {\n currentSection = checkIfSectionExist\n }\n\n // outputData.section.push({ ...otherSectionDetails, ...currentSection });\n\n otherSectionDetails = null\n }\n sectionOrder = item.section_order\n\n const thenValidations = item?.validation?.find((v: { type: string }) => v.type === \"when\")?.thenValidations || []\n\n const member = {\n ...item,\n id: `${Date.now()}-${Math.random()}`,\n field_type:\n item.field_type === \"media\" ? \"file\" : item.field_type || \"text\",\n type: item.is_system_field ? \"system\" : \"custom\",\n label: item.label,\n placeholder: item.placeholder || \"\",\n default_value: item.default_value || \"\",\n ...(item?.time_format &&\n item?.field_type === \"time\" && { option: item?.time_format }),\n ...(item?.currency &&\n item?.field_type === \"currency\" && { option: item?.currency }),\n ...(item.field_type === \"text\" && {\n min_length:\n item.validation.find(\n (v: { type: string }) => v.type === \"min_length\",\n )?.value || null,\n }),\n ...(item.field_type === \"text\" && {\n max_length:\n item.validation.find(\n (v: { type: string }) => v.type === \"max_length\",\n )?.value || null,\n }),\n ...(item.field_type === \"number\" && {\n min_length:\n item.validation.find(\n (v: { type: string }) => v.type === \"min_val\",\n )?.value || null,\n }),\n ...(item.field_type === \"number\" && {\n max_length:\n item.validation.find(\n (v: { type: string }) => v.type === \"max_val\",\n )?.value || null,\n }),\n ...((item.is_multiline !== undefined || item.field_properties?.is_multiline !== undefined) && {\n is_multiline: item.is_multiline || item.field_properties.is_multiline,\n }),\n is_required:\n item.validation.find((v: { type: string }) => v.type === \"required\")?.value ||\n thenValidations?.find((v: { type: string }) => v.type === \"required\")?.value ||\n false,\n is_unique:\n item.validation.find((v: { type: string }) => v.type === \"unique\")\n ?.value || false,\n section_order: item.section_order || 0,\n ...(item.field_properties?.float_step && {\n float_step: Number(item.field_properties.float_step),\n }),\n ...(item.field_properties?.options && {\n options: item.field_properties.options,\n }),\n ...(item.field_properties?.is_multiselect !== undefined && {\n is_multiselect: item.field_properties.is_multiselect,\n }),\n ...(item.field_properties?.enable_footer !== undefined && {\n enable_footer: Boolean(item.field_properties.enable_footer),\n }),\n ...(item.field_properties?.footer_action !== undefined && {\n footer_action: item.field_properties.footer_action || 'add',\n }),\n ...(item.field_type === \"date\" && {\n is_future_dates_allowed:\n item.validation.find(\n (v: { type: string }) => v.type === \"is_future_dates_allowed\",\n )?.value || null,\n }),\n ...(item.field_type === \"date\" && {\n is_past_dates_allowed:\n item.validation.find(\n (v: { type: string }) => v.type === \"is_past_dates_allowed\",\n )?.value || null,\n }),\n ...((item.field_type === \"image\" || item.field_type === \"media\" || item.field_type === \"file\") && {\n max_size:\n item.validation.find(\n (v: { type: string }) => v.type === \"max_file_size\",\n )?.value || undefined,\n is_multiple: item.field_properties?.is_multiple\n }),\n ...((item.field_type === \"toggleButton\" || item.field_type === \"checkbox\") && {\n title: item.field_properties?.title ? item.field_properties?.title : item.label,\n title_position: item.field_properties?.title_position ?? \"end\",\n is_checked: item.field_properties?.is_checked\n }),\n ...((item.field_type === \"table\") && {\n table: item.field_properties?.table,\n table_columns: convertTableColumns(item.field_properties?.table_columns),\n table_rows: item.field_properties?.table_rows,\n otherButtons: item.field_properties?.other_buttons || []\n }),\n };\n\n currentSection.members.push(member);\n if (\n currentSection.members.some((member: any) => member.type === \"system\")\n ) {\n currentSection.remove_section = true;\n } else {\n currentSection.remove_section = false;\n }\n }\n }\n );\n }\n\n return outputData;\n};\n\n\n\nfunction formatText(key: string): string {\n return key ? key\n .split(/[:_-]/)\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(\" \") : key;\n}\n\nexport const convertTableColumns = (columns: string[]) => {\n if (!Array.isArray(columns)) return [];\n\n return columns.map(column => {\n if (typeof column === 'object') {\n return { ...column }\n } else {\n const colArr = column.split(\".\").filter(str => str)\n const header = colArr.length ? (colArr.length > 1 ? formatText(colArr[colArr.length - 1]) : formatText(colArr[0])) : \"-\"\n\n return {\n header,\n accessorKey: column,\n visible: true,\n }\n }\n })\n}\n\nexport { formBuilderDeConversion };\nexport default formBuilderDeConversion;\n"],"names":["member"],"mappings":"AA2CA,MAAM,0BAA0B,CAAC,aAAoB;AACnD,QAAM,aAAa,qCAAU,KAAK,CAAC,UAAU,CAAC,MAAM;AACpD,SAAO;AACT;AAEA,MAAM,0BAA0B,CAAC,aAAkB;AACjD,QAAM,aAAkB,CAAA;AACxB,MAAI,SAAS,WAAW,GAAG;AACzB,WAAO;AAAA,EACT;AAEA,QAAM,YAAY,wBAAwB,QAAQ;AAElD,MAAI,uCAAW,UAAU;AACvB,eAAW,MAAW,CAAA;AACtB,QAAI,aAKO;AACX,QAAI,iBAMO;AACX,QAAI,sBAA2B,CAAA;AAC/B,QAAI,eAAoB;AAExB,aAAS,QAAQ,CAAC,SAAc;AA/BpC;AAgCM,UAAI,6BAAM,kBAAkB;AAC1B,8BAAsB;AAAA,UACpB,YAAY,6BAAM;AAAA,UAClB,OAAO,6BAAM;AAAA,UACb,cAAc,6BAAM;AAAA,UACpB,kBAAkB,6BAAM;AAAA,UACxB,cAAc,6BAAM;AAAA,UACpB,qBAAqB,6BAAM;AAAA,UAC3B,oBAAoB,6BAAM;AAAA,UAC1B,gBAAgB,6BAAM;AAAA,UACtB,UAAU,QAAQ,6BAAM,QAAQ;AAAA,QAAA;AAElC,yBAAiB;AACjB,uBAAe;AAAA,MACjB,OAAO;AACL,YAAI,CAAC,cAAc,WAAW,UAAU,KAAK,UAAU;AAErD,uBAAa;AAAA,YACX,WAAW,KAAK,aAAa;AAAA,YAC7B,OAAO,KAAK;AAAA,YACZ,MAAM,CAAA;AAAA,UAAC;AAET,gBAAM,kBAAkB,WAAW,IAAI,KAAK,SAAO,IAAI,WAAU,yCAAY,MAAK;AAElF,cAAI,CAAC,iBAAiB;AACpB,uBAAW,IAAI,KAAK,UAAU;AA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AAO;AACL,YAAM,SAAS,OAAO,MAAM,GAAG,EAAE,OAAO,SAAO,GAAG;AAClD,YAAM,SAAS,OAAO,SAAU,OAAO,SAAS,IAAI,WAAW,OAAO,OAAO,SAAS,CAAC,CAAC,IAAI,WAAW,OAAO,CAAC,CAAC,IAAK;AAErH,aAAO;AAAA,QACL;AAAA,QACA,aAAa;AAAA,QACb,SAAS;AAAA,MAAA;AAAA,IAEb;AAAA,EACF,CAAC;AACH;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../../../src/utils/form-builder-deconversion.ts"],"sourcesContent":["type ItemType = {\n section_name: any;\n is_system_field: boolean;\n field_type: string;\n label: string;\n name?: string;\n placeholder: string;\n default_value: any;\n validation: any[];\n is_multiline: any;\n section_order: any;\n option?: any;\n time_format?: string;\n currency?: string;\n field_properties: {\n is_accordion?: boolean;\n float_step?: any;\n options: any;\n is_multiselect: any;\n title: string;\n title_position: \"start\" | \"end\";\n is_multiline: boolean\n is_checked: boolean\n table: string,\n table_columns: string[]\n table_rows?: any\n is_multiple: boolean\n enable_footer?: boolean\n footer_action?: 'add'\n other_buttons?: React.ReactNode[]\n };\n is_section_field?: true;\n section_type?: \"default\" | \"Form switcher section\";\n form_switcher_label?: string;\n form_switcher_name?: string;\n switcher_forms?: {\n value?: string;\n name?: string;\n id?: number;\n }[];\n is_accordion?: boolean;\n}\n\nconst getFirstNonSectionField = (formData: any[]) => {\n const firstField = formData?.find((field) => !field.is_section_field)\n return firstField\n}\n\nconst formBuilderDeConversion = (formData: any) => {\n const outputData: any = {};\n if (formData.length === 0) {\n return outputData;\n }\n\n const firstItem = getFirstNonSectionField(formData);\n\n if (firstItem?.tab_name) {\n outputData.tab = <any>[];\n let currentTab: {\n title: string;\n data: any;\n remove_tab?: any;\n tab_order?: any;\n } | null = null;\n let currentSection: {\n label: string;\n members: any;\n remove_section: any;\n field_type?: string;\n is_accordion?: boolean;\n } | null = null;\n let otherSectionDetails: any = {}\n let sectionOrder: any = null\n\n formData.forEach((item: any) => {\n if (item?.is_section_field) {\n otherSectionDetails = {\n field_type: item?.field_type,\n label: item?.label,\n is_accordion: item?.is_accordion,\n is_section_field: item?.is_section_field,\n section_type: item?.section_type,\n form_switcher_label: item?.form_switcher_label,\n form_switcher_name: item?.form_switcher_name,\n switcher_forms: item?.switcher_forms,\n disabled: Boolean(item?.disabled)\n }\n currentSection = null\n sectionOrder = sectionOrder++\n } else {\n if (!currentTab || currentTab.title !== item.tab_name) {\n\n currentTab = {\n tab_order: item.tab_order || 1,\n title: item.tab_name,\n data: [],\n };\n const checkIfTabExist = outputData.tab.find(tab => tab.title === currentTab?.title)\n\n if (!checkIfTabExist) {\n outputData.tab.push(currentTab);\n } else {\n currentTab = checkIfTabExist\n }\n currentSection = null;\n }\n\n if (!currentSection || currentSection.label !== item.section_name || sectionOrder !== item.section_order) {\n currentSection = {\n field_type: \"section\",\n label: item.section_name || \"\",\n is_accordion: item.field_properties?.is_accordion,\n members: [],\n remove_section: item.is_system_field === true ? true : false,\n };\n\n const checkIfSectionExist = currentTab.data.find(section => section.label === currentSection?.label)\n if (!checkIfSectionExist) {\n // Merge section details and update currentSection reference to the actual pushed object\n currentSection = { ...otherSectionDetails, ...currentSection };\n currentTab.data.push(currentSection);\n } else {\n currentSection = checkIfSectionExist\n }\n otherSectionDetails = null\n }\n sectionOrder = item.section_order\n\n const thenValidations = item?.validation?.find((v: { type: string }) => v.type === \"when\")?.thenValidations || []\n\n const member = {\n ...item,\n id: `${Date.now()}-${Math.random()}`,\n field_type:\n item.field_type === \"media\" ? \"file\" : item.field_type || \"text\",\n type: item.is_system_field ? \"system\" : \"custom\",\n label: item.label || \"\",\n placeholder: item.placeholder || \"\",\n default_value: item.default_value || \"\",\n ...(item?.time_format &&\n item?.field_type === \"time\" && { option: item?.time_format }),\n ...(item?.currency &&\n item?.field_type === \"currency\" && { option: item?.currency }),\n ...(item.field_type === \"text\" && {\n min_length:\n item.validation.find(\n (v: { type: string }) => v.type === \"min_length\",\n )?.value || null,\n }),\n ...(item.field_type === \"text\" && {\n max_length:\n item.validation.find(\n (v: { type: string }) => v.type === \"max_length\",\n )?.value || null,\n }),\n ...(item.field_type === \"number\" && {\n min_length:\n item.validation.find((v: { type: string }) => v.type === \"min_val\")\n ?.value || null,\n }),\n ...(item.field_type === \"number\" && {\n max_length:\n item.validation.find((v: { type: string }) => v.type === \"max_val\")\n ?.value || null,\n }),\n ...((item.is_multiline !== undefined || item.field_properties.is_multiline !== undefined) && {\n is_multiline: item.is_multiline || item.field_properties.is_multiline,\n }),\n is_required:\n item.validation.find((v: { type: string }) => v.type === \"required\")?.value ||\n thenValidations?.find((v: { type: string }) => v.type === \"required\")?.value ||\n false,\n is_unique:\n item.validation.find((v: { type: string }) => v.type === \"unique\")\n ?.value || false,\n section_order: item.section_order || 0,\n ...(item.field_properties.float_step && {\n float_step: item.field_properties.float_step.toString(),\n }),\n ...(item.field_properties.options && {\n options: item.field_properties.options,\n }),\n ...(item.field_properties.is_multiselect !== undefined && {\n is_multiselect: item.field_properties.is_multiselect,\n }),\n ...(item.field_properties?.enable_footer !== undefined && {\n enable_footer: Boolean(item.field_properties.enable_footer),\n }),\n ...(item.field_properties?.footer_action !== undefined && {\n footer_action: item.field_properties.footer_action || 'add',\n }),\n ...(item.field_type === \"date\" && {\n is_future_dates_allowed:\n item.validation.find(\n (v: { type: string }) => v.type === \"is_future_dates_allowed\",\n )?.value || null,\n }),\n ...(item.field_type === \"date\" && {\n is_past_dates_allowed:\n item.validation.find(\n (v: { type: string }) => v.type === \"is_past_dates_allowed\",\n )?.value || null,\n }),\n ...((item.field_type === \"image\" || item.field_type === \"media\" || item.field_type === \"file\") && {\n max_size:\n item.validation.find(\n (v: { type: string }) => v.type === \"max_file_size\",\n )?.value || undefined,\n is_multiple: item.field_properties?.is_multiple\n }),\n ...((item.field_type === \"toggleButton\" || item.field_type === \"checkbox\" || item.field_type === \"radioButton\") && {\n title: item.field_properties?.title ? item.field_properties?.title : '',\n title_position: item.field_properties?.title_position ?? \"end\",\n is_checked: item.field_properties?.is_checked\n }),\n ...((item.field_type === \"table\") && {\n table: item.field_properties?.table,\n table_columns: convertTableColumns(item.field_properties?.table_columns),\n table_rows: item.field_properties?.table_rows,\n otherButtons: item.field_properties?.other_buttons || []\n }),\n };\n if (currentSection) {\n currentSection.members.push(member);\n if (\n currentSection.members.some((member: any) => member.type === \"system\")\n ) {\n currentSection.remove_section = true;\n } else {\n currentSection.remove_section = false;\n }\n currentTab.remove_tab = currentTab.data.some(\n (section: { members: any[] }) =>\n section.members.some(\n (member: { type: string }) => member.type === \"system\",\n ),\n );\n }\n }\n });\n } else {\n // Convert to sections format\n outputData.section = [];\n let currentSection: {\n label: any;\n members: any;\n remove_section: any;\n field_type?: string;\n is_accordion?: boolean;\n } | null = null;\n let otherSectionDetails: any = {}\n let sectionOrder: any = null\n\n formData.forEach(\n (item: ItemType) => {\n if (item.is_section_field) {\n otherSectionDetails = {\n field_type: item?.field_type,\n label: item?.label,\n is_accordion: item?.is_accordion,\n is_section_field: item?.is_section_field,\n section_type: item?.section_type,\n form_switcher_label: item?.form_switcher_label,\n form_switcher_name: item?.form_switcher_name,\n switcher_forms: item?.switcher_forms,\n disabled: Boolean(item?.disabled)\n }\n sectionOrder = sectionOrder++\n currentSection = null\n } else {\n if (!currentSection || currentSection.label !== item.section_name || sectionOrder !== item.section_order) {\n currentSection = {\n field_type: \"section\",\n label: item.section_name || \"\",\n is_accordion: item.field_properties?.is_accordion,\n members: [],\n remove_section: item.is_system_field === true ? true : false,\n };\n\n const checkIfSectionExist = outputData?.section?.find(section => section.label === currentSection?.label)\n if (!checkIfSectionExist) {\n // Merge section details and update currentSection reference to the actual pushed object\n currentSection = { ...otherSectionDetails, ...currentSection };\n outputData.section.push(currentSection);\n } else {\n currentSection = checkIfSectionExist\n }\n\n // outputData.section.push({ ...otherSectionDetails, ...currentSection });\n\n otherSectionDetails = null\n }\n sectionOrder = item.section_order\n\n const thenValidations = item?.validation?.find((v: { type: string }) => v.type === \"when\")?.thenValidations || []\n\n const member = {\n ...item,\n id: `${Date.now()}-${Math.random()}`,\n field_type:\n item.field_type === \"media\" ? \"file\" : item.field_type || \"text\",\n type: item.is_system_field ? \"system\" : \"custom\",\n label: item.label,\n placeholder: item.placeholder || \"\",\n default_value: item.default_value || \"\",\n ...(item?.time_format &&\n item?.field_type === \"time\" && { option: item?.time_format }),\n ...(item?.currency &&\n item?.field_type === \"currency\" && { option: item?.currency }),\n ...(item.field_type === \"text\" && {\n min_length:\n item.validation.find(\n (v: { type: string }) => v.type === \"min_length\",\n )?.value || null,\n }),\n ...(item.field_type === \"text\" && {\n max_length:\n item.validation.find(\n (v: { type: string }) => v.type === \"max_length\",\n )?.value || null,\n }),\n ...(item.field_type === \"number\" && {\n min_length:\n item.validation.find(\n (v: { type: string }) => v.type === \"min_val\",\n )?.value || null,\n }),\n ...(item.field_type === \"number\" && {\n max_length:\n item.validation.find(\n (v: { type: string }) => v.type === \"max_val\",\n )?.value || null,\n }),\n ...((item.is_multiline !== undefined || item.field_properties?.is_multiline !== undefined) && {\n is_multiline: item.is_multiline || item.field_properties.is_multiline,\n }),\n is_required:\n item.validation.find((v: { type: string }) => v.type === \"required\")?.value ||\n thenValidations?.find((v: { type: string }) => v.type === \"required\")?.value ||\n false,\n is_unique:\n item.validation.find((v: { type: string }) => v.type === \"unique\")\n ?.value || false,\n section_order: item.section_order || 0,\n ...(item.field_properties?.float_step && {\n float_step: Number(item.field_properties.float_step),\n }),\n ...(item.field_properties?.options && {\n options: item.field_properties.options,\n }),\n ...(item.field_properties?.is_multiselect !== undefined && {\n is_multiselect: item.field_properties.is_multiselect,\n }),\n ...(item.field_properties?.enable_footer !== undefined && {\n enable_footer: Boolean(item.field_properties.enable_footer),\n }),\n ...(item.field_properties?.footer_action !== undefined && {\n footer_action: item.field_properties.footer_action || 'add',\n }),\n ...(item.field_type === \"date\" && {\n is_future_dates_allowed:\n item.validation.find(\n (v: { type: string }) => v.type === \"is_future_dates_allowed\",\n )?.value || null,\n }),\n ...(item.field_type === \"date\" && {\n is_past_dates_allowed:\n item.validation.find(\n (v: { type: string }) => v.type === \"is_past_dates_allowed\",\n )?.value || null,\n }),\n ...((item.field_type === \"image\" || item.field_type === \"media\" || item.field_type === \"file\") && {\n max_size:\n item.validation.find(\n (v: { type: string }) => v.type === \"max_file_size\",\n )?.value || undefined,\n is_multiple: item.field_properties?.is_multiple\n }),\n ...((item.field_type === \"toggleButton\" || item.field_type === \"checkbox\") && {\n title: item.field_properties?.title ? item.field_properties?.title : item.label,\n title_position: item.field_properties?.title_position ?? \"end\",\n is_checked: item.field_properties?.is_checked\n }),\n ...((item.field_type === \"table\") && {\n table: item.field_properties?.table,\n table_columns: convertTableColumns(item.field_properties?.table_columns),\n table_rows: item.field_properties?.table_rows,\n otherButtons: item.field_properties?.other_buttons || []\n }),\n };\n\n currentSection.members.push(member);\n if (\n currentSection.members.some((member: any) => member.type === \"system\")\n ) {\n currentSection.remove_section = true;\n } else {\n currentSection.remove_section = false;\n }\n }\n }\n );\n }\n\n return outputData;\n};\n\n\n\nfunction formatText(key: string): string {\n return key ? key\n .split(/[:_-]/)\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(\" \") : key;\n}\n\nexport const convertTableColumns = (columns: string[]) => {\n if (!Array.isArray(columns)) return [];\n\n return columns.map(column => {\n if (typeof column === 'object') {\n return { ...column }\n } else {\n const colArr = column.split(\".\").filter(str => str)\n const header = colArr.length ? (colArr.length > 1 ? formatText(colArr[colArr.length - 1]) : formatText(colArr[0])) : \"-\"\n\n return {\n header,\n accessorKey: column,\n visible: true,\n }\n }\n })\n}\n\nexport default formBuilderDeConversion;\n"],"names":["member"],"mappings":"AA2CA,MAAM,0BAA0B,CAAC,aAAoB;AACnD,QAAM,aAAa,qCAAU,KAAK,CAAC,UAAU,CAAC,MAAM;AACpD,SAAO;AACT;AAEA,MAAM,0BAA0B,CAAC,aAAkB;AACjD,QAAM,aAAkB,CAAA;AACxB,MAAI,SAAS,WAAW,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Property(exports,"__esModule",{value:!0});const e=e=>{const l={};if(0===e.length)return l;const t=(e=>null==e?void 0:e.find(e=>!e.is_section_field))(e);if(null==t?void 0:t.tab_name){l.tab=[];let t=null,o=null,n={},d=null;e.forEach(e=>{var _,s,r,a,u,p,f,v,m,c,y,b,h,w,x,g,q,B,k,z,$,j,A,C;if(null==e?void 0:e.is_section_field)n={field_type:null==e?void 0:e.field_type,label:null==e?void 0:e.label,is_accordion:null==e?void 0:e.is_accordion,is_section_field:null==e?void 0:e.is_section_field,section_type:null==e?void 0:e.section_type,form_switcher_label:null==e?void 0:e.form_switcher_label,form_switcher_name:null==e?void 0:e.form_switcher_name,switcher_forms:null==e?void 0:e.switcher_forms,disabled:Boolean(null==e?void 0:e.disabled)},o=null,d=d++;else{if(!t||t.title!==e.tab_name){t={tab_order:e.tab_order||1,title:e.tab_name,data:[]};const i=l.tab.find(e=>e.title===(null==t?void 0:t.title));i?t=i:l.tab.push(t),o=null}if(!o||o.label!==e.section_name||d!==e.section_order){o={field_type:"section",label:e.section_name||"",is_accordion:null==(_=e.field_properties)?void 0:_.is_accordion,members:[],remove_section:!0===e.is_system_field};const l=t.data.find(e=>e.label===(null==o?void 0:o.label));l?o=l:t.data.push({...n,...o}),n=null}d=e.section_order;const D=(null==(r=null==(s=null==e?void 0:e.validation)?void 0:s.find(e=>"when"===e.type))?void 0:r.thenValidations)||[],M={...e,id:`${Date.now()}-${Math.random()}`,field_type:"media"===e.field_type?"file":e.field_type||"text",type:e.is_system_field?"system":"custom",label:e.label||"",placeholder:e.placeholder||"",default_value:e.default_value||"",...(null==e?void 0:e.time_format)&&"time"===(null==e?void 0:e.field_type)&&{option:null==e?void 0:e.time_format},...(null==e?void 0:e.currency)&&"currency"===(null==e?void 0:e.field_type)&&{option:null==e?void 0:e.currency},..."text"===e.field_type&&{min_length:(null==(a=e.validation.find(e=>"min_length"===e.type))?void 0:a.value)||null},..."text"===e.field_type&&{max_length:(null==(u=e.validation.find(e=>"max_length"===e.type))?void 0:u.value)||null},..."number"===e.field_type&&{min_length:(null==(p=e.validation.find(e=>"min_val"===e.type))?void 0:p.value)||null},..."number"===e.field_type&&{max_length:(null==(f=e.validation.find(e=>"max_val"===e.type))?void 0:f.value)||null},...(void 0!==e.is_multiline||void 0!==e.field_properties.is_multiline)&&{is_multiline:e.is_multiline||e.field_properties.is_multiline},is_required:(null==(v=e.validation.find(e=>"required"===e.type))?void 0:v.value)||(null==(m=null==D?void 0:D.find(e=>"required"===e.type))?void 0:m.value)||!1,is_unique:(null==(c=e.validation.find(e=>"unique"===e.type))?void 0:c.value)||!1,section_order:e.section_order||0,...e.field_properties.float_step&&{float_step:e.field_properties.float_step.toString()},...e.field_properties.options&&{options:e.field_properties.options},...void 0!==e.field_properties.is_multiselect&&{is_multiselect:e.field_properties.is_multiselect},...void 0!==(null==(y=e.field_properties)?void 0:y.enable_footer)&&{enable_footer:Boolean(e.field_properties.enable_footer)},...void 0!==(null==(b=e.field_properties)?void 0:b.footer_action)&&{footer_action:e.field_properties.footer_action||"add"},..."date"===e.field_type&&{is_future_dates_allowed:(null==(h=e.validation.find(e=>"is_future_dates_allowed"===e.type))?void 0:h.value)||null},..."date"===e.field_type&&{is_past_dates_allowed:(null==(w=e.validation.find(e=>"is_past_dates_allowed"===e.type))?void 0:w.value)||null},...("image"===e.field_type||"media"===e.field_type||"file"===e.field_type)&&{max_size:(null==(x=e.validation.find(e=>"max_file_size"===e.type))?void 0:x.value)||void 0,is_multiple:null==(g=e.field_properties)?void 0:g.is_multiple},...("toggleButton"===e.field_type||"checkbox"===e.field_type||"radioButton"===e.field_type)&&{title:(null==(q=e.field_properties)?void 0:q.title)?null==(B=e.field_properties)?void 0:B.title:"",title_position:(null==(k=e.field_properties)?void 0:k.title_position)??"end",is_checked:null==(z=e.field_properties)?void 0:z.is_checked},..."table"===e.field_type&&{table:null==($=e.field_properties)?void 0:$.table,table_columns:i(null==(j=e.field_properties)?void 0:j.table_columns),table_rows:null==(A=e.field_properties)?void 0:A.table_rows,otherButtons:(null==(C=e.field_properties)?void 0:C.other_buttons)||[]}};o&&(o.members.push(M),o.members.some(e=>"system"===e.type)?o.remove_section=!0:o.remove_section=!1,t.remove_tab=t.data.some(e=>e.members.some(e=>"system"===e.type)))}})}else{l.section=[];let t=null,o={},n=null;e.forEach(e=>{var d,_,s,r,a,u,p,f,v,m,c,y,b,h,w,x,g,q,B,k,z,$,j,A,C,D,M,E,V;if(e.is_section_field)o={field_type:null==e?void 0:e.field_type,label:null==e?void 0:e.label,is_accordion:null==e?void 0:e.is_accordion,is_section_field:null==e?void 0:e.is_section_field,section_type:null==e?void 0:e.section_type,form_switcher_label:null==e?void 0:e.form_switcher_label,form_switcher_name:null==e?void 0:e.form_switcher_name,switcher_forms:null==e?void 0:e.switcher_forms,disabled:Boolean(null==e?void 0:e.disabled)},n=n++,t=null;else{if(!t||t.label!==e.section_name||n!==e.section_order){t={field_type:"section",label:e.section_name||"",is_accordion:null==(d=e.field_properties)?void 0:d.is_accordion,members:[],remove_section:!0===e.is_system_field};const i=null==(_=null==l?void 0:l.section)?void 0:_.find(e=>e.label===(null==t?void 0:t.label));i?t=i:l.section.push({...o,...t}),o=null}n=e.section_order;const K=(null==(r=null==(s=null==e?void 0:e.validation)?void 0:s.find(e=>"when"===e.type))?void 0:r.thenValidations)||[],N={...e,id:`${Date.now()}-${Math.random()}`,field_type:"media"===e.field_type?"file":e.field_type||"text",type:e.is_system_field?"system":"custom",label:e.label,placeholder:e.placeholder||"",default_value:e.default_value||"",...(null==e?void 0:e.time_format)&&"time"===(null==e?void 0:e.field_type)&&{option:null==e?void 0:e.time_format},...(null==e?void 0:e.currency)&&"currency"===(null==e?void 0:e.field_type)&&{option:null==e?void 0:e.currency},..."text"===e.field_type&&{min_length:(null==(a=e.validation.find(e=>"min_length"===e.type))?void 0:a.value)||null},..."text"===e.field_type&&{max_length:(null==(u=e.validation.find(e=>"max_length"===e.type))?void 0:u.value)||null},..."number"===e.field_type&&{min_length:(null==(p=e.validation.find(e=>"min_val"===e.type))?void 0:p.value)||null},..."number"===e.field_type&&{max_length:(null==(f=e.validation.find(e=>"max_val"===e.type))?void 0:f.value)||null},...(void 0!==e.is_multiline||void 0!==(null==(v=e.field_properties)?void 0:v.is_multiline))&&{is_multiline:e.is_multiline||e.field_properties.is_multiline},is_required:(null==(m=e.validation.find(e=>"required"===e.type))?void 0:m.value)||(null==(c=null==K?void 0:K.find(e=>"required"===e.type))?void 0:c.value)||!1,is_unique:(null==(y=e.validation.find(e=>"unique"===e.type))?void 0:y.value)||!1,section_order:e.section_order||0,...(null==(b=e.field_properties)?void 0:b.float_step)&&{float_step:Number(e.field_properties.float_step)},...(null==(h=e.field_properties)?void 0:h.options)&&{options:e.field_properties.options},...void 0!==(null==(w=e.field_properties)?void 0:w.is_multiselect)&&{is_multiselect:e.field_properties.is_multiselect},...void 0!==(null==(x=e.field_properties)?void 0:x.enable_footer)&&{enable_footer:Boolean(e.field_properties.enable_footer)},...void 0!==(null==(g=e.field_properties)?void 0:g.footer_action)&&{footer_action:e.field_properties.footer_action||"add"},..."date"===e.field_type&&{is_future_dates_allowed:(null==(q=e.validation.find(e=>"is_future_dates_allowed"===e.type))?void 0:q.value)||null},..."date"===e.field_type&&{is_past_dates_allowed:(null==(B=e.validation.find(e=>"is_past_dates_allowed"===e.type))?void 0:B.value)||null},...("image"===e.field_type||"media"===e.field_type||"file"===e.field_type)&&{max_size:(null==(k=e.validation.find(e=>"max_file_size"===e.type))?void 0:k.value)||void 0,is_multiple:null==(z=e.field_properties)?void 0:z.is_multiple},...("toggleButton"===e.field_type||"checkbox"===e.field_type)&&{title:(null==($=e.field_properties)?void 0:$.title)?null==(j=e.field_properties)?void 0:j.title:e.label,title_position:(null==(A=e.field_properties)?void 0:A.title_position)??"end",is_checked:null==(C=e.field_properties)?void 0:C.is_checked},..."table"===e.field_type&&{table:null==(D=e.field_properties)?void 0:D.table,table_columns:i(null==(M=e.field_properties)?void 0:M.table_columns),table_rows:null==(E=e.field_properties)?void 0:E.table_rows,otherButtons:(null==(V=e.field_properties)?void 0:V.other_buttons)||[]}};t.members.push(N),t.members.some(e=>"system"===e.type)?t.remove_section=!0:t.remove_section=!1}})}return l};function l(e){return e?e.split(/[:_-]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):e}const i=e=>Array.isArray(e)?e.map(e=>{if("object"==typeof e)return{...e};{const i=e.split(".").filter(e=>e);return{header:i.length?i.length>1?l(i[i.length-1]):l(i[0]):"-",accessorKey:e,visible:!0}}}):[];exports.convertTableColumns=i,exports.default=e,exports.formBuilderDeConversion=e;
1
+ "use strict";function e(e){return e?e.split(/[:_-]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):e}Object.defineProperty(exports,"__esModule",{value:!0});const l=l=>Array.isArray(l)?l.map(l=>{if("object"==typeof l)return{...l};{const i=l.split(".").filter(e=>e);return{header:i.length?i.length>1?e(i[i.length-1]):e(i[0]):"-",accessorKey:l,visible:!0}}}):[];exports.convertTableColumns=l,exports.default=e=>{const i={};if(0===e.length)return i;const t=(e=>null==e?void 0:e.find(e=>!e.is_section_field))(e);if(null==t?void 0:t.tab_name){i.tab=[];let t=null,o=null,d={},n=null;e.forEach(e=>{var _,s,r,a,u,p,f,v,m,c,y,b,h,w,g,x,q,B,k,z,$,j,A,M;if(null==e?void 0:e.is_section_field)d={field_type:null==e?void 0:e.field_type,label:null==e?void 0:e.label,is_accordion:null==e?void 0:e.is_accordion,is_section_field:null==e?void 0:e.is_section_field,section_type:null==e?void 0:e.section_type,form_switcher_label:null==e?void 0:e.form_switcher_label,form_switcher_name:null==e?void 0:e.form_switcher_name,switcher_forms:null==e?void 0:e.switcher_forms,disabled:Boolean(null==e?void 0:e.disabled)},o=null,n=n++;else{if(!t||t.title!==e.tab_name){t={tab_order:e.tab_order||1,title:e.tab_name,data:[]};const l=i.tab.find(e=>e.title===(null==t?void 0:t.title));l?t=l:i.tab.push(t),o=null}if(!o||o.label!==e.section_name||n!==e.section_order){o={field_type:"section",label:e.section_name||"",is_accordion:null==(_=e.field_properties)?void 0:_.is_accordion,members:[],remove_section:!0===e.is_system_field};const l=t.data.find(e=>e.label===(null==o?void 0:o.label));l?o=l:(o={...d,...o},t.data.push(o)),d=null}n=e.section_order;const C=(null==(r=null==(s=null==e?void 0:e.validation)?void 0:s.find(e=>"when"===e.type))?void 0:r.thenValidations)||[],D={...e,id:`${Date.now()}-${Math.random()}`,field_type:"media"===e.field_type?"file":e.field_type||"text",type:e.is_system_field?"system":"custom",label:e.label||"",placeholder:e.placeholder||"",default_value:e.default_value||"",...(null==e?void 0:e.time_format)&&"time"===(null==e?void 0:e.field_type)&&{option:null==e?void 0:e.time_format},...(null==e?void 0:e.currency)&&"currency"===(null==e?void 0:e.field_type)&&{option:null==e?void 0:e.currency},..."text"===e.field_type&&{min_length:(null==(a=e.validation.find(e=>"min_length"===e.type))?void 0:a.value)||null},..."text"===e.field_type&&{max_length:(null==(u=e.validation.find(e=>"max_length"===e.type))?void 0:u.value)||null},..."number"===e.field_type&&{min_length:(null==(p=e.validation.find(e=>"min_val"===e.type))?void 0:p.value)||null},..."number"===e.field_type&&{max_length:(null==(f=e.validation.find(e=>"max_val"===e.type))?void 0:f.value)||null},...(void 0!==e.is_multiline||void 0!==e.field_properties.is_multiline)&&{is_multiline:e.is_multiline||e.field_properties.is_multiline},is_required:(null==(v=e.validation.find(e=>"required"===e.type))?void 0:v.value)||(null==(m=null==C?void 0:C.find(e=>"required"===e.type))?void 0:m.value)||!1,is_unique:(null==(c=e.validation.find(e=>"unique"===e.type))?void 0:c.value)||!1,section_order:e.section_order||0,...e.field_properties.float_step&&{float_step:e.field_properties.float_step.toString()},...e.field_properties.options&&{options:e.field_properties.options},...void 0!==e.field_properties.is_multiselect&&{is_multiselect:e.field_properties.is_multiselect},...void 0!==(null==(y=e.field_properties)?void 0:y.enable_footer)&&{enable_footer:Boolean(e.field_properties.enable_footer)},...void 0!==(null==(b=e.field_properties)?void 0:b.footer_action)&&{footer_action:e.field_properties.footer_action||"add"},..."date"===e.field_type&&{is_future_dates_allowed:(null==(h=e.validation.find(e=>"is_future_dates_allowed"===e.type))?void 0:h.value)||null},..."date"===e.field_type&&{is_past_dates_allowed:(null==(w=e.validation.find(e=>"is_past_dates_allowed"===e.type))?void 0:w.value)||null},...("image"===e.field_type||"media"===e.field_type||"file"===e.field_type)&&{max_size:(null==(g=e.validation.find(e=>"max_file_size"===e.type))?void 0:g.value)||void 0,is_multiple:null==(x=e.field_properties)?void 0:x.is_multiple},...("toggleButton"===e.field_type||"checkbox"===e.field_type||"radioButton"===e.field_type)&&{title:(null==(q=e.field_properties)?void 0:q.title)?null==(B=e.field_properties)?void 0:B.title:"",title_position:(null==(k=e.field_properties)?void 0:k.title_position)??"end",is_checked:null==(z=e.field_properties)?void 0:z.is_checked},..."table"===e.field_type&&{table:null==($=e.field_properties)?void 0:$.table,table_columns:l(null==(j=e.field_properties)?void 0:j.table_columns),table_rows:null==(A=e.field_properties)?void 0:A.table_rows,otherButtons:(null==(M=e.field_properties)?void 0:M.other_buttons)||[]}};o&&(o.members.push(D),o.members.some(e=>"system"===e.type)?o.remove_section=!0:o.remove_section=!1,t.remove_tab=t.data.some(e=>e.members.some(e=>"system"===e.type)))}})}else{i.section=[];let t=null,o={},d=null;e.forEach(e=>{var n,_,s,r,a,u,p,f,v,m,c,y,b,h,w,g,x,q,B,k,z,$,j,A,M,C,D,E,V;if(e.is_section_field)o={field_type:null==e?void 0:e.field_type,label:null==e?void 0:e.label,is_accordion:null==e?void 0:e.is_accordion,is_section_field:null==e?void 0:e.is_section_field,section_type:null==e?void 0:e.section_type,form_switcher_label:null==e?void 0:e.form_switcher_label,form_switcher_name:null==e?void 0:e.form_switcher_name,switcher_forms:null==e?void 0:e.switcher_forms,disabled:Boolean(null==e?void 0:e.disabled)},d=d++,t=null;else{if(!t||t.label!==e.section_name||d!==e.section_order){t={field_type:"section",label:e.section_name||"",is_accordion:null==(n=e.field_properties)?void 0:n.is_accordion,members:[],remove_section:!0===e.is_system_field};const l=null==(_=null==i?void 0:i.section)?void 0:_.find(e=>e.label===(null==t?void 0:t.label));l?t=l:(t={...o,...t},i.section.push(t)),o=null}d=e.section_order;const K=(null==(r=null==(s=null==e?void 0:e.validation)?void 0:s.find(e=>"when"===e.type))?void 0:r.thenValidations)||[],N={...e,id:`${Date.now()}-${Math.random()}`,field_type:"media"===e.field_type?"file":e.field_type||"text",type:e.is_system_field?"system":"custom",label:e.label,placeholder:e.placeholder||"",default_value:e.default_value||"",...(null==e?void 0:e.time_format)&&"time"===(null==e?void 0:e.field_type)&&{option:null==e?void 0:e.time_format},...(null==e?void 0:e.currency)&&"currency"===(null==e?void 0:e.field_type)&&{option:null==e?void 0:e.currency},..."text"===e.field_type&&{min_length:(null==(a=e.validation.find(e=>"min_length"===e.type))?void 0:a.value)||null},..."text"===e.field_type&&{max_length:(null==(u=e.validation.find(e=>"max_length"===e.type))?void 0:u.value)||null},..."number"===e.field_type&&{min_length:(null==(p=e.validation.find(e=>"min_val"===e.type))?void 0:p.value)||null},..."number"===e.field_type&&{max_length:(null==(f=e.validation.find(e=>"max_val"===e.type))?void 0:f.value)||null},...(void 0!==e.is_multiline||void 0!==(null==(v=e.field_properties)?void 0:v.is_multiline))&&{is_multiline:e.is_multiline||e.field_properties.is_multiline},is_required:(null==(m=e.validation.find(e=>"required"===e.type))?void 0:m.value)||(null==(c=null==K?void 0:K.find(e=>"required"===e.type))?void 0:c.value)||!1,is_unique:(null==(y=e.validation.find(e=>"unique"===e.type))?void 0:y.value)||!1,section_order:e.section_order||0,...(null==(b=e.field_properties)?void 0:b.float_step)&&{float_step:Number(e.field_properties.float_step)},...(null==(h=e.field_properties)?void 0:h.options)&&{options:e.field_properties.options},...void 0!==(null==(w=e.field_properties)?void 0:w.is_multiselect)&&{is_multiselect:e.field_properties.is_multiselect},...void 0!==(null==(g=e.field_properties)?void 0:g.enable_footer)&&{enable_footer:Boolean(e.field_properties.enable_footer)},...void 0!==(null==(x=e.field_properties)?void 0:x.footer_action)&&{footer_action:e.field_properties.footer_action||"add"},..."date"===e.field_type&&{is_future_dates_allowed:(null==(q=e.validation.find(e=>"is_future_dates_allowed"===e.type))?void 0:q.value)||null},..."date"===e.field_type&&{is_past_dates_allowed:(null==(B=e.validation.find(e=>"is_past_dates_allowed"===e.type))?void 0:B.value)||null},...("image"===e.field_type||"media"===e.field_type||"file"===e.field_type)&&{max_size:(null==(k=e.validation.find(e=>"max_file_size"===e.type))?void 0:k.value)||void 0,is_multiple:null==(z=e.field_properties)?void 0:z.is_multiple},...("toggleButton"===e.field_type||"checkbox"===e.field_type)&&{title:(null==($=e.field_properties)?void 0:$.title)?null==(j=e.field_properties)?void 0:j.title:e.label,title_position:(null==(A=e.field_properties)?void 0:A.title_position)??"end",is_checked:null==(M=e.field_properties)?void 0:M.is_checked},..."table"===e.field_type&&{table:null==(C=e.field_properties)?void 0:C.table,table_columns:l(null==(D=e.field_properties)?void 0:D.table_columns),table_rows:null==(E=e.field_properties)?void 0:E.table_rows,otherButtons:(null==(V=e.field_properties)?void 0:V.other_buttons)||[]}};t.members.push(N),t.members.some(e=>"system"===e.type)?t.remove_section=!0:t.remove_section=!1}})}return i};
2
2
  //# sourceMappingURL=index.js.map