vxe-table 4.6.7 → 4.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/es/custom/src/panel.js +22 -6
  2. package/es/custom/style.css +15 -9
  3. package/es/edit/src/hook.js +6 -4
  4. package/es/icon/style.css +1 -1
  5. package/es/locale/lang/en-US.js +2 -1
  6. package/es/locale/lang/es-ES.js +2 -1
  7. package/es/locale/lang/ja-JP.js +2 -1
  8. package/es/locale/lang/pt-BR.js +2 -1
  9. package/es/locale/lang/zh-CN.js +2 -1
  10. package/es/locale/lang/zh-TC.js +2 -1
  11. package/es/menu/src/hooks.js +6 -5
  12. package/es/style.css +1 -1
  13. package/es/style.min.css +1 -1
  14. package/es/table/src/table.js +14 -3
  15. package/es/tools/log.js +1 -1
  16. package/es/v-x-e-table/index.js +1 -1
  17. package/es/v-x-e-table/src/interceptor.js +1 -1
  18. package/es/vxe-table-custom-module/style.css +15 -9
  19. package/lib/custom/src/panel.js +18 -4
  20. package/lib/custom/src/panel.min.js +1 -1
  21. package/lib/custom/style/style.css +15 -9
  22. package/lib/custom/style/style.min.css +1 -1
  23. package/lib/edit/src/hook.js +7 -4
  24. package/lib/edit/src/hook.min.js +1 -1
  25. package/lib/icon/style/style.css +1 -1
  26. package/lib/icon/style/style.min.css +1 -1
  27. package/lib/index.umd.js +1034 -1004
  28. package/lib/index.umd.min.js +1 -1
  29. package/lib/locale/lang/en-US.js +2 -1
  30. package/lib/locale/lang/en-US.min.js +1 -1
  31. package/lib/locale/lang/en-US.umd.js +2 -1
  32. package/lib/locale/lang/es-ES.js +2 -1
  33. package/lib/locale/lang/es-ES.min.js +1 -1
  34. package/lib/locale/lang/es-ES.umd.js +2 -1
  35. package/lib/locale/lang/ja-JP.js +2 -1
  36. package/lib/locale/lang/ja-JP.min.js +1 -1
  37. package/lib/locale/lang/ja-JP.umd.js +2 -1
  38. package/lib/locale/lang/pt-BR.js +2 -1
  39. package/lib/locale/lang/pt-BR.min.js +1 -1
  40. package/lib/locale/lang/pt-BR.umd.js +2 -1
  41. package/lib/locale/lang/zh-CN.js +2 -1
  42. package/lib/locale/lang/zh-CN.min.js +1 -1
  43. package/lib/locale/lang/zh-CN.umd.js +2 -1
  44. package/lib/locale/lang/zh-HK.min.js +1 -1
  45. package/lib/locale/lang/zh-HK.umd.js +2 -1
  46. package/lib/locale/lang/zh-MO.min.js +1 -1
  47. package/lib/locale/lang/zh-MO.umd.js +2 -1
  48. package/lib/locale/lang/zh-TC.js +2 -1
  49. package/lib/locale/lang/zh-TC.min.js +1 -1
  50. package/lib/locale/lang/zh-TC.umd.js +2 -1
  51. package/lib/locale/lang/zh-TW.min.js +1 -1
  52. package/lib/locale/lang/zh-TW.umd.js +2 -1
  53. package/lib/menu/src/hooks.js +6 -5
  54. package/lib/menu/src/hooks.min.js +1 -1
  55. package/lib/style.css +1 -1
  56. package/lib/style.min.css +1 -1
  57. package/lib/table/src/table.js +14 -3
  58. package/lib/table/src/table.min.js +1 -1
  59. package/lib/tools/log.js +1 -1
  60. package/lib/tools/log.min.js +1 -1
  61. package/lib/v-x-e-table/index.js +1 -1
  62. package/lib/v-x-e-table/index.min.js +1 -1
  63. package/lib/v-x-e-table/src/interceptor.js +1 -1
  64. package/lib/v-x-e-table/src/interceptor.min.js +1 -1
  65. package/lib/vxe-table-custom-module/style/style.css +15 -9
  66. package/lib/vxe-table-custom-module/style/style.min.css +1 -1
  67. package/package.json +1 -1
  68. package/packages/custom/src/panel.ts +22 -6
  69. package/packages/edit/src/hook.ts +6 -4
  70. package/packages/locale/lang/en-US.ts +2 -1
  71. package/packages/locale/lang/es-ES.ts +2 -1
  72. package/packages/locale/lang/ja-JP.ts +2 -1
  73. package/packages/locale/lang/pt-BR.ts +2 -1
  74. package/packages/locale/lang/zh-CN.ts +2 -1
  75. package/packages/locale/lang/zh-TC.ts +2 -1
  76. package/packages/menu/src/hooks.ts +6 -5
  77. package/packages/table/src/table.ts +16 -3
  78. package/packages/v-x-e-table/src/interceptor.ts +1 -1
  79. package/styles/custom.scss +14 -2
  80. package/types/module/edit.d.ts +1 -1
  81. package/types/module/menu.d.ts +1 -0
  82. package/types/table.d.ts +6 -0
  83. package/types/v-x-e-table/interceptor.d.ts +2 -2
  84. /package/es/icon/style/{iconfont.1714444998024.ttf → iconfont.1714487458874.ttf} +0 -0
  85. /package/es/icon/style/{iconfont.1714444998024.woff → iconfont.1714487458874.woff} +0 -0
  86. /package/es/icon/style/{iconfont.1714444998024.woff2 → iconfont.1714487458874.woff2} +0 -0
  87. /package/es/{iconfont.1714444998024.ttf → iconfont.1714487458874.ttf} +0 -0
  88. /package/es/{iconfont.1714444998024.woff → iconfont.1714487458874.woff} +0 -0
  89. /package/es/{iconfont.1714444998024.woff2 → iconfont.1714487458874.woff2} +0 -0
  90. /package/lib/icon/style/{iconfont.1714444998024.ttf → iconfont.1714487458874.ttf} +0 -0
  91. /package/lib/icon/style/{iconfont.1714444998024.woff → iconfont.1714487458874.woff} +0 -0
  92. /package/lib/icon/style/{iconfont.1714444998024.woff2 → iconfont.1714487458874.woff2} +0 -0
  93. /package/lib/{iconfont.1714444998024.ttf → iconfont.1714487458874.ttf} +0 -0
  94. /package/lib/{iconfont.1714444998024.woff → iconfont.1714487458874.woff} +0 -0
  95. /package/lib/{iconfont.1714444998024.woff2 → iconfont.1714487458874.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -2470,7 +2470,7 @@ const GlobalConfig = {
2470
2470
  ;// CONCATENATED MODULE: ./packages/tools/log.ts
2471
2471
 
2472
2472
  function getLog(message, params) {
2473
- return `[vxe-table v${"4.6.7"}] ${conf.i18n(message, params)}`;
2473
+ return `[vxe-table v${"4.6.8"}] ${conf.i18n(message, params)}`;
2474
2474
  }
2475
2475
  function outLog(type) {
2476
2476
  return function (message, params) {
@@ -2497,7 +2497,7 @@ const interceptor = {
2497
2497
  add(type, callback) {
2498
2498
  // 检测类型
2499
2499
  if (true) {
2500
- const eventTypes = ['created', 'mounted', 'activated', 'beforeUnmount', 'unmounted', 'event.clearActived', 'event.clearFilter', 'event.clearAreas', 'event.showMenu', 'event.keydown', 'event.export', 'event.import'];
2500
+ const eventTypes = ['created', 'mounted', 'activated', 'beforeUnmount', 'unmounted', 'event.clearEdit', 'event.clearActived', 'event.clearFilter', 'event.clearAreas', 'event.showMenu', 'event.keydown', 'event.export', 'event.import'];
2501
2501
  if (eventTypes.indexOf(type) === -1) {
2502
2502
  warnLog('vxe.error.errProp', [`Interceptor.${type}`, eventTypes.join('|')]);
2503
2503
  }
@@ -4935,7 +4935,7 @@ const setup = config;
4935
4935
  const globalStore = {};
4936
4936
  const VXETable = {
4937
4937
  v,
4938
- version: "4.6.7",
4938
+ version: "4.6.8",
4939
4939
  config: config,
4940
4940
  globalStore,
4941
4941
  interceptor: interceptor,
@@ -5838,7 +5838,7 @@ const tableMenuHook = {
5838
5838
  /**
5839
5839
  * 显示快捷菜单
5840
5840
  */
5841
- const openContextMenu = (evnt, type, params) => {
5841
+ const handleOpenMenuEvent = (evnt, type, params) => {
5842
5842
  const {
5843
5843
  ctxMenuStore
5844
5844
  } = reactData;
@@ -5977,6 +5977,7 @@ const tableMenuHook = {
5977
5977
  menuPrivateMethods.ctxMenuLinkEvent(evnt, ctxMenuStore[property]);
5978
5978
  }
5979
5979
  },
5980
+ handleOpenMenuEvent,
5980
5981
  /**
5981
5982
  * 快捷菜单事件处理
5982
5983
  */
@@ -6021,7 +6022,7 @@ const tableMenuHook = {
6021
6022
  if (activeArea && activeArea.row && activeArea.column) {
6022
6023
  params.row = activeArea.row;
6023
6024
  params.column = activeArea.column;
6024
- openContextMenu(evnt, type, params);
6025
+ handleOpenMenuEvent(evnt, type, params);
6025
6026
  return;
6026
6027
  }
6027
6028
  } else if (mouseConfig && mouseOpts.selected) {
@@ -6029,7 +6030,7 @@ const tableMenuHook = {
6029
6030
  if (selected.row && selected.column) {
6030
6031
  params.row = selected.row;
6031
6032
  params.column = selected.column;
6032
- openContextMenu(evnt, type, params);
6033
+ handleOpenMenuEvent(evnt, type, params);
6033
6034
  return;
6034
6035
  }
6035
6036
  }
@@ -6069,14 +6070,14 @@ const tableMenuHook = {
6069
6070
  }
6070
6071
  }
6071
6072
  const eventType = `${typePrefix}cell-menu`;
6072
- openContextMenu(evnt, layout, params);
6073
+ handleOpenMenuEvent(evnt, layout, params);
6073
6074
  $xetable.dispatchEvent(eventType, params, evnt);
6074
6075
  return;
6075
6076
  } else if (getEventTargetNode(evnt, el, `vxe-table--${layout}-wrapper`, target => target.getAttribute('xid') === xID).flag) {
6076
6077
  if (menuOpts.trigger === 'cell') {
6077
6078
  evnt.preventDefault();
6078
6079
  } else {
6079
- openContextMenu(evnt, layout, params);
6080
+ handleOpenMenuEvent(evnt, layout, params);
6080
6081
  }
6081
6082
  return;
6082
6083
  }
@@ -6843,10 +6844,10 @@ const editHook = {
6843
6844
  return null;
6844
6845
  },
6845
6846
  clearActived(evnt) {
6846
- // if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
6847
- // warnLog('vxe.error.delFunc', ['clearActived', 'clearEdit'])
6848
- // }
6849
6847
  // 即将废弃
6848
+ if (true) {
6849
+ warnLog('vxe.error.delFunc', ['clearActived', 'clearEdit']);
6850
+ }
6850
6851
  return this.clearEdit(evnt);
6851
6852
  },
6852
6853
  /**
@@ -6857,7 +6858,8 @@ const editHook = {
6857
6858
  editStore
6858
6859
  } = reactData;
6859
6860
  const {
6860
- actived
6861
+ actived,
6862
+ focused
6861
6863
  } = editStore;
6862
6864
  const {
6863
6865
  row,
@@ -6883,6 +6885,8 @@ const editHook = {
6883
6885
  return $xetable.clearValidate();
6884
6886
  }
6885
6887
  }
6888
+ focused.row = null;
6889
+ focused.column = null;
6886
6890
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
6887
6891
  },
6888
6892
  /**
@@ -16470,10 +16474,7 @@ const VxeTableValidatorModule = {
16470
16474
  };
16471
16475
  const Validator = VxeTableValidatorModule;
16472
16476
  /* harmony default export */ var validator = ((/* unused pure expression or super */ null && (VxeTableValidatorModule)));
16473
- ;// CONCATENATED MODULE: ./packages/custom/src/panel.ts
16474
-
16475
-
16476
-
16477
+ ;// CONCATENATED MODULE: ./packages/tooltip/src/tooltip.ts
16477
16478
 
16478
16479
 
16479
16480
 
@@ -16481,379 +16482,687 @@ const Validator = VxeTableValidatorModule;
16481
16482
 
16482
16483
 
16483
16484
 
16484
- /* harmony default export */ var custom_src_panel = ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.defineComponent)({
16485
- name: 'VxeTableCustomPanel',
16485
+ /* harmony default export */ var tooltip = ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.defineComponent)({
16486
+ name: 'VxeTooltip',
16486
16487
  props: {
16487
- customStore: {
16488
- type: Object,
16489
- default: () => ({})
16488
+ modelValue: Boolean,
16489
+ size: {
16490
+ type: String,
16491
+ default: () => conf.tooltip.size || conf.size
16492
+ },
16493
+ trigger: {
16494
+ type: String,
16495
+ default: () => conf.tooltip.trigger
16496
+ },
16497
+ theme: {
16498
+ type: String,
16499
+ default: () => conf.tooltip.theme
16500
+ },
16501
+ content: {
16502
+ type: [String, Number],
16503
+ default: null
16504
+ },
16505
+ useHTML: Boolean,
16506
+ zIndex: [String, Number],
16507
+ popupClassName: [String, Function],
16508
+ isArrow: {
16509
+ type: Boolean,
16510
+ default: true
16511
+ },
16512
+ enterable: Boolean,
16513
+ enterDelay: {
16514
+ type: Number,
16515
+ default: () => conf.tooltip.enterDelay
16516
+ },
16517
+ leaveDelay: {
16518
+ type: Number,
16519
+ default: () => conf.tooltip.leaveDelay
16490
16520
  }
16491
16521
  },
16492
- setup(props) {
16493
- const $xetable = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xetable', {});
16494
- const {
16495
- reactData
16496
- } = $xetable;
16522
+ emits: ['update:modelValue'],
16523
+ setup(props, context) {
16497
16524
  const {
16498
- computeCustomOpts,
16499
- computeIsMaxFixedColumn
16500
- } = $xetable.getComputeMaps();
16525
+ slots,
16526
+ emit
16527
+ } = context;
16528
+ const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
16529
+ const computeSize = useSize(props);
16530
+ const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({
16531
+ target: null,
16532
+ isUpdate: false,
16533
+ visible: false,
16534
+ tipContent: '',
16535
+ tipActive: false,
16536
+ tipTarget: null,
16537
+ tipZindex: 0,
16538
+ tipStore: {
16539
+ style: {},
16540
+ placement: '',
16541
+ arrowStyle: {}
16542
+ }
16543
+ });
16501
16544
  const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
16502
- const bodyElemRef = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
16503
- const dragHintElemRef = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
16504
- const dragColumn = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
16505
- let prevDropTrEl;
16506
- const handleWrapperMouseenterEvent = evnt => {
16507
- const {
16508
- customStore
16509
- } = props;
16510
- customStore.activeWrapper = true;
16511
- $xetable.customOpenEvent(evnt);
16512
- };
16513
- const handleWrapperMouseleaveEvent = evnt => {
16514
- const {
16515
- customStore
16516
- } = props;
16517
- customStore.activeWrapper = false;
16518
- setTimeout(() => {
16519
- if (!customStore.activeBtn && !customStore.activeWrapper) {
16520
- $xetable.customColseEvent(evnt);
16521
- }
16522
- }, 300);
16523
- };
16524
- const confirmCustomEvent = evnt => {
16525
- $xetable.closeCustom();
16526
- $xetable.emitCustomEvent('confirm', evnt);
16527
- };
16528
- const cancelCustomEvent = evnt => {
16529
- $xetable.closeCustom();
16530
- $xetable.emitCustomEvent('cancel', evnt);
16531
- };
16532
- const resetCustomEvent = evnt => {
16533
- $xetable.resetColumn(true);
16534
- $xetable.closeCustom();
16535
- $xetable.emitCustomEvent('reset', evnt);
16545
+ const refMaps = {
16546
+ refElem
16536
16547
  };
16537
- const resetPopupCustomEvent = evnt => {
16538
- if (VXETable.modal) {
16539
- VXETable.modal.confirm({
16540
- content: conf.i18n('vxe.custom.cstmConfirmRestore'),
16541
- className: 'vxe-table--ignore-clear',
16542
- escClosable: true
16543
- }).then(type => {
16544
- if (type === 'confirm') {
16545
- resetCustomEvent(evnt);
16546
- }
16547
- });
16548
- } else {
16549
- resetCustomEvent(evnt);
16550
- }
16548
+ const $xetooltip = {
16549
+ xID,
16550
+ props,
16551
+ context,
16552
+ reactData,
16553
+ getRefMaps: () => refMaps
16551
16554
  };
16552
- const handleOptionCheck = column => {
16555
+ let tooltipMethods = {};
16556
+ const updateTipStyle = () => {
16553
16557
  const {
16554
- customColumnList
16558
+ tipTarget,
16559
+ tipStore
16555
16560
  } = reactData;
16556
- const matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(customColumnList, item => item === column);
16557
- if (matchObj && matchObj.parent) {
16561
+ if (tipTarget) {
16558
16562
  const {
16559
- parent
16560
- } = matchObj;
16561
- if (parent.children && parent.children.length) {
16562
- parent.visible = parent.children.every(column => column.visible);
16563
- parent.halfVisible = !parent.visible && parent.children.some(column => column.visible || column.halfVisible);
16564
- handleOptionCheck(parent);
16563
+ scrollTop,
16564
+ scrollLeft,
16565
+ visibleWidth
16566
+ } = getDomNode();
16567
+ const {
16568
+ top,
16569
+ left
16570
+ } = getAbsolutePos(tipTarget);
16571
+ const el = refElem.value;
16572
+ const marginSize = 6;
16573
+ const offsetHeight = el.offsetHeight;
16574
+ const offsetWidth = el.offsetWidth;
16575
+ let tipLeft = left;
16576
+ let tipTop = top - offsetHeight - marginSize;
16577
+ tipLeft = Math.max(marginSize, left + Math.floor((tipTarget.offsetWidth - offsetWidth) / 2));
16578
+ if (tipLeft + offsetWidth + marginSize > scrollLeft + visibleWidth) {
16579
+ tipLeft = scrollLeft + visibleWidth - offsetWidth - marginSize;
16580
+ }
16581
+ if (top - offsetHeight < scrollTop + marginSize) {
16582
+ tipStore.placement = 'bottom';
16583
+ tipTop = top + tipTarget.offsetHeight + marginSize;
16565
16584
  }
16585
+ tipStore.style.top = `${tipTop}px`;
16586
+ tipStore.style.left = `${tipLeft}px`;
16587
+ tipStore.arrowStyle.left = `${left - tipLeft + tipTarget.offsetWidth / 2}px`;
16566
16588
  }
16567
16589
  };
16568
- const changeCheckboxOption = column => {
16569
- const isChecked = !column.visible;
16570
- const customOpts = computeCustomOpts.value;
16571
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([column], item => {
16572
- item.visible = isChecked;
16573
- item.halfVisible = false;
16574
- });
16575
- handleOptionCheck(column);
16576
- if (customOpts.immediate) {
16577
- $xetable.handleCustom();
16590
+ const updateValue = value => {
16591
+ if (value !== reactData.visible) {
16592
+ reactData.visible = value;
16593
+ reactData.isUpdate = true;
16594
+ emit('update:modelValue', value);
16578
16595
  }
16579
- $xetable.checkCustomStatus();
16580
16596
  };
16581
- const changeFixedOption = (column, colFixed) => {
16582
- const isMaxFixedColumn = computeIsMaxFixedColumn.value;
16583
- if (column.fixed === colFixed) {
16584
- $xetable.clearColumnFixed(column);
16597
+ const updateZindex = () => {
16598
+ if (reactData.tipZindex < getLastZIndex()) {
16599
+ reactData.tipZindex = nextZIndex();
16600
+ }
16601
+ };
16602
+ const clickEvent = () => {
16603
+ if (reactData.visible) {
16604
+ tooltipMethods.close();
16585
16605
  } else {
16586
- if (!isMaxFixedColumn || column.fixed) {
16587
- $xetable.setColumnFixed(column, colFixed);
16588
- }
16606
+ tooltipMethods.open();
16589
16607
  }
16590
16608
  };
16591
- const changePopupFixedOption = column => {
16592
- const isMaxFixedColumn = computeIsMaxFixedColumn.value;
16593
- if (!isMaxFixedColumn) {
16594
- $xetable.setColumnFixed(column, column.fixed);
16609
+ const targetMouseenterEvent = () => {
16610
+ tooltipMethods.open();
16611
+ };
16612
+ const targetMouseleaveEvent = () => {
16613
+ const {
16614
+ trigger,
16615
+ enterable,
16616
+ leaveDelay
16617
+ } = props;
16618
+ reactData.tipActive = false;
16619
+ if (enterable && trigger === 'hover') {
16620
+ setTimeout(() => {
16621
+ if (!reactData.tipActive) {
16622
+ tooltipMethods.close();
16623
+ }
16624
+ }, leaveDelay);
16625
+ } else {
16626
+ tooltipMethods.close();
16595
16627
  }
16596
16628
  };
16597
- const allCustomEvent = () => {
16629
+ const wrapperMouseenterEvent = () => {
16630
+ reactData.tipActive = true;
16631
+ };
16632
+ const wrapperMouseleaveEvent = () => {
16598
16633
  const {
16599
- customStore
16634
+ trigger,
16635
+ enterable,
16636
+ leaveDelay
16600
16637
  } = props;
16638
+ reactData.tipActive = false;
16639
+ if (enterable && trigger === 'hover') {
16640
+ setTimeout(() => {
16641
+ if (!reactData.tipActive) {
16642
+ tooltipMethods.close();
16643
+ }
16644
+ }, leaveDelay);
16645
+ }
16646
+ };
16647
+ const showTip = () => {
16601
16648
  const {
16602
- customColumnList
16649
+ tipStore
16603
16650
  } = reactData;
16604
- const customOpts = computeCustomOpts.value;
16605
- const {
16606
- checkMethod
16607
- } = customOpts;
16608
- const isAll = !customStore.isAll;
16609
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, column => {
16610
- if (!checkMethod || checkMethod({
16611
- column
16612
- })) {
16613
- column.visible = isAll;
16614
- column.halfVisible = false;
16651
+ const el = refElem.value;
16652
+ if (el) {
16653
+ const parentNode = el.parentNode;
16654
+ if (!parentNode) {
16655
+ document.body.appendChild(el);
16615
16656
  }
16616
- });
16617
- customStore.isAll = isAll;
16618
- $xetable.checkCustomStatus();
16619
- };
16620
- const sortMousedownEvent = evnt => {
16621
- const btnEl = evnt.currentTarget;
16622
- const tdEl = btnEl.parentNode;
16623
- const trEl = tdEl.parentNode;
16624
- const colid = trEl.getAttribute('colid');
16625
- const column = $xetable.getColumnById(colid);
16626
- trEl.draggable = true;
16627
- dragColumn.value = column;
16628
- addClass(trEl, 'active--drag-origin');
16629
- };
16630
- const sortMouseupEvent = evnt => {
16631
- const btnEl = evnt.currentTarget;
16632
- const tdEl = btnEl.parentNode;
16633
- const trEl = tdEl.parentNode;
16634
- const dragHintEl = dragHintElemRef.value;
16635
- trEl.draggable = false;
16636
- dragColumn.value = null;
16637
- removeClass(trEl, 'active--drag-origin');
16638
- if (dragHintEl) {
16639
- dragHintEl.style.display = '';
16640
16657
  }
16658
+ updateValue(true);
16659
+ updateZindex();
16660
+ tipStore.placement = 'top';
16661
+ tipStore.style = {
16662
+ width: 'auto',
16663
+ left: 0,
16664
+ top: 0,
16665
+ zIndex: props.zIndex || reactData.tipZindex
16666
+ };
16667
+ tipStore.arrowStyle = {
16668
+ left: '50%'
16669
+ };
16670
+ return tooltipMethods.updatePlacement();
16641
16671
  };
16642
- const sortDragstartEvent = evnt => {
16643
- const img = new Image();
16644
- if (evnt.dataTransfer) {
16645
- evnt.dataTransfer.setDragImage(img, 0, 0);
16672
+ const showDelayTip = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().debounce(() => {
16673
+ if (reactData.tipActive) {
16674
+ showTip();
16646
16675
  }
16647
- };
16648
- const sortDragendEvent = evnt => {
16649
- const {
16650
- customColumnList
16651
- } = reactData;
16652
- const trEl = evnt.currentTarget;
16653
- const dragHintEl = dragHintElemRef.value;
16654
- if (prevDropTrEl) {
16655
- // 判断是否有拖动
16656
- if (prevDropTrEl !== trEl) {
16657
- const dragOffset = prevDropTrEl.getAttribute('drag-pos');
16658
- const colid = trEl.getAttribute('colid');
16659
- const column = $xetable.getColumnById(colid);
16660
- if (!column) {
16661
- return;
16676
+ }, props.enterDelay, {
16677
+ leading: false,
16678
+ trailing: true
16679
+ });
16680
+ tooltipMethods = {
16681
+ dispatchEvent(type, params, evnt) {
16682
+ emit(type, Object.assign({
16683
+ $tooltip: $xetooltip,
16684
+ $event: evnt
16685
+ }, params));
16686
+ },
16687
+ open(target, content) {
16688
+ return tooltipMethods.toVisible(target || reactData.target, content);
16689
+ },
16690
+ close() {
16691
+ reactData.tipTarget = null;
16692
+ reactData.tipActive = false;
16693
+ Object.assign(reactData.tipStore, {
16694
+ style: {},
16695
+ placement: '',
16696
+ arrowStyle: null
16697
+ });
16698
+ updateValue(false);
16699
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
16700
+ },
16701
+ toVisible(target, content) {
16702
+ if (target) {
16703
+ const {
16704
+ trigger,
16705
+ enterDelay
16706
+ } = props;
16707
+ reactData.tipActive = true;
16708
+ reactData.tipTarget = target;
16709
+ if (content) {
16710
+ reactData.tipContent = content;
16662
16711
  }
16663
- const cIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(customColumnList, item => item.id === column.id);
16664
- const targetColid = prevDropTrEl.getAttribute('colid');
16665
- const targetColumn = $xetable.getColumnById(targetColid);
16666
- if (!targetColumn) {
16667
- return;
16712
+ if (enterDelay && trigger === 'hover') {
16713
+ showDelayTip();
16714
+ } else {
16715
+ return showTip();
16668
16716
  }
16669
- // 移出源位置
16670
- customColumnList.splice(cIndex, 1);
16671
- const tcIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(customColumnList, item => item.id === targetColumn.id);
16672
- // 插新位置
16673
- customColumnList.splice(tcIndex + (dragOffset === 'bottom' ? 1 : 0), 0, column);
16674
16717
  }
16675
- prevDropTrEl.draggable = false;
16676
- prevDropTrEl.removeAttribute('drag-pos');
16677
- removeClass(prevDropTrEl, 'active--drag-target');
16678
- }
16679
- dragColumn.value = null;
16680
- trEl.draggable = false;
16681
- trEl.removeAttribute('drag-pos');
16682
- if (dragHintEl) {
16683
- dragHintEl.style.display = '';
16684
- }
16685
- removeClass(trEl, 'active--drag-target');
16686
- removeClass(trEl, 'active--drag-origin');
16687
- // 更新顺序
16688
- customColumnList.forEach((column, index) => {
16689
- column.renderSortNumber = index;
16690
- });
16691
- };
16692
- const sortDragoverEvent = evnt => {
16693
- const trEl = evnt.currentTarget;
16694
- if (prevDropTrEl !== trEl) {
16695
- removeClass(prevDropTrEl, 'active--drag-target');
16696
- }
16697
- const colid = trEl.getAttribute('colid');
16698
- const column = $xetable.getColumnById(colid);
16699
- // 是否移入有效元行
16700
- if (column && column.level === 1) {
16701
- evnt.preventDefault();
16702
- const offsetY = evnt.clientY - trEl.getBoundingClientRect().y;
16703
- const dragOffset = offsetY < trEl.clientHeight / 2 ? 'top' : 'bottom';
16704
- addClass(trEl, 'active--drag-target');
16705
- trEl.setAttribute('drag-pos', dragOffset);
16706
- prevDropTrEl = trEl;
16718
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
16719
+ },
16720
+ updatePlacement() {
16721
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
16722
+ const {
16723
+ tipTarget
16724
+ } = reactData;
16725
+ const el = refElem.value;
16726
+ if (tipTarget && el) {
16727
+ updateTipStyle();
16728
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(updateTipStyle);
16729
+ }
16730
+ });
16731
+ },
16732
+ isActived() {
16733
+ return reactData.tipActive;
16734
+ },
16735
+ setActived(actived) {
16736
+ reactData.tipActive = !!actived;
16707
16737
  }
16708
- updateDropHint(evnt);
16709
16738
  };
16710
- const updateDropHint = evnt => {
16711
- const dragHintEl = dragHintElemRef.value;
16712
- const bodyEl = bodyElemRef.value;
16713
- if (!bodyEl) {
16714
- return;
16715
- }
16716
- if (dragHintEl) {
16717
- const warpperEl = bodyEl.parentNode;
16718
- const warpperRect = warpperEl.getBoundingClientRect();
16719
- dragHintEl.style.display = 'block';
16720
- dragHintEl.style.top = `${Math.min(warpperEl.clientHeight - warpperEl.scrollTop - dragHintEl.clientHeight, evnt.clientY - warpperRect.y)}px`;
16721
- dragHintEl.style.left = `${Math.min(warpperEl.clientWidth - warpperEl.scrollLeft - dragHintEl.clientWidth - 16, evnt.clientX - warpperRect.x)}px`;
16739
+ Object.assign($xetooltip, tooltipMethods);
16740
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.content, () => {
16741
+ reactData.tipContent = props.content;
16742
+ });
16743
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.modelValue, () => {
16744
+ if (!reactData.isUpdate) {
16745
+ if (props.modelValue) {
16746
+ tooltipMethods.open();
16747
+ } else {
16748
+ tooltipMethods.close();
16749
+ }
16722
16750
  }
16723
- };
16724
- const renderSimplePanel = () => {
16751
+ reactData.isUpdate = false;
16752
+ });
16753
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
16754
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
16755
+ const {
16756
+ trigger,
16757
+ content,
16758
+ modelValue
16759
+ } = props;
16760
+ const wrapperElem = refElem.value;
16761
+ if (wrapperElem) {
16762
+ const parentNode = wrapperElem.parentNode;
16763
+ if (parentNode) {
16764
+ reactData.tipContent = content;
16765
+ reactData.tipZindex = nextZIndex();
16766
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(wrapperElem.children, (elem, index) => {
16767
+ if (index > 1) {
16768
+ parentNode.insertBefore(elem, wrapperElem);
16769
+ if (!reactData.target) {
16770
+ reactData.target = elem;
16771
+ }
16772
+ }
16773
+ });
16774
+ parentNode.removeChild(wrapperElem);
16775
+ const {
16776
+ target
16777
+ } = reactData;
16778
+ if (target) {
16779
+ if (trigger === 'hover') {
16780
+ target.onmouseenter = targetMouseenterEvent;
16781
+ target.onmouseleave = targetMouseleaveEvent;
16782
+ } else if (trigger === 'click') {
16783
+ target.onclick = clickEvent;
16784
+ }
16785
+ }
16786
+ if (modelValue) {
16787
+ tooltipMethods.open();
16788
+ }
16789
+ }
16790
+ }
16791
+ });
16792
+ });
16793
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onBeforeUnmount)(() => {
16725
16794
  const {
16726
- customStore
16795
+ trigger
16727
16796
  } = props;
16728
16797
  const {
16729
- customColumnList
16798
+ target
16730
16799
  } = reactData;
16731
- const customOpts = computeCustomOpts.value;
16732
- const {
16733
- maxHeight
16734
- } = customStore;
16735
- const {
16736
- checkMethod,
16737
- visibleMethod,
16738
- trigger
16739
- } = customOpts;
16740
- const isMaxFixedColumn = computeIsMaxFixedColumn.value;
16741
- const colVNs = [];
16742
- const customWrapperOns = {};
16743
- // hover 触发
16744
- if (trigger === 'hover') {
16745
- customWrapperOns.onMouseenter = handleWrapperMouseenterEvent;
16746
- customWrapperOns.onMouseleave = handleWrapperMouseleaveEvent;
16800
+ const wrapperElem = refElem.value;
16801
+ if (target) {
16802
+ if (trigger === 'hover') {
16803
+ target.onmouseenter = null;
16804
+ target.onmouseleave = null;
16805
+ } else if (trigger === 'click') {
16806
+ target.onclick = null;
16807
+ }
16747
16808
  }
16748
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, (column, index, items, path, parent) => {
16749
- const isVisible = visibleMethod ? visibleMethod({
16750
- column
16751
- }) : true;
16752
- if (isVisible) {
16753
- const isChecked = column.visible;
16754
- const isIndeterminate = column.halfVisible;
16755
- const isColGroup = column.children && column.children.length;
16756
- const colTitle = formatText(column.getTitle(), 1);
16757
- const isDisabled = checkMethod ? !checkMethod({
16758
- column
16759
- }) : false;
16760
- colVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('li', {
16761
- key: column.id,
16762
- class: ['vxe-table-custom--option', `level--${column.level}`, {
16763
- 'is--group': isColGroup
16764
- }]
16765
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
16766
- title: colTitle,
16767
- class: ['vxe-table-custom--checkbox-option', {
16768
- 'is--checked': isChecked,
16769
- 'is--indeterminate': isIndeterminate,
16770
- 'is--disabled': isDisabled
16771
- }],
16772
- onClick: () => {
16773
- if (!isDisabled) {
16774
- changeCheckboxOption(column);
16775
- }
16776
- }
16777
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
16778
- class: ['vxe-checkbox--icon', isIndeterminate ? conf.icon.TABLE_CHECKBOX_INDETERMINATE : isChecked ? conf.icon.TABLE_CHECKBOX_CHECKED : conf.icon.TABLE_CHECKBOX_UNCHECKED]
16779
- }), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
16780
- class: 'vxe-checkbox--label'
16781
- }, colTitle)]), !parent && customOpts.allowFixed ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
16782
- class: 'vxe-table-custom--fixed-option'
16783
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
16784
- class: ['vxe-table-custom--fixed-left-option', column.fixed === 'left' ? conf.icon.TOOLBAR_TOOLS_FIXED_LEFT_ACTIVED : conf.icon.TOOLBAR_TOOLS_FIXED_LEFT, {
16785
- 'is--checked': column.fixed === 'left',
16786
- 'is--disabled': isMaxFixedColumn && !column.fixed
16787
- }],
16788
- title: conf.i18n(column.fixed === 'left' ? 'vxe.toolbar.cancelfixed' : 'vxe.toolbar.fixedLeft'),
16789
- onClick: () => {
16790
- changeFixedOption(column, 'left');
16791
- }
16792
- }), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
16793
- class: ['vxe-table-custom--fixed-right-option', column.fixed === 'right' ? conf.icon.TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVED : conf.icon.TOOLBAR_TOOLS_FIXED_RIGHT, {
16794
- 'is--checked': column.fixed === 'right',
16795
- 'is--disabled': isMaxFixedColumn && !column.fixed
16796
- }],
16797
- title: conf.i18n(column.fixed === 'right' ? 'vxe.toolbar.cancelfixed' : 'vxe.toolbar.fixedRight'),
16798
- onClick: () => {
16799
- changeFixedOption(column, 'right');
16800
- }
16801
- })]) : null]));
16809
+ if (wrapperElem) {
16810
+ const parentNode = wrapperElem.parentNode;
16811
+ if (parentNode) {
16812
+ parentNode.removeChild(wrapperElem);
16802
16813
  }
16803
- });
16804
- const isAllChecked = customStore.isAll;
16805
- const isAllIndeterminate = customStore.isIndeterminate;
16814
+ }
16815
+ });
16816
+ const renderContent = () => {
16817
+ const {
16818
+ useHTML
16819
+ } = props;
16820
+ const {
16821
+ tipContent
16822
+ } = reactData;
16823
+ const contentSlot = slots.content;
16824
+ if (contentSlot) {
16825
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
16826
+ key: 1,
16827
+ class: 'vxe-table--tooltip-content'
16828
+ }, getSlotVNs(contentSlot({})));
16829
+ }
16830
+ if (useHTML) {
16831
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
16832
+ key: 2,
16833
+ class: 'vxe-table--tooltip-content',
16834
+ innerHTML: tipContent
16835
+ });
16836
+ }
16837
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
16838
+ key: 3,
16839
+ class: 'vxe-table--tooltip-content'
16840
+ }, formatText(tipContent));
16841
+ };
16842
+ const renderVN = () => {
16843
+ const {
16844
+ popupClassName,
16845
+ theme,
16846
+ isArrow,
16847
+ enterable
16848
+ } = props;
16849
+ const {
16850
+ tipActive,
16851
+ visible,
16852
+ tipStore
16853
+ } = reactData;
16854
+ const defaultSlot = slots.default;
16855
+ const vSize = computeSize.value;
16856
+ let ons;
16857
+ if (enterable) {
16858
+ ons = {
16859
+ onMouseenter: wrapperMouseenterEvent,
16860
+ onMouseleave: wrapperMouseleaveEvent
16861
+ };
16862
+ }
16806
16863
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
16807
16864
  ref: refElem,
16808
- key: 'simple',
16809
- class: ['vxe-table-custom-wrapper', {
16810
- 'is--active': customStore.visible
16811
- }]
16812
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('ul', {
16813
- class: 'vxe-table-custom--header'
16814
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('li', {
16815
- class: 'vxe-table-custom--option'
16816
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
16817
- class: ['vxe-table-custom--checkbox-option', {
16818
- 'is--checked': isAllChecked,
16819
- 'is--indeterminate': isAllIndeterminate
16865
+ class: ['vxe-table--tooltip-wrapper', `theme--${theme}`, popupClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(popupClassName) ? popupClassName({
16866
+ $tooltip: $xetooltip
16867
+ }) : popupClassName : '', {
16868
+ [`size--${vSize}`]: vSize,
16869
+ [`placement--${tipStore.placement}`]: tipStore.placement,
16870
+ 'is--enterable': enterable,
16871
+ 'is--visible': visible,
16872
+ 'is--arrow': isArrow,
16873
+ 'is--active': tipActive
16820
16874
  }],
16821
- title: conf.i18n('vxe.table.allTitle'),
16822
- onClick: allCustomEvent
16823
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
16824
- class: ['vxe-checkbox--icon', isAllIndeterminate ? conf.icon.TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? conf.icon.TABLE_CHECKBOX_CHECKED : conf.icon.TABLE_CHECKBOX_UNCHECKED]
16825
- }), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
16826
- class: 'vxe-checkbox--label'
16827
- }, conf.i18n('vxe.toolbar.customAll'))])])]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('ul', {
16828
- class: 'vxe-table-custom--body',
16829
- style: maxHeight ? {
16830
- maxHeight: `${maxHeight}px`
16831
- } : {},
16832
- ...customWrapperOns
16833
- }, colVNs), customOpts.showFooter ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
16834
- class: 'vxe-table-custom--footer'
16835
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('button', {
16836
- class: 'btn--reset',
16837
- onClick: resetCustomEvent
16838
- }, customOpts.resetButtonText || conf.i18n('vxe.toolbar.customRestore')), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('button', {
16839
- class: 'btn--confirm',
16840
- onClick: confirmCustomEvent
16841
- }, customOpts.confirmButtonText || conf.i18n('vxe.toolbar.customConfirm'))]) : null]);
16875
+ style: tipStore.style,
16876
+ ...ons
16877
+ }, [renderContent(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
16878
+ class: 'vxe-table--tooltip-arrow',
16879
+ style: tipStore.arrowStyle
16880
+ }), ...(defaultSlot ? getSlotVNs(defaultSlot({})) : [])]);
16842
16881
  };
16843
- const renderPopupPanel = () => {
16882
+ $xetooltip.renderVN = renderVN;
16883
+ return $xetooltip;
16884
+ },
16885
+ render() {
16886
+ return this.renderVN();
16887
+ }
16888
+ }));
16889
+ ;// CONCATENATED MODULE: ./packages/custom/src/panel.ts
16890
+
16891
+
16892
+
16893
+
16894
+
16895
+
16896
+
16897
+
16898
+
16899
+
16900
+
16901
+ /* harmony default export */ var custom_src_panel = ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.defineComponent)({
16902
+ name: 'VxeTableCustomPanel',
16903
+ props: {
16904
+ customStore: {
16905
+ type: Object,
16906
+ default: () => ({})
16907
+ }
16908
+ },
16909
+ setup(props) {
16910
+ const $xetable = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xetable', {});
16911
+ const {
16912
+ reactData
16913
+ } = $xetable;
16914
+ const {
16915
+ computeCustomOpts,
16916
+ computeColumnOpts,
16917
+ computeIsMaxFixedColumn
16918
+ } = $xetable.getComputeMaps();
16919
+ const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
16920
+ const bodyElemRef = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
16921
+ const dragHintElemRef = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
16922
+ const dragColumn = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
16923
+ let prevDropTrEl;
16924
+ const handleWrapperMouseenterEvent = evnt => {
16925
+ const {
16926
+ customStore
16927
+ } = props;
16928
+ customStore.activeWrapper = true;
16929
+ $xetable.customOpenEvent(evnt);
16930
+ };
16931
+ const handleWrapperMouseleaveEvent = evnt => {
16844
16932
  const {
16845
16933
  customStore
16846
16934
  } = props;
16935
+ customStore.activeWrapper = false;
16936
+ setTimeout(() => {
16937
+ if (!customStore.activeBtn && !customStore.activeWrapper) {
16938
+ $xetable.customColseEvent(evnt);
16939
+ }
16940
+ }, 300);
16941
+ };
16942
+ const confirmCustomEvent = evnt => {
16943
+ $xetable.closeCustom();
16944
+ $xetable.emitCustomEvent('confirm', evnt);
16945
+ };
16946
+ const cancelCustomEvent = evnt => {
16947
+ $xetable.closeCustom();
16948
+ $xetable.emitCustomEvent('cancel', evnt);
16949
+ };
16950
+ const resetCustomEvent = evnt => {
16951
+ $xetable.resetColumn(true);
16952
+ $xetable.closeCustom();
16953
+ $xetable.emitCustomEvent('reset', evnt);
16954
+ };
16955
+ const resetPopupCustomEvent = evnt => {
16956
+ if (VXETable.modal) {
16957
+ VXETable.modal.confirm({
16958
+ content: conf.i18n('vxe.custom.cstmConfirmRestore'),
16959
+ className: 'vxe-table--ignore-clear',
16960
+ escClosable: true
16961
+ }).then(type => {
16962
+ if (type === 'confirm') {
16963
+ resetCustomEvent(evnt);
16964
+ }
16965
+ });
16966
+ } else {
16967
+ resetCustomEvent(evnt);
16968
+ }
16969
+ };
16970
+ const handleOptionCheck = column => {
16847
16971
  const {
16848
16972
  customColumnList
16849
16973
  } = reactData;
16850
- const customOpts = computeCustomOpts.value;
16851
- const {
16974
+ const matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(customColumnList, item => item === column);
16975
+ if (matchObj && matchObj.parent) {
16976
+ const {
16977
+ parent
16978
+ } = matchObj;
16979
+ if (parent.children && parent.children.length) {
16980
+ parent.visible = parent.children.every(column => column.visible);
16981
+ parent.halfVisible = !parent.visible && parent.children.some(column => column.visible || column.halfVisible);
16982
+ handleOptionCheck(parent);
16983
+ }
16984
+ }
16985
+ };
16986
+ const changeCheckboxOption = column => {
16987
+ const isChecked = !column.visible;
16988
+ const customOpts = computeCustomOpts.value;
16989
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([column], item => {
16990
+ item.visible = isChecked;
16991
+ item.halfVisible = false;
16992
+ });
16993
+ handleOptionCheck(column);
16994
+ if (customOpts.immediate) {
16995
+ $xetable.handleCustom();
16996
+ }
16997
+ $xetable.checkCustomStatus();
16998
+ };
16999
+ const changeFixedOption = (column, colFixed) => {
17000
+ const isMaxFixedColumn = computeIsMaxFixedColumn.value;
17001
+ if (column.fixed === colFixed) {
17002
+ $xetable.clearColumnFixed(column);
17003
+ } else {
17004
+ if (!isMaxFixedColumn || column.fixed) {
17005
+ $xetable.setColumnFixed(column, colFixed);
17006
+ }
17007
+ }
17008
+ };
17009
+ const changePopupFixedOption = column => {
17010
+ const isMaxFixedColumn = computeIsMaxFixedColumn.value;
17011
+ if (!isMaxFixedColumn) {
17012
+ $xetable.setColumnFixed(column, column.fixed);
17013
+ }
17014
+ };
17015
+ const allCustomEvent = () => {
17016
+ const {
17017
+ customStore
17018
+ } = props;
17019
+ const {
17020
+ customColumnList
17021
+ } = reactData;
17022
+ const customOpts = computeCustomOpts.value;
17023
+ const {
17024
+ checkMethod
17025
+ } = customOpts;
17026
+ const isAll = !customStore.isAll;
17027
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, column => {
17028
+ if (!checkMethod || checkMethod({
17029
+ column
17030
+ })) {
17031
+ column.visible = isAll;
17032
+ column.halfVisible = false;
17033
+ }
17034
+ });
17035
+ customStore.isAll = isAll;
17036
+ $xetable.checkCustomStatus();
17037
+ };
17038
+ const sortMousedownEvent = evnt => {
17039
+ const btnEl = evnt.currentTarget;
17040
+ const tdEl = btnEl.parentNode;
17041
+ const trEl = tdEl.parentNode;
17042
+ const colid = trEl.getAttribute('colid');
17043
+ const column = $xetable.getColumnById(colid);
17044
+ trEl.draggable = true;
17045
+ dragColumn.value = column;
17046
+ addClass(trEl, 'active--drag-origin');
17047
+ };
17048
+ const sortMouseupEvent = evnt => {
17049
+ const btnEl = evnt.currentTarget;
17050
+ const tdEl = btnEl.parentNode;
17051
+ const trEl = tdEl.parentNode;
17052
+ const dragHintEl = dragHintElemRef.value;
17053
+ trEl.draggable = false;
17054
+ dragColumn.value = null;
17055
+ removeClass(trEl, 'active--drag-origin');
17056
+ if (dragHintEl) {
17057
+ dragHintEl.style.display = '';
17058
+ }
17059
+ };
17060
+ const sortDragstartEvent = evnt => {
17061
+ const img = new Image();
17062
+ if (evnt.dataTransfer) {
17063
+ evnt.dataTransfer.setDragImage(img, 0, 0);
17064
+ }
17065
+ };
17066
+ const sortDragendEvent = evnt => {
17067
+ const {
17068
+ customColumnList
17069
+ } = reactData;
17070
+ const trEl = evnt.currentTarget;
17071
+ const dragHintEl = dragHintElemRef.value;
17072
+ if (prevDropTrEl) {
17073
+ // 判断是否有拖动
17074
+ if (prevDropTrEl !== trEl) {
17075
+ const dragOffset = prevDropTrEl.getAttribute('drag-pos');
17076
+ const colid = trEl.getAttribute('colid');
17077
+ const column = $xetable.getColumnById(colid);
17078
+ if (!column) {
17079
+ return;
17080
+ }
17081
+ const cIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(customColumnList, item => item.id === column.id);
17082
+ const targetColid = prevDropTrEl.getAttribute('colid');
17083
+ const targetColumn = $xetable.getColumnById(targetColid);
17084
+ if (!targetColumn) {
17085
+ return;
17086
+ }
17087
+ // 移出源位置
17088
+ customColumnList.splice(cIndex, 1);
17089
+ const tcIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(customColumnList, item => item.id === targetColumn.id);
17090
+ // 插新位置
17091
+ customColumnList.splice(tcIndex + (dragOffset === 'bottom' ? 1 : 0), 0, column);
17092
+ }
17093
+ prevDropTrEl.draggable = false;
17094
+ prevDropTrEl.removeAttribute('drag-pos');
17095
+ removeClass(prevDropTrEl, 'active--drag-target');
17096
+ }
17097
+ dragColumn.value = null;
17098
+ trEl.draggable = false;
17099
+ trEl.removeAttribute('drag-pos');
17100
+ if (dragHintEl) {
17101
+ dragHintEl.style.display = '';
17102
+ }
17103
+ removeClass(trEl, 'active--drag-target');
17104
+ removeClass(trEl, 'active--drag-origin');
17105
+ // 更新顺序
17106
+ customColumnList.forEach((column, index) => {
17107
+ column.renderSortNumber = index;
17108
+ });
17109
+ };
17110
+ const sortDragoverEvent = evnt => {
17111
+ const trEl = evnt.currentTarget;
17112
+ if (prevDropTrEl !== trEl) {
17113
+ removeClass(prevDropTrEl, 'active--drag-target');
17114
+ }
17115
+ const colid = trEl.getAttribute('colid');
17116
+ const column = $xetable.getColumnById(colid);
17117
+ // 是否移入有效元行
17118
+ if (column && column.level === 1) {
17119
+ evnt.preventDefault();
17120
+ const offsetY = evnt.clientY - trEl.getBoundingClientRect().y;
17121
+ const dragOffset = offsetY < trEl.clientHeight / 2 ? 'top' : 'bottom';
17122
+ addClass(trEl, 'active--drag-target');
17123
+ trEl.setAttribute('drag-pos', dragOffset);
17124
+ prevDropTrEl = trEl;
17125
+ }
17126
+ updateDropHint(evnt);
17127
+ };
17128
+ const updateDropHint = evnt => {
17129
+ const dragHintEl = dragHintElemRef.value;
17130
+ const bodyEl = bodyElemRef.value;
17131
+ if (!bodyEl) {
17132
+ return;
17133
+ }
17134
+ if (dragHintEl) {
17135
+ const warpperEl = bodyEl.parentNode;
17136
+ const warpperRect = warpperEl.getBoundingClientRect();
17137
+ dragHintEl.style.display = 'block';
17138
+ dragHintEl.style.top = `${Math.min(warpperEl.clientHeight - warpperEl.scrollTop - dragHintEl.clientHeight, evnt.clientY - warpperRect.y)}px`;
17139
+ dragHintEl.style.left = `${Math.min(warpperEl.clientWidth - warpperEl.scrollLeft - dragHintEl.clientWidth - 16, evnt.clientX - warpperRect.x)}px`;
17140
+ }
17141
+ };
17142
+ const renderSimplePanel = () => {
17143
+ const {
17144
+ customStore
17145
+ } = props;
17146
+ const {
17147
+ customColumnList
17148
+ } = reactData;
17149
+ const customOpts = computeCustomOpts.value;
17150
+ const {
17151
+ maxHeight
17152
+ } = customStore;
17153
+ const {
16852
17154
  checkMethod,
16853
- visibleMethod
17155
+ visibleMethod,
17156
+ trigger
16854
17157
  } = customOpts;
16855
17158
  const isMaxFixedColumn = computeIsMaxFixedColumn.value;
16856
- const trVNs = [];
17159
+ const colVNs = [];
17160
+ const customWrapperOns = {};
17161
+ // hover 触发
17162
+ if (trigger === 'hover') {
17163
+ customWrapperOns.onMouseenter = handleWrapperMouseenterEvent;
17164
+ customWrapperOns.onMouseleave = handleWrapperMouseleaveEvent;
17165
+ }
16857
17166
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, (column, index, items, path, parent) => {
16858
17167
  const isVisible = visibleMethod ? visibleMethod({
16859
17168
  column
@@ -16861,36 +17170,18 @@ const Validator = VxeTableValidatorModule;
16861
17170
  if (isVisible) {
16862
17171
  const isChecked = column.visible;
16863
17172
  const isIndeterminate = column.halfVisible;
16864
- const colTitle = formatText(column.getTitle(), 1);
16865
17173
  const isColGroup = column.children && column.children.length;
17174
+ const colTitle = formatText(column.getTitle(), 1);
16866
17175
  const isDisabled = checkMethod ? !checkMethod({
16867
17176
  column
16868
17177
  }) : false;
16869
- trVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tr', {
17178
+ colVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('li', {
16870
17179
  key: column.id,
16871
- colid: column.id,
16872
- class: [`vxe-table-custom-popup--row level--${column.level}`, {
17180
+ class: ['vxe-table-custom--option', `level--${column.level}`, {
16873
17181
  'is--group': isColGroup
16874
- }],
16875
- onDragstart: sortDragstartEvent,
16876
- onDragend: sortDragendEvent,
16877
- onDragover: sortDragoverEvent
16878
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
16879
- class: 'vxe-table-custom-popup--column-item col--sort'
16880
- }, [column.level === 1 ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
16881
- class: 'vxe-table-custom-popup--column-sort-btn',
16882
- onMousedown: sortMousedownEvent,
16883
- onMouseup: sortMouseupEvent
16884
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
16885
- class: 'vxe-icon-sort'
16886
- })]) : null]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
16887
- class: 'vxe-table-custom-popup--column-item col--name'
16888
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
16889
- class: 'vxe-table-custom-popup--name',
16890
- title: colTitle
16891
- }, colTitle)]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
16892
- class: 'vxe-table-custom-popup--column-item col--visible'
17182
+ }]
16893
17183
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
17184
+ title: colTitle,
16894
17185
  class: ['vxe-table-custom--checkbox-option', {
16895
17186
  'is--checked': isChecked,
16896
17187
  'is--indeterminate': isIndeterminate,
@@ -16903,40 +17194,168 @@ const Validator = VxeTableValidatorModule;
16903
17194
  }
16904
17195
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
16905
17196
  class: ['vxe-checkbox--icon', isIndeterminate ? conf.icon.TABLE_CHECKBOX_INDETERMINATE : isChecked ? conf.icon.TABLE_CHECKBOX_CHECKED : conf.icon.TABLE_CHECKBOX_UNCHECKED]
16906
- })])]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
16907
- class: 'vxe-table-custom-popup--column-item col--fixed'
16908
- }, [!parent && customOpts.allowFixed ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(group, {
16909
- modelValue: column.fixed || '',
16910
- type: 'button',
16911
- size: 'mini',
16912
- options: [{
16913
- label: conf.i18n('vxe.custom.setting.fixedLeft'),
16914
- value: 'left',
16915
- disabled: isMaxFixedColumn
16916
- }, {
16917
- label: conf.i18n('vxe.custom.setting.fixedUnset'),
16918
- value: ''
16919
- }, {
16920
- label: conf.i18n('vxe.custom.setting.fixedRight'),
16921
- value: 'right',
16922
- disabled: isMaxFixedColumn
17197
+ }), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
17198
+ class: 'vxe-checkbox--label'
17199
+ }, colTitle)]), !parent && customOpts.allowFixed ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
17200
+ class: 'vxe-table-custom--fixed-option'
17201
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
17202
+ class: ['vxe-table-custom--fixed-left-option', column.fixed === 'left' ? conf.icon.TOOLBAR_TOOLS_FIXED_LEFT_ACTIVED : conf.icon.TOOLBAR_TOOLS_FIXED_LEFT, {
17203
+ 'is--checked': column.fixed === 'left',
17204
+ 'is--disabled': isMaxFixedColumn && !column.fixed
16923
17205
  }],
16924
- 'onUpdate:modelValue'(value) {
16925
- column.fixed = value;
16926
- },
16927
- onChange() {
16928
- changePopupFixedOption(column);
17206
+ title: conf.i18n(column.fixed === 'left' ? 'vxe.toolbar.cancelfixed' : 'vxe.toolbar.fixedLeft'),
17207
+ onClick: () => {
17208
+ changeFixedOption(column, 'left');
16929
17209
  }
16930
- }) : null])]));
16931
- }
16932
- });
16933
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(modal, {
17210
+ }), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
17211
+ class: ['vxe-table-custom--fixed-right-option', column.fixed === 'right' ? conf.icon.TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVED : conf.icon.TOOLBAR_TOOLS_FIXED_RIGHT, {
17212
+ 'is--checked': column.fixed === 'right',
17213
+ 'is--disabled': isMaxFixedColumn && !column.fixed
17214
+ }],
17215
+ title: conf.i18n(column.fixed === 'right' ? 'vxe.toolbar.cancelfixed' : 'vxe.toolbar.fixedRight'),
17216
+ onClick: () => {
17217
+ changeFixedOption(column, 'right');
17218
+ }
17219
+ })]) : null]));
17220
+ }
17221
+ });
17222
+ const isAllChecked = customStore.isAll;
17223
+ const isAllIndeterminate = customStore.isIndeterminate;
17224
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
17225
+ ref: refElem,
17226
+ key: 'simple',
17227
+ class: ['vxe-table-custom-wrapper', {
17228
+ 'is--active': customStore.visible
17229
+ }]
17230
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('ul', {
17231
+ class: 'vxe-table-custom--header'
17232
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('li', {
17233
+ class: 'vxe-table-custom--option'
17234
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
17235
+ class: ['vxe-table-custom--checkbox-option', {
17236
+ 'is--checked': isAllChecked,
17237
+ 'is--indeterminate': isAllIndeterminate
17238
+ }],
17239
+ title: conf.i18n('vxe.table.allTitle'),
17240
+ onClick: allCustomEvent
17241
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
17242
+ class: ['vxe-checkbox--icon', isAllIndeterminate ? conf.icon.TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? conf.icon.TABLE_CHECKBOX_CHECKED : conf.icon.TABLE_CHECKBOX_UNCHECKED]
17243
+ }), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
17244
+ class: 'vxe-checkbox--label'
17245
+ }, conf.i18n('vxe.toolbar.customAll'))])])]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('ul', {
17246
+ class: 'vxe-table-custom--body',
17247
+ style: maxHeight ? {
17248
+ maxHeight: `${maxHeight}px`
17249
+ } : {},
17250
+ ...customWrapperOns
17251
+ }, colVNs), customOpts.showFooter ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
17252
+ class: 'vxe-table-custom--footer'
17253
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('button', {
17254
+ class: 'btn--reset',
17255
+ onClick: resetCustomEvent
17256
+ }, customOpts.resetButtonText || conf.i18n('vxe.toolbar.customRestore')), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('button', {
17257
+ class: 'btn--confirm',
17258
+ onClick: confirmCustomEvent
17259
+ }, customOpts.confirmButtonText || conf.i18n('vxe.toolbar.customConfirm'))]) : null]);
17260
+ };
17261
+ const renderPopupPanel = () => {
17262
+ const {
17263
+ customStore
17264
+ } = props;
17265
+ const {
17266
+ customColumnList
17267
+ } = reactData;
17268
+ const customOpts = computeCustomOpts.value;
17269
+ const {
17270
+ checkMethod,
17271
+ visibleMethod
17272
+ } = customOpts;
17273
+ const columnOpts = computeColumnOpts.value;
17274
+ const isMaxFixedColumn = computeIsMaxFixedColumn.value;
17275
+ const trVNs = [];
17276
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, (column, index, items, path, parent) => {
17277
+ const isVisible = visibleMethod ? visibleMethod({
17278
+ column
17279
+ }) : true;
17280
+ if (isVisible) {
17281
+ const isChecked = column.visible;
17282
+ const isIndeterminate = column.halfVisible;
17283
+ const colTitle = formatText(column.getTitle(), 1);
17284
+ const isColGroup = column.children && column.children.length;
17285
+ const isDisabled = checkMethod ? !checkMethod({
17286
+ column
17287
+ }) : false;
17288
+ trVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tr', {
17289
+ key: column.id,
17290
+ colid: column.id,
17291
+ class: [`vxe-table-custom-popup--row level--${column.level}`, {
17292
+ 'is--group': isColGroup
17293
+ }],
17294
+ onDragstart: sortDragstartEvent,
17295
+ onDragend: sortDragendEvent,
17296
+ onDragover: sortDragoverEvent
17297
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
17298
+ class: 'vxe-table-custom-popup--column-item col--sort'
17299
+ }, [column.level === 1 ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
17300
+ class: 'vxe-table-custom-popup--column-sort-btn',
17301
+ onMousedown: sortMousedownEvent,
17302
+ onMouseup: sortMouseupEvent
17303
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
17304
+ class: 'vxe-icon-sort'
17305
+ })]) : null]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
17306
+ class: 'vxe-table-custom-popup--column-item col--name'
17307
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
17308
+ class: 'vxe-table-custom-popup--name',
17309
+ title: colTitle
17310
+ }, colTitle)]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
17311
+ class: 'vxe-table-custom-popup--column-item col--visible'
17312
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
17313
+ class: ['vxe-table-custom--checkbox-option', {
17314
+ 'is--checked': isChecked,
17315
+ 'is--indeterminate': isIndeterminate,
17316
+ 'is--disabled': isDisabled
17317
+ }],
17318
+ onClick: () => {
17319
+ if (!isDisabled) {
17320
+ changeCheckboxOption(column);
17321
+ }
17322
+ }
17323
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
17324
+ class: ['vxe-checkbox--icon', isIndeterminate ? conf.icon.TABLE_CHECKBOX_INDETERMINATE : isChecked ? conf.icon.TABLE_CHECKBOX_CHECKED : conf.icon.TABLE_CHECKBOX_UNCHECKED]
17325
+ })])]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
17326
+ class: 'vxe-table-custom-popup--column-item col--fixed'
17327
+ }, [!parent && customOpts.allowFixed ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(group, {
17328
+ modelValue: column.fixed || '',
17329
+ type: 'button',
17330
+ size: 'mini',
17331
+ options: [{
17332
+ label: conf.i18n('vxe.custom.setting.fixedLeft'),
17333
+ value: 'left',
17334
+ disabled: isMaxFixedColumn
17335
+ }, {
17336
+ label: conf.i18n('vxe.custom.setting.fixedUnset'),
17337
+ value: ''
17338
+ }, {
17339
+ label: conf.i18n('vxe.custom.setting.fixedRight'),
17340
+ value: 'right',
17341
+ disabled: isMaxFixedColumn
17342
+ }],
17343
+ 'onUpdate:modelValue'(value) {
17344
+ column.fixed = value;
17345
+ },
17346
+ onChange() {
17347
+ changePopupFixedOption(column);
17348
+ }
17349
+ }) : null])]));
17350
+ }
17351
+ });
17352
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(modal, {
16934
17353
  key: 'popup',
16935
17354
  className: 'vxe-table-custom-popup-wrapper vxe-table--ignore-clear',
16936
17355
  modelValue: customStore.visible,
16937
17356
  title: conf.i18n('vxe.custom.cstmTitle'),
16938
17357
  width: '40vw',
16939
- minWidth: 500,
17358
+ minWidth: 520,
16940
17359
  height: '50vh',
16941
17360
  minHeight: 300,
16942
17361
  mask: true,
@@ -16957,9 +17376,9 @@ const Validator = VxeTableValidatorModule;
16957
17376
  class: 'vxe-table-custom-popup--table-wrapper'
16958
17377
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('table', {}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('colgroup', {}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('col', {
16959
17378
  style: {
16960
- width: '60px'
17379
+ width: '80px'
16961
17380
  }
16962
- }), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('col'), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('col', {
17381
+ }), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('col', {}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('col', {
16963
17382
  style: {
16964
17383
  width: '80px'
16965
17384
  }
@@ -16967,7 +17386,18 @@ const Validator = VxeTableValidatorModule;
16967
17386
  style: {
16968
17387
  width: '200px'
16969
17388
  }
16970
- })]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('thead', {}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tr', {}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('th', {}, conf.i18n('vxe.custom.setting.colSort')), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('th', {}, conf.i18n('vxe.custom.setting.colTitle')), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('th', {}, conf.i18n('vxe.custom.setting.colVisible')), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('th', {}, conf.i18n('vxe.custom.setting.colFixed'))])]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.TransitionGroup, {
17389
+ })]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('thead', {}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tr', {}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('th', {}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
17390
+ class: 'vxe-table-custom-popup--table-sort-help-title'
17391
+ }, conf.i18n('vxe.custom.setting.colSort')), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(tooltip, {
17392
+ enterable: true,
17393
+ content: conf.i18n('vxe.custom.setting.sortHelpTip')
17394
+ }, {
17395
+ default: () => {
17396
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
17397
+ class: 'vxe-table-custom-popup--table-sort-help-icon vxe-icon-question-circle-fill'
17398
+ });
17399
+ }
17400
+ })]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('th', {}, conf.i18n('vxe.custom.setting.colTitle')), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('th', {}, conf.i18n('vxe.custom.setting.colVisible')), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('th', {}, conf.i18n('vxe.custom.setting.colFixed', [columnOpts.maxFixedSize || 0]))])]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.TransitionGroup, {
16971
17401
  class: 'vxe-table-custom--body',
16972
17402
  tag: 'tbody',
16973
17403
  name: 'vxe-table-custom--flip'
@@ -20756,6 +21186,11 @@ const sortStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_SORT';
20756
21186
  row: null,
20757
21187
  column: null
20758
21188
  },
21189
+ // 当前被强制聚焦单元格,只会在鼠标点击后算聚焦
21190
+ focused: {
21191
+ row: null,
21192
+ column: null
21193
+ },
20759
21194
  insertMaps: {},
20760
21195
  removeMaps: {}
20761
21196
  },
@@ -25243,6 +25678,7 @@ const sortStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_SORT';
25243
25678
  return !!rowExpandedMaps[rowid];
25244
25679
  },
25245
25680
  isExpandByRow(row) {
25681
+ // 已废弃
25246
25682
  if (true) {
25247
25683
  warnLog('vxe.error.delFunc', ['isExpandByRow', 'isRowExpandByRow']);
25248
25684
  }
@@ -25824,7 +26260,7 @@ const sortStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_SORT';
25824
26260
  // 如果是激活状态,点击了单元格之外
25825
26261
  if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-clear').flag) {
25826
26262
  // 如果手动调用了激活单元格,避免触发源被移除后导致重复关闭
25827
- tablePrivateMethods.preventEvent(evnt, 'event.clearActived', actived.args, () => {
26263
+ tablePrivateMethods.preventEvent(evnt, 'event.clearEdit', actived.args, () => {
25828
26264
  let isClear;
25829
26265
  if (editOpts.mode === 'row') {
25830
26266
  const rowTargetNode = getEventTargetNode(evnt, el, 'vxe-body--row');
@@ -26770,7 +27206,12 @@ const sortStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_SORT';
26770
27206
  reactData.reColumnFlag++;
26771
27207
  },
26772
27208
  preventEvent(evnt, type, args, next, end) {
26773
- const evntList = VXETable.interceptor.get(type);
27209
+ let evntList = VXETable.interceptor.get(type);
27210
+ // 兼容老版本
27211
+ if (!evntList.length && type === 'event.clearEdit') {
27212
+ evntList = VXETable.interceptor.get('event.clearActived');
27213
+ }
27214
+ // 兼容老版本
26774
27215
  let rest;
26775
27216
  if (!evntList.some(func => func(Object.assign({
26776
27217
  $grid: $xegrid,
@@ -27488,7 +27929,7 @@ const sortStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_SORT';
27488
27929
  } = expandOpts;
27489
27930
  const rowid = getRowid($xetable, row);
27490
27931
  if (!lazy || !rowExpandLazyLoadedMaps[rowid]) {
27491
- const expanded = !tableMethods.isExpandByRow(row);
27932
+ const expanded = !tableMethods.isRowExpandByRow(row);
27492
27933
  const columnIndex = tableMethods.getColumnIndex(column);
27493
27934
  const $columnIndex = tableMethods.getVMColumnIndex(column);
27494
27935
  tableMethods.setRowExpand(row, expanded);
@@ -29653,635 +30094,223 @@ dynamicApp.component(src_button.name, src_button);
29653
30094
  emit(type, Object.assign({
29654
30095
  $toolbar: $xetoolbar,
29655
30096
  $event: evnt
29656
- }, params));
29657
- },
29658
- syncUpdate(params) {
29659
- const {
29660
- collectColumn
29661
- } = params;
29662
- $xetable = params.$table;
29663
- reactData.columns = collectColumn;
29664
- connectFlag.value++;
29665
- }
29666
- };
29667
- Object.assign($xetoolbar, toolbarMethods);
29668
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
29669
- const {
29670
- refresh
29671
- } = props;
29672
- const refreshOpts = computeRefreshOpts.value;
29673
- const queryMethod = refreshOpts.queryMethod || refreshOpts.query;
29674
- if (refresh && !$xegrid && !queryMethod) {
29675
- warnLog('vxe.error.notFunc', ['queryMethod']);
29676
- }
29677
- const customOpts = computeCustomOpts.value;
29678
- if (true) {
29679
- if (customOpts.isFooter) {
29680
- warnLog('vxe.error.delProp', ['toolbar.custom.isFooter', 'table.custom-config.showFooter']);
29681
- }
29682
- if (customOpts.showFooter) {
29683
- warnLog('vxe.error.delProp', ['toolbar.custom.showFooter', 'table.custom-config.showFooter']);
29684
- }
29685
- if (customOpts.immediate) {
29686
- warnLog('vxe.error.delProp', ['toolbar.custom.immediate', 'table.custom-config.immediate']);
29687
- }
29688
- if (customOpts.trigger) {
29689
- warnLog('vxe.error.delProp', ['toolbar.custom.trigger', 'table.custom-config.trigger']);
29690
- }
29691
- }
29692
- });
29693
- const renderVN = () => {
29694
- const {
29695
- perfect,
29696
- loading,
29697
- refresh,
29698
- zoom,
29699
- custom,
29700
- className
29701
- } = props;
29702
- const vSize = computeSize.value;
29703
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
29704
- ref: refElem,
29705
- class: ['vxe-toolbar', className ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(className) ? className({
29706
- $toolbar: $xetoolbar
29707
- }) : className : '', {
29708
- [`size--${vSize}`]: vSize,
29709
- 'is--perfect': perfect,
29710
- 'is--loading': loading
29711
- }]
29712
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
29713
- class: 'vxe-buttons--wrapper'
29714
- }, renderBtns()), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
29715
- class: 'vxe-tools--wrapper'
29716
- }, renderRightTools()), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
29717
- class: 'vxe-tools--operate'
29718
- }, [props.import ? renderToolImport() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), props.export ? renderToolExport() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), props.print ? renderToolPrint() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), refresh ? renderToolRefresh() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), zoom && $xegrid ? renderToolZoom() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), custom ? renderToolCustom() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()])]);
29719
- };
29720
- $xetoolbar.renderVN = renderVN;
29721
- return $xetoolbar;
29722
- },
29723
- render() {
29724
- return this.renderVN();
29725
- }
29726
- }));
29727
- ;// CONCATENATED MODULE: ./packages/toolbar/index.ts
29728
-
29729
-
29730
- const VxeToolbar = Object.assign(toolbar, {
29731
- install: function (app) {
29732
- app.component(toolbar.name, toolbar);
29733
- }
29734
- });
29735
- const Toolbar = VxeToolbar;
29736
- dynamicApp.component(toolbar.name, toolbar);
29737
- /* harmony default export */ var packages_toolbar = (VxeToolbar);
29738
- ;// CONCATENATED MODULE: ./packages/form/src/itemInfo.ts
29739
-
29740
- class ItemInfo {
29741
- constructor($xeform, item) {
29742
- Object.assign(this, {
29743
- id: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId('item_'),
29744
- title: item.title,
29745
- field: item.field,
29746
- span: item.span,
29747
- align: item.align,
29748
- titleAlign: item.titleAlign,
29749
- titleWidth: item.titleWidth,
29750
- titleColon: item.titleColon,
29751
- titleAsterisk: item.titleAsterisk,
29752
- titlePrefix: item.titlePrefix,
29753
- titleSuffix: item.titleSuffix,
29754
- titleOverflow: item.titleOverflow,
29755
- showTitle: item.showTitle,
29756
- resetValue: item.resetValue,
29757
- visibleMethod: item.visibleMethod,
29758
- visible: item.visible,
29759
- folding: item.folding,
29760
- collapseNode: item.collapseNode,
29761
- className: item.className,
29762
- contentClassName: item.contentClassName,
29763
- contentStyle: item.contentStyle,
29764
- titleClassName: item.titleClassName,
29765
- titleStyle: item.titleStyle,
29766
- itemRender: item.itemRender,
29767
- // 渲染属性
29768
- showError: false,
29769
- errRule: null,
29770
- slots: item.slots,
29771
- children: []
29772
- });
29773
- }
29774
- update(name, value) {
29775
- this[name] = value;
29776
- }
29777
- }
29778
- ;// CONCATENATED MODULE: ./packages/form/src/util.ts
29779
-
29780
-
29781
-
29782
-
29783
-
29784
- function isFormItem(item) {
29785
- return item instanceof ItemInfo;
29786
- }
29787
- function createItem($xeform, _vm) {
29788
- return isFormItem(_vm) ? _vm : new ItemInfo($xeform, _vm);
29789
- }
29790
- function handleFieldOrItem($xeform, fieldOrItem) {
29791
- if (fieldOrItem) {
29792
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrItem) ? $xeform.getItemByField(fieldOrItem) : fieldOrItem;
29793
- }
29794
- return null;
29795
- }
29796
- function isHiddenItem($xeform, formItem) {
29797
- const {
29798
- reactData
29799
- } = $xeform;
29800
- const {
29801
- collapseAll
29802
- } = reactData;
29803
- const {
29804
- folding,
29805
- visible
29806
- } = formItem;
29807
- return visible === false || folding && collapseAll;
29808
- }
29809
- function isActivetem($xeform, formItem) {
29810
- let {
29811
- visibleMethod,
29812
- itemRender,
29813
- visible,
29814
- field
29815
- } = formItem;
29816
- if (visible === false) {
29817
- return visible;
29818
- }
29819
- const compConf = isEnableConf(itemRender) ? VXETable.renderer.get(itemRender.name) : null;
29820
- if (!visibleMethod && compConf && compConf.itemVisibleMethod) {
29821
- visibleMethod = compConf.itemVisibleMethod;
29822
- }
29823
- if (!visibleMethod) {
29824
- return true;
29825
- }
29826
- const {
29827
- data
29828
- } = $xeform.props;
29829
- return visibleMethod({
29830
- data,
29831
- field,
29832
- property: field,
29833
- item: formItem,
29834
- $form: $xeform,
29835
- $grid: $xeform.xegrid
29836
- });
29837
- }
29838
- function watchItem(props, formItem) {
29839
- Object.keys(props).forEach(name => {
29840
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props[name], value => {
29841
- formItem.update(name, value);
29842
- });
29843
- });
29844
- }
29845
- function assemItem($xeform, el, formItem, formGather) {
29846
- const {
29847
- reactData
29848
- } = $xeform;
29849
- const {
29850
- staticItems
29851
- } = reactData;
29852
- const parentElem = el.parentNode;
29853
- const parentItem = formGather ? formGather.formItem : null;
29854
- const parentItems = parentItem ? parentItem.children : staticItems;
29855
- if (parentElem) {
29856
- parentItems.splice(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayIndexOf(parentElem.children, el), 0, formItem);
29857
- reactData.staticItems = staticItems.slice(0);
29858
- }
29859
- }
29860
- function destroyItem($xeform, formItem) {
29861
- const {
29862
- reactData
29863
- } = $xeform;
29864
- const {
29865
- staticItems
29866
- } = reactData;
29867
- const index = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(staticItems, item => item.id === formItem.id);
29868
- if (index > -1) {
29869
- staticItems.splice(index, 1);
29870
- }
29871
- reactData.staticItems = staticItems.slice(0);
29872
- }
29873
- ;// CONCATENATED MODULE: ./packages/tooltip/src/tooltip.ts
29874
-
29875
-
29876
-
29877
-
29878
-
29879
-
29880
-
29881
- /* harmony default export */ var tooltip = ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.defineComponent)({
29882
- name: 'VxeTooltip',
29883
- props: {
29884
- modelValue: Boolean,
29885
- size: {
29886
- type: String,
29887
- default: () => conf.tooltip.size || conf.size
29888
- },
29889
- trigger: {
29890
- type: String,
29891
- default: () => conf.tooltip.trigger
29892
- },
29893
- theme: {
29894
- type: String,
29895
- default: () => conf.tooltip.theme
29896
- },
29897
- content: {
29898
- type: [String, Number],
29899
- default: null
29900
- },
29901
- useHTML: Boolean,
29902
- zIndex: [String, Number],
29903
- popupClassName: [String, Function],
29904
- isArrow: {
29905
- type: Boolean,
29906
- default: true
29907
- },
29908
- enterable: Boolean,
29909
- enterDelay: {
29910
- type: Number,
29911
- default: () => conf.tooltip.enterDelay
29912
- },
29913
- leaveDelay: {
29914
- type: Number,
29915
- default: () => conf.tooltip.leaveDelay
29916
- }
29917
- },
29918
- emits: ['update:modelValue'],
29919
- setup(props, context) {
29920
- const {
29921
- slots,
29922
- emit
29923
- } = context;
29924
- const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
29925
- const computeSize = useSize(props);
29926
- const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({
29927
- target: null,
29928
- isUpdate: false,
29929
- visible: false,
29930
- tipContent: '',
29931
- tipActive: false,
29932
- tipTarget: null,
29933
- tipZindex: 0,
29934
- tipStore: {
29935
- style: {},
29936
- placement: '',
29937
- arrowStyle: {}
29938
- }
29939
- });
29940
- const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
29941
- const refMaps = {
29942
- refElem
29943
- };
29944
- const $xetooltip = {
29945
- xID,
29946
- props,
29947
- context,
29948
- reactData,
29949
- getRefMaps: () => refMaps
29950
- };
29951
- let tooltipMethods = {};
29952
- const updateTipStyle = () => {
29953
- const {
29954
- tipTarget,
29955
- tipStore
29956
- } = reactData;
29957
- if (tipTarget) {
29958
- const {
29959
- scrollTop,
29960
- scrollLeft,
29961
- visibleWidth
29962
- } = getDomNode();
29963
- const {
29964
- top,
29965
- left
29966
- } = getAbsolutePos(tipTarget);
29967
- const el = refElem.value;
29968
- const marginSize = 6;
29969
- const offsetHeight = el.offsetHeight;
29970
- const offsetWidth = el.offsetWidth;
29971
- let tipLeft = left;
29972
- let tipTop = top - offsetHeight - marginSize;
29973
- tipLeft = Math.max(marginSize, left + Math.floor((tipTarget.offsetWidth - offsetWidth) / 2));
29974
- if (tipLeft + offsetWidth + marginSize > scrollLeft + visibleWidth) {
29975
- tipLeft = scrollLeft + visibleWidth - offsetWidth - marginSize;
29976
- }
29977
- if (top - offsetHeight < scrollTop + marginSize) {
29978
- tipStore.placement = 'bottom';
29979
- tipTop = top + tipTarget.offsetHeight + marginSize;
29980
- }
29981
- tipStore.style.top = `${tipTop}px`;
29982
- tipStore.style.left = `${tipLeft}px`;
29983
- tipStore.arrowStyle.left = `${left - tipLeft + tipTarget.offsetWidth / 2}px`;
29984
- }
29985
- };
29986
- const updateValue = value => {
29987
- if (value !== reactData.visible) {
29988
- reactData.visible = value;
29989
- reactData.isUpdate = true;
29990
- emit('update:modelValue', value);
29991
- }
29992
- };
29993
- const updateZindex = () => {
29994
- if (reactData.tipZindex < getLastZIndex()) {
29995
- reactData.tipZindex = nextZIndex();
29996
- }
29997
- };
29998
- const clickEvent = () => {
29999
- if (reactData.visible) {
30000
- tooltipMethods.close();
30001
- } else {
30002
- tooltipMethods.open();
30003
- }
30004
- };
30005
- const targetMouseenterEvent = () => {
30006
- tooltipMethods.open();
30007
- };
30008
- const targetMouseleaveEvent = () => {
30009
- const {
30010
- trigger,
30011
- enterable,
30012
- leaveDelay
30013
- } = props;
30014
- reactData.tipActive = false;
30015
- if (enterable && trigger === 'hover') {
30016
- setTimeout(() => {
30017
- if (!reactData.tipActive) {
30018
- tooltipMethods.close();
30019
- }
30020
- }, leaveDelay);
30021
- } else {
30022
- tooltipMethods.close();
30023
- }
30024
- };
30025
- const wrapperMouseenterEvent = () => {
30026
- reactData.tipActive = true;
30027
- };
30028
- const wrapperMouseleaveEvent = () => {
30029
- const {
30030
- trigger,
30031
- enterable,
30032
- leaveDelay
30033
- } = props;
30034
- reactData.tipActive = false;
30035
- if (enterable && trigger === 'hover') {
30036
- setTimeout(() => {
30037
- if (!reactData.tipActive) {
30038
- tooltipMethods.close();
30039
- }
30040
- }, leaveDelay);
30041
- }
30042
- };
30043
- const showTip = () => {
30044
- const {
30045
- tipStore
30046
- } = reactData;
30047
- const el = refElem.value;
30048
- if (el) {
30049
- const parentNode = el.parentNode;
30050
- if (!parentNode) {
30051
- document.body.appendChild(el);
30052
- }
30053
- }
30054
- updateValue(true);
30055
- updateZindex();
30056
- tipStore.placement = 'top';
30057
- tipStore.style = {
30058
- width: 'auto',
30059
- left: 0,
30060
- top: 0,
30061
- zIndex: props.zIndex || reactData.tipZindex
30062
- };
30063
- tipStore.arrowStyle = {
30064
- left: '50%'
30065
- };
30066
- return tooltipMethods.updatePlacement();
30067
- };
30068
- const showDelayTip = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().debounce(() => {
30069
- if (reactData.tipActive) {
30070
- showTip();
30071
- }
30072
- }, props.enterDelay, {
30073
- leading: false,
30074
- trailing: true
30075
- });
30076
- tooltipMethods = {
30077
- dispatchEvent(type, params, evnt) {
30078
- emit(type, Object.assign({
30079
- $tooltip: $xetooltip,
30080
- $event: evnt
30081
- }, params));
30082
- },
30083
- open(target, content) {
30084
- return tooltipMethods.toVisible(target || reactData.target, content);
30085
- },
30086
- close() {
30087
- reactData.tipTarget = null;
30088
- reactData.tipActive = false;
30089
- Object.assign(reactData.tipStore, {
30090
- style: {},
30091
- placement: '',
30092
- arrowStyle: null
30093
- });
30094
- updateValue(false);
30095
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
30096
- },
30097
- toVisible(target, content) {
30098
- if (target) {
30099
- const {
30100
- trigger,
30101
- enterDelay
30102
- } = props;
30103
- reactData.tipActive = true;
30104
- reactData.tipTarget = target;
30105
- if (content) {
30106
- reactData.tipContent = content;
30107
- }
30108
- if (enterDelay && trigger === 'hover') {
30109
- showDelayTip();
30110
- } else {
30111
- return showTip();
30112
- }
30113
- }
30114
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
30115
- },
30116
- updatePlacement() {
30117
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
30118
- const {
30119
- tipTarget
30120
- } = reactData;
30121
- const el = refElem.value;
30122
- if (tipTarget && el) {
30123
- updateTipStyle();
30124
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(updateTipStyle);
30125
- }
30126
- });
30127
- },
30128
- isActived() {
30129
- return reactData.tipActive;
30130
- },
30131
- setActived(actived) {
30132
- reactData.tipActive = !!actived;
30133
- }
30134
- };
30135
- Object.assign($xetooltip, tooltipMethods);
30136
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.content, () => {
30137
- reactData.tipContent = props.content;
30138
- });
30139
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.modelValue, () => {
30140
- if (!reactData.isUpdate) {
30141
- if (props.modelValue) {
30142
- tooltipMethods.open();
30143
- } else {
30144
- tooltipMethods.close();
30145
- }
30146
- }
30147
- reactData.isUpdate = false;
30148
- });
30149
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
30150
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
30151
- const {
30152
- trigger,
30153
- content,
30154
- modelValue
30155
- } = props;
30156
- const wrapperElem = refElem.value;
30157
- if (wrapperElem) {
30158
- const parentNode = wrapperElem.parentNode;
30159
- if (parentNode) {
30160
- reactData.tipContent = content;
30161
- reactData.tipZindex = nextZIndex();
30162
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(wrapperElem.children, (elem, index) => {
30163
- if (index > 1) {
30164
- parentNode.insertBefore(elem, wrapperElem);
30165
- if (!reactData.target) {
30166
- reactData.target = elem;
30167
- }
30168
- }
30169
- });
30170
- parentNode.removeChild(wrapperElem);
30171
- const {
30172
- target
30173
- } = reactData;
30174
- if (target) {
30175
- if (trigger === 'hover') {
30176
- target.onmouseenter = targetMouseenterEvent;
30177
- target.onmouseleave = targetMouseleaveEvent;
30178
- } else if (trigger === 'click') {
30179
- target.onclick = clickEvent;
30180
- }
30181
- }
30182
- if (modelValue) {
30183
- tooltipMethods.open();
30184
- }
30185
- }
30186
- }
30187
- });
30188
- });
30189
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onBeforeUnmount)(() => {
30190
- const {
30191
- trigger
30192
- } = props;
30193
- const {
30194
- target
30195
- } = reactData;
30196
- const wrapperElem = refElem.value;
30197
- if (target) {
30198
- if (trigger === 'hover') {
30199
- target.onmouseenter = null;
30200
- target.onmouseleave = null;
30201
- } else if (trigger === 'click') {
30202
- target.onclick = null;
30203
- }
30204
- }
30205
- if (wrapperElem) {
30206
- const parentNode = wrapperElem.parentNode;
30207
- if (parentNode) {
30208
- parentNode.removeChild(wrapperElem);
30209
- }
30097
+ }, params));
30098
+ },
30099
+ syncUpdate(params) {
30100
+ const {
30101
+ collectColumn
30102
+ } = params;
30103
+ $xetable = params.$table;
30104
+ reactData.columns = collectColumn;
30105
+ connectFlag.value++;
30210
30106
  }
30211
- });
30212
- const renderContent = () => {
30107
+ };
30108
+ Object.assign($xetoolbar, toolbarMethods);
30109
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
30213
30110
  const {
30214
- useHTML
30111
+ refresh
30215
30112
  } = props;
30216
- const {
30217
- tipContent
30218
- } = reactData;
30219
- const contentSlot = slots.content;
30220
- if (contentSlot) {
30221
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
30222
- key: 1,
30223
- class: 'vxe-table--tooltip-content'
30224
- }, getSlotVNs(contentSlot({})));
30113
+ const refreshOpts = computeRefreshOpts.value;
30114
+ const queryMethod = refreshOpts.queryMethod || refreshOpts.query;
30115
+ if (refresh && !$xegrid && !queryMethod) {
30116
+ warnLog('vxe.error.notFunc', ['queryMethod']);
30225
30117
  }
30226
- if (useHTML) {
30227
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
30228
- key: 2,
30229
- class: 'vxe-table--tooltip-content',
30230
- innerHTML: tipContent
30231
- });
30118
+ const customOpts = computeCustomOpts.value;
30119
+ if (true) {
30120
+ if (customOpts.isFooter) {
30121
+ warnLog('vxe.error.delProp', ['toolbar.custom.isFooter', 'table.custom-config.showFooter']);
30122
+ }
30123
+ if (customOpts.showFooter) {
30124
+ warnLog('vxe.error.delProp', ['toolbar.custom.showFooter', 'table.custom-config.showFooter']);
30125
+ }
30126
+ if (customOpts.immediate) {
30127
+ warnLog('vxe.error.delProp', ['toolbar.custom.immediate', 'table.custom-config.immediate']);
30128
+ }
30129
+ if (customOpts.trigger) {
30130
+ warnLog('vxe.error.delProp', ['toolbar.custom.trigger', 'table.custom-config.trigger']);
30131
+ }
30232
30132
  }
30233
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
30234
- key: 3,
30235
- class: 'vxe-table--tooltip-content'
30236
- }, formatText(tipContent));
30237
- };
30133
+ });
30238
30134
  const renderVN = () => {
30239
30135
  const {
30240
- popupClassName,
30241
- theme,
30242
- isArrow,
30243
- enterable
30136
+ perfect,
30137
+ loading,
30138
+ refresh,
30139
+ zoom,
30140
+ custom,
30141
+ className
30244
30142
  } = props;
30245
- const {
30246
- tipActive,
30247
- visible,
30248
- tipStore
30249
- } = reactData;
30250
- const defaultSlot = slots.default;
30251
30143
  const vSize = computeSize.value;
30252
- let ons;
30253
- if (enterable) {
30254
- ons = {
30255
- onMouseenter: wrapperMouseenterEvent,
30256
- onMouseleave: wrapperMouseleaveEvent
30257
- };
30258
- }
30259
30144
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
30260
30145
  ref: refElem,
30261
- class: ['vxe-table--tooltip-wrapper', `theme--${theme}`, popupClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(popupClassName) ? popupClassName({
30262
- $tooltip: $xetooltip
30263
- }) : popupClassName : '', {
30146
+ class: ['vxe-toolbar', className ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(className) ? className({
30147
+ $toolbar: $xetoolbar
30148
+ }) : className : '', {
30264
30149
  [`size--${vSize}`]: vSize,
30265
- [`placement--${tipStore.placement}`]: tipStore.placement,
30266
- 'is--enterable': enterable,
30267
- 'is--visible': visible,
30268
- 'is--arrow': isArrow,
30269
- 'is--active': tipActive
30270
- }],
30271
- style: tipStore.style,
30272
- ...ons
30273
- }, [renderContent(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
30274
- class: 'vxe-table--tooltip-arrow',
30275
- style: tipStore.arrowStyle
30276
- }), ...(defaultSlot ? getSlotVNs(defaultSlot({})) : [])]);
30150
+ 'is--perfect': perfect,
30151
+ 'is--loading': loading
30152
+ }]
30153
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
30154
+ class: 'vxe-buttons--wrapper'
30155
+ }, renderBtns()), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
30156
+ class: 'vxe-tools--wrapper'
30157
+ }, renderRightTools()), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
30158
+ class: 'vxe-tools--operate'
30159
+ }, [props.import ? renderToolImport() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), props.export ? renderToolExport() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), props.print ? renderToolPrint() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), refresh ? renderToolRefresh() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), zoom && $xegrid ? renderToolZoom() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), custom ? renderToolCustom() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()])]);
30277
30160
  };
30278
- $xetooltip.renderVN = renderVN;
30279
- return $xetooltip;
30161
+ $xetoolbar.renderVN = renderVN;
30162
+ return $xetoolbar;
30280
30163
  },
30281
30164
  render() {
30282
30165
  return this.renderVN();
30283
30166
  }
30284
30167
  }));
30168
+ ;// CONCATENATED MODULE: ./packages/toolbar/index.ts
30169
+
30170
+
30171
+ const VxeToolbar = Object.assign(toolbar, {
30172
+ install: function (app) {
30173
+ app.component(toolbar.name, toolbar);
30174
+ }
30175
+ });
30176
+ const Toolbar = VxeToolbar;
30177
+ dynamicApp.component(toolbar.name, toolbar);
30178
+ /* harmony default export */ var packages_toolbar = (VxeToolbar);
30179
+ ;// CONCATENATED MODULE: ./packages/form/src/itemInfo.ts
30180
+
30181
+ class ItemInfo {
30182
+ constructor($xeform, item) {
30183
+ Object.assign(this, {
30184
+ id: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId('item_'),
30185
+ title: item.title,
30186
+ field: item.field,
30187
+ span: item.span,
30188
+ align: item.align,
30189
+ titleAlign: item.titleAlign,
30190
+ titleWidth: item.titleWidth,
30191
+ titleColon: item.titleColon,
30192
+ titleAsterisk: item.titleAsterisk,
30193
+ titlePrefix: item.titlePrefix,
30194
+ titleSuffix: item.titleSuffix,
30195
+ titleOverflow: item.titleOverflow,
30196
+ showTitle: item.showTitle,
30197
+ resetValue: item.resetValue,
30198
+ visibleMethod: item.visibleMethod,
30199
+ visible: item.visible,
30200
+ folding: item.folding,
30201
+ collapseNode: item.collapseNode,
30202
+ className: item.className,
30203
+ contentClassName: item.contentClassName,
30204
+ contentStyle: item.contentStyle,
30205
+ titleClassName: item.titleClassName,
30206
+ titleStyle: item.titleStyle,
30207
+ itemRender: item.itemRender,
30208
+ // 渲染属性
30209
+ showError: false,
30210
+ errRule: null,
30211
+ slots: item.slots,
30212
+ children: []
30213
+ });
30214
+ }
30215
+ update(name, value) {
30216
+ this[name] = value;
30217
+ }
30218
+ }
30219
+ ;// CONCATENATED MODULE: ./packages/form/src/util.ts
30220
+
30221
+
30222
+
30223
+
30224
+
30225
+ function isFormItem(item) {
30226
+ return item instanceof ItemInfo;
30227
+ }
30228
+ function createItem($xeform, _vm) {
30229
+ return isFormItem(_vm) ? _vm : new ItemInfo($xeform, _vm);
30230
+ }
30231
+ function handleFieldOrItem($xeform, fieldOrItem) {
30232
+ if (fieldOrItem) {
30233
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrItem) ? $xeform.getItemByField(fieldOrItem) : fieldOrItem;
30234
+ }
30235
+ return null;
30236
+ }
30237
+ function isHiddenItem($xeform, formItem) {
30238
+ const {
30239
+ reactData
30240
+ } = $xeform;
30241
+ const {
30242
+ collapseAll
30243
+ } = reactData;
30244
+ const {
30245
+ folding,
30246
+ visible
30247
+ } = formItem;
30248
+ return visible === false || folding && collapseAll;
30249
+ }
30250
+ function isActivetem($xeform, formItem) {
30251
+ let {
30252
+ visibleMethod,
30253
+ itemRender,
30254
+ visible,
30255
+ field
30256
+ } = formItem;
30257
+ if (visible === false) {
30258
+ return visible;
30259
+ }
30260
+ const compConf = isEnableConf(itemRender) ? VXETable.renderer.get(itemRender.name) : null;
30261
+ if (!visibleMethod && compConf && compConf.itemVisibleMethod) {
30262
+ visibleMethod = compConf.itemVisibleMethod;
30263
+ }
30264
+ if (!visibleMethod) {
30265
+ return true;
30266
+ }
30267
+ const {
30268
+ data
30269
+ } = $xeform.props;
30270
+ return visibleMethod({
30271
+ data,
30272
+ field,
30273
+ property: field,
30274
+ item: formItem,
30275
+ $form: $xeform,
30276
+ $grid: $xeform.xegrid
30277
+ });
30278
+ }
30279
+ function watchItem(props, formItem) {
30280
+ Object.keys(props).forEach(name => {
30281
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props[name], value => {
30282
+ formItem.update(name, value);
30283
+ });
30284
+ });
30285
+ }
30286
+ function assemItem($xeform, el, formItem, formGather) {
30287
+ const {
30288
+ reactData
30289
+ } = $xeform;
30290
+ const {
30291
+ staticItems
30292
+ } = reactData;
30293
+ const parentElem = el.parentNode;
30294
+ const parentItem = formGather ? formGather.formItem : null;
30295
+ const parentItems = parentItem ? parentItem.children : staticItems;
30296
+ if (parentElem) {
30297
+ parentItems.splice(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayIndexOf(parentElem.children, el), 0, formItem);
30298
+ reactData.staticItems = staticItems.slice(0);
30299
+ }
30300
+ }
30301
+ function destroyItem($xeform, formItem) {
30302
+ const {
30303
+ reactData
30304
+ } = $xeform;
30305
+ const {
30306
+ staticItems
30307
+ } = reactData;
30308
+ const index = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(staticItems, item => item.id === formItem.id);
30309
+ if (index > -1) {
30310
+ staticItems.splice(index, 1);
30311
+ }
30312
+ reactData.staticItems = staticItems.slice(0);
30313
+ }
30285
30314
  ;// CONCATENATED MODULE: ./packages/tooltip/index.ts
30286
30315
 
30287
30316
 
@@ -34953,9 +34982,10 @@ dynamicApp.component(pulldown.name, pulldown);
34953
34982
  cstmDragTarget: '移动目标:{0}',
34954
34983
  setting: {
34955
34984
  colSort: '排序',
34985
+ sortHelpTip: '点击并拖动图标可以调整列的排序',
34956
34986
  colTitle: '标题',
34957
34987
  colVisible: '是否显示',
34958
- colFixed: '冻结列',
34988
+ colFixed: '冻结列(最多 {0} 列)',
34959
34989
  fixedLeft: '左侧',
34960
34990
  fixedUnset: '不设置',
34961
34991
  fixedRight: '右侧'