@itwin/tree-widget-react 3.17.7 → 3.17.8

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,12 +1,20 @@
1
1
  # Change Log - @itwin/tree-widget-react
2
2
 
3
- <!-- This log was last generated on Tue, 24 Feb 2026 07:53:57 GMT and should not be manually modified. -->
3
+ <!-- This log was last generated on Fri, 06 Mar 2026 19:28:08 GMT and should not be manually modified. -->
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 3.17.8
8
+
9
+ Fri, 06 Mar 2026 19:28:08 GMT
10
+
11
+ ### Patches
12
+
13
+ - Hide visibility checkbox tooltip and hover effect on touch devices. ([#1615](https://github.com/iTwin/viewer-components-react/pull/1615))
14
+
7
15
  ## 3.17.7
8
16
 
9
- Tue, 24 Feb 2026 07:53:57 GMT
17
+ Tue, 24 Feb 2026 07:54:06 GMT
10
18
 
11
19
  ### Patches
12
20
 
@@ -1,3 +1,4 @@
1
+ import "./TreeNodeCheckbox.scss";
1
2
  import { Checkbox } from "@itwin/itwinui-react";
2
3
  import type { ComponentPropsWithoutRef } from "react";
3
4
  import type { PresentationHierarchyNode, RenderedTreeNode } from "@itwin/presentation-hierarchies-react";
@@ -1,4 +1,7 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.TreeNodeCheckbox = TreeNodeCheckbox;
4
7
  const jsx_runtime_1 = require("react/jsx-runtime");
@@ -6,6 +9,8 @@ const jsx_runtime_1 = require("react/jsx-runtime");
6
9
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
7
10
  * See LICENSE.md in the project root for license terms and full copyright notice.
8
11
  *--------------------------------------------------------------------------------------------*/
12
+ require("./TreeNodeCheckbox.scss");
13
+ const classnames_1 = __importDefault(require("classnames"));
9
14
  const itwinui_react_1 = require("@itwin/itwinui-react");
10
15
  const presentation_hierarchies_react_1 = require("@itwin/presentation-hierarchies-react");
11
16
  /** @internal */
@@ -35,9 +40,9 @@ function TreeNodeCheckbox({ node, onCheckboxClicked, getCheckboxState, ...props
35
40
  checkboxProps.indeterminate = checkboxState.state === "partial";
36
41
  checkboxProps.disabled = checkboxState.isDisabled;
37
42
  }
38
- return ((0, jsx_runtime_1.jsx)(TooltipWrapper, { content: checkboxState.tooltip, children: (0, jsx_runtime_1.jsx)(itwinui_react_1.Checkbox, { ...checkboxProps }) }));
43
+ return ((0, jsx_runtime_1.jsx)(TooltipWrapper, { content: checkboxState.tooltip, children: (0, jsx_runtime_1.jsx)(itwinui_react_1.Checkbox, { ...checkboxProps, className: (0, classnames_1.default)("tw-tree-node-checkbox", checkboxProps.className) }) }));
39
44
  }
40
45
  function TooltipWrapper({ content, children }) {
41
- return !!content ? ((0, jsx_runtime_1.jsx)(itwinui_react_1.Tooltip, { content: content, placement: "left", children: children })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children }));
46
+ return !!content ? ((0, jsx_runtime_1.jsx)(itwinui_react_1.Tooltip, { content: content, placement: "left", className: "tw-tree-node-checkbox-tooltip", children: children })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children }));
42
47
  }
43
48
  //# sourceMappingURL=TreeNodeCheckbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TreeNodeCheckbox.js","sourceRoot":"","sources":["../../../../../../../src/tree-widget-react/components/trees/common/components/TreeNodeCheckbox.tsx"],"names":[],"mappings":";;AAwCA,4CA+BC;;AAvED;;;gGAGgG;AAEhG,wDAAyD;AACzD,0FAAoF;AAiCpF,gBAAgB;AAChB,SAAgB,gBAAgB,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,GAAG,KAAK,EAAsD;IAC1I,IAAI,MAAM,IAAI,IAAI,IAAI,CAAC,IAAA,4DAA2B,EAAC,IAAI,CAAC,EAAE,CAAC;QACzD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,aAAa,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC7C,MAAM,aAAa,GAA8C;QAC/D,GAAG,KAAK;QACR,YAAY,EAAE,aAAa,CAAC,OAAO;QACnC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACb,CAAC,CAAC,eAAe,EAAE,CAAC;QACtB,CAAC;QACD,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;YACd,iBAAiB,CAAC,IAAI,EAAE,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACnD,CAAC;KACF,CAAC;IACF,IAAI,WAAW,IAAI,aAAa,EAAE,CAAC;QACjC,aAAa,CAAC,KAAK,GAAG;YACpB,GAAG,aAAa,CAAC,KAAK;YACtB,UAAU,EAAE,QAAQ;SACrB,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,aAAa,CAAC,OAAO,GAAG,aAAa,CAAC,KAAK,KAAK,IAAI,CAAC;QACrD,aAAa,CAAC,aAAa,GAAG,aAAa,CAAC,KAAK,KAAK,SAAS,CAAC;QAChE,aAAa,CAAC,QAAQ,GAAG,aAAa,CAAC,UAAU,CAAC;IACpD,CAAC;IACD,OAAO,CACL,uBAAC,cAAc,IAAC,OAAO,EAAE,aAAa,CAAC,OAAO,YAC5C,uBAAC,wBAAQ,OAAK,aAAa,GAAI,GAChB,CAClB,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAoD;IAC7F,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CACjB,uBAAC,uBAAO,IAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAC,MAAM,YACxC,QAAQ,GACD,CACX,CAAC,CAAC,CAAC,CACF,2DAAG,QAAQ,GAAI,CAChB,CAAC;AACJ,CAAC","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\nimport { Checkbox, Tooltip } from \"@itwin/itwinui-react\";\nimport { isPresentationHierarchyNode } from \"@itwin/presentation-hierarchies-react\";\n\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { PresentationHierarchyNode, RenderedTreeNode } from \"@itwin/presentation-hierarchies-react\";\n\n/**\n * Data structure that describes tree node checkbox state.\n * @beta\n */\ntype TreeNodeCheckboxState = (\n | {\n state: \"on\" | \"off\" | \"partial\";\n isDisabled?: boolean;\n }\n | {\n isLoading: true;\n }\n) & {\n tooltip?: string;\n};\n\n/** @beta */\nexport interface TreeCheckboxProps {\n /** Callback that should be invoked when checkbox is clicked. */\n onCheckboxClicked: (node: PresentationHierarchyNode, checked: boolean) => void;\n /** Callback that should be used to determine current checkbox state. */\n getCheckboxState: (node: PresentationHierarchyNode) => TreeNodeCheckboxState;\n}\n\n/** @internal */\ntype TreeNodeCheckboxProps = TreeCheckboxProps &\n Omit<ComponentPropsWithoutRef<typeof Checkbox>, \"onClick\" | \"checked\" | \"onChange\" | \"indeterminate\" | \"disabled\" | \"title\">;\n\n/** @internal */\nexport function TreeNodeCheckbox({ node, onCheckboxClicked, getCheckboxState, ...props }: TreeNodeCheckboxProps & { node: RenderedTreeNode }) {\n if (\"type\" in node || !isPresentationHierarchyNode(node)) {\n return null;\n }\n\n const checkboxState = getCheckboxState(node);\n const checkboxProps: ComponentPropsWithoutRef<typeof Checkbox> = {\n ...props,\n \"aria-label\": checkboxState.tooltip,\n onClick: (e) => {\n e.stopPropagation();\n },\n onChange: (e) => {\n onCheckboxClicked(node, e.currentTarget.checked);\n },\n };\n if (\"isLoading\" in checkboxState) {\n checkboxProps.style = {\n ...checkboxProps.style,\n visibility: \"hidden\",\n };\n } else {\n checkboxProps.checked = checkboxState.state === \"on\";\n checkboxProps.indeterminate = checkboxState.state === \"partial\";\n checkboxProps.disabled = checkboxState.isDisabled;\n }\n return (\n <TooltipWrapper content={checkboxState.tooltip}>\n <Checkbox {...checkboxProps} />\n </TooltipWrapper>\n );\n}\n\nfunction TooltipWrapper({ content, children }: { content?: string; children?: React.ReactNode }) {\n return !!content ? (\n <Tooltip content={content} placement=\"left\">\n {children}\n </Tooltip>\n ) : (\n <>{children}</>\n );\n}\n"]}
1
+ {"version":3,"file":"TreeNodeCheckbox.js","sourceRoot":"","sources":["../../../../../../../src/tree-widget-react/components/trees/common/components/TreeNodeCheckbox.tsx"],"names":[],"mappings":";;;;;AA2CA,4CA+BC;;AA1ED;;;gGAGgG;AAEhG,mCAAiC;AAEjC,4DAA4B;AAC5B,wDAAyD;AACzD,0FAAoF;AAiCpF,gBAAgB;AAChB,SAAgB,gBAAgB,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,GAAG,KAAK,EAAsD;IAC1I,IAAI,MAAM,IAAI,IAAI,IAAI,CAAC,IAAA,4DAA2B,EAAC,IAAI,CAAC,EAAE,CAAC;QACzD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,aAAa,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC7C,MAAM,aAAa,GAA8C;QAC/D,GAAG,KAAK;QACR,YAAY,EAAE,aAAa,CAAC,OAAO;QACnC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACb,CAAC,CAAC,eAAe,EAAE,CAAC;QACtB,CAAC;QACD,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;YACd,iBAAiB,CAAC,IAAI,EAAE,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACnD,CAAC;KACF,CAAC;IACF,IAAI,WAAW,IAAI,aAAa,EAAE,CAAC;QACjC,aAAa,CAAC,KAAK,GAAG;YACpB,GAAG,aAAa,CAAC,KAAK;YACtB,UAAU,EAAE,QAAQ;SACrB,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,aAAa,CAAC,OAAO,GAAG,aAAa,CAAC,KAAK,KAAK,IAAI,CAAC;QACrD,aAAa,CAAC,aAAa,GAAG,aAAa,CAAC,KAAK,KAAK,SAAS,CAAC;QAChE,aAAa,CAAC,QAAQ,GAAG,aAAa,CAAC,UAAU,CAAC;IACpD,CAAC;IACD,OAAO,CACL,uBAAC,cAAc,IAAC,OAAO,EAAE,aAAa,CAAC,OAAO,YAC5C,uBAAC,wBAAQ,OAAK,aAAa,EAAE,SAAS,EAAE,IAAA,oBAAE,EAAC,uBAAuB,EAAE,aAAa,CAAC,SAAS,CAAC,GAAI,GACjF,CAClB,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAoD;IAC7F,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CACjB,uBAAC,uBAAO,IAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAC,MAAM,EAAC,SAAS,EAAC,+BAA+B,YAClF,QAAQ,GACD,CACX,CAAC,CAAC,CAAC,CACF,2DAAG,QAAQ,GAAI,CAChB,CAAC;AACJ,CAAC","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\nimport \"./TreeNodeCheckbox.scss\";\n\nimport cx from \"classnames\";\nimport { Checkbox, Tooltip } from \"@itwin/itwinui-react\";\nimport { isPresentationHierarchyNode } from \"@itwin/presentation-hierarchies-react\";\n\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { PresentationHierarchyNode, RenderedTreeNode } from \"@itwin/presentation-hierarchies-react\";\n\n/**\n * Data structure that describes tree node checkbox state.\n * @beta\n */\ntype TreeNodeCheckboxState = (\n | {\n state: \"on\" | \"off\" | \"partial\";\n isDisabled?: boolean;\n }\n | {\n isLoading: true;\n }\n) & {\n tooltip?: string;\n};\n\n/** @beta */\nexport interface TreeCheckboxProps {\n /** Callback that should be invoked when checkbox is clicked. */\n onCheckboxClicked: (node: PresentationHierarchyNode, checked: boolean) => void;\n /** Callback that should be used to determine current checkbox state. */\n getCheckboxState: (node: PresentationHierarchyNode) => TreeNodeCheckboxState;\n}\n\n/** @internal */\ntype TreeNodeCheckboxProps = TreeCheckboxProps &\n Omit<ComponentPropsWithoutRef<typeof Checkbox>, \"onClick\" | \"checked\" | \"onChange\" | \"indeterminate\" | \"disabled\" | \"title\">;\n\n/** @internal */\nexport function TreeNodeCheckbox({ node, onCheckboxClicked, getCheckboxState, ...props }: TreeNodeCheckboxProps & { node: RenderedTreeNode }) {\n if (\"type\" in node || !isPresentationHierarchyNode(node)) {\n return null;\n }\n\n const checkboxState = getCheckboxState(node);\n const checkboxProps: ComponentPropsWithoutRef<typeof Checkbox> = {\n ...props,\n \"aria-label\": checkboxState.tooltip,\n onClick: (e) => {\n e.stopPropagation();\n },\n onChange: (e) => {\n onCheckboxClicked(node, e.currentTarget.checked);\n },\n };\n if (\"isLoading\" in checkboxState) {\n checkboxProps.style = {\n ...checkboxProps.style,\n visibility: \"hidden\",\n };\n } else {\n checkboxProps.checked = checkboxState.state === \"on\";\n checkboxProps.indeterminate = checkboxState.state === \"partial\";\n checkboxProps.disabled = checkboxState.isDisabled;\n }\n return (\n <TooltipWrapper content={checkboxState.tooltip}>\n <Checkbox {...checkboxProps} className={cx(\"tw-tree-node-checkbox\", checkboxProps.className)} />\n </TooltipWrapper>\n );\n}\n\nfunction TooltipWrapper({ content, children }: { content?: string; children?: React.ReactNode }) {\n return !!content ? (\n <Tooltip content={content} placement=\"left\" className=\"tw-tree-node-checkbox-tooltip\">\n {children}\n </Tooltip>\n ) : (\n <>{children}</>\n );\n}\n"]}
@@ -0,0 +1,14 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+
6
+ @media (hover: none) {
7
+ .tw-tree-node-checkbox:hover {
8
+ background-color: transparent;
9
+ }
10
+
11
+ .tw-tree-node-checkbox-tooltip {
12
+ display: none;
13
+ }
14
+ }
@@ -1,3 +1,4 @@
1
+ import "./TreeNodeCheckbox.scss";
1
2
  import { Checkbox } from "@itwin/itwinui-react";
2
3
  import type { ComponentPropsWithoutRef } from "react";
3
4
  import type { PresentationHierarchyNode, RenderedTreeNode } from "@itwin/presentation-hierarchies-react";
@@ -3,6 +3,8 @@ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
4
  * See LICENSE.md in the project root for license terms and full copyright notice.
5
5
  *--------------------------------------------------------------------------------------------*/
6
+ import "./TreeNodeCheckbox.scss";
7
+ import cx from "classnames";
6
8
  import { Checkbox, Tooltip } from "@itwin/itwinui-react";
7
9
  import { isPresentationHierarchyNode } from "@itwin/presentation-hierarchies-react";
8
10
  /** @internal */
@@ -32,9 +34,9 @@ export function TreeNodeCheckbox({ node, onCheckboxClicked, getCheckboxState, ..
32
34
  checkboxProps.indeterminate = checkboxState.state === "partial";
33
35
  checkboxProps.disabled = checkboxState.isDisabled;
34
36
  }
35
- return (_jsx(TooltipWrapper, { content: checkboxState.tooltip, children: _jsx(Checkbox, { ...checkboxProps }) }));
37
+ return (_jsx(TooltipWrapper, { content: checkboxState.tooltip, children: _jsx(Checkbox, { ...checkboxProps, className: cx("tw-tree-node-checkbox", checkboxProps.className) }) }));
36
38
  }
37
39
  function TooltipWrapper({ content, children }) {
38
- return !!content ? (_jsx(Tooltip, { content: content, placement: "left", children: children })) : (_jsx(_Fragment, { children: children }));
40
+ return !!content ? (_jsx(Tooltip, { content: content, placement: "left", className: "tw-tree-node-checkbox-tooltip", children: children })) : (_jsx(_Fragment, { children: children }));
39
41
  }
40
42
  //# sourceMappingURL=TreeNodeCheckbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TreeNodeCheckbox.js","sourceRoot":"","sources":["../../../../../../../src/tree-widget-react/components/trees/common/components/TreeNodeCheckbox.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AAiCpF,gBAAgB;AAChB,MAAM,UAAU,gBAAgB,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,GAAG,KAAK,EAAsD;IAC1I,IAAI,MAAM,IAAI,IAAI,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,EAAE,CAAC;QACzD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,aAAa,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC7C,MAAM,aAAa,GAA8C;QAC/D,GAAG,KAAK;QACR,YAAY,EAAE,aAAa,CAAC,OAAO;QACnC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACb,CAAC,CAAC,eAAe,EAAE,CAAC;QACtB,CAAC;QACD,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;YACd,iBAAiB,CAAC,IAAI,EAAE,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACnD,CAAC;KACF,CAAC;IACF,IAAI,WAAW,IAAI,aAAa,EAAE,CAAC;QACjC,aAAa,CAAC,KAAK,GAAG;YACpB,GAAG,aAAa,CAAC,KAAK;YACtB,UAAU,EAAE,QAAQ;SACrB,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,aAAa,CAAC,OAAO,GAAG,aAAa,CAAC,KAAK,KAAK,IAAI,CAAC;QACrD,aAAa,CAAC,aAAa,GAAG,aAAa,CAAC,KAAK,KAAK,SAAS,CAAC;QAChE,aAAa,CAAC,QAAQ,GAAG,aAAa,CAAC,UAAU,CAAC;IACpD,CAAC;IACD,OAAO,CACL,KAAC,cAAc,IAAC,OAAO,EAAE,aAAa,CAAC,OAAO,YAC5C,KAAC,QAAQ,OAAK,aAAa,GAAI,GAChB,CAClB,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAoD;IAC7F,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CACjB,KAAC,OAAO,IAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAC,MAAM,YACxC,QAAQ,GACD,CACX,CAAC,CAAC,CAAC,CACF,4BAAG,QAAQ,GAAI,CAChB,CAAC;AACJ,CAAC","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\nimport { Checkbox, Tooltip } from \"@itwin/itwinui-react\";\nimport { isPresentationHierarchyNode } from \"@itwin/presentation-hierarchies-react\";\n\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { PresentationHierarchyNode, RenderedTreeNode } from \"@itwin/presentation-hierarchies-react\";\n\n/**\n * Data structure that describes tree node checkbox state.\n * @beta\n */\ntype TreeNodeCheckboxState = (\n | {\n state: \"on\" | \"off\" | \"partial\";\n isDisabled?: boolean;\n }\n | {\n isLoading: true;\n }\n) & {\n tooltip?: string;\n};\n\n/** @beta */\nexport interface TreeCheckboxProps {\n /** Callback that should be invoked when checkbox is clicked. */\n onCheckboxClicked: (node: PresentationHierarchyNode, checked: boolean) => void;\n /** Callback that should be used to determine current checkbox state. */\n getCheckboxState: (node: PresentationHierarchyNode) => TreeNodeCheckboxState;\n}\n\n/** @internal */\ntype TreeNodeCheckboxProps = TreeCheckboxProps &\n Omit<ComponentPropsWithoutRef<typeof Checkbox>, \"onClick\" | \"checked\" | \"onChange\" | \"indeterminate\" | \"disabled\" | \"title\">;\n\n/** @internal */\nexport function TreeNodeCheckbox({ node, onCheckboxClicked, getCheckboxState, ...props }: TreeNodeCheckboxProps & { node: RenderedTreeNode }) {\n if (\"type\" in node || !isPresentationHierarchyNode(node)) {\n return null;\n }\n\n const checkboxState = getCheckboxState(node);\n const checkboxProps: ComponentPropsWithoutRef<typeof Checkbox> = {\n ...props,\n \"aria-label\": checkboxState.tooltip,\n onClick: (e) => {\n e.stopPropagation();\n },\n onChange: (e) => {\n onCheckboxClicked(node, e.currentTarget.checked);\n },\n };\n if (\"isLoading\" in checkboxState) {\n checkboxProps.style = {\n ...checkboxProps.style,\n visibility: \"hidden\",\n };\n } else {\n checkboxProps.checked = checkboxState.state === \"on\";\n checkboxProps.indeterminate = checkboxState.state === \"partial\";\n checkboxProps.disabled = checkboxState.isDisabled;\n }\n return (\n <TooltipWrapper content={checkboxState.tooltip}>\n <Checkbox {...checkboxProps} />\n </TooltipWrapper>\n );\n}\n\nfunction TooltipWrapper({ content, children }: { content?: string; children?: React.ReactNode }) {\n return !!content ? (\n <Tooltip content={content} placement=\"left\">\n {children}\n </Tooltip>\n ) : (\n <>{children}</>\n );\n}\n"]}
1
+ {"version":3,"file":"TreeNodeCheckbox.js","sourceRoot":"","sources":["../../../../../../../src/tree-widget-react/components/trees/common/components/TreeNodeCheckbox.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAEhG,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AAiCpF,gBAAgB;AAChB,MAAM,UAAU,gBAAgB,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,GAAG,KAAK,EAAsD;IAC1I,IAAI,MAAM,IAAI,IAAI,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,EAAE,CAAC;QACzD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,aAAa,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC7C,MAAM,aAAa,GAA8C;QAC/D,GAAG,KAAK;QACR,YAAY,EAAE,aAAa,CAAC,OAAO;QACnC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACb,CAAC,CAAC,eAAe,EAAE,CAAC;QACtB,CAAC;QACD,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;YACd,iBAAiB,CAAC,IAAI,EAAE,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACnD,CAAC;KACF,CAAC;IACF,IAAI,WAAW,IAAI,aAAa,EAAE,CAAC;QACjC,aAAa,CAAC,KAAK,GAAG;YACpB,GAAG,aAAa,CAAC,KAAK;YACtB,UAAU,EAAE,QAAQ;SACrB,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,aAAa,CAAC,OAAO,GAAG,aAAa,CAAC,KAAK,KAAK,IAAI,CAAC;QACrD,aAAa,CAAC,aAAa,GAAG,aAAa,CAAC,KAAK,KAAK,SAAS,CAAC;QAChE,aAAa,CAAC,QAAQ,GAAG,aAAa,CAAC,UAAU,CAAC;IACpD,CAAC;IACD,OAAO,CACL,KAAC,cAAc,IAAC,OAAO,EAAE,aAAa,CAAC,OAAO,YAC5C,KAAC,QAAQ,OAAK,aAAa,EAAE,SAAS,EAAE,EAAE,CAAC,uBAAuB,EAAE,aAAa,CAAC,SAAS,CAAC,GAAI,GACjF,CAClB,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAoD;IAC7F,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CACjB,KAAC,OAAO,IAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAC,MAAM,EAAC,SAAS,EAAC,+BAA+B,YAClF,QAAQ,GACD,CACX,CAAC,CAAC,CAAC,CACF,4BAAG,QAAQ,GAAI,CAChB,CAAC;AACJ,CAAC","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\nimport \"./TreeNodeCheckbox.scss\";\n\nimport cx from \"classnames\";\nimport { Checkbox, Tooltip } from \"@itwin/itwinui-react\";\nimport { isPresentationHierarchyNode } from \"@itwin/presentation-hierarchies-react\";\n\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { PresentationHierarchyNode, RenderedTreeNode } from \"@itwin/presentation-hierarchies-react\";\n\n/**\n * Data structure that describes tree node checkbox state.\n * @beta\n */\ntype TreeNodeCheckboxState = (\n | {\n state: \"on\" | \"off\" | \"partial\";\n isDisabled?: boolean;\n }\n | {\n isLoading: true;\n }\n) & {\n tooltip?: string;\n};\n\n/** @beta */\nexport interface TreeCheckboxProps {\n /** Callback that should be invoked when checkbox is clicked. */\n onCheckboxClicked: (node: PresentationHierarchyNode, checked: boolean) => void;\n /** Callback that should be used to determine current checkbox state. */\n getCheckboxState: (node: PresentationHierarchyNode) => TreeNodeCheckboxState;\n}\n\n/** @internal */\ntype TreeNodeCheckboxProps = TreeCheckboxProps &\n Omit<ComponentPropsWithoutRef<typeof Checkbox>, \"onClick\" | \"checked\" | \"onChange\" | \"indeterminate\" | \"disabled\" | \"title\">;\n\n/** @internal */\nexport function TreeNodeCheckbox({ node, onCheckboxClicked, getCheckboxState, ...props }: TreeNodeCheckboxProps & { node: RenderedTreeNode }) {\n if (\"type\" in node || !isPresentationHierarchyNode(node)) {\n return null;\n }\n\n const checkboxState = getCheckboxState(node);\n const checkboxProps: ComponentPropsWithoutRef<typeof Checkbox> = {\n ...props,\n \"aria-label\": checkboxState.tooltip,\n onClick: (e) => {\n e.stopPropagation();\n },\n onChange: (e) => {\n onCheckboxClicked(node, e.currentTarget.checked);\n },\n };\n if (\"isLoading\" in checkboxState) {\n checkboxProps.style = {\n ...checkboxProps.style,\n visibility: \"hidden\",\n };\n } else {\n checkboxProps.checked = checkboxState.state === \"on\";\n checkboxProps.indeterminate = checkboxState.state === \"partial\";\n checkboxProps.disabled = checkboxState.isDisabled;\n }\n return (\n <TooltipWrapper content={checkboxState.tooltip}>\n <Checkbox {...checkboxProps} className={cx(\"tw-tree-node-checkbox\", checkboxProps.className)} />\n </TooltipWrapper>\n );\n}\n\nfunction TooltipWrapper({ content, children }: { content?: string; children?: React.ReactNode }) {\n return !!content ? (\n <Tooltip content={content} placement=\"left\" className=\"tw-tree-node-checkbox-tooltip\">\n {children}\n </Tooltip>\n ) : (\n <>{children}</>\n );\n}\n"]}
@@ -0,0 +1,14 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+
6
+ @media (hover: none) {
7
+ .tw-tree-node-checkbox:hover {
8
+ background-color: transparent;
9
+ }
10
+
11
+ .tw-tree-node-checkbox-tooltip {
12
+ display: none;
13
+ }
14
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/tree-widget-react",
3
- "version": "3.17.7",
3
+ "version": "3.17.8",
4
4
  "description": "Tree Widget React",
5
5
  "keywords": [
6
6
  "Bentley",