vxe-table 3.5.9-beta.7 → 3.5.9-beta.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.
- package/lib/edit/src/mixin.js +1 -1
- package/lib/edit/src/mixin.min.js +1 -1
- package/lib/export/src/mixin.js +1 -1
- package/lib/export/src/mixin.min.js +1 -1
- package/lib/filter/src/panel.js +6 -2
- package/lib/filter/src/panel.min.js +1 -1
- package/lib/form/src/form-config-item.js +2 -1
- package/lib/form/src/form-config-item.min.js +1 -1
- package/lib/form/src/form-item.js +2 -1
- package/lib/form/src/form-item.min.js +1 -1
- package/lib/index.umd.js +26 -17
- package/lib/index.umd.min.js +1 -1
- package/lib/table/src/body.js +5 -2
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/methods.js +9 -9
- package/lib/table/src/methods.min.js +1 -1
- package/package.json +1 -1
- package/packages/edit/src/mixin.js +2 -2
- package/packages/export/src/mixin.js +2 -2
- package/packages/filter/src/panel.js +13 -6
- package/packages/form/src/form-config-item.js +17 -9
- package/packages/form/src/form-item.js +15 -7
- package/packages/table/src/body.js +38 -23
- package/packages/table/src/methods.js +7 -7
- package/types/v-x-e-table/renderer.d.ts +13 -1
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import VXETable from '../../v-x-e-table'
|
|
|
3
3
|
import UtilTools, { isEnableConf } from '../../tools/utils'
|
|
4
4
|
import { getRowid } from '../../table/src/util'
|
|
5
5
|
import DomTools, { browse } from '../../tools/dom'
|
|
6
|
-
import { warnLog, errLog } from '../../tools/log'
|
|
6
|
+
import { warnLog, errLog, getLog } from '../../tools/log'
|
|
7
7
|
|
|
8
8
|
function insertTreeRow (_vm, newRecords, isAppend) {
|
|
9
9
|
const { tableFullTreeData, afterFullData, fullDataRowIdData, fullAllDataRowIdData, treeOpts } = _vm
|
|
@@ -130,7 +130,7 @@ export default {
|
|
|
130
130
|
}
|
|
131
131
|
} else {
|
|
132
132
|
if (treeConfig) {
|
|
133
|
-
throw new Error(
|
|
133
|
+
throw new Error(getLog('vxe.error.noTree', ['insert']))
|
|
134
134
|
}
|
|
135
135
|
let afIndex = -1
|
|
136
136
|
// 如果是可视索引
|
|
@@ -4,7 +4,7 @@ import VXETable from '../../v-x-e-table'
|
|
|
4
4
|
import UtilTools from '../../tools/utils'
|
|
5
5
|
import { mergeBodyMethod, isColumnInfo } from '../../table/src/util'
|
|
6
6
|
import { browse } from '../../tools/dom'
|
|
7
|
-
import { warnLog, errLog } from '../../tools/log'
|
|
7
|
+
import { warnLog, errLog, getLog } from '../../tools/log'
|
|
8
8
|
|
|
9
9
|
const { formatText } = UtilTools
|
|
10
10
|
|
|
@@ -576,7 +576,7 @@ export function saveLocalFile (options) {
|
|
|
576
576
|
}
|
|
577
577
|
return Promise.resolve()
|
|
578
578
|
}
|
|
579
|
-
return Promise.reject(new Error(
|
|
579
|
+
return Promise.reject(new Error(getLog('vxe.error.notExp')))
|
|
580
580
|
}
|
|
581
581
|
|
|
582
582
|
function downloadFile ($xetable, opts, content) {
|
|
@@ -16,15 +16,22 @@ export default {
|
|
|
16
16
|
},
|
|
17
17
|
render (h) {
|
|
18
18
|
const { $parent: $xetable, filterStore } = this
|
|
19
|
-
const { column } = filterStore
|
|
19
|
+
const { args, column } = filterStore
|
|
20
20
|
const filterRender = column ? column.filterRender : null
|
|
21
21
|
const compConf = filterRender ? VXETable.renderer.get(filterRender.name) : null
|
|
22
|
+
const filterClassName = compConf ? compConf.filterClassName : ''
|
|
22
23
|
return h('div', {
|
|
23
|
-
class: [
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
'
|
|
27
|
-
|
|
24
|
+
class: [
|
|
25
|
+
'vxe-table--filter-wrapper',
|
|
26
|
+
'filter--prevent-default',
|
|
27
|
+
compConf && compConf.className ? compConf.className : '',
|
|
28
|
+
UtilTools.getClass(filterClassName, Object.assign({ $panel: this }, args)),
|
|
29
|
+
{
|
|
30
|
+
'is--animat': $xetable.animat,
|
|
31
|
+
'is--multiple': filterStore.multiple,
|
|
32
|
+
'is--active': filterStore.visible
|
|
33
|
+
}
|
|
34
|
+
],
|
|
28
35
|
style: filterStore.style
|
|
29
36
|
}, filterStore.visible ? this.renderOptions(h, filterRender, compConf).concat(this.renderFooter(h)) : [])
|
|
30
37
|
},
|
|
@@ -30,6 +30,7 @@ const VxeFormConfigItem = {
|
|
|
30
30
|
const { rules, data, collapseAll, validOpts, titleAlign: allTitleAlign, titleWidth: allTitleWidth, titleColon: allTitleColon, titleAsterisk: allTitleAsterisk, titleOverflow: allTitleOverflow } = $xeform
|
|
31
31
|
const { slots, title, folding, visible, visibleMethod, field, collapseNode, itemRender, showError, errRule, className, titleOverflow, children } = item
|
|
32
32
|
const compConf = isEnableConf(itemRender) ? VXETable.renderer.get(itemRender.name) : null
|
|
33
|
+
const itemClassName = compConf ? compConf.itemClassName : ''
|
|
33
34
|
const span = item.span || $xeform.span
|
|
34
35
|
const align = item.align || $xeform.align
|
|
35
36
|
const titleAlign = XEUtils.eqNull(item.titleAlign) ? allTitleAlign : item.titleAlign
|
|
@@ -88,15 +89,22 @@ const VxeFormConfigItem = {
|
|
|
88
89
|
mouseleave: $xeform.handleTitleTipLeaveEvent
|
|
89
90
|
} : {}
|
|
90
91
|
return h('div', {
|
|
91
|
-
class: [
|
|
92
|
-
'
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
'
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
92
|
+
class: [
|
|
93
|
+
'vxe-form--item',
|
|
94
|
+
item.id,
|
|
95
|
+
span ? `vxe-col--${span} is--span` : null,
|
|
96
|
+
className ? (XEUtils.isFunction(className) ? className(params) : className) : '',
|
|
97
|
+
itemClassName ? (XEUtils.isFunction(itemClassName) ? itemClassName(params) : className) : '',
|
|
98
|
+
{
|
|
99
|
+
'is--title': title,
|
|
100
|
+
'is--colon': titleColon,
|
|
101
|
+
'is--asterisk': titleAsterisk,
|
|
102
|
+
'is--required': isRequired,
|
|
103
|
+
'is--hidden': folding && collapseAll,
|
|
104
|
+
'is--active': !itemVisibleMethod || itemVisibleMethod(params),
|
|
105
|
+
'is--error': showError
|
|
106
|
+
}
|
|
107
|
+
],
|
|
100
108
|
props: {
|
|
101
109
|
itemConfig: item
|
|
102
110
|
},
|
|
@@ -44,6 +44,7 @@ const renderItem = (h, _vm, item, slots) => {
|
|
|
44
44
|
const { rules, data, collapseAll, validOpts, titleOverflow: allTitleOverflow } = _vm
|
|
45
45
|
const { title, folding, visible, visibleMethod, field, collapseNode, itemRender, showError, errRule, className, titleOverflow } = item
|
|
46
46
|
const compConf = isEnableConf(itemRender) ? VXETable.renderer.get(itemRender.name) : null
|
|
47
|
+
const itemClassName = compConf ? compConf.itemClassName : ''
|
|
47
48
|
const span = item.span || _vm.span
|
|
48
49
|
const align = item.align || _vm.align
|
|
49
50
|
const titleAlign = item.titleAlign || _vm.titleAlign
|
|
@@ -82,13 +83,20 @@ const renderItem = (h, _vm, item, slots) => {
|
|
|
82
83
|
mouseleave: _vm.handleTitleTipLeaveEvent
|
|
83
84
|
} : {}
|
|
84
85
|
return h('div', {
|
|
85
|
-
class: [
|
|
86
|
-
'
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
'
|
|
91
|
-
|
|
86
|
+
class: [
|
|
87
|
+
'vxe-form--item',
|
|
88
|
+
item.id,
|
|
89
|
+
span ? `vxe-col--${span} is--span` : '',
|
|
90
|
+
className ? (XEUtils.isFunction(className) ? className(params) : className) : '',
|
|
91
|
+
itemClassName ? (XEUtils.isFunction(itemClassName) ? itemClassName(params) : className) : '',
|
|
92
|
+
{
|
|
93
|
+
'is--title': title,
|
|
94
|
+
'is--required': isRequired,
|
|
95
|
+
'is--hidden': visible === false || (folding && collapseAll),
|
|
96
|
+
'is--active': !itemVisibleMethod || itemVisibleMethod(params),
|
|
97
|
+
'is--error': showError
|
|
98
|
+
}
|
|
99
|
+
]
|
|
92
100
|
}, [
|
|
93
101
|
h('div', {
|
|
94
102
|
class: 'vxe-form--item-inner'
|
|
@@ -66,7 +66,7 @@ function renderColumn (h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, r
|
|
|
66
66
|
isAllOverflow,
|
|
67
67
|
align: allAlign,
|
|
68
68
|
currentColumn,
|
|
69
|
-
cellClassName,
|
|
69
|
+
cellClassName: allCellClassName,
|
|
70
70
|
cellStyle,
|
|
71
71
|
mergeList,
|
|
72
72
|
spanMethod,
|
|
@@ -90,6 +90,9 @@ function renderColumn (h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, r
|
|
|
90
90
|
const { actived } = editStore
|
|
91
91
|
const { rHeight: scrollYRHeight } = sYOpts
|
|
92
92
|
const { height: rowHeight } = rowOpts
|
|
93
|
+
const renderOpts = editRender || cellRender
|
|
94
|
+
const compConf = renderOpts ? VXETable.renderer.get(renderOpts.name) : null
|
|
95
|
+
const cellClassName = compConf ? compConf.cellClassName : ''
|
|
93
96
|
const showAllTip = tooltipOpts.showAll || tooltipOpts.enabled
|
|
94
97
|
const columnIndex = $xetable.getColumnIndex(column)
|
|
95
98
|
const _columnIndex = $xetable.getVTColumnIndex(column)
|
|
@@ -255,19 +258,26 @@ function renderColumn (h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, r
|
|
|
255
258
|
}
|
|
256
259
|
}
|
|
257
260
|
return h('td', {
|
|
258
|
-
class: [
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
261
|
+
class: [
|
|
262
|
+
'vxe-body--column',
|
|
263
|
+
column.id,
|
|
264
|
+
{
|
|
265
|
+
[`col--${cellAlign}`]: cellAlign,
|
|
266
|
+
[`col--${type}`]: type,
|
|
267
|
+
'col--last': $columnIndex === columns.length - 1,
|
|
268
|
+
'col--tree-node': treeNode,
|
|
269
|
+
'col--edit': isEdit,
|
|
270
|
+
'col--ellipsis': hasEllipsis,
|
|
271
|
+
'fixed--hidden': fixedHiddenColumn,
|
|
272
|
+
'col--dirty': isDirty,
|
|
273
|
+
'col--actived': editConfig && isEdit && (actived.row === row && (actived.column === column || editOpts.mode === 'row')),
|
|
274
|
+
'col--valid-error': hasValidError,
|
|
275
|
+
'col--current': currentColumn === column
|
|
276
|
+
},
|
|
277
|
+
UtilTools.getClass(cellClassName, params),
|
|
278
|
+
UtilTools.getClass(className, params),
|
|
279
|
+
UtilTools.getClass(allCellClassName, params)
|
|
280
|
+
],
|
|
271
281
|
key: columnKey || columnOpts.useKey ? column.id : $columnIndex,
|
|
272
282
|
attrs,
|
|
273
283
|
style: Object.assign({
|
|
@@ -343,15 +353,20 @@ function renderRows (h, _vm, $xetable, fixedType, tableData, tableColumn) {
|
|
|
343
353
|
}
|
|
344
354
|
rows.push(
|
|
345
355
|
h('tr', {
|
|
346
|
-
class: [
|
|
347
|
-
'row
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
356
|
+
class: [
|
|
357
|
+
'vxe-body--row',
|
|
358
|
+
treeConfig ? `row--level-${rowLevel}` : '',
|
|
359
|
+
{
|
|
360
|
+
'row--stripe': stripe && ($xetable.getVTRowIndex(row) + 1) % 2 === 0,
|
|
361
|
+
'is--new': isNewRow,
|
|
362
|
+
'is--expand-row': isExpandRow,
|
|
363
|
+
'is--expand-tree': isExpandTree,
|
|
364
|
+
'row--new': isNewRow && (editOpts.showStatus || editOpts.showInsertStatus),
|
|
365
|
+
'row--radio': radioOpts.highlight && $xetable.selectRow === row,
|
|
366
|
+
'row--checked': checkboxOpts.highlight && $xetable.isCheckedByCheckboxRow(row)
|
|
367
|
+
},
|
|
368
|
+
rowClassName ? (XEUtils.isFunction(rowClassName) ? rowClassName(params) : rowClassName) : ''
|
|
369
|
+
],
|
|
355
370
|
attrs: {
|
|
356
371
|
rowid: rowid
|
|
357
372
|
},
|
|
@@ -138,12 +138,12 @@ function calculateMergerOffserIndex (list, offsetItem, type) {
|
|
|
138
138
|
function setMerges (_vm, merges, mList, rowList) {
|
|
139
139
|
if (merges) {
|
|
140
140
|
const { treeConfig, visibleColumn } = _vm
|
|
141
|
-
if (treeConfig) {
|
|
142
|
-
throw new Error(UtilTools.getLog('vxe.error.noTree', ['merge-footer-items']))
|
|
143
|
-
}
|
|
144
141
|
if (!XEUtils.isArray(merges)) {
|
|
145
142
|
merges = [merges]
|
|
146
143
|
}
|
|
144
|
+
if (treeConfig && merges.length) {
|
|
145
|
+
errLog('vxe.error.noTree', ['merge-cells | merge-footer-items'])
|
|
146
|
+
}
|
|
147
147
|
merges.forEach(item => {
|
|
148
148
|
let { row, col, rowspan, colspan } = item
|
|
149
149
|
if (rowList && XEUtils.isNumber(row)) {
|
|
@@ -187,12 +187,12 @@ function removeMerges (_vm, merges, mList, rowList) {
|
|
|
187
187
|
const rest = []
|
|
188
188
|
if (merges) {
|
|
189
189
|
const { treeConfig, visibleColumn } = _vm
|
|
190
|
-
if (treeConfig) {
|
|
191
|
-
throw new Error(UtilTools.getLog('vxe.error.noTree', ['merge-cells']))
|
|
192
|
-
}
|
|
193
190
|
if (!XEUtils.isArray(merges)) {
|
|
194
191
|
merges = [merges]
|
|
195
192
|
}
|
|
193
|
+
if (treeConfig && merges.length) {
|
|
194
|
+
errLog('vxe.error.noTree', ['merge-cells | merge-footer-items'])
|
|
195
|
+
}
|
|
196
196
|
merges.forEach(item => {
|
|
197
197
|
let { row, col } = item
|
|
198
198
|
if (rowList && XEUtils.isNumber(row)) {
|
|
@@ -963,7 +963,7 @@ const Methods = {
|
|
|
963
963
|
if (!this.isInsertByRow(row)) {
|
|
964
964
|
const rowIndex = this.getRowIndex(row)
|
|
965
965
|
if (treeConfig && rowIndex === -1) {
|
|
966
|
-
|
|
966
|
+
errLog('vxe.error.noTree', ['revertData'])
|
|
967
967
|
}
|
|
968
968
|
const oRow = tableSourceData[rowIndex]
|
|
969
969
|
if (oRow && row) {
|
|
@@ -21,9 +21,19 @@ export interface VxeGlobalRenderer {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export interface RendererMapOptions {
|
|
24
|
-
|
|
24
|
+
/**
|
|
25
|
+
* 请使用 filterClassName
|
|
26
|
+
* @deprecated
|
|
27
|
+
*/
|
|
25
28
|
className?: string;
|
|
29
|
+
/**
|
|
30
|
+
* 请使用 showFilterFooter
|
|
31
|
+
* @deprecated
|
|
32
|
+
*/
|
|
26
33
|
isFooter?: boolean;
|
|
34
|
+
// 筛选渲染
|
|
35
|
+
filterClassName?: string | ((params: ColumnFilterRenderParams) => string | { [key: string]: boolean })
|
|
36
|
+
showFilterFooter?: boolean;
|
|
27
37
|
renderFilter?(h: CreateElement, renderOpts: ColumnFilterRenderOptions, params: ColumnFilterRenderParams): VNode[] | string[];
|
|
28
38
|
filterMethod?(params: ColumnFilterMethodParams): boolean;
|
|
29
39
|
filterResetMethod?(params: ColumnFilterResetParams): void;
|
|
@@ -31,6 +41,7 @@ export interface RendererMapOptions {
|
|
|
31
41
|
defaultFilterMethod?(params: ColumnFilterMethodParams): boolean;
|
|
32
42
|
|
|
33
43
|
// 单元格渲染
|
|
44
|
+
cellClassName?: string | ((params: ColumnCellRenderParams | ColumnEditRenderParams) => string | { [key: string]: boolean })
|
|
34
45
|
renderHeader?(h: CreateElement, renderOpts: ColumnCellRenderOptions | ColumnEditRenderOptions, params: ColumnCellRenderParams | ColumnEditRenderParams): VNode[] | string[];
|
|
35
46
|
renderDefault?(h: CreateElement, renderOpts: ColumnCellRenderOptions | ColumnEditRenderOptions, params: ColumnCellRenderParams | ColumnEditRenderParams): VNode[] | string[];
|
|
36
47
|
renderFooter?(h: CreateElement, renderOpts: ColumnCellRenderOptions | ColumnEditRenderOptions, params: ColumnFooterRenderParams): VNode[] | string[];
|
|
@@ -50,6 +61,7 @@ export interface RendererMapOptions {
|
|
|
50
61
|
renderToolbarTool?(h: CreateElement, renderOpts: ToolbarToolRenderOptions, params: ToolbarToolRenderParams): VNode[] | string[];
|
|
51
62
|
|
|
52
63
|
// 表单-项渲染
|
|
64
|
+
itemClassName?: string | ((params: FormItemRenderParams) => string | { [key: string]: boolean })
|
|
53
65
|
renderItemTitle?(h: CreateElement, renderOpts: FormItemRenderOptions, params: FormItemRenderParams): VNode[] | string[];
|
|
54
66
|
renderItemContent?(h: CreateElement, renderOpts: FormItemRenderOptions, params: FormItemRenderParams): VNode[] | string[];
|
|
55
67
|
itemVisibleMethod?(params: FormItemVisibleParams): boolean;
|