@itwin/core-react 4.2.1 → 4.3.0

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.
Files changed (126) hide show
  1. package/CHANGELOG.md +7 -4
  2. package/lib/cjs/core-react/_geometry.scss +3 -3
  3. package/lib/cjs/core-react/_math.scss +3 -3
  4. package/lib/cjs/core-react/_typography.scss +3 -3
  5. package/lib/cjs/core-react/autosuggest/AutoSuggest.scss +3 -3
  6. package/lib/cjs/core-react/badge/Badge.scss +3 -3
  7. package/lib/cjs/core-react/badge/NewBadge.scss +3 -3
  8. package/lib/cjs/core-react/base/base.scss +3 -3
  9. package/lib/cjs/core-react/base/index.scss +3 -3
  10. package/lib/cjs/core-react/classes.scss +3 -3
  11. package/lib/cjs/core-react/colorthemes.scss +3 -3
  12. package/lib/cjs/core-react/colorvariables.scss +3 -3
  13. package/lib/cjs/core-react/contextmenu/ContextMenu.scss +3 -3
  14. package/lib/cjs/core-react/dialog/Dialog.d.ts +3 -10
  15. package/lib/cjs/core-react/dialog/Dialog.d.ts.map +1 -1
  16. package/lib/cjs/core-react/dialog/Dialog.js +69 -166
  17. package/lib/cjs/core-react/dialog/Dialog.js.map +1 -1
  18. package/lib/cjs/core-react/dialog/Dialog.scss +59 -217
  19. package/lib/cjs/core-react/expandable/index.scss +3 -3
  20. package/lib/cjs/core-react/expandable/list.scss +3 -3
  21. package/lib/cjs/core-react/icons/SvgPath.scss +3 -3
  22. package/lib/cjs/core-react/icons/WebFontIcon.scss +3 -3
  23. package/lib/cjs/core-react/icons/index.scss +3 -3
  24. package/lib/cjs/core-react/icons/mixins.scss +3 -3
  25. package/lib/cjs/core-react/icons/variables.scss +3 -3
  26. package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.scss +3 -3
  27. package/lib/cjs/core-react/index.scss +3 -3
  28. package/lib/cjs/core-react/inputs/index.scss +3 -3
  29. package/lib/cjs/core-react/inputs/input-label.scss +3 -3
  30. package/lib/cjs/core-react/inputs/input.scss +3 -3
  31. package/lib/cjs/core-react/inputs/numberinput/NumberInput.scss +3 -3
  32. package/lib/cjs/core-react/inputs/variables.scss +3 -3
  33. package/lib/cjs/core-react/listbox/Listbox.scss +3 -3
  34. package/lib/cjs/core-react/loading/LoadingPrompt.scss +3 -3
  35. package/lib/cjs/core-react/loading/LoadingSpinner.scss +3 -3
  36. package/lib/cjs/core-react/loading/index.scss +3 -3
  37. package/lib/cjs/core-react/loading/mixins.scss +3 -3
  38. package/lib/cjs/core-react/messagebox/MessageBox.d.ts.map +1 -1
  39. package/lib/cjs/core-react/messagebox/MessageBox.js +2 -2
  40. package/lib/cjs/core-react/messagebox/MessageBox.js.map +1 -1
  41. package/lib/cjs/core-react/messagebox/MessageBox.scss +3 -3
  42. package/lib/cjs/core-react/popup/Popup.scss +3 -3
  43. package/lib/cjs/core-react/radialmenu/RadialMenu.scss +3 -3
  44. package/lib/cjs/core-react/searchbox/SearchBox.scss +3 -3
  45. package/lib/cjs/core-react/settings/SettingsContainer.scss +3 -3
  46. package/lib/cjs/core-react/style/baseline.scss +3 -3
  47. package/lib/cjs/core-react/style/index.scss +3 -3
  48. package/lib/cjs/core-react/style/opacity.scss +3 -3
  49. package/lib/cjs/core-react/tabs/index.scss +3 -3
  50. package/lib/cjs/core-react/tabs/tabs.scss +3 -3
  51. package/lib/cjs/core-react/tabs/vertical.scss +3 -3
  52. package/lib/cjs/core-react/text/FilteredText.scss +3 -3
  53. package/lib/cjs/core-react/text/block.scss +3 -3
  54. package/lib/cjs/core-react/text/body.scss +3 -3
  55. package/lib/cjs/core-react/text/index.scss +3 -3
  56. package/lib/cjs/core-react/text/mixins.scss +3 -3
  57. package/lib/cjs/core-react/tree/ExpansionToggle.scss +3 -3
  58. package/lib/cjs/core-react/tree/Placeholder.scss +3 -3
  59. package/lib/cjs/core-react/tree/Tree.scss +3 -3
  60. package/lib/esm/core-react/_geometry.scss +3 -3
  61. package/lib/esm/core-react/_math.scss +3 -3
  62. package/lib/esm/core-react/_typography.scss +3 -3
  63. package/lib/esm/core-react/autosuggest/AutoSuggest.scss +3 -3
  64. package/lib/esm/core-react/badge/Badge.scss +3 -3
  65. package/lib/esm/core-react/badge/NewBadge.scss +3 -3
  66. package/lib/esm/core-react/base/base.scss +3 -3
  67. package/lib/esm/core-react/base/index.scss +3 -3
  68. package/lib/esm/core-react/classes.scss +3 -3
  69. package/lib/esm/core-react/colorthemes.scss +3 -3
  70. package/lib/esm/core-react/colorvariables.scss +3 -3
  71. package/lib/esm/core-react/contextmenu/ContextMenu.scss +3 -3
  72. package/lib/esm/core-react/dialog/Dialog.d.ts +3 -10
  73. package/lib/esm/core-react/dialog/Dialog.d.ts.map +1 -1
  74. package/lib/esm/core-react/dialog/Dialog.js +68 -165
  75. package/lib/esm/core-react/dialog/Dialog.js.map +1 -1
  76. package/lib/esm/core-react/dialog/Dialog.scss +59 -217
  77. package/lib/esm/core-react/expandable/index.scss +3 -3
  78. package/lib/esm/core-react/expandable/list.scss +3 -3
  79. package/lib/esm/core-react/icons/SvgPath.scss +3 -3
  80. package/lib/esm/core-react/icons/WebFontIcon.scss +3 -3
  81. package/lib/esm/core-react/icons/index.scss +3 -3
  82. package/lib/esm/core-react/icons/mixins.scss +3 -3
  83. package/lib/esm/core-react/icons/variables.scss +3 -3
  84. package/lib/esm/core-react/imagecheckbox/ImageCheckBox.scss +3 -3
  85. package/lib/esm/core-react/index.scss +3 -3
  86. package/lib/esm/core-react/inputs/index.scss +3 -3
  87. package/lib/esm/core-react/inputs/input-label.scss +3 -3
  88. package/lib/esm/core-react/inputs/input.scss +3 -3
  89. package/lib/esm/core-react/inputs/numberinput/NumberInput.scss +3 -3
  90. package/lib/esm/core-react/inputs/variables.scss +3 -3
  91. package/lib/esm/core-react/listbox/Listbox.scss +3 -3
  92. package/lib/esm/core-react/loading/LoadingPrompt.scss +3 -3
  93. package/lib/esm/core-react/loading/LoadingSpinner.scss +3 -3
  94. package/lib/esm/core-react/loading/index.scss +3 -3
  95. package/lib/esm/core-react/loading/mixins.scss +3 -3
  96. package/lib/esm/core-react/messagebox/MessageBox.d.ts.map +1 -1
  97. package/lib/esm/core-react/messagebox/MessageBox.js +2 -2
  98. package/lib/esm/core-react/messagebox/MessageBox.js.map +1 -1
  99. package/lib/esm/core-react/messagebox/MessageBox.scss +3 -3
  100. package/lib/esm/core-react/popup/Popup.scss +3 -3
  101. package/lib/esm/core-react/radialmenu/RadialMenu.scss +3 -3
  102. package/lib/esm/core-react/searchbox/SearchBox.scss +3 -3
  103. package/lib/esm/core-react/settings/SettingsContainer.scss +3 -3
  104. package/lib/esm/core-react/style/baseline.scss +3 -3
  105. package/lib/esm/core-react/style/index.scss +3 -3
  106. package/lib/esm/core-react/style/opacity.scss +3 -3
  107. package/lib/esm/core-react/tabs/index.scss +3 -3
  108. package/lib/esm/core-react/tabs/tabs.scss +3 -3
  109. package/lib/esm/core-react/tabs/vertical.scss +3 -3
  110. package/lib/esm/core-react/text/FilteredText.scss +3 -3
  111. package/lib/esm/core-react/text/block.scss +3 -3
  112. package/lib/esm/core-react/text/body.scss +3 -3
  113. package/lib/esm/core-react/text/index.scss +3 -3
  114. package/lib/esm/core-react/text/mixins.scss +3 -3
  115. package/lib/esm/core-react/tree/ExpansionToggle.scss +3 -3
  116. package/lib/esm/core-react/tree/Placeholder.scss +3 -3
  117. package/lib/esm/core-react/tree/Tree.scss +3 -3
  118. package/package.json +3 -3
  119. package/lib/cjs/core-react/dialog/SimpleDialog.d.ts +0 -68
  120. package/lib/cjs/core-react/dialog/SimpleDialog.d.ts.map +0 -1
  121. package/lib/cjs/core-react/dialog/SimpleDialog.js +0 -51
  122. package/lib/cjs/core-react/dialog/SimpleDialog.js.map +0 -1
  123. package/lib/esm/core-react/dialog/SimpleDialog.d.ts +0 -68
  124. package/lib/esm/core-react/dialog/SimpleDialog.d.ts.map +0 -1
  125. package/lib/esm/core-react/dialog/SimpleDialog.js +0 -47
  126. package/lib/esm/core-react/dialog/SimpleDialog.js.map +0 -1
@@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C,CAAC;QACH,OAAO,OAAO,CAAC;IACjB,CAAC;;AA3Ya,mBAAY,GAAyB;IACjD,SAAS,EAAE,eAAe,CAAC,MAAM;IACjC,QAAQ,EAAE,GAAG;IACb,SAAS,EAAE,GAAG;IACd,KAAK,EAAE,KAAK;IACZ,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE,KAAK;IAChB,OAAO,EAAE,KAAK;IACd,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;IACX,SAAS,EAAE,KAAK;CACjB,AAXyB,CAWxB;AAdS,wBAAM","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 \"./Dialog.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { DialogButtonDef } from \"@itwin/appui-abstract\";\nimport { DialogButtonType, SpecialKey } from \"@itwin/appui-abstract\";\nimport { DivWithOutsideClick } from \"../base/DivWithOutsideClick\";\nimport { UiCore } from \"../UiCore\";\nimport type { CommonProps } from \"../utils/Props\";\nimport type { Omit } from \"../utils/typeUtils\";\nimport { FocusTrap } from \"../focustrap/FocusTrap\";\nimport type { ButtonProps } from \"@itwin/itwinui-react\";\nimport { Button } from \"@itwin/itwinui-react\";\nimport { Icon } from \"../icons/IconComponent\";\nimport { SvgClose } from \"@itwin/itwinui-icons-react\";\n\n// cspell:ignore focustrap\n\n/** Enum for dialog alignment\n * @public\n */\nexport enum DialogAlignment {\n TopLeft = \"top-left\",\n Top = \"top\",\n TopRight = \"top-right\",\n Left = \"left\",\n Center = \"center\",\n Right = \"right\",\n BottomLeft = \"bottom-left\",\n Bottom = \"bottom\",\n BottomRight = \"bottom-right\",\n}\n\n/** Properties for the [[Dialog]] component\n * @public\n */\nexport interface DialogProps\n extends Omit<React.AllHTMLAttributes<HTMLDivElement>, \"title\">,\n CommonProps {\n /** Indicates whether to show dialog or not */\n opened: boolean;\n\n /** Indicates whether the user can resize dialog with cursor. Default: false */\n resizable?: boolean;\n /** Indicates whether the user can move dialog with cursor. Default: false */\n movable?: boolean;\n /** Indicates whether the content should be inset. Default: true */\n inset?: boolean;\n /** Indicates whether the focus should be trapped within the dialog. Default: false */\n trapFocus?: boolean;\n\n /** Whether the hide the header. Default: false */\n hideHeader?: boolean;\n /** Override for the header */\n header?: React.ReactNode;\n /** Title to show in title bar of dialog */\n title?: string | React.ReactElement;\n /** Footer to show at bottom of dialog. Note: will override buttonCluster */\n footer?: string | React.ReactElement;\n /** List of DialogButtonDef objects specifying buttons and associated onClick events */\n buttonCluster?: DialogButtonDef[];\n\n /** Default alignment of dialog. Default: DialogAlignment.Center */\n alignment?: DialogAlignment;\n /** Initial x/left position of dialog in px. */\n x?: number;\n /** Initial y/top position of dialog in px. */\n y?: number;\n\n /** onClick event for X button for dialog */\n onClose?: () => void;\n /** 'keyup' event for Esc key */\n onEscape?: () => void;\n /** Triggered when a click is triggered outside of this dialog. */\n onOutsideClick?: (event: MouseEvent) => any;\n\n /** Initial width of dialog. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. Default: \"50%\" */\n width?: string | number;\n /** Initial height of dialog. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\n height?: string | number;\n /** Minimum width that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. Default: 300px */\n minWidth?: string | number;\n /** Minimum height that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. Default: 100px */\n minHeight?: string | number;\n /** Maximum width that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\n maxWidth?: string | number;\n /** Maximum height that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\n maxHeight?: string | number;\n\n /** Whether to show background overlay. Default: true.\n * @note Modeless dialogs require an id and an implementation of onModelessPointerDown.\n */\n modal?: boolean;\n /** An id for a modeless dialog */\n modelessId?: string;\n /** Pointer Down event handler when modeless (modal = false) */\n onModelessPointerDown?: (event: React.PointerEvent, id: string) => void;\n\n /** Custom CSS Style for overlay */\n backgroundStyle?: React.CSSProperties;\n /** Custom CSS Style for title */\n titleStyle?: React.CSSProperties;\n /** Custom CSS Style for footer */\n footerStyle?: React.CSSProperties;\n /** Custom CSS class name for the content */\n contentClassName?: string;\n /** Custom CSS Style for the content */\n contentStyle?: React.CSSProperties;\n}\n\n/** @internal */\ninterface DialogState {\n rightResizing: boolean;\n downResizing: boolean;\n moving: boolean;\n grabOffsetX: number;\n grabOffsetY: number;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n positionSet: boolean;\n}\n\n/**\n * Dialog React component with optional resizing and dragging functionality\n * @public\n */\nexport class Dialog extends React.Component<DialogProps, DialogState> {\n private _parentDocument = document;\n private _containerRef = React.createRef<HTMLDivElement>();\n public static defaultProps: Partial<DialogProps> = {\n alignment: DialogAlignment.Center,\n minWidth: 300,\n minHeight: 100,\n width: \"50%\",\n hideHeader: false,\n resizable: false,\n movable: false,\n modal: true,\n inset: true,\n trapFocus: false,\n };\n\n /** @internal */\n public override readonly state: Readonly<DialogState>;\n\n constructor(props: DialogProps) {\n super(props);\n this.state = {\n rightResizing: false,\n downResizing: false,\n moving: false,\n grabOffsetX: 0,\n grabOffsetY: 0,\n positionSet: props.x !== undefined || props.y !== undefined,\n };\n }\n\n private getParentWindow() {\n // istanbul ignore next\n return this._parentDocument.defaultView ?? window;\n }\n\n public override componentWillUnmount(): void {\n const parentWindow = this.getParentWindow();\n parentWindow.removeEventListener(\"pointerup\", this._handlePointerUp, true);\n parentWindow.removeEventListener(\n \"pointermove\",\n this._handlePointerMove,\n true\n );\n this._parentDocument.removeEventListener(\"keyup\", this._handleKeyUp, true);\n parentWindow.addEventListener(\"resize\", this._handleAppWindowResize);\n }\n\n /** Keep title bar of movable Dialog at least partially visible */\n // istanbul ignore next\n private _handleAppWindowResize = (): void => {\n if (!this._containerRef.current || !this.props.movable) return;\n\n const parentWindow = this.getParentWindow();\n const { x, y } = this.state;\n let newX: number | undefined;\n let newY: number | undefined;\n\n if (undefined !== y && undefined !== x) {\n if (y > parentWindow.innerHeight - 32)\n newY = parentWindow.innerHeight - 32;\n if (x > parentWindow.innerWidth - 32) newX = parentWindow.innerWidth - 32;\n }\n\n if (newX !== undefined || newY !== undefined)\n this.setState({\n x: newX !== undefined ? newX : x,\n y: newY !== undefined ? newY : y,\n positionSet: true,\n });\n };\n\n public override componentDidMount(): void {\n const parentWindow = this.getParentWindow();\n parentWindow.addEventListener(\"pointerup\", this._handlePointerUp, true);\n this._parentDocument.addEventListener(\"keyup\", this._handleKeyUp, true);\n parentWindow.addEventListener(\"resize\", this._handleAppWindowResize);\n }\n\n public handleRefSet = (containerDiv: HTMLDivElement | null) => {\n if (containerDiv) this._parentDocument = containerDiv.ownerDocument;\n };\n\n public override render(): React.ReactElement {\n const {\n opened,\n title,\n footer,\n buttonCluster,\n onClose,\n onEscape,\n onOutsideClick,\n minWidth,\n minHeight,\n x,\n y,\n width,\n height,\n maxHeight,\n maxWidth,\n backgroundStyle,\n titleStyle,\n footerStyle,\n style,\n contentStyle,\n contentClassName,\n modal,\n resizable,\n movable,\n className,\n alignment,\n inset,\n trapFocus,\n modelessId,\n onModelessPointerDown,\n hideHeader,\n header,\n ...props\n } = this.props;\n\n const containerStyle: React.CSSProperties = {\n margin: \"\",\n left: x,\n top: y,\n width,\n height,\n };\n\n if (this.state.x !== undefined || this.state.y !== undefined) {\n // istanbul ignore else\n if (this.state.x !== undefined) {\n containerStyle.marginLeft = \"0\";\n containerStyle.marginRight = \"0\";\n containerStyle.left = this.state.x;\n }\n // istanbul ignore else\n if (this.state.y !== undefined) {\n containerStyle.marginTop = \"0\";\n containerStyle.marginBottom = \"0\";\n containerStyle.top = this.state.y;\n }\n }\n\n if (this.state.width !== undefined || this.state.height !== undefined) {\n // istanbul ignore else\n if (this.state.width !== undefined)\n containerStyle.width = this.state.width;\n // istanbul ignore else\n if (this.state.height !== undefined)\n containerStyle.height = this.state.height;\n }\n\n const minMaxStyle: React.CSSProperties = {\n minWidth,\n minHeight,\n maxWidth,\n maxHeight,\n };\n\n const buttons = this.getFooterButtons(buttonCluster);\n\n const footerElement: React.ReactNode =\n footer ||\n (buttons && buttons.length > 0 && (\n <div className={\"core-dialog-buttons\"}>{buttons}</div>\n ));\n\n const divStyle: React.CSSProperties = {\n ...backgroundStyle,\n ...style,\n };\n\n const headerElement = header || (\n <div\n className={classnames(\n \"core-dialog-head\",\n { \"core-dialog-movable\": movable },\n { \"core-dialog-modal\": modal }\n )}\n data-testid=\"core-dialog-head\"\n onPointerDown={this._handleStartMove}\n >\n <div\n className={\"core-dialog-title\"}\n data-testid=\"core-dialog-title\"\n style={titleStyle}\n >\n {title}\n </div>\n <button\n className={\"core-focus-trap-ignore-initial core-dialog-close icon\"}\n data-testid=\"core-dialog-close\"\n onClick={onClose}\n >\n <Icon iconSpec={<SvgClose />} />\n </button>\n </div>\n );\n\n return (\n <div\n ref={this.handleRefSet}\n className={classnames(\n \"core-dialog\",\n !modal && \"core-dialog-hidden\",\n opened && \"core-dialog-opened\",\n className\n )}\n style={divStyle}\n data-testid=\"core-dialog-root\"\n {...props}\n >\n {opened && (\n <DivWithOutsideClick onOutsideClick={onOutsideClick}>\n <FocusTrap\n active={trapFocus && modal}\n returnFocusOnDeactivate={true}\n >\n <div\n className={classnames(\n \"core-dialog-container\",\n this.getCSSClassNameFromAlignment(alignment)\n )}\n style={{ ...containerStyle, ...minMaxStyle }}\n data-testid=\"core-dialog-container\"\n onPointerDown={this._handleContainerPointerDown}\n >\n <div\n className={\"core-dialog-area\"}\n ref={this._containerRef}\n style={minMaxStyle}\n >\n {!hideHeader && headerElement}\n <div\n className={classnames(\n \"core-dialog-content\",\n { \"core-dialog-content-no-inset\": !inset },\n contentClassName\n )}\n style={contentStyle}\n >\n {this.props.children}\n </div>\n {footerElement && (\n <div className={\"core-dialog-footer\"} style={footerStyle}>\n {footerElement}\n </div>\n )}\n <div\n className={classnames(\n \"core-dialog-drag\",\n \"core-dialog-drag-right\",\n { \"core-dialog-drag-enabled\": resizable }\n )}\n data-testid=\"core-dialog-drag-right\"\n onPointerDown={this._handleStartResizeRight}\n />\n <div\n className={classnames(\n \"core-dialog-drag\",\n \"core-dialog-drag-bottom-mid\",\n { \"core-dialog-drag-enabled\": resizable }\n )}\n data-testid=\"core-dialog-drag-bottom\"\n onPointerDown={this._handleStartResizeDown}\n />\n <div\n className={classnames(\n \"core-dialog-drag\",\n \"core-dialog-drag-bottom-right\",\n { \"core-dialog-drag-enabled\": resizable }\n )}\n data-testid=\"core-dialog-drag-bottom-right\"\n onPointerDown={this._handleStartResizeDownRight}\n />\n </div>\n </div>\n </FocusTrap>\n </DivWithOutsideClick>\n )}\n </div>\n );\n }\n\n private getCSSClassNameFromAlignment(alignment?: DialogAlignment): string {\n let className = \"\";\n\n // Drop the alignment CSS class if the Dialog has been sized or moved.\n if (this.state.positionSet) return \"\";\n\n // istanbul ignore next\n if (!alignment) alignment = DialogAlignment.Center;\n\n switch (alignment) {\n case DialogAlignment.TopLeft:\n className = \"core-dialog-top-left\";\n break;\n case DialogAlignment.Top:\n className = \"core-dialog-top\";\n break;\n case DialogAlignment.TopRight:\n className = \"core-dialog-top-right\";\n break;\n case DialogAlignment.Left:\n className = \"core-dialog-left\";\n break;\n case DialogAlignment.Center:\n className = \"core-dialog-center\";\n break;\n case DialogAlignment.Right:\n className = \"core-dialog-right\";\n break;\n case DialogAlignment.BottomLeft:\n className = \"core-dialog-bottom-left\";\n break;\n case DialogAlignment.Bottom:\n className = \"core-dialog-bottom\";\n break;\n case DialogAlignment.BottomRight:\n className = \"core-dialog-bottom-right\";\n break;\n }\n\n return className;\n }\n\n protected getFooterButtons(\n buttonCluster: DialogButtonDef[] | undefined,\n primaryStyleType: ButtonProps[\"styleType\"] = \"cta\",\n noCoreButtonClasses: boolean = false\n ): React.ReactNode[] | undefined {\n if (buttonCluster === undefined) return undefined;\n\n const buttons: React.ReactNode[] = [];\n buttonCluster.forEach((button: DialogButtonDef, index: number) => {\n let buttonText = \"\";\n let buttonClass = classnames(\n !noCoreButtonClasses && \"core-dialog-button\",\n !noCoreButtonClasses && `dialog-button-${button.type}`,\n button.className\n );\n let usePrimaryStyleType = false;\n\n switch (button.type) {\n case DialogButtonType.OK:\n buttonText = UiCore.translate(\"dialog.ok\");\n buttonClass = classnames(buttonClass, button.buttonStyle);\n usePrimaryStyleType = true;\n break;\n case DialogButtonType.Retry:\n buttonText = UiCore.translate(\"dialog.retry\");\n buttonClass = classnames(buttonClass, button.buttonStyle);\n usePrimaryStyleType = true;\n break;\n case DialogButtonType.Yes:\n buttonText = UiCore.translate(\"dialog.yes\");\n buttonClass = classnames(buttonClass, button.buttonStyle);\n usePrimaryStyleType = true;\n break;\n case DialogButtonType.No:\n buttonText = UiCore.translate(\"dialog.no\");\n buttonClass = classnames(buttonClass, button.buttonStyle);\n break;\n case DialogButtonType.Cancel:\n buttonText = UiCore.translate(\"dialog.cancel\");\n buttonClass = classnames(buttonClass, button.buttonStyle);\n break;\n case DialogButtonType.Close:\n buttonText = UiCore.translate(\"dialog.close\");\n buttonClass = classnames(buttonClass, button.buttonStyle);\n break;\n case DialogButtonType.Next:\n buttonText = UiCore.translate(\"dialog.next\");\n buttonClass = classnames(buttonClass, button.buttonStyle);\n usePrimaryStyleType = true;\n break;\n case DialogButtonType.Previous:\n buttonText = UiCore.translate(\"dialog.previous\");\n buttonClass = classnames(buttonClass, button.buttonStyle);\n usePrimaryStyleType = true;\n break;\n }\n\n if (button.label) buttonText = button.label;\n\n buttons.push(\n <Button\n className={buttonClass}\n disabled={button.disabled}\n styleType={usePrimaryStyleType ? primaryStyleType : undefined}\n key={index.toString()}\n onClick={button.onClick}\n >\n {buttonText}\n </Button>\n );\n });\n return buttons;\n }\n\n private _handleKeyUp = (event: KeyboardEvent) => {\n if (\n event.key === SpecialKey.Escape &&\n this.props.opened &&\n this.props.onEscape\n ) {\n this.props.onEscape();\n }\n };\n\n protected _handleContainerPointerDown = (event: React.PointerEvent): void => {\n if (!this.props.modal) {\n if (this.props.onModelessPointerDown && this.props.modelessId)\n this.props.onModelessPointerDown(event, this.props.modelessId);\n }\n };\n\n private _handleStartResizeRight = (event: React.PointerEvent): void => {\n event.preventDefault();\n this.setState({ rightResizing: true });\n const parentWindow = this.getParentWindow();\n parentWindow.addEventListener(\"pointermove\", this._handlePointerMove, true);\n };\n\n private _handleStartResizeDown = (event: React.PointerEvent): void => {\n event.preventDefault();\n this.setState({ downResizing: true });\n const parentWindow = this.getParentWindow();\n parentWindow.addEventListener(\"pointermove\", this._handlePointerMove, true);\n };\n\n private _handleStartResizeDownRight = (event: React.PointerEvent): void => {\n event.preventDefault();\n this.setState({ downResizing: true, rightResizing: true });\n const parentWindow = this.getParentWindow();\n parentWindow.addEventListener(\"pointermove\", this._handlePointerMove, true);\n };\n\n private _handleStartMove = (event: React.PointerEvent): void => {\n if (!this.props.movable) return;\n\n event.preventDefault();\n // istanbul ignore else\n if (this._containerRef.current) {\n const rect = this._containerRef.current.getBoundingClientRect();\n const grabOffsetX = event.clientX - rect.left;\n const grabOffsetY = event.clientY - rect.top;\n this.setState({\n grabOffsetX,\n grabOffsetY,\n moving: true,\n });\n\n const parentWindow = this.getParentWindow();\n parentWindow.addEventListener(\n \"pointermove\",\n this._handlePointerMove,\n true\n );\n }\n };\n\n private _handlePointerMove = (event: PointerEvent): void => {\n if (\n (!this.props.resizable && !this.props.movable) ||\n !this._containerRef.current\n )\n return;\n\n const { minWidth, maxWidth, minHeight, maxHeight, movable } = this.props;\n let { x, y, width, height } = this.state;\n\n // istanbul ignore else\n if (x === undefined) {\n // if x is undefined, so is y, width, and height\n const rect = this._containerRef.current.getBoundingClientRect();\n (width = rect.width),\n (height = rect.height),\n (x = rect.left),\n (y = rect.top);\n }\n\n if (this.props.resizable) {\n if (this.state.rightResizing) {\n const pointerX = event.clientX;\n width = pointerX - x;\n // istanbul ignore else\n if (typeof minWidth === \"number\") width = Math.max(width, minWidth);\n if (maxWidth !== undefined && typeof maxWidth === \"number\")\n width = Math.min(width, maxWidth);\n }\n\n if (this.state.downResizing) {\n const pointerY = event.clientY;\n height = pointerY - y!;\n // istanbul ignore else\n if (typeof minHeight === \"number\") height = Math.max(height, minHeight);\n if (maxHeight !== undefined && typeof maxHeight === \"number\")\n height = Math.min(height, maxHeight);\n }\n\n this.setState({ width, height });\n }\n\n // istanbul ignore next\n if (movable && this.state.moving) {\n x = event.clientX - this.state.grabOffsetX;\n y = event.clientY - this.state.grabOffsetY;\n if (y < 0) y = 0;\n if (event.view) {\n if (y > event.view.innerHeight - 32) y = event.view.innerHeight - 32;\n if (x > event.view.innerWidth - 32) x = event.view.innerWidth - 32;\n if (width) {\n if (x < 0 - width + 32) x = 0 - width + 32;\n }\n }\n\n this.setState({ x, y, positionSet: true });\n }\n };\n\n private _handlePointerUp = (_event: PointerEvent): void => {\n if (!this.props.movable && !this.props.resizable) return;\n\n // istanbul ignore else\n if (this._containerRef.current) {\n this.setState({\n rightResizing: false,\n downResizing: false,\n moving: false,\n grabOffsetX: 0,\n grabOffsetY: 0,\n });\n }\n\n const parentWindow = this.getParentWindow();\n parentWindow.removeEventListener(\n \"pointermove\",\n this._handlePointerMove,\n true\n );\n };\n}\n"]}
1
+ {"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../../src/core-react/dialog/Dialog.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,yBAAuB;AACvB,2CAAoC;AACpC,+BAA+B;AAE/B,0DAAqE;AACrE,qEAAkE;AAClE,sCAAmC;AAGnC,wDAA4D;AAC5D,wDAA8C;AAG9C,0BAA0B;AAE1B;;GAEG;AACH,IAAY,eAUX;AAVD,WAAY,eAAe;IACzB,uCAAoB,CAAA;IACpB,8BAAW,CAAA;IACX,yCAAsB,CAAA;IACtB,gCAAa,CAAA;IACb,oCAAiB,CAAA;IACjB,kCAAe,CAAA;IACf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E,EACrB,OAAO,EAAE,MAAM,CAAC,OAAO,IAEtB,UAAU,CACJ,CACV,CAAC;QACJ,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;IACjB,CAAC;;AA9Sa,mBAAY,GAAyB;IACjD,QAAQ,EAAE,GAAG;IACb,SAAS,EAAE,GAAG;IACd,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,KAAK;IACZ,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE,KAAK;IAChB,OAAO,EAAE,KAAK;IACd,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;IACX,SAAS,EAAE,KAAK;CACjB,AAXyB,CAWxB;AAdS,wBAAM","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 \"./Dialog.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { DialogButtonDef } from \"@itwin/appui-abstract\";\nimport { DialogButtonType, SpecialKey } from \"@itwin/appui-abstract\";\nimport { DivWithOutsideClick } from \"../base/DivWithOutsideClick\";\nimport { UiCore } from \"../UiCore\";\nimport type { CommonProps } from \"../utils/Props\";\nimport type { Omit } from \"../utils/typeUtils\";\nimport { Dialog as BaseDialog } from \"@itwin/itwinui-react\";\nimport { Button } from \"@itwin/itwinui-react\";\nimport type { ButtonProps } from \"@itwin/itwinui-react\";\n\n// cspell:ignore focustrap\n\n/** Enum for dialog alignment\n * @public\n */\nexport enum DialogAlignment {\n TopLeft = \"top-left\",\n Top = \"top\",\n TopRight = \"top-right\",\n Left = \"left\",\n Center = \"center\",\n Right = \"right\",\n BottomLeft = \"bottom-left\",\n Bottom = \"bottom\",\n BottomRight = \"bottom-right\",\n}\n\n/** Properties for the [[Dialog]] component\n * @public\n */\nexport interface DialogProps\n extends Omit<React.AllHTMLAttributes<HTMLDivElement>, \"title\">,\n CommonProps {\n /** Indicates whether to show dialog or not */\n opened: boolean;\n\n /** Indicates whether the user can resize dialog with cursor. Default: false */\n resizable?: boolean;\n /** Indicates whether the user can move dialog with cursor. Default: false */\n movable?: boolean;\n /** Indicates whether the content should be inset. Default: true */\n inset?: boolean;\n /** Indicates whether the focus should be trapped within the dialog. Default: false */\n trapFocus?: boolean;\n\n /** Whether the hide the header. Default: false */\n hideHeader?: boolean;\n /** Override for the header */\n header?: React.ReactNode;\n /** Title to show in title bar of dialog */\n title?: string | React.ReactElement;\n /** Footer to show at bottom of dialog. Note: will override buttonCluster */\n footer?: string | React.ReactElement;\n /** List of DialogButtonDef objects specifying buttons and associated onClick events */\n buttonCluster?: DialogButtonDef[];\n\n /** Default alignment of dialog. */\n alignment?: DialogAlignment;\n /** Initial x/left position of dialog in px. */\n x?: number;\n /** Initial y/top position of dialog in px. */\n y?: number;\n\n /** onClick event for X button for dialog */\n onClose?: () => void;\n /** 'keyup' event for Esc key */\n onEscape?: () => void;\n /** Triggered when a click is triggered outside of this dialog. */\n onOutsideClick?: (event: MouseEvent) => any;\n\n /** Initial width of dialog. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. Default: \"50%\" */\n width?: string | number;\n /** Initial height of dialog. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\n height?: string | number;\n /** Minimum width that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. Default: 300px */\n minWidth?: string | number;\n /** Minimum height that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. Default: 135px */\n minHeight?: string | number;\n /** Maximum width that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. Default: 100% */\n maxWidth?: string | number;\n /** Maximum height that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\n maxHeight?: string | number;\n\n /** Whether to show background overlay. Default: true.\n * @note Modeless dialogs require an id and an implementation of onModelessPointerDown.\n */\n modal?: boolean;\n /** An id for a modeless dialog */\n modelessId?: string;\n /** Pointer Down event handler when modeless (modal = false) */\n onModelessPointerDown?: (event: React.PointerEvent, id: string) => void;\n\n /** Custom CSS Style for overlay */\n backgroundStyle?: React.CSSProperties;\n /** Custom CSS Style for title */\n titleStyle?: React.CSSProperties;\n /** Custom CSS Style for footer */\n footerStyle?: React.CSSProperties;\n /** Custom CSS class name for the content */\n contentClassName?: string;\n /** Custom CSS Style for the content */\n contentStyle?: React.CSSProperties;\n}\n\n/** @internal */\ninterface DialogState {\n rightResizing: boolean;\n downResizing: boolean;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n}\n\n/**\n * Dialog React component with optional resizing and dragging functionality\n * @public\n */\nexport class Dialog extends React.Component<DialogProps, DialogState> {\n private _parentDocument = document;\n private _containerRef = React.createRef<HTMLDivElement>();\n public static defaultProps: Partial<DialogProps> = {\n minWidth: 300,\n minHeight: 135,\n maxWidth: \"100%\",\n width: \"50%\",\n hideHeader: false,\n resizable: false,\n movable: false,\n modal: true,\n inset: true,\n trapFocus: false,\n };\n\n /** @internal */\n public override readonly state: Readonly<DialogState>;\n\n constructor(props: DialogProps) {\n super(props);\n this.state = {\n rightResizing: false,\n downResizing: false,\n };\n }\n\n private getParentWindow() {\n // istanbul ignore next\n return this._parentDocument.defaultView ?? window;\n }\n\n public override componentWillUnmount(): void {\n const parentWindow = this.getParentWindow();\n parentWindow.removeEventListener(\"pointerup\", this._handlePointerUp, true);\n parentWindow.removeEventListener(\n \"pointermove\",\n this._handlePointerMove,\n true\n );\n this._parentDocument.removeEventListener(\"keyup\", this._handleKeyUp, true);\n }\n\n public override componentDidMount(): void {\n const parentWindow = this.getParentWindow();\n parentWindow.addEventListener(\"pointerup\", this._handlePointerUp, true);\n this._parentDocument.addEventListener(\"keyup\", this._handleKeyUp, true);\n }\n\n // istanbul ignore next\n public handleRefSet = (containerDiv: HTMLDivElement | null) => {\n if (containerDiv) this._parentDocument = containerDiv.ownerDocument;\n };\n\n public override render(): React.ReactElement {\n const {\n opened,\n title,\n footer,\n buttonCluster,\n onClose,\n onEscape,\n onOutsideClick,\n minWidth,\n minHeight,\n x,\n y,\n width,\n height,\n maxHeight,\n maxWidth,\n backgroundStyle,\n titleStyle,\n footerStyle,\n style,\n contentStyle,\n contentClassName,\n modal,\n resizable,\n movable,\n className,\n alignment,\n inset,\n trapFocus,\n modelessId,\n onModelessPointerDown,\n hideHeader,\n header,\n ...props\n } = this.props;\n\n let initialOffset: React.CSSProperties = {};\n if (x || y) {\n initialOffset = {\n left: x ?? 0,\n top: y ?? 0,\n transform: \"none\",\n };\n }\n\n const containerStyle: React.CSSProperties = {\n ...initialOffset,\n margin: \"\",\n width,\n height,\n };\n\n // istanbul ignore else\n if (this.state.width !== undefined) containerStyle.width = this.state.width;\n // istanbul ignore else\n if (this.state.height !== undefined)\n containerStyle.height = this.state.height;\n\n const minMaxStyle: React.CSSProperties = {\n minWidth,\n minHeight,\n maxWidth,\n maxHeight,\n };\n const dialogBaseContainerStyle: React.CSSProperties = {\n ...containerStyle,\n ...minMaxStyle,\n };\n\n const buttons = this.getFooterButtons(\n buttonCluster,\n \"high-visibility\",\n true\n );\n\n return (\n <BaseDialog\n isOpen={opened}\n onClose={onClose}\n closeOnExternalClick={false}\n closeOnEsc={false}\n style={style}\n className={classnames(\"core-dialog\", className)}\n isDraggable={movable}\n trapFocus={trapFocus && /* istanbul ignore next */ modal}\n preventDocumentScroll={true}\n data-testid=\"core-dialog-root\"\n {...props}\n >\n {modal && <BaseDialog.Backdrop style={backgroundStyle} />}\n <DivWithOutsideClick onOutsideClick={onOutsideClick}>\n <BaseDialog.Main\n ref={this._containerRef}\n className={classnames(\n \"core-dialog-main\",\n alignment && this.getCSSClassNameFromAlignment(alignment)\n )}\n data-testid=\"core-dialog-container\"\n style={dialogBaseContainerStyle}\n onPointerDown={this._handleContainerPointerDown}\n >\n {!hideHeader &&\n (header || (\n <BaseDialog.TitleBar\n titleText={title}\n style={titleStyle}\n data-testid=\"core-dialog-head\"\n />\n ))}\n <BaseDialog.Content\n className={contentClassName}\n style={{ padding: inset ? undefined : 0, ...contentStyle }}\n >\n {this.props.children}\n </BaseDialog.Content>\n {footer || (\n <BaseDialog.ButtonBar style={footerStyle}>\n {buttons}\n </BaseDialog.ButtonBar>\n )}\n {resizable && (\n <>\n <div\n className={classnames(\n \"core-dialog-resize-bar\",\n \"core-drag-right\"\n )}\n onPointerDown={this._handleStartResizeRight}\n data-testid=\"core-dialog-drag-right\"\n />\n <div\n className={classnames(\n \"core-dialog-resize-bar\",\n \"core-drag-bottom-right\"\n )}\n onPointerDown={this._handleStartResizeDownRight}\n data-testid=\"core-dialog-drag-bottom-right\"\n />\n <div\n className={classnames(\n \"core-dialog-resize-bar\",\n \"core-drag-bottom\"\n )}\n onPointerDown={this._handleStartResizeDown}\n data-testid=\"core-dialog-drag-bottom\"\n />\n </>\n )}\n </BaseDialog.Main>\n </DivWithOutsideClick>\n </BaseDialog>\n );\n }\n\n private getCSSClassNameFromAlignment(alignment: DialogAlignment): string {\n switch (alignment) {\n case DialogAlignment.TopLeft:\n return \"core-align-top-left\";\n case DialogAlignment.Top:\n return \"core-align-top\";\n case DialogAlignment.TopRight:\n return \"core-align-top-right\";\n case DialogAlignment.Left:\n return \"core-align-left\";\n case DialogAlignment.Center:\n return \"core-align-center\";\n case DialogAlignment.Right:\n return \"core-align-right\";\n case DialogAlignment.BottomLeft:\n return \"core-align-bottom-left\";\n case DialogAlignment.Bottom:\n return \"core-align-bottom\";\n case DialogAlignment.BottomRight:\n return \"core-align-bottom-right\";\n }\n }\n\n protected getFooterButtons(\n buttonCluster: DialogButtonDef[] | undefined,\n /* istanbul ignore next */ primaryStyleType: ButtonProps[\"styleType\"] = \"cta\",\n /* istanbul ignore next */ noCoreButtonClasses: boolean = false\n ): React.ReactNode[] | undefined {\n if (buttonCluster === undefined) return undefined;\n\n const buttons: React.ReactNode[] = [];\n buttonCluster.forEach((button: DialogButtonDef, index: number) => {\n let buttonText = \"\";\n // istanbul ignore next\n let buttonClass = classnames(\n !noCoreButtonClasses && \"core-dialog-button\",\n !noCoreButtonClasses && `dialog-button-${button.type}`,\n button.className\n );\n let usePrimaryStyleType = false;\n\n switch (button.type) {\n case DialogButtonType.OK:\n buttonText = UiCore.translate(\"dialog.ok\");\n buttonClass = classnames(buttonClass, button.buttonStyle);\n usePrimaryStyleType = true;\n break;\n case DialogButtonType.Retry:\n buttonText = UiCore.translate(\"dialog.retry\");\n buttonClass = classnames(buttonClass, button.buttonStyle);\n usePrimaryStyleType = true;\n break;\n case DialogButtonType.Yes:\n buttonText = UiCore.translate(\"dialog.yes\");\n buttonClass = classnames(buttonClass, button.buttonStyle);\n usePrimaryStyleType = true;\n break;\n case DialogButtonType.No:\n buttonText = UiCore.translate(\"dialog.no\");\n buttonClass = classnames(buttonClass, button.buttonStyle);\n break;\n case DialogButtonType.Cancel:\n buttonText = UiCore.translate(\"dialog.cancel\");\n buttonClass = classnames(buttonClass, button.buttonStyle);\n break;\n case DialogButtonType.Close:\n buttonText = UiCore.translate(\"dialog.close\");\n buttonClass = classnames(buttonClass, button.buttonStyle);\n break;\n case DialogButtonType.Next:\n buttonText = UiCore.translate(\"dialog.next\");\n buttonClass = classnames(buttonClass, button.buttonStyle);\n usePrimaryStyleType = true;\n break;\n case DialogButtonType.Previous:\n buttonText = UiCore.translate(\"dialog.previous\");\n buttonClass = classnames(buttonClass, button.buttonStyle);\n usePrimaryStyleType = true;\n break;\n }\n\n if (button.label) buttonText = button.label;\n\n buttons.push(\n <Button\n className={buttonClass}\n disabled={button.disabled}\n styleType={usePrimaryStyleType ? primaryStyleType : undefined}\n key={index.toString()}\n onClick={button.onClick}\n >\n {buttonText}\n </Button>\n );\n });\n return buttons;\n }\n\n private _handleKeyUp = (event: KeyboardEvent) => {\n if (\n event.key === SpecialKey.Escape &&\n this.props.opened &&\n this.props.onEscape\n ) {\n this.props.onEscape();\n }\n };\n\n protected _handleContainerPointerDown = (event: React.PointerEvent): void => {\n if (!this.props.modal) {\n if (this.props.onModelessPointerDown && this.props.modelessId)\n this.props.onModelessPointerDown(event, this.props.modelessId);\n }\n };\n\n private _handleStartResizeRight = (event: React.PointerEvent): void => {\n event.preventDefault();\n this.setState({ rightResizing: true });\n const parentWindow = this.getParentWindow();\n parentWindow.addEventListener(\"pointermove\", this._handlePointerMove, true);\n };\n\n private _handleStartResizeDown = (event: React.PointerEvent): void => {\n event.preventDefault();\n this.setState({ downResizing: true });\n const parentWindow = this.getParentWindow();\n parentWindow.addEventListener(\"pointermove\", this._handlePointerMove, true);\n };\n\n private _handleStartResizeDownRight = (event: React.PointerEvent): void => {\n event.preventDefault();\n this.setState({ downResizing: true, rightResizing: true });\n const parentWindow = this.getParentWindow();\n parentWindow.addEventListener(\"pointermove\", this._handlePointerMove, true);\n };\n\n private _handlePointerMove = (event: PointerEvent): void => {\n // istanbul ignore next\n if (!this.props.resizable || !this._containerRef.current) return;\n\n const { minWidth, maxWidth, minHeight, maxHeight } = this.props;\n let { x, y, width, height } = this.state;\n\n // istanbul ignore else\n if (x === undefined) {\n // if x is undefined, so is y, width, and height\n const rect = this._containerRef.current.getBoundingClientRect();\n (width = rect.width),\n (height = rect.height),\n (x = rect.left),\n (y = rect.top);\n }\n\n if (this.state.rightResizing) {\n const pointerX = event.clientX;\n width = pointerX - x;\n // istanbul ignore else\n if (typeof minWidth === \"number\") width = Math.max(width, minWidth);\n if (maxWidth !== undefined && typeof maxWidth === \"number\")\n width = Math.min(width, maxWidth);\n }\n\n if (this.state.downResizing) {\n const pointerY = event.clientY;\n height = pointerY - y!;\n // istanbul ignore else\n if (typeof minHeight === \"number\") height = Math.max(height, minHeight);\n if (maxHeight !== undefined && typeof maxHeight === \"number\")\n height = Math.min(height, maxHeight);\n }\n\n this.setState({ width, height });\n };\n\n private _handlePointerUp = (_event: PointerEvent): void => {\n if (!this.props.resizable) return;\n\n // istanbul ignore else\n if (this._containerRef.current) {\n this.setState({\n rightResizing: false,\n downResizing: false,\n });\n }\n\n const parentWindow = this.getParentWindow();\n parentWindow.removeEventListener(\n \"pointermove\",\n this._handlePointerMove,\n true\n );\n };\n}\n"]}
@@ -1,245 +1,87 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
5
- @import "../icons/variables";
6
- @import "../inputs/variables";
7
- @import "../style/themecolors";
8
- @import "../text/block";
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
9
5
  @import "../z-index";
10
- @import "../scrollbar";
11
-
12
- // cspell:ignore titlebar outoffocus nwse
13
6
 
14
7
  .core-dialog {
15
- font-family: var(--iui-font-sans);
16
-
17
- display: none;
18
- position: fixed;
19
-
20
8
  @include uicore-z-index(dialog);
21
9
 
22
- left: 0px;
23
- top: 0px;
24
- width: 100%;
25
- height: 100%;
26
- overflow: auto;
27
- background: rgba(0, 0, 0, 0.4);
28
-
29
- &.core-dialog-opened {
30
- display: block;
31
- }
32
-
33
- &.core-dialog-hidden {
34
- background-color: transparent;
35
- pointer-events: none;
10
+ > .core-dialog-main {
11
+ display: flex;
12
+ flex-direction: column;
36
13
 
37
- & > * {
38
- pointer-events: all;
14
+ &.core-align-top-left {
15
+ top: 0px;
16
+ left: 0px;
17
+ transform: none;
39
18
  }
40
- }
41
-
42
- .core-dialog-container {
43
- position: fixed;
44
-
45
- &.core-dialog-top-left {
46
- top: 0;
47
- left: 0;
19
+ &.core-align-top {
20
+ top: 0px;
21
+ left: 50%;
22
+ transform: translateX(-50%);
48
23
  }
49
-
50
- &.core-dialog-top {
51
- top: 0;
52
- left: 0;
53
- right: 0;
24
+ &.core-align-top-right {
25
+ top: 0px;
26
+ left: 100%;
27
+ transform: translateX(-100%);
54
28
  }
55
-
56
- &.core-dialog-top-right {
57
- top: 0;
58
- right: 0;
59
- }
60
-
61
- &.core-dialog-left {
62
- left: 0;
29
+ &.core-align-left {
63
30
  top: 50%;
31
+ left: 0px;
64
32
  transform: translateY(-50%);
65
33
  }
66
-
67
- &.core-dialog-center {
34
+ &.core-align-center {
68
35
  top: 50%;
69
36
  left: 50%;
70
37
  transform: translate(-50%, -50%);
71
38
  }
72
-
73
- &.core-dialog-right {
74
- right: 0;
39
+ &.core-align-right {
75
40
  top: 50%;
76
- transform: translateY(-50%);
41
+ left: 100%;
42
+ transform: translate(-100%, -50%);
77
43
  }
78
-
79
- &.core-dialog-bottom-left {
80
- bottom: 0;
81
- left: 0;
44
+ &.core-align-bottom-left {
45
+ top: 100%;
46
+ left: 0px;
47
+ transform: translateY(-100%);
82
48
  }
83
-
84
- &.core-dialog-bottom {
85
- bottom: 0;
86
- left: 0;
87
- right: 0;
49
+ &.core-align-bottom {
50
+ top: 100%;
51
+ left: 50%;
52
+ transform: translate(-50%, -100%);
88
53
  }
89
-
90
- &.core-dialog-bottom-right {
91
- bottom: 0;
92
- right: 0;
54
+ &.core-align-bottom-right {
55
+ top: 100%;
56
+ left: 100%;
57
+ transform: translate(-100%, -100%);
93
58
  }
59
+ }
94
60
 
95
- margin: auto;
96
- width: 60%;
97
- display: flex;
98
- flex-direction: column;
99
- height: fit-content;
100
-
101
- .core-dialog-area {
102
- position: relative;
103
- display: flex;
104
- flex-grow: 1;
105
- flex-direction: column;
106
- border: 1px solid var(--iui-color-border);
107
- border-radius: var(--iui-border-radius-1);
108
- background-color: var(--iui-color-background);
109
- color: var(--iui-color-text);
110
- padding: 0;
111
-
112
- > .core-dialog-head {
113
- flex-shrink: 0;
114
- align-items: center;
115
- background-color: var(--iui-color-background-backdrop);
116
- color: var(--iui-color-text);
117
- display: flex;
118
- padding: 4px;
119
-
120
- /* padding: $uicore-unbordered-padding; */
121
- &.core-dialog-movable {
122
- cursor: move;
123
- }
124
-
125
- > .core-dialog-title {
126
- flex: 1 1;
127
-
128
- padding: 0;
129
- border: none;
130
- vertical-align: baseline;
131
- font-size: var(--iui-font-size-2);
132
- font-weight: var(--iui-font-weight-normal);
133
- line-height: var(--iui-size-l);
134
-
135
- margin: 0;
136
- margin-left: 4px;
137
- }
138
-
139
- &.core-dialog-modal {
140
- background-color: var(--iui-color-background);
141
-
142
- > .core-dialog-title {
143
- margin: 0;
144
- padding: 0;
145
- border: none;
146
- vertical-align: baseline;
147
- font-size: var(--iui-font-size-3);
148
- font-weight: var(--iui-font-weight-normal);
149
- line-height: calc(1.5 * var(--iui-size-l));
150
- }
151
- }
152
-
153
- > .core-dialog-close {
154
- cursor: pointer;
155
- height: var(--iui-font-size-4);
156
- width: var(--iui-font-size-4);
157
- line-height: var(--iui-font-size-4);
158
- flex: 0 0 $uicore-icons-medium;
159
- text-align: center;
160
- color: var(--iui-color-icon);
161
- border: none;
162
- background-color: transparent;
163
-
164
- &:hover,
165
- &:focus {
166
- color: var(--iui-color-icon-hover);
167
- }
168
- &:focus {
169
- outline: 1px solid var(--iui-color-border-accent);
170
- }
171
- }
172
- }
173
-
174
- > .core-dialog-content {
175
- overflow: auto;
176
- flex: 1 1;
177
-
178
- @include uicore-text-block;
179
-
180
- padding: $uicore-unbordered-padding;
181
- margin: 0;
182
-
183
- @include uicore-touch-scrolling;
184
- @include uicore-scrollbar();
185
-
186
- &.core-dialog-content-no-inset {
187
- padding: 0;
188
- }
189
- }
190
-
191
- > .core-dialog-footer {
192
- flex-shrink: 0;
193
- padding: 0 $uicore-unbordered-padding $uicore-unbordered-padding
194
- $uicore-unbordered-padding;
195
-
196
- > .core-dialog-buttons {
197
- display: flex;
198
- justify-content: flex-end;
199
-
200
- > * {
201
- min-width: 80px;
202
-
203
- &:not(:first-child) {
204
- margin-left: $uicore-inputs-margin;
205
- }
206
- }
207
- }
208
- }
61
+ > .core-dialog-resize-bar {
62
+ &.core-drag-right {
63
+ right: -4px;
64
+ top: 8px;
65
+ bottom: 8px;
66
+ width: 8px;
67
+ position: absolute;
68
+ cursor: e-resize;
209
69
  }
210
-
211
- $dialog-resize-bar-width: 8px;
212
-
213
- .core-dialog-drag {
70
+ &.core-drag-bottom-right {
71
+ right: -4px;
72
+ bottom: -4px;
73
+ width: 12px;
74
+ height: 12px;
214
75
  position: absolute;
215
- z-index: auto;
216
- padding: 0px;
217
-
218
- &:not(.core-dialog-drag-enabled) {
219
- display: none;
220
- }
221
-
222
- &.core-dialog-drag-right {
223
- right: -$dialog-resize-bar-width * 0.5;
224
- width: $dialog-resize-bar-width;
225
- height: 100%;
226
- cursor: ew-resize;
227
- }
228
-
229
- &.core-dialog-drag-bottom-mid {
230
- bottom: -$dialog-resize-bar-width * 0.5;
231
- height: $dialog-resize-bar-width;
232
- width: 100%;
233
- cursor: ns-resize;
234
- }
235
-
236
- &.core-dialog-drag-bottom-right {
237
- right: -$dialog-resize-bar-width * 0.5;
238
- bottom: -$dialog-resize-bar-width * 0.5;
239
- height: $dialog-resize-bar-width;
240
- width: $dialog-resize-bar-width;
241
- cursor: nwse-resize;
242
- }
76
+ cursor: se-resize;
77
+ }
78
+ &.core-drag-bottom {
79
+ right: 8px;
80
+ left: 8px;
81
+ bottom: -4px;
82
+ height: 8px;
83
+ position: absolute;
84
+ cursor: s-resize;
243
85
  }
244
86
  }
245
87
  }
@@ -1,5 +1,5 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "./list";
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "../style/index";
6
6
 
7
7
  @mixin uicore-expandable-blocks-list {
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  .core-icons-svgPath {
6
6
  display: inline-block;
7
7
  box-sizing: border-box;
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "./index";
6
6
 
7
7
  .bui-webfont-icon {
@@ -1,6 +1,6 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "./variables";
6
6
  @import "./mixins";
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "./variables";
6
6
 
7
7
  @mixin uicore-icons-small {
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
 
6
6
  // Sizes
7
7
  $uicore-icons-x-small: 12px;
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "../style/index.scss";
6
6
  @import "../icons/variables.scss";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @use "sass:math";
6
6
 
7
7
  @import "./style/index";
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "../style/index";
6
6
 
7
7
  @import "./variables";
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "../style/index";
6
6
 
7
7
  @mixin uicore-inputs-labeled-input {
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "../style/index";
6
6
  @import "./variables";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "../../base/base";
6
6
  @import "../variables";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "../style/baseline";
6
6
  @import "../style/themecolors";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "../index";
6
6
 
7
7
  $uicore-list-item-height: calc(var(--iui-size-s) * 2);