@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,98 +1,95 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { jsx as l, Fragment as V, jsxs as q } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as m, useState as z } from "react";
|
|
3
|
+
import B from "../hooks/useUniqueId.js";
|
|
4
|
+
import D from "../hooks/useMergeRef.js";
|
|
5
|
+
import c from "../hooks/useDidUpdate.js";
|
|
6
|
+
import d from "./TimeInput.js";
|
|
7
7
|
import "../CloseButton/index.js";
|
|
8
|
-
import { HiOutlineClock as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
const
|
|
8
|
+
import { HiOutlineClock as E } from "react-icons/hi";
|
|
9
|
+
import H from "../Input/Input.js";
|
|
10
|
+
import M from "../CloseButton/CloseButton.js";
|
|
11
|
+
const Z = (p) => {
|
|
12
12
|
const {
|
|
13
|
-
amPmPlaceholder:
|
|
14
|
-
clearable:
|
|
15
|
-
className:
|
|
16
|
-
defaultValue:
|
|
13
|
+
amPmPlaceholder: h = "am",
|
|
14
|
+
clearable: g = !1,
|
|
15
|
+
className: x,
|
|
16
|
+
defaultValue: v = [null, null],
|
|
17
17
|
disabled: i = !1,
|
|
18
|
-
format:
|
|
19
|
-
id:
|
|
20
|
-
invalid:
|
|
21
|
-
name:
|
|
18
|
+
format: C = "24",
|
|
19
|
+
id: T,
|
|
20
|
+
invalid: R,
|
|
21
|
+
name: b,
|
|
22
22
|
onChange: n,
|
|
23
|
-
prefix:
|
|
24
|
-
ref:
|
|
25
|
-
seperator:
|
|
26
|
-
showSeconds:
|
|
23
|
+
prefix: y,
|
|
24
|
+
ref: I = null,
|
|
25
|
+
seperator: N = "~",
|
|
26
|
+
showSeconds: P = !1,
|
|
27
27
|
size: s,
|
|
28
|
-
style:
|
|
29
|
-
suffix:
|
|
30
|
-
timeFieldPlaceholder:
|
|
31
|
-
value:
|
|
32
|
-
...
|
|
33
|
-
} =
|
|
34
|
-
|
|
35
|
-
typeof n == "function" && n(
|
|
36
|
-
}, [
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
} }) : /* @__PURE__ */ t(B, { children: F }), f = {
|
|
44
|
-
amPmPlaceholder: v,
|
|
28
|
+
style: k,
|
|
29
|
+
suffix: w = /* @__PURE__ */ l(E, { className: "text-lg" }),
|
|
30
|
+
timeFieldPlaceholder: S = "--",
|
|
31
|
+
value: t,
|
|
32
|
+
...j
|
|
33
|
+
} = p, F = B(T), o = m(void 0), u = m(void 0), [e, r] = z(t ?? v);
|
|
34
|
+
c(() => {
|
|
35
|
+
typeof n == "function" && n(e);
|
|
36
|
+
}, [e]), c(() => {
|
|
37
|
+
t && (t[0]?.getTime() !== e[0]?.getTime() || t[1]?.getTime() !== e[1]?.getTime()) && r(t);
|
|
38
|
+
}, [t]);
|
|
39
|
+
const U = g && e ? /* @__PURE__ */ l(M, { onClick: () => {
|
|
40
|
+
r([null, null]), o.current?.focus();
|
|
41
|
+
} }) : /* @__PURE__ */ l(V, { children: w }), f = {
|
|
42
|
+
amPmPlaceholder: h,
|
|
45
43
|
disabled: i,
|
|
46
|
-
format:
|
|
44
|
+
format: C,
|
|
47
45
|
size: s,
|
|
48
|
-
timeFieldPlaceholder:
|
|
49
|
-
showSeconds:
|
|
46
|
+
timeFieldPlaceholder: S,
|
|
47
|
+
showSeconds: P
|
|
50
48
|
};
|
|
51
|
-
return /* @__PURE__ */
|
|
52
|
-
|
|
49
|
+
return /* @__PURE__ */ l(
|
|
50
|
+
H,
|
|
53
51
|
{
|
|
54
52
|
asElement: "div",
|
|
55
|
-
invalid:
|
|
53
|
+
invalid: R,
|
|
56
54
|
size: s,
|
|
57
|
-
className:
|
|
58
|
-
style:
|
|
55
|
+
className: x,
|
|
56
|
+
style: k,
|
|
59
57
|
disabled: i,
|
|
60
|
-
suffix:
|
|
61
|
-
prefix:
|
|
58
|
+
suffix: U,
|
|
59
|
+
prefix: y,
|
|
62
60
|
onClick: () => {
|
|
63
|
-
|
|
64
|
-
(e = a.current) == null || e.focus();
|
|
61
|
+
o.current?.focus();
|
|
65
62
|
},
|
|
66
|
-
...
|
|
67
|
-
children: /* @__PURE__ */
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
|
|
63
|
+
...j,
|
|
64
|
+
children: /* @__PURE__ */ q("div", { className: "time-input-wrapper", children: [
|
|
65
|
+
/* @__PURE__ */ l(
|
|
66
|
+
d,
|
|
70
67
|
{
|
|
71
|
-
ref:
|
|
72
|
-
|
|
73
|
-
|
|
68
|
+
ref: D(
|
|
69
|
+
o,
|
|
70
|
+
I
|
|
74
71
|
),
|
|
75
72
|
unstyle: !0,
|
|
76
|
-
value:
|
|
77
|
-
name:
|
|
73
|
+
value: e[0],
|
|
74
|
+
name: b,
|
|
78
75
|
nextRef: u,
|
|
79
|
-
id:
|
|
76
|
+
id: F,
|
|
80
77
|
clearable: !1,
|
|
81
78
|
suffix: null,
|
|
82
|
-
onChange: (
|
|
79
|
+
onChange: (a) => r([a, e[1]]),
|
|
83
80
|
...f
|
|
84
81
|
}
|
|
85
82
|
),
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
|
|
83
|
+
/* @__PURE__ */ l("span", { className: "time-input-separator", children: N }),
|
|
84
|
+
/* @__PURE__ */ l(
|
|
85
|
+
d,
|
|
89
86
|
{
|
|
90
87
|
ref: u,
|
|
91
88
|
unstyle: !0,
|
|
92
|
-
value:
|
|
89
|
+
value: e[1],
|
|
93
90
|
clearable: !1,
|
|
94
91
|
suffix: null,
|
|
95
|
-
onChange: (
|
|
92
|
+
onChange: (a) => r([e[0], a]),
|
|
96
93
|
...f
|
|
97
94
|
}
|
|
98
95
|
)
|
|
@@ -101,6 +98,6 @@ const le = (x) => {
|
|
|
101
98
|
);
|
|
102
99
|
};
|
|
103
100
|
export {
|
|
104
|
-
|
|
101
|
+
Z as default
|
|
105
102
|
};
|
|
106
103
|
//# sourceMappingURL=TimeInputRange.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeInputRange.js","sources":["../../../../../lib/@ecme/components/ui/TimeInput/TimeInputRange.tsx"],"sourcesContent":["import { useState, useRef } from 'react'\nimport useUniqueId from '../hooks/useUniqueId'\nimport useMergedRef from '../hooks/useMergeRef'\nimport useDidUpdate from '../hooks/useDidUpdate'\nimport TimeInput from './TimeInput'\nimport CloseButton from '../CloseButton'\nimport { HiOutlineClock } from 'react-icons/hi'\nimport Input from '../Input/Input'\nimport type { CommonProps, TypeAttributes } from '../@types/common'\nimport type { RefObject, Ref, ReactNode } from 'react'\n\ntype Value = [Date | null, Date | null]\n\nexport interface TimeInputRangeProps 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 seperator?: string\n size?: TypeAttributes.ControlSize\n suffix?: string | ReactNode\n timeFieldPlaceholder?: string\n timeFieldClass?: string\n value?: Value\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n field?: any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n form?: any\n}\n\nconst TimeInputRange = (props: TimeInputRangeProps) => {\n const {\n amPmPlaceholder = 'am',\n clearable = false,\n className,\n defaultValue = [null, null],\n disabled = false,\n format = '24',\n id,\n invalid,\n name,\n onChange,\n prefix,\n ref = null,\n seperator = '~',\n showSeconds = false,\n size,\n style,\n suffix = <HiOutlineClock className=\"text-lg\" />,\n timeFieldPlaceholder = '--',\n value,\n ...rest\n } = props\n\n const uuid = useUniqueId(id)\n\n const fromTimeRef = useRef<HTMLInputElement>(undefined)\n const toTimeRef = useRef<HTMLInputElement>(undefined)\n const [_value, setValue] = useState(value ?? defaultValue)\n\n useDidUpdate(() => {\n typeof onChange === 'function' && onChange(_value)\n }, [_value])\n\n useDidUpdate(() => {\n if (\n value &&\n (value[0]?.getTime() !== _value[0]?.getTime() ||\n value[1]?.getTime() !== _value[1]?.getTime())\n ) {\n setValue(value)\n }\n }, [value])\n\n const handleClear = () => {\n setValue([null, null])\n fromTimeRef.current?.focus()\n }\n\n const suffixSlot =\n clearable && _value ? (\n <CloseButton onClick={handleClear} />\n ) : (\n <>{suffix}</>\n )\n\n const forwardProps = {\n amPmPlaceholder,\n disabled,\n format,\n size,\n timeFieldPlaceholder,\n showSeconds,\n }\n\n return (\n <Input\n asElement=\"div\"\n invalid={invalid}\n size={size}\n className={className}\n style={style}\n disabled={disabled}\n suffix={suffixSlot}\n prefix={prefix}\n onClick={() => {\n fromTimeRef.current?.focus()\n }}\n {...rest}\n >\n <div className=\"time-input-wrapper\">\n <TimeInput\n ref={useMergedRef(\n fromTimeRef as Ref<HTMLInputElement>,\n ref,\n )}\n unstyle\n value={_value[0]}\n name={name}\n nextRef={toTimeRef as RefObject<HTMLInputElement | null>}\n id={uuid}\n clearable={false}\n suffix={null}\n onChange={(date) => setValue([date, _value[1]])}\n {...forwardProps}\n />\n\n <span className=\"time-input-separator\">{seperator}</span>\n\n <TimeInput\n ref={toTimeRef as Ref<HTMLInputElement>}\n unstyle\n value={_value[1]}\n clearable={false}\n suffix={null}\n onChange={(date) => setValue([_value[0], date])}\n {...forwardProps}\n />\n </div>\n </Input>\n )\n}\n\nexport default TimeInputRange\n"],"names":["TimeInputRange","props","amPmPlaceholder","clearable","className","defaultValue","disabled","format","id","invalid","name","onChange","prefix","ref","seperator","showSeconds","size","style","suffix","jsx","HiOutlineClock","timeFieldPlaceholder","value","rest","uuid","useUniqueId","fromTimeRef","useRef","toTimeRef","_value","setValue","useState","useDidUpdate","
|
|
1
|
+
{"version":3,"file":"TimeInputRange.js","sources":["../../../../../lib/@ecme/components/ui/TimeInput/TimeInputRange.tsx"],"sourcesContent":["import { useState, useRef } from 'react'\nimport useUniqueId from '../hooks/useUniqueId'\nimport useMergedRef from '../hooks/useMergeRef'\nimport useDidUpdate from '../hooks/useDidUpdate'\nimport TimeInput from './TimeInput'\nimport CloseButton from '../CloseButton'\nimport { HiOutlineClock } from 'react-icons/hi'\nimport Input from '../Input/Input'\nimport type { CommonProps, TypeAttributes } from '../@types/common'\nimport type { RefObject, Ref, ReactNode } from 'react'\n\ntype Value = [Date | null, Date | null]\n\nexport interface TimeInputRangeProps 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 seperator?: string\n size?: TypeAttributes.ControlSize\n suffix?: string | ReactNode\n timeFieldPlaceholder?: string\n timeFieldClass?: string\n value?: Value\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n field?: any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n form?: any\n}\n\nconst TimeInputRange = (props: TimeInputRangeProps) => {\n const {\n amPmPlaceholder = 'am',\n clearable = false,\n className,\n defaultValue = [null, null],\n disabled = false,\n format = '24',\n id,\n invalid,\n name,\n onChange,\n prefix,\n ref = null,\n seperator = '~',\n showSeconds = false,\n size,\n style,\n suffix = <HiOutlineClock className=\"text-lg\" />,\n timeFieldPlaceholder = '--',\n value,\n ...rest\n } = props\n\n const uuid = useUniqueId(id)\n\n const fromTimeRef = useRef<HTMLInputElement>(undefined)\n const toTimeRef = useRef<HTMLInputElement>(undefined)\n const [_value, setValue] = useState(value ?? defaultValue)\n\n useDidUpdate(() => {\n typeof onChange === 'function' && onChange(_value)\n }, [_value])\n\n useDidUpdate(() => {\n if (\n value &&\n (value[0]?.getTime() !== _value[0]?.getTime() ||\n value[1]?.getTime() !== _value[1]?.getTime())\n ) {\n setValue(value)\n }\n }, [value])\n\n const handleClear = () => {\n setValue([null, null])\n fromTimeRef.current?.focus()\n }\n\n const suffixSlot =\n clearable && _value ? (\n <CloseButton onClick={handleClear} />\n ) : (\n <>{suffix}</>\n )\n\n const forwardProps = {\n amPmPlaceholder,\n disabled,\n format,\n size,\n timeFieldPlaceholder,\n showSeconds,\n }\n\n return (\n <Input\n asElement=\"div\"\n invalid={invalid}\n size={size}\n className={className}\n style={style}\n disabled={disabled}\n suffix={suffixSlot}\n prefix={prefix}\n onClick={() => {\n fromTimeRef.current?.focus()\n }}\n {...rest}\n >\n <div className=\"time-input-wrapper\">\n <TimeInput\n ref={useMergedRef(\n fromTimeRef as Ref<HTMLInputElement>,\n ref,\n )}\n unstyle\n value={_value[0]}\n name={name}\n nextRef={toTimeRef as RefObject<HTMLInputElement | null>}\n id={uuid}\n clearable={false}\n suffix={null}\n onChange={(date) => setValue([date, _value[1]])}\n {...forwardProps}\n />\n\n <span className=\"time-input-separator\">{seperator}</span>\n\n <TimeInput\n ref={toTimeRef as Ref<HTMLInputElement>}\n unstyle\n value={_value[1]}\n clearable={false}\n suffix={null}\n onChange={(date) => setValue([_value[0], date])}\n {...forwardProps}\n />\n </div>\n </Input>\n )\n}\n\nexport default TimeInputRange\n"],"names":["TimeInputRange","props","amPmPlaceholder","clearable","className","defaultValue","disabled","format","id","invalid","name","onChange","prefix","ref","seperator","showSeconds","size","style","suffix","jsx","HiOutlineClock","timeFieldPlaceholder","value","rest","uuid","useUniqueId","fromTimeRef","useRef","toTimeRef","_value","setValue","useState","useDidUpdate","suffixSlot","CloseButton","Fragment","forwardProps","Input","jsxs","TimeInput","useMergedRef","date"],"mappings":"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"}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
function
|
|
2
|
-
amLabel:
|
|
3
|
-
pmLabel:
|
|
4
|
-
onChange:
|
|
5
|
-
nextRef:
|
|
1
|
+
function w({
|
|
2
|
+
amLabel: r,
|
|
3
|
+
pmLabel: t,
|
|
4
|
+
onChange: c,
|
|
5
|
+
nextRef: n
|
|
6
6
|
}) {
|
|
7
|
-
return (
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
u(c), t && ((w = r == null ? void 0 : r.current) == null || w.focus()), t && (($ = r == null ? void 0 : r.current) == null || $.select());
|
|
7
|
+
return (s, o) => {
|
|
8
|
+
const u = new RegExp(`(^(${r}|${t})?$)`), e = s.toLowerCase();
|
|
9
|
+
if (e === r || e === t) {
|
|
10
|
+
c(e), o && n?.current?.focus(), o && n?.current?.select();
|
|
12
11
|
return;
|
|
13
12
|
}
|
|
14
|
-
|
|
13
|
+
u.test(e) && c(e);
|
|
15
14
|
};
|
|
16
15
|
}
|
|
17
16
|
export {
|
|
18
|
-
|
|
17
|
+
w as createAmPmHandler
|
|
19
18
|
};
|
|
20
19
|
//# sourceMappingURL=createAmPmHandler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAmPmHandler.js","sources":["../../../../../../lib/@ecme/components/ui/TimeInput/utils/createAmPmHandler.ts"],"sourcesContent":["import type { RefObject } from 'react'\n\ntype CreateAmPmHandlerParams = {\n amLabel: string\n pmLabel: string\n onChange(value: string): void\n nextRef?: RefObject<HTMLInputElement | null>\n}\n\nexport function createAmPmHandler({\n amLabel,\n pmLabel,\n onChange,\n nextRef,\n}: CreateAmPmHandlerParams) {\n return (value: string, triggerShift: boolean) => {\n const testRegex = new RegExp(`(^(${amLabel}|${pmLabel})?$)`)\n const valLower = value.toLowerCase()\n\n if (valLower === amLabel || valLower === pmLabel) {\n onChange(valLower)\n triggerShift && nextRef?.current?.focus()\n triggerShift && nextRef?.current?.select()\n return\n }\n\n if (!testRegex.test(valLower)) {\n return\n }\n\n onChange(valLower)\n }\n}\n"],"names":["createAmPmHandler","amLabel","pmLabel","onChange","nextRef","value","triggerShift","
|
|
1
|
+
{"version":3,"file":"createAmPmHandler.js","sources":["../../../../../../lib/@ecme/components/ui/TimeInput/utils/createAmPmHandler.ts"],"sourcesContent":["import type { RefObject } from 'react'\n\ntype CreateAmPmHandlerParams = {\n amLabel: string\n pmLabel: string\n onChange(value: string): void\n nextRef?: RefObject<HTMLInputElement | null>\n}\n\nexport function createAmPmHandler({\n amLabel,\n pmLabel,\n onChange,\n nextRef,\n}: CreateAmPmHandlerParams) {\n return (value: string, triggerShift: boolean) => {\n const testRegex = new RegExp(`(^(${amLabel}|${pmLabel})?$)`)\n const valLower = value.toLowerCase()\n\n if (valLower === amLabel || valLower === pmLabel) {\n onChange(valLower)\n triggerShift && nextRef?.current?.focus()\n triggerShift && nextRef?.current?.select()\n return\n }\n\n if (!testRegex.test(valLower)) {\n return\n }\n\n onChange(valLower)\n }\n}\n"],"names":["createAmPmHandler","amLabel","pmLabel","onChange","nextRef","value","triggerShift","testRegex","valLower"],"mappings":"AASO,SAASA,EAAkB;AAAA,EAC9B,SAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AACJ,GAA4B;AACxB,SAAO,CAACC,GAAeC,MAA0B;AAC7C,UAAMC,IAAY,IAAI,OAAO,MAAMN,CAAO,IAAIC,CAAO,MAAM,GACrDM,IAAWH,EAAM,YAAA;AAEvB,QAAIG,MAAaP,KAAWO,MAAaN,GAAS;AAC9C,MAAAC,EAASK,CAAQ,GACjBF,KAAgBF,GAAS,SAAS,MAAA,GAClCE,KAAgBF,GAAS,SAAS,OAAA;AAClC;AAAA,IACJ;AAEA,IAAKG,EAAU,KAAKC,CAAQ,KAI5BL,EAASK,CAAQ;AAAA,EACrB;AACJ;"}
|
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
import { padTime as
|
|
2
|
-
import { clamp as
|
|
3
|
-
function
|
|
4
|
-
return Math.floor(
|
|
1
|
+
import { padTime as o } from "./padTime.js";
|
|
2
|
+
import { clamp as d } from "./clamp.js";
|
|
3
|
+
function n(r) {
|
|
4
|
+
return Math.floor(r / 10);
|
|
5
5
|
}
|
|
6
|
-
function
|
|
7
|
-
onChange:
|
|
8
|
-
nextRef:
|
|
9
|
-
min:
|
|
10
|
-
max:
|
|
11
|
-
nextMax:
|
|
6
|
+
function S({
|
|
7
|
+
onChange: r,
|
|
8
|
+
nextRef: u,
|
|
9
|
+
min: f,
|
|
10
|
+
max: e,
|
|
11
|
+
nextMax: l
|
|
12
12
|
}) {
|
|
13
|
-
return (
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
r > o && c && n <= a(c) ? (u = l(a(r).toString()), d = l(n.toString())) : u = l(S(r, e, o).toString()), i(u, d), s && ((p = t == null ? void 0 : t.current) == null || p.focus()), s && ((m = t == null ? void 0 : t.current) == null || m.select());
|
|
13
|
+
return (p, a, m = !1) => {
|
|
14
|
+
const t = parseInt(p, 10);
|
|
15
|
+
if (!Number.isNaN(t)) {
|
|
16
|
+
if (t > n(e) || m) {
|
|
17
|
+
const c = t % 10;
|
|
18
|
+
let i, s;
|
|
19
|
+
t > e && l && c <= n(l) ? (i = o(n(t).toString()), s = o(c.toString())) : i = o(d(t, f, e).toString()), r(i, s), a && u?.current?.focus(), a && u?.current?.select();
|
|
21
20
|
return;
|
|
22
21
|
}
|
|
23
|
-
|
|
22
|
+
r(t.toString());
|
|
24
23
|
}
|
|
25
24
|
};
|
|
26
25
|
}
|
|
27
26
|
export {
|
|
28
|
-
|
|
27
|
+
S as createTimeHandler
|
|
29
28
|
};
|
|
30
29
|
//# sourceMappingURL=createTimeHandler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTimeHandler.js","sources":["../../../../../../lib/@ecme/components/ui/TimeInput/utils/createTimeHandler.ts"],"sourcesContent":["import { padTime } from './padTime'\nimport { clamp } from './clamp'\nimport type { RefObject } from 'react'\n\nfunction allButLastDigit(value: number) {\n return Math.floor(value / 10)\n}\n\ntype CreateTimeHandlerParams = {\n onChange(value: string, carryOver?: string): void\n nextRef?: RefObject<HTMLInputElement | null>\n min: number\n max: number\n nextMax?: number\n}\n\nexport function createTimeHandler({\n onChange,\n nextRef,\n min,\n max,\n nextMax,\n}: CreateTimeHandlerParams) {\n return (\n value: string,\n triggerShift: boolean,\n forceTriggerShift = false,\n ) => {\n const parsed = parseInt(value, 10)\n\n if (Number.isNaN(parsed)) {\n return\n }\n\n if (parsed > allButLastDigit(max) || forceTriggerShift) {\n const lastDigit = parsed % 10\n\n let updatedValue\n let carryOver\n\n if (\n parsed > max &&\n nextMax &&\n lastDigit <= allButLastDigit(nextMax)\n ) {\n updatedValue = padTime(allButLastDigit(parsed).toString())\n carryOver = padTime(lastDigit.toString())\n } else {\n updatedValue = padTime(clamp(parsed, min, max).toString())\n }\n\n onChange(updatedValue, carryOver)\n triggerShift && nextRef?.current?.focus()\n triggerShift && nextRef?.current?.select()\n return\n }\n\n onChange(parsed.toString())\n }\n}\n"],"names":["allButLastDigit","value","createTimeHandler","onChange","nextRef","min","max","nextMax","triggerShift","forceTriggerShift","parsed","lastDigit","updatedValue","carryOver","padTime","clamp"
|
|
1
|
+
{"version":3,"file":"createTimeHandler.js","sources":["../../../../../../lib/@ecme/components/ui/TimeInput/utils/createTimeHandler.ts"],"sourcesContent":["import { padTime } from './padTime'\nimport { clamp } from './clamp'\nimport type { RefObject } from 'react'\n\nfunction allButLastDigit(value: number) {\n return Math.floor(value / 10)\n}\n\ntype CreateTimeHandlerParams = {\n onChange(value: string, carryOver?: string): void\n nextRef?: RefObject<HTMLInputElement | null>\n min: number\n max: number\n nextMax?: number\n}\n\nexport function createTimeHandler({\n onChange,\n nextRef,\n min,\n max,\n nextMax,\n}: CreateTimeHandlerParams) {\n return (\n value: string,\n triggerShift: boolean,\n forceTriggerShift = false,\n ) => {\n const parsed = parseInt(value, 10)\n\n if (Number.isNaN(parsed)) {\n return\n }\n\n if (parsed > allButLastDigit(max) || forceTriggerShift) {\n const lastDigit = parsed % 10\n\n let updatedValue\n let carryOver\n\n if (\n parsed > max &&\n nextMax &&\n lastDigit <= allButLastDigit(nextMax)\n ) {\n updatedValue = padTime(allButLastDigit(parsed).toString())\n carryOver = padTime(lastDigit.toString())\n } else {\n updatedValue = padTime(clamp(parsed, min, max).toString())\n }\n\n onChange(updatedValue, carryOver)\n triggerShift && nextRef?.current?.focus()\n triggerShift && nextRef?.current?.select()\n return\n }\n\n onChange(parsed.toString())\n }\n}\n"],"names":["allButLastDigit","value","createTimeHandler","onChange","nextRef","min","max","nextMax","triggerShift","forceTriggerShift","parsed","lastDigit","updatedValue","carryOver","padTime","clamp"],"mappings":";;AAIA,SAASA,EAAgBC,GAAe;AACpC,SAAO,KAAK,MAAMA,IAAQ,EAAE;AAChC;AAUO,SAASC,EAAkB;AAAA,EAC9B,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,KAAAC;AAAA,EACA,KAAAC;AAAA,EACA,SAAAC;AACJ,GAA4B;AACxB,SAAO,CACHN,GACAO,GACAC,IAAoB,OACnB;AACD,UAAMC,IAAS,SAAST,GAAO,EAAE;AAEjC,QAAI,QAAO,MAAMS,CAAM,GAIvB;AAAA,UAAIA,IAASV,EAAgBM,CAAG,KAAKG,GAAmB;AACpD,cAAME,IAAYD,IAAS;AAE3B,YAAIE,GACAC;AAEJ,QACIH,IAASJ,KACTC,KACAI,KAAaX,EAAgBO,CAAO,KAEpCK,IAAeE,EAAQd,EAAgBU,CAAM,EAAE,UAAU,GACzDG,IAAYC,EAAQH,EAAU,UAAU,KAExCC,IAAeE,EAAQC,EAAML,GAAQL,GAAKC,CAAG,EAAE,UAAU,GAG7DH,EAASS,GAAcC,CAAS,GAChCL,KAAgBJ,GAAS,SAAS,MAAA,GAClCI,KAAgBJ,GAAS,SAAS,OAAA;AAClC;AAAA,MACJ;AAEA,MAAAD,EAASO,EAAO,UAAU;AAAA;AAAA,EAC9B;AACJ;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import
|
|
1
|
+
import { jsx as a, jsxs as D, Fragment as K } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as Q, useState as O, useEffect as V, useCallback as g } from "react";
|
|
3
|
+
import h from "../utils/classNames.js";
|
|
4
4
|
import W from "lodash/cloneDeep";
|
|
5
5
|
import X from "./FileItem.js";
|
|
6
6
|
import Y from "../Button/Button.js";
|
|
@@ -8,130 +8,129 @@ import "../CloseButton/index.js";
|
|
|
8
8
|
import Z from "../Notification/Notification.js";
|
|
9
9
|
import ee from "../toast/toast.js";
|
|
10
10
|
import te from "../CloseButton/CloseButton.js";
|
|
11
|
-
const
|
|
11
|
+
const k = (i) => (
|
|
12
12
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
13
|
Object.keys(i).map((d) => i[d])
|
|
14
14
|
), pe = (i) => {
|
|
15
15
|
const {
|
|
16
16
|
accept: d,
|
|
17
|
-
beforeUpload:
|
|
18
|
-
disabled:
|
|
17
|
+
beforeUpload: v,
|
|
18
|
+
disabled: s = !1,
|
|
19
19
|
draggable: r = !1,
|
|
20
20
|
fileList: n = [],
|
|
21
|
-
fileListClass:
|
|
22
|
-
fileItemClass:
|
|
23
|
-
multiple:
|
|
24
|
-
onChange:
|
|
25
|
-
onFileRemove:
|
|
21
|
+
fileListClass: L,
|
|
22
|
+
fileItemClass: U,
|
|
23
|
+
multiple: j,
|
|
24
|
+
onChange: I,
|
|
25
|
+
onFileRemove: S,
|
|
26
26
|
ref: J,
|
|
27
27
|
showList: w = !0,
|
|
28
28
|
tip: x,
|
|
29
29
|
uploadLimit: f,
|
|
30
|
-
children:
|
|
30
|
+
children: p,
|
|
31
31
|
className: B,
|
|
32
|
-
...
|
|
33
|
-
} = i,
|
|
32
|
+
...b
|
|
33
|
+
} = i, C = Q(null), [l, u] = O(n), [E, m] = O(!1);
|
|
34
34
|
V(() => {
|
|
35
|
-
JSON.stringify(
|
|
35
|
+
JSON.stringify(l) !== JSON.stringify(n) && u(n);
|
|
36
36
|
}, [JSON.stringify(n)]);
|
|
37
|
-
const
|
|
37
|
+
const N = (t = "") => {
|
|
38
38
|
ee.push(
|
|
39
|
-
/* @__PURE__ */
|
|
39
|
+
/* @__PURE__ */ a(Z, { type: "danger", duration: 2e3, children: t || "Upload Failed!" }),
|
|
40
40
|
{
|
|
41
41
|
placement: "top-center"
|
|
42
42
|
}
|
|
43
43
|
);
|
|
44
|
-
},
|
|
44
|
+
}, F = (t, e) => {
|
|
45
45
|
if (t)
|
|
46
|
-
for (const
|
|
47
|
-
e.push(
|
|
46
|
+
for (const o of t)
|
|
47
|
+
e.push(o);
|
|
48
48
|
return e;
|
|
49
49
|
}, P = (t) => {
|
|
50
|
-
let e = W(
|
|
51
|
-
return typeof f == "number" && f !== 0 && Object.keys(e).length >= f ? (f === 1 && (e.shift(), e =
|
|
52
|
-
},
|
|
50
|
+
let e = W(l);
|
|
51
|
+
return typeof f == "number" && f !== 0 && Object.keys(e).length >= f ? (f === 1 && (e.shift(), e = F(t, e)), k({ ...e })) : (e = F(t, e), k({ ...e }));
|
|
52
|
+
}, R = (t) => {
|
|
53
53
|
const { files: e } = t.target;
|
|
54
|
-
let
|
|
55
|
-
if (
|
|
56
|
-
if (
|
|
57
|
-
|
|
54
|
+
let o = !0;
|
|
55
|
+
if (v) {
|
|
56
|
+
if (o = v(e, l), o === !1) {
|
|
57
|
+
N();
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
|
-
if (typeof
|
|
61
|
-
|
|
60
|
+
if (typeof o == "string" && o.length > 0) {
|
|
61
|
+
N(o);
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
if (
|
|
65
|
+
if (o) {
|
|
66
66
|
const c = P(e);
|
|
67
|
-
|
|
67
|
+
u(c), I?.(c, l);
|
|
68
68
|
}
|
|
69
|
+
}, A = (t) => {
|
|
70
|
+
const e = l.filter((o, c) => c !== t);
|
|
71
|
+
u(e), S?.(e);
|
|
69
72
|
}, M = (t) => {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
},
|
|
76
|
-
r &&
|
|
77
|
-
}, [r]),
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
},
|
|
82
|
-
onDragLeave: $,
|
|
83
|
-
onDragOver: q,
|
|
84
|
-
onDrop: z
|
|
85
|
-
}, O = "border-primary", H = v(
|
|
73
|
+
s || C.current?.click(), t.stopPropagation();
|
|
74
|
+
}, T = () => !r && !p ? /* @__PURE__ */ a(Y, { disabled: s, onClick: (t) => t.preventDefault(), children: "Upload" }) : r && !p ? /* @__PURE__ */ a("span", { children: "Choose a file or drag and drop here" }) : p, _ = g(() => {
|
|
75
|
+
r && m(!1);
|
|
76
|
+
}, [r]), $ = g(() => {
|
|
77
|
+
r && !s && m(!0);
|
|
78
|
+
}, [r, s]), q = g(() => {
|
|
79
|
+
r && m(!1);
|
|
80
|
+
}, [r]), z = {
|
|
81
|
+
onDragLeave: _,
|
|
82
|
+
onDragOver: $,
|
|
83
|
+
onDrop: q
|
|
84
|
+
}, y = "border-primary", G = h(
|
|
86
85
|
"upload",
|
|
87
86
|
r && "upload-draggable",
|
|
88
|
-
r && !
|
|
89
|
-
r &&
|
|
90
|
-
E &&
|
|
87
|
+
r && !s && `hover:${y}`,
|
|
88
|
+
r && s && "disabled",
|
|
89
|
+
E && y,
|
|
91
90
|
B
|
|
92
|
-
),
|
|
91
|
+
), H = h(
|
|
93
92
|
"upload-input",
|
|
94
93
|
r && "draggable"
|
|
95
94
|
);
|
|
96
|
-
return /* @__PURE__ */
|
|
97
|
-
/* @__PURE__ */
|
|
95
|
+
return /* @__PURE__ */ D(K, { children: [
|
|
96
|
+
/* @__PURE__ */ D(
|
|
98
97
|
"div",
|
|
99
98
|
{
|
|
100
99
|
ref: J,
|
|
101
|
-
className:
|
|
102
|
-
...r ?
|
|
103
|
-
...
|
|
100
|
+
className: G,
|
|
101
|
+
...r ? z : { onClick: M },
|
|
102
|
+
...b,
|
|
104
103
|
children: [
|
|
105
|
-
/* @__PURE__ */
|
|
104
|
+
/* @__PURE__ */ a(
|
|
106
105
|
"input",
|
|
107
106
|
{
|
|
108
|
-
ref:
|
|
109
|
-
className:
|
|
107
|
+
ref: C,
|
|
108
|
+
className: H,
|
|
110
109
|
type: "file",
|
|
111
|
-
disabled:
|
|
112
|
-
multiple:
|
|
110
|
+
disabled: s,
|
|
111
|
+
multiple: j,
|
|
113
112
|
accept: d,
|
|
114
113
|
title: "",
|
|
115
114
|
value: "",
|
|
116
|
-
onChange:
|
|
117
|
-
...
|
|
115
|
+
onChange: R,
|
|
116
|
+
...b
|
|
118
117
|
}
|
|
119
118
|
),
|
|
120
|
-
|
|
119
|
+
T()
|
|
121
120
|
]
|
|
122
121
|
}
|
|
123
122
|
),
|
|
124
123
|
x,
|
|
125
|
-
w && /* @__PURE__ */
|
|
124
|
+
w && /* @__PURE__ */ a("div", { className: h("upload-file-list", L), children: l.map((t, e) => /* @__PURE__ */ a(
|
|
126
125
|
X,
|
|
127
126
|
{
|
|
128
127
|
file: t,
|
|
129
|
-
className:
|
|
130
|
-
children: /* @__PURE__ */
|
|
128
|
+
className: U,
|
|
129
|
+
children: /* @__PURE__ */ a(
|
|
131
130
|
te,
|
|
132
131
|
{
|
|
133
132
|
className: "upload-file-remove",
|
|
134
|
-
onClick: () =>
|
|
133
|
+
onClick: () => A(e)
|
|
135
134
|
}
|
|
136
135
|
)
|
|
137
136
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Upload.js","sources":["../../../../../lib/@ecme/components/ui/Upload/Upload.tsx"],"sourcesContent":["import { useRef, useState, useCallback, useEffect } from 'react'\nimport classNames from '../utils/classNames'\nimport cloneDeep from 'lodash/cloneDeep'\nimport FileItem from './FileItem'\nimport Button from '../Button/Button'\nimport CloseButton from '../CloseButton'\nimport Notification from '../Notification/Notification'\nimport toast from '../toast/toast'\nimport type { CommonProps } from '../@types/common'\nimport type { ReactNode, ChangeEvent, MouseEvent, Ref } from 'react'\n\nexport interface UploadProps extends CommonProps {\n accept?: string\n beforeUpload?: (file: FileList | null, fileList: File[]) => boolean | string\n disabled?: boolean\n draggable?: boolean\n fileList?: File[]\n fileListClass?: string\n fileItemClass?: string\n multiple?: boolean\n onChange?: (file: File[], fileList: File[]) => void\n onFileRemove?: (file: File[]) => void\n ref?: Ref<HTMLDivElement>\n showList?: boolean\n tip?: string | ReactNode\n uploadLimit?: number\n}\n\nconst filesToArray = (files: File[]) =>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Object.keys(files).map((key) => files[key as any])\n\nconst Upload = (props: UploadProps) => {\n const {\n accept,\n beforeUpload,\n disabled = false,\n draggable = false,\n fileList = [],\n fileListClass,\n fileItemClass,\n multiple,\n onChange,\n onFileRemove,\n ref,\n showList = true,\n tip,\n uploadLimit,\n children,\n className,\n ...rest\n } = props\n\n const fileInputField = useRef<HTMLInputElement>(null)\n const [files, setFiles] = useState(fileList)\n const [dragOver, setDragOver] = useState(false)\n\n useEffect(() => {\n if (JSON.stringify(files) !== JSON.stringify(fileList)) {\n setFiles(fileList)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [JSON.stringify(fileList)])\n\n const triggerMessage = (msg: string | ReactNode = '') => {\n toast.push(\n <Notification type=\"danger\" duration={2000}>\n {msg || 'Upload Failed!'}\n </Notification>,\n {\n placement: 'top-center',\n },\n )\n }\n\n const pushFile = (newFiles: FileList | null, file: File[]) => {\n if (newFiles) {\n for (const f of newFiles) {\n file.push(f)\n }\n }\n\n return file\n }\n\n const addNewFiles = (newFiles: FileList | null) => {\n let file = cloneDeep(files)\n if (typeof uploadLimit === 'number' && uploadLimit !== 0) {\n if (Object.keys(file).length >= uploadLimit) {\n if (uploadLimit === 1) {\n file.shift()\n file = pushFile(newFiles, file)\n }\n\n return filesToArray({ ...file })\n }\n }\n file = pushFile(newFiles, file)\n return filesToArray({ ...file })\n }\n\n const onNewFileUpload = (e: ChangeEvent<HTMLInputElement>) => {\n const { files: newFiles } = e.target\n let result: boolean | string = true\n\n if (beforeUpload) {\n result = beforeUpload(newFiles, files)\n\n if (result === false) {\n triggerMessage()\n return\n }\n\n if (typeof result === 'string' && result.length > 0) {\n triggerMessage(result)\n return\n }\n }\n\n if (result) {\n const updatedFiles = addNewFiles(newFiles)\n setFiles(updatedFiles)\n onChange?.(updatedFiles, files)\n }\n }\n\n const removeFile = (fileIndex: number) => {\n const deletedFileList = files.filter((_, index) => index !== fileIndex)\n setFiles(deletedFileList)\n onFileRemove?.(deletedFileList)\n }\n\n const triggerUpload = (e: MouseEvent<HTMLDivElement>) => {\n if (!disabled) {\n fileInputField.current?.click()\n }\n e.stopPropagation()\n }\n\n const renderChildren = () => {\n if (!draggable && !children) {\n return (\n <Button disabled={disabled} onClick={(e) => e.preventDefault()}>\n Upload\n </Button>\n )\n }\n\n if (draggable && !children) {\n return <span>Choose a file or drag and drop here</span>\n }\n\n return children\n }\n\n const handleDragLeave = useCallback(() => {\n if (draggable) {\n setDragOver(false)\n }\n }, [draggable])\n\n const handleDragOver = useCallback(() => {\n if (draggable && !disabled) {\n setDragOver(true)\n }\n }, [draggable, disabled])\n\n const handleDrop = useCallback(() => {\n if (draggable) {\n setDragOver(false)\n }\n }, [draggable])\n\n const draggableProp = {\n onDragLeave: handleDragLeave,\n onDragOver: handleDragOver,\n onDrop: handleDrop,\n }\n\n const draggableEventFeedbackClass = `border-primary`\n\n const uploadClass = classNames(\n 'upload',\n draggable && `upload-draggable`,\n draggable && !disabled && `hover:${draggableEventFeedbackClass}`,\n draggable && disabled && 'disabled',\n dragOver && draggableEventFeedbackClass,\n className,\n )\n\n const uploadInputClass = classNames(\n 'upload-input',\n draggable && `draggable`,\n )\n\n return (\n <>\n <div\n ref={ref}\n className={uploadClass}\n {...(draggable ? draggableProp : { onClick: triggerUpload })}\n {...rest}\n >\n <input\n ref={fileInputField}\n className={uploadInputClass}\n type=\"file\"\n disabled={disabled}\n multiple={multiple}\n accept={accept}\n title=\"\"\n value=\"\"\n onChange={onNewFileUpload}\n {...rest}\n ></input>\n {renderChildren()}\n </div>\n {tip}\n {showList && (\n <div className={classNames('upload-file-list', fileListClass)}>\n {files.map((file, index) => (\n <FileItem\n key={file.name + index}\n file={file}\n className={fileItemClass}\n >\n <CloseButton\n className=\"upload-file-remove\"\n onClick={() => removeFile(index)}\n />\n </FileItem>\n ))}\n </div>\n )}\n </>\n )\n}\n\nexport default Upload\n"],"names":["filesToArray","files","key","Upload","props","accept","beforeUpload","disabled","draggable","fileList","fileListClass","fileItemClass","multiple","onChange","onFileRemove","ref","showList","tip","uploadLimit","children","className","rest","fileInputField","useRef","setFiles","useState","dragOver","setDragOver","useEffect","triggerMessage","msg","toast","Notification","pushFile","newFiles","file","f","addNewFiles","cloneDeep","onNewFileUpload","e","result","updatedFiles","removeFile","fileIndex","deletedFileList","_","index","triggerUpload","_a","renderChildren","jsx","Button","handleDragLeave","useCallback","handleDragOver","handleDrop","draggableProp","draggableEventFeedbackClass","uploadClass","classNames","uploadInputClass","jsxs","Fragment","FileItem","CloseButton"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"Upload.js","sources":["../../../../../lib/@ecme/components/ui/Upload/Upload.tsx"],"sourcesContent":["import { useRef, useState, useCallback, useEffect } from 'react'\nimport classNames from '../utils/classNames'\nimport cloneDeep from 'lodash/cloneDeep'\nimport FileItem from './FileItem'\nimport Button from '../Button/Button'\nimport CloseButton from '../CloseButton'\nimport Notification from '../Notification/Notification'\nimport toast from '../toast/toast'\nimport type { CommonProps } from '../@types/common'\nimport type { ReactNode, ChangeEvent, MouseEvent, Ref } from 'react'\n\nexport interface UploadProps extends CommonProps {\n accept?: string\n beforeUpload?: (file: FileList | null, fileList: File[]) => boolean | string\n disabled?: boolean\n draggable?: boolean\n fileList?: File[]\n fileListClass?: string\n fileItemClass?: string\n multiple?: boolean\n onChange?: (file: File[], fileList: File[]) => void\n onFileRemove?: (file: File[]) => void\n ref?: Ref<HTMLDivElement>\n showList?: boolean\n tip?: string | ReactNode\n uploadLimit?: number\n}\n\nconst filesToArray = (files: File[]) =>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Object.keys(files).map((key) => files[key as any])\n\nconst Upload = (props: UploadProps) => {\n const {\n accept,\n beforeUpload,\n disabled = false,\n draggable = false,\n fileList = [],\n fileListClass,\n fileItemClass,\n multiple,\n onChange,\n onFileRemove,\n ref,\n showList = true,\n tip,\n uploadLimit,\n children,\n className,\n ...rest\n } = props\n\n const fileInputField = useRef<HTMLInputElement>(null)\n const [files, setFiles] = useState(fileList)\n const [dragOver, setDragOver] = useState(false)\n\n useEffect(() => {\n if (JSON.stringify(files) !== JSON.stringify(fileList)) {\n setFiles(fileList)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [JSON.stringify(fileList)])\n\n const triggerMessage = (msg: string | ReactNode = '') => {\n toast.push(\n <Notification type=\"danger\" duration={2000}>\n {msg || 'Upload Failed!'}\n </Notification>,\n {\n placement: 'top-center',\n },\n )\n }\n\n const pushFile = (newFiles: FileList | null, file: File[]) => {\n if (newFiles) {\n for (const f of newFiles) {\n file.push(f)\n }\n }\n\n return file\n }\n\n const addNewFiles = (newFiles: FileList | null) => {\n let file = cloneDeep(files)\n if (typeof uploadLimit === 'number' && uploadLimit !== 0) {\n if (Object.keys(file).length >= uploadLimit) {\n if (uploadLimit === 1) {\n file.shift()\n file = pushFile(newFiles, file)\n }\n\n return filesToArray({ ...file })\n }\n }\n file = pushFile(newFiles, file)\n return filesToArray({ ...file })\n }\n\n const onNewFileUpload = (e: ChangeEvent<HTMLInputElement>) => {\n const { files: newFiles } = e.target\n let result: boolean | string = true\n\n if (beforeUpload) {\n result = beforeUpload(newFiles, files)\n\n if (result === false) {\n triggerMessage()\n return\n }\n\n if (typeof result === 'string' && result.length > 0) {\n triggerMessage(result)\n return\n }\n }\n\n if (result) {\n const updatedFiles = addNewFiles(newFiles)\n setFiles(updatedFiles)\n onChange?.(updatedFiles, files)\n }\n }\n\n const removeFile = (fileIndex: number) => {\n const deletedFileList = files.filter((_, index) => index !== fileIndex)\n setFiles(deletedFileList)\n onFileRemove?.(deletedFileList)\n }\n\n const triggerUpload = (e: MouseEvent<HTMLDivElement>) => {\n if (!disabled) {\n fileInputField.current?.click()\n }\n e.stopPropagation()\n }\n\n const renderChildren = () => {\n if (!draggable && !children) {\n return (\n <Button disabled={disabled} onClick={(e) => e.preventDefault()}>\n Upload\n </Button>\n )\n }\n\n if (draggable && !children) {\n return <span>Choose a file or drag and drop here</span>\n }\n\n return children\n }\n\n const handleDragLeave = useCallback(() => {\n if (draggable) {\n setDragOver(false)\n }\n }, [draggable])\n\n const handleDragOver = useCallback(() => {\n if (draggable && !disabled) {\n setDragOver(true)\n }\n }, [draggable, disabled])\n\n const handleDrop = useCallback(() => {\n if (draggable) {\n setDragOver(false)\n }\n }, [draggable])\n\n const draggableProp = {\n onDragLeave: handleDragLeave,\n onDragOver: handleDragOver,\n onDrop: handleDrop,\n }\n\n const draggableEventFeedbackClass = `border-primary`\n\n const uploadClass = classNames(\n 'upload',\n draggable && `upload-draggable`,\n draggable && !disabled && `hover:${draggableEventFeedbackClass}`,\n draggable && disabled && 'disabled',\n dragOver && draggableEventFeedbackClass,\n className,\n )\n\n const uploadInputClass = classNames(\n 'upload-input',\n draggable && `draggable`,\n )\n\n return (\n <>\n <div\n ref={ref}\n className={uploadClass}\n {...(draggable ? draggableProp : { onClick: triggerUpload })}\n {...rest}\n >\n <input\n ref={fileInputField}\n className={uploadInputClass}\n type=\"file\"\n disabled={disabled}\n multiple={multiple}\n accept={accept}\n title=\"\"\n value=\"\"\n onChange={onNewFileUpload}\n {...rest}\n ></input>\n {renderChildren()}\n </div>\n {tip}\n {showList && (\n <div className={classNames('upload-file-list', fileListClass)}>\n {files.map((file, index) => (\n <FileItem\n key={file.name + index}\n file={file}\n className={fileItemClass}\n >\n <CloseButton\n className=\"upload-file-remove\"\n onClick={() => removeFile(index)}\n />\n </FileItem>\n ))}\n </div>\n )}\n </>\n )\n}\n\nexport default Upload\n"],"names":["filesToArray","files","key","Upload","props","accept","beforeUpload","disabled","draggable","fileList","fileListClass","fileItemClass","multiple","onChange","onFileRemove","ref","showList","tip","uploadLimit","children","className","rest","fileInputField","useRef","setFiles","useState","dragOver","setDragOver","useEffect","triggerMessage","msg","toast","Notification","pushFile","newFiles","file","f","addNewFiles","cloneDeep","onNewFileUpload","e","result","updatedFiles","removeFile","fileIndex","deletedFileList","_","index","triggerUpload","renderChildren","jsx","Button","handleDragLeave","useCallback","handleDragOver","handleDrop","draggableProp","draggableEventFeedbackClass","uploadClass","classNames","uploadInputClass","jsxs","Fragment","FileItem","CloseButton"],"mappings":"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"}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
function
|
|
3
|
-
const
|
|
4
|
-
return
|
|
5
|
-
|
|
6
|
-
}),
|
|
7
|
-
var t;
|
|
8
|
-
return (t = e.current) == null ? void 0 : t.call(e, ...u);
|
|
9
|
-
}), []);
|
|
1
|
+
import { useRef as u, useEffect as f, useMemo as c } from "react";
|
|
2
|
+
function o(e) {
|
|
3
|
+
const r = u(e);
|
|
4
|
+
return f(() => {
|
|
5
|
+
r.current = e;
|
|
6
|
+
}), c(() => ((...t) => r.current?.(...t)), []);
|
|
10
7
|
}
|
|
11
8
|
export {
|
|
12
|
-
|
|
9
|
+
o as default
|
|
13
10
|
};
|
|
14
11
|
//# sourceMappingURL=useCallbackRef.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCallbackRef.js","sources":["../../../../../lib/@ecme/components/ui/hooks/useCallbackRef.ts"],"sourcesContent":["import { useRef, useEffect, useMemo } from 'react'\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nfunction useCallbackRef<T extends (...args: any[]) => any>(\n cb: T | undefined,\n): T {\n const cbRef = useRef(cb)\n\n useEffect(() => {\n cbRef.current = cb\n })\n\n return useMemo(() => ((...args) => cbRef.current?.(...args)) as T, [])\n}\n\nexport default useCallbackRef\n"],"names":["useCallbackRef","cb","cbRef","useRef","useEffect","useMemo","args"
|
|
1
|
+
{"version":3,"file":"useCallbackRef.js","sources":["../../../../../lib/@ecme/components/ui/hooks/useCallbackRef.ts"],"sourcesContent":["import { useRef, useEffect, useMemo } from 'react'\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nfunction useCallbackRef<T extends (...args: any[]) => any>(\n cb: T | undefined,\n): T {\n const cbRef = useRef(cb)\n\n useEffect(() => {\n cbRef.current = cb\n })\n\n return useMemo(() => ((...args) => cbRef.current?.(...args)) as T, [])\n}\n\nexport default useCallbackRef\n"],"names":["useCallbackRef","cb","cbRef","useRef","useEffect","useMemo","args"],"mappings":";AAGA,SAASA,EACLC,GACC;AACD,QAAMC,IAAQC,EAAOF,CAAE;AAEvB,SAAAG,EAAU,MAAM;AACZ,IAAAF,EAAM,UAAUD;AAAA,EACpB,CAAC,GAEMI,EAAQ,OAAO,IAAIC,MAASJ,EAAM,UAAU,GAAGI,CAAI,IAAS,EAAE;AACzE;"}
|