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.
- package/MIGRATION_GUIDE.md +328 -0
- package/README.md +154 -15
- package/bin/migrate-image-paths.cjs +127 -0
- package/bin/migrate.js +293 -0
- package/codemods/component-map.js +153 -0
- package/codemods/image-paths-transform.js +69 -0
- package/codemods/transform.js +136 -0
- package/dist/components/Accordion/index.js +2 -1
- package/dist/components/AccordionModern/index.js +2 -1
- package/dist/components/Alert/index.js +2 -1
- package/dist/components/Avatar/index.js +2 -1
- package/dist/components/Badge/filled/filledIconLabelBadges/index.js +2 -1
- package/dist/components/Badge/filled/filledOnlyIconBadges/index.js +2 -1
- package/dist/components/Badge/filled/filledOnlyLabelBadges/index.js +2 -1
- package/dist/components/Badge/index.js +3 -2
- package/dist/components/Badge/stroke/strokeIconLabelBadges/index.js +2 -1
- package/dist/components/Badge/stroke/strokeOnlyIconBadges/index.js +2 -1
- package/dist/components/Badge/stroke/strokeOnlyLabelBadges/index.js +2 -1
- package/dist/components/Badge/subtle/subtleIOnlyIconBadges/index.js +2 -1
- package/dist/components/Badge/subtle/subtleIconLabelBadges/index.js +2 -1
- package/dist/components/Badge/subtle/subtleOnlyLabelBadges/index.js +2 -1
- package/dist/components/BottomSheet/index.js +2 -1
- package/dist/components/Breadcrumbs/index.js +2 -1
- package/dist/components/Button/index.js +2 -1
- package/dist/components/ButtonGroup/index.js +2 -1
- package/dist/components/Card/index.js +2 -1
- package/dist/components/Chart/index.js +2 -1
- package/dist/components/Chatbot/index.js +2 -1
- package/dist/components/Checkbox/index.js +2 -1
- package/dist/components/Chips/index.js +2 -1
- package/dist/components/CreateItemFlow/index.js +2 -1
- package/dist/components/DatePicker/datePickerDropdown.js +2 -1
- package/dist/components/DatePicker/index.js +3 -2
- package/dist/components/DateRangePicker/dateRangePickerDropdown.js +2 -1
- package/dist/components/DateRangePicker/index.js +3 -2
- package/dist/components/DynamicLayout/index.js +2 -1
- package/dist/components/EmptyState/EmptyStateImage.d.ts.map +1 -1
- package/dist/components/EmptyState/EmptyStateImage.js +3 -2
- package/dist/components/EmptyState/index.js +2 -1
- package/dist/components/FileUpload/index.js +2 -1
- package/dist/components/FilterPanel/index.js +2 -1
- package/dist/components/FiltersStrip/index.js +2 -1
- package/dist/components/Header/index.js +2 -1
- package/dist/components/HomePage/index.js +2 -1
- package/dist/components/Input/index.js +2 -1
- package/dist/components/Loader/index.js +2 -1
- package/dist/components/Menu/IconMenuItem.js +2 -1
- package/dist/components/Menu/MenuHeaderInfo.js +2 -1
- package/dist/components/Menu/NestedMenuItem.js +2 -1
- package/dist/components/Menu/index.js +2 -1
- package/dist/components/Menu/nestedMenuItemsFromObject.js +2 -1
- package/dist/components/Modal/index.js +2 -1
- package/dist/components/Notification/NotificationBody/NotificationList/NotificationList.js +2 -1
- package/dist/components/Notification/index.js +2 -1
- package/dist/components/Panel/index.js +2 -1
- package/dist/components/Popover/index.js +2 -1
- package/dist/components/ProgressBar/index.js +2 -1
- package/dist/components/Prompt/index.js +2 -1
- package/dist/components/RadioButtonGroup/index.js +2 -1
- package/dist/components/Select/index.js +2 -1
- package/dist/components/Sidebar/index.js +2 -1
- package/dist/components/Slider/index.js +2 -1
- package/dist/components/Stepper/index.js +2 -1
- package/dist/components/Switch/index.js +2 -1
- package/dist/components/Table/TableImpl.js +4 -3
- package/dist/components/TableChat/EmptyContainer.js +2 -1
- package/dist/components/TableChat/TableChatSidePanel.js +2 -1
- package/dist/components/TableChat/components/ChatMessageSkeleton/ChatFooterSkeleton.js +2 -1
- package/dist/components/TableChat/components/ChatMessageSkeleton/ChatHeaderSkeleton.js +2 -1
- package/dist/components/TableChat/components/ChatMessageSkeleton/ChatMessageListSkeleton.js +2 -1
- package/dist/components/TableChat/components/ChatMessageSkeleton/ChatSkeleton.js +2 -1
- package/dist/components/TableChat/components/TableChatLeftSection/AddChatContainer/AddChatContainer.js +2 -1
- package/dist/components/TableChat/components/TableChatLeftSection/TableChatChannelHeader.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/AvatarGroup/AvatarGroup.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatDefaultMessageType/ChatDefaultMessageType.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatDeleteMessageType/ChatDeletedMessageType.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeader.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatMessageAvatar/ChatMessageAvatar.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatMessages/ChatMessage.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatNotificationSettings/ChatNotificationSettings.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/DateSeparator/DateSeparator.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/PinedChatPanel/PinedChatPanel.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/TableChatRightSection.js +2 -1
- package/dist/components/TableChat/components/TextEditor/EditorToolbar.js +2 -1
- package/dist/components/TableChat/components/TextEditor/Mention.js +2 -1
- package/dist/components/TableChat/components/TextEditor/MentionList.js +2 -1
- package/dist/components/Tabs/index.js +2 -1
- package/dist/components/Tag/index.js +2 -1
- package/dist/components/TagGroup/index.js +2 -1
- package/dist/components/TextArea/index.js +2 -1
- package/dist/components/Toast/index.js +2 -1
- package/dist/components/Tooltip/index.js +2 -1
- package/dist/components/common/HelperText/index.js +2 -1
- package/dist/components/index.d.ts +0 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +0 -1
- package/dist/mcp-component-registry.json +1 -1
- package/dist/styles/entry.d.ts +2 -0
- package/dist/styles/entry.d.ts.map +1 -0
- package/dist/styles/entry.js +1 -0
- package/dist/styles/style.css +1 -1
- package/eslint-plugin/index.js +91 -0
- package/eslint-plugin/rules/no-barrel-import.js +224 -0
- package/package.json +153 -89
- package/dist/0db32db10ae1525f.svg +0 -9
- package/dist/2bc76319b1fa572e.svg +0 -9
- package/dist/39d49e4daed1a992.svg +0 -9
- package/dist/44beedf64dc29d19.svg +0 -9
- package/dist/49a4f914058314f1.svg +0 -9
- package/dist/6fc8a59d621a04a1.svg +0 -13
- package/dist/78f845dcfc981491.svg +0 -9
- package/dist/b31c0c2a19c1c19a.svg +0 -9
- package/dist/index.js +0 -308
- package/dist/index.js.map +0 -1
- package/src/components/Accordion/Accordion.styles.scss +0 -118
- package/src/components/Accordion/index.js +0 -104
- package/src/components/AccordionModern/AccordionModern.styles.scss +0 -121
- package/src/components/AccordionModern/SortableAccordionComp.js +0 -156
- package/src/components/AccordionModern/index.js +0 -103
- package/src/components/Alert/Alert.styles.scss +0 -131
- package/src/components/Alert/index.js +0 -71
- package/src/components/Avatar/Avatar.styles.scss +0 -25
- package/src/components/Avatar/index.js +0 -58
- package/src/components/Badge/Badges.style.scss +0 -55
- package/src/components/Badge/filled/filledIconLabelBadges/filledIconLabelBadges.styles.scss +0 -32
- package/src/components/Badge/filled/filledIconLabelBadges/index.js +0 -38
- package/src/components/Badge/filled/filledOnlyIconBadges/filledOnlyIconBadges.styles.scss +0 -26
- package/src/components/Badge/filled/filledOnlyIconBadges/index.js +0 -31
- package/src/components/Badge/filled/filledOnlyLabelBadges/filledOnlyLabelBadges.styles.scss +0 -66
- package/src/components/Badge/filled/filledOnlyLabelBadges/index.js +0 -31
- package/src/components/Badge/filled/index.js +0 -30
- package/src/components/Badge/index.js +0 -53
- package/src/components/Badge/stroke/index.js +0 -43
- package/src/components/Badge/stroke/strokeIconLabelBadges/index.js +0 -38
- package/src/components/Badge/stroke/strokeIconLabelBadges/strokeIconLabelBadges.styles.scss +0 -33
- package/src/components/Badge/stroke/strokeOnlyIconBadges/index.js +0 -31
- package/src/components/Badge/stroke/strokeOnlyIconBadges/strokeOnlyIconBadges.styles.scss +0 -27
- package/src/components/Badge/stroke/strokeOnlyLabelBadges/index.js +0 -31
- package/src/components/Badge/stroke/strokeOnlyLabelBadges/strokeOnlyLabelBadges.styles.scss +0 -89
- package/src/components/Badge/styles.css +0 -52
- package/src/components/Badge/subtle/index.js +0 -41
- package/src/components/Badge/subtle/subtleIOnlyIconBadges/index.js +0 -31
- package/src/components/Badge/subtle/subtleIOnlyIconBadges/subtleIOnlyIconBadges.scss +0 -26
- package/src/components/Badge/subtle/subtleIconLabelBadges/index.js +0 -38
- package/src/components/Badge/subtle/subtleIconLabelBadges/subtleIconLabelBadges.scss +0 -56
- package/src/components/Badge/subtle/subtleOnlyLabelBadges/index.js +0 -31
- package/src/components/Badge/subtle/subtleOnlyLabelBadges/subtleOnlyLabelBadges.scss +0 -70
- package/src/components/BottomSheet/BottomSheet.styles.scss +0 -46
- package/src/components/BottomSheet/index.js +0 -60
- package/src/components/Breadcrumbs/Breadcrumbs.styles.scss +0 -65
- package/src/components/Breadcrumbs/index.js +0 -121
- package/src/components/Button/Button.styles.scss +0 -345
- package/src/components/Button/index.js +0 -171
- package/src/components/ButtonGroup/ButtonGroup.styles.scss +0 -125
- package/src/components/ButtonGroup/index.js +0 -84
- package/src/components/Card/Card.styles.scss +0 -33
- package/src/components/Card/index.js +0 -21
- package/src/components/Chart/Chart.style.scss +0 -142
- package/src/components/Chart/index.js +0 -752
- package/src/components/ChatBot/bookMarkPanel.js +0 -74
- package/src/components/ChatBot/chatBot.style.scss +0 -1295
- package/src/components/ChatBot/chatBotFooter.js +0 -14
- package/src/components/ChatBot/chatBotLandingScreen.js +0 -26
- package/src/components/ChatBot/chatInput.js +0 -206
- package/src/components/ChatBot/chatbotModuleMenu.js +0 -278
- package/src/components/ChatBot/constant.js +0 -32
- package/src/components/ChatBot/conversationScreen.js +0 -281
- package/src/components/ChatBot/customScreen.js +0 -69
- package/src/components/ChatBot/historyPanel.js +0 -579
- package/src/components/ChatBot/index.js +0 -473
- package/src/components/ChatBot/newChatComponent.js +0 -105
- package/src/components/ChatBot/utils.js +0 -27
- package/src/components/Checkbox/Checkbox.styles.scss +0 -232
- package/src/components/Checkbox/dashed/index.js +0 -34
- package/src/components/Checkbox/default/index.js +0 -70
- package/src/components/Checkbox/index.js +0 -50
- package/src/components/Checkbox/withDropDown/index.js +0 -96
- package/src/components/Checkbox/withoutFormLabel/index.js +0 -46
- package/src/components/Chips/Chip.style.scss +0 -134
- package/src/components/Chips/index.js +0 -34
- package/src/components/CreateItemFlow/CreateItemFlow.styles.scss +0 -37
- package/src/components/CreateItemFlow/index.js +0 -145
- package/src/components/DatePicker/DatePicker.styles.scss +0 -519
- package/src/components/DatePicker/datePickerDropdown.js +0 -282
- package/src/components/DatePicker/datePickerFooter.js +0 -76
- package/src/components/DatePicker/datePickerInput.js +0 -333
- package/src/components/DatePicker/index.js +0 -288
- package/src/components/DatePicker/showMonthYearSelect.js +0 -119
- package/src/components/DateRangePicker/DateRangePicker.styles.scss +0 -635
- package/src/components/DateRangePicker/dateRangePickerCustom.js +0 -22
- package/src/components/DateRangePicker/dateRangePickerDropdown.js +0 -320
- package/src/components/DateRangePicker/dateRangePickerFooter.js +0 -50
- package/src/components/DateRangePicker/dateRangePickerInput.js +0 -544
- package/src/components/DateRangePicker/index.js +0 -393
- package/src/components/DateRangePicker/showMonthYearSelect.js +0 -103
- package/src/components/DateRangePicker/utils.js +0 -71
- package/src/components/DynamicLayout/DynamicLayout.styles.scss +0 -153
- package/src/components/DynamicLayout/index.js +0 -73
- package/src/components/EmptyState/EmptyState.styles.scss +0 -88
- package/src/components/EmptyState/EmptyStateImageComponent.jsx +0 -36
- package/src/components/EmptyState/index.js +0 -54
- package/src/components/FileUpload/FileUpload.styles.scss +0 -449
- package/src/components/FileUpload/index.js +0 -641
- package/src/components/FilterPanel/FilterPanel.styles.scss +0 -241
- package/src/components/FilterPanel/FilterPanelHeader.js +0 -15
- package/src/components/FilterPanel/PanelFooter.js +0 -65
- package/src/components/FilterPanel/PanelSidebar.js +0 -85
- package/src/components/FilterPanel/index.js +0 -147
- package/src/components/FiltersStrip/FiltersStrip.styles.scss +0 -343
- package/src/components/FiltersStrip/Slider/FilterSlider.styles.scss +0 -85
- package/src/components/FiltersStrip/Slider/Portal.js +0 -59
- package/src/components/FiltersStrip/Slider/index.js +0 -233
- package/src/components/FiltersStrip/appliedFilter.js +0 -180
- package/src/components/FiltersStrip/filterDropDown.js +0 -96
- package/src/components/FiltersStrip/index.js +0 -127
- package/src/components/FiltersStrip/mockData.js +0 -227
- package/src/components/Header/Header.styles.scss +0 -223
- package/src/components/Header/index.js +0 -156
- package/src/components/HomePage/HomePage.styles.scss +0 -1638
- package/src/components/HomePage/constant.js +0 -331
- package/src/components/HomePage/index.js +0 -675
- package/src/components/Input/Input.styles.scss +0 -318
- package/src/components/Input/helperText.js +0 -19
- package/src/components/Input/index.js +0 -60
- package/src/components/Input/inputWithIcon.js +0 -134
- package/src/components/Input/vanilaInput.js +0 -68
- package/src/components/Loader/Loader.styles.scss +0 -90
- package/src/components/Loader/index.js +0 -69
- package/src/components/Menu/IconMenuItem.js +0 -100
- package/src/components/Menu/Menu.styles.scss +0 -190
- package/src/components/Menu/MenuHeader.jsx +0 -84
- package/src/components/Menu/MenuHeaderInfo.jsx +0 -319
- package/src/components/Menu/MenuHeaderInfo.styles.scss +0 -123
- package/src/components/Menu/NestedMenuItem.js +0 -189
- package/src/components/Menu/index.js +0 -254
- package/src/components/Menu/nestedMenuItemsFromObject.js +0 -100
- package/src/components/Modal/Modal.styles.scss +0 -129
- package/src/components/Modal/index.js +0 -141
- package/src/components/MonthPicker/MonthPicker.styles.scss +0 -255
- package/src/components/MonthPicker/constant.js +0 -1
- package/src/components/MonthPicker/index.js +0 -373
- package/src/components/MonthRangePicker/MonthRangePicker.styles.scss +0 -383
- package/src/components/MonthRangePicker/constant.js +0 -1
- package/src/components/MonthRangePicker/index.js +0 -574
- package/src/components/Notification/Notification.styles.scss +0 -594
- package/src/components/Notification/NotificationBody/NotificationInfoList/chipsLists.js +0 -144
- package/src/components/Notification/NotificationBody/NotificationInfoList/index.js +0 -128
- package/src/components/Notification/NotificationBody/NotificationInfoList/notificationList.js +0 -165
- package/src/components/Notification/NotificationBody/NotificationPanels/chipsLists.js +0 -85
- package/src/components/Notification/NotificationBody/NotificationPanels/index.js +0 -259
- package/src/components/Notification/NotificationBody/NotificationPanels/notificationList.js +0 -637
- package/src/components/Notification/NotificationBody/index.js +0 -117
- package/src/components/Notification/index.js +0 -128
- package/src/components/Notification/mockData.js +0 -389
- package/src/components/Notification/notificationFooter.js +0 -31
- package/src/components/Notification/notificationHeader.js +0 -28
- package/src/components/Panel/Panel.styles.scss +0 -71
- package/src/components/Panel/index.js +0 -144
- package/src/components/Popover/Popover.styles.scss +0 -52
- package/src/components/Popover/index.js +0 -71
- package/src/components/Portal/index.js +0 -31
- package/src/components/ProgressBar/ProgressBar.styles.scss +0 -62
- package/src/components/ProgressBar/index.js +0 -40
- package/src/components/Prompt/Prompt.styles.scss +0 -107
- package/src/components/Prompt/index.js +0 -107
- package/src/components/RadioButtonGroup/RadioButtonGroup.styles.scss +0 -136
- package/src/components/RadioButtonGroup/index.js +0 -107
- package/src/components/Select/SearchFilter.js +0 -72
- package/src/components/Select/Select.styles.scss +0 -748
- package/src/components/Select/customGroupHeading.js +0 -24
- package/src/components/Select/dropdown.js +0 -65
- package/src/components/Select/hooks/index.js +0 -2
- package/src/components/Select/hooks/useClickOutside.js +0 -61
- package/src/components/Select/hooks/useMenuPosition.js +0 -288
- package/src/components/Select/index.js +0 -1307
- package/src/components/Select/menuList.js +0 -119
- package/src/components/Select/optionList.js +0 -215
- package/src/components/Select/selected-option-tags.js +0 -99
- package/src/components/Select/utils.js +0 -232
- package/src/components/Sidebar/Menus/childMenu.js +0 -88
- package/src/components/Sidebar/Menus/index.js +0 -130
- package/src/components/Sidebar/Menus/parentMenu.js +0 -173
- package/src/components/Sidebar/Sidebar.styles.scss +0 -411
- package/src/components/Sidebar/actions.js +0 -31
- package/src/components/Sidebar/index.js +0 -84
- package/src/components/Sidebar/mock.js +0 -202
- package/src/components/Slider/Sliders.styles.scss +0 -260
- package/src/components/Slider/index.js +0 -314
- package/src/components/Stepper/Stepper.styles.scss +0 -355
- package/src/components/Stepper/index.js +0 -101
- package/src/components/Switch/Switch.styles.scss +0 -96
- package/src/components/Switch/index.js +0 -59
- package/src/components/Table/AdvanceSearchModalItem.js +0 -392
- package/src/components/Table/AdvanceSortModal.js +0 -332
- package/src/components/Table/AgGridHeader.js +0 -1009
- package/src/components/Table/CommentsPortal.js +0 -428
- package/src/components/Table/NewAdvanceSearchModal/NewAdvanceSearchModal.js +0 -323
- package/src/components/Table/NewAdvanceSearchModal/NewAdvanceSearchModalItem.js +0 -476
- package/src/components/Table/NoComments.js +0 -295
- package/src/components/Table/Table.styles.scss +0 -3859
- package/src/components/Table/actionBar.js +0 -43
- package/src/components/Table/advanceSearchModal.js +0 -797
- package/src/components/Table/commentPanel.js +0 -421
- package/src/components/Table/filterUtils.js +0 -850
- package/src/components/Table/index.js +0 -2175
- package/src/components/Table/mockData.js +0 -1344
- package/src/components/Table/tableFunctions.js +0 -1676
- package/src/components/Table/tableHeader.js +0 -476
- package/src/components/Table/tableIcons.js +0 -61
- package/src/components/Table/tableMoreOptions.js +0 -293
- package/src/components/Table/tablePagination.js +0 -63
- package/src/components/Table/tableSettings.js +0 -287
- package/src/components/Table/withCommentIcon.js +0 -107
- package/src/components/TableChat/EmptyContainer.jsx +0 -13
- package/src/components/TableChat/README.md +0 -588
- package/src/components/TableChat/TableChatSidePanel.jsx +0 -832
- package/src/components/TableChat/TableChatSidePanel.styles.scss +0 -57
- package/src/components/TableChat/components/ChatMessageSkeleton/ChatFooterSkeleton.jsx +0 -43
- package/src/components/TableChat/components/ChatMessageSkeleton/ChatHeaderSkeleton.jsx +0 -55
- package/src/components/TableChat/components/ChatMessageSkeleton/ChatMessageListSkeleton.jsx +0 -94
- package/src/components/TableChat/components/ChatMessageSkeleton/ChatSkeleton.jsx +0 -22
- package/src/components/TableChat/components/ChatMessageSkeleton/ChatSkeleton.scss +0 -179
- package/src/components/TableChat/components/SkeletonList.jsx +0 -12
- package/src/components/TableChat/components/TableChatLeftSection/AddChatContainer/AddChatContainer.jsx +0 -171
- package/src/components/TableChat/components/TableChatLeftSection/AddChatContainer/AddChatContainer.styles.scss +0 -37
- package/src/components/TableChat/components/TableChatLeftSection/ChannelCheckbox/ChannelCheckbox.jsx +0 -28
- package/src/components/TableChat/components/TableChatLeftSection/ChatChannelItem.jsx +0 -116
- package/src/components/TableChat/components/TableChatLeftSection/ChatChannelList.jsx +0 -89
- package/src/components/TableChat/components/TableChatLeftSection/ChatHeaderButton/ChatHeaderButton.jsx +0 -27
- package/src/components/TableChat/components/TableChatLeftSection/ChatHeaderNavigation.jsx +0 -191
- package/src/components/TableChat/components/TableChatLeftSection/ChatIconButton/ChatIconButton.jsx +0 -23
- package/src/components/TableChat/components/TableChatLeftSection/TableChatChannelHeader.jsx +0 -117
- package/src/components/TableChat/components/TableChatLeftSection/TableChatChannelHeader.styles.scss +0 -469
- package/src/components/TableChat/components/TableChatLeftSection/UnreadBadge/UnreadBadge.jsx +0 -16
- package/src/components/TableChat/components/TableChatRightSection/AvatarGroup/AvatarGroup.jsx +0 -119
- package/src/components/TableChat/components/TableChatRightSection/AvatarGroup/AvatarGroup.styles.scss +0 -87
- package/src/components/TableChat/components/TableChatRightSection/ChatDefaultMessageType/ChatDefaultMessageType.jsx +0 -216
- package/src/components/TableChat/components/TableChatRightSection/ChatDefaultMessageType/ChatDefaultMessageType.styles.scss +0 -291
- package/src/components/TableChat/components/TableChatRightSection/ChatDeleteMessageType/ChatDeletedMessageType.jsx +0 -19
- package/src/components/TableChat/components/TableChatRightSection/ChatDeleteMessageType/DeletedMessage.styles.scss +0 -55
- package/src/components/TableChat/components/TableChatRightSection/ChatEditedMessageType/ChatEditedMessageType.jsx +0 -61
- package/src/components/TableChat/components/TableChatRightSection/ChatEditedMessageType/ChatEditedMessageType.styles.scss +0 -13
- package/src/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeader.jsx +0 -432
- package/src/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderAction.jsx +0 -365
- package/src/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderInfo.jsx +0 -42
- package/src/components/TableChat/components/TableChatRightSection/ChatHeader/chatHeader.styles.scss +0 -323
- package/src/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.jsx +0 -793
- package/src/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.styles.scss +0 -394
- package/src/components/TableChat/components/TableChatRightSection/ChatMessageActions/ChatMessageActions.jsx +0 -61
- package/src/components/TableChat/components/TableChatRightSection/ChatMessageActions/ChatMessageActions.styles.scss +0 -28
- package/src/components/TableChat/components/TableChatRightSection/ChatMessageAvatar/ChatMessageAvatar.jsx +0 -11
- package/src/components/TableChat/components/TableChatRightSection/ChatMessageAvatar/ChatMessageAvatar.styles.scss +0 -3
- package/src/components/TableChat/components/TableChatRightSection/ChatMessages/ChatMessage.jsx +0 -220
- package/src/components/TableChat/components/TableChatRightSection/ChatMessages/ChatMessage.styles.scss +0 -128
- package/src/components/TableChat/components/TableChatRightSection/ChatNotificationSettings/ChatNotificationSettings.jsx +0 -246
- package/src/components/TableChat/components/TableChatRightSection/ChatNotificationSettings/ChatNotificationSettings.styles.scss +0 -210
- package/src/components/TableChat/components/TableChatRightSection/DateSeparator/DateSeparator.jsx +0 -52
- package/src/components/TableChat/components/TableChatRightSection/DateSeparator/DateSeparator.styles.scss +0 -34
- package/src/components/TableChat/components/TableChatRightSection/EmojiPicker/EmojiPicker.jsx +0 -31
- package/src/components/TableChat/components/TableChatRightSection/FileUploader/FileUploader.jsx +0 -170
- package/src/components/TableChat/components/TableChatRightSection/ImageUploader/ImageUploader.jsx +0 -165
- package/src/components/TableChat/components/TableChatRightSection/PinedChatPanel/PinedChat.styles.scss +0 -587
- package/src/components/TableChat/components/TableChatRightSection/PinedChatPanel/PinedChatPanel.jsx +0 -244
- package/src/components/TableChat/components/TableChatRightSection/ReplyBadge/ReplyBadge.jsx +0 -29
- package/src/components/TableChat/components/TableChatRightSection/ReplyBadge/ReplyBadge.styles.scss +0 -47
- package/src/components/TableChat/components/TableChatRightSection/TableChatRightSection.jsx +0 -1340
- package/src/components/TableChat/components/TableChatRightSection/TableChatRightSection.styles.scss +0 -147
- package/src/components/TableChat/components/TextEditor/EditorToolbar.jsx +0 -209
- package/src/components/TableChat/components/TextEditor/EditorToolbar.styles.scss +0 -61
- package/src/components/TableChat/components/TextEditor/Mention.jsx +0 -234
- package/src/components/TableChat/components/TextEditor/MentionList.jsx +0 -118
- package/src/components/TableChat/components/TextEditor/MentionList.scss +0 -146
- package/src/components/TableChat/components/TextEditor/styles.scss +0 -278
- package/src/components/TableChat/components/TextEditor/suggestion.js +0 -124
- package/src/components/TableChat/components/chatConfig.js +0 -64
- package/src/components/TableChat/hooks/useInfiniteScroll.js +0 -256
- package/src/components/TableOld/AgGridHeader.js +0 -545
- package/src/components/TableOld/Table.styles.scss +0 -2192
- package/src/components/TableOld/actionBar.js +0 -43
- package/src/components/TableOld/index.js +0 -598
- package/src/components/TableOld/mockData.js +0 -1344
- package/src/components/TableOld/tableFunctions.js +0 -1734
- package/src/components/TableOld/tableHeader.js +0 -251
- package/src/components/TableOld/tableIcons.js +0 -61
- package/src/components/TableOld/tablePagination.js +0 -64
- package/src/components/TableOld/tableSettings.js +0 -166
- package/src/components/Tabs/Tabs.styles.scss +0 -120
- package/src/components/Tabs/index.js +0 -91
- package/src/components/Tabs/tabPanel.js +0 -38
- package/src/components/Tag/Tags.styles.scss +0 -71
- package/src/components/Tag/filled.js +0 -48
- package/src/components/Tag/index.js +0 -54
- package/src/components/Tag/solid.js +0 -47
- package/src/components/Tag/stroke.js +0 -47
- package/src/components/Tag/utils.js +0 -12
- package/src/components/TagGroup/TagGroup.styles.scss +0 -7
- package/src/components/TagGroup/index.js +0 -6
- package/src/components/TextArea/TextArea.styles.scss +0 -158
- package/src/components/TextArea/index.js +0 -121
- package/src/components/Toast/Toast.styles.scss +0 -66
- package/src/components/Toast/index.js +0 -35
- package/src/components/Tooltip/Tooltips.styles.scss +0 -111
- package/src/components/Tooltip/index.js +0 -68
- package/src/components/common/HelperText/HelperText.styles.scss +0 -18
- package/src/components/common/HelperText/index.js +0 -44
- package/src/components/common/MentionEditor/MentionEditor.styles.scss +0 -301
- package/src/components/common/MentionEditor/MentionList/MentionList.styles.scss +0 -146
- package/src/components/common/MentionEditor/MentionList/index.js +0 -130
- package/src/components/common/MentionEditor/index.js +0 -246
- package/src/components/common/MentionEditor/suggestion.js +0 -124
- package/src/components/index.js +0 -53
- package/src/stories/Accordion.stories.js +0 -151
- package/src/stories/AccordionModern.stories.js +0 -263
- package/src/stories/Alert.stories.js +0 -103
- package/src/stories/Avatar.stories.js +0 -79
- package/src/stories/Badge.stories.js +0 -112
- package/src/stories/BottomSheet.stories.js +0 -224
- package/src/stories/Breadcrumbs.stories.js +0 -143
- package/src/stories/Button.stories.js +0 -190
- package/src/stories/ButtonGroup.stories.js +0 -123
- package/src/stories/Card.stories.js +0 -73
- package/src/stories/Changelog.mdx +0 -1006
- package/src/stories/Chart.stories.js +0 -2017
- package/src/stories/ChatBot.stories.js +0 -668
- package/src/stories/Checkbox.stories.js +0 -209
- package/src/stories/Chips.stories.js +0 -106
- package/src/stories/CreateItemFlow.stories.js +0 -255
- package/src/stories/DatePicker.stories.js +0 -311
- package/src/stories/DateRangePicker.stories.js +0 -364
- package/src/stories/EmptyState.stories.js +0 -110
- package/src/stories/FileUpload.stories.js +0 -169
- package/src/stories/FilterPanel.stories.js +0 -309
- package/src/stories/FiltersStrip.stories.js +0 -244
- package/src/stories/GettingStarted.mdx +0 -153
- package/src/stories/Header.stories.js +0 -185
- package/src/stories/HomePage.stories.js +0 -201
- package/src/stories/Input.stories.js +0 -165
- package/src/stories/Loader.stories.js +0 -33
- package/src/stories/Menu.stories.js +0 -309
- package/src/stories/Modal.stories.js +0 -185
- package/src/stories/MonthPicker.stories.js +0 -313
- package/src/stories/MonthRangePicker.stories.js +0 -255
- package/src/stories/Notification.stories.js +0 -500
- package/src/stories/Panel.stories.js +0 -179
- package/src/stories/Popover.stories.js +0 -125
- package/src/stories/ProgressBar.stories.js +0 -93
- package/src/stories/Prompt.stories.js +0 -120
- package/src/stories/RadioButtonGroup.stories.js +0 -83
- package/src/stories/Select.stories.js +0 -753
- package/src/stories/Sidebar.stories.js +0 -177
- package/src/stories/Slider.stories.js +0 -226
- package/src/stories/Stepper.stories.js +0 -158
- package/src/stories/Switch.stories.js +0 -72
- package/src/stories/Table.stories.js +0 -4323
- package/src/stories/TableChat.mdx +0 -992
- package/src/stories/TableChat.stories.js +0 -1712
- package/src/stories/TableOld.stories.js +0 -954
- package/src/stories/Tabs.stories.js +0 -253
- package/src/stories/Tag.stories.js +0 -92
- package/src/stories/TagGroup.stories.js +0 -39
- package/src/stories/TextArea.stories.js +0 -148
- package/src/stories/Toast.stories.js +0 -113
- package/src/stories/Tooltip.stories.js +0 -86
- package/src/stories/storybookLinks.mdx +0 -20
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import React, { useRef, useEffect, useState } from "react";
|
|
2
|
-
import { FixedSizeList as List } from "react-window";
|
|
3
|
-
import { components } from "react-select";
|
|
4
|
-
import { Loader } from "../Loader";
|
|
5
|
-
import { Button } from "../Button";
|
|
6
|
-
import { ReactComponent as ShowAllIcon } from "../../assets/showAll.svg";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// MenuList using react-window for virtualization
|
|
10
|
-
export const MenuList = (props) => {
|
|
11
|
-
const { options, children, maxHeight, isLoading } = props;
|
|
12
|
-
const height = 37; // Height of each option
|
|
13
|
-
const [dynamicHeight, setDynamicHeight] = useState(
|
|
14
|
-
Math.min(options.length * height, maxHeight)
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
const listRef = useRef();
|
|
18
|
-
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
let calcHeight = options.length * height;
|
|
21
|
-
if (props?.selectProps?.isLoadingMore) {
|
|
22
|
-
calcHeight += 92;
|
|
23
|
-
}
|
|
24
|
-
const dynamicHeight = Math.min(calcHeight, maxHeight);
|
|
25
|
-
setDynamicHeight(dynamicHeight);
|
|
26
|
-
}, [options, props?.selectProps?.isLoadingMore]);
|
|
27
|
-
|
|
28
|
-
const handleScroll = ({ scrollOffset, scrollUpdateWasRequested }) => {
|
|
29
|
-
if (!listRef.current || scrollUpdateWasRequested) return;
|
|
30
|
-
const totalHeight = options.length * height;
|
|
31
|
-
if (scrollOffset + dynamicHeight >= totalHeight - 2) {
|
|
32
|
-
if (
|
|
33
|
-
props.selectProps &&
|
|
34
|
-
typeof props.selectProps.onMenuScrollToBottom === "function"
|
|
35
|
-
) {
|
|
36
|
-
props.selectProps.onMenuScrollToBottom();
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
if (isLoading) {
|
|
42
|
-
return (
|
|
43
|
-
<components.MenuList className="menulistScroll" {...props}>
|
|
44
|
-
<div className="ia-select-loading-container">
|
|
45
|
-
<Loader size="small" />
|
|
46
|
-
</div>
|
|
47
|
-
</components.MenuList>
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (options?.length === 0) {
|
|
52
|
-
return (
|
|
53
|
-
<components.MenuList className="menulistScroll" {...props}>
|
|
54
|
-
<div className="ia-select-no-options-message">
|
|
55
|
-
{props?.selectProps?.noOptionMessage}
|
|
56
|
-
</div>
|
|
57
|
-
</components.MenuList>
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return (
|
|
62
|
-
<>
|
|
63
|
-
<components.MenuList className="menulistScroll" {...props}>
|
|
64
|
-
<List
|
|
65
|
-
ref={listRef}
|
|
66
|
-
height={dynamicHeight}
|
|
67
|
-
itemCount={
|
|
68
|
-
props?.selectProps?.isLoadingMore
|
|
69
|
-
? options.length + 1
|
|
70
|
-
: options.length
|
|
71
|
-
}
|
|
72
|
-
itemSize={height}
|
|
73
|
-
width="100%"
|
|
74
|
-
onScroll={handleScroll}
|
|
75
|
-
>
|
|
76
|
-
{({ index, style }) => {
|
|
77
|
-
if (props?.selectProps?.isLoadingMore && index === options.length) {
|
|
78
|
-
return (
|
|
79
|
-
<div
|
|
80
|
-
className="ia-select-loading-container ia-select-loading-more-container"
|
|
81
|
-
style={style}
|
|
82
|
-
>
|
|
83
|
-
<Loader size="small" />
|
|
84
|
-
</div>
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
return <div style={style}>{children[index]}</div>;
|
|
88
|
-
}}
|
|
89
|
-
</List>
|
|
90
|
-
</components.MenuList>
|
|
91
|
-
|
|
92
|
-
{props?.selectProps?.maxSelectableOptions && options?.length > 0 && (
|
|
93
|
-
<span className="ia-select-max-selectable-options">{`Maximum ${props?.selectProps?.maxSelectableOptions} selections`}</span>
|
|
94
|
-
)}
|
|
95
|
-
|
|
96
|
-
{props?.selectProps?.showFooterMessage?.description && options?.length > 0 && (
|
|
97
|
-
<div className="ia-select-footer-message">
|
|
98
|
-
<span className="ia-select-max-selectable-options">
|
|
99
|
-
{props?.selectProps?.showFooterMessage?.description}
|
|
100
|
-
</span>
|
|
101
|
-
{props?.selectProps?.showFooterMessage?.actionButtonText &&
|
|
102
|
-
<Button
|
|
103
|
-
icon={<ShowAllIcon />}
|
|
104
|
-
iconPlacement="right"
|
|
105
|
-
size="small"
|
|
106
|
-
type="default"
|
|
107
|
-
variant="url"
|
|
108
|
-
onClick={(e) => {
|
|
109
|
-
e.stopPropagation();
|
|
110
|
-
props?.selectProps?.showFooterMessage?.action?.();
|
|
111
|
-
}}
|
|
112
|
-
>
|
|
113
|
-
{props?.selectProps?.showFooterMessage?.actionButtonText}
|
|
114
|
-
</Button>}
|
|
115
|
-
</div>
|
|
116
|
-
)}
|
|
117
|
-
</>
|
|
118
|
-
);
|
|
119
|
-
};
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useRef, useState } from "react";
|
|
2
|
-
import { components } from "react-select";
|
|
3
|
-
import { Tooltip } from "../Tooltip";
|
|
4
|
-
import MUICheckbox from "@mui/material/Checkbox";
|
|
5
|
-
import { Checkbox } from "../Checkbox";
|
|
6
|
-
import ChevronRightIcon from "@mui/icons-material/ChevronRight";
|
|
7
|
-
|
|
8
|
-
// Add helper function to get selected children count
|
|
9
|
-
const getSelectedChildrenCount = (parent, selectedOptions) => {
|
|
10
|
-
if (!parent.children || !selectedOptions || !Array.isArray(selectedOptions))
|
|
11
|
-
return 0;
|
|
12
|
-
const selectedParent = selectedOptions.find(
|
|
13
|
-
(sel) => sel.value === parent.value
|
|
14
|
-
);
|
|
15
|
-
return selectedParent ? selectedParent.children.length : 0;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
// Helper to check if all children are selected
|
|
19
|
-
const areAllChildrenSelected = (option, selectedOptions) => {
|
|
20
|
-
if (!option.children || !selectedOptions || !Array.isArray(selectedOptions))
|
|
21
|
-
return false;
|
|
22
|
-
const selectedParent = selectedOptions.find(
|
|
23
|
-
(sel) => sel.value === option.value
|
|
24
|
-
);
|
|
25
|
-
return (
|
|
26
|
-
selectedParent && selectedParent.children.length === option.children.length
|
|
27
|
-
);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
// Renders a label and only wraps it with Tooltip if it overflows its container
|
|
31
|
-
const OverflowTooltipLabel = ({ text, popperProps }) => {
|
|
32
|
-
const labelRef = useRef(null);
|
|
33
|
-
const [isOverflowed, setIsOverflowed] = useState(false);
|
|
34
|
-
|
|
35
|
-
const checkOverflow = () => {
|
|
36
|
-
const el = labelRef.current;
|
|
37
|
-
if (!el) return;
|
|
38
|
-
setIsOverflowed(el.scrollWidth > el.clientWidth);
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
checkOverflow();
|
|
43
|
-
}, [text]);
|
|
44
|
-
|
|
45
|
-
useEffect(() => {
|
|
46
|
-
window.addEventListener("resize", checkOverflow);
|
|
47
|
-
return () => window.removeEventListener("resize", checkOverflow);
|
|
48
|
-
}, []);
|
|
49
|
-
|
|
50
|
-
const content = <span ref={labelRef}>{text}</span>;
|
|
51
|
-
|
|
52
|
-
return isOverflowed ? (
|
|
53
|
-
<Tooltip
|
|
54
|
-
title={text}
|
|
55
|
-
orientation="right"
|
|
56
|
-
variant="tertiary"
|
|
57
|
-
className="select-tooltip"
|
|
58
|
-
PopperProps={popperProps}
|
|
59
|
-
>
|
|
60
|
-
{content}
|
|
61
|
-
</Tooltip>
|
|
62
|
-
) : (
|
|
63
|
-
content
|
|
64
|
-
);
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export const Option = ({
|
|
68
|
-
isLoadingOption,
|
|
69
|
-
isDisabled,
|
|
70
|
-
customOptionProps,
|
|
71
|
-
...props
|
|
72
|
-
}) => {
|
|
73
|
-
const {
|
|
74
|
-
data,
|
|
75
|
-
isSelected,
|
|
76
|
-
isMulti,
|
|
77
|
-
isWithIcon,
|
|
78
|
-
selectedOptions,
|
|
79
|
-
initialOptions,
|
|
80
|
-
} = props;
|
|
81
|
-
|
|
82
|
-
const resolveComponent = (type) => {
|
|
83
|
-
if (isMulti) {
|
|
84
|
-
const hasChildren = data.children && data.children.length > 0;
|
|
85
|
-
const selectedCount = hasChildren
|
|
86
|
-
? getSelectedChildrenCount(data, selectedOptions)
|
|
87
|
-
: 0;
|
|
88
|
-
const allChildrenSelected = hasChildren
|
|
89
|
-
? areAllChildrenSelected(data, selectedOptions)
|
|
90
|
-
: false;
|
|
91
|
-
|
|
92
|
-
const popperProps = {
|
|
93
|
-
modifiers: [
|
|
94
|
-
{
|
|
95
|
-
name: "offset",
|
|
96
|
-
options: {
|
|
97
|
-
offset: [0, 18],
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
],
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
return (
|
|
104
|
-
<Checkbox
|
|
105
|
-
withoutFormLabel={true}
|
|
106
|
-
label={
|
|
107
|
-
<div className="select-label-with-icon">
|
|
108
|
-
{data.children ? (
|
|
109
|
-
<>
|
|
110
|
-
<OverflowTooltipLabel
|
|
111
|
-
text={data.label}
|
|
112
|
-
popperProps={popperProps}
|
|
113
|
-
/>
|
|
114
|
-
{hasChildren && selectedCount > 0 && (
|
|
115
|
-
<span className="selected-children-count">
|
|
116
|
-
({selectedCount})
|
|
117
|
-
</span>
|
|
118
|
-
)}
|
|
119
|
-
</>
|
|
120
|
-
) : (
|
|
121
|
-
<OverflowTooltipLabel
|
|
122
|
-
text={data.label}
|
|
123
|
-
popperProps={popperProps}
|
|
124
|
-
/>
|
|
125
|
-
)}
|
|
126
|
-
</div>
|
|
127
|
-
}
|
|
128
|
-
checked={isSelected}
|
|
129
|
-
variant={
|
|
130
|
-
hasChildren && selectedCount > 0 && !allChildrenSelected
|
|
131
|
-
? "dashed"
|
|
132
|
-
: "default"
|
|
133
|
-
}
|
|
134
|
-
onChange={() => null}
|
|
135
|
-
disabled={isLoadingOption || isDisabled}
|
|
136
|
-
/>
|
|
137
|
-
);
|
|
138
|
-
} else {
|
|
139
|
-
// Handle non-multi case
|
|
140
|
-
const isParentSelected =
|
|
141
|
-
data.children &&
|
|
142
|
-
data.children.some(
|
|
143
|
-
(child) => selectedOptions && selectedOptions.value === child.value
|
|
144
|
-
);
|
|
145
|
-
const isOptionSelected = isSelected || isParentSelected;
|
|
146
|
-
|
|
147
|
-
const popperProps = {
|
|
148
|
-
modifiers: [
|
|
149
|
-
{
|
|
150
|
-
name: "offset",
|
|
151
|
-
options: {
|
|
152
|
-
offset: [0, 15],
|
|
153
|
-
},
|
|
154
|
-
},
|
|
155
|
-
],
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
return (
|
|
159
|
-
<div
|
|
160
|
-
className={`select-label-with-icon ${
|
|
161
|
-
isOptionSelected ? "selected" : ""
|
|
162
|
-
} ${isDisabled ? "disabled" : ""}`}
|
|
163
|
-
>
|
|
164
|
-
{data.children ? (
|
|
165
|
-
<>
|
|
166
|
-
<OverflowTooltipLabel
|
|
167
|
-
text={data?.label}
|
|
168
|
-
popperProps={popperProps}
|
|
169
|
-
/>
|
|
170
|
-
</>
|
|
171
|
-
) : (
|
|
172
|
-
<OverflowTooltipLabel text={data.label} popperProps={popperProps} />
|
|
173
|
-
)}
|
|
174
|
-
</div>
|
|
175
|
-
);
|
|
176
|
-
}
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
const renderOption = (type) => (
|
|
180
|
-
<components.Option {...props}>
|
|
181
|
-
<div
|
|
182
|
-
className={`select-option-content ${
|
|
183
|
-
props.isSelected ||
|
|
184
|
-
(data.children &&
|
|
185
|
-
data.children.some(
|
|
186
|
-
(child) =>
|
|
187
|
-
selectedOptions && selectedOptions.value === child.value
|
|
188
|
-
))
|
|
189
|
-
? "selected"
|
|
190
|
-
: ""
|
|
191
|
-
}`}
|
|
192
|
-
{...customOptionProps}
|
|
193
|
-
>
|
|
194
|
-
{resolveComponent(type)}
|
|
195
|
-
{props.data.children && props.data.children.length > 0 && (
|
|
196
|
-
<ChevronRightIcon className="select-submenu-chevron" />
|
|
197
|
-
)}
|
|
198
|
-
</div>
|
|
199
|
-
</components.Option>
|
|
200
|
-
);
|
|
201
|
-
|
|
202
|
-
if (props.selectProps.isMulti && props.selectProps.isWithIcon) {
|
|
203
|
-
return renderOption("isMulti-with-icon");
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
if (props.selectProps.isMulti && !props.selectProps.isWithIcon) {
|
|
207
|
-
return renderOption("isMulti");
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
if (!props.selectProps.isMulti && props.selectProps.isWithIcon) {
|
|
211
|
-
return renderOption("with-icon");
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
return renderOption(props.isMulti ? "isMulti" : "default");
|
|
215
|
-
};
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef, useRef, useState } from "react";
|
|
2
|
-
import { Tag } from "../Tag";
|
|
3
|
-
import { Tooltip } from "../Tooltip";
|
|
4
|
-
import MoreHorizIcon from "@mui/icons-material/MoreHoriz";
|
|
5
|
-
|
|
6
|
-
export const SelectedOptionsTags = ({ selectedOptions, onChange }) => {
|
|
7
|
-
const optionListTagRef = useRef(null);
|
|
8
|
-
const [isSelectedOptionsTagListOpen, setSelectedOptionsTagListOpen] =
|
|
9
|
-
useState(false);
|
|
10
|
-
|
|
11
|
-
const handleOptionTagRemove = (option) => {
|
|
12
|
-
const updatedOptions = selectedOptions.filter(
|
|
13
|
-
(op) => op.value !== option.value,
|
|
14
|
-
);
|
|
15
|
-
onChange(updatedOptions);
|
|
16
|
-
};
|
|
17
|
-
return (
|
|
18
|
-
<div className="select-options-tag-group">
|
|
19
|
-
{selectedOptions.length > 0 ? (
|
|
20
|
-
<>
|
|
21
|
-
{/* to only display first 3 selected options under select */}
|
|
22
|
-
{selectedOptions.slice(0, 3).map((option, index) => {
|
|
23
|
-
return (
|
|
24
|
-
<SelectedOptionTag
|
|
25
|
-
orientation="bottom"
|
|
26
|
-
key={index}
|
|
27
|
-
label={option.label}
|
|
28
|
-
onClose={() => handleOptionTagRemove(option)}
|
|
29
|
-
className="selected-option-tag"
|
|
30
|
-
/>
|
|
31
|
-
);
|
|
32
|
-
})}
|
|
33
|
-
{/* rest of the options are hidden and displayed in the popup list */}
|
|
34
|
-
{selectedOptions.length > 3 && (
|
|
35
|
-
<>
|
|
36
|
-
<div className="tag-group-open" ref={optionListTagRef}>
|
|
37
|
-
<Tag
|
|
38
|
-
size="small"
|
|
39
|
-
onClick={(e) => {
|
|
40
|
-
setSelectedOptionsTagListOpen((prevState) => !prevState);
|
|
41
|
-
}}
|
|
42
|
-
label={<span className="tag-group-more" />}
|
|
43
|
-
/>
|
|
44
|
-
</div>
|
|
45
|
-
{isSelectedOptionsTagListOpen && (
|
|
46
|
-
<SelectedOptionsTagList
|
|
47
|
-
selectedOptions={selectedOptions}
|
|
48
|
-
ref={optionListTagRef}
|
|
49
|
-
handleOptionTagRemove={handleOptionTagRemove}
|
|
50
|
-
className="selected-option-tag"
|
|
51
|
-
/>
|
|
52
|
-
)}
|
|
53
|
-
</>
|
|
54
|
-
)}
|
|
55
|
-
</>
|
|
56
|
-
) : null}
|
|
57
|
-
</div>
|
|
58
|
-
);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export const SelectedOptionsTagList = forwardRef(
|
|
62
|
-
({ selectedOptions, handleOptionTagRemove }, ref) => {
|
|
63
|
-
return (
|
|
64
|
-
<div
|
|
65
|
-
className="select-options-tag-list"
|
|
66
|
-
style={{
|
|
67
|
-
top: ref.current?.offsetTop + 25,
|
|
68
|
-
left: ref.current?.offsetLeft,
|
|
69
|
-
}}
|
|
70
|
-
>
|
|
71
|
-
{/* to display rest of the options in list */}
|
|
72
|
-
{selectedOptions.slice(3, selectedOptions.length).map((option) => {
|
|
73
|
-
return (
|
|
74
|
-
<SelectedOptionTag
|
|
75
|
-
orientation="right"
|
|
76
|
-
label={option.label}
|
|
77
|
-
onClose={() => handleOptionTagRemove(option)}
|
|
78
|
-
/>
|
|
79
|
-
);
|
|
80
|
-
})}
|
|
81
|
-
</div>
|
|
82
|
-
);
|
|
83
|
-
},
|
|
84
|
-
);
|
|
85
|
-
|
|
86
|
-
const SelectedOptionTag = ({ orientation, onClose, label }) => {
|
|
87
|
-
return (
|
|
88
|
-
<Tooltip
|
|
89
|
-
title={label}
|
|
90
|
-
orientation={orientation}
|
|
91
|
-
trigger="hover"
|
|
92
|
-
variant="primary"
|
|
93
|
-
>
|
|
94
|
-
<span>
|
|
95
|
-
<Tag size="small" isRemovable onDelete={onClose} label={label} />
|
|
96
|
-
</span>
|
|
97
|
-
</Tooltip>
|
|
98
|
-
);
|
|
99
|
-
};
|
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
export const handleSearch = ({
|
|
2
|
-
isMulti,
|
|
3
|
-
event,
|
|
4
|
-
externalOnSearch,
|
|
5
|
-
initialOptions,
|
|
6
|
-
setCurrentOptions,
|
|
7
|
-
setOpenToast,
|
|
8
|
-
setToastMessage,
|
|
9
|
-
setSearchTerm,
|
|
10
|
-
}) => {
|
|
11
|
-
setSearchTerm(event.target.value);
|
|
12
|
-
if (externalOnSearch) {
|
|
13
|
-
externalOnSearch(event);
|
|
14
|
-
} else {
|
|
15
|
-
const isNonAlphaNumeric = (str) => /[^\w,]/.test(str);
|
|
16
|
-
const options = [...initialOptions];
|
|
17
|
-
// const searchTerm = isMulti
|
|
18
|
-
// ? event.target.value
|
|
19
|
-
// .trim()
|
|
20
|
-
// .toUpperCase()
|
|
21
|
-
// .replace(/\s/g, "")
|
|
22
|
-
// .split(",")
|
|
23
|
-
// .filter((item) => item != "")
|
|
24
|
-
// : event.target.value.trim().toUpperCase().replace(/\s/g, "");
|
|
25
|
-
|
|
26
|
-
const searchTerm = event.target.value
|
|
27
|
-
.trim()
|
|
28
|
-
.split(",")
|
|
29
|
-
.filter((item) => item !== "");
|
|
30
|
-
|
|
31
|
-
if (searchTerm && searchTerm.length > 0) {
|
|
32
|
-
const searchResults = options.filter((option) => {
|
|
33
|
-
return searchTerm.some((term) => {
|
|
34
|
-
return option.label
|
|
35
|
-
.toString()
|
|
36
|
-
.toLowerCase()
|
|
37
|
-
.includes(term.toLowerCase().trim());
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
setCurrentOptions([...searchResults]);
|
|
41
|
-
} else {
|
|
42
|
-
setCurrentOptions(initialOptions);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* handle when select all option is passed through props
|
|
49
|
-
*/
|
|
50
|
-
|
|
51
|
-
export const handleSelectAll = ({
|
|
52
|
-
event,
|
|
53
|
-
externalOnSelectAll,
|
|
54
|
-
setIsSelectAll,
|
|
55
|
-
currentOptions,
|
|
56
|
-
selectedOptions,
|
|
57
|
-
setSelectedOptions,
|
|
58
|
-
handleSelect,
|
|
59
|
-
}) => {
|
|
60
|
-
if (externalOnSelectAll) {
|
|
61
|
-
externalOnSelectAll(event);
|
|
62
|
-
} else {
|
|
63
|
-
if (event && event.target.checked) {
|
|
64
|
-
setIsSelectAll(true);
|
|
65
|
-
|
|
66
|
-
//currentOptions without selectedOptions
|
|
67
|
-
const restCurrentOptions = currentOptions.filter(
|
|
68
|
-
(option) =>
|
|
69
|
-
!selectedOptions.find(
|
|
70
|
-
(selectedOption) =>
|
|
71
|
-
selectedOption.label === option.label &&
|
|
72
|
-
option.value === selectedOption.value
|
|
73
|
-
)
|
|
74
|
-
);
|
|
75
|
-
//console.log(selectedOptions, restCurrentOptions);
|
|
76
|
-
setSelectedOptions([...selectedOptions, ...restCurrentOptions]);
|
|
77
|
-
handleSelect([...selectedOptions, ...restCurrentOptions]);
|
|
78
|
-
} else {
|
|
79
|
-
setIsSelectAll(false);
|
|
80
|
-
setSelectedOptions([]);
|
|
81
|
-
handleSelect([]);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* select all options if we passed isWithSelectAll props
|
|
88
|
-
*/
|
|
89
|
-
|
|
90
|
-
export const handleSelectAllWhenCompLoads = ({
|
|
91
|
-
currentOptions,
|
|
92
|
-
selectedOptions,
|
|
93
|
-
setSelectedOptions,
|
|
94
|
-
}) => {
|
|
95
|
-
const restCurrentOptions = currentOptions.filter(
|
|
96
|
-
(option) =>
|
|
97
|
-
!selectedOptions.find(
|
|
98
|
-
(selectedOption) =>
|
|
99
|
-
selectedOption.label === option.label &&
|
|
100
|
-
option.value === selectedOption.value
|
|
101
|
-
)
|
|
102
|
-
);
|
|
103
|
-
setSelectedOptions([...selectedOptions, ...restCurrentOptions]);
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* handle when handle clear all
|
|
108
|
-
*/
|
|
109
|
-
|
|
110
|
-
export const handleClearAll = ({
|
|
111
|
-
externalOnClearAll,
|
|
112
|
-
setSelectedOptions,
|
|
113
|
-
setIsSelectAll,
|
|
114
|
-
handleSelect,
|
|
115
|
-
syncParentChildSelection,
|
|
116
|
-
}) => {
|
|
117
|
-
if (externalOnClearAll) {
|
|
118
|
-
externalOnClearAll();
|
|
119
|
-
} else {
|
|
120
|
-
setSelectedOptions([]);
|
|
121
|
-
setIsSelectAll(false);
|
|
122
|
-
handleSelect([]);
|
|
123
|
-
syncParentChildSelection([]);
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* handle when handle select dropdown close
|
|
129
|
-
*/
|
|
130
|
-
|
|
131
|
-
export const handleDropdownClose = ({
|
|
132
|
-
externalOnDropdownClose,
|
|
133
|
-
setCurrentOptions,
|
|
134
|
-
initialOptions,
|
|
135
|
-
currentOptions,
|
|
136
|
-
setIsOpen,
|
|
137
|
-
onBlur,
|
|
138
|
-
event,
|
|
139
|
-
}) => {
|
|
140
|
-
setIsOpen(false);
|
|
141
|
-
if (onBlur) {
|
|
142
|
-
onBlur(event);
|
|
143
|
-
}
|
|
144
|
-
if (externalOnDropdownClose) {
|
|
145
|
-
externalOnDropdownClose();
|
|
146
|
-
} else {
|
|
147
|
-
setCurrentOptions(
|
|
148
|
-
initialOptions.length > 0 ? initialOptions : currentOptions
|
|
149
|
-
);
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* handle when handle select dropdown open
|
|
155
|
-
*/
|
|
156
|
-
|
|
157
|
-
export const handleDropdownOpen = ({
|
|
158
|
-
externalOnDropdownOpen,
|
|
159
|
-
isOpen,
|
|
160
|
-
setIsOpen,
|
|
161
|
-
}) => {
|
|
162
|
-
if (externalOnDropdownOpen) {
|
|
163
|
-
externalOnDropdownOpen();
|
|
164
|
-
setIsOpen(!isOpen);
|
|
165
|
-
} else {
|
|
166
|
-
setIsOpen(!isOpen);
|
|
167
|
-
}
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
export const getPlaceholder = (
|
|
171
|
-
isMulti,
|
|
172
|
-
selectedOptions,
|
|
173
|
-
placeholder,
|
|
174
|
-
customPlaceholderAfterSelect = null,
|
|
175
|
-
selectionLabels = {}
|
|
176
|
-
) => {
|
|
177
|
-
if (!isMulti && Object.entries(selectedOptions || {}).length > 0) {
|
|
178
|
-
return typeof selectedOptions.value !== "undefined"
|
|
179
|
-
? selectedOptions.label
|
|
180
|
-
: placeholder;
|
|
181
|
-
} else if (isMulti && selectedOptions.length > 0) {
|
|
182
|
-
return selectedOptions.length === 1
|
|
183
|
-
? selectedOptions[0].label
|
|
184
|
-
: `${selectionLabels.selected || "Selected"} (${
|
|
185
|
-
customPlaceholderAfterSelect
|
|
186
|
-
? customPlaceholderAfterSelect
|
|
187
|
-
: selectedOptions.length
|
|
188
|
-
})`;
|
|
189
|
-
}
|
|
190
|
-
return placeholder;
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
export const onKeyDown = ({ e, focusedIndex, currentOptions }) => {
|
|
194
|
-
const searchResults = Array.from(
|
|
195
|
-
document.getElementsByClassName("menulistScroll")
|
|
196
|
-
);
|
|
197
|
-
|
|
198
|
-
if (e.keyCode === 40 && focusedIndex.current + 1 < currentOptions.length) {
|
|
199
|
-
focusedIndex.current = focusedIndex.current + 1;
|
|
200
|
-
}
|
|
201
|
-
if (e.keyCode === 38 && focusedIndex.current - 1 >= 0) {
|
|
202
|
-
focusedIndex.current = focusedIndex.current - 1;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
searchResults.forEach((element, index) => {
|
|
206
|
-
const classList = element.classList.value;
|
|
207
|
-
if (index === focusedIndex.current) {
|
|
208
|
-
element.className = "multi-select__option--is-focused " + classList;
|
|
209
|
-
} else {
|
|
210
|
-
element.classList.remove("multi-select__option--is-focused");
|
|
211
|
-
}
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
if (e.keyCode === 13 && searchResults.length > 0) {
|
|
215
|
-
//When a enter key is pressed, currently focused element would be selected
|
|
216
|
-
if (focusedIndex.current > 0) {
|
|
217
|
-
searchResults[focusedIndex.current].click();
|
|
218
|
-
} else if (focusedIndex.current === 0) {
|
|
219
|
-
searchResults[0].click();
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
export const flattenOptions = (options) => {
|
|
224
|
-
if (!options || !Array.isArray(options)) return [];
|
|
225
|
-
|
|
226
|
-
return options?.reduce((flatOptions, option) => {
|
|
227
|
-
if (option.options) {
|
|
228
|
-
return [...flatOptions, ...option.options];
|
|
229
|
-
}
|
|
230
|
-
return [...flatOptions, option];
|
|
231
|
-
}, []);
|
|
232
|
-
};
|