@itwin/core-react 4.13.4 → 4.14.1
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 +7 -5
- package/lib/cjs/core-react/autosuggest/AutoSuggest.d.ts.map +1 -1
- package/lib/cjs/core-react/autosuggest/AutoSuggest.js +1 -5
- package/lib/cjs/core-react/autosuggest/AutoSuggest.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenu.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenu.js +4 -21
- package/lib/cjs/core-react/contextmenu/ContextMenu.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenu.scss +2 -0
- package/lib/cjs/core-react/contextmenu/ContextMenuItem.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenuItem.js +0 -2
- package/lib/cjs/core-react/contextmenu/ContextMenuItem.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextSubMenu.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextSubMenu.js +2 -11
- package/lib/cjs/core-react/contextmenu/ContextSubMenu.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/GlobalContextMenu.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/GlobalContextMenu.js +1 -5
- package/lib/cjs/core-react/contextmenu/GlobalContextMenu.js.map +1 -1
- package/lib/cjs/core-react/dialog/Dialog.d.ts.map +1 -1
- package/lib/cjs/core-react/dialog/Dialog.js +1 -3
- package/lib/cjs/core-react/dialog/Dialog.js.map +1 -1
- package/lib/cjs/core-react/dialog/GlobalDialog.d.ts.map +1 -1
- package/lib/cjs/core-react/dialog/GlobalDialog.js +0 -1
- package/lib/cjs/core-react/dialog/GlobalDialog.js.map +1 -1
- package/lib/cjs/core-react/elementseparator/ElementSeparator.d.ts.map +1 -1
- package/lib/cjs/core-react/elementseparator/ElementSeparator.js +1 -5
- package/lib/cjs/core-react/elementseparator/ElementSeparator.js.map +1 -1
- package/lib/cjs/core-react/elementseparator/ElementSeparator.scss +1 -0
- package/lib/cjs/core-react/expandable/ExpandableList.d.ts.map +1 -1
- package/lib/cjs/core-react/expandable/ExpandableList.js +0 -1
- package/lib/cjs/core-react/expandable/ExpandableList.js.map +1 -1
- package/lib/cjs/core-react/focus/ItemKeyboardNavigator.d.ts.map +1 -1
- package/lib/cjs/core-react/focus/ItemKeyboardNavigator.js +0 -2
- package/lib/cjs/core-react/focus/ItemKeyboardNavigator.js.map +1 -1
- package/lib/cjs/core-react/focustrap/FocusTrap.d.ts.map +1 -1
- package/lib/cjs/core-react/focustrap/FocusTrap.js +1 -14
- package/lib/cjs/core-react/focustrap/FocusTrap.js.map +1 -1
- package/lib/cjs/core-react/hocs/withOnOutsideClick.d.ts.map +1 -1
- package/lib/cjs/core-react/hocs/withOnOutsideClick.js +0 -6
- package/lib/cjs/core-react/hocs/withOnOutsideClick.js.map +1 -1
- package/lib/cjs/core-react/icons/ConditionalIconItem.d.ts.map +1 -1
- package/lib/cjs/core-react/icons/ConditionalIconItem.js +0 -8
- package/lib/cjs/core-react/icons/ConditionalIconItem.js.map +1 -1
- package/lib/cjs/core-react/icons/IconComponent.d.ts.map +1 -1
- package/lib/cjs/core-react/icons/IconComponent.js +0 -1
- package/lib/cjs/core-react/icons/IconComponent.js.map +1 -1
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.d.ts.map +1 -1
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.js +0 -4
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.js.map +1 -1
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.d.ts.map +1 -1
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.js +0 -1
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.js.map +1 -1
- package/lib/cjs/core-react/listbox/Listbox.d.ts.map +1 -1
- package/lib/cjs/core-react/listbox/Listbox.js +0 -11
- package/lib/cjs/core-react/listbox/Listbox.js.map +1 -1
- package/lib/cjs/core-react/messagebox/MessageBox.js +0 -2
- package/lib/cjs/core-react/messagebox/MessageBox.js.map +1 -1
- package/lib/cjs/core-react/notification/MessageRenderer.d.ts.map +1 -1
- package/lib/cjs/core-react/notification/MessageRenderer.js +0 -3
- package/lib/cjs/core-react/notification/MessageRenderer.js.map +1 -1
- package/lib/cjs/core-react/popup/Popup.d.ts.map +1 -1
- package/lib/cjs/core-react/popup/Popup.js +2 -14
- package/lib/cjs/core-react/popup/Popup.js.map +1 -1
- package/lib/cjs/core-react/radialmenu/Annulus.d.ts.map +1 -1
- package/lib/cjs/core-react/radialmenu/Annulus.js +1 -1
- package/lib/cjs/core-react/radialmenu/Annulus.js.map +1 -1
- package/lib/cjs/core-react/radialmenu/RadialMenu.d.ts +6 -5
- package/lib/cjs/core-react/radialmenu/RadialMenu.d.ts.map +1 -1
- package/lib/cjs/core-react/radialmenu/RadialMenu.js +4 -9
- package/lib/cjs/core-react/radialmenu/RadialMenu.js.map +1 -1
- package/lib/cjs/core-react/searchbox/SearchBox.d.ts.map +1 -1
- package/lib/cjs/core-react/searchbox/SearchBox.js +0 -7
- package/lib/cjs/core-react/searchbox/SearchBox.js.map +1 -1
- package/lib/cjs/core-react/settings/SettingsContainer.d.ts.map +1 -1
- package/lib/cjs/core-react/settings/SettingsContainer.js +0 -1
- package/lib/cjs/core-react/settings/SettingsContainer.js.map +1 -1
- package/lib/cjs/core-react/tabs/Tabs.d.ts.map +1 -1
- package/lib/cjs/core-react/tabs/Tabs.js +0 -4
- package/lib/cjs/core-react/tabs/Tabs.js.map +1 -1
- package/lib/cjs/core-react/text/FilteredText.d.ts.map +1 -1
- package/lib/cjs/core-react/text/FilteredText.js +0 -3
- package/lib/cjs/core-react/text/FilteredText.js.map +1 -1
- package/lib/cjs/core-react/tree/Tree.d.ts.map +1 -1
- package/lib/cjs/core-react/tree/Tree.js +0 -3
- package/lib/cjs/core-react/tree/Tree.js.map +1 -1
- package/lib/cjs/core-react/utils/IconHelper.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/IconHelper.js +0 -8
- package/lib/cjs/core-react/utils/IconHelper.js.map +1 -1
- package/lib/cjs/core-react/utils/IconWebComponent.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/IconWebComponent.js +0 -1
- package/lib/cjs/core-react/utils/IconWebComponent.js.map +1 -1
- package/lib/cjs/core-react/utils/ScrollPositionMaintainer.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/ScrollPositionMaintainer.js +0 -2
- package/lib/cjs/core-react/utils/ScrollPositionMaintainer.js.map +1 -1
- package/lib/cjs/core-react/utils/flattenChildren.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/flattenChildren.js +0 -1
- package/lib/cjs/core-react/utils/flattenChildren.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/ResizeObserverPolyfill.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/ResizeObserverPolyfill.js +0 -1
- package/lib/cjs/core-react/utils/hooks/ResizeObserverPolyfill.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useEventListener.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useEventListener.js +0 -1
- package/lib/cjs/core-react/utils/hooks/useEventListener.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useProximityToMouse.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useProximityToMouse.js +0 -1
- package/lib/cjs/core-react/utils/hooks/useProximityToMouse.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useRefs.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useRefs.js +0 -2
- package/lib/cjs/core-react/utils/hooks/useRefs.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.js +1 -17
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useWidgetOpacityContext.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useWidgetOpacityContext.js +1 -1
- package/lib/cjs/core-react/utils/hooks/useWidgetOpacityContext.js.map +1 -1
- package/lib/esm/core-react/autosuggest/AutoSuggest.d.ts.map +1 -1
- package/lib/esm/core-react/autosuggest/AutoSuggest.js +1 -5
- package/lib/esm/core-react/autosuggest/AutoSuggest.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenu.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenu.js +4 -21
- package/lib/esm/core-react/contextmenu/ContextMenu.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenu.scss +2 -0
- package/lib/esm/core-react/contextmenu/ContextMenuItem.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenuItem.js +0 -2
- package/lib/esm/core-react/contextmenu/ContextMenuItem.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextSubMenu.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextSubMenu.js +2 -11
- package/lib/esm/core-react/contextmenu/ContextSubMenu.js.map +1 -1
- package/lib/esm/core-react/contextmenu/GlobalContextMenu.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/GlobalContextMenu.js +1 -5
- package/lib/esm/core-react/contextmenu/GlobalContextMenu.js.map +1 -1
- package/lib/esm/core-react/dialog/Dialog.d.ts.map +1 -1
- package/lib/esm/core-react/dialog/Dialog.js +1 -3
- package/lib/esm/core-react/dialog/Dialog.js.map +1 -1
- package/lib/esm/core-react/dialog/GlobalDialog.d.ts.map +1 -1
- package/lib/esm/core-react/dialog/GlobalDialog.js +0 -1
- package/lib/esm/core-react/dialog/GlobalDialog.js.map +1 -1
- package/lib/esm/core-react/elementseparator/ElementSeparator.d.ts.map +1 -1
- package/lib/esm/core-react/elementseparator/ElementSeparator.js +1 -5
- package/lib/esm/core-react/elementseparator/ElementSeparator.js.map +1 -1
- package/lib/esm/core-react/elementseparator/ElementSeparator.scss +1 -0
- package/lib/esm/core-react/expandable/ExpandableList.d.ts.map +1 -1
- package/lib/esm/core-react/expandable/ExpandableList.js +0 -1
- package/lib/esm/core-react/expandable/ExpandableList.js.map +1 -1
- package/lib/esm/core-react/focus/ItemKeyboardNavigator.d.ts.map +1 -1
- package/lib/esm/core-react/focus/ItemKeyboardNavigator.js +0 -2
- package/lib/esm/core-react/focus/ItemKeyboardNavigator.js.map +1 -1
- package/lib/esm/core-react/focustrap/FocusTrap.d.ts.map +1 -1
- package/lib/esm/core-react/focustrap/FocusTrap.js +1 -14
- package/lib/esm/core-react/focustrap/FocusTrap.js.map +1 -1
- package/lib/esm/core-react/hocs/withOnOutsideClick.d.ts.map +1 -1
- package/lib/esm/core-react/hocs/withOnOutsideClick.js +0 -6
- package/lib/esm/core-react/hocs/withOnOutsideClick.js.map +1 -1
- package/lib/esm/core-react/icons/ConditionalIconItem.d.ts.map +1 -1
- package/lib/esm/core-react/icons/ConditionalIconItem.js +0 -8
- package/lib/esm/core-react/icons/ConditionalIconItem.js.map +1 -1
- package/lib/esm/core-react/icons/IconComponent.d.ts.map +1 -1
- package/lib/esm/core-react/icons/IconComponent.js +0 -1
- package/lib/esm/core-react/icons/IconComponent.js.map +1 -1
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.d.ts.map +1 -1
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.js +0 -4
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.js.map +1 -1
- package/lib/esm/core-react/inputs/numberinput/NumberInput.d.ts.map +1 -1
- package/lib/esm/core-react/inputs/numberinput/NumberInput.js +0 -1
- package/lib/esm/core-react/inputs/numberinput/NumberInput.js.map +1 -1
- package/lib/esm/core-react/listbox/Listbox.d.ts.map +1 -1
- package/lib/esm/core-react/listbox/Listbox.js +0 -11
- package/lib/esm/core-react/listbox/Listbox.js.map +1 -1
- package/lib/esm/core-react/messagebox/MessageBox.js +0 -2
- package/lib/esm/core-react/messagebox/MessageBox.js.map +1 -1
- package/lib/esm/core-react/notification/MessageRenderer.d.ts.map +1 -1
- package/lib/esm/core-react/notification/MessageRenderer.js +0 -3
- package/lib/esm/core-react/notification/MessageRenderer.js.map +1 -1
- package/lib/esm/core-react/popup/Popup.d.ts.map +1 -1
- package/lib/esm/core-react/popup/Popup.js +2 -14
- package/lib/esm/core-react/popup/Popup.js.map +1 -1
- package/lib/esm/core-react/radialmenu/Annulus.d.ts.map +1 -1
- package/lib/esm/core-react/radialmenu/Annulus.js +1 -1
- package/lib/esm/core-react/radialmenu/Annulus.js.map +1 -1
- package/lib/esm/core-react/radialmenu/RadialMenu.d.ts +6 -5
- package/lib/esm/core-react/radialmenu/RadialMenu.d.ts.map +1 -1
- package/lib/esm/core-react/radialmenu/RadialMenu.js +4 -9
- package/lib/esm/core-react/radialmenu/RadialMenu.js.map +1 -1
- package/lib/esm/core-react/searchbox/SearchBox.d.ts.map +1 -1
- package/lib/esm/core-react/searchbox/SearchBox.js +0 -7
- package/lib/esm/core-react/searchbox/SearchBox.js.map +1 -1
- package/lib/esm/core-react/settings/SettingsContainer.d.ts.map +1 -1
- package/lib/esm/core-react/settings/SettingsContainer.js +0 -1
- package/lib/esm/core-react/settings/SettingsContainer.js.map +1 -1
- package/lib/esm/core-react/tabs/Tabs.d.ts.map +1 -1
- package/lib/esm/core-react/tabs/Tabs.js +0 -4
- package/lib/esm/core-react/tabs/Tabs.js.map +1 -1
- package/lib/esm/core-react/text/FilteredText.d.ts.map +1 -1
- package/lib/esm/core-react/text/FilteredText.js +0 -3
- package/lib/esm/core-react/text/FilteredText.js.map +1 -1
- package/lib/esm/core-react/tree/Tree.d.ts.map +1 -1
- package/lib/esm/core-react/tree/Tree.js +0 -3
- package/lib/esm/core-react/tree/Tree.js.map +1 -1
- package/lib/esm/core-react/utils/IconHelper.d.ts.map +1 -1
- package/lib/esm/core-react/utils/IconHelper.js +0 -8
- package/lib/esm/core-react/utils/IconHelper.js.map +1 -1
- package/lib/esm/core-react/utils/IconWebComponent.d.ts.map +1 -1
- package/lib/esm/core-react/utils/IconWebComponent.js +0 -1
- package/lib/esm/core-react/utils/IconWebComponent.js.map +1 -1
- package/lib/esm/core-react/utils/ScrollPositionMaintainer.d.ts.map +1 -1
- package/lib/esm/core-react/utils/ScrollPositionMaintainer.js +0 -2
- package/lib/esm/core-react/utils/ScrollPositionMaintainer.js.map +1 -1
- package/lib/esm/core-react/utils/flattenChildren.d.ts.map +1 -1
- package/lib/esm/core-react/utils/flattenChildren.js +0 -1
- package/lib/esm/core-react/utils/flattenChildren.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/ResizeObserverPolyfill.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/ResizeObserverPolyfill.js +0 -1
- package/lib/esm/core-react/utils/hooks/ResizeObserverPolyfill.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useEventListener.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useEventListener.js +0 -1
- package/lib/esm/core-react/utils/hooks/useEventListener.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useProximityToMouse.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useProximityToMouse.js +0 -1
- package/lib/esm/core-react/utils/hooks/useProximityToMouse.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useRefs.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useRefs.js +0 -2
- package/lib/esm/core-react/utils/hooks/useRefs.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useResizeObserver.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useResizeObserver.js +1 -17
- package/lib/esm/core-react/utils/hooks/useResizeObserver.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useWidgetOpacityContext.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useWidgetOpacityContext.js +1 -1
- package/lib/esm/core-react/utils/hooks/useWidgetOpacityContext.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageBox.js","sourceRoot":"","sources":["../../../../src/core-react/messagebox/MessageBox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AAS,EAAE,aAAa;gBAC3B,oBAAC,IAAI,IAAC,QAAQ,EAAE,QAAQ,GAAI,CACxB;YACN,6BACE,SAAS,EAAE,UAAU,CACnB,0BAA0B,EAC1B,IAAI,CAAC,KAAK,CAAC,SAAS,CACrB,EACD,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,IAEtB,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 type { DialogButtonDef } from \"@itwin/appui-abstract\";\nimport { MessageSeverity } from \"@itwin/appui-abstract\";\nimport type { CommonProps } from \"../utils/Props\";\nimport {\n SvgHelpCircular,\n SvgHelpCircularHollow,\n SvgInfoCircular,\n SvgInfoCircularHollow,\n SvgStatusError,\n SvgStatusErrorHollow,\n SvgStatusRejected,\n SvgStatusRejectedHollow,\n SvgStatusSuccess,\n SvgStatusSuccessHollow,\n SvgStatusWarning,\n} from \"@itwin/itwinui-icons-react\";\nimport type { IconSpec } from \"../icons/IconComponent\";\nimport { Icon } from \"../icons/IconComponent\";\nimport { Dialog } from \"../dialog/Dialog\";\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 | React.ReactElement;\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(): React.ReactElement {\n return (\n // eslint-disable-next-line deprecation/deprecation\n <Dialog\n title={this.props.title}\n buttonCluster={this.props.buttonCluster}\n opened={this.props.opened}\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 width={this.props.width}\n >\n <MessageContainer\n severity={this.props.severity}\n className={this.props.contentClassName}\n style={this.props.contentStyle}\n >\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 corresponding to the MessageSeverity.\n * @param severity MessageSeverity\n */\n public static getIconClassName(severity: MessageSeverity): string;\n /** Returns the class name associated with the WebFont icon corresponding to the MessageSeverity.\n * @param severity MessageSeverity\n * @param hollow Should the icon be hollow\n * @deprecated in 4.0. Hollow parameter ignored, WebFont is not returned, only the color.\n */\n public static getIconClassName(\n severity: MessageSeverity,\n // eslint-disable-next-line @typescript-eslint/unified-signatures\n hollow?: boolean\n ): string;\n /* istanbul ignore next */\n public static getIconClassName(\n severity: MessageSeverity,\n _hollow?: boolean\n ): 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\";\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(): React.ReactElement {\n const iconClassName = classnames(\n \"icon\",\n \"core-message-box-icon\",\n MessageContainer.getIconClassName(this.props.severity)\n );\n\n const iconSpec = MessageContainer.getIcon(this.props.severity);\n\n return (\n <div className=\"core-message-box-container\">\n <div className={iconClassName}>\n <Icon iconSpec={iconSpec} />\n </div>\n <div\n className={classnames(\n \"core-message-box-content\",\n this.props.className\n )}\n style={this.props.style}\n >\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;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,mBAAmB,CAAC;AAC3B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,eAAe,EACf,qBAAqB,EACrB,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,EACvB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AA0C1C;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,KAAK,CAAC,aAA8B;IAQlD,MAAM;QACpB,OAAO;QACL,mDAAmD;QACnD,oBAAC,MAAM,IACL,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,EACvC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EACzB,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAC3B,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAC7B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS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AAuB,EACvB,gBAAgB,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CACvD,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;gBAC3B,oBAAC,IAAI,IAAC,QAAQ,EAAE,QAAQ,GAAI,CACxB;YACN,6BACE,SAAS,EAAE,UAAU,CACnB,0BAA0B,EAC1B,IAAI,CAAC,KAAK,CAAC,SAAS,CACrB,EACD,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,IAEtB,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 type { DialogButtonDef } from \"@itwin/appui-abstract\";\nimport { MessageSeverity } from \"@itwin/appui-abstract\";\nimport type { CommonProps } from \"../utils/Props\";\nimport {\n SvgHelpCircular,\n SvgHelpCircularHollow,\n SvgInfoCircular,\n SvgInfoCircularHollow,\n SvgStatusError,\n SvgStatusErrorHollow,\n SvgStatusRejected,\n SvgStatusRejectedHollow,\n SvgStatusSuccess,\n SvgStatusSuccessHollow,\n SvgStatusWarning,\n} from \"@itwin/itwinui-icons-react\";\nimport type { IconSpec } from \"../icons/IconComponent\";\nimport { Icon } from \"../icons/IconComponent\";\nimport { Dialog } from \"../dialog/Dialog\";\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 | React.ReactElement;\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(): React.ReactElement {\n return (\n // eslint-disable-next-line deprecation/deprecation\n <Dialog\n title={this.props.title}\n buttonCluster={this.props.buttonCluster}\n opened={this.props.opened}\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 width={this.props.width}\n >\n <MessageContainer\n severity={this.props.severity}\n className={this.props.contentClassName}\n style={this.props.contentStyle}\n >\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 corresponding to the MessageSeverity.\n * @param severity MessageSeverity\n */\n public static getIconClassName(severity: MessageSeverity): string;\n /** Returns the class name associated with the WebFont icon corresponding to the MessageSeverity.\n * @param severity MessageSeverity\n * @param hollow Should the icon be hollow\n * @deprecated in 4.0. Hollow parameter ignored, WebFont is not returned, only the color.\n */\n public static getIconClassName(\n severity: MessageSeverity,\n // eslint-disable-next-line @typescript-eslint/unified-signatures\n hollow?: boolean\n ): string;\n\n public static getIconClassName(\n severity: MessageSeverity,\n _hollow?: boolean\n ): 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\";\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\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(): React.ReactElement {\n const iconClassName = classnames(\n \"icon\",\n \"core-message-box-icon\",\n MessageContainer.getIconClassName(this.props.severity)\n );\n\n const iconSpec = MessageContainer.getIcon(this.props.severity);\n\n return (\n <div className=\"core-message-box-container\">\n <div className={iconClassName}>\n <Icon iconSpec={iconSpec} />\n </div>\n <div\n className={classnames(\n \"core-message-box-content\",\n this.props.className\n )}\n style={this.props.style}\n >\n {this.props.children}\n </div>\n </div>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageRenderer.d.ts","sourceRoot":"","sources":["../../../../src/core-react/notification/MessageRenderer.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAIrD;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,cAAc;IAC1D,wBAAwB;IACxB,OAAO,EAAE,WAAW,CAAC;IACrB,uEAAuE;IACvE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"MessageRenderer.d.ts","sourceRoot":"","sources":["../../../../src/core-react/notification/MessageRenderer.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAIrD;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,cAAc;IAC1D,wBAAwB;IACxB,OAAO,EAAE,WAAW,CAAC;IACrB,uEAAuE;IACvE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,4BAuF1D"}
|
|
@@ -20,7 +20,6 @@ export function MessageRenderer(props) {
|
|
|
20
20
|
else if (isHTMLElement(props.message)) {
|
|
21
21
|
// the esm build of dompurify has a default import but the cjs build does not
|
|
22
22
|
// if there is a default export, use it (likely esm), otherwise use the namespace
|
|
23
|
-
// istanbul ignore next
|
|
24
23
|
const sanitizer = DOMPurify ?? DOMPurifyNS; // `sanitizer` is default function name for "jam3/no-sanitizer-with-danger" ESLint rule
|
|
25
24
|
let validAnchors = false;
|
|
26
25
|
let hasAnchors = false;
|
|
@@ -47,7 +46,6 @@ export function MessageRenderer(props) {
|
|
|
47
46
|
// check for anchor tags in the message that have target _blank also have a relationship that avoids security holes
|
|
48
47
|
// https://web.dev/external-anchors-use-rel-noopener/
|
|
49
48
|
// first check the message element
|
|
50
|
-
/* istanbul ignore else */
|
|
51
49
|
if (props.message.hasAttribute("target") &&
|
|
52
50
|
props.message.target === "_blank") {
|
|
53
51
|
hasAnchors = true;
|
|
@@ -75,7 +73,6 @@ export function MessageRenderer(props) {
|
|
|
75
73
|
dangerouslySetInnerHTML: { __html: sanitizedHtml } }));
|
|
76
74
|
}
|
|
77
75
|
else {
|
|
78
|
-
/* istanbul ignore else */
|
|
79
76
|
if (isReactMessage(props.message))
|
|
80
77
|
messageNode = (React.createElement(OutElement, { className: props.className }, props.message.reactNode));
|
|
81
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageRenderer.js","sourceRoot":"","sources":["../../../../src/core-react/notification/MessageRenderer.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,SAAS,EAAE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CAAC,KAAK,CAAC,OAA4B,CAAC,CAAC;QACnE,CAAC;aAAM,CAAC;YACN,4EAA4E;YAC5E,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;gBAC3B,iBAAiB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACnC,CAAC;QACH,CAAC;QAED,IAAI,aAAa,CAAC;QAClB,IAAI,UAAU,IAAI,YAAY,EAAE,CAAC;YAC/B,uDAAuD;YACvD,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE;gBAC1D,QAAQ,EAAE,CAAC,QAAQ,CAAC;aACrB,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC9D,CAAC;QAED,WAAW,GAAG,CACZ,oBAAC,UAAU,IACT,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,iFAAiF;YACjF,yDAAyD;YACzD,uBAAuB,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,GAClD,CACH,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,IAAI,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC;YAC/B,WAAW,GAAG,CACZ,oBAAC,UAAU,IAAC,SAAS,EAAE,KAAK,CAAC,SAAS,IACnC,KAAK,CAAC,OAAO,CAAC,SAAS,CACb,CACd,CAAC;IACN,CAAC;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 type { MessageType } from \"./MessageType\";\nimport { isHTMLElement, isReactMessage } from \"./MessageType\";\nimport type { 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 = (\n <OutElement className={props.className}>{props.message}</OutElement>\n );\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 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 (\n anchor.hasAttribute(\"rel\") &&\n (anchor.rel.includes(\"noopener\") || anchor.rel.includes(\"noreferrer\"))\n );\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 (\n child.hasAttribute(\"target\") &&\n (child as HTMLAnchorElement).target === \"_blank\"\n ) {\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\n if (\n props.message.hasAttribute(\"target\") &&\n (props.message as HTMLAnchorElement).target === \"_blank\"\n ) {\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, {\n ADD_ATTR: [\"target\"],\n });\n } else {\n sanitizedHtml = sanitizer.sanitize(props.message.outerHTML);\n }\n\n messageNode = (\n <OutElement\n className={props.className}\n // we can safely disable jam3/no-sanitizer-with-danger as we are sanitizing above\n // eslint-disable-next-line jam3/no-sanitizer-with-danger\n dangerouslySetInnerHTML={{ __html: sanitizedHtml }}\n />\n );\n } else {\n if (isReactMessage(props.message))\n messageNode = (\n <OutElement className={props.className}>\n {props.message.reactNode}\n </OutElement>\n );\n }\n\n return messageNode;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popup.d.ts","sourceRoot":"","sources":["../../../../src/core-react/popup/Popup.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,cAAc,CAAC;AAEtB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAWlD;;GAEG;AACH,MAAM,WAAW,UAAW,SAAQ,WAAW;IAC7C,qDAAqD;IACrD,UAAU,EAAE,OAAO,CAAC;IACpB,iDAAiD;IACjD,SAAS,EAAE,OAAO,CAAC;IACnB,sEAAsE;IACtE,MAAM,EAAE,OAAO,CAAC;IAChB,6FAA6F;IAC7F,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,0DAA0D;IAC1D,GAAG,EAAE,MAAM,CAAC;IACZ,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,0DAA0D;IAC1D,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACzC,+CAA+C;IAC/C,OAAO,CAAC,EAAE,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ED;;GAEG;AACH,qBAAa,KAAM,SAAQ,KAAK,CAAC,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC;IAChE,OAAO,CAAC,MAAM,CAA4B;gBAE9B,KAAK,EAAE,UAAU;IAc7B,OAAc,YAAY,EAAE,OAAO,CAAC,UAAU,CAAC,CAQ7C;IAEc,iBAAiB;IAMjC,OAAO,CAAC,eAAe;IAIP,kBAAkB,CAChC,aAAa,EAAE,UAAU,EACzB,SAAS,EAAE,UAAU;IA2CP,oBAAoB;IAIpC,OAAO,CAAC,iBAAiB,CAQvB;IAEF,OAAO,CAAC,mBAAmB,CAQzB;IAEF,OAAO,CAAC,YAAY,CAQlB;IAEF,OAAO,CAAC,aAAa;IAarB,OAAO,CAAC,mBAAmB,CAiBzB;IAEF,OAAO,CAAC,kBAAkB,CAUxB;IAEF,OAAO,CAAC,eAAe,CAgBrB;IAEF,OAAO,CAAC,OAAO,CAQb;IAEF,OAAO,CAAC,KAAK,CAIX;IAEF,OAAO,CAAC,OAAO;IAaf,OAAO,CAAC,QAAQ;IAWhB,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,uBAAuB;IA6B/B,OAAO,CAAC,mBAAmB;IAkB3B,OAAO,CAAC,YAAY,CA8FlB;IAEF,OAAO,CAAC,uBAAuB;IAkF/B,OAAO,CAAC,SAAS,CA4Bf;IAEF,OAAO,CAAC,mBAAmB,CAMzB;IAEc,MAAM;IAsDtB,OAAO,CAAC,YAAY;CAOrB"}
|
|
@@ -188,22 +188,18 @@ export class Popup extends React.Component {
|
|
|
188
188
|
// fit the popup within the extents of the view port
|
|
189
189
|
this._fitPopup = (point) => {
|
|
190
190
|
const fittedPoint = point;
|
|
191
|
-
// istanbul ignore if
|
|
192
191
|
if (!this._popup) {
|
|
193
192
|
return fittedPoint;
|
|
194
193
|
}
|
|
195
194
|
// const popupRect = this._popup.getBoundingClientRect();
|
|
196
195
|
const { popupWidth, popupHeight } = this._getPopupDimensions();
|
|
197
196
|
const { innerWidth, innerHeight } = window;
|
|
198
|
-
// istanbul ignore if
|
|
199
197
|
if (fittedPoint.y + popupHeight > innerHeight) {
|
|
200
198
|
fittedPoint.y = innerHeight - popupHeight;
|
|
201
199
|
}
|
|
202
|
-
// istanbul ignore if
|
|
203
200
|
if (fittedPoint.x + popupWidth > innerWidth) {
|
|
204
201
|
fittedPoint.x = innerWidth - popupWidth;
|
|
205
202
|
}
|
|
206
|
-
// istanbul ignore if
|
|
207
203
|
if (fittedPoint.y < 0) {
|
|
208
204
|
fittedPoint.y = 0;
|
|
209
205
|
}
|
|
@@ -233,7 +229,6 @@ export class Popup extends React.Component {
|
|
|
233
229
|
}
|
|
234
230
|
}
|
|
235
231
|
getParentWindow() {
|
|
236
|
-
// istanbul ignore next
|
|
237
232
|
return this.state.parentDocument.defaultView ?? window;
|
|
238
233
|
}
|
|
239
234
|
componentDidUpdate(previousProps, prevState) {
|
|
@@ -241,7 +236,6 @@ export class Popup extends React.Component {
|
|
|
241
236
|
this.setState({ animationEnded: false });
|
|
242
237
|
}
|
|
243
238
|
if (this.props.target !== previousProps.target) {
|
|
244
|
-
// istanbul ignore next
|
|
245
239
|
{
|
|
246
240
|
const parentDocument = this.props.target?.ownerDocument ?? document;
|
|
247
241
|
if (parentDocument !== this.state.parentDocument) {
|
|
@@ -284,7 +278,6 @@ export class Popup extends React.Component {
|
|
|
284
278
|
return true;
|
|
285
279
|
}
|
|
286
280
|
else {
|
|
287
|
-
// istanbul ignore else
|
|
288
281
|
if (element.parentElement && this.isInCorePopup(element.parentElement))
|
|
289
282
|
return true;
|
|
290
283
|
}
|
|
@@ -343,7 +336,6 @@ export class Popup extends React.Component {
|
|
|
343
336
|
_getPopupDimensions() {
|
|
344
337
|
let popupWidth = 0;
|
|
345
338
|
let popupHeight = 0;
|
|
346
|
-
// istanbul ignore else
|
|
347
339
|
if (this._popup) {
|
|
348
340
|
const activeWindow = this.getParentWindow();
|
|
349
341
|
const style = activeWindow.getComputedStyle(this._popup);
|
|
@@ -361,7 +353,6 @@ export class Popup extends React.Component {
|
|
|
361
353
|
const { target, position, offset } = this.props;
|
|
362
354
|
if (!this._popup || !target)
|
|
363
355
|
return position;
|
|
364
|
-
// istanbul ignore if
|
|
365
356
|
if (this._isPositionAbsolute())
|
|
366
357
|
return position;
|
|
367
358
|
let newPosition = position;
|
|
@@ -376,9 +367,7 @@ export class Popup extends React.Component {
|
|
|
376
367
|
const targetRect = target.getBoundingClientRect();
|
|
377
368
|
const { popupWidth, popupHeight } = this._getPopupDimensions();
|
|
378
369
|
const containerStyle = activeWindow.getComputedStyle(target);
|
|
379
|
-
const offsetArrow = this.props.showArrow
|
|
380
|
-
? /* istanbul ignore next */ 10
|
|
381
|
-
: 2;
|
|
370
|
+
const offsetArrow = this.props.showArrow ? 10 : 2;
|
|
382
371
|
const bottomMargin = parseMargin(containerStyle.marginBottom);
|
|
383
372
|
if (targetRect.bottom + popupHeight + bottomMargin + offsetArrow + offset >
|
|
384
373
|
viewportRect.bottom) {
|
|
@@ -437,7 +426,6 @@ export class Popup extends React.Component {
|
|
|
437
426
|
React.createElement(FocusTrap, { active: !!this.props.moveFocus, initialFocusElement: this.props.focusTarget, returnFocusOnDeactivate: true }, this.props.children)), this.getContainer());
|
|
438
427
|
}
|
|
439
428
|
getContainer() {
|
|
440
|
-
// istanbul ignore next
|
|
441
429
|
return (this.state.parentDocument.body.querySelector('[data-root-container="appui-root-id"]') ?? this.state.parentDocument.body);
|
|
442
430
|
}
|
|
443
431
|
}
|
|
@@ -455,6 +443,6 @@ function parsePxString(pxStr) {
|
|
|
455
443
|
return parsed || 0;
|
|
456
444
|
}
|
|
457
445
|
function parseMargin(value) {
|
|
458
|
-
return value ?
|
|
446
|
+
return value ? parseFloat(value) : 0;
|
|
459
447
|
}
|
|
460
448
|
//# sourceMappingURL=Popup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popup.js","sourceRoot":"","sources":["../../../../src/core-react/popup/Popup.tsx"],"names":[],"mappings":"A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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 { Key } from \"ts-key-enum\";\nimport { RelativePosition } from \"@itwin/appui-abstract\";\nimport { FocusTrap } from \"../focustrap/FocusTrap\";\nimport type { CommonProps } from \"../utils/Props\";\nimport { Rectangle } from \"../utils/Rectangle\";\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(\n previousProps: PopupProps,\n prevState: PopupState\n ) {\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 (\n Math.abs(this.state.left - point.x) < 3 &&\n Math.abs(this.state.top - point.y) < 3 &&\n this.state.position === position\n )\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)) return;\n\n if (this.props.onWheel) return this.props.onWheel(event);\n\n const closeOnWheel =\n this.props.closeOnWheel !== undefined ? this.props.closeOnWheel : true;\n if (closeOnWheel) 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)) return;\n\n if (this.props.isPinned) return;\n\n if (\n !this.props.closeOnNestedPopupOutsideClick &&\n this.isInCorePopup(event.target as HTMLElement)\n )\n return;\n\n if (this.props.onOutsideClick) 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)) return;\n\n if (this.props.onContextMenu) return this.props.onContextMenu(event);\n\n const closeOnContextMenu =\n this.props.closeOnContextMenu !== undefined\n ? this.props.closeOnContextMenu\n : true;\n if (closeOnContextMenu) this._hide();\n };\n\n private _handleKeyboard = (event: KeyboardEvent): void => {\n if (this.props.isPinned) return;\n\n if (\n event.key === Key.Escape.valueOf() ||\n event.key === Key.Enter.valueOf()\n ) {\n const closeOnEnter =\n this.props.closeOnEnter !== undefined ? this.props.closeOnEnter : true;\n if (event.key === Key.Enter.valueOf()) {\n if (closeOnEnter) this._onClose(true);\n else 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) 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(\n { left: point.x, top: point.y, isOpen: true, position },\n () => {\n if (this.props.onOpen) this.props.onOpen();\n }\n );\n }\n\n private _onClose(enterKey?: boolean) {\n if (!this.state.isOpen) return;\n\n this._unBindWindowEvents();\n\n this.setState({ isOpen: false }, () => {\n if (enterKey && this.props.onEnter) this.props.onEnter();\n if (this.props.onClose) 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 =\n 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()) return { x: left, y: top };\n\n // sanity check\n const point = { x: 0, y: 0 };\n if (!this._popup || !target) return point;\n\n // relative position\n const scrollY = activeWindow.scrollY;\n const scrollX = activeWindow.scrollX;\n\n const container = this.getContainer();\n const containerBounds = container.getBoundingClientRect();\n const targetRect = Rectangle.create(target.getBoundingClientRect()).offset({\n x: -containerBounds.left,\n y: -containerBounds.top,\n });\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 =\n scrollX +\n targetRect.left +\n targetRect.getWidth() / 2 -\n 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 =\n scrollX +\n targetRect.left +\n targetRect.getWidth() / 2 -\n 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 =\n scrollY +\n targetRect.top +\n targetRect.getHeight() / 2 -\n 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 =\n scrollY +\n targetRect.top +\n targetRect.getHeight() / 2 -\n 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) return position;\n\n // istanbul ignore if\n if (this._isPositionAbsolute()) 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 = {\n left: activeWindow.scrollX,\n top: activeWindow.scrollY,\n right: activeWindow.scrollX + activeWindow.innerWidth,\n bottom: activeWindow.scrollY + activeWindow.innerHeight,\n };\n const targetRect = target.getBoundingClientRect();\n const { popupWidth, popupHeight } = this._getPopupDimensions();\n const containerStyle = activeWindow.getComputedStyle(target);\n const offsetArrow = this.props.showArrow\n ? /* istanbul ignore next */ 10\n : 2;\n\n const bottomMargin = parseMargin(containerStyle.marginBottom);\n if (\n targetRect.bottom + popupHeight + bottomMargin + offsetArrow + offset >\n viewportRect.bottom\n ) {\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 (\n targetRect.top - popupHeight - topMargin - offsetArrow - offset <\n viewportRect.top\n ) {\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 (\n targetRect.left - popupWidth - leftMargin - offsetArrow - offset <\n viewportRect.left\n ) {\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 (\n targetRect.right + popupWidth + rightMargin + offsetArrow + offset >\n viewportRect.right\n ) {\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 = (\n event: React.AnimationEvent<HTMLDivElement>\n ) => {\n if (event.target === this._popup) {\n this.setState({ animationEnded: true });\n }\n };\n\n public override render() {\n const animate =\n 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 &&\n this.props.keepContentsMounted &&\n \"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 <div\n className={className}\n data-testid=\"core-popup\"\n ref={(element) => {\n this._popup = element;\n }}\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\n active={!!this.props.moveFocus}\n initialFocusElement={this.props.focusTarget}\n returnFocusOnDeactivate={true}\n >\n {this.props.children}\n </FocusTrap>\n </div>,\n this.getContainer()\n );\n }\n\n private getContainer() {\n // istanbul ignore next\n return (\n this.state.parentDocument.body.querySelector(\n '[data-root-container=\"appui-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":"Popup.js","sourceRoot":"","sources":["../../../../src/core-react/popup/Popup.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;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,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAsF/C;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,KAAK,CAAC,SAAiC;IAGhE,YAAY,KAAiB;QAC3B,KAAK,CAAC,KAAK,CAAC,CAAC;QAHP,WAAM,GAAuB,IAAI,CAAC;QAqFlC,sBAAiB,GAAG,GAAG,EAAE;YAC/B,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,EAAE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hhBa,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;AA2gBJ,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,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACvC,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 { Key } from \"ts-key-enum\";\nimport { RelativePosition } from \"@itwin/appui-abstract\";\nimport { FocusTrap } from \"../focustrap/FocusTrap\";\nimport type { CommonProps } from \"../utils/Props\";\nimport { Rectangle } from \"../utils/Rectangle\";\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 return this.state.parentDocument.defaultView ?? window;\n }\n\n public override componentDidUpdate(\n previousProps: PopupProps,\n prevState: PopupState\n ) {\n if (this.state.position !== prevState.position) {\n this.setState({ animationEnded: false });\n }\n\n if (this.props.target !== previousProps.target) {\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 (\n Math.abs(this.state.left - point.x) < 3 &&\n Math.abs(this.state.top - point.y) < 3 &&\n this.state.position === position\n )\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)) return;\n\n if (this.props.onWheel) return this.props.onWheel(event);\n\n const closeOnWheel =\n this.props.closeOnWheel !== undefined ? this.props.closeOnWheel : true;\n if (closeOnWheel) 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 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)) return;\n\n if (this.props.isPinned) return;\n\n if (\n !this.props.closeOnNestedPopupOutsideClick &&\n this.isInCorePopup(event.target as HTMLElement)\n )\n return;\n\n if (this.props.onOutsideClick) 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)) return;\n\n if (this.props.onContextMenu) return this.props.onContextMenu(event);\n\n const closeOnContextMenu =\n this.props.closeOnContextMenu !== undefined\n ? this.props.closeOnContextMenu\n : true;\n if (closeOnContextMenu) this._hide();\n };\n\n private _handleKeyboard = (event: KeyboardEvent): void => {\n if (this.props.isPinned) return;\n\n if (\n event.key === Key.Escape.valueOf() ||\n event.key === Key.Enter.valueOf()\n ) {\n const closeOnEnter =\n this.props.closeOnEnter !== undefined ? this.props.closeOnEnter : true;\n if (event.key === Key.Enter.valueOf()) {\n if (closeOnEnter) this._onClose(true);\n else 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) 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(\n { left: point.x, top: point.y, isOpen: true, position },\n () => {\n if (this.props.onOpen) this.props.onOpen();\n }\n );\n }\n\n private _onClose(enterKey?: boolean) {\n if (!this.state.isOpen) return;\n\n this._unBindWindowEvents();\n\n this.setState({ isOpen: false }, () => {\n if (enterKey && this.props.onEnter) this.props.onEnter();\n if (this.props.onClose) 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 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 =\n 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()) return { x: left, y: top };\n\n // sanity check\n const point = { x: 0, y: 0 };\n if (!this._popup || !target) return point;\n\n // relative position\n const scrollY = activeWindow.scrollY;\n const scrollX = activeWindow.scrollX;\n\n const container = this.getContainer();\n const containerBounds = container.getBoundingClientRect();\n const targetRect = Rectangle.create(target.getBoundingClientRect()).offset({\n x: -containerBounds.left,\n y: -containerBounds.top,\n });\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 =\n scrollX +\n targetRect.left +\n targetRect.getWidth() / 2 -\n 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 =\n scrollX +\n targetRect.left +\n targetRect.getWidth() / 2 -\n 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 =\n scrollY +\n targetRect.top +\n targetRect.getHeight() / 2 -\n 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 =\n scrollY +\n targetRect.top +\n targetRect.getHeight() / 2 -\n 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) return position;\n\n if (this._isPositionAbsolute()) 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 = {\n left: activeWindow.scrollX,\n top: activeWindow.scrollY,\n right: activeWindow.scrollX + activeWindow.innerWidth,\n bottom: activeWindow.scrollY + activeWindow.innerHeight,\n };\n const targetRect = target.getBoundingClientRect();\n const { popupWidth, popupHeight } = this._getPopupDimensions();\n const containerStyle = activeWindow.getComputedStyle(target);\n const offsetArrow = this.props.showArrow ? 10 : 2;\n\n const bottomMargin = parseMargin(containerStyle.marginBottom);\n if (\n targetRect.bottom + popupHeight + bottomMargin + offsetArrow + offset >\n viewportRect.bottom\n ) {\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 (\n targetRect.top - popupHeight - topMargin - offsetArrow - offset <\n viewportRect.top\n ) {\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 (\n targetRect.left - popupWidth - leftMargin - offsetArrow - offset <\n viewportRect.left\n ) {\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 (\n targetRect.right + popupWidth + rightMargin + offsetArrow + offset >\n viewportRect.right\n ) {\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 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 if (fittedPoint.y + popupHeight > innerHeight) {\n fittedPoint.y = innerHeight - popupHeight;\n }\n\n if (fittedPoint.x + popupWidth > innerWidth) {\n fittedPoint.x = innerWidth - popupWidth;\n }\n\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 = (\n event: React.AnimationEvent<HTMLDivElement>\n ) => {\n if (event.target === this._popup) {\n this.setState({ animationEnded: true });\n }\n };\n\n public override render() {\n const animate =\n 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 &&\n this.props.keepContentsMounted &&\n \"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 <div\n className={className}\n data-testid=\"core-popup\"\n ref={(element) => {\n this._popup = element;\n }}\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\n active={!!this.props.moveFocus}\n initialFocusElement={this.props.focusTarget}\n returnFocusOnDeactivate={true}\n >\n {this.props.children}\n </FocusTrap>\n </div>,\n this.getContainer()\n );\n }\n\n private getContainer() {\n return (\n this.state.parentDocument.body.querySelector(\n '[data-root-container=\"appui-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 ? parseFloat(value) : 0;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Annulus.d.ts","sourceRoot":"","sources":["../../../../src/core-react/radialmenu/Annulus.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC;;GAEG;AACH,qBAAa,IAAI;IACR,EAAE,EAAE,KAAK,CAAC;IACV,EAAE,EAAE,KAAK,CAAC;gBAEL,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE,KAAK;IAKlC,0EAA0E;IACnE,MAAM,SAAU,IAAI,aAC0B;CACtD;AAED;;GAEG;AACH,qBAAa,MAAM;IACV,MAAM,EAA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K,EAAE,MAAM,CAAC,EAAE,MAAM;CAI5C;AAED;;GAEG;AACH,qBAAa,OAAO;IACX,MAAM,EAAE,KAAK,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;gBAET,MAAM,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM;CAMvE;AAED;;GAEG;AACH,qBAAa,aAAa;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IAEjB,IAAI,EAAE,MAAM,CAAC;IAEb,UAAU,EAAE,KAAK,CAAC;IAClB,UAAU,EAAE,KAAK,CAAC;IAClB,KAAK,EAAE,IAAI,CAAC;IACZ,QAAQ,EAAE,KAAK,CAAC;IAChB,QAAQ,EAAE,KAAK,CAAC;IAChB,GAAG,EAAE,IAAI,CAAC;IAEjB;;;;;OAKG;gBACS,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;CAgDlE"}
|
|
@@ -61,7 +61,7 @@ export class AnnularSector {
|
|
|
61
61
|
this.innerEnd = new Point(cx + inner * Math.cos(endAngle), cy + inner * Math.sin(endAngle));
|
|
62
62
|
this.end = new Line(this.outerEnd, this.innerEnd);
|
|
63
63
|
const angleDiff = endAngle - startAngle;
|
|
64
|
-
const largeArc = angleDiff % (Math.PI * 2) > Math.PI ?
|
|
64
|
+
const largeArc = angleDiff % (Math.PI * 2) > Math.PI ? 1 : 0;
|
|
65
65
|
const sectorCommands = [];
|
|
66
66
|
sectorCommands.push(`M${this.innerStart.x},${this.innerStart.y}`); // moveTo
|
|
67
67
|
sectorCommands.push(`L${this.outerStart.x},${this.outerStart.y}`); // lineTo
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Annulus.js","sourceRoot":"","sources":["../../../../src/core-react/radialmenu/Annulus.ts"],"names":[],"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AC,GAAG,CAAC,CAAC;IACvC,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 RadialMenu\n */\n\nimport { Point } from \"../utils/Point\";\n\n/** 2D Line consisting of a start point, and an end point\n * @internal\n */\nexport class Line {\n public p1: Point;\n public p2: Point;\n\n constructor(p1?: Point, p2?: Point) {\n this.p1 = p1 || new Point();\n this.p2 = p2 || new Point();\n }\n\n /** checks for equality with the components of this, and line parameter */\n public equals = (line: Line) =>\n this.p1.equals(line.p1) && this.p2.equals(line.p2);\n}\n\n/** 2D Circle.\n * @internal\n */\nexport class Circle {\n public center: Point;\n public radius: number;\n constructor(center?: Point, radius?: number) {\n this.center = center || new Point();\n this.radius = radius || 0;\n }\n}\n\n/** 2D Annulus (2D doughnut shape/flattened torus) defined by an inner and outer circle with a shared center point.\n * @internal\n */\nexport class Annulus {\n public center: Point;\n public inner: Circle;\n public outer: Circle;\n\n constructor(center?: Point, innerRadius?: number, outerRadius?: number) {\n this.center = center || new Point();\n\n this.inner = new Circle(center, innerRadius);\n this.outer = new Circle(center, outerRadius);\n }\n}\n\n/** 2D Sector of an Annulus, defined by both a parent annulus, a startAngle, and an endAngle.\n * @internal\n */\nexport class AnnularSector {\n public parent: Annulus;\n public startAngle: number;\n public endAngle: number;\n\n public path: string;\n\n public innerStart: Point;\n public outerStart: Point;\n public start: Line;\n public innerEnd: Point;\n public outerEnd: Point;\n public end: Line;\n\n /**\n * initialize AnnularSector on parent annulus, and generate SVG Path to store in this.path\n * @param parent parent annulus to initialize sector on.\n * @param startAngle angle to begin the annular sector on.\n * @param endAngle angle to end the annular sector on.\n */\n constructor(parent: Annulus, startAngle: number, endAngle: number) {\n this.parent = parent;\n this.startAngle = startAngle;\n this.endAngle = endAngle;\n\n // adapted from https://gist.github.com/buschtoens/4190516\n const { x: cx, y: cy } = parent.center;\n const inner = parent.inner.radius;\n const outer = parent.outer.radius;\n\n this.innerStart = new Point(\n cx + inner * Math.cos(startAngle),\n cy + inner * Math.sin(startAngle)\n );\n this.outerStart = new Point(\n cx + outer * Math.cos(startAngle),\n cy + outer * Math.sin(startAngle)\n );\n this.start = new Line(this.innerStart, this.outerStart);\n\n this.outerEnd = new Point(\n cx + outer * Math.cos(endAngle),\n cy + outer * Math.sin(endAngle)\n );\n this.innerEnd = new Point(\n cx + inner * Math.cos(endAngle),\n cy + inner * Math.sin(endAngle)\n );\n this.end = new Line(this.outerEnd, this.innerEnd);\n\n const angleDiff = endAngle - startAngle;\n const largeArc = angleDiff % (Math.PI * 2) > Math.PI ? 1 : 0;\n\n const sectorCommands = [];\n\n sectorCommands.push(`M${this.innerStart.x},${this.innerStart.y}`); // moveTo\n sectorCommands.push(`L${this.outerStart.x},${this.outerStart.y}`); // lineTo\n sectorCommands.push(\n `A${outer},${outer} 0 ${largeArc} 1 ${this.outerEnd.x},${this.outerEnd.y}`\n ); // arcTo\n sectorCommands.push(`L${this.innerEnd.x},${this.innerEnd.y}`); // lineTo\n sectorCommands.push(\n `A${inner},${inner} 0 ${largeArc} 0 ${this.innerStart.x},${this.innerStart.y}`\n ); // arcTo\n sectorCommands.push(`z`); // closePath\n\n this.path = sectorCommands.join(\" \");\n }\n}\n"]}
|
|
@@ -8,6 +8,7 @@ import type { CommonProps } from "../utils/Props";
|
|
|
8
8
|
import { AnnularSector } from "./Annulus";
|
|
9
9
|
/** Properties for [[RadialMenu]]
|
|
10
10
|
* @public
|
|
11
|
+
* @deprecated in 4.14.x. Props of deprecated component {@link RadialMenu}.
|
|
11
12
|
*/
|
|
12
13
|
export interface RadialMenuProps extends CommonProps {
|
|
13
14
|
/** Whether to show RadialMenu */
|
|
@@ -36,9 +37,9 @@ export interface RadialMenuProps extends CommonProps {
|
|
|
36
37
|
interface RadialMenuState {
|
|
37
38
|
sectors: AnnularSector[];
|
|
38
39
|
}
|
|
39
|
-
/**
|
|
40
|
-
* A context menu arranged in a radial layout.
|
|
40
|
+
/** A context menu arranged in a radial layout.
|
|
41
41
|
* @public
|
|
42
|
+
* @deprecated in 4.14.x. Use {@link ContextMenu} or {@link https://itwinui.bentley.com/docs/dropdownmenu iTwinUI dropdown menu} instead.
|
|
42
43
|
*/
|
|
43
44
|
export declare class RadialMenu extends React.Component<RadialMenuProps, RadialMenuState> {
|
|
44
45
|
private _root;
|
|
@@ -59,6 +60,7 @@ export declare class RadialMenu extends React.Component<RadialMenuProps, RadialM
|
|
|
59
60
|
}
|
|
60
61
|
/** Properties for [[RadialButton]] component
|
|
61
62
|
* @public
|
|
63
|
+
* @deprecated in 4.14.x. Props of deprecated component {@link RadialButton}.
|
|
62
64
|
*/
|
|
63
65
|
export interface RadialButtonProps extends CommonProps {
|
|
64
66
|
/** Whether label is rotated to radial menu. Default: Inherit */
|
|
@@ -74,13 +76,12 @@ export interface RadialButtonProps extends CommonProps {
|
|
|
74
76
|
/** Content */
|
|
75
77
|
children?: React.ReactNode;
|
|
76
78
|
}
|
|
77
|
-
/** @internal */
|
|
78
79
|
interface RadialButtonState {
|
|
79
80
|
hover: boolean;
|
|
80
81
|
}
|
|
81
|
-
/**
|
|
82
|
-
* Button for use within a [[RadialMenu]]
|
|
82
|
+
/** Button for use within a [[RadialMenu]]
|
|
83
83
|
* @public
|
|
84
|
+
* @deprecated in 4.14.x. Component used in a deprecated component {@link RadialMenu}.
|
|
84
85
|
*/
|
|
85
86
|
export declare class RadialButton extends React.Component<RadialButtonProps, RadialButtonState> {
|
|
86
87
|
/** @internal */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadialMenu.d.ts","sourceRoot":"","sources":["../../../../src/core-react/radialmenu/RadialMenu.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,mBAAmB,CAAC;AAE3B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,QAAQ,EA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X;IAEF,OAAO,CAAC,YAAY,CAElB;IAEF,OAAO,CAAC,gBAAgB,CAEtB;IAEF,OAAO,CAAC,eAAe,CAErB;CACH"}
|
|
@@ -12,9 +12,9 @@ import { Key } from "ts-key-enum";
|
|
|
12
12
|
import { Icon } from "../icons/IconComponent";
|
|
13
13
|
import { Point } from "../utils/Point";
|
|
14
14
|
import { AnnularSector, Annulus } from "./Annulus";
|
|
15
|
-
/**
|
|
16
|
-
* A context menu arranged in a radial layout.
|
|
15
|
+
/** A context menu arranged in a radial layout.
|
|
17
16
|
* @public
|
|
17
|
+
* @deprecated in 4.14.x. Use {@link ContextMenu} or {@link https://itwinui.bentley.com/docs/dropdownmenu iTwinUI dropdown menu} instead.
|
|
18
18
|
*/
|
|
19
19
|
export class RadialMenu extends React.Component {
|
|
20
20
|
constructor(props) {
|
|
@@ -38,7 +38,6 @@ export class RadialMenu extends React.Component {
|
|
|
38
38
|
};
|
|
39
39
|
/** Manually call onSelect of highlighted button. */
|
|
40
40
|
this.select = () => {
|
|
41
|
-
// istanbul ignore else
|
|
42
41
|
if (this._selectedButton)
|
|
43
42
|
this._selectedButton.select();
|
|
44
43
|
};
|
|
@@ -83,7 +82,6 @@ export class RadialMenu extends React.Component {
|
|
|
83
82
|
this._root = el;
|
|
84
83
|
}, className: classnames("core-radial-menu", { opened: this.props.opened }, this.props.className), style: divStyle, "data-testid": "core-radial-menu" },
|
|
85
84
|
React.createElement("svg", { xmlns: "http://w3.org/2000/svg", version: "1.1", width: width, height: width, className: "core-radial-menu-container" }, React.Children.map(this.props.children, (child, index) => {
|
|
86
|
-
// istanbul ignore next
|
|
87
85
|
if (!child || typeof child !== "object" || !("props" in child))
|
|
88
86
|
return child;
|
|
89
87
|
const childElement = child;
|
|
@@ -121,9 +119,9 @@ RadialMenu.defaultProps = {
|
|
|
121
119
|
labelRotate: false,
|
|
122
120
|
selected: -1,
|
|
123
121
|
};
|
|
124
|
-
/**
|
|
125
|
-
* Button for use within a [[RadialMenu]]
|
|
122
|
+
/** Button for use within a [[RadialMenu]]
|
|
126
123
|
* @public
|
|
124
|
+
* @deprecated in 4.14.x. Component used in a deprecated component {@link RadialMenu}.
|
|
127
125
|
*/
|
|
128
126
|
export class RadialButton extends React.Component {
|
|
129
127
|
constructor(props) {
|
|
@@ -134,12 +132,10 @@ export class RadialButton extends React.Component {
|
|
|
134
132
|
};
|
|
135
133
|
/** Manually call this.props.onSelect */
|
|
136
134
|
this.select = () => {
|
|
137
|
-
// istanbul ignore else
|
|
138
135
|
if (this.props.onSelect)
|
|
139
136
|
this.props.onSelect(undefined);
|
|
140
137
|
};
|
|
141
138
|
this._handleClick = (event) => {
|
|
142
|
-
// istanbul ignore else
|
|
143
139
|
if (this.props.onSelect)
|
|
144
140
|
this.props.onSelect(event);
|
|
145
141
|
};
|
|
@@ -169,7 +165,6 @@ export class RadialButton extends React.Component {
|
|
|
169
165
|
while (a > 180)
|
|
170
166
|
a -= 360;
|
|
171
167
|
while (a < -180)
|
|
172
|
-
/* istanbul ignore next */
|
|
173
168
|
a += 360;
|
|
174
169
|
if (a > 90)
|
|
175
170
|
a -= 180;
|