@onesy/ui-react 1.0.164 → 1.0.167
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/Accordion/Accordion.d.ts +2 -2
- package/Accordion/Accordion.js +18 -41
- package/AdvancedTextField/AdvancedTextField.d.ts +1 -1
- package/AdvancedTextField/AdvancedTextField.js +17 -22
- package/Append/Append.d.ts +3 -3
- package/Append/Append.js +98 -110
- package/AreaChart/AreaChart.d.ts +1 -1
- package/AreaChart/AreaChart.js +27 -18
- package/AreaChartItem/AreaChartItem.d.ts +1 -1
- package/AreaChartItem/AreaChartItem.js +38 -49
- package/AudioPlayer/AudioPlayer.d.ts +1 -1
- package/AudioPlayer/AudioPlayer.js +89 -116
- package/AudioRecorder/AudioRecorder.d.ts +1 -1
- package/AudioRecorder/AudioRecorder.js +24 -42
- package/AutoComplete/AutoComplete.d.ts +3 -3
- package/AutoComplete/AutoComplete.js +119 -151
- package/AutoCompleteCountry/AutoCompleteCountry.d.ts +1 -1
- package/AutoCompleteCountry/AutoCompleteCountry.js +11 -22
- package/AutoCompleteCurrency/AutoCompleteCurrency.d.ts +1 -1
- package/AutoCompleteCurrency/AutoCompleteCurrency.js +4 -9
- package/Avatar/Avatar.d.ts +1 -1
- package/Avatar/Avatar.js +58 -31
- package/AvatarGroup/AvatarGroup.d.ts +1 -1
- package/AvatarGroup/AvatarGroup.js +40 -23
- package/Backdrop/Backdrop.d.ts +1 -1
- package/Backdrop/Backdrop.js +7 -18
- package/Badge/Badge.d.ts +1 -1
- package/Badge/Badge.js +53 -26
- package/Banner/Banner.d.ts +1 -1
- package/Banner/Banner.js +86 -39
- package/BottomAppBar/BottomAppBar.d.ts +1 -1
- package/BottomAppBar/BottomAppBar.js +61 -31
- package/BottomSheet/BottomSheet.d.ts +1 -1
- package/BottomSheet/BottomSheet.js +23 -13
- package/Box/Box.d.ts +1 -1
- package/Box/Box.js +25 -11
- package/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/Breadcrumbs/Breadcrumbs.js +27 -38
- package/BubbleChart/BubbleChart.d.ts +1 -1
- package/BubbleChart/BubbleChart.js +126 -120
- package/BubbleChartItem/BubbleChartItem.d.ts +1 -1
- package/BubbleChartItem/BubbleChartItem.js +12 -23
- package/Button/Button.d.ts +1 -1
- package/Button/Button.js +27 -42
- package/Buttons/Buttons.d.ts +1 -1
- package/Buttons/Buttons.js +208 -97
- package/Calendar/Calendar.d.ts +3 -3
- package/Calendar/Calendar.js +95 -133
- package/CalendarAvailability/CalendarAvailability.d.ts +2 -2
- package/CalendarAvailability/CalendarAvailability.js +107 -148
- package/CalendarMenu/CalendarMenu.d.ts +1 -1
- package/CalendarMenu/CalendarMenu.js +47 -80
- package/CalendarMonth/CalendarMonth.d.ts +5 -5
- package/CalendarMonth/CalendarMonth.js +103 -124
- package/CalendarViews/CalendarViews.d.ts +2 -2
- package/CalendarViews/CalendarViews.js +34 -60
- package/CalendarWeek/CalendarWeek.d.ts +1 -1
- package/CalendarWeek/CalendarWeek.js +84 -95
- package/Card/Card.d.ts +1 -1
- package/Card/Card.js +10 -21
- package/CardButton/CardButton.d.ts +1 -1
- package/CardButton/CardButton.js +8 -13
- package/CardFooter/CardFooter.d.ts +1 -1
- package/CardFooter/CardFooter.js +40 -21
- package/CardHeader/CardHeader.d.ts +1 -1
- package/CardHeader/CardHeader.js +68 -24
- package/CardImage/CardImage.d.ts +1 -1
- package/CardImage/CardImage.js +31 -13
- package/CardMain/CardMain.d.ts +1 -1
- package/CardMain/CardMain.js +30 -16
- package/Carousel/Carousel.d.ts +4 -4
- package/Carousel/Carousel.js +163 -181
- package/Chart/Chart.d.ts +4 -4
- package/Chart/Chart.js +250 -271
- package/Checkbox/Checkbox.d.ts +1 -1
- package/Checkbox/Checkbox.js +133 -33
- package/Chip/Chip.d.ts +1 -1
- package/Chip/Chip.js +5 -10
- package/Chips/Chips.d.ts +1 -1
- package/Chips/Chips.js +73 -38
- package/ClickListener/ClickListener.d.ts +1 -1
- package/ClickListener/ClickListener.js +10 -12
- package/Clock/Clock.d.ts +5 -5
- package/Clock/Clock.js +81 -89
- package/ColorTextField/ColorTextField.d.ts +1 -1
- package/ColorTextField/ColorTextField.js +190 -75
- package/ColumnChart/ColumnChart.d.ts +1 -1
- package/ColumnChart/ColumnChart.js +43 -24
- package/ColumnChartItem/ColumnChartItem.d.ts +1 -1
- package/ColumnChartItem/ColumnChartItem.js +12 -23
- package/Confirm/Confirm.d.ts +4 -4
- package/Confirm/Confirm.js +13 -37
- package/Confirm/useConfirm.js +1 -1
- package/Container/Container.d.ts +1 -1
- package/Container/Container.js +9 -14
- package/CookieBanner/CookieBanner.d.ts +1 -1
- package/CookieBanner/CookieBanner.js +65 -39
- package/Countdown/Countdown.d.ts +1 -1
- package/Countdown/Countdown.js +25 -54
- package/DatePicker/DatePicker.d.ts +1 -1
- package/DatePicker/DatePicker.js +138 -176
- package/DateRangePicker/DateRangePicker.d.ts +1 -1
- package/DateRangePicker/DateRangePicker.js +23 -13
- package/DateTimePicker/DateTimePicker.d.ts +2 -2
- package/DateTimePicker/DateTimePicker.js +118 -156
- package/DateTimeRangePicker/DateTimeRangePicker.d.ts +1 -1
- package/DateTimeRangePicker/DateTimeRangePicker.js +23 -13
- package/Divider/Divider.d.ts +1 -1
- package/Divider/Divider.js +4 -12
- package/DonutChart/DonutChart.d.ts +1 -1
- package/DonutChart/DonutChart.js +23 -13
- package/DragAndDropList/DragAndDropList.d.ts +1 -1
- package/DragAndDropList/DragAndDropList.js +31 -33
- package/Drawing/Drawing.d.ts +2 -2
- package/Drawing/Drawing.js +107 -153
- package/DropZone/DropZone.d.ts +1 -1
- package/DropZone/DropZone.js +36 -54
- package/Emojis/Emojis.d.ts +3 -3
- package/Emojis/Emojis.js +52 -84
- package/Expand/Expand.d.ts +1 -1
- package/Expand/Expand.js +70 -37
- package/Fab/Fab.d.ts +1 -1
- package/Fab/Fab.js +8 -11
- package/Fade/Fade.d.ts +1 -1
- package/Fade/Fade.js +221 -111
- package/FileChoose/FileChoose.d.ts +2 -2
- package/FileChoose/FileChoose.js +26 -43
- package/Focus/Focus.d.ts +1 -1
- package/Focus/Focus.js +8 -10
- package/Form/Form.d.ts +1 -1
- package/Form/Form.js +95 -54
- package/FormRow/FormRow.d.ts +1 -1
- package/FormRow/FormRow.js +89 -42
- package/Forms/Forms.d.ts +1 -1
- package/Forms/Forms.js +36 -19
- package/Frame/Frame.d.ts +1 -1
- package/Frame/Frame.js +8 -22
- package/Grid/Grid.d.ts +2 -2
- package/Grid/Grid.js +13 -18
- package/Grow/Grow.d.ts +1 -1
- package/Grow/Grow.js +233 -118
- package/HTMLCanvas/HTMLCanvas.d.ts +2 -2
- package/HTMLCanvas/HTMLCanvas.js +225 -254
- package/IFrame/IFrame.d.ts +1 -1
- package/IFrame/IFrame.js +5 -11
- package/Icon/Icon.d.ts +1 -1
- package/Icon/Icon.js +82 -42
- package/IconButton/IconButton.d.ts +1 -1
- package/IconButton/IconButton.js +31 -18
- package/Image/Image.d.ts +1 -1
- package/Image/Image.js +13 -24
- package/ImageCrop/ImageCrop.d.ts +2 -2
- package/ImageCrop/ImageCrop.js +238 -244
- package/ImageEdit/ImageEdit.d.ts +2 -2
- package/ImageEdit/ImageEdit.js +189 -225
- package/ImageGallery/ImageGallery.d.ts +1 -1
- package/ImageGallery/ImageGallery.js +55 -73
- package/ImageList/ImageList.d.ts +1 -1
- package/ImageList/ImageList.js +13 -15
- package/ImageListItem/ImageListItem.d.ts +1 -1
- package/ImageListItem/ImageListItem.js +9 -14
- package/ImageListItemBox/ImageListItemBox.d.ts +1 -1
- package/ImageListItemBox/ImageListItemBox.js +30 -16
- package/Info/Info.d.ts +1 -1
- package/Info/Info.js +83 -42
- package/Interaction/Interaction.d.ts +2 -2
- package/Interaction/Interaction.js +39 -41
- package/Keyframes/Keyframes.d.ts +3 -3
- package/Keyframes/Keyframes.js +16 -18
- package/Keyframes/useKeyframes.js +1 -1
- package/Label/Label.d.ts +1 -1
- package/Label/Label.js +6 -15
- package/Labels/Labels.d.ts +1 -1
- package/Labels/Labels.js +16 -24
- package/Line/Line.d.ts +6 -6
- package/Line/Line.js +10 -15
- package/LineChart/LineChart.d.ts +1 -1
- package/LineChart/LineChart.js +27 -18
- package/LineChartItem/LineChartItem.d.ts +1 -1
- package/LineChartItem/LineChartItem.js +22 -33
- package/LinearMeter/LinearMeter.d.ts +1 -1
- package/LinearMeter/LinearMeter.js +125 -130
- package/LinearProgress/LinearProgress.d.ts +1 -1
- package/LinearProgress/LinearProgress.js +51 -31
- package/Link/Link.d.ts +1 -1
- package/Link/Link.js +59 -27
- package/Links/Links.d.ts +2 -2
- package/Links/Links.js +110 -81
- package/List/List.d.ts +1 -1
- package/List/List.js +12 -20
- package/ListItem/ListItem.d.ts +1 -1
- package/ListItem/ListItem.js +5 -17
- package/ListSubheader/ListSubheader.d.ts +1 -1
- package/ListSubheader/ListSubheader.js +23 -13
- package/MainProgress/MainProgress.d.ts +1 -1
- package/MainProgress/MainProgress.js +7 -12
- package/MainProgress/useMainProgress.js +1 -1
- package/MainProgressMaterial/MainProgressMaterial.d.ts +3 -3
- package/MainProgressMaterial/MainProgressMaterial.js +15 -23
- package/MainProgressMaterial/useMainProgressMaterial.js +1 -1
- package/Markdown/Markdown.d.ts +1 -1
- package/Markdown/Markdown.js +192 -194
- package/Masonry/Masonry.d.ts +1 -1
- package/Masonry/Masonry.js +25 -30
- package/Medias/Medias.d.ts +3 -3
- package/Medias/Medias.js +86 -113
- package/Menu/Menu.d.ts +1 -1
- package/Menu/Menu.js +55 -66
- package/MenuDesktop/MenuDesktop.d.ts +3 -3
- package/MenuDesktop/MenuDesktop.js +118 -121
- package/MenuItem/MenuItem.d.ts +1 -1
- package/MenuItem/MenuItem.js +40 -60
- package/Meta/Meta.d.ts +1 -1
- package/Meta/Meta.js +57 -35
- package/Modal/Modal.d.ts +1 -1
- package/Modal/Modal.js +11 -25
- package/ModalFooter/ModalFooter.d.ts +1 -1
- package/ModalFooter/ModalFooter.js +30 -16
- package/ModalHeader/ModalHeader.d.ts +1 -1
- package/ModalHeader/ModalHeader.js +32 -17
- package/ModalIcon/ModalIcon.d.ts +1 -1
- package/ModalIcon/ModalIcon.js +2 -4
- package/ModalMain/ModalMain.d.ts +1 -1
- package/ModalMain/ModalMain.js +31 -17
- package/ModalText/ModalText.d.ts +1 -1
- package/ModalText/ModalText.js +28 -15
- package/ModalTitle/ModalTitle.d.ts +1 -1
- package/ModalTitle/ModalTitle.js +28 -15
- package/MoreOptions/MoreOptions.d.ts +1 -1
- package/MoreOptions/MoreOptions.js +43 -28
- package/Move/Move.d.ts +1 -1
- package/Move/Move.js +24 -26
- package/NavigationBar/NavigationBar.d.ts +2 -2
- package/NavigationBar/NavigationBar.js +64 -39
- package/NavigationDrawer/NavigationDrawer.d.ts +1 -1
- package/NavigationDrawer/NavigationDrawer.js +12 -21
- package/NavigationItem/NavigationItem.d.ts +2 -2
- package/NavigationItem/NavigationItem.js +26 -41
- package/NavigationRail/NavigationRail.d.ts +1 -1
- package/NavigationRail/NavigationRail.js +69 -54
- package/NotFound/NotFound.d.ts +1 -1
- package/NotFound/NotFound.js +7 -18
- package/NumericTextField/NumericTextField.d.ts +1 -1
- package/NumericTextField/NumericTextField.js +51 -59
- package/Page/Page.d.ts +2 -2
- package/Page/Page.js +6 -20
- package/PageTransition/PageTransition.d.ts +1 -1
- package/PageTransition/PageTransition.js +7 -12
- package/Pagination/Pagination.d.ts +1 -1
- package/Pagination/Pagination.js +121 -68
- package/PaginationItem/PaginationItem.d.ts +1 -1
- package/PaginationItem/PaginationItem.js +50 -30
- package/Parallax/Parallax.d.ts +2 -2
- package/Parallax/Parallax.js +9 -11
- package/Path/Path.d.ts +1 -1
- package/Path/Path.js +22 -9
- package/PieChart/PieChart.d.ts +1 -1
- package/PieChart/PieChart.js +38 -55
- package/Placeholder/Placeholder.d.ts +1 -1
- package/Placeholder/Placeholder.js +59 -23
- package/Portal/Portal.d.ts +1 -1
- package/Portal/Portal.js +2 -4
- package/Properties/Properties.d.ts +2 -2
- package/Properties/Properties.js +51 -30
- package/Property/Property.d.ts +1 -1
- package/Property/Property.js +4 -12
- package/Radio/Radio.d.ts +1 -1
- package/Radio/Radio.js +83 -24
- package/Radios/Radios.d.ts +1 -1
- package/Radios/Radios.js +6 -14
- package/Rating/Rating.d.ts +1 -1
- package/Rating/Rating.js +68 -71
- package/Reset/Reset.d.ts +1 -1
- package/Reset/Reset.js +26 -4
- package/Reveal/Reveal.d.ts +1 -1
- package/Reveal/Reveal.js +8 -14
- package/RichTextEditor/RichTextEditor.d.ts +1 -1
- package/RichTextEditor/RichTextEditor.js +194 -254
- package/RoundMeter/RoundMeter.d.ts +1 -1
- package/RoundMeter/RoundMeter.js +207 -212
- package/RoundProgress/RoundProgress.d.ts +1 -1
- package/RoundProgress/RoundProgress.js +46 -27
- package/ScatterChart/ScatterChart.d.ts +1 -1
- package/ScatterChart/ScatterChart.js +27 -18
- package/ScatterChartItem/ScatterChartItem.d.ts +1 -1
- package/ScatterChartItem/ScatterChartItem.js +15 -26
- package/ScreenCapture/ScreenCapture.d.ts +2 -2
- package/ScreenCapture/ScreenCapture.js +57 -81
- package/Section/Section.d.ts +2 -2
- package/Section/Section.js +13 -24
- package/SectionAction/SectionAction.d.ts +1 -1
- package/SectionAction/SectionAction.js +4 -12
- package/SectionBoxes/SectionBoxes.d.ts +2 -2
- package/SectionBoxes/SectionBoxes.js +14 -28
- package/SectionCards/SectionCards.d.ts +2 -2
- package/SectionCards/SectionCards.js +14 -28
- package/SectionCarousel/SectionCarousel.d.ts +2 -2
- package/SectionCarousel/SectionCarousel.js +15 -32
- package/SectionContact/SectionContact.d.ts +1 -1
- package/SectionContact/SectionContact.js +6 -20
- package/SectionImageGallery/SectionImageGallery.d.ts +1 -1
- package/SectionImageGallery/SectionImageGallery.js +4 -12
- package/SectionLogos/SectionLogos.d.ts +1 -1
- package/SectionLogos/SectionLogos.js +8 -19
- package/SectionMedia/SectionMedia.d.ts +1 -1
- package/SectionMedia/SectionMedia.js +11 -34
- package/SectionReviews/SectionReviews.d.ts +2 -2
- package/SectionReviews/SectionReviews.js +16 -33
- package/SectionTextMedia/SectionTextMedia.d.ts +1 -1
- package/SectionTextMedia/SectionTextMedia.js +10 -37
- package/SectionTimeline/SectionTimeline.d.ts +2 -2
- package/SectionTimeline/SectionTimeline.js +17 -34
- package/SectionWatch/SectionWatch.d.ts +1 -1
- package/SectionWatch/SectionWatch.js +4 -12
- package/Select/Select.d.ts +1 -1
- package/Select/Select.js +95 -121
- package/Share/Share.d.ts +1 -1
- package/Share/Share.js +217 -119
- package/Slide/Slide.d.ts +1 -1
- package/Slide/Slide.js +16 -18
- package/Slider/Slider.d.ts +2 -2
- package/Slider/Slider.js +150 -165
- package/SmartTextField/SmartTextField.d.ts +1 -1
- package/SmartTextField/SmartTextField.js +203 -256
- package/Snackbar/Snackbar.d.ts +1 -1
- package/Snackbar/Snackbar.js +18 -35
- package/Snackbars/Context.d.ts +1 -1
- package/Snackbars/Snackbars.d.ts +2 -2
- package/Snackbars/Snackbars.js +43 -57
- package/Snackbars/useSnackbars.js +1 -1
- package/Space/Space.d.ts +1 -1
- package/Space/Space.js +762 -556
- package/SpeechToText/SpeechToText.d.ts +1 -1
- package/SpeechToText/SpeechToText.js +26 -37
- package/SpeedDial/SpeedDial.d.ts +1 -1
- package/SpeedDial/SpeedDial.js +69 -58
- package/SpeedDialItem/SpeedDialItem.d.ts +1 -1
- package/SpeedDialItem/SpeedDialItem.js +34 -23
- package/SpyScroll/SpyScroll.d.ts +1 -1
- package/SpyScroll/SpyScroll.js +17 -19
- package/Step/Step.d.ts +1 -1
- package/Step/Step.js +41 -52
- package/Stepper/Stepper.d.ts +1 -1
- package/Stepper/Stepper.js +12 -20
- package/Surface/Surface.d.ts +1 -1
- package/Surface/Surface.js +208 -133
- package/Switch/Switch.d.ts +1 -1
- package/Switch/Switch.js +107 -48
- package/Tab/Tab.d.ts +1 -1
- package/Tab/Tab.js +137 -68
- package/Table/Table.d.ts +1 -1
- package/Table/Table.js +70 -33
- package/TableBody/TableBody.d.ts +1 -1
- package/TableBody/TableBody.js +44 -23
- package/TableCell/TableCell.d.ts +2 -2
- package/TableCell/TableCell.js +26 -40
- package/TableFooter/TableFooter.d.ts +1 -1
- package/TableFooter/TableFooter.js +36 -19
- package/TableHead/TableHead.d.ts +1 -1
- package/TableHead/TableHead.js +15 -26
- package/TableHeader/TableHeader.d.ts +1 -1
- package/TableHeader/TableHeader.js +38 -23
- package/TablePagination/TablePagination.d.ts +1 -1
- package/TablePagination/TablePagination.js +10 -27
- package/TableRow/TableRow.d.ts +1 -1
- package/TableRow/TableRow.js +47 -26
- package/Tabs/Tabs.d.ts +1 -1
- package/Tabs/Tabs.js +41 -56
- package/Text/Text.d.ts +1 -1
- package/Text/Text.js +10 -18
- package/TextField/TextField.d.ts +1 -1
- package/TextField/TextField.js +68 -83
- package/TextToSpeech/TextToSpeech.d.ts +1 -1
- package/TextToSpeech/TextToSpeech.js +21 -32
- package/TimePicker/TimePicker.d.ts +3 -3
- package/TimePicker/TimePicker.js +183 -230
- package/TimeRangePicker/TimeRangePicker.d.ts +1 -1
- package/TimeRangePicker/TimeRangePicker.js +23 -13
- package/Timeline/Timeline.d.ts +1 -1
- package/Timeline/Timeline.js +35 -19
- package/TimelineItem/TimelineItem.d.ts +1 -1
- package/TimelineItem/TimelineItem.js +5 -16
- package/Timer/Timer.d.ts +1 -1
- package/Timer/Timer.js +29 -55
- package/ToggleButton/ToggleButton.d.ts +1 -1
- package/ToggleButton/ToggleButton.js +29 -16
- package/ToggleButtons/ToggleButtons.d.ts +1 -1
- package/ToggleButtons/ToggleButtons.js +24 -15
- package/Tooltip/Tooltip.d.ts +1 -1
- package/Tooltip/Tooltip.js +46 -60
- package/TopAppBar/TopAppBar.d.ts +1 -1
- package/TopAppBar/TopAppBar.js +118 -61
- package/Transition/Transition.d.ts +3 -3
- package/Transition/Transition.js +54 -56
- package/Transition/useTransition.js +1 -1
- package/Transitions/Transitions.d.ts +2 -2
- package/Transitions/Transitions.js +10 -12
- package/Tree/Tree.d.ts +1 -1
- package/Tree/Tree.js +37 -60
- package/Type/Type.d.ts +1 -1
- package/Type/Type.js +24 -17
- package/VideoPlayer/VideoPlayer.d.ts +1 -1
- package/VideoPlayer/VideoPlayer.js +123 -150
- package/ViewSplit/ViewSplit.d.ts +1 -1
- package/ViewSplit/ViewSplit.js +66 -77
- package/Watch/Watch.d.ts +1 -1
- package/Watch/Watch.js +14 -31
- package/Weather/Weather.d.ts +4 -4
- package/Weather/Weather.js +75 -47
- package/Whiteboard/Whiteboard.d.ts +5 -5
- package/Whiteboard/Whiteboard.js +565 -570
- package/Widgets/Widgets.d.ts +2 -2
- package/Widgets/Widgets.js +31 -48
- package/Widgets/useWidgets.js +1 -1
- package/WindowSplit/WindowSplit.d.ts +1 -1
- package/WindowSplit/WindowSplit.js +52 -63
- package/Zoom/Zoom.d.ts +1 -1
- package/Zoom/Zoom.js +221 -107
- package/esm/Accordion/Accordion.js +17 -17
- package/esm/AdvancedTextField/AdvancedTextField.js +16 -16
- package/esm/Append/Append.js +97 -103
- package/esm/AreaChart/AreaChart.js +26 -9
- package/esm/AreaChartItem/AreaChartItem.js +37 -37
- package/esm/AudioPlayer/AudioPlayer.js +88 -88
- package/esm/AudioRecorder/AudioRecorder.js +23 -23
- package/esm/AutoComplete/AutoComplete.js +115 -115
- package/esm/AutoCompleteCountry/AutoCompleteCountry.js +10 -10
- package/esm/AutoCompleteCurrency/AutoCompleteCurrency.js +3 -3
- package/esm/Avatar/Avatar.js +57 -22
- package/esm/AvatarGroup/AvatarGroup.js +39 -14
- package/esm/Backdrop/Backdrop.js +6 -6
- package/esm/Badge/Badge.js +52 -19
- package/esm/Banner/Banner.js +85 -27
- package/esm/BottomAppBar/BottomAppBar.js +60 -22
- package/esm/BottomSheet/BottomSheet.js +22 -7
- package/esm/Box/Box.js +24 -8
- package/esm/Breadcrumbs/Breadcrumbs.js +25 -25
- package/esm/BubbleChart/BubbleChart.js +130 -104
- package/esm/BubbleChartItem/BubbleChartItem.js +11 -11
- package/esm/Button/Button.js +25 -25
- package/esm/Buttons/Buttons.js +203 -86
- package/esm/Calendar/Calendar.js +93 -93
- package/esm/CalendarAvailability/CalendarAvailability.js +103 -103
- package/esm/CalendarMenu/CalendarMenu.js +46 -46
- package/esm/CalendarMonth/CalendarMonth.js +102 -102
- package/esm/CalendarViews/CalendarViews.js +33 -33
- package/esm/CalendarWeek/CalendarWeek.js +81 -81
- package/esm/Card/Card.js +9 -9
- package/esm/CardButton/CardButton.js +7 -7
- package/esm/CardFooter/CardFooter.js +39 -15
- package/esm/CardHeader/CardHeader.js +67 -18
- package/esm/CardImage/CardImage.js +30 -10
- package/esm/CardMain/CardMain.js +29 -10
- package/esm/Carousel/Carousel.js +162 -162
- package/esm/Chart/Chart.js +236 -236
- package/esm/Checkbox/Checkbox.js +132 -27
- package/esm/Chip/Chip.js +4 -4
- package/esm/Chips/Chips.js +72 -29
- package/esm/ClickListener/ClickListener.js +6 -6
- package/esm/Clock/Clock.js +80 -80
- package/esm/ColorTextField/ColorTextField.js +188 -57
- package/esm/ColumnChart/ColumnChart.js +42 -15
- package/esm/ColumnChartItem/ColumnChartItem.js +11 -11
- package/esm/Confirm/Confirm.js +12 -12
- package/esm/Confirm/useConfirm.js +1 -1
- package/esm/Container/Container.js +8 -8
- package/esm/CookieBanner/CookieBanner.js +64 -21
- package/esm/Countdown/Countdown.js +24 -24
- package/esm/DatePicker/DatePicker.js +136 -136
- package/esm/DateRangePicker/DateRangePicker.js +22 -7
- package/esm/DateTimePicker/DateTimePicker.js +116 -116
- package/esm/DateTimeRangePicker/DateTimeRangePicker.js +22 -7
- package/esm/Divider/Divider.js +3 -3
- package/esm/DonutChart/DonutChart.js +22 -7
- package/esm/DragAndDropList/DragAndDropList.js +30 -30
- package/esm/Drawing/Drawing.js +106 -105
- package/esm/DropZone/DropZone.js +35 -35
- package/esm/Emojis/Emojis.js +51 -51
- package/esm/Expand/Expand.js +69 -33
- package/esm/Fab/Fab.js +7 -5
- package/esm/Fade/Fade.js +204 -94
- package/esm/FileChoose/FileChoose.js +25 -25
- package/esm/Focus/Focus.js +7 -7
- package/esm/Form/Form.js +94 -42
- package/esm/FormRow/FormRow.js +88 -33
- package/esm/Forms/Forms.js +35 -13
- package/esm/Frame/Frame.js +7 -7
- package/esm/Grid/Grid.js +10 -10
- package/esm/Grow/Grow.js +216 -101
- package/esm/HTMLCanvas/HTMLCanvas.js +224 -224
- package/esm/IFrame/IFrame.js +4 -4
- package/esm/Icon/Icon.js +80 -38
- package/esm/IconButton/IconButton.js +30 -12
- package/esm/Image/Image.js +12 -12
- package/esm/ImageCrop/ImageCrop.js +237 -237
- package/esm/ImageEdit/ImageEdit.js +188 -188
- package/esm/ImageGallery/ImageGallery.js +54 -54
- package/esm/ImageList/ImageList.js +12 -12
- package/esm/ImageListItem/ImageListItem.js +8 -8
- package/esm/ImageListItemBox/ImageListItemBox.js +29 -10
- package/esm/Info/Info.js +82 -24
- package/esm/Interaction/Interaction.js +37 -37
- package/esm/Keyframes/Keyframes.js +15 -15
- package/esm/Keyframes/useKeyframes.js +1 -1
- package/esm/Label/Label.js +5 -5
- package/esm/Labels/Labels.js +15 -15
- package/esm/Line/Line.js +9 -9
- package/esm/LineChart/LineChart.js +26 -9
- package/esm/LineChartItem/LineChartItem.js +21 -21
- package/esm/LinearMeter/LinearMeter.js +124 -124
- package/esm/LinearProgress/LinearProgress.js +50 -28
- package/esm/Link/Link.js +58 -21
- package/esm/Links/Links.js +108 -53
- package/esm/List/List.js +11 -11
- package/esm/ListItem/ListItem.js +4 -4
- package/esm/ListSubheader/ListSubheader.js +22 -7
- package/esm/MainProgress/MainProgress.js +6 -6
- package/esm/MainProgress/useMainProgress.js +1 -1
- package/esm/MainProgressMaterial/MainProgressMaterial.js +14 -14
- package/esm/MainProgressMaterial/useMainProgressMaterial.js +1 -1
- package/esm/Markdown/Markdown.js +191 -191
- package/esm/Masonry/Masonry.js +24 -24
- package/esm/Medias/Medias.js +77 -77
- package/esm/Menu/Menu.js +44 -44
- package/esm/MenuDesktop/MenuDesktop.js +116 -93
- package/esm/MenuItem/MenuItem.js +39 -39
- package/esm/Meta/Meta.js +56 -25
- package/esm/Modal/Modal.js +10 -10
- package/esm/ModalFooter/ModalFooter.js +29 -10
- package/esm/ModalHeader/ModalHeader.js +31 -11
- package/esm/ModalIcon/ModalIcon.js +1 -1
- package/esm/ModalMain/ModalMain.js +30 -11
- package/esm/ModalText/ModalText.js +27 -9
- package/esm/ModalTitle/ModalTitle.js +27 -9
- package/esm/MoreOptions/MoreOptions.js +42 -19
- package/esm/Move/Move.js +23 -23
- package/esm/NavigationBar/NavigationBar.js +63 -30
- package/esm/NavigationDrawer/NavigationDrawer.js +11 -11
- package/esm/NavigationItem/NavigationItem.js +25 -25
- package/esm/NavigationRail/NavigationRail.js +66 -37
- package/esm/NotFound/NotFound.js +6 -6
- package/esm/NumericTextField/NumericTextField.js +50 -50
- package/esm/Page/Page.js +5 -5
- package/esm/PageTransition/PageTransition.js +6 -6
- package/esm/Pagination/Pagination.js +120 -53
- package/esm/PaginationItem/PaginationItem.js +49 -21
- package/esm/Parallax/Parallax.js +8 -8
- package/esm/Path/Path.js +21 -6
- package/esm/PieChart/PieChart.js +37 -37
- package/esm/Placeholder/Placeholder.js +58 -17
- package/esm/Portal/Portal.js +1 -1
- package/esm/Properties/Properties.js +50 -20
- package/esm/Property/Property.js +3 -3
- package/esm/Radio/Radio.js +82 -18
- package/esm/Radios/Radios.js +5 -5
- package/esm/Rating/Rating.js +66 -66
- package/esm/Reset/Reset.js +26 -4
- package/esm/Reveal/Reveal.js +7 -7
- package/esm/RichTextEditor/RichTextEditor.js +192 -192
- package/esm/RoundMeter/RoundMeter.js +206 -206
- package/esm/RoundProgress/RoundProgress.js +45 -24
- package/esm/ScatterChart/ScatterChart.js +26 -9
- package/esm/ScatterChartItem/ScatterChartItem.js +14 -14
- package/esm/ScreenCapture/ScreenCapture.js +56 -56
- package/esm/Section/Section.js +12 -12
- package/esm/SectionAction/SectionAction.js +3 -3
- package/esm/SectionBoxes/SectionBoxes.js +13 -13
- package/esm/SectionCards/SectionCards.js +13 -13
- package/esm/SectionCarousel/SectionCarousel.js +14 -14
- package/esm/SectionContact/SectionContact.js +5 -5
- package/esm/SectionImageGallery/SectionImageGallery.js +3 -3
- package/esm/SectionLogos/SectionLogos.js +7 -7
- package/esm/SectionMedia/SectionMedia.js +10 -10
- package/esm/SectionReviews/SectionReviews.js +14 -14
- package/esm/SectionTextMedia/SectionTextMedia.js +9 -9
- package/esm/SectionTimeline/SectionTimeline.js +16 -16
- package/esm/SectionWatch/SectionWatch.js +3 -3
- package/esm/Select/Select.js +88 -88
- package/esm/Share/Share.js +216 -92
- package/esm/Slide/Slide.js +15 -15
- package/esm/Slider/Slider.js +149 -149
- package/esm/SmartTextField/SmartTextField.js +199 -198
- package/esm/Snackbar/Snackbar.js +17 -17
- package/esm/Snackbars/Snackbars.js +40 -40
- package/esm/Snackbars/useSnackbars.js +1 -1
- package/esm/Space/Space.js +755 -480
- package/esm/SpeechToText/SpeechToText.js +25 -25
- package/esm/SpeedDial/SpeedDial.js +68 -40
- package/esm/SpeedDialItem/SpeedDialItem.js +33 -14
- package/esm/SpyScroll/SpyScroll.js +16 -16
- package/esm/Step/Step.js +40 -31
- package/esm/Stepper/Stepper.js +11 -11
- package/esm/Surface/Surface.js +207 -130
- package/esm/Switch/Switch.js +106 -39
- package/esm/Tab/Tab.js +136 -50
- package/esm/Table/Table.js +69 -24
- package/esm/TableBody/TableBody.js +43 -17
- package/esm/TableCell/TableCell.js +25 -25
- package/esm/TableFooter/TableFooter.js +35 -13
- package/esm/TableHead/TableHead.js +14 -14
- package/esm/TableHeader/TableHeader.js +37 -14
- package/esm/TablePagination/TablePagination.js +9 -9
- package/esm/TableRow/TableRow.js +46 -20
- package/esm/Tabs/Tabs.js +38 -38
- package/esm/Text/Text.js +9 -9
- package/esm/TextField/TextField.js +63 -63
- package/esm/TextToSpeech/TextToSpeech.js +20 -20
- package/esm/TimePicker/TimePicker.js +182 -182
- package/esm/TimeRangePicker/TimeRangePicker.js +22 -7
- package/esm/Timeline/Timeline.js +34 -13
- package/esm/TimelineItem/TimelineItem.js +4 -4
- package/esm/Timer/Timer.js +28 -28
- package/esm/ToggleButton/ToggleButton.js +28 -10
- package/esm/ToggleButtons/ToggleButtons.js +23 -9
- package/esm/Tooltip/Tooltip.js +45 -45
- package/esm/TopAppBar/TopAppBar.js +117 -49
- package/esm/Transition/Transition.js +53 -53
- package/esm/Transition/useTransition.js +1 -1
- package/esm/Transitions/Transitions.js +9 -9
- package/esm/Tree/Tree.js +36 -36
- package/esm/Type/Type.js +23 -14
- package/esm/VideoPlayer/VideoPlayer.js +121 -121
- package/esm/ViewSplit/ViewSplit.js +65 -65
- package/esm/Watch/Watch.js +13 -13
- package/esm/Weather/Weather.js +73 -29
- package/esm/Whiteboard/Whiteboard.js +557 -557
- package/esm/Widgets/Widgets.js +29 -29
- package/esm/Widgets/useWidgets.js +1 -1
- package/esm/WindowSplit/WindowSplit.js +51 -51
- package/esm/Zoom/Zoom.js +204 -90
- package/esm/index.js +1 -1
- package/esm/useForm/useForm.js +58 -58
- package/esm/useLocation/useLocation.js +4 -4
- package/esm/useMediaQuery/useMediaQuery.js +2 -2
- package/esm/useOnline/useOnline.js +23 -10
- package/esm/useOpen/useOpen.js +79 -27
- package/esm/useQuery/useQuery.js +11 -1
- package/esm/useResize/useResize.js +30 -14
- package/esm/useScroll/useScroll.js +2 -2
- package/esm/useSubscription/useSubscription.js +73 -21
- package/esm/useSwipe/useSwipe.js +30 -30
- package/esm/useTabs/useTabs.js +22 -7
- package/esm/useVisible/useVisible.js +3 -3
- package/index.js +1 -1
- package/package.json +8 -12
- package/types.d.ts +27 -27
- package/useForm/useForm.d.ts +2 -2
- package/useForm/useForm.js +58 -58
- package/useForm/validate.d.ts +12 -12
- package/useLocation/useLocation.d.ts +1 -1
- package/useLocation/useLocation.js +4 -4
- package/useMediaQuery/useMediaQuery.d.ts +1 -1
- package/useMediaQuery/useMediaQuery.js +2 -2
- package/useOnline/useOnline.js +23 -10
- package/useOpen/useOpen.js +79 -27
- package/useQuery/useQuery.js +11 -1
- package/useResize/useResize.js +30 -14
- package/useScroll/useScroll.d.ts +2 -2
- package/useScroll/useScroll.js +2 -2
- package/useSubscription/useSubscription.js +73 -21
- package/useSwipe/useSwipe.d.ts +2 -2
- package/useSwipe/useSwipe.js +30 -30
- package/useTabs/useTabs.js +22 -7
- package/useVisible/useVisible.d.ts +2 -2
- package/useVisible/useVisible.js +3 -3
|
@@ -248,8 +248,8 @@ const useStyle = styleMethod(theme => {
|
|
|
248
248
|
});
|
|
249
249
|
const ImageCrop = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
250
250
|
const theme = useOnesyTheme();
|
|
251
|
-
const props =
|
|
252
|
-
const Tooltip =
|
|
251
|
+
const props = _objectSpread(_objectSpread(_objectSpread({}, theme?.ui?.elements?.all?.props?.default), theme?.ui?.elements?.onesyImageCrop?.props?.default), props_);
|
|
252
|
+
const Tooltip = theme?.elements?.Tooltip || TooltipElement;
|
|
253
253
|
const {
|
|
254
254
|
// url, datauri or canvas
|
|
255
255
|
image: image_,
|
|
@@ -386,7 +386,7 @@ const ImageCrop = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
|
386
386
|
break;
|
|
387
387
|
}
|
|
388
388
|
};
|
|
389
|
-
const onMouseUp =
|
|
389
|
+
const onMouseUp = event_0 => {
|
|
390
390
|
setMouseDown(false);
|
|
391
391
|
refs.previousMouseEvent.current = undefined;
|
|
392
392
|
};
|
|
@@ -398,30 +398,30 @@ const ImageCrop = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
|
398
398
|
top: previousTop,
|
|
399
399
|
left: previousLeft
|
|
400
400
|
} = refs.mouseDown.current;
|
|
401
|
-
const
|
|
401
|
+
const rootRect_0 = refs.root.current.getBoundingClientRect();
|
|
402
402
|
const selectorRect_ = refs.imageSelectorMain.current.getBoundingClientRect();
|
|
403
403
|
const selectorRect = {};
|
|
404
404
|
|
|
405
405
|
// Normalize relative to root
|
|
406
406
|
selectorRect.width = selectorRect_.width;
|
|
407
407
|
selectorRect.height = selectorRect_.height;
|
|
408
|
-
selectorRect.top = selectorRect_.top -
|
|
409
|
-
selectorRect.left = selectorRect_.left -
|
|
408
|
+
selectorRect.top = selectorRect_.top - rootRect_0.top;
|
|
409
|
+
selectorRect.left = selectorRect_.left - rootRect_0.left;
|
|
410
410
|
selectorRect.right = selectorRect.left + selectorRect_.width;
|
|
411
411
|
selectorRect.bottom = selectorRect.top + selectorRect_.height;
|
|
412
412
|
if (refs.mouseDown.current?.version === 'make') {
|
|
413
|
-
const top_ = clamp(y -
|
|
414
|
-
const left_ = clamp(x -
|
|
413
|
+
const top_ = clamp(y - rootRect_0.top, 0, rootRect_0.height);
|
|
414
|
+
const left_ = clamp(x - rootRect_0.left, 0, rootRect_0.width);
|
|
415
415
|
let top = clamp(top_, 0, previousTop);
|
|
416
416
|
let left = clamp(left_, 0, previousLeft);
|
|
417
417
|
let width = Math.abs(left_ - previousLeft);
|
|
418
418
|
let height = Math.abs(top_ - previousTop);
|
|
419
419
|
if (refs.aspectRatio.current !== undefined) {
|
|
420
420
|
if (left < previousLeft) {
|
|
421
|
-
if (refs.selector.current?.left < previousLeft && left < refs.selector.current?.left && (top <= 0 || refs.selector.current?.top + refs.selector.current?.height >=
|
|
421
|
+
if (refs.selector.current?.left < previousLeft && left < refs.selector.current?.left && (top <= 0 || refs.selector.current?.top + refs.selector.current?.height >= rootRect_0.height)) return;
|
|
422
422
|
}
|
|
423
423
|
if (top < previousTop) {
|
|
424
|
-
if (refs.selector.current?.top < previousTop && top < refs.selector.current?.top && (left <= 0 || refs.selector.current?.left + refs.selector.current?.width >=
|
|
424
|
+
if (refs.selector.current?.top < previousTop && top < refs.selector.current?.top && (left <= 0 || refs.selector.current?.left + refs.selector.current?.width >= rootRect_0.width)) return;
|
|
425
425
|
}
|
|
426
426
|
|
|
427
427
|
// Max surface
|
|
@@ -450,14 +450,14 @@ const ImageCrop = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
|
450
450
|
}
|
|
451
451
|
|
|
452
452
|
// Max width
|
|
453
|
-
if (left + width >
|
|
454
|
-
width =
|
|
453
|
+
if (left + width > rootRect_0.width) {
|
|
454
|
+
width = rootRect_0.width - left;
|
|
455
455
|
height = width / refs.aspectRatio.current;
|
|
456
456
|
}
|
|
457
457
|
|
|
458
458
|
// Max height
|
|
459
|
-
if (top + height >
|
|
460
|
-
height =
|
|
459
|
+
if (top + height > rootRect_0.height) {
|
|
460
|
+
height = rootRect_0.height - top;
|
|
461
461
|
width = height * refs.aspectRatio.current;
|
|
462
462
|
}
|
|
463
463
|
|
|
@@ -474,322 +474,322 @@ const ImageCrop = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
|
474
474
|
height
|
|
475
475
|
}));
|
|
476
476
|
} else if (refs.mouseDown.current?.version === 'move') {
|
|
477
|
-
const
|
|
478
|
-
const
|
|
477
|
+
const top_0 = y - refs.previousMouseEvent.current.clientY;
|
|
478
|
+
const left_0 = x - refs.previousMouseEvent.current.clientX;
|
|
479
479
|
onSelectorChange(_objectSpread(_objectSpread({}, refs.selector.current), {}, {
|
|
480
|
-
top: clamp(refs.selector.current.top +
|
|
481
|
-
left: clamp(refs.selector.current.left +
|
|
480
|
+
top: clamp(refs.selector.current.top + top_0, 0, rootRect_0.height - selectorRect.height),
|
|
481
|
+
left: clamp(refs.selector.current.left + left_0, 0, rootRect_0.width - selectorRect.width)
|
|
482
482
|
}));
|
|
483
483
|
} else if (refs.mouseDown.current?.version === 'top_left') {
|
|
484
484
|
const incY = y - refs.previousMouseEvent.current.clientY;
|
|
485
485
|
const incX = x - refs.previousMouseEvent.current.clientX;
|
|
486
|
-
let
|
|
487
|
-
let
|
|
488
|
-
if (selectorRect.bottom -
|
|
489
|
-
let
|
|
490
|
-
let
|
|
486
|
+
let top_1 = clamp(selectorRect.top + incY, 0);
|
|
487
|
+
let left_1 = clamp(selectorRect.left + incX, 0);
|
|
488
|
+
if (selectorRect.bottom - top_1 < 0 && selectorRect.right - left_1 < 0) refs.mouseDown.current.version = 'bottom_right';else if (selectorRect.bottom - top_1 < 0) refs.mouseDown.current.version = 'bottom_left';else if (selectorRect.right - left_1 < 0) refs.mouseDown.current.version = 'top_right';
|
|
489
|
+
let width_0 = clamp(selectorRect.right - left_1, 0);
|
|
490
|
+
let height_0 = clamp(selectorRect.bottom - top_1, 0);
|
|
491
491
|
if (refs.aspectRatio.current !== undefined) {
|
|
492
492
|
// Left
|
|
493
|
-
if (
|
|
493
|
+
if (left_1 < refs.selector.current.left && refs.selector.current.left < previousLeft && refs.selector.current?.top === 0) return;
|
|
494
494
|
|
|
495
495
|
// Max surface
|
|
496
|
-
if (
|
|
497
|
-
|
|
496
|
+
if (width_0 + width_0 / refs.aspectRatio.current >= height_0 + height_0 * refs.aspectRatio.current) {
|
|
497
|
+
height_0 = width_0 / refs.aspectRatio.current;
|
|
498
498
|
} else {
|
|
499
|
-
|
|
499
|
+
width_0 = height_0 * refs.aspectRatio.current;
|
|
500
500
|
}
|
|
501
501
|
|
|
502
502
|
// Moved left
|
|
503
|
-
if (
|
|
504
|
-
|
|
503
|
+
if (left_1 < previousLeft) {
|
|
504
|
+
left_1 = clamp(previousLeft - width_0, 0, previousLeft);
|
|
505
505
|
|
|
506
506
|
// Update width, height upto the previousLeft
|
|
507
|
-
|
|
508
|
-
|
|
507
|
+
width_0 = clamp(width_0, 0, previousLeft);
|
|
508
|
+
height_0 = width_0 / refs.aspectRatio.current;
|
|
509
509
|
}
|
|
510
510
|
|
|
511
511
|
// Moved top
|
|
512
|
-
if (
|
|
513
|
-
|
|
512
|
+
if (top_1 < previousTop) {
|
|
513
|
+
top_1 = clamp(previousTop - height_0, 0, previousTop);
|
|
514
514
|
|
|
515
515
|
// Update width, height upto the previousTop
|
|
516
|
-
|
|
517
|
-
|
|
516
|
+
height_0 = clamp(height_0, 0, previousTop);
|
|
517
|
+
width_0 = height_0 * refs.aspectRatio.current;
|
|
518
518
|
}
|
|
519
519
|
|
|
520
520
|
// Max width
|
|
521
|
-
if (
|
|
522
|
-
|
|
523
|
-
|
|
521
|
+
if (left_1 + width_0 > rootRect_0.width) {
|
|
522
|
+
width_0 = rootRect_0.width - left_1;
|
|
523
|
+
height_0 = width_0 / refs.aspectRatio.current;
|
|
524
524
|
}
|
|
525
525
|
|
|
526
526
|
// Max height
|
|
527
|
-
if (
|
|
528
|
-
|
|
529
|
-
|
|
527
|
+
if (top_1 + height_0 > rootRect_0.height) {
|
|
528
|
+
height_0 = rootRect_0.height - top_1;
|
|
529
|
+
width_0 = height_0 * refs.aspectRatio.current;
|
|
530
530
|
}
|
|
531
531
|
|
|
532
532
|
// Min left
|
|
533
|
-
if (
|
|
533
|
+
if (left_1 < previousLeft) left_1 = previousLeft - width_0;
|
|
534
534
|
|
|
535
535
|
// Min top
|
|
536
|
-
if (
|
|
536
|
+
if (top_1 < previousTop) top_1 = previousTop - height_0;
|
|
537
537
|
}
|
|
538
538
|
onSelectorChange(_objectSpread(_objectSpread({}, refs.selector.current), {}, {
|
|
539
|
-
top,
|
|
540
|
-
left,
|
|
541
|
-
width,
|
|
542
|
-
height
|
|
539
|
+
top: top_1,
|
|
540
|
+
left: left_1,
|
|
541
|
+
width: width_0,
|
|
542
|
+
height: height_0
|
|
543
543
|
}));
|
|
544
544
|
} else if (refs.mouseDown.current?.version === 'top_right') {
|
|
545
|
-
const
|
|
546
|
-
const
|
|
547
|
-
const
|
|
548
|
-
if (selectorRect.bottom -
|
|
549
|
-
let
|
|
550
|
-
let
|
|
545
|
+
const incY_0 = y - refs.previousMouseEvent.current.clientY;
|
|
546
|
+
const incX_0 = x - refs.previousMouseEvent.current.clientX;
|
|
547
|
+
const top_2 = clamp(selectorRect.top + incY_0, 0);
|
|
548
|
+
if (selectorRect.bottom - top_2 < 0 && selectorRect.width + incX_0 < 0) refs.mouseDown.current.version = 'bottom_left';else if (selectorRect.bottom - top_2 < 0) refs.mouseDown.current.version = 'bottom_right';else if (selectorRect.width + incX_0 < 0) refs.mouseDown.current.version = 'top_left';
|
|
549
|
+
let width_1 = clamp(Math.abs(selectorRect.width + incX_0), 0, rootRect_0.width - selectorRect.left);
|
|
550
|
+
let height_1 = clamp(selectorRect.bottom - top_2, 0);
|
|
551
551
|
|
|
552
552
|
// Top
|
|
553
553
|
if (refs.aspectRatio.current !== undefined) {
|
|
554
554
|
// Top
|
|
555
|
-
if (
|
|
556
|
-
|
|
557
|
-
|
|
555
|
+
if (top_2 < refs.selector.current.top && refs.selector.current.top < previousTop && refs.selector.current.left + refs.selector.current.width >= rootRect_0.width) return;
|
|
556
|
+
width_1 = height_1 * refs.aspectRatio.current;
|
|
557
|
+
height_1 = width_1 / refs.aspectRatio.current;
|
|
558
558
|
|
|
559
559
|
// Max width
|
|
560
|
-
if (refs.selector.current.left +
|
|
561
|
-
|
|
562
|
-
|
|
560
|
+
if (refs.selector.current.left + width_1 > rootRect_0.width) {
|
|
561
|
+
width_1 = rootRect_0.width - refs.selector.current.left;
|
|
562
|
+
height_1 = width_1 / refs.aspectRatio.current;
|
|
563
563
|
}
|
|
564
564
|
|
|
565
565
|
// Max height
|
|
566
|
-
if (refs.selector.current.top +
|
|
567
|
-
|
|
568
|
-
|
|
566
|
+
if (refs.selector.current.top + height_1 > rootRect_0.height) {
|
|
567
|
+
height_1 = rootRect_0.height - refs.selector.current.top;
|
|
568
|
+
width_1 = height_1 * refs.aspectRatio.current;
|
|
569
569
|
}
|
|
570
570
|
}
|
|
571
571
|
onSelectorChange(_objectSpread(_objectSpread({}, refs.selector.current), {}, {
|
|
572
|
-
top,
|
|
573
|
-
width,
|
|
574
|
-
height
|
|
572
|
+
top: top_2,
|
|
573
|
+
width: width_1,
|
|
574
|
+
height: height_1
|
|
575
575
|
}));
|
|
576
576
|
} else if (refs.mouseDown.current?.version === 'bottom_right') {
|
|
577
|
-
const
|
|
578
|
-
const
|
|
579
|
-
if (selectorRect.height +
|
|
580
|
-
let
|
|
581
|
-
let
|
|
577
|
+
const incY_1 = y - refs.previousMouseEvent.current.clientY;
|
|
578
|
+
const incX_1 = x - refs.previousMouseEvent.current.clientX;
|
|
579
|
+
if (selectorRect.height + incY_1 < 0 && selectorRect.width + incX_1 < 0) refs.mouseDown.current.version = 'top_left';else if (selectorRect.height + incY_1 < 0) refs.mouseDown.current.version = 'top_right';else if (selectorRect.width + incX_1 < 0) refs.mouseDown.current.version = 'bottom_left';
|
|
580
|
+
let width_2 = clamp(Math.abs(selectorRect.width + incX_1), 0, rootRect_0.width - selectorRect.left);
|
|
581
|
+
let height_2 = clamp(Math.abs(selectorRect.height + incY_1), 0, rootRect_0.height - selectorRect.top);
|
|
582
582
|
|
|
583
583
|
// Right
|
|
584
584
|
if (refs.aspectRatio.current !== undefined) {
|
|
585
|
-
|
|
585
|
+
height_2 = width_2 / refs.aspectRatio.current;
|
|
586
586
|
|
|
587
587
|
// Max width
|
|
588
|
-
if (refs.selector.current.left +
|
|
589
|
-
|
|
590
|
-
|
|
588
|
+
if (refs.selector.current.left + width_2 > rootRect_0.width) {
|
|
589
|
+
width_2 = rootRect_0.width - refs.selector.current.left;
|
|
590
|
+
height_2 = width_2 / refs.aspectRatio.current;
|
|
591
591
|
}
|
|
592
592
|
|
|
593
593
|
// Max height
|
|
594
|
-
if (refs.selector.current.top +
|
|
595
|
-
|
|
596
|
-
|
|
594
|
+
if (refs.selector.current.top + height_2 > rootRect_0.height) {
|
|
595
|
+
height_2 = rootRect_0.height - refs.selector.current.top;
|
|
596
|
+
width_2 = height_2 * refs.aspectRatio.current;
|
|
597
597
|
}
|
|
598
|
-
|
|
598
|
+
width_2 = height_2 * refs.aspectRatio.current;
|
|
599
599
|
|
|
600
600
|
// Max width
|
|
601
|
-
if (refs.selector.current.left +
|
|
602
|
-
|
|
603
|
-
|
|
601
|
+
if (refs.selector.current.left + width_2 > rootRect_0.width) {
|
|
602
|
+
width_2 = rootRect_0.width - refs.selector.current.left;
|
|
603
|
+
height_2 = width_2 / refs.aspectRatio.current;
|
|
604
604
|
}
|
|
605
605
|
|
|
606
606
|
// Max height
|
|
607
|
-
if (refs.selector.current.top +
|
|
608
|
-
|
|
609
|
-
|
|
607
|
+
if (refs.selector.current.top + height_2 > rootRect_0.height) {
|
|
608
|
+
height_2 = rootRect_0.height - refs.selector.current.top;
|
|
609
|
+
width_2 = height_2 * refs.aspectRatio.current;
|
|
610
610
|
}
|
|
611
611
|
}
|
|
612
612
|
onSelectorChange(_objectSpread(_objectSpread({}, refs.selector.current), {}, {
|
|
613
|
-
width,
|
|
614
|
-
height
|
|
613
|
+
width: width_2,
|
|
614
|
+
height: height_2
|
|
615
615
|
}));
|
|
616
616
|
} else if (refs.mouseDown.current?.version === 'bottom_left') {
|
|
617
|
-
const
|
|
618
|
-
const
|
|
619
|
-
const
|
|
620
|
-
if (selectorRect.height +
|
|
621
|
-
let
|
|
622
|
-
let
|
|
617
|
+
const incY_2 = y - refs.previousMouseEvent.current.clientY;
|
|
618
|
+
const incX_2 = x - refs.previousMouseEvent.current.clientX;
|
|
619
|
+
const left_2 = clamp(selectorRect.left + incX_2, 0);
|
|
620
|
+
if (selectorRect.height + incY_2 < 0 && selectorRect.right - left_2 < 0) refs.mouseDown.current.version = 'top_right';else if (selectorRect.height + incY_2 < 0) refs.mouseDown.current.version = 'top_left';else if (selectorRect.right - left_2 < 0) refs.mouseDown.current.version = 'bottom_right';
|
|
621
|
+
let width_3 = clamp(selectorRect.right - left_2, 0);
|
|
622
|
+
let height_3 = clamp(Math.abs(selectorRect.height + incY_2), 0, rootRect_0.height - selectorRect.top);
|
|
623
623
|
|
|
624
624
|
// Left
|
|
625
625
|
if (refs.aspectRatio.current !== undefined) {
|
|
626
626
|
// Left
|
|
627
|
-
if (
|
|
628
|
-
|
|
627
|
+
if (left_2 < refs.selector.current.left && refs.selector.current?.top + refs.selector.current?.height >= rootRect_0.height) return;
|
|
628
|
+
height_3 = width_3 / refs.aspectRatio.current;
|
|
629
629
|
|
|
630
630
|
// Max width
|
|
631
|
-
if (refs.selector.current.left +
|
|
632
|
-
|
|
633
|
-
|
|
631
|
+
if (refs.selector.current.left + width_3 > rootRect_0.width) {
|
|
632
|
+
width_3 = rootRect_0.width - refs.selector.current.left;
|
|
633
|
+
height_3 = width_3 / refs.aspectRatio.current;
|
|
634
634
|
}
|
|
635
635
|
|
|
636
636
|
// Max height
|
|
637
|
-
if (refs.selector.current.top +
|
|
638
|
-
|
|
639
|
-
|
|
637
|
+
if (refs.selector.current.top + height_3 > rootRect_0.height) {
|
|
638
|
+
height_3 = rootRect_0.height - refs.selector.current.top;
|
|
639
|
+
width_3 = height_3 * refs.aspectRatio.current;
|
|
640
640
|
}
|
|
641
|
-
|
|
641
|
+
width_3 = height_3 * refs.aspectRatio.current;
|
|
642
642
|
|
|
643
643
|
// Max width
|
|
644
|
-
if (refs.selector.current.left +
|
|
645
|
-
|
|
646
|
-
|
|
644
|
+
if (refs.selector.current.left + width_3 > rootRect_0.width) {
|
|
645
|
+
width_3 = rootRect_0.width - refs.selector.current.left;
|
|
646
|
+
height_3 = width_3 / refs.aspectRatio.current;
|
|
647
647
|
}
|
|
648
648
|
|
|
649
649
|
// Max height
|
|
650
|
-
if (refs.selector.current.top +
|
|
651
|
-
|
|
652
|
-
|
|
650
|
+
if (refs.selector.current.top + height_3 > rootRect_0.height) {
|
|
651
|
+
height_3 = rootRect_0.height - refs.selector.current.top;
|
|
652
|
+
width_3 = height_3 * refs.aspectRatio.current;
|
|
653
653
|
}
|
|
654
654
|
}
|
|
655
655
|
onSelectorChange(_objectSpread(_objectSpread({}, refs.selector.current), {}, {
|
|
656
|
-
left,
|
|
657
|
-
width,
|
|
658
|
-
height
|
|
656
|
+
left: left_2,
|
|
657
|
+
width: width_3,
|
|
658
|
+
height: height_3
|
|
659
659
|
}));
|
|
660
660
|
} else if (refs.mouseDown.current?.version === 'top') {
|
|
661
661
|
const inc = y - refs.previousMouseEvent.current.clientY;
|
|
662
|
-
const
|
|
663
|
-
if (refs.selector.current.top <= 0 &&
|
|
664
|
-
if (selectorRect.bottom -
|
|
665
|
-
let
|
|
666
|
-
let
|
|
662
|
+
const top_3 = clamp(refs.selector.current.top + inc, 0);
|
|
663
|
+
if (refs.selector.current.top <= 0 && top_3 <= 0) return;
|
|
664
|
+
if (selectorRect.bottom - top_3 < 0) refs.mouseDown.current.version = 'bottom';
|
|
665
|
+
let width_4 = refs.selector.current.width;
|
|
666
|
+
let height_4 = clamp(Math.abs(refs.selector.current.height - inc), 0, previousTop - top_3);
|
|
667
667
|
if (refs.aspectRatio.current !== undefined) {
|
|
668
668
|
// Top
|
|
669
|
-
if (
|
|
670
|
-
|
|
669
|
+
if (top_3 < refs.selector.current.top && refs.selector.current.top < previousTop && refs.selector.current.left + refs.selector.current.width >= rootRect_0.width) return;
|
|
670
|
+
width_4 = height_4 * refs.aspectRatio.current;
|
|
671
671
|
|
|
672
672
|
// Max width
|
|
673
|
-
if (refs.selector.current.left +
|
|
674
|
-
|
|
675
|
-
|
|
673
|
+
if (refs.selector.current.left + width_4 > rootRect_0.width) {
|
|
674
|
+
width_4 = rootRect_0.width - refs.selector.current.left;
|
|
675
|
+
height_4 = width_4 / refs.aspectRatio.current;
|
|
676
676
|
}
|
|
677
677
|
|
|
678
678
|
// Max height
|
|
679
|
-
if (
|
|
680
|
-
|
|
681
|
-
|
|
679
|
+
if (top_3 + height_4 > rootRect_0.height) {
|
|
680
|
+
height_4 = rootRect_0.height - top_3;
|
|
681
|
+
width_4 = height_4 * refs.aspectRatio.current;
|
|
682
682
|
}
|
|
683
683
|
}
|
|
684
684
|
onSelectorChange(_objectSpread(_objectSpread({}, refs.selector.current), {}, {
|
|
685
|
-
top,
|
|
686
|
-
width,
|
|
687
|
-
height
|
|
685
|
+
top: top_3,
|
|
686
|
+
width: width_4,
|
|
687
|
+
height: height_4
|
|
688
688
|
}));
|
|
689
689
|
} else if (refs.mouseDown.current?.version === 'bottom') {
|
|
690
|
-
const
|
|
691
|
-
if (selectorRect.height +
|
|
692
|
-
let
|
|
693
|
-
let
|
|
690
|
+
const inc_0 = y - refs.previousMouseEvent.current.clientY;
|
|
691
|
+
if (selectorRect.height + inc_0 < 0) refs.mouseDown.current.version = 'top';
|
|
692
|
+
let width_5 = refs.selector.current.width;
|
|
693
|
+
let height_5 = clamp(Math.abs(selectorRect.height + inc_0), 0, rootRect_0.height - refs.selector.current.top);
|
|
694
694
|
if (refs.aspectRatio.current !== undefined) {
|
|
695
|
-
|
|
695
|
+
width_5 = height_5 * refs.aspectRatio.current;
|
|
696
696
|
|
|
697
697
|
// Max height
|
|
698
|
-
if (refs.selector.current.top +
|
|
699
|
-
|
|
700
|
-
|
|
698
|
+
if (refs.selector.current.top + height_5 > rootRect_0.height) {
|
|
699
|
+
height_5 = rootRect_0.height - refs.selector.current.top;
|
|
700
|
+
width_5 = height_5 * refs.aspectRatio.current;
|
|
701
701
|
}
|
|
702
702
|
|
|
703
703
|
// Max width
|
|
704
|
-
if (refs.selector.current.left +
|
|
705
|
-
|
|
706
|
-
|
|
704
|
+
if (refs.selector.current.left + width_5 > rootRect_0.width) {
|
|
705
|
+
width_5 = rootRect_0.width - refs.selector.current.left;
|
|
706
|
+
height_5 = width_5 / refs.aspectRatio.current;
|
|
707
707
|
}
|
|
708
708
|
}
|
|
709
709
|
onSelectorChange(_objectSpread(_objectSpread({}, refs.selector.current), {}, {
|
|
710
|
-
width,
|
|
711
|
-
height
|
|
710
|
+
width: width_5,
|
|
711
|
+
height: height_5
|
|
712
712
|
}));
|
|
713
713
|
} else if (refs.mouseDown.current?.version === 'left') {
|
|
714
|
-
const
|
|
715
|
-
const
|
|
716
|
-
if (selectorRect.right -
|
|
717
|
-
let
|
|
718
|
-
let
|
|
714
|
+
const inc_1 = x - refs.previousMouseEvent.current.clientX;
|
|
715
|
+
const left_3 = clamp(selectorRect.left + inc_1, 0);
|
|
716
|
+
if (selectorRect.right - left_3 < 0) refs.mouseDown.current.version = 'right';
|
|
717
|
+
let width_6 = clamp(selectorRect.right - left_3, 0);
|
|
718
|
+
let height_6 = refs.selector.current.height;
|
|
719
719
|
if (refs.aspectRatio.current !== undefined) {
|
|
720
|
-
if (
|
|
721
|
-
|
|
720
|
+
if (left_3 < refs.selector.current.left && refs.selector.current?.top + refs.selector.current?.height >= rootRect_0.height) return;
|
|
721
|
+
height_6 = width_6 / refs.aspectRatio.current;
|
|
722
722
|
|
|
723
723
|
// Max width
|
|
724
|
-
if (refs.selector.current.left +
|
|
725
|
-
|
|
726
|
-
|
|
724
|
+
if (refs.selector.current.left + width_6 > rootRect_0.width) {
|
|
725
|
+
width_6 = rootRect_0.width - refs.selector.current.left;
|
|
726
|
+
height_6 = width_6 / refs.aspectRatio.current;
|
|
727
727
|
}
|
|
728
728
|
|
|
729
729
|
// Max height
|
|
730
|
-
if (refs.selector.current.top +
|
|
731
|
-
|
|
732
|
-
|
|
730
|
+
if (refs.selector.current.top + height_6 > rootRect_0.height) {
|
|
731
|
+
height_6 = rootRect_0.height - refs.selector.current.top;
|
|
732
|
+
width_6 = height_6 * refs.aspectRatio.current;
|
|
733
733
|
}
|
|
734
734
|
}
|
|
735
735
|
onSelectorChange(_objectSpread(_objectSpread({}, refs.selector.current), {}, {
|
|
736
|
-
left,
|
|
737
|
-
width,
|
|
738
|
-
height
|
|
736
|
+
left: left_3,
|
|
737
|
+
width: width_6,
|
|
738
|
+
height: height_6
|
|
739
739
|
}));
|
|
740
740
|
} else if (refs.mouseDown.current?.version === 'right') {
|
|
741
|
-
const
|
|
742
|
-
if (selectorRect.width +
|
|
743
|
-
let
|
|
744
|
-
let
|
|
741
|
+
const inc_2 = x - refs.previousMouseEvent.current.clientX;
|
|
742
|
+
if (selectorRect.width + inc_2 < 0) refs.mouseDown.current.version = 'left';
|
|
743
|
+
let width_7 = clamp(Math.abs(selectorRect.width + inc_2), 0, rootRect_0.width - selectorRect.left);
|
|
744
|
+
let height_7 = refs.selector.current.height;
|
|
745
745
|
if (refs.aspectRatio.current !== undefined) {
|
|
746
|
-
|
|
746
|
+
height_7 = width_7 / refs.aspectRatio.current;
|
|
747
747
|
|
|
748
748
|
// Max width
|
|
749
|
-
if (refs.selector.current.left +
|
|
750
|
-
|
|
751
|
-
|
|
749
|
+
if (refs.selector.current.left + width_7 > rootRect_0.width) {
|
|
750
|
+
width_7 = rootRect_0.width - refs.selector.current.left;
|
|
751
|
+
height_7 = width_7 / refs.aspectRatio.current;
|
|
752
752
|
}
|
|
753
753
|
|
|
754
754
|
// Max height
|
|
755
|
-
if (refs.selector.current.top +
|
|
756
|
-
|
|
757
|
-
|
|
755
|
+
if (refs.selector.current.top + height_7 > rootRect_0.height) {
|
|
756
|
+
height_7 = rootRect_0.height - refs.selector.current.top;
|
|
757
|
+
width_7 = height_7 * refs.aspectRatio.current;
|
|
758
758
|
}
|
|
759
759
|
}
|
|
760
760
|
onSelectorChange(_objectSpread(_objectSpread({}, refs.selector.current), {}, {
|
|
761
|
-
width,
|
|
762
|
-
height
|
|
761
|
+
width: width_7,
|
|
762
|
+
height: height_7
|
|
763
763
|
}));
|
|
764
764
|
}
|
|
765
765
|
}
|
|
766
766
|
};
|
|
767
767
|
|
|
768
768
|
// Mouse move
|
|
769
|
-
const onMouseMove =
|
|
769
|
+
const onMouseMove = event_1 => {
|
|
770
770
|
if (refs.mouseDown.current) {
|
|
771
771
|
const {
|
|
772
772
|
clientY,
|
|
773
773
|
clientX
|
|
774
|
-
} =
|
|
774
|
+
} = event_1;
|
|
775
775
|
onMove(clientX, clientY);
|
|
776
|
-
refs.previousMouseEvent.current =
|
|
776
|
+
refs.previousMouseEvent.current = event_1;
|
|
777
777
|
}
|
|
778
778
|
};
|
|
779
779
|
|
|
780
780
|
// Touch move
|
|
781
|
-
const onTouchMove =
|
|
781
|
+
const onTouchMove = event_2 => {
|
|
782
782
|
if (refs.mouseDown.current) {
|
|
783
783
|
const {
|
|
784
|
-
clientY,
|
|
785
|
-
clientX
|
|
786
|
-
} =
|
|
787
|
-
onMove(
|
|
788
|
-
refs.previousMouseEvent.current =
|
|
784
|
+
clientY: clientY_0,
|
|
785
|
+
clientX: clientX_0
|
|
786
|
+
} = event_2.touches[0];
|
|
787
|
+
onMove(clientX_0, clientY_0);
|
|
788
|
+
refs.previousMouseEvent.current = event_2;
|
|
789
789
|
|
|
790
790
|
// Normalize for use as a mouseDown value
|
|
791
|
-
refs.previousMouseEvent.current.clientY =
|
|
792
|
-
refs.previousMouseEvent.current.clientX =
|
|
791
|
+
refs.previousMouseEvent.current.clientY = clientY_0;
|
|
792
|
+
refs.previousMouseEvent.current.clientX = clientX_0;
|
|
793
793
|
}
|
|
794
794
|
};
|
|
795
795
|
const rootDocument = isEnvironment('browser') ? refs.root.current?.ownerDocument || window.document : undefined;
|
|
@@ -820,13 +820,13 @@ const ImageCrop = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
|
820
820
|
}, [image_]);
|
|
821
821
|
const updateSelector = (selector__ = refs.selector.current, image__ = refs.image.current) => {
|
|
822
822
|
if (selector__ !== undefined && image__ !== undefined) {
|
|
823
|
-
const
|
|
823
|
+
const rootRect_1 = refs.root.current.getBoundingClientRect();
|
|
824
824
|
const selectorValue = {
|
|
825
825
|
top: clamp(selector__.top, 0, image__.height),
|
|
826
826
|
left: clamp(selector__.left, 0, image__.height)
|
|
827
827
|
};
|
|
828
|
-
selectorValue.width = clamp(selector__.width || 0, 0,
|
|
829
|
-
selectorValue.height = clamp(selector__.height || 0, 0,
|
|
828
|
+
selectorValue.width = clamp(selector__.width || 0, 0, rootRect_1.width - selectorValue.left);
|
|
829
|
+
selectorValue.height = clamp(selector__.height || 0, 0, rootRect_1.height - selectorValue.top);
|
|
830
830
|
|
|
831
831
|
// Aspect ratio
|
|
832
832
|
if (refs.aspectRatio.current !== undefined) {
|
|
@@ -838,14 +838,14 @@ const ImageCrop = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
|
838
838
|
}
|
|
839
839
|
|
|
840
840
|
// Max width
|
|
841
|
-
if (selectorValue.left + selectorValue.width >
|
|
842
|
-
selectorValue.width =
|
|
841
|
+
if (selectorValue.left + selectorValue.width > rootRect_1.width) {
|
|
842
|
+
selectorValue.width = rootRect_1.width - selectorValue.left;
|
|
843
843
|
selectorValue.height = selectorValue.width / refs.aspectRatio.current;
|
|
844
844
|
}
|
|
845
845
|
|
|
846
846
|
// Max height
|
|
847
|
-
if (selectorValue.top + selectorValue.height >
|
|
848
|
-
selectorValue.height =
|
|
847
|
+
if (selectorValue.top + selectorValue.height > rootRect_1.height) {
|
|
848
|
+
selectorValue.height = rootRect_1.height - selectorValue.top;
|
|
849
849
|
selectorValue.width = selectorValue.height * refs.aspectRatio.current;
|
|
850
850
|
}
|
|
851
851
|
}
|
|
@@ -855,10 +855,10 @@ const ImageCrop = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
|
855
855
|
|
|
856
856
|
// Update selector relative
|
|
857
857
|
setSelectorRelative({
|
|
858
|
-
top: selectorValue.top /
|
|
859
|
-
left: selectorValue.left /
|
|
860
|
-
width: selectorValue.width /
|
|
861
|
-
height: selectorValue.height /
|
|
858
|
+
top: selectorValue.top / rootRect_1?.height * refs.canvasMain.current?.height,
|
|
859
|
+
left: selectorValue.left / rootRect_1?.width * refs.canvasMain.current?.width,
|
|
860
|
+
width: selectorValue.width / rootRect_1?.width * refs.canvasMain.current?.width,
|
|
861
|
+
height: selectorValue.height / rootRect_1?.height * refs.canvasMain.current?.height
|
|
862
862
|
});
|
|
863
863
|
}
|
|
864
864
|
};
|
|
@@ -883,13 +883,13 @@ const ImageCrop = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
|
883
883
|
}, [image]);
|
|
884
884
|
const makeImage = async (value = image) => {
|
|
885
885
|
const img = await imageMethod(value);
|
|
886
|
-
const
|
|
887
|
-
const canvas =
|
|
888
|
-
const
|
|
886
|
+
const rootDocument_0 = isEnvironment('browser') ? refs.root.current?.ownerDocument || window.document : undefined;
|
|
887
|
+
const canvas = rootDocument_0.createElement('canvas');
|
|
888
|
+
const rootRect_2 = refs.root.current.getBoundingClientRect();
|
|
889
889
|
const aspectRatioImg = img.width / img.height;
|
|
890
890
|
|
|
891
891
|
// width being parent width
|
|
892
|
-
img.width =
|
|
892
|
+
img.width = rootRect_2.width;
|
|
893
893
|
|
|
894
894
|
// height keep aspect ratio of the img for the height
|
|
895
895
|
img.height = img.width / aspectRatioImg;
|
|
@@ -898,76 +898,76 @@ const ImageCrop = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
|
898
898
|
canvas.getContext('2d').drawImage(img, 0, 0, img.width, img.height);
|
|
899
899
|
setImage(canvas);
|
|
900
900
|
};
|
|
901
|
-
const onFocus =
|
|
901
|
+
const onFocus = event_3 => {
|
|
902
902
|
setFocus(true);
|
|
903
|
-
if (is('function', onFocus_)) onFocus_(
|
|
904
|
-
}
|
|
905
|
-
const onBlur =
|
|
903
|
+
if (is('function', onFocus_)) onFocus_(event_3);
|
|
904
|
+
};
|
|
905
|
+
const onBlur = event_4 => {
|
|
906
906
|
setFocus(false);
|
|
907
|
-
if (is('function', onBlur_)) onBlur_(
|
|
908
|
-
}
|
|
909
|
-
const onTouchStart =
|
|
910
|
-
if (![refs.imageSelectorMain.current, refs.imageSelector.current, refs.move.current, refs.borderTop.current, refs.borderLeft.current, refs.borderRight.current, refs.borderBottom.current, refs.dotTopLeft.current, refs.dotTopRight.current, refs.dotBottomLeft.current, refs.dotBottomRight.current].includes(
|
|
907
|
+
if (is('function', onBlur_)) onBlur_(event_4);
|
|
908
|
+
};
|
|
909
|
+
const onTouchStart = event_5 => {
|
|
910
|
+
if (![refs.imageSelectorMain.current, refs.imageSelector.current, refs.move.current, refs.borderTop.current, refs.borderLeft.current, refs.borderRight.current, refs.borderBottom.current, refs.dotTopLeft.current, refs.dotTopRight.current, refs.dotBottomLeft.current, refs.dotBottomRight.current].includes(event_5.target)) {
|
|
911
911
|
const {
|
|
912
|
-
clientY,
|
|
913
|
-
clientX
|
|
914
|
-
} =
|
|
915
|
-
const
|
|
912
|
+
clientY: clientY_1,
|
|
913
|
+
clientX: clientX_1
|
|
914
|
+
} = event_5.touches[0];
|
|
915
|
+
const rootRect_3 = refs.root.current.getBoundingClientRect();
|
|
916
916
|
setMouseDown({
|
|
917
917
|
version: 'make',
|
|
918
|
-
top:
|
|
919
|
-
left:
|
|
918
|
+
top: clientY_1 - rootRect_3.top,
|
|
919
|
+
left: clientX_1 - rootRect_3.left
|
|
920
920
|
});
|
|
921
921
|
}
|
|
922
|
-
}
|
|
923
|
-
const onMouseDown =
|
|
924
|
-
if (![refs.imageSelectorMain.current, refs.imageSelector.current, refs.move.current, refs.borderTop.current, refs.borderLeft.current, refs.borderRight.current, refs.borderBottom.current, refs.dotTopLeft.current, refs.dotTopRight.current, refs.dotBottomLeft.current, refs.dotBottomRight.current].includes(
|
|
922
|
+
};
|
|
923
|
+
const onMouseDown = event_6 => {
|
|
924
|
+
if (![refs.imageSelectorMain.current, refs.imageSelector.current, refs.move.current, refs.borderTop.current, refs.borderLeft.current, refs.borderRight.current, refs.borderBottom.current, refs.dotTopLeft.current, refs.dotTopRight.current, refs.dotBottomLeft.current, refs.dotBottomRight.current].includes(event_6.target)) {
|
|
925
925
|
const {
|
|
926
|
-
clientY,
|
|
927
|
-
clientX
|
|
928
|
-
} =
|
|
929
|
-
const
|
|
926
|
+
clientY: clientY_2,
|
|
927
|
+
clientX: clientX_2
|
|
928
|
+
} = event_6;
|
|
929
|
+
const rootRect_4 = refs.root.current.getBoundingClientRect();
|
|
930
930
|
setMouseDown({
|
|
931
931
|
version: 'make',
|
|
932
|
-
top:
|
|
933
|
-
left:
|
|
932
|
+
top: clientY_2 - rootRect_4.top,
|
|
933
|
+
left: clientX_2 - rootRect_4.left
|
|
934
934
|
});
|
|
935
935
|
}
|
|
936
|
-
}
|
|
937
|
-
const onTouchStartSelector =
|
|
936
|
+
};
|
|
937
|
+
const onTouchStartSelector = event_7 => {
|
|
938
938
|
const {
|
|
939
|
-
clientY,
|
|
940
|
-
clientX
|
|
941
|
-
} =
|
|
942
|
-
const
|
|
939
|
+
clientY: clientY_3,
|
|
940
|
+
clientX: clientX_3
|
|
941
|
+
} = event_7.touches[0];
|
|
942
|
+
const rootRect_5 = refs.root.current.getBoundingClientRect();
|
|
943
943
|
setMouseDown({
|
|
944
944
|
version: 'move',
|
|
945
|
-
top:
|
|
946
|
-
left:
|
|
945
|
+
top: clientY_3 - rootRect_5.top,
|
|
946
|
+
left: clientX_3 - rootRect_5.left
|
|
947
947
|
});
|
|
948
|
-
}
|
|
949
|
-
const onMouseDownSelector =
|
|
948
|
+
};
|
|
949
|
+
const onMouseDownSelector = event_8 => {
|
|
950
950
|
const {
|
|
951
|
-
clientY,
|
|
952
|
-
clientX
|
|
953
|
-
} =
|
|
954
|
-
const
|
|
951
|
+
clientY: clientY_4,
|
|
952
|
+
clientX: clientX_4
|
|
953
|
+
} = event_8;
|
|
954
|
+
const rootRect_6 = refs.root.current.getBoundingClientRect();
|
|
955
955
|
setMouseDown({
|
|
956
956
|
version: 'move',
|
|
957
|
-
top:
|
|
958
|
-
left:
|
|
957
|
+
top: clientY_4 - rootRect_6.top,
|
|
958
|
+
left: clientX_4 - rootRect_6.left
|
|
959
959
|
});
|
|
960
|
-
}
|
|
961
|
-
const onTouchStartBorder = version =>
|
|
960
|
+
};
|
|
961
|
+
const onTouchStartBorder = version => event_9 => {
|
|
962
962
|
setMouseDown({
|
|
963
963
|
version,
|
|
964
964
|
top: refs.selector.current?.top + refs.selector.current?.height,
|
|
965
965
|
left: refs.selector.current?.left + refs.selector.current?.width
|
|
966
966
|
});
|
|
967
967
|
};
|
|
968
|
-
const onMouseDownBorder =
|
|
968
|
+
const onMouseDownBorder = version_0 => event_10 => {
|
|
969
969
|
setMouseDown({
|
|
970
|
-
version,
|
|
970
|
+
version: version_0,
|
|
971
971
|
top: refs.selector.current?.top + refs.selector.current?.height,
|
|
972
972
|
left: refs.selector.current?.left + refs.selector.current?.width
|
|
973
973
|
});
|