vxe-pc-ui 3.9.0 → 3.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 (51) 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 +239 -139
  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/upload/src/upload.js +3 -1
  11. package/es/vxe-split/style.css +82 -45
  12. package/es/vxe-split/style.min.css +1 -1
  13. package/lib/icon/style/style.css +1 -1
  14. package/lib/icon/style/style.min.css +1 -1
  15. package/lib/index.umd.js +267 -166
  16. package/lib/index.umd.min.js +1 -1
  17. package/lib/split/src/split-pane.js +3 -3
  18. package/lib/split/src/split-pane.min.js +1 -1
  19. package/lib/split/src/split.js +258 -160
  20. package/lib/split/src/split.min.js +1 -1
  21. package/lib/split/style/style.css +82 -45
  22. package/lib/split/style/style.min.css +1 -1
  23. package/lib/style.css +1 -1
  24. package/lib/style.min.css +1 -1
  25. package/lib/ui/index.js +1 -1
  26. package/lib/ui/index.min.js +1 -1
  27. package/lib/ui/src/log.js +1 -1
  28. package/lib/ui/src/log.min.js +1 -1
  29. package/lib/upload/src/upload.js +3 -1
  30. package/lib/upload/src/upload.min.js +1 -1
  31. package/lib/vxe-split/style/style.css +82 -45
  32. package/lib/vxe-split/style/style.min.css +1 -1
  33. package/package.json +1 -1
  34. package/packages/split/src/split-pane.ts +4 -3
  35. package/packages/split/src/split.ts +236 -141
  36. package/packages/upload/src/upload.ts +3 -1
  37. package/styles/components/split.scss +109 -88
  38. package/types/components/split-pane.d.ts +11 -2
  39. package/types/components/split.d.ts +26 -20
  40. /package/es/icon/{iconfont.1756083812307.ttf → iconfont.1756133785685.ttf} +0 -0
  41. /package/es/icon/{iconfont.1756083812307.woff → iconfont.1756133785685.woff} +0 -0
  42. /package/es/icon/{iconfont.1756083812307.woff2 → iconfont.1756133785685.woff2} +0 -0
  43. /package/es/{iconfont.1756083812307.ttf → iconfont.1756133785685.ttf} +0 -0
  44. /package/es/{iconfont.1756083812307.woff → iconfont.1756133785685.woff} +0 -0
  45. /package/es/{iconfont.1756083812307.woff2 → iconfont.1756133785685.woff2} +0 -0
  46. /package/lib/icon/style/{iconfont.1756083812307.ttf → iconfont.1756133785685.ttf} +0 -0
  47. /package/lib/icon/style/{iconfont.1756083812307.woff → iconfont.1756133785685.woff} +0 -0
  48. /package/lib/icon/style/{iconfont.1756083812307.woff2 → iconfont.1756133785685.woff2} +0 -0
  49. /package/lib/{iconfont.1756083812307.ttf → iconfont.1756133785685.ttf} +0 -0
  50. /package/lib/{iconfont.1756083812307.woff → iconfont.1756133785685.woff} +0 -0
  51. /package/lib/{iconfont.1756083812307.woff2 → iconfont.1756133785685.woff2} +0 -0
@@ -52,7 +52,9 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
52
52
  var xID = _xeUtils.default.uniqueId();
53
53
  var reactData = {
54
54
  staticItems: [],
55
- itemList: []
55
+ itemList: [],
56
+ barWidth: 0,
57
+ barHeight: 0
56
58
  };
57
59
  var internalData = {
58
60
  wrapperWidth: 0,
@@ -101,7 +103,7 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
101
103
  var $xeSplit = this;
102
104
  var reactData = $xeSplit.reactData;
103
105
  return reactData.itemList.filter(function (item) {
104
- return item.isVisible;
106
+ return item.isExpand;
105
107
  });
106
108
  },
107
109
  computeAutoItems: function computeAutoItems() {
@@ -152,10 +154,21 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
152
154
  var $xeSplit = this;
153
155
  var props = $xeSplit;
154
156
  var reactData = $xeSplit.reactData;
157
+ var actionOpts = $xeSplit.computeActionOpts;
158
+ var showPrevButton = actionOpts.showPrevButton,
159
+ showNextButton = actionOpts.showNextButton;
155
160
  if (props.items && props.items.length) {
156
161
  (0, _log.errLog)('vxe.error.errConflicts', ['<vxe-split-pane ...>', 'items']);
157
162
  }
158
- reactData.itemList = reactData.staticItems;
163
+ reactData.itemList = reactData.staticItems || [];
164
+ if ((showPrevButton || showNextButton) && reactData.itemList.length > 2) {
165
+ (0, _log.errLog)('vxe.error.modelConflicts', ['action-config.showPrevButton | action-config.showNextButton', '<vxe-split-pane ...> Only supports 2 panel']);
166
+ }
167
+ reactData.itemList.forEach(function (item) {
168
+ if (item.showAction) {
169
+ (0, _log.warnLog)('vxe.error.removeProp', ['showAction']);
170
+ }
171
+ });
159
172
  $xeSplit.recalculate();
160
173
  }
161
174
  },
@@ -188,7 +201,6 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
188
201
  var itemList = reactData.itemList;
189
202
  itemList.forEach(function (item) {
190
203
  item.isExpand = true;
191
- item.isVisible = true;
192
204
  item.foldHeight = 0;
193
205
  item.foldWidth = 0;
194
206
  item.resizeHeight = 0;
@@ -202,7 +214,6 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
202
214
  var reactData = $xeSplit.reactData;
203
215
  var staticItems = reactData.staticItems;
204
216
  var itemDef = {
205
- isVisible: true,
206
217
  isExpand: true,
207
218
  renderWidth: 0,
208
219
  resizeWidth: 0,
@@ -247,6 +258,7 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
247
258
  var vertical = props.vertical;
248
259
  var itemList = reactData.itemList;
249
260
  var el = $xeSplit.$refs.refElem;
261
+ var barInfoElem = $xeSplit.$refs.refBarInfoElem;
250
262
  if (!el) {
251
263
  return;
252
264
  }
@@ -255,6 +267,12 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
255
267
  if (!wWidth || !wHeight) {
256
268
  return;
257
269
  }
270
+ if (barInfoElem) {
271
+ reactData.barWidth = barInfoElem.offsetWidth;
272
+ reactData.barHeight = barInfoElem.offsetHeight;
273
+ }
274
+ var contentWidth = wWidth - (vertical ? 0 : reactData.barWidth * (itemList.length - 1));
275
+ var contentHeight = wHeight - (vertical ? reactData.barHeight * (itemList.length - 1) : 0);
258
276
  var itemOpts = $xeSplit.computeItemOpts;
259
277
  var allMinWidth = _xeUtils.default.toNumber(itemOpts.minWidth);
260
278
  var allMinHeight = _xeUtils.default.toNumber(itemOpts.minHeight);
@@ -266,7 +284,7 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
266
284
  var itemHeight = 0;
267
285
  if (height) {
268
286
  if ((0, _dom.isScale)(height)) {
269
- itemHeight = wHeight * _xeUtils.default.toNumber(height) / 100;
287
+ itemHeight = contentHeight * _xeUtils.default.toNumber(height) / 100;
270
288
  } else {
271
289
  itemHeight = _xeUtils.default.toNumber(height);
272
290
  }
@@ -277,7 +295,7 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
277
295
  countHeight += itemHeight;
278
296
  });
279
297
  if (residueItems.length) {
280
- var reMeanHeight = (wHeight - countHeight) / residueItems.length;
298
+ var reMeanHeight = (contentHeight - countHeight) / residueItems.length;
281
299
  residueItems.forEach(function (item) {
282
300
  item.renderHeight = Math.max(_xeUtils.default.toNumber((0, _utils.getGlobalDefaultConfig)(item.minHeight, allMinHeight)), reMeanHeight);
283
301
  });
@@ -289,7 +307,7 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
289
307
  var itemWidth = 0;
290
308
  if (width) {
291
309
  if ((0, _dom.isScale)(width)) {
292
- itemWidth = wWidth * _xeUtils.default.toNumber(width) / 100;
310
+ itemWidth = contentWidth * _xeUtils.default.toNumber(width) / 100;
293
311
  } else {
294
312
  itemWidth = _xeUtils.default.toNumber(width);
295
313
  }
@@ -300,14 +318,14 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
300
318
  countWidth += itemWidth;
301
319
  });
302
320
  if (residueItems.length) {
303
- var reMeanWidth = (wWidth - countWidth) / residueItems.length;
321
+ var reMeanWidth = (contentWidth - countWidth) / residueItems.length;
304
322
  residueItems.forEach(function (item) {
305
323
  item.renderWidth = Math.max(_xeUtils.default.toNumber((0, _utils.getGlobalDefaultConfig)(item.minWidth, allMinWidth)), reMeanWidth);
306
324
  });
307
325
  }
308
326
  }
309
- internalData.wrapperWidth = wWidth;
310
- internalData.wrapperHeight = wHeight;
327
+ internalData.wrapperWidth = contentWidth;
328
+ internalData.wrapperHeight = contentHeight;
311
329
  });
312
330
  },
313
331
  dragEvent: function dragEvent(evnt) {
@@ -327,35 +345,31 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
327
345
  if (!el) {
328
346
  return;
329
347
  }
330
- var itemId = handleEl.getAttribute('itemid');
331
- var itemIndex = _xeUtils.default.findIndexOf(itemList, function (item) {
332
- return item.id === itemId;
333
- });
334
- var item = itemList[itemIndex];
335
- if (!item) {
348
+ var prevEl = handleEl.previousElementSibling;
349
+ var nextEl = handleEl.nextElementSibling;
350
+ if (!prevEl || !nextEl) {
336
351
  return;
337
352
  }
338
- if (!item.isExpand) {
353
+ var prevId = prevEl.getAttribute('itemid');
354
+ var nextId = nextEl.getAttribute('itemid');
355
+ var prevItem = itemList.find(function (item) {
356
+ return item.id === prevId;
357
+ });
358
+ var nextItem = itemList.find(function (item) {
359
+ return item.id === nextId;
360
+ });
361
+ if (!prevItem || !nextItem) {
339
362
  return;
340
363
  }
341
364
  var containerRect = el.getBoundingClientRect();
342
365
  var barRect = barEl.getBoundingClientRect();
343
366
  var rsSplitLineEl = $xeSplit.$refs.refResizableSplitTip;
344
367
  var rsSplitTipEl = rsSplitLineEl ? rsSplitLineEl.children[0] : null;
345
- var isFoldNext = $xeSplit.computeIsFoldNext;
346
368
  var itemOpts = $xeSplit.computeItemOpts;
347
369
  var resizeOpts = $xeSplit.computeResizeOpts;
348
370
  var immediate = resizeOpts.immediate;
349
371
  var allMinWidth = _xeUtils.default.toNumber(itemOpts.minWidth);
350
372
  var allMinHeight = _xeUtils.default.toNumber(itemOpts.minHeight);
351
- var targetItem = itemList[itemIndex + (isFoldNext ? 1 : -1)];
352
- var prevItem = itemList[itemIndex + (isFoldNext ? 0 : -1)];
353
- var nextItem = itemList[itemIndex + (isFoldNext ? 1 : 0)];
354
- var prevEl = targetItem ? el.querySelector(".vxe-split-pane[itemid=\"".concat(prevItem.id, "\"]")) : null;
355
- var nextEl = item ? el.querySelector(".vxe-split-pane[itemid=\"".concat(nextItem.id, "\"]")) : null;
356
- if (!prevEl || !nextEl) {
357
- return;
358
- }
359
373
  var barOffsetX = Math.ceil(barRect.width - (evnt.clientX - barRect.left));
360
374
  var barOffsetY = Math.ceil(evnt.clientY - barRect.top);
361
375
  var prevWidth = prevEl.offsetWidth;
@@ -492,8 +506,6 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
492
506
  handleReStyle(evnt);
493
507
  }
494
508
  $xeSplit.dispatchEvent('resize-drag', {
495
- item: item,
496
- name: item.name,
497
509
  prevItem: prevItem,
498
510
  nextItem: nextItem,
499
511
  offsetHeight: targetOffsetHeight,
@@ -513,8 +525,6 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
513
525
  handleUpdate();
514
526
  (0, _dom.removeClass)(el, 'is--drag');
515
527
  $xeSplit.dispatchEvent('resize-end', {
516
- item: item,
517
- name: item.name,
518
528
  prevItem: prevItem,
519
529
  nextItem: nextItem,
520
530
  offsetHeight: targetOffsetHeight,
@@ -529,173 +539,250 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
529
539
  handleDrag(evnt);
530
540
  (0, _dom.addClass)(el, 'is--drag');
531
541
  $xeSplit.dispatchEvent('resize-start', {
532
- item: item,
533
- name: item.name,
534
542
  prevItem: prevItem,
535
543
  nextItem: nextItem
536
544
  }, evnt);
537
545
  },
538
- handleItemActionEvent: function handleItemActionEvent(evnt) {
546
+ handleItemActionEvent: function handleItemActionEvent(evnt, prevItem, nextItem, isNext) {
539
547
  var $xeSplit = this;
540
548
  var props = $xeSplit;
549
+ var vertical = props.vertical;
550
+ var expanded = false;
551
+ var item = prevItem;
552
+ if (isNext) {
553
+ item = nextItem;
554
+ expanded = !nextItem.isExpand;
555
+ nextItem.isExpand = expanded;
556
+ } else {
557
+ expanded = !prevItem.isExpand;
558
+ prevItem.isExpand = expanded;
559
+ }
560
+ if (vertical) {
561
+ if (prevItem.isExpand && nextItem.isExpand) {
562
+ prevItem.foldHeight = 0;
563
+ nextItem.foldHeight = 0;
564
+ } else if (prevItem.isExpand) {
565
+ nextItem.foldHeight = 0;
566
+ prevItem.foldHeight = (prevItem.resizeHeight || prevItem.renderHeight) + (nextItem.resizeHeight || nextItem.renderHeight);
567
+ } else {
568
+ prevItem.foldHeight = 0;
569
+ nextItem.foldHeight = (prevItem.resizeHeight || prevItem.renderHeight) + (nextItem.resizeHeight || nextItem.renderHeight);
570
+ }
571
+ } else {
572
+ if (prevItem.isExpand && nextItem.isExpand) {
573
+ prevItem.foldWidth = 0;
574
+ nextItem.foldWidth = 0;
575
+ } else if (prevItem.isExpand) {
576
+ nextItem.foldWidth = 0;
577
+ prevItem.foldWidth = (prevItem.resizeWidth || prevItem.renderWidth) + (nextItem.resizeWidth || nextItem.renderWidth);
578
+ } else {
579
+ prevItem.foldWidth = 0;
580
+ nextItem.foldWidth = (prevItem.resizeWidth || prevItem.renderWidth) + (nextItem.resizeWidth || nextItem.renderWidth);
581
+ }
582
+ }
583
+ $xeSplit.dispatchEvent('toggle-expand', {
584
+ prevItem: prevItem,
585
+ nextItem: nextItem,
586
+ expanded: expanded,
587
+ item: item
588
+ }, evnt);
589
+ $xeSplit.recalculate();
590
+ },
591
+ handlePrevActionDblclickEvent: function handlePrevActionDblclickEvent(evnt) {
592
+ var $xeSplit = this;
541
593
  var reactData = $xeSplit.reactData;
542
- var el = $xeSplit.$refs.refElem;
543
- if (!el) {
544
- return;
594
+ var itemList = reactData.itemList;
595
+ var actionOpts = $xeSplit.computeActionOpts;
596
+ var btnEl = evnt.currentTarget;
597
+ var btnWrapperEl = btnEl.parentElement;
598
+ var handleEl = btnWrapperEl.parentElement;
599
+ var prevEl = handleEl.previousElementSibling;
600
+ var prevId = prevEl.getAttribute('itemid');
601
+ var prevItem = itemList.find(function (item) {
602
+ return item.id === prevId;
603
+ });
604
+ var nextEl = handleEl.nextElementSibling;
605
+ var nextId = nextEl.getAttribute('itemid');
606
+ var nextItem = itemList.find(function (item) {
607
+ return item.id === nextId;
608
+ });
609
+ if (actionOpts.trigger === 'dblclick') {
610
+ if (prevItem && nextItem && nextItem.isExpand) {
611
+ $xeSplit.handleItemActionEvent(evnt, prevItem, nextItem, false);
612
+ }
545
613
  }
546
- var vertical = props.vertical;
614
+ $xeSplit.dispatchEvent('action-dblclick', {
615
+ prevItem: prevItem,
616
+ nextItem: nextItem
617
+ }, evnt);
618
+ },
619
+ handlePrevActionClickEvent: function handlePrevActionClickEvent(evnt) {
620
+ var $xeSplit = this;
621
+ var reactData = $xeSplit.reactData;
547
622
  var itemList = reactData.itemList;
548
- var isFoldNext = $xeSplit.computeIsFoldNext;
623
+ var actionOpts = $xeSplit.computeActionOpts;
549
624
  var btnEl = evnt.currentTarget;
550
- var handleEl = btnEl.parentElement;
551
- var itemId = handleEl.getAttribute('itemid');
552
- var itemIndex = _xeUtils.default.findIndexOf(itemList, function (item) {
553
- return item.id === itemId;
625
+ var btnWrapperEl = btnEl.parentElement;
626
+ var handleEl = btnWrapperEl.parentElement;
627
+ var prevEl = handleEl.previousElementSibling;
628
+ var prevId = prevEl.getAttribute('itemid');
629
+ var prevItem = itemList.find(function (item) {
630
+ return item.id === prevId;
554
631
  });
555
- var item = itemList[itemIndex];
556
- var targetItem = itemList[itemIndex + (isFoldNext ? 1 : -1)];
557
- if (item) {
558
- var showAction = item.showAction,
559
- isExpand = item.isExpand;
560
- if (showAction) {
561
- if (vertical) {
562
- if (targetItem) {
563
- targetItem.isVisible = !isExpand;
564
- targetItem.foldHeight = 0;
565
- item.isExpand = !isExpand;
566
- item.isVisible = true;
567
- item.foldHeight = isExpand ? (targetItem.resizeHeight || targetItem.renderHeight) + (item.resizeHeight || item.renderHeight) : 0;
568
- }
569
- } else {
570
- if (targetItem) {
571
- targetItem.isVisible = !isExpand;
572
- targetItem.foldWidth = 0;
573
- item.isExpand = !isExpand;
574
- item.isVisible = true;
575
- item.foldWidth = isExpand ? (targetItem.resizeWidth || targetItem.renderWidth) + (item.resizeWidth || item.renderWidth) : 0;
576
- }
577
- }
578
- $xeSplit.dispatchEvent('toggle-expand', {
579
- item: item,
580
- name: item.name,
581
- targetItem: targetItem,
582
- targetName: targetItem ? targetItem.name : '',
583
- expanded: item.isExpand
584
- }, evnt);
585
- $xeSplit.recalculate();
632
+ var nextEl = handleEl.nextElementSibling;
633
+ var nextId = nextEl.getAttribute('itemid');
634
+ var nextItem = itemList.find(function (item) {
635
+ return item.id === nextId;
636
+ });
637
+ if (actionOpts.trigger !== 'dblclick') {
638
+ if (prevItem && nextItem && nextItem.isExpand) {
639
+ $xeSplit.handleItemActionEvent(evnt, prevItem, nextItem, false);
586
640
  }
587
641
  }
642
+ $xeSplit.dispatchEvent('action-click', {
643
+ prevItem: prevItem,
644
+ nextItem: nextItem
645
+ }, evnt);
588
646
  },
589
- handleActionDblclickEvent: function handleActionDblclickEvent(evnt) {
647
+ handleNextActionDblclickEvent: function handleNextActionDblclickEvent(evnt) {
590
648
  var $xeSplit = this;
591
649
  var reactData = $xeSplit.reactData;
592
650
  var itemList = reactData.itemList;
593
651
  var actionOpts = $xeSplit.computeActionOpts;
594
652
  var btnEl = evnt.currentTarget;
595
- var handleEl = btnEl.parentElement;
596
- var itemId = handleEl.getAttribute('itemid');
597
- var itemIndex = _xeUtils.default.findIndexOf(itemList, function (item) {
598
- return item.id === itemId;
653
+ var btnWrapperEl = btnEl.parentElement;
654
+ var handleEl = btnWrapperEl.parentElement;
655
+ var prevEl = handleEl.previousElementSibling;
656
+ var prevId = prevEl.getAttribute('itemid');
657
+ var prevItem = itemList.find(function (item) {
658
+ return item.id === prevId;
659
+ });
660
+ var nextEl = handleEl.nextElementSibling;
661
+ var nextId = nextEl.getAttribute('itemid');
662
+ var nextItem = itemList.find(function (item) {
663
+ return item.id === nextId;
599
664
  });
600
- var item = itemList[itemIndex];
601
665
  if (actionOpts.trigger === 'dblclick') {
602
- $xeSplit.handleItemActionEvent(evnt);
666
+ if (prevItem && nextItem && prevItem.isExpand) {
667
+ $xeSplit.handleItemActionEvent(evnt, prevItem, nextItem, true);
668
+ }
603
669
  }
604
670
  $xeSplit.dispatchEvent('action-dblclick', {
605
- item: item,
606
- name: item ? item.name : ''
671
+ prevItem: prevItem,
672
+ nextItem: nextItem
607
673
  }, evnt);
608
674
  },
609
- handleActionClickEvent: function handleActionClickEvent(evnt) {
675
+ handleNextActionClickEvent: function handleNextActionClickEvent(evnt) {
610
676
  var $xeSplit = this;
611
677
  var reactData = $xeSplit.reactData;
612
678
  var itemList = reactData.itemList;
613
679
  var actionOpts = $xeSplit.computeActionOpts;
614
680
  var btnEl = evnt.currentTarget;
615
- var handleEl = btnEl.parentElement;
616
- var itemId = handleEl.getAttribute('itemid');
617
- var itemIndex = _xeUtils.default.findIndexOf(itemList, function (item) {
618
- return item.id === itemId;
681
+ var btnWrapperEl = btnEl.parentElement;
682
+ var handleEl = btnWrapperEl.parentElement;
683
+ var prevEl = handleEl.previousElementSibling;
684
+ var prevId = prevEl.getAttribute('itemid');
685
+ var prevItem = itemList.find(function (item) {
686
+ return item.id === prevId;
687
+ });
688
+ var nextEl = handleEl.nextElementSibling;
689
+ var nextId = nextEl.getAttribute('itemid');
690
+ var nextItem = itemList.find(function (item) {
691
+ return item.id === nextId;
619
692
  });
620
- var item = itemList[itemIndex];
621
693
  if (actionOpts.trigger !== 'dblclick') {
622
- $xeSplit.handleItemActionEvent(evnt);
694
+ if (prevItem && nextItem && prevItem.isExpand) {
695
+ $xeSplit.handleItemActionEvent(evnt, prevItem, nextItem, true);
696
+ }
623
697
  }
624
698
  $xeSplit.dispatchEvent('action-click', {
625
- item: item,
626
- name: item ? item.name : ''
699
+ prevItem: prevItem,
700
+ nextItem: nextItem
627
701
  }, evnt);
628
702
  },
629
703
  handleGlobalResizeEvent: function handleGlobalResizeEvent() {
630
704
  var $xeSplit = this;
631
705
  $xeSplit.recalculate();
632
706
  },
633
- getDefaultActionIcon: function getDefaultActionIcon(item) {
707
+ getActionIcon: function getActionIcon(prevItem, nextItem, isNext) {
634
708
  var $xeSplit = this;
635
709
  var props = $xeSplit;
636
710
  var vertical = props.vertical;
637
- var showAction = item.showAction,
638
- isExpand = item.isExpand;
639
- var isFoldNext = $xeSplit.computeIsFoldNext;
640
711
  var topIcon = 'SPLIT_TOP_ACTION';
641
712
  var bottomIcon = 'SPLIT_BOTTOM_ACTION';
642
713
  var leftIcon = 'SPLIT_LEFT_ACTION';
643
714
  var rightIcon = 'SPLIT_RIGHT_ACTION';
644
- if (showAction) {
645
- var iconName = '';
646
- if (isFoldNext) {
647
- if (vertical) {
648
- iconName = isExpand ? bottomIcon : topIcon;
649
- } else {
650
- iconName = isExpand ? rightIcon : leftIcon;
651
- }
715
+ var iconName = '';
716
+ if (vertical) {
717
+ if (isNext) {
718
+ iconName = nextItem.isExpand ? bottomIcon : topIcon;
652
719
  } else {
653
- if (vertical) {
654
- iconName = isExpand ? topIcon : bottomIcon;
655
- } else {
656
- iconName = isExpand ? leftIcon : rightIcon;
657
- }
720
+ iconName = prevItem.isExpand ? topIcon : bottomIcon;
658
721
  }
659
- if (iconName) {
660
- return (0, _ui.getIcon)()[iconName];
722
+ } else {
723
+ if (isNext) {
724
+ iconName = nextItem.isExpand ? rightIcon : leftIcon;
725
+ } else {
726
+ iconName = prevItem.isExpand ? leftIcon : rightIcon;
661
727
  }
662
728
  }
729
+ if (iconName) {
730
+ return (0, _ui.getIcon)()[iconName];
731
+ }
663
732
  return '';
664
733
  },
665
734
  //
666
735
  // Render
667
736
  //
668
- renderHandleBar: function renderHandleBar(h, item) {
737
+ renderHandleBar: function renderHandleBar(h, prevItem, nextItem) {
669
738
  var $xeSplit = this;
739
+ var props = $xeSplit;
740
+ var reactData = $xeSplit.reactData;
741
+ var border = props.border,
742
+ resize = props.resize,
743
+ vertical = props.vertical;
744
+ var itemList = reactData.itemList;
670
745
  var barStyle = $xeSplit.computeBarStyle;
671
746
  var actionOpts = $xeSplit.computeActionOpts;
672
- var isFoldNext = $xeSplit.computeIsFoldNext;
673
- var id = item.id,
674
- isExpand = item.isExpand,
675
- showAction = item.showAction;
676
- var btnOns = {};
677
- if (actionOpts.trigger === 'dblclick') {
678
- btnOns.dblclick = $xeSplit.handleItemActionEvent;
679
- } else {
680
- btnOns.click = $xeSplit.handleItemActionEvent;
681
- }
747
+ var direction = actionOpts.direction;
748
+ var showPrevButton = _xeUtils.default.isBoolean(actionOpts.showPrevButton) ? actionOpts.showPrevButton : itemList.some(function (item) {
749
+ return item.showAction;
750
+ });
751
+ var showNextButton = _xeUtils.default.isBoolean(actionOpts.showNextButton) ? actionOpts.showNextButton : direction === 'next' && itemList.some(function (item) {
752
+ return item.showAction;
753
+ });
754
+ var resizeOpts = $xeSplit.computeResizeOpts;
755
+ var immediate = resizeOpts.immediate;
682
756
  return h('div', {
683
- attrs: {
684
- itemid: id
685
- },
686
- class: ['vxe-split-pane-handle', isFoldNext ? 'to--next' : 'to--prev']
757
+ class: ['vxe-split-pane-handle', vertical ? 'is--vertical' : 'is--horizontal', immediate ? 'is-resize--immediate' : 'is-resize--lazy', {
758
+ 'is--resize': resize,
759
+ 'is--border': border
760
+ }]
687
761
  }, [h('div', {
688
762
  class: 'vxe-split-pane-handle-bar',
689
763
  style: barStyle,
690
764
  on: {
691
765
  mousedown: $xeSplit.dragEvent
692
766
  }
693
- }), showAction ? h('span', {
767
+ }), itemList.length === 2 ? h('div', {
768
+ class: 'vxe-split-pane-action-btn-wrapper'
769
+ }, [showPrevButton && nextItem.isExpand ? h('div', {
770
+ class: 'vxe-split-pane-action-btn',
771
+ on: {
772
+ dblclick: $xeSplit.handlePrevActionDblclickEvent,
773
+ click: $xeSplit.handlePrevActionClickEvent
774
+ }
775
+ }, [h('i', {
776
+ class: $xeSplit.getActionIcon(prevItem, nextItem, false)
777
+ })]) : (0, _ui.renderEmptyElement)($xeSplit), showNextButton && prevItem.isExpand ? h('div', {
694
778
  class: 'vxe-split-pane-action-btn',
695
- on: btnOns
779
+ on: {
780
+ dblclick: $xeSplit.handleNextActionDblclickEvent,
781
+ click: $xeSplit.handleNextActionClickEvent
782
+ }
696
783
  }, [h('i', {
697
- class: (isExpand ? actionOpts.openIcon : actionOpts.closeIcon) || $xeSplit.getDefaultActionIcon(item)
698
- })]) : (0, _ui.renderEmptyElement)($xeSplit)]);
784
+ class: $xeSplit.getActionIcon(prevItem, nextItem, true)
785
+ })]) : (0, _ui.renderEmptyElement)($xeSplit)]) : (0, _ui.renderEmptyElement)($xeSplit)]);
699
786
  },
700
787
  renderItems: function renderItems(h) {
701
788
  var $xeSplit = this;
@@ -710,44 +797,45 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
710
797
  var immediate = resizeOpts.immediate;
711
798
  var visibleItems = $xeSplit.computeVisibleItems;
712
799
  var autoItems = $xeSplit.computeAutoItems.autoItems;
713
- var isFoldNext = $xeSplit.computeIsFoldNext;
714
800
  var itemVNs = [];
715
- itemList.forEach(function (item, index) {
716
- var id = item.id,
717
- name = item.name,
718
- slots = item.slots,
719
- renderHeight = item.renderHeight,
720
- resizeHeight = item.resizeHeight,
721
- foldHeight = item.foldHeight,
722
- renderWidth = item.renderWidth,
723
- resizeWidth = item.resizeWidth,
724
- foldWidth = item.foldWidth,
725
- isVisible = item.isVisible,
726
- isExpand = item.isExpand;
801
+ itemList.forEach(function (prevItem, index) {
802
+ var id = prevItem.id,
803
+ name = prevItem.name,
804
+ slots = prevItem.slots,
805
+ renderHeight = prevItem.renderHeight,
806
+ resizeHeight = prevItem.resizeHeight,
807
+ foldHeight = prevItem.foldHeight,
808
+ renderWidth = prevItem.renderWidth,
809
+ resizeWidth = prevItem.resizeWidth,
810
+ foldWidth = prevItem.foldWidth,
811
+ isExpand = prevItem.isExpand;
812
+ var nextItem = itemList[index + 1];
727
813
  var defaultSlot = slots ? slots.default : null;
728
814
  var stys = {};
729
- var itemWidth = isVisible ? foldWidth || resizeWidth || renderWidth : 0;
730
- var itemHeight = isVisible ? foldHeight || resizeHeight || renderHeight : 0;
815
+ var itemWidth = isExpand ? foldWidth || resizeWidth || renderWidth : 0;
816
+ var itemHeight = isExpand ? foldHeight || resizeHeight || renderHeight : 0;
731
817
  // 至少存在一个自适应
732
818
  if (autoItems.length === 1) {
733
819
  if (vertical) {
734
- if (!item.height) {
820
+ if (!prevItem.height) {
735
821
  itemHeight = 0;
736
822
  }
737
823
  } else {
738
- if (!item.width) {
824
+ if (!prevItem.width) {
739
825
  itemWidth = 0;
740
826
  }
741
827
  }
742
828
  }
743
- // 当只剩下一个可视区自动占用 100%
829
+ var isFill = true;
744
830
  if (vertical) {
745
- if (itemHeight) {
746
- stys.height = visibleItems.length === 1 ? '100%' : (0, _dom.toCssUnit)(itemHeight);
831
+ if (itemHeight && visibleItems.length > 1) {
832
+ isFill = false;
833
+ stys.height = (0, _dom.toCssUnit)(itemHeight);
747
834
  }
748
835
  } else {
749
- if (itemWidth) {
750
- stys.width = visibleItems.length === 1 ? '100%' : (0, _dom.toCssUnit)(itemWidth);
836
+ if (itemWidth && visibleItems.length > 1) {
837
+ isFill = false;
838
+ stys.width = (0, _dom.toCssUnit)(itemWidth);
751
839
  }
752
840
  }
753
841
  itemVNs.push(h('div', {
@@ -760,13 +848,12 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
760
848
  'is--border': border,
761
849
  'is--height': itemHeight,
762
850
  'is--width': itemWidth,
763
- 'is--fill': isVisible && !itemHeight && !itemWidth,
764
- 'is--handle': index > 0,
765
- 'is--expand': isExpand,
766
- 'is--hidden': !isVisible
851
+ 'is--visible': isExpand,
852
+ 'is--hidden': !isExpand,
853
+ 'is--fill': isExpand && isFill
767
854
  }],
768
855
  style: stys
769
- }, [index && !isFoldNext ? $xeSplit.renderHandleBar(h, item) : (0, _ui.renderEmptyElement)($xeSplit), h('div', {
856
+ }, [h('div', {
770
857
  attrs: {
771
858
  itemid: id
772
859
  },
@@ -775,9 +862,11 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
775
862
  class: 'vxe-split-pane--inner'
776
863
  }, defaultSlot ? $xeSplit.callSlot(defaultSlot, {
777
864
  name: name,
778
- isVisible: isVisible,
779
865
  isExpand: isExpand
780
- }) : [])]), isFoldNext && index < itemList.length - 1 ? $xeSplit.renderHandleBar(h, item) : (0, _ui.renderEmptyElement)($xeSplit)]));
866
+ }) : [])])]));
867
+ if (nextItem) {
868
+ itemVNs.push($xeSplit.renderHandleBar(h, prevItem, nextItem));
869
+ }
781
870
  });
782
871
  return h('div', {
783
872
  class: 'vxe-split-wrapper'
@@ -816,7 +905,12 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
816
905
  class: 'vxe-split--resizable-split-number-prev'
817
906
  }), h('div', {
818
907
  class: 'vxe-split--resizable-split-number-next'
819
- })])] : [])]);
908
+ })])] : []), h('div', {
909
+ class: 'vxe-split--render-vars'
910
+ }, [h('div', {
911
+ ref: 'refBarInfoElem',
912
+ class: 'vxe-split--handle-bar-info'
913
+ })])]);
820
914
  }
821
915
  },
822
916
  created: function created() {
@@ -837,6 +931,10 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
837
931
  if (props.items) {
838
932
  $xeSplit.loadItem(props.items);
839
933
  }
934
+ var actionOpts = $xeSplit.computeActionOpts;
935
+ if (actionOpts.direction) {
936
+ (0, _log.errLog)('vxe.error.delProp', ['action-config.direction', 'action-config.showPrevButton | action-config.showNextButton']);
937
+ }
840
938
  $xeSplit.$nextTick(function () {
841
939
  $xeSplit.recalculate();
842
940
  });