seeder-resources-view 1.3.3 → 1.3.5

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/dist/index.js CHANGED
@@ -17881,7 +17881,7 @@ const useDirectoryTree = _ref => {
17881
17881
  createFolder,
17882
17882
  removeFolderFile,
17883
17883
  renameFolderFile,
17884
- mediaType = 'VIDEO',
17884
+ mediaType,
17885
17885
  isEditable = true,
17886
17886
  batchOperations = true,
17887
17887
  withRootNode = true,
@@ -17897,7 +17897,11 @@ const useDirectoryTree = _ref => {
17897
17897
  // Tree 组件样式
17898
17898
  wrapperStyle = {
17899
17899
  paddingTop: 16
17900
- } // 包装器样式
17900
+ },
17901
+ // 包装器样式
17902
+ expandable = true,
17903
+ // 新增:是否允许展开/折叠
17904
+ onSelectDir
17901
17905
  } = _ref;
17902
17906
  const [treeState, setTreeState] = react.useState({
17903
17907
  data: [],
@@ -18057,6 +18061,11 @@ const useDirectoryTree = _ref => {
18057
18061
  currentPath: info.node.path,
18058
18062
  loading: true
18059
18063
  });
18064
+
18065
+ // 触发 onSelectDir 回调(如果存在)
18066
+ if (onSelectDir) {
18067
+ onSelectDir(info.node.rawData);
18068
+ }
18060
18069
  try {
18061
18070
  // 模拟延迟加载
18062
18071
  // eslint-disable-next-line no-promise-executor-return
@@ -18120,7 +18129,8 @@ const useDirectoryTree = _ref => {
18120
18129
  selectedKeys: treeState.selectedKeys,
18121
18130
  expandedKeys: treeState.expandedKeys,
18122
18131
  onSelect: onSelect,
18123
- onExpand: onExpand,
18132
+ onExpand: expandable ? onExpand : undefined // 不允许展开时不绑定事件
18133
+ ,
18124
18134
  treeData: treeState.data,
18125
18135
  titleRender: nodeData => /*#__PURE__*/jsxRuntime.jsx(TreeTitle$1, {
18126
18136
  title: nodeData.title,