@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.
- package/CHANGELOG.md +17 -1
- package/ContributeGuidelines.md +2 -2
- package/lib/cjs/core-react/UiCore.d.ts +3 -7
- package/lib/cjs/core-react/UiCore.d.ts.map +1 -1
- package/lib/cjs/core-react/UiCore.js +4 -22
- package/lib/cjs/core-react/UiCore.js.map +1 -1
- package/lib/cjs/core-react/UiCore.json +31 -0
- package/lib/cjs/core-react/badge/Badge.d.ts +6 -9
- package/lib/cjs/core-react/badge/Badge.d.ts.map +1 -1
- package/lib/cjs/core-react/badge/Badge.js +10 -9
- package/lib/cjs/core-react/badge/Badge.js.map +1 -1
- package/lib/cjs/core-react/badge/BadgeType.d.ts +13 -0
- package/lib/cjs/core-react/badge/BadgeType.d.ts.map +1 -0
- package/lib/cjs/core-react/badge/BadgeType.js +16 -0
- package/lib/cjs/core-react/badge/BadgeType.js.map +1 -0
- package/lib/cjs/core-react/badge/NewBadge.d.ts +2 -3
- package/lib/cjs/core-react/badge/NewBadge.d.ts.map +1 -1
- package/lib/cjs/core-react/badge/NewBadge.js +6 -7
- package/lib/cjs/core-react/badge/NewBadge.js.map +1 -1
- package/lib/cjs/core-react/badge/NewBadge.scss +2 -3
- package/lib/cjs/core-react/badge/TechnicalPreviewBadge.d.ts +10 -0
- package/lib/cjs/core-react/badge/TechnicalPreviewBadge.d.ts.map +1 -0
- package/lib/cjs/core-react/badge/TechnicalPreviewBadge.js +29 -0
- package/lib/cjs/core-react/badge/TechnicalPreviewBadge.js.map +1 -0
- package/lib/cjs/core-react/badge/{Badge.scss → TechnicalPreviewBadge.scss} +1 -7
- package/lib/cjs/core-react/base/Gap.js +1 -1
- package/lib/cjs/core-react/base/Gap.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenu.js +2 -1
- package/lib/cjs/core-react/contextmenu/ContextMenu.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenu.scss +0 -1
- package/lib/cjs/core-react/contextmenu/ContextMenuItem.d.ts +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenuItem.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenuItem.js +3 -3
- package/lib/cjs/core-react/contextmenu/ContextMenuItem.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextSubMenu.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextSubMenu.js +3 -3
- package/lib/cjs/core-react/contextmenu/ContextSubMenu.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/GlobalContextMenu.js +5 -3
- package/lib/cjs/core-react/contextmenu/GlobalContextMenu.js.map +1 -1
- package/lib/cjs/core-react/dialog/Dialog.d.ts +1 -0
- package/lib/cjs/core-react/dialog/Dialog.d.ts.map +1 -1
- package/lib/cjs/core-react/dialog/Dialog.js +54 -52
- package/lib/cjs/core-react/dialog/Dialog.js.map +1 -1
- package/lib/cjs/core-react/dialog/GlobalDialog.js +2 -1
- package/lib/cjs/core-react/dialog/GlobalDialog.js.map +1 -1
- package/lib/cjs/core-react/elementseparator/ElementSeparator.d.ts.map +1 -1
- package/lib/cjs/core-react/elementseparator/ElementSeparator.js +5 -5
- package/lib/cjs/core-react/elementseparator/ElementSeparator.js.map +1 -1
- package/lib/cjs/core-react/hocs/withOnOutsideClick.js +2 -1
- package/lib/cjs/core-react/hocs/withOnOutsideClick.js.map +1 -1
- package/lib/cjs/core-react/icons/IconComponent.js +1 -1
- package/lib/cjs/core-react/icons/IconComponent.js.map +1 -1
- package/lib/cjs/core-react/inputs/input-label.scss +1 -2
- package/lib/cjs/core-react/inputs/variables.scss +0 -2
- package/lib/cjs/core-react/l10n/LocalizationProvider.d.ts +20 -0
- package/lib/cjs/core-react/l10n/LocalizationProvider.d.ts.map +1 -0
- package/lib/cjs/core-react/l10n/LocalizationProvider.js +29 -0
- package/lib/cjs/core-react/l10n/LocalizationProvider.js.map +1 -0
- package/lib/cjs/core-react/l10n/usePackageTranslation.d.ts +15 -0
- package/lib/cjs/core-react/l10n/usePackageTranslation.d.ts.map +1 -0
- package/lib/cjs/core-react/l10n/usePackageTranslation.js +64 -0
- package/lib/cjs/core-react/l10n/usePackageTranslation.js.map +1 -0
- package/lib/cjs/core-react/l10n/useTranslation.d.ts +7 -0
- package/lib/cjs/core-react/l10n/useTranslation.d.ts.map +1 -0
- package/lib/cjs/core-react/l10n/useTranslation.js +30 -0
- package/lib/cjs/core-react/l10n/useTranslation.js.map +1 -0
- package/lib/cjs/core-react/listbox/Listbox.js +3 -2
- package/lib/cjs/core-react/listbox/Listbox.js.map +1 -1
- package/lib/cjs/core-react/notification/MessageRenderer.js +1 -1
- package/lib/cjs/core-react/notification/MessageRenderer.js.map +1 -1
- package/lib/cjs/core-react/popup/Popup.js +8 -4
- package/lib/cjs/core-react/popup/Popup.js.map +1 -1
- package/lib/cjs/core-react/searchbox/SearchBox.d.ts.map +1 -1
- package/lib/cjs/core-react/searchbox/SearchBox.js +13 -7
- package/lib/cjs/core-react/searchbox/SearchBox.js.map +1 -1
- package/lib/cjs/core-react/tabs/tabs.scss +1 -1
- package/lib/cjs/core-react/tree/ExpansionToggle.d.ts +1 -3
- package/lib/cjs/core-react/tree/ExpansionToggle.d.ts.map +1 -1
- package/lib/cjs/core-react/tree/ExpansionToggle.js +9 -10
- package/lib/cjs/core-react/tree/ExpansionToggle.js.map +1 -1
- package/lib/cjs/core-react/tree/Node.js +2 -1
- package/lib/cjs/core-react/tree/Node.js.map +1 -1
- package/lib/cjs/core-react/utils/IconWebComponent.d.ts +4 -2
- package/lib/cjs/core-react/utils/IconWebComponent.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/IconWebComponent.js +10 -6
- package/lib/cjs/core-react/utils/IconWebComponent.js.map +1 -1
- package/lib/cjs/core-react/utils/getCssVariable.js +1 -1
- package/lib/cjs/core-react/utils/getCssVariable.js.map +1 -1
- package/lib/cjs/core-react/utils/getObjectClassName.js +3 -2
- package/lib/cjs/core-react/utils/getObjectClassName.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.js +2 -1
- package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.js +14 -8
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.js.map +1 -1
- package/lib/cjs/core-react.d.ts +3 -3
- package/lib/cjs/core-react.d.ts.map +1 -1
- package/lib/cjs/core-react.js +12 -9
- package/lib/cjs/core-react.js.map +1 -1
- package/lib/esm/core-react/UiCore.d.ts +3 -7
- package/lib/esm/core-react/UiCore.d.ts.map +1 -1
- package/lib/esm/core-react/UiCore.js +4 -22
- package/lib/esm/core-react/UiCore.js.map +1 -1
- package/lib/esm/core-react/UiCore.json +31 -0
- package/lib/esm/core-react/badge/Badge.d.ts +6 -9
- package/lib/esm/core-react/badge/Badge.d.ts.map +1 -1
- package/lib/esm/core-react/badge/Badge.js +10 -9
- package/lib/esm/core-react/badge/Badge.js.map +1 -1
- package/lib/esm/core-react/badge/BadgeType.d.ts +13 -0
- package/lib/esm/core-react/badge/BadgeType.d.ts.map +1 -0
- package/lib/esm/core-react/badge/BadgeType.js +13 -0
- package/lib/esm/core-react/badge/BadgeType.js.map +1 -0
- package/lib/esm/core-react/badge/NewBadge.d.ts +2 -3
- package/lib/esm/core-react/badge/NewBadge.d.ts.map +1 -1
- package/lib/esm/core-react/badge/NewBadge.js +6 -7
- package/lib/esm/core-react/badge/NewBadge.js.map +1 -1
- package/lib/esm/core-react/badge/NewBadge.scss +2 -3
- package/lib/esm/core-react/badge/TechnicalPreviewBadge.d.ts +10 -0
- package/lib/esm/core-react/badge/TechnicalPreviewBadge.d.ts.map +1 -0
- package/lib/esm/core-react/badge/TechnicalPreviewBadge.js +25 -0
- package/lib/esm/core-react/badge/TechnicalPreviewBadge.js.map +1 -0
- package/lib/esm/core-react/badge/{Badge.scss → TechnicalPreviewBadge.scss} +1 -7
- package/lib/esm/core-react/base/Gap.js +1 -1
- package/lib/esm/core-react/base/Gap.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenu.js +2 -1
- package/lib/esm/core-react/contextmenu/ContextMenu.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenu.scss +0 -1
- package/lib/esm/core-react/contextmenu/ContextMenuItem.d.ts +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenuItem.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenuItem.js +3 -3
- package/lib/esm/core-react/contextmenu/ContextMenuItem.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextSubMenu.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextSubMenu.js +3 -3
- package/lib/esm/core-react/contextmenu/ContextSubMenu.js.map +1 -1
- package/lib/esm/core-react/contextmenu/GlobalContextMenu.js +5 -3
- package/lib/esm/core-react/contextmenu/GlobalContextMenu.js.map +1 -1
- package/lib/esm/core-react/dialog/Dialog.d.ts +1 -0
- package/lib/esm/core-react/dialog/Dialog.d.ts.map +1 -1
- package/lib/esm/core-react/dialog/Dialog.js +54 -52
- package/lib/esm/core-react/dialog/Dialog.js.map +1 -1
- package/lib/esm/core-react/dialog/GlobalDialog.js +2 -1
- package/lib/esm/core-react/dialog/GlobalDialog.js.map +1 -1
- package/lib/esm/core-react/elementseparator/ElementSeparator.d.ts.map +1 -1
- package/lib/esm/core-react/elementseparator/ElementSeparator.js +5 -5
- package/lib/esm/core-react/elementseparator/ElementSeparator.js.map +1 -1
- package/lib/esm/core-react/hocs/withOnOutsideClick.js +2 -1
- package/lib/esm/core-react/hocs/withOnOutsideClick.js.map +1 -1
- package/lib/esm/core-react/icons/IconComponent.js +1 -1
- package/lib/esm/core-react/icons/IconComponent.js.map +1 -1
- package/lib/esm/core-react/inputs/input-label.scss +1 -2
- package/lib/esm/core-react/inputs/variables.scss +0 -2
- package/lib/esm/core-react/l10n/LocalizationProvider.d.ts +20 -0
- package/lib/esm/core-react/l10n/LocalizationProvider.d.ts.map +1 -0
- package/lib/esm/core-react/l10n/LocalizationProvider.js +24 -0
- package/lib/esm/core-react/l10n/LocalizationProvider.js.map +1 -0
- package/lib/esm/core-react/l10n/usePackageTranslation.d.ts +15 -0
- package/lib/esm/core-react/l10n/usePackageTranslation.d.ts.map +1 -0
- package/lib/esm/core-react/l10n/usePackageTranslation.js +60 -0
- package/lib/esm/core-react/l10n/usePackageTranslation.js.map +1 -0
- package/lib/esm/core-react/l10n/useTranslation.d.ts +7 -0
- package/lib/esm/core-react/l10n/useTranslation.d.ts.map +1 -0
- package/lib/esm/core-react/l10n/useTranslation.js +26 -0
- package/lib/esm/core-react/l10n/useTranslation.js.map +1 -0
- package/lib/esm/core-react/listbox/Listbox.js +3 -2
- package/lib/esm/core-react/listbox/Listbox.js.map +1 -1
- package/lib/esm/core-react/notification/MessageRenderer.js +1 -1
- package/lib/esm/core-react/notification/MessageRenderer.js.map +1 -1
- package/lib/esm/core-react/popup/Popup.js +8 -4
- package/lib/esm/core-react/popup/Popup.js.map +1 -1
- package/lib/esm/core-react/searchbox/SearchBox.d.ts.map +1 -1
- package/lib/esm/core-react/searchbox/SearchBox.js +13 -7
- package/lib/esm/core-react/searchbox/SearchBox.js.map +1 -1
- package/lib/esm/core-react/tabs/tabs.scss +1 -1
- package/lib/esm/core-react/tree/ExpansionToggle.d.ts +1 -3
- package/lib/esm/core-react/tree/ExpansionToggle.d.ts.map +1 -1
- package/lib/esm/core-react/tree/ExpansionToggle.js +9 -10
- package/lib/esm/core-react/tree/ExpansionToggle.js.map +1 -1
- package/lib/esm/core-react/tree/Node.js +2 -1
- package/lib/esm/core-react/tree/Node.js.map +1 -1
- package/lib/esm/core-react/utils/IconWebComponent.d.ts +4 -2
- package/lib/esm/core-react/utils/IconWebComponent.d.ts.map +1 -1
- package/lib/esm/core-react/utils/IconWebComponent.js +8 -5
- package/lib/esm/core-react/utils/IconWebComponent.js.map +1 -1
- package/lib/esm/core-react/utils/getCssVariable.js +1 -1
- package/lib/esm/core-react/utils/getCssVariable.js.map +1 -1
- package/lib/esm/core-react/utils/getObjectClassName.js +3 -2
- package/lib/esm/core-react/utils/getObjectClassName.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.js +2 -1
- package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useResizeObserver.js +14 -8
- package/lib/esm/core-react/utils/hooks/useResizeObserver.js.map +1 -1
- package/lib/esm/core-react.d.ts +3 -3
- package/lib/esm/core-react.d.ts.map +1 -1
- package/lib/esm/core-react.js +5 -4
- package/lib/esm/core-react.js.map +1 -1
- package/package.json +5 -6
- package/lib/cjs/core-react/badge/BadgeUtilities.d.ts +0 -13
- package/lib/cjs/core-react/badge/BadgeUtilities.d.ts.map +0 -1
- package/lib/cjs/core-react/badge/BadgeUtilities.js +0 -39
- package/lib/cjs/core-react/badge/BadgeUtilities.js.map +0 -1
- package/lib/cjs/core-react/badge/BetaBadge.d.ts +0 -10
- package/lib/cjs/core-react/badge/BetaBadge.d.ts.map +0 -1
- package/lib/cjs/core-react/badge/BetaBadge.js +0 -23
- package/lib/cjs/core-react/badge/BetaBadge.js.map +0 -1
- package/lib/cjs/core-react/badge/new-feature-badge.svg +0 -1
- package/lib/cjs/core-react/badge/technical-preview-badge.svg +0 -1
- package/lib/esm/core-react/badge/BadgeUtilities.d.ts +0 -13
- package/lib/esm/core-react/badge/BadgeUtilities.d.ts.map +0 -1
- package/lib/esm/core-react/badge/BadgeUtilities.js +0 -35
- package/lib/esm/core-react/badge/BadgeUtilities.js.map +0 -1
- package/lib/esm/core-react/badge/BetaBadge.d.ts +0 -10
- package/lib/esm/core-react/badge/BetaBadge.d.ts.map +0 -1
- package/lib/esm/core-react/badge/BetaBadge.js +0 -19
- package/lib/esm/core-react/badge/BetaBadge.js.map +0 -1
- package/lib/esm/core-react/badge/new-feature-badge.svg +0 -1
- 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
|
|
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
|
package/ContributeGuidelines.md
CHANGED
|
@@ -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 `
|
|
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 =
|
|
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.
|
|
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;
|
|
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
|
-
|
|
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.
|
|
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,
|
|
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
|
|
7
|
-
/** Properties for the [[Badge]]
|
|
5
|
+
import { BadgeType } from "./BadgeType";
|
|
6
|
+
/** Properties for the [[Badge]] component.
|
|
8
7
|
* @internal
|
|
9
8
|
*/
|
|
10
|
-
export interface BadgeProps
|
|
11
|
-
|
|
9
|
+
export interface BadgeProps {
|
|
10
|
+
type?: BadgeType;
|
|
12
11
|
}
|
|
13
|
-
/**
|
|
12
|
+
/** Badge component that renders based on a badge type.
|
|
14
13
|
* @internal
|
|
15
14
|
*/
|
|
16
|
-
export declare
|
|
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,
|
|
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
|
|
15
|
-
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
return
|
|
21
|
-
|
|
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
|
|
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
|
-
|
|
7
|
-
/** New Badge React component
|
|
6
|
+
/** New badge component.
|
|
8
7
|
* @internal
|
|
9
8
|
*/
|
|
10
|
-
export declare function NewBadge(
|
|
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;
|
|
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
|
|
15
|
-
|
|
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(
|
|
20
|
-
|
|
21
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
233
|
+
return (_a = parentDocument.defaultView) !== null && _a !== void 0 ? _a : window;
|
|
233
234
|
}
|
|
234
235
|
/** @internal */
|
|
235
236
|
componentDidMount() {
|