@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,116 +1,112 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { useState as re, useRef as se } from "react";
|
|
3
|
+
import D from "dayjs";
|
|
4
|
+
import ie from "../hooks/useControllableState.js";
|
|
5
|
+
import ue from "../hooks/useMergeRef.js";
|
|
6
|
+
import h from "../utils/capitalize.js";
|
|
7
|
+
import fe from "./RangeCalendar.js";
|
|
8
|
+
import de from "./BasePicker.js";
|
|
9
9
|
import "../ConfigProvider/index.js";
|
|
10
|
-
import { useConfig as
|
|
11
|
-
const
|
|
10
|
+
import { useConfig as ce } from "../ConfigProvider/ConfigProvider.js";
|
|
11
|
+
const y = (e) => Array.isArray(e) && e.length === 2 && e.every((o) => o instanceof Date), me = (e) => Array.isArray(e) && e.length === 2 && e[0] instanceof Date, Ve = (e) => {
|
|
12
12
|
const {
|
|
13
|
-
className:
|
|
14
|
-
clearable:
|
|
13
|
+
className: o,
|
|
14
|
+
clearable: b = !0,
|
|
15
15
|
clearButton: C,
|
|
16
|
-
closePickerOnChange:
|
|
17
|
-
dateViewCount:
|
|
18
|
-
dayClassName:
|
|
19
|
-
dayStyle:
|
|
20
|
-
defaultMonth:
|
|
21
|
-
defaultOpen:
|
|
22
|
-
defaultValue:
|
|
23
|
-
defaultView:
|
|
24
|
-
disabled:
|
|
25
|
-
disableDate:
|
|
26
|
-
enableHeaderLabel:
|
|
27
|
-
disableOutOfMonth:
|
|
28
|
-
firstDayOfWeek:
|
|
29
|
-
hideOutOfMonthDates:
|
|
30
|
-
hideWeekdays:
|
|
31
|
-
inputFormat:
|
|
32
|
-
inputPrefix:
|
|
33
|
-
inputSuffix:
|
|
34
|
-
labelFormat:
|
|
16
|
+
closePickerOnChange: g = !0,
|
|
17
|
+
dateViewCount: w = 1,
|
|
18
|
+
dayClassName: O,
|
|
19
|
+
dayStyle: M,
|
|
20
|
+
defaultMonth: V,
|
|
21
|
+
defaultOpen: Y = !1,
|
|
22
|
+
defaultValue: i,
|
|
23
|
+
defaultView: k,
|
|
24
|
+
disabled: L,
|
|
25
|
+
disableDate: P,
|
|
26
|
+
enableHeaderLabel: R,
|
|
27
|
+
disableOutOfMonth: x,
|
|
28
|
+
firstDayOfWeek: F = "monday",
|
|
29
|
+
hideOutOfMonthDates: S,
|
|
30
|
+
hideWeekdays: A,
|
|
31
|
+
inputFormat: v,
|
|
32
|
+
inputPrefix: $,
|
|
33
|
+
inputSuffix: j,
|
|
34
|
+
labelFormat: z = {
|
|
35
35
|
month: "MMM",
|
|
36
36
|
year: "YYYY"
|
|
37
37
|
},
|
|
38
|
-
separator:
|
|
39
|
-
locale:
|
|
40
|
-
maxDate:
|
|
41
|
-
minDate:
|
|
42
|
-
onChange:
|
|
43
|
-
onDropdownClose:
|
|
44
|
-
onDropdownOpen:
|
|
45
|
-
openPickerOnClear:
|
|
46
|
-
ref:
|
|
47
|
-
renderDay:
|
|
48
|
-
singleDate:
|
|
49
|
-
size:
|
|
50
|
-
style:
|
|
51
|
-
value:
|
|
52
|
-
weekendDays:
|
|
53
|
-
yearLabelFormat:
|
|
54
|
-
...
|
|
55
|
-
} =
|
|
38
|
+
separator: B = "~",
|
|
39
|
+
locale: N,
|
|
40
|
+
maxDate: T,
|
|
41
|
+
minDate: W,
|
|
42
|
+
onChange: H,
|
|
43
|
+
onDropdownClose: u,
|
|
44
|
+
onDropdownOpen: f,
|
|
45
|
+
openPickerOnClear: _ = !1,
|
|
46
|
+
ref: q = null,
|
|
47
|
+
renderDay: E,
|
|
48
|
+
singleDate: G = !1,
|
|
49
|
+
size: I,
|
|
50
|
+
style: J,
|
|
51
|
+
value: K,
|
|
52
|
+
weekendDays: Q,
|
|
53
|
+
yearLabelFormat: U,
|
|
54
|
+
...X
|
|
55
|
+
} = e, { locale: Z } = ce(), n = N || Z, d = v || "YYYY-MM-DD", [ee, l] = re(Y), r = se(null), [a, c] = ie(
|
|
56
56
|
{
|
|
57
|
-
prop:
|
|
58
|
-
defaultProp:
|
|
59
|
-
onChange:
|
|
57
|
+
prop: K,
|
|
58
|
+
defaultProp: i !== void 0 ? i : [null, null],
|
|
59
|
+
onChange: H
|
|
60
60
|
}
|
|
61
61
|
), ae = (t) => {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}, 0));
|
|
66
|
-
}, oe = b(e), f = pe(e), re = e != null && e[0] ? D(y(e[0]).locale(l).format(d)) : "", ne = e != null && e[1] ? D(y(e[1]).locale(l).format(d)) : "", m = () => {
|
|
67
|
-
var t;
|
|
68
|
-
u([null, null]), s(!0), G && (r == null || r()), (t = i.current) == null || t.focus();
|
|
62
|
+
c(t), g && y(t) && (l(!1), u?.(), window.setTimeout(() => r.current?.focus(), 0));
|
|
63
|
+
}, te = y(a), s = me(a), oe = a?.[0] ? h(D(a[0]).locale(n).format(d)) : "", ne = a?.[1] ? h(D(a[1]).locale(n).format(d)) : "", m = () => {
|
|
64
|
+
c([null, null]), l(!0), _ && f?.(), r.current?.focus();
|
|
69
65
|
}, le = (t) => {
|
|
70
|
-
!t &&
|
|
66
|
+
!t && s && a?.[1] === null && m(), l(t);
|
|
71
67
|
};
|
|
72
|
-
return /* @__PURE__ */
|
|
73
|
-
|
|
68
|
+
return /* @__PURE__ */ p(
|
|
69
|
+
de,
|
|
74
70
|
{
|
|
75
|
-
ref:
|
|
76
|
-
dropdownOpened:
|
|
71
|
+
ref: ue(q, r),
|
|
72
|
+
dropdownOpened: ee,
|
|
77
73
|
setDropdownOpened: le,
|
|
78
|
-
size:
|
|
79
|
-
style:
|
|
80
|
-
className:
|
|
81
|
-
inputLabel:
|
|
82
|
-
clearable:
|
|
74
|
+
size: I,
|
|
75
|
+
style: J,
|
|
76
|
+
className: o,
|
|
77
|
+
inputLabel: s ? `${oe} ${B} ${ne}` : "",
|
|
78
|
+
clearable: b && s,
|
|
83
79
|
clearButton: C,
|
|
84
|
-
disabled:
|
|
85
|
-
inputPrefix:
|
|
86
|
-
inputSuffix:
|
|
80
|
+
disabled: L,
|
|
81
|
+
inputPrefix: $,
|
|
82
|
+
inputSuffix: j,
|
|
87
83
|
onClear: m,
|
|
88
|
-
onDropdownClose:
|
|
89
|
-
onDropdownOpen:
|
|
90
|
-
...
|
|
91
|
-
children: /* @__PURE__ */
|
|
92
|
-
|
|
84
|
+
onDropdownClose: u,
|
|
85
|
+
onDropdownOpen: f,
|
|
86
|
+
...X,
|
|
87
|
+
children: /* @__PURE__ */ p(
|
|
88
|
+
fe,
|
|
93
89
|
{
|
|
94
|
-
locale:
|
|
95
|
-
defaultMonth:
|
|
96
|
-
value:
|
|
97
|
-
labelFormat:
|
|
98
|
-
dayClassName:
|
|
99
|
-
dayStyle:
|
|
100
|
-
disableOutOfMonth:
|
|
101
|
-
minDate:
|
|
102
|
-
maxDate:
|
|
103
|
-
disableDate:
|
|
104
|
-
firstDayOfWeek:
|
|
105
|
-
enableHeaderLabel:
|
|
106
|
-
singleDate:
|
|
107
|
-
dateViewCount:
|
|
108
|
-
defaultView:
|
|
109
|
-
hideOutOfMonthDates:
|
|
110
|
-
hideWeekdays:
|
|
111
|
-
renderDay:
|
|
112
|
-
weekendDays:
|
|
113
|
-
yearLabelFormat:
|
|
90
|
+
locale: n,
|
|
91
|
+
defaultMonth: te ? a?.[0] : V,
|
|
92
|
+
value: a,
|
|
93
|
+
labelFormat: z,
|
|
94
|
+
dayClassName: O,
|
|
95
|
+
dayStyle: M,
|
|
96
|
+
disableOutOfMonth: x,
|
|
97
|
+
minDate: W,
|
|
98
|
+
maxDate: T,
|
|
99
|
+
disableDate: P,
|
|
100
|
+
firstDayOfWeek: F,
|
|
101
|
+
enableHeaderLabel: R,
|
|
102
|
+
singleDate: G,
|
|
103
|
+
dateViewCount: w,
|
|
104
|
+
defaultView: k,
|
|
105
|
+
hideOutOfMonthDates: S,
|
|
106
|
+
hideWeekdays: A,
|
|
107
|
+
renderDay: E,
|
|
108
|
+
weekendDays: Q,
|
|
109
|
+
yearLabelFormat: U,
|
|
114
110
|
onChange: (t) => ae(t)
|
|
115
111
|
}
|
|
116
112
|
)
|
|
@@ -118,6 +114,6 @@ const b = (a) => Array.isArray(a) && a.length === 2 && a.every((n) => n instance
|
|
|
118
114
|
);
|
|
119
115
|
};
|
|
120
116
|
export {
|
|
121
|
-
|
|
117
|
+
Ve as default
|
|
122
118
|
};
|
|
123
119
|
//# sourceMappingURL=DatePickerRange.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePickerRange.js","sources":["../../../../../lib/@ecme/components/ui/DatePicker/DatePickerRange.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { useState, useRef } from 'react'\nimport dayjs from 'dayjs'\nimport useControllableState from '../hooks/useControllableState'\nimport useMergedRef from '../hooks/useMergeRef'\nimport capitalize from '../utils/capitalize'\nimport RangeCalendar from './RangeCalendar'\nimport BasePicker from './BasePicker'\nimport { useConfig } from '../ConfigProvider'\nimport type { CommonProps } from '../@types/common'\nimport type { CalendarSharedProps } from './CalendarBase'\nimport type { BasePickerSharedProps } from './BasePicker'\nimport type { Ref } from 'react'\n\nexport type DatePickerRangeValue = [Date | null, Date | null]\n\nexport interface DatePickerRangeProps\n extends CommonProps,\n Omit<\n CalendarSharedProps,\n | 'onMonthChange'\n | 'onChange'\n | 'isDateInRange'\n | 'isDateFirstInRange'\n | 'isDateLastInRange'\n | 'month'\n >,\n BasePickerSharedProps {\n closePickerOnChange?: boolean\n defaultOpen?: boolean\n defaultValue?: DatePickerRangeValue\n inputFormat?: string\n separator?: string\n onChange?: (value: DatePickerRangeValue) => void\n openPickerOnClear?: boolean\n ref?: Ref<HTMLInputElement>\n singleDate?: boolean\n value?: DatePickerRangeValue\n}\n\nconst validationRule = (val: any) =>\n Array.isArray(val) &&\n val.length === 2 &&\n val.every((v) => v instanceof Date)\n\nconst isFirstDateSet = (val: any) =>\n Array.isArray(val) && val.length === 2 && val[0] instanceof Date\n\nconst DatePickerRange = (props: DatePickerRangeProps) => {\n const {\n className,\n clearable = true,\n clearButton,\n closePickerOnChange = true,\n dateViewCount = 1,\n dayClassName,\n dayStyle,\n defaultMonth,\n defaultOpen = false,\n defaultValue,\n defaultView,\n disabled,\n disableDate,\n enableHeaderLabel,\n disableOutOfMonth,\n firstDayOfWeek = 'monday',\n hideOutOfMonthDates,\n hideWeekdays,\n inputFormat,\n inputPrefix,\n inputSuffix,\n labelFormat = {\n month: 'MMM',\n year: 'YYYY',\n },\n separator = '~',\n locale,\n maxDate,\n minDate,\n onChange,\n onDropdownClose,\n onDropdownOpen,\n openPickerOnClear = false,\n ref = null,\n renderDay,\n singleDate = false,\n size,\n style,\n value,\n weekendDays,\n yearLabelFormat,\n ...rest\n } = props\n\n const { locale: themeLocale } = useConfig()\n\n const finalLocale = locale || themeLocale\n\n const dateFormat = inputFormat || 'YYYY-MM-DD'\n\n const [dropdownOpened, setDropdownOpened] = useState(defaultOpen)\n\n const inputRef = useRef<HTMLInputElement>(null)\n\n const [_value, setValue] = useControllableState<[Date | null, Date | null]>(\n {\n prop: value,\n defaultProp:\n defaultValue !== undefined ? defaultValue : [null, null],\n onChange,\n },\n )\n\n const handleValueChange = (range: [Date, Date]) => {\n setValue(range)\n if (closePickerOnChange && validationRule(range)) {\n setDropdownOpened(false)\n onDropdownClose?.()\n window.setTimeout(() => inputRef.current?.focus(), 0)\n }\n }\n\n const valueValid = validationRule(_value)\n const firstValueValid = isFirstDateSet(_value)\n\n const firstDateLabel = _value?.[0]\n ? capitalize(dayjs(_value[0]).locale(finalLocale).format(dateFormat))\n : ''\n\n const secondDateLabel = _value?.[1]\n ? capitalize(dayjs(_value[1]).locale(finalLocale).format(dateFormat))\n : ''\n\n const handleClear = () => {\n setValue([null, null])\n setDropdownOpened(true)\n openPickerOnClear && onDropdownOpen?.()\n inputRef.current?.focus()\n }\n\n const handleDropdownToggle = (isOpened: boolean) => {\n if (!isOpened && firstValueValid && _value?.[1] === null) {\n handleClear()\n }\n setDropdownOpened(isOpened)\n }\n\n return (\n <BasePicker\n ref={useMergedRef(ref, inputRef)}\n dropdownOpened={dropdownOpened as boolean}\n setDropdownOpened={handleDropdownToggle}\n size={size}\n style={style}\n className={className}\n inputLabel={\n firstValueValid\n ? `${firstDateLabel} ${separator} ${secondDateLabel}`\n : ''\n }\n clearable={clearable && firstValueValid}\n clearButton={clearButton}\n disabled={disabled}\n inputPrefix={inputPrefix}\n inputSuffix={inputSuffix}\n onClear={handleClear}\n onDropdownClose={onDropdownClose}\n onDropdownOpen={onDropdownOpen}\n {...rest}\n >\n <RangeCalendar\n locale={finalLocale}\n defaultMonth={(valueValid ? _value?.[0] : defaultMonth) as Date}\n value={_value as [Date | null, Date | null]}\n labelFormat={labelFormat}\n dayClassName={dayClassName}\n dayStyle={dayStyle}\n disableOutOfMonth={disableOutOfMonth}\n minDate={minDate}\n maxDate={maxDate}\n disableDate={disableDate}\n firstDayOfWeek={firstDayOfWeek}\n enableHeaderLabel={enableHeaderLabel}\n singleDate={singleDate}\n dateViewCount={dateViewCount}\n defaultView={defaultView}\n hideOutOfMonthDates={hideOutOfMonthDates}\n hideWeekdays={hideWeekdays}\n renderDay={renderDay}\n weekendDays={weekendDays}\n yearLabelFormat={yearLabelFormat}\n onChange={(date) => handleValueChange(date as [Date, Date])}\n />\n </BasePicker>\n )\n}\n\nexport default DatePickerRange\n"],"names":["validationRule","val","v","isFirstDateSet","DatePickerRange","props","className","clearable","clearButton","closePickerOnChange","dateViewCount","dayClassName","dayStyle","defaultMonth","defaultOpen","defaultValue","defaultView","disabled","disableDate","enableHeaderLabel","disableOutOfMonth","firstDayOfWeek","hideOutOfMonthDates","hideWeekdays","inputFormat","inputPrefix","inputSuffix","labelFormat","separator","locale","maxDate","minDate","onChange","onDropdownClose","onDropdownOpen","openPickerOnClear","ref","renderDay","singleDate","size","style","value","weekendDays","yearLabelFormat","rest","themeLocale","useConfig","finalLocale","dateFormat","dropdownOpened","setDropdownOpened","useState","inputRef","useRef","_value","setValue","useControllableState","handleValueChange","range","_a","valueValid","firstValueValid","firstDateLabel","capitalize","dayjs","secondDateLabel","handleClear","handleDropdownToggle","isOpened","jsx","BasePicker","useMergedRef","RangeCalendar","date"],"mappings":";;;;;;;;;;AAwCA,MAAMA,IAAiB,CAACC,MACpB,MAAM,QAAQA,CAAG,KACjBA,EAAI,WAAW,KACfA,EAAI,MAAM,CAACC,MAAMA,aAAa,IAAI,GAEhCC,KAAiB,CAACF,MACpB,MAAM,QAAQA,CAAG,KAAKA,EAAI,WAAW,KAAKA,EAAI,CAAC,aAAa,MAE1DG,KAAkB,CAACC,MAAgC;AACrD,QAAM;AAAA,IACF,WAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,aAAAC;AAAA,IACA,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UACG,QAAQzB;AAAA,UACR,cAAea,KAAaN,KAAA,gBAAAA,EAAS,KAAKzC;AAAA,UAC1C,OAAOyC;AAAA,UACP,aAAA3B;AAAA,UACA,cAAAhB;AAAA,UACA,UAAAC;AAAA,UACA,mBAAAQ;AAAA,UACA,SAAAW;AAAA,UACA,SAAAD;AAAA,UACA,aAAAZ;AAAA,UACA,gBAAAG;AAAA,UACA,mBAAAF;AAAA,UACA,YAAAmB;AAAA,UACA,eAAA5B;AAAA,UACA,aAAAM;AAAA,UACA,qBAAAM;AAAA,UACA,cAAAC;AAAA,UACA,WAAAc;AAAA,UACA,aAAAK;AAAA,UACA,iBAAAC;AAAA,UACA,UAAU,CAAC8B,MAAShB,GAAkBgB,CAAoB;AAAA,QAAA;AAAA,MAAA;AAAA,IAC9D;AAAA,EAAA;AAGZ;"}
|
|
1
|
+
{"version":3,"file":"DatePickerRange.js","sources":["../../../../../lib/@ecme/components/ui/DatePicker/DatePickerRange.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { useState, useRef } from 'react'\nimport dayjs from 'dayjs'\nimport useControllableState from '../hooks/useControllableState'\nimport useMergedRef from '../hooks/useMergeRef'\nimport capitalize from '../utils/capitalize'\nimport RangeCalendar from './RangeCalendar'\nimport BasePicker from './BasePicker'\nimport { useConfig } from '../ConfigProvider'\nimport type { CommonProps } from '../@types/common'\nimport type { CalendarSharedProps } from './CalendarBase'\nimport type { BasePickerSharedProps } from './BasePicker'\nimport type { Ref } from 'react'\n\nexport type DatePickerRangeValue = [Date | null, Date | null]\n\nexport interface DatePickerRangeProps\n extends CommonProps,\n Omit<\n CalendarSharedProps,\n | 'onMonthChange'\n | 'onChange'\n | 'isDateInRange'\n | 'isDateFirstInRange'\n | 'isDateLastInRange'\n | 'month'\n >,\n BasePickerSharedProps {\n closePickerOnChange?: boolean\n defaultOpen?: boolean\n defaultValue?: DatePickerRangeValue\n inputFormat?: string\n separator?: string\n onChange?: (value: DatePickerRangeValue) => void\n openPickerOnClear?: boolean\n ref?: Ref<HTMLInputElement>\n singleDate?: boolean\n value?: DatePickerRangeValue\n}\n\nconst validationRule = (val: any) =>\n Array.isArray(val) &&\n val.length === 2 &&\n val.every((v) => v instanceof Date)\n\nconst isFirstDateSet = (val: any) =>\n Array.isArray(val) && val.length === 2 && val[0] instanceof Date\n\nconst DatePickerRange = (props: DatePickerRangeProps) => {\n const {\n className,\n clearable = true,\n clearButton,\n closePickerOnChange = true,\n dateViewCount = 1,\n dayClassName,\n dayStyle,\n defaultMonth,\n defaultOpen = false,\n defaultValue,\n defaultView,\n disabled,\n disableDate,\n enableHeaderLabel,\n disableOutOfMonth,\n firstDayOfWeek = 'monday',\n hideOutOfMonthDates,\n hideWeekdays,\n inputFormat,\n inputPrefix,\n inputSuffix,\n labelFormat = {\n month: 'MMM',\n year: 'YYYY',\n },\n separator = '~',\n locale,\n maxDate,\n minDate,\n onChange,\n onDropdownClose,\n onDropdownOpen,\n openPickerOnClear = false,\n ref = null,\n renderDay,\n singleDate = false,\n size,\n style,\n value,\n weekendDays,\n yearLabelFormat,\n ...rest\n } = props\n\n const { locale: themeLocale } = useConfig()\n\n const finalLocale = locale || themeLocale\n\n const dateFormat = inputFormat || 'YYYY-MM-DD'\n\n const [dropdownOpened, setDropdownOpened] = useState(defaultOpen)\n\n const inputRef = useRef<HTMLInputElement>(null)\n\n const [_value, setValue] = useControllableState<[Date | null, Date | null]>(\n {\n prop: value,\n defaultProp:\n defaultValue !== undefined ? defaultValue : [null, null],\n onChange,\n },\n )\n\n const handleValueChange = (range: [Date, Date]) => {\n setValue(range)\n if (closePickerOnChange && validationRule(range)) {\n setDropdownOpened(false)\n onDropdownClose?.()\n window.setTimeout(() => inputRef.current?.focus(), 0)\n }\n }\n\n const valueValid = validationRule(_value)\n const firstValueValid = isFirstDateSet(_value)\n\n const firstDateLabel = _value?.[0]\n ? capitalize(dayjs(_value[0]).locale(finalLocale).format(dateFormat))\n : ''\n\n const secondDateLabel = _value?.[1]\n ? capitalize(dayjs(_value[1]).locale(finalLocale).format(dateFormat))\n : ''\n\n const handleClear = () => {\n setValue([null, null])\n setDropdownOpened(true)\n openPickerOnClear && onDropdownOpen?.()\n inputRef.current?.focus()\n }\n\n const handleDropdownToggle = (isOpened: boolean) => {\n if (!isOpened && firstValueValid && _value?.[1] === null) {\n handleClear()\n }\n setDropdownOpened(isOpened)\n }\n\n return (\n <BasePicker\n ref={useMergedRef(ref, inputRef)}\n dropdownOpened={dropdownOpened as boolean}\n setDropdownOpened={handleDropdownToggle}\n size={size}\n style={style}\n className={className}\n inputLabel={\n firstValueValid\n ? `${firstDateLabel} ${separator} ${secondDateLabel}`\n : ''\n }\n clearable={clearable && firstValueValid}\n clearButton={clearButton}\n disabled={disabled}\n inputPrefix={inputPrefix}\n inputSuffix={inputSuffix}\n onClear={handleClear}\n onDropdownClose={onDropdownClose}\n onDropdownOpen={onDropdownOpen}\n {...rest}\n >\n <RangeCalendar\n locale={finalLocale}\n defaultMonth={(valueValid ? _value?.[0] : defaultMonth) as Date}\n value={_value as [Date | null, Date | null]}\n labelFormat={labelFormat}\n dayClassName={dayClassName}\n dayStyle={dayStyle}\n disableOutOfMonth={disableOutOfMonth}\n minDate={minDate}\n maxDate={maxDate}\n disableDate={disableDate}\n firstDayOfWeek={firstDayOfWeek}\n enableHeaderLabel={enableHeaderLabel}\n singleDate={singleDate}\n dateViewCount={dateViewCount}\n defaultView={defaultView}\n hideOutOfMonthDates={hideOutOfMonthDates}\n hideWeekdays={hideWeekdays}\n renderDay={renderDay}\n weekendDays={weekendDays}\n yearLabelFormat={yearLabelFormat}\n onChange={(date) => handleValueChange(date as [Date, Date])}\n />\n </BasePicker>\n )\n}\n\nexport default DatePickerRange\n"],"names":["validationRule","val","v","isFirstDateSet","DatePickerRange","props","className","clearable","clearButton","closePickerOnChange","dateViewCount","dayClassName","dayStyle","defaultMonth","defaultOpen","defaultValue","defaultView","disabled","disableDate","enableHeaderLabel","disableOutOfMonth","firstDayOfWeek","hideOutOfMonthDates","hideWeekdays","inputFormat","inputPrefix","inputSuffix","labelFormat","separator","locale","maxDate","minDate","onChange","onDropdownClose","onDropdownOpen","openPickerOnClear","ref","renderDay","singleDate","size","style","value","weekendDays","yearLabelFormat","rest","themeLocale","useConfig","finalLocale","dateFormat","dropdownOpened","setDropdownOpened","useState","inputRef","useRef","_value","setValue","useControllableState","handleValueChange","range","valueValid","firstValueValid","firstDateLabel","capitalize","dayjs","secondDateLabel","handleClear","handleDropdownToggle","isOpened","jsx","BasePicker","useMergedRef","RangeCalendar","date"],"mappings":";;;;;;;;;;AAwCA,MAAMA,IAAiB,CAACC,MACpB,MAAM,QAAQA,CAAG,KACjBA,EAAI,WAAW,KACfA,EAAI,MAAM,CAACC,MAAMA,aAAa,IAAI,GAEhCC,KAAiB,CAACF,MACpB,MAAM,QAAQA,CAAG,KAAKA,EAAI,WAAW,KAAKA,EAAI,CAAC,aAAa,MAE1DG,KAAkB,CAACC,MAAgC;AACrD,QAAM;AAAA,IACF,WAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,aAAAC;AAAA,IACA,qBAAAC,IAAsB;AAAA,IACtB,eAAAC,IAAgB;AAAA,IAChB,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC,IAAc;AAAA,IACd,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,gBAAAC,IAAiB;AAAA,IACjB,qBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC,IAAc;AAAA,MACV,OAAO;AAAA,MACP,MAAM;AAAA,IAAA;AAAA,IAEV,WAAAC,IAAY;AAAA,IACZ,QAAAC;AAAA,IACA,SAAAC;AAAA,IACA,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,iBAAAC;AAAA,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
|
+
import { useState as u, useRef as we, useEffect as be } from "react";
|
|
3
3
|
import n from "dayjs";
|
|
4
4
|
import ye from "../hooks/useControllableState.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
5
|
+
import Oe from "../hooks/useMergeRef.js";
|
|
6
|
+
import c from "../utils/capitalize.js";
|
|
7
|
+
import Fe from "../TimeInput/TimeInput.js";
|
|
8
8
|
import ke from "./Calendar.js";
|
|
9
9
|
import Te from "./BasePicker.js";
|
|
10
10
|
import Ye from "../Button/Button.js";
|
|
@@ -19,11 +19,11 @@ const Ve = "DD-MMM-YYYY hh:mm a", xe = (x) => {
|
|
|
19
19
|
dateViewCount: B,
|
|
20
20
|
dayClassName: H,
|
|
21
21
|
dayStyle: I,
|
|
22
|
-
defaultMonth:
|
|
22
|
+
defaultMonth: M,
|
|
23
23
|
defaultOpen: N = !1,
|
|
24
24
|
defaultValue: C,
|
|
25
25
|
defaultView: z,
|
|
26
|
-
disabled:
|
|
26
|
+
disabled: w = !1,
|
|
27
27
|
disableDate: R,
|
|
28
28
|
enableHeaderLabel: _,
|
|
29
29
|
disableOutOfMonth: j,
|
|
@@ -43,35 +43,35 @@ const Ve = "DD-MMM-YYYY hh:mm a", xe = (x) => {
|
|
|
43
43
|
minDate: Z,
|
|
44
44
|
name: $ = "dateTime",
|
|
45
45
|
okButtonContent: ee = "OK",
|
|
46
|
-
onBlur:
|
|
47
|
-
onChange:
|
|
48
|
-
onFocus:
|
|
49
|
-
onDropdownClose:
|
|
50
|
-
onDropdownOpen:
|
|
46
|
+
onBlur: b,
|
|
47
|
+
onChange: d,
|
|
48
|
+
onFocus: y,
|
|
49
|
+
onDropdownClose: O,
|
|
50
|
+
onDropdownOpen: F,
|
|
51
51
|
openPickerOnClear: te,
|
|
52
52
|
ref: ae = null,
|
|
53
53
|
renderDay: oe,
|
|
54
54
|
size: ne,
|
|
55
|
-
value:
|
|
55
|
+
value: i,
|
|
56
56
|
weekendDays: le,
|
|
57
57
|
yearLabelFormat: se,
|
|
58
58
|
...re
|
|
59
|
-
} = x, { locale: ie } = ve(), l = Q || ie, r = W || Ve, [ue,
|
|
60
|
-
prop:
|
|
59
|
+
} = x, { locale: ie } = ve(), l = Q || ie, r = W || Ve, [ue, p] = u(N), f = we(null), [Le, k] = u(C ?? null), [t, m] = ye({
|
|
60
|
+
prop: i,
|
|
61
61
|
defaultProp: C,
|
|
62
|
-
onChange:
|
|
63
|
-
}), [ce, T] =
|
|
64
|
-
t ||
|
|
65
|
-
), [
|
|
66
|
-
t instanceof Date ?
|
|
67
|
-
),
|
|
68
|
-
|
|
62
|
+
onChange: d
|
|
63
|
+
}), [ce, T] = u(
|
|
64
|
+
t || M || /* @__PURE__ */ new Date()
|
|
65
|
+
), [h, Y] = u(!1), [fe, o] = u(
|
|
66
|
+
t instanceof Date ? c(n(t).locale(l).format(r)) : ""
|
|
67
|
+
), D = () => {
|
|
68
|
+
p(!1), O?.();
|
|
69
69
|
}, v = () => {
|
|
70
|
-
|
|
70
|
+
p(!0), F?.();
|
|
71
71
|
};
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}, [
|
|
72
|
+
be(() => {
|
|
73
|
+
i === null && !h && o(""), i instanceof Date && !h && o(n(i).locale(l).format(r));
|
|
74
|
+
}, [i, h]);
|
|
75
75
|
const me = (e) => {
|
|
76
76
|
if (t)
|
|
77
77
|
e.setHours(t.getHours()), e.setMinutes(t.getMinutes());
|
|
@@ -79,23 +79,19 @@ const Ve = "DD-MMM-YYYY hh:mm a", xe = (x) => {
|
|
|
79
79
|
const a = new Date(Date.now());
|
|
80
80
|
e.setHours(a.getHours()), e.setMinutes(a.getMinutes());
|
|
81
81
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
), s &&
|
|
85
|
-
var a;
|
|
86
|
-
return (a = p.current) == null ? void 0 : a.focus();
|
|
87
|
-
}, 0);
|
|
82
|
+
m(e), !i && !s && o(n(e).locale(l).format(r)), s && o(
|
|
83
|
+
c(n(e).locale(l).format(r))
|
|
84
|
+
), s && D(), window.setTimeout(() => f.current?.focus(), 0);
|
|
88
85
|
}, de = () => {
|
|
89
|
-
|
|
90
|
-
h(null), k(null), o(""), te && v(), (e = p.current) == null || e.focus(), i == null || i(null);
|
|
86
|
+
m(null), k(null), o(""), te && v(), f.current?.focus(), d?.(null);
|
|
91
87
|
}, pe = (e) => n(e, r, l).toDate(), he = (e) => {
|
|
92
|
-
typeof
|
|
88
|
+
typeof b == "function" && b(e), Y(!1);
|
|
93
89
|
}, De = (e) => {
|
|
94
|
-
typeof
|
|
90
|
+
typeof y == "function" && y(e), Y(!0);
|
|
95
91
|
}, ge = (e) => {
|
|
96
92
|
v();
|
|
97
93
|
const a = pe(e.target.value);
|
|
98
|
-
n(a).isValid() ? (
|
|
94
|
+
n(a).isValid() ? (m(a), k(a), s && o(e.target.value), T(a)) : s && o(e.target.value);
|
|
99
95
|
}, Me = (e) => {
|
|
100
96
|
if (t instanceof Date && e instanceof Date) {
|
|
101
97
|
const a = new Date(
|
|
@@ -107,36 +103,33 @@ const Ve = "DD-MMM-YYYY hh:mm a", xe = (x) => {
|
|
|
107
103
|
e.getSeconds(),
|
|
108
104
|
e.getMilliseconds()
|
|
109
105
|
);
|
|
110
|
-
|
|
111
|
-
|
|
106
|
+
m(a), !i && !s && o(
|
|
107
|
+
c(
|
|
112
108
|
n(a).locale(l).format(r)
|
|
113
109
|
)
|
|
114
110
|
), s && o(
|
|
115
|
-
|
|
111
|
+
c(
|
|
116
112
|
n(a).locale(l).format(r)
|
|
117
113
|
)
|
|
118
114
|
);
|
|
119
115
|
}
|
|
120
|
-
s &&
|
|
121
|
-
},
|
|
116
|
+
s && D();
|
|
117
|
+
}, Ce = () => {
|
|
122
118
|
o(
|
|
123
|
-
|
|
124
|
-
),
|
|
125
|
-
var e;
|
|
126
|
-
return (e = p.current) == null ? void 0 : e.focus();
|
|
127
|
-
}, 0), i == null || i(t);
|
|
119
|
+
c(n(t).locale(l).format(r))
|
|
120
|
+
), D(), window.setTimeout(() => f.current?.focus(), 0), d?.(t);
|
|
128
121
|
};
|
|
129
122
|
return /* @__PURE__ */ V(
|
|
130
123
|
Te,
|
|
131
124
|
{
|
|
132
|
-
ref:
|
|
125
|
+
ref: Oe(ae, f),
|
|
133
126
|
dropdownOpened: ue,
|
|
134
|
-
setDropdownOpened:
|
|
127
|
+
setDropdownOpened: p,
|
|
135
128
|
className: P,
|
|
136
129
|
name: $,
|
|
137
130
|
inputLabel: fe,
|
|
138
|
-
clearable: S && !!t && !
|
|
139
|
-
disabled:
|
|
131
|
+
clearable: S && !!t && !w,
|
|
132
|
+
disabled: w,
|
|
140
133
|
size: ne,
|
|
141
134
|
inputPrefix: K,
|
|
142
135
|
inputSuffix: q,
|
|
@@ -144,16 +137,16 @@ const Ve = "DD-MMM-YYYY hh:mm a", xe = (x) => {
|
|
|
144
137
|
onBlur: he,
|
|
145
138
|
onFocus: De,
|
|
146
139
|
onClear: de,
|
|
147
|
-
onDropdownClose:
|
|
148
|
-
onDropdownOpen:
|
|
140
|
+
onDropdownClose: O,
|
|
141
|
+
onDropdownOpen: F,
|
|
149
142
|
...re,
|
|
150
143
|
children: [
|
|
151
|
-
/* @__PURE__ */
|
|
144
|
+
/* @__PURE__ */ g(
|
|
152
145
|
ke,
|
|
153
146
|
{
|
|
154
147
|
locale: l,
|
|
155
148
|
month: G ? ce : void 0,
|
|
156
|
-
defaultMonth:
|
|
149
|
+
defaultMonth: M || (t instanceof Date ? t : /* @__PURE__ */ new Date()),
|
|
157
150
|
value: t instanceof Date ? t : t && n(t).toDate(),
|
|
158
151
|
labelFormat: J,
|
|
159
152
|
dayClassName: H,
|
|
@@ -177,8 +170,8 @@ const Ve = "DD-MMM-YYYY hh:mm a", xe = (x) => {
|
|
|
177
170
|
}
|
|
178
171
|
),
|
|
179
172
|
/* @__PURE__ */ V("div", { className: "flex items-center gap-4 mt-4", children: [
|
|
180
|
-
/* @__PURE__ */
|
|
181
|
-
|
|
173
|
+
/* @__PURE__ */ g(
|
|
174
|
+
Fe,
|
|
182
175
|
{
|
|
183
176
|
disabled: !t,
|
|
184
177
|
value: t,
|
|
@@ -188,7 +181,7 @@ const Ve = "DD-MMM-YYYY hh:mm a", xe = (x) => {
|
|
|
188
181
|
onChange: Me
|
|
189
182
|
}
|
|
190
183
|
),
|
|
191
|
-
/* @__PURE__ */
|
|
184
|
+
/* @__PURE__ */ g(Ye, { size: "sm", disabled: !t, onClick: Ce, children: ee })
|
|
192
185
|
] })
|
|
193
186
|
]
|
|
194
187
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimepicker.js","sources":["../../../../../lib/@ecme/components/ui/DatePicker/DateTimepicker.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react'\r\nimport dayjs from 'dayjs'\r\nimport useControllableState from '../hooks/useControllableState'\r\nimport useMergedRef from '../hooks/useMergeRef'\r\nimport capitalize from '../utils/capitalize'\r\nimport TimeInput from '../TimeInput/TimeInput'\r\nimport Calendar from './Calendar'\r\nimport BasePicker from './BasePicker'\r\nimport Button from '../Button/Button'\r\nimport { useConfig } from '../ConfigProvider'\r\nimport type { CommonProps } from '../@types/common'\r\nimport type { CalendarSharedProps } from './CalendarBase'\r\nimport type { BasePickerSharedProps } from './BasePicker'\r\nimport type { FocusEvent, ChangeEvent, Ref } from 'react'\r\n\r\nexport interface DateTimepickerProps\r\n extends CommonProps,\r\n Omit<\r\n CalendarSharedProps,\r\n | 'onMonthChange'\r\n | 'onChange'\r\n | 'isDateInRange'\r\n | 'isDateFirstInRange'\r\n | 'isDateLastInRange'\r\n | 'month'\r\n >,\r\n BasePickerSharedProps {\r\n closePickerOnChange?: boolean\r\n defaultOpen?: boolean\r\n defaultValue?: Date | null\r\n value?: Date | null\r\n inputFormat?: string\r\n openPickerOnClear?: boolean\r\n onChange?: (value: Date | null) => void\r\n ref?: Ref<HTMLInputElement>\r\n amPm?: boolean\r\n okButtonContent?: boolean\r\n}\r\n\r\nconst DEFAULT_INPUT_FORMAT = 'DD-MMM-YYYY hh:mm a'\r\n\r\nconst DateTimepicker = (props: DateTimepickerProps) => {\r\n const {\r\n amPm = true,\r\n className,\r\n clearable = true,\r\n closePickerOnChange = false,\r\n dateViewCount,\r\n dayClassName,\r\n dayStyle,\r\n defaultMonth,\r\n defaultOpen = false,\r\n defaultValue,\r\n defaultView,\r\n disabled = false,\r\n disableDate,\r\n enableHeaderLabel,\r\n disableOutOfMonth,\r\n firstDayOfWeek = 'monday',\r\n hideOutOfMonthDates,\r\n hideWeekdays,\r\n inputFormat,\r\n inputPrefix,\r\n inputSuffix,\r\n inputtable,\r\n labelFormat = {\r\n month: 'MMM',\r\n year: 'YYYY',\r\n },\r\n locale,\r\n maxDate,\r\n minDate,\r\n name = 'dateTime',\r\n okButtonContent = 'OK',\r\n onBlur,\r\n onChange,\r\n onFocus,\r\n onDropdownClose,\r\n onDropdownOpen,\r\n openPickerOnClear,\r\n ref = null,\r\n renderDay,\r\n size,\r\n value,\r\n weekendDays,\r\n yearLabelFormat,\r\n ...rest\r\n } = props\r\n\r\n const { locale: themeLocale } = useConfig()\r\n\r\n const finalLocale = locale || themeLocale\r\n\r\n const dateFormat = inputFormat || DEFAULT_INPUT_FORMAT\r\n\r\n const [dropdownOpened, setDropdownOpened] = useState(defaultOpen)\r\n\r\n const inputRef = useRef<HTMLInputElement>(null)\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const [_, setLastValidValue] = useState(defaultValue ?? null)\r\n const [_value, setValue] = useControllableState({\r\n prop: value,\r\n defaultProp: defaultValue,\r\n onChange,\r\n })\r\n\r\n const [calendarMonth, setCalendarMonth] = useState(\r\n _value || defaultMonth || new Date(),\r\n )\r\n\r\n const [focused, setFocused] = useState(false)\r\n const [inputState, setInputState] = useState(\r\n _value instanceof Date\r\n ? capitalize(dayjs(_value).locale(finalLocale).format(dateFormat))\r\n : '',\r\n )\r\n\r\n const closeDropdown = () => {\r\n setDropdownOpened(false)\r\n onDropdownClose?.()\r\n }\r\n\r\n const openDropdown = () => {\r\n setDropdownOpened(true)\r\n onDropdownOpen?.()\r\n }\r\n\r\n useEffect(() => {\r\n if (value === null && !focused) {\r\n setInputState('')\r\n }\r\n\r\n if (value instanceof Date && !focused) {\r\n setInputState(dayjs(value).locale(finalLocale).format(dateFormat))\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [value, focused])\r\n\r\n const handleValueChange = (date: Date) => {\r\n if (_value) {\r\n date.setHours(_value.getHours())\r\n date.setMinutes(_value.getMinutes())\r\n } else {\r\n const now = new Date(Date.now())\r\n date.setHours(now.getHours())\r\n date.setMinutes(now.getMinutes())\r\n }\r\n setValue(date)\r\n if (!value && !closePickerOnChange) {\r\n setInputState(dayjs(date).locale(finalLocale).format(dateFormat))\r\n }\r\n closePickerOnChange &&\r\n setInputState(\r\n capitalize(dayjs(date).locale(finalLocale).format(dateFormat)),\r\n )\r\n closePickerOnChange && closeDropdown()\r\n window.setTimeout(() => inputRef.current?.focus(), 0)\r\n }\r\n\r\n const handleClear = () => {\r\n setValue(null)\r\n setLastValidValue(null)\r\n setInputState('')\r\n openPickerOnClear && openDropdown()\r\n inputRef.current?.focus()\r\n onChange?.(null)\r\n }\r\n\r\n const parseDate = (date: string) =>\r\n dayjs(date, dateFormat, finalLocale).toDate()\r\n\r\n const handleInputBlur = (event: FocusEvent<HTMLInputElement, Element>) => {\r\n typeof onBlur === 'function' && onBlur(event)\r\n setFocused(false)\r\n }\r\n\r\n const handleInputFocus = (event: FocusEvent<HTMLInputElement, Element>) => {\r\n typeof onFocus === 'function' && onFocus(event)\r\n setFocused(true)\r\n }\r\n\r\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\r\n openDropdown()\r\n\r\n const date = parseDate(event.target.value)\r\n if (dayjs(date).isValid()) {\r\n setValue(date)\r\n setLastValidValue(date)\r\n closePickerOnChange && setInputState(event.target.value)\r\n setCalendarMonth(date)\r\n } else {\r\n closePickerOnChange && setInputState(event.target.value)\r\n }\r\n }\r\n\r\n const handleTimeChange = (time: Date | null) => {\r\n if (_value instanceof Date && time instanceof Date) {\r\n const newDateTime = new Date(\r\n _value.getFullYear(),\r\n _value.getMonth(),\r\n _value.getDate(),\r\n time.getHours(),\r\n time.getMinutes(),\r\n time.getSeconds(),\r\n time.getMilliseconds(),\r\n )\r\n setValue(newDateTime)\r\n\r\n if (!value && !closePickerOnChange) {\r\n setInputState(\r\n capitalize(\r\n dayjs(newDateTime)\r\n .locale(finalLocale)\r\n .format(dateFormat),\r\n ),\r\n )\r\n }\r\n\r\n closePickerOnChange &&\r\n setInputState(\r\n capitalize(\r\n dayjs(newDateTime)\r\n .locale(finalLocale)\r\n .format(dateFormat),\r\n ),\r\n )\r\n }\r\n closePickerOnChange && closeDropdown()\r\n }\r\n\r\n const handleOk = () => {\r\n setInputState(\r\n capitalize(dayjs(_value).locale(finalLocale).format(dateFormat)),\r\n )\r\n closeDropdown()\r\n window.setTimeout(() => inputRef.current?.focus(), 0)\r\n onChange?.(_value as Date | null)\r\n }\r\n\r\n return (\r\n <BasePicker\r\n ref={useMergedRef(ref, inputRef)}\r\n dropdownOpened={dropdownOpened as boolean}\r\n setDropdownOpened={setDropdownOpened}\r\n className={className}\r\n name={name}\r\n inputLabel={inputState}\r\n clearable={clearable && !!_value && !disabled}\r\n disabled={disabled}\r\n size={size}\r\n inputPrefix={inputPrefix}\r\n inputSuffix={inputSuffix}\r\n onChange={handleChange}\r\n onBlur={handleInputBlur}\r\n onFocus={handleInputFocus}\r\n onClear={handleClear}\r\n onDropdownClose={onDropdownClose}\r\n onDropdownOpen={onDropdownOpen}\r\n {...rest}\r\n >\r\n <Calendar\r\n locale={finalLocale}\r\n month={inputtable ? calendarMonth : undefined}\r\n defaultMonth={\r\n defaultMonth ||\r\n (_value instanceof Date ? _value : new Date())\r\n }\r\n value={\r\n _value instanceof Date\r\n ? _value\r\n : _value && dayjs(_value).toDate()\r\n }\r\n labelFormat={labelFormat}\r\n dayClassName={dayClassName}\r\n dayStyle={dayStyle}\r\n disableOutOfMonth={disableOutOfMonth}\r\n minDate={minDate}\r\n maxDate={maxDate}\r\n disableDate={disableDate}\r\n firstDayOfWeek={firstDayOfWeek}\r\n preventFocus={false}\r\n dateViewCount={dateViewCount}\r\n enableHeaderLabel={enableHeaderLabel}\r\n defaultView={defaultView}\r\n hideOutOfMonthDates={hideOutOfMonthDates}\r\n hideWeekdays={hideWeekdays}\r\n renderDay={renderDay}\r\n weekendDays={weekendDays}\r\n yearLabelFormat={yearLabelFormat}\r\n onMonthChange={setCalendarMonth}\r\n onChange={handleValueChange}\r\n />\r\n <div className=\"flex items-center gap-4 mt-4\">\r\n <TimeInput\r\n disabled={!_value}\r\n value={_value}\r\n format={amPm ? '12' : '24'}\r\n clearable={false}\r\n size=\"sm\"\r\n onChange={handleTimeChange}\r\n />\r\n <Button size=\"sm\" disabled={!_value} onClick={handleOk}>\r\n {okButtonContent}\r\n </Button>\r\n </div>\r\n </BasePicker>\r\n )\r\n}\r\n\r\nDateTimepicker.displayName = 'DateTimepicker'\r\n\r\nexport default DateTimepicker\r\n"],"names":["DEFAULT_INPUT_FORMAT","DateTimepicker","props","amPm","className","clearable","closePickerOnChange","dateViewCount","dayClassName","dayStyle","defaultMonth","defaultOpen","defaultValue","defaultView","disabled","disableDate","enableHeaderLabel","disableOutOfMonth","firstDayOfWeek","hideOutOfMonthDates","hideWeekdays","inputFormat","inputPrefix","inputSuffix","inputtable","labelFormat","locale","maxDate","minDate","name","okButtonContent","onBlur","onChange","onFocus","onDropdownClose","onDropdownOpen","openPickerOnClear","ref","renderDay","size","value","weekendDays","yearLabelFormat","rest","themeLocale","useConfig","finalLocale","dateFormat","dropdownOpened","setDropdownOpened","useState","inputRef","useRef","_","setLastValidValue","_value","setValue","useControllableState","calendarMonth","setCalendarMonth","focused","setFocused","inputState","setInputState","capitalize","dayjs","closeDropdown","openDropdown","useEffect","handleValueChange","date","now","_a","handleClear","parseDate","handleInputBlur","event","handleInputFocus","handleChange","handleTimeChange","time","newDateTime","handleOk","jsxs","BasePicker","useMergedRef","jsx","Calendar","TimeInput","Button"],"mappings":";;;;;;;;;;;;AAuCA,MAAMA,KAAuB,uBAEvBC,KAAiB,CAACC,MAA+B;AACnD,QAAM;AAAA,IACF,MAAAC,IAAO;AAAA,IACP,WAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,qBAAAC,IAAsB;AAAA,IACtB,eAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC,IAAc;AAAA,IACd,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,aAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,gBAAAC,IAAiB;AAAA,IACjB,qBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,aAAAC,IAAc;AAAA,MACV,OAAO;AAAA,MACP,MAAM;AAAA,IAAA;AAAA,IAEV,QAAAC;AAAA,IACA,SAAAC;AAAA,IACA,SAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,iBAAAC,KAAkB;AAAA,IAClB,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,KAAAC,KAAM;AAAA,IACN,WAAAC;AAAA,IACA,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHzC,GAEE,EAAE,QAAQ0C,GAAA,IAAgBC,GAAA,GAE1BC,IAAcpB,KAAUkB,IAExBG,IAAa1B,KAAerB,IAE5B,CAACgD,IAAgBC,CAAiB,IAAIC,EAASvC,CAAW,GAE1DwC,IAAWC,GAAyB,IAAI,GAGxC,CAACC,IA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B,OAAOA,wBAAa;YAE3C,OACIA,aAAkB,OACZA,IACAA,KAAUU,EAAMV,CAAM,EAAE,OAAA;AAAA,YAElC,aAAA9B;AAAA,YACA,cAAAjB;AAAA,YACA,UAAAC;AAAA,YACA,mBAAAQ;AAAA,YACA,SAAAW;AAAA,YACA,SAAAD;AAAA,YACA,aAAAZ;AAAA,YACA,gBAAAG;AAAA,YACA,cAAc;AAAA,YACd,eAAAX;AAAA,YACA,mBAAAS;AAAA,YACA,aAAAH;AAAA,YACA,qBAAAM;AAAA,YACA,cAAAC;AAAA,YACA,WAAAkB;AAAA,YACA,aAAAG;AAAA,YACA,iBAAAC;AAAA,YACA,eAAeiB;AAAA,YACf,UAAUU;AAAA,UAAA;AAAA,QAAA;AAAA,QAEd,gBAAAc,EAAC,OAAA,EAAI,WAAU,gCACX,UAAA;AAAA,UAAA,gBAAAG;AAAA,YAACE;AAAA,YAAA;AAAA,cACG,UAAU,CAACjC;AAAA,cACX,OAAOA;AAAA,cACP,QAAQpD,IAAO,OAAO;AAAA,cACtB,WAAW;AAAA,cACX,MAAK;AAAA,cACL,UAAU4E;AAAA,YAAA;AAAA,UAAA;AAAA,UAEd,gBAAAO,EAACG,MAAO,MAAK,MAAK,UAAU,CAAClC,GAAQ,SAAS2B,IACzC,UAAApD,GAAA,CACL;AAAA,QAAA,EAAA,CACJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGZ;AAEA7B,GAAe,cAAc;"}
|
|
1
|
+
{"version":3,"file":"DateTimepicker.js","sources":["../../../../../lib/@ecme/components/ui/DatePicker/DateTimepicker.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react'\r\nimport dayjs from 'dayjs'\r\nimport useControllableState from '../hooks/useControllableState'\r\nimport useMergedRef from '../hooks/useMergeRef'\r\nimport capitalize from '../utils/capitalize'\r\nimport TimeInput from '../TimeInput/TimeInput'\r\nimport Calendar from './Calendar'\r\nimport BasePicker from './BasePicker'\r\nimport Button from '../Button/Button'\r\nimport { useConfig } from '../ConfigProvider'\r\nimport type { CommonProps } from '../@types/common'\r\nimport type { CalendarSharedProps } from './CalendarBase'\r\nimport type { BasePickerSharedProps } from './BasePicker'\r\nimport type { FocusEvent, ChangeEvent, Ref } from 'react'\r\n\r\nexport interface DateTimepickerProps\r\n extends CommonProps,\r\n Omit<\r\n CalendarSharedProps,\r\n | 'onMonthChange'\r\n | 'onChange'\r\n | 'isDateInRange'\r\n | 'isDateFirstInRange'\r\n | 'isDateLastInRange'\r\n | 'month'\r\n >,\r\n BasePickerSharedProps {\r\n closePickerOnChange?: boolean\r\n defaultOpen?: boolean\r\n defaultValue?: Date | null\r\n value?: Date | null\r\n inputFormat?: string\r\n openPickerOnClear?: boolean\r\n onChange?: (value: Date | null) => void\r\n ref?: Ref<HTMLInputElement>\r\n amPm?: boolean\r\n okButtonContent?: boolean\r\n}\r\n\r\nconst DEFAULT_INPUT_FORMAT = 'DD-MMM-YYYY hh:mm a'\r\n\r\nconst DateTimepicker = (props: DateTimepickerProps) => {\r\n const {\r\n amPm = true,\r\n className,\r\n clearable = true,\r\n closePickerOnChange = false,\r\n dateViewCount,\r\n dayClassName,\r\n dayStyle,\r\n defaultMonth,\r\n defaultOpen = false,\r\n defaultValue,\r\n defaultView,\r\n disabled = false,\r\n disableDate,\r\n enableHeaderLabel,\r\n disableOutOfMonth,\r\n firstDayOfWeek = 'monday',\r\n hideOutOfMonthDates,\r\n hideWeekdays,\r\n inputFormat,\r\n inputPrefix,\r\n inputSuffix,\r\n inputtable,\r\n labelFormat = {\r\n month: 'MMM',\r\n year: 'YYYY',\r\n },\r\n locale,\r\n maxDate,\r\n minDate,\r\n name = 'dateTime',\r\n okButtonContent = 'OK',\r\n onBlur,\r\n onChange,\r\n onFocus,\r\n onDropdownClose,\r\n onDropdownOpen,\r\n openPickerOnClear,\r\n ref = null,\r\n renderDay,\r\n size,\r\n value,\r\n weekendDays,\r\n yearLabelFormat,\r\n ...rest\r\n } = props\r\n\r\n const { locale: themeLocale } = useConfig()\r\n\r\n const finalLocale = locale || themeLocale\r\n\r\n const dateFormat = inputFormat || DEFAULT_INPUT_FORMAT\r\n\r\n const [dropdownOpened, setDropdownOpened] = useState(defaultOpen)\r\n\r\n const inputRef = useRef<HTMLInputElement>(null)\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const [_, setLastValidValue] = useState(defaultValue ?? null)\r\n const [_value, setValue] = useControllableState({\r\n prop: value,\r\n defaultProp: defaultValue,\r\n onChange,\r\n })\r\n\r\n const [calendarMonth, setCalendarMonth] = useState(\r\n _value || defaultMonth || new Date(),\r\n )\r\n\r\n const [focused, setFocused] = useState(false)\r\n const [inputState, setInputState] = useState(\r\n _value instanceof Date\r\n ? capitalize(dayjs(_value).locale(finalLocale).format(dateFormat))\r\n : '',\r\n )\r\n\r\n const closeDropdown = () => {\r\n setDropdownOpened(false)\r\n onDropdownClose?.()\r\n }\r\n\r\n const openDropdown = () => {\r\n setDropdownOpened(true)\r\n onDropdownOpen?.()\r\n }\r\n\r\n useEffect(() => {\r\n if (value === null && !focused) {\r\n setInputState('')\r\n }\r\n\r\n if (value instanceof Date && !focused) {\r\n setInputState(dayjs(value).locale(finalLocale).format(dateFormat))\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [value, focused])\r\n\r\n const handleValueChange = (date: Date) => {\r\n if (_value) {\r\n date.setHours(_value.getHours())\r\n date.setMinutes(_value.getMinutes())\r\n } else {\r\n const now = new Date(Date.now())\r\n date.setHours(now.getHours())\r\n date.setMinutes(now.getMinutes())\r\n }\r\n setValue(date)\r\n if (!value && !closePickerOnChange) {\r\n setInputState(dayjs(date).locale(finalLocale).format(dateFormat))\r\n }\r\n closePickerOnChange &&\r\n setInputState(\r\n capitalize(dayjs(date).locale(finalLocale).format(dateFormat)),\r\n )\r\n closePickerOnChange && closeDropdown()\r\n window.setTimeout(() => inputRef.current?.focus(), 0)\r\n }\r\n\r\n const handleClear = () => {\r\n setValue(null)\r\n setLastValidValue(null)\r\n setInputState('')\r\n openPickerOnClear && openDropdown()\r\n inputRef.current?.focus()\r\n onChange?.(null)\r\n }\r\n\r\n const parseDate = (date: string) =>\r\n dayjs(date, dateFormat, finalLocale).toDate()\r\n\r\n const handleInputBlur = (event: FocusEvent<HTMLInputElement, Element>) => {\r\n typeof onBlur === 'function' && onBlur(event)\r\n setFocused(false)\r\n }\r\n\r\n const handleInputFocus = (event: FocusEvent<HTMLInputElement, Element>) => {\r\n typeof onFocus === 'function' && onFocus(event)\r\n setFocused(true)\r\n }\r\n\r\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\r\n openDropdown()\r\n\r\n const date = parseDate(event.target.value)\r\n if (dayjs(date).isValid()) {\r\n setValue(date)\r\n setLastValidValue(date)\r\n closePickerOnChange && setInputState(event.target.value)\r\n setCalendarMonth(date)\r\n } else {\r\n closePickerOnChange && setInputState(event.target.value)\r\n }\r\n }\r\n\r\n const handleTimeChange = (time: Date | null) => {\r\n if (_value instanceof Date && time instanceof Date) {\r\n const newDateTime = new Date(\r\n _value.getFullYear(),\r\n _value.getMonth(),\r\n _value.getDate(),\r\n time.getHours(),\r\n time.getMinutes(),\r\n time.getSeconds(),\r\n time.getMilliseconds(),\r\n )\r\n setValue(newDateTime)\r\n\r\n if (!value && !closePickerOnChange) {\r\n setInputState(\r\n capitalize(\r\n dayjs(newDateTime)\r\n .locale(finalLocale)\r\n .format(dateFormat),\r\n ),\r\n )\r\n }\r\n\r\n closePickerOnChange &&\r\n setInputState(\r\n capitalize(\r\n dayjs(newDateTime)\r\n .locale(finalLocale)\r\n .format(dateFormat),\r\n ),\r\n )\r\n }\r\n closePickerOnChange && closeDropdown()\r\n }\r\n\r\n const handleOk = () => {\r\n setInputState(\r\n capitalize(dayjs(_value).locale(finalLocale).format(dateFormat)),\r\n )\r\n closeDropdown()\r\n window.setTimeout(() => inputRef.current?.focus(), 0)\r\n onChange?.(_value as Date | null)\r\n }\r\n\r\n return (\r\n <BasePicker\r\n ref={useMergedRef(ref, inputRef)}\r\n dropdownOpened={dropdownOpened as boolean}\r\n setDropdownOpened={setDropdownOpened}\r\n className={className}\r\n name={name}\r\n inputLabel={inputState}\r\n clearable={clearable && !!_value && !disabled}\r\n disabled={disabled}\r\n size={size}\r\n inputPrefix={inputPrefix}\r\n inputSuffix={inputSuffix}\r\n onChange={handleChange}\r\n onBlur={handleInputBlur}\r\n onFocus={handleInputFocus}\r\n onClear={handleClear}\r\n onDropdownClose={onDropdownClose}\r\n onDropdownOpen={onDropdownOpen}\r\n {...rest}\r\n >\r\n <Calendar\r\n locale={finalLocale}\r\n month={inputtable ? calendarMonth : undefined}\r\n defaultMonth={\r\n defaultMonth ||\r\n (_value instanceof Date ? _value : new Date())\r\n }\r\n value={\r\n _value instanceof Date\r\n ? _value\r\n : _value && dayjs(_value).toDate()\r\n }\r\n labelFormat={labelFormat}\r\n dayClassName={dayClassName}\r\n dayStyle={dayStyle}\r\n disableOutOfMonth={disableOutOfMonth}\r\n minDate={minDate}\r\n maxDate={maxDate}\r\n disableDate={disableDate}\r\n firstDayOfWeek={firstDayOfWeek}\r\n preventFocus={false}\r\n dateViewCount={dateViewCount}\r\n enableHeaderLabel={enableHeaderLabel}\r\n defaultView={defaultView}\r\n hideOutOfMonthDates={hideOutOfMonthDates}\r\n hideWeekdays={hideWeekdays}\r\n renderDay={renderDay}\r\n weekendDays={weekendDays}\r\n yearLabelFormat={yearLabelFormat}\r\n onMonthChange={setCalendarMonth}\r\n onChange={handleValueChange}\r\n />\r\n <div className=\"flex items-center gap-4 mt-4\">\r\n <TimeInput\r\n disabled={!_value}\r\n value={_value}\r\n format={amPm ? '12' : '24'}\r\n clearable={false}\r\n size=\"sm\"\r\n onChange={handleTimeChange}\r\n />\r\n <Button size=\"sm\" disabled={!_value} onClick={handleOk}>\r\n {okButtonContent}\r\n </Button>\r\n </div>\r\n </BasePicker>\r\n )\r\n}\r\n\r\nDateTimepicker.displayName = 'DateTimepicker'\r\n\r\nexport default DateTimepicker\r\n"],"names":["DEFAULT_INPUT_FORMAT","DateTimepicker","props","amPm","className","clearable","closePickerOnChange","dateViewCount","dayClassName","dayStyle","defaultMonth","defaultOpen","defaultValue","defaultView","disabled","disableDate","enableHeaderLabel","disableOutOfMonth","firstDayOfWeek","hideOutOfMonthDates","hideWeekdays","inputFormat","inputPrefix","inputSuffix","inputtable","labelFormat","locale","maxDate","minDate","name","okButtonContent","onBlur","onChange","onFocus","onDropdownClose","onDropdownOpen","openPickerOnClear","ref","renderDay","size","value","weekendDays","yearLabelFormat","rest","themeLocale","useConfig","finalLocale","dateFormat","dropdownOpened","setDropdownOpened","useState","inputRef","useRef","_","setLastValidValue","_value","setValue","useControllableState","calendarMonth","setCalendarMonth","focused","setFocused","inputState","setInputState","capitalize","dayjs","closeDropdown","openDropdown","useEffect","handleValueChange","date","now","handleClear","parseDate","handleInputBlur","event","handleInputFocus","handleChange","handleTimeChange","time","newDateTime","handleOk","jsxs","BasePicker","useMergedRef","jsx","Calendar","TimeInput","Button"],"mappings":";;;;;;;;;;;;AAuCA,MAAMA,KAAuB,uBAEvBC,KAAiB,CAACC,MAA+B;AACnD,QAAM;AAAA,IACF,MAAAC,IAAO;AAAA,IACP,WAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,qBAAAC,IAAsB;AAAA,IACtB,eAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC,IAAc;AAAA,IACd,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,aAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,gBAAAC,IAAiB;AAAA,IACjB,qBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,aAAAC,IAAc;AAAA,MACV,OAAO;AAAA,MACP,MAAM;AAAA,IAAA;AAAA,IAEV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