@itwin/core-react 4.0.0-dev.13 → 4.0.0-dev.15
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/CHANGELOG.md +116 -1
- package/ContributeGuidelines.md +17 -14
- package/README.md +2 -2
- package/lib/cjs/core-react/UiCore.js.map +1 -1
- package/lib/cjs/core-react/_geometry.scss +70 -70
- package/lib/cjs/core-react/_helpers.scss +51 -51
- package/lib/cjs/core-react/_math.scss +13 -13
- package/lib/cjs/core-react/_scrollbar.scss +51 -51
- package/lib/cjs/core-react/_typography.scss +44 -44
- package/lib/cjs/core-react/_z-index.scss +65 -65
- package/lib/cjs/core-react/autosuggest/AutoSuggest.js.map +1 -1
- package/lib/cjs/core-react/autosuggest/AutoSuggest.scss +79 -79
- package/lib/cjs/core-react/badge/Badge.js.map +1 -1
- package/lib/cjs/core-react/badge/Badge.scss +13 -13
- package/lib/cjs/core-react/badge/BadgeUtilities.js.map +1 -1
- package/lib/cjs/core-react/badge/BetaBadge.js.map +1 -1
- package/lib/cjs/core-react/badge/NewBadge.js.map +1 -1
- package/lib/cjs/core-react/badge/NewBadge.scss +9 -9
- package/lib/cjs/core-react/base/Centered.js.map +1 -1
- package/lib/cjs/core-react/base/Div.js.map +1 -1
- package/lib/cjs/core-react/base/DivWithOutsideClick.js.map +1 -1
- package/lib/cjs/core-react/base/FillCentered.js.map +1 -1
- package/lib/cjs/core-react/base/FlexWrapContainer.js.map +1 -1
- package/lib/cjs/core-react/base/Gap.js.map +1 -1
- package/lib/cjs/core-react/base/PointerEvents.js.map +1 -1
- package/lib/cjs/core-react/base/ScrollView.js.map +1 -1
- package/lib/cjs/core-react/base/base.scss +42 -42
- package/lib/cjs/core-react/base/classes.scss +13 -13
- package/lib/cjs/core-react/base/index.scss +5 -5
- package/lib/cjs/core-react/button/UnderlinedButton.js.map +1 -1
- package/lib/cjs/core-react/button/UnderlinedButton.scss +32 -32
- package/lib/cjs/core-react/checklistbox/CheckListBox.js.map +1 -1
- package/lib/cjs/core-react/checklistbox/CheckListBox.scss +21 -21
- package/lib/cjs/core-react/classes.scss +11 -11
- package/lib/cjs/core-react/colorthemes.scss +61 -61
- package/lib/cjs/core-react/colorvariables.scss +131 -131
- package/lib/cjs/core-react/contextmenu/ContextMenu.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenu.scss +236 -236
- package/lib/cjs/core-react/contextmenu/ContextMenuDirection.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenuDivider.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenuItem.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextSubMenu.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/GlobalContextMenu.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/PopupContextMenu.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/TildeFinder.js.map +1 -1
- package/lib/cjs/core-react/dialog/Dialog.js.map +1 -1
- package/lib/cjs/core-react/dialog/Dialog.scss +245 -245
- package/lib/cjs/core-react/dialog/GlobalDialog.js.map +1 -1
- package/lib/cjs/core-react/elementseparator/ElementSeparator.js.map +1 -1
- package/lib/cjs/core-react/elementseparator/ElementSeparator.scss +85 -85
- package/lib/cjs/core-react/enums/Alignment.js.map +1 -1
- package/lib/cjs/core-react/enums/CheckBoxState.js.map +1 -1
- package/lib/cjs/core-react/enums/Orientation.js.map +1 -1
- package/lib/cjs/core-react/enums/SortDirection.js.map +1 -1
- package/lib/cjs/core-react/enums/TimeFormat.js.map +1 -1
- package/lib/cjs/core-react/expandable/ExpandableList.js.map +1 -1
- package/lib/cjs/core-react/expandable/ExpandableList.scss +8 -8
- package/lib/cjs/core-react/expandable/classes.scss +7 -7
- package/lib/cjs/core-react/expandable/index.scss +5 -5
- package/lib/cjs/core-react/expandable/list.scss +35 -35
- package/lib/cjs/core-react/focus/ItemKeyboardNavigator.js.map +1 -1
- package/lib/cjs/core-react/focustrap/FocusTrap.js.map +1 -1
- package/lib/cjs/core-react/hocs/withIsPressed.js.map +1 -1
- package/lib/cjs/core-react/hocs/withOnOutsideClick.js.map +1 -1
- package/lib/cjs/core-react/hocs/withTimeout.js.map +1 -1
- package/lib/cjs/core-react/icons/ConditionalIconItem.js.map +1 -1
- package/lib/cjs/core-react/icons/IconComponent.js.map +1 -1
- package/lib/cjs/core-react/icons/IconComponent.scss +20 -20
- package/lib/cjs/core-react/icons/SvgPath.js.map +1 -1
- package/lib/cjs/core-react/icons/SvgPath.scss +15 -15
- package/lib/cjs/core-react/icons/WebFontIcon.js.map +1 -1
- package/lib/cjs/core-react/icons/WebFontIcon.scss +17 -17
- package/lib/cjs/core-react/icons/classes.scss +10 -10
- package/lib/cjs/core-react/icons/index.scss +6 -6
- package/lib/cjs/core-react/icons/mixins.scss +25 -25
- package/lib/cjs/core-react/icons/variables.scss +12 -12
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.js.map +1 -1
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.scss +54 -54
- package/lib/cjs/core-react/index.scss +21 -21
- package/lib/cjs/core-react/inputs/Input.js.map +1 -1
- package/lib/cjs/core-react/inputs/InputLabel.js.map +1 -1
- package/lib/cjs/core-react/inputs/InputStatus.js.map +1 -1
- package/lib/cjs/core-react/inputs/LabeledComponentProps.js.map +1 -1
- package/lib/cjs/core-react/inputs/classes.scss +8 -8
- package/lib/cjs/core-react/inputs/iconinput/IconInput.js.map +1 -1
- package/lib/cjs/core-react/inputs/iconinput/IconInput.scss +35 -35
- package/lib/cjs/core-react/inputs/index.scss +9 -9
- package/lib/cjs/core-react/inputs/input-label.scss +90 -90
- package/lib/cjs/core-react/inputs/input.scss +58 -58
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.js.map +1 -1
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.scss +88 -88
- package/lib/cjs/core-react/inputs/variables.scss +38 -38
- package/lib/cjs/core-react/layout-variables.scss +17 -17
- package/lib/cjs/core-react/listbox/Listbox.js.map +1 -1
- package/lib/cjs/core-react/listbox/Listbox.scss +54 -54
- package/lib/cjs/core-react/loading/LoadingBar.js.map +1 -1
- package/lib/cjs/core-react/loading/LoadingBar.scss +29 -29
- package/lib/cjs/core-react/loading/LoadingPrompt.js.map +1 -1
- package/lib/cjs/core-react/loading/LoadingPrompt.scss +33 -33
- package/lib/cjs/core-react/loading/LoadingSpinner.js.map +1 -1
- package/lib/cjs/core-react/loading/LoadingSpinner.scss +26 -26
- package/lib/cjs/core-react/loading/LoadingStatus.js.map +1 -1
- package/lib/cjs/core-react/loading/LoadingStatus.scss +20 -20
- package/lib/cjs/core-react/loading/index.scss +5 -5
- package/lib/cjs/core-react/loading/mixins.scss +57 -57
- package/lib/cjs/core-react/messagebox/MessageBox.js.map +1 -1
- package/lib/cjs/core-react/messagebox/MessageBox.scss +56 -56
- package/lib/cjs/core-react/notification/MessageRenderer.js.map +1 -1
- package/lib/cjs/core-react/notification/MessageType.js.map +1 -1
- package/lib/cjs/core-react/popup/Popup.js.map +1 -1
- package/lib/cjs/core-react/popup/Popup.scss +240 -240
- package/lib/cjs/core-react/radialmenu/Annulus.js.map +1 -1
- package/lib/cjs/core-react/radialmenu/RadialMenu.js.map +1 -1
- package/lib/cjs/core-react/radialmenu/RadialMenu.scss +55 -55
- package/lib/cjs/core-react/searchbox/SearchBox.js.map +1 -1
- package/lib/cjs/core-react/searchbox/SearchBox.scss +47 -47
- package/lib/cjs/core-react/settings/SettingsContainer.js.map +1 -1
- package/lib/cjs/core-react/settings/SettingsContainer.scss +68 -68
- package/lib/cjs/core-react/settings/SettingsManager.js.map +1 -1
- package/lib/cjs/core-react/style/baseline.scss +11 -11
- package/lib/cjs/core-react/style/breakpoints.scss +41 -41
- package/lib/cjs/core-react/style/colors.scss +77 -77
- package/lib/cjs/core-react/style/index.scss +10 -10
- package/lib/cjs/core-react/style/mixins.scss +27 -27
- package/lib/cjs/core-react/style/opacity.scss +16 -16
- package/lib/cjs/core-react/style/themecolors.scss +123 -123
- package/lib/cjs/core-react/tabs/Tabs.js.map +1 -1
- package/lib/cjs/core-react/tabs/VerticalTabs.js.map +1 -1
- package/lib/cjs/core-react/tabs/classes.scss +7 -7
- package/lib/cjs/core-react/tabs/index.scss +5 -5
- package/lib/cjs/core-react/tabs/tabs.scss +96 -96
- package/lib/cjs/core-react/tabs/vertical.scss +51 -51
- package/lib/cjs/core-react/text/BlockText.js.map +1 -1
- package/lib/cjs/core-react/text/BodyText.js.map +1 -1
- package/lib/cjs/core-react/text/DisabledText.js.map +1 -1
- package/lib/cjs/core-react/text/FilteredText.js.map +1 -1
- package/lib/cjs/core-react/text/FilteredText.scss +10 -10
- package/lib/cjs/core-react/text/MutedText.js.map +1 -1
- package/lib/cjs/core-react/text/StyledText.js.map +1 -1
- package/lib/cjs/core-react/text/TextProps.js.map +1 -1
- package/lib/cjs/core-react/text/block.scss +15 -15
- package/lib/cjs/core-react/text/body.scss +13 -13
- package/lib/cjs/core-react/text/classes.scss +10 -10
- package/lib/cjs/core-react/text/disabled.scss +10 -10
- package/lib/cjs/core-react/text/index.scss +10 -10
- package/lib/cjs/core-react/text/mixins.scss +24 -24
- package/lib/cjs/core-react/text/muted.scss +10 -10
- package/lib/cjs/core-react/tree/Branch.js.map +1 -1
- package/lib/cjs/core-react/tree/Branch.scss +12 -12
- package/lib/cjs/core-react/tree/ExpansionToggle.js.map +1 -1
- package/lib/cjs/core-react/tree/ExpansionToggle.scss +32 -31
- package/lib/cjs/core-react/tree/Node.js.map +1 -1
- package/lib/cjs/core-react/tree/Node.scss +68 -68
- package/lib/cjs/core-react/tree/Placeholder.js.map +1 -1
- package/lib/cjs/core-react/tree/Placeholder.scss +17 -17
- package/lib/cjs/core-react/tree/Tree.js.map +1 -1
- package/lib/cjs/core-react/tree/Tree.scss +21 -21
- package/lib/cjs/core-react/uistate/LocalStateStorage.js.map +1 -1
- package/lib/cjs/core-react/uistate/UiStateEntry.js.map +1 -1
- package/lib/cjs/core-react/uistate/UiStateStorage.js.map +1 -1
- package/lib/cjs/core-react/utils/IconHelper.js.map +1 -1
- package/lib/cjs/core-react/utils/IconWebComponent.js.map +1 -1
- package/lib/cjs/core-react/utils/Point.js.map +1 -1
- package/lib/cjs/core-react/utils/Props.js.map +1 -1
- package/lib/cjs/core-react/utils/Rectangle.js.map +1 -1
- package/lib/cjs/core-react/utils/ScrollPositionMaintainer.js.map +1 -1
- package/lib/cjs/core-react/utils/Size.js.map +1 -1
- package/lib/cjs/core-react/utils/Timer.js.map +1 -1
- package/lib/cjs/core-react/utils/UiGeometry.js.map +1 -1
- package/lib/cjs/core-react/utils/flattenChildren.js.map +1 -1
- package/lib/cjs/core-react/utils/getBestBWContrastColor.js.map +1 -1
- package/lib/cjs/core-react/utils/getCssVariable.js.map +1 -1
- package/lib/cjs/core-react/utils/getDisplayName.js.map +1 -1
- package/lib/cjs/core-react/utils/getUserColor.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/ResizeObserverPolyfill.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useDisposable.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useEffectSkipFirst.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useEventListener.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useInterval.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useLifecycleLogging.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useOnOutsideClick.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useProximityToMouse.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useRefEffect.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useRefState.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useRefs.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useTargeted.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useThrottledFn.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useWidgetOpacityContext.js.map +1 -1
- package/lib/cjs/core-react/utils/isPromiseLike.js.map +1 -1
- package/lib/cjs/core-react/utils/shallowDiffers.js.map +1 -1
- package/lib/cjs/core-react/utils/typeUtils.js.map +1 -1
- package/lib/cjs/core-react.js.map +1 -1
- package/lib/esm/core-react/UiCore.js.map +1 -1
- package/lib/esm/core-react/_geometry.scss +70 -70
- package/lib/esm/core-react/_helpers.scss +51 -51
- package/lib/esm/core-react/_math.scss +13 -13
- package/lib/esm/core-react/_scrollbar.scss +51 -51
- package/lib/esm/core-react/_typography.scss +44 -44
- package/lib/esm/core-react/_z-index.scss +65 -65
- package/lib/esm/core-react/autosuggest/AutoSuggest.js.map +1 -1
- package/lib/esm/core-react/autosuggest/AutoSuggest.scss +79 -79
- package/lib/esm/core-react/badge/Badge.js.map +1 -1
- package/lib/esm/core-react/badge/Badge.scss +13 -13
- package/lib/esm/core-react/badge/BadgeUtilities.js.map +1 -1
- package/lib/esm/core-react/badge/BetaBadge.js.map +1 -1
- package/lib/esm/core-react/badge/NewBadge.js.map +1 -1
- package/lib/esm/core-react/badge/NewBadge.scss +9 -9
- package/lib/esm/core-react/base/Centered.js.map +1 -1
- package/lib/esm/core-react/base/Div.js.map +1 -1
- package/lib/esm/core-react/base/DivWithOutsideClick.js.map +1 -1
- package/lib/esm/core-react/base/FillCentered.js.map +1 -1
- package/lib/esm/core-react/base/FlexWrapContainer.js.map +1 -1
- package/lib/esm/core-react/base/Gap.js.map +1 -1
- package/lib/esm/core-react/base/PointerEvents.js.map +1 -1
- package/lib/esm/core-react/base/ScrollView.js.map +1 -1
- package/lib/esm/core-react/base/base.scss +42 -42
- package/lib/esm/core-react/base/classes.scss +13 -13
- package/lib/esm/core-react/base/index.scss +5 -5
- package/lib/esm/core-react/button/UnderlinedButton.js.map +1 -1
- package/lib/esm/core-react/button/UnderlinedButton.scss +32 -32
- package/lib/esm/core-react/checklistbox/CheckListBox.js.map +1 -1
- package/lib/esm/core-react/checklistbox/CheckListBox.scss +21 -21
- package/lib/esm/core-react/classes.scss +11 -11
- package/lib/esm/core-react/colorthemes.scss +61 -61
- package/lib/esm/core-react/colorvariables.scss +131 -131
- package/lib/esm/core-react/contextmenu/ContextMenu.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenu.scss +236 -236
- package/lib/esm/core-react/contextmenu/ContextMenuDirection.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenuDivider.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenuItem.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextSubMenu.js.map +1 -1
- package/lib/esm/core-react/contextmenu/GlobalContextMenu.js.map +1 -1
- package/lib/esm/core-react/contextmenu/PopupContextMenu.js.map +1 -1
- package/lib/esm/core-react/contextmenu/TildeFinder.js.map +1 -1
- package/lib/esm/core-react/dialog/Dialog.js.map +1 -1
- package/lib/esm/core-react/dialog/Dialog.scss +245 -245
- package/lib/esm/core-react/dialog/GlobalDialog.js.map +1 -1
- package/lib/esm/core-react/elementseparator/ElementSeparator.js.map +1 -1
- package/lib/esm/core-react/elementseparator/ElementSeparator.scss +85 -85
- package/lib/esm/core-react/enums/Alignment.js.map +1 -1
- package/lib/esm/core-react/enums/CheckBoxState.js.map +1 -1
- package/lib/esm/core-react/enums/Orientation.js.map +1 -1
- package/lib/esm/core-react/enums/SortDirection.js.map +1 -1
- package/lib/esm/core-react/enums/TimeFormat.js.map +1 -1
- package/lib/esm/core-react/expandable/ExpandableList.js.map +1 -1
- package/lib/esm/core-react/expandable/ExpandableList.scss +8 -8
- package/lib/esm/core-react/expandable/classes.scss +7 -7
- package/lib/esm/core-react/expandable/index.scss +5 -5
- package/lib/esm/core-react/expandable/list.scss +35 -35
- package/lib/esm/core-react/focus/ItemKeyboardNavigator.js.map +1 -1
- package/lib/esm/core-react/focustrap/FocusTrap.js.map +1 -1
- package/lib/esm/core-react/hocs/withIsPressed.js.map +1 -1
- package/lib/esm/core-react/hocs/withOnOutsideClick.js.map +1 -1
- package/lib/esm/core-react/hocs/withTimeout.js.map +1 -1
- package/lib/esm/core-react/icons/ConditionalIconItem.js.map +1 -1
- package/lib/esm/core-react/icons/IconComponent.js.map +1 -1
- package/lib/esm/core-react/icons/IconComponent.scss +20 -20
- package/lib/esm/core-react/icons/SvgPath.js.map +1 -1
- package/lib/esm/core-react/icons/SvgPath.scss +15 -15
- package/lib/esm/core-react/icons/WebFontIcon.js.map +1 -1
- package/lib/esm/core-react/icons/WebFontIcon.scss +17 -17
- package/lib/esm/core-react/icons/classes.scss +10 -10
- package/lib/esm/core-react/icons/index.scss +6 -6
- package/lib/esm/core-react/icons/mixins.scss +25 -25
- package/lib/esm/core-react/icons/variables.scss +12 -12
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.js.map +1 -1
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.scss +54 -54
- package/lib/esm/core-react/index.scss +21 -21
- package/lib/esm/core-react/inputs/Input.js.map +1 -1
- package/lib/esm/core-react/inputs/InputLabel.js.map +1 -1
- package/lib/esm/core-react/inputs/InputStatus.js.map +1 -1
- package/lib/esm/core-react/inputs/LabeledComponentProps.js.map +1 -1
- package/lib/esm/core-react/inputs/classes.scss +8 -8
- package/lib/esm/core-react/inputs/iconinput/IconInput.js.map +1 -1
- package/lib/esm/core-react/inputs/iconinput/IconInput.scss +35 -35
- package/lib/esm/core-react/inputs/index.scss +9 -9
- package/lib/esm/core-react/inputs/input-label.scss +90 -90
- package/lib/esm/core-react/inputs/input.scss +58 -58
- package/lib/esm/core-react/inputs/numberinput/NumberInput.js.map +1 -1
- package/lib/esm/core-react/inputs/numberinput/NumberInput.scss +88 -88
- package/lib/esm/core-react/inputs/variables.scss +38 -38
- package/lib/esm/core-react/layout-variables.scss +17 -17
- package/lib/esm/core-react/listbox/Listbox.js.map +1 -1
- package/lib/esm/core-react/listbox/Listbox.scss +54 -54
- package/lib/esm/core-react/loading/LoadingBar.js.map +1 -1
- package/lib/esm/core-react/loading/LoadingBar.scss +29 -29
- package/lib/esm/core-react/loading/LoadingPrompt.js.map +1 -1
- package/lib/esm/core-react/loading/LoadingPrompt.scss +33 -33
- package/lib/esm/core-react/loading/LoadingSpinner.js.map +1 -1
- package/lib/esm/core-react/loading/LoadingSpinner.scss +26 -26
- package/lib/esm/core-react/loading/LoadingStatus.js.map +1 -1
- package/lib/esm/core-react/loading/LoadingStatus.scss +20 -20
- package/lib/esm/core-react/loading/index.scss +5 -5
- package/lib/esm/core-react/loading/mixins.scss +57 -57
- package/lib/esm/core-react/messagebox/MessageBox.js.map +1 -1
- package/lib/esm/core-react/messagebox/MessageBox.scss +56 -56
- package/lib/esm/core-react/notification/MessageRenderer.js.map +1 -1
- package/lib/esm/core-react/notification/MessageType.js.map +1 -1
- package/lib/esm/core-react/popup/Popup.js.map +1 -1
- package/lib/esm/core-react/popup/Popup.scss +240 -240
- package/lib/esm/core-react/radialmenu/Annulus.js.map +1 -1
- package/lib/esm/core-react/radialmenu/RadialMenu.js.map +1 -1
- package/lib/esm/core-react/radialmenu/RadialMenu.scss +55 -55
- package/lib/esm/core-react/searchbox/SearchBox.js.map +1 -1
- package/lib/esm/core-react/searchbox/SearchBox.scss +47 -47
- package/lib/esm/core-react/settings/SettingsContainer.js.map +1 -1
- package/lib/esm/core-react/settings/SettingsContainer.scss +68 -68
- package/lib/esm/core-react/settings/SettingsManager.js.map +1 -1
- package/lib/esm/core-react/style/baseline.scss +11 -11
- package/lib/esm/core-react/style/breakpoints.scss +41 -41
- package/lib/esm/core-react/style/colors.scss +77 -77
- package/lib/esm/core-react/style/index.scss +10 -10
- package/lib/esm/core-react/style/mixins.scss +27 -27
- package/lib/esm/core-react/style/opacity.scss +16 -16
- package/lib/esm/core-react/style/themecolors.scss +123 -123
- package/lib/esm/core-react/tabs/Tabs.js.map +1 -1
- package/lib/esm/core-react/tabs/VerticalTabs.js.map +1 -1
- package/lib/esm/core-react/tabs/classes.scss +7 -7
- package/lib/esm/core-react/tabs/index.scss +5 -5
- package/lib/esm/core-react/tabs/tabs.scss +96 -96
- package/lib/esm/core-react/tabs/vertical.scss +51 -51
- package/lib/esm/core-react/text/BlockText.js.map +1 -1
- package/lib/esm/core-react/text/BodyText.js.map +1 -1
- package/lib/esm/core-react/text/DisabledText.js.map +1 -1
- package/lib/esm/core-react/text/FilteredText.js.map +1 -1
- package/lib/esm/core-react/text/FilteredText.scss +10 -10
- package/lib/esm/core-react/text/MutedText.js.map +1 -1
- package/lib/esm/core-react/text/StyledText.js.map +1 -1
- package/lib/esm/core-react/text/TextProps.js.map +1 -1
- package/lib/esm/core-react/text/block.scss +15 -15
- package/lib/esm/core-react/text/body.scss +13 -13
- package/lib/esm/core-react/text/classes.scss +10 -10
- package/lib/esm/core-react/text/disabled.scss +10 -10
- package/lib/esm/core-react/text/index.scss +10 -10
- package/lib/esm/core-react/text/mixins.scss +24 -24
- package/lib/esm/core-react/text/muted.scss +10 -10
- package/lib/esm/core-react/tree/Branch.js.map +1 -1
- package/lib/esm/core-react/tree/Branch.scss +12 -12
- package/lib/esm/core-react/tree/ExpansionToggle.js.map +1 -1
- package/lib/esm/core-react/tree/ExpansionToggle.scss +32 -31
- package/lib/esm/core-react/tree/Node.js.map +1 -1
- package/lib/esm/core-react/tree/Node.scss +68 -68
- package/lib/esm/core-react/tree/Placeholder.js.map +1 -1
- package/lib/esm/core-react/tree/Placeholder.scss +17 -17
- package/lib/esm/core-react/tree/Tree.js.map +1 -1
- package/lib/esm/core-react/tree/Tree.scss +21 -21
- package/lib/esm/core-react/uistate/LocalStateStorage.js.map +1 -1
- package/lib/esm/core-react/uistate/UiStateEntry.js.map +1 -1
- package/lib/esm/core-react/uistate/UiStateStorage.js.map +1 -1
- package/lib/esm/core-react/utils/IconHelper.js.map +1 -1
- package/lib/esm/core-react/utils/IconWebComponent.js.map +1 -1
- package/lib/esm/core-react/utils/Point.js.map +1 -1
- package/lib/esm/core-react/utils/Props.js.map +1 -1
- package/lib/esm/core-react/utils/Rectangle.js.map +1 -1
- package/lib/esm/core-react/utils/ScrollPositionMaintainer.js.map +1 -1
- package/lib/esm/core-react/utils/Size.js.map +1 -1
- package/lib/esm/core-react/utils/Timer.js.map +1 -1
- package/lib/esm/core-react/utils/UiGeometry.js.map +1 -1
- package/lib/esm/core-react/utils/flattenChildren.js.map +1 -1
- package/lib/esm/core-react/utils/getBestBWContrastColor.js.map +1 -1
- package/lib/esm/core-react/utils/getCssVariable.js.map +1 -1
- package/lib/esm/core-react/utils/getDisplayName.js.map +1 -1
- package/lib/esm/core-react/utils/getUserColor.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/ResizeObserverPolyfill.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useDisposable.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useEffectSkipFirst.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useEventListener.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useInterval.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useLifecycleLogging.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useOnOutsideClick.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useProximityToMouse.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useRefEffect.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useRefState.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useRefs.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useResizeObserver.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useTargeted.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useThrottledFn.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useWidgetOpacityContext.js.map +1 -1
- package/lib/esm/core-react/utils/isPromiseLike.js.map +1 -1
- package/lib/esm/core-react/utils/shallowDiffers.js.map +1 -1
- package/lib/esm/core-react/utils/typeUtils.js.map +1 -1
- package/lib/esm/core-react.js.map +1 -1
- package/lib/public/locales/en/UiCore.json +30 -30
- package/package.json +14 -12
- package/ThirdPartyNotices.md +0 -28
|
@@ -1,236 +1,236 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
@import "../icons/variables";
|
|
6
|
-
@import "../inputs/variables";
|
|
7
|
-
@import "../style/baseline";
|
|
8
|
-
@import "../style/colors";
|
|
9
|
-
@import "../style/opacity";
|
|
10
|
-
@import "../style/themecolors";
|
|
11
|
-
@import "../z-index";
|
|
12
|
-
|
|
13
|
-
// cspell:ignore themecolors unbordered
|
|
14
|
-
|
|
15
|
-
$uicore-menu-padding: $uicore-bordered-padding;
|
|
16
|
-
$uicore-menu-top-bottom-padding: calc(#{$uicore-menu-padding} * 0.6667);
|
|
17
|
-
|
|
18
|
-
.core-context-menu-global {
|
|
19
|
-
position: fixed;
|
|
20
|
-
width: 0px;
|
|
21
|
-
height: 0px;
|
|
22
|
-
|
|
23
|
-
@include uicore-z-index(context-menu-z);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.core-context-menu {
|
|
27
|
-
color: var(--iui-color-text);
|
|
28
|
-
|
|
29
|
-
&:hover {
|
|
30
|
-
color: var(--iui-color-text-hover);
|
|
31
|
-
cursor: auto;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
width: 0px;
|
|
35
|
-
height: 0px;
|
|
36
|
-
position: relative;
|
|
37
|
-
|
|
38
|
-
@include uicore-z-index(context-menu-z);
|
|
39
|
-
|
|
40
|
-
.core-context-menu-container {
|
|
41
|
-
position: absolute;
|
|
42
|
-
border-radius: var(--iui-border-radius-1);
|
|
43
|
-
padding: 4px 0;
|
|
44
|
-
box-shadow: var(--iui-shadow-1);
|
|
45
|
-
background-color: var(--iui-color-background);
|
|
46
|
-
text-overflow: ellipsis;
|
|
47
|
-
min-width: max-content;
|
|
48
|
-
max-width: 350px;
|
|
49
|
-
visibility: hidden;
|
|
50
|
-
transform: scaleY(0);
|
|
51
|
-
display: table;
|
|
52
|
-
border: 1px solid var(--iui-color-border);
|
|
53
|
-
|
|
54
|
-
&.core-context-menu-floating {
|
|
55
|
-
position: fixed;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
&.core-context-menu-opened {
|
|
59
|
-
visibility: inherit;
|
|
60
|
-
transform-origin: top;
|
|
61
|
-
transform: scaleY(1);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
&.core-context-menu-center {
|
|
65
|
-
transform: translate(-50%, -50%);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
&.core-context-menu-right {
|
|
69
|
-
transform: translate(0%, -50%);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
&.core-context-menu-left {
|
|
73
|
-
transform: translate(-100%, -50%);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
&.core-context-menu-top {
|
|
77
|
-
transform: translate(-50%, -100%);
|
|
78
|
-
|
|
79
|
-
&.core-context-menu-right {
|
|
80
|
-
transform: translate(0%, -100%);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
&.core-context-menu-left {
|
|
84
|
-
transform: translate(-100%, -100%);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
&.core-context-menu-bottom {
|
|
89
|
-
transform: translate(-50%, 0%);
|
|
90
|
-
|
|
91
|
-
&.core-context-menu-right {
|
|
92
|
-
transform: translate(0%, 0%);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
&.core-context-menu-left {
|
|
96
|
-
transform: translate(-100%, 0%);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.core-context-menu-item {
|
|
101
|
-
display: flex;
|
|
102
|
-
cursor: default;
|
|
103
|
-
padding: $uicore-menu-top-bottom-padding $uicore-menu-padding;
|
|
104
|
-
width: calc(100% - 2 * #{$uicore-menu-padding});
|
|
105
|
-
align-items: center;
|
|
106
|
-
position: relative;
|
|
107
|
-
box-sizing: content-box;
|
|
108
|
-
|
|
109
|
-
&:hover {
|
|
110
|
-
background-color: var(--iui-color-background-hover);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
&.core-context-menu-is-selected {
|
|
114
|
-
background-color: var(--iui-color-background-accent-muted);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
&.core-context-menu-disabled {
|
|
118
|
-
color: var(--iui-color-text-disabled);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
&.core-context-menu-hidden {
|
|
122
|
-
display: none;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
> .core-context-menu-icon {
|
|
126
|
-
flex-shrink: 0;
|
|
127
|
-
flex-grow: 0;
|
|
128
|
-
width: $uicore-icons-small;
|
|
129
|
-
height: var(--iui-size-l);
|
|
130
|
-
font-size: var(--iui-font-size-2);
|
|
131
|
-
line-height: var(--iui-size-l);
|
|
132
|
-
text-align: center;
|
|
133
|
-
margin-right: $uicore-unbordered-padding;
|
|
134
|
-
opacity: $uicore-opacity-2;
|
|
135
|
-
|
|
136
|
-
&.core-context-menu-icon-right {
|
|
137
|
-
margin-left: $uicore-unbordered-padding;
|
|
138
|
-
margin-right: 0;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
> .core-context-menu-content {
|
|
143
|
-
flex-shrink: 0;
|
|
144
|
-
flex-grow: 1;
|
|
145
|
-
font-size: var(--iui-font-size-1);
|
|
146
|
-
text-align: left;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
> .core-context-menu-badge {
|
|
150
|
-
position: absolute;
|
|
151
|
-
top: 0;
|
|
152
|
-
left: 0;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
&:focus {
|
|
156
|
-
outline: none;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
&:focus {
|
|
161
|
-
border: 1px solid $buic-background-divider;
|
|
162
|
-
box-shadow: var(--iui-shadow-1);
|
|
163
|
-
outline: 0px;
|
|
164
|
-
|
|
165
|
-
> .core-context-menu-item.is-selected,
|
|
166
|
-
> .context-submenu > .core-context-menu-item.is-selected {
|
|
167
|
-
// .is-selected being applied on hover, overriding with hover color
|
|
168
|
-
background-color: $buic-row-hover;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.core-context-submenu {
|
|
173
|
-
display: flex;
|
|
174
|
-
|
|
175
|
-
&.core-context-menu-top {
|
|
176
|
-
flex-direction: column;
|
|
177
|
-
align-items: center;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
&.core-context-menu-left {
|
|
181
|
-
flex-direction: row-reverse;
|
|
182
|
-
align-items: center;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
&.core-context-menu-right {
|
|
186
|
-
flex-direction: row;
|
|
187
|
-
align-items: center;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
&.core-context-menu-center {
|
|
191
|
-
flex-direction: column;
|
|
192
|
-
align-items: center;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
&.core-context-menu-top.core-context-menu-left {
|
|
196
|
-
flex-direction: column;
|
|
197
|
-
align-items: flex-start;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
&.core-context-menu-top.core-context-menu-right {
|
|
201
|
-
flex-direction: row;
|
|
202
|
-
align-items: flex-end;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
&.core-context-menu-bottom.core-context-menu-left {
|
|
206
|
-
flex-direction: row-reverse;
|
|
207
|
-
align-items: flex-start;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
&.core-context-menu-bottom.core-context-menu-right {
|
|
211
|
-
flex-direction: row;
|
|
212
|
-
align-items: flex-start;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
.core-context-submenu-container .core-context-submenu-arrow {
|
|
216
|
-
flex-shrink: 0;
|
|
217
|
-
flex-grow: 0;
|
|
218
|
-
margin-left: $uicore-unbordered-padding;
|
|
219
|
-
width: $uicore-icons-small;
|
|
220
|
-
height: var(--iui-size-l);
|
|
221
|
-
font-size: calc(var(--iui-font-size-2) * 0.5);
|
|
222
|
-
line-height: var(--iui-size-l);
|
|
223
|
-
text-align: center;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
.core-context-menu-divider {
|
|
229
|
-
border-bottom: 1px solid var(--iui-color-border-foreground);
|
|
230
|
-
height: 0px;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
.core-context-submenu-popup {
|
|
234
|
-
transform: translateY(-5px); // Compensate for the vertical padding
|
|
235
|
-
}
|
|
236
|
-
}
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
@import "../icons/variables";
|
|
6
|
+
@import "../inputs/variables";
|
|
7
|
+
@import "../style/baseline";
|
|
8
|
+
@import "../style/colors";
|
|
9
|
+
@import "../style/opacity";
|
|
10
|
+
@import "../style/themecolors";
|
|
11
|
+
@import "../z-index";
|
|
12
|
+
|
|
13
|
+
// cspell:ignore themecolors unbordered
|
|
14
|
+
|
|
15
|
+
$uicore-menu-padding: $uicore-bordered-padding;
|
|
16
|
+
$uicore-menu-top-bottom-padding: calc(#{$uicore-menu-padding} * 0.6667);
|
|
17
|
+
|
|
18
|
+
.core-context-menu-global {
|
|
19
|
+
position: fixed;
|
|
20
|
+
width: 0px;
|
|
21
|
+
height: 0px;
|
|
22
|
+
|
|
23
|
+
@include uicore-z-index(context-menu-z);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.core-context-menu {
|
|
27
|
+
color: var(--iui-color-text);
|
|
28
|
+
|
|
29
|
+
&:hover {
|
|
30
|
+
color: var(--iui-color-text-hover);
|
|
31
|
+
cursor: auto;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
width: 0px;
|
|
35
|
+
height: 0px;
|
|
36
|
+
position: relative;
|
|
37
|
+
|
|
38
|
+
@include uicore-z-index(context-menu-z);
|
|
39
|
+
|
|
40
|
+
.core-context-menu-container {
|
|
41
|
+
position: absolute;
|
|
42
|
+
border-radius: var(--iui-border-radius-1);
|
|
43
|
+
padding: 4px 0;
|
|
44
|
+
box-shadow: var(--iui-shadow-1);
|
|
45
|
+
background-color: var(--iui-color-background);
|
|
46
|
+
text-overflow: ellipsis;
|
|
47
|
+
min-width: max-content;
|
|
48
|
+
max-width: 350px;
|
|
49
|
+
visibility: hidden;
|
|
50
|
+
transform: scaleY(0);
|
|
51
|
+
display: table;
|
|
52
|
+
border: 1px solid var(--iui-color-border);
|
|
53
|
+
|
|
54
|
+
&.core-context-menu-floating {
|
|
55
|
+
position: fixed;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&.core-context-menu-opened {
|
|
59
|
+
visibility: inherit;
|
|
60
|
+
transform-origin: top;
|
|
61
|
+
transform: scaleY(1);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&.core-context-menu-center {
|
|
65
|
+
transform: translate(-50%, -50%);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&.core-context-menu-right {
|
|
69
|
+
transform: translate(0%, -50%);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&.core-context-menu-left {
|
|
73
|
+
transform: translate(-100%, -50%);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&.core-context-menu-top {
|
|
77
|
+
transform: translate(-50%, -100%);
|
|
78
|
+
|
|
79
|
+
&.core-context-menu-right {
|
|
80
|
+
transform: translate(0%, -100%);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&.core-context-menu-left {
|
|
84
|
+
transform: translate(-100%, -100%);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&.core-context-menu-bottom {
|
|
89
|
+
transform: translate(-50%, 0%);
|
|
90
|
+
|
|
91
|
+
&.core-context-menu-right {
|
|
92
|
+
transform: translate(0%, 0%);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&.core-context-menu-left {
|
|
96
|
+
transform: translate(-100%, 0%);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.core-context-menu-item {
|
|
101
|
+
display: flex;
|
|
102
|
+
cursor: default;
|
|
103
|
+
padding: $uicore-menu-top-bottom-padding $uicore-menu-padding;
|
|
104
|
+
width: calc(100% - 2 * #{$uicore-menu-padding});
|
|
105
|
+
align-items: center;
|
|
106
|
+
position: relative;
|
|
107
|
+
box-sizing: content-box;
|
|
108
|
+
|
|
109
|
+
&:hover {
|
|
110
|
+
background-color: var(--iui-color-background-hover);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&.core-context-menu-is-selected {
|
|
114
|
+
background-color: var(--iui-color-background-accent-muted);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&.core-context-menu-disabled {
|
|
118
|
+
color: var(--iui-color-text-disabled);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
&.core-context-menu-hidden {
|
|
122
|
+
display: none;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
> .core-context-menu-icon {
|
|
126
|
+
flex-shrink: 0;
|
|
127
|
+
flex-grow: 0;
|
|
128
|
+
width: $uicore-icons-small;
|
|
129
|
+
height: var(--iui-size-l);
|
|
130
|
+
font-size: var(--iui-font-size-2);
|
|
131
|
+
line-height: var(--iui-size-l);
|
|
132
|
+
text-align: center;
|
|
133
|
+
margin-right: $uicore-unbordered-padding;
|
|
134
|
+
opacity: $uicore-opacity-2;
|
|
135
|
+
|
|
136
|
+
&.core-context-menu-icon-right {
|
|
137
|
+
margin-left: $uicore-unbordered-padding;
|
|
138
|
+
margin-right: 0;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
> .core-context-menu-content {
|
|
143
|
+
flex-shrink: 0;
|
|
144
|
+
flex-grow: 1;
|
|
145
|
+
font-size: var(--iui-font-size-1);
|
|
146
|
+
text-align: left;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
> .core-context-menu-badge {
|
|
150
|
+
position: absolute;
|
|
151
|
+
top: 0;
|
|
152
|
+
left: 0;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
&:focus {
|
|
156
|
+
outline: none;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
&:focus {
|
|
161
|
+
border: 1px solid $buic-background-divider;
|
|
162
|
+
box-shadow: var(--iui-shadow-1);
|
|
163
|
+
outline: 0px;
|
|
164
|
+
|
|
165
|
+
> .core-context-menu-item.is-selected,
|
|
166
|
+
> .context-submenu > .core-context-menu-item.is-selected {
|
|
167
|
+
// .is-selected being applied on hover, overriding with hover color
|
|
168
|
+
background-color: $buic-row-hover;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.core-context-submenu {
|
|
173
|
+
display: flex;
|
|
174
|
+
|
|
175
|
+
&.core-context-menu-top {
|
|
176
|
+
flex-direction: column;
|
|
177
|
+
align-items: center;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
&.core-context-menu-left {
|
|
181
|
+
flex-direction: row-reverse;
|
|
182
|
+
align-items: center;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
&.core-context-menu-right {
|
|
186
|
+
flex-direction: row;
|
|
187
|
+
align-items: center;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
&.core-context-menu-center {
|
|
191
|
+
flex-direction: column;
|
|
192
|
+
align-items: center;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
&.core-context-menu-top.core-context-menu-left {
|
|
196
|
+
flex-direction: column;
|
|
197
|
+
align-items: flex-start;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
&.core-context-menu-top.core-context-menu-right {
|
|
201
|
+
flex-direction: row;
|
|
202
|
+
align-items: flex-end;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
&.core-context-menu-bottom.core-context-menu-left {
|
|
206
|
+
flex-direction: row-reverse;
|
|
207
|
+
align-items: flex-start;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
&.core-context-menu-bottom.core-context-menu-right {
|
|
211
|
+
flex-direction: row;
|
|
212
|
+
align-items: flex-start;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.core-context-submenu-container .core-context-submenu-arrow {
|
|
216
|
+
flex-shrink: 0;
|
|
217
|
+
flex-grow: 0;
|
|
218
|
+
margin-left: $uicore-unbordered-padding;
|
|
219
|
+
width: $uicore-icons-small;
|
|
220
|
+
height: var(--iui-size-l);
|
|
221
|
+
font-size: calc(var(--iui-font-size-2) * 0.5);
|
|
222
|
+
line-height: var(--iui-size-l);
|
|
223
|
+
text-align: center;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.core-context-menu-divider {
|
|
229
|
+
border-bottom: 1px solid var(--iui-color-border-foreground);
|
|
230
|
+
height: 0px;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.core-context-submenu-popup {
|
|
234
|
+
transform: translateY(-5px); // Compensate for the vertical padding
|
|
235
|
+
}
|
|
236
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenuDirection.js","sourceRoot":"","sources":["../../../../src/core-react/contextmenu/ContextMenuDirection.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH;;GAEG;AACH,MAAM,CAAN,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,iCAAS,CAAA;IACT,4CAAoB,CAAA;IAAE,mCAAW,CAAA;IAAE,8CAAsB,CAAA;IACzD,qCAAa,CAAA;IAAE,yCAAiB,CAAA;IAAE,uCAAe,CAAA;IACjD,kDAA0B,CAAA;IAAE,yCAAiB,CAAA;IAAE,oDAA4B,CAAA;AAC7E,CAAC,EALW,oBAAoB,KAApB,oBAAoB,QAK/B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ContextMenu\n */\n\n/** Enum to specify where a [[ContextMenu]] should anchor to its parent element\n * @public\n */\nexport enum ContextMenuDirection {\n None = \"\",\n TopLeft = \"top left\", Top = \"top\", TopRight = \"top right\",\n Left = \"left\", Center = \"center\", Right = \"right\",\n BottomLeft = \"bottom left\", Bottom = \"bottom\", BottomRight = \"bottom right\",\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ContextMenuDirection.js","sourceRoot":"","sources":["../../../../src/core-react/contextmenu/ContextMenuDirection.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH;;GAEG;AACH,MAAM,CAAN,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,iCAAS,CAAA;IACT,4CAAoB,CAAA;IAAE,mCAAW,CAAA;IAAE,8CAAsB,CAAA;IACzD,qCAAa,CAAA;IAAE,yCAAiB,CAAA;IAAE,uCAAe,CAAA;IACjD,kDAA0B,CAAA;IAAE,yCAAiB,CAAA;IAAE,oDAA4B,CAAA;AAC7E,CAAC,EALW,oBAAoB,KAApB,oBAAoB,QAK/B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ContextMenu\r\n */\r\n\r\n/** Enum to specify where a [[ContextMenu]] should anchor to its parent element\r\n * @public\r\n */\r\nexport enum ContextMenuDirection {\r\n None = \"\",\r\n TopLeft = \"top left\", Top = \"top\", TopRight = \"top right\",\r\n Left = \"left\", Center = \"center\", Right = \"right\",\r\n BottomLeft = \"bottom left\", Bottom = \"bottom\", BottomRight = \"bottom right\",\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenuDivider.js","sourceRoot":"","sources":["../../../../src/core-react/contextmenu/ContextMenuDivider.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AAGpC;;;GAGG;AACH,MAAM,OAAO,kBAAmB,SAAQ,KAAK,CAAC,aAA0B;IACtD,MAAM;QACpB,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC3C,OAAO,CACL,gCAAS,KAAK,iBAAc,2BAA2B,EAAC,SAAS,EAAE,UAAU,CAAC,2BAA2B,EAAE,SAAS,CAAC,GAAI,CAC1H,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ContextMenu\n */\n\nimport * as React from \"react\";\nimport classnames from \"classnames\";\nimport { CommonProps } from \"../utils/Props\";\n\n/**\n * Menu Divider for [[ContextMenu]]. Inserts a line between items, used for list item grouping.\n * @public\n */\nexport class ContextMenuDivider extends React.PureComponent<CommonProps> {\n public override render(): JSX.Element {\n const { className, ...props } = this.props;\n return (\n <div {...props} data-testid=\"core-context-menu-divider\" className={classnames(\"core-context-menu-divider\", className)} />\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ContextMenuDivider.js","sourceRoot":"","sources":["../../../../src/core-react/contextmenu/ContextMenuDivider.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AAGpC;;;GAGG;AACH,MAAM,OAAO,kBAAmB,SAAQ,KAAK,CAAC,aAA0B;IACtD,MAAM;QACpB,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC3C,OAAO,CACL,gCAAS,KAAK,iBAAc,2BAA2B,EAAC,SAAS,EAAE,UAAU,CAAC,2BAA2B,EAAE,SAAS,CAAC,GAAI,CAC1H,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ContextMenu\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport classnames from \"classnames\";\r\nimport { CommonProps } from \"../utils/Props\";\r\n\r\n/**\r\n * Menu Divider for [[ContextMenu]]. Inserts a line between items, used for list item grouping.\r\n * @public\r\n */\r\nexport class ContextMenuDivider extends React.PureComponent<CommonProps> {\r\n public override render(): JSX.Element {\r\n const { className, ...props } = this.props;\r\n return (\r\n <div {...props} data-testid=\"core-context-menu-divider\" className={classnames(\"core-context-menu-divider\", className)} />\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenuItem.js","sourceRoot":"","sources":["../../../../src/core-react/contextmenu/ContextMenuItem.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAa,uBAAuB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGvF,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,E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AC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,mBACd,UAAU,iBACZ,QAAQ;YAEpB,CAAC,iBAAiB,IAAI,6BAAK,SAAS,EAAC,wBAAwB,IAC3D,IAAI,KAAK,SAAS,IAAI,oBAAC,IAAI,IAAC,QAAQ,EAAE,IAAI,GAAI,CAC3C;YACN,6BAAK,SAAS,EAAE,2BAA2B,IACxC,IAAI,CAAC,eAAe,CACjB;YACL,SAAS;gBACR,6BAAK,SAAS,EAAE,UAAU,CAAC,wBAAwB,EAAE,8BAA8B,CAAC;oBAClF,oBAAC,IAAI,IAAC,QAAQ,EAAE,SAAS,GAAI,CACzB;YAEP,KAAK;gBACJ,6BAAK,SAAS,EAAC,yBAAyB,IACrC,KAAK,CACF,CAEJ,CACP,CAAC;IACJ,CAAC;IAEe,iBAAiB;QAC/B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAEe,kBAAkB,CAAC,SAA+B;QAChE,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ,EAAE;YAC9C,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;SACzC;IACH,CAAC;;AAxED,gBAAgB;AACF,4BAAY,GAAkC;IAC1D,QAAQ,EAAE,KAAK;IACf,MAAM,EAAE,KAAK;IACb,UAAU,EAAE,KAAK;CAClB,AAJyB,CAIxB;SATS,eAAe","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ContextMenu\n */\n\nimport * as React from \"react\";\nimport classnames from \"classnames\";\nimport { BadgeType, ConditionalBooleanValue, SpecialKey } from \"@itwin/appui-abstract\";\nimport { CommonProps } from \"../utils/Props\";\nimport { ContextMenu } from \"./ContextMenu\";\nimport { BadgeUtilities } from \"../badge/BadgeUtilities\";\nimport { TildeFinder } from \"./TildeFinder\";\nimport { Icon, IconSpec } from \"../icons/IconComponent\";\n\n/** Properties for the [[ContextMenuItem]] component\n * @public\n */\nexport interface ContextMenuItemProps extends Omit<React.AllHTMLAttributes<HTMLDivElement>, \"disabled\" | \"hidden\">, CommonProps {\n onSelect?: (event: any) => any;\n /** @internal */\n onHotKeyParsed?: (hotKey: string) => void;\n /** Icon to display in the left margin. */\n icon?: IconSpec;\n /** Disables any onSelect calls, hover/keyboard highlighting, and grays item. */\n disabled?: boolean | ConditionalBooleanValue;\n /** Indicates whether the item is visible or hidden. The default is for the item to be visible. */\n hidden?: boolean | ConditionalBooleanValue;\n /** Badge to be overlaid on the item. */\n badgeType?: BadgeType;\n /** Icon to display in the right margin. */\n iconRight?: IconSpec;\n /** Hide the icon container. This can be used to eliminate space used to display an icon at the left of the menu item. */\n hideIconContainer?: boolean;\n /** @internal */\n onHover?: () => any;\n /* @internal */\n isSelected?: boolean;\n /** @internal */\n parentMenu?: ContextMenu;\n}\n\n/** @internal */\ninterface ContextMenuItemState {\n hotKey?: string;\n}\n\n/**\n * Menu Item class for use within a [[ContextMenu]] component.\n * @public\n */\nexport class ContextMenuItem extends React.PureComponent<ContextMenuItemProps, ContextMenuItemState> {\n private _root: HTMLElement | null = null;\n private _lastChildren: React.ReactNode;\n private _parsedChildren: React.ReactNode;\n /** @internal */\n public static defaultProps: Partial<ContextMenuItemProps> = {\n disabled: false,\n hidden: false,\n isSelected: false,\n };\n constructor(props: ContextMenuItemProps) {\n super(props);\n }\n /** @internal */\n public override readonly state: Readonly<ContextMenuItemState> = {};\n public override render(): JSX.Element {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { onClick, className, style, onSelect, icon, disabled, hidden, onHover, isSelected, parentMenu, onHotKeyParsed, badgeType, iconRight,\n hideIconContainer, ...props } = this.props;\n const badge = BadgeUtilities.getComponentForBadgeType(badgeType);\n const isDisabled = ConditionalBooleanValue.getValue(disabled);\n const isHidden = ConditionalBooleanValue.getValue(hidden);\n\n if (this._lastChildren !== this.props.children) {\n this._parsedChildren = TildeFinder.findAfterTilde(this.props.children).node;\n this._lastChildren = this.props.children;\n }\n\n return (\n <div\n {...props}\n ref={(el) => { this._root = el; }}\n onClick={this._handleClick}\n style={style}\n onFocus={this._handleFocus}\n onKeyUp={this._handleKeyUp}\n onMouseOver={this._handleMouseOver}\n data-testid={\"core-context-menu-item\"}\n className={classnames(\"core-context-menu-item\", className,\n isDisabled && \"core-context-menu-disabled\",\n isHidden && \"core-context-menu-hidden\",\n isSelected && \"core-context-menu-is-selected\")\n }\n role=\"menuitem\"\n tabIndex={isSelected ? 0 : -1}\n aria-disabled={isDisabled}\n aria-hidden={isHidden}\n >\n {!hideIconContainer && <div className=\"core-context-menu-icon\">\n {icon !== undefined && <Icon iconSpec={icon} />}\n </div>}\n <div className={\"core-context-menu-content\"}>\n {this._parsedChildren}\n </div>\n {iconRight &&\n <div className={classnames(\"core-context-menu-icon\", \"core-context-menu-icon-right\")}>\n <Icon iconSpec={iconRight} />\n </div>\n }\n {badge &&\n <div className=\"core-context-menu-badge\">\n {badge}\n </div>\n }\n </div>\n );\n }\n\n public override componentDidMount() {\n this._updateHotkey(this.props.children);\n }\n\n public override componentDidUpdate(prevProps: ContextMenuItemProps) {\n if (this.props.children !== prevProps.children) {\n this._updateHotkey(this.props.children);\n }\n }\n\n private _updateHotkey = (node: React.ReactNode) => {\n let hotKey: string | undefined;\n const isDisabled = ConditionalBooleanValue.getValue(this.props.disabled);\n const isHidden = ConditionalBooleanValue.getValue(this.props.hidden);\n if (!isDisabled && !isHidden)\n hotKey = TildeFinder.findAfterTilde(node).character;\n else\n hotKey = undefined;\n if (hotKey && hotKey !== this.state.hotKey) {\n this.setState({ hotKey });\n if (this.props.onHotKeyParsed)\n this.props.onHotKeyParsed(hotKey);\n }\n };\n\n private _handleFocus = (event: React.FocusEvent<HTMLDivElement>) => {\n event.stopPropagation();\n };\n\n private _handleMouseOver = (_event: React.MouseEvent<HTMLDivElement>) => {\n // istanbul ignore else\n if (this._root && this._root.style.visibility !== \"hidden\" && this.props.onHover) {\n this.props.onHover();\n }\n };\n\n public select = () => {\n // istanbul ignore else\n if (this._root) {\n this._root.click();\n if (this.props.parentMenu && this.props.parentMenu.props.parentSubmenu)\n this.props.parentMenu.props.parentSubmenu.close(true);\n }\n };\n\n private _handleClick = (event: React.MouseEvent<HTMLDivElement>) => {\n const isDisabled = ConditionalBooleanValue.getValue(this.props.disabled);\n if (isDisabled)\n return;\n\n if (this.props.onClick)\n this.props.onClick(event);\n if (this.props.onSelect)\n this.props.onSelect(event);\n };\n\n private _handleKeyUp = (event: React.KeyboardEvent<HTMLDivElement>) => {\n const isDisabled = ConditionalBooleanValue.getValue(this.props.disabled);\n if (event.key === SpecialKey.Enter && this.props.onSelect !== undefined && !isDisabled) {\n this.props.onSelect(event);\n }\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ContextMenuItem.js","sourceRoot":"","sources":["../../../../src/core-react/contextmenu/ContextMenuItem.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAa,uBAAuB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGvF,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAY,MAAM,wBAAwB,CAAC;AAkCxD;;;GAGG;AACH,MAAa,eAAgB,SAAQ,KAAK,CAAC,aAAyD;IAUlG,YAAY,KAA2B;QACrC,KAAK,CAAC,KAAK,CAAC,CAAC;QAVP,UAAK,GAAuB,IAAI,CAAC;QAYzC,gBAAgB;QACS,UAAK,GAAmC,EAAE,CAAC;QAgE5D,kBAA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K,SAAS,EAAE,UAAU,CAAC,wBAAwB,EAAE,8BAA8B,CAAC;oBAClF,oBAAC,IAAI,IAAC,QAAQ,EAAE,SAAS,GAAI,CACzB;YAEP,KAAK;gBACJ,6BAAK,SAAS,EAAC,yBAAyB,IACrC,KAAK,CACF,CAEJ,CACP,CAAC;IACJ,CAAC;IAEe,iBAAiB;QAC/B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAEe,kBAAkB,CAAC,SAA+B;QAChE,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ,EAAE;YAC9C,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;SACzC;IACH,CAAC;;AAxED,gBAAgB;AACF,4BAAY,GAAkC;IAC1D,QAAQ,EAAE,KAAK;IACf,MAAM,EAAE,KAAK;IACb,UAAU,EAAE,KAAK;CAClB,AAJyB,CAIxB;SATS,eAAe","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ContextMenu\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport classnames from \"classnames\";\r\nimport { BadgeType, ConditionalBooleanValue, SpecialKey } from \"@itwin/appui-abstract\";\r\nimport { CommonProps } from \"../utils/Props\";\r\nimport { ContextMenu } from \"./ContextMenu\";\r\nimport { BadgeUtilities } from \"../badge/BadgeUtilities\";\r\nimport { TildeFinder } from \"./TildeFinder\";\r\nimport { Icon, IconSpec } from \"../icons/IconComponent\";\r\n\r\n/** Properties for the [[ContextMenuItem]] component\r\n * @public\r\n */\r\nexport interface ContextMenuItemProps extends Omit<React.AllHTMLAttributes<HTMLDivElement>, \"disabled\" | \"hidden\">, CommonProps {\r\n onSelect?: (event: any) => any;\r\n /** @internal */\r\n onHotKeyParsed?: (hotKey: string) => void;\r\n /** Icon to display in the left margin. */\r\n icon?: IconSpec;\r\n /** Disables any onSelect calls, hover/keyboard highlighting, and grays item. */\r\n disabled?: boolean | ConditionalBooleanValue;\r\n /** Indicates whether the item is visible or hidden. The default is for the item to be visible. */\r\n hidden?: boolean | ConditionalBooleanValue;\r\n /** Badge to be overlaid on the item. */\r\n badgeType?: BadgeType;\r\n /** Icon to display in the right margin. */\r\n iconRight?: IconSpec;\r\n /** Hide the icon container. This can be used to eliminate space used to display an icon at the left of the menu item. */\r\n hideIconContainer?: boolean;\r\n /** @internal */\r\n onHover?: () => any;\r\n /* @internal */\r\n isSelected?: boolean;\r\n /** @internal */\r\n parentMenu?: ContextMenu;\r\n}\r\n\r\n/** @internal */\r\ninterface ContextMenuItemState {\r\n hotKey?: string;\r\n}\r\n\r\n/**\r\n * Menu Item class for use within a [[ContextMenu]] component.\r\n * @public\r\n */\r\nexport class ContextMenuItem extends React.PureComponent<ContextMenuItemProps, ContextMenuItemState> {\r\n private _root: HTMLElement | null = null;\r\n private _lastChildren: React.ReactNode;\r\n private _parsedChildren: React.ReactNode;\r\n /** @internal */\r\n public static defaultProps: Partial<ContextMenuItemProps> = {\r\n disabled: false,\r\n hidden: false,\r\n isSelected: false,\r\n };\r\n constructor(props: ContextMenuItemProps) {\r\n super(props);\r\n }\r\n /** @internal */\r\n public override readonly state: Readonly<ContextMenuItemState> = {};\r\n public override render(): JSX.Element {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { onClick, className, style, onSelect, icon, disabled, hidden, onHover, isSelected, parentMenu, onHotKeyParsed, badgeType, iconRight,\r\n hideIconContainer, ...props } = this.props;\r\n const badge = BadgeUtilities.getComponentForBadgeType(badgeType);\r\n const isDisabled = ConditionalBooleanValue.getValue(disabled);\r\n const isHidden = ConditionalBooleanValue.getValue(hidden);\r\n\r\n if (this._lastChildren !== this.props.children) {\r\n this._parsedChildren = TildeFinder.findAfterTilde(this.props.children).node;\r\n this._lastChildren = this.props.children;\r\n }\r\n\r\n return (\r\n <div\r\n {...props}\r\n ref={(el) => { this._root = el; }}\r\n onClick={this._handleClick}\r\n style={style}\r\n onFocus={this._handleFocus}\r\n onKeyUp={this._handleKeyUp}\r\n onMouseOver={this._handleMouseOver}\r\n data-testid={\"core-context-menu-item\"}\r\n className={classnames(\"core-context-menu-item\", className,\r\n isDisabled && \"core-context-menu-disabled\",\r\n isHidden && \"core-context-menu-hidden\",\r\n isSelected && \"core-context-menu-is-selected\")\r\n }\r\n role=\"menuitem\"\r\n tabIndex={isSelected ? 0 : -1}\r\n aria-disabled={isDisabled}\r\n aria-hidden={isHidden}\r\n >\r\n {!hideIconContainer && <div className=\"core-context-menu-icon\">\r\n {icon !== undefined && <Icon iconSpec={icon} />}\r\n </div>}\r\n <div className={\"core-context-menu-content\"}>\r\n {this._parsedChildren}\r\n </div>\r\n {iconRight &&\r\n <div className={classnames(\"core-context-menu-icon\", \"core-context-menu-icon-right\")}>\r\n <Icon iconSpec={iconRight} />\r\n </div>\r\n }\r\n {badge &&\r\n <div className=\"core-context-menu-badge\">\r\n {badge}\r\n </div>\r\n }\r\n </div>\r\n );\r\n }\r\n\r\n public override componentDidMount() {\r\n this._updateHotkey(this.props.children);\r\n }\r\n\r\n public override componentDidUpdate(prevProps: ContextMenuItemProps) {\r\n if (this.props.children !== prevProps.children) {\r\n this._updateHotkey(this.props.children);\r\n }\r\n }\r\n\r\n private _updateHotkey = (node: React.ReactNode) => {\r\n let hotKey: string | undefined;\r\n const isDisabled = ConditionalBooleanValue.getValue(this.props.disabled);\r\n const isHidden = ConditionalBooleanValue.getValue(this.props.hidden);\r\n if (!isDisabled && !isHidden)\r\n hotKey = TildeFinder.findAfterTilde(node).character;\r\n else\r\n hotKey = undefined;\r\n if (hotKey && hotKey !== this.state.hotKey) {\r\n this.setState({ hotKey });\r\n if (this.props.onHotKeyParsed)\r\n this.props.onHotKeyParsed(hotKey);\r\n }\r\n };\r\n\r\n private _handleFocus = (event: React.FocusEvent<HTMLDivElement>) => {\r\n event.stopPropagation();\r\n };\r\n\r\n private _handleMouseOver = (_event: React.MouseEvent<HTMLDivElement>) => {\r\n // istanbul ignore else\r\n if (this._root && this._root.style.visibility !== \"hidden\" && this.props.onHover) {\r\n this.props.onHover();\r\n }\r\n };\r\n\r\n public select = () => {\r\n // istanbul ignore else\r\n if (this._root) {\r\n this._root.click();\r\n if (this.props.parentMenu && this.props.parentMenu.props.parentSubmenu)\r\n this.props.parentMenu.props.parentSubmenu.close(true);\r\n }\r\n };\r\n\r\n private _handleClick = (event: React.MouseEvent<HTMLDivElement>) => {\r\n const isDisabled = ConditionalBooleanValue.getValue(this.props.disabled);\r\n if (isDisabled)\r\n return;\r\n\r\n if (this.props.onClick)\r\n this.props.onClick(event);\r\n if (this.props.onSelect)\r\n this.props.onSelect(event);\r\n };\r\n\r\n private _handleKeyUp = (event: React.KeyboardEvent<HTMLDivElement>) => {\r\n const isDisabled = ConditionalBooleanValue.getValue(this.props.disabled);\r\n if (event.key === SpecialKey.Enter && this.props.onSelect !== undefined && !isDisabled) {\r\n this.props.onSelect(event);\r\n }\r\n };\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextSubMenu.js","sourceRoot":"","sources":["../../../../src/core-react/contextmenu/ContextSubMenu.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAoB,MAAM,eAAe,CAAC;AAE9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CA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AAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SACtC;IACH,CAAC;IAEO,SAAS;QACf,MAAM,EAAE,GAAG,IAAI,CAAC,eAAe,CAAC;QAChC,MAAM,cAAc,GAAG,EAAG,CAAC,aAAa,CAAC;QACzC,OAAO,cAAc,CAAC,WAAW,CAAC;IACpC,CAAC;IAEO,oBAAoB;QAC1B,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAChC,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QACtC,IAAI,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;QAC3C,uBAAuB;QACvB,IAAI,YAAY,IAAI,QAAQ,IAAI,IAAI,CAAC,YAAY,EAAE;YACjD,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;YAC7C,eAAe,GAAG,WAAW,CAAC,QAAQ,CAAC,eAAe,EAAE,QAAQ,EAAE,YAAY,CAAC,UAAU,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;YACrH,uBAAuB;YACvB,IAAI,eAAe,KAAK,IAAI,CAAC,KAAK,CAAC,SAAS;gBAC1C,IAAI,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC,CAAC;SACjD;IACH,CAAC;;AAtHa,2BAAY,GAAiC;IACzD,SAAS,EAAE,oBAAoB,CAAC,WAAW;IAC3C,QAAQ,EAAE,KAAK;IACf,MAAM,EAAE,KAAK;IACb,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE,KAAK;IACjB,aAAa,EAAE,CAAC;CACjB,AAPyB,CAOxB;SAfS,cAAc","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ContextMenu\n */\n\nimport * as React from \"react\";\nimport classnames from \"classnames\";\nimport { ConditionalBooleanValue } from \"@itwin/appui-abstract\";\nimport { ContextMenuItemProps } from \"./ContextMenuItem\";\nimport { ContextMenu, ContextMenuProps } from \"./ContextMenu\";\nimport { CommonProps } from \"../utils/Props\";\nimport { ContextMenuDirection } from \"./ContextMenuDirection\";\nimport { TildeFinder } from \"./TildeFinder\";\nimport { BadgeUtilities } from \"../badge/BadgeUtilities\";\nimport { Icon } from \"../icons/IconComponent\";\nimport { SvgCaretRight } from \"@itwin/itwinui-icons-react\";\n\n/** Properties for the [[ContextSubMenu]] component\n * @public\n */\nexport interface ContextSubMenuProps extends Omit<ContextMenuItemProps, \"label\">, Omit<ContextMenuProps, \"label\">, CommonProps {\n /** Text/jsx to display in the list item */\n label: string | JSX.Element;\n /** @internal */\n onHotKeyParsed?: (hotKey: string) => void;\n}\n\n/** @internal */\ninterface ContextSubMenuState {\n opened: boolean;\n direction: ContextMenuDirection;\n hotKey?: string;\n}\n\n/**\n * Submenu wrapper class for use within a [[ContextMenu]] component.\n * @public\n */\nexport class ContextSubMenu extends React.Component<ContextSubMenuProps, ContextSubMenuState> {\n private _menuElement: ContextMenu | null = null;\n private _subMenuElement: HTMLElement | null = null;\n private _menuButtonElement: HTMLElement | null = null;\n\n private _lastLabel: React.ReactNode;\n private _parsedLabel: React.ReactNode;\n\n public static defaultProps: Partial<ContextSubMenuProps> = {\n direction: ContextMenuDirection.BottomRight,\n disabled: false,\n hidden: false,\n autoflip: true,\n isSelected: false,\n selectedIndex: 0,\n };\n\n /** @internal */\n public override readonly state: Readonly<ContextSubMenuState>;\n constructor(props: ContextSubMenuProps) {\n super(props);\n this.state = {\n opened: false,\n direction: props.direction!,\n };\n }\n\n public override render(): JSX.Element {\n const {\n label,\n opened, direction, onOutsideClick, onEsc, autoflip, edgeLimit, selectedIndex, floating, parentMenu, parentSubmenu, // eslint-disable-line @typescript-eslint/no-unused-vars\n onSelect, icon, disabled, hidden, onHover, isSelected, onHotKeyParsed, // eslint-disable-line @typescript-eslint/no-unused-vars\n children, onClick, className, badgeType, ...props } = this.props; // eslint-disable-line @typescript-eslint/no-unused-vars\n const contextMenuProps = { onOutsideClick, onSelect, onEsc, autoflip, edgeLimit, selectedIndex, floating, parentMenu };\n const badge = BadgeUtilities.getComponentForBadgeType(badgeType);\n const renderDirection = this.state.direction;\n const isDisabled = ConditionalBooleanValue.getValue(disabled);\n const isHidden = ConditionalBooleanValue.getValue(hidden);\n\n if (this._lastLabel !== label) {\n this._parsedLabel = TildeFinder.findAfterTilde(label).node;\n this._lastLabel = label;\n }\n return (\n // eslint-disable-next-line jsx-a11y/mouse-events-have-key-events\n <div className={classnames(\"core-context-submenu\", ContextMenu.getCSSClassNameFromDirection(renderDirection), className)}\n onMouseOver={this._handleMouseOver}\n ref={(el) => { this._subMenuElement = el; }}\n data-testid=\"core-context-submenu\"\n {...props} >\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */}\n <div\n onClick={this._handleClick}\n ref={(el) => { this._menuButtonElement = el; }}\n className={classnames(\"core-context-menu-item\",\n \"core-context-submenu-container\",\n isDisabled && \"core-context-menu-disabled\",\n isHidden && \"core-context-menu-hidden\",\n isSelected && \"core-context-menu-is-selected\")}\n data-testid=\"core-context-submenu-container\"\n role=\"menuitem\"\n tabIndex={isSelected ? 0 : -1}\n aria-disabled={isDisabled}\n aria-hidden={isHidden}\n aria-haspopup={true}\n >\n <div className={classnames(\"core-context-menu-icon\", \"icon\", icon)} />\n <div className={\"core-context-menu-content\"}>{this._parsedLabel}</div>\n <div className={classnames(\"core-context-submenu-arrow\", \"icon\")}><Icon iconSpec={<SvgCaretRight />} /></div>\n {badge &&\n <div className=\"core-context-menu-badge\">\n {badge}\n </div>\n }\n </div>\n <ContextMenu\n ref={(el) => { this._menuElement = el; }}\n className=\"core-context-submenu-popup\"\n opened={this.state.opened}\n direction={renderDirection}\n parentSubmenu={this}\n {...contextMenuProps} >\n {children}\n </ContextMenu>\n </div>\n );\n }\n\n public override componentDidMount() {\n document.addEventListener(\"click\", this._handleClickGlobal);\n this._updateHotkey(this.props.label);\n\n this.checkRenderDirection();\n }\n\n public override componentWillUnmount() {\n document.removeEventListener(\"click\", this._handleClickGlobal);\n }\n\n public override componentDidUpdate(prevProps: ContextSubMenuProps, prevState: ContextSubMenuState) {\n const direction = this.props.direction!;\n if ((this.state.opened !== prevState.opened && direction !== this.state.direction) || prevProps.direction !== direction)\n this.checkRenderDirection();\n if (this.props.label !== prevProps.label) {\n this._updateHotkey(this.props.label);\n }\n }\n\n private getWindow() {\n const el = this._subMenuElement;\n const parentDocument = el!.ownerDocument;\n return parentDocument.defaultView;\n }\n\n private checkRenderDirection() {\n const { autoflip } = this.props;\n const parentWindow = this.getWindow();\n let renderDirection = this.state.direction;\n // istanbul ignore else\n if (parentWindow && autoflip && this._menuElement) {\n const menuRect = this._menuElement.getRect();\n renderDirection = ContextMenu.autoFlip(renderDirection, menuRect, parentWindow.innerWidth, parentWindow.innerHeight);\n // istanbul ignore next\n if (renderDirection !== this.state.direction)\n this.setState({ direction: renderDirection });\n }\n }\n\n private _updateHotkey = (node: React.ReactNode) => {\n let hotKey: string | undefined;\n const isDisabled = ConditionalBooleanValue.getValue(this.props.disabled);\n const isHidden = ConditionalBooleanValue.getValue(this.props.hidden);\n if (!isDisabled && !isHidden)\n hotKey = TildeFinder.findAfterTilde(node).character;\n else\n hotKey = undefined;\n if (hotKey && hotKey !== this.state.hotKey) {\n this.setState({ hotKey });\n if (this.props.onHotKeyParsed)\n this.props.onHotKeyParsed(hotKey);\n }\n };\n\n public select = () => {\n this.setState({ opened: true }, () => {\n // istanbul ignore else\n if (this._menuElement)\n this._menuElement.focus();\n if (this.props.onSelect !== undefined)\n this.props.onSelect(undefined);\n });\n };\n\n public close = (propagate?: boolean) => {\n this.setState({ opened: false }, () => {\n // istanbul ignore else\n if (this._menuElement)\n this._menuElement.blur();\n });\n // istanbul ignore next\n if (propagate && this.props.parentMenu && this.props.parentMenu.props.parentSubmenu) {\n this.props.parentMenu.props.parentSubmenu.close(true);\n }\n };\n\n private _handleMouseOver = (_event: React.MouseEvent<HTMLDivElement>) => {\n // istanbul ignore else\n if (this._menuButtonElement && this._menuButtonElement.style.visibility !== \"hidden\" && this.props.onHover) {\n this.props.onHover();\n }\n };\n\n private _handleClick = (event: any) => {\n event.stopPropagation();\n\n const isDisabled = ConditionalBooleanValue.getValue(this.props.disabled);\n\n // istanbul ignore else\n if (!isDisabled) {\n // istanbul ignore else\n if (this.props.onClick !== undefined)\n this.props.onClick(event);\n // istanbul ignore next\n if (this.props.opened)\n this.close();\n else\n this.select();\n }\n };\n\n private _handleClickGlobal = (event: any) => {\n if (this._subMenuElement && !this._subMenuElement.contains(event.target))\n this.setState((_prevState) => ({ opened: false }));\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ContextSubMenu.js","sourceRoot":"","sources":["../../../../src/core-react/contextmenu/ContextSubMenu.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAoB,MAAM,eAAe,CAAC;AAE9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAmB3D;;;GAGG;AACH,MAAa,cAAe,SAAQ,KAAK,CAAC,SAAmD;IAmB3F,YAAY,KAA0B;QACpC,KAAK,CAAC,KAAK,CAAC,CAAC;QAnBP,iBAAY,GAAuB,IAAI,CAAC;QACxC,oBAAe,GAAuB,IAAI,CA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AK,CAAC;QAChC,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QACtC,IAAI,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;QAC3C,uBAAuB;QACvB,IAAI,YAAY,IAAI,QAAQ,IAAI,IAAI,CAAC,YAAY,EAAE;YACjD,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;YAC7C,eAAe,GAAG,WAAW,CAAC,QAAQ,CAAC,eAAe,EAAE,QAAQ,EAAE,YAAY,CAAC,UAAU,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;YACrH,uBAAuB;YACvB,IAAI,eAAe,KAAK,IAAI,CAAC,KAAK,CAAC,SAAS;gBAC1C,IAAI,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC,CAAC;SACjD;IACH,CAAC;;AAtHa,2BAAY,GAAiC;IACzD,SAAS,EAAE,oBAAoB,CAAC,WAAW;IAC3C,QAAQ,EAAE,KAAK;IACf,MAAM,EAAE,KAAK;IACb,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE,KAAK;IACjB,aAAa,EAAE,CAAC;CACjB,AAPyB,CAOxB;SAfS,cAAc","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ContextMenu\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport classnames from \"classnames\";\r\nimport { ConditionalBooleanValue } from \"@itwin/appui-abstract\";\r\nimport { ContextMenuItemProps } from \"./ContextMenuItem\";\r\nimport { ContextMenu, ContextMenuProps } from \"./ContextMenu\";\r\nimport { CommonProps } from \"../utils/Props\";\r\nimport { ContextMenuDirection } from \"./ContextMenuDirection\";\r\nimport { TildeFinder } from \"./TildeFinder\";\r\nimport { BadgeUtilities } from \"../badge/BadgeUtilities\";\r\nimport { Icon } from \"../icons/IconComponent\";\r\nimport { SvgCaretRight } from \"@itwin/itwinui-icons-react\";\r\n\r\n/** Properties for the [[ContextSubMenu]] component\r\n * @public\r\n */\r\nexport interface ContextSubMenuProps extends Omit<ContextMenuItemProps, \"label\">, Omit<ContextMenuProps, \"label\">, CommonProps {\r\n /** Text/jsx to display in the list item */\r\n label: string | JSX.Element;\r\n /** @internal */\r\n onHotKeyParsed?: (hotKey: string) => void;\r\n}\r\n\r\n/** @internal */\r\ninterface ContextSubMenuState {\r\n opened: boolean;\r\n direction: ContextMenuDirection;\r\n hotKey?: string;\r\n}\r\n\r\n/**\r\n * Submenu wrapper class for use within a [[ContextMenu]] component.\r\n * @public\r\n */\r\nexport class ContextSubMenu extends React.Component<ContextSubMenuProps, ContextSubMenuState> {\r\n private _menuElement: ContextMenu | null = null;\r\n private _subMenuElement: HTMLElement | null = null;\r\n private _menuButtonElement: HTMLElement | null = null;\r\n\r\n private _lastLabel: React.ReactNode;\r\n private _parsedLabel: React.ReactNode;\r\n\r\n public static defaultProps: Partial<ContextSubMenuProps> = {\r\n direction: ContextMenuDirection.BottomRight,\r\n disabled: false,\r\n hidden: false,\r\n autoflip: true,\r\n isSelected: false,\r\n selectedIndex: 0,\r\n };\r\n\r\n /** @internal */\r\n public override readonly state: Readonly<ContextSubMenuState>;\r\n constructor(props: ContextSubMenuProps) {\r\n super(props);\r\n this.state = {\r\n opened: false,\r\n direction: props.direction!,\r\n };\r\n }\r\n\r\n public override render(): JSX.Element {\r\n const {\r\n label,\r\n opened, direction, onOutsideClick, onEsc, autoflip, edgeLimit, selectedIndex, floating, parentMenu, parentSubmenu, // eslint-disable-line @typescript-eslint/no-unused-vars\r\n onSelect, icon, disabled, hidden, onHover, isSelected, onHotKeyParsed, // eslint-disable-line @typescript-eslint/no-unused-vars\r\n children, onClick, className, badgeType, ...props } = this.props; // eslint-disable-line @typescript-eslint/no-unused-vars\r\n const contextMenuProps = { onOutsideClick, onSelect, onEsc, autoflip, edgeLimit, selectedIndex, floating, parentMenu };\r\n const badge = BadgeUtilities.getComponentForBadgeType(badgeType);\r\n const renderDirection = this.state.direction;\r\n const isDisabled = ConditionalBooleanValue.getValue(disabled);\r\n const isHidden = ConditionalBooleanValue.getValue(hidden);\r\n\r\n if (this._lastLabel !== label) {\r\n this._parsedLabel = TildeFinder.findAfterTilde(label).node;\r\n this._lastLabel = label;\r\n }\r\n return (\r\n // eslint-disable-next-line jsx-a11y/mouse-events-have-key-events\r\n <div className={classnames(\"core-context-submenu\", ContextMenu.getCSSClassNameFromDirection(renderDirection), className)}\r\n onMouseOver={this._handleMouseOver}\r\n ref={(el) => { this._subMenuElement = el; }}\r\n data-testid=\"core-context-submenu\"\r\n {...props} >\r\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */}\r\n <div\r\n onClick={this._handleClick}\r\n ref={(el) => { this._menuButtonElement = el; }}\r\n className={classnames(\"core-context-menu-item\",\r\n \"core-context-submenu-container\",\r\n isDisabled && \"core-context-menu-disabled\",\r\n isHidden && \"core-context-menu-hidden\",\r\n isSelected && \"core-context-menu-is-selected\")}\r\n data-testid=\"core-context-submenu-container\"\r\n role=\"menuitem\"\r\n tabIndex={isSelected ? 0 : -1}\r\n aria-disabled={isDisabled}\r\n aria-hidden={isHidden}\r\n aria-haspopup={true}\r\n >\r\n <div className={classnames(\"core-context-menu-icon\", \"icon\", icon)} />\r\n <div className={\"core-context-menu-content\"}>{this._parsedLabel}</div>\r\n <div className={classnames(\"core-context-submenu-arrow\", \"icon\")}><Icon iconSpec={<SvgCaretRight />} /></div>\r\n {badge &&\r\n <div className=\"core-context-menu-badge\">\r\n {badge}\r\n </div>\r\n }\r\n </div>\r\n <ContextMenu\r\n ref={(el) => { this._menuElement = el; }}\r\n className=\"core-context-submenu-popup\"\r\n opened={this.state.opened}\r\n direction={renderDirection}\r\n parentSubmenu={this}\r\n {...contextMenuProps} >\r\n {children}\r\n </ContextMenu>\r\n </div>\r\n );\r\n }\r\n\r\n public override componentDidMount() {\r\n document.addEventListener(\"click\", this._handleClickGlobal);\r\n this._updateHotkey(this.props.label);\r\n\r\n this.checkRenderDirection();\r\n }\r\n\r\n public override componentWillUnmount() {\r\n document.removeEventListener(\"click\", this._handleClickGlobal);\r\n }\r\n\r\n public override componentDidUpdate(prevProps: ContextSubMenuProps, prevState: ContextSubMenuState) {\r\n const direction = this.props.direction!;\r\n if ((this.state.opened !== prevState.opened && direction !== this.state.direction) || prevProps.direction !== direction)\r\n this.checkRenderDirection();\r\n if (this.props.label !== prevProps.label) {\r\n this._updateHotkey(this.props.label);\r\n }\r\n }\r\n\r\n private getWindow() {\r\n const el = this._subMenuElement;\r\n const parentDocument = el!.ownerDocument;\r\n return parentDocument.defaultView;\r\n }\r\n\r\n private checkRenderDirection() {\r\n const { autoflip } = this.props;\r\n const parentWindow = this.getWindow();\r\n let renderDirection = this.state.direction;\r\n // istanbul ignore else\r\n if (parentWindow && autoflip && this._menuElement) {\r\n const menuRect = this._menuElement.getRect();\r\n renderDirection = ContextMenu.autoFlip(renderDirection, menuRect, parentWindow.innerWidth, parentWindow.innerHeight);\r\n // istanbul ignore next\r\n if (renderDirection !== this.state.direction)\r\n this.setState({ direction: renderDirection });\r\n }\r\n }\r\n\r\n private _updateHotkey = (node: React.ReactNode) => {\r\n let hotKey: string | undefined;\r\n const isDisabled = ConditionalBooleanValue.getValue(this.props.disabled);\r\n const isHidden = ConditionalBooleanValue.getValue(this.props.hidden);\r\n if (!isDisabled && !isHidden)\r\n hotKey = TildeFinder.findAfterTilde(node).character;\r\n else\r\n hotKey = undefined;\r\n if (hotKey && hotKey !== this.state.hotKey) {\r\n this.setState({ hotKey });\r\n if (this.props.onHotKeyParsed)\r\n this.props.onHotKeyParsed(hotKey);\r\n }\r\n };\r\n\r\n public select = () => {\r\n this.setState({ opened: true }, () => {\r\n // istanbul ignore else\r\n if (this._menuElement)\r\n this._menuElement.focus();\r\n if (this.props.onSelect !== undefined)\r\n this.props.onSelect(undefined);\r\n });\r\n };\r\n\r\n public close = (propagate?: boolean) => {\r\n this.setState({ opened: false }, () => {\r\n // istanbul ignore else\r\n if (this._menuElement)\r\n this._menuElement.blur();\r\n });\r\n // istanbul ignore next\r\n if (propagate && this.props.parentMenu && this.props.parentMenu.props.parentSubmenu) {\r\n this.props.parentMenu.props.parentSubmenu.close(true);\r\n }\r\n };\r\n\r\n private _handleMouseOver = (_event: React.MouseEvent<HTMLDivElement>) => {\r\n // istanbul ignore else\r\n if (this._menuButtonElement && this._menuButtonElement.style.visibility !== \"hidden\" && this.props.onHover) {\r\n this.props.onHover();\r\n }\r\n };\r\n\r\n private _handleClick = (event: any) => {\r\n event.stopPropagation();\r\n\r\n const isDisabled = ConditionalBooleanValue.getValue(this.props.disabled);\r\n\r\n // istanbul ignore else\r\n if (!isDisabled) {\r\n // istanbul ignore else\r\n if (this.props.onClick !== undefined)\r\n this.props.onClick(event);\r\n // istanbul ignore next\r\n if (this.props.opened)\r\n this.close();\r\n else\r\n this.select();\r\n }\r\n };\r\n\r\n private _handleClickGlobal = (event: any) => {\r\n if (this._subMenuElement && !this._subMenuElement.contains(event.target))\r\n this.setState((_prevState) => ({ opened: false }));\r\n };\r\n}\r\n"]}
|