react-asc 18.8.1 → 18.8.2

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.
@@ -1,12 +1,13 @@
1
1
  /// <reference types="react" />
2
- export interface ITreeNodeProps {
2
+ export interface ITreeItemProps {
3
3
  nodeId: string;
4
4
  label: string;
5
5
  children?: any;
6
6
  className?: string;
7
7
  isExpanded?: boolean;
8
8
  isSelected?: boolean;
9
+ isSelectable?: boolean;
9
10
  onToggleExpand?: (id: string) => void;
10
11
  onSelect?: (id: string, isSelected: boolean) => void;
11
12
  }
12
- export declare const TreeItem: (props: ITreeNodeProps) => JSX.Element;
13
+ export declare const TreeItem: (props: ITreeItemProps) => JSX.Element;
package/index.es.js CHANGED
@@ -2492,12 +2492,12 @@ const TreeView = (props) => {
2492
2492
  return (React.createElement("ul", { className: getCssClasses() }, children));
2493
2493
  };
2494
2494
 
2495
- var css_248z = ".TreeItem-module_treeItem__2FtLe {\n display: flex;\n flex-direction: column;\n}";
2495
+ var css_248z = ".TreeItem-module_treeItem__2FtLe {\n display: flex;\n flex-direction: column;\n min-height: 48px;\n justify-content: center;\n}";
2496
2496
  var styles = {"treeItem":"TreeItem-module_treeItem__2FtLe"};
2497
2497
  styleInject(css_248z);
2498
2498
 
2499
2499
  const TreeItem = (props) => {
2500
- const { nodeId, label, children, className, isExpanded, isSelected, onToggleExpand, onSelect } = props;
2500
+ const { nodeId, label, children, className, isExpanded, isSelected, isSelectable, onToggleExpand, onSelect } = props;
2501
2501
  const [_isExpanded, setIsExpanded] = useState(false);
2502
2502
  const [_isSelected, setIsSelected] = useState(false);
2503
2503
  const getCssClasses = () => {
@@ -2526,7 +2526,8 @@ const TreeItem = (props) => {
2526
2526
  React.createElement("div", { className: "d-flex align-items-center" },
2527
2527
  children &&
2528
2528
  React.createElement(IconButton, { onClick: () => handleOnToggleExpand(nodeId), icon: !_isExpanded ? React.createElement(ChevronRightSolidIcon, null) : React.createElement(ChevronDownSolidIcon, null) }),
2529
- React.createElement(Checkbox, { checked: _isSelected, onChange: () => handleOnSelect(nodeId) }),
2529
+ isSelectable &&
2530
+ React.createElement(Checkbox, { checked: _isSelected, onChange: () => handleOnSelect(nodeId) }),
2530
2531
  label),
2531
2532
  children && _isExpanded ? React.createElement("ul", null, children) : null));
2532
2533
  };