vxe-table 3.18.10 → 3.18.12

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 (58) hide show
  1. package/es/grid/style.css +4 -0
  2. package/es/grid/style.min.css +1 -1
  3. package/es/index.css +1 -1
  4. package/es/index.min.css +1 -1
  5. package/es/style.css +1 -1
  6. package/es/style.min.css +1 -1
  7. package/es/table/src/body.js +2 -2
  8. package/es/table/src/cell.js +40 -22
  9. package/es/table/src/footer.js +2 -2
  10. package/es/table/src/methods.js +27 -9
  11. package/es/table/src/props.js +4 -0
  12. package/es/table/src/table.js +10 -0
  13. package/es/ui/index.js +12 -1
  14. package/es/ui/src/log.js +1 -1
  15. package/es/vxe-grid/style.css +4 -0
  16. package/es/vxe-grid/style.min.css +1 -1
  17. package/lib/grid/style/style.css +4 -0
  18. package/lib/grid/style/style.min.css +1 -1
  19. package/lib/index.css +1 -1
  20. package/lib/index.min.css +1 -1
  21. package/lib/index.umd.js +115 -44
  22. package/lib/index.umd.min.js +1 -1
  23. package/lib/style.css +1 -1
  24. package/lib/style.min.css +1 -1
  25. package/lib/table/src/body.js +2 -2
  26. package/lib/table/src/body.min.js +1 -1
  27. package/lib/table/src/cell.js +55 -29
  28. package/lib/table/src/cell.min.js +1 -1
  29. package/lib/table/src/footer.js +2 -2
  30. package/lib/table/src/footer.min.js +1 -1
  31. package/lib/table/src/methods.js +29 -9
  32. package/lib/table/src/methods.min.js +1 -1
  33. package/lib/table/src/props.js +4 -0
  34. package/lib/table/src/props.min.js +1 -1
  35. package/lib/table/src/table.js +10 -0
  36. package/lib/table/src/table.min.js +1 -1
  37. package/lib/ui/index.js +12 -1
  38. package/lib/ui/index.min.js +1 -1
  39. package/lib/ui/src/log.js +1 -1
  40. package/lib/ui/src/log.min.js +1 -1
  41. package/lib/vxe-grid/style/style.css +4 -0
  42. package/lib/vxe-grid/style/style.min.css +1 -1
  43. package/package.json +1 -1
  44. package/packages/table/src/body.ts +2 -2
  45. package/packages/table/src/cell.ts +38 -22
  46. package/packages/table/src/footer.ts +2 -2
  47. package/packages/table/src/methods.ts +24 -9
  48. package/packages/table/src/props.ts +4 -0
  49. package/packages/table/src/table.ts +12 -0
  50. package/packages/ui/index.ts +11 -0
  51. package/styles/components/grid.scss +3 -0
  52. package/styles/theme/base.scss +3 -3
  53. /package/es/{iconfont.1757464750041.ttf → iconfont.1757987563312.ttf} +0 -0
  54. /package/es/{iconfont.1757464750041.woff → iconfont.1757987563312.woff} +0 -0
  55. /package/es/{iconfont.1757464750041.woff2 → iconfont.1757987563312.woff2} +0 -0
  56. /package/lib/{iconfont.1757464750041.ttf → iconfont.1757987563312.ttf} +0 -0
  57. /package/lib/{iconfont.1757464750041.woff → iconfont.1757987563312.woff} +0 -0
  58. /package/lib/{iconfont.1757464750041.woff2 → iconfont.1757987563312.woff2} +0 -0
@@ -2806,7 +2806,7 @@ function clearRowDragData ($xeTable: VxeTableConstructor & VxeTablePrivateMethod
2806
2806
  * @param {Event} evnt 事件
2807
2807
  * @param {Row} row 行对象
2808
2808
  */
2809
- function handleTooltip ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, evnt: MouseEvent, type: 'header' | 'body' | 'footer', tdEl: HTMLTableCellElement, overflowElem: HTMLElement | null, tipElem: HTMLElement | null, params: any) {
2809
+ function handleTooltip ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, evnt: MouseEvent, tipOpts: VxeTablePropTypes.TooltipConfig | VxeTablePropTypes.HeaderTooltipConfig | VxeTablePropTypes.FooterTooltipConfig, type: 'header' | 'body' | 'footer', tdEl: HTMLTableCellElement, overflowElem: HTMLElement | null, tipElem: HTMLElement | null, params: any) {
2810
2810
  const reactData = $xeTable as unknown as TableReactData
2811
2811
 
2812
2812
  const tipOverEl = overflowElem || tdEl
@@ -2815,9 +2815,8 @@ function handleTooltip ($xeTable: VxeTableConstructor & VxeTablePrivateMethods,
2815
2815
  }
2816
2816
  params.cell = tdEl
2817
2817
  const { tooltipStore } = reactData
2818
- const tooltipOpts = $xeTable.computeTooltipOpts
2819
2818
  const { column, row } = params
2820
- const { showAll, contentMethod } = tooltipOpts
2819
+ const { showAll, contentMethod } = tipOpts
2821
2820
  const customContent = contentMethod ? contentMethod(params) : null
2822
2821
  const useCustom = contentMethod && !XEUtils.eqNull(customContent)
2823
2822
  const content = useCustom ? customContent : XEUtils.toString(column.type === 'html' ? tipOverEl.innerText : tipOverEl.textContent).trim()
@@ -2830,7 +2829,7 @@ function handleTooltip ($xeTable: VxeTableConstructor & VxeTablePrivateMethods,
2830
2829
  visible: true,
2831
2830
  content: tipContent,
2832
2831
  type,
2833
- currOpts: {}
2832
+ currOpts: tipOpts
2834
2833
  })
2835
2834
  $xeTable.$nextTick(() => {
2836
2835
  const $tooltip = $xeTable.$refs.refTooltip as VxeTooltipInstance
@@ -7112,6 +7111,7 @@ const Methods = {
7112
7111
  const reactData = $xeTable as unknown as TableReactData
7113
7112
 
7114
7113
  const { tooltipStore } = reactData
7114
+ const headerTooltipOpts = $xeTable.computeHeaderTooltipOpts
7115
7115
  const { column } = params
7116
7116
  handleTargetEnterEvent($xeTable, true)
7117
7117
  const titleElem = evnt.currentTarget as HTMLDivElement
@@ -7132,7 +7132,7 @@ const Methods = {
7132
7132
  }
7133
7133
  if (tooltipStore.column !== column || !tooltipStore.visible) {
7134
7134
  const ctEl = thEl.querySelector<HTMLElement>('.vxe-cell--title')
7135
- handleTooltip($xeTable, evnt, 'header', thEl, (hasClass(thEl, 'col--ellipsis') ? ctEl : cWrapperEl) || cWrapperEl, ctEl || cellEl, params)
7135
+ handleTooltip($xeTable, evnt, headerTooltipOpts, 'header', thEl, (hasClass(thEl, 'col--ellipsis') ? ctEl : cWrapperEl) || cWrapperEl, ctEl || cellEl, params)
7136
7136
  }
7137
7137
  },
7138
7138
  /**
@@ -7146,6 +7146,7 @@ const Methods = {
7146
7146
  const { editConfig } = props
7147
7147
  const { editStore } = reactData
7148
7148
  const { tooltipStore } = reactData
7149
+ const tooltipOpts = $xeTable.computeTooltipOpts
7149
7150
  const editOpts = $xeTable.computeEditOpts
7150
7151
  const { actived } = editStore
7151
7152
  const { row, column } = params
@@ -7172,7 +7173,7 @@ const Methods = {
7172
7173
  if (!tipEl) {
7173
7174
  tipEl = ctEl
7174
7175
  }
7175
- handleTooltip($xeTable, evnt, 'body', tdEl, ovEl || ctEl, tipEl, params)
7176
+ handleTooltip($xeTable, evnt, tooltipOpts, 'body', tdEl, ovEl || ctEl, tipEl, params)
7176
7177
  }
7177
7178
  },
7178
7179
  /**
@@ -7184,6 +7185,7 @@ const Methods = {
7184
7185
 
7185
7186
  const { column } = params
7186
7187
  const { tooltipStore } = reactData
7188
+ const footerTooltipOpts = $xeTable.computeFooterTooltipOpts
7187
7189
  const tdEl = evnt.currentTarget as HTMLTableCellElement
7188
7190
  handleTargetEnterEvent($xeTable, tooltipStore.column !== column || !!tooltipStore.row)
7189
7191
  if (tooltipStore.column !== column || !tooltipStore.visible) {
@@ -7196,7 +7198,7 @@ const Methods = {
7196
7198
  if (!tipEl) {
7197
7199
  tipEl = ctEl
7198
7200
  }
7199
- handleTooltip($xeTable, evnt, 'footer', tdEl, ovEl || ctEl, tipEl, params)
7201
+ handleTooltip($xeTable, evnt, footerTooltipOpts, 'footer', tdEl, ovEl || ctEl, tipEl, params)
7200
7202
  }
7201
7203
  },
7202
7204
  openTooltip (target: HTMLElement, content: string | number) {
@@ -7532,7 +7534,7 @@ const Methods = {
7532
7534
  }
7533
7535
  }
7534
7536
  }
7535
- if (!checkMethod || checkMethod({ $table: $xeTable, row })) {
7537
+ if (isRowGroupStatus || !checkMethod || checkMethod({ $table: $xeTable, row })) {
7536
7538
  $xeTable.handleBatchSelectRows([row], checked)
7537
7539
  $xeTable.checkSelectionStatus()
7538
7540
  $xeTable.dispatchEvent('checkbox-change', Object.assign({
@@ -7719,6 +7721,8 @@ const Methods = {
7719
7721
  const { treeConfig } = props
7720
7722
  const { isRowGroupStatus } = reactData
7721
7723
  const { afterFullData, afterTreeFullData, afterGroupFullData, checkboxReserveRowMap, selectCheckboxMaps, treeIndeterminateRowMaps } = internalData
7724
+ const aggregateOpts = $xeTable.computeAggregateOpts
7725
+ const { mapChildrenField } = aggregateOpts
7722
7726
  const checkboxOpts = $xeTable.computeCheckboxOpts
7723
7727
  const { checkField, checkMethod, showReserveStatus } = checkboxOpts
7724
7728
  const { handleGetRowId } = createHandleGetRowId($xeTable)
@@ -7734,7 +7738,18 @@ const Methods = {
7734
7738
  ? row => {
7735
7739
  const childRowid = handleGetRowId(row)
7736
7740
  const selected = checkField ? XEUtils.get(row, checkField) : selectCheckboxMaps[childRowid]
7737
- if (checkMethod({ $table: $xeTable, row })) {
7741
+ if (isRowGroupStatus && $xeTable.isAggregateRecord(row)) {
7742
+ const childList: any[] = row[mapChildrenField || '']
7743
+ if (selected) {
7744
+ vLen++
7745
+ sLen++
7746
+ } else if (treeIndeterminateRowMaps[childRowid]) {
7747
+ vLen++
7748
+ hLen++
7749
+ } else if (childList && childList.length && childList.some(item => checkMethod({ $table: $xeTable, row: item }))) {
7750
+ vLen++
7751
+ }
7752
+ } else if (checkMethod({ $table: $xeTable, row })) {
7738
7753
  if (selected) {
7739
7754
  sLen++
7740
7755
  } else if (treeIndeterminateRowMaps[childRowid]) {
@@ -235,6 +235,10 @@ export const tableProps = {
235
235
  checkboxConfig: Object as PropType<VxeTablePropTypes.CheckboxConfig>,
236
236
  // tooltip 配置项
237
237
  tooltipConfig: Object as PropType<VxeTablePropTypes.TooltipConfig>,
238
+ // 表头 tooltip 配置项
239
+ headerTooltipConfig: Object as PropType<VxeTablePropTypes.HeaderTooltipConfig>,
240
+ // 表尾 tooltip 配置项
241
+ footerTooltipConfig: Object as PropType<VxeTablePropTypes.FooterTooltipConfig>,
238
242
  // 导出配置项
239
243
  exportConfig: [Boolean, Object],
240
244
  // 导入配置项
@@ -1079,6 +1079,18 @@ export default {
1079
1079
  tipConfig () {
1080
1080
  return { ...this.tooltipOpts }
1081
1081
  },
1082
+ computeHeaderTooltipOpts () {
1083
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
1084
+ const props = $xeTable
1085
+
1086
+ return Object.assign({}, getConfig().tooltip, getConfig().table.headerTooltipConfig, props.headerTooltipConfig)
1087
+ },
1088
+ computeFooterTooltipOpts () {
1089
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
1090
+ const props = $xeTable
1091
+
1092
+ return Object.assign({}, getConfig().tooltip, getConfig().table.footerTooltipConfig, props.footerTooltipConfig)
1093
+ },
1082
1094
  computeTableTipConfig () {
1083
1095
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
1084
1096
  const reactData = $xeTable as unknown as TableReactData
@@ -69,6 +69,12 @@ VxeUI.setConfig({
69
69
  tooltipConfig: {
70
70
  enterable: true
71
71
  },
72
+ headerTooltipConfig: {
73
+ enterable: true
74
+ },
75
+ footerTooltipConfig: {
76
+ enterable: true
77
+ },
72
78
  validConfig: {
73
79
  showMessage: true,
74
80
  autoClear: true,
@@ -78,6 +84,11 @@ VxeUI.setConfig({
78
84
  theme: 'beautify'
79
85
  },
80
86
  columnConfig: {
87
+ autoOptions: {
88
+ isCalcHeader: true,
89
+ isCalcBody: true,
90
+ isCalcFooter: true
91
+ },
81
92
  maxFixedSize: 4
82
93
  },
83
94
  cellConfig: {
@@ -66,6 +66,9 @@
66
66
  .vxe-grid--layout-aside-left-wrapper,
67
67
  .vxe-grid--layout-aside-left-wrapper {
68
68
  flex-shrink: 0;
69
+ }
70
+ .vxe-grid--layout-aside-left-wrapper,
71
+ .vxe-grid--layout-aside-left-wrapper {
69
72
  overflow: auto;
70
73
  }
71
74
 
@@ -39,10 +39,10 @@
39
39
  --vxe-ui-table-column-icon-border-color: #c0c4cc;
40
40
  --vxe-ui-table-column-icon-border-hover-color: #515A6E;
41
41
 
42
- --vxe-ui-table-cell-padding-default: 10px;
43
- --vxe-ui-table-cell-padding-medium: 8px;
42
+ --vxe-ui-table-cell-padding-default: 8px;
43
+ --vxe-ui-table-cell-padding-medium: 7px;
44
44
  --vxe-ui-table-cell-padding-small: 6px;
45
- --vxe-ui-table-cell-padding-mini: 4px;
45
+ --vxe-ui-table-cell-padding-mini: 5px;
46
46
  --vxe-ui-table-cell-placeholder-color: #C0C4CC;
47
47
  --vxe-ui-table-cell-negative-color: #f56c6c;
48
48
  --vxe-ui-table-cell-input-height-default: var(--vxe-ui-table-row-height-default) - 6;