@opentinyvue/vue-grid 3.27.0 → 3.29.0
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/index.js +625 -414
- package/package.json +17 -17
- package/src/composable/index.d.ts +1 -0
- package/src/composable/useNormalData.d.ts +8 -0
- package/src/config.d.ts +381 -20
- package/src/table/src/methods.d.ts +15 -1
- package/src/table/src/table.d.ts +20 -9
package/lib/index.js
CHANGED
|
@@ -4,8 +4,8 @@ import { Interceptor, StoreMap } from '@opentinyvue/vue-renderless/grid/core';
|
|
|
4
4
|
import { debounce, PopupManager, PopperJS, extend, browserInfo, isObject, isEmptyObject, isServer, throttle, addClass, removeClass, getDataset, random, isNull, getActualTarget, fastdom, toDecimal, logger, tryToCurrency, tryToDecimal, tryToInt, toFileSize, truncate, toRate, isNumber as isNumber$1, toBoolValue, toDate, getDateWithNewTimezone, isDate, formatDateByPattern, toDateStr, on, Validator as Validator$1, getObj, getStyle, preventDefault, off, callInterceptor, hasClass } from '@opentinyvue/utils';
|
|
5
5
|
import { iconError, iconSortTriangleDescending, iconSortTriangleAscending, iconSortTriangle, iconUnfilter, iconEdit, iconConmentRefresh, iconMinscreen, iconFullscreen, iconSetting, iconChevronRight, iconChevronDown, iconGridNoData, iconRadio, iconRadioselected, iconSearch, iconCheckedSur, iconCheck, iconHalfselect, iconArrowBottom, IconEllipsis, iconClose, iconYes, iconExpand, iconPutAway, iconEllipsis, iconMarkOn } from '@opentinyvue/vue-icon';
|
|
6
6
|
import { $prefix, hooks, defineComponent, h, $install, isVue2, isVnode, $props, mergeClass, resolveTheme, useInstanceSlots, useRelation, emitter, resolveMode, useBreakpoint, setup as setup$1 } from '@opentinyvue/vue-common';
|
|
7
|
-
import { uniqueId, toNumber as toNumber$1, isBoolean, each, isObject as isObject$1, isFunction, isArray, findIndexOf, get, set, clone, clear, destructuring, mapTree, has, isUndefined, find as find$1,
|
|
8
|
-
import { getFuncText, getDomNode, getRowid, getEventTargetNode, isScale, emitEvent, hasChildrenList, getListeners, getOffsetPos, getFilters, getColumnConfig, formatText, getRowkey,
|
|
7
|
+
import { uniqueId, toNumber as toNumber$1, isBoolean, each, isObject as isObject$1, isFunction, isArray, findIndexOf, get, set, clone, clear, destructuring, mapTree, eachTree, has, isUndefined, isEqual, find as find$1, filterTree, arrayEach, isNumber, findTree as findTree$1, sum, template, assign, objectMap, sortBy, isString, remove, toStringJSON, toArray, arrayIndexOf } from '@opentinyvue/vue-renderless/grid/static/';
|
|
8
|
+
import { getFuncText, getDomNode, getRowid, getEventTargetNode, isScale, emitEvent, hasChildrenList, getListeners, getOffsetPos, getFilters, getColumnConfig, formatText, getRowkey, getRowUniqueId, setCellValue, getColumnList, repairFixed, rowToVisible, colToVisible, getCell, assemColumn, GlobalEvent, getCellValue, updateCellTitle, isPx, getClass, getRowNodes, getCellNodeIndex } from '@opentinyvue/vue-renderless/grid/utils';
|
|
9
9
|
import Tooltip$1 from '@opentinyvue/vue-tooltip';
|
|
10
10
|
import { createVNode, mergeProps, isVNode, createTextVNode, resolveComponent, openBlock, createElementBlock, normalizeClass, createBlock, createCommentVNode, normalizeStyle, Fragment, renderList } from 'vue';
|
|
11
11
|
import { toNumber, findTree, find, isEqual as isEqual$1, arrayEach as arrayEach$1 } from '@opentinyvue/vue-renderless/grid/static';
|
|
@@ -257,6 +257,8 @@ var GlobalConfig$1 = {
|
|
|
257
257
|
defaultTreeSpacing: 30,
|
|
258
258
|
rowId: "_RID",
|
|
259
259
|
// 行数据的唯一主键字段名
|
|
260
|
+
$rowIndex: Symbol("$rowIndex"),
|
|
261
|
+
// 虚拟滚动处理后的行索引
|
|
260
262
|
version: 0,
|
|
261
263
|
// 版本号,对于某些带数据缓存的功能有用到,上升版本号可以用于重置数据
|
|
262
264
|
optimization: {
|
|
@@ -1795,7 +1797,7 @@ var useData = function useData2(props) {
|
|
|
1795
1797
|
}], function(_ref15) {
|
|
1796
1798
|
_ref15[0]; var length = _ref15[1];
|
|
1797
1799
|
tiledLength.value = length;
|
|
1798
|
-
$table
|
|
1800
|
+
$table.updateRawData(props.data);
|
|
1799
1801
|
});
|
|
1800
1802
|
return {
|
|
1801
1803
|
tiledLength
|
|
@@ -1818,7 +1820,7 @@ var calcHeader = function calcHeader2(collectColumn2) {
|
|
|
1818
1820
|
levelMap.set(item, level);
|
|
1819
1821
|
_traverseTree(item.children, level + 1, item);
|
|
1820
1822
|
});
|
|
1821
|
-
} else {
|
|
1823
|
+
} else if (parent) {
|
|
1822
1824
|
leafColumns.push(parent);
|
|
1823
1825
|
}
|
|
1824
1826
|
};
|
|
@@ -1904,12 +1906,12 @@ var useHeader = function useHeader2(props, bodyVm, headerRowHeight) {
|
|
|
1904
1906
|
};
|
|
1905
1907
|
};
|
|
1906
1908
|
var getEventSource = function getEventSource2(e, $table) {
|
|
1907
|
-
var _tableEl$dataset, _$table$getColumnNode, _rowEl$dataset,
|
|
1909
|
+
var _tableEl$dataset, _$table$getColumnNode, _rowEl$dataset, _rowid;
|
|
1908
1910
|
var target = e.target;
|
|
1909
1911
|
var tableEl = target.closest(".tiny-grid__body");
|
|
1910
1912
|
if (((_tableEl$dataset = tableEl.dataset) == null ? void 0 : _tableEl$dataset.tableid) !== String($table.id)) return;
|
|
1911
1913
|
var cellEl = target.closest(".tiny-grid-header__column");
|
|
1912
|
-
var rowEl, part, rowType, row2, column;
|
|
1914
|
+
var rowEl, part, rowType, row2, column, rowid2;
|
|
1913
1915
|
if (cellEl) {
|
|
1914
1916
|
rowEl = cellEl.parentNode;
|
|
1915
1917
|
part = "header";
|
|
@@ -1922,12 +1924,17 @@ var getEventSource = function getEventSource2(e, $table) {
|
|
|
1922
1924
|
}
|
|
1923
1925
|
if (!part || !cellEl || !rowEl) return;
|
|
1924
1926
|
column = (_$table$getColumnNode = $table.getColumnNode(cellEl)) == null ? void 0 : _$table$getColumnNode.item;
|
|
1925
|
-
|
|
1927
|
+
rowid2 = (_rowEl$dataset = rowEl.dataset) == null ? void 0 : _rowEl$dataset.rowid;
|
|
1928
|
+
if ((_rowid = rowid2) != null && _rowid.startsWith("row_g_")) {
|
|
1926
1929
|
rowType = "virtual";
|
|
1927
1930
|
} else if (part === "body") {
|
|
1928
|
-
var _$table$getRowNode;
|
|
1929
1931
|
rowType = "normal";
|
|
1930
|
-
|
|
1932
|
+
if ($table.editStore.insertMap.has(rowid2)) {
|
|
1933
|
+
row2 = $table.editStore.insertMap.get(rowid2);
|
|
1934
|
+
} else {
|
|
1935
|
+
var _$table$getRowNode;
|
|
1936
|
+
row2 = (_$table$getRowNode = $table.getRowNode(rowEl)) == null ? void 0 : _$table$getRowNode.item;
|
|
1937
|
+
}
|
|
1931
1938
|
}
|
|
1932
1939
|
return {
|
|
1933
1940
|
part,
|
|
@@ -2270,9 +2277,9 @@ var useCellSpan = function useCellSpan2(bodyVm, bodyProps) {
|
|
|
2270
2277
|
var leftList = columnStore.leftList, rightList = columnStore.rightList;
|
|
2271
2278
|
var normalState = {};
|
|
2272
2279
|
var normalTable = [];
|
|
2273
|
-
for (var
|
|
2274
|
-
var row2 = tableData[
|
|
2275
|
-
var rowLevel = tableNode[
|
|
2280
|
+
for (var _index4 = 0; _index4 < tableData.length; _index4++) {
|
|
2281
|
+
var row2 = tableData[_index4];
|
|
2282
|
+
var rowLevel = tableNode[_index4].level;
|
|
2276
2283
|
var rowIndex = $table.getRowIndex(row2);
|
|
2277
2284
|
var virtualRow = false;
|
|
2278
2285
|
if (hasVirtualRow) {
|
|
@@ -2282,7 +2289,7 @@ var useCellSpan = function useCellSpan2(bodyVm, bodyProps) {
|
|
|
2282
2289
|
if (!isSkipRowRender) {
|
|
2283
2290
|
seqCount.value = seqCount.value + 1;
|
|
2284
2291
|
}
|
|
2285
|
-
var seq = isOrdered ? seqCount.value :
|
|
2292
|
+
var seq = isOrdered ? seqCount.value : _index4 + 1;
|
|
2286
2293
|
if (scrollYLoad) {
|
|
2287
2294
|
seq += startIndex;
|
|
2288
2295
|
}
|
|
@@ -2297,7 +2304,7 @@ var useCellSpan = function useCellSpan2(bodyVm, bodyProps) {
|
|
|
2297
2304
|
$table,
|
|
2298
2305
|
data: tableData,
|
|
2299
2306
|
row: row2,
|
|
2300
|
-
$rowIndex,
|
|
2307
|
+
$rowIndex: row2[GlobalConfig$1.$rowIndex],
|
|
2301
2308
|
rowIndex,
|
|
2302
2309
|
level: rowLevel,
|
|
2303
2310
|
$seq: "",
|
|
@@ -2506,6 +2513,69 @@ var adjustColspan = function adjustColspan2(table, pos, isLeft) {
|
|
|
2506
2513
|
}
|
|
2507
2514
|
}
|
|
2508
2515
|
};
|
|
2516
|
+
var useNormalData = function useNormalData2(_ref34) {
|
|
2517
|
+
var _hooks$getCurrentInst4;
|
|
2518
|
+
var props = _ref34.props, tableFullColumn = _ref34.tableFullColumn;
|
|
2519
|
+
var $table = (_hooks$getCurrentInst4 = hooks.getCurrentInstance()) == null ? void 0 : _hooks$getCurrentInst4.proxy;
|
|
2520
|
+
var rawData = hooks.ref([]);
|
|
2521
|
+
var rawDataVersion = hooks.ref(0);
|
|
2522
|
+
var editorColumns = hooks.ref([]);
|
|
2523
|
+
var editorColumnKey = hooks.ref("");
|
|
2524
|
+
hooks.watch(tableFullColumn, function(_tableFullColumn) {
|
|
2525
|
+
var columns2 = [];
|
|
2526
|
+
var columnKeys = [];
|
|
2527
|
+
for (var i = 0; i < _tableFullColumn.length; i++) {
|
|
2528
|
+
var column = _tableFullColumn[i];
|
|
2529
|
+
if (column.property && column.editor) {
|
|
2530
|
+
columns2.push(column);
|
|
2531
|
+
columnKeys.push(column.propety);
|
|
2532
|
+
}
|
|
2533
|
+
}
|
|
2534
|
+
var keyString = columnKeys.sort().join();
|
|
2535
|
+
if (editorColumnKey.value !== keyString) {
|
|
2536
|
+
editorColumnKey.value = keyString;
|
|
2537
|
+
editorColumns.value = columns2;
|
|
2538
|
+
}
|
|
2539
|
+
});
|
|
2540
|
+
hooks.watch(editorColumns, function(_editorColumns) {
|
|
2541
|
+
if (props.editConfig && _editorColumns.length > 0) {
|
|
2542
|
+
var _insertData = $table.editStore.insertList || [];
|
|
2543
|
+
var _rawData = rawData.value || [];
|
|
2544
|
+
var _data = [].concat(_insertData, _rawData);
|
|
2545
|
+
if (Array.isArray(_data)) {
|
|
2546
|
+
_data.forEach(function(row2) {
|
|
2547
|
+
return $table.defineField(row2, false, _editorColumns, true);
|
|
2548
|
+
});
|
|
2549
|
+
}
|
|
2550
|
+
}
|
|
2551
|
+
});
|
|
2552
|
+
hooks.watch(rawData, function(_rawData) {
|
|
2553
|
+
var _editorColumns = editorColumns.value;
|
|
2554
|
+
if (props.editConfig && _editorColumns.length > 0) {
|
|
2555
|
+
var _data = _rawData || [];
|
|
2556
|
+
if (Array.isArray(_data)) {
|
|
2557
|
+
_data.forEach(function(row2) {
|
|
2558
|
+
return $table.defineField(row2, false, _editorColumns);
|
|
2559
|
+
});
|
|
2560
|
+
}
|
|
2561
|
+
}
|
|
2562
|
+
rawDataVersion.value += 1;
|
|
2563
|
+
});
|
|
2564
|
+
hooks.watch(rawDataVersion, function() {
|
|
2565
|
+
var optimizeOpts = $table.optimizeOpts;
|
|
2566
|
+
var scrollY = optimizeOpts.scrollY;
|
|
2567
|
+
var _rawData = rawData.value || [];
|
|
2568
|
+
var tableFullData = Array.isArray(_rawData) ? _rawData.slice(0) : [];
|
|
2569
|
+
$table.tableFullData = tableFullData;
|
|
2570
|
+
$table.scrollYLoad = scrollY && scrollY.gt > 0 && scrollY.gt <= tableFullData.length;
|
|
2571
|
+
$table.updateCache(true, props.saveSource === "deep");
|
|
2572
|
+
$table.handleDataChange();
|
|
2573
|
+
});
|
|
2574
|
+
return {
|
|
2575
|
+
rawData,
|
|
2576
|
+
rawDataVersion
|
|
2577
|
+
};
|
|
2578
|
+
};
|
|
2509
2579
|
var toRaw = hooks.toRaw;
|
|
2510
2580
|
var VIRTUAL_ROW_KEY = "_$virtual_";
|
|
2511
2581
|
var difference$1 = function difference$12(arr, other) {
|
|
@@ -2605,7 +2675,7 @@ var orderingGroupBy = function orderingGroupBy2(arr, key, equals, active, rowKey
|
|
|
2605
2675
|
};
|
|
2606
2676
|
var buildRowGroupFullData = function buildRowGroupFullData2(fullData, _vm) {
|
|
2607
2677
|
var treeConfig = _vm.treeConfig, rowGroup = _vm.rowGroup;
|
|
2608
|
-
var
|
|
2678
|
+
var _ref35 = rowGroup || {}, field = _ref35.field, equals = _ref35.equals, activeMethod = _ref35.activeMethod;
|
|
2609
2679
|
_vm.hasVirtualRow = !treeConfig && rowGroup && field && fullData.length > 0;
|
|
2610
2680
|
if (_vm.hasVirtualRow) {
|
|
2611
2681
|
_vm.groupFullData = orderingGroupBy(fullData, field, equals || isEqual$1, activeMethod, getRowkey(_vm));
|
|
@@ -2629,14 +2699,14 @@ var handleRowGroupFold = function handleRowGroupFold2(row2, _vm) {
|
|
|
2629
2699
|
buildRenderGraph(_vm);
|
|
2630
2700
|
_vm.handleTableData().then(_vm.recalculate);
|
|
2631
2701
|
};
|
|
2632
|
-
var getFixedStyle = function getFixedStyle2(
|
|
2633
|
-
var fixedDetails =
|
|
2634
|
-
var overflowX =
|
|
2702
|
+
var getFixedStyle = function getFixedStyle2(_ref36, _ref37) {
|
|
2703
|
+
var fixedDetails = _ref36.fixedDetails;
|
|
2704
|
+
var overflowX = _ref37.overflowX;
|
|
2635
2705
|
return fixedDetails && overflowX ? fixedDetails.getStyle() : {};
|
|
2636
2706
|
};
|
|
2637
|
-
var getFixedClass = function getFixedClass2(
|
|
2638
|
-
var fixedDetails =
|
|
2639
|
-
var overflowX =
|
|
2707
|
+
var getFixedClass = function getFixedClass2(_ref38, _ref39) {
|
|
2708
|
+
var fixedDetails = _ref38.fixedDetails;
|
|
2709
|
+
var overflowX = _ref39.overflowX;
|
|
2640
2710
|
return _extends({
|
|
2641
2711
|
"fixed__column": fixedDetails && overflowX
|
|
2642
2712
|
}, fixedDetails && overflowX ? fixedDetails.getClass() : {});
|
|
@@ -2678,9 +2748,11 @@ var updatePool = function updatePool2(array, context) {
|
|
|
2678
2748
|
var indices = /* @__PURE__ */ new WeakMap();
|
|
2679
2749
|
expires.forEach(function(item) {
|
|
2680
2750
|
var view = context.idViewMap.get(item.id);
|
|
2681
|
-
view
|
|
2682
|
-
|
|
2683
|
-
|
|
2751
|
+
if (view) {
|
|
2752
|
+
view.used = false;
|
|
2753
|
+
context.idViewMap.delete(item.id);
|
|
2754
|
+
context.unusedViews.push(view);
|
|
2755
|
+
}
|
|
2684
2756
|
});
|
|
2685
2757
|
array.forEach(function(item, i) {
|
|
2686
2758
|
indices.set(item, i);
|
|
@@ -2707,6 +2779,34 @@ var updatePool = function updatePool2(array, context) {
|
|
|
2707
2779
|
});
|
|
2708
2780
|
return context;
|
|
2709
2781
|
};
|
|
2782
|
+
function addTableDataRowIndex(rowPool) {
|
|
2783
|
+
var treeTableData = [];
|
|
2784
|
+
var $rowIndex = GlobalConfig$1.$rowIndex;
|
|
2785
|
+
var tempChildren = Symbol("tempChildren");
|
|
2786
|
+
rowPool.forEach(function(rowPoolItem) {
|
|
2787
|
+
var _rowPoolItem$item = rowPoolItem.item, row2 = _rowPoolItem$item.payload, level = _rowPoolItem$item.level, parentNode = _rowPoolItem$item.parentNode, used = rowPoolItem.used;
|
|
2788
|
+
if (!used) {
|
|
2789
|
+
return;
|
|
2790
|
+
}
|
|
2791
|
+
if (level === 0) {
|
|
2792
|
+
treeTableData.push(row2);
|
|
2793
|
+
row2[$rowIndex] = treeTableData.length - 1;
|
|
2794
|
+
return;
|
|
2795
|
+
}
|
|
2796
|
+
var parent = parentNode == null ? void 0 : parentNode.payload;
|
|
2797
|
+
if (!parent) {
|
|
2798
|
+
return;
|
|
2799
|
+
}
|
|
2800
|
+
if (!parent[tempChildren]) {
|
|
2801
|
+
parent[tempChildren] = [];
|
|
2802
|
+
}
|
|
2803
|
+
parent[tempChildren].push(row2);
|
|
2804
|
+
row2[$rowIndex] = parent[tempChildren].length - 1;
|
|
2805
|
+
});
|
|
2806
|
+
rowPool.forEach(function(rowPoolItem) {
|
|
2807
|
+
delete rowPoolItem.item.payload[tempChildren];
|
|
2808
|
+
});
|
|
2809
|
+
}
|
|
2710
2810
|
var usePool = function usePool2(props) {
|
|
2711
2811
|
var columnPool = hooks.ref([]);
|
|
2712
2812
|
var rowPool = hooks.ref([]);
|
|
@@ -2733,6 +2833,7 @@ var usePool = function usePool2(props) {
|
|
|
2733
2833
|
rowContext = createPool(props.tableNode);
|
|
2734
2834
|
}
|
|
2735
2835
|
rowPool.value = ((_rowContext = rowContext) == null ? void 0 : _rowContext.pool) || rowPool.value;
|
|
2836
|
+
addTableDataRowIndex(rowPool.value);
|
|
2736
2837
|
isNoData.value = !(((_props$tableNode = props.tableNode) == null ? void 0 : _props$tableNode.length) > 0);
|
|
2737
2838
|
});
|
|
2738
2839
|
return {
|
|
@@ -2763,21 +2864,21 @@ var renderBorder = function renderBorder2(type) {
|
|
|
2763
2864
|
"class": "tiny-grid-border-left"
|
|
2764
2865
|
}, null)]);
|
|
2765
2866
|
};
|
|
2766
|
-
function renderColumn(
|
|
2767
|
-
var _normalRows$rowid,
|
|
2768
|
-
var $columnIndex =
|
|
2867
|
+
function renderColumn(_ref40) {
|
|
2868
|
+
var _normalRows$rowid, _ref42;
|
|
2869
|
+
var $columnIndex = _ref40.$columnIndex, $table = _ref40.$table, _vm = _ref40._vm, column = _ref40.column, id3 = _ref40.id, row2 = _ref40.row, rowid2 = _ref40.rowid, seq = _ref40.seq, used = _ref40.used;
|
|
2769
2870
|
var allAlign = $table.align, cellClassName = $table.cellClassName, _$table$dropConfig = $table.dropConfig, dropConfig = _$table$dropConfig === void 0 ? {} : _$table$dropConfig, editConfig = $table.editConfig, editRules = $table.editRules, editStore = $table.editStore;
|
|
2770
2871
|
var height2 = $table.height, rowId = $table.rowId, scrollXLoad = $table.scrollXLoad, scrollYLoad = $table.scrollYLoad, validOpts2 = $table.validOpts, validStore = $table.validStore, validatedMap = $table.validatedMap;
|
|
2771
2872
|
var normalRows = _vm.normalRows;
|
|
2772
|
-
var
|
|
2873
|
+
var _ref41 = ((_normalRows$rowid = normalRows[rowid2]) == null ? void 0 : _normalRows$rowid[column.id]) || {}, _ref41$attrs = _ref41.attrs, attrs = _ref41$attrs === void 0 ? {
|
|
2773
2874
|
rowspan: 1,
|
|
2774
2875
|
colspan: 1,
|
|
2775
2876
|
visible: true
|
|
2776
|
-
} :
|
|
2877
|
+
} : _ref41$attrs, _ref41$params = _ref41.params, params = _ref41$params === void 0 ? {
|
|
2777
2878
|
$table,
|
|
2778
2879
|
row: row2,
|
|
2779
2880
|
column
|
|
2780
|
-
} :
|
|
2881
|
+
} : _ref41$params;
|
|
2781
2882
|
var isMessageDefault = validOpts2.isMessageDefault, isMessageInline = validOpts2.isMessageInline, highlightError = validOpts2.highlightError;
|
|
2782
2883
|
var actived = editStore.actived;
|
|
2783
2884
|
var validated = validatedMap[column.id + "-" + row2[rowId]];
|
|
@@ -2805,7 +2906,7 @@ function renderColumn(_ref39) {
|
|
|
2805
2906
|
"data-colindex": $columnIndex,
|
|
2806
2907
|
"rowspan": attrs.rowspan > 1 ? attrs.rowspan : void 0,
|
|
2807
2908
|
"colspan": attrs.colspan > 1 ? attrs.colspan : void 0,
|
|
2808
|
-
"class": ["tiny-grid-body__column", column.id, (
|
|
2909
|
+
"class": ["tiny-grid-body__column", column.id, (_ref42 = {}, _ref42["col__" + cellAlign] = cellAlign, _ref42["col__edit"] = editor, _ref42["col__index"] = column.type === "index", _ref42["col__radio"] = column.type === "radio", _ref42["col__selection"] = column.type === "selection", _ref42["col__ellipsis"] = cellOverflowHint, _ref42["edit__visible"] = editor && editor.type === "visible", _ref42["col__dirty"] = isDirty, _ref42["col__actived"] = columnActived, _ref42["col__highlight-error"] = highlightError && validated, _ref42["col__valid-error"] = validError && validated, _ref42["col__valid-success"] = columnActived ? !validError && !validated : isDirty && !validated, _ref42["col__treenode"] = column.treeNode, _ref42), getClass(className, params), getClass(cellClassName, params), getFixedClass(column, $table), attrs._stickyClass || ""]
|
|
2809
2910
|
}, [[
|
|
2810
2911
|
// 行拖拽手柄
|
|
2811
2912
|
dropConfig.rowHandle === "index" && column.type === "index" ? createVNode("div", {
|
|
@@ -2846,9 +2947,9 @@ function renderHeaderRows(_vm) {
|
|
|
2846
2947
|
$table,
|
|
2847
2948
|
$rowIndex
|
|
2848
2949
|
}) : headerRowClassName : ""]
|
|
2849
|
-
}, [cols.map(function(
|
|
2850
|
-
var _column$children,
|
|
2851
|
-
var id3 =
|
|
2950
|
+
}, [cols.map(function(_ref43, $columnIndex) {
|
|
2951
|
+
var _column$children, _ref44;
|
|
2952
|
+
var id3 = _ref43.id, column = _ref43.column, colspan = _ref43.colspan, rowspan = _ref43.rowspan, height2 = _ref43.height, top = _ref43.top;
|
|
2852
2953
|
var isColGroup = (_column$children = column.children) == null ? void 0 : _column$children.length;
|
|
2853
2954
|
var headerAlign = column.headerAlign, align = column.align, headerClassName = column.headerClassName;
|
|
2854
2955
|
var _getConfigOverflow3 = getConfigOverflow(column, $table), headerTip = _getConfigOverflow3.headerTip, headerOverflowTitle = _getConfigOverflow3.headerOverflowTitle, headerOverflowTooltip = _getConfigOverflow3.headerOverflowTooltip, headerOverflowEllipsis = _getConfigOverflow3.headerOverflowEllipsis, headerOverflowHint = _getConfigOverflow3.headerOverflowHint;
|
|
@@ -2877,7 +2978,7 @@ function renderHeaderRows(_vm) {
|
|
|
2877
2978
|
top: top + "px",
|
|
2878
2979
|
zIndex: column.fixed ? 20 : 10
|
|
2879
2980
|
}],
|
|
2880
|
-
"class": ["tiny-grid-header__column", column.id, (
|
|
2981
|
+
"class": ["tiny-grid-header__column", column.id, (_ref44 = {}, _ref44["col__" + headAlign] = headAlign, _ref44["col__fixed"] = column.fixed, _ref44["col__index"] = column.type === "index", _ref44["col__radio"] = column.type === "radio", _ref44["col__selection"] = column.type === "selection", _ref44["col__group"] = isColGroup, _ref44["col__ellipsis"] = headerOverflowHint, _ref44["is__sortable"] = !["index", "radio", "selection"].includes(column.type) && column.sortable, _ref44["is__editable"] = column.editor, _ref44["is__filter"] = isObject(column.filter), _ref44["filter__active"] = column.filter && column.filter.hasFilter, _ref44["is__multilevel"] = rowspan > 1, _ref44), getClass(headerClassName, params), getClass(headerCellClassName, params), getFixedClass(column, $table)]
|
|
2881
2982
|
}, [[
|
|
2882
2983
|
!isColGroup && !(isBoolean(column.resizable) ? column.resizable : resizable) && column.type !== "index" ? createVNode("div", {
|
|
2883
2984
|
"class": {
|
|
@@ -2927,20 +3028,20 @@ function renderFooterRows(_vm) {
|
|
|
2927
3028
|
$table,
|
|
2928
3029
|
$rowIndex
|
|
2929
3030
|
}) : footerRowClassName : ""]
|
|
2930
|
-
}, [columnPool.map(function(
|
|
2931
|
-
var _footerRows$$rowIndex,
|
|
2932
|
-
var id3 =
|
|
3031
|
+
}, [columnPool.map(function(_ref45, $columnIndex) {
|
|
3032
|
+
var _footerRows$$rowIndex, _ref47;
|
|
3033
|
+
var id3 = _ref45.id, column = _ref45.item, used = _ref45.used;
|
|
2933
3034
|
var footerAlign = column.footerAlign, align = column.align, footerClassName = column.footerClassName;
|
|
2934
3035
|
var ftAlign = footerAlign || align || allFooterAlign || allAlign;
|
|
2935
3036
|
var _getConfigOverflow4 = getConfigOverflow(column, $table), cellOverflowHint = _getConfigOverflow4.cellOverflowHint;
|
|
2936
|
-
var
|
|
3037
|
+
var _ref46 = ((_footerRows$$rowIndex = footerRows[$rowIndex]) == null ? void 0 : _footerRows$$rowIndex[column.id]) || {}, _ref46$attrs = _ref46.attrs, attrs = _ref46$attrs === void 0 ? {
|
|
2937
3038
|
rowspan: 1,
|
|
2938
3039
|
colspan: 1,
|
|
2939
3040
|
visible: true
|
|
2940
|
-
} :
|
|
3041
|
+
} : _ref46$attrs, _ref46$params = _ref46.params, params = _ref46$params === void 0 ? {
|
|
2941
3042
|
$table,
|
|
2942
3043
|
column
|
|
2943
|
-
} :
|
|
3044
|
+
} : _ref46$params;
|
|
2944
3045
|
var rowspan = (attrs == null ? void 0 : attrs.rowspan) || 1;
|
|
2945
3046
|
var tdBottom = trBottom - (rowspan > 1 ? (rowspan - 1) * rowHeight : 0);
|
|
2946
3047
|
params.$columnIndex = $columnIndex;
|
|
@@ -2955,7 +3056,7 @@ function renderFooterRows(_vm) {
|
|
|
2955
3056
|
zIndex: column.fixed ? 20 : 10,
|
|
2956
3057
|
display: used && attrs.visible ? void 0 : "none"
|
|
2957
3058
|
}],
|
|
2958
|
-
"class": ["tiny-grid-footer__column", column.id, (
|
|
3059
|
+
"class": ["tiny-grid-footer__column", column.id, (_ref47 = {}, _ref47["col__" + ftAlign] = ftAlign, _ref47["col__ellipsis"] = cellOverflowHint, _ref47["filter__active"] = column.filter && column.filter.hasFilter, _ref47), getClass(footerClassName, params), getClass(footerCellClassName, params), getFixedClass(column, $table), attrs._stickyClass || ""]
|
|
2959
3060
|
}, [createVNode("div", {
|
|
2960
3061
|
"class": {
|
|
2961
3062
|
"tiny-grid-cell": true,
|
|
@@ -2972,24 +3073,21 @@ function renderRows(_vm) {
|
|
|
2972
3073
|
var expandMethod = expandConfig.activeMethod;
|
|
2973
3074
|
var startIndex = scrollYStore.startIndex;
|
|
2974
3075
|
var isOrdered = treeConfig ? !!treeOrdered : false;
|
|
2975
|
-
var
|
|
3076
|
+
var _ref48 = treeConfig || {}, hideMethod = _ref48.hideMethod;
|
|
2976
3077
|
var actived = editStore.actived;
|
|
2977
3078
|
var rows = [];
|
|
2978
3079
|
var seqCount = {
|
|
2979
3080
|
value: 0
|
|
2980
3081
|
};
|
|
2981
3082
|
var $seq = "";
|
|
2982
|
-
|
|
2983
|
-
var used = _ref48.used;
|
|
2984
|
-
return Boolean(used);
|
|
2985
|
-
});
|
|
2986
|
-
rowPool.forEach(function(_ref49, $rowIndex) {
|
|
3083
|
+
rowPool.forEach(function(_ref49) {
|
|
2987
3084
|
var id3 = _ref49.id, _ref49$item = _ref49.item, row2 = _ref49$item.payload, rowLevel = _ref49$item.level, used = _ref49.used;
|
|
2988
3085
|
var rowActived = editConfig && actived.row === row2;
|
|
2989
3086
|
var virtualRow = isVirtualRow(row2);
|
|
2990
3087
|
var isSkipRowRender = hideMethod && hideMethod(row2, rowLevel) || virtualRow;
|
|
2991
3088
|
var rowid2 = getRowid($table, row2);
|
|
2992
3089
|
var rowIndex = $table.getRowIndex(row2);
|
|
3090
|
+
var $rowIndex = row2[GlobalConfig$1.$rowIndex];
|
|
2993
3091
|
if (!isSkipRowRender) {
|
|
2994
3092
|
seqCount.value = seqCount.value + 1;
|
|
2995
3093
|
}
|
|
@@ -3021,8 +3119,7 @@ function renderRows(_vm) {
|
|
|
3021
3119
|
isSkipRowRender,
|
|
3022
3120
|
row: row2,
|
|
3023
3121
|
rowActived,
|
|
3024
|
-
rowClassName
|
|
3025
|
-
lastVisibleIndex
|
|
3122
|
+
rowClassName
|
|
3026
3123
|
};
|
|
3027
3124
|
Object.assign(args, {
|
|
3028
3125
|
rowIndex,
|
|
@@ -3033,7 +3130,8 @@ function renderRows(_vm) {
|
|
|
3033
3130
|
seq,
|
|
3034
3131
|
treeConfig,
|
|
3035
3132
|
used,
|
|
3036
|
-
selectRow
|
|
3133
|
+
selectRow,
|
|
3134
|
+
scrollYLoad
|
|
3037
3135
|
});
|
|
3038
3136
|
renderRow(args);
|
|
3039
3137
|
renderRowAfter({
|
|
@@ -3117,9 +3215,8 @@ function renderRowAfter(_ref50) {
|
|
|
3117
3215
|
}, h);
|
|
3118
3216
|
}
|
|
3119
3217
|
function renderRow(args) {
|
|
3120
|
-
var _ref51;
|
|
3121
3218
|
var $rowIndex = args.$rowIndex, $seq = args.$seq, $table = args.$table, _vm = args._vm, editStore = args.editStore, id3 = args.id, isSkipRowRender = args.isSkipRowRender, row2 = args.row, rowActived = args.rowActived, rowClassName = args.rowClassName;
|
|
3122
|
-
var rowIndex = args.rowIndex, rowLevel = args.rowLevel, rowid2 = args.rowid, rows = args.rows, selection = args.selection, selectRow = args.selectRow, seq = args.seq, treeConfig = args.treeConfig, used = args.used,
|
|
3219
|
+
var rowIndex = args.rowIndex, rowLevel = args.rowLevel, rowid2 = args.rowid, rows = args.rows, selection = args.selection, selectRow = args.selectRow, seq = args.seq, treeConfig = args.treeConfig, used = args.used, scrollYLoad = args.scrollYLoad;
|
|
3123
3220
|
if (isSkipRowRender) {
|
|
3124
3221
|
return;
|
|
3125
3222
|
}
|
|
@@ -3133,38 +3230,41 @@ function renderRow(args) {
|
|
|
3133
3230
|
}
|
|
3134
3231
|
}
|
|
3135
3232
|
var columnPool = _vm.columnPool;
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
"
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3233
|
+
if (used || scrollYLoad) {
|
|
3234
|
+
var _ref51;
|
|
3235
|
+
rows.push(createVNode("tr", {
|
|
3236
|
+
"key": key,
|
|
3237
|
+
"data-rowid": rowid2,
|
|
3238
|
+
"data-rowindex": $rowIndex,
|
|
3239
|
+
"data-rowlevel": rowLevel,
|
|
3240
|
+
"style": {
|
|
3241
|
+
display: used ? void 0 : "none"
|
|
3242
|
+
},
|
|
3243
|
+
"class": ["tiny-grid-body__row", (_ref51 = {}, _ref51["row__level-" + rowLevel] = treeConfig, _ref51["row__new"] = editStore.insertList.includes(row2), _ref51["row__selected"] = selection.includes(row2), _ref51["row__radio"] = selectRow === row2, _ref51["row__actived"] = rowActived, _ref51), rowClassName ? isFunction(rowClassName) ? rowClassName({
|
|
3244
|
+
$table,
|
|
3245
|
+
$seq,
|
|
3246
|
+
seq,
|
|
3247
|
+
fixedType: void 0,
|
|
3248
|
+
rowLevel,
|
|
3249
|
+
row: row2,
|
|
3250
|
+
rowIndex,
|
|
3251
|
+
$rowIndex
|
|
3252
|
+
}) : rowClassName : ""]
|
|
3253
|
+
}, [columnPool.map(function(_ref52, $columnIndex) {
|
|
3254
|
+
var id4 = _ref52.id, column = _ref52.item, used2 = _ref52.used;
|
|
3255
|
+
return renderColumn({
|
|
3256
|
+
$columnIndex,
|
|
3257
|
+
$table,
|
|
3258
|
+
_vm,
|
|
3259
|
+
column,
|
|
3260
|
+
id: id4,
|
|
3261
|
+
row: row2,
|
|
3262
|
+
rowid: rowid2,
|
|
3263
|
+
seq,
|
|
3264
|
+
used: used2
|
|
3265
|
+
});
|
|
3266
|
+
})]));
|
|
3267
|
+
}
|
|
3168
3268
|
}
|
|
3169
3269
|
function renderRowGroupTds(_ref53) {
|
|
3170
3270
|
var $table = _ref53.$table, closeable = _ref53.closeable, render17 = _ref53.render, renderGroupCell = _ref53.renderGroupCell, row2 = _ref53.row, tds = _ref53.tds, title = _ref53.title, _vm = _ref53._vm;
|
|
@@ -3370,9 +3470,9 @@ var Body = /* @__PURE__ */ defineComponent({
|
|
|
3370
3470
|
footerData: Array
|
|
3371
3471
|
},
|
|
3372
3472
|
setup: function setup3(props, _ref57) {
|
|
3373
|
-
var _hooks$
|
|
3473
|
+
var _hooks$getCurrentInst5;
|
|
3374
3474
|
var slots = _ref57.slots;
|
|
3375
|
-
var vm = (_hooks$
|
|
3475
|
+
var vm = (_hooks$getCurrentInst5 = hooks.getCurrentInstance()) == null ? void 0 : _hooks$getCurrentInst5.proxy;
|
|
3376
3476
|
var $table = vm == null ? void 0 : vm.$parent;
|
|
3377
3477
|
var rowHeight = hooks.computed(function() {
|
|
3378
3478
|
return $table.rowHeight;
|
|
@@ -3524,8 +3624,6 @@ var Body = /* @__PURE__ */ defineComponent({
|
|
|
3524
3624
|
"no-data": isNoData && $table.isShapeTable
|
|
3525
3625
|
},
|
|
3526
3626
|
"style": {
|
|
3527
|
-
"--body-container-scroll-height": containerScrollHeight + "px",
|
|
3528
|
-
"--body-container-scroll-width": containerScrollWidth + "px",
|
|
3529
3627
|
height: bodyWrapperHeight ? bodyWrapperHeight + "px" : void 0,
|
|
3530
3628
|
minHeight: bodyWrapperMinHeight ? bodyWrapperMinHeight + "px" : void 0,
|
|
3531
3629
|
maxHeight: bodyWrapperMaxHeight ? bodyWrapperMaxHeight + "px" : void 0
|
|
@@ -4002,14 +4100,15 @@ var Panel$1 = /* @__PURE__ */ defineComponent({
|
|
|
4002
4100
|
}
|
|
4003
4101
|
if (this.visible) {
|
|
4004
4102
|
setTimeout(function() {
|
|
4103
|
+
var _this4$$grid;
|
|
4005
4104
|
var _this4$filterStore = _this4.filterStore, targetElemParentTr = _this4$filterStore.targetElemParentTr, id3 = _this4$filterStore.id;
|
|
4006
4105
|
var reference = targetElemParentTr && targetElemParentTr.querySelector("svg.tiny-grid-filter__btn." + id3);
|
|
4007
4106
|
var popper = _this4.$el;
|
|
4008
4107
|
popper.style.zIndex = PopupManager.nextZIndex();
|
|
4009
|
-
_this4.popperJS = new PopperJS(reference, popper, {
|
|
4108
|
+
_this4.popperJS = new PopperJS(reference, popper, _extends({
|
|
4010
4109
|
placement: "bottom-end",
|
|
4011
4110
|
gpuAcceleration: false
|
|
4012
|
-
});
|
|
4111
|
+
}, ((_this4$$grid = _this4.$grid) == null ? void 0 : _this4$$grid.filterPopperOptions) || {}));
|
|
4013
4112
|
popper.style.display = "block";
|
|
4014
4113
|
});
|
|
4015
4114
|
}
|
|
@@ -4123,7 +4222,7 @@ var Panel$1 = /* @__PURE__ */ defineComponent({
|
|
|
4123
4222
|
};
|
|
4124
4223
|
}
|
|
4125
4224
|
}, _isSlot(label) ? label : {
|
|
4126
|
-
default: function
|
|
4225
|
+
default: function _default29() {
|
|
4127
4226
|
return [label];
|
|
4128
4227
|
}
|
|
4129
4228
|
});
|
|
@@ -4135,19 +4234,19 @@ var Panel$1 = /* @__PURE__ */ defineComponent({
|
|
|
4135
4234
|
"type": "primary",
|
|
4136
4235
|
"onClick": this.filterInput
|
|
4137
4236
|
}, _isSlot(_slot = this.i18n("ui.base.confirm")) ? _slot : {
|
|
4138
|
-
default: function
|
|
4237
|
+
default: function _default29() {
|
|
4139
4238
|
return [_slot];
|
|
4140
4239
|
}
|
|
4141
4240
|
}), createVNode(Button, {
|
|
4142
4241
|
"onClick": this.resetInput
|
|
4143
4242
|
}, _isSlot(_slot2 = this.i18n("ui.base.reset")) ? _slot2 : {
|
|
4144
|
-
default: function
|
|
4243
|
+
default: function _default29() {
|
|
4145
4244
|
return [_slot2];
|
|
4146
4245
|
}
|
|
4147
4246
|
}), createVNode(Button, {
|
|
4148
4247
|
"onClick": this.close
|
|
4149
4248
|
}, _isSlot(_slot3 = this.i18n("ui.base.cancel")) ? _slot3 : {
|
|
4150
|
-
default: function
|
|
4249
|
+
default: function _default29() {
|
|
4151
4250
|
return [_slot3];
|
|
4152
4251
|
}
|
|
4153
4252
|
})])]);
|
|
@@ -4171,7 +4270,7 @@ var Panel$1 = /* @__PURE__ */ defineComponent({
|
|
|
4171
4270
|
"type": "primary",
|
|
4172
4271
|
"onClick": this.filterEnum
|
|
4173
4272
|
}, _isSlot(_slot4 = this.i18n("ui.base.confirm")) ? _slot4 : {
|
|
4174
|
-
default: function
|
|
4273
|
+
default: function _default29() {
|
|
4175
4274
|
return [_slot4];
|
|
4176
4275
|
}
|
|
4177
4276
|
}), createVNode(Button, {
|
|
@@ -4179,7 +4278,7 @@ var Panel$1 = /* @__PURE__ */ defineComponent({
|
|
|
4179
4278
|
filterStore.visible = false;
|
|
4180
4279
|
}
|
|
4181
4280
|
}, _isSlot(_slot5 = this.i18n("ui.base.cancel")) ? _slot5 : {
|
|
4182
|
-
default: function
|
|
4281
|
+
default: function _default29() {
|
|
4183
4282
|
return [_slot5];
|
|
4184
4283
|
}
|
|
4185
4284
|
})]) : null]);
|
|
@@ -4251,7 +4350,7 @@ var Panel$1 = /* @__PURE__ */ defineComponent({
|
|
|
4251
4350
|
"type": "primary",
|
|
4252
4351
|
"onClick": this.filterDate
|
|
4253
4352
|
}, _isSlot(_slot6 = this.i18n("ui.base.confirm")) ? _slot6 : {
|
|
4254
|
-
default: function
|
|
4353
|
+
default: function _default29() {
|
|
4255
4354
|
return [_slot6];
|
|
4256
4355
|
}
|
|
4257
4356
|
}), createVNode(Button, {
|
|
@@ -4259,7 +4358,7 @@ var Panel$1 = /* @__PURE__ */ defineComponent({
|
|
|
4259
4358
|
filterStore.visible = false;
|
|
4260
4359
|
}
|
|
4261
4360
|
}, _isSlot(_slot7 = this.i18n("ui.base.cancel")) ? _slot7 : {
|
|
4262
|
-
default: function
|
|
4361
|
+
default: function _default29() {
|
|
4263
4362
|
return [_slot7];
|
|
4264
4363
|
}
|
|
4265
4364
|
})])]);
|
|
@@ -4300,7 +4399,7 @@ var Panel$1 = /* @__PURE__ */ defineComponent({
|
|
|
4300
4399
|
"type": "primary",
|
|
4301
4400
|
"onClick": this.filterEnum
|
|
4302
4401
|
}, _isSlot(_slot8 = this.i18n("ui.base.confirm")) ? _slot8 : {
|
|
4303
|
-
default: function
|
|
4402
|
+
default: function _default29() {
|
|
4304
4403
|
return [_slot8];
|
|
4305
4404
|
}
|
|
4306
4405
|
}), createVNode(Button, {
|
|
@@ -4308,7 +4407,7 @@ var Panel$1 = /* @__PURE__ */ defineComponent({
|
|
|
4308
4407
|
filterStore.visible = false;
|
|
4309
4408
|
}
|
|
4310
4409
|
}, _isSlot(_slot9 = this.i18n("ui.base.cancel")) ? _slot9 : {
|
|
4311
|
-
default: function
|
|
4410
|
+
default: function _default29() {
|
|
4312
4411
|
return [_slot9];
|
|
4313
4412
|
}
|
|
4314
4413
|
})]) : null]);
|
|
@@ -5567,11 +5666,11 @@ function getColumnRuleTypeOther(_ref94) {
|
|
|
5567
5666
|
var $table = _ref94.$table, _vm = _ref94._vm, colProps = _ref94.colProps, editor = _ref94.editor, filter2 = _ref94.filter, isTreeNode = _ref94.isTreeNode, renMaps = _ref94.renMaps, type = _ref94.type;
|
|
5568
5667
|
return {
|
|
5569
5668
|
match: function match() {
|
|
5570
|
-
return
|
|
5669
|
+
return !["index", "radio", "selection", "expand", "operation"].includes(type);
|
|
5571
5670
|
},
|
|
5572
5671
|
action: function action() {
|
|
5573
5672
|
var sortable = colProps.sortable, remoteSort = colProps.remoteSort;
|
|
5574
|
-
var isSortable = $table.sortable &&
|
|
5673
|
+
var isSortable = $table.sortable && sortable;
|
|
5575
5674
|
var isSortColumn = isSortable || remoteSort;
|
|
5576
5675
|
if (editor) {
|
|
5577
5676
|
renMaps.renderHeader = _vm.renderEditHeader;
|
|
@@ -5698,6 +5797,7 @@ var Cell = {
|
|
|
5698
5797
|
var $table = params.$table, row2 = params.row, column = params.column;
|
|
5699
5798
|
var slots = column.slots, renderer = column.renderer;
|
|
5700
5799
|
var format = column.format || {};
|
|
5800
|
+
$table.columnSlotsWeakMap || ($table.columnSlotsWeakMap = /* @__PURE__ */ new WeakMap());
|
|
5701
5801
|
if (slots && slots.default) {
|
|
5702
5802
|
return slots.default(params, h2);
|
|
5703
5803
|
}
|
|
@@ -6299,7 +6399,7 @@ var Cell = {
|
|
|
6299
6399
|
return renderBig(buttonConfig, viewClass);
|
|
6300
6400
|
});
|
|
6301
6401
|
var scopedSlots = {
|
|
6302
|
-
default: function
|
|
6402
|
+
default: function _default29() {
|
|
6303
6403
|
return h2(iconEllipsis(), {
|
|
6304
6404
|
class: "tiny-grid__oper-col-elps"
|
|
6305
6405
|
});
|
|
@@ -7541,7 +7641,7 @@ var Methods$d = {
|
|
|
7541
7641
|
_this15.tableData = [];
|
|
7542
7642
|
_this15.cellStatus.clear();
|
|
7543
7643
|
_this15.clearValidateMap();
|
|
7544
|
-
return _this15.
|
|
7644
|
+
return _this15.updateRawData(data7 || _this15.tableFullData);
|
|
7545
7645
|
};
|
|
7546
7646
|
return this.$nextTick().then(next);
|
|
7547
7647
|
},
|
|
@@ -7593,18 +7693,10 @@ var Methods$d = {
|
|
|
7593
7693
|
// 全量加载表格数据
|
|
7594
7694
|
loadTableData: function loadTableData(datas, notRefresh) {
|
|
7595
7695
|
var _this17 = this;
|
|
7596
|
-
var editStore = this.editStore, height2 = this.height, maxHeight = this.maxHeight, lastScrollLeft = this.lastScrollLeft, lastScrollTop = this.lastScrollTop,
|
|
7597
|
-
var scrollY = optimizeOpts.scrollY;
|
|
7598
|
-
var tableFullData = isArray(datas) ? datas.slice(0) : [];
|
|
7599
|
-
var scrollYLoad = scrollY && scrollY.gt > 0 && scrollY.gt <= tableFullData.length;
|
|
7696
|
+
var editStore = this.editStore, height2 = this.height, maxHeight = this.maxHeight, lastScrollLeft = this.lastScrollLeft, lastScrollTop = this.lastScrollTop, scrollYLoad = this.scrollYLoad;
|
|
7600
7697
|
editStore.insertList = [];
|
|
7698
|
+
editStore.insertMap = /* @__PURE__ */ new Map();
|
|
7601
7699
|
editStore.removeList = [];
|
|
7602
|
-
Object.assign(this, {
|
|
7603
|
-
tableFullData,
|
|
7604
|
-
tableSynchData: datas,
|
|
7605
|
-
scrollYLoad
|
|
7606
|
-
});
|
|
7607
|
-
this.updateCache(true, true);
|
|
7608
7700
|
if (scrollYLoad && !(height2 || maxHeight)) {
|
|
7609
7701
|
error("ui.grid.error.scrollYHeight");
|
|
7610
7702
|
}
|
|
@@ -7620,31 +7712,51 @@ var Methods$d = {
|
|
|
7620
7712
|
lastScrollTop
|
|
7621
7713
|
});
|
|
7622
7714
|
}
|
|
7715
|
+
}).then(function() {
|
|
7716
|
+
var _this17$resolveMap$lo;
|
|
7717
|
+
if (((_this17$resolveMap$lo = _this17.resolveMap.loadDataResolve) == null ? void 0 : _this17$resolveMap$lo.data) === datas) {
|
|
7718
|
+
_this17.resolveMap.loadDataResolve.resolveQueue.forEach(function(resolve) {
|
|
7719
|
+
return resolve();
|
|
7720
|
+
});
|
|
7721
|
+
_this17.resolveMap.loadDataResolve = null;
|
|
7722
|
+
}
|
|
7623
7723
|
});
|
|
7624
7724
|
},
|
|
7625
7725
|
// 重新加载数据
|
|
7626
7726
|
reloadData: function reloadData(datas) {
|
|
7627
7727
|
var _this18 = this;
|
|
7628
7728
|
return this.clearAll().then(function() {
|
|
7629
|
-
return _this18.
|
|
7729
|
+
return _this18.updateRawData(datas);
|
|
7630
7730
|
});
|
|
7631
7731
|
},
|
|
7632
7732
|
// 加载全量数据
|
|
7633
7733
|
loadData: function loadData(datas) {
|
|
7634
7734
|
var _this19 = this;
|
|
7635
7735
|
return new Promise(function(resolve) {
|
|
7636
|
-
_this19.
|
|
7637
|
-
|
|
7736
|
+
_this19.updateRawData(datas);
|
|
7737
|
+
if (_this19.resolveMap.loadDataResolve) {
|
|
7738
|
+
_this19.resolveMap.loadDataResolve.data = datas;
|
|
7739
|
+
_this19.resolveMap.loadDataResolve.resolveQueue.push(resolve);
|
|
7740
|
+
} else {
|
|
7741
|
+
_this19.resolveMap.loadDataResolve = {
|
|
7742
|
+
data: datas,
|
|
7743
|
+
resolveQueue: [resolve]
|
|
7744
|
+
};
|
|
7745
|
+
}
|
|
7638
7746
|
});
|
|
7639
7747
|
},
|
|
7748
|
+
updateRawData: function updateRawData(datas) {
|
|
7749
|
+
this.rawData = datas;
|
|
7750
|
+
this.rawDataVersion += 1;
|
|
7751
|
+
},
|
|
7640
7752
|
getOriginRow: function getOriginRow(row2) {
|
|
7641
|
-
var
|
|
7642
|
-
return
|
|
7753
|
+
var rowid2 = getRowid(this, row2);
|
|
7754
|
+
return rowid2 ? this.rowidCacheMap.get(rowid2) : null;
|
|
7643
7755
|
},
|
|
7644
7756
|
setOriginRow: function setOriginRow(row2, record) {
|
|
7645
|
-
var
|
|
7646
|
-
if (
|
|
7647
|
-
|
|
7757
|
+
var rowid2 = getRowid(this, row2);
|
|
7758
|
+
if (rowid2 && record) {
|
|
7759
|
+
this.rowidCacheMap.set(rowid2, record);
|
|
7648
7760
|
}
|
|
7649
7761
|
},
|
|
7650
7762
|
reloadRow: function reloadRow(row2, record, field) {
|
|
@@ -7718,14 +7830,14 @@ var Methods$d = {
|
|
|
7718
7830
|
if (deepCopy === void 0) {
|
|
7719
7831
|
deepCopy = false;
|
|
7720
7832
|
}
|
|
7721
|
-
var tableFullData = this.tableFullData, treeConfig = this.treeConfig, treeOrdered = this.treeOrdered;
|
|
7833
|
+
var tableFullData = this.tableFullData, treeConfig = this.treeConfig, treeOrdered = this.treeOrdered, editConfig = this.editConfig, _this$saveSource = this.saveSource, saveSource = _this$saveSource === void 0 ? false : _this$saveSource;
|
|
7722
7834
|
var rowKey = getRowkey(this);
|
|
7723
7835
|
var _ref157 = treeConfig || {}, childrenKey = _ref157.children, _ref157$temporaryInde = _ref157.temporaryIndex, temporaryIndex = _ref157$temporaryInde === void 0 ? "_$index_" : _ref157$temporaryInde;
|
|
7724
7836
|
var isTreeOrderedFalse = treeConfig && !treeOrdered;
|
|
7725
|
-
var
|
|
7726
|
-
|
|
7727
|
-
|
|
7728
|
-
|
|
7837
|
+
var fullDataRowIdData = this.fullDataRowIdData = {};
|
|
7838
|
+
var fullDataRowMap = this.fullDataRowMap;
|
|
7839
|
+
fullDataRowMap.clear();
|
|
7840
|
+
eachTree(tableFullData, function(row2, index2, _array, _path, parent) {
|
|
7729
7841
|
var rowId = getRowid(_this22, row2);
|
|
7730
7842
|
if (!rowId) {
|
|
7731
7843
|
rowId = getRowUniqueId();
|
|
@@ -7736,31 +7848,78 @@ var Methods$d = {
|
|
|
7736
7848
|
rowid: rowId,
|
|
7737
7849
|
index: index2
|
|
7738
7850
|
};
|
|
7739
|
-
|
|
7740
|
-
|
|
7741
|
-
|
|
7742
|
-
|
|
7743
|
-
|
|
7744
|
-
|
|
7745
|
-
|
|
7746
|
-
|
|
7747
|
-
|
|
7748
|
-
set(row2, temporaryIndex, (parentIndex ? parentIndex + "." : "") + (index2 + 1));
|
|
7851
|
+
if (fullDataRowIdData[rowId]) {
|
|
7852
|
+
warn("ui.grid.error.duplicateRowId", rowId);
|
|
7853
|
+
}
|
|
7854
|
+
fullDataRowIdData[rowId] = rowCache;
|
|
7855
|
+
fullDataRowMap.set(_this22.getRaw(row2), rowCache);
|
|
7856
|
+
if (isTreeOrderedFalse) {
|
|
7857
|
+
var parentIndex;
|
|
7858
|
+
if (parent) {
|
|
7859
|
+
parentIndex = get(parent, temporaryIndex);
|
|
7749
7860
|
}
|
|
7750
|
-
|
|
7751
|
-
var backupRow = deepCopy ? clone(_extends({}, row2, childrenField), true) : _extends({}, row2, childrenField);
|
|
7752
|
-
backupMap.set(row2, backupRow);
|
|
7753
|
-
return backupRow;
|
|
7861
|
+
set(row2, temporaryIndex, (parentIndex ? parentIndex + "." : "") + (index2 + 1));
|
|
7754
7862
|
}
|
|
7755
|
-
};
|
|
7756
|
-
|
|
7757
|
-
|
|
7758
|
-
|
|
7759
|
-
|
|
7760
|
-
|
|
7863
|
+
}, treeConfig);
|
|
7864
|
+
if (backup && (editConfig || saveSource)) {
|
|
7865
|
+
requestIdleCallback(function() {
|
|
7866
|
+
var rowidCacheMap = /* @__PURE__ */ new Map();
|
|
7867
|
+
var callback = function callback2(row2) {
|
|
7868
|
+
var _extends6;
|
|
7869
|
+
return rowidCacheMap.set(getRowid(_this22, row2), clone(childrenKey ? _extends({}, row2, (_extends6 = {}, _extends6[childrenKey] = null, _extends6)) : _extends({}, row2), deepCopy));
|
|
7870
|
+
};
|
|
7871
|
+
eachTree(tableFullData, callback, treeConfig);
|
|
7872
|
+
_this22.rowidCacheMap = rowidCacheMap;
|
|
7761
7873
|
});
|
|
7762
7874
|
}
|
|
7763
7875
|
},
|
|
7876
|
+
getRaw: function getRaw(object) {
|
|
7877
|
+
var hooks_vue = hooks;
|
|
7878
|
+
return !isVue2 && hooks_vue.isProxy(object) ? hooks.toRaw(object) : object;
|
|
7879
|
+
},
|
|
7880
|
+
/**
|
|
7881
|
+
* 递归地将 Proxy 对象(如 Vue 3 的响应式对象)转换为普通对象。
|
|
7882
|
+
* @param {any} data 待处理的数据
|
|
7883
|
+
* @returns {any} 转换后的普通对象或原始数据
|
|
7884
|
+
*/
|
|
7885
|
+
deepUnwrap: function deepUnwrap(data7) {
|
|
7886
|
+
if (data7 === null || typeof data7 !== "object") {
|
|
7887
|
+
return data7;
|
|
7888
|
+
}
|
|
7889
|
+
if (data7 instanceof Map) {
|
|
7890
|
+
return this.cloneMapAndUnwrap(data7);
|
|
7891
|
+
}
|
|
7892
|
+
if (data7 instanceof Set) {
|
|
7893
|
+
return new Set(Array.from(data7).map(this.deepUnwrap));
|
|
7894
|
+
}
|
|
7895
|
+
if (Array.isArray(data7)) {
|
|
7896
|
+
return data7.map(this.deepUnwrap);
|
|
7897
|
+
}
|
|
7898
|
+
var result = {};
|
|
7899
|
+
for (var key in data7) {
|
|
7900
|
+
if (Object.prototype.hasOwnProperty.call(data7, key)) {
|
|
7901
|
+
result[key] = this.deepUnwrap(data7[key]);
|
|
7902
|
+
}
|
|
7903
|
+
}
|
|
7904
|
+
return result;
|
|
7905
|
+
},
|
|
7906
|
+
/**
|
|
7907
|
+
* 复制 Map,并递归地将 Map 的值中包含的 Proxy 转换为普通对象。
|
|
7908
|
+
* @param {Map<any, any>} originalMap 原始 Map
|
|
7909
|
+
* @returns {Map<any, any>} 复制并解包后的新 Map
|
|
7910
|
+
*/
|
|
7911
|
+
cloneMapAndUnwrap: function cloneMapAndUnwrap(originalMap) {
|
|
7912
|
+
if (!(originalMap instanceof Map)) {
|
|
7913
|
+
return originalMap;
|
|
7914
|
+
}
|
|
7915
|
+
var newMap = /* @__PURE__ */ new Map();
|
|
7916
|
+
for (var _iterator0 = _createForOfIteratorHelperLoose(originalMap.entries()), _step0; !(_step0 = _iterator0()).done; ) {
|
|
7917
|
+
var _step0$value = _step0.value, key = _step0$value[0], value = _step0$value[1];
|
|
7918
|
+
var unwrappedValue = this.deepUnwrap(value);
|
|
7919
|
+
newMap.set(key, unwrappedValue);
|
|
7920
|
+
}
|
|
7921
|
+
return newMap;
|
|
7922
|
+
},
|
|
7764
7923
|
// 更新列的 Map
|
|
7765
7924
|
cacheColumnMap: function cacheColumnMap(options) {
|
|
7766
7925
|
var fullColumnMap = this.fullColumnMap;
|
|
@@ -7788,9 +7947,7 @@ var Methods$d = {
|
|
|
7788
7947
|
return null;
|
|
7789
7948
|
},
|
|
7790
7949
|
getColumnNode: function getColumnNode(cell) {
|
|
7791
|
-
if (!cell)
|
|
7792
|
-
return null;
|
|
7793
|
-
}
|
|
7950
|
+
if (!cell) return null;
|
|
7794
7951
|
var fullColumnIdData = this.fullColumnIdData, tableFullColumn = this.tableFullColumn;
|
|
7795
7952
|
var dataColid = cell.dataset.colid;
|
|
7796
7953
|
var colCache = fullColumnIdData[dataColid];
|
|
@@ -7804,31 +7961,41 @@ var Methods$d = {
|
|
|
7804
7961
|
return null;
|
|
7805
7962
|
},
|
|
7806
7963
|
getRowIndex: function getRowIndex(row2) {
|
|
7807
|
-
var rawRow = hooks.toRaw(row2);
|
|
7808
7964
|
var fullDataRowMap = this.fullDataRowMap;
|
|
7809
|
-
|
|
7965
|
+
row2 = this.getRaw(row2);
|
|
7966
|
+
return fullDataRowMap.has(row2) ? fullDataRowMap.get(row2).index : -1;
|
|
7810
7967
|
},
|
|
7811
7968
|
getColumnIndex: function getColumnIndex(column) {
|
|
7812
7969
|
var fullColumnMap = this.fullColumnMap;
|
|
7813
|
-
return fullColumnMap.has(column) ? fullColumnMap.get(column).
|
|
7970
|
+
return fullColumnMap.has(column) ? fullColumnMap.get(column).columnIndex : -1;
|
|
7814
7971
|
},
|
|
7815
7972
|
hasIndexColumn: function hasIndexColumn(column) {
|
|
7816
7973
|
return (column == null ? void 0 : column.type) === "index";
|
|
7817
7974
|
},
|
|
7818
|
-
defineField: function defineField(row2, copy) {
|
|
7819
|
-
|
|
7820
|
-
|
|
7821
|
-
}
|
|
7975
|
+
defineField: function defineField(row2, copy, editorColumns, cache) {
|
|
7976
|
+
var _this23 = this;
|
|
7977
|
+
if (!row2 || typeof row2 !== "object") return row2;
|
|
7822
7978
|
if (copy) {
|
|
7823
7979
|
row2 = clone(row2, true);
|
|
7824
7980
|
}
|
|
7825
7981
|
var rowKey = getRowkey(this);
|
|
7826
|
-
this.visibleColumn
|
|
7827
|
-
|
|
7982
|
+
var columns2 = editorColumns || this.visibleColumn;
|
|
7983
|
+
columns2.forEach(function(column) {
|
|
7984
|
+
var property = column.property, editor = column.editor;
|
|
7828
7985
|
var propNotExist = property && !has(row2, property);
|
|
7829
7986
|
var propDefaultValue = editor && !isUndefined(editor.defaultValue) ? editor.defaultValue : null;
|
|
7830
7987
|
if (propNotExist) {
|
|
7831
|
-
|
|
7988
|
+
if (cache) {
|
|
7989
|
+
var originRow = _this23.getOriginRow(row2);
|
|
7990
|
+
if (originRow) {
|
|
7991
|
+
originRow[property] = propDefaultValue;
|
|
7992
|
+
}
|
|
7993
|
+
}
|
|
7994
|
+
if (isVue2) {
|
|
7995
|
+
_this23.$set(row2, property, propDefaultValue);
|
|
7996
|
+
} else {
|
|
7997
|
+
set(row2, property, propDefaultValue);
|
|
7998
|
+
}
|
|
7832
7999
|
}
|
|
7833
8000
|
});
|
|
7834
8001
|
var rowId = get(row2, rowKey);
|
|
@@ -7838,11 +8005,8 @@ var Methods$d = {
|
|
|
7838
8005
|
return row2;
|
|
7839
8006
|
},
|
|
7840
8007
|
isTemporaryRow: function isTemporaryRow(row2) {
|
|
7841
|
-
var _this23 = this;
|
|
7842
8008
|
var rowid2 = getRowid(this, row2);
|
|
7843
|
-
return
|
|
7844
|
-
return rowid2 === getRowid(_this23, r);
|
|
7845
|
-
});
|
|
8009
|
+
return this.editStore.insertMap.has(rowid2);
|
|
7846
8010
|
},
|
|
7847
8011
|
createData: function createData(records, copy) {
|
|
7848
8012
|
var _this24 = this;
|
|
@@ -7882,7 +8046,7 @@ var Methods$d = {
|
|
|
7882
8046
|
return this.$nextTick();
|
|
7883
8047
|
},
|
|
7884
8048
|
hasRowInsert: function hasRowInsert(row2) {
|
|
7885
|
-
return this.
|
|
8049
|
+
return this.isTemporaryRow(row2);
|
|
7886
8050
|
},
|
|
7887
8051
|
compareRow: function compareRow(row2, originalRow, field) {
|
|
7888
8052
|
var value = get(row2, field);
|
|
@@ -7908,20 +8072,20 @@ var Methods$d = {
|
|
|
7908
8072
|
},
|
|
7909
8073
|
hasRowChange: function hasRowChange(row2, field) {
|
|
7910
8074
|
var _editConfig$insertCha;
|
|
7911
|
-
var treeConfig = this.treeConfig, visibleColumn = this.visibleColumn,
|
|
8075
|
+
var treeConfig = this.treeConfig, visibleColumn = this.visibleColumn, _this$editConfig2 = this.editConfig, editConfig = _this$editConfig2 === void 0 ? {} : _this$editConfig2;
|
|
7912
8076
|
var insertChanged = (_editConfig$insertCha = editConfig == null ? void 0 : editConfig.insertChanged) != null ? _editConfig$insertCha : false;
|
|
7913
8077
|
var argsLength = arguments.length;
|
|
7914
8078
|
var originRow;
|
|
7915
8079
|
if (this.isTemporaryRow(row2)) {
|
|
7916
8080
|
return insertChanged;
|
|
7917
8081
|
}
|
|
7918
|
-
var cacheRow =
|
|
8082
|
+
var cacheRow = this.getOriginRow(row2);
|
|
7919
8083
|
if (cacheRow) {
|
|
7920
8084
|
if (treeConfig) {
|
|
7921
|
-
var
|
|
8085
|
+
var _extends7, _extends8;
|
|
7922
8086
|
var children = treeConfig.children;
|
|
7923
|
-
row2 = _extends({}, row2, (
|
|
7924
|
-
originRow = _extends({}, cacheRow, (
|
|
8087
|
+
row2 = _extends({}, row2, (_extends7 = {}, _extends7[children] = null, _extends7));
|
|
8088
|
+
originRow = _extends({}, cacheRow, (_extends8 = {}, _extends8[children] = null, _extends8));
|
|
7925
8089
|
} else {
|
|
7926
8090
|
originRow = _extends({}, cacheRow);
|
|
7927
8091
|
}
|
|
@@ -7968,7 +8132,7 @@ var Methods$d = {
|
|
|
7968
8132
|
},
|
|
7969
8133
|
// 获取表格所有数据
|
|
7970
8134
|
getData: function getData(rowIndex) {
|
|
7971
|
-
var allRows = this.
|
|
8135
|
+
var allRows = this.rawData || [];
|
|
7972
8136
|
if (!arguments.length) {
|
|
7973
8137
|
return allRows.slice(0);
|
|
7974
8138
|
}
|
|
@@ -7982,7 +8146,7 @@ var Methods$d = {
|
|
|
7982
8146
|
var _this$selectConfig = this.selectConfig, selectConfig = _this$selectConfig === void 0 ? {} : _this$selectConfig, selection = this.selection;
|
|
7983
8147
|
var tableFullData = this.tableFullData, treeConfig = this.treeConfig;
|
|
7984
8148
|
var checkField = selectConfig.checkField;
|
|
7985
|
-
var
|
|
8149
|
+
var _ref158 = {}, _ref158$rowList = _ref158.rowList, rowList = _ref158$rowList === void 0 ? [] : _ref158$rowList;
|
|
7986
8150
|
if (checkField && treeConfig) {
|
|
7987
8151
|
rowList = filterTree(tableFullData, function(row2) {
|
|
7988
8152
|
return get(row2, checkField);
|
|
@@ -8011,8 +8175,8 @@ var Methods$d = {
|
|
|
8011
8175
|
var tableData = this.tableFullData;
|
|
8012
8176
|
var updateFilter = function updateFilter2(tableData2) {
|
|
8013
8177
|
var remoteFilter = _this26.remoteFilter, visibleColumn = _this26.visibleColumn;
|
|
8014
|
-
var filterColumn = visibleColumn.filter(function(
|
|
8015
|
-
var filter2 =
|
|
8178
|
+
var filterColumn = visibleColumn.filter(function(_ref159) {
|
|
8179
|
+
var filter2 = _ref159.filter;
|
|
8016
8180
|
return !!filter2;
|
|
8017
8181
|
});
|
|
8018
8182
|
return tableData2.filter(function(row2) {
|
|
@@ -8041,8 +8205,8 @@ var Methods$d = {
|
|
|
8041
8205
|
} else {
|
|
8042
8206
|
var sortedFlag = false;
|
|
8043
8207
|
if (sortOpts2.multipleColumnSort) {
|
|
8044
|
-
var sortColumns = visibleColumn.filter(function(
|
|
8045
|
-
var order2 =
|
|
8208
|
+
var sortColumns = visibleColumn.filter(function(_ref160) {
|
|
8209
|
+
var order2 = _ref160.order;
|
|
8046
8210
|
return !!order2;
|
|
8047
8211
|
});
|
|
8048
8212
|
if (sortColumns.length > 1) {
|
|
@@ -8104,9 +8268,10 @@ var Methods$d = {
|
|
|
8104
8268
|
return this.scrollLoad ? this.scrollLoad.pageSize || 10 : ((_this$_graphInfo = this._graphInfo) == null ? void 0 : _this$_graphInfo.graphed.length) || 0;
|
|
8105
8269
|
},
|
|
8106
8270
|
getRowById: function getRowById(rowid2) {
|
|
8107
|
-
var
|
|
8108
|
-
var
|
|
8109
|
-
|
|
8271
|
+
var _fullDataRowIdData$ro, _editStore$insertMap;
|
|
8272
|
+
var fullDataRowIdData = this.fullDataRowIdData, editStore = this.editStore;
|
|
8273
|
+
var rowCache = ((_fullDataRowIdData$ro = fullDataRowIdData[rowid2]) == null ? void 0 : _fullDataRowIdData$ro.row) || (editStore == null ? void 0 : (_editStore$insertMap = editStore.insertMap) == null ? void 0 : _editStore$insertMap.get(rowid2));
|
|
8274
|
+
return rowCache || null;
|
|
8110
8275
|
},
|
|
8111
8276
|
// 获取处理后的表格数据
|
|
8112
8277
|
getTableData: function getTableData() {
|
|
@@ -8150,7 +8315,7 @@ var Methods$d = {
|
|
|
8150
8315
|
});
|
|
8151
8316
|
}
|
|
8152
8317
|
if (hasCustomsOrColWidth && !isGroupOrNonSort) {
|
|
8153
|
-
var
|
|
8318
|
+
var _ref161 = {}, _ref161$collectColumn = _ref161.collectColumn, collectColumn2 = _ref161$collectColumn === void 0 ? [] : _ref161$collectColumn, _ref161$customMap = _ref161.customMap, customMap = _ref161$customMap === void 0 ? {} : _ref161$customMap, _ref161$orderColumn = _ref161.orderColumn, orderColumn = _ref161$orderColumn === void 0 ? [] : _ref161$orderColumn;
|
|
8154
8319
|
mapTree(customColumns, function(customCol) {
|
|
8155
8320
|
var targetCol = find$1(fullColumn, function(item) {
|
|
8156
8321
|
return customCol.property && item.property === customCol.property;
|
|
@@ -8216,7 +8381,8 @@ var Methods$d = {
|
|
|
8216
8381
|
var options = {
|
|
8217
8382
|
columnCaches: []
|
|
8218
8383
|
};
|
|
8219
|
-
|
|
8384
|
+
this.markColumnIndex = 0;
|
|
8385
|
+
var fullColumn = getColumnList(this, value, options);
|
|
8220
8386
|
if (options.isGroup && options.hasFixed) {
|
|
8221
8387
|
value.forEach(function(root) {
|
|
8222
8388
|
return repairFixed(root);
|
|
@@ -8487,8 +8653,8 @@ var Methods$d = {
|
|
|
8487
8653
|
}
|
|
8488
8654
|
end && end();
|
|
8489
8655
|
},
|
|
8490
|
-
blurOutside: function blurOutside(
|
|
8491
|
-
var row2 =
|
|
8656
|
+
blurOutside: function blurOutside(_ref162, event) {
|
|
8657
|
+
var row2 = _ref162.row, args = _ref162.args, column = _ref162.column;
|
|
8492
8658
|
var editConfig = this.editConfig, getEventTargetNode2 = this.getEventTargetNode, $el = this.$el;
|
|
8493
8659
|
if (column && row2) {
|
|
8494
8660
|
var editor = column.editor;
|
|
@@ -8548,7 +8714,7 @@ var Methods$d = {
|
|
|
8548
8714
|
// 处理单选框默认勾选
|
|
8549
8715
|
handleRadioDefChecked: function handleRadioDefChecked() {
|
|
8550
8716
|
var fullDataRowIdData = this.fullDataRowIdData;
|
|
8551
|
-
var
|
|
8717
|
+
var _ref163 = this.radioConfig || {}, checkRowKey = _ref163.checkRowKey;
|
|
8552
8718
|
var rowid2 = checkRowKey && encodeURIComponent(checkRowKey);
|
|
8553
8719
|
var rowCache = fullDataRowIdData[rowid2];
|
|
8554
8720
|
if (rowid2 && rowCache) {
|
|
@@ -8558,7 +8724,7 @@ var Methods$d = {
|
|
|
8558
8724
|
// 单选,行选中事件
|
|
8559
8725
|
triggerRadioRowEvent: function triggerRadioRowEvent(event, params) {
|
|
8560
8726
|
var selectRow = this.selectRow;
|
|
8561
|
-
var
|
|
8727
|
+
var _ref164 = this.radioConfig || {}, checkMethod = _ref164.checkMethod;
|
|
8562
8728
|
if (checkMethod && !checkMethod(params)) {
|
|
8563
8729
|
return;
|
|
8564
8730
|
}
|
|
@@ -8764,7 +8930,7 @@ var Methods$d = {
|
|
|
8764
8930
|
// 点击排序事件
|
|
8765
8931
|
triggerSortEvent: function triggerSortEvent(event, column, order) {
|
|
8766
8932
|
var property = column.property;
|
|
8767
|
-
var isColumnSortable = column.
|
|
8933
|
+
var isColumnSortable = column.sortable || column.remoteSort;
|
|
8768
8934
|
if (this.sortable && isColumnSortable) {
|
|
8769
8935
|
var evntParams = {
|
|
8770
8936
|
$table: this,
|
|
@@ -8789,7 +8955,7 @@ var Methods$d = {
|
|
|
8789
8955
|
return item.property === field;
|
|
8790
8956
|
});
|
|
8791
8957
|
var isRemote = isBoolean(column.remoteSort) ? column.remoteSort : remoteSort;
|
|
8792
|
-
var isColumnSortable = column.
|
|
8958
|
+
var isColumnSortable = column.sortable || column.remoteSort;
|
|
8793
8959
|
if (this.sortable && isColumnSortable) {
|
|
8794
8960
|
if (column.order !== order) {
|
|
8795
8961
|
tableFullColumn.forEach(function(column2) {
|
|
@@ -8813,8 +8979,8 @@ var Methods$d = {
|
|
|
8813
8979
|
this.groupExpandeds.push(row2);
|
|
8814
8980
|
},
|
|
8815
8981
|
// 展开行事件
|
|
8816
|
-
triggerRowExpandEvent: function triggerRowExpandEvent(event,
|
|
8817
|
-
var row2 =
|
|
8982
|
+
triggerRowExpandEvent: function triggerRowExpandEvent(event, _ref165) {
|
|
8983
|
+
var row2 = _ref165.row;
|
|
8818
8984
|
var rest = this.toggleRowExpansion(row2);
|
|
8819
8985
|
var eventParams = {
|
|
8820
8986
|
$table: this,
|
|
@@ -8831,7 +8997,7 @@ var Methods$d = {
|
|
|
8831
8997
|
// 处理默认展开行
|
|
8832
8998
|
handleDefaultRowExpand: function handleDefaultRowExpand() {
|
|
8833
8999
|
var fullDataRowIdData = this.fullDataRowIdData, tableFullData = this.tableFullData;
|
|
8834
|
-
var
|
|
9000
|
+
var _ref166 = this.expandConfig || {}, expandAll = _ref166.expandAll, expandRowKeys = _ref166.expandRowKeys;
|
|
8835
9001
|
if (expandAll) {
|
|
8836
9002
|
this.expandeds = tableFullData.slice(0);
|
|
8837
9003
|
return;
|
|
@@ -8852,7 +9018,7 @@ var Methods$d = {
|
|
|
8852
9018
|
// 设置展开行,二个参数设置这一行展开与否;支持单行;支持多行
|
|
8853
9019
|
setRowExpansion: function setRowExpansion(rows, expanded) {
|
|
8854
9020
|
var expandeds = this.expandeds;
|
|
8855
|
-
var
|
|
9021
|
+
var _ref167 = this.expandConfig || {}, accordion = _ref167.accordion;
|
|
8856
9022
|
var isToggle = arguments.length === 1;
|
|
8857
9023
|
var isAccordionCloseAll = false;
|
|
8858
9024
|
if (!rows) {
|
|
@@ -8928,7 +9094,7 @@ var Methods$d = {
|
|
|
8928
9094
|
var scrollXStore = this.scrollXStore, visibleColumn = this.visibleColumn;
|
|
8929
9095
|
var offsetSize = scrollXStore.offsetSize, renderSize = scrollXStore.renderSize, startIndex = scrollXStore.startIndex, visibleIndex = scrollXStore.visibleIndex, visibleSize = scrollXStore.visibleSize;
|
|
8930
9096
|
var scrollLeft = this.$refs.tableBody.$el.scrollLeft;
|
|
8931
|
-
var
|
|
9097
|
+
var _ref168 = {}, _ref168$preload = _ref168.preload, preload = _ref168$preload === void 0 ? false : _ref168$preload, _ref168$toVisibleInde = _ref168.toVisibleIndex, toVisibleIndex = _ref168$toVisibleInde === void 0 ? 0 : _ref168$toVisibleInde, _ref168$width = _ref168.width, width = _ref168$width === void 0 ? 0 : _ref168$width;
|
|
8932
9098
|
for (var i = 0; i < visibleColumn.length; i++) {
|
|
8933
9099
|
width += visibleColumn[i].renderWidth;
|
|
8934
9100
|
if (scrollLeft < width) {
|
|
@@ -9118,7 +9284,7 @@ var Methods$d = {
|
|
|
9118
9284
|
return this.$nextTick();
|
|
9119
9285
|
},
|
|
9120
9286
|
scrollToRow: function scrollToRow(row2, column, isDelay, move) {
|
|
9121
|
-
var hasRowCache = this.fullDataRowMap.has(
|
|
9287
|
+
var hasRowCache = this.fullDataRowMap.has(this.getRaw(row2));
|
|
9122
9288
|
var isDelayArg = isDelay || isBoolean(column);
|
|
9123
9289
|
row2 && hasRowCache && rowToVisible(this, row2);
|
|
9124
9290
|
return this.scrollToColumn(column, isDelayArg, move);
|
|
@@ -9259,8 +9425,8 @@ var Methods$d = {
|
|
|
9259
9425
|
return _this43.validCellRules(type, row2, column, cellValue).then(function() {
|
|
9260
9426
|
refreshStatus();
|
|
9261
9427
|
_this43.clearValidate();
|
|
9262
|
-
}).catch(function(
|
|
9263
|
-
var rule =
|
|
9428
|
+
}).catch(function(_ref169) {
|
|
9429
|
+
var rule = _ref169.rule;
|
|
9264
9430
|
refreshStatus();
|
|
9265
9431
|
_this43.showValidTooltip({
|
|
9266
9432
|
rule,
|
|
@@ -9307,8 +9473,8 @@ var Methods$d = {
|
|
|
9307
9473
|
return fetchColumns;
|
|
9308
9474
|
}
|
|
9309
9475
|
tableColumn2.forEach(function(col) {
|
|
9310
|
-
var
|
|
9311
|
-
var
|
|
9476
|
+
var _ref170 = col.format || {}, async = _ref170.async;
|
|
9477
|
+
var _ref171 = async || {}, fetch = _ref171.fetch, _ref171$splitConfig = _ref171.splitConfig, splitConfig = _ref171$splitConfig === void 0 ? {} : _ref171$splitConfig;
|
|
9312
9478
|
if (typeof fetch === "function") {
|
|
9313
9479
|
var columnValues = [];
|
|
9314
9480
|
tableData.forEach(function(row2) {
|
|
@@ -9368,8 +9534,8 @@ var Methods$d = {
|
|
|
9368
9534
|
}, this));
|
|
9369
9535
|
},
|
|
9370
9536
|
// Publish methods 与工具栏对接
|
|
9371
|
-
connect: function connect(
|
|
9372
|
-
var toolbar =
|
|
9537
|
+
connect: function connect(_ref172) {
|
|
9538
|
+
var toolbar = _ref172.toolbar;
|
|
9373
9539
|
this.$toolbar = toolbar;
|
|
9374
9540
|
},
|
|
9375
9541
|
// 检查触发源是否属于目标节点
|
|
@@ -9394,8 +9560,8 @@ var Methods$d = {
|
|
|
9394
9560
|
return column.order ? column.order === "asc" ? "desc" : null : "asc";
|
|
9395
9561
|
},
|
|
9396
9562
|
handleDataChange: function handleDataChange() {
|
|
9397
|
-
if (Array.isArray(this.
|
|
9398
|
-
!this._isUpdateData && this.loadTableData(this.
|
|
9563
|
+
if (Array.isArray(this.rawData)) {
|
|
9564
|
+
!this._isUpdateData && this.loadTableData(this.rawData);
|
|
9399
9565
|
this._isUpdateData = false;
|
|
9400
9566
|
}
|
|
9401
9567
|
},
|
|
@@ -9429,7 +9595,7 @@ var Methods$d = {
|
|
|
9429
9595
|
// 尝试恢复滚动位置,规范了最大滚动位置的取值
|
|
9430
9596
|
attemptRestoreScroll: function attemptRestoreScroll(options) {
|
|
9431
9597
|
var _this46 = this;
|
|
9432
|
-
var
|
|
9598
|
+
var _ref173 = options || this, lastScrollTop = _ref173.lastScrollTop, lastScrollLeft = _ref173.lastScrollLeft;
|
|
9433
9599
|
var scrollXLoad = this.scrollXLoad, scrollYLoad = this.scrollYLoad, elemStore = this.elemStore;
|
|
9434
9600
|
var tableBodyElem = elemStore["main-body-wrapper"];
|
|
9435
9601
|
if ((lastScrollTop || lastScrollLeft) && tableBodyElem) {
|
|
@@ -9679,8 +9845,8 @@ var _sfc_main$7 = defineComponent({
|
|
|
9679
9845
|
return typeof hidden === "boolean" && hidden || typeof hidden === "function" && hidden(row2);
|
|
9680
9846
|
};
|
|
9681
9847
|
var handleItemClick = function handleItemClick2(name) {
|
|
9682
|
-
var buttonConfig = visibleButtons.find(function(
|
|
9683
|
-
var buttonName =
|
|
9848
|
+
var buttonConfig = visibleButtons.find(function(_ref174) {
|
|
9849
|
+
var buttonName = _ref174.name;
|
|
9684
9850
|
return buttonName === name;
|
|
9685
9851
|
});
|
|
9686
9852
|
buttonConfig.click(window.event || {}, _extends({
|
|
@@ -9713,7 +9879,7 @@ var _sfc_main$7 = defineComponent({
|
|
|
9713
9879
|
})]);
|
|
9714
9880
|
} else {
|
|
9715
9881
|
var scopedSlots = {
|
|
9716
|
-
default: function
|
|
9882
|
+
default: function _default29() {
|
|
9717
9883
|
return h(IconEllipsis(), {
|
|
9718
9884
|
class: "mf-table-more outline-none text-base cursor-pointer"
|
|
9719
9885
|
});
|
|
@@ -10421,7 +10587,7 @@ function mergeScrollDirStore(scrollDir, scrollDirStore) {
|
|
|
10421
10587
|
}
|
|
10422
10588
|
function loadStatic(data7, _vm) {
|
|
10423
10589
|
if (data7 && data7.length > 0) {
|
|
10424
|
-
_vm.
|
|
10590
|
+
_vm.updateRawData(data7);
|
|
10425
10591
|
_vm.updateStyle();
|
|
10426
10592
|
}
|
|
10427
10593
|
}
|
|
@@ -10825,6 +10991,7 @@ var Table = defineComponent({
|
|
|
10825
10991
|
columns: []
|
|
10826
10992
|
},
|
|
10827
10993
|
insertList: [],
|
|
10994
|
+
insertMap: /* @__PURE__ */ new Map(),
|
|
10828
10995
|
removeList: [],
|
|
10829
10996
|
// 选中源
|
|
10830
10997
|
selected: {
|
|
@@ -10906,15 +11073,7 @@ var Table = defineComponent({
|
|
|
10906
11073
|
// 在编辑模式下 单元格在失去焦点验证的状态
|
|
10907
11074
|
validatedMap: {},
|
|
10908
11075
|
// 表格父容器的高度
|
|
10909
|
-
parentHeight: 0
|
|
10910
|
-
// 水平滚动条的状态
|
|
10911
|
-
horizonScroll: {
|
|
10912
|
-
fixed: false,
|
|
10913
|
-
threshold: 2,
|
|
10914
|
-
max: 0,
|
|
10915
|
-
isLeft: true,
|
|
10916
|
-
isRight: false
|
|
10917
|
-
}
|
|
11076
|
+
parentHeight: 0
|
|
10918
11077
|
};
|
|
10919
11078
|
},
|
|
10920
11079
|
computed: {
|
|
@@ -11039,9 +11198,10 @@ var Table = defineComponent({
|
|
|
11039
11198
|
// 选项式监控在vue2可以检测到顶层数组splice项替换/$set项替换
|
|
11040
11199
|
// array.splice(index, 1, newItem)
|
|
11041
11200
|
// this.$set(array, index, newItem)
|
|
11201
|
+
// 在数组中的行对象上动态添加字段也会触发此选项式监听
|
|
11042
11202
|
data: function data5(array1, array2) {
|
|
11043
11203
|
if (isVue2 && array1 === array2 && array1.length === array2.length) {
|
|
11044
|
-
this.
|
|
11204
|
+
this.updateRawData(this.data);
|
|
11045
11205
|
}
|
|
11046
11206
|
}
|
|
11047
11207
|
},
|
|
@@ -11058,8 +11218,6 @@ var Table = defineComponent({
|
|
|
11058
11218
|
fullColumnMap: /* @__PURE__ */ new Map(),
|
|
11059
11219
|
fullDataRowIdData: {},
|
|
11060
11220
|
fullDataRowMap: /* @__PURE__ */ new Map(),
|
|
11061
|
-
// 临时插入数据集
|
|
11062
|
-
temporaryRows: [],
|
|
11063
11221
|
// 最后滚动位置
|
|
11064
11222
|
lastScrollLeft: 0,
|
|
11065
11223
|
lastScrollTop: 0,
|
|
@@ -11153,6 +11311,13 @@ var Table = defineComponent({
|
|
|
11153
11311
|
// 百分比最小宽度列表集合
|
|
11154
11312
|
scaleMinList: []
|
|
11155
11313
|
});
|
|
11314
|
+
var horizonScroll = hooks.ref({
|
|
11315
|
+
fixed: false,
|
|
11316
|
+
threshold: 2,
|
|
11317
|
+
max: 0,
|
|
11318
|
+
isLeft: true,
|
|
11319
|
+
isRight: false
|
|
11320
|
+
});
|
|
11156
11321
|
var bodyProps = hooks.computed(function() {
|
|
11157
11322
|
return {
|
|
11158
11323
|
collectColumn: collectColumn2.value,
|
|
@@ -11172,6 +11337,10 @@ var Table = defineComponent({
|
|
|
11172
11337
|
};
|
|
11173
11338
|
});
|
|
11174
11339
|
var tableWrapper = hooks.ref();
|
|
11340
|
+
var _useNormalData = useNormalData({
|
|
11341
|
+
props,
|
|
11342
|
+
tableFullColumn
|
|
11343
|
+
}), rawData = _useNormalData.rawData, rawDataVersion = _useNormalData.rawDataVersion;
|
|
11175
11344
|
var tinyTheme = hooks.ref(resolveTheme(props, context));
|
|
11176
11345
|
var $table = hooks.getCurrentInstance().proxy;
|
|
11177
11346
|
var $grid = hooks.inject("$grid", null);
|
|
@@ -11217,6 +11386,38 @@ var Table = defineComponent({
|
|
|
11217
11386
|
columnStore
|
|
11218
11387
|
});
|
|
11219
11388
|
var _useData = useData(props), tiledLength = _useData.tiledLength;
|
|
11389
|
+
var updateFixedClasses = function updateFixedClasses2(isLeft, isRight) {
|
|
11390
|
+
if (!$table.$el) return;
|
|
11391
|
+
var el = $table.$el;
|
|
11392
|
+
var hasLeftClass = el.classList.contains("tiny-grid-fixed__left");
|
|
11393
|
+
var hasRightClass = el.classList.contains("tiny-grid-fixed__right");
|
|
11394
|
+
var shouldHaveLeft = !isLeft;
|
|
11395
|
+
var shouldHaveRight = !isRight;
|
|
11396
|
+
if (hasLeftClass !== shouldHaveLeft) {
|
|
11397
|
+
if (shouldHaveLeft) {
|
|
11398
|
+
el.classList.add("tiny-grid-fixed__left");
|
|
11399
|
+
} else {
|
|
11400
|
+
el.classList.remove("tiny-grid-fixed__left");
|
|
11401
|
+
}
|
|
11402
|
+
}
|
|
11403
|
+
if (hasRightClass !== shouldHaveRight) {
|
|
11404
|
+
if (shouldHaveRight) {
|
|
11405
|
+
el.classList.add("tiny-grid-fixed__right");
|
|
11406
|
+
} else {
|
|
11407
|
+
el.classList.remove("tiny-grid-fixed__right");
|
|
11408
|
+
}
|
|
11409
|
+
}
|
|
11410
|
+
};
|
|
11411
|
+
var resolveMap = {};
|
|
11412
|
+
hooks.watch(function() {
|
|
11413
|
+
var _horizonScroll$value, _horizonScroll$value2;
|
|
11414
|
+
return [(_horizonScroll$value = horizonScroll.value) == null ? void 0 : _horizonScroll$value.isLeft, (_horizonScroll$value2 = horizonScroll.value) == null ? void 0 : _horizonScroll$value2.isRight];
|
|
11415
|
+
}, function(_ref175) {
|
|
11416
|
+
var newIsLeft = _ref175[0], newIsRight = _ref175[1];
|
|
11417
|
+
hooks.nextTick(function() {
|
|
11418
|
+
return updateFixedClasses(newIsLeft, newIsRight);
|
|
11419
|
+
});
|
|
11420
|
+
});
|
|
11220
11421
|
hooks.onMounted(function() {
|
|
11221
11422
|
$table.addIntersectionObserver();
|
|
11222
11423
|
if (tableWrapper.value) {
|
|
@@ -11224,6 +11425,18 @@ var Table = defineComponent({
|
|
|
11224
11425
|
}
|
|
11225
11426
|
hooks.nextTick(function() {
|
|
11226
11427
|
$table.afterMounted = true;
|
|
11428
|
+
setTimeout(function() {
|
|
11429
|
+
if ($table.$el && $table.horizonScroll) {
|
|
11430
|
+
var _horizonScroll$value3, _horizonScroll$value4;
|
|
11431
|
+
var el = $table.$el;
|
|
11432
|
+
if (!((_horizonScroll$value3 = horizonScroll.value) != null && _horizonScroll$value3.isLeft)) {
|
|
11433
|
+
el.classList.add("tiny-grid-fixed__left");
|
|
11434
|
+
}
|
|
11435
|
+
if (!((_horizonScroll$value4 = horizonScroll.value) != null && _horizonScroll$value4.isRight)) {
|
|
11436
|
+
el.classList.add("tiny-grid-fixed__right");
|
|
11437
|
+
}
|
|
11438
|
+
}
|
|
11439
|
+
});
|
|
11227
11440
|
if (props.autoResize && Grid$1._resize) {
|
|
11228
11441
|
$table.bindResize();
|
|
11229
11442
|
}
|
|
@@ -11247,6 +11460,7 @@ var Table = defineComponent({
|
|
|
11247
11460
|
}
|
|
11248
11461
|
unbindEvent($table);
|
|
11249
11462
|
$table._tileInfo = $table._graphInfo = null;
|
|
11463
|
+
$table.rowidCacheMap = null;
|
|
11250
11464
|
});
|
|
11251
11465
|
hooks.onActivated(function() {
|
|
11252
11466
|
var lastScrollLeft = $table.lastScrollLeft, lastScrollTop = $table.lastScrollTop;
|
|
@@ -11265,6 +11479,9 @@ var Table = defineComponent({
|
|
|
11265
11479
|
unbindEvent($table);
|
|
11266
11480
|
});
|
|
11267
11481
|
var tableListeners = getListeners(attrs, listeners);
|
|
11482
|
+
var markColumnIndex = hooks.ref(0);
|
|
11483
|
+
var rowidCacheMap = /* @__PURE__ */ new Map();
|
|
11484
|
+
var columnSlotsWeakMap = /* @__PURE__ */ new WeakMap();
|
|
11268
11485
|
return {
|
|
11269
11486
|
slots,
|
|
11270
11487
|
tableListeners,
|
|
@@ -11297,7 +11514,14 @@ var Table = defineComponent({
|
|
|
11297
11514
|
bodyTableWidth,
|
|
11298
11515
|
scrollLoadScrollHeight,
|
|
11299
11516
|
columnStore,
|
|
11300
|
-
tiledLength
|
|
11517
|
+
tiledLength,
|
|
11518
|
+
rawDataVersion,
|
|
11519
|
+
rawData,
|
|
11520
|
+
markColumnIndex,
|
|
11521
|
+
rowidCacheMap,
|
|
11522
|
+
horizonScroll,
|
|
11523
|
+
resolveMap,
|
|
11524
|
+
columnSlotsWeakMap
|
|
11301
11525
|
};
|
|
11302
11526
|
},
|
|
11303
11527
|
render: function render14() {
|
|
@@ -11315,7 +11539,7 @@ var Table = defineComponent({
|
|
|
11315
11539
|
return h("div", {
|
|
11316
11540
|
class: (_class4 = {
|
|
11317
11541
|
"tiny-grid h-full sm:h-auto !bg-transparent sm:!bg-color-bg-1 after:border-none sm:after:border-solid": true
|
|
11318
|
-
}, _class4["row__valid-" + validOpts2.message] = true, _class4["size__" + vSize3] = vSize3, _class4["tiny-grid-editable"] = editConfig, _class4["show__head"] = showHeader, _class4["show__foot"] = showFooter, _class4["scroll__y"] = overflowY, _class4["scroll__x"] = overflowX, _class4["all-overflow"] = showOverflow, _class4["all-head-overflow"] = showHeaderOverflow, _class4["tiny-grid-cell__highlight"] = highlightCell, _class4["tiny-grid__animat"] = optimizeOpts.animat, _class4["tiny-grid__stripe"] = !isThemeSaas3 && stripe, _class4["tiny-grid__stripe-saas"] = isThemeSaas3 && stripeSaas, _class4["tiny-grid__border"] = border || isGroup2, _class4["tiny-grid__border-saas"] = isThemeSaas3 && borderSaas, _class4["tiny-grid__group-saas"] = isThemeSaas3 && isGroup2, _class4["tiny-grid__border-vertical"] = borderVertical, _class4["tiny-grid__checked"] = mouseConfig.checked, _class4["tiny-grid__hover-align"] = mouseConfig.hover, _class4["mark-insert"] = editConfig && editConfig.markInsert, _class4["edit__no-border"] = editConfig && editConfig.showBorder === false, _class4["is__loading"] = loading, _class4["row__highlight"] = highlightHoverRow, _class4["column__highlight"] = highlightHoverColumn, _class4["is__row-span"] = rowSpan && rowSpan.length > 0 || typeof spanMethod === "function", _class4["row__drop-handle--index"] = dropConfig.rowHandle === "index", _class4["fixed__sticky"] = horizonScroll.fixed, _class4
|
|
11542
|
+
}, _class4["row__valid-" + validOpts2.message] = true, _class4["size__" + vSize3] = vSize3, _class4["tiny-grid-editable"] = editConfig, _class4["show__head"] = showHeader, _class4["show__foot"] = showFooter, _class4["scroll__y"] = overflowY, _class4["scroll__x"] = overflowX, _class4["all-overflow"] = showOverflow, _class4["all-head-overflow"] = showHeaderOverflow, _class4["tiny-grid-cell__highlight"] = highlightCell, _class4["tiny-grid__animat"] = optimizeOpts.animat, _class4["tiny-grid__stripe"] = !isThemeSaas3 && stripe, _class4["tiny-grid__stripe-saas"] = isThemeSaas3 && stripeSaas, _class4["tiny-grid__border"] = border || isGroup2, _class4["tiny-grid__border-saas"] = isThemeSaas3 && borderSaas, _class4["tiny-grid__group-saas"] = isThemeSaas3 && isGroup2, _class4["tiny-grid__border-vertical"] = borderVertical, _class4["tiny-grid__checked"] = mouseConfig.checked, _class4["tiny-grid__hover-align"] = mouseConfig.hover, _class4["mark-insert"] = editConfig && editConfig.markInsert, _class4["edit__no-border"] = editConfig && editConfig.showBorder === false, _class4["is__loading"] = loading, _class4["row__highlight"] = highlightHoverRow, _class4["column__highlight"] = highlightHoverColumn, _class4["is__row-span"] = rowSpan && rowSpan.length > 0 || typeof spanMethod === "function", _class4["row__drop-handle--index"] = dropConfig.rowHandle === "index", _class4["fixed__sticky"] = horizonScroll.fixed, _class4)
|
|
11319
11543
|
}, [
|
|
11320
11544
|
// 隐藏列
|
|
11321
11545
|
h("div", {
|
|
@@ -11546,8 +11770,8 @@ var Column = defineComponent({
|
|
|
11546
11770
|
default: null
|
|
11547
11771
|
}
|
|
11548
11772
|
},
|
|
11549
|
-
setup: function setup7(props,
|
|
11550
|
-
var slots =
|
|
11773
|
+
setup: function setup7(props, _ref176) {
|
|
11774
|
+
var slots = _ref176.slots;
|
|
11551
11775
|
var reactive = hooks.reactive, inject = hooks.inject, getCurrentInstance = hooks.getCurrentInstance, onUpdated = hooks.onUpdated, watch = hooks.watch, nextTick = hooks.nextTick;
|
|
11552
11776
|
var currentInstance = getCurrentInstance();
|
|
11553
11777
|
var instance = currentInstance.proxy;
|
|
@@ -11601,7 +11825,7 @@ var Column = defineComponent({
|
|
|
11601
11825
|
warn("ui.grid.error.chainCallError");
|
|
11602
11826
|
}
|
|
11603
11827
|
var hasSubColumn = findTree(slotVnode, function(node) {
|
|
11604
|
-
var
|
|
11828
|
+
var _ref177 = node || {}, componentOptions = _ref177.componentOptions, type = _ref177.type;
|
|
11605
11829
|
var componentName = type && type.name || componentOptions && componentOptions.Ctor.extendOptions.name;
|
|
11606
11830
|
return $table.isValidCustomColumn(componentName);
|
|
11607
11831
|
}, null, null);
|
|
@@ -11679,7 +11903,13 @@ var Grid = defineComponent({
|
|
|
11679
11903
|
default: false
|
|
11680
11904
|
},
|
|
11681
11905
|
isMultipleHistory: Boolean,
|
|
11682
|
-
selectToolbar: [Boolean, Object]
|
|
11906
|
+
selectToolbar: [Boolean, Object],
|
|
11907
|
+
filterPopperOptions: {
|
|
11908
|
+
type: Object,
|
|
11909
|
+
default: function _default28() {
|
|
11910
|
+
return {};
|
|
11911
|
+
}
|
|
11912
|
+
}
|
|
11683
11913
|
}),
|
|
11684
11914
|
data: function data6() {
|
|
11685
11915
|
return {
|
|
@@ -11849,8 +12079,8 @@ var Grid = defineComponent({
|
|
|
11849
12079
|
var tinyTheme = hooks.ref(resolveTheme(props, context));
|
|
11850
12080
|
var tinyMode = hooks.ref(resolveMode(props, context));
|
|
11851
12081
|
var breakpoint = useBreakpoint();
|
|
11852
|
-
var renderless = function renderless2(props2, hooks2,
|
|
11853
|
-
var
|
|
12082
|
+
var renderless = function renderless2(props2, hooks2, _ref178) {
|
|
12083
|
+
var _ref178$designConfig = _ref178.designConfig, designConfig = _ref178$designConfig === void 0 ? null : _ref178$designConfig;
|
|
11854
12084
|
return {
|
|
11855
12085
|
tableListeners,
|
|
11856
12086
|
designConfig,
|
|
@@ -11957,8 +12187,8 @@ var Grid = defineComponent({
|
|
|
11957
12187
|
this.tasks.updateParentHeight();
|
|
11958
12188
|
},
|
|
11959
12189
|
// 向缓存添加实例
|
|
11960
|
-
connect: function connect2(
|
|
11961
|
-
var name =
|
|
12190
|
+
connect: function connect2(_ref179) {
|
|
12191
|
+
var name = _ref179.name, vm = _ref179.vm;
|
|
11962
12192
|
if (name && typeof name === "string" && vm) {
|
|
11963
12193
|
this.vmStore[name] = vm;
|
|
11964
12194
|
}
|
|
@@ -12030,30 +12260,25 @@ var Grid = defineComponent({
|
|
|
12030
12260
|
Grid.install = function(Vue) {
|
|
12031
12261
|
Vue.component(Grid.name, Grid);
|
|
12032
12262
|
};
|
|
12033
|
-
function operArrs(
|
|
12034
|
-
var _vm =
|
|
12263
|
+
function operArrs(_ref180) {
|
|
12264
|
+
var _vm = _ref180._vm, editStore = _ref180.editStore, newRecords = _ref180.newRecords, row2 = _ref180.row, tableFullData = _ref180.tableFullData;
|
|
12035
12265
|
if (row2 === -1) {
|
|
12036
|
-
Array.prototype.push.apply(nowData, newRecords);
|
|
12037
12266
|
Array.prototype.push.apply(tableFullData, newRecords);
|
|
12038
|
-
Array.prototype.push.apply(tableSourceData, newRecordsCopy);
|
|
12039
12267
|
}
|
|
12040
12268
|
if (row2 && row2 !== -1) {
|
|
12041
|
-
var
|
|
12042
|
-
if (
|
|
12269
|
+
var insertIndex = tableFullData.indexOf(row2);
|
|
12270
|
+
if (insertIndex === -1) {
|
|
12043
12271
|
throw new Error(error("ui.grid.error.unableInsert"));
|
|
12044
12272
|
}
|
|
12045
|
-
var insertIndex = tableFullData.indexOf(row2);
|
|
12046
|
-
Array.prototype.splice.apply(nowData, [targetIndex, 0].concat(newRecords));
|
|
12047
12273
|
Array.prototype.splice.apply(tableFullData, [insertIndex, 0].concat(newRecords));
|
|
12048
|
-
Array.prototype.splice.apply(tableSourceData, [insertIndex, 0].concat(newRecordsCopy));
|
|
12049
12274
|
}
|
|
12050
12275
|
if (!row2) {
|
|
12051
|
-
Array.prototype.unshift.apply(nowData, newRecords);
|
|
12052
12276
|
Array.prototype.unshift.apply(tableFullData, newRecords);
|
|
12053
|
-
Array.prototype.unshift.apply(tableSourceData, newRecordsCopy);
|
|
12054
12277
|
}
|
|
12055
12278
|
Array.prototype.unshift.apply(editStore.insertList, newRecords);
|
|
12056
|
-
|
|
12279
|
+
newRecords.forEach(function(row22) {
|
|
12280
|
+
return editStore.insertMap.set(getRowid(_vm, row22), row22);
|
|
12281
|
+
});
|
|
12057
12282
|
}
|
|
12058
12283
|
var _setActiveCell = function _setActiveCell2(row2, field) {
|
|
12059
12284
|
var _this52 = this;
|
|
@@ -12098,35 +12323,29 @@ var Methods$c = {
|
|
|
12098
12323
|
// 根据位置从指定行添加数据
|
|
12099
12324
|
_insertAt: function _insertAt(records, row2) {
|
|
12100
12325
|
var _this53 = this;
|
|
12101
|
-
var
|
|
12326
|
+
var editStore = this.editStore, isAsyncColumn = this.isAsyncColumn, scrollYLoad = this.scrollYLoad, tableFullData = this.tableFullData, treeConfig = this.treeConfig, visibleColumn = this.visibleColumn;
|
|
12102
12327
|
if (treeConfig) {
|
|
12103
12328
|
throw new Error(error("ui.grid.error.treeInsert"));
|
|
12104
12329
|
}
|
|
12105
|
-
if (isAsyncColumn) {
|
|
12106
|
-
var columnSet = this.getColumns();
|
|
12107
|
-
columnSet.forEach(function(column) {
|
|
12108
|
-
if (column.format && column.format.async && column.format.async.fetch) {
|
|
12109
|
-
records[GlobalConfig$1.constant.insertedField] = true;
|
|
12110
|
-
}
|
|
12111
|
-
});
|
|
12112
|
-
}
|
|
12113
12330
|
if (!isArray(records)) {
|
|
12114
12331
|
records = [records];
|
|
12115
12332
|
}
|
|
12116
|
-
var
|
|
12333
|
+
var isColumnFormat = isAsyncColumn && visibleColumn.some(function(column) {
|
|
12334
|
+
var _column$format, _column$format$async;
|
|
12335
|
+
return (_column$format = column.format) == null ? void 0 : (_column$format$async = _column$format.async) == null ? void 0 : _column$format$async.fetch;
|
|
12336
|
+
});
|
|
12337
|
+
var defaultRowId = "_RID";
|
|
12117
12338
|
var newRecords = records.map(function(record) {
|
|
12118
|
-
|
|
12339
|
+
isColumnFormat && (record[GlobalConfig$1.constant.insertedField] = true);
|
|
12340
|
+
delete record[defaultRowId];
|
|
12341
|
+
return hooks.reactive(_this53.defineField(Object.assign({}, record)));
|
|
12119
12342
|
});
|
|
12120
|
-
var newRecordsCopy = clone(newRecords, true);
|
|
12121
12343
|
operArrs({
|
|
12122
12344
|
_vm: this,
|
|
12123
12345
|
editStore,
|
|
12124
|
-
newRecords,
|
|
12125
|
-
newRecordsCopy,
|
|
12126
|
-
nowData,
|
|
12127
12346
|
row: row2,
|
|
12128
12347
|
tableFullData,
|
|
12129
|
-
|
|
12348
|
+
newRecords
|
|
12130
12349
|
});
|
|
12131
12350
|
this.updateCache();
|
|
12132
12351
|
this.handleTableData(true);
|
|
@@ -12151,9 +12370,9 @@ var Methods$c = {
|
|
|
12151
12370
|
*/
|
|
12152
12371
|
_remove: function _remove(rows) {
|
|
12153
12372
|
var _this54 = this;
|
|
12154
|
-
var afterFullData = this.afterFullData,
|
|
12155
|
-
var selection = this.selection, tableFullData = this.tableFullData, treeConfig = this.treeConfig
|
|
12156
|
-
var _this$editStore = this.editStore, insertList = _this$editStore.insertList, removeList = _this$editStore.removeList;
|
|
12373
|
+
var afterFullData = this.afterFullData, _this$selectConfig3 = this.selectConfig, selectConfig = _this$selectConfig3 === void 0 ? {} : _this$selectConfig3;
|
|
12374
|
+
var selection = this.selection, tableFullData = this.tableFullData, treeConfig = this.treeConfig;
|
|
12375
|
+
var _this$editStore = this.editStore, insertList = _this$editStore.insertList, insertMap = _this$editStore.insertMap, removeList = _this$editStore.removeList;
|
|
12157
12376
|
var checkField = selectConfig.checkField;
|
|
12158
12377
|
var nowData = afterFullData;
|
|
12159
12378
|
var rest = [];
|
|
@@ -12172,7 +12391,7 @@ var Methods$c = {
|
|
|
12172
12391
|
}
|
|
12173
12392
|
for (var i = 0; i < rows.length; i++) {
|
|
12174
12393
|
var row2 = rows[i];
|
|
12175
|
-
if (this.
|
|
12394
|
+
if (this.isTemporaryRow(row2)) continue;
|
|
12176
12395
|
removeList.push(row2);
|
|
12177
12396
|
}
|
|
12178
12397
|
if (!checkField) {
|
|
@@ -12192,23 +12411,15 @@ var Methods$c = {
|
|
|
12192
12411
|
return inArr(row3, rows);
|
|
12193
12412
|
});
|
|
12194
12413
|
}
|
|
12195
|
-
remove(tableSourceData, function(row3) {
|
|
12196
|
-
return find$1(insertList, function(r) {
|
|
12197
|
-
return getRowid(_this54, r) === getRowid(_this54, row3);
|
|
12198
|
-
}) && find$1(rows, function(r) {
|
|
12199
|
-
return getRowid(_this54, r) === getRowid(_this54, row3);
|
|
12200
|
-
});
|
|
12201
|
-
});
|
|
12202
12414
|
remove(insertList, function(row3) {
|
|
12203
|
-
|
|
12415
|
+
var exist = inArr(row3, rows);
|
|
12416
|
+
exist && insertMap.delete(getRowid(_this54, row3));
|
|
12417
|
+
return exist;
|
|
12204
12418
|
});
|
|
12205
12419
|
this.updateCache();
|
|
12206
12420
|
this.handleTableData(true);
|
|
12207
12421
|
this.checkSelectionStatus();
|
|
12208
12422
|
this.updateFooter();
|
|
12209
|
-
if (scrollYLoad) {
|
|
12210
|
-
this.updateScrollYSpace();
|
|
12211
|
-
}
|
|
12212
12423
|
var res = {
|
|
12213
12424
|
row: rows && rows.length ? rows[rows.length - 1] : null,
|
|
12214
12425
|
rows: rest
|
|
@@ -12242,12 +12453,12 @@ var Methods$c = {
|
|
|
12242
12453
|
* 如果还额外传了field则还原指定单元格。
|
|
12243
12454
|
*/
|
|
12244
12455
|
_revertData: function _revertData(rows, field) {
|
|
12245
|
-
var
|
|
12456
|
+
var rawData = this.rawData;
|
|
12246
12457
|
if (arguments.length && rows && !isArray(rows)) {
|
|
12247
12458
|
rows = [rows];
|
|
12248
12459
|
}
|
|
12249
12460
|
if (!arguments.length) {
|
|
12250
|
-
rows =
|
|
12461
|
+
rows = rawData || [];
|
|
12251
12462
|
}
|
|
12252
12463
|
for (var i = 0; i < rows.length; i++) {
|
|
12253
12464
|
var row2 = rows[i];
|
|
@@ -12264,7 +12475,7 @@ var Methods$c = {
|
|
|
12264
12475
|
if (arguments.length) {
|
|
12265
12476
|
return this.$nextTick();
|
|
12266
12477
|
}
|
|
12267
|
-
return this.reloadData(
|
|
12478
|
+
return this.reloadData(rawData || []);
|
|
12268
12479
|
},
|
|
12269
12480
|
/**
|
|
12270
12481
|
* 获取表格操作数据集
|
|
@@ -12321,7 +12532,7 @@ var Methods$c = {
|
|
|
12321
12532
|
editConfig,
|
|
12322
12533
|
row: row2
|
|
12323
12534
|
});
|
|
12324
|
-
if (!(editor && cell && isActiveCell)) {
|
|
12535
|
+
if (!(editor && cell && isActiveCell && editConfig)) {
|
|
12325
12536
|
_context.n = 2;
|
|
12326
12537
|
break;
|
|
12327
12538
|
}
|
|
@@ -12399,7 +12610,7 @@ var Methods$c = {
|
|
|
12399
12610
|
*/
|
|
12400
12611
|
_clearActived: function _clearActived(event) {
|
|
12401
12612
|
var _this58 = this;
|
|
12402
|
-
var _this$
|
|
12613
|
+
var _this$editConfig3 = this.editConfig, editConfig = _this$editConfig3 === void 0 ? {} : _this$editConfig3, editStore = this.editStore, tableColumn2 = this.tableColumn;
|
|
12403
12614
|
var actived = editStore.actived;
|
|
12404
12615
|
var args = actived.args, column = actived.column, row2 = actived.row;
|
|
12405
12616
|
var isActived = row2 || column;
|
|
@@ -12416,7 +12627,7 @@ var Methods$c = {
|
|
|
12416
12627
|
this.updateRowStatus(actived.row);
|
|
12417
12628
|
this.updateFooter();
|
|
12418
12629
|
var row22 = args.row, column2 = args.column;
|
|
12419
|
-
var
|
|
12630
|
+
var _ref181 = column2 || {}, editor = _ref181.editor;
|
|
12420
12631
|
if ((editor == null ? void 0 : editor.component) === "input" && (editor == null ? void 0 : (_editor$attrs = editor.attrs) == null ? void 0 : _editor$attrs.type) === "number") {
|
|
12421
12632
|
row22[column2.property] = +row22[column2.property];
|
|
12422
12633
|
}
|
|
@@ -12537,7 +12748,7 @@ var Methods$c = {
|
|
|
12537
12748
|
var _this60 = this;
|
|
12538
12749
|
var editConfig = this.editConfig, editStore = this.editStore, elemStore = this.elemStore, _this$mouseConfig3 = this.mouseConfig, mouseConfig = _this$mouseConfig3 === void 0 ? {} : _this$mouseConfig3;
|
|
12539
12750
|
var actived = editStore.actived, selected = editStore.selected;
|
|
12540
|
-
var
|
|
12751
|
+
var _ref182 = params || {}, cell = _ref182.cell, column = _ref182.column, row2 = _ref182.row;
|
|
12541
12752
|
var selectMethod = function selectMethod2() {
|
|
12542
12753
|
var _cell$parentNode;
|
|
12543
12754
|
if (selected.row === row2 && selected.column === column || actived.row === row2 && (editConfig.mode !== "cell" || actived.column === column)) {
|
|
@@ -12593,10 +12804,10 @@ function findLeft(params) {
|
|
|
12593
12804
|
targetRowIndex
|
|
12594
12805
|
};
|
|
12595
12806
|
}
|
|
12596
|
-
for (var
|
|
12597
|
-
if (checkColumn(visibleColumn[
|
|
12598
|
-
targetColumnIndex =
|
|
12599
|
-
targetColumn = visibleColumn[
|
|
12807
|
+
for (var _index5 = columnIndex - 1; _index5 >= 0; _index5--) {
|
|
12808
|
+
if (checkColumn(visibleColumn[_index5])) {
|
|
12809
|
+
targetColumnIndex = _index5;
|
|
12810
|
+
targetColumn = visibleColumn[_index5];
|
|
12600
12811
|
break;
|
|
12601
12812
|
}
|
|
12602
12813
|
}
|
|
@@ -12610,10 +12821,10 @@ function findLeft(params) {
|
|
|
12610
12821
|
}
|
|
12611
12822
|
targetRowIndex = rowIndex - 1;
|
|
12612
12823
|
targetRow = tableData[targetRowIndex];
|
|
12613
|
-
for (var
|
|
12614
|
-
if (checkColumn(visibleColumn[
|
|
12615
|
-
targetColumnIndex =
|
|
12616
|
-
targetColumn = visibleColumn[
|
|
12824
|
+
for (var _index6 = visibleColumn.length - 1; _index6 >= 0; _index6--) {
|
|
12825
|
+
if (checkColumn(visibleColumn[_index6])) {
|
|
12826
|
+
targetColumnIndex = _index6;
|
|
12827
|
+
targetColumn = visibleColumn[_index6];
|
|
12617
12828
|
break;
|
|
12618
12829
|
}
|
|
12619
12830
|
}
|
|
@@ -12635,10 +12846,10 @@ function findRight(params) {
|
|
|
12635
12846
|
targetRowIndex
|
|
12636
12847
|
};
|
|
12637
12848
|
}
|
|
12638
|
-
for (var
|
|
12639
|
-
if (checkColumn(visibleColumn[
|
|
12640
|
-
targetColumnIndex =
|
|
12641
|
-
targetColumn = visibleColumn[
|
|
12849
|
+
for (var _index7 = columnIndex + 1; _index7 < visibleColumn.length; _index7++) {
|
|
12850
|
+
if (checkColumn(visibleColumn[_index7])) {
|
|
12851
|
+
targetColumnIndex = _index7;
|
|
12852
|
+
targetColumn = visibleColumn[_index7];
|
|
12642
12853
|
break;
|
|
12643
12854
|
}
|
|
12644
12855
|
}
|
|
@@ -12652,10 +12863,10 @@ function findRight(params) {
|
|
|
12652
12863
|
}
|
|
12653
12864
|
targetRowIndex = rowIndex + 1;
|
|
12654
12865
|
targetRow = tableData[targetRowIndex];
|
|
12655
|
-
for (var
|
|
12656
|
-
if (checkColumn(visibleColumn[
|
|
12657
|
-
targetColumnIndex =
|
|
12658
|
-
targetColumn = visibleColumn[
|
|
12866
|
+
for (var _index8 = 0; _index8 < visibleColumn.length; _index8++) {
|
|
12867
|
+
if (checkColumn(visibleColumn[_index8])) {
|
|
12868
|
+
targetColumnIndex = _index8;
|
|
12869
|
+
targetColumn = visibleColumn[_index8];
|
|
12659
12870
|
break;
|
|
12660
12871
|
}
|
|
12661
12872
|
}
|
|
@@ -12718,7 +12929,7 @@ function handleCellMousedownEvent(args1) {
|
|
|
12718
12929
|
var $el = args1.$el, _vm = args1._vm, bodyList = args1.bodyList, cell = args1.cell, cellFirstElementChild = args1.cellFirstElementChild;
|
|
12719
12930
|
var cellLastElementChild = args1.cellLastElementChild, headStart = args1.headStart, headerList = args1.headerList, isIndex = args1.isIndex, startCellNode = args1.startCellNode;
|
|
12720
12931
|
var _vm$mouseConfig2 = _vm.mouseConfig, mouseConfig = _vm$mouseConfig2 === void 0 ? {} : _vm$mouseConfig2;
|
|
12721
|
-
var
|
|
12932
|
+
var _ref183 = mouseConfig || {}, _ref183$updateInterva = _ref183.updateInterval, updateInterval = _ref183$updateInterva === void 0 ? 10 : _ref183$updateInterva;
|
|
12722
12933
|
var oldMousemove = document.onmousemove;
|
|
12723
12934
|
var oldMouseup = document.onmouseup;
|
|
12724
12935
|
var updateEvent = function updateEvent2(event) {
|
|
@@ -12757,8 +12968,8 @@ function onCellMousedownSelectEditable(args) {
|
|
|
12757
12968
|
_vm.handleSelected(params, event);
|
|
12758
12969
|
}
|
|
12759
12970
|
}
|
|
12760
|
-
function onCellMousedownSelect(
|
|
12761
|
-
var _vm =
|
|
12971
|
+
function onCellMousedownSelect(_ref184) {
|
|
12972
|
+
var _vm = _ref184._vm, editConfig = _ref184.editConfig, event = _ref184.event, mouseConfig = _ref184.mouseConfig, params = _ref184.params;
|
|
12762
12973
|
if (!editConfig && mouseConfig.selected) {
|
|
12763
12974
|
_vm.handleSelected(params, event);
|
|
12764
12975
|
}
|
|
@@ -12777,8 +12988,8 @@ function onCellMousedownIndexColumn(args) {
|
|
|
12777
12988
|
_vm.handleIndexChecked(getRowNodes(bodyList, getCellNodeIndex(firstCell), getCellNodeIndex(cell)));
|
|
12778
12989
|
}
|
|
12779
12990
|
}
|
|
12780
|
-
function onCellMousedownNotIndexColumn(
|
|
12781
|
-
var _vm =
|
|
12991
|
+
function onCellMousedownNotIndexColumn(_ref185) {
|
|
12992
|
+
var _vm = _ref185._vm, cell = _ref185.cell, column = _ref185.column, event = _ref185.event, headerList = _ref185.headerList, isIndex = _ref185.isIndex, params = _ref185.params;
|
|
12782
12993
|
if (!isIndex) {
|
|
12783
12994
|
var firstCell = cell.parentNode.firstElementChild;
|
|
12784
12995
|
_vm.handleSelected(params, event);
|
|
@@ -12786,8 +12997,8 @@ function onCellMousedownNotIndexColumn(_ref186) {
|
|
|
12786
12997
|
_vm.handleIndexChecked([[firstCell]]);
|
|
12787
12998
|
}
|
|
12788
12999
|
}
|
|
12789
|
-
function handleHeaderCellMousedownEvent(
|
|
12790
|
-
var $el =
|
|
13000
|
+
function handleHeaderCellMousedownEvent(_ref186) {
|
|
13001
|
+
var $el = _ref186.$el, _vm = _ref186._vm, bodyList = _ref186.bodyList, cell = _ref186.cell, headerList = _ref186.headerList, startCell = _ref186.startCell;
|
|
12791
13002
|
var oldMousemove = document.onmousemove;
|
|
12792
13003
|
var oldMouseup = document.onmouseup;
|
|
12793
13004
|
var updateEvent = function updateEvent2(event) {
|
|
@@ -12820,8 +13031,8 @@ var removeCellClass = function removeCellClass2(bodyRef, clazz) {
|
|
|
12820
13031
|
return removeClass(elem, clazz);
|
|
12821
13032
|
});
|
|
12822
13033
|
};
|
|
12823
|
-
var getCellIndex = function getCellIndex2(
|
|
12824
|
-
var cell =
|
|
13034
|
+
var getCellIndex = function getCellIndex2(_ref187) {
|
|
13035
|
+
var cell = _ref187.cell, bodyList = _ref187.bodyList;
|
|
12825
13036
|
var trElem = cell.parentNode;
|
|
12826
13037
|
var cIndex = arrayIndexOf(trElem.children, cell);
|
|
12827
13038
|
var rIndex = arrayIndexOf(bodyList, trElem);
|
|
@@ -12830,8 +13041,8 @@ var getCellIndex = function getCellIndex2(_ref188) {
|
|
|
12830
13041
|
cIndex
|
|
12831
13042
|
};
|
|
12832
13043
|
};
|
|
12833
|
-
var getModify = function getModify2(
|
|
12834
|
-
var offsetTop =
|
|
13044
|
+
var getModify = function getModify2(_ref188) {
|
|
13045
|
+
var offsetTop = _ref188.offsetTop, offsetLeft = _ref188.offsetLeft, cWidth = _ref188.cWidth, cHeight = _ref188.cHeight;
|
|
12835
13046
|
var modifyDomStyle = function modifyDomStyle2(dom, styleOptions) {
|
|
12836
13047
|
return dom && Object.assign(dom.style, styleOptions);
|
|
12837
13048
|
};
|
|
@@ -12858,8 +13069,8 @@ var getModify = function getModify2(_ref189) {
|
|
|
12858
13069
|
});
|
|
12859
13070
|
};
|
|
12860
13071
|
};
|
|
12861
|
-
var writeClipboardText = function writeClipboardText2(
|
|
12862
|
-
var $table =
|
|
13072
|
+
var writeClipboardText = function writeClipboardText2(_ref189) {
|
|
13073
|
+
var $table = _ref189.$table, columns2 = _ref189.columns, rows = _ref189.rows, rowNodes = _ref189.rowNodes;
|
|
12863
13074
|
var _$table$keyboardConfi = $table.keyboardConfig, keyboardConfig = _$table$keyboardConfi === void 0 ? {} : _$table$keyboardConfi;
|
|
12864
13075
|
var _keyboardConfig$clipb = keyboardConfig.clipboard, clipboard = _keyboardConfig$clipb === void 0 ? {} : _keyboardConfig$clipb;
|
|
12865
13076
|
var writeMethod = clipboard.writeMethod, _clipboard$cellSplit = clipboard.cellSplit, cellSplit = _clipboard$cellSplit === void 0 ? "," : _clipboard$cellSplit, _clipboard$rowSplit = clipboard.rowSplit, rowSplit = _clipboard$rowSplit === void 0 ? ";" : _clipboard$rowSplit;
|
|
@@ -12906,7 +13117,7 @@ var Methods$b = {
|
|
|
12906
13117
|
var params = _extends({}, args);
|
|
12907
13118
|
var columnIndex = visibleColumn.indexOf(params.column);
|
|
12908
13119
|
var rowIndex = tableData.indexOf(params.row);
|
|
12909
|
-
var
|
|
13120
|
+
var _ref190 = {}, targetColumn = _ref190.targetColumn, targetColumnIndex = _ref190.targetColumnIndex, targetRow = _ref190.targetRow, targetRowIndex = _ref190.targetRowIndex;
|
|
12910
13121
|
event.preventDefault();
|
|
12911
13122
|
var checkColumn = function checkColumn2(column) {
|
|
12912
13123
|
return !hasIndexColumn2(column) && (edit ? column.editor : true);
|
|
@@ -13000,9 +13211,9 @@ var Methods$b = {
|
|
|
13000
13211
|
}
|
|
13001
13212
|
},
|
|
13002
13213
|
// 可编辑方向键移动处理
|
|
13003
|
-
moveSelected: function moveSelected(
|
|
13214
|
+
moveSelected: function moveSelected(_ref191) {
|
|
13004
13215
|
var _this62 = this;
|
|
13005
|
-
var args =
|
|
13216
|
+
var args = _ref191.args, isLeftArrow = _ref191.isLeftArrow, isUpArrow = _ref191.isUpArrow, isRightArrow = _ref191.isRightArrow, isDownArrow = _ref191.isDownArrow, event = _ref191.event;
|
|
13006
13217
|
var hasIndexColumn2 = this.hasIndexColumn, visibleColumn = this.tableColumn, tableData = this.tableFullData;
|
|
13007
13218
|
var params = _extends({}, args);
|
|
13008
13219
|
var column = params.column;
|
|
@@ -13224,7 +13435,7 @@ var Methods$b = {
|
|
|
13224
13435
|
_getMouseCheckeds: function _getMouseCheckeds() {
|
|
13225
13436
|
var _this64 = this;
|
|
13226
13437
|
var _this$editStore$check = this.editStore.checked.rowNodes, rowNodes = _this$editStore$check === void 0 ? [] : _this$editStore$check;
|
|
13227
|
-
var
|
|
13438
|
+
var _ref192 = {}, _ref192$rows = _ref192.rows, rows = _ref192$rows === void 0 ? [] : _ref192$rows, _ref192$columns = _ref192.columns, columns2 = _ref192$columns === void 0 ? [] : _ref192$columns;
|
|
13228
13439
|
var res = {
|
|
13229
13440
|
rows,
|
|
13230
13441
|
columns: columns2,
|
|
@@ -13253,7 +13464,7 @@ var Methods$b = {
|
|
|
13253
13464
|
if (!mouseConfig || !mouseConfig.checked) {
|
|
13254
13465
|
return;
|
|
13255
13466
|
}
|
|
13256
|
-
var
|
|
13467
|
+
var _ref193 = {}, cHeight = _ref193.cHeight, cWidth = _ref193.cWidth, offsetLeft = _ref193.offsetLeft, offsetTop = _ref193.offsetTop;
|
|
13257
13468
|
cWidth = cHeight = -2;
|
|
13258
13469
|
offsetTop = offsetLeft = 0;
|
|
13259
13470
|
this.clearChecked();
|
|
@@ -13382,7 +13593,7 @@ var Methods$b = {
|
|
|
13382
13593
|
var editStore = this.editStore, tableColumn2 = this.tableColumn, tableData = this.tableData;
|
|
13383
13594
|
var copyed = editStore.copyed;
|
|
13384
13595
|
var rowNodes = editStore.checked.rowNodes;
|
|
13385
|
-
var
|
|
13596
|
+
var _ref194 = {}, cHeight = _ref194.cHeight, cWidth = _ref194.cWidth, offsetLeft = _ref194.offsetLeft, offsetTop = _ref194.offsetTop, _ref194$rows = _ref194.rows, rows = _ref194$rows === void 0 ? [] : _ref194$rows, _ref194$columns = _ref194.columns, columns2 = _ref194$columns === void 0 ? [] : _ref194$columns;
|
|
13386
13597
|
cWidth = cHeight = -3;
|
|
13387
13598
|
offsetTop = offsetLeft = 0;
|
|
13388
13599
|
this.clearCopyed();
|
|
@@ -13505,13 +13716,13 @@ function adjustParams(rows, cb, vaildDatas) {
|
|
|
13505
13716
|
vaildDatas
|
|
13506
13717
|
};
|
|
13507
13718
|
}
|
|
13508
|
-
var columnHandler = function columnHandler2(
|
|
13509
|
-
var _vm =
|
|
13719
|
+
var columnHandler = function columnHandler2(_ref195) {
|
|
13720
|
+
var _vm = _ref195._vm, colValidPromiseArr = _ref195.colValidPromiseArr, editRules = _ref195.editRules, isAll = _ref195.isAll, row2 = _ref195.row, validRest = _ref195.validRest;
|
|
13510
13721
|
return function(column, columnIndex) {
|
|
13511
13722
|
if (has(editRules, column.property)) {
|
|
13512
13723
|
colValidPromiseArr.push(new Promise(function(resolve, reject) {
|
|
13513
|
-
_vm.validCellRules("all", row2, column).then(resolve).catch(function(
|
|
13514
|
-
var rule =
|
|
13724
|
+
_vm.validCellRules("all", row2, column).then(resolve).catch(function(_ref196) {
|
|
13725
|
+
var rule = _ref196.rule, rules = _ref196.rules;
|
|
13515
13726
|
var rowIndex = _vm.getRowIndex(row2);
|
|
13516
13727
|
var rest = {
|
|
13517
13728
|
rule,
|
|
@@ -13535,8 +13746,8 @@ var columnHandler = function columnHandler2(_ref196) {
|
|
|
13535
13746
|
}
|
|
13536
13747
|
};
|
|
13537
13748
|
};
|
|
13538
|
-
function validTree(
|
|
13539
|
-
var treeConfig =
|
|
13749
|
+
function validTree(_ref197) {
|
|
13750
|
+
var treeConfig = _ref197.treeConfig, handleVaild = _ref197.handleVaild, hasTreeExpand2 = _ref197.hasTreeExpand, vaildDatas = _ref197.vaildDatas, treeOpts = _ref197.treeOpts;
|
|
13540
13751
|
if (treeConfig.validHidden === false) {
|
|
13541
13752
|
var _recurValid = function recurValid(row2) {
|
|
13542
13753
|
var children = row2[treeConfig.children || "children"];
|
|
@@ -13550,8 +13761,8 @@ function validTree(_ref198) {
|
|
|
13550
13761
|
eachTree(vaildDatas, handleVaild, treeOpts);
|
|
13551
13762
|
}
|
|
13552
13763
|
}
|
|
13553
|
-
var realValid = function realValid2(
|
|
13554
|
-
var _vm =
|
|
13764
|
+
var realValid = function realValid2(_ref198) {
|
|
13765
|
+
var _vm = _ref198._vm, editRules = _ref198.editRules, isAll = _ref198.isAll, validRest = _ref198.validRest, treeConfig = _ref198.treeConfig, hasTreeExpand2 = _ref198.hasTreeExpand, vaildDatas = _ref198.vaildDatas, treeOpts = _ref198.treeOpts;
|
|
13555
13766
|
var rowValids = [];
|
|
13556
13767
|
var columns2 = _vm.getColumns();
|
|
13557
13768
|
var handleVaild = function handleVaild2(row2) {
|
|
@@ -13603,8 +13814,8 @@ var Rule = /* @__PURE__ */ (function() {
|
|
|
13603
13814
|
var onRejected = function onRejected2(opt, _this) {
|
|
13604
13815
|
var isAll = opt.isAll, validRest = opt.validRest, cb = opt.cb, afterFullData = opt.afterFullData, treeConfig = opt.treeConfig;
|
|
13605
13816
|
return function(params) {
|
|
13606
|
-
var
|
|
13607
|
-
var args = isAll ? validRest : (
|
|
13817
|
+
var _ref199;
|
|
13818
|
+
var args = isAll ? validRest : (_ref199 = {}, _ref199[params.column.property] = params, _ref199);
|
|
13608
13819
|
var funcFinish = function funcFinish2(args2, reject, resolve) {
|
|
13609
13820
|
return function() {
|
|
13610
13821
|
opt.status = false;
|
|
@@ -13671,10 +13882,10 @@ var Methods$a = {
|
|
|
13671
13882
|
},
|
|
13672
13883
|
validatePromise: function validatePromise(row2, column, columnIndex, isAll, validRest) {
|
|
13673
13884
|
var _this67 = this;
|
|
13674
|
-
function onrejected(
|
|
13675
|
-
var _vm =
|
|
13676
|
-
return function(
|
|
13677
|
-
var rule =
|
|
13885
|
+
function onrejected(_ref201) {
|
|
13886
|
+
var _vm = _ref201._vm, reject = _ref201.reject, resolve = _ref201.resolve;
|
|
13887
|
+
return function(_ref202) {
|
|
13888
|
+
var rule = _ref202.rule, rules = _ref202.rules;
|
|
13678
13889
|
var rest = {
|
|
13679
13890
|
$table: _vm,
|
|
13680
13891
|
column,
|
|
@@ -13710,7 +13921,7 @@ var Methods$a = {
|
|
|
13710
13921
|
*/
|
|
13711
13922
|
beginValidate: function beginValidate(rows, callback, isAll) {
|
|
13712
13923
|
var afterFullData = this.afterFullData, editRules = this.editRules, hasTreeExpand2 = this.hasTreeExpand, treeConfig = this.treeConfig, treeOpts = this.treeOpts;
|
|
13713
|
-
var
|
|
13924
|
+
var _ref203 = {}, _ref203$status = _ref203.status, status = _ref203$status === void 0 ? true : _ref203$status, _ref203$validRest = _ref203.validRest, validRest = _ref203$validRest === void 0 ? {} : _ref203$validRest;
|
|
13714
13925
|
var _adjustParams = adjustParams(rows, callback, afterFullData), vaildDatas = _adjustParams.vaildDatas, cb = _adjustParams.cb;
|
|
13715
13926
|
var opt = {
|
|
13716
13927
|
isAll,
|
|
@@ -13748,8 +13959,8 @@ var Methods$a = {
|
|
|
13748
13959
|
};
|
|
13749
13960
|
return Promise.all(rowValids).then(onFulfilled).catch(onRejected(opt, this));
|
|
13750
13961
|
},
|
|
13751
|
-
hasCellRules: function hasCellRules(type, row2,
|
|
13752
|
-
var property =
|
|
13962
|
+
hasCellRules: function hasCellRules(type, row2, _ref204) {
|
|
13963
|
+
var property = _ref204.property;
|
|
13753
13964
|
if (!property || !this.editRules) {
|
|
13754
13965
|
return false;
|
|
13755
13966
|
}
|
|
@@ -13782,7 +13993,7 @@ var Methods$a = {
|
|
|
13782
13993
|
var _this68 = this;
|
|
13783
13994
|
var editRules = this.editRules, rowId = this.rowId;
|
|
13784
13995
|
var property = column.property;
|
|
13785
|
-
var
|
|
13996
|
+
var _ref205 = {}, _ref205$descriptor = _ref205.descriptor, descriptor = _ref205$descriptor === void 0 ? {} : _ref205$descriptor, _ref205$model = _ref205.model, model = _ref205$model === void 0 ? {} : _ref205$model;
|
|
13786
13997
|
if (property && editRules) {
|
|
13787
13998
|
var rules = get(editRules, property);
|
|
13788
13999
|
var cellValue = isUndefined(defaultValue) ? get(row2, property) : defaultValue;
|
|
@@ -13807,8 +14018,8 @@ var Methods$a = {
|
|
|
13807
14018
|
column
|
|
13808
14019
|
}
|
|
13809
14020
|
};
|
|
13810
|
-
var onRejected3 = function onRejected32(
|
|
13811
|
-
var fields =
|
|
14021
|
+
var onRejected3 = function onRejected32(_ref206) {
|
|
14022
|
+
var fields = _ref206.fields;
|
|
13812
14023
|
var cellErrors = Object.keys(fields).map(function(prop) {
|
|
13813
14024
|
var rules2 = _descriptor[prop];
|
|
13814
14025
|
_descriptor[prop] = !rules2.message ? Object.assign(rules2, {
|
|
@@ -13867,8 +14078,8 @@ var Methods$a = {
|
|
|
13867
14078
|
var onfulfilled = function onfulfilled2() {
|
|
13868
14079
|
editConfig.mode === "row" && validStore.visible && validStore.row === row2 && validStore.column === column && _this69.clearValidate();
|
|
13869
14080
|
};
|
|
13870
|
-
var onrejected = function onrejected2(
|
|
13871
|
-
var rule =
|
|
14081
|
+
var onrejected = function onrejected2(_ref207) {
|
|
14082
|
+
var rule = _ref207.rule;
|
|
13872
14083
|
if (rule.trigger && type !== rule.trigger) {
|
|
13873
14084
|
return Promise.resolve();
|
|
13874
14085
|
}
|
|
@@ -13962,7 +14173,7 @@ var Methods$8 = {
|
|
|
13962
14173
|
initFetchOption: function initFetchOption() {
|
|
13963
14174
|
var _this$fetchData = this.fetchData, fetchData = _this$fetchData === void 0 ? {} : _this$fetchData, _this$dataset = this.dataset, dataset = _this$dataset === void 0 ? {} : _this$dataset;
|
|
13964
14175
|
if (fetchData.api || dataset.source || dataset.value || dataset.api) {
|
|
13965
|
-
var
|
|
14176
|
+
var _ref208 = fetchData || dataset.source || dataset.api || {}, loading = _ref208.loading, fields = _ref208.fields, api = _ref208.api, reloadConfig = _ref208.reloadConfig;
|
|
13966
14177
|
var isReloadFilter = false;
|
|
13967
14178
|
var isReloadScroll = false;
|
|
13968
14179
|
if (reloadConfig) {
|
|
@@ -14000,7 +14211,7 @@ var Methods$8 = {
|
|
|
14000
14211
|
error("ui.grid.error.notQuery");
|
|
14001
14212
|
return this.$nextTick();
|
|
14002
14213
|
}
|
|
14003
|
-
var
|
|
14214
|
+
var _ref209 = fetchData || dataset.source || dataset.api || {}, args = _ref209.args, loading = _ref209.loading;
|
|
14004
14215
|
var field = sortData.field, order = sortData.order, prop = sortData.prop, property = sortData.property;
|
|
14005
14216
|
var sortByData = {
|
|
14006
14217
|
field,
|
|
@@ -14108,8 +14319,8 @@ var Methods$7 = {
|
|
|
14108
14319
|
}
|
|
14109
14320
|
},
|
|
14110
14321
|
// 表格内置分页渲染器
|
|
14111
|
-
renderPager: function renderPager(
|
|
14112
|
-
var $slots =
|
|
14322
|
+
renderPager: function renderPager(_ref210) {
|
|
14323
|
+
var $slots = _ref210.$slots, _vm = _ref210._vm, loading = _ref210.loading, pager = _ref210.pager, pagerConfig = _ref210.pagerConfig, tableLoading = _ref210.tableLoading, vSize3 = _ref210.vSize;
|
|
14113
14324
|
var res = null;
|
|
14114
14325
|
var fetchData = _vm.fetchData;
|
|
14115
14326
|
if ($slots.pager) {
|
|
@@ -14203,8 +14414,8 @@ var Pager = {
|
|
|
14203
14414
|
Object.assign(host.methods, Methods$7);
|
|
14204
14415
|
}
|
|
14205
14416
|
};
|
|
14206
|
-
function setBodyRecords(
|
|
14207
|
-
var body =
|
|
14417
|
+
function setBodyRecords(_ref211) {
|
|
14418
|
+
var body = _ref211.body, insertRecords = _ref211.insertRecords, pendingRecords = _ref211.pendingRecords;
|
|
14208
14419
|
if (insertRecords.length) {
|
|
14209
14420
|
body.pendingRecords = pendingRecords.filter(function(row2) {
|
|
14210
14421
|
return !insertRecords.includes(row2);
|
|
@@ -14219,8 +14430,8 @@ function setBodyRecords(_ref212) {
|
|
|
14219
14430
|
function canInvokeSaveDataApi(body, removeRecords, updateRecords) {
|
|
14220
14431
|
return body.insertRecords.length || removeRecords.length || updateRecords.length || body.pendingRecords.length;
|
|
14221
14432
|
}
|
|
14222
|
-
function doRemoveOrShowMsg(
|
|
14223
|
-
var _vm =
|
|
14433
|
+
function doRemoveOrShowMsg(_ref212) {
|
|
14434
|
+
var _vm = _ref212._vm, canInvoke = _ref212.canInvoke, code = _ref212.code, isMsg2 = _ref212.isMsg, pendingRecords = _ref212.pendingRecords, resolve = _ref212.resolve, valid = _ref212.valid;
|
|
14224
14435
|
if (valid && !canInvoke) {
|
|
14225
14436
|
if (isMsg2) {
|
|
14226
14437
|
if (pendingRecords.length) {
|
|
@@ -14236,8 +14447,8 @@ function doRemoveOrShowMsg(_ref213) {
|
|
|
14236
14447
|
resolve();
|
|
14237
14448
|
}
|
|
14238
14449
|
}
|
|
14239
|
-
function invokeSaveDataApi(
|
|
14240
|
-
var _vm =
|
|
14450
|
+
function invokeSaveDataApi(_ref213) {
|
|
14451
|
+
var _vm = _ref213._vm, args = _ref213.args, body = _ref213.body, code = _ref213.code, removeRecords = _ref213.removeRecords, resolve = _ref213.resolve, saveData = _ref213.saveData, updateRecords = _ref213.updateRecords, valid = _ref213.valid;
|
|
14241
14452
|
var canInvoke = false;
|
|
14242
14453
|
if (valid) {
|
|
14243
14454
|
canInvoke = canInvokeSaveDataApi(body, removeRecords, updateRecords);
|
|
@@ -14264,8 +14475,8 @@ function invokeSaveDataApi(_ref214) {
|
|
|
14264
14475
|
}
|
|
14265
14476
|
var Methods$6 = {
|
|
14266
14477
|
// 表格工具栏渲染器
|
|
14267
|
-
getRenderedToolbar: function getRenderedToolbar(
|
|
14268
|
-
var $slots =
|
|
14478
|
+
getRenderedToolbar: function getRenderedToolbar(_ref214) {
|
|
14479
|
+
var $slots = _ref214.$slots, _vm = _ref214._vm, loading = _ref214.loading, tableLoading = _ref214.tableLoading, toolbar = _ref214.toolbar;
|
|
14269
14480
|
return _vm.renderedToolbar = (function() {
|
|
14270
14481
|
var res = null;
|
|
14271
14482
|
if ($slots.toolbar) {
|
|
@@ -14367,9 +14578,9 @@ var Methods$6 = {
|
|
|
14367
14578
|
};
|
|
14368
14579
|
this.remove(selecteds).then(afterRemove);
|
|
14369
14580
|
},
|
|
14370
|
-
handleFullScreen: function handleFullScreen(
|
|
14581
|
+
handleFullScreen: function handleFullScreen(_ref215) {
|
|
14371
14582
|
var _this77 = this;
|
|
14372
|
-
var show2 =
|
|
14583
|
+
var show2 = _ref215[0];
|
|
14373
14584
|
this.fullScreenClass = show2 ? "tiny-fullscreen-full" : "";
|
|
14374
14585
|
this.$nextTick(function() {
|
|
14375
14586
|
_this77.recalculate();
|
|
@@ -14386,8 +14597,8 @@ var Methods$6 = {
|
|
|
14386
14597
|
if (code === "insert") {
|
|
14387
14598
|
this.insert();
|
|
14388
14599
|
} else if (code === "insert_actived") {
|
|
14389
|
-
this.insert().then(function(
|
|
14390
|
-
var row2 =
|
|
14600
|
+
this.insert().then(function(_ref216) {
|
|
14601
|
+
var row2 = _ref216.row;
|
|
14391
14602
|
return _this78.setActiveRow(row2);
|
|
14392
14603
|
});
|
|
14393
14604
|
} else if (code === "mark_cancel") {
|
|
@@ -14474,7 +14685,7 @@ var Methods$6 = {
|
|
|
14474
14685
|
});
|
|
14475
14686
|
}
|
|
14476
14687
|
if (selecteds.length) {
|
|
14477
|
-
var
|
|
14688
|
+
var _ref217 = {}, _ref217$plus = _ref217.plus, plus = _ref217$plus === void 0 ? [] : _ref217$plus, _ref217$minus = _ref217.minus, minus = _ref217$minus === void 0 ? [] : _ref217$minus, tmp = _ref217.tmp;
|
|
14478
14689
|
selecteds.forEach(function(data7) {
|
|
14479
14690
|
var selectedPending = pendings.includes(data7);
|
|
14480
14691
|
tmp = selectedPending ? minus : plus;
|
|
@@ -14497,8 +14708,8 @@ var Toolbar = {
|
|
|
14497
14708
|
};
|
|
14498
14709
|
var Methods$5 = {
|
|
14499
14710
|
renderColumnAnchor: function renderColumnAnchor(params, _vm) {
|
|
14500
|
-
var
|
|
14501
|
-
} :
|
|
14711
|
+
var _ref218 = params || {}, _ref218$anchors = _ref218.anchors, anchors = _ref218$anchors === void 0 ? [] : _ref218$anchors, _ref218$action = _ref218.action, action = _ref218$action === void 0 ? function() {
|
|
14712
|
+
} : _ref218$action;
|
|
14502
14713
|
var viewType2 = _vm.viewType;
|
|
14503
14714
|
return h("div", {
|
|
14504
14715
|
class: ["tiny-grid__column-anchor", _vm.viewCls("columnAnchor")],
|
|
@@ -14533,8 +14744,8 @@ var Methods$5 = {
|
|
|
14533
14744
|
}, [iconVnode, spanVnode]);
|
|
14534
14745
|
}));
|
|
14535
14746
|
},
|
|
14536
|
-
buildColumnAnchor: function buildColumnAnchor(
|
|
14537
|
-
var property =
|
|
14747
|
+
buildColumnAnchor: function buildColumnAnchor(_ref219) {
|
|
14748
|
+
var property = _ref219.property, label = _ref219.label, anchors = _ref219.anchors, activeAnchor = _ref219.activeAnchor;
|
|
14538
14749
|
var visibleColumn = this.getColumns();
|
|
14539
14750
|
var column = visibleColumn.find(function(col) {
|
|
14540
14751
|
return !col.type && col.property === property;
|
|
@@ -14625,8 +14836,8 @@ var Methods$5 = {
|
|
|
14625
14836
|
}, activeAnchor.delay);
|
|
14626
14837
|
};
|
|
14627
14838
|
},
|
|
14628
|
-
anchorAction: function anchorAction(
|
|
14629
|
-
var field =
|
|
14839
|
+
anchorAction: function anchorAction(_ref220) {
|
|
14840
|
+
var field = _ref220.field, anchors = _ref220.anchors, _vm = _ref220._vm;
|
|
14630
14841
|
var fromAnchor = anchors.find(function(anchor) {
|
|
14631
14842
|
return anchor.active;
|
|
14632
14843
|
});
|
|
@@ -14672,8 +14883,8 @@ var ColumnAnchor = {
|
|
|
14672
14883
|
Object.assign(host.methods, Methods$5);
|
|
14673
14884
|
}
|
|
14674
14885
|
};
|
|
14675
|
-
var createHandlerOnEnd = function createHandlerOnEnd2(
|
|
14676
|
-
var _vm =
|
|
14886
|
+
var createHandlerOnEnd = function createHandlerOnEnd2(_ref221) {
|
|
14887
|
+
var _vm = _ref221._vm, refresh = _ref221.refresh;
|
|
14677
14888
|
return function(event) {
|
|
14678
14889
|
var insertRecords = _vm.getInsertRecords();
|
|
14679
14890
|
if (insertRecords.length) {
|
|
@@ -14685,7 +14896,7 @@ var createHandlerOnEnd = function createHandlerOnEnd2(_ref222) {
|
|
|
14685
14896
|
var targetTrElem = event.item;
|
|
14686
14897
|
var wrapperElem = targetTrElem.parentNode, prevEl = targetTrElem.previousElementSibling, nextEl = targetTrElem.nextElementSibling;
|
|
14687
14898
|
var prevTrElem = prevEl && prevEl.classList.contains("tiny-grid-body__row") ? prevEl : prevEl && prevEl.previousElementSibling;
|
|
14688
|
-
var tableTreeData = _vm.
|
|
14899
|
+
var tableTreeData = _vm.rawData || _vm.tableData;
|
|
14689
14900
|
var selfRow = _vm.getRowNode(targetTrElem).item;
|
|
14690
14901
|
var selfNode = findTree$1(tableTreeData, function(row2) {
|
|
14691
14902
|
return row2 === selfRow;
|
|
@@ -14719,7 +14930,7 @@ var createHandlerOnEnd = function createHandlerOnEnd2(_ref222) {
|
|
|
14719
14930
|
_vm.tableFullData = [].concat(tableTreeData);
|
|
14720
14931
|
}
|
|
14721
14932
|
_vm.$emit("row-drop-end", event, _vm, _vm.scrollYLoad ? tableTreeData : _vm.tableFullData);
|
|
14722
|
-
refresh && _vm.
|
|
14933
|
+
refresh && _vm.rawData && _vm.refreshData(_vm.rawData);
|
|
14723
14934
|
};
|
|
14724
14935
|
};
|
|
14725
14936
|
var getSortColumns = function getSortColumns2(columns2) {
|
|
@@ -14742,7 +14953,7 @@ var Methods$4 = {
|
|
|
14742
14953
|
// 处理列拖拽
|
|
14743
14954
|
columnDrop: function columnDrop(headerEl) {
|
|
14744
14955
|
var _this80 = this;
|
|
14745
|
-
var
|
|
14956
|
+
var _ref222 = this.dropConfig || {}, plugin = _ref222.plugin, onBeforeMove = _ref222.onBeforeMove, filter2 = _ref222.filter;
|
|
14746
14957
|
var columnDropContainer = headerEl.querySelector(".tiny-grid-header__row");
|
|
14747
14958
|
var columnDropOptions = _extends({}, this.dropConfig, {
|
|
14748
14959
|
handle: ".tiny-grid-header__column:not(.col__fixed)",
|
|
@@ -14835,8 +15046,8 @@ var Sort = {
|
|
|
14835
15046
|
Object.assign(host.methods, Methods$3);
|
|
14836
15047
|
}
|
|
14837
15048
|
};
|
|
14838
|
-
function createTooltipRange(
|
|
14839
|
-
var _vm =
|
|
15049
|
+
function createTooltipRange(_ref223) {
|
|
15050
|
+
var _vm = _ref223._vm, cell = _ref223.cell, column = _ref223.column, isHeader = _ref223.isHeader;
|
|
14840
15051
|
var range = document.createRange();
|
|
14841
15052
|
var rangeEnd;
|
|
14842
15053
|
range.setStart(cell, 0);
|
|
@@ -14854,8 +15065,8 @@ function createTooltipRange(_ref224) {
|
|
|
14854
15065
|
range.setEnd(cell, rangeEnd);
|
|
14855
15066
|
return range;
|
|
14856
15067
|
}
|
|
14857
|
-
function processContentMethod(
|
|
14858
|
-
var _vm =
|
|
15068
|
+
function processContentMethod(_ref224) {
|
|
15069
|
+
var _vm = _ref224._vm, column = _ref224.column, content = _ref224.content, contentMethod = _ref224.contentMethod, event = _ref224.event, isHeader = _ref224.isHeader, row2 = _ref224.row, showTip = _ref224.showTip;
|
|
14859
15070
|
if (contentMethod) {
|
|
14860
15071
|
_vm.tooltipContent = contentMethod({
|
|
14861
15072
|
event,
|
|
@@ -15007,15 +15218,15 @@ var Tooltip = {
|
|
|
15007
15218
|
Object.assign(host.methods, Methods$2);
|
|
15008
15219
|
}
|
|
15009
15220
|
};
|
|
15010
|
-
function onHalfSelectionProperty(
|
|
15011
|
-
var checkStrictly =
|
|
15221
|
+
function onHalfSelectionProperty(_ref225) {
|
|
15222
|
+
var checkStrictly = _ref225.checkStrictly, property = _ref225.property, row2 = _ref225.row, treeConfig = _ref225.treeConfig, treeIndeterminates = _ref225.treeIndeterminates, value = _ref225.value;
|
|
15012
15223
|
if (property && treeConfig && !checkStrictly && value === -1) {
|
|
15013
15224
|
treeIndeterminates.push(row2);
|
|
15014
15225
|
set(row2, property, false);
|
|
15015
15226
|
}
|
|
15016
15227
|
}
|
|
15017
|
-
function onFullSelectionProperty(
|
|
15018
|
-
var checkMethod =
|
|
15228
|
+
function onFullSelectionProperty(_ref226) {
|
|
15229
|
+
var checkMethod = _ref226.checkMethod, checkStrictly = _ref226.checkStrictly, property = _ref226.property, row2 = _ref226.row, treeConfig = _ref226.treeConfig, treeIndeterminates = _ref226.treeIndeterminates, value = _ref226.value;
|
|
15019
15230
|
if (property && treeConfig && !checkStrictly && value !== -1) {
|
|
15020
15231
|
eachTree([row2], function(item, $rowIndex) {
|
|
15021
15232
|
if (row2 === item || !checkMethod || checkMethod({
|
|
@@ -15030,8 +15241,8 @@ function onFullSelectionProperty(_ref227) {
|
|
|
15030
15241
|
}, treeConfig);
|
|
15031
15242
|
}
|
|
15032
15243
|
}
|
|
15033
|
-
function getVItemsOnParentSlctProp(
|
|
15034
|
-
var checkMethod =
|
|
15244
|
+
function getVItemsOnParentSlctProp(_ref227) {
|
|
15245
|
+
var checkMethod = _ref227.checkMethod, matchObj = _ref227.matchObj;
|
|
15035
15246
|
var tinyItems;
|
|
15036
15247
|
if (checkMethod) {
|
|
15037
15248
|
tinyItems = matchObj.items.filter(function(item, $rowIndex) {
|
|
@@ -15045,8 +15256,8 @@ function getVItemsOnParentSlctProp(_ref228) {
|
|
|
15045
15256
|
}
|
|
15046
15257
|
return tinyItems;
|
|
15047
15258
|
}
|
|
15048
|
-
function getParentStatusOnParentSlctProp(
|
|
15049
|
-
var indeterminatesItem =
|
|
15259
|
+
function getParentStatusOnParentSlctProp(_ref228) {
|
|
15260
|
+
var indeterminatesItem = _ref228.indeterminatesItem, matchObj = _ref228.matchObj, property = _ref228.property, vItems = _ref228.vItems, value = _ref228.value;
|
|
15050
15261
|
var parentStatus;
|
|
15051
15262
|
if (indeterminatesItem) {
|
|
15052
15263
|
parentStatus = -1;
|
|
@@ -15061,8 +15272,8 @@ function getParentStatusOnParentSlctProp(_ref229) {
|
|
|
15061
15272
|
}
|
|
15062
15273
|
return parentStatus;
|
|
15063
15274
|
}
|
|
15064
|
-
function onHalfSelection(
|
|
15065
|
-
var checkStrictly =
|
|
15275
|
+
function onHalfSelection(_ref229) {
|
|
15276
|
+
var checkStrictly = _ref229.checkStrictly, property = _ref229.property, row2 = _ref229.row, selection = _ref229.selection, treeConfig = _ref229.treeConfig, treeIndeterminates = _ref229.treeIndeterminates, value = _ref229.value;
|
|
15066
15277
|
if (!property && treeConfig && !checkStrictly && value === -1) {
|
|
15067
15278
|
treeIndeterminates.push(row2);
|
|
15068
15279
|
remove(selection, function(item) {
|
|
@@ -15073,8 +15284,8 @@ function onHalfSelection(_ref230) {
|
|
|
15073
15284
|
var addSelection = function addSelection2(selection, item) {
|
|
15074
15285
|
return !selection.includes(item) && selection.push(item);
|
|
15075
15286
|
};
|
|
15076
|
-
function onFullSelection(
|
|
15077
|
-
var checkMethod =
|
|
15287
|
+
function onFullSelection(_ref230) {
|
|
15288
|
+
var checkMethod = _ref230.checkMethod, checkStrictly = _ref230.checkStrictly, property = _ref230.property, row2 = _ref230.row, selection = _ref230.selection, treeConfig = _ref230.treeConfig, treeIndeterminates = _ref230.treeIndeterminates, value = _ref230.value;
|
|
15078
15289
|
if (!property && treeConfig && !checkStrictly && value !== -1) {
|
|
15079
15290
|
eachTree([row2], function(item, $rowIndex) {
|
|
15080
15291
|
if (row2 === item || !checkMethod || checkMethod({
|
|
@@ -15095,8 +15306,8 @@ function onFullSelection(_ref231) {
|
|
|
15095
15306
|
}, treeConfig);
|
|
15096
15307
|
}
|
|
15097
15308
|
}
|
|
15098
|
-
function getParentStatusOnParentSelection(
|
|
15099
|
-
var indeterminatesItem =
|
|
15309
|
+
function getParentStatusOnParentSelection(_ref231) {
|
|
15310
|
+
var indeterminatesItem = _ref231.indeterminatesItem, matchObj = _ref231.matchObj, selection = _ref231.selection, vItems = _ref231.vItems, value = _ref231.value;
|
|
15100
15311
|
var parentStatus;
|
|
15101
15312
|
if (indeterminatesItem) {
|
|
15102
15313
|
parentStatus = -1;
|
|
@@ -15109,8 +15320,8 @@ function getParentStatusOnParentSelection(_ref232) {
|
|
|
15109
15320
|
}
|
|
15110
15321
|
return parentStatus;
|
|
15111
15322
|
}
|
|
15112
|
-
function hasCheckField(
|
|
15113
|
-
var row2 =
|
|
15323
|
+
function hasCheckField(_ref232, value, _vm) {
|
|
15324
|
+
var row2 = _ref232.row;
|
|
15114
15325
|
var tableFullData = _vm.tableFullData, _vm$selectConfig = _vm.selectConfig, selectConfig = _vm$selectConfig === void 0 ? {} : _vm$selectConfig, treeConfig = _vm.treeConfig, treeIndeterminates = _vm.treeIndeterminates;
|
|
15115
15326
|
var property = selectConfig.checkField, checkStrictly = selectConfig.checkStrictly, checkMethod = selectConfig.checkMethod;
|
|
15116
15327
|
onHalfSelectionProperty({
|
|
@@ -15158,8 +15369,8 @@ function hasCheckField(_ref233, value, _vm) {
|
|
|
15158
15369
|
set(row2, property, value);
|
|
15159
15370
|
}
|
|
15160
15371
|
}
|
|
15161
|
-
function onSelectTreeCheckStrictly(
|
|
15162
|
-
var row2 =
|
|
15372
|
+
function onSelectTreeCheckStrictly(_ref233, value, _vm) {
|
|
15373
|
+
var row2 = _ref233.row;
|
|
15163
15374
|
var selection = _vm.selection, tableFullData = _vm.tableFullData, _vm$selectConfig2 = _vm.selectConfig, selectConfig = _vm$selectConfig2 === void 0 ? {} : _vm$selectConfig2, treeConfig = _vm.treeConfig, treeIndeterminates = _vm.treeIndeterminates;
|
|
15164
15375
|
var property = selectConfig.checkField, checkStrictly = selectConfig.checkStrictly, checkMethod = selectConfig.checkMethod;
|
|
15165
15376
|
onHalfSelection({
|
|
@@ -15203,8 +15414,8 @@ function onSelectTreeCheckStrictly(_ref234, value, _vm) {
|
|
|
15203
15414
|
}
|
|
15204
15415
|
}
|
|
15205
15416
|
}
|
|
15206
|
-
function onSelectOther(
|
|
15207
|
-
var row2 =
|
|
15417
|
+
function onSelectOther(_ref234, value, _vm) {
|
|
15418
|
+
var row2 = _ref234.row;
|
|
15208
15419
|
var selection = _vm.selection, _vm$selectConfig3 = _vm.selectConfig, selectConfig = _vm$selectConfig3 === void 0 ? {} : _vm$selectConfig3, treeConfig = _vm.treeConfig;
|
|
15209
15420
|
var property = selectConfig.checkField, checkStrictly = selectConfig.checkStrictly;
|
|
15210
15421
|
if (!property && !(treeConfig && !checkStrictly)) {
|
|
@@ -15217,8 +15428,8 @@ function onSelectOther(_ref235, value, _vm) {
|
|
|
15217
15428
|
}
|
|
15218
15429
|
}
|
|
15219
15430
|
}
|
|
15220
|
-
function hasNoCheckField(
|
|
15221
|
-
var row2 =
|
|
15431
|
+
function hasNoCheckField(_ref235, value, _vm) {
|
|
15432
|
+
var row2 = _ref235.row;
|
|
15222
15433
|
onSelectTreeCheckStrictly({
|
|
15223
15434
|
row: row2
|
|
15224
15435
|
}, value, _vm);
|
|
@@ -15226,8 +15437,8 @@ function hasNoCheckField(_ref236, value, _vm) {
|
|
|
15226
15437
|
row: row2
|
|
15227
15438
|
}, value, _vm);
|
|
15228
15439
|
}
|
|
15229
|
-
function pushSelectRow(
|
|
15230
|
-
var afterFullData =
|
|
15440
|
+
function pushSelectRow(_ref236) {
|
|
15441
|
+
var afterFullData = _ref236.afterFullData, checkMethod = _ref236.checkMethod, checkStrictly = _ref236.checkStrictly; _ref236.property; var selectRows = _ref236.selectRows, selection = _ref236.selection, treeConfig = _ref236.treeConfig, value = _ref236.value;
|
|
15231
15442
|
if (!checkStrictly && value) {
|
|
15232
15443
|
eachTree(afterFullData, function(row2, $rowIndex) {
|
|
15233
15444
|
if (!checkMethod || checkMethod({
|
|
@@ -15249,8 +15460,8 @@ function pushSelectRow(_ref237) {
|
|
|
15249
15460
|
}, treeConfig);
|
|
15250
15461
|
}
|
|
15251
15462
|
}
|
|
15252
|
-
function hasCheckFieldNoStrictly(
|
|
15253
|
-
var afterFullData =
|
|
15463
|
+
function hasCheckFieldNoStrictly(_ref237) {
|
|
15464
|
+
var afterFullData = _ref237.afterFullData, checkMethod = _ref237.checkMethod, checkStrictly = _ref237.checkStrictly, property = _ref237.property, selection = _ref237.selection, treeConfig = _ref237.treeConfig, value = _ref237.value;
|
|
15254
15465
|
if (!checkStrictly && property) {
|
|
15255
15466
|
var indexKey = (treeConfig ? "$" : "") + "rowIndex";
|
|
15256
15467
|
var setValFn = function setValFn2(row2, rowIndex) {
|
|
@@ -15276,8 +15487,8 @@ function hasCheckFieldNoStrictly(_ref238) {
|
|
|
15276
15487
|
}
|
|
15277
15488
|
}
|
|
15278
15489
|
}
|
|
15279
|
-
function filterSelectRow(
|
|
15280
|
-
var afterFullData =
|
|
15490
|
+
function filterSelectRow(_ref238) {
|
|
15491
|
+
var afterFullData = _ref238.afterFullData, checkMethod = _ref238.checkMethod, checkStrictly = _ref238.checkStrictly, selectRows = _ref238.selectRows, selection = _ref238.selection, value = _ref238.value;
|
|
15281
15492
|
if (!checkStrictly && value && checkMethod) {
|
|
15282
15493
|
selectRows = afterFullData.filter(function(row2, rowIndex) {
|
|
15283
15494
|
return selection.includes(row2) || checkMethod({
|
|
@@ -15299,8 +15510,8 @@ function filterSelectRow(_ref239) {
|
|
|
15299
15510
|
}
|
|
15300
15511
|
return selectRows;
|
|
15301
15512
|
}
|
|
15302
|
-
function hasNoCheckFieldNoStrictly(
|
|
15303
|
-
var afterFullData =
|
|
15513
|
+
function hasNoCheckFieldNoStrictly(_ref239) {
|
|
15514
|
+
var afterFullData = _ref239.afterFullData, checkMethod = _ref239.checkMethod, checkStrictly = _ref239.checkStrictly, property = _ref239.property, selection = _ref239.selection, treeConfig = _ref239.treeConfig, value = _ref239.value;
|
|
15304
15515
|
var selectRows = [];
|
|
15305
15516
|
if (treeConfig) {
|
|
15306
15517
|
pushSelectRow({
|
|
@@ -15325,8 +15536,8 @@ function hasNoCheckFieldNoStrictly(_ref240) {
|
|
|
15325
15536
|
}
|
|
15326
15537
|
return selectRows;
|
|
15327
15538
|
}
|
|
15328
|
-
function setSelectionNoStrictly(
|
|
15329
|
-
var _vm =
|
|
15539
|
+
function setSelectionNoStrictly(_ref240) {
|
|
15540
|
+
var _vm = _ref240._vm, checkStrictly = _ref240.checkStrictly, reserve = _ref240.reserve, selectRows = _ref240.selectRows, selection = _ref240.selection, value = _ref240.value, afterFullData = _ref240.afterFullData;
|
|
15330
15541
|
if (!checkStrictly) {
|
|
15331
15542
|
if (reserve) {
|
|
15332
15543
|
var unCheckedRows = afterFullData.filter(function(row2) {
|
|
@@ -15346,7 +15557,7 @@ var Methods$1 = {
|
|
|
15346
15557
|
// 处理默认勾选
|
|
15347
15558
|
handleSelectionDefChecked: function handleSelectionDefChecked() {
|
|
15348
15559
|
var fullDataRowIdData = this.fullDataRowIdData;
|
|
15349
|
-
var
|
|
15560
|
+
var _ref241 = this.selectConfig || {}, checkAll = _ref241.checkAll, checkRowKeys = _ref241.checkRowKeys;
|
|
15350
15561
|
if (checkAll) {
|
|
15351
15562
|
this.setAllSelection(true);
|
|
15352
15563
|
return;
|
|
@@ -15380,8 +15591,8 @@ var Methods$1 = {
|
|
|
15380
15591
|
return this.$nextTick();
|
|
15381
15592
|
},
|
|
15382
15593
|
// 多选,行选中事件。value:选中true、不选false、不确定-1
|
|
15383
|
-
handleSelectRow: function handleSelectRow(
|
|
15384
|
-
var row2 =
|
|
15594
|
+
handleSelectRow: function handleSelectRow(_ref242, value) {
|
|
15595
|
+
var row2 = _ref242.row;
|
|
15385
15596
|
hasCheckField({
|
|
15386
15597
|
row: row2
|
|
15387
15598
|
}, value, this);
|
|
@@ -15392,7 +15603,7 @@ var Methods$1 = {
|
|
|
15392
15603
|
},
|
|
15393
15604
|
handleToggleCheckRowEvent: function handleToggleCheckRowEvent(params, event) {
|
|
15394
15605
|
var selection = this.selection;
|
|
15395
|
-
var
|
|
15606
|
+
var _ref243 = this.selectConfig || {}, checkField = _ref243.checkField;
|
|
15396
15607
|
var row2 = params.row;
|
|
15397
15608
|
var value = checkField ? !get(row2, checkField) : !~selection.indexOf(row2);
|
|
15398
15609
|
if (event) {
|
|
@@ -15460,8 +15671,8 @@ var Methods$1 = {
|
|
|
15460
15671
|
// 根据表格选中状态,给头部复现框赋值状态(全选,半选,未选)
|
|
15461
15672
|
checkSelectionStatus: function checkSelectionStatus() {
|
|
15462
15673
|
var afterFullData = this.afterFullData, selection = this.selection, treeIndeterminates = this.treeIndeterminates;
|
|
15463
|
-
var
|
|
15464
|
-
var
|
|
15674
|
+
var _ref244 = this.selectConfig || {}, checkField = _ref244.checkField, checkMethod = _ref244.checkMethod;
|
|
15675
|
+
var _ref245 = {}, everyHandler = _ref245.everyHandler, someHandler = _ref245.someHandler;
|
|
15465
15676
|
if (checkField) {
|
|
15466
15677
|
everyHandler = checkMethod ? function(row2, rowIndex) {
|
|
15467
15678
|
return !checkMethod({
|
|
@@ -15510,7 +15721,7 @@ var Methods$1 = {
|
|
|
15510
15721
|
// 保留选中状态
|
|
15511
15722
|
reserveCheckSelection: function reserveCheckSelection() {
|
|
15512
15723
|
var fullDataRowIdData = this.fullDataRowIdData, selection = this.selection;
|
|
15513
|
-
var
|
|
15724
|
+
var _ref246 = this.selectConfig || {}, reserve = _ref246.reserve;
|
|
15514
15725
|
var rowkey = getRowkey(this);
|
|
15515
15726
|
if (reserve && selection.length) {
|
|
15516
15727
|
this.selection = selection.map(function(row2) {
|
|
@@ -15538,7 +15749,7 @@ var Methods$1 = {
|
|
|
15538
15749
|
},
|
|
15539
15750
|
clearSelection: function clearSelection() {
|
|
15540
15751
|
var tableFullData = this.tableFullData, treeConfig = this.treeConfig;
|
|
15541
|
-
var
|
|
15752
|
+
var _ref247 = this.selectConfig || {}, checkField = _ref247.checkField;
|
|
15542
15753
|
if (checkField) {
|
|
15543
15754
|
treeConfig ? eachTree(tableFullData, function(item) {
|
|
15544
15755
|
return set(item, checkField, false);
|
|
@@ -15664,9 +15875,9 @@ var Checkbox = {
|
|
|
15664
15875
|
};
|
|
15665
15876
|
var Methods = {
|
|
15666
15877
|
// 展开树节点事件
|
|
15667
|
-
triggerTreeExpandEvent: function triggerTreeExpandEvent(event,
|
|
15878
|
+
triggerTreeExpandEvent: function triggerTreeExpandEvent(event, _ref248) {
|
|
15668
15879
|
var _this83 = this;
|
|
15669
|
-
var row2 =
|
|
15880
|
+
var row2 = _ref248.row;
|
|
15670
15881
|
var currentColumn = this.currentColumn, currentRow = this.currentRow;
|
|
15671
15882
|
var rest = this.toggleTreeExpansion(row2);
|
|
15672
15883
|
var eventParams = {
|
|
@@ -15751,7 +15962,7 @@ var Methods = {
|
|
|
15751
15962
|
var treeExpandedsCopy = [].concat(treeExpandeds);
|
|
15752
15963
|
rows.forEach(function(row2) {
|
|
15753
15964
|
if (row2[children] && row2[children].length) {
|
|
15754
|
-
var
|
|
15965
|
+
var _index9 = treeExpandedsCopy.indexOf(row2);
|
|
15755
15966
|
if (accordion) {
|
|
15756
15967
|
var matchObj = findTree$1(tableFullData, function(item) {
|
|
15757
15968
|
return item === row2;
|
|
@@ -15760,11 +15971,11 @@ var Methods = {
|
|
|
15760
15971
|
return ~matchObj.items.indexOf(item);
|
|
15761
15972
|
});
|
|
15762
15973
|
}
|
|
15763
|
-
if (~
|
|
15764
|
-
treeExpandedsCopy.splice(
|
|
15974
|
+
if (~_index9 && (isToggle || !expanded)) {
|
|
15975
|
+
treeExpandedsCopy.splice(_index9, 1);
|
|
15765
15976
|
return;
|
|
15766
15977
|
}
|
|
15767
|
-
if (!~
|
|
15978
|
+
if (!~_index9 && (isToggle || expanded)) {
|
|
15768
15979
|
treeExpandedsCopy.push(row2);
|
|
15769
15980
|
}
|
|
15770
15981
|
}
|