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.
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/locale/lang/ar-EG.js +6 -0
- package/es/locale/lang/de-DE.js +6 -0
- package/es/locale/lang/en-US.js +6 -0
- package/es/locale/lang/es-ES.js +6 -0
- package/es/locale/lang/fr-FR.js +6 -0
- package/es/locale/lang/hu-HU.js +6 -0
- package/es/locale/lang/hy-AM.js +6 -0
- package/es/locale/lang/id-ID.js +6 -0
- package/es/locale/lang/it-IT.js +6 -0
- package/es/locale/lang/ja-JP.js +6 -0
- package/es/locale/lang/ko-KR.js +6 -0
- package/es/locale/lang/ms-MY.js +6 -0
- package/es/locale/lang/nb-NO.js +6 -0
- package/es/locale/lang/pt-BR.js +6 -0
- package/es/locale/lang/ru-RU.js +6 -0
- package/es/locale/lang/th-TH.js +6 -0
- package/es/locale/lang/ug-CN.js +6 -0
- package/es/locale/lang/uk-UA.js +6 -0
- package/es/locale/lang/uz-UZ.js +6 -0
- package/es/locale/lang/vi-VN.js +6 -0
- package/es/locale/lang/zh-CHT.js +6 -0
- package/es/locale/lang/zh-CN.js +6 -0
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/export/mixin.js +15 -1
- package/es/table/module/keyboard/mixin.js +18 -8
- package/es/table/module/validator/mixin.js +7 -6
- package/es/table/render/index.js +11 -0
- package/es/table/src/body.js +12 -5
- package/es/table/src/column.js +1 -1
- package/es/table/src/columnInfo.js +2 -0
- package/es/table/src/methods.js +208 -79
- package/es/table/src/props.js +4 -0
- package/es/table/src/table.js +64 -3
- package/es/table/src/util.js +38 -20
- package/es/table/style.css +11 -17
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +7 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +11 -17
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +241 -76
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +6 -0
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/ar-EG.umd.js +6 -0
- package/lib/locale/lang/de-DE.js +6 -0
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/de-DE.umd.js +6 -0
- package/lib/locale/lang/en-US.js +6 -0
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +6 -0
- package/lib/locale/lang/es-ES.js +6 -0
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +6 -0
- package/lib/locale/lang/fr-FR.js +6 -0
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/fr-FR.umd.js +6 -0
- package/lib/locale/lang/hu-HU.js +6 -0
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +6 -0
- package/lib/locale/lang/hy-AM.js +6 -0
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/hy-AM.umd.js +6 -0
- package/lib/locale/lang/id-ID.js +6 -0
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/id-ID.umd.js +6 -0
- package/lib/locale/lang/it-IT.js +6 -0
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/it-IT.umd.js +6 -0
- package/lib/locale/lang/ja-JP.js +6 -0
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +6 -0
- package/lib/locale/lang/ko-KR.js +6 -0
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +6 -0
- package/lib/locale/lang/ms-MY.js +6 -0
- package/lib/locale/lang/ms-MY.min.js +1 -1
- package/lib/locale/lang/ms-MY.umd.js +6 -0
- package/lib/locale/lang/nb-NO.js +6 -0
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/nb-NO.umd.js +6 -0
- package/lib/locale/lang/pt-BR.js +6 -0
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +6 -0
- package/lib/locale/lang/ru-RU.js +6 -0
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +6 -0
- package/lib/locale/lang/th-TH.js +6 -0
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/th-TH.umd.js +6 -0
- package/lib/locale/lang/ug-CN.js +6 -0
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/ug-CN.umd.js +6 -0
- package/lib/locale/lang/uk-UA.js +6 -0
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +6 -0
- package/lib/locale/lang/uz-UZ.js +6 -0
- package/lib/locale/lang/uz-UZ.min.js +1 -1
- package/lib/locale/lang/uz-UZ.umd.js +6 -0
- package/lib/locale/lang/vi-VN.js +6 -0
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/vi-VN.umd.js +6 -0
- package/lib/locale/lang/zh-CHT.js +6 -0
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +6 -0
- package/lib/locale/lang/zh-CN.js +6 -0
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +6 -0
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/export/mixin.js +18 -6
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +18 -4
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/module/validator/mixin.js +8 -6
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/render/index.js +15 -0
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +13 -4
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/column.js +1 -1
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +2 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/methods.js +806 -14157
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +4 -0
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +74 -2
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +41 -21
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +11 -17
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +7 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-table/style/style.css +11 -17
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/locale/lang/ar-EG.ts +6 -0
- package/packages/locale/lang/de-DE.ts +6 -0
- package/packages/locale/lang/en-US.ts +6 -0
- package/packages/locale/lang/es-ES.ts +6 -0
- package/packages/locale/lang/fr-FR.ts +6 -0
- package/packages/locale/lang/hu-HU.ts +6 -0
- package/packages/locale/lang/hy-AM.ts +6 -0
- package/packages/locale/lang/id-ID.ts +6 -0
- package/packages/locale/lang/it-IT.ts +6 -0
- package/packages/locale/lang/ja-JP.ts +6 -0
- package/packages/locale/lang/ko-KR.ts +6 -0
- package/packages/locale/lang/ms-MY.ts +6 -0
- package/packages/locale/lang/nb-NO.ts +6 -0
- package/packages/locale/lang/pt-BR.ts +6 -0
- package/packages/locale/lang/ru-RU.ts +6 -0
- package/packages/locale/lang/th-TH.ts +6 -0
- package/packages/locale/lang/ug-CN.ts +6 -0
- package/packages/locale/lang/uk-UA.ts +6 -0
- package/packages/locale/lang/uz-UZ.ts +6 -0
- package/packages/locale/lang/vi-VN.ts +6 -0
- package/packages/locale/lang/zh-CHT.ts +6 -0
- package/packages/locale/lang/zh-CN.ts +6 -0
- package/packages/table/module/export/mixin.ts +13 -1
- package/packages/table/module/keyboard/mixin.ts +21 -12
- package/packages/table/module/validator/mixin.ts +7 -6
- package/packages/table/render/index.ts +12 -0
- package/packages/table/src/body.ts +12 -5
- package/packages/table/src/column.ts +1 -1
- package/packages/table/src/columnInfo.ts +2 -0
- package/packages/table/src/methods.ts +201 -78
- package/packages/table/src/props.ts +4 -0
- package/packages/table/src/table.ts +70 -2
- package/packages/table/src/util.ts +43 -19
- package/packages/ui/index.ts +6 -0
- package/styles/components/table-module/filter.scss +1 -1
- package/styles/components/table-module/menu.scss +4 -9
- package/styles/components/table.scss +8 -2
- package/styles/theme/base.scss +0 -1
- /package/es/{iconfont.1768625297791.ttf → iconfont.1773109164685.ttf} +0 -0
- /package/es/{iconfont.1768625297791.woff → iconfont.1773109164685.woff} +0 -0
- /package/es/{iconfont.1768625297791.woff2 → iconfont.1773109164685.woff2} +0 -0
- /package/lib/{iconfont.1768625297791.ttf → iconfont.1773109164685.ttf} +0 -0
- /package/lib/{iconfont.1768625297791.woff → iconfont.1773109164685.woff} +0 -0
- /package/lib/{iconfont.1768625297791.woff2 → iconfont.1773109164685.woff2} +0 -0
|
@@ -1338,7 +1338,21 @@ export default {
|
|
|
1338
1338
|
return Promise.resolve((beforeQueryAll || ajaxMethods)(params))
|
|
1339
1339
|
.then(rest => {
|
|
1340
1340
|
const listProp = resConfigs.list;
|
|
1341
|
-
|
|
1341
|
+
let tdData = [];
|
|
1342
|
+
if (listProp) {
|
|
1343
|
+
if (XEUtils.isFunction(listProp)) {
|
|
1344
|
+
tdData = listProp({ data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt });
|
|
1345
|
+
}
|
|
1346
|
+
else {
|
|
1347
|
+
tdData = XEUtils.isArray(rest) ? rest : XEUtils.get(rest, listProp);
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
else {
|
|
1351
|
+
if (XEUtils.isArray(rest)) {
|
|
1352
|
+
tdData = rest;
|
|
1353
|
+
}
|
|
1354
|
+
}
|
|
1355
|
+
handleOptions.data = tdData;
|
|
1342
1356
|
if (afterQueryAll) {
|
|
1343
1357
|
afterQueryAll(params);
|
|
1344
1358
|
}
|
|
@@ -78,9 +78,19 @@ function handleMoveSelected($xeTable, evnt, args, isLeftArrow, isUpArrow, isRigh
|
|
|
78
78
|
const internalData = $xeTable;
|
|
79
79
|
const { afterFullData, visibleColumn } = internalData;
|
|
80
80
|
const params = Object.assign({}, args);
|
|
81
|
-
const
|
|
82
|
-
const
|
|
83
|
-
|
|
81
|
+
const { row, column } = params;
|
|
82
|
+
const _rowIndex = $xeTable.getVTRowIndex(row);
|
|
83
|
+
const _columnIndex = $xeTable.getVTColumnIndex(column);
|
|
84
|
+
const refTableBody = $xeTable.$refs.refTableBody;
|
|
85
|
+
const tableBodyElem = refTableBody ? refTableBody.$el : null;
|
|
86
|
+
const tableWidth = tableBodyElem ? tableBodyElem.clientWidth : 0;
|
|
87
|
+
let colAlign = isLeftArrow || isRightArrow || (column.renderWidth < tableWidth);
|
|
88
|
+
if ((isLeftArrow && _columnIndex >= 0) || (isRightArrow && _columnIndex <= visibleColumn.length - 1)) {
|
|
89
|
+
colAlign = false;
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
evnt.preventDefault();
|
|
93
|
+
}
|
|
84
94
|
if (isUpArrow && _rowIndex > 0) {
|
|
85
95
|
// 移动到上一行
|
|
86
96
|
params.rowIndex = _rowIndex - 1;
|
|
@@ -101,7 +111,9 @@ function handleMoveSelected($xeTable, evnt, args, isLeftArrow, isUpArrow, isRigh
|
|
|
101
111
|
params.columnIndex = _columnIndex + 1;
|
|
102
112
|
params.column = visibleColumn[params.columnIndex];
|
|
103
113
|
}
|
|
104
|
-
$xeTable.scrollToRow(params.row, params.column
|
|
114
|
+
$xeTable.scrollToRow(params.row, params.column, {
|
|
115
|
+
colAlign
|
|
116
|
+
}).then(() => {
|
|
105
117
|
params.cell = $xeTable.getCellElement(params.row, params.column);
|
|
106
118
|
$xeTable.handleSelected(params, evnt);
|
|
107
119
|
});
|
|
@@ -347,16 +359,14 @@ export default {
|
|
|
347
359
|
$xeTable.handleEdit(params, evnt);
|
|
348
360
|
}
|
|
349
361
|
else {
|
|
350
|
-
$xeTable.scrollToRow(params.row, params.column)
|
|
351
|
-
.then(() => {
|
|
362
|
+
$xeTable.scrollToRow(params.row, params.column).then(() => {
|
|
352
363
|
$xeTable.handleSelected(params, evnt);
|
|
353
364
|
});
|
|
354
365
|
}
|
|
355
366
|
}
|
|
356
367
|
}
|
|
357
368
|
else {
|
|
358
|
-
$xeTable.scrollToRow(params.row, params.column)
|
|
359
|
-
.then(() => {
|
|
369
|
+
$xeTable.scrollToRow(params.row, params.column).then(() => {
|
|
360
370
|
$xeTable.handleSelected(params, evnt);
|
|
361
371
|
});
|
|
362
372
|
}
|
|
@@ -117,20 +117,21 @@ function validRuleValue(rule, val, required) {
|
|
|
117
117
|
}
|
|
118
118
|
return true;
|
|
119
119
|
}
|
|
120
|
-
function checkRuleStatus(rule, val) {
|
|
121
|
-
const { required } = rule;
|
|
122
|
-
const
|
|
120
|
+
function checkRuleStatus(rule, row, val) {
|
|
121
|
+
const { required, field } = rule;
|
|
122
|
+
const currVal = field ? XEUtils.get(row, field) : val;
|
|
123
|
+
const isEmptyVal = XEUtils.isArray(currVal) ? !currVal.length : eqEmptyValue(currVal);
|
|
123
124
|
if (required) {
|
|
124
125
|
if (isEmptyVal) {
|
|
125
126
|
return false;
|
|
126
127
|
}
|
|
127
|
-
if (!validRuleValue(rule,
|
|
128
|
+
if (!validRuleValue(rule, currVal, required)) {
|
|
128
129
|
return false;
|
|
129
130
|
}
|
|
130
131
|
}
|
|
131
132
|
else {
|
|
132
133
|
if (!isEmptyVal) {
|
|
133
|
-
if (!validRuleValue(rule,
|
|
134
|
+
if (!validRuleValue(rule, currVal, required)) {
|
|
134
135
|
return false;
|
|
135
136
|
}
|
|
136
137
|
}
|
|
@@ -459,7 +460,7 @@ export default {
|
|
|
459
460
|
}
|
|
460
461
|
}
|
|
461
462
|
else {
|
|
462
|
-
if (!checkRuleStatus(rule, cellValue)) {
|
|
463
|
+
if (!checkRuleStatus(rule, row, cellValue)) {
|
|
463
464
|
internalData.validRuleErr = true;
|
|
464
465
|
errorRules.push(new Rule(rule));
|
|
465
466
|
}
|
package/es/table/render/index.js
CHANGED
|
@@ -725,6 +725,16 @@ function handleNumberCell(h, renderOpts, params) {
|
|
|
725
725
|
}
|
|
726
726
|
: {});
|
|
727
727
|
}
|
|
728
|
+
function handleFormatDatePicker(renderOpts, params) {
|
|
729
|
+
const { props = {} } = renderOpts;
|
|
730
|
+
const { cellValue } = params;
|
|
731
|
+
if (cellValue) {
|
|
732
|
+
if (props.type !== 'time') {
|
|
733
|
+
return getLabelFormatDate(cellValue, props);
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
return cellValue;
|
|
737
|
+
}
|
|
728
738
|
function handleFormatSelect(renderOpts, params) {
|
|
729
739
|
const { cellValue } = params;
|
|
730
740
|
return handleSelectCellValue(cellValue, renderOpts);
|
|
@@ -954,6 +964,7 @@ renderer.mixin({
|
|
|
954
964
|
}
|
|
955
965
|
return getCellLabelVNs(h, renderOpts, params, cellValue);
|
|
956
966
|
},
|
|
967
|
+
tableCellFormatter: handleFormatDatePicker,
|
|
957
968
|
renderTableDefault: defaultEditRender,
|
|
958
969
|
createTableFilterOptions: defaultFilterOptions,
|
|
959
970
|
renderTableFilter: defaultFilterRender,
|
package/es/table/src/body.js
CHANGED
|
@@ -80,7 +80,7 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
|
|
|
80
80
|
const $xeGantt = $xeTable.$xeGantt;
|
|
81
81
|
const { columnKey, resizable: allResizable, showOverflow: allShowOverflow, border, height, treeConfig, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig, padding: allPadding } = tableProps;
|
|
82
82
|
const { tableData, tableColumn, dragRow, overflowX, overflowY, currentColumn, scrollXLoad, scrollYLoad, mergeBodyFlag, calcCellHeightFlag, resizeHeightFlag, resizeWidthFlag, editStore, isAllOverflow, validErrorMaps } = tableReactData;
|
|
83
|
-
const { fullAllDataRowIdData, fullColumnIdData, mergeBodyCellMaps, visibleColumn, afterFullData, mergeBodyList, scrollXStore, scrollYStore } = tableInternalData;
|
|
83
|
+
const { fullAllDataRowIdData, fullColumnIdData, mergeBodyCellMaps, visibleColumn, afterFullData, mergeBodyList, scrollXStore, scrollYStore, keepUpdateFieldMaps } = tableInternalData;
|
|
84
84
|
const cellOpts = $xeTable.computeCellOpts;
|
|
85
85
|
const validOpts = $xeTable.computeValidOpts;
|
|
86
86
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
@@ -99,7 +99,7 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
|
|
|
99
99
|
const areaOpts = $xeTable.computeAreaOpts;
|
|
100
100
|
const cellOffsetWidth = $xeTable.computeCellOffsetWidth;
|
|
101
101
|
const { selectCellToRow } = areaOpts;
|
|
102
|
-
const { type, cellRender, editRender, align, showOverflow, className, treeNode, rowResize, padding, verticalAlign, slots } = column;
|
|
102
|
+
const { field, type, cellRender, editRender, align, showOverflow, className, treeNode, rowResize, padding, verticalAlign, slots } = column;
|
|
103
103
|
const { verticalAlign: allVerticalAlign } = cellOpts;
|
|
104
104
|
const { actived } = editStore;
|
|
105
105
|
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
@@ -254,8 +254,8 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
|
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
256
|
// 如果编辑列开启显示状态
|
|
257
|
-
if (!fixedHiddenColumn && editConfig && (
|
|
258
|
-
isDirty = $xeTable.isUpdateByRow(row,
|
|
257
|
+
if (!fixedHiddenColumn && editConfig && (editOpts.showStatus || editOpts.showUpdateStatus) && keepUpdateFieldMaps[field]) {
|
|
258
|
+
isDirty = $xeTable.isUpdateByRow(row, field);
|
|
259
259
|
}
|
|
260
260
|
const isVNAutoHeight = !hasEllipsis && (scrollYLoad || scrollXLoad);
|
|
261
261
|
let cellHeight = getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight);
|
|
@@ -552,6 +552,13 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
552
552
|
const expandOpts = $xeTable.computeExpandOpts;
|
|
553
553
|
const { height: expandHeight, padding, mode: expandMode } = expandOpts;
|
|
554
554
|
if (expandMode === 'fixed') {
|
|
555
|
+
const currExpHeight = rowRest.expandHeight;
|
|
556
|
+
let expHeight = 0;
|
|
557
|
+
if (rowExpandHeightFlag) {
|
|
558
|
+
if (currExpHeight || expandHeight) {
|
|
559
|
+
expHeight = (currExpHeight || expandHeight || 0) + 1;
|
|
560
|
+
}
|
|
561
|
+
}
|
|
555
562
|
rows.push(h('tr', {
|
|
556
563
|
class: 'vxe-body--row-expanded-place',
|
|
557
564
|
key: `expand_${rowid}`,
|
|
@@ -565,7 +572,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
565
572
|
colspan: tableColumn.length
|
|
566
573
|
},
|
|
567
574
|
style: {
|
|
568
|
-
height: `${
|
|
575
|
+
height: `${expHeight}px`
|
|
569
576
|
}
|
|
570
577
|
})
|
|
571
578
|
]));
|
package/es/table/src/column.js
CHANGED