vxe-pc-ui 4.9.0 → 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 (59) hide show
  1. package/es/icon/style.css +1 -1
  2. package/es/modal/src/modal.js +5 -2
  3. package/es/split/src/split-pane.js +3 -3
  4. package/es/split/src/split.js +244 -141
  5. package/es/split/style.css +82 -45
  6. package/es/split/style.min.css +1 -1
  7. package/es/style.css +1 -1
  8. package/es/style.min.css +1 -1
  9. package/es/tabs/src/tabs.js +6 -3
  10. package/es/ui/index.js +1 -1
  11. package/es/ui/src/log.js +1 -1
  12. package/es/upload/src/upload.js +7 -2
  13. package/es/vxe-split/style.css +82 -45
  14. package/es/vxe-split/style.min.css +1 -1
  15. package/lib/icon/style/style.css +1 -1
  16. package/lib/icon/style/style.min.css +1 -1
  17. package/lib/index.umd.js +270 -166
  18. package/lib/index.umd.min.js +1 -1
  19. package/lib/modal/src/modal.js +5 -2
  20. package/lib/modal/src/modal.min.js +1 -1
  21. package/lib/split/src/split-pane.js +3 -3
  22. package/lib/split/src/split-pane.min.js +1 -1
  23. package/lib/split/src/split.js +247 -154
  24. package/lib/split/src/split.min.js +1 -1
  25. package/lib/split/style/style.css +82 -45
  26. package/lib/split/style/style.min.css +1 -1
  27. package/lib/style.css +1 -1
  28. package/lib/style.min.css +1 -1
  29. package/lib/tabs/src/tabs.js +6 -3
  30. package/lib/tabs/src/tabs.min.js +1 -1
  31. package/lib/ui/index.js +1 -1
  32. package/lib/ui/index.min.js +1 -1
  33. package/lib/ui/src/log.js +1 -1
  34. package/lib/ui/src/log.min.js +1 -1
  35. package/lib/upload/src/upload.js +7 -2
  36. package/lib/upload/src/upload.min.js +1 -1
  37. package/lib/vxe-split/style/style.css +82 -45
  38. package/lib/vxe-split/style/style.min.css +1 -1
  39. package/package.json +1 -1
  40. package/packages/modal/src/modal.ts +6 -2
  41. package/packages/split/src/split-pane.ts +4 -3
  42. package/packages/split/src/split.ts +243 -142
  43. package/packages/tabs/src/tabs.ts +7 -3
  44. package/packages/upload/src/upload.ts +8 -2
  45. package/styles/components/split.scss +109 -88
  46. package/types/components/split-pane.d.ts +11 -2
  47. package/types/components/split.d.ts +26 -22
  48. /package/es/icon/{iconfont.1756083805751.ttf → iconfont.1756133787659.ttf} +0 -0
  49. /package/es/icon/{iconfont.1756083805751.woff → iconfont.1756133787659.woff} +0 -0
  50. /package/es/icon/{iconfont.1756083805751.woff2 → iconfont.1756133787659.woff2} +0 -0
  51. /package/es/{iconfont.1756083805751.ttf → iconfont.1756133787659.ttf} +0 -0
  52. /package/es/{iconfont.1756083805751.woff → iconfont.1756133787659.woff} +0 -0
  53. /package/es/{iconfont.1756083805751.woff2 → iconfont.1756133787659.woff2} +0 -0
  54. /package/lib/icon/style/{iconfont.1756083805751.ttf → iconfont.1756133787659.ttf} +0 -0
  55. /package/lib/icon/style/{iconfont.1756083805751.woff → iconfont.1756133787659.woff} +0 -0
  56. /package/lib/icon/style/{iconfont.1756083805751.woff2 → iconfont.1756133787659.woff2} +0 -0
  57. /package/lib/{iconfont.1756083805751.ttf → iconfont.1756133787659.ttf} +0 -0
  58. /package/lib/{iconfont.1756083805751.woff → iconfont.1756133787659.woff} +0 -0
  59. /package/lib/{iconfont.1756083805751.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.0"}`;
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.0";
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) {
@@ -27463,7 +27463,7 @@ const lockScrollCssWidthKey = '--vxe-ui-modal-lock-scroll-view-width';
27463
27463
  dispatchEvent('before-hide', params, null);
27464
27464
  setTimeout(() => {
27465
27465
  reactData.visible = false;
27466
- emit('update:modelValue', false);
27466
+ emitModel(false);
27467
27467
  dispatchEvent('hide', params, null);
27468
27468
  }, 200);
27469
27469
  removeBodyLockScroll();
@@ -27796,7 +27796,7 @@ const lockScrollCssWidthKey = '--vxe-ui-modal-lock-scroll-view-width';
27796
27796
  const params = {
27797
27797
  type
27798
27798
  };
27799
- emit('update:modelValue', true);
27799
+ emitModel(true);
27800
27800
  dispatchEvent('show', params, null);
27801
27801
  });
27802
27802
  }, 10);
@@ -28226,6 +28226,9 @@ const lockScrollCssWidthKey = '--vxe-ui-modal-lock-scroll-view-width';
28226
28226
  $modal: $xeModal
28227
28227
  }, params));
28228
28228
  };
28229
+ const emitModel = value => {
28230
+ emit('update:modelValue', value);
28231
+ };
28229
28232
  modalMethods = {
28230
28233
  dispatchEvent,
28231
28234
  open: openModal,
@@ -33707,10 +33710,13 @@ const Select = VxeSelect;
33707
33710
  } = context;
33708
33711
  const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
33709
33712
  const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
33713
+ const refBarInfoElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
33710
33714
  const refResizableSplitTip = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
33711
33715
  const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({
33712
33716
  staticItems: [],
33713
- itemList: []
33717
+ itemList: [],
33718
+ barWidth: 0,
33719
+ barHeight: 0
33714
33720
  });
33715
33721
  const internalData = {
33716
33722
  wrapperWidth: 0,
@@ -33728,12 +33734,8 @@ const Select = VxeSelect;
33728
33734
  const computeActionOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
33729
33735
  return Object.assign({}, getConfig().split.actionConfig, props.actionConfig);
33730
33736
  });
33731
- const computeIsFoldNext = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
33732
- const actionOpts = computeActionOpts.value;
33733
- return actionOpts.direction === 'next';
33734
- });
33735
33737
  const computeVisibleItems = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
33736
- return reactData.itemList.filter(item => item.isVisible);
33738
+ return reactData.itemList.filter(item => item.isExpand);
33737
33739
  });
33738
33740
  const computeAutoItems = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
33739
33741
  const {
@@ -33747,10 +33749,10 @@ const Select = VxeSelect;
33747
33749
  renderHeight,
33748
33750
  resizeHeight,
33749
33751
  foldHeight,
33750
- isVisible,
33752
+ isExpand,
33751
33753
  height
33752
33754
  } = item;
33753
- const itemHeight = isVisible ? foldHeight || resizeHeight || renderHeight : 0;
33755
+ const itemHeight = isExpand ? foldHeight || resizeHeight || renderHeight : 0;
33754
33756
  if (!height) {
33755
33757
  autoItems.push(item);
33756
33758
  }
@@ -33760,10 +33762,10 @@ const Select = VxeSelect;
33760
33762
  renderWidth,
33761
33763
  resizeWidth,
33762
33764
  foldWidth,
33763
- isVisible,
33765
+ isExpand,
33764
33766
  width
33765
33767
  } = item;
33766
- const itemWidth = isVisible ? foldWidth || resizeWidth || renderWidth : 0;
33768
+ const itemWidth = isExpand ? foldWidth || resizeWidth || renderWidth : 0;
33767
33769
  if (!width) {
33768
33770
  autoItems.push(item);
33769
33771
  }
@@ -33795,8 +33797,7 @@ const Select = VxeSelect;
33795
33797
  const computeMaps = {
33796
33798
  computeItemOpts,
33797
33799
  computeBarOpts,
33798
- computeActionOpts,
33799
- computeIsFoldNext
33800
+ computeActionOpts
33800
33801
  };
33801
33802
  const refMaps = {
33802
33803
  refElem
@@ -33826,38 +33827,31 @@ const Select = VxeSelect;
33826
33827
  }
33827
33828
  return [];
33828
33829
  };
33829
- const getDefaultActionIcon = item => {
33830
+ const getActionIcon = (prevItem, nextItem, isNext) => {
33830
33831
  const {
33831
33832
  vertical
33832
33833
  } = props;
33833
- const {
33834
- showAction,
33835
- isExpand
33836
- } = item;
33837
- const isFoldNext = computeIsFoldNext.value;
33838
33834
  const topIcon = 'SPLIT_TOP_ACTION';
33839
33835
  const bottomIcon = 'SPLIT_BOTTOM_ACTION';
33840
33836
  const leftIcon = 'SPLIT_LEFT_ACTION';
33841
33837
  const rightIcon = 'SPLIT_RIGHT_ACTION';
33842
- if (showAction) {
33843
- let iconName = '';
33844
- if (isFoldNext) {
33845
- if (vertical) {
33846
- iconName = isExpand ? bottomIcon : topIcon;
33847
- } else {
33848
- iconName = isExpand ? rightIcon : leftIcon;
33849
- }
33838
+ let iconName = '';
33839
+ if (vertical) {
33840
+ if (isNext) {
33841
+ iconName = nextItem.isExpand ? bottomIcon : topIcon;
33850
33842
  } else {
33851
- if (vertical) {
33852
- iconName = isExpand ? topIcon : bottomIcon;
33853
- } else {
33854
- iconName = isExpand ? leftIcon : rightIcon;
33855
- }
33843
+ iconName = prevItem.isExpand ? topIcon : bottomIcon;
33856
33844
  }
33857
- if (iconName) {
33858
- return getIcon()[iconName];
33845
+ } else {
33846
+ if (isNext) {
33847
+ iconName = nextItem.isExpand ? rightIcon : leftIcon;
33848
+ } else {
33849
+ iconName = prevItem.isExpand ? leftIcon : rightIcon;
33859
33850
  }
33860
33851
  }
33852
+ if (iconName) {
33853
+ return getIcon()[iconName];
33854
+ }
33861
33855
  return '';
33862
33856
  };
33863
33857
  const reset = () => {
@@ -33866,7 +33860,6 @@ const Select = VxeSelect;
33866
33860
  } = reactData;
33867
33861
  itemList.forEach(item => {
33868
33862
  item.isExpand = true;
33869
- item.isVisible = true;
33870
33863
  item.foldHeight = 0;
33871
33864
  item.foldWidth = 0;
33872
33865
  item.resizeHeight = 0;
@@ -33878,8 +33871,12 @@ const Select = VxeSelect;
33878
33871
  const {
33879
33872
  staticItems
33880
33873
  } = reactData;
33874
+ const actionOpts = computeActionOpts.value;
33875
+ const {
33876
+ showPrevButton,
33877
+ showNextButton
33878
+ } = actionOpts;
33881
33879
  const itemDef = {
33882
- isVisible: true,
33883
33880
  isExpand: true,
33884
33881
  renderWidth: 0,
33885
33882
  resizeWidth: 0,
@@ -33889,6 +33886,9 @@ const Select = VxeSelect;
33889
33886
  foldHeight: 0
33890
33887
  };
33891
33888
  reactData.itemList = list.map(item => {
33889
+ if (item.showAction) {
33890
+ warnLog('vxe.error.removeProp', ['showAction']);
33891
+ }
33892
33892
  if (item.slots) {
33893
33893
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(item.slots, func => {
33894
33894
  if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(func)) {
@@ -33905,6 +33905,9 @@ const Select = VxeSelect;
33905
33905
  if (staticItems.length) {
33906
33906
  errLog('vxe.error.errConflicts', ['<vxe-split-pane ...>', 'items']);
33907
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
+ }
33908
33911
  return recalculate();
33909
33912
  };
33910
33913
  const loadItem = list => {
@@ -33922,6 +33925,7 @@ const Select = VxeSelect;
33922
33925
  itemList
33923
33926
  } = reactData;
33924
33927
  const el = refElem.value;
33928
+ const barInfoElem = refBarInfoElem.value;
33925
33929
  if (!el) {
33926
33930
  return;
33927
33931
  }
@@ -33930,6 +33934,12 @@ const Select = VxeSelect;
33930
33934
  if (!wWidth || !wHeight) {
33931
33935
  return;
33932
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);
33933
33943
  const itemOpts = computeItemOpts.value;
33934
33944
  const allMinWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(itemOpts.minWidth);
33935
33945
  const allMinHeight = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(itemOpts.minHeight);
@@ -33943,7 +33953,7 @@ const Select = VxeSelect;
33943
33953
  let itemHeight = 0;
33944
33954
  if (height) {
33945
33955
  if (isScale(height)) {
33946
- 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;
33947
33957
  } else {
33948
33958
  itemHeight = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(height);
33949
33959
  }
@@ -33954,7 +33964,7 @@ const Select = VxeSelect;
33954
33964
  countHeight += itemHeight;
33955
33965
  });
33956
33966
  if (residueItems.length) {
33957
- const reMeanHeight = (wHeight - countHeight) / residueItems.length;
33967
+ const reMeanHeight = (contentHeight - countHeight) / residueItems.length;
33958
33968
  residueItems.forEach(item => {
33959
33969
  item.renderHeight = Math.max(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getGlobalDefaultConfig(item.minHeight, allMinHeight)), reMeanHeight);
33960
33970
  });
@@ -33968,7 +33978,7 @@ const Select = VxeSelect;
33968
33978
  let itemWidth = 0;
33969
33979
  if (width) {
33970
33980
  if (isScale(width)) {
33971
- 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;
33972
33982
  } else {
33973
33983
  itemWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(width);
33974
33984
  }
@@ -33979,14 +33989,14 @@ const Select = VxeSelect;
33979
33989
  countWidth += itemWidth;
33980
33990
  });
33981
33991
  if (residueItems.length) {
33982
- const reMeanWidth = (wWidth - countWidth) / residueItems.length;
33992
+ const reMeanWidth = (contentWidth - countWidth) / residueItems.length;
33983
33993
  residueItems.forEach(item => {
33984
33994
  item.renderWidth = Math.max(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getGlobalDefaultConfig(item.minWidth, allMinWidth)), reMeanWidth);
33985
33995
  });
33986
33996
  }
33987
33997
  }
33988
- internalData.wrapperWidth = wWidth;
33989
- internalData.wrapperHeight = wHeight;
33998
+ internalData.wrapperWidth = contentWidth;
33999
+ internalData.wrapperHeight = contentHeight;
33990
34000
  });
33991
34001
  };
33992
34002
  const dragEvent = evnt => {
@@ -34007,20 +34017,22 @@ const Select = VxeSelect;
34007
34017
  if (!el) {
34008
34018
  return;
34009
34019
  }
34010
- const itemId = handleEl.getAttribute('itemid');
34011
- const itemIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(itemList, item => item.id === itemId);
34012
- const item = itemList[itemIndex];
34013
- if (!item) {
34020
+ const prevEl = handleEl.previousElementSibling;
34021
+ const nextEl = handleEl.nextElementSibling;
34022
+ if (!prevEl || !nextEl) {
34014
34023
  return;
34015
34024
  }
34016
- 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) {
34017
34030
  return;
34018
34031
  }
34019
34032
  const containerRect = el.getBoundingClientRect();
34020
34033
  const barRect = barEl.getBoundingClientRect();
34021
34034
  const rsSplitLineEl = refResizableSplitTip.value;
34022
34035
  const rsSplitTipEl = rsSplitLineEl ? rsSplitLineEl.children[0] : null;
34023
- const isFoldNext = computeIsFoldNext.value;
34024
34036
  const itemOpts = computeItemOpts.value;
34025
34037
  const resizeOpts = computeResizeOpts.value;
34026
34038
  const {
@@ -34028,14 +34040,6 @@ const Select = VxeSelect;
34028
34040
  } = resizeOpts;
34029
34041
  const allMinWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(itemOpts.minWidth);
34030
34042
  const allMinHeight = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(itemOpts.minHeight);
34031
- const targetItem = itemList[itemIndex + (isFoldNext ? 1 : -1)];
34032
- const prevItem = itemList[itemIndex + (isFoldNext ? 0 : -1)];
34033
- const nextItem = itemList[itemIndex + (isFoldNext ? 1 : 0)];
34034
- const prevEl = targetItem ? el.querySelector(`.vxe-split-pane[itemid="${prevItem.id}"]`) : null;
34035
- const nextEl = item ? el.querySelector(`.vxe-split-pane[itemid="${nextItem.id}"]`) : null;
34036
- if (!prevEl || !nextEl) {
34037
- return;
34038
- }
34039
34043
  const barOffsetX = Math.ceil(barRect.width - (evnt.clientX - barRect.left));
34040
34044
  const barOffsetY = Math.ceil(evnt.clientY - barRect.top);
34041
34045
  const prevWidth = prevEl.offsetWidth;
@@ -34172,8 +34176,6 @@ const Select = VxeSelect;
34172
34176
  handleReStyle(evnt);
34173
34177
  }
34174
34178
  dispatchEvent('resize-drag', {
34175
- item,
34176
- name: item.name,
34177
34179
  prevItem,
34178
34180
  nextItem,
34179
34181
  offsetHeight: targetOffsetHeight,
@@ -34193,8 +34195,6 @@ const Select = VxeSelect;
34193
34195
  handleUpdate();
34194
34196
  removeClass(el, 'is--drag');
34195
34197
  dispatchEvent('resize-end', {
34196
- item,
34197
- name: item.name,
34198
34198
  prevItem,
34199
34199
  nextItem,
34200
34200
  offsetHeight: targetOffsetHeight,
@@ -34209,98 +34209,149 @@ const Select = VxeSelect;
34209
34209
  handleDrag(evnt);
34210
34210
  addClass(el, 'is--drag');
34211
34211
  dispatchEvent('resize-start', {
34212
- item,
34213
- name: item.name,
34214
34212
  prevItem,
34215
34213
  nextItem
34216
34214
  }, evnt);
34217
34215
  };
34218
- const handleItemActionEvent = evnt => {
34219
- const el = refElem.value;
34220
- if (!el) {
34221
- return;
34222
- }
34216
+ const handleItemActionEvent = (evnt, prevItem, nextItem, isNext) => {
34223
34217
  const {
34224
34218
  vertical
34225
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 => {
34226
34262
  const {
34227
34263
  itemList
34228
34264
  } = reactData;
34229
- const isFoldNext = computeIsFoldNext.value;
34265
+ const actionOpts = computeActionOpts.value;
34230
34266
  const btnEl = evnt.currentTarget;
34231
- const handleEl = btnEl.parentElement;
34232
- const itemId = handleEl.getAttribute('itemid');
34233
- const itemIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(itemList, item => item.id === itemId);
34234
- const item = itemList[itemIndex];
34235
- const targetItem = itemList[itemIndex + (isFoldNext ? 1 : -1)];
34236
- if (item) {
34237
- const {
34238
- showAction,
34239
- isExpand
34240
- } = item;
34241
- if (showAction) {
34242
- if (vertical) {
34243
- if (targetItem) {
34244
- targetItem.isVisible = !isExpand;
34245
- targetItem.foldHeight = 0;
34246
- item.isExpand = !isExpand;
34247
- item.isVisible = true;
34248
- item.foldHeight = isExpand ? (targetItem.resizeHeight || targetItem.renderHeight) + (item.resizeHeight || item.renderHeight) : 0;
34249
- }
34250
- } else {
34251
- if (targetItem) {
34252
- targetItem.isVisible = !isExpand;
34253
- targetItem.foldWidth = 0;
34254
- item.isExpand = !isExpand;
34255
- item.isVisible = true;
34256
- item.foldWidth = isExpand ? (targetItem.resizeWidth || targetItem.renderWidth) + (item.resizeWidth || item.renderWidth) : 0;
34257
- }
34258
- }
34259
- dispatchEvent('toggle-expand', {
34260
- item,
34261
- name: item.name,
34262
- targetItem,
34263
- targetName: targetItem ? targetItem.name : '',
34264
- expanded: item.isExpand
34265
- }, evnt);
34266
- 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);
34278
+ }
34279
+ }
34280
+ dispatchEvent('action-dblclick', {
34281
+ prevItem,
34282
+ nextItem
34283
+ }, evnt);
34284
+ };
34285
+ const handlePrevActionClickEvent = evnt => {
34286
+ const {
34287
+ itemList
34288
+ } = reactData;
34289
+ const actionOpts = computeActionOpts.value;
34290
+ const btnEl = evnt.currentTarget;
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);
34267
34302
  }
34268
34303
  }
34304
+ dispatchEvent('action-click', {
34305
+ prevItem,
34306
+ nextItem
34307
+ }, evnt);
34269
34308
  };
34270
- const handleActionDblclickEvent = evnt => {
34309
+ const handleNextActionDblclickEvent = evnt => {
34271
34310
  const {
34272
34311
  itemList
34273
34312
  } = reactData;
34274
34313
  const actionOpts = computeActionOpts.value;
34275
34314
  const btnEl = evnt.currentTarget;
34276
- const handleEl = btnEl.parentElement;
34277
- const itemId = handleEl.getAttribute('itemid');
34278
- const itemIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(itemList, item => item.id === itemId);
34279
- const item = itemList[itemIndex];
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);
34280
34323
  if (actionOpts.trigger === 'dblclick') {
34281
- handleItemActionEvent(evnt);
34324
+ if (prevItem && nextItem && prevItem.isExpand) {
34325
+ handleItemActionEvent(evnt, prevItem, nextItem, true);
34326
+ }
34282
34327
  }
34283
34328
  dispatchEvent('action-dblclick', {
34284
- item,
34285
- name: item ? item.name : ''
34329
+ prevItem,
34330
+ nextItem
34286
34331
  }, evnt);
34287
34332
  };
34288
- const handleActionClickEvent = evnt => {
34333
+ const handleNextActionClickEvent = evnt => {
34289
34334
  const {
34290
34335
  itemList
34291
34336
  } = reactData;
34292
34337
  const actionOpts = computeActionOpts.value;
34293
34338
  const btnEl = evnt.currentTarget;
34294
- const handleEl = btnEl.parentElement;
34295
- const itemId = handleEl.getAttribute('itemid');
34296
- const itemIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(itemList, item => item.id === itemId);
34297
- 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);
34298
34347
  if (actionOpts.trigger !== 'dblclick') {
34299
- handleItemActionEvent(evnt);
34348
+ if (prevItem && nextItem && prevItem.isExpand) {
34349
+ handleItemActionEvent(evnt, prevItem, nextItem, true);
34350
+ }
34300
34351
  }
34301
34352
  dispatchEvent('action-click', {
34302
- item,
34303
- name: item ? item.name : ''
34353
+ prevItem,
34354
+ nextItem
34304
34355
  }, evnt);
34305
34356
  };
34306
34357
  const handleGlobalResizeEvent = () => {
@@ -34315,29 +34366,50 @@ const Select = VxeSelect;
34315
34366
  };
34316
34367
  const splitPrivateMethods = {};
34317
34368
  Object.assign($xeSplit, splitMethods, splitPrivateMethods);
34318
- const renderHandleBar = item => {
34369
+ const renderHandleBar = (prevItem, nextItem) => {
34370
+ const {
34371
+ border,
34372
+ resize,
34373
+ vertical
34374
+ } = props;
34375
+ const {
34376
+ itemList
34377
+ } = reactData;
34319
34378
  const barStyle = computeBarStyle.value;
34320
34379
  const actionOpts = computeActionOpts.value;
34321
- const isFoldNext = computeIsFoldNext.value;
34322
34380
  const {
34323
- id,
34324
- isExpand,
34325
- showAction
34326
- } = 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;
34327
34389
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
34328
- itemid: id,
34329
- 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
+ }]
34330
34394
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
34331
34395
  class: 'vxe-split-pane-handle-bar',
34332
34396
  style: barStyle,
34333
34397
  onMousedown: dragEvent
34334
- }), 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', {
34335
34401
  class: 'vxe-split-pane-action-btn',
34336
- onDblclick: handleActionDblclickEvent,
34337
- onClick: handleActionClickEvent
34402
+ onDblclick: handlePrevActionDblclickEvent,
34403
+ onClick: handlePrevActionClickEvent
34338
34404
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
34339
- class: (isExpand ? actionOpts.openIcon : actionOpts.closeIcon) || getDefaultActionIcon(item)
34340
- })]) : renderEmptyElement($xeSplit)]);
34405
+ class: getActionIcon(prevItem, nextItem, false)
34406
+ })]) : renderEmptyElement($xeSplit), showNextButton && prevItem.isExpand ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
34407
+ class: 'vxe-split-pane-action-btn',
34408
+ onDblclick: handleNextActionDblclickEvent,
34409
+ onClick: handleNextActionClickEvent
34410
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
34411
+ class: getActionIcon(prevItem, nextItem, true)
34412
+ })]) : renderEmptyElement($xeSplit)]) : renderEmptyElement($xeSplit)]);
34341
34413
  };
34342
34414
  const renderItems = () => {
34343
34415
  const {
@@ -34357,9 +34429,8 @@ const Select = VxeSelect;
34357
34429
  const {
34358
34430
  autoItems
34359
34431
  } = computeAutoItems.value;
34360
- const isFoldNext = computeIsFoldNext.value;
34361
34432
  const itemVNs = [];
34362
- itemList.forEach((item, index) => {
34433
+ itemList.forEach((prevItem, index) => {
34363
34434
  const {
34364
34435
  id,
34365
34436
  name,
@@ -34370,33 +34441,35 @@ const Select = VxeSelect;
34370
34441
  renderWidth,
34371
34442
  resizeWidth,
34372
34443
  foldWidth,
34373
- isVisible,
34374
34444
  isExpand
34375
- } = item;
34445
+ } = prevItem;
34446
+ const nextItem = itemList[index + 1];
34376
34447
  const defaultSlot = slots ? slots.default : null;
34377
34448
  const stys = {};
34378
- let itemWidth = isVisible ? foldWidth || resizeWidth || renderWidth : 0;
34379
- let itemHeight = isVisible ? foldHeight || resizeHeight || renderHeight : 0;
34449
+ let itemWidth = isExpand ? foldWidth || resizeWidth || renderWidth : 0;
34450
+ let itemHeight = isExpand ? foldHeight || resizeHeight || renderHeight : 0;
34380
34451
  // 至少存在一个自适应
34381
34452
  if (autoItems.length === 1) {
34382
34453
  if (vertical) {
34383
- if (!item.height) {
34454
+ if (!prevItem.height) {
34384
34455
  itemHeight = 0;
34385
34456
  }
34386
34457
  } else {
34387
- if (!item.width) {
34458
+ if (!prevItem.width) {
34388
34459
  itemWidth = 0;
34389
34460
  }
34390
34461
  }
34391
34462
  }
34392
- // 当只剩下一个可视区自动占用 100%
34463
+ let isFill = true;
34393
34464
  if (vertical) {
34394
- if (itemHeight) {
34395
- stys.height = visibleItems.length === 1 ? '100%' : toCssUnit(itemHeight);
34465
+ if (itemHeight && visibleItems.length > 1) {
34466
+ isFill = false;
34467
+ stys.height = toCssUnit(itemHeight);
34396
34468
  }
34397
34469
  } else {
34398
- if (itemWidth) {
34399
- stys.width = visibleItems.length === 1 ? '100%' : toCssUnit(itemWidth);
34470
+ if (itemWidth && visibleItems.length > 1) {
34471
+ isFill = false;
34472
+ stys.width = toCssUnit(itemWidth);
34400
34473
  }
34401
34474
  }
34402
34475
  itemVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
@@ -34407,22 +34480,23 @@ const Select = VxeSelect;
34407
34480
  'is--border': border,
34408
34481
  'is--height': itemHeight,
34409
34482
  'is--width': itemWidth,
34410
- 'is--fill': isVisible && !itemHeight && !itemWidth,
34411
- 'is--handle': index > 0,
34412
- 'is--expand': isExpand,
34413
- 'is--hidden': !isVisible
34483
+ 'is--visible': isExpand,
34484
+ 'is--hidden': !isExpand,
34485
+ 'is--fill': isExpand && isFill
34414
34486
  }],
34415
34487
  style: stys
34416
- }, [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', {
34417
34489
  itemid: id,
34418
34490
  class: 'vxe-split-pane--wrapper'
34419
34491
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
34420
34492
  class: 'vxe-split-pane--inner'
34421
34493
  }, defaultSlot ? callSlot(defaultSlot, {
34422
34494
  name,
34423
- isVisible,
34424
34495
  isExpand
34425
- }) : [])]), isFoldNext && index < itemList.length - 1 ? renderHandleBar(item) : renderEmptyElement($xeSplit)]));
34496
+ }) : [])])]));
34497
+ if (nextItem) {
34498
+ itemVNs.push(renderHandleBar(prevItem, nextItem));
34499
+ }
34426
34500
  });
34427
34501
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
34428
34502
  class: 'vxe-split-wrapper'
@@ -34462,7 +34536,12 @@ const Select = VxeSelect;
34462
34536
  class: 'vxe-split--resizable-split-number-prev'
34463
34537
  }), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
34464
34538
  class: 'vxe-split--resizable-split-number-next'
34465
- })])] : [])]);
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
+ })])]);
34466
34545
  };
34467
34546
  const itemFlag = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);
34468
34547
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.items ? props.items.length : -1, () => {
@@ -34475,10 +34554,23 @@ const Select = VxeSelect;
34475
34554
  loadItem(props.items || []);
34476
34555
  });
34477
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;
34478
34562
  if (props.items && props.items.length) {
34479
34563
  errLog('vxe.error.errConflicts', ['<vxe-split-pane ...>', 'items']);
34480
34564
  }
34481
- 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
+ });
34482
34574
  recalculate();
34483
34575
  });
34484
34576
  let resizeObserver;
@@ -34493,6 +34585,10 @@ const Select = VxeSelect;
34493
34585
  });
34494
34586
  resizeObserver.observe(el);
34495
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
+ }
34496
34592
  globalEvents.on($xeSplit, 'resize', handleGlobalResizeEvent);
34497
34593
  });
34498
34594
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onUnmounted)(() => {
@@ -34558,7 +34654,6 @@ function destroySplitItem($xeSplit, paneConfig) {
34558
34654
  name: [Number, String],
34559
34655
  width: [Number, String],
34560
34656
  height: [Number, String],
34561
- showAction: Boolean,
34562
34657
  minWidth: {
34563
34658
  type: [Number, String],
34564
34659
  default: () => null
@@ -34566,7 +34661,9 @@ function destroySplitItem($xeSplit, paneConfig) {
34566
34661
  minHeight: {
34567
34662
  type: [Number, String],
34568
34663
  default: () => null
34569
- }
34664
+ },
34665
+ // 已废弃
34666
+ showAction: Boolean
34570
34667
  },
34571
34668
  emits: [],
34572
34669
  setup(props, context) {
@@ -34585,7 +34682,6 @@ function destroySplitItem($xeSplit, paneConfig) {
34585
34682
  minWidth: props.minWidth,
34586
34683
  minHeight: props.minHeight,
34587
34684
  showAction: props.showAction,
34588
- isVisible: true,
34589
34685
  isExpand: true,
34590
34686
  renderWidth: 0,
34591
34687
  resizeWidth: 0,
@@ -36370,6 +36466,9 @@ const scrollbarOffsetSize = 20;
36370
36466
  $tabs: $xeTabs
36371
36467
  }, params));
36372
36468
  };
36469
+ const emitModel = value => {
36470
+ emit('update:modelValue', value);
36471
+ };
36373
36472
  const addInitName = (name, evnt) => {
36374
36473
  const {
36375
36474
  initNames
@@ -36409,7 +36508,7 @@ const scrollbarOffsetSize = 20;
36409
36508
  if (!validVal) {
36410
36509
  activeName = list[0].name;
36411
36510
  addInitName(activeName, null);
36412
- emit('update:modelValue', activeName);
36511
+ emitModel(activeName);
36413
36512
  }
36414
36513
  }
36415
36514
  reactData.activeName = activeName;
@@ -36443,7 +36542,7 @@ const scrollbarOffsetSize = 20;
36443
36542
  })).then(status => {
36444
36543
  if (status) {
36445
36544
  reactData.activeName = name;
36446
- emit('update:modelValue', value);
36545
+ emitModel(value);
36447
36546
  addInitName(name, evnt);
36448
36547
  dispatchEvent('change', {
36449
36548
  value,
@@ -36709,7 +36808,7 @@ const scrollbarOffsetSize = 20;
36709
36808
  const name = item.name;
36710
36809
  const value = name;
36711
36810
  reactData.activeName = name;
36712
- emit('update:modelValue', value);
36811
+ emitModel(value);
36713
36812
  addInitName(name, null);
36714
36813
  }
36715
36814
  }
@@ -41670,6 +41769,9 @@ const saveLocalFile = options => {
41670
41769
  $upload: $xeUpload
41671
41770
  }, params));
41672
41771
  };
41772
+ const emitModel = value => {
41773
+ emit('update:modelValue', value);
41774
+ };
41673
41775
  const handleChange = value => {
41674
41776
  const {
41675
41777
  singleMode,
@@ -41684,13 +41786,15 @@ const saveLocalFile = options => {
41684
41786
  if (url) {
41685
41787
  const urlObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().parseUrl(url);
41686
41788
  if (!urlObj.searchQuery[nameProp]) {
41687
- return `${url}${url.indexOf('?') === -1 ? '?' : '&'}${nameProp}=${encodeURIComponent(item[nameProp] || '')}`;
41789
+ if (url.indexOf('blob:') === -1) {
41790
+ return `${url}${url.indexOf('?') === -1 ? '?' : '&'}${nameProp}=${encodeURIComponent(item[nameProp] || '')}`;
41791
+ }
41688
41792
  }
41689
41793
  }
41690
41794
  return url;
41691
41795
  });
41692
41796
  }
41693
- emit('update:modelValue', singleMode ? restList[0] || null : restList);
41797
+ emitModel(singleMode ? restList[0] || null : restList);
41694
41798
  };
41695
41799
  const getThumbnailFileUrl = item => {
41696
41800
  const getThumbnailUrlFn = props.getThumbnailUrlMethod || getConfig().upload.getThumbnailUrlMethod;