@orbe-agro/client-core 5.3.85 → 5.3.89
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/dist/@ecme/assets/styles/app.css +1 -1
- package/dist/@ecme/assets/styles/components/_dialog.css +1 -1
- package/dist/@ecme/assets/styles/components/_drawer.css +1 -1
- package/dist/@ecme/assets/styles/components/_scrollbar.css +1 -1
- package/dist/@ecme/assets/styles/components/_switcher.css +1 -1
- package/dist/@ecme/assets/styles/components/_upload.css +1 -1
- package/dist/@ecme/assets/styles/components/index.css +1 -1
- package/dist/@ecme/assets/styles/tailwind/index.css +1 -1
- package/dist/@ecme/auth/AuthProvider.js +58 -62
- package/dist/@ecme/auth/AuthProvider.js.map +1 -1
- package/dist/@ecme/components/docs/DemoCard/DemoCard.js +18 -19
- package/dist/@ecme/components/docs/DemoCard/DemoCard.js.map +1 -1
- package/dist/@ecme/components/layouts/PostLoginLayout/PostLoginLayout.js +29 -30
- package/dist/@ecme/components/layouts/PostLoginLayout/PostLoginLayout.js.map +1 -1
- package/dist/@ecme/components/layouts/PostLoginLayout/components/ContentOverlay.js +56 -56
- package/dist/@ecme/components/layouts/PostLoginLayout/components/ContentOverlay.js.map +1 -1
- package/dist/@ecme/components/shared/Affix.js +9 -10
- package/dist/@ecme/components/shared/Affix.js.map +1 -1
- package/dist/@ecme/components/shared/AutoComplete.js +27 -28
- package/dist/@ecme/components/shared/AutoComplete.js.map +1 -1
- package/dist/@ecme/components/shared/CalendarView.js +19 -20
- package/dist/@ecme/components/shared/CalendarView.js.map +1 -1
- package/dist/@ecme/components/shared/ConfirmDialog.js +16 -16
- package/dist/@ecme/components/shared/ConfirmDialog.js.map +1 -1
- package/dist/@ecme/components/shared/DataTable.js +151 -151
- package/dist/@ecme/components/shared/DataTable.js.map +1 -1
- package/dist/@ecme/components/shared/DebounceInput.js +11 -12
- package/dist/@ecme/components/shared/DebounceInput.js.map +1 -1
- package/dist/@ecme/components/shared/GanttChart/GanttChart.js +20 -20
- package/dist/@ecme/components/shared/GanttChart/GanttChart.js.map +1 -1
- package/dist/@ecme/components/shared/GanttChart/TaskListTable.js +22 -22
- package/dist/@ecme/components/shared/GanttChart/TaskListTable.js.map +1 -1
- package/dist/@ecme/components/shared/ImageGallery.js +18 -18
- package/dist/@ecme/components/shared/ImageGallery.js.map +1 -1
- package/dist/@ecme/components/shared/Masonry/Masonry.js +25 -25
- package/dist/@ecme/components/shared/Masonry/Masonry.js.map +1 -1
- package/dist/@ecme/components/shared/OtpInput.js +54 -56
- package/dist/@ecme/components/shared/OtpInput.js.map +1 -1
- package/dist/@ecme/components/shared/PasswordInput.js +6 -6
- package/dist/@ecme/components/shared/PasswordInput.js.map +1 -1
- package/dist/@ecme/components/shared/RegionMap.js +9 -9
- package/dist/@ecme/components/shared/RegionMap.js.map +1 -1
- package/dist/@ecme/components/shared/RichTextEditor/RichTextEditor.js +47 -47
- package/dist/@ecme/components/shared/RichTextEditor/RichTextEditor.js.map +1 -1
- package/dist/@ecme/components/shared/UsersAvatarGroup.js +24 -24
- package/dist/@ecme/components/shared/UsersAvatarGroup.js.map +1 -1
- package/dist/@ecme/components/template/HorizontalMenuContent/HorizontalMenuContent.js +63 -69
- package/dist/@ecme/components/template/HorizontalMenuContent/HorizontalMenuContent.js.map +1 -1
- package/dist/@ecme/components/template/HorizontalMenuContent/HorizontalMenuDropdown.js +48 -48
- package/dist/@ecme/components/template/HorizontalMenuContent/HorizontalMenuDropdown.js.map +1 -1
- package/dist/@ecme/components/template/HorizontalMenuContent/HorizontalMenuDropdownContent.js +220 -231
- package/dist/@ecme/components/template/HorizontalMenuContent/HorizontalMenuDropdownContent.js.map +1 -1
- package/dist/@ecme/components/template/LanguageSelector.js +10 -13
- package/dist/@ecme/components/template/LanguageSelector.js.map +1 -1
- package/dist/@ecme/components/template/Search.js +85 -92
- package/dist/@ecme/components/template/Search.js.map +1 -1
- package/dist/@ecme/components/template/ThemeConfigurator/DirectionSwitcher.js +18 -18
- package/dist/@ecme/components/template/ThemeConfigurator/DirectionSwitcher.js.map +1 -1
- package/dist/@ecme/components/template/VerticalMenuContent/VerticalCollapsedMenuItem.js +17 -17
- package/dist/@ecme/components/template/VerticalMenuContent/VerticalCollapsedMenuItem.js.map +1 -1
- package/dist/@ecme/components/template/VerticalMenuContent/VerticalMenuContent.js +59 -59
- package/dist/@ecme/components/template/VerticalMenuContent/VerticalMenuContent.js.map +1 -1
- package/dist/@ecme/components/template/VerticalMenuContent/VerticalSingleMenuItem.js +34 -34
- package/dist/@ecme/components/template/VerticalMenuContent/VerticalSingleMenuItem.js.map +1 -1
- package/dist/@ecme/components/ui/Alert/Alert.js +29 -29
- package/dist/@ecme/components/ui/Alert/Alert.js.map +1 -1
- package/dist/@ecme/components/ui/Avatar/AvatarGroup.js +30 -30
- package/dist/@ecme/components/ui/Avatar/AvatarGroup.js.map +1 -1
- package/dist/@ecme/components/ui/Button/Button.js +66 -67
- package/dist/@ecme/components/ui/Button/Button.js.map +1 -1
- package/dist/@ecme/components/ui/Card/Card.js +39 -40
- package/dist/@ecme/components/ui/Card/Card.js.map +1 -1
- package/dist/@ecme/components/ui/Checkbox/Checkbox.js +42 -42
- package/dist/@ecme/components/ui/Checkbox/Checkbox.js.map +1 -1
- package/dist/@ecme/components/ui/Checkbox/Group.js +27 -27
- package/dist/@ecme/components/ui/Checkbox/Group.js.map +1 -1
- package/dist/@ecme/components/ui/DatePicker/BasePicker.js +67 -67
- package/dist/@ecme/components/ui/DatePicker/BasePicker.js.map +1 -1
- package/dist/@ecme/components/ui/DatePicker/Calendar.js +18 -18
- package/dist/@ecme/components/ui/DatePicker/Calendar.js.map +1 -1
- package/dist/@ecme/components/ui/DatePicker/CalendarBase.js +77 -78
- package/dist/@ecme/components/ui/DatePicker/CalendarBase.js.map +1 -1
- package/dist/@ecme/components/ui/DatePicker/DatePicker.js +67 -71
- package/dist/@ecme/components/ui/DatePicker/DatePicker.js.map +1 -1
- package/dist/@ecme/components/ui/DatePicker/DatePickerRange.js +94 -98
- package/dist/@ecme/components/ui/DatePicker/DatePickerRange.js.map +1 -1
- package/dist/@ecme/components/ui/DatePicker/DateTimepicker.js +51 -58
- package/dist/@ecme/components/ui/DatePicker/DateTimepicker.js.map +1 -1
- package/dist/@ecme/components/ui/DatePicker/tables/DateTable.js +67 -67
- package/dist/@ecme/components/ui/DatePicker/tables/DateTable.js.map +1 -1
- package/dist/@ecme/components/ui/DatePicker/tables/components/Day.js +12 -12
- package/dist/@ecme/components/ui/DatePicker/tables/components/Day.js.map +1 -1
- package/dist/@ecme/components/ui/Dialog/Dialog.js +25 -25
- package/dist/@ecme/components/ui/Dialog/Dialog.js.map +1 -1
- package/dist/@ecme/components/ui/Drawer/Drawer.js +32 -32
- package/dist/@ecme/components/ui/Drawer/Drawer.js.map +1 -1
- package/dist/@ecme/components/ui/Dropdown/DropdownItem.js +58 -58
- package/dist/@ecme/components/ui/Dropdown/DropdownItem.js.map +1 -1
- package/dist/@ecme/components/ui/Dropdown/DropdownMenu.js +99 -100
- package/dist/@ecme/components/ui/Dropdown/DropdownMenu.js.map +1 -1
- package/dist/@ecme/components/ui/Dropdown/DropdownSubItem.js +26 -26
- package/dist/@ecme/components/ui/Dropdown/DropdownSubItem.js.map +1 -1
- package/dist/@ecme/components/ui/Form/FormContainer.js +17 -17
- package/dist/@ecme/components/ui/Form/FormContainer.js.map +1 -1
- package/dist/@ecme/components/ui/Form/FormItem.js +38 -38
- package/dist/@ecme/components/ui/Form/FormItem.js.map +1 -1
- package/dist/@ecme/components/ui/Input/Input.js +50 -52
- package/dist/@ecme/components/ui/Input/Input.js.map +1 -1
- package/dist/@ecme/components/ui/InputGroup/Addon.js +12 -13
- package/dist/@ecme/components/ui/InputGroup/Addon.js.map +1 -1
- package/dist/@ecme/components/ui/InputGroup/InputGroup.js +10 -11
- package/dist/@ecme/components/ui/InputGroup/InputGroup.js.map +1 -1
- package/dist/@ecme/components/ui/Notification/Notification.js +19 -19
- package/dist/@ecme/components/ui/Notification/Notification.js.map +1 -1
- package/dist/@ecme/components/ui/Pagination/Pagination.js +45 -45
- package/dist/@ecme/components/ui/Pagination/Pagination.js.map +1 -1
- package/dist/@ecme/components/ui/Radio/Group.js +28 -28
- package/dist/@ecme/components/ui/Radio/Group.js.map +1 -1
- package/dist/@ecme/components/ui/Radio/Radio.js +42 -42
- package/dist/@ecme/components/ui/Radio/Radio.js.map +1 -1
- package/dist/@ecme/components/ui/Segment/SegmentItem.js +53 -53
- package/dist/@ecme/components/ui/Segment/SegmentItem.js.map +1 -1
- package/dist/@ecme/components/ui/Select/Select.js +40 -41
- package/dist/@ecme/components/ui/Select/Select.js.map +1 -1
- package/dist/@ecme/components/ui/Steps/StepItem.js +33 -33
- package/dist/@ecme/components/ui/Steps/StepItem.js.map +1 -1
- package/dist/@ecme/components/ui/Switcher/Switcher.js +24 -24
- package/dist/@ecme/components/ui/Switcher/Switcher.js.map +1 -1
- package/dist/@ecme/components/ui/Tabs/TabNav.js +22 -22
- package/dist/@ecme/components/ui/Tabs/TabNav.js.map +1 -1
- package/dist/@ecme/components/ui/TimeInput/AmPmInput.js +25 -27
- package/dist/@ecme/components/ui/TimeInput/AmPmInput.js.map +1 -1
- package/dist/@ecme/components/ui/TimeInput/TimeInput.js +130 -135
- package/dist/@ecme/components/ui/TimeInput/TimeInput.js.map +1 -1
- package/dist/@ecme/components/ui/TimeInput/TimeInputField.js +22 -24
- package/dist/@ecme/components/ui/TimeInput/TimeInputField.js.map +1 -1
- package/dist/@ecme/components/ui/TimeInput/TimeInputRange.js +65 -68
- package/dist/@ecme/components/ui/TimeInput/TimeInputRange.js.map +1 -1
- package/dist/@ecme/components/ui/TimeInput/utils/createAmPmHandler.js +11 -12
- package/dist/@ecme/components/ui/TimeInput/utils/createAmPmHandler.js.map +1 -1
- package/dist/@ecme/components/ui/TimeInput/utils/createTimeHandler.js +19 -20
- package/dist/@ecme/components/ui/TimeInput/utils/createTimeHandler.js.map +1 -1
- package/dist/@ecme/components/ui/Upload/Upload.js +67 -68
- package/dist/@ecme/components/ui/Upload/Upload.js.map +1 -1
- package/dist/@ecme/components/ui/hooks/useCallbackRef.js +7 -10
- package/dist/@ecme/components/ui/hooks/useCallbackRef.js.map +1 -1
- package/dist/@ecme/components/ui/hooks/useRootClose.js +32 -32
- package/dist/@ecme/components/ui/hooks/useRootClose.js.map +1 -1
- package/dist/@ecme/components/ui/hooks/useTimeout.js +12 -13
- package/dist/@ecme/components/ui/hooks/useTimeout.js.map +1 -1
- package/dist/@ecme/components/ui/toast/ToastWrapper.js +58 -61
- package/dist/@ecme/components/ui/toast/ToastWrapper.js.map +1 -1
- package/dist/@ecme/components/ui/toast/toast.js +16 -19
- package/dist/@ecme/components/ui/toast/toast.js.map +1 -1
- package/dist/@ecme/components/view/Activity/ActivityEvent.js +63 -67
- package/dist/@ecme/components/view/Activity/ActivityEvent.js.map +1 -1
- package/dist/@ecme/components/view/ChatBox/components/Attachment.js +8 -9
- package/dist/@ecme/components/view/ChatBox/components/Attachment.js.map +1 -1
- package/dist/@ecme/components/view/ChatBox/components/ChatInput.js +37 -39
- package/dist/@ecme/components/view/ChatBox/components/ChatInput.js.map +1 -1
- package/dist/@ecme/components/view/ChatBox/components/Message.js +10 -10
- package/dist/@ecme/components/view/ChatBox/components/Message.js.map +1 -1
- package/dist/@ecme/components/view/CreditCardDialog/CreditCardDialog.js +36 -37
- package/dist/@ecme/components/view/CreditCardDialog/CreditCardDialog.js.map +1 -1
- package/dist/@ecme/components/view/TaskItem/TaskItem.js +33 -33
- package/dist/@ecme/components/view/TaskItem/TaskItem.js.map +1 -1
- package/dist/@ecme/mock/fakeApi/chatFakeApi.js +16 -18
- package/dist/@ecme/mock/fakeApi/chatFakeApi.js.map +1 -1
- package/dist/@ecme/mock/fakeApi/customersFakeApi.js +10 -11
- package/dist/@ecme/mock/fakeApi/customersFakeApi.js.map +1 -1
- package/dist/@ecme/mock/fakeApi/helpCenterFakeApi.js +10 -11
- package/dist/@ecme/mock/fakeApi/helpCenterFakeApi.js.map +1 -1
- package/dist/@ecme/mock/fakeApi/mailFakeApi.js +9 -10
- package/dist/@ecme/mock/fakeApi/mailFakeApi.js.map +1 -1
- package/dist/@ecme/mock/fakeApi/ordersFakeApi.js +9 -10
- package/dist/@ecme/mock/fakeApi/ordersFakeApi.js.map +1 -1
- package/dist/@ecme/mock/fakeApi/productsFakeApi.js +7 -8
- package/dist/@ecme/mock/fakeApi/productsFakeApi.js.map +1 -1
- package/dist/@ecme/mock/fakeApi/projectsFakeApi.js +10 -11
- package/dist/@ecme/mock/fakeApi/projectsFakeApi.js.map +1 -1
- package/dist/@ecme/utils/hooks/useInfiniteScroll.js +11 -11
- package/dist/@ecme/utils/hooks/useInfiniteScroll.js.map +1 -1
- package/dist/@ecme/utils/hooks/useMenuActive.js +11 -12
- package/dist/@ecme/utils/hooks/useMenuActive.js.map +1 -1
- package/dist/@ecme/views/auth/ForgotPassword/components/ForgotPasswordForm.js +36 -37
- package/dist/@ecme/views/auth/ForgotPassword/components/ForgotPasswordForm.js.map +1 -1
- package/dist/@ecme/views/auth/OtpVerification/OtpVerification.js +14 -14
- package/dist/@ecme/views/auth/OtpVerification/OtpVerification.js.map +1 -1
- package/dist/@ecme/views/auth/OtpVerification/components/OtpVerificationForm.js +41 -42
- package/dist/@ecme/views/auth/OtpVerification/components/OtpVerificationForm.js.map +1 -1
- package/dist/@ecme/views/auth/ResetPassword/components/ResetPasswordForm.js +59 -60
- package/dist/@ecme/views/auth/ResetPassword/components/ResetPasswordForm.js.map +1 -1
- package/dist/@ecme/views/auth/SignIn/components/OauthSignIn.js +27 -27
- package/dist/@ecme/views/auth/SignIn/components/OauthSignIn.js.map +1 -1
- package/dist/@ecme/views/auth/SignIn/components/SignInForm.js +57 -58
- package/dist/@ecme/views/auth/SignIn/components/SignInForm.js.map +1 -1
- package/dist/@ecme/views/auth/SignUp/components/SignUpForm.js +37 -38
- package/dist/@ecme/views/auth/SignUp/components/SignUpForm.js.map +1 -1
- package/dist/@ecme/views/concepts/accounts/Pricing/components/PaymentDialog.js +44 -45
- package/dist/@ecme/views/concepts/accounts/Pricing/components/PaymentDialog.js.map +1 -1
- package/dist/@ecme/views/concepts/accounts/Pricing/components/Plans.js +5 -5
- package/dist/@ecme/views/concepts/accounts/Pricing/components/Plans.js.map +1 -1
- package/dist/@ecme/views/concepts/accounts/RolesPermissions/components/RolesPermissionsAccessDialog.js +34 -35
- package/dist/@ecme/views/concepts/accounts/RolesPermissions/components/RolesPermissionsAccessDialog.js.map +1 -1
- package/dist/@ecme/views/concepts/accounts/RolesPermissions/components/RolesPermissionsUserAction.js +26 -26
- package/dist/@ecme/views/concepts/accounts/RolesPermissions/components/RolesPermissionsUserAction.js.map +1 -1
- package/dist/@ecme/views/concepts/accounts/RolesPermissions/components/RolesPermissionsUserTable.js +28 -29
- package/dist/@ecme/views/concepts/accounts/RolesPermissions/components/RolesPermissionsUserTable.js.map +1 -1
- package/dist/@ecme/views/concepts/accounts/RolesPermissions/hooks/useRolePermissonsUsers.js +8 -8
- package/dist/@ecme/views/concepts/accounts/RolesPermissions/hooks/useRolePermissonsUsers.js.map +1 -1
- package/dist/@ecme/views/concepts/accounts/Settings/components/SettingMobileMenu.js +10 -11
- package/dist/@ecme/views/concepts/accounts/Settings/components/SettingMobileMenu.js.map +1 -1
- package/dist/@ecme/views/concepts/accounts/Settings/components/SettingsBilling.js +48 -49
- package/dist/@ecme/views/concepts/accounts/Settings/components/SettingsBilling.js.map +1 -1
- package/dist/@ecme/views/concepts/accounts/Settings/components/SettingsMenu.js +14 -14
- package/dist/@ecme/views/concepts/accounts/Settings/components/SettingsMenu.js.map +1 -1
- package/dist/@ecme/views/concepts/accounts/Settings/components/SettingsProfile.js +102 -103
- package/dist/@ecme/views/concepts/accounts/Settings/components/SettingsProfile.js.map +1 -1
- package/dist/@ecme/views/concepts/accounts/Settings/components/SettingsSecurity.js +34 -35
- package/dist/@ecme/views/concepts/accounts/Settings/components/SettingsSecurity.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatCustomAction.js +16 -16
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatCustomAction.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatCustomContent.js +76 -78
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatCustomContent.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatHistory.js +23 -23
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatHistory.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatHistoryItem.js +48 -49
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatHistoryItem.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatHistoryRenameDialog.js +34 -35
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatHistoryRenameDialog.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatMobileNav.js +11 -14
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatMobileNav.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatSideNav.js +19 -19
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatSideNav.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatView.js +22 -26
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatView.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Chat/store/generativeChatStore.js +18 -24
- package/dist/@ecme/views/concepts/ai/Chat/store/generativeChatStore.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Image/components/ConfigDropdown.js +22 -22
- package/dist/@ecme/views/concepts/ai/Image/components/ConfigDropdown.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Image/components/GeneratorPrompt.js +31 -32
- package/dist/@ecme/views/concepts/ai/Image/components/GeneratorPrompt.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Image/components/ImageDialog.js +31 -32
- package/dist/@ecme/views/concepts/ai/Image/components/ImageDialog.js.map +1 -1
- package/dist/@ecme/views/concepts/calendar/Calendar/Calendar.js +38 -39
- package/dist/@ecme/views/concepts/calendar/Calendar/Calendar.js.map +1 -1
- package/dist/@ecme/views/concepts/calendar/Calendar/components/EventDialog.js +68 -69
- package/dist/@ecme/views/concepts/calendar/Calendar/components/EventDialog.js.map +1 -1
- package/dist/@ecme/views/concepts/chat/Chat/components/ChatBody.js +63 -66
- package/dist/@ecme/views/concepts/chat/Chat/components/ChatBody.js.map +1 -1
- package/dist/@ecme/views/concepts/chat/Chat/components/ChatList.js +21 -22
- package/dist/@ecme/views/concepts/chat/Chat/components/ChatList.js.map +1 -1
- package/dist/@ecme/views/concepts/chat/Chat/components/ContactInfoDrawer.js +84 -85
- package/dist/@ecme/views/concepts/chat/Chat/components/ContactInfoDrawer.js.map +1 -1
- package/dist/@ecme/views/concepts/customers/CustomerDetails/ActivitySection.js +19 -19
- package/dist/@ecme/views/concepts/customers/CustomerDetails/ActivitySection.js.map +1 -1
- package/dist/@ecme/views/concepts/customers/CustomerDetails/BillingSection.js +51 -58
- package/dist/@ecme/views/concepts/customers/CustomerDetails/BillingSection.js.map +1 -1
- package/dist/@ecme/views/concepts/customers/CustomerDetails/ProfileSection.js +76 -89
- package/dist/@ecme/views/concepts/customers/CustomerDetails/ProfileSection.js.map +1 -1
- package/dist/@ecme/views/concepts/customers/CustomerForm/AddressSection.js +104 -107
- package/dist/@ecme/views/concepts/customers/CustomerForm/AddressSection.js.map +1 -1
- package/dist/@ecme/views/concepts/customers/CustomerForm/CustomerForm.js +22 -22
- package/dist/@ecme/views/concepts/customers/CustomerForm/CustomerForm.js.map +1 -1
- package/dist/@ecme/views/concepts/customers/CustomerForm/OverviewSection.js +38 -39
- package/dist/@ecme/views/concepts/customers/CustomerForm/OverviewSection.js.map +1 -1
- package/dist/@ecme/views/concepts/customers/CustomerList/hooks/useCustomerList.js +20 -20
- package/dist/@ecme/views/concepts/customers/CustomerList/hooks/useCustomerList.js.map +1 -1
- package/dist/@ecme/views/concepts/files/FileManager/components/FileItemDropdown.js +32 -33
- package/dist/@ecme/views/concepts/files/FileManager/components/FileItemDropdown.js.map +1 -1
- package/dist/@ecme/views/concepts/help-center/EditArticle/components/EditArticleHeader.js +17 -18
- package/dist/@ecme/views/concepts/help-center/EditArticle/components/EditArticleHeader.js.map +1 -1
- package/dist/@ecme/views/concepts/help-center/ManageArticle/hooks/useManageArticle.js +5 -5
- package/dist/@ecme/views/concepts/help-center/ManageArticle/hooks/useManageArticle.js.map +1 -1
- package/dist/@ecme/views/concepts/help-center/SupportHub/components/TopSection.js +12 -13
- package/dist/@ecme/views/concepts/help-center/SupportHub/components/TopSection.js.map +1 -1
- package/dist/@ecme/views/concepts/mail/Mail/components/MailDetailAction.js +28 -29
- package/dist/@ecme/views/concepts/mail/Mail/components/MailDetailAction.js.map +1 -1
- package/dist/@ecme/views/concepts/mail/Mail/components/MailDetailContent.js +63 -67
- package/dist/@ecme/views/concepts/mail/Mail/components/MailDetailContent.js.map +1 -1
- package/dist/@ecme/views/concepts/mail/Mail/components/MailDetailTitle.js +8 -8
- package/dist/@ecme/views/concepts/mail/Mail/components/MailDetailTitle.js.map +1 -1
- package/dist/@ecme/views/concepts/mail/Mail/components/MailEditor.js +36 -37
- package/dist/@ecme/views/concepts/mail/Mail/components/MailEditor.js.map +1 -1
- package/dist/@ecme/views/concepts/mail/Mail/components/MailList.js +134 -137
- package/dist/@ecme/views/concepts/mail/Mail/components/MailList.js.map +1 -1
- package/dist/@ecme/views/concepts/orders/OrderDetails/components/OrderDetailProducts.js +17 -17
- package/dist/@ecme/views/concepts/orders/OrderDetails/components/OrderDetailProducts.js.map +1 -1
- package/dist/@ecme/views/concepts/orders/OrderEdit/OrderEdit.js +35 -35
- package/dist/@ecme/views/concepts/orders/OrderEdit/OrderEdit.js.map +1 -1
- package/dist/@ecme/views/concepts/orders/OrderForm/OrderForm.js +38 -38
- package/dist/@ecme/views/concepts/orders/OrderForm/OrderForm.js.map +1 -1
- package/dist/@ecme/views/concepts/orders/OrderForm/components/BillingAddressSection.js +108 -111
- package/dist/@ecme/views/concepts/orders/OrderForm/components/BillingAddressSection.js.map +1 -1
- package/dist/@ecme/views/concepts/orders/OrderForm/components/CustomerDetailSection.js +44 -45
- package/dist/@ecme/views/concepts/orders/OrderForm/components/CustomerDetailSection.js.map +1 -1
- package/dist/@ecme/views/concepts/orders/OrderForm/components/PaymentMethodSection.js +211 -214
- package/dist/@ecme/views/concepts/orders/OrderForm/components/PaymentMethodSection.js.map +1 -1
- package/dist/@ecme/views/concepts/orders/OrderList/components/OrderListTableFilter.js +17 -17
- package/dist/@ecme/views/concepts/orders/OrderList/components/OrderListTableFilter.js.map +1 -1
- package/dist/@ecme/views/concepts/orders/OrderList/hooks/useOrderlist.js +15 -15
- package/dist/@ecme/views/concepts/orders/OrderList/hooks/useOrderlist.js.map +1 -1
- package/dist/@ecme/views/concepts/products/ProductForm/ProductForm.js +4 -4
- package/dist/@ecme/views/concepts/products/ProductForm/ProductForm.js.map +1 -1
- package/dist/@ecme/views/concepts/products/ProductForm/components/AttributeSection.js +97 -100
- package/dist/@ecme/views/concepts/products/ProductForm/components/AttributeSection.js.map +1 -1
- package/dist/@ecme/views/concepts/products/ProductForm/components/GeneralSection.js +68 -71
- package/dist/@ecme/views/concepts/products/ProductForm/components/GeneralSection.js.map +1 -1
- package/dist/@ecme/views/concepts/products/ProductForm/components/ImageSection.js +85 -86
- package/dist/@ecme/views/concepts/products/ProductForm/components/ImageSection.js.map +1 -1
- package/dist/@ecme/views/concepts/products/ProductForm/components/PricingSection.js +121 -124
- package/dist/@ecme/views/concepts/products/ProductForm/components/PricingSection.js.map +1 -1
- package/dist/@ecme/views/concepts/products/ProductList/components/ProductListSearch.js +11 -11
- package/dist/@ecme/views/concepts/products/ProductList/components/ProductListSearch.js.map +1 -1
- package/dist/@ecme/views/concepts/products/ProductList/components/ProductTableFilter.js +17 -17
- package/dist/@ecme/views/concepts/products/ProductList/components/ProductTableFilter.js.map +1 -1
- package/dist/@ecme/views/concepts/products/ProductList/hooks/useProductList.js +17 -17
- package/dist/@ecme/views/concepts/products/ProductList/hooks/useProductList.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/Issue/components/IssueBody.js +101 -105
- package/dist/@ecme/views/concepts/projects/Issue/components/IssueBody.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/Issue/components/IssueFooter.js +57 -58
- package/dist/@ecme/views/concepts/projects/Issue/components/IssueFooter.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/ProjectDetails/components/ProjectDetailsHeader.js +51 -52
- package/dist/@ecme/views/concepts/projects/ProjectDetails/components/ProjectDetailsHeader.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/ProjectDetails/components/ProjectDetailsOverview.js +22 -23
- package/dist/@ecme/views/concepts/projects/ProjectDetails/components/ProjectDetailsOverview.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/ProjectDetails/components/ProjectDetailsSetting.js +45 -46
- package/dist/@ecme/views/concepts/projects/ProjectDetails/components/ProjectDetailsSetting.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/ProjectDetails/components/ProjectDetailsTask.js +62 -65
- package/dist/@ecme/views/concepts/projects/ProjectDetails/components/ProjectDetailsTask.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/ProjectList/components/NewProjectForm.js +52 -53
- package/dist/@ecme/views/concepts/projects/ProjectList/components/NewProjectForm.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/ProjectList/components/NewTaskField.js +23 -25
- package/dist/@ecme/views/concepts/projects/ProjectList/components/NewTaskField.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/ProjectList/components/ProjectListContent.js +15 -15
- package/dist/@ecme/views/concepts/projects/ProjectList/components/ProjectListContent.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/ProjectList/components/ProjectListHeader.js +16 -16
- package/dist/@ecme/views/concepts/projects/ProjectList/components/ProjectListHeader.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/ProjectList/hooks/useProjectList.js +9 -9
- package/dist/@ecme/views/concepts/projects/ProjectList/hooks/useProjectList.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/ScrumBoard/components/AddNewColumnContent.js +40 -41
- package/dist/@ecme/views/concepts/projects/ScrumBoard/components/AddNewColumnContent.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/ScrumBoard/components/AddNewTicketContent.js +33 -34
- package/dist/@ecme/views/concepts/projects/ScrumBoard/components/AddNewTicketContent.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/ScrumBoard/components/BoardCardList.js +33 -33
- package/dist/@ecme/views/concepts/projects/ScrumBoard/components/BoardCardList.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/ScrumBoard/components/TicketContent.js +203 -210
- package/dist/@ecme/views/concepts/projects/ScrumBoard/components/TicketContent.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/Tasks/components/AddTask.js +53 -56
- package/dist/@ecme/views/concepts/projects/Tasks/components/AddTask.js.map +1 -1
- package/dist/@ecme/views/concepts/projects/Tasks/components/TaskList.js +80 -83
- package/dist/@ecme/views/concepts/projects/Tasks/components/TaskList.js.map +1 -1
- package/dist/@ecme/views/dashboards/AnalyticDashboard/components/AnalyticHeader.js +6 -6
- package/dist/@ecme/views/dashboards/AnalyticDashboard/components/AnalyticHeader.js.map +1 -1
- package/dist/@ecme/views/dashboards/EcommerceDashboard/components/Overview.js +21 -21
- package/dist/@ecme/views/dashboards/EcommerceDashboard/components/Overview.js.map +1 -1
- package/dist/@ecme/views/dashboards/EcommerceDashboard/components/RevenueByChannel.js +27 -27
- package/dist/@ecme/views/dashboards/EcommerceDashboard/components/RevenueByChannel.js.map +1 -1
- package/dist/@ecme/views/dashboards/EcommerceDashboard/components/SalesTarget.js +27 -27
- package/dist/@ecme/views/dashboards/EcommerceDashboard/components/SalesTarget.js.map +1 -1
- package/dist/@ecme/views/dashboards/MarketingDashboard/components/CreateCampaign.js +59 -60
- package/dist/@ecme/views/dashboards/MarketingDashboard/components/CreateCampaign.js.map +1 -1
- package/dist/@ecme/views/dashboards/ProjectDashboard/components/CreateEventDialog.js +76 -77
- package/dist/@ecme/views/dashboards/ProjectDashboard/components/CreateEventDialog.js.map +1 -1
- package/dist/@ecme/views/dashboards/ProjectDashboard/components/UpcomingSchedule.js +30 -30
- package/dist/@ecme/views/dashboards/ProjectDashboard/components/UpcomingSchedule.js.map +1 -1
- package/dist/@ecme/views/guide/SharedComponentsDoc/components/CustomFormatInputDoc/WithForm.js +21 -22
- package/dist/@ecme/views/guide/SharedComponentsDoc/components/CustomFormatInputDoc/WithForm.js.map +1 -1
- package/dist/@ecme/views/guide/SharedComponentsDoc/components/ImageGalleryDoc/Example.js +15 -15
- package/dist/@ecme/views/guide/SharedComponentsDoc/components/ImageGalleryDoc/Example.js.map +1 -1
- package/dist/@ecme/views/guide/SharedComponentsDoc/components/NumericInputDoc/WithForm.js +20 -21
- package/dist/@ecme/views/guide/SharedComponentsDoc/components/NumericInputDoc/WithForm.js.map +1 -1
- package/dist/@ecme/views/guide/SharedComponentsDoc/components/PatternInputDoc/WithForm.js +20 -21
- package/dist/@ecme/views/guide/SharedComponentsDoc/components/PatternInputDoc/WithForm.js.map +1 -1
- package/dist/@ecme/views/guide/SharedComponentsDoc/components/RichTextEditorDoc/WithForm.js +20 -21
- package/dist/@ecme/views/guide/SharedComponentsDoc/components/RichTextEditorDoc/WithForm.js.map +1 -1
- package/dist/@ecme/views/ui-components/data-display/Table/Editable.js +17 -18
- package/dist/@ecme/views/ui-components/data-display/Table/Editable.js.map +1 -1
- package/dist/@ecme/views/ui-components/data-display/Table/PaginationTable.js +12 -12
- package/dist/@ecme/views/ui-components/data-display/Table/PaginationTable.js.map +1 -1
- package/dist/@ecme/views/ui-components/forms/FormControl/AsyncValidation.js +28 -29
- package/dist/@ecme/views/ui-components/forms/FormControl/AsyncValidation.js.map +1 -1
- package/dist/@ecme/views/ui-components/forms/FormControl/Basic.js +21 -22
- package/dist/@ecme/views/ui-components/forms/FormControl/Basic.js.map +1 -1
- package/dist/@ecme/views/ui-components/forms/FormControl/DependentValidation.js +24 -25
- package/dist/@ecme/views/ui-components/forms/FormControl/DependentValidation.js.map +1 -1
- package/dist/@ecme/views/ui-components/forms/FormControl/DynamicForm.js +75 -79
- package/dist/@ecme/views/ui-components/forms/FormControl/DynamicForm.js.map +1 -1
- package/dist/@ecme/views/ui-components/forms/FormControl/FieldValidation.js +19 -20
- package/dist/@ecme/views/ui-components/forms/FormControl/FieldValidation.js.map +1 -1
- package/dist/@ecme/views/ui-components/forms/FormControl/MixedFormControl.js +90 -91
- package/dist/@ecme/views/ui-components/forms/FormControl/MixedFormControl.js.map +1 -1
- package/dist/@ecme/views/ui-components/forms/FormControl/SchemaValidation.js +22 -23
- package/dist/@ecme/views/ui-components/forms/FormControl/SchemaValidation.js.map +1 -1
- package/dist/@types/base/configs/api.config.d.ts +0 -19
- package/dist/@types/base/configs/api.config.d.ts.map +1 -1
- package/dist/base/assets/styles/init.css +1 -1
- package/dist/base/components/forms/ArraysForms/GenericArrayNumberFormSection.js +24 -25
- package/dist/base/components/forms/ArraysForms/GenericArrayNumberFormSection.js.map +1 -1
- package/dist/base/components/forms/ArraysForms/GenericArrayStringFormSection.js +23 -24
- package/dist/base/components/forms/ArraysForms/GenericArrayStringFormSection.js.map +1 -1
- package/dist/base/components/forms/GenericFomrsSetValue/GenericNumberFormSectionPrice.js +30 -31
- package/dist/base/components/forms/GenericFomrsSetValue/GenericNumberFormSectionPrice.js.map +1 -1
- package/dist/base/components/forms/GenericFomrsSetValue/GenericStringFormSection.js +25 -26
- package/dist/base/components/forms/GenericFomrsSetValue/GenericStringFormSection.js.map +1 -1
- package/dist/base/components/forms/GenericForms/GenericArrayFormSection.js +49 -50
- package/dist/base/components/forms/GenericForms/GenericArrayFormSection.js.map +1 -1
- package/dist/base/components/forms/GenericForms/GenericNumberFormSection.js +27 -28
- package/dist/base/components/forms/GenericForms/GenericNumberFormSection.js.map +1 -1
- package/dist/base/components/forms/GenericForms/GenericStringFormSection.js +23 -24
- package/dist/base/components/forms/GenericForms/GenericStringFormSection.js.map +1 -1
- package/dist/base/components/forms/GenericForms/GenericUploadFormSection.js +27 -28
- package/dist/base/components/forms/GenericForms/GenericUploadFormSection.js.map +1 -1
- package/dist/base/components/forms/NumberFormVariant/GenericNumberFormSectionPercentage.js +29 -30
- package/dist/base/components/forms/NumberFormVariant/GenericNumberFormSectionPercentage.js.map +1 -1
- package/dist/base/components/forms/NumberFormVariant/GenericNumberFormSectionPrice.js +27 -28
- package/dist/base/components/forms/NumberFormVariant/GenericNumberFormSectionPrice.js.map +1 -1
- package/dist/base/components/forms/NumberFormVariant/GenericNumberFormSectionWeight.js +27 -28
- package/dist/base/components/forms/NumberFormVariant/GenericNumberFormSectionWeight.js.map +1 -1
- package/dist/base/components/shared/TransferirProcessoDialog.js +10 -10
- package/dist/base/components/shared/TransferirProcessoDialog.js.map +1 -1
- package/dist/base/components/tools/NavFilter.js +68 -75
- package/dist/base/components/tools/NavFilter.js.map +1 -1
- package/dist/base/configs/api.config.js +11 -14
- package/dist/base/configs/api.config.js.map +1 -1
- package/dist/base/hooks/adm/roles/useRolesList.js +11 -11
- package/dist/base/hooks/adm/roles/useRolesList.js.map +1 -1
- package/dist/base/hooks/adm/users/useUsersList.js +10 -10
- package/dist/base/hooks/adm/users/useUsersList.js.map +1 -1
- package/dist/base/hooks/dm/businessPartner/useBusinessPartnerClienteList.js +5 -5
- package/dist/base/hooks/dm/businessPartner/useBusinessPartnerClienteList.js.map +1 -1
- package/dist/base/hooks/dm/businessPartner/useBusinessPartnerFornecedorList.js +7 -7
- package/dist/base/hooks/dm/businessPartner/useBusinessPartnerFornecedorList.js.map +1 -1
- package/dist/base/hooks/dm/businessPartner/useBusinessPartnerList.js +10 -10
- package/dist/base/hooks/dm/businessPartner/useBusinessPartnerList.js.map +1 -1
- package/dist/base/hooks/dm/canalDistribuicao/useCanalDistribuicaoByCodigoList.js +8 -8
- package/dist/base/hooks/dm/canalDistribuicao/useCanalDistribuicaoByCodigoList.js.map +1 -1
- package/dist/base/hooks/dm/canalDistribuicao/useCanalDistribuicaoList.js +8 -8
- package/dist/base/hooks/dm/canalDistribuicao/useCanalDistribuicaoList.js.map +1 -1
- package/dist/base/hooks/dm/centro/useCentroByCodigoList.js +13 -13
- package/dist/base/hooks/dm/centro/useCentroByCodigoList.js.map +1 -1
- package/dist/base/hooks/dm/centro/useCentroList.js +6 -6
- package/dist/base/hooks/dm/centro/useCentroList.js.map +1 -1
- package/dist/base/hooks/dm/condicaoPagamento/useCondicaoPagamentoList.js +4 -4
- package/dist/base/hooks/dm/condicaoPagamento/useCondicaoPagamentoList.js.map +1 -1
- package/dist/base/hooks/dm/deposito/useDepositoByCodigoList.js +9 -9
- package/dist/base/hooks/dm/deposito/useDepositoByCodigoList.js.map +1 -1
- package/dist/base/hooks/dm/deposito/useDepositoList.js +5 -5
- package/dist/base/hooks/dm/deposito/useDepositoList.js.map +1 -1
- package/dist/base/hooks/dm/deposito/useDepositosByCodigoCentroList.js +13 -13
- package/dist/base/hooks/dm/deposito/useDepositosByCodigoCentroList.js.map +1 -1
- package/dist/base/hooks/dm/equipeVenda/useEquipeVendaByCodigoList.js +8 -8
- package/dist/base/hooks/dm/equipeVenda/useEquipeVendaByCodigoList.js.map +1 -1
- package/dist/base/hooks/dm/equipeVenda/useEquipeVendaList.js +6 -6
- package/dist/base/hooks/dm/equipeVenda/useEquipeVendaList.js.map +1 -1
- package/dist/base/hooks/dm/escritorioVenda/useEscritorioVendaByCodigoList.js +10 -10
- package/dist/base/hooks/dm/escritorioVenda/useEscritorioVendaByCodigoList.js.map +1 -1
- package/dist/base/hooks/dm/escritorioVenda/useEscritorioVendaList.js +7 -7
- package/dist/base/hooks/dm/escritorioVenda/useEscritorioVendaList.js.map +1 -1
- package/dist/base/hooks/dm/formaPagamento/useFormaPagamentoByCodigoList.js +10 -10
- package/dist/base/hooks/dm/formaPagamento/useFormaPagamentoByCodigoList.js.map +1 -1
- package/dist/base/hooks/dm/formaPagamento/useFormaPagamentoList.js +1 -1
- package/dist/base/hooks/dm/formaPagamento/useFormaPagamentoList.js.map +1 -1
- package/dist/base/hooks/dm/grupoVenda/useGrupoVendaByCodigoList.js +11 -11
- package/dist/base/hooks/dm/grupoVenda/useGrupoVendaByCodigoList.js.map +1 -1
- package/dist/base/hooks/dm/grupoVenda/useGrupoVendaList.js +9 -9
- package/dist/base/hooks/dm/grupoVenda/useGrupoVendaList.js.map +1 -1
- package/dist/base/hooks/dm/incoterms/useIncotermsList.js +17 -18
- package/dist/base/hooks/dm/incoterms/useIncotermsList.js.map +1 -1
- package/dist/base/hooks/dm/produto/useProdutoByCodigoList.js +13 -13
- package/dist/base/hooks/dm/produto/useProdutoByCodigoList.js.map +1 -1
- package/dist/base/hooks/dm/produto/useProdutoByGrupoProdutoList.js +21 -21
- package/dist/base/hooks/dm/produto/useProdutoByGrupoProdutoList.js.map +1 -1
- package/dist/base/hooks/dm/produto/useProdutoFindList.js +8 -8
- package/dist/base/hooks/dm/produto/useProdutoFindList.js.map +1 -1
- package/dist/base/hooks/dm/produto/useProdutoFindMonitorList.js +11 -11
- package/dist/base/hooks/dm/produto/useProdutoFindMonitorList.js.map +1 -1
- package/dist/base/hooks/dm/produto/useProdutoIsPrecificadoRacaoList.js +9 -9
- package/dist/base/hooks/dm/produto/useProdutoIsPrecificadoRacaoList.js.map +1 -1
- package/dist/base/hooks/dm/setorAtividade/useSetorAtividadeList.js +5 -5
- package/dist/base/hooks/dm/setorAtividade/useSetorAtividadeList.js.map +1 -1
- package/dist/base/hooks/dm/tipoDocumentoVenda/useTipoDocumentoVendaByCodigoList.js +9 -9
- package/dist/base/hooks/dm/tipoDocumentoVenda/useTipoDocumentoVendaByCodigoList.js.map +1 -1
- package/dist/base/hooks/dm/tipoDocumentoVenda/useTipoDocumentoVendaList.js +9 -9
- package/dist/base/hooks/dm/tipoDocumentoVenda/useTipoDocumentoVendaList.js.map +1 -1
- package/dist/base/hooks/dm/tipoOrdemVenda/useTipoOrdemVendaByCodigoList.js +10 -10
- package/dist/base/hooks/dm/tipoOrdemVenda/useTipoOrdemVendaByCodigoList.js.map +1 -1
- package/dist/base/hooks/dm/tipoOrdemVenda/useTipoOrdemVendaList.js +9 -9
- package/dist/base/hooks/dm/tipoOrdemVenda/useTipoOrdemVendaList.js.map +1 -1
- package/dist/base/hooks/useList.js +10 -10
- package/dist/base/hooks/useList.js.map +1 -1
- package/dist/base/services/modules/transportadora/ControleDescarga/ControleDescargaService.js +15 -15
- package/dist/base/services/modules/transportadora/ControleDescarga/ControleDescargaService.js.map +1 -1
- package/dist/base/services/modules/transportadora/ControleEmbarque/ControleEmbarqueService.js +7 -7
- package/dist/base/services/modules/transportadora/ControleEmbarque/ControleEmbarqueService.js.map +1 -1
- package/dist/base/services/modules/transportadora/NaturezaCarga/NaturezaCargaService.js +5 -5
- package/dist/base/services/modules/transportadora/NaturezaCarga/NaturezaCargaService.js.map +1 -1
- package/dist/base/utils/functions/stringUtils.js +14 -15
- package/dist/base/utils/functions/stringUtils.js.map +1 -1
- package/lib/base/configs/api.config.ts +6 -7
- package/package.json +1 -1
- package/tsconfig.json +6 -1
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useContext as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { DROPDOWN_ITEM_TYPE as
|
|
11
|
-
import { useFloatingTree as
|
|
12
|
-
const { DEFAULT:
|
|
1
|
+
import { jsx as I } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as D, useCallback as h, isValidElement as U, cloneElement as w } from "react";
|
|
3
|
+
import A from "lodash/isNil";
|
|
4
|
+
import H from "../hooks/useUncertainRef.js";
|
|
5
|
+
import K from "../hooks/useUniqueId.js";
|
|
6
|
+
import O from "../utils/classNames.js";
|
|
7
|
+
import b from "./context/dropdownContext.js";
|
|
8
|
+
import g from "./context/menuContext.js";
|
|
9
|
+
import S from "../MenuItem/index.js";
|
|
10
|
+
import { DROPDOWN_ITEM_TYPE as V } from "../utils/constants.js";
|
|
11
|
+
import { useFloatingTree as _ } from "@floating-ui/react";
|
|
12
|
+
const { DEFAULT: j, DIVIDER: q, HEADER: k, CUSTOM: i } = V, ee = (x) => {
|
|
13
13
|
const {
|
|
14
|
-
asElement:
|
|
15
|
-
children:
|
|
16
|
-
active:
|
|
17
|
-
disabled:
|
|
18
|
-
className:
|
|
19
|
-
style:
|
|
20
|
-
eventKey:
|
|
21
|
-
onSelect:
|
|
22
|
-
onClick:
|
|
23
|
-
onFocus:
|
|
24
|
-
ref:
|
|
25
|
-
variant: t =
|
|
26
|
-
...
|
|
27
|
-
} =
|
|
28
|
-
|
|
29
|
-
),
|
|
14
|
+
asElement: m = "li",
|
|
15
|
+
children: n,
|
|
16
|
+
active: F,
|
|
17
|
+
disabled: r,
|
|
18
|
+
className: s,
|
|
19
|
+
style: c,
|
|
20
|
+
eventKey: o,
|
|
21
|
+
onSelect: l,
|
|
22
|
+
onClick: a,
|
|
23
|
+
onFocus: N,
|
|
24
|
+
ref: R = null,
|
|
25
|
+
variant: t = j,
|
|
26
|
+
...u
|
|
27
|
+
} = x, f = D(b), d = D(g), p = H(
|
|
28
|
+
R
|
|
29
|
+
), T = K("menu-item-"), y = F || !A(f?.activeKey) && f?.activeKey === o, v = _(), E = h(
|
|
30
30
|
(e) => {
|
|
31
|
-
o
|
|
31
|
+
l?.(o || "", e), a?.(e);
|
|
32
32
|
},
|
|
33
|
-
[
|
|
34
|
-
),
|
|
33
|
+
[o, a, l]
|
|
34
|
+
), M = h(
|
|
35
35
|
(e) => {
|
|
36
|
-
|
|
36
|
+
r || (E(e), v?.events.emit("click"));
|
|
37
37
|
},
|
|
38
|
-
[
|
|
38
|
+
[r, E, v?.events]
|
|
39
39
|
), C = {
|
|
40
40
|
...d.getItemProps({
|
|
41
41
|
onClick(e) {
|
|
42
|
-
|
|
42
|
+
M(e);
|
|
43
43
|
},
|
|
44
44
|
onFocus(e) {
|
|
45
|
-
|
|
45
|
+
N?.(e), d.setHasFocusInside(!0);
|
|
46
46
|
}
|
|
47
47
|
})
|
|
48
48
|
};
|
|
49
|
-
if (t ===
|
|
50
|
-
return /* @__PURE__ */
|
|
51
|
-
|
|
49
|
+
if (t === q || t === k || t === i)
|
|
50
|
+
return /* @__PURE__ */ I(
|
|
51
|
+
m,
|
|
52
52
|
{
|
|
53
|
-
ref:
|
|
54
|
-
id:
|
|
55
|
-
style:
|
|
56
|
-
className:
|
|
57
|
-
...t ===
|
|
58
|
-
...
|
|
59
|
-
children: (t ===
|
|
53
|
+
ref: p,
|
|
54
|
+
id: T,
|
|
55
|
+
style: c,
|
|
56
|
+
className: O(`menu-item-${t}`, s),
|
|
57
|
+
...t === i ? C : {},
|
|
58
|
+
...u,
|
|
59
|
+
children: (t === k || t === i) && n
|
|
60
60
|
}
|
|
61
61
|
);
|
|
62
|
-
function
|
|
63
|
-
return
|
|
62
|
+
function P() {
|
|
63
|
+
return U(n) ? w(n) : n;
|
|
64
64
|
}
|
|
65
|
-
return /* @__PURE__ */
|
|
66
|
-
|
|
65
|
+
return /* @__PURE__ */ I(
|
|
66
|
+
S,
|
|
67
67
|
{
|
|
68
|
-
ref:
|
|
69
|
-
asElement:
|
|
70
|
-
style:
|
|
71
|
-
isActive:
|
|
72
|
-
disabled:
|
|
73
|
-
eventKey:
|
|
74
|
-
className:
|
|
68
|
+
ref: p,
|
|
69
|
+
asElement: m,
|
|
70
|
+
style: c,
|
|
71
|
+
isActive: y,
|
|
72
|
+
disabled: r,
|
|
73
|
+
eventKey: o,
|
|
74
|
+
className: s,
|
|
75
75
|
...C,
|
|
76
|
-
...
|
|
77
|
-
children:
|
|
76
|
+
...u,
|
|
77
|
+
children: P()
|
|
78
78
|
}
|
|
79
79
|
);
|
|
80
80
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownItem.js","sources":["../../../../../lib/@ecme/components/ui/Dropdown/DropdownItem.tsx"],"sourcesContent":["import { useContext, useCallback, isValidElement, cloneElement } from 'react'\nimport isNil from 'lodash/isNil'\nimport useUncertainRef from '../hooks/useUncertainRef'\nimport useUniqueId from '../hooks/useUniqueId'\nimport classNames from '../utils/classNames'\nimport DropdownContext from './context/dropdownContext'\nimport MenuContext from './context/menuContext'\nimport MenuItem from '../MenuItem'\nimport { DROPDOWN_ITEM_TYPE } from '../utils/constants'\nimport { useFloatingTree } from '@floating-ui/react'\nimport type { CommonProps } from '../@types/common'\nimport type {\n SyntheticEvent,\n RefObject,\n ElementType,\n ReactElement,\n MouseEvent,\n FocusEvent,\n Ref,\n} from 'react'\n\nexport interface DropdownItemProps extends CommonProps {\n asElement?: ElementType\n active?: boolean\n disabled?: boolean\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n submenu?: ReactElement<any>\n eventKey?: string\n onSelect?: (eventKey: string, e: SyntheticEvent) => void\n onFocus?: (e: SyntheticEvent) => void\n onClick?: (e: SyntheticEvent) => void\n ref?: Ref<HTMLElement>\n variant?: 'default' | 'header' | 'divider' | 'custom'\n}\n\nconst { DEFAULT, DIVIDER, HEADER, CUSTOM } = DROPDOWN_ITEM_TYPE\n\nconst DropdownItem = (props: DropdownItemProps) => {\n const {\n asElement: Component = 'li',\n children,\n active: activeProp,\n disabled,\n className,\n style,\n eventKey,\n onSelect,\n onClick,\n onFocus,\n ref = null,\n variant = DEFAULT,\n ...rest\n } = props\n\n const dropdown = useContext(DropdownContext)\n const menu = useContext(MenuContext)\n\n const menuitemRef = useUncertainRef<HTMLElement>(\n ref,\n ) as RefObject<HTMLElement | null>\n\n const menuitemId = useUniqueId('menu-item-')\n\n const active =\n activeProp ||\n (!isNil(dropdown?.activeKey) && dropdown?.activeKey === eventKey)\n\n const tree = useFloatingTree()\n\n const activate = useCallback(\n (e: SyntheticEvent) => {\n onSelect?.(eventKey || '', e)\n onClick?.(e)\n },\n [eventKey, onClick, onSelect],\n )\n\n const handleClick = useCallback(\n (e: SyntheticEvent) => {\n if (disabled) {\n return\n }\n\n activate(e)\n tree?.events.emit('click')\n },\n [disabled, activate, tree?.events],\n )\n\n const menuitemEventHandlers = {\n ...menu.getItemProps({\n onClick(event: MouseEvent<HTMLElement>) {\n handleClick(event)\n },\n onFocus(event: FocusEvent<HTMLElement>) {\n onFocus?.(event)\n menu.setHasFocusInside(true)\n },\n }),\n }\n\n if (variant === DIVIDER || variant === HEADER || variant === CUSTOM) {\n return (\n <Component\n ref={menuitemRef}\n id={menuitemId}\n style={style}\n className={classNames(`menu-item-${variant}`, className)}\n {...(variant === CUSTOM ? menuitemEventHandlers : {})}\n {...rest}\n >\n {(variant === HEADER || variant === CUSTOM) && children}\n </Component>\n )\n }\n\n function renderChildren() {\n if (!isValidElement(children)) {\n return children\n }\n return cloneElement(children)\n }\n\n return (\n <MenuItem\n ref={menuitemRef}\n asElement={Component}\n style={style}\n isActive={active}\n disabled={disabled}\n eventKey={eventKey}\n className={className}\n {...menuitemEventHandlers}\n {...rest}\n >\n {renderChildren()}\n </MenuItem>\n )\n}\n\nexport default DropdownItem\n"],"names":["DEFAULT","DIVIDER","HEADER","CUSTOM","DROPDOWN_ITEM_TYPE","DropdownItem","props","Component","children","activeProp","disabled","className","style","eventKey","onSelect","onClick","onFocus","ref","variant","rest","dropdown","useContext","DropdownContext","menu","MenuContext","menuitemRef","useUncertainRef","menuitemId","useUniqueId","active","isNil","tree","useFloatingTree","activate","useCallback","handleClick","menuitemEventHandlers","event","jsx","classNames","renderChildren","isValidElement","cloneElement","MenuItem"],"mappings":";;;;;;;;;;;AAmCA,MAAM,EAAE,SAAAA,GAAS,SAAAC,GAAS,QAAAC,GAAQ,QAAAC,MAAWC,GAEvCC,KAAe,CAACC,MAA6B;AAC/C,QAAM;AAAA,IACF,WAAWC,IAAY;AAAA,IACvB,UAAAC;AAAA,IACA,QAAQC;AAAA,IACR,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAAAC;AAAA,IACA,SAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,IACN,SAAAC,IAAUlB;AAAA,IACV,GAAGmB;AAAA,EAAA,IACHb,GAEEc,IAAWC,EAAWC,CAAe,GACrCC,IAAOF,EAAWG,CAAW,GAE7BC,IAAcC;AAAA,IAChBT;AAAA,EAAA,GAGEU,IAAaC,EAAY,YAAY,GAErCC,IACFpB,KACC,CAACqB,EAAMV,
|
|
1
|
+
{"version":3,"file":"DropdownItem.js","sources":["../../../../../lib/@ecme/components/ui/Dropdown/DropdownItem.tsx"],"sourcesContent":["import { useContext, useCallback, isValidElement, cloneElement } from 'react'\nimport isNil from 'lodash/isNil'\nimport useUncertainRef from '../hooks/useUncertainRef'\nimport useUniqueId from '../hooks/useUniqueId'\nimport classNames from '../utils/classNames'\nimport DropdownContext from './context/dropdownContext'\nimport MenuContext from './context/menuContext'\nimport MenuItem from '../MenuItem'\nimport { DROPDOWN_ITEM_TYPE } from '../utils/constants'\nimport { useFloatingTree } from '@floating-ui/react'\nimport type { CommonProps } from '../@types/common'\nimport type {\n SyntheticEvent,\n RefObject,\n ElementType,\n ReactElement,\n MouseEvent,\n FocusEvent,\n Ref,\n} from 'react'\n\nexport interface DropdownItemProps extends CommonProps {\n asElement?: ElementType\n active?: boolean\n disabled?: boolean\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n submenu?: ReactElement<any>\n eventKey?: string\n onSelect?: (eventKey: string, e: SyntheticEvent) => void\n onFocus?: (e: SyntheticEvent) => void\n onClick?: (e: SyntheticEvent) => void\n ref?: Ref<HTMLElement>\n variant?: 'default' | 'header' | 'divider' | 'custom'\n}\n\nconst { DEFAULT, DIVIDER, HEADER, CUSTOM } = DROPDOWN_ITEM_TYPE\n\nconst DropdownItem = (props: DropdownItemProps) => {\n const {\n asElement: Component = 'li',\n children,\n active: activeProp,\n disabled,\n className,\n style,\n eventKey,\n onSelect,\n onClick,\n onFocus,\n ref = null,\n variant = DEFAULT,\n ...rest\n } = props\n\n const dropdown = useContext(DropdownContext)\n const menu = useContext(MenuContext)\n\n const menuitemRef = useUncertainRef<HTMLElement>(\n ref,\n ) as RefObject<HTMLElement | null>\n\n const menuitemId = useUniqueId('menu-item-')\n\n const active =\n activeProp ||\n (!isNil(dropdown?.activeKey) && dropdown?.activeKey === eventKey)\n\n const tree = useFloatingTree()\n\n const activate = useCallback(\n (e: SyntheticEvent) => {\n onSelect?.(eventKey || '', e)\n onClick?.(e)\n },\n [eventKey, onClick, onSelect],\n )\n\n const handleClick = useCallback(\n (e: SyntheticEvent) => {\n if (disabled) {\n return\n }\n\n activate(e)\n tree?.events.emit('click')\n },\n [disabled, activate, tree?.events],\n )\n\n const menuitemEventHandlers = {\n ...menu.getItemProps({\n onClick(event: MouseEvent<HTMLElement>) {\n handleClick(event)\n },\n onFocus(event: FocusEvent<HTMLElement>) {\n onFocus?.(event)\n menu.setHasFocusInside(true)\n },\n }),\n }\n\n if (variant === DIVIDER || variant === HEADER || variant === CUSTOM) {\n return (\n <Component\n ref={menuitemRef}\n id={menuitemId}\n style={style}\n className={classNames(`menu-item-${variant}`, className)}\n {...(variant === CUSTOM ? menuitemEventHandlers : {})}\n {...rest}\n >\n {(variant === HEADER || variant === CUSTOM) && children}\n </Component>\n )\n }\n\n function renderChildren() {\n if (!isValidElement(children)) {\n return children\n }\n return cloneElement(children)\n }\n\n return (\n <MenuItem\n ref={menuitemRef}\n asElement={Component}\n style={style}\n isActive={active}\n disabled={disabled}\n eventKey={eventKey}\n className={className}\n {...menuitemEventHandlers}\n {...rest}\n >\n {renderChildren()}\n </MenuItem>\n )\n}\n\nexport default DropdownItem\n"],"names":["DEFAULT","DIVIDER","HEADER","CUSTOM","DROPDOWN_ITEM_TYPE","DropdownItem","props","Component","children","activeProp","disabled","className","style","eventKey","onSelect","onClick","onFocus","ref","variant","rest","dropdown","useContext","DropdownContext","menu","MenuContext","menuitemRef","useUncertainRef","menuitemId","useUniqueId","active","isNil","tree","useFloatingTree","activate","useCallback","handleClick","menuitemEventHandlers","event","jsx","classNames","renderChildren","isValidElement","cloneElement","MenuItem"],"mappings":";;;;;;;;;;;AAmCA,MAAM,EAAE,SAAAA,GAAS,SAAAC,GAAS,QAAAC,GAAQ,QAAAC,MAAWC,GAEvCC,KAAe,CAACC,MAA6B;AAC/C,QAAM;AAAA,IACF,WAAWC,IAAY;AAAA,IACvB,UAAAC;AAAA,IACA,QAAQC;AAAA,IACR,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAAAC;AAAA,IACA,SAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,IACN,SAAAC,IAAUlB;AAAA,IACV,GAAGmB;AAAA,EAAA,IACHb,GAEEc,IAAWC,EAAWC,CAAe,GACrCC,IAAOF,EAAWG,CAAW,GAE7BC,IAAcC;AAAA,IAChBT;AAAA,EAAA,GAGEU,IAAaC,EAAY,YAAY,GAErCC,IACFpB,KACC,CAACqB,EAAMV,GAAU,SAAS,KAAKA,GAAU,cAAcP,GAEtDkB,IAAOC,EAAA,GAEPC,IAAWC;AAAA,IACb,CAAC,MAAsB;AACnB,MAAApB,IAAWD,KAAY,IAAI,CAAC,GAC5BE,IAAU,CAAC;AAAA,IACf;AAAA,IACA,CAACF,GAAUE,GAASD,CAAQ;AAAA,EAAA,GAG1BqB,IAAcD;AAAA,IAChB,CAAC,MAAsB;AACnB,MAAIxB,MAIJuB,EAAS,CAAC,GACVF,GAAM,OAAO,KAAK,OAAO;AAAA,IAC7B;AAAA,IACA,CAACrB,GAAUuB,GAAUF,GAAM,MAAM;AAAA,EAAA,GAG/BK,IAAwB;AAAA,IAC1B,GAAGb,EAAK,aAAa;AAAA,MACjB,QAAQc,GAAgC;AACpC,QAAAF,EAAYE,CAAK;AAAA,MACrB;AAAA,MACA,QAAQA,GAAgC;AACpC,QAAArB,IAAUqB,CAAK,GACfd,EAAK,kBAAkB,EAAI;AAAA,MAC/B;AAAA,IAAA,CACH;AAAA,EAAA;AAGL,MAAIL,MAAYjB,KAAWiB,MAAYhB,KAAUgB,MAAYf;AACzD,WACI,gBAAAmC;AAAA,MAAC/B;AAAA,MAAA;AAAA,QACG,KAAKkB;AAAA,QACL,IAAIE;AAAA,QACJ,OAAAf;AAAA,QACA,WAAW2B,EAAW,aAAarB,CAAO,IAAIP,CAAS;AAAA,QACtD,GAAIO,MAAYf,IAASiC,IAAwB,CAAA;AAAA,QACjD,GAAGjB;AAAA,QAEF,WAAAD,MAAYhB,KAAUgB,MAAYf,MAAWK;AAAA,MAAA;AAAA,IAAA;AAK3D,WAASgC,IAAiB;AACtB,WAAKC,EAAejC,CAAQ,IAGrBkC,EAAalC,CAAQ,IAFjBA;AAAA,EAGf;AAEA,SACI,gBAAA8B;AAAA,IAACK;AAAA,IAAA;AAAA,MACG,KAAKlB;AAAA,MACL,WAAWlB;AAAA,MACX,OAAAK;AAAA,MACA,UAAUiB;AAAA,MACV,UAAAnB;AAAA,MACA,UAAAG;AAAA,MACA,WAAAF;AAAA,MACC,GAAGyB;AAAA,MACH,GAAGjB;AAAA,MAEH,UAAAqB,EAAA;AAAA,IAAe;AAAA,EAAA;AAG5B;"}
|
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
import { jsxs as te, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
2
|
+
import { useState as g, useRef as E, useContext as ne, useEffect as L, useImperativeHandle as oe } from "react";
|
|
3
3
|
import se from "./DropdownToggle.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
4
|
+
import re from "./DropdownSubItem.js";
|
|
5
|
+
import Y from "./context/menuContext.js";
|
|
6
|
+
import h from "../utils/classNames.js";
|
|
7
7
|
import "../ConfigProvider/index.js";
|
|
8
|
-
import { useFloatingTree as
|
|
8
|
+
import { useFloatingTree as ie, useFloatingNodeId as ae, useFloatingParentNodeId as le, useListItem as ce, useFloating as de, autoUpdate as ue, flip as fe, shift as me, useTransitionStyles as pe, useHover as ge, safePolygon as he, useClick as ve, useRole as Ie, useDismiss as Fe, useListNavigation as be, useTypeahead as xe, useInteractions as Ne, useMergeRefs as ye, FloatingNode as Pe, FloatingList as Ce, FloatingPortal as Me, FloatingFocusManager as we } from "@floating-ui/react";
|
|
9
9
|
import { useConfig as Re } from "../ConfigProvider/ConfigProvider.js";
|
|
10
|
-
const
|
|
10
|
+
const je = (j) => {
|
|
11
11
|
const {
|
|
12
|
-
children:
|
|
13
|
-
title:
|
|
14
|
-
renderTitle:
|
|
15
|
-
disabled:
|
|
16
|
-
toggleClassName:
|
|
17
|
-
menuClass:
|
|
18
|
-
placement:
|
|
19
|
-
trigger:
|
|
20
|
-
onOpen:
|
|
21
|
-
ref:
|
|
22
|
-
...
|
|
23
|
-
} =
|
|
24
|
-
|
|
25
|
-
},
|
|
12
|
+
children: z,
|
|
13
|
+
title: v,
|
|
14
|
+
renderTitle: d,
|
|
15
|
+
disabled: I,
|
|
16
|
+
toggleClassName: F,
|
|
17
|
+
menuClass: A,
|
|
18
|
+
placement: b,
|
|
19
|
+
trigger: u = "click",
|
|
20
|
+
onOpen: i,
|
|
21
|
+
ref: x,
|
|
22
|
+
...N
|
|
23
|
+
} = j, [r, l] = g(!1), [y, P] = g(!1), [f, m] = g(null), C = E([]), M = E([]), { direction: w } = Re(), p = ne(Y), t = ie(), a = ae(), c = le(), R = ce(), o = c != null, D = (e) => {
|
|
24
|
+
I || (l(e), i?.(e));
|
|
25
|
+
}, U = () => w === "ltr" ? "bottom-start" : "bottom-end", q = () => w === "ltr" ? "right-start" : "left-start", { floatingStyles: B, refs: k, context: s } = de({
|
|
26
26
|
nodeId: a,
|
|
27
27
|
open: r,
|
|
28
|
-
onOpenChange: (
|
|
29
|
-
|
|
28
|
+
onOpenChange: (e) => {
|
|
29
|
+
D(e);
|
|
30
30
|
},
|
|
31
|
-
placement:
|
|
31
|
+
placement: b || (o ? q() : U()),
|
|
32
32
|
middleware: [fe(), me()],
|
|
33
33
|
whileElementsMounted: ue
|
|
34
|
-
}), { isMounted:
|
|
35
|
-
common: ({ side:
|
|
34
|
+
}), { isMounted: G, styles: J } = pe(s, {
|
|
35
|
+
common: ({ side: e }) => ({
|
|
36
36
|
transformOrigin: {
|
|
37
37
|
top: "bottom",
|
|
38
38
|
bottom: "top",
|
|
39
39
|
left: "right",
|
|
40
40
|
right: "left"
|
|
41
|
-
}[
|
|
41
|
+
}[e]
|
|
42
42
|
}),
|
|
43
43
|
initial: {
|
|
44
44
|
transform: "translateY(-5%)",
|
|
@@ -53,131 +53,130 @@ const ze = (z) => {
|
|
|
53
53
|
opacity: 0,
|
|
54
54
|
transform: "translateY(-5%)"
|
|
55
55
|
}
|
|
56
|
-
}),
|
|
57
|
-
enabled:
|
|
56
|
+
}), K = ge(s, {
|
|
57
|
+
enabled: o || u === "hover",
|
|
58
58
|
delay: { open: 75 },
|
|
59
59
|
handleClose: he({ blockPointerEvents: !0 })
|
|
60
|
-
}),
|
|
60
|
+
}), Q = ve(s, {
|
|
61
61
|
event: "mousedown",
|
|
62
|
-
toggle: !
|
|
63
|
-
ignoreMouse:
|
|
64
|
-
}),
|
|
62
|
+
toggle: !o,
|
|
63
|
+
ignoreMouse: o
|
|
64
|
+
}), V = Ie(s, { role: "menu" }), W = Fe(s, { bubbles: !0 }), X = be(s, {
|
|
65
|
+
listRef: C,
|
|
66
|
+
activeIndex: f,
|
|
67
|
+
nested: o,
|
|
68
|
+
onNavigate: m
|
|
69
|
+
}), Z = xe(s, {
|
|
65
70
|
listRef: M,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
onMatch: r ? p : void 0,
|
|
72
|
-
activeIndex: g
|
|
73
|
-
}), { getReferenceProps: $, getFloatingProps: O, getItemProps: ee } = Ne([
|
|
74
|
-
Q,
|
|
71
|
+
onMatch: r ? m : void 0,
|
|
72
|
+
activeIndex: f
|
|
73
|
+
}), { getReferenceProps: _, getFloatingProps: $, getItemProps: ee } = Ne([
|
|
74
|
+
K,
|
|
75
|
+
V,
|
|
75
76
|
W,
|
|
76
77
|
X,
|
|
77
78
|
Z,
|
|
78
|
-
|
|
79
|
-
...m === "click" ? [V] : []
|
|
79
|
+
...u === "click" ? [Q] : []
|
|
80
80
|
]);
|
|
81
|
-
|
|
82
|
-
if (!
|
|
83
|
-
function
|
|
84
|
-
l(!1),
|
|
81
|
+
L(() => {
|
|
82
|
+
if (!t) return;
|
|
83
|
+
function e() {
|
|
84
|
+
l(!1), i?.(!1);
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
|
|
86
|
+
function S(H) {
|
|
87
|
+
H.nodeId !== a && H.parentId === c && (l(!1), i?.(!1));
|
|
88
88
|
}
|
|
89
|
-
return
|
|
90
|
-
|
|
89
|
+
return t.events.on("click", e), t.events.on("menuopen", S), () => {
|
|
90
|
+
t.events.off("click", e), t.events.off("menuopen", S);
|
|
91
91
|
};
|
|
92
|
-
}, [
|
|
93
|
-
r &&
|
|
94
|
-
}, [
|
|
95
|
-
const
|
|
96
|
-
|
|
92
|
+
}, [t, a, c]), L(() => {
|
|
93
|
+
r && t && t.events.emit("menuopen", { parentId: c, nodeId: a });
|
|
94
|
+
}, [t, r, a, c]);
|
|
95
|
+
const O = ye([k.setReference, R.ref, x]);
|
|
96
|
+
oe(x, () => ({
|
|
97
97
|
handleDropdownOpen: () => {
|
|
98
|
-
l(!0),
|
|
98
|
+
l(!0), i?.(!0);
|
|
99
99
|
},
|
|
100
100
|
handleDropdownClose: () => {
|
|
101
|
-
l(!1),
|
|
101
|
+
l(!1), i?.(!1);
|
|
102
102
|
}
|
|
103
|
-
}), [
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
...
|
|
108
|
-
onFocus(
|
|
109
|
-
|
|
110
|
-
(d = u.onFocus) == null || d.call(u, t), C(!1), h.setHasFocusInside(!0);
|
|
103
|
+
}), [i]);
|
|
104
|
+
const T = {
|
|
105
|
+
..._(
|
|
106
|
+
p.getItemProps({
|
|
107
|
+
...N,
|
|
108
|
+
onFocus(e) {
|
|
109
|
+
N.onFocus?.(e), P(!1), p.setHasFocusInside(!0);
|
|
111
110
|
}
|
|
112
111
|
})
|
|
113
112
|
),
|
|
114
|
-
...
|
|
115
|
-
onContextMenu: (
|
|
116
|
-
|
|
113
|
+
...u === "context" ? {
|
|
114
|
+
onContextMenu: (e) => {
|
|
115
|
+
e.preventDefault(), D(!0);
|
|
117
116
|
}
|
|
118
117
|
} : {}
|
|
119
118
|
};
|
|
120
119
|
return /* @__PURE__ */ te(Pe, { id: a, children: [
|
|
121
|
-
|
|
120
|
+
o ? /* @__PURE__ */ n(
|
|
122
121
|
"li",
|
|
123
122
|
{
|
|
124
|
-
ref:
|
|
125
|
-
tabIndex:
|
|
123
|
+
ref: O,
|
|
124
|
+
tabIndex: p.activeIndex === R.index ? 0 : -1,
|
|
126
125
|
"data-open": r ? "" : void 0,
|
|
127
126
|
"data-nested": "",
|
|
128
|
-
"data-focus-inside":
|
|
129
|
-
className:
|
|
130
|
-
...
|
|
131
|
-
children: /* @__PURE__ */ n(
|
|
127
|
+
"data-focus-inside": y ? "" : void 0,
|
|
128
|
+
className: h(F, "outline-none"),
|
|
129
|
+
...T,
|
|
130
|
+
children: /* @__PURE__ */ n(re, { children: d || v })
|
|
132
131
|
}
|
|
133
132
|
) : /* @__PURE__ */ n(
|
|
134
133
|
se,
|
|
135
134
|
{
|
|
136
|
-
ref:
|
|
135
|
+
ref: O,
|
|
137
136
|
role: "menuitem",
|
|
138
137
|
"data-open": r ? "" : void 0,
|
|
139
|
-
"data-focus-inside":
|
|
140
|
-
className:
|
|
141
|
-
disabled:
|
|
142
|
-
placement:
|
|
143
|
-
renderTitle:
|
|
144
|
-
...
|
|
145
|
-
children:
|
|
138
|
+
"data-focus-inside": y ? "" : void 0,
|
|
139
|
+
className: h(F),
|
|
140
|
+
disabled: I,
|
|
141
|
+
placement: b,
|
|
142
|
+
renderTitle: d,
|
|
143
|
+
...T,
|
|
144
|
+
children: v
|
|
146
145
|
}
|
|
147
146
|
),
|
|
148
147
|
/* @__PURE__ */ n(
|
|
149
|
-
|
|
148
|
+
Y.Provider,
|
|
150
149
|
{
|
|
151
150
|
value: {
|
|
152
|
-
activeIndex:
|
|
153
|
-
setActiveIndex:
|
|
151
|
+
activeIndex: f,
|
|
152
|
+
setActiveIndex: m,
|
|
154
153
|
getItemProps: ee,
|
|
155
|
-
setHasFocusInside:
|
|
154
|
+
setHasFocusInside: P,
|
|
156
155
|
isOpen: r
|
|
157
156
|
},
|
|
158
|
-
children: /* @__PURE__ */ n(Ce, { elementsRef:
|
|
157
|
+
children: /* @__PURE__ */ n(Ce, { elementsRef: C, labelsRef: M, children: G && /* @__PURE__ */ n(Me, { children: /* @__PURE__ */ n(
|
|
159
158
|
we,
|
|
160
159
|
{
|
|
161
|
-
context:
|
|
160
|
+
context: s,
|
|
162
161
|
modal: !1,
|
|
163
|
-
initialFocus:
|
|
164
|
-
returnFocus: !
|
|
162
|
+
initialFocus: o ? -1 : 0,
|
|
163
|
+
returnFocus: !o,
|
|
165
164
|
children: /* @__PURE__ */ n(
|
|
166
165
|
"div",
|
|
167
166
|
{
|
|
168
|
-
ref:
|
|
169
|
-
style:
|
|
170
|
-
|
|
167
|
+
ref: k.setFloating,
|
|
168
|
+
style: B,
|
|
169
|
+
...$(),
|
|
171
170
|
className: "outline-none z-30",
|
|
172
171
|
children: /* @__PURE__ */ n(
|
|
173
172
|
"ul",
|
|
174
173
|
{
|
|
175
|
-
className:
|
|
174
|
+
className: h(
|
|
176
175
|
"dropdown-menu min-w-[160px]",
|
|
177
|
-
|
|
176
|
+
A
|
|
178
177
|
),
|
|
179
|
-
style:
|
|
180
|
-
children:
|
|
178
|
+
style: J,
|
|
179
|
+
children: z
|
|
181
180
|
}
|
|
182
181
|
)
|
|
183
182
|
}
|
|
@@ -189,6 +188,6 @@ const ze = (z) => {
|
|
|
189
188
|
] });
|
|
190
189
|
};
|
|
191
190
|
export {
|
|
192
|
-
|
|
191
|
+
je as default
|
|
193
192
|
};
|
|
194
193
|
//# sourceMappingURL=DropdownMenu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.js","sources":["../../../../../lib/@ecme/components/ui/Dropdown/DropdownMenu.tsx"],"sourcesContent":["import {\n useState,\n useRef,\n useContext,\n useEffect,\n useImperativeHandle,\n} from 'react'\nimport DropdownToggle from './DropdownToggle'\nimport DropdownSubItem from './DropdownSubItem'\nimport MenuContext from './context/menuContext'\nimport classNames from '../utils/classNames'\nimport { useConfig } from '../ConfigProvider'\nimport {\n autoUpdate,\n flip,\n FloatingFocusManager,\n FloatingList,\n FloatingNode,\n FloatingPortal,\n safePolygon,\n shift,\n useClick,\n useDismiss,\n useFloating,\n useFloatingNodeId,\n useFloatingParentNodeId,\n useFloatingTree,\n useHover,\n useInteractions,\n useListItem,\n useListNavigation,\n useMergeRefs,\n useRole,\n useTypeahead,\n useTransitionStyles,\n} from '@floating-ui/react'\nimport type { CommonProps } from '../@types/common'\nimport type { DropdownToggleSharedProps } from './DropdownToggle'\nimport type { DropdownSubItemSharedProps } from './DropdownSubItem'\nimport type { Placement } from '@floating-ui/react'\nimport type { HTMLProps, FocusEvent, MouseEvent, ReactNode, Ref } from 'react'\n\nexport interface DropdownMenuProps\n extends CommonProps,\n DropdownToggleSharedProps,\n DropdownSubItemSharedProps {\n activeKey?: string\n title?: string | ReactNode\n menuClass?: string\n trigger?: 'click' | 'hover' | 'context'\n placement?: Placement\n onOpen?: (bool: boolean) => void\n ref?: Ref<HTMLElement | DropdownMenuRef>\n}\n\nexport type DropdownMenuRef = {\n handleDropdownOpen: () => void\n handleDropdownClose: () => void\n}\n\nconst DropdownMenu = (props: DropdownMenuProps & HTMLProps<HTMLElement>) => {\n const {\n children,\n title,\n renderTitle,\n disabled,\n toggleClassName,\n menuClass,\n placement,\n trigger = 'click',\n onOpen,\n ref,\n ...rest\n } = props\n\n const [isOpen, setIsOpen] = useState(false)\n const [hasFocusInside, setHasFocusInside] = useState(false)\n const [activeIndex, setActiveIndex] = useState<number | null>(null)\n\n const elementsRef = useRef<Array<HTMLElement | null>>([])\n const labelsRef = useRef<Array<string | null>>([])\n\n const { direction } = useConfig()\n\n const parent = useContext(MenuContext)\n\n const tree = useFloatingTree()\n const nodeId = useFloatingNodeId()\n const parentId = useFloatingParentNodeId()\n const item = useListItem()\n\n const isNested = parentId != null\n\n const handleOpen = (open: boolean) => {\n if (disabled) {\n return\n }\n setIsOpen(open)\n onOpen?.(open)\n }\n\n const getDefaultPlacement = () => {\n return direction === 'ltr' ? 'bottom-start' : 'bottom-end'\n }\n\n const getNestedDefaultPlacement = () => {\n return direction === 'ltr' ? 'right-start' : 'left-start'\n }\n\n const { floatingStyles, refs, context } = useFloating<HTMLElement>({\n nodeId,\n open: isOpen,\n onOpenChange: (open) => {\n handleOpen(open)\n },\n placement:\n placement ||\n (isNested ? getNestedDefaultPlacement() : getDefaultPlacement()),\n middleware: [flip(), shift()],\n whileElementsMounted: autoUpdate,\n })\n\n const { isMounted, styles } = useTransitionStyles(context, {\n common: ({ side }) => ({\n transformOrigin: {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left',\n }[side],\n }),\n initial: {\n transform: 'translateY(-5%)',\n opacity: 0,\n },\n duration: 200,\n open: {\n opacity: 1,\n transform: 'translateY(0%)',\n },\n close: {\n opacity: 0,\n transform: 'translateY(-5%)',\n },\n })\n\n const hover = useHover(context, {\n enabled: isNested || trigger === 'hover',\n delay: { open: 75 },\n handleClose: safePolygon({ blockPointerEvents: true }),\n })\n\n const click = useClick(context, {\n event: 'mousedown',\n toggle: !isNested,\n ignoreMouse: isNested,\n })\n\n const role = useRole(context, { role: 'menu' })\n\n const dismiss = useDismiss(context, { bubbles: true })\n\n const listNavigation = useListNavigation(context, {\n listRef: elementsRef,\n activeIndex,\n nested: isNested,\n onNavigate: setActiveIndex,\n })\n const typeahead = useTypeahead(context, {\n listRef: labelsRef,\n onMatch: isOpen ? setActiveIndex : undefined,\n activeIndex,\n })\n\n const { getReferenceProps, getFloatingProps, getItemProps } =\n useInteractions([\n hover,\n role,\n dismiss,\n listNavigation,\n typeahead,\n ...(trigger === 'click' ? [click] : []),\n ])\n\n useEffect(() => {\n if (!tree) return\n\n function handleTreeClick() {\n setIsOpen(false)\n onOpen?.(false)\n }\n\n function onSubMenuOpen(event: { nodeId: string; parentId: string }) {\n if (event.nodeId !== nodeId && event.parentId === parentId) {\n setIsOpen(false)\n onOpen?.(false)\n }\n }\n\n tree.events.on('click', handleTreeClick)\n tree.events.on('menuopen', onSubMenuOpen)\n\n return () => {\n tree.events.off('click', handleTreeClick)\n tree.events.off('menuopen', onSubMenuOpen)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [tree, nodeId, parentId])\n\n useEffect(() => {\n if (isOpen && tree) {\n tree.events.emit('menuopen', { parentId, nodeId })\n }\n }, [tree, isOpen, nodeId, parentId])\n\n const toggleRef = useMergeRefs([refs.setReference, item.ref, ref])\n\n useImperativeHandle(ref, () => {\n return {\n handleDropdownOpen: () => {\n setIsOpen(true)\n onOpen?.(true)\n },\n handleDropdownClose: () => {\n setIsOpen(false)\n onOpen?.(false)\n },\n }\n }, [onOpen])\n\n const toggleProps = {\n ...getReferenceProps(\n parent.getItemProps({\n ...rest,\n onFocus(event: FocusEvent<HTMLElement>) {\n rest.onFocus?.(event)\n setHasFocusInside(false)\n parent.setHasFocusInside(true)\n },\n }),\n ),\n ...(trigger === 'context'\n ? {\n onContextMenu: (e: MouseEvent<HTMLElement>) => {\n e.preventDefault()\n handleOpen(true)\n },\n }\n : {}),\n }\n\n return (\n <FloatingNode id={nodeId}>\n {!isNested ? (\n <DropdownToggle\n ref={toggleRef}\n role={'menuitem'}\n data-open={isOpen ? '' : undefined}\n data-focus-inside={hasFocusInside ? '' : undefined}\n className={classNames(toggleClassName)}\n disabled={disabled}\n placement={placement}\n renderTitle={renderTitle}\n {...toggleProps}\n >\n {title}\n </DropdownToggle>\n ) : (\n <li\n ref={toggleRef}\n tabIndex={parent.activeIndex === item.index ? 0 : -1}\n data-open={isOpen ? '' : undefined}\n data-nested={''}\n data-focus-inside={hasFocusInside ? '' : undefined}\n className={classNames(toggleClassName, 'outline-none')}\n {...toggleProps}\n >\n <DropdownSubItem>\n {renderTitle ? renderTitle : title}\n </DropdownSubItem>\n </li>\n )}\n <MenuContext.Provider\n value={{\n activeIndex,\n setActiveIndex,\n getItemProps,\n setHasFocusInside,\n isOpen,\n }}\n >\n <FloatingList elementsRef={elementsRef} labelsRef={labelsRef}>\n {isMounted && (\n <FloatingPortal>\n <FloatingFocusManager\n context={context}\n modal={false}\n initialFocus={isNested ? -1 : 0}\n returnFocus={!isNested}\n >\n <div\n ref={refs.setFloating}\n style={floatingStyles}\n {...getFloatingProps()}\n className=\"outline-none z-30\"\n >\n <ul\n className={classNames(\n 'dropdown-menu min-w-[160px]',\n menuClass,\n )}\n style={styles}\n >\n {children}\n </ul>\n </div>\n </FloatingFocusManager>\n </FloatingPortal>\n )}\n </FloatingList>\n </MenuContext.Provider>\n </FloatingNode>\n )\n}\n\nexport default DropdownMenu\n"],"names":["DropdownMenu","props","children","title","renderTitle","disabled","toggleClassName","menuClass","placement","trigger","onOpen","ref","rest","isOpen","setIsOpen","useState","hasFocusInside","setHasFocusInside","activeIndex","setActiveIndex","elementsRef","useRef","labelsRef","direction","useConfig","parent","useContext","MenuContext","tree","useFloatingTree","nodeId","useFloatingNodeId","parentId","useFloatingParentNodeId","item","useListItem","isNested","handleOpen","open","getDefaultPlacement","getNestedDefaultPlacement","floatingStyles","refs","context","useFloating","flip","shift","autoUpdate","isMounted","styles","useTransitionStyles","side","hover","useHover","safePolygon","click","useClick","role","useRole","dismiss","useDismiss","listNavigation","useListNavigation","typeahead","useTypeahead","getReferenceProps","getFloatingProps","getItemProps","useInteractions","useEffect","handleTreeClick","onSubMenuOpen","event","toggleRef","useMergeRefs","useImperativeHandle","toggleProps","_a","e","jsxs","FloatingNode","jsx","classNames","DropdownSubItem","DropdownToggle","FloatingList","FloatingPortal","FloatingFocusManager"],"mappings":";;;;;;;;;AA4DA,MAAMA,KAAe,CAACC,MAAsD;AACxE,QAAM;AAAA,IACF,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,QAAAC;AAAA,IACA,KAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHX,GAEE,CAACY,GAAQC,CAAS,IAAIC,EAAS,EAAK,GACpC,CAACC,GAAgBC,CAAiB,IAAIF,EAAS,EAAK,GACpD,CAACG,GAAaC,CAAc,IAAIJ,EAAwB,IAAI,GAE5DK,IAAcC,EAAkC,EAAE,GAClDC,IAAYD,EAA6B,EAAE,GAE3C,EAAE,WAAAE,EAAA,IAAcC,GAAA,GAEhBC,IAASC,GAAWC,CAAW,GAE/BC,IAAOC,GAAA,GACPC,IAASC,GAAA,GACTC,IAAWC,GAAA,GACXC,IAAOC,GAAA,GAEPC,IAAWJ,KAAY,MAEvBK,IAAa,CAACC,MAAkB;AAClC,IAAIjC,MAGJS,EAAUwB,CAAI,GACd5B,KAAA,QAAAA,EAAS4B;AAAA,EACb,GAEMC,IAAsB,MACjBhB,MAAc,QAAQ,iBAAiB,cAG5CiB,IAA4B,MACvBjB,MAAc,QAAQ,gBAAgB,cAG3C,EAAE,gBAAAkB,GAAgB,MAAAC,GAAM,SAAAC,EAAA,IAAYC,GAAyB;AAAA,IAC/D,QAAAd;AAAA,IACA,MAAMjB;AAAA,IACN,cAAc,CAACyB,MAAS;AACpB,MAAAD,EAAWC,CAAI;AAAA,IACnB;AAAA,IACA,WACI9B,MACC4B,IAAWI,EAAA,IAA8BD,EAAA;AAAA,IAC9C,YAAY,CAACM,MAAQC,IAAO;AAAA,IAC5B,sBAAsBC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UAAA0B,uBACIsC,IAAA,EACG,UAAA,gBAAAL;AAAA,UAACM;AAAA,UAAA;AAAA,YACG,SAAA5C;AAAA,YACA,OAAO;AAAA,YACP,cAAcP,IAAW,KAAK;AAAA,YAC9B,aAAa,CAACA;AAAA,YAEd,UAAA,gBAAA6C;AAAA,cAAC;AAAA,cAAA;AAAA,gBACG,KAAKvC,EAAK;AAAA,gBACV,OAAOD;AAAA,gBACN,GAAGyB,EAAA;AAAA,gBACJ,WAAU;AAAA,gBAEV,UAAA,gBAAAe;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACG,WAAWC;AAAA,sBACP;AAAA,sBACA3E;AAAA,oBAAA;AAAA,oBAEJ,OAAO0C;AAAA,oBAEN,UAAA/C;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACL;AAAA,YAAA;AAAA,UACJ;AAAA,QAAA,GAER,EAAA,CAER;AAAA,MAAA;AAAA,IAAA;AAAA,EACJ,GACJ;AAER;"}
|
|
1
|
+
{"version":3,"file":"DropdownMenu.js","sources":["../../../../../lib/@ecme/components/ui/Dropdown/DropdownMenu.tsx"],"sourcesContent":["import {\n useState,\n useRef,\n useContext,\n useEffect,\n useImperativeHandle,\n} from 'react'\nimport DropdownToggle from './DropdownToggle'\nimport DropdownSubItem from './DropdownSubItem'\nimport MenuContext from './context/menuContext'\nimport classNames from '../utils/classNames'\nimport { useConfig } from '../ConfigProvider'\nimport {\n autoUpdate,\n flip,\n FloatingFocusManager,\n FloatingList,\n FloatingNode,\n FloatingPortal,\n safePolygon,\n shift,\n useClick,\n useDismiss,\n useFloating,\n useFloatingNodeId,\n useFloatingParentNodeId,\n useFloatingTree,\n useHover,\n useInteractions,\n useListItem,\n useListNavigation,\n useMergeRefs,\n useRole,\n useTypeahead,\n useTransitionStyles,\n} from '@floating-ui/react'\nimport type { CommonProps } from '../@types/common'\nimport type { DropdownToggleSharedProps } from './DropdownToggle'\nimport type { DropdownSubItemSharedProps } from './DropdownSubItem'\nimport type { Placement } from '@floating-ui/react'\nimport type { HTMLProps, FocusEvent, MouseEvent, ReactNode, Ref } from 'react'\n\nexport interface DropdownMenuProps\n extends CommonProps,\n DropdownToggleSharedProps,\n DropdownSubItemSharedProps {\n activeKey?: string\n title?: string | ReactNode\n menuClass?: string\n trigger?: 'click' | 'hover' | 'context'\n placement?: Placement\n onOpen?: (bool: boolean) => void\n ref?: Ref<HTMLElement | DropdownMenuRef>\n}\n\nexport type DropdownMenuRef = {\n handleDropdownOpen: () => void\n handleDropdownClose: () => void\n}\n\nconst DropdownMenu = (props: DropdownMenuProps & HTMLProps<HTMLElement>) => {\n const {\n children,\n title,\n renderTitle,\n disabled,\n toggleClassName,\n menuClass,\n placement,\n trigger = 'click',\n onOpen,\n ref,\n ...rest\n } = props\n\n const [isOpen, setIsOpen] = useState(false)\n const [hasFocusInside, setHasFocusInside] = useState(false)\n const [activeIndex, setActiveIndex] = useState<number | null>(null)\n\n const elementsRef = useRef<Array<HTMLElement | null>>([])\n const labelsRef = useRef<Array<string | null>>([])\n\n const { direction } = useConfig()\n\n const parent = useContext(MenuContext)\n\n const tree = useFloatingTree()\n const nodeId = useFloatingNodeId()\n const parentId = useFloatingParentNodeId()\n const item = useListItem()\n\n const isNested = parentId != null\n\n const handleOpen = (open: boolean) => {\n if (disabled) {\n return\n }\n setIsOpen(open)\n onOpen?.(open)\n }\n\n const getDefaultPlacement = () => {\n return direction === 'ltr' ? 'bottom-start' : 'bottom-end'\n }\n\n const getNestedDefaultPlacement = () => {\n return direction === 'ltr' ? 'right-start' : 'left-start'\n }\n\n const { floatingStyles, refs, context } = useFloating<HTMLElement>({\n nodeId,\n open: isOpen,\n onOpenChange: (open) => {\n handleOpen(open)\n },\n placement:\n placement ||\n (isNested ? getNestedDefaultPlacement() : getDefaultPlacement()),\n middleware: [flip(), shift()],\n whileElementsMounted: autoUpdate,\n })\n\n const { isMounted, styles } = useTransitionStyles(context, {\n common: ({ side }) => ({\n transformOrigin: {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left',\n }[side],\n }),\n initial: {\n transform: 'translateY(-5%)',\n opacity: 0,\n },\n duration: 200,\n open: {\n opacity: 1,\n transform: 'translateY(0%)',\n },\n close: {\n opacity: 0,\n transform: 'translateY(-5%)',\n },\n })\n\n const hover = useHover(context, {\n enabled: isNested || trigger === 'hover',\n delay: { open: 75 },\n handleClose: safePolygon({ blockPointerEvents: true }),\n })\n\n const click = useClick(context, {\n event: 'mousedown',\n toggle: !isNested,\n ignoreMouse: isNested,\n })\n\n const role = useRole(context, { role: 'menu' })\n\n const dismiss = useDismiss(context, { bubbles: true })\n\n const listNavigation = useListNavigation(context, {\n listRef: elementsRef,\n activeIndex,\n nested: isNested,\n onNavigate: setActiveIndex,\n })\n const typeahead = useTypeahead(context, {\n listRef: labelsRef,\n onMatch: isOpen ? setActiveIndex : undefined,\n activeIndex,\n })\n\n const { getReferenceProps, getFloatingProps, getItemProps } =\n useInteractions([\n hover,\n role,\n dismiss,\n listNavigation,\n typeahead,\n ...(trigger === 'click' ? [click] : []),\n ])\n\n useEffect(() => {\n if (!tree) return\n\n function handleTreeClick() {\n setIsOpen(false)\n onOpen?.(false)\n }\n\n function onSubMenuOpen(event: { nodeId: string; parentId: string }) {\n if (event.nodeId !== nodeId && event.parentId === parentId) {\n setIsOpen(false)\n onOpen?.(false)\n }\n }\n\n tree.events.on('click', handleTreeClick)\n tree.events.on('menuopen', onSubMenuOpen)\n\n return () => {\n tree.events.off('click', handleTreeClick)\n tree.events.off('menuopen', onSubMenuOpen)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [tree, nodeId, parentId])\n\n useEffect(() => {\n if (isOpen && tree) {\n tree.events.emit('menuopen', { parentId, nodeId })\n }\n }, [tree, isOpen, nodeId, parentId])\n\n const toggleRef = useMergeRefs([refs.setReference, item.ref, ref])\n\n useImperativeHandle(ref, () => {\n return {\n handleDropdownOpen: () => {\n setIsOpen(true)\n onOpen?.(true)\n },\n handleDropdownClose: () => {\n setIsOpen(false)\n onOpen?.(false)\n },\n }\n }, [onOpen])\n\n const toggleProps = {\n ...getReferenceProps(\n parent.getItemProps({\n ...rest,\n onFocus(event: FocusEvent<HTMLElement>) {\n rest.onFocus?.(event)\n setHasFocusInside(false)\n parent.setHasFocusInside(true)\n },\n }),\n ),\n ...(trigger === 'context'\n ? {\n onContextMenu: (e: MouseEvent<HTMLElement>) => {\n e.preventDefault()\n handleOpen(true)\n },\n }\n : {}),\n }\n\n return (\n <FloatingNode id={nodeId}>\n {!isNested ? (\n <DropdownToggle\n ref={toggleRef}\n role={'menuitem'}\n data-open={isOpen ? '' : undefined}\n data-focus-inside={hasFocusInside ? '' : undefined}\n className={classNames(toggleClassName)}\n disabled={disabled}\n placement={placement}\n renderTitle={renderTitle}\n {...toggleProps}\n >\n {title}\n </DropdownToggle>\n ) : (\n <li\n ref={toggleRef}\n tabIndex={parent.activeIndex === item.index ? 0 : -1}\n data-open={isOpen ? '' : undefined}\n data-nested={''}\n data-focus-inside={hasFocusInside ? '' : undefined}\n className={classNames(toggleClassName, 'outline-none')}\n {...toggleProps}\n >\n <DropdownSubItem>\n {renderTitle ? renderTitle : title}\n </DropdownSubItem>\n </li>\n )}\n <MenuContext.Provider\n value={{\n activeIndex,\n setActiveIndex,\n getItemProps,\n setHasFocusInside,\n isOpen,\n }}\n >\n <FloatingList elementsRef={elementsRef} labelsRef={labelsRef}>\n {isMounted && (\n <FloatingPortal>\n <FloatingFocusManager\n context={context}\n modal={false}\n initialFocus={isNested ? -1 : 0}\n returnFocus={!isNested}\n >\n <div\n ref={refs.setFloating}\n style={floatingStyles}\n {...getFloatingProps()}\n className=\"outline-none z-30\"\n >\n <ul\n className={classNames(\n 'dropdown-menu min-w-[160px]',\n menuClass,\n )}\n style={styles}\n >\n {children}\n </ul>\n </div>\n </FloatingFocusManager>\n </FloatingPortal>\n )}\n </FloatingList>\n </MenuContext.Provider>\n </FloatingNode>\n )\n}\n\nexport default DropdownMenu\n"],"names":["DropdownMenu","props","children","title","renderTitle","disabled","toggleClassName","menuClass","placement","trigger","onOpen","ref","rest","isOpen","setIsOpen","useState","hasFocusInside","setHasFocusInside","activeIndex","setActiveIndex","elementsRef","useRef","labelsRef","direction","useConfig","parent","useContext","MenuContext","tree","useFloatingTree","nodeId","useFloatingNodeId","parentId","useFloatingParentNodeId","item","useListItem","isNested","handleOpen","open","getDefaultPlacement","getNestedDefaultPlacement","floatingStyles","refs","context","useFloating","flip","shift","autoUpdate","isMounted","styles","useTransitionStyles","side","hover","useHover","safePolygon","click","useClick","role","useRole","dismiss","useDismiss","listNavigation","useListNavigation","typeahead","useTypeahead","getReferenceProps","getFloatingProps","getItemProps","useInteractions","useEffect","handleTreeClick","onSubMenuOpen","event","toggleRef","useMergeRefs","useImperativeHandle","toggleProps","jsxs","FloatingNode","jsx","classNames","DropdownSubItem","DropdownToggle","FloatingList","FloatingPortal","FloatingFocusManager"],"mappings":";;;;;;;;;AA4DA,MAAMA,KAAe,CAACC,MAAsD;AACxE,QAAM;AAAA,IACF,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,QAAAC;AAAA,IACA,KAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHX,GAEE,CAACY,GAAQC,CAAS,IAAIC,EAAS,EAAK,GACpC,CAACC,GAAgBC,CAAiB,IAAIF,EAAS,EAAK,GACpD,CAACG,GAAaC,CAAc,IAAIJ,EAAwB,IAAI,GAE5DK,IAAcC,EAAkC,EAAE,GAClDC,IAAYD,EAA6B,EAAE,GAE3C,EAAE,WAAAE,EAAA,IAAcC,GAAA,GAEhBC,IAASC,GAAWC,CAAW,GAE/BC,IAAOC,GAAA,GACPC,IAASC,GAAA,GACTC,IAAWC,GAAA,GACXC,IAAOC,GAAA,GAEPC,IAAWJ,KAAY,MAEvBK,IAAa,CAACC,MAAkB;AA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,WAAWgE,EAAW1E,CAAe;AAAA,QACrC,UAAAD;AAAA,QACA,WAAAG;AAAA,QACA,aAAAJ;AAAA,QACC,GAAGwE;AAAA,QAEH,UAAAzE;AAAA,MAAA;AAAA,IAAA;AAAA,IAiBT,gBAAA4E;AAAA,MAACpD,EAAY;AAAA,MAAZ;AAAA,QACG,OAAO;AAAA,UACH,aAAAT;AAAA,UACA,gBAAAC;AAAA,UACA,cAAAgD;AAAA,UACA,mBAAAlD;AAAA,UACA,QAAAJ;AAAA,QAAA;AAAA,QAGJ,4BAACsE,IAAA,EAAa,aAAA/D,GAA0B,WAAAE,GACnC,UAAA0B,uBACIoC,IAAA,EACG,UAAA,gBAAAL;AAAA,UAACM;AAAA,UAAA;AAAA,YACG,SAAA1C;AAAA,YACA,OAAO;AAAA,YACP,cAAcP,IAAW,KAAK;AAAA,YAC9B,aAAa,CAACA;AAAA,YAEd,UAAA,gBAAA2C;AAAA,cAAC;AAAA,cAAA;AAAA,gBACG,KAAKrC,EAAK;AAAA,gBACV,OAAOD;AAAA,gBACN,GAAGyB,EAAA;AAAA,gBACJ,WAAU;AAAA,gBAEV,UAAA,gBAAAa;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACG,WAAWC;AAAA,sBACP;AAAA,sBACAzE;AAAA,oBAAA;AAAA,oBAEJ,OAAO0C;AAAA,oBAEN,UAAA/C;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACL;AAAA,YAAA;AAAA,UACJ;AAAA,QAAA,GAER,EAAA,CAER;AAAA,MAAA;AAAA,IAAA;AAAA,EACJ,GACJ;AAER;"}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as e, jsxs as C } from "react/jsx-runtime";
|
|
2
2
|
import { useContext as b } from "react";
|
|
3
3
|
import x from "lodash/isNil";
|
|
4
4
|
import N from "../hooks/useUncertainRef.js";
|
|
5
|
-
import
|
|
5
|
+
import w from "../hooks/useUniqueId.js";
|
|
6
6
|
import "../ConfigProvider/index.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { TbChevronLeft as
|
|
11
|
-
import { useConfig as
|
|
12
|
-
const z = (
|
|
7
|
+
import y from "../utils/classNames.js";
|
|
8
|
+
import I from "./context/dropdownContext.js";
|
|
9
|
+
import K from "../MenuItem/index.js";
|
|
10
|
+
import { TbChevronLeft as R, TbChevronRight as g } from "react-icons/tb";
|
|
11
|
+
import { useConfig as j } from "../ConfigProvider/ConfigProvider.js";
|
|
12
|
+
const z = (r) => {
|
|
13
13
|
const {
|
|
14
|
-
asElement:
|
|
15
|
-
children:
|
|
16
|
-
active:
|
|
14
|
+
asElement: n = "li",
|
|
15
|
+
children: i,
|
|
16
|
+
active: m,
|
|
17
17
|
disabled: s,
|
|
18
18
|
className: c,
|
|
19
19
|
style: a,
|
|
20
|
-
eventKey:
|
|
20
|
+
eventKey: t,
|
|
21
21
|
onSelect: l,
|
|
22
|
-
ref:
|
|
23
|
-
...
|
|
24
|
-
} =
|
|
25
|
-
|
|
26
|
-
),
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
-
|
|
22
|
+
ref: p = null,
|
|
23
|
+
...f
|
|
24
|
+
} = r, { direction: u } = j(), o = b(I), d = N(
|
|
25
|
+
p
|
|
26
|
+
), v = w("menu-item-"), h = m || !x(o?.activeKey) && o?.activeKey === t;
|
|
27
|
+
return /* @__PURE__ */ e("ul", { style: a, className: "relative", ...f, children: /* @__PURE__ */ C(
|
|
28
|
+
K,
|
|
29
29
|
{
|
|
30
|
-
ref:
|
|
30
|
+
ref: d,
|
|
31
31
|
disabled: s,
|
|
32
|
-
asElement:
|
|
33
|
-
id:
|
|
32
|
+
asElement: n,
|
|
33
|
+
id: v,
|
|
34
34
|
isActive: h,
|
|
35
|
-
eventKey:
|
|
36
|
-
className:
|
|
35
|
+
eventKey: t,
|
|
36
|
+
className: y("dropdown-submenu-item", c),
|
|
37
37
|
onSelect: l,
|
|
38
38
|
children: [
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
|
|
39
|
+
/* @__PURE__ */ e("span", { children: i }),
|
|
40
|
+
u === "rtl" ? /* @__PURE__ */ e(R, {}) : /* @__PURE__ */ e(g, {})
|
|
41
41
|
]
|
|
42
42
|
}
|
|
43
43
|
) });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownSubItem.js","sources":["../../../../../lib/@ecme/components/ui/Dropdown/DropdownSubItem.tsx"],"sourcesContent":["import { useContext } from 'react'\nimport isNil from 'lodash/isNil'\nimport useUncertainRef from '../hooks/useUncertainRef'\nimport useUniqueId from '../hooks/useUniqueId'\nimport { useConfig } from '../ConfigProvider'\nimport classNames from '../utils/classNames'\nimport DropdownContext from './context/dropdownContext'\nimport MenuItem from '../MenuItem'\nimport { TbChevronRight, TbChevronLeft } from 'react-icons/tb'\nimport type { CommonProps } from '../@types/common'\nimport type { SyntheticEvent, RefObject, ElementType, Ref } from 'react'\n\nexport interface DropdownSubItemSharedProps {\n onClick?: (e: SyntheticEvent) => void\n onSelect?: (eventKey: string, e: MouseEvent) => void\n disabled?: boolean\n eventKey?: string\n}\n\ninterface DropdownSubItemProps extends CommonProps, DropdownSubItemSharedProps {\n asElement?: ElementType\n active?: boolean\n ref?: Ref<HTMLElement>\n}\n\nconst DropdownSubMenu = (props: DropdownSubItemProps) => {\n const {\n asElement: Component = 'li',\n children,\n active: activeProp,\n disabled,\n className,\n style,\n eventKey,\n onSelect,\n ref = null,\n ...rest\n } = props\n\n const { direction } = useConfig()\n\n const dropdown = useContext(DropdownContext)\n\n const menuitemRef = useUncertainRef<HTMLElement>(\n ref,\n ) as RefObject<HTMLElement | null>\n const menuitemId = useUniqueId('menu-item-')\n\n const active =\n activeProp ||\n (!isNil(dropdown?.activeKey) && dropdown?.activeKey === eventKey)\n\n return (\n <ul style={style} className=\"relative\" {...rest}>\n <MenuItem\n ref={menuitemRef}\n disabled={disabled}\n asElement={Component}\n id={menuitemId}\n isActive={active}\n eventKey={eventKey}\n className={classNames('dropdown-submenu-item', className)}\n onSelect={onSelect}\n >\n <span>{children}</span>\n {direction === 'rtl' ? <TbChevronLeft /> : <TbChevronRight />}\n </MenuItem>\n </ul>\n )\n}\n\nexport default DropdownSubMenu\n"],"names":["DropdownSubMenu","props","Component","children","activeProp","disabled","className","style","eventKey","onSelect","ref","rest","direction","useConfig","dropdown","useContext","DropdownContext","menuitemRef","useUncertainRef","menuitemId","useUniqueId","active","isNil","jsxs","MenuItem","classNames","jsx","TbChevronLeft","TbChevronRight"],"mappings":";;;;;;;;;;;AAyBA,MAAMA,IAAkB,CAACC,MAAgC;AACrD,QAAM;AAAA,IACF,WAAWC,IAAY;AAAA,IACvB,UAAAC;AAAA,IACA,QAAQC;AAAA,IACR,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,IACN,GAAGC;AAAA,EAAA,IACHV,GAEE,EAAE,WAAAW,EAAA,IAAcC,EAAA,GAEhBC,IAAWC,EAAWC,CAAe,GAErCC,IAAcC;AAAA,IAChBR;AAAA,EAAA,GAEES,IAAaC,EAAY,YAAY,GAErCC,IACFjB,KACC,CAACkB,EAAMR,
|
|
1
|
+
{"version":3,"file":"DropdownSubItem.js","sources":["../../../../../lib/@ecme/components/ui/Dropdown/DropdownSubItem.tsx"],"sourcesContent":["import { useContext } from 'react'\nimport isNil from 'lodash/isNil'\nimport useUncertainRef from '../hooks/useUncertainRef'\nimport useUniqueId from '../hooks/useUniqueId'\nimport { useConfig } from '../ConfigProvider'\nimport classNames from '../utils/classNames'\nimport DropdownContext from './context/dropdownContext'\nimport MenuItem from '../MenuItem'\nimport { TbChevronRight, TbChevronLeft } from 'react-icons/tb'\nimport type { CommonProps } from '../@types/common'\nimport type { SyntheticEvent, RefObject, ElementType, Ref } from 'react'\n\nexport interface DropdownSubItemSharedProps {\n onClick?: (e: SyntheticEvent) => void\n onSelect?: (eventKey: string, e: MouseEvent) => void\n disabled?: boolean\n eventKey?: string\n}\n\ninterface DropdownSubItemProps extends CommonProps, DropdownSubItemSharedProps {\n asElement?: ElementType\n active?: boolean\n ref?: Ref<HTMLElement>\n}\n\nconst DropdownSubMenu = (props: DropdownSubItemProps) => {\n const {\n asElement: Component = 'li',\n children,\n active: activeProp,\n disabled,\n className,\n style,\n eventKey,\n onSelect,\n ref = null,\n ...rest\n } = props\n\n const { direction } = useConfig()\n\n const dropdown = useContext(DropdownContext)\n\n const menuitemRef = useUncertainRef<HTMLElement>(\n ref,\n ) as RefObject<HTMLElement | null>\n const menuitemId = useUniqueId('menu-item-')\n\n const active =\n activeProp ||\n (!isNil(dropdown?.activeKey) && dropdown?.activeKey === eventKey)\n\n return (\n <ul style={style} className=\"relative\" {...rest}>\n <MenuItem\n ref={menuitemRef}\n disabled={disabled}\n asElement={Component}\n id={menuitemId}\n isActive={active}\n eventKey={eventKey}\n className={classNames('dropdown-submenu-item', className)}\n onSelect={onSelect}\n >\n <span>{children}</span>\n {direction === 'rtl' ? <TbChevronLeft /> : <TbChevronRight />}\n </MenuItem>\n </ul>\n )\n}\n\nexport default DropdownSubMenu\n"],"names":["DropdownSubMenu","props","Component","children","activeProp","disabled","className","style","eventKey","onSelect","ref","rest","direction","useConfig","dropdown","useContext","DropdownContext","menuitemRef","useUncertainRef","menuitemId","useUniqueId","active","isNil","jsxs","MenuItem","classNames","jsx","TbChevronLeft","TbChevronRight"],"mappings":";;;;;;;;;;;AAyBA,MAAMA,IAAkB,CAACC,MAAgC;AACrD,QAAM;AAAA,IACF,WAAWC,IAAY;AAAA,IACvB,UAAAC;AAAA,IACA,QAAQC;AAAA,IACR,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,IACN,GAAGC;AAAA,EAAA,IACHV,GAEE,EAAE,WAAAW,EAAA,IAAcC,EAAA,GAEhBC,IAAWC,EAAWC,CAAe,GAErCC,IAAcC;AAAA,IAChBR;AAAA,EAAA,GAEES,IAAaC,EAAY,YAAY,GAErCC,IACFjB,KACC,CAACkB,EAAMR,GAAU,SAAS,KAAKA,GAAU,cAAcN;AAE5D,2BACK,MAAA,EAAG,OAAAD,GAAc,WAAU,YAAY,GAAGI,GACvC,UAAA,gBAAAY;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,KAAKP;AAAA,MACL,UAAAZ;AAAA,MACA,WAAWH;AAAA,MACX,IAAIiB;AAAA,MACJ,UAAUE;AAAA,MACV,UAAAb;AAAA,MACA,WAAWiB,EAAW,yBAAyBnB,CAAS;AAAA,MACxD,UAAAG;AAAA,MAEA,UAAA;AAAA,QAAA,gBAAAiB,EAAC,UAAM,UAAAvB,GAAS;AAAA,QACfS,MAAc,QAAQ,gBAAAc,EAACC,GAAA,CAAA,CAAc,sBAAMC,GAAA,CAAA,CAAe;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAEnE;AAER;"}
|