@itwin/core-react 4.2.0 → 4.3.0-dev.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.
Files changed (125) hide show
  1. package/lib/cjs/core-react/_geometry.scss +3 -3
  2. package/lib/cjs/core-react/_math.scss +3 -3
  3. package/lib/cjs/core-react/_typography.scss +3 -3
  4. package/lib/cjs/core-react/autosuggest/AutoSuggest.scss +3 -3
  5. package/lib/cjs/core-react/badge/Badge.scss +3 -3
  6. package/lib/cjs/core-react/badge/NewBadge.scss +3 -3
  7. package/lib/cjs/core-react/base/base.scss +3 -3
  8. package/lib/cjs/core-react/base/index.scss +3 -3
  9. package/lib/cjs/core-react/classes.scss +3 -3
  10. package/lib/cjs/core-react/colorthemes.scss +3 -3
  11. package/lib/cjs/core-react/colorvariables.scss +3 -3
  12. package/lib/cjs/core-react/contextmenu/ContextMenu.scss +3 -3
  13. package/lib/cjs/core-react/dialog/Dialog.d.ts +3 -10
  14. package/lib/cjs/core-react/dialog/Dialog.d.ts.map +1 -1
  15. package/lib/cjs/core-react/dialog/Dialog.js +69 -166
  16. package/lib/cjs/core-react/dialog/Dialog.js.map +1 -1
  17. package/lib/cjs/core-react/dialog/Dialog.scss +59 -217
  18. package/lib/cjs/core-react/expandable/index.scss +3 -3
  19. package/lib/cjs/core-react/expandable/list.scss +3 -3
  20. package/lib/cjs/core-react/icons/SvgPath.scss +3 -3
  21. package/lib/cjs/core-react/icons/WebFontIcon.scss +3 -3
  22. package/lib/cjs/core-react/icons/index.scss +3 -3
  23. package/lib/cjs/core-react/icons/mixins.scss +3 -3
  24. package/lib/cjs/core-react/icons/variables.scss +3 -3
  25. package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.scss +3 -3
  26. package/lib/cjs/core-react/index.scss +3 -3
  27. package/lib/cjs/core-react/inputs/index.scss +3 -3
  28. package/lib/cjs/core-react/inputs/input-label.scss +3 -3
  29. package/lib/cjs/core-react/inputs/input.scss +3 -3
  30. package/lib/cjs/core-react/inputs/numberinput/NumberInput.scss +3 -3
  31. package/lib/cjs/core-react/inputs/variables.scss +3 -3
  32. package/lib/cjs/core-react/listbox/Listbox.scss +3 -3
  33. package/lib/cjs/core-react/loading/LoadingPrompt.scss +3 -3
  34. package/lib/cjs/core-react/loading/LoadingSpinner.scss +3 -3
  35. package/lib/cjs/core-react/loading/index.scss +3 -3
  36. package/lib/cjs/core-react/loading/mixins.scss +3 -3
  37. package/lib/cjs/core-react/messagebox/MessageBox.d.ts.map +1 -1
  38. package/lib/cjs/core-react/messagebox/MessageBox.js +2 -2
  39. package/lib/cjs/core-react/messagebox/MessageBox.js.map +1 -1
  40. package/lib/cjs/core-react/messagebox/MessageBox.scss +3 -3
  41. package/lib/cjs/core-react/popup/Popup.scss +3 -3
  42. package/lib/cjs/core-react/radialmenu/RadialMenu.scss +3 -3
  43. package/lib/cjs/core-react/searchbox/SearchBox.scss +3 -3
  44. package/lib/cjs/core-react/settings/SettingsContainer.scss +3 -3
  45. package/lib/cjs/core-react/style/baseline.scss +3 -3
  46. package/lib/cjs/core-react/style/index.scss +3 -3
  47. package/lib/cjs/core-react/style/opacity.scss +3 -3
  48. package/lib/cjs/core-react/tabs/index.scss +3 -3
  49. package/lib/cjs/core-react/tabs/tabs.scss +3 -3
  50. package/lib/cjs/core-react/tabs/vertical.scss +3 -3
  51. package/lib/cjs/core-react/text/FilteredText.scss +3 -3
  52. package/lib/cjs/core-react/text/block.scss +3 -3
  53. package/lib/cjs/core-react/text/body.scss +3 -3
  54. package/lib/cjs/core-react/text/index.scss +3 -3
  55. package/lib/cjs/core-react/text/mixins.scss +3 -3
  56. package/lib/cjs/core-react/tree/ExpansionToggle.scss +3 -3
  57. package/lib/cjs/core-react/tree/Placeholder.scss +3 -3
  58. package/lib/cjs/core-react/tree/Tree.scss +3 -3
  59. package/lib/esm/core-react/_geometry.scss +3 -3
  60. package/lib/esm/core-react/_math.scss +3 -3
  61. package/lib/esm/core-react/_typography.scss +3 -3
  62. package/lib/esm/core-react/autosuggest/AutoSuggest.scss +3 -3
  63. package/lib/esm/core-react/badge/Badge.scss +3 -3
  64. package/lib/esm/core-react/badge/NewBadge.scss +3 -3
  65. package/lib/esm/core-react/base/base.scss +3 -3
  66. package/lib/esm/core-react/base/index.scss +3 -3
  67. package/lib/esm/core-react/classes.scss +3 -3
  68. package/lib/esm/core-react/colorthemes.scss +3 -3
  69. package/lib/esm/core-react/colorvariables.scss +3 -3
  70. package/lib/esm/core-react/contextmenu/ContextMenu.scss +3 -3
  71. package/lib/esm/core-react/dialog/Dialog.d.ts +3 -10
  72. package/lib/esm/core-react/dialog/Dialog.d.ts.map +1 -1
  73. package/lib/esm/core-react/dialog/Dialog.js +68 -165
  74. package/lib/esm/core-react/dialog/Dialog.js.map +1 -1
  75. package/lib/esm/core-react/dialog/Dialog.scss +59 -217
  76. package/lib/esm/core-react/expandable/index.scss +3 -3
  77. package/lib/esm/core-react/expandable/list.scss +3 -3
  78. package/lib/esm/core-react/icons/SvgPath.scss +3 -3
  79. package/lib/esm/core-react/icons/WebFontIcon.scss +3 -3
  80. package/lib/esm/core-react/icons/index.scss +3 -3
  81. package/lib/esm/core-react/icons/mixins.scss +3 -3
  82. package/lib/esm/core-react/icons/variables.scss +3 -3
  83. package/lib/esm/core-react/imagecheckbox/ImageCheckBox.scss +3 -3
  84. package/lib/esm/core-react/index.scss +3 -3
  85. package/lib/esm/core-react/inputs/index.scss +3 -3
  86. package/lib/esm/core-react/inputs/input-label.scss +3 -3
  87. package/lib/esm/core-react/inputs/input.scss +3 -3
  88. package/lib/esm/core-react/inputs/numberinput/NumberInput.scss +3 -3
  89. package/lib/esm/core-react/inputs/variables.scss +3 -3
  90. package/lib/esm/core-react/listbox/Listbox.scss +3 -3
  91. package/lib/esm/core-react/loading/LoadingPrompt.scss +3 -3
  92. package/lib/esm/core-react/loading/LoadingSpinner.scss +3 -3
  93. package/lib/esm/core-react/loading/index.scss +3 -3
  94. package/lib/esm/core-react/loading/mixins.scss +3 -3
  95. package/lib/esm/core-react/messagebox/MessageBox.d.ts.map +1 -1
  96. package/lib/esm/core-react/messagebox/MessageBox.js +2 -2
  97. package/lib/esm/core-react/messagebox/MessageBox.js.map +1 -1
  98. package/lib/esm/core-react/messagebox/MessageBox.scss +3 -3
  99. package/lib/esm/core-react/popup/Popup.scss +3 -3
  100. package/lib/esm/core-react/radialmenu/RadialMenu.scss +3 -3
  101. package/lib/esm/core-react/searchbox/SearchBox.scss +3 -3
  102. package/lib/esm/core-react/settings/SettingsContainer.scss +3 -3
  103. package/lib/esm/core-react/style/baseline.scss +3 -3
  104. package/lib/esm/core-react/style/index.scss +3 -3
  105. package/lib/esm/core-react/style/opacity.scss +3 -3
  106. package/lib/esm/core-react/tabs/index.scss +3 -3
  107. package/lib/esm/core-react/tabs/tabs.scss +3 -3
  108. package/lib/esm/core-react/tabs/vertical.scss +3 -3
  109. package/lib/esm/core-react/text/FilteredText.scss +3 -3
  110. package/lib/esm/core-react/text/block.scss +3 -3
  111. package/lib/esm/core-react/text/body.scss +3 -3
  112. package/lib/esm/core-react/text/index.scss +3 -3
  113. package/lib/esm/core-react/text/mixins.scss +3 -3
  114. package/lib/esm/core-react/tree/ExpansionToggle.scss +3 -3
  115. package/lib/esm/core-react/tree/Placeholder.scss +3 -3
  116. package/lib/esm/core-react/tree/Tree.scss +3 -3
  117. package/package.json +3 -3
  118. package/lib/cjs/core-react/dialog/SimpleDialog.d.ts +0 -68
  119. package/lib/cjs/core-react/dialog/SimpleDialog.d.ts.map +0 -1
  120. package/lib/cjs/core-react/dialog/SimpleDialog.js +0 -51
  121. package/lib/cjs/core-react/dialog/SimpleDialog.js.map +0 -1
  122. package/lib/esm/core-react/dialog/SimpleDialog.d.ts +0 -68
  123. package/lib/esm/core-react/dialog/SimpleDialog.d.ts.map +0 -1
  124. package/lib/esm/core-react/dialog/SimpleDialog.js +0 -47
  125. package/lib/esm/core-react/dialog/SimpleDialog.js.map +0 -1
@@ -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 "../z-index";
6
6
  @import "../style/themecolors";
7
7
  @import "../icons/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/themecolors";
6
6
 
7
7
  .core-searchbox {
@@ -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
  @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
  $uicore-baseline: var(--iui-size-s);
6
6
  $uicore-line-height: var(--iui-size-l); /// 22px; /// ~1.618;
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 "./baseline";
6
6
  @import "./breakpoints";
7
7
  @import "./themecolors";
@@ -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
  /// Opacity stops:
6
6
 
7
7
  $uicore-opacity-1: var(--iui-opacity-1);
@@ -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 "./vertical";
@@ -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 "../icons/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/index";
6
6
  @import "./tabs";
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/themecolors";
6
6
 
7
7
  .uicore-filtered-text-match {
@@ -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
  @mixin uicore-text-block {
6
6
  margin: 0;
7
7
  padding: 0;
@@ -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
  @mixin uicore-text-body {
6
6
  margin: 0;
7
7
  padding: 0;
@@ -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 "./mixins";
6
6
 
7
7
  @import "./body";
@@ -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/themecolors";
6
6
 
7
7
  @mixin uicore-text-block-spacing {
@@ -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
  .core-tree-expansionToggle {
7
7
  &:focus {
@@ -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
  .core-tree-placeholder {
7
7
  display: block;
@@ -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
  .core-tree {
7
7
  user-select: none;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/core-react",
3
- "version": "4.2.0",
3
+ "version": "4.3.0-dev.1",
4
4
  "description": "iTwin.js UI core components",
5
5
  "main": "lib/cjs/core-react.js",
6
6
  "module": "lib/esm/core-react.js",
@@ -54,7 +54,7 @@
54
54
  "@types/react": "^17.0.37",
55
55
  "@types/react-autosuggest": "10.1.2",
56
56
  "@types/react-dom": "^17.0.0",
57
- "@types/sinon": "^9.0.0",
57
+ "@types/sinon": "^10.0.15",
58
58
  "@types/sinon-chai": "^3.2.0",
59
59
  "chai": "^4.1.2",
60
60
  "chai-as-promised": "^7",
@@ -71,7 +71,7 @@
71
71
  "react-dom": "^17.0.0",
72
72
  "react-test-renderer": "^17.0.0",
73
73
  "rimraf": "^3.0.2",
74
- "sinon": "^9.0.2",
74
+ "sinon": "^15.2.0",
75
75
  "sinon-chai": "^3.2.0",
76
76
  "ts-node": "^10.8.2",
77
77
  "typemoq": "^2.1.0",
@@ -1,68 +0,0 @@
1
- /** @packageDocumentation
2
- * @module Dialog
3
- */
4
- import "./Dialog.scss";
5
- import * as React from "react";
6
- import type { DialogButtonDef } from "@itwin/appui-abstract";
7
- import type { CommonProps } from "../utils/Props";
8
- import type { Omit } from "../utils/typeUtils";
9
- import { Dialog as CoreDialog } from "./Dialog";
10
- /** Properties of [[SimpleDialog]] component.
11
- * @internal
12
- */
13
- export interface SimpleDialogProps extends Omit<React.AllHTMLAttributes<HTMLDivElement>, "title">, CommonProps {
14
- /** Indicates whether to show dialog or not */
15
- opened: boolean;
16
- /** Indicates whether the focus should be trapped within the dialog. Default: false */
17
- trapFocus?: boolean;
18
- /** Whether the hide the header. Default: false */
19
- hideHeader?: boolean;
20
- /** Title to show in title bar of dialog */
21
- title?: string | JSX.Element;
22
- /** List of DialogButtonDef objects specifying buttons and associated onClick events */
23
- buttonCluster?: DialogButtonDef[];
24
- /** onClick event for X button for dialog */
25
- onClose?: () => void;
26
- /** 'keyup' event for Esc key */
27
- onEscape?: () => void;
28
- /** Triggered when a click is triggered outside of this dialog. */
29
- onOutsideClick?: (event: MouseEvent) => any;
30
- /** Whether to show background overlay. Default: true.
31
- * @note Modeless dialogs require an id and an implementation of onModelessPointerDown.
32
- */
33
- modal?: boolean;
34
- /** An id for a modeless dialog */
35
- modelessId?: string;
36
- /** Pointer Down event handler when modeless (modal = false) */
37
- onModelessPointerDown?: (event: React.PointerEvent, id: string) => void;
38
- /** Initial width of dialog. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. Default: "50%" */
39
- width?: string | number;
40
- /** Initial height of dialog. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */
41
- height?: string | number;
42
- /** 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 */
43
- minWidth?: string | number;
44
- /** 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 */
45
- minHeight?: string | number;
46
- /** Maximum width that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */
47
- maxWidth?: string | number;
48
- /** Maximum height that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */
49
- maxHeight?: string | number;
50
- /** Custom CSS Style for overlay */
51
- backgroundStyle?: React.CSSProperties;
52
- /** Custom CSS Style for title */
53
- titleStyle?: React.CSSProperties;
54
- /** Custom CSS Style for footer */
55
- footerStyle?: React.CSSProperties;
56
- /** Custom CSS class name for the content */
57
- contentClassName?: string;
58
- /** Custom CSS Style for the content */
59
- contentStyle?: React.CSSProperties;
60
- }
61
- /** itwinui-react [[Dialog]] wrapper that excludes buggy features and adds features from core-react [[Dialog]].
62
- * @internal
63
- */
64
- export declare class SimpleDialog extends CoreDialog {
65
- constructor(props: SimpleDialogProps);
66
- render(): JSX.Element;
67
- }
68
- //# sourceMappingURL=SimpleDialog.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SimpleDialog.d.ts","sourceRoot":"","sources":["../../../../src/core-react/dialog/SimpleDialog.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,eAAe,CAAC;AACvB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,UAAU,CAAC;AAGhD;;GAEG;AACH,MAAM,WAAW,iBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,EAC5D,WAAW;IACb,8CAA8C;IAC9C,MAAM,EAAE,OAAO,CAAC;IAChB,sFAAsF;IACtF,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,kDAAkD;IAClD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;IAC7B,uFAAuF;IACvF,aAAa,CAAC,EAAE,eAAe,EAAE,CAAC;IAElC,4CAA4C;IAC5C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,kEAAkE;IAClE,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,GAAG,CAAC;IAE5C;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+DAA+D;IAC/D,qBAAqB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAExE,gIAAgI;IAChI,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,kHAAkH;IAClH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,wJAAwJ;IACxJ,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,yJAAyJ;IACzJ,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,yIAAyI;IACzI,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,0IAA0I;IAC1I,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE5B,mCAAmC;IACnC,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACtC,iCAAiC;IACjC,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACjC,kCAAkC;IAClC,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAClC,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uCAAuC;IACvC,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACpC;AAED;;GAEG;AACH,qBAAa,YAAa,SAAQ,UAAU;gBAC9B,KAAK,EAAE,iBAAiB;IAIpB,MAAM,IAAI,GAAG,CAAC,OAAO;CAkFtC"}
@@ -1,51 +0,0 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- /** @packageDocumentation
7
- * @module Dialog
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.SimpleDialog = void 0;
11
- require("./Dialog.scss");
12
- const React = require("react");
13
- const DivWithOutsideClick_1 = require("../base/DivWithOutsideClick");
14
- const Dialog_1 = require("./Dialog");
15
- const itwinui_react_1 = require("@itwin/itwinui-react");
16
- /** itwinui-react [[Dialog]] wrapper that excludes buggy features and adds features from core-react [[Dialog]].
17
- * @internal
18
- */
19
- class SimpleDialog extends Dialog_1.Dialog {
20
- constructor(props) {
21
- super(props);
22
- }
23
- render() {
24
- const { opened, title, buttonCluster, onClose, onOutsideClick, minWidth, minHeight, width, height, maxHeight, maxWidth, backgroundStyle, titleStyle, footerStyle, style, contentStyle, contentClassName, className, trapFocus, modal, hideHeader, ...props } = this.props;
25
- const containerStyle = {
26
- margin: "",
27
- width,
28
- height,
29
- };
30
- const minMaxStyle = {
31
- minWidth,
32
- minHeight,
33
- maxWidth,
34
- maxHeight,
35
- };
36
- const dialogBaseContainerStyle = {
37
- ...containerStyle,
38
- ...minMaxStyle,
39
- };
40
- const buttons = this.getFooterButtons(buttonCluster, "high-visibility", true);
41
- return (React.createElement(itwinui_react_1.Dialog, { isOpen: opened, onClose: onClose, closeOnExternalClick: false, closeOnEsc: false, style: style, className: className, isResizable: false, isDraggable: false, trapFocus: trapFocus && /* istanbul ignore next */ modal, preventDocumentScroll: true, "data-testid": "core-dialog-root", ...props },
42
- modal && React.createElement(itwinui_react_1.Dialog.Backdrop, { style: backgroundStyle }),
43
- React.createElement(DivWithOutsideClick_1.DivWithOutsideClick, { onOutsideClick: onOutsideClick },
44
- React.createElement(itwinui_react_1.Dialog.Main, { "data-testid": "core-dialog-container", style: dialogBaseContainerStyle, onPointerDown: this._handleContainerPointerDown },
45
- !hideHeader && (React.createElement(itwinui_react_1.Dialog.TitleBar, { titleText: title, style: titleStyle })),
46
- React.createElement(itwinui_react_1.Dialog.Content, { className: contentClassName, style: contentStyle }, this.props.children),
47
- React.createElement(itwinui_react_1.Dialog.ButtonBar, { style: footerStyle }, buttons)))));
48
- }
49
- }
50
- exports.SimpleDialog = SimpleDialog;
51
- //# sourceMappingURL=SimpleDialog.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SimpleDialog.js","sourceRoot":"","sources":["../../../../src/core-react/dialog/SimpleDialog.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,yBAAuB;AACvB,+BAA+B;AAE/B,qEAAkE;AAGlE,qCAAgD;AAChD,wDAA8C;AA6D9C;;GAEG;AACH,MAAa,YAAa,SAAQ,eAAU;IAC1C,YAAY,KAAwB;QAClC,KAAK,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;IAEe,MAAM;QACpB,MAAM,EACJ,MAAM,EACN,KAAK,EACL,aAAa,EACb,OAAO,EACP,cAAc,EACd,QAAQ,EACR,SAAS,EACT,KAAK,EACL,MAAM,EACN,SAAS,EACT,QAAQ,EACR,eAAe,EACf,UAAU,EACV,WAAW,EACX,KAAK,EACL,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,SAAS,EACT,KAAK,EACL,UAAU,EACV,GAAG,KAAK,EACT,GAAG,IAAI,CAAC,KAAK,CAAC;QAEf,MAAM,cAAc,GAAwB;YAC1C,MAAM,EAAE,EAAE;YACV,KAAK;YACL,MAAM;SACP,CAAC;QACF,MAAM,WAAW,GAAwB;YACvC,QAAQ;YACR,SAAS;YACT,QAAQ;YACR,SAAS;SACV,CAAC;QACF,MAAM,wBAAwB,GAAwB;YACpD,GAAG,cAAc;YACjB,GAAG,WAAW;SACf,CAAC;QAEF,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CACnC,aAAa,EACb,iBAAiB,EACjB,IAAI,CACL,CAAC;QAEF,OAAO,CACL,oBAAC,sBAAM,IACL,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,oBAAoB,EAAE,KAAK,EAC3B,UAAU,EAAE,KAAK,EACjB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,KAAK,EAClB,WAAW,EAAE,KAAK,EAClB,SAAS,EAAE,SAAS,IAAI,0BAA0B,CAAC,KAAK,EACxD,qBAAqB,EAAE,IAAI,iBACf,kBAAkB,KAC1B,KAAK;YAER,KAAK,IAAI,oBAAC,sBAAM,CAAC,QAAQ,IAAC,KAAK,EAAE,eAAe,GAAI;YACrD,oBAAC,yCAAmB,IAAC,cAAc,EAAE,cAAc;gBACjD,oBAAC,sBAAM,CAAC,IAAI,mBACE,uBAAuB,EACnC,KAAK,EAAE,wBAAwB,EAC/B,aAAa,EAAE,IAAI,CAAC,2BAA2B;oBAE9C,CAAC,UAAU,IAAI,CACd,oBAAC,sBAAM,CAAC,QAAQ,IAAC,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,GAAI,CACzD;oBACD,oBAAC,sBAAM,CAAC,OAAO,IAAC,SAAS,EAAE,gBAAgB,EAAE,KAAK,EAAE,YAAY,IAC7D,IAAI,CAAC,KAAK,CAAC,QAAQ,CACL;oBACjB,oBAAC,sBAAM,CAAC,SAAS,IAAC,KAAK,EAAE,WAAW,IAAG,OAAO,CAAoB,CACtD,CACM,CACf,CACV,CAAC;IACJ,CAAC;CACF;AAvFD,oCAuFC","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 * as React from \"react\";\nimport type { DialogButtonDef } from \"@itwin/appui-abstract\";\nimport { DivWithOutsideClick } from \"../base/DivWithOutsideClick\";\nimport type { CommonProps } from \"../utils/Props\";\nimport type { Omit } from \"../utils/typeUtils\";\nimport { Dialog as CoreDialog } from \"./Dialog\";\nimport { Dialog } from \"@itwin/itwinui-react\";\n\n/** Properties of [[SimpleDialog]] component.\n * @internal\n */\nexport interface SimpleDialogProps\n extends Omit<React.AllHTMLAttributes<HTMLDivElement>, \"title\">,\n CommonProps {\n /** Indicates whether to show dialog or not */\n opened: 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 /** Title to show in title bar of dialog */\n title?: string | JSX.Element;\n /** List of DialogButtonDef objects specifying buttons and associated onClick events */\n buttonCluster?: DialogButtonDef[];\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 /** 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 /** 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 /** 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/** itwinui-react [[Dialog]] wrapper that excludes buggy features and adds features from core-react [[Dialog]].\n * @internal\n */\nexport class SimpleDialog extends CoreDialog {\n constructor(props: SimpleDialogProps) {\n super(props);\n }\n\n public override render(): JSX.Element {\n const {\n opened,\n title,\n buttonCluster,\n onClose,\n onOutsideClick,\n minWidth,\n minHeight,\n width,\n height,\n maxHeight,\n maxWidth,\n backgroundStyle,\n titleStyle,\n footerStyle,\n style,\n contentStyle,\n contentClassName,\n className,\n trapFocus,\n modal,\n hideHeader,\n ...props\n } = this.props;\n\n const containerStyle: React.CSSProperties = {\n margin: \"\",\n width,\n 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 <Dialog\n isOpen={opened}\n onClose={onClose}\n closeOnExternalClick={false}\n closeOnEsc={false}\n style={style}\n className={className}\n isResizable={false}\n isDraggable={false}\n trapFocus={trapFocus && /* istanbul ignore next */ modal}\n preventDocumentScroll={true}\n data-testid=\"core-dialog-root\"\n {...props}\n >\n {modal && <Dialog.Backdrop style={backgroundStyle} />}\n <DivWithOutsideClick onOutsideClick={onOutsideClick}>\n <Dialog.Main\n data-testid=\"core-dialog-container\"\n style={dialogBaseContainerStyle}\n onPointerDown={this._handleContainerPointerDown}\n >\n {!hideHeader && (\n <Dialog.TitleBar titleText={title} style={titleStyle} />\n )}\n <Dialog.Content className={contentClassName} style={contentStyle}>\n {this.props.children}\n </Dialog.Content>\n <Dialog.ButtonBar style={footerStyle}>{buttons}</Dialog.ButtonBar>\n </Dialog.Main>\n </DivWithOutsideClick>\n </Dialog>\n );\n }\n}\n"]}
@@ -1,68 +0,0 @@
1
- /** @packageDocumentation
2
- * @module Dialog
3
- */
4
- import "./Dialog.scss";
5
- import * as React from "react";
6
- import type { DialogButtonDef } from "@itwin/appui-abstract";
7
- import type { CommonProps } from "../utils/Props";
8
- import type { Omit } from "../utils/typeUtils";
9
- import { Dialog as CoreDialog } from "./Dialog";
10
- /** Properties of [[SimpleDialog]] component.
11
- * @internal
12
- */
13
- export interface SimpleDialogProps extends Omit<React.AllHTMLAttributes<HTMLDivElement>, "title">, CommonProps {
14
- /** Indicates whether to show dialog or not */
15
- opened: boolean;
16
- /** Indicates whether the focus should be trapped within the dialog. Default: false */
17
- trapFocus?: boolean;
18
- /** Whether the hide the header. Default: false */
19
- hideHeader?: boolean;
20
- /** Title to show in title bar of dialog */
21
- title?: string | JSX.Element;
22
- /** List of DialogButtonDef objects specifying buttons and associated onClick events */
23
- buttonCluster?: DialogButtonDef[];
24
- /** onClick event for X button for dialog */
25
- onClose?: () => void;
26
- /** 'keyup' event for Esc key */
27
- onEscape?: () => void;
28
- /** Triggered when a click is triggered outside of this dialog. */
29
- onOutsideClick?: (event: MouseEvent) => any;
30
- /** Whether to show background overlay. Default: true.
31
- * @note Modeless dialogs require an id and an implementation of onModelessPointerDown.
32
- */
33
- modal?: boolean;
34
- /** An id for a modeless dialog */
35
- modelessId?: string;
36
- /** Pointer Down event handler when modeless (modal = false) */
37
- onModelessPointerDown?: (event: React.PointerEvent, id: string) => void;
38
- /** Initial width of dialog. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. Default: "50%" */
39
- width?: string | number;
40
- /** Initial height of dialog. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */
41
- height?: string | number;
42
- /** 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 */
43
- minWidth?: string | number;
44
- /** 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 */
45
- minHeight?: string | number;
46
- /** Maximum width that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */
47
- maxWidth?: string | number;
48
- /** Maximum height that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */
49
- maxHeight?: string | number;
50
- /** Custom CSS Style for overlay */
51
- backgroundStyle?: React.CSSProperties;
52
- /** Custom CSS Style for title */
53
- titleStyle?: React.CSSProperties;
54
- /** Custom CSS Style for footer */
55
- footerStyle?: React.CSSProperties;
56
- /** Custom CSS class name for the content */
57
- contentClassName?: string;
58
- /** Custom CSS Style for the content */
59
- contentStyle?: React.CSSProperties;
60
- }
61
- /** itwinui-react [[Dialog]] wrapper that excludes buggy features and adds features from core-react [[Dialog]].
62
- * @internal
63
- */
64
- export declare class SimpleDialog extends CoreDialog {
65
- constructor(props: SimpleDialogProps);
66
- render(): JSX.Element;
67
- }
68
- //# sourceMappingURL=SimpleDialog.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SimpleDialog.d.ts","sourceRoot":"","sources":["../../../../src/core-react/dialog/SimpleDialog.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,eAAe,CAAC;AACvB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,UAAU,CAAC;AAGhD;;GAEG;AACH,MAAM,WAAW,iBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,EAC5D,WAAW;IACb,8CAA8C;IAC9C,MAAM,EAAE,OAAO,CAAC;IAChB,sFAAsF;IACtF,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,kDAAkD;IAClD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;IAC7B,uFAAuF;IACvF,aAAa,CAAC,EAAE,eAAe,EAAE,CAAC;IAElC,4CAA4C;IAC5C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,kEAAkE;IAClE,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,GAAG,CAAC;IAE5C;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+DAA+D;IAC/D,qBAAqB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAExE,gIAAgI;IAChI,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,kHAAkH;IAClH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,wJAAwJ;IACxJ,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,yJAAyJ;IACzJ,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,yIAAyI;IACzI,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,0IAA0I;IAC1I,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE5B,mCAAmC;IACnC,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACtC,iCAAiC;IACjC,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACjC,kCAAkC;IAClC,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAClC,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uCAAuC;IACvC,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACpC;AAED;;GAEG;AACH,qBAAa,YAAa,SAAQ,UAAU;gBAC9B,KAAK,EAAE,iBAAiB;IAIpB,MAAM,IAAI,GAAG,CAAC,OAAO;CAkFtC"}
@@ -1,47 +0,0 @@
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
- /** @packageDocumentation
6
- * @module Dialog
7
- */
8
- import "./Dialog.scss";
9
- import * as React from "react";
10
- import { DivWithOutsideClick } from "../base/DivWithOutsideClick";
11
- import { Dialog as CoreDialog } from "./Dialog";
12
- import { Dialog } from "@itwin/itwinui-react";
13
- /** itwinui-react [[Dialog]] wrapper that excludes buggy features and adds features from core-react [[Dialog]].
14
- * @internal
15
- */
16
- export class SimpleDialog extends CoreDialog {
17
- constructor(props) {
18
- super(props);
19
- }
20
- render() {
21
- const { opened, title, buttonCluster, onClose, onOutsideClick, minWidth, minHeight, width, height, maxHeight, maxWidth, backgroundStyle, titleStyle, footerStyle, style, contentStyle, contentClassName, className, trapFocus, modal, hideHeader, ...props } = this.props;
22
- const containerStyle = {
23
- margin: "",
24
- width,
25
- height,
26
- };
27
- const minMaxStyle = {
28
- minWidth,
29
- minHeight,
30
- maxWidth,
31
- maxHeight,
32
- };
33
- const dialogBaseContainerStyle = {
34
- ...containerStyle,
35
- ...minMaxStyle,
36
- };
37
- const buttons = this.getFooterButtons(buttonCluster, "high-visibility", true);
38
- return (React.createElement(Dialog, { isOpen: opened, onClose: onClose, closeOnExternalClick: false, closeOnEsc: false, style: style, className: className, isResizable: false, isDraggable: false, trapFocus: trapFocus && /* istanbul ignore next */ modal, preventDocumentScroll: true, "data-testid": "core-dialog-root", ...props },
39
- modal && React.createElement(Dialog.Backdrop, { style: backgroundStyle }),
40
- React.createElement(DivWithOutsideClick, { onOutsideClick: onOutsideClick },
41
- React.createElement(Dialog.Main, { "data-testid": "core-dialog-container", style: dialogBaseContainerStyle, onPointerDown: this._handleContainerPointerDown },
42
- !hideHeader && (React.createElement(Dialog.TitleBar, { titleText: title, style: titleStyle })),
43
- React.createElement(Dialog.Content, { className: contentClassName, style: contentStyle }, this.props.children),
44
- React.createElement(Dialog.ButtonBar, { style: footerStyle }, buttons)))));
45
- }
46
- }
47
- //# sourceMappingURL=SimpleDialog.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SimpleDialog.js","sourceRoot":"","sources":["../../../../src/core-react/dialog/SimpleDialog.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,eAAe,CAAC;AACvB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAGlE,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AA6D9C;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,UAAU;IAC1C,YAAY,KAAwB;QAClC,KAAK,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;IAEe,MAAM;QACpB,MAAM,EACJ,MAAM,EACN,KAAK,EACL,aAAa,EACb,OAAO,EACP,cAAc,EACd,QAAQ,EACR,SAAS,EACT,KAAK,EACL,MAAM,EACN,SAAS,EACT,QAAQ,EACR,eAAe,EACf,UAAU,EACV,WAAW,EACX,KAAK,EACL,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,SAAS,EACT,KAAK,EACL,UAAU,EACV,GAAG,KAAK,EACT,GAAG,IAAI,CAAC,KAAK,CAAC;QAEf,MAAM,cAAc,GAAwB;YAC1C,MAAM,EAAE,EAAE;YACV,KAAK;YACL,MAAM;SACP,CAAC;QACF,MAAM,WAAW,GAAwB;YACvC,QAAQ;YACR,SAAS;YACT,QAAQ;YACR,SAAS;SACV,CAAC;QACF,MAAM,wBAAwB,GAAwB;YACpD,GAAG,cAAc;YACjB,GAAG,WAAW;SACf,CAAC;QAEF,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CACnC,aAAa,EACb,iBAAiB,EACjB,IAAI,CACL,CAAC;QAEF,OAAO,CACL,oBAAC,MAAM,IACL,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,oBAAoB,EAAE,KAAK,EAC3B,UAAU,EAAE,KAAK,EACjB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,KAAK,EAClB,WAAW,EAAE,KAAK,EAClB,SAAS,EAAE,SAAS,IAAI,0BAA0B,CAAC,KAAK,EACxD,qBAAqB,EAAE,IAAI,iBACf,kBAAkB,KAC1B,KAAK;YAER,KAAK,IAAI,oBAAC,MAAM,CAAC,QAAQ,IAAC,KAAK,EAAE,eAAe,GAAI;YACrD,oBAAC,mBAAmB,IAAC,cAAc,EAAE,cAAc;gBACjD,oBAAC,MAAM,CAAC,IAAI,mBACE,uBAAuB,EACnC,KAAK,EAAE,wBAAwB,EAC/B,aAAa,EAAE,IAAI,CAAC,2BAA2B;oBAE9C,CAAC,UAAU,IAAI,CACd,oBAAC,MAAM,CAAC,QAAQ,IAAC,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,GAAI,CACzD;oBACD,oBAAC,MAAM,CAAC,OAAO,IAAC,SAAS,EAAE,gBAAgB,EAAE,KAAK,EAAE,YAAY,IAC7D,IAAI,CAAC,KAAK,CAAC,QAAQ,CACL;oBACjB,oBAAC,MAAM,CAAC,SAAS,IAAC,KAAK,EAAE,WAAW,IAAG,OAAO,CAAoB,CACtD,CACM,CACf,CACV,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 \"./Dialog.scss\";\nimport * as React from \"react\";\nimport type { DialogButtonDef } from \"@itwin/appui-abstract\";\nimport { DivWithOutsideClick } from \"../base/DivWithOutsideClick\";\nimport type { CommonProps } from \"../utils/Props\";\nimport type { Omit } from \"../utils/typeUtils\";\nimport { Dialog as CoreDialog } from \"./Dialog\";\nimport { Dialog } from \"@itwin/itwinui-react\";\n\n/** Properties of [[SimpleDialog]] component.\n * @internal\n */\nexport interface SimpleDialogProps\n extends Omit<React.AllHTMLAttributes<HTMLDivElement>, \"title\">,\n CommonProps {\n /** Indicates whether to show dialog or not */\n opened: 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 /** Title to show in title bar of dialog */\n title?: string | JSX.Element;\n /** List of DialogButtonDef objects specifying buttons and associated onClick events */\n buttonCluster?: DialogButtonDef[];\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 /** 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 /** 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 /** 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/** itwinui-react [[Dialog]] wrapper that excludes buggy features and adds features from core-react [[Dialog]].\n * @internal\n */\nexport class SimpleDialog extends CoreDialog {\n constructor(props: SimpleDialogProps) {\n super(props);\n }\n\n public override render(): JSX.Element {\n const {\n opened,\n title,\n buttonCluster,\n onClose,\n onOutsideClick,\n minWidth,\n minHeight,\n width,\n height,\n maxHeight,\n maxWidth,\n backgroundStyle,\n titleStyle,\n footerStyle,\n style,\n contentStyle,\n contentClassName,\n className,\n trapFocus,\n modal,\n hideHeader,\n ...props\n } = this.props;\n\n const containerStyle: React.CSSProperties = {\n margin: \"\",\n width,\n 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 <Dialog\n isOpen={opened}\n onClose={onClose}\n closeOnExternalClick={false}\n closeOnEsc={false}\n style={style}\n className={className}\n isResizable={false}\n isDraggable={false}\n trapFocus={trapFocus && /* istanbul ignore next */ modal}\n preventDocumentScroll={true}\n data-testid=\"core-dialog-root\"\n {...props}\n >\n {modal && <Dialog.Backdrop style={backgroundStyle} />}\n <DivWithOutsideClick onOutsideClick={onOutsideClick}>\n <Dialog.Main\n data-testid=\"core-dialog-container\"\n style={dialogBaseContainerStyle}\n onPointerDown={this._handleContainerPointerDown}\n >\n {!hideHeader && (\n <Dialog.TitleBar titleText={title} style={titleStyle} />\n )}\n <Dialog.Content className={contentClassName} style={contentStyle}>\n {this.props.children}\n </Dialog.Content>\n <Dialog.ButtonBar style={footerStyle}>{buttons}</Dialog.ButtonBar>\n </Dialog.Main>\n </DivWithOutsideClick>\n </Dialog>\n );\n }\n}\n"]}