@itwin/appui-react 3.7.2 → 3.7.4

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 CHANGED
@@ -1,6 +1,18 @@
1
1
  # Change Log - @itwin/appui-react
2
2
 
3
- This log was last generated on Wed, 12 Apr 2023 13:12:42 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 25 Apr 2023 17:50:35 GMT and should not be manually modified.
4
+
5
+ ## 3.7.4
6
+ Tue, 25 Apr 2023 17:50:35 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 3.7.3
11
+ Thu, 20 Apr 2023 13:19:28 GMT
12
+
13
+ ### Updates
14
+
15
+ - Fix stale options of SelectionScopeField.
4
16
 
5
17
  ## 3.7.2
6
18
  Wed, 12 Apr 2023 13:12:42 GMT
@@ -1,8 +1,8 @@
1
1
  /** @packageDocumentation
2
2
  * @module StatusBar
3
3
  */
4
+ /// <reference types="react" />
4
5
  import "./SelectionScope.scss";
5
- import * as React from "react";
6
6
  import { PresentationSelectionScope } from "../redux/SessionState";
7
7
  import { StatusFieldProps } from "./StatusFieldProps";
8
8
  /** Defines properties supported by the SelectionScopeField Component.
@@ -20,19 +20,12 @@ interface SelectionScopeFieldProps extends StatusFieldProps {
20
20
  * in the Redux state.
21
21
  * @public
22
22
  */
23
- declare class SelectionScopeFieldComponent extends React.Component<SelectionScopeFieldProps> {
24
- private _label;
25
- private _toolTip;
26
- private _scopeOptions;
27
- constructor(props: SelectionScopeFieldProps);
28
- private _updateSelectValue;
29
- render(): React.ReactNode;
30
- }
23
+ declare function SelectionScopeFieldComponent(props: SelectionScopeFieldProps): JSX.Element;
31
24
  /**
32
25
  * SelectionScopeField React component. This component is designed to be specified in a status bar definition. It will
33
26
  * display the active selection scope that is used by the PresentationManager to determine what elements are added to the selection nap mode.
34
27
  * This React component is Redux connected.
35
28
  * @public
36
- */ export declare const SelectionScopeField: import("react-redux").ConnectedComponent<typeof SelectionScopeFieldComponent, import("react-redux").Omit<React.ClassAttributes<SelectionScopeFieldComponent> & SelectionScopeFieldProps, "availableSelectionScopes" | "activeSelectionScope">>;
29
+ */ export declare const SelectionScopeField: import("react-redux").ConnectedComponent<typeof SelectionScopeFieldComponent, import("react-redux").Omit<SelectionScopeFieldProps, "availableSelectionScopes" | "activeSelectionScope">>;
37
30
  export {};
38
31
  //# sourceMappingURL=SelectionScope.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectionScope.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/statusfields/SelectionScope.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,uBAAuB,CAAC;AAE/B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,UAAU,wBAAyB,SAAQ,gBAAgB;IAEzD,oBAAoB,EAAE,MAAM,CAAC;IAC7B,wBAAwB,EAAE,0BAA0B,EAAE,CAAC;CACxD;AAED;;;;;;;GAOG;AACH,cAAM,4BAA6B,SAAQ,KAAK,CAAC,SAAS,CAAC,wBAAwB,CAAC;IAClF,OAAO,CAAC,MAAM,CAAsD;IACpE,OAAO,CAAC,QAAQ,CAAwD;IACxE,OAAO,CAAC,aAAa,CAA8B;gBAEvC,KAAK,EAAE,wBAAwB;IAQ3C,OAAO,CAAC,kBAAkB,CAKxB;IAEc,MAAM,IAAI,KAAK,CAAC,SAAS;CA0B1C;AAaD;;;;;GAKG,CACH,eAAO,MAAM,mBAAmB,gPAAyD,CAAC"}
1
+ {"version":3,"file":"SelectionScope.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/statusfields/SelectionScope.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAEH,OAAO,uBAAuB,CAAC;AAM/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,UAAU,wBAAyB,SAAQ,gBAAgB;IACzD,oBAAoB,EAAE,MAAM,CAAC;IAC7B,wBAAwB,EAAE,0BAA0B,EAAE,CAAC;CACxD;AAED;;;;;;;GAOG;AACH,iBAAS,4BAA4B,CAAC,KAAK,EAAE,wBAAwB,eAqCpE;AAYD;;;;;GAKG,CACH,eAAO,MAAM,mBAAmB,0LAAyD,CAAC"}
@@ -23,35 +23,28 @@ const UiFramework_1 = require("../UiFramework");
23
23
  * in the Redux state.
24
24
  * @public
25
25
  */
26
- class SelectionScopeFieldComponent extends React.Component {
27
- constructor(props) {
28
- super(props);
29
- this._label = UiFramework_1.UiFramework.translate("selectionScopeField.label");
30
- this._toolTip = UiFramework_1.UiFramework.translate("selectionScopeField.toolTip");
31
- this._scopeOptions = [];
32
- this._updateSelectValue = (newValue) => {
33
- // istanbul ignore else
34
- if (newValue) {
35
- UiFramework_1.UiFramework.setActiveSelectionScope(newValue);
36
- }
37
- };
38
- this._scopeOptions = this.props.availableSelectionScopes.map((scope) => {
39
- const label = !!scope.label ? scope.label : UiFramework_1.UiFramework.translate(`selectionScopeLabels.${scope.id}`);
40
- return { value: scope.id, label };
41
- });
42
- }
43
- render() {
44
- var _a, _b;
45
- return (React.createElement(appui_layout_react_1.FooterIndicator // eslint-disable-line deprecation/deprecation
46
- , { className: (0, classnames_1.default)("uifw-statusFields-selectionScope", this.props.className), style: this.props.style,
47
- // eslint-disable-next-line deprecation/deprecation
48
- isInFooterMode: (_a = this.props.isInFooterMode) !== null && _a !== void 0 ? _a : true },
49
- ((_b = this.props.isInFooterMode) !== null && _b !== void 0 ? _b : true) &&
50
- React.createElement("label", { className: "uifw-statusFields-selectionScope-label" },
51
- this._label,
52
- ":"),
53
- React.createElement(itwinui_react_1.Select, { className: "uifw-statusFields-selectionScope-selector", value: this.props.activeSelectionScope, options: this._scopeOptions, onChange: this._updateSelectValue, "data-testid": "components-selectionScope-selector", title: this._toolTip, size: "small" })));
54
- }
26
+ function SelectionScopeFieldComponent(props) {
27
+ var _a, _b;
28
+ const label = UiFramework_1.UiFramework.translate("selectionScopeField.label");
29
+ const toolTip = UiFramework_1.UiFramework.translate("selectionScopeField.toolTip");
30
+ const options = React.useMemo(() => props.availableSelectionScopes.map((scope) => {
31
+ return { value: scope.id, label: scope.label };
32
+ }), [props.availableSelectionScopes]);
33
+ const updateSelectValue = (newValue) => {
34
+ // istanbul ignore else
35
+ if (newValue) {
36
+ UiFramework_1.UiFramework.setActiveSelectionScope(newValue);
37
+ }
38
+ };
39
+ return (React.createElement(appui_layout_react_1.FooterIndicator // eslint-disable-line deprecation/deprecation
40
+ , { className: (0, classnames_1.default)("uifw-statusFields-selectionScope", props.className), style: props.style,
41
+ // eslint-disable-next-line deprecation/deprecation
42
+ isInFooterMode: (_a = props.isInFooterMode) !== null && _a !== void 0 ? _a : true },
43
+ ((_b = props.isInFooterMode) !== null && _b !== void 0 ? _b : true) &&
44
+ React.createElement("label", { className: "uifw-statusFields-selectionScope-label" },
45
+ label,
46
+ ":"),
47
+ React.createElement(itwinui_react_1.Select, { className: "uifw-statusFields-selectionScope-selector", value: props.activeSelectionScope, options: options, onChange: updateSelectValue, "data-testid": "components-selectionScope-selector", title: toolTip, size: "small" })));
55
48
  }
56
49
  /** Function used by Redux to map state data in Redux store to props that are used to render this component. */
57
50
  function mapStateToProps(state) {
@@ -1 +1 @@
1
- {"version":3,"file":"SelectionScope.js","sourceRoot":"","sources":["../../../../src/appui-react/statusfields/SelectionScope.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,iCAA+B;AAC/B,2CAAoC;AACpC,+BAA+B;AAC/B,6CAAsC;AACtC,kEAA4D;AAC5D,wDAA4D;AAE5D,gDAA6C;AAY7C;;;;;;;GAOG;AACH,MAAM,4BAA6B,SAAQ,KAAK,CAAC,SAAmC;IAKlF,YAAY,KAA+B;QACzC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CAAC,KAAK,CAAC,oBAAoB,EACtC,OAAO,EAAE,IAAI,CAAC,aAAa,EAC3B,QAAQ,EAAE,IAAI,CAAC,kBAAkB,iBACrB,oCAAoC,EAChD,KAAK,EAAE,IAAI,CAAC,QAAQ,EACpB,IAAI,EAAC,OAAO,GAAG,CACA,CACpB,CAAC;IACJ,CAAC;CACF;AAED,+GAA+G;AAC/G,SAAS,eAAe,CAAC,KAAU;IACjC,MAAM,cAAc,GAAG,KAAK,CAAC,yBAAW,CAAC,iBAAiB,CAAC,CAAC,CAAE,8CAA8C;IAC5G,0BAA0B;IAC1B,IAAI,CAAC,cAAc;QACjB,OAAO,SAAS,CAAC;IAEnB,OAAO,EAAE,oBAAoB,EAAE,cAAc,CAAC,YAAY,CAAC,oBAAoB,EAAE,wBAAwB,EAAE,cAAc,CAAC,YAAY,CAAC,wBAAwB,EAAE,CAAC;AACpK,CAAC;AAED,4EAA4E;AAC5E;;;;;GAKG,CAAC,gEAAgE;AACvD,QAAA,mBAAmB,GAAG,IAAA,qBAAO,EAAC,eAAe,CAAC,CAAC,4BAA4B,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module StatusBar\r\n */\r\n\r\nimport \"./SelectionScope.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { connect } from \"react-redux\";\r\nimport { FooterIndicator } from \"@itwin/appui-layout-react\";\r\nimport { Select, SelectOption } from \"@itwin/itwinui-react\";\r\nimport { PresentationSelectionScope } from \"../redux/SessionState\";\r\nimport { UiFramework } from \"../UiFramework\";\r\nimport { StatusFieldProps } from \"./StatusFieldProps\";\r\n\r\n/** Defines properties supported by the SelectionScopeField Component.\r\n * @public\r\n */\r\ninterface SelectionScopeFieldProps extends StatusFieldProps {\r\n\r\n activeSelectionScope: string;\r\n availableSelectionScopes: PresentationSelectionScope[];\r\n}\r\n\r\n/**\r\n * Status Field React component. This component is designed to be specified in a status bar definition.\r\n * It is used to display the number of selected items based on the Presentation Rules Selection Manager.\r\n * The IModelApp should call either UiFramework.setIModelConnection or SyncUiEventDispatcher.initializeConnectionEvents\r\n * with the active iModelConnection each time a new iModel is opened so the selection scope data is properly updated\r\n * in the Redux state.\r\n * @public\r\n */\r\nclass SelectionScopeFieldComponent extends React.Component<SelectionScopeFieldProps> {\r\n private _label = UiFramework.translate(\"selectionScopeField.label\");\r\n private _toolTip = UiFramework.translate(\"selectionScopeField.toolTip\");\r\n private _scopeOptions: SelectOption<string>[] = [];\r\n\r\n constructor(props: SelectionScopeFieldProps) {\r\n super(props);\r\n this._scopeOptions = this.props.availableSelectionScopes.map((scope: PresentationSelectionScope) => {\r\n const label = !!scope.label ? scope.label : UiFramework.translate(`selectionScopeLabels.${scope.id}`);\r\n return { value: scope.id, label };\r\n });\r\n }\r\n\r\n private _updateSelectValue = (newValue: string) => {\r\n // istanbul ignore else\r\n if (newValue) {\r\n UiFramework.setActiveSelectionScope(newValue);\r\n }\r\n };\r\n\r\n public override render(): React.ReactNode {\r\n\r\n return (\r\n <FooterIndicator // eslint-disable-line deprecation/deprecation\r\n className={classnames(\"uifw-statusFields-selectionScope\", this.props.className)}\r\n style={this.props.style}\r\n // eslint-disable-next-line deprecation/deprecation\r\n isInFooterMode={this.props.isInFooterMode ?? true}\r\n >\r\n {// eslint-disable-next-line deprecation/deprecation\r\n (this.props.isInFooterMode ?? true) &&\r\n <label className=\"uifw-statusFields-selectionScope-label\">\r\n {this._label}:\r\n </label>\r\n }\r\n <Select\r\n className=\"uifw-statusFields-selectionScope-selector\"\r\n value={this.props.activeSelectionScope}\r\n options={this._scopeOptions}\r\n onChange={this._updateSelectValue}\r\n data-testid=\"components-selectionScope-selector\"\r\n title={this._toolTip}\r\n size=\"small\" />\r\n </FooterIndicator >\r\n );\r\n }\r\n}\r\n\r\n/** Function used by Redux to map state data in Redux store to props that are used to render this component. */\r\nfunction mapStateToProps(state: any) {\r\n const frameworkState = state[UiFramework.frameworkStateKey]; // since app sets up key, don't hard-code name\r\n /* istanbul ignore next */\r\n if (!frameworkState)\r\n return undefined;\r\n\r\n return { activeSelectionScope: frameworkState.sessionState.activeSelectionScope, availableSelectionScopes: frameworkState.sessionState.availableSelectionScopes };\r\n}\r\n\r\n// we declare the variable and export that rather than using export default.\r\n/**\r\n * SelectionScopeField React component. This component is designed to be specified in a status bar definition. It will\r\n * display the active selection scope that is used by the PresentationManager to determine what elements are added to the selection nap mode.\r\n * This React component is Redux connected.\r\n * @public\r\n */ // eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport const SelectionScopeField = connect(mapStateToProps)(SelectionScopeFieldComponent);\r\n"]}
1
+ {"version":3,"file":"SelectionScope.js","sourceRoot":"","sources":["../../../../src/appui-react/statusfields/SelectionScope.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,iCAA+B;AAC/B,2CAAoC;AACpC,+BAA+B;AAC/B,6CAAsC;AACtC,kEAA4D;AAC5D,wDAA8C;AAE9C,gDAA6C;AAW7C;;;;;;;GAOG;AACH,SAAS,4BAA4B,CAAC,KAA+B;;IACnE,MAAM,KAAK,GAAG,yBAAW,CAAC,SAAS,CAAC,2BAA2B,CAAC,CAAC;IACjE,MAAM,OAAO,GAAG,yBAAW,CAAC,SAAS,CAAC,6BAA6B,CAAC,CAAC;IAErE,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,wBAAwB,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QAC/E,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;IACjD,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC,CAAC;IAEtC,MAAM,iBAAiB,GAAG,CAAC,QAAgB,EAAE,EAAE;QAC7C,uBAAuB;QACvB,IAAI,QAAQ,EAAE;YACZ,yBAAW,CAAC,uBAAuB,CAAC,QAAQ,CAAC,CAAC;SAC/C;IACH,CAAC,CAAC;IACF,OAAO,CACL,oBAAC,oCAAe,CAAC,8CAA8C;QAC7D,SAAS,EAAE,IAAA,oBAAU,EAAC,kCAAkC,EAAE,KAAK,CAAC,SAAS,CAAC,EAC1E,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,mDAAmD;QACnD,cAAc,EAAE,MAAA,KAAK,CAAC,cAAc,mCAAI,IAAI;QAG1C,CAAC,MAAA,KAAK,CAAC,cAAc,mCAAI,IAAI,CAAC;YAC9B,+BAAO,SAAS,EAAC,wCAAwC;gBACtD,KAAK;oBACA;QAEV,oBAAC,sBAAM,IACL,SAAS,EAAC,2CAA2C,EACrD,KAAK,EAAE,KAAK,CAAC,oBAAoB,EACjC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,iBAAiB,iBACf,oCAAoC,EAChD,KAAK,EAAE,OAAO,EACd,IAAI,EAAC,OAAO,GAAG,CACA,CACpB,CAAC;AACJ,CAAC;AACD,+GAA+G;AAC/G,SAAS,eAAe,CAAC,KAAU;IACjC,MAAM,cAAc,GAAG,KAAK,CAAC,yBAAW,CAAC,iBAAiB,CAAC,CAAC,CAAE,8CAA8C;IAC5G,0BAA0B;IAC1B,IAAI,CAAC,cAAc;QACjB,OAAO,SAAS,CAAC;IAEnB,OAAO,EAAE,oBAAoB,EAAE,cAAc,CAAC,YAAY,CAAC,oBAAoB,EAAE,wBAAwB,EAAE,cAAc,CAAC,YAAY,CAAC,wBAAwB,EAAE,CAAC;AACpK,CAAC;AAED,4EAA4E;AAC5E;;;;;GAKG,CAAC,gEAAgE;AACvD,QAAA,mBAAmB,GAAG,IAAA,qBAAO,EAAC,eAAe,CAAC,CAAC,4BAA4B,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module StatusBar\r\n */\r\n\r\nimport \"./SelectionScope.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { connect } from \"react-redux\";\r\nimport { FooterIndicator } from \"@itwin/appui-layout-react\";\r\nimport { Select } from \"@itwin/itwinui-react\";\r\nimport { PresentationSelectionScope } from \"../redux/SessionState\";\r\nimport { UiFramework } from \"../UiFramework\";\r\nimport { StatusFieldProps } from \"./StatusFieldProps\";\r\n\r\n/** Defines properties supported by the SelectionScopeField Component.\r\n * @public\r\n */\r\ninterface SelectionScopeFieldProps extends StatusFieldProps {\r\n activeSelectionScope: string;\r\n availableSelectionScopes: PresentationSelectionScope[];\r\n}\r\n\r\n/**\r\n * Status Field React component. This component is designed to be specified in a status bar definition.\r\n * It is used to display the number of selected items based on the Presentation Rules Selection Manager.\r\n * The IModelApp should call either UiFramework.setIModelConnection or SyncUiEventDispatcher.initializeConnectionEvents\r\n * with the active iModelConnection each time a new iModel is opened so the selection scope data is properly updated\r\n * in the Redux state.\r\n * @public\r\n */\r\nfunction SelectionScopeFieldComponent(props: SelectionScopeFieldProps) {\r\n const label = UiFramework.translate(\"selectionScopeField.label\");\r\n const toolTip = UiFramework.translate(\"selectionScopeField.toolTip\");\r\n\r\n const options = React.useMemo(() => props.availableSelectionScopes.map((scope) => {\r\n return { value: scope.id, label: scope.label };\r\n }), [props.availableSelectionScopes]);\r\n\r\n const updateSelectValue = (newValue: string) => {\r\n // istanbul ignore else\r\n if (newValue) {\r\n UiFramework.setActiveSelectionScope(newValue);\r\n }\r\n };\r\n return (\r\n <FooterIndicator // eslint-disable-line deprecation/deprecation\r\n className={classnames(\"uifw-statusFields-selectionScope\", props.className)}\r\n style={props.style}\r\n // eslint-disable-next-line deprecation/deprecation\r\n isInFooterMode={props.isInFooterMode ?? true}\r\n >\r\n {// eslint-disable-next-line deprecation/deprecation\r\n (props.isInFooterMode ?? true) &&\r\n <label className=\"uifw-statusFields-selectionScope-label\">\r\n {label}:\r\n </label>\r\n }\r\n <Select\r\n className=\"uifw-statusFields-selectionScope-selector\"\r\n value={props.activeSelectionScope}\r\n options={options}\r\n onChange={updateSelectValue}\r\n data-testid=\"components-selectionScope-selector\"\r\n title={toolTip}\r\n size=\"small\" />\r\n </FooterIndicator >\r\n );\r\n}\r\n/** Function used by Redux to map state data in Redux store to props that are used to render this component. */\r\nfunction mapStateToProps(state: any) {\r\n const frameworkState = state[UiFramework.frameworkStateKey]; // since app sets up key, don't hard-code name\r\n /* istanbul ignore next */\r\n if (!frameworkState)\r\n return undefined;\r\n\r\n return { activeSelectionScope: frameworkState.sessionState.activeSelectionScope, availableSelectionScopes: frameworkState.sessionState.availableSelectionScopes };\r\n}\r\n\r\n// we declare the variable and export that rather than using export default.\r\n/**\r\n * SelectionScopeField React component. This component is designed to be specified in a status bar definition. It will\r\n * display the active selection scope that is used by the PresentationManager to determine what elements are added to the selection nap mode.\r\n * This React component is Redux connected.\r\n * @public\r\n */ // eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport const SelectionScopeField = connect(mapStateToProps)(SelectionScopeFieldComponent);\r\n"]}
@@ -1,8 +1,8 @@
1
1
  /** @packageDocumentation
2
2
  * @module StatusBar
3
3
  */
4
+ /// <reference types="react" />
4
5
  import "./SelectionScope.scss";
5
- import * as React from "react";
6
6
  import { PresentationSelectionScope } from "../redux/SessionState";
7
7
  import { StatusFieldProps } from "./StatusFieldProps";
8
8
  /** Defines properties supported by the SelectionScopeField Component.
@@ -20,19 +20,12 @@ interface SelectionScopeFieldProps extends StatusFieldProps {
20
20
  * in the Redux state.
21
21
  * @public
22
22
  */
23
- declare class SelectionScopeFieldComponent extends React.Component<SelectionScopeFieldProps> {
24
- private _label;
25
- private _toolTip;
26
- private _scopeOptions;
27
- constructor(props: SelectionScopeFieldProps);
28
- private _updateSelectValue;
29
- render(): React.ReactNode;
30
- }
23
+ declare function SelectionScopeFieldComponent(props: SelectionScopeFieldProps): JSX.Element;
31
24
  /**
32
25
  * SelectionScopeField React component. This component is designed to be specified in a status bar definition. It will
33
26
  * display the active selection scope that is used by the PresentationManager to determine what elements are added to the selection nap mode.
34
27
  * This React component is Redux connected.
35
28
  * @public
36
- */ export declare const SelectionScopeField: import("react-redux").ConnectedComponent<typeof SelectionScopeFieldComponent, import("react-redux").Omit<React.ClassAttributes<SelectionScopeFieldComponent> & SelectionScopeFieldProps, "availableSelectionScopes" | "activeSelectionScope">>;
29
+ */ export declare const SelectionScopeField: import("react-redux").ConnectedComponent<typeof SelectionScopeFieldComponent, import("react-redux").Omit<SelectionScopeFieldProps, "availableSelectionScopes" | "activeSelectionScope">>;
37
30
  export {};
38
31
  //# sourceMappingURL=SelectionScope.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectionScope.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/statusfields/SelectionScope.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,uBAAuB,CAAC;AAE/B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,UAAU,wBAAyB,SAAQ,gBAAgB;IAEzD,oBAAoB,EAAE,MAAM,CAAC;IAC7B,wBAAwB,EAAE,0BAA0B,EAAE,CAAC;CACxD;AAED;;;;;;;GAOG;AACH,cAAM,4BAA6B,SAAQ,KAAK,CAAC,SAAS,CAAC,wBAAwB,CAAC;IAClF,OAAO,CAAC,MAAM,CAAsD;IACpE,OAAO,CAAC,QAAQ,CAAwD;IACxE,OAAO,CAAC,aAAa,CAA8B;gBAEvC,KAAK,EAAE,wBAAwB;IAQ3C,OAAO,CAAC,kBAAkB,CAKxB;IAEc,MAAM,IAAI,KAAK,CAAC,SAAS;CA0B1C;AAaD;;;;;GAKG,CACH,eAAO,MAAM,mBAAmB,gPAAyD,CAAC"}
1
+ {"version":3,"file":"SelectionScope.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/statusfields/SelectionScope.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAEH,OAAO,uBAAuB,CAAC;AAM/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,UAAU,wBAAyB,SAAQ,gBAAgB;IACzD,oBAAoB,EAAE,MAAM,CAAC;IAC7B,wBAAwB,EAAE,0BAA0B,EAAE,CAAC;CACxD;AAED;;;;;;;GAOG;AACH,iBAAS,4BAA4B,CAAC,KAAK,EAAE,wBAAwB,eAqCpE;AAYD;;;;;GAKG,CACH,eAAO,MAAM,mBAAmB,0LAAyD,CAAC"}
@@ -20,35 +20,28 @@ import { UiFramework } from "../UiFramework";
20
20
  * in the Redux state.
21
21
  * @public
22
22
  */
23
- class SelectionScopeFieldComponent extends React.Component {
24
- constructor(props) {
25
- super(props);
26
- this._label = UiFramework.translate("selectionScopeField.label");
27
- this._toolTip = UiFramework.translate("selectionScopeField.toolTip");
28
- this._scopeOptions = [];
29
- this._updateSelectValue = (newValue) => {
30
- // istanbul ignore else
31
- if (newValue) {
32
- UiFramework.setActiveSelectionScope(newValue);
33
- }
34
- };
35
- this._scopeOptions = this.props.availableSelectionScopes.map((scope) => {
36
- const label = !!scope.label ? scope.label : UiFramework.translate(`selectionScopeLabels.${scope.id}`);
37
- return { value: scope.id, label };
38
- });
39
- }
40
- render() {
41
- var _a, _b;
42
- return (React.createElement(FooterIndicator // eslint-disable-line deprecation/deprecation
43
- , { className: classnames("uifw-statusFields-selectionScope", this.props.className), style: this.props.style,
44
- // eslint-disable-next-line deprecation/deprecation
45
- isInFooterMode: (_a = this.props.isInFooterMode) !== null && _a !== void 0 ? _a : true },
46
- ((_b = this.props.isInFooterMode) !== null && _b !== void 0 ? _b : true) &&
47
- React.createElement("label", { className: "uifw-statusFields-selectionScope-label" },
48
- this._label,
49
- ":"),
50
- React.createElement(Select, { className: "uifw-statusFields-selectionScope-selector", value: this.props.activeSelectionScope, options: this._scopeOptions, onChange: this._updateSelectValue, "data-testid": "components-selectionScope-selector", title: this._toolTip, size: "small" })));
51
- }
23
+ function SelectionScopeFieldComponent(props) {
24
+ var _a, _b;
25
+ const label = UiFramework.translate("selectionScopeField.label");
26
+ const toolTip = UiFramework.translate("selectionScopeField.toolTip");
27
+ const options = React.useMemo(() => props.availableSelectionScopes.map((scope) => {
28
+ return { value: scope.id, label: scope.label };
29
+ }), [props.availableSelectionScopes]);
30
+ const updateSelectValue = (newValue) => {
31
+ // istanbul ignore else
32
+ if (newValue) {
33
+ UiFramework.setActiveSelectionScope(newValue);
34
+ }
35
+ };
36
+ return (React.createElement(FooterIndicator // eslint-disable-line deprecation/deprecation
37
+ , { className: classnames("uifw-statusFields-selectionScope", props.className), style: props.style,
38
+ // eslint-disable-next-line deprecation/deprecation
39
+ isInFooterMode: (_a = props.isInFooterMode) !== null && _a !== void 0 ? _a : true },
40
+ ((_b = props.isInFooterMode) !== null && _b !== void 0 ? _b : true) &&
41
+ React.createElement("label", { className: "uifw-statusFields-selectionScope-label" },
42
+ label,
43
+ ":"),
44
+ React.createElement(Select, { className: "uifw-statusFields-selectionScope-selector", value: props.activeSelectionScope, options: options, onChange: updateSelectValue, "data-testid": "components-selectionScope-selector", title: toolTip, size: "small" })));
52
45
  }
53
46
  /** Function used by Redux to map state data in Redux store to props that are used to render this component. */
54
47
  function mapStateToProps(state) {
@@ -1 +1 @@
1
- {"version":3,"file":"SelectionScope.js","sourceRoot":"","sources":["../../../../src/appui-react/statusfields/SelectionScope.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,uBAAuB,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;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K,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;YACvB,mDAAmD;YACnD,cAAc,EAAE,MAAA,IAAI,CAAC,KAAK,CAAC,cAAc,mCAAI,IAAI;YAG/C,CAAC,MAAA,IAAI,CAAC,KAAK,CAAC,cAAc,mCAAI,IAAI,CAAC;gBACnC,+BAAO,SAAS,EAAC,wCAAwC;oBACtD,IAAI,CAAC,MAAM;wBACN;YAEV,oBAAC,MAAM,IACL,SAAS,EAAC,2CAA2C,EACrD,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,oBAAoB,EACtC,OAAO,EAAE,IAAI,CAAC,aAAa,EAC3B,QAAQ,EAAE,IAAI,CAAC,kBAAkB,iBACrB,oCAAoC,EAChD,KAAK,EAAE,IAAI,CAAC,QAAQ,EACpB,IAAI,EAAC,OAAO,GAAG,CACA,CACpB,CAAC;IACJ,CAAC;CACF;AAED,+GAA+G;AAC/G,SAAS,eAAe,CAAC,KAAU;IACjC,MAAM,cAAc,GAAG,KAAK,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC,CAAE,8CAA8C;IAC5G,0BAA0B;IAC1B,IAAI,CAAC,cAAc;QACjB,OAAO,SAAS,CAAC;IAEnB,OAAO,EAAE,oBAAoB,EAAE,cAAc,CAAC,YAAY,CAAC,oBAAoB,EAAE,wBAAwB,EAAE,cAAc,CAAC,YAAY,CAAC,wBAAwB,EAAE,CAAC;AACpK,CAAC;AAED,4EAA4E;AAC5E;;;;;GAKG,CAAC,gEAAgE;AACpE,MAAM,CAAC,MAAM,mBAAmB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,4BAA4B,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module StatusBar\r\n */\r\n\r\nimport \"./SelectionScope.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { connect } from \"react-redux\";\r\nimport { FooterIndicator } from \"@itwin/appui-layout-react\";\r\nimport { Select, SelectOption } from \"@itwin/itwinui-react\";\r\nimport { PresentationSelectionScope } from \"../redux/SessionState\";\r\nimport { UiFramework } from \"../UiFramework\";\r\nimport { StatusFieldProps } from \"./StatusFieldProps\";\r\n\r\n/** Defines properties supported by the SelectionScopeField Component.\r\n * @public\r\n */\r\ninterface SelectionScopeFieldProps extends StatusFieldProps {\r\n\r\n activeSelectionScope: string;\r\n availableSelectionScopes: PresentationSelectionScope[];\r\n}\r\n\r\n/**\r\n * Status Field React component. This component is designed to be specified in a status bar definition.\r\n * It is used to display the number of selected items based on the Presentation Rules Selection Manager.\r\n * The IModelApp should call either UiFramework.setIModelConnection or SyncUiEventDispatcher.initializeConnectionEvents\r\n * with the active iModelConnection each time a new iModel is opened so the selection scope data is properly updated\r\n * in the Redux state.\r\n * @public\r\n */\r\nclass SelectionScopeFieldComponent extends React.Component<SelectionScopeFieldProps> {\r\n private _label = UiFramework.translate(\"selectionScopeField.label\");\r\n private _toolTip = UiFramework.translate(\"selectionScopeField.toolTip\");\r\n private _scopeOptions: SelectOption<string>[] = [];\r\n\r\n constructor(props: SelectionScopeFieldProps) {\r\n super(props);\r\n this._scopeOptions = this.props.availableSelectionScopes.map((scope: PresentationSelectionScope) => {\r\n const label = !!scope.label ? scope.label : UiFramework.translate(`selectionScopeLabels.${scope.id}`);\r\n return { value: scope.id, label };\r\n });\r\n }\r\n\r\n private _updateSelectValue = (newValue: string) => {\r\n // istanbul ignore else\r\n if (newValue) {\r\n UiFramework.setActiveSelectionScope(newValue);\r\n }\r\n };\r\n\r\n public override render(): React.ReactNode {\r\n\r\n return (\r\n <FooterIndicator // eslint-disable-line deprecation/deprecation\r\n className={classnames(\"uifw-statusFields-selectionScope\", this.props.className)}\r\n style={this.props.style}\r\n // eslint-disable-next-line deprecation/deprecation\r\n isInFooterMode={this.props.isInFooterMode ?? true}\r\n >\r\n {// eslint-disable-next-line deprecation/deprecation\r\n (this.props.isInFooterMode ?? true) &&\r\n <label className=\"uifw-statusFields-selectionScope-label\">\r\n {this._label}:\r\n </label>\r\n }\r\n <Select\r\n className=\"uifw-statusFields-selectionScope-selector\"\r\n value={this.props.activeSelectionScope}\r\n options={this._scopeOptions}\r\n onChange={this._updateSelectValue}\r\n data-testid=\"components-selectionScope-selector\"\r\n title={this._toolTip}\r\n size=\"small\" />\r\n </FooterIndicator >\r\n );\r\n }\r\n}\r\n\r\n/** Function used by Redux to map state data in Redux store to props that are used to render this component. */\r\nfunction mapStateToProps(state: any) {\r\n const frameworkState = state[UiFramework.frameworkStateKey]; // since app sets up key, don't hard-code name\r\n /* istanbul ignore next */\r\n if (!frameworkState)\r\n return undefined;\r\n\r\n return { activeSelectionScope: frameworkState.sessionState.activeSelectionScope, availableSelectionScopes: frameworkState.sessionState.availableSelectionScopes };\r\n}\r\n\r\n// we declare the variable and export that rather than using export default.\r\n/**\r\n * SelectionScopeField React component. This component is designed to be specified in a status bar definition. It will\r\n * display the active selection scope that is used by the PresentationManager to determine what elements are added to the selection nap mode.\r\n * This React component is Redux connected.\r\n * @public\r\n */ // eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport const SelectionScopeField = connect(mapStateToProps)(SelectionScopeFieldComponent);\r\n"]}
1
+ {"version":3,"file":"SelectionScope.js","sourceRoot":"","sources":["../../../../src/appui-react/statusfields/SelectionScope.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,uBAAuB,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,WAAW,EAA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,CAAC;AACD,+GAA+G;AAC/G,SAAS,eAAe,CAAC,KAAU;IACjC,MAAM,cAAc,GAAG,KAAK,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC,CAAE,8CAA8C;IAC5G,0BAA0B;IAC1B,IAAI,CAAC,cAAc;QACjB,OAAO,SAAS,CAAC;IAEnB,OAAO,EAAE,oBAAoB,EAAE,cAAc,CAAC,YAAY,CAAC,oBAAoB,EAAE,wBAAwB,EAAE,cAAc,CAAC,YAAY,CAAC,wBAAwB,EAAE,CAAC;AACpK,CAAC;AAED,4EAA4E;AAC5E;;;;;GAKG,CAAC,gEAAgE;AACpE,MAAM,CAAC,MAAM,mBAAmB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,4BAA4B,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module StatusBar\r\n */\r\n\r\nimport \"./SelectionScope.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { connect } from \"react-redux\";\r\nimport { FooterIndicator } from \"@itwin/appui-layout-react\";\r\nimport { Select } from \"@itwin/itwinui-react\";\r\nimport { PresentationSelectionScope } from \"../redux/SessionState\";\r\nimport { UiFramework } from \"../UiFramework\";\r\nimport { StatusFieldProps } from \"./StatusFieldProps\";\r\n\r\n/** Defines properties supported by the SelectionScopeField Component.\r\n * @public\r\n */\r\ninterface SelectionScopeFieldProps extends StatusFieldProps {\r\n activeSelectionScope: string;\r\n availableSelectionScopes: PresentationSelectionScope[];\r\n}\r\n\r\n/**\r\n * Status Field React component. This component is designed to be specified in a status bar definition.\r\n * It is used to display the number of selected items based on the Presentation Rules Selection Manager.\r\n * The IModelApp should call either UiFramework.setIModelConnection or SyncUiEventDispatcher.initializeConnectionEvents\r\n * with the active iModelConnection each time a new iModel is opened so the selection scope data is properly updated\r\n * in the Redux state.\r\n * @public\r\n */\r\nfunction SelectionScopeFieldComponent(props: SelectionScopeFieldProps) {\r\n const label = UiFramework.translate(\"selectionScopeField.label\");\r\n const toolTip = UiFramework.translate(\"selectionScopeField.toolTip\");\r\n\r\n const options = React.useMemo(() => props.availableSelectionScopes.map((scope) => {\r\n return { value: scope.id, label: scope.label };\r\n }), [props.availableSelectionScopes]);\r\n\r\n const updateSelectValue = (newValue: string) => {\r\n // istanbul ignore else\r\n if (newValue) {\r\n UiFramework.setActiveSelectionScope(newValue);\r\n }\r\n };\r\n return (\r\n <FooterIndicator // eslint-disable-line deprecation/deprecation\r\n className={classnames(\"uifw-statusFields-selectionScope\", props.className)}\r\n style={props.style}\r\n // eslint-disable-next-line deprecation/deprecation\r\n isInFooterMode={props.isInFooterMode ?? true}\r\n >\r\n {// eslint-disable-next-line deprecation/deprecation\r\n (props.isInFooterMode ?? true) &&\r\n <label className=\"uifw-statusFields-selectionScope-label\">\r\n {label}:\r\n </label>\r\n }\r\n <Select\r\n className=\"uifw-statusFields-selectionScope-selector\"\r\n value={props.activeSelectionScope}\r\n options={options}\r\n onChange={updateSelectValue}\r\n data-testid=\"components-selectionScope-selector\"\r\n title={toolTip}\r\n size=\"small\" />\r\n </FooterIndicator >\r\n );\r\n}\r\n/** Function used by Redux to map state data in Redux store to props that are used to render this component. */\r\nfunction mapStateToProps(state: any) {\r\n const frameworkState = state[UiFramework.frameworkStateKey]; // since app sets up key, don't hard-code name\r\n /* istanbul ignore next */\r\n if (!frameworkState)\r\n return undefined;\r\n\r\n return { activeSelectionScope: frameworkState.sessionState.activeSelectionScope, availableSelectionScopes: frameworkState.sessionState.availableSelectionScopes };\r\n}\r\n\r\n// we declare the variable and export that rather than using export default.\r\n/**\r\n * SelectionScopeField React component. This component is designed to be specified in a status bar definition. It will\r\n * display the active selection scope that is used by the PresentationManager to determine what elements are added to the selection nap mode.\r\n * This React component is Redux connected.\r\n * @public\r\n */ // eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport const SelectionScopeField = connect(mapStateToProps)(SelectionScopeFieldComponent);\r\n"]}
@@ -62,11 +62,6 @@
62
62
  "label": "Scope",
63
63
  "toolTip": "Selection Scope"
64
64
  },
65
- "selectionScopeLabels": {
66
- "element": "Element",
67
- "assembly": "Assembly",
68
- "top-assembly": "Top Assembly"
69
- },
70
65
  "tests": {
71
66
  "singleContent": "Single Content",
72
67
  "label": "Test Label",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/appui-react",
3
- "version": "3.7.2",
3
+ "version": "3.7.4",
4
4
  "description": "UI framework",
5
5
  "main": "lib/cjs/appui-react.js",
6
6
  "module": "lib/esm/appui-react.js",
@@ -20,19 +20,19 @@
20
20
  "url": "http://www.bentley.com"
21
21
  },
22
22
  "peerDependencies": {
23
- "@itwin/appui-abstract": "^3.7.2",
24
- "@itwin/appui-layout-react": "^3.7.2",
25
- "@itwin/components-react": "^3.7.2",
26
- "@itwin/core-bentley": "^3.7.2",
27
- "@itwin/core-common": "^3.7.2",
28
- "@itwin/core-frontend": "^3.7.2",
29
- "@itwin/core-geometry": "^3.7.2",
30
- "@itwin/core-markup": "^3.7.2",
31
- "@itwin/core-quantity": "^3.7.2",
32
- "@itwin/core-react": "^3.7.2",
33
- "@itwin/imodel-components-react": "^3.7.2",
34
- "@itwin/presentation-common": "^3.7.2",
35
- "@itwin/presentation-frontend": "^3.7.2",
23
+ "@itwin/appui-abstract": "^3.7.4",
24
+ "@itwin/appui-layout-react": "^3.7.4",
25
+ "@itwin/components-react": "^3.7.4",
26
+ "@itwin/core-bentley": "^3.7.4",
27
+ "@itwin/core-common": "^3.7.4",
28
+ "@itwin/core-frontend": "^3.7.4",
29
+ "@itwin/core-geometry": "^3.7.4",
30
+ "@itwin/core-markup": "^3.7.4",
31
+ "@itwin/core-quantity": "^3.7.4",
32
+ "@itwin/core-react": "^3.7.4",
33
+ "@itwin/imodel-components-react": "^3.7.4",
34
+ "@itwin/presentation-common": "^3.7.4",
35
+ "@itwin/presentation-frontend": "^3.7.4",
36
36
  "react": "^17.0.0",
37
37
  "react-dom": "^17.0.0",
38
38
  "react-redux": "^7.2.2",
@@ -43,22 +43,22 @@
43
43
  "NOTE: All tools used by scripts in this package must be listed as devDependencies"
44
44
  ],
45
45
  "devDependencies": {
46
- "@itwin/appui-abstract": "3.7.2",
47
- "@itwin/appui-layout-react": "3.7.2",
48
- "@itwin/build-tools": "3.7.2",
49
- "@itwin/components-react": "3.7.2",
50
- "@itwin/core-bentley": "3.7.2",
51
- "@itwin/core-common": "3.7.2",
52
- "@itwin/core-frontend": "3.7.2",
53
- "@itwin/core-geometry": "3.7.2",
54
- "@itwin/core-markup": "3.7.2",
55
- "@itwin/core-quantity": "3.7.2",
56
- "@itwin/core-react": "3.7.2",
57
- "@itwin/eslint-plugin": "3.7.2",
58
- "@itwin/imodel-components-react": "3.7.2",
59
- "@itwin/presentation-common": "3.7.2",
60
- "@itwin/presentation-frontend": "3.7.2",
61
- "@itwin/presentation-testing": "3.7.2",
46
+ "@itwin/appui-abstract": "3.7.4",
47
+ "@itwin/appui-layout-react": "3.7.4",
48
+ "@itwin/build-tools": "3.7.4",
49
+ "@itwin/components-react": "3.7.4",
50
+ "@itwin/core-bentley": "3.7.4",
51
+ "@itwin/core-common": "3.7.4",
52
+ "@itwin/core-frontend": "3.7.4",
53
+ "@itwin/core-geometry": "3.7.4",
54
+ "@itwin/core-markup": "3.7.4",
55
+ "@itwin/core-quantity": "3.7.4",
56
+ "@itwin/core-react": "3.7.4",
57
+ "@itwin/eslint-plugin": "3.7.4",
58
+ "@itwin/imodel-components-react": "3.7.4",
59
+ "@itwin/presentation-common": "3.7.4",
60
+ "@itwin/presentation-frontend": "3.7.4",
61
+ "@itwin/presentation-testing": "3.7.4",
62
62
  "@testing-library/react": "^12.0.0",
63
63
  "@testing-library/react-hooks": "^7.0.2",
64
64
  "@testing-library/user-event": "^14.4.2",
@@ -114,8 +114,8 @@
114
114
  "dependencies": {
115
115
  "@bentley/icons-generic": "^1.0.15",
116
116
  "@bentley/icons-generic-webfont": "^1.0.15",
117
- "@itwin/core-telemetry": "3.7.2",
118
- "@itwin/presentation-components": "3.7.2",
117
+ "@itwin/core-telemetry": "3.7.4",
118
+ "@itwin/presentation-components": "3.7.4",
119
119
  "@itwin/itwinui-css": "0.x",
120
120
  "@itwin/itwinui-react": "~1.46.0",
121
121
  "@itwin/itwinui-icons-react": "^1.15.0",