vxe-table 4.11.18 → 4.11.20
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/grid/src/grid.js +45 -34
- package/es/style.css +1 -1
- package/es/table/module/keyboard/hook.js +30 -1
- package/es/table/src/body.js +11 -6
- package/es/table/src/footer.js +7 -2
- package/es/table/src/table.js +164 -48
- package/es/table/src/util.js +13 -3
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +43 -39
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +293 -104
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/keyboard/hook.js +31 -1
- package/lib/table/module/keyboard/hook.min.js +1 -1
- package/lib/table/src/body.js +10 -5
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/footer.js +7 -2
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/table.js +184 -49
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +16 -6
- package/lib/table/src/util.min.js +1 -1
- package/lib/ui/index.js +1 -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/package.json +2 -2
- package/packages/grid/src/grid.ts +49 -40
- package/packages/table/module/keyboard/hook.ts +29 -2
- package/packages/table/src/body.ts +10 -5
- package/packages/table/src/footer.ts +7 -2
- package/packages/table/src/table.ts +167 -50
- package/packages/table/src/util.ts +15 -3
- /package/es/{iconfont.1741224125327.ttf → iconfont.1741665718304.ttf} +0 -0
- /package/es/{iconfont.1741224125327.woff → iconfont.1741665718304.woff} +0 -0
- /package/es/{iconfont.1741224125327.woff2 → iconfont.1741665718304.woff2} +0 -0
- /package/lib/{iconfont.1741224125327.ttf → iconfont.1741665718304.ttf} +0 -0
- /package/lib/{iconfont.1741224125327.woff → iconfont.1741665718304.woff} +0 -0
- /package/lib/{iconfont.1741224125327.woff2 → iconfont.1741665718304.woff2} +0 -0
package/es/grid/src/grid.js
CHANGED
|
@@ -11,7 +11,7 @@ import { getSlotVNs } from '../../ui/src/vn';
|
|
|
11
11
|
import { errLog } from '../../ui/src/log';
|
|
12
12
|
const { getConfig, getI18n, commands, hooks, useFns, createEvent, globalEvents, GLOBAL_EVENT_KEYS, renderEmptyElement } = VxeUI;
|
|
13
13
|
const tableComponentPropKeys = Object.keys(tableComponentProps);
|
|
14
|
-
const tableComponentMethodKeys = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getFullColumns', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'getFullData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'setRowHeightConf', 'getRowHeightConf', 'setRowHeight', 'getRowHeight', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'setCheckboxRowKey', 'isCheckedByCheckboxRow', 'isCheckedByCheckboxRowKey', 'isIndeterminateByCheckboxRow', 'isIndeterminateByCheckboxRowKey', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'isCheckedByRadioRowKey', 'setRadioRow', 'setRadioRowKey', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'getPendingRecords', 'clearPendingRow', 'sort', 'setSort', 'clearSort', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'scrollTo', 'scrollToRow', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'getCustomStoreData', 'openTooltip', 'getCellLabel', 'getCellElement', 'focus', 'blur', 'connect'];
|
|
14
|
+
const tableComponentMethodKeys = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isRemoveByRow', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getFullColumns', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'getFullData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'setRowHeightConf', 'getRowHeightConf', 'setRowHeight', 'getRowHeight', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'setCheckboxRowKey', 'isCheckedByCheckboxRow', 'isCheckedByCheckboxRowKey', 'isIndeterminateByCheckboxRow', 'isIndeterminateByCheckboxRowKey', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'isCheckedByRadioRowKey', 'setRadioRow', 'setRadioRowKey', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'getPendingRecords', 'clearPendingRow', 'sort', 'setSort', 'clearSort', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'scrollTo', 'scrollToRow', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'getCustomStoreData', 'openTooltip', 'moveColumnTo', 'moveRowTo', 'getCellLabel', 'getCellElement', 'focus', 'blur', 'connect'];
|
|
15
15
|
const gridComponentEmits = [
|
|
16
16
|
...tableComponentEmits,
|
|
17
17
|
'page-change',
|
|
@@ -417,6 +417,25 @@ export default defineComponent({
|
|
|
417
417
|
}
|
|
418
418
|
return null;
|
|
419
419
|
};
|
|
420
|
+
const getConfigSlot = (slotConfigs) => {
|
|
421
|
+
const slotConf = {};
|
|
422
|
+
XEUtils.objectMap(slotConfigs, (slotFunc, slotKey) => {
|
|
423
|
+
if (slotFunc) {
|
|
424
|
+
if (XEUtils.isString(slotFunc)) {
|
|
425
|
+
if (slots[slotFunc]) {
|
|
426
|
+
slotConf[slotKey] = slots[slotFunc];
|
|
427
|
+
}
|
|
428
|
+
else {
|
|
429
|
+
errLog('vxe.error.notSlot', [slotFunc]);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
else {
|
|
433
|
+
slotConf[slotKey] = slotFunc;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
});
|
|
437
|
+
return slotConf;
|
|
438
|
+
};
|
|
420
439
|
/**
|
|
421
440
|
* 渲染表单
|
|
422
441
|
*/
|
|
@@ -593,37 +612,21 @@ export default defineComponent({
|
|
|
593
612
|
const { proxyConfig, pagerConfig } = props;
|
|
594
613
|
const proxyOpts = computeProxyOpts.value;
|
|
595
614
|
const pagerOpts = computePagerOpts.value;
|
|
615
|
+
const pagerSlot = slots.pager;
|
|
596
616
|
if ((pagerConfig && isEnableConf(pagerOpts)) || slots.pager) {
|
|
597
|
-
let slotVNs = [];
|
|
598
|
-
if (slots.pager) {
|
|
599
|
-
slotVNs = slots.pager({ $grid: $xeGrid });
|
|
600
|
-
}
|
|
601
|
-
else {
|
|
602
|
-
const pagerOptSlots = pagerOpts.slots;
|
|
603
|
-
const pagerSlots = {};
|
|
604
|
-
let leftSlot;
|
|
605
|
-
let rightSlot;
|
|
606
|
-
if (pagerOptSlots) {
|
|
607
|
-
leftSlot = getFuncSlot(pagerOptSlots, 'left');
|
|
608
|
-
rightSlot = getFuncSlot(pagerOptSlots, 'right');
|
|
609
|
-
if (leftSlot) {
|
|
610
|
-
pagerSlots.left = leftSlot;
|
|
611
|
-
}
|
|
612
|
-
if (rightSlot) {
|
|
613
|
-
pagerSlots.right = rightSlot;
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
if (VxeUIPagerComponent) {
|
|
617
|
-
slotVNs.push(h(VxeUIPagerComponent, Object.assign(Object.assign(Object.assign({ ref: refPager }, pagerOpts), (proxyConfig && isEnableConf(proxyOpts) ? reactData.tablePage : {})), { onPageChange: pageChangeEvent }), pagerSlots));
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
617
|
return h('div', {
|
|
621
618
|
ref: refPagerWrapper,
|
|
622
619
|
key: 'pager',
|
|
623
620
|
class: 'vxe-grid--pager-wrapper'
|
|
624
|
-
},
|
|
621
|
+
}, pagerSlot
|
|
622
|
+
? pagerSlot({ $grid: $xeGrid })
|
|
623
|
+
: [
|
|
624
|
+
VxeUIPagerComponent
|
|
625
|
+
? h(VxeUIPagerComponent, Object.assign(Object.assign(Object.assign({ ref: refPager }, pagerOpts), (proxyConfig && isEnableConf(proxyOpts) ? reactData.tablePage : {})), { onPageChange: pageChangeEvent }), getConfigSlot(pagerOpts.slots))
|
|
626
|
+
: renderEmptyElement($xeGrid)
|
|
627
|
+
]);
|
|
625
628
|
}
|
|
626
|
-
return
|
|
629
|
+
return renderEmptyElement($xeGrid);
|
|
627
630
|
};
|
|
628
631
|
const renderChildLayout = (layoutKeys) => {
|
|
629
632
|
const childVNs = [];
|
|
@@ -745,6 +748,9 @@ export default defineComponent({
|
|
|
745
748
|
};
|
|
746
749
|
const gridMethods = {
|
|
747
750
|
dispatchEvent,
|
|
751
|
+
getEl() {
|
|
752
|
+
return refElem.value;
|
|
753
|
+
},
|
|
748
754
|
/**
|
|
749
755
|
* 提交指令,支持 code 或 button
|
|
750
756
|
* @param {String/Object} code 字符串或对象
|
|
@@ -1174,18 +1180,23 @@ export default defineComponent({
|
|
|
1174
1180
|
getExcludeHeight() {
|
|
1175
1181
|
const { isZMax } = reactData;
|
|
1176
1182
|
const el = refElem.value;
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1183
|
+
if (el) {
|
|
1184
|
+
const formWrapper = refFormWrapper.value;
|
|
1185
|
+
const toolbarWrapper = refToolbarWrapper.value;
|
|
1186
|
+
const topWrapper = refTopWrapper.value;
|
|
1187
|
+
const bottomWrapper = refBottomWrapper.value;
|
|
1188
|
+
const pagerWrapper = refPagerWrapper.value;
|
|
1189
|
+
const parentEl = el.parentElement;
|
|
1190
|
+
const parentPaddingSize = isZMax ? 0 : (parentEl ? getPaddingTopBottomSize(parentEl) : 0);
|
|
1191
|
+
return parentPaddingSize + getPaddingTopBottomSize(el) + getOffsetHeight(formWrapper) + getOffsetHeight(toolbarWrapper) + getOffsetHeight(topWrapper) + getOffsetHeight(bottomWrapper) + getOffsetHeight(pagerWrapper);
|
|
1192
|
+
}
|
|
1193
|
+
return 0;
|
|
1184
1194
|
},
|
|
1185
1195
|
getParentHeight() {
|
|
1186
1196
|
const el = refElem.value;
|
|
1187
1197
|
if (el) {
|
|
1188
|
-
|
|
1198
|
+
const parentEl = el.parentElement;
|
|
1199
|
+
return (reactData.isZMax ? getDomNode().visibleHeight : (parentEl ? XEUtils.toNumber(getComputedStyle(parentEl).height) : 0)) - gridPrivateMethods.getExcludeHeight();
|
|
1189
1200
|
}
|
|
1190
1201
|
return 0;
|
|
1191
1202
|
},
|