seeder-resources-view 1.2.0 → 1.3.0

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
@@ -17666,7 +17666,8 @@ const TreeTitleNode = _ref2 => {
17666
17666
  nodeData,
17667
17667
  handleSave,
17668
17668
  handleDel,
17669
- handleAdd
17669
+ handleAdd,
17670
+ isEditable = true
17670
17671
  } = _ref2;
17671
17672
  const [editing, setEditing] = react.useState(false);
17672
17673
  const inputRef = react.useRef(null);
@@ -17761,7 +17762,13 @@ const TreeTitleNode = _ref2 => {
17761
17762
  }, [editing, nodeData.title, save, title, renderIconNode]);
17762
17763
  return /*#__PURE__*/jsxRuntime.jsx("div", {
17763
17764
  className: "tree-title",
17764
- children: renderChildNode()
17765
+ children: isEditable ? renderChildNode() : /*#__PURE__*/jsxRuntime.jsx(antd.Typography.Text, {
17766
+ ellipsis: true,
17767
+ style: {
17768
+ width: "100%%"
17769
+ },
17770
+ children: title
17771
+ })
17765
17772
  });
17766
17773
  };
17767
17774
  var TreeTitle$1 = /*#__PURE__*/react.memo(TreeTitle);
@@ -17872,6 +17879,8 @@ const useDirectoryTree = _ref => {
17872
17879
  createFolder,
17873
17880
  removeFolderFile,
17874
17881
  renameFolderFile,
17882
+ mediaType,
17883
+ isEditable = true,
17875
17884
  batchOperations = true,
17876
17885
  withRootNode = true,
17877
17886
  height = 828,
@@ -17926,9 +17935,14 @@ const useDirectoryTree = _ref => {
17926
17935
  const fetchFolderData = react.useCallback(async function () {
17927
17936
  let initialization = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
17928
17937
  try {
17929
- const data = await getFolderData({
17938
+ // 构建请求参数
17939
+ const requestParams = {
17930
17940
  folder: ""
17931
- });
17941
+ };
17942
+ if (mediaType) {
17943
+ requestParams.media_type = mediaType;
17944
+ }
17945
+ const data = await getFolderData(requestParams);
17932
17946
  if (!(data !== null && data !== void 0 && data.directoryTree)) {
17933
17947
  return null;
17934
17948
  }
@@ -17955,7 +17969,7 @@ const useDirectoryTree = _ref => {
17955
17969
  } catch (error) {
17956
17970
  handleError(error, 'GET FOLDER DATA');
17957
17971
  }
17958
- }, [withRootNode]);
17972
+ }, [mediaType, withRootNode]);
17959
17973
 
17960
17974
  // 初始化数据
17961
17975
  react.useEffect(() => {
@@ -18102,6 +18116,7 @@ const useDirectoryTree = _ref => {
18102
18116
  titleRender: nodeData => /*#__PURE__*/jsxRuntime.jsx(TreeTitle$1, {
18103
18117
  title: nodeData.title,
18104
18118
  nodeData: nodeData,
18119
+ isEditable: isEditable,
18105
18120
  handleSave: handleRename,
18106
18121
  handleDel: handleRemove,
18107
18122
  handleAdd: handleCreate