@itwin/core-react 4.10.0 → 4.12.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 (215) hide show
  1. package/CHANGELOG.md +17 -1
  2. package/ContributeGuidelines.md +2 -2
  3. package/lib/cjs/core-react/UiCore.d.ts +3 -7
  4. package/lib/cjs/core-react/UiCore.d.ts.map +1 -1
  5. package/lib/cjs/core-react/UiCore.js +4 -22
  6. package/lib/cjs/core-react/UiCore.js.map +1 -1
  7. package/lib/cjs/core-react/UiCore.json +31 -0
  8. package/lib/cjs/core-react/badge/Badge.d.ts +6 -9
  9. package/lib/cjs/core-react/badge/Badge.d.ts.map +1 -1
  10. package/lib/cjs/core-react/badge/Badge.js +10 -9
  11. package/lib/cjs/core-react/badge/Badge.js.map +1 -1
  12. package/lib/cjs/core-react/badge/BadgeType.d.ts +13 -0
  13. package/lib/cjs/core-react/badge/BadgeType.d.ts.map +1 -0
  14. package/lib/cjs/core-react/badge/BadgeType.js +16 -0
  15. package/lib/cjs/core-react/badge/BadgeType.js.map +1 -0
  16. package/lib/cjs/core-react/badge/NewBadge.d.ts +2 -3
  17. package/lib/cjs/core-react/badge/NewBadge.d.ts.map +1 -1
  18. package/lib/cjs/core-react/badge/NewBadge.js +6 -7
  19. package/lib/cjs/core-react/badge/NewBadge.js.map +1 -1
  20. package/lib/cjs/core-react/badge/NewBadge.scss +2 -3
  21. package/lib/cjs/core-react/badge/TechnicalPreviewBadge.d.ts +10 -0
  22. package/lib/cjs/core-react/badge/TechnicalPreviewBadge.d.ts.map +1 -0
  23. package/lib/cjs/core-react/badge/TechnicalPreviewBadge.js +29 -0
  24. package/lib/cjs/core-react/badge/TechnicalPreviewBadge.js.map +1 -0
  25. package/lib/cjs/core-react/badge/{Badge.scss → TechnicalPreviewBadge.scss} +1 -7
  26. package/lib/cjs/core-react/base/Gap.js +1 -1
  27. package/lib/cjs/core-react/base/Gap.js.map +1 -1
  28. package/lib/cjs/core-react/contextmenu/ContextMenu.js +2 -1
  29. package/lib/cjs/core-react/contextmenu/ContextMenu.js.map +1 -1
  30. package/lib/cjs/core-react/contextmenu/ContextMenu.scss +0 -1
  31. package/lib/cjs/core-react/contextmenu/ContextMenuItem.d.ts +1 -1
  32. package/lib/cjs/core-react/contextmenu/ContextMenuItem.d.ts.map +1 -1
  33. package/lib/cjs/core-react/contextmenu/ContextMenuItem.js +3 -3
  34. package/lib/cjs/core-react/contextmenu/ContextMenuItem.js.map +1 -1
  35. package/lib/cjs/core-react/contextmenu/ContextSubMenu.d.ts.map +1 -1
  36. package/lib/cjs/core-react/contextmenu/ContextSubMenu.js +3 -3
  37. package/lib/cjs/core-react/contextmenu/ContextSubMenu.js.map +1 -1
  38. package/lib/cjs/core-react/contextmenu/GlobalContextMenu.js +5 -3
  39. package/lib/cjs/core-react/contextmenu/GlobalContextMenu.js.map +1 -1
  40. package/lib/cjs/core-react/dialog/Dialog.d.ts +1 -0
  41. package/lib/cjs/core-react/dialog/Dialog.d.ts.map +1 -1
  42. package/lib/cjs/core-react/dialog/Dialog.js +54 -52
  43. package/lib/cjs/core-react/dialog/Dialog.js.map +1 -1
  44. package/lib/cjs/core-react/dialog/GlobalDialog.js +2 -1
  45. package/lib/cjs/core-react/dialog/GlobalDialog.js.map +1 -1
  46. package/lib/cjs/core-react/elementseparator/ElementSeparator.d.ts.map +1 -1
  47. package/lib/cjs/core-react/elementseparator/ElementSeparator.js +5 -5
  48. package/lib/cjs/core-react/elementseparator/ElementSeparator.js.map +1 -1
  49. package/lib/cjs/core-react/hocs/withOnOutsideClick.js +2 -1
  50. package/lib/cjs/core-react/hocs/withOnOutsideClick.js.map +1 -1
  51. package/lib/cjs/core-react/icons/IconComponent.js +1 -1
  52. package/lib/cjs/core-react/icons/IconComponent.js.map +1 -1
  53. package/lib/cjs/core-react/inputs/input-label.scss +1 -2
  54. package/lib/cjs/core-react/inputs/variables.scss +0 -2
  55. package/lib/cjs/core-react/l10n/LocalizationProvider.d.ts +20 -0
  56. package/lib/cjs/core-react/l10n/LocalizationProvider.d.ts.map +1 -0
  57. package/lib/cjs/core-react/l10n/LocalizationProvider.js +29 -0
  58. package/lib/cjs/core-react/l10n/LocalizationProvider.js.map +1 -0
  59. package/lib/cjs/core-react/l10n/usePackageTranslation.d.ts +15 -0
  60. package/lib/cjs/core-react/l10n/usePackageTranslation.d.ts.map +1 -0
  61. package/lib/cjs/core-react/l10n/usePackageTranslation.js +64 -0
  62. package/lib/cjs/core-react/l10n/usePackageTranslation.js.map +1 -0
  63. package/lib/cjs/core-react/l10n/useTranslation.d.ts +7 -0
  64. package/lib/cjs/core-react/l10n/useTranslation.d.ts.map +1 -0
  65. package/lib/cjs/core-react/l10n/useTranslation.js +30 -0
  66. package/lib/cjs/core-react/l10n/useTranslation.js.map +1 -0
  67. package/lib/cjs/core-react/listbox/Listbox.js +3 -2
  68. package/lib/cjs/core-react/listbox/Listbox.js.map +1 -1
  69. package/lib/cjs/core-react/notification/MessageRenderer.js +1 -1
  70. package/lib/cjs/core-react/notification/MessageRenderer.js.map +1 -1
  71. package/lib/cjs/core-react/popup/Popup.js +8 -4
  72. package/lib/cjs/core-react/popup/Popup.js.map +1 -1
  73. package/lib/cjs/core-react/searchbox/SearchBox.d.ts.map +1 -1
  74. package/lib/cjs/core-react/searchbox/SearchBox.js +13 -7
  75. package/lib/cjs/core-react/searchbox/SearchBox.js.map +1 -1
  76. package/lib/cjs/core-react/tabs/tabs.scss +1 -1
  77. package/lib/cjs/core-react/tree/ExpansionToggle.d.ts +1 -3
  78. package/lib/cjs/core-react/tree/ExpansionToggle.d.ts.map +1 -1
  79. package/lib/cjs/core-react/tree/ExpansionToggle.js +9 -10
  80. package/lib/cjs/core-react/tree/ExpansionToggle.js.map +1 -1
  81. package/lib/cjs/core-react/tree/Node.js +2 -1
  82. package/lib/cjs/core-react/tree/Node.js.map +1 -1
  83. package/lib/cjs/core-react/utils/IconWebComponent.d.ts +4 -2
  84. package/lib/cjs/core-react/utils/IconWebComponent.d.ts.map +1 -1
  85. package/lib/cjs/core-react/utils/IconWebComponent.js +10 -6
  86. package/lib/cjs/core-react/utils/IconWebComponent.js.map +1 -1
  87. package/lib/cjs/core-react/utils/getCssVariable.js +1 -1
  88. package/lib/cjs/core-react/utils/getCssVariable.js.map +1 -1
  89. package/lib/cjs/core-react/utils/getObjectClassName.js +3 -2
  90. package/lib/cjs/core-react/utils/getObjectClassName.js.map +1 -1
  91. package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.js +2 -1
  92. package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.js.map +1 -1
  93. package/lib/cjs/core-react/utils/hooks/useResizeObserver.js +14 -8
  94. package/lib/cjs/core-react/utils/hooks/useResizeObserver.js.map +1 -1
  95. package/lib/cjs/core-react.d.ts +3 -3
  96. package/lib/cjs/core-react.d.ts.map +1 -1
  97. package/lib/cjs/core-react.js +12 -9
  98. package/lib/cjs/core-react.js.map +1 -1
  99. package/lib/esm/core-react/UiCore.d.ts +3 -7
  100. package/lib/esm/core-react/UiCore.d.ts.map +1 -1
  101. package/lib/esm/core-react/UiCore.js +4 -22
  102. package/lib/esm/core-react/UiCore.js.map +1 -1
  103. package/lib/esm/core-react/UiCore.json +31 -0
  104. package/lib/esm/core-react/badge/Badge.d.ts +6 -9
  105. package/lib/esm/core-react/badge/Badge.d.ts.map +1 -1
  106. package/lib/esm/core-react/badge/Badge.js +10 -9
  107. package/lib/esm/core-react/badge/Badge.js.map +1 -1
  108. package/lib/esm/core-react/badge/BadgeType.d.ts +13 -0
  109. package/lib/esm/core-react/badge/BadgeType.d.ts.map +1 -0
  110. package/lib/esm/core-react/badge/BadgeType.js +13 -0
  111. package/lib/esm/core-react/badge/BadgeType.js.map +1 -0
  112. package/lib/esm/core-react/badge/NewBadge.d.ts +2 -3
  113. package/lib/esm/core-react/badge/NewBadge.d.ts.map +1 -1
  114. package/lib/esm/core-react/badge/NewBadge.js +6 -7
  115. package/lib/esm/core-react/badge/NewBadge.js.map +1 -1
  116. package/lib/esm/core-react/badge/NewBadge.scss +2 -3
  117. package/lib/esm/core-react/badge/TechnicalPreviewBadge.d.ts +10 -0
  118. package/lib/esm/core-react/badge/TechnicalPreviewBadge.d.ts.map +1 -0
  119. package/lib/esm/core-react/badge/TechnicalPreviewBadge.js +25 -0
  120. package/lib/esm/core-react/badge/TechnicalPreviewBadge.js.map +1 -0
  121. package/lib/esm/core-react/badge/{Badge.scss → TechnicalPreviewBadge.scss} +1 -7
  122. package/lib/esm/core-react/base/Gap.js +1 -1
  123. package/lib/esm/core-react/base/Gap.js.map +1 -1
  124. package/lib/esm/core-react/contextmenu/ContextMenu.js +2 -1
  125. package/lib/esm/core-react/contextmenu/ContextMenu.js.map +1 -1
  126. package/lib/esm/core-react/contextmenu/ContextMenu.scss +0 -1
  127. package/lib/esm/core-react/contextmenu/ContextMenuItem.d.ts +1 -1
  128. package/lib/esm/core-react/contextmenu/ContextMenuItem.d.ts.map +1 -1
  129. package/lib/esm/core-react/contextmenu/ContextMenuItem.js +3 -3
  130. package/lib/esm/core-react/contextmenu/ContextMenuItem.js.map +1 -1
  131. package/lib/esm/core-react/contextmenu/ContextSubMenu.d.ts.map +1 -1
  132. package/lib/esm/core-react/contextmenu/ContextSubMenu.js +3 -3
  133. package/lib/esm/core-react/contextmenu/ContextSubMenu.js.map +1 -1
  134. package/lib/esm/core-react/contextmenu/GlobalContextMenu.js +5 -3
  135. package/lib/esm/core-react/contextmenu/GlobalContextMenu.js.map +1 -1
  136. package/lib/esm/core-react/dialog/Dialog.d.ts +1 -0
  137. package/lib/esm/core-react/dialog/Dialog.d.ts.map +1 -1
  138. package/lib/esm/core-react/dialog/Dialog.js +54 -52
  139. package/lib/esm/core-react/dialog/Dialog.js.map +1 -1
  140. package/lib/esm/core-react/dialog/GlobalDialog.js +2 -1
  141. package/lib/esm/core-react/dialog/GlobalDialog.js.map +1 -1
  142. package/lib/esm/core-react/elementseparator/ElementSeparator.d.ts.map +1 -1
  143. package/lib/esm/core-react/elementseparator/ElementSeparator.js +5 -5
  144. package/lib/esm/core-react/elementseparator/ElementSeparator.js.map +1 -1
  145. package/lib/esm/core-react/hocs/withOnOutsideClick.js +2 -1
  146. package/lib/esm/core-react/hocs/withOnOutsideClick.js.map +1 -1
  147. package/lib/esm/core-react/icons/IconComponent.js +1 -1
  148. package/lib/esm/core-react/icons/IconComponent.js.map +1 -1
  149. package/lib/esm/core-react/inputs/input-label.scss +1 -2
  150. package/lib/esm/core-react/inputs/variables.scss +0 -2
  151. package/lib/esm/core-react/l10n/LocalizationProvider.d.ts +20 -0
  152. package/lib/esm/core-react/l10n/LocalizationProvider.d.ts.map +1 -0
  153. package/lib/esm/core-react/l10n/LocalizationProvider.js +24 -0
  154. package/lib/esm/core-react/l10n/LocalizationProvider.js.map +1 -0
  155. package/lib/esm/core-react/l10n/usePackageTranslation.d.ts +15 -0
  156. package/lib/esm/core-react/l10n/usePackageTranslation.d.ts.map +1 -0
  157. package/lib/esm/core-react/l10n/usePackageTranslation.js +60 -0
  158. package/lib/esm/core-react/l10n/usePackageTranslation.js.map +1 -0
  159. package/lib/esm/core-react/l10n/useTranslation.d.ts +7 -0
  160. package/lib/esm/core-react/l10n/useTranslation.d.ts.map +1 -0
  161. package/lib/esm/core-react/l10n/useTranslation.js +26 -0
  162. package/lib/esm/core-react/l10n/useTranslation.js.map +1 -0
  163. package/lib/esm/core-react/listbox/Listbox.js +3 -2
  164. package/lib/esm/core-react/listbox/Listbox.js.map +1 -1
  165. package/lib/esm/core-react/notification/MessageRenderer.js +1 -1
  166. package/lib/esm/core-react/notification/MessageRenderer.js.map +1 -1
  167. package/lib/esm/core-react/popup/Popup.js +8 -4
  168. package/lib/esm/core-react/popup/Popup.js.map +1 -1
  169. package/lib/esm/core-react/searchbox/SearchBox.d.ts.map +1 -1
  170. package/lib/esm/core-react/searchbox/SearchBox.js +13 -7
  171. package/lib/esm/core-react/searchbox/SearchBox.js.map +1 -1
  172. package/lib/esm/core-react/tabs/tabs.scss +1 -1
  173. package/lib/esm/core-react/tree/ExpansionToggle.d.ts +1 -3
  174. package/lib/esm/core-react/tree/ExpansionToggle.d.ts.map +1 -1
  175. package/lib/esm/core-react/tree/ExpansionToggle.js +9 -10
  176. package/lib/esm/core-react/tree/ExpansionToggle.js.map +1 -1
  177. package/lib/esm/core-react/tree/Node.js +2 -1
  178. package/lib/esm/core-react/tree/Node.js.map +1 -1
  179. package/lib/esm/core-react/utils/IconWebComponent.d.ts +4 -2
  180. package/lib/esm/core-react/utils/IconWebComponent.d.ts.map +1 -1
  181. package/lib/esm/core-react/utils/IconWebComponent.js +8 -5
  182. package/lib/esm/core-react/utils/IconWebComponent.js.map +1 -1
  183. package/lib/esm/core-react/utils/getCssVariable.js +1 -1
  184. package/lib/esm/core-react/utils/getCssVariable.js.map +1 -1
  185. package/lib/esm/core-react/utils/getObjectClassName.js +3 -2
  186. package/lib/esm/core-react/utils/getObjectClassName.js.map +1 -1
  187. package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.js +2 -1
  188. package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.js.map +1 -1
  189. package/lib/esm/core-react/utils/hooks/useResizeObserver.js +14 -8
  190. package/lib/esm/core-react/utils/hooks/useResizeObserver.js.map +1 -1
  191. package/lib/esm/core-react.d.ts +3 -3
  192. package/lib/esm/core-react.d.ts.map +1 -1
  193. package/lib/esm/core-react.js +5 -4
  194. package/lib/esm/core-react.js.map +1 -1
  195. package/package.json +5 -6
  196. package/lib/cjs/core-react/badge/BadgeUtilities.d.ts +0 -13
  197. package/lib/cjs/core-react/badge/BadgeUtilities.d.ts.map +0 -1
  198. package/lib/cjs/core-react/badge/BadgeUtilities.js +0 -39
  199. package/lib/cjs/core-react/badge/BadgeUtilities.js.map +0 -1
  200. package/lib/cjs/core-react/badge/BetaBadge.d.ts +0 -10
  201. package/lib/cjs/core-react/badge/BetaBadge.d.ts.map +0 -1
  202. package/lib/cjs/core-react/badge/BetaBadge.js +0 -23
  203. package/lib/cjs/core-react/badge/BetaBadge.js.map +0 -1
  204. package/lib/cjs/core-react/badge/new-feature-badge.svg +0 -1
  205. package/lib/cjs/core-react/badge/technical-preview-badge.svg +0 -1
  206. package/lib/esm/core-react/badge/BadgeUtilities.d.ts +0 -13
  207. package/lib/esm/core-react/badge/BadgeUtilities.d.ts.map +0 -1
  208. package/lib/esm/core-react/badge/BadgeUtilities.js +0 -35
  209. package/lib/esm/core-react/badge/BadgeUtilities.js.map +0 -1
  210. package/lib/esm/core-react/badge/BetaBadge.d.ts +0 -10
  211. package/lib/esm/core-react/badge/BetaBadge.d.ts.map +0 -1
  212. package/lib/esm/core-react/badge/BetaBadge.js +0 -19
  213. package/lib/esm/core-react/badge/BetaBadge.js.map +0 -1
  214. package/lib/esm/core-react/badge/new-feature-badge.svg +0 -1
  215. package/lib/esm/core-react/badge/technical-preview-badge.svg +0 -1
package/CHANGELOG.md CHANGED
@@ -1,6 +1,22 @@
1
1
  # Change Log - @itwin/core-react
2
2
 
3
- This log was last generated on Mon, 26 Feb 2024 15:50:45 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 05 Apr 2024 09:55:35 GMT and should not be manually modified.
4
+
5
+ ## 4.12.0
6
+ Fri, 05 Apr 2024 09:55:35 GMT
7
+
8
+ ### Updates
9
+
10
+ - Inline svg of badge components instead of using the `svg-loader`.
11
+ - Add `LocalizationProvider` as an alternative to static package initializer.
12
+
13
+ ## 4.11.0
14
+ Thu, 21 Mar 2024 16:38:04 GMT
15
+
16
+ ### Updates
17
+
18
+ - Add BadgeType
19
+ - Removed memoization for translated strings in components.
4
20
 
5
21
  ## 4.10.0
6
22
  Mon, 26 Feb 2024 15:50:45 GMT
@@ -44,7 +44,7 @@ In order to maintain consistency in the iTwin.js UI source code, please abide by
44
44
  export * from "./core-react/badge/Badge";
45
45
  ```
46
46
 
47
- - Localize all strings to be seen by the user and use `Ui*.translate` to get the localized string. Please do **not** use hard-coded strings. The translatable strings should be in a JSON file in the `public/locales/en` of the repository. Example:
47
+ - Localize all strings to be seen by the user and use `useTranslation` hook to get the localized string. Please do **not** use hard-coded strings. The translatable strings should be in a JSON file in the `src/{package-name}/{Package}.json` of the repository. Example:
48
48
 
49
49
  ```json
50
50
  {
@@ -57,7 +57,7 @@ export * from "./core-react/badge/Badge";
57
57
  ```
58
58
 
59
59
  ```typescript
60
- buttonText = UiCore.translate("dialog.ok");
60
+ buttonText = useTranslation("dialog.ok");
61
61
  ```
62
62
 
63
63
  - Run `npm run extract-api` to update the `*api.md` file for the package
@@ -7,8 +7,7 @@ import "./colorvariables.scss";
7
7
  import "./layout-variables.scss";
8
8
  import "./classes.scss";
9
9
  import type { Localization } from "@itwin/core-common";
10
- /**
11
- * Manages the Localization service for the core-react package.
10
+ /** Manages the Localization service for the core-react package.
12
11
  * @public
13
12
  */
14
13
  export declare class UiCore {
@@ -23,13 +22,10 @@ export declare class UiCore {
23
22
  static terminate(): void;
24
23
  /** Determines if UiCore has been initialized */
25
24
  static get initialized(): boolean;
26
- /** The internationalization service created by the host application.
27
- * @internal
28
- */
29
- static get localization(): Localization;
30
25
  /** The internationalization service namespace. */
31
26
  static get localizationNamespace(): string;
32
- /** Calls localization.getLocalizedStringWithNamespace with the "UiCore" namespace. Do NOT include the namespace in the key.
27
+ /** Calls localization.getLocalizedString with the "UiCore" namespace. Do NOT include the namespace in the key.
28
+ * @deprecated in 4.12.x. Do not use this internally, this is replaced by `useTranslation`.
33
29
  * @internal
34
30
  */
35
31
  static translate(key: string | string[]): string;
@@ -1 +1 @@
1
- {"version":3,"file":"UiCore.d.ts","sourceRoot":"","sources":["../../../src/core-react/UiCore.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,4EAA4E;AAC5E,OAAO,oBAAoB,CAAC;AAC5B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,yBAAyB,CAAC;AACjC,OAAO,gBAAgB,CAAC;AAGxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAMvD;;;GAGG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,MAAM,CAAC,YAAY,CAAS;IACpC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAe;IAE5C;;;OAGG;WACiB,UAAU,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAiBzE,oDAAoD;WACtC,SAAS;IAQvB,gDAAgD;IAChD,WAAkB,WAAW,IAAI,OAAO,CAEvC;IAED;;OAEG;IACH,WAAkB,YAAY,IAAI,YAAY,CAU7C;IAED,kDAAkD;IAClD,WAAkB,qBAAqB,IAAI,MAAM,CAEhD;IAED;;OAEG;WACW,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM;IAavD,gBAAgB;IAChB,WAAkB,WAAW,IAAI,MAAM,CAEtC;IAED,gBAAgB;WACF,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM;CAK/C"}
1
+ {"version":3,"file":"UiCore.d.ts","sourceRoot":"","sources":["../../../src/core-react/UiCore.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,4EAA4E;AAC5E,OAAO,oBAAoB,CAAC;AAC5B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,yBAAyB,CAAC;AACjC,OAAO,gBAAgB,CAAC;AAGxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD;;GAEG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,MAAM,CAAC,YAAY,CAAS;IACpC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAe;IAE5C;;;OAGG;WACiB,UAAU,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAezE,oDAAoD;WACtC,SAAS;IAQvB,gDAAgD;IAChD,WAAkB,WAAW,IAAI,OAAO,CAEvC;IAED,kDAAkD;IAClD,WAAkB,qBAAqB,IAAI,MAAM,CAEhD;IAED;;;OAGG;WACW,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM;IAavD,gBAAgB;IAChB,WAAkB,WAAW,IAAI,MAAM,CAEtC;IAED,gBAAgB;WACF,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM;CAK/C"}
@@ -14,12 +14,8 @@ require("./colorvariables.scss");
14
14
  require("./layout-variables.scss");
15
15
  require("./classes.scss");
16
16
  const core_bentley_1 = require("@itwin/core-bentley");
17
- const appui_abstract_1 = require("@itwin/appui-abstract");
18
- const IconWebComponent_1 = require("./utils/IconWebComponent");
19
17
  const getObjectClassName_1 = require("./utils/getObjectClassName");
20
- // cSpell:ignore colorthemes colorvariables
21
- /**
22
- * Manages the Localization service for the core-react package.
18
+ /** Manages the Localization service for the core-react package.
23
19
  * @public
24
20
  */
25
21
  class UiCore {
@@ -34,8 +30,6 @@ class UiCore {
34
30
  }
35
31
  UiCore._localization = localization;
36
32
  await UiCore._localization.registerNamespace(UiCore.localizationNamespace);
37
- if (window.customElements.get("svg-loader") === undefined)
38
- window.customElements.define("svg-loader", IconWebComponent_1.IconWebComponent);
39
33
  UiCore._initialized = true;
40
34
  }
41
35
  /** Unregisters the UiCore localization namespace */
@@ -49,22 +43,12 @@ class UiCore {
49
43
  static get initialized() {
50
44
  return UiCore._initialized;
51
45
  }
52
- /** The internationalization service created by the host application.
53
- * @internal
54
- */
55
- static get localization() {
56
- // istanbul ignore else
57
- if (!UiCore._localization)
58
- // eslint-disable-next-line deprecation/deprecation
59
- throw new appui_abstract_1.UiError(UiCore.loggerCategory(this), "localization: UiCore.initialize has not been called. Unable to return Localization object.");
60
- // istanbul ignore next
61
- return UiCore._localization;
62
- }
63
46
  /** The internationalization service namespace. */
64
47
  static get localizationNamespace() {
65
48
  return "UiCore";
66
49
  }
67
- /** Calls localization.getLocalizedStringWithNamespace with the "UiCore" namespace. Do NOT include the namespace in the key.
50
+ /** Calls localization.getLocalizedString with the "UiCore" namespace. Do NOT include the namespace in the key.
51
+ * @deprecated in 4.12.x. Do not use this internally, this is replaced by `useTranslation`.
68
52
  * @internal
69
53
  */
70
54
  static translate(key) {
@@ -72,9 +56,7 @@ class UiCore {
72
56
  core_bentley_1.Logger.logError(UiCore.loggerCategory(this), `translate: UiCore must be initialize with a localization provider. Returning blank string.`);
73
57
  return "";
74
58
  }
75
- return UiCore._localization.getLocalizedString(key, {
76
- ns: UiCore.localizationNamespace,
77
- });
59
+ return UiCore._localization.getLocalizedString(`${UiCore.localizationNamespace}:${key}`);
78
60
  }
79
61
  /** @internal */
80
62
  static get packageName() {
@@ -1 +1 @@
1
- {"version":3,"file":"UiCore.js","sourceRoot":"","sources":["../../../src/core-react/UiCore.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,4EAA4E;AAC5E,8BAA4B;AAC5B,iCAA+B;AAC/B,mCAAiC;AACjC,0BAAwB;AAExB,sDAA6C;AAE7C,0DAAgD;AAChD,+DAA4D;AAC5D,mEAAgE;AAChE,2CAA2C;AAE3C;;;GAGG;AACH,MAAa,MAAM;IAIjB;;;OAGG;IACI,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,YAA0B;QACvD,IAAI,MAAM,CAAC,YAAY,EAAE;YACvB,qBAAM,CAAC,OAAO,CACZ,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,EAC7B,kCAAkC,CACnC,CAAC;YACF,OAAO;SACR;QAED,MAAM,CAAC,aAAa,GAAG,YAAY,CAAC;QACpC,MAAM,MAAM,CAAC,aAAa,CAAC,iBAAiB,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;QAC3E,IAAI,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,SAAS;YACvD,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,YAAY,EAAE,mCAAgB,CAAC,CAAC;QAE/D,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC;IAC7B,CAAC;IAED,oDAAoD;IAC7C,MAAM,CAAC,SAAS;QACrB,IAAI,MAAM,CAAC,aAAa;YACtB,MAAM,CAAC,aAAa,CAAC,mBAAmB,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;QACzE,MAAM,CAAC,aAAa,GAAG,SAAS,CAAC;QAEjC,MAAM,CAAC,YAAY,GAAG,KAAK,CAAC;IAC9B,CAAC;IAED,gDAAgD;IACzC,MAAM,KAAK,WAAW;QAC3B,OAAO,MAAM,CAAC,YAAY,CAAC;IAC7B,CAAC;IAED;;OAEG;IACI,MAAM,KAAK,YAAY;QAC5B,uBAAuB;QACvB,IAAI,CAAC,MAAM,CAAC,aAAa;YACvB,mDAAmD;YACnD,MAAM,IAAI,wBAAO,CACf,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,EAC3B,4FAA4F,CAC7F,CAAC;QACJ,uBAAuB;QACvB,OAAO,MAAM,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED,kDAAkD;IAC3C,MAAM,KAAK,qBAAqB;QACrC,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,SAAS,CAAC,GAAsB;QAC5C,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE;YACzB,qBAAM,CAAC,QAAQ,CACb,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,EAC3B,4FAA4F,CAC7F,CAAC;YACF,OAAO,EAAE,CAAC;SACX;QACD,OAAO,MAAM,CAAC,aAAa,CAAC,kBAAkB,CAAC,GAAG,EAAE;YAClD,EAAE,EAAE,MAAM,CAAC,qBAAqB;SACjC,CAAC,CAAC;IACL,CAAC;IAED,gBAAgB;IACT,MAAM,KAAK,WAAW;QAC3B,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,cAAc,CAAC,GAAQ;QACnC,MAAM,SAAS,GAAG,IAAA,uCAAkB,EAAC,GAAG,CAAC,CAAC;QAC1C,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACzE,OAAO,QAAQ,CAAC;IAClB,CAAC;;AApFc,mBAAY,GAAG,KAAK,CAAC;AADzB,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 Utilities\n */\n\n/** Import color variables, layout variables and Sass classes barrel file */\nimport \"./colorthemes.scss\";\nimport \"./colorvariables.scss\";\nimport \"./layout-variables.scss\";\nimport \"./classes.scss\";\n\nimport { Logger } from \"@itwin/core-bentley\";\nimport type { Localization } from \"@itwin/core-common\";\nimport { UiError } from \"@itwin/appui-abstract\";\nimport { IconWebComponent } from \"./utils/IconWebComponent\";\nimport { getObjectClassName } from \"./utils/getObjectClassName\";\n// cSpell:ignore colorthemes colorvariables\n\n/**\n * Manages the Localization service for the core-react package.\n * @public\n */\nexport class UiCore {\n private static _initialized = false;\n private static _localization?: Localization;\n\n /**\n * Registers the Localization service namespace for UiCore.\n * @param localization The internationalization service created by the host application.\n */\n public static async initialize(localization: Localization): Promise<void> {\n if (UiCore._initialized) {\n Logger.logInfo(\n UiCore.loggerCategory(UiCore),\n `UiCore.initialize already called`\n );\n return;\n }\n\n UiCore._localization = localization;\n await UiCore._localization.registerNamespace(UiCore.localizationNamespace);\n if (window.customElements.get(\"svg-loader\") === undefined)\n window.customElements.define(\"svg-loader\", IconWebComponent);\n\n UiCore._initialized = true;\n }\n\n /** Unregisters the UiCore localization namespace */\n public static terminate() {\n if (UiCore._localization)\n UiCore._localization.unregisterNamespace(UiCore.localizationNamespace);\n UiCore._localization = undefined;\n\n UiCore._initialized = false;\n }\n\n /** Determines if UiCore has been initialized */\n public static get initialized(): boolean {\n return UiCore._initialized;\n }\n\n /** The internationalization service created by the host application.\n * @internal\n */\n public static get localization(): Localization {\n // istanbul ignore else\n if (!UiCore._localization)\n // eslint-disable-next-line deprecation/deprecation\n throw new UiError(\n UiCore.loggerCategory(this),\n \"localization: UiCore.initialize has not been called. Unable to return Localization object.\"\n );\n // istanbul ignore next\n return UiCore._localization;\n }\n\n /** The internationalization service namespace. */\n public static get localizationNamespace(): string {\n return \"UiCore\";\n }\n\n /** Calls localization.getLocalizedStringWithNamespace with the \"UiCore\" namespace. Do NOT include the namespace in the key.\n * @internal\n */\n public static translate(key: string | string[]): string {\n if (!UiCore._localization) {\n Logger.logError(\n UiCore.loggerCategory(this),\n `translate: UiCore must be initialize with a localization provider. Returning blank string.`\n );\n return \"\";\n }\n return UiCore._localization.getLocalizedString(key, {\n ns: UiCore.localizationNamespace,\n });\n }\n\n /** @internal */\n public static get packageName(): string {\n return \"core-react\";\n }\n\n /** @internal */\n public static loggerCategory(obj: any): string {\n const className = getObjectClassName(obj);\n const category = UiCore.packageName + (className ? `.${className}` : \"\");\n return category;\n }\n}\n"]}
1
+ {"version":3,"file":"UiCore.js","sourceRoot":"","sources":["../../../src/core-react/UiCore.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,4EAA4E;AAC5E,8BAA4B;AAC5B,iCAA+B;AAC/B,mCAAiC;AACjC,0BAAwB;AAExB,sDAA6C;AAE7C,mEAAgE;AAEhE;;GAEG;AACH,MAAa,MAAM;IAIjB;;;OAGG;IACI,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,YAA0B;QACvD,IAAI,MAAM,CAAC,YAAY,EAAE;YACvB,qBAAM,CAAC,OAAO,CACZ,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,EAC7B,kCAAkC,CACnC,CAAC;YACF,OAAO;SACR;QAED,MAAM,CAAC,aAAa,GAAG,YAAY,CAAC;QACpC,MAAM,MAAM,CAAC,aAAa,CAAC,iBAAiB,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;QAE3E,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC;IAC7B,CAAC;IAED,oDAAoD;IAC7C,MAAM,CAAC,SAAS;QACrB,IAAI,MAAM,CAAC,aAAa;YACtB,MAAM,CAAC,aAAa,CAAC,mBAAmB,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;QACzE,MAAM,CAAC,aAAa,GAAG,SAAS,CAAC;QAEjC,MAAM,CAAC,YAAY,GAAG,KAAK,CAAC;IAC9B,CAAC;IAED,gDAAgD;IACzC,MAAM,KAAK,WAAW;QAC3B,OAAO,MAAM,CAAC,YAAY,CAAC;IAC7B,CAAC;IAED,kDAAkD;IAC3C,MAAM,KAAK,qBAAqB;QACrC,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,SAAS,CAAC,GAAsB;QAC5C,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE;YACzB,qBAAM,CAAC,QAAQ,CACb,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,EAC3B,4FAA4F,CAC7F,CAAC;YACF,OAAO,EAAE,CAAC;SACX;QACD,OAAO,MAAM,CAAC,aAAa,CAAC,kBAAkB,CAC5C,GAAG,MAAM,CAAC,qBAAqB,IAAI,GAAG,EAAE,CACzC,CAAC;IACJ,CAAC;IAED,gBAAgB;IACT,MAAM,KAAK,WAAW;QAC3B,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,cAAc,CAAC,GAAQ;QACnC,MAAM,SAAS,GAAG,IAAA,uCAAkB,EAAC,GAAG,CAAC,CAAC;QAC1C,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACzE,OAAO,QAAQ,CAAC;IAClB,CAAC;;AApEc,mBAAY,GAAG,KAAK,CAAC;AADzB,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 Utilities\n */\n\n/** Import color variables, layout variables and Sass classes barrel file */\nimport \"./colorthemes.scss\";\nimport \"./colorvariables.scss\";\nimport \"./layout-variables.scss\";\nimport \"./classes.scss\";\n\nimport { Logger } from \"@itwin/core-bentley\";\nimport type { Localization } from \"@itwin/core-common\";\nimport { getObjectClassName } from \"./utils/getObjectClassName\";\n\n/** Manages the Localization service for the core-react package.\n * @public\n */\nexport class UiCore {\n private static _initialized = false;\n private static _localization?: Localization;\n\n /**\n * Registers the Localization service namespace for UiCore.\n * @param localization The internationalization service created by the host application.\n */\n public static async initialize(localization: Localization): Promise<void> {\n if (UiCore._initialized) {\n Logger.logInfo(\n UiCore.loggerCategory(UiCore),\n `UiCore.initialize already called`\n );\n return;\n }\n\n UiCore._localization = localization;\n await UiCore._localization.registerNamespace(UiCore.localizationNamespace);\n\n UiCore._initialized = true;\n }\n\n /** Unregisters the UiCore localization namespace */\n public static terminate() {\n if (UiCore._localization)\n UiCore._localization.unregisterNamespace(UiCore.localizationNamespace);\n UiCore._localization = undefined;\n\n UiCore._initialized = false;\n }\n\n /** Determines if UiCore has been initialized */\n public static get initialized(): boolean {\n return UiCore._initialized;\n }\n\n /** The internationalization service namespace. */\n public static get localizationNamespace(): string {\n return \"UiCore\";\n }\n\n /** Calls localization.getLocalizedString with the \"UiCore\" namespace. Do NOT include the namespace in the key.\n * @deprecated in 4.12.x. Do not use this internally, this is replaced by `useTranslation`.\n * @internal\n */\n public static translate(key: string | string[]): string {\n if (!UiCore._localization) {\n Logger.logError(\n UiCore.loggerCategory(this),\n `translate: UiCore must be initialize with a localization provider. Returning blank string.`\n );\n return \"\";\n }\n return UiCore._localization.getLocalizedString(\n `${UiCore.localizationNamespace}:${key}`\n );\n }\n\n /** @internal */\n public static get packageName(): string {\n return \"core-react\";\n }\n\n /** @internal */\n public static loggerCategory(obj: any): string {\n const className = getObjectClassName(obj);\n const category = UiCore.packageName + (className ? `.${className}` : \"\");\n return category;\n }\n}\n"]}
@@ -0,0 +1,31 @@
1
+ {
2
+ "form": {
3
+ "submitButtonLabel": "Submit",
4
+ "errorPrefix": "Error:",
5
+ "errorSuffix": "Please review input and try again."
6
+ },
7
+ "general": {
8
+ "search": "Search",
9
+ "clear": "Clear"
10
+ },
11
+ "dialog": {
12
+ "ok": "OK",
13
+ "retry": "Retry",
14
+ "yes": "Yes",
15
+ "no": "No",
16
+ "cancel": "Cancel",
17
+ "close": "Close",
18
+ "next": "Next",
19
+ "previous": "Previous"
20
+ },
21
+ "reactselect": {
22
+ "noSelectOption": "Option not found"
23
+ },
24
+ "tree": {
25
+ "expand": "Expand",
26
+ "collapse": "Collapse"
27
+ },
28
+ "elementSeparator": {
29
+ "label": "Resizer"
30
+ }
31
+ }
@@ -1,19 +1,16 @@
1
1
  /** @packageDocumentation
2
2
  * @module Utilities
3
3
  */
4
- import "./Badge.scss";
5
4
  import * as React from "react";
6
- import type { CommonProps } from "../utils/Props";
7
- /** Properties for the [[Badge]] React component
5
+ import { BadgeType } from "./BadgeType";
6
+ /** Properties for the [[Badge]] component.
8
7
  * @internal
9
8
  */
10
- export interface BadgeProps extends CommonProps {
11
- svg: any;
9
+ export interface BadgeProps {
10
+ type?: BadgeType;
12
11
  }
13
- /** Beta Badge React component
12
+ /** Badge component that renders based on a badge type.
14
13
  * @internal
15
14
  */
16
- export declare class Badge extends React.PureComponent<BadgeProps> {
17
- render(): React.ReactElement;
18
- }
15
+ export declare function Badge({ type }: BadgeProps): React.JSX.Element | null;
19
16
  //# sourceMappingURL=Badge.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../../src/core-react/badge/Badge.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,cAAc,CAAC;AAEtB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD;;GAEG;AACH,MAAM,WAAW,UAAW,SAAQ,WAAW;IAC7C,GAAG,EAAE,GAAG,CAAC;CACV;AAED;;GAEG;AACH,qBAAa,KAAM,SAAQ,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC;IACxC,MAAM,IAAI,KAAK,CAAC,YAAY;CAU7C"}
1
+ {"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../../src/core-react/badge/Badge.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxC;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,EAAE,IAAI,EAAE,EAAE,UAAU,4BAIzC"}
@@ -8,18 +8,19 @@
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.Badge = void 0;
11
- require("./Badge.scss");
12
- const classnames_1 = require("classnames");
13
11
  const React = require("react");
14
- const IconComponent_1 = require("../icons/IconComponent");
15
- /** Beta Badge React component
12
+ const BadgeType_1 = require("./BadgeType");
13
+ const TechnicalPreviewBadge_1 = require("./TechnicalPreviewBadge");
14
+ const NewBadge_1 = require("./NewBadge");
15
+ /** Badge component that renders based on a badge type.
16
16
  * @internal
17
17
  */
18
- class Badge extends React.PureComponent {
19
- render() {
20
- return (React.createElement("div", { className: (0, classnames_1.default)("core-badge", this.props.className), style: this.props.style },
21
- React.createElement(IconComponent_1.Icon, { iconSpec: this.props.svg })));
22
- }
18
+ function Badge({ type }) {
19
+ if (type === BadgeType_1.BadgeType.TechnicalPreview)
20
+ return React.createElement(TechnicalPreviewBadge_1.TechnicalPreviewBadge, null);
21
+ if (type === BadgeType_1.BadgeType.New)
22
+ return React.createElement(NewBadge_1.NewBadge, null);
23
+ return null;
23
24
  }
24
25
  exports.Badge = Badge;
25
26
  //# sourceMappingURL=Badge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.js","sourceRoot":"","sources":["../../../../src/core-react/badge/Badge.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,wBAAsB;AACtB,2CAAoC;AACpC,+BAA+B;AAE/B,0DAA8C;AAS9C;;GAEG;AACH,MAAa,KAAM,SAAQ,KAAK,CAAC,aAAyB;IACxC,MAAM;QACpB,OAAO,CACL,6BACE,SAAS,EAAE,IAAA,oBAAU,EAAC,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EACzD,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;YAEvB,oBAAC,oBAAI,IAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,GAAI,CAC9B,CACP,CAAC;IACJ,CAAC;CACF;AAXD,sBAWC","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 Utilities\n */\n\nimport \"./Badge.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { CommonProps } from \"../utils/Props\";\nimport { Icon } from \"../icons/IconComponent\";\n\n/** Properties for the [[Badge]] React component\n * @internal\n */\nexport interface BadgeProps extends CommonProps {\n svg: any;\n}\n\n/** Beta Badge React component\n * @internal\n */\nexport class Badge extends React.PureComponent<BadgeProps> {\n public override render(): React.ReactElement {\n return (\n <div\n className={classnames(\"core-badge\", this.props.className)}\n style={this.props.style}\n >\n <Icon iconSpec={this.props.svg} />\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"Badge.js","sourceRoot":"","sources":["../../../../src/core-react/badge/Badge.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAC/B,2CAAwC;AACxC,mEAAgE;AAChE,yCAAsC;AAStC;;GAEG;AACH,SAAgB,KAAK,CAAC,EAAE,IAAI,EAAc;IACxC,IAAI,IAAI,KAAK,qBAAS,CAAC,gBAAgB;QAAE,OAAO,oBAAC,6CAAqB,OAAG,CAAC;IAC1E,IAAI,IAAI,KAAK,qBAAS,CAAC,GAAG;QAAE,OAAO,oBAAC,mBAAQ,OAAG,CAAC;IAChD,OAAO,IAAI,CAAC;AACd,CAAC;AAJD,sBAIC","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 Utilities\n */\n\nimport * as React from \"react\";\nimport { BadgeType } from \"./BadgeType\";\nimport { TechnicalPreviewBadge } from \"./TechnicalPreviewBadge\";\nimport { NewBadge } from \"./NewBadge\";\n\n/** Properties for the [[Badge]] component.\n * @internal\n */\nexport interface BadgeProps {\n type?: BadgeType;\n}\n\n/** Badge component that renders based on a badge type.\n * @internal\n */\nexport function Badge({ type }: BadgeProps) {\n if (type === BadgeType.TechnicalPreview) return <TechnicalPreviewBadge />;\n if (type === BadgeType.New) return <NewBadge />;\n return null;\n}\n"]}
@@ -0,0 +1,13 @@
1
+ /** @packageDocumentation
2
+ * @module Utilities
3
+ */
4
+ import { BadgeType as _BadgeType } from "@itwin/appui-abstract";
5
+ /** Specifies type of badge, if any, that should be overlaid on UI component.
6
+ * @public
7
+ */
8
+ export type BadgeType = _BadgeType;
9
+ /** Specifies type of badge, if any, that should be overlaid on UI component.
10
+ * @public
11
+ */
12
+ export declare const BadgeType: typeof _BadgeType;
13
+ //# sourceMappingURL=BadgeType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BadgeType.d.ts","sourceRoot":"","sources":["../../../../src/core-react/badge/BadgeType.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,SAAS,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC;AAEnC;;GAEG;AACH,eAAO,MAAM,SAAS,mBAAa,CAAC"}
@@ -0,0 +1,16 @@
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 Utilities
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.BadgeType = void 0;
11
+ const appui_abstract_1 = require("@itwin/appui-abstract");
12
+ /** Specifies type of badge, if any, that should be overlaid on UI component.
13
+ * @public
14
+ */
15
+ exports.BadgeType = appui_abstract_1.BadgeType; // eslint-disable-line @typescript-eslint/no-redeclare, deprecation/deprecation
16
+ //# sourceMappingURL=BadgeType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BadgeType.js","sourceRoot":"","sources":["../../../../src/core-react/badge/BadgeType.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,0DAAgE;AAOhE;;GAEG;AACU,QAAA,SAAS,GAAG,0BAAU,CAAC,CAAC,+EAA+E","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 Utilities\n */\n\nimport { BadgeType as _BadgeType } from \"@itwin/appui-abstract\";\n\n/** Specifies type of badge, if any, that should be overlaid on UI component.\n * @public\n */\nexport type BadgeType = _BadgeType; // eslint-disable-line deprecation/deprecation\n\n/** Specifies type of badge, if any, that should be overlaid on UI component.\n * @public\n */\nexport const BadgeType = _BadgeType; // eslint-disable-line @typescript-eslint/no-redeclare, deprecation/deprecation\n"]}
@@ -3,9 +3,8 @@
3
3
  */
4
4
  import "./NewBadge.scss";
5
5
  import * as React from "react";
6
- import type { CommonProps } from "../utils/Props";
7
- /** New Badge React component
6
+ /** New badge component.
8
7
  * @internal
9
8
  */
10
- export declare function NewBadge(props: CommonProps): React.JSX.Element;
9
+ export declare function NewBadge(): React.JSX.Element;
11
10
  //# sourceMappingURL=NewBadge.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NewBadge.d.ts","sourceRoot":"","sources":["../../../../src/core-react/badge/NewBadge.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,iBAAiB,CAAC;AAEzB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,WAAW,qBAS1C"}
1
+ {"version":3,"file":"NewBadge.d.ts","sourceRoot":"","sources":["../../../../src/core-react/badge/NewBadge.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,iBAAiB,CAAC;AACzB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B;;GAEG;AACH,wBAAgB,QAAQ,sBAYvB"}
@@ -9,16 +9,15 @@
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.NewBadge = void 0;
11
11
  require("./NewBadge.scss");
12
- const classnames_1 = require("classnames");
13
12
  const React = require("react");
14
- const Badge_1 = require("./Badge");
15
- const new_feature_badge_svg_1 = require("./new-feature-badge.svg");
16
- /** New Badge React component
13
+ const itwinui_react_1 = require("@itwin/itwinui-react");
14
+ /** New badge component.
17
15
  * @internal
18
16
  */
19
- function NewBadge(props) {
20
- const { className, ...badgeProps } = props;
21
- return (React.createElement(Badge_1.Badge, { ...badgeProps, className: (0, classnames_1.default)("core-new-badge", className), svg: new_feature_badge_svg_1.default }));
17
+ function NewBadge() {
18
+ return (React.createElement(itwinui_react_1.Icon, { className: "core-badge-newBadge" },
19
+ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", enableBackground: "new 0 0 16 16" },
20
+ React.createElement("path", { d: "m15 0h-14c-.4 0-.8.2-.9.6s-.1.8.2 1.1l14 14c.2.2.4.3.7.3.1 0 .3 0 .4-.1.4-.2.6-.5.6-.9v-14c0-.6-.4-1-1-1m-4 7c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2" }))));
22
21
  }
23
22
  exports.NewBadge = NewBadge;
24
23
  //# sourceMappingURL=NewBadge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NewBadge.js","sourceRoot":"","sources":["../../../../src/core-react/badge/NewBadge.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,2BAAyB;AACzB,2CAAoC;AACpC,+BAA+B;AAE/B,mCAAgC;AAChC,mEAAmD;AAEnD;;GAEG;AACH,SAAgB,QAAQ,CAAC,KAAkB;IACzC,MAAM,EAAE,SAAS,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IAC3C,OAAO,CACL,oBAAC,aAAK,OACA,UAAU,EACd,SAAS,EAAE,IAAA,oBAAU,EAAC,gBAAgB,EAAE,SAAS,CAAC,EAClD,GAAG,EAAE,+BAAY,GACjB,CACH,CAAC;AACJ,CAAC;AATD,4BASC","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 Utilities\n */\n\nimport \"./NewBadge.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { CommonProps } from \"../utils/Props\";\nimport { Badge } from \"./Badge\";\nimport newBadgeIcon from \"./new-feature-badge.svg\";\n\n/** New Badge React component\n * @internal\n */\nexport function NewBadge(props: CommonProps) {\n const { className, ...badgeProps } = props;\n return (\n <Badge\n {...badgeProps}\n className={classnames(\"core-new-badge\", className)}\n svg={newBadgeIcon}\n />\n );\n}\n"]}
1
+ {"version":3,"file":"NewBadge.js","sourceRoot":"","sources":["../../../../src/core-react/badge/NewBadge.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,2BAAyB;AACzB,+BAA+B;AAC/B,wDAA4C;AAE5C;;GAEG;AACH,SAAgB,QAAQ;IACtB,OAAO,CACL,oBAAC,oBAAI,IAAC,SAAS,EAAC,qBAAqB;QACnC,6BACE,KAAK,EAAC,4BAA4B,EAClC,OAAO,EAAC,WAAW,EACnB,gBAAgB,EAAC,eAAe;YAEhC,8BAAM,CAAC,EAAC,0JAA0J,GAAG,CACjK,CACD,CACR,CAAC;AACJ,CAAC;AAZD,4BAYC","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 Utilities\n */\n\nimport \"./NewBadge.scss\";\nimport * as React from \"react\";\nimport { Icon } from \"@itwin/itwinui-react\";\n\n/** New badge component.\n * @internal\n */\nexport function NewBadge() {\n return (\n <Icon className=\"core-badge-newBadge\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n enableBackground=\"new 0 0 16 16\"\n >\n <path d=\"m15 0h-14c-.4 0-.8.2-.9.6s-.1.8.2 1.1l14 14c.2.2.4.3.7.3.1 0 .3 0 .4-.1.4-.2.6-.5.6-.9v-14c0-.6-.4-1-1-1m-4 7c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2\" />\n </svg>\n </Icon>\n );\n}\n"]}
@@ -2,8 +2,7 @@
2
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
- @import "../style/themecolors";
6
-
7
- .core-new-badge {
5
+ .core-badge-newBadge {
8
6
  color: var(--iui-color-text-positive);
7
+ transform: rotate(270deg);
9
8
  }
@@ -0,0 +1,10 @@
1
+ /** @packageDocumentation
2
+ * @module Utilities
3
+ */
4
+ import "./TechnicalPreviewBadge.scss";
5
+ import * as React from "react";
6
+ /** Technical preview badge component.
7
+ * @internal
8
+ */
9
+ export declare function TechnicalPreviewBadge(): React.JSX.Element;
10
+ //# sourceMappingURL=TechnicalPreviewBadge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TechnicalPreviewBadge.d.ts","sourceRoot":"","sources":["../../../../src/core-react/badge/TechnicalPreviewBadge.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B;;GAEG;AACH,wBAAgB,qBAAqB,sBAoCpC"}
@@ -0,0 +1,29 @@
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 Utilities
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.TechnicalPreviewBadge = void 0;
11
+ require("./TechnicalPreviewBadge.scss");
12
+ const React = require("react");
13
+ const itwinui_react_1 = require("@itwin/itwinui-react");
14
+ /** Technical preview badge component.
15
+ * @internal
16
+ */
17
+ function TechnicalPreviewBadge() {
18
+ return (React.createElement(itwinui_react_1.Icon, { className: "core-badge-technicalPreviewBadge" },
19
+ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", viewBox: "0 0 16 16" },
20
+ React.createElement("defs", null,
21
+ React.createElement("linearGradient", { id: "a", x1: "8", y1: "15", x2: "8", y2: "1", gradientUnits: "userSpaceOnUse" },
22
+ React.createElement("stop", { offset: "0", stopColor: "#ffc335" }),
23
+ React.createElement("stop", { offset: "1", stopColor: "#ffdf52" }))),
24
+ React.createElement("path", { d: "M15,1V15L1,1H15", fill: "url(#a)" }),
25
+ React.createElement("path", { d: "M15,1V15L1,1H15m0-1H1A.87458.87458,0,0,0,.1.6.91284.91284,0,0,0,.3,1.7l14,14a.90783.90783,0,0,0,.7.3.60123.60123,0,0,0,.4-.1A.961.961,0,0,0,16,15V1A.94477.94477,0,0,0,15,0Z", fill: "#ffc000" }),
26
+ React.createElement("circle", { cx: "11", cy: "5", r: "2", opacity: "0.9", style: { isolation: "isolate" } }))));
27
+ }
28
+ exports.TechnicalPreviewBadge = TechnicalPreviewBadge;
29
+ //# sourceMappingURL=TechnicalPreviewBadge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TechnicalPreviewBadge.js","sourceRoot":"","sources":["../../../../src/core-react/badge/TechnicalPreviewBadge.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,wCAAsC;AACtC,+BAA+B;AAC/B,wDAA4C;AAE5C;;GAEG;AACH,SAAgB,qBAAqB;IACnC,OAAO,CACL,oBAAC,oBAAI,IAAC,SAAS,EAAC,kCAAkC;QAChD,6BACE,KAAK,EAAC,4BAA4B,EAClC,UAAU,EAAC,8BAA8B,EACzC,OAAO,EAAC,WAAW;YAEnB;gBACE,wCACE,EAAE,EAAC,GAAG,EACN,EAAE,EAAC,GAAG,EACN,EAAE,EAAC,IAAI,EACP,EAAE,EAAC,GAAG,EACN,EAAE,EAAC,GAAG,EACN,aAAa,EAAC,gBAAgB;oBAE9B,8BAAM,MAAM,EAAC,GAAG,EAAC,SAAS,EAAC,SAAS,GAAG;oBACvC,8BAAM,MAAM,EAAC,GAAG,EAAC,SAAS,EAAC,SAAS,GAAG,CACxB,CACZ;YACP,8BAAM,CAAC,EAAC,iBAAiB,EAAC,IAAI,EAAC,SAAS,GAAG;YAC3C,8BACE,CAAC,EAAC,8KAA8K,EAChL,IAAI,EAAC,SAAS,GACd;YACF,gCACE,EAAE,EAAC,IAAI,EACP,EAAE,EAAC,GAAG,EACN,CAAC,EAAC,GAAG,EACL,OAAO,EAAC,KAAK,EACb,KAAK,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,GAC/B,CACE,CACD,CACR,CAAC;AACJ,CAAC;AApCD,sDAoCC","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 Utilities\n */\n\nimport \"./TechnicalPreviewBadge.scss\";\nimport * as React from \"react\";\nimport { Icon } from \"@itwin/itwinui-react\";\n\n/** Technical preview badge component.\n * @internal\n */\nexport function TechnicalPreviewBadge() {\n return (\n <Icon className=\"core-badge-technicalPreviewBadge\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlnsXlink=\"http://www.w3.org/1999/xlink\"\n viewBox=\"0 0 16 16\"\n >\n <defs>\n <linearGradient\n id=\"a\"\n x1=\"8\"\n y1=\"15\"\n x2=\"8\"\n y2=\"1\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0\" stopColor=\"#ffc335\" />\n <stop offset=\"1\" stopColor=\"#ffdf52\" />\n </linearGradient>\n </defs>\n <path d=\"M15,1V15L1,1H15\" fill=\"url(#a)\" />\n <path\n d=\"M15,1V15L1,1H15m0-1H1A.87458.87458,0,0,0,.1.6.91284.91284,0,0,0,.3,1.7l14,14a.90783.90783,0,0,0,.7.3.60123.60123,0,0,0,.4-.1A.961.961,0,0,0,16,15V1A.94477.94477,0,0,0,15,0Z\"\n fill=\"#ffc000\"\n />\n <circle\n cx=\"11\"\n cy=\"5\"\n r=\"2\"\n opacity=\"0.9\"\n style={{ isolation: \"isolate\" }}\n />\n </svg>\n </Icon>\n );\n}\n"]}
@@ -2,12 +2,6 @@
2
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
- @import "../style/themecolors";
6
-
7
- $icon-size: 16px;
8
-
9
- .core-badge {
5
+ .core-badge-technicalPreviewBadge {
10
6
  transform: rotate(270deg);
11
- width: $icon-size;
12
- height: $icon-size;
13
7
  }
@@ -14,7 +14,7 @@ const React = require("react");
14
14
  */
15
15
  function Gap(props) {
16
16
  const { size, style, ...rest } = props;
17
- const paddingLeft = size ?? "10px";
17
+ const paddingLeft = size !== null && size !== void 0 ? size : "10px";
18
18
  return React.createElement("span", { style: { ...style, paddingLeft }, ...rest });
19
19
  }
20
20
  exports.Gap = Gap;
@@ -1 +1 @@
1
- {"version":3,"file":"Gap.js","sourceRoot":"","sources":["../../../../src/core-react/base/Gap.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAU/B;;GAEG;AACH,SAAgB,GAAG,CAAC,KAAe;IACjC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IACvC,MAAM,WAAW,GAAG,IAAI,IAAI,MAAM,CAAC;IAEnC,OAAO,8BAAM,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,WAAW,EAAE,KAAM,IAAI,GAAI,CAAC;AAC9D,CAAC;AALD,kBAKC","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 Base\n */\n\nimport * as React from \"react\";\nimport type { CommonProps } from \"../utils/Props\";\n\n/** Properties for the [[Gap]] component.\n * @public\n */\nexport interface GapProps extends CommonProps {\n size?: string;\n}\n\n/** Horizontal gap or space React component. Defaults to 10px.\n * @public\n */\nexport function Gap(props: GapProps) {\n const { size, style, ...rest } = props;\n const paddingLeft = size ?? \"10px\";\n\n return <span style={{ ...style, paddingLeft }} {...rest} />;\n}\n"]}
1
+ {"version":3,"file":"Gap.js","sourceRoot":"","sources":["../../../../src/core-react/base/Gap.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAU/B;;GAEG;AACH,SAAgB,GAAG,CAAC,KAAe;IACjC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IACvC,MAAM,WAAW,GAAG,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,MAAM,CAAC;IAEnC,OAAO,8BAAM,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,WAAW,EAAE,KAAM,IAAI,GAAI,CAAC;AAC9D,CAAC;AALD,kBAKC","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 Base\n */\n\nimport * as React from \"react\";\nimport type { CommonProps } from \"../utils/Props\";\n\n/** Properties for the [[Gap]] component.\n * @public\n */\nexport interface GapProps extends CommonProps {\n size?: string;\n}\n\n/** Horizontal gap or space React component. Defaults to 10px.\n * @public\n */\nexport function Gap(props: GapProps) {\n const { size, style, ...rest } = props;\n const paddingLeft = size ?? \"10px\";\n\n return <span style={{ ...style, paddingLeft }} {...rest} />;\n}\n"]}
@@ -224,12 +224,13 @@ class ContextMenu extends React.PureComponent {
224
224
  React.createElement("div", { ref: this._menuRef, role: "menu", tabIndex: 0, "data-testid": "core-context-menu-container", className: (0, classnames_1.default)("core-context-menu-container", opened && "core-context-menu-opened", floating && "core-context-menu-floating", ContextMenu.getCSSClassNameFromDirection(renderDirection)) }, this._injectedChildren))));
225
225
  }
226
226
  getWindow() {
227
+ var _a;
227
228
  const el = this._rootElement
228
229
  ? this._rootElement
229
230
  : /* istanbul ignore next */ this._menuElement;
230
231
  const parentDocument = el.ownerDocument;
231
232
  // istanbul ignore next
232
- return parentDocument.defaultView ?? window;
233
+ return (_a = parentDocument.defaultView) !== null && _a !== void 0 ? _a : window;
233
234
  }
234
235
  /** @internal */
235
236
  componentDidMount() {