@gingkoo/pandora-explorer 0.0.1-alpha.57 → 0.0.1-alpha.59
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.
|
@@ -4,7 +4,7 @@ interface TileProps {
|
|
|
4
4
|
onMenuClick?: (key: string, param: any) => void;
|
|
5
5
|
onDblclick?: (key: string, param: any) => void;
|
|
6
6
|
onSelect?: (key: string, param: any) => void;
|
|
7
|
-
onRename?: (key: string, value: string, param: any) => void;
|
|
7
|
+
onRename?: (key: string, value: string | boolean, param: any) => void;
|
|
8
8
|
[key: string]: any;
|
|
9
9
|
}
|
|
10
10
|
export default function Tile(props: TileProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/es/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @gingkoo/pandora-explorer v0.0.1-alpha.
|
|
2
|
+
* @gingkoo/pandora-explorer v0.0.1-alpha.59
|
|
3
3
|
*/
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import cx$1 from 'classnames';
|
|
@@ -4663,11 +4663,13 @@ registerMenu('folder', [{
|
|
|
4663
4663
|
}, {
|
|
4664
4664
|
key: 'copy',
|
|
4665
4665
|
icon: 'copy',
|
|
4666
|
-
title: '复制'
|
|
4666
|
+
title: '复制',
|
|
4667
|
+
desc: 'ctrl + c'
|
|
4667
4668
|
}, {
|
|
4668
4669
|
key: 'shear',
|
|
4669
4670
|
icon: 'shear',
|
|
4670
|
-
title: '剪切'
|
|
4671
|
+
title: '剪切',
|
|
4672
|
+
desc: 'ctrl + x'
|
|
4671
4673
|
}, {
|
|
4672
4674
|
key: 'rename',
|
|
4673
4675
|
icon: 'rename',
|
|
@@ -4693,7 +4695,8 @@ registerMenu('cur-folder', [{
|
|
|
4693
4695
|
}, {
|
|
4694
4696
|
key: 'copy',
|
|
4695
4697
|
icon: 'copy',
|
|
4696
|
-
title: '复制'
|
|
4698
|
+
title: '复制',
|
|
4699
|
+
desc: 'ctrl + c'
|
|
4697
4700
|
}, {
|
|
4698
4701
|
key: 'file-upload',
|
|
4699
4702
|
icon: 'upload',
|
|
@@ -5387,6 +5390,7 @@ var TreeItem = (props => {
|
|
|
5387
5390
|
setTitle(props.title);
|
|
5388
5391
|
}, [props.title]);
|
|
5389
5392
|
let menudata = [];
|
|
5393
|
+
if (props?.menu == false) return;
|
|
5390
5394
|
if (getMenu(props.id)) {
|
|
5391
5395
|
menudata = getMenu(props.id);
|
|
5392
5396
|
} else if (props.type && getMenu(props.type)) {
|
|
@@ -6283,16 +6287,15 @@ function Tile(props) {
|
|
|
6283
6287
|
onRename?.(v.key, e.target?.value, v);
|
|
6284
6288
|
return;
|
|
6285
6289
|
}
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
|
|
6289
|
-
|
|
6290
|
-
|
|
6291
|
-
setRekey(null);
|
|
6290
|
+
onRename?.(v.key, e.target?.value, v);
|
|
6291
|
+
}
|
|
6292
|
+
if (e.key === 'Escape') {
|
|
6293
|
+
onRename?.(v.key, false, v);
|
|
6294
|
+
return;
|
|
6292
6295
|
}
|
|
6293
6296
|
},
|
|
6294
6297
|
onBlur: e => {
|
|
6295
|
-
if (
|
|
6298
|
+
if (v.create_file) {
|
|
6296
6299
|
onRename?.(v.key, e.target?.value, v);
|
|
6297
6300
|
return;
|
|
6298
6301
|
}
|
|
@@ -6589,6 +6592,7 @@ const SelectBox = props => {
|
|
|
6589
6592
|
if (!key) return;
|
|
6590
6593
|
typeof props.onUpload === 'function' && props?.onUpload(files, key, empty);
|
|
6591
6594
|
store.curInfo && loadData(store.curInfo?.key);
|
|
6595
|
+
store.curInfo?.key && store.reloadNode(store.curInfo.key);
|
|
6592
6596
|
}, 500);
|
|
6593
6597
|
};
|
|
6594
6598
|
function handleDragEnter(e) {
|
|
@@ -7531,7 +7535,7 @@ function ExplorerInfo(props) {
|
|
|
7531
7535
|
children: [jsx("span", {
|
|
7532
7536
|
children: typeof info?.size == 'number' ? convertBytesToSize(info?.size) : info?.size || '-'
|
|
7533
7537
|
}), jsx("span", {
|
|
7534
|
-
children: info?.fixTime || '
|
|
7538
|
+
children: info?.fixTime || ''
|
|
7535
7539
|
})]
|
|
7536
7540
|
})]
|
|
7537
7541
|
})]
|
|
@@ -7675,22 +7679,18 @@ const Explorer = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
7675
7679
|
//清空日志
|
|
7676
7680
|
setLog([]);
|
|
7677
7681
|
},
|
|
7678
|
-
|
|
7682
|
+
updateNav: key => {
|
|
7679
7683
|
if (key) {
|
|
7680
|
-
|
|
7684
|
+
reloadNode(key);
|
|
7681
7685
|
} else {
|
|
7682
|
-
|
|
7683
|
-
reloadNode(curInfo.key);
|
|
7684
|
-
}
|
|
7686
|
+
curInfo?.key && reloadNode(curInfo.key);
|
|
7685
7687
|
}
|
|
7686
7688
|
},
|
|
7687
7689
|
updateData: key => {
|
|
7688
7690
|
if (key) {
|
|
7689
|
-
|
|
7691
|
+
loadData(key);
|
|
7690
7692
|
} else {
|
|
7691
|
-
|
|
7692
|
-
reloadNode(curInfo.key);
|
|
7693
|
-
}
|
|
7693
|
+
curInfo?.key && loadData(curInfo.key);
|
|
7694
7694
|
}
|
|
7695
7695
|
}
|
|
7696
7696
|
}));
|
|
@@ -7735,6 +7735,7 @@ const Explorer = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
7735
7735
|
}
|
|
7736
7736
|
if ((e.ctrlKey || e.metaKey) && e.key === 'v') {
|
|
7737
7737
|
curInfo && onPaste?.(curInfo);
|
|
7738
|
+
curInfo && reloadNode(curInfo.key);
|
|
7738
7739
|
}
|
|
7739
7740
|
};
|
|
7740
7741
|
const closeMenu = () => {
|
|
@@ -7907,9 +7908,13 @@ const Explorer = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
7907
7908
|
}
|
|
7908
7909
|
} else {
|
|
7909
7910
|
let data = await _onRename?.(key, value, info);
|
|
7910
|
-
if (
|
|
7911
|
+
if (info.type == 'folder' || type == 'menu') {
|
|
7911
7912
|
if (data?.key) {
|
|
7912
|
-
|
|
7913
|
+
if (key === curInfo?.key) {
|
|
7914
|
+
loadData(data.key);
|
|
7915
|
+
} else {
|
|
7916
|
+
curInfo?.key && loadData(curInfo?.key);
|
|
7917
|
+
}
|
|
7913
7918
|
updata(key, {
|
|
7914
7919
|
key: data.key,
|
|
7915
7920
|
title: value
|