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