vxe-table 4.16.2 → 4.16.4

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 (53) hide show
  1. package/es/grid/src/grid.js +5 -1
  2. package/es/index.css +1 -1
  3. package/es/index.min.css +1 -1
  4. package/es/style.css +1 -1
  5. package/es/style.min.css +1 -1
  6. package/es/table/module/menu/hook.js +4 -2
  7. package/es/table/render/index.js +4 -3
  8. package/es/table/src/body.js +12 -14
  9. package/es/table/src/table.js +27 -15
  10. package/es/table/style.css +0 -4
  11. package/es/table/style.min.css +1 -1
  12. package/es/ui/index.js +1 -1
  13. package/es/ui/src/log.js +1 -1
  14. package/es/vxe-table/style.css +0 -4
  15. package/es/vxe-table/style.min.css +1 -1
  16. package/lib/grid/src/grid.js +6 -0
  17. package/lib/grid/src/grid.min.js +1 -1
  18. package/lib/index.css +1 -1
  19. package/lib/index.min.css +1 -1
  20. package/lib/index.umd.js +35 -22
  21. package/lib/index.umd.min.js +1 -1
  22. package/lib/style.css +1 -1
  23. package/lib/style.min.css +1 -1
  24. package/lib/table/module/menu/hook.js +6 -0
  25. package/lib/table/module/menu/hook.min.js +1 -1
  26. package/lib/table/render/index.js +6 -3
  27. package/lib/table/render/index.min.js +1 -1
  28. package/lib/table/src/body.js +11 -13
  29. package/lib/table/src/body.min.js +1 -1
  30. package/lib/table/src/table.js +4 -4
  31. package/lib/table/src/table.min.js +1 -1
  32. package/lib/table/style/style.css +0 -4
  33. package/lib/table/style/style.min.css +1 -1
  34. package/lib/ui/index.js +1 -1
  35. package/lib/ui/index.min.js +1 -1
  36. package/lib/ui/src/log.js +1 -1
  37. package/lib/ui/src/log.min.js +1 -1
  38. package/lib/vxe-table/style/style.css +0 -4
  39. package/lib/vxe-table/style/style.min.css +1 -1
  40. package/package.json +1 -1
  41. package/packages/grid/src/grid.ts +5 -1
  42. package/packages/table/module/menu/hook.ts +5 -2
  43. package/packages/table/render/index.ts +27 -26
  44. package/packages/table/src/body.ts +11 -13
  45. package/packages/table/src/table.ts +26 -10
  46. package/packages/ui/src/vn.ts +3 -2
  47. package/styles/components/table.scss +0 -1
  48. /package/es/{iconfont.1756452373591.ttf → iconfont.1756734897558.ttf} +0 -0
  49. /package/es/{iconfont.1756452373591.woff → iconfont.1756734897558.woff} +0 -0
  50. /package/es/{iconfont.1756452373591.woff2 → iconfont.1756734897558.woff2} +0 -0
  51. /package/lib/{iconfont.1756452373591.ttf → iconfont.1756734897558.ttf} +0 -0
  52. /package/lib/{iconfont.1756452373591.woff → iconfont.1756734897558.woff} +0 -0
  53. /package/lib/{iconfont.1756452373591.woff2 → iconfont.1756734897558.woff2} +0 -0
@@ -146,6 +146,8 @@ hooks.add('tableMenuModule', {
146
146
  * 快捷菜单事件处理
147
147
  */
148
148
  handleGlobalContextmenuEvent(evnt) {
149
+ const $xeGrid = $xeTable.xeGrid;
150
+ const $xeGantt = $xeTable.xeGantt;
149
151
  const { mouseConfig, menuConfig } = props;
150
152
  const { editStore, ctxMenuStore } = reactData;
151
153
  const { visibleColumn } = internalData;
@@ -163,7 +165,7 @@ hooks.add('tableMenuModule', {
163
165
  }
164
166
  if (internalData._keyCtx) {
165
167
  const type = 'body';
166
- const params = { type, $table: $xeTable, keyboard: true, columns: visibleColumn.slice(0), $event: evnt };
168
+ const params = { type, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, keyboard: true, columns: visibleColumn.slice(0), $event: evnt };
167
169
  // 如果开启单元格区域
168
170
  if (mouseConfig && mouseOpts.area) {
169
171
  const activeArea = $xeTable.getActiveCellArea();
@@ -191,7 +193,7 @@ hooks.add('tableMenuModule', {
191
193
  // target=td|th,直接向上找 table 去匹配即可
192
194
  return target.parentNode.parentNode.parentNode.getAttribute('xid') === xID;
193
195
  });
194
- const params = { type: layout, $table: $xeTable, columns: visibleColumn.slice(0), $event: evnt };
196
+ const params = { type: layout, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, columns: visibleColumn.slice(0), $event: evnt };
195
197
  if (columnTargetNode.flag) {
196
198
  const cell = columnTargetNode.targetElem;
197
199
  const columnNodeRest = $xeTable.getColumnNode(cell);
@@ -295,7 +295,7 @@ function nativeEditRender(renderOpts, params) {
295
295
  const { name } = renderOpts;
296
296
  const cellValue = isImmediateCell(renderOpts, params) ? getCellValue(row, column) : column.model.value;
297
297
  return [
298
- h(name, Object.assign(Object.assign(Object.assign({ class: `vxe-default-${name}` }, getNativeAttrs(renderOpts)), { value: cellValue }), getNativeEditOns(renderOpts, params)))
298
+ h(`${name}`, Object.assign(Object.assign(Object.assign({ class: `vxe-default-${name}` }, getNativeAttrs(renderOpts)), { value: cellValue }), getNativeEditOns(renderOpts, params)))
299
299
  ];
300
300
  }
301
301
  function buttonCellRender(renderOpts, params) {
@@ -350,7 +350,8 @@ function oldButtonEditRender(renderOpts, params) {
350
350
  * @deprecated
351
351
  */
352
352
  function oldButtonsEditRender(renderOpts, params) {
353
- return renderOpts.children.map((childRenderOpts) => oldButtonEditRender(childRenderOpts, params)[0]);
353
+ const { children } = renderOpts;
354
+ return children ? children.map((childRenderOpts) => oldButtonEditRender(childRenderOpts, params)[0]) : [];
354
355
  }
355
356
  function renderNativeOptgroups(renderOpts, params, renderOptionsMethods) {
356
357
  const { optionGroups, optionGroupProps = {} } = renderOpts;
@@ -394,7 +395,7 @@ function nativeFilterRender(renderOpts, params) {
394
395
  const { name } = renderOpts;
395
396
  const attrs = getNativeAttrs(renderOpts);
396
397
  return column.filters.map((option, oIndex) => {
397
- return h(name, Object.assign(Object.assign(Object.assign({ key: oIndex, class: `vxe-default-${name}` }, attrs), { value: option.data }), getNativeFilterOns(renderOpts, params, option)));
398
+ return h(`${name}`, Object.assign(Object.assign(Object.assign({ key: oIndex, class: `vxe-default-${name}` }, attrs), { value: option.data }), getNativeFilterOns(renderOpts, params, option)));
398
399
  });
399
400
  }
400
401
  function defaultFilterRender(renderOpts, params) {
@@ -167,15 +167,14 @@ export default defineVxeComponent({
167
167
  // hover 进入事件
168
168
  if (showTitle || showTooltip || showAllTip || tooltipConfig) {
169
169
  tdOns.onMouseenter = (evnt) => {
170
- if (isVMScrollProcess()) {
171
- return;
172
- }
173
- if (showTitle) {
174
- updateCellTitle(evnt.currentTarget, column);
175
- }
176
- else if (showTooltip || showAllTip) {
177
- // 如果配置了显示 tooltip
178
- $xeTable.triggerBodyTooltipEvent(evnt, cellParams);
170
+ if (!isVMScrollProcess()) {
171
+ if (showTitle) {
172
+ updateCellTitle(evnt.currentTarget, column);
173
+ }
174
+ else if (showTooltip || showAllTip) {
175
+ // 如果配置了显示 tooltip
176
+ $xeTable.triggerBodyTooltipEvent(evnt, cellParams);
177
+ }
179
178
  }
180
179
  $xeTable.dispatchEvent('cell-mouseenter', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt);
181
180
  };
@@ -183,11 +182,10 @@ export default defineVxeComponent({
183
182
  // hover 退出事件
184
183
  if (showTooltip || showAllTip || tooltipConfig) {
185
184
  tdOns.onMouseleave = (evnt) => {
186
- if (isVMScrollProcess()) {
187
- return;
188
- }
189
- if (showTooltip || showAllTip) {
190
- $xeTable.handleTargetLeaveEvent(evnt);
185
+ if (!isVMScrollProcess()) {
186
+ if (showTooltip || showAllTip) {
187
+ $xeTable.handleTargetLeaveEvent(evnt);
188
+ }
191
189
  }
192
190
  $xeTable.dispatchEvent('cell-mouseleave', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt);
193
191
  };
@@ -10148,11 +10148,20 @@ export default defineVxeComponent({
10148
10148
  const rowDragOpts = computeRowDragOpts.value;
10149
10149
  const { isCrossTableDrag } = rowDragOpts;
10150
10150
  if (isCrossTableDrag && crossTableDragRowObj && !tableData.length) {
10151
- const { $oldTable } = crossTableDragRowObj;
10152
- if ($oldTable && $oldTable.xID !== $xeTable.xID) {
10153
- evnt.preventDefault();
10154
- crossTableDragRowObj.$newTable = $xeTable;
10155
- internalData.prevDragRow = null;
10151
+ const { $oldTable, $newTable } = crossTableDragRowObj;
10152
+ if ($oldTable) {
10153
+ const oldTableReactData = $oldTable.reactData;
10154
+ if ($oldTable.xID !== $xeTable.xID) {
10155
+ if ($newTable && $newTable.xID !== $xeTable.xID) {
10156
+ $newTable.hideCrossTableRowDropClearStatus();
10157
+ }
10158
+ evnt.preventDefault();
10159
+ $oldTable.hideCrossTableRowDropClearStatus();
10160
+ crossTableDragRowObj.$newTable = $xeTable;
10161
+ internalData.prevDragRow = null;
10162
+ reactData.dragTipText = oldTableReactData.dragTipText;
10163
+ showDropTip(evnt, evnt.currentTarget, null, true, '');
10164
+ }
10156
10165
  }
10157
10166
  }
10158
10167
  },
@@ -10370,6 +10379,9 @@ export default defineVxeComponent({
10370
10379
  crossTableDragRowObj.$newTable = null;
10371
10380
  }
10372
10381
  else {
10382
+ if ($newTable && $newTable.xID !== $xeTable.xID) {
10383
+ $newTable.hideCrossTableRowDropClearStatus();
10384
+ }
10373
10385
  $oldTable.hideCrossTableRowDropClearStatus();
10374
10386
  oldTableReactData.isCrossDragRow = true;
10375
10387
  reactData.dragTipText = oldTableReactData.dragTipText;
@@ -12032,13 +12044,13 @@ export default defineVxeComponent({
12032
12044
  const scrollbarXToTop = computeScrollbarXToTop.value;
12033
12045
  const scrollbarYToLeft = computeScrollbarYToLeft.value;
12034
12046
  const { isCrossTableDrag } = rowDragOpts;
12035
- const rwOns = {};
12047
+ const tbOns = {
12048
+ onKeydown: keydownEvent
12049
+ };
12036
12050
  if (isCrossTableDrag && !tableData.length) {
12037
- rwOns.onDragover = $xeTable.handleCrossTableRowDragoverEmptyEvent;
12051
+ tbOns.onDragover = $xeTable.handleCrossTableRowDragoverEmptyEvent;
12038
12052
  }
12039
- return h('div', {
12040
- ref: refElem,
12041
- class: ['vxe-table', 'vxe-table--render-default', `tid_${xID}`, `border--${tableBorder}`, `sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`, `sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`, {
12053
+ return h('div', Object.assign({ ref: refElem, class: ['vxe-table', 'vxe-table--render-default', `tid_${xID}`, `border--${tableBorder}`, `sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`, `sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`, {
12042
12054
  [`size--${vSize}`]: vSize,
12043
12055
  [`valid-msg--${validOpts.msgMode}`]: !!editRules,
12044
12056
  'vxe-editable': !!editConfig,
@@ -12068,10 +12080,7 @@ export default defineVxeComponent({
12068
12080
  'is--scroll-x': overflowX,
12069
12081
  'is--virtual-x': scrollXLoad,
12070
12082
  'is--virtual-y': scrollYLoad
12071
- }],
12072
- spellcheck: false,
12073
- onKeydown: keydownEvent
12074
- }, [
12083
+ }], spellcheck: false }, tbOns), [
12075
12084
  /**
12076
12085
  * 隐藏列
12077
12086
  */
@@ -12095,7 +12104,10 @@ export default defineVxeComponent({
12095
12104
  class: 'vxe-table-var-mini'
12096
12105
  })
12097
12106
  ]),
12098
- h('div', Object.assign({ key: 'tw', class: 'vxe-table--render-wrapper' }, rwOns), scrollbarXToTop
12107
+ h('div', {
12108
+ key: 'tw',
12109
+ class: 'vxe-table--render-wrapper'
12110
+ }, scrollbarXToTop
12099
12111
  ? [
12100
12112
  renderScrollX(),
12101
12113
  renderBody()
@@ -2394,10 +2394,6 @@
2394
2394
  .vxe-header--column .vxe-cell-title-suffix-icon {
2395
2395
  padding: 0.2em;
2396
2396
  }
2397
- .vxe-header--column .vxe-cell-title-prefix-icon,
2398
- .vxe-header--column .vxe-cell-title-suffix-icon {
2399
- cursor: help;
2400
- }
2401
2397
  .vxe-header--column .vxe-cell-title-prefix-icon.theme--primary,
2402
2398
  .vxe-header--column .vxe-cell-title-suffix-icon.theme--primary {
2403
2399
  color: var(--vxe-ui-font-primary-color);