@gingkoo/pandora-explorer 0.0.1-alpha.110 → 0.0.1-alpha.111
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 +27 -11
- 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.111
|
|
3
3
|
*/
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import cx$1 from 'classnames';
|
|
@@ -8355,6 +8355,25 @@ const Columns = /*#__PURE__*/forwardRef((props, _ref) => {
|
|
|
8355
8355
|
arr.splice(level, 1, data);
|
|
8356
8356
|
return arr;
|
|
8357
8357
|
}
|
|
8358
|
+
function setData(key, _data) {
|
|
8359
|
+
const fixdata = (data, level) => {
|
|
8360
|
+
let arr = data;
|
|
8361
|
+
let i = 0;
|
|
8362
|
+
while (i < arr?.length) {
|
|
8363
|
+
let item = arr[i];
|
|
8364
|
+
if (item.key == key) {
|
|
8365
|
+
item['children'] = _data;
|
|
8366
|
+
}
|
|
8367
|
+
if (Array.isArray(item.children) && item.children.length > 0) {
|
|
8368
|
+
fixdata(item.children);
|
|
8369
|
+
}
|
|
8370
|
+
i++;
|
|
8371
|
+
}
|
|
8372
|
+
return arr;
|
|
8373
|
+
};
|
|
8374
|
+
let arr = fixdata(data);
|
|
8375
|
+
onChange(arr);
|
|
8376
|
+
}
|
|
8358
8377
|
if (!data.length) {
|
|
8359
8378
|
return jsx("div", {
|
|
8360
8379
|
className: 'explorer-columns notdata',
|
|
@@ -8557,16 +8576,13 @@ const Columns = /*#__PURE__*/forwardRef((props, _ref) => {
|
|
|
8557
8576
|
setSelectCol(level);
|
|
8558
8577
|
if (v.type == 'folder') {
|
|
8559
8578
|
let select = setlevel(v.key, level);
|
|
8560
|
-
|
|
8561
|
-
|
|
8562
|
-
|
|
8563
|
-
|
|
8564
|
-
|
|
8565
|
-
|
|
8566
|
-
|
|
8567
|
-
// ? [...v?.children]
|
|
8568
|
-
// : loaddata;
|
|
8569
|
-
// setData(v.key, arr);
|
|
8579
|
+
let loaddata = null;
|
|
8580
|
+
let data = await onLoadData?.(v.key);
|
|
8581
|
+
if (Array.isArray(data) && data.length) {
|
|
8582
|
+
loaddata = data;
|
|
8583
|
+
}
|
|
8584
|
+
let arr = Array.isArray(v?.children) && v?.children.length ? [...v?.children] : loaddata;
|
|
8585
|
+
setData(v.key, arr);
|
|
8570
8586
|
store.setExpandkey(select);
|
|
8571
8587
|
}
|
|
8572
8588
|
},
|