@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
package/ImageCrop/ImageCrop.js
CHANGED
|
@@ -254,16 +254,10 @@ const useStyle = (0, _styleReact.style)(theme => {
|
|
|
254
254
|
name: 'onesy-ImageCrop'
|
|
255
255
|
});
|
|
256
256
|
const ImageCrop = /*#__PURE__*/_react.default.forwardRef((props_, ref) => {
|
|
257
|
-
var _refs$root$current4;
|
|
257
|
+
var _theme$ui, _theme$ui2, _theme$elements, _refs$root$current4;
|
|
258
258
|
const theme = (0, _styleReact.useOnesyTheme)();
|
|
259
|
-
const props =
|
|
260
|
-
|
|
261
|
-
return _objectSpread(_objectSpread(_objectSpread({}, theme === null || theme === void 0 || (_theme$ui = theme.ui) === null || _theme$ui === void 0 || (_theme$ui = _theme$ui.elements) === null || _theme$ui === void 0 || (_theme$ui = _theme$ui.all) === null || _theme$ui === void 0 || (_theme$ui = _theme$ui.props) === null || _theme$ui === void 0 ? void 0 : _theme$ui.default), theme === null || theme === void 0 || (_theme$ui2 = theme.ui) === null || _theme$ui2 === void 0 || (_theme$ui2 = _theme$ui2.elements) === null || _theme$ui2 === void 0 || (_theme$ui2 = _theme$ui2.onesyImageCrop) === null || _theme$ui2 === void 0 || (_theme$ui2 = _theme$ui2.props) === null || _theme$ui2 === void 0 ? void 0 : _theme$ui2.default), props_);
|
|
262
|
-
}, [props_]);
|
|
263
|
-
const Tooltip = _react.default.useMemo(() => {
|
|
264
|
-
var _theme$elements;
|
|
265
|
-
return (theme === null || theme === void 0 || (_theme$elements = theme.elements) === null || _theme$elements === void 0 ? void 0 : _theme$elements.Tooltip) || _Tooltip.default;
|
|
266
|
-
}, [theme]);
|
|
259
|
+
const props = _objectSpread(_objectSpread(_objectSpread({}, theme === null || theme === void 0 || (_theme$ui = theme.ui) === null || _theme$ui === void 0 || (_theme$ui = _theme$ui.elements) === null || _theme$ui === void 0 || (_theme$ui = _theme$ui.all) === null || _theme$ui === void 0 || (_theme$ui = _theme$ui.props) === null || _theme$ui === void 0 ? void 0 : _theme$ui.default), theme === null || theme === void 0 || (_theme$ui2 = theme.ui) === null || _theme$ui2 === void 0 || (_theme$ui2 = _theme$ui2.elements) === null || _theme$ui2 === void 0 || (_theme$ui2 = _theme$ui2.onesyImageCrop) === null || _theme$ui2 === void 0 || (_theme$ui2 = _theme$ui2.props) === null || _theme$ui2 === void 0 ? void 0 : _theme$ui2.default), props_);
|
|
260
|
+
const Tooltip = (theme === null || theme === void 0 || (_theme$elements = theme.elements) === null || _theme$elements === void 0 ? void 0 : _theme$elements.Tooltip) || _Tooltip.default;
|
|
267
261
|
const {
|
|
268
262
|
// url, datauri or canvas
|
|
269
263
|
image: image_,
|
|
@@ -404,7 +398,7 @@ const ImageCrop = /*#__PURE__*/_react.default.forwardRef((props_, ref) => {
|
|
|
404
398
|
break;
|
|
405
399
|
}
|
|
406
400
|
};
|
|
407
|
-
const onMouseUp =
|
|
401
|
+
const onMouseUp = event_0 => {
|
|
408
402
|
setMouseDown(false);
|
|
409
403
|
refs.previousMouseEvent.current = undefined;
|
|
410
404
|
};
|
|
@@ -417,20 +411,20 @@ const ImageCrop = /*#__PURE__*/_react.default.forwardRef((props_, ref) => {
|
|
|
417
411
|
top: previousTop,
|
|
418
412
|
left: previousLeft
|
|
419
413
|
} = refs.mouseDown.current;
|
|
420
|
-
const
|
|
414
|
+
const rootRect_0 = refs.root.current.getBoundingClientRect();
|
|
421
415
|
const selectorRect_ = refs.imageSelectorMain.current.getBoundingClientRect();
|
|
422
416
|
const selectorRect = {};
|
|
423
417
|
|
|
424
418
|
// Normalize relative to root
|
|
425
419
|
selectorRect.width = selectorRect_.width;
|
|
426
420
|
selectorRect.height = selectorRect_.height;
|
|
427
|
-
selectorRect.top = selectorRect_.top -
|
|
428
|
-
selectorRect.left = selectorRect_.left -
|
|
421
|
+
selectorRect.top = selectorRect_.top - rootRect_0.top;
|
|
422
|
+
selectorRect.left = selectorRect_.left - rootRect_0.left;
|
|
429
423
|
selectorRect.right = selectorRect.left + selectorRect_.width;
|
|
430
424
|
selectorRect.bottom = selectorRect.top + selectorRect_.height;
|
|
431
425
|
if (((_refs$mouseDown$curre2 = refs.mouseDown.current) === null || _refs$mouseDown$curre2 === void 0 ? void 0 : _refs$mouseDown$curre2.version) === 'make') {
|
|
432
|
-
const top_ = (0, _utils.clamp)(y -
|
|
433
|
-
const left_ = (0, _utils.clamp)(x -
|
|
426
|
+
const top_ = (0, _utils.clamp)(y - rootRect_0.top, 0, rootRect_0.height);
|
|
427
|
+
const left_ = (0, _utils.clamp)(x - rootRect_0.left, 0, rootRect_0.width);
|
|
434
428
|
let top = (0, _utils.clamp)(top_, 0, previousTop);
|
|
435
429
|
let left = (0, _utils.clamp)(left_, 0, previousLeft);
|
|
436
430
|
let width = Math.abs(left_ - previousLeft);
|
|
@@ -438,11 +432,11 @@ const ImageCrop = /*#__PURE__*/_react.default.forwardRef((props_, ref) => {
|
|
|
438
432
|
if (refs.aspectRatio.current !== undefined) {
|
|
439
433
|
if (left < previousLeft) {
|
|
440
434
|
var _refs$selector$curren5, _refs$selector$curren6, _refs$selector$curren7, _refs$selector$curren8;
|
|
441
|
-
if (((_refs$selector$curren5 = refs.selector.current) === null || _refs$selector$curren5 === void 0 ? void 0 : _refs$selector$curren5.left) < previousLeft && left < ((_refs$selector$curren6 = refs.selector.current) === null || _refs$selector$curren6 === void 0 ? void 0 : _refs$selector$curren6.left) && (top <= 0 || ((_refs$selector$curren7 = refs.selector.current) === null || _refs$selector$curren7 === void 0 ? void 0 : _refs$selector$curren7.top) + ((_refs$selector$curren8 = refs.selector.current) === null || _refs$selector$curren8 === void 0 ? void 0 : _refs$selector$curren8.height) >=
|
|
435
|
+
if (((_refs$selector$curren5 = refs.selector.current) === null || _refs$selector$curren5 === void 0 ? void 0 : _refs$selector$curren5.left) < previousLeft && left < ((_refs$selector$curren6 = refs.selector.current) === null || _refs$selector$curren6 === void 0 ? void 0 : _refs$selector$curren6.left) && (top <= 0 || ((_refs$selector$curren7 = refs.selector.current) === null || _refs$selector$curren7 === void 0 ? void 0 : _refs$selector$curren7.top) + ((_refs$selector$curren8 = refs.selector.current) === null || _refs$selector$curren8 === void 0 ? void 0 : _refs$selector$curren8.height) >= rootRect_0.height)) return;
|
|
442
436
|
}
|
|
443
437
|
if (top < previousTop) {
|
|
444
438
|
var _refs$selector$curren9, _refs$selector$curren0, _refs$selector$curren1, _refs$selector$curren10;
|
|
445
|
-
if (((_refs$selector$curren9 = refs.selector.current) === null || _refs$selector$curren9 === void 0 ? void 0 : _refs$selector$curren9.top) < previousTop && top < ((_refs$selector$curren0 = refs.selector.current) === null || _refs$selector$curren0 === void 0 ? void 0 : _refs$selector$curren0.top) && (left <= 0 || ((_refs$selector$curren1 = refs.selector.current) === null || _refs$selector$curren1 === void 0 ? void 0 : _refs$selector$curren1.left) + ((_refs$selector$curren10 = refs.selector.current) === null || _refs$selector$curren10 === void 0 ? void 0 : _refs$selector$curren10.width) >=
|
|
439
|
+
if (((_refs$selector$curren9 = refs.selector.current) === null || _refs$selector$curren9 === void 0 ? void 0 : _refs$selector$curren9.top) < previousTop && top < ((_refs$selector$curren0 = refs.selector.current) === null || _refs$selector$curren0 === void 0 ? void 0 : _refs$selector$curren0.top) && (left <= 0 || ((_refs$selector$curren1 = refs.selector.current) === null || _refs$selector$curren1 === void 0 ? void 0 : _refs$selector$curren1.left) + ((_refs$selector$curren10 = refs.selector.current) === null || _refs$selector$curren10 === void 0 ? void 0 : _refs$selector$curren10.width) >= rootRect_0.width)) return;
|
|
446
440
|
}
|
|
447
441
|
|
|
448
442
|
// Max surface
|
|
@@ -471,14 +465,14 @@ const ImageCrop = /*#__PURE__*/_react.default.forwardRef((props_, ref) => {
|
|
|
471
465
|
}
|
|
472
466
|
|
|
473
467
|
// Max width
|
|
474
|
-
if (left + width >
|
|
475
|
-
width =
|
|
468
|
+
if (left + width > rootRect_0.width) {
|
|
469
|
+
width = rootRect_0.width - left;
|
|
476
470
|
height = width / refs.aspectRatio.current;
|
|
477
471
|
}
|
|
478
472
|
|
|
479
473
|
// Max height
|
|
480
|
-
if (top + height >
|
|
481
|
-
height =
|
|
474
|
+
if (top + height > rootRect_0.height) {
|
|
475
|
+
height = rootRect_0.height - top;
|
|
482
476
|
width = height * refs.aspectRatio.current;
|
|
483
477
|
}
|
|
484
478
|
|
|
@@ -495,325 +489,325 @@ const ImageCrop = /*#__PURE__*/_react.default.forwardRef((props_, ref) => {
|
|
|
495
489
|
height
|
|
496
490
|
}));
|
|
497
491
|
} else if (((_refs$mouseDown$curre3 = refs.mouseDown.current) === null || _refs$mouseDown$curre3 === void 0 ? void 0 : _refs$mouseDown$curre3.version) === 'move') {
|
|
498
|
-
const
|
|
499
|
-
const
|
|
492
|
+
const top_0 = y - refs.previousMouseEvent.current.clientY;
|
|
493
|
+
const left_0 = x - refs.previousMouseEvent.current.clientX;
|
|
500
494
|
onSelectorChange(_objectSpread(_objectSpread({}, refs.selector.current), {}, {
|
|
501
|
-
top: (0, _utils.clamp)(refs.selector.current.top +
|
|
502
|
-
left: (0, _utils.clamp)(refs.selector.current.left +
|
|
495
|
+
top: (0, _utils.clamp)(refs.selector.current.top + top_0, 0, rootRect_0.height - selectorRect.height),
|
|
496
|
+
left: (0, _utils.clamp)(refs.selector.current.left + left_0, 0, rootRect_0.width - selectorRect.width)
|
|
503
497
|
}));
|
|
504
498
|
} else if (((_refs$mouseDown$curre4 = refs.mouseDown.current) === null || _refs$mouseDown$curre4 === void 0 ? void 0 : _refs$mouseDown$curre4.version) === 'top_left') {
|
|
505
499
|
const incY = y - refs.previousMouseEvent.current.clientY;
|
|
506
500
|
const incX = x - refs.previousMouseEvent.current.clientX;
|
|
507
|
-
let
|
|
508
|
-
let
|
|
509
|
-
if (selectorRect.bottom -
|
|
510
|
-
let
|
|
511
|
-
let
|
|
501
|
+
let top_1 = (0, _utils.clamp)(selectorRect.top + incY, 0);
|
|
502
|
+
let left_1 = (0, _utils.clamp)(selectorRect.left + incX, 0);
|
|
503
|
+
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';
|
|
504
|
+
let width_0 = (0, _utils.clamp)(selectorRect.right - left_1, 0);
|
|
505
|
+
let height_0 = (0, _utils.clamp)(selectorRect.bottom - top_1, 0);
|
|
512
506
|
if (refs.aspectRatio.current !== undefined) {
|
|
513
507
|
var _refs$selector$curren11;
|
|
514
508
|
// Left
|
|
515
|
-
if (
|
|
509
|
+
if (left_1 < refs.selector.current.left && refs.selector.current.left < previousLeft && ((_refs$selector$curren11 = refs.selector.current) === null || _refs$selector$curren11 === void 0 ? void 0 : _refs$selector$curren11.top) === 0) return;
|
|
516
510
|
|
|
517
511
|
// Max surface
|
|
518
|
-
if (
|
|
519
|
-
|
|
512
|
+
if (width_0 + width_0 / refs.aspectRatio.current >= height_0 + height_0 * refs.aspectRatio.current) {
|
|
513
|
+
height_0 = width_0 / refs.aspectRatio.current;
|
|
520
514
|
} else {
|
|
521
|
-
|
|
515
|
+
width_0 = height_0 * refs.aspectRatio.current;
|
|
522
516
|
}
|
|
523
517
|
|
|
524
518
|
// Moved left
|
|
525
|
-
if (
|
|
526
|
-
|
|
519
|
+
if (left_1 < previousLeft) {
|
|
520
|
+
left_1 = (0, _utils.clamp)(previousLeft - width_0, 0, previousLeft);
|
|
527
521
|
|
|
528
522
|
// Update width, height upto the previousLeft
|
|
529
|
-
|
|
530
|
-
|
|
523
|
+
width_0 = (0, _utils.clamp)(width_0, 0, previousLeft);
|
|
524
|
+
height_0 = width_0 / refs.aspectRatio.current;
|
|
531
525
|
}
|
|
532
526
|
|
|
533
527
|
// Moved top
|
|
534
|
-
if (
|
|
535
|
-
|
|
528
|
+
if (top_1 < previousTop) {
|
|
529
|
+
top_1 = (0, _utils.clamp)(previousTop - height_0, 0, previousTop);
|
|
536
530
|
|
|
537
531
|
// Update width, height upto the previousTop
|
|
538
|
-
|
|
539
|
-
|
|
532
|
+
height_0 = (0, _utils.clamp)(height_0, 0, previousTop);
|
|
533
|
+
width_0 = height_0 * refs.aspectRatio.current;
|
|
540
534
|
}
|
|
541
535
|
|
|
542
536
|
// Max width
|
|
543
|
-
if (
|
|
544
|
-
|
|
545
|
-
|
|
537
|
+
if (left_1 + width_0 > rootRect_0.width) {
|
|
538
|
+
width_0 = rootRect_0.width - left_1;
|
|
539
|
+
height_0 = width_0 / refs.aspectRatio.current;
|
|
546
540
|
}
|
|
547
541
|
|
|
548
542
|
// Max height
|
|
549
|
-
if (
|
|
550
|
-
|
|
551
|
-
|
|
543
|
+
if (top_1 + height_0 > rootRect_0.height) {
|
|
544
|
+
height_0 = rootRect_0.height - top_1;
|
|
545
|
+
width_0 = height_0 * refs.aspectRatio.current;
|
|
552
546
|
}
|
|
553
547
|
|
|
554
548
|
// Min left
|
|
555
|
-
if (
|
|
549
|
+
if (left_1 < previousLeft) left_1 = previousLeft - width_0;
|
|
556
550
|
|
|
557
551
|
// Min top
|
|
558
|
-
if (
|
|
552
|
+
if (top_1 < previousTop) top_1 = previousTop - height_0;
|
|
559
553
|
}
|
|
560
554
|
onSelectorChange(_objectSpread(_objectSpread({}, refs.selector.current), {}, {
|
|
561
|
-
top,
|
|
562
|
-
left,
|
|
563
|
-
width,
|
|
564
|
-
height
|
|
555
|
+
top: top_1,
|
|
556
|
+
left: left_1,
|
|
557
|
+
width: width_0,
|
|
558
|
+
height: height_0
|
|
565
559
|
}));
|
|
566
560
|
} else if (((_refs$mouseDown$curre5 = refs.mouseDown.current) === null || _refs$mouseDown$curre5 === void 0 ? void 0 : _refs$mouseDown$curre5.version) === 'top_right') {
|
|
567
|
-
const
|
|
568
|
-
const
|
|
569
|
-
const
|
|
570
|
-
if (selectorRect.bottom -
|
|
571
|
-
let
|
|
572
|
-
let
|
|
561
|
+
const incY_0 = y - refs.previousMouseEvent.current.clientY;
|
|
562
|
+
const incX_0 = x - refs.previousMouseEvent.current.clientX;
|
|
563
|
+
const top_2 = (0, _utils.clamp)(selectorRect.top + incY_0, 0);
|
|
564
|
+
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';
|
|
565
|
+
let width_1 = (0, _utils.clamp)(Math.abs(selectorRect.width + incX_0), 0, rootRect_0.width - selectorRect.left);
|
|
566
|
+
let height_1 = (0, _utils.clamp)(selectorRect.bottom - top_2, 0);
|
|
573
567
|
|
|
574
568
|
// Top
|
|
575
569
|
if (refs.aspectRatio.current !== undefined) {
|
|
576
570
|
// Top
|
|
577
|
-
if (
|
|
578
|
-
|
|
579
|
-
|
|
571
|
+
if (top_2 < refs.selector.current.top && refs.selector.current.top < previousTop && refs.selector.current.left + refs.selector.current.width >= rootRect_0.width) return;
|
|
572
|
+
width_1 = height_1 * refs.aspectRatio.current;
|
|
573
|
+
height_1 = width_1 / refs.aspectRatio.current;
|
|
580
574
|
|
|
581
575
|
// Max width
|
|
582
|
-
if (refs.selector.current.left +
|
|
583
|
-
|
|
584
|
-
|
|
576
|
+
if (refs.selector.current.left + width_1 > rootRect_0.width) {
|
|
577
|
+
width_1 = rootRect_0.width - refs.selector.current.left;
|
|
578
|
+
height_1 = width_1 / refs.aspectRatio.current;
|
|
585
579
|
}
|
|
586
580
|
|
|
587
581
|
// Max height
|
|
588
|
-
if (refs.selector.current.top +
|
|
589
|
-
|
|
590
|
-
|
|
582
|
+
if (refs.selector.current.top + height_1 > rootRect_0.height) {
|
|
583
|
+
height_1 = rootRect_0.height - refs.selector.current.top;
|
|
584
|
+
width_1 = height_1 * refs.aspectRatio.current;
|
|
591
585
|
}
|
|
592
586
|
}
|
|
593
587
|
onSelectorChange(_objectSpread(_objectSpread({}, refs.selector.current), {}, {
|
|
594
|
-
top,
|
|
595
|
-
width,
|
|
596
|
-
height
|
|
588
|
+
top: top_2,
|
|
589
|
+
width: width_1,
|
|
590
|
+
height: height_1
|
|
597
591
|
}));
|
|
598
592
|
} else if (((_refs$mouseDown$curre6 = refs.mouseDown.current) === null || _refs$mouseDown$curre6 === void 0 ? void 0 : _refs$mouseDown$curre6.version) === 'bottom_right') {
|
|
599
|
-
const
|
|
600
|
-
const
|
|
601
|
-
if (selectorRect.height +
|
|
602
|
-
let
|
|
603
|
-
let
|
|
593
|
+
const incY_1 = y - refs.previousMouseEvent.current.clientY;
|
|
594
|
+
const incX_1 = x - refs.previousMouseEvent.current.clientX;
|
|
595
|
+
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';
|
|
596
|
+
let width_2 = (0, _utils.clamp)(Math.abs(selectorRect.width + incX_1), 0, rootRect_0.width - selectorRect.left);
|
|
597
|
+
let height_2 = (0, _utils.clamp)(Math.abs(selectorRect.height + incY_1), 0, rootRect_0.height - selectorRect.top);
|
|
604
598
|
|
|
605
599
|
// Right
|
|
606
600
|
if (refs.aspectRatio.current !== undefined) {
|
|
607
|
-
|
|
601
|
+
height_2 = width_2 / refs.aspectRatio.current;
|
|
608
602
|
|
|
609
603
|
// Max width
|
|
610
|
-
if (refs.selector.current.left +
|
|
611
|
-
|
|
612
|
-
|
|
604
|
+
if (refs.selector.current.left + width_2 > rootRect_0.width) {
|
|
605
|
+
width_2 = rootRect_0.width - refs.selector.current.left;
|
|
606
|
+
height_2 = width_2 / refs.aspectRatio.current;
|
|
613
607
|
}
|
|
614
608
|
|
|
615
609
|
// Max height
|
|
616
|
-
if (refs.selector.current.top +
|
|
617
|
-
|
|
618
|
-
|
|
610
|
+
if (refs.selector.current.top + height_2 > rootRect_0.height) {
|
|
611
|
+
height_2 = rootRect_0.height - refs.selector.current.top;
|
|
612
|
+
width_2 = height_2 * refs.aspectRatio.current;
|
|
619
613
|
}
|
|
620
|
-
|
|
614
|
+
width_2 = height_2 * refs.aspectRatio.current;
|
|
621
615
|
|
|
622
616
|
// Max width
|
|
623
|
-
if (refs.selector.current.left +
|
|
624
|
-
|
|
625
|
-
|
|
617
|
+
if (refs.selector.current.left + width_2 > rootRect_0.width) {
|
|
618
|
+
width_2 = rootRect_0.width - refs.selector.current.left;
|
|
619
|
+
height_2 = width_2 / refs.aspectRatio.current;
|
|
626
620
|
}
|
|
627
621
|
|
|
628
622
|
// Max height
|
|
629
|
-
if (refs.selector.current.top +
|
|
630
|
-
|
|
631
|
-
|
|
623
|
+
if (refs.selector.current.top + height_2 > rootRect_0.height) {
|
|
624
|
+
height_2 = rootRect_0.height - refs.selector.current.top;
|
|
625
|
+
width_2 = height_2 * refs.aspectRatio.current;
|
|
632
626
|
}
|
|
633
627
|
}
|
|
634
628
|
onSelectorChange(_objectSpread(_objectSpread({}, refs.selector.current), {}, {
|
|
635
|
-
width,
|
|
636
|
-
height
|
|
629
|
+
width: width_2,
|
|
630
|
+
height: height_2
|
|
637
631
|
}));
|
|
638
632
|
} else if (((_refs$mouseDown$curre7 = refs.mouseDown.current) === null || _refs$mouseDown$curre7 === void 0 ? void 0 : _refs$mouseDown$curre7.version) === 'bottom_left') {
|
|
639
|
-
const
|
|
640
|
-
const
|
|
641
|
-
const
|
|
642
|
-
if (selectorRect.height +
|
|
643
|
-
let
|
|
644
|
-
let
|
|
633
|
+
const incY_2 = y - refs.previousMouseEvent.current.clientY;
|
|
634
|
+
const incX_2 = x - refs.previousMouseEvent.current.clientX;
|
|
635
|
+
const left_2 = (0, _utils.clamp)(selectorRect.left + incX_2, 0);
|
|
636
|
+
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';
|
|
637
|
+
let width_3 = (0, _utils.clamp)(selectorRect.right - left_2, 0);
|
|
638
|
+
let height_3 = (0, _utils.clamp)(Math.abs(selectorRect.height + incY_2), 0, rootRect_0.height - selectorRect.top);
|
|
645
639
|
|
|
646
640
|
// Left
|
|
647
641
|
if (refs.aspectRatio.current !== undefined) {
|
|
648
642
|
var _refs$selector$curren12, _refs$selector$curren13;
|
|
649
643
|
// Left
|
|
650
|
-
if (
|
|
651
|
-
|
|
644
|
+
if (left_2 < refs.selector.current.left && ((_refs$selector$curren12 = refs.selector.current) === null || _refs$selector$curren12 === void 0 ? void 0 : _refs$selector$curren12.top) + ((_refs$selector$curren13 = refs.selector.current) === null || _refs$selector$curren13 === void 0 ? void 0 : _refs$selector$curren13.height) >= rootRect_0.height) return;
|
|
645
|
+
height_3 = width_3 / refs.aspectRatio.current;
|
|
652
646
|
|
|
653
647
|
// Max width
|
|
654
|
-
if (refs.selector.current.left +
|
|
655
|
-
|
|
656
|
-
|
|
648
|
+
if (refs.selector.current.left + width_3 > rootRect_0.width) {
|
|
649
|
+
width_3 = rootRect_0.width - refs.selector.current.left;
|
|
650
|
+
height_3 = width_3 / refs.aspectRatio.current;
|
|
657
651
|
}
|
|
658
652
|
|
|
659
653
|
// Max height
|
|
660
|
-
if (refs.selector.current.top +
|
|
661
|
-
|
|
662
|
-
|
|
654
|
+
if (refs.selector.current.top + height_3 > rootRect_0.height) {
|
|
655
|
+
height_3 = rootRect_0.height - refs.selector.current.top;
|
|
656
|
+
width_3 = height_3 * refs.aspectRatio.current;
|
|
663
657
|
}
|
|
664
|
-
|
|
658
|
+
width_3 = height_3 * refs.aspectRatio.current;
|
|
665
659
|
|
|
666
660
|
// Max width
|
|
667
|
-
if (refs.selector.current.left +
|
|
668
|
-
|
|
669
|
-
|
|
661
|
+
if (refs.selector.current.left + width_3 > rootRect_0.width) {
|
|
662
|
+
width_3 = rootRect_0.width - refs.selector.current.left;
|
|
663
|
+
height_3 = width_3 / refs.aspectRatio.current;
|
|
670
664
|
}
|
|
671
665
|
|
|
672
666
|
// Max height
|
|
673
|
-
if (refs.selector.current.top +
|
|
674
|
-
|
|
675
|
-
|
|
667
|
+
if (refs.selector.current.top + height_3 > rootRect_0.height) {
|
|
668
|
+
height_3 = rootRect_0.height - refs.selector.current.top;
|
|
669
|
+
width_3 = height_3 * refs.aspectRatio.current;
|
|
676
670
|
}
|
|
677
671
|
}
|
|
678
672
|
onSelectorChange(_objectSpread(_objectSpread({}, refs.selector.current), {}, {
|
|
679
|
-
left,
|
|
680
|
-
width,
|
|
681
|
-
height
|
|
673
|
+
left: left_2,
|
|
674
|
+
width: width_3,
|
|
675
|
+
height: height_3
|
|
682
676
|
}));
|
|
683
677
|
} else if (((_refs$mouseDown$curre8 = refs.mouseDown.current) === null || _refs$mouseDown$curre8 === void 0 ? void 0 : _refs$mouseDown$curre8.version) === 'top') {
|
|
684
678
|
const inc = y - refs.previousMouseEvent.current.clientY;
|
|
685
|
-
const
|
|
686
|
-
if (refs.selector.current.top <= 0 &&
|
|
687
|
-
if (selectorRect.bottom -
|
|
688
|
-
let
|
|
689
|
-
let
|
|
679
|
+
const top_3 = (0, _utils.clamp)(refs.selector.current.top + inc, 0);
|
|
680
|
+
if (refs.selector.current.top <= 0 && top_3 <= 0) return;
|
|
681
|
+
if (selectorRect.bottom - top_3 < 0) refs.mouseDown.current.version = 'bottom';
|
|
682
|
+
let width_4 = refs.selector.current.width;
|
|
683
|
+
let height_4 = (0, _utils.clamp)(Math.abs(refs.selector.current.height - inc), 0, previousTop - top_3);
|
|
690
684
|
if (refs.aspectRatio.current !== undefined) {
|
|
691
685
|
// Top
|
|
692
|
-
if (
|
|
693
|
-
|
|
686
|
+
if (top_3 < refs.selector.current.top && refs.selector.current.top < previousTop && refs.selector.current.left + refs.selector.current.width >= rootRect_0.width) return;
|
|
687
|
+
width_4 = height_4 * refs.aspectRatio.current;
|
|
694
688
|
|
|
695
689
|
// Max width
|
|
696
|
-
if (refs.selector.current.left +
|
|
697
|
-
|
|
698
|
-
|
|
690
|
+
if (refs.selector.current.left + width_4 > rootRect_0.width) {
|
|
691
|
+
width_4 = rootRect_0.width - refs.selector.current.left;
|
|
692
|
+
height_4 = width_4 / refs.aspectRatio.current;
|
|
699
693
|
}
|
|
700
694
|
|
|
701
695
|
// Max height
|
|
702
|
-
if (
|
|
703
|
-
|
|
704
|
-
|
|
696
|
+
if (top_3 + height_4 > rootRect_0.height) {
|
|
697
|
+
height_4 = rootRect_0.height - top_3;
|
|
698
|
+
width_4 = height_4 * refs.aspectRatio.current;
|
|
705
699
|
}
|
|
706
700
|
}
|
|
707
701
|
onSelectorChange(_objectSpread(_objectSpread({}, refs.selector.current), {}, {
|
|
708
|
-
top,
|
|
709
|
-
width,
|
|
710
|
-
height
|
|
702
|
+
top: top_3,
|
|
703
|
+
width: width_4,
|
|
704
|
+
height: height_4
|
|
711
705
|
}));
|
|
712
706
|
} else if (((_refs$mouseDown$curre9 = refs.mouseDown.current) === null || _refs$mouseDown$curre9 === void 0 ? void 0 : _refs$mouseDown$curre9.version) === 'bottom') {
|
|
713
|
-
const
|
|
714
|
-
if (selectorRect.height +
|
|
715
|
-
let
|
|
716
|
-
let
|
|
707
|
+
const inc_0 = y - refs.previousMouseEvent.current.clientY;
|
|
708
|
+
if (selectorRect.height + inc_0 < 0) refs.mouseDown.current.version = 'top';
|
|
709
|
+
let width_5 = refs.selector.current.width;
|
|
710
|
+
let height_5 = (0, _utils.clamp)(Math.abs(selectorRect.height + inc_0), 0, rootRect_0.height - refs.selector.current.top);
|
|
717
711
|
if (refs.aspectRatio.current !== undefined) {
|
|
718
|
-
|
|
712
|
+
width_5 = height_5 * refs.aspectRatio.current;
|
|
719
713
|
|
|
720
714
|
// Max height
|
|
721
|
-
if (refs.selector.current.top +
|
|
722
|
-
|
|
723
|
-
|
|
715
|
+
if (refs.selector.current.top + height_5 > rootRect_0.height) {
|
|
716
|
+
height_5 = rootRect_0.height - refs.selector.current.top;
|
|
717
|
+
width_5 = height_5 * refs.aspectRatio.current;
|
|
724
718
|
}
|
|
725
719
|
|
|
726
720
|
// Max width
|
|
727
|
-
if (refs.selector.current.left +
|
|
728
|
-
|
|
729
|
-
|
|
721
|
+
if (refs.selector.current.left + width_5 > rootRect_0.width) {
|
|
722
|
+
width_5 = rootRect_0.width - refs.selector.current.left;
|
|
723
|
+
height_5 = width_5 / refs.aspectRatio.current;
|
|
730
724
|
}
|
|
731
725
|
}
|
|
732
726
|
onSelectorChange(_objectSpread(_objectSpread({}, refs.selector.current), {}, {
|
|
733
|
-
width,
|
|
734
|
-
height
|
|
727
|
+
width: width_5,
|
|
728
|
+
height: height_5
|
|
735
729
|
}));
|
|
736
730
|
} else if (((_refs$mouseDown$curre0 = refs.mouseDown.current) === null || _refs$mouseDown$curre0 === void 0 ? void 0 : _refs$mouseDown$curre0.version) === 'left') {
|
|
737
|
-
const
|
|
738
|
-
const
|
|
739
|
-
if (selectorRect.right -
|
|
740
|
-
let
|
|
741
|
-
let
|
|
731
|
+
const inc_1 = x - refs.previousMouseEvent.current.clientX;
|
|
732
|
+
const left_3 = (0, _utils.clamp)(selectorRect.left + inc_1, 0);
|
|
733
|
+
if (selectorRect.right - left_3 < 0) refs.mouseDown.current.version = 'right';
|
|
734
|
+
let width_6 = (0, _utils.clamp)(selectorRect.right - left_3, 0);
|
|
735
|
+
let height_6 = refs.selector.current.height;
|
|
742
736
|
if (refs.aspectRatio.current !== undefined) {
|
|
743
737
|
var _refs$selector$curren14, _refs$selector$curren15;
|
|
744
|
-
if (
|
|
745
|
-
|
|
738
|
+
if (left_3 < refs.selector.current.left && ((_refs$selector$curren14 = refs.selector.current) === null || _refs$selector$curren14 === void 0 ? void 0 : _refs$selector$curren14.top) + ((_refs$selector$curren15 = refs.selector.current) === null || _refs$selector$curren15 === void 0 ? void 0 : _refs$selector$curren15.height) >= rootRect_0.height) return;
|
|
739
|
+
height_6 = width_6 / refs.aspectRatio.current;
|
|
746
740
|
|
|
747
741
|
// Max width
|
|
748
|
-
if (refs.selector.current.left +
|
|
749
|
-
|
|
750
|
-
|
|
742
|
+
if (refs.selector.current.left + width_6 > rootRect_0.width) {
|
|
743
|
+
width_6 = rootRect_0.width - refs.selector.current.left;
|
|
744
|
+
height_6 = width_6 / refs.aspectRatio.current;
|
|
751
745
|
}
|
|
752
746
|
|
|
753
747
|
// Max height
|
|
754
|
-
if (refs.selector.current.top +
|
|
755
|
-
|
|
756
|
-
|
|
748
|
+
if (refs.selector.current.top + height_6 > rootRect_0.height) {
|
|
749
|
+
height_6 = rootRect_0.height - refs.selector.current.top;
|
|
750
|
+
width_6 = height_6 * refs.aspectRatio.current;
|
|
757
751
|
}
|
|
758
752
|
}
|
|
759
753
|
onSelectorChange(_objectSpread(_objectSpread({}, refs.selector.current), {}, {
|
|
760
|
-
left,
|
|
761
|
-
width,
|
|
762
|
-
height
|
|
754
|
+
left: left_3,
|
|
755
|
+
width: width_6,
|
|
756
|
+
height: height_6
|
|
763
757
|
}));
|
|
764
758
|
} else if (((_refs$mouseDown$curre1 = refs.mouseDown.current) === null || _refs$mouseDown$curre1 === void 0 ? void 0 : _refs$mouseDown$curre1.version) === 'right') {
|
|
765
|
-
const
|
|
766
|
-
if (selectorRect.width +
|
|
767
|
-
let
|
|
768
|
-
let
|
|
759
|
+
const inc_2 = x - refs.previousMouseEvent.current.clientX;
|
|
760
|
+
if (selectorRect.width + inc_2 < 0) refs.mouseDown.current.version = 'left';
|
|
761
|
+
let width_7 = (0, _utils.clamp)(Math.abs(selectorRect.width + inc_2), 0, rootRect_0.width - selectorRect.left);
|
|
762
|
+
let height_7 = refs.selector.current.height;
|
|
769
763
|
if (refs.aspectRatio.current !== undefined) {
|
|
770
|
-
|
|
764
|
+
height_7 = width_7 / refs.aspectRatio.current;
|
|
771
765
|
|
|
772
766
|
// Max width
|
|
773
|
-
if (refs.selector.current.left +
|
|
774
|
-
|
|
775
|
-
|
|
767
|
+
if (refs.selector.current.left + width_7 > rootRect_0.width) {
|
|
768
|
+
width_7 = rootRect_0.width - refs.selector.current.left;
|
|
769
|
+
height_7 = width_7 / refs.aspectRatio.current;
|
|
776
770
|
}
|
|
777
771
|
|
|
778
772
|
// Max height
|
|
779
|
-
if (refs.selector.current.top +
|
|
780
|
-
|
|
781
|
-
|
|
773
|
+
if (refs.selector.current.top + height_7 > rootRect_0.height) {
|
|
774
|
+
height_7 = rootRect_0.height - refs.selector.current.top;
|
|
775
|
+
width_7 = height_7 * refs.aspectRatio.current;
|
|
782
776
|
}
|
|
783
777
|
}
|
|
784
778
|
onSelectorChange(_objectSpread(_objectSpread({}, refs.selector.current), {}, {
|
|
785
|
-
width,
|
|
786
|
-
height
|
|
779
|
+
width: width_7,
|
|
780
|
+
height: height_7
|
|
787
781
|
}));
|
|
788
782
|
}
|
|
789
783
|
}
|
|
790
784
|
};
|
|
791
785
|
|
|
792
786
|
// Mouse move
|
|
793
|
-
const onMouseMove =
|
|
787
|
+
const onMouseMove = event_1 => {
|
|
794
788
|
if (refs.mouseDown.current) {
|
|
795
789
|
const {
|
|
796
790
|
clientY,
|
|
797
791
|
clientX
|
|
798
|
-
} =
|
|
792
|
+
} = event_1;
|
|
799
793
|
onMove(clientX, clientY);
|
|
800
|
-
refs.previousMouseEvent.current =
|
|
794
|
+
refs.previousMouseEvent.current = event_1;
|
|
801
795
|
}
|
|
802
796
|
};
|
|
803
797
|
|
|
804
798
|
// Touch move
|
|
805
|
-
const onTouchMove =
|
|
799
|
+
const onTouchMove = event_2 => {
|
|
806
800
|
if (refs.mouseDown.current) {
|
|
807
801
|
const {
|
|
808
|
-
clientY,
|
|
809
|
-
clientX
|
|
810
|
-
} =
|
|
811
|
-
onMove(
|
|
812
|
-
refs.previousMouseEvent.current =
|
|
802
|
+
clientY: clientY_0,
|
|
803
|
+
clientX: clientX_0
|
|
804
|
+
} = event_2.touches[0];
|
|
805
|
+
onMove(clientX_0, clientY_0);
|
|
806
|
+
refs.previousMouseEvent.current = event_2;
|
|
813
807
|
|
|
814
808
|
// Normalize for use as a mouseDown value
|
|
815
|
-
refs.previousMouseEvent.current.clientY =
|
|
816
|
-
refs.previousMouseEvent.current.clientX =
|
|
809
|
+
refs.previousMouseEvent.current.clientY = clientY_0;
|
|
810
|
+
refs.previousMouseEvent.current.clientX = clientX_0;
|
|
817
811
|
}
|
|
818
812
|
};
|
|
819
813
|
const rootDocument = (0, _utils.isEnvironment)('browser') ? ((_refs$root$current2 = refs.root.current) === null || _refs$root$current2 === void 0 ? void 0 : _refs$root$current2.ownerDocument) || window.document : undefined;
|
|
@@ -845,13 +839,13 @@ const ImageCrop = /*#__PURE__*/_react.default.forwardRef((props_, ref) => {
|
|
|
845
839
|
const updateSelector = (selector__ = refs.selector.current, image__ = refs.image.current) => {
|
|
846
840
|
if (selector__ !== undefined && image__ !== undefined) {
|
|
847
841
|
var _refs$canvasMain$curr5, _refs$canvasMain$curr6, _refs$canvasMain$curr7, _refs$canvasMain$curr8;
|
|
848
|
-
const
|
|
842
|
+
const rootRect_1 = refs.root.current.getBoundingClientRect();
|
|
849
843
|
const selectorValue = {
|
|
850
844
|
top: (0, _utils.clamp)(selector__.top, 0, image__.height),
|
|
851
845
|
left: (0, _utils.clamp)(selector__.left, 0, image__.height)
|
|
852
846
|
};
|
|
853
|
-
selectorValue.width = (0, _utils.clamp)(selector__.width || 0, 0,
|
|
854
|
-
selectorValue.height = (0, _utils.clamp)(selector__.height || 0, 0,
|
|
847
|
+
selectorValue.width = (0, _utils.clamp)(selector__.width || 0, 0, rootRect_1.width - selectorValue.left);
|
|
848
|
+
selectorValue.height = (0, _utils.clamp)(selector__.height || 0, 0, rootRect_1.height - selectorValue.top);
|
|
855
849
|
|
|
856
850
|
// Aspect ratio
|
|
857
851
|
if (refs.aspectRatio.current !== undefined) {
|
|
@@ -863,14 +857,14 @@ const ImageCrop = /*#__PURE__*/_react.default.forwardRef((props_, ref) => {
|
|
|
863
857
|
}
|
|
864
858
|
|
|
865
859
|
// Max width
|
|
866
|
-
if (selectorValue.left + selectorValue.width >
|
|
867
|
-
selectorValue.width =
|
|
860
|
+
if (selectorValue.left + selectorValue.width > rootRect_1.width) {
|
|
861
|
+
selectorValue.width = rootRect_1.width - selectorValue.left;
|
|
868
862
|
selectorValue.height = selectorValue.width / refs.aspectRatio.current;
|
|
869
863
|
}
|
|
870
864
|
|
|
871
865
|
// Max height
|
|
872
|
-
if (selectorValue.top + selectorValue.height >
|
|
873
|
-
selectorValue.height =
|
|
866
|
+
if (selectorValue.top + selectorValue.height > rootRect_1.height) {
|
|
867
|
+
selectorValue.height = rootRect_1.height - selectorValue.top;
|
|
874
868
|
selectorValue.width = selectorValue.height * refs.aspectRatio.current;
|
|
875
869
|
}
|
|
876
870
|
}
|
|
@@ -880,10 +874,10 @@ const ImageCrop = /*#__PURE__*/_react.default.forwardRef((props_, ref) => {
|
|
|
880
874
|
|
|
881
875
|
// Update selector relative
|
|
882
876
|
setSelectorRelative({
|
|
883
|
-
top: selectorValue.top / (
|
|
884
|
-
left: selectorValue.left / (
|
|
885
|
-
width: selectorValue.width / (
|
|
886
|
-
height: selectorValue.height / (
|
|
877
|
+
top: selectorValue.top / (rootRect_1 === null || rootRect_1 === void 0 ? void 0 : rootRect_1.height) * ((_refs$canvasMain$curr5 = refs.canvasMain.current) === null || _refs$canvasMain$curr5 === void 0 ? void 0 : _refs$canvasMain$curr5.height),
|
|
878
|
+
left: selectorValue.left / (rootRect_1 === null || rootRect_1 === void 0 ? void 0 : rootRect_1.width) * ((_refs$canvasMain$curr6 = refs.canvasMain.current) === null || _refs$canvasMain$curr6 === void 0 ? void 0 : _refs$canvasMain$curr6.width),
|
|
879
|
+
width: selectorValue.width / (rootRect_1 === null || rootRect_1 === void 0 ? void 0 : rootRect_1.width) * ((_refs$canvasMain$curr7 = refs.canvasMain.current) === null || _refs$canvasMain$curr7 === void 0 ? void 0 : _refs$canvasMain$curr7.width),
|
|
880
|
+
height: selectorValue.height / (rootRect_1 === null || rootRect_1 === void 0 ? void 0 : rootRect_1.height) * ((_refs$canvasMain$curr8 = refs.canvasMain.current) === null || _refs$canvasMain$curr8 === void 0 ? void 0 : _refs$canvasMain$curr8.height)
|
|
887
881
|
});
|
|
888
882
|
}
|
|
889
883
|
};
|
|
@@ -909,13 +903,13 @@ const ImageCrop = /*#__PURE__*/_react.default.forwardRef((props_, ref) => {
|
|
|
909
903
|
const makeImage = async (value = image) => {
|
|
910
904
|
var _refs$root$current3;
|
|
911
905
|
const img = await (0, _utils2.image)(value);
|
|
912
|
-
const
|
|
913
|
-
const canvas =
|
|
914
|
-
const
|
|
906
|
+
const rootDocument_0 = (0, _utils.isEnvironment)('browser') ? ((_refs$root$current3 = refs.root.current) === null || _refs$root$current3 === void 0 ? void 0 : _refs$root$current3.ownerDocument) || window.document : undefined;
|
|
907
|
+
const canvas = rootDocument_0.createElement('canvas');
|
|
908
|
+
const rootRect_2 = refs.root.current.getBoundingClientRect();
|
|
915
909
|
const aspectRatioImg = img.width / img.height;
|
|
916
910
|
|
|
917
911
|
// width being parent width
|
|
918
|
-
img.width =
|
|
912
|
+
img.width = rootRect_2.width;
|
|
919
913
|
|
|
920
914
|
// height keep aspect ratio of the img for the height
|
|
921
915
|
img.height = img.width / aspectRatioImg;
|
|
@@ -924,67 +918,67 @@ const ImageCrop = /*#__PURE__*/_react.default.forwardRef((props_, ref) => {
|
|
|
924
918
|
canvas.getContext('2d').drawImage(img, 0, 0, img.width, img.height);
|
|
925
919
|
setImage(canvas);
|
|
926
920
|
};
|
|
927
|
-
const onFocus =
|
|
921
|
+
const onFocus = event_3 => {
|
|
928
922
|
setFocus(true);
|
|
929
|
-
if ((0, _utils.is)('function', onFocus_)) onFocus_(
|
|
930
|
-
}
|
|
931
|
-
const onBlur =
|
|
923
|
+
if ((0, _utils.is)('function', onFocus_)) onFocus_(event_3);
|
|
924
|
+
};
|
|
925
|
+
const onBlur = event_4 => {
|
|
932
926
|
setFocus(false);
|
|
933
|
-
if ((0, _utils.is)('function', onBlur_)) onBlur_(
|
|
934
|
-
}
|
|
935
|
-
const onTouchStart =
|
|
936
|
-
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(
|
|
927
|
+
if ((0, _utils.is)('function', onBlur_)) onBlur_(event_4);
|
|
928
|
+
};
|
|
929
|
+
const onTouchStart = event_5 => {
|
|
930
|
+
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)) {
|
|
937
931
|
const {
|
|
938
|
-
clientY,
|
|
939
|
-
clientX
|
|
940
|
-
} =
|
|
941
|
-
const
|
|
932
|
+
clientY: clientY_1,
|
|
933
|
+
clientX: clientX_1
|
|
934
|
+
} = event_5.touches[0];
|
|
935
|
+
const rootRect_3 = refs.root.current.getBoundingClientRect();
|
|
942
936
|
setMouseDown({
|
|
943
937
|
version: 'make',
|
|
944
|
-
top:
|
|
945
|
-
left:
|
|
938
|
+
top: clientY_1 - rootRect_3.top,
|
|
939
|
+
left: clientX_1 - rootRect_3.left
|
|
946
940
|
});
|
|
947
941
|
}
|
|
948
|
-
}
|
|
949
|
-
const onMouseDown =
|
|
950
|
-
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(
|
|
942
|
+
};
|
|
943
|
+
const onMouseDown = event_6 => {
|
|
944
|
+
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)) {
|
|
951
945
|
const {
|
|
952
|
-
clientY,
|
|
953
|
-
clientX
|
|
954
|
-
} =
|
|
955
|
-
const
|
|
946
|
+
clientY: clientY_2,
|
|
947
|
+
clientX: clientX_2
|
|
948
|
+
} = event_6;
|
|
949
|
+
const rootRect_4 = refs.root.current.getBoundingClientRect();
|
|
956
950
|
setMouseDown({
|
|
957
951
|
version: 'make',
|
|
958
|
-
top:
|
|
959
|
-
left:
|
|
952
|
+
top: clientY_2 - rootRect_4.top,
|
|
953
|
+
left: clientX_2 - rootRect_4.left
|
|
960
954
|
});
|
|
961
955
|
}
|
|
962
|
-
}
|
|
963
|
-
const onTouchStartSelector =
|
|
956
|
+
};
|
|
957
|
+
const onTouchStartSelector = event_7 => {
|
|
964
958
|
const {
|
|
965
|
-
clientY,
|
|
966
|
-
clientX
|
|
967
|
-
} =
|
|
968
|
-
const
|
|
959
|
+
clientY: clientY_3,
|
|
960
|
+
clientX: clientX_3
|
|
961
|
+
} = event_7.touches[0];
|
|
962
|
+
const rootRect_5 = refs.root.current.getBoundingClientRect();
|
|
969
963
|
setMouseDown({
|
|
970
964
|
version: 'move',
|
|
971
|
-
top:
|
|
972
|
-
left:
|
|
965
|
+
top: clientY_3 - rootRect_5.top,
|
|
966
|
+
left: clientX_3 - rootRect_5.left
|
|
973
967
|
});
|
|
974
|
-
}
|
|
975
|
-
const onMouseDownSelector =
|
|
968
|
+
};
|
|
969
|
+
const onMouseDownSelector = event_8 => {
|
|
976
970
|
const {
|
|
977
|
-
clientY,
|
|
978
|
-
clientX
|
|
979
|
-
} =
|
|
980
|
-
const
|
|
971
|
+
clientY: clientY_4,
|
|
972
|
+
clientX: clientX_4
|
|
973
|
+
} = event_8;
|
|
974
|
+
const rootRect_6 = refs.root.current.getBoundingClientRect();
|
|
981
975
|
setMouseDown({
|
|
982
976
|
version: 'move',
|
|
983
|
-
top:
|
|
984
|
-
left:
|
|
977
|
+
top: clientY_4 - rootRect_6.top,
|
|
978
|
+
left: clientX_4 - rootRect_6.left
|
|
985
979
|
});
|
|
986
|
-
}
|
|
987
|
-
const onTouchStartBorder = version =>
|
|
980
|
+
};
|
|
981
|
+
const onTouchStartBorder = version => event_9 => {
|
|
988
982
|
var _refs$selector$curren16, _refs$selector$curren17, _refs$selector$curren18, _refs$selector$curren19;
|
|
989
983
|
setMouseDown({
|
|
990
984
|
version,
|
|
@@ -992,10 +986,10 @@ const ImageCrop = /*#__PURE__*/_react.default.forwardRef((props_, ref) => {
|
|
|
992
986
|
left: ((_refs$selector$curren18 = refs.selector.current) === null || _refs$selector$curren18 === void 0 ? void 0 : _refs$selector$curren18.left) + ((_refs$selector$curren19 = refs.selector.current) === null || _refs$selector$curren19 === void 0 ? void 0 : _refs$selector$curren19.width)
|
|
993
987
|
});
|
|
994
988
|
};
|
|
995
|
-
const onMouseDownBorder =
|
|
989
|
+
const onMouseDownBorder = version_0 => event_10 => {
|
|
996
990
|
var _refs$selector$curren20, _refs$selector$curren21, _refs$selector$curren22, _refs$selector$curren23;
|
|
997
991
|
setMouseDown({
|
|
998
|
-
version,
|
|
992
|
+
version: version_0,
|
|
999
993
|
top: ((_refs$selector$curren20 = refs.selector.current) === null || _refs$selector$curren20 === void 0 ? void 0 : _refs$selector$curren20.top) + ((_refs$selector$curren21 = refs.selector.current) === null || _refs$selector$curren21 === void 0 ? void 0 : _refs$selector$curren21.height),
|
|
1000
994
|
left: ((_refs$selector$curren22 = refs.selector.current) === null || _refs$selector$curren22 === void 0 ? void 0 : _refs$selector$curren22.left) + ((_refs$selector$curren23 = refs.selector.current) === null || _refs$selector$curren23 === void 0 ? void 0 : _refs$selector$curren23.width)
|
|
1001
995
|
});
|