vxe-table 3.20.0-beta.9 → 3.20.1

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 (190) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.min.css +1 -1
  3. package/es/locale/lang/ar-EG.js +6 -0
  4. package/es/locale/lang/de-DE.js +6 -0
  5. package/es/locale/lang/en-US.js +6 -0
  6. package/es/locale/lang/es-ES.js +6 -0
  7. package/es/locale/lang/fr-FR.js +6 -0
  8. package/es/locale/lang/hu-HU.js +6 -0
  9. package/es/locale/lang/hy-AM.js +6 -0
  10. package/es/locale/lang/id-ID.js +6 -0
  11. package/es/locale/lang/it-IT.js +6 -0
  12. package/es/locale/lang/ja-JP.js +6 -0
  13. package/es/locale/lang/ko-KR.js +6 -0
  14. package/es/locale/lang/ms-MY.js +6 -0
  15. package/es/locale/lang/nb-NO.js +6 -0
  16. package/es/locale/lang/pt-BR.js +6 -0
  17. package/es/locale/lang/ru-RU.js +6 -0
  18. package/es/locale/lang/th-TH.js +6 -0
  19. package/es/locale/lang/ug-CN.js +6 -0
  20. package/es/locale/lang/uk-UA.js +6 -0
  21. package/es/locale/lang/uz-UZ.js +6 -0
  22. package/es/locale/lang/vi-VN.js +6 -0
  23. package/es/locale/lang/zh-CHT.js +6 -0
  24. package/es/locale/lang/zh-CN.js +6 -0
  25. package/es/style.css +1 -1
  26. package/es/style.min.css +1 -1
  27. package/es/table/module/export/mixin.js +15 -1
  28. package/es/table/module/keyboard/mixin.js +18 -8
  29. package/es/table/module/validator/mixin.js +7 -6
  30. package/es/table/render/index.js +11 -0
  31. package/es/table/src/body.js +12 -5
  32. package/es/table/src/column.js +1 -1
  33. package/es/table/src/columnInfo.js +2 -0
  34. package/es/table/src/methods.js +208 -79
  35. package/es/table/src/props.js +4 -0
  36. package/es/table/src/table.js +64 -3
  37. package/es/table/src/util.js +38 -20
  38. package/es/table/style.css +11 -17
  39. package/es/table/style.min.css +1 -1
  40. package/es/ui/index.js +7 -1
  41. package/es/ui/src/log.js +1 -1
  42. package/es/vxe-table/style.css +11 -17
  43. package/es/vxe-table/style.min.css +1 -1
  44. package/lib/index.css +1 -1
  45. package/lib/index.min.css +1 -1
  46. package/lib/index.umd.js +241 -76
  47. package/lib/index.umd.min.js +1 -1
  48. package/lib/locale/lang/ar-EG.js +6 -0
  49. package/lib/locale/lang/ar-EG.min.js +1 -1
  50. package/lib/locale/lang/ar-EG.umd.js +6 -0
  51. package/lib/locale/lang/de-DE.js +6 -0
  52. package/lib/locale/lang/de-DE.min.js +1 -1
  53. package/lib/locale/lang/de-DE.umd.js +6 -0
  54. package/lib/locale/lang/en-US.js +6 -0
  55. package/lib/locale/lang/en-US.min.js +1 -1
  56. package/lib/locale/lang/en-US.umd.js +6 -0
  57. package/lib/locale/lang/es-ES.js +6 -0
  58. package/lib/locale/lang/es-ES.min.js +1 -1
  59. package/lib/locale/lang/es-ES.umd.js +6 -0
  60. package/lib/locale/lang/fr-FR.js +6 -0
  61. package/lib/locale/lang/fr-FR.min.js +1 -1
  62. package/lib/locale/lang/fr-FR.umd.js +6 -0
  63. package/lib/locale/lang/hu-HU.js +6 -0
  64. package/lib/locale/lang/hu-HU.min.js +1 -1
  65. package/lib/locale/lang/hu-HU.umd.js +6 -0
  66. package/lib/locale/lang/hy-AM.js +6 -0
  67. package/lib/locale/lang/hy-AM.min.js +1 -1
  68. package/lib/locale/lang/hy-AM.umd.js +6 -0
  69. package/lib/locale/lang/id-ID.js +6 -0
  70. package/lib/locale/lang/id-ID.min.js +1 -1
  71. package/lib/locale/lang/id-ID.umd.js +6 -0
  72. package/lib/locale/lang/it-IT.js +6 -0
  73. package/lib/locale/lang/it-IT.min.js +1 -1
  74. package/lib/locale/lang/it-IT.umd.js +6 -0
  75. package/lib/locale/lang/ja-JP.js +6 -0
  76. package/lib/locale/lang/ja-JP.min.js +1 -1
  77. package/lib/locale/lang/ja-JP.umd.js +6 -0
  78. package/lib/locale/lang/ko-KR.js +6 -0
  79. package/lib/locale/lang/ko-KR.min.js +1 -1
  80. package/lib/locale/lang/ko-KR.umd.js +6 -0
  81. package/lib/locale/lang/ms-MY.js +6 -0
  82. package/lib/locale/lang/ms-MY.min.js +1 -1
  83. package/lib/locale/lang/ms-MY.umd.js +6 -0
  84. package/lib/locale/lang/nb-NO.js +6 -0
  85. package/lib/locale/lang/nb-NO.min.js +1 -1
  86. package/lib/locale/lang/nb-NO.umd.js +6 -0
  87. package/lib/locale/lang/pt-BR.js +6 -0
  88. package/lib/locale/lang/pt-BR.min.js +1 -1
  89. package/lib/locale/lang/pt-BR.umd.js +6 -0
  90. package/lib/locale/lang/ru-RU.js +6 -0
  91. package/lib/locale/lang/ru-RU.min.js +1 -1
  92. package/lib/locale/lang/ru-RU.umd.js +6 -0
  93. package/lib/locale/lang/th-TH.js +6 -0
  94. package/lib/locale/lang/th-TH.min.js +1 -1
  95. package/lib/locale/lang/th-TH.umd.js +6 -0
  96. package/lib/locale/lang/ug-CN.js +6 -0
  97. package/lib/locale/lang/ug-CN.min.js +1 -1
  98. package/lib/locale/lang/ug-CN.umd.js +6 -0
  99. package/lib/locale/lang/uk-UA.js +6 -0
  100. package/lib/locale/lang/uk-UA.min.js +1 -1
  101. package/lib/locale/lang/uk-UA.umd.js +6 -0
  102. package/lib/locale/lang/uz-UZ.js +6 -0
  103. package/lib/locale/lang/uz-UZ.min.js +1 -1
  104. package/lib/locale/lang/uz-UZ.umd.js +6 -0
  105. package/lib/locale/lang/vi-VN.js +6 -0
  106. package/lib/locale/lang/vi-VN.min.js +1 -1
  107. package/lib/locale/lang/vi-VN.umd.js +6 -0
  108. package/lib/locale/lang/zh-CHT.js +6 -0
  109. package/lib/locale/lang/zh-CHT.min.js +1 -1
  110. package/lib/locale/lang/zh-CHT.umd.js +6 -0
  111. package/lib/locale/lang/zh-CN.js +6 -0
  112. package/lib/locale/lang/zh-CN.min.js +1 -1
  113. package/lib/locale/lang/zh-CN.umd.js +6 -0
  114. package/lib/style.css +1 -1
  115. package/lib/style.min.css +1 -1
  116. package/lib/table/module/export/mixin.js +18 -6
  117. package/lib/table/module/export/mixin.min.js +1 -1
  118. package/lib/table/module/keyboard/mixin.js +18 -4
  119. package/lib/table/module/keyboard/mixin.min.js +1 -1
  120. package/lib/table/module/validator/mixin.js +8 -6
  121. package/lib/table/module/validator/mixin.min.js +1 -1
  122. package/lib/table/render/index.js +15 -0
  123. package/lib/table/render/index.min.js +1 -1
  124. package/lib/table/src/body.js +13 -4
  125. package/lib/table/src/body.min.js +1 -1
  126. package/lib/table/src/column.js +1 -1
  127. package/lib/table/src/column.min.js +1 -1
  128. package/lib/table/src/columnInfo.js +2 -0
  129. package/lib/table/src/columnInfo.min.js +1 -1
  130. package/lib/table/src/methods.js +806 -14157
  131. package/lib/table/src/methods.min.js +1 -1
  132. package/lib/table/src/props.js +4 -0
  133. package/lib/table/src/props.min.js +1 -1
  134. package/lib/table/src/table.js +74 -2
  135. package/lib/table/src/table.min.js +1 -1
  136. package/lib/table/src/util.js +41 -21
  137. package/lib/table/src/util.min.js +1 -1
  138. package/lib/table/style/style.css +11 -17
  139. package/lib/table/style/style.min.css +1 -1
  140. package/lib/ui/index.js +7 -1
  141. package/lib/ui/index.min.js +1 -1
  142. package/lib/ui/src/log.js +1 -1
  143. package/lib/ui/src/log.min.js +1 -1
  144. package/lib/vxe-table/style/style.css +11 -17
  145. package/lib/vxe-table/style/style.min.css +1 -1
  146. package/package.json +2 -2
  147. package/packages/locale/lang/ar-EG.ts +6 -0
  148. package/packages/locale/lang/de-DE.ts +6 -0
  149. package/packages/locale/lang/en-US.ts +6 -0
  150. package/packages/locale/lang/es-ES.ts +6 -0
  151. package/packages/locale/lang/fr-FR.ts +6 -0
  152. package/packages/locale/lang/hu-HU.ts +6 -0
  153. package/packages/locale/lang/hy-AM.ts +6 -0
  154. package/packages/locale/lang/id-ID.ts +6 -0
  155. package/packages/locale/lang/it-IT.ts +6 -0
  156. package/packages/locale/lang/ja-JP.ts +6 -0
  157. package/packages/locale/lang/ko-KR.ts +6 -0
  158. package/packages/locale/lang/ms-MY.ts +6 -0
  159. package/packages/locale/lang/nb-NO.ts +6 -0
  160. package/packages/locale/lang/pt-BR.ts +6 -0
  161. package/packages/locale/lang/ru-RU.ts +6 -0
  162. package/packages/locale/lang/th-TH.ts +6 -0
  163. package/packages/locale/lang/ug-CN.ts +6 -0
  164. package/packages/locale/lang/uk-UA.ts +6 -0
  165. package/packages/locale/lang/uz-UZ.ts +6 -0
  166. package/packages/locale/lang/vi-VN.ts +6 -0
  167. package/packages/locale/lang/zh-CHT.ts +6 -0
  168. package/packages/locale/lang/zh-CN.ts +6 -0
  169. package/packages/table/module/export/mixin.ts +13 -1
  170. package/packages/table/module/keyboard/mixin.ts +21 -12
  171. package/packages/table/module/validator/mixin.ts +7 -6
  172. package/packages/table/render/index.ts +12 -0
  173. package/packages/table/src/body.ts +12 -5
  174. package/packages/table/src/column.ts +1 -1
  175. package/packages/table/src/columnInfo.ts +2 -0
  176. package/packages/table/src/methods.ts +201 -78
  177. package/packages/table/src/props.ts +4 -0
  178. package/packages/table/src/table.ts +70 -2
  179. package/packages/table/src/util.ts +43 -19
  180. package/packages/ui/index.ts +6 -0
  181. package/styles/components/table-module/filter.scss +1 -1
  182. package/styles/components/table-module/menu.scss +4 -9
  183. package/styles/components/table.scss +8 -2
  184. package/styles/theme/base.scss +0 -1
  185. /package/es/{iconfont.1768625297791.ttf → iconfont.1773109164685.ttf} +0 -0
  186. /package/es/{iconfont.1768625297791.woff → iconfont.1773109164685.woff} +0 -0
  187. /package/es/{iconfont.1768625297791.woff2 → iconfont.1773109164685.woff2} +0 -0
  188. /package/lib/{iconfont.1768625297791.ttf → iconfont.1773109164685.ttf} +0 -0
  189. /package/lib/{iconfont.1768625297791.woff → iconfont.1773109164685.woff} +0 -0
  190. /package/lib/{iconfont.1768625297791.woff2 → iconfont.1773109164685.woff2} +0 -0
@@ -79,9 +79,18 @@ function handleMoveSelected ($xeTable: VxeTableConstructor & VxeTablePrivateMeth
79
79
 
80
80
  const { afterFullData, visibleColumn } = internalData
81
81
  const params = Object.assign({}, args)
82
- const _rowIndex = $xeTable.getVTRowIndex(params.row)
83
- const _columnIndex = $xeTable.getVTColumnIndex(params.column)
84
- evnt.preventDefault()
82
+ const { row, column } = params
83
+ const _rowIndex = $xeTable.getVTRowIndex(row)
84
+ const _columnIndex = $xeTable.getVTColumnIndex(column)
85
+ const refTableBody = $xeTable.$refs.refTableBody
86
+ const tableBodyElem = refTableBody ? (refTableBody as any).$el as HTMLDivElement : null
87
+ const tableWidth = tableBodyElem ? tableBodyElem.clientWidth : 0
88
+ let colAlign = isLeftArrow || isRightArrow || (column.renderWidth < tableWidth)
89
+ if ((isLeftArrow && _columnIndex >= 0) || (isRightArrow && _columnIndex <= visibleColumn.length - 1)) {
90
+ colAlign = false
91
+ } else {
92
+ evnt.preventDefault()
93
+ }
85
94
  if (isUpArrow && _rowIndex > 0) {
86
95
  // 移动到上一行
87
96
  params.rowIndex = _rowIndex - 1
@@ -99,7 +108,9 @@ function handleMoveSelected ($xeTable: VxeTableConstructor & VxeTablePrivateMeth
99
108
  params.columnIndex = _columnIndex + 1
100
109
  params.column = visibleColumn[params.columnIndex]
101
110
  }
102
- $xeTable.scrollToRow(params.row, params.column).then(() => {
111
+ $xeTable.scrollToRow(params.row, params.column, {
112
+ colAlign
113
+ }).then(() => {
103
114
  params.cell = $xeTable.getCellElement(params.row, params.column)
104
115
  $xeTable.handleSelected(params, evnt)
105
116
  })
@@ -335,17 +346,15 @@ export default {
335
346
  if (editOpts.mode === 'row') {
336
347
  $xeTable.handleEdit(params, evnt)
337
348
  } else {
338
- $xeTable.scrollToRow(params.row, params.column)
339
- .then(() => {
340
- $xeTable.handleSelected(params, evnt)
341
- })
349
+ $xeTable.scrollToRow(params.row, params.column).then(() => {
350
+ $xeTable.handleSelected(params, evnt)
351
+ })
342
352
  }
343
353
  }
344
354
  } else {
345
- $xeTable.scrollToRow(params.row, params.column)
346
- .then(() => {
347
- $xeTable.handleSelected(params, evnt)
348
- })
355
+ $xeTable.scrollToRow(params.row, params.column).then(() => {
356
+ $xeTable.handleSelected(params, evnt)
357
+ })
349
358
  }
350
359
  }
351
360
  },
@@ -122,19 +122,20 @@ function validRuleValue (rule: VxeTableDefines.ValidatorRule, val: any, required
122
122
  return true
123
123
  }
124
124
 
125
- function checkRuleStatus (rule: VxeTableDefines.ValidatorRule, val: any) {
126
- const { required } = rule
127
- const isEmptyVal = XEUtils.isArray(val) ? !val.length : eqEmptyValue(val)
125
+ function checkRuleStatus (rule: VxeTableDefines.ValidatorRule, row: any, val: any) {
126
+ const { required, field } = rule
127
+ const currVal = field ? XEUtils.get(row, field) : val
128
+ const isEmptyVal = XEUtils.isArray(currVal) ? !currVal.length : eqEmptyValue(currVal)
128
129
  if (required) {
129
130
  if (isEmptyVal) {
130
131
  return false
131
132
  }
132
- if (!validRuleValue(rule, val, required)) {
133
+ if (!validRuleValue(rule, currVal, required)) {
133
134
  return false
134
135
  }
135
136
  } else {
136
137
  if (!isEmptyVal) {
137
- if (!validRuleValue(rule, val, required)) {
138
+ if (!validRuleValue(rule, currVal, required)) {
138
139
  return false
139
140
  }
140
141
  }
@@ -473,7 +474,7 @@ export default {
473
474
  }
474
475
  }
475
476
  } else {
476
- if (!checkRuleStatus(rule, cellValue)) {
477
+ if (!checkRuleStatus(rule, row, cellValue)) {
477
478
  internalData.validRuleErr = true
478
479
  errorRules.push(new Rule(rule))
479
480
  }
@@ -793,6 +793,17 @@ function handleNumberCell (h: CreateElement, renderOpts: VxeGlobalRendererHandle
793
793
  : {})
794
794
  }
795
795
 
796
+ function handleFormatDatePicker (renderOpts: VxeGlobalRendererHandles.RenderTableDefaultOptions, params: VxeGlobalRendererHandles.TableCellFormatterParams) {
797
+ const { props = {} } = renderOpts
798
+ const { cellValue } = params
799
+ if (cellValue) {
800
+ if (props.type !== 'time') {
801
+ return getLabelFormatDate(cellValue, props)
802
+ }
803
+ }
804
+ return cellValue
805
+ }
806
+
796
807
  function handleFormatSelect (renderOpts: VxeGlobalRendererHandles.RenderTableDefaultOptions, params: VxeGlobalRendererHandles.TableCellFormatterParams | VxeGlobalRendererHandles.TableCellCopyMethodParams) {
797
808
  const { cellValue } = params
798
809
  return handleSelectCellValue(cellValue, renderOpts)
@@ -1022,6 +1033,7 @@ renderer.mixin({
1022
1033
  }
1023
1034
  return getCellLabelVNs(h, renderOpts, params, cellValue)
1024
1035
  },
1036
+ tableCellFormatter: handleFormatDatePicker,
1025
1037
  renderTableDefault: defaultEditRender,
1026
1038
  createTableFilterOptions: defaultFilterOptions,
1027
1039
  renderTableFilter: defaultFilterRender,
@@ -106,7 +106,7 @@ function renderTdColumn (
106
106
 
107
107
  const { columnKey, resizable: allResizable, showOverflow: allShowOverflow, border, height, treeConfig, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig, padding: allPadding } = tableProps
108
108
  const { tableData, tableColumn, dragRow, overflowX, overflowY, currentColumn, scrollXLoad, scrollYLoad, mergeBodyFlag, calcCellHeightFlag, resizeHeightFlag, resizeWidthFlag, editStore, isAllOverflow, validErrorMaps } = tableReactData
109
- const { fullAllDataRowIdData, fullColumnIdData, mergeBodyCellMaps, visibleColumn, afterFullData, mergeBodyList, scrollXStore, scrollYStore } = tableInternalData
109
+ const { fullAllDataRowIdData, fullColumnIdData, mergeBodyCellMaps, visibleColumn, afterFullData, mergeBodyList, scrollXStore, scrollYStore, keepUpdateFieldMaps } = tableInternalData
110
110
  const cellOpts = $xeTable.computeCellOpts
111
111
  const validOpts = $xeTable.computeValidOpts
112
112
  const checkboxOpts = $xeTable.computeCheckboxOpts
@@ -125,7 +125,7 @@ function renderTdColumn (
125
125
  const areaOpts = $xeTable.computeAreaOpts
126
126
  const cellOffsetWidth = $xeTable.computeCellOffsetWidth
127
127
  const { selectCellToRow } = areaOpts
128
- const { type, cellRender, editRender, align, showOverflow, className, treeNode, rowResize, padding, verticalAlign, slots } = column
128
+ const { field, type, cellRender, editRender, align, showOverflow, className, treeNode, rowResize, padding, verticalAlign, slots } = column
129
129
  const { verticalAlign: allVerticalAlign } = cellOpts
130
130
  const { actived } = editStore
131
131
  const rowRest = fullAllDataRowIdData[rowid] || {}
@@ -280,8 +280,8 @@ function renderTdColumn (
280
280
  }
281
281
  }
282
282
  // 如果编辑列开启显示状态
283
- if (!fixedHiddenColumn && editConfig && (editRender || cellRender) && (editOpts.showStatus || editOpts.showUpdateStatus)) {
284
- isDirty = $xeTable.isUpdateByRow(row, column.field)
283
+ if (!fixedHiddenColumn && editConfig && (editOpts.showStatus || editOpts.showUpdateStatus) && keepUpdateFieldMaps[field]) {
284
+ isDirty = $xeTable.isUpdateByRow(row, field)
285
285
  }
286
286
 
287
287
  const isVNAutoHeight = !hasEllipsis && (scrollYLoad || scrollXLoad)
@@ -598,6 +598,13 @@ function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '
598
598
  const expandOpts = $xeTable.computeExpandOpts
599
599
  const { height: expandHeight, padding, mode: expandMode } = expandOpts
600
600
  if (expandMode === 'fixed') {
601
+ const currExpHeight = rowRest.expandHeight
602
+ let expHeight = 0
603
+ if (rowExpandHeightFlag) {
604
+ if (currExpHeight || expandHeight) {
605
+ expHeight = (currExpHeight || expandHeight || 0) + 1
606
+ }
607
+ }
601
608
  rows.push(
602
609
  h('tr', {
603
610
  class: 'vxe-body--row-expanded-place',
@@ -612,7 +619,7 @@ function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '
612
619
  colspan: tableColumn.length
613
620
  },
614
621
  style: {
615
- height: `${rowExpandHeightFlag ? (rowRest.expandHeight || expandHeight) : 0}px`
622
+ height: `${expHeight}px`
616
623
  }
617
624
  })
618
625
  ])
@@ -138,7 +138,7 @@ export const columnProps = {
138
138
  contentRender: Object,
139
139
 
140
140
  // 聚合函数
141
- aggFunc: [String, Boolean] as PropType<VxeColumnPropTypes.AggFunc>,
141
+ aggFunc: [Boolean, String] as PropType<VxeColumnPropTypes.AggFunc>,
142
142
  // 将单元格复制到剪贴板
143
143
  copyMethod: Function as PropType<VxeColumnPropTypes.CopyMethod>,
144
144
  // 将剪贴单元格的值清除
@@ -174,6 +174,8 @@ export class ColumnInfo {
174
174
  renderSortNumber: 0, // 用于记录自定义列顺序
175
175
 
176
176
  renderAggFn: '',
177
+ renderAggDigits: null,
178
+ renderAggFormat: null,
177
179
 
178
180
  renderFixed: '',
179
181
  renderVisible: false,