@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,5 +1,5 @@
|
|
|
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 "./mixins";
|
|
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 "./mixins";
|
|
@@ -1,57 +1,57 @@
|
|
|
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 "../style/index";
|
|
6
|
-
|
|
7
|
-
@mixin uicore-spinner(
|
|
8
|
-
$size,
|
|
9
|
-
$borderSize: $size * 0.125,
|
|
10
|
-
$activeColor: $buic-foreground-primary,
|
|
11
|
-
$selector: "&::after",
|
|
12
|
-
$time: 1.5s
|
|
13
|
-
) {
|
|
14
|
-
// Animation Keyframes
|
|
15
|
-
@keyframes uicoreSpinner {
|
|
16
|
-
0% {
|
|
17
|
-
transform: translate3d(-50%, -50%, 0) rotate(0deg);
|
|
18
|
-
}
|
|
19
|
-
100% {
|
|
20
|
-
transform: translate3d(-50%, -50%, 0) rotate(360deg);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
display: inline-block;
|
|
25
|
-
position: relative;
|
|
26
|
-
|
|
27
|
-
width: $size;
|
|
28
|
-
height: $size;
|
|
29
|
-
|
|
30
|
-
// Styles to fade out spinner when loaded
|
|
31
|
-
&.-loaded {
|
|
32
|
-
opacity: 0;
|
|
33
|
-
transition: opacity linear 0.1s;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// Spinner
|
|
37
|
-
#{$selector} {
|
|
38
|
-
height: $size;
|
|
39
|
-
width: $size;
|
|
40
|
-
|
|
41
|
-
border: solid $borderSize $buic-background-control-stroke;
|
|
42
|
-
border-bottom-color: #{$activeColor};
|
|
43
|
-
border-radius: 50%;
|
|
44
|
-
box-sizing: border-box;
|
|
45
|
-
|
|
46
|
-
content: "";
|
|
47
|
-
opacity: inherit;
|
|
48
|
-
position: absolute;
|
|
49
|
-
left: 50%;
|
|
50
|
-
top: 50%;
|
|
51
|
-
|
|
52
|
-
animation: $time 0.1s linear infinite uicoreSpinner;
|
|
53
|
-
transform: translate3d(-50%, -50%, 0);
|
|
54
|
-
transform-origin: center;
|
|
55
|
-
will-change: transform;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
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 "../style/index";
|
|
6
|
+
|
|
7
|
+
@mixin uicore-spinner(
|
|
8
|
+
$size,
|
|
9
|
+
$borderSize: $size * 0.125,
|
|
10
|
+
$activeColor: $buic-foreground-primary,
|
|
11
|
+
$selector: "&::after",
|
|
12
|
+
$time: 1.5s
|
|
13
|
+
) {
|
|
14
|
+
// Animation Keyframes
|
|
15
|
+
@keyframes uicoreSpinner {
|
|
16
|
+
0% {
|
|
17
|
+
transform: translate3d(-50%, -50%, 0) rotate(0deg);
|
|
18
|
+
}
|
|
19
|
+
100% {
|
|
20
|
+
transform: translate3d(-50%, -50%, 0) rotate(360deg);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
display: inline-block;
|
|
25
|
+
position: relative;
|
|
26
|
+
|
|
27
|
+
width: $size;
|
|
28
|
+
height: $size;
|
|
29
|
+
|
|
30
|
+
// Styles to fade out spinner when loaded
|
|
31
|
+
&.-loaded {
|
|
32
|
+
opacity: 0;
|
|
33
|
+
transition: opacity linear 0.1s;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Spinner
|
|
37
|
+
#{$selector} {
|
|
38
|
+
height: $size;
|
|
39
|
+
width: $size;
|
|
40
|
+
|
|
41
|
+
border: solid $borderSize $buic-background-control-stroke;
|
|
42
|
+
border-bottom-color: #{$activeColor};
|
|
43
|
+
border-radius: 50%;
|
|
44
|
+
box-sizing: border-box;
|
|
45
|
+
|
|
46
|
+
content: "";
|
|
47
|
+
opacity: inherit;
|
|
48
|
+
position: absolute;
|
|
49
|
+
left: 50%;
|
|
50
|
+
top: 50%;
|
|
51
|
+
|
|
52
|
+
animation: $time 0.1s linear infinite uicoreSpinner;
|
|
53
|
+
transform: translate3d(-50%, -50%, 0);
|
|
54
|
+
transform-origin: center;
|
|
55
|
+
will-change: transform;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageBox.js","sourceRoot":"","sources":["../../../../src/core-react/messagebox/MessageBox.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,mBAAmB,CAAC;AAC3B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAmB,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,eAAe,EAAE,qBAAqB,EAAE,cAAc,EAAE,oBAAoB,EAAE,iBAAiB,EAC9I,uBAAuB,EACvB,gBAAgB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACj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pE,MAAM;YACR,KAAK,eAAe,CAAC,OAAO;gBAC1B,QAAQ,GAAG,oBAAC,gBAAgB,OAAG,CAAC,CAAC,8CAA8C;gBAC/E,MAAM;YACR,KAAK,eAAe,CAAC,KAAK;gBACxB,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,oBAAC,oBAAoB,OAAG,CAAC,CAAC,CAAC,oBAAC,cAAc,OAAG,CAAC;gBAClE,MAAM;YACR,KAAK,eAAe,CAAC,KAAK;gBACxB,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,oBAAC,uBAAuB,OAAG,CAAC,CAAC,CAAC,oBAAC,iBAAiB,OAAG,CAAC;gBACxE,MAAM;SACT;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAEe,MAAM;QACpB,MAAM,aAAa,GAAG,UAAU,CAC9B,MAAM,EACN,uBAAuB,CACxB,CAAC;QAEF,MAAM,QAAQ,GAAG,gBAAgB,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAE/D,OAAO,CACL,6BAAK,SAAS,EAAC,4BAA4B;YACzC,6BAAK,SAAS,EAAE,aAAa;gBAAG,oBAAC,IAAI,IAAC,QAAQ,EAAE,QAAQ,GAAI,CAAM;YAClE,6BAAK,SAAS,EAAE,UAAU,CAAC,0BAA0B,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,IAClG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAChB,CACF,CACP,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 Dialog\n */\n\nimport \"./MessageBox.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { DialogButtonDef, MessageSeverity } from \"@itwin/appui-abstract\";\nimport { Dialog } from \"../dialog/Dialog\";\nimport { CommonProps } from \"../utils/Props\";\nimport { SvgHelpCircular, SvgHelpCircularHollow, SvgInfoCircular, SvgInfoCircularHollow, SvgStatusError, SvgStatusErrorHollow, SvgStatusRejected,\n SvgStatusRejectedHollow,\n SvgStatusSuccess, SvgStatusSuccessHollow, SvgStatusWarning } from \"@itwin/itwinui-icons-react\";\nimport { Icon, IconSpec } from \"../icons/IconComponent\";\n\n/** Properties for the [[MessageBox]] component\n * @public\n */\nexport interface MessageBoxProps extends CommonProps {\n /** Severity of MessageBox */\n severity: MessageSeverity;\n /** whether to show dialog or not */\n opened: boolean;\n /** List of [[DialogButtonDef]] objects specifying buttons and associated onClick events */\n buttonCluster: DialogButtonDef[];\n /** Title to show in title bar of dialog */\n title?: string | JSX.Element;\n /** onClick event for X button for dialog */\n onClose?: () => void;\n /** 'keyup' event for <Esc> key */\n onEscape?: () => void;\n /** minimum width that the dialog may be resized to. Default: 400 */\n minWidth?: number;\n /** minimum height that the dialog may be resized to. Default: 400 */\n minHeight?: number;\n /** initial width of dialog.\n * Displayed in px if value is a number, otherwise displayed in specified CSS unit.\n * Default: \"50%\"\n */\n width?: string | number;\n /** initial height of dialog.\n * Displayed in px if value is a number, otherwise displayed in specified CSS unit.\n * Default: \"\"\n */\n height?: string | number;\n /** Whether to show background overlay. Default: true */\n modal?: boolean;\n /** Custom CSS class name for the content */\n contentClassName?: string;\n /** Custom CSS Style for the content */\n contentStyle?: React.CSSProperties;\n /** Message content */\n children?: React.ReactNode;\n}\n\n/** Message Box React component.\n * @public\n */\nexport class MessageBox extends React.PureComponent<MessageBoxProps> {\n public static defaultProps: Partial<MessageBoxProps> = {\n minWidth: 400,\n minHeight: 400,\n width: \"512px\",\n modal: true,\n };\n\n public override render(): JSX.Element {\n return (\n <Dialog\n title={this.props.title}\n buttonCluster={this.props.buttonCluster}\n opened={this.props.opened}\n width={this.props.width}\n onClose={this.props.onClose}\n onEscape={this.props.onEscape}\n modal={this.props.modal}\n className={this.props.className}\n style={this.props.style} >\n <MessageContainer severity={this.props.severity} className={this.props.contentClassName} style={this.props.contentStyle}>\n {this.props.children}\n </MessageContainer>\n </Dialog>\n );\n }\n}\n\n/** Properties for the [[MessageContainer]] component\n * @public\n */\nexport interface MessageContainerProps extends CommonProps {\n severity: MessageSeverity;\n /** Message Content */\n children?: React.ReactNode;\n}\n\n/** Message Container React component.\n * @public\n */\nexport class MessageContainer extends React.PureComponent<MessageContainerProps> {\n /** Returns the class name associated with the WebFont icon corresponding to the MessageSeverity.\n * @param severity MessageSeverity\n * @param _hollow @deprecated in 4.0. Ignored.\n * @deprecated in 4.0. Please use getIcon method\n */\n /* istanbul ignore next */\n public static getIconClassName(severity: MessageSeverity, _hollow?: boolean): string {\n let iconClassName = \"\";\n\n switch (severity) {\n case MessageSeverity.None:\n iconClassName = \"\";\n break;\n case MessageSeverity.Success:\n iconClassName = \"core-message-box-success\";\n break;\n case MessageSeverity.Information:\n iconClassName = \"core-message-box-information\";\n break;\n case MessageSeverity.Question:\n iconClassName = \"core-message-box-question\";\n break;\n case MessageSeverity.Warning:\n iconClassName = \"core-message-box-warning\"; // TODO - need icon-status-warning-hollow icon\n break;\n case MessageSeverity.Error:\n iconClassName = \"core-message-box-error\";\n break;\n case MessageSeverity.Fatal:\n iconClassName = \"core-message-box-fatal\";\n break;\n }\n\n return iconClassName;\n }\n\n /** Returns the React icon corresponding to the MessageSeverity.\n * @param severity MessageSeverity\n * @param hollow set to true to return the hollow form of the icon.\n * @returns IconSpec\n */\n /* ignore for unit tests and replace with visual testing */\n /* istanbul ignore next */\n public static getIcon(severity: MessageSeverity, hollow?: boolean): IconSpec {\n let iconSpec: IconSpec = \"\";\n switch (severity) {\n case MessageSeverity.None:\n iconSpec = \"\";\n break;\n case MessageSeverity.Success:\n iconSpec = hollow ? <SvgStatusSuccessHollow /> : <SvgStatusSuccess />;\n break;\n case MessageSeverity.Information:\n iconSpec = hollow ? <SvgInfoCircularHollow /> : <SvgInfoCircular />;\n break;\n case MessageSeverity.Question:\n iconSpec = hollow ? <SvgHelpCircularHollow /> : <SvgHelpCircular />;\n break;\n case MessageSeverity.Warning:\n iconSpec = <SvgStatusWarning />; // TODO - need icon-status-warning-hollow icon\n break;\n case MessageSeverity.Error:\n iconSpec = hollow ? <SvgStatusErrorHollow /> : <SvgStatusError />;\n break;\n case MessageSeverity.Fatal:\n iconSpec = hollow ? <SvgStatusRejectedHollow /> : <SvgStatusRejected />;\n break;\n }\n return iconSpec;\n }\n\n public override render(): JSX.Element {\n const iconClassName = classnames(\n \"icon\",\n \"core-message-box-icon\"\n );\n\n const iconSpec = MessageContainer.getIcon(this.props.severity);\n\n return (\n <div className=\"core-message-box-container\">\n <div className={iconClassName} ><Icon iconSpec={iconSpec} /></div>\n <div className={classnames(\"core-message-box-content\", this.props.className)} style={this.props.style}>\n {this.props.children}\n </div>\n </div>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"MessageBox.js","sourceRoot":"","sources":["../../../../src/core-react/messagebox/MessageBox.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,mBAAmB,CAAC;AAC3B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAmB,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,eAAe,EAAE,qBAAqB,EAAE,cAAc,EAAE,oBAAoB,EAAE,iBAAiB,EAC9I,uBAAuB,EACvB,gBAAgB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACjG,OAAO,EAAE,IAAI,EAAY,MAAM,wBAAwB,CAAC;AA0CxD;;GAEG;AACH,MAAa,UAAW,SAAQ,KAAK,CAAC,aAA8B;IAQlD,MAAM;QACp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AAK,eAAe,CAAC,KAAK;gBACxB,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,oBAAC,oBAAoB,OAAG,CAAC,CAAC,CAAC,oBAAC,cAAc,OAAG,CAAC;gBAClE,MAAM;YACR,KAAK,eAAe,CAAC,KAAK;gBACxB,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,oBAAC,uBAAuB,OAAG,CAAC,CAAC,CAAC,oBAAC,iBAAiB,OAAG,CAAC;gBACxE,MAAM;SACT;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAEe,MAAM;QACpB,MAAM,aAAa,GAAG,UAAU,CAC9B,MAAM,EACN,uBAAuB,CACxB,CAAC;QAEF,MAAM,QAAQ,GAAG,gBAAgB,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAE/D,OAAO,CACL,6BAAK,SAAS,EAAC,4BAA4B;YACzC,6BAAK,SAAS,EAAE,aAAa;gBAAG,oBAAC,IAAI,IAAC,QAAQ,EAAE,QAAQ,GAAI,CAAM;YAClE,6BAAK,SAAS,EAAE,UAAU,CAAC,0BAA0B,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,IAClG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAChB,CACF,CACP,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 Dialog\r\n */\r\n\r\nimport \"./MessageBox.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { DialogButtonDef, MessageSeverity } from \"@itwin/appui-abstract\";\r\nimport { Dialog } from \"../dialog/Dialog\";\r\nimport { CommonProps } from \"../utils/Props\";\r\nimport { SvgHelpCircular, SvgHelpCircularHollow, SvgInfoCircular, SvgInfoCircularHollow, SvgStatusError, SvgStatusErrorHollow, SvgStatusRejected,\r\n SvgStatusRejectedHollow,\r\n SvgStatusSuccess, SvgStatusSuccessHollow, SvgStatusWarning } from \"@itwin/itwinui-icons-react\";\r\nimport { Icon, IconSpec } from \"../icons/IconComponent\";\r\n\r\n/** Properties for the [[MessageBox]] component\r\n * @public\r\n */\r\nexport interface MessageBoxProps extends CommonProps {\r\n /** Severity of MessageBox */\r\n severity: MessageSeverity;\r\n /** whether to show dialog or not */\r\n opened: boolean;\r\n /** List of [[DialogButtonDef]] objects specifying buttons and associated onClick events */\r\n buttonCluster: DialogButtonDef[];\r\n /** Title to show in title bar of dialog */\r\n title?: string | JSX.Element;\r\n /** onClick event for X button for dialog */\r\n onClose?: () => void;\r\n /** 'keyup' event for <Esc> key */\r\n onEscape?: () => void;\r\n /** minimum width that the dialog may be resized to. Default: 400 */\r\n minWidth?: number;\r\n /** minimum height that the dialog may be resized to. Default: 400 */\r\n minHeight?: number;\r\n /** initial width of dialog.\r\n * Displayed in px if value is a number, otherwise displayed in specified CSS unit.\r\n * Default: \"50%\"\r\n */\r\n width?: string | number;\r\n /** initial height of dialog.\r\n * Displayed in px if value is a number, otherwise displayed in specified CSS unit.\r\n * Default: \"\"\r\n */\r\n height?: string | number;\r\n /** Whether to show background overlay. Default: true */\r\n modal?: boolean;\r\n /** Custom CSS class name for the content */\r\n contentClassName?: string;\r\n /** Custom CSS Style for the content */\r\n contentStyle?: React.CSSProperties;\r\n /** Message content */\r\n children?: React.ReactNode;\r\n}\r\n\r\n/** Message Box React component.\r\n * @public\r\n */\r\nexport class MessageBox extends React.PureComponent<MessageBoxProps> {\r\n public static defaultProps: Partial<MessageBoxProps> = {\r\n minWidth: 400,\r\n minHeight: 400,\r\n width: \"512px\",\r\n modal: true,\r\n };\r\n\r\n public override render(): JSX.Element {\r\n return (\r\n <Dialog\r\n title={this.props.title}\r\n buttonCluster={this.props.buttonCluster}\r\n opened={this.props.opened}\r\n width={this.props.width}\r\n onClose={this.props.onClose}\r\n onEscape={this.props.onEscape}\r\n modal={this.props.modal}\r\n className={this.props.className}\r\n style={this.props.style} >\r\n <MessageContainer severity={this.props.severity} className={this.props.contentClassName} style={this.props.contentStyle}>\r\n {this.props.children}\r\n </MessageContainer>\r\n </Dialog>\r\n );\r\n }\r\n}\r\n\r\n/** Properties for the [[MessageContainer]] component\r\n * @public\r\n */\r\nexport interface MessageContainerProps extends CommonProps {\r\n severity: MessageSeverity;\r\n /** Message Content */\r\n children?: React.ReactNode;\r\n}\r\n\r\n/** Message Container React component.\r\n * @public\r\n */\r\nexport class MessageContainer extends React.PureComponent<MessageContainerProps> {\r\n /** Returns the class name associated with the WebFont icon corresponding to the MessageSeverity.\r\n * @param severity MessageSeverity\r\n * @param _hollow @deprecated in 4.0. Ignored.\r\n * @deprecated in 4.0. Please use getIcon method\r\n */\r\n /* istanbul ignore next */\r\n public static getIconClassName(severity: MessageSeverity, _hollow?: boolean): string {\r\n let iconClassName = \"\";\r\n\r\n switch (severity) {\r\n case MessageSeverity.None:\r\n iconClassName = \"\";\r\n break;\r\n case MessageSeverity.Success:\r\n iconClassName = \"core-message-box-success\";\r\n break;\r\n case MessageSeverity.Information:\r\n iconClassName = \"core-message-box-information\";\r\n break;\r\n case MessageSeverity.Question:\r\n iconClassName = \"core-message-box-question\";\r\n break;\r\n case MessageSeverity.Warning:\r\n iconClassName = \"core-message-box-warning\"; // TODO - need icon-status-warning-hollow icon\r\n break;\r\n case MessageSeverity.Error:\r\n iconClassName = \"core-message-box-error\";\r\n break;\r\n case MessageSeverity.Fatal:\r\n iconClassName = \"core-message-box-fatal\";\r\n break;\r\n }\r\n\r\n return iconClassName;\r\n }\r\n\r\n /** Returns the React icon corresponding to the MessageSeverity.\r\n * @param severity MessageSeverity\r\n * @param hollow set to true to return the hollow form of the icon.\r\n * @returns IconSpec\r\n */\r\n /* ignore for unit tests and replace with visual testing */\r\n /* istanbul ignore next */\r\n public static getIcon(severity: MessageSeverity, hollow?: boolean): IconSpec {\r\n let iconSpec: IconSpec = \"\";\r\n switch (severity) {\r\n case MessageSeverity.None:\r\n iconSpec = \"\";\r\n break;\r\n case MessageSeverity.Success:\r\n iconSpec = hollow ? <SvgStatusSuccessHollow /> : <SvgStatusSuccess />;\r\n break;\r\n case MessageSeverity.Information:\r\n iconSpec = hollow ? <SvgInfoCircularHollow /> : <SvgInfoCircular />;\r\n break;\r\n case MessageSeverity.Question:\r\n iconSpec = hollow ? <SvgHelpCircularHollow /> : <SvgHelpCircular />;\r\n break;\r\n case MessageSeverity.Warning:\r\n iconSpec = <SvgStatusWarning />; // TODO - need icon-status-warning-hollow icon\r\n break;\r\n case MessageSeverity.Error:\r\n iconSpec = hollow ? <SvgStatusErrorHollow /> : <SvgStatusError />;\r\n break;\r\n case MessageSeverity.Fatal:\r\n iconSpec = hollow ? <SvgStatusRejectedHollow /> : <SvgStatusRejected />;\r\n break;\r\n }\r\n return iconSpec;\r\n }\r\n\r\n public override render(): JSX.Element {\r\n const iconClassName = classnames(\r\n \"icon\",\r\n \"core-message-box-icon\"\r\n );\r\n\r\n const iconSpec = MessageContainer.getIcon(this.props.severity);\r\n\r\n return (\r\n <div className=\"core-message-box-container\">\r\n <div className={iconClassName} ><Icon iconSpec={iconSpec} /></div>\r\n <div className={classnames(\"core-message-box-content\", this.props.className)} style={this.props.style}>\r\n {this.props.children}\r\n </div>\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -1,56 +1,56 @@
|
|
|
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 "../style/colors";
|
|
7
|
-
@import "../style/baseline";
|
|
8
|
-
|
|
9
|
-
.core-message-box-container {
|
|
10
|
-
display: flex;
|
|
11
|
-
color: var(--iui-color-text);
|
|
12
|
-
|
|
13
|
-
.core-message-box-icon {
|
|
14
|
-
flex: 0 0;
|
|
15
|
-
font-size: $uicore-icons-medium;
|
|
16
|
-
padding: 0 $uicore-unbordered-padding $uicore-unbordered-padding
|
|
17
|
-
$uicore-unbordered-padding;
|
|
18
|
-
margin-top: 10px;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.core-message-box-content {
|
|
22
|
-
display: flex;
|
|
23
|
-
align-items: center;
|
|
24
|
-
flex: 1 1;
|
|
25
|
-
|
|
26
|
-
a {
|
|
27
|
-
// iTwinUI anchor link style
|
|
28
|
-
color: var(--iui-color-text-accent);
|
|
29
|
-
-webkit-tap-highlight-color: hsl(
|
|
30
|
-
var(--iui-color-accent-hsl) / var(--iui-opacity-6)
|
|
31
|
-
);
|
|
32
|
-
border-radius: var(--iui-border-radius-1);
|
|
33
|
-
cursor: pointer;
|
|
34
|
-
text-decoration: none;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.core-message-box-success {
|
|
40
|
-
color: var(--iui-color-text-positive);
|
|
41
|
-
}
|
|
42
|
-
.core-message-box-information,
|
|
43
|
-
.core-message-box-question {
|
|
44
|
-
color: var(--iui-color-text-informational);
|
|
45
|
-
}
|
|
46
|
-
.core-message-box-warning {
|
|
47
|
-
color: var(--iui-color-text-warning);
|
|
48
|
-
}
|
|
49
|
-
.core-message-box-error,
|
|
50
|
-
.core-message-box-fatal {
|
|
51
|
-
color: var(--iui-color-text-negative);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.notifymessage-icon {
|
|
55
|
-
margin-right: 6px;
|
|
56
|
-
}
|
|
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 "../style/colors";
|
|
7
|
+
@import "../style/baseline";
|
|
8
|
+
|
|
9
|
+
.core-message-box-container {
|
|
10
|
+
display: flex;
|
|
11
|
+
color: var(--iui-color-text);
|
|
12
|
+
|
|
13
|
+
.core-message-box-icon {
|
|
14
|
+
flex: 0 0;
|
|
15
|
+
font-size: $uicore-icons-medium;
|
|
16
|
+
padding: 0 $uicore-unbordered-padding $uicore-unbordered-padding
|
|
17
|
+
$uicore-unbordered-padding;
|
|
18
|
+
margin-top: 10px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.core-message-box-content {
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
flex: 1 1;
|
|
25
|
+
|
|
26
|
+
a {
|
|
27
|
+
// iTwinUI anchor link style
|
|
28
|
+
color: var(--iui-color-text-accent);
|
|
29
|
+
-webkit-tap-highlight-color: hsl(
|
|
30
|
+
var(--iui-color-accent-hsl) / var(--iui-opacity-6)
|
|
31
|
+
);
|
|
32
|
+
border-radius: var(--iui-border-radius-1);
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
text-decoration: none;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.core-message-box-success {
|
|
40
|
+
color: var(--iui-color-text-positive);
|
|
41
|
+
}
|
|
42
|
+
.core-message-box-information,
|
|
43
|
+
.core-message-box-question {
|
|
44
|
+
color: var(--iui-color-text-informational);
|
|
45
|
+
}
|
|
46
|
+
.core-message-box-warning {
|
|
47
|
+
color: var(--iui-color-text-warning);
|
|
48
|
+
}
|
|
49
|
+
.core-message-box-error,
|
|
50
|
+
.core-message-box-fatal {
|
|
51
|
+
color: var(--iui-color-text-negative);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.notifymessage-icon {
|
|
55
|
+
margin-right: 6px;
|
|
56
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"M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AAI,CAAC;KAC9G;SAAM;QACL,0BAA0B;QAC1B,IAAI,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC;YAC/B,WAAW,GAAG,oBAAC,UAAU,IAAC,SAAS,EAAE,KAAK,CAAC,SAAS,IAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAc,CAAC;KAChG;IAED,OAAO,WAAW,CAAC;AACrB,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 Notification\n */\n\nimport * as React from \"react\";\nimport DOMPurify, * as DOMPurifyNS from \"dompurify\";\nimport { isHTMLElement, isReactMessage, MessageType } from \"./MessageType\";\nimport { ClassNameProps } from \"../utils/Props\";\n\n// cSpell:ignore dompurify\n\n/** Properties for the [[MessageRenderer]] component\n * @public\n */\nexport interface MessageRendererProps extends ClassNameProps {\n /** Message to render */\n message: MessageType;\n /** Indicates whether to use a `span` or `div` element for rendering */\n useSpan?: boolean;\n}\n\n/** React component renders a string, HTMLElement or React node in a `div` or `span`\n * @public\n */\nexport function MessageRenderer(props: MessageRendererProps) {\n let messageNode = null;\n const OutElement = props.useSpan ? \"span\" : \"div\";\n\n if (typeof props.message === \"string\") {\n messageNode = <OutElement className={props.className}>{props.message}</OutElement>;\n } else if (isHTMLElement(props.message)) {\n // the esm build of dompurify has a default import but the cjs build does not\n // if there is a default export, use it (likely esm), otherwise use the namespace\n // istanbul ignore next\n const sanitizer = DOMPurify ?? DOMPurifyNS; // `sanitizer` is default function name for \"jam3/no-sanitizer-with-danger\" ESLint rule\n\n let validAnchors = false;\n let hasAnchors = false;\n\n // verify that the tag has proper relationships\n const isAnchorValid = (anchor: HTMLAnchorElement): boolean => {\n return anchor.hasAttribute(\"rel\") && (anchor.rel.includes(\"noopener\") || anchor.rel.includes(\"noreferrer\"));\n };\n\n // recursively check child elements for valid anchor tags\n const checkChildAnchors = (parent: Element) => {\n const children = Array.from(parent.children);\n for (const child of children){\n if (child.hasAttribute(\"target\") && (child as HTMLAnchorElement).target === \"_blank\") {\n hasAnchors = true;\n validAnchors = isAnchorValid(child as HTMLAnchorElement);\n if (!validAnchors) {\n return;\n }\n }\n checkChildAnchors(child);\n }\n };\n\n // check for anchor tags in the message that have target _blank also have a relationship that avoids security holes\n // https://web.dev/external-anchors-use-rel-noopener/\n // first check the message element\n /* istanbul ignore else */\n if (props.message.hasAttribute(\"target\") && (props.message as HTMLAnchorElement).target === \"_blank\") {\n hasAnchors = true;\n validAnchors = isAnchorValid(props.message as HTMLAnchorElement);\n } else {\n // if the message element is not an anchor, recursively verify it's children\n if (props.message.children) {\n checkChildAnchors(props.message);\n }\n }\n\n let sanitizedHtml;\n if (hasAnchors && validAnchors) {\n // all anchors are valid. do not remove the target attr\n sanitizedHtml = sanitizer.sanitize(props.message.outerHTML, {ADD_ATTR: [\"target\"]});\n } else {\n sanitizedHtml = sanitizer.sanitize(props.message.outerHTML);\n }\n\n // we can safely disable jam3/no-sanitizer-with-danger as we are sanitizing above\n // eslint-disable-next-line @typescript-eslint/naming-convention, jam3/no-sanitizer-with-danger\n messageNode = <OutElement className={props.className} dangerouslySetInnerHTML={{ __html: sanitizedHtml }} />;\n } else {\n /* istanbul ignore else */\n if (isReactMessage(props.message))\n messageNode = <OutElement className={props.className}>{props.message.reactNode}</OutElement>;\n }\n\n return messageNode;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"MessageRenderer.js","sourceRoot":"","sources":["../../../../src/core-react/notification/MessageRenderer.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,SAAS,EAAE,KAAK,WAAW,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAe,MAAM,eAAe,CAAC;AAe3E;;GAEG;AACH,MAAM,UAAU,eAA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BACF;gBACD,iBAAiB,CAAC,KAAK,CAAC,CAAC;aAC1B;QACH,CAAC,CAAC;QAEF,mHAAmH;QACnH,qDAAqD;QACrD,kCAAkC;QAClC,0BAA0B;QAC1B,IAAI,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAK,KAAK,CAAC,OAA6B,CAAC,MAAM,KAAK,QAAQ,EAAE;YACpG,UAAU,GAAG,IAAI,CAAC;YAClB,YAAY,GAAG,aAAa,CAAC,KAAK,CAAC,OAA4B,CAAC,CAAC;SAClE;aAAM;YACL,4EAA4E;YAC5E,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE;gBAC1B,iBAAiB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;aAClC;SACF;QAED,IAAI,aAAa,CAAC;QAClB,IAAI,UAAU,IAAI,YAAY,EAAE;YAC9B,uDAAuD;YACvD,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,EAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAC,CAAC,CAAC;SACrF;aAAM;YACL,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;SAC7D;QAED,iFAAiF;QACjF,+FAA+F;QAC/F,WAAW,GAAG,oBAAC,UAAU,IAAC,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,uBAAuB,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,GAAI,CAAC;KAC9G;SAAM;QACL,0BAA0B;QAC1B,IAAI,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC;YAC/B,WAAW,GAAG,oBAAC,UAAU,IAAC,SAAS,EAAE,KAAK,CAAC,SAAS,IAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAc,CAAC;KAChG;IAED,OAAO,WAAW,CAAC;AACrB,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 Notification\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport DOMPurify, * as DOMPurifyNS from \"dompurify\";\r\nimport { isHTMLElement, isReactMessage, MessageType } from \"./MessageType\";\r\nimport { ClassNameProps } from \"../utils/Props\";\r\n\r\n// cSpell:ignore dompurify\r\n\r\n/** Properties for the [[MessageRenderer]] component\r\n * @public\r\n */\r\nexport interface MessageRendererProps extends ClassNameProps {\r\n /** Message to render */\r\n message: MessageType;\r\n /** Indicates whether to use a `span` or `div` element for rendering */\r\n useSpan?: boolean;\r\n}\r\n\r\n/** React component renders a string, HTMLElement or React node in a `div` or `span`\r\n * @public\r\n */\r\nexport function MessageRenderer(props: MessageRendererProps) {\r\n let messageNode = null;\r\n const OutElement = props.useSpan ? \"span\" : \"div\";\r\n\r\n if (typeof props.message === \"string\") {\r\n messageNode = <OutElement className={props.className}>{props.message}</OutElement>;\r\n } else if (isHTMLElement(props.message)) {\r\n // the esm build of dompurify has a default import but the cjs build does not\r\n // if there is a default export, use it (likely esm), otherwise use the namespace\r\n // istanbul ignore next\r\n const sanitizer = DOMPurify ?? DOMPurifyNS; // `sanitizer` is default function name for \"jam3/no-sanitizer-with-danger\" ESLint rule\r\n\r\n let validAnchors = false;\r\n let hasAnchors = false;\r\n\r\n // verify that the tag has proper relationships\r\n const isAnchorValid = (anchor: HTMLAnchorElement): boolean => {\r\n return anchor.hasAttribute(\"rel\") && (anchor.rel.includes(\"noopener\") || anchor.rel.includes(\"noreferrer\"));\r\n };\r\n\r\n // recursively check child elements for valid anchor tags\r\n const checkChildAnchors = (parent: Element) => {\r\n const children = Array.from(parent.children);\r\n for (const child of children){\r\n if (child.hasAttribute(\"target\") && (child as HTMLAnchorElement).target === \"_blank\") {\r\n hasAnchors = true;\r\n validAnchors = isAnchorValid(child as HTMLAnchorElement);\r\n if (!validAnchors) {\r\n return;\r\n }\r\n }\r\n checkChildAnchors(child);\r\n }\r\n };\r\n\r\n // check for anchor tags in the message that have target _blank also have a relationship that avoids security holes\r\n // https://web.dev/external-anchors-use-rel-noopener/\r\n // first check the message element\r\n /* istanbul ignore else */\r\n if (props.message.hasAttribute(\"target\") && (props.message as HTMLAnchorElement).target === \"_blank\") {\r\n hasAnchors = true;\r\n validAnchors = isAnchorValid(props.message as HTMLAnchorElement);\r\n } else {\r\n // if the message element is not an anchor, recursively verify it's children\r\n if (props.message.children) {\r\n checkChildAnchors(props.message);\r\n }\r\n }\r\n\r\n let sanitizedHtml;\r\n if (hasAnchors && validAnchors) {\r\n // all anchors are valid. do not remove the target attr\r\n sanitizedHtml = sanitizer.sanitize(props.message.outerHTML, {ADD_ATTR: [\"target\"]});\r\n } else {\r\n sanitizedHtml = sanitizer.sanitize(props.message.outerHTML);\r\n }\r\n\r\n // we can safely disable jam3/no-sanitizer-with-danger as we are sanitizing above\r\n // eslint-disable-next-line @typescript-eslint/naming-convention, jam3/no-sanitizer-with-danger\r\n messageNode = <OutElement className={props.className} dangerouslySetInnerHTML={{ __html: sanitizedHtml }} />;\r\n } else {\r\n /* istanbul ignore else */\r\n if (isReactMessage(props.message))\r\n messageNode = <OutElement className={props.className}>{props.message.reactNode}</OutElement>;\r\n }\r\n\r\n return messageNode;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageType.js","sourceRoot":"","sources":["../../../../src/core-react/notification/MessageType.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAgBH;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAoB,EAA0B,EAAE;IAC5E,OAAQ,OAAuB,CAAC,SAAS,KAAK,SAAS,CAAC;AAC1D,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAAoB,EAA2B,EAAE;IAC9E,OAAQ,OAAwB,CAAC,SAAS,KAAK,SAAS,CAAC;AAC3D,CAAC,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 Notification\n */\n\nimport * as React from \"react\";\n\n/** Describes a React based message\n * @public\n */\nexport interface ReactMessage {\n reactNode: React.ReactNode;\n}\n\n/** Types for message\n * @public\n */\nexport type MessageType = string | HTMLElement | ReactMessage;\n\n/** HTMLElement type guard.\n * @internal\n */\nexport const isHTMLElement = (message: MessageType): message is HTMLElement => {\n return (message as HTMLElement).outerHTML !== undefined;\n};\n\n/** ReactMessage type guard.\n * @internal\n */\nexport const isReactMessage = (message: MessageType): message is ReactMessage => {\n return (message as ReactMessage).reactNode !== undefined;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"MessageType.js","sourceRoot":"","sources":["../../../../src/core-react/notification/MessageType.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAgBH;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAoB,EAA0B,EAAE;IAC5E,OAAQ,OAAuB,CAAC,SAAS,KAAK,SAAS,CAAC;AAC1D,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAAoB,EAA2B,EAAE;IAC9E,OAAQ,OAAwB,CAAC,SAAS,KAAK,SAAS,CAAC;AAC3D,CAAC,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 Notification\r\n */\r\n\r\nimport * as React from \"react\";\r\n\r\n/** Describes a React based message\r\n * @public\r\n */\r\nexport interface ReactMessage {\r\n reactNode: React.ReactNode;\r\n}\r\n\r\n/** Types for message\r\n * @public\r\n */\r\nexport type MessageType = string | HTMLElement | ReactMessage;\r\n\r\n/** HTMLElement type guard.\r\n * @internal\r\n */\r\nexport const isHTMLElement = (message: MessageType): message is HTMLElement => {\r\n return (message as HTMLElement).outerHTML !== undefined;\r\n};\r\n\r\n/** ReactMessage type guard.\r\n * @internal\r\n */\r\nexport const isReactMessage = (message: MessageType): message is ReactMessage => {\r\n return (message as ReactMessage).reactNode !== undefined;\r\n};\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popup.js","sourceRoot":"","sources":["../../../../src/core-react/popup/Popup.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,cAAc,CAAC;AACtB,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,QAAQ,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAuFnD;;GAEG;AACH,MAAa,KAAM,SAAQ,KAAK,CAAC,SAAiC;IAGhE,YAAY,KAAiB;QAC3B,KAAK,CAAC,KAAK,CAAC,CAAC;QAHP,WAAM,GAAuB,IAAI,CAAC;QAkFlC,sBAAiB,GAAG,GAAG,EAAE;YAC/B,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;YAC5C,YAAY,CAAC,gBAAgB,CAAC,aAAa,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;YACvE,YAAY,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;YACtD,YAAY,CAAC,gBAAgB,CAAC,aAAa,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;YACtE,YAAY,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,KAA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,IAAI,EAAE,IAAI,gBACE,IAAI,EAChB,QAAQ,EAAE,CAAC,CAAC,gBACA,IAAI,CAAC,KAAK,CAAC,SAAS,EAChC,cAAc,EAAE,IAAI,CAAC,mBAAmB;YAExC,oBAAC,SAAS,IAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,mBAAmB,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,uBAAuB,EAAE,IAAI,IAClH,IAAI,CAAC,KAAK,CAAC,QAAQ,CACV,CACR,CACP;QACD,uBAAuB;QACvB,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,aAAa,CAC1C,qCAAqC,CACtC,IAAI,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CACpC,CAAC;IACJ,CAAC;;AArea,kBAAY,GAAwB;IAChD,QAAQ,EAAE,gBAAgB,CAAC,MAAM;IACjC,UAAU,EAAE,IAAI;IAChB,SAAS,EAAE,KAAK;IAChB,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,CAAC;IACT,GAAG,EAAE,CAAC,CAAC;IACP,IAAI,EAAE,CAAC,CAAC;CACT,AARyB,CAQxB;SAzBS,KAAK;AAyflB,SAAS,aAAa,CAAC,KAAa;IAClC,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACnC,OAAO,MAAM,IAAI,CAAC,CAAC;AACrB,CAAC;AAED,SAAS,WAAW,CAAC,KAAa;IAChC,OAAO,KAAK,CAAC,CAAC,CAAC,0BAA0B,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClE,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 Popup\n */\n\nimport \"./Popup.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { RelativePosition, SpecialKey } from \"@itwin/appui-abstract\";\nimport { FocusTrap } from \"../focustrap/FocusTrap\";\nimport { CommonProps } from \"../utils/Props\";\n\n// cSpell:ignore focustrap focusable alertdialog\n\n/** @internal */\ninterface PopupPoint {\n x: number;\n y: number;\n}\n\n/** Properties for the [[Popup]] component\n * @public\n */\nexport interface PopupProps extends CommonProps {\n /** Show or hide the box shadow (defaults to true) */\n showShadow: boolean;\n /** Show or hide the arrow (defaults to false) */\n showArrow: boolean;\n /** Indicates whether the popup is shown or not (defaults to false) */\n isOpen: boolean;\n /** Direction (relative to the target) to which the popup is expanded (defaults to Bottom) */\n position: RelativePosition;\n /** Top position (absolute positioning - defaults to 0) */\n top: number;\n /** Left position (absolute positioning - defaults to 0) */\n left: number;\n /** Function called when the popup is opened */\n onOpen?: () => void;\n /** Function called when user clicks outside the popup */\n onOutsideClick?: (e: MouseEvent) => void;\n /** Function called when the popup is closed */\n onClose?: () => void;\n /** Function called when the popup is closed on Enter */\n onEnter?: () => void;\n /** Function called when the wheel is used */\n onWheel?: (e: WheelEvent) => void;\n /** Function called when the right mouse button is pressed */\n onContextMenu?: (e: MouseEvent) => void;\n /** Offset from the parent (defaults to 4) */\n offset: number;\n /** Target element to position popup */\n target?: HTMLElement | null;\n /** Role - if not specified \"dialog\" is used */\n role?: \"dialog\" | \"alert\" | \"alertdialog\";\n /** accessibility label */\n ariaLabel?: string;\n /** set focus to popup - default to not set focus */\n moveFocus?: boolean;\n /** Element to receive focus, specified by React.RefObject or CSS selector string. If undefined and moveFocus is true then focus is moved to first focusable element. */\n focusTarget?: React.RefObject<HTMLElement> | string;\n /** Indicates whether the popup is pinned. */\n isPinned?: boolean;\n /** Indicates whether to use animation for open/close (defaults to true) */\n animate?: boolean;\n /** Indicates whether to close the popup when Enter is pressed (defaults to true) */\n closeOnEnter?: boolean;\n /** Indicates whether to close the popup when the wheel is used (defaults to true) */\n closeOnWheel?: boolean;\n /** Indicates whether to close the popup when the right mouse button is pressed (defaults to true) */\n closeOnContextMenu?: boolean;\n /** If false outside click processing and closing are skipped if click occurs in another Popup component, default to false. */\n closeOnNestedPopupOutsideClick?: boolean;\n /** If true the children are mounted once and unmounted when this component is unmounted. If false the\n * children are unmounted each time the popup is closed. */\n keepContentsMounted?: boolean;\n\n /**\n * If true the popup will remain open and will be repositioned when window resize events occur, default to false.\n * @beta\n * */\n repositionOnResize?: boolean;\n\n /** Content */\n children?: React.ReactNode;\n}\n\n/** @internal */\ninterface PopupState {\n isOpen: boolean;\n top: number;\n left: number;\n position: RelativePosition;\n parentDocument: Document;\n animationEnded: boolean;\n}\n\n/** Popup React component displays a popup relative to an optional target element.\n * @public\n */\nexport class Popup extends React.Component<PopupProps, PopupState> {\n private _popup: HTMLElement | null = null;\n\n constructor(props: PopupProps) {\n super(props);\n const parentDocument = this.props.target?.ownerDocument ?? document;\n\n this.state = {\n animationEnded: false,\n isOpen: this.props.isOpen,\n top: 0,\n left: 0,\n position: this.props.position,\n parentDocument,\n };\n }\n\n public static defaultProps: Partial<PopupProps> = {\n position: RelativePosition.Bottom,\n showShadow: true,\n showArrow: false,\n isOpen: false,\n offset: 4,\n top: -1,\n left: -1,\n };\n\n public override componentDidMount() {\n if (this.props.isOpen) {\n this._onShow();\n }\n }\n\n private getParentWindow() {\n // istanbul ignore next\n return this.state.parentDocument.defaultView ?? window;\n }\n\n public override componentDidUpdate(previousProps: PopupProps, prevState: PopupState) {\n if (this.state.position !== prevState.position) {\n this.setState( { animationEnded: false });\n }\n\n if (this.props.target !== previousProps.target) {\n // istanbul ignore next\n {\n const parentDocument = this.props.target?.ownerDocument ?? document;\n if (parentDocument !== this.state.parentDocument) {\n this._unBindWindowEvents();\n this.setState({ parentDocument });\n }\n }\n }\n\n if (this.props.isOpen === previousProps.isOpen) {\n if (this.props.isOpen) {\n const position = this._toggleRelativePosition();\n const point = this._fitPopup(this._getPosition(position));\n if ((Math.abs(this.state.left - point.x) < 3) &&\n (Math.abs(this.state.top - point.y) < 3) &&\n this.state.position === position)\n return;\n\n this.setState({\n left: point.x,\n top: point.y,\n position,\n });\n }\n return;\n }\n\n if (this.props.isOpen) {\n this._onShow();\n } else {\n this._onClose();\n }\n }\n\n public override componentWillUnmount() {\n this._unBindWindowEvents();\n }\n\n private _bindWindowEvents = () => {\n const activeWindow = this.getParentWindow();\n activeWindow.addEventListener(\"pointerdown\", this._handleOutsideClick);\n activeWindow.addEventListener(\"resize\", this._resize);\n activeWindow.addEventListener(\"contextmenu\", this._handleContextMenu);\n activeWindow.addEventListener(\"scroll\", this._hide);\n activeWindow.addEventListener(\"wheel\", this._handleWheel);\n activeWindow.addEventListener(\"keydown\", this._handleKeyboard);\n };\n\n private _unBindWindowEvents = () => {\n const activeWindow = this.getParentWindow();\n activeWindow.removeEventListener(\"pointerdown\", this._handleOutsideClick);\n activeWindow.removeEventListener(\"resize\", this._resize);\n activeWindow.removeEventListener(\"contextmenu\", this._handleContextMenu);\n activeWindow.removeEventListener(\"scroll\", this._hide);\n activeWindow.removeEventListener(\"wheel\", this._handleWheel);\n activeWindow.removeEventListener(\"keydown\", this._handleKeyboard);\n };\n\n private _handleWheel = (event: WheelEvent) => {\n if (this._popup && this._popup.contains(event.target as Node))\n return;\n\n if (this.props.onWheel)\n return this.props.onWheel(event);\n\n const closeOnWheel = this.props.closeOnWheel !== undefined ? this.props.closeOnWheel : true;\n if (closeOnWheel)\n this._hide();\n };\n\n private isInCorePopup(element: HTMLElement): boolean {\n if (element.nodeName === \"DIV\") {\n if (element.classList && element.classList.contains(\"core-popup\"))\n return true;\n if (element.parentElement && this.isInCorePopup(element.parentElement))\n return true;\n } else {\n // istanbul ignore else\n if (element.parentElement && this.isInCorePopup(element.parentElement))\n return true;\n }\n return false;\n }\n\n private _handleOutsideClick = (event: MouseEvent): void => {\n if (this._popup && this._popup.contains(event.target as Node))\n return;\n\n if (this.props.isPinned)\n return;\n\n if (!this.props.closeOnNestedPopupOutsideClick && this.isInCorePopup(event.target as HTMLElement))\n return;\n\n if (this.props.onOutsideClick)\n return this.props.onOutsideClick(event);\n\n if (this.props.target && this.props.target.contains(event.target as Node))\n return;\n\n this._onClose();\n };\n\n private _handleContextMenu = (event: MouseEvent) => {\n if (this._popup && this._popup.contains(event.target as Node))\n return;\n\n if (this.props.onContextMenu)\n return this.props.onContextMenu(event);\n\n const closeOnContextMenu = this.props.closeOnContextMenu !== undefined ? this.props.closeOnContextMenu : true;\n if (closeOnContextMenu)\n this._hide();\n };\n\n private _handleKeyboard = (event: KeyboardEvent): void => {\n if (this.props.isPinned)\n return;\n\n if (event.key === SpecialKey.Escape || event.key === SpecialKey.Enter) {\n const closeOnEnter = this.props.closeOnEnter !== undefined ? this.props.closeOnEnter : true;\n if (event.key === SpecialKey.Enter) {\n if (closeOnEnter)\n this._onClose(true);\n else\n this.props.onEnter && this.props.onEnter();\n } else {\n this._onClose(false);\n }\n }\n };\n\n private _resize = () => {\n if (this.props.repositionOnResize) {\n const position = this._toggleRelativePosition();\n const point = this._fitPopup(this._getPosition(position));\n this.setState({ left: point.x, top: point.y, position });\n } else {\n this._hide(); // legacy behavior\n }\n };\n\n private _hide = () => {\n if (this.props.isPinned)\n return;\n\n this._onClose();\n };\n\n private _onShow() {\n this._bindWindowEvents();\n const position = this._toggleRelativePosition();\n const point = this._fitPopup(this._getPosition(position));\n\n this.setState({ left: point.x, top: point.y, isOpen: true, position }, () => {\n if (this.props.onOpen)\n this.props.onOpen();\n });\n }\n\n private _onClose(enterKey?: boolean) {\n if (!this.state.isOpen)\n return;\n\n this._unBindWindowEvents();\n\n this.setState({ isOpen: false }, () => {\n if (enterKey && this.props.onEnter)\n this.props.onEnter();\n if (this.props.onClose)\n this.props.onClose();\n });\n }\n\n private _isPositionAbsolute(): boolean {\n return (this.props.top !== -1 && this.props.left !== -1);\n }\n\n private _getClassNameByPosition(position: RelativePosition): string {\n if (!this._isPositionAbsolute()) {\n switch (position) {\n case RelativePosition.TopLeft:\n return \"core-popup-top-left\";\n case RelativePosition.TopRight:\n return \"core-popup-top-right\";\n case RelativePosition.BottomLeft:\n return \"core-popup-bottom-left\";\n case RelativePosition.BottomRight:\n return \"core-popup-bottom-right\";\n case RelativePosition.Top:\n return \"core-popup-top\";\n case RelativePosition.Left:\n return \"core-popup-left\";\n case RelativePosition.Right:\n return \"core-popup-right\";\n case RelativePosition.Bottom:\n return \"core-popup-bottom\";\n case RelativePosition.LeftTop:\n return \"core-popup-left-top\";\n case RelativePosition.RightTop:\n return \"core-popup-right-top\";\n }\n }\n\n return \"\";\n }\n\n private _getPopupDimensions(): { popupWidth: number, popupHeight: number } {\n let popupWidth = 0;\n let popupHeight = 0;\n // istanbul ignore else\n if (this._popup) {\n const activeWindow = this.getParentWindow();\n const style = activeWindow.getComputedStyle(this._popup);\n const borderLeftWidth = parsePxString(style.borderLeftWidth);\n const borderRightWidth = parsePxString(style.borderRightWidth);\n const borderTopWidth = parsePxString(style.borderTopWidth);\n const borderBottomWidth = parsePxString(style.borderBottomWidth);\n popupWidth = this._popup.clientWidth + borderLeftWidth + borderRightWidth;\n popupHeight = this._popup.clientHeight + borderTopWidth + borderBottomWidth;\n }\n\n return { popupWidth, popupHeight };\n }\n\n private _getPosition = (position: RelativePosition) => {\n const activeWindow = this.getParentWindow();\n const { target, offset, top, left } = this.props;\n const offsetArrow = (this.props.showArrow) ? 6 : 0;\n\n // absolute position\n if (this._isPositionAbsolute())\n return { x: left, y: top };\n\n // sanity check\n const point = { x: 0, y: 0 };\n if (!this._popup || !target)\n return point;\n\n // relative position\n const scrollY = activeWindow.scrollY;\n const scrollX = activeWindow.scrollX;\n\n const targetRect = target.getBoundingClientRect();\n\n const { popupWidth, popupHeight } = this._getPopupDimensions();\n\n switch (position) {\n case RelativePosition.Top:\n point.y = scrollY + targetRect.top - popupHeight - offset - offsetArrow;\n point.x = scrollX + targetRect.left + (targetRect.width / 2) - (popupWidth / 2);\n break;\n\n case RelativePosition.TopLeft:\n point.y = scrollY + targetRect.top - popupHeight - offset - offsetArrow;\n point.x = scrollX + targetRect.left;\n break;\n\n case RelativePosition.TopRight:\n point.y = scrollY + targetRect.top - popupHeight - offset - offsetArrow;\n point.x = scrollX + targetRect.right - popupWidth;\n break;\n\n case RelativePosition.Bottom:\n point.y = scrollY + targetRect.bottom + offset + offsetArrow;\n point.x = scrollX + targetRect.left + (targetRect.width / 2) - (popupWidth / 2);\n break;\n\n case RelativePosition.BottomLeft:\n point.y = scrollY + targetRect.bottom + offset + offsetArrow;\n point.x = scrollX + targetRect.left;\n break;\n\n case RelativePosition.BottomRight:\n point.y = scrollY + targetRect.bottom + offset + offsetArrow;\n point.x = scrollX + targetRect.right - popupWidth;\n break;\n\n case RelativePosition.Left:\n point.y = scrollY + targetRect.top + (targetRect.height / 2) - (popupHeight / 2);\n point.x = scrollX + targetRect.left - popupWidth - offset - offsetArrow;\n break;\n\n case RelativePosition.LeftTop:\n point.y = scrollY + targetRect.top;\n point.x = scrollX + targetRect.left - popupWidth - offset - offsetArrow;\n break;\n\n case RelativePosition.Right:\n point.y = scrollY + targetRect.top + (targetRect.height / 2) - (popupHeight / 2);\n point.x = scrollX + targetRect.right + offset + offsetArrow;\n break;\n\n case RelativePosition.RightTop:\n point.y = scrollY + targetRect.top;\n point.x = scrollX + targetRect.right + offset + offsetArrow;\n break;\n }\n\n return point;\n };\n\n private _toggleRelativePosition(): RelativePosition {\n const { target, position, offset } = this.props;\n\n if (!this._popup || !target)\n return position;\n\n // istanbul ignore if\n if (this._isPositionAbsolute())\n return position;\n\n let newPosition = position;\n\n interface Rect {\n left: number;\n top: number;\n right: number;\n bottom: number;\n }\n\n const activeWindow = this.getParentWindow();\n\n // Note: Cannot use DOMRect yet since it's experimental and not available in all browsers (Nov. 2018)\n const viewportRect: Rect = { left: activeWindow.scrollX, top: activeWindow.scrollY, right: activeWindow.scrollX + activeWindow.innerWidth, bottom: activeWindow.scrollY + activeWindow.innerHeight };\n const targetRect = target.getBoundingClientRect();\n const { popupWidth, popupHeight } = this._getPopupDimensions();\n const containerStyle = activeWindow.getComputedStyle(target);\n const offsetArrow = this.props.showArrow ? /* istanbul ignore next */ 10 : 2;\n\n const bottomMargin = parseMargin(containerStyle.marginBottom);\n if ((targetRect.bottom + popupHeight + bottomMargin + offsetArrow + offset) > viewportRect.bottom) {\n if (newPosition === RelativePosition.Bottom)\n newPosition = RelativePosition.Top;\n else if (newPosition === RelativePosition.BottomLeft)\n newPosition = RelativePosition.TopLeft;\n else if (newPosition === RelativePosition.BottomRight)\n newPosition = RelativePosition.TopRight;\n }\n\n const topMargin = parseMargin(containerStyle.marginTop);\n if ((targetRect.top - popupHeight - topMargin - offsetArrow - offset) < viewportRect.top) {\n if (newPosition === RelativePosition.Top)\n newPosition = RelativePosition.Bottom;\n else if (newPosition === RelativePosition.TopLeft)\n newPosition = RelativePosition.BottomLeft;\n else if (newPosition === RelativePosition.TopRight)\n newPosition = RelativePosition.BottomRight;\n }\n\n const leftMargin = parseMargin(containerStyle.marginLeft);\n if ((targetRect.left - popupWidth - leftMargin - offsetArrow - offset) < viewportRect.left) {\n if (newPosition === RelativePosition.Left)\n newPosition = RelativePosition.Right;\n else if (newPosition === RelativePosition.LeftTop)\n newPosition = RelativePosition.RightTop;\n }\n\n const rightMargin = parseMargin(containerStyle.marginRight);\n if ((targetRect.right + popupWidth + rightMargin + offsetArrow + offset) > viewportRect.right) {\n if (newPosition === RelativePosition.Right)\n newPosition = RelativePosition.Left;\n else if (newPosition === RelativePosition.RightTop)\n newPosition = RelativePosition.LeftTop;\n }\n\n return newPosition;\n }\n\n // fit the popup within the extents of the view port\n private _fitPopup = (point: PopupPoint) => {\n const fittedPoint = point;\n\n // istanbul ignore if\n if (!this._popup) {\n return fittedPoint;\n }\n\n // const popupRect = this._popup.getBoundingClientRect();\n const { popupWidth, popupHeight } = this._getPopupDimensions();\n const { innerWidth, innerHeight } = window;\n\n // istanbul ignore if\n if (fittedPoint.y + popupHeight > innerHeight) {\n fittedPoint.y = innerHeight - popupHeight;\n }\n\n // istanbul ignore if\n if (fittedPoint.x + popupWidth > innerWidth) {\n fittedPoint.x = innerWidth - popupWidth;\n }\n\n // istanbul ignore if\n if (fittedPoint.y < 0) {\n fittedPoint.y = 0;\n }\n\n if (fittedPoint.x < 0) {\n fittedPoint.x = 0;\n }\n\n return fittedPoint;\n };\n\n private _handleAnimationEnd = (event: React.AnimationEvent<HTMLDivElement>) => {\n if (event.target === this._popup) {\n this.setState({ animationEnded: true });\n }\n };\n\n public override render() {\n const animate = this.props.animate !== undefined ? this.props.animate : true;\n const className = classnames(\n \"core-popup\",\n this._getClassNameByPosition(this.state.position),\n this.props.showShadow && \"core-popup-shadow\",\n this.props.showArrow && \"arrow\",\n !animate && \"core-popup-animation-none\",\n this.props.className,\n this.state.animationEnded && \"core-animation-ended\",\n (!this.props.isOpen && this.props.keepContentsMounted) && \"core-popup-hidden\"\n );\n\n const style: React.CSSProperties = {\n top: this.state.top,\n left: this.state.left,\n ...this.props.style,\n };\n\n const role = this.props.role ? this.props.role : \"dialog\"; // accessibility property\n\n if (!this.props.isOpen && !this.props.keepContentsMounted) {\n return null;\n }\n\n return ReactDOM.createPortal(\n (\n <div\n className={className} data-testid=\"core-popup\"\n ref={(element) => { this._popup = element; }}\n style={style}\n role={role}\n aria-modal={true}\n tabIndex={-1}\n aria-label={this.props.ariaLabel}\n onAnimationEnd={this._handleAnimationEnd}\n >\n <FocusTrap active={!!this.props.moveFocus} initialFocusElement={this.props.focusTarget} returnFocusOnDeactivate={true}>\n {this.props.children}\n </FocusTrap>\n </div>\n ),\n // istanbul ignore next\n this.state.parentDocument.body.querySelector(\n '[data-root-container=\"iui-root-id\"]'\n ) ?? this.state.parentDocument.body\n );\n }\n}\n\nfunction parsePxString(pxStr: string): number {\n const parsed = parseInt(pxStr, 10);\n return parsed || 0;\n}\n\nfunction parseMargin(value: string) {\n return value ? /* istanbul ignore next */ parseFloat(value) : 0;\n}\n"]}
|
|
1
|
+
{"version":3,"file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P;QACD,uBAAuB;QACvB,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,aAAa,CAC1C,qCAAqC,CACtC,IAAI,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CACpC,CAAC;IACJ,CAAC;;AArea,kBAAY,GAAwB;IAChD,QAAQ,EAAE,gBAAgB,CAAC,MAAM;IACjC,UAAU,EAAE,IAAI;IAChB,SAAS,EAAE,KAAK;IAChB,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,CAAC;IACT,GAAG,EAAE,CAAC,CAAC;IACP,IAAI,EAAE,CAAC,CAAC;CACT,AARyB,CAQxB;SAzBS,KAAK;AAyflB,SAAS,aAAa,CAAC,KAAa;IAClC,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACnC,OAAO,MAAM,IAAI,CAAC,CAAC;AACrB,CAAC;AAED,SAAS,WAAW,CAAC,KAAa;IAChC,OAAO,KAAK,CAAC,CAAC,CAAC,0BAA0B,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClE,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 Popup\r\n */\r\n\r\nimport \"./Popup.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport * as ReactDOM from \"react-dom\";\r\nimport { RelativePosition, SpecialKey } from \"@itwin/appui-abstract\";\r\nimport { FocusTrap } from \"../focustrap/FocusTrap\";\r\nimport { CommonProps } from \"../utils/Props\";\r\n\r\n// cSpell:ignore focustrap focusable alertdialog\r\n\r\n/** @internal */\r\ninterface PopupPoint {\r\n x: number;\r\n y: number;\r\n}\r\n\r\n/** Properties for the [[Popup]] component\r\n * @public\r\n */\r\nexport interface PopupProps extends CommonProps {\r\n /** Show or hide the box shadow (defaults to true) */\r\n showShadow: boolean;\r\n /** Show or hide the arrow (defaults to false) */\r\n showArrow: boolean;\r\n /** Indicates whether the popup is shown or not (defaults to false) */\r\n isOpen: boolean;\r\n /** Direction (relative to the target) to which the popup is expanded (defaults to Bottom) */\r\n position: RelativePosition;\r\n /** Top position (absolute positioning - defaults to 0) */\r\n top: number;\r\n /** Left position (absolute positioning - defaults to 0) */\r\n left: number;\r\n /** Function called when the popup is opened */\r\n onOpen?: () => void;\r\n /** Function called when user clicks outside the popup */\r\n onOutsideClick?: (e: MouseEvent) => void;\r\n /** Function called when the popup is closed */\r\n onClose?: () => void;\r\n /** Function called when the popup is closed on Enter */\r\n onEnter?: () => void;\r\n /** Function called when the wheel is used */\r\n onWheel?: (e: WheelEvent) => void;\r\n /** Function called when the right mouse button is pressed */\r\n onContextMenu?: (e: MouseEvent) => void;\r\n /** Offset from the parent (defaults to 4) */\r\n offset: number;\r\n /** Target element to position popup */\r\n target?: HTMLElement | null;\r\n /** Role - if not specified \"dialog\" is used */\r\n role?: \"dialog\" | \"alert\" | \"alertdialog\";\r\n /** accessibility label */\r\n ariaLabel?: string;\r\n /** set focus to popup - default to not set focus */\r\n moveFocus?: boolean;\r\n /** Element to receive focus, specified by React.RefObject or CSS selector string. If undefined and moveFocus is true then focus is moved to first focusable element. */\r\n focusTarget?: React.RefObject<HTMLElement> | string;\r\n /** Indicates whether the popup is pinned. */\r\n isPinned?: boolean;\r\n /** Indicates whether to use animation for open/close (defaults to true) */\r\n animate?: boolean;\r\n /** Indicates whether to close the popup when Enter is pressed (defaults to true) */\r\n closeOnEnter?: boolean;\r\n /** Indicates whether to close the popup when the wheel is used (defaults to true) */\r\n closeOnWheel?: boolean;\r\n /** Indicates whether to close the popup when the right mouse button is pressed (defaults to true) */\r\n closeOnContextMenu?: boolean;\r\n /** If false outside click processing and closing are skipped if click occurs in another Popup component, default to false. */\r\n closeOnNestedPopupOutsideClick?: boolean;\r\n /** If true the children are mounted once and unmounted when this component is unmounted. If false the\r\n * children are unmounted each time the popup is closed. */\r\n keepContentsMounted?: boolean;\r\n\r\n /**\r\n * If true the popup will remain open and will be repositioned when window resize events occur, default to false.\r\n * @beta\r\n * */\r\n repositionOnResize?: boolean;\r\n\r\n /** Content */\r\n children?: React.ReactNode;\r\n}\r\n\r\n/** @internal */\r\ninterface PopupState {\r\n isOpen: boolean;\r\n top: number;\r\n left: number;\r\n position: RelativePosition;\r\n parentDocument: Document;\r\n animationEnded: boolean;\r\n}\r\n\r\n/** Popup React component displays a popup relative to an optional target element.\r\n * @public\r\n */\r\nexport class Popup extends React.Component<PopupProps, PopupState> {\r\n private _popup: HTMLElement | null = null;\r\n\r\n constructor(props: PopupProps) {\r\n super(props);\r\n const parentDocument = this.props.target?.ownerDocument ?? document;\r\n\r\n this.state = {\r\n animationEnded: false,\r\n isOpen: this.props.isOpen,\r\n top: 0,\r\n left: 0,\r\n position: this.props.position,\r\n parentDocument,\r\n };\r\n }\r\n\r\n public static defaultProps: Partial<PopupProps> = {\r\n position: RelativePosition.Bottom,\r\n showShadow: true,\r\n showArrow: false,\r\n isOpen: false,\r\n offset: 4,\r\n top: -1,\r\n left: -1,\r\n };\r\n\r\n public override componentDidMount() {\r\n if (this.props.isOpen) {\r\n this._onShow();\r\n }\r\n }\r\n\r\n private getParentWindow() {\r\n // istanbul ignore next\r\n return this.state.parentDocument.defaultView ?? window;\r\n }\r\n\r\n public override componentDidUpdate(previousProps: PopupProps, prevState: PopupState) {\r\n if (this.state.position !== prevState.position) {\r\n this.setState( { animationEnded: false });\r\n }\r\n\r\n if (this.props.target !== previousProps.target) {\r\n // istanbul ignore next\r\n {\r\n const parentDocument = this.props.target?.ownerDocument ?? document;\r\n if (parentDocument !== this.state.parentDocument) {\r\n this._unBindWindowEvents();\r\n this.setState({ parentDocument });\r\n }\r\n }\r\n }\r\n\r\n if (this.props.isOpen === previousProps.isOpen) {\r\n if (this.props.isOpen) {\r\n const position = this._toggleRelativePosition();\r\n const point = this._fitPopup(this._getPosition(position));\r\n if ((Math.abs(this.state.left - point.x) < 3) &&\r\n (Math.abs(this.state.top - point.y) < 3) &&\r\n this.state.position === position)\r\n return;\r\n\r\n this.setState({\r\n left: point.x,\r\n top: point.y,\r\n position,\r\n });\r\n }\r\n return;\r\n }\r\n\r\n if (this.props.isOpen) {\r\n this._onShow();\r\n } else {\r\n this._onClose();\r\n }\r\n }\r\n\r\n public override componentWillUnmount() {\r\n this._unBindWindowEvents();\r\n }\r\n\r\n private _bindWindowEvents = () => {\r\n const activeWindow = this.getParentWindow();\r\n activeWindow.addEventListener(\"pointerdown\", this._handleOutsideClick);\r\n activeWindow.addEventListener(\"resize\", this._resize);\r\n activeWindow.addEventListener(\"contextmenu\", this._handleContextMenu);\r\n activeWindow.addEventListener(\"scroll\", this._hide);\r\n activeWindow.addEventListener(\"wheel\", this._handleWheel);\r\n activeWindow.addEventListener(\"keydown\", this._handleKeyboard);\r\n };\r\n\r\n private _unBindWindowEvents = () => {\r\n const activeWindow = this.getParentWindow();\r\n activeWindow.removeEventListener(\"pointerdown\", this._handleOutsideClick);\r\n activeWindow.removeEventListener(\"resize\", this._resize);\r\n activeWindow.removeEventListener(\"contextmenu\", this._handleContextMenu);\r\n activeWindow.removeEventListener(\"scroll\", this._hide);\r\n activeWindow.removeEventListener(\"wheel\", this._handleWheel);\r\n activeWindow.removeEventListener(\"keydown\", this._handleKeyboard);\r\n };\r\n\r\n private _handleWheel = (event: WheelEvent) => {\r\n if (this._popup && this._popup.contains(event.target as Node))\r\n return;\r\n\r\n if (this.props.onWheel)\r\n return this.props.onWheel(event);\r\n\r\n const closeOnWheel = this.props.closeOnWheel !== undefined ? this.props.closeOnWheel : true;\r\n if (closeOnWheel)\r\n this._hide();\r\n };\r\n\r\n private isInCorePopup(element: HTMLElement): boolean {\r\n if (element.nodeName === \"DIV\") {\r\n if (element.classList && element.classList.contains(\"core-popup\"))\r\n return true;\r\n if (element.parentElement && this.isInCorePopup(element.parentElement))\r\n return true;\r\n } else {\r\n // istanbul ignore else\r\n if (element.parentElement && this.isInCorePopup(element.parentElement))\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n private _handleOutsideClick = (event: MouseEvent): void => {\r\n if (this._popup && this._popup.contains(event.target as Node))\r\n return;\r\n\r\n if (this.props.isPinned)\r\n return;\r\n\r\n if (!this.props.closeOnNestedPopupOutsideClick && this.isInCorePopup(event.target as HTMLElement))\r\n return;\r\n\r\n if (this.props.onOutsideClick)\r\n return this.props.onOutsideClick(event);\r\n\r\n if (this.props.target && this.props.target.contains(event.target as Node))\r\n return;\r\n\r\n this._onClose();\r\n };\r\n\r\n private _handleContextMenu = (event: MouseEvent) => {\r\n if (this._popup && this._popup.contains(event.target as Node))\r\n return;\r\n\r\n if (this.props.onContextMenu)\r\n return this.props.onContextMenu(event);\r\n\r\n const closeOnContextMenu = this.props.closeOnContextMenu !== undefined ? this.props.closeOnContextMenu : true;\r\n if (closeOnContextMenu)\r\n this._hide();\r\n };\r\n\r\n private _handleKeyboard = (event: KeyboardEvent): void => {\r\n if (this.props.isPinned)\r\n return;\r\n\r\n if (event.key === SpecialKey.Escape || event.key === SpecialKey.Enter) {\r\n const closeOnEnter = this.props.closeOnEnter !== undefined ? this.props.closeOnEnter : true;\r\n if (event.key === SpecialKey.Enter) {\r\n if (closeOnEnter)\r\n this._onClose(true);\r\n else\r\n this.props.onEnter && this.props.onEnter();\r\n } else {\r\n this._onClose(false);\r\n }\r\n }\r\n };\r\n\r\n private _resize = () => {\r\n if (this.props.repositionOnResize) {\r\n const position = this._toggleRelativePosition();\r\n const point = this._fitPopup(this._getPosition(position));\r\n this.setState({ left: point.x, top: point.y, position });\r\n } else {\r\n this._hide(); // legacy behavior\r\n }\r\n };\r\n\r\n private _hide = () => {\r\n if (this.props.isPinned)\r\n return;\r\n\r\n this._onClose();\r\n };\r\n\r\n private _onShow() {\r\n this._bindWindowEvents();\r\n const position = this._toggleRelativePosition();\r\n const point = this._fitPopup(this._getPosition(position));\r\n\r\n this.setState({ left: point.x, top: point.y, isOpen: true, position }, () => {\r\n if (this.props.onOpen)\r\n this.props.onOpen();\r\n });\r\n }\r\n\r\n private _onClose(enterKey?: boolean) {\r\n if (!this.state.isOpen)\r\n return;\r\n\r\n this._unBindWindowEvents();\r\n\r\n this.setState({ isOpen: false }, () => {\r\n if (enterKey && this.props.onEnter)\r\n this.props.onEnter();\r\n if (this.props.onClose)\r\n this.props.onClose();\r\n });\r\n }\r\n\r\n private _isPositionAbsolute(): boolean {\r\n return (this.props.top !== -1 && this.props.left !== -1);\r\n }\r\n\r\n private _getClassNameByPosition(position: RelativePosition): string {\r\n if (!this._isPositionAbsolute()) {\r\n switch (position) {\r\n case RelativePosition.TopLeft:\r\n return \"core-popup-top-left\";\r\n case RelativePosition.TopRight:\r\n return \"core-popup-top-right\";\r\n case RelativePosition.BottomLeft:\r\n return \"core-popup-bottom-left\";\r\n case RelativePosition.BottomRight:\r\n return \"core-popup-bottom-right\";\r\n case RelativePosition.Top:\r\n return \"core-popup-top\";\r\n case RelativePosition.Left:\r\n return \"core-popup-left\";\r\n case RelativePosition.Right:\r\n return \"core-popup-right\";\r\n case RelativePosition.Bottom:\r\n return \"core-popup-bottom\";\r\n case RelativePosition.LeftTop:\r\n return \"core-popup-left-top\";\r\n case RelativePosition.RightTop:\r\n return \"core-popup-right-top\";\r\n }\r\n }\r\n\r\n return \"\";\r\n }\r\n\r\n private _getPopupDimensions(): { popupWidth: number, popupHeight: number } {\r\n let popupWidth = 0;\r\n let popupHeight = 0;\r\n // istanbul ignore else\r\n if (this._popup) {\r\n const activeWindow = this.getParentWindow();\r\n const style = activeWindow.getComputedStyle(this._popup);\r\n const borderLeftWidth = parsePxString(style.borderLeftWidth);\r\n const borderRightWidth = parsePxString(style.borderRightWidth);\r\n const borderTopWidth = parsePxString(style.borderTopWidth);\r\n const borderBottomWidth = parsePxString(style.borderBottomWidth);\r\n popupWidth = this._popup.clientWidth + borderLeftWidth + borderRightWidth;\r\n popupHeight = this._popup.clientHeight + borderTopWidth + borderBottomWidth;\r\n }\r\n\r\n return { popupWidth, popupHeight };\r\n }\r\n\r\n private _getPosition = (position: RelativePosition) => {\r\n const activeWindow = this.getParentWindow();\r\n const { target, offset, top, left } = this.props;\r\n const offsetArrow = (this.props.showArrow) ? 6 : 0;\r\n\r\n // absolute position\r\n if (this._isPositionAbsolute())\r\n return { x: left, y: top };\r\n\r\n // sanity check\r\n const point = { x: 0, y: 0 };\r\n if (!this._popup || !target)\r\n return point;\r\n\r\n // relative position\r\n const scrollY = activeWindow.scrollY;\r\n const scrollX = activeWindow.scrollX;\r\n\r\n const targetRect = target.getBoundingClientRect();\r\n\r\n const { popupWidth, popupHeight } = this._getPopupDimensions();\r\n\r\n switch (position) {\r\n case RelativePosition.Top:\r\n point.y = scrollY + targetRect.top - popupHeight - offset - offsetArrow;\r\n point.x = scrollX + targetRect.left + (targetRect.width / 2) - (popupWidth / 2);\r\n break;\r\n\r\n case RelativePosition.TopLeft:\r\n point.y = scrollY + targetRect.top - popupHeight - offset - offsetArrow;\r\n point.x = scrollX + targetRect.left;\r\n break;\r\n\r\n case RelativePosition.TopRight:\r\n point.y = scrollY + targetRect.top - popupHeight - offset - offsetArrow;\r\n point.x = scrollX + targetRect.right - popupWidth;\r\n break;\r\n\r\n case RelativePosition.Bottom:\r\n point.y = scrollY + targetRect.bottom + offset + offsetArrow;\r\n point.x = scrollX + targetRect.left + (targetRect.width / 2) - (popupWidth / 2);\r\n break;\r\n\r\n case RelativePosition.BottomLeft:\r\n point.y = scrollY + targetRect.bottom + offset + offsetArrow;\r\n point.x = scrollX + targetRect.left;\r\n break;\r\n\r\n case RelativePosition.BottomRight:\r\n point.y = scrollY + targetRect.bottom + offset + offsetArrow;\r\n point.x = scrollX + targetRect.right - popupWidth;\r\n break;\r\n\r\n case RelativePosition.Left:\r\n point.y = scrollY + targetRect.top + (targetRect.height / 2) - (popupHeight / 2);\r\n point.x = scrollX + targetRect.left - popupWidth - offset - offsetArrow;\r\n break;\r\n\r\n case RelativePosition.LeftTop:\r\n point.y = scrollY + targetRect.top;\r\n point.x = scrollX + targetRect.left - popupWidth - offset - offsetArrow;\r\n break;\r\n\r\n case RelativePosition.Right:\r\n point.y = scrollY + targetRect.top + (targetRect.height / 2) - (popupHeight / 2);\r\n point.x = scrollX + targetRect.right + offset + offsetArrow;\r\n break;\r\n\r\n case RelativePosition.RightTop:\r\n point.y = scrollY + targetRect.top;\r\n point.x = scrollX + targetRect.right + offset + offsetArrow;\r\n break;\r\n }\r\n\r\n return point;\r\n };\r\n\r\n private _toggleRelativePosition(): RelativePosition {\r\n const { target, position, offset } = this.props;\r\n\r\n if (!this._popup || !target)\r\n return position;\r\n\r\n // istanbul ignore if\r\n if (this._isPositionAbsolute())\r\n return position;\r\n\r\n let newPosition = position;\r\n\r\n interface Rect {\r\n left: number;\r\n top: number;\r\n right: number;\r\n bottom: number;\r\n }\r\n\r\n const activeWindow = this.getParentWindow();\r\n\r\n // Note: Cannot use DOMRect yet since it's experimental and not available in all browsers (Nov. 2018)\r\n const viewportRect: Rect = { left: activeWindow.scrollX, top: activeWindow.scrollY, right: activeWindow.scrollX + activeWindow.innerWidth, bottom: activeWindow.scrollY + activeWindow.innerHeight };\r\n const targetRect = target.getBoundingClientRect();\r\n const { popupWidth, popupHeight } = this._getPopupDimensions();\r\n const containerStyle = activeWindow.getComputedStyle(target);\r\n const offsetArrow = this.props.showArrow ? /* istanbul ignore next */ 10 : 2;\r\n\r\n const bottomMargin = parseMargin(containerStyle.marginBottom);\r\n if ((targetRect.bottom + popupHeight + bottomMargin + offsetArrow + offset) > viewportRect.bottom) {\r\n if (newPosition === RelativePosition.Bottom)\r\n newPosition = RelativePosition.Top;\r\n else if (newPosition === RelativePosition.BottomLeft)\r\n newPosition = RelativePosition.TopLeft;\r\n else if (newPosition === RelativePosition.BottomRight)\r\n newPosition = RelativePosition.TopRight;\r\n }\r\n\r\n const topMargin = parseMargin(containerStyle.marginTop);\r\n if ((targetRect.top - popupHeight - topMargin - offsetArrow - offset) < viewportRect.top) {\r\n if (newPosition === RelativePosition.Top)\r\n newPosition = RelativePosition.Bottom;\r\n else if (newPosition === RelativePosition.TopLeft)\r\n newPosition = RelativePosition.BottomLeft;\r\n else if (newPosition === RelativePosition.TopRight)\r\n newPosition = RelativePosition.BottomRight;\r\n }\r\n\r\n const leftMargin = parseMargin(containerStyle.marginLeft);\r\n if ((targetRect.left - popupWidth - leftMargin - offsetArrow - offset) < viewportRect.left) {\r\n if (newPosition === RelativePosition.Left)\r\n newPosition = RelativePosition.Right;\r\n else if (newPosition === RelativePosition.LeftTop)\r\n newPosition = RelativePosition.RightTop;\r\n }\r\n\r\n const rightMargin = parseMargin(containerStyle.marginRight);\r\n if ((targetRect.right + popupWidth + rightMargin + offsetArrow + offset) > viewportRect.right) {\r\n if (newPosition === RelativePosition.Right)\r\n newPosition = RelativePosition.Left;\r\n else if (newPosition === RelativePosition.RightTop)\r\n newPosition = RelativePosition.LeftTop;\r\n }\r\n\r\n return newPosition;\r\n }\r\n\r\n // fit the popup within the extents of the view port\r\n private _fitPopup = (point: PopupPoint) => {\r\n const fittedPoint = point;\r\n\r\n // istanbul ignore if\r\n if (!this._popup) {\r\n return fittedPoint;\r\n }\r\n\r\n // const popupRect = this._popup.getBoundingClientRect();\r\n const { popupWidth, popupHeight } = this._getPopupDimensions();\r\n const { innerWidth, innerHeight } = window;\r\n\r\n // istanbul ignore if\r\n if (fittedPoint.y + popupHeight > innerHeight) {\r\n fittedPoint.y = innerHeight - popupHeight;\r\n }\r\n\r\n // istanbul ignore if\r\n if (fittedPoint.x + popupWidth > innerWidth) {\r\n fittedPoint.x = innerWidth - popupWidth;\r\n }\r\n\r\n // istanbul ignore if\r\n if (fittedPoint.y < 0) {\r\n fittedPoint.y = 0;\r\n }\r\n\r\n if (fittedPoint.x < 0) {\r\n fittedPoint.x = 0;\r\n }\r\n\r\n return fittedPoint;\r\n };\r\n\r\n private _handleAnimationEnd = (event: React.AnimationEvent<HTMLDivElement>) => {\r\n if (event.target === this._popup) {\r\n this.setState({ animationEnded: true });\r\n }\r\n };\r\n\r\n public override render() {\r\n const animate = this.props.animate !== undefined ? this.props.animate : true;\r\n const className = classnames(\r\n \"core-popup\",\r\n this._getClassNameByPosition(this.state.position),\r\n this.props.showShadow && \"core-popup-shadow\",\r\n this.props.showArrow && \"arrow\",\r\n !animate && \"core-popup-animation-none\",\r\n this.props.className,\r\n this.state.animationEnded && \"core-animation-ended\",\r\n (!this.props.isOpen && this.props.keepContentsMounted) && \"core-popup-hidden\"\r\n );\r\n\r\n const style: React.CSSProperties = {\r\n top: this.state.top,\r\n left: this.state.left,\r\n ...this.props.style,\r\n };\r\n\r\n const role = this.props.role ? this.props.role : \"dialog\"; // accessibility property\r\n\r\n if (!this.props.isOpen && !this.props.keepContentsMounted) {\r\n return null;\r\n }\r\n\r\n return ReactDOM.createPortal(\r\n (\r\n <div\r\n className={className} data-testid=\"core-popup\"\r\n ref={(element) => { this._popup = element; }}\r\n style={style}\r\n role={role}\r\n aria-modal={true}\r\n tabIndex={-1}\r\n aria-label={this.props.ariaLabel}\r\n onAnimationEnd={this._handleAnimationEnd}\r\n >\r\n <FocusTrap active={!!this.props.moveFocus} initialFocusElement={this.props.focusTarget} returnFocusOnDeactivate={true}>\r\n {this.props.children}\r\n </FocusTrap>\r\n </div>\r\n ),\r\n // istanbul ignore next\r\n this.state.parentDocument.body.querySelector(\r\n '[data-root-container=\"iui-root-id\"]'\r\n ) ?? this.state.parentDocument.body\r\n );\r\n }\r\n}\r\n\r\nfunction parsePxString(pxStr: string): number {\r\n const parsed = parseInt(pxStr, 10);\r\n return parsed || 0;\r\n}\r\n\r\nfunction parseMargin(value: string) {\r\n return value ? /* istanbul ignore next */ parseFloat(value) : 0;\r\n}\r\n"]}
|