@gingkoo/pandora-explorer 0.0.1-alpha.7 → 0.0.1-alpha.8

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.
@@ -31,6 +31,7 @@ export interface TreeProps {
31
31
  onChange?: (data: TreeItem[]) => void;
32
32
  titleRender?: (props: any) => any;
33
33
  onMenuClick?: (key: string, props: any) => void;
34
+ onDblclick?: (key: string, props: any) => void;
34
35
  loadData?: (key: string) => Promise<TreeItem[]> | TreeItem[];
35
36
  onRename?: (key: string, value: string, props?: TreeItem) => boolean | void;
36
37
  [key: string]: any;
package/lib/es/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @gingkoo/pandora-explorer v0.0.1-alpha.7
2
+ * @gingkoo/pandora-explorer v0.0.1-alpha.8
3
3
  */
4
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
5
  import cx$1 from 'classnames';
@@ -5289,6 +5289,7 @@ var Tree = (props => {
5289
5289
  onChecks,
5290
5290
  onChange,
5291
5291
  onSelect,
5292
+ onDblclick,
5292
5293
  onMenuClick,
5293
5294
  onRename,
5294
5295
  loadData
@@ -5311,11 +5312,7 @@ var Tree = (props => {
5311
5312
  return size > w ? size : Math.ceil(w);
5312
5313
  }, [width, _widht]);
5313
5314
  useEffect(() => {
5314
- let arr = type == 'tree' ? treeData : [...treeData, {
5315
- key: '_ending',
5316
- title: '',
5317
- height: 200
5318
- }];
5315
+ let arr = treeData;
5319
5316
  arr = addLevel(arr, 0, '');
5320
5317
  setData(arr);
5321
5318
  }, [treeData, type]);
@@ -5352,7 +5349,7 @@ var Tree = (props => {
5352
5349
  });
5353
5350
  };
5354
5351
  const s_table_icon = v => {
5355
- if (v.key == '_ending') {
5352
+ if (v.eventKey == '_ending') {
5356
5353
  return jsx(Fragment, {});
5357
5354
  }
5358
5355
  if (v.isLeaf) {
@@ -5516,6 +5513,9 @@ var Tree = (props => {
5516
5513
  onContextMenu: e => {
5517
5514
  e.preventDefault();
5518
5515
  },
5516
+ onDoubleClick: (v, node) => {
5517
+ onDblclick && onDblclick?.(node.key, node);
5518
+ },
5519
5519
  titleRender: v => {
5520
5520
  if (v.key == '_ending') {
5521
5521
  return jsx("div", {
@@ -5597,7 +5597,11 @@ var Tree = (props => {
5597
5597
  });
5598
5598
  },
5599
5599
  loadData: isload ? onLoadData : null,
5600
- treeData: data,
5600
+ treeData: type == 'table' ? [...data, {
5601
+ key: '_ending',
5602
+ title: '',
5603
+ height: 200
5604
+ }] : data,
5601
5605
  switcherIcon: type == 'table' ? s_table_icon : s_icon
5602
5606
  })]
5603
5607
  })
@@ -5969,6 +5973,9 @@ const SelectBox = props => {
5969
5973
  const [stageClickInfo, setStageClickInfo] = useState({
5970
5974
  show: false
5971
5975
  });
5976
+ useEffect(() => {
5977
+ setSelect(checks);
5978
+ }, [checks]);
5972
5979
  useEffect(() => {
5973
5980
  document.addEventListener('mousemove', handleBodyMousemove);
5974
5981
  document.addEventListener('mouseup', handleBodyMouseup);
@@ -5976,7 +5983,7 @@ const SelectBox = props => {
5976
5983
  document.removeEventListener('mousemove', handleBodyMousemove);
5977
5984
  document.removeEventListener('mouseup', handleBodyMouseup);
5978
5985
  };
5979
- }, [stageClickInfo]);
5986
+ }, [stageClickInfo, checkMode]);
5980
5987
  //判断鼠标点击位置 是否为目标区域
5981
5988
  function isSelectTarget(e) {
5982
5989
  let idx = [];
@@ -6089,6 +6096,9 @@ const SelectBox = props => {
6089
6096
  const selectionDom = selectionRef.current;
6090
6097
  if (selectionDom) {
6091
6098
  let idx = [];
6099
+ if (checkMode == 'check') {
6100
+ idx = cloneDeep(checks);
6101
+ }
6092
6102
  let dom = [];
6093
6103
  // 终点
6094
6104
  const {
@@ -6169,7 +6179,6 @@ const SelectBox = props => {
6169
6179
  z-index: 10;
6170
6180
  `;
6171
6181
  _dom.current = dom;
6172
- setSelect(idx);
6173
6182
  onChange(idx);
6174
6183
  }
6175
6184
  }