@gingkoo/pandora-explorer 0.0.1-alpha.25 → 0.0.1-alpha.26
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 +15 -5
- package/lib/es/index.js.map +1 -1
- package/lib/es/types.d.ts +1 -0
- 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.26
|
|
3
3
|
*/
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import cx$1 from 'classnames';
|
|
@@ -5074,9 +5074,17 @@ function Menu(props) {
|
|
|
5074
5074
|
onChange
|
|
5075
5075
|
} = props;
|
|
5076
5076
|
if (!menu) return jsx(Fragment, {});
|
|
5077
|
+
const store = useContext(ExampleContext);
|
|
5077
5078
|
let data = useMemo(() => {
|
|
5078
|
-
|
|
5079
|
-
|
|
5079
|
+
let arr = menu.map(v => {
|
|
5080
|
+
let data = v;
|
|
5081
|
+
if (store?.loadMenu) {
|
|
5082
|
+
data = store.loadMenu(v);
|
|
5083
|
+
}
|
|
5084
|
+
return data;
|
|
5085
|
+
});
|
|
5086
|
+
return arr;
|
|
5087
|
+
}, [menu, props]);
|
|
5080
5088
|
const menus = useMemo(() => {
|
|
5081
5089
|
return data.map((v, index) => {
|
|
5082
5090
|
if (v?.type == 'line') {
|
|
@@ -6166,12 +6174,13 @@ const SelectBox = props => {
|
|
|
6166
6174
|
document?.addEventListener('dragenter', handleDragEnter);
|
|
6167
6175
|
document?.addEventListener('drop', handleDrop);
|
|
6168
6176
|
return () => {
|
|
6177
|
+
document.querySelector(getContainer)?.removeEventListener('dragenter', bodyDragEnter);
|
|
6169
6178
|
document.removeEventListener('dragenter', bodyDragEnter);
|
|
6170
6179
|
document.removeEventListener('dragover', handleDragOver);
|
|
6171
6180
|
document.removeEventListener('dragleave', handleDragLeave);
|
|
6172
6181
|
document?.addEventListener('drop', handleDrop);
|
|
6173
6182
|
};
|
|
6174
|
-
}, []);
|
|
6183
|
+
}, [store.curInfo, store.dataMap]);
|
|
6175
6184
|
useEffect(() => {
|
|
6176
6185
|
document.addEventListener('mousemove', handleBodyMousemove);
|
|
6177
6186
|
document.addEventListener('mouseup', handleBodyMouseup);
|
|
@@ -6611,7 +6620,7 @@ const SelectBox = props => {
|
|
|
6611
6620
|
e.stopPropagation();
|
|
6612
6621
|
},
|
|
6613
6622
|
onMouseDown: e => {
|
|
6614
|
-
if (e.button === 2) return;
|
|
6623
|
+
// if (e.button === 2) return;
|
|
6615
6624
|
if (isDclick.current) {
|
|
6616
6625
|
clearTimeout(isDclick.current);
|
|
6617
6626
|
isDclick.current = null;
|
|
@@ -7434,6 +7443,7 @@ const Explorer = props => {
|
|
|
7434
7443
|
loadkey,
|
|
7435
7444
|
//icon
|
|
7436
7445
|
getIcons: Icons,
|
|
7446
|
+
loadMenu: props.loadMenu,
|
|
7437
7447
|
//set
|
|
7438
7448
|
setLog,
|
|
7439
7449
|
setCurInfo,
|