@orbe-agro/client-core 5.3.86 → 5.3.90
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 +3 -22
- 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 +15 -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 +9 -7
- package/package.json +1 -1
- package/tsconfig.json +6 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmPmInput.js","sources":["../../../../../lib/@ecme/components/ui/TimeInput/AmPmInput.tsx"],"sourcesContent":["import { useRef } from 'react'\nimport classNames from 'classnames'\nimport useMergedRef from '../hooks/useMergeRef'\nimport type { CommonProps } from '../@types/common'\nimport type {\n FocusEvent,\n MouseEvent,\n KeyboardEvent,\n ChangeEvent,\n Ref,\n} from 'react'\n\ninterface AmPmInputProps extends CommonProps {\n disabled?: boolean\n amLabel?: string\n onChange: (value: string, triggerShift: boolean) => void\n onFocus?: (e: FocusEvent<HTMLInputElement>) => void\n ref?: Ref<HTMLInputElement>\n placeholder?: string\n pmLabel?: string\n value: string | number | readonly string[]\n}\n\nconst AmPmInput = (props: AmPmInputProps) => {\n const {\n className,\n onChange,\n onFocus,\n value,\n amLabel,\n pmLabel,\n ref = null,\n ...rest\n } = props\n\n const inputRef = useRef<HTMLInputElement>(undefined)\n\n const handleClick = (event: MouseEvent<HTMLInputElement>) => {\n event.stopPropagation()\n inputRef?.current?.select()\n }\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n event.preventDefault()\n onChange(\n value === amLabel ? (pmLabel as string) : (amLabel as string),\n true,\n )\n }\n }\n\n const handleFocus = (event: FocusEvent<HTMLInputElement>) => {\n typeof onFocus === 'function' && onFocus(event)\n inputRef?.current?.select()\n }\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n const lastInputVal = event.target.value.slice(-1).toLowerCase()\n\n if (lastInputVal === 'p') {\n event.preventDefault()\n onChange(pmLabel as string, true)\n return\n }\n\n if (lastInputVal === 'a') {\n event.preventDefault()\n onChange(amLabel as string, true)\n return\n }\n\n onChange(value.toString(), true)\n }\n\n return (\n <input\n ref={useMergedRef(inputRef as Ref<HTMLInputElement>, ref)}\n type=\"text\"\n value={value}\n className={classNames('time-input-field', 'am-pm-input', className)}\n onClick={handleClick}\n onFocus={handleFocus}\n onKeyDown={handleKeyDown}\n onChange={handleChange}\n {...rest}\n />\n )\n}\n\nexport default AmPmInput\n"],"names":["AmPmInput","props","className","onChange","onFocus","value","amLabel","pmLabel","ref","rest","inputRef","useRef","handleClick","event","
|
|
1
|
+
{"version":3,"file":"AmPmInput.js","sources":["../../../../../lib/@ecme/components/ui/TimeInput/AmPmInput.tsx"],"sourcesContent":["import { useRef } from 'react'\nimport classNames from 'classnames'\nimport useMergedRef from '../hooks/useMergeRef'\nimport type { CommonProps } from '../@types/common'\nimport type {\n FocusEvent,\n MouseEvent,\n KeyboardEvent,\n ChangeEvent,\n Ref,\n} from 'react'\n\ninterface AmPmInputProps extends CommonProps {\n disabled?: boolean\n amLabel?: string\n onChange: (value: string, triggerShift: boolean) => void\n onFocus?: (e: FocusEvent<HTMLInputElement>) => void\n ref?: Ref<HTMLInputElement>\n placeholder?: string\n pmLabel?: string\n value: string | number | readonly string[]\n}\n\nconst AmPmInput = (props: AmPmInputProps) => {\n const {\n className,\n onChange,\n onFocus,\n value,\n amLabel,\n pmLabel,\n ref = null,\n ...rest\n } = props\n\n const inputRef = useRef<HTMLInputElement>(undefined)\n\n const handleClick = (event: MouseEvent<HTMLInputElement>) => {\n event.stopPropagation()\n inputRef?.current?.select()\n }\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n event.preventDefault()\n onChange(\n value === amLabel ? (pmLabel as string) : (amLabel as string),\n true,\n )\n }\n }\n\n const handleFocus = (event: FocusEvent<HTMLInputElement>) => {\n typeof onFocus === 'function' && onFocus(event)\n inputRef?.current?.select()\n }\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n const lastInputVal = event.target.value.slice(-1).toLowerCase()\n\n if (lastInputVal === 'p') {\n event.preventDefault()\n onChange(pmLabel as string, true)\n return\n }\n\n if (lastInputVal === 'a') {\n event.preventDefault()\n onChange(amLabel as string, true)\n return\n }\n\n onChange(value.toString(), true)\n }\n\n return (\n <input\n ref={useMergedRef(inputRef as Ref<HTMLInputElement>, ref)}\n type=\"text\"\n value={value}\n className={classNames('time-input-field', 'am-pm-input', className)}\n onClick={handleClick}\n onFocus={handleFocus}\n onKeyDown={handleKeyDown}\n onChange={handleChange}\n {...rest}\n />\n )\n}\n\nexport default AmPmInput\n"],"names":["AmPmInput","props","className","onChange","onFocus","value","amLabel","pmLabel","ref","rest","inputRef","useRef","handleClick","event","handleKeyDown","handleFocus","handleChange","lastInputVal","jsx","useMergedRef","classNames"],"mappings":";;;;AAuBA,MAAMA,IAAY,CAACC,MAA0B;AACzC,QAAM;AAAA,IACF,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAAAC;AAAA,IACA,OAAAC;AAAA,IACA,SAAAC;AAAA,IACA,SAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,IACN,GAAGC;AAAA,EAAA,IACHR,GAEES,IAAWC,EAAyB,MAAS,GAE7CC,IAAc,CAACC,MAAwC;AACzD,IAAAA,EAAM,gBAAA,GACNH,GAAU,SAAS,OAAA;AAAA,EACvB,GAEMI,IAAgB,CAACD,MAA2C;AAC9D,KAAIA,EAAM,QAAQ,aAAaA,EAAM,QAAQ,iBACzCA,EAAM,eAAA,GACNV;AAAA,MACIE,MAAUC,IAAWC,IAAsBD;AAAA,MAC3C;AAAA,IAAA;AAAA,EAGZ,GAEMS,IAAc,CAACF,MAAwC;AACzD,WAAOT,KAAY,cAAcA,EAAQS,CAAK,GAC9CH,GAAU,SAAS,OAAA;AAAA,EACvB,GAEMM,IAAe,CAACH,MAAyC;AAC3D,UAAMI,IAAeJ,EAAM,OAAO,MAAM,MAAM,EAAE,EAAE,YAAA;AAElD,QAAII,MAAiB,KAAK;AACtB,MAAAJ,EAAM,eAAA,GACNV,EAASI,GAAmB,EAAI;AAChC;AAAA,IACJ;AAEA,QAAIU,MAAiB,KAAK;AACtB,MAAAJ,EAAM,eAAA,GACNV,EAASG,GAAmB,EAAI;AAChC;AAAA,IACJ;AAEA,IAAAH,EAASE,EAAM,SAAA,GAAY,EAAI;AAAA,EACnC;AAEA,SACI,gBAAAa;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,KAAKC,EAAaT,GAAmCF,CAAG;AAAA,MACxD,MAAK;AAAA,MACL,OAAAH;AAAA,MACA,WAAWe,EAAW,oBAAoB,eAAelB,CAAS;AAAA,MAClE,SAASU;AAAA,MACT,SAASG;AAAA,MACT,WAAWD;AAAA,MACX,UAAUE;AAAA,MACT,GAAGP;AAAA,IAAA;AAAA,EAAA;AAGhB;"}
|
|
@@ -1,186 +1,181 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { useFormItem as
|
|
1
|
+
import { jsx as o, jsxs as X } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as f, useState as V } from "react";
|
|
3
|
+
import Y from "../hooks/useUniqueId.js";
|
|
4
|
+
import Z from "../hooks/useMergeRef.js";
|
|
5
|
+
import w from "../hooks/useDidUpdate.js";
|
|
6
|
+
import { useFormItem as $ } from "../Form/context.js";
|
|
7
7
|
import I from "./TimeInputField.js";
|
|
8
|
-
import
|
|
8
|
+
import ee from "./AmPmInput.js";
|
|
9
9
|
import "../CloseButton/index.js";
|
|
10
10
|
import "../Input/index.js";
|
|
11
11
|
import "./utils/index.js";
|
|
12
12
|
import { HiOutlineClock as ae } from "react-icons/hi";
|
|
13
|
-
import { getTimeValues as
|
|
14
|
-
import { getDate as
|
|
15
|
-
import { createTimeHandler as
|
|
16
|
-
import { createAmPmHandler as
|
|
17
|
-
import
|
|
13
|
+
import { getTimeValues as D } from "./utils/getTimeValues.js";
|
|
14
|
+
import { getDate as te } from "./utils/getDate.js";
|
|
15
|
+
import { createTimeHandler as R } from "./utils/createTimeHandler.js";
|
|
16
|
+
import { createAmPmHandler as ne } from "./utils/createAmPmHandler.js";
|
|
17
|
+
import oe from "../CloseButton/CloseButton.js";
|
|
18
18
|
import se from "../Input/Input.js";
|
|
19
|
-
const
|
|
20
|
-
var R;
|
|
19
|
+
const Ne = (F) => {
|
|
21
20
|
const {
|
|
22
|
-
amLabel:
|
|
23
|
-
amPmPlaceholder:
|
|
24
|
-
className:
|
|
25
|
-
clearable:
|
|
26
|
-
defaultValue:
|
|
27
|
-
disabled:
|
|
28
|
-
format:
|
|
29
|
-
id:
|
|
30
|
-
invalid:
|
|
31
|
-
name:
|
|
32
|
-
nextRef:
|
|
33
|
-
onChange:
|
|
34
|
-
pmLabel:
|
|
35
|
-
prefix:
|
|
36
|
-
ref:
|
|
37
|
-
showSeconds:
|
|
38
|
-
size:
|
|
39
|
-
style:
|
|
40
|
-
suffix:
|
|
41
|
-
timeFieldPlaceholder:
|
|
42
|
-
timeFieldClass:
|
|
43
|
-
value:
|
|
44
|
-
...
|
|
45
|
-
} =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
21
|
+
amLabel: m = "am",
|
|
22
|
+
amPmPlaceholder: H = "am",
|
|
23
|
+
className: M,
|
|
24
|
+
clearable: k = !0,
|
|
25
|
+
defaultValue: b,
|
|
26
|
+
disabled: i = !1,
|
|
27
|
+
format: t = "24",
|
|
28
|
+
id: A,
|
|
29
|
+
invalid: j,
|
|
30
|
+
name: y,
|
|
31
|
+
nextRef: h,
|
|
32
|
+
onChange: p,
|
|
33
|
+
pmLabel: s = "pm",
|
|
34
|
+
prefix: L,
|
|
35
|
+
ref: U = null,
|
|
36
|
+
showSeconds: u = !1,
|
|
37
|
+
size: q = "md",
|
|
38
|
+
style: z,
|
|
39
|
+
suffix: B = /* @__PURE__ */ o(ae, { className: "text-lg" }),
|
|
40
|
+
timeFieldPlaceholder: x = "--",
|
|
41
|
+
timeFieldClass: C,
|
|
42
|
+
value: r,
|
|
43
|
+
...E
|
|
44
|
+
} = F, O = Y(A), g = f(void 0), T = f(void 0), S = f(void 0), v = f(void 0), [n, l] = V(
|
|
45
|
+
D(
|
|
46
|
+
r || b,
|
|
47
|
+
t,
|
|
48
|
+
m,
|
|
49
|
+
s
|
|
51
50
|
)
|
|
52
|
-
), [
|
|
53
|
-
|
|
54
|
-
),
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}, [
|
|
58
|
-
|
|
59
|
-
}, [
|
|
60
|
-
const
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
51
|
+
), [c, P] = V(
|
|
52
|
+
r || b
|
|
53
|
+
), W = $()?.invalid, _ = j || W;
|
|
54
|
+
w(() => {
|
|
55
|
+
l(D(c, t, m, s));
|
|
56
|
+
}, [c, t, m, s]), w(() => {
|
|
57
|
+
r?.getTime() !== c?.getTime() && P(r);
|
|
58
|
+
}, [r]);
|
|
59
|
+
const d = (e) => {
|
|
60
|
+
const a = { ...n, ...e }, N = te(
|
|
61
|
+
a.hours,
|
|
62
|
+
a.minutes,
|
|
63
|
+
a.seconds,
|
|
64
|
+
t,
|
|
65
|
+
s,
|
|
66
|
+
a.amPm
|
|
68
67
|
);
|
|
69
|
-
P(
|
|
70
|
-
},
|
|
71
|
-
onChange: (e,
|
|
72
|
-
|
|
68
|
+
P(N), typeof p == "function" && p(N);
|
|
69
|
+
}, G = R({
|
|
70
|
+
onChange: (e, a) => {
|
|
71
|
+
d({
|
|
73
72
|
hours: e,
|
|
74
|
-
minutes:
|
|
73
|
+
minutes: a ?? n.minutes
|
|
75
74
|
});
|
|
76
75
|
},
|
|
77
|
-
min:
|
|
78
|
-
max:
|
|
79
|
-
nextRef:
|
|
76
|
+
min: t === "12" ? 1 : 0,
|
|
77
|
+
max: t === "12" ? 12 : 23,
|
|
78
|
+
nextRef: T,
|
|
80
79
|
nextMax: 59
|
|
81
|
-
}),
|
|
82
|
-
onChange: (e,
|
|
83
|
-
|
|
80
|
+
}), J = R({
|
|
81
|
+
onChange: (e, a) => {
|
|
82
|
+
d({
|
|
84
83
|
minutes: e,
|
|
85
|
-
seconds:
|
|
84
|
+
seconds: a ?? n.seconds
|
|
86
85
|
});
|
|
87
86
|
},
|
|
88
87
|
min: 0,
|
|
89
88
|
max: 59,
|
|
90
|
-
nextRef:
|
|
91
|
-
nextMax:
|
|
92
|
-
}),
|
|
89
|
+
nextRef: u ? S : t === "12" ? v : h,
|
|
90
|
+
nextMax: u ? 59 : void 0
|
|
91
|
+
}), K = R({
|
|
93
92
|
onChange: (e) => {
|
|
94
|
-
|
|
93
|
+
d({ seconds: e });
|
|
95
94
|
},
|
|
96
95
|
min: 0,
|
|
97
96
|
max: 59,
|
|
98
|
-
nextRef:
|
|
99
|
-
}),
|
|
100
|
-
amLabel:
|
|
101
|
-
pmLabel:
|
|
97
|
+
nextRef: t === "12" ? v : h
|
|
98
|
+
}), Q = ne({
|
|
99
|
+
amLabel: m,
|
|
100
|
+
pmLabel: s,
|
|
102
101
|
onChange: (e) => {
|
|
103
|
-
|
|
102
|
+
d({ amPm: e });
|
|
104
103
|
},
|
|
105
|
-
nextRef:
|
|
104
|
+
nextRef: h
|
|
106
105
|
});
|
|
107
|
-
return /* @__PURE__ */
|
|
106
|
+
return /* @__PURE__ */ o(
|
|
108
107
|
se,
|
|
109
108
|
{
|
|
110
109
|
asElement: "div",
|
|
111
|
-
invalid:
|
|
112
|
-
disabled:
|
|
113
|
-
style:
|
|
114
|
-
className:
|
|
115
|
-
size:
|
|
116
|
-
prefix:
|
|
117
|
-
suffix:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
},
|
|
125
|
-
...O,
|
|
126
|
-
children: /* @__PURE__ */ Z("div", { className: "time-input-wrapper", children: [
|
|
127
|
-
/* @__PURE__ */ s(
|
|
110
|
+
invalid: _,
|
|
111
|
+
disabled: i,
|
|
112
|
+
style: z,
|
|
113
|
+
className: M,
|
|
114
|
+
size: q,
|
|
115
|
+
prefix: L,
|
|
116
|
+
suffix: k && c ? /* @__PURE__ */ o(oe, { onClick: () => {
|
|
117
|
+
l({ hours: "", minutes: "", seconds: "", amPm: "" }), P(null), p?.(null), g?.current?.focus();
|
|
118
|
+
} }) : B,
|
|
119
|
+
onClick: () => g?.current?.focus(),
|
|
120
|
+
...E,
|
|
121
|
+
children: /* @__PURE__ */ X("div", { className: "time-input-wrapper", children: [
|
|
122
|
+
/* @__PURE__ */ o(
|
|
128
123
|
I,
|
|
129
124
|
{
|
|
130
|
-
ref:
|
|
125
|
+
ref: Z(g, U),
|
|
131
126
|
withSeparator: !0,
|
|
132
|
-
value:
|
|
133
|
-
setValue: (e) =>
|
|
134
|
-
id:
|
|
135
|
-
className:
|
|
136
|
-
max:
|
|
137
|
-
placeholder:
|
|
127
|
+
value: n.hours,
|
|
128
|
+
setValue: (e) => l((a) => ({ ...a, hours: e })),
|
|
129
|
+
id: O,
|
|
130
|
+
className: C,
|
|
131
|
+
max: t === "12" ? 12 : 23,
|
|
132
|
+
placeholder: x,
|
|
138
133
|
"aria-label": "hours",
|
|
139
|
-
disabled:
|
|
140
|
-
name:
|
|
141
|
-
onChange:
|
|
134
|
+
disabled: i,
|
|
135
|
+
name: y,
|
|
136
|
+
onChange: G
|
|
142
137
|
}
|
|
143
138
|
),
|
|
144
|
-
/* @__PURE__ */
|
|
139
|
+
/* @__PURE__ */ o(
|
|
145
140
|
I,
|
|
146
141
|
{
|
|
147
|
-
ref:
|
|
148
|
-
value:
|
|
149
|
-
setValue: (e) =>
|
|
150
|
-
className:
|
|
151
|
-
withSeparator:
|
|
142
|
+
ref: T,
|
|
143
|
+
value: n.minutes,
|
|
144
|
+
setValue: (e) => l((a) => ({ ...a, minutes: e })),
|
|
145
|
+
className: C,
|
|
146
|
+
withSeparator: u,
|
|
152
147
|
max: 59,
|
|
153
|
-
placeholder:
|
|
148
|
+
placeholder: x,
|
|
154
149
|
"aria-label": "minutes",
|
|
155
|
-
disabled:
|
|
156
|
-
onChange:
|
|
150
|
+
disabled: i,
|
|
151
|
+
onChange: J
|
|
157
152
|
}
|
|
158
153
|
),
|
|
159
|
-
|
|
154
|
+
u && /* @__PURE__ */ o(
|
|
160
155
|
I,
|
|
161
156
|
{
|
|
162
|
-
ref:
|
|
163
|
-
value:
|
|
164
|
-
setValue: (e) =>
|
|
165
|
-
className:
|
|
157
|
+
ref: S,
|
|
158
|
+
value: n.seconds,
|
|
159
|
+
setValue: (e) => l((a) => ({ ...a, seconds: e })),
|
|
160
|
+
className: C,
|
|
166
161
|
max: 59,
|
|
167
|
-
placeholder:
|
|
162
|
+
placeholder: x,
|
|
168
163
|
"aria-label": "seconds",
|
|
169
|
-
disabled:
|
|
170
|
-
onChange:
|
|
164
|
+
disabled: i,
|
|
165
|
+
onChange: K
|
|
171
166
|
}
|
|
172
167
|
),
|
|
173
|
-
|
|
174
|
-
|
|
168
|
+
t === "12" && /* @__PURE__ */ o(
|
|
169
|
+
ee,
|
|
175
170
|
{
|
|
176
171
|
ref: v,
|
|
177
|
-
value:
|
|
178
|
-
placeholder:
|
|
179
|
-
amLabel:
|
|
180
|
-
pmLabel:
|
|
172
|
+
value: n.amPm,
|
|
173
|
+
placeholder: H,
|
|
174
|
+
amLabel: m,
|
|
175
|
+
pmLabel: s,
|
|
181
176
|
"aria-label": "am pm",
|
|
182
|
-
disabled:
|
|
183
|
-
onChange:
|
|
177
|
+
disabled: i,
|
|
178
|
+
onChange: Q
|
|
184
179
|
}
|
|
185
180
|
)
|
|
186
181
|
] })
|
|
@@ -188,6 +183,6 @@ const Ve = (H) => {
|
|
|
188
183
|
);
|
|
189
184
|
};
|
|
190
185
|
export {
|
|
191
|
-
|
|
186
|
+
Ne as default
|
|
192
187
|
};
|
|
193
188
|
//# sourceMappingURL=TimeInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeInput.js","sources":["../../../../../lib/@ecme/components/ui/TimeInput/TimeInput.tsx"],"sourcesContent":["import { useState, useRef } from 'react'\nimport useUniqueId from '../hooks/useUniqueId'\nimport useMergedRef from '../hooks/useMergeRef'\nimport useDidUpdate from '../hooks/useDidUpdate'\nimport { useFormItem } from '../Form/context'\nimport TimeInputField from './TimeInputField'\nimport AmPmInput from './AmPmInput'\nimport CloseButton from '../CloseButton'\nimport { Input } from '../Input'\nimport {\n getTimeValues,\n getDate,\n createAmPmHandler,\n createTimeHandler,\n} from './utils'\nimport { HiOutlineClock } from 'react-icons/hi'\nimport type { CommonProps, TypeAttributes } from '../@types/common'\nimport type { ReactNode, RefObject, Ref } from 'react'\n\ntype Value = Date | null\n\nexport interface TimeInputProps extends CommonProps {\n amLabel?: string\n amPmPlaceholder?: string\n clearable?: boolean\n defaultValue?: Value\n disabled?: boolean\n format?: '12' | '24'\n id?: string\n invalid?: boolean\n name?: string\n nextRef?: RefObject<HTMLInputElement | null>\n onChange?: (value: Value) => void\n pmLabel?: string\n prefix?: string | ReactNode\n ref?: Ref<HTMLInputElement>\n showSeconds?: boolean\n size?: TypeAttributes.ControlSize\n suffix?: string | ReactNode\n timeFieldPlaceholder?: string\n timeFieldClass?: string\n unstyle?: boolean\n value?: Value\n}\n\nconst TimeInput = (props: TimeInputProps) => {\n const {\n amLabel = 'am',\n amPmPlaceholder = 'am',\n className,\n clearable = true,\n defaultValue,\n disabled = false,\n format = '24',\n id,\n invalid,\n name,\n nextRef,\n onChange,\n pmLabel = 'pm',\n prefix,\n ref = null,\n showSeconds = false,\n size = 'md',\n style,\n suffix = <HiOutlineClock className=\"text-lg\" />,\n timeFieldPlaceholder = '--',\n timeFieldClass,\n value,\n ...rest\n } = props\n\n const uuid = useUniqueId(id)\n\n const hoursRef = useRef<HTMLInputElement>(undefined)\n const minutesRef = useRef<HTMLInputElement>(undefined)\n const secondsRef = useRef<HTMLInputElement>(undefined)\n const amPmRef = useRef<HTMLInputElement>(undefined)\n const [time, setTime] = useState(\n getTimeValues(\n value || (defaultValue as Date),\n format,\n amLabel,\n pmLabel,\n ),\n )\n const [_value, setValue] = useState<Value>(\n (value as Date) || (defaultValue as Date),\n )\n\n const formItemInvalid = useFormItem()?.invalid\n const isTimeInputInvalid = invalid || formItemInvalid\n\n useDidUpdate(() => {\n setTime(getTimeValues(_value as Date, format, amLabel, pmLabel))\n }, [_value, format, amLabel, pmLabel])\n\n useDidUpdate(() => {\n if (value?.getTime() !== _value?.getTime()) {\n setValue(value as Date | null)\n }\n }, [value])\n\n const setDate = (change: Partial<typeof time>) => {\n const timeWithChange = { ...time, ...change }\n const newDate = getDate(\n timeWithChange.hours,\n timeWithChange.minutes,\n timeWithChange.seconds,\n format,\n pmLabel,\n timeWithChange.amPm,\n )\n setValue(newDate)\n typeof onChange === 'function' && onChange(newDate)\n }\n\n const handleHoursChange = createTimeHandler({\n onChange: (val, carryOver) => {\n setDate({\n hours: val,\n minutes: carryOver ?? time.minutes,\n })\n },\n min: format === '12' ? 1 : 0,\n max: format === '12' ? 12 : 23,\n nextRef: minutesRef as RefObject<HTMLInputElement | null>,\n nextMax: 59,\n })\n\n const handleMinutesChange = createTimeHandler({\n onChange: (val, carryOver) => {\n setDate({\n minutes: val,\n seconds: carryOver ?? time.seconds,\n })\n },\n min: 0,\n max: 59,\n nextRef: showSeconds\n ? (secondsRef as RefObject<HTMLInputElement | null>)\n : format === '12'\n ? (amPmRef as RefObject<HTMLInputElement | null>)\n : (nextRef as RefObject<HTMLInputElement | null>),\n nextMax: showSeconds ? 59 : undefined,\n })\n\n const handleSecondsChange = createTimeHandler({\n onChange: (val) => {\n setDate({ seconds: val })\n },\n min: 0,\n max: 59,\n nextRef:\n format === '12'\n ? (amPmRef as RefObject<HTMLInputElement | null>)\n : (nextRef as RefObject<HTMLInputElement | null>),\n })\n\n const handleAmPmChange = createAmPmHandler({\n amLabel,\n pmLabel,\n onChange: (val) => {\n setDate({ amPm: val })\n },\n nextRef,\n })\n\n const handleClear = () => {\n setTime({ hours: '', minutes: '', seconds: '', amPm: '' })\n setValue(null)\n onChange?.(null)\n hoursRef?.current?.focus()\n }\n\n const suffixSlot =\n clearable && _value ? <CloseButton onClick={handleClear} /> : suffix\n\n return (\n <Input\n asElement=\"div\"\n invalid={isTimeInputInvalid}\n disabled={disabled}\n style={style}\n className={className}\n size={size}\n prefix={prefix}\n suffix={suffixSlot}\n onClick={() => hoursRef?.current?.focus()}\n {...rest}\n >\n <div className=\"time-input-wrapper\">\n <TimeInputField\n ref={useMergedRef(hoursRef as Ref<HTMLInputElement>, ref)}\n withSeparator\n value={time.hours}\n setValue={(val) =>\n setTime((current) => ({ ...current, hours: val }))\n }\n id={uuid}\n className={timeFieldClass}\n max={format === '12' ? 12 : 23}\n placeholder={timeFieldPlaceholder}\n aria-label=\"hours\"\n disabled={disabled}\n name={name}\n onChange={handleHoursChange}\n />\n <TimeInputField\n ref={minutesRef as Ref<HTMLInputElement>}\n value={time.minutes}\n setValue={(val) =>\n setTime((current) => ({ ...current, minutes: val }))\n }\n className={timeFieldClass}\n withSeparator={showSeconds}\n max={59}\n placeholder={timeFieldPlaceholder}\n aria-label=\"minutes\"\n disabled={disabled}\n onChange={handleMinutesChange}\n />\n {showSeconds && (\n <TimeInputField\n ref={secondsRef as Ref<HTMLInputElement>}\n value={time.seconds}\n setValue={(val) =>\n setTime((current) => ({ ...current, seconds: val }))\n }\n className={timeFieldClass}\n max={59}\n placeholder={timeFieldPlaceholder}\n aria-label=\"seconds\"\n disabled={disabled}\n onChange={handleSecondsChange}\n />\n )}\n {format === '12' && (\n <AmPmInput\n ref={amPmRef as Ref<HTMLInputElement>}\n value={time.amPm}\n placeholder={amPmPlaceholder}\n amLabel={amLabel}\n pmLabel={pmLabel}\n aria-label=\"am pm\"\n disabled={disabled}\n onChange={handleAmPmChange}\n />\n )}\n </div>\n </Input>\n )\n}\n\nexport default TimeInput\n"],"names":["TimeInput","props","amLabel","amPmPlaceholder","className","clearable","defaultValue","disabled","format","id","invalid","name","nextRef","onChange","pmLabel","prefix","ref","showSeconds","size","style","suffix","jsx","HiOutlineClock","timeFieldPlaceholder","timeFieldClass","value","rest","uuid","useUniqueId","hoursRef","useRef","minutesRef","secondsRef","amPmRef","time","setTime","useState","getTimeValues","_value","setValue","formItemInvalid","_a","useFormItem","isTimeInputInvalid","useDidUpdate","setDate","change","timeWithChange","newDate","getDate","handleHoursChange","createTimeHandler","val","carryOver","handleMinutesChange","handleSecondsChange","handleAmPmChange","createAmPmHandler","Input","CloseButton","jsxs","TimeInputField","useMergedRef","current","AmPmInput"],"mappings":";;;;;;;;;;;;;;;;;;AA6CA,MAAMA,KAAY,CAACC,MAA0B;;AACzC,QAAM;AAAA,IACF,SAAAC,IAAU;AAAA,IACV,iBAAAC,IAAkB;AAAA,IAClB,WAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,cAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,QAAAC,IAAS;AAAA,IACT,IAAAC;AAAA,IACA,SAAAC;AAAA,IACA,M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gBAAAI;AAAA,UAACwC;AAAA,UAAA;AAAA,YACG,KAAK7B;AAAA,YACL,OAAOE,EAAK;AAAA,YACZ,UAAU,CAACkB,MACPjB,EAAQ,CAAC4B,OAAa,EAAE,GAAGA,GAAS,SAASX,EAAA,EAAM;AAAA,YAEvD,WAAW5B;AAAA,YACX,KAAK;AAAA,YACL,aAAaD;AAAA,YACb,cAAW;AAAA,YACX,UAAAhB;AAAA,YACA,UAAUgD;AAAA,UAAA;AAAA,QAAA;AAAA,QAGjB/C,MAAW,QACR,gBAAAa;AAAA,UAAC2C;AAAA,UAAA;AAAA,YACG,KAAK/B;AAAA,YACL,OAAOC,EAAK;AAAA,YACZ,aAAa/B;AAAA,YACb,SAAAD;AAAA,YACA,SAAAY;AAAA,YACA,cAAW;AAAA,YACX,UAAAP;AAAA,YACA,UAAUiD;AAAA,UAAA;AAAA,QAAA;AAAA,MACd,EAAA,CAER;AAAA,IAAA;AAAA,EAAA;AAGZ;"}
|
|
1
|
+
{"version":3,"file":"TimeInput.js","sources":["../../../../../lib/@ecme/components/ui/TimeInput/TimeInput.tsx"],"sourcesContent":["import { useState, useRef } from 'react'\nimport useUniqueId from '../hooks/useUniqueId'\nimport useMergedRef from '../hooks/useMergeRef'\nimport useDidUpdate from '../hooks/useDidUpdate'\nimport { useFormItem } from '../Form/context'\nimport TimeInputField from './TimeInputField'\nimport AmPmInput from './AmPmInput'\nimport CloseButton from '../CloseButton'\nimport { Input } from '../Input'\nimport {\n getTimeValues,\n getDate,\n createAmPmHandler,\n createTimeHandler,\n} from './utils'\nimport { HiOutlineClock } from 'react-icons/hi'\nimport type { CommonProps, TypeAttributes } from '../@types/common'\nimport type { ReactNode, RefObject, Ref } from 'react'\n\ntype Value = Date | null\n\nexport interface TimeInputProps extends CommonProps {\n amLabel?: string\n amPmPlaceholder?: string\n clearable?: boolean\n defaultValue?: Value\n disabled?: boolean\n format?: '12' | '24'\n id?: string\n invalid?: boolean\n name?: string\n nextRef?: RefObject<HTMLInputElement | null>\n onChange?: (value: Value) => void\n pmLabel?: string\n prefix?: string | ReactNode\n ref?: Ref<HTMLInputElement>\n showSeconds?: boolean\n size?: TypeAttributes.ControlSize\n suffix?: string | ReactNode\n timeFieldPlaceholder?: string\n timeFieldClass?: string\n unstyle?: boolean\n value?: Value\n}\n\nconst TimeInput = (props: TimeInputProps) => {\n const {\n amLabel = 'am',\n amPmPlaceholder = 'am',\n className,\n clearable = true,\n defaultValue,\n disabled = false,\n format = '24',\n id,\n invalid,\n name,\n nextRef,\n onChange,\n pmLabel = 'pm',\n prefix,\n ref = null,\n showSeconds = false,\n size = 'md',\n style,\n suffix = <HiOutlineClock className=\"text-lg\" />,\n timeFieldPlaceholder = '--',\n timeFieldClass,\n value,\n ...rest\n } = props\n\n const uuid = useUniqueId(id)\n\n const hoursRef = useRef<HTMLInputElement>(undefined)\n const minutesRef = useRef<HTMLInputElement>(undefined)\n const secondsRef = useRef<HTMLInputElement>(undefined)\n const amPmRef = useRef<HTMLInputElement>(undefined)\n const [time, setTime] = useState(\n getTimeValues(\n value || (defaultValue as Date),\n format,\n amLabel,\n pmLabel,\n ),\n )\n const [_value, setValue] = useState<Value>(\n (value as Date) || (defaultValue as Date),\n )\n\n const formItemInvalid = useFormItem()?.invalid\n const isTimeInputInvalid = invalid || formItemInvalid\n\n useDidUpdate(() => {\n setTime(getTimeValues(_value as Date, format, amLabel, pmLabel))\n }, [_value, format, amLabel, pmLabel])\n\n useDidUpdate(() => {\n if (value?.getTime() !== _value?.getTime()) {\n setValue(value as Date | null)\n }\n }, [value])\n\n const setDate = (change: Partial<typeof time>) => {\n const timeWithChange = { ...time, ...change }\n const newDate = getDate(\n timeWithChange.hours,\n timeWithChange.minutes,\n timeWithChange.seconds,\n format,\n pmLabel,\n timeWithChange.amPm,\n )\n setValue(newDate)\n typeof onChange === 'function' && onChange(newDate)\n }\n\n const handleHoursChange = createTimeHandler({\n onChange: (val, carryOver) => {\n setDate({\n hours: val,\n minutes: carryOver ?? time.minutes,\n })\n },\n min: format === '12' ? 1 : 0,\n max: format === '12' ? 12 : 23,\n nextRef: minutesRef as RefObject<HTMLInputElement | null>,\n nextMax: 59,\n })\n\n const handleMinutesChange = createTimeHandler({\n onChange: (val, carryOver) => {\n setDate({\n minutes: val,\n seconds: carryOver ?? time.seconds,\n })\n },\n min: 0,\n max: 59,\n nextRef: showSeconds\n ? (secondsRef as RefObject<HTMLInputElement | null>)\n : format === '12'\n ? (amPmRef as RefObject<HTMLInputElement | null>)\n : (nextRef as RefObject<HTMLInputElement | null>),\n nextMax: showSeconds ? 59 : undefined,\n })\n\n const handleSecondsChange = createTimeHandler({\n onChange: (val) => {\n setDate({ seconds: val })\n },\n min: 0,\n max: 59,\n nextRef:\n format === '12'\n ? (amPmRef as RefObject<HTMLInputElement | null>)\n : (nextRef as RefObject<HTMLInputElement | null>),\n })\n\n const handleAmPmChange = createAmPmHandler({\n amLabel,\n pmLabel,\n onChange: (val) => {\n setDate({ amPm: val })\n },\n nextRef,\n })\n\n const handleClear = () => {\n setTime({ hours: '', minutes: '', seconds: '', amPm: '' })\n setValue(null)\n onChange?.(null)\n hoursRef?.current?.focus()\n }\n\n const suffixSlot =\n clearable && _value ? <CloseButton onClick={handleClear} /> : suffix\n\n return (\n <Input\n asElement=\"div\"\n invalid={isTimeInputInvalid}\n disabled={disabled}\n style={style}\n className={className}\n size={size}\n prefix={prefix}\n suffix={suffixSlot}\n onClick={() => hoursRef?.current?.focus()}\n {...rest}\n >\n <div className=\"time-input-wrapper\">\n <TimeInputField\n ref={useMergedRef(hoursRef as Ref<HTMLInputElement>, ref)}\n withSeparator\n value={time.hours}\n setValue={(val) =>\n setTime((current) => ({ ...current, hours: val }))\n }\n id={uuid}\n className={timeFieldClass}\n max={format === '12' ? 12 : 23}\n placeholder={timeFieldPlaceholder}\n aria-label=\"hours\"\n disabled={disabled}\n name={name}\n onChange={handleHoursChange}\n />\n <TimeInputField\n ref={minutesRef as Ref<HTMLInputElement>}\n value={time.minutes}\n setValue={(val) =>\n setTime((current) => ({ ...current, minutes: val }))\n }\n className={timeFieldClass}\n withSeparator={showSeconds}\n max={59}\n placeholder={timeFieldPlaceholder}\n aria-label=\"minutes\"\n disabled={disabled}\n onChange={handleMinutesChange}\n />\n {showSeconds && (\n <TimeInputField\n ref={secondsRef as Ref<HTMLInputElement>}\n value={time.seconds}\n setValue={(val) =>\n setTime((current) => ({ ...current, seconds: val }))\n }\n className={timeFieldClass}\n max={59}\n placeholder={timeFieldPlaceholder}\n aria-label=\"seconds\"\n disabled={disabled}\n onChange={handleSecondsChange}\n />\n )}\n {format === '12' && (\n <AmPmInput\n ref={amPmRef as Ref<HTMLInputElement>}\n value={time.amPm}\n placeholder={amPmPlaceholder}\n amLabel={amLabel}\n pmLabel={pmLabel}\n aria-label=\"am pm\"\n disabled={disabled}\n onChange={handleAmPmChange}\n />\n )}\n </div>\n </Input>\n )\n}\n\nexport default TimeInput\n"],"names":["TimeInput","props","amLabel","amPmPlaceholder","className","clearable","defaultValue","disabled","format","id","invalid","name","nextRef","onChange","pmLabel","prefix","ref","showSeconds","size","style","suffix","jsx","HiOutlineClock","timeFieldPlaceholder","timeFieldClass","value","rest","uuid","useUniqueId","hoursRef","useRef","minutesRef","secondsRef","amPmRef","time","setTime","useState","getTimeValues","_value","setValue","formItemInvalid","useFormItem","isTimeInputInvalid","useDidUpdate","setDate","change","timeWithChange","newDate","getDate","handleHoursChange","createTimeHandler","val","carryOver","handleMinutesChange","handleSecondsChange","handleAmPmChange","createAmPmHandler","Input","CloseButton","jsxs","TimeInputField","useMergedRef","current","AmPmInput"],"mappings":";;;;;;;;;;;;;;;;;;AA6CA,MAAMA,KAAY,CAACC,MAA0B;AACzC,QAAM;AAAA,IACF,SAAAC,IAAU;AAAA,IACV,iBAAAC,IAAkB;AAAA,IAClB,WAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,cAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,QAAAC,IAAS;AAAA,IACT,IAAAC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hB,EAAQ,CAAC2B,OAAa,EAAE,GAAGA,GAAS,SAASX,EAAA,EAAM;AAAA,YAEvD,WAAW3B;AAAA,YACX,KAAK;AAAA,YACL,aAAaD;AAAA,YACb,cAAW;AAAA,YACX,UAAAhB;AAAA,YACA,UAAU+C;AAAA,UAAA;AAAA,QAAA;AAAA,QAGjB9C,MAAW,QACR,gBAAAa;AAAA,UAAC0C;AAAA,UAAA;AAAA,YACG,KAAK9B;AAAA,YACL,OAAOC,EAAK;AAAA,YACZ,aAAa/B;AAAA,YACb,SAAAD;AAAA,YACA,SAAAY;AAAA,YACA,cAAW;AAAA,YACX,UAAAP;AAAA,YACA,UAAUgD;AAAA,UAAA;AAAA,QAAA;AAAA,MACd,EAAA,CAER;AAAA,IAAA;AAAA,EAAA;AAGZ;"}
|
|
@@ -1,71 +1,69 @@
|
|
|
1
1
|
import { jsxs as k, Fragment as I, jsx as f } from "react/jsx-runtime";
|
|
2
2
|
import { useState as v, useRef as B } from "react";
|
|
3
3
|
import N from "classnames";
|
|
4
|
-
import
|
|
4
|
+
import R from "../hooks/useMergeRef.js";
|
|
5
5
|
import "./utils/index.js";
|
|
6
6
|
import { padTime as p } from "./utils/padTime.js";
|
|
7
7
|
import { clamp as m } from "./utils/clamp.js";
|
|
8
|
-
const
|
|
8
|
+
const V = (d) => {
|
|
9
9
|
const {
|
|
10
10
|
className: g,
|
|
11
11
|
onFocus: s,
|
|
12
12
|
onBlur: i,
|
|
13
|
-
onChange:
|
|
13
|
+
onChange: r,
|
|
14
14
|
ref: h = null,
|
|
15
15
|
setValue: y,
|
|
16
16
|
withSeparator: w = !1,
|
|
17
|
-
max:
|
|
18
|
-
min:
|
|
19
|
-
value:
|
|
17
|
+
max: u,
|
|
18
|
+
min: l = 0,
|
|
19
|
+
value: o,
|
|
20
20
|
...D
|
|
21
|
-
} = d, [
|
|
22
|
-
|
|
23
|
-
typeof s == "function" && s(e), (t = r == null ? void 0 : r.current) == null || t.select(), u(0);
|
|
21
|
+
} = d, [n, c] = v(0), a = B(void 0), T = (e) => {
|
|
22
|
+
typeof s == "function" && s(e), a?.current?.select(), c(0);
|
|
24
23
|
}, x = (e) => {
|
|
25
|
-
typeof i == "function" && i(e),
|
|
24
|
+
typeof i == "function" && i(e), n === 1 && typeof r == "function" && r(e.currentTarget.value, !1);
|
|
26
25
|
}, C = (e) => {
|
|
27
|
-
|
|
28
|
-
e.stopPropagation(), (t = r == null ? void 0 : r.current) == null || t.select();
|
|
26
|
+
e.stopPropagation(), a?.current?.select();
|
|
29
27
|
}, F = (e) => {
|
|
30
28
|
if (e.key === "ArrowUp") {
|
|
31
29
|
e.preventDefault();
|
|
32
30
|
const t = p(
|
|
33
31
|
m(
|
|
34
32
|
parseInt(e.currentTarget.value, 10) + 1,
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
l,
|
|
34
|
+
u
|
|
37
35
|
).toString()
|
|
38
36
|
);
|
|
39
|
-
|
|
37
|
+
o !== t && r(t, !1);
|
|
40
38
|
}
|
|
41
39
|
if (e.key === "ArrowDown") {
|
|
42
40
|
e.preventDefault();
|
|
43
41
|
const t = p(
|
|
44
42
|
m(
|
|
45
43
|
parseInt(e.currentTarget.value, 10) - 1,
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
l,
|
|
45
|
+
u
|
|
48
46
|
).toString()
|
|
49
47
|
);
|
|
50
|
-
|
|
48
|
+
o !== t && r(t, !1);
|
|
51
49
|
}
|
|
52
50
|
}, S = (e) => {
|
|
53
|
-
|
|
51
|
+
c(n + 1);
|
|
54
52
|
const t = parseInt(e.currentTarget.value, 10).toString();
|
|
55
|
-
if (t === "0" &&
|
|
53
|
+
if (t === "0" && n === 0) {
|
|
56
54
|
y("00");
|
|
57
55
|
return;
|
|
58
56
|
}
|
|
59
|
-
|
|
57
|
+
r(t, !0, n > 0);
|
|
60
58
|
};
|
|
61
59
|
return /* @__PURE__ */ k(I, { children: [
|
|
62
60
|
/* @__PURE__ */ f(
|
|
63
61
|
"input",
|
|
64
62
|
{
|
|
65
|
-
ref:
|
|
63
|
+
ref: R(a, h),
|
|
66
64
|
type: "text",
|
|
67
65
|
inputMode: "numeric",
|
|
68
|
-
value:
|
|
66
|
+
value: o,
|
|
69
67
|
className: N("time-input-field", g),
|
|
70
68
|
onChange: S,
|
|
71
69
|
onClick: C,
|
|
@@ -79,6 +77,6 @@ const _ = (d) => {
|
|
|
79
77
|
] });
|
|
80
78
|
};
|
|
81
79
|
export {
|
|
82
|
-
|
|
80
|
+
V as default
|
|
83
81
|
};
|
|
84
82
|
//# sourceMappingURL=TimeInputField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeInputField.js","sources":["../../../../../lib/@ecme/components/ui/TimeInput/TimeInputField.tsx"],"sourcesContent":["import { useRef, useState } from 'react'\nimport classNames from 'classnames'\nimport useMergedRef from '../hooks/useMergeRef'\nimport { clamp, padTime, createTimeHandler } from './utils'\nimport type { CommonProps } from '../@types/common'\nimport type {\n FocusEvent,\n Ref,\n KeyboardEvent,\n MouseEvent,\n ChangeEvent,\n} from 'react'\n\ninterface TimeInputFieldProps extends CommonProps {\n disabled?: boolean\n id?: string\n name?: string\n max?: number\n min?: number\n onChange: ReturnType<typeof createTimeHandler>\n onFocus?: (event: FocusEvent<HTMLInputElement, Element>) => void\n onBlur?: (event: FocusEvent<HTMLInputElement, Element>) => void\n placeholder?: string\n ref?: Ref<HTMLInputElement>\n setValue: (value: string) => void\n withSeparator?: boolean\n value: string | number | readonly string[]\n}\n\nconst TimeInputField = (props: TimeInputFieldProps) => {\n const {\n className,\n onFocus,\n onBlur,\n onChange,\n ref = null,\n setValue,\n withSeparator = false,\n max,\n min = 0,\n value,\n ...rest\n } = props\n\n const [digitsEntered, setDigitsEntered] = useState(0)\n\n const inputRef = useRef<HTMLInputElement>(undefined)\n\n const handleFocus = (event: FocusEvent<HTMLInputElement>) => {\n typeof onFocus === 'function' && onFocus(event)\n inputRef?.current?.select()\n setDigitsEntered(0)\n }\n\n const handleBlur = (event: FocusEvent<HTMLInputElement, Element>) => {\n typeof onBlur === 'function' && onBlur(event)\n if (digitsEntered === 1) {\n typeof onChange === 'function' &&\n onChange(event.currentTarget.value, false)\n }\n }\n\n const handleClick = (event: MouseEvent<HTMLInputElement>) => {\n event.stopPropagation()\n inputRef?.current?.select()\n }\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'ArrowUp') {\n event.preventDefault()\n const padded = padTime(\n clamp(\n parseInt(event.currentTarget.value, 10) + 1,\n min,\n max as number,\n ).toString(),\n )\n\n if (value !== padded) {\n onChange(padded, false)\n }\n }\n\n if (event.key === 'ArrowDown') {\n event.preventDefault()\n const padded = padTime(\n clamp(\n parseInt(event.currentTarget.value, 10) - 1,\n min,\n max as number,\n ).toString(),\n )\n\n if (value !== padded) {\n onChange(padded, false)\n }\n }\n }\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n setDigitsEntered(digitsEntered + 1)\n\n const _val = parseInt(event.currentTarget.value, 10).toString()\n\n if (_val === '0' && digitsEntered === 0) {\n setValue('00')\n return\n }\n onChange(_val, true, digitsEntered > 0)\n }\n\n return (\n <>\n <input\n ref={useMergedRef(inputRef as Ref<HTMLInputElement>, ref)}\n type=\"text\"\n inputMode=\"numeric\"\n value={value}\n className={classNames('time-input-field', className)}\n onChange={handleChange}\n onClick={handleClick}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n {...rest}\n />\n {withSeparator && <span> : </span>}\n </>\n )\n}\n\nexport default TimeInputField\n"],"names":["TimeInputField","props","className","onFocus","onBlur","onChange","ref","setValue","withSeparator","max","min","value","rest","digitsEntered","setDigitsEntered","useState","inputRef","useRef","handleFocus","event","
|
|
1
|
+
{"version":3,"file":"TimeInputField.js","sources":["../../../../../lib/@ecme/components/ui/TimeInput/TimeInputField.tsx"],"sourcesContent":["import { useRef, useState } from 'react'\nimport classNames from 'classnames'\nimport useMergedRef from '../hooks/useMergeRef'\nimport { clamp, padTime, createTimeHandler } from './utils'\nimport type { CommonProps } from '../@types/common'\nimport type {\n FocusEvent,\n Ref,\n KeyboardEvent,\n MouseEvent,\n ChangeEvent,\n} from 'react'\n\ninterface TimeInputFieldProps extends CommonProps {\n disabled?: boolean\n id?: string\n name?: string\n max?: number\n min?: number\n onChange: ReturnType<typeof createTimeHandler>\n onFocus?: (event: FocusEvent<HTMLInputElement, Element>) => void\n onBlur?: (event: FocusEvent<HTMLInputElement, Element>) => void\n placeholder?: string\n ref?: Ref<HTMLInputElement>\n setValue: (value: string) => void\n withSeparator?: boolean\n value: string | number | readonly string[]\n}\n\nconst TimeInputField = (props: TimeInputFieldProps) => {\n const {\n className,\n onFocus,\n onBlur,\n onChange,\n ref = null,\n setValue,\n withSeparator = false,\n max,\n min = 0,\n value,\n ...rest\n } = props\n\n const [digitsEntered, setDigitsEntered] = useState(0)\n\n const inputRef = useRef<HTMLInputElement>(undefined)\n\n const handleFocus = (event: FocusEvent<HTMLInputElement>) => {\n typeof onFocus === 'function' && onFocus(event)\n inputRef?.current?.select()\n setDigitsEntered(0)\n }\n\n const handleBlur = (event: FocusEvent<HTMLInputElement, Element>) => {\n typeof onBlur === 'function' && onBlur(event)\n if (digitsEntered === 1) {\n typeof onChange === 'function' &&\n onChange(event.currentTarget.value, false)\n }\n }\n\n const handleClick = (event: MouseEvent<HTMLInputElement>) => {\n event.stopPropagation()\n inputRef?.current?.select()\n }\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'ArrowUp') {\n event.preventDefault()\n const padded = padTime(\n clamp(\n parseInt(event.currentTarget.value, 10) + 1,\n min,\n max as number,\n ).toString(),\n )\n\n if (value !== padded) {\n onChange(padded, false)\n }\n }\n\n if (event.key === 'ArrowDown') {\n event.preventDefault()\n const padded = padTime(\n clamp(\n parseInt(event.currentTarget.value, 10) - 1,\n min,\n max as number,\n ).toString(),\n )\n\n if (value !== padded) {\n onChange(padded, false)\n }\n }\n }\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n setDigitsEntered(digitsEntered + 1)\n\n const _val = parseInt(event.currentTarget.value, 10).toString()\n\n if (_val === '0' && digitsEntered === 0) {\n setValue('00')\n return\n }\n onChange(_val, true, digitsEntered > 0)\n }\n\n return (\n <>\n <input\n ref={useMergedRef(inputRef as Ref<HTMLInputElement>, ref)}\n type=\"text\"\n inputMode=\"numeric\"\n value={value}\n className={classNames('time-input-field', className)}\n onChange={handleChange}\n onClick={handleClick}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n {...rest}\n />\n {withSeparator && <span> : </span>}\n </>\n )\n}\n\nexport default TimeInputField\n"],"names":["TimeInputField","props","className","onFocus","onBlur","onChange","ref","setValue","withSeparator","max","min","value","rest","digitsEntered","setDigitsEntered","useState","inputRef","useRef","handleFocus","event","handleBlur","handleClick","handleKeyDown","padded","padTime","clamp","handleChange","_val","jsxs","Fragment","jsx","useMergedRef","classNames"],"mappings":";;;;;;;AA6BA,MAAMA,IAAiB,CAACC,MAA+B;AACnD,QAAM;AAAA,IACF,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,IACN,UAAAC;AAAA,IACA,eAAAC,IAAgB;AAAA,IAChB,KAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,IACN,OAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHX,GAEE,CAACY,GAAeC,CAAgB,IAAIC,EAAS,CAAC,GAE9CC,IAAWC,EAAyB,MAAS,GAE7CC,IAAc,CAACC,MAAwC;AACzD,WAAOhB,KAAY,cAAcA,EAAQgB,CAAK,GAC9CH,GAAU,SAAS,OAAA,GACnBF,EAAiB,CAAC;AAAA,EACtB,GAEMM,IAAa,CAACD,MAAiD;AACjE,WAAOf,KAAW,cAAcA,EAAOe,CAAK,GACxCN,MAAkB,KAClB,OAAOR,KAAa,cAChBA,EAASc,EAAM,cAAc,O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