vxe-table 4.7.76 → 4.7.78
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/README.en.md +1 -1
- package/README.ja-JP.md +1 -1
- package/README.md +1 -1
- package/README.zh-TW.md +1 -1
- package/es/grid/src/grid.js +45 -36
- package/es/style.css +1 -1
- package/es/table/module/custom/panel.js +5 -0
- package/es/table/src/body.js +26 -2
- package/es/table/src/cell.js +6 -6
- package/es/table/src/column.js +45 -18
- package/es/table/src/footer.js +16 -4
- package/es/table/src/group.js +18 -12
- package/es/table/src/header.js +4 -1
- package/es/table/src/props.js +96 -24
- package/es/table/src/table.js +80 -20
- package/es/table/src/util.js +1 -1
- package/es/toolbar/src/toolbar.js +89 -68
- package/es/ui/index.js +2 -2
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +45 -39
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +343 -198
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/custom/panel.js +7 -0
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/src/cell.js +3 -3
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +16 -10
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/group.js +17 -11
- package/lib/table/src/group.min.js +1 -1
- package/lib/table/src/table.js +91 -22
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +1 -1
- package/lib/table/src/util.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +109 -76
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/ui/index.js +2 -2
- 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 +54 -44
- package/packages/table/module/custom/panel.ts +5 -0
- package/packages/table/src/body.ts +26 -2
- package/packages/table/src/cell.ts +9 -8
- package/packages/table/src/column.ts +47 -20
- package/packages/table/src/footer.ts +16 -4
- package/packages/table/src/group.ts +19 -13
- package/packages/table/src/header.ts +4 -1
- package/packages/table/src/props.ts +97 -24
- package/packages/table/src/table.ts +80 -25
- package/packages/table/src/util.ts +2 -2
- package/packages/toolbar/src/toolbar.ts +97 -75
- /package/es/{iconfont.1725332971397.ttf → iconfont.1726051234125.ttf} +0 -0
- /package/es/{iconfont.1725332971397.woff → iconfont.1726051234125.woff} +0 -0
- /package/es/{iconfont.1725332971397.woff2 → iconfont.1726051234125.woff2} +0 -0
- /package/lib/{iconfont.1725332971397.ttf → iconfont.1726051234125.ttf} +0 -0
- /package/lib/{iconfont.1725332971397.woff → iconfont.1726051234125.woff} +0 -0
- /package/lib/{iconfont.1725332971397.woff2 → iconfont.1726051234125.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -1794,6 +1794,8 @@ var core_ = __webpack_require__(4345);
|
|
|
1794
1794
|
var external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_ = __webpack_require__(8871);
|
|
1795
1795
|
var external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default = /*#__PURE__*/__webpack_require__.n(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_);
|
|
1796
1796
|
;// CONCATENATED MODULE: ./node_modules/dom-zindex/es/index.esm.js
|
|
1797
|
+
var winDom = null;
|
|
1798
|
+
var bodyEl = null;
|
|
1797
1799
|
var storeEl = null;
|
|
1798
1800
|
var storeId = 'z-index-manage';
|
|
1799
1801
|
var styleEl = null;
|
|
@@ -1804,19 +1806,34 @@ var storeData = {
|
|
|
1804
1806
|
m: 1000,
|
|
1805
1807
|
s: 1000
|
|
1806
1808
|
};
|
|
1807
|
-
function
|
|
1808
|
-
|
|
1809
|
+
function getDocument() {
|
|
1810
|
+
if (!winDom) {
|
|
1811
|
+
if (typeof document !== 'undefined') {
|
|
1812
|
+
winDom = document;
|
|
1813
|
+
}
|
|
1814
|
+
}
|
|
1815
|
+
return winDom;
|
|
1816
|
+
}
|
|
1817
|
+
function getBody() {
|
|
1818
|
+
if (winDom && !bodyEl) {
|
|
1819
|
+
bodyEl = winDom.body || winDom.getElementsByTagName('body')[0];
|
|
1820
|
+
}
|
|
1821
|
+
return bodyEl;
|
|
1809
1822
|
}
|
|
1810
1823
|
function getDomMaxZIndex() {
|
|
1811
1824
|
var max = 0;
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1825
|
+
var dom = getDocument();
|
|
1826
|
+
if (dom) {
|
|
1827
|
+
var body = getBody();
|
|
1828
|
+
if (body) {
|
|
1829
|
+
var allElem = body.getElementsByTagName('*');
|
|
1830
|
+
for (var i = 0; i < allElem.length; i++) {
|
|
1831
|
+
var elem = allElem[i];
|
|
1832
|
+
if (elem && elem.style && elem.nodeType === 1) {
|
|
1833
|
+
var zIndex = elem.style.zIndex;
|
|
1834
|
+
if (zIndex && /^\d+$/.test(zIndex)) {
|
|
1835
|
+
max = Math.max(max, Number(zIndex));
|
|
1836
|
+
}
|
|
1820
1837
|
}
|
|
1821
1838
|
}
|
|
1822
1839
|
}
|
|
@@ -1825,12 +1842,13 @@ function getDomMaxZIndex() {
|
|
|
1825
1842
|
}
|
|
1826
1843
|
function getStyle() {
|
|
1827
1844
|
if (!styleEl) {
|
|
1828
|
-
|
|
1829
|
-
|
|
1845
|
+
var dom = getDocument();
|
|
1846
|
+
if (dom) {
|
|
1847
|
+
styleEl = dom.getElementById(styleId);
|
|
1830
1848
|
if (!styleEl) {
|
|
1831
|
-
styleEl =
|
|
1849
|
+
styleEl = dom.createElement('style');
|
|
1832
1850
|
styleEl.id = styleId;
|
|
1833
|
-
|
|
1851
|
+
dom.getElementsByTagName('head')[0].appendChild(styleEl);
|
|
1834
1852
|
}
|
|
1835
1853
|
}
|
|
1836
1854
|
}
|
|
@@ -1844,17 +1862,21 @@ function updateVar() {
|
|
|
1844
1862
|
styEl.innerHTML = ':root{' + prefixes + 'main' + propKey + ':' + getCurrent() + ';' + prefixes + 'sub' + propKey + ':' + getSubCurrent() + '}';
|
|
1845
1863
|
}
|
|
1846
1864
|
}
|
|
1847
|
-
function
|
|
1865
|
+
function getStoreDom() {
|
|
1848
1866
|
if (!storeEl) {
|
|
1849
|
-
|
|
1850
|
-
|
|
1867
|
+
var dom = getDocument();
|
|
1868
|
+
if (dom) {
|
|
1869
|
+
storeEl = dom.getElementById(storeId);
|
|
1851
1870
|
if (!storeEl) {
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1871
|
+
var body = getBody();
|
|
1872
|
+
if (body) {
|
|
1873
|
+
storeEl = dom.createElement('div');
|
|
1874
|
+
storeEl.id = storeId;
|
|
1875
|
+
storeEl.style.display = 'none';
|
|
1876
|
+
body.appendChild(storeEl);
|
|
1877
|
+
setCurrent(storeData.m);
|
|
1878
|
+
setSubCurrent(storeData.s);
|
|
1879
|
+
}
|
|
1858
1880
|
}
|
|
1859
1881
|
}
|
|
1860
1882
|
}
|
|
@@ -1865,12 +1887,12 @@ function createSetHandle(key) {
|
|
|
1865
1887
|
if (value) {
|
|
1866
1888
|
value = Number(value);
|
|
1867
1889
|
storeData[key] = value;
|
|
1868
|
-
var
|
|
1869
|
-
if (
|
|
1870
|
-
if (
|
|
1871
|
-
|
|
1890
|
+
var el = getStoreDom();
|
|
1891
|
+
if (el) {
|
|
1892
|
+
if (el.dataset) {
|
|
1893
|
+
el.dataset[key] = value + '';
|
|
1872
1894
|
} else {
|
|
1873
|
-
|
|
1895
|
+
el.setAttribute('data-' + key, value + '');
|
|
1874
1896
|
}
|
|
1875
1897
|
}
|
|
1876
1898
|
}
|
|
@@ -1882,9 +1904,9 @@ var setCurrent = createSetHandle(storeMainKey);
|
|
|
1882
1904
|
function createGetHandle(key, nextMethod) {
|
|
1883
1905
|
return function getCurrent(currZindex) {
|
|
1884
1906
|
var zIndex;
|
|
1885
|
-
var
|
|
1886
|
-
if (
|
|
1887
|
-
var domVal =
|
|
1907
|
+
var el = getStoreDom();
|
|
1908
|
+
if (el) {
|
|
1909
|
+
var domVal = el.dataset ? el.dataset[key] : el.getAttribute('data-' + key);
|
|
1888
1910
|
if (domVal) {
|
|
1889
1911
|
zIndex = Number(domVal);
|
|
1890
1912
|
}
|
|
@@ -1976,9 +1998,9 @@ function eqEmptyValue(cellValue) {
|
|
|
1976
1998
|
;// CONCATENATED MODULE: ./packages/ui/index.ts
|
|
1977
1999
|
|
|
1978
2000
|
|
|
1979
|
-
const version = "4.7.
|
|
2001
|
+
const version = "4.7.78";
|
|
1980
2002
|
core_.VxeUI.version = version;
|
|
1981
|
-
core_.VxeUI.tableVersion = "4.7.
|
|
2003
|
+
core_.VxeUI.tableVersion = "4.7.78";
|
|
1982
2004
|
core_.VxeUI.setConfig({
|
|
1983
2005
|
emptyCell: ' ',
|
|
1984
2006
|
table: {
|
|
@@ -2360,7 +2382,7 @@ var es_array_push = __webpack_require__(4114);
|
|
|
2360
2382
|
const {
|
|
2361
2383
|
log: log_log
|
|
2362
2384
|
} = core_.VxeUI;
|
|
2363
|
-
const log_version = `table v${"4.7.
|
|
2385
|
+
const log_version = `table v${"4.7.78"}`;
|
|
2364
2386
|
const warnLog = log_log.create('warn', log_version);
|
|
2365
2387
|
const errLog = log_log.create('error', log_version);
|
|
2366
2388
|
;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
|
|
@@ -3000,7 +3022,7 @@ function assembleColumn($xeTable, elem, column, colgroup) {
|
|
|
3000
3022
|
staticColumns
|
|
3001
3023
|
} = reactData;
|
|
3002
3024
|
const parentElem = elem.parentNode;
|
|
3003
|
-
const parentColumn = colgroup ? colgroup.
|
|
3025
|
+
const parentColumn = colgroup ? colgroup.columnConfig : null;
|
|
3004
3026
|
const parentCols = parentColumn ? parentColumn.children : staticColumns;
|
|
3005
3027
|
if (parentElem && parentCols) {
|
|
3006
3028
|
parentCols.splice(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayIndexOf(parentElem.children, elem), 0, column);
|
|
@@ -3507,11 +3529,11 @@ const Cell = {
|
|
|
3507
3529
|
const cellPlaceholder = editRender ? editRender.placeholder : '';
|
|
3508
3530
|
return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
3509
3531
|
class: 'vxe-cell--label'
|
|
3510
|
-
},
|
|
3532
|
+
}, [
|
|
3511
3533
|
// 如果设置占位符
|
|
3512
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
3534
|
+
editRender && eqEmptyValue(cellValue) ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
3513
3535
|
class: 'vxe-cell--placeholder'
|
|
3514
|
-
}, formatText(getFuncText(cellPlaceholder), 1))
|
|
3536
|
+
}, formatText(getFuncText(cellPlaceholder), 1)) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', formatText(cellValue, 1))])];
|
|
3515
3537
|
},
|
|
3516
3538
|
renderTreeCell(params) {
|
|
3517
3539
|
return Cell.renderTreeIcon(params, Cell.renderDefaultCell(params));
|
|
@@ -4442,25 +4464,31 @@ const columnProps = {
|
|
|
4442
4464
|
slots
|
|
4443
4465
|
}) {
|
|
4444
4466
|
const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
4445
|
-
const $xeTable = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeTable',
|
|
4446
|
-
const
|
|
4447
|
-
|
|
4448
|
-
|
|
4467
|
+
const $xeTable = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeTable', null);
|
|
4468
|
+
const $xeColgroup = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeColgroup', null);
|
|
4469
|
+
if (!$xeTable) {
|
|
4470
|
+
return () => (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)();
|
|
4471
|
+
}
|
|
4472
|
+
const columnConfig = cell.createColumn($xeTable, props);
|
|
4473
|
+
columnConfig.slots = slots;
|
|
4449
4474
|
const renderVN = () => {
|
|
4450
4475
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
4451
4476
|
ref: refElem
|
|
4452
4477
|
});
|
|
4453
4478
|
};
|
|
4454
4479
|
const $xeColumn = {
|
|
4455
|
-
|
|
4480
|
+
columnConfig,
|
|
4456
4481
|
renderVN
|
|
4457
4482
|
};
|
|
4458
|
-
watchColumn($xeTable, props,
|
|
4483
|
+
watchColumn($xeTable, props, columnConfig);
|
|
4459
4484
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
|
|
4460
|
-
|
|
4485
|
+
const elem = refElem.value;
|
|
4486
|
+
if (elem) {
|
|
4487
|
+
assembleColumn($xeTable, elem, columnConfig, $xeColgroup);
|
|
4488
|
+
}
|
|
4461
4489
|
});
|
|
4462
4490
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onUnmounted)(() => {
|
|
4463
|
-
destroyColumn($xeTable,
|
|
4491
|
+
destroyColumn($xeTable, columnConfig);
|
|
4464
4492
|
});
|
|
4465
4493
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.provide)('$xeColumn', $xeColumn);
|
|
4466
4494
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.provide)('$xeGrid', null);
|
|
@@ -4497,21 +4525,27 @@ const Column = VxeColumn;
|
|
|
4497
4525
|
slots
|
|
4498
4526
|
}) {
|
|
4499
4527
|
const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
4500
|
-
const $xeTable = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeTable',
|
|
4501
|
-
const
|
|
4502
|
-
|
|
4528
|
+
const $xeTable = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeTable', null);
|
|
4529
|
+
const $xeParentColgroup = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeColgroup', null);
|
|
4530
|
+
if (!$xeTable) {
|
|
4531
|
+
return () => (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)();
|
|
4532
|
+
}
|
|
4533
|
+
const columnConfig = cell.createColumn($xeTable, props);
|
|
4503
4534
|
const columnSlots = {};
|
|
4504
4535
|
if (slots.header) {
|
|
4505
4536
|
columnSlots.header = slots.header;
|
|
4506
4537
|
}
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
watchColumn($xeTable, props,
|
|
4538
|
+
columnConfig.slots = columnSlots;
|
|
4539
|
+
columnConfig.children = [];
|
|
4540
|
+
watchColumn($xeTable, props, columnConfig);
|
|
4510
4541
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
|
|
4511
|
-
|
|
4542
|
+
const elem = refElem.value;
|
|
4543
|
+
if (elem) {
|
|
4544
|
+
assembleColumn($xeTable, elem, columnConfig, $xeParentColgroup);
|
|
4545
|
+
}
|
|
4512
4546
|
});
|
|
4513
4547
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onUnmounted)(() => {
|
|
4514
|
-
destroyColumn($xeTable,
|
|
4548
|
+
destroyColumn($xeTable, columnConfig);
|
|
4515
4549
|
});
|
|
4516
4550
|
const renderVN = () => {
|
|
4517
4551
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
@@ -4519,7 +4553,7 @@ const Column = VxeColumn;
|
|
|
4519
4553
|
}, slots.default ? slots.default() : []);
|
|
4520
4554
|
};
|
|
4521
4555
|
const $xeColgroup = {
|
|
4522
|
-
|
|
4556
|
+
columnConfig
|
|
4523
4557
|
};
|
|
4524
4558
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.provide)('$xeColgroup', $xeColgroup);
|
|
4525
4559
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.provide)('$xeGrid', null);
|
|
@@ -7391,9 +7425,16 @@ const {
|
|
|
7391
7425
|
};
|
|
7392
7426
|
if (true) {
|
|
7393
7427
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
7428
|
+
const customOpts = computeCustomOpts.value;
|
|
7429
|
+
const {
|
|
7430
|
+
mode
|
|
7431
|
+
} = customOpts;
|
|
7394
7432
|
if (!VxeUIModalComponent) {
|
|
7395
7433
|
errLog('vxe.error.reqComp', ['vxe-modal']);
|
|
7396
7434
|
}
|
|
7435
|
+
if (!VxeUIDrawerComponent && mode === 'drawer') {
|
|
7436
|
+
errLog('vxe.error.reqComp', ['vxe-drawer']);
|
|
7437
|
+
}
|
|
7397
7438
|
if (!VxeUIButtonComponent) {
|
|
7398
7439
|
errLog('vxe.error.reqComp', ['vxe-button']);
|
|
7399
7440
|
}
|
|
@@ -10468,9 +10509,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
10468
10509
|
if (rows && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)) {
|
|
10469
10510
|
rows = [rows];
|
|
10470
10511
|
}
|
|
10471
|
-
|
|
10472
|
-
|
|
10473
|
-
}, !!value, isForce));
|
|
10512
|
+
tablePrivateMethods.handleBatchSelectRows(rows, !!value, isForce);
|
|
10513
|
+
tablePrivateMethods.checkSelectionStatus();
|
|
10474
10514
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
10475
10515
|
};
|
|
10476
10516
|
const handleCheckedAllCheckboxRow = (value, isForce) => {
|
|
@@ -10482,7 +10522,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
10482
10522
|
} = reactData;
|
|
10483
10523
|
const {
|
|
10484
10524
|
afterFullData,
|
|
10485
|
-
afterFullRowMaps,
|
|
10486
10525
|
checkboxReserveRowMap
|
|
10487
10526
|
} = internalData;
|
|
10488
10527
|
const treeOpts = computeTreeOpts.value;
|
|
@@ -10496,15 +10535,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
10496
10535
|
} = checkboxOpts;
|
|
10497
10536
|
const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
|
|
10498
10537
|
const selectRowMaps = {};
|
|
10499
|
-
// 疑惑!
|
|
10500
|
-
if (!treeConfig) {
|
|
10501
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(selectCheckboxMaps, (row, rowid) => {
|
|
10502
|
-
if (!afterFullRowMaps[rowid]) {
|
|
10503
|
-
selectRowMaps[rowid] = row;
|
|
10504
|
-
}
|
|
10505
|
-
});
|
|
10506
|
-
}
|
|
10507
|
-
// 疑惑!
|
|
10508
10538
|
if (checkStrictly) {
|
|
10509
10539
|
reactData.isAllSelected = value;
|
|
10510
10540
|
} else {
|
|
@@ -11603,7 +11633,13 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11603
11633
|
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)) {
|
|
11604
11634
|
rest = [rows];
|
|
11605
11635
|
}
|
|
11606
|
-
|
|
11636
|
+
const rowkey = getRowkey($xeTable);
|
|
11637
|
+
rest.forEach(row => {
|
|
11638
|
+
const rowid = getRowid($xeTable, row);
|
|
11639
|
+
const newRecord = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(Object.assign({}, record), true);
|
|
11640
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(newRecord, rowkey, rowid);
|
|
11641
|
+
Object.assign(row, newRecord);
|
|
11642
|
+
});
|
|
11607
11643
|
}
|
|
11608
11644
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
11609
11645
|
},
|
|
@@ -11629,13 +11665,14 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11629
11665
|
const oRow = tableSourceData[rowIndex];
|
|
11630
11666
|
if (oRow && row) {
|
|
11631
11667
|
if (field) {
|
|
11632
|
-
const newValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(record || row, field);
|
|
11668
|
+
const newValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(record || row, field), true);
|
|
11633
11669
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, field, newValue);
|
|
11634
11670
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(oRow, field, newValue);
|
|
11635
11671
|
} else {
|
|
11636
|
-
const
|
|
11637
|
-
|
|
11638
|
-
}, true);
|
|
11672
|
+
const rowkey = getRowkey($xeTable);
|
|
11673
|
+
const rowid = getRowid($xeTable, row);
|
|
11674
|
+
const newRecord = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(Object.assign({}, record), true);
|
|
11675
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(newRecord, rowkey, rowid);
|
|
11639
11676
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().destructuring(oRow, Object.assign(row, newRecord));
|
|
11640
11677
|
}
|
|
11641
11678
|
}
|
|
@@ -12513,6 +12550,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12513
12550
|
* @param {Boolean} value 是否选中
|
|
12514
12551
|
*/
|
|
12515
12552
|
setCheckboxRow(rows, value) {
|
|
12553
|
+
if (rows && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)) {
|
|
12554
|
+
rows = [rows];
|
|
12555
|
+
}
|
|
12516
12556
|
return handleCheckedCheckboxRow(rows, value, true);
|
|
12517
12557
|
},
|
|
12518
12558
|
isCheckedByCheckboxRow(row) {
|
|
@@ -12549,6 +12589,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12549
12589
|
tablePrivateMethods.handleSelectRow({
|
|
12550
12590
|
row
|
|
12551
12591
|
}, value, true);
|
|
12592
|
+
tablePrivateMethods.checkSelectionStatus();
|
|
12552
12593
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
12553
12594
|
},
|
|
12554
12595
|
/**
|
|
@@ -14891,6 +14932,72 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
14891
14932
|
}
|
|
14892
14933
|
},
|
|
14893
14934
|
/**
|
|
14935
|
+
* 多行
|
|
14936
|
+
* 多选,行选中事件
|
|
14937
|
+
* value 选中true 不选false 半选-1
|
|
14938
|
+
*/
|
|
14939
|
+
handleBatchSelectRows(rows, value, isForce) {
|
|
14940
|
+
const {
|
|
14941
|
+
treeConfig
|
|
14942
|
+
} = props;
|
|
14943
|
+
const {
|
|
14944
|
+
selectCheckboxMaps
|
|
14945
|
+
} = reactData;
|
|
14946
|
+
const selectRowMaps = Object.assign({}, selectCheckboxMaps);
|
|
14947
|
+
const checkboxOpts = computeCheckboxOpts.value;
|
|
14948
|
+
const {
|
|
14949
|
+
checkField,
|
|
14950
|
+
checkStrictly,
|
|
14951
|
+
checkMethod
|
|
14952
|
+
} = checkboxOpts;
|
|
14953
|
+
if (checkField) {
|
|
14954
|
+
if (treeConfig && !checkStrictly) {
|
|
14955
|
+
rows.forEach(row => {
|
|
14956
|
+
tablePrivateMethods.handleSelectRow({
|
|
14957
|
+
row
|
|
14958
|
+
}, value, isForce);
|
|
14959
|
+
});
|
|
14960
|
+
} else {
|
|
14961
|
+
rows.forEach(row => {
|
|
14962
|
+
if (isForce || !checkMethod || checkMethod({
|
|
14963
|
+
row
|
|
14964
|
+
})) {
|
|
14965
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, checkField, value);
|
|
14966
|
+
handleCheckboxReserveRow(row, value);
|
|
14967
|
+
}
|
|
14968
|
+
});
|
|
14969
|
+
}
|
|
14970
|
+
} else {
|
|
14971
|
+
if (treeConfig && !checkStrictly) {
|
|
14972
|
+
rows.forEach(row => {
|
|
14973
|
+
tablePrivateMethods.handleSelectRow({
|
|
14974
|
+
row
|
|
14975
|
+
}, value, isForce);
|
|
14976
|
+
});
|
|
14977
|
+
} else {
|
|
14978
|
+
rows.forEach(row => {
|
|
14979
|
+
const rowid = getRowid($xeTable, row);
|
|
14980
|
+
if (isForce || !checkMethod || checkMethod({
|
|
14981
|
+
row
|
|
14982
|
+
})) {
|
|
14983
|
+
if (value) {
|
|
14984
|
+
if (!selectRowMaps[rowid]) {
|
|
14985
|
+
selectRowMaps[rowid] = row;
|
|
14986
|
+
}
|
|
14987
|
+
} else {
|
|
14988
|
+
if (selectRowMaps[rowid]) {
|
|
14989
|
+
delete selectRowMaps[rowid];
|
|
14990
|
+
}
|
|
14991
|
+
}
|
|
14992
|
+
handleCheckboxReserveRow(row, value);
|
|
14993
|
+
}
|
|
14994
|
+
});
|
|
14995
|
+
}
|
|
14996
|
+
}
|
|
14997
|
+
reactData.selectCheckboxMaps = selectRowMaps;
|
|
14998
|
+
},
|
|
14999
|
+
/**
|
|
15000
|
+
* 单行
|
|
14894
15001
|
* 多选,行选中事件
|
|
14895
15002
|
* value 选中true 不选false 半选-1
|
|
14896
15003
|
*/
|
|
@@ -14904,9 +15011,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
14904
15011
|
selectCheckboxMaps,
|
|
14905
15012
|
treeIndeterminateMaps
|
|
14906
15013
|
} = reactData;
|
|
14907
|
-
const selectRowMaps = {
|
|
14908
|
-
...selectCheckboxMaps
|
|
14909
|
-
};
|
|
15014
|
+
const selectRowMaps = Object.assign({}, selectCheckboxMaps);
|
|
14910
15015
|
const {
|
|
14911
15016
|
afterFullData
|
|
14912
15017
|
} = internalData;
|
|
@@ -14985,9 +15090,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
14985
15090
|
parentStatus = selectItems.filter(item => vItemMaps[getRowid($xeTable, item)]).length === vItems.length ? true : selectItems.length || value === -1 ? -1 : false;
|
|
14986
15091
|
}
|
|
14987
15092
|
reactData.selectCheckboxMaps = selectRowMaps;
|
|
14988
|
-
|
|
15093
|
+
tablePrivateMethods.handleSelectRow({
|
|
14989
15094
|
row: matchObj.parent
|
|
14990
15095
|
}, parentStatus, isForce);
|
|
15096
|
+
return;
|
|
14991
15097
|
}
|
|
14992
15098
|
} else {
|
|
14993
15099
|
if (isForce || !checkMethod || checkMethod({
|
|
@@ -15072,9 +15178,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
15072
15178
|
parentStatus = selectItems.filter(item => vItemMaps[getRowid($xeTable, item)]).length === vItems.length ? true : selectItems.length || value === -1 ? -1 : false;
|
|
15073
15179
|
}
|
|
15074
15180
|
reactData.selectCheckboxMaps = selectRowMaps;
|
|
15075
|
-
|
|
15181
|
+
tablePrivateMethods.handleSelectRow({
|
|
15076
15182
|
row: matchObj.parent
|
|
15077
15183
|
}, parentStatus, isForce);
|
|
15184
|
+
return;
|
|
15078
15185
|
}
|
|
15079
15186
|
} else {
|
|
15080
15187
|
if (isForce || !checkMethod || checkMethod({
|
|
@@ -15094,7 +15201,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
15094
15201
|
}
|
|
15095
15202
|
}
|
|
15096
15203
|
reactData.selectCheckboxMaps = selectRowMaps;
|
|
15097
|
-
tablePrivateMethods.checkSelectionStatus();
|
|
15098
15204
|
},
|
|
15099
15205
|
triggerHeaderTitleEvent(evnt, iconParams, params) {
|
|
15100
15206
|
const tipContent = iconParams.content || iconParams.message;
|
|
@@ -15403,6 +15509,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
15403
15509
|
tablePrivateMethods.triggerCheckRowEvent(evnt, params, value);
|
|
15404
15510
|
} else {
|
|
15405
15511
|
tablePrivateMethods.handleSelectRow(params, value);
|
|
15512
|
+
tablePrivateMethods.checkSelectionStatus();
|
|
15406
15513
|
}
|
|
15407
15514
|
},
|
|
15408
15515
|
triggerCheckRowEvent(evnt, params, value) {
|
|
@@ -15442,6 +15549,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
15442
15549
|
row
|
|
15443
15550
|
})) {
|
|
15444
15551
|
tablePrivateMethods.handleSelectRow(params, value);
|
|
15552
|
+
tablePrivateMethods.checkSelectionStatus();
|
|
15445
15553
|
tableMethods.dispatchEvent('checkbox-change', Object.assign({
|
|
15446
15554
|
records: tableMethods.getCheckboxRecords(),
|
|
15447
15555
|
reserves: tableMethods.getCheckboxReserveRecords(),
|
|
@@ -16324,9 +16432,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
16324
16432
|
table_globalEvents.on($xeTable, 'mousewheel', handleGlobalMousewheelEvent);
|
|
16325
16433
|
table_globalEvents.on($xeTable, 'keydown', handleGlobalKeydownEvent);
|
|
16326
16434
|
table_globalEvents.on($xeTable, 'resize', handleGlobalResizeEvent);
|
|
16327
|
-
|
|
16328
|
-
table_globalEvents.on($xeTable, 'contextmenu', $xeTable.handleGlobalContextmenuEvent);
|
|
16329
|
-
}
|
|
16435
|
+
table_globalEvents.on($xeTable, 'contextmenu', $xeTable.handleGlobalContextmenuEvent);
|
|
16330
16436
|
tablePrivateMethods.preventEvent(null, 'mounted', {
|
|
16331
16437
|
$table: $xeTable
|
|
16332
16438
|
});
|
|
@@ -16547,7 +16653,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
16547
16653
|
storeData: reactData.importStore
|
|
16548
16654
|
}) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(),
|
|
16549
16655
|
/**
|
|
16550
|
-
*
|
|
16656
|
+
* 导出
|
|
16551
16657
|
*/
|
|
16552
16658
|
initStore.export && (props.exportConfig || props.printConfig) ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(export_panel, {
|
|
16553
16659
|
defaultOptions: reactData.exportParams,
|
|
@@ -22469,8 +22575,12 @@ const {
|
|
|
22469
22575
|
} = toolbar_useFns.useSize(props);
|
|
22470
22576
|
const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({
|
|
22471
22577
|
isRefresh: false,
|
|
22578
|
+
connectFlag: 0,
|
|
22472
22579
|
columns: []
|
|
22473
22580
|
});
|
|
22581
|
+
const internalData = {
|
|
22582
|
+
connectTable: null
|
|
22583
|
+
};
|
|
22474
22584
|
const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
22475
22585
|
const refMaps = {
|
|
22476
22586
|
refElem
|
|
@@ -22480,12 +22590,11 @@ const {
|
|
|
22480
22590
|
props,
|
|
22481
22591
|
context,
|
|
22482
22592
|
reactData,
|
|
22593
|
+
internalData,
|
|
22483
22594
|
getRefMaps: () => refMaps
|
|
22484
22595
|
};
|
|
22485
22596
|
let toolbarMethods = {};
|
|
22486
22597
|
const $xeGrid = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeGrid', null);
|
|
22487
|
-
const refTable = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
22488
|
-
const connectFlag = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);
|
|
22489
22598
|
const computeRefreshOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
22490
22599
|
return Object.assign({}, toolbar_getConfig().toolbar.refresh, props.refresh);
|
|
22491
22600
|
});
|
|
@@ -22505,8 +22614,11 @@ const {
|
|
|
22505
22614
|
return Object.assign({}, toolbar_getConfig().toolbar.custom, props.custom);
|
|
22506
22615
|
});
|
|
22507
22616
|
const computeTableCustomOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
22508
|
-
const
|
|
22509
|
-
|
|
22617
|
+
const {
|
|
22618
|
+
connectTable
|
|
22619
|
+
} = internalData;
|
|
22620
|
+
const $table = connectTable;
|
|
22621
|
+
if (reactData.connectFlag || $table) {
|
|
22510
22622
|
if ($table) {
|
|
22511
22623
|
const {
|
|
22512
22624
|
computeCustomOpts
|
|
@@ -22523,7 +22635,10 @@ const {
|
|
|
22523
22635
|
return tableCustomOpts.trigger;
|
|
22524
22636
|
});
|
|
22525
22637
|
const checkTable = () => {
|
|
22526
|
-
const
|
|
22638
|
+
const {
|
|
22639
|
+
connectTable
|
|
22640
|
+
} = internalData;
|
|
22641
|
+
const $table = connectTable;
|
|
22527
22642
|
if ($table) {
|
|
22528
22643
|
return true;
|
|
22529
22644
|
}
|
|
@@ -22532,7 +22647,10 @@ const {
|
|
|
22532
22647
|
const handleClickSettingEvent = ({
|
|
22533
22648
|
$event
|
|
22534
22649
|
}) => {
|
|
22535
|
-
const
|
|
22650
|
+
const {
|
|
22651
|
+
connectTable
|
|
22652
|
+
} = internalData;
|
|
22653
|
+
const $table = connectTable;
|
|
22536
22654
|
if ($table) {
|
|
22537
22655
|
if ($table.triggerCustomEvent) {
|
|
22538
22656
|
$table.triggerCustomEvent($event);
|
|
@@ -22544,7 +22662,10 @@ const {
|
|
|
22544
22662
|
const handleMouseenterSettingEvent = ({
|
|
22545
22663
|
$event
|
|
22546
22664
|
}) => {
|
|
22547
|
-
const
|
|
22665
|
+
const {
|
|
22666
|
+
connectTable
|
|
22667
|
+
} = internalData;
|
|
22668
|
+
const $table = connectTable;
|
|
22548
22669
|
if ($table) {
|
|
22549
22670
|
$table.customOpenEvent($event);
|
|
22550
22671
|
} else {
|
|
@@ -22554,7 +22675,10 @@ const {
|
|
|
22554
22675
|
const handleMouseleaveSettingEvent = ({
|
|
22555
22676
|
$event
|
|
22556
22677
|
}) => {
|
|
22557
|
-
const
|
|
22678
|
+
const {
|
|
22679
|
+
connectTable
|
|
22680
|
+
} = internalData;
|
|
22681
|
+
const $table = connectTable;
|
|
22558
22682
|
if ($table) {
|
|
22559
22683
|
const {
|
|
22560
22684
|
customStore
|
|
@@ -22603,7 +22727,10 @@ const {
|
|
|
22603
22727
|
}
|
|
22604
22728
|
};
|
|
22605
22729
|
const btnEvent = (evnt, item) => {
|
|
22606
|
-
const
|
|
22730
|
+
const {
|
|
22731
|
+
connectTable
|
|
22732
|
+
} = internalData;
|
|
22733
|
+
const $table = connectTable;
|
|
22607
22734
|
const {
|
|
22608
22735
|
code
|
|
22609
22736
|
} = item;
|
|
@@ -22634,7 +22761,10 @@ const {
|
|
|
22634
22761
|
}
|
|
22635
22762
|
};
|
|
22636
22763
|
const tolEvent = (evnt, item) => {
|
|
22637
|
-
const
|
|
22764
|
+
const {
|
|
22765
|
+
connectTable
|
|
22766
|
+
} = internalData;
|
|
22767
|
+
const $table = connectTable;
|
|
22638
22768
|
const {
|
|
22639
22769
|
code
|
|
22640
22770
|
} = item;
|
|
@@ -22666,7 +22796,10 @@ const {
|
|
|
22666
22796
|
};
|
|
22667
22797
|
const importEvent = () => {
|
|
22668
22798
|
if (checkTable()) {
|
|
22669
|
-
const
|
|
22799
|
+
const {
|
|
22800
|
+
connectTable
|
|
22801
|
+
} = internalData;
|
|
22802
|
+
const $table = connectTable;
|
|
22670
22803
|
if ($table) {
|
|
22671
22804
|
$table.openImport();
|
|
22672
22805
|
}
|
|
@@ -22674,7 +22807,10 @@ const {
|
|
|
22674
22807
|
};
|
|
22675
22808
|
const exportEvent = () => {
|
|
22676
22809
|
if (checkTable()) {
|
|
22677
|
-
const
|
|
22810
|
+
const {
|
|
22811
|
+
connectTable
|
|
22812
|
+
} = internalData;
|
|
22813
|
+
const $table = connectTable;
|
|
22678
22814
|
if ($table) {
|
|
22679
22815
|
$table.openExport();
|
|
22680
22816
|
}
|
|
@@ -22682,12 +22818,29 @@ const {
|
|
|
22682
22818
|
};
|
|
22683
22819
|
const printEvent = () => {
|
|
22684
22820
|
if (checkTable()) {
|
|
22685
|
-
const
|
|
22821
|
+
const {
|
|
22822
|
+
connectTable
|
|
22823
|
+
} = internalData;
|
|
22824
|
+
const $table = connectTable;
|
|
22686
22825
|
if ($table) {
|
|
22687
22826
|
$table.openPrint();
|
|
22688
22827
|
}
|
|
22689
22828
|
}
|
|
22690
22829
|
};
|
|
22830
|
+
const dispatchEvent = (type, params, evnt) => {
|
|
22831
|
+
emit(type, toolbar_createEvent(evnt, {
|
|
22832
|
+
$toolbar: $xeToolbar
|
|
22833
|
+
}, params));
|
|
22834
|
+
};
|
|
22835
|
+
toolbarMethods = {
|
|
22836
|
+
dispatchEvent,
|
|
22837
|
+
syncUpdate(params) {
|
|
22838
|
+
internalData.connectTable = params.$table;
|
|
22839
|
+
reactData.columns = params.collectColumn;
|
|
22840
|
+
reactData.connectFlag++;
|
|
22841
|
+
}
|
|
22842
|
+
};
|
|
22843
|
+
Object.assign($xeToolbar, toolbarMethods);
|
|
22691
22844
|
const renderDropdowns = (item, isBtn) => {
|
|
22692
22845
|
const {
|
|
22693
22846
|
dropdowns
|
|
@@ -22724,14 +22877,10 @@ const {
|
|
|
22724
22877
|
const {
|
|
22725
22878
|
buttons
|
|
22726
22879
|
} = props;
|
|
22727
|
-
const
|
|
22728
|
-
|
|
22729
|
-
|
|
22730
|
-
|
|
22731
|
-
$grid: $xeGrid,
|
|
22732
|
-
$table: $table
|
|
22733
|
-
}));
|
|
22734
|
-
}
|
|
22880
|
+
const {
|
|
22881
|
+
connectTable
|
|
22882
|
+
} = internalData;
|
|
22883
|
+
const $table = connectTable;
|
|
22735
22884
|
const btnVNs = [];
|
|
22736
22885
|
if (buttons) {
|
|
22737
22886
|
buttons.forEach(item => {
|
|
@@ -22787,14 +22936,10 @@ const {
|
|
|
22787
22936
|
const {
|
|
22788
22937
|
tools
|
|
22789
22938
|
} = props;
|
|
22790
|
-
const
|
|
22791
|
-
|
|
22792
|
-
|
|
22793
|
-
|
|
22794
|
-
$grid: $xeGrid,
|
|
22795
|
-
$table: $table
|
|
22796
|
-
}));
|
|
22797
|
-
}
|
|
22939
|
+
const {
|
|
22940
|
+
connectTable
|
|
22941
|
+
} = internalData;
|
|
22942
|
+
const $table = connectTable;
|
|
22798
22943
|
const btnVNs = [];
|
|
22799
22944
|
if (tools) {
|
|
22800
22945
|
tools.forEach((item, tIndex) => {
|
|
@@ -22918,47 +23063,6 @@ const {
|
|
|
22918
23063
|
...customBtnOns
|
|
22919
23064
|
}) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)();
|
|
22920
23065
|
};
|
|
22921
|
-
toolbarMethods = {
|
|
22922
|
-
dispatchEvent(type, params, evnt) {
|
|
22923
|
-
emit(type, toolbar_createEvent(evnt, {
|
|
22924
|
-
$toolbar: $xeToolbar
|
|
22925
|
-
}, params));
|
|
22926
|
-
},
|
|
22927
|
-
syncUpdate(params) {
|
|
22928
|
-
const {
|
|
22929
|
-
collectColumn
|
|
22930
|
-
} = params;
|
|
22931
|
-
refTable.value = params.$table;
|
|
22932
|
-
reactData.columns = collectColumn;
|
|
22933
|
-
connectFlag.value++;
|
|
22934
|
-
}
|
|
22935
|
-
};
|
|
22936
|
-
Object.assign($xeToolbar, toolbarMethods);
|
|
22937
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
22938
|
-
const {
|
|
22939
|
-
refresh
|
|
22940
|
-
} = props;
|
|
22941
|
-
const refreshOpts = computeRefreshOpts.value;
|
|
22942
|
-
const queryMethod = refreshOpts.queryMethod || refreshOpts.query;
|
|
22943
|
-
if (refresh && !$xeGrid && !queryMethod) {
|
|
22944
|
-
warnLog('vxe.error.notFunc', ['queryMethod']);
|
|
22945
|
-
}
|
|
22946
|
-
const customOpts = computeCustomOpts.value;
|
|
22947
|
-
if (true) {
|
|
22948
|
-
if (customOpts.isFooter) {
|
|
22949
|
-
warnLog('vxe.error.delProp', ['toolbar.custom.isFooter', 'table.custom-config.showFooter']);
|
|
22950
|
-
}
|
|
22951
|
-
if (customOpts.showFooter) {
|
|
22952
|
-
warnLog('vxe.error.delProp', ['toolbar.custom.showFooter', 'table.custom-config.showFooter']);
|
|
22953
|
-
}
|
|
22954
|
-
if (customOpts.immediate) {
|
|
22955
|
-
warnLog('vxe.error.delProp', ['toolbar.custom.immediate', 'table.custom-config.immediate']);
|
|
22956
|
-
}
|
|
22957
|
-
if (customOpts.trigger) {
|
|
22958
|
-
warnLog('vxe.error.delProp', ['toolbar.custom.trigger', 'table.custom-config.trigger']);
|
|
22959
|
-
}
|
|
22960
|
-
}
|
|
22961
|
-
});
|
|
22962
23066
|
const renderVN = () => {
|
|
22963
23067
|
const {
|
|
22964
23068
|
perfect,
|
|
@@ -22968,7 +23072,13 @@ const {
|
|
|
22968
23072
|
custom,
|
|
22969
23073
|
className
|
|
22970
23074
|
} = props;
|
|
23075
|
+
const {
|
|
23076
|
+
connectTable
|
|
23077
|
+
} = internalData;
|
|
22971
23078
|
const vSize = computeSize.value;
|
|
23079
|
+
const toolsSlot = slots.tools;
|
|
23080
|
+
const buttonsSlot = slots.buttons;
|
|
23081
|
+
const $table = connectTable;
|
|
22972
23082
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
22973
23083
|
ref: refElem,
|
|
22974
23084
|
class: ['vxe-toolbar', className ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(className) ? className({
|
|
@@ -22980,22 +23090,51 @@ const {
|
|
|
22980
23090
|
}]
|
|
22981
23091
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
22982
23092
|
class: 'vxe-buttons--wrapper'
|
|
22983
|
-
},
|
|
23093
|
+
}, buttonsSlot ? buttonsSlot({
|
|
23094
|
+
$grid: $xeGrid,
|
|
23095
|
+
$table: $table
|
|
23096
|
+
}) : renderBtns()), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
22984
23097
|
class: 'vxe-tools--wrapper'
|
|
22985
|
-
},
|
|
23098
|
+
}, toolsSlot ? toolsSlot({
|
|
23099
|
+
$grid: $xeGrid,
|
|
23100
|
+
$table: $table
|
|
23101
|
+
}) : renderRightTools()), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
22986
23102
|
class: 'vxe-tools--operate'
|
|
22987
23103
|
}, [props.import ? renderToolImport() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), props.export ? renderToolExport() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), props.print ? renderToolPrint() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), refresh ? renderToolRefresh() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), zoom && $xeGrid ? renderToolZoom() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), custom ? renderToolCustom() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()])]);
|
|
22988
23104
|
};
|
|
22989
23105
|
$xeToolbar.renderVN = renderVN;
|
|
22990
|
-
|
|
22991
|
-
|
|
23106
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
23107
|
+
const {
|
|
23108
|
+
refresh
|
|
23109
|
+
} = props;
|
|
23110
|
+
const refreshOpts = computeRefreshOpts.value;
|
|
23111
|
+
const queryMethod = refreshOpts.queryMethod || refreshOpts.query;
|
|
23112
|
+
if (refresh && !$xeGrid && !queryMethod) {
|
|
23113
|
+
warnLog('vxe.error.notFunc', ['queryMethod']);
|
|
23114
|
+
}
|
|
23115
|
+
const customOpts = computeCustomOpts.value;
|
|
23116
|
+
if (true) {
|
|
23117
|
+
if (customOpts.isFooter) {
|
|
23118
|
+
warnLog('vxe.error.delProp', ['toolbar.custom.isFooter', 'table.custom-config.showFooter']);
|
|
23119
|
+
}
|
|
23120
|
+
if (customOpts.showFooter) {
|
|
23121
|
+
warnLog('vxe.error.delProp', ['toolbar.custom.showFooter', 'table.custom-config.showFooter']);
|
|
23122
|
+
}
|
|
23123
|
+
if (customOpts.immediate) {
|
|
23124
|
+
warnLog('vxe.error.delProp', ['toolbar.custom.immediate', 'table.custom-config.immediate']);
|
|
23125
|
+
}
|
|
23126
|
+
if (customOpts.trigger) {
|
|
23127
|
+
warnLog('vxe.error.delProp', ['toolbar.custom.trigger', 'table.custom-config.trigger']);
|
|
23128
|
+
}
|
|
23129
|
+
}
|
|
23130
|
+
if (true) {
|
|
22992
23131
|
if (props.refresh || props.import || props.export || props.print || props.zoom) {
|
|
22993
23132
|
if (!VxeUIButtonComponent) {
|
|
22994
23133
|
errLog('vxe.error.reqComp', ['vxe-button']);
|
|
22995
23134
|
}
|
|
22996
23135
|
}
|
|
22997
|
-
}
|
|
22998
|
-
}
|
|
23136
|
+
}
|
|
23137
|
+
});
|
|
22999
23138
|
return $xeToolbar;
|
|
23000
23139
|
},
|
|
23001
23140
|
render() {
|
|
@@ -23153,28 +23292,6 @@ const gridComponentEmits = [...emits, 'page-change', 'form-submit', 'form-submit
|
|
|
23153
23292
|
});
|
|
23154
23293
|
return rest;
|
|
23155
23294
|
});
|
|
23156
|
-
const refMaps = {
|
|
23157
|
-
refElem,
|
|
23158
|
-
refTable,
|
|
23159
|
-
refForm,
|
|
23160
|
-
refToolbar,
|
|
23161
|
-
refPager
|
|
23162
|
-
};
|
|
23163
|
-
const computeMaps = {
|
|
23164
|
-
computeProxyOpts,
|
|
23165
|
-
computePagerOpts,
|
|
23166
|
-
computeFormOpts,
|
|
23167
|
-
computeToolbarOpts,
|
|
23168
|
-
computeZoomOpts
|
|
23169
|
-
};
|
|
23170
|
-
const $xeGrid = {
|
|
23171
|
-
xID,
|
|
23172
|
-
props: props,
|
|
23173
|
-
context,
|
|
23174
|
-
reactData,
|
|
23175
|
-
getRefMaps: () => refMaps,
|
|
23176
|
-
getComputeMaps: () => computeMaps
|
|
23177
|
-
};
|
|
23178
23295
|
const computeTableProps = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
23179
23296
|
const {
|
|
23180
23297
|
seqConfig,
|
|
@@ -23214,6 +23331,37 @@ const gridComponentEmits = [...emits, 'page-change', 'form-submit', 'form-submit
|
|
|
23214
23331
|
}
|
|
23215
23332
|
return tableProps;
|
|
23216
23333
|
});
|
|
23334
|
+
const computeCurrLayout = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
23335
|
+
const {
|
|
23336
|
+
layouts
|
|
23337
|
+
} = props;
|
|
23338
|
+
if (layouts && layouts.length) {
|
|
23339
|
+
return layouts;
|
|
23340
|
+
}
|
|
23341
|
+
return grid_getConfig().grid.layouts || ['Form', 'Toolbar', 'Top', 'Table', 'Bottom', 'Pager'];
|
|
23342
|
+
});
|
|
23343
|
+
const refMaps = {
|
|
23344
|
+
refElem,
|
|
23345
|
+
refTable,
|
|
23346
|
+
refForm,
|
|
23347
|
+
refToolbar,
|
|
23348
|
+
refPager
|
|
23349
|
+
};
|
|
23350
|
+
const computeMaps = {
|
|
23351
|
+
computeProxyOpts,
|
|
23352
|
+
computePagerOpts,
|
|
23353
|
+
computeFormOpts,
|
|
23354
|
+
computeToolbarOpts,
|
|
23355
|
+
computeZoomOpts
|
|
23356
|
+
};
|
|
23357
|
+
const $xeGrid = {
|
|
23358
|
+
xID,
|
|
23359
|
+
props: props,
|
|
23360
|
+
context,
|
|
23361
|
+
reactData,
|
|
23362
|
+
getRefMaps: () => refMaps,
|
|
23363
|
+
getComputeMaps: () => computeMaps
|
|
23364
|
+
};
|
|
23217
23365
|
const initToolbar = () => {
|
|
23218
23366
|
const toolbarOpts = computeToolbarOpts.value;
|
|
23219
23367
|
if (props.toolbarConfig && isEnableConf(toolbarOpts)) {
|
|
@@ -23708,13 +23856,9 @@ const gridComponentEmits = [...emits, 'page-change', 'form-submit', 'form-submit
|
|
|
23708
23856
|
}
|
|
23709
23857
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)();
|
|
23710
23858
|
};
|
|
23711
|
-
const defaultLayouts = ['Form', 'Toolbar', 'Top', 'Table', 'Bottom', 'Pager'];
|
|
23712
23859
|
const renderLayout = () => {
|
|
23713
|
-
const {
|
|
23714
|
-
layouts
|
|
23715
|
-
} = props;
|
|
23716
23860
|
const vns = [];
|
|
23717
|
-
const currLayouts =
|
|
23861
|
+
const currLayouts = computeCurrLayout.value;
|
|
23718
23862
|
currLayouts.forEach(name => {
|
|
23719
23863
|
switch (name) {
|
|
23720
23864
|
case 'Form':
|
|
@@ -23802,12 +23946,20 @@ const gridComponentEmits = [...emits, 'page-change', 'form-submit', 'form-submit
|
|
|
23802
23946
|
}
|
|
23803
23947
|
}
|
|
23804
23948
|
};
|
|
23949
|
+
const handleGlobalKeydownEvent = evnt => {
|
|
23950
|
+
const zoomOpts = computeZoomOpts.value;
|
|
23951
|
+
const isEsc = grid_globalEvents.hasKey(evnt, grid_GLOBAL_EVENT_KEYS.ESCAPE);
|
|
23952
|
+
if (isEsc && reactData.isZMax && zoomOpts.escRestore !== false) {
|
|
23953
|
+
gridPrivateMethods.triggerZoomEvent(evnt);
|
|
23954
|
+
}
|
|
23955
|
+
};
|
|
23956
|
+
const dispatchEvent = (type, params, evnt) => {
|
|
23957
|
+
emit(type, grid_createEvent(evnt, {
|
|
23958
|
+
$grid: $xeGrid
|
|
23959
|
+
}, params));
|
|
23960
|
+
};
|
|
23805
23961
|
const gridMethods = {
|
|
23806
|
-
dispatchEvent
|
|
23807
|
-
emit(type, grid_createEvent(evnt, {
|
|
23808
|
-
$grid: $xeGrid
|
|
23809
|
-
}, params));
|
|
23810
|
-
},
|
|
23962
|
+
dispatchEvent,
|
|
23811
23963
|
/**
|
|
23812
23964
|
* 提交指令,支持 code 或 button
|
|
23813
23965
|
* @param {String/Object} code 字符串或对象
|
|
@@ -24420,13 +24572,6 @@ const gridComponentEmits = [...emits, 'page-change', 'form-submit', 'form-submit
|
|
|
24420
24572
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.proxyConfig, () => {
|
|
24421
24573
|
initProxy();
|
|
24422
24574
|
});
|
|
24423
|
-
const handleGlobalKeydownEvent = evnt => {
|
|
24424
|
-
const zoomOpts = computeZoomOpts.value;
|
|
24425
|
-
const isEsc = grid_globalEvents.hasKey(evnt, grid_GLOBAL_EVENT_KEYS.ESCAPE);
|
|
24426
|
-
if (isEsc && reactData.isZMax && zoomOpts.escRestore !== false) {
|
|
24427
|
-
gridPrivateMethods.triggerZoomEvent(evnt);
|
|
24428
|
-
}
|
|
24429
|
-
};
|
|
24430
24575
|
grid_hooks.forEach(options => {
|
|
24431
24576
|
const {
|
|
24432
24577
|
setupGrid
|