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,797 +0,0 @@
1
- import React, { useMemo, useRef } from "react";
2
- import { Modal } from "../Modal";
3
- import { ButtonGroup } from "../ButtonGroup";
4
- import { Button } from "../Button";
5
- import { useState, useEffect } from "react";
6
- import { AddOutlined } from "@mui/icons-material";
7
- import { Toast } from "../Toast";
8
- import AdvanceSearchModalItem from "./AdvanceSearchModalItem";
9
- import { useForm, useFieldArray } from "react-hook-form";
10
- import {
11
- convertToOptions,
12
- getAllowedColumns,
13
- hasDuplicateColumns,
14
- NON_TEXT_FILTER_OPTIONS,
15
- TEXT_FILTER_OPTIONS,
16
- } from "../../utils/helper";
17
- import moment from "moment";
18
- import { cloneDeep } from "lodash";
19
- import { on } from "events";
20
-
21
- export default function AdvanceSearchModal({
22
- isAdvanceSearch,
23
- toggleAdvanceSearch,
24
- colDefs,
25
- actualRef,
26
- currentColumnId,
27
- savedAdvanceSearchConfig,
28
- setInitialFilters,
29
- initialFilters = [{ column: null, operation: null, value: "" }],
30
- selectedThirdOptionDropdownValue,
31
- setSelectedThirdOptionDropdownValue,
32
- draftFilter,
33
- setDraftFilter,
34
- ...args
35
- }) {
36
- const [activeOption, setActiveOption] = useState("advanceSearch");
37
- const [initialDataSet, setInitialDataSet] = useState(false);
38
- const [isFormValid, setIsFormValid] = useState(true);
39
- const [openToast, setOpenToast] = useState(false);
40
- const [isClearAll, setIsClearAll] = useState(false);
41
- const [flag, setFlag] = useState(false);
42
- const [_, forceRender] = useState(false);
43
-
44
- const [
45
- toShowDuplicateColumnInAdvanceSearch,
46
- setToShowDuplicateColumnInAdvanceSearch,
47
- ] = useState(false);
48
-
49
- const formMethods =
50
- activeOption == "advanceSearch"
51
- ? useForm({
52
- defaultValues: {
53
- filters: initialFilters,
54
- },
55
- rules: {
56
- required: true,
57
- },
58
- })
59
- : useForm({
60
- defaultValues: {
61
- filters: [{ column: null, operation: null, value: null }],
62
- },
63
- rules: {
64
- required: true,
65
- },
66
- });
67
-
68
- const { control, handleSubmit, reset, getValues, watch, setValue } =
69
- formMethods;
70
- const { fields, append, remove } = useFieldArray({
71
- control,
72
- name: "filters",
73
- keyName: "fieldId",
74
- });
75
-
76
- const [pendingDeletions, setPendingDeletions] = useState([]);
77
- const [softCleared, setSoftCleared] = useState(false);
78
- // code for removing repeating field name
79
-
80
- const allowedCols = useMemo(() => {
81
- return getAllowedColumns(colDefs);
82
- }, [colDefs]);
83
-
84
- // Using `flag` in dependency array because `fields` is an array of objects,
85
- // and changes to object properties inside it don't trigger `useMemo`.
86
- // Toggling `flag` ensures the memoized value recomputes on updates.
87
-
88
- const filteredColumnsInitialOptions = useMemo(() => {
89
- const selectedValues = fields
90
- .filter((field) => !pendingDeletions.includes(field.fieldId))
91
- .map((f) => f.column?.value)
92
- .filter(Boolean);
93
-
94
- return convertToOptions(colDefs || []).filter(
95
- (opt) => !selectedValues.includes(opt.value)
96
- );
97
- }, [colDefs, fields, flag, pendingDeletions]);
98
-
99
- // Set initial form values from filter model
100
-
101
- useEffect(() => {
102
- if (
103
- !initialDataSet &&
104
- actualRef?.current?.api &&
105
- actualRef?.current?.api?.getFilterModel()
106
- ) {
107
- // Helper function to check if a filter is truly empty
108
- const isEmptyFilter = (filter) => {
109
- return (
110
- !filter?.column?.value ||
111
- filter?.column?.value === null ||
112
- filter?.column?.value === "" ||
113
- (!filter?.operation?.value && !filter?.value)
114
- );
115
- };
116
-
117
- // Check if initialFilters was intentionally cleared (all filters are empty or empty array)
118
- const validInitialFilters =
119
- initialFilters?.filter((f) => !isEmptyFilter(f)) || [];
120
- const isIntentionallyCleared =
121
- initialFilters?.length === 0 || // Empty array means cleared
122
- (initialFilters?.length > 0 && validInitialFilters.length === 0); // Array with only empty filters
123
-
124
- // If filters were intentionally cleared, don't restore from filter model
125
- if (isIntentionallyCleared) {
126
- reset({ filters: [{ column: null, operation: null, value: "" }] });
127
- setInitialDataSet(true);
128
- return;
129
- }
130
-
131
- const filterModel = actualRef.current.api?.getFilterModel();
132
- if (Object.keys(filterModel)?.length > 0) {
133
- const formattedFilters = Object.entries(filterModel)?.map(
134
- ([field, filterData]) => {
135
- const columnOption = filteredColumnsInitialOptions?.find(
136
- (opt) => opt?.value === field
137
- );
138
-
139
- const columnsOptionsInfo = colDefs?.find(
140
- (col) => col?.field === field
141
- );
142
- const isThirdOptionDropdown =
143
- columnsOptionsInfo?.thirdOptionAsDropdown;
144
-
145
- const getThirdOptionDropdownValue = (filterData) => {
146
- if (isThirdOptionDropdown) {
147
- return columnsOptionsInfo?.thirdOptionDropdownOptions?.find(
148
- (item) => item?.value === filterData
149
- );
150
- }
151
- return filterData;
152
- };
153
-
154
- const filterValue = getThirdOptionDropdownValue(filterData?.filter);
155
-
156
- const operationOption =
157
- filterData.filterType === "number"
158
- ? NON_TEXT_FILTER_OPTIONS?.find(
159
- (opt) => opt?.value === filterData?.type
160
- )
161
- : TEXT_FILTER_OPTIONS?.find(
162
- (opt) => opt?.value === filterData?.type
163
- );
164
-
165
- return {
166
- column: columnOption,
167
- operation: operationOption,
168
- value:
169
- filterData?.filterType === "date"
170
- ? moment(filterValue)
171
- : filterValue,
172
- id: "", // no uuid for now
173
- };
174
- }
175
- );
176
-
177
- // Filter out empty filters from initialFilters
178
- const validInitialFilters =
179
- initialFilters?.filter((f) => !isEmptyFilter(f)) || [];
180
-
181
- const updatedInitialFilters = [
182
- // Include valid initial filters, updated with formattedFilters if they match
183
- ...validInitialFilters?.map((filter) => {
184
- const match = formattedFilters?.find(
185
- (f) => f?.column?.value === filter?.column?.value
186
- );
187
- return match || filter;
188
- }),
189
-
190
- // Add new filters from formattedFilters that don't exist in initialFilters
191
- ...formattedFilters?.filter(
192
- (f) =>
193
- f?.column?.value && // column.value must be there
194
- f?.operation?.value && // operation must be there
195
- !validInitialFilters?.find(
196
- (filter) => filter?.column?.value === f?.column?.value
197
- )
198
- ),
199
- ];
200
-
201
- // If no valid filters exist, add one empty filter as default
202
- const finalFilters =
203
- updatedInitialFilters.length > 0
204
- ? updatedInitialFilters
205
- : [{ column: null, operation: null, value: "" }];
206
-
207
- reset({ filters: finalFilters });
208
- setInitialDataSet(true);
209
- } else {
210
- // Handle case when filterModel is empty - still need to initialize
211
- const isEmptyFilter = (filter) => {
212
- return (
213
- !filter?.column?.value ||
214
- filter?.column?.value === null ||
215
- filter?.column?.value === "" ||
216
- (!filter?.operation?.value && !filter?.value)
217
- );
218
- };
219
-
220
- const validInitialFilters =
221
- initialFilters?.filter((f) => !isEmptyFilter(f)) || [];
222
- const finalFilters =
223
- validInitialFilters.length > 0
224
- ? validInitialFilters
225
- : [{ column: null, operation: null, value: "" }];
226
-
227
- reset({ filters: finalFilters });
228
- setInitialDataSet(true);
229
- }
230
- } else if (initialFilters?.length > 0 && !initialDataSet) {
231
- // Apply same empty filter logic here too
232
- const isEmptyFilter = (filter) => {
233
- return (
234
- !filter?.column?.value ||
235
- filter?.column?.value === null ||
236
- filter?.column?.value === "" ||
237
- (!filter?.operation?.value && !filter?.value)
238
- );
239
- };
240
-
241
- const validInitialFilters =
242
- initialFilters?.filter((f) => !isEmptyFilter(f)) || [];
243
- const finalFilters =
244
- validInitialFilters.length > 0
245
- ? validInitialFilters
246
- : [{ column: null, operation: null, value: "" }];
247
-
248
- reset({ filters: finalFilters });
249
- setInitialDataSet(true);
250
- } else if (!initialDataSet) {
251
- // Final fallback - ensure we always have at least one empty filter
252
- reset({ filters: [{ column: null, operation: null, value: "" }] });
253
- setInitialDataSet(true);
254
- }
255
- }, [
256
- actualRef,
257
- filteredColumnsInitialOptions,
258
- initialDataSet,
259
- initialFilters,
260
- ]);
261
-
262
- // helper: remove visually only
263
- const softRemove = (index, fieldId) => {
264
- const filter = getValues()?.filters[index];
265
- // If the row has no column selected, remove it directly.
266
- if (!filter?.column?.value) {
267
- remove(index);
268
- } else {
269
- // Otherwise, add it to pending deletions for a soft delete.
270
- setPendingDeletions((prev) => [...prev, fieldId]);
271
- }
272
- };
273
-
274
- useEffect(() => {
275
- if (isAdvanceSearch) {
276
- // Helper function to check if a filter is truly empty
277
- const isEmptyFilter = (filter) => {
278
- return (
279
- !filter?.column?.value ||
280
- filter?.column?.value === null ||
281
- filter?.column?.value === "" ||
282
- (!filter?.operation?.value && !filter?.value)
283
- );
284
- };
285
-
286
- // Check if initialFilters was intentionally cleared (all filters are empty or empty array)
287
- const validInitialFilters =
288
- initialFilters?.filter((f) => !isEmptyFilter(f)) || [];
289
- const isIntentionallyCleared =
290
- initialFilters?.length === 0 || // Empty array means cleared
291
- (initialFilters?.length > 0 && validInitialFilters.length === 0); // Array with only empty filters
292
-
293
- // If filters were intentionally cleared, don't restore from filter model
294
- if (isIntentionallyCleared) {
295
- reset({ filters: [{ column: null, operation: null, value: "" }] });
296
- setIsClearAll(false);
297
- return;
298
- }
299
-
300
- const filterModel = args?.api?.getFilterModel?.() || {};
301
- const newFilters = [];
302
- Object.keys(filterModel).forEach((colId) => {
303
- const columnDef = colDefs.find(
304
- (col) => col?.colId === colId || col?.field === colId
305
- );
306
- if (!columnDef) return;
307
-
308
- let value = "";
309
- let operation = "";
310
-
311
- if (columnDef.filter === "agDateColumnFilter") {
312
- value = filterModel[colId]?.dateFrom || "";
313
- operation = "equals";
314
- } else if (columnDef.filter === "agNumberColumnFilter") {
315
- value = filterModel[colId]?.filter?.toString?.() || "";
316
- operation = filterModel[colId]?.type || "equals";
317
- } else {
318
- value = filterModel[colId]?.filter?.toString?.() || "";
319
- operation = "contains";
320
- }
321
-
322
- if (value) {
323
- newFilters.push({
324
- column: {
325
- label: columnDef.headerName,
326
- value: colId,
327
- },
328
- operation: {
329
- label: operation.charAt(0).toUpperCase() + operation.slice(1),
330
- value: operation,
331
- },
332
- value: value,
333
- });
334
- }
335
- });
336
-
337
- // If user typed filter in grid search box
338
- if (newFilters.length > 0) {
339
- reset({ filters: newFilters });
340
- } else {
341
- // ✅ Get filters from actualRef (agGrid)
342
- const actualFilters = actualRef?.current?.api?.getFilterModel?.() || {};
343
- const fieldOrder = Object.keys(actualFilters); // 👈 This maintains order
344
-
345
- const tempExtraFilters = fieldOrder?.map((colId) => {
346
- const filter = actualFilters[colId];
347
- return {
348
- column: {
349
- label: colId?.charAt(0)?.toUpperCase() + colId?.slice(1),
350
- value: colId,
351
- type: filter?.filterType || "text",
352
- },
353
- operation: {
354
- label:
355
- filter?.type?.charAt(0)?.toUpperCase() +
356
- filter?.type?.slice(1) || "Contains",
357
- value: filter?.type || "contains",
358
- },
359
- value: filter?.dateFrom || filter?.filter || "",
360
- id: "",
361
- };
362
- });
363
-
364
- // Remove duplicates if needed
365
- const merged = [
366
- ...tempExtraFilters,
367
- ...validInitialFilters?.filter(
368
- (f) => !fieldOrder?.includes(f?.column?.value)
369
- ),
370
- ];
371
-
372
- reset({
373
- filters:
374
- merged.length > 0
375
- ? merged
376
- : [{ column: null, operation: null, value: "" }],
377
- });
378
- }
379
-
380
- setIsClearAll(false);
381
- }
382
- }, [isAdvanceSearch, initialFilters, colDefs, args?.api]);
383
-
384
- useEffect(() => {
385
- if (!isAdvanceSearch) return;
386
-
387
- // Helper function to check if a filter is truly empty
388
- const isEmptyFilter = (filter) => {
389
- return (
390
- !filter?.column?.value ||
391
- filter?.column?.value === null ||
392
- filter?.column?.value === "" ||
393
- (!filter?.operation?.value && !filter?.value)
394
- );
395
- };
396
-
397
- // Check if initialFilters was intentionally cleared (all filters are empty or empty array)
398
- const validInitialFilters =
399
- initialFilters?.filter((f) => !isEmptyFilter(f)) || [];
400
- const isIntentionallyCleared =
401
- initialFilters?.length === 0 || // Empty array means cleared
402
- (initialFilters?.length > 0 && validInitialFilters.length === 0); // Array with only empty filters
403
-
404
- // If filters were intentionally cleared, don't restore from draftFilter or initialFilters
405
- if (isIntentionallyCleared) {
406
- reset({ filters: [{ column: null, operation: null, value: "" }] });
407
- setIsClearAll(false);
408
- return;
409
- }
410
-
411
- if (draftFilter?.length > 0) {
412
- // Merge logic: combine draftFilter with any new columns from initialFilters
413
- const draftColumnValues = draftFilter
414
- .map((f) => f?.column?.value)
415
- .filter(Boolean);
416
- const newColumnsFromInitial =
417
- validInitialFilters?.filter(
418
- (f) =>
419
- f?.column?.value && !draftColumnValues.includes(f?.column?.value)
420
- ) || [];
421
-
422
- const mergedFilters = [...draftFilter, ...newColumnsFromInitial];
423
-
424
- reset({ filters: mergedFilters });
425
- } else {
426
- reset({
427
- filters:
428
- validInitialFilters.length > 0
429
- ? validInitialFilters
430
- : [{ column: null, operation: null, value: "" }],
431
- });
432
- }
433
-
434
- setIsClearAll(false);
435
- }, [isAdvanceSearch, initialFilters, draftFilter]);
436
-
437
- const onSubmit = (data) => {};
438
-
439
- const handleClearAll = () => {
440
- const currentFilters = getValues()?.filters || [];
441
-
442
- // Save current filters in case user closes modal without applying
443
- const clonedFilters = cloneDeep(
444
- currentFilters.filter((f) => f?.column?.value)
445
- );
446
- setDraftFilter(clonedFilters);
447
-
448
- reset({
449
- filters: [
450
- {
451
- column: null,
452
- operation: null,
453
- value: "",
454
- },
455
- ],
456
- });
457
- setSoftCleared(true);
458
- setIsClearAll(true);
459
-
460
- // Immediately clear AG Grid filter model and advanced filter model
461
- actualRef?.current?.api?.setFilterModel(null);
462
-
463
- // Clear advanced filter model as well
464
- const model = actualRef?.current?.api?.getModel();
465
- if (model?.advancedFilterModel) {
466
- model.advancedFilterModel = {};
467
- }
468
-
469
- // Trigger filter change to update UI immediately
470
- Promise.resolve().then(() => {
471
- actualRef?.current?.api?.onFilterChanged();
472
- });
473
-
474
- // Update initialFilters immediately
475
- setInitialFilters([{ column: null, operation: null, value: "" }]);
476
-
477
- // Reset initialDataSet to force reinitialization on next open
478
- setInitialDataSet(false);
479
-
480
- args?.onClearAllClick?.();
481
- };
482
- const handleClearAllValues = () => {
483
- const allFilters = getValues()?.filters || [];
484
- const updatedFilters = allFilters
485
- ?.filter((filter, index) => {
486
- const fieldId = fields[index]?.fieldId;
487
- // Exclude fields that are pending deletion AND have empty columns
488
- return !pendingDeletions?.includes(fieldId) && filter?.column !== "";
489
- })
490
- .map((filter) => ({
491
- ...filter,
492
- value: undefined,
493
- }));
494
- reset({
495
- filters:
496
- updatedFilters?.length > 0
497
- ? updatedFilters
498
- : [
499
- {
500
- column: { label: "", value: "", type: "text" },
501
- operation: null,
502
- value: undefined,
503
- },
504
- ],
505
- });
506
- };
507
-
508
- const watchedFilters = watch("filters");
509
- const watchedColumns = watchedFilters?.map((filter) => filter?.column?.value);
510
-
511
- useEffect(() => {
512
- // Filter out null/empty values before checking for duplicates
513
- const nonEmptyColumns = watchedColumns?.filter(
514
- (col) => col !== null && col !== undefined && col !== ""
515
- );
516
- const hasDuplicates = hasDuplicateColumns(nonEmptyColumns);
517
- // Only validate if there are actual column selections, ignore empty fields
518
- setIsFormValid(!hasDuplicates);
519
- }, [watchedColumns]);
520
- useEffect(() => {
521
- if (!isFormValid) {
522
- setOpenToast(true);
523
- }
524
- }, [isFormValid]);
525
-
526
- const handleApplyFilters = () => {
527
- const allFilters = getValues()?.filters || [];
528
- setDraftFilter([]); // Always clear draftFilter when applying
529
- const updatedFilters = allFilters?.filter((field, index) => {
530
- const fieldId = fields[index]?.fieldId;
531
- return (
532
- !pendingDeletions?.includes(fieldId) &&
533
- field?.column?.value &&
534
- field?.operation?.value
535
- );
536
- });
537
-
538
- if (softCleared) {
539
- // Filters were already cleared in handleClearAll, just need to apply
540
- // Pass empty array to onSearchApplyClick
541
- args.onSearchApplyClick([]);
542
- setSoftCleared(false);
543
- setIsClearAll(false);
544
- setPendingDeletions([]);
545
- return; // Exit early - don't process filters
546
- } else {
547
- setInitialFilters(updatedFilters);
548
- }
549
-
550
- args.onSearchApplyClick(updatedFilters);
551
- const finalModel = updatedFilters?.reduce((acc, curr) => {
552
- if (curr?.column?.value && curr?.operation?.value) {
553
- let filterValue = curr?.value?.value || curr?.value;
554
- let filterType = "text";
555
-
556
- if (moment?.isMoment(filterValue)) {
557
- filterType = "date";
558
- filterValue = filterValue?.format("YYYY-MM-DD");
559
- }
560
-
561
- acc[curr?.column?.value] = {
562
- filter: filterValue,
563
- filterType,
564
- type: curr?.operation?.value,
565
- ...(filterType === "date" && { dateFrom: filterValue }),
566
- };
567
- }
568
- return acc;
569
- }, {});
570
-
571
- setSoftCleared(false);
572
-
573
- actualRef?.current?.api?.setFilterModel(finalModel);
574
-
575
- Promise.resolve().then(() => {
576
- actualRef?.current?.api?.onFilterChanged();
577
- });
578
-
579
- actualRef?.current?.api?.setFilterModel(finalModel);
580
-
581
- // Important: to update UI like search text in AgGridHeader
582
- Promise.resolve().then(() => {
583
- actualRef?.current?.api?.onFilterChanged();
584
- });
585
-
586
- setIsClearAll(false);
587
- setPendingDeletions([]); // clear state
588
- };
589
-
590
- const handleAdvanceSearchClose = () => {
591
- const currentFilters = getValues()?.filters || [];
592
-
593
- const cleanedFilters = currentFilters.filter((f) => {
594
- const hasColumn = f?.column?.value;
595
- const hasOperation = f?.operation?.value;
596
- const hasValue =
597
- typeof f?.value === "string"
598
- ? f?.value?.trim() !== ""
599
- : f?.value !== null && f?.value !== undefined;
600
-
601
- return hasColumn && (hasOperation || hasValue);
602
- });
603
-
604
- setPendingDeletions([]);
605
- setInitialFilters(cleanedFilters);
606
- };
607
-
608
- // Filter out the temporarily deleted fields to get only the visible ones on UI
609
- const visibleFields = fields?.filter(
610
- (field) => !pendingDeletions?.includes(field.fieldId)
611
- );
612
-
613
- return (
614
- <Modal
615
- className="ia-table-search-modal"
616
- onClose={() => {
617
- setPendingDeletions([]);
618
- // Reset initialDataSet when modal closes so it reinitializes on next open
619
- setInitialDataSet(false);
620
- toggleAdvanceSearch();
621
- if (!softCleared) {
622
- handleAdvanceSearchClose();
623
- }
624
- setSoftCleared(false);
625
- setIsClearAll(false);
626
- }}
627
- onPrimaryButtonClick={handleApplyFilters}
628
- onSecondaryButtonClick={(e) => {
629
- e.preventDefault();
630
- args?.onSearchSaveClick(getValues()?.filters);
631
- }}
632
- primaryButtonProps={{
633
- type: "submit",
634
- disabled: !isFormValid,
635
- }}
636
- secondaryButtonProps={{
637
- disabled: !isFormValid,
638
- }}
639
- primaryButtonLabel="Apply"
640
- secondaryButtonLabel={args?.onSearchSaveClick ? "Save search" : null}
641
- size="small"
642
- title="Search"
643
- width={850}
644
- height={400}
645
- open={isAdvanceSearch}
646
- >
647
- <div className="ia-table-search-header">
648
- <ButtonGroup
649
- options={[
650
- {
651
- label: "Search",
652
- value: "search",
653
- },
654
- {
655
- label: "Advance Search",
656
- value: "advanceSearch",
657
- },
658
- ]}
659
- selectedOption={activeOption}
660
- onChange={(e, val) => {
661
- e.preventDefault();
662
- setActiveOption(val);
663
- actualRef?.current?.api?.destroyFilter(null);
664
-
665
- // New logic to conditionally clear only operation if value is blank
666
- if (val === "advanceSearch") {
667
- const updatedFilters = getValues()?.filters?.map((filter) => {
668
- const shouldResetOp =
669
- filter.value === null || filter.value === "" || !filter.value;
670
-
671
- return {
672
- ...filter,
673
- operation: shouldResetOp ? null : filter.operation,
674
- };
675
- });
676
- reset({ filters: updatedFilters });
677
- }
678
- }}
679
- />
680
-
681
- <Button
682
- variant="url"
683
- size="small"
684
- type="button"
685
- onClick={(e) => {
686
- e.preventDefault();
687
- handleClearAll();
688
- }}
689
- >
690
- Clear all
691
- </Button>
692
- </div>
693
- <form
694
- onSubmit={(e) => {
695
- e.preventDefault();
696
- handleSubmit(onSubmit)(e);
697
- }}
698
- className="ia-table-search-content"
699
- >
700
- <div className="ia-table-search-content-title">
701
- Match all of the following rules
702
- </div>
703
-
704
- <>
705
- {savedAdvanceSearchConfig?.length > 0
706
- ? savedAdvanceSearchConfig
707
- : (() => {
708
- return fields
709
- ?.filter(
710
- (field) => !pendingDeletions?.includes(field.fieldId)
711
- )
712
- ?.map((field, visualIndex) => {
713
- // Find the actual index in the full fields array
714
- const actualIndex = fields.findIndex(
715
- (f) => f.fieldId === field.fieldId
716
- );
717
- return (
718
- <AdvanceSearchModalItem
719
- key={field.fieldId}
720
- colDefs={colDefs}
721
- control={control}
722
- index={visualIndex} // Visual index for UI purposes
723
- actualIndex={actualIndex} // Actual form index
724
- fields={fields}
725
- filteredColumnsInitialOptions={
726
- filteredColumnsInitialOptions
727
- }
728
- onDelete={() => {
729
- softRemove(actualIndex, field.fieldId);
730
- }}
731
- totalColumns={fields.length}
732
- currentColumnId={currentColumnId}
733
- activeOption={activeOption}
734
- getValues={getValues}
735
- addNewColumn={append}
736
- isClearAll={isClearAll}
737
- setToShowDuplicateColumnInAdvanceSearch={
738
- setToShowDuplicateColumnInAdvanceSearch
739
- }
740
- selectedThirdOptionDropdownValue={
741
- selectedThirdOptionDropdownValue
742
- }
743
- setSelectedThirdOptionDropdownValue={
744
- setSelectedThirdOptionDropdownValue
745
- }
746
- flag={flag}
747
- setFlag={setFlag}
748
- isLastVisible={visibleFields.length === 1}
749
- pendingDeletions={pendingDeletions}
750
- setPendingDeletions={setPendingDeletions}
751
- remove={remove}
752
- {...args}
753
- />
754
- );
755
- });
756
- })()}
757
- </>
758
- {!isFormValid && (
759
- <Toast
760
- isOpen={openToast}
761
- message="Please select an unselected column "
762
- onClose={() => setOpenToast(!openToast)}
763
- position="top-right"
764
- variant="warning"
765
- />
766
- )}
767
- <div className="ia-table-search-content-footer">
768
- <Button
769
- variant="secondary"
770
- size="large"
771
- onClick={handleClearAllValues}
772
- type="button"
773
- disabled={filteredColumnsInitialOptions?.length === 1}
774
- >
775
- Clear values
776
- </Button>
777
- <Button
778
- variant="tertiary"
779
- size="large"
780
- type="button"
781
- onClick={() => {
782
- append({
783
- column: "",
784
- operation: "",
785
- value: "",
786
- });
787
- }}
788
- disabled={visibleFields.length === allowedCols.length}
789
- icon={<AddOutlined />}
790
- >
791
- Add attribute
792
- </Button>
793
- </div>
794
- </form>
795
- </Modal>
796
- );
797
- }