@gingkoo/pandora-explorer 0.0.1-alpha.37 → 0.0.1-alpha.39
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/lib/es/css.d.ts +7 -7
- package/lib/es/index.js +90 -12
- package/lib/es/index.js.map +1 -1
- package/lib/es/types.d.ts +1 -1
- package/package.json +7 -6
package/lib/es/css.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export declare const flush: () => void, hydrate: (ids: string[]) => void, cx: (...classNames: import("@emotion/css/create-instance").ClassNamesArg[]) => string, merge: (className: string) => string, getRegisteredStyles: (registeredStyles: string[], className: string) => string, injectGlobal: {
|
|
2
|
-
(template: TemplateStringsArray, ...args: import("@emotion/
|
|
3
|
-
(...args: import("@emotion/
|
|
2
|
+
(template: TemplateStringsArray, ...args: import("@emotion/css/create-instance").CSSInterpolation[]): void;
|
|
3
|
+
(...args: import("@emotion/css/create-instance").CSSInterpolation[]): void;
|
|
4
4
|
}, keyframes: {
|
|
5
|
-
(template: TemplateStringsArray, ...args: import("@emotion/
|
|
6
|
-
(...args: import("@emotion/
|
|
5
|
+
(template: TemplateStringsArray, ...args: import("@emotion/css/create-instance").CSSInterpolation[]): string;
|
|
6
|
+
(...args: import("@emotion/css/create-instance").CSSInterpolation[]): string;
|
|
7
7
|
}, css: {
|
|
8
|
-
(template: TemplateStringsArray, ...args: import("@emotion/
|
|
9
|
-
(...args: import("@emotion/
|
|
10
|
-
}, sheet: import("@emotion/css/create-instance").CSSStyleSheet, cache: import("@emotion/
|
|
8
|
+
(template: TemplateStringsArray, ...args: import("@emotion/css/create-instance").CSSInterpolation[]): string;
|
|
9
|
+
(...args: import("@emotion/css/create-instance").CSSInterpolation[]): string;
|
|
10
|
+
}, sheet: import("@emotion/css/create-instance").CSSStyleSheet, cache: import("@emotion/css/create-instance").EmotionCache;
|
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.39
|
|
3
3
|
*/
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import cx$1 from 'classnames';
|
|
@@ -5239,7 +5239,6 @@ function TableItem(props) {
|
|
|
5239
5239
|
onClone
|
|
5240
5240
|
}) => {
|
|
5241
5241
|
if (!props.isOpenMenu) return;
|
|
5242
|
-
if (!props.menu) return;
|
|
5243
5242
|
let menudata = [];
|
|
5244
5243
|
if (getMenu(props.id)) {
|
|
5245
5244
|
menudata = getMenu(props.id);
|
|
@@ -5311,6 +5310,19 @@ function TableItem(props) {
|
|
|
5311
5310
|
autoFocus: true,
|
|
5312
5311
|
defaultValue: param[v?.key],
|
|
5313
5312
|
placeholder: '\u8BF7\u8F93\u5165',
|
|
5313
|
+
onKeyDown: e => {
|
|
5314
|
+
if (e.key === 'Enter' || e.keyCode === 13) {
|
|
5315
|
+
if (props.create_file) {
|
|
5316
|
+
onRename?.(e.target?.value);
|
|
5317
|
+
return;
|
|
5318
|
+
}
|
|
5319
|
+
if (e.target?.value === param[v?.key]) {
|
|
5320
|
+
onRename?.(false);
|
|
5321
|
+
return;
|
|
5322
|
+
}
|
|
5323
|
+
onRename?.(e.target?.value);
|
|
5324
|
+
}
|
|
5325
|
+
},
|
|
5314
5326
|
onFocus: e => {
|
|
5315
5327
|
let i = param[v?.key]?.lastIndexOf('.');
|
|
5316
5328
|
if (props?.suffix == 'folder') {
|
|
@@ -5320,6 +5332,10 @@ function TableItem(props) {
|
|
|
5320
5332
|
}
|
|
5321
5333
|
},
|
|
5322
5334
|
onBlur: e => {
|
|
5335
|
+
if (props.create_file) {
|
|
5336
|
+
onRename?.(e.target.value);
|
|
5337
|
+
return;
|
|
5338
|
+
}
|
|
5323
5339
|
if (e.target.value === param[v?.key]) {
|
|
5324
5340
|
onRename?.(false);
|
|
5325
5341
|
return;
|
|
@@ -5402,6 +5418,11 @@ var TreeItem = (props => {
|
|
|
5402
5418
|
autoFocus: true,
|
|
5403
5419
|
value: title,
|
|
5404
5420
|
placeholder: '\u8BF7\u8F93\u5165',
|
|
5421
|
+
onKeyDown: e => {
|
|
5422
|
+
if (e.key === 'Enter' || e.keyCode === 13) {
|
|
5423
|
+
onRename?.(title);
|
|
5424
|
+
}
|
|
5425
|
+
},
|
|
5405
5426
|
onFocus: e => {
|
|
5406
5427
|
let i = title.lastIndexOf('.');
|
|
5407
5428
|
if (props?.suffix == 'folder') {
|
|
@@ -5961,6 +5982,11 @@ const ExplorerMenu = props => {
|
|
|
5961
5982
|
useEffect(() => {
|
|
5962
5983
|
setEventKey(expandedKeys);
|
|
5963
5984
|
}, [expandedKeys]);
|
|
5985
|
+
useEffect(() => {
|
|
5986
|
+
if (typeof store.curInfo?.key === 'string') {
|
|
5987
|
+
setSelect(store.curInfo?.key);
|
|
5988
|
+
}
|
|
5989
|
+
}, [store.curInfo?.key]);
|
|
5964
5990
|
return jsx("div", {
|
|
5965
5991
|
className: 'frame-left',
|
|
5966
5992
|
onContextMenu: e => {
|
|
@@ -5982,7 +6008,7 @@ const ExplorerMenu = props => {
|
|
|
5982
6008
|
onChange: onChange,
|
|
5983
6009
|
onRename: onRename,
|
|
5984
6010
|
onSelect: v => {
|
|
5985
|
-
setSelect(v.key);
|
|
6011
|
+
// setSelect(v.key);
|
|
5986
6012
|
if (v.key === store.curInfo?.key) return;
|
|
5987
6013
|
store.setPathDisplay(v?.pathDisplay);
|
|
5988
6014
|
loadData(v.key);
|
|
@@ -6220,7 +6246,29 @@ function Tile(props) {
|
|
|
6220
6246
|
e.target.setSelectionRange(0, i);
|
|
6221
6247
|
}
|
|
6222
6248
|
},
|
|
6249
|
+
onKeyDown: e => {
|
|
6250
|
+
if (e.key === 'Enter' || e.keyCode === 13) {
|
|
6251
|
+
if (props.create_file) {
|
|
6252
|
+
onRename?.(v.key, e.target?.value, v);
|
|
6253
|
+
return;
|
|
6254
|
+
}
|
|
6255
|
+
if (e.target?.value === v.title) {
|
|
6256
|
+
setRekey(null);
|
|
6257
|
+
return;
|
|
6258
|
+
}
|
|
6259
|
+
onRename?.(v.key, e.target.value, v);
|
|
6260
|
+
setRekey(null);
|
|
6261
|
+
}
|
|
6262
|
+
},
|
|
6223
6263
|
onBlur: e => {
|
|
6264
|
+
if (props.create_file) {
|
|
6265
|
+
onRename?.(v.key, e.target?.value, v);
|
|
6266
|
+
return;
|
|
6267
|
+
}
|
|
6268
|
+
if (e.target?.value === v.title) {
|
|
6269
|
+
setRekey(null);
|
|
6270
|
+
return;
|
|
6271
|
+
}
|
|
6224
6272
|
onRename?.(v.key, e.target.value, v);
|
|
6225
6273
|
setRekey(null);
|
|
6226
6274
|
},
|
|
@@ -6467,20 +6515,48 @@ const SelectBox = props => {
|
|
|
6467
6515
|
setIsDragFile(false);
|
|
6468
6516
|
e.preventDefault();
|
|
6469
6517
|
e.stopPropagation();
|
|
6470
|
-
const
|
|
6518
|
+
const items = e.dataTransfer.items;
|
|
6519
|
+
let files = [];
|
|
6520
|
+
let empty = [];
|
|
6521
|
+
const traverseFileTree = (item, path = '') => {
|
|
6522
|
+
if (item.isFile) {
|
|
6523
|
+
item.file(file => {
|
|
6524
|
+
files = [...files, file];
|
|
6525
|
+
});
|
|
6526
|
+
} else if (item.isDirectory) {
|
|
6527
|
+
const dirReader = item.createReader();
|
|
6528
|
+
dirReader.readEntries(async entries => {
|
|
6529
|
+
if (!entries.length) {
|
|
6530
|
+
empty.push(path + item.name + '/');
|
|
6531
|
+
} else {
|
|
6532
|
+
for (let i = 0; i < entries.length; i++) {
|
|
6533
|
+
traverseFileTree(entries[i], path + item.name + '/');
|
|
6534
|
+
}
|
|
6535
|
+
}
|
|
6536
|
+
});
|
|
6537
|
+
}
|
|
6538
|
+
};
|
|
6539
|
+
for (let i = 0; i < items.length; i++) {
|
|
6540
|
+
const item = items[i].webkitGetAsEntry();
|
|
6541
|
+
if (item) {
|
|
6542
|
+
traverseFileTree(item, '');
|
|
6543
|
+
}
|
|
6544
|
+
}
|
|
6471
6545
|
let data = isSelectTarget(e, 'folder', 'remove');
|
|
6472
6546
|
let key = null;
|
|
6473
6547
|
if (ref.current.contains(e.target)) {
|
|
6474
6548
|
key = store.curInfo;
|
|
6475
6549
|
ref.current.style.cssText = `
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
}
|
|
6479
|
-
if (typeof data?.[0] == 'string' && store?.dataMap?.[data?.[0]]) {
|
|
6480
|
-
key = store?.dataMap?.[data?.[0]];
|
|
6550
|
+
border:2px solid transparent;
|
|
6551
|
+
`;
|
|
6481
6552
|
}
|
|
6482
|
-
|
|
6483
|
-
|
|
6553
|
+
setTimeout(() => {
|
|
6554
|
+
if (typeof data?.[0] == 'string' && store?.dataMap?.[data?.[0]]) {
|
|
6555
|
+
key = store?.dataMap?.[data?.[0]];
|
|
6556
|
+
}
|
|
6557
|
+
if (!key) return;
|
|
6558
|
+
typeof onUpload === 'function' && onUpload(files, key, empty);
|
|
6559
|
+
}, 500);
|
|
6484
6560
|
};
|
|
6485
6561
|
function handleDragEnter(e) {
|
|
6486
6562
|
e.preventDefault();
|
|
@@ -7688,9 +7764,11 @@ const Explorer = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
7688
7764
|
if (!curInfo) return;
|
|
7689
7765
|
let input = document.createElement('input');
|
|
7690
7766
|
input.type = 'file';
|
|
7767
|
+
input.multiple = true;
|
|
7691
7768
|
input?.click();
|
|
7692
7769
|
input.onchange = async e => {
|
|
7693
|
-
|
|
7770
|
+
const files = Array.from(e.target.files);
|
|
7771
|
+
await props?.onUpload?.(files, curInfo);
|
|
7694
7772
|
loadData?.(curInfo?.key);
|
|
7695
7773
|
};
|
|
7696
7774
|
}
|