vxe-pc-ui 4.9.1 → 4.9.2

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.
Files changed (47) hide show
  1. package/es/icon/style.css +1 -1
  2. package/es/split/src/split-pane.js +3 -3
  3. package/es/split/src/split.js +244 -141
  4. package/es/split/style.css +82 -45
  5. package/es/split/style.min.css +1 -1
  6. package/es/style.css +1 -1
  7. package/es/style.min.css +1 -1
  8. package/es/ui/index.js +1 -1
  9. package/es/ui/src/log.js +1 -1
  10. package/es/vxe-split/style.css +82 -45
  11. package/es/vxe-split/style.min.css +1 -1
  12. package/lib/icon/style/style.css +1 -1
  13. package/lib/icon/style/style.min.css +1 -1
  14. package/lib/index.umd.js +252 -159
  15. package/lib/index.umd.min.js +1 -1
  16. package/lib/split/src/split-pane.js +3 -3
  17. package/lib/split/src/split-pane.min.js +1 -1
  18. package/lib/split/src/split.js +247 -154
  19. package/lib/split/src/split.min.js +1 -1
  20. package/lib/split/style/style.css +82 -45
  21. package/lib/split/style/style.min.css +1 -1
  22. package/lib/style.css +1 -1
  23. package/lib/style.min.css +1 -1
  24. package/lib/ui/index.js +1 -1
  25. package/lib/ui/index.min.js +1 -1
  26. package/lib/ui/src/log.js +1 -1
  27. package/lib/ui/src/log.min.js +1 -1
  28. package/lib/vxe-split/style/style.css +82 -45
  29. package/lib/vxe-split/style/style.min.css +1 -1
  30. package/package.json +1 -1
  31. package/packages/split/src/split-pane.ts +4 -3
  32. package/packages/split/src/split.ts +243 -142
  33. package/styles/components/split.scss +109 -88
  34. package/types/components/split-pane.d.ts +11 -2
  35. package/types/components/split.d.ts +26 -22
  36. /package/es/icon/{iconfont.1756086135196.ttf → iconfont.1756133787659.ttf} +0 -0
  37. /package/es/icon/{iconfont.1756086135196.woff → iconfont.1756133787659.woff} +0 -0
  38. /package/es/icon/{iconfont.1756086135196.woff2 → iconfont.1756133787659.woff2} +0 -0
  39. /package/es/{iconfont.1756086135196.ttf → iconfont.1756133787659.ttf} +0 -0
  40. /package/es/{iconfont.1756086135196.woff → iconfont.1756133787659.woff} +0 -0
  41. /package/es/{iconfont.1756086135196.woff2 → iconfont.1756133787659.woff2} +0 -0
  42. /package/lib/icon/style/{iconfont.1756086135196.ttf → iconfont.1756133787659.ttf} +0 -0
  43. /package/lib/icon/style/{iconfont.1756086135196.woff → iconfont.1756133787659.woff} +0 -0
  44. /package/lib/icon/style/{iconfont.1756086135196.woff2 → iconfont.1756133787659.woff2} +0 -0
  45. /package/lib/{iconfont.1756086135196.ttf → iconfont.1756133787659.ttf} +0 -0
  46. /package/lib/{iconfont.1756086135196.woff → iconfont.1756133787659.woff} +0 -0
  47. /package/lib/{iconfont.1756086135196.woff2 → iconfont.1756133787659.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -3588,14 +3588,14 @@ function checkDynamic() {
3588
3588
  }
3589
3589
  ;// CONCATENATED MODULE: ./packages/ui/src/log.ts
3590
3590
 
3591
- const log_version = `ui v${"4.9.1"}`;
3591
+ const log_version = `ui v${"4.9.2"}`;
3592
3592
  const warnLog = log.create('warn', log_version);
3593
3593
  const errLog = log.create('error', log_version);
3594
3594
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
3595
3595
 
3596
3596
 
3597
3597
 
3598
- const ui_version = "4.9.1";
3598
+ const ui_version = "4.9.2";
3599
3599
  index_esm_VxeUI.uiVersion = ui_version;
3600
3600
  index_esm_VxeUI.dynamicApp = dynamicApp;
3601
3601
  function config(options) {
@@ -33710,10 +33710,13 @@ const Select = VxeSelect;
33710
33710
  } = context;
33711
33711
  const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
33712
33712
  const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
33713
+ const refBarInfoElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
33713
33714
  const refResizableSplitTip = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
33714
33715
  const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({
33715
33716
  staticItems: [],
33716
- itemList: []
33717
+ itemList: [],
33718
+ barWidth: 0,
33719
+ barHeight: 0
33717
33720
  });
33718
33721
  const internalData = {
33719
33722
  wrapperWidth: 0,
@@ -33731,12 +33734,8 @@ const Select = VxeSelect;
33731
33734
  const computeActionOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
33732
33735
  return Object.assign({}, getConfig().split.actionConfig, props.actionConfig);
33733
33736
  });
33734
- const computeIsFoldNext = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
33735
- const actionOpts = computeActionOpts.value;
33736
- return actionOpts.direction === 'next';
33737
- });
33738
33737
  const computeVisibleItems = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
33739
- return reactData.itemList.filter(item => item.isVisible);
33738
+ return reactData.itemList.filter(item => item.isExpand);
33740
33739
  });
33741
33740
  const computeAutoItems = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
33742
33741
  const {
@@ -33750,10 +33749,10 @@ const Select = VxeSelect;
33750
33749
  renderHeight,
33751
33750
  resizeHeight,
33752
33751
  foldHeight,
33753
- isVisible,
33752
+ isExpand,
33754
33753
  height
33755
33754
  } = item;
33756
- const itemHeight = isVisible ? foldHeight || resizeHeight || renderHeight : 0;
33755
+ const itemHeight = isExpand ? foldHeight || resizeHeight || renderHeight : 0;
33757
33756
  if (!height) {
33758
33757
  autoItems.push(item);
33759
33758
  }
@@ -33763,10 +33762,10 @@ const Select = VxeSelect;
33763
33762
  renderWidth,
33764
33763
  resizeWidth,
33765
33764
  foldWidth,
33766
- isVisible,
33765
+ isExpand,
33767
33766
  width
33768
33767
  } = item;
33769
- const itemWidth = isVisible ? foldWidth || resizeWidth || renderWidth : 0;
33768
+ const itemWidth = isExpand ? foldWidth || resizeWidth || renderWidth : 0;
33770
33769
  if (!width) {
33771
33770
  autoItems.push(item);
33772
33771
  }
@@ -33798,8 +33797,7 @@ const Select = VxeSelect;
33798
33797
  const computeMaps = {
33799
33798
  computeItemOpts,
33800
33799
  computeBarOpts,
33801
- computeActionOpts,
33802
- computeIsFoldNext
33800
+ computeActionOpts
33803
33801
  };
33804
33802
  const refMaps = {
33805
33803
  refElem
@@ -33829,38 +33827,31 @@ const Select = VxeSelect;
33829
33827
  }
33830
33828
  return [];
33831
33829
  };
33832
- const getDefaultActionIcon = item => {
33830
+ const getActionIcon = (prevItem, nextItem, isNext) => {
33833
33831
  const {
33834
33832
  vertical
33835
33833
  } = props;
33836
- const {
33837
- showAction,
33838
- isExpand
33839
- } = item;
33840
- const isFoldNext = computeIsFoldNext.value;
33841
33834
  const topIcon = 'SPLIT_TOP_ACTION';
33842
33835
  const bottomIcon = 'SPLIT_BOTTOM_ACTION';
33843
33836
  const leftIcon = 'SPLIT_LEFT_ACTION';
33844
33837
  const rightIcon = 'SPLIT_RIGHT_ACTION';
33845
- if (showAction) {
33846
- let iconName = '';
33847
- if (isFoldNext) {
33848
- if (vertical) {
33849
- iconName = isExpand ? bottomIcon : topIcon;
33850
- } else {
33851
- iconName = isExpand ? rightIcon : leftIcon;
33852
- }
33838
+ let iconName = '';
33839
+ if (vertical) {
33840
+ if (isNext) {
33841
+ iconName = nextItem.isExpand ? bottomIcon : topIcon;
33853
33842
  } else {
33854
- if (vertical) {
33855
- iconName = isExpand ? topIcon : bottomIcon;
33856
- } else {
33857
- iconName = isExpand ? leftIcon : rightIcon;
33858
- }
33843
+ iconName = prevItem.isExpand ? topIcon : bottomIcon;
33859
33844
  }
33860
- if (iconName) {
33861
- return getIcon()[iconName];
33845
+ } else {
33846
+ if (isNext) {
33847
+ iconName = nextItem.isExpand ? rightIcon : leftIcon;
33848
+ } else {
33849
+ iconName = prevItem.isExpand ? leftIcon : rightIcon;
33862
33850
  }
33863
33851
  }
33852
+ if (iconName) {
33853
+ return getIcon()[iconName];
33854
+ }
33864
33855
  return '';
33865
33856
  };
33866
33857
  const reset = () => {
@@ -33869,7 +33860,6 @@ const Select = VxeSelect;
33869
33860
  } = reactData;
33870
33861
  itemList.forEach(item => {
33871
33862
  item.isExpand = true;
33872
- item.isVisible = true;
33873
33863
  item.foldHeight = 0;
33874
33864
  item.foldWidth = 0;
33875
33865
  item.resizeHeight = 0;
@@ -33881,8 +33871,12 @@ const Select = VxeSelect;
33881
33871
  const {
33882
33872
  staticItems
33883
33873
  } = reactData;
33874
+ const actionOpts = computeActionOpts.value;
33875
+ const {
33876
+ showPrevButton,
33877
+ showNextButton
33878
+ } = actionOpts;
33884
33879
  const itemDef = {
33885
- isVisible: true,
33886
33880
  isExpand: true,
33887
33881
  renderWidth: 0,
33888
33882
  resizeWidth: 0,
@@ -33892,6 +33886,9 @@ const Select = VxeSelect;
33892
33886
  foldHeight: 0
33893
33887
  };
33894
33888
  reactData.itemList = list.map(item => {
33889
+ if (item.showAction) {
33890
+ warnLog('vxe.error.removeProp', ['showAction']);
33891
+ }
33895
33892
  if (item.slots) {
33896
33893
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(item.slots, func => {
33897
33894
  if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(func)) {
@@ -33908,6 +33905,9 @@ const Select = VxeSelect;
33908
33905
  if (staticItems.length) {
33909
33906
  errLog('vxe.error.errConflicts', ['<vxe-split-pane ...>', 'items']);
33910
33907
  }
33908
+ if ((showPrevButton || showNextButton) && reactData.itemList.length > 2) {
33909
+ errLog('vxe.error.errConflicts', ['action-config.showPrevButton | action-config.showNextButton', 'Only supports 2 item']);
33910
+ }
33911
33911
  return recalculate();
33912
33912
  };
33913
33913
  const loadItem = list => {
@@ -33925,6 +33925,7 @@ const Select = VxeSelect;
33925
33925
  itemList
33926
33926
  } = reactData;
33927
33927
  const el = refElem.value;
33928
+ const barInfoElem = refBarInfoElem.value;
33928
33929
  if (!el) {
33929
33930
  return;
33930
33931
  }
@@ -33933,6 +33934,12 @@ const Select = VxeSelect;
33933
33934
  if (!wWidth || !wHeight) {
33934
33935
  return;
33935
33936
  }
33937
+ if (barInfoElem) {
33938
+ reactData.barWidth = barInfoElem.offsetWidth;
33939
+ reactData.barHeight = barInfoElem.offsetHeight;
33940
+ }
33941
+ const contentWidth = wWidth - (vertical ? 0 : reactData.barWidth * (itemList.length - 1));
33942
+ const contentHeight = wHeight - (vertical ? reactData.barHeight * (itemList.length - 1) : 0);
33936
33943
  const itemOpts = computeItemOpts.value;
33937
33944
  const allMinWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(itemOpts.minWidth);
33938
33945
  const allMinHeight = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(itemOpts.minHeight);
@@ -33946,7 +33953,7 @@ const Select = VxeSelect;
33946
33953
  let itemHeight = 0;
33947
33954
  if (height) {
33948
33955
  if (isScale(height)) {
33949
- itemHeight = wHeight * external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(height) / 100;
33956
+ itemHeight = contentHeight * external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(height) / 100;
33950
33957
  } else {
33951
33958
  itemHeight = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(height);
33952
33959
  }
@@ -33957,7 +33964,7 @@ const Select = VxeSelect;
33957
33964
  countHeight += itemHeight;
33958
33965
  });
33959
33966
  if (residueItems.length) {
33960
- const reMeanHeight = (wHeight - countHeight) / residueItems.length;
33967
+ const reMeanHeight = (contentHeight - countHeight) / residueItems.length;
33961
33968
  residueItems.forEach(item => {
33962
33969
  item.renderHeight = Math.max(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getGlobalDefaultConfig(item.minHeight, allMinHeight)), reMeanHeight);
33963
33970
  });
@@ -33971,7 +33978,7 @@ const Select = VxeSelect;
33971
33978
  let itemWidth = 0;
33972
33979
  if (width) {
33973
33980
  if (isScale(width)) {
33974
- itemWidth = wWidth * external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(width) / 100;
33981
+ itemWidth = contentWidth * external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(width) / 100;
33975
33982
  } else {
33976
33983
  itemWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(width);
33977
33984
  }
@@ -33982,14 +33989,14 @@ const Select = VxeSelect;
33982
33989
  countWidth += itemWidth;
33983
33990
  });
33984
33991
  if (residueItems.length) {
33985
- const reMeanWidth = (wWidth - countWidth) / residueItems.length;
33992
+ const reMeanWidth = (contentWidth - countWidth) / residueItems.length;
33986
33993
  residueItems.forEach(item => {
33987
33994
  item.renderWidth = Math.max(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getGlobalDefaultConfig(item.minWidth, allMinWidth)), reMeanWidth);
33988
33995
  });
33989
33996
  }
33990
33997
  }
33991
- internalData.wrapperWidth = wWidth;
33992
- internalData.wrapperHeight = wHeight;
33998
+ internalData.wrapperWidth = contentWidth;
33999
+ internalData.wrapperHeight = contentHeight;
33993
34000
  });
33994
34001
  };
33995
34002
  const dragEvent = evnt => {
@@ -34010,20 +34017,22 @@ const Select = VxeSelect;
34010
34017
  if (!el) {
34011
34018
  return;
34012
34019
  }
34013
- const itemId = handleEl.getAttribute('itemid');
34014
- const itemIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(itemList, item => item.id === itemId);
34015
- const item = itemList[itemIndex];
34016
- if (!item) {
34020
+ const prevEl = handleEl.previousElementSibling;
34021
+ const nextEl = handleEl.nextElementSibling;
34022
+ if (!prevEl || !nextEl) {
34017
34023
  return;
34018
34024
  }
34019
- if (!item.isExpand) {
34025
+ const prevId = prevEl.getAttribute('itemid');
34026
+ const nextId = nextEl.getAttribute('itemid');
34027
+ const prevItem = itemList.find(item => item.id === prevId);
34028
+ const nextItem = itemList.find(item => item.id === nextId);
34029
+ if (!prevItem || !nextItem) {
34020
34030
  return;
34021
34031
  }
34022
34032
  const containerRect = el.getBoundingClientRect();
34023
34033
  const barRect = barEl.getBoundingClientRect();
34024
34034
  const rsSplitLineEl = refResizableSplitTip.value;
34025
34035
  const rsSplitTipEl = rsSplitLineEl ? rsSplitLineEl.children[0] : null;
34026
- const isFoldNext = computeIsFoldNext.value;
34027
34036
  const itemOpts = computeItemOpts.value;
34028
34037
  const resizeOpts = computeResizeOpts.value;
34029
34038
  const {
@@ -34031,14 +34040,6 @@ const Select = VxeSelect;
34031
34040
  } = resizeOpts;
34032
34041
  const allMinWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(itemOpts.minWidth);
34033
34042
  const allMinHeight = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(itemOpts.minHeight);
34034
- const targetItem = itemList[itemIndex + (isFoldNext ? 1 : -1)];
34035
- const prevItem = itemList[itemIndex + (isFoldNext ? 0 : -1)];
34036
- const nextItem = itemList[itemIndex + (isFoldNext ? 1 : 0)];
34037
- const prevEl = targetItem ? el.querySelector(`.vxe-split-pane[itemid="${prevItem.id}"]`) : null;
34038
- const nextEl = item ? el.querySelector(`.vxe-split-pane[itemid="${nextItem.id}"]`) : null;
34039
- if (!prevEl || !nextEl) {
34040
- return;
34041
- }
34042
34043
  const barOffsetX = Math.ceil(barRect.width - (evnt.clientX - barRect.left));
34043
34044
  const barOffsetY = Math.ceil(evnt.clientY - barRect.top);
34044
34045
  const prevWidth = prevEl.offsetWidth;
@@ -34175,8 +34176,6 @@ const Select = VxeSelect;
34175
34176
  handleReStyle(evnt);
34176
34177
  }
34177
34178
  dispatchEvent('resize-drag', {
34178
- item,
34179
- name: item.name,
34180
34179
  prevItem,
34181
34180
  nextItem,
34182
34181
  offsetHeight: targetOffsetHeight,
@@ -34196,8 +34195,6 @@ const Select = VxeSelect;
34196
34195
  handleUpdate();
34197
34196
  removeClass(el, 'is--drag');
34198
34197
  dispatchEvent('resize-end', {
34199
- item,
34200
- name: item.name,
34201
34198
  prevItem,
34202
34199
  nextItem,
34203
34200
  offsetHeight: targetOffsetHeight,
@@ -34212,98 +34209,149 @@ const Select = VxeSelect;
34212
34209
  handleDrag(evnt);
34213
34210
  addClass(el, 'is--drag');
34214
34211
  dispatchEvent('resize-start', {
34215
- item,
34216
- name: item.name,
34217
34212
  prevItem,
34218
34213
  nextItem
34219
34214
  }, evnt);
34220
34215
  };
34221
- const handleItemActionEvent = evnt => {
34222
- const el = refElem.value;
34223
- if (!el) {
34224
- return;
34225
- }
34216
+ const handleItemActionEvent = (evnt, prevItem, nextItem, isNext) => {
34226
34217
  const {
34227
34218
  vertical
34228
34219
  } = props;
34220
+ let expanded = false;
34221
+ let item = prevItem;
34222
+ if (isNext) {
34223
+ item = nextItem;
34224
+ expanded = !nextItem.isExpand;
34225
+ nextItem.isExpand = expanded;
34226
+ } else {
34227
+ expanded = !prevItem.isExpand;
34228
+ prevItem.isExpand = expanded;
34229
+ }
34230
+ if (vertical) {
34231
+ if (prevItem.isExpand && nextItem.isExpand) {
34232
+ prevItem.foldHeight = 0;
34233
+ nextItem.foldHeight = 0;
34234
+ } else if (prevItem.isExpand) {
34235
+ nextItem.foldHeight = 0;
34236
+ prevItem.foldHeight = (prevItem.resizeHeight || prevItem.renderHeight) + (nextItem.resizeHeight || nextItem.renderHeight);
34237
+ } else {
34238
+ prevItem.foldHeight = 0;
34239
+ nextItem.foldHeight = (prevItem.resizeHeight || prevItem.renderHeight) + (nextItem.resizeHeight || nextItem.renderHeight);
34240
+ }
34241
+ } else {
34242
+ if (prevItem.isExpand && nextItem.isExpand) {
34243
+ prevItem.foldWidth = 0;
34244
+ nextItem.foldWidth = 0;
34245
+ } else if (prevItem.isExpand) {
34246
+ nextItem.foldWidth = 0;
34247
+ prevItem.foldWidth = (prevItem.resizeWidth || prevItem.renderWidth) + (nextItem.resizeWidth || nextItem.renderWidth);
34248
+ } else {
34249
+ prevItem.foldWidth = 0;
34250
+ nextItem.foldWidth = (prevItem.resizeWidth || prevItem.renderWidth) + (nextItem.resizeWidth || nextItem.renderWidth);
34251
+ }
34252
+ }
34253
+ dispatchEvent('toggle-expand', {
34254
+ prevItem,
34255
+ nextItem,
34256
+ expanded,
34257
+ item
34258
+ }, evnt);
34259
+ recalculate();
34260
+ };
34261
+ const handlePrevActionDblclickEvent = evnt => {
34229
34262
  const {
34230
34263
  itemList
34231
34264
  } = reactData;
34232
- const isFoldNext = computeIsFoldNext.value;
34265
+ const actionOpts = computeActionOpts.value;
34233
34266
  const btnEl = evnt.currentTarget;
34234
- const handleEl = btnEl.parentElement;
34235
- const itemId = handleEl.getAttribute('itemid');
34236
- const itemIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(itemList, item => item.id === itemId);
34237
- const item = itemList[itemIndex];
34238
- const targetItem = itemList[itemIndex + (isFoldNext ? 1 : -1)];
34239
- if (item) {
34240
- const {
34241
- showAction,
34242
- isExpand
34243
- } = item;
34244
- if (showAction) {
34245
- if (vertical) {
34246
- if (targetItem) {
34247
- targetItem.isVisible = !isExpand;
34248
- targetItem.foldHeight = 0;
34249
- item.isExpand = !isExpand;
34250
- item.isVisible = true;
34251
- item.foldHeight = isExpand ? (targetItem.resizeHeight || targetItem.renderHeight) + (item.resizeHeight || item.renderHeight) : 0;
34252
- }
34253
- } else {
34254
- if (targetItem) {
34255
- targetItem.isVisible = !isExpand;
34256
- targetItem.foldWidth = 0;
34257
- item.isExpand = !isExpand;
34258
- item.isVisible = true;
34259
- item.foldWidth = isExpand ? (targetItem.resizeWidth || targetItem.renderWidth) + (item.resizeWidth || item.renderWidth) : 0;
34260
- }
34261
- }
34262
- dispatchEvent('toggle-expand', {
34263
- item,
34264
- name: item.name,
34265
- targetItem,
34266
- targetName: targetItem ? targetItem.name : '',
34267
- expanded: item.isExpand
34268
- }, evnt);
34269
- recalculate();
34267
+ const btnWrapperEl = btnEl.parentElement;
34268
+ const handleEl = btnWrapperEl.parentElement;
34269
+ const prevEl = handleEl.previousElementSibling;
34270
+ const prevId = prevEl.getAttribute('itemid');
34271
+ const prevItem = itemList.find(item => item.id === prevId);
34272
+ const nextEl = handleEl.nextElementSibling;
34273
+ const nextId = nextEl.getAttribute('itemid');
34274
+ const nextItem = itemList.find(item => item.id === nextId);
34275
+ if (actionOpts.trigger === 'dblclick') {
34276
+ if (prevItem && nextItem && nextItem.isExpand) {
34277
+ handleItemActionEvent(evnt, prevItem, nextItem, false);
34270
34278
  }
34271
34279
  }
34280
+ dispatchEvent('action-dblclick', {
34281
+ prevItem,
34282
+ nextItem
34283
+ }, evnt);
34272
34284
  };
34273
- const handleActionDblclickEvent = evnt => {
34285
+ const handlePrevActionClickEvent = evnt => {
34274
34286
  const {
34275
34287
  itemList
34276
34288
  } = reactData;
34277
34289
  const actionOpts = computeActionOpts.value;
34278
34290
  const btnEl = evnt.currentTarget;
34279
- const handleEl = btnEl.parentElement;
34280
- const itemId = handleEl.getAttribute('itemid');
34281
- const itemIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(itemList, item => item.id === itemId);
34282
- const item = itemList[itemIndex];
34291
+ const btnWrapperEl = btnEl.parentElement;
34292
+ const handleEl = btnWrapperEl.parentElement;
34293
+ const prevEl = handleEl.previousElementSibling;
34294
+ const prevId = prevEl.getAttribute('itemid');
34295
+ const prevItem = itemList.find(item => item.id === prevId);
34296
+ const nextEl = handleEl.nextElementSibling;
34297
+ const nextId = nextEl.getAttribute('itemid');
34298
+ const nextItem = itemList.find(item => item.id === nextId);
34299
+ if (actionOpts.trigger !== 'dblclick') {
34300
+ if (prevItem && nextItem && nextItem.isExpand) {
34301
+ handleItemActionEvent(evnt, prevItem, nextItem, false);
34302
+ }
34303
+ }
34304
+ dispatchEvent('action-click', {
34305
+ prevItem,
34306
+ nextItem
34307
+ }, evnt);
34308
+ };
34309
+ const handleNextActionDblclickEvent = evnt => {
34310
+ const {
34311
+ itemList
34312
+ } = reactData;
34313
+ const actionOpts = computeActionOpts.value;
34314
+ const btnEl = evnt.currentTarget;
34315
+ const btnWrapperEl = btnEl.parentElement;
34316
+ const handleEl = btnWrapperEl.parentElement;
34317
+ const prevEl = handleEl.previousElementSibling;
34318
+ const prevId = prevEl.getAttribute('itemid');
34319
+ const prevItem = itemList.find(item => item.id === prevId);
34320
+ const nextEl = handleEl.nextElementSibling;
34321
+ const nextId = nextEl.getAttribute('itemid');
34322
+ const nextItem = itemList.find(item => item.id === nextId);
34283
34323
  if (actionOpts.trigger === 'dblclick') {
34284
- handleItemActionEvent(evnt);
34324
+ if (prevItem && nextItem && prevItem.isExpand) {
34325
+ handleItemActionEvent(evnt, prevItem, nextItem, true);
34326
+ }
34285
34327
  }
34286
34328
  dispatchEvent('action-dblclick', {
34287
- item,
34288
- name: item ? item.name : ''
34329
+ prevItem,
34330
+ nextItem
34289
34331
  }, evnt);
34290
34332
  };
34291
- const handleActionClickEvent = evnt => {
34333
+ const handleNextActionClickEvent = evnt => {
34292
34334
  const {
34293
34335
  itemList
34294
34336
  } = reactData;
34295
34337
  const actionOpts = computeActionOpts.value;
34296
34338
  const btnEl = evnt.currentTarget;
34297
- const handleEl = btnEl.parentElement;
34298
- const itemId = handleEl.getAttribute('itemid');
34299
- const itemIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(itemList, item => item.id === itemId);
34300
- const item = itemList[itemIndex];
34339
+ const btnWrapperEl = btnEl.parentElement;
34340
+ const handleEl = btnWrapperEl.parentElement;
34341
+ const prevEl = handleEl.previousElementSibling;
34342
+ const prevId = prevEl.getAttribute('itemid');
34343
+ const prevItem = itemList.find(item => item.id === prevId);
34344
+ const nextEl = handleEl.nextElementSibling;
34345
+ const nextId = nextEl.getAttribute('itemid');
34346
+ const nextItem = itemList.find(item => item.id === nextId);
34301
34347
  if (actionOpts.trigger !== 'dblclick') {
34302
- handleItemActionEvent(evnt);
34348
+ if (prevItem && nextItem && prevItem.isExpand) {
34349
+ handleItemActionEvent(evnt, prevItem, nextItem, true);
34350
+ }
34303
34351
  }
34304
34352
  dispatchEvent('action-click', {
34305
- item,
34306
- name: item ? item.name : ''
34353
+ prevItem,
34354
+ nextItem
34307
34355
  }, evnt);
34308
34356
  };
34309
34357
  const handleGlobalResizeEvent = () => {
@@ -34318,29 +34366,50 @@ const Select = VxeSelect;
34318
34366
  };
34319
34367
  const splitPrivateMethods = {};
34320
34368
  Object.assign($xeSplit, splitMethods, splitPrivateMethods);
34321
- const renderHandleBar = item => {
34369
+ const renderHandleBar = (prevItem, nextItem) => {
34370
+ const {
34371
+ border,
34372
+ resize,
34373
+ vertical
34374
+ } = props;
34375
+ const {
34376
+ itemList
34377
+ } = reactData;
34322
34378
  const barStyle = computeBarStyle.value;
34323
34379
  const actionOpts = computeActionOpts.value;
34324
- const isFoldNext = computeIsFoldNext.value;
34325
34380
  const {
34326
- id,
34327
- isExpand,
34328
- showAction
34329
- } = item;
34381
+ direction
34382
+ } = actionOpts;
34383
+ const showPrevButton = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(actionOpts.showPrevButton) ? actionOpts.showPrevButton : itemList.some(item => item.showAction);
34384
+ const showNextButton = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(actionOpts.showNextButton) ? actionOpts.showNextButton : direction === 'next' && itemList.some(item => item.showAction);
34385
+ const resizeOpts = computeResizeOpts.value;
34386
+ const {
34387
+ immediate
34388
+ } = resizeOpts;
34330
34389
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
34331
- itemid: id,
34332
- class: ['vxe-split-pane-handle', isFoldNext ? 'to--next' : 'to--prev']
34390
+ class: ['vxe-split-pane-handle', vertical ? 'is--vertical' : 'is--horizontal', immediate ? 'is-resize--immediate' : 'is-resize--lazy', {
34391
+ 'is--resize': resize,
34392
+ 'is--border': border
34393
+ }]
34333
34394
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
34334
34395
  class: 'vxe-split-pane-handle-bar',
34335
34396
  style: barStyle,
34336
34397
  onMousedown: dragEvent
34337
- }), showAction ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
34398
+ }), itemList.length === 2 ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
34399
+ class: 'vxe-split-pane-action-btn-wrapper'
34400
+ }, [showPrevButton && nextItem.isExpand ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
34401
+ class: 'vxe-split-pane-action-btn',
34402
+ onDblclick: handlePrevActionDblclickEvent,
34403
+ onClick: handlePrevActionClickEvent
34404
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
34405
+ class: getActionIcon(prevItem, nextItem, false)
34406
+ })]) : renderEmptyElement($xeSplit), showNextButton && prevItem.isExpand ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
34338
34407
  class: 'vxe-split-pane-action-btn',
34339
- onDblclick: handleActionDblclickEvent,
34340
- onClick: handleActionClickEvent
34408
+ onDblclick: handleNextActionDblclickEvent,
34409
+ onClick: handleNextActionClickEvent
34341
34410
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
34342
- class: (isExpand ? actionOpts.openIcon : actionOpts.closeIcon) || getDefaultActionIcon(item)
34343
- })]) : renderEmptyElement($xeSplit)]);
34411
+ class: getActionIcon(prevItem, nextItem, true)
34412
+ })]) : renderEmptyElement($xeSplit)]) : renderEmptyElement($xeSplit)]);
34344
34413
  };
34345
34414
  const renderItems = () => {
34346
34415
  const {
@@ -34360,9 +34429,8 @@ const Select = VxeSelect;
34360
34429
  const {
34361
34430
  autoItems
34362
34431
  } = computeAutoItems.value;
34363
- const isFoldNext = computeIsFoldNext.value;
34364
34432
  const itemVNs = [];
34365
- itemList.forEach((item, index) => {
34433
+ itemList.forEach((prevItem, index) => {
34366
34434
  const {
34367
34435
  id,
34368
34436
  name,
@@ -34373,33 +34441,35 @@ const Select = VxeSelect;
34373
34441
  renderWidth,
34374
34442
  resizeWidth,
34375
34443
  foldWidth,
34376
- isVisible,
34377
34444
  isExpand
34378
- } = item;
34445
+ } = prevItem;
34446
+ const nextItem = itemList[index + 1];
34379
34447
  const defaultSlot = slots ? slots.default : null;
34380
34448
  const stys = {};
34381
- let itemWidth = isVisible ? foldWidth || resizeWidth || renderWidth : 0;
34382
- let itemHeight = isVisible ? foldHeight || resizeHeight || renderHeight : 0;
34449
+ let itemWidth = isExpand ? foldWidth || resizeWidth || renderWidth : 0;
34450
+ let itemHeight = isExpand ? foldHeight || resizeHeight || renderHeight : 0;
34383
34451
  // 至少存在一个自适应
34384
34452
  if (autoItems.length === 1) {
34385
34453
  if (vertical) {
34386
- if (!item.height) {
34454
+ if (!prevItem.height) {
34387
34455
  itemHeight = 0;
34388
34456
  }
34389
34457
  } else {
34390
- if (!item.width) {
34458
+ if (!prevItem.width) {
34391
34459
  itemWidth = 0;
34392
34460
  }
34393
34461
  }
34394
34462
  }
34395
- // 当只剩下一个可视区自动占用 100%
34463
+ let isFill = true;
34396
34464
  if (vertical) {
34397
- if (itemHeight) {
34398
- stys.height = visibleItems.length === 1 ? '100%' : toCssUnit(itemHeight);
34465
+ if (itemHeight && visibleItems.length > 1) {
34466
+ isFill = false;
34467
+ stys.height = toCssUnit(itemHeight);
34399
34468
  }
34400
34469
  } else {
34401
- if (itemWidth) {
34402
- stys.width = visibleItems.length === 1 ? '100%' : toCssUnit(itemWidth);
34470
+ if (itemWidth && visibleItems.length > 1) {
34471
+ isFill = false;
34472
+ stys.width = toCssUnit(itemWidth);
34403
34473
  }
34404
34474
  }
34405
34475
  itemVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
@@ -34410,22 +34480,23 @@ const Select = VxeSelect;
34410
34480
  'is--border': border,
34411
34481
  'is--height': itemHeight,
34412
34482
  'is--width': itemWidth,
34413
- 'is--fill': isVisible && !itemHeight && !itemWidth,
34414
- 'is--handle': index > 0,
34415
- 'is--expand': isExpand,
34416
- 'is--hidden': !isVisible
34483
+ 'is--visible': isExpand,
34484
+ 'is--hidden': !isExpand,
34485
+ 'is--fill': isExpand && isFill
34417
34486
  }],
34418
34487
  style: stys
34419
- }, [index && !isFoldNext ? renderHandleBar(item) : renderEmptyElement($xeSplit), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
34488
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
34420
34489
  itemid: id,
34421
34490
  class: 'vxe-split-pane--wrapper'
34422
34491
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
34423
34492
  class: 'vxe-split-pane--inner'
34424
34493
  }, defaultSlot ? callSlot(defaultSlot, {
34425
34494
  name,
34426
- isVisible,
34427
34495
  isExpand
34428
- }) : [])]), isFoldNext && index < itemList.length - 1 ? renderHandleBar(item) : renderEmptyElement($xeSplit)]));
34496
+ }) : [])])]));
34497
+ if (nextItem) {
34498
+ itemVNs.push(renderHandleBar(prevItem, nextItem));
34499
+ }
34429
34500
  });
34430
34501
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
34431
34502
  class: 'vxe-split-wrapper'
@@ -34465,7 +34536,12 @@ const Select = VxeSelect;
34465
34536
  class: 'vxe-split--resizable-split-number-prev'
34466
34537
  }), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
34467
34538
  class: 'vxe-split--resizable-split-number-next'
34468
- })])] : [])]);
34539
+ })])] : []), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
34540
+ class: 'vxe-split--render-vars'
34541
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
34542
+ ref: refBarInfoElem,
34543
+ class: 'vxe-split--handle-bar-info'
34544
+ })])]);
34469
34545
  };
34470
34546
  const itemFlag = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);
34471
34547
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.items ? props.items.length : -1, () => {
@@ -34478,10 +34554,23 @@ const Select = VxeSelect;
34478
34554
  loadItem(props.items || []);
34479
34555
  });
34480
34556
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => reactData.staticItems, val => {
34557
+ const actionOpts = computeActionOpts.value;
34558
+ const {
34559
+ showPrevButton,
34560
+ showNextButton
34561
+ } = actionOpts;
34481
34562
  if (props.items && props.items.length) {
34482
34563
  errLog('vxe.error.errConflicts', ['<vxe-split-pane ...>', 'items']);
34483
34564
  }
34484
- reactData.itemList = val;
34565
+ reactData.itemList = val || [];
34566
+ if ((showPrevButton || showNextButton) && reactData.itemList.length > 2) {
34567
+ errLog('vxe.error.modelConflicts', ['action-config.showPrevButton | action-config.showNextButton', '<vxe-split-pane ...> Only supports 2 panel']);
34568
+ }
34569
+ reactData.itemList.forEach(item => {
34570
+ if (item.showAction) {
34571
+ warnLog('vxe.error.removeProp', ['showAction']);
34572
+ }
34573
+ });
34485
34574
  recalculate();
34486
34575
  });
34487
34576
  let resizeObserver;
@@ -34496,6 +34585,10 @@ const Select = VxeSelect;
34496
34585
  });
34497
34586
  resizeObserver.observe(el);
34498
34587
  }
34588
+ const actionOpts = computeActionOpts.value;
34589
+ if (actionOpts.direction) {
34590
+ errLog('vxe.error.delProp', ['action-config.direction', 'action-config.showPrevButton | action-config.showNextButton']);
34591
+ }
34499
34592
  globalEvents.on($xeSplit, 'resize', handleGlobalResizeEvent);
34500
34593
  });
34501
34594
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onUnmounted)(() => {
@@ -34561,7 +34654,6 @@ function destroySplitItem($xeSplit, paneConfig) {
34561
34654
  name: [Number, String],
34562
34655
  width: [Number, String],
34563
34656
  height: [Number, String],
34564
- showAction: Boolean,
34565
34657
  minWidth: {
34566
34658
  type: [Number, String],
34567
34659
  default: () => null
@@ -34569,7 +34661,9 @@ function destroySplitItem($xeSplit, paneConfig) {
34569
34661
  minHeight: {
34570
34662
  type: [Number, String],
34571
34663
  default: () => null
34572
- }
34664
+ },
34665
+ // 已废弃
34666
+ showAction: Boolean
34573
34667
  },
34574
34668
  emits: [],
34575
34669
  setup(props, context) {
@@ -34588,7 +34682,6 @@ function destroySplitItem($xeSplit, paneConfig) {
34588
34682
  minWidth: props.minWidth,
34589
34683
  minHeight: props.minHeight,
34590
34684
  showAction: props.showAction,
34591
- isVisible: true,
34592
34685
  isExpand: true,
34593
34686
  renderWidth: 0,
34594
34687
  resizeWidth: 0,