@orbe-agro/client-core 5.3.86 → 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,9 +1,9 @@
|
|
|
1
|
-
import { jsx as t, jsxs as d, Fragment as
|
|
2
|
-
import { Menu as
|
|
3
|
-
import { Dropdown as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
const { MenuItem: f, MenuCollapse: k } =
|
|
1
|
+
import { jsx as t, jsxs as d, Fragment as p } from "react/jsx-runtime";
|
|
2
|
+
import { Menu as y } from "../../ui/Menu/index.js";
|
|
3
|
+
import { Dropdown as a } from "../../ui/Dropdown/index.js";
|
|
4
|
+
import c from "./VerticalMenuIcon.js";
|
|
5
|
+
import h from "../../shared/AuthorityCheck.js";
|
|
6
|
+
const { MenuItem: f, MenuCollapse: k } = y, I = ({
|
|
7
7
|
nav: e,
|
|
8
8
|
indent: r,
|
|
9
9
|
dotIndent: o,
|
|
@@ -13,8 +13,8 @@ const { MenuItem: f, MenuCollapse: k } = p, I = ({
|
|
|
13
13
|
}) => /* @__PURE__ */ t(
|
|
14
14
|
k,
|
|
15
15
|
{
|
|
16
|
-
label: /* @__PURE__ */ d(
|
|
17
|
-
/* @__PURE__ */ t(
|
|
16
|
+
label: /* @__PURE__ */ d(p, { children: [
|
|
17
|
+
/* @__PURE__ */ t(c, { icon: e.icon }),
|
|
18
18
|
/* @__PURE__ */ t("span", { children: l(e.translateKey, e.title) })
|
|
19
19
|
] }),
|
|
20
20
|
eventKey: e.key,
|
|
@@ -31,32 +31,32 @@ const { MenuItem: f, MenuCollapse: k } = p, I = ({
|
|
|
31
31
|
t: i,
|
|
32
32
|
renderAsIcon: n,
|
|
33
33
|
userAuthority: l,
|
|
34
|
-
parentKeys:
|
|
34
|
+
parentKeys: s
|
|
35
35
|
}) => {
|
|
36
|
-
const
|
|
36
|
+
const m = /* @__PURE__ */ t(
|
|
37
37
|
f,
|
|
38
38
|
{
|
|
39
|
-
isActive:
|
|
39
|
+
isActive: s?.includes(e.key),
|
|
40
40
|
eventKey: e.key,
|
|
41
41
|
className: "mb-2",
|
|
42
|
-
children: /* @__PURE__ */ t(
|
|
42
|
+
children: /* @__PURE__ */ t(c, { icon: e.icon })
|
|
43
43
|
},
|
|
44
44
|
e.key
|
|
45
45
|
), u = /* @__PURE__ */ t("div", { children: i(e.translateKey, e.title) }, e.key);
|
|
46
|
-
return /* @__PURE__ */ t(
|
|
47
|
-
|
|
46
|
+
return /* @__PURE__ */ t(h, { userAuthority: l, authority: e.authority, children: /* @__PURE__ */ t(
|
|
47
|
+
a,
|
|
48
48
|
{
|
|
49
49
|
trigger: "hover",
|
|
50
|
-
renderTitle: n ?
|
|
50
|
+
renderTitle: n ? m : u,
|
|
51
51
|
placement: r === "rtl" ? "left-start" : "right-start",
|
|
52
52
|
children: o
|
|
53
53
|
}
|
|
54
54
|
) });
|
|
55
|
-
},
|
|
55
|
+
}, b = ({
|
|
56
56
|
sideCollapsed: e,
|
|
57
57
|
...r
|
|
58
58
|
}) => e ? /* @__PURE__ */ t(M, { ...r }) : /* @__PURE__ */ t(I, { ...r });
|
|
59
59
|
export {
|
|
60
|
-
|
|
60
|
+
b as default
|
|
61
61
|
};
|
|
62
62
|
//# sourceMappingURL=VerticalCollapsedMenuItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VerticalCollapsedMenuItem.js","sources":["../../../../../lib/@ecme/components/template/VerticalMenuContent/VerticalCollapsedMenuItem.tsx"],"sourcesContent":["import Menu from \"@/components/ui/Menu\";\nimport Dropdown from \"@/components/ui/Dropdown\";\nimport VerticalMenuIcon from \"./VerticalMenuIcon\";\nimport AuthorityCheck from \"@/components/shared/AuthorityCheck\";\nimport type { CommonProps, TraslationFn } from \"@/@types/common\";\nimport type { Direction } from \"@/@types/theme\";\nimport type { NavigationTree } from \"@/@types/navigation\";\n\ninterface DefaultItemProps extends CommonProps {\n nav: NavigationTree;\n onLinkClick?: (link: { key: string; title: string; path: string }) => void;\n t: TraslationFn;\n indent?: boolean;\n dotIndent?: boolean;\n userAuthority: string[];\n}\n\ninterface CollapsedItemProps extends DefaultItemProps {\n direction: Direction;\n renderAsIcon?: boolean;\n currentKey?: string;\n parentKeys?: string[];\n}\n\ninterface VerticalCollapsedMenuItemProps extends CollapsedItemProps {\n sideCollapsed?: boolean;\n}\n\nconst { MenuItem, MenuCollapse } = Menu;\n\nconst DefaultItem = ({\n nav,\n indent,\n dotIndent,\n children,\n userAuthority,\n t,\n}: DefaultItemProps) => {\n return (\n <MenuCollapse\n key={nav.key}\n label={\n <>\n <VerticalMenuIcon icon={nav.icon} />\n <span>{t(nav.translateKey, nav.title)}</span>\n </>\n }\n eventKey={nav.key}\n expanded={false}\n dotIndent={dotIndent}\n indent={indent}\n >\n {children}\n </MenuCollapse>\n );\n};\n\nconst CollapsedItem = ({\n nav,\n direction,\n children,\n t,\n renderAsIcon,\n userAuthority,\n parentKeys,\n}: CollapsedItemProps) => {\n const menuItem = (\n <MenuItem\n key={nav.key}\n isActive={parentKeys?.includes(nav.key)}\n eventKey={nav.key}\n className=\"mb-2\"\n >\n <VerticalMenuIcon icon={nav.icon} />\n </MenuItem>\n );\n\n const dropdownItem = (\n <div key={nav.key}>{t(nav.translateKey, nav.title)}</div>\n );\n\n return (\n <AuthorityCheck userAuthority={userAuthority} authority={nav.authority}>\n <Dropdown\n trigger=\"hover\"\n renderTitle={renderAsIcon ? menuItem : dropdownItem}\n placement={direction === \"rtl\" ? \"left-start\" : \"right-start\"}\n >\n {children}\n </Dropdown>\n </AuthorityCheck>\n );\n};\n\nconst VerticalCollapsedMenuItem = ({\n sideCollapsed,\n ...rest\n}: VerticalCollapsedMenuItemProps) => {\n return sideCollapsed ? (\n <CollapsedItem {...rest} />\n ) : (\n <DefaultItem {...rest} />\n );\n};\n\nexport default VerticalCollapsedMenuItem;\n"],"names":["MenuItem","MenuCollapse","Menu","DefaultItem","nav","indent","dotIndent","children","userAuthority","t","jsx","jsxs","Fragment","VerticalMenuIcon","CollapsedItem","direction","renderAsIcon","parentKeys","menuItem","dropdownItem","AuthorityCheck","Dropdown","VerticalCollapsedMenuItem","sideCollapsed","rest"],"mappings":";;;;;AA4BA,MAAM,EAAE,UAAAA,GAAU,cAAAC,EAAA,IAAiBC,GAE7BC,IAAc,CAAC;AAAA,EACnB,KAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,GAAAC;AACF,MAEI,gBAAAC;AAAA,EAACT;AAAA,EAAA;AAAA,IAEC,OACE,gBAAAU,EAAAC,GAAA,EACE,UAAA;AAAA,MAAA,gBAAAF,EAACG,GAAA,EAAiB,MAAMT,EAAI,KAAA,CAAM;AAAA,wBACjC,QAAA,EAAM,UAAAK,EAAEL,EAAI,cAAcA,EAAI,KAAK,EAAA,CAAE;AAAA,IAAA,GACxC;AAAA,IAEF,UAAUA,EAAI;AAAA,IACd,UAAU;AAAA,IACV,WAAAE;AAAA,IACA,QAAAD;AAAA,IAEC,UAAAE;AAAA,EAAA;AAAA,EAZIH,EAAI;AAAA,GAiBTU,IAAgB,CAAC;AAAA,EACrB,KAAAV;AAAA,EACA,WAAAW;AAAA,EACA,UAAAR;AAAA,EACA,GAAAE;AAAA,EACA,cAAAO;AAAA,EACA,eAAAR;AAAA,EACA,YAAAS;AACF,MAA0B;AACxB,QAAMC,IACJ,gBAAAR;AAAA,IAACV;AAAA,IAAA;AAAA,MAEC,UAAUiB,
|
|
1
|
+
{"version":3,"file":"VerticalCollapsedMenuItem.js","sources":["../../../../../lib/@ecme/components/template/VerticalMenuContent/VerticalCollapsedMenuItem.tsx"],"sourcesContent":["import Menu from \"@/components/ui/Menu\";\nimport Dropdown from \"@/components/ui/Dropdown\";\nimport VerticalMenuIcon from \"./VerticalMenuIcon\";\nimport AuthorityCheck from \"@/components/shared/AuthorityCheck\";\nimport type { CommonProps, TraslationFn } from \"@/@types/common\";\nimport type { Direction } from \"@/@types/theme\";\nimport type { NavigationTree } from \"@/@types/navigation\";\n\ninterface DefaultItemProps extends CommonProps {\n nav: NavigationTree;\n onLinkClick?: (link: { key: string; title: string; path: string }) => void;\n t: TraslationFn;\n indent?: boolean;\n dotIndent?: boolean;\n userAuthority: string[];\n}\n\ninterface CollapsedItemProps extends DefaultItemProps {\n direction: Direction;\n renderAsIcon?: boolean;\n currentKey?: string;\n parentKeys?: string[];\n}\n\ninterface VerticalCollapsedMenuItemProps extends CollapsedItemProps {\n sideCollapsed?: boolean;\n}\n\nconst { MenuItem, MenuCollapse } = Menu;\n\nconst DefaultItem = ({\n nav,\n indent,\n dotIndent,\n children,\n userAuthority,\n t,\n}: DefaultItemProps) => {\n return (\n <MenuCollapse\n key={nav.key}\n label={\n <>\n <VerticalMenuIcon icon={nav.icon} />\n <span>{t(nav.translateKey, nav.title)}</span>\n </>\n }\n eventKey={nav.key}\n expanded={false}\n dotIndent={dotIndent}\n indent={indent}\n >\n {children}\n </MenuCollapse>\n );\n};\n\nconst CollapsedItem = ({\n nav,\n direction,\n children,\n t,\n renderAsIcon,\n userAuthority,\n parentKeys,\n}: CollapsedItemProps) => {\n const menuItem = (\n <MenuItem\n key={nav.key}\n isActive={parentKeys?.includes(nav.key)}\n eventKey={nav.key}\n className=\"mb-2\"\n >\n <VerticalMenuIcon icon={nav.icon} />\n </MenuItem>\n );\n\n const dropdownItem = (\n <div key={nav.key}>{t(nav.translateKey, nav.title)}</div>\n );\n\n return (\n <AuthorityCheck userAuthority={userAuthority} authority={nav.authority}>\n <Dropdown\n trigger=\"hover\"\n renderTitle={renderAsIcon ? menuItem : dropdownItem}\n placement={direction === \"rtl\" ? \"left-start\" : \"right-start\"}\n >\n {children}\n </Dropdown>\n </AuthorityCheck>\n );\n};\n\nconst VerticalCollapsedMenuItem = ({\n sideCollapsed,\n ...rest\n}: VerticalCollapsedMenuItemProps) => {\n return sideCollapsed ? (\n <CollapsedItem {...rest} />\n ) : (\n <DefaultItem {...rest} />\n );\n};\n\nexport default VerticalCollapsedMenuItem;\n"],"names":["MenuItem","MenuCollapse","Menu","DefaultItem","nav","indent","dotIndent","children","userAuthority","t","jsx","jsxs","Fragment","VerticalMenuIcon","CollapsedItem","direction","renderAsIcon","parentKeys","menuItem","dropdownItem","AuthorityCheck","Dropdown","VerticalCollapsedMenuItem","sideCollapsed","rest"],"mappings":";;;;;AA4BA,MAAM,EAAE,UAAAA,GAAU,cAAAC,EAAA,IAAiBC,GAE7BC,IAAc,CAAC;AAAA,EACnB,KAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,GAAAC;AACF,MAEI,gBAAAC;AAAA,EAACT;AAAA,EAAA;AAAA,IAEC,OACE,gBAAAU,EAAAC,GAAA,EACE,UAAA;AAAA,MAAA,gBAAAF,EAACG,GAAA,EAAiB,MAAMT,EAAI,KAAA,CAAM;AAAA,wBACjC,QAAA,EAAM,UAAAK,EAAEL,EAAI,cAAcA,EAAI,KAAK,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} from "react/jsx-runtime";
|
|
2
|
+
import { useState as A, useEffect as _, Fragment as x } from "react";
|
|
3
|
+
import { Menu as a } from "../../ui/Menu/index.js";
|
|
4
4
|
import N from "./VerticalSingleMenuItem.js";
|
|
5
5
|
import L from "./VerticalCollapsedMenuItem.js";
|
|
6
6
|
import { themeConfig as S } from "../../../configs/theme.config.js";
|
|
7
7
|
import { NAV_ITEM_TYPE_ITEM as V, NAV_ITEM_TYPE_COLLAPSE as P, NAV_ITEM_TYPE_TITLE as w } from "../../../constants/navigation.constant.js";
|
|
8
8
|
import F from "../../../utils/hooks/useMenuActive.js";
|
|
9
9
|
import { useTranslation as Y } from "../../../utils/hooks/useTranslation.js";
|
|
10
|
-
const { MenuGroup: j } =
|
|
10
|
+
const { MenuGroup: j } = a, h = (p, n) => p.reduce((i, t) => {
|
|
11
11
|
if (t.subMenu && t.subMenu.length > 0) {
|
|
12
|
-
const s =
|
|
12
|
+
const s = h(
|
|
13
13
|
t.subMenu,
|
|
14
14
|
n
|
|
15
15
|
);
|
|
16
|
-
s.length > 0 &&
|
|
16
|
+
s.length > 0 && i.push({ ...t, subMenu: s });
|
|
17
17
|
} else
|
|
18
|
-
(t.path && n.includes(t.path) || !t.path) &&
|
|
19
|
-
return
|
|
20
|
-
}, []),
|
|
18
|
+
(t.path && n.includes(t.path) || !t.path) && i.push(t);
|
|
19
|
+
return i;
|
|
20
|
+
}, []), J = (p) => {
|
|
21
21
|
const {
|
|
22
22
|
collapsed: n,
|
|
23
|
-
routeKey:
|
|
23
|
+
routeKey: i,
|
|
24
24
|
navigationTree: t = [],
|
|
25
25
|
onMenuItemClick: s,
|
|
26
|
-
direction:
|
|
27
|
-
translationSetup:
|
|
28
|
-
userAuthority:
|
|
29
|
-
linkRenderer:
|
|
30
|
-
} =
|
|
26
|
+
direction: m = S.direction,
|
|
27
|
+
translationSetup: k,
|
|
28
|
+
userAuthority: d,
|
|
29
|
+
linkRenderer: K
|
|
30
|
+
} = p, { t: y } = Y(!k), [c, T] = A([]), M = h(
|
|
31
31
|
t,
|
|
32
|
-
|
|
33
|
-
), { activedRoute:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}, [
|
|
37
|
-
const
|
|
38
|
-
s
|
|
39
|
-
},
|
|
40
|
-
const
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
-
|
|
32
|
+
d
|
|
33
|
+
), { activedRoute: r } = F(M, i);
|
|
34
|
+
_(() => {
|
|
35
|
+
r?.parentKey && T([r?.parentKey]);
|
|
36
|
+
}, [r?.parentKey]);
|
|
37
|
+
const b = () => {
|
|
38
|
+
s?.();
|
|
39
|
+
}, f = (g, o = 0, C) => {
|
|
40
|
+
const l = o + 1;
|
|
41
|
+
return /* @__PURE__ */ u(E, { children: g.map((e) => /* @__PURE__ */ I(x, { children: [
|
|
42
|
+
e.type === V && /* @__PURE__ */ u(
|
|
43
43
|
N,
|
|
44
44
|
{
|
|
45
|
-
currentKey:
|
|
46
|
-
parentKeys:
|
|
47
|
-
nav:
|
|
45
|
+
currentKey: r?.key,
|
|
46
|
+
parentKeys: c,
|
|
47
|
+
nav: e,
|
|
48
48
|
sideCollapsed: n,
|
|
49
|
-
direction:
|
|
49
|
+
direction: m,
|
|
50
50
|
indent: C,
|
|
51
|
-
renderAsIcon:
|
|
52
|
-
showIcon:
|
|
53
|
-
userAuthority:
|
|
54
|
-
showTitle:
|
|
55
|
-
t:
|
|
56
|
-
onLinkClick:
|
|
57
|
-
linkRenderer:
|
|
51
|
+
renderAsIcon: o <= 0,
|
|
52
|
+
showIcon: o <= 0,
|
|
53
|
+
userAuthority: d,
|
|
54
|
+
showTitle: e.forceShowTitle ?? (n ? o >= 1 : o <= 1),
|
|
55
|
+
t: y,
|
|
56
|
+
onLinkClick: b,
|
|
57
|
+
linkRenderer: K
|
|
58
58
|
},
|
|
59
|
-
|
|
59
|
+
e.key
|
|
60
60
|
),
|
|
61
|
-
|
|
61
|
+
e.type === P && /* @__PURE__ */ u(
|
|
62
62
|
L,
|
|
63
63
|
{
|
|
64
|
-
currentKey:
|
|
65
|
-
parentKeys:
|
|
66
|
-
nav:
|
|
64
|
+
currentKey: r?.key,
|
|
65
|
+
parentKeys: c,
|
|
66
|
+
nav: e,
|
|
67
67
|
sideCollapsed: n,
|
|
68
|
-
direction:
|
|
69
|
-
indent:
|
|
70
|
-
dotIndent:
|
|
71
|
-
renderAsIcon:
|
|
72
|
-
userAuthority:
|
|
73
|
-
t:
|
|
68
|
+
direction: m,
|
|
69
|
+
indent: l >= 2,
|
|
70
|
+
dotIndent: l >= 2,
|
|
71
|
+
renderAsIcon: l <= 1,
|
|
72
|
+
userAuthority: d,
|
|
73
|
+
t: y,
|
|
74
74
|
onLinkClick: s,
|
|
75
|
-
children:
|
|
75
|
+
children: e.subMenu && e.subMenu.length > 0 && f(e.subMenu, l, !0)
|
|
76
76
|
},
|
|
77
|
-
|
|
77
|
+
e.key
|
|
78
78
|
),
|
|
79
|
-
|
|
80
|
-
] },
|
|
79
|
+
e.type === w && /* @__PURE__ */ u(j, { label: y(e.translateKey) || e.title, children: e.subMenu && e.subMenu.length > 0 && f(e.subMenu, o, !1) }, e.key)
|
|
80
|
+
] }, e.key)) });
|
|
81
81
|
};
|
|
82
|
-
return /* @__PURE__ */
|
|
83
|
-
|
|
82
|
+
return /* @__PURE__ */ u(
|
|
83
|
+
a,
|
|
84
84
|
{
|
|
85
85
|
className: "px-4 pb-4",
|
|
86
86
|
sideCollapsed: n,
|
|
87
|
-
defaultActiveKeys:
|
|
88
|
-
defaultExpandedKeys:
|
|
89
|
-
defaultCollapseActiveKeys:
|
|
90
|
-
children:
|
|
87
|
+
defaultActiveKeys: r?.key ? [r.key] : [],
|
|
88
|
+
defaultExpandedKeys: c,
|
|
89
|
+
defaultCollapseActiveKeys: r?.parentKey ? [r.parentKey] : [],
|
|
90
|
+
children: f(M, 0)
|
|
91
91
|
}
|
|
92
92
|
);
|
|
93
93
|
};
|
|
94
94
|
export {
|
|
95
|
-
|
|
95
|
+
J as default
|
|
96
96
|
};
|
|
97
97
|
//# sourceMappingURL=VerticalMenuContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VerticalMenuContent.js","sources":["../../../../../lib/@ecme/components/template/VerticalMenuContent/VerticalMenuContent.tsx"],"sourcesContent":["import { useState, useEffect, Fragment } from \"react\";\nimport Menu from \"@/components/ui/Menu\";\nimport VerticalSingleMenuItem from \"./VerticalSingleMenuItem\";\nimport VerticalCollapsedMenuItem from \"./VerticalCollapsedMenuItem\";\nimport { themeConfig } from \"@/configs/theme.config\";\nimport {\n NAV_ITEM_TYPE_TITLE,\n NAV_ITEM_TYPE_COLLAPSE,\n NAV_ITEM_TYPE_ITEM,\n} from \"@/constants/navigation.constant\";\nimport useMenuActive from \"@/utils/hooks/useMenuActive\";\nimport useTranslation from \"@/utils/hooks/useTranslation\";\nimport { Direction } from \"@/@types/theme\";\nimport type { NavigationTree } from \"@/@types/navigation\";\nimport type { TraslationFn } from \"@/@types/common\";\nimport { LinkRenderer } from \"@/components/layouts/Layouts\";\n\nexport interface VerticalMenuContentProps {\n collapsed?: boolean;\n routeKey: string;\n navigationTree?: NavigationTree[];\n onMenuItemClick?: () => void;\n direction?: Direction;\n translationSetup?: boolean;\n userAuthority: string[];\n linkRenderer?: LinkRenderer;\n}\n\nconst { MenuGroup } = Menu;\n\nconst filterNavigationByAuthority = (\n navTree: NavigationTree[],\n userAuthority: string[]\n): NavigationTree[] => {\n return navTree.reduce((acc: NavigationTree[], nav) => {\n if (nav.subMenu && nav.subMenu.length > 0) {\n const filteredSubMenu = filterNavigationByAuthority(\n nav.subMenu,\n userAuthority\n );\n if (filteredSubMenu.length > 0) {\n acc.push({ ...nav, subMenu: filteredSubMenu });\n }\n } else {\n if ((nav.path && userAuthority.includes(nav.path)) || !nav.path) {\n acc.push(nav);\n }\n }\n return acc;\n }, []);\n};\n\nconst VerticalMenuContent = (props: VerticalMenuContentProps) => {\n const {\n collapsed,\n routeKey,\n navigationTree = [],\n onMenuItemClick,\n direction = themeConfig.direction,\n translationSetup,\n userAuthority,\n linkRenderer,\n } = props;\n\n const { t } = useTranslation(!translationSetup);\n const [defaulExpandKey, setDefaulExpandKey] = useState<string[]>([]);\n const filteredNavigationTree = filterNavigationByAuthority(\n navigationTree,\n userAuthority\n );\n\n const { activedRoute } = useMenuActive(filteredNavigationTree, routeKey);\n\n useEffect(() => {\n if (activedRoute?.parentKey) {\n setDefaulExpandKey([activedRoute?.parentKey]);\n }\n }, [activedRoute?.parentKey]);\n\n const handleLinkClick = () => {\n onMenuItemClick?.();\n };\n\n const renderNavigation = (\n navTree: NavigationTree[],\n cascade: number = 0,\n indent?: boolean\n ) => {\n const nextCascade = cascade + 1;\n\n return (\n <>\n {navTree.map((nav) => (\n <Fragment key={nav.key}>\n {nav.type === NAV_ITEM_TYPE_ITEM && (\n <VerticalSingleMenuItem\n key={nav.key}\n currentKey={activedRoute?.key}\n parentKeys={defaulExpandKey}\n nav={nav}\n sideCollapsed={collapsed}\n direction={direction}\n indent={indent}\n renderAsIcon={cascade <= 0}\n showIcon={cascade <= 0}\n userAuthority={userAuthority}\n showTitle={\n nav.forceShowTitle ??\n (collapsed ? cascade >= 1 : cascade <= 1)\n }\n t={t as TraslationFn}\n onLinkClick={handleLinkClick}\n linkRenderer={linkRenderer}\n />\n )}\n {nav.type === NAV_ITEM_TYPE_COLLAPSE && (\n <VerticalCollapsedMenuItem\n key={nav.key}\n currentKey={activedRoute?.key}\n parentKeys={defaulExpandKey}\n nav={nav}\n sideCollapsed={collapsed}\n direction={direction}\n indent={nextCascade >= 2}\n dotIndent={nextCascade >= 2}\n renderAsIcon={nextCascade <= 1}\n userAuthority={userAuthority}\n t={t as TraslationFn}\n onLinkClick={onMenuItemClick}\n >\n {nav.subMenu &&\n nav.subMenu.length > 0 &&\n renderNavigation(nav.subMenu, nextCascade, true)}\n </VerticalCollapsedMenuItem>\n )}\n {nav.type === NAV_ITEM_TYPE_TITLE && (\n <MenuGroup key={nav.key} label={t(nav.translateKey) || nav.title}>\n {nav.subMenu &&\n nav.subMenu.length > 0 &&\n renderNavigation(nav.subMenu, cascade, false)}\n </MenuGroup>\n )}\n </Fragment>\n ))}\n </>\n );\n };\n\n return (\n <Menu\n className=\"px-4 pb-4\"\n sideCollapsed={collapsed}\n defaultActiveKeys={activedRoute?.key ? [activedRoute.key] : []}\n defaultExpandedKeys={defaulExpandKey}\n defaultCollapseActiveKeys={\n activedRoute?.parentKey ? [activedRoute.parentKey] : []\n }\n >\n {renderNavigation(filteredNavigationTree, 0)}\n </Menu>\n );\n};\n\nexport default VerticalMenuContent;\n"],"names":["MenuGroup","Menu","filterNavigationByAuthority","navTree","userAuthority","acc","nav","filteredSubMenu","VerticalMenuContent","props","collapsed","routeKey","navigationTree","onMenuItemClick","direction","themeConfig","translationSetup","linkRenderer","t","useTranslation","defaulExpandKey","setDefaulExpandKey","useState","filteredNavigationTree","activedRoute","useMenuActive","useEffect","handleLinkClick","renderNavigation","cascade","indent","nextCascade","jsxs","Fragment","NAV_ITEM_TYPE_ITEM","jsx","VerticalSingleMenuItem","NAV_ITEM_TYPE_COLLAPSE","VerticalCollapsedMenuItem","NAV_ITEM_TYPE_TITLE"],"mappings":";;;;;;;;;AA4BA,MAAM,EAAE,WAAAA,MAAcC,GAEhBC,IAA8B,CAClCC,GACAC,MAEOD,EAAQ,OAAO,CAACE,GAAuBC,MAAQ;AACpD,MAAIA,EAAI,WAAWA,EAAI,QAAQ,SAAS,GAAG;AACzC,UAAMC,IAAkBL;AAAA,MACtBI,EAAI;AAAA,MACJF;AAAA,IAAA;AAEF,IAAIG,EAAgB,SAAS,KAC3BF,EAAI,KAAK,EAAE,GAAGC,GAAK,SAASC,GAAiB;AAAA,EAEjD;AACE,KAAKD,EAAI,QAAQF,EAAc,SAASE,EAAI,IAAI,KAAM,CAACA,EAAI,SACzDD,EAAI,KAAKC,CAAG;AAGhB,SAAOD;AACT,GAAG,CAAA,CAAE,GAGDG,IAAsB,CAACC,MAAoC;AAC/D,QAAM;AAAA,IACJ,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,gBAAAC,IAAiB,CAAA;AAAA,IACjB,iBAAAC;AAAA,IACA,WAAAC,IAAYC,EAAY;AAAA,IACxB,kBAAAC;AAAA,IACA,eAAAZ;AAAA,IACA,cAAAa;AAAA,EAAA,IACER,GAEE,EAAE,GAAAS,EAAA,IAAMC,EAAe,CAACH,CAAgB,GACxC,CAACI,GAAiBC,CAAkB,IAAIC,EAAmB,CAAA,CAAE,GAC7DC,IAAyBrB;AAAA,IAC7BU;AAAA,IACAR;AAAA,EAAA,GAGI,EAAE,cAAAoB,EAAA,IAAiBC,EAAcF,GAAwBZ,CAAQ;AAEvE,EAAAe,EAAU,MAAM;AACd,IAAIF,
|
|
1
|
+
{"version":3,"file":"VerticalMenuContent.js","sources":["../../../../../lib/@ecme/components/template/VerticalMenuContent/VerticalMenuContent.tsx"],"sourcesContent":["import { useState, useEffect, Fragment } from \"react\";\nimport Menu from \"@/components/ui/Menu\";\nimport VerticalSingleMenuItem from \"./VerticalSingleMenuItem\";\nimport VerticalCollapsedMenuItem from \"./VerticalCollapsedMenuItem\";\nimport { themeConfig } from \"@/configs/theme.config\";\nimport {\n NAV_ITEM_TYPE_TITLE,\n NAV_ITEM_TYPE_COLLAPSE,\n NAV_ITEM_TYPE_ITEM,\n} from \"@/constants/navigation.constant\";\nimport useMenuActive from \"@/utils/hooks/useMenuActive\";\nimport useTranslation from \"@/utils/hooks/useTranslation\";\nimport { Direction } from \"@/@types/theme\";\nimport type { NavigationTree } from \"@/@types/navigation\";\nimport type { TraslationFn } from \"@/@types/common\";\nimport { LinkRenderer } from \"@/components/layouts/Layouts\";\n\nexport interface VerticalMenuContentProps {\n collapsed?: boolean;\n routeKey: string;\n navigationTree?: NavigationTree[];\n onMenuItemClick?: () => void;\n direction?: Direction;\n translationSetup?: boolean;\n userAuthority: string[];\n linkRenderer?: LinkRenderer;\n}\n\nconst { MenuGroup } = Menu;\n\nconst filterNavigationByAuthority = (\n navTree: NavigationTree[],\n userAuthority: string[]\n): NavigationTree[] => {\n return navTree.reduce((acc: NavigationTree[], nav) => {\n if (nav.subMenu && nav.subMenu.length > 0) {\n const filteredSubMenu = filterNavigationByAuthority(\n nav.subMenu,\n userAuthority\n );\n if (filteredSubMenu.length > 0) {\n acc.push({ ...nav, subMenu: filteredSubMenu });\n }\n } else {\n if ((nav.path && userAuthority.includes(nav.path)) || !nav.path) {\n acc.push(nav);\n }\n }\n return acc;\n }, []);\n};\n\nconst VerticalMenuContent = (props: VerticalMenuContentProps) => {\n const {\n collapsed,\n routeKey,\n navigationTree = [],\n onMenuItemClick,\n direction = themeConfig.direction,\n translationSetup,\n userAuthority,\n linkRenderer,\n } = props;\n\n const { t } = useTranslation(!translationSetup);\n const [defaulExpandKey, setDefaulExpandKey] = useState<string[]>([]);\n const filteredNavigationTree = filterNavigationByAuthority(\n navigationTree,\n userAuthority\n );\n\n const { activedRoute } = useMenuActive(filteredNavigationTree, routeKey);\n\n useEffect(() => {\n if (activedRoute?.parentKey) {\n setDefaulExpandKey([activedRoute?.parentKey]);\n }\n }, [activedRoute?.parentKey]);\n\n const handleLinkClick = () => {\n onMenuItemClick?.();\n };\n\n const renderNavigation = (\n navTree: NavigationTree[],\n cascade: number = 0,\n indent?: boolean\n ) => {\n const nextCascade = cascade + 1;\n\n return (\n <>\n {navTree.map((nav) => (\n <Fragment key={nav.key}>\n {nav.type === NAV_ITEM_TYPE_ITEM && (\n <VerticalSingleMenuItem\n key={nav.key}\n currentKey={activedRoute?.key}\n parentKeys={defaulExpandKey}\n nav={nav}\n sideCollapsed={collapsed}\n direction={direction}\n indent={indent}\n renderAsIcon={cascade <= 0}\n showIcon={cascade <= 0}\n userAuthority={userAuthority}\n showTitle={\n nav.forceShowTitle ??\n (collapsed ? cascade >= 1 : cascade <= 1)\n }\n t={t as TraslationFn}\n onLinkClick={handleLinkClick}\n linkRenderer={linkRenderer}\n />\n )}\n {nav.type === NAV_ITEM_TYPE_COLLAPSE && (\n <VerticalCollapsedMenuItem\n key={nav.key}\n currentKey={activedRoute?.key}\n parentKeys={defaulExpandKey}\n nav={nav}\n sideCollapsed={collapsed}\n direction={direction}\n indent={nextCascade >= 2}\n dotIndent={nextCascade >= 2}\n renderAsIcon={nextCascade <= 1}\n userAuthority={userAuthority}\n t={t as TraslationFn}\n onLinkClick={onMenuItemClick}\n >\n {nav.subMenu &&\n nav.subMenu.length > 0 &&\n renderNavigation(nav.subMenu, nextCascade, true)}\n </VerticalCollapsedMenuItem>\n )}\n {nav.type === NAV_ITEM_TYPE_TITLE && (\n <MenuGroup key={nav.key} label={t(nav.translateKey) || nav.title}>\n {nav.subMenu &&\n nav.subMenu.length > 0 &&\n renderNavigation(nav.subMenu, cascade, false)}\n </MenuGroup>\n )}\n </Fragment>\n ))}\n </>\n );\n };\n\n return (\n <Menu\n className=\"px-4 pb-4\"\n sideCollapsed={collapsed}\n defaultActiveKeys={activedRoute?.key ? [activedRoute.key] : []}\n defaultExpandedKeys={defaulExpandKey}\n defaultCollapseActiveKeys={\n activedRoute?.parentKey ? [activedRoute.parentKey] : []\n }\n >\n {renderNavigation(filteredNavigationTree, 0)}\n </Menu>\n );\n};\n\nexport default VerticalMenuContent;\n"],"names":["MenuGroup","Menu","filterNavigationByAuthority","navTree","userAuthority","acc","nav","filteredSubMenu","VerticalMenuContent","props","collapsed","routeKey","navigationTree","onMenuItemClick","direction","themeConfig","translationSetup","linkRenderer","t","useTranslation","defaulExpandKey","setDefaulExpandKey","useState","filteredNavigationTree","activedRoute","useMenuActive","useEffect","handleLinkClick","renderNavigation","cascade","indent","nextCascade","jsxs","Fragment","NAV_ITEM_TYPE_ITEM","jsx","VerticalSingleMenuItem","NAV_ITEM_TYPE_COLLAPSE","VerticalCollapsedMenuItem","NAV_ITEM_TYPE_TITLE"],"mappings":";;;;;;;;;AA4BA,MAAM,EAAE,WAAAA,MAAcC,GAEhBC,IAA8B,CAClCC,GACAC,MAEOD,EAAQ,OAAO,CA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BJ;AAAA,MACrB,2BACEI,GAAc,YAAY,CAACA,EAAa,SAAS,IAAI,CAAA;AAAA,MAGtD,UAAAI,EAAiBL,GAAwB,CAAC;AAAA,IAAA;AAAA,EAAA;AAGjD;"}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as e, jsxs as m, Fragment as k } from "react/jsx-runtime";
|
|
2
2
|
import "../../ui/Tooltip/index.js";
|
|
3
|
-
import { Menu as
|
|
4
|
-
import
|
|
5
|
-
import { Link as
|
|
6
|
-
import { Dropdown as
|
|
3
|
+
import { Menu as f } from "../../ui/Menu/index.js";
|
|
4
|
+
import p from "./VerticalMenuIcon.js";
|
|
5
|
+
import { Link as y } from "react-router-dom";
|
|
6
|
+
import { Dropdown as M } from "../../ui/Dropdown/index.js";
|
|
7
7
|
import I from "../../ui/Tooltip/Tooltip.js";
|
|
8
|
-
const { MenuItem: w } =
|
|
9
|
-
const h = (
|
|
8
|
+
const { MenuItem: w } = f;
|
|
9
|
+
const h = (n) => {
|
|
10
10
|
const {
|
|
11
11
|
nav: t,
|
|
12
|
-
onLinkClick:
|
|
13
|
-
showTitle:
|
|
12
|
+
onLinkClick: i,
|
|
13
|
+
showTitle: r,
|
|
14
14
|
indent: l,
|
|
15
15
|
showIcon: o = !0,
|
|
16
|
-
userAuthority:
|
|
16
|
+
userAuthority: c,
|
|
17
17
|
t: d,
|
|
18
|
-
linkRenderer:
|
|
19
|
-
} =
|
|
20
|
-
o && /* @__PURE__ */
|
|
21
|
-
|
|
22
|
-
] }), u = () =>
|
|
23
|
-
|
|
18
|
+
linkRenderer: s
|
|
19
|
+
} = n, a = /* @__PURE__ */ m(k, { children: [
|
|
20
|
+
o && /* @__PURE__ */ e(p, { icon: t.icon }),
|
|
21
|
+
r && /* @__PURE__ */ e("span", { children: d(t.translateKey, t.title) })
|
|
22
|
+
] }), u = () => s ? s(t, a) : /* @__PURE__ */ e(
|
|
23
|
+
y,
|
|
24
24
|
{
|
|
25
25
|
to: t.path,
|
|
26
26
|
className: "flex h-full w-full items-center gap-2",
|
|
27
27
|
target: t.isExternalLink ? "_blank" : "",
|
|
28
|
-
onClick: () =>
|
|
28
|
+
onClick: () => i?.({
|
|
29
29
|
key: t.key,
|
|
30
30
|
title: t.title,
|
|
31
31
|
path: t.path
|
|
@@ -33,43 +33,43 @@ const h = (r) => {
|
|
|
33
33
|
children: a
|
|
34
34
|
}
|
|
35
35
|
);
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
-
},
|
|
38
|
-
const { sideCollapsed: t, nav:
|
|
39
|
-
return t ? /* @__PURE__ */
|
|
36
|
+
return /* @__PURE__ */ e(w, { eventKey: t.key, dotIndent: l, children: u() }, t.key);
|
|
37
|
+
}, b = (n) => {
|
|
38
|
+
const { sideCollapsed: t, nav: i, t: r, userAuthority: l, onLinkClick: o, linkRenderer: c } = n;
|
|
39
|
+
return t ? /* @__PURE__ */ e(
|
|
40
40
|
I,
|
|
41
41
|
{
|
|
42
|
-
title: i
|
|
43
|
-
placement:
|
|
44
|
-
children: /* @__PURE__ */
|
|
42
|
+
title: r(i.translateKey, i.title),
|
|
43
|
+
placement: n.direction === "rtl" ? "left" : "right",
|
|
44
|
+
children: /* @__PURE__ */ e(
|
|
45
45
|
h,
|
|
46
46
|
{
|
|
47
|
-
nav:
|
|
47
|
+
nav: i,
|
|
48
48
|
onLinkClick: o,
|
|
49
|
-
t:
|
|
49
|
+
t: r,
|
|
50
50
|
userAuthority: l,
|
|
51
|
-
linkRenderer:
|
|
51
|
+
linkRenderer: c,
|
|
52
52
|
showIcon: !0,
|
|
53
53
|
showTitle: !1,
|
|
54
|
-
indent:
|
|
54
|
+
indent: n.indent
|
|
55
55
|
}
|
|
56
56
|
)
|
|
57
57
|
}
|
|
58
|
-
) : /* @__PURE__ */
|
|
58
|
+
) : /* @__PURE__ */ e(
|
|
59
59
|
h,
|
|
60
60
|
{
|
|
61
|
-
nav:
|
|
61
|
+
nav: i,
|
|
62
62
|
onLinkClick: o,
|
|
63
|
-
t:
|
|
63
|
+
t: r,
|
|
64
64
|
userAuthority: l,
|
|
65
|
-
linkRenderer:
|
|
65
|
+
linkRenderer: c,
|
|
66
66
|
showIcon: !0,
|
|
67
67
|
showTitle: !0,
|
|
68
|
-
indent:
|
|
68
|
+
indent: n.indent
|
|
69
69
|
}
|
|
70
70
|
);
|
|
71
71
|
};
|
|
72
72
|
export {
|
|
73
|
-
|
|
73
|
+
b as default
|
|
74
74
|
};
|
|
75
75
|
//# sourceMappingURL=VerticalSingleMenuItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VerticalSingleMenuItem.js","sources":["../../../../../lib/@ecme/components/template/VerticalMenuContent/VerticalSingleMenuItem.tsx"],"sourcesContent":["import Tooltip from \"@/components/ui/Tooltip\";\nimport Menu from \"@/components/ui/Menu\";\nimport AuthorityCheck from \"@/components/shared/AuthorityCheck\";\nimport VerticalMenuIcon from \"./VerticalMenuIcon\";\nimport { Link } from \"react-router-dom\";\nimport Dropdown from \"@/components/ui/Dropdown\";\nimport type { CommonProps } from \"@/@types/common\";\nimport type { Direction } from \"@/@types/theme\";\nimport type { NavigationTree } from \"@/@types/navigation\";\n\nconst { MenuItem } = Menu;\n\ntype LinkRenderer = (\n nav: NavigationTree,\n children: React.ReactNode\n) => React.ReactNode;\n\ninterface CollapsedItemProps extends CommonProps {\n nav: NavigationTree;\n direction?: Direction;\n linkRenderer?: LinkRenderer;\n onLinkClick?: (link: { key: string; title: string; path: string }) => void;\n t: (\n key: string,\n fallback?: string | Record<string, string | number>\n ) => string;\n renderAsIcon?: boolean;\n userAuthority: string[];\n currentKey?: string;\n parentKeys?: string[];\n}\n\ninterface DefaultItemProps {\n nav: NavigationTree;\n onLinkClick?: (link: { key: string; title: string; path: string }) => void;\n sideCollapsed?: boolean;\n t: (\n key: string,\n fallback?: string | Record<string, string | number>\n ) => string;\n indent?: boolean;\n userAuthority: string[];\n showIcon?: boolean;\n showTitle?: boolean;\n linkRenderer?: LinkRenderer;\n}\n\ninterface VerticalMenuItemProps extends CollapsedItemProps, DefaultItemProps {}\n\nconst CollapsedItem = ({\n nav,\n children,\n direction,\n renderAsIcon,\n onLinkClick,\n userAuthority,\n t,\n currentKey,\n linkRenderer,\n}: CollapsedItemProps) => {\n const linkContent = <span>{t(nav.translateKey, nav.title)}</span>;\n\n const renderLink = () => {\n if (linkRenderer) {\n return linkRenderer(nav, linkContent);\n }\n\n return (\n <Link\n id={nav.path}\n className=\"flex h-full w-full items-center outline-none\"\n to={nav.path}\n target={nav.isExternalLink ? \"_blank\" : \"\"}\n onClick={() =>\n onLinkClick?.({\n key: nav.key,\n title: nav.title,\n path: nav.path,\n })\n }\n >\n {linkContent}\n </Link>\n );\n };\n\n return (\n <Dropdown.Item active={currentKey === nav.key}>\n {nav.path ? renderLink() : <span>{t(nav.translateKey, nav.title)}</span>}\n </Dropdown.Item>\n );\n};\n\nconst DefaultItem = (props: DefaultItemProps) => {\n const {\n nav,\n onLinkClick,\n showTitle,\n indent,\n showIcon = true,\n userAuthority,\n t,\n linkRenderer,\n } = props;\n\n const linkContent = (\n <>\n {showIcon && <VerticalMenuIcon icon={nav.icon} />}\n {showTitle && <span>{t(nav.translateKey, nav.title)}</span>}\n </>\n );\n\n const renderLink = () => {\n if (linkRenderer) {\n return linkRenderer(nav, linkContent);\n }\n\n return (\n <Link\n to={nav.path}\n className=\"flex h-full w-full items-center gap-2\"\n target={nav.isExternalLink ? \"_blank\" : \"\"}\n onClick={() =>\n onLinkClick?.({\n key: nav.key,\n title: nav.title,\n path: nav.path,\n })\n }\n >\n {linkContent}\n </Link>\n );\n };\n\n return (\n <MenuItem key={nav.key} eventKey={nav.key} dotIndent={indent}>\n {renderLink()}\n </MenuItem>\n );\n};\nconst VerticalSingleMenuItem = (props: VerticalMenuItemProps) => {\n const { sideCollapsed, nav, t, userAuthority, onLinkClick, linkRenderer } =\n props;\n\n if (sideCollapsed) {\n return (\n <Tooltip\n title={t(nav.translateKey, nav.title)}\n placement={props.direction === \"rtl\" ? \"left\" : \"right\"}\n >\n <DefaultItem\n nav={nav}\n onLinkClick={onLinkClick}\n t={t}\n userAuthority={userAuthority}\n linkRenderer={linkRenderer}\n showIcon={true}\n showTitle={false}\n indent={props.indent}\n />\n </Tooltip>\n );\n }\n\n return (\n <DefaultItem\n nav={nav}\n onLinkClick={onLinkClick}\n t={t}\n userAuthority={userAuthority}\n linkRenderer={linkRenderer}\n showIcon={true}\n showTitle={true}\n indent={props.indent}\n />\n );\n};\nexport default VerticalSingleMenuItem;\n"],"names":["MenuItem","Menu","DefaultItem","props","nav","onLinkClick","showTitle","indent","showIcon","userAuthority","t","linkRenderer","linkContent","jsxs","Fragment","jsx","VerticalMenuIcon","renderLink","Link","VerticalSingleMenuItem","sideCollapsed","Tooltip"],"mappings":";;;;;;;AAUA,MAAM,EAAE,UAAAA,MAAaC;AAmFrB,MAAMC,IAAc,CAACC,MAA4B;AAC/C,QAAM;AAAA,IACJ,KAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,eAAAC;AAAA,IACA,GAAAC;AAAA,IACA,cAAAC;AAAA,EAAA,IACER,GAEES,IACJ,gBAAAC,EAAAC,GAAA,EACG,UAAA;AAAA,IAAAN,KAAY,gBAAAO,EAACC,GAAA,EAAiB,MAAMZ,EAAI,MAAM;AAAA,IAC9CE,uBAAc,QAAA,EAAM,UAAAI,EAAEN,EAAI,cAAcA,EAAI,KAAK,EAAA,CAAE;AAAA,EAAA,GACtD,GAGIa,IAAa,MACbN,IACKA,EAAaP,GAAKQ,CAAW,IAIpC,gBAAAG;AAAA,IAACG;AAAA,IAAA;AAAA,MACC,IAAId,EAAI;AAAA,MACR,WAAU;AAAA,MACV,QAAQA,EAAI,iBAAiB,WAAW;AAAA,MACxC,SAAS,MACPC,
|
|
1
|
+
{"version":3,"file":"VerticalSingleMenuItem.js","sources":["../../../../../lib/@ecme/components/template/VerticalMenuContent/VerticalSingleMenuItem.tsx"],"sourcesContent":["import Tooltip from \"@/components/ui/Tooltip\";\nimport Menu from \"@/components/ui/Menu\";\nimport AuthorityCheck from \"@/components/shared/AuthorityCheck\";\nimport VerticalMenuIcon from \"./VerticalMenuIcon\";\nimport { Link } from \"react-router-dom\";\nimport Dropdown from \"@/components/ui/Dropdown\";\nimport type { CommonProps } from \"@/@types/common\";\nimport type { Direction } from \"@/@types/theme\";\nimport type { NavigationTree } from \"@/@types/navigation\";\n\nconst { MenuItem } = Menu;\n\ntype LinkRenderer = (\n nav: NavigationTree,\n children: React.ReactNode\n) => React.ReactNode;\n\ninterface CollapsedItemProps extends CommonProps {\n nav: NavigationTree;\n direction?: Direction;\n linkRenderer?: LinkRenderer;\n onLinkClick?: (link: { key: string; title: string; path: string }) => void;\n t: (\n key: string,\n fallback?: string | Record<string, string | number>\n ) => string;\n renderAsIcon?: boolean;\n userAuthority: string[];\n currentKey?: string;\n parentKeys?: string[];\n}\n\ninterface DefaultItemProps {\n nav: NavigationTree;\n onLinkClick?: (link: { key: string; title: string; path: string }) => void;\n sideCollapsed?: boolean;\n t: (\n key: string,\n fallback?: string | Record<string, string | number>\n ) => string;\n indent?: boolean;\n userAuthority: string[];\n showIcon?: boolean;\n showTitle?: boolean;\n linkRenderer?: LinkRenderer;\n}\n\ninterface VerticalMenuItemProps extends CollapsedItemProps, DefaultItemProps {}\n\nconst CollapsedItem = ({\n nav,\n children,\n direction,\n renderAsIcon,\n onLinkClick,\n userAuthority,\n t,\n currentKey,\n linkRenderer,\n}: CollapsedItemProps) => {\n const linkContent = <span>{t(nav.translateKey, nav.title)}</span>;\n\n const renderLink = () => {\n if (linkRenderer) {\n return linkRenderer(nav, linkContent);\n }\n\n return (\n <Link\n id={nav.path}\n className=\"flex h-full w-full items-center outline-none\"\n to={nav.path}\n target={nav.isExternalLink ? \"_blank\" : \"\"}\n onClick={() =>\n onLinkClick?.({\n key: nav.key,\n title: nav.title,\n path: nav.path,\n })\n }\n >\n {linkContent}\n </Link>\n );\n };\n\n return (\n <Dropdown.Item active={currentKey === nav.key}>\n {nav.path ? renderLink() : <span>{t(nav.translateKey, nav.title)}</span>}\n </Dropdown.Item>\n );\n};\n\nconst DefaultItem = (props: DefaultItemProps) => {\n const {\n nav,\n onLinkClick,\n showTitle,\n indent,\n showIcon = true,\n userAuthority,\n t,\n linkRenderer,\n } = props;\n\n const linkContent = (\n <>\n {showIcon && <VerticalMenuIcon icon={nav.icon} />}\n {showTitle && <span>{t(nav.translateKey, nav.title)}</span>}\n </>\n );\n\n const renderLink = () => {\n if (linkRenderer) {\n return linkRenderer(nav, linkContent);\n }\n\n return (\n <Link\n to={nav.path}\n className=\"flex h-full w-full items-center gap-2\"\n target={nav.isExternalLink ? \"_blank\" : \"\"}\n onClick={() =>\n onLinkClick?.({\n key: nav.key,\n title: nav.title,\n path: nav.path,\n })\n }\n >\n {linkContent}\n </Link>\n );\n };\n\n return (\n <MenuItem key={nav.key} eventKey={nav.key} dotIndent={indent}>\n {renderLink()}\n </MenuItem>\n );\n};\nconst VerticalSingleMenuItem = (props: VerticalMenuItemProps) => {\n const { sideCollapsed, nav, t, userAuthority, onLinkClick, linkRenderer } =\n props;\n\n if (sideCollapsed) {\n return (\n <Tooltip\n title={t(nav.translateKey, nav.title)}\n placement={props.direction === \"rtl\" ? \"left\" : \"right\"}\n >\n <DefaultItem\n nav={nav}\n onLinkClick={onLinkClick}\n t={t}\n userAuthority={userAuthority}\n linkRenderer={linkRenderer}\n showIcon={true}\n showTitle={false}\n indent={props.indent}\n />\n </Tooltip>\n );\n }\n\n return (\n <DefaultItem\n nav={nav}\n onLinkClick={onLinkClick}\n t={t}\n userAuthority={userAuthority}\n linkRenderer={linkRenderer}\n showIcon={true}\n showTitle={true}\n indent={props.indent}\n />\n );\n};\nexport default VerticalSingleMenuItem;\n"],"names":["MenuItem","Menu","DefaultItem","props","nav","onLinkClick","showTitle","indent","showIcon","userAuthority","t","linkRenderer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I,KAAK;AAAA,MACpC,WAAWD,EAAM,cAAc,QAAQ,SAAS;AAAA,MAEhD,UAAA,gBAAAY;AAAA,QAACb;AAAA,QAAA;AAAA,UACC,KAAAE;AAAA,UACA,aAAAC;AAAA,UACA,GAAAK;AAAA,UACA,eAAAD;AAAA,UACA,cAAAE;AAAA,UACA,UAAU;AAAA,UACV,WAAW;AAAA,UACX,QAAQR,EAAM;AAAA,QAAA;AAAA,MAAA;AAAA,IAChB;AAAA,EAAA,IAMJ,gBAAAY;AAAA,IAACb;AAAA,IAAA;AAAA,MACC,KAAAE;AAAA,MACA,aAAAC;AAAA,MACA,GAAAK;AAAA,MACA,eAAAD;AAAA,MACA,cAAAE;AAAA,MACA,UAAU;AAAA,MACV,WAAW;AAAA,MACX,QAAQR,EAAM;AAAA,IAAA;AAAA,EAAA;AAGpB;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
1
|
+
import { jsx as t, jsxs as s } from "react/jsx-runtime";
|
|
2
2
|
import { useState as A } from "react";
|
|
3
|
-
import
|
|
3
|
+
import l from "../utils/classNames.js";
|
|
4
4
|
import E from "../hooks/useTimeout.js";
|
|
5
5
|
import { HiXCircle as H, HiExclamation as I, HiInformationCircle as P, HiCheckCircle as Y } from "react-icons/hi";
|
|
6
6
|
import { motion as j } from "framer-motion";
|
|
@@ -42,29 +42,29 @@ const g = "warning", B = {
|
|
|
42
42
|
"danger",
|
|
43
43
|
"info",
|
|
44
44
|
"warning"
|
|
45
|
-
], O = (
|
|
45
|
+
], O = (c) => {
|
|
46
46
|
const {
|
|
47
|
-
children:
|
|
47
|
+
children: n,
|
|
48
48
|
className: x,
|
|
49
|
-
closable:
|
|
49
|
+
closable: i = !1,
|
|
50
50
|
customClose: p,
|
|
51
51
|
customIcon: b,
|
|
52
|
-
duration:
|
|
52
|
+
duration: a = 3e3,
|
|
53
53
|
title: o = null,
|
|
54
|
-
onClose:
|
|
54
|
+
onClose: u,
|
|
55
55
|
ref: h,
|
|
56
56
|
showIcon: y = !1,
|
|
57
57
|
triggerByToast: m = !1,
|
|
58
58
|
...w
|
|
59
|
-
} =
|
|
60
|
-
const { type: e = g } =
|
|
59
|
+
} = c, d = (() => {
|
|
60
|
+
const { type: e = g } = c;
|
|
61
61
|
return M.includes(e) ? e : g;
|
|
62
|
-
})(),
|
|
63
|
-
r,
|
|
62
|
+
})(), r = B[d], [C, f] = A("show"), { clear: T } = E(
|
|
64
63
|
u,
|
|
65
|
-
|
|
64
|
+
a,
|
|
65
|
+
a > 0
|
|
66
66
|
), k = (e) => {
|
|
67
|
-
f("hiding"),
|
|
67
|
+
f("hiding"), u?.(e), T(), m || setTimeout(() => {
|
|
68
68
|
f("hide");
|
|
69
69
|
}, 400);
|
|
70
70
|
}, N = () => /* @__PURE__ */ t(
|
|
@@ -81,17 +81,17 @@ const g = "warning", B = {
|
|
|
81
81
|
}
|
|
82
82
|
)
|
|
83
83
|
}
|
|
84
|
-
), v =
|
|
84
|
+
), v = l(
|
|
85
85
|
"alert",
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
r.backgroundColor,
|
|
87
|
+
r.textColor,
|
|
88
88
|
o ? "" : "font-semibold",
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
i ? "justify-between" : "",
|
|
90
|
+
i && !o ? "items-center" : "",
|
|
91
91
|
!m && "rounded-xl",
|
|
92
92
|
x
|
|
93
93
|
);
|
|
94
|
-
return C === "hide" ? null : /* @__PURE__ */
|
|
94
|
+
return C === "hide" ? null : /* @__PURE__ */ s(
|
|
95
95
|
j.div,
|
|
96
96
|
{
|
|
97
97
|
ref: h,
|
|
@@ -109,40 +109,40 @@ const g = "warning", B = {
|
|
|
109
109
|
},
|
|
110
110
|
...w,
|
|
111
111
|
children: [
|
|
112
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ s(
|
|
113
113
|
"div",
|
|
114
114
|
{
|
|
115
|
-
className:
|
|
115
|
+
className: l(
|
|
116
116
|
"flex gap-2",
|
|
117
|
-
!o &&
|
|
118
|
-
o &&
|
|
117
|
+
!o && n ? "items-center" : "",
|
|
118
|
+
o && n ? "mt-0.5" : ""
|
|
119
119
|
),
|
|
120
120
|
children: [
|
|
121
121
|
y && /* @__PURE__ */ t(
|
|
122
122
|
_,
|
|
123
123
|
{
|
|
124
|
-
iconColor:
|
|
124
|
+
iconColor: r.iconColor,
|
|
125
125
|
custom: b,
|
|
126
126
|
type: d
|
|
127
127
|
}
|
|
128
128
|
),
|
|
129
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ s("div", { children: [
|
|
130
130
|
o ? /* @__PURE__ */ t(
|
|
131
131
|
"div",
|
|
132
132
|
{
|
|
133
|
-
className:
|
|
133
|
+
className: l(
|
|
134
134
|
"font-semibold text-lg mb-1",
|
|
135
|
-
|
|
135
|
+
r.titleColor
|
|
136
136
|
),
|
|
137
137
|
children: o
|
|
138
138
|
}
|
|
139
139
|
) : null,
|
|
140
|
-
|
|
140
|
+
n
|
|
141
141
|
] })
|
|
142
142
|
]
|
|
143
143
|
}
|
|
144
144
|
),
|
|
145
|
-
|
|
145
|
+
i ? N() : null
|
|
146
146
|
]
|
|
147
147
|
}
|
|
148
148
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.js","sources":["../../../../../lib/@ecme/components/ui/Alert/Alert.tsx"],"sourcesContent":["import { useState } from 'react'\nimport classNames from '../utils/classNames'\nimport useTimeout from '../hooks/useTimeout'\nimport {\n HiCheckCircle,\n HiInformationCircle,\n HiExclamation,\n HiXCircle,\n} from 'react-icons/hi'\nimport { motion } from 'framer-motion'\nimport CloseButton from '../CloseButton'\nimport StatusIcon from '../StatusIcon'\nimport type { TypeAttributes, CommonProps } from '../@types/common'\nimport type { ReactNode, MouseEvent, Ref } from 'react'\n\nexport interface AlertProps extends CommonProps {\n closable?: boolean\n customClose?: ReactNode | string\n customIcon?: ReactNode | string\n duration?: number\n title?: ReactNode | string\n onClose?: (e?: MouseEvent<HTMLDivElement>) => void\n showIcon?: boolean\n triggerByToast?: boolean\n type?: TypeAttributes.Status\n ref?: Ref<HTMLDivElement>\n}\n\nconst DEFAULT_TYPE = 'warning'\n\nconst TYPE_MAP = {\n success: {\n backgroundColor: 'bg-success-subtle',\n titleColor: 'text-success',\n textColor: 'text-success',\n iconColor: 'text-success',\n icon: <HiCheckCircle />,\n },\n info: {\n backgroundColor: 'bg-info-subtle',\n titleColor: 'text-info',\n textColor: 'text-info',\n iconColor: 'text-info',\n icon: <HiInformationCircle />,\n },\n warning: {\n backgroundColor: 'bg-warning-subtle',\n titleColor: 'text-warning',\n textColor: 'text-warning',\n iconColor: 'text-warning',\n icon: <HiExclamation />,\n },\n danger: {\n backgroundColor: 'bg-error-subtle',\n titleColor: 'text-error',\n textColor: 'text-error',\n iconColor: 'text-error',\n icon: <HiXCircle />,\n },\n}\n\nconst TYPE_ARRAY: TypeAttributes.Status[] = [\n 'success',\n 'danger',\n 'info',\n 'warning',\n]\n\nconst Alert = (props: AlertProps) => {\n const {\n children,\n className,\n closable = false,\n customClose,\n customIcon,\n duration = 3000,\n title = null,\n onClose,\n ref,\n showIcon = false,\n triggerByToast = false,\n ...rest\n } = props\n\n const getType = () => {\n const { type = DEFAULT_TYPE } = props\n if (TYPE_ARRAY.includes(type)) {\n return type\n }\n return DEFAULT_TYPE\n }\n\n const type = getType()\n const typeMap = TYPE_MAP[type]\n\n const [display, setDisplay] = useState('show')\n\n const { clear } = useTimeout(\n onClose as () => void,\n duration,\n (duration as number) > 0,\n )\n\n const handleClose = (e: MouseEvent<HTMLDivElement>) => {\n setDisplay('hiding')\n onClose?.(e)\n clear()\n if (!triggerByToast) {\n setTimeout(() => {\n setDisplay('hide')\n }, 400)\n }\n }\n\n const renderClose = () => {\n return (\n <div\n className=\"cursor-pointer\"\n role=\"presentation\"\n onClick={(e) => handleClose(e)}\n >\n {customClose || (\n <CloseButton\n resetDefaultClass\n className=\"text-lg outline-none\"\n />\n )}\n </div>\n )\n }\n\n const alertClass = classNames(\n 'alert',\n typeMap.backgroundColor,\n typeMap.textColor,\n !title ? 'font-semibold' : '',\n closable ? 'justify-between' : '',\n closable && !title ? 'items-center' : '',\n !triggerByToast && 'rounded-xl',\n\n className,\n )\n\n if (display === 'hide') {\n return null\n }\n\n return (\n <motion.div\n ref={ref}\n className={alertClass}\n initial={{ opacity: 1 }}\n animate={display === 'hiding' ? 'exit' : 'animate'}\n transition={{ duration: 0.25, type: 'tween' }}\n variants={{\n animate: {\n opacity: 1,\n },\n exit: {\n opacity: 0,\n },\n }}\n {...rest}\n >\n <div\n className={classNames(\n 'flex gap-2',\n !title && children ? 'items-center' : '',\n title && children ? 'mt-0.5' : '',\n )}\n >\n {showIcon && (\n <StatusIcon\n iconColor={typeMap.iconColor}\n custom={customIcon}\n type={type}\n />\n )}\n <div>\n {title ? (\n <div\n className={classNames(\n 'font-semibold text-lg mb-1',\n typeMap.titleColor,\n )}\n >\n {title}\n </div>\n ) : null}\n {children}\n </div>\n </div>\n {closable ? renderClose() : null}\n </motion.div>\n )\n}\n\nexport default Alert\n"],"names":["DEFAULT_TYPE","TYPE_MAP","HiCheckCircle","HiInformationCircle","HiExclamation","HiXCircle","TYPE_ARRAY","Alert","props","children","className","closable","customClose","customIcon","duration","title","onClose","ref","showIcon","triggerByToast","rest","type","typeMap","display","setDisplay","useState","clear","useTimeout","handleClose","renderClose","jsx","CloseButton","alertClass","classNames","jsxs","motion","StatusIcon"],"mappings":";;;;;;;;;;AA4BA,MAAMA,IAAe,WAEfC,IAAW;AAAA,EACb,SAAS;AAAA,IACL,iBAAiB;AAAA,IACjB,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,WAAW;AAAA,IACX,wBAAOC,GAAA,CAAA,CAAc;AAAA,EAAA;AAAA,EAEzB,MAAM;AAAA,IACF,iBAAiB;AAAA,IACjB,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,WAAW;AAAA,IACX,wBAAOC,GAAA,CAAA,CAAoB;AAAA,EAAA;AAAA,EAE/B,SAAS;AAAA,IACL,iBAAiB;AAAA,IACjB,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,WAAW;AAAA,IACX,wBAAOC,GAAA,CAAA,CAAc;AAAA,EAAA;AAAA,EAEzB,QAAQ;AAAA,IACJ,iBAAiB;AAAA,IACjB,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,WAAW;AAAA,IACX,wBAAOC,GAAA,CAAA,CAAU;AAAA,EAAA;AAEzB,GAEMC,IAAsC;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,GAEMC,IAAQ,CAACC,MAAsB;AACjC,QAAM;AAAA,IACF,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,OAAAC,IAAQ;AAAA,IACR,SAAAC;AAAA,IACA,KAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,gBAAAC,IAAiB;AAAA,IACjB,GAAGC;AAAA,EAAA,IACHZ,GAUEa,KARU,MAAM;AAClB,UAAM,EAAE,MAAAA,IAAOrB,EAAA,IAAiBQ;AAChC,WAAIF,EAAW,SAASe,CAAI,IACjBA,IAEJrB;AAAA,EACX,GAEa,GACPsB,IAAUrB,EAASoB,CAAI,GAEvB,CAACE,GAASC,CAAU,IAAIC,EAAS,MAAM,GAEvC,EAAE,OAAAC,MAAUC;AAAA,IACdX;AAAA,IACAF;AAAA,IACCA,IAAsB;AAAA,EAAA,GAGrBc,IAAc,CAAC,MAAkC;AACnD,IAAAJ,EAAW,QAAQ,GACnBR,
|
|
1
|
+
{"version":3,"file":"Alert.js","sources":["../../../../../lib/@ecme/components/ui/Alert/Alert.tsx"],"sourcesContent":["import { useState } from 'react'\nimport classNames from '../utils/classNames'\nimport useTimeout from '../hooks/useTimeout'\nimport {\n HiCheckCircle,\n HiInformationCircle,\n HiExclamation,\n HiXCircle,\n} from 'react-icons/hi'\nimport { motion } from 'framer-motion'\nimport CloseButton from '../CloseButton'\nimport StatusIcon from '../StatusIcon'\nimport type { TypeAttributes, CommonProps } from '../@types/common'\nimport type { ReactNode, MouseEvent, Ref } from 'react'\n\nexport interface AlertProps extends CommonProps {\n closable?: boolean\n customClose?: ReactNode | string\n customIcon?: ReactNode | string\n duration?: number\n title?: ReactNode | string\n onClose?: (e?: MouseEvent<HTMLDivElement>) => void\n showIcon?: boolean\n triggerByToast?: boolean\n type?: TypeAttributes.Status\n ref?: Ref<HTMLDivElement>\n}\n\nconst DEFAULT_TYPE = 'warning'\n\nconst TYPE_MAP = {\n success: {\n backgroundColor: 'bg-success-subtle',\n titleColor: 'text-success',\n textColor: 'text-success',\n iconColor: 'text-success',\n icon: <HiCheckCircle />,\n },\n info: {\n backgroundColor: 'bg-info-subtle',\n titleColor: 'text-info',\n textColor: 'text-info',\n iconColor: 'text-info',\n icon: <HiInformationCircle />,\n },\n warning: {\n backgroundColor: 'bg-warning-subtle',\n titleColor: 'text-warning',\n textColor: 'text-warning',\n iconColor: 'text-warning',\n icon: <HiExclamation />,\n },\n danger: {\n backgroundColor: 'bg-error-subtle',\n titleColor: 'text-error',\n textColor: 'text-error',\n iconColor: 'text-error',\n icon: <HiXCircle />,\n },\n}\n\nconst TYPE_ARRAY: TypeAttributes.Status[] = [\n 'success',\n 'danger',\n 'info',\n 'warning',\n]\n\nconst Alert = (props: AlertProps) => {\n const {\n children,\n className,\n closable = false,\n customClose,\n customIcon,\n duration = 3000,\n title = null,\n onClose,\n ref,\n showIcon = false,\n triggerByToast = false,\n ...rest\n } = props\n\n const getType = () => {\n const { type = DEFAULT_TYPE } = props\n if (TYPE_ARRAY.includes(type)) {\n return type\n }\n return DEFAULT_TYPE\n }\n\n const type = getType()\n const typeMap = TYPE_MAP[type]\n\n const [display, setDisplay] = useState('show')\n\n const { clear } = useTimeout(\n onClose as () => void,\n duration,\n (duration as number) > 0,\n )\n\n const handleClose = (e: MouseEvent<HTMLDivElement>) => {\n setDisplay('hiding')\n onClose?.(e)\n clear()\n if (!triggerByToast) {\n setTimeout(() => {\n setDisplay('hide')\n }, 400)\n }\n }\n\n const renderClose = () => {\n return (\n <div\n className=\"cursor-pointer\"\n role=\"presentation\"\n onClick={(e) => handleClose(e)}\n >\n {customClose || (\n <CloseButton\n resetDefaultClass\n className=\"text-lg outline-none\"\n />\n )}\n </div>\n )\n }\n\n const alertClass = classNames(\n 'alert',\n typeMap.backgroundColor,\n typeMap.textColor,\n !title ? 'font-semibold' : '',\n closable ? 'justify-between' : '',\n closable && !title ? 'items-center' : '',\n !triggerByToast && 'rounded-xl',\n\n className,\n )\n\n if (display === 'hide') {\n return null\n }\n\n return (\n <motion.div\n ref={ref}\n className={alertClass}\n initial={{ opacity: 1 }}\n animate={display === 'hiding' ? 'exit' : 'animate'}\n transition={{ duration: 0.25, type: 'tween' }}\n variants={{\n animate: {\n opacity: 1,\n },\n exit: {\n opacity: 0,\n },\n }}\n {...rest}\n >\n <div\n className={classNames(\n 'flex gap-2',\n !title && children ? 'items-center' : '',\n title && children ? 'mt-0.5' : '',\n )}\n >\n {showIcon && (\n <StatusIcon\n iconColor={typeMap.iconColor}\n custom={customIcon}\n type={type}\n />\n )}\n <div>\n {title ? (\n <div\n className={classNames(\n 'font-semibold text-lg mb-1',\n typeMap.titleColor,\n )}\n >\n {title}\n </div>\n ) : null}\n {children}\n </div>\n </div>\n {closable ? renderClose() : null}\n </motion.div>\n )\n}\n\nexport default Alert\n"],"names":["DEFAULT_TYPE","TYPE_MAP","HiCheckCircle","HiInformationCircle","HiExclamation","HiXCircle","TYPE_ARRAY","Alert","props","children","className","closable","customClose","customIcon","duration","title","onClose","ref","showIcon","triggerByToast","rest","type","typeMap","display","setDisplay","useState","clear","useTimeout","handleClose","renderClose","jsx","CloseButton","alertClass","classNames","jsxs","motion","StatusIcon"],"mappings":";;;;;;;;;;AA4BA,MAAMA,IAAe,WAEfC,IAAW;AAAA,EACb,SAAS;AAAA,IAC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