@gingkoo/pandora-explorer 0.0.1-alpha.76 → 0.0.1-alpha.77
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/index.js +35 -19
- package/lib/es/index.js.map +1 -1
- package/package.json +1 -1
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.77
|
|
3
3
|
*/
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import cx$1 from 'classnames';
|
|
@@ -7143,7 +7143,7 @@ const SelectBox = props => {
|
|
|
7143
7143
|
});
|
|
7144
7144
|
};
|
|
7145
7145
|
|
|
7146
|
-
var css_248z$2 = ".explorer-columns {\n width: 100%;\n height: 100%;\n display: flex;\n position: relative;\n overflow: auto;\n}\n.explorer-columns .layer {\n position: relative;\n flex: 1 0 0;\n border-right: 1px solid #f5f5f5;\n}\n.explorer-columns .layer.select_col {\n box-shadow: 0 0 20px #e9f5ff inset;\n}\n.explorer-columns .layer.select_col::after {\n content: '';\n position: absolute;\n height: 4px;\n bottom: 0px;\n background: #50afff;\n left: 0;\n right: 0;\n}\n.explorer-columns .layer.list {\n min-width: 200px;\n}\n.explorer-columns .layer.list::before {\n position: absolute;\n content: '';\n top: 50%;\n right: 1px;\n width: 1px;\n height: 18px;\n margin-left: -1px;\n margin-top: -9px;\n border: 1px solid #ddd;\n border-top: none;\n border-bottom: none;\n backdrop-filter: none;\n border-radius: 0;\n background: transparent;\n box-sizing: content-box;\n -webkit-backdrop-filter: blur(10px);\n}\n.explorer-columns .layer.list .list-main {\n width: 100%;\n height: 100%;\n transition: 0.3s;\n padding-top: 5px;\n}\n.explorer-columns .layer.list .list-main .list-scroll::-webkit-scrollbar {\n width: 6px;\n}\n.explorer-columns .layer.list .list-main .list-scroll::-webkit-scrollbar-thumb {\n background-color: transparent;\n border-radius: 6px;\n transition: 0.3s;\n}\n.explorer-columns .layer.list .list-main:hover .list-scroll::-webkit-scrollbar-thumb {\n background-color: #00000030;\n}\n.explorer-columns .layer.list .drag {\n position: absolute;\n width: 8px;\n border-right: 1px solid #f5f5f5;\n right: -3px;\n top: 0;\n bottom: 0;\n cursor: col-resize;\n z-index: 10;\n}\n.explorer-columns .layer.list .drag:hover {\n background: #40a9ff4d;\n}\n.explorer-columns .layer.empty {\n display: flex;\n justify-content: center;\n padding-top: 100px;\n}\n.explorer-columns .layer.empty .empty-is-null {\n width: 200px;\n}\n.explorer-columns .layer.empty .empty-icon {\n height: 140px;\n}\n.explorer-columns .layer.empty .empty-desc {\n display: flex;\n justify-content: center;\n}\n.explorer-columns .layer.empty .empty-desc > span {\n display: inline-block;\n padding: 3px 10px;\n border-radius: 10px;\n line-height: 1;\n background: #a0a0a01a;\n color: #bbb;\n font-size: 0.9em;\n}\n.explorer-columns-list {\n padding-left: 10px;\n display: flex;\n height: 30px;\n margin-bottom: 2px;\n margin: 0 5px 3px 5px;\n align-items: center;\n border: 1px solid transparent;\n user-select: none;\n overflow: hidden;\n}\n.explorer-columns-list .columns-list-icon {\n display: flex;\n width: 18px;\n height: 18px;\n margin-right: 10px;\n flex-shrink: 0;\n}\n.explorer-columns-list .columns-list-title {\n width: 100%;\n display: inline-block;\n width: calc(100% - 30px);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.explorer-columns-list .columns-list-
|
|
7146
|
+
var css_248z$2 = ".explorer-columns {\n width: 100%;\n height: 100%;\n display: flex;\n position: relative;\n overflow: auto;\n}\n.explorer-columns .layer {\n position: relative;\n min-width: 200px;\n flex: 1 0 0;\n border-right: 1px solid #f5f5f5;\n}\n.explorer-columns .layer.select_col {\n box-shadow: 0 0 20px #e9f5ff inset;\n}\n.explorer-columns .layer.select_col::after {\n content: '';\n position: absolute;\n height: 4px;\n bottom: 0px;\n background: #50afff;\n left: 0;\n right: 0;\n}\n.explorer-columns .layer.list {\n min-width: 200px;\n}\n.explorer-columns .layer.list::before {\n position: absolute;\n content: '';\n top: 50%;\n right: 1px;\n width: 1px;\n height: 18px;\n margin-left: -1px;\n margin-top: -9px;\n border: 1px solid #ddd;\n border-top: none;\n border-bottom: none;\n backdrop-filter: none;\n border-radius: 0;\n background: transparent;\n box-sizing: content-box;\n -webkit-backdrop-filter: blur(10px);\n}\n.explorer-columns .layer.list .list-main {\n width: 100%;\n height: 100%;\n transition: 0.3s;\n padding-top: 5px;\n}\n.explorer-columns .layer.list .list-main .list-scroll::-webkit-scrollbar {\n width: 6px;\n}\n.explorer-columns .layer.list .list-main .list-scroll::-webkit-scrollbar-thumb {\n background-color: transparent;\n border-radius: 6px;\n transition: 0.3s;\n}\n.explorer-columns .layer.list .list-main:hover .list-scroll::-webkit-scrollbar-thumb {\n background-color: #00000030;\n}\n.explorer-columns .layer.list .drag {\n position: absolute;\n width: 8px;\n border-right: 1px solid #f5f5f5;\n right: -3px;\n top: 0;\n bottom: 0;\n cursor: col-resize;\n z-index: 10;\n}\n.explorer-columns .layer.list .drag:hover {\n background: #40a9ff4d;\n}\n.explorer-columns .layer.empty {\n display: flex;\n justify-content: center;\n padding-top: 100px;\n}\n.explorer-columns .layer.empty .empty-is-null {\n width: 200px;\n}\n.explorer-columns .layer.empty .empty-icon {\n height: 140px;\n}\n.explorer-columns .layer.empty .empty-desc {\n display: flex;\n justify-content: center;\n}\n.explorer-columns .layer.empty .empty-desc > span {\n display: inline-block;\n padding: 3px 10px;\n border-radius: 10px;\n line-height: 1;\n background: #a0a0a01a;\n color: #bbb;\n font-size: 0.9em;\n}\n.explorer-columns-list {\n padding-left: 10px;\n display: flex;\n height: 30px;\n margin-bottom: 2px;\n margin: 0 5px 3px 5px;\n align-items: center;\n border: 1px solid transparent;\n user-select: none;\n overflow: hidden;\n}\n.explorer-columns-list .columns-list-icon {\n display: flex;\n width: 18px;\n height: 18px;\n margin-right: 10px;\n flex-shrink: 0;\n}\n.explorer-columns-list .columns-list-title {\n width: 100%;\n display: inline-block;\n width: calc(100% - 30px);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.explorer-columns-list .columns-list-input {\n flex: 1;\n height: 100%;\n outline: 0;\n border: 0;\n margin-right: 10px;\n background: #fff;\n}\n.explorer-columns-list.acitve {\n background: #e3f0ff;\n}\n.explorer-columns-list.last {\n margin-bottom: 100px;\n}\n.explorer-columns-list.checks {\n background: #cce8ff;\n border-color: #a8d8ff !important;\n}\n.explorer-columns-list.isedit {\n background: #cce8ff;\n border-color: #a8d8ff !important;\n}\n.explorer-columns-list.disable {\n opacity: 0.4;\n}\n.explorer-columns-list:hover {\n background: #e3f0ff;\n border-color: #c9e2ff;\n}\n.explorer-columns-list:hover .edit {\n opacity: 1;\n}\n.explorer-columns-loading {\n position: absolute;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 999;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n}\n.explorer-columns-loading .loading-content {\n width: 100px;\n height: 106px;\n border-radius: 6px;\n background: rgba(255, 255, 255, 0.7);\n box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.07);\n color: #888;\n}\n.explorer-columns-loading .loading-content-icon {\n display: flex;\n justify-content: center;\n margin: 25px auto 6px auto;\n font-size: 30px;\n}\n.explorer-columns-loading .loading-content-icon > i {\n animation: rotate 1.5s linear infinite;\n}\n.explorer-columns-loading .loading-content-title {\n padding-top: 15px;\n text-align: center;\n}\n.explorer-columns.notdata .explorer-notdata {\n width: 100%;\n}\n@keyframes rotate {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n";
|
|
7147
7147
|
styleInject(css_248z$2);
|
|
7148
7148
|
|
|
7149
7149
|
function Item(props) {
|
|
@@ -7154,7 +7154,8 @@ function Item(props) {
|
|
|
7154
7154
|
isedit,
|
|
7155
7155
|
checks = false,
|
|
7156
7156
|
icon,
|
|
7157
|
-
parent
|
|
7157
|
+
parent,
|
|
7158
|
+
onDblclick
|
|
7158
7159
|
} = props;
|
|
7159
7160
|
const [value, setValue] = useState('');
|
|
7160
7161
|
useEffect(() => {
|
|
@@ -7211,6 +7212,9 @@ function Item(props) {
|
|
|
7211
7212
|
key: props.id
|
|
7212
7213
|
});
|
|
7213
7214
|
},
|
|
7215
|
+
onDoubleClick: e => {
|
|
7216
|
+
onDblclick?.();
|
|
7217
|
+
},
|
|
7214
7218
|
children: [icon && icon?.(props, 'columns-list-icon'), isedit ? jsx("input", {
|
|
7215
7219
|
className: 'columns-list-input',
|
|
7216
7220
|
autoFocus: true,
|
|
@@ -7283,16 +7287,20 @@ function Columns(props) {
|
|
|
7283
7287
|
checks = [],
|
|
7284
7288
|
icons,
|
|
7285
7289
|
onLoadData,
|
|
7286
|
-
onChange
|
|
7290
|
+
onChange,
|
|
7291
|
+
onDblclick
|
|
7287
7292
|
} = props;
|
|
7288
7293
|
const ref = useRef(null);
|
|
7289
|
-
const
|
|
7290
|
-
|
|
7294
|
+
const scroll = useRef({
|
|
7295
|
+
x: 0,
|
|
7296
|
+
y: 0
|
|
7297
|
+
});
|
|
7298
|
+
const [layer, setLayer] = useState(new Array(5).fill([])); //文件列表数据
|
|
7299
|
+
const [width, setWidth] = useState(new Array(5).fill(null)); //记录每行的宽度
|
|
7291
7300
|
const [select_col, setSelectCol] = useState(0); //选中栏
|
|
7292
|
-
const [select_info, setSelectInfo] = useState(''); //当前选中 key
|
|
7293
7301
|
const [isdrag, setIsdarg] = useState(false);
|
|
7294
7302
|
useEffect(() => {
|
|
7295
|
-
let arr = new Array(
|
|
7303
|
+
let arr = new Array(5).fill('');
|
|
7296
7304
|
//清空
|
|
7297
7305
|
store.setExpandkey(arr);
|
|
7298
7306
|
}, [store.curInfo.key]);
|
|
@@ -7305,10 +7313,11 @@ function Columns(props) {
|
|
|
7305
7313
|
}, [select_col, store?.expandkey]);
|
|
7306
7314
|
let avg = useMemo(() => {
|
|
7307
7315
|
if (!_w) return 0;
|
|
7308
|
-
|
|
7316
|
+
let num = Math.ceil(_w / 5);
|
|
7317
|
+
return num < 200 ? 200 : num;
|
|
7309
7318
|
}, [_w]);
|
|
7310
7319
|
async function initdata() {
|
|
7311
|
-
let arr = new Array(
|
|
7320
|
+
let arr = new Array(5).fill([]);
|
|
7312
7321
|
let {
|
|
7313
7322
|
layer,
|
|
7314
7323
|
isApi,
|
|
@@ -7324,7 +7333,7 @@ function Columns(props) {
|
|
|
7324
7333
|
// 1. 返回 没层用到的数据
|
|
7325
7334
|
// 2. 返回 是否调用接口
|
|
7326
7335
|
// 3. 如果掉调用借口 需要记录 数据给到 children 上
|
|
7327
|
-
let arr = new Array(
|
|
7336
|
+
let arr = new Array(5).fill([]);
|
|
7328
7337
|
let api = false;
|
|
7329
7338
|
let child = [];
|
|
7330
7339
|
if (Array.isArray(data)) {
|
|
@@ -7388,9 +7397,15 @@ function Columns(props) {
|
|
|
7388
7397
|
}
|
|
7389
7398
|
return x + 0;
|
|
7390
7399
|
}, 0);
|
|
7391
|
-
arr[select_col] = e.nativeEvent.clientX - dom.left - data;
|
|
7400
|
+
arr[select_col] = scroll.current.y + e.nativeEvent.clientX - dom.left - data;
|
|
7392
7401
|
setWidth(arr);
|
|
7393
7402
|
}
|
|
7403
|
+
function handleScroll(e) {
|
|
7404
|
+
scroll.current = {
|
|
7405
|
+
x: e.target.scrollTop,
|
|
7406
|
+
y: e.target.scrollLeft
|
|
7407
|
+
};
|
|
7408
|
+
}
|
|
7394
7409
|
function setlevel(data, level) {
|
|
7395
7410
|
let arr = cloneDeep(store.expandkey);
|
|
7396
7411
|
arr.fill('', level + 1);
|
|
@@ -7453,8 +7468,8 @@ function Columns(props) {
|
|
|
7453
7468
|
return jsx("div", {
|
|
7454
7469
|
className: cx$1('layer', {}),
|
|
7455
7470
|
style: {
|
|
7456
|
-
|
|
7457
|
-
|
|
7471
|
+
minWidth: avg + 'px',
|
|
7472
|
+
flex: `0 0 ${avg}px`
|
|
7458
7473
|
}
|
|
7459
7474
|
});
|
|
7460
7475
|
}
|
|
@@ -7504,7 +7519,6 @@ function Columns(props) {
|
|
|
7504
7519
|
store.closeMenu();
|
|
7505
7520
|
store.setCurSelect(v.key);
|
|
7506
7521
|
setSelectCol(level);
|
|
7507
|
-
setSelectInfo(v.key);
|
|
7508
7522
|
if (v.type == 'folder') {
|
|
7509
7523
|
let select = setlevel(v.key, level);
|
|
7510
7524
|
let loaddata = null;
|
|
@@ -7517,6 +7531,9 @@ function Columns(props) {
|
|
|
7517
7531
|
store.setExpandkey(select);
|
|
7518
7532
|
}
|
|
7519
7533
|
},
|
|
7534
|
+
onDblclick: () => {
|
|
7535
|
+
onDblclick?.(v.key, v);
|
|
7536
|
+
},
|
|
7520
7537
|
parent: parent
|
|
7521
7538
|
});
|
|
7522
7539
|
}
|
|
@@ -7537,6 +7554,7 @@ function Columns(props) {
|
|
|
7537
7554
|
[className || '']: className
|
|
7538
7555
|
}),
|
|
7539
7556
|
onMouseMove: handleMousemove,
|
|
7557
|
+
onScroll: handleScroll,
|
|
7540
7558
|
onMouseUp: () => {
|
|
7541
7559
|
setIsdarg(false);
|
|
7542
7560
|
},
|
|
@@ -7697,7 +7715,7 @@ const Layout$1 = props => {
|
|
|
7697
7715
|
onClick: onClick,
|
|
7698
7716
|
onRename: onRename,
|
|
7699
7717
|
onMenuClick: onMenuClick,
|
|
7700
|
-
onDblclick:
|
|
7718
|
+
onDblclick: _onDblclick,
|
|
7701
7719
|
height: height,
|
|
7702
7720
|
width: width,
|
|
7703
7721
|
onChange: v => {
|
|
@@ -8062,9 +8080,7 @@ Object.defineProperty(Array.prototype, 'myforeach', {
|
|
|
8062
8080
|
if (index in arr) {
|
|
8063
8081
|
try {
|
|
8064
8082
|
await fn.call(context, arr[index], index, arr);
|
|
8065
|
-
} catch (e) {
|
|
8066
|
-
console.log(e);
|
|
8067
|
-
}
|
|
8083
|
+
} catch (e) {}
|
|
8068
8084
|
}
|
|
8069
8085
|
index++;
|
|
8070
8086
|
}
|