@gingkoo/pandora-explorer 0.1.10 → 0.1.11-alpha.1

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.
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  export declare const IconsMap: Map<string, import("react/jsx-runtime").JSX.Element>;
4
3
  export declare function FavoriteSvg(): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare function getMenu(key: string): import("react").ComponentType<{}>;
3
2
  export declare function registerMenu(key: string, component: any): void;
4
3
  export declare function addMenuItem(key: string | string[], menu: any[]): void;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Key, FlattenNode } from '../interface';
3
2
  export declare function findExpandedKeys(prev?: Key[], next?: Key[]): {
4
3
  add: boolean;
package/lib/es/css.d.ts CHANGED
@@ -1,10 +1,10 @@
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/css/create-instance").CSSInterpolation[]): void;
3
- (...args: import("@emotion/css/create-instance").CSSInterpolation[]): void;
1
+ export declare const flush: () => void, hydrate: (ids: Array<string>) => void, cx: (...classNames: Array<import("@emotion/css/create-instance").ClassNamesArg>) => string, merge: (className: string) => string, getRegisteredStyles: (registeredStyles: Array<string>, className: string) => string, injectGlobal: {
2
+ (template: TemplateStringsArray, ...args: Array<import("@emotion/css/create-instance").CSSInterpolation>): void;
3
+ (...args: Array<import("@emotion/css/create-instance").CSSInterpolation>): void;
4
4
  }, keyframes: {
5
- (template: TemplateStringsArray, ...args: import("@emotion/css/create-instance").CSSInterpolation[]): string;
6
- (...args: import("@emotion/css/create-instance").CSSInterpolation[]): string;
5
+ (template: TemplateStringsArray, ...args: Array<import("@emotion/css/create-instance").CSSInterpolation>): string;
6
+ (...args: Array<import("@emotion/css/create-instance").CSSInterpolation>): string;
7
7
  }, css: {
8
- (template: TemplateStringsArray, ...args: import("@emotion/css/create-instance").CSSInterpolation[]): string;
9
- (...args: import("@emotion/css/create-instance").CSSInterpolation[]): string;
8
+ (template: TemplateStringsArray, ...args: Array<import("@emotion/css/create-instance").CSSInterpolation>): string;
9
+ (...args: Array<import("@emotion/css/create-instance").CSSInterpolation>): string;
10
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.1.10
2
+ * @gingkoo/pandora-explorer v0.1.11-alpha.1
3
3
  */
4
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
5
  import cx$1 from 'classnames';
@@ -933,7 +933,7 @@ function UploadSvg() {
933
933
  });
934
934
  }
935
935
 
936
- var css_248z$d = ".explorer-container .frame-explorer-main {\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n.explorer-container .frame-explorer-main .frame-left {\n position: relative;\n border-right: 1px solid rgba(100, 100, 100, 0.1);\n height: 100%;\n}\n.explorer-container .frame-explorer-main .frame-left::after {\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 z-index: 2;\n}\n.explorer-container .frame-explorer-main .frame-right {\n border-right: 1px solid #f5f5f5;\n height: 100%;\n}\n.explorer-container .frame-explorer-main .frame-right .frame-header {\n width: 100%;\n height: 85px;\n min-width: 400px;\n position: relative;\n background: #fff;\n}\n.explorer-container .frame-explorer-main .frame-right .frame-main {\n position: relative;\n height: 100%;\n}\n.explorer-container .app-wrapper {\n height: 100%;\n}\n.explorer-label-icon {\n display: inline-block;\n position: relative;\n box-sizing: border-box !important;\n}\n.explorer-label-icon > div {\n position: relative;\n width: 100%;\n height: 100%;\n border-radius: 50% !important;\n}\n.explorer-label-icon > div::after {\n width: 40%;\n height: 40%;\n border-radius: 50%;\n content: ' ';\n background: linear-gradient(45deg, #ffffff7d, #ffffff00);\n margin-top: 4px;\n position: absolute;\n right: 15%;\n top: 15%;\n}\n";
936
+ var css_248z$d = ".explorer-container .frame-explorer-main {\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n.explorer-container .frame-explorer-main .frame-left {\n position: relative;\n border-right: 1px solid rgba(100, 100, 100, 0.1);\n height: 100%;\n}\n.explorer-container .frame-explorer-main .frame-left::after {\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 z-index: 2;\n}\n.explorer-container .frame-explorer-main .frame-right {\n border-right: 1px solid #f5f5f5;\n height: 100%;\n}\n.explorer-container .frame-explorer-main .frame-right .frame-header {\n width: 100%;\n height: 85px;\n min-width: 400px;\n position: relative;\n background: #fff;\n}\n.explorer-container .frame-explorer-main .frame-right .frame-main {\n position: relative;\n height: 100%;\n}\n.explorer-container .app-wrapper {\n height: 100%;\n}\n.explorer-container .rc-tree-list-holder-inner::-webkit-scrollbar {\n display: none;\n width: 0;\n height: 0;\n}\n.explorer-label-icon {\n display: inline-block;\n position: relative;\n box-sizing: border-box !important;\n}\n.explorer-label-icon > div {\n position: relative;\n width: 100%;\n height: 100%;\n border-radius: 50% !important;\n}\n.explorer-label-icon > div::after {\n width: 40%;\n height: 40%;\n border-radius: 50%;\n content: ' ';\n background: linear-gradient(45deg, #ffffff7d, #ffffff00);\n margin-top: 4px;\n position: absolute;\n right: 15%;\n top: 15%;\n}\n";
937
937
  styleInject(css_248z$d);
938
938
 
939
939
  const {
@@ -1291,9 +1291,6 @@ var css_248z$9 = "._dropdown_menu {\n background: #fff;\n min-width: 45px;\n
1291
1291
  styleInject(css_248z$9);
1292
1292
 
1293
1293
  function returnDocument(element) {
1294
- if (element) {
1295
- return element.ownerDocument;
1296
- }
1297
1294
  return window.document;
1298
1295
  }
1299
1296
  function Dropdown(props) {
@@ -1889,7 +1886,7 @@ function menuIcon(icon) {
1889
1886
  suffix: icon
1890
1887
  }, 'explorer-menu-icon');
1891
1888
  }
1892
- if ( /*#__PURE__*/React__default.isValidElement(icon)) {
1889
+ if (/*#__PURE__*/React__default.isValidElement(icon)) {
1893
1890
  return jsx("span", {
1894
1891
  className: 'explorer-menu-icon x-icon',
1895
1892
  children: icon
@@ -4352,9 +4349,7 @@ function cleanConductCheck(keys, halfKeys, levelEntities, maxLevel, syntheticGet
4352
4349
  */
4353
4350
  function conductCheck(keyList, checked, keyEntities, getCheckDisabled) {
4354
4351
  let syntheticGetCheckDisabled;
4355
- if (getCheckDisabled) {
4356
- syntheticGetCheckDisabled = getCheckDisabled;
4357
- } else {
4352
+ {
4358
4353
  syntheticGetCheckDisabled = isCheckDisabled;
4359
4354
  }
4360
4355
  // We only handle exist keys
@@ -5003,7 +4998,6 @@ let Tree$1 = class Tree extends React.Component {
5003
4998
  checkedKeys,
5004
4999
  halfCheckedKeys
5005
5000
  } = conductCheck(Array.from(keySet), {
5006
- checked: false,
5007
5001
  halfCheckedKeys
5008
5002
  }, keyEntities));
5009
5003
  }
@@ -5758,7 +5752,7 @@ function TableItem(props) {
5758
5752
  });
5759
5753
  }
5760
5754
 
5761
- var TreeItem = (props => {
5755
+ var TreeItem = props => {
5762
5756
  const {
5763
5757
  onRename,
5764
5758
  onMenuClick,
@@ -5872,7 +5866,7 @@ var TreeItem = (props => {
5872
5866
  })]
5873
5867
  })
5874
5868
  });
5875
- });
5869
+ };
5876
5870
 
5877
5871
  var css_248z$6 = ".explorer-notdata {\n display: flex;\n height: 100%;\n justify-content: center;\n}\n.explorer-notdata .tree-empty {\n position: relative;\n top: 100px;\n width: 200px;\n height: 135px;\n text-align: center;\n}\n.explorer-notdata .tree-empty .empty-svg {\n width: 200px;\n height: 115px;\n overflow: hidden;\n}\n.explorer-notdata .tree-empty > span {\n display: inline-block;\n background: rgba(160, 160, 160, 0.1);\n padding: 3px 10px;\n border-radius: 10px;\n font-size: 0.9em;\n margin-top: 10px;\n line-height: 1;\n color: #999;\n user-select: none;\n}\n";
5878
5872
  styleInject(css_248z$6);
@@ -6085,7 +6079,7 @@ var Tree = /*#__PURE__*/forwardRef((props, _ref) => {
6085
6079
  //树s的懒加载
6086
6080
  const getNewTreeData = (treeData, curKey, child, level) => {
6087
6081
  const loop = (data, levelkey) => {
6088
- if (level < 1 || curKey.length - 3 > level * 2) return;
6082
+ if (curKey.length - 3 > level * 2) return;
6089
6083
  data.forEach((item, index) => {
6090
6084
  let l = levelkey + `-${index}`;
6091
6085
  if (curKey.indexOf(l) === 0) {
@@ -9544,8 +9538,8 @@ const Explorer = /*#__PURE__*/forwardRef((props, ref) => {
9544
9538
  const [menutype, setMenutype] = useState('tile');
9545
9539
  const [infoshow, setInfoShow] = useState(false);
9546
9540
  const [loading, setLoading] = useState(ApiStatusEnum.READY);
9547
- useState(100);
9548
- useState(1);
9541
+ const [pageNum, setPageNum] = useState(100);
9542
+ const [curpage, setCurPage] = useState(1);
9549
9543
  const [totalNum, setTotalNum] = useState(0);
9550
9544
  const [shift, setShift] = useState(false);
9551
9545
  const [control, setControl] = useState(false);
@@ -9700,7 +9694,7 @@ const Explorer = /*#__PURE__*/forwardRef((props, ref) => {
9700
9694
  useEffect(() => {
9701
9695
  if (isNavtab) {
9702
9696
  if (!curlist?.length) {
9703
- setCurList(data || []);
9697
+ setCurList(data?.[0]?.children || []);
9704
9698
  }
9705
9699
  } else {
9706
9700
  if (!curInfo) {
@@ -9712,7 +9706,7 @@ const Explorer = /*#__PURE__*/forwardRef((props, ref) => {
9712
9706
  }, [data, isNavtab]);
9713
9707
  //切换当前 文件目录时 需要清空的内容
9714
9708
  useEffect(() => {
9715
- if (!curInfo?.key) return;
9709
+ if (!curInfo?.key || curInfo?.key == 'root') return;
9716
9710
  setExpandkey([]);
9717
9711
  onExpand?.([]);
9718
9712
  setCurSelect(null);
@@ -9739,6 +9733,9 @@ const Explorer = /*#__PURE__*/forwardRef((props, ref) => {
9739
9733
  }
9740
9734
  //清空加载过的结点记录
9741
9735
  setLoadKey([]);
9736
+ // console.log('🚀 ~ data?.current:', key);
9737
+ // console.log('🚀 ~ data?.fileList:', data?.fileList);
9738
+ // console.log('🚀 ~ data?.current:', data?.current);
9742
9739
  setCurList(data?.fileList || []);
9743
9740
  setCurInfo(data?.current || {});
9744
9741
  setTotalNum(data?.totalNum || 0);
@@ -9813,35 +9810,19 @@ const Explorer = /*#__PURE__*/forwardRef((props, ref) => {
9813
9810
  item.children = arr;
9814
9811
  return item;
9815
9812
  };
9816
- const updateinfo = (item, params) => {
9817
- return {
9818
- ...item,
9819
- ...params
9820
- };
9821
- };
9822
- const delNode = (arr, index) => {
9823
- arr.splice(index, 1);
9824
- return arr;
9825
- };
9826
9813
  const filterData = (data, key) => {
9827
9814
  let arr = data;
9828
9815
  let i = 0;
9829
- let del_index = null;
9830
9816
  while (i < arr.length) {
9831
9817
  let item = arr[i];
9832
9818
  if (key == item.key) {
9833
- if (type == 'add') item = addNode(item, params);
9834
- if (type == 'update') item = updateinfo(item, params);
9835
- if (type == 'del') del_index = i;
9819
+ item = addNode(item, params);
9836
9820
  }
9837
9821
  if (Array.isArray(item.children)) {
9838
9822
  item.children = filterData(item.children, key);
9839
9823
  }
9840
9824
  i++;
9841
9825
  }
9842
- if (type == 'del' && typeof del_index == 'number') {
9843
- arr = delNode(arr, del_index);
9844
- }
9845
9826
  return arr || [];
9846
9827
  };
9847
9828
  let datas = filterData(cloneDeep(data) || [], key);