@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaymentDialog.js","sources":["../../../../../../../lib/@ecme/views/concepts/accounts/Pricing/components/PaymentDialog.tsx"],"sourcesContent":["import { useState } from 'react'\nimport Button from '@/components/ui/Button'\nimport Dialog from '@/components/ui/Dialog'\nimport Segment from '@/components/ui/Segment'\nimport classNames from '@/utils/classNames'\nimport sleep from '@/utils/sleep'\nimport { usePricingStore } from '../store/pricingStore'\nimport { TbCheck, TbCreditCard, TbMail } from 'react-icons/tb'\nimport {\n NumericFormat,\n PatternFormat,\n NumberFormatBase,\n} from 'react-number-format'\nimport { useNavigate } from 'react-router-dom'\nimport { PaymentCycle } from '../types'\n\nfunction limit(val: string, max: string) {\n if (val.length === 1 && val[0] > max[0]) {\n val = '0' + val\n }\n\n if (val.length === 2) {\n if (Number(val) === 0) {\n val = '01'\n } else if (val > max) {\n val = max\n }\n }\n\n return val\n}\n\nfunction cardExpiryFormat(val: string) {\n const month = limit(val.substring(0, 2), '12')\n const date = limit(val.substring(2, 4), '31')\n\n return month + (date.length ? '/' + date : '')\n}\n\nconst PaymentDialog = () => {\n const [loading, setLoading] = useState(false)\n const [paymentSuccessful, setPaymentSuccessful] = useState(false)\n\n const navigate = useNavigate()\n\n const { paymentDialog, setPaymentDialog, selectedPlan, setSelectedPlan } =\n usePricingStore()\n\n const handleDialogClose = async () => {\n setPaymentDialog(false)\n await sleep(200)\n setSelectedPlan({})\n setPaymentSuccessful(false)\n }\n\n const handlePaymentChange = (paymentCycle: PaymentCycle) => {\n setSelectedPlan({\n ...selectedPlan,\n paymentCycle,\n })\n }\n\n const handlePay = async () => {\n setLoading(true)\n await sleep(500)\n setLoading(false)\n setPaymentSuccessful(true)\n }\n\n const handleManageSubscription = async () => {\n navigate('/concepts/account/settings?view=billing')\n await handleDialogClose()\n }\n\n return (\n <Dialog\n isOpen={paymentDialog}\n closable={!paymentSuccessful}\n onClose={handleDialogClose}\n onRequestClose={handleDialogClose}\n >\n {paymentSuccessful ? (\n <>\n <div className=\"text-center mt-6 mb-2\">\n <div className=\"inline-flex rounded-full p-5 bg-success\">\n <TbCheck className=\"text-5xl text-white\" />\n </div>\n <div className=\"mt-6\">\n <h4>Thank you for your purchase!</h4>\n <p className=\"text-base max-w-[400px] mx-auto mt-4 leading-relaxed\">\n We've received your order and are\n processing it now. You'll get an email with\n your order details soon\n </p>\n </div>\n <div className=\"grid grid-cols-2 gap-2 mt-8\">\n <Button block onClick={handleManageSubscription}>\n Manage subscription\n </Button>\n <Button\n block\n variant=\"solid\"\n onClick={handleDialogClose}\n >\n Close\n </Button>\n </div>\n </div>\n </>\n ) : (\n <>\n <h4>{selectedPlan.planName} plan</h4>\n <div className=\"mt-6\">\n <Segment\n defaultValue={selectedPlan.paymentCycle}\n className=\"gap-4 flex bg-transparent\"\n onChange={(value) =>\n handlePaymentChange(value as PaymentCycle)\n }\n >\n {Object.entries(selectedPlan.price || {}).map(\n ([key, value]) => (\n <Segment.Item key={key} value={key}>\n {({ active, onSegmentItemClick }) => {\n return (\n <div\n className={classNames(\n 'flex justify-between border rounded-xl border-gray-300 py-5 px-4 select-none ring-1 w-1/2',\n active\n ? 'ring-primary border-primary '\n : 'ring-transparent bg-gray-100',\n )}\n role=\"button\"\n onClick={onSegmentItemClick}\n >\n <div>\n <div className=\"heading-text mb-0.5\">\n Pay{' '}\n {key === 'monthly'\n ? 'monthly'\n : 'anually'}\n </div>\n <span className=\"text-lg font-bold heading-text flex gap-0.5\">\n <NumericFormat\n displayType=\"text\"\n value={value}\n prefix={'$'}\n thousandSeparator={\n true\n }\n />\n <span>{'/'}</span>\n <span>\n {key ===\n 'monthly'\n ? 'month'\n : 'year'}\n </span>\n </span>\n </div>\n {active && (\n <TbCheck className=\"text-primary text-xl\" />\n )}\n </div>\n )\n }}\n </Segment.Item>\n ),\n )}\n </Segment>\n </div>\n <div className=\"mt-6 border border-gray-200 dark:border-gray-600 rounded-lg\">\n <div className=\"flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-600\">\n <div className=\"w-full\">\n <span>Billing email</span>\n <div className=\"flex items-center gap-2 mt-2\">\n <TbMail className=\"text-2xl\" />\n <input\n className=\"focus:outline-none heading-text flex-1\"\n placeholder=\"Enter email\"\n type=\"email\"\n />\n </div>\n </div>\n </div>\n <div className=\"flex items-center justify-between p-4\">\n <div className=\"w-full\">\n <span>Credit card</span>\n <div className=\"flex items-center gap-2 mt-2\">\n <div className=\"flex-1\">\n <TbCreditCard className=\"text-2xl\" />\n </div>\n <PatternFormat\n className=\"focus:outline-none heading-text w-full\"\n placeholder=\"Credit card number\"\n format=\"#### #### #### ####\"\n />\n <NumberFormatBase\n className=\"focus:outline-none heading-text max-w-12 sm:max-w-28\"\n placeholder=\"MM/YY\"\n format={cardExpiryFormat}\n />\n <PatternFormat\n className=\"focus:outline-none heading-text max-w-12 sm:max-w-28\"\n placeholder=\"CVC\"\n format=\"###\"\n />\n </div>\n </div>\n </div>\n </div>\n <div className=\"mt-6 flex flex-col items-end\">\n <h4>\n <span>Bill now: </span>\n <span>\n <NumericFormat\n displayType=\"text\"\n value={\n selectedPlan.price?.[\n selectedPlan.paymentCycle as PaymentCycle\n ]\n }\n prefix={'$'}\n thousandSeparator={true}\n />\n </span>\n </h4>\n <div className=\"max-w-[350px] ltr:text-right rtl:text-left leading-none mt-2 opacity-80\">\n <small>\n By clicking "Pay", you agree to be\n charged $399 every month, you can cancel this\n subscription any time.\n </small>\n </div>\n </div>\n <div className=\"mt-6\">\n <Button\n block\n variant=\"solid\"\n loading={loading}\n onClick={handlePay}\n >\n Pay\n </Button>\n </div>\n </>\n )}\n </Dialog>\n )\n}\n\nexport default PaymentDialog\n"],"names":["limit","val","max","cardExpiryFormat","month","date","PaymentDialog","loading","setLoading","useState","paymentSuccessful","setPaymentSuccessful","navigate","useNavigate","paymentDialog","setPaymentDialog","selectedPlan","setSelectedPlan","usePricingStore","handleDialogClose","sleep","handlePaymentChange","paymentCycle","handlePay","jsx","Dialog","Fragment","jsxs","TbCheck","Button","Segment","value","key","active","onSegmentItemClick","classNames","NumericFormat","TbMail","TbCreditCard","PatternFormat","NumberFormatBase","_a"],"mappings":";;;;;;;;;;;;;AAgBA,SAASA,EAAMC,GAAaC,GAAa;AACrC,SAAID,EAAI,WAAW,KAAKA,EAAI,CAAC,IAAIC,EAAI,CAAC,MAClCD,IAAM,MAAMA,IAGZA,EAAI,WAAW,MACX,OAAOA,CAAG,MAAM,IAChBA,IAAM,OACCA,IAAMC,MACbD,IAAMC,KAIPD;AACX;AAEA,SAASE,EAAiBF,GAAa;AACnC,QAAMG,IAAQJ,EAAMC,EAAI,UAAU,GAAG,CAAC,GAAG,IAAI,GACvCI,IAAOL,EAAMC,EAAI,UAAU,GAAG,CAAC,GAAG,IAAI;AAE5C,SAAOG,KAASC,EAAK,SAAS,MAAMA,IAAO;AAC/C;AAEA,MAAMC,IAAg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../../../../../../../lib/@ecme/views/concepts/accounts/Pricing/components/PaymentDialog.tsx"],"sourcesContent":["import { useState } from 'react'\nimport Button from '@/components/ui/Button'\nimport Dialog from '@/components/ui/Dialog'\nimport Segment from '@/components/ui/Segment'\nimport classNames from '@/utils/classNames'\nimport sleep from '@/utils/sleep'\nimport { usePricingStore } from '../store/pricingStore'\nimport { TbCheck, TbCreditCard, TbMail } from 'react-icons/tb'\nimport {\n NumericFormat,\n PatternFormat,\n NumberFormatBase,\n} from 'react-number-format'\nimport { useNavigate } from 'react-router-dom'\nimport { PaymentCycle } from '../types'\n\nfunction limit(val: string, max: string) {\n if (val.length === 1 && val[0] > max[0]) {\n val = '0' + val\n }\n\n if (val.length === 2) {\n if (Number(val) === 0) {\n val = '01'\n } else if (val > max) {\n val = max\n }\n }\n\n return val\n}\n\nfunction cardExpiryFormat(val: string) {\n const month = limit(val.substring(0, 2), '12')\n const date = limit(val.substring(2, 4), '31')\n\n return month + (date.length ? '/' + date : '')\n}\n\nconst PaymentDialog = () => {\n const [loading, setLoading] = useState(false)\n const [paymentSuccessful, setPaymentSuccessful] = useState(false)\n\n const navigate = useNavigate()\n\n const { paymentDialog, setPaymentDialog, selectedPlan, setSelectedPlan } =\n usePricingStore()\n\n const handleDialogClose = async () => {\n setPaymentDialog(false)\n await sleep(200)\n setSelectedPlan({})\n setPaymentSuccessful(false)\n }\n\n const handlePaymentChange = (paymentCycle: PaymentCycle) => {\n setSelectedPlan({\n ...selectedPlan,\n paymentCycle,\n })\n }\n\n const handlePay = async () => {\n setLoading(true)\n await sleep(500)\n setLoading(false)\n setPaymentSuccessful(true)\n }\n\n const handleManageSubscription = async () => {\n navigate('/concepts/account/settings?view=billing')\n await handleDialogClose()\n }\n\n return (\n <Dialog\n isOpen={paymentDialog}\n closable={!paymentSuccessful}\n onClose={handleDialogClose}\n onRequestClose={handleDialogClose}\n >\n {paymentSuccessful ? (\n <>\n <div className=\"text-center mt-6 mb-2\">\n <div className=\"inline-flex rounded-full p-5 bg-success\">\n <TbCheck className=\"text-5xl text-white\" />\n </div>\n <div className=\"mt-6\">\n <h4>Thank you for your purchase!</h4>\n <p className=\"text-base max-w-[400px] mx-auto mt-4 leading-relaxed\">\n We've received your order and are\n processing it now. You'll get an email with\n your order details soon\n </p>\n </div>\n <div className=\"grid grid-cols-2 gap-2 mt-8\">\n <Button block onClick={handleManageSubscription}>\n Manage subscription\n </Button>\n <Button\n block\n variant=\"solid\"\n onClick={handleDialogClose}\n >\n Close\n </Button>\n </div>\n </div>\n </>\n ) : (\n <>\n <h4>{selectedPlan.planName} plan</h4>\n <div className=\"mt-6\">\n <Segment\n defaultValue={selectedPlan.paymentCycle}\n className=\"gap-4 flex bg-transparent\"\n onChange={(value) =>\n handlePaymentChange(value as PaymentCycle)\n }\n >\n {Object.entries(selectedPlan.price || {}).map(\n ([key, value]) => (\n <Segment.Item key={key} value={key}>\n {({ active, onSegmentItemClick }) => {\n return (\n <div\n className={classNames(\n 'flex justify-between border rounded-xl border-gray-300 py-5 px-4 select-none ring-1 w-1/2',\n active\n ? 'ring-primary border-primary '\n : 'ring-transparent bg-gray-100',\n )}\n role=\"button\"\n onClick={onSegmentItemClick}\n >\n <div>\n <div className=\"heading-text mb-0.5\">\n Pay{' '}\n {key === 'monthly'\n ? 'monthly'\n : 'anually'}\n </div>\n <span className=\"text-lg font-bold heading-text flex gap-0.5\">\n <NumericFormat\n displayType=\"text\"\n value={value}\n prefix={'$'}\n thousandSeparator={\n true\n }\n />\n <span>{'/'}</span>\n <span>\n {key ===\n 'monthly'\n ? 'month'\n : 'year'}\n </span>\n </span>\n </div>\n {active && (\n <TbCheck className=\"text-primary text-xl\" />\n )}\n </div>\n )\n }}\n </Segment.Item>\n ),\n )}\n </Segment>\n </div>\n <div className=\"mt-6 border border-gray-200 dark:border-gray-600 rounded-lg\">\n <div className=\"flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-600\">\n <div className=\"w-full\">\n <span>Billing email</span>\n <div className=\"flex items-center gap-2 mt-2\">\n <TbMail className=\"text-2xl\" />\n <input\n className=\"focus:outline-none heading-text flex-1\"\n placeholder=\"Enter email\"\n type=\"email\"\n />\n </div>\n </div>\n </div>\n <div className=\"flex items-center justify-between p-4\">\n <div className=\"w-full\">\n <span>Credit card</span>\n <div className=\"flex items-center gap-2 mt-2\">\n <div className=\"flex-1\">\n <TbCreditCard className=\"text-2xl\" />\n </div>\n <PatternFormat\n className=\"focus:outline-none heading-text w-full\"\n placeholder=\"Credit card number\"\n format=\"#### #### #### ####\"\n />\n <NumberFormatBase\n className=\"focus:outline-none heading-text max-w-12 sm:max-w-28\"\n placeholder=\"MM/YY\"\n format={cardExpiryFormat}\n />\n <PatternFormat\n className=\"focus:outline-none heading-text max-w-12 sm:max-w-28\"\n placeholder=\"CVC\"\n format=\"###\"\n />\n </div>\n </div>\n </div>\n </div>\n <div className=\"mt-6 flex flex-col items-end\">\n <h4>\n <span>Bill now: </span>\n <span>\n <NumericFormat\n displayType=\"text\"\n value={\n selectedPlan.price?.[\n selectedPlan.paymentCycle as PaymentCycle\n ]\n }\n prefix={'$'}\n thousandSeparator={true}\n />\n </span>\n </h4>\n <div className=\"max-w-[350px] ltr:text-right rtl:text-left leading-none mt-2 opacity-80\">\n <small>\n By clicking "Pay", you agree to be\n charged $399 every month, you can cancel this\n subscription any time.\n </small>\n </div>\n </div>\n <div className=\"mt-6\">\n <Button\n block\n variant=\"solid\"\n loading={loading}\n onClick={handlePay}\n >\n Pay\n </Button>\n </div>\n </>\n )}\n </Dialog>\n )\n}\n\nexport default PaymentDialog\n"],"names":["limit","val","max","cardExpiryFormat","month","date","PaymentDialog","loading","setLoading","useState","paymentSuccessful","setPaymentSuccessful","navigate","useNavigate","paymentDialog","setPaymentDialog","selectedPlan","setSelectedPlan","usePricingStore","handleDialogClose","sleep","handlePaymentChange","paymentCycle","handlePay","jsx","Dialog","Fragment","jsxs","TbCheck","Button","Segment","value","key","active","onSegmentItemClick","classNames","NumericFormat","TbMail","TbCreditCard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,YAAA,EACvB,CACJ;AAAA,UAAA,GACJ;AAAA,4BACC,OAAA,EAAI,WAAU,2EACX,UAAA,gBAAAQ,EAAC,SAAA,EAAM,qHAIP,EAAA,CACJ;AAAA,QAAA,GACJ;AAAA,QACA,gBAAAA,EAAC,OAAA,EAAI,WAAU,QACX,UAAA,gBAAAA;AAAA,UAACK;AAAA,UAAA;AAAA,YACG,OAAK;AAAA,YACL,SAAQ;AAAA,YACR,SAAAtB;AAAA,YACA,SAASgB;AAAA,YACZ,UAAA;AAAA,UAAA;AAAA,QAAA,EAED,CACJ;AAAA,MAAA,EAAA,CACJ;AAAA,IAAA;AAAA,EAAA;AAIhB;"}
|
|
@@ -13,7 +13,7 @@ import { TbCheck as v } from "react-icons/tb";
|
|
|
13
13
|
import P from "../../../../../components/ui/Tag/Tag.js";
|
|
14
14
|
import S from "../../../../../components/ui/Button/Button.js";
|
|
15
15
|
const Q = () => {
|
|
16
|
-
const { paymentCycle: t, setPaymentDialog: m, setSelectedPlan: n } = g(),
|
|
16
|
+
const { paymentCycle: t, setPaymentDialog: m, setSelectedPlan: n } = g(), s = b(), o = s.get("subcription"), c = s.get("cycle"), { data: l } = y(
|
|
17
17
|
["/api/pricing"],
|
|
18
18
|
() => h(),
|
|
19
19
|
{
|
|
@@ -22,12 +22,12 @@ const Q = () => {
|
|
|
22
22
|
revalidateOnReconnect: !1
|
|
23
23
|
}
|
|
24
24
|
);
|
|
25
|
-
return /* @__PURE__ */ r("div", { className: "grid grid-cols-1 xl:grid-cols-3 gap-8 xl:gap-4", children:
|
|
25
|
+
return /* @__PURE__ */ r("div", { className: "grid grid-cols-1 xl:grid-cols-3 gap-8 xl:gap-4", children: l?.plans.map((e, p) => /* @__PURE__ */ i(
|
|
26
26
|
"div",
|
|
27
27
|
{
|
|
28
28
|
className: d(
|
|
29
29
|
"px-6 pt-2 flex flex-col justify-between",
|
|
30
|
-
!x(
|
|
30
|
+
!x(l.plans, p) && "border-r-0 xl:border-r border-gray-200 dark:border-gray-700"
|
|
31
31
|
),
|
|
32
32
|
children: [
|
|
33
33
|
/* @__PURE__ */ i("div", { children: [
|
|
@@ -80,7 +80,7 @@ const Q = () => {
|
|
|
80
80
|
S,
|
|
81
81
|
{
|
|
82
82
|
block: !0,
|
|
83
|
-
disabled:
|
|
83
|
+
disabled: o === e.id && c === t,
|
|
84
84
|
onClick: () => {
|
|
85
85
|
n({
|
|
86
86
|
paymentCycle: t,
|
|
@@ -88,7 +88,7 @@ const Q = () => {
|
|
|
88
88
|
price: e.price
|
|
89
89
|
}), m(!0);
|
|
90
90
|
},
|
|
91
|
-
children:
|
|
91
|
+
children: o === e.id && c === t ? "Current plan" : "Select plan"
|
|
92
92
|
}
|
|
93
93
|
) })
|
|
94
94
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plans.js","sources":["../../../../../../../lib/@ecme/views/concepts/accounts/Pricing/components/Plans.tsx"],"sourcesContent":["import Button from '@/components/ui/Button'\nimport Tag from '@/components/ui/Tag'\nimport { usePricingStore } from '../store/pricingStore'\nimport { apiGetPricingPlans } from '@/services/AccontsService'\nimport { featuresList } from '../constants'\nimport classNames from '@/utils/classNames'\nimport isLastChild from '@/utils/isLastChild'\nimport useQuery from '@/utils/hooks/useQuery'\nimport useSWR from 'swr'\nimport { NumericFormat } from 'react-number-format'\nimport { TbCheck } from 'react-icons/tb'\nimport type { GetPricingPanResponse } from '../types'\n\nconst Plans = () => {\n const { paymentCycle, setPaymentDialog, setSelectedPlan } =\n usePricingStore()\n\n const query = useQuery()\n const subcription = query.get('subcription')\n const cycle = query.get('cycle')\n\n const { data } = useSWR(\n ['/api/pricing'],\n () => apiGetPricingPlans<GetPricingPanResponse>(),\n {\n revalidateOnFocus: false,\n revalidateIfStale: false,\n revalidateOnReconnect: false,\n },\n )\n\n return (\n <div className=\"grid grid-cols-1 xl:grid-cols-3 gap-8 xl:gap-4\">\n {data?.plans.map((plan, index) => (\n <div\n key={plan.id}\n className={classNames(\n 'px-6 pt-2 flex flex-col justify-between',\n !isLastChild(data.plans, index) &&\n 'border-r-0 xl:border-r border-gray-200 dark:border-gray-700',\n )}\n >\n <div>\n <h5 className=\"mb-6 flex items-center gap-2\">\n <span>{plan.name}</span>\n {plan.recommended && (\n <Tag className=\"rounded-full bg-green-200 font-bold\">\n Recommended\n </Tag>\n )}\n </h5>\n <div className=\"\">{plan.description}</div>\n <div className=\"mt-6\">\n <NumericFormat\n className=\"h1\"\n displayType=\"text\"\n value={plan.price[paymentCycle]}\n prefix={'$'}\n thousandSeparator={true}\n />\n <span className=\"text-lg font-bold\">\n {' '}\n /{' '}\n {paymentCycle === 'monthly' ? 'month' : 'year'}\n </span>\n </div>\n <div className=\"flex flex-col gap-4 border-t border-gray-200 dark:border-gray-700 mt-6 pt-6\">\n {featuresList.map((feature) => (\n <div\n key={feature.id}\n className=\"flex items-center gap-4 font-semibold heading-text\"\n >\n {plan.features.includes(feature.id) && (\n <>\n <TbCheck\n className={classNames(\n 'text-2xl',\n plan.features.includes(\n feature.id,\n )\n ? 'text-primary'\n : 'text-gray-100',\n )}\n />\n <span>\n {\n feature.description[\n plan.id as string\n ]\n }\n </span>\n </>\n )}\n </div>\n ))}\n </div>\n </div>\n <div className=\"mt-10\">\n <Button\n block\n disabled={\n subcription === plan.id &&\n cycle === paymentCycle\n }\n onClick={() => {\n setSelectedPlan({\n paymentCycle,\n planName: plan.name,\n price: plan.price,\n })\n setPaymentDialog(true)\n }}\n >\n {subcription === plan.id && cycle === paymentCycle\n ? 'Current plan'\n : 'Select plan'}\n </Button>\n </div>\n </div>\n ))}\n </div>\n )\n}\n\nexport default Plans\n"],"names":["Plans","paymentCycle","setPaymentDialog","setSelectedPlan","usePricingStore","query","useQuery","subcription","cycle","data","useSWR","apiGetPricingPlans","jsx","plan","index","jsxs","classNames","isLastChild","Tag","NumericFormat","featuresList","feature","Fragment","TbCheck","Button"],"mappings":";;;;;;;;;;;;;;AAaA,MAAMA,IAAQ,MAAM;AAChB,QAAM,EAAE,cAAAC,GAAc,kBAAAC,GAAkB,iBAAAC,EAAA,IACpCC,EAAA,GAEEC,IAAQC,EAAA,GACRC,IAAcF,EAAM,IAAI,aAAa,GACrCG,IAAQH,EAAM,IAAI,OAAO,GAEzB,EAAE,MAAAI,MAASC;AAAA,IACb,CAAC,cAAc;AAAA,IACf,MAAMC,EAAA;AAAA,IACN;AAAA,MACI,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB,uBAAuB;AAAA,IAAA;AAAA,EAC3B;AAGJ,SACI,gBAAAC,EAAC,SAAI,WAAU,kDACV,
|
|
1
|
+
{"version":3,"file":"Plans.js","sources":["../../../../../../../lib/@ecme/views/concepts/accounts/Pricing/components/Plans.tsx"],"sourcesContent":["import Button from '@/components/ui/Button'\nimport Tag from '@/components/ui/Tag'\nimport { usePricingStore } from '../store/pricingStore'\nimport { apiGetPricingPlans } from '@/services/AccontsService'\nimport { featuresList } from '../constants'\nimport classNames from '@/utils/classNames'\nimport isLastChild from '@/utils/isLastChild'\nimport useQuery from '@/utils/hooks/useQuery'\nimport useSWR from 'swr'\nimport { NumericFormat } from 'react-number-format'\nimport { TbCheck } from 'react-icons/tb'\nimport type { GetPricingPanResponse } from '../types'\n\nconst Plans = () => {\n const { paymentCycle, setPaymentDialog, setSelectedPlan } =\n usePricingStore()\n\n const query = useQuery()\n const subcription = query.get('subcription')\n const cycle = query.get('cycle')\n\n const { data } = useSWR(\n ['/api/pricing'],\n () => apiGetPricingPlans<GetPricingPanResponse>(),\n {\n revalidateOnFocus: false,\n revalidateIfStale: false,\n revalidateOnReconnect: false,\n },\n )\n\n return (\n <div className=\"grid grid-cols-1 xl:grid-cols-3 gap-8 xl:gap-4\">\n {data?.plans.map((plan, index) => (\n <div\n key={plan.id}\n className={classNames(\n 'px-6 pt-2 flex flex-col justify-between',\n !isLastChild(data.plans, index) &&\n 'border-r-0 xl:border-r border-gray-200 dark:border-gray-700',\n )}\n >\n <div>\n <h5 className=\"mb-6 flex items-center gap-2\">\n <span>{plan.name}</span>\n {plan.recommended && (\n <Tag className=\"rounded-full bg-green-200 font-bold\">\n Recommended\n </Tag>\n )}\n </h5>\n <div className=\"\">{plan.description}</div>\n <div className=\"mt-6\">\n <NumericFormat\n className=\"h1\"\n displayType=\"text\"\n value={plan.price[paymentCycle]}\n prefix={'$'}\n thousandSeparator={true}\n />\n <span className=\"text-lg font-bold\">\n {' '}\n /{' '}\n {paymentCycle === 'monthly' ? 'month' : 'year'}\n </span>\n </div>\n <div className=\"flex flex-col gap-4 border-t border-gray-200 dark:border-gray-700 mt-6 pt-6\">\n {featuresList.map((feature) => (\n <div\n key={feature.id}\n className=\"flex items-center gap-4 font-semibold heading-text\"\n >\n {plan.features.includes(feature.id) && (\n <>\n <TbCheck\n className={classNames(\n 'text-2xl',\n plan.features.includes(\n feature.id,\n )\n ? 'text-primary'\n : 'text-gray-100',\n )}\n />\n <span>\n {\n feature.description[\n plan.id as string\n ]\n }\n </span>\n </>\n )}\n </div>\n ))}\n </div>\n </div>\n <div className=\"mt-10\">\n <Button\n block\n disabled={\n subcription === plan.id &&\n cycle === paymentCycle\n }\n onClick={() => {\n setSelectedPlan({\n paymentCycle,\n planName: plan.name,\n price: plan.price,\n })\n setPaymentDialog(true)\n }}\n >\n {subcription === plan.id && cycle === paymentCycle\n ? 'Current plan'\n : 'Select plan'}\n </Button>\n </div>\n </div>\n ))}\n </div>\n )\n}\n\nexport default Plans\n"],"names":["Plans","paymentCycle","setPaymentDialog","setSelectedPlan","usePricingStore","query","useQuery","subcription","cycle","data","useSWR","apiGetPricingPlans","jsx","plan","index","jsxs","classNames","isLastChild","Tag","NumericFormat","featuresList","feature","Fragment","TbCheck","Button"],"mappings":";;;;;;;;;;;;;;AAaA,MAAMA,IAAQ,MAAM;AAChB,QAAM,EAAE,cAAAC,GAAc,kBAAAC,GAAkB,iBAAAC,EAAA,IACpCC,EAAA,GAEEC,IAAQC,EAAA,GACRC,IAAcF,EAAM,IAAI,aAAa,GACrCG,IAAQH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A,YAAA;AAAA,cAEG,WAAU;AAAA,cAET,YAAK,SAAS,SAASS,EAAQ,EAAE,KAC9B,gBAAAN,EAAAO,GAAA,EACI,UAAA;AAAA,gBAAA,gBAAAV;AAAA,kBAACW;AAAA,kBAAA;AAAA,oBACG,WAAWP;AAAA,sBACP;AAAA,sBACAH,EAAK,SAAS;AAAA,wBACVQ,EAAQ;AAAA,sBAAA,IAEN,iBACA;AAAA,oBAAA;AAAA,kBACV;AAAA,gBAAA;AAAA,kCAEH,QAAA,EAEO,UAAAA,EAAQ,YACJR,EAAK,EACT,EAAA,CAER;AAAA,cAAA,EAAA,CACJ;AAAA,YAAA;AAAA,YAtBCQ,EAAQ;AAAA,UAAA,CAyBpB,EAAA,CACL;AAAA,QAAA,GACJ;AAAA,QACA,gBAAAT,EAAC,OAAA,EAAI,WAAU,SACX,UAAA,gBAAAA;AAAA,UAACY;AAAA,UAAA;AAAA,YACG,OAAK;AAAA,YACL,UACIjB,MAAgBM,EAAK,MACrBL,MAAUP;AAAA,YAEd,SAAS,MAAM;AACX,cAAAE,EAAgB;AAAA,gBACZ,cAAAF;AAAA,gBACA,UAAUY,EAAK;AAAA,gBACf,OAAOA,EAAK;AAAA,cAAA,CACf,GACDX,EAAiB,EAAI;AAAA,YACzB;AAAA,YAEC,UAAAK,MAAgBM,EAAK,MAAML,MAAUP,IAChC,iBACA;AAAA,UAAA;AAAA,QAAA,EACV,CACJ;AAAA,MAAA;AAAA,IAAA;AAAA,IAlFKY,EAAK;AAAA,EAAA,CAoFjB,GACL;AAER;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as n, Fragment as b } from "react/jsx-runtime";
|
|
2
2
|
import { useState as A, useRef as g, useMemo as F } from "react";
|
|
3
3
|
import "../../../../../components/ui/Button/index.js";
|
|
4
4
|
import { Avatar as B } from "../../../../../components/ui/Avatar/index.js";
|
|
@@ -18,7 +18,7 @@ import K from "../../../../../components/ui/Dialog/Dialog.js";
|
|
|
18
18
|
import L from "../../../../../components/ui/ScrollBar/ScrollBar.js";
|
|
19
19
|
import v from "../../../../../components/ui/Form/FormItem.js";
|
|
20
20
|
import N from "../../../../../components/ui/Input/Input.js";
|
|
21
|
-
import
|
|
21
|
+
import m from "../../../../../components/ui/Button/Button.js";
|
|
22
22
|
const Q = {
|
|
23
23
|
users: /* @__PURE__ */ e(H, {}),
|
|
24
24
|
products: /* @__PURE__ */ e(G, {}),
|
|
@@ -26,56 +26,55 @@ const Q = {
|
|
|
26
26
|
files: /* @__PURE__ */ e($, {}),
|
|
27
27
|
reports: /* @__PURE__ */ e(O, {})
|
|
28
28
|
}, { useUniqueId: V } = P, be = ({
|
|
29
|
-
roleList:
|
|
29
|
+
roleList: o,
|
|
30
30
|
mutate: d
|
|
31
31
|
}) => {
|
|
32
|
-
const { selectedRole:
|
|
32
|
+
const { selectedRole: c, setSelectedRole: R, setRoleDialog: w, roleDialog: s } = q(), [k, S] = A({}), p = g(null), f = g(null), h = V("role-"), a = () => {
|
|
33
33
|
w({
|
|
34
34
|
type: "",
|
|
35
35
|
open: !1
|
|
36
36
|
});
|
|
37
37
|
}, T = async () => {
|
|
38
|
-
|
|
38
|
+
a(), await M(300), R("");
|
|
39
39
|
}, I = async () => {
|
|
40
|
-
|
|
41
|
-
const r = structuredClone(c);
|
|
40
|
+
const r = structuredClone(o);
|
|
42
41
|
r.push({
|
|
43
|
-
id:
|
|
44
|
-
name:
|
|
45
|
-
description:
|
|
42
|
+
id: h,
|
|
43
|
+
name: p.current?.value || `Untitle-${h}`,
|
|
44
|
+
description: f.current?.value || "",
|
|
46
45
|
users: [],
|
|
47
46
|
accessRight: k
|
|
48
|
-
}), d(r, !1),
|
|
49
|
-
},
|
|
50
|
-
if (s.type === "new" && S((t) => (t[
|
|
51
|
-
const t = structuredClone(
|
|
47
|
+
}), d(r, !1), a();
|
|
48
|
+
}, u = F(() => o.find((r) => r.id === c), [c, o]), D = (r, l) => {
|
|
49
|
+
if (s.type === "new" && S((t) => (t[l] = r, t)), s.type === "edit") {
|
|
50
|
+
const t = structuredClone(o).map((i) => (i.id === c && (i.accessRight[l] = r), i));
|
|
52
51
|
d(t, !1);
|
|
53
52
|
}
|
|
54
53
|
};
|
|
55
|
-
return /* @__PURE__ */
|
|
54
|
+
return /* @__PURE__ */ n(
|
|
56
55
|
K,
|
|
57
56
|
{
|
|
58
57
|
isOpen: s.open,
|
|
59
58
|
width: 900,
|
|
60
|
-
onClose:
|
|
61
|
-
onRequestClose:
|
|
59
|
+
onClose: a,
|
|
60
|
+
onRequestClose: a,
|
|
62
61
|
children: [
|
|
63
|
-
/* @__PURE__ */ e("h4", { children: s.type === "new" ? "Create role" :
|
|
64
|
-
/* @__PURE__ */ e(L, { className: "mt-6 max-h-[600px] overflow-y-auto", children: /* @__PURE__ */
|
|
65
|
-
s.type === "new" && /* @__PURE__ */
|
|
66
|
-
/* @__PURE__ */ e(v, { label: "Role name", children: /* @__PURE__ */ e(N, { ref:
|
|
67
|
-
/* @__PURE__ */ e(v, { label: "Description", children: /* @__PURE__ */ e(N, { ref:
|
|
62
|
+
/* @__PURE__ */ e("h4", { children: s.type === "new" ? "Create role" : u?.name }),
|
|
63
|
+
/* @__PURE__ */ e(L, { className: "mt-6 max-h-[600px] overflow-y-auto", children: /* @__PURE__ */ n("div", { className: "px-4", children: [
|
|
64
|
+
s.type === "new" && /* @__PURE__ */ n(b, { children: [
|
|
65
|
+
/* @__PURE__ */ e(v, { label: "Role name", children: /* @__PURE__ */ e(N, { ref: p }) }),
|
|
66
|
+
/* @__PURE__ */ e(v, { label: "Description", children: /* @__PURE__ */ e(N, { ref: f, textArea: !0 }) }),
|
|
68
67
|
/* @__PURE__ */ e("span", { className: "font-semibold mb-2", children: "Permission" })
|
|
69
68
|
] }),
|
|
70
|
-
x.map((r,
|
|
69
|
+
x.map((r, l) => /* @__PURE__ */ n(
|
|
71
70
|
"div",
|
|
72
71
|
{
|
|
73
72
|
className: C(
|
|
74
73
|
"flex flex-col md:flex-row md:items-center justify-between gap-4 py-6 border-gray-200 dark:border-gray-600",
|
|
75
|
-
!z(x,
|
|
74
|
+
!z(x, l) && "border-b"
|
|
76
75
|
),
|
|
77
76
|
children: [
|
|
78
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-4", children: [
|
|
79
78
|
/* @__PURE__ */ e(
|
|
80
79
|
B,
|
|
81
80
|
{
|
|
@@ -85,7 +84,7 @@ const Q = {
|
|
|
85
84
|
shape: "round"
|
|
86
85
|
}
|
|
87
86
|
),
|
|
88
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ n("div", { children: [
|
|
89
88
|
/* @__PURE__ */ e("h6", { className: "font-bold", children: r.name }),
|
|
90
89
|
/* @__PURE__ */ e("span", { children: r.description })
|
|
91
90
|
] })
|
|
@@ -95,21 +94,21 @@ const Q = {
|
|
|
95
94
|
{
|
|
96
95
|
className: "bg-transparent dark:bg-transparent",
|
|
97
96
|
selectionType: "multiple",
|
|
98
|
-
value:
|
|
97
|
+
value: u?.accessRight[r.id],
|
|
99
98
|
onChange: (t) => D(t, r.id),
|
|
100
99
|
children: r.accessor.map((t) => /* @__PURE__ */ e(
|
|
101
100
|
y.Item,
|
|
102
101
|
{
|
|
103
102
|
value: t.value,
|
|
104
103
|
children: ({
|
|
105
|
-
active:
|
|
104
|
+
active: i,
|
|
106
105
|
onSegmentItemClick: U
|
|
107
106
|
}) => /* @__PURE__ */ e(
|
|
108
|
-
|
|
107
|
+
m,
|
|
109
108
|
{
|
|
110
109
|
variant: "default",
|
|
111
|
-
icon:
|
|
112
|
-
active:
|
|
110
|
+
icon: i ? /* @__PURE__ */ e(J, { className: "text-primary text-xl" }) : /* @__PURE__ */ e(b, {}),
|
|
111
|
+
active: i,
|
|
113
112
|
type: "button",
|
|
114
113
|
className: "md:min-w-[100px]",
|
|
115
114
|
size: "sm",
|
|
@@ -131,18 +130,18 @@ const Q = {
|
|
|
131
130
|
},
|
|
132
131
|
r.id
|
|
133
132
|
)),
|
|
134
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ n("div", { className: "flex justify-end mt-6", children: [
|
|
135
134
|
/* @__PURE__ */ e(
|
|
136
|
-
|
|
135
|
+
m,
|
|
137
136
|
{
|
|
138
137
|
className: "ltr:mr-2 rtl:ml-2",
|
|
139
138
|
variant: "plain",
|
|
140
|
-
onClick:
|
|
139
|
+
onClick: a,
|
|
141
140
|
children: "Cancel"
|
|
142
141
|
}
|
|
143
142
|
),
|
|
144
143
|
/* @__PURE__ */ e(
|
|
145
|
-
|
|
144
|
+
m,
|
|
146
145
|
{
|
|
147
146
|
variant: "solid",
|
|
148
147
|
onClick: s.type === "edit" ? T : I,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RolesPermissionsAccessDialog.js","sources":["../../../../../../../lib/@ecme/views/concepts/accounts/RolesPermissions/components/RolesPermissionsAccessDialog.tsx"],"sourcesContent":["import { useMemo, useState, useRef } from 'react'\nimport Button from '@/components/ui/Button'\nimport Avatar from '@/components/ui/Avatar'\nimport Segment from '@/components/ui/Segment'\nimport Dialog from '@/components/ui/Dialog'\nimport Input from '@/components/ui/Input'\nimport ScrollBar from '@/components/ui/ScrollBar'\nimport { FormItem } from '@/components/ui/Form'\nimport hooks from '@/components/ui/hooks'\nimport { useRolePermissionsStore } from '../store/rolePermissionsStore'\nimport { accessModules } from '../constants'\nimport classNames from '@/utils/classNames'\nimport isLastChild from '@/utils/isLastChild'\nimport sleep from '@/utils/sleep'\nimport {\n TbUserCog,\n TbBox,\n TbSettings,\n TbFiles,\n TbFileChart,\n TbCheck,\n} from 'react-icons/tb'\nimport type { MutateRolesPermissionsRolesResponse, Roles } from '../types'\nimport type { ReactNode } from 'react'\n\ntype RolesPermissionsAccessDialog = {\n roleList: Roles\n mutate: MutateRolesPermissionsRolesResponse\n}\n\nconst moduleIcon: Record<string, ReactNode> = {\n users: <TbUserCog />,\n products: <TbBox />,\n configurations: <TbSettings />,\n files: <TbFiles />,\n reports: <TbFileChart />,\n}\n\nconst { useUniqueId } = hooks\n\nconst RolesPermissionsAccessDialog = ({\n roleList,\n mutate,\n}: RolesPermissionsAccessDialog) => {\n const { selectedRole, setSelectedRole, setRoleDialog, roleDialog } =\n useRolePermissionsStore()\n\n const [accessRight, setAccessRight] = useState<Record<string, string[]>>({})\n\n const roleNameRef = useRef<HTMLInputElement>(null)\n const descriptionRef = useRef<HTMLTextAreaElement>(null)\n\n const newId = useUniqueId('role-')\n\n const handleClose = () => {\n setRoleDialog({\n type: '',\n open: false,\n })\n }\n\n const handleUpdate = async () => {\n handleClose()\n await sleep(300)\n setSelectedRole('')\n }\n\n const handleSubmit = async () => {\n const newRoleList = structuredClone(roleList)\n newRoleList.push({\n id: newId,\n name: roleNameRef.current?.value || `Untitle-${newId}`,\n description: descriptionRef.current?.value || '',\n users: [],\n accessRight,\n })\n mutate(newRoleList, false)\n handleClose()\n }\n\n const modules = useMemo(() => {\n return roleList.find((role) => role.id === selectedRole)\n }, [selectedRole, roleList])\n\n const handleChange = (accessRight: string[], key: string) => {\n if (roleDialog.type === 'new') {\n setAccessRight((value) => {\n value[key] = accessRight\n return value\n })\n }\n\n if (roleDialog.type === 'edit') {\n const newRoleList = structuredClone(roleList).map((role) => {\n if (role.id === selectedRole) {\n role.accessRight[key] = accessRight\n }\n\n return role\n })\n\n mutate(newRoleList, false)\n }\n }\n\n return (\n <Dialog\n isOpen={roleDialog.open}\n width={900}\n onClose={handleClose}\n onRequestClose={handleClose}\n >\n <h4>{roleDialog.type === 'new' ? 'Create role' : modules?.name}</h4>\n <ScrollBar className=\"mt-6 max-h-[600px] overflow-y-auto\">\n <div className=\"px-4\">\n {roleDialog.type === 'new' && (\n <>\n <FormItem label=\"Role name\">\n <Input ref={roleNameRef} />\n </FormItem>\n <FormItem label=\"Description\">\n <Input ref={descriptionRef} textArea />\n </FormItem>\n <span className=\"font-semibold mb-2\">\n Permission\n </span>\n </>\n )}\n {accessModules.map((module, index) => (\n <div\n key={module.id}\n className={classNames(\n 'flex flex-col md:flex-row md:items-center justify-between gap-4 py-6 border-gray-200 dark:border-gray-600',\n !isLastChild(accessModules, index) &&\n 'border-b',\n )}\n >\n <div className=\"flex items-center gap-4\">\n <Avatar\n className=\"bg-transparent dark:bg-transparent p-2 border-2 border-gray-200 dark:border-gray-600 text-primary\"\n size={50}\n icon={moduleIcon[module.id]}\n shape=\"round\"\n />\n <div>\n <h6 className=\"font-bold\">{module.name}</h6>\n <span>{module.description}</span>\n </div>\n </div>\n <div className=\"flex items-center gap-4\">\n <Segment\n className=\"bg-transparent dark:bg-transparent\"\n selectionType=\"multiple\"\n value={modules?.accessRight[module.id]}\n onChange={(val) =>\n handleChange(val as string[], module.id)\n }\n >\n {module.accessor.map((access) => (\n <Segment.Item\n key={module.id + access.value}\n value={access.value}\n >\n {({\n active,\n onSegmentItemClick,\n }) => {\n return (\n <Button\n variant=\"default\"\n icon={\n active ? (\n <TbCheck className=\"text-primary text-xl\" />\n ) : (\n <></>\n )\n }\n active={active}\n type=\"button\"\n className=\"md:min-w-[100px]\"\n size=\"sm\"\n customColorClass={({\n active,\n }) =>\n classNames(\n active &&\n 'bg-transparent dark:bg-transparent text-primary border-primary ring-1 ring-primary',\n )\n }\n onClick={\n onSegmentItemClick\n }\n >\n {access.label}\n </Button>\n )\n }}\n </Segment.Item>\n ))}\n </Segment>\n </div>\n </div>\n ))}\n <div className=\"flex justify-end mt-6\">\n <Button\n className=\"ltr:mr-2 rtl:ml-2\"\n variant=\"plain\"\n onClick={handleClose}\n >\n Cancel\n </Button>\n <Button\n variant=\"solid\"\n onClick={\n roleDialog.type === 'edit'\n ? handleUpdate\n : handleSubmit\n }\n >\n {roleDialog.type === 'edit' ? 'Update' : 'Create'}\n </Button>\n </div>\n </div>\n </ScrollBar>\n </Dialog>\n )\n}\n\nexport default RolesPermissionsAccessDialog\n"],"names":["moduleIcon","TbUserCog","TbBox","TbSettings","TbFiles","TbFileChart","useUniqueId","hooks","RolesPermissionsAccessDialog","roleList","mutate","selectedRole","setSelectedRole","setRoleDialog","roleDialog","useRolePermissionsStore","accessRight","setAccessRight","useState","roleNameRef","useRef","descriptionRef","newId","handleClose","handleUpdate","sleep","handleSubmit","newRoleList","_a","_b","modules","useMemo","role","handleChange","key","value","jsxs","Dialog","jsx","ScrollBar","Fragment","FormItem","Input","accessModules","module","index","classNames","isLastChild","Avatar","Segment","val","access","active","onSegmentItemClick","Button","TbCheck"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA8BA,MAAMA,IAAwC;AAAA,EAC1C,yBAAQC,GAAA,EAAU;AAAA,EAClB,4BAAWC,GAAA,EAAM;AAAA,EACjB,kCAAiBC,GAAA,EAAW;AAAA,EAC5B,yBAAQC,GAAA,EAAQ;AAAA,EAChB,2BAAUC,GAAA,CAAA,CAAY;AAC1B,GAEM,EAAE,aAAAC,MAAgBC,GAElBC,KAA+B,CAAC;AAAA,EAClC,UAAAC;AAAA,EACA,QAAAC;AACJ,MAAoC;AAChC,QAAM,EAAE,cAAAC,GAAc,iBAAAC,GAAiB,eAAAC,GAAe,YAAAC,EAAA,IAClDC,EAAA,GAEE,CAACC,GAAaC,CAAc,IAAIC,EAAmC,CAAA,CAAE,GAErEC,IAAcC,EAAyB,IAAI,GAC3CC,IAAiBD,EAA4B,IAAI,GAEjDE,IAAQhB,EAAY,OAAO,GAE3BiB,IAAc,MAAM;AACtB,IAAAV,EAAc;AAAA,MACV,MAAM;AAAA,MACN,MAAM;AAAA,IAAA,CACT;AAAA,EACL,GAEMW,IAAe,YAAY;AAC7B,IAAAD,EAAA,GACA,MAAME,EAAM,GAAG,GACfb,EAAgB,EAAE;AAAA,EACtB,GAEMc,IAAe,YAAY;;AAC7B,UAAMC,IAAc,gBAAgBlB,CAAQ;AAC5C,IAAAkB,EAAY,KAAK;AAAA,MACb,IAAIL;AAAA,MACJ,QAAMM,IAAAT,EAAY,YAAZ,gBAAAS,EAAqB,UA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SAAQ;AAAA,4BACR,MACIF,IACI,gBAAAd,EAACiB,KAAQ,WAAU,uBAAA,CAAuB,IAE1C,gBAAAjB,EAAAE,GAAA,EAAE;AAAA,4BAGV,QAAAY;AAAA,4BACA,MAAK;AAAA,4BACL,WAAU;AAAA,4BACV,MAAK;AAAA,4BACL,kBAAkB,CAAC;AAAA,8BACf,QAAAA;AAAAA,4BAAA,MAEAN;AAAA,8BACIM,KACI;AAAA,4BAAA;AAAA,4BAGZ,SACIC;AAAA,4BAGH,UAAAF,EAAO;AAAA,0BAAA;AAAA,wBAAA;AAAA,sBAGpB;AAAA,sBApCKP,EAAO,KAAKO,EAAO;AAAA,oBAAA,CAsC/B;AAAA,kBAAA;AAAA,gBAAA,EACL,CACJ;AAAA,cAAA;AAAA,YAAA;AAAA,YAtEKP,EAAO;AAAA,UAAA,CAwEnB;AAAA,UACD,gBAAAR,EAAC,OAAA,EAAI,WAAU,yBACX,UAAA;AAAA,YAAA,gBAAAE;AAAA,cAACgB;AAAA,cAAA;AAAA,gBACG,WAAU;AAAA,gBACV,SAAQ;AAAA,gBACR,SAAS/B;AAAA,gBACZ,UAAA;AAAA,cAAA;AAAA,YAAA;AAAA,YAGD,gBAAAe;AAAA,cAACgB;AAAA,cAAA;AAAA,gBACG,SAAQ;AAAA,gBACR,SACIxC,EAAW,SAAS,SACdU,IACAE;AAAA,gBAGT,UAAAZ,EAAW,SAAS,SAAS,WAAW;AAAA,cAAA;AAAA,YAAA;AAAA,UAC7C,EAAA,CACJ;AAAA,QAAA,EAAA,CACJ,EAAA,CACJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGZ;"}
|
|
1
|
+
{"version":3,"file":"RolesPermissionsAccessDialog.js","sources":["../../../../../../../lib/@ecme/views/concepts/accounts/RolesPermissions/components/RolesPermissionsAccessDialog.tsx"],"sourcesContent":["import { useMemo, useState, useRef } from 'react'\nimport Button from '@/components/ui/Button'\nimport Avatar from '@/components/ui/Avatar'\nimport Segment from '@/components/ui/Segment'\nimport Dialog from '@/components/ui/Dialog'\nimport Input from '@/components/ui/Input'\nimport ScrollBar from '@/components/ui/ScrollBar'\nimport { FormItem } from '@/components/ui/Form'\nimport hooks from '@/components/ui/hooks'\nimport { useRolePermissionsStore } from '../store/rolePermissionsStore'\nimport { accessModules } from '../constants'\nimport classNames from '@/utils/classNames'\nimport isLastChild from '@/utils/isLastChild'\nimport sleep from '@/utils/sleep'\nimport {\n TbUserCog,\n TbBox,\n TbSettings,\n TbFiles,\n TbFileChart,\n TbCheck,\n} from 'react-icons/tb'\nimport type { MutateRolesPermissionsRolesResponse, Roles } from '../types'\nimport type { ReactNode } from 'react'\n\ntype RolesPermissionsAccessDialog = {\n roleList: Roles\n mutate: MutateRolesPermissionsRolesResponse\n}\n\nconst moduleIcon: Record<string, ReactNode> = {\n users: <TbUserCog />,\n products: <TbBox />,\n configurations: <TbSettings />,\n files: <TbFiles />,\n reports: <TbFileChart />,\n}\n\nconst { useUniqueId } = hooks\n\nconst RolesPermissionsAccessDialog = ({\n roleList,\n mutate,\n}: RolesPermissionsAccessDialog) => {\n const { selectedRole, setSelectedRole, setRoleDialog, roleDialog } =\n useRolePermissionsStore()\n\n const [accessRight, setAccessRight] = useState<Record<string, string[]>>({})\n\n const roleNameRef = useRef<HTMLInputElement>(null)\n const descriptionRef = useRef<HTMLTextAreaElement>(null)\n\n const newId = useUniqueId('role-')\n\n const handleClose = () => {\n setRoleDialog({\n type: '',\n open: false,\n })\n }\n\n const handleUpdate = async () => {\n handleClose()\n await sleep(300)\n setSelectedRole('')\n }\n\n const handleSubmit = async () => {\n const newRoleList = structuredClone(roleList)\n newRoleList.push({\n id: newId,\n name: roleNameRef.current?.value || `Untitle-${newId}`,\n description: descriptionRef.current?.value || '',\n users: [],\n accessRight,\n })\n mutate(newRoleList, false)\n handleClose()\n }\n\n const modules = useMemo(() => {\n return roleList.find((role) => role.id === selectedRole)\n }, [selectedRole, roleList])\n\n const handleChange = (accessRight: string[], key: string) => {\n if (roleDialog.type === 'new') {\n setAccessRight((value) => {\n value[key] = accessRight\n return value\n })\n }\n\n if (roleDialog.type === 'edit') {\n const newRoleList = structuredClone(roleList).map((role) => {\n if (role.id === selectedRole) {\n role.accessRight[key] = accessRight\n }\n\n return role\n })\n\n mutate(newRoleList, false)\n }\n }\n\n return (\n <Dialog\n isOpen={roleDialog.open}\n width={900}\n onClose={handleClose}\n onRequestClose={handleClose}\n >\n <h4>{roleDialog.type === 'new' ? 'Create role' : modules?.name}</h4>\n <ScrollBar className=\"mt-6 max-h-[600px] overflow-y-auto\">\n <div className=\"px-4\">\n {roleDialog.type === 'new' && (\n <>\n <FormItem label=\"Role name\">\n <Input ref={roleNameRef} />\n </FormItem>\n <FormItem label=\"Description\">\n <Input ref={descriptionRef} textArea />\n </FormItem>\n <span className=\"font-semibold mb-2\">\n Permission\n </span>\n </>\n )}\n {accessModules.map((module, index) => (\n <div\n key={module.id}\n className={classNames(\n 'flex flex-col md:flex-row md:items-center justify-between gap-4 py-6 border-gray-200 dark:border-gray-600',\n !isLastChild(accessModules, index) &&\n 'border-b',\n )}\n >\n <div className=\"flex items-center gap-4\">\n <Avatar\n className=\"bg-transparent dark:bg-transparent p-2 border-2 border-gray-200 dark:border-gray-600 text-primary\"\n size={50}\n icon={moduleIcon[module.id]}\n shape=\"round\"\n />\n <div>\n <h6 className=\"font-bold\">{module.name}</h6>\n <span>{module.description}</span>\n </div>\n </div>\n <div className=\"flex items-center gap-4\">\n <Segment\n className=\"bg-transparent dark:bg-transparent\"\n selectionType=\"multiple\"\n value={modules?.accessRight[module.id]}\n onChange={(val) =>\n handleChange(val as string[], module.id)\n }\n >\n {module.accessor.map((access) => (\n <Segment.Item\n key={module.id + access.value}\n value={access.value}\n >\n {({\n active,\n onSegmentItemClick,\n }) => {\n return (\n <Button\n variant=\"default\"\n icon={\n active ? (\n <TbCheck className=\"text-primary text-xl\" />\n ) : (\n <></>\n )\n }\n active={active}\n type=\"button\"\n className=\"md:min-w-[100px]\"\n size=\"sm\"\n customColorClass={({\n active,\n }) =>\n classNames(\n active &&\n 'bg-transparent dark:bg-transparent text-primary border-primary ring-1 ring-primary',\n )\n }\n onClick={\n onSegmentItemClick\n }\n >\n {access.label}\n </Button>\n )\n }}\n </Segment.Item>\n ))}\n </Segment>\n </div>\n </div>\n ))}\n <div className=\"flex justify-end mt-6\">\n <Button\n className=\"ltr:mr-2 rtl:ml-2\"\n variant=\"plain\"\n onClick={handleClose}\n >\n Cancel\n </Button>\n <Button\n variant=\"solid\"\n onClick={\n roleDialog.type === 'edit'\n ? handleUpdate\n : handleSubmit\n }\n >\n {roleDialog.type === 'edit' ? 'Update' : 'Create'}\n </Button>\n </div>\n </div>\n </ScrollBar>\n </Dialog>\n )\n}\n\nexport default RolesPermissionsAccessDialog\n"],"names":["moduleIcon","TbUserCog","TbBox","TbSettings","TbFiles","TbFileChart","useUniqueId","hooks","RolesPermissionsAccessDialog","roleList","mutate","selectedRole","setSelectedRole","setRoleDialog","roleDialog","useRolePermissionsStore","accessRight","setAccessRight","useState","roleNameRef","useRef","descriptionRef","newId","handleClose","handleUpdate","sleep","handleSubmit","newRoleList","modules","useMemo","role","handleChange","key","value","jsxs","Dialog","jsx","ScrollBar","Fragment","FormItem","Input","accessModules","module","index","classNames","isLastChild","Avatar","Segment","val","access","active","onSegmentItemClick","Button","TbCheck"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA8BA,MAAMA,IAAwC;AAAA,EAC1C,yBAAQC,GAAA,EAAU;AAAA,EAClB,4BAAWC,GAAA,EAAM;AAAA,EACjB,kCAAiBC,GAAA,EAAW;AAAA,EAC5B,yBAAQC,GAAA,EAAQ;AAAA,EAChB,2BAAUC,GAAA,CAAA,CAAY;AAC1B,GAEM,EAAE,aAAAC,MAAgBC,GAElBC,KAA+B,CAAC;AAAA,EAClC,UAAAC;AAAA,EACA,QAAAC;AACJ,MAAoC;AAChC,QAAM,EAAE,cAAAC,GAAc,iBAAAC,GAAiB,eAAAC,GAAe,YAAAC,E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AAA,gBACR,SACItC,EAAW,SAAS,SACdU,IACAE;AAAA,gBAGT,UAAAZ,EAAW,SAAS,SAAS,WAAW;AAAA,cAAA;AAAA,YAAA;AAAA,UAC7C,EAAA,CACJ;AAAA,QAAA,EAAA,CACJ,EAAA,CACJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGZ;"}
|
package/dist/@ecme/views/concepts/accounts/RolesPermissions/components/RolesPermissionsUserAction.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
1
|
+
import { jsx as l, jsxs as s } from "react/jsx-runtime";
|
|
2
2
|
import "../../../../../components/ui/Badge/index.js";
|
|
3
3
|
import "../../../../../components/ui/Select/index.js";
|
|
4
|
-
import
|
|
4
|
+
import d from "../../../../../components/shared/DebounceInput.js";
|
|
5
5
|
import { useRolePermissionsStore as g } from "../store/rolePermissionsStore.js";
|
|
6
6
|
import { TbSearch as b } from "react-icons/tb";
|
|
7
7
|
import { components as v } from "react-select";
|
|
8
|
-
import
|
|
8
|
+
import r from "../../../../../components/ui/Select/Option.js";
|
|
9
9
|
import c from "../../../../../components/ui/Badge/Badge.js";
|
|
10
|
-
import
|
|
10
|
+
import n from "../../../../../components/ui/Select/Select.js";
|
|
11
11
|
const { Control: h } = v, f = [
|
|
12
12
|
{ label: "All", value: "", dotBackground: "bg-gray-200" },
|
|
13
13
|
{ label: "Active", value: "active", dotBackground: "bg-success" },
|
|
@@ -20,50 +20,50 @@ const { Control: h } = v, f = [
|
|
|
20
20
|
{ label: "User", value: "user" },
|
|
21
21
|
{ label: "Auditor", value: "auditor" },
|
|
22
22
|
{ label: "Guest", value: "guest" }
|
|
23
|
-
], S = (
|
|
24
|
-
|
|
23
|
+
], S = (o) => /* @__PURE__ */ l(
|
|
24
|
+
r,
|
|
25
25
|
{
|
|
26
|
-
...
|
|
27
|
-
customLabel: (t, a) => /* @__PURE__ */
|
|
26
|
+
...o,
|
|
27
|
+
customLabel: (t, a) => /* @__PURE__ */ s("span", { className: "flex items-center gap-2", children: [
|
|
28
28
|
/* @__PURE__ */ l(c, { className: t.dotBackground }),
|
|
29
29
|
/* @__PURE__ */ l("span", { children: a })
|
|
30
30
|
] })
|
|
31
31
|
}
|
|
32
|
-
), C = (
|
|
33
|
-
|
|
32
|
+
), C = (o) => /* @__PURE__ */ l(
|
|
33
|
+
r,
|
|
34
34
|
{
|
|
35
|
-
...
|
|
35
|
+
...o,
|
|
36
36
|
customLabel: (t, a) => /* @__PURE__ */ l("span", { children: a })
|
|
37
37
|
}
|
|
38
|
-
), N = ({ children:
|
|
38
|
+
), N = ({ children: o, ...t }) => {
|
|
39
39
|
const a = t.getValue()[0];
|
|
40
|
-
return /* @__PURE__ */
|
|
40
|
+
return /* @__PURE__ */ s(h, { ...t, children: [
|
|
41
41
|
a && /* @__PURE__ */ l("div", { className: "flex ml-3", children: /* @__PURE__ */ l(c, { className: a.dotBackground }) }),
|
|
42
|
-
|
|
42
|
+
o
|
|
43
43
|
] });
|
|
44
44
|
}, V = () => {
|
|
45
|
-
const { tableData:
|
|
45
|
+
const { tableData: o, filterData: t, setFilterData: a, setTableData: u } = g(), i = (e) => {
|
|
46
46
|
a({ ...t, status: e });
|
|
47
|
-
},
|
|
47
|
+
}, m = (e) => {
|
|
48
48
|
a({ ...t, role: e });
|
|
49
|
-
},
|
|
50
|
-
u({ ...
|
|
49
|
+
}, p = (e) => {
|
|
50
|
+
u({ ...o, query: e });
|
|
51
51
|
};
|
|
52
|
-
return /* @__PURE__ */
|
|
52
|
+
return /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
|
|
53
53
|
/* @__PURE__ */ l(
|
|
54
|
-
|
|
54
|
+
d,
|
|
55
55
|
{
|
|
56
56
|
className: "max-w-[300px]",
|
|
57
57
|
placeholder: "Search...",
|
|
58
58
|
type: "text",
|
|
59
59
|
size: "sm",
|
|
60
60
|
prefix: /* @__PURE__ */ l(b, { className: "text-lg" }),
|
|
61
|
-
onChange: (e) =>
|
|
61
|
+
onChange: (e) => p(e.target.value)
|
|
62
62
|
}
|
|
63
63
|
),
|
|
64
|
-
/* @__PURE__ */
|
|
64
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
65
65
|
/* @__PURE__ */ l(
|
|
66
|
-
|
|
66
|
+
n,
|
|
67
67
|
{
|
|
68
68
|
className: "min-w-[150px] w-full",
|
|
69
69
|
components: {
|
|
@@ -78,11 +78,11 @@ const { Control: h } = v, f = [
|
|
|
78
78
|
value: "",
|
|
79
79
|
dotBackground: "bg-gray-200"
|
|
80
80
|
},
|
|
81
|
-
onChange: (e) =>
|
|
81
|
+
onChange: (e) => i(e?.value || "")
|
|
82
82
|
}
|
|
83
83
|
),
|
|
84
84
|
/* @__PURE__ */ l(
|
|
85
|
-
|
|
85
|
+
n,
|
|
86
86
|
{
|
|
87
87
|
className: "min-w-[150px] w-full",
|
|
88
88
|
components: {
|
|
@@ -92,7 +92,7 @@ const { Control: h } = v, f = [
|
|
|
92
92
|
size: "sm",
|
|
93
93
|
placeholder: "Role",
|
|
94
94
|
defaultValue: { label: "All", value: "" },
|
|
95
|
-
onChange: (e) =>
|
|
95
|
+
onChange: (e) => m(e?.value || "")
|
|
96
96
|
}
|
|
97
97
|
)
|
|
98
98
|
] })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RolesPermissionsUserAction.js","sources":["../../../../../../../lib/@ecme/views/concepts/accounts/RolesPermissions/components/RolesPermissionsUserAction.tsx"],"sourcesContent":["import Badge from '@/components/ui/Badge'\nimport Select, { Option as DefaultOption } from '@/components/ui/Select'\nimport DebounceInput from '@/components/shared/DebounceInput'\nimport { useRolePermissionsStore } from '../store/rolePermissionsStore'\nimport { TbSearch } from 'react-icons/tb'\nimport { components } from 'react-select'\nimport type { ControlProps, OptionProps } from 'react-select'\n\nconst { Control } = components\n\ntype StatusOption = {\n label: string\n value: string\n dotBackground: string\n}\n\ntype RoleOption = {\n label: string\n value: string\n}\n\nconst statusOptions = [\n { label: 'All', value: '', dotBackground: 'bg-gray-200' },\n { label: 'Active', value: 'active', dotBackground: 'bg-success' },\n { label: 'Blocked', value: 'blocked', dotBackground: 'bg-error' },\n]\n\nconst roleOptions = [\n { label: 'All', value: '' },\n { label: 'Admin', value: 'admin' },\n { label: 'Supervisor', value: 'supervisor' },\n { label: 'Support', value: 'support' },\n { label: 'User', value: 'user' },\n { label: 'Auditor', value: 'auditor' },\n { label: 'Guest', value: 'guest' },\n]\n\nconst StatusSelectOption = (props: OptionProps<StatusOption>) => {\n return (\n <DefaultOption<StatusOption>\n {...props}\n customLabel={(data, label) => (\n <span className=\"flex items-center gap-2\">\n <Badge className={data.dotBackground} />\n <span>{label}</span>\n </span>\n )}\n />\n )\n}\n\nconst RoleSelectOption = (props: OptionProps<RoleOption>) => {\n return (\n <DefaultOption<RoleOption>\n {...props}\n customLabel={(_, label) => <span>{label}</span>}\n />\n )\n}\n\nconst CustomControl = ({ children, ...props }: ControlProps<StatusOption>) => {\n const selected = props.getValue()[0]\n return (\n <Control {...props}>\n {selected && (\n <div className=\"flex ml-3\">\n <Badge className={selected.dotBackground} />\n </div>\n )}\n {children}\n </Control>\n )\n}\n\nconst RolesPermissionsUserAction = () => {\n const { tableData, filterData, setFilterData, setTableData } =\n useRolePermissionsStore()\n\n const handleStatusChange = (status: string) => {\n setFilterData({ ...filterData, status })\n }\n\n const handleRoleChange = (role: string) => {\n setFilterData({ ...filterData, role })\n }\n\n const handleInputChange = (query: string) => {\n setTableData({ ...tableData, query })\n }\n\n return (\n <div className=\"flex items-center justify-between\">\n <DebounceInput\n className=\"max-w-[300px]\"\n placeholder=\"Search...\"\n type=\"text\"\n size=\"sm\"\n prefix={<TbSearch className=\"text-lg\" />}\n onChange={(e) => handleInputChange(e.target.value)}\n />\n <div className=\"flex items-center gap-2\">\n <Select<StatusOption, false>\n className=\"min-w-[150px] w-full\"\n components={{\n Control: CustomControl,\n Option: StatusSelectOption,\n }}\n options={statusOptions}\n size=\"sm\"\n placeholder=\"Status\"\n defaultValue={{\n label: 'All',\n value: '',\n dotBackground: 'bg-gray-200',\n }}\n onChange={(option) =>\n handleStatusChange(option?.value || '')\n }\n />\n <Select<RoleOption>\n className=\"min-w-[150px] w-full\"\n components={{\n Option: RoleSelectOption,\n }}\n options={roleOptions}\n size=\"sm\"\n placeholder=\"Role\"\n defaultValue={{ label: 'All', value: '' }}\n onChange={(option) => handleRoleChange(option?.value || '')}\n />\n </div>\n </div>\n )\n}\n\nexport default RolesPermissionsUserAction\n"],"names":["Control","components","statusOptions","roleOptions","StatusSelectOption","props","jsx","DefaultOption","data","label","jsxs","Badge","RoleSelectOption","_","CustomControl","children","selected","RolesPermissionsUserAction","tableData","filterData","setFilterData","setTableData","useRolePermissionsStore","handleStatusChange","status","handleRoleChange","role","handleInputChange","query","DebounceInput","TbSearch","Select","option"],"mappings":";;;;;;;;;;AAQA,MAAM,EAAE,SAAAA,MAAYC,GAadC,IAAgB;AAAA,EAClB,EAAE,OAAO,OAAO,OAAO,IAAI,eAAe,cAAA;AAAA,EAC1C,EAAE,OAAO,UAAU,OAAO,UAAU,eAAe,aAAA;AAAA,EACnD,EAAE,OAAO,WAAW,OAAO,WAAW,eAAe,WAAA;AACzD,GAEMC,IAAc;AAAA,EAChB,EAAE,OAAO,OAAO,OAAO,GAAA;AAAA,EACvB,EAAE,OAAO,SAAS,OAAO,QAAA;AAAA,EACzB,EAAE,OAAO,cAAc,OAAO,aAAA;AAAA,EAC9B,EAAE,OAAO,WAAW,OAAO,UAAA;AAAA,EAC3B,EAAE,OAAO,QAAQ,OAAO,OAAA;AAAA,EACxB,EAAE,OAAO,WAAW,OAAO,UAAA;AAAA,EAC3B,EAAE,OAAO,SAAS,OAAO,QAAA;AAC7B,GAEMC,IAAqB,CAACC,MAEpB,gBAAAC;AAAA,EAACC;AAAAA,EAAA;AAAA,IACI,GAAGF;AAAA,IACJ,aAAa,CAACG,GAAMC,MAChB,gBAAAC,EAAC,QAAA,EAAK,WAAU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AACwB,GAAA,EAAS,WAAU,UAAA,CAAU;AAAA,QACtC,UAAU,CAAC,MAAMH,EAAkB,EAAE,OAAO,KAAK;AAAA,MAAA;AAAA,IAAA;AAAA,IAErD,gBAAAjB,EAAC,OAAA,EAAI,WAAU,2BACX,UAAA;AAAA,MAAA,gBAAAJ;AAAA,QAACyB;AAAA,QAAA;AAAA,UACG,WAAU;AAAA,UACV,YAAY;AAAA,YACR,SAASjB;AAAA,YACT,QAAQV;AAAA,UAAA;AAAA,UAEZ,SAASF;AAAA,UACT,MAAK;AAAA,UACL,aAAY;AAAA,UACZ,cAAc;AAAA,YACV,OAAO;AAAA,YACP,OAAO;AAAA,YACP,eAAe;AAAA,UAAA;AAAA,UAEnB,UAAU,CAAC8B,MACPT,
|
|
1
|
+
{"version":3,"file":"RolesPermissionsUserAction.js","sources":["../../../../../../../lib/@ecme/views/concepts/accounts/RolesPermissions/components/RolesPermissionsUserAction.tsx"],"sourcesContent":["import Badge from '@/components/ui/Badge'\nimport Select, { Option as DefaultOption } from '@/components/ui/Select'\nimport DebounceInput from '@/components/shared/DebounceInput'\nimport { useRolePermissionsStore } from '../store/rolePermissionsStore'\nimport { TbSearch } from 'react-icons/tb'\nimport { components } from 'react-select'\nimport type { ControlProps, OptionProps } from 'react-select'\n\nconst { Control } = components\n\ntype StatusOption = {\n label: string\n value: string\n dotBackground: string\n}\n\ntype RoleOption = {\n label: string\n value: string\n}\n\nconst statusOptions = [\n { label: 'All', value: '', dotBackground: 'bg-gray-200' },\n { label: 'Active', value: 'active', dotBackground: 'bg-success' },\n { label: 'Blocked', value: 'blocked', dotBackground: 'bg-error' },\n]\n\nconst roleOptions = [\n { label: 'All', value: '' },\n { label: 'Admin', value: 'admin' },\n { label: 'Supervisor', value: 'supervisor' },\n { label: 'Support', value: 'support' },\n { label: 'User', value: 'user' },\n { label: 'Auditor', value: 'auditor' },\n { label: 'Guest', value: 'guest' },\n]\n\nconst StatusSelectOption = (props: OptionProps<StatusOption>) => {\n return (\n <DefaultOption<StatusOption>\n {...props}\n customLabel={(data, label) => (\n <span className=\"flex items-center gap-2\">\n <Badge className={data.dotBackground} />\n <span>{label}</span>\n </span>\n )}\n />\n )\n}\n\nconst RoleSelectOption = (props: OptionProps<RoleOption>) => {\n return (\n <DefaultOption<RoleOption>\n {...props}\n customLabel={(_, label) => <span>{label}</span>}\n />\n )\n}\n\nconst CustomControl = ({ children, ...props }: ControlProps<StatusOption>) => {\n const selected = props.getValue()[0]\n return (\n <Control {...props}>\n {selected && (\n <div className=\"flex ml-3\">\n <Badge className={selected.dotBackground} />\n </div>\n )}\n {children}\n </Control>\n )\n}\n\nconst RolesPermissionsUserAction = () => {\n const { tableData, filterData, setFilterData, setTableData } =\n useRolePermissionsStore()\n\n const handleStatusChange = (status: string) => {\n setFilterData({ ...filterData, status })\n }\n\n const handleRoleChange = (role: string) => {\n setFilterData({ ...filterData, role })\n }\n\n const handleInputChange = (query: string) => {\n setTableData({ ...tableData, query })\n }\n\n return (\n <div className=\"flex items-center justify-between\">\n <DebounceInput\n className=\"max-w-[300px]\"\n placeholder=\"Search...\"\n type=\"text\"\n size=\"sm\"\n prefix={<TbSearch className=\"text-lg\" />}\n onChange={(e) => handleInputChange(e.target.value)}\n />\n <div className=\"flex items-center gap-2\">\n <Select<StatusOption, false>\n className=\"min-w-[150px] w-full\"\n components={{\n Control: CustomControl,\n Option: StatusSelectOption,\n }}\n options={statusOptions}\n size=\"sm\"\n placeholder=\"Status\"\n defaultValue={{\n label: 'All',\n value: '',\n dotBackground: 'bg-gray-200',\n }}\n onChange={(option) =>\n handleStatusChange(option?.value || '')\n }\n />\n <Select<RoleOption>\n className=\"min-w-[150px] w-full\"\n components={{\n Option: RoleSelectOption,\n }}\n options={roleOptions}\n size=\"sm\"\n placeholder=\"Role\"\n defaultValue={{ label: 'All', value: '' }}\n onChange={(option) => handleRoleChange(option?.value || '')}\n />\n </div>\n </div>\n )\n}\n\nexport default RolesPermissionsUserAction\n"],"names":["Control","components","statusOptions","roleOptions","StatusSelectOption","props","jsx","DefaultOption","data","label","jsxs","Badge","RoleSelectOption","_","CustomControl","children","selected","RolesPermissionsUserAction","tableData","filterData","setFilterData","setTableData","useRolePermissionsStore","handleStatusChange","status","handleRoleChange","role","handleInputChange","query","DebounceInput","TbSearch","Select","option"],"mappings":";;;;;;;;;;AAQA,MAAM,EAAE,SAAAA,MAAYC,GAadC,IAAgB;AAAA,EAClB,EAAE,OAAO,OAAO,OAAO,IAAI,eAAe,cAAA;AAAA,EAC1C,EAAE,OAAO,UAAU,OAAO,UAAU,eAAe,aAAA;AAAA,EACnD,EAAE,OAAO,WAAW,OAAO,WAAW,eAAe,WAAA;AACzD,GAEMC,IAAc;AAAA,EAChB,EAAE,OAAO,OAAO,OAAO,GAAA;AAAA,EACvB,EAAE,OAAO,SAAS,OAAO,QAAA;AAAA,EACzB,EAAE,OAAO,cAAc,OAAO,aAAA;AAAA,EAC9B,EAAE,OAAO,WAAW,OAAO,UAAA;AAAA,EAC3B,EAAE,OAAO,QAAQ,OAAO,OAAA;AAAA,EACxB,EAAE,OAAO,WAAW,OAAO,UAAA;AAAA,EAC3B,EAAE,OAAO,SAAS,OAAO,QAAA;AAC7B,GAEMC,IAAqB,CAACC,MAEpB,gBAAAC;AAAA,EAACC;AAAAA,EAAA;AAAA,IACI,GAAGF;AAAA,IACJ,aAAa,CAACG,GAAMC,MAChB,gBAAAC,EAAC,QAAA,EAAK,WAAU,2BACZ,UAAA;AAAA,MAAA,gBAAAJ,EAACK,GAAA,EAAM,WAAWH,EAAK,cAAA,CAAe;AAAA,MACtC,gBAAAF,EAAC,UAAM,UAAAG,EAAA,CAAM;AAAA,IAAA,EAAA,CACjB;AAAA,EAAA;AAAA,GAMVG,IAAmB,CAACP,MAElB,gBAAAC;AAAA,EAACC;AAAAA,EAAA;AAAA,IACI,GAAGF;AAAA,IACJ,aAAa,CAACQ,GAAGJ,MAAU,gBAAAH,EAAC,UAAM,UAAAG,EAAA,CAAM;AAAA,EAAA;A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