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,282 +0,0 @@
|
|
|
1
|
-
import React, { useState, useLayoutEffect, useRef } from "react";
|
|
2
|
-
import { DayPickerSingleDateController } from "react-dates";
|
|
3
|
-
import DatePickerFooter from "./datePickerFooter";
|
|
4
|
-
import ShowMonthYearSelect from "./showMonthYearSelect";
|
|
5
|
-
import moment from "moment";
|
|
6
|
-
import Portal from "../Portal";
|
|
7
|
-
|
|
8
|
-
export default function DatePickerDropdown({
|
|
9
|
-
datePickerMainContainer,
|
|
10
|
-
onDatesChange,
|
|
11
|
-
focused,
|
|
12
|
-
setFocused,
|
|
13
|
-
selectedDate,
|
|
14
|
-
setSelectedDate,
|
|
15
|
-
showWeekNumbers,
|
|
16
|
-
setIsOpen,
|
|
17
|
-
withPortal,
|
|
18
|
-
portalContainer,
|
|
19
|
-
containerRef,
|
|
20
|
-
showMonthYearSelect,
|
|
21
|
-
customYears,
|
|
22
|
-
tertiaryButtonProps,
|
|
23
|
-
primaryButtonProps,
|
|
24
|
-
onTertiaryButtonClick,
|
|
25
|
-
onSecondaryButtonClick,
|
|
26
|
-
onPrimaryButtonClick,
|
|
27
|
-
minDate,
|
|
28
|
-
maxDate,
|
|
29
|
-
placement,
|
|
30
|
-
hideTertiaryButton,
|
|
31
|
-
hideSecondaryButton,
|
|
32
|
-
hidePrimaryButton,
|
|
33
|
-
dropdownRef: externalDropdownRef,
|
|
34
|
-
allButtonsHidden,
|
|
35
|
-
...args
|
|
36
|
-
}) {
|
|
37
|
-
const [position, setPosition] = useState({
|
|
38
|
-
x: 0,
|
|
39
|
-
y: 0,
|
|
40
|
-
offsetHeight: 0,
|
|
41
|
-
offsetWidth: 0,
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
const internalDropdownRef = useRef(null);
|
|
45
|
-
const dropdownRef = externalDropdownRef || internalDropdownRef;
|
|
46
|
-
const [dropdownWidth, setDropdownWidth] = useState(269);
|
|
47
|
-
const [dropdownHeight, setDropdownHeight] = useState(
|
|
48
|
-
allButtonsHidden ? 250 : 300
|
|
49
|
-
);
|
|
50
|
-
|
|
51
|
-
useLayoutEffect(() => {
|
|
52
|
-
let frame = null;
|
|
53
|
-
|
|
54
|
-
const update = () => {
|
|
55
|
-
if (!containerRef?.current) return;
|
|
56
|
-
|
|
57
|
-
const scrollY = window.scrollY || document.documentElement.scrollTop;
|
|
58
|
-
const {
|
|
59
|
-
x,
|
|
60
|
-
y,
|
|
61
|
-
height: offsetHeight,
|
|
62
|
-
width: offsetWidth,
|
|
63
|
-
} = containerRef.current.getBoundingClientRect();
|
|
64
|
-
setPosition({ x, y: y + scrollY, offsetHeight, offsetWidth });
|
|
65
|
-
|
|
66
|
-
if (dropdownRef.current) {
|
|
67
|
-
const rect = dropdownRef.current.getBoundingClientRect();
|
|
68
|
-
if (rect.width) setDropdownWidth(rect.width);
|
|
69
|
-
if (rect.height) setDropdownHeight(rect.height);
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
const scheduleUpdate = () => {
|
|
74
|
-
if (frame !== null) return;
|
|
75
|
-
frame = requestAnimationFrame(() => {
|
|
76
|
-
update();
|
|
77
|
-
frame = null;
|
|
78
|
-
});
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
// Initial measure
|
|
82
|
-
update();
|
|
83
|
-
|
|
84
|
-
// Schedule a second measure after paint so the dropdown DOM is fully rendered
|
|
85
|
-
let rafOuter = requestAnimationFrame(() => {
|
|
86
|
-
rafOuter = null;
|
|
87
|
-
rafOuter = requestAnimationFrame(() => {
|
|
88
|
-
rafOuter = null;
|
|
89
|
-
update();
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
window.addEventListener("resize", scheduleUpdate);
|
|
94
|
-
window.addEventListener("scroll", scheduleUpdate, true);
|
|
95
|
-
|
|
96
|
-
return () => {
|
|
97
|
-
window.removeEventListener("resize", scheduleUpdate);
|
|
98
|
-
window.removeEventListener("scroll", scheduleUpdate, true);
|
|
99
|
-
if (frame !== null) cancelAnimationFrame(frame);
|
|
100
|
-
if (rafOuter !== null) cancelAnimationFrame(rafOuter);
|
|
101
|
-
};
|
|
102
|
-
}, [
|
|
103
|
-
containerRef,
|
|
104
|
-
placement,
|
|
105
|
-
withPortal,
|
|
106
|
-
showMonthYearSelect,
|
|
107
|
-
showWeekNumbers,
|
|
108
|
-
allButtonsHidden,
|
|
109
|
-
]);
|
|
110
|
-
|
|
111
|
-
const handleDateChange = (date) => {
|
|
112
|
-
if (date) {
|
|
113
|
-
const newDate = moment(date);
|
|
114
|
-
onDatesChange(newDate);
|
|
115
|
-
} else {
|
|
116
|
-
onDatesChange(null);
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
const renderDayContents = React.useCallback((momentInstance, modifiers) => {
|
|
121
|
-
// Calculate the week number within the month
|
|
122
|
-
const startOfMonth = momentInstance.clone().startOf("month");
|
|
123
|
-
const weekNumber = Math.ceil(
|
|
124
|
-
(momentInstance.date() - 1 + startOfMonth.day()) / 7
|
|
125
|
-
);
|
|
126
|
-
|
|
127
|
-
return (
|
|
128
|
-
<>
|
|
129
|
-
{/* Add week numbers, adds one button each row */}
|
|
130
|
-
{showWeekNumbers && modifiers.has("first-day-of-week") && (
|
|
131
|
-
<span className="CalendarDayWeekNumber">W{weekNumber + 1}</span>
|
|
132
|
-
)}
|
|
133
|
-
<span className="CalendarDayNumber">{momentInstance.format("D")}</span>
|
|
134
|
-
</>
|
|
135
|
-
);
|
|
136
|
-
}, []);
|
|
137
|
-
|
|
138
|
-
const renderCalendar = () => {
|
|
139
|
-
const currentDate = selectedDate ? moment(selectedDate) : null;
|
|
140
|
-
return (
|
|
141
|
-
<DayPickerSingleDateController
|
|
142
|
-
key={`calendar-${withPortal ? "portal" : "inline"}-${
|
|
143
|
-
focused ? "focused" : "unfocused"
|
|
144
|
-
}`}
|
|
145
|
-
onDateChange={handleDateChange}
|
|
146
|
-
onFocusChange={() => setFocused(true)}
|
|
147
|
-
focused={focused}
|
|
148
|
-
date={currentDate}
|
|
149
|
-
initialMonth={currentDate || moment()}
|
|
150
|
-
hideKeyboardShortcutsPanel={true}
|
|
151
|
-
daySize={26}
|
|
152
|
-
horizontalMonthPadding={showWeekNumbers ? 24 : 12}
|
|
153
|
-
renderDayContents={showWeekNumbers ? renderDayContents : undefined}
|
|
154
|
-
renderMonthElement={
|
|
155
|
-
showMonthYearSelect
|
|
156
|
-
? ({ month, onMonthSelect, onYearSelect }) => (
|
|
157
|
-
<ShowMonthYearSelect
|
|
158
|
-
customYears={customYears}
|
|
159
|
-
month={month}
|
|
160
|
-
onMonthSelect={onMonthSelect}
|
|
161
|
-
onYearSelect={onYearSelect}
|
|
162
|
-
minDate={minDate}
|
|
163
|
-
maxDate={maxDate}
|
|
164
|
-
/>
|
|
165
|
-
)
|
|
166
|
-
: undefined
|
|
167
|
-
}
|
|
168
|
-
{...args}
|
|
169
|
-
/>
|
|
170
|
-
);
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
if (withPortal) {
|
|
174
|
-
const spacing = 6;
|
|
175
|
-
const scrollX = window.scrollX || document.documentElement.scrollLeft;
|
|
176
|
-
const scrollY = window.scrollY || document.documentElement.scrollTop;
|
|
177
|
-
const viewportWidth = window.innerWidth;
|
|
178
|
-
const viewportTopOffset = 64;
|
|
179
|
-
const top =
|
|
180
|
-
placement === "top"
|
|
181
|
-
? position.y - dropdownHeight - spacing
|
|
182
|
-
: position.y + position.offsetHeight + spacing;
|
|
183
|
-
|
|
184
|
-
const clampedTop = Math.max(viewportTopOffset + scrollY, top);
|
|
185
|
-
|
|
186
|
-
const rightPadding = 10;
|
|
187
|
-
const leftPadding = 10;
|
|
188
|
-
const triggerRight = position.x + position.offsetWidth;
|
|
189
|
-
const wouldOverflowRight =
|
|
190
|
-
position.x + dropdownWidth > viewportWidth - rightPadding;
|
|
191
|
-
|
|
192
|
-
const viewportLeft = wouldOverflowRight
|
|
193
|
-
? triggerRight - dropdownWidth
|
|
194
|
-
: position.x;
|
|
195
|
-
|
|
196
|
-
const clampedViewportLeft = Math.min(
|
|
197
|
-
Math.max(leftPadding, viewportLeft),
|
|
198
|
-
viewportWidth - dropdownWidth - rightPadding
|
|
199
|
-
);
|
|
200
|
-
const documentLeft = clampedViewportLeft + scrollX;
|
|
201
|
-
|
|
202
|
-
return (
|
|
203
|
-
<Portal container={portalContainer}>
|
|
204
|
-
<div
|
|
205
|
-
className="impact-portal-container"
|
|
206
|
-
style={{
|
|
207
|
-
top: clampedTop,
|
|
208
|
-
left: documentLeft,
|
|
209
|
-
width: (position.offsetWidth || 0) + "px",
|
|
210
|
-
}}
|
|
211
|
-
>
|
|
212
|
-
<div
|
|
213
|
-
className={`impact-date-picker-dropdown-container impact-date-picker-dropdown-portal ${
|
|
214
|
-
showWeekNumbers ? "showWeekNumbers" : ""
|
|
215
|
-
}`}
|
|
216
|
-
ref={dropdownRef}
|
|
217
|
-
>
|
|
218
|
-
{renderCalendar()}
|
|
219
|
-
<DatePickerFooter
|
|
220
|
-
tertiaryButtonProps={tertiaryButtonProps}
|
|
221
|
-
primaryButtonProps={primaryButtonProps}
|
|
222
|
-
setSelectedDate={setSelectedDate}
|
|
223
|
-
setFocused={setFocused}
|
|
224
|
-
onSecondaryButtonClick={onSecondaryButtonClick}
|
|
225
|
-
onPrimaryButtonClick={onPrimaryButtonClick}
|
|
226
|
-
onTertiaryButtonClick={onTertiaryButtonClick}
|
|
227
|
-
setIsOpen={setIsOpen}
|
|
228
|
-
hideTertiaryButton={hideTertiaryButton}
|
|
229
|
-
hideSecondaryButton={hideSecondaryButton}
|
|
230
|
-
hidePrimaryButton={hidePrimaryButton}
|
|
231
|
-
/>
|
|
232
|
-
</div>
|
|
233
|
-
</div>
|
|
234
|
-
<div
|
|
235
|
-
className="ia-select-container-v3-blanket"
|
|
236
|
-
onClick={() => setIsOpen(false)}
|
|
237
|
-
/>
|
|
238
|
-
</Portal>
|
|
239
|
-
);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
const viewportWidth = window.innerWidth;
|
|
243
|
-
const rightPadding = 10;
|
|
244
|
-
const leftPadding = 10;
|
|
245
|
-
|
|
246
|
-
const triggerRight = position.x + position.offsetWidth;
|
|
247
|
-
const wouldOverflowRight =
|
|
248
|
-
position.x + dropdownWidth > viewportWidth - rightPadding;
|
|
249
|
-
const viewportLeft = wouldOverflowRight
|
|
250
|
-
? triggerRight - dropdownWidth
|
|
251
|
-
: position.x;
|
|
252
|
-
const clampedViewportLeft = Math.min(
|
|
253
|
-
Math.max(leftPadding, viewportLeft),
|
|
254
|
-
viewportWidth - dropdownWidth - rightPadding
|
|
255
|
-
);
|
|
256
|
-
const relativeLeft = clampedViewportLeft - position.x;
|
|
257
|
-
|
|
258
|
-
return (
|
|
259
|
-
<div
|
|
260
|
-
className={`impact-date-picker-dropdown-container ${
|
|
261
|
-
placement === "top" ? "impact-date-picker-dropdown-top" : ""
|
|
262
|
-
} ${showWeekNumbers ? "showWeekNumbers" : ""}`}
|
|
263
|
-
style={{ left: relativeLeft }}
|
|
264
|
-
ref={dropdownRef}
|
|
265
|
-
>
|
|
266
|
-
{renderCalendar()}
|
|
267
|
-
<DatePickerFooter
|
|
268
|
-
tertiaryButtonProps={tertiaryButtonProps}
|
|
269
|
-
primaryButtonProps={primaryButtonProps}
|
|
270
|
-
setSelectedDate={setSelectedDate}
|
|
271
|
-
setFocused={setFocused}
|
|
272
|
-
onTertiaryButtonClick={onTertiaryButtonClick}
|
|
273
|
-
onSecondaryButtonClick={onSecondaryButtonClick}
|
|
274
|
-
onPrimaryButtonClick={onPrimaryButtonClick}
|
|
275
|
-
setIsOpen={setIsOpen}
|
|
276
|
-
hideTertiaryButton={hideTertiaryButton}
|
|
277
|
-
hideSecondaryButton={hideSecondaryButton}
|
|
278
|
-
hidePrimaryButton={hidePrimaryButton}
|
|
279
|
-
/>
|
|
280
|
-
</div>
|
|
281
|
-
);
|
|
282
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Button } from "../Button";
|
|
3
|
-
|
|
4
|
-
export default function DatePickerFooter({
|
|
5
|
-
tertiaryButtonProps,
|
|
6
|
-
secondaryButtonProps,
|
|
7
|
-
primaryButtonProps,
|
|
8
|
-
setSelectedDate,
|
|
9
|
-
setFocused,
|
|
10
|
-
onTertiaryButtonClick,
|
|
11
|
-
onSecondaryButtonClick,
|
|
12
|
-
onPrimaryButtonClick,
|
|
13
|
-
setIsOpen,
|
|
14
|
-
hideTertiaryButton,
|
|
15
|
-
hideSecondaryButton,
|
|
16
|
-
hidePrimaryButton,
|
|
17
|
-
}) {
|
|
18
|
-
const handleClear = () => {
|
|
19
|
-
setSelectedDate(null);
|
|
20
|
-
setFocused(false);
|
|
21
|
-
onTertiaryButtonClick?.();
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const handleCancel = () => {
|
|
25
|
-
setIsOpen(false);
|
|
26
|
-
setFocused(false);
|
|
27
|
-
onSecondaryButtonClick?.();
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const handelApply = () => {
|
|
31
|
-
setIsOpen(false);
|
|
32
|
-
onPrimaryButtonClick?.();
|
|
33
|
-
};
|
|
34
|
-
return (
|
|
35
|
-
<div
|
|
36
|
-
className={`datePicker-buttons-container ${
|
|
37
|
-
hideTertiaryButton && hideSecondaryButton && hidePrimaryButton
|
|
38
|
-
? "datePicker-buttons-container--hidden"
|
|
39
|
-
: ""
|
|
40
|
-
}`}
|
|
41
|
-
>
|
|
42
|
-
{!hideTertiaryButton && (
|
|
43
|
-
<Button
|
|
44
|
-
variant="url"
|
|
45
|
-
size="small"
|
|
46
|
-
onClick={handleClear}
|
|
47
|
-
{...tertiaryButtonProps}
|
|
48
|
-
>
|
|
49
|
-
Clear
|
|
50
|
-
</Button>
|
|
51
|
-
)}
|
|
52
|
-
|
|
53
|
-
{!hideSecondaryButton && (
|
|
54
|
-
<Button
|
|
55
|
-
variant="secondary"
|
|
56
|
-
size="small"
|
|
57
|
-
onClick={handleCancel}
|
|
58
|
-
{...secondaryButtonProps}
|
|
59
|
-
>
|
|
60
|
-
Cancel
|
|
61
|
-
</Button>
|
|
62
|
-
)}
|
|
63
|
-
|
|
64
|
-
{!hidePrimaryButton && (
|
|
65
|
-
<Button
|
|
66
|
-
variant="primary"
|
|
67
|
-
size="small"
|
|
68
|
-
onClick={handelApply}
|
|
69
|
-
{...primaryButtonProps}
|
|
70
|
-
>
|
|
71
|
-
Apply
|
|
72
|
-
</Button>
|
|
73
|
-
)}
|
|
74
|
-
</div>
|
|
75
|
-
);
|
|
76
|
-
}
|
|
@@ -1,333 +0,0 @@
|
|
|
1
|
-
import React, { useState, useRef, useEffect } from "react";
|
|
2
|
-
import moment from "moment";
|
|
3
|
-
|
|
4
|
-
export default function DatePickerInput({
|
|
5
|
-
dateString,
|
|
6
|
-
placeholder,
|
|
7
|
-
isDisabled,
|
|
8
|
-
isError,
|
|
9
|
-
inputContainerRef,
|
|
10
|
-
selectedDate,
|
|
11
|
-
ref,
|
|
12
|
-
inputProps,
|
|
13
|
-
isOpen,
|
|
14
|
-
setIsOpen,
|
|
15
|
-
displayFormat = "DD-MM-YYYY",
|
|
16
|
-
onDateStringChange,
|
|
17
|
-
minDate,
|
|
18
|
-
maxDate,
|
|
19
|
-
onCancel,
|
|
20
|
-
readOnly = false,
|
|
21
|
-
customIcon,
|
|
22
|
-
}) {
|
|
23
|
-
const [isFocused, setIsFocused] = useState(false);
|
|
24
|
-
const [inputValue, setInputValue] = useState("");
|
|
25
|
-
const inputRef = useRef(null);
|
|
26
|
-
const [errorState, setErrorState] = useState(false);
|
|
27
|
-
const [pendingCursorPosition, setPendingCursorPosition] = useState(null);
|
|
28
|
-
|
|
29
|
-
// Handle cancel action
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
if (onCancel) {
|
|
32
|
-
setErrorState(false);
|
|
33
|
-
setInputValue("");
|
|
34
|
-
}
|
|
35
|
-
}, [onCancel]);
|
|
36
|
-
|
|
37
|
-
// Fixed positions for DD-MM-YYYY format
|
|
38
|
-
const NUMBER_POSITIONS =
|
|
39
|
-
displayFormat === "YYYY-MM-DD"
|
|
40
|
-
? [0, 1, 2, 3, 5, 6, 8, 9] // For YYYY-MM-DD format
|
|
41
|
-
: [0, 1, 3, 4, 6, 7, 8, 9]; // For DD-MM-YYYY and MM-DD-YYYY formats
|
|
42
|
-
|
|
43
|
-
// Handle cursor positioning after value updates
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
if (pendingCursorPosition !== null && inputRef.current) {
|
|
46
|
-
inputRef.current.setSelectionRange(
|
|
47
|
-
pendingCursorPosition,
|
|
48
|
-
pendingCursorPosition
|
|
49
|
-
);
|
|
50
|
-
setPendingCursorPosition(null);
|
|
51
|
-
}
|
|
52
|
-
}, [inputValue, pendingCursorPosition]);
|
|
53
|
-
|
|
54
|
-
useEffect(() => {
|
|
55
|
-
if (dateString) {
|
|
56
|
-
setInputValue(dateString);
|
|
57
|
-
} else {
|
|
58
|
-
setInputValue("");
|
|
59
|
-
}
|
|
60
|
-
}, [dateString]);
|
|
61
|
-
|
|
62
|
-
useEffect(() => {
|
|
63
|
-
if (readOnly) {
|
|
64
|
-
setInputValue("");
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
if (!inputValue && isFocused) {
|
|
68
|
-
setInputValue(displayFormat);
|
|
69
|
-
setPendingCursorPosition(NUMBER_POSITIONS[0]);
|
|
70
|
-
}
|
|
71
|
-
}, [isFocused]);
|
|
72
|
-
|
|
73
|
-
const handleDateInputFocus = () => {
|
|
74
|
-
setIsFocused(true);
|
|
75
|
-
setIsOpen(true);
|
|
76
|
-
// If input is empty, show the format as placeholder
|
|
77
|
-
if (!inputValue) {
|
|
78
|
-
if (!readOnly) {
|
|
79
|
-
setInputValue(displayFormat);
|
|
80
|
-
}
|
|
81
|
-
if (inputRef.current) {
|
|
82
|
-
inputRef.current.setSelectionRange(0, 0);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
const validateDate = (date) => {
|
|
88
|
-
if (!date) return false;
|
|
89
|
-
|
|
90
|
-
try {
|
|
91
|
-
// If date is a string, try to parse it
|
|
92
|
-
const momentDate =
|
|
93
|
-
typeof date === "string"
|
|
94
|
-
? moment(date, displayFormat, true)
|
|
95
|
-
: moment(date);
|
|
96
|
-
|
|
97
|
-
// Check if it's a valid moment object
|
|
98
|
-
if (!momentDate.isValid()) {
|
|
99
|
-
return false;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
// Check if date is within min/max range
|
|
103
|
-
if (minDate && momentDate.isBefore(minDate, "day")) {
|
|
104
|
-
return false;
|
|
105
|
-
}
|
|
106
|
-
if (maxDate && momentDate.isAfter(maxDate, "day")) {
|
|
107
|
-
return false;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// Get the day and month from the input value
|
|
111
|
-
const format = displayFormat || "DD-MM-YYYY";
|
|
112
|
-
const formatMap = {
|
|
113
|
-
"DD-MM-YYYY": { day: [0, 2], month: [3, 5], year: [6, 10] },
|
|
114
|
-
"MM-DD-YYYY": { day: [3, 5], month: [0, 2], year: [6, 10] },
|
|
115
|
-
"YYYY-MM-DD": { day: [8, 10], month: [5, 7], year: [0, 4] },
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
const formatInfo = formatMap[format] || formatMap["DD-MM-YYYY"];
|
|
119
|
-
|
|
120
|
-
// Safely parse the date parts
|
|
121
|
-
const day =
|
|
122
|
-
parseInt(inputValue.substring(formatInfo.day[0], formatInfo.day[1])) ||
|
|
123
|
-
0;
|
|
124
|
-
const month =
|
|
125
|
-
parseInt(
|
|
126
|
-
inputValue.substring(formatInfo.month[0], formatInfo.month[1])
|
|
127
|
-
) || 0;
|
|
128
|
-
const year =
|
|
129
|
-
parseInt(
|
|
130
|
-
inputValue.substring(formatInfo.year[0], formatInfo.year[1])
|
|
131
|
-
) || 0;
|
|
132
|
-
|
|
133
|
-
// Validate month (1-12)
|
|
134
|
-
if (month < 1 || month > 12) {
|
|
135
|
-
return false;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// Get the last day of the month
|
|
139
|
-
const lastDayOfMonth = moment(`${year}-${month}`, "YYYY-M").daysInMonth();
|
|
140
|
-
|
|
141
|
-
// Validate day (1 to last day of month)
|
|
142
|
-
if (day < 1 || day > lastDayOfMonth) {
|
|
143
|
-
return false;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
return true;
|
|
147
|
-
} catch (error) {
|
|
148
|
-
console.warn("Date validation error:", error);
|
|
149
|
-
return false;
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
const handleDateInputBlur = () => {
|
|
154
|
-
setIsFocused(false);
|
|
155
|
-
|
|
156
|
-
try {
|
|
157
|
-
// Validate date on blur
|
|
158
|
-
const parsedDate = moment(inputValue, displayFormat, true);
|
|
159
|
-
if (parsedDate.isValid()) {
|
|
160
|
-
const isValid = validateDate(parsedDate);
|
|
161
|
-
setErrorState(!isValid);
|
|
162
|
-
if (isValid) {
|
|
163
|
-
onDateStringChange?.(parsedDate);
|
|
164
|
-
}
|
|
165
|
-
} else {
|
|
166
|
-
setErrorState(true);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
// If input is empty or just the format, clear it
|
|
170
|
-
if (!inputValue || inputValue === displayFormat) {
|
|
171
|
-
setInputValue("");
|
|
172
|
-
setErrorState(false);
|
|
173
|
-
onDateStringChange?.(null);
|
|
174
|
-
}
|
|
175
|
-
} catch (error) {
|
|
176
|
-
console.warn("Date blur handling error:", error);
|
|
177
|
-
setErrorState(true);
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
const handleInputClick = () => {
|
|
182
|
-
setIsOpen(true);
|
|
183
|
-
if (inputRef.current) {
|
|
184
|
-
const cursor = inputRef.current.selectionStart;
|
|
185
|
-
|
|
186
|
-
// Special case: clicking after last character
|
|
187
|
-
if (cursor >= NUMBER_POSITIONS[NUMBER_POSITIONS.length - 1] + 1) {
|
|
188
|
-
inputRef.current.setSelectionRange(
|
|
189
|
-
NUMBER_POSITIONS[NUMBER_POSITIONS.length - 1] + 1,
|
|
190
|
-
NUMBER_POSITIONS[NUMBER_POSITIONS.length - 1] + 1
|
|
191
|
-
);
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
// If click lands on a non-digit position (i.e. separator)
|
|
196
|
-
if (!NUMBER_POSITIONS.includes(cursor)) {
|
|
197
|
-
// Find the next number position *after* the click
|
|
198
|
-
const nextPos = NUMBER_POSITIONS.find((pos) => pos >= cursor);
|
|
199
|
-
|
|
200
|
-
// Fallback: go to last number position
|
|
201
|
-
const fallbackPos = NUMBER_POSITIONS[NUMBER_POSITIONS.length - 1];
|
|
202
|
-
|
|
203
|
-
inputRef.current.setSelectionRange(
|
|
204
|
-
nextPos !== undefined ? nextPos : fallbackPos,
|
|
205
|
-
nextPos !== undefined ? nextPos : fallbackPos
|
|
206
|
-
);
|
|
207
|
-
}
|
|
208
|
-
// Else: click landed on a number digit, let it be
|
|
209
|
-
}
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
const handleInputChange = (e) => {
|
|
213
|
-
try {
|
|
214
|
-
const input = e.target;
|
|
215
|
-
const value = input.value;
|
|
216
|
-
const cursorPosition = input.selectionStart;
|
|
217
|
-
|
|
218
|
-
// Guard: invalid cursor
|
|
219
|
-
if (cursorPosition == null || cursorPosition < 1) return;
|
|
220
|
-
|
|
221
|
-
const newChar = value[cursorPosition - 1];
|
|
222
|
-
if (!/^\d$/.test(newChar)) return;
|
|
223
|
-
|
|
224
|
-
const pos = cursorPosition - 1;
|
|
225
|
-
|
|
226
|
-
// Guard: only allow typing in number positions
|
|
227
|
-
if (!NUMBER_POSITIONS.includes(pos)) {
|
|
228
|
-
e.preventDefault?.();
|
|
229
|
-
setPendingCursorPosition(
|
|
230
|
-
NUMBER_POSITIONS.find((p) => p > pos) ??
|
|
231
|
-
NUMBER_POSITIONS[NUMBER_POSITIONS.length - 1]
|
|
232
|
-
);
|
|
233
|
-
return;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
const newValue =
|
|
237
|
-
inputValue.slice(0, pos) + newChar + inputValue.slice(pos + 1);
|
|
238
|
-
|
|
239
|
-
if (newValue.length > displayFormat.length) return;
|
|
240
|
-
setInputValue(newValue);
|
|
241
|
-
onDateStringChange?.(newValue);
|
|
242
|
-
|
|
243
|
-
const currentIndex = NUMBER_POSITIONS.indexOf(pos);
|
|
244
|
-
if (currentIndex < NUMBER_POSITIONS.length - 1) {
|
|
245
|
-
const nextPos = NUMBER_POSITIONS[currentIndex + 1];
|
|
246
|
-
setPendingCursorPosition(nextPos);
|
|
247
|
-
} else {
|
|
248
|
-
const parsedDate = moment(newValue, displayFormat, true);
|
|
249
|
-
const isValid = parsedDate.isValid() && validateDate(parsedDate);
|
|
250
|
-
setErrorState(!isValid);
|
|
251
|
-
onDateStringChange?.(isValid ? parsedDate : newValue);
|
|
252
|
-
}
|
|
253
|
-
} catch (error) {
|
|
254
|
-
console.warn("Date input change error:", error);
|
|
255
|
-
setErrorState(true);
|
|
256
|
-
}
|
|
257
|
-
};
|
|
258
|
-
|
|
259
|
-
const handleKeyDown = (e) => {
|
|
260
|
-
// Allow navigation keys
|
|
261
|
-
if (e.key === "ArrowLeft" || e.key === "ArrowRight" || e.key === "Tab") {
|
|
262
|
-
return;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
if (e.key === "Backspace") {
|
|
266
|
-
e.preventDefault();
|
|
267
|
-
|
|
268
|
-
const caret = inputRef.current.selectionStart;
|
|
269
|
-
|
|
270
|
-
/* 1️⃣ figure out which digit we should delete */
|
|
271
|
-
const deletePos = [...NUMBER_POSITIONS] // reverse‑scan
|
|
272
|
-
.reverse()
|
|
273
|
-
.find((p) => p < caret);
|
|
274
|
-
|
|
275
|
-
if (deletePos == null) return; // nothing to delete
|
|
276
|
-
|
|
277
|
-
/* 2️⃣ build a new masked value */
|
|
278
|
-
const newValue =
|
|
279
|
-
inputValue.slice(0, deletePos) +
|
|
280
|
-
displayFormat[deletePos] + // "D" | "M" | "Y"
|
|
281
|
-
inputValue.slice(deletePos + 1);
|
|
282
|
-
|
|
283
|
-
setInputValue(newValue);
|
|
284
|
-
onDateStringChange?.(newValue);
|
|
285
|
-
|
|
286
|
-
/* 3️⃣ place caret so next Backspace hits the next digit */
|
|
287
|
-
let nextCaret = deletePos; // start just after the reset char
|
|
288
|
-
while (nextCaret > 0 && !NUMBER_POSITIONS.includes(nextCaret - 1)) {
|
|
289
|
-
nextCaret--; // hop over separator(s)
|
|
290
|
-
}
|
|
291
|
-
setPendingCursorPosition(nextCaret);
|
|
292
|
-
return;
|
|
293
|
-
}
|
|
294
|
-
// Only allow numbers
|
|
295
|
-
if (!/^\d$/.test(e.key)) {
|
|
296
|
-
e.preventDefault();
|
|
297
|
-
}
|
|
298
|
-
};
|
|
299
|
-
|
|
300
|
-
return (
|
|
301
|
-
<div
|
|
302
|
-
className={`datePicker-input-container ${
|
|
303
|
-
isDisabled ? "datePicker-input-disabled" : null
|
|
304
|
-
}
|
|
305
|
-
${isError || errorState ? "impact-datePicker-error" : null} ${
|
|
306
|
-
customIcon ? "datePicker-input-container-custom-icon" : null
|
|
307
|
-
}`}
|
|
308
|
-
ref={inputContainerRef}
|
|
309
|
-
>
|
|
310
|
-
<input
|
|
311
|
-
type="text"
|
|
312
|
-
placeholder={placeholder || "Select Date"}
|
|
313
|
-
value={inputValue}
|
|
314
|
-
onFocus={handleDateInputFocus}
|
|
315
|
-
onBlur={handleDateInputBlur}
|
|
316
|
-
onClick={handleInputClick}
|
|
317
|
-
onChange={handleInputChange}
|
|
318
|
-
onKeyDown={handleKeyDown}
|
|
319
|
-
ref={(node) => {
|
|
320
|
-
inputRef.current = node;
|
|
321
|
-
if (ref?.inputRef) {
|
|
322
|
-
ref.inputRef.current = node;
|
|
323
|
-
}
|
|
324
|
-
}}
|
|
325
|
-
{...inputProps}
|
|
326
|
-
disabled={isDisabled}
|
|
327
|
-
readOnly={readOnly}
|
|
328
|
-
className="impact-datepicker-date-input"
|
|
329
|
-
/>
|
|
330
|
-
{customIcon && customIcon}
|
|
331
|
-
</div>
|
|
332
|
-
);
|
|
333
|
-
}
|