@kne/file-system-view 1.0.0 → 1.0.1

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.
@@ -21,7 +21,7 @@ const withLocale = createWithIntlProvider({
21
21
  namespace: 'file-system-view'
22
22
  });
23
23
 
24
- var style = {"file-system-view":"_qMhn9","tree-node":"_t015K","action-btn":"_mLgqh","node-icon":"_dgomj","node-title":"_r6Ngq","node-name":"_st428","node-ext":"_POSao","empty":"_4zeDm"};
24
+ var style = {"file-system-view":"_qMhn9","tree-node":"_t015K","action-btn":"_mLgqh","selected":"_vI5hy","node-icon":"_dgomj","node-title":"_r6Ngq","node-name":"_st428","node-ext":"_POSao","empty":"_4zeDm"};
25
25
 
26
26
  const IconContext = /*#__PURE__*/createContext({});
27
27
  var Context = IconContext;
@@ -1736,6 +1736,7 @@ const TreeNode = ({
1736
1736
  node,
1737
1737
  menuItems,
1738
1738
  expandedKeys,
1739
+ selectedPath,
1739
1740
  onToggle,
1740
1741
  onFileClick,
1741
1742
  rootRef
@@ -1748,6 +1749,7 @@ const TreeNode = ({
1748
1749
  data
1749
1750
  } = node;
1750
1751
  const isExpanded = expandedKeys.includes(key);
1752
+ const isSelected = selectedPath === key;
1751
1753
  const {
1752
1754
  icon: IconComponent,
1753
1755
  color
@@ -1780,7 +1782,7 @@ const TreeNode = ({
1780
1782
  }
1781
1783
  }, [isDirectory, onToggle, onFileClick, key, isExpanded, data]);
1782
1784
  return /*#__PURE__*/jsxs("div", {
1783
- className: style['tree-node'],
1785
+ className: `${style['tree-node']}${isSelected ? ` ${style['selected']}` : ''}`,
1784
1786
  onClick: handleNodeClick,
1785
1787
  children: [/*#__PURE__*/jsx("span", {
1786
1788
  className: style['node-icon'],
@@ -1823,6 +1825,7 @@ const FileSystemView = withLocale(({
1823
1825
  menuItems,
1824
1826
  defaultExpandAll,
1825
1827
  expandedKeys: controlledExpandedKeys,
1828
+ selectedPath,
1826
1829
  onExpand,
1827
1830
  onFileClick
1828
1831
  }) => {
@@ -1880,9 +1883,10 @@ const FileSystemView = withLocale(({
1880
1883
  node: node,
1881
1884
  menuItems: menuItems,
1882
1885
  expandedKeys: expandedKeys,
1886
+ selectedPath: selectedPath,
1883
1887
  onToggle: handleToggle,
1884
1888
  onFileClick: onFileClick
1885
- }), [menuItems, expandedKeys, handleToggle, onFileClick]);
1889
+ }), [menuItems, expandedKeys, selectedPath, handleToggle, onFileClick]);
1886
1890
  if (!data || data.length === 0) {
1887
1891
  return /*#__PURE__*/jsx("div", {
1888
1892
  className: style['empty'],