impact-ui 3.7.25 → 4.0.0-alpha.10

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 (465) hide show
  1. package/MIGRATION_GUIDE.md +328 -0
  2. package/README.md +154 -15
  3. package/bin/migrate-image-paths.cjs +127 -0
  4. package/bin/migrate.js +293 -0
  5. package/codemods/component-map.js +153 -0
  6. package/codemods/image-paths-transform.js +69 -0
  7. package/codemods/transform.js +136 -0
  8. package/dist/components/Accordion/index.js +2 -1
  9. package/dist/components/AccordionModern/index.js +2 -1
  10. package/dist/components/Alert/index.js +2 -1
  11. package/dist/components/Avatar/index.js +2 -1
  12. package/dist/components/Badge/filled/filledIconLabelBadges/index.js +2 -1
  13. package/dist/components/Badge/filled/filledOnlyIconBadges/index.js +2 -1
  14. package/dist/components/Badge/filled/filledOnlyLabelBadges/index.js +2 -1
  15. package/dist/components/Badge/index.js +3 -2
  16. package/dist/components/Badge/stroke/strokeIconLabelBadges/index.js +2 -1
  17. package/dist/components/Badge/stroke/strokeOnlyIconBadges/index.js +2 -1
  18. package/dist/components/Badge/stroke/strokeOnlyLabelBadges/index.js +2 -1
  19. package/dist/components/Badge/subtle/subtleIOnlyIconBadges/index.js +2 -1
  20. package/dist/components/Badge/subtle/subtleIconLabelBadges/index.js +2 -1
  21. package/dist/components/Badge/subtle/subtleOnlyLabelBadges/index.js +2 -1
  22. package/dist/components/BottomSheet/index.js +2 -1
  23. package/dist/components/Breadcrumbs/index.js +2 -1
  24. package/dist/components/Button/index.js +2 -1
  25. package/dist/components/ButtonGroup/index.js +2 -1
  26. package/dist/components/Card/index.js +2 -1
  27. package/dist/components/Chart/index.js +2 -1
  28. package/dist/components/Chatbot/index.js +2 -1
  29. package/dist/components/Checkbox/index.js +2 -1
  30. package/dist/components/Chips/index.js +2 -1
  31. package/dist/components/CreateItemFlow/index.js +2 -1
  32. package/dist/components/DatePicker/datePickerDropdown.js +2 -1
  33. package/dist/components/DatePicker/index.js +3 -2
  34. package/dist/components/DateRangePicker/dateRangePickerDropdown.js +2 -1
  35. package/dist/components/DateRangePicker/index.js +3 -2
  36. package/dist/components/DynamicLayout/index.js +2 -1
  37. package/dist/components/EmptyState/EmptyStateImage.d.ts.map +1 -1
  38. package/dist/components/EmptyState/EmptyStateImage.js +3 -2
  39. package/dist/components/EmptyState/index.js +2 -1
  40. package/dist/components/FileUpload/index.js +2 -1
  41. package/dist/components/FilterPanel/index.js +2 -1
  42. package/dist/components/FiltersStrip/index.js +2 -1
  43. package/dist/components/Header/index.js +2 -1
  44. package/dist/components/HomePage/index.js +2 -1
  45. package/dist/components/Input/index.js +2 -1
  46. package/dist/components/Loader/index.js +2 -1
  47. package/dist/components/Menu/IconMenuItem.js +2 -1
  48. package/dist/components/Menu/MenuHeaderInfo.js +2 -1
  49. package/dist/components/Menu/NestedMenuItem.js +2 -1
  50. package/dist/components/Menu/index.js +2 -1
  51. package/dist/components/Menu/nestedMenuItemsFromObject.js +2 -1
  52. package/dist/components/Modal/index.js +2 -1
  53. package/dist/components/Notification/NotificationBody/NotificationList/NotificationList.js +2 -1
  54. package/dist/components/Notification/index.js +2 -1
  55. package/dist/components/Panel/index.js +2 -1
  56. package/dist/components/Popover/index.js +2 -1
  57. package/dist/components/ProgressBar/index.js +2 -1
  58. package/dist/components/Prompt/index.js +2 -1
  59. package/dist/components/RadioButtonGroup/index.js +2 -1
  60. package/dist/components/Select/index.js +2 -1
  61. package/dist/components/Sidebar/index.js +2 -1
  62. package/dist/components/Slider/index.js +2 -1
  63. package/dist/components/Stepper/index.js +2 -1
  64. package/dist/components/Switch/index.js +2 -1
  65. package/dist/components/Table/TableImpl.js +4 -3
  66. package/dist/components/TableChat/EmptyContainer.js +2 -1
  67. package/dist/components/TableChat/TableChatSidePanel.js +2 -1
  68. package/dist/components/TableChat/components/ChatMessageSkeleton/ChatFooterSkeleton.js +2 -1
  69. package/dist/components/TableChat/components/ChatMessageSkeleton/ChatHeaderSkeleton.js +2 -1
  70. package/dist/components/TableChat/components/ChatMessageSkeleton/ChatMessageListSkeleton.js +2 -1
  71. package/dist/components/TableChat/components/ChatMessageSkeleton/ChatSkeleton.js +2 -1
  72. package/dist/components/TableChat/components/TableChatLeftSection/AddChatContainer/AddChatContainer.js +2 -1
  73. package/dist/components/TableChat/components/TableChatLeftSection/TableChatChannelHeader.js +2 -1
  74. package/dist/components/TableChat/components/TableChatRightSection/AvatarGroup/AvatarGroup.js +2 -1
  75. package/dist/components/TableChat/components/TableChatRightSection/ChatDefaultMessageType/ChatDefaultMessageType.js +2 -1
  76. package/dist/components/TableChat/components/TableChatRightSection/ChatDeleteMessageType/ChatDeletedMessageType.js +2 -1
  77. package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeader.js +2 -1
  78. package/dist/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.js +2 -1
  79. package/dist/components/TableChat/components/TableChatRightSection/ChatMessageAvatar/ChatMessageAvatar.js +2 -1
  80. package/dist/components/TableChat/components/TableChatRightSection/ChatMessages/ChatMessage.js +2 -1
  81. package/dist/components/TableChat/components/TableChatRightSection/ChatNotificationSettings/ChatNotificationSettings.js +2 -1
  82. package/dist/components/TableChat/components/TableChatRightSection/DateSeparator/DateSeparator.js +2 -1
  83. package/dist/components/TableChat/components/TableChatRightSection/PinedChatPanel/PinedChatPanel.js +2 -1
  84. package/dist/components/TableChat/components/TableChatRightSection/TableChatRightSection.js +2 -1
  85. package/dist/components/TableChat/components/TextEditor/EditorToolbar.js +2 -1
  86. package/dist/components/TableChat/components/TextEditor/Mention.js +2 -1
  87. package/dist/components/TableChat/components/TextEditor/MentionList.js +2 -1
  88. package/dist/components/Tabs/index.js +2 -1
  89. package/dist/components/Tag/index.js +2 -1
  90. package/dist/components/TagGroup/index.js +2 -1
  91. package/dist/components/TextArea/index.js +2 -1
  92. package/dist/components/Toast/index.js +2 -1
  93. package/dist/components/Tooltip/index.js +2 -1
  94. package/dist/components/common/HelperText/index.js +2 -1
  95. package/dist/components/index.d.ts +0 -1
  96. package/dist/components/index.d.ts.map +1 -1
  97. package/dist/components/index.js +0 -1
  98. package/dist/mcp-component-registry.json +1 -1
  99. package/dist/styles/entry.d.ts +2 -0
  100. package/dist/styles/entry.d.ts.map +1 -0
  101. package/dist/styles/entry.js +1 -0
  102. package/dist/styles/style.css +1 -1
  103. package/eslint-plugin/index.js +91 -0
  104. package/eslint-plugin/rules/no-barrel-import.js +224 -0
  105. package/package.json +153 -89
  106. package/dist/0db32db10ae1525f.svg +0 -9
  107. package/dist/2bc76319b1fa572e.svg +0 -9
  108. package/dist/39d49e4daed1a992.svg +0 -9
  109. package/dist/44beedf64dc29d19.svg +0 -9
  110. package/dist/49a4f914058314f1.svg +0 -9
  111. package/dist/6fc8a59d621a04a1.svg +0 -13
  112. package/dist/78f845dcfc981491.svg +0 -9
  113. package/dist/b31c0c2a19c1c19a.svg +0 -9
  114. package/dist/index.js +0 -308
  115. package/dist/index.js.map +0 -1
  116. package/src/components/Accordion/Accordion.styles.scss +0 -118
  117. package/src/components/Accordion/index.js +0 -104
  118. package/src/components/AccordionModern/AccordionModern.styles.scss +0 -121
  119. package/src/components/AccordionModern/SortableAccordionComp.js +0 -156
  120. package/src/components/AccordionModern/index.js +0 -103
  121. package/src/components/Alert/Alert.styles.scss +0 -131
  122. package/src/components/Alert/index.js +0 -71
  123. package/src/components/Avatar/Avatar.styles.scss +0 -25
  124. package/src/components/Avatar/index.js +0 -58
  125. package/src/components/Badge/Badges.style.scss +0 -55
  126. package/src/components/Badge/filled/filledIconLabelBadges/filledIconLabelBadges.styles.scss +0 -32
  127. package/src/components/Badge/filled/filledIconLabelBadges/index.js +0 -38
  128. package/src/components/Badge/filled/filledOnlyIconBadges/filledOnlyIconBadges.styles.scss +0 -26
  129. package/src/components/Badge/filled/filledOnlyIconBadges/index.js +0 -31
  130. package/src/components/Badge/filled/filledOnlyLabelBadges/filledOnlyLabelBadges.styles.scss +0 -66
  131. package/src/components/Badge/filled/filledOnlyLabelBadges/index.js +0 -31
  132. package/src/components/Badge/filled/index.js +0 -30
  133. package/src/components/Badge/index.js +0 -53
  134. package/src/components/Badge/stroke/index.js +0 -43
  135. package/src/components/Badge/stroke/strokeIconLabelBadges/index.js +0 -38
  136. package/src/components/Badge/stroke/strokeIconLabelBadges/strokeIconLabelBadges.styles.scss +0 -33
  137. package/src/components/Badge/stroke/strokeOnlyIconBadges/index.js +0 -31
  138. package/src/components/Badge/stroke/strokeOnlyIconBadges/strokeOnlyIconBadges.styles.scss +0 -27
  139. package/src/components/Badge/stroke/strokeOnlyLabelBadges/index.js +0 -31
  140. package/src/components/Badge/stroke/strokeOnlyLabelBadges/strokeOnlyLabelBadges.styles.scss +0 -89
  141. package/src/components/Badge/styles.css +0 -52
  142. package/src/components/Badge/subtle/index.js +0 -41
  143. package/src/components/Badge/subtle/subtleIOnlyIconBadges/index.js +0 -31
  144. package/src/components/Badge/subtle/subtleIOnlyIconBadges/subtleIOnlyIconBadges.scss +0 -26
  145. package/src/components/Badge/subtle/subtleIconLabelBadges/index.js +0 -38
  146. package/src/components/Badge/subtle/subtleIconLabelBadges/subtleIconLabelBadges.scss +0 -56
  147. package/src/components/Badge/subtle/subtleOnlyLabelBadges/index.js +0 -31
  148. package/src/components/Badge/subtle/subtleOnlyLabelBadges/subtleOnlyLabelBadges.scss +0 -70
  149. package/src/components/BottomSheet/BottomSheet.styles.scss +0 -46
  150. package/src/components/BottomSheet/index.js +0 -60
  151. package/src/components/Breadcrumbs/Breadcrumbs.styles.scss +0 -65
  152. package/src/components/Breadcrumbs/index.js +0 -121
  153. package/src/components/Button/Button.styles.scss +0 -345
  154. package/src/components/Button/index.js +0 -171
  155. package/src/components/ButtonGroup/ButtonGroup.styles.scss +0 -125
  156. package/src/components/ButtonGroup/index.js +0 -84
  157. package/src/components/Card/Card.styles.scss +0 -33
  158. package/src/components/Card/index.js +0 -21
  159. package/src/components/Chart/Chart.style.scss +0 -142
  160. package/src/components/Chart/index.js +0 -752
  161. package/src/components/ChatBot/bookMarkPanel.js +0 -74
  162. package/src/components/ChatBot/chatBot.style.scss +0 -1295
  163. package/src/components/ChatBot/chatBotFooter.js +0 -14
  164. package/src/components/ChatBot/chatBotLandingScreen.js +0 -26
  165. package/src/components/ChatBot/chatInput.js +0 -206
  166. package/src/components/ChatBot/chatbotModuleMenu.js +0 -278
  167. package/src/components/ChatBot/constant.js +0 -32
  168. package/src/components/ChatBot/conversationScreen.js +0 -281
  169. package/src/components/ChatBot/customScreen.js +0 -69
  170. package/src/components/ChatBot/historyPanel.js +0 -579
  171. package/src/components/ChatBot/index.js +0 -473
  172. package/src/components/ChatBot/newChatComponent.js +0 -105
  173. package/src/components/ChatBot/utils.js +0 -27
  174. package/src/components/Checkbox/Checkbox.styles.scss +0 -232
  175. package/src/components/Checkbox/dashed/index.js +0 -34
  176. package/src/components/Checkbox/default/index.js +0 -70
  177. package/src/components/Checkbox/index.js +0 -50
  178. package/src/components/Checkbox/withDropDown/index.js +0 -96
  179. package/src/components/Checkbox/withoutFormLabel/index.js +0 -46
  180. package/src/components/Chips/Chip.style.scss +0 -134
  181. package/src/components/Chips/index.js +0 -34
  182. package/src/components/CreateItemFlow/CreateItemFlow.styles.scss +0 -37
  183. package/src/components/CreateItemFlow/index.js +0 -145
  184. package/src/components/DatePicker/DatePicker.styles.scss +0 -519
  185. package/src/components/DatePicker/datePickerDropdown.js +0 -282
  186. package/src/components/DatePicker/datePickerFooter.js +0 -76
  187. package/src/components/DatePicker/datePickerInput.js +0 -333
  188. package/src/components/DatePicker/index.js +0 -288
  189. package/src/components/DatePicker/showMonthYearSelect.js +0 -119
  190. package/src/components/DateRangePicker/DateRangePicker.styles.scss +0 -635
  191. package/src/components/DateRangePicker/dateRangePickerCustom.js +0 -22
  192. package/src/components/DateRangePicker/dateRangePickerDropdown.js +0 -320
  193. package/src/components/DateRangePicker/dateRangePickerFooter.js +0 -50
  194. package/src/components/DateRangePicker/dateRangePickerInput.js +0 -544
  195. package/src/components/DateRangePicker/index.js +0 -393
  196. package/src/components/DateRangePicker/showMonthYearSelect.js +0 -103
  197. package/src/components/DateRangePicker/utils.js +0 -71
  198. package/src/components/DynamicLayout/DynamicLayout.styles.scss +0 -153
  199. package/src/components/DynamicLayout/index.js +0 -73
  200. package/src/components/EmptyState/EmptyState.styles.scss +0 -88
  201. package/src/components/EmptyState/EmptyStateImageComponent.jsx +0 -36
  202. package/src/components/EmptyState/index.js +0 -54
  203. package/src/components/FileUpload/FileUpload.styles.scss +0 -449
  204. package/src/components/FileUpload/index.js +0 -641
  205. package/src/components/FilterPanel/FilterPanel.styles.scss +0 -241
  206. package/src/components/FilterPanel/FilterPanelHeader.js +0 -15
  207. package/src/components/FilterPanel/PanelFooter.js +0 -65
  208. package/src/components/FilterPanel/PanelSidebar.js +0 -85
  209. package/src/components/FilterPanel/index.js +0 -147
  210. package/src/components/FiltersStrip/FiltersStrip.styles.scss +0 -343
  211. package/src/components/FiltersStrip/Slider/FilterSlider.styles.scss +0 -85
  212. package/src/components/FiltersStrip/Slider/Portal.js +0 -59
  213. package/src/components/FiltersStrip/Slider/index.js +0 -233
  214. package/src/components/FiltersStrip/appliedFilter.js +0 -180
  215. package/src/components/FiltersStrip/filterDropDown.js +0 -96
  216. package/src/components/FiltersStrip/index.js +0 -127
  217. package/src/components/FiltersStrip/mockData.js +0 -227
  218. package/src/components/Header/Header.styles.scss +0 -223
  219. package/src/components/Header/index.js +0 -156
  220. package/src/components/HomePage/HomePage.styles.scss +0 -1638
  221. package/src/components/HomePage/constant.js +0 -331
  222. package/src/components/HomePage/index.js +0 -675
  223. package/src/components/Input/Input.styles.scss +0 -318
  224. package/src/components/Input/helperText.js +0 -19
  225. package/src/components/Input/index.js +0 -60
  226. package/src/components/Input/inputWithIcon.js +0 -134
  227. package/src/components/Input/vanilaInput.js +0 -68
  228. package/src/components/Loader/Loader.styles.scss +0 -90
  229. package/src/components/Loader/index.js +0 -69
  230. package/src/components/Menu/IconMenuItem.js +0 -100
  231. package/src/components/Menu/Menu.styles.scss +0 -190
  232. package/src/components/Menu/MenuHeader.jsx +0 -84
  233. package/src/components/Menu/MenuHeaderInfo.jsx +0 -319
  234. package/src/components/Menu/MenuHeaderInfo.styles.scss +0 -123
  235. package/src/components/Menu/NestedMenuItem.js +0 -189
  236. package/src/components/Menu/index.js +0 -254
  237. package/src/components/Menu/nestedMenuItemsFromObject.js +0 -100
  238. package/src/components/Modal/Modal.styles.scss +0 -129
  239. package/src/components/Modal/index.js +0 -141
  240. package/src/components/MonthPicker/MonthPicker.styles.scss +0 -255
  241. package/src/components/MonthPicker/constant.js +0 -1
  242. package/src/components/MonthPicker/index.js +0 -373
  243. package/src/components/MonthRangePicker/MonthRangePicker.styles.scss +0 -383
  244. package/src/components/MonthRangePicker/constant.js +0 -1
  245. package/src/components/MonthRangePicker/index.js +0 -574
  246. package/src/components/Notification/Notification.styles.scss +0 -594
  247. package/src/components/Notification/NotificationBody/NotificationInfoList/chipsLists.js +0 -144
  248. package/src/components/Notification/NotificationBody/NotificationInfoList/index.js +0 -128
  249. package/src/components/Notification/NotificationBody/NotificationInfoList/notificationList.js +0 -165
  250. package/src/components/Notification/NotificationBody/NotificationPanels/chipsLists.js +0 -85
  251. package/src/components/Notification/NotificationBody/NotificationPanels/index.js +0 -259
  252. package/src/components/Notification/NotificationBody/NotificationPanels/notificationList.js +0 -637
  253. package/src/components/Notification/NotificationBody/index.js +0 -117
  254. package/src/components/Notification/index.js +0 -128
  255. package/src/components/Notification/mockData.js +0 -389
  256. package/src/components/Notification/notificationFooter.js +0 -31
  257. package/src/components/Notification/notificationHeader.js +0 -28
  258. package/src/components/Panel/Panel.styles.scss +0 -71
  259. package/src/components/Panel/index.js +0 -144
  260. package/src/components/Popover/Popover.styles.scss +0 -52
  261. package/src/components/Popover/index.js +0 -71
  262. package/src/components/Portal/index.js +0 -31
  263. package/src/components/ProgressBar/ProgressBar.styles.scss +0 -62
  264. package/src/components/ProgressBar/index.js +0 -40
  265. package/src/components/Prompt/Prompt.styles.scss +0 -107
  266. package/src/components/Prompt/index.js +0 -107
  267. package/src/components/RadioButtonGroup/RadioButtonGroup.styles.scss +0 -136
  268. package/src/components/RadioButtonGroup/index.js +0 -107
  269. package/src/components/Select/SearchFilter.js +0 -72
  270. package/src/components/Select/Select.styles.scss +0 -748
  271. package/src/components/Select/customGroupHeading.js +0 -24
  272. package/src/components/Select/dropdown.js +0 -65
  273. package/src/components/Select/hooks/index.js +0 -2
  274. package/src/components/Select/hooks/useClickOutside.js +0 -61
  275. package/src/components/Select/hooks/useMenuPosition.js +0 -288
  276. package/src/components/Select/index.js +0 -1307
  277. package/src/components/Select/menuList.js +0 -119
  278. package/src/components/Select/optionList.js +0 -215
  279. package/src/components/Select/selected-option-tags.js +0 -99
  280. package/src/components/Select/utils.js +0 -232
  281. package/src/components/Sidebar/Menus/childMenu.js +0 -88
  282. package/src/components/Sidebar/Menus/index.js +0 -130
  283. package/src/components/Sidebar/Menus/parentMenu.js +0 -173
  284. package/src/components/Sidebar/Sidebar.styles.scss +0 -411
  285. package/src/components/Sidebar/actions.js +0 -31
  286. package/src/components/Sidebar/index.js +0 -84
  287. package/src/components/Sidebar/mock.js +0 -202
  288. package/src/components/Slider/Sliders.styles.scss +0 -260
  289. package/src/components/Slider/index.js +0 -314
  290. package/src/components/Stepper/Stepper.styles.scss +0 -355
  291. package/src/components/Stepper/index.js +0 -101
  292. package/src/components/Switch/Switch.styles.scss +0 -96
  293. package/src/components/Switch/index.js +0 -59
  294. package/src/components/Table/AdvanceSearchModalItem.js +0 -392
  295. package/src/components/Table/AdvanceSortModal.js +0 -332
  296. package/src/components/Table/AgGridHeader.js +0 -1009
  297. package/src/components/Table/CommentsPortal.js +0 -428
  298. package/src/components/Table/NewAdvanceSearchModal/NewAdvanceSearchModal.js +0 -323
  299. package/src/components/Table/NewAdvanceSearchModal/NewAdvanceSearchModalItem.js +0 -476
  300. package/src/components/Table/NoComments.js +0 -295
  301. package/src/components/Table/Table.styles.scss +0 -3859
  302. package/src/components/Table/actionBar.js +0 -43
  303. package/src/components/Table/advanceSearchModal.js +0 -797
  304. package/src/components/Table/commentPanel.js +0 -421
  305. package/src/components/Table/filterUtils.js +0 -850
  306. package/src/components/Table/index.js +0 -2175
  307. package/src/components/Table/mockData.js +0 -1344
  308. package/src/components/Table/tableFunctions.js +0 -1676
  309. package/src/components/Table/tableHeader.js +0 -476
  310. package/src/components/Table/tableIcons.js +0 -61
  311. package/src/components/Table/tableMoreOptions.js +0 -293
  312. package/src/components/Table/tablePagination.js +0 -63
  313. package/src/components/Table/tableSettings.js +0 -287
  314. package/src/components/Table/withCommentIcon.js +0 -107
  315. package/src/components/TableChat/EmptyContainer.jsx +0 -13
  316. package/src/components/TableChat/README.md +0 -588
  317. package/src/components/TableChat/TableChatSidePanel.jsx +0 -832
  318. package/src/components/TableChat/TableChatSidePanel.styles.scss +0 -57
  319. package/src/components/TableChat/components/ChatMessageSkeleton/ChatFooterSkeleton.jsx +0 -43
  320. package/src/components/TableChat/components/ChatMessageSkeleton/ChatHeaderSkeleton.jsx +0 -55
  321. package/src/components/TableChat/components/ChatMessageSkeleton/ChatMessageListSkeleton.jsx +0 -94
  322. package/src/components/TableChat/components/ChatMessageSkeleton/ChatSkeleton.jsx +0 -22
  323. package/src/components/TableChat/components/ChatMessageSkeleton/ChatSkeleton.scss +0 -179
  324. package/src/components/TableChat/components/SkeletonList.jsx +0 -12
  325. package/src/components/TableChat/components/TableChatLeftSection/AddChatContainer/AddChatContainer.jsx +0 -171
  326. package/src/components/TableChat/components/TableChatLeftSection/AddChatContainer/AddChatContainer.styles.scss +0 -37
  327. package/src/components/TableChat/components/TableChatLeftSection/ChannelCheckbox/ChannelCheckbox.jsx +0 -28
  328. package/src/components/TableChat/components/TableChatLeftSection/ChatChannelItem.jsx +0 -116
  329. package/src/components/TableChat/components/TableChatLeftSection/ChatChannelList.jsx +0 -89
  330. package/src/components/TableChat/components/TableChatLeftSection/ChatHeaderButton/ChatHeaderButton.jsx +0 -27
  331. package/src/components/TableChat/components/TableChatLeftSection/ChatHeaderNavigation.jsx +0 -191
  332. package/src/components/TableChat/components/TableChatLeftSection/ChatIconButton/ChatIconButton.jsx +0 -23
  333. package/src/components/TableChat/components/TableChatLeftSection/TableChatChannelHeader.jsx +0 -117
  334. package/src/components/TableChat/components/TableChatLeftSection/TableChatChannelHeader.styles.scss +0 -469
  335. package/src/components/TableChat/components/TableChatLeftSection/UnreadBadge/UnreadBadge.jsx +0 -16
  336. package/src/components/TableChat/components/TableChatRightSection/AvatarGroup/AvatarGroup.jsx +0 -119
  337. package/src/components/TableChat/components/TableChatRightSection/AvatarGroup/AvatarGroup.styles.scss +0 -87
  338. package/src/components/TableChat/components/TableChatRightSection/ChatDefaultMessageType/ChatDefaultMessageType.jsx +0 -216
  339. package/src/components/TableChat/components/TableChatRightSection/ChatDefaultMessageType/ChatDefaultMessageType.styles.scss +0 -291
  340. package/src/components/TableChat/components/TableChatRightSection/ChatDeleteMessageType/ChatDeletedMessageType.jsx +0 -19
  341. package/src/components/TableChat/components/TableChatRightSection/ChatDeleteMessageType/DeletedMessage.styles.scss +0 -55
  342. package/src/components/TableChat/components/TableChatRightSection/ChatEditedMessageType/ChatEditedMessageType.jsx +0 -61
  343. package/src/components/TableChat/components/TableChatRightSection/ChatEditedMessageType/ChatEditedMessageType.styles.scss +0 -13
  344. package/src/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeader.jsx +0 -432
  345. package/src/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderAction.jsx +0 -365
  346. package/src/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderInfo.jsx +0 -42
  347. package/src/components/TableChat/components/TableChatRightSection/ChatHeader/chatHeader.styles.scss +0 -323
  348. package/src/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.jsx +0 -793
  349. package/src/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.styles.scss +0 -394
  350. package/src/components/TableChat/components/TableChatRightSection/ChatMessageActions/ChatMessageActions.jsx +0 -61
  351. package/src/components/TableChat/components/TableChatRightSection/ChatMessageActions/ChatMessageActions.styles.scss +0 -28
  352. package/src/components/TableChat/components/TableChatRightSection/ChatMessageAvatar/ChatMessageAvatar.jsx +0 -11
  353. package/src/components/TableChat/components/TableChatRightSection/ChatMessageAvatar/ChatMessageAvatar.styles.scss +0 -3
  354. package/src/components/TableChat/components/TableChatRightSection/ChatMessages/ChatMessage.jsx +0 -220
  355. package/src/components/TableChat/components/TableChatRightSection/ChatMessages/ChatMessage.styles.scss +0 -128
  356. package/src/components/TableChat/components/TableChatRightSection/ChatNotificationSettings/ChatNotificationSettings.jsx +0 -246
  357. package/src/components/TableChat/components/TableChatRightSection/ChatNotificationSettings/ChatNotificationSettings.styles.scss +0 -210
  358. package/src/components/TableChat/components/TableChatRightSection/DateSeparator/DateSeparator.jsx +0 -52
  359. package/src/components/TableChat/components/TableChatRightSection/DateSeparator/DateSeparator.styles.scss +0 -34
  360. package/src/components/TableChat/components/TableChatRightSection/EmojiPicker/EmojiPicker.jsx +0 -31
  361. package/src/components/TableChat/components/TableChatRightSection/FileUploader/FileUploader.jsx +0 -170
  362. package/src/components/TableChat/components/TableChatRightSection/ImageUploader/ImageUploader.jsx +0 -165
  363. package/src/components/TableChat/components/TableChatRightSection/PinedChatPanel/PinedChat.styles.scss +0 -587
  364. package/src/components/TableChat/components/TableChatRightSection/PinedChatPanel/PinedChatPanel.jsx +0 -244
  365. package/src/components/TableChat/components/TableChatRightSection/ReplyBadge/ReplyBadge.jsx +0 -29
  366. package/src/components/TableChat/components/TableChatRightSection/ReplyBadge/ReplyBadge.styles.scss +0 -47
  367. package/src/components/TableChat/components/TableChatRightSection/TableChatRightSection.jsx +0 -1340
  368. package/src/components/TableChat/components/TableChatRightSection/TableChatRightSection.styles.scss +0 -147
  369. package/src/components/TableChat/components/TextEditor/EditorToolbar.jsx +0 -209
  370. package/src/components/TableChat/components/TextEditor/EditorToolbar.styles.scss +0 -61
  371. package/src/components/TableChat/components/TextEditor/Mention.jsx +0 -234
  372. package/src/components/TableChat/components/TextEditor/MentionList.jsx +0 -118
  373. package/src/components/TableChat/components/TextEditor/MentionList.scss +0 -146
  374. package/src/components/TableChat/components/TextEditor/styles.scss +0 -278
  375. package/src/components/TableChat/components/TextEditor/suggestion.js +0 -124
  376. package/src/components/TableChat/components/chatConfig.js +0 -64
  377. package/src/components/TableChat/hooks/useInfiniteScroll.js +0 -256
  378. package/src/components/TableOld/AgGridHeader.js +0 -545
  379. package/src/components/TableOld/Table.styles.scss +0 -2192
  380. package/src/components/TableOld/actionBar.js +0 -43
  381. package/src/components/TableOld/index.js +0 -598
  382. package/src/components/TableOld/mockData.js +0 -1344
  383. package/src/components/TableOld/tableFunctions.js +0 -1734
  384. package/src/components/TableOld/tableHeader.js +0 -251
  385. package/src/components/TableOld/tableIcons.js +0 -61
  386. package/src/components/TableOld/tablePagination.js +0 -64
  387. package/src/components/TableOld/tableSettings.js +0 -166
  388. package/src/components/Tabs/Tabs.styles.scss +0 -120
  389. package/src/components/Tabs/index.js +0 -91
  390. package/src/components/Tabs/tabPanel.js +0 -38
  391. package/src/components/Tag/Tags.styles.scss +0 -71
  392. package/src/components/Tag/filled.js +0 -48
  393. package/src/components/Tag/index.js +0 -54
  394. package/src/components/Tag/solid.js +0 -47
  395. package/src/components/Tag/stroke.js +0 -47
  396. package/src/components/Tag/utils.js +0 -12
  397. package/src/components/TagGroup/TagGroup.styles.scss +0 -7
  398. package/src/components/TagGroup/index.js +0 -6
  399. package/src/components/TextArea/TextArea.styles.scss +0 -158
  400. package/src/components/TextArea/index.js +0 -121
  401. package/src/components/Toast/Toast.styles.scss +0 -66
  402. package/src/components/Toast/index.js +0 -35
  403. package/src/components/Tooltip/Tooltips.styles.scss +0 -111
  404. package/src/components/Tooltip/index.js +0 -68
  405. package/src/components/common/HelperText/HelperText.styles.scss +0 -18
  406. package/src/components/common/HelperText/index.js +0 -44
  407. package/src/components/common/MentionEditor/MentionEditor.styles.scss +0 -301
  408. package/src/components/common/MentionEditor/MentionList/MentionList.styles.scss +0 -146
  409. package/src/components/common/MentionEditor/MentionList/index.js +0 -130
  410. package/src/components/common/MentionEditor/index.js +0 -246
  411. package/src/components/common/MentionEditor/suggestion.js +0 -124
  412. package/src/components/index.js +0 -53
  413. package/src/stories/Accordion.stories.js +0 -151
  414. package/src/stories/AccordionModern.stories.js +0 -263
  415. package/src/stories/Alert.stories.js +0 -103
  416. package/src/stories/Avatar.stories.js +0 -79
  417. package/src/stories/Badge.stories.js +0 -112
  418. package/src/stories/BottomSheet.stories.js +0 -224
  419. package/src/stories/Breadcrumbs.stories.js +0 -143
  420. package/src/stories/Button.stories.js +0 -190
  421. package/src/stories/ButtonGroup.stories.js +0 -123
  422. package/src/stories/Card.stories.js +0 -73
  423. package/src/stories/Changelog.mdx +0 -1006
  424. package/src/stories/Chart.stories.js +0 -2017
  425. package/src/stories/ChatBot.stories.js +0 -668
  426. package/src/stories/Checkbox.stories.js +0 -209
  427. package/src/stories/Chips.stories.js +0 -106
  428. package/src/stories/CreateItemFlow.stories.js +0 -255
  429. package/src/stories/DatePicker.stories.js +0 -311
  430. package/src/stories/DateRangePicker.stories.js +0 -364
  431. package/src/stories/EmptyState.stories.js +0 -110
  432. package/src/stories/FileUpload.stories.js +0 -169
  433. package/src/stories/FilterPanel.stories.js +0 -309
  434. package/src/stories/FiltersStrip.stories.js +0 -244
  435. package/src/stories/GettingStarted.mdx +0 -153
  436. package/src/stories/Header.stories.js +0 -185
  437. package/src/stories/HomePage.stories.js +0 -201
  438. package/src/stories/Input.stories.js +0 -165
  439. package/src/stories/Loader.stories.js +0 -33
  440. package/src/stories/Menu.stories.js +0 -309
  441. package/src/stories/Modal.stories.js +0 -185
  442. package/src/stories/MonthPicker.stories.js +0 -313
  443. package/src/stories/MonthRangePicker.stories.js +0 -255
  444. package/src/stories/Notification.stories.js +0 -500
  445. package/src/stories/Panel.stories.js +0 -179
  446. package/src/stories/Popover.stories.js +0 -125
  447. package/src/stories/ProgressBar.stories.js +0 -93
  448. package/src/stories/Prompt.stories.js +0 -120
  449. package/src/stories/RadioButtonGroup.stories.js +0 -83
  450. package/src/stories/Select.stories.js +0 -753
  451. package/src/stories/Sidebar.stories.js +0 -177
  452. package/src/stories/Slider.stories.js +0 -226
  453. package/src/stories/Stepper.stories.js +0 -158
  454. package/src/stories/Switch.stories.js +0 -72
  455. package/src/stories/Table.stories.js +0 -4323
  456. package/src/stories/TableChat.mdx +0 -992
  457. package/src/stories/TableChat.stories.js +0 -1712
  458. package/src/stories/TableOld.stories.js +0 -954
  459. package/src/stories/Tabs.stories.js +0 -253
  460. package/src/stories/Tag.stories.js +0 -92
  461. package/src/stories/TagGroup.stories.js +0 -39
  462. package/src/stories/TextArea.stories.js +0 -148
  463. package/src/stories/Toast.stories.js +0 -113
  464. package/src/stories/Tooltip.stories.js +0 -86
  465. package/src/stories/storybookLinks.mdx +0 -20
@@ -1,850 +0,0 @@
1
- import moment from "moment";
2
- import {
3
- convertToOptions,
4
- DATE_FILTER_OPTIONS,
5
- NON_TEXT_FILTER_OPTIONS,
6
- TEXT_FILTER_OPTIONS,
7
- } from "../../utils/helper";
8
-
9
- // Helper: Determine operator list based on column definition
10
- export const getOperatorListForColumn = (columnDef) => {
11
- // Priority 1: Custom operator list
12
- if (columnDef?.operationFilterOptions) {
13
- return columnDef.operationFilterOptions;
14
- }
15
-
16
- // Priority 2: Date range picker
17
- if (columnDef?.thirdOptionAsDateRangePicker) {
18
- return [{ label: "In range", value: "inRange" }];
19
- }
20
-
21
- // Priority 3: Check filter type
22
- switch (columnDef?.filter) {
23
- case "agDateColumnFilter":
24
- return DATE_FILTER_OPTIONS;
25
-
26
- case "agNumberColumnFilter":
27
- return NON_TEXT_FILTER_OPTIONS;
28
-
29
- case "agTextColumnFilter":
30
- // Boolean columns with text filter
31
- if (columnDef?.dataType === "boolean") {
32
- return [
33
- { label: "Equals", value: "equals" },
34
- { label: "Not equal", value: "notEqual" },
35
- ];
36
- }
37
- // Number type with text filter (formatted numbers)
38
- if (columnDef?.type === "number") {
39
- return TEXT_FILTER_OPTIONS;
40
- }
41
- return TEXT_FILTER_OPTIONS;
42
-
43
- default:
44
- break;
45
- }
46
-
47
- // Priority 4: Check dataType
48
- if (columnDef?.dataType === "boolean") {
49
- return [
50
- { label: "Equals", value: "equals" },
51
- { label: "Not equal", value: "notEqual" },
52
- ];
53
- }
54
-
55
- // Priority 5: Check type (number without explicit filter)
56
- if (columnDef?.type === "number") {
57
- return NON_TEXT_FILTER_OPTIONS;
58
- }
59
-
60
- // Default: Text operators
61
- return TEXT_FILTER_OPTIONS;
62
- };
63
-
64
- // Helper: Get default operation for a column
65
- export const getDefaultOperationForColumn = (columnDef, filter = null) => {
66
- // Find "Equals" option if available
67
- const operatorList = getOperatorListForColumn(columnDef);
68
- const equalsOption = operatorList.find((opt) => opt.value === "equals");
69
-
70
- // Date range picker always uses "inRange"
71
- if (columnDef?.thirdOptionAsDateRangePicker) {
72
- return { label: "In range", value: "inRange" };
73
- }
74
-
75
- // Columns that prefer "Equals" as default
76
- const prefersEquals =
77
- columnDef?.filter === "agDateColumnFilter" ||
78
- filter?.filterType === "date" ||
79
- columnDef?.filter === "agNumberColumnFilter" ||
80
- columnDef?.dataType === "boolean" ||
81
- filter?.filterType === "boolean" ||
82
- (columnDef?.type === "number" &&
83
- columnDef?.filter === "agNumberColumnFilter");
84
-
85
- if (prefersEquals && equalsOption) {
86
- return equalsOption;
87
- }
88
-
89
- // Default to first operator in list
90
- return operatorList[0];
91
- };
92
-
93
- /**
94
- * Removes special characters from numeric strings
95
- * Supports: currency symbols ($, €, £, ¥, ₹), commas, spaces, percentages
96
- * @param {string} value - The value to clean
97
- * @returns {string} - Cleaned value
98
- */
99
- export const cleanNumericValue = (value) => {
100
- if (typeof value !== "string") {
101
- return value;
102
- }
103
- // Remove currency symbols, commas, spaces, and percentage signs
104
- return value.replace(/[$€£¥₹,\s%]/g, "");
105
- };
106
-
107
- /**
108
- * Parses a filter value based on the column type and definition
109
- * @param {*} value - The raw filter value
110
- * @param {object} columnDef - The column definition from AG Grid
111
- * @returns {object} - { parsedValue, filterType }
112
- */
113
- export const parseFilterValue = (value, columnDef) => {
114
- const type = columnDef?.type;
115
- const filter = columnDef?.filter;
116
- let parsedValue;
117
- let filterType = "contains";
118
-
119
- // Handle date range picker values (check this first before single date)
120
- if (
121
- value &&
122
- typeof value === "object" &&
123
- value?.startDate !== undefined &&
124
- value?.endDate !== undefined
125
- ) {
126
- const startDate = moment.isMoment(value.startDate)
127
- ? value.startDate
128
- : moment(value.startDate);
129
- const endDate = moment.isMoment(value.endDate)
130
- ? value.endDate
131
- : moment(value.endDate);
132
-
133
- parsedValue = {
134
- startDate: startDate.isValid() ? startDate.format("YYYY-MM-DD") : null,
135
- endDate: endDate.isValid() ? endDate.format("YYYY-MM-DD") : null,
136
- };
137
- return { parsedValue, filterType };
138
- }
139
-
140
- // Handle date columns and single date picker (moment object)
141
- if (filter === "agDateColumnFilter") {
142
- filterType = "equals";
143
-
144
- // Handle moment objects
145
- if (value && typeof value === "object" && moment.isMoment(value)) {
146
- parsedValue = value.format("YYYY-MM-DD");
147
- return { parsedValue, filterType };
148
- }
149
-
150
- // Handle date strings
151
- if (value && typeof value === "string") {
152
- const dateMoment = moment(
153
- value,
154
- ["MM-DD-YYYY", "YYYY-MM-DD", "MM/DD/YYYY"],
155
- true
156
- );
157
- if (dateMoment.isValid()) {
158
- parsedValue = dateMoment.format("YYYY-MM-DD");
159
- return { parsedValue, filterType };
160
- }
161
- }
162
-
163
- // Handle objects with format method
164
- if (
165
- value &&
166
- typeof value === "object" &&
167
- typeof value?.format === "function"
168
- ) {
169
- parsedValue = value.format("YYYY-MM-DD");
170
- return { parsedValue, filterType };
171
- }
172
-
173
- parsedValue = undefined;
174
- return { parsedValue, filterType };
175
- }
176
-
177
- // Handle number columns with special characters
178
- if (filter === "agNumberColumnFilter" || type === "number") {
179
- const cleanedValue = cleanNumericValue(value);
180
- const numericValue = parseFloat(cleanedValue);
181
-
182
- // Return null for invalid numbers
183
- if (isNaN(numericValue) || cleanedValue === "") {
184
- return { parsedValue: null, filterType };
185
- }
186
-
187
- parsedValue = numericValue;
188
- filterType = "equals";
189
- return { parsedValue, filterType };
190
- }
191
-
192
- // Handle text columns and other types
193
- parsedValue =
194
- typeof value === "string"
195
- ? value
196
- : typeof value === "object" && value?.value
197
- ? value.value
198
- : value;
199
-
200
- return { parsedValue, filterType };
201
- };
202
-
203
- /**
204
- * Determines if a column value is a string or number by checking first row data
205
- * Used to decide between "equals" (numbers) vs "contains" (strings) filter type
206
- * @param {object} api - AG Grid API
207
- * @param {string} columnId - Column ID to check
208
- * @returns {boolean} - true if column contains string values
209
- */
210
- export const isColumnDataString = (api, columnId) => {
211
- let firstValue = null;
212
- api.forEachNode((node) => {
213
- if (firstValue === null && node.data) {
214
- firstValue = node.data[columnId];
215
- }
216
- });
217
- return typeof firstValue === "string";
218
- };
219
-
220
- /**
221
- * Builds a filter model entry for AG Grid
222
- * Supports all AG Grid filter operators including:
223
- * - Text: contains, notContains, equals, notEqual, startsWith, endsWith, blank, notBlank
224
- * - Number: equals, notEqual, lessThan, lessThanOrEqual, greaterThan, greaterThanOrEqual, blank, notBlank
225
- * - Date: equals, notEqual, lessThan, lessThanOrEqual, greaterThan, greaterThanOrEqual, inRange, blank, notBlank
226
- *
227
- * @param {*} parsedValue - The parsed filter value
228
- * @param {string} filterType - The filter type (equals, contains, etc.)
229
- * @param {object} columnDef - The column definition
230
- * @param {string} operationType - Optional operation type from advance search
231
- * @returns {object|undefined} - Filter model entry or undefined if invalid
232
- */
233
- export const buildFilterModelEntry = (
234
- parsedValue,
235
- filterType,
236
- columnDef,
237
- operationType = null
238
- ) => {
239
- const type = columnDef?.type;
240
- const filter = columnDef?.filter;
241
- const operator = operationType || filterType;
242
-
243
- // Handle blank and notBlank operators (they don't need a value)
244
- if (operator === "blank" || operator === "notBlank") {
245
- // Determine the appropriate filterType based on column definition
246
- let filterTypeForBlank = "text";
247
- if (filter === "agDateColumnFilter") {
248
- filterTypeForBlank = "date";
249
- } else if (filter === "agNumberColumnFilter" || type === "number") {
250
- filterTypeForBlank = "number";
251
- } else if (
252
- columnDef?.dataType === "boolean" &&
253
- filter === "agTextColumnFilter"
254
- ) {
255
- // Boolean columns using text filter should use "text" filterType to match AG Grid's filter
256
- filterTypeForBlank = "text";
257
- }
258
-
259
- return {
260
- filterType: filterTypeForBlank,
261
- type: operator,
262
- };
263
- }
264
-
265
- // Check if value is valid for other operators
266
- if (parsedValue === null || parsedValue === undefined || parsedValue === "") {
267
- return undefined;
268
- }
269
-
270
- // Handle date range values (object with startDate and endDate)
271
- if (
272
- filter === "agDateColumnFilter" &&
273
- typeof parsedValue === "object" &&
274
- parsedValue.startDate &&
275
- parsedValue.endDate
276
- ) {
277
- return {
278
- filterType: "date",
279
- type: "inRange",
280
- dateFrom: parsedValue.startDate,
281
- dateTo: parsedValue.endDate,
282
- };
283
- }
284
-
285
- // Handle single date columns with all operators
286
- if (filter === "agDateColumnFilter") {
287
- return {
288
- filterType: "date",
289
- type: operator,
290
- dateFrom: parsedValue,
291
- };
292
- }
293
-
294
- // Handle number columns with agNumberColumnFilter
295
- // AG Grid number filter supports: equals, notEqual, lessThan, lessThanOrEqual, greaterThan, greaterThanOrEqual, blank, notBlank
296
- if (filter === "agNumberColumnFilter") {
297
- return {
298
- filterType: "number",
299
- type: operator,
300
- filter: parsedValue,
301
- };
302
- }
303
-
304
- // Handle boolean columns
305
- if (columnDef?.dataType === "boolean") {
306
- return {
307
- filterType: "text",
308
- type: operator,
309
- filter: String(parsedValue),
310
- };
311
- }
312
-
313
- // If type is number but filter is agTextColumnFilter (e.g., formatted numbers like "$11.38")
314
- // Use text filter format for text-based searching
315
- if (type === "number" && filter === "agTextColumnFilter") {
316
- return {
317
- filterType: "text",
318
- type: operator,
319
- filter: String(parsedValue),
320
- };
321
- }
322
-
323
- // If type is number with no explicit filter, use number filter
324
- if (type === "number") {
325
- return {
326
- filterType: "number",
327
- type: operator,
328
- filter: parsedValue,
329
- };
330
- }
331
-
332
- // Handle text columns with all operators
333
- // AG Grid text filter supports: contains, notContains, equals, notEqual, startsWith, endsWith, blank, notBlank
334
- const filterEntry = {
335
- type: operator,
336
- filter: parsedValue,
337
- filterType: "text",
338
- };
339
-
340
- return filterEntry;
341
- };
342
-
343
- /**
344
- * Recursively finds a column definition by field or colId
345
- * @param {array} colDefs - Array of column definitions
346
- * @param {string} field - Field or colId to find
347
- * @returns {object|null} - Column definition or null
348
- */
349
- export const findColumnDef = (colDefs, field) => {
350
- for (const col of colDefs) {
351
- // Check children recursively
352
- if (col.children) {
353
- const found = findColumnDef(col.children, field);
354
- if (found) return found;
355
- }
356
- if (
357
- col.toShowDuplicateColumnInAdvanceSearch &&
358
- col.columnFieldsInAdvanceSearch
359
- ) {
360
- const index = col.columnFieldsInAdvanceSearch?.indexOf(field);
361
- if (index !== -1) {
362
- return {
363
- ...col,
364
- currentColumnField: `${field}${index + 1}`, // add index + 1
365
- };
366
- }
367
- } else if (
368
- (col.colId && col.colId === field) ||
369
- (col.field && col.field === field)
370
- ) {
371
- return col;
372
- }
373
- }
374
- return null;
375
- };
376
-
377
- /**
378
- * Applies inline search filter for a single column
379
- * Handles special logic for number columns with formatted vs raw data
380
- * @param {*} value - Search value
381
- * @param {object} columnDef - Column definition
382
- * @param {object} api - AG Grid API
383
- * @param {string} columnId - Column ID
384
- * @returns {object} - { parsedValue, filterType }
385
- */
386
- export const parseInlineSearchValue = (value, columnDef, api, columnId) => {
387
- const type = columnDef?.type;
388
- const filter = columnDef?.filter;
389
-
390
- // Date columns
391
- if (filter === "agDateColumnFilter") {
392
- // Handle date range objects (from DateRangePicker)
393
- if (
394
- value &&
395
- typeof value === "object" &&
396
- value?.startDate !== undefined &&
397
- value?.endDate !== undefined
398
- ) {
399
- const startDate = moment.isMoment(value.startDate)
400
- ? value.startDate
401
- : moment(value.startDate);
402
- const endDate = moment.isMoment(value.endDate)
403
- ? value.endDate
404
- : moment(value.endDate);
405
-
406
- return {
407
- parsedValue: {
408
- startDate: startDate.isValid()
409
- ? startDate.format("YYYY-MM-DD")
410
- : null,
411
- endDate: endDate.isValid() ? endDate.format("YYYY-MM-DD") : null,
412
- },
413
- filterType: "inRange",
414
- };
415
- }
416
- // Handle single moment objects
417
- if (value && typeof value === "object" && moment.isMoment(value)) {
418
- return {
419
- parsedValue: value.format("YYYY-MM-DD"),
420
- filterType: "equals",
421
- };
422
- }
423
- // Handle date strings
424
- if (value && typeof value === "string") {
425
- const dateMoment = moment(value, [
426
- "MM-DD-YYYY",
427
- "YYYY-MM-DD",
428
- "MM/DD/YYYY",
429
- ]);
430
- if (dateMoment.isValid()) {
431
- return {
432
- parsedValue: dateMoment.format("YYYY-MM-DD"),
433
- filterType: "equals",
434
- };
435
- }
436
- }
437
- return { parsedValue: undefined, filterType: "equals" };
438
- }
439
-
440
- // Number columns with special character handling
441
- if (filter === "agNumberColumnFilter" || type === "number") {
442
- const cleanedValue = cleanNumericValue(value);
443
- const parsedNumber = parseFloat(cleanedValue);
444
-
445
- if (isNaN(parsedNumber) || cleanedValue === "") {
446
- return { parsedValue: null, filterType: "contains" };
447
- }
448
-
449
- // Check if column data is string or number to determine filter type
450
- const isStringColumn = isColumnDataString(api, columnId);
451
-
452
- if (isStringColumn) {
453
- // Column contains formatted strings like "$11.38" - use original value for contains match
454
- return { parsedValue: value, filterType: "contains" };
455
- } else {
456
- // Column contains raw numbers - use parsed number for exact match
457
- return { parsedValue: parsedNumber, filterType: "equals" };
458
- }
459
- }
460
-
461
- // Boolean columns - use equals for exact match
462
- if (columnDef?.dataType === "boolean") {
463
- return { parsedValue: value, filterType: "equals" };
464
- }
465
-
466
- // Text columns
467
- return { parsedValue: value, filterType: "contains" };
468
- };
469
-
470
- /**
471
- * Validates if a parsed value is valid for filtering
472
- * @param {*} parsedValue - The parsed value to validate
473
- * @returns {boolean} - true if valid
474
- */
475
- export const isValidFilterValue = (parsedValue) => {
476
- if (parsedValue === null || parsedValue === undefined) {
477
- return false;
478
- }
479
-
480
- if (typeof parsedValue === "number" && isNaN(parsedValue)) {
481
- return false;
482
- }
483
-
484
- if (typeof parsedValue === "string" && parsedValue.trim() === "") {
485
- return false;
486
- }
487
-
488
- // Handle date range objects
489
- if (
490
- typeof parsedValue === "object" &&
491
- parsedValue.startDate !== undefined &&
492
- parsedValue.endDate !== undefined
493
- ) {
494
- // Valid if both dates are present and not null
495
- return parsedValue.startDate !== null && parsedValue.endDate !== null;
496
- }
497
-
498
- return true;
499
- };
500
-
501
- /**
502
- * Gets the display label for a column (handles nested/hierarchical columns)
503
- * @param {string} columnId - The column ID
504
- * @param {object} columnDef - The column definition
505
- * @param {array} colDefs - All column definitions
506
- * @returns {string} - Display label for the column
507
- */
508
- export const getColumnLabel = (columnId, columnDef, colDefs) => {
509
- // Start with basic label from column definition
510
- let label = columnDef?.headerName || columnId;
511
-
512
- // Try to get hierarchical label from convertToOptions
513
- if (colDefs) {
514
- const columnOptions = convertToOptions(colDefs);
515
- const columnOption = columnOptions.find((opt) => opt.value === columnId);
516
- if (columnOption?.label) {
517
- label = columnOption.label;
518
- }
519
- }
520
-
521
- return label;
522
- };
523
-
524
- /**
525
- * Validates if a filter in the filter model has a valid value
526
- * @param {object} filter - Filter object from filter model
527
- * @returns {boolean} - true if filter has valid value
528
- */
529
- export const hasValidFilterValue = (filter) => {
530
- if (!filter || filter === undefined || filter === null) {
531
- return false;
532
- }
533
-
534
- const hasValue =
535
- (filter.filter !== undefined &&
536
- filter.filter !== null &&
537
- filter.filter !== "") ||
538
- (filter.dateFrom !== undefined &&
539
- filter.dateFrom !== null &&
540
- filter.dateFrom !== "");
541
-
542
- return hasValue;
543
- };
544
-
545
- /**
546
- * Converts AG Grid filter model entry to advance search modal format
547
- * @param {string} columnId - Column ID
548
- * @param {object} filter - Filter from filter model
549
- * @param {object} columnDef - Column definition
550
- * @param {array} colDefs - All column definitions
551
- * @returns {object} - Filter in modal format
552
- */
553
- export const convertFilterToModalFormat = (
554
- columnId,
555
- filter,
556
- columnDef,
557
- colDefs
558
- ) => {
559
- const columnLabel = getColumnLabel(columnId, columnDef, colDefs);
560
-
561
- // Get the filter value based on filter type
562
- let value = filter?.filter || "";
563
-
564
- if (filter?.dateFrom) {
565
- // Handle date strings (may have time component from AG Grid)
566
- if (typeof filter.dateFrom === "string") {
567
- value = filter.dateFrom.split(" ")?.[0];
568
- } else if (filter.dateFrom instanceof Date) {
569
- // Fallback for Date objects (shouldn't happen but handle it)
570
- value = moment(filter.dateFrom).format("YYYY-MM-DD");
571
- } else {
572
- value = filter.dateFrom;
573
- }
574
- }
575
-
576
- // Determine operation type and label
577
- let operationType = filter?.type;
578
- let operationLabel;
579
-
580
- if (!operationType) {
581
- // Use default operation based on column type
582
- const defaultOp = getDefaultOperationForColumn(columnDef, filter);
583
- operationType = defaultOp.value;
584
- operationLabel = defaultOp.label;
585
- } else {
586
- // Format the label from the operation type
587
- operationLabel =
588
- operationType.charAt(0).toUpperCase() + operationType.slice(1);
589
- }
590
-
591
- return {
592
- column: {
593
- label: columnLabel,
594
- value: columnId,
595
- type: filter?.filterType || "text",
596
- },
597
- operation: {
598
- label: operationLabel,
599
- value: operationType,
600
- },
601
- value: value,
602
- };
603
- };
604
-
605
- /**
606
- * Gets column definition from AG Grid API or colDefs
607
- * @param {object} api - AG Grid API
608
- * @param {string} colId - Column ID
609
- * @param {array} colDefs - All column definitions
610
- * @returns {object|null} - Column definition
611
- */
612
- const getColumnDefById = (api, colId, colDefs) => {
613
- const column = api?.getColumn(colId);
614
- if (column) {
615
- return column.getColDef();
616
- }
617
- if (colDefs) {
618
- return findColumnDef(colDefs, colId);
619
- }
620
- return null;
621
- };
622
-
623
- /**
624
- * Converts all active filters from AG Grid to modal format
625
- * @param {object} filterModel - AG Grid filter model
626
- * @param {object} api - AG Grid API
627
- * @param {array} colDefs - All column definitions
628
- * @returns {array} - Array of filters in modal format
629
- */
630
- const convertActiveFiltersToModalFormat = (filterModel, api, colDefs) => {
631
- return Object.keys(filterModel)
632
- .filter((colId) => hasValidFilterValue(filterModel[colId]))
633
- .map((colId) => {
634
- const filter = filterModel[colId];
635
- const colDef = getColumnDefById(api, colId, colDefs);
636
- return convertFilterToModalFormat(colId, filter, colDef, colDefs);
637
- });
638
- };
639
-
640
- /**
641
- * Prepares value for modal based on column type using strategy pattern
642
- * @param {*} inputValue - Raw input value
643
- * @param {object} columnDef - Column definition
644
- * @param {function} getOptionFromDropdownValue - Function to convert dropdown values
645
- * @returns {*} - Prepared value for modal
646
- */
647
- const prepareValueForModal = (
648
- inputValue,
649
- columnDef,
650
- getOptionFromDropdownValue
651
- ) => {
652
- const columnType = columnDef?.type;
653
-
654
- // Strategy pattern for different column types
655
- switch (columnType) {
656
- case "dropdown":
657
- case "select":
658
- // Handle dropdown columns with options
659
- if (columnDef?.thirdOptionDropdownOptions && inputValue) {
660
- const optionObject = getOptionFromDropdownValue(inputValue, columnDef);
661
- return typeof optionObject === "object" &&
662
- optionObject !== null &&
663
- optionObject.label
664
- ? optionObject
665
- : inputValue;
666
- }
667
- return inputValue;
668
-
669
- case "date":
670
- // Date values are already formatted, just return
671
- return inputValue;
672
-
673
- case "number":
674
- // Number values are already parsed, just return
675
- return inputValue;
676
-
677
- case "text":
678
- default:
679
- // Text and other types - check if has dropdown options
680
- if (columnDef?.thirdOptionDropdownOptions && inputValue) {
681
- const optionObject = getOptionFromDropdownValue(inputValue, columnDef);
682
- return typeof optionObject === "object" &&
683
- optionObject !== null &&
684
- optionObject.label
685
- ? optionObject
686
- : inputValue;
687
- }
688
- return inputValue;
689
- }
690
- };
691
-
692
- /**
693
- * Creates a new filter entry for modal
694
- * @param {string} columnId - Column ID
695
- * @param {*} value - Filter value
696
- * @param {object} columnDef - Column definition
697
- * @param {array} colDefs - All column definitions
698
- * @returns {object} - Filter entry in modal format
699
- */
700
- const createModalFilterEntry = (columnId, value, columnDef, colDefs) => {
701
- return {
702
- column: {
703
- label: getColumnLabel(columnId, columnDef, colDefs),
704
- value: columnId,
705
- type: columnDef?.type || "text",
706
- },
707
- operation: getDefaultOperationForColumn(columnDef),
708
- value: value,
709
- };
710
- };
711
-
712
- /**
713
- * Updates existing filters or adds new filter
714
- * @param {array} existingFilters - Current filters in modal format
715
- * @param {string} columnId - Column ID being updated
716
- * @param {*} value - New filter value
717
- * @param {object} columnDef - Column definition
718
- * @param {array} colDefs - All column definitions
719
- * @returns {array} - Updated filters array
720
- */
721
- export const updateOrAddFilter = (
722
- existingFilters,
723
- columnId,
724
- value,
725
- columnDef,
726
- colDefs
727
- ) => {
728
- const isAlreadyPresent = existingFilters.find(
729
- (f) => f?.column?.value === columnId
730
- );
731
-
732
- if (isAlreadyPresent) {
733
- // Update existing filter
734
- return existingFilters.map((f) =>
735
- f?.column?.value === columnId ? { ...f, value } : f
736
- );
737
- } else {
738
- // Add new filter
739
- return [
740
- ...existingFilters,
741
- createModalFilterEntry(columnId, value, columnDef, colDefs),
742
- ];
743
- }
744
- };
745
-
746
- /**
747
- * Syncs AG Grid filter model with advance search modal state
748
- * Clean, step-by-step approach for better maintainability
749
- *
750
- * @param {object} api - AG Grid API
751
- * @param {string} currentColumnId - Current column being filtered
752
- * @param {*} inputValue - The filter value
753
- * @param {object} columnDef - Column definition
754
- * @param {array} colDefs - All column definitions
755
- * @param {function} setValue - Form setValue function
756
- * @param {function} setInitialFilters - Set initial filters function
757
- * @param {function} getOptionFromDropdownValue - Function to convert dropdown values
758
- */
759
- export const syncFiltersWithModal = (
760
- api,
761
- currentColumnId,
762
- inputValue,
763
- columnDef,
764
- colDefs,
765
- setValue,
766
- setInitialFilters,
767
- getOptionFromDropdownValue
768
- ) => {
769
- try {
770
- // Step 1: Get current filter model from AG Grid (source of truth)
771
- const currentFilterModel = api?.getFilterModel() || {};
772
-
773
- // Step 2: Convert all active filters to modal format
774
- const filtersFromModel = convertActiveFiltersToModalFormat(
775
- currentFilterModel,
776
- api,
777
- colDefs
778
- );
779
-
780
- // Step 3: Prepare value based on column type (uses strategy pattern)
781
- const valueForModal = prepareValueForModal(
782
- inputValue,
783
- columnDef,
784
- getOptionFromDropdownValue
785
- );
786
-
787
- // Step 4: Update or add the filter
788
- const updatedFilters = updateOrAddFilter(
789
- filtersFromModel,
790
- currentColumnId,
791
- valueForModal,
792
- columnDef,
793
- colDefs
794
- );
795
-
796
- // Step 5: Update modal state
797
- setValue?.("filters", updatedFilters);
798
- setInitialFilters?.(updatedFilters);
799
- } catch (err) {
800
- console.warn("Error syncing modal filters:", err);
801
- }
802
- };
803
-
804
- /**
805
- * Processes advance search filters and builds AG Grid filter model
806
- * @param {array} formValues - Array of filter objects from form
807
- * @param {array} colDefs - Column definitions
808
- * @returns {object} - AG Grid filter model
809
- */
810
- export const buildAdvanceSearchFilterModel = (formValues, colDefs) => {
811
- const filterModel = {};
812
-
813
- if (!formValues || !Array.isArray(formValues)) {
814
- return filterModel;
815
- }
816
-
817
- formValues.forEach((value) => {
818
- if (!value?.column?.value || !value?.operation?.value) {
819
- return;
820
- }
821
-
822
- const columnDef = findColumnDef(colDefs, value.column.value);
823
- if (!columnDef) {
824
- return;
825
- }
826
-
827
- const { parsedValue, filterType } = parseFilterValue(
828
- value.value,
829
- columnDef
830
- );
831
-
832
- if (!isValidFilterValue(parsedValue)) {
833
- return;
834
- }
835
-
836
- const columnKey = columnDef.colId || value.column.value;
837
- const filterEntry = buildFilterModelEntry(
838
- parsedValue,
839
- filterType,
840
- columnDef,
841
- value.operation.value
842
- );
843
-
844
- if (filterEntry) {
845
- filterModel[columnKey] = filterEntry;
846
- }
847
- });
848
-
849
- return filterModel;
850
- };