@onesy/ui-react 1.0.172 → 1.0.174
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.js +93 -74
- package/AdvancedTextField/AdvancedTextField.js +7 -6
- package/Append/Append.js +24 -19
- package/AreaChart/AreaChart.js +15 -17
- package/AreaChartItem/AreaChartItem.js +63 -58
- package/AudioPlayer/AudioPlayer.js +180 -148
- package/AudioRecorder/AudioRecorder.js +104 -59
- package/AutoComplete/AutoComplete.js +135 -125
- package/AutoCompleteCountry/AutoCompleteCountry.js +10 -11
- package/AutoCompleteCurrency/AutoCompleteCurrency.js +4 -5
- package/Avatar/Avatar.js +11 -8
- package/AvatarGroup/AvatarGroup.js +21 -20
- package/Backdrop/Backdrop.js +30 -21
- package/Badge/Badge.js +18 -17
- package/Banner/Banner.js +15 -12
- package/BottomAppBar/BottomAppBar.js +14 -14
- package/BottomSheet/BottomSheet.js +9 -11
- package/Box/Box.js +12 -12
- package/Breadcrumbs/Breadcrumbs.js +38 -34
- package/BubbleChart/BubbleChart.js +159 -134
- package/BubbleChartItem/BubbleChartItem.js +48 -43
- package/Button/Button.js +46 -39
- package/Buttons/Buttons.d.ts +1 -1
- package/Buttons/Buttons.js +34 -28
- package/Calendar/Calendar.js +357 -315
- package/CalendarAvailability/CalendarAvailability.js +351 -298
- package/CalendarMenu/CalendarMenu.js +93 -79
- package/CalendarMonth/CalendarMonth.js +113 -102
- package/CalendarViews/CalendarViews.js +138 -115
- package/CalendarWeek/CalendarWeek.js +180 -158
- package/Card/Card.js +16 -15
- package/CardButton/CardButton.js +11 -10
- package/CardFooter/CardFooter.js +12 -12
- package/CardHeader/CardHeader.js +13 -13
- package/CardImage/CardImage.js +10 -12
- package/CardMain/CardMain.js +12 -12
- package/Carousel/Carousel.js +140 -124
- package/Chart/Chart.js +438 -393
- package/Checkbox/Checkbox.js +46 -43
- package/Chip/Chip.js +12 -11
- package/Chips/Chips.js +20 -20
- package/ClickListener/ClickListener.js +19 -15
- package/Clock/Clock.js +38 -36
- package/ColorTextField/ColorTextField.js +33 -27
- package/ColumnChart/ColumnChart.js +16 -17
- package/ColumnChartItem/ColumnChartItem.js +35 -31
- package/Confirm/Confirm.js +51 -35
- package/Container/Container.js +9 -6
- package/CookieBanner/CookieBanner.js +55 -41
- package/Countdown/Countdown.js +163 -123
- package/DatePicker/DatePicker.js +236 -197
- package/DateRangePicker/DateRangePicker.js +9 -11
- package/DateTimePicker/DateTimePicker.js +127 -103
- package/DateTimeRangePicker/DateTimeRangePicker.js +9 -11
- package/Divider/Divider.js +25 -21
- package/DonutChart/DonutChart.js +9 -11
- package/DragAndDropList/DragAndDropList.js +8 -4
- package/Drawing/Drawing.js +369 -312
- package/DropZone/DropZone.js +20 -15
- package/Emojis/Emojis.js +95 -85
- package/Expand/Expand.js +78 -70
- package/Fab/Fab.js +4 -6
- package/Fade/Fade.js +64 -58
- package/FileChoose/FileChoose.js +69 -60
- package/Focus/Focus.js +19 -16
- package/Form/Form.js +69 -57
- package/FormRow/FormRow.js +49 -38
- package/Forms/Forms.js +13 -13
- package/Frame/Frame.js +62 -54
- package/Grid/Grid.js +15 -12
- package/Grow/Grow.js +60 -52
- package/HTMLCanvas/HTMLCanvas.js +88 -74
- package/IFrame/IFrame.js +33 -27
- package/Icon/Icon.js +14 -14
- package/IconButton/IconButton.js +12 -14
- package/Image/Image.js +19 -15
- package/ImageCrop/ImageCrop.js +96 -87
- package/ImageEdit/ImageEdit.js +355 -290
- package/ImageGallery/ImageGallery.js +104 -86
- package/ImageList/ImageList.js +16 -11
- package/ImageListItem/ImageListItem.js +9 -6
- package/ImageListItemBox/ImageListItemBox.js +12 -12
- package/Info/Info.js +38 -27
- package/Interaction/Interaction.js +57 -68
- package/Keyframes/Keyframes.js +11 -9
- package/Label/Label.js +59 -50
- package/Labels/Labels.js +30 -26
- package/Line/Line.js +10 -7
- package/LineChart/LineChart.js +16 -17
- package/LineChartItem/LineChartItem.js +30 -26
- package/LinearMeter/LinearMeter.js +92 -87
- package/LinearProgress/LinearProgress.js +27 -22
- package/Link/Link.js +7 -8
- package/Links/Links.js +128 -118
- package/List/List.js +23 -21
- package/ListItem/ListItem.js +68 -58
- package/ListSubheader/ListSubheader.js +9 -11
- package/MainProgress/MainProgress.js +14 -12
- package/MainProgressMaterial/MainProgressMaterial.js +16 -14
- package/Markdown/Markdown.js +6 -5
- package/Masonry/Masonry.js +26 -22
- package/Medias/Medias.js +95 -93
- package/Menu/Menu.js +51 -45
- package/MenuDesktop/MenuDesktop.js +141 -130
- package/MenuItem/MenuItem.js +75 -64
- package/Meta/Meta.js +21 -19
- package/Modal/Modal.js +52 -39
- package/ModalFooter/ModalFooter.js +12 -12
- package/ModalHeader/ModalHeader.js +12 -12
- package/ModalIcon/ModalIcon.js +55 -13
- package/ModalMain/ModalMain.js +12 -12
- package/ModalText/ModalText.js +12 -12
- package/ModalTitle/ModalTitle.js +12 -12
- package/MoreOptions/MoreOptions.js +14 -12
- package/Move/Move.js +9 -6
- package/NavigationBar/NavigationBar.js +7 -6
- package/NavigationDrawer/NavigationDrawer.js +7 -6
- package/NavigationItem/NavigationItem.js +58 -48
- package/NavigationRail/NavigationRail.js +25 -22
- package/NotFound/NotFound.js +21 -18
- package/NumericTextField/NumericTextField.js +14 -9
- package/Page/Page.js +50 -38
- package/PageTransition/PageTransition.js +8 -7
- package/Pagination/Pagination.js +41 -31
- package/PaginationItem/PaginationItem.js +20 -18
- package/Parallax/Parallax.js +4 -3
- package/Path/Path.js +9 -11
- package/PieChart/PieChart.js +96 -79
- package/Placeholder/Placeholder.js +15 -12
- package/Portal/Portal.js +41 -18
- package/Properties/Properties.js +17 -18
- package/Property/Property.js +24 -17
- package/Radio/Radio.js +25 -21
- package/Radios/Radios.js +30 -26
- package/Rating/Rating.js +36 -31
- package/Reset/Reset.js +4 -1
- package/Reveal/Reveal.js +17 -13
- package/RichTextEditor/RichTextEditor.js +1011 -824
- package/RoundMeter/RoundMeter.js +98 -93
- package/RoundProgress/RoundProgress.js +36 -32
- package/ScatterChart/ScatterChart.js +15 -17
- package/ScatterChartItem/ScatterChartItem.js +36 -34
- package/ScreenCapture/ScreenCapture.js +57 -43
- package/Section/Section.js +66 -56
- package/SectionAction/SectionAction.js +17 -13
- package/SectionBoxes/SectionBoxes.js +75 -67
- package/SectionCards/SectionCards.js +86 -76
- package/SectionCarousel/SectionCarousel.js +72 -65
- package/SectionContact/SectionContact.js +65 -58
- package/SectionImageGallery/SectionImageGallery.js +13 -10
- package/SectionLogos/SectionLogos.js +34 -30
- package/SectionMedia/SectionMedia.js +41 -34
- package/SectionReviews/SectionReviews.js +76 -67
- package/SectionTextMedia/SectionTextMedia.js +64 -57
- package/SectionTimeline/SectionTimeline.js +46 -43
- package/SectionWatch/SectionWatch.js +12 -9
- package/Select/Select.js +163 -151
- package/Share/Share.js +165 -151
- package/Slide/Slide.js +29 -26
- package/Slider/Slider.js +87 -81
- package/SmartTextField/SmartTextField.js +453 -361
- package/Snackbar/Snackbar.js +48 -38
- package/Snackbars/Snackbars.js +43 -40
- package/Space/Space.js +731 -630
- package/SpeechToText/SpeechToText.js +20 -14
- package/SpeedDial/SpeedDial.js +84 -65
- package/SpeedDialItem/SpeedDialItem.js +22 -19
- package/SpyScroll/SpyScroll.js +16 -12
- package/Step/Step.js +29 -27
- package/Stepper/Stepper.js +42 -41
- package/Surface/Surface.js +7 -7
- package/Switch/Switch.js +49 -41
- package/Tab/Tab.js +40 -35
- package/Table/Table.js +19 -16
- package/TableBody/TableBody.js +14 -14
- package/TableCell/TableCell.js +37 -30
- package/TableFooter/TableFooter.js +13 -13
- package/TableHead/TableHead.js +25 -21
- package/TableHeader/TableHeader.js +14 -14
- package/TablePagination/TablePagination.js +67 -49
- package/TableRow/TableRow.js +14 -14
- package/Tabs/Tabs.js +55 -49
- package/Text/Text.js +17 -13
- package/TextField/TextField.js +135 -111
- package/TextToSpeech/TextToSpeech.js +20 -14
- package/TimePicker/TimePicker.js +196 -160
- package/TimeRangePicker/TimeRangePicker.js +9 -11
- package/Timeline/Timeline.js +13 -13
- package/TimelineItem/TimelineItem.js +29 -24
- package/Timer/Timer.js +137 -94
- package/ToggleButton/ToggleButton.js +10 -12
- package/ToggleButtons/ToggleButtons.js +9 -11
- package/Tooltip/Tooltip.js +63 -54
- package/TopAppBar/TopAppBar.js +32 -25
- package/Transition/Transition.js +11 -9
- package/Tree/Tree.js +73 -61
- package/Type/Type.js +7 -6
- package/VideoPlayer/VideoPlayer.js +207 -170
- package/ViewSplit/ViewSplit.js +49 -40
- package/Watch/Watch.js +204 -187
- package/Weather/Weather.js +58 -49
- package/Whiteboard/Whiteboard.js +28 -24
- package/Widgets/Widgets.js +60 -54
- package/WindowSplit/WindowSplit.js +59 -52
- package/Zoom/Zoom.js +60 -52
- package/esm/Accordion/Accordion.js +93 -74
- package/esm/AdvancedTextField/AdvancedTextField.js +7 -6
- package/esm/Append/Append.js +24 -19
- package/esm/AreaChart/AreaChart.js +15 -17
- package/esm/AreaChartItem/AreaChartItem.js +63 -58
- package/esm/AudioPlayer/AudioPlayer.js +180 -148
- package/esm/AudioRecorder/AudioRecorder.js +104 -59
- package/esm/AutoComplete/AutoComplete.js +135 -125
- package/esm/AutoCompleteCountry/AutoCompleteCountry.js +10 -11
- package/esm/AutoCompleteCurrency/AutoCompleteCurrency.js +4 -5
- package/esm/Avatar/Avatar.js +11 -8
- package/esm/AvatarGroup/AvatarGroup.js +18 -17
- package/esm/Backdrop/Backdrop.js +30 -21
- package/esm/Badge/Badge.js +18 -17
- package/esm/Banner/Banner.js +15 -12
- package/esm/BottomAppBar/BottomAppBar.js +14 -14
- package/esm/BottomSheet/BottomSheet.js +9 -11
- package/esm/Box/Box.js +12 -12
- package/esm/Breadcrumbs/Breadcrumbs.js +37 -33
- package/esm/BubbleChart/BubbleChart.js +159 -134
- package/esm/BubbleChartItem/BubbleChartItem.js +48 -43
- package/esm/Button/Button.js +45 -38
- package/esm/Buttons/Buttons.js +33 -28
- package/esm/Calendar/Calendar.js +357 -315
- package/esm/CalendarAvailability/CalendarAvailability.js +348 -295
- package/esm/CalendarMenu/CalendarMenu.js +93 -79
- package/esm/CalendarMonth/CalendarMonth.js +113 -102
- package/esm/CalendarViews/CalendarViews.js +138 -115
- package/esm/CalendarWeek/CalendarWeek.js +177 -155
- package/esm/Card/Card.js +16 -15
- package/esm/CardButton/CardButton.js +11 -10
- package/esm/CardFooter/CardFooter.js +12 -12
- package/esm/CardHeader/CardHeader.js +13 -13
- package/esm/CardImage/CardImage.js +10 -12
- package/esm/CardMain/CardMain.js +12 -12
- package/esm/Carousel/Carousel.js +140 -124
- package/esm/Chart/Chart.js +433 -388
- package/esm/Checkbox/Checkbox.js +46 -43
- package/esm/Chip/Chip.js +12 -11
- package/esm/Chips/Chips.js +20 -20
- package/esm/ClickListener/ClickListener.js +19 -15
- package/esm/Clock/Clock.js +38 -36
- package/esm/ColorTextField/ColorTextField.js +33 -27
- package/esm/ColumnChart/ColumnChart.js +16 -17
- package/esm/ColumnChartItem/ColumnChartItem.js +35 -31
- package/esm/Confirm/Confirm.js +51 -35
- package/esm/Container/Container.js +9 -6
- package/esm/CookieBanner/CookieBanner.js +55 -41
- package/esm/Countdown/Countdown.js +163 -123
- package/esm/DatePicker/DatePicker.js +236 -197
- package/esm/DateRangePicker/DateRangePicker.js +9 -11
- package/esm/DateTimePicker/DateTimePicker.js +127 -103
- package/esm/DateTimeRangePicker/DateTimeRangePicker.js +9 -11
- package/esm/Divider/Divider.js +25 -21
- package/esm/DonutChart/DonutChart.js +9 -11
- package/esm/DragAndDropList/DragAndDropList.js +8 -4
- package/esm/Drawing/Drawing.js +368 -311
- package/esm/DropZone/DropZone.js +20 -15
- package/esm/Emojis/Emojis.js +95 -85
- package/esm/Expand/Expand.js +77 -69
- package/esm/Fab/Fab.js +4 -6
- package/esm/Fade/Fade.js +64 -58
- package/esm/FileChoose/FileChoose.js +69 -60
- package/esm/Focus/Focus.js +19 -16
- package/esm/Form/Form.js +69 -57
- package/esm/FormRow/FormRow.js +49 -38
- package/esm/Forms/Forms.js +13 -13
- package/esm/Frame/Frame.js +62 -54
- package/esm/Grid/Grid.js +13 -10
- package/esm/Grow/Grow.js +60 -52
- package/esm/HTMLCanvas/HTMLCanvas.js +88 -74
- package/esm/IFrame/IFrame.js +33 -27
- package/esm/Icon/Icon.js +14 -14
- package/esm/IconButton/IconButton.js +12 -14
- package/esm/Image/Image.js +19 -15
- package/esm/ImageCrop/ImageCrop.js +96 -87
- package/esm/ImageEdit/ImageEdit.js +355 -290
- package/esm/ImageGallery/ImageGallery.js +104 -86
- package/esm/ImageList/ImageList.js +16 -11
- package/esm/ImageListItem/ImageListItem.js +9 -6
- package/esm/ImageListItemBox/ImageListItemBox.js +12 -12
- package/esm/Info/Info.js +38 -27
- package/esm/Interaction/Interaction.js +57 -68
- package/esm/Keyframes/Keyframes.js +11 -9
- package/esm/Label/Label.js +59 -50
- package/esm/Labels/Labels.js +30 -26
- package/esm/Line/Line.js +10 -7
- package/esm/LineChart/LineChart.js +16 -17
- package/esm/LineChartItem/LineChartItem.js +30 -26
- package/esm/LinearMeter/LinearMeter.js +92 -87
- package/esm/LinearProgress/LinearProgress.js +27 -22
- package/esm/Link/Link.js +7 -8
- package/esm/Links/Links.js +125 -115
- package/esm/List/List.js +23 -21
- package/esm/ListItem/ListItem.js +68 -58
- package/esm/ListSubheader/ListSubheader.js +9 -11
- package/esm/MainProgress/MainProgress.js +14 -12
- package/esm/MainProgressMaterial/MainProgressMaterial.js +16 -14
- package/esm/Markdown/Markdown.js +6 -5
- package/esm/Masonry/Masonry.js +26 -22
- package/esm/Medias/Medias.js +95 -93
- package/esm/Menu/Menu.js +51 -45
- package/esm/MenuDesktop/MenuDesktop.js +139 -128
- package/esm/MenuItem/MenuItem.js +75 -64
- package/esm/Meta/Meta.js +21 -19
- package/esm/Modal/Modal.js +52 -39
- package/esm/ModalFooter/ModalFooter.js +12 -12
- package/esm/ModalHeader/ModalHeader.js +12 -12
- package/esm/ModalIcon/ModalIcon.js +55 -13
- package/esm/ModalMain/ModalMain.js +12 -12
- package/esm/ModalText/ModalText.js +12 -12
- package/esm/ModalTitle/ModalTitle.js +12 -12
- package/esm/MoreOptions/MoreOptions.js +14 -12
- package/esm/Move/Move.js +9 -6
- package/esm/NavigationBar/NavigationBar.js +7 -6
- package/esm/NavigationDrawer/NavigationDrawer.js +7 -6
- package/esm/NavigationItem/NavigationItem.js +58 -48
- package/esm/NavigationRail/NavigationRail.js +25 -22
- package/esm/NotFound/NotFound.js +21 -18
- package/esm/NumericTextField/NumericTextField.js +14 -9
- package/esm/Page/Page.js +50 -38
- package/esm/PageTransition/PageTransition.js +8 -7
- package/esm/Pagination/Pagination.js +41 -31
- package/esm/PaginationItem/PaginationItem.js +20 -18
- package/esm/Parallax/Parallax.js +4 -3
- package/esm/Path/Path.js +9 -11
- package/esm/PieChart/PieChart.js +96 -79
- package/esm/Placeholder/Placeholder.js +15 -12
- package/esm/Portal/Portal.js +41 -18
- package/esm/Properties/Properties.js +17 -18
- package/esm/Property/Property.js +24 -17
- package/esm/Radio/Radio.js +25 -21
- package/esm/Radios/Radios.js +30 -26
- package/esm/Rating/Rating.js +35 -30
- package/esm/Reset/Reset.js +4 -1
- package/esm/Reveal/Reveal.js +17 -13
- package/esm/RichTextEditor/RichTextEditor.js +1011 -824
- package/esm/RoundMeter/RoundMeter.js +98 -93
- package/esm/RoundProgress/RoundProgress.js +36 -32
- package/esm/ScatterChart/ScatterChart.js +15 -17
- package/esm/ScatterChartItem/ScatterChartItem.js +36 -34
- package/esm/ScreenCapture/ScreenCapture.js +57 -43
- package/esm/Section/Section.js +66 -56
- package/esm/SectionAction/SectionAction.js +17 -13
- package/esm/SectionBoxes/SectionBoxes.js +75 -67
- package/esm/SectionCards/SectionCards.js +86 -76
- package/esm/SectionCarousel/SectionCarousel.js +72 -65
- package/esm/SectionContact/SectionContact.js +65 -58
- package/esm/SectionImageGallery/SectionImageGallery.js +13 -10
- package/esm/SectionLogos/SectionLogos.js +34 -30
- package/esm/SectionMedia/SectionMedia.js +41 -34
- package/esm/SectionReviews/SectionReviews.js +74 -65
- package/esm/SectionTextMedia/SectionTextMedia.js +64 -57
- package/esm/SectionTimeline/SectionTimeline.js +46 -43
- package/esm/SectionWatch/SectionWatch.js +12 -9
- package/esm/Select/Select.js +161 -149
- package/esm/Share/Share.js +165 -151
- package/esm/Slide/Slide.js +28 -25
- package/esm/Slider/Slider.js +86 -80
- package/esm/SmartTextField/SmartTextField.js +450 -358
- package/esm/Snackbar/Snackbar.js +48 -38
- package/esm/Snackbars/Snackbars.js +40 -37
- package/esm/Space/Space.js +731 -630
- package/esm/SpeechToText/SpeechToText.js +20 -14
- package/esm/SpeedDial/SpeedDial.js +84 -65
- package/esm/SpeedDialItem/SpeedDialItem.js +22 -19
- package/esm/SpyScroll/SpyScroll.js +16 -12
- package/esm/Step/Step.js +29 -27
- package/esm/Stepper/Stepper.js +42 -41
- package/esm/Surface/Surface.js +7 -7
- package/esm/Switch/Switch.js +49 -41
- package/esm/Tab/Tab.js +40 -35
- package/esm/Table/Table.js +19 -16
- package/esm/TableBody/TableBody.js +14 -14
- package/esm/TableCell/TableCell.js +37 -30
- package/esm/TableFooter/TableFooter.js +13 -13
- package/esm/TableHead/TableHead.js +25 -21
- package/esm/TableHeader/TableHeader.js +14 -14
- package/esm/TablePagination/TablePagination.js +67 -49
- package/esm/TableRow/TableRow.js +14 -14
- package/esm/Tabs/Tabs.js +55 -49
- package/esm/Text/Text.js +17 -13
- package/esm/TextField/TextField.js +129 -105
- package/esm/TextToSpeech/TextToSpeech.js +20 -14
- package/esm/TimePicker/TimePicker.js +196 -160
- package/esm/TimeRangePicker/TimeRangePicker.js +9 -11
- package/esm/Timeline/Timeline.js +13 -13
- package/esm/TimelineItem/TimelineItem.js +29 -24
- package/esm/Timer/Timer.js +137 -94
- package/esm/ToggleButton/ToggleButton.js +10 -12
- package/esm/ToggleButtons/ToggleButtons.js +9 -11
- package/esm/Tooltip/Tooltip.js +62 -53
- package/esm/TopAppBar/TopAppBar.js +32 -25
- package/esm/Transition/Transition.js +11 -9
- package/esm/Tree/Tree.js +73 -61
- package/esm/Type/Type.js +7 -6
- package/esm/VideoPlayer/VideoPlayer.js +207 -170
- package/esm/ViewSplit/ViewSplit.js +49 -40
- package/esm/Watch/Watch.js +204 -187
- package/esm/Weather/Weather.js +58 -49
- package/esm/Whiteboard/Whiteboard.js +28 -24
- package/esm/Widgets/Widgets.js +57 -51
- package/esm/WindowSplit/WindowSplit.js +59 -52
- package/esm/Zoom/Zoom.js +60 -52
- package/esm/index.js +1 -1
- package/index.js +1 -1
- package/package.json +3 -3
package/esm/Menu/Menu.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
-
const _excluded = ["open", "openDefault", "name", "label", "menuItems", "arrow", "anchor", "anchorElement", "autoSelect", "autoSelectOnBlur", "resetKeyboardNavigation", "closeOnClickAway", "include", "includeParentQueries", "includeQueries", "ignoreNonExisting", "onSelect", "onOpen", "onClose", "ListProps", "ModalProps", "WrapperProps", "ClickListenerProps", "className", "children"];
|
|
3
|
+
const _excluded = ["ref", "open", "openDefault", "name", "label", "menuItems", "arrow", "anchor", "anchorElement", "autoSelect", "autoSelectOnBlur", "resetKeyboardNavigation", "closeOnClickAway", "include", "includeParentQueries", "includeQueries", "ignoreNonExisting", "onSelect", "onOpen", "onClose", "ListProps", "ModalProps", "WrapperProps", "ClickListenerProps", "className", "children"];
|
|
5
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
6
|
import React from 'react';
|
|
@@ -11,6 +10,7 @@ import ListElement from '../List';
|
|
|
11
10
|
import TooltipElement from '../Tooltip';
|
|
12
11
|
import ClickListenerElement from '../ClickListener';
|
|
13
12
|
import { staticClassName } from '../utils';
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
const useStyle = styleMethod(theme => ({
|
|
15
15
|
root: {}
|
|
16
16
|
}), {
|
|
@@ -30,13 +30,14 @@ export const MENUS = {
|
|
|
30
30
|
MENUS.open = MENUS.open.filter(Boolean);
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
|
-
const Menu =
|
|
33
|
+
const Menu = props_ => {
|
|
34
34
|
const theme = useOnesyTheme();
|
|
35
35
|
const props = _objectSpread(_objectSpread(_objectSpread({}, theme?.ui?.elements?.all?.props?.default), theme?.ui?.elements?.onesyMenu?.props?.default), props_);
|
|
36
36
|
const List = theme?.elements?.List || ListElement;
|
|
37
37
|
const Tooltip = theme?.elements?.Tooltip || TooltipElement;
|
|
38
38
|
const ClickListener = theme?.elements?.ClickListener || ClickListenerElement;
|
|
39
39
|
const {
|
|
40
|
+
ref,
|
|
40
41
|
open: open_,
|
|
41
42
|
openDefault,
|
|
42
43
|
name,
|
|
@@ -207,47 +208,52 @@ const Menu = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
|
207
208
|
}
|
|
208
209
|
} : {});
|
|
209
210
|
const nameValue = name || label;
|
|
210
|
-
return /*#__PURE__*/
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
if (
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
211
|
+
return /*#__PURE__*/_jsx(Wrapper, _objectSpread(_objectSpread({}, WrapperProps), {}, {
|
|
212
|
+
children: /*#__PURE__*/_jsx(Tooltip, _objectSpread(_objectSpread({
|
|
213
|
+
ref: item_8 => {
|
|
214
|
+
if (ref) {
|
|
215
|
+
if (is('function', ref)) ref(item_8);else ref.current = item_8;
|
|
216
|
+
}
|
|
217
|
+
refs.root.current = item_8;
|
|
218
|
+
},
|
|
219
|
+
open: open,
|
|
220
|
+
className: classNames([staticClassName('Menu', theme) && ['onesy-Menu-root', open && `onesy-Menu-open`], className, classes.root]),
|
|
221
|
+
onMouseLeave: onMouseLeave,
|
|
222
|
+
anchor: anchor,
|
|
223
|
+
anchorElement: anchorElement,
|
|
224
|
+
label: nameValue ? is('function', nameValue) ? nameValue(methodItem) : nameValue : menuItems && /*#__PURE__*/_jsx(List, _objectSpread(_objectSpread({
|
|
225
|
+
menu: true,
|
|
226
|
+
menuOpen: open,
|
|
227
|
+
include: refs.include.current,
|
|
228
|
+
role: "menu"
|
|
229
|
+
}, ListProps), {}, {
|
|
230
|
+
className: classNames(['onesy-Menu-list', ListProps?.className, classes.list]),
|
|
231
|
+
children: ListProps?.noChildrenTransform ? menuItems : React.Children.toArray(menuItems).map((item_9, index_6) => (/*#__PURE__*/React.cloneElement(item_9, methodItem(item_9, index_6))))
|
|
232
|
+
})),
|
|
233
|
+
click: true,
|
|
234
|
+
arrow: arrow,
|
|
235
|
+
hover: false,
|
|
236
|
+
focus: false,
|
|
237
|
+
longPress: false,
|
|
238
|
+
noMargin: !arrow,
|
|
239
|
+
onOpen: onOpen,
|
|
240
|
+
onClose: onClose,
|
|
241
|
+
ModalProps: _objectSpread({
|
|
242
|
+
background: true,
|
|
243
|
+
backgroundInvisible: true,
|
|
244
|
+
freezeScroll: false
|
|
245
|
+
}, ModalProps)
|
|
246
|
+
}, other), {}, {
|
|
247
|
+
children: children && /*#__PURE__*/React.cloneElement(children, {
|
|
248
|
+
ref: item_10 => {
|
|
249
|
+
if (children.ref) {
|
|
250
|
+
if (is('function', children.ref)) children.ref(item_10);else children.ref.current = item_10;
|
|
251
|
+
}
|
|
252
|
+
refs.main.current = item_10;
|
|
253
|
+
}
|
|
254
|
+
})
|
|
255
|
+
}))
|
|
256
|
+
}));
|
|
257
|
+
};
|
|
252
258
|
Menu.displayName = 'onesy-Menu';
|
|
253
259
|
export default Menu;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
-
const _excluded = ["tonal", "color", "version", "items", "valueDefault", "value_", "openOnHover", "openOnClick", "openOnFocus", "renderItem", "indicator", "menuTransition", "menuTransitionClassName", "menuTransitionStyle", "onOpen", "onClose", "onChange", "TransitionComponent", "IconIndicator", "AppendProps", "TypeProps", "ItemProps", "IconProps", "TransitionComponentProps", "WrapperProps", "WrapperMenuProps", "className"];
|
|
3
|
+
const _excluded = ["ref", "tonal", "color", "version", "items", "valueDefault", "value_", "openOnHover", "openOnClick", "openOnFocus", "renderItem", "indicator", "menuTransition", "menuTransitionClassName", "menuTransitionStyle", "onOpen", "onClose", "onChange", "TransitionComponent", "IconIndicator", "AppendProps", "TypeProps", "ItemProps", "IconProps", "TransitionComponentProps", "WrapperProps", "WrapperMenuProps", "className"];
|
|
5
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
6
|
import { c as _c } from "react/compiler-runtime";
|
|
@@ -19,6 +18,7 @@ import TypeElement from '../Type';
|
|
|
19
18
|
import LineElement from '../Line';
|
|
20
19
|
import useMediaQuery from '../useMediaQuery';
|
|
21
20
|
import { staticClassName } from '../utils';
|
|
21
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
22
|
const useStyle = styleMethod(theme => ({
|
|
23
23
|
root: {
|
|
24
24
|
position: 'relative'
|
|
@@ -96,8 +96,8 @@ const useStyle = styleMethod(theme => ({
|
|
|
96
96
|
}), {
|
|
97
97
|
name: 'onesy-MenuDesktop'
|
|
98
98
|
});
|
|
99
|
-
const Wrapper =
|
|
100
|
-
const $ = _c(
|
|
99
|
+
const Wrapper = props => {
|
|
100
|
+
const $ = _c(8);
|
|
101
101
|
const theme = useOnesyTheme();
|
|
102
102
|
const {
|
|
103
103
|
onMouseEnter,
|
|
@@ -116,25 +116,24 @@ const Wrapper = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
116
116
|
t0 = $[2];
|
|
117
117
|
}
|
|
118
118
|
let t1;
|
|
119
|
-
if ($[3] !== onMouseEnter || $[4] !== onMouseLeave || $[5] !== props.children || $[6] !==
|
|
120
|
-
t1 = /*#__PURE__*/
|
|
121
|
-
ref: ref,
|
|
119
|
+
if ($[3] !== onMouseEnter || $[4] !== onMouseLeave || $[5] !== props.children || $[6] !== t0) {
|
|
120
|
+
t1 = /*#__PURE__*/_jsx("div", {
|
|
122
121
|
onMouseEnter: onMouseEnter,
|
|
123
122
|
onMouseLeave: onMouseLeave,
|
|
124
|
-
style: t0
|
|
125
|
-
|
|
123
|
+
style: t0,
|
|
124
|
+
children: props.children
|
|
125
|
+
});
|
|
126
126
|
$[3] = onMouseEnter;
|
|
127
127
|
$[4] = onMouseLeave;
|
|
128
128
|
$[5] = props.children;
|
|
129
|
-
$[6] =
|
|
130
|
-
$[7] =
|
|
131
|
-
$[8] = t1;
|
|
129
|
+
$[6] = t0;
|
|
130
|
+
$[7] = t1;
|
|
132
131
|
} else {
|
|
133
|
-
t1 = $[
|
|
132
|
+
t1 = $[7];
|
|
134
133
|
}
|
|
135
134
|
return t1;
|
|
136
|
-
}
|
|
137
|
-
const MenuDesktop =
|
|
135
|
+
};
|
|
136
|
+
const MenuDesktop = props_ => {
|
|
138
137
|
const theme = useOnesyTheme();
|
|
139
138
|
const props = _objectSpread(_objectSpread(_objectSpread({}, theme?.ui?.elements?.all?.props?.default), theme?.ui?.elements?.onesyMenuDesktop?.props?.default), props_);
|
|
140
139
|
const Line = theme?.elements?.Line || LineElement;
|
|
@@ -146,6 +145,7 @@ const MenuDesktop = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
|
146
145
|
const Surface = theme?.elements?.Surface || SurfaceElement;
|
|
147
146
|
const Type = theme?.elements?.Type || TypeElement;
|
|
148
147
|
const {
|
|
148
|
+
ref,
|
|
149
149
|
tonal = true,
|
|
150
150
|
color = 'primary',
|
|
151
151
|
version = 'filled',
|
|
@@ -378,119 +378,130 @@ const MenuDesktop = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
|
378
378
|
// not to waste html space
|
|
379
379
|
if (!items?.length) return;
|
|
380
380
|
const openIndex = items.findIndex(item__8 => item__8?.value === open);
|
|
381
|
-
return /*#__PURE__*/
|
|
382
|
-
onClickOutside: onClickOutside
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
anchorElement: refs.anchorElement.current,
|
|
437
|
-
position: "bottom",
|
|
438
|
-
alignment: "start",
|
|
439
|
-
element: ({
|
|
440
|
-
ref: refAppend,
|
|
441
|
-
values,
|
|
442
|
-
style: styleAppend
|
|
443
|
-
}) => {
|
|
444
|
-
return /*#__PURE__*/React.createElement(Wrapper, _extends({
|
|
445
|
-
ref: refAppend,
|
|
446
|
-
onMouseEnter: updateOpenPure,
|
|
447
|
-
onMouseLeave: onMouseLeave
|
|
448
|
-
}, WrapperProps, {
|
|
449
|
-
style: _objectSpread(_objectSpread(_objectSpread({}, append), styleAppend), {}, {
|
|
450
|
-
transition: 'none'
|
|
451
|
-
}, WrapperProps?.style)
|
|
452
|
-
}), /*#__PURE__*/React.createElement(TransitionComponent, _extends({
|
|
453
|
-
in: inProp,
|
|
454
|
-
onEntered: () => {
|
|
455
|
-
if (refAppend.current) setTimeout(() => {
|
|
456
|
-
refAppend.current.style.transition = theme.methods.transitions.make(['width', 'height', 'transform']);
|
|
457
|
-
}, 14);
|
|
458
|
-
},
|
|
459
|
-
onExited: () => {
|
|
460
|
-
close();
|
|
461
|
-
if (refAppend.current) refAppend.current.style.transition = 'none';
|
|
381
|
+
return /*#__PURE__*/_jsx(ClickListener, {
|
|
382
|
+
onClickOutside: onClickOutside,
|
|
383
|
+
children: /*#__PURE__*/_jsxs(Line, _objectSpread(_objectSpread({
|
|
384
|
+
ref: item_9 => {
|
|
385
|
+
if (ref) {
|
|
386
|
+
if (is('function', ref)) ref(item_9);else ref.current = item_9;
|
|
387
|
+
}
|
|
388
|
+
refs.root.current = item_9;
|
|
389
|
+
},
|
|
390
|
+
gap: 0,
|
|
391
|
+
direction: "column",
|
|
392
|
+
align: "unset",
|
|
393
|
+
justify: "unset",
|
|
394
|
+
className: classNames([staticClassName('MenuDesktop', theme) && ['onesy-MenuDesktop-root'], className, classes.root])
|
|
395
|
+
}, other), {}, {
|
|
396
|
+
children: [/*#__PURE__*/_jsx(Line, {
|
|
397
|
+
gap: 0,
|
|
398
|
+
direction: "row",
|
|
399
|
+
align: "unset",
|
|
400
|
+
justify: "unset",
|
|
401
|
+
children: items.map((item_10, index_4) =>
|
|
402
|
+
// hovered and onClick add to the method
|
|
403
|
+
is('function', renderItem) ? renderItem(item_10, index_4) : /*#__PURE__*/_jsxs(Line, _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
404
|
+
ref: item__9 => {
|
|
405
|
+
if (!refs.items.current.includes(item_10)) refs.items.current.push(item__9);
|
|
406
|
+
},
|
|
407
|
+
tabIndex: !item_10.disabled && item_10.menu ? 0 : undefined,
|
|
408
|
+
"data-value": item_10.value,
|
|
409
|
+
gap: 0.5,
|
|
410
|
+
direction: "row",
|
|
411
|
+
align: "center"
|
|
412
|
+
}, ItemProps), !!item_10.menu && openOnClick && {
|
|
413
|
+
onClick: () => onClick(item_10)
|
|
414
|
+
}), !!item_10.menu && !mobile && openOnFocus && {
|
|
415
|
+
onFocus: () => onFocus(item_10),
|
|
416
|
+
onBlur: () => onBlur()
|
|
417
|
+
}), !!item_10.menu && openOnHover && {
|
|
418
|
+
onMouseEnter: () => onMouseEnter(item_10),
|
|
419
|
+
onMouseLeave: () => onMouseLeave(item_10)
|
|
420
|
+
}), {}, {
|
|
421
|
+
className: classNames([staticClassName('MenuDesktop', theme) && ['onesy-MenuDesktop-item', open === item_10.value && `onesy-MenuDesktop-open`, item_10.disabled && `onesy-MenuDesktop-disabled`], ItemProps?.className, classes.item, item_10.disabled && classes.item_disabled]),
|
|
422
|
+
children: [/*#__PURE__*/_jsx(Type, _objectSpread(_objectSpread({
|
|
423
|
+
version: "l1"
|
|
424
|
+
}, TypeProps), {}, {
|
|
425
|
+
children: item_10.name !== undefined ? item_10.name : item_10.label
|
|
426
|
+
})), !!item_10.menu && /*#__PURE__*/_jsx(IconIndicator, _objectSpread({
|
|
427
|
+
size: 20,
|
|
428
|
+
className: classNames([staticClassName('MenuDesktop', theme) && ['onesy-MenuDesktop-indicator'], classes.indicator, inProp && open === item_10.value && classes.indicator_open])
|
|
429
|
+
}, IconProps))]
|
|
430
|
+
}), index_4))
|
|
431
|
+
}), !init && items.map((item_11, index_5) => /*#__PURE__*/_jsx("div", {
|
|
432
|
+
ref: item__10 => refs.menus.current[index_5] = item__10,
|
|
433
|
+
style: {
|
|
434
|
+
position: 'absolute',
|
|
435
|
+
visibility: 'hidden'
|
|
462
436
|
},
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
437
|
+
children: item_11.menu
|
|
438
|
+
}, index_5)), /*#__PURE__*/_jsx(Append, _objectSpread({
|
|
439
|
+
open: !!open,
|
|
440
|
+
anchorElement: refs.anchorElement.current,
|
|
441
|
+
position: "bottom",
|
|
442
|
+
alignment: "start",
|
|
443
|
+
element: ({
|
|
444
|
+
ref: refAppend,
|
|
445
|
+
values,
|
|
446
|
+
style: styleAppend
|
|
447
|
+
}) => {
|
|
448
|
+
return /*#__PURE__*/_jsx(Wrapper, _objectSpread(_objectSpread({
|
|
449
|
+
ref: refAppend,
|
|
450
|
+
onMouseEnter: updateOpenPure,
|
|
451
|
+
onMouseLeave: onMouseLeave
|
|
452
|
+
}, WrapperProps), {}, {
|
|
453
|
+
style: _objectSpread(_objectSpread(_objectSpread({}, append), styleAppend), {}, {
|
|
454
|
+
transition: 'none'
|
|
455
|
+
}, WrapperProps?.style),
|
|
456
|
+
children: /*#__PURE__*/_jsx(TransitionComponent, _objectSpread(_objectSpread({
|
|
457
|
+
in: inProp,
|
|
458
|
+
onEntered: () => {
|
|
459
|
+
if (refAppend.current) setTimeout(() => {
|
|
460
|
+
refAppend.current.style.transition = theme.methods.transitions.make(['width', 'height', 'transform']);
|
|
461
|
+
}, 14);
|
|
462
|
+
},
|
|
463
|
+
onExited: () => {
|
|
464
|
+
close();
|
|
465
|
+
if (refAppend.current) refAppend.current.style.transition = 'none';
|
|
466
|
+
},
|
|
467
|
+
add: true,
|
|
468
|
+
removeOnExited: true
|
|
469
|
+
}, TransitionComponentProps), {}, {
|
|
470
|
+
children: /*#__PURE__*/_jsxs(Surface, _objectSpread(_objectSpread({
|
|
471
|
+
tonal: tonal,
|
|
472
|
+
color: color,
|
|
473
|
+
version: version
|
|
474
|
+
}, WrapperMenuProps), {}, {
|
|
475
|
+
className: classNames([staticClassName('MenuDesktop', theme) && ['onesy-MenuDesktop-menu-wrapper'], WrapperMenuProps?.className, classes.menuWrapper]),
|
|
476
|
+
style: _objectSpread(_objectSpread({}, append), WrapperMenuProps?.style),
|
|
477
|
+
children: [menu && menuTransition && /*#__PURE__*/_jsx(Transitions, {
|
|
478
|
+
switch: true,
|
|
479
|
+
mode: "in-out-follow",
|
|
480
|
+
children: /*#__PURE__*/_jsx(Transition, {
|
|
481
|
+
children: status => {
|
|
482
|
+
return /*#__PURE__*/React.cloneElement(menu, {
|
|
483
|
+
// For manual onClose within the element
|
|
484
|
+
onMenuDesktopClose: onClose,
|
|
485
|
+
className: classNames([staticClassName('MenuDesktop', theme) && ['onesy-MenuDesktop-menu', status], ...(is('function', menuTransitionClassName) ? menuTransitionClassName(status, openItem) : []), classes[theme.direction === 'ltr' ? openIndex <= 0 || openIndex < refs.previousOpenIndex.current ? 'menu' : 'menu_reverse' : openIndex <= 0 || openIndex < refs.previousOpenIndex.current ? 'menu_reverse' : 'menu']]),
|
|
486
|
+
style: _objectSpread(_objectSpread(_objectSpread({
|
|
487
|
+
position: 'absolute'
|
|
488
|
+
}, menu?.props?.style), refs.menu.current?.props.style), is('function', menuTransitionStyle) && menuTransitionStyle(status, openItem))
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
}, openItem)
|
|
492
|
+
}), menu && !menuTransition && (/*#__PURE__*/React.cloneElement(menu, {
|
|
493
|
+
// For manual onClose within the element
|
|
494
|
+
onMenuDesktopClose: onClose,
|
|
495
|
+
className: classNames([staticClassName('MenuDesktop', theme) && ['onesy-MenuDesktop-menu'], classes.menu]),
|
|
496
|
+
style: _objectSpread(_objectSpread(_objectSpread({}, menu?.props?.style), refs.menu.current?.style), append)
|
|
497
|
+
}))]
|
|
498
|
+
}))
|
|
499
|
+
}))
|
|
500
|
+
}));
|
|
501
|
+
}
|
|
502
|
+
}, AppendProps))]
|
|
503
|
+
}))
|
|
504
|
+
});
|
|
505
|
+
};
|
|
495
506
|
MenuDesktop.displayName = 'onesy-MenuDesktop';
|
|
496
507
|
export default MenuDesktop;
|
package/esm/MenuItem/MenuItem.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
-
const _excluded = ["tonal", "color", "colorSelected", "size", "menu", "menuId", "menuOpen", "openMenu", "openMenuDefault", "openList", "openListDefault", "menuItem", "list", "preselected", "selected", "inset", "end", "indicator", "include", "footer", "menuCloseOnClick", "listCloseOnClick", "disabled", "onClick", "onFocus", "onBlur", "onMouseEnter", "onMouseLeave", "ExpandIcon", "ListTransitionComponent", "ListProps", "ListTransitionComponentProps", "ExpandProps", "MenuProps"];
|
|
3
|
+
const _excluded = ["ref", "tonal", "color", "colorSelected", "size", "menu", "menuId", "menuOpen", "openMenu", "openMenuDefault", "openList", "openListDefault", "menuItem", "list", "preselected", "selected", "inset", "end", "indicator", "include", "footer", "menuCloseOnClick", "listCloseOnClick", "disabled", "onClick", "onFocus", "onBlur", "onMouseEnter", "onMouseLeave", "ExpandIcon", "ListTransitionComponent", "ListProps", "ListTransitionComponentProps", "ExpandProps", "MenuProps"];
|
|
5
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
6
|
import React from 'react';
|
|
@@ -16,6 +15,7 @@ import MenuElement from '../Menu';
|
|
|
16
15
|
import ExpandElement from '../Expand';
|
|
17
16
|
import FadeElement from '../Fade';
|
|
18
17
|
import { iconFontSize, staticClassName } from '../utils';
|
|
18
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
19
|
const useStyle = styleMethod(theme => ({
|
|
20
20
|
icon: {
|
|
21
21
|
transition: theme.methods.transitions.make('transform')
|
|
@@ -31,7 +31,7 @@ const ListItemDelays = {
|
|
|
31
31
|
enter: 70
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
-
const MenuItem =
|
|
34
|
+
const MenuItem = props_ => {
|
|
35
35
|
const theme = useOnesyTheme();
|
|
36
36
|
const props = _objectSpread(_objectSpread(_objectSpread({}, theme?.ui?.elements?.all?.props?.default), theme?.ui?.elements?.onesyMenuItem?.props?.default), props_);
|
|
37
37
|
const ListItem = theme?.elements?.ListItem || ListItemElement;
|
|
@@ -41,6 +41,7 @@ const MenuItem = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
|
41
41
|
const Expand = theme?.elements?.Expand || ExpandElement;
|
|
42
42
|
const Fade = theme?.elements?.Fade || FadeElement;
|
|
43
43
|
const {
|
|
44
|
+
ref,
|
|
44
45
|
tonal = true,
|
|
45
46
|
color = 'default',
|
|
46
47
|
colorSelected = props.color,
|
|
@@ -121,15 +122,16 @@ const MenuItem = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
|
121
122
|
if (is('function', onClick_)) onClick_(event_0);
|
|
122
123
|
};
|
|
123
124
|
let end = end_;
|
|
124
|
-
if (menu) end = end_ || /*#__PURE__*/
|
|
125
|
-
if (list) end = end_ || indicator && /*#__PURE__*/
|
|
125
|
+
if (menu) end = end_ || /*#__PURE__*/_jsx(IconMaterialArrowRight, {});
|
|
126
|
+
if (list) end = end_ || indicator && /*#__PURE__*/_jsx(IconButton, {
|
|
126
127
|
size: 24,
|
|
127
128
|
fontSize: iconFontSize,
|
|
128
129
|
onClick: onClick,
|
|
129
|
-
className: classNames([staticClassName('ListItem', theme) && ['onesy-ListItem-icon-button'], classes.iconButton])
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
className: classNames([staticClassName('ListItem', theme) && ['onesy-ListItem-icon-button'], classes.iconButton]),
|
|
131
|
+
children: /*#__PURE__*/_jsx(ExpandIcon, {
|
|
132
|
+
className: classNames([classes.icon, openList && classes.icon_open])
|
|
133
|
+
})
|
|
134
|
+
});
|
|
133
135
|
React.useEffect(() => {
|
|
134
136
|
const onKeyDown = event_1 => {
|
|
135
137
|
if (!refs.props.current.disabled) {
|
|
@@ -206,60 +208,69 @@ const MenuItem = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
|
206
208
|
}
|
|
207
209
|
};
|
|
208
210
|
ListTransitionComponentProps.in = !!openList;
|
|
209
|
-
return /*#__PURE__*/
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
if (
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
211
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
212
|
+
children: /*#__PURE__*/_jsx(ListItem, _objectSpread({
|
|
213
|
+
ref: item_0 => {
|
|
214
|
+
if (ref) {
|
|
215
|
+
if (is('function', ref)) ref(item_0);else if (ref?.current) ref.current = item_0;
|
|
216
|
+
}
|
|
217
|
+
refs.root.current = item_0;
|
|
218
|
+
},
|
|
219
|
+
tonal: tonal,
|
|
220
|
+
color: color,
|
|
221
|
+
colorSelected: colorSelected,
|
|
222
|
+
size: size,
|
|
223
|
+
inset: inset,
|
|
224
|
+
selected: selected,
|
|
225
|
+
preselected: preselected,
|
|
226
|
+
end: end,
|
|
227
|
+
disabled: disabled,
|
|
228
|
+
onClick: onClick,
|
|
229
|
+
onFocus: onFocus,
|
|
230
|
+
onBlur: onBlur,
|
|
231
|
+
onMouseEnter: onMouseEnter,
|
|
232
|
+
onMouseLeave: onMouseLeave,
|
|
233
|
+
"aria-haspopup": !!menu,
|
|
234
|
+
"aria-expanded": openMenu,
|
|
235
|
+
menuItem: true,
|
|
236
|
+
className: classNames([staticClassName('MenuItem', theme) && ['onesy-MenuItem-root', `onesy-MenuItem-size-${size}`], classes.root]),
|
|
237
|
+
InteractionProps: {
|
|
238
|
+
focus
|
|
239
|
+
},
|
|
240
|
+
RootProps: {
|
|
241
|
+
className: classNames([staticClassName('ListItem', theme) && [menu && `onesy-ListItem-menu`, list && `onesy-ListItem-list`, menuItem && `onesy-ListItem-menu-item`, menuOpen && `onesy-ListItem-menu-open`, openMenu && `onesy-ListItem-open-menu`, openList && `onesy-ListItem-open-list`, menuItem && [inset && `onesy-ListItem-menu-item-inset`]]])
|
|
242
|
+
},
|
|
243
|
+
footer: (footer || menu || list) && /*#__PURE__*/_jsxs(_Fragment, {
|
|
244
|
+
children: [footer, list && /*#__PURE__*/_jsx(Expand, _objectSpread(_objectSpread({
|
|
245
|
+
in: openList,
|
|
246
|
+
parent: refs.root.current
|
|
247
|
+
}, ExpandProps), {}, {
|
|
248
|
+
children: /*#__PURE__*/_jsx(ListTransitionComponent, _objectSpread(_objectSpread({}, ListTransitionComponentProps), {}, {
|
|
249
|
+
children: /*#__PURE__*/_jsx(List, _objectSpread(_objectSpread({
|
|
250
|
+
indent: 5
|
|
251
|
+
}, ListProps), {}, {
|
|
252
|
+
className: classNames([staticClassName('ListItem', theme) && ['onesy-ListItem-list'], ListProps?.className, classes.list]),
|
|
253
|
+
children: list
|
|
254
|
+
}))
|
|
255
|
+
}))
|
|
256
|
+
})), menu && /*#__PURE__*/_jsx(Menu, _objectSpread({
|
|
257
|
+
open: !!openMenu,
|
|
258
|
+
include: include,
|
|
259
|
+
onClose: onCloseMenu,
|
|
260
|
+
closeOnClickAway: false,
|
|
261
|
+
anchorElement: refs.root.current,
|
|
262
|
+
menuItems: menu,
|
|
263
|
+
transformOrigin: "left top",
|
|
264
|
+
transformOriginSwitch: "right top",
|
|
265
|
+
transformOriginRtl: "left top",
|
|
266
|
+
transformOriginRtlSwitch: "right top",
|
|
267
|
+
position: "right",
|
|
268
|
+
alignment: "start",
|
|
269
|
+
onMouseEnter: onMouseEnter
|
|
270
|
+
}, MenuProps))]
|
|
271
|
+
})
|
|
272
|
+
}, other))
|
|
273
|
+
});
|
|
274
|
+
};
|
|
264
275
|
MenuItem.displayName = 'onesy-MenuItem';
|
|
265
276
|
export default MenuItem;
|